Built motion from commit (unavailable).|2.0.76
authorAndrea Bianco <andrea.bianco@xcally.com>
Thu, 21 Feb 2019 13:54:37 +0000 (14:54 +0100)
committerAndrea Bianco <andrea.bianco@xcally.com>
Thu, 21 Feb 2019 13:54:37 +0000 (14:54 +0100)
972 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/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/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/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/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/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/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/squareOdbc/index.js
server/api/squareOdbc/squareOdbc.attributes.js
server/api/squareOdbc/squareOdbc.controller.js
server/api/squareOdbc/squareOdbc.model.js
server/api/squareOdbc/squareOdbc.rpc.js
server/api/squareProject/index.js
server/api/squareProject/squareProject.attributes.js
server/api/squareProject/squareProject.controller.js
server/api/squareProject/squareProject.events.js
server/api/squareProject/squareProject.model.js
server/api/squareProject/squareProject.rpc.js
server/api/squareProject/squareProject.socket.js
server/api/squareRecording/index.js
server/api/squareRecording/squareRecording.attributes.js
server/api/squareRecording/squareRecording.controller.js
server/api/squareRecording/squareRecording.model.js
server/api/squareRecording/squareRecording.rpc.js
server/api/squareReport/index.js
server/api/squareReport/squareReport.attributes.js
server/api/squareReport/squareReport.controller.js
server/api/squareReport/squareReport.model.js
server/api/squareReport/squareReport.rpc.js
server/api/squareReportDetail/index.js
server/api/squareReportDetail/squareReportDetail.attributes.js
server/api/squareReportDetail/squareReportDetail.controller.js
server/api/squareReportDetail/squareReportDetail.model.js
server/api/squareReportDetail/squareReportDetail.rpc.js
server/api/system/index.js
server/api/system/system.controller.js
server/api/tag/index.js
server/api/tag/tag.attributes.js
server/api/tag/tag.controller.js
server/api/tag/tag.model.js
server/api/tag/tag.rpc.js
server/api/team/index.js
server/api/team/team.attributes.js
server/api/team/team.controller.js
server/api/team/team.events.js
server/api/team/team.model.js
server/api/team/team.rpc.js
server/api/team/team.socket.js
server/api/template/index.js
server/api/template/template.attributes.js
server/api/template/template.controller.js
server/api/template/template.model.js
server/api/template/template.rpc.js
server/api/trigger/index.js
server/api/trigger/trigger.attributes.js
server/api/trigger/trigger.controller.js
server/api/trigger/trigger.model.js
server/api/trigger/trigger.rpc.js
server/api/trunk/index.js
server/api/trunk/trunk.attributes.js
server/api/trunk/trunk.controller.js
server/api/trunk/trunk.model.js
server/api/trunk/trunk.rpc.js
server/api/user/index.js
server/api/user/user.attributes.js
server/api/user/user.controller.js
server/api/user/user.events.js
server/api/user/user.model.js
server/api/user/user.rpc.js
server/api/user/user.socket.js
server/api/userChatQueue/index.js
server/api/userChatQueue/userChatQueue.attributes.js
server/api/userChatQueue/userChatQueue.model.js
server/api/userChatQueue/userChatQueue.rpc.js
server/api/userFaxQueue/index.js
server/api/userFaxQueue/userFaxQueue.attributes.js
server/api/userFaxQueue/userFaxQueue.model.js
server/api/userFaxQueue/userFaxQueue.rpc.js
server/api/userMailQueue/index.js
server/api/userMailQueue/userMailQueue.attributes.js
server/api/userMailQueue/userMailQueue.model.js
server/api/userMailQueue/userMailQueue.rpc.js
server/api/userOpenchannelQueue/index.js
server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
server/api/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/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/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/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/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/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/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/faxAccount.js
server/services/ami/model/freshdeskAccount.js
server/services/ami/model/queueReport.js
server/services/ami/model/salesforceAccount.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/freshdesk.js
server/services/ami/rpc/integrations/salesforce.js
server/services/ami/rpc/integrations/sugarcrm.js
server/services/ami/rpc/integrations/vtiger.js
server/services/ami/rpc/integrations/zendesk.js
server/services/ami/rpc/integrations/zoho.js
server/services/ami/rpc/memberReport.js
server/services/ami/rpc/template.js
server/services/ami/rpc/trigger.js
server/services/ami/rpc/trunk.js
server/services/ami/rpc/user.js
server/services/ami/rpc/voiceAgentReport.js
server/services/ami/rpc/voiceCallReport.js
server/services/ami/rpc/voiceDialReport.js
server/services/ami/rpc/voiceExtension.js
server/services/ami/rpc/voiceQueue.js
server/services/ami/rpc/voiceQueueReport.js
server/services/ami/rpc/voiceQueueRt.js
server/services/ami/rpc/voiceRecording.js
server/services/ami/rpc/voiceTransferReport.js
server/services/ami/server/index.js
server/services/ami/trigger/cmContact/index.js
server/services/ami/trigger/index.js
server/services/ami/trigger/integration/desk.js
server/services/ami/trigger/integration/freshdesk.js
server/services/ami/trigger/integration/index.js
server/services/ami/trigger/integration/salesforce.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/urlforward/index.js
server/services/email/client.js
server/services/email/index.js
server/services/email/lib/email.js
server/services/email/lib/imap.js
server/services/email/lib/smtp.js
server/services/email/lib/utils.js
server/services/email/model/mailAccount.js
server/services/email/realtime/index.js
server/services/email/rpc/mailAccount.js
server/services/email/server/index.js
server/services/express/index.js
server/services/routing/client.js
server/services/routing/index.js
server/services/routing/lib/rule-engine.js
server/services/routing/mailRpc/index.js
server/services/routing/model/agent.js
server/services/routing/model/chatQueue.js
server/services/routing/model/faxQueue.js
server/services/routing/model/interval.js
server/services/routing/model/mailQueue.js
server/services/routing/model/openchannelQueue.js
server/services/routing/model/smsQueue.js
server/services/routing/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/server/applications/agent.js
server/services/routing/server/applications/autoreply.js
server/services/routing/server/applications/close.js
server/services/routing/server/applications/dialogflow.js
server/services/routing/server/applications/gotoif.js
server/services/routing/server/applications/gotop.js
server/services/routing/server/applications/message.js
server/services/routing/server/applications/noop.js
server/services/routing/server/applications/queue.js
server/services/routing/server/applications/strategy/agent.js
server/services/routing/server/applications/strategy/beepall.js
server/services/routing/server/applications/strategy/index.js
server/services/routing/server/applications/strategy/rrmemory.js
server/services/routing/server/applications/strategy/util.js
server/services/routing/server/applications/system.js
server/services/routing/server/applications/tag.js
server/services/routing/server/applications/utils.js
server/services/routing/server/index.js
server/services/routing/server/interval.js

index 5333eca..3c84718 100644 (file)
@@ -1 +1 @@
-define({\r  "name": "xCALLY Motion API",\r  "version": "2.0.76",\r  "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",\r  "title": "xCALLY MOTION API",\r  "header": {\r    "title": "Introduction",\r    "content": "<h2>The API</h2>\n<p>This is the documentation for the xCALLY MOTION API.</p>\n<p>We make changes to the APIs from time to time. For more information, see <a href=\"https://wiki.xcallymotion.com/display/XMV/Motion+GUI\">Changelog</a>.</p>\n<p>The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.</p>\n<p>The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].</p>\n<p>Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:</p>\n<pre><code class=\"language-sh\">GET /api/users\n</code></pre>\n<p>Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:</p>\n<pre><code class=\"language-sh\">https://motion.xcally.com/api/users\n</code></pre>\n<p>Curly braces, <code>{}</code>, indicate values you have to supply. Example:</p>\n<pre><code class=\"language-sh\">GET  /api/users/{id}\n</code></pre>\n<p>The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].</p>\n<p>The examples use basic authentication requiring a xCALLY username and password.</p>\n<h2>Security and Authentication</h2>\n<p>This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token.</p>\n<p>Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or a xCALLY API token.</p>\n<h3>Basic authentication</h3>\n<p>Use the following authentication format with your username and password:\n<code>{username}:{password}</code></p>\n<p>Example:</p>\n<pre><code class=\"language-sh\">curl -u admin:password https://motion.xcally.com/api/users\n</code></pre>\n<h3>OAuth access token</h3>\n<p>The xCALLY API supports OAuth authorization flows.</p>\n<p>OAuth access tokens also permit client-side API requests.</p>\n<p>In your requests, specify the access token in an Authorization header as follows:\n<code>Authorization: Bearer {token}</code></p>\n<p>Example:</p>\n<pre><code class=\"language-sh\">curl -H &quot;Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo&quot; https://motion.xcally.com/api/users\n</code></pre>\n<h2>Request Format</h2>\n<p>The xCALLY API is a JSON API. You must supply a <code>Content-Type: application/json</code> header in <code>PUT</code> and <code>POST</code> requests. You must set an <code>Accept: application/json</code> header on all requests. You may get a <code>text/plain</code> response in case of an error like a bad request. You should treat this as an error you need to fix.</p>\n<h2>Response Format</h2>\n<p>The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.</p>\n<p>Responses may have the status codes described in the following sections.</p>\n<h3>200 range</h3>\n<p>The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.</p>\n<h3>400 range</h3>\n<p>The request was not successful. The content type of the response may be <code>text/plain</code> for API-level error messages, such as when trying to call the API without SSL. The content type is <code>application/json</code> for business-level error messages because the response includes a JSON object with information about the error.</p>\n<p>If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.</p>\n<h3>500 range</h3>\n<p>When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.</p>\n<p>If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.</p>\n<h2>Data Types</h2>\n<p>The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.</p>\n<h2>ID integers</h2>\n<p>Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.</p>\n<p>The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.</p>\n<h2>Time stamps</h2>\n<p>Time stamps use UTC time and are formatted as ISO 8601 strings. Example: <code>2017-04-16T09:14:57Z</code></p>\n"\r  },\r  "template": {\r    "withGenerator": false,\r    "withCompare": false,\r    "forceLanguage": "en"\r  },\r  "sampleUrl": false,\r  "defaultVersion": "0.0.0",\r  "apidoc": "0.3.0",\r  "generator": {\r    "name": "apidoc",\r    "time": "2019-02-21T13:22:09.731Z",\r    "url": "http://apidocjs.com",\r    "version": "0.17.7"\r  }\r});
+define({\r  "name": "xCALLY Motion API",\r  "version": "2.0.76",\r  "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",\r  "title": "xCALLY MOTION API",\r  "header": {\r    "title": "Introduction",\r    "content": "<h2>The API</h2>\n<p>This is the documentation for the xCALLY MOTION API.</p>\n<p>We make changes to the APIs from time to time. For more information, see <a href=\"https://wiki.xcallymotion.com/display/XMV/Motion+GUI\">Changelog</a>.</p>\n<p>The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.</p>\n<p>The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].</p>\n<p>Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:</p>\n<pre><code class=\"language-sh\">GET /api/users\n</code></pre>\n<p>Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:</p>\n<pre><code class=\"language-sh\">https://motion.xcally.com/api/users\n</code></pre>\n<p>Curly braces, <code>{}</code>, indicate values you have to supply. Example:</p>\n<pre><code class=\"language-sh\">GET  /api/users/{id}\n</code></pre>\n<p>The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].</p>\n<p>The examples use basic authentication requiring a xCALLY username and password.</p>\n<h2>Security and Authentication</h2>\n<p>This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token.</p>\n<p>Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or a xCALLY API token.</p>\n<h3>Basic authentication</h3>\n<p>Use the following authentication format with your username and password:\n<code>{username}:{password}</code></p>\n<p>Example:</p>\n<pre><code class=\"language-sh\">curl -u admin:password https://motion.xcally.com/api/users\n</code></pre>\n<h3>OAuth access token</h3>\n<p>The xCALLY API supports OAuth authorization flows.</p>\n<p>OAuth access tokens also permit client-side API requests.</p>\n<p>In your requests, specify the access token in an Authorization header as follows:\n<code>Authorization: Bearer {token}</code></p>\n<p>Example:</p>\n<pre><code class=\"language-sh\">curl -H &quot;Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo&quot; https://motion.xcally.com/api/users\n</code></pre>\n<h2>Request Format</h2>\n<p>The xCALLY API is a JSON API. You must supply a <code>Content-Type: application/json</code> header in <code>PUT</code> and <code>POST</code> requests. You must set an <code>Accept: application/json</code> header on all requests. You may get a <code>text/plain</code> response in case of an error like a bad request. You should treat this as an error you need to fix.</p>\n<h2>Response Format</h2>\n<p>The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.</p>\n<p>Responses may have the status codes described in the following sections.</p>\n<h3>200 range</h3>\n<p>The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.</p>\n<h3>400 range</h3>\n<p>The request was not successful. The content type of the response may be <code>text/plain</code> for API-level error messages, such as when trying to call the API without SSL. The content type is <code>application/json</code> for business-level error messages because the response includes a JSON object with information about the error.</p>\n<p>If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.</p>\n<h3>500 range</h3>\n<p>When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.</p>\n<p>If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.</p>\n<h2>Data Types</h2>\n<p>The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.</p>\n<h2>ID integers</h2>\n<p>Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.</p>\n<p>The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.</p>\n<h2>Time stamps</h2>\n<p>Time stamps use UTC time and are formatted as ISO 8601 strings. Example: <code>2017-04-16T09:14:57Z</code></p>\n"\r  },\r  "template": {\r    "withGenerator": false,\r    "withCompare": false,\r    "forceLanguage": "en"\r  },\r  "sampleUrl": false,\r  "defaultVersion": "0.0.0",\r  "apidoc": "0.3.0",\r  "generator": {\r    "name": "apidoc",\r    "time": "2019-02-21T13:47:58.550Z",\r    "url": "http://apidocjs.com",\r    "version": "0.17.7"\r  }\r});
index 91ae684..b0aebf4 100644 (file)
@@ -1 +1 @@
-{\r  "name": "xCALLY Motion API",\r  "version": "2.0.76",\r  "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",\r  "title": "xCALLY MOTION API",\r  "header": {\r    "title": "Introduction",\r    "content": "<h2>The API</h2>\n<p>This is the documentation for the xCALLY MOTION API.</p>\n<p>We make changes to the APIs from time to time. For more information, see <a href=\"https://wiki.xcallymotion.com/display/XMV/Motion+GUI\">Changelog</a>.</p>\n<p>The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.</p>\n<p>The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].</p>\n<p>Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:</p>\n<pre><code class=\"language-sh\">GET /api/users\n</code></pre>\n<p>Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:</p>\n<pre><code class=\"language-sh\">https://motion.xcally.com/api/users\n</code></pre>\n<p>Curly braces, <code>{}</code>, indicate values you have to supply. Example:</p>\n<pre><code class=\"language-sh\">GET  /api/users/{id}\n</code></pre>\n<p>The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].</p>\n<p>The examples use basic authentication requiring a xCALLY username and password.</p>\n<h2>Security and Authentication</h2>\n<p>This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token.</p>\n<p>Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or a xCALLY API token.</p>\n<h3>Basic authentication</h3>\n<p>Use the following authentication format with your username and password:\n<code>{username}:{password}</code></p>\n<p>Example:</p>\n<pre><code class=\"language-sh\">curl -u admin:password https://motion.xcally.com/api/users\n</code></pre>\n<h3>OAuth access token</h3>\n<p>The xCALLY API supports OAuth authorization flows.</p>\n<p>OAuth access tokens also permit client-side API requests.</p>\n<p>In your requests, specify the access token in an Authorization header as follows:\n<code>Authorization: Bearer {token}</code></p>\n<p>Example:</p>\n<pre><code class=\"language-sh\">curl -H &quot;Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo&quot; https://motion.xcally.com/api/users\n</code></pre>\n<h2>Request Format</h2>\n<p>The xCALLY API is a JSON API. You must supply a <code>Content-Type: application/json</code> header in <code>PUT</code> and <code>POST</code> requests. You must set an <code>Accept: application/json</code> header on all requests. You may get a <code>text/plain</code> response in case of an error like a bad request. You should treat this as an error you need to fix.</p>\n<h2>Response Format</h2>\n<p>The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.</p>\n<p>Responses may have the status codes described in the following sections.</p>\n<h3>200 range</h3>\n<p>The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.</p>\n<h3>400 range</h3>\n<p>The request was not successful. The content type of the response may be <code>text/plain</code> for API-level error messages, such as when trying to call the API without SSL. The content type is <code>application/json</code> for business-level error messages because the response includes a JSON object with information about the error.</p>\n<p>If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.</p>\n<h3>500 range</h3>\n<p>When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.</p>\n<p>If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.</p>\n<h2>Data Types</h2>\n<p>The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.</p>\n<h2>ID integers</h2>\n<p>Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.</p>\n<p>The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.</p>\n<h2>Time stamps</h2>\n<p>Time stamps use UTC time and are formatted as ISO 8601 strings. Example: <code>2017-04-16T09:14:57Z</code></p>\n"\r  },\r  "template": {\r    "withGenerator": false,\r    "withCompare": false,\r    "forceLanguage": "en"\r  },\r  "sampleUrl": false,\r  "defaultVersion": "0.0.0",\r  "apidoc": "0.3.0",\r  "generator": {\r    "name": "apidoc",\r    "time": "2019-02-21T13:22:09.731Z",\r    "url": "http://apidocjs.com",\r    "version": "0.17.7"\r  }\r}
+{\r  "name": "xCALLY Motion API",\r  "version": "2.0.76",\r  "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",\r  "title": "xCALLY MOTION API",\r  "header": {\r    "title": "Introduction",\r    "content": "<h2>The API</h2>\n<p>This is the documentation for the xCALLY MOTION API.</p>\n<p>We make changes to the APIs from time to time. For more information, see <a href=\"https://wiki.xcallymotion.com/display/XMV/Motion+GUI\">Changelog</a>.</p>\n<p>The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.</p>\n<p>The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].</p>\n<p>Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:</p>\n<pre><code class=\"language-sh\">GET /api/users\n</code></pre>\n<p>Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:</p>\n<pre><code class=\"language-sh\">https://motion.xcally.com/api/users\n</code></pre>\n<p>Curly braces, <code>{}</code>, indicate values you have to supply. Example:</p>\n<pre><code class=\"language-sh\">GET  /api/users/{id}\n</code></pre>\n<p>The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].</p>\n<p>The examples use basic authentication requiring a xCALLY username and password.</p>\n<h2>Security and Authentication</h2>\n<p>This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token.</p>\n<p>Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or a xCALLY API token.</p>\n<h3>Basic authentication</h3>\n<p>Use the following authentication format with your username and password:\n<code>{username}:{password}</code></p>\n<p>Example:</p>\n<pre><code class=\"language-sh\">curl -u admin:password https://motion.xcally.com/api/users\n</code></pre>\n<h3>OAuth access token</h3>\n<p>The xCALLY API supports OAuth authorization flows.</p>\n<p>OAuth access tokens also permit client-side API requests.</p>\n<p>In your requests, specify the access token in an Authorization header as follows:\n<code>Authorization: Bearer {token}</code></p>\n<p>Example:</p>\n<pre><code class=\"language-sh\">curl -H &quot;Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo&quot; https://motion.xcally.com/api/users\n</code></pre>\n<h2>Request Format</h2>\n<p>The xCALLY API is a JSON API. You must supply a <code>Content-Type: application/json</code> header in <code>PUT</code> and <code>POST</code> requests. You must set an <code>Accept: application/json</code> header on all requests. You may get a <code>text/plain</code> response in case of an error like a bad request. You should treat this as an error you need to fix.</p>\n<h2>Response Format</h2>\n<p>The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.</p>\n<p>Responses may have the status codes described in the following sections.</p>\n<h3>200 range</h3>\n<p>The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.</p>\n<h3>400 range</h3>\n<p>The request was not successful. The content type of the response may be <code>text/plain</code> for API-level error messages, such as when trying to call the API without SSL. The content type is <code>application/json</code> for business-level error messages because the response includes a JSON object with information about the error.</p>\n<p>If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.</p>\n<h3>500 range</h3>\n<p>When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.</p>\n<p>If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.</p>\n<h2>Data Types</h2>\n<p>The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.</p>\n<h2>ID integers</h2>\n<p>Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.</p>\n<p>The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.</p>\n<h2>Time stamps</h2>\n<p>Time stamps use UTC time and are formatted as ISO 8601 strings. Example: <code>2017-04-16T09:14:57Z</code></p>\n"\r  },\r  "template": {\r    "withGenerator": false,\r    "withCompare": false,\r    "forceLanguage": "en"\r  },\r  "sampleUrl": false,\r  "defaultVersion": "0.0.0",\r  "apidoc": "0.3.0",\r  "generator": {\r    "name": "apidoc",\r    "time": "2019-02-21T13:47:58.550Z",\r    "url": "http://apidocjs.com",\r    "version": "0.17.7"\r  }\r}
index 0b77c5a..e2c721c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd772=['motionbar[NULL,NULL,WinAppArguments]','exports','VIRTUAL','getDataValue','action','contactManager','motionbar','urlForward','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser','STRING','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'];(function(_0x8baabf,_0x494023){var _0x7b312c=function(_0x3faf12){while(--_0x3faf12){_0x8baabf['push'](_0x8baabf['shift']());}};_0x7b312c(++_0x494023);}(_0xd772,0x139));var _0x2d77=function(_0x16f503,_0xba7c0c){_0x16f503=_0x16f503-0x0;var _0x5e5035=_0xd772[_0x16f503];return _0x5e5035;};'use strict';var Sequelize=require('sequelize');module[_0x2d77('0x0')]={'name':{'type':Sequelize[_0x2d77('0x1')],'get':function(_0x4b4f8e){return this[_0x2d77('0x2')](_0x2d77('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x2d77('0x4'),'integration',_0x2d77('0x5'),'jscripty',_0x2d77('0x6'),'browser']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser'}},'comment':_0x2d77('0x7')},'data1':{'type':Sequelize[_0x2d77('0x8')](0x1000),'comment':_0x2d77('0x9')},'data2':{'type':Sequelize[_0x2d77('0x8')](0x1000),'comment':_0x2d77('0xa')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x2d77('0xb')},'data4':{'type':Sequelize[_0x2d77('0x8')](0x1000)},'data5':{'type':Sequelize[_0x2d77('0x8')](0x1000)},'data6':{'type':Sequelize[_0x2d77('0x8')]},'data7':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x603b=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward'];(function(_0x4861a2,_0x1957cd){var _0xadde3e=function(_0x225a24){while(--_0x225a24){_0x4861a2['push'](_0x4861a2['shift']());}};_0xadde3e(++_0x1957cd);}(_0x603b,0xe3));var _0xb603=function(_0x4940f7,_0x55d307){_0x4940f7=_0x4940f7-0x0;var _0x38770b=_0x603b[_0x4940f7];return _0x38770b;};'use strict';var Sequelize=require(_0xb603('0x0'));module[_0xb603('0x1')]={'name':{'type':Sequelize[_0xb603('0x2')],'get':function(_0x574d9d){return this[_0xb603('0x3')](_0xb603('0x4'));}},'action':{'type':Sequelize[_0xb603('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xb603('0x6'),_0xb603('0x7'),_0xb603('0x8'),_0xb603('0x9'),_0xb603('0xa'),'browser']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser'}},'comment':_0xb603('0xb')},'data1':{'type':Sequelize[_0xb603('0x5')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xb603('0xc')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0xb603('0x5')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0xb603('0xd')]}};
\ No newline at end of file
index ccd6d7d..0c1e15a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['params','catch','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','Content-Range','save','then','sendStatus','name','send','update','body','Action','find'];(function(_0x4d1e52,_0x33c900){var _0x15202a=function(_0x3779cf){while(--_0x3779cf){_0x4d1e52['push'](_0x4d1e52['shift']());}};_0x15202a(++_0x33c900);}(_0xf494,0x1c6));var _0x4f49=function(_0x28426f,_0x3991d3){_0x28426f=_0x28426f-0x0;var _0x58d6d3=_0xf494[_0x28426f];return _0x58d6d3;};'use strict';var pdf=require(_0x4f49('0x0'));var emlformat=require(_0x4f49('0x1'));var rimraf=require(_0x4f49('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f49('0x3'));var rp=require(_0x4f49('0x4'));var moment=require(_0x4f49('0x5'));var BPromise=require(_0x4f49('0x6'));var Mustache=require(_0x4f49('0x7'));var util=require(_0x4f49('0x8'));var path=require(_0x4f49('0x9'));var sox=require(_0x4f49('0xa'));var csv=require(_0x4f49('0xb'));var ejs=require(_0x4f49('0xc'));var fs=require('fs');var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xb'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var qs=require(_0x4f49('0x12'));var logger=require(_0x4f49('0x13'))(_0x4f49('0x14'));var utils=require('../../config/utils');var config=require(_0x4f49('0x15'));var db=require(_0x4f49('0x16'))['db'];function respondWithStatusCode(_0x5bcfe5,_0x15e7a1){_0x15e7a1=_0x15e7a1||0xcc;return function(_0x5bbc75){if(_0x5bbc75){return _0x5bcfe5['sendStatus'](_0x15e7a1);}return _0x5bcfe5[_0x4f49('0x17')](_0x15e7a1)[_0x4f49('0x18')]();};}function respondWithResult(_0x4bf89f,_0x1e1c37){_0x1e1c37=_0x1e1c37||0xc8;return function(_0x111a8b){if(_0x111a8b){return _0x4bf89f[_0x4f49('0x17')](_0x1e1c37)[_0x4f49('0x19')](_0x111a8b);}};}function respondWithFilteredResult(_0x1a0f1e,_0x2f0131){return function(_0xfdb477){if(_0xfdb477){var _0x5c373e=_0xfdb477['count'],_0x515ace=_0x2f0131['offset'],_0x1f2d0d=_0x2f0131[_0x4f49('0x1a')]+_0x2f0131[_0x4f49('0x1b')],_0x415e83;if(_0x1f2d0d>=_0x5c373e){_0x1f2d0d=_0x5c373e;_0x415e83=0xc8;}else{_0x415e83=0xce;}_0x1a0f1e[_0x4f49('0x17')](_0x415e83);return _0x1a0f1e['set'](_0x4f49('0x1c'),_0x515ace+'-'+_0x1f2d0d+'/'+_0x5c373e)[_0x4f49('0x19')](_0xfdb477);}return null;};}function patchUpdates(_0x4e85df){return function(_0x49cdaf){try{jsonpatch['apply'](_0x49cdaf,_0x4e85df,!![]);}catch(_0x560592){return BPromise['reject'](_0x560592);}return _0x49cdaf[_0x4f49('0x1d')]();};}function saveUpdates(_0x1834f4,_0x1c2d70){return function(_0x407042){if(_0x407042){return _0x407042['update'](_0x1834f4)[_0x4f49('0x1e')](function(_0x2aed27){return _0x2aed27;});}return null;};}function removeEntity(_0x197a49,_0xaab5e7){return function(_0xea82f8){if(_0xea82f8){return _0xea82f8['destroy']()[_0x4f49('0x1e')](function(){_0x197a49[_0x4f49('0x17')](0xcc)[_0x4f49('0x18')]();});}};}function handleEntityNotFound(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(!_0x1d70a7){_0x53b57d[_0x4f49('0x1f')](0x194);}return _0x1d70a7;};}function handleError(_0x43c458,_0x9d30aa){_0x9d30aa=_0x9d30aa||0x1f4;return function(_0x36187b){logger['error'](_0x36187b['stack']);if(_0x36187b[_0x4f49('0x20')]){delete _0x36187b[_0x4f49('0x20')];}_0x43c458['status'](_0x9d30aa)[_0x4f49('0x21')](_0x36187b);};}exports[_0x4f49('0x22')]=function(_0x35f8e0,_0x525950){if(_0x35f8e0[_0x4f49('0x23')]['id']){delete _0x35f8e0[_0x4f49('0x23')]['id'];}return db[_0x4f49('0x24')][_0x4f49('0x25')]({'where':{'id':_0x35f8e0[_0x4f49('0x26')]['id']}})[_0x4f49('0x1e')](handleEntityNotFound(_0x525950,null))['then'](saveUpdates(_0x35f8e0['body'],null))[_0x4f49('0x1e')](respondWithResult(_0x525950,null))[_0x4f49('0x27')](handleError(_0x525950,null));};exports[_0x4f49('0x28')]=function(_0x560050,_0x3cbfbd){return db[_0x4f49('0x24')][_0x4f49('0x25')]({'where':{'id':_0x560050['params']['id']}})['then'](handleEntityNotFound(_0x3cbfbd,null))[_0x4f49('0x1e')](removeEntity(_0x3cbfbd,null))[_0x4f49('0x27')](handleError(_0x3cbfbd,null));};
\ No newline at end of file
+var _0x885a=['fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','then','destroy','stack','name','update','body','Action','find','params','catch','eml-format','rimraf','zip-dir'];(function(_0x1f5887,_0x2fa1f1){var _0x21774b=function(_0x48a7e5){while(--_0x48a7e5){_0x1f5887['push'](_0x1f5887['shift']());}};_0x21774b(++_0x2fa1f1);}(_0x885a,0x180));var _0xa885=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x885a[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa885('0x0'));var rimraf=require(_0xa885('0x1'));var zipdir=require(_0xa885('0x2'));var jsonpatch=require(_0xa885('0x3'));var rp=require('request-promise');var moment=require(_0xa885('0x4'));var BPromise=require(_0xa885('0x5'));var Mustache=require(_0xa885('0x6'));var util=require(_0xa885('0x7'));var path=require(_0xa885('0x8'));var sox=require(_0xa885('0x9'));var csv=require('to-csv');var ejs=require(_0xa885('0xa'));var fs=require('fs');var _=require(_0xa885('0xb'));var squel=require(_0xa885('0xc'));var crypto=require('crypto');var jsforce=require(_0xa885('0xd'));var deskjs=require(_0xa885('0xe'));var toCsv=require(_0xa885('0xf'));var querystring=require('querystring');var Papa=require(_0xa885('0x10'));var qs=require(_0xa885('0x11'));var logger=require(_0xa885('0x12'))(_0xa885('0x13'));var utils=require(_0xa885('0x14'));var config=require(_0xa885('0x15'));var db=require(_0xa885('0x16'))['db'];function respondWithStatusCode(_0x571c0d,_0x8a82f5){_0x8a82f5=_0x8a82f5||0xcc;return function(_0x18af5f){if(_0x18af5f){return _0x571c0d[_0xa885('0x17')](_0x8a82f5);}return _0x571c0d[_0xa885('0x18')](_0x8a82f5)[_0xa885('0x19')]();};}function respondWithResult(_0x3e9c7a,_0x4585d9){_0x4585d9=_0x4585d9||0xc8;return function(_0x574eb8){if(_0x574eb8){return _0x3e9c7a[_0xa885('0x18')](_0x4585d9)[_0xa885('0x1a')](_0x574eb8);}};}function respondWithFilteredResult(_0x27b24a,_0x12d81c){return function(_0x33ce2e){if(_0x33ce2e){var _0x5bdb0c=_0x33ce2e[_0xa885('0x1b')],_0x1c9687=_0x12d81c[_0xa885('0x1c')],_0x2ca5c5=_0x12d81c['offset']+_0x12d81c[_0xa885('0x1d')],_0x5296e6;if(_0x2ca5c5>=_0x5bdb0c){_0x2ca5c5=_0x5bdb0c;_0x5296e6=0xc8;}else{_0x5296e6=0xce;}_0x27b24a[_0xa885('0x18')](_0x5296e6);return _0x27b24a['set'](_0xa885('0x1e'),_0x1c9687+'-'+_0x2ca5c5+'/'+_0x5bdb0c)['json'](_0x33ce2e);}return null;};}function patchUpdates(_0x2e9290){return function(_0x3960ea){try{jsonpatch[_0xa885('0x1f')](_0x3960ea,_0x2e9290,!![]);}catch(_0x4e4d51){return BPromise[_0xa885('0x20')](_0x4e4d51);}return _0x3960ea['save']();};}function saveUpdates(_0x127a86,_0x1d5d0b){return function(_0x113043){if(_0x113043){return _0x113043['update'](_0x127a86)[_0xa885('0x21')](function(_0x32b8df){return _0x32b8df;});}return null;};}function removeEntity(_0x1530b6,_0x4de770){return function(_0x273988){if(_0x273988){return _0x273988[_0xa885('0x22')]()[_0xa885('0x21')](function(){_0x1530b6['status'](0xcc)[_0xa885('0x19')]();});}};}function handleEntityNotFound(_0x582b59,_0x20ec96){return function(_0x299553){if(!_0x299553){_0x582b59['sendStatus'](0x194);}return _0x299553;};}function handleError(_0x1d94c1,_0x190a57){_0x190a57=_0x190a57||0x1f4;return function(_0x21c98c){logger['error'](_0x21c98c[_0xa885('0x23')]);if(_0x21c98c[_0xa885('0x24')]){delete _0x21c98c['name'];}_0x1d94c1[_0xa885('0x18')](_0x190a57)['send'](_0x21c98c);};}exports[_0xa885('0x25')]=function(_0x526ba9,_0x1a28d6){if(_0x526ba9[_0xa885('0x26')]['id']){delete _0x526ba9[_0xa885('0x26')]['id'];}return db[_0xa885('0x27')][_0xa885('0x28')]({'where':{'id':_0x526ba9[_0xa885('0x29')]['id']}})[_0xa885('0x21')](handleEntityNotFound(_0x1a28d6,null))[_0xa885('0x21')](saveUpdates(_0x526ba9['body'],null))['then'](respondWithResult(_0x1a28d6,null))['catch'](handleError(_0x1a28d6,null));};exports['destroy']=function(_0x1c94ab,_0x3e9e22){return db[_0xa885('0x27')][_0xa885('0x28')]({'where':{'id':_0x1c94ab[_0xa885('0x29')]['id']}})[_0xa885('0x21')](handleEntityNotFound(_0x3e9e22,null))['then'](removeEntity(_0x3e9e22,null))[_0xa885('0x2a')](handleError(_0x3e9e22,null));};
\ No newline at end of file
index 9afae29..369dfb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c87=['api','bluebird','request-promise','./action.attributes','exports','tools_actions','lodash','util','../../config/logger'];(function(_0x9fb389,_0x3cb976){var _0x208a14=function(_0x25be27){while(--_0x25be27){_0x9fb389['push'](_0x9fb389['shift']());}};_0x208a14(++_0x3cb976);}(_0x6c87,0x96));var _0x76c8=function(_0x6f829e,_0x641c25){_0x6f829e=_0x6f829e-0x0;var _0x2491ac=_0x6c87[_0x6f829e];return _0x2491ac;};'use strict';var _=require(_0x76c8('0x0'));var util=require(_0x76c8('0x1'));var logger=require(_0x76c8('0x2'))(_0x76c8('0x3'));var moment=require('moment');var BPromise=require(_0x76c8('0x4'));var rp=require(_0x76c8('0x5'));var attributes=require(_0x76c8('0x6'));module[_0x76c8('0x7')]=function(_0x3e9493,_0x35cc3a){return _0x3e9493['define']('Action',attributes,{'tableName':_0x76c8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0d51=['moment','bluebird','./action.attributes','exports','define','Action','lodash','util','../../config/logger','api'];(function(_0x5980e1,_0x1f36dd){var _0x248d42=function(_0xa53f0e){while(--_0xa53f0e){_0x5980e1['push'](_0x5980e1['shift']());}};_0x248d42(++_0x1f36dd);}(_0x0d51,0x146));var _0x10d5=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0x0d51[_0x3bab09];return _0x164376;};'use strict';var _=require(_0x10d5('0x0'));var util=require(_0x10d5('0x1'));var logger=require(_0x10d5('0x2'))(_0x10d5('0x3'));var moment=require(_0x10d5('0x4'));var BPromise=require(_0x10d5('0x5'));var rp=require('request-promise');var attributes=require(_0x10d5('0x6'));module[_0x10d5('0x7')]=function(_0x40e918,_0x211cd8){return _0x40e918[_0x10d5('0x8')](_0x10d5('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8462bf1..d410c71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x387c=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','Action,\x20%s,\x20%s','message','info','result','catch','util'];(function(_0x268542,_0xc688c7){var _0x2b54af=function(_0x225c34){while(--_0x225c34){_0x268542['push'](_0x268542['shift']());}};_0x2b54af(++_0xc688c7);}(_0x387c,0xaf));var _0xc387=function(_0x128450,_0x5869ba){_0x128450=_0x128450-0x0;var _0x4d80ed=_0x387c[_0x128450];return _0x4d80ed;};'use strict';var _=require('lodash');var util=require(_0xc387('0x0'));var moment=require(_0xc387('0x1'));var BPromise=require(_0xc387('0x2'));var rs=require(_0xc387('0x3'));var fs=require('fs');var db=require(_0xc387('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc387('0x5'))(_0xc387('0x6'));var config=require(_0xc387('0x7'));var jayson=require(_0xc387('0x8'));var client=jayson['client'][_0xc387('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cbaed,_0x424dd4,_0x277022){return new BPromise(function(_0x50ff93,_0x51491e){return client[_0xc387('0xa')](_0x5cbaed,_0x277022)[_0xc387('0xb')](function(_0x526c59){logger['info']('Action,\x20%s,\x20%s',_0x424dd4,_0xc387('0xc'));logger['debug'](_0xc387('0xd'),_0x424dd4,_0xc387('0xc'),JSON[_0xc387('0xe')](_0x526c59));if(_0x526c59[_0xc387('0xf')]){if(_0x526c59[_0xc387('0xf')][_0xc387('0x10')]===0x1f4){logger[_0xc387('0xf')](_0xc387('0x11'),_0x424dd4,_0x526c59['error'][_0xc387('0x12')]);return _0x51491e(_0x526c59['error'][_0xc387('0x12')]);}logger[_0xc387('0xf')](_0xc387('0x11'),_0x424dd4,_0x526c59['error']['message']);return _0x50ff93(_0x526c59[_0xc387('0xf')]['message']);}else{logger[_0xc387('0x13')](_0xc387('0x11'),_0x424dd4,_0xc387('0xc'));_0x50ff93(_0x526c59[_0xc387('0x14')][_0xc387('0x12')]);}})[_0xc387('0x15')](function(_0xcba16c){logger['error'](_0xc387('0x11'),_0x424dd4,_0xcba16c);_0x51491e(_0xcba16c);});});}
\ No newline at end of file
+var _0x76e0=['Action,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Action,\x20%s,\x20%s','catch','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','debug'];(function(_0x4ec4f4,_0xdbef42){var _0x54649d=function(_0x5b759e){while(--_0x5b759e){_0x4ec4f4['push'](_0x4ec4f4['shift']());}};_0x54649d(++_0xdbef42);}(_0x76e0,0x6e));var _0x076e=function(_0x3c3a07,_0x31b163){_0x3c3a07=_0x3c3a07-0x0;var _0x44e6d4=_0x76e0[_0x3c3a07];return _0x44e6d4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x076e('0x0'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x076e('0x1'));var logger=require(_0x076e('0x2'))('rpc');var config=require(_0x076e('0x3'));var jayson=require(_0x076e('0x4'));var client=jayson[_0x076e('0x5')][_0x076e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x70551c,_0x590561,_0x4ec074){return new BPromise(function(_0x219c91,_0x15f58c){return client[_0x076e('0x7')](_0x70551c,_0x4ec074)['then'](function(_0x49ab28){logger['info']('Action,\x20%s,\x20%s',_0x590561,'request\x20sent');logger[_0x076e('0x8')](_0x076e('0x9'),_0x590561,_0x076e('0xa'),JSON[_0x076e('0xb')](_0x49ab28));if(_0x49ab28[_0x076e('0xc')]){if(_0x49ab28[_0x076e('0xc')][_0x076e('0xd')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x590561,_0x49ab28[_0x076e('0xc')][_0x076e('0xe')]);return _0x15f58c(_0x49ab28[_0x076e('0xc')][_0x076e('0xe')]);}logger[_0x076e('0xc')](_0x076e('0xf'),_0x590561,_0x49ab28['error'][_0x076e('0xe')]);return _0x219c91(_0x49ab28[_0x076e('0xc')][_0x076e('0xe')]);}else{logger['info'](_0x076e('0xf'),_0x590561,_0x076e('0xa'));_0x219c91(_0x49ab28['result'][_0x076e('0xe')]);}})[_0x076e('0x10')](function(_0x26156c){logger[_0x076e('0xc')](_0x076e('0xf'),_0x590561,_0x26156c);_0x15f58c(_0x26156c);});});}
\ No newline at end of file
index b25446a..f3bddf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2eb=['/:id','isAuthenticated','update','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put'];(function(_0x2fd225,_0x1abf49){var _0x42cc7c=function(_0x1784b5){while(--_0x1784b5){_0x2fd225['push'](_0x2fd225['shift']());}};_0x42cc7c(++_0x1abf49);}(_0xe2eb,0xf3));var _0xbe2e=function(_0x570ddd,_0x15dc90){_0x570ddd=_0x570ddd-0x0;var _0x26d7c8=_0xe2eb[_0x570ddd];return _0x26d7c8;};'use strict';var multer=require(_0xbe2e('0x0'));var util=require(_0xbe2e('0x1'));var path=require(_0xbe2e('0x2'));var express=require(_0xbe2e('0x3'));var router=express['Router']();var auth=require(_0xbe2e('0x4'));var interaction=require(_0xbe2e('0x5'));var config=require(_0xbe2e('0x6'));var controller=require(_0xbe2e('0x7'));router[_0xbe2e('0x8')](_0xbe2e('0x9'),auth[_0xbe2e('0xa')](),controller[_0xbe2e('0xb')]);router[_0xbe2e('0xc')](_0xbe2e('0x9'),auth[_0xbe2e('0xa')](),controller[_0xbe2e('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x6383=['put','/:id','isAuthenticated','update','delete','exports','multer','path','express','Router','../../components/auth/service','./action.controller'];(function(_0xe99855,_0xa41fbb){var _0x56915d=function(_0x412e49){while(--_0x412e49){_0xe99855['push'](_0xe99855['shift']());}};_0x56915d(++_0xa41fbb);}(_0x6383,0xae));var _0x3638=function(_0x1328e2,_0x4deb23){_0x1328e2=_0x1328e2-0x0;var _0x42fe68=_0x6383[_0x1328e2];return _0x42fe68;};'use strict';var multer=require(_0x3638('0x0'));var util=require('util');var path=require(_0x3638('0x1'));var express=require(_0x3638('0x2'));var router=express[_0x3638('0x3')]();var auth=require(_0x3638('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3638('0x5'));router[_0x3638('0x6')](_0x3638('0x7'),auth[_0x3638('0x8')](),controller[_0x3638('0x9')]);router[_0x3638('0xa')](_0x3638('0x7'),auth[_0x3638('0x8')](),controller['destroy']);module[_0x3638('0xb')]=router;
\ No newline at end of file
index d89b232..0d525d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x480e=['STRING','TEXT','sequelize','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x480e,0x1c6));var _0xe480=function(_0x3623da,_0xa76748){_0x3623da=_0x3623da-0x0;var _0x32bfc9=_0x480e[_0x3623da];return _0x32bfc9;};'use strict';var Sequelize=require(_0xe480('0x0'));module[_0xe480('0x1')]={'name':{'type':Sequelize[_0xe480('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe480('0x2')]},'parent':{'type':Sequelize[_0xe480('0x2')]},'table':{'type':Sequelize[_0xe480('0x2')]},'conditions':{'type':Sequelize[_0xe480('0x3')]},'joins':{'type':Sequelize[_0xe480('0x3')]}};
\ No newline at end of file
+var _0x0efc=['sequelize','exports','STRING','TEXT'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0efc,0x104));var _0xc0ef=function(_0x302cd7,_0x2e8e0e){_0x302cd7=_0x302cd7-0x0;var _0x49c218=_0x0efc[_0x302cd7];return _0x49c218;};'use strict';var Sequelize=require(_0xc0ef('0x0'));module[_0xc0ef('0x1')]={'name':{'type':Sequelize[_0xc0ef('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xc0ef('0x2')]},'table':{'type':Sequelize[_0xc0ef('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xc0ef('0x3')]}};
\ No newline at end of file
index ac6a962..604fd24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6494=['toString','sequelize','SELECT','outer_join','COUNT(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','QueryTypes','output','web','fullPath','randomstring','generate','AnalyticExtractedReport','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','runReport','ROUND(%s)','debug','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','sendStatus','end','status','json','offset','limit','reject','save','update','then','destroy','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','add','day','merge','filter','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationError','Please\x20insert\x20at\x20least\x20one\x20field!','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','alias','joins','type','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','clone','Limited\x20Query:'];(function(_0x7e16fd,_0x19983d){var _0x92a919=function(_0x327b53){while(--_0x327b53){_0x7e16fd['push'](_0x7e16fd['shift']());}};_0x92a919(++_0x19983d);}(_0x6494,0x141));var _0x4649=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6494[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4649('0x0'));var rimraf=require(_0x4649('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4649('0x2'));var rp=require(_0x4649('0x3'));var moment=require(_0x4649('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4649('0x5'));var path=require(_0x4649('0x6'));var sox=require('sox');var csv=require(_0x4649('0x7'));var ejs=require(_0x4649('0x8'));var fs=require('fs');var _=require(_0x4649('0x9'));var squel=require(_0x4649('0xa'));var crypto=require('crypto');var jsforce=require(_0x4649('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4649('0x7'));var querystring=require(_0x4649('0xc'));var Papa=require(_0x4649('0xd'));var qs=require(_0x4649('0xe'));var logger=require(_0x4649('0xf'))('api');var utils=require(_0x4649('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a5a41,_0x4108e3){_0x4108e3=_0x4108e3||0xcc;return function(_0x45d82c){if(_0x45d82c){return _0x3a5a41[_0x4649('0x11')](_0x4108e3);}return _0x3a5a41['status'](_0x4108e3)[_0x4649('0x12')]();};}function respondWithResult(_0x1a6f97,_0x3f99f0){_0x3f99f0=_0x3f99f0||0xc8;return function(_0x5f1db4){if(_0x5f1db4){return _0x1a6f97[_0x4649('0x13')](_0x3f99f0)[_0x4649('0x14')](_0x5f1db4);}};}function respondWithFilteredResult(_0x222667,_0x281766){return function(_0x1b450f){if(_0x1b450f){var _0x3cbe33=_0x1b450f['count'],_0x18de69=_0x281766['offset'],_0x13463e=_0x281766[_0x4649('0x15')]+_0x281766[_0x4649('0x16')],_0x142bf7;if(_0x13463e>=_0x3cbe33){_0x13463e=_0x3cbe33;_0x142bf7=0xc8;}else{_0x142bf7=0xce;}_0x222667[_0x4649('0x13')](_0x142bf7);return _0x222667['set']('Content-Range',_0x18de69+'-'+_0x13463e+'/'+_0x3cbe33)['json'](_0x1b450f);}return null;};}function patchUpdates(_0x4136b4){return function(_0x4cd6a6){try{jsonpatch['apply'](_0x4cd6a6,_0x4136b4,!![]);}catch(_0x11a867){return BPromise[_0x4649('0x17')](_0x11a867);}return _0x4cd6a6[_0x4649('0x18')]();};}function saveUpdates(_0x19fad7,_0x103e03){return function(_0xa4f51a){if(_0xa4f51a){return _0xa4f51a[_0x4649('0x19')](_0x19fad7)[_0x4649('0x1a')](function(_0xdbbf2e){return _0xdbbf2e;});}return null;};}function removeEntity(_0x55d364,_0x3ac9d1){return function(_0x19d430){if(_0x19d430){return _0x19d430[_0x4649('0x1b')]()[_0x4649('0x1a')](function(){_0x55d364[_0x4649('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bfb99,_0x31fdcb){return function(_0x4e28d9){if(!_0x4e28d9){_0x5bfb99[_0x4649('0x11')](0x194);}return _0x4e28d9;};}function handleError(_0x3d30ca,_0x5d4510){_0x5d4510=_0x5d4510||0x1f4;return function(_0x4bfbb4){logger[_0x4649('0x1c')](_0x4bfbb4[_0x4649('0x1d')]);if(_0x4bfbb4[_0x4649('0x1e')]){delete _0x4bfbb4[_0x4649('0x1e')];}_0x3d30ca[_0x4649('0x13')](_0x5d4510)[_0x4649('0x1f')](_0x4bfbb4);};}exports[_0x4649('0x20')]=function(_0x2c2e2c,_0x380203){var _0x4ef2cb={},_0x12a59a={},_0x3f88d7={'count':0x0,'rows':[]};var _0x5be441=db[_0x4649('0x21')][_0x4649('0x22')];_0x12a59a[_0x4649('0x23')]=_[_0x4649('0x24')](_0x5be441);var _0x1828da={'dateStart':_0x2c2e2c[_0x4649('0x25')][_0x4649('0x26')],'dateEnd':_0x2c2e2c[_0x4649('0x25')][_0x4649('0x27')]};delete _0x2c2e2c[_0x4649('0x25')]['dateStart'];delete _0x2c2e2c[_0x4649('0x25')][_0x4649('0x27')];_0x12a59a[_0x4649('0x25')]=_[_0x4649('0x24')](_0x2c2e2c[_0x4649('0x25')]);_0x12a59a['filters']=_[_0x4649('0x28')](_0x12a59a['model'],_0x12a59a[_0x4649('0x25')]);_0x4ef2cb[_0x4649('0x29')]=_[_0x4649('0x28')](_0x12a59a[_0x4649('0x23')],qs['fields'](_0x2c2e2c[_0x4649('0x25')][_0x4649('0x2a')]));_0x4ef2cb[_0x4649('0x29')]=_0x4ef2cb[_0x4649('0x29')][_0x4649('0x2b')]?_0x4ef2cb['attributes']:_0x12a59a[_0x4649('0x23')];if(!_0x2c2e2c['query'][_0x4649('0x2c')]('nolimit')){_0x4ef2cb[_0x4649('0x16')]=qs[_0x4649('0x16')](_0x2c2e2c[_0x4649('0x25')][_0x4649('0x16')]);_0x4ef2cb['offset']=qs[_0x4649('0x15')](_0x2c2e2c[_0x4649('0x25')][_0x4649('0x15')]);}_0x4ef2cb[_0x4649('0x2d')]=qs[_0x4649('0x2e')](_0x2c2e2c[_0x4649('0x25')][_0x4649('0x2e')]);_0x4ef2cb[_0x4649('0x2f')]=qs[_0x4649('0x30')](_[_0x4649('0x31')](_0x2c2e2c[_0x4649('0x25')],_0x12a59a['filters']));if(_0x1828da[_0x4649('0x26')]){if(_0x1828da[_0x4649('0x27')]){_0x1828da[_0x4649('0x27')]=moment(_0x1828da['dateEnd'])[_0x4649('0x32')](0x1,_0x4649('0x33'));}else{_0x1828da[_0x4649('0x27')]=moment(_0x1828da[_0x4649('0x26')])[_0x4649('0x32')](0x1,_0x4649('0x33'));}_[_0x4649('0x34')](_0x4ef2cb[_0x4649('0x2f')],{'createdAt':{'$gte':_0x1828da[_0x4649('0x26')],'$lte':_0x1828da[_0x4649('0x27')]}});}if(_0x2c2e2c[_0x4649('0x25')]['filter']){_0x4ef2cb[_0x4649('0x2f')]=_[_0x4649('0x34')](_0x4ef2cb[_0x4649('0x2f')],{'$or':_['map'](_0x4ef2cb[_0x4649('0x29')],function(_0x385c5f){var _0x35a05e={};_0x35a05e[_0x385c5f]={'$like':'%'+_0x2c2e2c[_0x4649('0x25')][_0x4649('0x35')]+'%'};return _0x35a05e;})});}_0x4ef2cb=_[_0x4649('0x34')]({},_0x4ef2cb,_0x2c2e2c[_0x4649('0x36')]);var _0x50e6a={'where':_0x4ef2cb['where']};return db[_0x4649('0x21')][_0x4649('0x37')](_0x50e6a)['then'](function(_0x5bdde8){_0x3f88d7[_0x4649('0x37')]=_0x5bdde8;if(_0x2c2e2c[_0x4649('0x25')][_0x4649('0x38')]){_0x4ef2cb[_0x4649('0x39')]=[{'all':!![]}];}return db[_0x4649('0x21')][_0x4649('0x3a')](_0x4ef2cb);})[_0x4649('0x1a')](function(_0x10be33){_0x3f88d7[_0x4649('0x3b')]=_0x10be33;return _0x3f88d7;})['then'](respondWithFilteredResult(_0x380203,_0x4ef2cb))['catch'](handleError(_0x380203,null));};exports[_0x4649('0x3c')]=function(_0x3d16b2,_0x5e27bf){var _0x2c681c={'raw':![],'where':{'id':_0x3d16b2[_0x4649('0x3d')]['id']}},_0x3f875c={};_0x3f875c[_0x4649('0x23')]=_['keys'](db[_0x4649('0x21')][_0x4649('0x22')]);_0x3f875c[_0x4649('0x25')]=_[_0x4649('0x24')](_0x3d16b2[_0x4649('0x25')]);_0x3f875c[_0x4649('0x30')]=_[_0x4649('0x28')](_0x3f875c[_0x4649('0x23')],_0x3f875c[_0x4649('0x25')]);_0x2c681c['attributes']=_[_0x4649('0x28')](_0x3f875c[_0x4649('0x23')],qs['fields'](_0x3d16b2[_0x4649('0x25')][_0x4649('0x2a')]));_0x2c681c[_0x4649('0x29')]=_0x2c681c['attributes'][_0x4649('0x2b')]?_0x2c681c['attributes']:_0x3f875c[_0x4649('0x23')];if(_0x3d16b2[_0x4649('0x25')][_0x4649('0x38')]){_0x2c681c[_0x4649('0x39')]=[{'all':!![]}];}_0x2c681c=_['merge']({},_0x2c681c,_0x3d16b2[_0x4649('0x36')]);return db['AnalyticCustomReport'][_0x4649('0x3e')](_0x2c681c)[_0x4649('0x1a')](handleEntityNotFound(_0x5e27bf,null))[_0x4649('0x1a')](respondWithResult(_0x5e27bf,null))[_0x4649('0x3f')](handleError(_0x5e27bf,null));};exports[_0x4649('0x40')]=function(_0x277af2,_0x2e0199){return db[_0x4649('0x21')][_0x4649('0x40')](_0x277af2[_0x4649('0x41')],{})[_0x4649('0x1a')](respondWithResult(_0x2e0199,0xc9))[_0x4649('0x3f')](handleError(_0x2e0199,null));};exports[_0x4649('0x19')]=function(_0x39b897,_0x3fb463){if(_0x39b897[_0x4649('0x41')]['id']){delete _0x39b897[_0x4649('0x41')]['id'];}return db[_0x4649('0x21')][_0x4649('0x3e')]({'where':{'id':_0x39b897[_0x4649('0x3d')]['id']}})[_0x4649('0x1a')](handleEntityNotFound(_0x3fb463,null))[_0x4649('0x1a')](saveUpdates(_0x39b897[_0x4649('0x41')],null))['then'](respondWithResult(_0x3fb463,null))['catch'](handleError(_0x3fb463,null));};exports[_0x4649('0x1b')]=function(_0x5693e4,_0x59dd79){return db[_0x4649('0x21')][_0x4649('0x3e')]({'where':{'id':_0x5693e4[_0x4649('0x3d')]['id']}})[_0x4649('0x1a')](handleEntityNotFound(_0x59dd79,null))[_0x4649('0x1a')](removeEntity(_0x59dd79,null))['catch'](handleError(_0x59dd79,null));};exports[_0x4649('0x42')]=function(_0x895b84,_0x16d373){var _0x4d5d84=0xa;var _0x15c53b=[_0x4649('0x43'),_0x4649('0x44'),_0x4649('0x45'),'outer_join',_0x4649('0x46')];var _0x95d7fd={'SUM':_0x4649('0x47'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4649('0x48'),'MAX':_0x4649('0x49'),'MIN':_0x4649('0x4a'),'AVG':_0x4649('0x4b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4649('0x4c')};var _0x4af01e={'SEC_TO_TIME':_0x4649('0x4d'),'DATE':_0x4649('0x4e'),'HOUR':_0x4649('0x4f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4649('0x50')};var _0x49b6c7=function(_0x389506){return!_[_0x4649('0x51')]([_0x4649('0x52'),_0x4649('0x53'),_0x4649('0x54'),_0x4649('0x55')],_0x389506);};var _0x2502bb=function(_0x32ff48){if(!_0x32ff48||!_0x32ff48[_0x4649('0x56')][_0x4649('0x2b')]){return'';}for(var _0x2c7a09='(',_0xd0d967=0x0;_0xd0d967<_0x32ff48[_0x4649('0x56')]['length'];_0xd0d967+=0x1){_0xd0d967>0x0&&(_0x2c7a09+='\x20'+_0x32ff48[_0x4649('0x57')]+'\x20');_0x2c7a09+=_0x32ff48[_0x4649('0x56')][_0xd0d967]['group']?_0x2502bb(_0x32ff48[_0x4649('0x56')][_0xd0d967][_0x4649('0x58')]):_0x32ff48[_0x4649('0x56')][_0xd0d967][_0x4649('0x59')]+'\x20'+_0x32ff48['rules'][_0xd0d967][_0x4649('0x5a')]+(_0x49b6c7(_0x32ff48[_0x4649('0x56')][_0xd0d967][_0x4649('0x5a')])?'\x20'+_0x32ff48['rules'][_0xd0d967][_0x4649('0x5b')]:'');}return _0x2c7a09+')';};var _0x3f63af={'where':{'id':_0x895b84[_0x4649('0x3d')]['id']}},_0x51a8c4,_0x16c2c1,_0x2fd70a,_0x391454,_0x29ed67;_0x3f63af=_[_0x4649('0x34')]({},_0x3f63af,_0x895b84[_0x4649('0x36')]);return db[_0x4649('0x21')]['find'](_0x3f63af)[_0x4649('0x1a')](function(_0xf1850f){if(_0xf1850f){_0x51a8c4=_0xf1850f;return _0xf1850f[_0x4649('0x5c')]();}return null;})[_0x4649('0x1a')](function(_0x39f694){if(_0x39f694){if(!_0x39f694[_0x4649('0x2b')]){throw new db[(_0x4649('0x5d'))][(_0x4649('0x5e'))](_0x4649('0x5f'));}_0x16c2c1=_0x39f694;return db[_0x4649('0x60')]['findAll']({'raw':!![]});}return null;})[_0x4649('0x1a')](function(_0x22c6f7){if(_0x22c6f7){_0x2fd70a=_[_0x4649('0x61')](_0x22c6f7,'id');var _0x399050;var _0x5a9592=squel[_0x4649('0x62')]();_0x5a9592[_0x4649('0x63')](_0x51a8c4[_0x4649('0x64')]);for(var _0x200f2a=0x0;_0x200f2a<_0x16c2c1[_0x4649('0x2b')];_0x200f2a+=0x1){_0x399050=_0x16c2c1[_0x200f2a]['MetricId']?_0x2fd70a[_0x16c2c1[_0x200f2a][_0x4649('0x65')]][_0x4649('0x66')]:_0x16c2c1[_0x200f2a][_0x4649('0x59')];_0x399050=_0x16c2c1[_0x200f2a]['function']?_['replace'](_0x95d7fd[_0x16c2c1[_0x200f2a][_0x4649('0x67')]],'%s',_0x399050):_0x399050;_0x399050=_0x16c2c1[_0x200f2a][_0x4649('0x68')]?_[_0x4649('0x69')](_0x4af01e[_0x16c2c1[_0x200f2a][_0x4649('0x68')]],'%s',_0x399050):_0x399050;if(_0x16c2c1[_0x200f2a][_0x4649('0x6a')]){_0x5a9592[_0x4649('0x58')](_0x399050);}_0x16c2c1[_0x200f2a][_0x4649('0x6b')]&&_0x5a9592['order'](_0x399050,_0x16c2c1[_0x200f2a]['orderBy']===_0x4649('0x6c')?![]:!![]);_0x5a9592[_0x4649('0x59')](_0x399050,_0x16c2c1[_0x200f2a][_0x4649('0x6d')]||_0x399050);}if(_0x51a8c4[_0x4649('0x6e')]){_0x51a8c4[_0x4649('0x6e')]=JSON['parse'](_0x51a8c4[_0x4649('0x6e')]);for(var _0x1c6908=0x0;_0x1c6908<_0x51a8c4['joins'][_0x4649('0x2b')];_0x1c6908+=0x1){if(_0x51a8c4['joins'][_0x1c6908][_0x4649('0x6f')]&&_[_0x4649('0x51')](_0x15c53b,_0x51a8c4['joins'][_0x1c6908][_0x4649('0x6f')])&&_0x51a8c4[_0x4649('0x6e')][_0x1c6908]['parentKey']&&_0x51a8c4[_0x4649('0x6e')][_0x1c6908][_0x4649('0x70')]&&_0x51a8c4['joins'][_0x1c6908][_0x4649('0x71')]){_0x5a9592[_0x51a8c4[_0x4649('0x6e')][_0x1c6908][_0x4649('0x6f')]](_0x51a8c4['joins'][_0x1c6908][_0x4649('0x70')],null,util['format'](_0x4649('0x72'),_0x51a8c4[_0x4649('0x64')],_0x51a8c4['joins'][_0x1c6908][_0x4649('0x73')],_0x51a8c4[_0x4649('0x6e')][_0x1c6908][_0x4649('0x70')],_0x51a8c4[_0x4649('0x6e')][_0x1c6908]['foreignKey']));}}}if(_0x51a8c4[_0x4649('0x74')]){_0x51a8c4['conditions']=JSON[_0x4649('0x75')](_0x51a8c4[_0x4649('0x74')]);_0x5a9592[_0x4649('0x2f')](_0x2502bb(_0x51a8c4['conditions']['group']));}_0x29ed67=_0x5a9592[_0x4649('0x76')]();_0x5a9592[_0x4649('0x16')](_0x4d5d84);_0x5a9592['offset'](0x0);logger['debug'](_0x4649('0x77'),_0x5a9592[_0x4649('0x78')]());return db[_0x4649('0x79')]['query'](_0x5a9592[_0x4649('0x78')](),{'type':db[_0x4649('0x79')]['QueryTypes'][_0x4649('0x7a')]});}})[_0x4649('0x1a')](respondWithResult(_0x16d373,null))[_0x4649('0x3f')](handleError(_0x16d373,null));};function runReport(_0x21665c,_0x18a072,_0x3217d2){var _0x525c49=_0x18a072[_0x4649('0x1e')];var _0x3e77cd=0xa;var _0x303f4e=[_0x4649('0x43'),_0x4649('0x44'),_0x4649('0x45'),_0x4649('0x7b'),_0x4649('0x46')];var _0x10c217={'SUM':_0x4649('0x47'),'COUNT':_0x4649('0x7c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x4649('0x49'),'MIN':_0x4649('0x4a'),'AVG':_0x4649('0x4b'),'GROUP_CONCAT':_0x4649('0x7d'),'GROUP_CONCAT ASC':_0x4649('0x7e'),'GROUP_CONCAT DESC':_0x4649('0x4c')};var _0x36ccdd={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x4649('0x4f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1ac6dc=function(_0x2c8bb4){return!_['includes']([_0x4649('0x52'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x4649('0x55')],_0x2c8bb4);};var _0x1dee31=function(_0x7055db){if(!_0x7055db||!_0x7055db[_0x4649('0x56')][_0x4649('0x2b')]){return'';}for(var _0x581a4a='(',_0x4c9800=0x0;_0x4c9800<_0x7055db[_0x4649('0x56')][_0x4649('0x2b')];_0x4c9800+=0x1){_0x4c9800>0x0&&(_0x581a4a+='\x20'+_0x7055db['operator']+'\x20');_0x581a4a+=_0x7055db[_0x4649('0x56')][_0x4c9800][_0x4649('0x58')]?_0x1dee31(_0x7055db['rules'][_0x4c9800]['group']):_0x7055db[_0x4649('0x56')][_0x4c9800]['field']+'\x20'+_0x7055db[_0x4649('0x56')][_0x4c9800][_0x4649('0x5a')]+(_0x1ac6dc(_0x7055db[_0x4649('0x56')][_0x4c9800]['condition'])?'\x20'+_0x7055db['rules'][_0x4c9800][_0x4649('0x5b')]:'');}return _0x581a4a+')';};var _0x2376c7={'where':{'id':_0x21665c['id']}},_0x5216cb,_0x4902df,_0x5ae138,_0x150d04,_0x30ea6f;_0x2376c7=_[_0x4649('0x34')]({},_0x2376c7,_0x3217d2);return db[_0x4649('0x21')][_0x4649('0x3e')](_0x2376c7)[_0x4649('0x1a')](function(_0xabe0cf){if(_0xabe0cf){_0x5216cb=_0xabe0cf;return _0xabe0cf[_0x4649('0x5c')]();}return null;})[_0x4649('0x1a')](function(_0x3bba31){if(_0x3bba31){if(!_0x3bba31['length']){throw new db[(_0x4649('0x5d'))][(_0x4649('0x5e'))](_0x4649('0x5f'));}_0x4902df=_0x3bba31;return db['AnalyticMetric'][_0x4649('0x3a')]({'raw':!![]});}return null;})['then'](function(_0x468dbf){if(_0x468dbf){_0x5ae138=_['keyBy'](_0x468dbf,'id');var _0x1c8e3f;var _0x551683=squel[_0x4649('0x62')]();_0x551683['from'](_0x5216cb[_0x4649('0x64')]);for(var _0x4a39a7=0x0;_0x4a39a7<_0x4902df[_0x4649('0x2b')];_0x4a39a7+=0x1){_0x1c8e3f=_0x4902df[_0x4a39a7][_0x4649('0x65')]?_0x5ae138[_0x4902df[_0x4a39a7]['MetricId']][_0x4649('0x66')]:_0x4902df[_0x4a39a7][_0x4649('0x59')];_0x1c8e3f=_0x4902df[_0x4a39a7]['function']?_[_0x4649('0x69')](_0x10c217[_0x4902df[_0x4a39a7][_0x4649('0x67')]],'%s',_0x1c8e3f):_0x1c8e3f;_0x1c8e3f=_0x4902df[_0x4a39a7]['format']?_[_0x4649('0x69')](_0x36ccdd[_0x4902df[_0x4a39a7][_0x4649('0x68')]],'%s',_0x1c8e3f):_0x1c8e3f;if(_0x4902df[_0x4a39a7][_0x4649('0x6a')]){_0x551683[_0x4649('0x58')](_0x1c8e3f);}_0x4902df[_0x4a39a7][_0x4649('0x6b')]&&_0x551683[_0x4649('0x2d')](_0x1c8e3f,_0x4902df[_0x4a39a7][_0x4649('0x6b')]===_0x4649('0x6c')?![]:!![]);_0x551683[_0x4649('0x59')](_0x1c8e3f,_0x4902df[_0x4a39a7][_0x4649('0x6d')]||_0x1c8e3f);}if(_0x5216cb[_0x4649('0x6e')]){_0x5216cb[_0x4649('0x6e')]=JSON[_0x4649('0x75')](_0x5216cb[_0x4649('0x6e')]);for(var _0x3fe24c=0x0;_0x3fe24c<_0x5216cb[_0x4649('0x6e')][_0x4649('0x2b')];_0x3fe24c+=0x1){if(_0x5216cb[_0x4649('0x6e')][_0x3fe24c][_0x4649('0x6f')]&&_[_0x4649('0x51')](_0x303f4e,_0x5216cb[_0x4649('0x6e')][_0x3fe24c]['type'])&&_0x5216cb[_0x4649('0x6e')][_0x3fe24c][_0x4649('0x73')]&&_0x5216cb[_0x4649('0x6e')][_0x3fe24c]['foreignTable']&&_0x5216cb['joins'][_0x3fe24c][_0x4649('0x71')]){_0x551683[_0x5216cb['joins'][_0x3fe24c][_0x4649('0x6f')]](_0x5216cb['joins'][_0x3fe24c][_0x4649('0x70')],null,util[_0x4649('0x68')](_0x4649('0x72'),_0x5216cb[_0x4649('0x64')],_0x5216cb[_0x4649('0x6e')][_0x3fe24c]['parentKey'],_0x5216cb[_0x4649('0x6e')][_0x3fe24c][_0x4649('0x70')],_0x5216cb[_0x4649('0x6e')][_0x3fe24c]['foreignKey']));}}}if(_0x5216cb['conditions']){_0x5216cb[_0x4649('0x74')]=JSON['parse'](_0x5216cb[_0x4649('0x74')]);_0x551683[_0x4649('0x2f')](_0x1dee31(_0x5216cb['conditions']['group']));}_0x30ea6f=_0x551683['clone']();_0x551683[_0x4649('0x16')](_0x3e77cd);_0x551683['offset'](0x0);logger['debug'](_0x4649('0x77'),_0x551683[_0x4649('0x78')]());return db[_0x4649('0x79')]['query'](_0x551683[_0x4649('0x78')](),{'type':db[_0x4649('0x79')][_0x4649('0x7f')]['SELECT']});}})['then'](function(_0x3eae0a){if(!_0x3eae0a[_0x4649('0x2b')]){throw new db[(_0x4649('0x5d'))][(_0x4649('0x5e'))]('No\x20Data!');}if(_0x18a072[_0x4649('0x80')]===_0x4649('0x81')){return null;}var _0xc33c30=_['merge'](_0x18a072,{'name':_0x18a072[_0x4649('0x82')]||_0x18a072[_0x4649('0x1e')]||_0x5216cb[_0x4649('0x1e')],'basename':_0x525c49,'savename':util[_0x4649('0x68')]('%s-%s.%s',_0x18a072['name']||_0x5216cb[_0x4649('0x1e')],require(_0x4649('0x83'))[_0x4649('0x84')](0x4),_0x18a072[_0x4649('0x80')]||'csv')});return db[_0x4649('0x85')][_0x4649('0x40')](_0xc33c30,{'raw':!![]});})[_0x4649('0x1a')](function(_0x24956f){_0x30ea6f[_0x4649('0x2f')](_0x5216cb[_0x4649('0x64')]+_0x4649('0x86'),_0x18a072[_0x4649('0x87')],_0x18a072[_0x4649('0x88')]);if(_0x24956f){logger[_0x4649('0x89')]('Run\x20Query:',_0x30ea6f[_0x4649('0x78')]());require(_0x4649('0x8a'))[_0x4649('0x8b')](path['join'](__dirname,_0x4649('0x8c'),_0x24956f[_0x4649('0x80')]),[_0x24956f['id'],_0x30ea6f['toString'](),path[_0x4649('0x43')](__dirname,_0x4649('0x8d'),_0x24956f[_0x4649('0x8e')]),_0x525c49]);return _0x24956f;}else{var _0x288aa2=squel[_0x4649('0x62')]();_0x288aa2[_0x4649('0x63')]('('+_0x30ea6f[_0x4649('0x78')]()+')',_0x4649('0x8f'));_0x288aa2[_0x4649('0x59')]('COUNT(*)',_0x4649('0x37'));_0x30ea6f['limit'](_0x18a072['limit']||_0x3e77cd);_0x30ea6f[_0x4649('0x15')](_0x18a072[_0x4649('0x15')]||0x0);return db[_0x4649('0x79')][_0x4649('0x25')](_0x288aa2[_0x4649('0x78')](),{'type':db['sequelize']['QueryTypes']['SELECT']})['then'](function(_0x41b956){if(!_0x41b956['length']){_0x150d04=0x0;}else{_0x150d04=_0x41b956[0x0][_0x4649('0x37')]||0x0;}return db[_0x4649('0x79')][_0x4649('0x25')](_0x30ea6f[_0x4649('0x78')](),{'type':db[_0x4649('0x79')][_0x4649('0x7f')]['SELECT']});})['then'](function(_0x26ba99){return{'rows':_0x26ba99||[],'count':_0x150d04};});}});}exports['run']=function(_0x4a020f,_0x3ea6dc){return runReport(_0x4a020f[_0x4649('0x3d')],_0x4a020f[_0x4649('0x25')],_0x4a020f[_0x4649('0x36')])['then'](respondWithResult(_0x3ea6dc,null))['catch'](handleError(_0x3ea6dc,null));};exports[_0x4649('0x90')]=runReport;exports[_0x4649('0x25')]=function(_0xc87bbe,_0x838e3e){var _0x45f8d2=0xa;var _0x3268ca=[_0x4649('0x43'),'left_join',_0x4649('0x45'),'outer_join',_0x4649('0x46')];var _0x5a8026={'SUM':_0x4649('0x47'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x4649('0x49'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x4649('0x7d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3cd104={'SEC_TO_TIME':_0x4649('0x4d'),'DATE':_0x4649('0x4e'),'HOUR':_0x4649('0x4f'),'ROUND':_0x4649('0x91'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x497d8c=function(_0x45fa78){return!_[_0x4649('0x51')]([_0x4649('0x52'),'IS\x20NOT\x20NULL',_0x4649('0x54'),_0x4649('0x55')],_0x45fa78);};var _0x424601=function(_0x394adf){if(!_0x394adf||!_0x394adf[_0x4649('0x56')][_0x4649('0x2b')]){return'';}for(var _0x39a78d='(',_0x3b6004=0x0;_0x3b6004<_0x394adf[_0x4649('0x56')]['length'];_0x3b6004+=0x1){_0x3b6004>0x0&&(_0x39a78d+='\x20'+_0x394adf[_0x4649('0x57')]+'\x20');_0x39a78d+=_0x394adf[_0x4649('0x56')][_0x3b6004][_0x4649('0x58')]?_0x424601(_0x394adf[_0x4649('0x56')][_0x3b6004]['group']):_0x394adf['rules'][_0x3b6004][_0x4649('0x59')]+'\x20'+_0x394adf[_0x4649('0x56')][_0x3b6004][_0x4649('0x5a')]+(_0x497d8c(_0x394adf[_0x4649('0x56')][_0x3b6004][_0x4649('0x5a')])?'\x20'+_0x394adf['rules'][_0x3b6004][_0x4649('0x5b')]:'');}return _0x39a78d+')';};var _0x4141e5={'where':{'id':_0xc87bbe[_0x4649('0x3d')]['id']}},_0x1368a0,_0x1841e4,_0x2f537f,_0x53c658,_0x27f8dd;_0x4141e5=_[_0x4649('0x34')]({},_0x4141e5,_0xc87bbe[_0x4649('0x36')]);return db['AnalyticCustomReport'][_0x4649('0x3e')](_0x4141e5)[_0x4649('0x1a')](function(_0x301832){if(_0x301832){_0x1368a0=_0x301832;return _0x301832['getFields']();}return null;})[_0x4649('0x1a')](function(_0x448817){if(_0x448817){if(!_0x448817['length']){throw new db[(_0x4649('0x5d'))][(_0x4649('0x5e'))]('Please\x20insert\x20at\x20least\x20one\x20field!');}_0x1841e4=_0x448817;return db[_0x4649('0x60')][_0x4649('0x3a')]({'raw':!![]});}return null;})[_0x4649('0x1a')](function(_0x583241){if(_0x583241){_0x2f537f=_[_0x4649('0x61')](_0x583241,'id');var _0x528089;var _0xd3b9dc=squel['select']();_0xd3b9dc['from'](_0x1368a0[_0x4649('0x64')]);for(var _0x6d394a=0x0;_0x6d394a<_0x1841e4['length'];_0x6d394a+=0x1){_0x528089=_0x1841e4[_0x6d394a][_0x4649('0x65')]?_0x2f537f[_0x1841e4[_0x6d394a][_0x4649('0x65')]][_0x4649('0x66')]:_0x1841e4[_0x6d394a]['field'];_0x528089=_0x1841e4[_0x6d394a][_0x4649('0x67')]?_[_0x4649('0x69')](_0x5a8026[_0x1841e4[_0x6d394a]['function']],'%s',_0x528089):_0x528089;_0x528089=_0x1841e4[_0x6d394a][_0x4649('0x68')]?_[_0x4649('0x69')](_0x3cd104[_0x1841e4[_0x6d394a]['format']],'%s',_0x528089):_0x528089;if(_0x1841e4[_0x6d394a][_0x4649('0x6a')]){_0xd3b9dc[_0x4649('0x58')](_0x528089);}_0x1841e4[_0x6d394a][_0x4649('0x6b')]&&_0xd3b9dc['order'](_0x528089,_0x1841e4[_0x6d394a]['orderBy']===_0x4649('0x6c')?![]:!![]);_0xd3b9dc[_0x4649('0x59')](_0x528089,_0x1841e4[_0x6d394a]['alias']||_0x528089);}if(_0x1368a0[_0x4649('0x6e')]){_0x1368a0['joins']=JSON[_0x4649('0x75')](_0x1368a0[_0x4649('0x6e')]);for(var _0x5b3fba=0x0;_0x5b3fba<_0x1368a0[_0x4649('0x6e')]['length'];_0x5b3fba+=0x1){if(_0x1368a0[_0x4649('0x6e')][_0x5b3fba][_0x4649('0x6f')]&&_[_0x4649('0x51')](_0x3268ca,_0x1368a0[_0x4649('0x6e')][_0x5b3fba][_0x4649('0x6f')])&&_0x1368a0[_0x4649('0x6e')][_0x5b3fba][_0x4649('0x73')]&&_0x1368a0[_0x4649('0x6e')][_0x5b3fba]['foreignTable']&&_0x1368a0[_0x4649('0x6e')][_0x5b3fba][_0x4649('0x71')]){_0xd3b9dc[_0x1368a0['joins'][_0x5b3fba]['type']](_0x1368a0[_0x4649('0x6e')][_0x5b3fba][_0x4649('0x70')],null,util[_0x4649('0x68')](_0x4649('0x72'),_0x1368a0[_0x4649('0x64')],_0x1368a0['joins'][_0x5b3fba][_0x4649('0x73')],_0x1368a0[_0x4649('0x6e')][_0x5b3fba][_0x4649('0x70')],_0x1368a0[_0x4649('0x6e')][_0x5b3fba][_0x4649('0x71')]));}}}if(_0x1368a0[_0x4649('0x74')]){_0x1368a0[_0x4649('0x74')]=JSON[_0x4649('0x75')](_0x1368a0[_0x4649('0x74')]);_0xd3b9dc['where'](_0x424601(_0x1368a0[_0x4649('0x74')][_0x4649('0x58')]));}_0x27f8dd=_0xd3b9dc[_0x4649('0x76')]();_0xd3b9dc[_0x4649('0x16')](_0x45f8d2);_0xd3b9dc[_0x4649('0x15')](0x0);logger[_0x4649('0x92')](_0x4649('0x77'),_0xd3b9dc['toString']());return db[_0x4649('0x79')][_0x4649('0x25')](_0xd3b9dc['toString'](),{'type':db[_0x4649('0x79')][_0x4649('0x7f')][_0x4649('0x7a')]});}})[_0x4649('0x1a')](function(){return{'sql':_0x27f8dd[_0x4649('0x78')]()};})[_0x4649('0x1a')](respondWithResult(_0x838e3e,null))[_0x4649('0x3f')](handleError(_0x838e3e,null));};
\ No newline at end of file
+var _0xd273=['alias','joins','parse','type','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','SUM(%s)','SEC_TO_TIME(%s)','DATE(%s)','IS\x20NULL','value','AnalyticMetric','keyBy','order','clone','No\x20Data!','output','web','generate','csv','AnalyticExtractedReport','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','to-csv','ejs','lodash','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','reject','then','name','send','index','AnalyticCustomReport','query','dateStart','dateEnd','keys','filters','intersection','attributes','model','fields','length','limit','sort','where','pick','day','merge','filter','map','options','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','destroy','preview','join','right_join','outer_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationError','Please\x20insert\x20at\x20least\x20one\x20field!','select','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC'];(function(_0x45a45f,_0x2d8681){var _0x2d1fbf=function(_0x41b95c){while(--_0x41b95c){_0x45a45f['push'](_0x45a45f['shift']());}};_0x2d1fbf(++_0x2d8681);}(_0xd273,0x1dc));var _0x3d27=function(_0xba480c,_0x333119){_0xba480c=_0xba480c-0x0;var _0x1aeafc=_0xd273[_0xba480c];return _0x1aeafc;};'use strict';var pdf=require(_0x3d27('0x0'));var emlformat=require(_0x3d27('0x1'));var rimraf=require(_0x3d27('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3d27('0x3'));var rp=require('request-promise');var moment=require(_0x3d27('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3d27('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3d27('0x6'));var ejs=require(_0x3d27('0x7'));var fs=require('fs');var _=require(_0x3d27('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3d27('0x9'));var deskjs=require(_0x3d27('0xa'));var toCsv=require(_0x3d27('0x6'));var querystring=require('querystring');var Papa=require(_0x3d27('0xb'));var qs=require(_0x3d27('0xc'));var logger=require(_0x3d27('0xd'))(_0x3d27('0xe'));var utils=require(_0x3d27('0xf'));var config=require(_0x3d27('0x10'));var db=require(_0x3d27('0x11'))['db'];function respondWithStatusCode(_0x539a2f,_0x47e34b){_0x47e34b=_0x47e34b||0xcc;return function(_0x36b54d){if(_0x36b54d){return _0x539a2f[_0x3d27('0x12')](_0x47e34b);}return _0x539a2f[_0x3d27('0x13')](_0x47e34b)['end']();};}function respondWithResult(_0x2d6c80,_0x5a87c5){_0x5a87c5=_0x5a87c5||0xc8;return function(_0x10aad3){if(_0x10aad3){return _0x2d6c80[_0x3d27('0x13')](_0x5a87c5)[_0x3d27('0x14')](_0x10aad3);}};}function respondWithFilteredResult(_0x46b255,_0x4e74d7){return function(_0x35b833){if(_0x35b833){var _0x3a4b59=_0x35b833[_0x3d27('0x15')],_0x2b268f=_0x4e74d7['offset'],_0x4df4f8=_0x4e74d7[_0x3d27('0x16')]+_0x4e74d7['limit'],_0x45fcc7;if(_0x4df4f8>=_0x3a4b59){_0x4df4f8=_0x3a4b59;_0x45fcc7=0xc8;}else{_0x45fcc7=0xce;}_0x46b255[_0x3d27('0x13')](_0x45fcc7);return _0x46b255['set'](_0x3d27('0x17'),_0x2b268f+'-'+_0x4df4f8+'/'+_0x3a4b59)['json'](_0x35b833);}return null;};}function patchUpdates(_0x2b175e){return function(_0x3e3cfc){try{jsonpatch[_0x3d27('0x18')](_0x3e3cfc,_0x2b175e,!![]);}catch(_0x487d4f){return BPromise[_0x3d27('0x19')](_0x487d4f);}return _0x3e3cfc['save']();};}function saveUpdates(_0x289b02,_0x52408c){return function(_0x110c2f){if(_0x110c2f){return _0x110c2f['update'](_0x289b02)[_0x3d27('0x1a')](function(_0x1411dd){return _0x1411dd;});}return null;};}function removeEntity(_0x24b80f,_0x2098cf){return function(_0x3f5790){if(_0x3f5790){return _0x3f5790['destroy']()['then'](function(){_0x24b80f[_0x3d27('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5856be,_0x338f43){return function(_0x2e21bb){if(!_0x2e21bb){_0x5856be[_0x3d27('0x12')](0x194);}return _0x2e21bb;};}function handleError(_0x3b88e5,_0x5b64d3){_0x5b64d3=_0x5b64d3||0x1f4;return function(_0x5a07b8){logger['error'](_0x5a07b8['stack']);if(_0x5a07b8[_0x3d27('0x1b')]){delete _0x5a07b8[_0x3d27('0x1b')];}_0x3b88e5[_0x3d27('0x13')](_0x5b64d3)[_0x3d27('0x1c')](_0x5a07b8);};}exports[_0x3d27('0x1d')]=function(_0x443d1a,_0x32fabb){var _0x36893d={},_0x3a9e9b={},_0x3f8813={'count':0x0,'rows':[]};var _0x3ab72e=db[_0x3d27('0x1e')]['rawAttributes'];_0x3a9e9b['model']=_['keys'](_0x3ab72e);var _0x4aa4b1={'dateStart':_0x443d1a[_0x3d27('0x1f')][_0x3d27('0x20')],'dateEnd':_0x443d1a[_0x3d27('0x1f')][_0x3d27('0x21')]};delete _0x443d1a['query'][_0x3d27('0x20')];delete _0x443d1a[_0x3d27('0x1f')][_0x3d27('0x21')];_0x3a9e9b['query']=_[_0x3d27('0x22')](_0x443d1a[_0x3d27('0x1f')]);_0x3a9e9b[_0x3d27('0x23')]=_[_0x3d27('0x24')](_0x3a9e9b['model'],_0x3a9e9b[_0x3d27('0x1f')]);_0x36893d[_0x3d27('0x25')]=_[_0x3d27('0x24')](_0x3a9e9b[_0x3d27('0x26')],qs[_0x3d27('0x27')](_0x443d1a['query'][_0x3d27('0x27')]));_0x36893d[_0x3d27('0x25')]=_0x36893d[_0x3d27('0x25')][_0x3d27('0x28')]?_0x36893d['attributes']:_0x3a9e9b[_0x3d27('0x26')];if(!_0x443d1a[_0x3d27('0x1f')]['hasOwnProperty']('nolimit')){_0x36893d[_0x3d27('0x29')]=qs[_0x3d27('0x29')](_0x443d1a[_0x3d27('0x1f')][_0x3d27('0x29')]);_0x36893d[_0x3d27('0x16')]=qs[_0x3d27('0x16')](_0x443d1a['query']['offset']);}_0x36893d['order']=qs[_0x3d27('0x2a')](_0x443d1a[_0x3d27('0x1f')][_0x3d27('0x2a')]);_0x36893d[_0x3d27('0x2b')]=qs[_0x3d27('0x23')](_[_0x3d27('0x2c')](_0x443d1a[_0x3d27('0x1f')],_0x3a9e9b[_0x3d27('0x23')]));if(_0x4aa4b1[_0x3d27('0x20')]){if(_0x4aa4b1[_0x3d27('0x21')]){_0x4aa4b1[_0x3d27('0x21')]=moment(_0x4aa4b1[_0x3d27('0x21')])['add'](0x1,_0x3d27('0x2d'));}else{_0x4aa4b1['dateEnd']=moment(_0x4aa4b1[_0x3d27('0x20')])['add'](0x1,_0x3d27('0x2d'));}_[_0x3d27('0x2e')](_0x36893d[_0x3d27('0x2b')],{'createdAt':{'$gte':_0x4aa4b1[_0x3d27('0x20')],'$lte':_0x4aa4b1[_0x3d27('0x21')]}});}if(_0x443d1a[_0x3d27('0x1f')][_0x3d27('0x2f')]){_0x36893d[_0x3d27('0x2b')]=_[_0x3d27('0x2e')](_0x36893d[_0x3d27('0x2b')],{'$or':_[_0x3d27('0x30')](_0x36893d[_0x3d27('0x25')],function(_0x256a41){var _0x5698f9={};_0x5698f9[_0x256a41]={'$like':'%'+_0x443d1a[_0x3d27('0x1f')]['filter']+'%'};return _0x5698f9;})});}_0x36893d=_[_0x3d27('0x2e')]({},_0x36893d,_0x443d1a[_0x3d27('0x31')]);var _0x25a799={'where':_0x36893d[_0x3d27('0x2b')]};return db['AnalyticCustomReport']['count'](_0x25a799)[_0x3d27('0x1a')](function(_0x252374){_0x3f8813[_0x3d27('0x15')]=_0x252374;if(_0x443d1a['query'][_0x3d27('0x32')]){_0x36893d[_0x3d27('0x33')]=[{'all':!![]}];}return db[_0x3d27('0x1e')][_0x3d27('0x34')](_0x36893d);})[_0x3d27('0x1a')](function(_0x70309f){_0x3f8813[_0x3d27('0x35')]=_0x70309f;return _0x3f8813;})[_0x3d27('0x1a')](respondWithFilteredResult(_0x32fabb,_0x36893d))[_0x3d27('0x36')](handleError(_0x32fabb,null));};exports[_0x3d27('0x37')]=function(_0x39f1cd,_0x45ae47){var _0x578380={'raw':![],'where':{'id':_0x39f1cd[_0x3d27('0x38')]['id']}},_0x55a1aa={};_0x55a1aa['model']=_[_0x3d27('0x22')](db['AnalyticCustomReport']['rawAttributes']);_0x55a1aa[_0x3d27('0x1f')]=_[_0x3d27('0x22')](_0x39f1cd[_0x3d27('0x1f')]);_0x55a1aa['filters']=_[_0x3d27('0x24')](_0x55a1aa['model'],_0x55a1aa[_0x3d27('0x1f')]);_0x578380[_0x3d27('0x25')]=_[_0x3d27('0x24')](_0x55a1aa[_0x3d27('0x26')],qs[_0x3d27('0x27')](_0x39f1cd[_0x3d27('0x1f')][_0x3d27('0x27')]));_0x578380[_0x3d27('0x25')]=_0x578380['attributes']['length']?_0x578380[_0x3d27('0x25')]:_0x55a1aa[_0x3d27('0x26')];if(_0x39f1cd['query']['includeAll']){_0x578380['include']=[{'all':!![]}];}_0x578380=_['merge']({},_0x578380,_0x39f1cd['options']);return db[_0x3d27('0x1e')][_0x3d27('0x39')](_0x578380)[_0x3d27('0x1a')](handleEntityNotFound(_0x45ae47,null))[_0x3d27('0x1a')](respondWithResult(_0x45ae47,null))[_0x3d27('0x36')](handleError(_0x45ae47,null));};exports['create']=function(_0x494519,_0x314aff){return db['AnalyticCustomReport'][_0x3d27('0x3a')](_0x494519['body'],{})[_0x3d27('0x1a')](respondWithResult(_0x314aff,0xc9))[_0x3d27('0x36')](handleError(_0x314aff,null));};exports[_0x3d27('0x3b')]=function(_0x3ede1f,_0x491b09){if(_0x3ede1f['body']['id']){delete _0x3ede1f[_0x3d27('0x3c')]['id'];}return db[_0x3d27('0x1e')]['find']({'where':{'id':_0x3ede1f['params']['id']}})[_0x3d27('0x1a')](handleEntityNotFound(_0x491b09,null))[_0x3d27('0x1a')](saveUpdates(_0x3ede1f['body'],null))['then'](respondWithResult(_0x491b09,null))['catch'](handleError(_0x491b09,null));};exports[_0x3d27('0x3d')]=function(_0x5ca936,_0x2d559b){return db[_0x3d27('0x1e')]['find']({'where':{'id':_0x5ca936['params']['id']}})[_0x3d27('0x1a')](handleEntityNotFound(_0x2d559b,null))[_0x3d27('0x1a')](removeEntity(_0x2d559b,null))[_0x3d27('0x36')](handleError(_0x2d559b,null));};exports[_0x3d27('0x3e')]=function(_0x4d9190,_0x3778af){var _0x54babf=0xa;var _0xf44f26=[_0x3d27('0x3f'),'left_join',_0x3d27('0x40'),_0x3d27('0x41'),'cross_join'];var _0x4c3ebb={'SUM':'SUM(%s)','COUNT':_0x3d27('0x42'),'COUNT DISTINCT':_0x3d27('0x43'),'MAX':_0x3d27('0x44'),'MIN':_0x3d27('0x45'),'AVG':_0x3d27('0x46'),'GROUP_CONCAT':_0x3d27('0x47'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x3d27('0x48')};var _0x407347={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x3d27('0x49'),'ROUND':_0x3d27('0x4a'),'UNIX_TIMESTAMP':_0x3d27('0x4b')};var _0x440a0c=function(_0x18fbda){return!_[_0x3d27('0x4c')](['IS\x20NULL',_0x3d27('0x4d'),_0x3d27('0x4e'),_0x3d27('0x4f')],_0x18fbda);};var _0x3dfb3f=function(_0x2aefce){if(!_0x2aefce||!_0x2aefce[_0x3d27('0x50')][_0x3d27('0x28')]){return'';}for(var _0x3add1e='(',_0xd2612=0x0;_0xd2612<_0x2aefce['rules'][_0x3d27('0x28')];_0xd2612+=0x1){_0xd2612>0x0&&(_0x3add1e+='\x20'+_0x2aefce[_0x3d27('0x51')]+'\x20');_0x3add1e+=_0x2aefce[_0x3d27('0x50')][_0xd2612][_0x3d27('0x52')]?_0x3dfb3f(_0x2aefce[_0x3d27('0x50')][_0xd2612][_0x3d27('0x52')]):_0x2aefce[_0x3d27('0x50')][_0xd2612][_0x3d27('0x53')]+'\x20'+_0x2aefce['rules'][_0xd2612][_0x3d27('0x54')]+(_0x440a0c(_0x2aefce[_0x3d27('0x50')][_0xd2612][_0x3d27('0x54')])?'\x20'+_0x2aefce[_0x3d27('0x50')][_0xd2612]['value']:'');}return _0x3add1e+')';};var _0x104f9b={'where':{'id':_0x4d9190['params']['id']}},_0x2edd2f,_0x43970c,_0x71c08e,_0x33de50,_0x1aaff4;_0x104f9b=_[_0x3d27('0x2e')]({},_0x104f9b,_0x4d9190[_0x3d27('0x31')]);return db['AnalyticCustomReport'][_0x3d27('0x39')](_0x104f9b)[_0x3d27('0x1a')](function(_0x4e7cfe){if(_0x4e7cfe){_0x2edd2f=_0x4e7cfe;return _0x4e7cfe[_0x3d27('0x55')]();}return null;})[_0x3d27('0x1a')](function(_0x42ec73){if(_0x42ec73){if(!_0x42ec73[_0x3d27('0x28')]){throw new db[(_0x3d27('0x56'))][(_0x3d27('0x57'))](_0x3d27('0x58'));}_0x43970c=_0x42ec73;return db['AnalyticMetric'][_0x3d27('0x34')]({'raw':!![]});}return null;})[_0x3d27('0x1a')](function(_0x8f50dd){if(_0x8f50dd){_0x71c08e=_['keyBy'](_0x8f50dd,'id');var _0x5d47ad;var _0x34c57e=squel[_0x3d27('0x59')]();_0x34c57e[_0x3d27('0x5a')](_0x2edd2f[_0x3d27('0x5b')]);for(var _0x26fdf6=0x0;_0x26fdf6<_0x43970c[_0x3d27('0x28')];_0x26fdf6+=0x1){_0x5d47ad=_0x43970c[_0x26fdf6][_0x3d27('0x5c')]?_0x71c08e[_0x43970c[_0x26fdf6][_0x3d27('0x5c')]][_0x3d27('0x5d')]:_0x43970c[_0x26fdf6]['field'];_0x5d47ad=_0x43970c[_0x26fdf6]['function']?_['replace'](_0x4c3ebb[_0x43970c[_0x26fdf6][_0x3d27('0x5e')]],'%s',_0x5d47ad):_0x5d47ad;_0x5d47ad=_0x43970c[_0x26fdf6][_0x3d27('0x5f')]?_[_0x3d27('0x60')](_0x407347[_0x43970c[_0x26fdf6][_0x3d27('0x5f')]],'%s',_0x5d47ad):_0x5d47ad;if(_0x43970c[_0x26fdf6][_0x3d27('0x61')]){_0x34c57e[_0x3d27('0x52')](_0x5d47ad);}_0x43970c[_0x26fdf6][_0x3d27('0x62')]&&_0x34c57e['order'](_0x5d47ad,_0x43970c[_0x26fdf6]['orderBy']===_0x3d27('0x63')?![]:!![]);_0x34c57e[_0x3d27('0x53')](_0x5d47ad,_0x43970c[_0x26fdf6][_0x3d27('0x64')]||_0x5d47ad);}if(_0x2edd2f[_0x3d27('0x65')]){_0x2edd2f[_0x3d27('0x65')]=JSON[_0x3d27('0x66')](_0x2edd2f[_0x3d27('0x65')]);for(var _0x4674d9=0x0;_0x4674d9<_0x2edd2f[_0x3d27('0x65')][_0x3d27('0x28')];_0x4674d9+=0x1){if(_0x2edd2f['joins'][_0x4674d9][_0x3d27('0x67')]&&_['includes'](_0xf44f26,_0x2edd2f['joins'][_0x4674d9][_0x3d27('0x67')])&&_0x2edd2f[_0x3d27('0x65')][_0x4674d9][_0x3d27('0x68')]&&_0x2edd2f['joins'][_0x4674d9]['foreignTable']&&_0x2edd2f['joins'][_0x4674d9][_0x3d27('0x69')]){_0x34c57e[_0x2edd2f['joins'][_0x4674d9]['type']](_0x2edd2f[_0x3d27('0x65')][_0x4674d9][_0x3d27('0x6a')],null,util[_0x3d27('0x5f')](_0x3d27('0x6b'),_0x2edd2f[_0x3d27('0x5b')],_0x2edd2f[_0x3d27('0x65')][_0x4674d9]['parentKey'],_0x2edd2f['joins'][_0x4674d9][_0x3d27('0x6a')],_0x2edd2f[_0x3d27('0x65')][_0x4674d9][_0x3d27('0x69')]));}}}if(_0x2edd2f['conditions']){_0x2edd2f[_0x3d27('0x6c')]=JSON[_0x3d27('0x66')](_0x2edd2f[_0x3d27('0x6c')]);_0x34c57e[_0x3d27('0x2b')](_0x3dfb3f(_0x2edd2f['conditions'][_0x3d27('0x52')]));}_0x1aaff4=_0x34c57e['clone']();_0x34c57e[_0x3d27('0x29')](_0x54babf);_0x34c57e['offset'](0x0);logger[_0x3d27('0x6d')](_0x3d27('0x6e'),_0x34c57e[_0x3d27('0x6f')]());return db[_0x3d27('0x70')][_0x3d27('0x1f')](_0x34c57e['toString'](),{'type':db['sequelize'][_0x3d27('0x71')][_0x3d27('0x72')]});}})[_0x3d27('0x1a')](respondWithResult(_0x3778af,null))['catch'](handleError(_0x3778af,null));};function runReport(_0x8276d6,_0x35be02,_0x1be1d2){var _0x12f032=_0x35be02[_0x3d27('0x1b')];var _0x5b43f9=0xa;var _0x30c4ec=[_0x3d27('0x3f'),'left_join',_0x3d27('0x40'),'outer_join',_0x3d27('0x73')];var _0x2ff230={'SUM':_0x3d27('0x74'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x3d27('0x43'),'MAX':_0x3d27('0x44'),'MIN':_0x3d27('0x45'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x3d27('0x48')};var _0x3b9de5={'SEC_TO_TIME':_0x3d27('0x75'),'DATE':_0x3d27('0x76'),'HOUR':'HOUR(%s)','ROUND':_0x3d27('0x4a'),'UNIX_TIMESTAMP':_0x3d27('0x4b')};var _0x17d336=function(_0x29e183){return!_[_0x3d27('0x4c')]([_0x3d27('0x77'),_0x3d27('0x4d'),_0x3d27('0x4e'),_0x3d27('0x4f')],_0x29e183);};var _0x244723=function(_0x33cbce){if(!_0x33cbce||!_0x33cbce[_0x3d27('0x50')]['length']){return'';}for(var _0x52e95e='(',_0x482a23=0x0;_0x482a23<_0x33cbce[_0x3d27('0x50')][_0x3d27('0x28')];_0x482a23+=0x1){_0x482a23>0x0&&(_0x52e95e+='\x20'+_0x33cbce[_0x3d27('0x51')]+'\x20');_0x52e95e+=_0x33cbce[_0x3d27('0x50')][_0x482a23][_0x3d27('0x52')]?_0x244723(_0x33cbce[_0x3d27('0x50')][_0x482a23]['group']):_0x33cbce['rules'][_0x482a23][_0x3d27('0x53')]+'\x20'+_0x33cbce[_0x3d27('0x50')][_0x482a23]['condition']+(_0x17d336(_0x33cbce['rules'][_0x482a23][_0x3d27('0x54')])?'\x20'+_0x33cbce[_0x3d27('0x50')][_0x482a23][_0x3d27('0x78')]:'');}return _0x52e95e+')';};var _0x27a12a={'where':{'id':_0x8276d6['id']}},_0x1445ee,_0x217b79,_0x3dd0db,_0x4e61fb,_0x4117d0;_0x27a12a=_[_0x3d27('0x2e')]({},_0x27a12a,_0x1be1d2);return db[_0x3d27('0x1e')][_0x3d27('0x39')](_0x27a12a)[_0x3d27('0x1a')](function(_0xe6bc4){if(_0xe6bc4){_0x1445ee=_0xe6bc4;return _0xe6bc4['getFields']();}return null;})[_0x3d27('0x1a')](function(_0x4f2b9a){if(_0x4f2b9a){if(!_0x4f2b9a[_0x3d27('0x28')]){throw new db[(_0x3d27('0x56'))][(_0x3d27('0x57'))](_0x3d27('0x58'));}_0x217b79=_0x4f2b9a;return db[_0x3d27('0x79')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x3ad3e1){if(_0x3ad3e1){_0x3dd0db=_[_0x3d27('0x7a')](_0x3ad3e1,'id');var _0x2a77ae;var _0x26821e=squel['select']();_0x26821e['from'](_0x1445ee['table']);for(var _0x3e4fd2=0x0;_0x3e4fd2<_0x217b79[_0x3d27('0x28')];_0x3e4fd2+=0x1){_0x2a77ae=_0x217b79[_0x3e4fd2][_0x3d27('0x5c')]?_0x3dd0db[_0x217b79[_0x3e4fd2][_0x3d27('0x5c')]][_0x3d27('0x5d')]:_0x217b79[_0x3e4fd2]['field'];_0x2a77ae=_0x217b79[_0x3e4fd2]['function']?_[_0x3d27('0x60')](_0x2ff230[_0x217b79[_0x3e4fd2]['function']],'%s',_0x2a77ae):_0x2a77ae;_0x2a77ae=_0x217b79[_0x3e4fd2][_0x3d27('0x5f')]?_[_0x3d27('0x60')](_0x3b9de5[_0x217b79[_0x3e4fd2][_0x3d27('0x5f')]],'%s',_0x2a77ae):_0x2a77ae;if(_0x217b79[_0x3e4fd2][_0x3d27('0x61')]){_0x26821e['group'](_0x2a77ae);}_0x217b79[_0x3e4fd2][_0x3d27('0x62')]&&_0x26821e[_0x3d27('0x7b')](_0x2a77ae,_0x217b79[_0x3e4fd2][_0x3d27('0x62')]===_0x3d27('0x63')?![]:!![]);_0x26821e[_0x3d27('0x53')](_0x2a77ae,_0x217b79[_0x3e4fd2][_0x3d27('0x64')]||_0x2a77ae);}if(_0x1445ee[_0x3d27('0x65')]){_0x1445ee[_0x3d27('0x65')]=JSON[_0x3d27('0x66')](_0x1445ee[_0x3d27('0x65')]);for(var _0x5c32db=0x0;_0x5c32db<_0x1445ee[_0x3d27('0x65')][_0x3d27('0x28')];_0x5c32db+=0x1){if(_0x1445ee[_0x3d27('0x65')][_0x5c32db]['type']&&_[_0x3d27('0x4c')](_0x30c4ec,_0x1445ee[_0x3d27('0x65')][_0x5c32db][_0x3d27('0x67')])&&_0x1445ee[_0x3d27('0x65')][_0x5c32db]['parentKey']&&_0x1445ee[_0x3d27('0x65')][_0x5c32db][_0x3d27('0x6a')]&&_0x1445ee[_0x3d27('0x65')][_0x5c32db]['foreignKey']){_0x26821e[_0x1445ee[_0x3d27('0x65')][_0x5c32db][_0x3d27('0x67')]](_0x1445ee[_0x3d27('0x65')][_0x5c32db][_0x3d27('0x6a')],null,util[_0x3d27('0x5f')](_0x3d27('0x6b'),_0x1445ee[_0x3d27('0x5b')],_0x1445ee['joins'][_0x5c32db][_0x3d27('0x68')],_0x1445ee['joins'][_0x5c32db][_0x3d27('0x6a')],_0x1445ee[_0x3d27('0x65')][_0x5c32db][_0x3d27('0x69')]));}}}if(_0x1445ee[_0x3d27('0x6c')]){_0x1445ee[_0x3d27('0x6c')]=JSON[_0x3d27('0x66')](_0x1445ee[_0x3d27('0x6c')]);_0x26821e[_0x3d27('0x2b')](_0x244723(_0x1445ee[_0x3d27('0x6c')][_0x3d27('0x52')]));}_0x4117d0=_0x26821e[_0x3d27('0x7c')]();_0x26821e[_0x3d27('0x29')](_0x5b43f9);_0x26821e['offset'](0x0);logger['debug'](_0x3d27('0x6e'),_0x26821e[_0x3d27('0x6f')]());return db[_0x3d27('0x70')][_0x3d27('0x1f')](_0x26821e[_0x3d27('0x6f')](),{'type':db[_0x3d27('0x70')][_0x3d27('0x71')][_0x3d27('0x72')]});}})[_0x3d27('0x1a')](function(_0x2e0ac6){if(!_0x2e0ac6[_0x3d27('0x28')]){throw new db[(_0x3d27('0x56'))][(_0x3d27('0x57'))](_0x3d27('0x7d'));}if(_0x35be02[_0x3d27('0x7e')]===_0x3d27('0x7f')){return null;}var _0x185244=_[_0x3d27('0x2e')](_0x35be02,{'name':_0x35be02['fullPath']||_0x35be02[_0x3d27('0x1b')]||_0x1445ee[_0x3d27('0x1b')],'basename':_0x12f032,'savename':util['format']('%s-%s.%s',_0x35be02[_0x3d27('0x1b')]||_0x1445ee[_0x3d27('0x1b')],require('randomstring')[_0x3d27('0x80')](0x4),_0x35be02['output']||_0x3d27('0x81'))});return db[_0x3d27('0x82')][_0x3d27('0x3a')](_0x185244,{'raw':!![]});})['then'](function(_0x9c3581){_0x4117d0[_0x3d27('0x2b')](_0x1445ee['table']+_0x3d27('0x83'),_0x35be02[_0x3d27('0x84')],_0x35be02['endDate']);if(_0x9c3581){logger[_0x3d27('0x85')](_0x3d27('0x86'),_0x4117d0[_0x3d27('0x6f')]());require(_0x3d27('0x87'))[_0x3d27('0x88')](path[_0x3d27('0x3f')](__dirname,_0x3d27('0x89'),_0x9c3581[_0x3d27('0x7e')]),[_0x9c3581['id'],_0x4117d0[_0x3d27('0x6f')](),path[_0x3d27('0x3f')](__dirname,_0x3d27('0x8a'),_0x9c3581[_0x3d27('0x8b')]),_0x12f032]);return _0x9c3581;}else{var _0x5056ba=squel['select']();_0x5056ba[_0x3d27('0x5a')]('('+_0x4117d0['toString']()+')',_0x3d27('0x8c'));_0x5056ba['field'](_0x3d27('0x8d'),_0x3d27('0x15'));_0x4117d0['limit'](_0x35be02[_0x3d27('0x29')]||_0x5b43f9);_0x4117d0[_0x3d27('0x16')](_0x35be02['offset']||0x0);return db[_0x3d27('0x70')][_0x3d27('0x1f')](_0x5056ba[_0x3d27('0x6f')](),{'type':db[_0x3d27('0x70')][_0x3d27('0x71')]['SELECT']})[_0x3d27('0x1a')](function(_0x478a57){if(!_0x478a57[_0x3d27('0x28')]){_0x4e61fb=0x0;}else{_0x4e61fb=_0x478a57[0x0][_0x3d27('0x15')]||0x0;}return db[_0x3d27('0x70')]['query'](_0x4117d0[_0x3d27('0x6f')](),{'type':db[_0x3d27('0x70')][_0x3d27('0x71')][_0x3d27('0x72')]});})[_0x3d27('0x1a')](function(_0x305075){return{'rows':_0x305075||[],'count':_0x4e61fb};});}});}exports['run']=function(_0x3361de,_0x15c668){return runReport(_0x3361de['params'],_0x3361de['query'],_0x3361de[_0x3d27('0x31')])['then'](respondWithResult(_0x15c668,null))[_0x3d27('0x36')](handleError(_0x15c668,null));};exports[_0x3d27('0x8e')]=runReport;exports['query']=function(_0x4b0610,_0x29a727){var _0x58225f=0xa;var _0xee5a65=['join','left_join',_0x3d27('0x40'),'outer_join','cross_join'];var _0xff2631={'SUM':_0x3d27('0x74'),'COUNT':_0x3d27('0x42'),'COUNT DISTINCT':_0x3d27('0x43'),'MAX':_0x3d27('0x44'),'MIN':'MIN(%s)','AVG':_0x3d27('0x46'),'GROUP_CONCAT':_0x3d27('0x47'),'GROUP_CONCAT ASC':_0x3d27('0x8f'),'GROUP_CONCAT DESC':_0x3d27('0x48')};var _0x1188ea={'SEC_TO_TIME':_0x3d27('0x75'),'DATE':_0x3d27('0x76'),'HOUR':'HOUR(%s)','ROUND':_0x3d27('0x4a'),'UNIX_TIMESTAMP':_0x3d27('0x4b')};var _0x4aa0d=function(_0x2079eb){return!_[_0x3d27('0x4c')]([_0x3d27('0x77'),'IS\x20NOT\x20NULL',_0x3d27('0x4e'),'IS\x20NOT\x20EMPTY'],_0x2079eb);};var _0x246289=function(_0x5d435f){if(!_0x5d435f||!_0x5d435f[_0x3d27('0x50')]['length']){return'';}for(var _0x22bb0d='(',_0x591993=0x0;_0x591993<_0x5d435f[_0x3d27('0x50')][_0x3d27('0x28')];_0x591993+=0x1){_0x591993>0x0&&(_0x22bb0d+='\x20'+_0x5d435f[_0x3d27('0x51')]+'\x20');_0x22bb0d+=_0x5d435f[_0x3d27('0x50')][_0x591993]['group']?_0x246289(_0x5d435f[_0x3d27('0x50')][_0x591993][_0x3d27('0x52')]):_0x5d435f[_0x3d27('0x50')][_0x591993][_0x3d27('0x53')]+'\x20'+_0x5d435f[_0x3d27('0x50')][_0x591993][_0x3d27('0x54')]+(_0x4aa0d(_0x5d435f[_0x3d27('0x50')][_0x591993][_0x3d27('0x54')])?'\x20'+_0x5d435f['rules'][_0x591993][_0x3d27('0x78')]:'');}return _0x22bb0d+')';};var _0x46e9d8={'where':{'id':_0x4b0610[_0x3d27('0x38')]['id']}},_0x29d74c,_0x7ffd77,_0x3b2a8b,_0x2b6fc0,_0x33cf06;_0x46e9d8=_[_0x3d27('0x2e')]({},_0x46e9d8,_0x4b0610[_0x3d27('0x31')]);return db[_0x3d27('0x1e')][_0x3d27('0x39')](_0x46e9d8)[_0x3d27('0x1a')](function(_0x23aee6){if(_0x23aee6){_0x29d74c=_0x23aee6;return _0x23aee6[_0x3d27('0x55')]();}return null;})[_0x3d27('0x1a')](function(_0x4b30eb){if(_0x4b30eb){if(!_0x4b30eb['length']){throw new db[(_0x3d27('0x56'))][(_0x3d27('0x57'))](_0x3d27('0x58'));}_0x7ffd77=_0x4b30eb;return db[_0x3d27('0x79')][_0x3d27('0x34')]({'raw':!![]});}return null;})[_0x3d27('0x1a')](function(_0x2e1e9b){if(_0x2e1e9b){_0x3b2a8b=_[_0x3d27('0x7a')](_0x2e1e9b,'id');var _0x5d6e6a;var _0x7b640c=squel[_0x3d27('0x59')]();_0x7b640c[_0x3d27('0x5a')](_0x29d74c[_0x3d27('0x5b')]);for(var _0x3dfd4f=0x0;_0x3dfd4f<_0x7ffd77[_0x3d27('0x28')];_0x3dfd4f+=0x1){_0x5d6e6a=_0x7ffd77[_0x3dfd4f][_0x3d27('0x5c')]?_0x3b2a8b[_0x7ffd77[_0x3dfd4f][_0x3d27('0x5c')]][_0x3d27('0x5d')]:_0x7ffd77[_0x3dfd4f]['field'];_0x5d6e6a=_0x7ffd77[_0x3dfd4f][_0x3d27('0x5e')]?_[_0x3d27('0x60')](_0xff2631[_0x7ffd77[_0x3dfd4f][_0x3d27('0x5e')]],'%s',_0x5d6e6a):_0x5d6e6a;_0x5d6e6a=_0x7ffd77[_0x3dfd4f]['format']?_[_0x3d27('0x60')](_0x1188ea[_0x7ffd77[_0x3dfd4f]['format']],'%s',_0x5d6e6a):_0x5d6e6a;if(_0x7ffd77[_0x3dfd4f][_0x3d27('0x61')]){_0x7b640c[_0x3d27('0x52')](_0x5d6e6a);}_0x7ffd77[_0x3dfd4f][_0x3d27('0x62')]&&_0x7b640c[_0x3d27('0x7b')](_0x5d6e6a,_0x7ffd77[_0x3dfd4f]['orderBy']==='DESC'?![]:!![]);_0x7b640c[_0x3d27('0x53')](_0x5d6e6a,_0x7ffd77[_0x3dfd4f][_0x3d27('0x64')]||_0x5d6e6a);}if(_0x29d74c['joins']){_0x29d74c['joins']=JSON[_0x3d27('0x66')](_0x29d74c[_0x3d27('0x65')]);for(var _0x4ee91f=0x0;_0x4ee91f<_0x29d74c[_0x3d27('0x65')]['length'];_0x4ee91f+=0x1){if(_0x29d74c[_0x3d27('0x65')][_0x4ee91f][_0x3d27('0x67')]&&_['includes'](_0xee5a65,_0x29d74c['joins'][_0x4ee91f][_0x3d27('0x67')])&&_0x29d74c['joins'][_0x4ee91f][_0x3d27('0x68')]&&_0x29d74c[_0x3d27('0x65')][_0x4ee91f][_0x3d27('0x6a')]&&_0x29d74c[_0x3d27('0x65')][_0x4ee91f][_0x3d27('0x69')]){_0x7b640c[_0x29d74c[_0x3d27('0x65')][_0x4ee91f][_0x3d27('0x67')]](_0x29d74c[_0x3d27('0x65')][_0x4ee91f][_0x3d27('0x6a')],null,util[_0x3d27('0x5f')]('%s.%s\x20=\x20%s.%s',_0x29d74c['table'],_0x29d74c[_0x3d27('0x65')][_0x4ee91f][_0x3d27('0x68')],_0x29d74c[_0x3d27('0x65')][_0x4ee91f][_0x3d27('0x6a')],_0x29d74c[_0x3d27('0x65')][_0x4ee91f][_0x3d27('0x69')]));}}}if(_0x29d74c[_0x3d27('0x6c')]){_0x29d74c['conditions']=JSON[_0x3d27('0x66')](_0x29d74c['conditions']);_0x7b640c[_0x3d27('0x2b')](_0x246289(_0x29d74c[_0x3d27('0x6c')]['group']));}_0x33cf06=_0x7b640c['clone']();_0x7b640c['limit'](_0x58225f);_0x7b640c[_0x3d27('0x16')](0x0);logger[_0x3d27('0x6d')](_0x3d27('0x6e'),_0x7b640c['toString']());return db[_0x3d27('0x70')]['query'](_0x7b640c['toString'](),{'type':db[_0x3d27('0x70')][_0x3d27('0x71')][_0x3d27('0x72')]});}})[_0x3d27('0x1a')](function(){return{'sql':_0x33cf06[_0x3d27('0x6f')]()};})[_0x3d27('0x1a')](respondWithResult(_0x29a727,null))[_0x3d27('0x36')](handleError(_0x29a727,null));};
\ No newline at end of file
index aceff14..5e970c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4fd=['lodash','util','../../config/logger','api','request-promise','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb4fd,0x118));var _0xdb4f=function(_0x4da6ea,_0x1998a9){_0x4da6ea=_0x4da6ea-0x0;var _0x287d63=_0xb4fd[_0x4da6ea];return _0x287d63;};'use strict';var _=require(_0xdb4f('0x0'));var util=require(_0xdb4f('0x1'));var logger=require(_0xdb4f('0x2'))(_0xdb4f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdb4f('0x4'));var attributes=require(_0xdb4f('0x5'));module[_0xdb4f('0x6')]=function(_0x7efc4f,_0x53d650){return _0x7efc4f[_0xdb4f('0x7')](_0xdb4f('0x8'),attributes,{'tableName':_0xdb4f('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ffb=['exports','define','AnalyticCustomReport','lodash','util','../../config/logger','moment','bluebird','./analyticCustomReport.attributes'];(function(_0x1c3429,_0x11d159){var _0x1609bd=function(_0x5ce42c){while(--_0x5ce42c){_0x1c3429['push'](_0x1c3429['shift']());}};_0x1609bd(++_0x11d159);}(_0x4ffb,0xed));var _0xb4ff=function(_0xad57ee,_0x2823a6){_0xad57ee=_0xad57ee-0x0;var _0x3eaea9=_0x4ffb[_0xad57ee];return _0x3eaea9;};'use strict';var _=require(_0xb4ff('0x0'));var util=require(_0xb4ff('0x1'));var logger=require(_0xb4ff('0x2'))('api');var moment=require(_0xb4ff('0x3'));var BPromise=require(_0xb4ff('0x4'));var rp=require('request-promise');var attributes=require(_0xb4ff('0x5'));module[_0xb4ff('0x6')]=function(_0x59bf26,_0x32f964){return _0x59bf26[_0xb4ff('0x7')](_0xb4ff('0x8'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 06fb35b..263e00c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb48=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticCustomReport,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xdb48,0x161));var _0x8db4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xdb48[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0x8db4('0x0'));var util=require(_0x8db4('0x1'));var moment=require(_0x8db4('0x2'));var BPromise=require('bluebird');var rs=require(_0x8db4('0x3'));var fs=require('fs');var db=require(_0x8db4('0x4'))['db'];var utils=require(_0x8db4('0x5'));var logger=require(_0x8db4('0x6'))(_0x8db4('0x7'));var config=require(_0x8db4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8db4('0x9')][_0x8db4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x478b4d,_0x660ef0,_0x5c045e){return new BPromise(function(_0x294b3e,_0x267685){return client[_0x8db4('0xb')](_0x478b4d,_0x5c045e)['then'](function(_0x3d5501){logger[_0x8db4('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x660ef0,_0x8db4('0xd'));logger[_0x8db4('0xe')](_0x8db4('0xf'),_0x660ef0,_0x8db4('0xd'),JSON[_0x8db4('0x10')](_0x3d5501));if(_0x3d5501[_0x8db4('0x11')]){if(_0x3d5501[_0x8db4('0x11')]['code']===0x1f4){logger[_0x8db4('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x660ef0,_0x3d5501[_0x8db4('0x11')]['message']);return _0x267685(_0x3d5501[_0x8db4('0x11')]['message']);}logger[_0x8db4('0x11')](_0x8db4('0x12'),_0x660ef0,_0x3d5501[_0x8db4('0x11')][_0x8db4('0x13')]);return _0x294b3e(_0x3d5501[_0x8db4('0x11')][_0x8db4('0x13')]);}else{logger[_0x8db4('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x660ef0,_0x8db4('0xd'));_0x294b3e(_0x3d5501[_0x8db4('0x14')][_0x8db4('0x13')]);}})['catch'](function(_0x3a32d3){logger['error'](_0x8db4('0x12'),_0x660ef0,_0x3a32d3);_0x267685(_0x3a32d3);});});}
\ No newline at end of file
+var _0x6451=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x6451,0x68));var _0x1645=function(_0x23a49a,_0x11b371){_0x23a49a=_0x23a49a-0x0;var _0x454192=_0x6451[_0x23a49a];return _0x454192;};'use strict';var _=require(_0x1645('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1645('0x1'));var rs=require(_0x1645('0x2'));var fs=require('fs');var db=require(_0x1645('0x3'))['db'];var utils=require(_0x1645('0x4'));var logger=require(_0x1645('0x5'))(_0x1645('0x6'));var config=require(_0x1645('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1645('0x8')][_0x1645('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1411d1,_0x23c7ec,_0x1947cc){return new BPromise(function(_0x5a1ec4,_0x2aa94a){return client[_0x1645('0xa')](_0x1411d1,_0x1947cc)[_0x1645('0xb')](function(_0x37bcf3){logger[_0x1645('0xc')](_0x1645('0xd'),_0x23c7ec,_0x1645('0xe'));logger[_0x1645('0xf')](_0x1645('0x10'),_0x23c7ec,'request\x20sent',JSON[_0x1645('0x11')](_0x37bcf3));if(_0x37bcf3[_0x1645('0x12')]){if(_0x37bcf3[_0x1645('0x12')][_0x1645('0x13')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x23c7ec,_0x37bcf3[_0x1645('0x12')]['message']);return _0x2aa94a(_0x37bcf3['error'][_0x1645('0x14')]);}logger[_0x1645('0x12')](_0x1645('0xd'),_0x23c7ec,_0x37bcf3[_0x1645('0x12')][_0x1645('0x14')]);return _0x5a1ec4(_0x37bcf3['error']['message']);}else{logger[_0x1645('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x23c7ec,'request\x20sent');_0x5a1ec4(_0x37bcf3['result'][_0x1645('0x14')]);}})['catch'](function(_0x469592){logger['error'](_0x1645('0xd'),_0x23c7ec,_0x469592);_0x2aa94a(_0x469592);});});}
\ No newline at end of file
index b9aee60..80d9108 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31ef=['preview','/:id/run','/:id/query','post','create','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview'];(function(_0x4201de,_0x36c400){var _0x4ddb9d=function(_0x3d46fc){while(--_0x3d46fc){_0x4201de['push'](_0x4201de['shift']());}};_0x4ddb9d(++_0x36c400);}(_0x31ef,0x9b));var _0xf31e=function(_0x1ff5c7,_0x1313f5){_0x1ff5c7=_0x1ff5c7-0x0;var _0x50cbbb=_0x31ef[_0x1ff5c7];return _0x50cbbb;};'use strict';var multer=require(_0xf31e('0x0'));var util=require(_0xf31e('0x1'));var path=require('path');var express=require(_0xf31e('0x2'));var router=express[_0xf31e('0x3')]();var auth=require(_0xf31e('0x4'));var interaction=require(_0xf31e('0x5'));var config=require(_0xf31e('0x6'));var controller=require(_0xf31e('0x7'));router[_0xf31e('0x8')]('/',auth[_0xf31e('0x9')](),controller[_0xf31e('0xa')]);router['get']('/:id',auth[_0xf31e('0x9')](),controller[_0xf31e('0xb')]);router['get'](_0xf31e('0xc'),auth[_0xf31e('0x9')](),controller[_0xf31e('0xd')]);router[_0xf31e('0x8')](_0xf31e('0xe'),auth['isAuthenticated'](),controller['run']);router[_0xf31e('0x8')](_0xf31e('0xf'),auth['isAuthenticated'](),controller['query']);router[_0xf31e('0x10')]('/',auth[_0xf31e('0x9')](),controller[_0xf31e('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf31e('0x12')]('/:id',auth[_0xf31e('0x9')](),controller[_0xf31e('0x13')]);module[_0xf31e('0x14')]=router;
\ No newline at end of file
+var _0xee7c=['create','put','update','delete','destroy','express','Router','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','query','post'];(function(_0x581c3d,_0xfbe7b3){var _0x15f535=function(_0x32274c){while(--_0x32274c){_0x581c3d['push'](_0x581c3d['shift']());}};_0x15f535(++_0xfbe7b3);}(_0xee7c,0x1bd));var _0xcee7=function(_0x5f18b6,_0x94cbac){_0x5f18b6=_0x5f18b6-0x0;var _0xcfed6a=_0xee7c[_0x5f18b6];return _0xcfed6a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var express=require(_0xcee7('0x0'));var router=express[_0xcee7('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xcee7('0x2'));var config=require(_0xcee7('0x3'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xcee7('0x4')]);router[_0xcee7('0x5')](_0xcee7('0x6'),auth[_0xcee7('0x7')](),controller[_0xcee7('0x8')]);router[_0xcee7('0x5')](_0xcee7('0x9'),auth[_0xcee7('0x7')](),controller['preview']);router[_0xcee7('0x5')](_0xcee7('0xa'),auth[_0xcee7('0x7')](),controller[_0xcee7('0xb')]);router[_0xcee7('0x5')](_0xcee7('0xc'),auth['isAuthenticated'](),controller[_0xcee7('0xd')]);router[_0xcee7('0xe')]('/',auth[_0xcee7('0x7')](),controller[_0xcee7('0xf')]);router[_0xcee7('0x10')](_0xcee7('0x6'),auth[_0xcee7('0x7')](),controller[_0xcee7('0x11')]);router[_0xcee7('0x12')](_0xcee7('0x6'),auth[_0xcee7('0x7')](),controller[_0xcee7('0x13')]);module['exports']=router;
\ No newline at end of file
index 286835b..e439fa8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9d4=['sequelize','exports','STRING','TEXT'];(function(_0x2c28ee,_0x2db4ff){var _0x985bec=function(_0x1051cb){while(--_0x1051cb){_0x2c28ee['push'](_0x2c28ee['shift']());}};_0x985bec(++_0x2db4ff);}(_0xf9d4,0x110));var _0x4f9d=function(_0x493aec,_0x19c3b5){_0x493aec=_0x493aec-0x0;var _0x28e1c4=_0xf9d4[_0x493aec];return _0x28e1c4;};'use strict';var Sequelize=require(_0x4f9d('0x0'));module[_0x4f9d('0x1')]={'name':{'type':Sequelize[_0x4f9d('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4f9d('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x4f9d('0x3')]},'joins':{'type':Sequelize[_0x4f9d('0x3')]}};
\ No newline at end of file
+var _0xec10=['TEXT','STRING'];(function(_0x5a779d,_0x3de06b){var _0x3528ec=function(_0x4b2db7){while(--_0x4b2db7){_0x5a779d['push'](_0x5a779d['shift']());}};_0x3528ec(++_0x3de06b);}(_0xec10,0xe7));var _0x0ec1=function(_0x3f7693,_0x10340b){_0x3f7693=_0x3f7693-0x0;var _0x205605=_0xec10[_0x3f7693];return _0x205605;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0ec1('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x0ec1('0x0')]},'table':{'type':Sequelize[_0x0ec1('0x0')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x0ec1('0x1')]}};
\ No newline at end of file
index cf9b8ce..ce53a94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e7=['where','pick','add','day','filter','map','options','includeAll','rows','params','rawAttributes','merge','create','body','catch','find','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field!','findAll','keyBy','select','MetricId','replace','orderBy','alias','joins','parse','type','includes','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','group','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','outer_join','COUNT(%s)','MIN(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','ValidationError','AnalyticMetric','from','metric','function','groupBy','DESC','No\x20Data!','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','../../components/export/','../../files/reports','savename','countTable','html-pdf','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','AnalyticDefaultReport','model','query','dateEnd','dateStart','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x182f6e,_0x380714){var _0x165b88=function(_0x1b5a7d){while(--_0x1b5a7d){_0x182f6e['push'](_0x182f6e['shift']());}};_0x165b88(++_0x380714);}(_0xa9e7,0xfa));var _0x7a9e=function(_0x4a2a8b,_0x40f374){_0x4a2a8b=_0x4a2a8b-0x0;var _0x4a7583=_0xa9e7[_0x4a2a8b];return _0x4a7583;};'use strict';var pdf=require(_0x7a9e('0x0'));var emlformat=require(_0x7a9e('0x1'));var rimraf=require(_0x7a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7a9e('0x3'));var BPromise=require(_0x7a9e('0x4'));var Mustache=require(_0x7a9e('0x5'));var util=require(_0x7a9e('0x6'));var path=require(_0x7a9e('0x7'));var sox=require(_0x7a9e('0x8'));var csv=require(_0x7a9e('0x9'));var ejs=require(_0x7a9e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7a9e('0xb'));var crypto=require('crypto');var jsforce=require(_0x7a9e('0xc'));var deskjs=require(_0x7a9e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7a9e('0xe'));var Papa=require(_0x7a9e('0xf'));var qs=require(_0x7a9e('0x10'));var logger=require('../../config/logger')(_0x7a9e('0x11'));var utils=require(_0x7a9e('0x12'));var config=require(_0x7a9e('0x13'));var db=require(_0x7a9e('0x14'))['db'];function respondWithStatusCode(_0x5133f9,_0x58bbbc){_0x58bbbc=_0x58bbbc||0xcc;return function(_0x126637){if(_0x126637){return _0x5133f9['sendStatus'](_0x58bbbc);}return _0x5133f9['status'](_0x58bbbc)[_0x7a9e('0x15')]();};}function respondWithResult(_0x4e2203,_0x14b994){_0x14b994=_0x14b994||0xc8;return function(_0x3ded65){if(_0x3ded65){return _0x4e2203[_0x7a9e('0x16')](_0x14b994)[_0x7a9e('0x17')](_0x3ded65);}};}function respondWithFilteredResult(_0x109ffc,_0xe4199c){return function(_0x36c38e){if(_0x36c38e){var _0x3486d0=_0x36c38e[_0x7a9e('0x18')],_0xa20017=_0xe4199c[_0x7a9e('0x19')],_0x77fa33=_0xe4199c[_0x7a9e('0x19')]+_0xe4199c[_0x7a9e('0x1a')],_0x12789d;if(_0x77fa33>=_0x3486d0){_0x77fa33=_0x3486d0;_0x12789d=0xc8;}else{_0x12789d=0xce;}_0x109ffc['status'](_0x12789d);return _0x109ffc[_0x7a9e('0x1b')](_0x7a9e('0x1c'),_0xa20017+'-'+_0x77fa33+'/'+_0x3486d0)['json'](_0x36c38e);}return null;};}function patchUpdates(_0xf3b096){return function(_0x39cf4a){try{jsonpatch[_0x7a9e('0x1d')](_0x39cf4a,_0xf3b096,!![]);}catch(_0x47b8d8){return BPromise[_0x7a9e('0x1e')](_0x47b8d8);}return _0x39cf4a[_0x7a9e('0x1f')]();};}function saveUpdates(_0x521b90,_0x3578a9){return function(_0x5ed12e){if(_0x5ed12e){return _0x5ed12e[_0x7a9e('0x20')](_0x521b90)['then'](function(_0x24697a){return _0x24697a;});}return null;};}function removeEntity(_0x5cbe41,_0x42a0bd){return function(_0x204598){if(_0x204598){return _0x204598[_0x7a9e('0x21')]()[_0x7a9e('0x22')](function(){_0x5cbe41[_0x7a9e('0x16')](0xcc)[_0x7a9e('0x15')]();});}};}function handleEntityNotFound(_0x2016ef,_0x59ef60){return function(_0x2aa193){if(!_0x2aa193){_0x2016ef['sendStatus'](0x194);}return _0x2aa193;};}function handleError(_0x14dded,_0x555431){_0x555431=_0x555431||0x1f4;return function(_0x57dbfe){logger['error'](_0x57dbfe[_0x7a9e('0x23')]);if(_0x57dbfe['name']){delete _0x57dbfe[_0x7a9e('0x24')];}_0x14dded[_0x7a9e('0x16')](_0x555431)[_0x7a9e('0x25')](_0x57dbfe);};}exports[_0x7a9e('0x26')]=function(_0x5ab7c4,_0x2116e6){var _0xe1b66={},_0x46b2f5={},_0x1db781={'count':0x0,'rows':[]};var _0x4d1761=db[_0x7a9e('0x27')]['rawAttributes'];_0x46b2f5[_0x7a9e('0x28')]=_['keys'](_0x4d1761);var _0x4956cd={'dateStart':_0x5ab7c4[_0x7a9e('0x29')]['dateStart'],'dateEnd':_0x5ab7c4[_0x7a9e('0x29')][_0x7a9e('0x2a')]};delete _0x5ab7c4[_0x7a9e('0x29')][_0x7a9e('0x2b')];delete _0x5ab7c4['query'][_0x7a9e('0x2a')];_0x46b2f5[_0x7a9e('0x29')]=_[_0x7a9e('0x2c')](_0x5ab7c4['query']);_0x46b2f5[_0x7a9e('0x2d')]=_[_0x7a9e('0x2e')](_0x46b2f5[_0x7a9e('0x28')],_0x46b2f5[_0x7a9e('0x29')]);_0xe1b66[_0x7a9e('0x2f')]=_['intersection'](_0x46b2f5['model'],qs[_0x7a9e('0x30')](_0x5ab7c4[_0x7a9e('0x29')][_0x7a9e('0x30')]));_0xe1b66['attributes']=_0xe1b66['attributes'][_0x7a9e('0x31')]?_0xe1b66[_0x7a9e('0x2f')]:_0x46b2f5[_0x7a9e('0x28')];if(!_0x5ab7c4[_0x7a9e('0x29')][_0x7a9e('0x32')]('nolimit')){_0xe1b66[_0x7a9e('0x1a')]=qs[_0x7a9e('0x1a')](_0x5ab7c4[_0x7a9e('0x29')][_0x7a9e('0x1a')]);_0xe1b66[_0x7a9e('0x19')]=qs[_0x7a9e('0x19')](_0x5ab7c4[_0x7a9e('0x29')][_0x7a9e('0x19')]);}_0xe1b66[_0x7a9e('0x33')]=qs['sort'](_0x5ab7c4[_0x7a9e('0x29')]['sort']);_0xe1b66[_0x7a9e('0x34')]=qs[_0x7a9e('0x2d')](_[_0x7a9e('0x35')](_0x5ab7c4[_0x7a9e('0x29')],_0x46b2f5[_0x7a9e('0x2d')]));if(_0x4956cd[_0x7a9e('0x2b')]){if(_0x4956cd['dateEnd']){_0x4956cd[_0x7a9e('0x2a')]=moment(_0x4956cd[_0x7a9e('0x2a')])[_0x7a9e('0x36')](0x1,'day');}else{_0x4956cd[_0x7a9e('0x2a')]=moment(_0x4956cd[_0x7a9e('0x2b')])[_0x7a9e('0x36')](0x1,_0x7a9e('0x37'));}_['merge'](_0xe1b66[_0x7a9e('0x34')],{'createdAt':{'$gte':_0x4956cd[_0x7a9e('0x2b')],'$lte':_0x4956cd['dateEnd']}});}if(_0x5ab7c4[_0x7a9e('0x29')][_0x7a9e('0x38')]){_0xe1b66['where']=_['merge'](_0xe1b66['where'],{'$or':_[_0x7a9e('0x39')](_0xe1b66[_0x7a9e('0x2f')],function(_0x3d66ac){var _0x29eba1={};_0x29eba1[_0x3d66ac]={'$like':'%'+_0x5ab7c4['query']['filter']+'%'};return _0x29eba1;})});}_0xe1b66=_['merge']({},_0xe1b66,_0x5ab7c4[_0x7a9e('0x3a')]);var _0x2e530f={'where':_0xe1b66['where']};return db[_0x7a9e('0x27')]['count'](_0x2e530f)[_0x7a9e('0x22')](function(_0x1aaa99){_0x1db781[_0x7a9e('0x18')]=_0x1aaa99;if(_0x5ab7c4['query'][_0x7a9e('0x3b')]){_0xe1b66['include']=[{'all':!![]}];}return db[_0x7a9e('0x27')]['findAll'](_0xe1b66);})[_0x7a9e('0x22')](function(_0x5a7076){_0x1db781[_0x7a9e('0x3c')]=_0x5a7076;return _0x1db781;})[_0x7a9e('0x22')](respondWithFilteredResult(_0x2116e6,_0xe1b66))['catch'](handleError(_0x2116e6,null));};exports['show']=function(_0x1317f4,_0x16f0fe){var _0x3696cb={'raw':!![],'where':{'id':_0x1317f4[_0x7a9e('0x3d')]['id']}},_0xdc42b9={};_0xdc42b9[_0x7a9e('0x28')]=_[_0x7a9e('0x2c')](db[_0x7a9e('0x27')][_0x7a9e('0x3e')]);_0xdc42b9[_0x7a9e('0x29')]=_[_0x7a9e('0x2c')](_0x1317f4[_0x7a9e('0x29')]);_0xdc42b9[_0x7a9e('0x2d')]=_[_0x7a9e('0x2e')](_0xdc42b9[_0x7a9e('0x28')],_0xdc42b9[_0x7a9e('0x29')]);_0x3696cb[_0x7a9e('0x2f')]=_[_0x7a9e('0x2e')](_0xdc42b9[_0x7a9e('0x28')],qs[_0x7a9e('0x30')](_0x1317f4['query'][_0x7a9e('0x30')]));_0x3696cb[_0x7a9e('0x2f')]=_0x3696cb[_0x7a9e('0x2f')][_0x7a9e('0x31')]?_0x3696cb[_0x7a9e('0x2f')]:_0xdc42b9[_0x7a9e('0x28')];if(_0x1317f4[_0x7a9e('0x29')][_0x7a9e('0x3b')]){_0x3696cb['include']=[{'all':!![]}];}_0x3696cb=_[_0x7a9e('0x3f')]({},_0x3696cb,_0x1317f4[_0x7a9e('0x3a')]);return db[_0x7a9e('0x27')]['find'](_0x3696cb)[_0x7a9e('0x22')](handleEntityNotFound(_0x16f0fe,null))[_0x7a9e('0x22')](respondWithResult(_0x16f0fe,null))['catch'](handleError(_0x16f0fe,null));};exports[_0x7a9e('0x40')]=function(_0x1124ef,_0x573e2e){return db[_0x7a9e('0x27')]['create'](_0x1124ef[_0x7a9e('0x41')],{})[_0x7a9e('0x22')](respondWithResult(_0x573e2e,0xc9))[_0x7a9e('0x42')](handleError(_0x573e2e,null));};exports[_0x7a9e('0x20')]=function(_0x2326ce,_0x471a0e){if(_0x2326ce[_0x7a9e('0x41')]['id']){delete _0x2326ce[_0x7a9e('0x41')]['id'];}return db[_0x7a9e('0x27')][_0x7a9e('0x43')]({'where':{'id':_0x2326ce[_0x7a9e('0x3d')]['id']}})[_0x7a9e('0x22')](handleEntityNotFound(_0x471a0e,null))[_0x7a9e('0x22')](saveUpdates(_0x2326ce[_0x7a9e('0x41')],null))[_0x7a9e('0x22')](respondWithResult(_0x471a0e,null))[_0x7a9e('0x42')](handleError(_0x471a0e,null));};exports[_0x7a9e('0x21')]=function(_0x46a998,_0x4fc360){return db[_0x7a9e('0x27')]['find']({'where':{'id':_0x46a998[_0x7a9e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4fc360,null))[_0x7a9e('0x22')](removeEntity(_0x4fc360,null))['catch'](handleError(_0x4fc360,null));};exports[_0x7a9e('0x44')]=function(_0x470c1b,_0x4074f5){var _0x1cd48e=0xa;var _0x4edbf7=['join',_0x7a9e('0x45'),_0x7a9e('0x46'),'outer_join',_0x7a9e('0x47')];var _0x446b72={'SUM':_0x7a9e('0x48'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7a9e('0x49'),'MAX':_0x7a9e('0x4a'),'MIN':'MIN(%s)','AVG':_0x7a9e('0x4b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7a9e('0x4c'),'GROUP_CONCAT DESC':_0x7a9e('0x4d')};var _0x1c236d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x7a9e('0x4e'),'HOUR':_0x7a9e('0x4f'),'ROUND':_0x7a9e('0x50'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9d40=function(_0x36148b){return!_['includes']([_0x7a9e('0x51'),_0x7a9e('0x52'),'IS\x20EMPTY',_0x7a9e('0x53')],_0x36148b);};var _0x1c91eb=function(_0x414015){if(!_0x414015||!_0x414015['rules'][_0x7a9e('0x31')]){return'';}for(var _0x3e906c='(',_0x4fd7c9=0x0;_0x4fd7c9<_0x414015[_0x7a9e('0x54')]['length'];_0x4fd7c9+=0x1){_0x4fd7c9>0x0&&(_0x3e906c+='\x20'+_0x414015[_0x7a9e('0x55')]+'\x20');_0x3e906c+=_0x414015[_0x7a9e('0x54')][_0x4fd7c9]['group']?_0x1c91eb(_0x414015[_0x7a9e('0x54')][_0x4fd7c9]['group']):_0x414015['rules'][_0x4fd7c9][_0x7a9e('0x56')]+'\x20'+_0x414015[_0x7a9e('0x54')][_0x4fd7c9][_0x7a9e('0x57')]+(_0x1c9d40(_0x414015[_0x7a9e('0x54')][_0x4fd7c9][_0x7a9e('0x57')])?'\x20'+_0x414015['rules'][_0x4fd7c9][_0x7a9e('0x58')]:'');}return _0x3e906c+')';};var _0x1e3f1a={'where':{'id':_0x470c1b[_0x7a9e('0x3d')]['id']}},_0x4d8b7f,_0x38b881,_0x5cf6f7,_0x159d33,_0x24007e;_0x1e3f1a=_[_0x7a9e('0x3f')]({},_0x1e3f1a,_0x470c1b[_0x7a9e('0x3a')]);return db[_0x7a9e('0x27')][_0x7a9e('0x43')](_0x1e3f1a)[_0x7a9e('0x22')](function(_0x44275d){if(_0x44275d){_0x4d8b7f=_0x44275d;return _0x44275d[_0x7a9e('0x59')]();}return null;})[_0x7a9e('0x22')](function(_0x55d8d4){if(_0x55d8d4){if(!_0x55d8d4[_0x7a9e('0x31')]){throw new db[(_0x7a9e('0x5a'))]['ValidationError'](_0x7a9e('0x5b'));}_0x38b881=_0x55d8d4;return db['AnalyticMetric'][_0x7a9e('0x5c')]({'raw':!![]});}return null;})[_0x7a9e('0x22')](function(_0xeef15b){if(_0xeef15b){_0x5cf6f7=_[_0x7a9e('0x5d')](_0xeef15b,'id');var _0x180b91;var _0x217c20=squel[_0x7a9e('0x5e')]();_0x217c20['from'](_0x4d8b7f['table']);for(var _0x479592=0x0;_0x479592<_0x38b881[_0x7a9e('0x31')];_0x479592+=0x1){_0x180b91=_0x38b881[_0x479592][_0x7a9e('0x5f')]?_0x5cf6f7[_0x38b881[_0x479592][_0x7a9e('0x5f')]]['metric']:_0x38b881[_0x479592]['field'];_0x180b91=_0x38b881[_0x479592]['function']?_[_0x7a9e('0x60')](_0x446b72[_0x38b881[_0x479592]['function']],'%s',_0x180b91):_0x180b91;_0x180b91=_0x38b881[_0x479592]['format']?_[_0x7a9e('0x60')](_0x1c236d[_0x38b881[_0x479592]['format']],'%s',_0x180b91):_0x180b91;if(_0x38b881[_0x479592]['groupBy']){_0x217c20['group'](_0x180b91);}_0x38b881[_0x479592][_0x7a9e('0x61')]&&_0x217c20[_0x7a9e('0x33')](_0x180b91,_0x38b881[_0x479592][_0x7a9e('0x61')]==='DESC'?![]:!![]);_0x217c20['field'](_0x180b91,_0x38b881[_0x479592][_0x7a9e('0x62')]||_0x180b91);}if(_0x4d8b7f['joins']){_0x4d8b7f[_0x7a9e('0x63')]=JSON[_0x7a9e('0x64')](_0x4d8b7f[_0x7a9e('0x63')]);for(var _0x3bb660=0x0;_0x3bb660<_0x4d8b7f[_0x7a9e('0x63')][_0x7a9e('0x31')];_0x3bb660+=0x1){if(_0x4d8b7f[_0x7a9e('0x63')][_0x3bb660][_0x7a9e('0x65')]&&_[_0x7a9e('0x66')](_0x4edbf7,_0x4d8b7f[_0x7a9e('0x63')][_0x3bb660]['type'])&&_0x4d8b7f[_0x7a9e('0x63')][_0x3bb660]['parentKey']&&_0x4d8b7f[_0x7a9e('0x63')][_0x3bb660][_0x7a9e('0x67')]&&_0x4d8b7f['joins'][_0x3bb660][_0x7a9e('0x68')]){_0x217c20[_0x4d8b7f['joins'][_0x3bb660][_0x7a9e('0x65')]](_0x4d8b7f['joins'][_0x3bb660][_0x7a9e('0x67')],null,util[_0x7a9e('0x69')](_0x7a9e('0x6a'),_0x4d8b7f[_0x7a9e('0x6b')],_0x4d8b7f['joins'][_0x3bb660][_0x7a9e('0x6c')],_0x4d8b7f[_0x7a9e('0x63')][_0x3bb660][_0x7a9e('0x67')],_0x4d8b7f['joins'][_0x3bb660]['foreignKey']));}}}if(_0x4d8b7f[_0x7a9e('0x6d')]){_0x4d8b7f['conditions']=JSON[_0x7a9e('0x64')](_0x4d8b7f[_0x7a9e('0x6d')]);_0x217c20[_0x7a9e('0x34')](_0x1c91eb(_0x4d8b7f[_0x7a9e('0x6d')][_0x7a9e('0x6e')]));}_0x24007e=_0x217c20[_0x7a9e('0x6f')]();_0x217c20['limit'](_0x1cd48e);_0x217c20[_0x7a9e('0x19')](0x0);logger[_0x7a9e('0x70')](_0x7a9e('0x71'),_0x217c20[_0x7a9e('0x72')]());return db[_0x7a9e('0x73')][_0x7a9e('0x29')](_0x217c20[_0x7a9e('0x72')](),{'type':db['sequelize'][_0x7a9e('0x74')][_0x7a9e('0x75')]});}})[_0x7a9e('0x22')](respondWithResult(_0x4074f5,null))[_0x7a9e('0x42')](handleError(_0x4074f5,null));};function runReport(_0x3949ed,_0x5da9e0,_0x3c491d){var _0x3e9aac=_0x5da9e0['name'];var _0x5caedd=0xa;var _0x330c23=[_0x7a9e('0x76'),_0x7a9e('0x45'),_0x7a9e('0x46'),_0x7a9e('0x77'),_0x7a9e('0x47')];var _0xc1c661={'SUM':_0x7a9e('0x48'),'COUNT':_0x7a9e('0x78'),'COUNT DISTINCT':_0x7a9e('0x49'),'MAX':_0x7a9e('0x4a'),'MIN':_0x7a9e('0x79'),'AVG':_0x7a9e('0x4b'),'GROUP_CONCAT':_0x7a9e('0x7a'),'GROUP_CONCAT ASC':_0x7a9e('0x4c'),'GROUP_CONCAT DESC':_0x7a9e('0x4d')};var _0x35ac5c={'SEC_TO_TIME':_0x7a9e('0x7b'),'DATE':_0x7a9e('0x4e'),'HOUR':_0x7a9e('0x4f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7a9e('0x7c')};var _0x344d34=function(_0x4c2c08){return!_[_0x7a9e('0x66')]([_0x7a9e('0x51'),'IS\x20NOT\x20NULL',_0x7a9e('0x7d'),_0x7a9e('0x53')],_0x4c2c08);};var _0x296f84=function(_0x4f4c51){if(!_0x4f4c51||!_0x4f4c51[_0x7a9e('0x54')][_0x7a9e('0x31')]){return'';}for(var _0x5cc3fb='(',_0x3c18e4=0x0;_0x3c18e4<_0x4f4c51[_0x7a9e('0x54')][_0x7a9e('0x31')];_0x3c18e4+=0x1){_0x3c18e4>0x0&&(_0x5cc3fb+='\x20'+_0x4f4c51[_0x7a9e('0x55')]+'\x20');_0x5cc3fb+=_0x4f4c51[_0x7a9e('0x54')][_0x3c18e4]['group']?_0x296f84(_0x4f4c51['rules'][_0x3c18e4][_0x7a9e('0x6e')]):_0x4f4c51[_0x7a9e('0x54')][_0x3c18e4][_0x7a9e('0x56')]+'\x20'+_0x4f4c51['rules'][_0x3c18e4][_0x7a9e('0x57')]+(_0x344d34(_0x4f4c51[_0x7a9e('0x54')][_0x3c18e4]['condition'])?'\x20'+_0x4f4c51[_0x7a9e('0x54')][_0x3c18e4][_0x7a9e('0x58')]:'');}return _0x5cc3fb+')';};var _0x2eef1f={'where':{'id':_0x3949ed['id']}},_0x367eeb,_0x1c31fe,_0x363ac5,_0x535ca3,_0x2c5cca;_0x2eef1f=_[_0x7a9e('0x3f')]({},_0x2eef1f,_0x3c491d);return db['AnalyticDefaultReport']['find'](_0x2eef1f)[_0x7a9e('0x22')](function(_0x36cbe1){if(_0x36cbe1){_0x367eeb=_0x36cbe1;return _0x36cbe1[_0x7a9e('0x59')]();}return null;})[_0x7a9e('0x22')](function(_0x583837){if(_0x583837){if(!_0x583837['length']){throw new db[(_0x7a9e('0x5a'))][(_0x7a9e('0x7e'))](_0x7a9e('0x5b'));}_0x1c31fe=_0x583837;return db[_0x7a9e('0x7f')]['findAll']({'raw':!![]});}return null;})[_0x7a9e('0x22')](function(_0x146b48){if(_0x146b48){_0x363ac5=_['keyBy'](_0x146b48,'id');var _0x36b95a;var _0x2e6284=squel['select']();_0x2e6284[_0x7a9e('0x80')](_0x367eeb[_0x7a9e('0x6b')]);for(var _0x450ab7=0x0;_0x450ab7<_0x1c31fe[_0x7a9e('0x31')];_0x450ab7+=0x1){_0x36b95a=_0x1c31fe[_0x450ab7][_0x7a9e('0x5f')]?_0x363ac5[_0x1c31fe[_0x450ab7][_0x7a9e('0x5f')]][_0x7a9e('0x81')]:_0x1c31fe[_0x450ab7][_0x7a9e('0x56')];_0x36b95a=_0x1c31fe[_0x450ab7][_0x7a9e('0x82')]?_[_0x7a9e('0x60')](_0xc1c661[_0x1c31fe[_0x450ab7][_0x7a9e('0x82')]],'%s',_0x36b95a):_0x36b95a;_0x36b95a=_0x1c31fe[_0x450ab7][_0x7a9e('0x69')]?_[_0x7a9e('0x60')](_0x35ac5c[_0x1c31fe[_0x450ab7]['format']],'%s',_0x36b95a):_0x36b95a;if(_0x1c31fe[_0x450ab7][_0x7a9e('0x83')]){_0x2e6284[_0x7a9e('0x6e')](_0x36b95a);}_0x1c31fe[_0x450ab7]['orderBy']&&_0x2e6284['order'](_0x36b95a,_0x1c31fe[_0x450ab7]['orderBy']===_0x7a9e('0x84')?![]:!![]);_0x2e6284['field'](_0x36b95a,_0x1c31fe[_0x450ab7][_0x7a9e('0x62')]||_0x36b95a);}if(_0x367eeb[_0x7a9e('0x63')]){_0x367eeb[_0x7a9e('0x63')]=JSON[_0x7a9e('0x64')](_0x367eeb[_0x7a9e('0x63')]);for(var _0x4d99ef=0x0;_0x4d99ef<_0x367eeb[_0x7a9e('0x63')][_0x7a9e('0x31')];_0x4d99ef+=0x1){if(_0x367eeb[_0x7a9e('0x63')][_0x4d99ef][_0x7a9e('0x65')]&&_['includes'](_0x330c23,_0x367eeb[_0x7a9e('0x63')][_0x4d99ef]['type'])&&_0x367eeb[_0x7a9e('0x63')][_0x4d99ef][_0x7a9e('0x6c')]&&_0x367eeb['joins'][_0x4d99ef][_0x7a9e('0x67')]&&_0x367eeb[_0x7a9e('0x63')][_0x4d99ef][_0x7a9e('0x68')]){_0x2e6284[_0x367eeb[_0x7a9e('0x63')][_0x4d99ef][_0x7a9e('0x65')]](_0x367eeb['joins'][_0x4d99ef][_0x7a9e('0x67')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x367eeb[_0x7a9e('0x6b')],_0x367eeb[_0x7a9e('0x63')][_0x4d99ef]['parentKey'],_0x367eeb['joins'][_0x4d99ef][_0x7a9e('0x67')],_0x367eeb[_0x7a9e('0x63')][_0x4d99ef][_0x7a9e('0x68')]));}}}if(_0x367eeb[_0x7a9e('0x6d')]){_0x367eeb[_0x7a9e('0x6d')]=JSON['parse'](_0x367eeb['conditions']);_0x2e6284[_0x7a9e('0x34')](_0x296f84(_0x367eeb[_0x7a9e('0x6d')]['group']));}_0x2c5cca=_0x2e6284['clone']();_0x2e6284[_0x7a9e('0x1a')](_0x5caedd);_0x2e6284[_0x7a9e('0x19')](0x0);logger[_0x7a9e('0x70')](_0x7a9e('0x71'),_0x2e6284['toString']());return db[_0x7a9e('0x73')][_0x7a9e('0x29')](_0x2e6284['toString'](),{'type':db[_0x7a9e('0x73')][_0x7a9e('0x74')][_0x7a9e('0x75')]});}})[_0x7a9e('0x22')](function(_0x40fb05){if(!_0x40fb05['length']){throw new db[(_0x7a9e('0x5a'))][(_0x7a9e('0x7e'))](_0x7a9e('0x85'));}if(_0x5da9e0[_0x7a9e('0x86')]===_0x7a9e('0x87')){return null;}var _0x1e67dc=_[_0x7a9e('0x3f')](_0x5da9e0,{'name':_0x5da9e0[_0x7a9e('0x88')]||_0x5da9e0[_0x7a9e('0x24')]||_0x367eeb['name'],'basename':_0x3e9aac,'savename':util[_0x7a9e('0x69')](_0x7a9e('0x89'),_0x5da9e0[_0x7a9e('0x24')]||_0x367eeb[_0x7a9e('0x24')],require(_0x7a9e('0x8a'))[_0x7a9e('0x8b')](0x4),_0x5da9e0[_0x7a9e('0x86')]||_0x7a9e('0x8c'))});return db[_0x7a9e('0x8d')]['create'](_0x1e67dc,{'raw':!![]});})[_0x7a9e('0x22')](function(_0x1a03c4){_0x2c5cca[_0x7a9e('0x34')](_0x367eeb[_0x7a9e('0x6b')]+_0x7a9e('0x8e'),_0x5da9e0[_0x7a9e('0x8f')],_0x5da9e0[_0x7a9e('0x90')]);if(_0x1a03c4){logger[_0x7a9e('0x91')]('Run\x20Query:',_0x2c5cca[_0x7a9e('0x72')]());require(_0x7a9e('0x92'))['fork'](path[_0x7a9e('0x76')](__dirname,_0x7a9e('0x93'),_0x1a03c4[_0x7a9e('0x86')]),[_0x1a03c4['id'],_0x2c5cca[_0x7a9e('0x72')](),path['join'](__dirname,_0x7a9e('0x94'),_0x1a03c4[_0x7a9e('0x95')]),_0x3e9aac]);return _0x1a03c4;}else{var _0x22243b=squel['select']();_0x22243b[_0x7a9e('0x80')]('('+_0x2c5cca[_0x7a9e('0x72')]()+')',_0x7a9e('0x96'));_0x22243b[_0x7a9e('0x56')]('COUNT(*)','count');_0x2c5cca['limit'](_0x5da9e0[_0x7a9e('0x1a')]||_0x5caedd);_0x2c5cca[_0x7a9e('0x19')](_0x5da9e0[_0x7a9e('0x19')]||0x0);return db[_0x7a9e('0x73')][_0x7a9e('0x29')](_0x22243b['toString'](),{'type':db[_0x7a9e('0x73')][_0x7a9e('0x74')]['SELECT']})[_0x7a9e('0x22')](function(_0x1db9e3){if(!_0x1db9e3[_0x7a9e('0x31')]){_0x535ca3=0x0;}else{_0x535ca3=_0x1db9e3[0x0][_0x7a9e('0x18')]||0x0;}return db[_0x7a9e('0x73')][_0x7a9e('0x29')](_0x2c5cca[_0x7a9e('0x72')](),{'type':db[_0x7a9e('0x73')][_0x7a9e('0x74')][_0x7a9e('0x75')]});})['then'](function(_0x551ace){return{'rows':_0x551ace||[],'count':_0x535ca3};});}});}exports['run']=function(_0x57fa39,_0x3426da){return runReport(_0x57fa39['params'],_0x57fa39['query'],_0x57fa39['options'])[_0x7a9e('0x22')](respondWithResult(_0x3426da,null))['catch'](handleError(_0x3426da,null));};exports['runReport']=runReport;exports['query']=function(_0x469e34,_0x4de83c){var _0x3e3d8e=0xa;var _0x327e8f=[_0x7a9e('0x76'),_0x7a9e('0x45'),'right_join',_0x7a9e('0x77'),_0x7a9e('0x47')];var _0x9d1a18={'SUM':_0x7a9e('0x48'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7a9e('0x49'),'MAX':'MAX(%s)','MIN':_0x7a9e('0x79'),'AVG':_0x7a9e('0x4b'),'GROUP_CONCAT':_0x7a9e('0x7a'),'GROUP_CONCAT ASC':_0x7a9e('0x4c'),'GROUP_CONCAT DESC':_0x7a9e('0x4d')};var _0xbbcf23={'SEC_TO_TIME':_0x7a9e('0x7b'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x7a9e('0x50'),'UNIX_TIMESTAMP':_0x7a9e('0x7c')};var _0x27dc17=function(_0x2c622f){return!_[_0x7a9e('0x66')]([_0x7a9e('0x51'),_0x7a9e('0x52'),_0x7a9e('0x7d'),_0x7a9e('0x53')],_0x2c622f);};var _0x34ef01=function(_0x5c24ea){if(!_0x5c24ea||!_0x5c24ea['rules']['length']){return'';}for(var _0x201e3b='(',_0xdf105d=0x0;_0xdf105d<_0x5c24ea['rules'][_0x7a9e('0x31')];_0xdf105d+=0x1){_0xdf105d>0x0&&(_0x201e3b+='\x20'+_0x5c24ea['operator']+'\x20');_0x201e3b+=_0x5c24ea[_0x7a9e('0x54')][_0xdf105d][_0x7a9e('0x6e')]?_0x34ef01(_0x5c24ea[_0x7a9e('0x54')][_0xdf105d]['group']):_0x5c24ea[_0x7a9e('0x54')][_0xdf105d]['field']+'\x20'+_0x5c24ea[_0x7a9e('0x54')][_0xdf105d][_0x7a9e('0x57')]+(_0x27dc17(_0x5c24ea[_0x7a9e('0x54')][_0xdf105d][_0x7a9e('0x57')])?'\x20'+_0x5c24ea[_0x7a9e('0x54')][_0xdf105d][_0x7a9e('0x58')]:'');}return _0x201e3b+')';};var _0x4764dc={'where':{'id':_0x469e34['params']['id']}},_0x1c85e0,_0x2e2ea8,_0x1c3978,_0x194b6b,_0x81945e;_0x4764dc=_[_0x7a9e('0x3f')]({},_0x4764dc,_0x469e34[_0x7a9e('0x3a')]);return db[_0x7a9e('0x27')][_0x7a9e('0x43')](_0x4764dc)[_0x7a9e('0x22')](function(_0x148705){if(_0x148705){_0x1c85e0=_0x148705;return _0x148705[_0x7a9e('0x59')]();}return null;})[_0x7a9e('0x22')](function(_0x16cc6d){if(_0x16cc6d){if(!_0x16cc6d[_0x7a9e('0x31')]){throw new db[(_0x7a9e('0x5a'))]['ValidationError']('Please\x20insert\x20at\x20least\x20one\x20field!');}_0x2e2ea8=_0x16cc6d;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x7a9e('0x22')](function(_0x249f29){if(_0x249f29){_0x1c3978=_[_0x7a9e('0x5d')](_0x249f29,'id');var _0x35bc7a;var _0xf60965=squel[_0x7a9e('0x5e')]();_0xf60965[_0x7a9e('0x80')](_0x1c85e0[_0x7a9e('0x6b')]);for(var _0x30e4de=0x0;_0x30e4de<_0x2e2ea8[_0x7a9e('0x31')];_0x30e4de+=0x1){_0x35bc7a=_0x2e2ea8[_0x30e4de][_0x7a9e('0x5f')]?_0x1c3978[_0x2e2ea8[_0x30e4de][_0x7a9e('0x5f')]]['metric']:_0x2e2ea8[_0x30e4de][_0x7a9e('0x56')];_0x35bc7a=_0x2e2ea8[_0x30e4de][_0x7a9e('0x82')]?_['replace'](_0x9d1a18[_0x2e2ea8[_0x30e4de][_0x7a9e('0x82')]],'%s',_0x35bc7a):_0x35bc7a;_0x35bc7a=_0x2e2ea8[_0x30e4de]['format']?_[_0x7a9e('0x60')](_0xbbcf23[_0x2e2ea8[_0x30e4de][_0x7a9e('0x69')]],'%s',_0x35bc7a):_0x35bc7a;if(_0x2e2ea8[_0x30e4de][_0x7a9e('0x83')]){_0xf60965['group'](_0x35bc7a);}_0x2e2ea8[_0x30e4de][_0x7a9e('0x61')]&&_0xf60965[_0x7a9e('0x33')](_0x35bc7a,_0x2e2ea8[_0x30e4de]['orderBy']===_0x7a9e('0x84')?![]:!![]);_0xf60965[_0x7a9e('0x56')](_0x35bc7a,_0x2e2ea8[_0x30e4de]['alias']||_0x35bc7a);}if(_0x1c85e0[_0x7a9e('0x63')]){_0x1c85e0['joins']=JSON[_0x7a9e('0x64')](_0x1c85e0[_0x7a9e('0x63')]);for(var _0x5c89d7=0x0;_0x5c89d7<_0x1c85e0[_0x7a9e('0x63')][_0x7a9e('0x31')];_0x5c89d7+=0x1){if(_0x1c85e0[_0x7a9e('0x63')][_0x5c89d7][_0x7a9e('0x65')]&&_[_0x7a9e('0x66')](_0x327e8f,_0x1c85e0[_0x7a9e('0x63')][_0x5c89d7][_0x7a9e('0x65')])&&_0x1c85e0[_0x7a9e('0x63')][_0x5c89d7][_0x7a9e('0x6c')]&&_0x1c85e0[_0x7a9e('0x63')][_0x5c89d7][_0x7a9e('0x67')]&&_0x1c85e0['joins'][_0x5c89d7][_0x7a9e('0x68')]){_0xf60965[_0x1c85e0[_0x7a9e('0x63')][_0x5c89d7][_0x7a9e('0x65')]](_0x1c85e0[_0x7a9e('0x63')][_0x5c89d7][_0x7a9e('0x67')],null,util[_0x7a9e('0x69')]('%s.%s\x20=\x20%s.%s',_0x1c85e0[_0x7a9e('0x6b')],_0x1c85e0[_0x7a9e('0x63')][_0x5c89d7][_0x7a9e('0x6c')],_0x1c85e0[_0x7a9e('0x63')][_0x5c89d7][_0x7a9e('0x67')],_0x1c85e0['joins'][_0x5c89d7][_0x7a9e('0x68')]));}}}if(_0x1c85e0[_0x7a9e('0x6d')]){_0x1c85e0['conditions']=JSON[_0x7a9e('0x64')](_0x1c85e0[_0x7a9e('0x6d')]);_0xf60965['where'](_0x34ef01(_0x1c85e0[_0x7a9e('0x6d')][_0x7a9e('0x6e')]));}_0x81945e=_0xf60965[_0x7a9e('0x6f')]();_0xf60965[_0x7a9e('0x1a')](_0x3e3d8e);_0xf60965[_0x7a9e('0x19')](0x0);logger[_0x7a9e('0x70')]('Limited\x20Query:',_0xf60965[_0x7a9e('0x72')]());return db[_0x7a9e('0x73')][_0x7a9e('0x29')](_0xf60965[_0x7a9e('0x72')](),{'type':db[_0x7a9e('0x73')][_0x7a9e('0x74')]['SELECT']});}})[_0x7a9e('0x22')](function(){return{'sql':_0x81945e[_0x7a9e('0x72')]()};})[_0x7a9e('0x22')](respondWithResult(_0x4de83c,null))[_0x7a9e('0x42')](handleError(_0x4de83c,null));};
\ No newline at end of file
+var _0xdbb3=['sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','AnalyticDefaultReport','model','query','dateStart','dateEnd','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','add','day','merge','filter','map','include','findAll','catch','show','params','rawAttributes','includeAll','options','find','create','body','preview','join','left_join','right_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)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationError','Please\x20insert\x20at\x20least\x20one\x20field!','AnalyticMetric','keyBy','select','from','table','metric','field','function','replace','format','groupBy','orderBy','order','DESC','alias','joins','includes','parentKey','foreignTable','foreignKey','type','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','outer_join','cross_join','COUNT(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','IS\x20NOT\x20EMPTY','Sequelize','MetricId','QueryTypes','No\x20Data!','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xdbb3,0x1c2));var _0x3dbb=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xdbb3[_0x13e741];return _0x3f8bb3;};'use strict';var pdf=require(_0x3dbb('0x0'));var emlformat=require(_0x3dbb('0x1'));var rimraf=require(_0x3dbb('0x2'));var zipdir=require(_0x3dbb('0x3'));var jsonpatch=require(_0x3dbb('0x4'));var rp=require('request-promise');var moment=require(_0x3dbb('0x5'));var BPromise=require(_0x3dbb('0x6'));var Mustache=require(_0x3dbb('0x7'));var util=require('util');var path=require(_0x3dbb('0x8'));var sox=require(_0x3dbb('0x9'));var csv=require(_0x3dbb('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3dbb('0xb'));var squel=require(_0x3dbb('0xc'));var crypto=require('crypto');var jsforce=require(_0x3dbb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3dbb('0xa'));var querystring=require(_0x3dbb('0xe'));var Papa=require(_0x3dbb('0xf'));var qs=require(_0x3dbb('0x10'));var logger=require('../../config/logger')(_0x3dbb('0x11'));var utils=require(_0x3dbb('0x12'));var config=require(_0x3dbb('0x13'));var db=require(_0x3dbb('0x14'))['db'];function respondWithStatusCode(_0x1afbbb,_0x4bcb19){_0x4bcb19=_0x4bcb19||0xcc;return function(_0x398886){if(_0x398886){return _0x1afbbb[_0x3dbb('0x15')](_0x4bcb19);}return _0x1afbbb['status'](_0x4bcb19)[_0x3dbb('0x16')]();};}function respondWithResult(_0x51fe77,_0x321ade){_0x321ade=_0x321ade||0xc8;return function(_0x35e006){if(_0x35e006){return _0x51fe77[_0x3dbb('0x17')](_0x321ade)[_0x3dbb('0x18')](_0x35e006);}};}function respondWithFilteredResult(_0x1aa0d5,_0xb0bb4c){return function(_0x1df26b){if(_0x1df26b){var _0x65908d=_0x1df26b[_0x3dbb('0x19')],_0x33323e=_0xb0bb4c[_0x3dbb('0x1a')],_0x758918=_0xb0bb4c[_0x3dbb('0x1a')]+_0xb0bb4c['limit'],_0x504fc4;if(_0x758918>=_0x65908d){_0x758918=_0x65908d;_0x504fc4=0xc8;}else{_0x504fc4=0xce;}_0x1aa0d5[_0x3dbb('0x17')](_0x504fc4);return _0x1aa0d5[_0x3dbb('0x1b')](_0x3dbb('0x1c'),_0x33323e+'-'+_0x758918+'/'+_0x65908d)[_0x3dbb('0x18')](_0x1df26b);}return null;};}function patchUpdates(_0x3a5c81){return function(_0x21c12a){try{jsonpatch[_0x3dbb('0x1d')](_0x21c12a,_0x3a5c81,!![]);}catch(_0x313bfd){return BPromise[_0x3dbb('0x1e')](_0x313bfd);}return _0x21c12a['save']();};}function saveUpdates(_0x182f06,_0xfc8ab8){return function(_0x4b43d4){if(_0x4b43d4){return _0x4b43d4[_0x3dbb('0x1f')](_0x182f06)[_0x3dbb('0x20')](function(_0x28ee71){return _0x28ee71;});}return null;};}function removeEntity(_0x5eb635,_0x19e8fc){return function(_0x58f2b7){if(_0x58f2b7){return _0x58f2b7[_0x3dbb('0x21')]()[_0x3dbb('0x20')](function(){_0x5eb635[_0x3dbb('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bfc2a,_0x35911e){return function(_0x5c13aa){if(!_0x5c13aa){_0x3bfc2a[_0x3dbb('0x15')](0x194);}return _0x5c13aa;};}function handleError(_0x444c68,_0xa5862d){_0xa5862d=_0xa5862d||0x1f4;return function(_0x43eb58){logger[_0x3dbb('0x22')](_0x43eb58[_0x3dbb('0x23')]);if(_0x43eb58[_0x3dbb('0x24')]){delete _0x43eb58['name'];}_0x444c68[_0x3dbb('0x17')](_0xa5862d)['send'](_0x43eb58);};}exports[_0x3dbb('0x25')]=function(_0x437021,_0x2c7c05){var _0x4aadad={},_0x27f38b={},_0x4c3c28={'count':0x0,'rows':[]};var _0x4ba86f=db[_0x3dbb('0x26')]['rawAttributes'];_0x27f38b[_0x3dbb('0x27')]=_['keys'](_0x4ba86f);var _0x2ffe0a={'dateStart':_0x437021[_0x3dbb('0x28')][_0x3dbb('0x29')],'dateEnd':_0x437021['query'][_0x3dbb('0x2a')]};delete _0x437021[_0x3dbb('0x28')][_0x3dbb('0x29')];delete _0x437021[_0x3dbb('0x28')][_0x3dbb('0x2a')];_0x27f38b[_0x3dbb('0x28')]=_[_0x3dbb('0x2b')](_0x437021[_0x3dbb('0x28')]);_0x27f38b[_0x3dbb('0x2c')]=_[_0x3dbb('0x2d')](_0x27f38b['model'],_0x27f38b[_0x3dbb('0x28')]);_0x4aadad[_0x3dbb('0x2e')]=_[_0x3dbb('0x2d')](_0x27f38b[_0x3dbb('0x27')],qs[_0x3dbb('0x2f')](_0x437021[_0x3dbb('0x28')][_0x3dbb('0x2f')]));_0x4aadad[_0x3dbb('0x2e')]=_0x4aadad['attributes'][_0x3dbb('0x30')]?_0x4aadad['attributes']:_0x27f38b['model'];if(!_0x437021['query'][_0x3dbb('0x31')](_0x3dbb('0x32'))){_0x4aadad[_0x3dbb('0x33')]=qs[_0x3dbb('0x33')](_0x437021[_0x3dbb('0x28')][_0x3dbb('0x33')]);_0x4aadad[_0x3dbb('0x1a')]=qs[_0x3dbb('0x1a')](_0x437021[_0x3dbb('0x28')][_0x3dbb('0x1a')]);}_0x4aadad['order']=qs[_0x3dbb('0x34')](_0x437021[_0x3dbb('0x28')]['sort']);_0x4aadad[_0x3dbb('0x35')]=qs[_0x3dbb('0x2c')](_[_0x3dbb('0x36')](_0x437021[_0x3dbb('0x28')],_0x27f38b['filters']));if(_0x2ffe0a[_0x3dbb('0x29')]){if(_0x2ffe0a[_0x3dbb('0x2a')]){_0x2ffe0a[_0x3dbb('0x2a')]=moment(_0x2ffe0a[_0x3dbb('0x2a')])[_0x3dbb('0x37')](0x1,_0x3dbb('0x38'));}else{_0x2ffe0a['dateEnd']=moment(_0x2ffe0a[_0x3dbb('0x29')])[_0x3dbb('0x37')](0x1,'day');}_[_0x3dbb('0x39')](_0x4aadad[_0x3dbb('0x35')],{'createdAt':{'$gte':_0x2ffe0a[_0x3dbb('0x29')],'$lte':_0x2ffe0a['dateEnd']}});}if(_0x437021[_0x3dbb('0x28')][_0x3dbb('0x3a')]){_0x4aadad[_0x3dbb('0x35')]=_[_0x3dbb('0x39')](_0x4aadad[_0x3dbb('0x35')],{'$or':_[_0x3dbb('0x3b')](_0x4aadad[_0x3dbb('0x2e')],function(_0x1aba50){var _0x4a4205={};_0x4a4205[_0x1aba50]={'$like':'%'+_0x437021[_0x3dbb('0x28')][_0x3dbb('0x3a')]+'%'};return _0x4a4205;})});}_0x4aadad=_[_0x3dbb('0x39')]({},_0x4aadad,_0x437021['options']);var _0x4c1f66={'where':_0x4aadad['where']};return db[_0x3dbb('0x26')][_0x3dbb('0x19')](_0x4c1f66)[_0x3dbb('0x20')](function(_0x274896){_0x4c3c28[_0x3dbb('0x19')]=_0x274896;if(_0x437021[_0x3dbb('0x28')]['includeAll']){_0x4aadad[_0x3dbb('0x3c')]=[{'all':!![]}];}return db[_0x3dbb('0x26')][_0x3dbb('0x3d')](_0x4aadad);})[_0x3dbb('0x20')](function(_0x35151e){_0x4c3c28['rows']=_0x35151e;return _0x4c3c28;})[_0x3dbb('0x20')](respondWithFilteredResult(_0x2c7c05,_0x4aadad))[_0x3dbb('0x3e')](handleError(_0x2c7c05,null));};exports[_0x3dbb('0x3f')]=function(_0x23b147,_0x1d4955){var _0x4d9132={'raw':!![],'where':{'id':_0x23b147[_0x3dbb('0x40')]['id']}},_0x303c46={};_0x303c46['model']=_[_0x3dbb('0x2b')](db[_0x3dbb('0x26')][_0x3dbb('0x41')]);_0x303c46['query']=_[_0x3dbb('0x2b')](_0x23b147['query']);_0x303c46[_0x3dbb('0x2c')]=_['intersection'](_0x303c46[_0x3dbb('0x27')],_0x303c46[_0x3dbb('0x28')]);_0x4d9132[_0x3dbb('0x2e')]=_[_0x3dbb('0x2d')](_0x303c46[_0x3dbb('0x27')],qs[_0x3dbb('0x2f')](_0x23b147['query'][_0x3dbb('0x2f')]));_0x4d9132[_0x3dbb('0x2e')]=_0x4d9132[_0x3dbb('0x2e')][_0x3dbb('0x30')]?_0x4d9132[_0x3dbb('0x2e')]:_0x303c46[_0x3dbb('0x27')];if(_0x23b147[_0x3dbb('0x28')][_0x3dbb('0x42')]){_0x4d9132['include']=[{'all':!![]}];}_0x4d9132=_[_0x3dbb('0x39')]({},_0x4d9132,_0x23b147[_0x3dbb('0x43')]);return db[_0x3dbb('0x26')][_0x3dbb('0x44')](_0x4d9132)[_0x3dbb('0x20')](handleEntityNotFound(_0x1d4955,null))['then'](respondWithResult(_0x1d4955,null))[_0x3dbb('0x3e')](handleError(_0x1d4955,null));};exports[_0x3dbb('0x45')]=function(_0x4d21d0,_0xf9037d){return db[_0x3dbb('0x26')]['create'](_0x4d21d0[_0x3dbb('0x46')],{})[_0x3dbb('0x20')](respondWithResult(_0xf9037d,0xc9))[_0x3dbb('0x3e')](handleError(_0xf9037d,null));};exports[_0x3dbb('0x1f')]=function(_0x580913,_0x5c6c90){if(_0x580913['body']['id']){delete _0x580913[_0x3dbb('0x46')]['id'];}return db[_0x3dbb('0x26')][_0x3dbb('0x44')]({'where':{'id':_0x580913[_0x3dbb('0x40')]['id']}})['then'](handleEntityNotFound(_0x5c6c90,null))[_0x3dbb('0x20')](saveUpdates(_0x580913[_0x3dbb('0x46')],null))['then'](respondWithResult(_0x5c6c90,null))[_0x3dbb('0x3e')](handleError(_0x5c6c90,null));};exports[_0x3dbb('0x21')]=function(_0x3cda5c,_0x25bbc6){return db[_0x3dbb('0x26')][_0x3dbb('0x44')]({'where':{'id':_0x3cda5c[_0x3dbb('0x40')]['id']}})[_0x3dbb('0x20')](handleEntityNotFound(_0x25bbc6,null))[_0x3dbb('0x20')](removeEntity(_0x25bbc6,null))[_0x3dbb('0x3e')](handleError(_0x25bbc6,null));};exports[_0x3dbb('0x47')]=function(_0x3c6696,_0x4d2c60){var _0x27b67f=0xa;var _0x29f5b1=[_0x3dbb('0x48'),_0x3dbb('0x49'),_0x3dbb('0x4a'),'outer_join','cross_join'];var _0x361422={'SUM':_0x3dbb('0x4b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x3dbb('0x4c'),'MAX':_0x3dbb('0x4d'),'MIN':_0x3dbb('0x4e'),'AVG':_0x3dbb('0x4f'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x3dbb('0x50'),'GROUP_CONCAT DESC':_0x3dbb('0x51')};var _0x157800={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x3dbb('0x52'),'ROUND':_0x3dbb('0x53'),'UNIX_TIMESTAMP':_0x3dbb('0x54')};var _0x35ad0b=function(_0x169f19){return!_['includes']([_0x3dbb('0x55'),_0x3dbb('0x56'),_0x3dbb('0x57'),'IS\x20NOT\x20EMPTY'],_0x169f19);};var _0xa82ef8=function(_0x1e90e1){if(!_0x1e90e1||!_0x1e90e1[_0x3dbb('0x58')]['length']){return'';}for(var _0x4114b6='(',_0x30101a=0x0;_0x30101a<_0x1e90e1[_0x3dbb('0x58')]['length'];_0x30101a+=0x1){_0x30101a>0x0&&(_0x4114b6+='\x20'+_0x1e90e1[_0x3dbb('0x59')]+'\x20');_0x4114b6+=_0x1e90e1[_0x3dbb('0x58')][_0x30101a]['group']?_0xa82ef8(_0x1e90e1[_0x3dbb('0x58')][_0x30101a][_0x3dbb('0x5a')]):_0x1e90e1[_0x3dbb('0x58')][_0x30101a]['field']+'\x20'+_0x1e90e1[_0x3dbb('0x58')][_0x30101a][_0x3dbb('0x5b')]+(_0x35ad0b(_0x1e90e1[_0x3dbb('0x58')][_0x30101a][_0x3dbb('0x5b')])?'\x20'+_0x1e90e1[_0x3dbb('0x58')][_0x30101a][_0x3dbb('0x5c')]:'');}return _0x4114b6+')';};var _0x5b4db6={'where':{'id':_0x3c6696[_0x3dbb('0x40')]['id']}},_0x317f93,_0x408a3c,_0x279778,_0x493b6b,_0x1afeff;_0x5b4db6=_[_0x3dbb('0x39')]({},_0x5b4db6,_0x3c6696[_0x3dbb('0x43')]);return db['AnalyticDefaultReport'][_0x3dbb('0x44')](_0x5b4db6)[_0x3dbb('0x20')](function(_0x243b03){if(_0x243b03){_0x317f93=_0x243b03;return _0x243b03[_0x3dbb('0x5d')]();}return null;})[_0x3dbb('0x20')](function(_0x26c603){if(_0x26c603){if(!_0x26c603[_0x3dbb('0x30')]){throw new db['Sequelize'][(_0x3dbb('0x5e'))](_0x3dbb('0x5f'));}_0x408a3c=_0x26c603;return db[_0x3dbb('0x60')][_0x3dbb('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x21ca5c){if(_0x21ca5c){_0x279778=_[_0x3dbb('0x61')](_0x21ca5c,'id');var _0x3769f8;var _0x42b638=squel[_0x3dbb('0x62')]();_0x42b638[_0x3dbb('0x63')](_0x317f93[_0x3dbb('0x64')]);for(var _0x3e34e6=0x0;_0x3e34e6<_0x408a3c[_0x3dbb('0x30')];_0x3e34e6+=0x1){_0x3769f8=_0x408a3c[_0x3e34e6]['MetricId']?_0x279778[_0x408a3c[_0x3e34e6]['MetricId']][_0x3dbb('0x65')]:_0x408a3c[_0x3e34e6][_0x3dbb('0x66')];_0x3769f8=_0x408a3c[_0x3e34e6][_0x3dbb('0x67')]?_[_0x3dbb('0x68')](_0x361422[_0x408a3c[_0x3e34e6]['function']],'%s',_0x3769f8):_0x3769f8;_0x3769f8=_0x408a3c[_0x3e34e6][_0x3dbb('0x69')]?_[_0x3dbb('0x68')](_0x157800[_0x408a3c[_0x3e34e6]['format']],'%s',_0x3769f8):_0x3769f8;if(_0x408a3c[_0x3e34e6][_0x3dbb('0x6a')]){_0x42b638[_0x3dbb('0x5a')](_0x3769f8);}_0x408a3c[_0x3e34e6][_0x3dbb('0x6b')]&&_0x42b638[_0x3dbb('0x6c')](_0x3769f8,_0x408a3c[_0x3e34e6][_0x3dbb('0x6b')]===_0x3dbb('0x6d')?![]:!![]);_0x42b638[_0x3dbb('0x66')](_0x3769f8,_0x408a3c[_0x3e34e6][_0x3dbb('0x6e')]||_0x3769f8);}if(_0x317f93[_0x3dbb('0x6f')]){_0x317f93[_0x3dbb('0x6f')]=JSON['parse'](_0x317f93['joins']);for(var _0x5ce7ed=0x0;_0x5ce7ed<_0x317f93[_0x3dbb('0x6f')][_0x3dbb('0x30')];_0x5ce7ed+=0x1){if(_0x317f93[_0x3dbb('0x6f')][_0x5ce7ed]['type']&&_[_0x3dbb('0x70')](_0x29f5b1,_0x317f93[_0x3dbb('0x6f')][_0x5ce7ed]['type'])&&_0x317f93[_0x3dbb('0x6f')][_0x5ce7ed][_0x3dbb('0x71')]&&_0x317f93[_0x3dbb('0x6f')][_0x5ce7ed][_0x3dbb('0x72')]&&_0x317f93[_0x3dbb('0x6f')][_0x5ce7ed][_0x3dbb('0x73')]){_0x42b638[_0x317f93[_0x3dbb('0x6f')][_0x5ce7ed][_0x3dbb('0x74')]](_0x317f93['joins'][_0x5ce7ed][_0x3dbb('0x72')],null,util[_0x3dbb('0x69')](_0x3dbb('0x75'),_0x317f93[_0x3dbb('0x64')],_0x317f93[_0x3dbb('0x6f')][_0x5ce7ed]['parentKey'],_0x317f93[_0x3dbb('0x6f')][_0x5ce7ed][_0x3dbb('0x72')],_0x317f93['joins'][_0x5ce7ed]['foreignKey']));}}}if(_0x317f93[_0x3dbb('0x76')]){_0x317f93[_0x3dbb('0x76')]=JSON[_0x3dbb('0x77')](_0x317f93[_0x3dbb('0x76')]);_0x42b638[_0x3dbb('0x35')](_0xa82ef8(_0x317f93[_0x3dbb('0x76')][_0x3dbb('0x5a')]));}_0x1afeff=_0x42b638[_0x3dbb('0x78')]();_0x42b638[_0x3dbb('0x33')](_0x27b67f);_0x42b638[_0x3dbb('0x1a')](0x0);logger[_0x3dbb('0x79')](_0x3dbb('0x7a'),_0x42b638[_0x3dbb('0x7b')]());return db[_0x3dbb('0x7c')][_0x3dbb('0x28')](_0x42b638[_0x3dbb('0x7b')](),{'type':db[_0x3dbb('0x7c')]['QueryTypes'][_0x3dbb('0x7d')]});}})[_0x3dbb('0x20')](respondWithResult(_0x4d2c60,null))[_0x3dbb('0x3e')](handleError(_0x4d2c60,null));};function runReport(_0x2f955b,_0x40642b,_0x6fb70b){var _0x4e92d2=_0x40642b[_0x3dbb('0x24')];var _0x2419f8=0xa;var _0x12c4df=[_0x3dbb('0x48'),_0x3dbb('0x49'),_0x3dbb('0x4a'),_0x3dbb('0x7e'),_0x3dbb('0x7f')];var _0x3c8e24={'SUM':_0x3dbb('0x4b'),'COUNT':_0x3dbb('0x80'),'COUNT DISTINCT':_0x3dbb('0x4c'),'MAX':'MAX(%s)','MIN':_0x3dbb('0x4e'),'AVG':_0x3dbb('0x4f'),'GROUP_CONCAT':_0x3dbb('0x81'),'GROUP_CONCAT ASC':_0x3dbb('0x50'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x565b24={'SEC_TO_TIME':_0x3dbb('0x82'),'DATE':_0x3dbb('0x83'),'HOUR':'HOUR(%s)','ROUND':_0x3dbb('0x53'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x62cd57=function(_0x2dcc9){return!_[_0x3dbb('0x70')]([_0x3dbb('0x55'),_0x3dbb('0x56'),_0x3dbb('0x57'),_0x3dbb('0x84')],_0x2dcc9);};var _0x583457=function(_0x252664){if(!_0x252664||!_0x252664['rules'][_0x3dbb('0x30')]){return'';}for(var _0x67f0fe='(',_0x319856=0x0;_0x319856<_0x252664[_0x3dbb('0x58')][_0x3dbb('0x30')];_0x319856+=0x1){_0x319856>0x0&&(_0x67f0fe+='\x20'+_0x252664['operator']+'\x20');_0x67f0fe+=_0x252664[_0x3dbb('0x58')][_0x319856][_0x3dbb('0x5a')]?_0x583457(_0x252664[_0x3dbb('0x58')][_0x319856][_0x3dbb('0x5a')]):_0x252664[_0x3dbb('0x58')][_0x319856][_0x3dbb('0x66')]+'\x20'+_0x252664[_0x3dbb('0x58')][_0x319856]['condition']+(_0x62cd57(_0x252664[_0x3dbb('0x58')][_0x319856][_0x3dbb('0x5b')])?'\x20'+_0x252664[_0x3dbb('0x58')][_0x319856][_0x3dbb('0x5c')]:'');}return _0x67f0fe+')';};var _0x431b54={'where':{'id':_0x2f955b['id']}},_0x132cd9,_0x306d00,_0x12dcd7,_0x30b875,_0x216902;_0x431b54=_['merge']({},_0x431b54,_0x6fb70b);return db[_0x3dbb('0x26')][_0x3dbb('0x44')](_0x431b54)[_0x3dbb('0x20')](function(_0x53ba8c){if(_0x53ba8c){_0x132cd9=_0x53ba8c;return _0x53ba8c['getFields']();}return null;})[_0x3dbb('0x20')](function(_0x3ebf06){if(_0x3ebf06){if(!_0x3ebf06[_0x3dbb('0x30')]){throw new db[(_0x3dbb('0x85'))]['ValidationError'](_0x3dbb('0x5f'));}_0x306d00=_0x3ebf06;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x3dbb('0x20')](function(_0x2c774f){if(_0x2c774f){_0x12dcd7=_[_0x3dbb('0x61')](_0x2c774f,'id');var _0x4f134a;var _0xbc3405=squel[_0x3dbb('0x62')]();_0xbc3405['from'](_0x132cd9[_0x3dbb('0x64')]);for(var _0x247eb9=0x0;_0x247eb9<_0x306d00[_0x3dbb('0x30')];_0x247eb9+=0x1){_0x4f134a=_0x306d00[_0x247eb9][_0x3dbb('0x86')]?_0x12dcd7[_0x306d00[_0x247eb9][_0x3dbb('0x86')]][_0x3dbb('0x65')]:_0x306d00[_0x247eb9][_0x3dbb('0x66')];_0x4f134a=_0x306d00[_0x247eb9][_0x3dbb('0x67')]?_['replace'](_0x3c8e24[_0x306d00[_0x247eb9][_0x3dbb('0x67')]],'%s',_0x4f134a):_0x4f134a;_0x4f134a=_0x306d00[_0x247eb9]['format']?_['replace'](_0x565b24[_0x306d00[_0x247eb9][_0x3dbb('0x69')]],'%s',_0x4f134a):_0x4f134a;if(_0x306d00[_0x247eb9][_0x3dbb('0x6a')]){_0xbc3405[_0x3dbb('0x5a')](_0x4f134a);}_0x306d00[_0x247eb9][_0x3dbb('0x6b')]&&_0xbc3405['order'](_0x4f134a,_0x306d00[_0x247eb9]['orderBy']===_0x3dbb('0x6d')?![]:!![]);_0xbc3405[_0x3dbb('0x66')](_0x4f134a,_0x306d00[_0x247eb9][_0x3dbb('0x6e')]||_0x4f134a);}if(_0x132cd9[_0x3dbb('0x6f')]){_0x132cd9[_0x3dbb('0x6f')]=JSON[_0x3dbb('0x77')](_0x132cd9['joins']);for(var _0x4ee082=0x0;_0x4ee082<_0x132cd9['joins'][_0x3dbb('0x30')];_0x4ee082+=0x1){if(_0x132cd9['joins'][_0x4ee082]['type']&&_[_0x3dbb('0x70')](_0x12c4df,_0x132cd9[_0x3dbb('0x6f')][_0x4ee082]['type'])&&_0x132cd9[_0x3dbb('0x6f')][_0x4ee082][_0x3dbb('0x71')]&&_0x132cd9['joins'][_0x4ee082]['foreignTable']&&_0x132cd9[_0x3dbb('0x6f')][_0x4ee082]['foreignKey']){_0xbc3405[_0x132cd9[_0x3dbb('0x6f')][_0x4ee082][_0x3dbb('0x74')]](_0x132cd9[_0x3dbb('0x6f')][_0x4ee082]['foreignTable'],null,util[_0x3dbb('0x69')](_0x3dbb('0x75'),_0x132cd9[_0x3dbb('0x64')],_0x132cd9[_0x3dbb('0x6f')][_0x4ee082]['parentKey'],_0x132cd9[_0x3dbb('0x6f')][_0x4ee082][_0x3dbb('0x72')],_0x132cd9[_0x3dbb('0x6f')][_0x4ee082]['foreignKey']));}}}if(_0x132cd9[_0x3dbb('0x76')]){_0x132cd9[_0x3dbb('0x76')]=JSON[_0x3dbb('0x77')](_0x132cd9[_0x3dbb('0x76')]);_0xbc3405[_0x3dbb('0x35')](_0x583457(_0x132cd9[_0x3dbb('0x76')]['group']));}_0x216902=_0xbc3405['clone']();_0xbc3405[_0x3dbb('0x33')](_0x2419f8);_0xbc3405['offset'](0x0);logger[_0x3dbb('0x79')](_0x3dbb('0x7a'),_0xbc3405[_0x3dbb('0x7b')]());return db[_0x3dbb('0x7c')][_0x3dbb('0x28')](_0xbc3405[_0x3dbb('0x7b')](),{'type':db[_0x3dbb('0x7c')][_0x3dbb('0x87')][_0x3dbb('0x7d')]});}})[_0x3dbb('0x20')](function(_0x1a12b1){if(!_0x1a12b1['length']){throw new db[(_0x3dbb('0x85'))]['ValidationError'](_0x3dbb('0x88'));}if(_0x40642b[_0x3dbb('0x89')]===_0x3dbb('0x8a')){return null;}var _0x4667e1=_[_0x3dbb('0x39')](_0x40642b,{'name':_0x40642b[_0x3dbb('0x8b')]||_0x40642b[_0x3dbb('0x24')]||_0x132cd9[_0x3dbb('0x24')],'basename':_0x4e92d2,'savename':util[_0x3dbb('0x69')](_0x3dbb('0x8c'),_0x40642b[_0x3dbb('0x24')]||_0x132cd9['name'],require(_0x3dbb('0x8d'))[_0x3dbb('0x8e')](0x4),_0x40642b[_0x3dbb('0x89')]||_0x3dbb('0x8f'))});return db[_0x3dbb('0x90')][_0x3dbb('0x45')](_0x4667e1,{'raw':!![]});})['then'](function(_0x1d9ca8){_0x216902[_0x3dbb('0x35')](_0x132cd9['table']+_0x3dbb('0x91'),_0x40642b[_0x3dbb('0x92')],_0x40642b[_0x3dbb('0x93')]);if(_0x1d9ca8){logger['info'](_0x3dbb('0x94'),_0x216902[_0x3dbb('0x7b')]());require(_0x3dbb('0x95'))[_0x3dbb('0x96')](path[_0x3dbb('0x48')](__dirname,_0x3dbb('0x97'),_0x1d9ca8[_0x3dbb('0x89')]),[_0x1d9ca8['id'],_0x216902[_0x3dbb('0x7b')](),path['join'](__dirname,_0x3dbb('0x98'),_0x1d9ca8[_0x3dbb('0x99')]),_0x4e92d2]);return _0x1d9ca8;}else{var _0xa15cfa=squel[_0x3dbb('0x62')]();_0xa15cfa[_0x3dbb('0x63')]('('+_0x216902[_0x3dbb('0x7b')]()+')',_0x3dbb('0x9a'));_0xa15cfa[_0x3dbb('0x66')](_0x3dbb('0x9b'),_0x3dbb('0x19'));_0x216902['limit'](_0x40642b[_0x3dbb('0x33')]||_0x2419f8);_0x216902[_0x3dbb('0x1a')](_0x40642b[_0x3dbb('0x1a')]||0x0);return db[_0x3dbb('0x7c')]['query'](_0xa15cfa[_0x3dbb('0x7b')](),{'type':db[_0x3dbb('0x7c')]['QueryTypes']['SELECT']})[_0x3dbb('0x20')](function(_0x8a062d){if(!_0x8a062d[_0x3dbb('0x30')]){_0x30b875=0x0;}else{_0x30b875=_0x8a062d[0x0][_0x3dbb('0x19')]||0x0;}return db[_0x3dbb('0x7c')][_0x3dbb('0x28')](_0x216902[_0x3dbb('0x7b')](),{'type':db['sequelize'][_0x3dbb('0x87')][_0x3dbb('0x7d')]});})[_0x3dbb('0x20')](function(_0x3b292d){return{'rows':_0x3b292d||[],'count':_0x30b875};});}});}exports[_0x3dbb('0x9c')]=function(_0x385fa0,_0x459f79){return runReport(_0x385fa0['params'],_0x385fa0[_0x3dbb('0x28')],_0x385fa0['options'])['then'](respondWithResult(_0x459f79,null))['catch'](handleError(_0x459f79,null));};exports['runReport']=runReport;exports[_0x3dbb('0x28')]=function(_0x354ff4,_0x5d5989){var _0x26c163=0xa;var _0xbbaa15=[_0x3dbb('0x48'),'left_join',_0x3dbb('0x4a'),_0x3dbb('0x7e'),_0x3dbb('0x7f')];var _0x264dfe={'SUM':_0x3dbb('0x4b'),'COUNT':_0x3dbb('0x80'),'COUNT DISTINCT':_0x3dbb('0x4c'),'MAX':_0x3dbb('0x4d'),'MIN':'MIN(%s)','AVG':_0x3dbb('0x4f'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x3dbb('0x50'),'GROUP_CONCAT DESC':_0x3dbb('0x51')};var _0x49493b={'SEC_TO_TIME':_0x3dbb('0x82'),'DATE':_0x3dbb('0x83'),'HOUR':_0x3dbb('0x52'),'ROUND':_0x3dbb('0x53'),'UNIX_TIMESTAMP':_0x3dbb('0x54')};var _0x4af1ce=function(_0xf77c94){return!_[_0x3dbb('0x70')]([_0x3dbb('0x55'),_0x3dbb('0x56'),_0x3dbb('0x57'),'IS\x20NOT\x20EMPTY'],_0xf77c94);};var _0x14ab48=function(_0x5df850){if(!_0x5df850||!_0x5df850[_0x3dbb('0x58')]['length']){return'';}for(var _0x15689e='(',_0x179471=0x0;_0x179471<_0x5df850[_0x3dbb('0x58')][_0x3dbb('0x30')];_0x179471+=0x1){_0x179471>0x0&&(_0x15689e+='\x20'+_0x5df850[_0x3dbb('0x59')]+'\x20');_0x15689e+=_0x5df850[_0x3dbb('0x58')][_0x179471][_0x3dbb('0x5a')]?_0x14ab48(_0x5df850[_0x3dbb('0x58')][_0x179471][_0x3dbb('0x5a')]):_0x5df850[_0x3dbb('0x58')][_0x179471]['field']+'\x20'+_0x5df850[_0x3dbb('0x58')][_0x179471][_0x3dbb('0x5b')]+(_0x4af1ce(_0x5df850[_0x3dbb('0x58')][_0x179471][_0x3dbb('0x5b')])?'\x20'+_0x5df850[_0x3dbb('0x58')][_0x179471][_0x3dbb('0x5c')]:'');}return _0x15689e+')';};var _0x1b207a={'where':{'id':_0x354ff4[_0x3dbb('0x40')]['id']}},_0x369cc4,_0x1681fd,_0x295664,_0x3f7666,_0x32c903;_0x1b207a=_[_0x3dbb('0x39')]({},_0x1b207a,_0x354ff4['options']);return db[_0x3dbb('0x26')]['find'](_0x1b207a)['then'](function(_0x322e72){if(_0x322e72){_0x369cc4=_0x322e72;return _0x322e72['getFields']();}return null;})[_0x3dbb('0x20')](function(_0x341f46){if(_0x341f46){if(!_0x341f46[_0x3dbb('0x30')]){throw new db[(_0x3dbb('0x85'))][(_0x3dbb('0x5e'))](_0x3dbb('0x5f'));}_0x1681fd=_0x341f46;return db[_0x3dbb('0x60')][_0x3dbb('0x3d')]({'raw':!![]});}return null;})[_0x3dbb('0x20')](function(_0x22fedf){if(_0x22fedf){_0x295664=_[_0x3dbb('0x61')](_0x22fedf,'id');var _0x56d264;var _0x4afb06=squel['select']();_0x4afb06[_0x3dbb('0x63')](_0x369cc4[_0x3dbb('0x64')]);for(var _0x576cfb=0x0;_0x576cfb<_0x1681fd[_0x3dbb('0x30')];_0x576cfb+=0x1){_0x56d264=_0x1681fd[_0x576cfb]['MetricId']?_0x295664[_0x1681fd[_0x576cfb]['MetricId']][_0x3dbb('0x65')]:_0x1681fd[_0x576cfb]['field'];_0x56d264=_0x1681fd[_0x576cfb]['function']?_[_0x3dbb('0x68')](_0x264dfe[_0x1681fd[_0x576cfb]['function']],'%s',_0x56d264):_0x56d264;_0x56d264=_0x1681fd[_0x576cfb][_0x3dbb('0x69')]?_['replace'](_0x49493b[_0x1681fd[_0x576cfb]['format']],'%s',_0x56d264):_0x56d264;if(_0x1681fd[_0x576cfb][_0x3dbb('0x6a')]){_0x4afb06[_0x3dbb('0x5a')](_0x56d264);}_0x1681fd[_0x576cfb][_0x3dbb('0x6b')]&&_0x4afb06[_0x3dbb('0x6c')](_0x56d264,_0x1681fd[_0x576cfb][_0x3dbb('0x6b')]===_0x3dbb('0x6d')?![]:!![]);_0x4afb06[_0x3dbb('0x66')](_0x56d264,_0x1681fd[_0x576cfb]['alias']||_0x56d264);}if(_0x369cc4[_0x3dbb('0x6f')]){_0x369cc4[_0x3dbb('0x6f')]=JSON[_0x3dbb('0x77')](_0x369cc4[_0x3dbb('0x6f')]);for(var _0x5cf35d=0x0;_0x5cf35d<_0x369cc4[_0x3dbb('0x6f')][_0x3dbb('0x30')];_0x5cf35d+=0x1){if(_0x369cc4[_0x3dbb('0x6f')][_0x5cf35d][_0x3dbb('0x74')]&&_[_0x3dbb('0x70')](_0xbbaa15,_0x369cc4[_0x3dbb('0x6f')][_0x5cf35d][_0x3dbb('0x74')])&&_0x369cc4[_0x3dbb('0x6f')][_0x5cf35d]['parentKey']&&_0x369cc4[_0x3dbb('0x6f')][_0x5cf35d]['foreignTable']&&_0x369cc4['joins'][_0x5cf35d][_0x3dbb('0x73')]){_0x4afb06[_0x369cc4[_0x3dbb('0x6f')][_0x5cf35d][_0x3dbb('0x74')]](_0x369cc4['joins'][_0x5cf35d][_0x3dbb('0x72')],null,util[_0x3dbb('0x69')](_0x3dbb('0x75'),_0x369cc4[_0x3dbb('0x64')],_0x369cc4[_0x3dbb('0x6f')][_0x5cf35d][_0x3dbb('0x71')],_0x369cc4[_0x3dbb('0x6f')][_0x5cf35d]['foreignTable'],_0x369cc4['joins'][_0x5cf35d]['foreignKey']));}}}if(_0x369cc4[_0x3dbb('0x76')]){_0x369cc4[_0x3dbb('0x76')]=JSON[_0x3dbb('0x77')](_0x369cc4['conditions']);_0x4afb06[_0x3dbb('0x35')](_0x14ab48(_0x369cc4[_0x3dbb('0x76')][_0x3dbb('0x5a')]));}_0x32c903=_0x4afb06[_0x3dbb('0x78')]();_0x4afb06[_0x3dbb('0x33')](_0x26c163);_0x4afb06[_0x3dbb('0x1a')](0x0);logger[_0x3dbb('0x79')]('Limited\x20Query:',_0x4afb06[_0x3dbb('0x7b')]());return db[_0x3dbb('0x7c')][_0x3dbb('0x28')](_0x4afb06[_0x3dbb('0x7b')](),{'type':db['sequelize'][_0x3dbb('0x87')][_0x3dbb('0x7d')]});}})[_0x3dbb('0x20')](function(){return{'sql':_0x32c903[_0x3dbb('0x7b')]()};})[_0x3dbb('0x20')](respondWithResult(_0x5d5989,null))[_0x3dbb('0x3e')](handleError(_0x5d5989,null));};
\ No newline at end of file
index 70b2635..0ff6bff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f54=['analytics_default_reports','lodash','api','moment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f54,0x1e4));var _0x41f5=function(_0x447c82,_0x407de3){_0x447c82=_0x447c82-0x0;var _0x5429aa=_0x1f54[_0x447c82];return _0x5429aa;};'use strict';var _=require(_0x41f5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x41f5('0x1'));var moment=require(_0x41f5('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x41f5('0x3'));module[_0x41f5('0x4')]=function(_0x1aee0c,_0x3fae64){return _0x1aee0c['define'](_0x41f5('0x5'),attributes,{'tableName':_0x41f5('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf8ed=['../../config/logger','request-promise','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x3a6817,_0x44b18e){var _0x1cce75=function(_0x5088be){while(--_0x5088be){_0x3a6817['push'](_0x3a6817['shift']());}};_0x1cce75(++_0x44b18e);}(_0xf8ed,0x180));var _0xdf8e=function(_0x5db761,_0x5f3fa0){_0x5db761=_0x5db761-0x0;var _0x1e5d85=_0xf8ed[_0x5db761];return _0x1e5d85;};'use strict';var _=require(_0xdf8e('0x0'));var util=require('util');var logger=require(_0xdf8e('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdf8e('0x2'));var attributes=require(_0xdf8e('0x3'));module[_0xdf8e('0x4')]=function(_0x16013c,_0x5e2be2){return _0x16013c['define'](_0xdf8e('0x5'),attributes,{'tableName':_0xdf8e('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2bb2af3..2a0d9c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9df2=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4f9e52,_0x3b7254){var _0x5ab620=function(_0x2d8eab){while(--_0x2d8eab){_0x4f9e52['push'](_0x4f9e52['shift']());}};_0x5ab620(++_0x3b7254);}(_0x9df2,0xc5));var _0x29df=function(_0x2d0094,_0x167a61){_0x2d0094=_0x2d0094-0x0;var _0x4cc4ca=_0x9df2[_0x2d0094];return _0x4cc4ca;};'use strict';var _=require(_0x29df('0x0'));var util=require(_0x29df('0x1'));var moment=require('moment');var BPromise=require(_0x29df('0x2'));var rs=require(_0x29df('0x3'));var fs=require('fs');var db=require(_0x29df('0x4'))['db'];var utils=require(_0x29df('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x29df('0x6'));var jayson=require(_0x29df('0x7'));var client=jayson[_0x29df('0x8')][_0x29df('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32fa21,_0x398c69,_0x778bf3){return new BPromise(function(_0x4b1f7f,_0x52dbf0){return client[_0x29df('0xa')](_0x32fa21,_0x778bf3)[_0x29df('0xb')](function(_0x328781){logger[_0x29df('0xc')](_0x29df('0xd'),_0x398c69,_0x29df('0xe'));logger['debug'](_0x29df('0xf'),_0x398c69,_0x29df('0xe'),JSON[_0x29df('0x10')](_0x328781));if(_0x328781['error']){if(_0x328781[_0x29df('0x11')][_0x29df('0x12')]===0x1f4){logger[_0x29df('0x11')](_0x29df('0xd'),_0x398c69,_0x328781[_0x29df('0x11')]['message']);return _0x52dbf0(_0x328781['error'][_0x29df('0x13')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x398c69,_0x328781['error'][_0x29df('0x13')]);return _0x4b1f7f(_0x328781[_0x29df('0x11')][_0x29df('0x13')]);}else{logger['info'](_0x29df('0xd'),_0x398c69,'request\x20sent');_0x4b1f7f(_0x328781[_0x29df('0x14')][_0x29df('0x13')]);}})['catch'](function(_0x3b5757){logger[_0x29df('0x11')](_0x29df('0xd'),_0x398c69,_0x3b5757);_0x52dbf0(_0x3b5757);});});}
\ No newline at end of file
+var _0x255f=['request','info','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3a33d9,_0x488f9a){var _0x153402=function(_0x312951){while(--_0x312951){_0x3a33d9['push'](_0x3a33d9['shift']());}};_0x153402(++_0x488f9a);}(_0x255f,0x185));var _0xf255=function(_0x3ec551,_0xbf0edc){_0x3ec551=_0x3ec551-0x0;var _0x4b5e52=_0x255f[_0x3ec551];return _0x4b5e52;};'use strict';var _=require(_0xf255('0x0'));var util=require('util');var moment=require(_0xf255('0x1'));var BPromise=require(_0xf255('0x2'));var rs=require(_0xf255('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0xf255('0x4'));var logger=require(_0xf255('0x5'))(_0xf255('0x6'));var config=require(_0xf255('0x7'));var jayson=require(_0xf255('0x8'));var client=jayson[_0xf255('0x9')][_0xf255('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bbed0,_0x1236fb,_0x4b98fa){return new BPromise(function(_0x481d8c,_0x4a533f){return client[_0xf255('0xb')](_0x5bbed0,_0x4b98fa)['then'](function(_0x30c429){logger[_0xf255('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1236fb,_0xf255('0xd'));logger['debug'](_0xf255('0xe'),_0x1236fb,_0xf255('0xd'),JSON[_0xf255('0xf')](_0x30c429));if(_0x30c429[_0xf255('0x10')]){if(_0x30c429[_0xf255('0x10')]['code']===0x1f4){logger[_0xf255('0x10')](_0xf255('0x11'),_0x1236fb,_0x30c429[_0xf255('0x10')]['message']);return _0x4a533f(_0x30c429[_0xf255('0x10')][_0xf255('0x12')]);}logger['error'](_0xf255('0x11'),_0x1236fb,_0x30c429[_0xf255('0x10')][_0xf255('0x12')]);return _0x481d8c(_0x30c429['error'][_0xf255('0x12')]);}else{logger[_0xf255('0xc')](_0xf255('0x11'),_0x1236fb,_0xf255('0xd'));_0x481d8c(_0x30c429[_0xf255('0x13')][_0xf255('0x12')]);}})['catch'](function(_0x131d4d){logger['error'](_0xf255('0x11'),_0x1236fb,_0x131d4d);_0x4a533f(_0x131d4d);});});}
\ No newline at end of file
index 01e50cf..e421c48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4cd=['/:id/query','query','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','get','/:id','show','/:id/preview','preview','/:id/run','run'];(function(_0x37de50,_0x27f82a){var _0x2c37dc=function(_0x325186){while(--_0x325186){_0x37de50['push'](_0x37de50['shift']());}};_0x2c37dc(++_0x27f82a);}(_0xb4cd,0x11b));var _0xdb4c=function(_0x460302,_0x17fcdc){_0x460302=_0x460302-0x0;var _0x2b429a=_0xb4cd[_0x460302];return _0x2b429a;};'use strict';var multer=require(_0xdb4c('0x0'));var util=require(_0xdb4c('0x1'));var path=require(_0xdb4c('0x2'));var express=require(_0xdb4c('0x3'));var router=express[_0xdb4c('0x4')]();var auth=require(_0xdb4c('0x5'));var interaction=require(_0xdb4c('0x6'));var config=require(_0xdb4c('0x7'));var controller=require(_0xdb4c('0x8'));router['get']('/',auth[_0xdb4c('0x9')](),controller['index']);router[_0xdb4c('0xa')](_0xdb4c('0xb'),auth[_0xdb4c('0x9')](),controller[_0xdb4c('0xc')]);router[_0xdb4c('0xa')](_0xdb4c('0xd'),auth[_0xdb4c('0x9')](),controller[_0xdb4c('0xe')]);router[_0xdb4c('0xa')](_0xdb4c('0xf'),auth[_0xdb4c('0x9')](),controller[_0xdb4c('0x10')]);router[_0xdb4c('0xa')](_0xdb4c('0x11'),auth['isAuthenticated'](),controller[_0xdb4c('0x12')]);router[_0xdb4c('0x13')]('/',auth[_0xdb4c('0x9')](),controller[_0xdb4c('0x14')]);router[_0xdb4c('0x15')](_0xdb4c('0xb'),auth[_0xdb4c('0x9')](),controller[_0xdb4c('0x16')]);router[_0xdb4c('0x17')]('/:id',auth[_0xdb4c('0x9')](),controller[_0xdb4c('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x1b78=['get','isAuthenticated','index','show','/:id/run','run','/:id/query','query','put','/:id','update','delete','destroy','exports','multer','util','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x545b71,_0x4f44eb){var _0x26e587=function(_0x293b81){while(--_0x293b81){_0x545b71['push'](_0x545b71['shift']());}};_0x26e587(++_0x4f44eb);}(_0x1b78,0x105));var _0x81b7=function(_0x36c415,_0x7b836a){_0x36c415=_0x36c415-0x0;var _0x3538d8=_0x1b78[_0x36c415];return _0x3538d8;};'use strict';var multer=require(_0x81b7('0x0'));var util=require(_0x81b7('0x1'));var path=require('path');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x81b7('0x2'));var config=require(_0x81b7('0x3'));var controller=require(_0x81b7('0x4'));router[_0x81b7('0x5')]('/',auth[_0x81b7('0x6')](),controller[_0x81b7('0x7')]);router[_0x81b7('0x5')]('/:id',auth[_0x81b7('0x6')](),controller[_0x81b7('0x8')]);router[_0x81b7('0x5')]('/:id/preview',auth[_0x81b7('0x6')](),controller['preview']);router[_0x81b7('0x5')](_0x81b7('0x9'),auth[_0x81b7('0x6')](),controller[_0x81b7('0xa')]);router[_0x81b7('0x5')](_0x81b7('0xb'),auth[_0x81b7('0x6')](),controller[_0x81b7('0xc')]);router['post']('/',auth[_0x81b7('0x6')](),controller['create']);router[_0x81b7('0xd')](_0x81b7('0xe'),auth[_0x81b7('0x6')](),controller[_0x81b7('0xf')]);router[_0x81b7('0x10')](_0x81b7('0xe'),auth[_0x81b7('0x6')](),controller[_0x81b7('0x11')]);module[_0x81b7('0x12')]=router;
\ No newline at end of file
index edf9727..19f7cd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba2a=['Loading','ENUM','scheduled','manual','sequelize','moment','exports','STRING','pdf','xlsx','csv','DATE'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xba2a,0x88));var _0xaba2=function(_0x1f36da,_0x54e2d2){_0x1f36da=_0x1f36da-0x0;var _0xb0d5b0=_0xba2a[_0x1f36da];return _0xb0d5b0;};'use strict';var Sequelize=require(_0xaba2('0x0'));var moment=require(_0xaba2('0x1'));module[_0xaba2('0x2')]={'name':{'type':Sequelize[_0xaba2('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xaba2('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0xaba2('0x4'),_0xaba2('0x5')),'allowNull':![],'defaultValue':_0xaba2('0x6')},'savename':{'type':Sequelize[_0xaba2('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xaba2('0x7')]},'endDate':{'type':Sequelize[_0xaba2('0x7')]},'status':{'type':Sequelize[_0xaba2('0x3')],'defaultValue':_0xaba2('0x8')},'type':{'type':Sequelize[_0xaba2('0x9')]('manual',_0xaba2('0xa')),'allowNull':![],'defaultValue':_0xaba2('0xb')}};
\ No newline at end of file
+var _0x33c3=['scheduled','manual','moment','exports','STRING','csv','pdf','xlsx','DATE'];(function(_0x526855,_0x386d19){var _0x11c4e9=function(_0x408cfe){while(--_0x408cfe){_0x526855['push'](_0x526855['shift']());}};_0x11c4e9(++_0x386d19);}(_0x33c3,0xc8));var _0x333c=function(_0x1754d5,_0x1f2cb7){_0x1754d5=_0x1754d5-0x0;var _0x1ced50=_0x33c3[_0x1754d5];return _0x1ced50;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x333c('0x0'));module[_0x333c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x333c('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x333c('0x3'),_0x333c('0x4'),_0x333c('0x5')),'allowNull':![],'defaultValue':_0x333c('0x3')},'savename':{'type':Sequelize[_0x333c('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x333c('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x333c('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual',_0x333c('0x7')),'allowNull':![],'defaultValue':_0x333c('0x8')}};
\ No newline at end of file
index e0b272f..42807ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccd2=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','name','rawAttributes','model','query','dateStart','dateEnd','filters','attributes','intersection','fields','length','sort','where','day','map','filter','merge','AnalyticExtractedReport','count','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','find','download','basename','savename','output','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','html-pdf','eml-format','zip-dir','fast-json-patch'];(function(_0x15ab99,_0x10c0c3){var _0x3734a7=function(_0x2b6508){while(--_0x2b6508){_0x15ab99['push'](_0x15ab99['shift']());}};_0x3734a7(++_0x10c0c3);}(_0xccd2,0xf2));var _0x2ccd=function(_0x3f36ad,_0x11bc7a){_0x3f36ad=_0x3f36ad-0x0;var _0x4560ed=_0xccd2[_0x3f36ad];return _0x4560ed;};'use strict';var pdf=require(_0x2ccd('0x0'));var emlformat=require(_0x2ccd('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2ccd('0x2'));var jsonpatch=require(_0x2ccd('0x3'));var rp=require(_0x2ccd('0x4'));var moment=require(_0x2ccd('0x5'));var BPromise=require(_0x2ccd('0x6'));var Mustache=require(_0x2ccd('0x7'));var util=require(_0x2ccd('0x8'));var path=require(_0x2ccd('0x9'));var sox=require(_0x2ccd('0xa'));var csv=require(_0x2ccd('0xb'));var ejs=require(_0x2ccd('0xc'));var fs=require('fs');var _=require(_0x2ccd('0xd'));var squel=require(_0x2ccd('0xe'));var crypto=require(_0x2ccd('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x2ccd('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2ccd('0x11'));var qs=require(_0x2ccd('0x12'));var logger=require(_0x2ccd('0x13'))(_0x2ccd('0x14'));var utils=require(_0x2ccd('0x15'));var config=require(_0x2ccd('0x16'));var db=require(_0x2ccd('0x17'))['db'];function respondWithStatusCode(_0x4b75a4,_0x4ef5a1){_0x4ef5a1=_0x4ef5a1||0xcc;return function(_0x6960ae){if(_0x6960ae){return _0x4b75a4[_0x2ccd('0x18')](_0x4ef5a1);}return _0x4b75a4[_0x2ccd('0x19')](_0x4ef5a1)[_0x2ccd('0x1a')]();};}function respondWithResult(_0x40cdf7,_0x12641b){_0x12641b=_0x12641b||0xc8;return function(_0xc697d8){if(_0xc697d8){return _0x40cdf7[_0x2ccd('0x19')](_0x12641b)[_0x2ccd('0x1b')](_0xc697d8);}};}function respondWithFilteredResult(_0x3f082d,_0x467a7d){return function(_0x254c40){if(_0x254c40){var _0xbd365d=_0x254c40['count'],_0xb0fe33=_0x467a7d[_0x2ccd('0x1c')],_0x218275=_0x467a7d[_0x2ccd('0x1c')]+_0x467a7d[_0x2ccd('0x1d')],_0x25ed4e;if(_0x218275>=_0xbd365d){_0x218275=_0xbd365d;_0x25ed4e=0xc8;}else{_0x25ed4e=0xce;}_0x3f082d[_0x2ccd('0x19')](_0x25ed4e);return _0x3f082d[_0x2ccd('0x1e')](_0x2ccd('0x1f'),_0xb0fe33+'-'+_0x218275+'/'+_0xbd365d)['json'](_0x254c40);}return null;};}function patchUpdates(_0x2bccc5){return function(_0x3c5872){try{jsonpatch['apply'](_0x3c5872,_0x2bccc5,!![]);}catch(_0x20e307){return BPromise['reject'](_0x20e307);}return _0x3c5872[_0x2ccd('0x20')]();};}function saveUpdates(_0x1d50a4,_0x45d904){return function(_0x2bc6fb){if(_0x2bc6fb){return _0x2bc6fb[_0x2ccd('0x21')](_0x1d50a4)[_0x2ccd('0x22')](function(_0x2576b4){return _0x2576b4;});}return null;};}function removeEntity(_0x5d778d,_0x29494a){return function(_0x7f1225){if(_0x7f1225){return _0x7f1225[_0x2ccd('0x23')]()[_0x2ccd('0x22')](function(){_0x5d778d['status'](0xcc)[_0x2ccd('0x1a')]();});}};}function handleEntityNotFound(_0x5c2d5f,_0x1ebc67){return function(_0x2917bc){if(!_0x2917bc){_0x5c2d5f[_0x2ccd('0x18')](0x194);}return _0x2917bc;};}function handleError(_0x5c04ae,_0x44369e){_0x44369e=_0x44369e||0x1f4;return function(_0x53c968){logger[_0x2ccd('0x24')](_0x53c968[_0x2ccd('0x25')]);if(_0x53c968[_0x2ccd('0x26')]){delete _0x53c968['name'];}_0x5c04ae['status'](_0x44369e)['send'](_0x53c968);};}exports['index']=function(_0x1ddf1d,_0x25ec40){var _0x73c504={},_0x1ae28f={},_0x40c9dc={'count':0x0,'rows':[]};var _0x3ca4a3=db['AnalyticExtractedReport'][_0x2ccd('0x27')];_0x1ae28f[_0x2ccd('0x28')]=_['keys'](_0x3ca4a3);var _0x2ae9c5={'dateStart':_0x1ddf1d[_0x2ccd('0x29')][_0x2ccd('0x2a')],'dateEnd':_0x1ddf1d[_0x2ccd('0x29')]['dateEnd']};delete _0x1ddf1d['query'][_0x2ccd('0x2a')];delete _0x1ddf1d[_0x2ccd('0x29')][_0x2ccd('0x2b')];_0x1ae28f[_0x2ccd('0x29')]=_['keys'](_0x1ddf1d[_0x2ccd('0x29')]);_0x1ae28f[_0x2ccd('0x2c')]=_['intersection'](_0x1ae28f[_0x2ccd('0x28')],_0x1ae28f[_0x2ccd('0x29')]);_0x73c504[_0x2ccd('0x2d')]=_[_0x2ccd('0x2e')](_0x1ae28f[_0x2ccd('0x28')],qs[_0x2ccd('0x2f')](_0x1ddf1d[_0x2ccd('0x29')][_0x2ccd('0x2f')]));_0x73c504['attributes']=_0x73c504[_0x2ccd('0x2d')][_0x2ccd('0x30')]?_0x73c504['attributes']:_0x1ae28f['model'];if(!_0x1ddf1d[_0x2ccd('0x29')]['hasOwnProperty']('nolimit')){_0x73c504[_0x2ccd('0x1d')]=qs['limit'](_0x1ddf1d[_0x2ccd('0x29')]['limit']);_0x73c504['offset']=qs['offset'](_0x1ddf1d['query'][_0x2ccd('0x1c')]);}_0x73c504['order']=qs['sort'](_0x1ddf1d[_0x2ccd('0x29')][_0x2ccd('0x31')]);_0x73c504[_0x2ccd('0x32')]=qs[_0x2ccd('0x2c')](_['pick'](_0x1ddf1d['query'],_0x1ae28f['filters']));if(_0x2ae9c5[_0x2ccd('0x2a')]){if(_0x2ae9c5[_0x2ccd('0x2b')]){_0x2ae9c5['dateEnd']=moment(_0x2ae9c5[_0x2ccd('0x2b')])['add'](0x1,_0x2ccd('0x33'));}else{_0x2ae9c5[_0x2ccd('0x2b')]=moment(_0x2ae9c5[_0x2ccd('0x2a')])['add'](0x1,_0x2ccd('0x33'));}_['merge'](_0x73c504[_0x2ccd('0x32')],{'createdAt':{'$gte':_0x2ae9c5[_0x2ccd('0x2a')],'$lte':_0x2ae9c5[_0x2ccd('0x2b')]}});}if(_0x1ddf1d['query']['filter']){_0x73c504[_0x2ccd('0x32')]=_['merge'](_0x73c504[_0x2ccd('0x32')],{'$or':_[_0x2ccd('0x34')](_0x73c504[_0x2ccd('0x2d')],function(_0x5dfb51){var _0x3b8b0c={};_0x3b8b0c[_0x5dfb51]={'$like':'%'+_0x1ddf1d[_0x2ccd('0x29')][_0x2ccd('0x35')]+'%'};return _0x3b8b0c;})});}_0x73c504=_[_0x2ccd('0x36')]({},_0x73c504,_0x1ddf1d['options']);var _0x249900={'where':_0x73c504[_0x2ccd('0x32')]};return db[_0x2ccd('0x37')][_0x2ccd('0x38')](_0x249900)['then'](function(_0x5ce96e){_0x40c9dc['count']=_0x5ce96e;if(_0x1ddf1d[_0x2ccd('0x29')][_0x2ccd('0x39')]){_0x73c504[_0x2ccd('0x3a')]=[{'all':!![]}];}return db[_0x2ccd('0x37')][_0x2ccd('0x3b')](_0x73c504);})[_0x2ccd('0x22')](function(_0x1fce8a){_0x40c9dc[_0x2ccd('0x3c')]=_0x1fce8a;return _0x40c9dc;})['then'](respondWithFilteredResult(_0x25ec40,_0x73c504))[_0x2ccd('0x3d')](handleError(_0x25ec40,null));};exports[_0x2ccd('0x3e')]=function(_0x41f79f,_0x4ca6a3){var _0x1ec4f0={'raw':!![],'where':{'id':_0x41f79f[_0x2ccd('0x3f')]['id']}},_0x2d8dd7={};_0x2d8dd7['model']=_[_0x2ccd('0x40')](db[_0x2ccd('0x37')][_0x2ccd('0x27')]);_0x2d8dd7['query']=_['keys'](_0x41f79f[_0x2ccd('0x29')]);_0x2d8dd7[_0x2ccd('0x2c')]=_[_0x2ccd('0x2e')](_0x2d8dd7[_0x2ccd('0x28')],_0x2d8dd7['query']);_0x1ec4f0['attributes']=_['intersection'](_0x2d8dd7[_0x2ccd('0x28')],qs['fields'](_0x41f79f[_0x2ccd('0x29')]['fields']));_0x1ec4f0['attributes']=_0x1ec4f0[_0x2ccd('0x2d')][_0x2ccd('0x30')]?_0x1ec4f0[_0x2ccd('0x2d')]:_0x2d8dd7['model'];if(_0x41f79f[_0x2ccd('0x29')][_0x2ccd('0x39')]){_0x1ec4f0[_0x2ccd('0x3a')]=[{'all':!![]}];}_0x1ec4f0=_[_0x2ccd('0x36')]({},_0x1ec4f0,_0x41f79f[_0x2ccd('0x41')]);return db['AnalyticExtractedReport']['find'](_0x1ec4f0)[_0x2ccd('0x22')](handleEntityNotFound(_0x4ca6a3,null))[_0x2ccd('0x22')](respondWithResult(_0x4ca6a3,null))[_0x2ccd('0x3d')](handleError(_0x4ca6a3,null));};exports[_0x2ccd('0x42')]=function(_0x1e8eb4,_0x1ffd64){return db[_0x2ccd('0x37')]['create'](_0x1e8eb4[_0x2ccd('0x43')],{})['then'](respondWithResult(_0x1ffd64,0xc9))[_0x2ccd('0x3d')](handleError(_0x1ffd64,null));};exports['update']=function(_0x37f56c,_0x1b82b4){if(_0x37f56c[_0x2ccd('0x43')]['id']){delete _0x37f56c['body']['id'];}return db[_0x2ccd('0x37')][_0x2ccd('0x44')]({'where':{'id':_0x37f56c[_0x2ccd('0x3f')]['id']}})[_0x2ccd('0x22')](handleEntityNotFound(_0x1b82b4,null))[_0x2ccd('0x22')](saveUpdates(_0x37f56c[_0x2ccd('0x43')],null))['then'](respondWithResult(_0x1b82b4,null))[_0x2ccd('0x3d')](handleError(_0x1b82b4,null));};exports[_0x2ccd('0x23')]=function(_0x4bf802,_0x14a445){return db[_0x2ccd('0x37')][_0x2ccd('0x44')]({'where':{'id':_0x4bf802[_0x2ccd('0x3f')]['id']}})[_0x2ccd('0x22')](handleEntityNotFound(_0x14a445,null))[_0x2ccd('0x22')](removeEntity(_0x14a445,null))[_0x2ccd('0x3d')](handleError(_0x14a445,null));};exports[_0x2ccd('0x45')]=function(_0x38cc0a,_0x1c008c,_0x51f22b){return db[_0x2ccd('0x37')][_0x2ccd('0x44')]({'where':{'id':_0x38cc0a[_0x2ccd('0x3f')]['id']},'attributes':['name',_0x2ccd('0x46'),_0x2ccd('0x47'),_0x2ccd('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0x1c008c,null))['then'](function(_0x3ebc01){if(_0x3ebc01){if(!fs['existsSync'](path[_0x2ccd('0x49')](config[_0x2ccd('0x4a')],_0x2ccd('0x4b'),_0x3ebc01[_0x2ccd('0x47')]))){throw new db[(_0x2ccd('0x4c'))]['ValidationError'](_0x2ccd('0x4d'));}if(_0x38cc0a[_0x2ccd('0x29')][_0x2ccd('0x4e')]){return _0x1c008c[_0x2ccd('0x18')](0xc8);}return _0x1c008c[_0x2ccd('0x45')](path['join'](config[_0x2ccd('0x4a')],_0x2ccd('0x4b'),_0x3ebc01['savename']),util[_0x2ccd('0x4f')](_0x2ccd('0x50'),_0x3ebc01[_0x2ccd('0x46')]||_0x3ebc01[_0x2ccd('0x26')],_0x3ebc01[_0x2ccd('0x48')][_0x2ccd('0x51')]()));}})[_0x2ccd('0x3d')](handleError(_0x1c008c,null));};
\ No newline at end of file
+var _0xaa04=['options','include','findAll','rows','catch','show','params','find','create','body','download','basename','savename','output','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','send','index','AnalyticExtractedReport','model','keys','query','dateStart','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','dateEnd','add','day','filter','where','merge','map'];(function(_0x5643a8,_0x4becd0){var _0x6c2c2d=function(_0x1bf2ee){while(--_0x1bf2ee){_0x5643a8['push'](_0x5643a8['shift']());}};_0x6c2c2d(++_0x4becd0);}(_0xaa04,0x69));var _0x4aa0=function(_0x279e0c,_0xaf1f6b){_0x279e0c=_0x279e0c-0x0;var _0x34015e=_0xaa04[_0x279e0c];return _0x34015e;};'use strict';var pdf=require(_0x4aa0('0x0'));var emlformat=require(_0x4aa0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4aa0('0x2'));var jsonpatch=require(_0x4aa0('0x3'));var rp=require(_0x4aa0('0x4'));var moment=require(_0x4aa0('0x5'));var BPromise=require(_0x4aa0('0x6'));var Mustache=require(_0x4aa0('0x7'));var util=require(_0x4aa0('0x8'));var path=require(_0x4aa0('0x9'));var sox=require(_0x4aa0('0xa'));var csv=require(_0x4aa0('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4aa0('0xc'));var squel=require(_0x4aa0('0xd'));var crypto=require(_0x4aa0('0xe'));var jsforce=require(_0x4aa0('0xf'));var deskjs=require(_0x4aa0('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4aa0('0x11'));var Papa=require(_0x4aa0('0x12'));var qs=require(_0x4aa0('0x13'));var logger=require(_0x4aa0('0x14'))(_0x4aa0('0x15'));var utils=require('../../config/utils');var config=require(_0x4aa0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x468bb4,_0x249bb1){_0x249bb1=_0x249bb1||0xcc;return function(_0x38547a){if(_0x38547a){return _0x468bb4['sendStatus'](_0x249bb1);}return _0x468bb4[_0x4aa0('0x17')](_0x249bb1)[_0x4aa0('0x18')]();};}function respondWithResult(_0x397877,_0x394a60){_0x394a60=_0x394a60||0xc8;return function(_0x390e16){if(_0x390e16){return _0x397877[_0x4aa0('0x17')](_0x394a60)[_0x4aa0('0x19')](_0x390e16);}};}function respondWithFilteredResult(_0x4ff6df,_0x1a0171){return function(_0x2ea35d){if(_0x2ea35d){var _0x517b0b=_0x2ea35d[_0x4aa0('0x1a')],_0x52b1a4=_0x1a0171['offset'],_0x5214ac=_0x1a0171[_0x4aa0('0x1b')]+_0x1a0171[_0x4aa0('0x1c')],_0x8c0262;if(_0x5214ac>=_0x517b0b){_0x5214ac=_0x517b0b;_0x8c0262=0xc8;}else{_0x8c0262=0xce;}_0x4ff6df[_0x4aa0('0x17')](_0x8c0262);return _0x4ff6df[_0x4aa0('0x1d')](_0x4aa0('0x1e'),_0x52b1a4+'-'+_0x5214ac+'/'+_0x517b0b)['json'](_0x2ea35d);}return null;};}function patchUpdates(_0xde24f1){return function(_0x3e521f){try{jsonpatch[_0x4aa0('0x1f')](_0x3e521f,_0xde24f1,!![]);}catch(_0x49ee42){return BPromise['reject'](_0x49ee42);}return _0x3e521f[_0x4aa0('0x20')]();};}function saveUpdates(_0x4a122b,_0xca52c0){return function(_0x1e1abc){if(_0x1e1abc){return _0x1e1abc[_0x4aa0('0x21')](_0x4a122b)[_0x4aa0('0x22')](function(_0x5501b0){return _0x5501b0;});}return null;};}function removeEntity(_0xea9ba8,_0x56138a){return function(_0x1acac4){if(_0x1acac4){return _0x1acac4[_0x4aa0('0x23')]()[_0x4aa0('0x22')](function(){_0xea9ba8[_0x4aa0('0x17')](0xcc)[_0x4aa0('0x18')]();});}};}function handleEntityNotFound(_0x113df9,_0x26f516){return function(_0x195551){if(!_0x195551){_0x113df9[_0x4aa0('0x24')](0x194);}return _0x195551;};}function handleError(_0x581c6f,_0x2d875d){_0x2d875d=_0x2d875d||0x1f4;return function(_0x41d5b9){logger[_0x4aa0('0x25')](_0x41d5b9['stack']);if(_0x41d5b9[_0x4aa0('0x26')]){delete _0x41d5b9[_0x4aa0('0x26')];}_0x581c6f['status'](_0x2d875d)[_0x4aa0('0x27')](_0x41d5b9);};}exports[_0x4aa0('0x28')]=function(_0xf26732,_0x4d0034){var _0x4f660a={},_0x20d557={},_0x15952e={'count':0x0,'rows':[]};var _0x2f0fe7=db[_0x4aa0('0x29')]['rawAttributes'];_0x20d557[_0x4aa0('0x2a')]=_[_0x4aa0('0x2b')](_0x2f0fe7);var _0x23e046={'dateStart':_0xf26732[_0x4aa0('0x2c')][_0x4aa0('0x2d')],'dateEnd':_0xf26732[_0x4aa0('0x2c')]['dateEnd']};delete _0xf26732[_0x4aa0('0x2c')][_0x4aa0('0x2d')];delete _0xf26732['query']['dateEnd'];_0x20d557[_0x4aa0('0x2c')]=_[_0x4aa0('0x2b')](_0xf26732[_0x4aa0('0x2c')]);_0x20d557[_0x4aa0('0x2e')]=_[_0x4aa0('0x2f')](_0x20d557[_0x4aa0('0x2a')],_0x20d557[_0x4aa0('0x2c')]);_0x4f660a['attributes']=_['intersection'](_0x20d557[_0x4aa0('0x2a')],qs[_0x4aa0('0x30')](_0xf26732[_0x4aa0('0x2c')][_0x4aa0('0x30')]));_0x4f660a['attributes']=_0x4f660a[_0x4aa0('0x31')][_0x4aa0('0x32')]?_0x4f660a[_0x4aa0('0x31')]:_0x20d557[_0x4aa0('0x2a')];if(!_0xf26732[_0x4aa0('0x2c')][_0x4aa0('0x33')](_0x4aa0('0x34'))){_0x4f660a['limit']=qs[_0x4aa0('0x1c')](_0xf26732['query'][_0x4aa0('0x1c')]);_0x4f660a[_0x4aa0('0x1b')]=qs[_0x4aa0('0x1b')](_0xf26732[_0x4aa0('0x2c')]['offset']);}_0x4f660a[_0x4aa0('0x35')]=qs[_0x4aa0('0x36')](_0xf26732[_0x4aa0('0x2c')][_0x4aa0('0x36')]);_0x4f660a['where']=qs[_0x4aa0('0x2e')](_[_0x4aa0('0x37')](_0xf26732[_0x4aa0('0x2c')],_0x20d557[_0x4aa0('0x2e')]));if(_0x23e046[_0x4aa0('0x2d')]){if(_0x23e046[_0x4aa0('0x38')]){_0x23e046['dateEnd']=moment(_0x23e046[_0x4aa0('0x38')])[_0x4aa0('0x39')](0x1,'day');}else{_0x23e046[_0x4aa0('0x38')]=moment(_0x23e046[_0x4aa0('0x2d')])[_0x4aa0('0x39')](0x1,_0x4aa0('0x3a'));}_['merge'](_0x4f660a['where'],{'createdAt':{'$gte':_0x23e046[_0x4aa0('0x2d')],'$lte':_0x23e046['dateEnd']}});}if(_0xf26732['query'][_0x4aa0('0x3b')]){_0x4f660a[_0x4aa0('0x3c')]=_[_0x4aa0('0x3d')](_0x4f660a[_0x4aa0('0x3c')],{'$or':_[_0x4aa0('0x3e')](_0x4f660a[_0x4aa0('0x31')],function(_0x671696){var _0x54ec84={};_0x54ec84[_0x671696]={'$like':'%'+_0xf26732[_0x4aa0('0x2c')][_0x4aa0('0x3b')]+'%'};return _0x54ec84;})});}_0x4f660a=_['merge']({},_0x4f660a,_0xf26732[_0x4aa0('0x3f')]);var _0x4bdc86={'where':_0x4f660a[_0x4aa0('0x3c')]};return db[_0x4aa0('0x29')][_0x4aa0('0x1a')](_0x4bdc86)[_0x4aa0('0x22')](function(_0x372d9c){_0x15952e[_0x4aa0('0x1a')]=_0x372d9c;if(_0xf26732[_0x4aa0('0x2c')]['includeAll']){_0x4f660a[_0x4aa0('0x40')]=[{'all':!![]}];}return db[_0x4aa0('0x29')][_0x4aa0('0x41')](_0x4f660a);})[_0x4aa0('0x22')](function(_0x573490){_0x15952e[_0x4aa0('0x42')]=_0x573490;return _0x15952e;})['then'](respondWithFilteredResult(_0x4d0034,_0x4f660a))[_0x4aa0('0x43')](handleError(_0x4d0034,null));};exports[_0x4aa0('0x44')]=function(_0x2b70f3,_0x4e6c3e){var _0x34127c={'raw':!![],'where':{'id':_0x2b70f3[_0x4aa0('0x45')]['id']}},_0x2e3233={};_0x2e3233[_0x4aa0('0x2a')]=_[_0x4aa0('0x2b')](db['AnalyticExtractedReport']['rawAttributes']);_0x2e3233['query']=_[_0x4aa0('0x2b')](_0x2b70f3[_0x4aa0('0x2c')]);_0x2e3233['filters']=_['intersection'](_0x2e3233[_0x4aa0('0x2a')],_0x2e3233[_0x4aa0('0x2c')]);_0x34127c['attributes']=_[_0x4aa0('0x2f')](_0x2e3233[_0x4aa0('0x2a')],qs['fields'](_0x2b70f3[_0x4aa0('0x2c')][_0x4aa0('0x30')]));_0x34127c[_0x4aa0('0x31')]=_0x34127c[_0x4aa0('0x31')][_0x4aa0('0x32')]?_0x34127c[_0x4aa0('0x31')]:_0x2e3233[_0x4aa0('0x2a')];if(_0x2b70f3[_0x4aa0('0x2c')]['includeAll']){_0x34127c[_0x4aa0('0x40')]=[{'all':!![]}];}_0x34127c=_['merge']({},_0x34127c,_0x2b70f3[_0x4aa0('0x3f')]);return db['AnalyticExtractedReport'][_0x4aa0('0x46')](_0x34127c)[_0x4aa0('0x22')](handleEntityNotFound(_0x4e6c3e,null))[_0x4aa0('0x22')](respondWithResult(_0x4e6c3e,null))[_0x4aa0('0x43')](handleError(_0x4e6c3e,null));};exports[_0x4aa0('0x47')]=function(_0x58a536,_0x51410b){return db[_0x4aa0('0x29')][_0x4aa0('0x47')](_0x58a536['body'],{})[_0x4aa0('0x22')](respondWithResult(_0x51410b,0xc9))[_0x4aa0('0x43')](handleError(_0x51410b,null));};exports[_0x4aa0('0x21')]=function(_0x4ea30c,_0x37a52f){if(_0x4ea30c[_0x4aa0('0x48')]['id']){delete _0x4ea30c[_0x4aa0('0x48')]['id'];}return db[_0x4aa0('0x29')][_0x4aa0('0x46')]({'where':{'id':_0x4ea30c[_0x4aa0('0x45')]['id']}})[_0x4aa0('0x22')](handleEntityNotFound(_0x37a52f,null))['then'](saveUpdates(_0x4ea30c[_0x4aa0('0x48')],null))[_0x4aa0('0x22')](respondWithResult(_0x37a52f,null))[_0x4aa0('0x43')](handleError(_0x37a52f,null));};exports[_0x4aa0('0x23')]=function(_0x31edd6,_0x516669){return db[_0x4aa0('0x29')][_0x4aa0('0x46')]({'where':{'id':_0x31edd6['params']['id']}})[_0x4aa0('0x22')](handleEntityNotFound(_0x516669,null))['then'](removeEntity(_0x516669,null))[_0x4aa0('0x43')](handleError(_0x516669,null));};exports[_0x4aa0('0x49')]=function(_0x2c00d8,_0x2fb5b4,_0x3ac43f){return db[_0x4aa0('0x29')][_0x4aa0('0x46')]({'where':{'id':_0x2c00d8[_0x4aa0('0x45')]['id']},'attributes':[_0x4aa0('0x26'),_0x4aa0('0x4a'),_0x4aa0('0x4b'),_0x4aa0('0x4c')],'raw':!![]})[_0x4aa0('0x22')](handleEntityNotFound(_0x2fb5b4,null))[_0x4aa0('0x22')](function(_0x59127e){if(_0x59127e){if(!fs['existsSync'](path[_0x4aa0('0x4d')](config['root'],_0x4aa0('0x4e'),_0x59127e[_0x4aa0('0x4b')]))){throw new db[(_0x4aa0('0x4f'))][(_0x4aa0('0x50'))](_0x4aa0('0x51'));}if(_0x2c00d8[_0x4aa0('0x2c')][_0x4aa0('0x52')]){return _0x2fb5b4[_0x4aa0('0x24')](0xc8);}return _0x2fb5b4['download'](path[_0x4aa0('0x4d')](config[_0x4aa0('0x53')],_0x4aa0('0x4e'),_0x59127e[_0x4aa0('0x4b')]),util['format']('%s.%s',_0x59127e[_0x4aa0('0x4a')]||_0x59127e['name'],_0x59127e[_0x4aa0('0x4c')]['toLowerCase']()));}})['catch'](handleError(_0x2fb5b4,null));};
\ No newline at end of file
index b95819c..397899e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e94=['util','api','moment','./analyticExtractedReport.attributes','analytics_extracted_reports','lodash'];(function(_0x33dc75,_0x425795){var _0x1a227d=function(_0x1a56b){while(--_0x1a56b){_0x33dc75['push'](_0x33dc75['shift']());}};_0x1a227d(++_0x425795);}(_0x4e94,0x155));var _0x44e9=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x4e94[_0x16771d];return _0x386f11;};'use strict';var _=require(_0x44e9('0x0'));var util=require(_0x44e9('0x1'));var logger=require('../../config/logger')(_0x44e9('0x2'));var moment=require(_0x44e9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x44e9('0x4'));module['exports']=function(_0x3a7f9b,_0x5c479e){return _0x3a7f9b['define']('AnalyticExtractedReport',attributes,{'tableName':_0x44e9('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb846=['lodash','api','moment','bluebird','request-promise','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x1f73ec,_0xe3233){var _0x209363=function(_0x1c9b91){while(--_0x1c9b91){_0x1f73ec['push'](_0x1f73ec['shift']());}};_0x209363(++_0xe3233);}(_0xb846,0x1d0));var _0x6b84=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xb846[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0x6b84('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6b84('0x1'));var moment=require(_0x6b84('0x2'));var BPromise=require(_0x6b84('0x3'));var rp=require(_0x6b84('0x4'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0xa68b33,_0x39d119){return _0xa68b33[_0x6b84('0x5')](_0x6b84('0x6'),attributes,{'tableName':_0x6b84('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5abd54b..7e1a6ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0233=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x446f40,_0x203d4e){var _0x54bef1=function(_0x5c09ff){while(--_0x5c09ff){_0x446f40['push'](_0x446f40['shift']());}};_0x54bef1(++_0x203d4e);}(_0x0233,0x180));var _0x3023=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x0233[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x3023('0x0'));var util=require('util');var moment=require(_0x3023('0x1'));var BPromise=require(_0x3023('0x2'));var rs=require(_0x3023('0x3'));var fs=require('fs');var db=require(_0x3023('0x4'))['db'];var utils=require(_0x3023('0x5'));var logger=require('../../config/logger')(_0x3023('0x6'));var config=require(_0x3023('0x7'));var jayson=require(_0x3023('0x8'));var client=jayson[_0x3023('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x823918,_0xe243d7,_0x3e4d6a){return new BPromise(function(_0x518510,_0x1ae649){return client[_0x3023('0xa')](_0x823918,_0x3e4d6a)[_0x3023('0xb')](function(_0x4e0a01){logger[_0x3023('0xc')](_0x3023('0xd'),_0xe243d7,_0x3023('0xe'));logger['debug'](_0x3023('0xf'),_0xe243d7,_0x3023('0xe'),JSON[_0x3023('0x10')](_0x4e0a01));if(_0x4e0a01[_0x3023('0x11')]){if(_0x4e0a01[_0x3023('0x11')][_0x3023('0x12')]===0x1f4){logger['error'](_0x3023('0xd'),_0xe243d7,_0x4e0a01[_0x3023('0x11')][_0x3023('0x13')]);return _0x1ae649(_0x4e0a01[_0x3023('0x11')][_0x3023('0x13')]);}logger[_0x3023('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xe243d7,_0x4e0a01[_0x3023('0x11')][_0x3023('0x13')]);return _0x518510(_0x4e0a01[_0x3023('0x11')]['message']);}else{logger['info'](_0x3023('0xd'),_0xe243d7,'request\x20sent');_0x518510(_0x4e0a01[_0x3023('0x14')][_0x3023('0x13')]);}})[_0x3023('0x15')](function(_0x4b741f){logger['error'](_0x3023('0xd'),_0xe243d7,_0x4b741f);_0x1ae649(_0x4b741f);});});}
\ No newline at end of file
+var _0x9138=['client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x57e83d,_0x5238ab){var _0x46cce7=function(_0x529ecc){while(--_0x529ecc){_0x57e83d['push'](_0x57e83d['shift']());}};_0x46cce7(++_0x5238ab);}(_0x9138,0x177));var _0x8913=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x9138[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x8913('0x0'));var util=require(_0x8913('0x1'));var moment=require('moment');var BPromise=require(_0x8913('0x2'));var rs=require(_0x8913('0x3'));var fs=require('fs');var db=require(_0x8913('0x4'))['db'];var utils=require(_0x8913('0x5'));var logger=require(_0x8913('0x6'))(_0x8913('0x7'));var config=require(_0x8913('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8913('0x9')][_0x8913('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x294a49,_0x2b7c06,_0x956cb){return new BPromise(function(_0x33a67f,_0x24936e){return client[_0x8913('0xb')](_0x294a49,_0x956cb)[_0x8913('0xc')](function(_0x125f9f){logger['info'](_0x8913('0xd'),_0x2b7c06,_0x8913('0xe'));logger[_0x8913('0xf')](_0x8913('0x10'),_0x2b7c06,_0x8913('0xe'),JSON[_0x8913('0x11')](_0x125f9f));if(_0x125f9f[_0x8913('0x12')]){if(_0x125f9f[_0x8913('0x12')][_0x8913('0x13')]===0x1f4){logger[_0x8913('0x12')](_0x8913('0xd'),_0x2b7c06,_0x125f9f['error'][_0x8913('0x14')]);return _0x24936e(_0x125f9f[_0x8913('0x12')]['message']);}logger['error'](_0x8913('0xd'),_0x2b7c06,_0x125f9f['error'][_0x8913('0x14')]);return _0x33a67f(_0x125f9f[_0x8913('0x12')][_0x8913('0x14')]);}else{logger[_0x8913('0x15')](_0x8913('0xd'),_0x2b7c06,_0x8913('0xe'));_0x33a67f(_0x125f9f[_0x8913('0x16')][_0x8913('0x14')]);}})[_0x8913('0x17')](function(_0x40c0a9){logger[_0x8913('0x12')](_0x8913('0xd'),_0x2b7c06,_0x40c0a9);_0x24936e(_0x40c0a9);});});}
\ No newline at end of file
index 08da666..d8565fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b8d=['get','/:id/download','download','post','create','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index'];(function(_0x5cb97e,_0x132a39){var _0x1714b4=function(_0x384210){while(--_0x384210){_0x5cb97e['push'](_0x5cb97e['shift']());}};_0x1714b4(++_0x132a39);}(_0x0b8d,0x18f));var _0xd0b8=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x0b8d[_0x266618];return _0x54dbf5;};'use strict';var multer=require(_0xd0b8('0x0'));var util=require(_0xd0b8('0x1'));var path=require(_0xd0b8('0x2'));var express=require('express');var router=express[_0xd0b8('0x3')]();var auth=require(_0xd0b8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd0b8('0x5'));var controller=require(_0xd0b8('0x6'));router['get']('/',auth[_0xd0b8('0x7')](),controller[_0xd0b8('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xd0b8('0x9')](_0xd0b8('0xa'),auth[_0xd0b8('0x7')](),controller[_0xd0b8('0xb')]);router[_0xd0b8('0xc')]('/',auth[_0xd0b8('0x7')](),controller[_0xd0b8('0xd')]);router['put']('/:id',auth[_0xd0b8('0x7')](),controller['update']);router[_0xd0b8('0xe')]('/:id',auth[_0xd0b8('0x7')](),controller[_0xd0b8('0xf')]);module[_0xd0b8('0x10')]=router;
\ No newline at end of file
+var _0x0272=['create','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','index','get','/:id','/:id/download','download','isAuthenticated'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x0272,0x15a));var _0x2027=function(_0x51a45e,_0x5cdb9b){_0x51a45e=_0x51a45e-0x0;var _0x1c6b62=_0x0272[_0x51a45e];return _0x1c6b62;};'use strict';var multer=require(_0x2027('0x0'));var util=require(_0x2027('0x1'));var path=require('path');var express=require(_0x2027('0x2'));var router=express[_0x2027('0x3')]();var auth=require(_0x2027('0x4'));var interaction=require(_0x2027('0x5'));var config=require(_0x2027('0x6'));var controller=require(_0x2027('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2027('0x8')]);router[_0x2027('0x9')](_0x2027('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x2027('0xb'),auth['isAuthenticated'](),controller[_0x2027('0xc')]);router['post']('/',auth[_0x2027('0xd')](),controller[_0x2027('0xe')]);router[_0x2027('0xf')](_0x2027('0xa'),auth['isAuthenticated'](),controller[_0x2027('0x10')]);router[_0x2027('0x11')](_0x2027('0xa'),auth[_0x2027('0xd')](),controller[_0x2027('0x12')]);module[_0x2027('0x13')]=router;
\ No newline at end of file
index b2f8328..a1561b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc02a=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x5d8d4b,_0x4c12e4){var _0xe43bf3=function(_0x396e1b){while(--_0x396e1b){_0x5d8d4b['push'](_0x5d8d4b['shift']());}};_0xe43bf3(++_0x4c12e4);}(_0xc02a,0x161));var _0xac02=function(_0x2abc3d,_0x48edca){_0x2abc3d=_0x2abc3d-0x0;var _0x252745=_0xc02a[_0x2abc3d];return _0x252745;};'use strict';var Sequelize=require(_0xac02('0x0'));module[_0xac02('0x1')]={'field':{'type':Sequelize[_0xac02('0x2')]},'alias':{'type':Sequelize[_0xac02('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xac02('0x3')]},'groupBy':{'type':Sequelize[_0xac02('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xac02('0x3')]},'custom':{'type':Sequelize[_0xac02('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xe970=['TEXT','STRING','BOOLEAN','exports'];(function(_0x4786f2,_0x53483f){var _0x160c8b=function(_0x436870){while(--_0x436870){_0x4786f2['push'](_0x4786f2['shift']());}};_0x160c8b(++_0x53483f);}(_0xe970,0xff));var _0x0e97=function(_0x15c1dd,_0x511094){_0x15c1dd=_0x15c1dd-0x0;var _0x161dab=_0xe970[_0x15c1dd];return _0x161dab;};'use strict';var Sequelize=require('sequelize');module[_0x0e97('0x0')]={'field':{'type':Sequelize[_0x0e97('0x1')]},'alias':{'type':Sequelize[_0x0e97('0x2')]},'function':{'type':Sequelize[_0x0e97('0x2')]},'format':{'type':Sequelize[_0x0e97('0x2')]},'groupBy':{'type':Sequelize[_0x0e97('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0e97('0x2')]},'custom':{'type':Sequelize[_0x0e97('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 3da7cad..e855019 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdebb=['keys','query','dateEnd','dateStart','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','add','day','merge','filter','map','options','includeAll','include','findAll','rows','catch','params','find','create','bulkCreate','body','bulkDestroy','destroy','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','end','error','stack','name','send','index','AnalyticFieldReport','rawAttributes'];(function(_0x35f210,_0x1e12a4){var _0xd6cfca=function(_0x3bac49){while(--_0x3bac49){_0x35f210['push'](_0x35f210['shift']());}};_0xd6cfca(++_0x1e12a4);}(_0xdebb,0x77));var _0xbdeb=function(_0x22f627,_0x45c235){_0x22f627=_0x22f627-0x0;var _0x5bc5a2=_0xdebb[_0x22f627];return _0x5bc5a2;};'use strict';var pdf=require(_0xbdeb('0x0'));var emlformat=require(_0xbdeb('0x1'));var rimraf=require(_0xbdeb('0x2'));var zipdir=require(_0xbdeb('0x3'));var jsonpatch=require(_0xbdeb('0x4'));var rp=require(_0xbdeb('0x5'));var moment=require(_0xbdeb('0x6'));var BPromise=require(_0xbdeb('0x7'));var Mustache=require(_0xbdeb('0x8'));var util=require('util');var path=require(_0xbdeb('0x9'));var sox=require('sox');var csv=require(_0xbdeb('0xa'));var ejs=require(_0xbdeb('0xb'));var fs=require('fs');var _=require(_0xbdeb('0xc'));var squel=require('squel');var crypto=require(_0xbdeb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbdeb('0xe'));var toCsv=require(_0xbdeb('0xa'));var querystring=require(_0xbdeb('0xf'));var Papa=require(_0xbdeb('0x10'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xbdeb('0x11'));var utils=require(_0xbdeb('0x12'));var config=require(_0xbdeb('0x13'));var db=require(_0xbdeb('0x14'))['db'];function respondWithStatusCode(_0x169d2d,_0x4e2c86){_0x4e2c86=_0x4e2c86||0xcc;return function(_0x67b3db){if(_0x67b3db){return _0x169d2d[_0xbdeb('0x15')](_0x4e2c86);}return _0x169d2d[_0xbdeb('0x16')](_0x4e2c86)['end']();};}function respondWithResult(_0x429b73,_0x290e48){_0x290e48=_0x290e48||0xc8;return function(_0x27c4fa){if(_0x27c4fa){return _0x429b73['status'](_0x290e48)[_0xbdeb('0x17')](_0x27c4fa);}};}function respondWithFilteredResult(_0x5c5793,_0x182524){return function(_0x16db4c){if(_0x16db4c){var _0x34573d=_0x16db4c[_0xbdeb('0x18')],_0xae28e=_0x182524[_0xbdeb('0x19')],_0x59c459=_0x182524['offset']+_0x182524[_0xbdeb('0x1a')],_0x30e6ef;if(_0x59c459>=_0x34573d){_0x59c459=_0x34573d;_0x30e6ef=0xc8;}else{_0x30e6ef=0xce;}_0x5c5793[_0xbdeb('0x16')](_0x30e6ef);return _0x5c5793[_0xbdeb('0x1b')](_0xbdeb('0x1c'),_0xae28e+'-'+_0x59c459+'/'+_0x34573d)[_0xbdeb('0x17')](_0x16db4c);}return null;};}function patchUpdates(_0x2c129f){return function(_0x109a4e){try{jsonpatch['apply'](_0x109a4e,_0x2c129f,!![]);}catch(_0x3ce199){return BPromise[_0xbdeb('0x1d')](_0x3ce199);}return _0x109a4e[_0xbdeb('0x1e')]();};}function saveUpdates(_0x576ff4,_0x2549f8){return function(_0x4c4af4){if(_0x4c4af4){return _0x4c4af4[_0xbdeb('0x1f')](_0x576ff4)[_0xbdeb('0x20')](function(_0x314b3c){return _0x314b3c;});}return null;};}function removeEntity(_0x34584f,_0x324f29){return function(_0x56d850){if(_0x56d850){return _0x56d850['destroy']()[_0xbdeb('0x20')](function(){_0x34584f[_0xbdeb('0x16')](0xcc)[_0xbdeb('0x21')]();});}};}function handleEntityNotFound(_0x2d8a63,_0x1b4991){return function(_0x34a51d){if(!_0x34a51d){_0x2d8a63[_0xbdeb('0x15')](0x194);}return _0x34a51d;};}function handleError(_0x4a42db,_0x297d84){_0x297d84=_0x297d84||0x1f4;return function(_0x1103af){logger[_0xbdeb('0x22')](_0x1103af[_0xbdeb('0x23')]);if(_0x1103af[_0xbdeb('0x24')]){delete _0x1103af[_0xbdeb('0x24')];}_0x4a42db[_0xbdeb('0x16')](_0x297d84)[_0xbdeb('0x25')](_0x1103af);};}exports[_0xbdeb('0x26')]=function(_0x21f7a6,_0x426fdc){var _0x1da926={},_0x37a874={},_0x4b5337={'count':0x0,'rows':[]};var _0x400377=db[_0xbdeb('0x27')][_0xbdeb('0x28')];_0x37a874['model']=_[_0xbdeb('0x29')](_0x400377);var _0x5c03a3={'dateStart':_0x21f7a6[_0xbdeb('0x2a')]['dateStart'],'dateEnd':_0x21f7a6[_0xbdeb('0x2a')][_0xbdeb('0x2b')]};delete _0x21f7a6[_0xbdeb('0x2a')][_0xbdeb('0x2c')];delete _0x21f7a6[_0xbdeb('0x2a')]['dateEnd'];_0x37a874[_0xbdeb('0x2a')]=_['keys'](_0x21f7a6[_0xbdeb('0x2a')]);_0x37a874['filters']=_[_0xbdeb('0x2d')](_0x37a874[_0xbdeb('0x2e')],_0x37a874[_0xbdeb('0x2a')]);_0x1da926['attributes']=_[_0xbdeb('0x2d')](_0x37a874[_0xbdeb('0x2e')],qs[_0xbdeb('0x2f')](_0x21f7a6[_0xbdeb('0x2a')][_0xbdeb('0x2f')]));_0x1da926['attributes']=_0x1da926[_0xbdeb('0x30')][_0xbdeb('0x31')]?_0x1da926[_0xbdeb('0x30')]:_0x37a874[_0xbdeb('0x2e')];if(!_0x21f7a6[_0xbdeb('0x2a')][_0xbdeb('0x32')](_0xbdeb('0x33'))){_0x1da926[_0xbdeb('0x1a')]=qs[_0xbdeb('0x1a')](_0x21f7a6[_0xbdeb('0x2a')][_0xbdeb('0x1a')]);_0x1da926['offset']=qs['offset'](_0x21f7a6[_0xbdeb('0x2a')]['offset']);}_0x1da926[_0xbdeb('0x34')]=qs['sort'](_0x21f7a6[_0xbdeb('0x2a')][_0xbdeb('0x35')]);_0x1da926[_0xbdeb('0x36')]=qs[_0xbdeb('0x37')](_[_0xbdeb('0x38')](_0x21f7a6['query'],_0x37a874[_0xbdeb('0x37')]));if(_0x5c03a3[_0xbdeb('0x2c')]){if(_0x5c03a3[_0xbdeb('0x2b')]){_0x5c03a3['dateEnd']=moment(_0x5c03a3[_0xbdeb('0x2b')])[_0xbdeb('0x39')](0x1,_0xbdeb('0x3a'));}else{_0x5c03a3[_0xbdeb('0x2b')]=moment(_0x5c03a3[_0xbdeb('0x2c')])[_0xbdeb('0x39')](0x1,_0xbdeb('0x3a'));}_[_0xbdeb('0x3b')](_0x1da926['where'],{'createdAt':{'$gte':_0x5c03a3[_0xbdeb('0x2c')],'$lte':_0x5c03a3[_0xbdeb('0x2b')]}});}if(_0x21f7a6[_0xbdeb('0x2a')][_0xbdeb('0x3c')]){_0x1da926[_0xbdeb('0x36')]=_[_0xbdeb('0x3b')](_0x1da926['where'],{'$or':_[_0xbdeb('0x3d')](_0x1da926['attributes'],function(_0x3a4b67){var _0x23c715={};_0x23c715[_0x3a4b67]={'$like':'%'+_0x21f7a6[_0xbdeb('0x2a')][_0xbdeb('0x3c')]+'%'};return _0x23c715;})});}_0x1da926=_['merge']({},_0x1da926,_0x21f7a6[_0xbdeb('0x3e')]);var _0x49c355={'where':_0x1da926[_0xbdeb('0x36')]};return db['AnalyticFieldReport']['count'](_0x49c355)[_0xbdeb('0x20')](function(_0x53d5f1){_0x4b5337['count']=_0x53d5f1;if(_0x21f7a6[_0xbdeb('0x2a')][_0xbdeb('0x3f')]){_0x1da926[_0xbdeb('0x40')]=[{'all':!![]}];}return db[_0xbdeb('0x27')][_0xbdeb('0x41')](_0x1da926);})[_0xbdeb('0x20')](function(_0x1afff0){_0x4b5337[_0xbdeb('0x42')]=_0x1afff0;return _0x4b5337;})[_0xbdeb('0x20')](respondWithFilteredResult(_0x426fdc,_0x1da926))[_0xbdeb('0x43')](handleError(_0x426fdc,null));};exports['show']=function(_0x480da2,_0x314d17){var _0x1e5a2e={'raw':![],'where':{'id':_0x480da2[_0xbdeb('0x44')]['id']}},_0x112787={};_0x112787[_0xbdeb('0x2e')]=_[_0xbdeb('0x29')](db['AnalyticFieldReport'][_0xbdeb('0x28')]);_0x112787['query']=_[_0xbdeb('0x29')](_0x480da2[_0xbdeb('0x2a')]);_0x112787[_0xbdeb('0x37')]=_[_0xbdeb('0x2d')](_0x112787[_0xbdeb('0x2e')],_0x112787[_0xbdeb('0x2a')]);_0x1e5a2e[_0xbdeb('0x30')]=_[_0xbdeb('0x2d')](_0x112787[_0xbdeb('0x2e')],qs['fields'](_0x480da2[_0xbdeb('0x2a')][_0xbdeb('0x2f')]));_0x1e5a2e[_0xbdeb('0x30')]=_0x1e5a2e[_0xbdeb('0x30')][_0xbdeb('0x31')]?_0x1e5a2e[_0xbdeb('0x30')]:_0x112787[_0xbdeb('0x2e')];if(_0x480da2[_0xbdeb('0x2a')]['includeAll']){_0x1e5a2e[_0xbdeb('0x40')]=[{'all':!![]}];}_0x1e5a2e=_['merge']({},_0x1e5a2e,_0x480da2[_0xbdeb('0x3e')]);return db[_0xbdeb('0x27')][_0xbdeb('0x45')](_0x1e5a2e)[_0xbdeb('0x20')](handleEntityNotFound(_0x314d17,null))['then'](respondWithResult(_0x314d17,null))['catch'](handleError(_0x314d17,null));};exports['create']=function(_0x290fb6,_0x1ba2e3){return db[_0xbdeb('0x27')][_0xbdeb('0x46')](_0x290fb6['body'],{})[_0xbdeb('0x20')](respondWithResult(_0x1ba2e3,0xc9))[_0xbdeb('0x43')](handleError(_0x1ba2e3,null));};exports[_0xbdeb('0x47')]=function(_0x4f7dde,_0x54a5ea){return db[_0xbdeb('0x27')][_0xbdeb('0x47')](_0x4f7dde['body'],{'raw':![],'individualHooks':!![]})[_0xbdeb('0x20')](respondWithResult(_0x54a5ea,0xc9))[_0xbdeb('0x43')](handleError(_0x54a5ea,null));};exports[_0xbdeb('0x1f')]=function(_0x5720a7,_0x4491b4){if(_0x5720a7[_0xbdeb('0x48')]['id']){delete _0x5720a7[_0xbdeb('0x48')]['id'];}return db[_0xbdeb('0x27')][_0xbdeb('0x45')]({'where':{'id':_0x5720a7[_0xbdeb('0x44')]['id']}})['then'](handleEntityNotFound(_0x4491b4,null))[_0xbdeb('0x20')](saveUpdates(_0x5720a7[_0xbdeb('0x48')],null))[_0xbdeb('0x20')](respondWithResult(_0x4491b4,null))[_0xbdeb('0x43')](handleError(_0x4491b4,null));};exports['destroy']=function(_0x2a9053,_0x4ad904){return db[_0xbdeb('0x27')]['find']({'where':{'id':_0x2a9053[_0xbdeb('0x44')]['id']}})[_0xbdeb('0x20')](handleEntityNotFound(_0x4ad904,null))['then'](removeEntity(_0x4ad904,null))[_0xbdeb('0x43')](handleError(_0x4ad904,null));};exports[_0xbdeb('0x49')]=function(_0x44faaf,_0x490e1f){return db[_0xbdeb('0x27')][_0xbdeb('0x4a')]({'where':{'id':_0x44faaf[_0xbdeb('0x2a')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x490e1f,0xcc))['catch'](handleError(_0x490e1f,null));};exports[_0xbdeb('0x4b')]=function(_0x349f01,_0xee54d2,_0x1132a8){return db[_0xbdeb('0x4c')][_0xbdeb('0x4d')]({'where':{'id':_0x349f01[_0xbdeb('0x44')]['id']}})['then'](handleEntityNotFound(_0xee54d2,null))[_0xbdeb('0x20')](function(_0x14fa5c){if(_0x14fa5c){return db['sequelize'][_0xbdeb('0x4e')](function(_0x2cac1e){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x349f01[_0xbdeb('0x44')]['id']},'transaction':_0x2cac1e})[_0xbdeb('0x20')](function(_0x256fb6){var _0x4f2181=_[_0xbdeb('0x3d')](_0x349f01['body'],function(_0x2080d8){delete _0x2080d8['id'];_0x2080d8[_0xbdeb('0x4f')]=_0x349f01[_0xbdeb('0x44')]['id'];return _0x2080d8;});return db[_0xbdeb('0x27')]['bulkCreate'](_0x4f2181,{'transaction':_0x2cac1e});});})[_0xbdeb('0x20')](function(){return db[_0xbdeb('0x27')][_0xbdeb('0x41')]({'where':{'CustomReportId':_0x349f01[_0xbdeb('0x44')]['id']}});});}})['then'](respondWithResult(_0xee54d2,null))[_0xbdeb('0x43')](handleError(_0xee54d2,null));};
\ No newline at end of file
+var _0xc428=['then','includeAll','include','findAll','rows','show','params','intersection','options','find','catch','create','body','bulkCreate','bulkDestroy','ids','addFields','findOne','sequelize','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','error','stack','name','send','AnalyticFieldReport','rawAttributes','model','keys','query','dateEnd','filters','attributes','fields','length','hasOwnProperty','order','sort','add','day','dateStart','merge','where','filter','map'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xc428,0xb1));var _0x8c42=function(_0x23f485,_0x59ca59){_0x23f485=_0x23f485-0x0;var _0x5cc50d=_0xc428[_0x23f485];return _0x5cc50d;};'use strict';var pdf=require(_0x8c42('0x0'));var emlformat=require(_0x8c42('0x1'));var rimraf=require(_0x8c42('0x2'));var zipdir=require(_0x8c42('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8c42('0x4'));var moment=require('moment');var BPromise=require(_0x8c42('0x5'));var Mustache=require(_0x8c42('0x6'));var util=require(_0x8c42('0x7'));var path=require(_0x8c42('0x8'));var sox=require(_0x8c42('0x9'));var csv=require(_0x8c42('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8c42('0xb'));var squel=require(_0x8c42('0xc'));var crypto=require(_0x8c42('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8c42('0xe'));var toCsv=require(_0x8c42('0xa'));var querystring=require(_0x8c42('0xf'));var Papa=require(_0x8c42('0x10'));var qs=require(_0x8c42('0x11'));var logger=require(_0x8c42('0x12'))(_0x8c42('0x13'));var utils=require(_0x8c42('0x14'));var config=require(_0x8c42('0x15'));var db=require(_0x8c42('0x16'))['db'];function respondWithStatusCode(_0x3f87ad,_0x35ea61){_0x35ea61=_0x35ea61||0xcc;return function(_0x3d27ed){if(_0x3d27ed){return _0x3f87ad[_0x8c42('0x17')](_0x35ea61);}return _0x3f87ad[_0x8c42('0x18')](_0x35ea61)[_0x8c42('0x19')]();};}function respondWithResult(_0x9d63e8,_0x30f7b8){_0x30f7b8=_0x30f7b8||0xc8;return function(_0x5f5161){if(_0x5f5161){return _0x9d63e8[_0x8c42('0x18')](_0x30f7b8)[_0x8c42('0x1a')](_0x5f5161);}};}function respondWithFilteredResult(_0x8fe2c7,_0x309db7){return function(_0x2acce1){if(_0x2acce1){var _0x4497de=_0x2acce1[_0x8c42('0x1b')],_0x26175b=_0x309db7[_0x8c42('0x1c')],_0x3fba63=_0x309db7[_0x8c42('0x1c')]+_0x309db7[_0x8c42('0x1d')],_0x1ec134;if(_0x3fba63>=_0x4497de){_0x3fba63=_0x4497de;_0x1ec134=0xc8;}else{_0x1ec134=0xce;}_0x8fe2c7[_0x8c42('0x18')](_0x1ec134);return _0x8fe2c7[_0x8c42('0x1e')]('Content-Range',_0x26175b+'-'+_0x3fba63+'/'+_0x4497de)[_0x8c42('0x1a')](_0x2acce1);}return null;};}function patchUpdates(_0x9fa9ff){return function(_0x1196d3){try{jsonpatch[_0x8c42('0x1f')](_0x1196d3,_0x9fa9ff,!![]);}catch(_0x282d3f){return BPromise[_0x8c42('0x20')](_0x282d3f);}return _0x1196d3[_0x8c42('0x21')]();};}function saveUpdates(_0x3ffe0e,_0xb07d8a){return function(_0x5872ce){if(_0x5872ce){return _0x5872ce[_0x8c42('0x22')](_0x3ffe0e)['then'](function(_0x7c7d2b){return _0x7c7d2b;});}return null;};}function removeEntity(_0x5a2ea8,_0x2cd836){return function(_0x58f153){if(_0x58f153){return _0x58f153[_0x8c42('0x23')]()['then'](function(){_0x5a2ea8[_0x8c42('0x18')](0xcc)[_0x8c42('0x19')]();});}};}function handleEntityNotFound(_0x3d5fa6,_0x32aac3){return function(_0x35424d){if(!_0x35424d){_0x3d5fa6[_0x8c42('0x17')](0x194);}return _0x35424d;};}function handleError(_0x52af6a,_0x3c7b0c){_0x3c7b0c=_0x3c7b0c||0x1f4;return function(_0x1cc52c){logger[_0x8c42('0x24')](_0x1cc52c[_0x8c42('0x25')]);if(_0x1cc52c[_0x8c42('0x26')]){delete _0x1cc52c[_0x8c42('0x26')];}_0x52af6a[_0x8c42('0x18')](_0x3c7b0c)[_0x8c42('0x27')](_0x1cc52c);};}exports['index']=function(_0x5d2791,_0x54562f){var _0x2f2f22={},_0x56840b={},_0x4cba12={'count':0x0,'rows':[]};var _0x3776f2=db[_0x8c42('0x28')][_0x8c42('0x29')];_0x56840b[_0x8c42('0x2a')]=_[_0x8c42('0x2b')](_0x3776f2);var _0x3acaa3={'dateStart':_0x5d2791[_0x8c42('0x2c')]['dateStart'],'dateEnd':_0x5d2791[_0x8c42('0x2c')]['dateEnd']};delete _0x5d2791['query']['dateStart'];delete _0x5d2791['query'][_0x8c42('0x2d')];_0x56840b[_0x8c42('0x2c')]=_[_0x8c42('0x2b')](_0x5d2791[_0x8c42('0x2c')]);_0x56840b[_0x8c42('0x2e')]=_['intersection'](_0x56840b[_0x8c42('0x2a')],_0x56840b[_0x8c42('0x2c')]);_0x2f2f22[_0x8c42('0x2f')]=_['intersection'](_0x56840b[_0x8c42('0x2a')],qs[_0x8c42('0x30')](_0x5d2791[_0x8c42('0x2c')]['fields']));_0x2f2f22['attributes']=_0x2f2f22[_0x8c42('0x2f')][_0x8c42('0x31')]?_0x2f2f22[_0x8c42('0x2f')]:_0x56840b[_0x8c42('0x2a')];if(!_0x5d2791['query'][_0x8c42('0x32')]('nolimit')){_0x2f2f22[_0x8c42('0x1d')]=qs[_0x8c42('0x1d')](_0x5d2791[_0x8c42('0x2c')][_0x8c42('0x1d')]);_0x2f2f22[_0x8c42('0x1c')]=qs['offset'](_0x5d2791[_0x8c42('0x2c')]['offset']);}_0x2f2f22[_0x8c42('0x33')]=qs[_0x8c42('0x34')](_0x5d2791[_0x8c42('0x2c')][_0x8c42('0x34')]);_0x2f2f22['where']=qs['filters'](_['pick'](_0x5d2791[_0x8c42('0x2c')],_0x56840b[_0x8c42('0x2e')]));if(_0x3acaa3['dateStart']){if(_0x3acaa3[_0x8c42('0x2d')]){_0x3acaa3['dateEnd']=moment(_0x3acaa3[_0x8c42('0x2d')])[_0x8c42('0x35')](0x1,_0x8c42('0x36'));}else{_0x3acaa3[_0x8c42('0x2d')]=moment(_0x3acaa3[_0x8c42('0x37')])[_0x8c42('0x35')](0x1,'day');}_[_0x8c42('0x38')](_0x2f2f22[_0x8c42('0x39')],{'createdAt':{'$gte':_0x3acaa3[_0x8c42('0x37')],'$lte':_0x3acaa3[_0x8c42('0x2d')]}});}if(_0x5d2791[_0x8c42('0x2c')][_0x8c42('0x3a')]){_0x2f2f22[_0x8c42('0x39')]=_[_0x8c42('0x38')](_0x2f2f22[_0x8c42('0x39')],{'$or':_[_0x8c42('0x3b')](_0x2f2f22[_0x8c42('0x2f')],function(_0x3d2d5c){var _0x3ce187={};_0x3ce187[_0x3d2d5c]={'$like':'%'+_0x5d2791[_0x8c42('0x2c')][_0x8c42('0x3a')]+'%'};return _0x3ce187;})});}_0x2f2f22=_[_0x8c42('0x38')]({},_0x2f2f22,_0x5d2791['options']);var _0x1fe0a6={'where':_0x2f2f22['where']};return db['AnalyticFieldReport'][_0x8c42('0x1b')](_0x1fe0a6)[_0x8c42('0x3c')](function(_0x49a482){_0x4cba12[_0x8c42('0x1b')]=_0x49a482;if(_0x5d2791[_0x8c42('0x2c')][_0x8c42('0x3d')]){_0x2f2f22[_0x8c42('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x8c42('0x3f')](_0x2f2f22);})[_0x8c42('0x3c')](function(_0x3e8c4b){_0x4cba12[_0x8c42('0x40')]=_0x3e8c4b;return _0x4cba12;})[_0x8c42('0x3c')](respondWithFilteredResult(_0x54562f,_0x2f2f22))['catch'](handleError(_0x54562f,null));};exports[_0x8c42('0x41')]=function(_0x1f6c55,_0x236a22){var _0x35f449={'raw':![],'where':{'id':_0x1f6c55[_0x8c42('0x42')]['id']}},_0x3c2c26={};_0x3c2c26['model']=_[_0x8c42('0x2b')](db[_0x8c42('0x28')][_0x8c42('0x29')]);_0x3c2c26['query']=_[_0x8c42('0x2b')](_0x1f6c55[_0x8c42('0x2c')]);_0x3c2c26[_0x8c42('0x2e')]=_[_0x8c42('0x43')](_0x3c2c26[_0x8c42('0x2a')],_0x3c2c26[_0x8c42('0x2c')]);_0x35f449[_0x8c42('0x2f')]=_[_0x8c42('0x43')](_0x3c2c26[_0x8c42('0x2a')],qs['fields'](_0x1f6c55[_0x8c42('0x2c')]['fields']));_0x35f449[_0x8c42('0x2f')]=_0x35f449['attributes']['length']?_0x35f449[_0x8c42('0x2f')]:_0x3c2c26['model'];if(_0x1f6c55[_0x8c42('0x2c')][_0x8c42('0x3d')]){_0x35f449['include']=[{'all':!![]}];}_0x35f449=_[_0x8c42('0x38')]({},_0x35f449,_0x1f6c55[_0x8c42('0x44')]);return db[_0x8c42('0x28')][_0x8c42('0x45')](_0x35f449)[_0x8c42('0x3c')](handleEntityNotFound(_0x236a22,null))[_0x8c42('0x3c')](respondWithResult(_0x236a22,null))[_0x8c42('0x46')](handleError(_0x236a22,null));};exports[_0x8c42('0x47')]=function(_0x178ce4,_0x5a3ae3){return db[_0x8c42('0x28')][_0x8c42('0x47')](_0x178ce4[_0x8c42('0x48')],{})[_0x8c42('0x3c')](respondWithResult(_0x5a3ae3,0xc9))[_0x8c42('0x46')](handleError(_0x5a3ae3,null));};exports[_0x8c42('0x49')]=function(_0x2928af,_0x437d0b){return db['AnalyticFieldReport'][_0x8c42('0x49')](_0x2928af['body'],{'raw':![],'individualHooks':!![]})[_0x8c42('0x3c')](respondWithResult(_0x437d0b,0xc9))[_0x8c42('0x46')](handleError(_0x437d0b,null));};exports[_0x8c42('0x22')]=function(_0x210489,_0x221a00){if(_0x210489[_0x8c42('0x48')]['id']){delete _0x210489[_0x8c42('0x48')]['id'];}return db[_0x8c42('0x28')][_0x8c42('0x45')]({'where':{'id':_0x210489[_0x8c42('0x42')]['id']}})[_0x8c42('0x3c')](handleEntityNotFound(_0x221a00,null))['then'](saveUpdates(_0x210489[_0x8c42('0x48')],null))[_0x8c42('0x3c')](respondWithResult(_0x221a00,null))[_0x8c42('0x46')](handleError(_0x221a00,null));};exports[_0x8c42('0x23')]=function(_0x5b609b,_0x140c6a){return db[_0x8c42('0x28')][_0x8c42('0x45')]({'where':{'id':_0x5b609b[_0x8c42('0x42')]['id']}})[_0x8c42('0x3c')](handleEntityNotFound(_0x140c6a,null))['then'](removeEntity(_0x140c6a,null))[_0x8c42('0x46')](handleError(_0x140c6a,null));};exports[_0x8c42('0x4a')]=function(_0x469498,_0x5ad35d){return db[_0x8c42('0x28')]['destroy']({'where':{'id':_0x469498[_0x8c42('0x2c')][_0x8c42('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x8c42('0x3c')](respondWithResult(_0x5ad35d,0xcc))[_0x8c42('0x46')](handleError(_0x5ad35d,null));};exports[_0x8c42('0x4c')]=function(_0x59c20a,_0x171ca6,_0x1ab529){return db['AnalyticCustomReport'][_0x8c42('0x4d')]({'where':{'id':_0x59c20a['params']['id']}})[_0x8c42('0x3c')](handleEntityNotFound(_0x171ca6,null))[_0x8c42('0x3c')](function(_0x2c6d8a){if(_0x2c6d8a){return db[_0x8c42('0x4e')]['transaction'](function(_0x114131){return db[_0x8c42('0x28')][_0x8c42('0x23')]({'where':{'CustomReportId':_0x59c20a[_0x8c42('0x42')]['id']},'transaction':_0x114131})[_0x8c42('0x3c')](function(_0x3dcf5e){var _0x5c38c2=_['map'](_0x59c20a[_0x8c42('0x48')],function(_0x450931){delete _0x450931['id'];_0x450931['CustomReportId']=_0x59c20a['params']['id'];return _0x450931;});return db[_0x8c42('0x28')][_0x8c42('0x49')](_0x5c38c2,{'transaction':_0x114131});});})[_0x8c42('0x3c')](function(){return db[_0x8c42('0x28')][_0x8c42('0x3f')]({'where':{'CustomReportId':_0x59c20a[_0x8c42('0x42')]['id']}});});}})[_0x8c42('0x3c')](respondWithResult(_0x171ca6,null))[_0x8c42('0x46')](handleError(_0x171ca6,null));};
\ No newline at end of file
index 16b3372..9ac0bb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x742c=['util','../../config/logger','api','moment','bluebird','exports','define','AnalyticFieldReport','analytics_report_fields','lodash'];(function(_0x402b08,_0x60873c){var _0x51c1ca=function(_0x1442d7){while(--_0x1442d7){_0x402b08['push'](_0x402b08['shift']());}};_0x51c1ca(++_0x60873c);}(_0x742c,0x8b));var _0xc742=function(_0x1fdb40,_0x51351c){_0x1fdb40=_0x1fdb40-0x0;var _0x281f93=_0x742c[_0x1fdb40];return _0x281f93;};'use strict';var _=require(_0xc742('0x0'));var util=require(_0xc742('0x1'));var logger=require(_0xc742('0x2'))(_0xc742('0x3'));var moment=require(_0xc742('0x4'));var BPromise=require(_0xc742('0x5'));var rp=require('request-promise');var attributes=require('./analyticFieldReport.attributes');module[_0xc742('0x6')]=function(_0x34050f,_0x49fefd){return _0x34050f[_0xc742('0x7')](_0xc742('0x8'),attributes,{'tableName':_0xc742('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d4a=['request-promise','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment'];(function(_0x5e9689,_0x48e034){var _0x2fac94=function(_0x1e8f97){while(--_0x1e8f97){_0x5e9689['push'](_0x5e9689['shift']());}};_0x2fac94(++_0x48e034);}(_0x7d4a,0x196));var _0xa7d4=function(_0x3d38fe,_0x1c91d1){_0x3d38fe=_0x3d38fe-0x0;var _0x4b07d8=_0x7d4a[_0x3d38fe];return _0x4b07d8;};'use strict';var _=require(_0xa7d4('0x0'));var util=require('util');var logger=require(_0xa7d4('0x1'))(_0xa7d4('0x2'));var moment=require(_0xa7d4('0x3'));var BPromise=require('bluebird');var rp=require(_0xa7d4('0x4'));var attributes=require(_0xa7d4('0x5'));module[_0xa7d4('0x6')]=function(_0x5d4c43,_0x50d25b){return _0x5d4c43[_0xa7d4('0x7')](_0xa7d4('0x8'),attributes,{'tableName':_0xa7d4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b2337a3..a3ad736 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdd1=['code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x123cc3,_0x361fd8){var _0x134ee0=function(_0xdccd6d){while(--_0xdccd6d){_0x123cc3['push'](_0x123cc3['shift']());}};_0x134ee0(++_0x361fd8);}(_0xbdd1,0x1e5));var _0x1bdd=function(_0x3bfd1c,_0x40e285){_0x3bfd1c=_0x3bfd1c-0x0;var _0x22527d=_0xbdd1[_0x3bfd1c];return _0x22527d;};'use strict';var _=require(_0x1bdd('0x0'));var util=require(_0x1bdd('0x1'));var moment=require('moment');var BPromise=require(_0x1bdd('0x2'));var rs=require(_0x1bdd('0x3'));var fs=require('fs');var db=require(_0x1bdd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1bdd('0x5'))(_0x1bdd('0x6'));var config=require(_0x1bdd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1bdd('0x8')][_0x1bdd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc70f8e,_0x31d002,_0x3367fb){return new BPromise(function(_0x3b5632,_0x2fa4e0){return client['request'](_0xc70f8e,_0x3367fb)['then'](function(_0x1679db){logger['info'](_0x1bdd('0xa'),_0x31d002,_0x1bdd('0xb'));logger[_0x1bdd('0xc')](_0x1bdd('0xd'),_0x31d002,_0x1bdd('0xb'),JSON['stringify'](_0x1679db));if(_0x1679db[_0x1bdd('0xe')]){if(_0x1679db['error'][_0x1bdd('0xf')]===0x1f4){logger['error'](_0x1bdd('0xa'),_0x31d002,_0x1679db[_0x1bdd('0xe')][_0x1bdd('0x10')]);return _0x2fa4e0(_0x1679db[_0x1bdd('0xe')][_0x1bdd('0x10')]);}logger[_0x1bdd('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x31d002,_0x1679db[_0x1bdd('0xe')][_0x1bdd('0x10')]);return _0x3b5632(_0x1679db['error'][_0x1bdd('0x10')]);}else{logger[_0x1bdd('0x11')](_0x1bdd('0xa'),_0x31d002,_0x1bdd('0xb'));_0x3b5632(_0x1679db[_0x1bdd('0x12')][_0x1bdd('0x10')]);}})[_0x1bdd('0x13')](function(_0x13cfc1){logger[_0x1bdd('0xe')](_0x1bdd('0xa'),_0x31d002,_0x13cfc1);_0x2fa4e0(_0x13cfc1);});});}
\ No newline at end of file
+var _0x113b=['moment','bluebird','randomstring','../../config/logger','../../config/environment','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x22b022,_0x4af786){var _0x3d29b8=function(_0x42ea01){while(--_0x42ea01){_0x22b022['push'](_0x22b022['shift']());}};_0x3d29b8(++_0x4af786);}(_0x113b,0xc7));var _0xb113=function(_0x52e5af,_0x55ff9e){_0x52e5af=_0x52e5af-0x0;var _0x48fd81=_0x113b[_0x52e5af];return _0x48fd81;};'use strict';var _=require('lodash');var util=require(_0xb113('0x0'));var moment=require(_0xb113('0x1'));var BPromise=require(_0xb113('0x2'));var rs=require(_0xb113('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb113('0x4'))('rpc');var config=require(_0xb113('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb113('0x6')][_0xb113('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2e0731,_0x5f290d,_0x13ca57){return new BPromise(function(_0xd5f990,_0x397de1){return client[_0xb113('0x8')](_0x2e0731,_0x13ca57)[_0xb113('0x9')](function(_0xfb9963){logger[_0xb113('0xa')](_0xb113('0xb'),_0x5f290d,_0xb113('0xc'));logger['debug'](_0xb113('0xd'),_0x5f290d,'request\x20sent',JSON[_0xb113('0xe')](_0xfb9963));if(_0xfb9963[_0xb113('0xf')]){if(_0xfb9963[_0xb113('0xf')][_0xb113('0x10')]===0x1f4){logger[_0xb113('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5f290d,_0xfb9963[_0xb113('0xf')]['message']);return _0x397de1(_0xfb9963['error'][_0xb113('0x11')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x5f290d,_0xfb9963[_0xb113('0xf')][_0xb113('0x11')]);return _0xd5f990(_0xfb9963['error'][_0xb113('0x11')]);}else{logger['info'](_0xb113('0xb'),_0x5f290d,_0xb113('0xc'));_0xd5f990(_0xfb9963[_0xb113('0x12')][_0xb113('0x11')]);}})[_0xb113('0x13')](function(_0x7152){logger[_0xb113('0xf')](_0xb113('0xb'),_0x5f290d,_0x7152);_0x397de1(_0x7152);});});}
\ No newline at end of file
index b91b645..46409f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad34=['/destroy_many','bulkDestroy','destroy','multer','util','path','Router','../../components/auth/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','create','post','/:id/create_many','addFields','put','update','delete'];(function(_0x39eb64,_0x264b32){var _0xd6b833=function(_0x5c263c){while(--_0x5c263c){_0x39eb64['push'](_0x39eb64['shift']());}};_0xd6b833(++_0x264b32);}(_0xad34,0x1d1));var _0x4ad3=function(_0x456f79,_0x303e8b){_0x456f79=_0x456f79-0x0;var _0x57c261=_0xad34[_0x456f79];return _0x57c261;};'use strict';var multer=require(_0x4ad3('0x0'));var util=require(_0x4ad3('0x1'));var path=require(_0x4ad3('0x2'));var express=require('express');var router=express[_0x4ad3('0x3')]();var auth=require(_0x4ad3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4ad3('0x5'));var controller=require(_0x4ad3('0x6'));router[_0x4ad3('0x7')]('/',auth[_0x4ad3('0x8')](),controller[_0x4ad3('0x9')]);router[_0x4ad3('0x7')](_0x4ad3('0xa'),auth[_0x4ad3('0x8')](),controller['show']);router['post']('/',auth[_0x4ad3('0x8')](),controller[_0x4ad3('0xb')]);router[_0x4ad3('0xc')]('/create_many',auth[_0x4ad3('0x8')](),controller['bulkCreate']);router['post'](_0x4ad3('0xd'),auth[_0x4ad3('0x8')](),controller[_0x4ad3('0xe')]);router[_0x4ad3('0xf')](_0x4ad3('0xa'),auth[_0x4ad3('0x8')](),controller[_0x4ad3('0x10')]);router[_0x4ad3('0x11')](_0x4ad3('0x12'),auth[_0x4ad3('0x8')](),controller[_0x4ad3('0x13')]);router[_0x4ad3('0x11')](_0x4ad3('0xa'),auth[_0x4ad3('0x8')](),controller[_0x4ad3('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x79a0=['../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','show','post','create','/create_many','bulkCreate','/:id/create_many','addFields','put','update','bulkDestroy','delete','destroy','exports','util','path','express','Router','../../components/auth/service'];(function(_0x3422bf,_0x21b1da){var _0x4de668=function(_0x271cce){while(--_0x271cce){_0x3422bf['push'](_0x3422bf['shift']());}};_0x4de668(++_0x21b1da);}(_0x79a0,0xf5));var _0x079a=function(_0x573de7,_0x3da0f1){_0x573de7=_0x573de7-0x0;var _0x3f0f1b=_0x79a0[_0x573de7];return _0x3f0f1b;};'use strict';var multer=require('multer');var util=require(_0x079a('0x0'));var path=require(_0x079a('0x1'));var express=require(_0x079a('0x2'));var router=express[_0x079a('0x3')]();var auth=require(_0x079a('0x4'));var interaction=require(_0x079a('0x5'));var config=require(_0x079a('0x6'));var controller=require(_0x079a('0x7'));router[_0x079a('0x8')]('/',auth[_0x079a('0x9')](),controller[_0x079a('0xa')]);router[_0x079a('0x8')](_0x079a('0xb'),auth[_0x079a('0x9')](),controller[_0x079a('0xc')]);router[_0x079a('0xd')]('/',auth[_0x079a('0x9')](),controller[_0x079a('0xe')]);router[_0x079a('0xd')](_0x079a('0xf'),auth[_0x079a('0x9')](),controller[_0x079a('0x10')]);router[_0x079a('0xd')](_0x079a('0x11'),auth[_0x079a('0x9')](),controller[_0x079a('0x12')]);router[_0x079a('0x13')](_0x079a('0xb'),auth['isAuthenticated'](),controller[_0x079a('0x14')]);router['delete']('/destroy_many',auth['isAuthenticated'](),controller[_0x079a('0x15')]);router[_0x079a('0x16')](_0x079a('0xb'),auth[_0x079a('0x9')](),controller[_0x079a('0x17')]);module[_0x079a('0x18')]=router;
\ No newline at end of file
index 02c9c9d..d8a87aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdb0=['STRING','name','TEXT','exports'];(function(_0x4fc2b8,_0x588951){var _0x344115=function(_0x3e1719){while(--_0x3e1719){_0x4fc2b8['push'](_0x4fc2b8['shift']());}};_0x344115(++_0x588951);}(_0xcdb0,0x8b));var _0x0cdb=function(_0x1222d0,_0x2f41c7){_0x1222d0=_0x1222d0-0x0;var _0x477fa4=_0xcdb0[_0x1222d0];return _0x477fa4;};'use strict';var Sequelize=require('sequelize');module[_0x0cdb('0x0')]={'name':{'type':Sequelize[_0x0cdb('0x1')],'allowNull':![],'unique':_0x0cdb('0x2')},'table':{'type':Sequelize[_0x0cdb('0x1')]},'metric':{'type':Sequelize[_0x0cdb('0x3')]},'description':{'type':Sequelize[_0x0cdb('0x1')]}};
\ No newline at end of file
+var _0xfdaa=['STRING','name','TEXT','exports'];(function(_0x514079,_0x115262){var _0xf4c29a=function(_0x44465c){while(--_0x44465c){_0x514079['push'](_0x514079['shift']());}};_0xf4c29a(++_0x115262);}(_0xfdaa,0x19b));var _0xafda=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0xfdaa[_0x38b14f];return _0x22a324;};'use strict';var Sequelize=require('sequelize');module[_0xafda('0x0')]={'name':{'type':Sequelize[_0xafda('0x1')],'allowNull':![],'unique':_0xafda('0x2')},'table':{'type':Sequelize[_0xafda('0x1')]},'metric':{'type':Sequelize[_0xafda('0x3')]},'description':{'type':Sequelize[_0xafda('0x1')]}};
\ No newline at end of file
index de49c74..03f875a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3e8=['find','body','destroy','eml-format','rimraf','request-promise','moment','bluebird','path','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','stack','name','send','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','add','day','merge','filter','options','AnalyticMetric','include','rows','catch','show','params'];(function(_0x40444f,_0x12114e){var _0x385175=function(_0x56a391){while(--_0x56a391){_0x40444f['push'](_0x40444f['shift']());}};_0x385175(++_0x12114e);}(_0xe3e8,0x139));var _0x8e3e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xe3e8[_0x187ee1];return _0x388160;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8e3e('0x0'));var rimraf=require(_0x8e3e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8e3e('0x2'));var moment=require(_0x8e3e('0x3'));var BPromise=require(_0x8e3e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8e3e('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x8e3e('0x6'));var squel=require(_0x8e3e('0x7'));var crypto=require(_0x8e3e('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x8e3e('0x9'));var toCsv=require('to-csv');var querystring=require(_0x8e3e('0xa'));var Papa=require('papaparse');var qs=require(_0x8e3e('0xb'));var logger=require(_0x8e3e('0xc'))(_0x8e3e('0xd'));var utils=require(_0x8e3e('0xe'));var config=require(_0x8e3e('0xf'));var db=require(_0x8e3e('0x10'))['db'];function respondWithStatusCode(_0xdd2e7d,_0x341418){_0x341418=_0x341418||0xcc;return function(_0x48384f){if(_0x48384f){return _0xdd2e7d[_0x8e3e('0x11')](_0x341418);}return _0xdd2e7d[_0x8e3e('0x12')](_0x341418)[_0x8e3e('0x13')]();};}function respondWithResult(_0x519ca9,_0x238686){_0x238686=_0x238686||0xc8;return function(_0x37879e){if(_0x37879e){return _0x519ca9['status'](_0x238686)[_0x8e3e('0x14')](_0x37879e);}};}function respondWithFilteredResult(_0x3220ae,_0xac8f6e){return function(_0x36f43d){if(_0x36f43d){var _0x32a3fd=_0x36f43d[_0x8e3e('0x15')],_0x508687=_0xac8f6e[_0x8e3e('0x16')],_0x5cd583=_0xac8f6e[_0x8e3e('0x16')]+_0xac8f6e[_0x8e3e('0x17')],_0x14a3f9;if(_0x5cd583>=_0x32a3fd){_0x5cd583=_0x32a3fd;_0x14a3f9=0xc8;}else{_0x14a3f9=0xce;}_0x3220ae[_0x8e3e('0x12')](_0x14a3f9);return _0x3220ae[_0x8e3e('0x18')](_0x8e3e('0x19'),_0x508687+'-'+_0x5cd583+'/'+_0x32a3fd)['json'](_0x36f43d);}return null;};}function patchUpdates(_0x309b2d){return function(_0x34bfb0){try{jsonpatch[_0x8e3e('0x1a')](_0x34bfb0,_0x309b2d,!![]);}catch(_0x104ff4){return BPromise['reject'](_0x104ff4);}return _0x34bfb0[_0x8e3e('0x1b')]();};}function saveUpdates(_0x3a69c2,_0x23b61b){return function(_0x2e5d77){if(_0x2e5d77){return _0x2e5d77['update'](_0x3a69c2)[_0x8e3e('0x1c')](function(_0x4875fd){return _0x4875fd;});}return null;};}function removeEntity(_0x100938,_0x54f36d){return function(_0x5d48a6){if(_0x5d48a6){return _0x5d48a6['destroy']()[_0x8e3e('0x1c')](function(){_0x100938[_0x8e3e('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55c12c,_0x3cbd54){return function(_0x45153d){if(!_0x45153d){_0x55c12c[_0x8e3e('0x11')](0x194);}return _0x45153d;};}function handleError(_0x336506,_0x5929bf){_0x5929bf=_0x5929bf||0x1f4;return function(_0x3708fd){logger['error'](_0x3708fd[_0x8e3e('0x1d')]);if(_0x3708fd[_0x8e3e('0x1e')]){delete _0x3708fd[_0x8e3e('0x1e')];}_0x336506[_0x8e3e('0x12')](_0x5929bf)[_0x8e3e('0x1f')](_0x3708fd);};}exports['index']=function(_0x22ab03,_0x4fc3ac){var _0x5b4965={},_0x294665={},_0x1d433e={'count':0x0,'rows':[]};var _0x1efb38=db['AnalyticMetric'][_0x8e3e('0x20')];_0x294665[_0x8e3e('0x21')]=_[_0x8e3e('0x22')](_0x1efb38);var _0x194189={'dateStart':_0x22ab03[_0x8e3e('0x23')][_0x8e3e('0x24')],'dateEnd':_0x22ab03[_0x8e3e('0x23')]['dateEnd']};delete _0x22ab03[_0x8e3e('0x23')][_0x8e3e('0x24')];delete _0x22ab03[_0x8e3e('0x23')][_0x8e3e('0x25')];_0x294665[_0x8e3e('0x23')]=_[_0x8e3e('0x22')](_0x22ab03[_0x8e3e('0x23')]);_0x294665[_0x8e3e('0x26')]=_[_0x8e3e('0x27')](_0x294665[_0x8e3e('0x21')],_0x294665[_0x8e3e('0x23')]);_0x5b4965['attributes']=_[_0x8e3e('0x27')](_0x294665[_0x8e3e('0x21')],qs['fields'](_0x22ab03[_0x8e3e('0x23')][_0x8e3e('0x28')]));_0x5b4965[_0x8e3e('0x29')]=_0x5b4965[_0x8e3e('0x29')]['length']?_0x5b4965[_0x8e3e('0x29')]:_0x294665['model'];if(!_0x22ab03[_0x8e3e('0x23')][_0x8e3e('0x2a')](_0x8e3e('0x2b'))){_0x5b4965['limit']=qs[_0x8e3e('0x17')](_0x22ab03['query'][_0x8e3e('0x17')]);_0x5b4965['offset']=qs[_0x8e3e('0x16')](_0x22ab03[_0x8e3e('0x23')][_0x8e3e('0x16')]);}_0x5b4965[_0x8e3e('0x2c')]=qs['sort'](_0x22ab03['query'][_0x8e3e('0x2d')]);_0x5b4965[_0x8e3e('0x2e')]=qs[_0x8e3e('0x26')](_[_0x8e3e('0x2f')](_0x22ab03['query'],_0x294665[_0x8e3e('0x26')]));if(_0x194189[_0x8e3e('0x24')]){if(_0x194189[_0x8e3e('0x25')]){_0x194189[_0x8e3e('0x25')]=moment(_0x194189[_0x8e3e('0x25')])[_0x8e3e('0x30')](0x1,_0x8e3e('0x31'));}else{_0x194189[_0x8e3e('0x25')]=moment(_0x194189[_0x8e3e('0x24')])[_0x8e3e('0x30')](0x1,_0x8e3e('0x31'));}_[_0x8e3e('0x32')](_0x5b4965[_0x8e3e('0x2e')],{'createdAt':{'$gte':_0x194189['dateStart'],'$lte':_0x194189[_0x8e3e('0x25')]}});}if(_0x22ab03[_0x8e3e('0x23')][_0x8e3e('0x33')]){_0x5b4965[_0x8e3e('0x2e')]=_[_0x8e3e('0x32')](_0x5b4965[_0x8e3e('0x2e')],{'$or':_['map'](_0x5b4965['attributes'],function(_0x73c0af){var _0x5882c5={};_0x5882c5[_0x73c0af]={'$like':'%'+_0x22ab03[_0x8e3e('0x23')][_0x8e3e('0x33')]+'%'};return _0x5882c5;})});}_0x5b4965=_[_0x8e3e('0x32')]({},_0x5b4965,_0x22ab03[_0x8e3e('0x34')]);var _0x3f4ba6={'where':_0x5b4965[_0x8e3e('0x2e')]};return db[_0x8e3e('0x35')]['count'](_0x3f4ba6)[_0x8e3e('0x1c')](function(_0x369845){_0x1d433e['count']=_0x369845;if(_0x22ab03['query']['includeAll']){_0x5b4965[_0x8e3e('0x36')]=[{'all':!![]}];}return db[_0x8e3e('0x35')]['findAll'](_0x5b4965);})[_0x8e3e('0x1c')](function(_0x44b2c0){_0x1d433e[_0x8e3e('0x37')]=_0x44b2c0;return _0x1d433e;})[_0x8e3e('0x1c')](respondWithFilteredResult(_0x4fc3ac,_0x5b4965))[_0x8e3e('0x38')](handleError(_0x4fc3ac,null));};exports[_0x8e3e('0x39')]=function(_0x4f08a6,_0x431101){var _0x3ca340={'raw':!![],'where':{'id':_0x4f08a6[_0x8e3e('0x3a')]['id']}},_0x48c672={};_0x48c672['model']=_[_0x8e3e('0x22')](db[_0x8e3e('0x35')][_0x8e3e('0x20')]);_0x48c672[_0x8e3e('0x23')]=_['keys'](_0x4f08a6['query']);_0x48c672[_0x8e3e('0x26')]=_[_0x8e3e('0x27')](_0x48c672[_0x8e3e('0x21')],_0x48c672[_0x8e3e('0x23')]);_0x3ca340[_0x8e3e('0x29')]=_[_0x8e3e('0x27')](_0x48c672[_0x8e3e('0x21')],qs['fields'](_0x4f08a6[_0x8e3e('0x23')][_0x8e3e('0x28')]));_0x3ca340[_0x8e3e('0x29')]=_0x3ca340[_0x8e3e('0x29')]['length']?_0x3ca340[_0x8e3e('0x29')]:_0x48c672[_0x8e3e('0x21')];if(_0x4f08a6[_0x8e3e('0x23')]['includeAll']){_0x3ca340['include']=[{'all':!![]}];}_0x3ca340=_[_0x8e3e('0x32')]({},_0x3ca340,_0x4f08a6[_0x8e3e('0x34')]);return db[_0x8e3e('0x35')][_0x8e3e('0x3b')](_0x3ca340)[_0x8e3e('0x1c')](handleEntityNotFound(_0x431101,null))[_0x8e3e('0x1c')](respondWithResult(_0x431101,null))[_0x8e3e('0x38')](handleError(_0x431101,null));};exports['create']=function(_0x197c36,_0xb15994){return db[_0x8e3e('0x35')]['create'](_0x197c36['body'],{})[_0x8e3e('0x1c')](respondWithResult(_0xb15994,0xc9))[_0x8e3e('0x38')](handleError(_0xb15994,null));};exports['update']=function(_0x597561,_0x46c399){if(_0x597561[_0x8e3e('0x3c')]['id']){delete _0x597561[_0x8e3e('0x3c')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x597561[_0x8e3e('0x3a')]['id']}})[_0x8e3e('0x1c')](handleEntityNotFound(_0x46c399,null))[_0x8e3e('0x1c')](saveUpdates(_0x597561[_0x8e3e('0x3c')],null))[_0x8e3e('0x1c')](respondWithResult(_0x46c399,null))[_0x8e3e('0x38')](handleError(_0x46c399,null));};exports[_0x8e3e('0x3d')]=function(_0x8a6aca,_0x70de5a){return db['AnalyticMetric'][_0x8e3e('0x3b')]({'where':{'id':_0x8a6aca['params']['id']}})[_0x8e3e('0x1c')](handleEntityNotFound(_0x70de5a,null))['then'](removeEntity(_0x70de5a,null))['catch'](handleError(_0x70de5a,null));};
\ No newline at end of file
+var _0xf17e=['length','nolimit','order','sort','where','pick','day','merge','filter','map','options','AnalyticMetric','then','includeAll','include','findAll','rows','catch','show','params','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','fields','attributes'];(function(_0x592177,_0x6b27d7){var _0x576b87=function(_0x45a8a7){while(--_0x45a8a7){_0x592177['push'](_0x592177['shift']());}};_0x576b87(++_0x6b27d7);}(_0xf17e,0x13b));var _0xef17=function(_0x424171,_0x5e4b6f){_0x424171=_0x424171-0x0;var _0xd18ba1=_0xf17e[_0x424171];return _0xd18ba1;};'use strict';var pdf=require(_0xef17('0x0'));var emlformat=require(_0xef17('0x1'));var rimraf=require(_0xef17('0x2'));var zipdir=require(_0xef17('0x3'));var jsonpatch=require(_0xef17('0x4'));var rp=require(_0xef17('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xef17('0x6'));var util=require(_0xef17('0x7'));var path=require(_0xef17('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xef17('0x9'));var squel=require(_0xef17('0xa'));var crypto=require(_0xef17('0xb'));var jsforce=require(_0xef17('0xc'));var deskjs=require(_0xef17('0xd'));var toCsv=require(_0xef17('0xe'));var querystring=require(_0xef17('0xf'));var Papa=require(_0xef17('0x10'));var qs=require(_0xef17('0x11'));var logger=require('../../config/logger')(_0xef17('0x12'));var utils=require(_0xef17('0x13'));var config=require(_0xef17('0x14'));var db=require(_0xef17('0x15'))['db'];function respondWithStatusCode(_0x578099,_0x4fe0c9){_0x4fe0c9=_0x4fe0c9||0xcc;return function(_0x2cd062){if(_0x2cd062){return _0x578099[_0xef17('0x16')](_0x4fe0c9);}return _0x578099[_0xef17('0x17')](_0x4fe0c9)[_0xef17('0x18')]();};}function respondWithResult(_0x378076,_0x184e15){_0x184e15=_0x184e15||0xc8;return function(_0x245b70){if(_0x245b70){return _0x378076[_0xef17('0x17')](_0x184e15)['json'](_0x245b70);}};}function respondWithFilteredResult(_0x3cb5b8,_0x5eb0bd){return function(_0x3183ca){if(_0x3183ca){var _0x181343=_0x3183ca[_0xef17('0x19')],_0xfb3097=_0x5eb0bd['offset'],_0x18010b=_0x5eb0bd[_0xef17('0x1a')]+_0x5eb0bd[_0xef17('0x1b')],_0x410647;if(_0x18010b>=_0x181343){_0x18010b=_0x181343;_0x410647=0xc8;}else{_0x410647=0xce;}_0x3cb5b8[_0xef17('0x17')](_0x410647);return _0x3cb5b8[_0xef17('0x1c')](_0xef17('0x1d'),_0xfb3097+'-'+_0x18010b+'/'+_0x181343)[_0xef17('0x1e')](_0x3183ca);}return null;};}function patchUpdates(_0x4d9136){return function(_0x32cc52){try{jsonpatch[_0xef17('0x1f')](_0x32cc52,_0x4d9136,!![]);}catch(_0x35a4b3){return BPromise['reject'](_0x35a4b3);}return _0x32cc52[_0xef17('0x20')]();};}function saveUpdates(_0x14dc3f,_0x544a3d){return function(_0x3409f2){if(_0x3409f2){return _0x3409f2[_0xef17('0x21')](_0x14dc3f)['then'](function(_0x1764a0){return _0x1764a0;});}return null;};}function removeEntity(_0x110fd3,_0xd3d351){return function(_0x558a71){if(_0x558a71){return _0x558a71[_0xef17('0x22')]()['then'](function(){_0x110fd3[_0xef17('0x17')](0xcc)[_0xef17('0x18')]();});}};}function handleEntityNotFound(_0x20951e,_0x256ab8){return function(_0x239ed4){if(!_0x239ed4){_0x20951e[_0xef17('0x16')](0x194);}return _0x239ed4;};}function handleError(_0x1b5528,_0x4920e0){_0x4920e0=_0x4920e0||0x1f4;return function(_0x1a2409){logger[_0xef17('0x23')](_0x1a2409[_0xef17('0x24')]);if(_0x1a2409[_0xef17('0x25')]){delete _0x1a2409[_0xef17('0x25')];}_0x1b5528['status'](_0x4920e0)[_0xef17('0x26')](_0x1a2409);};}exports[_0xef17('0x27')]=function(_0x288934,_0x2c32a5){var _0x5bffe2={},_0x29e2d8={},_0x5cb795={'count':0x0,'rows':[]};var _0x2f7ff=db['AnalyticMetric'][_0xef17('0x28')];_0x29e2d8[_0xef17('0x29')]=_[_0xef17('0x2a')](_0x2f7ff);var _0x8db984={'dateStart':_0x288934[_0xef17('0x2b')][_0xef17('0x2c')],'dateEnd':_0x288934[_0xef17('0x2b')][_0xef17('0x2d')]};delete _0x288934['query']['dateStart'];delete _0x288934[_0xef17('0x2b')][_0xef17('0x2d')];_0x29e2d8['query']=_['keys'](_0x288934[_0xef17('0x2b')]);_0x29e2d8[_0xef17('0x2e')]=_[_0xef17('0x2f')](_0x29e2d8[_0xef17('0x29')],_0x29e2d8[_0xef17('0x2b')]);_0x5bffe2['attributes']=_[_0xef17('0x2f')](_0x29e2d8[_0xef17('0x29')],qs[_0xef17('0x30')](_0x288934[_0xef17('0x2b')][_0xef17('0x30')]));_0x5bffe2[_0xef17('0x31')]=_0x5bffe2[_0xef17('0x31')][_0xef17('0x32')]?_0x5bffe2[_0xef17('0x31')]:_0x29e2d8[_0xef17('0x29')];if(!_0x288934[_0xef17('0x2b')]['hasOwnProperty'](_0xef17('0x33'))){_0x5bffe2[_0xef17('0x1b')]=qs[_0xef17('0x1b')](_0x288934[_0xef17('0x2b')][_0xef17('0x1b')]);_0x5bffe2['offset']=qs[_0xef17('0x1a')](_0x288934[_0xef17('0x2b')]['offset']);}_0x5bffe2[_0xef17('0x34')]=qs[_0xef17('0x35')](_0x288934[_0xef17('0x2b')][_0xef17('0x35')]);_0x5bffe2[_0xef17('0x36')]=qs[_0xef17('0x2e')](_[_0xef17('0x37')](_0x288934[_0xef17('0x2b')],_0x29e2d8[_0xef17('0x2e')]));if(_0x8db984[_0xef17('0x2c')]){if(_0x8db984['dateEnd']){_0x8db984[_0xef17('0x2d')]=moment(_0x8db984[_0xef17('0x2d')])['add'](0x1,'day');}else{_0x8db984['dateEnd']=moment(_0x8db984[_0xef17('0x2c')])['add'](0x1,_0xef17('0x38'));}_[_0xef17('0x39')](_0x5bffe2[_0xef17('0x36')],{'createdAt':{'$gte':_0x8db984['dateStart'],'$lte':_0x8db984[_0xef17('0x2d')]}});}if(_0x288934['query'][_0xef17('0x3a')]){_0x5bffe2[_0xef17('0x36')]=_[_0xef17('0x39')](_0x5bffe2['where'],{'$or':_[_0xef17('0x3b')](_0x5bffe2[_0xef17('0x31')],function(_0x3206a0){var _0x57c660={};_0x57c660[_0x3206a0]={'$like':'%'+_0x288934[_0xef17('0x2b')][_0xef17('0x3a')]+'%'};return _0x57c660;})});}_0x5bffe2=_[_0xef17('0x39')]({},_0x5bffe2,_0x288934[_0xef17('0x3c')]);var _0x534279={'where':_0x5bffe2[_0xef17('0x36')]};return db[_0xef17('0x3d')][_0xef17('0x19')](_0x534279)[_0xef17('0x3e')](function(_0x4352d5){_0x5cb795[_0xef17('0x19')]=_0x4352d5;if(_0x288934[_0xef17('0x2b')][_0xef17('0x3f')]){_0x5bffe2[_0xef17('0x40')]=[{'all':!![]}];}return db[_0xef17('0x3d')][_0xef17('0x41')](_0x5bffe2);})['then'](function(_0x14f017){_0x5cb795[_0xef17('0x42')]=_0x14f017;return _0x5cb795;})['then'](respondWithFilteredResult(_0x2c32a5,_0x5bffe2))[_0xef17('0x43')](handleError(_0x2c32a5,null));};exports[_0xef17('0x44')]=function(_0xbbea44,_0x598231){var _0x3bd839={'raw':!![],'where':{'id':_0xbbea44[_0xef17('0x45')]['id']}},_0x5be0c7={};_0x5be0c7[_0xef17('0x29')]=_[_0xef17('0x2a')](db[_0xef17('0x3d')][_0xef17('0x28')]);_0x5be0c7['query']=_[_0xef17('0x2a')](_0xbbea44[_0xef17('0x2b')]);_0x5be0c7[_0xef17('0x2e')]=_[_0xef17('0x2f')](_0x5be0c7['model'],_0x5be0c7[_0xef17('0x2b')]);_0x3bd839[_0xef17('0x31')]=_['intersection'](_0x5be0c7[_0xef17('0x29')],qs[_0xef17('0x30')](_0xbbea44[_0xef17('0x2b')][_0xef17('0x30')]));_0x3bd839[_0xef17('0x31')]=_0x3bd839['attributes']['length']?_0x3bd839[_0xef17('0x31')]:_0x5be0c7['model'];if(_0xbbea44['query']['includeAll']){_0x3bd839['include']=[{'all':!![]}];}_0x3bd839=_[_0xef17('0x39')]({},_0x3bd839,_0xbbea44['options']);return db[_0xef17('0x3d')]['find'](_0x3bd839)[_0xef17('0x3e')](handleEntityNotFound(_0x598231,null))[_0xef17('0x3e')](respondWithResult(_0x598231,null))['catch'](handleError(_0x598231,null));};exports['create']=function(_0x3c9a09,_0x5a02e1){return db['AnalyticMetric'][_0xef17('0x46')](_0x3c9a09[_0xef17('0x47')],{})['then'](respondWithResult(_0x5a02e1,0xc9))[_0xef17('0x43')](handleError(_0x5a02e1,null));};exports[_0xef17('0x21')]=function(_0x56c47b,_0x183425){if(_0x56c47b['body']['id']){delete _0x56c47b[_0xef17('0x47')]['id'];}return db['AnalyticMetric'][_0xef17('0x48')]({'where':{'id':_0x56c47b['params']['id']}})[_0xef17('0x3e')](handleEntityNotFound(_0x183425,null))[_0xef17('0x3e')](saveUpdates(_0x56c47b[_0xef17('0x47')],null))[_0xef17('0x3e')](respondWithResult(_0x183425,null))[_0xef17('0x43')](handleError(_0x183425,null));};exports[_0xef17('0x22')]=function(_0x377fcd,_0x466c95){return db[_0xef17('0x3d')][_0xef17('0x48')]({'where':{'id':_0x377fcd[_0xef17('0x45')]['id']}})[_0xef17('0x3e')](handleEntityNotFound(_0x466c95,null))[_0xef17('0x3e')](removeEntity(_0x466c95,null))[_0xef17('0x43')](handleError(_0x466c95,null));};
\ No newline at end of file
index 2ea2eb0..8abb2c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8d5=['lodash','../../config/logger','api','moment','bluebird','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xf8d5,0x19a));var _0x5f8d=function(_0x5c090d,_0x6186ef){_0x5c090d=_0x5c090d-0x0;var _0x4084ef=_0xf8d5[_0x5c090d];return _0x4084ef;};'use strict';var _=require(_0x5f8d('0x0'));var util=require('util');var logger=require(_0x5f8d('0x1'))(_0x5f8d('0x2'));var moment=require(_0x5f8d('0x3'));var BPromise=require(_0x5f8d('0x4'));var rp=require('request-promise');var attributes=require(_0x5f8d('0x5'));module[_0x5f8d('0x6')]=function(_0x172609,_0x13191d){return _0x172609[_0x5f8d('0x7')](_0x5f8d('0x8'),attributes,{'tableName':_0x5f8d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbfe1=['../../config/logger','api','moment','bluebird','request-promise','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbfe1,0xf1));var _0x1bfe=function(_0x5471e1,_0x16b183){_0x5471e1=_0x5471e1-0x0;var _0x1fbdef=_0xbfe1[_0x5471e1];return _0x1fbdef;};'use strict';var _=require('lodash');var util=require(_0x1bfe('0x0'));var logger=require(_0x1bfe('0x1'))(_0x1bfe('0x2'));var moment=require(_0x1bfe('0x3'));var BPromise=require(_0x1bfe('0x4'));var rp=require(_0x1bfe('0x5'));var attributes=require(_0x1bfe('0x6'));module[_0x1bfe('0x7')]=function(_0x34b0b3,_0x44228d){return _0x34b0b3[_0x1bfe('0x8')](_0x1bfe('0x9'),attributes,{'tableName':_0x1bfe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fa4425d..b6d1161 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['error','message','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x250514,_0x389eda){var _0x59c25b=function(_0x3ad38b){while(--_0x3ad38b){_0x250514['push'](_0x250514['shift']());}};_0x59c25b(++_0x389eda);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 db=require(_0x0a9e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a9e('0x4'))(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var jayson=require(_0x0a9e('0x7'));var client=jayson[_0x0a9e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x219af0,_0x441e3a,_0x2cc193){return new BPromise(function(_0x5f41ea,_0x503809){return client[_0x0a9e('0x9')](_0x219af0,_0x2cc193)['then'](function(_0x52cace){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x441e3a,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x441e3a,_0x0a9e('0xc'),JSON['stringify'](_0x52cace));if(_0x52cace['error']){if(_0x52cace['error']['code']===0x1f4){logger[_0x0a9e('0xf')](_0x0a9e('0xb'),_0x441e3a,_0x52cace[_0x0a9e('0xf')][_0x0a9e('0x10')]);return _0x503809(_0x52cace[_0x0a9e('0xf')][_0x0a9e('0x10')]);}logger['error'](_0x0a9e('0xb'),_0x441e3a,_0x52cace[_0x0a9e('0xf')][_0x0a9e('0x10')]);return _0x5f41ea(_0x52cace[_0x0a9e('0xf')][_0x0a9e('0x10')]);}else{logger[_0x0a9e('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x441e3a,_0x0a9e('0xc'));_0x5f41ea(_0x52cace['result'][_0x0a9e('0x10')]);}})['catch'](function(_0x16033c){logger[_0x0a9e('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x441e3a,_0x16033c);_0x503809(_0x16033c);});});}
\ No newline at end of file
+var _0x9957=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x7995('0x4'))['db'];var utils=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var config=require('../../config/environment');var jayson=require(_0x7995('0x8'));var client=jayson[_0x7995('0x9')][_0x7995('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x219534,_0xbda126,_0x326741){return new BPromise(function(_0x4996ca,_0x465276){return client[_0x7995('0xb')](_0x219534,_0x326741)['then'](function(_0xa2e5f0){logger[_0x7995('0xc')](_0x7995('0xd'),_0xbda126,_0x7995('0xe'));logger[_0x7995('0xf')](_0x7995('0x10'),_0xbda126,_0x7995('0xe'),JSON['stringify'](_0xa2e5f0));if(_0xa2e5f0[_0x7995('0x11')]){if(_0xa2e5f0[_0x7995('0x11')]['code']===0x1f4){logger[_0x7995('0x11')](_0x7995('0xd'),_0xbda126,_0xa2e5f0[_0x7995('0x11')][_0x7995('0x12')]);return _0x465276(_0xa2e5f0[_0x7995('0x11')][_0x7995('0x12')]);}logger[_0x7995('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0xbda126,_0xa2e5f0['error'][_0x7995('0x12')]);return _0x4996ca(_0xa2e5f0[_0x7995('0x11')][_0x7995('0x12')]);}else{logger[_0x7995('0xc')](_0x7995('0xd'),_0xbda126,_0x7995('0xe'));_0x4996ca(_0xa2e5f0[_0x7995('0x13')][_0x7995('0x12')]);}})['catch'](function(_0x2eeacc){logger['error'](_0x7995('0xd'),_0xbda126,_0x2eeacc);_0x465276(_0x2eeacc);});});}
\ No newline at end of file
index 1d37723..99f7d76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ac2=['show','post','create','put','/:id','update','delete','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ac2,0x14a));var _0x29ac=function(_0x525513,_0x44220c){_0x525513=_0x525513-0x0;var _0x17f77f=_0x9ac2[_0x525513];return _0x17f77f;};'use strict';var multer=require(_0x29ac('0x0'));var util=require(_0x29ac('0x1'));var path=require(_0x29ac('0x2'));var express=require(_0x29ac('0x3'));var router=express[_0x29ac('0x4')]();var auth=require(_0x29ac('0x5'));var interaction=require(_0x29ac('0x6'));var config=require(_0x29ac('0x7'));var controller=require(_0x29ac('0x8'));router[_0x29ac('0x9')]('/',auth['isAuthenticated'](),controller[_0x29ac('0xa')]);router['get']('/:id',auth[_0x29ac('0xb')](),controller[_0x29ac('0xc')]);router[_0x29ac('0xd')]('/',auth[_0x29ac('0xb')](),controller[_0x29ac('0xe')]);router[_0x29ac('0xf')](_0x29ac('0x10'),auth['isAuthenticated'](),controller[_0x29ac('0x11')]);router[_0x29ac('0x12')](_0x29ac('0x10'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xaf9b=['index','create','/:id','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x490ae5,_0x50bacd){var _0x31f132=function(_0x4024ec){while(--_0x4024ec){_0x490ae5['push'](_0x490ae5['shift']());}};_0x31f132(++_0x50bacd);}(_0xaf9b,0x132));var _0xbaf9=function(_0x3653ca,_0x8643fa){_0x3653ca=_0x3653ca-0x0;var _0x283a49=_0xaf9b[_0x3653ca];return _0x283a49;};'use strict';var multer=require(_0xbaf9('0x0'));var util=require(_0xbaf9('0x1'));var path=require(_0xbaf9('0x2'));var express=require('express');var router=express[_0xbaf9('0x3')]();var auth=require(_0xbaf9('0x4'));var interaction=require(_0xbaf9('0x5'));var config=require(_0xbaf9('0x6'));var controller=require('./analyticMetric.controller');router[_0xbaf9('0x7')]('/',auth[_0xbaf9('0x8')](),controller[_0xbaf9('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbaf9('0xa')]);router['put'](_0xbaf9('0xb'),auth[_0xbaf9('0x8')](),controller['update']);router[_0xbaf9('0xc')](_0xbaf9('0xb'),auth[_0xbaf9('0x8')](),controller[_0xbaf9('0xd')]);module[_0xbaf9('0xe')]=router;
\ No newline at end of file
index 3303b50..0e7059c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc93b=['exports','TEXT'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc93b,0x1c4));var _0xbc93=function(_0x33d427,_0x47c8c2){_0x33d427=_0x33d427-0x0;var _0x383dbd=_0xc93b[_0x33d427];return _0x383dbd;};'use strict';var Sequelize=require('sequelize');module[_0xbc93('0x0')]={'tree':{'type':Sequelize[_0xbc93('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x632c=['TEXT','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x632c,0x1f3));var _0xc632=function(_0x2f1907,_0x392dac){_0x2f1907=_0x2f1907-0x0;var _0x142c77=_0x632c[_0x2f1907];return _0x142c77;};'use strict';var Sequelize=require(_0xc632('0x0'));module[_0xc632('0x1')]={'tree':{'type':Sequelize[_0xc632('0x2')],'allowNull':![]}};
\ No newline at end of file
index b03744c..91d922a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f2e=['error','name','send','AnalyticTreeReport','rawAttributes','model','dateStart','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','dateEnd','add','day','merge','map','count','includeAll','include','findAll','catch','show','params','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../mysqldb','sendStatus','json','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','end'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x6f2e,0x64));var _0xe6f2=function(_0x318730,_0x1780ce){_0x318730=_0x318730-0x0;var _0x2dd493=_0x6f2e[_0x318730];return _0x2dd493;};'use strict';var pdf=require(_0xe6f2('0x0'));var emlformat=require(_0xe6f2('0x1'));var rimraf=require(_0xe6f2('0x2'));var zipdir=require(_0xe6f2('0x3'));var jsonpatch=require(_0xe6f2('0x4'));var rp=require(_0xe6f2('0x5'));var moment=require(_0xe6f2('0x6'));var BPromise=require(_0xe6f2('0x7'));var Mustache=require(_0xe6f2('0x8'));var util=require(_0xe6f2('0x9'));var path=require('path');var sox=require(_0xe6f2('0xa'));var csv=require('to-csv');var ejs=require(_0xe6f2('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe6f2('0xc'));var crypto=require(_0xe6f2('0xd'));var jsforce=require(_0xe6f2('0xe'));var deskjs=require(_0xe6f2('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe6f2('0x10'));var Papa=require(_0xe6f2('0x11'));var qs=require(_0xe6f2('0x12'));var logger=require(_0xe6f2('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe6f2('0x14'))['db'];function respondWithStatusCode(_0x2e7dae,_0x2b3e47){_0x2b3e47=_0x2b3e47||0xcc;return function(_0x246d14){if(_0x246d14){return _0x2e7dae[_0xe6f2('0x15')](_0x2b3e47);}return _0x2e7dae['status'](_0x2b3e47)['end']();};}function respondWithResult(_0x2ab460,_0x424619){_0x424619=_0x424619||0xc8;return function(_0x2b0356){if(_0x2b0356){return _0x2ab460['status'](_0x424619)[_0xe6f2('0x16')](_0x2b0356);}};}function respondWithFilteredResult(_0x3a7786,_0xce6e98){return function(_0x59798b){if(_0x59798b){var _0x2f2d20=_0x59798b['count'],_0x52d4db=_0xce6e98[_0xe6f2('0x17')],_0x7f2496=_0xce6e98['offset']+_0xce6e98[_0xe6f2('0x18')],_0x27cab8;if(_0x7f2496>=_0x2f2d20){_0x7f2496=_0x2f2d20;_0x27cab8=0xc8;}else{_0x27cab8=0xce;}_0x3a7786[_0xe6f2('0x19')](_0x27cab8);return _0x3a7786[_0xe6f2('0x1a')](_0xe6f2('0x1b'),_0x52d4db+'-'+_0x7f2496+'/'+_0x2f2d20)[_0xe6f2('0x16')](_0x59798b);}return null;};}function patchUpdates(_0x2750e3){return function(_0x426908){try{jsonpatch[_0xe6f2('0x1c')](_0x426908,_0x2750e3,!![]);}catch(_0x2090bb){return BPromise[_0xe6f2('0x1d')](_0x2090bb);}return _0x426908[_0xe6f2('0x1e')]();};}function saveUpdates(_0x682c8d,_0x17a8ac){return function(_0x573402){if(_0x573402){return _0x573402['update'](_0x682c8d)[_0xe6f2('0x1f')](function(_0x324540){return _0x324540;});}return null;};}function removeEntity(_0x55ba06,_0x308a55){return function(_0x16db3b){if(_0x16db3b){return _0x16db3b[_0xe6f2('0x20')]()[_0xe6f2('0x1f')](function(){_0x55ba06[_0xe6f2('0x19')](0xcc)[_0xe6f2('0x21')]();});}};}function handleEntityNotFound(_0x33dbcc,_0x2c8aa4){return function(_0x153fb9){if(!_0x153fb9){_0x33dbcc['sendStatus'](0x194);}return _0x153fb9;};}function handleError(_0x2c8673,_0x12714b){_0x12714b=_0x12714b||0x1f4;return function(_0x3f5a52){logger[_0xe6f2('0x22')](_0x3f5a52['stack']);if(_0x3f5a52[_0xe6f2('0x23')]){delete _0x3f5a52[_0xe6f2('0x23')];}_0x2c8673['status'](_0x12714b)[_0xe6f2('0x24')](_0x3f5a52);};}exports['index']=function(_0x26562d,_0x4d3caa){var _0x4ba40e={},_0x3bf4ed={},_0x316055={'count':0x0,'rows':[]};var _0xf0cc83=db[_0xe6f2('0x25')][_0xe6f2('0x26')];_0x3bf4ed[_0xe6f2('0x27')]=_['keys'](_0xf0cc83);var _0x1df97b={'dateStart':_0x26562d['query'][_0xe6f2('0x28')],'dateEnd':_0x26562d[_0xe6f2('0x29')]['dateEnd']};delete _0x26562d[_0xe6f2('0x29')][_0xe6f2('0x28')];delete _0x26562d[_0xe6f2('0x29')]['dateEnd'];_0x3bf4ed['query']=_[_0xe6f2('0x2a')](_0x26562d[_0xe6f2('0x29')]);_0x3bf4ed[_0xe6f2('0x2b')]=_[_0xe6f2('0x2c')](_0x3bf4ed[_0xe6f2('0x27')],_0x3bf4ed[_0xe6f2('0x29')]);_0x4ba40e['attributes']=_['intersection'](_0x3bf4ed[_0xe6f2('0x27')],qs[_0xe6f2('0x2d')](_0x26562d[_0xe6f2('0x29')][_0xe6f2('0x2d')]));_0x4ba40e[_0xe6f2('0x2e')]=_0x4ba40e[_0xe6f2('0x2e')][_0xe6f2('0x2f')]?_0x4ba40e[_0xe6f2('0x2e')]:_0x3bf4ed['model'];if(!_0x26562d[_0xe6f2('0x29')][_0xe6f2('0x30')](_0xe6f2('0x31'))){_0x4ba40e[_0xe6f2('0x18')]=qs['limit'](_0x26562d[_0xe6f2('0x29')]['limit']);_0x4ba40e[_0xe6f2('0x17')]=qs[_0xe6f2('0x17')](_0x26562d['query']['offset']);}_0x4ba40e['order']=qs['sort'](_0x26562d[_0xe6f2('0x29')][_0xe6f2('0x32')]);_0x4ba40e[_0xe6f2('0x33')]=qs[_0xe6f2('0x2b')](_['pick'](_0x26562d[_0xe6f2('0x29')],_0x3bf4ed['filters']));if(_0x1df97b[_0xe6f2('0x28')]){if(_0x1df97b[_0xe6f2('0x34')]){_0x1df97b['dateEnd']=moment(_0x1df97b[_0xe6f2('0x34')])[_0xe6f2('0x35')](0x1,_0xe6f2('0x36'));}else{_0x1df97b[_0xe6f2('0x34')]=moment(_0x1df97b[_0xe6f2('0x28')])['add'](0x1,'day');}_[_0xe6f2('0x37')](_0x4ba40e[_0xe6f2('0x33')],{'createdAt':{'$gte':_0x1df97b[_0xe6f2('0x28')],'$lte':_0x1df97b[_0xe6f2('0x34')]}});}if(_0x26562d[_0xe6f2('0x29')]['filter']){_0x4ba40e[_0xe6f2('0x33')]=_[_0xe6f2('0x37')](_0x4ba40e[_0xe6f2('0x33')],{'$or':_[_0xe6f2('0x38')](_0x4ba40e['attributes'],function(_0x5cb11a){var _0x4cb058={};_0x4cb058[_0x5cb11a]={'$like':'%'+_0x26562d[_0xe6f2('0x29')]['filter']+'%'};return _0x4cb058;})});}_0x4ba40e=_[_0xe6f2('0x37')]({},_0x4ba40e,_0x26562d['options']);var _0x146be6={'where':_0x4ba40e['where']};return db[_0xe6f2('0x25')][_0xe6f2('0x39')](_0x146be6)['then'](function(_0x507a4a){_0x316055[_0xe6f2('0x39')]=_0x507a4a;if(_0x26562d[_0xe6f2('0x29')][_0xe6f2('0x3a')]){_0x4ba40e[_0xe6f2('0x3b')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xe6f2('0x3c')](_0x4ba40e);})[_0xe6f2('0x1f')](function(_0x234b55){_0x316055['rows']=_0x234b55;return _0x316055;})[_0xe6f2('0x1f')](respondWithFilteredResult(_0x4d3caa,_0x4ba40e))[_0xe6f2('0x3d')](handleError(_0x4d3caa,null));};exports[_0xe6f2('0x3e')]=function(_0x401af6,_0x4c07a7){var _0x539944={'raw':!![],'where':{'id':_0x401af6[_0xe6f2('0x3f')]['id']}},_0x228f53={};_0x228f53[_0xe6f2('0x27')]=_[_0xe6f2('0x2a')](db['AnalyticTreeReport'][_0xe6f2('0x26')]);_0x228f53[_0xe6f2('0x29')]=_[_0xe6f2('0x2a')](_0x401af6[_0xe6f2('0x29')]);_0x228f53[_0xe6f2('0x2b')]=_[_0xe6f2('0x2c')](_0x228f53[_0xe6f2('0x27')],_0x228f53[_0xe6f2('0x29')]);_0x539944[_0xe6f2('0x2e')]=_[_0xe6f2('0x2c')](_0x228f53[_0xe6f2('0x27')],qs[_0xe6f2('0x2d')](_0x401af6['query']['fields']));_0x539944[_0xe6f2('0x2e')]=_0x539944[_0xe6f2('0x2e')]['length']?_0x539944[_0xe6f2('0x2e')]:_0x228f53[_0xe6f2('0x27')];if(_0x401af6[_0xe6f2('0x29')][_0xe6f2('0x3a')]){_0x539944['include']=[{'all':!![]}];}_0x539944=_['merge']({},_0x539944,_0x401af6['options']);return db[_0xe6f2('0x25')][_0xe6f2('0x40')](_0x539944)[_0xe6f2('0x1f')](handleEntityNotFound(_0x4c07a7,null))[_0xe6f2('0x1f')](respondWithResult(_0x4c07a7,null))[_0xe6f2('0x3d')](handleError(_0x4c07a7,null));};exports[_0xe6f2('0x41')]=function(_0x5d7667,_0x533522){return db[_0xe6f2('0x25')][_0xe6f2('0x41')](_0x5d7667[_0xe6f2('0x42')],{})[_0xe6f2('0x1f')](respondWithResult(_0x533522,0xc9))[_0xe6f2('0x3d')](handleError(_0x533522,null));};exports['update']=function(_0x3ed7fb,_0x2b4908){if(_0x3ed7fb['body']['id']){delete _0x3ed7fb[_0xe6f2('0x42')]['id'];}return db['AnalyticTreeReport'][_0xe6f2('0x40')]({'where':{'id':_0x3ed7fb[_0xe6f2('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2b4908,null))[_0xe6f2('0x1f')](saveUpdates(_0x3ed7fb[_0xe6f2('0x42')],null))['then'](respondWithResult(_0x2b4908,null))[_0xe6f2('0x3d')](handleError(_0x2b4908,null));};exports[_0xe6f2('0x20')]=function(_0x3f6fa5,_0x16c76c){return db[_0xe6f2('0x25')][_0xe6f2('0x40')]({'where':{'id':_0x3f6fa5[_0xe6f2('0x3f')]['id']}})[_0xe6f2('0x1f')](handleEntityNotFound(_0x16c76c,null))[_0xe6f2('0x1f')](removeEntity(_0x16c76c,null))[_0xe6f2('0x3d')](handleError(_0x16c76c,null));};
\ No newline at end of file
+var _0xc601=['update','then','destroy','sendStatus','error','name','send','index','AnalyticTreeReport','rawAttributes','model','keys','query','dateEnd','dateStart','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','day','add','merge','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','count','offset','limit','set','Content-Range','json','apply','reject'];(function(_0x5522f6,_0x45ea95){var _0x52d85f=function(_0x3a2eb3){while(--_0x3a2eb3){_0x5522f6['push'](_0x5522f6['shift']());}};_0x52d85f(++_0x45ea95);}(_0xc601,0xfb));var _0x1c60=function(_0x2e6d94,_0x12fcbe){_0x2e6d94=_0x2e6d94-0x0;var _0x59d60f=_0xc601[_0x2e6d94];return _0x59d60f;};'use strict';var pdf=require(_0x1c60('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1c60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c60('0x2'));var rp=require(_0x1c60('0x3'));var moment=require(_0x1c60('0x4'));var BPromise=require(_0x1c60('0x5'));var Mustache=require(_0x1c60('0x6'));var util=require(_0x1c60('0x7'));var path=require(_0x1c60('0x8'));var sox=require(_0x1c60('0x9'));var csv=require('to-csv');var ejs=require(_0x1c60('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1c60('0xb'));var crypto=require(_0x1c60('0xc'));var jsforce=require(_0x1c60('0xd'));var deskjs=require(_0x1c60('0xe'));var toCsv=require(_0x1c60('0xf'));var querystring=require(_0x1c60('0x10'));var Papa=require(_0x1c60('0x11'));var qs=require(_0x1c60('0x12'));var logger=require(_0x1c60('0x13'))(_0x1c60('0x14'));var utils=require(_0x1c60('0x15'));var config=require(_0x1c60('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2dfeca,_0x24b6d8){_0x24b6d8=_0x24b6d8||0xcc;return function(_0x47a9e3){if(_0x47a9e3){return _0x2dfeca['sendStatus'](_0x24b6d8);}return _0x2dfeca[_0x1c60('0x17')](_0x24b6d8)[_0x1c60('0x18')]();};}function respondWithResult(_0x83fca7,_0x35223d){_0x35223d=_0x35223d||0xc8;return function(_0xa5f4b8){if(_0xa5f4b8){return _0x83fca7[_0x1c60('0x17')](_0x35223d)['json'](_0xa5f4b8);}};}function respondWithFilteredResult(_0x55e4b7,_0x22803e){return function(_0x55cc88){if(_0x55cc88){var _0x5a79e2=_0x55cc88[_0x1c60('0x19')],_0x5548e1=_0x22803e[_0x1c60('0x1a')],_0x5e544c=_0x22803e[_0x1c60('0x1a')]+_0x22803e[_0x1c60('0x1b')],_0x2834fe;if(_0x5e544c>=_0x5a79e2){_0x5e544c=_0x5a79e2;_0x2834fe=0xc8;}else{_0x2834fe=0xce;}_0x55e4b7['status'](_0x2834fe);return _0x55e4b7[_0x1c60('0x1c')](_0x1c60('0x1d'),_0x5548e1+'-'+_0x5e544c+'/'+_0x5a79e2)[_0x1c60('0x1e')](_0x55cc88);}return null;};}function patchUpdates(_0x3bdb00){return function(_0x253148){try{jsonpatch[_0x1c60('0x1f')](_0x253148,_0x3bdb00,!![]);}catch(_0x554bb6){return BPromise[_0x1c60('0x20')](_0x554bb6);}return _0x253148['save']();};}function saveUpdates(_0x3d99c9,_0x5d8a65){return function(_0x1046df){if(_0x1046df){return _0x1046df[_0x1c60('0x21')](_0x3d99c9)[_0x1c60('0x22')](function(_0x16580f){return _0x16580f;});}return null;};}function removeEntity(_0x631100,_0x4a89ab){return function(_0x13b4dd){if(_0x13b4dd){return _0x13b4dd[_0x1c60('0x23')]()[_0x1c60('0x22')](function(){_0x631100[_0x1c60('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b3167,_0x135db0){return function(_0x2eabbb){if(!_0x2eabbb){_0x3b3167[_0x1c60('0x24')](0x194);}return _0x2eabbb;};}function handleError(_0x3274a9,_0x584d4b){_0x584d4b=_0x584d4b||0x1f4;return function(_0x17d2b9){logger[_0x1c60('0x25')](_0x17d2b9['stack']);if(_0x17d2b9[_0x1c60('0x26')]){delete _0x17d2b9[_0x1c60('0x26')];}_0x3274a9[_0x1c60('0x17')](_0x584d4b)[_0x1c60('0x27')](_0x17d2b9);};}exports[_0x1c60('0x28')]=function(_0x260a4a,_0xe41907){var _0x260ed9={},_0x1a6757={},_0x56fe74={'count':0x0,'rows':[]};var _0xb848e1=db[_0x1c60('0x29')][_0x1c60('0x2a')];_0x1a6757[_0x1c60('0x2b')]=_[_0x1c60('0x2c')](_0xb848e1);var _0x2a799e={'dateStart':_0x260a4a[_0x1c60('0x2d')]['dateStart'],'dateEnd':_0x260a4a[_0x1c60('0x2d')][_0x1c60('0x2e')]};delete _0x260a4a[_0x1c60('0x2d')][_0x1c60('0x2f')];delete _0x260a4a[_0x1c60('0x2d')][_0x1c60('0x2e')];_0x1a6757[_0x1c60('0x2d')]=_[_0x1c60('0x2c')](_0x260a4a[_0x1c60('0x2d')]);_0x1a6757[_0x1c60('0x30')]=_[_0x1c60('0x31')](_0x1a6757[_0x1c60('0x2b')],_0x1a6757[_0x1c60('0x2d')]);_0x260ed9[_0x1c60('0x32')]=_[_0x1c60('0x31')](_0x1a6757[_0x1c60('0x2b')],qs[_0x1c60('0x33')](_0x260a4a['query'][_0x1c60('0x33')]));_0x260ed9[_0x1c60('0x32')]=_0x260ed9[_0x1c60('0x32')]['length']?_0x260ed9[_0x1c60('0x32')]:_0x1a6757[_0x1c60('0x2b')];if(!_0x260a4a[_0x1c60('0x2d')][_0x1c60('0x34')](_0x1c60('0x35'))){_0x260ed9[_0x1c60('0x1b')]=qs[_0x1c60('0x1b')](_0x260a4a['query'][_0x1c60('0x1b')]);_0x260ed9[_0x1c60('0x1a')]=qs[_0x1c60('0x1a')](_0x260a4a[_0x1c60('0x2d')]['offset']);}_0x260ed9[_0x1c60('0x36')]=qs['sort'](_0x260a4a[_0x1c60('0x2d')][_0x1c60('0x37')]);_0x260ed9[_0x1c60('0x38')]=qs[_0x1c60('0x30')](_['pick'](_0x260a4a[_0x1c60('0x2d')],_0x1a6757[_0x1c60('0x30')]));if(_0x2a799e['dateStart']){if(_0x2a799e[_0x1c60('0x2e')]){_0x2a799e[_0x1c60('0x2e')]=moment(_0x2a799e[_0x1c60('0x2e')])['add'](0x1,_0x1c60('0x39'));}else{_0x2a799e[_0x1c60('0x2e')]=moment(_0x2a799e[_0x1c60('0x2f')])[_0x1c60('0x3a')](0x1,_0x1c60('0x39'));}_[_0x1c60('0x3b')](_0x260ed9[_0x1c60('0x38')],{'createdAt':{'$gte':_0x2a799e['dateStart'],'$lte':_0x2a799e[_0x1c60('0x2e')]}});}if(_0x260a4a[_0x1c60('0x2d')][_0x1c60('0x3c')]){_0x260ed9[_0x1c60('0x38')]=_[_0x1c60('0x3b')](_0x260ed9[_0x1c60('0x38')],{'$or':_['map'](_0x260ed9[_0x1c60('0x32')],function(_0x37fd98){var _0x4c4d00={};_0x4c4d00[_0x37fd98]={'$like':'%'+_0x260a4a[_0x1c60('0x2d')][_0x1c60('0x3c')]+'%'};return _0x4c4d00;})});}_0x260ed9=_['merge']({},_0x260ed9,_0x260a4a[_0x1c60('0x3d')]);var _0x27aafa={'where':_0x260ed9[_0x1c60('0x38')]};return db[_0x1c60('0x29')][_0x1c60('0x19')](_0x27aafa)['then'](function(_0x3d72f2){_0x56fe74['count']=_0x3d72f2;if(_0x260a4a[_0x1c60('0x2d')][_0x1c60('0x3e')]){_0x260ed9[_0x1c60('0x3f')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x1c60('0x40')](_0x260ed9);})['then'](function(_0x72fb19){_0x56fe74[_0x1c60('0x41')]=_0x72fb19;return _0x56fe74;})[_0x1c60('0x22')](respondWithFilteredResult(_0xe41907,_0x260ed9))[_0x1c60('0x42')](handleError(_0xe41907,null));};exports['show']=function(_0x32abf1,_0x273189){var _0x5043cd={'raw':!![],'where':{'id':_0x32abf1[_0x1c60('0x43')]['id']}},_0x2cbb70={};_0x2cbb70[_0x1c60('0x2b')]=_['keys'](db['AnalyticTreeReport']['rawAttributes']);_0x2cbb70[_0x1c60('0x2d')]=_[_0x1c60('0x2c')](_0x32abf1[_0x1c60('0x2d')]);_0x2cbb70[_0x1c60('0x30')]=_[_0x1c60('0x31')](_0x2cbb70['model'],_0x2cbb70[_0x1c60('0x2d')]);_0x5043cd[_0x1c60('0x32')]=_[_0x1c60('0x31')](_0x2cbb70[_0x1c60('0x2b')],qs[_0x1c60('0x33')](_0x32abf1[_0x1c60('0x2d')][_0x1c60('0x33')]));_0x5043cd['attributes']=_0x5043cd[_0x1c60('0x32')]['length']?_0x5043cd[_0x1c60('0x32')]:_0x2cbb70[_0x1c60('0x2b')];if(_0x32abf1[_0x1c60('0x2d')][_0x1c60('0x3e')]){_0x5043cd[_0x1c60('0x3f')]=[{'all':!![]}];}_0x5043cd=_['merge']({},_0x5043cd,_0x32abf1[_0x1c60('0x3d')]);return db[_0x1c60('0x29')][_0x1c60('0x44')](_0x5043cd)[_0x1c60('0x22')](handleEntityNotFound(_0x273189,null))[_0x1c60('0x22')](respondWithResult(_0x273189,null))['catch'](handleError(_0x273189,null));};exports[_0x1c60('0x45')]=function(_0x5a65ab,_0x3a07c2){return db['AnalyticTreeReport'][_0x1c60('0x45')](_0x5a65ab['body'],{})['then'](respondWithResult(_0x3a07c2,0xc9))[_0x1c60('0x42')](handleError(_0x3a07c2,null));};exports[_0x1c60('0x21')]=function(_0x4efdca,_0x48c6d0){if(_0x4efdca[_0x1c60('0x46')]['id']){delete _0x4efdca[_0x1c60('0x46')]['id'];}return db[_0x1c60('0x29')]['find']({'where':{'id':_0x4efdca[_0x1c60('0x43')]['id']}})['then'](handleEntityNotFound(_0x48c6d0,null))[_0x1c60('0x22')](saveUpdates(_0x4efdca['body'],null))[_0x1c60('0x22')](respondWithResult(_0x48c6d0,null))[_0x1c60('0x42')](handleError(_0x48c6d0,null));};exports[_0x1c60('0x23')]=function(_0x277768,_0x2a52e7){return db[_0x1c60('0x29')][_0x1c60('0x44')]({'where':{'id':_0x277768[_0x1c60('0x43')]['id']}})[_0x1c60('0x22')](handleEntityNotFound(_0x2a52e7,null))[_0x1c60('0x22')](removeEntity(_0x2a52e7,null))[_0x1c60('0x42')](handleError(_0x2a52e7,null));};
\ No newline at end of file
index dc372a8..f364963 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f45=['api','moment','bluebird','./analyticTreeReport.attributes','exports','define','analytics_report_trees','../../config/logger'];(function(_0x11c30d,_0x566175){var _0x43c1b3=function(_0x29941d){while(--_0x29941d){_0x11c30d['push'](_0x11c30d['shift']());}};_0x43c1b3(++_0x566175);}(_0x5f45,0x137));var _0x55f4=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x5f45[_0x599e60];return _0x468e19;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x55f4('0x0'))(_0x55f4('0x1'));var moment=require(_0x55f4('0x2'));var BPromise=require(_0x55f4('0x3'));var rp=require('request-promise');var attributes=require(_0x55f4('0x4'));module[_0x55f4('0x5')]=function(_0x58c93c,_0x965b63){return _0x58c93c[_0x55f4('0x6')]('AnalyticTreeReport',attributes,{'tableName':_0x55f4('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3c6=['./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','bluebird'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0xf3c6,0xbc));var _0x6f3c=function(_0x26eb3d,_0x2cfde2){_0x26eb3d=_0x26eb3d-0x0;var _0x4bd0c1=_0xf3c6[_0x26eb3d];return _0x4bd0c1;};'use strict';var _=require(_0x6f3c('0x0'));var util=require('util');var logger=require(_0x6f3c('0x1'))(_0x6f3c('0x2'));var moment=require('moment');var BPromise=require(_0x6f3c('0x3'));var rp=require('request-promise');var attributes=require(_0x6f3c('0x4'));module['exports']=function(_0x261e64,_0x203290){return _0x261e64[_0x6f3c('0x5')](_0x6f3c('0x6'),attributes,{'tableName':_0x6f3c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3413a6f..7d39e55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dd2=['stringify','error','AnalyticTreeReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s'];(function(_0x32cf96,_0x7502d5){var _0x125cc1=function(_0x376987){while(--_0x376987){_0x32cf96['push'](_0x32cf96['shift']());}};_0x125cc1(++_0x7502d5);}(_0x7dd2,0x19e));var _0x27dd=function(_0x1f57b4,_0x1a2ce9){_0x1f57b4=_0x1f57b4-0x0;var _0x678b4b=_0x7dd2[_0x1f57b4];return _0x678b4b;};'use strict';var _=require('lodash');var util=require(_0x27dd('0x0'));var moment=require(_0x27dd('0x1'));var BPromise=require(_0x27dd('0x2'));var rs=require(_0x27dd('0x3'));var fs=require('fs');var db=require(_0x27dd('0x4'))['db'];var utils=require(_0x27dd('0x5'));var logger=require(_0x27dd('0x6'))(_0x27dd('0x7'));var config=require(_0x27dd('0x8'));var jayson=require(_0x27dd('0x9'));var client=jayson[_0x27dd('0xa')][_0x27dd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d5e87,_0x2708bf,_0x563658){return new BPromise(function(_0xa15399,_0x5bfc4a){return client[_0x27dd('0xc')](_0x3d5e87,_0x563658)[_0x27dd('0xd')](function(_0x3f85fc){logger[_0x27dd('0xe')]('AnalyticTreeReport,\x20%s,\x20%s',_0x2708bf,_0x27dd('0xf'));logger[_0x27dd('0x10')](_0x27dd('0x11'),_0x2708bf,'request\x20sent',JSON[_0x27dd('0x12')](_0x3f85fc));if(_0x3f85fc[_0x27dd('0x13')]){if(_0x3f85fc[_0x27dd('0x13')]['code']===0x1f4){logger[_0x27dd('0x13')](_0x27dd('0x14'),_0x2708bf,_0x3f85fc[_0x27dd('0x13')][_0x27dd('0x15')]);return _0x5bfc4a(_0x3f85fc[_0x27dd('0x13')]['message']);}logger['error'](_0x27dd('0x14'),_0x2708bf,_0x3f85fc[_0x27dd('0x13')][_0x27dd('0x15')]);return _0xa15399(_0x3f85fc['error'][_0x27dd('0x15')]);}else{logger['info'](_0x27dd('0x14'),_0x2708bf,_0x27dd('0xf'));_0xa15399(_0x3f85fc[_0x27dd('0x16')]['message']);}})[_0x27dd('0x17')](function(_0x52c61f){logger['error'](_0x27dd('0x14'),_0x2708bf,_0x52c61f);_0x5bfc4a(_0x52c61f);});});}
\ No newline at end of file
+var _0x1882=['debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent'];(function(_0x351bb5,_0x10e0e4){var _0x24584c=function(_0x1d5e8d){while(--_0x1d5e8d){_0x351bb5['push'](_0x351bb5['shift']());}};_0x24584c(++_0x10e0e4);}(_0x1882,0x12e));var _0x2188=function(_0x29cd67,_0x21ecd0){_0x29cd67=_0x29cd67-0x0;var _0x3b9583=_0x1882[_0x29cd67];return _0x3b9583;};'use strict';var _=require(_0x2188('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2188('0x1'));var fs=require('fs');var db=require(_0x2188('0x2'))['db'];var utils=require(_0x2188('0x3'));var logger=require(_0x2188('0x4'))(_0x2188('0x5'));var config=require('../../config/environment');var jayson=require(_0x2188('0x6'));var client=jayson[_0x2188('0x7')][_0x2188('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5503d5,_0x1e335c,_0x164f28){return new BPromise(function(_0x2f7059,_0x24b79d){return client[_0x2188('0x9')](_0x5503d5,_0x164f28)[_0x2188('0xa')](function(_0x340fa6){logger['info'](_0x2188('0xb'),_0x1e335c,_0x2188('0xc'));logger[_0x2188('0xd')](_0x2188('0xe'),_0x1e335c,_0x2188('0xc'),JSON[_0x2188('0xf')](_0x340fa6));if(_0x340fa6[_0x2188('0x10')]){if(_0x340fa6['error'][_0x2188('0x11')]===0x1f4){logger[_0x2188('0x10')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1e335c,_0x340fa6[_0x2188('0x10')][_0x2188('0x12')]);return _0x24b79d(_0x340fa6[_0x2188('0x10')][_0x2188('0x12')]);}logger[_0x2188('0x10')](_0x2188('0xb'),_0x1e335c,_0x340fa6[_0x2188('0x10')]['message']);return _0x2f7059(_0x340fa6[_0x2188('0x10')][_0x2188('0x12')]);}else{logger[_0x2188('0x13')](_0x2188('0xb'),_0x1e335c,'request\x20sent');_0x2f7059(_0x340fa6['result'][_0x2188('0x12')]);}})[_0x2188('0x14')](function(_0xbe83bf){logger[_0x2188('0x10')](_0x2188('0xb'),_0x1e335c,_0xbe83bf);_0x24b79d(_0xbe83bf);});});}
\ No newline at end of file
index 809366b..89ce4a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68eb=['destroy','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','post','put','/:id','update'];(function(_0x5d31f3,_0x4239b0){var _0x1cc88c=function(_0x1be8fc){while(--_0x1be8fc){_0x5d31f3['push'](_0x5d31f3['shift']());}};_0x1cc88c(++_0x4239b0);}(_0x68eb,0x1d2));var _0xb68e=function(_0x9c3c56,_0x169b56){_0x9c3c56=_0x9c3c56-0x0;var _0x2dd782=_0x68eb[_0x9c3c56];return _0x2dd782;};'use strict';var multer=require(_0xb68e('0x0'));var util=require(_0xb68e('0x1'));var path=require(_0xb68e('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xb68e('0x3'));var interaction=require(_0xb68e('0x4'));var config=require(_0xb68e('0x5'));var controller=require(_0xb68e('0x6'));router[_0xb68e('0x7')]('/',auth[_0xb68e('0x8')](),controller[_0xb68e('0x9')]);router[_0xb68e('0x7')]('/:id',auth[_0xb68e('0x8')](),controller['show']);router[_0xb68e('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb68e('0xb')](_0xb68e('0xc'),auth[_0xb68e('0x8')](),controller[_0xb68e('0xd')]);router['delete']('/:id',auth[_0xb68e('0x8')](),controller[_0xb68e('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x63b1=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports'];(function(_0x1065d1,_0x9c15a2){var _0x1b9c18=function(_0x1dc2e7){while(--_0x1dc2e7){_0x1065d1['push'](_0x1065d1['shift']());}};_0x1b9c18(++_0x9c15a2);}(_0x63b1,0x1cb));var _0x163b=function(_0x231c3b,_0x9de253){_0x231c3b=_0x231c3b-0x0;var _0x256106=_0x63b1[_0x231c3b];return _0x256106;};'use strict';var multer=require(_0x163b('0x0'));var util=require(_0x163b('0x1'));var path=require(_0x163b('0x2'));var express=require(_0x163b('0x3'));var router=express[_0x163b('0x4')]();var auth=require(_0x163b('0x5'));var interaction=require(_0x163b('0x6'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x163b('0x7')]('/',auth[_0x163b('0x8')](),controller[_0x163b('0x9')]);router[_0x163b('0x7')](_0x163b('0xa'),auth['isAuthenticated'](),controller[_0x163b('0xb')]);router[_0x163b('0xc')]('/',auth[_0x163b('0x8')](),controller['create']);router[_0x163b('0xd')](_0x163b('0xa'),auth[_0x163b('0x8')](),controller[_0x163b('0xe')]);router[_0x163b('0xf')](_0x163b('0xa'),auth[_0x163b('0x8')](),controller['destroy']);module[_0x163b('0x10')]=router;
\ No newline at end of file
index 359660f..ccf3152 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3305=['STRING','sequelize','exports'];(function(_0x4f7a4f,_0x3c68cf){var _0x41789d=function(_0x4433b7){while(--_0x4433b7){_0x4f7a4f['push'](_0x4f7a4f['shift']());}};_0x41789d(++_0x3c68cf);}(_0x3305,0x145));var _0x5330=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x3305[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x5330('0x0'));module[_0x5330('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x5330('0x2')]},'type':{'type':Sequelize[_0x5330('0x2')]}};
\ No newline at end of file
+var _0x5dfd=['STRING','sequelize'];(function(_0x379c3e,_0x5c9d34){var _0x20fa30=function(_0x5cd11f){while(--_0x5cd11f){_0x379c3e['push'](_0x379c3e['shift']());}};_0x20fa30(++_0x5c9d34);}(_0x5dfd,0x195));var _0xd5df=function(_0x27dba4,_0x419253){_0x27dba4=_0x27dba4-0x0;var _0x35ec9d=_0x5dfd[_0x27dba4];return _0x35ec9d;};'use strict';var Sequelize=require(_0xd5df('0x0'));module['exports']={'name':{'type':Sequelize[_0xd5df('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd5df('0x1')]}};
\ No newline at end of file
index 937e549..6e2c029 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5de1=['includeAll','find','catch','body','params','create','originalname','basename','file','filename','type','mimetype','download','join','root','server/files/attachments/','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','jsforce','papaparse','../../config/logger','api','../../config/environment','status','end','json','count','offset','limit','Content-Range','reject','update','destroy','then','sendStatus','error','stack','name','send','index','Attachment','rawAttributes','model','keys','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','nolimit','sort','where','add','day','merge','filter','map','options','include','findAll','rows'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0x5de1,0x1c6));var _0x15de=function(_0x22e053,_0x4fa53f){_0x22e053=_0x22e053-0x0;var _0x152181=_0x5de1[_0x22e053];return _0x152181;};'use strict';var pdf=require(_0x15de('0x0'));var emlformat=require(_0x15de('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x15de('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x15de('0x3'));var moment=require(_0x15de('0x4'));var BPromise=require(_0x15de('0x5'));var Mustache=require('mustache');var util=require(_0x15de('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x15de('0x7'));var ejs=require(_0x15de('0x8'));var fs=require('fs');var _=require(_0x15de('0x9'));var squel=require(_0x15de('0xa'));var crypto=require('crypto');var jsforce=require(_0x15de('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x15de('0x7'));var querystring=require('querystring');var Papa=require(_0x15de('0xc'));var qs=require('../../components/parsers/qs');var logger=require(_0x15de('0xd'))(_0x15de('0xe'));var utils=require('../../config/utils');var config=require(_0x15de('0xf'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3473ef,_0x33f89e){_0x33f89e=_0x33f89e||0xcc;return function(_0x16ae56){if(_0x16ae56){return _0x3473ef['sendStatus'](_0x33f89e);}return _0x3473ef[_0x15de('0x10')](_0x33f89e)[_0x15de('0x11')]();};}function respondWithResult(_0x50424e,_0x251545){_0x251545=_0x251545||0xc8;return function(_0x3ec0f4){if(_0x3ec0f4){return _0x50424e[_0x15de('0x10')](_0x251545)[_0x15de('0x12')](_0x3ec0f4);}};}function respondWithFilteredResult(_0x15bf28,_0x506f87){return function(_0x40faf4){if(_0x40faf4){var _0x13f7be=_0x40faf4[_0x15de('0x13')],_0x4dce5f=_0x506f87[_0x15de('0x14')],_0xc5df75=_0x506f87['offset']+_0x506f87[_0x15de('0x15')],_0x884e7c;if(_0xc5df75>=_0x13f7be){_0xc5df75=_0x13f7be;_0x884e7c=0xc8;}else{_0x884e7c=0xce;}_0x15bf28[_0x15de('0x10')](_0x884e7c);return _0x15bf28['set'](_0x15de('0x16'),_0x4dce5f+'-'+_0xc5df75+'/'+_0x13f7be)[_0x15de('0x12')](_0x40faf4);}return null;};}function patchUpdates(_0x59092d){return function(_0x473c5c){try{jsonpatch['apply'](_0x473c5c,_0x59092d,!![]);}catch(_0x66a401){return BPromise[_0x15de('0x17')](_0x66a401);}return _0x473c5c['save']();};}function saveUpdates(_0x54a46e,_0x4046be){return function(_0x2725c7){if(_0x2725c7){return _0x2725c7[_0x15de('0x18')](_0x54a46e)['then'](function(_0xed8784){return _0xed8784;});}return null;};}function removeEntity(_0x3fa541,_0x28038e){return function(_0x53d0c2){if(_0x53d0c2){return _0x53d0c2[_0x15de('0x19')]()[_0x15de('0x1a')](function(){_0x3fa541[_0x15de('0x10')](0xcc)[_0x15de('0x11')]();});}};}function handleEntityNotFound(_0x390515,_0x2348bd){return function(_0x1b0b6c){if(!_0x1b0b6c){_0x390515[_0x15de('0x1b')](0x194);}return _0x1b0b6c;};}function handleError(_0x421e99,_0x1b8763){_0x1b8763=_0x1b8763||0x1f4;return function(_0x1ab18a){logger[_0x15de('0x1c')](_0x1ab18a[_0x15de('0x1d')]);if(_0x1ab18a[_0x15de('0x1e')]){delete _0x1ab18a['name'];}_0x421e99[_0x15de('0x10')](_0x1b8763)[_0x15de('0x1f')](_0x1ab18a);};}exports[_0x15de('0x20')]=function(_0x16802c,_0x2f43d2){var _0x56e358={},_0x493478={},_0x15cade={'count':0x0,'rows':[]};var _0x2e5a63=db[_0x15de('0x21')][_0x15de('0x22')];_0x493478[_0x15de('0x23')]=_[_0x15de('0x24')](_0x2e5a63);var _0x4dcb8d={'dateStart':_0x16802c['query'][_0x15de('0x25')],'dateEnd':_0x16802c[_0x15de('0x26')][_0x15de('0x27')]};delete _0x16802c['query'][_0x15de('0x25')];delete _0x16802c[_0x15de('0x26')][_0x15de('0x27')];_0x493478[_0x15de('0x26')]=_[_0x15de('0x24')](_0x16802c[_0x15de('0x26')]);_0x493478[_0x15de('0x28')]=_[_0x15de('0x29')](_0x493478[_0x15de('0x23')],_0x493478['query']);_0x56e358[_0x15de('0x2a')]=_['intersection'](_0x493478[_0x15de('0x23')],qs[_0x15de('0x2b')](_0x16802c[_0x15de('0x26')][_0x15de('0x2b')]));_0x56e358[_0x15de('0x2a')]=_0x56e358[_0x15de('0x2a')][_0x15de('0x2c')]?_0x56e358[_0x15de('0x2a')]:_0x493478['model'];if(!_0x16802c[_0x15de('0x26')]['hasOwnProperty'](_0x15de('0x2d'))){_0x56e358[_0x15de('0x15')]=qs[_0x15de('0x15')](_0x16802c['query'][_0x15de('0x15')]);_0x56e358['offset']=qs[_0x15de('0x14')](_0x16802c['query'][_0x15de('0x14')]);}_0x56e358['order']=qs[_0x15de('0x2e')](_0x16802c[_0x15de('0x26')]['sort']);_0x56e358[_0x15de('0x2f')]=qs[_0x15de('0x28')](_['pick'](_0x16802c[_0x15de('0x26')],_0x493478['filters']));if(_0x4dcb8d['dateStart']){if(_0x4dcb8d[_0x15de('0x27')]){_0x4dcb8d[_0x15de('0x27')]=moment(_0x4dcb8d['dateEnd'])[_0x15de('0x30')](0x1,_0x15de('0x31'));}else{_0x4dcb8d[_0x15de('0x27')]=moment(_0x4dcb8d[_0x15de('0x25')])[_0x15de('0x30')](0x1,_0x15de('0x31'));}_[_0x15de('0x32')](_0x56e358[_0x15de('0x2f')],{'createdAt':{'$gte':_0x4dcb8d[_0x15de('0x25')],'$lte':_0x4dcb8d['dateEnd']}});}if(_0x16802c['query'][_0x15de('0x33')]){_0x56e358[_0x15de('0x2f')]=_[_0x15de('0x32')](_0x56e358[_0x15de('0x2f')],{'$or':_[_0x15de('0x34')](_0x56e358['attributes'],function(_0x217c06){var _0x28c098={};_0x28c098[_0x217c06]={'$like':'%'+_0x16802c[_0x15de('0x26')][_0x15de('0x33')]+'%'};return _0x28c098;})});}_0x56e358=_[_0x15de('0x32')]({},_0x56e358,_0x16802c[_0x15de('0x35')]);var _0x5eadd6={'where':_0x56e358['where']};return db['Attachment'][_0x15de('0x13')](_0x5eadd6)[_0x15de('0x1a')](function(_0x15a065){_0x15cade['count']=_0x15a065;if(_0x16802c[_0x15de('0x26')]['includeAll']){_0x56e358[_0x15de('0x36')]=[{'all':!![]}];}return db[_0x15de('0x21')][_0x15de('0x37')](_0x56e358);})[_0x15de('0x1a')](function(_0x874b26){_0x15cade[_0x15de('0x38')]=_0x874b26;return _0x15cade;})[_0x15de('0x1a')](respondWithFilteredResult(_0x2f43d2,_0x56e358))['catch'](handleError(_0x2f43d2,null));};exports['show']=function(_0x1d14ec,_0x51b088){var _0x5860fb={'raw':!![],'where':{'id':_0x1d14ec['params']['id']}},_0x2de04c={};_0x2de04c[_0x15de('0x23')]=_[_0x15de('0x24')](db[_0x15de('0x21')][_0x15de('0x22')]);_0x2de04c[_0x15de('0x26')]=_['keys'](_0x1d14ec['query']);_0x2de04c[_0x15de('0x28')]=_['intersection'](_0x2de04c[_0x15de('0x23')],_0x2de04c[_0x15de('0x26')]);_0x5860fb[_0x15de('0x2a')]=_[_0x15de('0x29')](_0x2de04c['model'],qs[_0x15de('0x2b')](_0x1d14ec[_0x15de('0x26')][_0x15de('0x2b')]));_0x5860fb[_0x15de('0x2a')]=_0x5860fb[_0x15de('0x2a')][_0x15de('0x2c')]?_0x5860fb[_0x15de('0x2a')]:_0x2de04c['model'];if(_0x1d14ec[_0x15de('0x26')][_0x15de('0x39')]){_0x5860fb[_0x15de('0x36')]=[{'all':!![]}];}_0x5860fb=_['merge']({},_0x5860fb,_0x1d14ec[_0x15de('0x35')]);return db[_0x15de('0x21')][_0x15de('0x3a')](_0x5860fb)['then'](handleEntityNotFound(_0x51b088,null))[_0x15de('0x1a')](respondWithResult(_0x51b088,null))[_0x15de('0x3b')](handleError(_0x51b088,null));};exports[_0x15de('0x18')]=function(_0x35e707,_0x56628f){if(_0x35e707[_0x15de('0x3c')]['id']){delete _0x35e707['body']['id'];}return db[_0x15de('0x21')][_0x15de('0x3a')]({'where':{'id':_0x35e707[_0x15de('0x3d')]['id']}})[_0x15de('0x1a')](handleEntityNotFound(_0x56628f,null))['then'](saveUpdates(_0x35e707[_0x15de('0x3c')],null))[_0x15de('0x1a')](respondWithResult(_0x56628f,null))[_0x15de('0x3b')](handleError(_0x56628f,null));};exports['destroy']=function(_0x2fa4a0,_0x46c6f6){return db[_0x15de('0x21')][_0x15de('0x3a')]({'where':{'id':_0x2fa4a0[_0x15de('0x3d')]['id']}})[_0x15de('0x1a')](handleEntityNotFound(_0x46c6f6,null))[_0x15de('0x1a')](removeEntity(_0x46c6f6,null))[_0x15de('0x3b')](handleError(_0x46c6f6,null));};exports[_0x15de('0x3e')]=function(_0xa0702e,_0x9bbeaa,_0x3eca5e){_0xa0702e[_0x15de('0x3c')][_0x15de('0x1e')]=_0xa0702e['file'][_0x15de('0x3f')];_0xa0702e['body'][_0x15de('0x40')]=_0xa0702e[_0x15de('0x41')][_0x15de('0x42')];_0xa0702e['body'][_0x15de('0x43')]=_0xa0702e[_0x15de('0x41')][_0x15de('0x44')];return db['Attachment'][_0x15de('0x3e')](_0xa0702e['body'])[_0x15de('0x1a')](respondWithResult(_0x9bbeaa,0xc9))['catch'](handleError(_0x9bbeaa,null));};exports['download']=function(_0x5d37a1,_0x350625,_0x2845d4){return db['Attachment']['findOne']({'where':{'id':_0x5d37a1[_0x15de('0x3d')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x350625,null))[_0x15de('0x1a')](function(_0x49593e){if(_0x49593e){return _0x350625[_0x15de('0x45')](path[_0x15de('0x46')](config[_0x15de('0x47')],_0x15de('0x48'),_0x49593e[_0x15de('0x40')]));}})['catch'](handleError(_0x350625,null));};
\ No newline at end of file
+var _0xdf04=['json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','model','attributes','fields','hasOwnProperty','limit','sort','where','pick','add','day','merge','filter','map','options','includeAll','include','Attachment','findAll','rows','catch','show','params','body','find','create','basename','file','filename','mimetype','download','findOne','join','server/files/attachments/','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','../../config/logger','api','../../config/environment','sendStatus','end','status'];(function(_0x59bcde,_0x2938f8){var _0x4da7b3=function(_0x1aa51a){while(--_0x1aa51a){_0x59bcde['push'](_0x59bcde['shift']());}};_0x4da7b3(++_0x2938f8);}(_0xdf04,0x156));var _0x4df0=function(_0x4c1fa9,_0x3d0599){_0x4c1fa9=_0x4c1fa9-0x0;var _0x859e34=_0xdf04[_0x4c1fa9];return _0x859e34;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4df0('0x0'));var zipdir=require(_0x4df0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4df0('0x2'));var Mustache=require(_0x4df0('0x3'));var util=require(_0x4df0('0x4'));var path=require(_0x4df0('0x5'));var sox=require(_0x4df0('0x6'));var csv=require(_0x4df0('0x7'));var ejs=require(_0x4df0('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4df0('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x4df0('0xa'));var toCsv=require(_0x4df0('0x7'));var querystring=require(_0x4df0('0xb'));var Papa=require('papaparse');var qs=require('../../components/parsers/qs');var logger=require(_0x4df0('0xc'))(_0x4df0('0xd'));var utils=require('../../config/utils');var config=require(_0x4df0('0xe'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x170486,_0x5dbcfa){_0x5dbcfa=_0x5dbcfa||0xcc;return function(_0x4c0d20){if(_0x4c0d20){return _0x170486[_0x4df0('0xf')](_0x5dbcfa);}return _0x170486['status'](_0x5dbcfa)[_0x4df0('0x10')]();};}function respondWithResult(_0x1a38e8,_0xde6100){_0xde6100=_0xde6100||0xc8;return function(_0x2af4be){if(_0x2af4be){return _0x1a38e8[_0x4df0('0x11')](_0xde6100)[_0x4df0('0x12')](_0x2af4be);}};}function respondWithFilteredResult(_0x33b2f6,_0x104786){return function(_0xf173d9){if(_0xf173d9){var _0x5dfc58=_0xf173d9[_0x4df0('0x13')],_0x4d49b7=_0x104786['offset'],_0x2fa123=_0x104786[_0x4df0('0x14')]+_0x104786['limit'],_0x5c8ede;if(_0x2fa123>=_0x5dfc58){_0x2fa123=_0x5dfc58;_0x5c8ede=0xc8;}else{_0x5c8ede=0xce;}_0x33b2f6[_0x4df0('0x11')](_0x5c8ede);return _0x33b2f6[_0x4df0('0x15')](_0x4df0('0x16'),_0x4d49b7+'-'+_0x2fa123+'/'+_0x5dfc58)[_0x4df0('0x12')](_0xf173d9);}return null;};}function patchUpdates(_0x28b9db){return function(_0xb904e){try{jsonpatch[_0x4df0('0x17')](_0xb904e,_0x28b9db,!![]);}catch(_0x2fd80f){return BPromise[_0x4df0('0x18')](_0x2fd80f);}return _0xb904e[_0x4df0('0x19')]();};}function saveUpdates(_0x1d2fb3,_0x27c53c){return function(_0x1ec358){if(_0x1ec358){return _0x1ec358[_0x4df0('0x1a')](_0x1d2fb3)[_0x4df0('0x1b')](function(_0x1c8d90){return _0x1c8d90;});}return null;};}function removeEntity(_0x251a36,_0x5adab4){return function(_0x5d81c5){if(_0x5d81c5){return _0x5d81c5[_0x4df0('0x1c')]()[_0x4df0('0x1b')](function(){_0x251a36[_0x4df0('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2250dd,_0x228857){return function(_0x5d68f3){if(!_0x5d68f3){_0x2250dd[_0x4df0('0xf')](0x194);}return _0x5d68f3;};}function handleError(_0xff6f5c,_0x2ed184){_0x2ed184=_0x2ed184||0x1f4;return function(_0xd66a7e){logger['error'](_0xd66a7e['stack']);if(_0xd66a7e['name']){delete _0xd66a7e[_0x4df0('0x1d')];}_0xff6f5c[_0x4df0('0x11')](_0x2ed184)[_0x4df0('0x1e')](_0xd66a7e);};}exports[_0x4df0('0x1f')]=function(_0x132f55,_0x4b71d5){var _0x50e744={},_0x328613={},_0x1107ea={'count':0x0,'rows':[]};var _0xfca1d=db['Attachment'][_0x4df0('0x20')];_0x328613['model']=_[_0x4df0('0x21')](_0xfca1d);var _0x5d3749={'dateStart':_0x132f55[_0x4df0('0x22')][_0x4df0('0x23')],'dateEnd':_0x132f55[_0x4df0('0x22')][_0x4df0('0x24')]};delete _0x132f55[_0x4df0('0x22')]['dateStart'];delete _0x132f55[_0x4df0('0x22')][_0x4df0('0x24')];_0x328613[_0x4df0('0x22')]=_['keys'](_0x132f55[_0x4df0('0x22')]);_0x328613[_0x4df0('0x25')]=_[_0x4df0('0x26')](_0x328613[_0x4df0('0x27')],_0x328613[_0x4df0('0x22')]);_0x50e744[_0x4df0('0x28')]=_[_0x4df0('0x26')](_0x328613[_0x4df0('0x27')],qs[_0x4df0('0x29')](_0x132f55[_0x4df0('0x22')]['fields']));_0x50e744['attributes']=_0x50e744[_0x4df0('0x28')]['length']?_0x50e744[_0x4df0('0x28')]:_0x328613[_0x4df0('0x27')];if(!_0x132f55[_0x4df0('0x22')][_0x4df0('0x2a')]('nolimit')){_0x50e744[_0x4df0('0x2b')]=qs['limit'](_0x132f55[_0x4df0('0x22')][_0x4df0('0x2b')]);_0x50e744[_0x4df0('0x14')]=qs[_0x4df0('0x14')](_0x132f55[_0x4df0('0x22')]['offset']);}_0x50e744['order']=qs['sort'](_0x132f55[_0x4df0('0x22')][_0x4df0('0x2c')]);_0x50e744[_0x4df0('0x2d')]=qs['filters'](_[_0x4df0('0x2e')](_0x132f55['query'],_0x328613[_0x4df0('0x25')]));if(_0x5d3749[_0x4df0('0x23')]){if(_0x5d3749[_0x4df0('0x24')]){_0x5d3749[_0x4df0('0x24')]=moment(_0x5d3749['dateEnd'])[_0x4df0('0x2f')](0x1,'day');}else{_0x5d3749[_0x4df0('0x24')]=moment(_0x5d3749[_0x4df0('0x23')])['add'](0x1,_0x4df0('0x30'));}_[_0x4df0('0x31')](_0x50e744[_0x4df0('0x2d')],{'createdAt':{'$gte':_0x5d3749[_0x4df0('0x23')],'$lte':_0x5d3749[_0x4df0('0x24')]}});}if(_0x132f55[_0x4df0('0x22')][_0x4df0('0x32')]){_0x50e744[_0x4df0('0x2d')]=_[_0x4df0('0x31')](_0x50e744[_0x4df0('0x2d')],{'$or':_[_0x4df0('0x33')](_0x50e744['attributes'],function(_0x55cacf){var _0x138b29={};_0x138b29[_0x55cacf]={'$like':'%'+_0x132f55[_0x4df0('0x22')]['filter']+'%'};return _0x138b29;})});}_0x50e744=_['merge']({},_0x50e744,_0x132f55[_0x4df0('0x34')]);var _0x14773c={'where':_0x50e744[_0x4df0('0x2d')]};return db['Attachment'][_0x4df0('0x13')](_0x14773c)[_0x4df0('0x1b')](function(_0x21870a){_0x1107ea[_0x4df0('0x13')]=_0x21870a;if(_0x132f55[_0x4df0('0x22')][_0x4df0('0x35')]){_0x50e744[_0x4df0('0x36')]=[{'all':!![]}];}return db[_0x4df0('0x37')][_0x4df0('0x38')](_0x50e744);})['then'](function(_0x5d887f){_0x1107ea[_0x4df0('0x39')]=_0x5d887f;return _0x1107ea;})[_0x4df0('0x1b')](respondWithFilteredResult(_0x4b71d5,_0x50e744))[_0x4df0('0x3a')](handleError(_0x4b71d5,null));};exports[_0x4df0('0x3b')]=function(_0x25f15e,_0x4b0c81){var _0x10ef45={'raw':!![],'where':{'id':_0x25f15e[_0x4df0('0x3c')]['id']}},_0x7fa55b={};_0x7fa55b[_0x4df0('0x27')]=_[_0x4df0('0x21')](db['Attachment'][_0x4df0('0x20')]);_0x7fa55b['query']=_[_0x4df0('0x21')](_0x25f15e[_0x4df0('0x22')]);_0x7fa55b[_0x4df0('0x25')]=_['intersection'](_0x7fa55b[_0x4df0('0x27')],_0x7fa55b[_0x4df0('0x22')]);_0x10ef45[_0x4df0('0x28')]=_[_0x4df0('0x26')](_0x7fa55b[_0x4df0('0x27')],qs[_0x4df0('0x29')](_0x25f15e[_0x4df0('0x22')]['fields']));_0x10ef45[_0x4df0('0x28')]=_0x10ef45[_0x4df0('0x28')]['length']?_0x10ef45[_0x4df0('0x28')]:_0x7fa55b[_0x4df0('0x27')];if(_0x25f15e[_0x4df0('0x22')]['includeAll']){_0x10ef45[_0x4df0('0x36')]=[{'all':!![]}];}_0x10ef45=_[_0x4df0('0x31')]({},_0x10ef45,_0x25f15e[_0x4df0('0x34')]);return db[_0x4df0('0x37')]['find'](_0x10ef45)['then'](handleEntityNotFound(_0x4b0c81,null))[_0x4df0('0x1b')](respondWithResult(_0x4b0c81,null))[_0x4df0('0x3a')](handleError(_0x4b0c81,null));};exports['update']=function(_0x105867,_0x11e413){if(_0x105867['body']['id']){delete _0x105867[_0x4df0('0x3d')]['id'];}return db[_0x4df0('0x37')][_0x4df0('0x3e')]({'where':{'id':_0x105867[_0x4df0('0x3c')]['id']}})[_0x4df0('0x1b')](handleEntityNotFound(_0x11e413,null))[_0x4df0('0x1b')](saveUpdates(_0x105867[_0x4df0('0x3d')],null))[_0x4df0('0x1b')](respondWithResult(_0x11e413,null))[_0x4df0('0x3a')](handleError(_0x11e413,null));};exports['destroy']=function(_0x492b57,_0x6596d){return db[_0x4df0('0x37')][_0x4df0('0x3e')]({'where':{'id':_0x492b57['params']['id']}})['then'](handleEntityNotFound(_0x6596d,null))[_0x4df0('0x1b')](removeEntity(_0x6596d,null))[_0x4df0('0x3a')](handleError(_0x6596d,null));};exports[_0x4df0('0x3f')]=function(_0x354513,_0x126cce,_0x1b4e8d){_0x354513[_0x4df0('0x3d')][_0x4df0('0x1d')]=_0x354513['file']['originalname'];_0x354513[_0x4df0('0x3d')][_0x4df0('0x40')]=_0x354513[_0x4df0('0x41')][_0x4df0('0x42')];_0x354513[_0x4df0('0x3d')]['type']=_0x354513[_0x4df0('0x41')][_0x4df0('0x43')];return db[_0x4df0('0x37')][_0x4df0('0x3f')](_0x354513[_0x4df0('0x3d')])[_0x4df0('0x1b')](respondWithResult(_0x126cce,0xc9))['catch'](handleError(_0x126cce,null));};exports[_0x4df0('0x44')]=function(_0x1b7873,_0x4eefe1,_0xe54d72){return db[_0x4df0('0x37')][_0x4df0('0x45')]({'where':{'id':_0x1b7873['params']['id']},'raw':!![]})[_0x4df0('0x1b')](handleEntityNotFound(_0x4eefe1,null))['then'](function(_0x368b22){if(_0x368b22){return _0x4eefe1[_0x4df0('0x44')](path[_0x4df0('0x46')](config['root'],_0x4df0('0x47'),_0x368b22[_0x4df0('0x40')]));}})[_0x4df0('0x3a')](handleError(_0x4eefe1,null));};
\ No newline at end of file
index 6363cc4..b435499 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['lodash','../../config/logger','api','moment','bluebird','request-promise','define','Attachment','attachments'];(function(_0x1108c3,_0x406efd){var _0x5ce6b0=function(_0x1d5590){while(--_0x1d5590){_0x1108c3['push'](_0x1108c3['shift']());}};_0x5ce6b0(++_0x406efd);}(_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 attributes=require('./attachment.attributes');module['exports']=function(_0x472a96,_0xce17f9){return _0x472a96[_0x7721('0x6')](_0x7721('0x7'),attributes,{'tableName':_0x7721('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x55ca=['bluebird','request-promise','exports','define','Attachment','attachments','lodash','util'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0x55ca,0x126));var _0xa55c=function(_0xa7efd7,_0x45c885){_0xa7efd7=_0xa7efd7-0x0;var _0x572019=_0x55ca[_0xa7efd7];return _0x572019;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var attributes=require('./attachment.attributes');module[_0xa55c('0x4')]=function(_0x2db02a,_0xcb02e3){return _0x2db02a[_0xa55c('0x5')](_0xa55c('0x6'),attributes,{'tableName':_0xa55c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2754fb4..4cf7d16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02ce=['../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x23ea6a,_0xeb7243){var _0x3520a4=function(_0x5bc3b8){while(--_0x5bc3b8){_0x23ea6a['push'](_0x23ea6a['shift']());}};_0x3520a4(++_0xeb7243);}(_0x02ce,0x1ac));var _0xe02c=function(_0x1e6029,_0x4a3978){_0x1e6029=_0x1e6029-0x0;var _0x30a55c=_0x02ce[_0x1e6029];return _0x30a55c;};'use strict';var _=require(_0xe02c('0x0'));var util=require(_0xe02c('0x1'));var moment=require(_0xe02c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe02c('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0xe02c('0x4'));var logger=require(_0xe02c('0x5'))(_0xe02c('0x6'));var config=require(_0xe02c('0x7'));var jayson=require(_0xe02c('0x8'));var client=jayson[_0xe02c('0x9')][_0xe02c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b804f,_0x36a87f,_0x4fecb3){return new BPromise(function(_0x5eabb0,_0x3c757e){return client[_0xe02c('0xb')](_0x2b804f,_0x4fecb3)[_0xe02c('0xc')](function(_0x1a9f97){logger[_0xe02c('0xd')](_0xe02c('0xe'),_0x36a87f,_0xe02c('0xf'));logger[_0xe02c('0x10')](_0xe02c('0x11'),_0x36a87f,_0xe02c('0xf'),JSON[_0xe02c('0x12')](_0x1a9f97));if(_0x1a9f97[_0xe02c('0x13')]){if(_0x1a9f97[_0xe02c('0x13')][_0xe02c('0x14')]===0x1f4){logger[_0xe02c('0x13')](_0xe02c('0xe'),_0x36a87f,_0x1a9f97[_0xe02c('0x13')][_0xe02c('0x15')]);return _0x3c757e(_0x1a9f97['error'][_0xe02c('0x15')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x36a87f,_0x1a9f97[_0xe02c('0x13')]['message']);return _0x5eabb0(_0x1a9f97[_0xe02c('0x13')]['message']);}else{logger[_0xe02c('0xd')]('Attachment,\x20%s,\x20%s',_0x36a87f,_0xe02c('0xf'));_0x5eabb0(_0x1a9f97[_0xe02c('0x16')]['message']);}})[_0xe02c('0x17')](function(_0x226a80){logger['error'](_0xe02c('0xe'),_0x36a87f,_0x226a80);_0x3c757e(_0x226a80);});});}exports[_0xe02c('0x18')]=function(_0x5a4583){var _0x52917f=this;return new Promise(function(_0x3e37bf,_0x49604a){return db[_0xe02c('0x19')][_0xe02c('0x1a')](_0x5a4583[_0xe02c('0x1b')],{'raw':_0x5a4583[_0xe02c('0x1c')]?_0x5a4583[_0xe02c('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xe02c('0xc')](function(_0x59026f){logger['info'](_0xe02c('0x18'),_0x5a4583);logger[_0xe02c('0x10')]('CreateAttachment',_0x5a4583,JSON[_0xe02c('0x12')](_0x59026f));_0x3e37bf(_0x59026f);})[_0xe02c('0x17')](function(_0x4ce5ee){logger[_0xe02c('0x13')](_0xe02c('0x18'),_0x4ce5ee[_0xe02c('0x15')],_0x5a4583);_0x49604a(_0x52917f[_0xe02c('0x13')](0x1f4,_0x4ce5ee[_0xe02c('0x15')]));});});};
\ No newline at end of file
+var _0x97db=['stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s'];(function(_0x3d71c7,_0x1144f6){var _0x5d38f5=function(_0x211ae4){while(--_0x211ae4){_0x3d71c7['push'](_0x3d71c7['shift']());}};_0x5d38f5(++_0x1144f6);}(_0x97db,0x1b4));var _0xb97d=function(_0x1ad2ce,_0x5b2bc9){_0x1ad2ce=_0x1ad2ce-0x0;var _0x1a8db1=_0x97db[_0x1ad2ce];return _0x1a8db1;};'use strict';var _=require(_0xb97d('0x0'));var util=require(_0xb97d('0x1'));var moment=require(_0xb97d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0xb97d('0x3'))['db'];var utils=require(_0xb97d('0x4'));var logger=require(_0xb97d('0x5'))(_0xb97d('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb97d('0x7')][_0xb97d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a5902,_0x533149,_0x2ff80e){return new BPromise(function(_0x57cbd4,_0x20f1e1){return client[_0xb97d('0x9')](_0x4a5902,_0x2ff80e)['then'](function(_0x1c0fb8){logger[_0xb97d('0xa')](_0xb97d('0xb'),_0x533149,_0xb97d('0xc'));logger['debug'](_0xb97d('0xd'),_0x533149,_0xb97d('0xc'),JSON[_0xb97d('0xe')](_0x1c0fb8));if(_0x1c0fb8[_0xb97d('0xf')]){if(_0x1c0fb8[_0xb97d('0xf')][_0xb97d('0x10')]===0x1f4){logger[_0xb97d('0xf')](_0xb97d('0xb'),_0x533149,_0x1c0fb8[_0xb97d('0xf')][_0xb97d('0x11')]);return _0x20f1e1(_0x1c0fb8[_0xb97d('0xf')][_0xb97d('0x11')]);}logger[_0xb97d('0xf')](_0xb97d('0xb'),_0x533149,_0x1c0fb8[_0xb97d('0xf')][_0xb97d('0x11')]);return _0x57cbd4(_0x1c0fb8[_0xb97d('0xf')][_0xb97d('0x11')]);}else{logger['info'](_0xb97d('0xb'),_0x533149,_0xb97d('0xc'));_0x57cbd4(_0x1c0fb8[_0xb97d('0x12')][_0xb97d('0x11')]);}})[_0xb97d('0x13')](function(_0x5519bb){logger[_0xb97d('0xf')](_0xb97d('0xb'),_0x533149,_0x5519bb);_0x20f1e1(_0x5519bb);});});}exports[_0xb97d('0x14')]=function(_0x56bf66){var _0x50cd63=this;return new Promise(function(_0x2aa592,_0x2285bc){return db[_0xb97d('0x15')][_0xb97d('0x16')](_0x56bf66[_0xb97d('0x17')],{'raw':_0x56bf66[_0xb97d('0x18')]?_0x56bf66[_0xb97d('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4b26e8){logger['info'](_0xb97d('0x14'),_0x56bf66);logger['debug'](_0xb97d('0x14'),_0x56bf66,JSON[_0xb97d('0xe')](_0x4b26e8));_0x2aa592(_0x4b26e8);})['catch'](function(_0x52af79){logger['error'](_0xb97d('0x14'),_0x52af79[_0xb97d('0x11')],_0x56bf66);_0x2285bc(_0x50cd63[_0xb97d('0xf')](0x1f4,_0x52af79[_0xb97d('0x11')]));});});};
\ No newline at end of file
index 240ba45..c69bd90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8506=['../../components/auth/service','../../config/environment','./attachment.controller','get','index','/:id','isAuthenticated','download','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','create','put','delete','destroy','exports','util','express'];(function(_0x4e8a16,_0x404574){var _0x4ee1a3=function(_0x3cee25){while(--_0x3cee25){_0x4e8a16['push'](_0x4e8a16['shift']());}};_0x4ee1a3(++_0x404574);}(_0x8506,0xe8));var _0x6850=function(_0x37d370,_0x1898d7){_0x37d370=_0x37d370-0x0;var _0x4b6cd8=_0x8506[_0x37d370];return _0x4b6cd8;};'use strict';var multer=require('multer');var util=require(_0x6850('0x0'));var path=require('path');var express=require(_0x6850('0x1'));var router=express['Router']();var auth=require(_0x6850('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x6850('0x3'));var controller=require(_0x6850('0x4'));router[_0x6850('0x5')]('/',auth['isAuthenticated'](),controller[_0x6850('0x6')]);router[_0x6850('0x5')](_0x6850('0x7'),auth[_0x6850('0x8')](),controller['show']);router['get']('/:id/download',auth[_0x6850('0x8')](),controller[_0x6850('0x9')]);var upload=multer({'storage':multer[_0x6850('0xa')]({'destination':function(_0x589417,_0x5abd3b,_0x50e0e9){_0x50e0e9(null,path[_0x6850('0xb')](config[_0x6850('0xc')],_0x6850('0xd')));},'filename':function(_0xa24cab,_0x5d712b,_0x16510e){_0x16510e(null,util[_0x6850('0xe')](_0x6850('0xf'),Date[_0x6850('0x10')](),_0x5d712b[_0x6850('0x11')][_0x6850('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload[_0x6850('0x13')](_0x6850('0x14')),controller[_0x6850('0x15')]);router[_0x6850('0x16')](_0x6850('0x7'),auth[_0x6850('0x8')](),controller['update']);router[_0x6850('0x17')]('/:id',auth[_0x6850('0x8')](),controller[_0x6850('0x18')]);module[_0x6850('0x19')]=router;
\ No newline at end of file
+var _0x4c99=['replace','post','single','file','create','update','delete','destroy','exports','multer','path','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/download','download','diskStorage','join','root','%s-%s','now','originalname'];(function(_0x3e01da,_0x13724f){var _0xbc0c99=function(_0x6f9ada){while(--_0x6f9ada){_0x3e01da['push'](_0x3e01da['shift']());}};_0xbc0c99(++_0x13724f);}(_0x4c99,0x1ec));var _0x94c9=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x4c99[_0x1deb03];return _0x189fe7;};'use strict';var multer=require(_0x94c9('0x0'));var util=require('util');var path=require(_0x94c9('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x94c9('0x2'));var config=require(_0x94c9('0x3'));var controller=require('./attachment.controller');router[_0x94c9('0x4')]('/',auth[_0x94c9('0x5')](),controller['index']);router[_0x94c9('0x4')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x94c9('0x4')](_0x94c9('0x6'),auth[_0x94c9('0x5')](),controller[_0x94c9('0x7')]);var upload=multer({'storage':multer[_0x94c9('0x8')]({'destination':function(_0x1c0983,_0x13fc19,_0x359356){_0x359356(null,path[_0x94c9('0x9')](config[_0x94c9('0xa')],'server/files/attachments/'));},'filename':function(_0x2f097d,_0x277dfd,_0xef9ed0){_0xef9ed0(null,util['format'](_0x94c9('0xb'),Date[_0x94c9('0xc')](),_0x277dfd[_0x94c9('0xd')][_0x94c9('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x94c9('0xf')]('/',upload[_0x94c9('0x10')](_0x94c9('0x11')),controller[_0x94c9('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x94c9('0x13')]);router[_0x94c9('0x14')]('/:id',auth[_0x94c9('0x5')](),controller[_0x94c9('0x15')]);module[_0x94c9('0x16')]=router;
\ No newline at end of file
index a588b84..7d75c9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a94=['../../components/auth/service','signToken','authenticate','google','profile','email','callback','/login','use','clientID','clientSecret','secret','callbackURL','User','find','map','value','agent','then','User\x20email\x20not\x20found!','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x0a94,0xf5));var _0x40a9=function(_0x17cbe8,_0xbd4669){_0x17cbe8=_0x17cbe8-0x0;var _0x48b832=_0x0a94[_0x17cbe8];return _0x48b832;};'use strict';var _=require(_0x40a9('0x0'));var passport=require(_0x40a9('0x1'));var GoogleStrategy=require(_0x40a9('0x2'))[_0x40a9('0x3')];var db=require(_0x40a9('0x4'))['db'];var config=require('../../config/environment');var signToken=require(_0x40a9('0x5'))[_0x40a9('0x6')];exports['login']=passport[_0x40a9('0x7')](_0x40a9('0x8'),{'failureRedirect':'/login','scope':[_0x40a9('0x9'),_0x40a9('0xa')],'session':![]});exports[_0x40a9('0xb')]=passport['authenticate']('google',{'failureRedirect':_0x40a9('0xc'),'session':![]});passport[_0x40a9('0xd')](new GoogleStrategy({'clientID':config['google']?config[_0x40a9('0x8')][_0x40a9('0xe')]:'id','clientSecret':config[_0x40a9('0x8')]?config[_0x40a9('0x8')][_0x40a9('0xf')]:_0x40a9('0x10'),'callbackURL':config[_0x40a9('0x8')]?config[_0x40a9('0x8')][_0x40a9('0x11')]:''},function(_0x1ac467,_0x1a07c4,_0x2f6c6d,_0x2d6b26){db[_0x40a9('0x12')][_0x40a9('0x13')]({'where':{'email':_[_0x40a9('0x14')](_0x2f6c6d['emails'],_0x40a9('0x15')),'role':{'$or':['admin','user',_0x40a9('0x16')]}}})[_0x40a9('0x17')](function(_0x463d9e){if(_0x463d9e){return _0x2d6b26(null,_0x463d9e);}_0x2d6b26(_0x40a9('0x18'));})['catch'](function(_0x35ca24){_0x2d6b26(_0x35ca24);});}));
\ No newline at end of file
+var _0xb8cb=['login','authenticate','profile','email','callback','google','/login','use','clientID','clientSecret','secret','User','map','emails','value','admin','user','agent','then','User\x20email\x20not\x20found!','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service'];(function(_0xd2284f,_0x2bcb6b){var _0x4e6915=function(_0x3351f0){while(--_0x3351f0){_0xd2284f['push'](_0xd2284f['shift']());}};_0x4e6915(++_0x2bcb6b);}(_0xb8cb,0xd9));var _0xbb8c=function(_0x56dd52,_0xdaa1f7){_0x56dd52=_0x56dd52-0x0;var _0x5aa4c2=_0xb8cb[_0x56dd52];return _0x5aa4c2;};'use strict';var _=require(_0xbb8c('0x0'));var passport=require(_0xbb8c('0x1'));var GoogleStrategy=require(_0xbb8c('0x2'))[_0xbb8c('0x3')];var db=require(_0xbb8c('0x4'))['db'];var config=require(_0xbb8c('0x5'));var signToken=require(_0xbb8c('0x6'))['signToken'];exports[_0xbb8c('0x7')]=passport[_0xbb8c('0x8')]('google',{'failureRedirect':'/login','scope':[_0xbb8c('0x9'),_0xbb8c('0xa')],'session':![]});exports[_0xbb8c('0xb')]=passport['authenticate'](_0xbb8c('0xc'),{'failureRedirect':_0xbb8c('0xd'),'session':![]});passport[_0xbb8c('0xe')](new GoogleStrategy({'clientID':config[_0xbb8c('0xc')]?config[_0xbb8c('0xc')][_0xbb8c('0xf')]:'id','clientSecret':config[_0xbb8c('0xc')]?config[_0xbb8c('0xc')][_0xbb8c('0x10')]:_0xbb8c('0x11'),'callbackURL':config[_0xbb8c('0xc')]?config[_0xbb8c('0xc')]['callbackURL']:''},function(_0x43367b,_0x179a2f,_0x14eeab,_0x316daa){db[_0xbb8c('0x12')]['find']({'where':{'email':_[_0xbb8c('0x13')](_0x14eeab[_0xbb8c('0x14')],_0xbb8c('0x15')),'role':{'$or':[_0xbb8c('0x16'),_0xbb8c('0x17'),_0xbb8c('0x18')]}}})[_0xbb8c('0x19')](function(_0x47c7c2){if(_0x47c7c2){return _0x316daa(null,_0x47c7c2);}_0x316daa(_0xbb8c('0x1a'));})[_0xbb8c('0x1b')](function(_0x425891){_0x316daa(_0x425891);});}));
\ No newline at end of file
index 59c0d3b..9516a19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf381=['express','passport','Router','./authGoogle.controller','../../components/auth/service','get','/callback','callback','exports'];(function(_0xecb381,_0x4fe46d){var _0x5e79c3=function(_0x47819c){while(--_0x47819c){_0xecb381['push'](_0xecb381['shift']());}};_0x5e79c3(++_0x4fe46d);}(_0xf381,0x1b0));var _0x1f38=function(_0x1cfe91,_0x3a79b0){_0x1cfe91=_0x1cfe91-0x0;var _0x54180c=_0xf381[_0x1cfe91];return _0x54180c;};'use strict';var express=require(_0x1f38('0x0'));var passport=require(_0x1f38('0x1'));var router=express[_0x1f38('0x2')]();var controller=require(_0x1f38('0x3'));var setTokenCookie=require(_0x1f38('0x4'))['setTokenCookie'];router['get']('/',controller['login']);router[_0x1f38('0x5')](_0x1f38('0x6'),controller[_0x1f38('0x7')],setTokenCookie);module[_0x1f38('0x8')]=router;
\ No newline at end of file
+var _0xe853=['Router','./authGoogle.controller','get','login','/callback','exports','express','passport'];(function(_0x46699d,_0xf012a4){var _0x4ed9f4=function(_0x481a51){while(--_0x481a51){_0x46699d['push'](_0x46699d['shift']());}};_0x4ed9f4(++_0xf012a4);}(_0xe853,0xee));var _0x3e85=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xe853[_0x501510];return _0x1e6ee5;};'use strict';var express=require(_0x3e85('0x0'));var passport=require(_0x3e85('0x1'));var router=express[_0x3e85('0x2')]();var controller=require(_0x3e85('0x3'));var setTokenCookie=require('../../components/auth/service')['setTokenCookie'];router[_0x3e85('0x4')]('/',controller[_0x3e85('0x5')]);router[_0x3e85('0x4')](_0x3e85('0x6'),controller['callback'],setTokenCookie);module[_0x3e85('0x7')]=router;
\ No newline at end of file
index b779062..262e672 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf129=['../../components/auth/service','signToken','role','agent','count','../../config/license/util','then','agents','catch','find','admin','user','authenticate','This\x20password\x20is\x20not\x20correct.','name','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','merge','\x22%s\x22\x20<%s>','request','SendMail','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','stringify','send','message','local','json','online','forgot','body','generate','toLowerCase','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','http://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','User','params','token','password','save','Password\x20reset!','use','util','passport-local','Strategy','bluebird','jayson/promise','lodash','../../config/logger','api','../../mysqldb'];(function(_0x47d835,_0x17569c){var _0x437f34=function(_0x229e3d){while(--_0x229e3d){_0x47d835['push'](_0x47d835['shift']());}};_0x437f34(++_0x17569c);}(_0xf129,0x85));var _0x9f12=function(_0x142213,_0x3c295e){_0x142213=_0x142213-0x0;var _0x1d18df=_0xf129[_0x142213];return _0x1d18df;};'use strict';var util=require(_0x9f12('0x0'));var passport=require('passport');var LocalStrategy=require(_0x9f12('0x1'))[_0x9f12('0x2')];var BPromise=require(_0x9f12('0x3'));var jayson=require(_0x9f12('0x4'));var _=require(_0x9f12('0x5'));var logger=require(_0x9f12('0x6'))(_0x9f12('0x7'));var rs=require('randomstring');var db=require(_0x9f12('0x8'))['db'];var signToken=require(_0x9f12('0x9'))[_0x9f12('0xa')];var client=jayson['client']['http']({'port':0x232b});var getLicense=function(_0x43809d){return new BPromise(function(_0x1c93c9,_0x23d232){var _0x4ebac1=0x0;_0x43809d[_0x9f12('0xb')]!==_0x9f12('0xc')&&_0x1c93c9(_0x43809d);return db['User'][_0x9f12('0xd')]({'where':{'role':_0x9f12('0xc'),'online':!![],'id':{'$ne':_0x43809d['id']}}})['then'](function(_0x26b70d){_0x4ebac1=_0x26b70d;return require(_0x9f12('0xe'))['getLicense']();})[_0x9f12('0xf')](function(_0x26a18d){if(_0x26a18d&&_0x26a18d[_0x9f12('0x10')]&&_0x4ebac1>=_0x26a18d[_0x9f12('0x10')]){return _0x23d232({'message':'Maximum\x20login\x20has\x20been\x20reached'});}return _0x1c93c9(_0x43809d);})[_0x9f12('0x11')](function(_0xb3167b){return _0x23d232(_0xb3167b);});});};function localAuthenticate(_0x15e41f,_0x430dbe,_0x2fef28,_0x545554){var _0x217743;_0x15e41f[_0x9f12('0x12')]({'where':{'name':_0x430dbe['trim'](),'role':{'$or':[_0x9f12('0x13'),_0x9f12('0x14'),_0x9f12('0xc')]}}})[_0x9f12('0xf')](function(_0x349968){if(!_0x349968){return _0x545554(null,![],{'message':'This\x20name\x20is\x20not\x20registered.'});}return getLicense(_0x349968);})[_0x9f12('0xf')](function(_0x20111a){_0x20111a[_0x9f12('0x15')](_0x2fef28,function(_0x50e778,_0x32b9cd){if(_0x50e778){return _0x545554(_0x50e778);}if(!_0x32b9cd){return _0x545554(null,![],{'message':_0x9f12('0x16')});}else{return _0x545554(null,_0x20111a);}});})[_0x9f12('0x11')](function(_0x3705fc){_0x545554(_0x3705fc);});}function sendServiceMail(_0x21efcd){return db['MailAccount'][_0x9f12('0x12')]({'where':{'service':!![]},'attributes':['id',_0x9f12('0x17'),_0x9f12('0x18')],'include':[{'model':db[_0x9f12('0x19')],'as':_0x9f12('0x1a')}]})[_0x9f12('0xf')](function(_0x32b4ec){if(!_0x32b4ec){throw new Error(_0x9f12('0x1b'));}var _0x6e523a={'tls':{'rejectUnauthorized':![]}};if(_0x32b4ec[_0x9f12('0x1a')][_0x9f12('0x1c')]){_0x6e523a['service']=_0x32b4ec['Smtp']['service'];}else{_0x6e523a[_0x9f12('0x1d')]=_0x32b4ec[_0x9f12('0x1a')]['host'];_0x6e523a[_0x9f12('0x1e')]=_0x32b4ec[_0x9f12('0x1a')][_0x9f12('0x1e')];_0x6e523a[_0x9f12('0x1f')]=_0x32b4ec['Smtp'][_0x9f12('0x1f')];}if(_0x32b4ec[_0x9f12('0x1a')][_0x9f12('0x20')]){_0x6e523a[_0x9f12('0x21')]={'user':_0x32b4ec[_0x9f12('0x1a')][_0x9f12('0x14')],'pass':_0x32b4ec[_0x9f12('0x1a')]['pass']};}var _0x303747={'account':_0x6e523a,'message':_[_0x9f12('0x22')]({'from':util['format'](_0x9f12('0x23'),_0x32b4ec[_0x9f12('0x17')],_0x32b4ec['email']||_0x32b4ec[_0x9f12('0x1a')][_0x9f12('0x14')])},_0x21efcd)};return client[_0x9f12('0x24')](_0x9f12('0x25'),_0x303747);})[_0x9f12('0xf')](function(_0x7f60a){if(_0x7f60a['error']){throw new Error(util[_0x9f12('0x26')](_0x9f12('0x27'),_0x7f60a[_0x9f12('0x28')]['message']||JSON[_0x9f12('0x29')](_0x7f60a[_0x9f12('0x28')])));}return!![];});}function handleError(_0xb479bf,_0x43833e,_0xb1a806){return _0xb479bf['status'](_0x43833e||0x1f4)[_0x9f12('0x2a')]({'message':_0xb1a806?_0xb1a806[_0x9f12('0x2b')]||_0xb1a806:''});}exports['login']=function(_0x245011,_0x36c8b7,_0x477fe1){passport['authenticate'](_0x9f12('0x2c'),function(_0x988b7f,_0x4c89b8,_0x4cf7aa){var _0x1100f2=_0x988b7f||_0x4cf7aa;if(_0x1100f2){return handleError(_0x36c8b7,0x191,_0x1100f2);}if(!_0x4c89b8){return handleError(_0x36c8b7,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}var _0x5a6c5f=signToken(_0x4c89b8['id'],_0x4c89b8[_0x9f12('0xb')]);_0x36c8b7[_0x9f12('0x2d')]({'id':_0x4c89b8['id'],'token':_0x5a6c5f,'statusCall':'','isAlreadyLogged':_0x4c89b8[_0x9f12('0x2e')]});})(_0x245011,_0x36c8b7,_0x477fe1);};exports[_0x9f12('0x2f')]=function(_0x10cd72,_0x518d99,_0x5be447){if(!_0x10cd72[_0x9f12('0x30')][_0x9f12('0x18')]){return handleError(_0x518d99,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x5d6e4d=rs[_0x9f12('0x31')]();_0x10cd72[_0x9f12('0x30')][_0x9f12('0x18')]=_0x10cd72['body'][_0x9f12('0x18')]['trim']()[_0x9f12('0x32')]();return db['User']['find']({'where':{'email':_0x10cd72[_0x9f12('0x30')][_0x9f12('0x18')]}})[_0x9f12('0xf')](function(_0xb05d7e){if(!_0xb05d7e){throw new Error(_0x9f12('0x33'));}_0xb05d7e[_0x9f12('0x34')]=_0x5d6e4d;_0xb05d7e[_0x9f12('0x35')]=Date[_0x9f12('0x36')]()+0x36ee80;return _0xb05d7e['save']();})[_0x9f12('0xf')](function(){return sendServiceMail({'to':_0x10cd72[_0x9f12('0x30')][_0x9f12('0x18')],'subject':_0x9f12('0x37'),'text':_0x9f12('0x38')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x9f12('0x39')+_0x10cd72[_0x9f12('0x3a')]['host']+_0x9f12('0x3b')+_0x5d6e4d+'\x0a\x0a'+_0x9f12('0x3c')});})['then'](function(){_0x518d99[_0x9f12('0x3d')](0xc8)[_0x9f12('0x2a')]({'message':_0x9f12('0x3e')});})[_0x9f12('0x11')](function(_0x37d20c){return handleError(_0x518d99,0x1f4,_0x37d20c);});};exports[_0x9f12('0x3f')]=function(_0x3e7688,_0x26ff52,_0x84d652){return db[_0x9f12('0x40')][_0x9f12('0x12')]({'where':{'resetPasswordToken':_0x3e7688[_0x9f12('0x41')][_0x9f12('0x42')],'resetPasswordExpires':{'$gt':Date[_0x9f12('0x36')]()}}})['then'](function(_0x249747){if(!_0x249747){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}_0x249747[_0x9f12('0x43')]=_0x3e7688[_0x9f12('0x30')][_0x9f12('0x43')];_0x249747[_0x9f12('0x34')]=null;_0x249747[_0x9f12('0x35')]=null;return _0x249747[_0x9f12('0x44')]();})[_0x9f12('0xf')](function(){_0x26ff52['status'](0xc8)[_0x9f12('0x2a')]({'message':_0x9f12('0x45')});})[_0x9f12('0x11')](function(_0x5abf49){return handleError(_0x26ff52,0x1f4,_0x5abf49);});};passport[_0x9f12('0x46')](new LocalStrategy({'usernameField':_0x9f12('0x17'),'passwordField':_0x9f12('0x43')},function(_0x414a42,_0x5b6970,_0x1d6b68){return localAuthenticate(db[_0x9f12('0x40')],_0x414a42,_0x5b6970,_0x1d6b68);}));
\ No newline at end of file
+var _0x1596=['find','admin','This\x20name\x20is\x20not\x20registered.','authenticate','MailAccount','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','name','user','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','stringify','status','send','message','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','Email\x20parameter\x20is\x20missing','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','resetPasswordExpires','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','password','save','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','../../config/logger','api','randomstring','../../mysqldb','signToken','client','role','agent','../../config/license/util','getLicense','then','agents','catch'];(function(_0x1a31e0,_0x21cce4){var _0x2c4370=function(_0x585652){while(--_0x585652){_0x1a31e0['push'](_0x1a31e0['shift']());}};_0x2c4370(++_0x21cce4);}(_0x1596,0x10e));var _0x6159=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x1596[_0xfae23b];return _0x200640;};'use strict';var util=require(_0x6159('0x0'));var passport=require('passport');var LocalStrategy=require(_0x6159('0x1'))[_0x6159('0x2')];var BPromise=require('bluebird');var jayson=require(_0x6159('0x3'));var _=require(_0x6159('0x4'));var logger=require(_0x6159('0x5'))(_0x6159('0x6'));var rs=require(_0x6159('0x7'));var db=require(_0x6159('0x8'))['db'];var signToken=require('../../components/auth/service')[_0x6159('0x9')];var client=jayson[_0x6159('0xa')]['http']({'port':0x232b});var getLicense=function(_0x34f1e4){return new BPromise(function(_0x5c852c,_0x2e986b){var _0x4fc059=0x0;_0x34f1e4[_0x6159('0xb')]!==_0x6159('0xc')&&_0x5c852c(_0x34f1e4);return db['User']['count']({'where':{'role':_0x6159('0xc'),'online':!![],'id':{'$ne':_0x34f1e4['id']}}})['then'](function(_0x4b6d90){_0x4fc059=_0x4b6d90;return require(_0x6159('0xd'))[_0x6159('0xe')]();})[_0x6159('0xf')](function(_0x26eaf4){if(_0x26eaf4&&_0x26eaf4[_0x6159('0x10')]&&_0x4fc059>=_0x26eaf4['agents']){return _0x2e986b({'message':'Maximum\x20login\x20has\x20been\x20reached'});}return _0x5c852c(_0x34f1e4);})[_0x6159('0x11')](function(_0x31852e){return _0x2e986b(_0x31852e);});});};function localAuthenticate(_0x4bd030,_0x5f02a2,_0x16751b,_0x5dfd36){var _0x2b666f;_0x4bd030[_0x6159('0x12')]({'where':{'name':_0x5f02a2['trim'](),'role':{'$or':[_0x6159('0x13'),'user',_0x6159('0xc')]}}})[_0x6159('0xf')](function(_0x1cfb7a){if(!_0x1cfb7a){return _0x5dfd36(null,![],{'message':_0x6159('0x14')});}return getLicense(_0x1cfb7a);})[_0x6159('0xf')](function(_0x4264ce){_0x4264ce[_0x6159('0x15')](_0x16751b,function(_0x167add,_0x228cb6){if(_0x167add){return _0x5dfd36(_0x167add);}if(!_0x228cb6){return _0x5dfd36(null,![],{'message':'This\x20password\x20is\x20not\x20correct.'});}else{return _0x5dfd36(null,_0x4264ce);}});})[_0x6159('0x11')](function(_0x382d46){_0x5dfd36(_0x382d46);});}function sendServiceMail(_0x306bc2){return db[_0x6159('0x16')]['find']({'where':{'service':!![]},'attributes':['id','name',_0x6159('0x17')],'include':[{'model':db[_0x6159('0x18')],'as':_0x6159('0x19')}]})[_0x6159('0xf')](function(_0x395728){if(!_0x395728){throw new Error(_0x6159('0x1a'));}var _0x18483a={'tls':{'rejectUnauthorized':![]}};if(_0x395728[_0x6159('0x19')]['service']){_0x18483a[_0x6159('0x1b')]=_0x395728[_0x6159('0x19')][_0x6159('0x1b')];}else{_0x18483a[_0x6159('0x1c')]=_0x395728['Smtp'][_0x6159('0x1c')];_0x18483a[_0x6159('0x1d')]=_0x395728['Smtp'][_0x6159('0x1d')];_0x18483a['secure']=_0x395728['Smtp'][_0x6159('0x1e')];}if(_0x395728[_0x6159('0x19')][_0x6159('0x1f')]){_0x18483a[_0x6159('0x20')]={'user':_0x395728[_0x6159('0x19')]['user'],'pass':_0x395728[_0x6159('0x19')][_0x6159('0x21')]};}var _0xf9656f={'account':_0x18483a,'message':_[_0x6159('0x22')]({'from':util[_0x6159('0x23')]('\x22%s\x22\x20<%s>',_0x395728[_0x6159('0x24')],_0x395728[_0x6159('0x17')]||_0x395728['Smtp'][_0x6159('0x25')])},_0x306bc2)};return client['request'](_0x6159('0x26'),_0xf9656f);})[_0x6159('0xf')](function(_0x294cc2){if(_0x294cc2['error']){throw new Error(util['format'](_0x6159('0x27'),_0x294cc2[_0x6159('0x28')]['message']||JSON[_0x6159('0x29')](_0x294cc2[_0x6159('0x28')])));}return!![];});}function handleError(_0x406095,_0x345d28,_0x53c516){return _0x406095[_0x6159('0x2a')](_0x345d28||0x1f4)[_0x6159('0x2b')]({'message':_0x53c516?_0x53c516[_0x6159('0x2c')]||_0x53c516:''});}exports[_0x6159('0x2d')]=function(_0x368574,_0x57a5ea,_0x3c144f){passport[_0x6159('0x15')](_0x6159('0x2e'),function(_0x191308,_0x3e383d,_0x4c5dd8){var _0x43d84e=_0x191308||_0x4c5dd8;if(_0x43d84e){return handleError(_0x57a5ea,0x191,_0x43d84e);}if(!_0x3e383d){return handleError(_0x57a5ea,0x194,{'message':_0x6159('0x2f')});}var _0x4dd9db=signToken(_0x3e383d['id'],_0x3e383d['role']);_0x57a5ea[_0x6159('0x30')]({'id':_0x3e383d['id'],'token':_0x4dd9db,'statusCall':'','isAlreadyLogged':_0x3e383d[_0x6159('0x31')]});})(_0x368574,_0x57a5ea,_0x3c144f);};exports[_0x6159('0x32')]=function(_0x2242b6,_0x17be34,_0x4ffa60){if(!_0x2242b6['body'][_0x6159('0x17')]){return handleError(_0x17be34,0x1f4,{'message':_0x6159('0x33')});}var _0x13bcb7=rs['generate']();_0x2242b6[_0x6159('0x34')]['email']=_0x2242b6[_0x6159('0x34')][_0x6159('0x17')][_0x6159('0x35')]()[_0x6159('0x36')]();return db[_0x6159('0x37')][_0x6159('0x12')]({'where':{'email':_0x2242b6[_0x6159('0x34')][_0x6159('0x17')]}})[_0x6159('0xf')](function(_0x2615c0){if(!_0x2615c0){throw new Error(_0x6159('0x38'));}_0x2615c0[_0x6159('0x39')]=_0x13bcb7;_0x2615c0[_0x6159('0x3a')]=Date['now']()+0x36ee80;return _0x2615c0['save']();})[_0x6159('0xf')](function(){return sendServiceMail({'to':_0x2242b6['body'][_0x6159('0x17')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x6159('0x3b')+_0x6159('0x3c')+_0x2242b6[_0x6159('0x3d')][_0x6159('0x1c')]+'/reset/'+_0x13bcb7+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x6159('0xf')](function(){_0x17be34[_0x6159('0x2a')](0xc8)['send']({'message':_0x6159('0x3e')});})[_0x6159('0x11')](function(_0x30a306){return handleError(_0x17be34,0x1f4,_0x30a306);});};exports[_0x6159('0x3f')]=function(_0x553170,_0x25bc1e,_0x3438c8){return db[_0x6159('0x37')]['find']({'where':{'resetPasswordToken':_0x553170[_0x6159('0x40')][_0x6159('0x41')],'resetPasswordExpires':{'$gt':Date[_0x6159('0x42')]()}}})[_0x6159('0xf')](function(_0x2ff42c){if(!_0x2ff42c){throw new Error(_0x6159('0x43'));}_0x2ff42c[_0x6159('0x44')]=_0x553170['body'][_0x6159('0x44')];_0x2ff42c[_0x6159('0x39')]=null;_0x2ff42c[_0x6159('0x3a')]=null;return _0x2ff42c[_0x6159('0x45')]();})[_0x6159('0xf')](function(){_0x25bc1e[_0x6159('0x2a')](0xc8)[_0x6159('0x2b')]({'message':_0x6159('0x46')});})[_0x6159('0x11')](function(_0x5df9fd){return handleError(_0x25bc1e,0x1f4,_0x5df9fd);});};passport[_0x6159('0x47')](new LocalStrategy({'usernameField':'name','passwordField':_0x6159('0x44')},function(_0x43a1d7,_0x3fe4dd,_0x4ff29a){return localAuthenticate(db[_0x6159('0x37')],_0x43a1d7,_0x3fe4dd,_0x4ff29a);}));
\ No newline at end of file
index 4330b8a..26f1908 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9371=['/reset/:token','reset','exports','express','post'];(function(_0x254aad,_0x420eff){var _0x22c41d=function(_0xd5417){while(--_0xd5417){_0x254aad['push'](_0x254aad['shift']());}};_0x22c41d(++_0x420eff);}(_0x9371,0x11b));var _0x1937=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9371[_0x122ef9];return _0x42fba0;};'use strict';var express=require(_0x1937('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0x1937('0x1')]('/',controller['login']);router['post']('/forgot',controller['forgot']);router[_0x1937('0x1')](_0x1937('0x2'),controller[_0x1937('0x3')]);module[_0x1937('0x4')]=router;
\ No newline at end of file
+var _0x69c4=['exports','express','./authLocal.controller','post','login','/reset/:token'];(function(_0x31103f,_0x4f6640){var _0x5b9ee9=function(_0x3a81f9){while(--_0x3a81f9){_0x31103f['push'](_0x31103f['shift']());}};_0x5b9ee9(++_0x4f6640);}(_0x69c4,0x6d));var _0x469c=function(_0x33baa6,_0x3ce48e){_0x33baa6=_0x33baa6-0x0;var _0x4be1ef=_0x69c4[_0x33baa6];return _0x4be1ef;};'use strict';var express=require(_0x469c('0x0'));var router=express['Router']();var controller=require(_0x469c('0x1'));router[_0x469c('0x2')]('/',controller[_0x469c('0x3')]);router[_0x469c('0x2')]('/forgot',controller['forgot']);router[_0x469c('0x2')](_0x469c('0x4'),controller['reset']);module[_0x469c('0x5')]=router;
\ No newline at end of file
index 60c8b04..6fc6dcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc434=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x26b462,_0x4a2fe2){var _0x5050af=function(_0xf22d68){while(--_0xf22d68){_0x26b462['push'](_0x26b462['shift']());}};_0x5050af(++_0x4a2fe2);}(_0xc434,0x16b));var _0x4c43=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xc434[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0x4c43('0x0'));module[_0x4c43('0x1')]={'name':{'type':Sequelize[_0x4c43('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x4c43('0x2')]},'description':{'type':Sequelize[_0x4c43('0x2')]},'status':{'type':Sequelize[_0x4c43('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x4c43('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x854f=['BOOLEAN','sequelize','exports','STRING'];(function(_0x736627,_0x3e80a1){var _0x92661b=function(_0x578cb5){while(--_0x578cb5){_0x736627['push'](_0x736627['shift']());}};_0x92661b(++_0x3e80a1);}(_0x854f,0xc1));var _0xf854=function(_0x193d29,_0x5bc061){_0x193d29=_0x193d29-0x0;var _0x46beeb=_0x854f[_0x193d29];return _0x46beeb;};'use strict';var Sequelize=require(_0xf854('0x0'));module[_0xf854('0x1')]={'name':{'type':Sequelize[_0xf854('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xf854('0x2')]},'description':{'type':Sequelize[_0xf854('0x2')]},'status':{'type':Sequelize[_0xf854('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
index 8884a1d..55c31d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcf0=['path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','Automation','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','add','filter','where','map','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','addConditions','Condition','ids','getConditions','findOne','length','Action','getActions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x5c049a,_0x2c1263){var _0x168e70=function(_0x49441e){while(--_0x49441e){_0x5c049a['push'](_0x5c049a['shift']());}};_0x168e70(++_0x2c1263);}(_0xfcf0,0x138));var _0x0fcf=function(_0x401d67,_0xeb1592){_0x401d67=_0x401d67-0x0;var _0x25076b=_0xfcf0[_0x401d67];return _0x25076b;};'use strict';var pdf=require(_0x0fcf('0x0'));var emlformat=require(_0x0fcf('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0fcf('0x2'));var jsonpatch=require(_0x0fcf('0x3'));var rp=require(_0x0fcf('0x4'));var moment=require(_0x0fcf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0fcf('0x6'));var util=require(_0x0fcf('0x7'));var path=require(_0x0fcf('0x8'));var sox=require(_0x0fcf('0x9'));var csv=require(_0x0fcf('0xa'));var ejs=require(_0x0fcf('0xb'));var fs=require('fs');var _=require(_0x0fcf('0xc'));var squel=require(_0x0fcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fcf('0xe'));var deskjs=require(_0x0fcf('0xf'));var toCsv=require(_0x0fcf('0xa'));var querystring=require('querystring');var Papa=require(_0x0fcf('0x10'));var qs=require(_0x0fcf('0x11'));var logger=require(_0x0fcf('0x12'))('api');var utils=require(_0x0fcf('0x13'));var config=require('../../config/environment');var db=require(_0x0fcf('0x14'))['db'];function respondWithStatusCode(_0x2317cf,_0x201a58){_0x201a58=_0x201a58||0xcc;return function(_0x48619c){if(_0x48619c){return _0x2317cf['sendStatus'](_0x201a58);}return _0x2317cf[_0x0fcf('0x15')](_0x201a58)[_0x0fcf('0x16')]();};}function respondWithResult(_0x4b4904,_0x20153d){_0x20153d=_0x20153d||0xc8;return function(_0x4031ad){if(_0x4031ad){return _0x4b4904[_0x0fcf('0x15')](_0x20153d)[_0x0fcf('0x17')](_0x4031ad);}};}function respondWithFilteredResult(_0x25fadc,_0x48bba6){return function(_0xa32692){if(_0xa32692){var _0x3701c9=_0xa32692[_0x0fcf('0x18')],_0x1fcb47=_0x48bba6[_0x0fcf('0x19')],_0x5e867f=_0x48bba6[_0x0fcf('0x19')]+_0x48bba6['limit'],_0x3c09c4;if(_0x5e867f>=_0x3701c9){_0x5e867f=_0x3701c9;_0x3c09c4=0xc8;}else{_0x3c09c4=0xce;}_0x25fadc[_0x0fcf('0x15')](_0x3c09c4);return _0x25fadc[_0x0fcf('0x1a')](_0x0fcf('0x1b'),_0x1fcb47+'-'+_0x5e867f+'/'+_0x3701c9)[_0x0fcf('0x17')](_0xa32692);}return null;};}function patchUpdates(_0x19cfbd){return function(_0x567320){try{jsonpatch[_0x0fcf('0x1c')](_0x567320,_0x19cfbd,!![]);}catch(_0x1a8f58){return BPromise['reject'](_0x1a8f58);}return _0x567320[_0x0fcf('0x1d')]();};}function saveUpdates(_0x1b9a90,_0x4da7e3){return function(_0x2022e1){if(_0x2022e1){return _0x2022e1['update'](_0x1b9a90)[_0x0fcf('0x1e')](function(_0x13454e){return _0x13454e;});}return null;};}function removeEntity(_0x5c8279,_0x457880){return function(_0x3f28d0){if(_0x3f28d0){return _0x3f28d0[_0x0fcf('0x1f')]()['then'](function(){_0x5c8279[_0x0fcf('0x15')](0xcc)[_0x0fcf('0x16')]();});}};}function handleEntityNotFound(_0x196d30,_0x41b20b){return function(_0x18af5c){if(!_0x18af5c){_0x196d30[_0x0fcf('0x20')](0x194);}return _0x18af5c;};}function handleError(_0x5841a9,_0x2eef74){_0x2eef74=_0x2eef74||0x1f4;return function(_0x253641){logger[_0x0fcf('0x21')](_0x253641[_0x0fcf('0x22')]);if(_0x253641[_0x0fcf('0x23')]){delete _0x253641[_0x0fcf('0x23')];}_0x5841a9[_0x0fcf('0x15')](_0x2eef74)[_0x0fcf('0x24')](_0x253641);};}exports[_0x0fcf('0x25')]=function(_0x588685,_0x18965e){var _0xc107a={},_0x41b7a2={},_0x2f198b={'count':0x0,'rows':[]};var _0x3876ed=db[_0x0fcf('0x26')][_0x0fcf('0x27')];_0x41b7a2['model']=_[_0x0fcf('0x28')](_0x3876ed);var _0xbaa4d8={'dateStart':_0x588685[_0x0fcf('0x29')][_0x0fcf('0x2a')],'dateEnd':_0x588685['query']['dateEnd']};delete _0x588685['query'][_0x0fcf('0x2a')];delete _0x588685['query'][_0x0fcf('0x2b')];_0x41b7a2[_0x0fcf('0x29')]=_['keys'](_0x588685[_0x0fcf('0x29')]);_0x41b7a2[_0x0fcf('0x2c')]=_[_0x0fcf('0x2d')](_0x41b7a2[_0x0fcf('0x2e')],_0x41b7a2[_0x0fcf('0x29')]);_0xc107a[_0x0fcf('0x2f')]=_['intersection'](_0x41b7a2[_0x0fcf('0x2e')],qs[_0x0fcf('0x30')](_0x588685[_0x0fcf('0x29')][_0x0fcf('0x30')]));_0xc107a[_0x0fcf('0x2f')]=_0xc107a[_0x0fcf('0x2f')]['length']?_0xc107a[_0x0fcf('0x2f')]:_0x41b7a2[_0x0fcf('0x2e')];if(!_0x588685[_0x0fcf('0x29')][_0x0fcf('0x31')](_0x0fcf('0x32'))){_0xc107a[_0x0fcf('0x33')]=qs[_0x0fcf('0x33')](_0x588685[_0x0fcf('0x29')][_0x0fcf('0x33')]);_0xc107a[_0x0fcf('0x19')]=qs[_0x0fcf('0x19')](_0x588685[_0x0fcf('0x29')][_0x0fcf('0x19')]);}_0xc107a[_0x0fcf('0x34')]=qs['sort'](_0x588685['query'][_0x0fcf('0x35')]);_0xc107a['where']=qs['filters'](_[_0x0fcf('0x36')](_0x588685[_0x0fcf('0x29')],_0x41b7a2[_0x0fcf('0x2c')]));if(_0xbaa4d8['dateStart']){if(_0xbaa4d8['dateEnd']){_0xbaa4d8[_0x0fcf('0x2b')]=moment(_0xbaa4d8[_0x0fcf('0x2b')])[_0x0fcf('0x37')](0x1,'day');}else{_0xbaa4d8[_0x0fcf('0x2b')]=moment(_0xbaa4d8[_0x0fcf('0x2a')])[_0x0fcf('0x37')](0x1,'day');}_['merge'](_0xc107a['where'],{'createdAt':{'$gte':_0xbaa4d8[_0x0fcf('0x2a')],'$lte':_0xbaa4d8[_0x0fcf('0x2b')]}});}if(_0x588685[_0x0fcf('0x29')][_0x0fcf('0x38')]){_0xc107a[_0x0fcf('0x39')]=_['merge'](_0xc107a[_0x0fcf('0x39')],{'$or':_[_0x0fcf('0x3a')](_0xc107a[_0x0fcf('0x2f')],function(_0x4cbc84){var _0x4edc5d={};_0x4edc5d[_0x4cbc84]={'$like':'%'+_0x588685[_0x0fcf('0x29')][_0x0fcf('0x38')]+'%'};return _0x4edc5d;})});}_0xc107a=_[_0x0fcf('0x3b')]({},_0xc107a,_0x588685[_0x0fcf('0x3c')]);var _0x43e0f9={'where':_0xc107a['where']};return db[_0x0fcf('0x26')][_0x0fcf('0x18')](_0x43e0f9)[_0x0fcf('0x1e')](function(_0x11134c){_0x2f198b['count']=_0x11134c;if(_0x588685['query'][_0x0fcf('0x3d')]){_0xc107a[_0x0fcf('0x3e')]=[{'all':!![]}];}return db['Automation'][_0x0fcf('0x3f')](_0xc107a);})[_0x0fcf('0x1e')](function(_0x536171){_0x2f198b[_0x0fcf('0x40')]=_0x536171;return _0x2f198b;})[_0x0fcf('0x1e')](respondWithFilteredResult(_0x18965e,_0xc107a))[_0x0fcf('0x41')](handleError(_0x18965e,null));};exports[_0x0fcf('0x42')]=function(_0x3f99d5,_0x5efc41){var _0x30dbda={'raw':![],'where':{'id':_0x3f99d5['params']['id']}},_0x4f89da={};_0x4f89da['model']=_[_0x0fcf('0x28')](db['Automation']['rawAttributes']);_0x4f89da[_0x0fcf('0x29')]=_[_0x0fcf('0x28')](_0x3f99d5[_0x0fcf('0x29')]);_0x4f89da[_0x0fcf('0x2c')]=_[_0x0fcf('0x2d')](_0x4f89da[_0x0fcf('0x2e')],_0x4f89da[_0x0fcf('0x29')]);_0x30dbda[_0x0fcf('0x2f')]=_[_0x0fcf('0x2d')](_0x4f89da[_0x0fcf('0x2e')],qs['fields'](_0x3f99d5[_0x0fcf('0x29')][_0x0fcf('0x30')]));_0x30dbda[_0x0fcf('0x2f')]=_0x30dbda['attributes']['length']?_0x30dbda[_0x0fcf('0x2f')]:_0x4f89da[_0x0fcf('0x2e')];if(_0x3f99d5[_0x0fcf('0x29')][_0x0fcf('0x3d')]){_0x30dbda['include']=[{'all':!![]}];}_0x30dbda=_['merge']({},_0x30dbda,_0x3f99d5[_0x0fcf('0x3c')]);return db[_0x0fcf('0x26')][_0x0fcf('0x43')](_0x30dbda)[_0x0fcf('0x1e')](handleEntityNotFound(_0x5efc41,null))[_0x0fcf('0x1e')](respondWithResult(_0x5efc41,null))[_0x0fcf('0x41')](handleError(_0x5efc41,null));};exports[_0x0fcf('0x44')]=function(_0xc7ae,_0x4c4f56){return db['Automation'][_0x0fcf('0x44')](_0xc7ae[_0x0fcf('0x45')],{})[_0x0fcf('0x1e')](respondWithResult(_0x4c4f56,0xc9))[_0x0fcf('0x41')](handleError(_0x4c4f56,null));};exports[_0x0fcf('0x46')]=function(_0x381a7f,_0x5dbd03){if(_0x381a7f[_0x0fcf('0x45')]['id']){delete _0x381a7f[_0x0fcf('0x45')]['id'];}return db['Automation'][_0x0fcf('0x43')]({'where':{'id':_0x381a7f[_0x0fcf('0x47')]['id']}})[_0x0fcf('0x1e')](handleEntityNotFound(_0x5dbd03,null))[_0x0fcf('0x1e')](saveUpdates(_0x381a7f['body'],null))[_0x0fcf('0x1e')](respondWithResult(_0x5dbd03,null))[_0x0fcf('0x41')](handleError(_0x5dbd03,null));};exports[_0x0fcf('0x1f')]=function(_0x1b5ae4,_0x41392f){return db[_0x0fcf('0x26')][_0x0fcf('0x43')]({'where':{'id':_0x1b5ae4[_0x0fcf('0x47')]['id']}})[_0x0fcf('0x1e')](handleEntityNotFound(_0x41392f,null))[_0x0fcf('0x1e')](removeEntity(_0x41392f,null))[_0x0fcf('0x41')](handleError(_0x41392f,null));};exports[_0x0fcf('0x48')]=function(_0x3b840e,_0x727fe7,_0x5c001e){return db[_0x0fcf('0x49')]['find']({'where':{'id':_0x3b840e[_0x0fcf('0x47')]['id']}})[_0x0fcf('0x1e')](handleEntityNotFound(_0x727fe7,null))[_0x0fcf('0x1e')](function(_0x3355c4){if(_0x3355c4){return _0x3355c4[_0x0fcf('0x48')](_0x3b840e['body'][_0x0fcf('0x4a')],_['omit'](_0x3b840e[_0x0fcf('0x45')],[_0x0fcf('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x727fe7,null))[_0x0fcf('0x41')](handleError(_0x727fe7,null));};exports[_0x0fcf('0x4b')]=function(_0x490cb6,_0x41288d,_0x2e9226){var _0x2e57b8={};var _0xe94027={};var _0x7b7558;var _0x4c5181;return db['Automation'][_0x0fcf('0x4c')]({'where':{'id':_0x490cb6['params']['id']}})[_0x0fcf('0x1e')](handleEntityNotFound(_0x41288d,null))[_0x0fcf('0x1e')](function(_0x5d403b){if(_0x5d403b){_0x7b7558=_0x5d403b;_0xe94027['model']=_[_0x0fcf('0x28')](db[_0x0fcf('0x49')][_0x0fcf('0x27')]);_0xe94027['query']=_[_0x0fcf('0x28')](_0x490cb6['query']);_0xe94027[_0x0fcf('0x2c')]=_[_0x0fcf('0x2d')](_0xe94027[_0x0fcf('0x2e')],_0xe94027['query']);_0x2e57b8[_0x0fcf('0x2f')]=_[_0x0fcf('0x2d')](_0xe94027[_0x0fcf('0x2e')],qs[_0x0fcf('0x30')](_0x490cb6[_0x0fcf('0x29')][_0x0fcf('0x30')]));_0x2e57b8[_0x0fcf('0x2f')]=_0x2e57b8[_0x0fcf('0x2f')][_0x0fcf('0x4d')]?_0x2e57b8[_0x0fcf('0x2f')]:_0xe94027[_0x0fcf('0x2e')];_0x2e57b8['order']=qs[_0x0fcf('0x35')](_0x490cb6[_0x0fcf('0x29')][_0x0fcf('0x35')]);_0x2e57b8[_0x0fcf('0x39')]=qs[_0x0fcf('0x2c')](_[_0x0fcf('0x36')](_0x490cb6[_0x0fcf('0x29')],_0xe94027['filters']));if(_0x490cb6['query'][_0x0fcf('0x38')]){_0x2e57b8[_0x0fcf('0x39')]=_['merge'](_0x2e57b8[_0x0fcf('0x39')],{'$or':_[_0x0fcf('0x3a')](_0x2e57b8[_0x0fcf('0x2f')],function(_0x38590f){var _0x484b9c={};_0x484b9c[_0x38590f]={'$like':'%'+_0x490cb6[_0x0fcf('0x29')][_0x0fcf('0x38')]+'%'};return _0x484b9c;})});}_0x2e57b8=_[_0x0fcf('0x3b')]({},_0x2e57b8,_0x490cb6[_0x0fcf('0x3c')]);return _0x7b7558[_0x0fcf('0x4b')](_0x2e57b8);}})[_0x0fcf('0x1e')](function(_0x51d662){if(_0x51d662){_0x4c5181=_0x51d662[_0x0fcf('0x4d')];if(!_0x490cb6[_0x0fcf('0x29')][_0x0fcf('0x31')](_0x0fcf('0x32'))){_0x2e57b8[_0x0fcf('0x33')]=qs['limit'](_0x490cb6['query'][_0x0fcf('0x33')]);_0x2e57b8[_0x0fcf('0x19')]=qs[_0x0fcf('0x19')](_0x490cb6[_0x0fcf('0x29')][_0x0fcf('0x19')]);}return _0x7b7558[_0x0fcf('0x4b')](_0x2e57b8);}})[_0x0fcf('0x1e')](function(_0x109a77){if(_0x109a77){return _0x109a77?{'count':_0x4c5181,'rows':_0x109a77}:null;}})[_0x0fcf('0x1e')](respondWithResult(_0x41288d,null))[_0x0fcf('0x41')](handleError(_0x41288d,null));};exports['addActions']=function(_0xd245dd,_0x231559,_0x1c5ec1){return db[_0x0fcf('0x4e')][_0x0fcf('0x43')]({'where':{'id':_0xd245dd[_0x0fcf('0x47')]['id']}})[_0x0fcf('0x1e')](handleEntityNotFound(_0x231559,null))[_0x0fcf('0x1e')](function(_0x166525){if(_0x166525){return _0x166525['addActions'](_0xd245dd['body']['ids'],_['omit'](_0xd245dd[_0x0fcf('0x45')],['ids','id'])||{});}})[_0x0fcf('0x1e')](respondWithResult(_0x231559,null))[_0x0fcf('0x41')](handleError(_0x231559,null));};exports[_0x0fcf('0x4f')]=function(_0x4cb1e5,_0x5ab5c6,_0x44eaac){var _0x239c9c={};var _0x590973={};var _0x105c75;var _0x3cb75a;return db['Automation'][_0x0fcf('0x4c')]({'where':{'id':_0x4cb1e5[_0x0fcf('0x47')]['id']}})[_0x0fcf('0x1e')](handleEntityNotFound(_0x5ab5c6,null))[_0x0fcf('0x1e')](function(_0x7cc9a0){if(_0x7cc9a0){_0x105c75=_0x7cc9a0;_0x590973[_0x0fcf('0x2e')]=_[_0x0fcf('0x28')](db['Action'][_0x0fcf('0x27')]);_0x590973[_0x0fcf('0x29')]=_[_0x0fcf('0x28')](_0x4cb1e5[_0x0fcf('0x29')]);_0x590973[_0x0fcf('0x2c')]=_[_0x0fcf('0x2d')](_0x590973['model'],_0x590973['query']);_0x239c9c[_0x0fcf('0x2f')]=_[_0x0fcf('0x2d')](_0x590973[_0x0fcf('0x2e')],qs[_0x0fcf('0x30')](_0x4cb1e5['query'][_0x0fcf('0x30')]));_0x239c9c[_0x0fcf('0x2f')]=_0x239c9c[_0x0fcf('0x2f')][_0x0fcf('0x4d')]?_0x239c9c[_0x0fcf('0x2f')]:_0x590973['model'];_0x239c9c['order']=qs[_0x0fcf('0x35')](_0x4cb1e5['query'][_0x0fcf('0x35')]);_0x239c9c['where']=qs[_0x0fcf('0x2c')](_[_0x0fcf('0x36')](_0x4cb1e5[_0x0fcf('0x29')],_0x590973[_0x0fcf('0x2c')]));if(_0x4cb1e5[_0x0fcf('0x29')]['filter']){_0x239c9c[_0x0fcf('0x39')]=_[_0x0fcf('0x3b')](_0x239c9c[_0x0fcf('0x39')],{'$or':_[_0x0fcf('0x3a')](_0x239c9c['attributes'],function(_0x376d26){var _0x5ba384={};_0x5ba384[_0x376d26]={'$like':'%'+_0x4cb1e5[_0x0fcf('0x29')]['filter']+'%'};return _0x5ba384;})});}_0x239c9c=_[_0x0fcf('0x3b')]({},_0x239c9c,_0x4cb1e5[_0x0fcf('0x3c')]);return _0x105c75['getActions'](_0x239c9c);}})[_0x0fcf('0x1e')](function(_0x10ed68){if(_0x10ed68){_0x3cb75a=_0x10ed68[_0x0fcf('0x4d')];if(!_0x4cb1e5['query']['hasOwnProperty']('nolimit')){_0x239c9c[_0x0fcf('0x33')]=qs['limit'](_0x4cb1e5[_0x0fcf('0x29')][_0x0fcf('0x33')]);_0x239c9c[_0x0fcf('0x19')]=qs[_0x0fcf('0x19')](_0x4cb1e5[_0x0fcf('0x29')][_0x0fcf('0x19')]);}return _0x105c75[_0x0fcf('0x4f')](_0x239c9c);}})[_0x0fcf('0x1e')](function(_0x4073be){if(_0x4073be){return _0x4073be?{'count':_0x3cb75a,'rows':_0x4073be}:null;}})['then'](respondWithResult(_0x5ab5c6,null))[_0x0fcf('0x41')](handleError(_0x5ab5c6,null));};
\ No newline at end of file
+var _0x524e=['map','options','includeAll','include','rows','catch','show','find','create','body','params','addConditions','Condition','ids','omit','findOne','filter','getConditions','nolimit','addActions','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','apply','reject','save','then','destroy','end','error','name','send','index','Automation','rawAttributes','model','keys','query','dateEnd','dateStart','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','day','add','merge'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x524e,0x15e));var _0xe524=function(_0x2f70f0,_0x57e68e){_0x2f70f0=_0x2f70f0-0x0;var _0x913658=_0x524e[_0x2f70f0];return _0x913658;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe524('0x0'));var zipdir=require(_0xe524('0x1'));var jsonpatch=require(_0xe524('0x2'));var rp=require(_0xe524('0x3'));var moment=require(_0xe524('0x4'));var BPromise=require(_0xe524('0x5'));var Mustache=require(_0xe524('0x6'));var util=require(_0xe524('0x7'));var path=require(_0xe524('0x8'));var sox=require(_0xe524('0x9'));var csv=require('to-csv');var ejs=require(_0xe524('0xa'));var fs=require('fs');var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0xf'));var querystring=require(_0xe524('0x10'));var Papa=require(_0xe524('0x11'));var qs=require(_0xe524('0x12'));var logger=require(_0xe524('0x13'))(_0xe524('0x14'));var utils=require(_0xe524('0x15'));var config=require(_0xe524('0x16'));var db=require(_0xe524('0x17'))['db'];function respondWithStatusCode(_0x2b6cbd,_0x1184df){_0x1184df=_0x1184df||0xcc;return function(_0x2f0e86){if(_0x2f0e86){return _0x2b6cbd[_0xe524('0x18')](_0x1184df);}return _0x2b6cbd[_0xe524('0x19')](_0x1184df)['end']();};}function respondWithResult(_0x4b0f51,_0xfdc2a5){_0xfdc2a5=_0xfdc2a5||0xc8;return function(_0x1541d8){if(_0x1541d8){return _0x4b0f51[_0xe524('0x19')](_0xfdc2a5)[_0xe524('0x1a')](_0x1541d8);}};}function respondWithFilteredResult(_0x20a852,_0x57c1b6){return function(_0x12ff75){if(_0x12ff75){var _0x51e9fe=_0x12ff75[_0xe524('0x1b')],_0x19f013=_0x57c1b6['offset'],_0x1b0af6=_0x57c1b6[_0xe524('0x1c')]+_0x57c1b6['limit'],_0x48165e;if(_0x1b0af6>=_0x51e9fe){_0x1b0af6=_0x51e9fe;_0x48165e=0xc8;}else{_0x48165e=0xce;}_0x20a852[_0xe524('0x19')](_0x48165e);return _0x20a852['set']('Content-Range',_0x19f013+'-'+_0x1b0af6+'/'+_0x51e9fe)['json'](_0x12ff75);}return null;};}function patchUpdates(_0x3a4027){return function(_0x4f1dfb){try{jsonpatch[_0xe524('0x1d')](_0x4f1dfb,_0x3a4027,!![]);}catch(_0x238f8f){return BPromise[_0xe524('0x1e')](_0x238f8f);}return _0x4f1dfb[_0xe524('0x1f')]();};}function saveUpdates(_0x5d7b17,_0x1fd93a){return function(_0x3ccb3f){if(_0x3ccb3f){return _0x3ccb3f['update'](_0x5d7b17)[_0xe524('0x20')](function(_0x309f85){return _0x309f85;});}return null;};}function removeEntity(_0x43a4f9,_0x1dcc0f){return function(_0x1c4194){if(_0x1c4194){return _0x1c4194[_0xe524('0x21')]()[_0xe524('0x20')](function(){_0x43a4f9[_0xe524('0x19')](0xcc)[_0xe524('0x22')]();});}};}function handleEntityNotFound(_0x5c4d21,_0x7d1f92){return function(_0x5bb00b){if(!_0x5bb00b){_0x5c4d21['sendStatus'](0x194);}return _0x5bb00b;};}function handleError(_0x2d2f83,_0x23df5e){_0x23df5e=_0x23df5e||0x1f4;return function(_0x1ad106){logger[_0xe524('0x23')](_0x1ad106['stack']);if(_0x1ad106[_0xe524('0x24')]){delete _0x1ad106['name'];}_0x2d2f83[_0xe524('0x19')](_0x23df5e)[_0xe524('0x25')](_0x1ad106);};}exports[_0xe524('0x26')]=function(_0x3cd922,_0x4102d9){var _0xfd5965={},_0x2141db={},_0x583cc3={'count':0x0,'rows':[]};var _0x58a896=db[_0xe524('0x27')][_0xe524('0x28')];_0x2141db[_0xe524('0x29')]=_[_0xe524('0x2a')](_0x58a896);var _0x359c8b={'dateStart':_0x3cd922['query']['dateStart'],'dateEnd':_0x3cd922[_0xe524('0x2b')][_0xe524('0x2c')]};delete _0x3cd922[_0xe524('0x2b')][_0xe524('0x2d')];delete _0x3cd922[_0xe524('0x2b')]['dateEnd'];_0x2141db[_0xe524('0x2b')]=_[_0xe524('0x2a')](_0x3cd922['query']);_0x2141db['filters']=_[_0xe524('0x2e')](_0x2141db[_0xe524('0x29')],_0x2141db['query']);_0xfd5965[_0xe524('0x2f')]=_['intersection'](_0x2141db[_0xe524('0x29')],qs['fields'](_0x3cd922[_0xe524('0x2b')][_0xe524('0x30')]));_0xfd5965[_0xe524('0x2f')]=_0xfd5965['attributes'][_0xe524('0x31')]?_0xfd5965['attributes']:_0x2141db[_0xe524('0x29')];if(!_0x3cd922[_0xe524('0x2b')][_0xe524('0x32')]('nolimit')){_0xfd5965[_0xe524('0x33')]=qs[_0xe524('0x33')](_0x3cd922['query'][_0xe524('0x33')]);_0xfd5965[_0xe524('0x1c')]=qs[_0xe524('0x1c')](_0x3cd922[_0xe524('0x2b')]['offset']);}_0xfd5965[_0xe524('0x34')]=qs[_0xe524('0x35')](_0x3cd922[_0xe524('0x2b')][_0xe524('0x35')]);_0xfd5965[_0xe524('0x36')]=qs[_0xe524('0x37')](_[_0xe524('0x38')](_0x3cd922[_0xe524('0x2b')],_0x2141db['filters']));if(_0x359c8b[_0xe524('0x2d')]){if(_0x359c8b['dateEnd']){_0x359c8b[_0xe524('0x2c')]=moment(_0x359c8b[_0xe524('0x2c')])['add'](0x1,_0xe524('0x39'));}else{_0x359c8b['dateEnd']=moment(_0x359c8b[_0xe524('0x2d')])[_0xe524('0x3a')](0x1,_0xe524('0x39'));}_[_0xe524('0x3b')](_0xfd5965[_0xe524('0x36')],{'createdAt':{'$gte':_0x359c8b[_0xe524('0x2d')],'$lte':_0x359c8b[_0xe524('0x2c')]}});}if(_0x3cd922[_0xe524('0x2b')]['filter']){_0xfd5965[_0xe524('0x36')]=_[_0xe524('0x3b')](_0xfd5965[_0xe524('0x36')],{'$or':_[_0xe524('0x3c')](_0xfd5965[_0xe524('0x2f')],function(_0x3885f6){var _0x1d9648={};_0x1d9648[_0x3885f6]={'$like':'%'+_0x3cd922[_0xe524('0x2b')]['filter']+'%'};return _0x1d9648;})});}_0xfd5965=_[_0xe524('0x3b')]({},_0xfd5965,_0x3cd922[_0xe524('0x3d')]);var _0x2e4a13={'where':_0xfd5965['where']};return db[_0xe524('0x27')]['count'](_0x2e4a13)[_0xe524('0x20')](function(_0x217e85){_0x583cc3[_0xe524('0x1b')]=_0x217e85;if(_0x3cd922[_0xe524('0x2b')][_0xe524('0x3e')]){_0xfd5965[_0xe524('0x3f')]=[{'all':!![]}];}return db[_0xe524('0x27')]['findAll'](_0xfd5965);})[_0xe524('0x20')](function(_0x334c99){_0x583cc3[_0xe524('0x40')]=_0x334c99;return _0x583cc3;})[_0xe524('0x20')](respondWithFilteredResult(_0x4102d9,_0xfd5965))[_0xe524('0x41')](handleError(_0x4102d9,null));};exports[_0xe524('0x42')]=function(_0x4a4a16,_0xb694b9){var _0x2982a0={'raw':![],'where':{'id':_0x4a4a16['params']['id']}},_0x3fe124={};_0x3fe124[_0xe524('0x29')]=_['keys'](db['Automation'][_0xe524('0x28')]);_0x3fe124[_0xe524('0x2b')]=_['keys'](_0x4a4a16[_0xe524('0x2b')]);_0x3fe124[_0xe524('0x37')]=_[_0xe524('0x2e')](_0x3fe124[_0xe524('0x29')],_0x3fe124['query']);_0x2982a0['attributes']=_[_0xe524('0x2e')](_0x3fe124[_0xe524('0x29')],qs['fields'](_0x4a4a16[_0xe524('0x2b')]['fields']));_0x2982a0[_0xe524('0x2f')]=_0x2982a0[_0xe524('0x2f')][_0xe524('0x31')]?_0x2982a0[_0xe524('0x2f')]:_0x3fe124[_0xe524('0x29')];if(_0x4a4a16[_0xe524('0x2b')][_0xe524('0x3e')]){_0x2982a0[_0xe524('0x3f')]=[{'all':!![]}];}_0x2982a0=_[_0xe524('0x3b')]({},_0x2982a0,_0x4a4a16[_0xe524('0x3d')]);return db[_0xe524('0x27')][_0xe524('0x43')](_0x2982a0)[_0xe524('0x20')](handleEntityNotFound(_0xb694b9,null))[_0xe524('0x20')](respondWithResult(_0xb694b9,null))[_0xe524('0x41')](handleError(_0xb694b9,null));};exports['create']=function(_0x53be1f,_0x4c06f0){return db['Automation'][_0xe524('0x44')](_0x53be1f['body'],{})[_0xe524('0x20')](respondWithResult(_0x4c06f0,0xc9))[_0xe524('0x41')](handleError(_0x4c06f0,null));};exports['update']=function(_0x20753e,_0x5c1655){if(_0x20753e['body']['id']){delete _0x20753e[_0xe524('0x45')]['id'];}return db[_0xe524('0x27')][_0xe524('0x43')]({'where':{'id':_0x20753e['params']['id']}})['then'](handleEntityNotFound(_0x5c1655,null))['then'](saveUpdates(_0x20753e['body'],null))['then'](respondWithResult(_0x5c1655,null))['catch'](handleError(_0x5c1655,null));};exports[_0xe524('0x21')]=function(_0x2ce5c0,_0x4f5059){return db[_0xe524('0x27')][_0xe524('0x43')]({'where':{'id':_0x2ce5c0[_0xe524('0x46')]['id']}})[_0xe524('0x20')](handleEntityNotFound(_0x4f5059,null))[_0xe524('0x20')](removeEntity(_0x4f5059,null))['catch'](handleError(_0x4f5059,null));};exports[_0xe524('0x47')]=function(_0x355bcc,_0x34ca5e,_0x494c39){return db[_0xe524('0x48')]['find']({'where':{'id':_0x355bcc[_0xe524('0x46')]['id']}})[_0xe524('0x20')](handleEntityNotFound(_0x34ca5e,null))[_0xe524('0x20')](function(_0x2dbaa1){if(_0x2dbaa1){return _0x2dbaa1[_0xe524('0x47')](_0x355bcc[_0xe524('0x45')][_0xe524('0x49')],_[_0xe524('0x4a')](_0x355bcc[_0xe524('0x45')],[_0xe524('0x49'),'id'])||{});}})[_0xe524('0x20')](respondWithResult(_0x34ca5e,null))[_0xe524('0x41')](handleError(_0x34ca5e,null));};exports['getConditions']=function(_0x4dac0f,_0x4831fa,_0xe49f84){var _0x469f67={};var _0xe7de83={};var _0xcc3897;var _0x45fb0d;return db[_0xe524('0x27')][_0xe524('0x4b')]({'where':{'id':_0x4dac0f[_0xe524('0x46')]['id']}})[_0xe524('0x20')](handleEntityNotFound(_0x4831fa,null))[_0xe524('0x20')](function(_0x3cc1ab){if(_0x3cc1ab){_0xcc3897=_0x3cc1ab;_0xe7de83['model']=_[_0xe524('0x2a')](db[_0xe524('0x48')]['rawAttributes']);_0xe7de83['query']=_['keys'](_0x4dac0f['query']);_0xe7de83[_0xe524('0x37')]=_[_0xe524('0x2e')](_0xe7de83[_0xe524('0x29')],_0xe7de83[_0xe524('0x2b')]);_0x469f67['attributes']=_[_0xe524('0x2e')](_0xe7de83[_0xe524('0x29')],qs[_0xe524('0x30')](_0x4dac0f[_0xe524('0x2b')]['fields']));_0x469f67['attributes']=_0x469f67['attributes'][_0xe524('0x31')]?_0x469f67['attributes']:_0xe7de83[_0xe524('0x29')];_0x469f67[_0xe524('0x34')]=qs[_0xe524('0x35')](_0x4dac0f[_0xe524('0x2b')][_0xe524('0x35')]);_0x469f67['where']=qs['filters'](_[_0xe524('0x38')](_0x4dac0f[_0xe524('0x2b')],_0xe7de83[_0xe524('0x37')]));if(_0x4dac0f[_0xe524('0x2b')][_0xe524('0x4c')]){_0x469f67[_0xe524('0x36')]=_['merge'](_0x469f67[_0xe524('0x36')],{'$or':_[_0xe524('0x3c')](_0x469f67[_0xe524('0x2f')],function(_0x5d3b9c){var _0x35b1a6={};_0x35b1a6[_0x5d3b9c]={'$like':'%'+_0x4dac0f[_0xe524('0x2b')][_0xe524('0x4c')]+'%'};return _0x35b1a6;})});}_0x469f67=_['merge']({},_0x469f67,_0x4dac0f['options']);return _0xcc3897[_0xe524('0x4d')](_0x469f67);}})[_0xe524('0x20')](function(_0x2db546){if(_0x2db546){_0x45fb0d=_0x2db546[_0xe524('0x31')];if(!_0x4dac0f[_0xe524('0x2b')]['hasOwnProperty'](_0xe524('0x4e'))){_0x469f67[_0xe524('0x33')]=qs[_0xe524('0x33')](_0x4dac0f[_0xe524('0x2b')][_0xe524('0x33')]);_0x469f67[_0xe524('0x1c')]=qs[_0xe524('0x1c')](_0x4dac0f[_0xe524('0x2b')][_0xe524('0x1c')]);}return _0xcc3897[_0xe524('0x4d')](_0x469f67);}})[_0xe524('0x20')](function(_0x4c69e2){if(_0x4c69e2){return _0x4c69e2?{'count':_0x45fb0d,'rows':_0x4c69e2}:null;}})[_0xe524('0x20')](respondWithResult(_0x4831fa,null))[_0xe524('0x41')](handleError(_0x4831fa,null));};exports[_0xe524('0x4f')]=function(_0xfed246,_0xeec885,_0x5c8d1e){return db[_0xe524('0x50')][_0xe524('0x43')]({'where':{'id':_0xfed246[_0xe524('0x46')]['id']}})[_0xe524('0x20')](handleEntityNotFound(_0xeec885,null))[_0xe524('0x20')](function(_0x19a485){if(_0x19a485){return _0x19a485[_0xe524('0x4f')](_0xfed246['body'][_0xe524('0x49')],_[_0xe524('0x4a')](_0xfed246[_0xe524('0x45')],[_0xe524('0x49'),'id'])||{});}})['then'](respondWithResult(_0xeec885,null))[_0xe524('0x41')](handleError(_0xeec885,null));};exports['getActions']=function(_0x27b0cb,_0x2a88e2,_0x52e84e){var _0x594515={};var _0x25eb85={};var _0x1ec311;var _0x43d125;return db[_0xe524('0x27')][_0xe524('0x4b')]({'where':{'id':_0x27b0cb['params']['id']}})[_0xe524('0x20')](handleEntityNotFound(_0x2a88e2,null))[_0xe524('0x20')](function(_0x4292c5){if(_0x4292c5){_0x1ec311=_0x4292c5;_0x25eb85[_0xe524('0x29')]=_[_0xe524('0x2a')](db['Action'][_0xe524('0x28')]);_0x25eb85[_0xe524('0x2b')]=_[_0xe524('0x2a')](_0x27b0cb[_0xe524('0x2b')]);_0x25eb85[_0xe524('0x37')]=_[_0xe524('0x2e')](_0x25eb85['model'],_0x25eb85[_0xe524('0x2b')]);_0x594515[_0xe524('0x2f')]=_[_0xe524('0x2e')](_0x25eb85['model'],qs[_0xe524('0x30')](_0x27b0cb[_0xe524('0x2b')]['fields']));_0x594515[_0xe524('0x2f')]=_0x594515[_0xe524('0x2f')][_0xe524('0x31')]?_0x594515[_0xe524('0x2f')]:_0x25eb85[_0xe524('0x29')];_0x594515[_0xe524('0x34')]=qs['sort'](_0x27b0cb[_0xe524('0x2b')][_0xe524('0x35')]);_0x594515[_0xe524('0x36')]=qs[_0xe524('0x37')](_[_0xe524('0x38')](_0x27b0cb[_0xe524('0x2b')],_0x25eb85[_0xe524('0x37')]));if(_0x27b0cb[_0xe524('0x2b')][_0xe524('0x4c')]){_0x594515[_0xe524('0x36')]=_[_0xe524('0x3b')](_0x594515[_0xe524('0x36')],{'$or':_[_0xe524('0x3c')](_0x594515[_0xe524('0x2f')],function(_0x23425c){var _0x576ffa={};_0x576ffa[_0x23425c]={'$like':'%'+_0x27b0cb[_0xe524('0x2b')][_0xe524('0x4c')]+'%'};return _0x576ffa;})});}_0x594515=_[_0xe524('0x3b')]({},_0x594515,_0x27b0cb['options']);return _0x1ec311[_0xe524('0x51')](_0x594515);}})[_0xe524('0x20')](function(_0x5c29aa){if(_0x5c29aa){_0x43d125=_0x5c29aa['length'];if(!_0x27b0cb[_0xe524('0x2b')]['hasOwnProperty'](_0xe524('0x4e'))){_0x594515['limit']=qs[_0xe524('0x33')](_0x27b0cb[_0xe524('0x2b')][_0xe524('0x33')]);_0x594515[_0xe524('0x1c')]=qs['offset'](_0x27b0cb['query'][_0xe524('0x1c')]);}return _0x1ec311[_0xe524('0x51')](_0x594515);}})['then'](function(_0x45c287){if(_0x45c287){return _0x45c287?{'count':_0x43d125,'rows':_0x45c287}:null;}})[_0xe524('0x20')](respondWithResult(_0x2a88e2,null))[_0xe524('0x41')](handleError(_0x2a88e2,null));};
\ No newline at end of file
index fc3747a..415cf4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2de=['lodash','../../config/logger','api','request-promise','./automation.attributes','exports','define','tools_automations'];(function(_0x47c6e4,_0x1fc750){var _0x2e655e=function(_0x8c2221){while(--_0x8c2221){_0x47c6e4['push'](_0x47c6e4['shift']());}};_0x2e655e(++_0x1fc750);}(_0xb2de,0x130));var _0xeb2d=function(_0x330336,_0xb8cb41){_0x330336=_0x330336-0x0;var _0x2055ee=_0xb2de[_0x330336];return _0x2055ee;};'use strict';var _=require(_0xeb2d('0x0'));var util=require('util');var logger=require(_0xeb2d('0x1'))(_0xeb2d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xeb2d('0x3'));var attributes=require(_0xeb2d('0x4'));module[_0xeb2d('0x5')]=function(_0xef62e2,_0x5d1058){return _0xef62e2[_0xeb2d('0x6')]('Automation',attributes,{'tableName':_0xeb2d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb6fa=['bluebird','request-promise','./automation.attributes','exports','define','Automation','lodash','../../config/logger','api','moment'];(function(_0xa30c35,_0xa61b20){var _0x468135=function(_0x361016){while(--_0x361016){_0xa30c35['push'](_0xa30c35['shift']());}};_0x468135(++_0xa61b20);}(_0xb6fa,0x18c));var _0xab6f=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0xb6fa[_0x270adf];return _0x29eda9;};'use strict';var _=require(_0xab6f('0x0'));var util=require('util');var logger=require(_0xab6f('0x1'))(_0xab6f('0x2'));var moment=require(_0xab6f('0x3'));var BPromise=require(_0xab6f('0x4'));var rp=require(_0xab6f('0x5'));var attributes=require(_0xab6f('0x6'));module[_0xab6f('0x7')]=function(_0x3ac444,_0x194df2){return _0x3ac444[_0xab6f('0x8')](_0xab6f('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 430ac13..fbf9b87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bab=['result','catch','lodash','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x375126,_0x514a8e){var _0x1f76bb=function(_0x22f2d0){while(--_0x22f2d0){_0x375126['push'](_0x375126['shift']());}};_0x1f76bb(++_0x514a8e);}(_0x9bab,0xb2));var _0xb9ba=function(_0x5e2aff,_0x1ac19c){_0x5e2aff=_0x5e2aff-0x0;var _0x4401f3=_0x9bab[_0x5e2aff];return _0x4401f3;};'use strict';var _=require(_0xb9ba('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb9ba('0x1'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0xb9ba('0x2'));var logger=require(_0xb9ba('0x3'))(_0xb9ba('0x4'));var config=require(_0xb9ba('0x5'));var jayson=require(_0xb9ba('0x6'));var client=jayson[_0xb9ba('0x7')][_0xb9ba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46114f,_0x4d0a5d,_0x423036){return new BPromise(function(_0x3219da,_0x27f455){return client[_0xb9ba('0x9')](_0x46114f,_0x423036)[_0xb9ba('0xa')](function(_0x16f8b7){logger['info'](_0xb9ba('0xb'),_0x4d0a5d,_0xb9ba('0xc'));logger[_0xb9ba('0xd')](_0xb9ba('0xe'),_0x4d0a5d,_0xb9ba('0xc'),JSON[_0xb9ba('0xf')](_0x16f8b7));if(_0x16f8b7[_0xb9ba('0x10')]){if(_0x16f8b7[_0xb9ba('0x10')][_0xb9ba('0x11')]===0x1f4){logger[_0xb9ba('0x10')](_0xb9ba('0xb'),_0x4d0a5d,_0x16f8b7[_0xb9ba('0x10')][_0xb9ba('0x12')]);return _0x27f455(_0x16f8b7[_0xb9ba('0x10')]['message']);}logger[_0xb9ba('0x10')]('Automation,\x20%s,\x20%s',_0x4d0a5d,_0x16f8b7['error'][_0xb9ba('0x12')]);return _0x3219da(_0x16f8b7[_0xb9ba('0x10')][_0xb9ba('0x12')]);}else{logger[_0xb9ba('0x13')](_0xb9ba('0xb'),_0x4d0a5d,'request\x20sent');_0x3219da(_0x16f8b7[_0xb9ba('0x14')][_0xb9ba('0x12')]);}})[_0xb9ba('0x15')](function(_0x4a8bfe){logger[_0xb9ba('0x10')]('Automation,\x20%s,\x20%s',_0x4d0a5d,_0x4a8bfe);_0x27f455(_0x4a8bfe);});});}
\ No newline at end of file
+var _0xc712=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment'];(function(_0x27590c,_0x16615b){var _0x4c6b64=function(_0x5ab709){while(--_0x5ab709){_0x27590c['push'](_0x27590c['shift']());}};_0x4c6b64(++_0x16615b);}(_0xc712,0x71));var _0x2c71=function(_0x32f755,_0x5af6fb){_0x32f755=_0x32f755-0x0;var _0x30a0de=_0xc712[_0x32f755];return _0x30a0de;};'use strict';var _=require(_0x2c71('0x0'));var util=require('util');var moment=require(_0x2c71('0x1'));var BPromise=require(_0x2c71('0x2'));var rs=require(_0x2c71('0x3'));var fs=require('fs');var db=require(_0x2c71('0x4'))['db'];var utils=require(_0x2c71('0x5'));var logger=require(_0x2c71('0x6'))(_0x2c71('0x7'));var config=require(_0x2c71('0x8'));var jayson=require(_0x2c71('0x9'));var client=jayson[_0x2c71('0xa')][_0x2c71('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b2ad5,_0x1f2dd4,_0x55e123){return new BPromise(function(_0x3e110b,_0x4ba78c){return client[_0x2c71('0xc')](_0x5b2ad5,_0x55e123)[_0x2c71('0xd')](function(_0x10b219){logger[_0x2c71('0xe')](_0x2c71('0xf'),_0x1f2dd4,_0x2c71('0x10'));logger['debug'](_0x2c71('0x11'),_0x1f2dd4,_0x2c71('0x10'),JSON[_0x2c71('0x12')](_0x10b219));if(_0x10b219[_0x2c71('0x13')]){if(_0x10b219[_0x2c71('0x13')]['code']===0x1f4){logger[_0x2c71('0x13')](_0x2c71('0xf'),_0x1f2dd4,_0x10b219[_0x2c71('0x13')][_0x2c71('0x14')]);return _0x4ba78c(_0x10b219['error'][_0x2c71('0x14')]);}logger['error'](_0x2c71('0xf'),_0x1f2dd4,_0x10b219[_0x2c71('0x13')][_0x2c71('0x14')]);return _0x3e110b(_0x10b219[_0x2c71('0x13')]['message']);}else{logger[_0x2c71('0xe')]('Automation,\x20%s,\x20%s',_0x1f2dd4,_0x2c71('0x10'));_0x3e110b(_0x10b219[_0x2c71('0x15')][_0x2c71('0x14')]);}})[_0x2c71('0x16')](function(_0x34ebc8){logger[_0x2c71('0x13')]('Automation,\x20%s,\x20%s',_0x1f2dd4,_0x34ebc8);_0x4ba78c(_0x34ebc8);});});}
\ No newline at end of file
index 9b99890..6c6c593 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['path','Router','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','getActions','/:id/conditions','addConditions','post','/:id/actions','addActions','update','delete','destroy','exports','multer','util'];(function(_0xa6b2c0,_0x5064c7){var _0x5bf095=function(_0x399d47){while(--_0x399d47){_0xa6b2c0['push'](_0xa6b2c0['shift']());}};_0x5bf095(++_0x5064c7);}(_0x7a54,0x106));var _0x47a5=function(_0x39127f,_0x5f175e){_0x39127f=_0x39127f-0x0;var _0x456dbd=_0x7a54[_0x39127f];return _0x456dbd;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var express=require('express');var router=express[_0x47a5('0x3')]();var auth=require(_0x47a5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x47a5('0x5'));var controller=require(_0x47a5('0x6'));router[_0x47a5('0x7')]('/',auth[_0x47a5('0x8')](),controller[_0x47a5('0x9')]);router['get'](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router[_0x47a5('0x7')]('/:id/conditions',auth[_0x47a5('0x8')](),controller['getConditions']);router['get']('/:id/actions',auth[_0x47a5('0x8')](),controller[_0x47a5('0xc')]);router['post']('/',auth[_0x47a5('0x8')](),controller['create']);router['post'](_0x47a5('0xd'),auth[_0x47a5('0x8')](),controller[_0x47a5('0xe')]);router[_0x47a5('0xf')](_0x47a5('0x10'),auth[_0x47a5('0x8')](),controller[_0x47a5('0x11')]);router['put'](_0x47a5('0xa'),auth[_0x47a5('0x8')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x13')](_0x47a5('0xa'),auth[_0x47a5('0x8')](),controller[_0x47a5('0x14')]);module[_0x47a5('0x15')]=router;
\ No newline at end of file
+var _0x9957=['./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','/:id/actions','getActions','post','create','addActions','put','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x35a91c,_0x211e70){var _0x5e68af=function(_0x118c46){while(--_0x118c46){_0x35a91c['push'](_0x35a91c['shift']());}};_0x5e68af(++_0x211e70);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var express=require(_0x7995('0x3'));var router=express['Router']();var auth=require(_0x7995('0x4'));var interaction=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));var controller=require(_0x7995('0x7'));router['get']('/',auth[_0x7995('0x8')](),controller[_0x7995('0x9')]);router[_0x7995('0xa')](_0x7995('0xb'),auth[_0x7995('0x8')](),controller[_0x7995('0xc')]);router['get'](_0x7995('0xd'),auth[_0x7995('0x8')](),controller['getConditions']);router[_0x7995('0xa')](_0x7995('0xe'),auth[_0x7995('0x8')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x8')](),controller[_0x7995('0x11')]);router['post'](_0x7995('0xd'),auth[_0x7995('0x8')](),controller['addConditions']);router[_0x7995('0x10')](_0x7995('0xe'),auth[_0x7995('0x8')](),controller[_0x7995('0x12')]);router[_0x7995('0x13')](_0x7995('0xb'),auth[_0x7995('0x8')](),controller['update']);router['delete'](_0x7995('0xb'),auth[_0x7995('0x8')](),controller[_0x7995('0x14')]);module[_0x7995('0x15')]=router;
\ No newline at end of file
index e50f120..4684c27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7688=['#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD'];(function(_0x30faee,_0x1c3794){var _0x3a90ab=function(_0x11129b){while(--_0x11129b){_0x30faee['push'](_0x30faee['shift']());}};_0x3a90ab(++_0x1c3794);}(_0x7688,0xbc));var _0x8768=function(_0x3cb2a8,_0x5b5dae){_0x3cb2a8=_0x3cb2a8-0x0;var _0x146ef8=_0x7688[_0x3cb2a8];return _0x146ef8;};'use strict';var Sequelize=require(_0x8768('0x0'));module[_0x8768('0x1')]={'name':{'type':Sequelize[_0x8768('0x2')],'unique':_0x8768('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x8768('0x4')]('ivr'),'allowNull':![],'defaultValue':_0x8768('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x8768('0x6')],'defaultValue':0x0,'comment':_0x8768('0x7')},'limitCalls':{'type':Sequelize[_0x8768('0x8')](0x4)[_0x8768('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x8768('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8768('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x8768('0x8')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8768('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x8768('0x8')](0x3)[_0x8768('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8768('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8768('0x8')](0x5)[_0x8768('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8768('0xc')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8768('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8768('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x8768('0x8')](0x5)[_0x8768('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8768('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8768('0x9')],'defaultValue':0x3,'comment':_0x8768('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8768('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8768('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8768('0x8')](0x3)[_0x8768('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8768('0x11')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8768('0x2')],'defaultValue':_0x8768('0x12')},'dialCheckDuplicateType':{'type':Sequelize[_0x8768('0x4')](_0x8768('0x13'),_0x8768('0x14'),'onlyIfOpen'),'defaultValue':_0x8768('0x13')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8768('0x15')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8768('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8768('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x8768('0x8')](0x9)[_0x8768('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8768('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8768('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8768('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8768('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8768('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0x8768('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8768('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8768('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8768('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8768('0x8')](0x9)[_0x8768('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8768('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8768('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8768('0x1d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8768('0x8')](0x9)[_0x8768('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8768('0x1e')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x8768('0x1f'),_0x8768('0x20')),'defaultValue':_0x8768('0x1f')},'dialPrefix':{'type':Sequelize[_0x8768('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8768('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8768('0x21')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x8768('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8768('0x22')}};
\ No newline at end of file
+var _0xac87=['NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\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','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)'];(function(_0x2d47da,_0x18dc85){var _0x9d811c=function(_0x2d4dfa){while(--_0x2d4dfa){_0x2d47da['push'](_0x2d47da['shift']());}};_0x9d811c(++_0x18dc85);}(_0xac87,0x71));var _0x7ac8=function(_0x247ce4,_0x2796f8){_0x247ce4=_0x247ce4-0x0;var _0x475864=_0xac87[_0x247ce4];return _0x475864;};'use strict';var Sequelize=require(_0x7ac8('0x0'));module[_0x7ac8('0x1')]={'name':{'type':Sequelize[_0x7ac8('0x2')],'unique':_0x7ac8('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7ac8('0x4')](_0x7ac8('0x5')),'allowNull':![],'defaultValue':_0x7ac8('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x7ac8('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x7ac8('0x7')](0x4)[_0x7ac8('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7ac8('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7ac8('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7ac8('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x7ac8('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x7ac8('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ac8('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7ac8('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ac8('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7ac8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ac8('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7ac8('0x7')](0x5)[_0x7ac8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ac8('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7ac8('0x7')](0x3)[_0x7ac8('0x8')],'defaultValue':0x3,'comment':_0x7ac8('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7ac8('0x7')](0x5)[_0x7ac8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ac8('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x7ac8('0x7')](0x3)[_0x7ac8('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7ac8('0x10')},'dialTimezone':{'type':Sequelize[_0x7ac8('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7ac8('0x2')],'defaultValue':_0x7ac8('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x7ac8('0x4')](_0x7ac8('0x12'),'never',_0x7ac8('0x13')),'defaultValue':_0x7ac8('0x12')},'dialAMDActive':{'type':Sequelize[_0x7ac8('0x6')],'defaultValue':0x0,'comment':_0x7ac8('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x7ac8('0x7')](0x9)[_0x7ac8('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x7ac8('0x7')](0x9)[_0x7ac8('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7ac8('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7ac8('0x7')](0x9)[_0x7ac8('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7ac8('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7ac8('0x7')](0x9)[_0x7ac8('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7ac8('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x7ac8('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7ac8('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7ac8('0x7')](0x9)[_0x7ac8('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7ac8('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7ac8('0x7')](0x9)[_0x7ac8('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7ac8('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7ac8('0x7')](0x5)[_0x7ac8('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7ac8('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7ac8('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7ac8('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7ac8('0x4')](_0x7ac8('0x1d'),'ASC'),'defaultValue':_0x7ac8('0x1d')},'dialPrefix':{'type':Sequelize[_0x7ac8('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7ac8('0x7')](0x3)[_0x7ac8('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7ac8('0x1e')},'dialCutDigit':{'type':Sequelize[_0x7ac8('0x7')](0x3)[_0x7ac8('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7ac8('0x1f')}};
\ No newline at end of file
index 9c9d68d..7fa36fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6784=['add','day','merge','filter','map','options','includeAll','include','findAll','catch','params','find','create','body','clone','get','omit','updatedAt','createdAt','getHoppers','findOne','CmHopper','pick','CampaignId','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','CampaignId\x20=\x20?','cm_hopper','onlyIfOpen','ListId','deletedAt\x20IS\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','save','update','then','destroy','end','error','name','send','index','Campaign','rawAttributes','model','keys','query','dateEnd','dateStart','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x5681f8,_0x95a506){var _0xa8901f=function(_0x5ea17){while(--_0x5ea17){_0x5681f8['push'](_0x5681f8['shift']());}};_0xa8901f(++_0x95a506);}(_0x6784,0x136));var _0x4678=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x6784[_0x334841];return _0x5beb4b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4678('0x0'));var rimraf=require(_0x4678('0x1'));var zipdir=require(_0x4678('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4678('0x3'));var moment=require('moment');var BPromise=require(_0x4678('0x4'));var Mustache=require(_0x4678('0x5'));var util=require(_0x4678('0x6'));var path=require(_0x4678('0x7'));var sox=require('sox');var csv=require(_0x4678('0x8'));var ejs=require(_0x4678('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4678('0xa'));var jsforce=require(_0x4678('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4678('0xc'));var Papa=require(_0x4678('0xd'));var qs=require(_0x4678('0xe'));var logger=require(_0x4678('0xf'))(_0x4678('0x10'));var utils=require(_0x4678('0x11'));var config=require(_0x4678('0x12'));var db=require(_0x4678('0x13'))['db'];function respondWithStatusCode(_0x42daff,_0x4c20ae){_0x4c20ae=_0x4c20ae||0xcc;return function(_0x534835){if(_0x534835){return _0x42daff[_0x4678('0x14')](_0x4c20ae);}return _0x42daff[_0x4678('0x15')](_0x4c20ae)['end']();};}function respondWithResult(_0xabf955,_0x3e78bc){_0x3e78bc=_0x3e78bc||0xc8;return function(_0x2181b6){if(_0x2181b6){return _0xabf955[_0x4678('0x15')](_0x3e78bc)[_0x4678('0x16')](_0x2181b6);}};}function respondWithFilteredResult(_0x1b2020,_0x1ab67b){return function(_0x53a51e){if(_0x53a51e){var _0x330178=_0x53a51e[_0x4678('0x17')],_0x5bc078=_0x1ab67b[_0x4678('0x18')],_0x3a389a=_0x1ab67b['offset']+_0x1ab67b[_0x4678('0x19')],_0x3f3132;if(_0x3a389a>=_0x330178){_0x3a389a=_0x330178;_0x3f3132=0xc8;}else{_0x3f3132=0xce;}_0x1b2020[_0x4678('0x15')](_0x3f3132);return _0x1b2020['set'](_0x4678('0x1a'),_0x5bc078+'-'+_0x3a389a+'/'+_0x330178)['json'](_0x53a51e);}return null;};}function patchUpdates(_0x4a0628){return function(_0x3d9e9c){try{jsonpatch['apply'](_0x3d9e9c,_0x4a0628,!![]);}catch(_0x54838c){return BPromise['reject'](_0x54838c);}return _0x3d9e9c[_0x4678('0x1b')]();};}function saveUpdates(_0x5f292b,_0x9334ab){return function(_0xe8eaff){if(_0xe8eaff){return _0xe8eaff[_0x4678('0x1c')](_0x5f292b)[_0x4678('0x1d')](function(_0x40c15){return _0x40c15;});}return null;};}function removeEntity(_0x1b8450,_0x231ca1){return function(_0x574f66){if(_0x574f66){return _0x574f66[_0x4678('0x1e')]()[_0x4678('0x1d')](function(){_0x1b8450[_0x4678('0x15')](0xcc)[_0x4678('0x1f')]();});}};}function handleEntityNotFound(_0x26b3f0,_0x3d4f2b){return function(_0x2c42f8){if(!_0x2c42f8){_0x26b3f0[_0x4678('0x14')](0x194);}return _0x2c42f8;};}function handleError(_0x4f1871,_0x451b11){_0x451b11=_0x451b11||0x1f4;return function(_0x4d55dd){logger[_0x4678('0x20')](_0x4d55dd['stack']);if(_0x4d55dd['name']){delete _0x4d55dd[_0x4678('0x21')];}_0x4f1871[_0x4678('0x15')](_0x451b11)[_0x4678('0x22')](_0x4d55dd);};}exports[_0x4678('0x23')]=function(_0x50753c,_0x4e8870){var _0x4aeb4b={},_0x16026f={},_0x15e3f9={'count':0x0,'rows':[]};var _0x3b81de=db[_0x4678('0x24')][_0x4678('0x25')];_0x16026f[_0x4678('0x26')]=_[_0x4678('0x27')](_0x3b81de);var _0x15230e={'dateStart':_0x50753c[_0x4678('0x28')]['dateStart'],'dateEnd':_0x50753c[_0x4678('0x28')][_0x4678('0x29')]};delete _0x50753c[_0x4678('0x28')][_0x4678('0x2a')];delete _0x50753c[_0x4678('0x28')][_0x4678('0x29')];_0x16026f[_0x4678('0x28')]=_[_0x4678('0x27')](_0x50753c[_0x4678('0x28')]);_0x16026f[_0x4678('0x2b')]=_[_0x4678('0x2c')](_0x16026f[_0x4678('0x26')],_0x16026f[_0x4678('0x28')]);_0x4aeb4b[_0x4678('0x2d')]=_['intersection'](_0x16026f[_0x4678('0x26')],qs[_0x4678('0x2e')](_0x50753c[_0x4678('0x28')][_0x4678('0x2e')]));_0x4aeb4b[_0x4678('0x2d')]=_0x4aeb4b[_0x4678('0x2d')][_0x4678('0x2f')]?_0x4aeb4b['attributes']:_0x16026f[_0x4678('0x26')];if(!_0x50753c[_0x4678('0x28')][_0x4678('0x30')](_0x4678('0x31'))){_0x4aeb4b[_0x4678('0x19')]=qs['limit'](_0x50753c[_0x4678('0x28')][_0x4678('0x19')]);_0x4aeb4b[_0x4678('0x18')]=qs[_0x4678('0x18')](_0x50753c[_0x4678('0x28')]['offset']);}_0x4aeb4b[_0x4678('0x32')]=qs[_0x4678('0x33')](_0x50753c['query'][_0x4678('0x33')]);_0x4aeb4b[_0x4678('0x34')]=qs[_0x4678('0x2b')](_['pick'](_0x50753c[_0x4678('0x28')],_0x16026f['filters']));if(_0x15230e[_0x4678('0x2a')]){if(_0x15230e[_0x4678('0x29')]){_0x15230e[_0x4678('0x29')]=moment(_0x15230e[_0x4678('0x29')])['add'](0x1,'day');}else{_0x15230e[_0x4678('0x29')]=moment(_0x15230e[_0x4678('0x2a')])[_0x4678('0x35')](0x1,_0x4678('0x36'));}_[_0x4678('0x37')](_0x4aeb4b['where'],{'createdAt':{'$gte':_0x15230e[_0x4678('0x2a')],'$lte':_0x15230e['dateEnd']}});}if(_0x50753c[_0x4678('0x28')][_0x4678('0x38')]){_0x4aeb4b[_0x4678('0x34')]=_[_0x4678('0x37')](_0x4aeb4b[_0x4678('0x34')],{'$or':_[_0x4678('0x39')](_0x4aeb4b[_0x4678('0x2d')],function(_0x6dc73e){var _0x2e667b={};_0x2e667b[_0x6dc73e]={'$like':'%'+_0x50753c['query'][_0x4678('0x38')]+'%'};return _0x2e667b;})});}_0x4aeb4b=_[_0x4678('0x37')]({},_0x4aeb4b,_0x50753c[_0x4678('0x3a')]);var _0x49134c={'where':_0x4aeb4b[_0x4678('0x34')]};return db['Campaign'][_0x4678('0x17')](_0x49134c)[_0x4678('0x1d')](function(_0x3d2420){_0x15e3f9[_0x4678('0x17')]=_0x3d2420;if(_0x50753c[_0x4678('0x28')][_0x4678('0x3b')]){_0x4aeb4b[_0x4678('0x3c')]=[{'all':!![]}];}return db['Campaign'][_0x4678('0x3d')](_0x4aeb4b);})['then'](function(_0xcb7c7){_0x15e3f9['rows']=_0xcb7c7;return _0x15e3f9;})['then'](respondWithFilteredResult(_0x4e8870,_0x4aeb4b))[_0x4678('0x3e')](handleError(_0x4e8870,null));};exports['show']=function(_0x51a390,_0x3c9217){var _0x299fcc={'raw':![],'where':{'id':_0x51a390[_0x4678('0x3f')]['id']}},_0x589d25={};_0x589d25[_0x4678('0x26')]=_[_0x4678('0x27')](db['Campaign'][_0x4678('0x25')]);_0x589d25[_0x4678('0x28')]=_['keys'](_0x51a390[_0x4678('0x28')]);_0x589d25[_0x4678('0x2b')]=_[_0x4678('0x2c')](_0x589d25[_0x4678('0x26')],_0x589d25[_0x4678('0x28')]);_0x299fcc[_0x4678('0x2d')]=_[_0x4678('0x2c')](_0x589d25[_0x4678('0x26')],qs[_0x4678('0x2e')](_0x51a390[_0x4678('0x28')][_0x4678('0x2e')]));_0x299fcc[_0x4678('0x2d')]=_0x299fcc[_0x4678('0x2d')]['length']?_0x299fcc[_0x4678('0x2d')]:_0x589d25[_0x4678('0x26')];if(_0x51a390[_0x4678('0x28')][_0x4678('0x3b')]){_0x299fcc[_0x4678('0x3c')]=[{'all':!![]}];}_0x299fcc=_[_0x4678('0x37')]({},_0x299fcc,_0x51a390[_0x4678('0x3a')]);return db[_0x4678('0x24')][_0x4678('0x40')](_0x299fcc)[_0x4678('0x1d')](handleEntityNotFound(_0x3c9217,null))[_0x4678('0x1d')](respondWithResult(_0x3c9217,null))['catch'](handleError(_0x3c9217,null));};exports['create']=function(_0x2e6323,_0x4c52be){return db[_0x4678('0x24')][_0x4678('0x41')](_0x2e6323[_0x4678('0x42')],{})['then'](respondWithResult(_0x4c52be,0xc9))[_0x4678('0x3e')](handleError(_0x4c52be,null));};exports[_0x4678('0x43')]=function(_0x3adc23,_0x268d5e){var _0x4a8981={'raw':![],'where':{'id':_0x3adc23['params']['id']}},_0x378753={};_0x378753['model']=_[_0x4678('0x27')](db[_0x4678('0x24')][_0x4678('0x25')]);_0x4a8981[_0x4678('0x2d')]=_['intersection'](_0x378753[_0x4678('0x26')],qs[_0x4678('0x2e')](_0x3adc23[_0x4678('0x28')][_0x4678('0x2e')]));_0x4a8981[_0x4678('0x2d')]=_0x4a8981[_0x4678('0x2d')]['length']?_0x4a8981['attributes']:_0x378753['model'];if(_0x3adc23[_0x4678('0x28')][_0x4678('0x3b')]){_0x4a8981[_0x4678('0x3c')]=[{'all':!![]}];}_0x4a8981=_[_0x4678('0x37')]({},_0x4a8981,_0x3adc23[_0x4678('0x3a')]);return db['Campaign']['find'](_0x4a8981)[_0x4678('0x1d')](handleEntityNotFound(_0x268d5e,null))['then'](function(_0x587365){if(_0x587365){var _0x25f545=_0x587365[_0x4678('0x44')]({'plain':!![]});_0x25f545=qs[_0x4678('0x45')](_0x25f545,['id','createdAt',_0x4678('0x46')]);_0x3adc23[_0x4678('0x42')]=_['omit'](_0x3adc23['body'],['id',_0x4678('0x47'),_0x4678('0x46')]);return db[_0x4678('0x24')][_0x4678('0x41')](_[_0x4678('0x37')](_0x25f545,_0x3adc23[_0x4678('0x42')]),{'include':_0x3adc23['query'][_0x4678('0x3b')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x268d5e,0xc9))[_0x4678('0x3e')](handleError(_0x268d5e,null));};exports[_0x4678('0x1c')]=function(_0x34f2da,_0x33a4ed){if(_0x34f2da[_0x4678('0x42')]['id']){delete _0x34f2da[_0x4678('0x42')]['id'];}return db[_0x4678('0x24')][_0x4678('0x40')]({'where':{'id':_0x34f2da[_0x4678('0x3f')]['id']}})[_0x4678('0x1d')](handleEntityNotFound(_0x33a4ed,null))[_0x4678('0x1d')](saveUpdates(_0x34f2da['body'],null))[_0x4678('0x1d')](respondWithResult(_0x33a4ed,null))['catch'](handleError(_0x33a4ed,null));};exports[_0x4678('0x1e')]=function(_0x18fa20,_0x457b88){return db[_0x4678('0x24')][_0x4678('0x40')]({'where':{'id':_0x18fa20[_0x4678('0x3f')]['id']}})['then'](handleEntityNotFound(_0x457b88,null))[_0x4678('0x1d')](removeEntity(_0x457b88,null))['catch'](handleError(_0x457b88,null));};exports[_0x4678('0x48')]=function(_0x5d801d,_0x1f9f0d,_0x147e93){var _0x27fc72={'raw':!![],'where':{}};var _0x259a76={};var _0x440705={'count':0x0,'rows':[]};return db['Campaign'][_0x4678('0x49')]({'where':{'id':_0x5d801d[_0x4678('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1f9f0d,null))[_0x4678('0x1d')](function(_0x2a919a){if(_0x2a919a){_0x259a76[_0x4678('0x26')]=_[_0x4678('0x27')](db[_0x4678('0x4a')][_0x4678('0x25')]);_0x259a76[_0x4678('0x28')]=_[_0x4678('0x27')](_0x5d801d[_0x4678('0x28')]);_0x259a76[_0x4678('0x2b')]=_[_0x4678('0x2c')](_0x259a76['model'],_0x259a76['query']);_0x27fc72[_0x4678('0x2d')]=_[_0x4678('0x2c')](_0x259a76[_0x4678('0x26')],qs[_0x4678('0x2e')](_0x5d801d[_0x4678('0x28')]['fields']));_0x27fc72[_0x4678('0x2d')]=_0x27fc72['attributes'][_0x4678('0x2f')]?_0x27fc72[_0x4678('0x2d')]:_0x259a76[_0x4678('0x26')];if(!_0x5d801d[_0x4678('0x28')][_0x4678('0x30')](_0x4678('0x31'))){_0x27fc72[_0x4678('0x19')]=qs[_0x4678('0x19')](_0x5d801d[_0x4678('0x28')]['limit']);_0x27fc72[_0x4678('0x18')]=qs[_0x4678('0x18')](_0x5d801d[_0x4678('0x28')]['offset']);}_0x27fc72[_0x4678('0x32')]=qs['sort'](_0x5d801d[_0x4678('0x28')][_0x4678('0x33')]);_0x27fc72[_0x4678('0x34')]=qs[_0x4678('0x2b')](_[_0x4678('0x4b')](_0x5d801d[_0x4678('0x28')],_0x259a76['filters']));_0x27fc72['where'][_0x4678('0x4c')]=_0x2a919a['id'];if(_0x5d801d[_0x4678('0x28')][_0x4678('0x38')]){_0x27fc72[_0x4678('0x34')]=_[_0x4678('0x37')](_0x27fc72[_0x4678('0x34')],{'$or':_[_0x4678('0x39')](_0x27fc72[_0x4678('0x2d')],function(_0x5ebd7b){var _0x3ee66d={};_0x3ee66d[_0x5ebd7b]={'$like':'%'+_0x5d801d[_0x4678('0x28')]['filter']+'%'};return _0x3ee66d;})});}_0x27fc72=_[_0x4678('0x37')]({},_0x27fc72,_0x5d801d[_0x4678('0x3a')]);return db[_0x4678('0x4a')][_0x4678('0x17')]({'where':_0x27fc72[_0x4678('0x34')]})[_0x4678('0x1d')](function(_0x5343f6){_0x440705[_0x4678('0x17')]=_0x5343f6;if(_0x5d801d['query']['includeAll']){_0x27fc72[_0x4678('0x3c')]=[{'all':!![]}];}return db['CmHopper'][_0x4678('0x3d')](_0x27fc72);})[_0x4678('0x1d')](function(_0xba03f3){_0x440705[_0x4678('0x4d')]=_0xba03f3;return _0x440705;});}})[_0x4678('0x1d')](respondWithFilteredResult(_0x1f9f0d,_0x27fc72))[_0x4678('0x3e')](handleError(_0x1f9f0d,null));};exports[_0x4678('0x4e')]=function(_0x3b2f08,_0xff97b0,_0x3e2e46){var _0x5780f1={'raw':!![],'where':{}};var _0x444376={};var _0x32cf41={'count':0x0,'rows':[]};return db[_0x4678('0x24')]['findOne']({'where':{'id':_0x3b2f08[_0x4678('0x3f')]['id']}})[_0x4678('0x1d')](handleEntityNotFound(_0xff97b0,null))[_0x4678('0x1d')](function(_0x58d833){if(_0x58d833){_0x444376[_0x4678('0x26')]=_[_0x4678('0x27')](db['CmHopperHistory']['rawAttributes']);_0x444376[_0x4678('0x28')]=_[_0x4678('0x27')](_0x3b2f08['query']);_0x444376[_0x4678('0x2b')]=_['intersection'](_0x444376[_0x4678('0x26')],_0x444376['query']);_0x5780f1[_0x4678('0x2d')]=_[_0x4678('0x2c')](_0x444376[_0x4678('0x26')],qs[_0x4678('0x2e')](_0x3b2f08['query']['fields']));_0x5780f1['attributes']=_0x5780f1[_0x4678('0x2d')][_0x4678('0x2f')]?_0x5780f1[_0x4678('0x2d')]:_0x444376['model'];if(!_0x3b2f08[_0x4678('0x28')]['hasOwnProperty']('nolimit')){_0x5780f1['limit']=qs[_0x4678('0x19')](_0x3b2f08[_0x4678('0x28')][_0x4678('0x19')]);_0x5780f1[_0x4678('0x18')]=qs[_0x4678('0x18')](_0x3b2f08[_0x4678('0x28')][_0x4678('0x18')]);}_0x5780f1[_0x4678('0x32')]=qs['sort'](_0x3b2f08[_0x4678('0x28')][_0x4678('0x33')]);_0x5780f1['where']=qs[_0x4678('0x2b')](_[_0x4678('0x4b')](_0x3b2f08['query'],_0x444376[_0x4678('0x2b')]));_0x5780f1['where'][_0x4678('0x4c')]=_0x58d833['id'];if(_0x3b2f08[_0x4678('0x28')][_0x4678('0x38')]){_0x5780f1[_0x4678('0x34')]=_[_0x4678('0x37')](_0x5780f1[_0x4678('0x34')],{'$or':_[_0x4678('0x39')](_0x5780f1[_0x4678('0x2d')],function(_0x12be9a){var _0x35869e={};_0x35869e[_0x12be9a]={'$like':'%'+_0x3b2f08['query'][_0x4678('0x38')]+'%'};return _0x35869e;})});}_0x5780f1=_[_0x4678('0x37')]({},_0x5780f1,_0x3b2f08[_0x4678('0x3a')]);return db[_0x4678('0x4f')][_0x4678('0x17')]({'where':_0x5780f1[_0x4678('0x34')]})[_0x4678('0x1d')](function(_0x1c571a){_0x32cf41[_0x4678('0x17')]=_0x1c571a;if(_0x3b2f08[_0x4678('0x28')]['includeAll']){_0x5780f1[_0x4678('0x3c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x4678('0x3d')](_0x5780f1);})[_0x4678('0x1d')](function(_0x54b3c4){_0x32cf41[_0x4678('0x4d')]=_0x54b3c4;return _0x32cf41;});}})[_0x4678('0x1d')](respondWithFilteredResult(_0xff97b0,_0x5780f1))[_0x4678('0x3e')](handleError(_0xff97b0,null));};exports['getHopperFinals']=function(_0x2fc07b,_0x56fd58,_0xcbeb1a){var _0x525003={'raw':!![],'where':{}};var _0x2d6ea9={};var _0x531d56={'count':0x0,'rows':[]};return db[_0x4678('0x24')]['findOne']({'where':{'id':_0x2fc07b[_0x4678('0x3f')]['id']}})[_0x4678('0x1d')](handleEntityNotFound(_0x56fd58,null))['then'](function(_0x50b656){if(_0x50b656){_0x2d6ea9[_0x4678('0x26')]=_[_0x4678('0x27')](db['CmHopperFinal'][_0x4678('0x25')]);_0x2d6ea9[_0x4678('0x28')]=_[_0x4678('0x27')](_0x2fc07b[_0x4678('0x28')]);_0x2d6ea9['filters']=_[_0x4678('0x2c')](_0x2d6ea9[_0x4678('0x26')],_0x2d6ea9[_0x4678('0x28')]);_0x525003[_0x4678('0x2d')]=_[_0x4678('0x2c')](_0x2d6ea9[_0x4678('0x26')],qs['fields'](_0x2fc07b[_0x4678('0x28')][_0x4678('0x2e')]));_0x525003[_0x4678('0x2d')]=_0x525003[_0x4678('0x2d')]['length']?_0x525003['attributes']:_0x2d6ea9['model'];if(!_0x2fc07b[_0x4678('0x28')][_0x4678('0x30')]('nolimit')){_0x525003[_0x4678('0x19')]=qs[_0x4678('0x19')](_0x2fc07b[_0x4678('0x28')]['limit']);_0x525003[_0x4678('0x18')]=qs[_0x4678('0x18')](_0x2fc07b[_0x4678('0x28')][_0x4678('0x18')]);}_0x525003[_0x4678('0x32')]=qs['sort'](_0x2fc07b[_0x4678('0x28')]['sort']);_0x525003[_0x4678('0x34')]=qs[_0x4678('0x2b')](_[_0x4678('0x4b')](_0x2fc07b[_0x4678('0x28')],_0x2d6ea9['filters']));_0x525003[_0x4678('0x34')][_0x4678('0x4c')]=_0x50b656['id'];if(_0x2fc07b[_0x4678('0x28')][_0x4678('0x38')]){_0x525003[_0x4678('0x34')]=_[_0x4678('0x37')](_0x525003[_0x4678('0x34')],{'$or':_[_0x4678('0x39')](_0x525003[_0x4678('0x2d')],function(_0x37ec93){var _0x1ff1c7={};_0x1ff1c7[_0x37ec93]={'$like':'%'+_0x2fc07b[_0x4678('0x28')]['filter']+'%'};return _0x1ff1c7;})});}_0x525003=_[_0x4678('0x37')]({},_0x525003,_0x2fc07b[_0x4678('0x3a')]);return db[_0x4678('0x50')][_0x4678('0x17')]({'where':_0x525003[_0x4678('0x34')]})[_0x4678('0x1d')](function(_0x7d4206){_0x531d56[_0x4678('0x17')]=_0x7d4206;if(_0x2fc07b['query'][_0x4678('0x3b')]){_0x525003['include']=[{'all':!![]}];}return db[_0x4678('0x50')]['findAll'](_0x525003);})[_0x4678('0x1d')](function(_0x329420){_0x531d56[_0x4678('0x4d')]=_0x329420;return _0x531d56;});}})[_0x4678('0x1d')](respondWithFilteredResult(_0x56fd58,_0x525003))[_0x4678('0x3e')](handleError(_0x56fd58,null));};exports[_0x4678('0x51')]=function(_0x3866d8,_0x1044a1,_0xcdbc76){var _0xf89d7f={'raw':!![],'where':{}};var _0x332b59={};var _0x5cb173={'count':0x0,'rows':[]};return db['Campaign'][_0x4678('0x49')]({'where':{'id':_0x3866d8[_0x4678('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1044a1,null))[_0x4678('0x1d')](function(_0x43db28){if(_0x43db28){_0x332b59[_0x4678('0x26')]=_[_0x4678('0x27')](db[_0x4678('0x52')][_0x4678('0x25')]);_0x332b59[_0x4678('0x28')]=_['keys'](_0x3866d8[_0x4678('0x28')]);_0x332b59[_0x4678('0x2b')]=_[_0x4678('0x2c')](_0x332b59[_0x4678('0x26')],_0x332b59['query']);_0xf89d7f[_0x4678('0x2d')]=_['intersection'](_0x332b59[_0x4678('0x26')],qs[_0x4678('0x2e')](_0x3866d8[_0x4678('0x28')]['fields']));_0xf89d7f[_0x4678('0x2d')]=_0xf89d7f[_0x4678('0x2d')][_0x4678('0x2f')]?_0xf89d7f['attributes']:_0x332b59[_0x4678('0x26')];if(!_0x3866d8[_0x4678('0x28')][_0x4678('0x30')](_0x4678('0x31'))){_0xf89d7f[_0x4678('0x19')]=qs[_0x4678('0x19')](_0x3866d8[_0x4678('0x28')]['limit']);_0xf89d7f['offset']=qs['offset'](_0x3866d8[_0x4678('0x28')][_0x4678('0x18')]);}_0xf89d7f[_0x4678('0x32')]=qs[_0x4678('0x33')](_0x3866d8[_0x4678('0x28')]['sort']);_0xf89d7f['where']=qs[_0x4678('0x2b')](_['pick'](_0x3866d8['query'],_0x332b59[_0x4678('0x2b')]));_0xf89d7f[_0x4678('0x34')]['CampaignId']=_0x43db28['id'];if(_0x3866d8['query'][_0x4678('0x38')]){_0xf89d7f['where']=_[_0x4678('0x37')](_0xf89d7f[_0x4678('0x34')],{'$or':_[_0x4678('0x39')](_0xf89d7f[_0x4678('0x2d')],function(_0x58d10b){var _0xcb610a={};_0xcb610a[_0x58d10b]={'$like':'%'+_0x3866d8[_0x4678('0x28')][_0x4678('0x38')]+'%'};return _0xcb610a;})});}_0xf89d7f=_[_0x4678('0x37')]({},_0xf89d7f,_0x3866d8[_0x4678('0x3a')]);return db['CmHopperBlack']['count']({'where':_0xf89d7f[_0x4678('0x34')]})[_0x4678('0x1d')](function(_0x53d047){_0x5cb173[_0x4678('0x17')]=_0x53d047;if(_0x3866d8[_0x4678('0x28')][_0x4678('0x3b')]){_0xf89d7f[_0x4678('0x3c')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0xf89d7f);})[_0x4678('0x1d')](function(_0x94c32e){_0x5cb173['rows']=_0x94c32e;return _0x5cb173;});}})[_0x4678('0x1d')](respondWithFilteredResult(_0x1044a1,_0xf89d7f))['catch'](handleError(_0x1044a1,null));};exports[_0x4678('0x53')]=function(_0x476cff,_0x46614f,_0x2ecf18){var _0x46f1e3={};var _0x4fcd37={};var _0x12b629;var _0x2e3caf;return db[_0x4678('0x24')][_0x4678('0x49')]({'where':{'id':_0x476cff[_0x4678('0x3f')]['id']}})[_0x4678('0x1d')](handleEntityNotFound(_0x46614f,null))[_0x4678('0x1d')](function(_0xfe5aaa){if(_0xfe5aaa){_0x12b629=_0xfe5aaa;_0x4fcd37[_0x4678('0x26')]=_[_0x4678('0x27')](db[_0x4678('0x54')][_0x4678('0x25')]);_0x4fcd37[_0x4678('0x28')]=_[_0x4678('0x27')](_0x476cff[_0x4678('0x28')]);_0x4fcd37[_0x4678('0x2b')]=_[_0x4678('0x2c')](_0x4fcd37[_0x4678('0x26')],_0x4fcd37[_0x4678('0x28')]);_0x46f1e3[_0x4678('0x2d')]=_[_0x4678('0x2c')](_0x4fcd37[_0x4678('0x26')],qs[_0x4678('0x2e')](_0x476cff[_0x4678('0x28')][_0x4678('0x2e')]));_0x46f1e3[_0x4678('0x2d')]=_0x46f1e3['attributes'][_0x4678('0x2f')]?_0x46f1e3[_0x4678('0x2d')]:_0x4fcd37[_0x4678('0x26')];_0x46f1e3[_0x4678('0x32')]=qs[_0x4678('0x33')](_0x476cff[_0x4678('0x28')]['sort']);_0x46f1e3[_0x4678('0x34')]=qs[_0x4678('0x2b')](_['pick'](_0x476cff[_0x4678('0x28')],_0x4fcd37[_0x4678('0x2b')]));if(_0x476cff[_0x4678('0x28')][_0x4678('0x38')]){_0x46f1e3[_0x4678('0x34')]=_[_0x4678('0x37')](_0x46f1e3[_0x4678('0x34')],{'$or':_[_0x4678('0x39')](_0x46f1e3[_0x4678('0x2d')],function(_0x490ae2){var _0x518b04={};_0x518b04[_0x490ae2]={'$like':'%'+_0x476cff['query'][_0x4678('0x38')]+'%'};return _0x518b04;})});}_0x46f1e3=_[_0x4678('0x37')]({},_0x46f1e3,_0x476cff[_0x4678('0x3a')]);return _0x12b629[_0x4678('0x53')](_0x46f1e3);}})[_0x4678('0x1d')](function(_0x4d27fb){if(_0x4d27fb){_0x2e3caf=_0x4d27fb['length'];if(!_0x476cff[_0x4678('0x28')][_0x4678('0x30')](_0x4678('0x31'))){_0x46f1e3[_0x4678('0x19')]=qs['limit'](_0x476cff[_0x4678('0x28')][_0x4678('0x19')]);_0x46f1e3[_0x4678('0x18')]=qs[_0x4678('0x18')](_0x476cff[_0x4678('0x28')][_0x4678('0x18')]);}return _0x12b629[_0x4678('0x53')](_0x46f1e3);}})[_0x4678('0x1d')](function(_0x388002){if(_0x388002){return _0x388002?{'count':_0x2e3caf,'rows':_0x388002}:null;}})['then'](respondWithResult(_0x46614f,null))[_0x4678('0x3e')](handleError(_0x46614f,null));};exports['addLists']=function(_0x30cb1d,_0x4b0ac7,_0x23e476){var _0x5b6688,_0x768e79;return db[_0x4678('0x24')][_0x4678('0x40')]({'where':{'id':_0x30cb1d[_0x4678('0x3f')]['id']}})[_0x4678('0x1d')](handleEntityNotFound(_0x4b0ac7,null))[_0x4678('0x1d')](function(_0x5d3497){if(_0x5d3497){_0x768e79=_0x5d3497;return _0x5d3497[_0x4678('0x55')](_0x30cb1d[_0x4678('0x42')][_0x4678('0x56')],_[_0x4678('0x45')](_0x30cb1d[_0x4678('0x42')],[_0x4678('0x56'),'id'])||{});}return null;})[_0x4678('0x57')](function(_0x27bee4){var _0x12f3ed;_0x5b6688=_0x27bee4||[];var _0x56000a=[];if(_0x27bee4){for(var _0x1a6d67=0x0;_0x1a6d67<_0x27bee4['length'];_0x1a6d67+=0x1){var _0x1c65a3=_0x27bee4[_0x1a6d67]['get']({'plain':!![]});_0x768e79[_0x4678('0x58')]=_0x30cb1d[_0x4678('0x42')][_0x4678('0x58')]?_0x30cb1d['body'][_0x4678('0x58')]:_0x768e79['dialCheckDuplicateType'];switch(_0x768e79[_0x4678('0x58')]){case _0x4678('0x59'):_0x12f3ed=squel[_0x4678('0x5a')]()[_0x4678('0x5b')]('cm_hopper')[_0x4678('0x5c')]([_0x4678('0x5d'),_0x4678('0x5e'),_0x4678('0x5f'),'ListId',_0x4678('0x4c'),_0x4678('0x47'),_0x4678('0x46')],squel[_0x4678('0x60')]()[_0x4678('0x61')](_0x4678('0x5d'),'phone')[_0x4678('0x61')](_0x4678('0x62'),_0x4678('0x5e'))[_0x4678('0x61')]('id',_0x4678('0x5f'))[_0x4678('0x61')](_0x1c65a3[_0x4678('0x63')][_0x4678('0x64')](),'ListId')[_0x4678('0x61')](_0x30cb1d[_0x4678('0x3f')]['id'][_0x4678('0x64')](),_0x4678('0x4c'))[_0x4678('0x61')](_0x4678('0x62'),_0x4678('0x47'))[_0x4678('0x61')](_0x4678('0x62'),_0x4678('0x46'))[_0x4678('0x65')](_0x4678('0x66'))['where']('deletedAt\x20IS\x20NULL')[_0x4678('0x34')](_0x4678('0x67'),_0x1c65a3[_0x4678('0x63')]['toString']())[_0x4678('0x34')](_0x4678('0x68'))[_0x4678('0x34')](_0x4678('0x69'),squel['select']()[_0x4678('0x61')](_0x4678('0x6a'))[_0x4678('0x65')](_0x4678('0x6b'))[_0x4678('0x34')](_0x4678('0x6c'),_0x30cb1d[_0x4678('0x3f')]['id'][_0x4678('0x64')]()))['where'](_0x4678('0x69'),squel[_0x4678('0x60')]()[_0x4678('0x61')]('phone')[_0x4678('0x65')](_0x4678('0x6d'))[_0x4678('0x34')](_0x4678('0x6c'),_0x30cb1d['params']['id'][_0x4678('0x64')]())))['toString']();break;case _0x4678('0x6e'):_0x12f3ed=squel[_0x4678('0x5a')]()[_0x4678('0x5b')]('cm_hopper')[_0x4678('0x5c')]([_0x4678('0x5d'),'scheduledAt',_0x4678('0x5f'),_0x4678('0x6f'),_0x4678('0x4c'),'createdAt',_0x4678('0x46')],squel[_0x4678('0x60')]()[_0x4678('0x61')](_0x4678('0x5d'),_0x4678('0x5d'))[_0x4678('0x61')](_0x4678('0x62'),_0x4678('0x5e'))[_0x4678('0x61')]('id',_0x4678('0x5f'))[_0x4678('0x61')](_0x1c65a3[_0x4678('0x63')]['toString'](),'ListId')[_0x4678('0x61')](_0x30cb1d['params']['id'][_0x4678('0x64')](),_0x4678('0x4c'))[_0x4678('0x61')](_0x4678('0x62'),_0x4678('0x47'))['field']('NOW()',_0x4678('0x46'))[_0x4678('0x65')](_0x4678('0x66'))[_0x4678('0x34')](_0x4678('0x70'))[_0x4678('0x34')](_0x4678('0x67'),_0x1c65a3[_0x4678('0x63')][_0x4678('0x64')]())['where'](_0x4678('0x68'))[_0x4678('0x34')](_0x4678('0x69'),squel['select']()[_0x4678('0x61')]('phone')[_0x4678('0x65')]('cm_hopper')[_0x4678('0x34')](_0x4678('0x6c'),_0x30cb1d[_0x4678('0x3f')]['id'][_0x4678('0x64')]())))[_0x4678('0x64')]();break;default:_0x12f3ed=squel[_0x4678('0x5a')]()['into']('cm_hopper')['fromQuery']([_0x4678('0x5d'),_0x4678('0x5e'),_0x4678('0x5f'),_0x4678('0x6f'),_0x4678('0x4c'),_0x4678('0x47'),_0x4678('0x46')],squel[_0x4678('0x60')]()['field'](_0x4678('0x5d'),_0x4678('0x5d'))[_0x4678('0x61')]('NOW()',_0x4678('0x5e'))['field']('id',_0x4678('0x5f'))[_0x4678('0x61')](_0x1c65a3[_0x4678('0x63')]['toString'](),_0x4678('0x6f'))[_0x4678('0x61')](_0x30cb1d[_0x4678('0x3f')]['id'][_0x4678('0x64')](),_0x4678('0x4c'))[_0x4678('0x61')](_0x4678('0x62'),_0x4678('0x47'))[_0x4678('0x61')](_0x4678('0x62'),_0x4678('0x46'))['from'](_0x4678('0x66'))[_0x4678('0x34')](_0x4678('0x70'))[_0x4678('0x34')](_0x4678('0x67'),_0x1c65a3['CmListId'][_0x4678('0x64')]())[_0x4678('0x34')]('phone\x20IS\x20NOT\x20NULL'))[_0x4678('0x64')]();}_0x56000a[_0x4678('0x71')](db[_0x4678('0x72')][_0x4678('0x28')](_0x12f3ed));}return BPromise[_0x4678('0x73')](_0x56000a);}})[_0x4678('0x1d')](function(){return _0x5b6688;})[_0x4678('0x1d')](respondWithResult(_0x4b0ac7,null))[_0x4678('0x3e')](handleError(_0x4b0ac7,null));};exports[_0x4678('0x74')]=function(_0x220b82,_0x58a4d4,_0x3bf76c){var _0x2857b1;return db[_0x4678('0x24')][_0x4678('0x40')]({'where':{'id':_0x220b82[_0x4678('0x3f')]['id']}})[_0x4678('0x1d')](handleEntityNotFound(_0x58a4d4,null))[_0x4678('0x1d')](function(_0x319f7e){if(_0x319f7e){return _0x319f7e[_0x4678('0x74')](_0x220b82[_0x4678('0x28')][_0x4678('0x56')]);}})[_0x4678('0x1d')](function(_0x2d2de1){if(_0x2d2de1){_0x2857b1=_0x2d2de1;return db[_0x4678('0x4a')][_0x4678('0x1e')]({'where':{'ListId':_0x220b82[_0x4678('0x28')][_0x4678('0x56')],'CampaignId':_0x220b82['params']['id']}})[_0x4678('0x1d')](function(){return _0x2857b1;});}})[_0x4678('0x1d')](respondWithStatusCode(_0x58a4d4,null))[_0x4678('0x3e')](handleError(_0x58a4d4,null));};exports[_0x4678('0x75')]=function(_0x51d219,_0x4945fb,_0x2d0d6c){var _0x336a73={'raw':!![],'where':{}};var _0xe086c5={};var _0xc4a5e3={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x51d219[_0x4678('0x3f')]['id']}})[_0x4678('0x1d')](handleEntityNotFound(_0x4945fb,null))[_0x4678('0x1d')](function(_0x57451f){if(_0x57451f){_0xe086c5[_0x4678('0x26')]=_[_0x4678('0x27')](db[_0x4678('0x54')][_0x4678('0x25')]);_0xe086c5[_0x4678('0x28')]=_['keys'](_0x51d219[_0x4678('0x28')]);_0xe086c5['filters']=_['intersection'](_0xe086c5['model'],_0xe086c5[_0x4678('0x28')]);_0x336a73[_0x4678('0x2d')]=_[_0x4678('0x2c')](_0xe086c5[_0x4678('0x26')],qs[_0x4678('0x2e')](_0x51d219[_0x4678('0x28')][_0x4678('0x2e')]));_0x336a73[_0x4678('0x2d')]=_0x336a73[_0x4678('0x2d')][_0x4678('0x2f')]?_0x336a73[_0x4678('0x2d')]:_0xe086c5[_0x4678('0x26')];if(!_0x51d219[_0x4678('0x28')][_0x4678('0x30')](_0x4678('0x31'))){_0x336a73['limit']=qs[_0x4678('0x19')](_0x51d219[_0x4678('0x28')]['limit']);_0x336a73[_0x4678('0x18')]=qs[_0x4678('0x18')](_0x51d219['query']['offset']);}_0x336a73[_0x4678('0x32')]=qs[_0x4678('0x33')](_0x51d219[_0x4678('0x28')][_0x4678('0x33')]);_0x336a73[_0x4678('0x34')]=qs['filters'](_[_0x4678('0x4b')](_0x51d219[_0x4678('0x28')],_0xe086c5[_0x4678('0x2b')]));_0x336a73[_0x4678('0x34')]['CampaignId']=_0x57451f['id'];if(_0x51d219['query'][_0x4678('0x38')]){_0x336a73[_0x4678('0x34')]=_[_0x4678('0x37')](_0x336a73[_0x4678('0x34')],{'$or':_[_0x4678('0x39')](_0x336a73[_0x4678('0x2d')],function(_0x125a59){var _0x2b3a94={};_0x2b3a94[_0x125a59]={'$like':'%'+_0x51d219[_0x4678('0x28')]['filter']+'%'};return _0x2b3a94;})});}_0x336a73=_[_0x4678('0x37')]({},_0x336a73,_0x51d219[_0x4678('0x3a')]);return db[_0x4678('0x54')]['count']({'where':_0x336a73['where']})[_0x4678('0x1d')](function(_0x12a408){_0xc4a5e3[_0x4678('0x17')]=_0x12a408;if(_0x51d219[_0x4678('0x28')]['includeAll']){_0x336a73[_0x4678('0x3c')]=[{'all':!![]}];}return db[_0x4678('0x54')]['findAll'](_0x336a73);})[_0x4678('0x1d')](function(_0x2fed2e){_0xc4a5e3[_0x4678('0x4d')]=_0x2fed2e;return _0xc4a5e3;});}})[_0x4678('0x1d')](respondWithFilteredResult(_0x4945fb,_0x336a73))[_0x4678('0x3e')](handleError(_0x4945fb,null));};exports[_0x4678('0x76')]=function(_0x4c9aa8,_0x2d8070,_0x153986){var _0x3e171c,_0x2da6f1;return db[_0x4678('0x24')]['find']({'where':{'id':_0x4c9aa8[_0x4678('0x3f')]['id']}})[_0x4678('0x1d')](handleEntityNotFound(_0x2d8070,null))[_0x4678('0x1d')](function(_0x2af5a2){if(_0x2af5a2){_0x2da6f1=_0x2af5a2;return _0x2af5a2[_0x4678('0x76')](_0x4c9aa8[_0x4678('0x42')][_0x4678('0x56')],_[_0x4678('0x45')](_0x4c9aa8[_0x4678('0x42')],['ids','id'])||{});}return null;})['spread'](function(_0x5ab926){var _0x33b608;_0x3e171c=_0x5ab926||[];var _0x3c01f7=[];if(_0x5ab926){for(var _0x2236c9=0x0;_0x2236c9<_0x5ab926[_0x4678('0x2f')];_0x2236c9+=0x1){var _0x4f3d7e=_0x5ab926[_0x2236c9]['get']({'plain':!![]});_0x33b608=squel[_0x4678('0x5a')]()[_0x4678('0x5b')](_0x4678('0x77'))[_0x4678('0x5c')]([_0x4678('0x5d'),_0x4678('0x5f'),_0x4678('0x6f'),_0x4678('0x4c'),_0x4678('0x47'),_0x4678('0x46')],squel['select']()['field'](_0x4678('0x5d'),_0x4678('0x5d'))[_0x4678('0x61')]('id',_0x4678('0x5f'))[_0x4678('0x61')](_0x4f3d7e[_0x4678('0x63')]['toString'](),'ListId')[_0x4678('0x61')](_0x4c9aa8['params']['id'][_0x4678('0x64')](),'CampaignId')[_0x4678('0x61')](_0x4678('0x62'),'createdAt')[_0x4678('0x61')](_0x4678('0x62'),_0x4678('0x46'))[_0x4678('0x65')](_0x4678('0x66'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x4678('0x67'),_0x4f3d7e[_0x4678('0x63')][_0x4678('0x64')]())[_0x4678('0x34')](_0x4678('0x68')))['toString']();_0x3c01f7['push'](db['sequelize'][_0x4678('0x28')](_0x33b608));}return BPromise[_0x4678('0x73')](_0x3c01f7);}})['then'](function(){return _0x3e171c;})[_0x4678('0x1d')](respondWithResult(_0x2d8070,null))[_0x4678('0x3e')](handleError(_0x2d8070,null));};exports[_0x4678('0x78')]=function(_0x562da6,_0x49a778,_0xa23318){var _0x41ca32;return db[_0x4678('0x24')][_0x4678('0x40')]({'where':{'id':_0x562da6[_0x4678('0x3f')]['id']}})[_0x4678('0x1d')](handleEntityNotFound(_0x49a778,null))[_0x4678('0x1d')](function(_0x31f0db){if(_0x31f0db){return _0x31f0db[_0x4678('0x78')](_0x562da6['query'][_0x4678('0x56')]);}})['then'](function(_0x2b0d12){if(_0x2b0d12){_0x41ca32=_0x2b0d12;return db['CmHopperBlack'][_0x4678('0x1e')]({'where':{'ListId':_0x562da6[_0x4678('0x28')][_0x4678('0x56')],'CampaignId':_0x562da6[_0x4678('0x3f')]['id']}})[_0x4678('0x1d')](function(){return _0x41ca32;});}})[_0x4678('0x1d')](respondWithStatusCode(_0x49a778,null))[_0x4678('0x3e')](handleError(_0x49a778,null));};
\ No newline at end of file
+var _0xd450=['set','reject','save','update','then','destroy','error','send','index','Campaign','rawAttributes','keys','query','dateStart','dateEnd','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','add','day','filter','merge','options','count','includeAll','include','findAll','rows','show','length','find','catch','create','clone','params','omit','updatedAt','body','createdAt','getHoppers','findOne','CmHopper','pick','CampaignId','map','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','get','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','ContactId','select','phone','field','NOW()','scheduledAt','CmListId','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','from','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','sendStatus','end','json','offset','status'];(function(_0x313772,_0x404901){var _0x19fcc8=function(_0x192bfe){while(--_0x192bfe){_0x313772['push'](_0x313772['shift']());}};_0x19fcc8(++_0x404901);}(_0xd450,0x157));var _0x0d45=function(_0x43e887,_0x172567){_0x43e887=_0x43e887-0x0;var _0x5dad70=_0xd450[_0x43e887];return _0x5dad70;};'use strict';var pdf=require(_0x0d45('0x0'));var emlformat=require(_0x0d45('0x1'));var rimraf=require(_0x0d45('0x2'));var zipdir=require(_0x0d45('0x3'));var jsonpatch=require(_0x0d45('0x4'));var rp=require(_0x0d45('0x5'));var moment=require(_0x0d45('0x6'));var BPromise=require(_0x0d45('0x7'));var Mustache=require(_0x0d45('0x8'));var util=require(_0x0d45('0x9'));var path=require('path');var sox=require(_0x0d45('0xa'));var csv=require(_0x0d45('0xb'));var ejs=require(_0x0d45('0xc'));var fs=require('fs');var _=require(_0x0d45('0xd'));var squel=require(_0x0d45('0xe'));var crypto=require('crypto');var jsforce=require(_0x0d45('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0d45('0xb'));var querystring=require(_0x0d45('0x10'));var Papa=require(_0x0d45('0x11'));var qs=require(_0x0d45('0x12'));var logger=require(_0x0d45('0x13'))('api');var utils=require(_0x0d45('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15f685,_0x1f98dd){_0x1f98dd=_0x1f98dd||0xcc;return function(_0x12649c){if(_0x12649c){return _0x15f685[_0x0d45('0x15')](_0x1f98dd);}return _0x15f685['status'](_0x1f98dd)[_0x0d45('0x16')]();};}function respondWithResult(_0xa78152,_0x436f7b){_0x436f7b=_0x436f7b||0xc8;return function(_0x2ff6c9){if(_0x2ff6c9){return _0xa78152['status'](_0x436f7b)[_0x0d45('0x17')](_0x2ff6c9);}};}function respondWithFilteredResult(_0x4cb93d,_0x3e977f){return function(_0x30d068){if(_0x30d068){var _0x3a18b3=_0x30d068['count'],_0x54c1bd=_0x3e977f[_0x0d45('0x18')],_0xcc8864=_0x3e977f[_0x0d45('0x18')]+_0x3e977f['limit'],_0x5a7e52;if(_0xcc8864>=_0x3a18b3){_0xcc8864=_0x3a18b3;_0x5a7e52=0xc8;}else{_0x5a7e52=0xce;}_0x4cb93d[_0x0d45('0x19')](_0x5a7e52);return _0x4cb93d[_0x0d45('0x1a')]('Content-Range',_0x54c1bd+'-'+_0xcc8864+'/'+_0x3a18b3)[_0x0d45('0x17')](_0x30d068);}return null;};}function patchUpdates(_0x2a4398){return function(_0x535a6d){try{jsonpatch['apply'](_0x535a6d,_0x2a4398,!![]);}catch(_0xf920db){return BPromise[_0x0d45('0x1b')](_0xf920db);}return _0x535a6d[_0x0d45('0x1c')]();};}function saveUpdates(_0x16457e,_0x12a83d){return function(_0xb0085e){if(_0xb0085e){return _0xb0085e[_0x0d45('0x1d')](_0x16457e)[_0x0d45('0x1e')](function(_0x2020d1){return _0x2020d1;});}return null;};}function removeEntity(_0x282c4b,_0x216747){return function(_0xfc989c){if(_0xfc989c){return _0xfc989c[_0x0d45('0x1f')]()['then'](function(){_0x282c4b[_0x0d45('0x19')](0xcc)[_0x0d45('0x16')]();});}};}function handleEntityNotFound(_0x1ce316,_0x47ee58){return function(_0x4a5f68){if(!_0x4a5f68){_0x1ce316[_0x0d45('0x15')](0x194);}return _0x4a5f68;};}function handleError(_0xd6b10b,_0x4221ea){_0x4221ea=_0x4221ea||0x1f4;return function(_0x29c2d5){logger[_0x0d45('0x20')](_0x29c2d5['stack']);if(_0x29c2d5['name']){delete _0x29c2d5['name'];}_0xd6b10b[_0x0d45('0x19')](_0x4221ea)[_0x0d45('0x21')](_0x29c2d5);};}exports[_0x0d45('0x22')]=function(_0x188087,_0x4917f6){var _0x1f0b54={},_0x5b8cb4={},_0x441ea4={'count':0x0,'rows':[]};var _0xcc6852=db[_0x0d45('0x23')][_0x0d45('0x24')];_0x5b8cb4['model']=_[_0x0d45('0x25')](_0xcc6852);var _0x5e229a={'dateStart':_0x188087[_0x0d45('0x26')][_0x0d45('0x27')],'dateEnd':_0x188087['query'][_0x0d45('0x28')]};delete _0x188087[_0x0d45('0x26')][_0x0d45('0x27')];delete _0x188087[_0x0d45('0x26')]['dateEnd'];_0x5b8cb4[_0x0d45('0x26')]=_[_0x0d45('0x25')](_0x188087['query']);_0x5b8cb4['filters']=_[_0x0d45('0x29')](_0x5b8cb4[_0x0d45('0x2a')],_0x5b8cb4[_0x0d45('0x26')]);_0x1f0b54['attributes']=_[_0x0d45('0x29')](_0x5b8cb4[_0x0d45('0x2a')],qs['fields'](_0x188087[_0x0d45('0x26')][_0x0d45('0x2b')]));_0x1f0b54['attributes']=_0x1f0b54[_0x0d45('0x2c')]['length']?_0x1f0b54[_0x0d45('0x2c')]:_0x5b8cb4[_0x0d45('0x2a')];if(!_0x188087[_0x0d45('0x26')][_0x0d45('0x2d')](_0x0d45('0x2e'))){_0x1f0b54[_0x0d45('0x2f')]=qs['limit'](_0x188087[_0x0d45('0x26')][_0x0d45('0x2f')]);_0x1f0b54[_0x0d45('0x18')]=qs['offset'](_0x188087[_0x0d45('0x26')]['offset']);}_0x1f0b54[_0x0d45('0x30')]=qs[_0x0d45('0x31')](_0x188087[_0x0d45('0x26')][_0x0d45('0x31')]);_0x1f0b54[_0x0d45('0x32')]=qs['filters'](_['pick'](_0x188087['query'],_0x5b8cb4[_0x0d45('0x33')]));if(_0x5e229a[_0x0d45('0x27')]){if(_0x5e229a[_0x0d45('0x28')]){_0x5e229a[_0x0d45('0x28')]=moment(_0x5e229a[_0x0d45('0x28')])[_0x0d45('0x34')](0x1,_0x0d45('0x35'));}else{_0x5e229a[_0x0d45('0x28')]=moment(_0x5e229a['dateStart'])[_0x0d45('0x34')](0x1,_0x0d45('0x35'));}_['merge'](_0x1f0b54[_0x0d45('0x32')],{'createdAt':{'$gte':_0x5e229a[_0x0d45('0x27')],'$lte':_0x5e229a[_0x0d45('0x28')]}});}if(_0x188087[_0x0d45('0x26')][_0x0d45('0x36')]){_0x1f0b54[_0x0d45('0x32')]=_[_0x0d45('0x37')](_0x1f0b54[_0x0d45('0x32')],{'$or':_['map'](_0x1f0b54[_0x0d45('0x2c')],function(_0x3c9b7b){var _0x1d7178={};_0x1d7178[_0x3c9b7b]={'$like':'%'+_0x188087[_0x0d45('0x26')][_0x0d45('0x36')]+'%'};return _0x1d7178;})});}_0x1f0b54=_[_0x0d45('0x37')]({},_0x1f0b54,_0x188087[_0x0d45('0x38')]);var _0x2f5d0e={'where':_0x1f0b54[_0x0d45('0x32')]};return db[_0x0d45('0x23')][_0x0d45('0x39')](_0x2f5d0e)[_0x0d45('0x1e')](function(_0x25515b){_0x441ea4[_0x0d45('0x39')]=_0x25515b;if(_0x188087['query'][_0x0d45('0x3a')]){_0x1f0b54[_0x0d45('0x3b')]=[{'all':!![]}];}return db[_0x0d45('0x23')][_0x0d45('0x3c')](_0x1f0b54);})[_0x0d45('0x1e')](function(_0x4e7a69){_0x441ea4[_0x0d45('0x3d')]=_0x4e7a69;return _0x441ea4;})[_0x0d45('0x1e')](respondWithFilteredResult(_0x4917f6,_0x1f0b54))['catch'](handleError(_0x4917f6,null));};exports[_0x0d45('0x3e')]=function(_0x17e04a,_0x447c3e){var _0xea94a0={'raw':![],'where':{'id':_0x17e04a['params']['id']}},_0x5aaa8f={};_0x5aaa8f[_0x0d45('0x2a')]=_[_0x0d45('0x25')](db[_0x0d45('0x23')]['rawAttributes']);_0x5aaa8f[_0x0d45('0x26')]=_[_0x0d45('0x25')](_0x17e04a['query']);_0x5aaa8f[_0x0d45('0x33')]=_[_0x0d45('0x29')](_0x5aaa8f[_0x0d45('0x2a')],_0x5aaa8f[_0x0d45('0x26')]);_0xea94a0['attributes']=_['intersection'](_0x5aaa8f[_0x0d45('0x2a')],qs[_0x0d45('0x2b')](_0x17e04a[_0x0d45('0x26')]['fields']));_0xea94a0[_0x0d45('0x2c')]=_0xea94a0['attributes'][_0x0d45('0x3f')]?_0xea94a0[_0x0d45('0x2c')]:_0x5aaa8f['model'];if(_0x17e04a[_0x0d45('0x26')][_0x0d45('0x3a')]){_0xea94a0[_0x0d45('0x3b')]=[{'all':!![]}];}_0xea94a0=_['merge']({},_0xea94a0,_0x17e04a[_0x0d45('0x38')]);return db[_0x0d45('0x23')][_0x0d45('0x40')](_0xea94a0)[_0x0d45('0x1e')](handleEntityNotFound(_0x447c3e,null))[_0x0d45('0x1e')](respondWithResult(_0x447c3e,null))[_0x0d45('0x41')](handleError(_0x447c3e,null));};exports[_0x0d45('0x42')]=function(_0x551d03,_0x20a20b){return db[_0x0d45('0x23')][_0x0d45('0x42')](_0x551d03['body'],{})['then'](respondWithResult(_0x20a20b,0xc9))[_0x0d45('0x41')](handleError(_0x20a20b,null));};exports[_0x0d45('0x43')]=function(_0x2ede87,_0x129660){var _0x11d3ff={'raw':![],'where':{'id':_0x2ede87[_0x0d45('0x44')]['id']}},_0x223943={};_0x223943[_0x0d45('0x2a')]=_[_0x0d45('0x25')](db[_0x0d45('0x23')][_0x0d45('0x24')]);_0x11d3ff['attributes']=_[_0x0d45('0x29')](_0x223943[_0x0d45('0x2a')],qs[_0x0d45('0x2b')](_0x2ede87[_0x0d45('0x26')][_0x0d45('0x2b')]));_0x11d3ff[_0x0d45('0x2c')]=_0x11d3ff[_0x0d45('0x2c')][_0x0d45('0x3f')]?_0x11d3ff[_0x0d45('0x2c')]:_0x223943[_0x0d45('0x2a')];if(_0x2ede87[_0x0d45('0x26')][_0x0d45('0x3a')]){_0x11d3ff[_0x0d45('0x3b')]=[{'all':!![]}];}_0x11d3ff=_[_0x0d45('0x37')]({},_0x11d3ff,_0x2ede87[_0x0d45('0x38')]);return db[_0x0d45('0x23')][_0x0d45('0x40')](_0x11d3ff)['then'](handleEntityNotFound(_0x129660,null))[_0x0d45('0x1e')](function(_0x27ee44){if(_0x27ee44){var _0x4e6d55=_0x27ee44['get']({'plain':!![]});_0x4e6d55=qs[_0x0d45('0x45')](_0x4e6d55,['id','createdAt',_0x0d45('0x46')]);_0x2ede87[_0x0d45('0x47')]=_[_0x0d45('0x45')](_0x2ede87[_0x0d45('0x47')],['id',_0x0d45('0x48'),_0x0d45('0x46')]);return db[_0x0d45('0x23')][_0x0d45('0x42')](_[_0x0d45('0x37')](_0x4e6d55,_0x2ede87[_0x0d45('0x47')]),{'include':_0x2ede87[_0x0d45('0x26')][_0x0d45('0x3a')]?[{'all':!![]}]:undefined});}})[_0x0d45('0x1e')](respondWithResult(_0x129660,0xc9))[_0x0d45('0x41')](handleError(_0x129660,null));};exports['update']=function(_0x486fb0,_0x50d439){if(_0x486fb0['body']['id']){delete _0x486fb0[_0x0d45('0x47')]['id'];}return db[_0x0d45('0x23')][_0x0d45('0x40')]({'where':{'id':_0x486fb0[_0x0d45('0x44')]['id']}})[_0x0d45('0x1e')](handleEntityNotFound(_0x50d439,null))[_0x0d45('0x1e')](saveUpdates(_0x486fb0[_0x0d45('0x47')],null))[_0x0d45('0x1e')](respondWithResult(_0x50d439,null))[_0x0d45('0x41')](handleError(_0x50d439,null));};exports['destroy']=function(_0x4de6f7,_0x8f55f4){return db[_0x0d45('0x23')][_0x0d45('0x40')]({'where':{'id':_0x4de6f7[_0x0d45('0x44')]['id']}})[_0x0d45('0x1e')](handleEntityNotFound(_0x8f55f4,null))[_0x0d45('0x1e')](removeEntity(_0x8f55f4,null))['catch'](handleError(_0x8f55f4,null));};exports[_0x0d45('0x49')]=function(_0xd93b68,_0x2f256f,_0x13c2de){var _0x499103={'raw':!![],'where':{}};var _0x15c834={};var _0x15f23c={'count':0x0,'rows':[]};return db[_0x0d45('0x23')][_0x0d45('0x4a')]({'where':{'id':_0xd93b68[_0x0d45('0x44')]['id']}})[_0x0d45('0x1e')](handleEntityNotFound(_0x2f256f,null))[_0x0d45('0x1e')](function(_0x1ed7fe){if(_0x1ed7fe){_0x15c834[_0x0d45('0x2a')]=_[_0x0d45('0x25')](db[_0x0d45('0x4b')][_0x0d45('0x24')]);_0x15c834[_0x0d45('0x26')]=_[_0x0d45('0x25')](_0xd93b68[_0x0d45('0x26')]);_0x15c834[_0x0d45('0x33')]=_[_0x0d45('0x29')](_0x15c834['model'],_0x15c834['query']);_0x499103[_0x0d45('0x2c')]=_[_0x0d45('0x29')](_0x15c834[_0x0d45('0x2a')],qs[_0x0d45('0x2b')](_0xd93b68[_0x0d45('0x26')][_0x0d45('0x2b')]));_0x499103[_0x0d45('0x2c')]=_0x499103[_0x0d45('0x2c')][_0x0d45('0x3f')]?_0x499103['attributes']:_0x15c834[_0x0d45('0x2a')];if(!_0xd93b68[_0x0d45('0x26')][_0x0d45('0x2d')]('nolimit')){_0x499103[_0x0d45('0x2f')]=qs[_0x0d45('0x2f')](_0xd93b68[_0x0d45('0x26')][_0x0d45('0x2f')]);_0x499103[_0x0d45('0x18')]=qs['offset'](_0xd93b68[_0x0d45('0x26')]['offset']);}_0x499103[_0x0d45('0x30')]=qs[_0x0d45('0x31')](_0xd93b68[_0x0d45('0x26')]['sort']);_0x499103[_0x0d45('0x32')]=qs['filters'](_[_0x0d45('0x4c')](_0xd93b68[_0x0d45('0x26')],_0x15c834['filters']));_0x499103[_0x0d45('0x32')][_0x0d45('0x4d')]=_0x1ed7fe['id'];if(_0xd93b68[_0x0d45('0x26')][_0x0d45('0x36')]){_0x499103['where']=_[_0x0d45('0x37')](_0x499103['where'],{'$or':_[_0x0d45('0x4e')](_0x499103[_0x0d45('0x2c')],function(_0x1af95f){var _0x4fde5b={};_0x4fde5b[_0x1af95f]={'$like':'%'+_0xd93b68[_0x0d45('0x26')][_0x0d45('0x36')]+'%'};return _0x4fde5b;})});}_0x499103=_[_0x0d45('0x37')]({},_0x499103,_0xd93b68[_0x0d45('0x38')]);return db[_0x0d45('0x4b')][_0x0d45('0x39')]({'where':_0x499103[_0x0d45('0x32')]})[_0x0d45('0x1e')](function(_0x4f4e08){_0x15f23c[_0x0d45('0x39')]=_0x4f4e08;if(_0xd93b68[_0x0d45('0x26')]['includeAll']){_0x499103['include']=[{'all':!![]}];}return db['CmHopper'][_0x0d45('0x3c')](_0x499103);})[_0x0d45('0x1e')](function(_0x3cfaa8){_0x15f23c[_0x0d45('0x3d')]=_0x3cfaa8;return _0x15f23c;});}})[_0x0d45('0x1e')](respondWithFilteredResult(_0x2f256f,_0x499103))[_0x0d45('0x41')](handleError(_0x2f256f,null));};exports[_0x0d45('0x4f')]=function(_0x66b8ce,_0x8c6911,_0x50d000){var _0x5150db={'raw':!![],'where':{}};var _0x353dc4={};var _0xb0c516={'count':0x0,'rows':[]};return db['Campaign'][_0x0d45('0x4a')]({'where':{'id':_0x66b8ce[_0x0d45('0x44')]['id']}})[_0x0d45('0x1e')](handleEntityNotFound(_0x8c6911,null))[_0x0d45('0x1e')](function(_0xfb7974){if(_0xfb7974){_0x353dc4[_0x0d45('0x2a')]=_[_0x0d45('0x25')](db[_0x0d45('0x50')][_0x0d45('0x24')]);_0x353dc4[_0x0d45('0x26')]=_['keys'](_0x66b8ce[_0x0d45('0x26')]);_0x353dc4[_0x0d45('0x33')]=_[_0x0d45('0x29')](_0x353dc4['model'],_0x353dc4['query']);_0x5150db[_0x0d45('0x2c')]=_[_0x0d45('0x29')](_0x353dc4[_0x0d45('0x2a')],qs[_0x0d45('0x2b')](_0x66b8ce['query'][_0x0d45('0x2b')]));_0x5150db['attributes']=_0x5150db[_0x0d45('0x2c')]['length']?_0x5150db['attributes']:_0x353dc4[_0x0d45('0x2a')];if(!_0x66b8ce[_0x0d45('0x26')]['hasOwnProperty'](_0x0d45('0x2e'))){_0x5150db[_0x0d45('0x2f')]=qs[_0x0d45('0x2f')](_0x66b8ce[_0x0d45('0x26')][_0x0d45('0x2f')]);_0x5150db[_0x0d45('0x18')]=qs[_0x0d45('0x18')](_0x66b8ce[_0x0d45('0x26')][_0x0d45('0x18')]);}_0x5150db['order']=qs[_0x0d45('0x31')](_0x66b8ce[_0x0d45('0x26')]['sort']);_0x5150db[_0x0d45('0x32')]=qs['filters'](_['pick'](_0x66b8ce['query'],_0x353dc4[_0x0d45('0x33')]));_0x5150db['where'][_0x0d45('0x4d')]=_0xfb7974['id'];if(_0x66b8ce[_0x0d45('0x26')][_0x0d45('0x36')]){_0x5150db[_0x0d45('0x32')]=_[_0x0d45('0x37')](_0x5150db['where'],{'$or':_[_0x0d45('0x4e')](_0x5150db['attributes'],function(_0x56629c){var _0x202464={};_0x202464[_0x56629c]={'$like':'%'+_0x66b8ce['query']['filter']+'%'};return _0x202464;})});}_0x5150db=_['merge']({},_0x5150db,_0x66b8ce[_0x0d45('0x38')]);return db['CmHopperHistory'][_0x0d45('0x39')]({'where':_0x5150db['where']})['then'](function(_0x1ec014){_0xb0c516['count']=_0x1ec014;if(_0x66b8ce['query']['includeAll']){_0x5150db[_0x0d45('0x3b')]=[{'all':!![]}];}return db[_0x0d45('0x50')][_0x0d45('0x3c')](_0x5150db);})[_0x0d45('0x1e')](function(_0x1dc04f){_0xb0c516[_0x0d45('0x3d')]=_0x1dc04f;return _0xb0c516;});}})[_0x0d45('0x1e')](respondWithFilteredResult(_0x8c6911,_0x5150db))[_0x0d45('0x41')](handleError(_0x8c6911,null));};exports[_0x0d45('0x51')]=function(_0x5c06dd,_0x3df2f2,_0x2f4ff0){var _0x11c4f8={'raw':!![],'where':{}};var _0x493a8e={};var _0x2c3cb1={'count':0x0,'rows':[]};return db[_0x0d45('0x23')][_0x0d45('0x4a')]({'where':{'id':_0x5c06dd[_0x0d45('0x44')]['id']}})['then'](handleEntityNotFound(_0x3df2f2,null))['then'](function(_0x488800){if(_0x488800){_0x493a8e[_0x0d45('0x2a')]=_[_0x0d45('0x25')](db['CmHopperFinal']['rawAttributes']);_0x493a8e[_0x0d45('0x26')]=_[_0x0d45('0x25')](_0x5c06dd[_0x0d45('0x26')]);_0x493a8e[_0x0d45('0x33')]=_[_0x0d45('0x29')](_0x493a8e['model'],_0x493a8e['query']);_0x11c4f8[_0x0d45('0x2c')]=_[_0x0d45('0x29')](_0x493a8e[_0x0d45('0x2a')],qs['fields'](_0x5c06dd['query'][_0x0d45('0x2b')]));_0x11c4f8[_0x0d45('0x2c')]=_0x11c4f8[_0x0d45('0x2c')][_0x0d45('0x3f')]?_0x11c4f8[_0x0d45('0x2c')]:_0x493a8e[_0x0d45('0x2a')];if(!_0x5c06dd['query']['hasOwnProperty']('nolimit')){_0x11c4f8[_0x0d45('0x2f')]=qs[_0x0d45('0x2f')](_0x5c06dd[_0x0d45('0x26')][_0x0d45('0x2f')]);_0x11c4f8[_0x0d45('0x18')]=qs[_0x0d45('0x18')](_0x5c06dd[_0x0d45('0x26')][_0x0d45('0x18')]);}_0x11c4f8[_0x0d45('0x30')]=qs[_0x0d45('0x31')](_0x5c06dd[_0x0d45('0x26')][_0x0d45('0x31')]);_0x11c4f8['where']=qs['filters'](_[_0x0d45('0x4c')](_0x5c06dd[_0x0d45('0x26')],_0x493a8e[_0x0d45('0x33')]));_0x11c4f8[_0x0d45('0x32')]['CampaignId']=_0x488800['id'];if(_0x5c06dd[_0x0d45('0x26')][_0x0d45('0x36')]){_0x11c4f8[_0x0d45('0x32')]=_[_0x0d45('0x37')](_0x11c4f8['where'],{'$or':_[_0x0d45('0x4e')](_0x11c4f8[_0x0d45('0x2c')],function(_0xe6bd23){var _0x1073af={};_0x1073af[_0xe6bd23]={'$like':'%'+_0x5c06dd['query'][_0x0d45('0x36')]+'%'};return _0x1073af;})});}_0x11c4f8=_[_0x0d45('0x37')]({},_0x11c4f8,_0x5c06dd[_0x0d45('0x38')]);return db[_0x0d45('0x52')][_0x0d45('0x39')]({'where':_0x11c4f8[_0x0d45('0x32')]})[_0x0d45('0x1e')](function(_0x4673e2){_0x2c3cb1[_0x0d45('0x39')]=_0x4673e2;if(_0x5c06dd['query'][_0x0d45('0x3a')]){_0x11c4f8[_0x0d45('0x3b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x0d45('0x3c')](_0x11c4f8);})[_0x0d45('0x1e')](function(_0x16ff1b){_0x2c3cb1[_0x0d45('0x3d')]=_0x16ff1b;return _0x2c3cb1;});}})['then'](respondWithFilteredResult(_0x3df2f2,_0x11c4f8))[_0x0d45('0x41')](handleError(_0x3df2f2,null));};exports[_0x0d45('0x53')]=function(_0x4b675d,_0x2ec3bd,_0x4ac9a1){var _0x408e36={'raw':!![],'where':{}};var _0x4fa202={};var _0x384bb3={'count':0x0,'rows':[]};return db['Campaign'][_0x0d45('0x4a')]({'where':{'id':_0x4b675d[_0x0d45('0x44')]['id']}})['then'](handleEntityNotFound(_0x2ec3bd,null))['then'](function(_0x2cfc09){if(_0x2cfc09){_0x4fa202['model']=_[_0x0d45('0x25')](db['CmHopperBlack']['rawAttributes']);_0x4fa202[_0x0d45('0x26')]=_[_0x0d45('0x25')](_0x4b675d[_0x0d45('0x26')]);_0x4fa202[_0x0d45('0x33')]=_['intersection'](_0x4fa202[_0x0d45('0x2a')],_0x4fa202[_0x0d45('0x26')]);_0x408e36[_0x0d45('0x2c')]=_['intersection'](_0x4fa202[_0x0d45('0x2a')],qs[_0x0d45('0x2b')](_0x4b675d[_0x0d45('0x26')][_0x0d45('0x2b')]));_0x408e36[_0x0d45('0x2c')]=_0x408e36['attributes']['length']?_0x408e36[_0x0d45('0x2c')]:_0x4fa202[_0x0d45('0x2a')];if(!_0x4b675d[_0x0d45('0x26')]['hasOwnProperty']('nolimit')){_0x408e36[_0x0d45('0x2f')]=qs['limit'](_0x4b675d[_0x0d45('0x26')]['limit']);_0x408e36['offset']=qs['offset'](_0x4b675d[_0x0d45('0x26')][_0x0d45('0x18')]);}_0x408e36['order']=qs['sort'](_0x4b675d['query'][_0x0d45('0x31')]);_0x408e36[_0x0d45('0x32')]=qs[_0x0d45('0x33')](_[_0x0d45('0x4c')](_0x4b675d['query'],_0x4fa202[_0x0d45('0x33')]));_0x408e36[_0x0d45('0x32')]['CampaignId']=_0x2cfc09['id'];if(_0x4b675d['query']['filter']){_0x408e36['where']=_[_0x0d45('0x37')](_0x408e36[_0x0d45('0x32')],{'$or':_['map'](_0x408e36[_0x0d45('0x2c')],function(_0x14f8e5){var _0x358dcd={};_0x358dcd[_0x14f8e5]={'$like':'%'+_0x4b675d[_0x0d45('0x26')][_0x0d45('0x36')]+'%'};return _0x358dcd;})});}_0x408e36=_[_0x0d45('0x37')]({},_0x408e36,_0x4b675d[_0x0d45('0x38')]);return db[_0x0d45('0x54')][_0x0d45('0x39')]({'where':_0x408e36[_0x0d45('0x32')]})['then'](function(_0x1bd969){_0x384bb3[_0x0d45('0x39')]=_0x1bd969;if(_0x4b675d[_0x0d45('0x26')]['includeAll']){_0x408e36['include']=[{'all':!![]}];}return db[_0x0d45('0x54')][_0x0d45('0x3c')](_0x408e36);})['then'](function(_0x2f067d){_0x384bb3[_0x0d45('0x3d')]=_0x2f067d;return _0x384bb3;});}})[_0x0d45('0x1e')](respondWithFilteredResult(_0x2ec3bd,_0x408e36))[_0x0d45('0x41')](handleError(_0x2ec3bd,null));};exports[_0x0d45('0x55')]=function(_0xdcac31,_0x191fdc,_0x5d2381){var _0x146657={};var _0x4627bc={};var _0x48b18a;var _0x33016c;return db[_0x0d45('0x23')][_0x0d45('0x4a')]({'where':{'id':_0xdcac31[_0x0d45('0x44')]['id']}})['then'](handleEntityNotFound(_0x191fdc,null))[_0x0d45('0x1e')](function(_0x4508dc){if(_0x4508dc){_0x48b18a=_0x4508dc;_0x4627bc[_0x0d45('0x2a')]=_[_0x0d45('0x25')](db[_0x0d45('0x56')][_0x0d45('0x24')]);_0x4627bc['query']=_['keys'](_0xdcac31[_0x0d45('0x26')]);_0x4627bc[_0x0d45('0x33')]=_[_0x0d45('0x29')](_0x4627bc[_0x0d45('0x2a')],_0x4627bc[_0x0d45('0x26')]);_0x146657['attributes']=_[_0x0d45('0x29')](_0x4627bc[_0x0d45('0x2a')],qs[_0x0d45('0x2b')](_0xdcac31[_0x0d45('0x26')]['fields']));_0x146657[_0x0d45('0x2c')]=_0x146657[_0x0d45('0x2c')][_0x0d45('0x3f')]?_0x146657[_0x0d45('0x2c')]:_0x4627bc[_0x0d45('0x2a')];_0x146657['order']=qs[_0x0d45('0x31')](_0xdcac31[_0x0d45('0x26')][_0x0d45('0x31')]);_0x146657[_0x0d45('0x32')]=qs[_0x0d45('0x33')](_[_0x0d45('0x4c')](_0xdcac31['query'],_0x4627bc[_0x0d45('0x33')]));if(_0xdcac31[_0x0d45('0x26')][_0x0d45('0x36')]){_0x146657[_0x0d45('0x32')]=_[_0x0d45('0x37')](_0x146657[_0x0d45('0x32')],{'$or':_[_0x0d45('0x4e')](_0x146657[_0x0d45('0x2c')],function(_0x57155f){var _0x48faec={};_0x48faec[_0x57155f]={'$like':'%'+_0xdcac31[_0x0d45('0x26')][_0x0d45('0x36')]+'%'};return _0x48faec;})});}_0x146657=_[_0x0d45('0x37')]({},_0x146657,_0xdcac31[_0x0d45('0x38')]);return _0x48b18a['getLists'](_0x146657);}})[_0x0d45('0x1e')](function(_0x1dc9fa){if(_0x1dc9fa){_0x33016c=_0x1dc9fa[_0x0d45('0x3f')];if(!_0xdcac31[_0x0d45('0x26')][_0x0d45('0x2d')](_0x0d45('0x2e'))){_0x146657['limit']=qs[_0x0d45('0x2f')](_0xdcac31[_0x0d45('0x26')]['limit']);_0x146657[_0x0d45('0x18')]=qs[_0x0d45('0x18')](_0xdcac31[_0x0d45('0x26')][_0x0d45('0x18')]);}return _0x48b18a[_0x0d45('0x55')](_0x146657);}})[_0x0d45('0x1e')](function(_0x37156e){if(_0x37156e){return _0x37156e?{'count':_0x33016c,'rows':_0x37156e}:null;}})[_0x0d45('0x1e')](respondWithResult(_0x191fdc,null))[_0x0d45('0x41')](handleError(_0x191fdc,null));};exports[_0x0d45('0x57')]=function(_0x897d25,_0x248c0f,_0x31d42f){var _0x28c91e,_0x53a164;return db[_0x0d45('0x23')][_0x0d45('0x40')]({'where':{'id':_0x897d25[_0x0d45('0x44')]['id']}})['then'](handleEntityNotFound(_0x248c0f,null))[_0x0d45('0x1e')](function(_0x398a8c){if(_0x398a8c){_0x53a164=_0x398a8c;return _0x398a8c[_0x0d45('0x57')](_0x897d25[_0x0d45('0x47')][_0x0d45('0x58')],_[_0x0d45('0x45')](_0x897d25[_0x0d45('0x47')],[_0x0d45('0x58'),'id'])||{});}return null;})[_0x0d45('0x59')](function(_0x36f89a){var _0x31eaea;_0x28c91e=_0x36f89a||[];var _0x45dd4d=[];if(_0x36f89a){for(var _0x795958=0x0;_0x795958<_0x36f89a[_0x0d45('0x3f')];_0x795958+=0x1){var _0x23cbe5=_0x36f89a[_0x795958][_0x0d45('0x5a')]({'plain':!![]});_0x53a164[_0x0d45('0x5b')]=_0x897d25[_0x0d45('0x47')][_0x0d45('0x5b')]?_0x897d25[_0x0d45('0x47')][_0x0d45('0x5b')]:_0x53a164[_0x0d45('0x5b')];switch(_0x53a164[_0x0d45('0x5b')]){case'always':_0x31eaea=squel[_0x0d45('0x5c')]()[_0x0d45('0x5d')](_0x0d45('0x5e'))[_0x0d45('0x5f')](['phone','scheduledAt',_0x0d45('0x60'),'ListId',_0x0d45('0x4d'),'createdAt',_0x0d45('0x46')],squel[_0x0d45('0x61')]()['field'](_0x0d45('0x62'),_0x0d45('0x62'))[_0x0d45('0x63')](_0x0d45('0x64'),_0x0d45('0x65'))['field']('id',_0x0d45('0x60'))[_0x0d45('0x63')](_0x23cbe5[_0x0d45('0x66')][_0x0d45('0x67')](),_0x0d45('0x68'))[_0x0d45('0x63')](_0x897d25[_0x0d45('0x44')]['id']['toString'](),_0x0d45('0x4d'))[_0x0d45('0x63')](_0x0d45('0x64'),_0x0d45('0x48'))['field'](_0x0d45('0x64'),_0x0d45('0x46'))['from'](_0x0d45('0x69'))[_0x0d45('0x32')](_0x0d45('0x6a'))['where'](_0x0d45('0x6b'),_0x23cbe5['CmListId'][_0x0d45('0x67')]())['where'](_0x0d45('0x6c'))[_0x0d45('0x32')](_0x0d45('0x6d'),squel[_0x0d45('0x61')]()['field'](_0x0d45('0x6e'))[_0x0d45('0x6f')](_0x0d45('0x70'))[_0x0d45('0x32')](_0x0d45('0x71'),_0x897d25[_0x0d45('0x44')]['id']['toString']()))[_0x0d45('0x32')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0d45('0x61')]()[_0x0d45('0x63')]('phone')[_0x0d45('0x6f')]('cm_hopper')[_0x0d45('0x32')](_0x0d45('0x71'),_0x897d25[_0x0d45('0x44')]['id'][_0x0d45('0x67')]())))[_0x0d45('0x67')]();break;case _0x0d45('0x72'):_0x31eaea=squel['insert']()[_0x0d45('0x5d')](_0x0d45('0x5e'))['fromQuery']([_0x0d45('0x62'),_0x0d45('0x65'),'ContactId',_0x0d45('0x68'),_0x0d45('0x4d'),'createdAt',_0x0d45('0x46')],squel['select']()['field'](_0x0d45('0x62'),'phone')[_0x0d45('0x63')](_0x0d45('0x64'),_0x0d45('0x65'))['field']('id',_0x0d45('0x60'))['field'](_0x23cbe5[_0x0d45('0x66')]['toString'](),'ListId')['field'](_0x897d25[_0x0d45('0x44')]['id'][_0x0d45('0x67')](),'CampaignId')[_0x0d45('0x63')](_0x0d45('0x64'),_0x0d45('0x48'))[_0x0d45('0x63')](_0x0d45('0x64'),_0x0d45('0x46'))['from'](_0x0d45('0x69'))[_0x0d45('0x32')](_0x0d45('0x6a'))[_0x0d45('0x32')](_0x0d45('0x6b'),_0x23cbe5[_0x0d45('0x66')][_0x0d45('0x67')]())[_0x0d45('0x32')](_0x0d45('0x6c'))[_0x0d45('0x32')](_0x0d45('0x6d'),squel[_0x0d45('0x61')]()[_0x0d45('0x63')](_0x0d45('0x62'))[_0x0d45('0x6f')]('cm_hopper')[_0x0d45('0x32')](_0x0d45('0x71'),_0x897d25[_0x0d45('0x44')]['id'][_0x0d45('0x67')]())))[_0x0d45('0x67')]();break;default:_0x31eaea=squel['insert']()[_0x0d45('0x5d')](_0x0d45('0x5e'))[_0x0d45('0x5f')]([_0x0d45('0x62'),_0x0d45('0x65'),'ContactId',_0x0d45('0x68'),_0x0d45('0x4d'),_0x0d45('0x48'),_0x0d45('0x46')],squel[_0x0d45('0x61')]()['field'](_0x0d45('0x62'),_0x0d45('0x62'))['field']('NOW()',_0x0d45('0x65'))[_0x0d45('0x63')]('id',_0x0d45('0x60'))[_0x0d45('0x63')](_0x23cbe5['CmListId']['toString'](),'ListId')[_0x0d45('0x63')](_0x897d25[_0x0d45('0x44')]['id'][_0x0d45('0x67')](),'CampaignId')['field']('NOW()',_0x0d45('0x48'))[_0x0d45('0x63')](_0x0d45('0x64'),_0x0d45('0x46'))[_0x0d45('0x6f')](_0x0d45('0x69'))[_0x0d45('0x32')](_0x0d45('0x6a'))[_0x0d45('0x32')](_0x0d45('0x6b'),_0x23cbe5[_0x0d45('0x66')]['toString']())['where'](_0x0d45('0x6c')))[_0x0d45('0x67')]();}_0x45dd4d[_0x0d45('0x73')](db[_0x0d45('0x74')][_0x0d45('0x26')](_0x31eaea));}return BPromise[_0x0d45('0x75')](_0x45dd4d);}})[_0x0d45('0x1e')](function(){return _0x28c91e;})[_0x0d45('0x1e')](respondWithResult(_0x248c0f,null))[_0x0d45('0x41')](handleError(_0x248c0f,null));};exports[_0x0d45('0x76')]=function(_0x2234e8,_0x5ef896,_0x56b00c){var _0x477695;return db['Campaign']['find']({'where':{'id':_0x2234e8[_0x0d45('0x44')]['id']}})['then'](handleEntityNotFound(_0x5ef896,null))[_0x0d45('0x1e')](function(_0x3d32c1){if(_0x3d32c1){return _0x3d32c1[_0x0d45('0x76')](_0x2234e8[_0x0d45('0x26')][_0x0d45('0x58')]);}})[_0x0d45('0x1e')](function(_0x47e568){if(_0x47e568){_0x477695=_0x47e568;return db['CmHopper'][_0x0d45('0x1f')]({'where':{'ListId':_0x2234e8[_0x0d45('0x26')][_0x0d45('0x58')],'CampaignId':_0x2234e8[_0x0d45('0x44')]['id']}})[_0x0d45('0x1e')](function(){return _0x477695;});}})['then'](respondWithStatusCode(_0x5ef896,null))[_0x0d45('0x41')](handleError(_0x5ef896,null));};exports[_0x0d45('0x77')]=function(_0x2f3f3f,_0x58a318,_0x571264){var _0x33dfbe={'raw':!![],'where':{}};var _0x245e43={};var _0x18f17a={'count':0x0,'rows':[]};return db[_0x0d45('0x23')][_0x0d45('0x4a')]({'where':{'id':_0x2f3f3f[_0x0d45('0x44')]['id']}})[_0x0d45('0x1e')](handleEntityNotFound(_0x58a318,null))[_0x0d45('0x1e')](function(_0x4bf46a){if(_0x4bf46a){_0x245e43[_0x0d45('0x2a')]=_[_0x0d45('0x25')](db['CmList'][_0x0d45('0x24')]);_0x245e43[_0x0d45('0x26')]=_[_0x0d45('0x25')](_0x2f3f3f[_0x0d45('0x26')]);_0x245e43[_0x0d45('0x33')]=_[_0x0d45('0x29')](_0x245e43[_0x0d45('0x2a')],_0x245e43[_0x0d45('0x26')]);_0x33dfbe[_0x0d45('0x2c')]=_[_0x0d45('0x29')](_0x245e43[_0x0d45('0x2a')],qs[_0x0d45('0x2b')](_0x2f3f3f[_0x0d45('0x26')]['fields']));_0x33dfbe[_0x0d45('0x2c')]=_0x33dfbe[_0x0d45('0x2c')][_0x0d45('0x3f')]?_0x33dfbe['attributes']:_0x245e43['model'];if(!_0x2f3f3f['query']['hasOwnProperty']('nolimit')){_0x33dfbe[_0x0d45('0x2f')]=qs[_0x0d45('0x2f')](_0x2f3f3f['query'][_0x0d45('0x2f')]);_0x33dfbe['offset']=qs['offset'](_0x2f3f3f['query'][_0x0d45('0x18')]);}_0x33dfbe[_0x0d45('0x30')]=qs[_0x0d45('0x31')](_0x2f3f3f[_0x0d45('0x26')]['sort']);_0x33dfbe[_0x0d45('0x32')]=qs[_0x0d45('0x33')](_[_0x0d45('0x4c')](_0x2f3f3f[_0x0d45('0x26')],_0x245e43[_0x0d45('0x33')]));_0x33dfbe[_0x0d45('0x32')][_0x0d45('0x4d')]=_0x4bf46a['id'];if(_0x2f3f3f['query'][_0x0d45('0x36')]){_0x33dfbe[_0x0d45('0x32')]=_['merge'](_0x33dfbe[_0x0d45('0x32')],{'$or':_[_0x0d45('0x4e')](_0x33dfbe[_0x0d45('0x2c')],function(_0x4b1704){var _0x50fbe7={};_0x50fbe7[_0x4b1704]={'$like':'%'+_0x2f3f3f['query'][_0x0d45('0x36')]+'%'};return _0x50fbe7;})});}_0x33dfbe=_[_0x0d45('0x37')]({},_0x33dfbe,_0x2f3f3f[_0x0d45('0x38')]);return db[_0x0d45('0x56')][_0x0d45('0x39')]({'where':_0x33dfbe[_0x0d45('0x32')]})['then'](function(_0x265fd7){_0x18f17a['count']=_0x265fd7;if(_0x2f3f3f[_0x0d45('0x26')][_0x0d45('0x3a')]){_0x33dfbe[_0x0d45('0x3b')]=[{'all':!![]}];}return db['CmList'][_0x0d45('0x3c')](_0x33dfbe);})['then'](function(_0x4e2d19){_0x18f17a[_0x0d45('0x3d')]=_0x4e2d19;return _0x18f17a;});}})[_0x0d45('0x1e')](respondWithFilteredResult(_0x58a318,_0x33dfbe))[_0x0d45('0x41')](handleError(_0x58a318,null));};exports[_0x0d45('0x78')]=function(_0x5ca268,_0x1c1bb8,_0x5a63d0){var _0x3790b7,_0x53b099;return db[_0x0d45('0x23')][_0x0d45('0x40')]({'where':{'id':_0x5ca268[_0x0d45('0x44')]['id']}})[_0x0d45('0x1e')](handleEntityNotFound(_0x1c1bb8,null))['then'](function(_0x2eef39){if(_0x2eef39){_0x53b099=_0x2eef39;return _0x2eef39['addBlackLists'](_0x5ca268[_0x0d45('0x47')][_0x0d45('0x58')],_[_0x0d45('0x45')](_0x5ca268[_0x0d45('0x47')],[_0x0d45('0x58'),'id'])||{});}return null;})[_0x0d45('0x59')](function(_0x582c63){var _0x3fa79c;_0x3790b7=_0x582c63||[];var _0x5af7c3=[];if(_0x582c63){for(var _0xac7b1a=0x0;_0xac7b1a<_0x582c63['length'];_0xac7b1a+=0x1){var _0x5dffe8=_0x582c63[_0xac7b1a]['get']({'plain':!![]});_0x3fa79c=squel[_0x0d45('0x5c')]()['into'](_0x0d45('0x79'))['fromQuery'](['phone','ContactId',_0x0d45('0x68'),_0x0d45('0x4d'),'createdAt','updatedAt'],squel[_0x0d45('0x61')]()[_0x0d45('0x63')]('phone','phone')['field']('id',_0x0d45('0x60'))[_0x0d45('0x63')](_0x5dffe8[_0x0d45('0x66')]['toString'](),_0x0d45('0x68'))[_0x0d45('0x63')](_0x5ca268[_0x0d45('0x44')]['id'][_0x0d45('0x67')](),_0x0d45('0x4d'))[_0x0d45('0x63')]('NOW()','createdAt')['field'](_0x0d45('0x64'),_0x0d45('0x46'))[_0x0d45('0x6f')]('cm_contacts')['where'](_0x0d45('0x6a'))[_0x0d45('0x32')](_0x0d45('0x6b'),_0x5dffe8[_0x0d45('0x66')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0d45('0x67')]();_0x5af7c3[_0x0d45('0x73')](db[_0x0d45('0x74')][_0x0d45('0x26')](_0x3fa79c));}return BPromise[_0x0d45('0x75')](_0x5af7c3);}})[_0x0d45('0x1e')](function(){return _0x3790b7;})[_0x0d45('0x1e')](respondWithResult(_0x1c1bb8,null))[_0x0d45('0x41')](handleError(_0x1c1bb8,null));};exports['removeBlackLists']=function(_0x244868,_0x1504aa,_0x33d369){var _0x232bab;return db[_0x0d45('0x23')][_0x0d45('0x40')]({'where':{'id':_0x244868[_0x0d45('0x44')]['id']}})['then'](handleEntityNotFound(_0x1504aa,null))[_0x0d45('0x1e')](function(_0x391254){if(_0x391254){return _0x391254[_0x0d45('0x7a')](_0x244868['query']['ids']);}})['then'](function(_0x669023){if(_0x669023){_0x232bab=_0x669023;return db['CmHopperBlack'][_0x0d45('0x1f')]({'where':{'ListId':_0x244868[_0x0d45('0x26')][_0x0d45('0x58')],'CampaignId':_0x244868[_0x0d45('0x44')]['id']}})['then'](function(){return _0x232bab;});}})[_0x0d45('0x1e')](respondWithStatusCode(_0x1504aa,null))['catch'](handleError(_0x1504aa,null));};
\ No newline at end of file
index 1ae99bb..db57f88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7956=['moment','request-promise','exports','campaigns','lodash','util','../../config/logger','api'];(function(_0x39db87,_0x102615){var _0x2fb465=function(_0x21d889){while(--_0x21d889){_0x39db87['push'](_0x39db87['shift']());}};_0x2fb465(++_0x102615);}(_0x7956,0x1cc));var _0x6795=function(_0x1b4cf7,_0x57e4a3){_0x1b4cf7=_0x1b4cf7-0x0;var _0x10e490=_0x7956[_0x1b4cf7];return _0x10e490;};'use strict';var _=require(_0x6795('0x0'));var util=require(_0x6795('0x1'));var logger=require(_0x6795('0x2'))(_0x6795('0x3'));var moment=require(_0x6795('0x4'));var BPromise=require('bluebird');var rp=require(_0x6795('0x5'));var attributes=require('./campaign.attributes');module[_0x6795('0x6')]=function(_0x4c0c21,_0x44c956){return _0x4c0c21['define']('Campaign',attributes,{'tableName':_0x6795('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc281=['bluebird','request-promise','./campaign.attributes','define','campaigns','util','../../config/logger','api','moment'];(function(_0x11b534,_0x2d587c){var _0x2604f2=function(_0x3ca30e){while(--_0x3ca30e){_0x11b534['push'](_0x11b534['shift']());}};_0x2604f2(++_0x2d587c);}(_0xc281,0x1c7));var _0x1c28=function(_0x534c33,_0x120ebc){_0x534c33=_0x534c33-0x0;var _0x22b732=_0xc281[_0x534c33];return _0x22b732;};'use strict';var _=require('lodash');var util=require(_0x1c28('0x0'));var logger=require(_0x1c28('0x1'))(_0x1c28('0x2'));var moment=require(_0x1c28('0x3'));var BPromise=require(_0x1c28('0x4'));var rp=require(_0x1c28('0x5'));var attributes=require(_0x1c28('0x6'));module['exports']=function(_0x170974,_0x452425){return _0x170974[_0x1c28('0x7')]('Campaign',attributes,{'tableName':_0x1c28('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d7f3ffb..69365b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89c8=['GetCampaign','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Campaign','findAll','options','raw','where','limit','include','map','model','attributes','debug'];(function(_0x5243c3,_0x5cc0d8){var _0x5dcd2c=function(_0x5bffc2){while(--_0x5bffc2){_0x5243c3['push'](_0x5243c3['shift']());}};_0x5dcd2c(++_0x5cc0d8);}(_0x89c8,0xe1));var _0x889c=function(_0x593ccf,_0x2873b5){_0x593ccf=_0x593ccf-0x0;var _0x2ce4c1=_0x89c8[_0x593ccf];return _0x2ce4c1;};'use strict';var _=require('lodash');var util=require(_0x889c('0x0'));var moment=require(_0x889c('0x1'));var BPromise=require(_0x889c('0x2'));var rs=require(_0x889c('0x3'));var fs=require('fs');var db=require(_0x889c('0x4'))['db'];var utils=require(_0x889c('0x5'));var logger=require(_0x889c('0x6'))('rpc');var config=require(_0x889c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x889c('0x8')][_0x889c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5571fa,_0x41e082,_0x329966){return new BPromise(function(_0x3d5684,_0x35c4ec){return client['request'](_0x5571fa,_0x329966)[_0x889c('0xa')](function(_0x590d14){logger[_0x889c('0xb')](_0x889c('0xc'),_0x41e082,'request\x20sent');logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x41e082,_0x889c('0xd'),JSON[_0x889c('0xe')](_0x590d14));if(_0x590d14[_0x889c('0xf')]){if(_0x590d14[_0x889c('0xf')][_0x889c('0x10')]===0x1f4){logger[_0x889c('0xf')](_0x889c('0xc'),_0x41e082,_0x590d14[_0x889c('0xf')][_0x889c('0x11')]);return _0x35c4ec(_0x590d14['error'][_0x889c('0x11')]);}logger[_0x889c('0xf')](_0x889c('0xc'),_0x41e082,_0x590d14[_0x889c('0xf')][_0x889c('0x11')]);return _0x3d5684(_0x590d14[_0x889c('0xf')][_0x889c('0x11')]);}else{logger[_0x889c('0xb')](_0x889c('0xc'),_0x41e082,_0x889c('0xd'));_0x3d5684(_0x590d14[_0x889c('0x12')]['message']);}})[_0x889c('0x13')](function(_0xb88c30){logger['error'](_0x889c('0xc'),_0x41e082,_0xb88c30);_0x35c4ec(_0xb88c30);});});}exports['GetCampaign']=function(_0x4fe95b){var _0x5ccc5c=this;return new Promise(function(_0x13e3eb,_0x46b14c){return db[_0x889c('0x14')][_0x889c('0x15')]({'raw':_0x4fe95b[_0x889c('0x16')]?_0x4fe95b[_0x889c('0x16')][_0x889c('0x17')]===undefined?!![]:![]:!![],'where':_0x4fe95b[_0x889c('0x16')]?_0x4fe95b[_0x889c('0x16')][_0x889c('0x18')]||null:null,'attributes':_0x4fe95b['options']?_0x4fe95b['options']['attributes']||null:null,'limit':_0x4fe95b[_0x889c('0x16')]?_0x4fe95b[_0x889c('0x16')][_0x889c('0x19')]||null:null,'include':_0x4fe95b[_0x889c('0x16')]?_0x4fe95b[_0x889c('0x16')][_0x889c('0x1a')]?_[_0x889c('0x1b')](_0x4fe95b[_0x889c('0x16')][_0x889c('0x1a')],function(_0x4a3dc5){return{'model':db[_0x4a3dc5[_0x889c('0x1c')]],'as':_0x4a3dc5['as'],'attributes':_0x4a3dc5[_0x889c('0x1d')],'include':_0x4a3dc5['include']?_[_0x889c('0x1b')](_0x4a3dc5[_0x889c('0x1a')],function(_0x369956){return{'model':db[_0x369956[_0x889c('0x1c')]],'as':_0x369956['as'],'attributes':_0x369956['attributes'],'include':_0x369956['include']?_[_0x889c('0x1b')](_0x369956[_0x889c('0x1a')],function(_0x22821c){return{'model':db[_0x22821c['model']],'as':_0x22821c['as'],'attributes':_0x22821c[_0x889c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x889c('0xa')](function(_0x72e997){logger[_0x889c('0xb')]('GetCampaign',_0x4fe95b);logger[_0x889c('0x1e')](_0x889c('0x1f'),_0x4fe95b,JSON[_0x889c('0xe')](_0x72e997));_0x13e3eb(_0x72e997);})[_0x889c('0x13')](function(_0x445b25){logger['error']('GetCampaign',_0x445b25[_0x889c('0x11')],_0x4fe95b);_0x46b14c(_0x5ccc5c['error'](0x1f4,_0x445b25['message']));});});};
\ No newline at end of file
+var _0xe980=['Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','GetCampaign','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x55cca0,_0x4682c4){var _0x9745ea=function(_0x42891a){while(--_0x42891a){_0x55cca0['push'](_0x55cca0['shift']());}};_0x9745ea(++_0x4682c4);}(_0xe980,0x1b5));var _0x0e98=function(_0x520f1a,_0x250e76){_0x520f1a=_0x520f1a-0x0;var _0x30e207=_0xe980[_0x520f1a];return _0x30e207;};'use strict';var _=require('lodash');var util=require(_0x0e98('0x0'));var moment=require(_0x0e98('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0x0e98('0x2'))['db'];var utils=require(_0x0e98('0x3'));var logger=require(_0x0e98('0x4'))('rpc');var config=require(_0x0e98('0x5'));var jayson=require(_0x0e98('0x6'));var client=jayson[_0x0e98('0x7')][_0x0e98('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x28ce30,_0x1c4b9f,_0x52f445){return new BPromise(function(_0x3d4782,_0x2014e4){return client['request'](_0x28ce30,_0x52f445)[_0x0e98('0x9')](function(_0x4b793e){logger[_0x0e98('0xa')](_0x0e98('0xb'),_0x1c4b9f,'request\x20sent');logger[_0x0e98('0xc')](_0x0e98('0xd'),_0x1c4b9f,_0x0e98('0xe'),JSON[_0x0e98('0xf')](_0x4b793e));if(_0x4b793e[_0x0e98('0x10')]){if(_0x4b793e[_0x0e98('0x10')][_0x0e98('0x11')]===0x1f4){logger[_0x0e98('0x10')](_0x0e98('0xb'),_0x1c4b9f,_0x4b793e['error'][_0x0e98('0x12')]);return _0x2014e4(_0x4b793e[_0x0e98('0x10')]['message']);}logger[_0x0e98('0x10')](_0x0e98('0xb'),_0x1c4b9f,_0x4b793e['error'][_0x0e98('0x12')]);return _0x3d4782(_0x4b793e['error'][_0x0e98('0x12')]);}else{logger[_0x0e98('0xa')](_0x0e98('0xb'),_0x1c4b9f,_0x0e98('0xe'));_0x3d4782(_0x4b793e[_0x0e98('0x13')][_0x0e98('0x12')]);}})[_0x0e98('0x14')](function(_0x39018c){logger[_0x0e98('0x10')](_0x0e98('0xb'),_0x1c4b9f,_0x39018c);_0x2014e4(_0x39018c);});});}exports['GetCampaign']=function(_0x132494){var _0xdb8dba=this;return new Promise(function(_0x37bf87,_0x47f4b3){return db[_0x0e98('0x15')][_0x0e98('0x16')]({'raw':_0x132494[_0x0e98('0x17')]?_0x132494[_0x0e98('0x17')][_0x0e98('0x18')]===undefined?!![]:![]:!![],'where':_0x132494[_0x0e98('0x17')]?_0x132494[_0x0e98('0x17')][_0x0e98('0x19')]||null:null,'attributes':_0x132494[_0x0e98('0x17')]?_0x132494[_0x0e98('0x17')][_0x0e98('0x1a')]||null:null,'limit':_0x132494['options']?_0x132494[_0x0e98('0x17')][_0x0e98('0x1b')]||null:null,'include':_0x132494[_0x0e98('0x17')]?_0x132494[_0x0e98('0x17')]['include']?_['map'](_0x132494[_0x0e98('0x17')][_0x0e98('0x1c')],function(_0x1eafc2){return{'model':db[_0x1eafc2['model']],'as':_0x1eafc2['as'],'attributes':_0x1eafc2[_0x0e98('0x1a')],'include':_0x1eafc2[_0x0e98('0x1c')]?_[_0x0e98('0x1d')](_0x1eafc2[_0x0e98('0x1c')],function(_0xdcce19){return{'model':db[_0xdcce19[_0x0e98('0x1e')]],'as':_0xdcce19['as'],'attributes':_0xdcce19['attributes'],'include':_0xdcce19['include']?_[_0x0e98('0x1d')](_0xdcce19[_0x0e98('0x1c')],function(_0x531a9b){return{'model':db[_0x531a9b[_0x0e98('0x1e')]],'as':_0x531a9b['as'],'attributes':_0x531a9b[_0x0e98('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0e98('0x9')](function(_0x221d2b){logger[_0x0e98('0xa')](_0x0e98('0x1f'),_0x132494);logger[_0x0e98('0xc')]('GetCampaign',_0x132494,JSON['stringify'](_0x221d2b));_0x37bf87(_0x221d2b);})[_0x0e98('0x14')](function(_0x54ee9e){logger[_0x0e98('0x10')](_0x0e98('0x1f'),_0x54ee9e[_0x0e98('0x12')],_0x132494);_0x47f4b3(_0xdb8dba[_0x0e98('0x10')](0x1f4,_0x54ee9e[_0x0e98('0x12')]));});});};
\ No newline at end of file
index 297bbc8..839a8f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0c2=['addLists','addBlackLists','update','delete','destroy','removeLists','/:id/blacklists','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone'];(function(_0x2a8e60,_0x2cc913){var _0x2401ae=function(_0x441583){while(--_0x441583){_0x2a8e60['push'](_0x2a8e60['shift']());}};_0x2401ae(++_0x2cc913);}(_0xf0c2,0x6e));var _0x2f0c=function(_0x45ecea,_0x267d8b){_0x45ecea=_0x45ecea-0x0;var _0x13de4e=_0xf0c2[_0x45ecea];return _0x13de4e;};'use strict';var multer=require('multer');var util=require(_0x2f0c('0x0'));var path=require(_0x2f0c('0x1'));var express=require(_0x2f0c('0x2'));var router=express[_0x2f0c('0x3')]();var auth=require(_0x2f0c('0x4'));var interaction=require(_0x2f0c('0x5'));var config=require(_0x2f0c('0x6'));var controller=require(_0x2f0c('0x7'));router[_0x2f0c('0x8')]('/',auth[_0x2f0c('0x9')](),controller[_0x2f0c('0xa')]);router[_0x2f0c('0x8')](_0x2f0c('0xb'),auth['isAuthenticated'](),controller[_0x2f0c('0xc')]);router[_0x2f0c('0x8')]('/:id/hoppers',auth[_0x2f0c('0x9')](),controller[_0x2f0c('0xd')]);router[_0x2f0c('0x8')](_0x2f0c('0xe'),auth[_0x2f0c('0x9')](),controller['getHopperHistories']);router[_0x2f0c('0x8')](_0x2f0c('0xf'),auth[_0x2f0c('0x9')](),controller[_0x2f0c('0x10')]);router[_0x2f0c('0x8')](_0x2f0c('0x11'),auth[_0x2f0c('0x9')](),controller[_0x2f0c('0x12')]);router[_0x2f0c('0x8')](_0x2f0c('0x13'),auth[_0x2f0c('0x9')](),controller[_0x2f0c('0x14')]);router[_0x2f0c('0x8')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x2f0c('0x15')]);router[_0x2f0c('0x16')]('/',auth[_0x2f0c('0x9')](),controller[_0x2f0c('0x17')]);router['post'](_0x2f0c('0x18'),auth[_0x2f0c('0x9')](),controller[_0x2f0c('0x19')]);router[_0x2f0c('0x16')](_0x2f0c('0x13'),auth['isAuthenticated'](),controller[_0x2f0c('0x1a')]);router[_0x2f0c('0x16')]('/:id/blacklists',auth[_0x2f0c('0x9')](),controller[_0x2f0c('0x1b')]);router['put']('/:id',auth[_0x2f0c('0x9')](),controller[_0x2f0c('0x1c')]);router[_0x2f0c('0x1d')](_0x2f0c('0xb'),auth[_0x2f0c('0x9')](),controller[_0x2f0c('0x1e')]);router[_0x2f0c('0x1d')](_0x2f0c('0x13'),auth[_0x2f0c('0x9')](),controller[_0x2f0c('0x1f')]);router[_0x2f0c('0x1d')](_0x2f0c('0x20'),auth[_0x2f0c('0x9')](),controller['removeBlackLists']);module[_0x2f0c('0x21')]=router;
\ No newline at end of file
+var _0xb27f=['exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','update','delete','destroy','removeLists','removeBlackLists'];(function(_0x3a3492,_0x5e43c3){var _0x1dc583=function(_0xe7e52d){while(--_0xe7e52d){_0x3a3492['push'](_0x3a3492['shift']());}};_0x1dc583(++_0x5e43c3);}(_0xb27f,0x67));var _0xfb27=function(_0x48661d,_0x5ada85){_0x48661d=_0x48661d-0x0;var _0x362f82=_0xb27f[_0x48661d];return _0x362f82;};'use strict';var multer=require(_0xfb27('0x0'));var util=require(_0xfb27('0x1'));var path=require(_0xfb27('0x2'));var express=require(_0xfb27('0x3'));var router=express[_0xfb27('0x4')]();var auth=require(_0xfb27('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfb27('0x6'));var controller=require(_0xfb27('0x7'));router['get']('/',auth[_0xfb27('0x8')](),controller[_0xfb27('0x9')]);router[_0xfb27('0xa')](_0xfb27('0xb'),auth[_0xfb27('0x8')](),controller[_0xfb27('0xc')]);router['get'](_0xfb27('0xd'),auth['isAuthenticated'](),controller['getHoppers']);router[_0xfb27('0xa')](_0xfb27('0xe'),auth['isAuthenticated'](),controller[_0xfb27('0xf')]);router[_0xfb27('0xa')]('/:id/hopper_finals',auth[_0xfb27('0x8')](),controller[_0xfb27('0x10')]);router[_0xfb27('0xa')](_0xfb27('0x11'),auth[_0xfb27('0x8')](),controller[_0xfb27('0x12')]);router[_0xfb27('0xa')](_0xfb27('0x13'),auth['isAuthenticated'](),controller['getLists']);router[_0xfb27('0xa')](_0xfb27('0x14'),auth[_0xfb27('0x8')](),controller[_0xfb27('0x15')]);router[_0xfb27('0x16')]('/',auth['isAuthenticated'](),controller[_0xfb27('0x17')]);router[_0xfb27('0x16')](_0xfb27('0x18'),auth[_0xfb27('0x8')](),controller[_0xfb27('0x19')]);router[_0xfb27('0x16')]('/:id/lists',auth['isAuthenticated'](),controller[_0xfb27('0x1a')]);router[_0xfb27('0x16')](_0xfb27('0x14'),auth['isAuthenticated'](),controller[_0xfb27('0x1b')]);router['put'](_0xfb27('0xb'),auth[_0xfb27('0x8')](),controller[_0xfb27('0x1c')]);router[_0xfb27('0x1d')](_0xfb27('0xb'),auth[_0xfb27('0x8')](),controller[_0xfb27('0x1e')]);router[_0xfb27('0x1d')](_0xfb27('0x13'),auth[_0xfb27('0x8')](),controller[_0xfb27('0x1f')]);router[_0xfb27('0x1d')](_0xfb27('0x14'),auth['isAuthenticated'](),controller[_0xfb27('0x20')]);module[_0xfb27('0x21')]=router;
\ No newline at end of file
index 8f8443f..d9f5d35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['exports','STRING','TEXT'];(function(_0x390b86,_0x1260b0){var _0x585594=function(_0x5434a6){while(--_0x5434a6){_0x390b86['push'](_0x390b86['shift']());}};_0x585594(++_0x1260b0);}(_0x1261,0x144));var _0x1126=function(_0x3aeb36,_0x312dc9){_0x3aeb36=_0x3aeb36-0x0;var _0xa2ef21=_0x1261[_0x3aeb36];return _0xa2ef21;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'key':{'type':Sequelize[_0x1126('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x1126('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1126('0x1')]}};
\ No newline at end of file
+var _0x7217=['sequelize','STRING','TEXT'];(function(_0x350942,_0x12726c){var _0x2942d7=function(_0x37f008){while(--_0x37f008){_0x350942['push'](_0x350942['shift']());}};_0x2942d7(++_0x12726c);}(_0x7217,0x19e));var _0x7721=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x7217[_0x34bc30];return _0x5706de;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'key':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x7721('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]}};
\ No newline at end of file
index 1427276..050a8c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c09=['attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','add','day','merge','filter','options','includeAll','include','rows','catch','show','params','find','body','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','CannedAnswer','rawAttributes','model','keys','dateStart','query','dateEnd','intersection','fields'];(function(_0x4129ee,_0x341055){var _0x53a798=function(_0x10da61){while(--_0x10da61){_0x4129ee['push'](_0x4129ee['shift']());}};_0x53a798(++_0x341055);}(_0x7c09,0x102));var _0x97c0=function(_0x20937b,_0x5f59b8){_0x20937b=_0x20937b-0x0;var _0x32a0a7=_0x7c09[_0x20937b];return _0x32a0a7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x97c0('0x0'));var rimraf=require(_0x97c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x97c0('0x2'));var rp=require(_0x97c0('0x3'));var moment=require(_0x97c0('0x4'));var BPromise=require(_0x97c0('0x5'));var Mustache=require(_0x97c0('0x6'));var util=require(_0x97c0('0x7'));var path=require(_0x97c0('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x97c0('0x9'));var squel=require(_0x97c0('0xa'));var crypto=require(_0x97c0('0xb'));var jsforce=require(_0x97c0('0xc'));var deskjs=require(_0x97c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x97c0('0xe'));var Papa=require('papaparse');var qs=require(_0x97c0('0xf'));var logger=require(_0x97c0('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x97c0('0x11'));var db=require(_0x97c0('0x12'))['db'];function respondWithStatusCode(_0x3265cf,_0x238ed9){_0x238ed9=_0x238ed9||0xcc;return function(_0x346e34){if(_0x346e34){return _0x3265cf[_0x97c0('0x13')](_0x238ed9);}return _0x3265cf[_0x97c0('0x14')](_0x238ed9)[_0x97c0('0x15')]();};}function respondWithResult(_0x9ca3c1,_0x2ecf34){_0x2ecf34=_0x2ecf34||0xc8;return function(_0x2810fd){if(_0x2810fd){return _0x9ca3c1[_0x97c0('0x14')](_0x2ecf34)[_0x97c0('0x16')](_0x2810fd);}};}function respondWithFilteredResult(_0x514782,_0x3f2fc2){return function(_0x15b336){if(_0x15b336){var _0xcac10b=_0x15b336[_0x97c0('0x17')],_0x496017=_0x3f2fc2[_0x97c0('0x18')],_0x42027d=_0x3f2fc2[_0x97c0('0x18')]+_0x3f2fc2[_0x97c0('0x19')],_0x9ca6a8;if(_0x42027d>=_0xcac10b){_0x42027d=_0xcac10b;_0x9ca6a8=0xc8;}else{_0x9ca6a8=0xce;}_0x514782['status'](_0x9ca6a8);return _0x514782[_0x97c0('0x1a')](_0x97c0('0x1b'),_0x496017+'-'+_0x42027d+'/'+_0xcac10b)['json'](_0x15b336);}return null;};}function patchUpdates(_0x560ac0){return function(_0x16918b){try{jsonpatch[_0x97c0('0x1c')](_0x16918b,_0x560ac0,!![]);}catch(_0xe81408){return BPromise[_0x97c0('0x1d')](_0xe81408);}return _0x16918b[_0x97c0('0x1e')]();};}function saveUpdates(_0x4fed42,_0x1eeaf0){return function(_0x432705){if(_0x432705){return _0x432705[_0x97c0('0x1f')](_0x4fed42)['then'](function(_0x554122){return _0x554122;});}return null;};}function removeEntity(_0x2b74a2,_0xa3f59d){return function(_0x169f19){if(_0x169f19){return _0x169f19['destroy']()[_0x97c0('0x20')](function(){_0x2b74a2[_0x97c0('0x14')](0xcc)[_0x97c0('0x15')]();});}};}function handleEntityNotFound(_0x272314,_0x30fba2){return function(_0x3a0bfb){if(!_0x3a0bfb){_0x272314[_0x97c0('0x13')](0x194);}return _0x3a0bfb;};}function handleError(_0x5ac457,_0x60ab00){_0x60ab00=_0x60ab00||0x1f4;return function(_0x29b3aa){logger[_0x97c0('0x21')](_0x29b3aa[_0x97c0('0x22')]);if(_0x29b3aa['name']){delete _0x29b3aa[_0x97c0('0x23')];}_0x5ac457[_0x97c0('0x14')](_0x60ab00)['send'](_0x29b3aa);};}exports[_0x97c0('0x24')]=function(_0x2bb908,_0x447316){var _0x4af5a5={},_0x4f11ba={},_0x51f258={'count':0x0,'rows':[]};var _0x11b8ad=db[_0x97c0('0x25')][_0x97c0('0x26')];_0x4f11ba[_0x97c0('0x27')]=_[_0x97c0('0x28')](_0x11b8ad);var _0x153b14={'dateStart':_0x2bb908['query'][_0x97c0('0x29')],'dateEnd':_0x2bb908[_0x97c0('0x2a')][_0x97c0('0x2b')]};delete _0x2bb908['query'][_0x97c0('0x29')];delete _0x2bb908[_0x97c0('0x2a')][_0x97c0('0x2b')];_0x4f11ba[_0x97c0('0x2a')]=_[_0x97c0('0x28')](_0x2bb908['query']);_0x4f11ba['filters']=_[_0x97c0('0x2c')](_0x4f11ba[_0x97c0('0x27')],_0x4f11ba[_0x97c0('0x2a')]);_0x4af5a5['attributes']=_[_0x97c0('0x2c')](_0x4f11ba[_0x97c0('0x27')],qs['fields'](_0x2bb908[_0x97c0('0x2a')][_0x97c0('0x2d')]));_0x4af5a5[_0x97c0('0x2e')]=_0x4af5a5[_0x97c0('0x2e')][_0x97c0('0x2f')]?_0x4af5a5[_0x97c0('0x2e')]:_0x4f11ba[_0x97c0('0x27')];if(!_0x2bb908[_0x97c0('0x2a')][_0x97c0('0x30')](_0x97c0('0x31'))){_0x4af5a5[_0x97c0('0x19')]=qs[_0x97c0('0x19')](_0x2bb908[_0x97c0('0x2a')][_0x97c0('0x19')]);_0x4af5a5[_0x97c0('0x18')]=qs['offset'](_0x2bb908[_0x97c0('0x2a')][_0x97c0('0x18')]);}_0x4af5a5[_0x97c0('0x32')]=qs[_0x97c0('0x33')](_0x2bb908[_0x97c0('0x2a')][_0x97c0('0x33')]);_0x4af5a5[_0x97c0('0x34')]=qs[_0x97c0('0x35')](_['pick'](_0x2bb908[_0x97c0('0x2a')],_0x4f11ba['filters']));if(_0x153b14[_0x97c0('0x29')]){if(_0x153b14[_0x97c0('0x2b')]){_0x153b14[_0x97c0('0x2b')]=moment(_0x153b14[_0x97c0('0x2b')])[_0x97c0('0x36')](0x1,_0x97c0('0x37'));}else{_0x153b14[_0x97c0('0x2b')]=moment(_0x153b14[_0x97c0('0x29')])[_0x97c0('0x36')](0x1,_0x97c0('0x37'));}_[_0x97c0('0x38')](_0x4af5a5['where'],{'createdAt':{'$gte':_0x153b14[_0x97c0('0x29')],'$lte':_0x153b14[_0x97c0('0x2b')]}});}if(_0x2bb908['query'][_0x97c0('0x39')]){_0x4af5a5[_0x97c0('0x34')]=_[_0x97c0('0x38')](_0x4af5a5[_0x97c0('0x34')],{'$or':_['map'](_0x4af5a5[_0x97c0('0x2e')],function(_0x4f1629){var _0x1acf31={};_0x1acf31[_0x4f1629]={'$like':'%'+_0x2bb908[_0x97c0('0x2a')]['filter']+'%'};return _0x1acf31;})});}_0x4af5a5=_[_0x97c0('0x38')]({},_0x4af5a5,_0x2bb908[_0x97c0('0x3a')]);var _0xd728dd={'where':_0x4af5a5[_0x97c0('0x34')]};return db[_0x97c0('0x25')][_0x97c0('0x17')](_0xd728dd)[_0x97c0('0x20')](function(_0x239be6){_0x51f258[_0x97c0('0x17')]=_0x239be6;if(_0x2bb908[_0x97c0('0x2a')][_0x97c0('0x3b')]){_0x4af5a5[_0x97c0('0x3c')]=[{'all':!![]}];}return db[_0x97c0('0x25')]['findAll'](_0x4af5a5);})[_0x97c0('0x20')](function(_0x90bfbb){_0x51f258[_0x97c0('0x3d')]=_0x90bfbb;return _0x51f258;})[_0x97c0('0x20')](respondWithFilteredResult(_0x447316,_0x4af5a5))[_0x97c0('0x3e')](handleError(_0x447316,null));};exports[_0x97c0('0x3f')]=function(_0x45e894,_0x5157c9){var _0x51a0f5={'raw':!![],'where':{'id':_0x45e894[_0x97c0('0x40')]['id']}},_0x10ee7b={};_0x10ee7b[_0x97c0('0x27')]=_[_0x97c0('0x28')](db[_0x97c0('0x25')]['rawAttributes']);_0x10ee7b['query']=_['keys'](_0x45e894[_0x97c0('0x2a')]);_0x10ee7b['filters']=_['intersection'](_0x10ee7b[_0x97c0('0x27')],_0x10ee7b[_0x97c0('0x2a')]);_0x51a0f5[_0x97c0('0x2e')]=_[_0x97c0('0x2c')](_0x10ee7b[_0x97c0('0x27')],qs['fields'](_0x45e894[_0x97c0('0x2a')][_0x97c0('0x2d')]));_0x51a0f5[_0x97c0('0x2e')]=_0x51a0f5[_0x97c0('0x2e')][_0x97c0('0x2f')]?_0x51a0f5[_0x97c0('0x2e')]:_0x10ee7b[_0x97c0('0x27')];if(_0x45e894[_0x97c0('0x2a')][_0x97c0('0x3b')]){_0x51a0f5[_0x97c0('0x3c')]=[{'all':!![]}];}_0x51a0f5=_['merge']({},_0x51a0f5,_0x45e894[_0x97c0('0x3a')]);return db[_0x97c0('0x25')][_0x97c0('0x41')](_0x51a0f5)[_0x97c0('0x20')](handleEntityNotFound(_0x5157c9,null))['then'](respondWithResult(_0x5157c9,null))['catch'](handleError(_0x5157c9,null));};exports[_0x97c0('0x1f')]=function(_0x2b54fb,_0x2c26b9){if(_0x2b54fb['body']['id']){delete _0x2b54fb[_0x97c0('0x42')]['id'];}return db[_0x97c0('0x25')][_0x97c0('0x41')]({'where':{'id':_0x2b54fb[_0x97c0('0x40')]['id']}})[_0x97c0('0x20')](handleEntityNotFound(_0x2c26b9,null))['then'](saveUpdates(_0x2b54fb[_0x97c0('0x42')],null))[_0x97c0('0x20')](respondWithResult(_0x2c26b9,null))[_0x97c0('0x3e')](handleError(_0x2c26b9,null));};exports['destroy']=function(_0x577af2,_0x94ce89){return db['CannedAnswer']['find']({'where':{'id':_0x577af2[_0x97c0('0x40')]['id']}})[_0x97c0('0x20')](handleEntityNotFound(_0x94ce89,null))[_0x97c0('0x20')](removeEntity(_0x94ce89,null))['catch'](handleError(_0x94ce89,null));};exports['create']=function(_0x5190b0,_0x25cbd1){var _0x2b7daa={'key':_0x5190b0[_0x97c0('0x42')][_0x97c0('0x43')]};if(_0x5190b0[_0x97c0('0x42')][_0x97c0('0x44')]){_0x2b7daa[_0x97c0('0x44')]=_0x5190b0['body'][_0x97c0('0x44')];}else if(_0x5190b0[_0x97c0('0x42')][_0x97c0('0x45')]){_0x2b7daa[_0x97c0('0x45')]=_0x5190b0[_0x97c0('0x42')][_0x97c0('0x45')];}else if(_0x5190b0['body'][_0x97c0('0x46')]){_0x2b7daa[_0x97c0('0x46')]=_0x5190b0['body'][_0x97c0('0x46')];}else if(_0x5190b0[_0x97c0('0x42')][_0x97c0('0x47')]){_0x2b7daa[_0x97c0('0x47')]=_0x5190b0[_0x97c0('0x42')][_0x97c0('0x47')];}return db[_0x97c0('0x25')]['find']({'where':_0x2b7daa})[_0x97c0('0x20')](function(_0x14e93c){if(_0x14e93c){throw new db[(_0x97c0('0x48'))][(_0x97c0('0x49'))](_0x97c0('0x4a'));}return db[_0x97c0('0x25')][_0x97c0('0x4b')](_0x5190b0[_0x97c0('0x42')]);})[_0x97c0('0x20')](respondWithResult(_0x25cbd1,0xc9))[_0x97c0('0x3e')](handleError(_0x25cbd1,null));};
\ No newline at end of file
+var _0x7217=['rawAttributes','intersection','include','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','model','keys','query','dateStart','dateEnd','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','add','day','merge','filter','options','CannedAnswer','count','includeAll','rows','catch','show','params'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0x7217,0x19e));var _0x7721=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x7217[_0x21aec3];return _0x288bbc;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var qs=require(_0x7721('0x12'));var logger=require(_0x7721('0x13'))('api');var utils=require(_0x7721('0x14'));var config=require(_0x7721('0x15'));var db=require(_0x7721('0x16'))['db'];function respondWithStatusCode(_0xf78099,_0xa8977c){_0xa8977c=_0xa8977c||0xcc;return function(_0x409b37){if(_0x409b37){return _0xf78099[_0x7721('0x17')](_0xa8977c);}return _0xf78099[_0x7721('0x18')](_0xa8977c)['end']();};}function respondWithResult(_0x2911ec,_0x199930){_0x199930=_0x199930||0xc8;return function(_0x57ff6d){if(_0x57ff6d){return _0x2911ec[_0x7721('0x18')](_0x199930)[_0x7721('0x19')](_0x57ff6d);}};}function respondWithFilteredResult(_0x3f01c5,_0x2e9752){return function(_0x5069da){if(_0x5069da){var _0x3cbce8=_0x5069da['count'],_0x25b1c0=_0x2e9752[_0x7721('0x1a')],_0x534f1b=_0x2e9752[_0x7721('0x1a')]+_0x2e9752[_0x7721('0x1b')],_0x4e199a;if(_0x534f1b>=_0x3cbce8){_0x534f1b=_0x3cbce8;_0x4e199a=0xc8;}else{_0x4e199a=0xce;}_0x3f01c5[_0x7721('0x18')](_0x4e199a);return _0x3f01c5['set'](_0x7721('0x1c'),_0x25b1c0+'-'+_0x534f1b+'/'+_0x3cbce8)['json'](_0x5069da);}return null;};}function patchUpdates(_0x3fc09e){return function(_0x5cb0e6){try{jsonpatch[_0x7721('0x1d')](_0x5cb0e6,_0x3fc09e,!![]);}catch(_0x4e96fb){return BPromise[_0x7721('0x1e')](_0x4e96fb);}return _0x5cb0e6[_0x7721('0x1f')]();};}function saveUpdates(_0x2286e5,_0x40af90){return function(_0x402820){if(_0x402820){return _0x402820[_0x7721('0x20')](_0x2286e5)[_0x7721('0x21')](function(_0xaeccc4){return _0xaeccc4;});}return null;};}function removeEntity(_0x4ce1db,_0x288f7e){return function(_0x2c1583){if(_0x2c1583){return _0x2c1583[_0x7721('0x22')]()[_0x7721('0x21')](function(){_0x4ce1db['status'](0xcc)[_0x7721('0x23')]();});}};}function handleEntityNotFound(_0x512f31,_0xb9e9dd){return function(_0x288e3a){if(!_0x288e3a){_0x512f31[_0x7721('0x17')](0x194);}return _0x288e3a;};}function handleError(_0x1caad8,_0x121cc4){_0x121cc4=_0x121cc4||0x1f4;return function(_0x395b15){logger[_0x7721('0x24')](_0x395b15['stack']);if(_0x395b15[_0x7721('0x25')]){delete _0x395b15[_0x7721('0x25')];}_0x1caad8[_0x7721('0x18')](_0x121cc4)[_0x7721('0x26')](_0x395b15);};}exports[_0x7721('0x27')]=function(_0x16355a,_0x424e05){var _0xf753f1={},_0x40f367={},_0x52316e={'count':0x0,'rows':[]};var _0x258ddf=db['CannedAnswer']['rawAttributes'];_0x40f367[_0x7721('0x28')]=_[_0x7721('0x29')](_0x258ddf);var _0x53c904={'dateStart':_0x16355a[_0x7721('0x2a')][_0x7721('0x2b')],'dateEnd':_0x16355a[_0x7721('0x2a')][_0x7721('0x2c')]};delete _0x16355a[_0x7721('0x2a')]['dateStart'];delete _0x16355a[_0x7721('0x2a')][_0x7721('0x2c')];_0x40f367['query']=_['keys'](_0x16355a[_0x7721('0x2a')]);_0x40f367[_0x7721('0x2d')]=_['intersection'](_0x40f367[_0x7721('0x28')],_0x40f367[_0x7721('0x2a')]);_0xf753f1[_0x7721('0x2e')]=_['intersection'](_0x40f367[_0x7721('0x28')],qs[_0x7721('0x2f')](_0x16355a[_0x7721('0x2a')][_0x7721('0x2f')]));_0xf753f1[_0x7721('0x2e')]=_0xf753f1['attributes'][_0x7721('0x30')]?_0xf753f1[_0x7721('0x2e')]:_0x40f367[_0x7721('0x28')];if(!_0x16355a['query'][_0x7721('0x31')](_0x7721('0x32'))){_0xf753f1['limit']=qs[_0x7721('0x1b')](_0x16355a['query'][_0x7721('0x1b')]);_0xf753f1[_0x7721('0x1a')]=qs[_0x7721('0x1a')](_0x16355a[_0x7721('0x2a')][_0x7721('0x1a')]);}_0xf753f1[_0x7721('0x33')]=qs[_0x7721('0x34')](_0x16355a[_0x7721('0x2a')][_0x7721('0x34')]);_0xf753f1[_0x7721('0x35')]=qs[_0x7721('0x2d')](_['pick'](_0x16355a[_0x7721('0x2a')],_0x40f367['filters']));if(_0x53c904[_0x7721('0x2b')]){if(_0x53c904[_0x7721('0x2c')]){_0x53c904[_0x7721('0x2c')]=moment(_0x53c904[_0x7721('0x2c')])[_0x7721('0x36')](0x1,_0x7721('0x37'));}else{_0x53c904['dateEnd']=moment(_0x53c904['dateStart'])['add'](0x1,'day');}_[_0x7721('0x38')](_0xf753f1[_0x7721('0x35')],{'createdAt':{'$gte':_0x53c904[_0x7721('0x2b')],'$lte':_0x53c904[_0x7721('0x2c')]}});}if(_0x16355a['query'][_0x7721('0x39')]){_0xf753f1['where']=_[_0x7721('0x38')](_0xf753f1[_0x7721('0x35')],{'$or':_['map'](_0xf753f1[_0x7721('0x2e')],function(_0x3a47c8){var _0x4e77ff={};_0x4e77ff[_0x3a47c8]={'$like':'%'+_0x16355a['query'][_0x7721('0x39')]+'%'};return _0x4e77ff;})});}_0xf753f1=_[_0x7721('0x38')]({},_0xf753f1,_0x16355a[_0x7721('0x3a')]);var _0x15e34d={'where':_0xf753f1['where']};return db[_0x7721('0x3b')][_0x7721('0x3c')](_0x15e34d)[_0x7721('0x21')](function(_0x337abf){_0x52316e[_0x7721('0x3c')]=_0x337abf;if(_0x16355a['query'][_0x7721('0x3d')]){_0xf753f1['include']=[{'all':!![]}];}return db[_0x7721('0x3b')]['findAll'](_0xf753f1);})[_0x7721('0x21')](function(_0x15fa2c){_0x52316e[_0x7721('0x3e')]=_0x15fa2c;return _0x52316e;})['then'](respondWithFilteredResult(_0x424e05,_0xf753f1))[_0x7721('0x3f')](handleError(_0x424e05,null));};exports[_0x7721('0x40')]=function(_0x1ad315,_0x481fa8){var _0x9f7b1d={'raw':!![],'where':{'id':_0x1ad315[_0x7721('0x41')]['id']}},_0x754071={};_0x754071[_0x7721('0x28')]=_[_0x7721('0x29')](db[_0x7721('0x3b')][_0x7721('0x42')]);_0x754071['query']=_['keys'](_0x1ad315[_0x7721('0x2a')]);_0x754071[_0x7721('0x2d')]=_[_0x7721('0x43')](_0x754071[_0x7721('0x28')],_0x754071[_0x7721('0x2a')]);_0x9f7b1d[_0x7721('0x2e')]=_[_0x7721('0x43')](_0x754071[_0x7721('0x28')],qs[_0x7721('0x2f')](_0x1ad315[_0x7721('0x2a')]['fields']));_0x9f7b1d['attributes']=_0x9f7b1d[_0x7721('0x2e')][_0x7721('0x30')]?_0x9f7b1d[_0x7721('0x2e')]:_0x754071[_0x7721('0x28')];if(_0x1ad315['query'][_0x7721('0x3d')]){_0x9f7b1d[_0x7721('0x44')]=[{'all':!![]}];}_0x9f7b1d=_['merge']({},_0x9f7b1d,_0x1ad315[_0x7721('0x3a')]);return db['CannedAnswer'][_0x7721('0x45')](_0x9f7b1d)['then'](handleEntityNotFound(_0x481fa8,null))[_0x7721('0x21')](respondWithResult(_0x481fa8,null))[_0x7721('0x3f')](handleError(_0x481fa8,null));};exports[_0x7721('0x20')]=function(_0x4eda58,_0x2d18dd){if(_0x4eda58[_0x7721('0x46')]['id']){delete _0x4eda58['body']['id'];}return db[_0x7721('0x3b')][_0x7721('0x45')]({'where':{'id':_0x4eda58[_0x7721('0x41')]['id']}})['then'](handleEntityNotFound(_0x2d18dd,null))[_0x7721('0x21')](saveUpdates(_0x4eda58['body'],null))[_0x7721('0x21')](respondWithResult(_0x2d18dd,null))[_0x7721('0x3f')](handleError(_0x2d18dd,null));};exports[_0x7721('0x22')]=function(_0x443503,_0x1c95d8){return db[_0x7721('0x3b')][_0x7721('0x45')]({'where':{'id':_0x443503[_0x7721('0x41')]['id']}})[_0x7721('0x21')](handleEntityNotFound(_0x1c95d8,null))[_0x7721('0x21')](removeEntity(_0x1c95d8,null))[_0x7721('0x3f')](handleError(_0x1c95d8,null));};exports[_0x7721('0x47')]=function(_0x24b17d,_0xbcd90e){var _0x2cd678={'key':_0x24b17d['body'][_0x7721('0x48')]};if(_0x24b17d[_0x7721('0x46')][_0x7721('0x49')]){_0x2cd678[_0x7721('0x49')]=_0x24b17d[_0x7721('0x46')][_0x7721('0x49')];}else if(_0x24b17d[_0x7721('0x46')]['SmsAccountId']){_0x2cd678[_0x7721('0x4a')]=_0x24b17d[_0x7721('0x46')][_0x7721('0x4a')];}else if(_0x24b17d[_0x7721('0x46')][_0x7721('0x4b')]){_0x2cd678[_0x7721('0x4b')]=_0x24b17d[_0x7721('0x46')][_0x7721('0x4b')];}else if(_0x24b17d[_0x7721('0x46')][_0x7721('0x4c')]){_0x2cd678[_0x7721('0x4c')]=_0x24b17d['body'][_0x7721('0x4c')];}return db[_0x7721('0x3b')][_0x7721('0x45')]({'where':_0x2cd678})[_0x7721('0x21')](function(_0x15ed3b){if(_0x15ed3b){throw new db[(_0x7721('0x4d'))][(_0x7721('0x4e'))](_0x7721('0x4f'));}return db[_0x7721('0x3b')][_0x7721('0x47')](_0x24b17d[_0x7721('0x46')]);})[_0x7721('0x21')](respondWithResult(_0xbcd90e,0xc9))[_0x7721('0x3f')](handleError(_0xbcd90e,null));};
\ No newline at end of file
index 86f16bd..12469c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4fc=['define','tools_canned_answers','util','../../config/logger','api','moment','bluebird','request-promise','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb4fc,0x197));var _0xcb4f=function(_0x88b8bb,_0x471e65){_0x88b8bb=_0x88b8bb-0x0;var _0x5b814d=_0xb4fc[_0x88b8bb];return _0x5b814d;};'use strict';var _=require('lodash');var util=require(_0xcb4f('0x0'));var logger=require(_0xcb4f('0x1'))(_0xcb4f('0x2'));var moment=require(_0xcb4f('0x3'));var BPromise=require(_0xcb4f('0x4'));var rp=require(_0xcb4f('0x5'));var attributes=require('./cannedAnswer.attributes');module[_0xcb4f('0x6')]=function(_0x365ed6,_0x2c568f){return _0x365ed6[_0xcb4f('0x7')]('CannedAnswer',attributes,{'tableName':_0xcb4f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe159=['api','moment','bluebird','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','lodash','../../config/logger'];(function(_0x5a64eb,_0x286782){var _0x3ad930=function(_0x36a52f){while(--_0x36a52f){_0x5a64eb['push'](_0x5a64eb['shift']());}};_0x3ad930(++_0x286782);}(_0xe159,0x1a2));var _0x9e15=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe159[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x9e15('0x0'));var util=require('util');var logger=require(_0x9e15('0x1'))(_0x9e15('0x2'));var moment=require(_0x9e15('0x3'));var BPromise=require(_0x9e15('0x4'));var rp=require('request-promise');var attributes=require(_0x9e15('0x5'));module[_0x9e15('0x6')]=function(_0x3de545,_0x55b264){return _0x3de545[_0x9e15('0x7')](_0x9e15('0x8'),attributes,{'tableName':_0x9e15('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3d2e5e6..70cb61a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9c6=['util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9c6,0xa0));var _0x6a9c=function(_0x800d3f,_0x168719){_0x800d3f=_0x800d3f-0x0;var _0x7932f7=_0xa9c6[_0x800d3f];return _0x7932f7;};'use strict';var _=require(_0x6a9c('0x0'));var util=require(_0x6a9c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0x6a9c('0x2'))['db'];var utils=require(_0x6a9c('0x3'));var logger=require(_0x6a9c('0x4'))(_0x6a9c('0x5'));var config=require(_0x6a9c('0x6'));var jayson=require(_0x6a9c('0x7'));var client=jayson[_0x6a9c('0x8')][_0x6a9c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3856ab,_0x4f20ab,_0xa059cc){return new BPromise(function(_0x3a3d5c,_0x4510eb){return client[_0x6a9c('0xa')](_0x3856ab,_0xa059cc)[_0x6a9c('0xb')](function(_0x2e3ced){logger[_0x6a9c('0xc')](_0x6a9c('0xd'),_0x4f20ab,_0x6a9c('0xe'));logger[_0x6a9c('0xf')](_0x6a9c('0x10'),_0x4f20ab,_0x6a9c('0xe'),JSON[_0x6a9c('0x11')](_0x2e3ced));if(_0x2e3ced[_0x6a9c('0x12')]){if(_0x2e3ced[_0x6a9c('0x12')][_0x6a9c('0x13')]===0x1f4){logger['error'](_0x6a9c('0xd'),_0x4f20ab,_0x2e3ced[_0x6a9c('0x12')][_0x6a9c('0x14')]);return _0x4510eb(_0x2e3ced[_0x6a9c('0x12')]['message']);}logger[_0x6a9c('0x12')](_0x6a9c('0xd'),_0x4f20ab,_0x2e3ced[_0x6a9c('0x12')]['message']);return _0x3a3d5c(_0x2e3ced[_0x6a9c('0x12')][_0x6a9c('0x14')]);}else{logger[_0x6a9c('0xc')]('CannedAnswer,\x20%s,\x20%s',_0x4f20ab,_0x6a9c('0xe'));_0x3a3d5c(_0x2e3ced[_0x6a9c('0x15')][_0x6a9c('0x14')]);}})[_0x6a9c('0x16')](function(_0x47e3af){logger[_0x6a9c('0x12')](_0x6a9c('0xd'),_0x4f20ab,_0x47e3af);_0x4510eb(_0x47e3af);});});}
\ No newline at end of file
+var _0x6773=['error','code','CannedAnswer,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x391cfb,_0x50b7c9){var _0x25244f=function(_0x2a0dac){while(--_0x2a0dac){_0x391cfb['push'](_0x391cfb['shift']());}};_0x25244f(++_0x50b7c9);}(_0x6773,0x123));var _0x3677=function(_0x81ec48,_0x50f33d){_0x81ec48=_0x81ec48-0x0;var _0xe16980=_0x6773[_0x81ec48];return _0xe16980;};'use strict';var _=require('lodash');var util=require(_0x3677('0x0'));var moment=require(_0x3677('0x1'));var BPromise=require(_0x3677('0x2'));var rs=require(_0x3677('0x3'));var fs=require('fs');var db=require(_0x3677('0x4'))['db'];var utils=require(_0x3677('0x5'));var logger=require(_0x3677('0x6'))(_0x3677('0x7'));var config=require(_0x3677('0x8'));var jayson=require(_0x3677('0x9'));var client=jayson['client'][_0x3677('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x405511,_0x25b14f,_0x2437a9){return new BPromise(function(_0x21aedf,_0xfe6ec0){return client['request'](_0x405511,_0x2437a9)[_0x3677('0xb')](function(_0x4e64a0){logger[_0x3677('0xc')]('CannedAnswer,\x20%s,\x20%s',_0x25b14f,_0x3677('0xd'));logger[_0x3677('0xe')](_0x3677('0xf'),_0x25b14f,'request\x20sent',JSON[_0x3677('0x10')](_0x4e64a0));if(_0x4e64a0['error']){if(_0x4e64a0[_0x3677('0x11')][_0x3677('0x12')]===0x1f4){logger[_0x3677('0x11')](_0x3677('0x13'),_0x25b14f,_0x4e64a0[_0x3677('0x11')]['message']);return _0xfe6ec0(_0x4e64a0['error'][_0x3677('0x14')]);}logger[_0x3677('0x11')](_0x3677('0x13'),_0x25b14f,_0x4e64a0[_0x3677('0x11')][_0x3677('0x14')]);return _0x21aedf(_0x4e64a0[_0x3677('0x11')][_0x3677('0x14')]);}else{logger[_0x3677('0xc')](_0x3677('0x13'),_0x25b14f,_0x3677('0xd'));_0x21aedf(_0x4e64a0['result']['message']);}})[_0x3677('0x15')](function(_0x112e5f){logger[_0x3677('0x11')](_0x3677('0x13'),_0x25b14f,_0x112e5f);_0xfe6ec0(_0x112e5f);});});}
\ No newline at end of file
index 9961161..be55b4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdeec=['util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','multer'];(function(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_0xdeec,0x1cf));var _0xcdee=function(_0x15a4c8,_0x3246df){_0x15a4c8=_0x15a4c8-0x0;var _0x5d796e=_0xdeec[_0x15a4c8];return _0x5d796e;};'use strict';var multer=require(_0xcdee('0x0'));var util=require(_0xcdee('0x1'));var path=require('path');var express=require('express');var router=express[_0xcdee('0x2')]();var auth=require(_0xcdee('0x3'));var interaction=require(_0xcdee('0x4'));var config=require(_0xcdee('0x5'));var controller=require(_0xcdee('0x6'));router[_0xcdee('0x7')]('/',auth[_0xcdee('0x8')](),controller[_0xcdee('0x9')]);router[_0xcdee('0x7')](_0xcdee('0xa'),auth[_0xcdee('0x8')](),controller[_0xcdee('0xb')]);router['post']('/',auth[_0xcdee('0x8')](),controller[_0xcdee('0xc')]);router[_0xcdee('0xd')](_0xcdee('0xa'),auth[_0xcdee('0x8')](),controller['update']);router[_0xcdee('0xe')](_0xcdee('0xa'),auth[_0xcdee('0x8')](),controller[_0xcdee('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x6508=['put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6508,0x71));var _0x8650=function(_0x34c027,_0x123688){_0x34c027=_0x34c027-0x0;var _0x47bff0=_0x6508[_0x34c027];return _0x47bff0;};'use strict';var multer=require(_0x8650('0x0'));var util=require(_0x8650('0x1'));var path=require('path');var express=require(_0x8650('0x2'));var router=express[_0x8650('0x3')]();var auth=require(_0x8650('0x4'));var interaction=require(_0x8650('0x5'));var config=require(_0x8650('0x6'));var controller=require('./cannedAnswer.controller');router[_0x8650('0x7')]('/',auth[_0x8650('0x8')](),controller[_0x8650('0x9')]);router[_0x8650('0x7')](_0x8650('0xa'),auth[_0x8650('0x8')](),controller[_0x8650('0xb')]);router['post']('/',auth[_0x8650('0x8')](),controller[_0x8650('0xc')]);router[_0x8650('0xd')](_0x8650('0xa'),auth['isAuthenticated'](),controller[_0x8650('0xe')]);router[_0x8650('0xf')](_0x8650('0xa'),auth['isAuthenticated'](),controller[_0x8650('0x10')]);module[_0x8650('0x11')]=router;
\ No newline at end of file
index ae812d5..d0bf712 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b9a=['sequelize','DATE','STRING','INTEGER'];(function(_0x2f52bb,_0x330841){var _0x44e94c=function(_0xdbdc6b){while(--_0xdbdc6b){_0x2f52bb['push'](_0x2f52bb['shift']());}};_0x44e94c(++_0x330841);}(_0x3b9a,0x194));var _0xa3b9=function(_0x3f3f50,_0x477928){_0x3f3f50=_0x3f3f50-0x0;var _0x4344c4=_0x3b9a[_0x3f3f50];return _0x4344c4;};'use strict';var Sequelize=require(_0xa3b9('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xa3b9('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xa3b9('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xa3b9('0x2')]},'dcontext':{'type':Sequelize[_0xa3b9('0x2')]},'channel':{'type':Sequelize[_0xa3b9('0x2')]},'dstchannel':{'type':Sequelize[_0xa3b9('0x2')]},'lastapp':{'type':Sequelize[_0xa3b9('0x2')]},'lastdata':{'type':Sequelize[_0xa3b9('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xa3b9('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xa3b9('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xa3b9('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xa3b9('0x2')]},'peeraccount':{'type':Sequelize[_0xa3b9('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xa3b9('0x2')]}};
\ No newline at end of file
+var _0xd7d8=['STRING','INTEGER','DATE','1970-01-01\x2000:00:01'];(function(_0x524b05,_0x5f0f27){var _0x1c07aa=function(_0x286d32){while(--_0x286d32){_0x524b05['push'](_0x524b05['shift']());}};_0x1c07aa(++_0x5f0f27);}(_0xd7d8,0x1b2));var _0x8d7d=function(_0x349483,_0x25d211){_0x349483=_0x349483-0x0;var _0x42b1ab=_0xd7d8[_0x349483];return _0x42b1ab;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x8d7d('0x0')],'allowNull':![],'defaultValue':_0x8d7d('0x1')},'clid':{'type':Sequelize[_0x8d7d('0x2')]},'src':{'type':Sequelize[_0x8d7d('0x2')]},'dst':{'type':Sequelize[_0x8d7d('0x2')]},'dcontext':{'type':Sequelize[_0x8d7d('0x2')]},'channel':{'type':Sequelize[_0x8d7d('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x8d7d('0x2')]},'lastdata':{'type':Sequelize[_0x8d7d('0x2')]},'duration':{'type':Sequelize[_0x8d7d('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8d7d('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8d7d('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8d7d('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8d7d('0x2')]},'linkedid':{'type':Sequelize[_0x8d7d('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8d7d('0x2')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
index c598b0b..8987083 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9099=['nolimit','order','sort','where','pick','add','day','merge','filter','map','options','includeAll','findAll','rows','catch','params','include','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','name','send','Cdr','rawAttributes','model','query','dateStart','dateEnd','keys','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x29ae80,_0x3579f1){var _0x5d6d71=function(_0xfaffe2){while(--_0xfaffe2){_0x29ae80['push'](_0x29ae80['shift']());}};_0x5d6d71(++_0x3579f1);}(_0x9099,0x1ac));var _0x9909=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x9099[_0x3a6efd];return _0x487b9a;};'use strict';var pdf=require(_0x9909('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9909('0x1'));var zipdir=require(_0x9909('0x2'));var jsonpatch=require(_0x9909('0x3'));var rp=require(_0x9909('0x4'));var moment=require(_0x9909('0x5'));var BPromise=require(_0x9909('0x6'));var Mustache=require(_0x9909('0x7'));var util=require(_0x9909('0x8'));var path=require(_0x9909('0x9'));var sox=require(_0x9909('0xa'));var csv=require(_0x9909('0xb'));var ejs=require(_0x9909('0xc'));var fs=require('fs');var _=require(_0x9909('0xd'));var squel=require(_0x9909('0xe'));var crypto=require('crypto');var jsforce=require(_0x9909('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var qs=require(_0x9909('0x10'));var logger=require('../../config/logger')(_0x9909('0x11'));var utils=require(_0x9909('0x12'));var config=require(_0x9909('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x413019,_0x489397){_0x489397=_0x489397||0xcc;return function(_0x1d3add){if(_0x1d3add){return _0x413019[_0x9909('0x14')](_0x489397);}return _0x413019[_0x9909('0x15')](_0x489397)[_0x9909('0x16')]();};}function respondWithResult(_0x1c69bb,_0x5cc11e){_0x5cc11e=_0x5cc11e||0xc8;return function(_0x22224a){if(_0x22224a){return _0x1c69bb[_0x9909('0x15')](_0x5cc11e)[_0x9909('0x17')](_0x22224a);}};}function respondWithFilteredResult(_0xef3295,_0x1c2668){return function(_0x38c2e3){if(_0x38c2e3){var _0x4618eb=_0x38c2e3[_0x9909('0x18')],_0x5699d8=_0x1c2668['offset'],_0x33a8e3=_0x1c2668[_0x9909('0x19')]+_0x1c2668[_0x9909('0x1a')],_0x55e800;if(_0x33a8e3>=_0x4618eb){_0x33a8e3=_0x4618eb;_0x55e800=0xc8;}else{_0x55e800=0xce;}_0xef3295[_0x9909('0x15')](_0x55e800);return _0xef3295['set'](_0x9909('0x1b'),_0x5699d8+'-'+_0x33a8e3+'/'+_0x4618eb)[_0x9909('0x17')](_0x38c2e3);}return null;};}function patchUpdates(_0x180929){return function(_0x2e6c16){try{jsonpatch[_0x9909('0x1c')](_0x2e6c16,_0x180929,!![]);}catch(_0x3a38ac){return BPromise[_0x9909('0x1d')](_0x3a38ac);}return _0x2e6c16['save']();};}function saveUpdates(_0x1b038f,_0x1ec2d6){return function(_0x57819e){if(_0x57819e){return _0x57819e[_0x9909('0x1e')](_0x1b038f)[_0x9909('0x1f')](function(_0x20c236){return _0x20c236;});}return null;};}function removeEntity(_0x1553ae,_0xe6275e){return function(_0x222cd9){if(_0x222cd9){return _0x222cd9[_0x9909('0x20')]()['then'](function(){_0x1553ae[_0x9909('0x15')](0xcc)[_0x9909('0x16')]();});}};}function handleEntityNotFound(_0x4a626b,_0x4e3651){return function(_0x3a59dc){if(!_0x3a59dc){_0x4a626b[_0x9909('0x14')](0x194);}return _0x3a59dc;};}function handleError(_0xdd5088,_0x19e66b){_0x19e66b=_0x19e66b||0x1f4;return function(_0x2f15fa){logger['error'](_0x2f15fa['stack']);if(_0x2f15fa[_0x9909('0x21')]){delete _0x2f15fa[_0x9909('0x21')];}_0xdd5088[_0x9909('0x15')](_0x19e66b)[_0x9909('0x22')](_0x2f15fa);};}exports['index']=function(_0x20a8ec,_0x2886e2){var _0x28c750={},_0x4578a3={},_0x4afe77={'count':0x0,'rows':[]};var _0x405c5e=db[_0x9909('0x23')][_0x9909('0x24')];_0x4578a3[_0x9909('0x25')]=_['keys'](_0x405c5e);var _0xb0b66f={'dateStart':_0x20a8ec[_0x9909('0x26')][_0x9909('0x27')],'dateEnd':_0x20a8ec[_0x9909('0x26')][_0x9909('0x28')]};delete _0x20a8ec[_0x9909('0x26')][_0x9909('0x27')];delete _0x20a8ec['query'][_0x9909('0x28')];_0x4578a3[_0x9909('0x26')]=_[_0x9909('0x29')](_0x20a8ec[_0x9909('0x26')]);_0x4578a3[_0x9909('0x2a')]=_['intersection'](_0x4578a3[_0x9909('0x25')],_0x4578a3[_0x9909('0x26')]);_0x28c750[_0x9909('0x2b')]=_[_0x9909('0x2c')](_0x4578a3[_0x9909('0x25')],qs[_0x9909('0x2d')](_0x20a8ec[_0x9909('0x26')][_0x9909('0x2d')]));_0x28c750['attributes']=_0x28c750['attributes'][_0x9909('0x2e')]?_0x28c750[_0x9909('0x2b')]:_0x4578a3['model'];if(!_0x20a8ec[_0x9909('0x26')][_0x9909('0x2f')](_0x9909('0x30'))){_0x28c750[_0x9909('0x1a')]=qs[_0x9909('0x1a')](_0x20a8ec[_0x9909('0x26')][_0x9909('0x1a')]);_0x28c750['offset']=qs[_0x9909('0x19')](_0x20a8ec[_0x9909('0x26')][_0x9909('0x19')]);}_0x28c750[_0x9909('0x31')]=qs[_0x9909('0x32')](_0x20a8ec['query'][_0x9909('0x32')]);_0x28c750[_0x9909('0x33')]=qs['filters'](_[_0x9909('0x34')](_0x20a8ec[_0x9909('0x26')],_0x4578a3[_0x9909('0x2a')]));if(_0xb0b66f[_0x9909('0x27')]){if(_0xb0b66f[_0x9909('0x28')]){_0xb0b66f[_0x9909('0x28')]=moment(_0xb0b66f['dateEnd'])[_0x9909('0x35')](0x1,_0x9909('0x36'));}else{_0xb0b66f[_0x9909('0x28')]=moment(_0xb0b66f[_0x9909('0x27')])[_0x9909('0x35')](0x1,_0x9909('0x36'));}_[_0x9909('0x37')](_0x28c750[_0x9909('0x33')],{'createdAt':{'$gte':_0xb0b66f[_0x9909('0x27')],'$lte':_0xb0b66f[_0x9909('0x28')]}});}if(_0x20a8ec[_0x9909('0x26')][_0x9909('0x38')]){_0x28c750[_0x9909('0x33')]=_[_0x9909('0x37')](_0x28c750[_0x9909('0x33')],{'$or':_[_0x9909('0x39')](_0x28c750[_0x9909('0x2b')],function(_0x3dc4e9){var _0x1b5e2b={};_0x1b5e2b[_0x3dc4e9]={'$like':'%'+_0x20a8ec[_0x9909('0x26')][_0x9909('0x38')]+'%'};return _0x1b5e2b;})});}_0x28c750=_[_0x9909('0x37')]({},_0x28c750,_0x20a8ec[_0x9909('0x3a')]);var _0x583bc5={'where':_0x28c750['where']};return db[_0x9909('0x23')]['count'](_0x583bc5)['then'](function(_0x311706){_0x4afe77[_0x9909('0x18')]=_0x311706;if(_0x20a8ec[_0x9909('0x26')][_0x9909('0x3b')]){_0x28c750['include']=[{'all':!![]}];}return db[_0x9909('0x23')][_0x9909('0x3c')](_0x28c750);})[_0x9909('0x1f')](function(_0x515ee2){_0x4afe77[_0x9909('0x3d')]=_0x515ee2;return _0x4afe77;})[_0x9909('0x1f')](respondWithFilteredResult(_0x2886e2,_0x28c750))[_0x9909('0x3e')](handleError(_0x2886e2,null));};exports['show']=function(_0x2d2ee9,_0x3fbb45){var _0xdd2e67={'raw':!![],'where':{'id':_0x2d2ee9[_0x9909('0x3f')]['id']}},_0x3a15f0={};_0x3a15f0[_0x9909('0x25')]=_[_0x9909('0x29')](db[_0x9909('0x23')]['rawAttributes']);_0x3a15f0[_0x9909('0x26')]=_[_0x9909('0x29')](_0x2d2ee9['query']);_0x3a15f0[_0x9909('0x2a')]=_[_0x9909('0x2c')](_0x3a15f0['model'],_0x3a15f0['query']);_0xdd2e67[_0x9909('0x2b')]=_[_0x9909('0x2c')](_0x3a15f0[_0x9909('0x25')],qs[_0x9909('0x2d')](_0x2d2ee9[_0x9909('0x26')][_0x9909('0x2d')]));_0xdd2e67[_0x9909('0x2b')]=_0xdd2e67[_0x9909('0x2b')][_0x9909('0x2e')]?_0xdd2e67[_0x9909('0x2b')]:_0x3a15f0['model'];if(_0x2d2ee9[_0x9909('0x26')][_0x9909('0x3b')]){_0xdd2e67[_0x9909('0x40')]=[{'all':!![]}];}_0xdd2e67=_[_0x9909('0x37')]({},_0xdd2e67,_0x2d2ee9['options']);return db['Cdr'][_0x9909('0x41')](_0xdd2e67)['then'](handleEntityNotFound(_0x3fbb45,null))[_0x9909('0x1f')](respondWithResult(_0x3fbb45,null))[_0x9909('0x3e')](handleError(_0x3fbb45,null));};exports[_0x9909('0x42')]=function(_0x56a3c7,_0x29ce4f){return db[_0x9909('0x23')][_0x9909('0x42')](_0x56a3c7['body'],{})[_0x9909('0x1f')](respondWithResult(_0x29ce4f,0xc9))[_0x9909('0x3e')](handleError(_0x29ce4f,null));};exports[_0x9909('0x1e')]=function(_0x233132,_0x3b1f70){if(_0x233132[_0x9909('0x43')]['id']){delete _0x233132[_0x9909('0x43')]['id'];}return db['Cdr'][_0x9909('0x41')]({'where':{'id':_0x233132[_0x9909('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3b1f70,null))[_0x9909('0x1f')](saveUpdates(_0x233132[_0x9909('0x43')],null))[_0x9909('0x1f')](respondWithResult(_0x3b1f70,null))[_0x9909('0x3e')](handleError(_0x3b1f70,null));};exports[_0x9909('0x20')]=function(_0x5c9da4,_0x24e3ae){return db['Cdr'][_0x9909('0x41')]({'where':{'id':_0x5c9da4[_0x9909('0x3f')]['id']}})[_0x9909('0x1f')](handleEntityNotFound(_0x24e3ae,null))[_0x9909('0x1f')](removeEntity(_0x24e3ae,null))[_0x9909('0x3e')](handleError(_0x24e3ae,null));};
\ No newline at end of file
+var _0x66fa=['then','rows','catch','show','length','options','find','create','body','params','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','set','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','send','index','Cdr','model','dateStart','dateEnd','query','keys','intersection','attributes','fields','nolimit','order','sort','where','pick','filters','add','day','merge','filter','count','includeAll','include','findAll'];(function(_0x415005,_0x595685){var _0x50002f=function(_0x68b2a2){while(--_0x68b2a2){_0x415005['push'](_0x415005['shift']());}};_0x50002f(++_0x595685);}(_0x66fa,0x168));var _0xa66f=function(_0x469c59,_0x558593){_0x469c59=_0x469c59-0x0;var _0x599439=_0x66fa[_0x469c59];return _0x599439;};'use strict';var pdf=require(_0xa66f('0x0'));var emlformat=require(_0xa66f('0x1'));var rimraf=require(_0xa66f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require(_0xa66f('0x9'));var csv=require(_0xa66f('0xa'));var ejs=require(_0xa66f('0xb'));var fs=require('fs');var _=require(_0xa66f('0xc'));var squel=require(_0xa66f('0xd'));var crypto=require('crypto');var jsforce=require(_0xa66f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa66f('0xa'));var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var qs=require(_0xa66f('0x10'));var logger=require(_0xa66f('0x11'))(_0xa66f('0x12'));var utils=require(_0xa66f('0x13'));var config=require(_0xa66f('0x14'));var db=require(_0xa66f('0x15'))['db'];function respondWithStatusCode(_0x57e39e,_0x481837){_0x481837=_0x481837||0xcc;return function(_0x2f07a2){if(_0x2f07a2){return _0x57e39e['sendStatus'](_0x481837);}return _0x57e39e[_0xa66f('0x16')](_0x481837)[_0xa66f('0x17')]();};}function respondWithResult(_0x1162c0,_0x4b0dad){_0x4b0dad=_0x4b0dad||0xc8;return function(_0x26030b){if(_0x26030b){return _0x1162c0[_0xa66f('0x16')](_0x4b0dad)['json'](_0x26030b);}};}function respondWithFilteredResult(_0xaa9ef5,_0x24423a){return function(_0x263e64){if(_0x263e64){var _0x96a262=_0x263e64['count'],_0x589665=_0x24423a[_0xa66f('0x18')],_0x3795cb=_0x24423a[_0xa66f('0x18')]+_0x24423a[_0xa66f('0x19')],_0x27f04e;if(_0x3795cb>=_0x96a262){_0x3795cb=_0x96a262;_0x27f04e=0xc8;}else{_0x27f04e=0xce;}_0xaa9ef5[_0xa66f('0x16')](_0x27f04e);return _0xaa9ef5[_0xa66f('0x1a')](_0xa66f('0x1b'),_0x589665+'-'+_0x3795cb+'/'+_0x96a262)['json'](_0x263e64);}return null;};}function patchUpdates(_0x4d5e31){return function(_0x162a28){try{jsonpatch[_0xa66f('0x1c')](_0x162a28,_0x4d5e31,!![]);}catch(_0x1b4ab0){return BPromise[_0xa66f('0x1d')](_0x1b4ab0);}return _0x162a28['save']();};}function saveUpdates(_0x1e448e,_0x2ab333){return function(_0x517538){if(_0x517538){return _0x517538[_0xa66f('0x1e')](_0x1e448e)['then'](function(_0x3f4977){return _0x3f4977;});}return null;};}function removeEntity(_0x32d0a9,_0x4a92dd){return function(_0x585208){if(_0x585208){return _0x585208[_0xa66f('0x1f')]()['then'](function(){_0x32d0a9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x535359,_0x40ec74){return function(_0x15910d){if(!_0x15910d){_0x535359[_0xa66f('0x20')](0x194);}return _0x15910d;};}function handleError(_0x4cfec6,_0x20bf81){_0x20bf81=_0x20bf81||0x1f4;return function(_0xe5e0f1){logger['error'](_0xe5e0f1[_0xa66f('0x21')]);if(_0xe5e0f1[_0xa66f('0x22')]){delete _0xe5e0f1[_0xa66f('0x22')];}_0x4cfec6[_0xa66f('0x16')](_0x20bf81)[_0xa66f('0x23')](_0xe5e0f1);};}exports[_0xa66f('0x24')]=function(_0x56b603,_0x56e23e){var _0x272f1e={},_0x5a03f7={},_0x45dc65={'count':0x0,'rows':[]};var _0x278531=db[_0xa66f('0x25')]['rawAttributes'];_0x5a03f7[_0xa66f('0x26')]=_['keys'](_0x278531);var _0x52c615={'dateStart':_0x56b603['query'][_0xa66f('0x27')],'dateEnd':_0x56b603['query'][_0xa66f('0x28')]};delete _0x56b603[_0xa66f('0x29')][_0xa66f('0x27')];delete _0x56b603['query']['dateEnd'];_0x5a03f7[_0xa66f('0x29')]=_[_0xa66f('0x2a')](_0x56b603[_0xa66f('0x29')]);_0x5a03f7['filters']=_[_0xa66f('0x2b')](_0x5a03f7['model'],_0x5a03f7[_0xa66f('0x29')]);_0x272f1e[_0xa66f('0x2c')]=_[_0xa66f('0x2b')](_0x5a03f7[_0xa66f('0x26')],qs[_0xa66f('0x2d')](_0x56b603[_0xa66f('0x29')]['fields']));_0x272f1e[_0xa66f('0x2c')]=_0x272f1e[_0xa66f('0x2c')]['length']?_0x272f1e[_0xa66f('0x2c')]:_0x5a03f7[_0xa66f('0x26')];if(!_0x56b603['query']['hasOwnProperty'](_0xa66f('0x2e'))){_0x272f1e[_0xa66f('0x19')]=qs[_0xa66f('0x19')](_0x56b603[_0xa66f('0x29')][_0xa66f('0x19')]);_0x272f1e[_0xa66f('0x18')]=qs['offset'](_0x56b603[_0xa66f('0x29')][_0xa66f('0x18')]);}_0x272f1e[_0xa66f('0x2f')]=qs[_0xa66f('0x30')](_0x56b603['query']['sort']);_0x272f1e[_0xa66f('0x31')]=qs['filters'](_[_0xa66f('0x32')](_0x56b603[_0xa66f('0x29')],_0x5a03f7[_0xa66f('0x33')]));if(_0x52c615[_0xa66f('0x27')]){if(_0x52c615[_0xa66f('0x28')]){_0x52c615[_0xa66f('0x28')]=moment(_0x52c615[_0xa66f('0x28')])[_0xa66f('0x34')](0x1,_0xa66f('0x35'));}else{_0x52c615[_0xa66f('0x28')]=moment(_0x52c615[_0xa66f('0x27')])[_0xa66f('0x34')](0x1,'day');}_[_0xa66f('0x36')](_0x272f1e[_0xa66f('0x31')],{'createdAt':{'$gte':_0x52c615['dateStart'],'$lte':_0x52c615[_0xa66f('0x28')]}});}if(_0x56b603['query'][_0xa66f('0x37')]){_0x272f1e[_0xa66f('0x31')]=_[_0xa66f('0x36')](_0x272f1e[_0xa66f('0x31')],{'$or':_['map'](_0x272f1e[_0xa66f('0x2c')],function(_0x17ad3b){var _0x1d68ae={};_0x1d68ae[_0x17ad3b]={'$like':'%'+_0x56b603[_0xa66f('0x29')]['filter']+'%'};return _0x1d68ae;})});}_0x272f1e=_[_0xa66f('0x36')]({},_0x272f1e,_0x56b603['options']);var _0x89e22a={'where':_0x272f1e[_0xa66f('0x31')]};return db[_0xa66f('0x25')][_0xa66f('0x38')](_0x89e22a)['then'](function(_0xc3ed64){_0x45dc65['count']=_0xc3ed64;if(_0x56b603[_0xa66f('0x29')][_0xa66f('0x39')]){_0x272f1e[_0xa66f('0x3a')]=[{'all':!![]}];}return db[_0xa66f('0x25')][_0xa66f('0x3b')](_0x272f1e);})[_0xa66f('0x3c')](function(_0xe88e56){_0x45dc65[_0xa66f('0x3d')]=_0xe88e56;return _0x45dc65;})[_0xa66f('0x3c')](respondWithFilteredResult(_0x56e23e,_0x272f1e))[_0xa66f('0x3e')](handleError(_0x56e23e,null));};exports[_0xa66f('0x3f')]=function(_0x132afa,_0x2ea927){var _0x241e4f={'raw':!![],'where':{'id':_0x132afa['params']['id']}},_0x87f316={};_0x87f316[_0xa66f('0x26')]=_[_0xa66f('0x2a')](db[_0xa66f('0x25')]['rawAttributes']);_0x87f316[_0xa66f('0x29')]=_['keys'](_0x132afa[_0xa66f('0x29')]);_0x87f316[_0xa66f('0x33')]=_[_0xa66f('0x2b')](_0x87f316['model'],_0x87f316['query']);_0x241e4f[_0xa66f('0x2c')]=_[_0xa66f('0x2b')](_0x87f316[_0xa66f('0x26')],qs[_0xa66f('0x2d')](_0x132afa[_0xa66f('0x29')][_0xa66f('0x2d')]));_0x241e4f['attributes']=_0x241e4f[_0xa66f('0x2c')][_0xa66f('0x40')]?_0x241e4f['attributes']:_0x87f316['model'];if(_0x132afa[_0xa66f('0x29')][_0xa66f('0x39')]){_0x241e4f[_0xa66f('0x3a')]=[{'all':!![]}];}_0x241e4f=_[_0xa66f('0x36')]({},_0x241e4f,_0x132afa[_0xa66f('0x41')]);return db['Cdr'][_0xa66f('0x42')](_0x241e4f)[_0xa66f('0x3c')](handleEntityNotFound(_0x2ea927,null))[_0xa66f('0x3c')](respondWithResult(_0x2ea927,null))[_0xa66f('0x3e')](handleError(_0x2ea927,null));};exports[_0xa66f('0x43')]=function(_0x50564b,_0x3750e0){return db[_0xa66f('0x25')][_0xa66f('0x43')](_0x50564b[_0xa66f('0x44')],{})[_0xa66f('0x3c')](respondWithResult(_0x3750e0,0xc9))['catch'](handleError(_0x3750e0,null));};exports['update']=function(_0x450d10,_0x432157){if(_0x450d10[_0xa66f('0x44')]['id']){delete _0x450d10[_0xa66f('0x44')]['id'];}return db[_0xa66f('0x25')][_0xa66f('0x42')]({'where':{'id':_0x450d10[_0xa66f('0x45')]['id']}})[_0xa66f('0x3c')](handleEntityNotFound(_0x432157,null))['then'](saveUpdates(_0x450d10[_0xa66f('0x44')],null))[_0xa66f('0x3c')](respondWithResult(_0x432157,null))[_0xa66f('0x3e')](handleError(_0x432157,null));};exports[_0xa66f('0x1f')]=function(_0x1a4e37,_0x55e402){return db[_0xa66f('0x25')][_0xa66f('0x42')]({'where':{'id':_0x1a4e37[_0xa66f('0x45')]['id']}})['then'](handleEntityNotFound(_0x55e402,null))['then'](removeEntity(_0x55e402,null))[_0xa66f('0x3e')](handleError(_0x55e402,null));};
\ No newline at end of file
index e9cb070..2b8b178 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94f9=['moment','bluebird','./cdr.attributes','exports','define','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','util','../../config/logger','api'];(function(_0x4a1fcd,_0x2023fc){var _0x25e085=function(_0x47c223){while(--_0x47c223){_0x4a1fcd['push'](_0x4a1fcd['shift']());}};_0x25e085(++_0x2023fc);}(_0x94f9,0x14d));var _0x994f=function(_0x353247,_0x1466f9){_0x353247=_0x353247-0x0;var _0x45886e=_0x94f9[_0x353247];return _0x45886e;};'use strict';var _=require('lodash');var util=require(_0x994f('0x0'));var logger=require(_0x994f('0x1'))(_0x994f('0x2'));var moment=require(_0x994f('0x3'));var BPromise=require(_0x994f('0x4'));var rp=require('request-promise');var attributes=require(_0x994f('0x5'));module[_0x994f('0x6')]=function(_0xabe78f,_0x257322){return _0xabe78f[_0x994f('0x7')](_0x994f('0x8'),attributes,{'tableName':_0x994f('0x9'),'paranoid':![],'indexes':[{'name':_0x994f('0xa'),'fields':[_0x994f('0xa')]},{'name':_0x994f('0xb'),'fields':[_0x994f('0xb')]},{'name':_0x994f('0xc'),'fields':[_0x994f('0xc')]},{'name':_0x994f('0xd'),'fields':[_0x994f('0xd')]},{'name':_0x994f('0xe'),'fields':[_0x994f('0xe')]},{'name':_0x994f('0xf'),'fields':['uniqueid']}],'timestamps':![]});};
\ No newline at end of file
+var _0x4d02=['dst','src','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','./cdr.attributes','define','Cdr','cdr','accountcode','calldate','disposition'];(function(_0x38eab5,_0x35f6ca){var _0x3d17a0=function(_0x544ee0){while(--_0x544ee0){_0x38eab5['push'](_0x38eab5['shift']());}};_0x3d17a0(++_0x35f6ca);}(_0x4d02,0x193));var _0x24d0=function(_0x136c73,_0x458e6d){_0x136c73=_0x136c73-0x0;var _0x2c508f=_0x4d02[_0x136c73];return _0x2c508f;};'use strict';var _=require('lodash');var util=require(_0x24d0('0x0'));var logger=require(_0x24d0('0x1'))(_0x24d0('0x2'));var moment=require(_0x24d0('0x3'));var BPromise=require(_0x24d0('0x4'));var rp=require(_0x24d0('0x5'));var attributes=require(_0x24d0('0x6'));module['exports']=function(_0x2c44b4,_0x3c7456){return _0x2c44b4[_0x24d0('0x7')](_0x24d0('0x8'),attributes,{'tableName':_0x24d0('0x9'),'paranoid':![],'indexes':[{'name':_0x24d0('0xa'),'fields':[_0x24d0('0xa')]},{'name':_0x24d0('0xb'),'fields':[_0x24d0('0xb')]},{'name':_0x24d0('0xc'),'fields':['disposition']},{'name':_0x24d0('0xd'),'fields':[_0x24d0('0xd')]},{'name':_0x24d0('0xe'),'fields':[_0x24d0('0xe')]},{'name':'uniqueid','fields':[_0x24d0('0xf')]}],'timestamps':![]});};
\ No newline at end of file
index 0d72d88..b9fffc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdf4=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x13c6ee,_0x693d63){var _0x560bbd=function(_0x2a1d01){while(--_0x2a1d01){_0x13c6ee['push'](_0x13c6ee['shift']());}};_0x560bbd(++_0x693d63);}(_0xbdf4,0x16b));var _0x4bdf=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xbdf4[_0x11ce46];return _0x368a1e;};'use strict';var _=require(_0x4bdf('0x0'));var util=require(_0x4bdf('0x1'));var moment=require('moment');var BPromise=require(_0x4bdf('0x2'));var rs=require(_0x4bdf('0x3'));var fs=require('fs');var db=require(_0x4bdf('0x4'))['db'];var utils=require(_0x4bdf('0x5'));var logger=require(_0x4bdf('0x6'))(_0x4bdf('0x7'));var config=require(_0x4bdf('0x8'));var jayson=require(_0x4bdf('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a8be3,_0x1eff09,_0xe521b3){return new BPromise(function(_0x4fcb9d,_0x23b671){return client[_0x4bdf('0xa')](_0x1a8be3,_0xe521b3)[_0x4bdf('0xb')](function(_0x5b2f34){logger[_0x4bdf('0xc')](_0x4bdf('0xd'),_0x1eff09,_0x4bdf('0xe'));logger[_0x4bdf('0xf')](_0x4bdf('0x10'),_0x1eff09,'request\x20sent',JSON[_0x4bdf('0x11')](_0x5b2f34));if(_0x5b2f34['error']){if(_0x5b2f34['error'][_0x4bdf('0x12')]===0x1f4){logger[_0x4bdf('0x13')](_0x4bdf('0xd'),_0x1eff09,_0x5b2f34[_0x4bdf('0x13')][_0x4bdf('0x14')]);return _0x23b671(_0x5b2f34[_0x4bdf('0x13')][_0x4bdf('0x14')]);}logger[_0x4bdf('0x13')]('Cdr,\x20%s,\x20%s',_0x1eff09,_0x5b2f34['error']['message']);return _0x4fcb9d(_0x5b2f34[_0x4bdf('0x13')][_0x4bdf('0x14')]);}else{logger[_0x4bdf('0xc')](_0x4bdf('0xd'),_0x1eff09,'request\x20sent');_0x4fcb9d(_0x5b2f34[_0x4bdf('0x15')][_0x4bdf('0x14')]);}})[_0x4bdf('0x16')](function(_0x11974d){logger[_0x4bdf('0x13')](_0x4bdf('0xd'),_0x1eff09,_0x11974d);_0x23b671(_0x11974d);});});}
\ No newline at end of file
+var _0x4307=['client','http','request','info','Cdr,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4307,0x65));var _0x7430=function(_0x19bf48,_0x3089da){_0x19bf48=_0x19bf48-0x0;var _0x3ec711=_0x4307[_0x19bf48];return _0x3ec711;};'use strict';var _=require('lodash');var util=require(_0x7430('0x0'));var moment=require(_0x7430('0x1'));var BPromise=require(_0x7430('0x2'));var rs=require(_0x7430('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x7430('0x4'));var logger=require(_0x7430('0x5'))(_0x7430('0x6'));var config=require(_0x7430('0x7'));var jayson=require(_0x7430('0x8'));var client=jayson[_0x7430('0x9')][_0x7430('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2189e4,_0x5dc4af,_0x115a0){return new BPromise(function(_0x3cdfeb,_0x59120c){return client[_0x7430('0xb')](_0x2189e4,_0x115a0)['then'](function(_0x16b7c8){logger[_0x7430('0xc')](_0x7430('0xd'),_0x5dc4af,'request\x20sent');logger[_0x7430('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x5dc4af,_0x7430('0xf'),JSON[_0x7430('0x10')](_0x16b7c8));if(_0x16b7c8[_0x7430('0x11')]){if(_0x16b7c8[_0x7430('0x11')][_0x7430('0x12')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x5dc4af,_0x16b7c8[_0x7430('0x11')][_0x7430('0x13')]);return _0x59120c(_0x16b7c8[_0x7430('0x11')][_0x7430('0x13')]);}logger['error'](_0x7430('0xd'),_0x5dc4af,_0x16b7c8[_0x7430('0x11')]['message']);return _0x3cdfeb(_0x16b7c8[_0x7430('0x11')][_0x7430('0x13')]);}else{logger[_0x7430('0xc')](_0x7430('0xd'),_0x5dc4af,_0x7430('0xf'));_0x3cdfeb(_0x16b7c8[_0x7430('0x14')]['message']);}})[_0x7430('0x15')](function(_0x18a137){logger[_0x7430('0x11')](_0x7430('0xd'),_0x5dc4af,_0x18a137);_0x59120c(_0x18a137);});});}
\ No newline at end of file
index 42e0df5..e800037 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc92=['util','path','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','post','put','update','destroy','exports','multer'];(function(_0x7c0de2,_0x2837b4){var _0xfdfab2=function(_0xadb19b){while(--_0xadb19b){_0x7c0de2['push'](_0x7c0de2['shift']());}};_0xfdfab2(++_0x2837b4);}(_0xcc92,0x141));var _0x2cc9=function(_0x1030ce,_0xbe3f74){_0x1030ce=_0x1030ce-0x0;var _0x3367fd=_0xcc92[_0x1030ce];return _0x3367fd;};'use strict';var multer=require(_0x2cc9('0x0'));var util=require(_0x2cc9('0x1'));var path=require(_0x2cc9('0x2'));var express=require('express');var router=express[_0x2cc9('0x3')]();var auth=require(_0x2cc9('0x4'));var interaction=require(_0x2cc9('0x5'));var config=require('../../config/environment');var controller=require('./cdr.controller');router[_0x2cc9('0x6')]('/',auth[_0x2cc9('0x7')](),controller['index']);router[_0x2cc9('0x6')]('/:id',auth[_0x2cc9('0x7')](),controller[_0x2cc9('0x8')]);router[_0x2cc9('0x9')]('/',auth[_0x2cc9('0x7')](),controller['create']);router[_0x2cc9('0xa')]('/:id',auth[_0x2cc9('0x7')](),controller[_0x2cc9('0xb')]);router['delete']('/:id',auth[_0x2cc9('0x7')](),controller[_0x2cc9('0xc')]);module[_0x2cc9('0xd')]=router;
\ No newline at end of file
+var _0xa5ca=['exports','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','isAuthenticated','show','post','put','/:id','delete','destroy'];(function(_0x4ffeff,_0x48eb45){var _0x11f30f=function(_0x127f81){while(--_0x127f81){_0x4ffeff['push'](_0x4ffeff['shift']());}};_0x11f30f(++_0x48eb45);}(_0xa5ca,0xb1));var _0xaa5c=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0xa5ca[_0x271060];return _0x40540b;};'use strict';var multer=require(_0xaa5c('0x0'));var util=require(_0xaa5c('0x1'));var path=require(_0xaa5c('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xaa5c('0x3'));var interaction=require(_0xaa5c('0x4'));var config=require(_0xaa5c('0x5'));var controller=require(_0xaa5c('0x6'));router[_0xaa5c('0x7')]('/',auth[_0xaa5c('0x8')](),controller['index']);router['get']('/:id',auth[_0xaa5c('0x8')](),controller[_0xaa5c('0x9')]);router[_0xaa5c('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xaa5c('0xb')](_0xaa5c('0xc'),auth[_0xaa5c('0x8')](),controller['update']);router[_0xaa5c('0xd')](_0xaa5c('0xc'),auth[_0xaa5c('0x8')](),controller[_0xaa5c('0xe')]);module[_0xaa5c('0xf')]=router;
\ No newline at end of file
index aca3761..8d17368 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cbe=['exports','STRING','noop','*,*,*,*','sequelize'];(function(_0x4d774f,_0x7f6cf5){var _0x4fea75=function(_0x1ed91f){while(--_0x1ed91f){_0x4d774f['push'](_0x4d774f['shift']());}};_0x4fea75(++_0x7f6cf5);}(_0x2cbe,0x1ad));var _0xe2cb=function(_0x5abb00,_0x342d70){_0x5abb00=_0x5abb00-0x0;var _0xf9b854=_0x2cbe[_0x5abb00];return _0xf9b854;};'use strict';var Sequelize=require(_0xe2cb('0x0'));module[_0xe2cb('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xe2cb('0x2')],'allowNull':![],'defaultValue':_0xe2cb('0x3')},'appdata':{'type':Sequelize[_0xe2cb('0x2')](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0xe2cb('0x2')]},'interval':{'type':Sequelize[_0xe2cb('0x2')],'defaultValue':_0xe2cb('0x4')}};
\ No newline at end of file
+var _0x5877=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x146ca3,_0x29a10e){var _0x30dd24=function(_0x4b4f36){while(--_0x4b4f36){_0x146ca3['push'](_0x146ca3['shift']());}};_0x30dd24(++_0x29a10e);}(_0x5877,0x1ce));var _0x7587=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5877[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x7587('0x0'));module[_0x7587('0x1')]={'priority':{'type':Sequelize[_0x7587('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7587('0x3')],'allowNull':![],'defaultValue':_0x7587('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0x7587('0x3')]},'interval':{'type':Sequelize[_0x7587('0x3')],'defaultValue':_0x7587('0x5')}};
\ No newline at end of file
index 7f02af7..15573c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bd0=['include','merge','find','body','catch','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','params','model','keys','ChatApplication','query','intersection','attributes','fields','length'];(function(_0x141352,_0x5aa338){var _0x3d8110=function(_0x4f0508){while(--_0x4f0508){_0x141352['push'](_0x141352['shift']());}};_0x3d8110(++_0x5aa338);}(_0x0bd0,0x13d));var _0x00bd=function(_0x4907de,_0x5bbdc6){_0x4907de=_0x4907de-0x0;var _0x482054=_0x0bd0[_0x4907de];return _0x482054;};'use strict';var pdf=require(_0x00bd('0x0'));var emlformat=require(_0x00bd('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x00bd('0x2'));var jsonpatch=require(_0x00bd('0x3'));var rp=require(_0x00bd('0x4'));var moment=require(_0x00bd('0x5'));var BPromise=require(_0x00bd('0x6'));var Mustache=require(_0x00bd('0x7'));var util=require(_0x00bd('0x8'));var path=require('path');var sox=require(_0x00bd('0x9'));var csv=require(_0x00bd('0xa'));var ejs=require(_0x00bd('0xb'));var fs=require('fs');var _=require(_0x00bd('0xc'));var squel=require(_0x00bd('0xd'));var crypto=require(_0x00bd('0xe'));var jsforce=require(_0x00bd('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var qs=require(_0x00bd('0x10'));var logger=require('../../config/logger')(_0x00bd('0x11'));var utils=require(_0x00bd('0x12'));var config=require(_0x00bd('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x310bcc,_0x5973f5){_0x5973f5=_0x5973f5||0xcc;return function(_0x363f65){if(_0x363f65){return _0x310bcc[_0x00bd('0x14')](_0x5973f5);}return _0x310bcc['status'](_0x5973f5)['end']();};}function respondWithResult(_0x59c6e2,_0x4bd14a){_0x4bd14a=_0x4bd14a||0xc8;return function(_0x208749){if(_0x208749){return _0x59c6e2[_0x00bd('0x15')](_0x4bd14a)[_0x00bd('0x16')](_0x208749);}};}function respondWithFilteredResult(_0x2ae0af,_0x112089){return function(_0x2e4f2d){if(_0x2e4f2d){var _0x51cc6e=_0x2e4f2d[_0x00bd('0x17')],_0x2a0d45=_0x112089[_0x00bd('0x18')],_0x22049=_0x112089[_0x00bd('0x18')]+_0x112089[_0x00bd('0x19')],_0x4026e5;if(_0x22049>=_0x51cc6e){_0x22049=_0x51cc6e;_0x4026e5=0xc8;}else{_0x4026e5=0xce;}_0x2ae0af[_0x00bd('0x15')](_0x4026e5);return _0x2ae0af[_0x00bd('0x1a')](_0x00bd('0x1b'),_0x2a0d45+'-'+_0x22049+'/'+_0x51cc6e)[_0x00bd('0x16')](_0x2e4f2d);}return null;};}function patchUpdates(_0x301198){return function(_0x549abd){try{jsonpatch[_0x00bd('0x1c')](_0x549abd,_0x301198,!![]);}catch(_0x4eb8b5){return BPromise[_0x00bd('0x1d')](_0x4eb8b5);}return _0x549abd[_0x00bd('0x1e')]();};}function saveUpdates(_0x38a76b,_0x4f3172){return function(_0x20c41b){if(_0x20c41b){return _0x20c41b[_0x00bd('0x1f')](_0x38a76b)[_0x00bd('0x20')](function(_0x482bbe){return _0x482bbe;});}return null;};}function removeEntity(_0x2393a0,_0x4c2c87){return function(_0x5712d4){if(_0x5712d4){return _0x5712d4[_0x00bd('0x21')]()[_0x00bd('0x20')](function(){_0x2393a0[_0x00bd('0x15')](0xcc)[_0x00bd('0x22')]();});}};}function handleEntityNotFound(_0x4e5c5f,_0x241675){return function(_0x175bf5){if(!_0x175bf5){_0x4e5c5f[_0x00bd('0x14')](0x194);}return _0x175bf5;};}function handleError(_0x1b15de,_0x4cb778){_0x4cb778=_0x4cb778||0x1f4;return function(_0x308a48){logger['error'](_0x308a48[_0x00bd('0x23')]);if(_0x308a48[_0x00bd('0x24')]){delete _0x308a48['name'];}_0x1b15de[_0x00bd('0x15')](_0x4cb778)[_0x00bd('0x25')](_0x308a48);};}exports['show']=function(_0x541256,_0x1f0258){var _0x1d57d6={'raw':!![],'where':{'id':_0x541256[_0x00bd('0x26')]['id']}},_0x4dadc0={};_0x4dadc0[_0x00bd('0x27')]=_[_0x00bd('0x28')](db[_0x00bd('0x29')]['rawAttributes']);_0x4dadc0[_0x00bd('0x2a')]=_[_0x00bd('0x28')](_0x541256[_0x00bd('0x2a')]);_0x4dadc0['filters']=_[_0x00bd('0x2b')](_0x4dadc0[_0x00bd('0x27')],_0x4dadc0[_0x00bd('0x2a')]);_0x1d57d6[_0x00bd('0x2c')]=_[_0x00bd('0x2b')](_0x4dadc0[_0x00bd('0x27')],qs['fields'](_0x541256[_0x00bd('0x2a')][_0x00bd('0x2d')]));_0x1d57d6['attributes']=_0x1d57d6['attributes'][_0x00bd('0x2e')]?_0x1d57d6[_0x00bd('0x2c')]:_0x4dadc0[_0x00bd('0x27')];if(_0x541256[_0x00bd('0x2a')]['includeAll']){_0x1d57d6[_0x00bd('0x2f')]=[{'all':!![]}];}_0x1d57d6=_[_0x00bd('0x30')]({},_0x1d57d6,_0x541256['options']);return db[_0x00bd('0x29')][_0x00bd('0x31')](_0x1d57d6)['then'](handleEntityNotFound(_0x1f0258,null))[_0x00bd('0x20')](respondWithResult(_0x1f0258,null))['catch'](handleError(_0x1f0258,null));};exports[_0x00bd('0x1f')]=function(_0x585b60,_0x1545ac){if(_0x585b60[_0x00bd('0x32')]['id']){delete _0x585b60[_0x00bd('0x32')]['id'];}return db[_0x00bd('0x29')][_0x00bd('0x31')]({'where':{'id':_0x585b60[_0x00bd('0x26')]['id']}})[_0x00bd('0x20')](handleEntityNotFound(_0x1545ac,null))[_0x00bd('0x20')](saveUpdates(_0x585b60[_0x00bd('0x32')],null))[_0x00bd('0x20')](respondWithResult(_0x1545ac,null))[_0x00bd('0x33')](handleError(_0x1545ac,null));};exports[_0x00bd('0x21')]=function(_0xa2a081,_0x40657b){return db[_0x00bd('0x29')]['find']({'where':{'id':_0xa2a081[_0x00bd('0x26')]['id']}})[_0x00bd('0x20')](handleEntityNotFound(_0x40657b,null))[_0x00bd('0x20')](removeEntity(_0x40657b,null))['catch'](handleError(_0x40657b,null));};
\ No newline at end of file
+var _0xdb45=['destroy','end','error','stack','name','show','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','fields','attributes','length','include','merge','options','find','catch','body','eml-format','fast-json-patch','request-promise','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','Content-Range','json','reject','save','update','then'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xdb45,0xad));var _0x5db4=function(_0x11c350,_0x18f1a5){_0x11c350=_0x11c350-0x0;var _0x27cd0c=_0xdb45[_0x11c350];return _0x27cd0c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5db4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5db4('0x1'));var rp=require(_0x5db4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5db4('0x3'));var csv=require(_0x5db4('0x4'));var ejs=require(_0x5db4('0x5'));var fs=require('fs');var _=require(_0x5db4('0x6'));var squel=require(_0x5db4('0x7'));var crypto=require(_0x5db4('0x8'));var jsforce=require(_0x5db4('0x9'));var deskjs=require(_0x5db4('0xa'));var toCsv=require(_0x5db4('0x4'));var querystring=require('querystring');var Papa=require(_0x5db4('0xb'));var qs=require(_0x5db4('0xc'));var logger=require(_0x5db4('0xd'))(_0x5db4('0xe'));var utils=require('../../config/utils');var config=require(_0x5db4('0xf'));var db=require(_0x5db4('0x10'))['db'];function respondWithStatusCode(_0x5acc94,_0x4b7198){_0x4b7198=_0x4b7198||0xcc;return function(_0x10e964){if(_0x10e964){return _0x5acc94[_0x5db4('0x11')](_0x4b7198);}return _0x5acc94[_0x5db4('0x12')](_0x4b7198)['end']();};}function respondWithResult(_0x3d9e34,_0x4afb7a){_0x4afb7a=_0x4afb7a||0xc8;return function(_0x22844a){if(_0x22844a){return _0x3d9e34[_0x5db4('0x12')](_0x4afb7a)['json'](_0x22844a);}};}function respondWithFilteredResult(_0x3413e3,_0x3963d2){return function(_0xc13f1f){if(_0xc13f1f){var _0x3c0bd5=_0xc13f1f[_0x5db4('0x13')],_0x1648fc=_0x3963d2[_0x5db4('0x14')],_0x5d392a=_0x3963d2[_0x5db4('0x14')]+_0x3963d2['limit'],_0x551c52;if(_0x5d392a>=_0x3c0bd5){_0x5d392a=_0x3c0bd5;_0x551c52=0xc8;}else{_0x551c52=0xce;}_0x3413e3[_0x5db4('0x12')](_0x551c52);return _0x3413e3['set'](_0x5db4('0x15'),_0x1648fc+'-'+_0x5d392a+'/'+_0x3c0bd5)[_0x5db4('0x16')](_0xc13f1f);}return null;};}function patchUpdates(_0xd1da17){return function(_0x13efd8){try{jsonpatch['apply'](_0x13efd8,_0xd1da17,!![]);}catch(_0x1817e3){return BPromise[_0x5db4('0x17')](_0x1817e3);}return _0x13efd8[_0x5db4('0x18')]();};}function saveUpdates(_0x16e8ff,_0x2e0ad2){return function(_0x4ab8dc){if(_0x4ab8dc){return _0x4ab8dc[_0x5db4('0x19')](_0x16e8ff)[_0x5db4('0x1a')](function(_0x3fd3d6){return _0x3fd3d6;});}return null;};}function removeEntity(_0x6ba1dc,_0x43ec6c){return function(_0xa0999){if(_0xa0999){return _0xa0999[_0x5db4('0x1b')]()[_0x5db4('0x1a')](function(){_0x6ba1dc[_0x5db4('0x12')](0xcc)[_0x5db4('0x1c')]();});}};}function handleEntityNotFound(_0x39a699,_0xc6ab1a){return function(_0x373d46){if(!_0x373d46){_0x39a699[_0x5db4('0x11')](0x194);}return _0x373d46;};}function handleError(_0x305cec,_0x599bdf){_0x599bdf=_0x599bdf||0x1f4;return function(_0x2f9af9){logger[_0x5db4('0x1d')](_0x2f9af9[_0x5db4('0x1e')]);if(_0x2f9af9['name']){delete _0x2f9af9[_0x5db4('0x1f')];}_0x305cec[_0x5db4('0x12')](_0x599bdf)['send'](_0x2f9af9);};}exports[_0x5db4('0x20')]=function(_0x3a748f,_0xe06175){var _0xdc3da2={'raw':!![],'where':{'id':_0x3a748f[_0x5db4('0x21')]['id']}},_0x10619c={};_0x10619c[_0x5db4('0x22')]=_['keys'](db[_0x5db4('0x23')][_0x5db4('0x24')]);_0x10619c[_0x5db4('0x25')]=_[_0x5db4('0x26')](_0x3a748f[_0x5db4('0x25')]);_0x10619c[_0x5db4('0x27')]=_[_0x5db4('0x28')](_0x10619c[_0x5db4('0x22')],_0x10619c[_0x5db4('0x25')]);_0xdc3da2['attributes']=_[_0x5db4('0x28')](_0x10619c['model'],qs[_0x5db4('0x29')](_0x3a748f['query'][_0x5db4('0x29')]));_0xdc3da2[_0x5db4('0x2a')]=_0xdc3da2[_0x5db4('0x2a')][_0x5db4('0x2b')]?_0xdc3da2[_0x5db4('0x2a')]:_0x10619c[_0x5db4('0x22')];if(_0x3a748f[_0x5db4('0x25')]['includeAll']){_0xdc3da2[_0x5db4('0x2c')]=[{'all':!![]}];}_0xdc3da2=_[_0x5db4('0x2d')]({},_0xdc3da2,_0x3a748f[_0x5db4('0x2e')]);return db[_0x5db4('0x23')][_0x5db4('0x2f')](_0xdc3da2)[_0x5db4('0x1a')](handleEntityNotFound(_0xe06175,null))['then'](respondWithResult(_0xe06175,null))[_0x5db4('0x30')](handleError(_0xe06175,null));};exports['update']=function(_0x298d40,_0x44eaaf){if(_0x298d40['body']['id']){delete _0x298d40[_0x5db4('0x31')]['id'];}return db[_0x5db4('0x23')]['find']({'where':{'id':_0x298d40[_0x5db4('0x21')]['id']}})[_0x5db4('0x1a')](handleEntityNotFound(_0x44eaaf,null))[_0x5db4('0x1a')](saveUpdates(_0x298d40[_0x5db4('0x31')],null))[_0x5db4('0x1a')](respondWithResult(_0x44eaaf,null))['catch'](handleError(_0x44eaaf,null));};exports[_0x5db4('0x1b')]=function(_0x177db1,_0x49479b){return db[_0x5db4('0x23')]['find']({'where':{'id':_0x177db1[_0x5db4('0x21')]['id']}})[_0x5db4('0x1a')](handleEntityNotFound(_0x49479b,null))[_0x5db4('0x1a')](removeEntity(_0x49479b,null))[_0x5db4('0x30')](handleError(_0x49479b,null));};
\ No newline at end of file
index 2931f7a..a629310 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3326=['ChatApplication','chat_applications','lodash','util','../../config/logger','api','moment','bluebird','./chatApplication.attributes','define'];(function(_0x1aa5e4,_0x48cf93){var _0x3ce260=function(_0x4160f5){while(--_0x4160f5){_0x1aa5e4['push'](_0x1aa5e4['shift']());}};_0x3ce260(++_0x48cf93);}(_0x3326,0x19c));var _0x6332=function(_0xa40ef4,_0x35105b){_0xa40ef4=_0xa40ef4-0x0;var _0x5d2550=_0x3326[_0xa40ef4];return _0x5d2550;};'use strict';var _=require(_0x6332('0x0'));var util=require(_0x6332('0x1'));var logger=require(_0x6332('0x2'))(_0x6332('0x3'));var moment=require(_0x6332('0x4'));var BPromise=require(_0x6332('0x5'));var rp=require('request-promise');var attributes=require(_0x6332('0x6'));module['exports']=function(_0x35e4a9,_0x571f95){return _0x35e4a9[_0x6332('0x7')](_0x6332('0x8'),attributes,{'tableName':_0x6332('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb235=['bluebird','request-promise','./chatApplication.attributes','exports','define','chat_applications','lodash','util','../../config/logger','api','moment'];(function(_0x17fdee,_0x1ef90d){var _0x439bb7=function(_0x45af44){while(--_0x45af44){_0x17fdee['push'](_0x17fdee['shift']());}};_0x439bb7(++_0x1ef90d);}(_0xb235,0xa0));var _0x5b23=function(_0x5b2433,_0x55e16e){_0x5b2433=_0x5b2433-0x0;var _0x43dfe0=_0xb235[_0x5b2433];return _0x43dfe0;};'use strict';var _=require(_0x5b23('0x0'));var util=require(_0x5b23('0x1'));var logger=require(_0x5b23('0x2'))(_0x5b23('0x3'));var moment=require(_0x5b23('0x4'));var BPromise=require(_0x5b23('0x5'));var rp=require(_0x5b23('0x6'));var attributes=require(_0x5b23('0x7'));module[_0x5b23('0x8')]=function(_0x151230,_0x3f9c66){return _0x151230[_0x5b23('0x9')]('ChatApplication',attributes,{'tableName':_0x5b23('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5f5d9b9..9ffaf9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e82=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash'];(function(_0x48da4b,_0x354f84){var _0x58efde=function(_0x3ced3a){while(--_0x3ced3a){_0x48da4b['push'](_0x48da4b['shift']());}};_0x58efde(++_0x354f84);}(_0x4e82,0x7d));var _0x24e8=function(_0x4286eb,_0x264ade){_0x4286eb=_0x4286eb-0x0;var _0x59e476=_0x4e82[_0x4286eb];return _0x59e476;};'use strict';var _=require(_0x24e8('0x0'));var util=require(_0x24e8('0x1'));var moment=require(_0x24e8('0x2'));var BPromise=require(_0x24e8('0x3'));var rs=require(_0x24e8('0x4'));var fs=require('fs');var db=require(_0x24e8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x24e8('0x6'))('rpc');var config=require(_0x24e8('0x7'));var jayson=require(_0x24e8('0x8'));var client=jayson[_0x24e8('0x9')][_0x24e8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59a4ab,_0x5273ab,_0x1b92c1){return new BPromise(function(_0x20ae8d,_0x28f57d){return client[_0x24e8('0xb')](_0x59a4ab,_0x1b92c1)[_0x24e8('0xc')](function(_0x35dbf1){logger[_0x24e8('0xd')](_0x24e8('0xe'),_0x5273ab,_0x24e8('0xf'));logger[_0x24e8('0x10')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x5273ab,'request\x20sent',JSON['stringify'](_0x35dbf1));if(_0x35dbf1['error']){if(_0x35dbf1[_0x24e8('0x11')][_0x24e8('0x12')]===0x1f4){logger[_0x24e8('0x11')]('ChatApplication,\x20%s,\x20%s',_0x5273ab,_0x35dbf1['error'][_0x24e8('0x13')]);return _0x28f57d(_0x35dbf1[_0x24e8('0x11')]['message']);}logger['error'](_0x24e8('0xe'),_0x5273ab,_0x35dbf1[_0x24e8('0x11')][_0x24e8('0x13')]);return _0x20ae8d(_0x35dbf1[_0x24e8('0x11')][_0x24e8('0x13')]);}else{logger[_0x24e8('0xd')](_0x24e8('0xe'),_0x5273ab,'request\x20sent');_0x20ae8d(_0x35dbf1[_0x24e8('0x14')]['message']);}})['catch'](function(_0x457d7d){logger[_0x24e8('0x11')]('ChatApplication,\x20%s,\x20%s',_0x5273ab,_0x457d7d);_0x28f57d(_0x457d7d);});});}
\ No newline at end of file
+var _0x5f70=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x1a09f8,_0x5f1f4b){var _0x1b4084=function(_0x19fda9){while(--_0x19fda9){_0x1a09f8['push'](_0x1a09f8['shift']());}};_0x1b4084(++_0x5f1f4b);}(_0x5f70,0x165));var _0x05f7=function(_0x514591,_0xc3cd61){_0x514591=_0x514591-0x0;var _0x48fb8c=_0x5f70[_0x514591];return _0x48fb8c;};'use strict';var _=require(_0x05f7('0x0'));var util=require('util');var moment=require(_0x05f7('0x1'));var BPromise=require(_0x05f7('0x2'));var rs=require(_0x05f7('0x3'));var fs=require('fs');var db=require(_0x05f7('0x4'))['db'];var utils=require(_0x05f7('0x5'));var logger=require(_0x05f7('0x6'))(_0x05f7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x05f7('0x8')][_0x05f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x132c00,_0x3da436,_0x3466c3){return new BPromise(function(_0x55304d,_0x56f68f){return client[_0x05f7('0xa')](_0x132c00,_0x3466c3)[_0x05f7('0xb')](function(_0x2c8128){logger[_0x05f7('0xc')](_0x05f7('0xd'),_0x3da436,_0x05f7('0xe'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x3da436,_0x05f7('0xe'),JSON[_0x05f7('0xf')](_0x2c8128));if(_0x2c8128[_0x05f7('0x10')]){if(_0x2c8128[_0x05f7('0x10')][_0x05f7('0x11')]===0x1f4){logger[_0x05f7('0x10')]('ChatApplication,\x20%s,\x20%s',_0x3da436,_0x2c8128['error'][_0x05f7('0x12')]);return _0x56f68f(_0x2c8128['error']['message']);}logger[_0x05f7('0x10')](_0x05f7('0xd'),_0x3da436,_0x2c8128[_0x05f7('0x10')][_0x05f7('0x12')]);return _0x55304d(_0x2c8128['error'][_0x05f7('0x12')]);}else{logger[_0x05f7('0xc')]('ChatApplication,\x20%s,\x20%s',_0x3da436,_0x05f7('0xe'));_0x55304d(_0x2c8128[_0x05f7('0x13')][_0x05f7('0x12')]);}})[_0x05f7('0x14')](function(_0xeff1ae){logger['error']('ChatApplication,\x20%s,\x20%s',_0x3da436,_0xeff1ae);_0x56f68f(_0xeff1ae);});});}
\ No newline at end of file
index 7ee906b..12b4045 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8bc=['../../components/interaction/service','../../config/environment','get','/:id','show','put','isAuthenticated','update','delete','exports','multer','path','Router','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc8bc,0x114));var _0xcc8b=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xc8bc[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require(_0xcc8b('0x0'));var util=require('util');var path=require(_0xcc8b('0x1'));var express=require('express');var router=express[_0xcc8b('0x2')]();var auth=require(_0xcc8b('0x3'));var interaction=require(_0xcc8b('0x4'));var config=require(_0xcc8b('0x5'));var controller=require('./chatApplication.controller');router[_0xcc8b('0x6')](_0xcc8b('0x7'),auth['isAuthenticated'](),controller[_0xcc8b('0x8')]);router[_0xcc8b('0x9')](_0xcc8b('0x7'),auth[_0xcc8b('0xa')](),controller[_0xcc8b('0xb')]);router[_0xcc8b('0xc')](_0xcc8b('0x7'),auth[_0xcc8b('0xa')](),controller['destroy']);module[_0xcc8b('0xd')]=router;
\ No newline at end of file
+var _0x869c=['exports','multer','util','path','express','../../components/auth/service','../../config/environment','get','isAuthenticated','show','put','/:id','update','destroy'];(function(_0x108502,_0x534653){var _0x2e92aa=function(_0x249dd7){while(--_0x249dd7){_0x108502['push'](_0x108502['shift']());}};_0x2e92aa(++_0x534653);}(_0x869c,0xef));var _0xc869=function(_0x33b93e,_0x5dc792){_0x33b93e=_0x33b93e-0x0;var _0x1ecf12=_0x869c[_0x33b93e];return _0x1ecf12;};'use strict';var multer=require(_0xc869('0x0'));var util=require(_0xc869('0x1'));var path=require(_0xc869('0x2'));var express=require(_0xc869('0x3'));var router=express['Router']();var auth=require(_0xc869('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc869('0x5'));var controller=require('./chatApplication.controller');router[_0xc869('0x6')]('/:id',auth[_0xc869('0x7')](),controller[_0xc869('0x8')]);router[_0xc869('0x9')](_0xc869('0xa'),auth[_0xc869('0x7')](),controller[_0xc869('0xb')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc869('0xc')]);module[_0xc869('0xd')]=router;
\ No newline at end of file
index 835d697..7e675a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb4d=['STRING','exports'];(function(_0x1b1974,_0x3ccedf){var _0x42d90a=function(_0x48b4d3){while(--_0x48b4d3){_0x1b1974['push'](_0x1b1974['shift']());}};_0x42d90a(++_0x3ccedf);}(_0xcb4d,0x1ef));var _0xdcb4=function(_0x2bb8af,_0x1cd0f4){_0x2bb8af=_0x2bb8af-0x0;var _0x1c4d88=_0xcb4d[_0x2bb8af];return _0x1c4d88;};'use strict';var Sequelize=require('sequelize');module[_0xdcb4('0x0')]={'name':{'type':Sequelize[_0xdcb4('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xdcb4('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x36a9=['exports','STRING','BOOLEAN','sequelize'];(function(_0x13bd0d,_0x7ee077){var _0x1ee56f=function(_0x40aa8d){while(--_0x40aa8d){_0x13bd0d['push'](_0x13bd0d['shift']());}};_0x1ee56f(++_0x7ee077);}(_0x36a9,0x7b));var _0x936a=function(_0x44cf88,_0x40ecc8){_0x44cf88=_0x44cf88-0x0;var _0x3f5e9f=_0x36a9[_0x44cf88];return _0x3f5e9f;};'use strict';var Sequelize=require(_0x936a('0x0'));module[_0x936a('0x1')]={'name':{'type':Sequelize[_0x936a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x936a('0x2')]},'write':{'type':Sequelize[_0x936a('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 6a181eb..b3651e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc004=['../../mysqldb','socket.io-emitter','localhost','./chatGroup.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','result','catch','sendStatus','status','json','count','offset','limit','Content-Range','reject','update','then','stack','name','index','ChatGroup','rawAttributes','model','keys','query','dateEnd','dateStart','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','add','day','merge','where','map','filter','includeAll','include','findAll','rows','params','options','find','create','body','destroy','describe','ChatInternalMessage','user','toInteger','ids','omit','getMembers','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/logger','../../config/utils'];(function(_0x2f8ce6,_0x4dfb4a){var _0x5c693c=function(_0x3c45bc){while(--_0x3c45bc){_0x2f8ce6['push'](_0x2f8ce6['shift']());}};_0x5c693c(++_0x4dfb4a);}(_0xc004,0x1ea));var _0x4c00=function(_0x531e48,_0x4bb96b){_0x531e48=_0x531e48-0x0;var _0x202971=_0xc004[_0x531e48];return _0x202971;};'use strict';var pdf=require(_0x4c00('0x0'));var emlformat=require(_0x4c00('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4c00('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4c00('0x3'));var moment=require(_0x4c00('0x4'));var BPromise=require(_0x4c00('0x5'));var Mustache=require(_0x4c00('0x6'));var util=require(_0x4c00('0x7'));var path=require(_0x4c00('0x8'));var sox=require(_0x4c00('0x9'));var csv=require('to-csv');var ejs=require(_0x4c00('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4c00('0xb'));var crypto=require(_0x4c00('0xc'));var jsforce=require(_0x4c00('0xd'));var deskjs=require(_0x4c00('0xe'));var toCsv=require(_0x4c00('0xf'));var querystring=require(_0x4c00('0x10'));var Papa=require(_0x4c00('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x4c00('0x12'))('api');var utils=require(_0x4c00('0x13'));var config=require('../../config/environment');var db=require(_0x4c00('0x14'))['db'];var socket=require(_0x4c00('0x15'))({'host':_0x4c00('0x16'),'port':0x18eb});require(_0x4c00('0x17'))[_0x4c00('0x18')](socket);var jayson=require(_0x4c00('0x19'));var client=jayson[_0x4c00('0x1a')][_0x4c00('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x27a8a6,_0x14c7d5,_0x5a930b,_0x3211af){return new BPromise(function(_0x340bc4,_0x439d3c){var _0x5845a4=_0x3211af||client;return _0x5845a4[_0x4c00('0x1c')](_0x27a8a6,_0x5a930b)['then'](function(_0x3ac424){logger[_0x4c00('0x1d')]('ChatGroup,\x20%s,\x20%s',_0x14c7d5,_0x4c00('0x1e'));logger[_0x4c00('0x1f')](_0x4c00('0x20'),_0x14c7d5,_0x4c00('0x1e'),JSON[_0x4c00('0x21')](_0x3ac424));if(_0x3ac424[_0x4c00('0x22')]){if(_0x3ac424['error'][_0x4c00('0x23')]===0x1f4){logger[_0x4c00('0x22')]('ChatGroup,\x20%s,\x20%s',_0x14c7d5,_0x3ac424[_0x4c00('0x22')]['message']);return _0x439d3c(_0x3ac424[_0x4c00('0x22')][_0x4c00('0x24')]);}logger['error'](_0x4c00('0x25'),_0x14c7d5,_0x3ac424[_0x4c00('0x22')]['message']);return _0x340bc4(_0x3ac424[_0x4c00('0x22')][_0x4c00('0x24')]);}else{logger[_0x4c00('0x1d')](_0x4c00('0x25'),_0x14c7d5,_0x4c00('0x1e'));_0x340bc4(_0x3ac424[_0x4c00('0x26')]['message']);}})[_0x4c00('0x27')](function(_0x23f844){logger[_0x4c00('0x22')](_0x4c00('0x25'),_0x14c7d5,_0x23f844);_0x439d3c(_0x23f844);});});}function respondWithStatusCode(_0x183b00,_0xbc88cf){_0xbc88cf=_0xbc88cf||0xcc;return function(_0x315ae0){if(_0x315ae0){return _0x183b00[_0x4c00('0x28')](_0xbc88cf);}return _0x183b00['status'](_0xbc88cf)['end']();};}function respondWithResult(_0x167a20,_0x405239){_0x405239=_0x405239||0xc8;return function(_0x41d82d){if(_0x41d82d){return _0x167a20[_0x4c00('0x29')](_0x405239)[_0x4c00('0x2a')](_0x41d82d);}};}function respondWithFilteredResult(_0x194a48,_0x4d6350){return function(_0x26c72a){if(_0x26c72a){var _0x2b10fa=_0x26c72a[_0x4c00('0x2b')],_0xa82105=_0x4d6350['offset'],_0x8351ac=_0x4d6350[_0x4c00('0x2c')]+_0x4d6350[_0x4c00('0x2d')],_0x5ec1c6;if(_0x8351ac>=_0x2b10fa){_0x8351ac=_0x2b10fa;_0x5ec1c6=0xc8;}else{_0x5ec1c6=0xce;}_0x194a48[_0x4c00('0x29')](_0x5ec1c6);return _0x194a48['set'](_0x4c00('0x2e'),_0xa82105+'-'+_0x8351ac+'/'+_0x2b10fa)['json'](_0x26c72a);}return null;};}function patchUpdates(_0x492646){return function(_0x23436b){try{jsonpatch['apply'](_0x23436b,_0x492646,!![]);}catch(_0x43cd5a){return BPromise[_0x4c00('0x2f')](_0x43cd5a);}return _0x23436b['save']();};}function saveUpdates(_0x382b4a,_0x4d76b5){return function(_0x5718de){if(_0x5718de){return _0x5718de[_0x4c00('0x30')](_0x382b4a)[_0x4c00('0x31')](function(_0x1c7bcb){return _0x1c7bcb;});}return null;};}function removeEntity(_0x3ed48b,_0x881b7){return function(_0x4a28c3){if(_0x4a28c3){return _0x4a28c3['destroy']()['then'](function(){_0x3ed48b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x578fe3,_0x14411b){return function(_0x60bec9){if(!_0x60bec9){_0x578fe3['sendStatus'](0x194);}return _0x60bec9;};}function handleError(_0x374b25,_0x221813){_0x221813=_0x221813||0x1f4;return function(_0x4a4ef1){logger[_0x4c00('0x22')](_0x4a4ef1[_0x4c00('0x32')]);if(_0x4a4ef1[_0x4c00('0x33')]){delete _0x4a4ef1[_0x4c00('0x33')];}_0x374b25[_0x4c00('0x29')](_0x221813)['send'](_0x4a4ef1);};}exports[_0x4c00('0x34')]=function(_0x55f5fb,_0x7c1314){var _0x1eab43={},_0x362804={},_0x5a9705={'count':0x0,'rows':[]};var _0x59a982=db[_0x4c00('0x35')][_0x4c00('0x36')];_0x362804[_0x4c00('0x37')]=_[_0x4c00('0x38')](_0x59a982);var _0x5c901d={'dateStart':_0x55f5fb['query']['dateStart'],'dateEnd':_0x55f5fb[_0x4c00('0x39')][_0x4c00('0x3a')]};delete _0x55f5fb[_0x4c00('0x39')][_0x4c00('0x3b')];delete _0x55f5fb['query']['dateEnd'];_0x362804[_0x4c00('0x39')]=_[_0x4c00('0x38')](_0x55f5fb[_0x4c00('0x39')]);_0x362804[_0x4c00('0x3c')]=_[_0x4c00('0x3d')](_0x362804[_0x4c00('0x37')],_0x362804['query']);_0x1eab43[_0x4c00('0x3e')]=_[_0x4c00('0x3d')](_0x362804[_0x4c00('0x37')],qs[_0x4c00('0x3f')](_0x55f5fb[_0x4c00('0x39')][_0x4c00('0x3f')]));_0x1eab43[_0x4c00('0x3e')]=_0x1eab43['attributes'][_0x4c00('0x40')]?_0x1eab43['attributes']:_0x362804[_0x4c00('0x37')];if(!_0x55f5fb[_0x4c00('0x39')][_0x4c00('0x41')](_0x4c00('0x42'))){_0x1eab43[_0x4c00('0x2d')]=qs[_0x4c00('0x2d')](_0x55f5fb['query'][_0x4c00('0x2d')]);_0x1eab43[_0x4c00('0x2c')]=qs['offset'](_0x55f5fb[_0x4c00('0x39')][_0x4c00('0x2c')]);}_0x1eab43[_0x4c00('0x43')]=qs['sort'](_0x55f5fb[_0x4c00('0x39')][_0x4c00('0x44')]);_0x1eab43['where']=qs[_0x4c00('0x3c')](_[_0x4c00('0x45')](_0x55f5fb['query'],_0x362804[_0x4c00('0x3c')]));if(_0x5c901d[_0x4c00('0x3b')]){if(_0x5c901d[_0x4c00('0x3a')]){_0x5c901d[_0x4c00('0x3a')]=moment(_0x5c901d['dateEnd'])[_0x4c00('0x46')](0x1,_0x4c00('0x47'));}else{_0x5c901d[_0x4c00('0x3a')]=moment(_0x5c901d[_0x4c00('0x3b')])[_0x4c00('0x46')](0x1,_0x4c00('0x47'));}_[_0x4c00('0x48')](_0x1eab43[_0x4c00('0x49')],{'createdAt':{'$gte':_0x5c901d[_0x4c00('0x3b')],'$lte':_0x5c901d['dateEnd']}});}if(_0x55f5fb['query']['filter']){_0x1eab43[_0x4c00('0x49')]=_[_0x4c00('0x48')](_0x1eab43[_0x4c00('0x49')],{'$or':_[_0x4c00('0x4a')](_0x1eab43[_0x4c00('0x3e')],function(_0x4c339e){var _0x41f4d1={};_0x41f4d1[_0x4c339e]={'$like':'%'+_0x55f5fb[_0x4c00('0x39')][_0x4c00('0x4b')]+'%'};return _0x41f4d1;})});}_0x1eab43=_[_0x4c00('0x48')]({},_0x1eab43,_0x55f5fb['options']);var _0x302cb8={'where':_0x1eab43[_0x4c00('0x49')]};return db[_0x4c00('0x35')][_0x4c00('0x2b')](_0x302cb8)[_0x4c00('0x31')](function(_0x4a93d7){_0x5a9705[_0x4c00('0x2b')]=_0x4a93d7;if(_0x55f5fb[_0x4c00('0x39')][_0x4c00('0x4c')]){_0x1eab43[_0x4c00('0x4d')]=[{'all':!![]}];}return db[_0x4c00('0x35')][_0x4c00('0x4e')](_0x1eab43);})[_0x4c00('0x31')](function(_0x17656a){_0x5a9705[_0x4c00('0x4f')]=_0x17656a;return _0x5a9705;})[_0x4c00('0x31')](respondWithFilteredResult(_0x7c1314,_0x1eab43))[_0x4c00('0x27')](handleError(_0x7c1314,null));};exports['show']=function(_0x36aabb,_0x326455){var _0x3bd268={'raw':!![],'where':{'id':_0x36aabb[_0x4c00('0x50')]['id']}},_0x2385bb={};_0x2385bb[_0x4c00('0x37')]=_[_0x4c00('0x38')](db[_0x4c00('0x35')][_0x4c00('0x36')]);_0x2385bb['query']=_[_0x4c00('0x38')](_0x36aabb['query']);_0x2385bb['filters']=_[_0x4c00('0x3d')](_0x2385bb[_0x4c00('0x37')],_0x2385bb[_0x4c00('0x39')]);_0x3bd268['attributes']=_[_0x4c00('0x3d')](_0x2385bb[_0x4c00('0x37')],qs[_0x4c00('0x3f')](_0x36aabb[_0x4c00('0x39')]['fields']));_0x3bd268[_0x4c00('0x3e')]=_0x3bd268[_0x4c00('0x3e')][_0x4c00('0x40')]?_0x3bd268['attributes']:_0x2385bb[_0x4c00('0x37')];if(_0x36aabb[_0x4c00('0x39')][_0x4c00('0x4c')]){_0x3bd268[_0x4c00('0x4d')]=[{'all':!![]}];}_0x3bd268=_[_0x4c00('0x48')]({},_0x3bd268,_0x36aabb[_0x4c00('0x51')]);return db['ChatGroup'][_0x4c00('0x52')](_0x3bd268)['then'](handleEntityNotFound(_0x326455,null))[_0x4c00('0x31')](respondWithResult(_0x326455,null))[_0x4c00('0x27')](handleError(_0x326455,null));};exports[_0x4c00('0x53')]=function(_0x54e87b,_0x5d825e){return db[_0x4c00('0x35')][_0x4c00('0x53')](_0x54e87b[_0x4c00('0x54')],{})[_0x4c00('0x31')](respondWithResult(_0x5d825e,0xc9))[_0x4c00('0x27')](handleError(_0x5d825e,null));};exports[_0x4c00('0x30')]=function(_0x5be758,_0x5c4ad8){if(_0x5be758[_0x4c00('0x54')]['id']){delete _0x5be758[_0x4c00('0x54')]['id'];}return db['ChatGroup'][_0x4c00('0x52')]({'where':{'id':_0x5be758[_0x4c00('0x50')]['id']}})[_0x4c00('0x31')](handleEntityNotFound(_0x5c4ad8,null))['then'](saveUpdates(_0x5be758['body'],null))[_0x4c00('0x31')](respondWithResult(_0x5c4ad8,null))[_0x4c00('0x27')](handleError(_0x5c4ad8,null));};exports[_0x4c00('0x55')]=function(_0x18a83c,_0x13afe2){return db[_0x4c00('0x35')][_0x4c00('0x52')]({'where':{'id':_0x18a83c[_0x4c00('0x50')]['id']}})[_0x4c00('0x31')](handleEntityNotFound(_0x13afe2,null))['then'](removeEntity(_0x13afe2,null))[_0x4c00('0x27')](handleError(_0x13afe2,null));};exports[_0x4c00('0x56')]=function(_0x408dfd,_0x1f9049){return db[_0x4c00('0x35')]['describe']()[_0x4c00('0x31')](respondWithResult(_0x1f9049,null))['catch'](handleError(_0x1f9049,null));};exports['getUnread']=function(_0x885ed0,_0x97a821,_0xfd2eb4){return db[_0x4c00('0x57')]['count']({'where':{'ChatGroupId':_0x885ed0[_0x4c00('0x50')]['id'],'ToId':_0x885ed0[_0x4c00('0x58')]['id'],'read':![]}})[_0x4c00('0x31')](function(_0x4484ca){return{'id':_[_0x4c00('0x59')](_0x885ed0[_0x4c00('0x50')]['id']),'count':_0x4484ca};})[_0x4c00('0x31')](respondWithResult(_0x97a821,null))[_0x4c00('0x27')](handleError(_0x97a821,null));};exports['addMembers']=function(_0x538d3d,_0xa2c899,_0x12f75f){return db[_0x4c00('0x35')][_0x4c00('0x52')]({'where':{'id':_0x538d3d[_0x4c00('0x50')]['id']}})[_0x4c00('0x31')](handleEntityNotFound(_0xa2c899,null))[_0x4c00('0x31')](function(_0xa6bd08){if(_0xa6bd08){return _0xa6bd08['addMembers'](_0x538d3d[_0x4c00('0x54')][_0x4c00('0x5a')],_[_0x4c00('0x5b')](_0x538d3d['body'],[_0x4c00('0x5a'),'id'])||{});}})[_0x4c00('0x31')](respondWithResult(_0xa2c899,null))[_0x4c00('0x27')](handleError(_0xa2c899,null));};exports[_0x4c00('0x5c')]=function(_0x24e30b,_0x33baf1,_0x128ff8){var _0x2334bf={};var _0x1504fa={};var _0x3827f1;var _0x5224cc;return db[_0x4c00('0x35')]['findOne']({'where':{'id':_0x24e30b['params']['id']}})['then'](handleEntityNotFound(_0x33baf1,null))['then'](function(_0x126f23){if(_0x126f23){_0x3827f1=_0x126f23;_0x1504fa['model']=_[_0x4c00('0x38')](db[_0x4c00('0x5d')][_0x4c00('0x36')]);_0x1504fa[_0x4c00('0x39')]=_['keys'](_0x24e30b[_0x4c00('0x39')]);_0x1504fa[_0x4c00('0x3c')]=_[_0x4c00('0x3d')](_0x1504fa[_0x4c00('0x37')],_0x1504fa['query']);_0x2334bf[_0x4c00('0x3e')]=_['intersection'](_0x1504fa[_0x4c00('0x37')],qs[_0x4c00('0x3f')](_0x24e30b[_0x4c00('0x39')]['fields']));_0x2334bf['attributes']=_0x2334bf[_0x4c00('0x3e')][_0x4c00('0x40')]?_0x2334bf['attributes']:_0x1504fa[_0x4c00('0x37')];_0x2334bf[_0x4c00('0x43')]=qs[_0x4c00('0x44')](_0x24e30b[_0x4c00('0x39')][_0x4c00('0x44')]);_0x2334bf[_0x4c00('0x49')]=qs['filters'](_['pick'](_0x24e30b[_0x4c00('0x39')],_0x1504fa[_0x4c00('0x3c')]));if(_0x24e30b[_0x4c00('0x39')][_0x4c00('0x4b')]){_0x2334bf[_0x4c00('0x49')]=_[_0x4c00('0x48')](_0x2334bf[_0x4c00('0x49')],{'$or':_[_0x4c00('0x4a')](_0x2334bf[_0x4c00('0x3e')],function(_0x1d2dc0){var _0xa63d4b={};_0xa63d4b[_0x1d2dc0]={'$like':'%'+_0x24e30b[_0x4c00('0x39')][_0x4c00('0x4b')]+'%'};return _0xa63d4b;})});}_0x2334bf=_[_0x4c00('0x48')]({},_0x2334bf,_0x24e30b[_0x4c00('0x51')]);return _0x3827f1[_0x4c00('0x5c')](_0x2334bf);}})['then'](function(_0x4c06c9){if(_0x4c06c9){_0x5224cc=_0x4c06c9[_0x4c00('0x40')];if(!_0x24e30b[_0x4c00('0x39')][_0x4c00('0x41')]('nolimit')){_0x2334bf[_0x4c00('0x2d')]=qs['limit'](_0x24e30b['query'][_0x4c00('0x2d')]);_0x2334bf[_0x4c00('0x2c')]=qs[_0x4c00('0x2c')](_0x24e30b[_0x4c00('0x39')][_0x4c00('0x2c')]);}return _0x3827f1[_0x4c00('0x5c')](_0x2334bf);}})[_0x4c00('0x31')](function(_0x42d2a3){if(_0x42d2a3){return _0x42d2a3?{'count':_0x5224cc,'rows':_0x42d2a3}:null;}})['then'](respondWithResult(_0x33baf1,null))[_0x4c00('0x27')](handleError(_0x33baf1,null));};exports['removeMembers']=function(_0x3005d3,_0x58e8d6,_0x34f893){var _0x11d052;return db['ChatGroup'][_0x4c00('0x52')]({'where':{'id':_0x3005d3['params']['id']}})[_0x4c00('0x31')](handleEntityNotFound(_0x58e8d6,null))['then'](function(_0x35cc21){if(_0x35cc21){return _0x35cc21[_0x4c00('0x5e')](_0x3005d3[_0x4c00('0x39')][_0x4c00('0x5a')]);}})[_0x4c00('0x31')](respondWithStatusCode(_0x58e8d6,null))['catch'](handleError(_0x58e8d6,null));};exports[_0x4c00('0x5f')]=function(_0x1a1f9a,_0xf8fe46,_0x43336d){if(_0x1a1f9a[_0x4c00('0x54')]['id']){delete _0x1a1f9a[_0x4c00('0x54')]['id'];}return db['ChatGroup'][_0x4c00('0x52')]({'where':{'id':_0x1a1f9a[_0x4c00('0x50')]['id']}})[_0x4c00('0x31')](handleEntityNotFound(_0xf8fe46,null))['then'](function(_0x4c4dcc){if(_0x4c4dcc){_0x1a1f9a[_0x4c00('0x54')][_0x4c00('0x60')]=_0x4c4dcc['id'];return db[_0x4c00('0x57')]['create'](_0x1a1f9a[_0x4c00('0x54')]);}})[_0x4c00('0x31')](respondWithResult(_0xf8fe46,null))[_0x4c00('0x27')](handleError(_0xf8fe46,null));};exports[_0x4c00('0x61')]=function(_0x377fec,_0x1290be,_0x43fd52){var _0x2551a8={};var _0x113633={};var _0x221378;var _0x43986c;return db[_0x4c00('0x35')]['findOne']({'where':{'id':_0x377fec[_0x4c00('0x50')]['id']}})['then'](handleEntityNotFound(_0x1290be,null))[_0x4c00('0x31')](function(_0x2138da){if(_0x2138da){_0x221378=_0x2138da;_0x113633[_0x4c00('0x37')]=_[_0x4c00('0x38')](db['ChatInternalMessage'][_0x4c00('0x36')]);_0x113633['query']=_[_0x4c00('0x38')](_0x377fec['query']);_0x113633[_0x4c00('0x3c')]=_[_0x4c00('0x3d')](_0x113633[_0x4c00('0x37')],_0x113633[_0x4c00('0x39')]);_0x2551a8[_0x4c00('0x3e')]=_[_0x4c00('0x3d')](_0x113633[_0x4c00('0x37')],qs['fields'](_0x377fec[_0x4c00('0x39')][_0x4c00('0x3f')]));_0x2551a8['attributes']=_0x2551a8[_0x4c00('0x3e')]['length']?_0x2551a8['attributes']:_0x113633[_0x4c00('0x37')];_0x2551a8[_0x4c00('0x43')]=qs['sort'](_0x377fec[_0x4c00('0x39')][_0x4c00('0x44')]);_0x2551a8[_0x4c00('0x49')]=qs[_0x4c00('0x3c')](_[_0x4c00('0x45')](_0x377fec[_0x4c00('0x39')],_0x113633[_0x4c00('0x3c')]));if(_0x377fec[_0x4c00('0x39')][_0x4c00('0x4b')]){_0x2551a8[_0x4c00('0x49')]=_[_0x4c00('0x48')](_0x2551a8[_0x4c00('0x49')],{'$or':_[_0x4c00('0x4a')](_0x2551a8['attributes'],function(_0x34b60e){var _0x7c3962={};_0x7c3962[_0x34b60e]={'$like':'%'+_0x377fec[_0x4c00('0x39')][_0x4c00('0x4b')]+'%'};return _0x7c3962;})});}if(_0x377fec[_0x4c00('0x39')][_0x4c00('0x62')]){var _0x31f3cc=_0x377fec[_0x4c00('0x39')][_0x4c00('0x62')][_0x4c00('0x63')](',');var _0x41b87c={};_0x41b87c[_0x31f3cc[0x0]]={'$gte':moment(_0x31f3cc[0x1])[_0x4c00('0x64')](_0x4c00('0x65'))};_0x2551a8['where']=_[_0x4c00('0x48')](_0x2551a8['where'],_0x41b87c);}_0x2551a8=_[_0x4c00('0x48')]({},_0x2551a8,_0x377fec['options']);return _0x221378[_0x4c00('0x61')](_0x2551a8);}})[_0x4c00('0x31')](function(_0x3d39ad){if(_0x3d39ad){_0x43986c=_0x3d39ad[_0x4c00('0x40')];if(!_0x377fec[_0x4c00('0x39')][_0x4c00('0x41')](_0x4c00('0x42'))){_0x2551a8[_0x4c00('0x2d')]=qs[_0x4c00('0x2d')](_0x377fec[_0x4c00('0x39')][_0x4c00('0x2d')]);_0x2551a8['offset']=qs[_0x4c00('0x2c')](_0x377fec[_0x4c00('0x39')]['offset']);}return _0x221378['getMessages'](_0x2551a8);}})[_0x4c00('0x31')](function(_0x22da56){if(_0x22da56){return _0x22da56?{'count':_0x43986c,'rows':_0x22da56}:null;}})[_0x4c00('0x31')](respondWithResult(_0x1290be,null))[_0x4c00('0x27')](handleError(_0x1290be,null));};
\ No newline at end of file
+var _0xd72d=['squel','crypto','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./chatGroup.socket','jayson/promise','client','http','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','stack','name','ChatGroup','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day','merge','map','filter','includeAll','include','findAll','show','params','fields','options','find','body','describe','getUnread','user','addMembers','ids','omit','getMembers','findOne','removeMembers','addMessage','ChatGroupId','create','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','rimraf','zip-dir','mustache','util','path','sox','to-csv'];(function(_0x54de83,_0x4c8606){var _0x42cc12=function(_0x291cae){while(--_0x291cae){_0x54de83['push'](_0x54de83['shift']());}};_0x42cc12(++_0x4c8606);}(_0xd72d,0xbe));var _0xdd72=function(_0x96cc01,_0x5a112c){_0x96cc01=_0x96cc01-0x0;var _0x11b2b9=_0xd72d[_0x96cc01];return _0x11b2b9;};'use strict';var pdf=require(_0xdd72('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdd72('0x1'));var zipdir=require(_0xdd72('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdd72('0x3'));var util=require(_0xdd72('0x4'));var path=require(_0xdd72('0x5'));var sox=require(_0xdd72('0x6'));var csv=require(_0xdd72('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xdd72('0x8'));var crypto=require(_0xdd72('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xdd72('0xa'));var toCsv=require(_0xdd72('0x7'));var querystring=require(_0xdd72('0xb'));var Papa=require(_0xdd72('0xc'));var qs=require('../../components/parsers/qs');var logger=require(_0xdd72('0xd'))(_0xdd72('0xe'));var utils=require(_0xdd72('0xf'));var config=require(_0xdd72('0x10'));var db=require(_0xdd72('0x11'))['db'];var socket=require(_0xdd72('0x12'))({'host':_0xdd72('0x13'),'port':0x18eb});require(_0xdd72('0x14'))['register'](socket);var jayson=require(_0xdd72('0x15'));var client=jayson[_0xdd72('0x16')][_0xdd72('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x12d273,_0x35e47b,_0x258dac,_0x54048a){return new BPromise(function(_0x37476f,_0x18e6af){var _0x16e49d=_0x54048a||client;return _0x16e49d[_0xdd72('0x18')](_0x12d273,_0x258dac)[_0xdd72('0x19')](function(_0x354726){logger[_0xdd72('0x1a')](_0xdd72('0x1b'),_0x35e47b,_0xdd72('0x1c'));logger[_0xdd72('0x1d')](_0xdd72('0x1e'),_0x35e47b,'request\x20sent',JSON[_0xdd72('0x1f')](_0x354726));if(_0x354726[_0xdd72('0x20')]){if(_0x354726[_0xdd72('0x20')][_0xdd72('0x21')]===0x1f4){logger[_0xdd72('0x20')](_0xdd72('0x1b'),_0x35e47b,_0x354726[_0xdd72('0x20')][_0xdd72('0x22')]);return _0x18e6af(_0x354726[_0xdd72('0x20')][_0xdd72('0x22')]);}logger['error'](_0xdd72('0x1b'),_0x35e47b,_0x354726[_0xdd72('0x20')][_0xdd72('0x22')]);return _0x37476f(_0x354726[_0xdd72('0x20')][_0xdd72('0x22')]);}else{logger['info'](_0xdd72('0x1b'),_0x35e47b,_0xdd72('0x1c'));_0x37476f(_0x354726[_0xdd72('0x23')][_0xdd72('0x22')]);}})[_0xdd72('0x24')](function(_0x2d2a9d){logger[_0xdd72('0x20')](_0xdd72('0x1b'),_0x35e47b,_0x2d2a9d);_0x18e6af(_0x2d2a9d);});});}function respondWithStatusCode(_0x5048d7,_0x6b195e){_0x6b195e=_0x6b195e||0xcc;return function(_0x859bf3){if(_0x859bf3){return _0x5048d7[_0xdd72('0x25')](_0x6b195e);}return _0x5048d7[_0xdd72('0x26')](_0x6b195e)[_0xdd72('0x27')]();};}function respondWithResult(_0x25ea23,_0x431c06){_0x431c06=_0x431c06||0xc8;return function(_0x346ae3){if(_0x346ae3){return _0x25ea23[_0xdd72('0x26')](_0x431c06)[_0xdd72('0x28')](_0x346ae3);}};}function respondWithFilteredResult(_0x3813cf,_0x295e65){return function(_0x5856e6){if(_0x5856e6){var _0xc0d6b0=_0x5856e6[_0xdd72('0x29')],_0x2b3a43=_0x295e65[_0xdd72('0x2a')],_0x558b87=_0x295e65[_0xdd72('0x2a')]+_0x295e65[_0xdd72('0x2b')],_0x620082;if(_0x558b87>=_0xc0d6b0){_0x558b87=_0xc0d6b0;_0x620082=0xc8;}else{_0x620082=0xce;}_0x3813cf['status'](_0x620082);return _0x3813cf[_0xdd72('0x2c')]('Content-Range',_0x2b3a43+'-'+_0x558b87+'/'+_0xc0d6b0)['json'](_0x5856e6);}return null;};}function patchUpdates(_0x4e92c4){return function(_0x22bd8f){try{jsonpatch[_0xdd72('0x2d')](_0x22bd8f,_0x4e92c4,!![]);}catch(_0x129ec4){return BPromise[_0xdd72('0x2e')](_0x129ec4);}return _0x22bd8f[_0xdd72('0x2f')]();};}function saveUpdates(_0xe2288b,_0x37094c){return function(_0x52f522){if(_0x52f522){return _0x52f522[_0xdd72('0x30')](_0xe2288b)[_0xdd72('0x19')](function(_0x57b4a0){return _0x57b4a0;});}return null;};}function removeEntity(_0x5c6fd3,_0x133e2a){return function(_0xb807c6){if(_0xb807c6){return _0xb807c6[_0xdd72('0x31')]()[_0xdd72('0x19')](function(){_0x5c6fd3[_0xdd72('0x26')](0xcc)[_0xdd72('0x27')]();});}};}function handleEntityNotFound(_0x34422f,_0x7615aa){return function(_0x3a3eb1){if(!_0x3a3eb1){_0x34422f[_0xdd72('0x25')](0x194);}return _0x3a3eb1;};}function handleError(_0x5bc67c,_0x4df9df){_0x4df9df=_0x4df9df||0x1f4;return function(_0x94a44c){logger[_0xdd72('0x20')](_0x94a44c[_0xdd72('0x32')]);if(_0x94a44c[_0xdd72('0x33')]){delete _0x94a44c[_0xdd72('0x33')];}_0x5bc67c['status'](_0x4df9df)['send'](_0x94a44c);};}exports['index']=function(_0x456fb0,_0xe3c18d){var _0x544125={},_0x13b571={},_0x16184b={'count':0x0,'rows':[]};var _0x2228ae=db[_0xdd72('0x34')][_0xdd72('0x35')];_0x13b571[_0xdd72('0x36')]=_[_0xdd72('0x37')](_0x2228ae);var _0x2c9f4a={'dateStart':_0x456fb0[_0xdd72('0x38')][_0xdd72('0x39')],'dateEnd':_0x456fb0[_0xdd72('0x38')]['dateEnd']};delete _0x456fb0[_0xdd72('0x38')][_0xdd72('0x39')];delete _0x456fb0[_0xdd72('0x38')][_0xdd72('0x3a')];_0x13b571[_0xdd72('0x38')]=_[_0xdd72('0x37')](_0x456fb0[_0xdd72('0x38')]);_0x13b571[_0xdd72('0x3b')]=_[_0xdd72('0x3c')](_0x13b571[_0xdd72('0x36')],_0x13b571['query']);_0x544125[_0xdd72('0x3d')]=_[_0xdd72('0x3c')](_0x13b571['model'],qs['fields'](_0x456fb0[_0xdd72('0x38')]['fields']));_0x544125[_0xdd72('0x3d')]=_0x544125[_0xdd72('0x3d')][_0xdd72('0x3e')]?_0x544125[_0xdd72('0x3d')]:_0x13b571[_0xdd72('0x36')];if(!_0x456fb0[_0xdd72('0x38')][_0xdd72('0x3f')](_0xdd72('0x40'))){_0x544125['limit']=qs[_0xdd72('0x2b')](_0x456fb0['query'][_0xdd72('0x2b')]);_0x544125[_0xdd72('0x2a')]=qs[_0xdd72('0x2a')](_0x456fb0['query'][_0xdd72('0x2a')]);}_0x544125[_0xdd72('0x41')]=qs[_0xdd72('0x42')](_0x456fb0[_0xdd72('0x38')][_0xdd72('0x42')]);_0x544125[_0xdd72('0x43')]=qs[_0xdd72('0x3b')](_[_0xdd72('0x44')](_0x456fb0['query'],_0x13b571[_0xdd72('0x3b')]));if(_0x2c9f4a[_0xdd72('0x39')]){if(_0x2c9f4a[_0xdd72('0x3a')]){_0x2c9f4a['dateEnd']=moment(_0x2c9f4a[_0xdd72('0x3a')])[_0xdd72('0x45')](0x1,_0xdd72('0x46'));}else{_0x2c9f4a['dateEnd']=moment(_0x2c9f4a[_0xdd72('0x39')])['add'](0x1,'day');}_[_0xdd72('0x47')](_0x544125[_0xdd72('0x43')],{'createdAt':{'$gte':_0x2c9f4a[_0xdd72('0x39')],'$lte':_0x2c9f4a[_0xdd72('0x3a')]}});}if(_0x456fb0[_0xdd72('0x38')]['filter']){_0x544125['where']=_[_0xdd72('0x47')](_0x544125['where'],{'$or':_[_0xdd72('0x48')](_0x544125[_0xdd72('0x3d')],function(_0x3c417f){var _0x4ffb4f={};_0x4ffb4f[_0x3c417f]={'$like':'%'+_0x456fb0[_0xdd72('0x38')][_0xdd72('0x49')]+'%'};return _0x4ffb4f;})});}_0x544125=_['merge']({},_0x544125,_0x456fb0['options']);var _0x47109b={'where':_0x544125[_0xdd72('0x43')]};return db[_0xdd72('0x34')]['count'](_0x47109b)[_0xdd72('0x19')](function(_0x2684b9){_0x16184b[_0xdd72('0x29')]=_0x2684b9;if(_0x456fb0['query'][_0xdd72('0x4a')]){_0x544125[_0xdd72('0x4b')]=[{'all':!![]}];}return db[_0xdd72('0x34')][_0xdd72('0x4c')](_0x544125);})[_0xdd72('0x19')](function(_0x11b3fa){_0x16184b['rows']=_0x11b3fa;return _0x16184b;})[_0xdd72('0x19')](respondWithFilteredResult(_0xe3c18d,_0x544125))[_0xdd72('0x24')](handleError(_0xe3c18d,null));};exports[_0xdd72('0x4d')]=function(_0x262afc,_0x3d7480){var _0x2782d0={'raw':!![],'where':{'id':_0x262afc[_0xdd72('0x4e')]['id']}},_0xe87e30={};_0xe87e30['model']=_[_0xdd72('0x37')](db[_0xdd72('0x34')][_0xdd72('0x35')]);_0xe87e30[_0xdd72('0x38')]=_[_0xdd72('0x37')](_0x262afc[_0xdd72('0x38')]);_0xe87e30[_0xdd72('0x3b')]=_[_0xdd72('0x3c')](_0xe87e30[_0xdd72('0x36')],_0xe87e30['query']);_0x2782d0[_0xdd72('0x3d')]=_['intersection'](_0xe87e30[_0xdd72('0x36')],qs[_0xdd72('0x4f')](_0x262afc[_0xdd72('0x38')][_0xdd72('0x4f')]));_0x2782d0[_0xdd72('0x3d')]=_0x2782d0[_0xdd72('0x3d')][_0xdd72('0x3e')]?_0x2782d0[_0xdd72('0x3d')]:_0xe87e30['model'];if(_0x262afc['query'][_0xdd72('0x4a')]){_0x2782d0[_0xdd72('0x4b')]=[{'all':!![]}];}_0x2782d0=_['merge']({},_0x2782d0,_0x262afc[_0xdd72('0x50')]);return db[_0xdd72('0x34')][_0xdd72('0x51')](_0x2782d0)[_0xdd72('0x19')](handleEntityNotFound(_0x3d7480,null))[_0xdd72('0x19')](respondWithResult(_0x3d7480,null))[_0xdd72('0x24')](handleError(_0x3d7480,null));};exports['create']=function(_0x2e5d80,_0x2285df){return db[_0xdd72('0x34')]['create'](_0x2e5d80[_0xdd72('0x52')],{})['then'](respondWithResult(_0x2285df,0xc9))[_0xdd72('0x24')](handleError(_0x2285df,null));};exports[_0xdd72('0x30')]=function(_0xa05c94,_0x3d70fe){if(_0xa05c94[_0xdd72('0x52')]['id']){delete _0xa05c94[_0xdd72('0x52')]['id'];}return db['ChatGroup'][_0xdd72('0x51')]({'where':{'id':_0xa05c94[_0xdd72('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3d70fe,null))[_0xdd72('0x19')](saveUpdates(_0xa05c94[_0xdd72('0x52')],null))['then'](respondWithResult(_0x3d70fe,null))['catch'](handleError(_0x3d70fe,null));};exports['destroy']=function(_0x4a49d7,_0x3dec32){return db[_0xdd72('0x34')][_0xdd72('0x51')]({'where':{'id':_0x4a49d7[_0xdd72('0x4e')]['id']}})[_0xdd72('0x19')](handleEntityNotFound(_0x3dec32,null))[_0xdd72('0x19')](removeEntity(_0x3dec32,null))[_0xdd72('0x24')](handleError(_0x3dec32,null));};exports[_0xdd72('0x53')]=function(_0x15505a,_0x439cd3){return db['ChatGroup'][_0xdd72('0x53')]()['then'](respondWithResult(_0x439cd3,null))['catch'](handleError(_0x439cd3,null));};exports[_0xdd72('0x54')]=function(_0x1159d5,_0x27a58e,_0x50b7ee){return db['ChatInternalMessage'][_0xdd72('0x29')]({'where':{'ChatGroupId':_0x1159d5[_0xdd72('0x4e')]['id'],'ToId':_0x1159d5[_0xdd72('0x55')]['id'],'read':![]}})[_0xdd72('0x19')](function(_0x1fa0d7){return{'id':_['toInteger'](_0x1159d5['params']['id']),'count':_0x1fa0d7};})[_0xdd72('0x19')](respondWithResult(_0x27a58e,null))[_0xdd72('0x24')](handleError(_0x27a58e,null));};exports[_0xdd72('0x56')]=function(_0x33da07,_0x35a705,_0x17ac8e){return db[_0xdd72('0x34')]['find']({'where':{'id':_0x33da07['params']['id']}})[_0xdd72('0x19')](handleEntityNotFound(_0x35a705,null))[_0xdd72('0x19')](function(_0x40faea){if(_0x40faea){return _0x40faea[_0xdd72('0x56')](_0x33da07[_0xdd72('0x52')][_0xdd72('0x57')],_[_0xdd72('0x58')](_0x33da07[_0xdd72('0x52')],[_0xdd72('0x57'),'id'])||{});}})[_0xdd72('0x19')](respondWithResult(_0x35a705,null))['catch'](handleError(_0x35a705,null));};exports[_0xdd72('0x59')]=function(_0x1357e9,_0x4a7e78,_0x124fe4){var _0x2f48df={};var _0x44be22={};var _0x4313ec;var _0x30d056;return db[_0xdd72('0x34')][_0xdd72('0x5a')]({'where':{'id':_0x1357e9[_0xdd72('0x4e')]['id']}})[_0xdd72('0x19')](handleEntityNotFound(_0x4a7e78,null))[_0xdd72('0x19')](function(_0x53c816){if(_0x53c816){_0x4313ec=_0x53c816;_0x44be22[_0xdd72('0x36')]=_[_0xdd72('0x37')](db['User'][_0xdd72('0x35')]);_0x44be22[_0xdd72('0x38')]=_[_0xdd72('0x37')](_0x1357e9['query']);_0x44be22[_0xdd72('0x3b')]=_[_0xdd72('0x3c')](_0x44be22[_0xdd72('0x36')],_0x44be22[_0xdd72('0x38')]);_0x2f48df[_0xdd72('0x3d')]=_[_0xdd72('0x3c')](_0x44be22[_0xdd72('0x36')],qs['fields'](_0x1357e9[_0xdd72('0x38')][_0xdd72('0x4f')]));_0x2f48df[_0xdd72('0x3d')]=_0x2f48df[_0xdd72('0x3d')][_0xdd72('0x3e')]?_0x2f48df['attributes']:_0x44be22['model'];_0x2f48df[_0xdd72('0x41')]=qs['sort'](_0x1357e9[_0xdd72('0x38')][_0xdd72('0x42')]);_0x2f48df[_0xdd72('0x43')]=qs[_0xdd72('0x3b')](_[_0xdd72('0x44')](_0x1357e9[_0xdd72('0x38')],_0x44be22[_0xdd72('0x3b')]));if(_0x1357e9[_0xdd72('0x38')]['filter']){_0x2f48df['where']=_['merge'](_0x2f48df[_0xdd72('0x43')],{'$or':_[_0xdd72('0x48')](_0x2f48df[_0xdd72('0x3d')],function(_0x4f17c6){var _0x1c4b64={};_0x1c4b64[_0x4f17c6]={'$like':'%'+_0x1357e9[_0xdd72('0x38')]['filter']+'%'};return _0x1c4b64;})});}_0x2f48df=_[_0xdd72('0x47')]({},_0x2f48df,_0x1357e9['options']);return _0x4313ec['getMembers'](_0x2f48df);}})[_0xdd72('0x19')](function(_0x549c04){if(_0x549c04){_0x30d056=_0x549c04[_0xdd72('0x3e')];if(!_0x1357e9[_0xdd72('0x38')][_0xdd72('0x3f')](_0xdd72('0x40'))){_0x2f48df['limit']=qs[_0xdd72('0x2b')](_0x1357e9[_0xdd72('0x38')]['limit']);_0x2f48df[_0xdd72('0x2a')]=qs['offset'](_0x1357e9[_0xdd72('0x38')]['offset']);}return _0x4313ec[_0xdd72('0x59')](_0x2f48df);}})[_0xdd72('0x19')](function(_0x5cf1d2){if(_0x5cf1d2){return _0x5cf1d2?{'count':_0x30d056,'rows':_0x5cf1d2}:null;}})[_0xdd72('0x19')](respondWithResult(_0x4a7e78,null))[_0xdd72('0x24')](handleError(_0x4a7e78,null));};exports['removeMembers']=function(_0x403a10,_0x575697,_0x407053){var _0x33a54b;return db[_0xdd72('0x34')][_0xdd72('0x51')]({'where':{'id':_0x403a10[_0xdd72('0x4e')]['id']}})[_0xdd72('0x19')](handleEntityNotFound(_0x575697,null))['then'](function(_0xb2ea80){if(_0xb2ea80){return _0xb2ea80[_0xdd72('0x5b')](_0x403a10[_0xdd72('0x38')][_0xdd72('0x57')]);}})[_0xdd72('0x19')](respondWithStatusCode(_0x575697,null))[_0xdd72('0x24')](handleError(_0x575697,null));};exports[_0xdd72('0x5c')]=function(_0x22eaa4,_0x455465,_0x5848e4){if(_0x22eaa4[_0xdd72('0x52')]['id']){delete _0x22eaa4[_0xdd72('0x52')]['id'];}return db[_0xdd72('0x34')][_0xdd72('0x51')]({'where':{'id':_0x22eaa4[_0xdd72('0x4e')]['id']}})['then'](handleEntityNotFound(_0x455465,null))[_0xdd72('0x19')](function(_0x3e23e4){if(_0x3e23e4){_0x22eaa4['body'][_0xdd72('0x5d')]=_0x3e23e4['id'];return db['ChatInternalMessage'][_0xdd72('0x5e')](_0x22eaa4[_0xdd72('0x52')]);}})[_0xdd72('0x19')](respondWithResult(_0x455465,null))[_0xdd72('0x24')](handleError(_0x455465,null));};exports[_0xdd72('0x5f')]=function(_0x5ea235,_0x2dca51,_0x52bd58){var _0x595964={};var _0x1b9f5a={};var _0x2eb23a;var _0x4a994d;return db['ChatGroup'][_0xdd72('0x5a')]({'where':{'id':_0x5ea235[_0xdd72('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2dca51,null))[_0xdd72('0x19')](function(_0x1bd6ea){if(_0x1bd6ea){_0x2eb23a=_0x1bd6ea;_0x1b9f5a[_0xdd72('0x36')]=_[_0xdd72('0x37')](db['ChatInternalMessage'][_0xdd72('0x35')]);_0x1b9f5a[_0xdd72('0x38')]=_[_0xdd72('0x37')](_0x5ea235[_0xdd72('0x38')]);_0x1b9f5a[_0xdd72('0x3b')]=_[_0xdd72('0x3c')](_0x1b9f5a[_0xdd72('0x36')],_0x1b9f5a[_0xdd72('0x38')]);_0x595964['attributes']=_['intersection'](_0x1b9f5a[_0xdd72('0x36')],qs[_0xdd72('0x4f')](_0x5ea235[_0xdd72('0x38')][_0xdd72('0x4f')]));_0x595964[_0xdd72('0x3d')]=_0x595964[_0xdd72('0x3d')]['length']?_0x595964[_0xdd72('0x3d')]:_0x1b9f5a[_0xdd72('0x36')];_0x595964['order']=qs[_0xdd72('0x42')](_0x5ea235[_0xdd72('0x38')]['sort']);_0x595964[_0xdd72('0x43')]=qs[_0xdd72('0x3b')](_[_0xdd72('0x44')](_0x5ea235[_0xdd72('0x38')],_0x1b9f5a['filters']));if(_0x5ea235[_0xdd72('0x38')]['filter']){_0x595964['where']=_['merge'](_0x595964['where'],{'$or':_[_0xdd72('0x48')](_0x595964[_0xdd72('0x3d')],function(_0x21606c){var _0x1c115e={};_0x1c115e[_0x21606c]={'$like':'%'+_0x5ea235[_0xdd72('0x38')]['filter']+'%'};return _0x1c115e;})});}if(_0x5ea235[_0xdd72('0x38')][_0xdd72('0x60')]){var _0x25b8a8=_0x5ea235[_0xdd72('0x38')][_0xdd72('0x60')]['split'](',');var _0x33c14d={};_0x33c14d[_0x25b8a8[0x0]]={'$gte':moment(_0x25b8a8[0x1])[_0xdd72('0x61')](_0xdd72('0x62'))};_0x595964[_0xdd72('0x43')]=_[_0xdd72('0x47')](_0x595964['where'],_0x33c14d);}_0x595964=_['merge']({},_0x595964,_0x5ea235[_0xdd72('0x50')]);return _0x2eb23a[_0xdd72('0x5f')](_0x595964);}})[_0xdd72('0x19')](function(_0x4bf7ff){if(_0x4bf7ff){_0x4a994d=_0x4bf7ff[_0xdd72('0x3e')];if(!_0x5ea235['query'][_0xdd72('0x3f')](_0xdd72('0x40'))){_0x595964[_0xdd72('0x2b')]=qs['limit'](_0x5ea235[_0xdd72('0x38')][_0xdd72('0x2b')]);_0x595964[_0xdd72('0x2a')]=qs[_0xdd72('0x2a')](_0x5ea235[_0xdd72('0x38')][_0xdd72('0x2a')]);}return _0x2eb23a[_0xdd72('0x5f')](_0x595964);}})[_0xdd72('0x19')](function(_0x2ba9a8){if(_0x2ba9a8){return _0x2ba9a8?{'count':_0x4a994d,'rows':_0x2ba9a8}:null;}})[_0xdd72('0x19')](respondWithResult(_0x2dca51,null))[_0xdd72('0x24')](handleError(_0x2dca51,null));};
\ No newline at end of file
index 5ddb755..b0a2d43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x718a=['events','ChatGroup','emit','hasOwnProperty','hook'];(function(_0x196126,_0x35ce6c){var _0xe144e9=function(_0x5d03a7){while(--_0x5d03a7){_0x196126['push'](_0x196126['shift']());}};_0xe144e9(++_0x35ce6c);}(_0x718a,0x186));var _0xa718=function(_0x42eff3,_0x500490){_0x42eff3=_0x42eff3-0x0;var _0x2db56e=_0x718a[_0x42eff3];return _0x2db56e;};'use strict';var EventEmitter=require(_0xa718('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xa718('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x451360){return function(_0x7405a5,_0x14bb31,_0x35494b){ChatGroupEvents[_0xa718('0x2')](_0x451360+':'+_0x7405a5['id'],_0x7405a5);ChatGroupEvents[_0xa718('0x2')](_0x451360,_0x7405a5);_0x35494b(null);};}for(var e in events){if(events[_0xa718('0x3')](e)){var event=events[e];ChatGroup[_0xa718('0x4')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x3839=['hook','events','../../mysqldb','ChatGroup','save','update','remove','emit'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x3839,0x149));var _0x9383=function(_0x27256b,_0x3d00cf){_0x27256b=_0x27256b-0x0;var _0x577382=_0x3839[_0x27256b];return _0x577382;};'use strict';var EventEmitter=require(_0x9383('0x0'));var ChatGroup=require(_0x9383('0x1'))['db'][_0x9383('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9383('0x3'),'afterUpdate':_0x9383('0x4'),'afterDestroy':_0x9383('0x5')};function emitEvent(_0x39fd5c){return function(_0x440795,_0x410b50,_0x1e1fa4){ChatGroupEvents[_0x9383('0x6')](_0x39fd5c+':'+_0x440795['id'],_0x440795);ChatGroupEvents['emit'](_0x39fd5c,_0x440795);_0x1e1fa4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x9383('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
index 86d522d..4b8d3cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87dc=['exports','define','ChatGroup','lodash','util','../../config/logger','moment','bluebird','./chatGroup.attributes'];(function(_0x2b3171,_0x25be8f){var _0x179573=function(_0x28dbf6){while(--_0x28dbf6){_0x2b3171['push'](_0x2b3171['shift']());}};_0x179573(++_0x25be8f);}(_0x87dc,0x123));var _0xc87d=function(_0x1fc309,_0x7321ba){_0x1fc309=_0x1fc309-0x0;var _0x184f7d=_0x87dc[_0x1fc309];return _0x184f7d;};'use strict';var _=require(_0xc87d('0x0'));var util=require(_0xc87d('0x1'));var logger=require(_0xc87d('0x2'))('api');var moment=require(_0xc87d('0x3'));var BPromise=require(_0xc87d('0x4'));var rp=require('request-promise');var attributes=require(_0xc87d('0x5'));module[_0xc87d('0x6')]=function(_0x3d2b4b,_0x4aa1fb){return _0x3d2b4b[_0xc87d('0x7')](_0xc87d('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdf79=['api','moment','bluebird','request-promise','define','ChatGroup','chat_groups','../../config/logger'];(function(_0x52cf1c,_0x3d8f21){var _0x5f35f5=function(_0x4f4cba){while(--_0x4f4cba){_0x52cf1c['push'](_0x52cf1c['shift']());}};_0x5f35f5(++_0x3d8f21);}(_0xdf79,0xa7));var _0x9df7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdf79[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9df7('0x0'))(_0x9df7('0x1'));var moment=require(_0x9df7('0x2'));var BPromise=require(_0x9df7('0x3'));var rp=require(_0x9df7('0x4'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x5c0301,_0x531eed){return _0x5c0301[_0x9df7('0x5')](_0x9df7('0x6'),attributes,{'tableName':_0x9df7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f244241..ab43c25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaeb0=['lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','socket.io-emitter','localhost','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x2ba0c8,_0x396b75){var _0x12aed4=function(_0x4d4d93){while(--_0x4d4d93){_0x2ba0c8['push'](_0x2ba0c8['shift']());}};_0x12aed4(++_0x396b75);}(_0xaeb0,0xe1));var _0x0aeb=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xaeb0[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x0aeb('0x0'));var util=require('util');var moment=require(_0x0aeb('0x1'));var BPromise=require('bluebird');var rs=require(_0x0aeb('0x2'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x0aeb('0x3'));var logger=require(_0x0aeb('0x4'))(_0x0aeb('0x5'));var config=require(_0x0aeb('0x6'));var jayson=require(_0x0aeb('0x7'));var client=jayson[_0x0aeb('0x8')]['http']({'port':0x232a});var socket=require(_0x0aeb('0x9'))({'host':_0x0aeb('0xa'),'port':0x18eb});require(_0x0aeb('0xb'))[_0x0aeb('0xc')](socket);function respondWithRpcPromise(_0xc004df,_0x5649b5,_0x380e1e){return new BPromise(function(_0x346bd8,_0x157aee){return client[_0x0aeb('0xd')](_0xc004df,_0x380e1e)[_0x0aeb('0xe')](function(_0x5b3891){logger['info'](_0x0aeb('0xf'),_0x5649b5,_0x0aeb('0x10'));logger[_0x0aeb('0x11')](_0x0aeb('0x12'),_0x5649b5,'request\x20sent',JSON[_0x0aeb('0x13')](_0x5b3891));if(_0x5b3891[_0x0aeb('0x14')]){if(_0x5b3891[_0x0aeb('0x14')]['code']===0x1f4){logger[_0x0aeb('0x14')](_0x0aeb('0xf'),_0x5649b5,_0x5b3891[_0x0aeb('0x14')][_0x0aeb('0x15')]);return _0x157aee(_0x5b3891[_0x0aeb('0x14')][_0x0aeb('0x15')]);}logger[_0x0aeb('0x14')](_0x0aeb('0xf'),_0x5649b5,_0x5b3891[_0x0aeb('0x14')]['message']);return _0x346bd8(_0x5b3891[_0x0aeb('0x14')][_0x0aeb('0x15')]);}else{logger[_0x0aeb('0x16')]('ChatGroup,\x20%s,\x20%s',_0x5649b5,'request\x20sent');_0x346bd8(_0x5b3891[_0x0aeb('0x17')][_0x0aeb('0x15')]);}})[_0x0aeb('0x18')](function(_0x5497df){logger[_0x0aeb('0x14')]('ChatGroup,\x20%s,\x20%s',_0x5649b5,_0x5497df);_0x157aee(_0x5497df);});});}
\ No newline at end of file
+var _0x7ef0=['randomstring','../../config/utils','rpc','http','localhost','./chatGroup.socket','register','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','util','bluebird'];(function(_0x41cfd4,_0x1ed2cc){var _0x190f48=function(_0x4b5b1a){while(--_0x4b5b1a){_0x41cfd4['push'](_0x41cfd4['shift']());}};_0x190f48(++_0x1ed2cc);}(_0x7ef0,0x76));var _0x07ef=function(_0x1e9534,_0x85034a){_0x1e9534=_0x1e9534-0x0;var _0x2effcf=_0x7ef0[_0x1e9534];return _0x2effcf;};'use strict';var _=require('lodash');var util=require(_0x07ef('0x0'));var moment=require('moment');var BPromise=require(_0x07ef('0x1'));var rs=require(_0x07ef('0x2'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x07ef('0x3'));var logger=require('../../config/logger')(_0x07ef('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x07ef('0x5')]({'port':0x232a});var socket=require('socket.io-emitter')({'host':_0x07ef('0x6'),'port':0x18eb});require(_0x07ef('0x7'))[_0x07ef('0x8')](socket);function respondWithRpcPromise(_0x33b3ab,_0x47ce4c,_0x2a8f07){return new BPromise(function(_0x16fdef,_0x2a00d7){return client['request'](_0x33b3ab,_0x2a8f07)[_0x07ef('0x9')](function(_0xc751d6){logger[_0x07ef('0xa')]('ChatGroup,\x20%s,\x20%s',_0x47ce4c,_0x07ef('0xb'));logger[_0x07ef('0xc')](_0x07ef('0xd'),_0x47ce4c,'request\x20sent',JSON[_0x07ef('0xe')](_0xc751d6));if(_0xc751d6['error']){if(_0xc751d6[_0x07ef('0xf')][_0x07ef('0x10')]===0x1f4){logger['error'](_0x07ef('0x11'),_0x47ce4c,_0xc751d6[_0x07ef('0xf')][_0x07ef('0x12')]);return _0x2a00d7(_0xc751d6['error']['message']);}logger[_0x07ef('0xf')]('ChatGroup,\x20%s,\x20%s',_0x47ce4c,_0xc751d6[_0x07ef('0xf')][_0x07ef('0x12')]);return _0x16fdef(_0xc751d6[_0x07ef('0xf')][_0x07ef('0x12')]);}else{logger[_0x07ef('0xa')](_0x07ef('0x11'),_0x47ce4c,'request\x20sent');_0x16fdef(_0xc751d6[_0x07ef('0x13')][_0x07ef('0x12')]);}})['catch'](function(_0x30a2ec){logger[_0x07ef('0xf')]('ChatGroup,\x20%s,\x20%s',_0x47ce4c,_0x30a2ec);_0x2a00d7(_0x30a2ec);});});}
\ No newline at end of file
index 36e8edf..da91f82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5b6=['removeListener','register','length','./chatGroup.events','save','remove','update','emit'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd5b6,0x73));var _0x6d5b=function(_0x355535,_0x1e2607){_0x355535=_0x355535-0x0;var _0x2a4242=_0xd5b6[_0x355535];return _0x2a4242;};'use strict';var ChatGroupEvents=require(_0x6d5b('0x0'));var events=[_0x6d5b('0x1'),_0x6d5b('0x2'),_0x6d5b('0x3')];function createListener(_0x406106,_0x3d9bc9){return function(_0x162442){_0x3d9bc9[_0x6d5b('0x4')](_0x406106,_0x162442);};}function removeListener(_0x558202,_0x2735ab){return function(){ChatGroupEvents[_0x6d5b('0x5')](_0x558202,_0x2735ab);};}exports[_0x6d5b('0x6')]=function(_0x4935ef){for(var _0x1c2490=0x0,_0x3e722d=events[_0x6d5b('0x7')];_0x1c2490<_0x3e722d;_0x1c2490++){var _0x3cdc91=events[_0x1c2490];var _0x5b57cb=createListener('chatGroup:'+_0x3cdc91,_0x4935ef);ChatGroupEvents['on'](_0x3cdc91,_0x5b57cb);}};
\ No newline at end of file
+var _0x876b=['emit','removeListener','register','chatGroup:','remove','update'];(function(_0x4286b7,_0x2fdb8e){var _0x597fd1=function(_0x220ea3){while(--_0x220ea3){_0x4286b7['push'](_0x4286b7['shift']());}};_0x597fd1(++_0x2fdb8e);}(_0x876b,0x1ba));var _0xb876=function(_0x5063b1,_0x53998a){_0x5063b1=_0x5063b1-0x0;var _0x36b0e4=_0x876b[_0x5063b1];return _0x36b0e4;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0xb876('0x0'),_0xb876('0x1')];function createListener(_0x5c6895,_0x569fc2){return function(_0x34a150){_0x569fc2[_0xb876('0x2')](_0x5c6895,_0x34a150);};}function removeListener(_0x4e24d3,_0x23429e){return function(){ChatGroupEvents[_0xb876('0x3')](_0x4e24d3,_0x23429e);};}exports[_0xb876('0x4')]=function(_0x5e1da8){for(var _0x275125=0x0,_0x4353cf=events['length'];_0x275125<_0x4353cf;_0x275125++){var _0x309bfd=events[_0x275125];var _0xcbf343=createListener(_0xb876('0x5')+_0x309bfd,_0x5e1da8);ChatGroupEvents['on'](_0x309bfd,_0xcbf343);}};
\ No newline at end of file
index 1247a9b..3e13e03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbddb=['addMessage','put','update','delete','removeMembers','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers'];(function(_0x30f457,_0x582ea5){var _0x1a8943=function(_0x4b242a){while(--_0x4b242a){_0x30f457['push'](_0x30f457['shift']());}};_0x1a8943(++_0x582ea5);}(_0xbddb,0x102));var _0xbbdd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbddb[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xbbdd('0x0'));var util=require('util');var path=require('path');var express=require(_0xbbdd('0x1'));var router=express[_0xbbdd('0x2')]();var auth=require(_0xbbdd('0x3'));var interaction=require(_0xbbdd('0x4'));var config=require(_0xbbdd('0x5'));var controller=require(_0xbbdd('0x6'));router[_0xbbdd('0x7')]('/',auth[_0xbbdd('0x8')](),controller[_0xbbdd('0x9')]);router['get'](_0xbbdd('0xa'),auth[_0xbbdd('0x8')](),controller[_0xbbdd('0xb')]);router['get'](_0xbbdd('0xc'),auth['isAuthenticated'](),controller[_0xbbdd('0xd')]);router[_0xbbdd('0x7')](_0xbbdd('0xe'),auth[_0xbbdd('0x8')](),controller[_0xbbdd('0xf')]);router[_0xbbdd('0x7')](_0xbbdd('0x10'),auth[_0xbbdd('0x8')](),controller['getMembers']);router[_0xbbdd('0x7')](_0xbbdd('0x11'),auth[_0xbbdd('0x8')](),controller[_0xbbdd('0x12')]);router[_0xbbdd('0x13')]('/',auth['isAuthenticated'](),controller[_0xbbdd('0x14')]);router[_0xbbdd('0x13')](_0xbbdd('0x10'),auth[_0xbbdd('0x8')](),controller[_0xbbdd('0x15')]);router['post'](_0xbbdd('0x11'),auth['isAuthenticated'](),controller[_0xbbdd('0x16')]);router[_0xbbdd('0x17')](_0xbbdd('0xc'),auth[_0xbbdd('0x8')](),controller[_0xbbdd('0x18')]);router['delete'](_0xbbdd('0xc'),auth[_0xbbdd('0x8')](),controller['destroy']);router[_0xbbdd('0x19')](_0xbbdd('0x10'),auth[_0xbbdd('0x8')](),controller[_0xbbdd('0x1a')]);module[_0xbbdd('0x1b')]=router;
\ No newline at end of file
+var _0xd6af=['isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','put','delete','removeMembers','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get'];(function(_0x463376,_0x13871c){var _0x336ccd=function(_0x33afd2){while(--_0x33afd2){_0x463376['push'](_0x463376['shift']());}};_0x336ccd(++_0x13871c);}(_0xd6af,0xcf));var _0xfd6a=function(_0xdfca8d,_0x377316){_0xdfca8d=_0xdfca8d-0x0;var _0x1cbe00=_0xd6af[_0xdfca8d];return _0x1cbe00;};'use strict';var multer=require(_0xfd6a('0x0'));var util=require(_0xfd6a('0x1'));var path=require('path');var express=require(_0xfd6a('0x2'));var router=express[_0xfd6a('0x3')]();var auth=require(_0xfd6a('0x4'));var interaction=require(_0xfd6a('0x5'));var config=require(_0xfd6a('0x6'));var controller=require(_0xfd6a('0x7'));router[_0xfd6a('0x8')]('/',auth[_0xfd6a('0x9')](),controller['index']);router['get'](_0xfd6a('0xa'),auth[_0xfd6a('0x9')](),controller[_0xfd6a('0xb')]);router[_0xfd6a('0x8')](_0xfd6a('0xc'),auth['isAuthenticated'](),controller[_0xfd6a('0xd')]);router['get'](_0xfd6a('0xe'),auth[_0xfd6a('0x9')](),controller[_0xfd6a('0xf')]);router['get'](_0xfd6a('0x10'),auth[_0xfd6a('0x9')](),controller[_0xfd6a('0x11')]);router[_0xfd6a('0x8')](_0xfd6a('0x12'),auth[_0xfd6a('0x9')](),controller[_0xfd6a('0x13')]);router[_0xfd6a('0x14')]('/',auth['isAuthenticated'](),controller[_0xfd6a('0x15')]);router['post'](_0xfd6a('0x10'),auth[_0xfd6a('0x9')](),controller['addMembers']);router[_0xfd6a('0x14')]('/:id/messages',auth[_0xfd6a('0x9')](),controller[_0xfd6a('0x16')]);router[_0xfd6a('0x17')]('/:id',auth[_0xfd6a('0x9')](),controller['update']);router[_0xfd6a('0x18')](_0xfd6a('0xc'),auth[_0xfd6a('0x9')](),controller['destroy']);router['delete'](_0xfd6a('0x10'),auth[_0xfd6a('0x9')](),controller[_0xfd6a('0x19')]);module[_0xfd6a('0x1a')]=router;
\ No newline at end of file
index e8b4023..73b7442 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1be1=['thumb','TEXT','STRING','DATE','ENUM','out','BOOLEAN','INTEGER','star'];(function(_0x1c6511,_0x3af4af){var _0x23defb=function(_0x390ae3){while(--_0x390ae3){_0x1c6511['push'](_0x1c6511['shift']());}};_0x23defb(++_0x3af4af);}(_0x1be1,0x192));var _0x11be=function(_0x5cf71a,_0x75d6bd){_0x5cf71a=_0x5cf71a-0x0;var _0x58e716=_0x1be1[_0x5cf71a];return _0x58e716;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x11be('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x11be('0x1')]},'ratingType':{'type':Sequelize['ENUM'](_0x11be('0x2'),_0x11be('0x3')),'defaultValue':_0x11be('0x2')},'ratingMessage':{'type':Sequelize[_0x11be('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x11be('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x11be('0x6')]},'disposition':{'type':Sequelize[_0x11be('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x11be('0x5')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x11be('0x5')]},'osVersion':{'type':Sequelize[_0x11be('0x5')]},'deviceModel':{'type':Sequelize[_0x11be('0x5')]},'deviceVendor':{'type':Sequelize[_0x11be('0x5')]},'deviceType':{'type':Sequelize[_0x11be('0x5')]},'referer':{'type':Sequelize['STRING']},'customerIp':{'type':Sequelize[_0x11be('0x5')]},'formData':{'type':Sequelize[_0x11be('0x4')]('long')},'read1stAt':{'type':Sequelize[_0x11be('0x6')]},'lastMsgAt':{'type':Sequelize[_0x11be('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x11be('0x7')]('in',_0x11be('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x91a7=['star','STRING','DATE','long','ENUM','out','exports','BOOLEAN','INTEGER'];(function(_0x1e5f0c,_0x31aa12){var _0x3d083b=function(_0x1a8df2){while(--_0x1a8df2){_0x1e5f0c['push'](_0x1e5f0c['shift']());}};_0x3d083b(++_0x31aa12);}(_0x91a7,0xe7));var _0x791a=function(_0x1e8d69,_0x2d5b26){_0x1e8d69=_0x1e8d69-0x0;var _0x4c0199=_0x91a7[_0x1e8d69];return _0x4c0199;};'use strict';var Sequelize=require('sequelize');module[_0x791a('0x0')]={'closed':{'type':Sequelize[_0x791a('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x791a('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x791a('0x3'),'thumb'),'defaultValue':_0x791a('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x791a('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x791a('0x5')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x791a('0x4')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x791a('0x4')]},'osName':{'type':Sequelize[_0x791a('0x4')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x791a('0x4')]},'deviceVendor':{'type':Sequelize[_0x791a('0x4')]},'deviceType':{'type':Sequelize[_0x791a('0x4')]},'referer':{'type':Sequelize[_0x791a('0x4')]},'customerIp':{'type':Sequelize[_0x791a('0x4')]},'formData':{'type':Sequelize['TEXT'](_0x791a('0x6'))},'read1stAt':{'type':Sequelize[_0x791a('0x5')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x791a('0x7')]('in',_0x791a('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x791a('0x4')]}};
\ No newline at end of file
index a935ab7..659628f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2af0=['add','day','merge','filter','options','include','tag','push','Tag','Tags','distinct','ChatMessage','direction','read','includeAll','User','fullname','CmContact','Contact','Owner','ChatWebsite','Account','Messages','createdAt','color','findAll','rows','catch','show','params','find','create','body','describe','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','ValidationError','Interaction\x20already\x20assigned','update','closed','closedAt','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','type','mimetype','Attachment','attachmentDownload','Unauthorized','findOne','join','root','server/files/attachments/','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','ChatWebsiteId','ContactId','format','%s%d','System','agentIdentifier','website_alias','agentAlias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','user','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','ChatInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','map','includeAgent','alias','addTags','setTags','spread','chatInteractionTags:save','removeTags','download','unix','toString','server','tmp','files','attachments','1cm','mkdirSync','<h1>Chat\x20Interaction:\x20#%d</h1>','<h2>Date:\x20%s</h2>','<div\x20style=\x22border-style:\x20solid;\x20border-width:\x201px;\x20margin:\x203px;\x22>','<p\x20style=\x22margin:\x203px;\x22>%s:\x20%s</p>','</div>','existsSync','createReadStream','pipe','createWriteStream','toFile','interaction-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../mysqldb','localhost','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','end','status','json','count','offset','set','Content-Range','apply','save','destroy','stack','name','send','index','ChatInteraction','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick'];(function(_0x1cadce,_0xa2642){var _0x4e9be9=function(_0x585122){while(--_0x585122){_0x1cadce['push'](_0x1cadce['shift']());}};_0x4e9be9(++_0xa2642);}(_0x2af0,0x14d));var _0x02af=function(_0x5d82ad,_0x2a734a){_0x5d82ad=_0x5d82ad-0x0;var _0x4ab31f=_0x2af0[_0x5d82ad];return _0x4ab31f;};'use strict';var pdf=require(_0x02af('0x0'));var emlformat=require(_0x02af('0x1'));var rimraf=require(_0x02af('0x2'));var zipdir=require(_0x02af('0x3'));var jsonpatch=require(_0x02af('0x4'));var rp=require(_0x02af('0x5'));var moment=require(_0x02af('0x6'));var BPromise=require(_0x02af('0x7'));var Mustache=require(_0x02af('0x8'));var util=require('util');var path=require(_0x02af('0x9'));var sox=require(_0x02af('0xa'));var csv=require(_0x02af('0xb'));var ejs=require(_0x02af('0xc'));var fs=require('fs');var _=require(_0x02af('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x02af('0xe'));var deskjs=require(_0x02af('0xf'));var toCsv=require(_0x02af('0xb'));var querystring=require(_0x02af('0x10'));var Papa=require(_0x02af('0x11'));var qs=require(_0x02af('0x12'));var logger=require('../../config/logger')(_0x02af('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x02af('0x14'))['db'];var socket=require('socket.io-emitter')({'host':_0x02af('0x15'),'port':0x18eb});require('./chatInteraction.socket')[_0x02af('0x16')](socket);var jayson=require(_0x02af('0x17'));var client=jayson[_0x02af('0x18')]['http']({'port':0x232b});var client9004=jayson[_0x02af('0x18')][_0x02af('0x19')]({'port':0x232c});function respondWithRpcPromise(_0x4eb8da,_0x548db7,_0x3242c0,_0x867515){return new BPromise(function(_0x11c6df,_0x18bc82){var _0x478807=_0x867515||client;return _0x478807[_0x02af('0x1a')](_0x4eb8da,_0x3242c0)[_0x02af('0x1b')](function(_0x5aaeba){logger[_0x02af('0x1c')](_0x02af('0x1d'),_0x548db7,_0x02af('0x1e'));logger[_0x02af('0x1f')](_0x02af('0x20'),_0x548db7,_0x02af('0x1e'),JSON[_0x02af('0x21')](_0x5aaeba));if(_0x5aaeba[_0x02af('0x22')]){if(_0x5aaeba['error'][_0x02af('0x23')]===0x1f4){logger[_0x02af('0x22')](_0x02af('0x1d'),_0x548db7,_0x5aaeba[_0x02af('0x22')][_0x02af('0x24')]);return _0x18bc82(_0x5aaeba[_0x02af('0x22')][_0x02af('0x24')]);}logger[_0x02af('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x548db7,_0x5aaeba['error'][_0x02af('0x24')]);return _0x11c6df(_0x5aaeba[_0x02af('0x22')][_0x02af('0x24')]);}else{logger[_0x02af('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x548db7,_0x02af('0x1e'));_0x11c6df(_0x5aaeba['result'][_0x02af('0x24')]);}})['catch'](function(_0x4b0219){logger[_0x02af('0x22')](_0x02af('0x1d'),_0x548db7,_0x4b0219);_0x18bc82(_0x4b0219);});});}function respondWithStatusCode(_0x20a7bf,_0x4da603){_0x4da603=_0x4da603||0xcc;return function(_0xe41830){if(_0xe41830){return _0x20a7bf[_0x02af('0x25')](_0x4da603);}return _0x20a7bf['status'](_0x4da603)[_0x02af('0x26')]();};}function respondWithResult(_0x4bbfcc,_0x268aab){_0x268aab=_0x268aab||0xc8;return function(_0x318a17){if(_0x318a17){return _0x4bbfcc[_0x02af('0x27')](_0x268aab)[_0x02af('0x28')](_0x318a17);}};}function respondWithFilteredResult(_0x509ab3,_0x459df2){return function(_0xd83614){if(_0xd83614){var _0x1ea05c=_0xd83614[_0x02af('0x29')],_0x36e74f=_0x459df2[_0x02af('0x2a')],_0x167638=_0x459df2['offset']+_0x459df2['limit'],_0x538f27;if(_0x167638>=_0x1ea05c){_0x167638=_0x1ea05c;_0x538f27=0xc8;}else{_0x538f27=0xce;}_0x509ab3[_0x02af('0x27')](_0x538f27);return _0x509ab3[_0x02af('0x2b')](_0x02af('0x2c'),_0x36e74f+'-'+_0x167638+'/'+_0x1ea05c)['json'](_0xd83614);}return null;};}function patchUpdates(_0x533223){return function(_0x401b0e){try{jsonpatch[_0x02af('0x2d')](_0x401b0e,_0x533223,!![]);}catch(_0x14e02e){return BPromise['reject'](_0x14e02e);}return _0x401b0e[_0x02af('0x2e')]();};}function saveUpdates(_0x2ee018,_0x44b49a){return function(_0x522567){if(_0x522567){return _0x522567['update'](_0x2ee018)[_0x02af('0x1b')](function(_0x44595c){return _0x44595c;});}return null;};}function removeEntity(_0x117879,_0x584742){return function(_0x2d603b){if(_0x2d603b){return _0x2d603b[_0x02af('0x2f')]()[_0x02af('0x1b')](function(){_0x117879['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc3ab47,_0x2d2fc1){return function(_0x152e92){if(!_0x152e92){_0xc3ab47[_0x02af('0x25')](0x194);}return _0x152e92;};}function handleError(_0xaa2c8d,_0x137d0e){_0x137d0e=_0x137d0e||0x1f4;return function(_0x5ce8ed){logger['error'](_0x5ce8ed[_0x02af('0x30')]);if(_0x5ce8ed[_0x02af('0x31')]){delete _0x5ce8ed['name'];}_0xaa2c8d['status'](_0x137d0e)[_0x02af('0x32')](_0x5ce8ed);};}exports[_0x02af('0x33')]=function(_0x411cdd,_0x1aefb8){var _0x25b76a={},_0x597845={},_0x1990ea={'count':0x0,'rows':[]};var _0x33d8d1=db[_0x02af('0x34')][_0x02af('0x35')];_0x597845[_0x02af('0x36')]=_[_0x02af('0x37')](_0x33d8d1);var _0x34c0bb={'dateStart':_0x411cdd[_0x02af('0x38')][_0x02af('0x39')],'dateEnd':_0x411cdd[_0x02af('0x38')][_0x02af('0x3a')]};delete _0x411cdd['query'][_0x02af('0x39')];delete _0x411cdd[_0x02af('0x38')][_0x02af('0x3a')];_0x597845['query']=_[_0x02af('0x37')](_0x411cdd[_0x02af('0x38')]);_0x597845[_0x02af('0x3b')]=_[_0x02af('0x3c')](_0x597845[_0x02af('0x36')],_0x597845['query']);_0x25b76a[_0x02af('0x3d')]=_['intersection'](_0x597845[_0x02af('0x36')],qs[_0x02af('0x3e')](_0x411cdd[_0x02af('0x38')][_0x02af('0x3e')]));_0x25b76a[_0x02af('0x3d')]=_0x25b76a[_0x02af('0x3d')][_0x02af('0x3f')]?_0x25b76a[_0x02af('0x3d')]:_0x597845[_0x02af('0x36')];if(!_0x411cdd[_0x02af('0x38')][_0x02af('0x40')](_0x02af('0x41'))){_0x25b76a[_0x02af('0x42')]=qs[_0x02af('0x42')](_0x411cdd['query'][_0x02af('0x42')]);_0x25b76a[_0x02af('0x2a')]=qs[_0x02af('0x2a')](_0x411cdd[_0x02af('0x38')][_0x02af('0x2a')]);}_0x25b76a[_0x02af('0x43')]=qs[_0x02af('0x44')](_0x411cdd[_0x02af('0x38')][_0x02af('0x44')]);_0x25b76a[_0x02af('0x45')]=qs[_0x02af('0x3b')](_[_0x02af('0x46')](_0x411cdd['query'],_0x597845['filters']));if(_0x34c0bb[_0x02af('0x39')]){if(_0x34c0bb[_0x02af('0x3a')]){_0x34c0bb[_0x02af('0x3a')]=moment(_0x34c0bb[_0x02af('0x3a')])[_0x02af('0x47')](0x1,_0x02af('0x48'));}else{_0x34c0bb[_0x02af('0x3a')]=moment(_0x34c0bb[_0x02af('0x39')])[_0x02af('0x47')](0x1,_0x02af('0x48'));}_[_0x02af('0x49')](_0x25b76a[_0x02af('0x45')],{'createdAt':{'$gte':_0x34c0bb[_0x02af('0x39')],'$lte':_0x34c0bb[_0x02af('0x3a')]}});}if(_0x411cdd[_0x02af('0x38')][_0x02af('0x4a')]){_0x25b76a[_0x02af('0x45')]=_[_0x02af('0x49')](_0x25b76a[_0x02af('0x45')],{'$or':_['map'](_0x25b76a[_0x02af('0x3d')],function(_0x1823b3){var _0x181a77={};_0x181a77[_0x1823b3]={'$like':'%'+_0x411cdd[_0x02af('0x38')][_0x02af('0x4a')]+'%'};return _0x181a77;})});}_0x25b76a=_['merge']({},_0x25b76a,_0x411cdd[_0x02af('0x4b')]);var _0x40907b={'where':_0x25b76a[_0x02af('0x45')]};_0x40907b[_0x02af('0x4c')]=[];if(_0x411cdd[_0x02af('0x38')][_0x02af('0x4d')]){_0x40907b[_0x02af('0x4c')][_0x02af('0x4e')]({'model':db[_0x02af('0x4f')],'as':_0x02af('0x50'),'attributes':['id'],'where':{'id':_0x411cdd[_0x02af('0x38')][_0x02af('0x4d')]},'required':!![]});_0x40907b[_0x02af('0x51')]=!![];}if(_0x411cdd[_0x02af('0x38')]['read']){_0x40907b[_0x02af('0x4c')][_0x02af('0x4e')]({'model':db[_0x02af('0x52')],'as':'Messages','attributes':['id',_0x02af('0x53'),'createdAt','read'],'where':{'direction':'in','read':_0x411cdd['query'][_0x02af('0x54')]||![]},'required':!![]});_0x40907b['distinct']=!![];}return db[_0x02af('0x34')][_0x02af('0x29')](_0x40907b)[_0x02af('0x1b')](function(_0xd8e713){_0x1990ea['count']=_0xd8e713;if(_0x411cdd['query'][_0x02af('0x55')]){_0x25b76a[_0x02af('0x4c')]=[{'model':db[_0x02af('0x56')],'as':'Users','required':![],'attributes':['id','name',_0x02af('0x57')]},{'model':db[_0x02af('0x58')],'as':_0x02af('0x59'),'required':![]},{'model':db[_0x02af('0x56')],'as':_0x02af('0x5a'),'attributes':[_0x02af('0x31'),_0x02af('0x57'),'internal'],'required':![]},{'model':db[_0x02af('0x5b')],'as':_0x02af('0x5c'),'attributes':['name','key'],'required':![]},{'model':db[_0x02af('0x52')],'as':_0x02af('0x5d'),'attributes':['id',_0x02af('0x53'),_0x02af('0x5e'),_0x02af('0x54')],'where':{'direction':'in','read':_0x411cdd['query'][_0x02af('0x54')]||![]},'required':_0x411cdd['query']['read']||![]},{'model':db['Tag'],'as':_0x02af('0x50'),'attributes':['id','name','color'],'required':_0x411cdd[_0x02af('0x38')][_0x02af('0x4d')]?!![]:![]},{'model':db[_0x02af('0x4f')],'as':'ThroughTags','attributes':['id',_0x02af('0x31'),_0x02af('0x5f')],'through':_0x411cdd[_0x02af('0x38')]['tag']?{'attributes':[],'where':{'TagId':_0x411cdd[_0x02af('0x38')][_0x02af('0x4d')]||undefined}}:{},'required':_0x411cdd[_0x02af('0x38')][_0x02af('0x4d')]?!![]:![]}];}return db[_0x02af('0x34')][_0x02af('0x60')](_0x25b76a);})[_0x02af('0x1b')](function(_0x35d721){_0x1990ea[_0x02af('0x61')]=_0x35d721;return _0x1990ea;})['then'](respondWithFilteredResult(_0x1aefb8,_0x25b76a))[_0x02af('0x62')](handleError(_0x1aefb8,null));};exports[_0x02af('0x63')]=function(_0x21b133,_0x304c4){var _0x47cc50={'raw':![],'where':{'id':_0x21b133[_0x02af('0x64')]['id']}},_0x45099b={};_0x45099b[_0x02af('0x36')]=_[_0x02af('0x37')](db[_0x02af('0x34')][_0x02af('0x35')]);_0x45099b[_0x02af('0x38')]=_[_0x02af('0x37')](_0x21b133[_0x02af('0x38')]);_0x45099b['filters']=_[_0x02af('0x3c')](_0x45099b[_0x02af('0x36')],_0x45099b[_0x02af('0x38')]);_0x47cc50[_0x02af('0x3d')]=_[_0x02af('0x3c')](_0x45099b[_0x02af('0x36')],qs[_0x02af('0x3e')](_0x21b133[_0x02af('0x38')][_0x02af('0x3e')]));_0x47cc50['attributes']=_0x47cc50[_0x02af('0x3d')][_0x02af('0x3f')]?_0x47cc50[_0x02af('0x3d')]:_0x45099b[_0x02af('0x36')];if(_0x21b133[_0x02af('0x38')][_0x02af('0x55')]){_0x47cc50['include']=[{'all':!![]}];}_0x47cc50=_[_0x02af('0x49')]({},_0x47cc50,_0x21b133[_0x02af('0x4b')]);return db[_0x02af('0x34')][_0x02af('0x65')](_0x47cc50)[_0x02af('0x1b')](handleEntityNotFound(_0x304c4,null))['then'](respondWithResult(_0x304c4,null))[_0x02af('0x62')](handleError(_0x304c4,null));};exports[_0x02af('0x66')]=function(_0x76c463,_0x46e6d5){return db[_0x02af('0x34')][_0x02af('0x66')](_0x76c463['body'],{})['then'](respondWithResult(_0x46e6d5,0xc9))[_0x02af('0x62')](handleError(_0x46e6d5,null));};exports['update']=function(_0x286c39,_0x2cd1f6){if(_0x286c39[_0x02af('0x67')]['id']){delete _0x286c39[_0x02af('0x67')]['id'];}return db['ChatInteraction'][_0x02af('0x65')]({'where':{'id':_0x286c39[_0x02af('0x64')]['id']}})['then'](handleEntityNotFound(_0x2cd1f6,null))[_0x02af('0x1b')](saveUpdates(_0x286c39[_0x02af('0x67')],null))[_0x02af('0x1b')](respondWithResult(_0x2cd1f6,null))[_0x02af('0x62')](handleError(_0x2cd1f6,null));};exports[_0x02af('0x2f')]=function(_0x244ac0,_0x284304){return db['ChatInteraction'][_0x02af('0x65')]({'where':{'id':_0x244ac0[_0x02af('0x64')]['id']}})['then'](handleEntityNotFound(_0x284304,null))['then'](removeEntity(_0x284304,null))[_0x02af('0x62')](handleError(_0x284304,null));};exports['describe']=function(_0x26ffba,_0x3fec43){return db['ChatInteraction'][_0x02af('0x68')]()[_0x02af('0x1b')](respondWithResult(_0x3fec43,null))['catch'](handleError(_0x3fec43,null));};exports['customUpdate']=function(_0x1be6bc,_0x564ad2){if(_0x1be6bc[_0x02af('0x67')]['id']){delete _0x1be6bc[_0x02af('0x67')]['id'];}return db[_0x02af('0x34')][_0x02af('0x65')]({'where':{'id':_0x1be6bc[_0x02af('0x64')]['id']}})['then'](handleEntityNotFound(_0x564ad2,null))[_0x02af('0x1b')](saveUpdates(_0x1be6bc[_0x02af('0x67')],null))[_0x02af('0x1b')](respondWithResult(_0x564ad2,null))['catch'](handleError(_0x564ad2,null));};exports[_0x02af('0x69')]=function(_0x50399c,_0x49ad2a,_0x4bad35){if(_0x50399c['body']['id']){delete _0x50399c['body']['id'];}return db[_0x02af('0x34')][_0x02af('0x65')]({'where':{'id':_0x50399c[_0x02af('0x64')]['id']}})['then'](function(_0x1cb474){if(!_0x1cb474){logger['error'](_0x02af('0x6a'),'abandon',0x194,_0x02af('0x6b'));_0x49ad2a[_0x02af('0x25')](0x194);}else{if(_0x1cb474[_0x02af('0x6c')]){throw new db['Sequelize'][(_0x02af('0x6d'))](_0x02af('0x6e'));}}return _0x1cb474;})[_0x02af('0x1b')](function(_0x2f1542){if(_0x2f1542){return _0x2f1542[_0x02af('0x6f')]({'closed':_0x50399c[_0x02af('0x67')][_0x02af('0x70')],'closedAt':_0x50399c[_0x02af('0x67')][_0x02af('0x71')],'disposition':_0x50399c[_0x02af('0x67')]['disposition']})[_0x02af('0x1b')](function(_0x2601c1){return _0x2601c1;});}})[_0x02af('0x1b')](function(_0x559a7e){return respondWithRpcPromise(_0x02af('0x72'),_0x02af('0x69'),_0x50399c[_0x02af('0x67')],client9004);})[_0x02af('0x1b')](respondWithResult(_0x49ad2a,null))[_0x02af('0x62')](handleError(_0x49ad2a,null));};exports[_0x02af('0x73')]=function(_0x55d33a,_0x51f867,_0x30f88f){_0x55d33a['body'][_0x02af('0x31')]=_0x55d33a[_0x02af('0x74')][_0x02af('0x75')];_0x55d33a['body'][_0x02af('0x76')]=_0x55d33a[_0x02af('0x74')][_0x02af('0x77')];_0x55d33a[_0x02af('0x67')][_0x02af('0x78')]=_0x55d33a[_0x02af('0x74')][_0x02af('0x79')];return db[_0x02af('0x7a')][_0x02af('0x66')](_0x55d33a[_0x02af('0x67')])[_0x02af('0x1b')](respondWithResult(_0x51f867,0xc9))[_0x02af('0x62')](handleError(_0x51f867,null));};exports[_0x02af('0x7b')]=function(_0x1b4286,_0x3f33ae,_0x26e0f5){return db[_0x02af('0x34')]['findOne']({'where':{'id':_0x1b4286[_0x02af('0x64')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3f33ae,null))['then'](function(_0x57d9b3){if(_0x57d9b3){if(_0x57d9b3[_0x02af('0x70')]){return _0x3f33ae[_0x02af('0x27')](0x193)[_0x02af('0x28')]({'status':0x193,'message':_0x02af('0x7c')});}return db[_0x02af('0x7a')][_0x02af('0x7d')]({'where':{'id':_0x1b4286[_0x02af('0x38')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x3f33ae,null));}})[_0x02af('0x1b')](function(_0x49d77e){if(_0x49d77e){return _0x3f33ae['download'](path[_0x02af('0x7e')](config[_0x02af('0x7f')],_0x02af('0x80'),_0x49d77e[_0x02af('0x76')]));}})['catch'](handleError(_0x3f33ae,null));};exports['close']=function(_0x19c97b,_0x190475){var _0x43eb5d=null;var _0x41ee3d=null;var _0x17ddbe=null;var _0x15f5d8=null;if(_0x19c97b[_0x02af('0x67')]['id']){delete _0x19c97b['body']['id'];}if(_0x19c97b['body'][_0x02af('0x81')]){_0x15f5d8=path['join'](config['root'],_0x02af('0x82'),util['format'](_0x02af('0x83'),Date[_0x02af('0x84')]()));_0x19c97b[_0x02af('0x67')]['pathTranscript']=_0x15f5d8;}return db[_0x02af('0x34')]['find']({'where':{'id':_0x19c97b[_0x02af('0x64')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x02af('0x5d'),'include':[{'model':db[_0x02af('0x56')],'as':'User'}]}]})[_0x02af('0x1b')](handleEntityNotFound(_0x190475,null))['then'](saveUpdates(_0x19c97b[_0x02af('0x67')],null))[_0x02af('0x1b')](function(_0x22291c){if(_0x22291c){_0x43eb5d=_0x22291c;return db[_0x02af('0x5b')][_0x02af('0x65')]({'where':{'id':_0x43eb5d[_0x02af('0x85')]}});}})[_0x02af('0x1b')](function(_0x646d19){if(_0x646d19){_0x17ddbe=_0x646d19;return db[_0x02af('0x58')][_0x02af('0x65')]({'where':{'id':_0x43eb5d[_0x02af('0x86')]}});}})[_0x02af('0x1b')](function(_0x5a6a14){if(_0x5a6a14){_0x41ee3d=_0x5a6a14;if(_0x15f5d8){var _0xe0bfc1=null;for(var _0x2cca18=0x1;_0x2cca18<_0x43eb5d[_0x02af('0x5d')][_0x02af('0x3f')];++_0x2cca18){_0xe0bfc1=_0x43eb5d[_0x02af('0x5d')][_0x2cca18];var _0x1db66b=_0xe0bfc1[_0x02af('0x6c')]?util[_0x02af('0x87')](_0x02af('0x88'),_0x17ddbe['agentAlias'],_0xe0bfc1[_0x02af('0x6c')]):_0x02af('0x89');var _0x4f0e91=_0x19c97b['body']['customer']||util[_0x02af('0x87')](_0x02af('0x88'),'Visitor',_0xe0bfc1[_0x02af('0x86')]);switch(_0x17ddbe[_0x02af('0x8a')]){case _0x02af('0x8b'):_0x1db66b=_0xe0bfc1[_0x02af('0x6c')]?util[_0x02af('0x87')]('%s%d',_0x17ddbe[_0x02af('0x8c')],_0xe0bfc1[_0x02af('0x6c')]):_0x02af('0x89');break;case _0x02af('0x8d'):_0x1db66b=_0xe0bfc1[_0x02af('0x6c')]?_0xe0bfc1[_0x02af('0x56')]['alias']||_0xe0bfc1[_0x02af('0x56')][_0x02af('0x57')]:_0x02af('0x89');break;case _0x02af('0x8e'):_0x1db66b=_0xe0bfc1[_0x02af('0x6c')]?_0xe0bfc1[_0x02af('0x56')][_0x02af('0x57')]:'System';break;default:_0x1db66b=_0xe0bfc1[_0x02af('0x6c')]?util[_0x02af('0x87')](_0x02af('0x88'),_0x17ddbe[_0x02af('0x8c')],_0xe0bfc1[_0x02af('0x6c')]):_0x02af('0x89');}var _0x3103ec=util['format'](_0x02af('0x8f'),moment(_0xe0bfc1[_0x02af('0x5e')])[_0x02af('0x87')](_0x02af('0x90')),_0xe0bfc1[_0x02af('0x53')]==='in'?_0x4f0e91:_0x1db66b,_0xe0bfc1['body']);if(!_0xe0bfc1[_0x02af('0x91')]){fs[_0x02af('0x92')](_0x15f5d8,_0x3103ec);}}return db[_0x02af('0x93')][_0x02af('0x7d')]({'where':{'service':!![]},'include':[{'model':db[_0x02af('0x94')],'as':_0x02af('0x95'),'raw':!![]}]});}}})[_0x02af('0x1b')](function(_0x580591){if(_0x580591&&_0x580591[_0x02af('0x95')]&&_0x19c97b['body']){var _0x4b0e69={'tls':{'rejectUnauthorized':![]}};if(_0x580591[_0x02af('0x95')][_0x02af('0x96')]){_0x4b0e69['service']=_0x580591['Smtp'][_0x02af('0x96')];}else{_0x4b0e69[_0x02af('0x97')]=_0x580591[_0x02af('0x95')][_0x02af('0x97')];_0x4b0e69[_0x02af('0x98')]=_0x580591['Smtp']['port'];_0x4b0e69[_0x02af('0x99')]=_0x580591[_0x02af('0x95')][_0x02af('0x99')];}if(_0x580591[_0x02af('0x95')][_0x02af('0x9a')]){_0x4b0e69['auth']={'user':_0x580591[_0x02af('0x95')]['user'],'pass':_0x580591[_0x02af('0x95')][_0x02af('0x9b')]};}return respondWithRpcPromise(_0x02af('0x9c'),_0x02af('0x9d'),{'account':_0x4b0e69,'message':{'from':util[_0x02af('0x87')](_0x02af('0x9e'),_0x580591[_0x02af('0x31')],_0x580591['email']||_0x580591[_0x02af('0x95')][_0x02af('0x9f')]),'to':_0x19c97b[_0x02af('0x67')][_0x02af('0x81')],'subject':_0x02af('0xa0'),'text':util[_0x02af('0x87')](_0x02af('0xa1'),_0x19c97b['body']['mailTranscript']),'attachments':[{'path':_0x15f5d8}]}})['then'](function(){return _0x43eb5d;})['catch'](function(_0x20abdc){console['error'](_0x20abdc);});}else{return _0x43eb5d;}})['then'](respondWithStatusCode(_0x190475,0xc8))[_0x02af('0x62')](handleError(_0x190475,null));};exports[_0x02af('0xa2')]=function(_0x464dc2,_0x5bb083,_0x2bfeb5){return db[_0x02af('0x52')][_0x02af('0x65')]({'where':{'id':_0x464dc2[_0x02af('0x64')]['id']}})['then'](handleEntityNotFound(_0x5bb083,null))['then'](function(_0x3c09bb){if(_0x3c09bb){return _0x3c09bb[_0x02af('0xa2')](_0x464dc2[_0x02af('0x67')][_0x02af('0xa3')],_['omit'](_0x464dc2['body'],[_0x02af('0xa3'),'id'])||{});}})[_0x02af('0x1b')](respondWithResult(_0x5bb083,null))[_0x02af('0x62')](handleError(_0x5bb083,null));};exports[_0x02af('0xa4')]=function(_0x55ba80,_0x410cd6,_0x39b13c){var _0x5a180b={'raw':![],'where':{}};var _0x4eaa00={};var _0x544ca9={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x02af('0x7d')]({'where':{'id':_0x55ba80[_0x02af('0x64')]['id']}})[_0x02af('0x1b')](handleEntityNotFound(_0x410cd6,null))[_0x02af('0x1b')](function(_0x1ebfc7){if(_0x1ebfc7){_0x4eaa00[_0x02af('0x36')]=_['keys'](db[_0x02af('0x52')][_0x02af('0x35')]);_0x4eaa00[_0x02af('0x38')]=_['keys'](_0x55ba80[_0x02af('0x38')]);_0x4eaa00['filters']=_[_0x02af('0x3c')](_0x4eaa00[_0x02af('0x36')],_0x4eaa00['query']);_0x5a180b['attributes']=_[_0x02af('0x3c')](_0x4eaa00[_0x02af('0x36')],qs[_0x02af('0x3e')](_0x55ba80[_0x02af('0x38')]['fields']));_0x5a180b[_0x02af('0x3d')]=_0x5a180b['attributes'][_0x02af('0x3f')]?_0x5a180b[_0x02af('0x3d')]:_0x4eaa00[_0x02af('0x36')];if(!_0x55ba80[_0x02af('0x38')][_0x02af('0x40')](_0x02af('0x41'))){_0x5a180b[_0x02af('0x42')]=qs[_0x02af('0x42')](_0x55ba80[_0x02af('0x38')][_0x02af('0x42')]);_0x5a180b[_0x02af('0x2a')]=qs['offset'](_0x55ba80[_0x02af('0x38')][_0x02af('0x2a')]);}_0x5a180b[_0x02af('0x43')]=qs[_0x02af('0x44')](_0x55ba80['query'][_0x02af('0x44')]);_0x5a180b[_0x02af('0x45')]=qs[_0x02af('0x3b')](_[_0x02af('0x46')](_0x55ba80[_0x02af('0x38')],_0x4eaa00[_0x02af('0x3b')]));_0x5a180b['where'][_0x02af('0xa5')]=_0x1ebfc7['id'];if(_0x55ba80[_0x02af('0x38')][_0x02af('0x4a')]){_0x5a180b[_0x02af('0x45')]=_[_0x02af('0x49')](_0x5a180b[_0x02af('0x45')],{'$or':_['map'](_0x5a180b[_0x02af('0x3d')],function(_0x2752c9){var _0x5f4d46={};_0x5f4d46[_0x2752c9]={'$like':'%'+_0x55ba80['query'][_0x02af('0x4a')]+'%'};return _0x5f4d46;})});}if(_0x55ba80[_0x02af('0x38')]['$gte']){var _0x50f2e6=_0x55ba80[_0x02af('0x38')][_0x02af('0xa6')][_0x02af('0xa7')](',');var _0x4fe7dd={};_0x4fe7dd[_0x50f2e6[0x0]]={'$gte':moment(_0x50f2e6[0x1])[_0x02af('0x87')](_0x02af('0xa8'))};_0x5a180b[_0x02af('0x45')]=_[_0x02af('0x49')](_0x5a180b[_0x02af('0x45')],_0x4fe7dd);}_0x5a180b=_[_0x02af('0x49')]({},_0x5a180b,_0x55ba80[_0x02af('0x4b')]);return db['ChatMessage'][_0x02af('0x29')]({'where':_0x5a180b[_0x02af('0x45')]})[_0x02af('0x1b')](function(_0x2feb61){_0x544ca9['count']=_0x2feb61;if(_0x55ba80[_0x02af('0x38')][_0x02af('0x55')]){_0x5a180b[_0x02af('0x4c')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x5a180b);})['then'](function(_0x56fa81){_0x544ca9[_0x02af('0x61')]=_0x56fa81;return _0x544ca9;});}})['then'](respondWithFilteredResult(_0x410cd6,_0x5a180b))[_0x02af('0x62')](handleError(_0x410cd6,null));};exports[_0x02af('0xa9')]=function(_0x2df987,_0xe0f9ea,_0x4034eb){var _0x362742={'where':{}},_0x1b608b={},_0x252626={'count':0x0,'rows':[]};return db[_0x02af('0x34')][_0x02af('0x7d')]({'where':{'id':_0x2df987[_0x02af('0x64')]['id']}})[_0x02af('0x1b')](handleEntityNotFound(_0xe0f9ea,null))['then'](function(_0x1d1df4){if(_0x1d1df4){_0x1b608b[_0x02af('0x36')]=_[_0x02af('0x37')](db[_0x02af('0x52')][_0x02af('0x35')]);_0x1b608b['query']=_['keys'](_0x2df987[_0x02af('0x38')]);_0x1b608b[_0x02af('0x3b')]=_[_0x02af('0x3c')](_0x1b608b[_0x02af('0x36')],_0x1b608b[_0x02af('0x38')]);_0x362742['attributes']=_[_0x02af('0x3c')](_0x1b608b[_0x02af('0x36')],qs['fields'](_0x2df987['query'][_0x02af('0x3e')]));_0x362742[_0x02af('0x3d')]=_0x362742[_0x02af('0x3d')][_0x02af('0x3f')]?_0x362742[_0x02af('0x3d')]:_0x1b608b['model'];if(!_0x2df987[_0x02af('0x38')]['hasOwnProperty'](_0x02af('0x41'))){_0x362742[_0x02af('0x42')]=qs['limit'](_0x2df987[_0x02af('0x38')][_0x02af('0x42')]);_0x362742[_0x02af('0x2a')]=qs[_0x02af('0x2a')](_0x2df987[_0x02af('0x38')][_0x02af('0x2a')]);}_0x362742[_0x02af('0x43')]=qs[_0x02af('0x44')](_0x2df987[_0x02af('0x38')]['sort']);_0x362742[_0x02af('0x45')]=qs[_0x02af('0x3b')](_['pick'](_0x2df987[_0x02af('0x38')],_0x1b608b[_0x02af('0x3b')]));_0x362742[_0x02af('0x45')][_0x02af('0xa5')]=_0x1d1df4['id'];if(_0x2df987['query'][_0x02af('0x4a')]){_0x362742[_0x02af('0x45')]=_[_0x02af('0x49')](_0x362742[_0x02af('0x45')],{'$or':_[_0x02af('0xaa')](_0x362742[_0x02af('0x3d')],function(_0x1e184e){var _0x473f1f={};_0x473f1f[_0x1e184e]={'$like':'%'+_0x2df987[_0x02af('0x38')][_0x02af('0x4a')]+'%'};return _0x473f1f;})});}_0x362742[_0x02af('0x45')][_0x02af('0x91')]=![];if(_0x2df987['query']['id']){_0x362742[_0x02af('0x45')]['id']={'$gt':_0x2df987[_0x02af('0x38')]['id']};}_0x362742=_[_0x02af('0x49')]({},_0x362742,_0x2df987[_0x02af('0x4b')]);return db[_0x02af('0x52')][_0x02af('0x29')]({'where':_0x362742[_0x02af('0x45')]})['then'](function(_0x8edb79){_0x252626['count']=_0x8edb79;_0x362742[_0x02af('0x4c')]=[];if(_0x2df987['query'][_0x02af('0xab')]){_0x362742[_0x02af('0x4c')][_0x02af('0x4e')]({'model':db[_0x02af('0x56')],'as':'User','attributes':['id',_0x02af('0x57'),_0x02af('0xac')]});}if(_0x2df987[_0x02af('0x38')][_0x02af('0x55')]){_0x362742[_0x02af('0x4c')]=[{'all':!![]}];}return db['ChatMessage'][_0x02af('0x60')](_0x362742);})[_0x02af('0x1b')](function(_0x4c0217){_0x252626[_0x02af('0x61')]=_0x4c0217;return _0x252626;});}})[_0x02af('0x1b')](respondWithFilteredResult(_0xe0f9ea,_0x362742))[_0x02af('0x62')](handleError(_0xe0f9ea,null));};exports[_0x02af('0xad')]=function(_0x452176,_0x5accb6,_0x4070a7){return db[_0x02af('0x34')][_0x02af('0x65')]({'where':{'id':_0x452176[_0x02af('0x64')]['id']}})[_0x02af('0x1b')](handleEntityNotFound(_0x5accb6,null))[_0x02af('0x1b')](function(_0x28803d){if(_0x28803d){return _0x28803d[_0x02af('0xae')](_0x452176['body']['ids'],_['omit'](_0x452176['body'],['ids','id'])||{})[_0x02af('0xaf')](function(){return db['Tag'][_0x02af('0x60')]({'attributes':['id','name',_0x02af('0x5f')],'where':{'id':_0x452176['body'][_0x02af('0xa3')]}});})[_0x02af('0x1b')](function(_0x866ca7){socket['emit'](_0x02af('0xb0'),{'id':Number(_0x452176[_0x02af('0x64')]['id']),'tags':_0x866ca7||[]});return{'id':Number(_0x452176[_0x02af('0x64')]['id']),'tags':_0x866ca7||[]};});}})['then'](respondWithResult(_0x5accb6,null))[_0x02af('0x62')](handleError(_0x5accb6,null));};exports[_0x02af('0xb1')]=function(_0x6f2bb5,_0x1478e5,_0x3fa61f){var _0x34b64b;return db[_0x02af('0x34')][_0x02af('0x65')]({'where':{'id':_0x6f2bb5[_0x02af('0x64')]['id']}})[_0x02af('0x1b')](handleEntityNotFound(_0x1478e5,null))[_0x02af('0x1b')](function(_0x211ac9){if(_0x211ac9){return _0x211ac9[_0x02af('0xb1')](_0x6f2bb5[_0x02af('0x38')][_0x02af('0xa3')]);}})[_0x02af('0x1b')](respondWithStatusCode(_0x1478e5,null))[_0x02af('0x62')](handleError(_0x1478e5,null));};exports[_0x02af('0xb2')]=function(_0x72be94,_0x5d64a1){var _0x46f9ae=moment()[_0x02af('0xb3')]()[_0x02af('0xb4')]();var _0xfb109=path[_0x02af('0x7e')](config[_0x02af('0x7f')],_0x02af('0xb5'),'files',_0x02af('0xb6'));var _0x5b4fef=path[_0x02af('0x7e')](config[_0x02af('0x7f')],'server',_0x02af('0xb7'),_0x02af('0xb8'));var _0x59ff92=path[_0x02af('0x7e')](_0xfb109,_0x46f9ae);var _0x348541=util[_0x02af('0x87')]('interaction-%s.zip',_0x46f9ae);var _0x7008ee=path[_0x02af('0x7e')](_0xfb109,_0x348541);var _0x940a5=![];return db[_0x02af('0x34')][_0x02af('0x65')]({'where':{'id':_0x72be94[_0x02af('0x64')]['id']},'include':[{'model':db[_0x02af('0x52')],'as':_0x02af('0x5d'),'attributes':['id','body'],'include':[{'model':db[_0x02af('0x56')],'as':_0x02af('0x56'),'attributes':['id',_0x02af('0x57')],'raw':!![]},{'model':db[_0x02af('0x58')],'as':_0x02af('0x59'),'attributes':['id','firstName'],'raw':!![]},{'model':db[_0x02af('0x7a')],'as':_0x02af('0x7a'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x5d64a1,null))['then'](function(_0x2b916c){if(_0x2b916c){_0x940a5=!![];var _0x1704b3='';var _0x1bc15b={'format':'Letter','border':_0x02af('0xb9')};fs[_0x02af('0xba')](_0x59ff92);_0x1704b3+=util[_0x02af('0x87')](_0x02af('0xbb'),_0x2b916c['id']);_0x1704b3+=util['format'](_0x02af('0xbc'),moment()[_0x02af('0x87')]('MMMM\x20Do\x20YYYY,\x20HH:mm:ss')['toString']());_0x1704b3+='<hr>';for(var _0x4aa3ee=0x1;_0x4aa3ee<_0x2b916c[_0x02af('0x5d')][_0x02af('0x3f')];_0x4aa3ee++){var _0x46a1be=_0x2b916c[_0x02af('0x5d')][_0x4aa3ee];_0x1704b3+=_0x02af('0xbd');_0x1704b3+=util[_0x02af('0x87')](_0x02af('0xbe'),_0x46a1be[_0x02af('0x56')]?_0x46a1be['User'][_0x02af('0x57')]:_0x46a1be['Contact']['firstName'],_0x46a1be[_0x02af('0x67')]);_0x1704b3+=_0x02af('0xbf');if(_0x46a1be['Attachment']){var _0xe17065=_0x46a1be[_0x02af('0x7a')];var _0xdc715e=path[_0x02af('0x7e')](_0x5b4fef,_0xe17065[_0x02af('0x76')]);if(fs[_0x02af('0xc0')](_0xdc715e)){fs[_0x02af('0xc1')](_0xdc715e)[_0x02af('0xc2')](fs[_0x02af('0xc3')](path[_0x02af('0x7e')](_0x59ff92,_0xe17065['basename'])));}}}return new BPromise(function(_0x180b31,_0x43c091){pdf['create'](_0x1704b3,_0x1bc15b)[_0x02af('0xc4')](path['join'](_0x59ff92,_0x02af('0xc5')+_0x46f9ae+_0x02af('0xc6')),function(_0x44494f,_0x10a962){if(_0x44494f)return _0x43c091(_0x44494f);_0x180b31(_0x10a962);});});}})[_0x02af('0x1b')](function(){if(_0x940a5){return new BPromise(function(_0x1d23a7,_0x5a54a7){zipdir(_0x59ff92,{'saveTo':_0x7008ee},function(_0x128991,_0x457599){if(_0x128991)return _0x5a54a7(_0x128991);return _0x1d23a7(_0x457599);});});}})['then'](function(){if(_0x940a5){return new BPromise(function(_0x53884b,_0x2f1767){rimraf(_0x59ff92,function(_0x29313b){if(_0x29313b)_0x2f1767(_0x29313b);return _0x53884b();});});}})[_0x02af('0x1b')](function(){if(_0x940a5){return _0x5d64a1[_0x02af('0xb2')](_0x7008ee,_0x348541,function(_0x3c9f92){if(_0x3c9f92){console[_0x02af('0xc7')](_0x02af('0xc8'),_0x3c9f92);}else{fs[_0x02af('0xc9')](_0x7008ee);}});}else{return _0x5d64a1[_0x02af('0x25')](0xc8);}})[_0x02af('0x62')](handleError(_0x5d64a1,null));};
\ No newline at end of file
+var _0x423c=['catch','create','body','update','describe','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Sequelize','ValidationError','Interaction\x20already\x20assigned','closed','closedAt','abandon','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','download','server/files/attachments/','close','mailTranscript','join','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatWebsiteId','CmContact','ContactId','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','[%s]\x20%s:\x20%s\x0a','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','user','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','push','alias','addTags','setTags','spread','chatInteractionTags:save','removeTags','unix','root','server','files','tmp','attachments','interaction-%s.zip','firstName','Letter','1cm','mkdirSync','<h1>Chat\x20Interaction:\x20#%d</h1>','<h2>Date:\x20%s</h2>','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','<hr>','<div\x20style=\x22border-style:\x20solid;\x20border-width:\x201px;\x20margin:\x203px;\x22>','<p\x20style=\x22margin:\x203px;\x22>%s:\x20%s</p>','</div>','createWriteStream','toFile','interaction-','log','err','html-pdf','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','localhost','./chatInteraction.socket','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','name','send','ChatInteraction','rawAttributes','model','query','dateStart','dateEnd','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','add','day','merge','map','tag','include','Tag','Tags','distinct','read','ChatMessage','Messages','direction','includeAll','User','Users','fullname','Contact','Owner','internal','ChatWebsite','Account','createdAt','color','findAll','rows','show','params','length','options','find'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x423c,0x68));var _0xc423=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x423c[_0x4d613c];return _0x301fe3;};'use strict';var pdf=require(_0xc423('0x0'));var emlformat=require(_0xc423('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc423('0x2'));var moment=require('moment');var BPromise=require(_0xc423('0x3'));var Mustache=require(_0xc423('0x4'));var util=require(_0xc423('0x5'));var path=require(_0xc423('0x6'));var sox=require(_0xc423('0x7'));var csv=require(_0xc423('0x8'));var ejs=require(_0xc423('0x9'));var fs=require('fs');var _=require(_0xc423('0xa'));var squel=require(_0xc423('0xb'));var crypto=require(_0xc423('0xc'));var jsforce=require(_0xc423('0xd'));var deskjs=require(_0xc423('0xe'));var toCsv=require(_0xc423('0x8'));var querystring=require(_0xc423('0xf'));var Papa=require(_0xc423('0x10'));var qs=require(_0xc423('0x11'));var logger=require(_0xc423('0x12'))(_0xc423('0x13'));var utils=require(_0xc423('0x14'));var config=require(_0xc423('0x15'));var db=require(_0xc423('0x16'))['db'];var socket=require('socket.io-emitter')({'host':_0xc423('0x17'),'port':0x18eb});require(_0xc423('0x18'))['register'](socket);var jayson=require(_0xc423('0x19'));var client=jayson[_0xc423('0x1a')][_0xc423('0x1b')]({'port':0x232b});var client9004=jayson[_0xc423('0x1a')][_0xc423('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x258a3a,_0x1d6b1d,_0x27cec6,_0x38867d){return new BPromise(function(_0x3223e7,_0x1b7f29){var _0x1e3562=_0x38867d||client;return _0x1e3562[_0xc423('0x1c')](_0x258a3a,_0x27cec6)[_0xc423('0x1d')](function(_0x3d6ba7){logger[_0xc423('0x1e')](_0xc423('0x1f'),_0x1d6b1d,'request\x20sent');logger[_0xc423('0x20')](_0xc423('0x21'),_0x1d6b1d,'request\x20sent',JSON[_0xc423('0x22')](_0x3d6ba7));if(_0x3d6ba7['error']){if(_0x3d6ba7[_0xc423('0x23')][_0xc423('0x24')]===0x1f4){logger[_0xc423('0x23')](_0xc423('0x1f'),_0x1d6b1d,_0x3d6ba7[_0xc423('0x23')][_0xc423('0x25')]);return _0x1b7f29(_0x3d6ba7[_0xc423('0x23')][_0xc423('0x25')]);}logger['error'](_0xc423('0x1f'),_0x1d6b1d,_0x3d6ba7[_0xc423('0x23')]['message']);return _0x3223e7(_0x3d6ba7[_0xc423('0x23')][_0xc423('0x25')]);}else{logger[_0xc423('0x1e')](_0xc423('0x1f'),_0x1d6b1d,'request\x20sent');_0x3223e7(_0x3d6ba7[_0xc423('0x26')][_0xc423('0x25')]);}})['catch'](function(_0x450749){logger[_0xc423('0x23')](_0xc423('0x1f'),_0x1d6b1d,_0x450749);_0x1b7f29(_0x450749);});});}function respondWithStatusCode(_0x482a9b,_0x3f1095){_0x3f1095=_0x3f1095||0xcc;return function(_0x26622f){if(_0x26622f){return _0x482a9b[_0xc423('0x27')](_0x3f1095);}return _0x482a9b[_0xc423('0x28')](_0x3f1095)[_0xc423('0x29')]();};}function respondWithResult(_0x55e457,_0x16a0e8){_0x16a0e8=_0x16a0e8||0xc8;return function(_0x290b2a){if(_0x290b2a){return _0x55e457[_0xc423('0x28')](_0x16a0e8)[_0xc423('0x2a')](_0x290b2a);}};}function respondWithFilteredResult(_0xae188d,_0x1e84d0){return function(_0x40f463){if(_0x40f463){var _0x3ec07b=_0x40f463[_0xc423('0x2b')],_0x271a1a=_0x1e84d0[_0xc423('0x2c')],_0x47ed96=_0x1e84d0['offset']+_0x1e84d0[_0xc423('0x2d')],_0x4b833c;if(_0x47ed96>=_0x3ec07b){_0x47ed96=_0x3ec07b;_0x4b833c=0xc8;}else{_0x4b833c=0xce;}_0xae188d[_0xc423('0x28')](_0x4b833c);return _0xae188d[_0xc423('0x2e')](_0xc423('0x2f'),_0x271a1a+'-'+_0x47ed96+'/'+_0x3ec07b)['json'](_0x40f463);}return null;};}function patchUpdates(_0x4664e6){return function(_0x4ec63f){try{jsonpatch[_0xc423('0x30')](_0x4ec63f,_0x4664e6,!![]);}catch(_0x4a1adf){return BPromise['reject'](_0x4a1adf);}return _0x4ec63f[_0xc423('0x31')]();};}function saveUpdates(_0x356a70,_0x59dc45){return function(_0x138289){if(_0x138289){return _0x138289['update'](_0x356a70)['then'](function(_0x520f52){return _0x520f52;});}return null;};}function removeEntity(_0xb2c1c8,_0x212973){return function(_0x28819c){if(_0x28819c){return _0x28819c[_0xc423('0x32')]()['then'](function(){_0xb2c1c8[_0xc423('0x28')](0xcc)[_0xc423('0x29')]();});}};}function handleEntityNotFound(_0x5944b6,_0x4246ea){return function(_0x240f0b){if(!_0x240f0b){_0x5944b6[_0xc423('0x27')](0x194);}return _0x240f0b;};}function handleError(_0x15200c,_0x4d7454){_0x4d7454=_0x4d7454||0x1f4;return function(_0x1c891b){logger[_0xc423('0x23')](_0x1c891b['stack']);if(_0x1c891b[_0xc423('0x33')]){delete _0x1c891b[_0xc423('0x33')];}_0x15200c[_0xc423('0x28')](_0x4d7454)[_0xc423('0x34')](_0x1c891b);};}exports['index']=function(_0xc87213,_0x149276){var _0x3f6763={},_0x18a597={},_0xb43357={'count':0x0,'rows':[]};var _0x44b868=db[_0xc423('0x35')][_0xc423('0x36')];_0x18a597[_0xc423('0x37')]=_['keys'](_0x44b868);var _0x3b17dc={'dateStart':_0xc87213[_0xc423('0x38')][_0xc423('0x39')],'dateEnd':_0xc87213[_0xc423('0x38')][_0xc423('0x3a')]};delete _0xc87213[_0xc423('0x38')][_0xc423('0x39')];delete _0xc87213[_0xc423('0x38')][_0xc423('0x3a')];_0x18a597[_0xc423('0x38')]=_[_0xc423('0x3b')](_0xc87213[_0xc423('0x38')]);_0x18a597['filters']=_[_0xc423('0x3c')](_0x18a597['model'],_0x18a597[_0xc423('0x38')]);_0x3f6763['attributes']=_[_0xc423('0x3c')](_0x18a597[_0xc423('0x37')],qs[_0xc423('0x3d')](_0xc87213[_0xc423('0x38')][_0xc423('0x3d')]));_0x3f6763[_0xc423('0x3e')]=_0x3f6763['attributes']['length']?_0x3f6763[_0xc423('0x3e')]:_0x18a597[_0xc423('0x37')];if(!_0xc87213[_0xc423('0x38')][_0xc423('0x3f')](_0xc423('0x40'))){_0x3f6763[_0xc423('0x2d')]=qs[_0xc423('0x2d')](_0xc87213[_0xc423('0x38')][_0xc423('0x2d')]);_0x3f6763['offset']=qs['offset'](_0xc87213['query'][_0xc423('0x2c')]);}_0x3f6763[_0xc423('0x41')]=qs[_0xc423('0x42')](_0xc87213[_0xc423('0x38')]['sort']);_0x3f6763[_0xc423('0x43')]=qs[_0xc423('0x44')](_['pick'](_0xc87213[_0xc423('0x38')],_0x18a597[_0xc423('0x44')]));if(_0x3b17dc[_0xc423('0x39')]){if(_0x3b17dc['dateEnd']){_0x3b17dc[_0xc423('0x3a')]=moment(_0x3b17dc[_0xc423('0x3a')])[_0xc423('0x45')](0x1,'day');}else{_0x3b17dc[_0xc423('0x3a')]=moment(_0x3b17dc[_0xc423('0x39')])[_0xc423('0x45')](0x1,_0xc423('0x46'));}_['merge'](_0x3f6763['where'],{'createdAt':{'$gte':_0x3b17dc['dateStart'],'$lte':_0x3b17dc['dateEnd']}});}if(_0xc87213[_0xc423('0x38')]['filter']){_0x3f6763[_0xc423('0x43')]=_[_0xc423('0x47')](_0x3f6763[_0xc423('0x43')],{'$or':_[_0xc423('0x48')](_0x3f6763[_0xc423('0x3e')],function(_0x45d2be){var _0xb49f0c={};_0xb49f0c[_0x45d2be]={'$like':'%'+_0xc87213['query']['filter']+'%'};return _0xb49f0c;})});}_0x3f6763=_[_0xc423('0x47')]({},_0x3f6763,_0xc87213['options']);var _0x3347d4={'where':_0x3f6763[_0xc423('0x43')]};_0x3347d4['include']=[];if(_0xc87213['query'][_0xc423('0x49')]){_0x3347d4[_0xc423('0x4a')]['push']({'model':db[_0xc423('0x4b')],'as':_0xc423('0x4c'),'attributes':['id'],'where':{'id':_0xc87213[_0xc423('0x38')]['tag']},'required':!![]});_0x3347d4[_0xc423('0x4d')]=!![];}if(_0xc87213['query'][_0xc423('0x4e')]){_0x3347d4['include']['push']({'model':db[_0xc423('0x4f')],'as':_0xc423('0x50'),'attributes':['id',_0xc423('0x51'),'createdAt',_0xc423('0x4e')],'where':{'direction':'in','read':_0xc87213[_0xc423('0x38')]['read']||![]},'required':!![]});_0x3347d4[_0xc423('0x4d')]=!![];}return db[_0xc423('0x35')][_0xc423('0x2b')](_0x3347d4)[_0xc423('0x1d')](function(_0x34f685){_0xb43357[_0xc423('0x2b')]=_0x34f685;if(_0xc87213['query'][_0xc423('0x52')]){_0x3f6763[_0xc423('0x4a')]=[{'model':db[_0xc423('0x53')],'as':_0xc423('0x54'),'required':![],'attributes':['id',_0xc423('0x33'),_0xc423('0x55')]},{'model':db['CmContact'],'as':_0xc423('0x56'),'required':![]},{'model':db['User'],'as':_0xc423('0x57'),'attributes':[_0xc423('0x33'),_0xc423('0x55'),_0xc423('0x58')],'required':![]},{'model':db[_0xc423('0x59')],'as':_0xc423('0x5a'),'attributes':[_0xc423('0x33'),'key'],'required':![]},{'model':db[_0xc423('0x4f')],'as':_0xc423('0x50'),'attributes':['id','direction',_0xc423('0x5b'),_0xc423('0x4e')],'where':{'direction':'in','read':_0xc87213[_0xc423('0x38')][_0xc423('0x4e')]||![]},'required':_0xc87213['query'][_0xc423('0x4e')]||![]},{'model':db[_0xc423('0x4b')],'as':_0xc423('0x4c'),'attributes':['id',_0xc423('0x33'),_0xc423('0x5c')],'required':_0xc87213[_0xc423('0x38')][_0xc423('0x49')]?!![]:![]},{'model':db[_0xc423('0x4b')],'as':'ThroughTags','attributes':['id','name','color'],'through':_0xc87213['query']['tag']?{'attributes':[],'where':{'TagId':_0xc87213[_0xc423('0x38')][_0xc423('0x49')]||undefined}}:{},'required':_0xc87213[_0xc423('0x38')][_0xc423('0x49')]?!![]:![]}];}return db[_0xc423('0x35')][_0xc423('0x5d')](_0x3f6763);})[_0xc423('0x1d')](function(_0x4f64b0){_0xb43357[_0xc423('0x5e')]=_0x4f64b0;return _0xb43357;})[_0xc423('0x1d')](respondWithFilteredResult(_0x149276,_0x3f6763))['catch'](handleError(_0x149276,null));};exports[_0xc423('0x5f')]=function(_0x357bf0,_0x8addfd){var _0x4d56c9={'raw':![],'where':{'id':_0x357bf0[_0xc423('0x60')]['id']}},_0x50e4dc={};_0x50e4dc['model']=_[_0xc423('0x3b')](db[_0xc423('0x35')]['rawAttributes']);_0x50e4dc[_0xc423('0x38')]=_[_0xc423('0x3b')](_0x357bf0['query']);_0x50e4dc[_0xc423('0x44')]=_[_0xc423('0x3c')](_0x50e4dc[_0xc423('0x37')],_0x50e4dc['query']);_0x4d56c9['attributes']=_[_0xc423('0x3c')](_0x50e4dc[_0xc423('0x37')],qs[_0xc423('0x3d')](_0x357bf0[_0xc423('0x38')]['fields']));_0x4d56c9[_0xc423('0x3e')]=_0x4d56c9[_0xc423('0x3e')][_0xc423('0x61')]?_0x4d56c9[_0xc423('0x3e')]:_0x50e4dc[_0xc423('0x37')];if(_0x357bf0[_0xc423('0x38')][_0xc423('0x52')]){_0x4d56c9[_0xc423('0x4a')]=[{'all':!![]}];}_0x4d56c9=_[_0xc423('0x47')]({},_0x4d56c9,_0x357bf0[_0xc423('0x62')]);return db['ChatInteraction'][_0xc423('0x63')](_0x4d56c9)['then'](handleEntityNotFound(_0x8addfd,null))[_0xc423('0x1d')](respondWithResult(_0x8addfd,null))[_0xc423('0x64')](handleError(_0x8addfd,null));};exports[_0xc423('0x65')]=function(_0x4e4b16,_0x567833){return db[_0xc423('0x35')]['create'](_0x4e4b16[_0xc423('0x66')],{})[_0xc423('0x1d')](respondWithResult(_0x567833,0xc9))[_0xc423('0x64')](handleError(_0x567833,null));};exports[_0xc423('0x67')]=function(_0x9ff96b,_0x18e78a){if(_0x9ff96b['body']['id']){delete _0x9ff96b[_0xc423('0x66')]['id'];}return db['ChatInteraction'][_0xc423('0x63')]({'where':{'id':_0x9ff96b[_0xc423('0x60')]['id']}})[_0xc423('0x1d')](handleEntityNotFound(_0x18e78a,null))[_0xc423('0x1d')](saveUpdates(_0x9ff96b[_0xc423('0x66')],null))['then'](respondWithResult(_0x18e78a,null))['catch'](handleError(_0x18e78a,null));};exports['destroy']=function(_0x494189,_0x55aab3){return db[_0xc423('0x35')][_0xc423('0x63')]({'where':{'id':_0x494189['params']['id']}})[_0xc423('0x1d')](handleEntityNotFound(_0x55aab3,null))[_0xc423('0x1d')](removeEntity(_0x55aab3,null))[_0xc423('0x64')](handleError(_0x55aab3,null));};exports[_0xc423('0x68')]=function(_0x603ad3,_0x165b94){return db[_0xc423('0x35')][_0xc423('0x68')]()[_0xc423('0x1d')](respondWithResult(_0x165b94,null))[_0xc423('0x64')](handleError(_0x165b94,null));};exports['customUpdate']=function(_0x47f4cc,_0x57a343){if(_0x47f4cc['body']['id']){delete _0x47f4cc[_0xc423('0x66')]['id'];}return db[_0xc423('0x35')]['find']({'where':{'id':_0x47f4cc['params']['id']}})[_0xc423('0x1d')](handleEntityNotFound(_0x57a343,null))[_0xc423('0x1d')](saveUpdates(_0x47f4cc['body'],null))[_0xc423('0x1d')](respondWithResult(_0x57a343,null))[_0xc423('0x64')](handleError(_0x57a343,null));};exports['abandon']=function(_0x116c68,_0x436976,_0x14eaf0){if(_0x116c68[_0xc423('0x66')]['id']){delete _0x116c68[_0xc423('0x66')]['id'];}return db['ChatInteraction'][_0xc423('0x63')]({'where':{'id':_0x116c68['params']['id']}})['then'](function(_0x127813){if(!_0x127813){logger[_0xc423('0x23')](_0xc423('0x69'),'abandon',0x194,_0xc423('0x6a'));_0x436976['sendStatus'](0x194);}else{if(_0x127813[_0xc423('0x6b')]){throw new db[(_0xc423('0x6c'))][(_0xc423('0x6d'))](_0xc423('0x6e'));}}return _0x127813;})['then'](function(_0x257351){if(_0x257351){return _0x257351[_0xc423('0x67')]({'closed':_0x116c68['body'][_0xc423('0x6f')],'closedAt':_0x116c68[_0xc423('0x66')][_0xc423('0x70')],'disposition':_0x116c68['body']['disposition']})[_0xc423('0x1d')](function(_0x1a3a57){return _0x1a3a57;});}})[_0xc423('0x1d')](function(_0x3f6295){return respondWithRpcPromise('AbandonInteraction',_0xc423('0x71'),_0x116c68['body'],client9004);})[_0xc423('0x1d')](respondWithResult(_0x436976,null))[_0xc423('0x64')](handleError(_0x436976,null));};exports[_0xc423('0x72')]=function(_0x2a9916,_0x2ad3f6,_0x58115c){_0x2a9916[_0xc423('0x66')]['name']=_0x2a9916[_0xc423('0x73')][_0xc423('0x74')];_0x2a9916[_0xc423('0x66')][_0xc423('0x75')]=_0x2a9916['file'][_0xc423('0x76')];_0x2a9916['body']['type']=_0x2a9916[_0xc423('0x73')][_0xc423('0x77')];return db[_0xc423('0x78')][_0xc423('0x65')](_0x2a9916[_0xc423('0x66')])['then'](respondWithResult(_0x2ad3f6,0xc9))['catch'](handleError(_0x2ad3f6,null));};exports[_0xc423('0x79')]=function(_0x164ad9,_0x51fd0a,_0x2e5a4c){return db[_0xc423('0x35')][_0xc423('0x7a')]({'where':{'id':_0x164ad9[_0xc423('0x60')]['id']},'raw':!![]})[_0xc423('0x1d')](handleEntityNotFound(_0x51fd0a,null))[_0xc423('0x1d')](function(_0x2b66dd){if(_0x2b66dd){if(_0x2b66dd[_0xc423('0x6f')]){return _0x51fd0a[_0xc423('0x28')](0x193)[_0xc423('0x2a')]({'status':0x193,'message':_0xc423('0x7b')});}return db['Attachment'][_0xc423('0x7a')]({'where':{'id':_0x164ad9[_0xc423('0x38')][_0xc423('0x7c')]},'raw':!![]})[_0xc423('0x1d')](handleEntityNotFound(_0x51fd0a,null));}})[_0xc423('0x1d')](function(_0x36eb07){if(_0x36eb07){return _0x51fd0a[_0xc423('0x7d')](path['join'](config['root'],_0xc423('0x7e'),_0x36eb07[_0xc423('0x75')]));}})['catch'](handleError(_0x51fd0a,null));};exports[_0xc423('0x7f')]=function(_0x122edc,_0x251566){var _0xad4040=null;var _0x63c1a6=null;var _0x532135=null;var _0x1144e9=null;if(_0x122edc[_0xc423('0x66')]['id']){delete _0x122edc['body']['id'];}if(_0x122edc[_0xc423('0x66')][_0xc423('0x80')]){_0x1144e9=path[_0xc423('0x81')](config['root'],_0xc423('0x82'),util[_0xc423('0x83')](_0xc423('0x84'),Date[_0xc423('0x85')]()));_0x122edc[_0xc423('0x66')][_0xc423('0x86')]=_0x1144e9;}return db[_0xc423('0x35')]['find']({'where':{'id':_0x122edc[_0xc423('0x60')]['id']},'include':[{'model':db[_0xc423('0x4f')],'as':_0xc423('0x50'),'include':[{'model':db[_0xc423('0x53')],'as':'User'}]}]})[_0xc423('0x1d')](handleEntityNotFound(_0x251566,null))[_0xc423('0x1d')](saveUpdates(_0x122edc[_0xc423('0x66')],null))['then'](function(_0xed730e){if(_0xed730e){_0xad4040=_0xed730e;return db[_0xc423('0x59')][_0xc423('0x63')]({'where':{'id':_0xad4040[_0xc423('0x87')]}});}})[_0xc423('0x1d')](function(_0x545a4e){if(_0x545a4e){_0x532135=_0x545a4e;return db[_0xc423('0x88')][_0xc423('0x63')]({'where':{'id':_0xad4040[_0xc423('0x89')]}});}})[_0xc423('0x1d')](function(_0x4ce2bc){if(_0x4ce2bc){_0x63c1a6=_0x4ce2bc;if(_0x1144e9){var _0x49d521=null;for(var _0x1adcb6=0x1;_0x1adcb6<_0xad4040[_0xc423('0x50')][_0xc423('0x61')];++_0x1adcb6){_0x49d521=_0xad4040[_0xc423('0x50')][_0x1adcb6];var _0x50c8d9=_0x49d521[_0xc423('0x6b')]?util[_0xc423('0x83')](_0xc423('0x8a'),_0x532135[_0xc423('0x8b')],_0x49d521[_0xc423('0x6b')]):'System';var _0x122532=_0x122edc['body'][_0xc423('0x8c')]||util['format'](_0xc423('0x8a'),_0xc423('0x8d'),_0x49d521[_0xc423('0x89')]);switch(_0x532135[_0xc423('0x8e')]){case _0xc423('0x8f'):_0x50c8d9=_0x49d521[_0xc423('0x6b')]?util[_0xc423('0x83')](_0xc423('0x8a'),_0x532135[_0xc423('0x8b')],_0x49d521['UserId']):'System';break;case'agent_alias':_0x50c8d9=_0x49d521['UserId']?_0x49d521[_0xc423('0x53')]['alias']||_0x49d521[_0xc423('0x53')]['fullname']:_0xc423('0x90');break;case'agent_fullname':_0x50c8d9=_0x49d521['UserId']?_0x49d521['User'][_0xc423('0x55')]:_0xc423('0x90');break;default:_0x50c8d9=_0x49d521[_0xc423('0x6b')]?util[_0xc423('0x83')](_0xc423('0x8a'),_0x532135[_0xc423('0x8b')],_0x49d521[_0xc423('0x6b')]):_0xc423('0x90');}var _0x360c11=util[_0xc423('0x83')](_0xc423('0x91'),moment(_0x49d521[_0xc423('0x5b')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x49d521[_0xc423('0x51')]==='in'?_0x122532:_0x50c8d9,_0x49d521[_0xc423('0x66')]);if(!_0x49d521[_0xc423('0x92')]){fs['appendFileSync'](_0x1144e9,_0x360c11);}}return db[_0xc423('0x93')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xc423('0x94')],'as':'Smtp','raw':!![]}]});}}})[_0xc423('0x1d')](function(_0x208d9f){if(_0x208d9f&&_0x208d9f[_0xc423('0x95')]&&_0x122edc[_0xc423('0x66')]){var _0x296a9b={'tls':{'rejectUnauthorized':![]}};if(_0x208d9f['Smtp'][_0xc423('0x96')]){_0x296a9b['service']=_0x208d9f['Smtp'][_0xc423('0x96')];}else{_0x296a9b[_0xc423('0x97')]=_0x208d9f[_0xc423('0x95')][_0xc423('0x97')];_0x296a9b[_0xc423('0x98')]=_0x208d9f['Smtp'][_0xc423('0x98')];_0x296a9b[_0xc423('0x99')]=_0x208d9f['Smtp'][_0xc423('0x99')];}if(_0x208d9f['Smtp'][_0xc423('0x9a')]){_0x296a9b['auth']={'user':_0x208d9f[_0xc423('0x95')]['user'],'pass':_0x208d9f[_0xc423('0x95')][_0xc423('0x9b')]};}return respondWithRpcPromise(_0xc423('0x9c'),_0xc423('0x9d'),{'account':_0x296a9b,'message':{'from':util[_0xc423('0x83')](_0xc423('0x9e'),_0x208d9f[_0xc423('0x33')],_0x208d9f[_0xc423('0x9f')]||_0x208d9f[_0xc423('0x95')][_0xc423('0xa0')]),'to':_0x122edc['body'][_0xc423('0x80')],'subject':_0xc423('0xa1'),'text':util[_0xc423('0x83')](_0xc423('0xa2'),_0x122edc[_0xc423('0x66')][_0xc423('0x80')]),'attachments':[{'path':_0x1144e9}]}})[_0xc423('0x1d')](function(){return _0xad4040;})['catch'](function(_0x417964){console[_0xc423('0x23')](_0x417964);});}else{return _0xad4040;}})['then'](respondWithStatusCode(_0x251566,0xc8))['catch'](handleError(_0x251566,null));};exports[_0xc423('0xa3')]=function(_0xbb1291,_0x3ecbed,_0x51a2ba){return db[_0xc423('0x4f')][_0xc423('0x63')]({'where':{'id':_0xbb1291[_0xc423('0x60')]['id']}})['then'](handleEntityNotFound(_0x3ecbed,null))[_0xc423('0x1d')](function(_0x4d7437){if(_0x4d7437){return _0x4d7437['addMessage'](_0xbb1291[_0xc423('0x66')][_0xc423('0xa4')],_[_0xc423('0xa5')](_0xbb1291['body'],['ids','id'])||{});}})[_0xc423('0x1d')](respondWithResult(_0x3ecbed,null))[_0xc423('0x64')](handleError(_0x3ecbed,null));};exports[_0xc423('0xa6')]=function(_0x4b0630,_0x4f1b8e,_0x468d32){var _0x2aa667={'raw':![],'where':{}};var _0x335e6f={};var _0x2ba845={'count':0x0,'rows':[]};return db[_0xc423('0x35')]['findOne']({'where':{'id':_0x4b0630[_0xc423('0x60')]['id']}})[_0xc423('0x1d')](handleEntityNotFound(_0x4f1b8e,null))['then'](function(_0x5e90d2){if(_0x5e90d2){_0x335e6f[_0xc423('0x37')]=_[_0xc423('0x3b')](db[_0xc423('0x4f')][_0xc423('0x36')]);_0x335e6f['query']=_['keys'](_0x4b0630[_0xc423('0x38')]);_0x335e6f['filters']=_[_0xc423('0x3c')](_0x335e6f[_0xc423('0x37')],_0x335e6f[_0xc423('0x38')]);_0x2aa667[_0xc423('0x3e')]=_[_0xc423('0x3c')](_0x335e6f[_0xc423('0x37')],qs[_0xc423('0x3d')](_0x4b0630['query'][_0xc423('0x3d')]));_0x2aa667['attributes']=_0x2aa667[_0xc423('0x3e')][_0xc423('0x61')]?_0x2aa667['attributes']:_0x335e6f[_0xc423('0x37')];if(!_0x4b0630['query'][_0xc423('0x3f')](_0xc423('0x40'))){_0x2aa667[_0xc423('0x2d')]=qs['limit'](_0x4b0630['query'][_0xc423('0x2d')]);_0x2aa667[_0xc423('0x2c')]=qs[_0xc423('0x2c')](_0x4b0630[_0xc423('0x38')][_0xc423('0x2c')]);}_0x2aa667[_0xc423('0x41')]=qs[_0xc423('0x42')](_0x4b0630[_0xc423('0x38')]['sort']);_0x2aa667[_0xc423('0x43')]=qs[_0xc423('0x44')](_[_0xc423('0xa7')](_0x4b0630[_0xc423('0x38')],_0x335e6f[_0xc423('0x44')]));_0x2aa667['where'][_0xc423('0xa8')]=_0x5e90d2['id'];if(_0x4b0630[_0xc423('0x38')][_0xc423('0xa9')]){_0x2aa667[_0xc423('0x43')]=_[_0xc423('0x47')](_0x2aa667['where'],{'$or':_[_0xc423('0x48')](_0x2aa667[_0xc423('0x3e')],function(_0xc7f7a2){var _0x20332e={};_0x20332e[_0xc7f7a2]={'$like':'%'+_0x4b0630[_0xc423('0x38')]['filter']+'%'};return _0x20332e;})});}if(_0x4b0630[_0xc423('0x38')][_0xc423('0xaa')]){var _0x5509bc=_0x4b0630['query'][_0xc423('0xaa')][_0xc423('0xab')](',');var _0x18cfa0={};_0x18cfa0[_0x5509bc[0x0]]={'$gte':moment(_0x5509bc[0x1])['format'](_0xc423('0xac'))};_0x2aa667[_0xc423('0x43')]=_['merge'](_0x2aa667[_0xc423('0x43')],_0x18cfa0);}_0x2aa667=_['merge']({},_0x2aa667,_0x4b0630[_0xc423('0x62')]);return db[_0xc423('0x4f')][_0xc423('0x2b')]({'where':_0x2aa667[_0xc423('0x43')]})['then'](function(_0x14c5df){_0x2ba845[_0xc423('0x2b')]=_0x14c5df;if(_0x4b0630[_0xc423('0x38')][_0xc423('0x52')]){_0x2aa667[_0xc423('0x4a')]=[{'all':!![]}];}return db[_0xc423('0x4f')][_0xc423('0x5d')](_0x2aa667);})[_0xc423('0x1d')](function(_0x789653){_0x2ba845[_0xc423('0x5e')]=_0x789653;return _0x2ba845;});}})[_0xc423('0x1d')](respondWithFilteredResult(_0x4f1b8e,_0x2aa667))[_0xc423('0x64')](handleError(_0x4f1b8e,null));};exports[_0xc423('0xad')]=function(_0x3a42d9,_0x5d0781,_0xe0af58){var _0x3b96c0={'where':{}},_0x2647fd={},_0x3c5498={'count':0x0,'rows':[]};return db[_0xc423('0x35')][_0xc423('0x7a')]({'where':{'id':_0x3a42d9[_0xc423('0x60')]['id']}})[_0xc423('0x1d')](handleEntityNotFound(_0x5d0781,null))[_0xc423('0x1d')](function(_0xe6eb96){if(_0xe6eb96){_0x2647fd[_0xc423('0x37')]=_['keys'](db[_0xc423('0x4f')]['rawAttributes']);_0x2647fd[_0xc423('0x38')]=_['keys'](_0x3a42d9[_0xc423('0x38')]);_0x2647fd[_0xc423('0x44')]=_[_0xc423('0x3c')](_0x2647fd[_0xc423('0x37')],_0x2647fd[_0xc423('0x38')]);_0x3b96c0['attributes']=_['intersection'](_0x2647fd[_0xc423('0x37')],qs[_0xc423('0x3d')](_0x3a42d9['query'][_0xc423('0x3d')]));_0x3b96c0[_0xc423('0x3e')]=_0x3b96c0['attributes'][_0xc423('0x61')]?_0x3b96c0[_0xc423('0x3e')]:_0x2647fd[_0xc423('0x37')];if(!_0x3a42d9[_0xc423('0x38')]['hasOwnProperty'](_0xc423('0x40'))){_0x3b96c0[_0xc423('0x2d')]=qs[_0xc423('0x2d')](_0x3a42d9['query'][_0xc423('0x2d')]);_0x3b96c0['offset']=qs[_0xc423('0x2c')](_0x3a42d9[_0xc423('0x38')]['offset']);}_0x3b96c0[_0xc423('0x41')]=qs[_0xc423('0x42')](_0x3a42d9['query'][_0xc423('0x42')]);_0x3b96c0[_0xc423('0x43')]=qs[_0xc423('0x44')](_[_0xc423('0xa7')](_0x3a42d9['query'],_0x2647fd[_0xc423('0x44')]));_0x3b96c0[_0xc423('0x43')][_0xc423('0xa8')]=_0xe6eb96['id'];if(_0x3a42d9[_0xc423('0x38')][_0xc423('0xa9')]){_0x3b96c0[_0xc423('0x43')]=_[_0xc423('0x47')](_0x3b96c0['where'],{'$or':_[_0xc423('0x48')](_0x3b96c0[_0xc423('0x3e')],function(_0x2dea13){var _0x26ac2c={};_0x26ac2c[_0x2dea13]={'$like':'%'+_0x3a42d9[_0xc423('0x38')][_0xc423('0xa9')]+'%'};return _0x26ac2c;})});}_0x3b96c0[_0xc423('0x43')][_0xc423('0x92')]=![];if(_0x3a42d9[_0xc423('0x38')]['id']){_0x3b96c0[_0xc423('0x43')]['id']={'$gt':_0x3a42d9[_0xc423('0x38')]['id']};}_0x3b96c0=_[_0xc423('0x47')]({},_0x3b96c0,_0x3a42d9[_0xc423('0x62')]);return db[_0xc423('0x4f')][_0xc423('0x2b')]({'where':_0x3b96c0[_0xc423('0x43')]})['then'](function(_0x5393c0){_0x3c5498[_0xc423('0x2b')]=_0x5393c0;_0x3b96c0[_0xc423('0x4a')]=[];if(_0x3a42d9[_0xc423('0x38')]['includeAgent']){_0x3b96c0[_0xc423('0x4a')][_0xc423('0xae')]({'model':db['User'],'as':_0xc423('0x53'),'attributes':['id',_0xc423('0x55'),_0xc423('0xaf')]});}if(_0x3a42d9[_0xc423('0x38')][_0xc423('0x52')]){_0x3b96c0[_0xc423('0x4a')]=[{'all':!![]}];}return db['ChatMessage'][_0xc423('0x5d')](_0x3b96c0);})[_0xc423('0x1d')](function(_0x1880cb){_0x3c5498[_0xc423('0x5e')]=_0x1880cb;return _0x3c5498;});}})[_0xc423('0x1d')](respondWithFilteredResult(_0x5d0781,_0x3b96c0))[_0xc423('0x64')](handleError(_0x5d0781,null));};exports[_0xc423('0xb0')]=function(_0x3a798e,_0x1a4e14,_0x48f887){return db['ChatInteraction'][_0xc423('0x63')]({'where':{'id':_0x3a798e[_0xc423('0x60')]['id']}})[_0xc423('0x1d')](handleEntityNotFound(_0x1a4e14,null))[_0xc423('0x1d')](function(_0x1b07d0){if(_0x1b07d0){return _0x1b07d0[_0xc423('0xb1')](_0x3a798e[_0xc423('0x66')][_0xc423('0xa4')],_[_0xc423('0xa5')](_0x3a798e[_0xc423('0x66')],[_0xc423('0xa4'),'id'])||{})[_0xc423('0xb2')](function(){return db[_0xc423('0x4b')]['findAll']({'attributes':['id',_0xc423('0x33'),_0xc423('0x5c')],'where':{'id':_0x3a798e[_0xc423('0x66')][_0xc423('0xa4')]}});})['then'](function(_0x7397c4){socket['emit'](_0xc423('0xb3'),{'id':Number(_0x3a798e[_0xc423('0x60')]['id']),'tags':_0x7397c4||[]});return{'id':Number(_0x3a798e[_0xc423('0x60')]['id']),'tags':_0x7397c4||[]};});}})[_0xc423('0x1d')](respondWithResult(_0x1a4e14,null))[_0xc423('0x64')](handleError(_0x1a4e14,null));};exports[_0xc423('0xb4')]=function(_0x14799e,_0x4254b0,_0x544c1b){var _0x44d0d7;return db['ChatInteraction'][_0xc423('0x63')]({'where':{'id':_0x14799e[_0xc423('0x60')]['id']}})[_0xc423('0x1d')](handleEntityNotFound(_0x4254b0,null))[_0xc423('0x1d')](function(_0x4e056c){if(_0x4e056c){return _0x4e056c[_0xc423('0xb4')](_0x14799e[_0xc423('0x38')]['ids']);}})[_0xc423('0x1d')](respondWithStatusCode(_0x4254b0,null))['catch'](handleError(_0x4254b0,null));};exports[_0xc423('0x7d')]=function(_0x280828,_0x3c827f){var _0x54e51d=moment()[_0xc423('0xb5')]()['toString']();var _0x156a74=path[_0xc423('0x81')](config[_0xc423('0xb6')],_0xc423('0xb7'),_0xc423('0xb8'),_0xc423('0xb9'));var _0x495648=path[_0xc423('0x81')](config[_0xc423('0xb6')],_0xc423('0xb7'),_0xc423('0xb8'),_0xc423('0xba'));var _0x1946cf=path[_0xc423('0x81')](_0x156a74,_0x54e51d);var _0x8dcf50=util[_0xc423('0x83')](_0xc423('0xbb'),_0x54e51d);var _0x5c49f8=path['join'](_0x156a74,_0x8dcf50);var _0x5477cf=![];return db['ChatInteraction']['find']({'where':{'id':_0x280828[_0xc423('0x60')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xc423('0x50'),'attributes':['id',_0xc423('0x66')],'include':[{'model':db[_0xc423('0x53')],'as':_0xc423('0x53'),'attributes':['id',_0xc423('0x55')],'raw':!![]},{'model':db[_0xc423('0x88')],'as':_0xc423('0x56'),'attributes':['id',_0xc423('0xbc')],'raw':!![]},{'model':db[_0xc423('0x78')],'as':_0xc423('0x78'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3c827f,null))[_0xc423('0x1d')](function(_0x871e3){if(_0x871e3){_0x5477cf=!![];var _0x665967='';var _0x58b33f={'format':_0xc423('0xbd'),'border':_0xc423('0xbe')};fs[_0xc423('0xbf')](_0x1946cf);_0x665967+=util['format'](_0xc423('0xc0'),_0x871e3['id']);_0x665967+=util['format'](_0xc423('0xc1'),moment()['format'](_0xc423('0xc2'))['toString']());_0x665967+=_0xc423('0xc3');for(var _0x45e646=0x1;_0x45e646<_0x871e3[_0xc423('0x50')][_0xc423('0x61')];_0x45e646++){var _0x497077=_0x871e3['Messages'][_0x45e646];_0x665967+=_0xc423('0xc4');_0x665967+=util[_0xc423('0x83')](_0xc423('0xc5'),_0x497077[_0xc423('0x53')]?_0x497077['User'][_0xc423('0x55')]:_0x497077[_0xc423('0x56')][_0xc423('0xbc')],_0x497077[_0xc423('0x66')]);_0x665967+=_0xc423('0xc6');if(_0x497077['Attachment']){var _0x30ea24=_0x497077[_0xc423('0x78')];var _0x2a270c=path['join'](_0x495648,_0x30ea24[_0xc423('0x75')]);if(fs['existsSync'](_0x2a270c)){fs['createReadStream'](_0x2a270c)['pipe'](fs[_0xc423('0xc7')](path[_0xc423('0x81')](_0x1946cf,_0x30ea24[_0xc423('0x75')])));}}}return new BPromise(function(_0x4d2f18,_0x124fb8){pdf[_0xc423('0x65')](_0x665967,_0x58b33f)[_0xc423('0xc8')](path['join'](_0x1946cf,_0xc423('0xc9')+_0x54e51d+'.pdf'),function(_0x36c3d9,_0x5a1d49){if(_0x36c3d9)return _0x124fb8(_0x36c3d9);_0x4d2f18(_0x5a1d49);});});}})['then'](function(){if(_0x5477cf){return new BPromise(function(_0x254e96,_0x255522){zipdir(_0x1946cf,{'saveTo':_0x5c49f8},function(_0x2c538d,_0x44bc9c){if(_0x2c538d)return _0x255522(_0x2c538d);return _0x254e96(_0x44bc9c);});});}})[_0xc423('0x1d')](function(){if(_0x5477cf){return new BPromise(function(_0x3677af,_0x27be77){rimraf(_0x1946cf,function(_0x1031d2){if(_0x1031d2)_0x27be77(_0x1031d2);return _0x3677af();});});}})['then'](function(){if(_0x5477cf){return _0x3c827f['download'](_0x5c49f8,_0x8dcf50,function(_0x1bc7e0){if(_0x1bc7e0){console[_0xc423('0xca')](_0xc423('0xcb'),_0x1bc7e0);}else{fs['unlinkSync'](_0x5c49f8);}});}else{return _0x3c827f[_0xc423('0x27')](0xc8);}})[_0xc423('0x64')](handleError(_0x3c827f,null));};
\ No newline at end of file
index 67df044..c91c841 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c9c=['../../mysqldb','ChatInteraction','save','update','remove','emit','hook','exports','events'];(function(_0x5eba51,_0x36169d){var _0x5f5b81=function(_0x51e3d5){while(--_0x51e3d5){_0x5eba51['push'](_0x5eba51['shift']());}};_0x5f5b81(++_0x36169d);}(_0x1c9c,0xc5));var _0xc1c9=function(_0x4b2494,_0x494d41){_0x4b2494=_0x4b2494-0x0;var _0x2c1436=_0x1c9c[_0x4b2494];return _0x2c1436;};'use strict';var EventEmitter=require(_0xc1c9('0x0'));var ChatInteraction=require(_0xc1c9('0x1'))['db'][_0xc1c9('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc1c9('0x3'),'afterUpdate':_0xc1c9('0x4'),'afterDestroy':_0xc1c9('0x5')};function emitEvent(_0x2e0d58){return function(_0x2ca3bb,_0x5e611f,_0x55da85){ChatInteractionEvents[_0xc1c9('0x6')](_0x2e0d58+':'+_0x2ca3bb['id'],_0x2ca3bb);ChatInteractionEvents[_0xc1c9('0x6')](_0x2e0d58,_0x2ca3bb);_0x55da85(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xc1c9('0x7')](e,emitEvent(event));}}module[_0xc1c9('0x8')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x4229=['remove','emit','hasOwnProperty','exports','events','ChatInteraction','setMaxListeners','save'];(function(_0x4a735a,_0x547301){var _0x58fac6=function(_0x440e15){while(--_0x440e15){_0x4a735a['push'](_0x4a735a['shift']());}};_0x58fac6(++_0x547301);}(_0x4229,0x11c));var _0x9422=function(_0xe85679,_0x483fdd){_0xe85679=_0xe85679-0x0;var _0xc5ff82=_0x4229[_0xe85679];return _0xc5ff82;};'use strict';var EventEmitter=require(_0x9422('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x9422('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x9422('0x2')](0x0);var events={'afterCreate':_0x9422('0x3'),'afterUpdate':'update','afterDestroy':_0x9422('0x4')};function emitEvent(_0x1387ab){return function(_0xde811a,_0xf22fe3,_0x4ac2d3){ChatInteractionEvents[_0x9422('0x5')](_0x1387ab+':'+_0xde811a['id'],_0xde811a);ChatInteractionEvents['emit'](_0x1387ab,_0xde811a);_0x4ac2d3(null);};}for(var e in events){if(events[_0x9422('0x6')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x9422('0x7')]=ChatInteractionEvents;
\ No newline at end of file
index 5d4acc8..ecac4ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5de9=['util','../../config/logger','api','bluebird','request-promise','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','utf8mb4_unicode_ci'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5de9,0x1d9));var _0x95de=function(_0x4394b6,_0x12357f){_0x4394b6=_0x4394b6-0x0;var _0x360244=_0x5de9[_0x4394b6];return _0x360244;};'use strict';var _=require('lodash');var util=require(_0x95de('0x0'));var logger=require(_0x95de('0x1'))(_0x95de('0x2'));var moment=require('moment');var BPromise=require(_0x95de('0x3'));var rp=require(_0x95de('0x4'));var attributes=require(_0x95de('0x5'));module[_0x95de('0x6')]=function(_0x561d33,_0x2411db){return _0x561d33[_0x95de('0x7')](_0x95de('0x8'),attributes,{'tableName':_0x95de('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x95de('0xa')});};
\ No newline at end of file
+var _0xa5d0=['chat_interactions','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','./chatInteraction.attributes','define','ChatInteraction'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xa5d0,0x1cb));var _0x0a5d=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa5d0[_0x4709c0];return _0x13348b;};'use strict';var _=require('lodash');var util=require(_0x0a5d('0x0'));var logger=require(_0x0a5d('0x1'))(_0x0a5d('0x2'));var moment=require(_0x0a5d('0x3'));var BPromise=require(_0x0a5d('0x4'));var rp=require(_0x0a5d('0x5'));var attributes=require(_0x0a5d('0x6'));module['exports']=function(_0x55b6e7,_0x1c4324){return _0x55b6e7[_0x0a5d('0x7')](_0x0a5d('0x8'),attributes,{'tableName':_0x0a5d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0a5d('0xa'),'collate':_0x0a5d('0xb')});};
\ No newline at end of file
index 461aef8..ea03a27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5e4=['localhost','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateChatInteraction','update','options','raw','where','attributes','limit','then','debug','AddTagsToChatInteraction','ChatInteraction','addTags','body','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter'];(function(_0x37d0bf,_0x37fc66){var _0x18f12b=function(_0x597e4d){while(--_0x597e4d){_0x37d0bf['push'](_0x37d0bf['shift']());}};_0x18f12b(++_0x37fc66);}(_0xe5e4,0x13b));var _0x4e5e=function(_0x3a4e2f,_0x713dac){_0x3a4e2f=_0x3a4e2f-0x0;var _0x11a27d=_0xe5e4[_0x3a4e2f];return _0x11a27d;};'use strict';var _=require('lodash');var util=require(_0x4e5e('0x0'));var moment=require(_0x4e5e('0x1'));var BPromise=require(_0x4e5e('0x2'));var rs=require(_0x4e5e('0x3'));var fs=require('fs');var db=require(_0x4e5e('0x4'))['db'];var utils=require(_0x4e5e('0x5'));var logger=require(_0x4e5e('0x6'))(_0x4e5e('0x7'));var config=require(_0x4e5e('0x8'));var jayson=require(_0x4e5e('0x9'));var client=jayson[_0x4e5e('0xa')][_0x4e5e('0xb')]({'port':0x232a});var socket=require(_0x4e5e('0xc'))({'host':_0x4e5e('0xd'),'port':0x18eb});require(_0x4e5e('0xe'))[_0x4e5e('0xf')](socket);function respondWithRpcPromise(_0x4f4055,_0x3a3ccf,_0x45df35){return new BPromise(function(_0x258621,_0x3f5887){return client[_0x4e5e('0x10')](_0x4f4055,_0x45df35)['then'](function(_0x5a407a){logger[_0x4e5e('0x11')](_0x4e5e('0x12'),_0x3a3ccf,'request\x20sent');logger['debug'](_0x4e5e('0x13'),_0x3a3ccf,_0x4e5e('0x14'),JSON[_0x4e5e('0x15')](_0x5a407a));if(_0x5a407a[_0x4e5e('0x16')]){if(_0x5a407a[_0x4e5e('0x16')][_0x4e5e('0x17')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x3a3ccf,_0x5a407a['error'][_0x4e5e('0x18')]);return _0x3f5887(_0x5a407a['error'][_0x4e5e('0x18')]);}logger[_0x4e5e('0x16')](_0x4e5e('0x12'),_0x3a3ccf,_0x5a407a['error']['message']);return _0x258621(_0x5a407a[_0x4e5e('0x16')][_0x4e5e('0x18')]);}else{logger[_0x4e5e('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x3a3ccf,_0x4e5e('0x14'));_0x258621(_0x5a407a['result'][_0x4e5e('0x18')]);}})[_0x4e5e('0x19')](function(_0x497344){logger[_0x4e5e('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x3a3ccf,_0x497344);_0x3f5887(_0x497344);});});}exports[_0x4e5e('0x1a')]=function(_0x3128b9){var _0x46a5c0=this;return new Promise(function(_0x301ea7,_0x5976b3){return db['ChatInteraction'][_0x4e5e('0x1b')](_0x3128b9['body'],{'raw':_0x3128b9[_0x4e5e('0x1c')]?_0x3128b9[_0x4e5e('0x1c')][_0x4e5e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3128b9[_0x4e5e('0x1c')]?_0x3128b9[_0x4e5e('0x1c')][_0x4e5e('0x1e')]||null:null,'attributes':_0x3128b9[_0x4e5e('0x1c')]?_0x3128b9[_0x4e5e('0x1c')][_0x4e5e('0x1f')]||null:null,'limit':_0x3128b9[_0x4e5e('0x1c')]?_0x3128b9[_0x4e5e('0x1c')][_0x4e5e('0x20')]||null:null})[_0x4e5e('0x21')](function(_0x162367){logger['info'](_0x4e5e('0x1a'),_0x3128b9);logger[_0x4e5e('0x22')](_0x4e5e('0x1a'),_0x3128b9,JSON['stringify'](_0x162367));_0x301ea7(_0x162367);})[_0x4e5e('0x19')](function(_0x310421){logger['error'](_0x4e5e('0x1a'),_0x310421[_0x4e5e('0x18')],_0x3128b9);_0x5976b3(_0x46a5c0['error'](0x1f4,_0x310421[_0x4e5e('0x18')]));});});};exports[_0x4e5e('0x23')]=function(_0x1fee00){return new Promise(function(_0x1dc922,_0x348c37){return db[_0x4e5e('0x24')]['find']({'where':_0x1fee00[_0x4e5e('0x1c')]?_0x1fee00[_0x4e5e('0x1c')]['where']||null:null})[_0x4e5e('0x21')](function(_0x355d37){if(_0x355d37){return _0x355d37[_0x4e5e('0x25')](_0x1fee00[_0x4e5e('0x26')]['ids'],_['omit'](_0x1fee00[_0x4e5e('0x26')],['ids','id'])||{});}})[_0x4e5e('0x27')](function(_0x4e0393){logger[_0x4e5e('0x11')]('AddTags',_0x1fee00);logger[_0x4e5e('0x22')](_0x4e5e('0x28'),_0x1fee00,JSON[_0x4e5e('0x15')](_0x4e0393));_0x1dc922(_0x4e0393);})[_0x4e5e('0x19')](function(_0x4e8363){logger[_0x4e5e('0x16')](_0x4e5e('0x28'),_0x4e8363[_0x4e5e('0x18')],_0x1fee00);_0x348c37(_this[_0x4e5e('0x16')](0x1f4,_0x4e8363[_0x4e5e('0x18')]));});});};
\ No newline at end of file
+var _0x1167=['register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','AddTagsToChatInteraction','find','addTags','ids','spread','AddTags','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','socket.io-emitter','localhost','./chatInteraction.socket'];(function(_0xd0b5c6,_0x9789c7){var _0x38e4a9=function(_0x3d6584){while(--_0x3d6584){_0xd0b5c6['push'](_0xd0b5c6['shift']());}};_0x38e4a9(++_0x9789c7);}(_0x1167,0x196));var _0x7116=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x1167[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x7116('0x0'));var util=require(_0x7116('0x1'));var moment=require(_0x7116('0x2'));var BPromise=require(_0x7116('0x3'));var rs=require(_0x7116('0x4'));var fs=require('fs');var db=require(_0x7116('0x5'))['db'];var utils=require(_0x7116('0x6'));var logger=require('../../config/logger')(_0x7116('0x7'));var config=require('../../config/environment');var jayson=require(_0x7116('0x8'));var client=jayson[_0x7116('0x9')][_0x7116('0xa')]({'port':0x232a});var socket=require(_0x7116('0xb'))({'host':_0x7116('0xc'),'port':0x18eb});require(_0x7116('0xd'))[_0x7116('0xe')](socket);function respondWithRpcPromise(_0x48ac02,_0x16d89f,_0x2fc9c5){return new BPromise(function(_0x32bcfe,_0x48540b){return client[_0x7116('0xf')](_0x48ac02,_0x2fc9c5)[_0x7116('0x10')](function(_0x5729bb){logger[_0x7116('0x11')](_0x7116('0x12'),_0x16d89f,_0x7116('0x13'));logger[_0x7116('0x14')](_0x7116('0x15'),_0x16d89f,_0x7116('0x13'),JSON[_0x7116('0x16')](_0x5729bb));if(_0x5729bb[_0x7116('0x17')]){if(_0x5729bb['error'][_0x7116('0x18')]===0x1f4){logger[_0x7116('0x17')](_0x7116('0x12'),_0x16d89f,_0x5729bb[_0x7116('0x17')]['message']);return _0x48540b(_0x5729bb[_0x7116('0x17')][_0x7116('0x19')]);}logger[_0x7116('0x17')](_0x7116('0x12'),_0x16d89f,_0x5729bb[_0x7116('0x17')][_0x7116('0x19')]);return _0x32bcfe(_0x5729bb[_0x7116('0x17')][_0x7116('0x19')]);}else{logger[_0x7116('0x11')](_0x7116('0x12'),_0x16d89f,_0x7116('0x13'));_0x32bcfe(_0x5729bb[_0x7116('0x1a')]['message']);}})['catch'](function(_0x4ad897){logger[_0x7116('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x16d89f,_0x4ad897);_0x48540b(_0x4ad897);});});}exports[_0x7116('0x1b')]=function(_0x5ee3dd){var _0x396944=this;return new Promise(function(_0x1f6439,_0x44e139){return db[_0x7116('0x1c')][_0x7116('0x1d')](_0x5ee3dd[_0x7116('0x1e')],{'raw':_0x5ee3dd[_0x7116('0x1f')]?_0x5ee3dd[_0x7116('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ee3dd[_0x7116('0x1f')]?_0x5ee3dd[_0x7116('0x1f')][_0x7116('0x20')]||null:null,'attributes':_0x5ee3dd['options']?_0x5ee3dd[_0x7116('0x1f')][_0x7116('0x21')]||null:null,'limit':_0x5ee3dd[_0x7116('0x1f')]?_0x5ee3dd[_0x7116('0x1f')][_0x7116('0x22')]||null:null})[_0x7116('0x10')](function(_0x4224ef){logger[_0x7116('0x11')]('UpdateChatInteraction',_0x5ee3dd);logger[_0x7116('0x14')](_0x7116('0x1b'),_0x5ee3dd,JSON[_0x7116('0x16')](_0x4224ef));_0x1f6439(_0x4224ef);})['catch'](function(_0x30a6d2){logger[_0x7116('0x17')](_0x7116('0x1b'),_0x30a6d2[_0x7116('0x19')],_0x5ee3dd);_0x44e139(_0x396944['error'](0x1f4,_0x30a6d2[_0x7116('0x19')]));});});};exports[_0x7116('0x23')]=function(_0x14c58d){return new Promise(function(_0x3fa9f6,_0x538096){return db[_0x7116('0x1c')][_0x7116('0x24')]({'where':_0x14c58d[_0x7116('0x1f')]?_0x14c58d['options'][_0x7116('0x20')]||null:null})[_0x7116('0x10')](function(_0x2ccc05){if(_0x2ccc05){return _0x2ccc05[_0x7116('0x25')](_0x14c58d[_0x7116('0x1e')][_0x7116('0x26')],_['omit'](_0x14c58d[_0x7116('0x1e')],['ids','id'])||{});}})[_0x7116('0x27')](function(_0x531b16){logger[_0x7116('0x11')](_0x7116('0x28'),_0x14c58d);logger['debug']('AddTags',_0x14c58d,JSON['stringify'](_0x531b16));_0x3fa9f6(_0x531b16);})[_0x7116('0x29')](function(_0x4ff56b){logger['error'](_0x7116('0x28'),_0x4ff56b[_0x7116('0x19')],_0x14c58d);_0x538096(_this[_0x7116('0x17')](0x1f4,_0x4ff56b['message']));});});};
\ No newline at end of file
index ae0f1e1..86e3b8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6630=['remove','update','emit','removeListener','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x3bf278,_0x5d4aa9){var _0x4789da=function(_0x27fe4b){while(--_0x27fe4b){_0x3bf278['push'](_0x3bf278['shift']());}};_0x4789da(++_0x5d4aa9);}(_0x6630,0x76));var _0x0663=function(_0x392fc9,_0x5d7102){_0x392fc9=_0x392fc9-0x0;var _0x237e23=_0x6630[_0x392fc9];return _0x237e23;};'use strict';var ChatInteractionEvents=require(_0x0663('0x0'));var events=[_0x0663('0x1'),_0x0663('0x2'),_0x0663('0x3')];function createListener(_0x5ee3f1,_0x248ad1){return function(_0x590ad3){_0x248ad1[_0x0663('0x4')](_0x5ee3f1,_0x590ad3);};}function removeListener(_0x161c81,_0x176d75){return function(){ChatInteractionEvents[_0x0663('0x5')](_0x161c81,_0x176d75);};}exports['register']=function(_0x57a03b){for(var _0x30eb17=0x0,_0x10b54c=events[_0x0663('0x6')];_0x30eb17<_0x10b54c;_0x30eb17++){var _0x2e05e8=events[_0x30eb17];var _0xb9a30f=createListener(_0x0663('0x7')+_0x2e05e8,_0x57a03b);ChatInteractionEvents['on'](_0x2e05e8,_0xb9a30f);}};
\ No newline at end of file
+var _0x4800=['chatInteraction:','./chatInteraction.events','save','emit','register'];(function(_0x1ceb7b,_0x894d3d){var _0x57c016=function(_0x282306){while(--_0x282306){_0x1ceb7b['push'](_0x1ceb7b['shift']());}};_0x57c016(++_0x894d3d);}(_0x4800,0x1a0));var _0x0480=function(_0x1c52b3,_0x2c3ecf){_0x1c52b3=_0x1c52b3-0x0;var _0x38b25e=_0x4800[_0x1c52b3];return _0x38b25e;};'use strict';var ChatInteractionEvents=require(_0x0480('0x0'));var events=[_0x0480('0x1'),'remove','update'];function createListener(_0x484a02,_0xeb1975){return function(_0x4230d2){_0xeb1975[_0x0480('0x2')](_0x484a02,_0x4230d2);};}function removeListener(_0x546541,_0x2059e1){return function(){ChatInteractionEvents['removeListener'](_0x546541,_0x2059e1);};}exports[_0x0480('0x3')]=function(_0x3ac17c){for(var _0x451fd5=0x0,_0x108890=events['length'];_0x451fd5<_0x108890;_0x451fd5++){var _0x4cd980=events[_0x451fd5];var _0xca309=createListener(_0x0480('0x4')+_0x4cd980,_0x3ac17c);ChatInteractionEvents['on'](_0x4cd980,_0xca309);}};
\ No newline at end of file
index 47be35d..0b3917e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98d5=['tracked','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','replace','/:id/attachment_upload','single','file','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put'];(function(_0x4b9f66,_0x5b0bac){var _0xdee5f4=function(_0x56d702){while(--_0x56d702){_0x4b9f66['push'](_0x4b9f66['shift']());}};_0xdee5f4(++_0x5b0bac);}(_0x98d5,0xfb));var _0x598d=function(_0x1abb97,_0x58b9fa){_0x1abb97=_0x1abb97-0x0;var _0x121add=_0x98d5[_0x1abb97];return _0x121add;};'use strict';var multer=require(_0x598d('0x0'));var util=require('util');var path=require('path');var express=require(_0x598d('0x1'));var router=express[_0x598d('0x2')]();var auth=require(_0x598d('0x3'));var interaction=require(_0x598d('0x4'));var config=require(_0x598d('0x5'));var controller=require(_0x598d('0x6'));router[_0x598d('0x7')]('/',auth[_0x598d('0x8')](),controller['index']);router[_0x598d('0x7')]('/describe',auth[_0x598d('0x8')](),controller['describe']);router['get'](_0x598d('0x9'),auth[_0x598d('0xa')](),controller['show']);router[_0x598d('0x7')](_0x598d('0xb'),auth[_0x598d('0xa')](),controller[_0x598d('0xc')]);router[_0x598d('0x7')](_0x598d('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0x598d('0x7')](_0x598d('0xe'),auth[_0x598d('0xa')](),controller[_0x598d('0xf')]);router[_0x598d('0x7')](_0x598d('0x10'),auth[_0x598d('0x8')](),controller[_0x598d('0x11')]);router[_0x598d('0x12')]('/',auth[_0x598d('0x8')](),controller[_0x598d('0x13')]);var upload=multer({'storage':multer[_0x598d('0x14')]({'destination':function(_0x507935,_0x164abe,_0x574e1b){_0x574e1b(null,path[_0x598d('0x15')](config[_0x598d('0x16')],_0x598d('0x17')));},'filename':function(_0x18327a,_0x2032b9,_0x4b2e3a){_0x4b2e3a(null,util[_0x598d('0x18')](_0x598d('0x19'),Date['now'](),_0x2032b9[_0x598d('0x1a')][_0x598d('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x598d('0x1c'),upload[_0x598d('0x1d')](_0x598d('0x1e')),controller['attachmentUpload']);router['post'](_0x598d('0xd'),auth[_0x598d('0xa')](),controller[_0x598d('0x1f')]);router[_0x598d('0x12')](_0x598d('0x20'),auth[_0x598d('0x8')](),interaction['tracked'](_0x598d('0x21'),_0x598d('0x22')),controller[_0x598d('0x23')]);router[_0x598d('0x24')](_0x598d('0x9'),auth['isAuthenticated'](),interaction[_0x598d('0x25')](_0x598d('0x21'),'chatinteraction:update'),controller[_0x598d('0x26')]);router[_0x598d('0x24')](_0x598d('0x27'),controller[_0x598d('0x28')]);router[_0x598d('0x24')](_0x598d('0x29'),auth[_0x598d('0xa')](),controller[_0x598d('0x2a')]);router[_0x598d('0x24')](_0x598d('0x2b'),controller['close']);router[_0x598d('0x2c')](_0x598d('0x9'),auth[_0x598d('0x8')](),interaction[_0x598d('0x25')](_0x598d('0x21'),_0x598d('0x2d')),controller[_0x598d('0x2e')]);router[_0x598d('0x2c')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x598d('0x2f')]=router;
\ No newline at end of file
+var _0x5089=['isAuthenticated','getMessages','/:id/download','download','post','create','join','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','close','chatinteraction:destroy','destroy','delete','removeTags','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages'];(function(_0x4a3c1a,_0x3c5a20){var _0x579f73=function(_0x431f9c){while(--_0x431f9c){_0x4a3c1a['push'](_0x4a3c1a['shift']());}};_0x579f73(++_0x3c5a20);}(_0x5089,0x1bb));var _0x9508=function(_0xd580e2,_0x109182){_0xd580e2=_0xd580e2-0x0;var _0x4d955f=_0x5089[_0xd580e2];return _0x4d955f;};'use strict';var multer=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var path=require('path');var express=require(_0x9508('0x2'));var router=express[_0x9508('0x3')]();var auth=require(_0x9508('0x4'));var interaction=require(_0x9508('0x5'));var config=require(_0x9508('0x6'));var controller=require('./chatInteraction.controller');router[_0x9508('0x7')]('/',auth['isAuthenticated'](),controller[_0x9508('0x8')]);router[_0x9508('0x7')](_0x9508('0x9'),auth['isAuthenticated'](),controller[_0x9508('0xa')]);router[_0x9508('0x7')]('/:id',auth[_0x9508('0xb')](),controller[_0x9508('0xc')]);router['get'](_0x9508('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x9508('0xe')]);router[_0x9508('0x7')](_0x9508('0xf'),auth[_0x9508('0x10')](),controller[_0x9508('0x11')]);router[_0x9508('0x7')]('/:id/my_messages',auth[_0x9508('0xb')](),controller['getMyMessages']);router[_0x9508('0x7')](_0x9508('0x12'),auth['isAuthenticated'](),controller[_0x9508('0x13')]);router[_0x9508('0x14')]('/',auth[_0x9508('0x10')](),controller[_0x9508('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x440709,_0x21b2d1,_0x51c80b){_0x51c80b(null,path[_0x9508('0x16')](config['root'],_0x9508('0x17')));},'filename':function(_0x418889,_0x374c03,_0x255a03){_0x255a03(null,util[_0x9508('0x18')](_0x9508('0x19'),Date[_0x9508('0x1a')](),_0x374c03[_0x9508('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9508('0x14')](_0x9508('0x1c'),upload[_0x9508('0x1d')](_0x9508('0x1e')),controller[_0x9508('0x1f')]);router[_0x9508('0x14')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x9508('0x20')]);router['post'](_0x9508('0x21'),auth['isAuthenticated'](),interaction[_0x9508('0x22')](_0x9508('0x23'),_0x9508('0x24')),controller[_0x9508('0x25')]);router[_0x9508('0x26')](_0x9508('0x27'),auth[_0x9508('0x10')](),interaction['tracked']('chat',_0x9508('0x28')),controller[_0x9508('0x29')]);router[_0x9508('0x26')](_0x9508('0x2a'),controller[_0x9508('0x2b')]);router[_0x9508('0x26')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x9508('0x2c')]);router['put']('/:id/close',controller[_0x9508('0x2d')]);router['delete']('/:id',auth[_0x9508('0x10')](),interaction[_0x9508('0x22')]('chat',_0x9508('0x2e')),controller[_0x9508('0x2f')]);router[_0x9508('0x30')](_0x9508('0x21'),auth[_0x9508('0x10')](),controller[_0x9508('0x31')]);module[_0x9508('0x32')]=router;
\ No newline at end of file
index 13f4b4d..d38bbce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe944=['sequelize','medium'];(function(_0x1b223f,_0x511615){var _0x21f9c2=function(_0x138648){while(--_0x138648){_0x1b223f['push'](_0x1b223f['shift']());}};_0x21f9c2(++_0x511615);}(_0xe944,0x174));var _0x4e94=function(_0x3b1a37,_0x250506){_0x3b1a37=_0x3b1a37-0x0;var _0x59e45b=_0xe944[_0x3b1a37];return _0x59e45b;};'use strict';var Sequelize=require(_0x4e94('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x4e94('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x187d=['BOOLEAN','INTEGER','sequelize','TEXT','medium'];(function(_0x32e812,_0x184998){var _0xd86752=function(_0x5e7565){while(--_0x5e7565){_0x32e812['push'](_0x32e812['shift']());}};_0xd86752(++_0x184998);}(_0x187d,0x93));var _0xd187=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x187d[_0x1b349a];return _0x5d1f7c;};'use strict';var Sequelize=require(_0xd187('0x0'));module['exports']={'body':{'type':Sequelize[_0xd187('0x1')](_0xd187('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd187('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd187('0x4')]}};
\ No newline at end of file
index f19e820..f257c7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c56=['messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','findAll','user','fullname','role','userpic','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','type','push','FromId','read','-createdAt','all','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','localhost','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','update','then','destroy','error','name','send','index','ChatInternalMessage','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','fields','attributes','nolimit','sort','where','pick','day','add','filter','merge','options','count','includeAll','include','rows','catch','show','params','length','create','body','find','describe'];(function(_0x28f1e,_0x23a273){var _0x3bcbe9=function(_0x299bde){while(--_0x299bde){_0x28f1e['push'](_0x28f1e['shift']());}};_0x3bcbe9(++_0x23a273);}(_0x0c56,0x1e4));var _0x60c5=function(_0x52ecb9,_0x3f8376){_0x52ecb9=_0x52ecb9-0x0;var _0x16e38f=_0x0c56[_0x52ecb9];return _0x16e38f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x60c5('0x0'));var rp=require(_0x60c5('0x1'));var moment=require(_0x60c5('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x60c5('0x3'));var util=require('util');var path=require(_0x60c5('0x4'));var sox=require(_0x60c5('0x5'));var csv=require(_0x60c5('0x6'));var ejs=require(_0x60c5('0x7'));var fs=require('fs');var _=require(_0x60c5('0x8'));var squel=require('squel');var crypto=require(_0x60c5('0x9'));var jsforce=require(_0x60c5('0xa'));var deskjs=require(_0x60c5('0xb'));var toCsv=require(_0x60c5('0x6'));var querystring=require(_0x60c5('0xc'));var Papa=require(_0x60c5('0xd'));var qs=require(_0x60c5('0xe'));var logger=require(_0x60c5('0xf'))('api');var utils=require(_0x60c5('0x10'));var config=require('../../config/environment');var db=require(_0x60c5('0x11'))['db'];var socket=require('socket.io-emitter')({'host':_0x60c5('0x12'),'port':0x18eb});require('./chatInternalMessage.socket')[_0x60c5('0x13')](socket);function respondWithStatusCode(_0x469db2,_0x44fd1b){_0x44fd1b=_0x44fd1b||0xcc;return function(_0x32c5c4){if(_0x32c5c4){return _0x469db2[_0x60c5('0x14')](_0x44fd1b);}return _0x469db2[_0x60c5('0x15')](_0x44fd1b)[_0x60c5('0x16')]();};}function respondWithResult(_0x58febe,_0x468819){_0x468819=_0x468819||0xc8;return function(_0x845073){if(_0x845073){return _0x58febe[_0x60c5('0x15')](_0x468819)[_0x60c5('0x17')](_0x845073);}};}function respondWithFilteredResult(_0x35384b,_0x38ad19){return function(_0x3c3ab1){if(_0x3c3ab1){var _0x18324f=_0x3c3ab1['count'],_0x156e35=_0x38ad19['offset'],_0x53b5aa=_0x38ad19[_0x60c5('0x18')]+_0x38ad19[_0x60c5('0x19')],_0x50f9ef;if(_0x53b5aa>=_0x18324f){_0x53b5aa=_0x18324f;_0x50f9ef=0xc8;}else{_0x50f9ef=0xce;}_0x35384b[_0x60c5('0x15')](_0x50f9ef);return _0x35384b[_0x60c5('0x1a')](_0x60c5('0x1b'),_0x156e35+'-'+_0x53b5aa+'/'+_0x18324f)[_0x60c5('0x17')](_0x3c3ab1);}return null;};}function patchUpdates(_0x2dd0b9){return function(_0x370464){try{jsonpatch[_0x60c5('0x1c')](_0x370464,_0x2dd0b9,!![]);}catch(_0x170b1d){return BPromise['reject'](_0x170b1d);}return _0x370464['save']();};}function saveUpdates(_0x439895,_0x465e9f){return function(_0x4934cf){if(_0x4934cf){return _0x4934cf[_0x60c5('0x1d')](_0x439895)[_0x60c5('0x1e')](function(_0x4f2a94){return _0x4f2a94;});}return null;};}function removeEntity(_0x5be881,_0x2d8d07){return function(_0x58d589){if(_0x58d589){return _0x58d589[_0x60c5('0x1f')]()[_0x60c5('0x1e')](function(){_0x5be881[_0x60c5('0x15')](0xcc)[_0x60c5('0x16')]();});}};}function handleEntityNotFound(_0x4952d8,_0x5a41aa){return function(_0x5ef5d1){if(!_0x5ef5d1){_0x4952d8[_0x60c5('0x14')](0x194);}return _0x5ef5d1;};}function handleError(_0x333e33,_0x194856){_0x194856=_0x194856||0x1f4;return function(_0x55a7ce){logger[_0x60c5('0x20')](_0x55a7ce['stack']);if(_0x55a7ce[_0x60c5('0x21')]){delete _0x55a7ce[_0x60c5('0x21')];}_0x333e33['status'](_0x194856)[_0x60c5('0x22')](_0x55a7ce);};}exports[_0x60c5('0x23')]=function(_0x1af258,_0x3a067a){var _0x6b8a13={},_0x44e169={},_0x586f24={'count':0x0,'rows':[]};var _0x15de95=db[_0x60c5('0x24')][_0x60c5('0x25')];_0x44e169[_0x60c5('0x26')]=_[_0x60c5('0x27')](_0x15de95);var _0x273466={'dateStart':_0x1af258[_0x60c5('0x28')][_0x60c5('0x29')],'dateEnd':_0x1af258[_0x60c5('0x28')][_0x60c5('0x2a')]};delete _0x1af258['query']['dateStart'];delete _0x1af258['query']['dateEnd'];_0x44e169[_0x60c5('0x28')]=_[_0x60c5('0x27')](_0x1af258[_0x60c5('0x28')]);_0x44e169[_0x60c5('0x2b')]=_[_0x60c5('0x2c')](_0x44e169[_0x60c5('0x26')],_0x44e169[_0x60c5('0x28')]);_0x6b8a13['attributes']=_[_0x60c5('0x2c')](_0x44e169['model'],qs[_0x60c5('0x2d')](_0x1af258['query']['fields']));_0x6b8a13['attributes']=_0x6b8a13['attributes']['length']?_0x6b8a13[_0x60c5('0x2e')]:_0x44e169[_0x60c5('0x26')];if(!_0x1af258['query']['hasOwnProperty'](_0x60c5('0x2f'))){_0x6b8a13[_0x60c5('0x19')]=qs['limit'](_0x1af258[_0x60c5('0x28')][_0x60c5('0x19')]);_0x6b8a13[_0x60c5('0x18')]=qs[_0x60c5('0x18')](_0x1af258[_0x60c5('0x28')][_0x60c5('0x18')]);}_0x6b8a13['order']=qs[_0x60c5('0x30')](_0x1af258[_0x60c5('0x28')][_0x60c5('0x30')]);_0x6b8a13[_0x60c5('0x31')]=qs[_0x60c5('0x2b')](_[_0x60c5('0x32')](_0x1af258[_0x60c5('0x28')],_0x44e169[_0x60c5('0x2b')]));if(_0x273466[_0x60c5('0x29')]){if(_0x273466[_0x60c5('0x2a')]){_0x273466[_0x60c5('0x2a')]=moment(_0x273466[_0x60c5('0x2a')])['add'](0x1,_0x60c5('0x33'));}else{_0x273466[_0x60c5('0x2a')]=moment(_0x273466['dateStart'])[_0x60c5('0x34')](0x1,_0x60c5('0x33'));}_['merge'](_0x6b8a13[_0x60c5('0x31')],{'createdAt':{'$gte':_0x273466[_0x60c5('0x29')],'$lte':_0x273466[_0x60c5('0x2a')]}});}if(_0x1af258[_0x60c5('0x28')][_0x60c5('0x35')]){_0x6b8a13[_0x60c5('0x31')]=_[_0x60c5('0x36')](_0x6b8a13[_0x60c5('0x31')],{'$or':_['map'](_0x6b8a13[_0x60c5('0x2e')],function(_0x12517b){var _0x499bcc={};_0x499bcc[_0x12517b]={'$like':'%'+_0x1af258[_0x60c5('0x28')][_0x60c5('0x35')]+'%'};return _0x499bcc;})});}_0x6b8a13=_[_0x60c5('0x36')]({},_0x6b8a13,_0x1af258[_0x60c5('0x37')]);var _0x10207d={'where':_0x6b8a13[_0x60c5('0x31')]};return db[_0x60c5('0x24')]['count'](_0x10207d)['then'](function(_0x4ca95b){_0x586f24[_0x60c5('0x38')]=_0x4ca95b;if(_0x1af258[_0x60c5('0x28')][_0x60c5('0x39')]){_0x6b8a13[_0x60c5('0x3a')]=[{'all':!![]}];}return db[_0x60c5('0x24')]['findAll'](_0x6b8a13);})[_0x60c5('0x1e')](function(_0x47173e){_0x586f24[_0x60c5('0x3b')]=_0x47173e;return _0x586f24;})[_0x60c5('0x1e')](respondWithFilteredResult(_0x3a067a,_0x6b8a13))[_0x60c5('0x3c')](handleError(_0x3a067a,null));};exports[_0x60c5('0x3d')]=function(_0x1aaabd,_0xacce45){var _0x233006={'raw':!![],'where':{'id':_0x1aaabd[_0x60c5('0x3e')]['id']}},_0x21e438={};_0x21e438[_0x60c5('0x26')]=_['keys'](db[_0x60c5('0x24')][_0x60c5('0x25')]);_0x21e438[_0x60c5('0x28')]=_[_0x60c5('0x27')](_0x1aaabd[_0x60c5('0x28')]);_0x21e438[_0x60c5('0x2b')]=_[_0x60c5('0x2c')](_0x21e438[_0x60c5('0x26')],_0x21e438[_0x60c5('0x28')]);_0x233006[_0x60c5('0x2e')]=_[_0x60c5('0x2c')](_0x21e438['model'],qs[_0x60c5('0x2d')](_0x1aaabd[_0x60c5('0x28')][_0x60c5('0x2d')]));_0x233006[_0x60c5('0x2e')]=_0x233006[_0x60c5('0x2e')][_0x60c5('0x3f')]?_0x233006[_0x60c5('0x2e')]:_0x21e438[_0x60c5('0x26')];if(_0x1aaabd[_0x60c5('0x28')][_0x60c5('0x39')]){_0x233006['include']=[{'all':!![]}];}_0x233006=_[_0x60c5('0x36')]({},_0x233006,_0x1aaabd[_0x60c5('0x37')]);return db[_0x60c5('0x24')]['find'](_0x233006)[_0x60c5('0x1e')](handleEntityNotFound(_0xacce45,null))[_0x60c5('0x1e')](respondWithResult(_0xacce45,null))[_0x60c5('0x3c')](handleError(_0xacce45,null));};exports[_0x60c5('0x40')]=function(_0x1ade32,_0x133d99){return db[_0x60c5('0x24')][_0x60c5('0x40')](_0x1ade32[_0x60c5('0x41')],{})[_0x60c5('0x1e')](respondWithResult(_0x133d99,0xc9))['catch'](handleError(_0x133d99,null));};exports[_0x60c5('0x1d')]=function(_0x22f205,_0x368e93){if(_0x22f205[_0x60c5('0x41')]['id']){delete _0x22f205[_0x60c5('0x41')]['id'];}return db[_0x60c5('0x24')][_0x60c5('0x42')]({'where':{'id':_0x22f205[_0x60c5('0x3e')]['id']}})['then'](handleEntityNotFound(_0x368e93,null))[_0x60c5('0x1e')](saveUpdates(_0x22f205[_0x60c5('0x41')],null))['then'](respondWithResult(_0x368e93,null))[_0x60c5('0x3c')](handleError(_0x368e93,null));};exports[_0x60c5('0x1f')]=function(_0xc1153c,_0x35d2ab){return db[_0x60c5('0x24')][_0x60c5('0x42')]({'where':{'id':_0xc1153c[_0x60c5('0x3e')]['id']}})['then'](handleEntityNotFound(_0x35d2ab,null))['then'](removeEntity(_0x35d2ab,null))[_0x60c5('0x3c')](handleError(_0x35d2ab,null));};exports[_0x60c5('0x43')]=function(_0x11a970,_0x440d63){return db['ChatInternalMessage'][_0x60c5('0x43')]()[_0x60c5('0x1e')](respondWithResult(_0x440d63,null))[_0x60c5('0x3c')](handleError(_0x440d63,null));};function wrapUser(_0xbe1ba8){return function(_0x5ce52b){var _0x11d4c7=_0xbe1ba8['get']({'plain':!![]});_0x11d4c7[_0x60c5('0x44')]=[];if(_0x5ce52b){_0x11d4c7[_0x60c5('0x45')]=_0x5ce52b[_0x60c5('0x46')];_0x11d4c7[_0x60c5('0x47')]=_0x5ce52b;}else{_0x11d4c7[_0x60c5('0x45')]=moment(0x0)[_0x60c5('0x48')](_0x60c5('0x49'));_0x11d4c7[_0x60c5('0x47')]={};}return _0x11d4c7;};}exports['getUsers']=function(_0x5a5947,_0x114201,_0x463633){var _0x209f0b=[];return db[_0x60c5('0x4a')][_0x60c5('0x4b')]({'where':{'role':['agent','admin',_0x60c5('0x4c')]},'attributes':['id',_0x60c5('0x4d'),'name',_0x60c5('0x4e'),_0x60c5('0x4f'),'internal',_0x60c5('0x50'),_0x60c5('0x51'),_0x60c5('0x52'),'showWebBar'],'order':qs['sort'](_0x60c5('0x53')),'include':[{'model':db[_0x60c5('0x54')],'as':_0x60c5('0x55'),'attributes':['id',_0x60c5('0x21'),_0x60c5('0x56')],'through':{'attributes':[]}}]})['then'](function(_0x37abb1){var _0x3838b5=[];if(_0x37abb1){_0x209f0b=_0x37abb1;for(var _0x201065=0x0;_0x201065<_0x37abb1[_0x60c5('0x3f')];_0x201065+=0x1){_0x209f0b[_0x201065][_0x60c5('0x44')]=[];_0x3838b5[_0x60c5('0x57')](db['ChatInternalMessage'][_0x60c5('0x42')]({'where':{'FromId':[_0x5a5947[_0x60c5('0x4c')]['id'],_0x37abb1[_0x201065]['id']],'ToId':[_0x5a5947[_0x60c5('0x4c')]['id'],_0x37abb1[_0x201065]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x60c5('0x58'),'ToId',_0x60c5('0x59'),_0x60c5('0x41')],'order':qs[_0x60c5('0x30')](_0x60c5('0x5a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x60c5('0x1e')](wrapUser(_0x37abb1[_0x201065])));}return BPromise[_0x60c5('0x5b')](_0x3838b5);}return[];})[_0x60c5('0x1e')](function(_0x5b4670){return{'rows':_0x5b4670,'count':_0x5b4670['length']};})[_0x60c5('0x1e')](respondWithResult(_0x114201,null))[_0x60c5('0x3c')](handleError(_0x114201,null));};
\ No newline at end of file
+var _0x821f=['register','sendStatus','end','count','offset','limit','status','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','ChatInternalMessage','keys','query','dateEnd','dateStart','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day','filter','map','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','filters','include','find','create','body','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','getUsers','User','agent','admin','role','userpic','internal','online','lastLoginAt','allowmessenger','VoiceQueue','VoiceQueues','type','push','user','FromId','ToId','read','-createdAt','all','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./chatInternalMessage.socket'];(function(_0x56a936,_0x457a1b){var _0x5ec02b=function(_0x242e0b){while(--_0x242e0b){_0x56a936['push'](_0x56a936['shift']());}};_0x5ec02b(++_0x457a1b);}(_0x821f,0x189));var _0xf821=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x821f[_0x9cd4c3];return _0x4c9025;};'use strict';var pdf=require(_0xf821('0x0'));var emlformat=require(_0xf821('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf821('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf821('0x3'));var moment=require(_0xf821('0x4'));var BPromise=require(_0xf821('0x5'));var Mustache=require(_0xf821('0x6'));var util=require(_0xf821('0x7'));var path=require('path');var sox=require(_0xf821('0x8'));var csv=require(_0xf821('0x9'));var ejs=require(_0xf821('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf821('0xb'));var crypto=require(_0xf821('0xc'));var jsforce=require(_0xf821('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf821('0x9'));var querystring=require(_0xf821('0xe'));var Papa=require('papaparse');var qs=require(_0xf821('0xf'));var logger=require(_0xf821('0x10'))('api');var utils=require(_0xf821('0x11'));var config=require(_0xf821('0x12'));var db=require(_0xf821('0x13'))['db'];var socket=require(_0xf821('0x14'))({'host':_0xf821('0x15'),'port':0x18eb});require(_0xf821('0x16'))[_0xf821('0x17')](socket);function respondWithStatusCode(_0x4bb638,_0x4bb1f4){_0x4bb1f4=_0x4bb1f4||0xcc;return function(_0x264d85){if(_0x264d85){return _0x4bb638[_0xf821('0x18')](_0x4bb1f4);}return _0x4bb638['status'](_0x4bb1f4)[_0xf821('0x19')]();};}function respondWithResult(_0x4d1284,_0xd93436){_0xd93436=_0xd93436||0xc8;return function(_0x4ccc9a){if(_0x4ccc9a){return _0x4d1284['status'](_0xd93436)['json'](_0x4ccc9a);}};}function respondWithFilteredResult(_0x1f608c,_0x238c8f){return function(_0x7b66b1){if(_0x7b66b1){var _0x3bb22d=_0x7b66b1[_0xf821('0x1a')],_0x2452a5=_0x238c8f[_0xf821('0x1b')],_0xbe8f52=_0x238c8f[_0xf821('0x1b')]+_0x238c8f[_0xf821('0x1c')],_0x470de9;if(_0xbe8f52>=_0x3bb22d){_0xbe8f52=_0x3bb22d;_0x470de9=0xc8;}else{_0x470de9=0xce;}_0x1f608c[_0xf821('0x1d')](_0x470de9);return _0x1f608c[_0xf821('0x1e')](_0xf821('0x1f'),_0x2452a5+'-'+_0xbe8f52+'/'+_0x3bb22d)[_0xf821('0x20')](_0x7b66b1);}return null;};}function patchUpdates(_0x3304ab){return function(_0x2c1c18){try{jsonpatch[_0xf821('0x21')](_0x2c1c18,_0x3304ab,!![]);}catch(_0x4f15c6){return BPromise[_0xf821('0x22')](_0x4f15c6);}return _0x2c1c18[_0xf821('0x23')]();};}function saveUpdates(_0x320b34,_0x241d55){return function(_0x46aa66){if(_0x46aa66){return _0x46aa66[_0xf821('0x24')](_0x320b34)[_0xf821('0x25')](function(_0x43b3f4){return _0x43b3f4;});}return null;};}function removeEntity(_0x167275,_0x16f610){return function(_0x4f1426){if(_0x4f1426){return _0x4f1426[_0xf821('0x26')]()[_0xf821('0x25')](function(){_0x167275[_0xf821('0x1d')](0xcc)[_0xf821('0x19')]();});}};}function handleEntityNotFound(_0x134db7,_0x22f89a){return function(_0x3cd586){if(!_0x3cd586){_0x134db7['sendStatus'](0x194);}return _0x3cd586;};}function handleError(_0x3f55b0,_0x227b08){_0x227b08=_0x227b08||0x1f4;return function(_0xc05f6d){logger[_0xf821('0x27')](_0xc05f6d['stack']);if(_0xc05f6d[_0xf821('0x28')]){delete _0xc05f6d['name'];}_0x3f55b0[_0xf821('0x1d')](_0x227b08)[_0xf821('0x29')](_0xc05f6d);};}exports[_0xf821('0x2a')]=function(_0x1dae34,_0x41b678){var _0x211848={},_0x36655d={},_0x2fbf28={'count':0x0,'rows':[]};var _0x4c90d5=db[_0xf821('0x2b')]['rawAttributes'];_0x36655d['model']=_[_0xf821('0x2c')](_0x4c90d5);var _0x3c918c={'dateStart':_0x1dae34['query']['dateStart'],'dateEnd':_0x1dae34[_0xf821('0x2d')][_0xf821('0x2e')]};delete _0x1dae34[_0xf821('0x2d')][_0xf821('0x2f')];delete _0x1dae34[_0xf821('0x2d')][_0xf821('0x2e')];_0x36655d[_0xf821('0x2d')]=_[_0xf821('0x2c')](_0x1dae34[_0xf821('0x2d')]);_0x36655d['filters']=_[_0xf821('0x30')](_0x36655d[_0xf821('0x31')],_0x36655d[_0xf821('0x2d')]);_0x211848[_0xf821('0x32')]=_[_0xf821('0x30')](_0x36655d[_0xf821('0x31')],qs[_0xf821('0x33')](_0x1dae34[_0xf821('0x2d')][_0xf821('0x33')]));_0x211848[_0xf821('0x32')]=_0x211848[_0xf821('0x32')][_0xf821('0x34')]?_0x211848[_0xf821('0x32')]:_0x36655d[_0xf821('0x31')];if(!_0x1dae34[_0xf821('0x2d')][_0xf821('0x35')](_0xf821('0x36'))){_0x211848['limit']=qs[_0xf821('0x1c')](_0x1dae34[_0xf821('0x2d')][_0xf821('0x1c')]);_0x211848[_0xf821('0x1b')]=qs[_0xf821('0x1b')](_0x1dae34[_0xf821('0x2d')][_0xf821('0x1b')]);}_0x211848[_0xf821('0x37')]=qs[_0xf821('0x38')](_0x1dae34[_0xf821('0x2d')][_0xf821('0x38')]);_0x211848[_0xf821('0x39')]=qs['filters'](_[_0xf821('0x3a')](_0x1dae34['query'],_0x36655d['filters']));if(_0x3c918c[_0xf821('0x2f')]){if(_0x3c918c[_0xf821('0x2e')]){_0x3c918c[_0xf821('0x2e')]=moment(_0x3c918c[_0xf821('0x2e')])[_0xf821('0x3b')](0x1,_0xf821('0x3c'));}else{_0x3c918c[_0xf821('0x2e')]=moment(_0x3c918c[_0xf821('0x2f')])[_0xf821('0x3b')](0x1,'day');}_['merge'](_0x211848[_0xf821('0x39')],{'createdAt':{'$gte':_0x3c918c[_0xf821('0x2f')],'$lte':_0x3c918c[_0xf821('0x2e')]}});}if(_0x1dae34['query'][_0xf821('0x3d')]){_0x211848[_0xf821('0x39')]=_['merge'](_0x211848[_0xf821('0x39')],{'$or':_[_0xf821('0x3e')](_0x211848[_0xf821('0x32')],function(_0x295fa5){var _0x1f0010={};_0x1f0010[_0x295fa5]={'$like':'%'+_0x1dae34[_0xf821('0x2d')]['filter']+'%'};return _0x1f0010;})});}_0x211848=_[_0xf821('0x3f')]({},_0x211848,_0x1dae34[_0xf821('0x40')]);var _0x24067d={'where':_0x211848[_0xf821('0x39')]};return db[_0xf821('0x2b')][_0xf821('0x1a')](_0x24067d)[_0xf821('0x25')](function(_0x1cf4d1){_0x2fbf28[_0xf821('0x1a')]=_0x1cf4d1;if(_0x1dae34[_0xf821('0x2d')][_0xf821('0x41')]){_0x211848['include']=[{'all':!![]}];}return db[_0xf821('0x2b')][_0xf821('0x42')](_0x211848);})['then'](function(_0x430296){_0x2fbf28[_0xf821('0x43')]=_0x430296;return _0x2fbf28;})[_0xf821('0x25')](respondWithFilteredResult(_0x41b678,_0x211848))[_0xf821('0x44')](handleError(_0x41b678,null));};exports[_0xf821('0x45')]=function(_0x267050,_0xaa6349){var _0x44e667={'raw':!![],'where':{'id':_0x267050[_0xf821('0x46')]['id']}},_0x443494={};_0x443494[_0xf821('0x31')]=_[_0xf821('0x2c')](db[_0xf821('0x2b')][_0xf821('0x47')]);_0x443494[_0xf821('0x2d')]=_[_0xf821('0x2c')](_0x267050[_0xf821('0x2d')]);_0x443494[_0xf821('0x48')]=_[_0xf821('0x30')](_0x443494[_0xf821('0x31')],_0x443494[_0xf821('0x2d')]);_0x44e667[_0xf821('0x32')]=_[_0xf821('0x30')](_0x443494[_0xf821('0x31')],qs[_0xf821('0x33')](_0x267050[_0xf821('0x2d')][_0xf821('0x33')]));_0x44e667[_0xf821('0x32')]=_0x44e667[_0xf821('0x32')][_0xf821('0x34')]?_0x44e667[_0xf821('0x32')]:_0x443494[_0xf821('0x31')];if(_0x267050[_0xf821('0x2d')][_0xf821('0x41')]){_0x44e667[_0xf821('0x49')]=[{'all':!![]}];}_0x44e667=_[_0xf821('0x3f')]({},_0x44e667,_0x267050[_0xf821('0x40')]);return db[_0xf821('0x2b')][_0xf821('0x4a')](_0x44e667)[_0xf821('0x25')](handleEntityNotFound(_0xaa6349,null))[_0xf821('0x25')](respondWithResult(_0xaa6349,null))[_0xf821('0x44')](handleError(_0xaa6349,null));};exports[_0xf821('0x4b')]=function(_0x26179e,_0x5cb493){return db[_0xf821('0x2b')][_0xf821('0x4b')](_0x26179e[_0xf821('0x4c')],{})[_0xf821('0x25')](respondWithResult(_0x5cb493,0xc9))['catch'](handleError(_0x5cb493,null));};exports['update']=function(_0x2df648,_0x5e2bc7){if(_0x2df648[_0xf821('0x4c')]['id']){delete _0x2df648[_0xf821('0x4c')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x2df648[_0xf821('0x46')]['id']}})[_0xf821('0x25')](handleEntityNotFound(_0x5e2bc7,null))[_0xf821('0x25')](saveUpdates(_0x2df648[_0xf821('0x4c')],null))[_0xf821('0x25')](respondWithResult(_0x5e2bc7,null))[_0xf821('0x44')](handleError(_0x5e2bc7,null));};exports[_0xf821('0x26')]=function(_0x41c6de,_0x5ed825){return db['ChatInternalMessage'][_0xf821('0x4a')]({'where':{'id':_0x41c6de[_0xf821('0x46')]['id']}})[_0xf821('0x25')](handleEntityNotFound(_0x5ed825,null))[_0xf821('0x25')](removeEntity(_0x5ed825,null))[_0xf821('0x44')](handleError(_0x5ed825,null));};exports[_0xf821('0x4d')]=function(_0x4b624c,_0x2ffb90){return db[_0xf821('0x2b')][_0xf821('0x4d')]()[_0xf821('0x25')](respondWithResult(_0x2ffb90,null))[_0xf821('0x44')](handleError(_0x2ffb90,null));};function wrapUser(_0x5aa18b){return function(_0x1a8554){var _0x1046cd=_0x5aa18b[_0xf821('0x4e')]({'plain':!![]});_0x1046cd[_0xf821('0x4f')]=[];if(_0x1a8554){_0x1046cd['lastMessageAt']=_0x1a8554[_0xf821('0x50')];_0x1046cd[_0xf821('0x51')]=_0x1a8554;}else{_0x1046cd[_0xf821('0x52')]=moment(0x0)[_0xf821('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x1046cd[_0xf821('0x51')]={};}return _0x1046cd;};}exports[_0xf821('0x54')]=function(_0x368af7,_0x5b0251,_0xce8f01){var _0x506557=[];return db[_0xf821('0x55')][_0xf821('0x42')]({'where':{'role':[_0xf821('0x56'),_0xf821('0x57'),'user']},'attributes':['id','fullname',_0xf821('0x28'),_0xf821('0x58'),_0xf821('0x59'),_0xf821('0x5a'),_0xf821('0x5b'),_0xf821('0x5c'),_0xf821('0x5d'),'showWebBar'],'order':qs[_0xf821('0x38')]('-online'),'include':[{'model':db[_0xf821('0x5e')],'as':_0xf821('0x5f'),'attributes':['id',_0xf821('0x28'),_0xf821('0x60')],'through':{'attributes':[]}}]})[_0xf821('0x25')](function(_0xa643c){var _0x451556=[];if(_0xa643c){_0x506557=_0xa643c;for(var _0x25ba76=0x0;_0x25ba76<_0xa643c[_0xf821('0x34')];_0x25ba76+=0x1){_0x506557[_0x25ba76][_0xf821('0x4f')]=[];_0x451556[_0xf821('0x61')](db[_0xf821('0x2b')][_0xf821('0x4a')]({'where':{'FromId':[_0x368af7['user']['id'],_0xa643c[_0x25ba76]['id']],'ToId':[_0x368af7[_0xf821('0x62')]['id'],_0xa643c[_0x25ba76]['id']],'ChatGroupId':null},'attributes':['id',_0xf821('0x50'),_0xf821('0x63'),_0xf821('0x64'),_0xf821('0x65'),'body'],'order':qs[_0xf821('0x38')](_0xf821('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0xa643c[_0x25ba76])));}return BPromise[_0xf821('0x67')](_0x451556);}return[];})[_0xf821('0x25')](function(_0x41b064){return{'rows':_0x41b064,'count':_0x41b064[_0xf821('0x34')]};})['then'](respondWithResult(_0x5b0251,null))['catch'](handleError(_0x5b0251,null));};
\ No newline at end of file
index 738bf45..2215063 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47fd=['emit','hasOwnProperty','hook','events','ChatInternalMessage','save','remove'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x47fd,0xce));var _0xd47f=function(_0x3a5a8d,_0x22dac9){_0x3a5a8d=_0x3a5a8d-0x0;var _0x1b94b7=_0x47fd[_0x3a5a8d];return _0x1b94b7;};'use strict';var EventEmitter=require(_0xd47f('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xd47f('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd47f('0x2'),'afterUpdate':'update','afterDestroy':_0xd47f('0x3')};function emitEvent(_0x5cc55f){return function(_0x36309f,_0x3d86fa,_0x1b7739){ChatInternalMessageEvents[_0xd47f('0x4')](_0x5cc55f+':'+_0x36309f['id'],_0x36309f);ChatInternalMessageEvents[_0xd47f('0x4')](_0x5cc55f,_0x36309f);_0x1b7739(null);};}for(var e in events){if(events[_0xd47f('0x5')](e)){var event=events[e];ChatInternalMessage[_0xd47f('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x64c5=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','ChatInternalMessage'];(function(_0x5e2152,_0x172f3d){var _0x5ddcf6=function(_0x30a5cc){while(--_0x30a5cc){_0x5e2152['push'](_0x5e2152['shift']());}};_0x5ddcf6(++_0x172f3d);}(_0x64c5,0x1ae));var _0x564c=function(_0x23418f,_0x1b83c9){_0x23418f=_0x23418f-0x0;var _0x3d4f88=_0x64c5[_0x23418f];return _0x3d4f88;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x564c('0x0'))['db'][_0x564c('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x564c('0x2')](0x0);var events={'afterCreate':_0x564c('0x3'),'afterUpdate':_0x564c('0x4'),'afterDestroy':_0x564c('0x5')};function emitEvent(_0x5846d2){return function(_0x12bc1d,_0x4e2abd,_0x1cc0dc){ChatInternalMessageEvents[_0x564c('0x6')](_0x5846d2+':'+_0x12bc1d['id'],_0x12bc1d);ChatInternalMessageEvents[_0x564c('0x6')](_0x5846d2,_0x12bc1d);_0x1cc0dc(null);};}for(var e in events){if(events[_0x564c('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x564c('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
index d4c85a9..4ef18ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2327=['util','../../config/logger','moment','bluebird','request-promise','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5a26f5,_0x196300){var _0x2e9ef7=function(_0x593736){while(--_0x593736){_0x5a26f5['push'](_0x5a26f5['shift']());}};_0x2e9ef7(++_0x196300);}(_0x2327,0x13e));var _0x7232=function(_0x39b3d8,_0x5548f5){_0x39b3d8=_0x39b3d8-0x0;var _0x5dfed7=_0x2327[_0x39b3d8];return _0x5dfed7;};'use strict';var _=require(_0x7232('0x0'));var util=require(_0x7232('0x1'));var logger=require(_0x7232('0x2'))('api');var moment=require(_0x7232('0x3'));var BPromise=require(_0x7232('0x4'));var rp=require(_0x7232('0x5'));var attributes=require('./chatInternalMessage.attributes');module[_0x7232('0x6')]=function(_0x1c94d6,_0x3d9b42){return _0x1c94d6[_0x7232('0x7')](_0x7232('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7232('0x9'),'collate':_0x7232('0xa')});};
\ No newline at end of file
+var _0x281e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x281e,0x168));var _0xe281=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x281e[_0x28aea5];return _0x6a55f9;};'use strict';var _=require(_0xe281('0x0'));var util=require(_0xe281('0x1'));var logger=require(_0xe281('0x2'))(_0xe281('0x3'));var moment=require(_0xe281('0x4'));var BPromise=require(_0xe281('0x5'));var rp=require(_0xe281('0x6'));var attributes=require(_0xe281('0x7'));module['exports']=function(_0x4a5b43,_0x1239eb){return _0x4a5b43['define'](_0xe281('0x8'),attributes,{'tableName':_0xe281('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 985e836..eb19d30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11f7=['client','socket.io-emitter','register','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x11f7,0x108));var _0x711f=function(_0x5b768b,_0x4e1844){_0x5b768b=_0x5b768b-0x0;var _0x4b9600=_0x11f7[_0x5b768b];return _0x4b9600;};'use strict';var _=require(_0x711f('0x0'));var util=require(_0x711f('0x1'));var moment=require(_0x711f('0x2'));var BPromise=require('bluebird');var rs=require(_0x711f('0x3'));var fs=require('fs');var db=require(_0x711f('0x4'))['db'];var utils=require(_0x711f('0x5'));var logger=require(_0x711f('0x6'))('rpc');var config=require(_0x711f('0x7'));var jayson=require(_0x711f('0x8'));var client=jayson[_0x711f('0x9')]['http']({'port':0x232a});var socket=require(_0x711f('0xa'))({'host':'localhost','port':0x18eb});require('./chatInternalMessage.socket')[_0x711f('0xb')](socket);function respondWithRpcPromise(_0x84f5d0,_0x2d2202,_0xd8404d){return new BPromise(function(_0x4a671e,_0x3f0dae){return client['request'](_0x84f5d0,_0xd8404d)['then'](function(_0x3205dd){logger[_0x711f('0xc')](_0x711f('0xd'),_0x2d2202,'request\x20sent');logger['debug'](_0x711f('0xe'),_0x2d2202,'request\x20sent',JSON[_0x711f('0xf')](_0x3205dd));if(_0x3205dd['error']){if(_0x3205dd[_0x711f('0x10')][_0x711f('0x11')]===0x1f4){logger[_0x711f('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x2d2202,_0x3205dd[_0x711f('0x10')][_0x711f('0x12')]);return _0x3f0dae(_0x3205dd[_0x711f('0x10')]['message']);}logger[_0x711f('0x10')](_0x711f('0xd'),_0x2d2202,_0x3205dd[_0x711f('0x10')][_0x711f('0x12')]);return _0x4a671e(_0x3205dd[_0x711f('0x10')][_0x711f('0x12')]);}else{logger[_0x711f('0xc')]('ChatInternalMessage,\x20%s,\x20%s',_0x2d2202,'request\x20sent');_0x4a671e(_0x3205dd[_0x711f('0x13')]['message']);}})[_0x711f('0x14')](function(_0x54dbfc){logger['error'](_0x711f('0xd'),_0x2d2202,_0x54dbfc);_0x3f0dae(_0x54dbfc);});});}
\ No newline at end of file
+var _0x2c68=['debug','stringify','error','code','message','ChatInternalMessage,\x20%s,\x20%s','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','localhost','./chatInternalMessage.socket','request','then','info','request\x20sent'];(function(_0x5a0dcd,_0x4bd3d5){var _0xc0a210=function(_0x26b0ff){while(--_0x26b0ff){_0x5a0dcd['push'](_0x5a0dcd['shift']());}};_0xc0a210(++_0x4bd3d5);}(_0x2c68,0xb0));var _0x82c6=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x2c68[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require('lodash');var util=require(_0x82c6('0x0'));var moment=require(_0x82c6('0x1'));var BPromise=require('bluebird');var rs=require(_0x82c6('0x2'));var fs=require('fs');var db=require(_0x82c6('0x3'))['db'];var utils=require(_0x82c6('0x4'));var logger=require(_0x82c6('0x5'))(_0x82c6('0x6'));var config=require(_0x82c6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x82c6('0x8')][_0x82c6('0x9')]({'port':0x232a});var socket=require('socket.io-emitter')({'host':_0x82c6('0xa'),'port':0x18eb});require(_0x82c6('0xb'))['register'](socket);function respondWithRpcPromise(_0x5e675e,_0x3f387a,_0x5197ae){return new BPromise(function(_0x209f96,_0x5fce30){return client[_0x82c6('0xc')](_0x5e675e,_0x5197ae)[_0x82c6('0xd')](function(_0x4505fc){logger[_0x82c6('0xe')]('ChatInternalMessage,\x20%s,\x20%s',_0x3f387a,_0x82c6('0xf'));logger[_0x82c6('0x10')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x3f387a,_0x82c6('0xf'),JSON[_0x82c6('0x11')](_0x4505fc));if(_0x4505fc[_0x82c6('0x12')]){if(_0x4505fc['error'][_0x82c6('0x13')]===0x1f4){logger[_0x82c6('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x3f387a,_0x4505fc[_0x82c6('0x12')][_0x82c6('0x14')]);return _0x5fce30(_0x4505fc[_0x82c6('0x12')][_0x82c6('0x14')]);}logger[_0x82c6('0x12')](_0x82c6('0x15'),_0x3f387a,_0x4505fc['error'][_0x82c6('0x14')]);return _0x209f96(_0x4505fc[_0x82c6('0x12')][_0x82c6('0x14')]);}else{logger[_0x82c6('0xe')](_0x82c6('0x15'),_0x3f387a,_0x82c6('0xf'));_0x209f96(_0x4505fc[_0x82c6('0x16')][_0x82c6('0x14')]);}})[_0x82c6('0x17')](function(_0x1dc891){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x3f387a,_0x1dc891);_0x5fce30(_0x1dc891);});});}
\ No newline at end of file
index fc4bbc3..09a2f61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6387=['save','remove','update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6387,0x1d3));var _0x7638=function(_0x5e0d3c,_0x531c47){_0x5e0d3c=_0x5e0d3c-0x0;var _0x19a397=_0x6387[_0x5e0d3c];return _0x19a397;};'use strict';var ChatInternalMessageEvents=require(_0x7638('0x0'));var events=[_0x7638('0x1'),_0x7638('0x2'),_0x7638('0x3')];function createListener(_0x324fd0,_0x5ecdfc){return function(_0x18e029){_0x5ecdfc[_0x7638('0x4')](_0x324fd0,_0x18e029);};}function removeListener(_0x420e31,_0x2e4ad8){return function(){ChatInternalMessageEvents[_0x7638('0x5')](_0x420e31,_0x2e4ad8);};}exports[_0x7638('0x6')]=function(_0x29cc42){for(var _0x32c1a9=0x0,_0x4eeebd=events[_0x7638('0x7')];_0x32c1a9<_0x4eeebd;_0x32c1a9++){var _0x4b4735=events[_0x32c1a9];var _0x298731=createListener(_0x7638('0x8')+_0x4b4735,_0x29cc42);ChatInternalMessageEvents['on'](_0x4b4735,_0x298731);}};
\ No newline at end of file
+var _0xea2c=['remove','update','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x9cf9f8,_0x1efb85){var _0x24550a=function(_0x588463){while(--_0x588463){_0x9cf9f8['push'](_0x9cf9f8['shift']());}};_0x24550a(++_0x1efb85);}(_0xea2c,0x18f));var _0xcea2=function(_0x1f99a5,_0x523e8b){_0x1f99a5=_0x1f99a5-0x0;var _0x20107c=_0xea2c[_0x1f99a5];return _0x20107c;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0xcea2('0x0'),_0xcea2('0x1')];function createListener(_0x1a6198,_0x138410){return function(_0x302f62){_0x138410[_0xcea2('0x2')](_0x1a6198,_0x302f62);};}function removeListener(_0x2ed379,_0x1562cb){return function(){ChatInternalMessageEvents[_0xcea2('0x3')](_0x2ed379,_0x1562cb);};}exports[_0xcea2('0x4')]=function(_0x256c16){for(var _0x5bc141=0x0,_0x4abe90=events[_0xcea2('0x5')];_0x5bc141<_0x4abe90;_0x5bc141++){var _0x39b8a8=events[_0x5bc141];var _0x1fb78a=createListener(_0xcea2('0x6')+_0x39b8a8,_0x256c16);ChatInternalMessageEvents['on'](_0x39b8a8,_0x1fb78a);}};
\ No newline at end of file
index 0ec90ed..643b38d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa88=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x45b174,_0xa563fd){var _0x2db3e4=function(_0x1543dd){while(--_0x1543dd){_0x45b174['push'](_0x45b174['shift']());}};_0x2db3e4(++_0xa563fd);}(_0xaa88,0x137));var _0x8aa8=function(_0x17882c,_0x4b964b){_0x17882c=_0x17882c-0x0;var _0x355a59=_0xaa88[_0x17882c];return _0x355a59;};'use strict';var multer=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var path=require(_0x8aa8('0x2'));var express=require(_0x8aa8('0x3'));var router=express['Router']();var auth=require(_0x8aa8('0x4'));var interaction=require(_0x8aa8('0x5'));var config=require(_0x8aa8('0x6'));var controller=require(_0x8aa8('0x7'));router[_0x8aa8('0x8')]('/',auth[_0x8aa8('0x9')](),controller['index']);router['get'](_0x8aa8('0xa'),auth['isAuthenticated'](),controller[_0x8aa8('0xb')]);router[_0x8aa8('0x8')](_0x8aa8('0xc'),auth[_0x8aa8('0x9')](),controller['getUsers']);router[_0x8aa8('0x8')](_0x8aa8('0xd'),auth[_0x8aa8('0x9')](),controller['show']);router[_0x8aa8('0xe')]('/',auth[_0x8aa8('0x9')](),controller[_0x8aa8('0xf')]);router[_0x8aa8('0x10')]('/:id',controller[_0x8aa8('0x11')]);router[_0x8aa8('0x12')]('/:id',auth[_0x8aa8('0x9')](),controller[_0x8aa8('0x13')]);module[_0x8aa8('0x14')]=router;
\ No newline at end of file
+var _0xd8b0=['/describe','isAuthenticated','/users','getUsers','/:id','show','post','create','delete','destroy','exports','multer','util','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_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 express=require('express');var router=express['Router']();var auth=require(_0x0d8b('0x2'));var interaction=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var controller=require(_0x0d8b('0x5'));router[_0x0d8b('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0d8b('0x6')](_0x0d8b('0x7'),auth[_0x0d8b('0x8')](),controller['describe']);router[_0x0d8b('0x6')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x6')](_0x0d8b('0xb'),auth[_0x0d8b('0x8')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x8')](),controller[_0x0d8b('0xe')]);router['put'](_0x0d8b('0xb'),controller['update']);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth[_0x0d8b('0x8')](),controller[_0x0d8b('0x10')]);module[_0x0d8b('0x11')]=router;
\ No newline at end of file
index 6f611dd..91bfbbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadf3=['BOOLEAN','out','DATE','TEXT','medium'];(function(_0x144e96,_0x222dea){var _0x44b315=function(_0x22d8f7){while(--_0x22d8f7){_0x144e96['push'](_0x144e96['shift']());}};_0x44b315(++_0x222dea);}(_0xadf3,0x1b1));var _0x3adf=function(_0x2a4bf4,_0x463362){_0x2a4bf4=_0x2a4bf4-0x0;var _0x1f4938=_0xadf3[_0x2a4bf4];return _0x1f4938;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x3adf('0x0')](_0x3adf('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x3adf('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3adf('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3adf('0x3')),'defaultValue':_0x3adf('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3adf('0x4')]}};
\ No newline at end of file
+var _0x9369=['exports','TEXT','medium','ENUM','out','sequelize'];(function(_0x7d3b47,_0x162357){var _0x3c69e0=function(_0x226013){while(--_0x226013){_0x7d3b47['push'](_0x7d3b47['shift']());}};_0x3c69e0(++_0x162357);}(_0x9369,0x101));var _0x9936=function(_0xb11f12,_0x56fc03){_0xb11f12=_0xb11f12-0x0;var _0x1a4514=_0x9369[_0xb11f12];return _0x1a4514;};'use strict';var Sequelize=require(_0x9936('0x0'));module[_0x9936('0x1')]={'body':{'type':Sequelize[_0x9936('0x2')](_0x9936('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9936('0x4')]('in',_0x9936('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
index 48e003c..8839bce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11ea=['agent','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','interface','event','rejectmessage','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','socket.io-emitter','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','ChatMessage,\x20%s,\x20%s','result','catch','status','end','json','count','offset','limit','set','apply','reject','save','destroy','sendStatus','stack','name','rawAttributes','model','keys','query','dateEnd','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','day','dateStart','add','merge','map','includeAll','include','ChatMessage','findAll','params','options','find','create','body','update','describe','chat-interactions','accept','chat','read','readAt','format','UserId','Contact','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','EventManager','acceptmessage','parse','formData'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x11ea,0x16e));var _0xa11e=function(_0x178d32,_0x56427e){_0x178d32=_0x178d32-0x0;var _0x4df4b3=_0x11ea[_0x178d32];return _0x4df4b3;};'use strict';var pdf=require(_0xa11e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa11e('0x1'));var zipdir=require(_0xa11e('0x2'));var jsonpatch=require(_0xa11e('0x3'));var rp=require(_0xa11e('0x4'));var moment=require(_0xa11e('0x5'));var BPromise=require(_0xa11e('0x6'));var Mustache=require(_0xa11e('0x7'));var util=require('util');var path=require(_0xa11e('0x8'));var sox=require('sox');var csv=require(_0xa11e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa11e('0xa'));var squel=require('squel');var crypto=require(_0xa11e('0xb'));var jsforce=require(_0xa11e('0xc'));var deskjs=require(_0xa11e('0xd'));var toCsv=require(_0xa11e('0x9'));var querystring=require(_0xa11e('0xe'));var Papa=require(_0xa11e('0xf'));var qs=require(_0xa11e('0x10'));var logger=require(_0xa11e('0x11'))('api');var utils=require(_0xa11e('0x12'));var config=require(_0xa11e('0x13'));var db=require('../../mysqldb')['db'];var socket=require(_0xa11e('0x14'))({'host':_0xa11e('0x15'),'port':0x18eb});require(_0xa11e('0x16'))[_0xa11e('0x17')](socket);var jayson=require(_0xa11e('0x18'));var client=jayson[_0xa11e('0x19')][_0xa11e('0x1a')]({'port':0x232c});var client9002=jayson[_0xa11e('0x19')][_0xa11e('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x251bbc,_0x431ddd,_0x2eff98,_0x4426de){return new BPromise(function(_0x2ceb4c,_0x17f2a0){var _0x4c33f6=_0x4426de||client;return _0x4c33f6['request'](_0x251bbc,_0x2eff98)[_0xa11e('0x1b')](function(_0x31c506){logger['info']('ChatMessage,\x20%s,\x20%s',_0x431ddd,_0xa11e('0x1c'));logger[_0xa11e('0x1d')](_0xa11e('0x1e'),_0x431ddd,_0xa11e('0x1c'),JSON['stringify'](_0x31c506));if(_0x31c506[_0xa11e('0x1f')]){if(_0x31c506['error'][_0xa11e('0x20')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x431ddd,_0x31c506[_0xa11e('0x1f')][_0xa11e('0x21')]);return _0x17f2a0(_0x31c506[_0xa11e('0x1f')][_0xa11e('0x21')]);}logger[_0xa11e('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x431ddd,_0x31c506['error'][_0xa11e('0x21')]);return _0x2ceb4c(_0x31c506[_0xa11e('0x1f')][_0xa11e('0x21')]);}else{logger[_0xa11e('0x22')](_0xa11e('0x23'),_0x431ddd,_0xa11e('0x1c'));_0x2ceb4c(_0x31c506[_0xa11e('0x24')][_0xa11e('0x21')]);}})[_0xa11e('0x25')](function(_0x43106d){logger[_0xa11e('0x1f')](_0xa11e('0x23'),_0x431ddd,_0x43106d);_0x17f2a0(_0x43106d);});});}function respondWithStatusCode(_0xb01d82,_0x56b4f5){_0x56b4f5=_0x56b4f5||0xcc;return function(_0x3544eb){if(_0x3544eb){return _0xb01d82['sendStatus'](_0x56b4f5);}return _0xb01d82[_0xa11e('0x26')](_0x56b4f5)[_0xa11e('0x27')]();};}function respondWithResult(_0x227f5c,_0xd46468){_0xd46468=_0xd46468||0xc8;return function(_0x17fa7e){if(_0x17fa7e){return _0x227f5c[_0xa11e('0x26')](_0xd46468)[_0xa11e('0x28')](_0x17fa7e);}};}function respondWithFilteredResult(_0x57c5c0,_0x2e6b47){return function(_0x4ec650){if(_0x4ec650){var _0x1fca31=_0x4ec650[_0xa11e('0x29')],_0x213a78=_0x2e6b47[_0xa11e('0x2a')],_0x94da19=_0x2e6b47[_0xa11e('0x2a')]+_0x2e6b47[_0xa11e('0x2b')],_0x3370e9;if(_0x94da19>=_0x1fca31){_0x94da19=_0x1fca31;_0x3370e9=0xc8;}else{_0x3370e9=0xce;}_0x57c5c0[_0xa11e('0x26')](_0x3370e9);return _0x57c5c0[_0xa11e('0x2c')]('Content-Range',_0x213a78+'-'+_0x94da19+'/'+_0x1fca31)[_0xa11e('0x28')](_0x4ec650);}return null;};}function patchUpdates(_0x435770){return function(_0x1ce6ef){try{jsonpatch[_0xa11e('0x2d')](_0x1ce6ef,_0x435770,!![]);}catch(_0x7ad0ed){return BPromise[_0xa11e('0x2e')](_0x7ad0ed);}return _0x1ce6ef[_0xa11e('0x2f')]();};}function saveUpdates(_0x351119,_0x5e1543){return function(_0x31011c){if(_0x31011c){return _0x31011c['update'](_0x351119)[_0xa11e('0x1b')](function(_0x2de943){return _0x2de943;});}return null;};}function removeEntity(_0x81ff90,_0x54a4b1){return function(_0x2eac73){if(_0x2eac73){return _0x2eac73[_0xa11e('0x30')]()['then'](function(){_0x81ff90[_0xa11e('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ee68b,_0x5d66b0){return function(_0x5e0307){if(!_0x5e0307){_0x3ee68b[_0xa11e('0x31')](0x194);}return _0x5e0307;};}function handleError(_0x5dd7ff,_0x3aaefa){_0x3aaefa=_0x3aaefa||0x1f4;return function(_0x4bc965){logger['error'](_0x4bc965[_0xa11e('0x32')]);if(_0x4bc965[_0xa11e('0x33')]){delete _0x4bc965['name'];}_0x5dd7ff[_0xa11e('0x26')](_0x3aaefa)['send'](_0x4bc965);};}exports['index']=function(_0xe51156,_0x3ab301){var _0x1eee1a={},_0x186c70={},_0x4507ac={'count':0x0,'rows':[]};var _0x5b326b=db['ChatMessage'][_0xa11e('0x34')];_0x186c70[_0xa11e('0x35')]=_[_0xa11e('0x36')](_0x5b326b);var _0x1ecfc6={'dateStart':_0xe51156[_0xa11e('0x37')]['dateStart'],'dateEnd':_0xe51156[_0xa11e('0x37')][_0xa11e('0x38')]};delete _0xe51156[_0xa11e('0x37')]['dateStart'];delete _0xe51156['query'][_0xa11e('0x38')];_0x186c70[_0xa11e('0x37')]=_[_0xa11e('0x36')](_0xe51156[_0xa11e('0x37')]);_0x186c70['filters']=_['intersection'](_0x186c70[_0xa11e('0x35')],_0x186c70[_0xa11e('0x37')]);_0x1eee1a[_0xa11e('0x39')]=_[_0xa11e('0x3a')](_0x186c70[_0xa11e('0x35')],qs[_0xa11e('0x3b')](_0xe51156[_0xa11e('0x37')][_0xa11e('0x3b')]));_0x1eee1a[_0xa11e('0x39')]=_0x1eee1a[_0xa11e('0x39')][_0xa11e('0x3c')]?_0x1eee1a[_0xa11e('0x39')]:_0x186c70['model'];if(!_0xe51156[_0xa11e('0x37')][_0xa11e('0x3d')]('nolimit')){_0x1eee1a[_0xa11e('0x2b')]=qs[_0xa11e('0x2b')](_0xe51156[_0xa11e('0x37')][_0xa11e('0x2b')]);_0x1eee1a[_0xa11e('0x2a')]=qs[_0xa11e('0x2a')](_0xe51156[_0xa11e('0x37')][_0xa11e('0x2a')]);}_0x1eee1a[_0xa11e('0x3e')]=qs[_0xa11e('0x3f')](_0xe51156[_0xa11e('0x37')][_0xa11e('0x3f')]);_0x1eee1a[_0xa11e('0x40')]=qs[_0xa11e('0x41')](_[_0xa11e('0x42')](_0xe51156['query'],_0x186c70[_0xa11e('0x41')]));if(_0x1ecfc6['dateStart']){if(_0x1ecfc6[_0xa11e('0x38')]){_0x1ecfc6[_0xa11e('0x38')]=moment(_0x1ecfc6[_0xa11e('0x38')])['add'](0x1,_0xa11e('0x43'));}else{_0x1ecfc6[_0xa11e('0x38')]=moment(_0x1ecfc6[_0xa11e('0x44')])[_0xa11e('0x45')](0x1,_0xa11e('0x43'));}_['merge'](_0x1eee1a['where'],{'createdAt':{'$gte':_0x1ecfc6[_0xa11e('0x44')],'$lte':_0x1ecfc6[_0xa11e('0x38')]}});}if(_0xe51156[_0xa11e('0x37')]['filter']){_0x1eee1a[_0xa11e('0x40')]=_[_0xa11e('0x46')](_0x1eee1a['where'],{'$or':_[_0xa11e('0x47')](_0x1eee1a[_0xa11e('0x39')],function(_0x459794){var _0x4815fa={};_0x4815fa[_0x459794]={'$like':'%'+_0xe51156['query']['filter']+'%'};return _0x4815fa;})});}_0x1eee1a=_['merge']({},_0x1eee1a,_0xe51156['options']);var _0x2105ea={'where':_0x1eee1a[_0xa11e('0x40')]};return db['ChatMessage'][_0xa11e('0x29')](_0x2105ea)[_0xa11e('0x1b')](function(_0x5a276d){_0x4507ac[_0xa11e('0x29')]=_0x5a276d;if(_0xe51156['query'][_0xa11e('0x48')]){_0x1eee1a[_0xa11e('0x49')]=[{'all':!![]}];}return db[_0xa11e('0x4a')][_0xa11e('0x4b')](_0x1eee1a);})[_0xa11e('0x1b')](function(_0x27993d){_0x4507ac['rows']=_0x27993d;return _0x4507ac;})[_0xa11e('0x1b')](respondWithFilteredResult(_0x3ab301,_0x1eee1a))[_0xa11e('0x25')](handleError(_0x3ab301,null));};exports['show']=function(_0xb93046,_0x44cdcf){var _0x1f8670={'raw':!![],'where':{'id':_0xb93046[_0xa11e('0x4c')]['id']}},_0x539314={};_0x539314['model']=_[_0xa11e('0x36')](db['ChatMessage'][_0xa11e('0x34')]);_0x539314[_0xa11e('0x37')]=_[_0xa11e('0x36')](_0xb93046[_0xa11e('0x37')]);_0x539314[_0xa11e('0x41')]=_[_0xa11e('0x3a')](_0x539314[_0xa11e('0x35')],_0x539314[_0xa11e('0x37')]);_0x1f8670['attributes']=_[_0xa11e('0x3a')](_0x539314[_0xa11e('0x35')],qs['fields'](_0xb93046['query']['fields']));_0x1f8670[_0xa11e('0x39')]=_0x1f8670[_0xa11e('0x39')][_0xa11e('0x3c')]?_0x1f8670['attributes']:_0x539314[_0xa11e('0x35')];if(_0xb93046[_0xa11e('0x37')][_0xa11e('0x48')]){_0x1f8670['include']=[{'all':!![]}];}_0x1f8670=_[_0xa11e('0x46')]({},_0x1f8670,_0xb93046[_0xa11e('0x4d')]);return db[_0xa11e('0x4a')][_0xa11e('0x4e')](_0x1f8670)[_0xa11e('0x1b')](handleEntityNotFound(_0x44cdcf,null))['then'](respondWithResult(_0x44cdcf,null))['catch'](handleError(_0x44cdcf,null));};exports[_0xa11e('0x4f')]=function(_0x24225b,_0x5ce8f8){return db['ChatMessage'][_0xa11e('0x4f')](_0x24225b[_0xa11e('0x50')],{})[_0xa11e('0x1b')](respondWithResult(_0x5ce8f8,0xc9))['catch'](handleError(_0x5ce8f8,null));};exports[_0xa11e('0x51')]=function(_0x1112e0,_0x4d0055){if(_0x1112e0[_0xa11e('0x50')]['id']){delete _0x1112e0[_0xa11e('0x50')]['id'];}return db[_0xa11e('0x4a')][_0xa11e('0x4e')]({'where':{'id':_0x1112e0['params']['id']}})['then'](handleEntityNotFound(_0x4d0055,null))[_0xa11e('0x1b')](saveUpdates(_0x1112e0[_0xa11e('0x50')],null))[_0xa11e('0x1b')](respondWithResult(_0x4d0055,null))[_0xa11e('0x25')](handleError(_0x4d0055,null));};exports[_0xa11e('0x30')]=function(_0x30e638,_0x3d92fc){return db['ChatMessage'][_0xa11e('0x4e')]({'where':{'id':_0x30e638['params']['id']}})['then'](handleEntityNotFound(_0x3d92fc,null))[_0xa11e('0x1b')](removeEntity(_0x3d92fc,null))[_0xa11e('0x25')](handleError(_0x3d92fc,null));};exports['describe']=function(_0x2b628d,_0x4acb11){return db['ChatMessage'][_0xa11e('0x52')]()['then'](respondWithResult(_0x4acb11,null))['catch'](handleError(_0x4acb11,null));};var interaction_log=require(_0xa11e('0x11'))(_0xa11e('0x53'));exports[_0xa11e('0x54')]=function(_0x201595,_0xfcf998,_0x581198){var _0x3d277a={'channel':_0xa11e('0x55')};if(_0x201595['body']['id']){delete _0x201595[_0xa11e('0x50')]['id'];}_0x201595[_0xa11e('0x50')][_0xa11e('0x56')]=!![];_0x201595['body'][_0xa11e('0x57')]=moment()[_0xa11e('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x201595[_0xa11e('0x50')]['UserId']=_0x201595[_0xa11e('0x50')][_0xa11e('0x59')]||_0x201595['user']['id'];return db['ChatMessage']['find']({'where':{'id':_0x201595[_0xa11e('0x4c')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xa11e('0x5a')}]})[_0xa11e('0x1b')](handleEntityNotFound(_0xfcf998,null))[_0xa11e('0x1b')](saveUpdates(_0x201595[_0xa11e('0x50')],null))[_0xa11e('0x1b')](function(_0x28c53e){if(_0x28c53e){_0x3d277a[_0xa11e('0x21')]=_0x28c53e['get']({'plain':!![]});return db[_0xa11e('0x5b')][_0xa11e('0x4e')]({'where':{'id':_0x28c53e[_0xa11e('0x5c')]}});}return null;})['then'](handleEntityNotFound(_0xfcf998,null))[_0xa11e('0x1b')](function(_0x30c34b){if(_0x30c34b){return _0x30c34b[_0xa11e('0x51')]({'UserId':_0x201595[_0xa11e('0x50')]['UserId'],'read1stAt':_[_0xa11e('0x5d')](_0x30c34b[_0xa11e('0x5e')])?moment()[_0xa11e('0x58')](_0xa11e('0x5f')):undefined});}return null;})['then'](function(_0x1ed8ba){if(_0x1ed8ba){_0x3d277a[_0xa11e('0x60')]=_0x1ed8ba['get']({'plain':!![]});interaction_log[_0xa11e('0x22')](_0xa11e('0x61'),_0x201595[_0xa11e('0x62')]['id'],_0x201595['user'][_0xa11e('0x33')],_0x201595[_0xa11e('0x62')][_0xa11e('0x63')],_0x3d277a['interaction']['id'],_0x201595['body']?JSON['stringify'](_0x201595[_0xa11e('0x50')]):_0xa11e('0x64'));return respondWithRpcPromise(_0xa11e('0x65'),_0xa11e('0x66'),_0x3d277a);}return null;})['then'](function(_0x36c6bf){if(_0x36c6bf){if(_0x201595[_0xa11e('0x50')][_0xa11e('0x67')]){_0x3d277a[_0xa11e('0x21')]['interface']=util[_0xa11e('0x58')](_0xa11e('0x68'),_0x201595[_0xa11e('0x62')][_0xa11e('0x33')]);_0x3d277a['message'][_0xa11e('0x69')]=_0x3d277a[_0xa11e('0x69')];_0x3d277a['message']['event']=_0xa11e('0x54');return respondWithRpcPromise(_0xa11e('0x6a'),_0xa11e('0x6a'),{'event':_0xa11e('0x6b'),'message':_['merge'](_0x3d277a[_0xa11e('0x21')],JSON[_0xa11e('0x6c')](_0x3d277a['interaction'][_0xa11e('0x6d')]))},client9002)[_0xa11e('0x1b')](function(){return _0x3d277a;});}return _0x3d277a;}return null;})['then'](respondWithResult(_0xfcf998,null))[_0xa11e('0x25')](handleError(_0xfcf998,null));};var interaction_log=require(_0xa11e('0x11'))(_0xa11e('0x53'));exports[_0xa11e('0x2e')]=function(_0x1655e6,_0x510df1,_0x3496e0){var _0x157535={'agent':{},'channel':_0xa11e('0x55')};if(_0x1655e6['body']['id']){delete _0x1655e6[_0xa11e('0x50')]['id'];}_0x1655e6[_0xa11e('0x50')]['UserId']=_0x1655e6[_0xa11e('0x50')][_0xa11e('0x59')]||_0x1655e6[_0xa11e('0x62')]['id'];_0x157535[_0xa11e('0x6e')]['id']=_0x1655e6[_0xa11e('0x50')][_0xa11e('0x59')];return db[_0xa11e('0x4a')][_0xa11e('0x4e')]({'where':{'id':_0x1655e6['params']['id'],'UserId':null}})[_0xa11e('0x1b')](handleEntityNotFound(_0x510df1,null))[_0xa11e('0x1b')](function(_0x50654d){if(_0x50654d){_0x157535[_0xa11e('0x21')]=_0x50654d[_0xa11e('0x6f')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x50654d[_0xa11e('0x5c')]}});}return null;})[_0xa11e('0x1b')](handleEntityNotFound(_0x510df1,null))[_0xa11e('0x1b')](function(_0x3401a7){if(_0x3401a7){_0x157535[_0xa11e('0x60')]=_0x3401a7['get']({'plain':!![]});interaction_log[_0xa11e('0x22')](_0xa11e('0x70'),_0x1655e6[_0xa11e('0x62')]['id'],_0x1655e6['user'][_0xa11e('0x33')],_0x1655e6[_0xa11e('0x62')]['role'],_0x157535[_0xa11e('0x60')]['id'],_0x1655e6[_0xa11e('0x50')]?JSON[_0xa11e('0x71')](_0x1655e6['body']):'null');return respondWithRpcPromise(_0xa11e('0x72'),_0xa11e('0x73'),_0x157535);}return null;})[_0xa11e('0x1b')](function(_0x197778){if(_0x197778){_0x197778['message'][_0xa11e('0x74')]=util['format'](_0xa11e('0x68'),_0x1655e6['user']['name']);_0x197778[_0xa11e('0x21')][_0xa11e('0x69')]=_0x157535['channel'];_0x197778['message'][_0xa11e('0x75')]=_0xa11e('0x2e');respondWithRpcPromise(_0xa11e('0x6a'),_0xa11e('0x6a'),{'event':_0xa11e('0x76'),'message':_0x197778['message']},client9002);return _0x157535;}return null;})[_0xa11e('0x1b')](respondWithResult(_0x510df1,null))[_0xa11e('0x25')](handleError(_0x510df1,null));};
\ No newline at end of file
+var _0x950d=['destroy','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','ChatInteractionId','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./chatMessage.socket','register','jayson/promise','client','http','info','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','request\x20sent','result','status','end','json','limit','set','Content-Range','apply','reject','update','then','stack','name','index','ChatMessage','rawAttributes','model','query','dateStart','dateEnd','keys','attributes','intersection','fields','length','hasOwnProperty','offset','order','sort','where','filters','pick','day','add','merge','filter','map','options','count','includeAll','include','findAll','rows','catch','params','find','create','body'];(function(_0x2315b5,_0x453f66){var _0x4e0454=function(_0x230e89){while(--_0x230e89){_0x2315b5['push'](_0x2315b5['shift']());}};_0x4e0454(++_0x453f66);}(_0x950d,0x96));var _0xd950=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x950d[_0x134c2e];return _0x2825db;};'use strict';var pdf=require(_0xd950('0x0'));var emlformat=require(_0xd950('0x1'));var rimraf=require(_0xd950('0x2'));var zipdir=require(_0xd950('0x3'));var jsonpatch=require(_0xd950('0x4'));var rp=require(_0xd950('0x5'));var moment=require(_0xd950('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xd950('0x7'));var util=require('util');var path=require(_0xd950('0x8'));var sox=require('sox');var csv=require(_0xd950('0x9'));var ejs=require(_0xd950('0xa'));var fs=require('fs');var _=require(_0xd950('0xb'));var squel=require(_0xd950('0xc'));var crypto=require(_0xd950('0xd'));var jsforce=require(_0xd950('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd950('0x9'));var querystring=require(_0xd950('0xf'));var Papa=require('papaparse');var qs=require('../../components/parsers/qs');var logger=require(_0xd950('0x10'))(_0xd950('0x11'));var utils=require(_0xd950('0x12'));var config=require(_0xd950('0x13'));var db=require(_0xd950('0x14'))['db'];var socket=require(_0xd950('0x15'))({'host':_0xd950('0x16'),'port':0x18eb});require(_0xd950('0x17'))[_0xd950('0x18')](socket);var jayson=require(_0xd950('0x19'));var client=jayson[_0xd950('0x1a')]['http']({'port':0x232c});var client9002=jayson[_0xd950('0x1a')][_0xd950('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1af8f3,_0x378244,_0x510c26,_0x3b7771){return new BPromise(function(_0x5d21ca,_0x47dfce){var _0x563ea0=_0x3b7771||client;return _0x563ea0['request'](_0x1af8f3,_0x510c26)['then'](function(_0x1d0b3d){logger[_0xd950('0x1c')]('ChatMessage,\x20%s,\x20%s',_0x378244,'request\x20sent');logger['debug'](_0xd950('0x1d'),_0x378244,'request\x20sent',JSON[_0xd950('0x1e')](_0x1d0b3d));if(_0x1d0b3d[_0xd950('0x1f')]){if(_0x1d0b3d['error'][_0xd950('0x20')]===0x1f4){logger['error'](_0xd950('0x21'),_0x378244,_0x1d0b3d[_0xd950('0x1f')]['message']);return _0x47dfce(_0x1d0b3d['error'][_0xd950('0x22')]);}logger['error'](_0xd950('0x21'),_0x378244,_0x1d0b3d[_0xd950('0x1f')][_0xd950('0x22')]);return _0x5d21ca(_0x1d0b3d[_0xd950('0x1f')][_0xd950('0x22')]);}else{logger[_0xd950('0x1c')](_0xd950('0x21'),_0x378244,_0xd950('0x23'));_0x5d21ca(_0x1d0b3d[_0xd950('0x24')][_0xd950('0x22')]);}})['catch'](function(_0x927db3){logger[_0xd950('0x1f')](_0xd950('0x21'),_0x378244,_0x927db3);_0x47dfce(_0x927db3);});});}function respondWithStatusCode(_0xd7fa46,_0x488475){_0x488475=_0x488475||0xcc;return function(_0x8868){if(_0x8868){return _0xd7fa46['sendStatus'](_0x488475);}return _0xd7fa46[_0xd950('0x25')](_0x488475)[_0xd950('0x26')]();};}function respondWithResult(_0x46f7c6,_0x16b535){_0x16b535=_0x16b535||0xc8;return function(_0x4ff8f1){if(_0x4ff8f1){return _0x46f7c6[_0xd950('0x25')](_0x16b535)[_0xd950('0x27')](_0x4ff8f1);}};}function respondWithFilteredResult(_0x289f64,_0x2697b9){return function(_0x2734fb){if(_0x2734fb){var _0x255ab0=_0x2734fb['count'],_0x11c5d1=_0x2697b9['offset'],_0x235b2d=_0x2697b9['offset']+_0x2697b9[_0xd950('0x28')],_0x5d8212;if(_0x235b2d>=_0x255ab0){_0x235b2d=_0x255ab0;_0x5d8212=0xc8;}else{_0x5d8212=0xce;}_0x289f64['status'](_0x5d8212);return _0x289f64[_0xd950('0x29')](_0xd950('0x2a'),_0x11c5d1+'-'+_0x235b2d+'/'+_0x255ab0)[_0xd950('0x27')](_0x2734fb);}return null;};}function patchUpdates(_0x35920f){return function(_0x7a7d45){try{jsonpatch[_0xd950('0x2b')](_0x7a7d45,_0x35920f,!![]);}catch(_0x33c45d){return BPromise[_0xd950('0x2c')](_0x33c45d);}return _0x7a7d45['save']();};}function saveUpdates(_0x456176,_0x33f6c0){return function(_0x56eea5){if(_0x56eea5){return _0x56eea5[_0xd950('0x2d')](_0x456176)[_0xd950('0x2e')](function(_0x4c165e){return _0x4c165e;});}return null;};}function removeEntity(_0x760a2d,_0xaf677a){return function(_0x5171cf){if(_0x5171cf){return _0x5171cf['destroy']()['then'](function(){_0x760a2d[_0xd950('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x172fd0,_0x5bd0c0){return function(_0x58b8aa){if(!_0x58b8aa){_0x172fd0['sendStatus'](0x194);}return _0x58b8aa;};}function handleError(_0x3c5df6,_0x2e8426){_0x2e8426=_0x2e8426||0x1f4;return function(_0x381425){logger[_0xd950('0x1f')](_0x381425[_0xd950('0x2f')]);if(_0x381425[_0xd950('0x30')]){delete _0x381425[_0xd950('0x30')];}_0x3c5df6['status'](_0x2e8426)['send'](_0x381425);};}exports[_0xd950('0x31')]=function(_0x5087b2,_0x175d9e){var _0x1cec03={},_0x50bb05={},_0x885fa1={'count':0x0,'rows':[]};var _0x37bfbf=db[_0xd950('0x32')][_0xd950('0x33')];_0x50bb05[_0xd950('0x34')]=_['keys'](_0x37bfbf);var _0xadef63={'dateStart':_0x5087b2[_0xd950('0x35')][_0xd950('0x36')],'dateEnd':_0x5087b2[_0xd950('0x35')][_0xd950('0x37')]};delete _0x5087b2['query'][_0xd950('0x36')];delete _0x5087b2[_0xd950('0x35')]['dateEnd'];_0x50bb05[_0xd950('0x35')]=_[_0xd950('0x38')](_0x5087b2[_0xd950('0x35')]);_0x50bb05['filters']=_['intersection'](_0x50bb05[_0xd950('0x34')],_0x50bb05[_0xd950('0x35')]);_0x1cec03[_0xd950('0x39')]=_[_0xd950('0x3a')](_0x50bb05[_0xd950('0x34')],qs[_0xd950('0x3b')](_0x5087b2['query'][_0xd950('0x3b')]));_0x1cec03[_0xd950('0x39')]=_0x1cec03['attributes'][_0xd950('0x3c')]?_0x1cec03['attributes']:_0x50bb05[_0xd950('0x34')];if(!_0x5087b2['query'][_0xd950('0x3d')]('nolimit')){_0x1cec03[_0xd950('0x28')]=qs[_0xd950('0x28')](_0x5087b2[_0xd950('0x35')][_0xd950('0x28')]);_0x1cec03[_0xd950('0x3e')]=qs[_0xd950('0x3e')](_0x5087b2[_0xd950('0x35')][_0xd950('0x3e')]);}_0x1cec03[_0xd950('0x3f')]=qs['sort'](_0x5087b2['query'][_0xd950('0x40')]);_0x1cec03[_0xd950('0x41')]=qs[_0xd950('0x42')](_[_0xd950('0x43')](_0x5087b2['query'],_0x50bb05[_0xd950('0x42')]));if(_0xadef63['dateStart']){if(_0xadef63[_0xd950('0x37')]){_0xadef63['dateEnd']=moment(_0xadef63[_0xd950('0x37')])['add'](0x1,_0xd950('0x44'));}else{_0xadef63['dateEnd']=moment(_0xadef63[_0xd950('0x36')])[_0xd950('0x45')](0x1,_0xd950('0x44'));}_[_0xd950('0x46')](_0x1cec03['where'],{'createdAt':{'$gte':_0xadef63[_0xd950('0x36')],'$lte':_0xadef63[_0xd950('0x37')]}});}if(_0x5087b2[_0xd950('0x35')][_0xd950('0x47')]){_0x1cec03[_0xd950('0x41')]=_[_0xd950('0x46')](_0x1cec03[_0xd950('0x41')],{'$or':_[_0xd950('0x48')](_0x1cec03[_0xd950('0x39')],function(_0x207ed5){var _0x1688b5={};_0x1688b5[_0x207ed5]={'$like':'%'+_0x5087b2[_0xd950('0x35')]['filter']+'%'};return _0x1688b5;})});}_0x1cec03=_[_0xd950('0x46')]({},_0x1cec03,_0x5087b2[_0xd950('0x49')]);var _0x255cc6={'where':_0x1cec03['where']};return db[_0xd950('0x32')][_0xd950('0x4a')](_0x255cc6)[_0xd950('0x2e')](function(_0x42e60a){_0x885fa1[_0xd950('0x4a')]=_0x42e60a;if(_0x5087b2[_0xd950('0x35')][_0xd950('0x4b')]){_0x1cec03[_0xd950('0x4c')]=[{'all':!![]}];}return db[_0xd950('0x32')][_0xd950('0x4d')](_0x1cec03);})['then'](function(_0x143414){_0x885fa1[_0xd950('0x4e')]=_0x143414;return _0x885fa1;})[_0xd950('0x2e')](respondWithFilteredResult(_0x175d9e,_0x1cec03))[_0xd950('0x4f')](handleError(_0x175d9e,null));};exports['show']=function(_0x329737,_0x320082){var _0x4e93a3={'raw':!![],'where':{'id':_0x329737[_0xd950('0x50')]['id']}},_0x35f8c9={};_0x35f8c9['model']=_['keys'](db['ChatMessage'][_0xd950('0x33')]);_0x35f8c9['query']=_[_0xd950('0x38')](_0x329737[_0xd950('0x35')]);_0x35f8c9['filters']=_['intersection'](_0x35f8c9['model'],_0x35f8c9[_0xd950('0x35')]);_0x4e93a3[_0xd950('0x39')]=_[_0xd950('0x3a')](_0x35f8c9[_0xd950('0x34')],qs[_0xd950('0x3b')](_0x329737[_0xd950('0x35')][_0xd950('0x3b')]));_0x4e93a3[_0xd950('0x39')]=_0x4e93a3[_0xd950('0x39')][_0xd950('0x3c')]?_0x4e93a3['attributes']:_0x35f8c9[_0xd950('0x34')];if(_0x329737[_0xd950('0x35')][_0xd950('0x4b')]){_0x4e93a3['include']=[{'all':!![]}];}_0x4e93a3=_[_0xd950('0x46')]({},_0x4e93a3,_0x329737[_0xd950('0x49')]);return db[_0xd950('0x32')][_0xd950('0x51')](_0x4e93a3)[_0xd950('0x2e')](handleEntityNotFound(_0x320082,null))[_0xd950('0x2e')](respondWithResult(_0x320082,null))[_0xd950('0x4f')](handleError(_0x320082,null));};exports[_0xd950('0x52')]=function(_0x3fdc5a,_0x14ff24){return db['ChatMessage']['create'](_0x3fdc5a[_0xd950('0x53')],{})[_0xd950('0x2e')](respondWithResult(_0x14ff24,0xc9))[_0xd950('0x4f')](handleError(_0x14ff24,null));};exports[_0xd950('0x2d')]=function(_0x1306bc,_0x4aff71){if(_0x1306bc[_0xd950('0x53')]['id']){delete _0x1306bc[_0xd950('0x53')]['id'];}return db[_0xd950('0x32')][_0xd950('0x51')]({'where':{'id':_0x1306bc[_0xd950('0x50')]['id']}})['then'](handleEntityNotFound(_0x4aff71,null))['then'](saveUpdates(_0x1306bc[_0xd950('0x53')],null))[_0xd950('0x2e')](respondWithResult(_0x4aff71,null))[_0xd950('0x4f')](handleError(_0x4aff71,null));};exports[_0xd950('0x54')]=function(_0x2fe7c1,_0x26f67f){return db[_0xd950('0x32')][_0xd950('0x51')]({'where':{'id':_0x2fe7c1[_0xd950('0x50')]['id']}})[_0xd950('0x2e')](handleEntityNotFound(_0x26f67f,null))['then'](removeEntity(_0x26f67f,null))[_0xd950('0x4f')](handleError(_0x26f67f,null));};exports[_0xd950('0x55')]=function(_0x3ffa8f,_0x41dcc3){return db[_0xd950('0x32')][_0xd950('0x55')]()[_0xd950('0x2e')](respondWithResult(_0x41dcc3,null))[_0xd950('0x4f')](handleError(_0x41dcc3,null));};var interaction_log=require(_0xd950('0x10'))(_0xd950('0x56'));exports[_0xd950('0x57')]=function(_0x27a2fd,_0x3f3c3f,_0x45e7f8){var _0x168186={'channel':_0xd950('0x58')};if(_0x27a2fd[_0xd950('0x53')]['id']){delete _0x27a2fd[_0xd950('0x53')]['id'];}_0x27a2fd['body'][_0xd950('0x59')]=!![];_0x27a2fd['body'][_0xd950('0x5a')]=moment()[_0xd950('0x5b')](_0xd950('0x5c'));_0x27a2fd['body'][_0xd950('0x5d')]=_0x27a2fd[_0xd950('0x53')]['UserId']||_0x27a2fd['user']['id'];return db[_0xd950('0x32')][_0xd950('0x51')]({'where':{'id':_0x27a2fd[_0xd950('0x50')]['id'],'UserId':null},'include':[{'model':db[_0xd950('0x5e')],'as':_0xd950('0x5f')}]})[_0xd950('0x2e')](handleEntityNotFound(_0x3f3c3f,null))['then'](saveUpdates(_0x27a2fd[_0xd950('0x53')],null))['then'](function(_0x462d56){if(_0x462d56){_0x168186['message']=_0x462d56[_0xd950('0x60')]({'plain':!![]});return db['ChatInteraction'][_0xd950('0x51')]({'where':{'id':_0x462d56[_0xd950('0x61')]}});}return null;})[_0xd950('0x2e')](handleEntityNotFound(_0x3f3c3f,null))['then'](function(_0x3f975a){if(_0x3f975a){return _0x3f975a[_0xd950('0x2d')]({'UserId':_0x27a2fd[_0xd950('0x53')][_0xd950('0x5d')],'read1stAt':_['isNil'](_0x3f975a[_0xd950('0x62')])?moment()[_0xd950('0x5b')](_0xd950('0x5c')):undefined});}return null;})[_0xd950('0x2e')](function(_0xbabafd){if(_0xbabafd){_0x168186[_0xd950('0x63')]=_0xbabafd[_0xd950('0x60')]({'plain':!![]});interaction_log[_0xd950('0x1c')](_0xd950('0x64'),_0x27a2fd[_0xd950('0x65')]['id'],_0x27a2fd[_0xd950('0x65')][_0xd950('0x30')],_0x27a2fd[_0xd950('0x65')][_0xd950('0x66')],_0x168186[_0xd950('0x63')]['id'],_0x27a2fd['body']?JSON[_0xd950('0x1e')](_0x27a2fd[_0xd950('0x53')]):_0xd950('0x67'));return respondWithRpcPromise(_0xd950('0x68'),_0xd950('0x69'),_0x168186);}return null;})[_0xd950('0x2e')](function(_0x4b734b){if(_0x4b734b){if(_0x27a2fd[_0xd950('0x53')][_0xd950('0x6a')]){_0x168186[_0xd950('0x22')][_0xd950('0x6b')]=util[_0xd950('0x5b')](_0xd950('0x6c'),_0x27a2fd['user'][_0xd950('0x30')]);_0x168186[_0xd950('0x22')][_0xd950('0x6d')]=_0x168186[_0xd950('0x6d')];_0x168186['message'][_0xd950('0x6e')]='accept';return respondWithRpcPromise(_0xd950('0x6f'),'EventManager',{'event':_0xd950('0x70'),'message':_['merge'](_0x168186[_0xd950('0x22')],JSON['parse'](_0x168186['interaction'][_0xd950('0x71')]))},client9002)[_0xd950('0x2e')](function(){return _0x168186;});}return _0x168186;}return null;})[_0xd950('0x2e')](respondWithResult(_0x3f3c3f,null))['catch'](handleError(_0x3f3c3f,null));};var interaction_log=require(_0xd950('0x10'))(_0xd950('0x56'));exports[_0xd950('0x2c')]=function(_0x30e6c4,_0x289280,_0x32583b){var _0x5405bb={'agent':{},'channel':_0xd950('0x58')};if(_0x30e6c4[_0xd950('0x53')]['id']){delete _0x30e6c4['body']['id'];}_0x30e6c4[_0xd950('0x53')]['UserId']=_0x30e6c4[_0xd950('0x53')][_0xd950('0x5d')]||_0x30e6c4['user']['id'];_0x5405bb['agent']['id']=_0x30e6c4['body'][_0xd950('0x5d')];return db[_0xd950('0x32')]['find']({'where':{'id':_0x30e6c4[_0xd950('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x289280,null))[_0xd950('0x2e')](function(_0x74420c){if(_0x74420c){_0x5405bb['message']=_0x74420c[_0xd950('0x60')]({'plain':!![]});return db[_0xd950('0x72')][_0xd950('0x51')]({'where':{'id':_0x74420c[_0xd950('0x61')]}});}return null;})[_0xd950('0x2e')](handleEntityNotFound(_0x289280,null))[_0xd950('0x2e')](function(_0x457a9b){if(_0x457a9b){_0x5405bb[_0xd950('0x63')]=_0x457a9b[_0xd950('0x60')]({'plain':!![]});interaction_log[_0xd950('0x1c')](_0xd950('0x73'),_0x30e6c4[_0xd950('0x65')]['id'],_0x30e6c4[_0xd950('0x65')][_0xd950('0x30')],_0x30e6c4[_0xd950('0x65')][_0xd950('0x66')],_0x5405bb[_0xd950('0x63')]['id'],_0x30e6c4[_0xd950('0x53')]?JSON[_0xd950('0x1e')](_0x30e6c4[_0xd950('0x53')]):_0xd950('0x67'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x5405bb);}return null;})[_0xd950('0x2e')](function(_0x292e51){if(_0x292e51){_0x292e51['message']['interface']=util['format'](_0xd950('0x6c'),_0x30e6c4[_0xd950('0x65')][_0xd950('0x30')]);_0x292e51['message'][_0xd950('0x6d')]=_0x5405bb[_0xd950('0x6d')];_0x292e51[_0xd950('0x22')]['event']='reject';respondWithRpcPromise(_0xd950('0x6f'),_0xd950('0x6f'),{'event':_0xd950('0x74'),'message':_0x292e51[_0xd950('0x22')]},client9002);return _0x5405bb;}return null;})[_0xd950('0x2e')](respondWithResult(_0x289280,null))[_0xd950('0x4f')](handleError(_0x289280,null));};
\ No newline at end of file
index 286d1d7..995647f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f2a=['events','ChatMessage','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x1fbbca,_0x25c321){var _0x331216=function(_0x370490){while(--_0x370490){_0x1fbbca['push'](_0x1fbbca['shift']());}};_0x331216(++_0x25c321);}(_0x6f2a,0x1e0));var _0xa6f2=function(_0x4b153d,_0x231ff1){_0x4b153d=_0x4b153d-0x0;var _0x25a7bb=_0x6f2a[_0x4b153d];return _0x25a7bb;};'use strict';var EventEmitter=require(_0xa6f2('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xa6f2('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa6f2('0x2')](0x0);var events={'afterCreate':_0xa6f2('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x258b13){return function(_0x28dcd2,_0x152baa,_0x269aee){ChatMessageEvents[_0xa6f2('0x4')](_0x258b13+':'+_0x28dcd2['id'],_0x28dcd2);ChatMessageEvents[_0xa6f2('0x4')](_0x258b13,_0x28dcd2);_0x269aee(null);};}for(var e in events){if(events[_0xa6f2('0x5')](e)){var event=events[e];ChatMessage[_0xa6f2('0x6')](e,emitEvent(event));}}module[_0xa6f2('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x07b5=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x5c659c,_0x20b0be){var _0x31decf=function(_0x3f46d0){while(--_0x3f46d0){_0x5c659c['push'](_0x5c659c['shift']());}};_0x31decf(++_0x20b0be);}(_0x07b5,0x131));var _0x507b=function(_0xf0ec6e,_0xa183d3){_0xf0ec6e=_0xf0ec6e-0x0;var _0x8bbc27=_0x07b5[_0xf0ec6e];return _0x8bbc27;};'use strict';var EventEmitter=require(_0x507b('0x0'));var ChatMessage=require(_0x507b('0x1'))['db'][_0x507b('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x507b('0x3')](0x0);var events={'afterCreate':_0x507b('0x4'),'afterUpdate':_0x507b('0x5'),'afterDestroy':_0x507b('0x6')};function emitEvent(_0x1e090b){return function(_0x322f76,_0x57bbbb,_0x545ff4){ChatMessageEvents[_0x507b('0x7')](_0x1e090b+':'+_0x322f76['id'],_0x322f76);ChatMessageEvents[_0x507b('0x7')](_0x1e090b,_0x322f76);_0x545ff4(null);};}for(var e in events){if(events[_0x507b('0x8')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x507b('0x9')]=ChatMessageEvents;
\ No newline at end of file
index c859be5..11dc4fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6113=['moment','bluebird','request-promise','define','ChatMessage','chat_messages','get','direction','toLowerCase','out','secret','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x47ba2d,_0x22f032){var _0xb4221c=function(_0x4eba76){while(--_0x4eba76){_0x47ba2d['push'](_0x47ba2d['shift']());}};_0xb4221c(++_0x22f032);}(_0x6113,0x13e));var _0x3611=function(_0x26b404,_0x29259e){_0x26b404=_0x26b404-0x0;var _0x4be8fc=_0x6113[_0x26b404];return _0x4be8fc;};'use strict';var _=require(_0x3611('0x0'));var util=require(_0x3611('0x1'));var logger=require(_0x3611('0x2'))(_0x3611('0x3'));var moment=require(_0x3611('0x4'));var BPromise=require(_0x3611('0x5'));var rp=require(_0x3611('0x6'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x2afad0,_0x94af3c){return _0x2afad0[_0x3611('0x7')](_0x3611('0x8'),attributes,{'tableName':_0x3611('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e5dfd,_0x30ed6f,_0x2d242b){var _0x516659=_0x2afad0['models'];var _0xc9347a=_0x3e5dfd[_0x3611('0xa')]({'plain':!![]});if(_0xc9347a[_0x3611('0xb')][_0x3611('0xc')]()==='in'||_0xc9347a[_0x3611('0xb')][_0x3611('0xc')]()===_0x3611('0xd')&&!_0xc9347a[_0x3611('0xe')]&&!_['isNil'](_0xc9347a['UserId'])){_0x516659['ChatInteraction'][_0x3611('0xf')]({'where':{'id':_0xc9347a[_0x3611('0x10')]}})[_0x3611('0x11')](function(_0x5a0cde){if(_0x5a0cde){_0x5a0cde[_0x3611('0x12')]({'lastMsgAt':_0xc9347a[_0x3611('0x13')],'lastMsgDirection':_0xc9347a['direction'][_0x3611('0xc')](),'lastMsgBody':_0xc9347a['body']});}})[_0x3611('0x14')](function(_0x595264){console[_0x3611('0x15')](_0x595264);});}_0x2d242b();}},'charset':_0x3611('0x16'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x0f3e=['update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','exports','define','ChatMessage','chat_messages','models','get','direction','toLowerCase','out','isNil','ChatInteraction','findOne','then'];(function(_0x395742,_0x5c07a8){var _0x416a94=function(_0x686ea2){while(--_0x686ea2){_0x395742['push'](_0x395742['shift']());}};_0x416a94(++_0x5c07a8);}(_0x0f3e,0x1e6));var _0xe0f3=function(_0x4732a1,_0x248f32){_0x4732a1=_0x4732a1-0x0;var _0xd2a46c=_0x0f3e[_0x4732a1];return _0xd2a46c;};'use strict';var _=require(_0xe0f3('0x0'));var util=require('util');var logger=require(_0xe0f3('0x1'))(_0xe0f3('0x2'));var moment=require('moment');var BPromise=require(_0xe0f3('0x3'));var rp=require(_0xe0f3('0x4'));var attributes=require('./chatMessage.attributes');module[_0xe0f3('0x5')]=function(_0x14c0ac,_0x5227ba){return _0x14c0ac[_0xe0f3('0x6')](_0xe0f3('0x7'),attributes,{'tableName':_0xe0f3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3da4d6,_0x365c29,_0x181221){var _0x3fd26f=_0x14c0ac[_0xe0f3('0x9')];var _0x418597=_0x3da4d6[_0xe0f3('0xa')]({'plain':!![]});if(_0x418597[_0xe0f3('0xb')][_0xe0f3('0xc')]()==='in'||_0x418597[_0xe0f3('0xb')][_0xe0f3('0xc')]()===_0xe0f3('0xd')&&!_0x418597['secret']&&!_[_0xe0f3('0xe')](_0x418597['UserId'])){_0x3fd26f[_0xe0f3('0xf')][_0xe0f3('0x10')]({'where':{'id':_0x418597['ChatInteractionId']}})[_0xe0f3('0x11')](function(_0xa5cef2){if(_0xa5cef2){_0xa5cef2[_0xe0f3('0x12')]({'lastMsgAt':_0x418597[_0xe0f3('0x13')],'lastMsgDirection':_0x418597['direction'][_0xe0f3('0xc')](),'lastMsgBody':_0x418597['body']});}})[_0xe0f3('0x14')](function(_0x2024c4){console[_0xe0f3('0x15')](_0x2024c4);});}_0x181221();}},'charset':_0xe0f3('0x16'),'collate':_0xe0f3('0x17')});};
\ No newline at end of file
index de96177..834c9d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda2d=['randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','socket.io-emitter','localhost','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','code','error','message','CreateChatMessage','ChatMessage','create','body','options','raw','catch','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda2d,0x102));var _0xdda2=function(_0x3e9253,_0xf95c50){_0x3e9253=_0x3e9253-0x0;var _0x44d2c9=_0xda2d[_0x3e9253];return _0x44d2c9;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var db=require(_0xdda2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xdda2('0x5'));var jayson=require(_0xdda2('0x6'));var client=jayson[_0xdda2('0x7')][_0xdda2('0x8')]({'port':0x232a});var socket=require(_0xdda2('0x9'))({'host':_0xdda2('0xa'),'port':0x18eb});require(_0xdda2('0xb'))[_0xdda2('0xc')](socket);function respondWithRpcPromise(_0x2e2523,_0x341c7b,_0x4a97f3){return new BPromise(function(_0x1a774e,_0x22c6e5){return client['request'](_0x2e2523,_0x4a97f3)[_0xdda2('0xd')](function(_0x2f3454){logger[_0xdda2('0xe')](_0xdda2('0xf'),_0x341c7b,_0xdda2('0x10'));logger[_0xdda2('0x11')](_0xdda2('0x12'),_0x341c7b,_0xdda2('0x10'),JSON['stringify'](_0x2f3454));if(_0x2f3454['error']){if(_0x2f3454['error'][_0xdda2('0x13')]===0x1f4){logger[_0xdda2('0x14')](_0xdda2('0xf'),_0x341c7b,_0x2f3454[_0xdda2('0x14')][_0xdda2('0x15')]);return _0x22c6e5(_0x2f3454[_0xdda2('0x14')][_0xdda2('0x15')]);}logger['error'](_0xdda2('0xf'),_0x341c7b,_0x2f3454['error'][_0xdda2('0x15')]);return _0x1a774e(_0x2f3454[_0xdda2('0x14')][_0xdda2('0x15')]);}else{logger[_0xdda2('0xe')](_0xdda2('0xf'),_0x341c7b,'request\x20sent');_0x1a774e(_0x2f3454['result'][_0xdda2('0x15')]);}})['catch'](function(_0x1a5192){logger[_0xdda2('0x14')](_0xdda2('0xf'),_0x341c7b,_0x1a5192);_0x22c6e5(_0x1a5192);});});}exports[_0xdda2('0x16')]=function(_0x8d44b7){var _0x17015f=this;return new Promise(function(_0x3ca127,_0x351151){return db[_0xdda2('0x17')][_0xdda2('0x18')](_0x8d44b7[_0xdda2('0x19')],{'raw':_0x8d44b7[_0xdda2('0x1a')]?_0x8d44b7['options'][_0xdda2('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0xc4567c){logger[_0xdda2('0xe')](_0xdda2('0x16'),_0x8d44b7);logger['debug'](_0xdda2('0x16'),_0x8d44b7,JSON['stringify'](_0xc4567c));_0x3ca127(_0xc4567c);})[_0xdda2('0x1c')](function(_0x107ee4){logger['error'](_0xdda2('0x16'),_0x107ee4[_0xdda2('0x15')],_0x8d44b7);_0x351151(_0x17015f[_0xdda2('0x14')](0x1f4,_0x107ee4[_0xdda2('0x15')]));});});};
\ No newline at end of file
+var _0xc4aa=['localhost','./chatMessage.socket','register','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','catch','create','body','options','raw','debug','CreateChatMessage','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','socket.io-emitter'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc4aa[_0x19950b];return _0x3c6b41;};'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 db=require(_0xac4a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xac4a('0x6'));var jayson=require(_0xac4a('0x7'));var client=jayson[_0xac4a('0x8')][_0xac4a('0x9')]({'port':0x232a});var socket=require(_0xac4a('0xa'))({'host':_0xac4a('0xb'),'port':0x18eb});require(_0xac4a('0xc'))[_0xac4a('0xd')](socket);function respondWithRpcPromise(_0x5c6179,_0x5b8339,_0x1aba6d){return new BPromise(function(_0x2a4d53,_0x26ec84){return client['request'](_0x5c6179,_0x1aba6d)[_0xac4a('0xe')](function(_0x3a82de){logger[_0xac4a('0xf')]('ChatMessage,\x20%s,\x20%s',_0x5b8339,_0xac4a('0x10'));logger['debug'](_0xac4a('0x11'),_0x5b8339,'request\x20sent',JSON[_0xac4a('0x12')](_0x3a82de));if(_0x3a82de[_0xac4a('0x13')]){if(_0x3a82de[_0xac4a('0x13')]['code']===0x1f4){logger[_0xac4a('0x13')](_0xac4a('0x14'),_0x5b8339,_0x3a82de[_0xac4a('0x13')][_0xac4a('0x15')]);return _0x26ec84(_0x3a82de[_0xac4a('0x13')][_0xac4a('0x15')]);}logger[_0xac4a('0x13')](_0xac4a('0x14'),_0x5b8339,_0x3a82de[_0xac4a('0x13')][_0xac4a('0x15')]);return _0x2a4d53(_0x3a82de[_0xac4a('0x13')][_0xac4a('0x15')]);}else{logger['info'](_0xac4a('0x14'),_0x5b8339,_0xac4a('0x10'));_0x2a4d53(_0x3a82de[_0xac4a('0x16')][_0xac4a('0x15')]);}})[_0xac4a('0x17')](function(_0x387a54){logger[_0xac4a('0x13')](_0xac4a('0x14'),_0x5b8339,_0x387a54);_0x26ec84(_0x387a54);});});}exports['CreateChatMessage']=function(_0x5ac21e){var _0x21a729=this;return new Promise(function(_0x13c8eb,_0x39b691){return db['ChatMessage'][_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x19')],{'raw':_0x5ac21e[_0xac4a('0x1a')]?_0x5ac21e[_0xac4a('0x1a')][_0xac4a('0x1b')]===undefined?!![]:![]:!![]})[_0xac4a('0xe')](function(_0xe38996){logger[_0xac4a('0xf')]('CreateChatMessage',_0x5ac21e);logger[_0xac4a('0x1c')](_0xac4a('0x1d'),_0x5ac21e,JSON['stringify'](_0xe38996));_0x13c8eb(_0xe38996);})[_0xac4a('0x17')](function(_0x4169c0){logger[_0xac4a('0x13')](_0xac4a('0x1d'),_0x4169c0['message'],_0x5ac21e);_0x39b691(_0x21a729[_0xac4a('0x13')](0x1f4,_0x4169c0[_0xac4a('0x15')]));});});};
\ No newline at end of file
index 0c5efcf..72cd9b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['removeListener','register','./chatMessage.events','save'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x55ca,0x126));var _0xa55c=function(_0x1eb585,_0x202476){_0x1eb585=_0x1eb585-0x0;var _0x497ee2=_0x55ca[_0x1eb585];return _0x497ee2;};'use strict';var ChatMessageEvents=require(_0xa55c('0x0'));var events=[_0xa55c('0x1'),'remove','update'];function createListener(_0x49875a,_0x1c6ec3){return function(_0x267ea0){_0x1c6ec3['emit'](_0x49875a,_0x267ea0);};}function removeListener(_0x3b478a,_0x2db02a){return function(){ChatMessageEvents[_0xa55c('0x2')](_0x3b478a,_0x2db02a);};}exports[_0xa55c('0x3')]=function(_0x3c97c8){for(var _0x279caa=0x0,_0x36b623=events['length'];_0x279caa<_0x36b623;_0x279caa++){var _0x2121fd=events[_0x279caa];var _0x2537f0=createListener('chatMessage:'+_0x2121fd,_0x3c97c8);ChatMessageEvents['on'](_0x2121fd,_0x2537f0);}};
\ No newline at end of file
+var _0x3e74=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','remove','update'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x3e74,0x175));var _0x43e7=function(_0x1ad109,_0x3bfb84){_0x1ad109=_0x1ad109-0x0;var _0x556a73=_0x3e74[_0x1ad109];return _0x556a73;};'use strict';var ChatMessageEvents=require(_0x43e7('0x0'));var events=['save',_0x43e7('0x1'),_0x43e7('0x2')];function createListener(_0x151ad2,_0x494e45){return function(_0x490ced){_0x494e45[_0x43e7('0x3')](_0x151ad2,_0x490ced);};}function removeListener(_0x4f9bbe,_0x128b0f){return function(){ChatMessageEvents[_0x43e7('0x4')](_0x4f9bbe,_0x128b0f);};}exports[_0x43e7('0x5')]=function(_0x1c503b){for(var _0xc98b9c=0x0,_0x503698=events[_0x43e7('0x6')];_0xc98b9c<_0x503698;_0xc98b9c++){var _0x3491d6=events[_0xc98b9c];var _0x2ede2d=createListener(_0x43e7('0x7')+_0x3491d6,_0x1c503b);ChatMessageEvents['on'](_0x3491d6,_0x2ede2d);}};
\ No newline at end of file
index 8940db5..f4e594a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e03=['chat','chatmessage:create','create','/:id','update','/:id/accept','accept','reject','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','tracked'];(function(_0x801395,_0x1a785b){var _0x598364=function(_0x393bd9){while(--_0x393bd9){_0x801395['push'](_0x801395['shift']());}};_0x598364(++_0x1a785b);}(_0x4e03,0x104));var _0x34e0=function(_0x365499,_0x2e6615){_0x365499=_0x365499-0x0;var _0x4a6aec=_0x4e03[_0x365499];return _0x4a6aec;};'use strict';var multer=require(_0x34e0('0x0'));var util=require(_0x34e0('0x1'));var path=require(_0x34e0('0x2'));var express=require(_0x34e0('0x3'));var router=express['Router']();var auth=require(_0x34e0('0x4'));var interaction=require(_0x34e0('0x5'));var config=require('../../config/environment');var controller=require(_0x34e0('0x6'));router[_0x34e0('0x7')]('/',auth[_0x34e0('0x8')](),controller[_0x34e0('0x9')]);router[_0x34e0('0x7')](_0x34e0('0xa'),auth[_0x34e0('0x8')](),controller[_0x34e0('0xb')]);router[_0x34e0('0x7')]('/:id',auth[_0x34e0('0x8')](),controller[_0x34e0('0xc')]);router[_0x34e0('0xd')]('/',auth[_0x34e0('0x8')](),interaction[_0x34e0('0xe')](_0x34e0('0xf'),_0x34e0('0x10')),controller[_0x34e0('0x11')]);router['put'](_0x34e0('0x12'),controller[_0x34e0('0x13')]);router['put'](_0x34e0('0x14'),auth[_0x34e0('0x8')](),controller[_0x34e0('0x15')]);router['put']('/:id/reject',auth[_0x34e0('0x8')](),controller[_0x34e0('0x16')]);router[_0x34e0('0x17')]('/:id',auth[_0x34e0('0x8')](),controller[_0x34e0('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0xc417=['../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','chat','chatmessage:create','create','update','put','/:id/accept','accept','reject','delete','destroy','exports','util','express','Router','../../components/auth/service'];(function(_0x447a5c,_0x1e994d){var _0x19ed40=function(_0x3364c7){while(--_0x3364c7){_0x447a5c['push'](_0x447a5c['shift']());}};_0x19ed40(++_0x1e994d);}(_0xc417,0x79));var _0x7c41=function(_0x294627,_0x1909e5){_0x294627=_0x294627-0x0;var _0x246a54=_0xc417[_0x294627];return _0x246a54;};'use strict';var multer=require('multer');var util=require(_0x7c41('0x0'));var path=require('path');var express=require(_0x7c41('0x1'));var router=express[_0x7c41('0x2')]();var auth=require(_0x7c41('0x3'));var interaction=require(_0x7c41('0x4'));var config=require('../../config/environment');var controller=require(_0x7c41('0x5'));router[_0x7c41('0x6')]('/',auth[_0x7c41('0x7')](),controller[_0x7c41('0x8')]);router[_0x7c41('0x6')](_0x7c41('0x9'),auth[_0x7c41('0x7')](),controller[_0x7c41('0xa')]);router['get'](_0x7c41('0xb'),auth['isAuthenticated'](),controller[_0x7c41('0xc')]);router[_0x7c41('0xd')]('/',auth[_0x7c41('0x7')](),interaction['tracked'](_0x7c41('0xe'),_0x7c41('0xf')),controller[_0x7c41('0x10')]);router['put']('/:id',controller[_0x7c41('0x11')]);router[_0x7c41('0x12')](_0x7c41('0x13'),auth[_0x7c41('0x7')](),controller[_0x7c41('0x14')]);router[_0x7c41('0x12')]('/:id/reject',auth[_0x7c41('0x7')](),controller[_0x7c41('0x15')]);router[_0x7c41('0x16')](_0x7c41('0xb'),auth[_0x7c41('0x7')](),controller[_0x7c41('0x17')]);module[_0x7c41('0x18')]=router;
\ No newline at end of file
index 20d44bf..6476fc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77f2=['exports','medium'];(function(_0x40e890,_0xfd3110){var _0x15146e=function(_0x4b6bce){while(--_0x4b6bce){_0x40e890['push'](_0x40e890['shift']());}};_0x15146e(++_0xfd3110);}(_0x77f2,0x188));var _0x277f=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0x77f2[_0x52666e];return _0x515330;};'use strict';var Sequelize=require('sequelize');module[_0x277f('0x0')]={'body':{'type':Sequelize['TEXT'](_0x277f('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0xca4b=['exports','TEXT','medium'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0xca4b,0x132));var _0xbca4=function(_0x17baee,_0x54be4a){_0x17baee=_0x17baee-0x0;var _0x3f331b=_0xca4b[_0x17baee];return _0x3f331b;};'use strict';var Sequelize=require('sequelize');module[_0xbca4('0x0')]={'body':{'type':Sequelize[_0xbca4('0x1')](_0xbca4('0x2')),'allowNull':![]}};
\ No newline at end of file
index 8798ee1..fc3e621 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4c7=['mustache','to-csv','ejs','lodash','crypto','desk.js','querystring','../../components/parsers/qs','../../config/logger','../../mysqldb','sendStatus','status','json','count','offset','set','save','update','then','destroy','error','stack','name','send','index','model','keys','query','dateStart','dateEnd','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','add','day','map','filter','merge','ChatOfflineMessage','includeAll','include','findAll','show','rawAttributes','options','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x1f7610,_0xb5618a){var _0x1d4206=function(_0x28b7e2){while(--_0x28b7e2){_0x1f7610['push'](_0x1f7610['shift']());}};_0x1d4206(++_0xb5618a);}(_0xb4c7,0x143));var _0x7b4c=function(_0x5c3fa5,_0x6cb9a8){_0x5c3fa5=_0x5c3fa5-0x0;var _0x45d77e=_0xb4c7[_0x5c3fa5];return _0x45d77e;};'use strict';var pdf=require(_0x7b4c('0x0'));var emlformat=require(_0x7b4c('0x1'));var rimraf=require(_0x7b4c('0x2'));var zipdir=require(_0x7b4c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b4c('0x4'));var moment=require(_0x7b4c('0x5'));var BPromise=require(_0x7b4c('0x6'));var Mustache=require(_0x7b4c('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7b4c('0x8'));var ejs=require(_0x7b4c('0x9'));var fs=require('fs');var _=require(_0x7b4c('0xa'));var squel=require('squel');var crypto=require(_0x7b4c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b4c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7b4c('0xd'));var Papa=require('papaparse');var qs=require(_0x7b4c('0xe'));var logger=require(_0x7b4c('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x7b4c('0x10'))['db'];function respondWithStatusCode(_0x484e3d,_0x468b70){_0x468b70=_0x468b70||0xcc;return function(_0x319e4c){if(_0x319e4c){return _0x484e3d[_0x7b4c('0x11')](_0x468b70);}return _0x484e3d[_0x7b4c('0x12')](_0x468b70)['end']();};}function respondWithResult(_0x5c1786,_0x5bcdf4){_0x5bcdf4=_0x5bcdf4||0xc8;return function(_0x3ce3b8){if(_0x3ce3b8){return _0x5c1786['status'](_0x5bcdf4)[_0x7b4c('0x13')](_0x3ce3b8);}};}function respondWithFilteredResult(_0x7576d9,_0x462154){return function(_0x5720b0){if(_0x5720b0){var _0x161601=_0x5720b0[_0x7b4c('0x14')],_0x221744=_0x462154[_0x7b4c('0x15')],_0xb36998=_0x462154[_0x7b4c('0x15')]+_0x462154['limit'],_0x37b6ec;if(_0xb36998>=_0x161601){_0xb36998=_0x161601;_0x37b6ec=0xc8;}else{_0x37b6ec=0xce;}_0x7576d9['status'](_0x37b6ec);return _0x7576d9[_0x7b4c('0x16')]('Content-Range',_0x221744+'-'+_0xb36998+'/'+_0x161601)[_0x7b4c('0x13')](_0x5720b0);}return null;};}function patchUpdates(_0x4c98e9){return function(_0x216f91){try{jsonpatch['apply'](_0x216f91,_0x4c98e9,!![]);}catch(_0x30199e){return BPromise['reject'](_0x30199e);}return _0x216f91[_0x7b4c('0x17')]();};}function saveUpdates(_0x401363,_0x5b5a9b){return function(_0x257b08){if(_0x257b08){return _0x257b08[_0x7b4c('0x18')](_0x401363)[_0x7b4c('0x19')](function(_0x38cc46){return _0x38cc46;});}return null;};}function removeEntity(_0x29f39a,_0x120aa7){return function(_0x20d08c){if(_0x20d08c){return _0x20d08c[_0x7b4c('0x1a')]()['then'](function(){_0x29f39a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a8961,_0x1b7926){return function(_0x51a3f0){if(!_0x51a3f0){_0x3a8961[_0x7b4c('0x11')](0x194);}return _0x51a3f0;};}function handleError(_0x1f28eb,_0x5a40f6){_0x5a40f6=_0x5a40f6||0x1f4;return function(_0x49be31){logger[_0x7b4c('0x1b')](_0x49be31[_0x7b4c('0x1c')]);if(_0x49be31[_0x7b4c('0x1d')]){delete _0x49be31[_0x7b4c('0x1d')];}_0x1f28eb[_0x7b4c('0x12')](_0x5a40f6)[_0x7b4c('0x1e')](_0x49be31);};}exports[_0x7b4c('0x1f')]=function(_0x34bc88,_0x1fccd9){var _0x174376={},_0x3bd462={},_0x34e2c1={'count':0x0,'rows':[]};var _0x889be8=db['ChatOfflineMessage']['rawAttributes'];_0x3bd462[_0x7b4c('0x20')]=_[_0x7b4c('0x21')](_0x889be8);var _0x49bc37={'dateStart':_0x34bc88[_0x7b4c('0x22')][_0x7b4c('0x23')],'dateEnd':_0x34bc88['query'][_0x7b4c('0x24')]};delete _0x34bc88[_0x7b4c('0x22')][_0x7b4c('0x23')];delete _0x34bc88[_0x7b4c('0x22')][_0x7b4c('0x24')];_0x3bd462['query']=_[_0x7b4c('0x21')](_0x34bc88[_0x7b4c('0x22')]);_0x3bd462['filters']=_[_0x7b4c('0x25')](_0x3bd462['model'],_0x3bd462[_0x7b4c('0x22')]);_0x174376[_0x7b4c('0x26')]=_[_0x7b4c('0x25')](_0x3bd462[_0x7b4c('0x20')],qs[_0x7b4c('0x27')](_0x34bc88[_0x7b4c('0x22')][_0x7b4c('0x27')]));_0x174376[_0x7b4c('0x26')]=_0x174376[_0x7b4c('0x26')][_0x7b4c('0x28')]?_0x174376[_0x7b4c('0x26')]:_0x3bd462['model'];if(!_0x34bc88['query'][_0x7b4c('0x29')](_0x7b4c('0x2a'))){_0x174376[_0x7b4c('0x2b')]=qs[_0x7b4c('0x2b')](_0x34bc88[_0x7b4c('0x22')]['limit']);_0x174376[_0x7b4c('0x15')]=qs[_0x7b4c('0x15')](_0x34bc88[_0x7b4c('0x22')][_0x7b4c('0x15')]);}_0x174376[_0x7b4c('0x2c')]=qs[_0x7b4c('0x2d')](_0x34bc88[_0x7b4c('0x22')]['sort']);_0x174376[_0x7b4c('0x2e')]=qs[_0x7b4c('0x2f')](_['pick'](_0x34bc88[_0x7b4c('0x22')],_0x3bd462['filters']));if(_0x49bc37[_0x7b4c('0x23')]){if(_0x49bc37[_0x7b4c('0x24')]){_0x49bc37['dateEnd']=moment(_0x49bc37['dateEnd'])[_0x7b4c('0x30')](0x1,_0x7b4c('0x31'));}else{_0x49bc37['dateEnd']=moment(_0x49bc37[_0x7b4c('0x23')])['add'](0x1,_0x7b4c('0x31'));}_['merge'](_0x174376[_0x7b4c('0x2e')],{'createdAt':{'$gte':_0x49bc37[_0x7b4c('0x23')],'$lte':_0x49bc37[_0x7b4c('0x24')]}});}if(_0x34bc88[_0x7b4c('0x22')]['filter']){_0x174376[_0x7b4c('0x2e')]=_['merge'](_0x174376[_0x7b4c('0x2e')],{'$or':_[_0x7b4c('0x32')](_0x174376[_0x7b4c('0x26')],function(_0x22ddcc){var _0x6004bf={};_0x6004bf[_0x22ddcc]={'$like':'%'+_0x34bc88[_0x7b4c('0x22')][_0x7b4c('0x33')]+'%'};return _0x6004bf;})});}_0x174376=_[_0x7b4c('0x34')]({},_0x174376,_0x34bc88['options']);var _0x21d476={'where':_0x174376[_0x7b4c('0x2e')]};return db[_0x7b4c('0x35')]['count'](_0x21d476)['then'](function(_0xcced19){_0x34e2c1['count']=_0xcced19;if(_0x34bc88['query'][_0x7b4c('0x36')]){_0x174376[_0x7b4c('0x37')]=[{'all':!![]}];}return db[_0x7b4c('0x35')][_0x7b4c('0x38')](_0x174376);})[_0x7b4c('0x19')](function(_0x2e4171){_0x34e2c1['rows']=_0x2e4171;return _0x34e2c1;})[_0x7b4c('0x19')](respondWithFilteredResult(_0x1fccd9,_0x174376))['catch'](handleError(_0x1fccd9,null));};exports[_0x7b4c('0x39')]=function(_0x186042,_0x16f6b6){var _0x3052fe={'raw':!![],'where':{'id':_0x186042['params']['id']}},_0x1863b7={};_0x1863b7[_0x7b4c('0x20')]=_[_0x7b4c('0x21')](db[_0x7b4c('0x35')][_0x7b4c('0x3a')]);_0x1863b7['query']=_['keys'](_0x186042[_0x7b4c('0x22')]);_0x1863b7[_0x7b4c('0x2f')]=_[_0x7b4c('0x25')](_0x1863b7[_0x7b4c('0x20')],_0x1863b7[_0x7b4c('0x22')]);_0x3052fe[_0x7b4c('0x26')]=_[_0x7b4c('0x25')](_0x1863b7[_0x7b4c('0x20')],qs[_0x7b4c('0x27')](_0x186042[_0x7b4c('0x22')]['fields']));_0x3052fe[_0x7b4c('0x26')]=_0x3052fe['attributes'][_0x7b4c('0x28')]?_0x3052fe[_0x7b4c('0x26')]:_0x1863b7[_0x7b4c('0x20')];if(_0x186042[_0x7b4c('0x22')]['includeAll']){_0x3052fe[_0x7b4c('0x37')]=[{'all':!![]}];}_0x3052fe=_[_0x7b4c('0x34')]({},_0x3052fe,_0x186042[_0x7b4c('0x3b')]);return db[_0x7b4c('0x35')][_0x7b4c('0x3c')](_0x3052fe)[_0x7b4c('0x19')](handleEntityNotFound(_0x16f6b6,null))[_0x7b4c('0x19')](respondWithResult(_0x16f6b6,null))[_0x7b4c('0x3d')](handleError(_0x16f6b6,null));};exports[_0x7b4c('0x3e')]=function(_0x39fe32,_0x2c16d4){return db[_0x7b4c('0x35')][_0x7b4c('0x3e')](_0x39fe32['body'],{})[_0x7b4c('0x19')](respondWithResult(_0x2c16d4,0xc9))[_0x7b4c('0x3d')](handleError(_0x2c16d4,null));};exports['update']=function(_0x2c60a5,_0x1bc114){if(_0x2c60a5[_0x7b4c('0x3f')]['id']){delete _0x2c60a5[_0x7b4c('0x3f')]['id'];}return db['ChatOfflineMessage'][_0x7b4c('0x3c')]({'where':{'id':_0x2c60a5[_0x7b4c('0x40')]['id']}})[_0x7b4c('0x19')](handleEntityNotFound(_0x1bc114,null))[_0x7b4c('0x19')](saveUpdates(_0x2c60a5['body'],null))[_0x7b4c('0x19')](respondWithResult(_0x1bc114,null))[_0x7b4c('0x3d')](handleError(_0x1bc114,null));};exports['destroy']=function(_0x2df318,_0x27c5bc){return db[_0x7b4c('0x35')]['find']({'where':{'id':_0x2df318[_0x7b4c('0x40')]['id']}})[_0x7b4c('0x19')](handleEntityNotFound(_0x27c5bc,null))[_0x7b4c('0x19')](removeEntity(_0x27c5bc,null))['catch'](handleError(_0x27c5bc,null));};exports[_0x7b4c('0x41')]=function(_0x16d13f,_0xd971d5){return db['ChatOfflineMessage'][_0x7b4c('0x41')]()[_0x7b4c('0x19')](respondWithResult(_0xd971d5,null))[_0x7b4c('0x3d')](handleError(_0xd971d5,null));};
\ No newline at end of file
+var _0x5362=['index','rawAttributes','keys','query','dateEnd','dateStart','filters','intersection','model','attributes','fields','hasOwnProperty','sort','pick','day','add','where','filter','merge','map','options','includeAll','include','ChatOfflineMessage','findAll','rows','show','params','find','catch','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send'];(function(_0x391c2a,_0x5af288){var _0x1b7889=function(_0x44b118){while(--_0x44b118){_0x391c2a['push'](_0x391c2a['shift']());}};_0x1b7889(++_0x5af288);}(_0x5362,0x6b));var _0x2536=function(_0x4b3ed6,_0x4fee4c){_0x4b3ed6=_0x4b3ed6-0x0;var _0x58efde=_0x5362[_0x4b3ed6];return _0x58efde;};'use strict';var pdf=require(_0x2536('0x0'));var emlformat=require(_0x2536('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2536('0x2'));var jsonpatch=require(_0x2536('0x3'));var rp=require(_0x2536('0x4'));var moment=require(_0x2536('0x5'));var BPromise=require(_0x2536('0x6'));var Mustache=require(_0x2536('0x7'));var util=require(_0x2536('0x8'));var path=require(_0x2536('0x9'));var sox=require(_0x2536('0xa'));var csv=require('to-csv');var ejs=require(_0x2536('0xb'));var fs=require('fs');var _=require(_0x2536('0xc'));var squel=require(_0x2536('0xd'));var crypto=require(_0x2536('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2536('0xf'));var toCsv=require(_0x2536('0x10'));var querystring=require(_0x2536('0x11'));var Papa=require(_0x2536('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0x2536('0x13'))('api');var utils=require(_0x2536('0x14'));var config=require(_0x2536('0x15'));var db=require(_0x2536('0x16'))['db'];function respondWithStatusCode(_0x31d8c1,_0x32f933){_0x32f933=_0x32f933||0xcc;return function(_0x5968cf){if(_0x5968cf){return _0x31d8c1[_0x2536('0x17')](_0x32f933);}return _0x31d8c1[_0x2536('0x18')](_0x32f933)[_0x2536('0x19')]();};}function respondWithResult(_0x395e5,_0x3688de){_0x3688de=_0x3688de||0xc8;return function(_0x1cd1d8){if(_0x1cd1d8){return _0x395e5[_0x2536('0x18')](_0x3688de)[_0x2536('0x1a')](_0x1cd1d8);}};}function respondWithFilteredResult(_0x35397c,_0x5ae0cd){return function(_0x3c6e14){if(_0x3c6e14){var _0x1cc546=_0x3c6e14[_0x2536('0x1b')],_0x4b1748=_0x5ae0cd[_0x2536('0x1c')],_0x965116=_0x5ae0cd['offset']+_0x5ae0cd[_0x2536('0x1d')],_0x302c62;if(_0x965116>=_0x1cc546){_0x965116=_0x1cc546;_0x302c62=0xc8;}else{_0x302c62=0xce;}_0x35397c[_0x2536('0x18')](_0x302c62);return _0x35397c['set'](_0x2536('0x1e'),_0x4b1748+'-'+_0x965116+'/'+_0x1cc546)['json'](_0x3c6e14);}return null;};}function patchUpdates(_0x413328){return function(_0x50a483){try{jsonpatch[_0x2536('0x1f')](_0x50a483,_0x413328,!![]);}catch(_0x1e4e1d){return BPromise[_0x2536('0x20')](_0x1e4e1d);}return _0x50a483[_0x2536('0x21')]();};}function saveUpdates(_0x253752,_0x255407){return function(_0x466b4d){if(_0x466b4d){return _0x466b4d[_0x2536('0x22')](_0x253752)[_0x2536('0x23')](function(_0x8dc009){return _0x8dc009;});}return null;};}function removeEntity(_0x233c23,_0x5d4377){return function(_0x38cc34){if(_0x38cc34){return _0x38cc34[_0x2536('0x24')]()['then'](function(){_0x233c23[_0x2536('0x18')](0xcc)[_0x2536('0x19')]();});}};}function handleEntityNotFound(_0x240cc4,_0x22ba8e){return function(_0x51d5ec){if(!_0x51d5ec){_0x240cc4[_0x2536('0x17')](0x194);}return _0x51d5ec;};}function handleError(_0x3b67d5,_0x1a64b5){_0x1a64b5=_0x1a64b5||0x1f4;return function(_0x3e4ad3){logger[_0x2536('0x25')](_0x3e4ad3[_0x2536('0x26')]);if(_0x3e4ad3['name']){delete _0x3e4ad3[_0x2536('0x27')];}_0x3b67d5[_0x2536('0x18')](_0x1a64b5)[_0x2536('0x28')](_0x3e4ad3);};}exports[_0x2536('0x29')]=function(_0x14da1e,_0x443191){var _0x3a7e20={},_0x3abab6={},_0x5af1cc={'count':0x0,'rows':[]};var _0x24aa1c=db['ChatOfflineMessage'][_0x2536('0x2a')];_0x3abab6['model']=_[_0x2536('0x2b')](_0x24aa1c);var _0x3c71aa={'dateStart':_0x14da1e['query']['dateStart'],'dateEnd':_0x14da1e[_0x2536('0x2c')][_0x2536('0x2d')]};delete _0x14da1e['query'][_0x2536('0x2e')];delete _0x14da1e[_0x2536('0x2c')][_0x2536('0x2d')];_0x3abab6[_0x2536('0x2c')]=_[_0x2536('0x2b')](_0x14da1e[_0x2536('0x2c')]);_0x3abab6[_0x2536('0x2f')]=_[_0x2536('0x30')](_0x3abab6[_0x2536('0x31')],_0x3abab6[_0x2536('0x2c')]);_0x3a7e20[_0x2536('0x32')]=_[_0x2536('0x30')](_0x3abab6[_0x2536('0x31')],qs[_0x2536('0x33')](_0x14da1e[_0x2536('0x2c')][_0x2536('0x33')]));_0x3a7e20[_0x2536('0x32')]=_0x3a7e20[_0x2536('0x32')]['length']?_0x3a7e20[_0x2536('0x32')]:_0x3abab6[_0x2536('0x31')];if(!_0x14da1e[_0x2536('0x2c')][_0x2536('0x34')]('nolimit')){_0x3a7e20[_0x2536('0x1d')]=qs[_0x2536('0x1d')](_0x14da1e[_0x2536('0x2c')][_0x2536('0x1d')]);_0x3a7e20['offset']=qs[_0x2536('0x1c')](_0x14da1e[_0x2536('0x2c')]['offset']);}_0x3a7e20['order']=qs['sort'](_0x14da1e[_0x2536('0x2c')][_0x2536('0x35')]);_0x3a7e20['where']=qs['filters'](_[_0x2536('0x36')](_0x14da1e[_0x2536('0x2c')],_0x3abab6[_0x2536('0x2f')]));if(_0x3c71aa['dateStart']){if(_0x3c71aa['dateEnd']){_0x3c71aa[_0x2536('0x2d')]=moment(_0x3c71aa[_0x2536('0x2d')])['add'](0x1,_0x2536('0x37'));}else{_0x3c71aa[_0x2536('0x2d')]=moment(_0x3c71aa['dateStart'])[_0x2536('0x38')](0x1,'day');}_['merge'](_0x3a7e20[_0x2536('0x39')],{'createdAt':{'$gte':_0x3c71aa[_0x2536('0x2e')],'$lte':_0x3c71aa[_0x2536('0x2d')]}});}if(_0x14da1e[_0x2536('0x2c')][_0x2536('0x3a')]){_0x3a7e20['where']=_[_0x2536('0x3b')](_0x3a7e20[_0x2536('0x39')],{'$or':_[_0x2536('0x3c')](_0x3a7e20[_0x2536('0x32')],function(_0x16f612){var _0x38a8a9={};_0x38a8a9[_0x16f612]={'$like':'%'+_0x14da1e[_0x2536('0x2c')][_0x2536('0x3a')]+'%'};return _0x38a8a9;})});}_0x3a7e20=_['merge']({},_0x3a7e20,_0x14da1e[_0x2536('0x3d')]);var _0x2a2707={'where':_0x3a7e20[_0x2536('0x39')]};return db['ChatOfflineMessage'][_0x2536('0x1b')](_0x2a2707)[_0x2536('0x23')](function(_0x123413){_0x5af1cc[_0x2536('0x1b')]=_0x123413;if(_0x14da1e[_0x2536('0x2c')][_0x2536('0x3e')]){_0x3a7e20[_0x2536('0x3f')]=[{'all':!![]}];}return db[_0x2536('0x40')][_0x2536('0x41')](_0x3a7e20);})[_0x2536('0x23')](function(_0x479090){_0x5af1cc[_0x2536('0x42')]=_0x479090;return _0x5af1cc;})['then'](respondWithFilteredResult(_0x443191,_0x3a7e20))['catch'](handleError(_0x443191,null));};exports[_0x2536('0x43')]=function(_0x1d3618,_0x4383f7){var _0x3dd7d5={'raw':!![],'where':{'id':_0x1d3618[_0x2536('0x44')]['id']}},_0x4e5848={};_0x4e5848[_0x2536('0x31')]=_[_0x2536('0x2b')](db[_0x2536('0x40')]['rawAttributes']);_0x4e5848[_0x2536('0x2c')]=_[_0x2536('0x2b')](_0x1d3618[_0x2536('0x2c')]);_0x4e5848[_0x2536('0x2f')]=_[_0x2536('0x30')](_0x4e5848[_0x2536('0x31')],_0x4e5848[_0x2536('0x2c')]);_0x3dd7d5[_0x2536('0x32')]=_[_0x2536('0x30')](_0x4e5848[_0x2536('0x31')],qs['fields'](_0x1d3618[_0x2536('0x2c')][_0x2536('0x33')]));_0x3dd7d5[_0x2536('0x32')]=_0x3dd7d5[_0x2536('0x32')]['length']?_0x3dd7d5['attributes']:_0x4e5848[_0x2536('0x31')];if(_0x1d3618[_0x2536('0x2c')][_0x2536('0x3e')]){_0x3dd7d5['include']=[{'all':!![]}];}_0x3dd7d5=_[_0x2536('0x3b')]({},_0x3dd7d5,_0x1d3618['options']);return db['ChatOfflineMessage'][_0x2536('0x45')](_0x3dd7d5)[_0x2536('0x23')](handleEntityNotFound(_0x4383f7,null))[_0x2536('0x23')](respondWithResult(_0x4383f7,null))[_0x2536('0x46')](handleError(_0x4383f7,null));};exports[_0x2536('0x47')]=function(_0x215d84,_0x4a7b8a){return db[_0x2536('0x40')][_0x2536('0x47')](_0x215d84[_0x2536('0x48')],{})[_0x2536('0x23')](respondWithResult(_0x4a7b8a,0xc9))[_0x2536('0x46')](handleError(_0x4a7b8a,null));};exports[_0x2536('0x22')]=function(_0x535b31,_0x3b0f88){if(_0x535b31['body']['id']){delete _0x535b31['body']['id'];}return db[_0x2536('0x40')][_0x2536('0x45')]({'where':{'id':_0x535b31[_0x2536('0x44')]['id']}})[_0x2536('0x23')](handleEntityNotFound(_0x3b0f88,null))[_0x2536('0x23')](saveUpdates(_0x535b31[_0x2536('0x48')],null))['then'](respondWithResult(_0x3b0f88,null))['catch'](handleError(_0x3b0f88,null));};exports['destroy']=function(_0x98d11a,_0x41b2fa){return db[_0x2536('0x40')][_0x2536('0x45')]({'where':{'id':_0x98d11a[_0x2536('0x44')]['id']}})[_0x2536('0x23')](handleEntityNotFound(_0x41b2fa,null))[_0x2536('0x23')](removeEntity(_0x41b2fa,null))['catch'](handleError(_0x41b2fa,null));};exports[_0x2536('0x49')]=function(_0x5538eb,_0x4f8bb9){return db[_0x2536('0x40')][_0x2536('0x49')]()['then'](respondWithResult(_0x4f8bb9,null))['catch'](handleError(_0x4f8bb9,null));};
\ No newline at end of file
index ee165ee..30461db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04e9=['bluebird','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x831790,_0x14b960){var _0x58574d=function(_0x5f0255){while(--_0x5f0255){_0x831790['push'](_0x831790['shift']());}};_0x58574d(++_0x14b960);}(_0x04e9,0x1b7));var _0x904e=function(_0x4fb676,_0x40cfda){_0x4fb676=_0x4fb676-0x0;var _0x17290c=_0x04e9[_0x4fb676];return _0x17290c;};'use strict';var _=require(_0x904e('0x0'));var util=require(_0x904e('0x1'));var logger=require(_0x904e('0x2'))(_0x904e('0x3'));var moment=require(_0x904e('0x4'));var BPromise=require(_0x904e('0x5'));var rp=require('request-promise');var attributes=require(_0x904e('0x6'));module[_0x904e('0x7')]=function(_0xf005e8,_0x239c7b){return _0xf005e8[_0x904e('0x8')](_0x904e('0x9'),attributes,{'tableName':_0x904e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x904e('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xc93d=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./chatOfflineMessage.attributes','define','ChatOfflineMessage'];(function(_0x20714a,_0x7de591){var _0x15e877=function(_0x3f9f8d){while(--_0x3f9f8d){_0x20714a['push'](_0x20714a['shift']());}};_0x15e877(++_0x7de591);}(_0xc93d,0x122));var _0xdc93=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0xc93d[_0x5f1617];return _0x3af5da;};'use strict';var _=require(_0xdc93('0x0'));var util=require(_0xdc93('0x1'));var logger=require(_0xdc93('0x2'))(_0xdc93('0x3'));var moment=require(_0xdc93('0x4'));var BPromise=require(_0xdc93('0x5'));var rp=require(_0xdc93('0x6'));var attributes=require(_0xdc93('0x7'));module['exports']=function(_0x552e3e,_0x5953c1){return _0x552e3e[_0xdc93('0x8')](_0xdc93('0x9'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdc93('0xa'),'collate':_0xdc93('0xb')});};
\ No newline at end of file
index af9edbb..f121e19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75a2=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x75a2,0x85));var _0x275a=function(_0x113518,_0x32b90c){_0x113518=_0x113518-0x0;var _0xd978c8=_0x75a2[_0x113518];return _0xd978c8;};'use strict';var _=require(_0x275a('0x0'));var util=require(_0x275a('0x1'));var moment=require(_0x275a('0x2'));var BPromise=require(_0x275a('0x3'));var rs=require(_0x275a('0x4'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x275a('0x5'));var logger=require(_0x275a('0x6'))(_0x275a('0x7'));var config=require(_0x275a('0x8'));var jayson=require(_0x275a('0x9'));var client=jayson[_0x275a('0xa')][_0x275a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dd171,_0xacc225,_0x13a58e){return new BPromise(function(_0x366216,_0x47e8be){return client[_0x275a('0xc')](_0x5dd171,_0x13a58e)[_0x275a('0xd')](function(_0x207663){logger['info'](_0x275a('0xe'),_0xacc225,'request\x20sent');logger['debug'](_0x275a('0xf'),_0xacc225,'request\x20sent',JSON['stringify'](_0x207663));if(_0x207663['error']){if(_0x207663[_0x275a('0x10')][_0x275a('0x11')]===0x1f4){logger[_0x275a('0x10')](_0x275a('0xe'),_0xacc225,_0x207663['error']['message']);return _0x47e8be(_0x207663[_0x275a('0x10')][_0x275a('0x12')]);}logger[_0x275a('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0xacc225,_0x207663[_0x275a('0x10')][_0x275a('0x12')]);return _0x366216(_0x207663[_0x275a('0x10')][_0x275a('0x12')]);}else{logger[_0x275a('0x13')](_0x275a('0xe'),_0xacc225,_0x275a('0x14'));_0x366216(_0x207663[_0x275a('0x15')][_0x275a('0x12')]);}})[_0x275a('0x16')](function(_0xe29659){logger[_0x275a('0x10')](_0x275a('0xe'),_0xacc225,_0xe29659);_0x47e8be(_0xe29659);});});}
\ No newline at end of file
+var _0x6ebe=['client','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4df29d,_0x52cf44){var _0x50b549=function(_0x2685e5){while(--_0x2685e5){_0x4df29d['push'](_0x4df29d['shift']());}};_0x50b549(++_0x52cf44);}(_0x6ebe,0x146));var _0xe6eb=function(_0x1f6a84,_0x44a188){_0x1f6a84=_0x1f6a84-0x0;var _0x14da8a=_0x6ebe[_0x1f6a84];return _0x14da8a;};'use strict';var _=require(_0xe6eb('0x0'));var util=require(_0xe6eb('0x1'));var moment=require(_0xe6eb('0x2'));var BPromise=require(_0xe6eb('0x3'));var rs=require(_0xe6eb('0x4'));var fs=require('fs');var db=require(_0xe6eb('0x5'))['db'];var utils=require(_0xe6eb('0x6'));var logger=require(_0xe6eb('0x7'))(_0xe6eb('0x8'));var config=require(_0xe6eb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe6eb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc5daeb,_0x1c7245,_0x3410ba){return new BPromise(function(_0x20f609,_0x4d5882){return client[_0xe6eb('0xb')](_0xc5daeb,_0x3410ba)['then'](function(_0x2d66e8){logger[_0xe6eb('0xc')](_0xe6eb('0xd'),_0x1c7245,_0xe6eb('0xe'));logger[_0xe6eb('0xf')](_0xe6eb('0x10'),_0x1c7245,_0xe6eb('0xe'),JSON['stringify'](_0x2d66e8));if(_0x2d66e8['error']){if(_0x2d66e8[_0xe6eb('0x11')][_0xe6eb('0x12')]===0x1f4){logger['error'](_0xe6eb('0xd'),_0x1c7245,_0x2d66e8[_0xe6eb('0x11')][_0xe6eb('0x13')]);return _0x4d5882(_0x2d66e8[_0xe6eb('0x11')][_0xe6eb('0x13')]);}logger[_0xe6eb('0x11')](_0xe6eb('0xd'),_0x1c7245,_0x2d66e8[_0xe6eb('0x11')][_0xe6eb('0x13')]);return _0x20f609(_0x2d66e8[_0xe6eb('0x11')][_0xe6eb('0x13')]);}else{logger[_0xe6eb('0xc')](_0xe6eb('0xd'),_0x1c7245,_0xe6eb('0xe'));_0x20f609(_0x2d66e8['result']['message']);}})[_0xe6eb('0x14')](function(_0x1659cf){logger[_0xe6eb('0x11')](_0xe6eb('0xd'),_0x1c7245,_0x1659cf);_0x4d5882(_0x1659cf);});});}
\ No newline at end of file
index 07afd04..bd8fc86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0dcf=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','express'];(function(_0xa1e3ca,_0x559022){var _0x5005ab=function(_0x12f90e){while(--_0x12f90e){_0xa1e3ca['push'](_0xa1e3ca['shift']());}};_0x5005ab(++_0x559022);}(_0x0dcf,0xcf));var _0xf0dc=function(_0x236b93,_0x12abed){_0x236b93=_0x236b93-0x0;var _0x38641f=_0x0dcf[_0x236b93];return _0x38641f;};'use strict';var multer=require(_0xf0dc('0x0'));var util=require(_0xf0dc('0x1'));var path=require('path');var express=require(_0xf0dc('0x2'));var router=express[_0xf0dc('0x3')]();var auth=require(_0xf0dc('0x4'));var interaction=require(_0xf0dc('0x5'));var config=require(_0xf0dc('0x6'));var controller=require(_0xf0dc('0x7'));router['get']('/',auth[_0xf0dc('0x8')](),controller[_0xf0dc('0x9')]);router[_0xf0dc('0xa')](_0xf0dc('0xb'),auth['isAuthenticated'](),controller[_0xf0dc('0xc')]);router[_0xf0dc('0xa')](_0xf0dc('0xd'),auth[_0xf0dc('0x8')](),controller[_0xf0dc('0xe')]);router[_0xf0dc('0xf')]('/',auth['isAuthenticated'](),controller[_0xf0dc('0x10')]);router[_0xf0dc('0x11')](_0xf0dc('0xd'),auth[_0xf0dc('0x8')](),controller[_0xf0dc('0x12')]);router['delete'](_0xf0dc('0xd'),auth[_0xf0dc('0x8')](),controller[_0xf0dc('0x13')]);module[_0xf0dc('0x14')]=router;
\ No newline at end of file
+var _0x3b56=['delete','exports','util','../../components/auth/service','../../config/environment','isAuthenticated','index','describe','/:id','show','create','put','update'];(function(_0x5f3562,_0x212f41){var _0x1b39b4=function(_0x153e49){while(--_0x153e49){_0x5f3562['push'](_0x5f3562['shift']());}};_0x1b39b4(++_0x212f41);}(_0x3b56,0xdf));var _0x63b5=function(_0x493d19,_0x352120){_0x493d19=_0x493d19-0x0;var _0x25ea60=_0x3b56[_0x493d19];return _0x25ea60;};'use strict';var multer=require('multer');var util=require(_0x63b5('0x0'));var path=require('path');var express=require('express');var router=express['Router']();var auth=require(_0x63b5('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x63b5('0x2'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0x63b5('0x3')](),controller[_0x63b5('0x4')]);router['get']('/describe',auth[_0x63b5('0x3')](),controller[_0x63b5('0x5')]);router['get'](_0x63b5('0x6'),auth[_0x63b5('0x3')](),controller[_0x63b5('0x7')]);router['post']('/',auth[_0x63b5('0x3')](),controller[_0x63b5('0x8')]);router[_0x63b5('0x9')]('/:id',auth[_0x63b5('0x3')](),controller[_0x63b5('0xa')]);router[_0x63b5('0xb')](_0x63b5('0x6'),auth[_0x63b5('0x3')](),controller['destroy']);module[_0x63b5('0xc')]=router;
\ No newline at end of file
index d016342..c52534f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dee=['exports','STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0x25383a,_0xd9b3c5){var _0x25fdb1=function(_0x343ca3){while(--_0x343ca3){_0x25383a['push'](_0x25383a['shift']());}};_0x25fdb1(++_0xd9b3c5);}(_0x4dee,0x172));var _0xe4de=function(_0xe79b95,_0x54fcd8){_0xe79b95=_0xe79b95-0x0;var _0x5a3faf=_0x4dee[_0xe79b95];return _0x5a3faf;};'use strict';var Sequelize=require(_0xe4de('0x0'));module[_0xe4de('0x1')]={'name':{'type':Sequelize[_0xe4de('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe4de('0x3')](_0xe4de('0x4'),_0xe4de('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xe4de('0x2')]},'timeout':{'type':Sequelize[_0xe4de('0x6')]}};
\ No newline at end of file
+var _0xaaca=['exports','STRING','ENUM','mouseOver','INTEGER','sequelize'];(function(_0xa3fa3,_0x328285){var _0x488dd4=function(_0x1c4f57){while(--_0x1c4f57){_0xa3fa3['push'](_0xa3fa3['shift']());}};_0x488dd4(++_0x328285);}(_0xaaca,0x167));var _0xaaac=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0xaaca[_0x2afbb0];return _0x411ff2;};'use strict';var Sequelize=require(_0xaaac('0x0'));module[_0xaaac('0x1')]={'name':{'type':Sequelize[_0xaaac('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xaaac('0x3')]('mouseOver','timeout'),'defaultValue':_0xaaac('0x4')},'selector':{'type':Sequelize[_0xaaac('0x2')]},'timeout':{'type':Sequelize[_0xaaac('0x5')]}};
\ No newline at end of file
index 7fb117a..383469d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['Content-Range','json','apply','save','update','destroy','then','error','stack','name','send','show','params','keys','ChatProactiveAction','rawAttributes','query','filters','model','attributes','fields','length','includeAll','merge','options','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set'];(function(_0x435be7,_0x95a876){var _0x4b7e7e=function(_0x566a9b){while(--_0x566a9b){_0x435be7['push'](_0x435be7['shift']());}};_0x4b7e7e(++_0x95a876);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var qs=require(_0x7995('0x12'));var logger=require(_0x7995('0x13'))(_0x7995('0x14'));var utils=require(_0x7995('0x15'));var config=require(_0x7995('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x245143,_0x41c652){_0x41c652=_0x41c652||0xcc;return function(_0x581f22){if(_0x581f22){return _0x245143[_0x7995('0x17')](_0x41c652);}return _0x245143[_0x7995('0x18')](_0x41c652)[_0x7995('0x19')]();};}function respondWithResult(_0x385f00,_0x281576){_0x281576=_0x281576||0xc8;return function(_0x23999f){if(_0x23999f){return _0x385f00[_0x7995('0x18')](_0x281576)['json'](_0x23999f);}};}function respondWithFilteredResult(_0x58f5ad,_0x2b4e94){return function(_0x2233dd){if(_0x2233dd){var _0x24b5bb=_0x2233dd[_0x7995('0x1a')],_0x321ae8=_0x2b4e94[_0x7995('0x1b')],_0x3f1d3e=_0x2b4e94['offset']+_0x2b4e94[_0x7995('0x1c')],_0x1a5310;if(_0x3f1d3e>=_0x24b5bb){_0x3f1d3e=_0x24b5bb;_0x1a5310=0xc8;}else{_0x1a5310=0xce;}_0x58f5ad['status'](_0x1a5310);return _0x58f5ad[_0x7995('0x1d')](_0x7995('0x1e'),_0x321ae8+'-'+_0x3f1d3e+'/'+_0x24b5bb)[_0x7995('0x1f')](_0x2233dd);}return null;};}function patchUpdates(_0x291317){return function(_0x1e1415){try{jsonpatch[_0x7995('0x20')](_0x1e1415,_0x291317,!![]);}catch(_0x4faa60){return BPromise['reject'](_0x4faa60);}return _0x1e1415[_0x7995('0x21')]();};}function saveUpdates(_0x5e6f90,_0x555f74){return function(_0x3ec178){if(_0x3ec178){return _0x3ec178[_0x7995('0x22')](_0x5e6f90)['then'](function(_0x3a9b54){return _0x3a9b54;});}return null;};}function removeEntity(_0x51f276,_0x4b1a8e){return function(_0x3e4c54){if(_0x3e4c54){return _0x3e4c54[_0x7995('0x23')]()[_0x7995('0x24')](function(){_0x51f276[_0x7995('0x18')](0xcc)[_0x7995('0x19')]();});}};}function handleEntityNotFound(_0x1c278a,_0x5d40ae){return function(_0x32a09a){if(!_0x32a09a){_0x1c278a[_0x7995('0x17')](0x194);}return _0x32a09a;};}function handleError(_0x204507,_0x285437){_0x285437=_0x285437||0x1f4;return function(_0x563799){logger[_0x7995('0x25')](_0x563799[_0x7995('0x26')]);if(_0x563799[_0x7995('0x27')]){delete _0x563799['name'];}_0x204507[_0x7995('0x18')](_0x285437)[_0x7995('0x28')](_0x563799);};}exports[_0x7995('0x29')]=function(_0x268ce7,_0x3a3fcf){var _0x2a307e={'raw':!![],'where':{'id':_0x268ce7[_0x7995('0x2a')]['id']}},_0x56691a={};_0x56691a['model']=_[_0x7995('0x2b')](db[_0x7995('0x2c')][_0x7995('0x2d')]);_0x56691a[_0x7995('0x2e')]=_[_0x7995('0x2b')](_0x268ce7['query']);_0x56691a[_0x7995('0x2f')]=_['intersection'](_0x56691a[_0x7995('0x30')],_0x56691a[_0x7995('0x2e')]);_0x2a307e[_0x7995('0x31')]=_['intersection'](_0x56691a['model'],qs['fields'](_0x268ce7[_0x7995('0x2e')][_0x7995('0x32')]));_0x2a307e[_0x7995('0x31')]=_0x2a307e[_0x7995('0x31')][_0x7995('0x33')]?_0x2a307e[_0x7995('0x31')]:_0x56691a['model'];if(_0x268ce7['query'][_0x7995('0x34')]){_0x2a307e['include']=[{'all':!![]}];}_0x2a307e=_[_0x7995('0x35')]({},_0x2a307e,_0x268ce7[_0x7995('0x36')]);return db[_0x7995('0x2c')][_0x7995('0x37')](_0x2a307e)[_0x7995('0x24')](handleEntityNotFound(_0x3a3fcf,null))['then'](respondWithResult(_0x3a3fcf,null))[_0x7995('0x38')](handleError(_0x3a3fcf,null));};exports[_0x7995('0x39')]=function(_0x5dd802,_0x48db25){return db['ChatProactiveAction'][_0x7995('0x39')](_0x5dd802[_0x7995('0x3a')],{})['then'](respondWithResult(_0x48db25,0xc9))[_0x7995('0x38')](handleError(_0x48db25,null));};exports['update']=function(_0x37917b,_0x1cb058){if(_0x37917b[_0x7995('0x3a')]['id']){delete _0x37917b['body']['id'];}return db['ChatProactiveAction'][_0x7995('0x37')]({'where':{'id':_0x37917b['params']['id']}})['then'](handleEntityNotFound(_0x1cb058,null))[_0x7995('0x24')](saveUpdates(_0x37917b[_0x7995('0x3a')],null))['then'](respondWithResult(_0x1cb058,null))[_0x7995('0x38')](handleError(_0x1cb058,null));};exports[_0x7995('0x23')]=function(_0x2b772f,_0x18667c){return db[_0x7995('0x2c')]['find']({'where':{'id':_0x2b772f[_0x7995('0x2a')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x18667c,null))[_0x7995('0x24')](removeEntity(_0x18667c,null))[_0x7995('0x38')](handleError(_0x18667c,null));};
\ No newline at end of file
+var _0xa9e0=['reject','save','update','then','error','stack','name','model','ChatProactiveAction','query','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','params','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','Content-Range','apply'];(function(_0x188650,_0xc40d8){var _0x4db216=function(_0x42cc5c){while(--_0x42cc5c){_0x188650['push'](_0x188650['shift']());}};_0x4db216(++_0xc40d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var qs=require(_0x0a9e('0xe'));var logger=require(_0x0a9e('0xf'))(_0x0a9e('0x10'));var utils=require(_0x0a9e('0x11'));var config=require(_0x0a9e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50dfb2,_0x527cdd){_0x527cdd=_0x527cdd||0xcc;return function(_0x4cfe67){if(_0x4cfe67){return _0x50dfb2[_0x0a9e('0x13')](_0x527cdd);}return _0x50dfb2[_0x0a9e('0x14')](_0x527cdd)[_0x0a9e('0x15')]();};}function respondWithResult(_0x26d672,_0x32d742){_0x32d742=_0x32d742||0xc8;return function(_0x69aeb7){if(_0x69aeb7){return _0x26d672['status'](_0x32d742)[_0x0a9e('0x16')](_0x69aeb7);}};}function respondWithFilteredResult(_0x239b12,_0x2b4227){return function(_0x281129){if(_0x281129){var _0x44dcfd=_0x281129['count'],_0x4d5611=_0x2b4227[_0x0a9e('0x17')],_0x52a03d=_0x2b4227['offset']+_0x2b4227[_0x0a9e('0x18')],_0x22dccb;if(_0x52a03d>=_0x44dcfd){_0x52a03d=_0x44dcfd;_0x22dccb=0xc8;}else{_0x22dccb=0xce;}_0x239b12[_0x0a9e('0x14')](_0x22dccb);return _0x239b12['set'](_0x0a9e('0x19'),_0x4d5611+'-'+_0x52a03d+'/'+_0x44dcfd)['json'](_0x281129);}return null;};}function patchUpdates(_0x459eb1){return function(_0x478723){try{jsonpatch[_0x0a9e('0x1a')](_0x478723,_0x459eb1,!![]);}catch(_0x205fd6){return BPromise[_0x0a9e('0x1b')](_0x205fd6);}return _0x478723[_0x0a9e('0x1c')]();};}function saveUpdates(_0x530eb7,_0x20559e){return function(_0x1314ae){if(_0x1314ae){return _0x1314ae[_0x0a9e('0x1d')](_0x530eb7)[_0x0a9e('0x1e')](function(_0x105080){return _0x105080;});}return null;};}function removeEntity(_0x4bb1e3,_0x2c3407){return function(_0x155cce){if(_0x155cce){return _0x155cce['destroy']()[_0x0a9e('0x1e')](function(){_0x4bb1e3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a02e1,_0x432e56){return function(_0x38e7c4){if(!_0x38e7c4){_0x3a02e1[_0x0a9e('0x13')](0x194);}return _0x38e7c4;};}function handleError(_0x4abc77,_0xfb6e48){_0xfb6e48=_0xfb6e48||0x1f4;return function(_0x2fb0e4){logger[_0x0a9e('0x1f')](_0x2fb0e4[_0x0a9e('0x20')]);if(_0x2fb0e4[_0x0a9e('0x21')]){delete _0x2fb0e4[_0x0a9e('0x21')];}_0x4abc77[_0x0a9e('0x14')](_0xfb6e48)['send'](_0x2fb0e4);};}exports['show']=function(_0x197ec0,_0x3a8e58){var _0x40c424={'raw':!![],'where':{'id':_0x197ec0['params']['id']}},_0x33161b={};_0x33161b[_0x0a9e('0x22')]=_['keys'](db[_0x0a9e('0x23')]['rawAttributes']);_0x33161b[_0x0a9e('0x24')]=_[_0x0a9e('0x25')](_0x197ec0[_0x0a9e('0x24')]);_0x33161b[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x22')],_0x33161b[_0x0a9e('0x24')]);_0x40c424[_0x0a9e('0x28')]=_['intersection'](_0x33161b[_0x0a9e('0x22')],qs[_0x0a9e('0x29')](_0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x29')]));_0x40c424['attributes']=_0x40c424[_0x0a9e('0x28')][_0x0a9e('0x2a')]?_0x40c424[_0x0a9e('0x28')]:_0x33161b[_0x0a9e('0x22')];if(_0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x2b')]){_0x40c424[_0x0a9e('0x2c')]=[{'all':!![]}];}_0x40c424=_[_0x0a9e('0x2d')]({},_0x40c424,_0x197ec0[_0x0a9e('0x2e')]);return db['ChatProactiveAction'][_0x0a9e('0x2f')](_0x40c424)['then'](handleEntityNotFound(_0x3a8e58,null))[_0x0a9e('0x1e')](respondWithResult(_0x3a8e58,null))[_0x0a9e('0x30')](handleError(_0x3a8e58,null));};exports[_0x0a9e('0x31')]=function(_0x33bdb7,_0x25ce3a){return db['ChatProactiveAction'][_0x0a9e('0x31')](_0x33bdb7[_0x0a9e('0x32')],{})[_0x0a9e('0x1e')](respondWithResult(_0x25ce3a,0xc9))[_0x0a9e('0x30')](handleError(_0x25ce3a,null));};exports[_0x0a9e('0x1d')]=function(_0x409319,_0x332d35){if(_0x409319[_0x0a9e('0x32')]['id']){delete _0x409319['body']['id'];}return db[_0x0a9e('0x23')]['find']({'where':{'id':_0x409319[_0x0a9e('0x33')]['id']}})[_0x0a9e('0x1e')](handleEntityNotFound(_0x332d35,null))[_0x0a9e('0x1e')](saveUpdates(_0x409319[_0x0a9e('0x32')],null))['then'](respondWithResult(_0x332d35,null))[_0x0a9e('0x30')](handleError(_0x332d35,null));};exports[_0x0a9e('0x34')]=function(_0x1fa90d,_0x15de0e){return db['ChatProactiveAction']['find']({'where':{'id':_0x1fa90d[_0x0a9e('0x33')]['id']}})['then'](handleEntityNotFound(_0x15de0e,null))[_0x0a9e('0x1e')](removeEntity(_0x15de0e,null))[_0x0a9e('0x30')](handleError(_0x15de0e,null));};
\ No newline at end of file
index bb5d59d..9f0f218 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['ChatProactiveAction','chat_proactive_actions','util','api','moment','bluebird','./chatProactiveAction.attributes','exports','define'];(function(_0x43a9f9,_0x2e9c17){var _0x9534e0=function(_0x587eb4){while(--_0x587eb4){_0x43a9f9['push'](_0x43a9f9['shift']());}};_0x9534e0(++_0x2e9c17);}(_0xadb5,0xad));var _0x5adb=function(_0x59244b,_0x22b7b5){_0x59244b=_0x59244b-0x0;var _0x50a5f1=_0xadb5[_0x59244b];return _0x50a5f1;};'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 attributes=require(_0x5adb('0x4'));module[_0x5adb('0x5')]=function(_0x2e3ef4,_0x4cb1d1){return _0x2e3ef4[_0x5adb('0x6')](_0x5adb('0x7'),attributes,{'tableName':_0x5adb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5f66=['util','api','moment','bluebird','request-promise','./chatProactiveAction.attributes','define','ChatProactiveAction'];(function(_0x372dc5,_0x54c262){var _0x44dc72=function(_0x55424b){while(--_0x55424b){_0x372dc5['push'](_0x372dc5['shift']());}};_0x44dc72(++_0x54c262);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var logger=require('../../config/logger')(_0x65f6('0x1'));var moment=require(_0x65f6('0x2'));var BPromise=require(_0x65f6('0x3'));var rp=require(_0x65f6('0x4'));var attributes=require(_0x65f6('0x5'));module['exports']=function(_0x3c5029,_0x5150c8){return _0x3c5029[_0x65f6('0x6')](_0x65f6('0x7'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e58a8cc..84f1e94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb935=['rpc','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','../../config/utils','../../config/logger'];(function(_0x43dcea,_0x13bca0){var _0x41d014=function(_0x25db1f){while(--_0x25db1f){_0x43dcea['push'](_0x43dcea['shift']());}};_0x41d014(++_0x13bca0);}(_0xb935,0xb0));var _0x5b93=function(_0x4a81a5,_0x421e50){_0x4a81a5=_0x4a81a5-0x0;var _0xcd5ecf=_0xb935[_0x4a81a5];return _0xcd5ecf;};'use strict';var _=require('lodash');var util=require(_0x5b93('0x0'));var moment=require(_0x5b93('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x5b93('0x2'));var logger=require(_0x5b93('0x3'))(_0x5b93('0x4'));var config=require(_0x5b93('0x5'));var jayson=require(_0x5b93('0x6'));var client=jayson[_0x5b93('0x7')][_0x5b93('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13782a,_0x462571,_0x13458e){return new BPromise(function(_0x4d04aa,_0x416dae){return client[_0x5b93('0x9')](_0x13782a,_0x13458e)['then'](function(_0x3fb1dc){logger[_0x5b93('0xa')](_0x5b93('0xb'),_0x462571,_0x5b93('0xc'));logger['debug'](_0x5b93('0xd'),_0x462571,_0x5b93('0xc'),JSON[_0x5b93('0xe')](_0x3fb1dc));if(_0x3fb1dc[_0x5b93('0xf')]){if(_0x3fb1dc[_0x5b93('0xf')][_0x5b93('0x10')]===0x1f4){logger[_0x5b93('0xf')](_0x5b93('0xb'),_0x462571,_0x3fb1dc[_0x5b93('0xf')][_0x5b93('0x11')]);return _0x416dae(_0x3fb1dc[_0x5b93('0xf')]['message']);}logger[_0x5b93('0xf')](_0x5b93('0xb'),_0x462571,_0x3fb1dc[_0x5b93('0xf')][_0x5b93('0x11')]);return _0x4d04aa(_0x3fb1dc[_0x5b93('0xf')][_0x5b93('0x11')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x462571,_0x5b93('0xc'));_0x4d04aa(_0x3fb1dc['result'][_0x5b93('0x11')]);}})['catch'](function(_0x467388){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x462571,_0x467388);_0x416dae(_0x467388);});});}
\ No newline at end of file
+var _0x4f41=['../../config/environment','client','http','request','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','ChatProactiveAction,\x20%s,\x20%s','message','info','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x4171ab,_0x3f0e2d){var _0x36cc95=function(_0x366297){while(--_0x366297){_0x4171ab['push'](_0x4171ab['shift']());}};_0x36cc95(++_0x3f0e2d);}(_0x4f41,0xdd));var _0x14f4=function(_0x421c56,_0x4efd00){_0x421c56=_0x421c56-0x0;var _0x49b244=_0x4f41[_0x421c56];return _0x49b244;};'use strict';var _=require('lodash');var util=require(_0x14f4('0x0'));var moment=require(_0x14f4('0x1'));var BPromise=require(_0x14f4('0x2'));var rs=require(_0x14f4('0x3'));var fs=require('fs');var db=require(_0x14f4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x14f4('0x5'))(_0x14f4('0x6'));var config=require(_0x14f4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x14f4('0x8')][_0x14f4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x112be1,_0x21ec9e,_0x2966dd){return new BPromise(function(_0x4573d8,_0x5f0976){return client[_0x14f4('0xa')](_0x112be1,_0x2966dd)['then'](function(_0x40548b){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x21ec9e,_0x14f4('0xb'));logger[_0x14f4('0xc')](_0x14f4('0xd'),_0x21ec9e,_0x14f4('0xb'),JSON['stringify'](_0x40548b));if(_0x40548b[_0x14f4('0xe')]){if(_0x40548b[_0x14f4('0xe')]['code']===0x1f4){logger[_0x14f4('0xe')](_0x14f4('0xf'),_0x21ec9e,_0x40548b[_0x14f4('0xe')]['message']);return _0x5f0976(_0x40548b['error'][_0x14f4('0x10')]);}logger[_0x14f4('0xe')](_0x14f4('0xf'),_0x21ec9e,_0x40548b['error'][_0x14f4('0x10')]);return _0x4573d8(_0x40548b['error']['message']);}else{logger[_0x14f4('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x21ec9e,_0x14f4('0xb'));_0x4573d8(_0x40548b['result'][_0x14f4('0x10')]);}})[_0x14f4('0x12')](function(_0x425b62){logger[_0x14f4('0xe')](_0x14f4('0xf'),_0x21ec9e,_0x425b62);_0x5f0976(_0x425b62);});});}
\ No newline at end of file
index ec4c505..82407ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1172=['get','/:id','isAuthenticated','show','post','create','put','update','exports','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x408d4b,_0x1d0e7b){var _0x25eea8=function(_0x4ba0b4){while(--_0x4ba0b4){_0x408d4b['push'](_0x408d4b['shift']());}};_0x25eea8(++_0x1d0e7b);}(_0x1172,0x81));var _0x2117=function(_0x3f0ab4,_0x41d2af){_0x3f0ab4=_0x3f0ab4-0x0;var _0x1ed9eb=_0x1172[_0x3f0ab4];return _0x1ed9eb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2117('0x0'));var express=require(_0x2117('0x1'));var router=express['Router']();var auth=require(_0x2117('0x2'));var interaction=require(_0x2117('0x3'));var config=require(_0x2117('0x4'));var controller=require(_0x2117('0x5'));router[_0x2117('0x6')](_0x2117('0x7'),auth[_0x2117('0x8')](),controller[_0x2117('0x9')]);router[_0x2117('0xa')]('/',auth[_0x2117('0x8')](),controller[_0x2117('0xb')]);router[_0x2117('0xc')]('/:id',auth[_0x2117('0x8')](),controller[_0x2117('0xd')]);router['delete'](_0x2117('0x7'),auth[_0x2117('0x8')](),controller['destroy']);module[_0x2117('0xe')]=router;
\ No newline at end of file
+var _0x0e0e=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports'];(function(_0x356385,_0x258aa9){var _0x53977d=function(_0x1c651a){while(--_0x1c651a){_0x356385['push'](_0x356385['shift']());}};_0x53977d(++_0x258aa9);}(_0x0e0e,0xa2));var _0xe0e0=function(_0x165194,_0x31a93e){_0x165194=_0x165194-0x0;var _0x2975f0=_0x0e0e[_0x165194];return _0x2975f0;};'use strict';var multer=require(_0xe0e0('0x0'));var util=require(_0xe0e0('0x1'));var path=require(_0xe0e0('0x2'));var express=require(_0xe0e0('0x3'));var router=express[_0xe0e0('0x4')]();var auth=require(_0xe0e0('0x5'));var interaction=require(_0xe0e0('0x6'));var config=require('../../config/environment');var controller=require(_0xe0e0('0x7'));router[_0xe0e0('0x8')](_0xe0e0('0x9'),auth[_0xe0e0('0xa')](),controller[_0xe0e0('0xb')]);router[_0xe0e0('0xc')]('/',auth['isAuthenticated'](),controller[_0xe0e0('0xd')]);router[_0xe0e0('0xe')](_0xe0e0('0x9'),auth[_0xe0e0('0xa')](),controller['update']);router[_0xe0e0('0xf')](_0xe0e0('0x9'),auth[_0xe0e0('0xa')](),controller[_0xe0e0('0x10')]);module[_0xe0e0('0x11')]=router;
\ No newline at end of file
index c098b33..ccaf7d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3287=['sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x3c44ce,_0x3b9dc8){var _0x55588f=function(_0x1c1819){while(--_0x1c1819){_0x3c44ce['push'](_0x3c44ce['shift']());}};_0x55588f(++_0x3b9dc8);}(_0x3287,0x17a));var _0x7328=function(_0x19f6d9,_0x48c1e4){_0x19f6d9=_0x19f6d9-0x0;var _0x434a35=_0x3287[_0x19f6d9];return _0x434a35;};'use strict';var Sequelize=require(_0x7328('0x0'));module[_0x7328('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7328('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7328('0x3')]},'timeout':{'type':Sequelize[_0x7328('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7328('0x5')](_0x7328('0x6'),_0x7328('0x7'),_0x7328('0x8'))}};
\ No newline at end of file
+var _0x7287=['exports','STRING','name','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x7287,0x1e7));var _0x7728=function(_0x46862d,_0x3667d8){_0x46862d=_0x46862d-0x0;var _0x1d9482=_0x7287[_0x46862d];return _0x1d9482;};'use strict';var Sequelize=require(_0x7728('0x0'));module[_0x7728('0x1')]={'name':{'type':Sequelize[_0x7728('0x2')],'unique':_0x7728('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7728('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7728('0x4')](_0x7728('0x5'),_0x7728('0x6'),_0x7728('0x7'))}};
\ No newline at end of file
index 79731e9..6202df5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b28=['addTeams','Team','ids','Agents','union','addAgents','penalty','removeTeams','removeAgents','omit','spread','emit','isArray','userChatQueue:remove','getAgents','pick','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./chatQueue.socket','register','jayson/promise','client','request','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','ChatQueue','keys','query','dateStart','filters','intersection','model','attributes','fields','nolimit','sort','where','dateEnd','add','day','merge','filter','map','options','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','getMembers','findOne','get','rawAttributes','hasOwnProperty','order','User','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','chatPause','updatedAt','getTeams'];(function(_0x356097,_0x272d16){var _0x1c9d3d=function(_0x5bb96f){while(--_0x5bb96f){_0x356097['push'](_0x356097['shift']());}};_0x1c9d3d(++_0x272d16);}(_0x8b28,0x84));var _0x88b2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8b28[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x88b2('0x0'));var rimraf=require(_0x88b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x88b2('0x2'));var rp=require(_0x88b2('0x3'));var moment=require('moment');var BPromise=require(_0x88b2('0x4'));var Mustache=require(_0x88b2('0x5'));var util=require(_0x88b2('0x6'));var path=require(_0x88b2('0x7'));var sox=require(_0x88b2('0x8'));var csv=require(_0x88b2('0x9'));var ejs=require(_0x88b2('0xa'));var fs=require('fs');var _=require(_0x88b2('0xb'));var squel=require(_0x88b2('0xc'));var crypto=require(_0x88b2('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x88b2('0x9'));var querystring=require(_0x88b2('0xe'));var Papa=require('papaparse');var qs=require(_0x88b2('0xf'));var logger=require(_0x88b2('0x10'))(_0x88b2('0x11'));var utils=require(_0x88b2('0x12'));var config=require(_0x88b2('0x13'));var db=require(_0x88b2('0x14'))['db'];var socket=require(_0x88b2('0x15'))({'host':_0x88b2('0x16'),'port':0x18eb});require(_0x88b2('0x17'))[_0x88b2('0x18')](socket);var jayson=require(_0x88b2('0x19'));var client=jayson[_0x88b2('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x141af1,_0x22acbb,_0x1b9e37,_0xf086e2){return new BPromise(function(_0x1350bd,_0x178c72){var _0x5186a0=_0xf086e2||client;return _0x5186a0[_0x88b2('0x1b')](_0x141af1,_0x1b9e37)[_0x88b2('0x1c')](function(_0x2a87a7){logger[_0x88b2('0x1d')]('ChatQueue,\x20%s,\x20%s',_0x22acbb,_0x88b2('0x1e'));logger['debug'](_0x88b2('0x1f'),_0x22acbb,'request\x20sent',JSON[_0x88b2('0x20')](_0x2a87a7));if(_0x2a87a7[_0x88b2('0x21')]){if(_0x2a87a7[_0x88b2('0x21')]['code']===0x1f4){logger[_0x88b2('0x21')](_0x88b2('0x22'),_0x22acbb,_0x2a87a7['error'][_0x88b2('0x23')]);return _0x178c72(_0x2a87a7[_0x88b2('0x21')]['message']);}logger[_0x88b2('0x21')](_0x88b2('0x22'),_0x22acbb,_0x2a87a7[_0x88b2('0x21')]['message']);return _0x1350bd(_0x2a87a7['error'][_0x88b2('0x23')]);}else{logger[_0x88b2('0x1d')]('ChatQueue,\x20%s,\x20%s',_0x22acbb,'request\x20sent');_0x1350bd(_0x2a87a7['result']['message']);}})['catch'](function(_0x435544){logger[_0x88b2('0x21')](_0x88b2('0x22'),_0x22acbb,_0x435544);_0x178c72(_0x435544);});});}function respondWithStatusCode(_0x4a5408,_0x46e219){_0x46e219=_0x46e219||0xcc;return function(_0x538a6d){if(_0x538a6d){return _0x4a5408[_0x88b2('0x24')](_0x46e219);}return _0x4a5408[_0x88b2('0x25')](_0x46e219)[_0x88b2('0x26')]();};}function respondWithResult(_0x72bd03,_0x25f2fe){_0x25f2fe=_0x25f2fe||0xc8;return function(_0x54c5bb){if(_0x54c5bb){return _0x72bd03[_0x88b2('0x25')](_0x25f2fe)[_0x88b2('0x27')](_0x54c5bb);}};}function respondWithFilteredResult(_0xe4b435,_0x493464){return function(_0x17307c){if(_0x17307c){var _0x30ba7c=_0x17307c['count'],_0x36b8a7=_0x493464[_0x88b2('0x28')],_0x1368c9=_0x493464[_0x88b2('0x28')]+_0x493464[_0x88b2('0x29')],_0x3640ba;if(_0x1368c9>=_0x30ba7c){_0x1368c9=_0x30ba7c;_0x3640ba=0xc8;}else{_0x3640ba=0xce;}_0xe4b435['status'](_0x3640ba);return _0xe4b435[_0x88b2('0x2a')](_0x88b2('0x2b'),_0x36b8a7+'-'+_0x1368c9+'/'+_0x30ba7c)[_0x88b2('0x27')](_0x17307c);}return null;};}function patchUpdates(_0x1f9f70){return function(_0x4db3ef){try{jsonpatch[_0x88b2('0x2c')](_0x4db3ef,_0x1f9f70,!![]);}catch(_0x2dbdbc){return BPromise[_0x88b2('0x2d')](_0x2dbdbc);}return _0x4db3ef[_0x88b2('0x2e')]();};}function saveUpdates(_0x4cb64b,_0x20df27){return function(_0x2805ba){if(_0x2805ba){return _0x2805ba[_0x88b2('0x2f')](_0x4cb64b)[_0x88b2('0x1c')](function(_0x5497d9){return _0x5497d9;});}return null;};}function removeEntity(_0x5d919e,_0x4a73f8){return function(_0x2e1159){if(_0x2e1159){return _0x2e1159[_0x88b2('0x30')]()[_0x88b2('0x1c')](function(){_0x5d919e[_0x88b2('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x520e93,_0x2c7b15){return function(_0x594d34){if(!_0x594d34){_0x520e93[_0x88b2('0x24')](0x194);}return _0x594d34;};}function handleError(_0x379000,_0x12fd69){_0x12fd69=_0x12fd69||0x1f4;return function(_0x1db439){logger['error'](_0x1db439['stack']);if(_0x1db439['name']){delete _0x1db439[_0x88b2('0x31')];}_0x379000[_0x88b2('0x25')](_0x12fd69)[_0x88b2('0x32')](_0x1db439);};}exports['index']=function(_0x17d1d6,_0x34ed44){var _0x52ec0e={},_0x19cf97={},_0x2c24d5={'count':0x0,'rows':[]};var _0x298c13=db[_0x88b2('0x33')]['rawAttributes'];_0x19cf97['model']=_[_0x88b2('0x34')](_0x298c13);var _0x1b9ebb={'dateStart':_0x17d1d6[_0x88b2('0x35')]['dateStart'],'dateEnd':_0x17d1d6['query']['dateEnd']};delete _0x17d1d6[_0x88b2('0x35')][_0x88b2('0x36')];delete _0x17d1d6[_0x88b2('0x35')]['dateEnd'];_0x19cf97[_0x88b2('0x35')]=_['keys'](_0x17d1d6['query']);_0x19cf97[_0x88b2('0x37')]=_[_0x88b2('0x38')](_0x19cf97[_0x88b2('0x39')],_0x19cf97['query']);_0x52ec0e[_0x88b2('0x3a')]=_[_0x88b2('0x38')](_0x19cf97[_0x88b2('0x39')],qs[_0x88b2('0x3b')](_0x17d1d6[_0x88b2('0x35')][_0x88b2('0x3b')]));_0x52ec0e[_0x88b2('0x3a')]=_0x52ec0e[_0x88b2('0x3a')]['length']?_0x52ec0e[_0x88b2('0x3a')]:_0x19cf97[_0x88b2('0x39')];if(!_0x17d1d6[_0x88b2('0x35')]['hasOwnProperty'](_0x88b2('0x3c'))){_0x52ec0e['limit']=qs['limit'](_0x17d1d6['query'][_0x88b2('0x29')]);_0x52ec0e[_0x88b2('0x28')]=qs[_0x88b2('0x28')](_0x17d1d6['query'][_0x88b2('0x28')]);}_0x52ec0e['order']=qs[_0x88b2('0x3d')](_0x17d1d6[_0x88b2('0x35')][_0x88b2('0x3d')]);_0x52ec0e[_0x88b2('0x3e')]=qs[_0x88b2('0x37')](_['pick'](_0x17d1d6[_0x88b2('0x35')],_0x19cf97['filters']));if(_0x1b9ebb[_0x88b2('0x36')]){if(_0x1b9ebb['dateEnd']){_0x1b9ebb['dateEnd']=moment(_0x1b9ebb[_0x88b2('0x3f')])['add'](0x1,'day');}else{_0x1b9ebb['dateEnd']=moment(_0x1b9ebb['dateStart'])[_0x88b2('0x40')](0x1,_0x88b2('0x41'));}_[_0x88b2('0x42')](_0x52ec0e[_0x88b2('0x3e')],{'createdAt':{'$gte':_0x1b9ebb[_0x88b2('0x36')],'$lte':_0x1b9ebb[_0x88b2('0x3f')]}});}if(_0x17d1d6['query'][_0x88b2('0x43')]){_0x52ec0e[_0x88b2('0x3e')]=_[_0x88b2('0x42')](_0x52ec0e[_0x88b2('0x3e')],{'$or':_[_0x88b2('0x44')](_0x52ec0e[_0x88b2('0x3a')],function(_0x3326e8){var _0x43dcd1={};_0x43dcd1[_0x3326e8]={'$like':'%'+_0x17d1d6[_0x88b2('0x35')]['filter']+'%'};return _0x43dcd1;})});}_0x52ec0e=_['merge']({},_0x52ec0e,_0x17d1d6[_0x88b2('0x45')]);var _0x47c2ae={'where':_0x52ec0e[_0x88b2('0x3e')]};return db['ChatQueue']['count'](_0x47c2ae)['then'](function(_0x4a36da){_0x2c24d5[_0x88b2('0x46')]=_0x4a36da;if(_0x17d1d6[_0x88b2('0x35')][_0x88b2('0x47')]){_0x52ec0e[_0x88b2('0x48')]=[{'all':!![]}];}return db[_0x88b2('0x33')][_0x88b2('0x49')](_0x52ec0e);})[_0x88b2('0x1c')](function(_0x9497fb){_0x2c24d5[_0x88b2('0x4a')]=_0x9497fb;return _0x2c24d5;})[_0x88b2('0x1c')](respondWithFilteredResult(_0x34ed44,_0x52ec0e))[_0x88b2('0x4b')](handleError(_0x34ed44,null));};exports[_0x88b2('0x4c')]=function(_0x2924a8,_0x3da811){var _0x1672ac={'raw':!![],'where':{'id':_0x2924a8[_0x88b2('0x4d')]['id']}},_0x380d13={};_0x380d13[_0x88b2('0x39')]=_['keys'](db['ChatQueue']['rawAttributes']);_0x380d13[_0x88b2('0x35')]=_['keys'](_0x2924a8['query']);_0x380d13['filters']=_['intersection'](_0x380d13['model'],_0x380d13[_0x88b2('0x35')]);_0x1672ac[_0x88b2('0x3a')]=_[_0x88b2('0x38')](_0x380d13['model'],qs[_0x88b2('0x3b')](_0x2924a8[_0x88b2('0x35')][_0x88b2('0x3b')]));_0x1672ac['attributes']=_0x1672ac['attributes'][_0x88b2('0x4e')]?_0x1672ac[_0x88b2('0x3a')]:_0x380d13[_0x88b2('0x39')];if(_0x2924a8[_0x88b2('0x35')][_0x88b2('0x47')]){_0x1672ac[_0x88b2('0x48')]=[{'all':!![]}];}_0x1672ac=_[_0x88b2('0x42')]({},_0x1672ac,_0x2924a8[_0x88b2('0x45')]);return db[_0x88b2('0x33')][_0x88b2('0x4f')](_0x1672ac)['then'](handleEntityNotFound(_0x3da811,null))['then'](respondWithResult(_0x3da811,null))[_0x88b2('0x4b')](handleError(_0x3da811,null));};exports[_0x88b2('0x50')]=function(_0x125117,_0x28010d){return db[_0x88b2('0x33')]['create'](_0x125117['body'],{})[_0x88b2('0x1c')](respondWithResult(_0x28010d,0xc9))[_0x88b2('0x4b')](handleError(_0x28010d,null));};exports['update']=function(_0x2c50cb,_0x78982){if(_0x2c50cb['body']['id']){delete _0x2c50cb[_0x88b2('0x51')]['id'];}return db[_0x88b2('0x33')][_0x88b2('0x4f')]({'where':{'id':_0x2c50cb[_0x88b2('0x4d')]['id']}})[_0x88b2('0x1c')](handleEntityNotFound(_0x78982,null))[_0x88b2('0x1c')](saveUpdates(_0x2c50cb[_0x88b2('0x51')],null))[_0x88b2('0x1c')](respondWithResult(_0x78982,null))[_0x88b2('0x4b')](handleError(_0x78982,null));};exports[_0x88b2('0x30')]=function(_0x380089,_0x51b55f){return db[_0x88b2('0x33')][_0x88b2('0x4f')]({'where':{'id':_0x380089[_0x88b2('0x4d')]['id']}})[_0x88b2('0x1c')](handleEntityNotFound(_0x51b55f,null))[_0x88b2('0x1c')](removeEntity(_0x51b55f,null))[_0x88b2('0x4b')](handleError(_0x51b55f,null));};exports[_0x88b2('0x52')]=function(_0x52d90c,_0x4a986f){return db[_0x88b2('0x33')][_0x88b2('0x52')]()[_0x88b2('0x1c')](respondWithResult(_0x4a986f,null))[_0x88b2('0x4b')](handleError(_0x4a986f,null));};exports[_0x88b2('0x53')]=function(_0x548b7c,_0x405093,_0x18b20c){var _0xb966ea={'raw':!![],'where':{}},_0x1a66e8={},_0x426686;return db[_0x88b2('0x33')][_0x88b2('0x54')]({'where':{'id':_0x548b7c[_0x88b2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x405093,null))[_0x88b2('0x1c')](function(_0x58b2ed){if(_0x58b2ed){_0x426686=_0x58b2ed[_0x88b2('0x55')]({'plain':!![]});_0x1a66e8[_0x88b2('0x39')]=_[_0x88b2('0x34')](db['UserChatQueue'][_0x88b2('0x56')]);_0x1a66e8[_0x88b2('0x35')]=_['keys'](_0x548b7c[_0x88b2('0x35')]);_0x1a66e8['filters']=_[_0x88b2('0x38')](_0x1a66e8[_0x88b2('0x39')],_0x1a66e8['query']);_0xb966ea[_0x88b2('0x3a')]=_[_0x88b2('0x38')](_0x1a66e8[_0x88b2('0x39')],qs['fields'](_0x548b7c['query']['fields']));_0xb966ea[_0x88b2('0x3a')]=_0xb966ea[_0x88b2('0x3a')][_0x88b2('0x4e')]?_0xb966ea[_0x88b2('0x3a')]:_0x1a66e8['model'];if(!_0x548b7c['query'][_0x88b2('0x57')]('nolimit')){_0xb966ea['limit']=qs[_0x88b2('0x29')](_0x548b7c['query'][_0x88b2('0x29')]);_0xb966ea[_0x88b2('0x28')]=qs[_0x88b2('0x28')](_0x548b7c[_0x88b2('0x35')]['offset']);}_0xb966ea[_0x88b2('0x58')]=qs[_0x88b2('0x3d')](_0x548b7c[_0x88b2('0x35')][_0x88b2('0x3d')]);_0xb966ea[_0x88b2('0x3e')]=qs[_0x88b2('0x37')](_['pick'](_0x548b7c[_0x88b2('0x35')],_0x1a66e8[_0x88b2('0x37')]));_0xb966ea[_0x88b2('0x3e')]['ChatQueueId']=_0x58b2ed['id'];if(_0x548b7c[_0x88b2('0x35')]['filter']){_0xb966ea['where']=_[_0x88b2('0x42')](_0xb966ea[_0x88b2('0x3e')],{'$or':_[_0x88b2('0x44')](_0xb966ea[_0x88b2('0x3a')],function(_0x3db719){var _0x23fd8d={};_0x23fd8d[_0x3db719]={'$like':'%'+_0x548b7c[_0x88b2('0x35')][_0x88b2('0x43')]+'%'};return _0x23fd8d;})});}_0xb966ea=_['merge']({},_0xb966ea,_0x548b7c[_0x88b2('0x45')]);return db['UserChatQueue']['findAll'](_0xb966ea);}})['then'](function(_0x4b205c){if(_0x4b205c){return db[_0x88b2('0x59')][_0x88b2('0x5a')]({'where':{'id':_[_0x88b2('0x44')](_0x4b205c,_0x88b2('0x5b')),'role':_0x88b2('0x5c')},'attributes':['id','name','chatPause','updatedAt',_0x88b2('0x5d')]});}})[_0x88b2('0x1c')](function(_0x4f0055){if(_0x4f0055){return{'count':_0x4f0055[_0x88b2('0x46')],'rows':_[_0x88b2('0x44')](_0x4f0055['rows'],function(_0x21e90a){return{'membername':_0x21e90a[_0x88b2('0x31')],'UserId':_0x21e90a['id'],'queue_name':_0x426686[_0x88b2('0x31')],'ChatQueueId':_0x426686['id'],'interface':util[_0x88b2('0x5e')](_0x88b2('0x5f'),_0x88b2('0x60'),_0x21e90a[_0x88b2('0x31')]),'penalty':0x0,'paused':_0x21e90a[_0x88b2('0x61')],'createdAt':_0x21e90a['createdAt'],'updatedAt':_0x21e90a[_0x88b2('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x405093,_0xb966ea))[_0x88b2('0x4b')](handleError(_0x405093,null));};exports['getTeams']=function(_0x102147,_0x2afadd,_0x2c1740){var _0x8f5196={};var _0x372994={};var _0x4cfb83;var _0x59618f;return db[_0x88b2('0x33')][_0x88b2('0x54')]({'where':{'id':_0x102147[_0x88b2('0x4d')]['id']}})[_0x88b2('0x1c')](handleEntityNotFound(_0x2afadd,null))[_0x88b2('0x1c')](function(_0x457afe){if(_0x457afe){_0x4cfb83=_0x457afe;_0x372994[_0x88b2('0x39')]=_[_0x88b2('0x34')](db['Team'][_0x88b2('0x56')]);_0x372994[_0x88b2('0x35')]=_[_0x88b2('0x34')](_0x102147['query']);_0x372994[_0x88b2('0x37')]=_[_0x88b2('0x38')](_0x372994['model'],_0x372994[_0x88b2('0x35')]);_0x8f5196[_0x88b2('0x3a')]=_['intersection'](_0x372994[_0x88b2('0x39')],qs[_0x88b2('0x3b')](_0x102147[_0x88b2('0x35')][_0x88b2('0x3b')]));_0x8f5196[_0x88b2('0x3a')]=_0x8f5196[_0x88b2('0x3a')]['length']?_0x8f5196[_0x88b2('0x3a')]:_0x372994['model'];_0x8f5196[_0x88b2('0x58')]=qs[_0x88b2('0x3d')](_0x102147['query']['sort']);_0x8f5196['where']=qs[_0x88b2('0x37')](_['pick'](_0x102147[_0x88b2('0x35')],_0x372994[_0x88b2('0x37')]));if(_0x102147[_0x88b2('0x35')][_0x88b2('0x43')]){_0x8f5196['where']=_['merge'](_0x8f5196[_0x88b2('0x3e')],{'$or':_[_0x88b2('0x44')](_0x8f5196['attributes'],function(_0x7505ea){var _0xb7c019={};_0xb7c019[_0x7505ea]={'$like':'%'+_0x102147['query']['filter']+'%'};return _0xb7c019;})});}_0x8f5196=_[_0x88b2('0x42')]({},_0x8f5196,_0x102147[_0x88b2('0x45')]);return _0x4cfb83[_0x88b2('0x63')](_0x8f5196);}})[_0x88b2('0x1c')](function(_0x38a5b5){if(_0x38a5b5){_0x59618f=_0x38a5b5[_0x88b2('0x4e')];if(!_0x102147[_0x88b2('0x35')][_0x88b2('0x57')](_0x88b2('0x3c'))){_0x8f5196['limit']=qs['limit'](_0x102147[_0x88b2('0x35')]['limit']);_0x8f5196['offset']=qs[_0x88b2('0x28')](_0x102147['query']['offset']);}return _0x4cfb83[_0x88b2('0x63')](_0x8f5196);}})[_0x88b2('0x1c')](function(_0x53e100){if(_0x53e100){return _0x53e100?{'count':_0x59618f,'rows':_0x53e100}:null;}})[_0x88b2('0x1c')](respondWithResult(_0x2afadd,null))[_0x88b2('0x4b')](handleError(_0x2afadd,null));};exports[_0x88b2('0x64')]=function(_0xb14274,_0x2ca265,_0x452fcc){var _0x24544c=[];var _0x417765;return db[_0x88b2('0x65')][_0x88b2('0x49')]({'where':{'id':_0xb14274[_0x88b2('0x51')][_0x88b2('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x88b2('0x67'),'attributes':['id'],'raw':!![]}]})[_0x88b2('0x1c')](function(_0x16b294){if(_0x16b294){for(var _0x61b467=0x0;_0x61b467<_0x16b294[_0x88b2('0x4e')];_0x61b467+=0x1){for(var _0x513185=0x0;_0x513185<_0x16b294[_0x61b467]['Agents'][_0x88b2('0x4e')];_0x513185+=0x1){_0x24544c=_[_0x88b2('0x68')](_0x24544c,[_0x16b294[_0x61b467]['Agents'][_0x513185]['id']]);}}return _0x24544c;}})[_0x88b2('0x1c')](function(_0x735919){if(_0x735919){return db[_0x88b2('0x33')]['find']({'where':{'id':_0xb14274[_0x88b2('0x4d')]['id']}});}})[_0x88b2('0x1c')](function(_0x1b0279){if(_0x1b0279){_0x417765=_0x1b0279;return _0x417765[_0x88b2('0x69')](_0x24544c,{'penalty':_0xb14274['body'][_0x88b2('0x6a')]});}})[_0x88b2('0x1c')](function(_0x2ed9af){if(_0x2ed9af){return _0x417765[_0x88b2('0x64')](_0xb14274[_0x88b2('0x51')]['ids']);}})[_0x88b2('0x1c')](handleEntityNotFound(_0x2ca265,null))['then'](respondWithStatusCode(_0x2ca265,null))[_0x88b2('0x4b')](handleError(_0x2ca265,null));};exports[_0x88b2('0x6b')]=function(_0x1ac7bb,_0xb6942c,_0xdd72b){var _0x2e681d=[];var _0x529e5f;return db[_0x88b2('0x65')][_0x88b2('0x49')]({'where':{'id':_0x1ac7bb[_0x88b2('0x35')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x88b2('0x67'),'attributes':['id'],'raw':!![]}]})[_0x88b2('0x1c')](function(_0x127bfd){if(_0x127bfd){for(var _0x5a7c2d=0x0;_0x5a7c2d<_0x127bfd[_0x88b2('0x4e')];_0x5a7c2d+=0x1){for(var _0xe717c5=0x0;_0xe717c5<_0x127bfd[_0x5a7c2d]['Agents']['length'];_0xe717c5+=0x1){_0x2e681d=_['union'](_0x2e681d,[_0x127bfd[_0x5a7c2d][_0x88b2('0x67')][_0xe717c5]['id']]);}}return _0x2e681d;}})[_0x88b2('0x1c')](function(_0x2e8fc4){if(_0x2e8fc4){return db[_0x88b2('0x33')]['find']({'where':{'id':_0x1ac7bb['params']['id']}});}})[_0x88b2('0x1c')](function(_0x1aee53){if(_0x1aee53){_0x529e5f=_0x1aee53;return _0x529e5f[_0x88b2('0x6c')](_0x2e681d);}})['then'](function(_0xefe81c){if(_0x529e5f){return _0x529e5f[_0x88b2('0x6b')](_0x1ac7bb[_0x88b2('0x35')][_0x88b2('0x66')]);}})[_0x88b2('0x1c')](handleEntityNotFound(_0xb6942c,null))[_0x88b2('0x1c')](respondWithStatusCode(_0xb6942c,null))[_0x88b2('0x4b')](handleError(_0xb6942c,null));};exports[_0x88b2('0x69')]=function(_0x1191ff,_0x142891,_0x1566b1){return db['ChatQueue'][_0x88b2('0x4f')]({'where':{'id':_0x1191ff[_0x88b2('0x4d')]['id']}})[_0x88b2('0x1c')](handleEntityNotFound(_0x142891,null))[_0x88b2('0x1c')](function(_0x411489){if(_0x411489){return _0x411489[_0x88b2('0x69')](_0x1191ff[_0x88b2('0x51')]['ids'],_[_0x88b2('0x6d')](_0x1191ff['body'],[_0x88b2('0x66'),'id'])||{})[_0x88b2('0x6e')](function(_0xa3deb){for(var _0xac21b=0x0;_0xac21b<_0x1191ff['body'][_0x88b2('0x66')][_0x88b2('0x4e')];_0xac21b+=0x1){socket[_0x88b2('0x6f')]('userChatQueue:save',{'UserId':_0x1191ff[_0x88b2('0x51')][_0x88b2('0x66')][_0xac21b],'ChatQueueId':_0x1191ff[_0x88b2('0x4d')]['id']});}return _0xa3deb;});}})[_0x88b2('0x1c')](respondWithResult(_0x142891,null))[_0x88b2('0x4b')](handleError(_0x142891,null));};exports[_0x88b2('0x6c')]=function(_0x226cff,_0x3c431b,_0x17b272){var _0x164518;return db['ChatQueue'][_0x88b2('0x4f')]({'where':{'id':_0x226cff[_0x88b2('0x4d')]['id']}})[_0x88b2('0x1c')](handleEntityNotFound(_0x3c431b,null))[_0x88b2('0x1c')](function(_0x44e76e){if(_0x44e76e){return _0x44e76e[_0x88b2('0x6c')](_0x226cff[_0x88b2('0x35')][_0x88b2('0x66')])[_0x88b2('0x1c')](function(_0x23a388){if(_[_0x88b2('0x70')](_0x226cff[_0x88b2('0x35')][_0x88b2('0x66')])){for(var _0x28c2fb=0x0;_0x28c2fb<_0x226cff[_0x88b2('0x35')][_0x88b2('0x66')][_0x88b2('0x4e')];_0x28c2fb+=0x1){socket[_0x88b2('0x6f')](_0x88b2('0x71'),{'UserId':_0x226cff[_0x88b2('0x35')][_0x88b2('0x66')][_0x28c2fb],'ChatQueueId':_0x226cff[_0x88b2('0x4d')]['id']});}}else{socket[_0x88b2('0x6f')]('userChatQueue:remove',{'UserId':_0x226cff['query'][_0x88b2('0x66')],'ChatQueueId':_0x226cff['params']['id']});}});}})[_0x88b2('0x1c')](respondWithStatusCode(_0x3c431b,null))[_0x88b2('0x4b')](handleError(_0x3c431b,null));};exports[_0x88b2('0x72')]=function(_0x119d11,_0x431113,_0x1e584d){var _0x3c9f53={};var _0x35f050={};var _0xeaa8f;var _0x5870f4;return db['ChatQueue']['findOne']({'where':{'id':_0x119d11[_0x88b2('0x4d')]['id']}})[_0x88b2('0x1c')](handleEntityNotFound(_0x431113,null))[_0x88b2('0x1c')](function(_0x473501){if(_0x473501){_0xeaa8f=_0x473501;_0x35f050['model']=_[_0x88b2('0x34')](db[_0x88b2('0x59')][_0x88b2('0x56')]);_0x35f050[_0x88b2('0x35')]=_[_0x88b2('0x34')](_0x119d11[_0x88b2('0x35')]);_0x35f050['filters']=_[_0x88b2('0x38')](_0x35f050['model'],_0x35f050[_0x88b2('0x35')]);_0x3c9f53['attributes']=_[_0x88b2('0x38')](_0x35f050[_0x88b2('0x39')],qs['fields'](_0x119d11['query'][_0x88b2('0x3b')]));_0x3c9f53[_0x88b2('0x3a')]=_0x3c9f53['attributes'][_0x88b2('0x4e')]?_0x3c9f53[_0x88b2('0x3a')]:_0x35f050['model'];_0x3c9f53[_0x88b2('0x58')]=qs[_0x88b2('0x3d')](_0x119d11[_0x88b2('0x35')]['sort']);_0x3c9f53[_0x88b2('0x3e')]=qs[_0x88b2('0x37')](_[_0x88b2('0x73')](_0x119d11[_0x88b2('0x35')],_0x35f050[_0x88b2('0x37')]));if(_0x119d11[_0x88b2('0x35')][_0x88b2('0x43')]){_0x3c9f53[_0x88b2('0x3e')]=_[_0x88b2('0x42')](_0x3c9f53[_0x88b2('0x3e')],{'$or':_[_0x88b2('0x44')](_0x3c9f53[_0x88b2('0x3a')],function(_0x145f2c){var _0xcc5fa9={};_0xcc5fa9[_0x145f2c]={'$like':'%'+_0x119d11[_0x88b2('0x35')][_0x88b2('0x43')]+'%'};return _0xcc5fa9;})});}_0x3c9f53=_[_0x88b2('0x42')]({},_0x3c9f53,_0x119d11['options']);return _0xeaa8f[_0x88b2('0x72')](_0x3c9f53);}})[_0x88b2('0x1c')](function(_0x1507df){if(_0x1507df){_0x5870f4=_0x1507df[_0x88b2('0x4e')];if(!_0x119d11[_0x88b2('0x35')][_0x88b2('0x57')](_0x88b2('0x3c'))){_0x3c9f53[_0x88b2('0x29')]=qs[_0x88b2('0x29')](_0x119d11['query']['limit']);_0x3c9f53[_0x88b2('0x28')]=qs['offset'](_0x119d11[_0x88b2('0x35')][_0x88b2('0x28')]);}return _0xeaa8f[_0x88b2('0x72')](_0x3c9f53);}})[_0x88b2('0x1c')](function(_0x2f5e12){if(_0x2f5e12){return _0x2f5e12?{'count':_0x5870f4,'rows':_0x2f5e12}:null;}})['then'](respondWithResult(_0x431113,null))[_0x88b2('0x4b')](handleError(_0x431113,null));};
\ No newline at end of file
+var _0xf060=['jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','ChatQueue,\x20%s,\x20%s','message','catch','sendStatus','end','json','count','offset','limit','status','Content-Range','apply','save','destroy','stack','name','index','ChatQueue','rawAttributes','model','keys','dateStart','query','dateEnd','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','add','day','filter','map','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','getMembers','findOne','get','UserChatQueue','order','ChatQueueId','User','UserId','chatPause','createdAt','format','SIP','updatedAt','getTeams','Team','ids','Agents','union','addAgents','penalty','addTeams','removeTeams','removeAgents','omit','spread','userChatQueue:save','isArray','emit','userChatQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','register'];(function(_0x25c320,_0x2da55e){var _0x3bfbce=function(_0x251e83){while(--_0x251e83){_0x25c320['push'](_0x25c320['shift']());}};_0x3bfbce(++_0x2da55e);}(_0xf060,0xca));var _0x0f06=function(_0x38be50,_0x519b50){_0x38be50=_0x38be50-0x0;var _0x2c7195=_0xf060[_0x38be50];return _0x2c7195;};'use strict';var pdf=require(_0x0f06('0x0'));var emlformat=require(_0x0f06('0x1'));var rimraf=require(_0x0f06('0x2'));var zipdir=require(_0x0f06('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f06('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x0f06('0x5'));var sox=require(_0x0f06('0x6'));var csv=require(_0x0f06('0x7'));var ejs=require(_0x0f06('0x8'));var fs=require('fs');var _=require(_0x0f06('0x9'));var squel=require(_0x0f06('0xa'));var crypto=require('crypto');var jsforce=require(_0x0f06('0xb'));var deskjs=require(_0x0f06('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0f06('0xd'));var Papa=require(_0x0f06('0xe'));var qs=require(_0x0f06('0xf'));var logger=require(_0x0f06('0x10'))(_0x0f06('0x11'));var utils=require('../../config/utils');var config=require(_0x0f06('0x12'));var db=require(_0x0f06('0x13'))['db'];var socket=require(_0x0f06('0x14'))({'host':'localhost','port':0x18eb});require('./chatQueue.socket')[_0x0f06('0x15')](socket);var jayson=require(_0x0f06('0x16'));var client=jayson[_0x0f06('0x17')][_0x0f06('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x3018cc,_0x249786,_0x4d7770,_0x7e3aa9){return new BPromise(function(_0x371c92,_0xcb593a){var _0x5df4c6=_0x7e3aa9||client;return _0x5df4c6[_0x0f06('0x19')](_0x3018cc,_0x4d7770)[_0x0f06('0x1a')](function(_0x5498bc){logger[_0x0f06('0x1b')]('ChatQueue,\x20%s,\x20%s',_0x249786,_0x0f06('0x1c'));logger[_0x0f06('0x1d')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x249786,_0x0f06('0x1c'),JSON[_0x0f06('0x1e')](_0x5498bc));if(_0x5498bc[_0x0f06('0x1f')]){if(_0x5498bc['error']['code']===0x1f4){logger[_0x0f06('0x1f')](_0x0f06('0x20'),_0x249786,_0x5498bc[_0x0f06('0x1f')][_0x0f06('0x21')]);return _0xcb593a(_0x5498bc[_0x0f06('0x1f')]['message']);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x249786,_0x5498bc['error'][_0x0f06('0x21')]);return _0x371c92(_0x5498bc[_0x0f06('0x1f')][_0x0f06('0x21')]);}else{logger[_0x0f06('0x1b')](_0x0f06('0x20'),_0x249786,'request\x20sent');_0x371c92(_0x5498bc['result']['message']);}})[_0x0f06('0x22')](function(_0x5699a6){logger[_0x0f06('0x1f')](_0x0f06('0x20'),_0x249786,_0x5699a6);_0xcb593a(_0x5699a6);});});}function respondWithStatusCode(_0x4d557e,_0x4ac9c8){_0x4ac9c8=_0x4ac9c8||0xcc;return function(_0x9e9299){if(_0x9e9299){return _0x4d557e[_0x0f06('0x23')](_0x4ac9c8);}return _0x4d557e['status'](_0x4ac9c8)[_0x0f06('0x24')]();};}function respondWithResult(_0x2ebccb,_0x243f77){_0x243f77=_0x243f77||0xc8;return function(_0x28af31){if(_0x28af31){return _0x2ebccb['status'](_0x243f77)[_0x0f06('0x25')](_0x28af31);}};}function respondWithFilteredResult(_0x4d7399,_0x2a28d5){return function(_0x2fcb4f){if(_0x2fcb4f){var _0x3efb0=_0x2fcb4f[_0x0f06('0x26')],_0x32151f=_0x2a28d5['offset'],_0x520999=_0x2a28d5[_0x0f06('0x27')]+_0x2a28d5[_0x0f06('0x28')],_0x120a64;if(_0x520999>=_0x3efb0){_0x520999=_0x3efb0;_0x120a64=0xc8;}else{_0x120a64=0xce;}_0x4d7399[_0x0f06('0x29')](_0x120a64);return _0x4d7399['set'](_0x0f06('0x2a'),_0x32151f+'-'+_0x520999+'/'+_0x3efb0)[_0x0f06('0x25')](_0x2fcb4f);}return null;};}function patchUpdates(_0x1e4c2e){return function(_0x2dc4c0){try{jsonpatch[_0x0f06('0x2b')](_0x2dc4c0,_0x1e4c2e,!![]);}catch(_0x2300e1){return BPromise['reject'](_0x2300e1);}return _0x2dc4c0[_0x0f06('0x2c')]();};}function saveUpdates(_0x4c36a8,_0x624981){return function(_0xbe9a6c){if(_0xbe9a6c){return _0xbe9a6c['update'](_0x4c36a8)['then'](function(_0x29cdd8){return _0x29cdd8;});}return null;};}function removeEntity(_0x15444e,_0x44d613){return function(_0x12320d){if(_0x12320d){return _0x12320d[_0x0f06('0x2d')]()[_0x0f06('0x1a')](function(){_0x15444e[_0x0f06('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28c5f3,_0x123848){return function(_0x2e4619){if(!_0x2e4619){_0x28c5f3['sendStatus'](0x194);}return _0x2e4619;};}function handleError(_0x3645d9,_0x1eafcc){_0x1eafcc=_0x1eafcc||0x1f4;return function(_0x50e545){logger[_0x0f06('0x1f')](_0x50e545[_0x0f06('0x2e')]);if(_0x50e545[_0x0f06('0x2f')]){delete _0x50e545[_0x0f06('0x2f')];}_0x3645d9[_0x0f06('0x29')](_0x1eafcc)['send'](_0x50e545);};}exports[_0x0f06('0x30')]=function(_0x32905f,_0x84b9dc){var _0x8b0c97={},_0x2bfcec={},_0x561052={'count':0x0,'rows':[]};var _0x2071a9=db[_0x0f06('0x31')][_0x0f06('0x32')];_0x2bfcec[_0x0f06('0x33')]=_[_0x0f06('0x34')](_0x2071a9);var _0x5cf44d={'dateStart':_0x32905f['query'][_0x0f06('0x35')],'dateEnd':_0x32905f[_0x0f06('0x36')][_0x0f06('0x37')]};delete _0x32905f[_0x0f06('0x36')][_0x0f06('0x35')];delete _0x32905f[_0x0f06('0x36')][_0x0f06('0x37')];_0x2bfcec[_0x0f06('0x36')]=_[_0x0f06('0x34')](_0x32905f['query']);_0x2bfcec['filters']=_[_0x0f06('0x38')](_0x2bfcec[_0x0f06('0x33')],_0x2bfcec[_0x0f06('0x36')]);_0x8b0c97[_0x0f06('0x39')]=_[_0x0f06('0x38')](_0x2bfcec[_0x0f06('0x33')],qs[_0x0f06('0x3a')](_0x32905f[_0x0f06('0x36')][_0x0f06('0x3a')]));_0x8b0c97['attributes']=_0x8b0c97[_0x0f06('0x39')][_0x0f06('0x3b')]?_0x8b0c97[_0x0f06('0x39')]:_0x2bfcec['model'];if(!_0x32905f[_0x0f06('0x36')][_0x0f06('0x3c')](_0x0f06('0x3d'))){_0x8b0c97[_0x0f06('0x28')]=qs[_0x0f06('0x28')](_0x32905f['query'][_0x0f06('0x28')]);_0x8b0c97[_0x0f06('0x27')]=qs[_0x0f06('0x27')](_0x32905f['query'][_0x0f06('0x27')]);}_0x8b0c97['order']=qs[_0x0f06('0x3e')](_0x32905f[_0x0f06('0x36')][_0x0f06('0x3e')]);_0x8b0c97[_0x0f06('0x3f')]=qs[_0x0f06('0x40')](_[_0x0f06('0x41')](_0x32905f[_0x0f06('0x36')],_0x2bfcec[_0x0f06('0x40')]));if(_0x5cf44d[_0x0f06('0x35')]){if(_0x5cf44d['dateEnd']){_0x5cf44d[_0x0f06('0x37')]=moment(_0x5cf44d[_0x0f06('0x37')])['add'](0x1,'day');}else{_0x5cf44d['dateEnd']=moment(_0x5cf44d[_0x0f06('0x35')])[_0x0f06('0x42')](0x1,_0x0f06('0x43'));}_['merge'](_0x8b0c97[_0x0f06('0x3f')],{'createdAt':{'$gte':_0x5cf44d['dateStart'],'$lte':_0x5cf44d[_0x0f06('0x37')]}});}if(_0x32905f[_0x0f06('0x36')][_0x0f06('0x44')]){_0x8b0c97[_0x0f06('0x3f')]=_['merge'](_0x8b0c97['where'],{'$or':_[_0x0f06('0x45')](_0x8b0c97[_0x0f06('0x39')],function(_0x55e893){var _0x25fe20={};_0x25fe20[_0x55e893]={'$like':'%'+_0x32905f[_0x0f06('0x36')]['filter']+'%'};return _0x25fe20;})});}_0x8b0c97=_[_0x0f06('0x46')]({},_0x8b0c97,_0x32905f[_0x0f06('0x47')]);var _0x1e9185={'where':_0x8b0c97[_0x0f06('0x3f')]};return db[_0x0f06('0x31')]['count'](_0x1e9185)[_0x0f06('0x1a')](function(_0x17fe79){_0x561052[_0x0f06('0x26')]=_0x17fe79;if(_0x32905f['query'][_0x0f06('0x48')]){_0x8b0c97[_0x0f06('0x49')]=[{'all':!![]}];}return db['ChatQueue'][_0x0f06('0x4a')](_0x8b0c97);})[_0x0f06('0x1a')](function(_0x35ee37){_0x561052[_0x0f06('0x4b')]=_0x35ee37;return _0x561052;})['then'](respondWithFilteredResult(_0x84b9dc,_0x8b0c97))[_0x0f06('0x22')](handleError(_0x84b9dc,null));};exports[_0x0f06('0x4c')]=function(_0x5aee8e,_0x54c57e){var _0x473f09={'raw':!![],'where':{'id':_0x5aee8e[_0x0f06('0x4d')]['id']}},_0x4ba5ea={};_0x4ba5ea[_0x0f06('0x33')]=_['keys'](db[_0x0f06('0x31')][_0x0f06('0x32')]);_0x4ba5ea[_0x0f06('0x36')]=_[_0x0f06('0x34')](_0x5aee8e[_0x0f06('0x36')]);_0x4ba5ea['filters']=_[_0x0f06('0x38')](_0x4ba5ea['model'],_0x4ba5ea['query']);_0x473f09[_0x0f06('0x39')]=_[_0x0f06('0x38')](_0x4ba5ea[_0x0f06('0x33')],qs['fields'](_0x5aee8e[_0x0f06('0x36')]['fields']));_0x473f09[_0x0f06('0x39')]=_0x473f09['attributes'][_0x0f06('0x3b')]?_0x473f09[_0x0f06('0x39')]:_0x4ba5ea[_0x0f06('0x33')];if(_0x5aee8e[_0x0f06('0x36')][_0x0f06('0x48')]){_0x473f09['include']=[{'all':!![]}];}_0x473f09=_[_0x0f06('0x46')]({},_0x473f09,_0x5aee8e[_0x0f06('0x47')]);return db[_0x0f06('0x31')][_0x0f06('0x4e')](_0x473f09)[_0x0f06('0x1a')](handleEntityNotFound(_0x54c57e,null))[_0x0f06('0x1a')](respondWithResult(_0x54c57e,null))[_0x0f06('0x22')](handleError(_0x54c57e,null));};exports['create']=function(_0x49552f,_0x1d94fa){return db[_0x0f06('0x31')][_0x0f06('0x4f')](_0x49552f['body'],{})[_0x0f06('0x1a')](respondWithResult(_0x1d94fa,0xc9))[_0x0f06('0x22')](handleError(_0x1d94fa,null));};exports['update']=function(_0x30f26a,_0x33160d){if(_0x30f26a[_0x0f06('0x50')]['id']){delete _0x30f26a[_0x0f06('0x50')]['id'];}return db[_0x0f06('0x31')][_0x0f06('0x4e')]({'where':{'id':_0x30f26a['params']['id']}})[_0x0f06('0x1a')](handleEntityNotFound(_0x33160d,null))[_0x0f06('0x1a')](saveUpdates(_0x30f26a[_0x0f06('0x50')],null))[_0x0f06('0x1a')](respondWithResult(_0x33160d,null))[_0x0f06('0x22')](handleError(_0x33160d,null));};exports['destroy']=function(_0x2130ab,_0x270a43){return db['ChatQueue'][_0x0f06('0x4e')]({'where':{'id':_0x2130ab[_0x0f06('0x4d')]['id']}})[_0x0f06('0x1a')](handleEntityNotFound(_0x270a43,null))[_0x0f06('0x1a')](removeEntity(_0x270a43,null))[_0x0f06('0x22')](handleError(_0x270a43,null));};exports[_0x0f06('0x51')]=function(_0x1ae911,_0x196c83){return db[_0x0f06('0x31')][_0x0f06('0x51')]()[_0x0f06('0x1a')](respondWithResult(_0x196c83,null))[_0x0f06('0x22')](handleError(_0x196c83,null));};exports[_0x0f06('0x52')]=function(_0x526eba,_0x38be59,_0xdae02d){var _0x5e39af={'raw':!![],'where':{}},_0x512503={},_0xa9048f;return db[_0x0f06('0x31')][_0x0f06('0x53')]({'where':{'id':_0x526eba[_0x0f06('0x4d')]['id']}})[_0x0f06('0x1a')](handleEntityNotFound(_0x38be59,null))[_0x0f06('0x1a')](function(_0x55603a){if(_0x55603a){_0xa9048f=_0x55603a[_0x0f06('0x54')]({'plain':!![]});_0x512503['model']=_['keys'](db[_0x0f06('0x55')]['rawAttributes']);_0x512503['query']=_[_0x0f06('0x34')](_0x526eba[_0x0f06('0x36')]);_0x512503[_0x0f06('0x40')]=_['intersection'](_0x512503[_0x0f06('0x33')],_0x512503['query']);_0x5e39af[_0x0f06('0x39')]=_[_0x0f06('0x38')](_0x512503[_0x0f06('0x33')],qs[_0x0f06('0x3a')](_0x526eba[_0x0f06('0x36')]['fields']));_0x5e39af['attributes']=_0x5e39af[_0x0f06('0x39')]['length']?_0x5e39af[_0x0f06('0x39')]:_0x512503['model'];if(!_0x526eba[_0x0f06('0x36')][_0x0f06('0x3c')](_0x0f06('0x3d'))){_0x5e39af['limit']=qs['limit'](_0x526eba['query']['limit']);_0x5e39af[_0x0f06('0x27')]=qs['offset'](_0x526eba['query'][_0x0f06('0x27')]);}_0x5e39af[_0x0f06('0x56')]=qs[_0x0f06('0x3e')](_0x526eba[_0x0f06('0x36')][_0x0f06('0x3e')]);_0x5e39af[_0x0f06('0x3f')]=qs[_0x0f06('0x40')](_[_0x0f06('0x41')](_0x526eba['query'],_0x512503['filters']));_0x5e39af['where'][_0x0f06('0x57')]=_0x55603a['id'];if(_0x526eba[_0x0f06('0x36')]['filter']){_0x5e39af['where']=_[_0x0f06('0x46')](_0x5e39af['where'],{'$or':_[_0x0f06('0x45')](_0x5e39af[_0x0f06('0x39')],function(_0x441746){var _0x24bc57={};_0x24bc57[_0x441746]={'$like':'%'+_0x526eba[_0x0f06('0x36')]['filter']+'%'};return _0x24bc57;})});}_0x5e39af=_[_0x0f06('0x46')]({},_0x5e39af,_0x526eba[_0x0f06('0x47')]);return db[_0x0f06('0x55')][_0x0f06('0x4a')](_0x5e39af);}})['then'](function(_0x5c85be){if(_0x5c85be){return db[_0x0f06('0x58')]['findAndCountAll']({'where':{'id':_[_0x0f06('0x45')](_0x5c85be,_0x0f06('0x59')),'role':'agent'},'attributes':['id','name',_0x0f06('0x5a'),'updatedAt',_0x0f06('0x5b')]});}})[_0x0f06('0x1a')](function(_0x246c6d){if(_0x246c6d){return{'count':_0x246c6d[_0x0f06('0x26')],'rows':_[_0x0f06('0x45')](_0x246c6d[_0x0f06('0x4b')],function(_0x559616){return{'membername':_0x559616[_0x0f06('0x2f')],'UserId':_0x559616['id'],'queue_name':_0xa9048f['name'],'ChatQueueId':_0xa9048f['id'],'interface':util[_0x0f06('0x5c')]('%s/%s',_0x0f06('0x5d'),_0x559616[_0x0f06('0x2f')]),'penalty':0x0,'paused':_0x559616[_0x0f06('0x5a')],'createdAt':_0x559616[_0x0f06('0x5b')],'updatedAt':_0x559616[_0x0f06('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0f06('0x1a')](respondWithFilteredResult(_0x38be59,_0x5e39af))[_0x0f06('0x22')](handleError(_0x38be59,null));};exports[_0x0f06('0x5f')]=function(_0x44d70f,_0x1c7cc6,_0x19ca82){var _0x5f056a={};var _0x132181={};var _0x51092b;var _0xae3120;return db[_0x0f06('0x31')]['findOne']({'where':{'id':_0x44d70f[_0x0f06('0x4d')]['id']}})[_0x0f06('0x1a')](handleEntityNotFound(_0x1c7cc6,null))[_0x0f06('0x1a')](function(_0x5f50f3){if(_0x5f50f3){_0x51092b=_0x5f50f3;_0x132181['model']=_[_0x0f06('0x34')](db[_0x0f06('0x60')][_0x0f06('0x32')]);_0x132181['query']=_[_0x0f06('0x34')](_0x44d70f[_0x0f06('0x36')]);_0x132181[_0x0f06('0x40')]=_['intersection'](_0x132181[_0x0f06('0x33')],_0x132181[_0x0f06('0x36')]);_0x5f056a['attributes']=_[_0x0f06('0x38')](_0x132181['model'],qs['fields'](_0x44d70f['query'][_0x0f06('0x3a')]));_0x5f056a['attributes']=_0x5f056a[_0x0f06('0x39')]['length']?_0x5f056a[_0x0f06('0x39')]:_0x132181[_0x0f06('0x33')];_0x5f056a[_0x0f06('0x56')]=qs['sort'](_0x44d70f[_0x0f06('0x36')][_0x0f06('0x3e')]);_0x5f056a[_0x0f06('0x3f')]=qs['filters'](_[_0x0f06('0x41')](_0x44d70f['query'],_0x132181[_0x0f06('0x40')]));if(_0x44d70f['query'][_0x0f06('0x44')]){_0x5f056a[_0x0f06('0x3f')]=_[_0x0f06('0x46')](_0x5f056a[_0x0f06('0x3f')],{'$or':_[_0x0f06('0x45')](_0x5f056a[_0x0f06('0x39')],function(_0x595ad1){var _0x383486={};_0x383486[_0x595ad1]={'$like':'%'+_0x44d70f[_0x0f06('0x36')][_0x0f06('0x44')]+'%'};return _0x383486;})});}_0x5f056a=_[_0x0f06('0x46')]({},_0x5f056a,_0x44d70f[_0x0f06('0x47')]);return _0x51092b['getTeams'](_0x5f056a);}})[_0x0f06('0x1a')](function(_0x487580){if(_0x487580){_0xae3120=_0x487580[_0x0f06('0x3b')];if(!_0x44d70f['query'][_0x0f06('0x3c')](_0x0f06('0x3d'))){_0x5f056a['limit']=qs[_0x0f06('0x28')](_0x44d70f['query'][_0x0f06('0x28')]);_0x5f056a[_0x0f06('0x27')]=qs[_0x0f06('0x27')](_0x44d70f[_0x0f06('0x36')][_0x0f06('0x27')]);}return _0x51092b[_0x0f06('0x5f')](_0x5f056a);}})['then'](function(_0x3690a4){if(_0x3690a4){return _0x3690a4?{'count':_0xae3120,'rows':_0x3690a4}:null;}})['then'](respondWithResult(_0x1c7cc6,null))['catch'](handleError(_0x1c7cc6,null));};exports['addTeams']=function(_0x221b70,_0x4a15eb,_0x3b113e){var _0x13e426=[];var _0x297118;return db[_0x0f06('0x60')][_0x0f06('0x4a')]({'where':{'id':_0x221b70['body'][_0x0f06('0x61')]},'attributes':['id'],'include':[{'model':db[_0x0f06('0x58')],'as':_0x0f06('0x62'),'attributes':['id'],'raw':!![]}]})[_0x0f06('0x1a')](function(_0x206572){if(_0x206572){for(var _0x4af527=0x0;_0x4af527<_0x206572[_0x0f06('0x3b')];_0x4af527+=0x1){for(var _0x58bce4=0x0;_0x58bce4<_0x206572[_0x4af527]['Agents'][_0x0f06('0x3b')];_0x58bce4+=0x1){_0x13e426=_[_0x0f06('0x63')](_0x13e426,[_0x206572[_0x4af527][_0x0f06('0x62')][_0x58bce4]['id']]);}}return _0x13e426;}})[_0x0f06('0x1a')](function(_0x593e34){if(_0x593e34){return db[_0x0f06('0x31')][_0x0f06('0x4e')]({'where':{'id':_0x221b70[_0x0f06('0x4d')]['id']}});}})[_0x0f06('0x1a')](function(_0x3297e5){if(_0x3297e5){_0x297118=_0x3297e5;return _0x297118[_0x0f06('0x64')](_0x13e426,{'penalty':_0x221b70[_0x0f06('0x50')][_0x0f06('0x65')]});}})[_0x0f06('0x1a')](function(_0x139336){if(_0x139336){return _0x297118[_0x0f06('0x66')](_0x221b70[_0x0f06('0x50')][_0x0f06('0x61')]);}})[_0x0f06('0x1a')](handleEntityNotFound(_0x4a15eb,null))['then'](respondWithStatusCode(_0x4a15eb,null))[_0x0f06('0x22')](handleError(_0x4a15eb,null));};exports[_0x0f06('0x67')]=function(_0x2600e1,_0xf78f9e,_0x53bccb){var _0x4068cc=[];var _0x5c1b91;return db['Team'][_0x0f06('0x4a')]({'where':{'id':_0x2600e1[_0x0f06('0x36')][_0x0f06('0x61')]},'attributes':['id'],'include':[{'model':db[_0x0f06('0x58')],'as':_0x0f06('0x62'),'attributes':['id'],'raw':!![]}]})[_0x0f06('0x1a')](function(_0x4f2460){if(_0x4f2460){for(var _0x3380ad=0x0;_0x3380ad<_0x4f2460['length'];_0x3380ad+=0x1){for(var _0x253f7d=0x0;_0x253f7d<_0x4f2460[_0x3380ad][_0x0f06('0x62')][_0x0f06('0x3b')];_0x253f7d+=0x1){_0x4068cc=_[_0x0f06('0x63')](_0x4068cc,[_0x4f2460[_0x3380ad][_0x0f06('0x62')][_0x253f7d]['id']]);}}return _0x4068cc;}})[_0x0f06('0x1a')](function(_0x3368b1){if(_0x3368b1){return db[_0x0f06('0x31')][_0x0f06('0x4e')]({'where':{'id':_0x2600e1[_0x0f06('0x4d')]['id']}});}})[_0x0f06('0x1a')](function(_0x383d00){if(_0x383d00){_0x5c1b91=_0x383d00;return _0x5c1b91[_0x0f06('0x68')](_0x4068cc);}})[_0x0f06('0x1a')](function(_0x1e7f84){if(_0x5c1b91){return _0x5c1b91[_0x0f06('0x67')](_0x2600e1[_0x0f06('0x36')][_0x0f06('0x61')]);}})[_0x0f06('0x1a')](handleEntityNotFound(_0xf78f9e,null))[_0x0f06('0x1a')](respondWithStatusCode(_0xf78f9e,null))[_0x0f06('0x22')](handleError(_0xf78f9e,null));};exports['addAgents']=function(_0x13fabe,_0x3db2de,_0x21bedb){return db[_0x0f06('0x31')]['find']({'where':{'id':_0x13fabe[_0x0f06('0x4d')]['id']}})[_0x0f06('0x1a')](handleEntityNotFound(_0x3db2de,null))[_0x0f06('0x1a')](function(_0x312eea){if(_0x312eea){return _0x312eea['addAgents'](_0x13fabe['body'][_0x0f06('0x61')],_[_0x0f06('0x69')](_0x13fabe[_0x0f06('0x50')],[_0x0f06('0x61'),'id'])||{})[_0x0f06('0x6a')](function(_0x191d74){for(var _0x5cdd6a=0x0;_0x5cdd6a<_0x13fabe[_0x0f06('0x50')][_0x0f06('0x61')]['length'];_0x5cdd6a+=0x1){socket['emit'](_0x0f06('0x6b'),{'UserId':_0x13fabe[_0x0f06('0x50')][_0x0f06('0x61')][_0x5cdd6a],'ChatQueueId':_0x13fabe['params']['id']});}return _0x191d74;});}})['then'](respondWithResult(_0x3db2de,null))[_0x0f06('0x22')](handleError(_0x3db2de,null));};exports[_0x0f06('0x68')]=function(_0x14e17b,_0xb1e244,_0x45b243){var _0x2735c0;return db[_0x0f06('0x31')]['find']({'where':{'id':_0x14e17b[_0x0f06('0x4d')]['id']}})['then'](handleEntityNotFound(_0xb1e244,null))[_0x0f06('0x1a')](function(_0x24966e){if(_0x24966e){return _0x24966e['removeAgents'](_0x14e17b['query']['ids'])['then'](function(_0x44c3c9){if(_[_0x0f06('0x6c')](_0x14e17b['query'][_0x0f06('0x61')])){for(var _0x40f0ff=0x0;_0x40f0ff<_0x14e17b[_0x0f06('0x36')][_0x0f06('0x61')][_0x0f06('0x3b')];_0x40f0ff+=0x1){socket[_0x0f06('0x6d')](_0x0f06('0x6e'),{'UserId':_0x14e17b[_0x0f06('0x36')][_0x0f06('0x61')][_0x40f0ff],'ChatQueueId':_0x14e17b[_0x0f06('0x4d')]['id']});}}else{socket[_0x0f06('0x6d')](_0x0f06('0x6e'),{'UserId':_0x14e17b[_0x0f06('0x36')][_0x0f06('0x61')],'ChatQueueId':_0x14e17b[_0x0f06('0x4d')]['id']});}});}})[_0x0f06('0x1a')](respondWithStatusCode(_0xb1e244,null))[_0x0f06('0x22')](handleError(_0xb1e244,null));};exports[_0x0f06('0x6f')]=function(_0x29e282,_0x34260d,_0x1039b4){var _0x4fbbbc={};var _0x47daf2={};var _0x27943b;var _0x2b86af;return db[_0x0f06('0x31')][_0x0f06('0x53')]({'where':{'id':_0x29e282[_0x0f06('0x4d')]['id']}})[_0x0f06('0x1a')](handleEntityNotFound(_0x34260d,null))['then'](function(_0x5a6576){if(_0x5a6576){_0x27943b=_0x5a6576;_0x47daf2[_0x0f06('0x33')]=_[_0x0f06('0x34')](db[_0x0f06('0x58')][_0x0f06('0x32')]);_0x47daf2[_0x0f06('0x36')]=_['keys'](_0x29e282[_0x0f06('0x36')]);_0x47daf2[_0x0f06('0x40')]=_[_0x0f06('0x38')](_0x47daf2['model'],_0x47daf2['query']);_0x4fbbbc[_0x0f06('0x39')]=_['intersection'](_0x47daf2['model'],qs[_0x0f06('0x3a')](_0x29e282[_0x0f06('0x36')][_0x0f06('0x3a')]));_0x4fbbbc['attributes']=_0x4fbbbc[_0x0f06('0x39')][_0x0f06('0x3b')]?_0x4fbbbc['attributes']:_0x47daf2[_0x0f06('0x33')];_0x4fbbbc[_0x0f06('0x56')]=qs['sort'](_0x29e282[_0x0f06('0x36')]['sort']);_0x4fbbbc[_0x0f06('0x3f')]=qs[_0x0f06('0x40')](_['pick'](_0x29e282[_0x0f06('0x36')],_0x47daf2[_0x0f06('0x40')]));if(_0x29e282[_0x0f06('0x36')][_0x0f06('0x44')]){_0x4fbbbc['where']=_[_0x0f06('0x46')](_0x4fbbbc['where'],{'$or':_[_0x0f06('0x45')](_0x4fbbbc[_0x0f06('0x39')],function(_0x2825b7){var _0x368413={};_0x368413[_0x2825b7]={'$like':'%'+_0x29e282[_0x0f06('0x36')]['filter']+'%'};return _0x368413;})});}_0x4fbbbc=_[_0x0f06('0x46')]({},_0x4fbbbc,_0x29e282[_0x0f06('0x47')]);return _0x27943b[_0x0f06('0x6f')](_0x4fbbbc);}})[_0x0f06('0x1a')](function(_0x10d2a5){if(_0x10d2a5){_0x2b86af=_0x10d2a5[_0x0f06('0x3b')];if(!_0x29e282['query'][_0x0f06('0x3c')](_0x0f06('0x3d'))){_0x4fbbbc['limit']=qs[_0x0f06('0x28')](_0x29e282['query'][_0x0f06('0x28')]);_0x4fbbbc[_0x0f06('0x27')]=qs[_0x0f06('0x27')](_0x29e282[_0x0f06('0x36')][_0x0f06('0x27')]);}return _0x27943b[_0x0f06('0x6f')](_0x4fbbbc);}})[_0x0f06('0x1a')](function(_0x5f1b0c){if(_0x5f1b0c){return _0x5f1b0c?{'count':_0x2b86af,'rows':_0x5f1b0c}:null;}})['then'](respondWithResult(_0x34260d,null))['catch'](handleError(_0x34260d,null));};
\ No newline at end of file
index 0905a76..a98ca91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fdc=['setMaxListeners','save','update','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x470b0a,_0x2889d6){var _0x4463f6=function(_0x2b5f0e){while(--_0x2b5f0e){_0x470b0a['push'](_0x470b0a['shift']());}};_0x4463f6(++_0x2889d6);}(_0x4fdc,0x84));var _0xc4fd=function(_0xf6e256,_0x50c1ba){_0xf6e256=_0xf6e256-0x0;var _0x4f86b7=_0x4fdc[_0xf6e256];return _0x4f86b7;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xc4fd('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xc4fd('0x1')](0x0);var events={'afterCreate':_0xc4fd('0x2'),'afterUpdate':_0xc4fd('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3de7e2){return function(_0x2dee59,_0x363bd1,_0x14c82a){ChatQueueEvents[_0xc4fd('0x4')](_0x3de7e2+':'+_0x2dee59['id'],_0x2dee59);ChatQueueEvents[_0xc4fd('0x4')](_0x3de7e2,_0x2dee59);_0x14c82a(null);};}for(var e in events){if(events[_0xc4fd('0x5')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xc4fd('0x6')]=ChatQueueEvents;
\ No newline at end of file
+var _0xb676=['ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x586db1,_0x4acf4b){var _0x836e14=function(_0x530413){while(--_0x530413){_0x586db1['push'](_0x586db1['shift']());}};_0x836e14(++_0x4acf4b);}(_0xb676,0xbc));var _0x6b67=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0xb676[_0x1f36bb];return _0xaf97fa;};'use strict';var EventEmitter=require(_0x6b67('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x6b67('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x6b67('0x2')](0x0);var events={'afterCreate':_0x6b67('0x3'),'afterUpdate':_0x6b67('0x4'),'afterDestroy':'remove'};function emitEvent(_0x564da1){return function(_0x1ed5cd,_0xa6e590,_0x4dee9f){ChatQueueEvents[_0x6b67('0x5')](_0x564da1+':'+_0x1ed5cd['id'],_0x1ed5cd);ChatQueueEvents['emit'](_0x564da1,_0x1ed5cd);_0x4dee9f(null);};}for(var e in events){if(events[_0x6b67('0x6')](e)){var event=events[e];ChatQueue[_0x6b67('0x7')](e,emitEvent(event));}}module[_0x6b67('0x8')]=ChatQueueEvents;
\ No newline at end of file
index 3db2e61..abc7ff1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6334=['bluebird','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0x1463e3,_0x2d2703){var _0x15ca0a=function(_0x34c792){while(--_0x34c792){_0x1463e3['push'](_0x1463e3['shift']());}};_0x15ca0a(++_0x2d2703);}(_0x6334,0x119));var _0x4633=function(_0x20e7e3,_0x1529be){_0x20e7e3=_0x20e7e3-0x0;var _0x14b9de=_0x6334[_0x20e7e3];return _0x14b9de;};'use strict';var _=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var logger=require(_0x4633('0x2'))(_0x4633('0x3'));var moment=require(_0x4633('0x4'));var BPromise=require(_0x4633('0x5'));var rp=require('request-promise');var attributes=require(_0x4633('0x6'));module[_0x4633('0x7')]=function(_0x2a2b3c,_0x3572d1){return _0x2a2b3c[_0x4633('0x8')](_0x4633('0x9'),attributes,{'tableName':_0x4633('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x84e7=['define','ChatQueue','util','../../config/logger','moment','bluebird','./chatQueue.attributes','exports'];(function(_0x3f43eb,_0x35fce0){var _0x5eaaf3=function(_0x533b7a){while(--_0x533b7a){_0x3f43eb['push'](_0x3f43eb['shift']());}};_0x5eaaf3(++_0x35fce0);}(_0x84e7,0x122));var _0x784e=function(_0x48ce2f,_0x2e21ea){_0x48ce2f=_0x48ce2f-0x0;var _0x3f667b=_0x84e7[_0x48ce2f];return _0x3f667b;};'use strict';var _=require('lodash');var util=require(_0x784e('0x0'));var logger=require(_0x784e('0x1'))('api');var moment=require(_0x784e('0x2'));var BPromise=require(_0x784e('0x3'));var rp=require('request-promise');var attributes=require(_0x784e('0x4'));module[_0x784e('0x5')]=function(_0x205619,_0xdc7692){return _0x205619[_0x784e('0x6')](_0x784e('0x7'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2d3f31c..04b0129 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['rpc','../../config/environment','jayson/promise','client','socket.io-emitter','localhost','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','map','include','model','attributes','debug','ShowChatQueue','find','lodash','util','moment','../../mysqldb','../../config/logger'];(function(_0x22a96e,_0x100624){var _0xfbb257=function(_0x15c5f4){while(--_0x15c5f4){_0x22a96e['push'](_0x22a96e['shift']());}};_0xfbb257(++_0x100624);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 db=require(_0x0a9e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a9e('0x4'))(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var jayson=require(_0x0a9e('0x7'));var client=jayson[_0x0a9e('0x8')]['http']({'port':0x232a});var socket=require(_0x0a9e('0x9'))({'host':_0x0a9e('0xa'),'port':0x18eb});require(_0x0a9e('0xb'))['register'](socket);function respondWithRpcPromise(_0x503809,_0xe42b77,_0x56465b){return new BPromise(function(_0x52cace,_0x39753a){return client[_0x0a9e('0xc')](_0x503809,_0x56465b)[_0x0a9e('0xd')](function(_0x3ab53f){logger[_0x0a9e('0xe')](_0x0a9e('0xf'),_0xe42b77,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0xe42b77,'request\x20sent',JSON[_0x0a9e('0x10')](_0x3ab53f));if(_0x3ab53f[_0x0a9e('0x11')]){if(_0x3ab53f[_0x0a9e('0x11')][_0x0a9e('0x12')]===0x1f4){logger[_0x0a9e('0x11')](_0x0a9e('0xf'),_0xe42b77,_0x3ab53f['error'][_0x0a9e('0x13')]);return _0x39753a(_0x3ab53f[_0x0a9e('0x11')][_0x0a9e('0x13')]);}logger[_0x0a9e('0x11')](_0x0a9e('0xf'),_0xe42b77,_0x3ab53f[_0x0a9e('0x11')]['message']);return _0x52cace(_0x3ab53f[_0x0a9e('0x11')]['message']);}else{logger[_0x0a9e('0xe')]('ChatQueue,\x20%s,\x20%s',_0xe42b77,_0x0a9e('0x14'));_0x52cace(_0x3ab53f[_0x0a9e('0x15')]['message']);}})[_0x0a9e('0x16')](function(_0x5a0a06){logger[_0x0a9e('0x11')](_0x0a9e('0xf'),_0xe42b77,_0x5a0a06);_0x39753a(_0x5a0a06);});});}exports[_0x0a9e('0x17')]=function(_0x205fd6){var _0x31b1ca=this;return new Promise(function(_0x2eb11f,_0x530eb7){return db[_0x0a9e('0x18')][_0x0a9e('0x19')]({'raw':_0x205fd6[_0x0a9e('0x1a')]?_0x205fd6[_0x0a9e('0x1a')][_0x0a9e('0x1b')]===undefined?!![]:![]:!![],'where':_0x205fd6['options']?_0x205fd6[_0x0a9e('0x1a')][_0x0a9e('0x1c')]||null:null,'attributes':_0x205fd6['options']?_0x205fd6[_0x0a9e('0x1a')]['attributes']||null:null,'limit':_0x205fd6['options']?_0x205fd6[_0x0a9e('0x1a')][_0x0a9e('0x1d')]||null:null,'include':_0x205fd6[_0x0a9e('0x1a')]?_0x205fd6[_0x0a9e('0x1a')]['include']?_[_0x0a9e('0x1e')](_0x205fd6[_0x0a9e('0x1a')][_0x0a9e('0x1f')],function(_0x4d00e6){return{'model':db[_0x4d00e6[_0x0a9e('0x20')]],'as':_0x4d00e6['as'],'attributes':_0x4d00e6[_0x0a9e('0x21')],'include':_0x4d00e6[_0x0a9e('0x1f')]?_['map'](_0x4d00e6['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x20')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x21')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x20')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0xd')](function(_0x34dc65){logger[_0x0a9e('0xe')](_0x0a9e('0x17'),_0x205fd6);logger[_0x0a9e('0x22')](_0x0a9e('0x17'),_0x205fd6,JSON[_0x0a9e('0x10')](_0x34dc65));_0x2eb11f(_0x34dc65);})[_0x0a9e('0x16')](function(_0x5a101a){logger[_0x0a9e('0x11')](_0x0a9e('0x17'),_0x5a101a[_0x0a9e('0x13')],_0x205fd6);_0x530eb7(_0x31b1ca[_0x0a9e('0x11')](0x1f4,_0x5a101a['message']));});});};exports[_0x0a9e('0x23')]=function(_0x40e7a3){var _0x1843b2=this;return new Promise(function(_0x824a4f,_0x58b06f){return db[_0x0a9e('0x18')][_0x0a9e('0x24')]({'raw':_0x40e7a3[_0x0a9e('0x1a')]?_0x40e7a3[_0x0a9e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x40e7a3[_0x0a9e('0x1a')]?_0x40e7a3['options'][_0x0a9e('0x1c')]||null:null,'attributes':_0x40e7a3[_0x0a9e('0x1a')]?_0x40e7a3[_0x0a9e('0x1a')][_0x0a9e('0x21')]||null:null,'include':_0x40e7a3[_0x0a9e('0x1a')]?_0x40e7a3['options'][_0x0a9e('0x1f')]?_[_0x0a9e('0x1e')](_0x40e7a3[_0x0a9e('0x1a')][_0x0a9e('0x1f')],function(_0x2b45ea){return{'model':db[_0x2b45ea[_0x0a9e('0x20')]],'as':_0x2b45ea['as'],'attributes':_0x2b45ea[_0x0a9e('0x21')],'include':_0x2b45ea[_0x0a9e('0x1f')]?_['map'](_0x2b45ea[_0x0a9e('0x1f')],function(_0x5e7238){return{'model':db[_0x5e7238[_0x0a9e('0x20')]],'as':_0x5e7238['as'],'attributes':_0x5e7238[_0x0a9e('0x21')],'include':_0x5e7238[_0x0a9e('0x1f')]?_[_0x0a9e('0x1e')](_0x5e7238['include'],function(_0x191e91){return{'model':db[_0x191e91[_0x0a9e('0x20')]],'as':_0x191e91['as'],'attributes':_0x191e91[_0x0a9e('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0xd')](function(_0x4853b1){logger['info'](_0x0a9e('0x23'),_0x40e7a3);logger['debug'](_0x0a9e('0x23'),_0x40e7a3,JSON[_0x0a9e('0x10')](_0x4853b1));_0x824a4f(_0x4853b1);})[_0x0a9e('0x16')](function(_0x1ef87a){logger['error'](_0x0a9e('0x23'),_0x1ef87a[_0x0a9e('0x13')],_0x40e7a3);_0x58b06f(_0x1843b2[_0x0a9e('0x11')](0x1f4,_0x1ef87a['message']));});});};
\ No newline at end of file
+var _0xa9e0=['rpc','../../config/environment','jayson/promise','client','socket.io-emitter','localhost','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','map','include','model','attributes','debug','ShowChatQueue','find','lodash','util','moment','../../mysqldb','../../config/logger'];(function(_0x1145f7,_0x34a977){var _0x5cb8b5=function(_0x5a87a6){while(--_0x5a87a6){_0x1145f7['push'](_0x1145f7['shift']());}};_0x5cb8b5(++_0x34a977);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0x0a9e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a9e('0x4'))(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var jayson=require(_0x0a9e('0x7'));var client=jayson[_0x0a9e('0x8')]['http']({'port':0x232a});var socket=require(_0x0a9e('0x9'))({'host':_0x0a9e('0xa'),'port':0x18eb});require(_0x0a9e('0xb'))['register'](socket);function respondWithRpcPromise(_0x503809,_0xe42b77,_0x56465b){return new BPromise(function(_0x52cace,_0x39753a){return client[_0x0a9e('0xc')](_0x503809,_0x56465b)[_0x0a9e('0xd')](function(_0x3ab53f){logger[_0x0a9e('0xe')](_0x0a9e('0xf'),_0xe42b77,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0xe42b77,'request\x20sent',JSON[_0x0a9e('0x10')](_0x3ab53f));if(_0x3ab53f[_0x0a9e('0x11')]){if(_0x3ab53f[_0x0a9e('0x11')][_0x0a9e('0x12')]===0x1f4){logger[_0x0a9e('0x11')](_0x0a9e('0xf'),_0xe42b77,_0x3ab53f['error'][_0x0a9e('0x13')]);return _0x39753a(_0x3ab53f[_0x0a9e('0x11')][_0x0a9e('0x13')]);}logger[_0x0a9e('0x11')](_0x0a9e('0xf'),_0xe42b77,_0x3ab53f[_0x0a9e('0x11')]['message']);return _0x52cace(_0x3ab53f[_0x0a9e('0x11')]['message']);}else{logger[_0x0a9e('0xe')]('ChatQueue,\x20%s,\x20%s',_0xe42b77,_0x0a9e('0x14'));_0x52cace(_0x3ab53f[_0x0a9e('0x15')]['message']);}})[_0x0a9e('0x16')](function(_0x5a0a06){logger[_0x0a9e('0x11')](_0x0a9e('0xf'),_0xe42b77,_0x5a0a06);_0x39753a(_0x5a0a06);});});}exports[_0x0a9e('0x17')]=function(_0x205fd6){var _0x31b1ca=this;return new Promise(function(_0x2eb11f,_0x530eb7){return db[_0x0a9e('0x18')][_0x0a9e('0x19')]({'raw':_0x205fd6[_0x0a9e('0x1a')]?_0x205fd6[_0x0a9e('0x1a')][_0x0a9e('0x1b')]===undefined?!![]:![]:!![],'where':_0x205fd6['options']?_0x205fd6[_0x0a9e('0x1a')][_0x0a9e('0x1c')]||null:null,'attributes':_0x205fd6['options']?_0x205fd6[_0x0a9e('0x1a')]['attributes']||null:null,'limit':_0x205fd6['options']?_0x205fd6[_0x0a9e('0x1a')][_0x0a9e('0x1d')]||null:null,'include':_0x205fd6[_0x0a9e('0x1a')]?_0x205fd6[_0x0a9e('0x1a')]['include']?_[_0x0a9e('0x1e')](_0x205fd6[_0x0a9e('0x1a')][_0x0a9e('0x1f')],function(_0x4d00e6){return{'model':db[_0x4d00e6[_0x0a9e('0x20')]],'as':_0x4d00e6['as'],'attributes':_0x4d00e6[_0x0a9e('0x21')],'include':_0x4d00e6[_0x0a9e('0x1f')]?_['map'](_0x4d00e6['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x20')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x21')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x20')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0xd')](function(_0x34dc65){logger[_0x0a9e('0xe')](_0x0a9e('0x17'),_0x205fd6);logger[_0x0a9e('0x22')](_0x0a9e('0x17'),_0x205fd6,JSON[_0x0a9e('0x10')](_0x34dc65));_0x2eb11f(_0x34dc65);})[_0x0a9e('0x16')](function(_0x5a101a){logger[_0x0a9e('0x11')](_0x0a9e('0x17'),_0x5a101a[_0x0a9e('0x13')],_0x205fd6);_0x530eb7(_0x31b1ca[_0x0a9e('0x11')](0x1f4,_0x5a101a['message']));});});};exports[_0x0a9e('0x23')]=function(_0x40e7a3){var _0x1843b2=this;return new Promise(function(_0x824a4f,_0x58b06f){return db[_0x0a9e('0x18')][_0x0a9e('0x24')]({'raw':_0x40e7a3[_0x0a9e('0x1a')]?_0x40e7a3[_0x0a9e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x40e7a3[_0x0a9e('0x1a')]?_0x40e7a3['options'][_0x0a9e('0x1c')]||null:null,'attributes':_0x40e7a3[_0x0a9e('0x1a')]?_0x40e7a3[_0x0a9e('0x1a')][_0x0a9e('0x21')]||null:null,'include':_0x40e7a3[_0x0a9e('0x1a')]?_0x40e7a3['options'][_0x0a9e('0x1f')]?_[_0x0a9e('0x1e')](_0x40e7a3[_0x0a9e('0x1a')][_0x0a9e('0x1f')],function(_0x2b45ea){return{'model':db[_0x2b45ea[_0x0a9e('0x20')]],'as':_0x2b45ea['as'],'attributes':_0x2b45ea[_0x0a9e('0x21')],'include':_0x2b45ea[_0x0a9e('0x1f')]?_['map'](_0x2b45ea[_0x0a9e('0x1f')],function(_0x5e7238){return{'model':db[_0x5e7238[_0x0a9e('0x20')]],'as':_0x5e7238['as'],'attributes':_0x5e7238[_0x0a9e('0x21')],'include':_0x5e7238[_0x0a9e('0x1f')]?_[_0x0a9e('0x1e')](_0x5e7238['include'],function(_0x191e91){return{'model':db[_0x191e91[_0x0a9e('0x20')]],'as':_0x191e91['as'],'attributes':_0x191e91[_0x0a9e('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0xd')](function(_0x4853b1){logger['info'](_0x0a9e('0x23'),_0x40e7a3);logger['debug'](_0x0a9e('0x23'),_0x40e7a3,JSON[_0x0a9e('0x10')](_0x4853b1));_0x824a4f(_0x4853b1);})[_0x0a9e('0x16')](function(_0x1ef87a){logger['error'](_0x0a9e('0x23'),_0x1ef87a[_0x0a9e('0x13')],_0x40e7a3);_0x58b06f(_0x1843b2[_0x0a9e('0x11')](0x1f4,_0x1ef87a['message']));});});};
\ No newline at end of file
index 0ce2106..50625aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','chatQueue:','./chatQueue.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(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index 4207bdb..7151ef7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8443=['put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','/:id/members','/:id/teams','/:id/users','post','create','addTeams','addAgents'];(function(_0x3bde2c,_0x3584cf){var _0x18abbe=function(_0x24ae93){while(--_0x24ae93){_0x3bde2c['push'](_0x3bde2c['shift']());}};_0x18abbe(++_0x3584cf);}(_0x8443,0x101));var _0x3844=function(_0x57efaa,_0x1d0a41){_0x57efaa=_0x57efaa-0x0;var _0x3c7ecb=_0x8443[_0x57efaa];return _0x3c7ecb;};'use strict';var multer=require(_0x3844('0x0'));var util=require(_0x3844('0x1'));var path=require('path');var express=require('express');var router=express[_0x3844('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x3844('0x3'));var config=require(_0x3844('0x4'));var controller=require('./chatQueue.controller');router['get']('/',auth[_0x3844('0x5')](),controller['index']);router[_0x3844('0x6')](_0x3844('0x7'),auth[_0x3844('0x5')](),controller[_0x3844('0x8')]);router[_0x3844('0x6')](_0x3844('0x9'),auth['isAuthenticated'](),controller[_0x3844('0xa')]);router[_0x3844('0x6')](_0x3844('0xb'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x3844('0xc'),auth[_0x3844('0x5')](),controller['getTeams']);router[_0x3844('0x6')](_0x3844('0xd'),auth[_0x3844('0x5')](),controller['getAgents']);router[_0x3844('0xe')]('/',auth['isAuthenticated'](),controller[_0x3844('0xf')]);router[_0x3844('0xe')](_0x3844('0xc'),auth[_0x3844('0x5')](),controller[_0x3844('0x10')]);router[_0x3844('0xe')](_0x3844('0xd'),auth[_0x3844('0x5')](),controller[_0x3844('0x11')]);router[_0x3844('0x12')](_0x3844('0x9'),auth[_0x3844('0x5')](),controller[_0x3844('0x13')]);router[_0x3844('0x14')]('/:id',auth[_0x3844('0x5')](),controller[_0x3844('0x15')]);router[_0x3844('0x14')]('/:id/teams',auth[_0x3844('0x5')](),controller[_0x3844('0x16')]);router[_0x3844('0x14')]('/:id/users',auth[_0x3844('0x5')](),controller[_0x3844('0x17')]);module[_0x3844('0x18')]=router;
\ No newline at end of file
+var _0x3614=['isAuthenticated','index','/describe','describe','/:id','show','getMembers','getTeams','getAgents','post','create','/:id/teams','/:id/users','addAgents','put','delete','destroy','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get'];(function(_0x40310b,_0x2db179){var _0x1e67f3=function(_0x343f88){while(--_0x343f88){_0x40310b['push'](_0x40310b['shift']());}};_0x1e67f3(++_0x2db179);}(_0x3614,0xf3));var _0x4361=function(_0xb7f5f5,_0x34768f){_0xb7f5f5=_0xb7f5f5-0x0;var _0x246578=_0x3614[_0xb7f5f5];return _0x246578;};'use strict';var multer=require(_0x4361('0x0'));var util=require(_0x4361('0x1'));var path=require(_0x4361('0x2'));var express=require(_0x4361('0x3'));var router=express[_0x4361('0x4')]();var auth=require(_0x4361('0x5'));var interaction=require(_0x4361('0x6'));var config=require('../../config/environment');var controller=require(_0x4361('0x7'));router[_0x4361('0x8')]('/',auth[_0x4361('0x9')](),controller[_0x4361('0xa')]);router[_0x4361('0x8')](_0x4361('0xb'),auth[_0x4361('0x9')](),controller[_0x4361('0xc')]);router[_0x4361('0x8')](_0x4361('0xd'),auth[_0x4361('0x9')](),controller[_0x4361('0xe')]);router[_0x4361('0x8')]('/:id/members',auth[_0x4361('0x9')](),controller[_0x4361('0xf')]);router[_0x4361('0x8')]('/:id/teams',auth[_0x4361('0x9')](),controller[_0x4361('0x10')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x4361('0x11')]);router[_0x4361('0x12')]('/',auth[_0x4361('0x9')](),controller[_0x4361('0x13')]);router['post'](_0x4361('0x14'),auth[_0x4361('0x9')](),controller['addTeams']);router['post'](_0x4361('0x15'),auth[_0x4361('0x9')](),controller[_0x4361('0x16')]);router[_0x4361('0x17')](_0x4361('0xd'),auth[_0x4361('0x9')](),controller['update']);router[_0x4361('0x18')](_0x4361('0xd'),auth[_0x4361('0x9')](),controller[_0x4361('0x19')]);router[_0x4361('0x18')]('/:id/teams',auth[_0x4361('0x9')](),controller['removeTeams']);router[_0x4361('0x18')](_0x4361('0x15'),auth[_0x4361('0x9')](),controller[_0x4361('0x1a')]);module[_0x4361('0x1b')]=router;
\ No newline at end of file
index a09e422..3299ab6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd94d=['STRING','DATE','moment','sequelize','exports'];(function(_0xb3daf7,_0x33755a){var _0x11998f=function(_0x523e2b){while(--_0x523e2b){_0xb3daf7['push'](_0xb3daf7['shift']());}};_0x11998f(++_0x33755a);}(_0xd94d,0x101));var _0xdd94=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd94d[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xdd94('0x0'));var Sequelize=require(_0xdd94('0x1'));module[_0xdd94('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xdd94('0x3')]},'joinAt':{'type':Sequelize[_0xdd94('0x4')]},'leaveAt':{'type':Sequelize[_0xdd94('0x4')]},'acceptAt':{'type':Sequelize[_0xdd94('0x4')]},'exitAt':{'type':Sequelize[_0xdd94('0x4')]},'reason':{'type':Sequelize[_0xdd94('0x3')]}};
\ No newline at end of file
+var _0x438c=['exports','STRING','DATE','moment','sequelize'];(function(_0x279875,_0x4d3d3c){var _0x4fba53=function(_0xd97328){while(--_0xd97328){_0x279875['push'](_0x279875['shift']());}};_0x4fba53(++_0x4d3d3c);}(_0x438c,0x16b));var _0xc438=function(_0x795855,_0x416e01){_0x795855=_0x795855-0x0;var _0x1e26f2=_0x438c[_0x795855];return _0x1e26f2;};'use strict';var moment=require(_0xc438('0x0'));var Sequelize=require(_0xc438('0x1'));module[_0xc438('0x2')]={'uniqueid':{'type':Sequelize[_0xc438('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc438('0x4')]},'leaveAt':{'type':Sequelize[_0xc438('0x4')]},'acceptAt':{'type':Sequelize[_0xc438('0x4')]},'exitAt':{'type':Sequelize[_0xc438('0x4')]},'reason':{'type':Sequelize[_0xc438('0x3')]}};
\ No newline at end of file
index 2f822fc..e3126e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc90=['length','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','model','query','dateStart','dateEnd','keys','filters','intersection','fields','attributes','nolimit','order','sort','pick','add','where','filter','merge','map','options','ChatQueueReport','count','includeAll','include','catch','show','params'];(function(_0x5cece2,_0x40f1b1){var _0x46cc39=function(_0x3228c5){while(--_0x3228c5){_0x5cece2['push'](_0x5cece2['shift']());}};_0x46cc39(++_0x40f1b1);}(_0xdc90,0x1af));var _0x0dc9=function(_0x540418,_0x367cc4){_0x540418=_0x540418-0x0;var _0x3278ba=_0xdc90[_0x540418];return _0x3278ba;};'use strict';var pdf=require(_0x0dc9('0x0'));var emlformat=require(_0x0dc9('0x1'));var rimraf=require(_0x0dc9('0x2'));var zipdir=require(_0x0dc9('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0dc9('0x4'));var moment=require('moment');var BPromise=require(_0x0dc9('0x5'));var Mustache=require(_0x0dc9('0x6'));var util=require('util');var path=require(_0x0dc9('0x7'));var sox=require(_0x0dc9('0x8'));var csv=require(_0x0dc9('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0dc9('0xa'));var squel=require(_0x0dc9('0xb'));var crypto=require(_0x0dc9('0xc'));var jsforce=require(_0x0dc9('0xd'));var deskjs=require(_0x0dc9('0xe'));var toCsv=require(_0x0dc9('0x9'));var querystring=require('querystring');var Papa=require(_0x0dc9('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x0dc9('0x10'))(_0x0dc9('0x11'));var utils=require(_0x0dc9('0x12'));var config=require(_0x0dc9('0x13'));var db=require(_0x0dc9('0x14'))['db'];function respondWithStatusCode(_0x3998b6,_0x326cf0){_0x326cf0=_0x326cf0||0xcc;return function(_0x57178f){if(_0x57178f){return _0x3998b6[_0x0dc9('0x15')](_0x326cf0);}return _0x3998b6['status'](_0x326cf0)[_0x0dc9('0x16')]();};}function respondWithResult(_0x2dde3e,_0x9eddf0){_0x9eddf0=_0x9eddf0||0xc8;return function(_0x139f75){if(_0x139f75){return _0x2dde3e[_0x0dc9('0x17')](_0x9eddf0)[_0x0dc9('0x18')](_0x139f75);}};}function respondWithFilteredResult(_0x291002,_0x39a57d){return function(_0x213a44){if(_0x213a44){var _0x988f97=_0x213a44['count'],_0x1cc9b3=_0x39a57d['offset'],_0x4fa1c8=_0x39a57d[_0x0dc9('0x19')]+_0x39a57d[_0x0dc9('0x1a')],_0x27e6b6;if(_0x4fa1c8>=_0x988f97){_0x4fa1c8=_0x988f97;_0x27e6b6=0xc8;}else{_0x27e6b6=0xce;}_0x291002[_0x0dc9('0x17')](_0x27e6b6);return _0x291002[_0x0dc9('0x1b')]('Content-Range',_0x1cc9b3+'-'+_0x4fa1c8+'/'+_0x988f97)[_0x0dc9('0x18')](_0x213a44);}return null;};}function patchUpdates(_0x2c9cb6){return function(_0x44a33c){try{jsonpatch[_0x0dc9('0x1c')](_0x44a33c,_0x2c9cb6,!![]);}catch(_0x1f894c){return BPromise[_0x0dc9('0x1d')](_0x1f894c);}return _0x44a33c[_0x0dc9('0x1e')]();};}function saveUpdates(_0x2c8de3,_0x444cef){return function(_0x42363d){if(_0x42363d){return _0x42363d[_0x0dc9('0x1f')](_0x2c8de3)['then'](function(_0x15e682){return _0x15e682;});}return null;};}function removeEntity(_0x5773ae,_0x1d4e92){return function(_0xf38620){if(_0xf38620){return _0xf38620[_0x0dc9('0x20')]()[_0x0dc9('0x21')](function(){_0x5773ae[_0x0dc9('0x17')](0xcc)[_0x0dc9('0x16')]();});}};}function handleEntityNotFound(_0x298628,_0x3c477a){return function(_0x59318d){if(!_0x59318d){_0x298628[_0x0dc9('0x15')](0x194);}return _0x59318d;};}function handleError(_0x105804,_0x4faf89){_0x4faf89=_0x4faf89||0x1f4;return function(_0x55f848){logger[_0x0dc9('0x22')](_0x55f848[_0x0dc9('0x23')]);if(_0x55f848[_0x0dc9('0x24')]){delete _0x55f848[_0x0dc9('0x24')];}_0x105804[_0x0dc9('0x17')](_0x4faf89)[_0x0dc9('0x25')](_0x55f848);};}exports[_0x0dc9('0x26')]=function(_0x78a0f4,_0x396ba4){var _0x262953={},_0x51273d={},_0x499af7={'count':0x0,'rows':[]};var _0x199654=db['ChatQueueReport'][_0x0dc9('0x27')];_0x51273d[_0x0dc9('0x28')]=_['keys'](_0x199654);var _0xe3f2a1={'dateStart':_0x78a0f4[_0x0dc9('0x29')][_0x0dc9('0x2a')],'dateEnd':_0x78a0f4[_0x0dc9('0x29')][_0x0dc9('0x2b')]};delete _0x78a0f4['query'][_0x0dc9('0x2a')];delete _0x78a0f4[_0x0dc9('0x29')][_0x0dc9('0x2b')];_0x51273d[_0x0dc9('0x29')]=_[_0x0dc9('0x2c')](_0x78a0f4[_0x0dc9('0x29')]);_0x51273d[_0x0dc9('0x2d')]=_[_0x0dc9('0x2e')](_0x51273d[_0x0dc9('0x28')],_0x51273d[_0x0dc9('0x29')]);_0x262953['attributes']=_['intersection'](_0x51273d[_0x0dc9('0x28')],qs[_0x0dc9('0x2f')](_0x78a0f4[_0x0dc9('0x29')]['fields']));_0x262953['attributes']=_0x262953[_0x0dc9('0x30')]['length']?_0x262953[_0x0dc9('0x30')]:_0x51273d[_0x0dc9('0x28')];if(!_0x78a0f4['query']['hasOwnProperty'](_0x0dc9('0x31'))){_0x262953[_0x0dc9('0x1a')]=qs['limit'](_0x78a0f4[_0x0dc9('0x29')][_0x0dc9('0x1a')]);_0x262953['offset']=qs[_0x0dc9('0x19')](_0x78a0f4[_0x0dc9('0x29')][_0x0dc9('0x19')]);}_0x262953[_0x0dc9('0x32')]=qs[_0x0dc9('0x33')](_0x78a0f4[_0x0dc9('0x29')][_0x0dc9('0x33')]);_0x262953['where']=qs[_0x0dc9('0x2d')](_[_0x0dc9('0x34')](_0x78a0f4[_0x0dc9('0x29')],_0x51273d[_0x0dc9('0x2d')]));if(_0xe3f2a1[_0x0dc9('0x2a')]){if(_0xe3f2a1[_0x0dc9('0x2b')]){_0xe3f2a1[_0x0dc9('0x2b')]=moment(_0xe3f2a1['dateEnd'])[_0x0dc9('0x35')](0x1,'day');}else{_0xe3f2a1['dateEnd']=moment(_0xe3f2a1[_0x0dc9('0x2a')])[_0x0dc9('0x35')](0x1,'day');}_['merge'](_0x262953[_0x0dc9('0x36')],{'createdAt':{'$gte':_0xe3f2a1['dateStart'],'$lte':_0xe3f2a1[_0x0dc9('0x2b')]}});}if(_0x78a0f4[_0x0dc9('0x29')][_0x0dc9('0x37')]){_0x262953['where']=_[_0x0dc9('0x38')](_0x262953[_0x0dc9('0x36')],{'$or':_[_0x0dc9('0x39')](_0x262953['attributes'],function(_0xccd403){var _0x73345e={};_0x73345e[_0xccd403]={'$like':'%'+_0x78a0f4['query'][_0x0dc9('0x37')]+'%'};return _0x73345e;})});}_0x262953=_['merge']({},_0x262953,_0x78a0f4[_0x0dc9('0x3a')]);var _0x2bef47={'where':_0x262953['where']};return db[_0x0dc9('0x3b')][_0x0dc9('0x3c')](_0x2bef47)[_0x0dc9('0x21')](function(_0x1ba73e){_0x499af7[_0x0dc9('0x3c')]=_0x1ba73e;if(_0x78a0f4['query'][_0x0dc9('0x3d')]){_0x262953[_0x0dc9('0x3e')]=[{'all':!![]}];}return db[_0x0dc9('0x3b')]['findAll'](_0x262953);})['then'](function(_0x560563){_0x499af7['rows']=_0x560563;return _0x499af7;})[_0x0dc9('0x21')](respondWithFilteredResult(_0x396ba4,_0x262953))[_0x0dc9('0x3f')](handleError(_0x396ba4,null));};exports[_0x0dc9('0x40')]=function(_0x351509,_0x552a52){var _0x42ddd9={'raw':!![],'where':{'id':_0x351509[_0x0dc9('0x41')]['id']}},_0x3be852={};_0x3be852[_0x0dc9('0x28')]=_['keys'](db[_0x0dc9('0x3b')][_0x0dc9('0x27')]);_0x3be852[_0x0dc9('0x29')]=_[_0x0dc9('0x2c')](_0x351509['query']);_0x3be852[_0x0dc9('0x2d')]=_['intersection'](_0x3be852[_0x0dc9('0x28')],_0x3be852['query']);_0x42ddd9['attributes']=_[_0x0dc9('0x2e')](_0x3be852[_0x0dc9('0x28')],qs['fields'](_0x351509[_0x0dc9('0x29')][_0x0dc9('0x2f')]));_0x42ddd9['attributes']=_0x42ddd9[_0x0dc9('0x30')][_0x0dc9('0x42')]?_0x42ddd9[_0x0dc9('0x30')]:_0x3be852[_0x0dc9('0x28')];if(_0x351509[_0x0dc9('0x29')][_0x0dc9('0x3d')]){_0x42ddd9[_0x0dc9('0x3e')]=[{'all':!![]}];}_0x42ddd9=_[_0x0dc9('0x38')]({},_0x42ddd9,_0x351509[_0x0dc9('0x3a')]);return db['ChatQueueReport'][_0x0dc9('0x43')](_0x42ddd9)['then'](handleEntityNotFound(_0x552a52,null))[_0x0dc9('0x21')](respondWithResult(_0x552a52,null))[_0x0dc9('0x3f')](handleError(_0x552a52,null));};exports[_0x0dc9('0x44')]=function(_0x185ea2,_0x2bbe74){return db[_0x0dc9('0x3b')]['create'](_0x185ea2[_0x0dc9('0x45')],{})[_0x0dc9('0x21')](respondWithResult(_0x2bbe74,0xc9))[_0x0dc9('0x3f')](handleError(_0x2bbe74,null));};exports['update']=function(_0x4d5928,_0x142cd4){if(_0x4d5928['body']['id']){delete _0x4d5928[_0x0dc9('0x45')]['id'];}return db[_0x0dc9('0x3b')][_0x0dc9('0x43')]({'where':{'id':_0x4d5928[_0x0dc9('0x41')]['id']}})[_0x0dc9('0x21')](handleEntityNotFound(_0x142cd4,null))[_0x0dc9('0x21')](saveUpdates(_0x4d5928[_0x0dc9('0x45')],null))[_0x0dc9('0x21')](respondWithResult(_0x142cd4,null))[_0x0dc9('0x3f')](handleError(_0x142cd4,null));};exports[_0x0dc9('0x20')]=function(_0x28ec01,_0x4bc9df){return db[_0x0dc9('0x3b')][_0x0dc9('0x43')]({'where':{'id':_0x28ec01[_0x0dc9('0x41')]['id']}})[_0x0dc9('0x21')](handleEntityNotFound(_0x4bc9df,null))[_0x0dc9('0x21')](removeEntity(_0x4bc9df,null))[_0x0dc9('0x3f')](handleError(_0x4bc9df,null));};exports[_0x0dc9('0x46')]=function(_0x4fed0b,_0x45f741){return db[_0x0dc9('0x3b')][_0x0dc9('0x46')]()['then'](respondWithResult(_0x45f741,null))[_0x0dc9('0x3f')](handleError(_0x45f741,null));};
\ No newline at end of file
+var _0x9a05=['lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','ChatQueueReport','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','add','merge','map','filter','includeAll','include','catch','show','find','create','body','params','destroy','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x2e4bae,_0x1d3b4f){var _0x4934cb=function(_0x347c51){while(--_0x347c51){_0x2e4bae['push'](_0x2e4bae['shift']());}};_0x4934cb(++_0x1d3b4f);}(_0x9a05,0xc7));var _0x59a0=function(_0x55fb16,_0x4ba18c){_0x55fb16=_0x55fb16-0x0;var _0x3cad7c=_0x9a05[_0x55fb16];return _0x3cad7c;};'use strict';var pdf=require(_0x59a0('0x0'));var emlformat=require(_0x59a0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x59a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x59a0('0x3'));var moment=require(_0x59a0('0x4'));var BPromise=require(_0x59a0('0x5'));var Mustache=require('mustache');var util=require(_0x59a0('0x6'));var path=require(_0x59a0('0x7'));var sox=require(_0x59a0('0x8'));var csv=require(_0x59a0('0x9'));var ejs=require(_0x59a0('0xa'));var fs=require('fs');var _=require(_0x59a0('0xb'));var squel=require(_0x59a0('0xc'));var crypto=require(_0x59a0('0xd'));var jsforce=require(_0x59a0('0xe'));var deskjs=require(_0x59a0('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x59a0('0x10'));var qs=require(_0x59a0('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x59a0('0x12'));var config=require(_0x59a0('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e9554,_0x4a472b){_0x4a472b=_0x4a472b||0xcc;return function(_0x2f57a9){if(_0x2f57a9){return _0x4e9554[_0x59a0('0x14')](_0x4a472b);}return _0x4e9554[_0x59a0('0x15')](_0x4a472b)[_0x59a0('0x16')]();};}function respondWithResult(_0x27a6b0,_0x53d19b){_0x53d19b=_0x53d19b||0xc8;return function(_0x1015dc){if(_0x1015dc){return _0x27a6b0[_0x59a0('0x15')](_0x53d19b)[_0x59a0('0x17')](_0x1015dc);}};}function respondWithFilteredResult(_0x100fd6,_0x71033b){return function(_0x45c61e){if(_0x45c61e){var _0x42411a=_0x45c61e[_0x59a0('0x18')],_0x4293a2=_0x71033b[_0x59a0('0x19')],_0x33347a=_0x71033b['offset']+_0x71033b[_0x59a0('0x1a')],_0x424440;if(_0x33347a>=_0x42411a){_0x33347a=_0x42411a;_0x424440=0xc8;}else{_0x424440=0xce;}_0x100fd6[_0x59a0('0x15')](_0x424440);return _0x100fd6[_0x59a0('0x1b')](_0x59a0('0x1c'),_0x4293a2+'-'+_0x33347a+'/'+_0x42411a)[_0x59a0('0x17')](_0x45c61e);}return null;};}function patchUpdates(_0x491f47){return function(_0x3dd815){try{jsonpatch[_0x59a0('0x1d')](_0x3dd815,_0x491f47,!![]);}catch(_0x53f622){return BPromise[_0x59a0('0x1e')](_0x53f622);}return _0x3dd815[_0x59a0('0x1f')]();};}function saveUpdates(_0x2bc747,_0x5815a3){return function(_0x161b3c){if(_0x161b3c){return _0x161b3c[_0x59a0('0x20')](_0x2bc747)[_0x59a0('0x21')](function(_0x318845){return _0x318845;});}return null;};}function removeEntity(_0xecd723,_0x31f465){return function(_0x5f370b){if(_0x5f370b){return _0x5f370b['destroy']()['then'](function(){_0xecd723[_0x59a0('0x15')](0xcc)[_0x59a0('0x16')]();});}};}function handleEntityNotFound(_0x1ebd2e,_0x2bcb20){return function(_0x1db8b0){if(!_0x1db8b0){_0x1ebd2e[_0x59a0('0x14')](0x194);}return _0x1db8b0;};}function handleError(_0x516776,_0x55fca0){_0x55fca0=_0x55fca0||0x1f4;return function(_0x44511f){logger[_0x59a0('0x22')](_0x44511f[_0x59a0('0x23')]);if(_0x44511f[_0x59a0('0x24')]){delete _0x44511f['name'];}_0x516776[_0x59a0('0x15')](_0x55fca0)[_0x59a0('0x25')](_0x44511f);};}exports[_0x59a0('0x26')]=function(_0x207589,_0x36f220){var _0x4a9dc6={},_0x1a0fb0={},_0x3a1b68={'count':0x0,'rows':[]};var _0x33e3ff=db[_0x59a0('0x27')]['rawAttributes'];_0x1a0fb0[_0x59a0('0x28')]=_[_0x59a0('0x29')](_0x33e3ff);var _0x501a5e={'dateStart':_0x207589[_0x59a0('0x2a')][_0x59a0('0x2b')],'dateEnd':_0x207589[_0x59a0('0x2a')][_0x59a0('0x2c')]};delete _0x207589[_0x59a0('0x2a')][_0x59a0('0x2b')];delete _0x207589['query'][_0x59a0('0x2c')];_0x1a0fb0[_0x59a0('0x2a')]=_[_0x59a0('0x29')](_0x207589[_0x59a0('0x2a')]);_0x1a0fb0[_0x59a0('0x2d')]=_[_0x59a0('0x2e')](_0x1a0fb0['model'],_0x1a0fb0['query']);_0x4a9dc6[_0x59a0('0x2f')]=_['intersection'](_0x1a0fb0['model'],qs[_0x59a0('0x30')](_0x207589[_0x59a0('0x2a')][_0x59a0('0x30')]));_0x4a9dc6[_0x59a0('0x2f')]=_0x4a9dc6[_0x59a0('0x2f')][_0x59a0('0x31')]?_0x4a9dc6[_0x59a0('0x2f')]:_0x1a0fb0[_0x59a0('0x28')];if(!_0x207589[_0x59a0('0x2a')][_0x59a0('0x32')](_0x59a0('0x33'))){_0x4a9dc6[_0x59a0('0x1a')]=qs['limit'](_0x207589[_0x59a0('0x2a')][_0x59a0('0x1a')]);_0x4a9dc6[_0x59a0('0x19')]=qs['offset'](_0x207589[_0x59a0('0x2a')][_0x59a0('0x19')]);}_0x4a9dc6[_0x59a0('0x34')]=qs['sort'](_0x207589[_0x59a0('0x2a')][_0x59a0('0x35')]);_0x4a9dc6[_0x59a0('0x36')]=qs['filters'](_[_0x59a0('0x37')](_0x207589[_0x59a0('0x2a')],_0x1a0fb0[_0x59a0('0x2d')]));if(_0x501a5e[_0x59a0('0x2b')]){if(_0x501a5e[_0x59a0('0x2c')]){_0x501a5e['dateEnd']=moment(_0x501a5e[_0x59a0('0x2c')])[_0x59a0('0x38')](0x1,'day');}else{_0x501a5e[_0x59a0('0x2c')]=moment(_0x501a5e[_0x59a0('0x2b')])[_0x59a0('0x38')](0x1,'day');}_[_0x59a0('0x39')](_0x4a9dc6[_0x59a0('0x36')],{'createdAt':{'$gte':_0x501a5e[_0x59a0('0x2b')],'$lte':_0x501a5e['dateEnd']}});}if(_0x207589[_0x59a0('0x2a')]['filter']){_0x4a9dc6[_0x59a0('0x36')]=_[_0x59a0('0x39')](_0x4a9dc6[_0x59a0('0x36')],{'$or':_[_0x59a0('0x3a')](_0x4a9dc6['attributes'],function(_0x206526){var _0x57f509={};_0x57f509[_0x206526]={'$like':'%'+_0x207589[_0x59a0('0x2a')][_0x59a0('0x3b')]+'%'};return _0x57f509;})});}_0x4a9dc6=_[_0x59a0('0x39')]({},_0x4a9dc6,_0x207589['options']);var _0x485ec7={'where':_0x4a9dc6[_0x59a0('0x36')]};return db[_0x59a0('0x27')][_0x59a0('0x18')](_0x485ec7)[_0x59a0('0x21')](function(_0x163532){_0x3a1b68[_0x59a0('0x18')]=_0x163532;if(_0x207589[_0x59a0('0x2a')][_0x59a0('0x3c')]){_0x4a9dc6[_0x59a0('0x3d')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x4a9dc6);})[_0x59a0('0x21')](function(_0x17ba14){_0x3a1b68['rows']=_0x17ba14;return _0x3a1b68;})[_0x59a0('0x21')](respondWithFilteredResult(_0x36f220,_0x4a9dc6))[_0x59a0('0x3e')](handleError(_0x36f220,null));};exports[_0x59a0('0x3f')]=function(_0x1597fe,_0x559098){var _0x27fe6b={'raw':!![],'where':{'id':_0x1597fe['params']['id']}},_0x54c488={};_0x54c488[_0x59a0('0x28')]=_[_0x59a0('0x29')](db[_0x59a0('0x27')]['rawAttributes']);_0x54c488['query']=_[_0x59a0('0x29')](_0x1597fe[_0x59a0('0x2a')]);_0x54c488[_0x59a0('0x2d')]=_[_0x59a0('0x2e')](_0x54c488[_0x59a0('0x28')],_0x54c488['query']);_0x27fe6b[_0x59a0('0x2f')]=_[_0x59a0('0x2e')](_0x54c488['model'],qs[_0x59a0('0x30')](_0x1597fe[_0x59a0('0x2a')]['fields']));_0x27fe6b[_0x59a0('0x2f')]=_0x27fe6b[_0x59a0('0x2f')][_0x59a0('0x31')]?_0x27fe6b[_0x59a0('0x2f')]:_0x54c488['model'];if(_0x1597fe[_0x59a0('0x2a')][_0x59a0('0x3c')]){_0x27fe6b['include']=[{'all':!![]}];}_0x27fe6b=_[_0x59a0('0x39')]({},_0x27fe6b,_0x1597fe['options']);return db['ChatQueueReport'][_0x59a0('0x40')](_0x27fe6b)[_0x59a0('0x21')](handleEntityNotFound(_0x559098,null))[_0x59a0('0x21')](respondWithResult(_0x559098,null))[_0x59a0('0x3e')](handleError(_0x559098,null));};exports[_0x59a0('0x41')]=function(_0x394db9,_0x1c1ee9){return db['ChatQueueReport'][_0x59a0('0x41')](_0x394db9[_0x59a0('0x42')],{})[_0x59a0('0x21')](respondWithResult(_0x1c1ee9,0xc9))[_0x59a0('0x3e')](handleError(_0x1c1ee9,null));};exports[_0x59a0('0x20')]=function(_0x4603af,_0xf2555d){if(_0x4603af[_0x59a0('0x42')]['id']){delete _0x4603af[_0x59a0('0x42')]['id'];}return db[_0x59a0('0x27')][_0x59a0('0x40')]({'where':{'id':_0x4603af[_0x59a0('0x43')]['id']}})['then'](handleEntityNotFound(_0xf2555d,null))[_0x59a0('0x21')](saveUpdates(_0x4603af['body'],null))[_0x59a0('0x21')](respondWithResult(_0xf2555d,null))[_0x59a0('0x3e')](handleError(_0xf2555d,null));};exports[_0x59a0('0x44')]=function(_0x507f61,_0x50aa9b){return db[_0x59a0('0x27')][_0x59a0('0x40')]({'where':{'id':_0x507f61['params']['id']}})[_0x59a0('0x21')](handleEntityNotFound(_0x50aa9b,null))[_0x59a0('0x21')](removeEntity(_0x50aa9b,null))['catch'](handleError(_0x50aa9b,null));};exports[_0x59a0('0x45')]=function(_0x10d0fb,_0x452ba5){return db[_0x59a0('0x27')][_0x59a0('0x45')]()[_0x59a0('0x21')](respondWithResult(_0x452ba5,null))[_0x59a0('0x3e')](handleError(_0x452ba5,null));};
\ No newline at end of file
index 0663c4c..0b5a717 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['moment','request-promise','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','api'];(function(_0x11ba42,_0x549f2b){var _0x397a69=function(_0x463a87){while(--_0x463a87){_0x11ba42['push'](_0x11ba42['shift']());}};_0x397a69(++_0x549f2b);}(_0x008c,0x188));var _0xc008=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x008c[_0x2f9467];return _0x39894c;};'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 attributes=require(_0xc008('0x6'));module[_0xc008('0x7')]=function(_0x163bd9,_0x1cbe76){return _0x163bd9[_0xc008('0x8')](_0xc008('0x9'),attributes,{'tableName':_0xc008('0xa'),'paranoid':![],'indexes':[{'name':_0xc008('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe14b=['ChatQueueReport','report_chat_queue','uniqueid','lodash','util','moment','bluebird','./chatQueueReport.attributes','define'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe14b,0x93));var _0xbe14=function(_0xfdf433,_0x410338){_0xfdf433=_0xfdf433-0x0;var _0x5ac128=_0xe14b[_0xfdf433];return _0x5ac128;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var attributes=require(_0xbe14('0x4'));module['exports']=function(_0x496c04,_0x1833e3){return _0x496c04[_0xbe14('0x5')](_0xbe14('0x6'),attributes,{'tableName':_0xbe14('0x7'),'paranoid':![],'indexes':[{'name':_0xbe14('0x8'),'fields':[_0xbe14('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
index b4249d7..632fd05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeff8=['message','ChatQueueReport,\x20%s,\x20%s','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xb1a718,_0x4e722f){var _0x176ceb=function(_0x2a0bd4){while(--_0x2a0bd4){_0xb1a718['push'](_0xb1a718['shift']());}};_0x176ceb(++_0x4e722f);}(_0xeff8,0x186));var _0x8eff=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0xeff8[_0x2d9c6a];return _0xf3c918;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var moment=require('moment');var BPromise=require(_0x8eff('0x2'));var rs=require(_0x8eff('0x3'));var fs=require('fs');var db=require(_0x8eff('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8eff('0x5'))(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var jayson=require(_0x8eff('0x8'));var client=jayson['client'][_0x8eff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb54063,_0x3409bc,_0x323b2){return new BPromise(function(_0x491f01,_0x3fb9ee){return client[_0x8eff('0xa')](_0xb54063,_0x323b2)[_0x8eff('0xb')](function(_0x19c94c){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x3409bc,_0x8eff('0xc'));logger[_0x8eff('0xd')](_0x8eff('0xe'),_0x3409bc,'request\x20sent',JSON[_0x8eff('0xf')](_0x19c94c));if(_0x19c94c[_0x8eff('0x10')]){if(_0x19c94c['error'][_0x8eff('0x11')]===0x1f4){logger[_0x8eff('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x3409bc,_0x19c94c['error'][_0x8eff('0x12')]);return _0x3fb9ee(_0x19c94c[_0x8eff('0x10')][_0x8eff('0x12')]);}logger[_0x8eff('0x10')](_0x8eff('0x13'),_0x3409bc,_0x19c94c['error'][_0x8eff('0x12')]);return _0x491f01(_0x19c94c[_0x8eff('0x10')][_0x8eff('0x12')]);}else{logger[_0x8eff('0x14')](_0x8eff('0x13'),_0x3409bc,_0x8eff('0xc'));_0x491f01(_0x19c94c[_0x8eff('0x15')][_0x8eff('0x12')]);}})[_0x8eff('0x16')](function(_0x427902){logger[_0x8eff('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x3409bc,_0x427902);_0x3fb9ee(_0x427902);});});}exports[_0x8eff('0x17')]=function(_0x38fb15){var _0x3cd1dc=this;return new Promise(function(_0x20ec2a,_0x2cd7c5){return db[_0x8eff('0x18')][_0x8eff('0x19')](_0x38fb15[_0x8eff('0x1a')],{'raw':_0x38fb15[_0x8eff('0x1b')]?_0x38fb15[_0x8eff('0x1b')][_0x8eff('0x1c')]===undefined?!![]:![]:!![]})[_0x8eff('0xb')](function(_0x1e9ad0){logger[_0x8eff('0x14')](_0x8eff('0x17'),_0x38fb15);logger[_0x8eff('0xd')]('CreateChatQueueReport',_0x38fb15,JSON[_0x8eff('0xf')](_0x1e9ad0));_0x20ec2a(_0x1e9ad0);})[_0x8eff('0x16')](function(_0x5a2492){logger[_0x8eff('0x10')]('CreateChatQueueReport',_0x5a2492[_0x8eff('0x12')],_0x38fb15);_0x2cd7c5(_0x3cd1dc[_0x8eff('0x10')](0x1f4,_0x5a2492[_0x8eff('0x12')]));});});};exports[_0x8eff('0x1d')]=function(_0x1ee09c){var _0x4e891c=this;return new Promise(function(_0x179814,_0x350927){return db['ChatQueueReport'][_0x8eff('0x1e')](_0x1ee09c[_0x8eff('0x1a')],{'raw':_0x1ee09c[_0x8eff('0x1b')]?_0x1ee09c[_0x8eff('0x1b')][_0x8eff('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ee09c[_0x8eff('0x1b')]?_0x1ee09c[_0x8eff('0x1b')][_0x8eff('0x1f')]||null:null,'attributes':_0x1ee09c['options']?_0x1ee09c[_0x8eff('0x1b')][_0x8eff('0x20')]||null:null,'limit':_0x1ee09c[_0x8eff('0x1b')]?_0x1ee09c[_0x8eff('0x1b')][_0x8eff('0x21')]||null:null})[_0x8eff('0xb')](function(_0x4cc146){logger['info'](_0x8eff('0x1d'),_0x1ee09c);logger[_0x8eff('0xd')](_0x8eff('0x1d'),_0x1ee09c,JSON['stringify'](_0x4cc146));_0x179814(_0x4cc146);})[_0x8eff('0x16')](function(_0x2f8ad9){logger[_0x8eff('0x10')](_0x8eff('0x1d'),_0x2f8ad9[_0x8eff('0x12')],_0x1ee09c);_0x350927(_0x4e891c[_0x8eff('0x10')](0x1f4,_0x2f8ad9[_0x8eff('0x12')]));});});};
\ No newline at end of file
+var _0x7a54=['moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','stringify','UpdateChatQueueReport','update','attributes','limit','debug','lodash','util'];(function(_0x1aba79,_0x335da1){var _0x3d2058=function(_0x3cf3a5){while(--_0x3cf3a5){_0x1aba79['push'](_0x1aba79['shift']());}};_0x3d2058(++_0x335da1);}(_0x7a54,0x106));var _0x47a5=function(_0x461efc,_0x18406e){_0x461efc=_0x461efc-0x0;var _0x28a3e9=_0x7a54[_0x461efc];return _0x28a3e9;};'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 db=require(_0x47a5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var jayson=require(_0x47a5('0x8'));var client=jayson[_0x47a5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d5629,_0x59199c,_0x343372){return new BPromise(function(_0x30e405,_0x506eda){return client[_0x47a5('0xa')](_0x3d5629,_0x343372)['then'](function(_0x5d90b3){logger['info'](_0x47a5('0xb'),_0x59199c,_0x47a5('0xc'));logger['debug'](_0x47a5('0xd'),_0x59199c,'request\x20sent',JSON['stringify'](_0x5d90b3));if(_0x5d90b3[_0x47a5('0xe')]){if(_0x5d90b3[_0x47a5('0xe')][_0x47a5('0xf')]===0x1f4){logger[_0x47a5('0xe')](_0x47a5('0xb'),_0x59199c,_0x5d90b3[_0x47a5('0xe')][_0x47a5('0x10')]);return _0x506eda(_0x5d90b3['error'][_0x47a5('0x10')]);}logger[_0x47a5('0xe')](_0x47a5('0xb'),_0x59199c,_0x5d90b3[_0x47a5('0xe')][_0x47a5('0x10')]);return _0x30e405(_0x5d90b3[_0x47a5('0xe')][_0x47a5('0x10')]);}else{logger[_0x47a5('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x59199c,_0x47a5('0xc'));_0x30e405(_0x5d90b3[_0x47a5('0x12')][_0x47a5('0x10')]);}})[_0x47a5('0x13')](function(_0x1ef44c){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x59199c,_0x1ef44c);_0x506eda(_0x1ef44c);});});}exports[_0x47a5('0x14')]=function(_0x4b966e){var _0x5247fd=this;return new Promise(function(_0x423a81,_0xaf70a6){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x4b966e[_0x47a5('0x17')],{'raw':_0x4b966e[_0x47a5('0x18')]?_0x4b966e[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})[_0x47a5('0x1a')](function(_0x4a9fcb){logger[_0x47a5('0x11')](_0x47a5('0x14'),_0x4b966e);logger['debug'](_0x47a5('0x14'),_0x4b966e,JSON[_0x47a5('0x1b')](_0x4a9fcb));_0x423a81(_0x4a9fcb);})[_0x47a5('0x13')](function(_0x4c5910){logger[_0x47a5('0xe')](_0x47a5('0x14'),_0x4c5910[_0x47a5('0x10')],_0x4b966e);_0xaf70a6(_0x5247fd[_0x47a5('0xe')](0x1f4,_0x4c5910['message']));});});};exports[_0x47a5('0x1c')]=function(_0x385687){var _0x513981=this;return new Promise(function(_0x28747d,_0xc4cd63){return db[_0x47a5('0x15')][_0x47a5('0x1d')](_0x385687[_0x47a5('0x17')],{'raw':_0x385687['options']?_0x385687['options'][_0x47a5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x385687['options']?_0x385687[_0x47a5('0x18')]['where']||null:null,'attributes':_0x385687[_0x47a5('0x18')]?_0x385687[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x385687[_0x47a5('0x18')]?_0x385687[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x1a')](function(_0x136b14){logger[_0x47a5('0x11')](_0x47a5('0x1c'),_0x385687);logger[_0x47a5('0x20')](_0x47a5('0x1c'),_0x385687,JSON[_0x47a5('0x1b')](_0x136b14));_0x28747d(_0x136b14);})['catch'](function(_0x243210){logger['error'](_0x47a5('0x1c'),_0x243210[_0x47a5('0x10')],_0x385687);_0xc4cd63(_0x513981[_0x47a5('0xe')](0x1f4,_0x243210['message']));});});};
\ No newline at end of file
index 4b66434..052bab8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x835d=['util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy','exports'];(function(_0xec26c4,_0x5a597b){var _0x394ebf=function(_0x53e8eb){while(--_0x53e8eb){_0xec26c4['push'](_0xec26c4['shift']());}};_0x394ebf(++_0x5a597b);}(_0x835d,0x132));var _0xd835=function(_0x5d148d,_0x106f75){_0x5d148d=_0x5d148d-0x0;var _0x428c77=_0x835d[_0x5d148d];return _0x428c77;};'use strict';var multer=require('multer');var util=require(_0xd835('0x0'));var path=require('path');var express=require('express');var router=express[_0xd835('0x1')]();var auth=require(_0xd835('0x2'));var interaction=require(_0xd835('0x3'));var config=require(_0xd835('0x4'));var controller=require('./chatQueueReport.controller');router[_0xd835('0x5')]('/',auth[_0xd835('0x6')](),controller['index']);router[_0xd835('0x5')](_0xd835('0x7'),auth[_0xd835('0x6')](),controller[_0xd835('0x8')]);router['get'](_0xd835('0x9'),auth[_0xd835('0x6')](),controller[_0xd835('0xa')]);router[_0xd835('0xb')]('/',auth['isAuthenticated'](),controller[_0xd835('0xc')]);router[_0xd835('0xd')](_0xd835('0x9'),auth[_0xd835('0x6')](),controller[_0xd835('0xe')]);router['delete']('/:id',auth[_0xd835('0x6')](),controller[_0xd835('0xf')]);module[_0xd835('0x10')]=router;
\ No newline at end of file
+var _0x51d0=['get','isAuthenticated','describe','/:id','create','put','update','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service'];(function(_0x9e75b1,_0x536fdd){var _0x2021cb=function(_0x2bbacc){while(--_0x2bbacc){_0x9e75b1['push'](_0x9e75b1['shift']());}};_0x2021cb(++_0x536fdd);}(_0x51d0,0x87));var _0x051d=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x51d0[_0x2aa0e7];return _0x1472c0;};'use strict';var multer=require(_0x051d('0x0'));var util=require(_0x051d('0x1'));var path=require('path');var express=require(_0x051d('0x2'));var router=express['Router']();var auth=require(_0x051d('0x3'));var interaction=require(_0x051d('0x4'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0x051d('0x5')]('/',auth[_0x051d('0x6')](),controller['index']);router[_0x051d('0x5')]('/describe',auth[_0x051d('0x6')](),controller[_0x051d('0x7')]);router[_0x051d('0x5')](_0x051d('0x8'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x051d('0x6')](),controller[_0x051d('0x9')]);router[_0x051d('0xa')](_0x051d('0x8'),auth[_0x051d('0x6')](),controller[_0x051d('0xb')]);router['delete'](_0x051d('0x8'),auth[_0x051d('0x6')](),controller[_0x051d('0xc')]);module[_0x051d('0xd')]=router;
\ No newline at end of file
index adc019d..09e0fb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1795=['queue','DATE','moment','exports','STRING','account','agent'];(function(_0x6ada5d,_0x53dafc){var _0x2f5d85=function(_0x26b4ea){while(--_0x26b4ea){_0x6ada5d['push'](_0x6ada5d['shift']());}};_0x2f5d85(++_0x53dafc);}(_0x1795,0xcd));var _0x5179=function(_0x3bbff8,_0x797805){_0x3bbff8=_0x3bbff8-0x0;var _0xc89be8=_0x1795[_0x3bbff8];return _0xc89be8;};'use strict';var moment=require(_0x5179('0x0'));var Sequelize=require('sequelize');module[_0x5179('0x1')]={'uniqueid':{'type':Sequelize[_0x5179('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x5179('0x3'),_0x5179('0x4'),_0x5179('0x5')),'allowNull':![],'defaultValue':_0x5179('0x5')},'transferredAt':{'type':Sequelize[_0x5179('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x5bad=['moment','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x1ae301,_0xb4fa22){var _0x3d3889=function(_0x585a4e){while(--_0x585a4e){_0x1ae301['push'](_0x1ae301['shift']());}};_0x3d3889(++_0xb4fa22);}(_0x5bad,0x165));var _0xd5ba=function(_0x59bb05,_0x51d2bd){_0x59bb05=_0x59bb05-0x0;var _0x3c23c3=_0x5bad[_0x59bb05];return _0x3c23c3;};'use strict';var moment=require(_0xd5ba('0x0'));var Sequelize=require('sequelize');module[_0xd5ba('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xd5ba('0x2')]('account',_0xd5ba('0x3'),_0xd5ba('0x4')),'allowNull':![],'defaultValue':_0xd5ba('0x4')},'transferredAt':{'type':Sequelize[_0xd5ba('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xd5ba('0x6')]}};
\ No newline at end of file
index 1ff66dd..8d2046e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b84=['status','end','json','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','ChatTransferReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','dateStart','dateEnd','add','day','merge','map','filter','options','includeAll','include','findAll','catch','show','params','length','find','create','body','describe','html-pdf','eml-format','fast-json-patch','bluebird','mustache','util','ejs','squel','jsforce','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x21870c,_0xffff7c){var _0x1e855f=function(_0x545077){while(--_0x545077){_0x21870c['push'](_0x21870c['shift']());}};_0x1e855f(++_0xffff7c);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x4b84[_0x2df507];return _0x1f7167;};'use strict';var pdf=require(_0x44b8('0x0'));var emlformat=require(_0x44b8('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x44b8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x44b8('0x3'));var Mustache=require(_0x44b8('0x4'));var util=require(_0x44b8('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x44b8('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var qs=require(_0x44b8('0xb'));var logger=require('../../config/logger')(_0x44b8('0xc'));var utils=require(_0x44b8('0xd'));var config=require(_0x44b8('0xe'));var db=require(_0x44b8('0xf'))['db'];function respondWithStatusCode(_0x24dd10,_0x37e471){_0x37e471=_0x37e471||0xcc;return function(_0xe9a025){if(_0xe9a025){return _0x24dd10['sendStatus'](_0x37e471);}return _0x24dd10[_0x44b8('0x10')](_0x37e471)[_0x44b8('0x11')]();};}function respondWithResult(_0x4bcc43,_0x194230){_0x194230=_0x194230||0xc8;return function(_0x490bc6){if(_0x490bc6){return _0x4bcc43[_0x44b8('0x10')](_0x194230)[_0x44b8('0x12')](_0x490bc6);}};}function respondWithFilteredResult(_0x4df670,_0x63e8f6){return function(_0x4be54c){if(_0x4be54c){var _0x54fa95=_0x4be54c[_0x44b8('0x13')],_0x2a3e4c=_0x63e8f6['offset'],_0x2af0ad=_0x63e8f6['offset']+_0x63e8f6['limit'],_0x1722da;if(_0x2af0ad>=_0x54fa95){_0x2af0ad=_0x54fa95;_0x1722da=0xc8;}else{_0x1722da=0xce;}_0x4df670[_0x44b8('0x10')](_0x1722da);return _0x4df670['set'](_0x44b8('0x14'),_0x2a3e4c+'-'+_0x2af0ad+'/'+_0x54fa95)[_0x44b8('0x12')](_0x4be54c);}return null;};}function patchUpdates(_0x55e258){return function(_0x36743e){try{jsonpatch[_0x44b8('0x15')](_0x36743e,_0x55e258,!![]);}catch(_0x5103f5){return BPromise[_0x44b8('0x16')](_0x5103f5);}return _0x36743e[_0x44b8('0x17')]();};}function saveUpdates(_0x4b600f,_0xcce202){return function(_0x8b4301){if(_0x8b4301){return _0x8b4301[_0x44b8('0x18')](_0x4b600f)[_0x44b8('0x19')](function(_0x102ef9){return _0x102ef9;});}return null;};}function removeEntity(_0x369c09,_0x452f2f){return function(_0x9b0536){if(_0x9b0536){return _0x9b0536[_0x44b8('0x1a')]()[_0x44b8('0x19')](function(){_0x369c09[_0x44b8('0x10')](0xcc)[_0x44b8('0x11')]();});}};}function handleEntityNotFound(_0x48327e,_0x56549a){return function(_0x3a8aa4){if(!_0x3a8aa4){_0x48327e[_0x44b8('0x1b')](0x194);}return _0x3a8aa4;};}function handleError(_0x1418db,_0x305a5c){_0x305a5c=_0x305a5c||0x1f4;return function(_0x51a34a){logger[_0x44b8('0x1c')](_0x51a34a['stack']);if(_0x51a34a[_0x44b8('0x1d')]){delete _0x51a34a[_0x44b8('0x1d')];}_0x1418db[_0x44b8('0x10')](_0x305a5c)[_0x44b8('0x1e')](_0x51a34a);};}exports[_0x44b8('0x1f')]=function(_0x59acbc,_0x474f01){var _0x502acf={},_0x41d673={},_0x350482={'count':0x0,'rows':[]};var _0x549a26=db[_0x44b8('0x20')][_0x44b8('0x21')];_0x41d673[_0x44b8('0x22')]=_['keys'](_0x549a26);var _0xb22107={'dateStart':_0x59acbc[_0x44b8('0x23')]['dateStart'],'dateEnd':_0x59acbc[_0x44b8('0x23')]['dateEnd']};delete _0x59acbc[_0x44b8('0x23')]['dateStart'];delete _0x59acbc['query']['dateEnd'];_0x41d673[_0x44b8('0x23')]=_[_0x44b8('0x24')](_0x59acbc[_0x44b8('0x23')]);_0x41d673[_0x44b8('0x25')]=_[_0x44b8('0x26')](_0x41d673[_0x44b8('0x22')],_0x41d673[_0x44b8('0x23')]);_0x502acf[_0x44b8('0x27')]=_[_0x44b8('0x26')](_0x41d673[_0x44b8('0x22')],qs[_0x44b8('0x28')](_0x59acbc[_0x44b8('0x23')][_0x44b8('0x28')]));_0x502acf['attributes']=_0x502acf[_0x44b8('0x27')]['length']?_0x502acf[_0x44b8('0x27')]:_0x41d673[_0x44b8('0x22')];if(!_0x59acbc[_0x44b8('0x23')][_0x44b8('0x29')](_0x44b8('0x2a'))){_0x502acf['limit']=qs[_0x44b8('0x2b')](_0x59acbc[_0x44b8('0x23')][_0x44b8('0x2b')]);_0x502acf[_0x44b8('0x2c')]=qs[_0x44b8('0x2c')](_0x59acbc['query'][_0x44b8('0x2c')]);}_0x502acf[_0x44b8('0x2d')]=qs[_0x44b8('0x2e')](_0x59acbc[_0x44b8('0x23')][_0x44b8('0x2e')]);_0x502acf[_0x44b8('0x2f')]=qs[_0x44b8('0x25')](_[_0x44b8('0x30')](_0x59acbc[_0x44b8('0x23')],_0x41d673[_0x44b8('0x25')]));if(_0xb22107[_0x44b8('0x31')]){if(_0xb22107[_0x44b8('0x32')]){_0xb22107[_0x44b8('0x32')]=moment(_0xb22107[_0x44b8('0x32')])[_0x44b8('0x33')](0x1,_0x44b8('0x34'));}else{_0xb22107[_0x44b8('0x32')]=moment(_0xb22107[_0x44b8('0x31')])[_0x44b8('0x33')](0x1,_0x44b8('0x34'));}_[_0x44b8('0x35')](_0x502acf[_0x44b8('0x2f')],{'createdAt':{'$gte':_0xb22107['dateStart'],'$lte':_0xb22107[_0x44b8('0x32')]}});}if(_0x59acbc[_0x44b8('0x23')]['filter']){_0x502acf[_0x44b8('0x2f')]=_[_0x44b8('0x35')](_0x502acf[_0x44b8('0x2f')],{'$or':_[_0x44b8('0x36')](_0x502acf['attributes'],function(_0x221543){var _0x11e4e3={};_0x11e4e3[_0x221543]={'$like':'%'+_0x59acbc[_0x44b8('0x23')][_0x44b8('0x37')]+'%'};return _0x11e4e3;})});}_0x502acf=_[_0x44b8('0x35')]({},_0x502acf,_0x59acbc[_0x44b8('0x38')]);var _0x46aadd={'where':_0x502acf[_0x44b8('0x2f')]};return db[_0x44b8('0x20')][_0x44b8('0x13')](_0x46aadd)[_0x44b8('0x19')](function(_0x395366){_0x350482[_0x44b8('0x13')]=_0x395366;if(_0x59acbc[_0x44b8('0x23')][_0x44b8('0x39')]){_0x502acf[_0x44b8('0x3a')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x44b8('0x3b')](_0x502acf);})[_0x44b8('0x19')](function(_0xbf444f){_0x350482['rows']=_0xbf444f;return _0x350482;})[_0x44b8('0x19')](respondWithFilteredResult(_0x474f01,_0x502acf))[_0x44b8('0x3c')](handleError(_0x474f01,null));};exports[_0x44b8('0x3d')]=function(_0x585a16,_0xbad4bb){var _0xaad841={'raw':!![],'where':{'id':_0x585a16[_0x44b8('0x3e')]['id']}},_0x149d55={};_0x149d55[_0x44b8('0x22')]=_['keys'](db['ChatTransferReport'][_0x44b8('0x21')]);_0x149d55[_0x44b8('0x23')]=_[_0x44b8('0x24')](_0x585a16[_0x44b8('0x23')]);_0x149d55[_0x44b8('0x25')]=_[_0x44b8('0x26')](_0x149d55[_0x44b8('0x22')],_0x149d55[_0x44b8('0x23')]);_0xaad841[_0x44b8('0x27')]=_[_0x44b8('0x26')](_0x149d55[_0x44b8('0x22')],qs[_0x44b8('0x28')](_0x585a16[_0x44b8('0x23')][_0x44b8('0x28')]));_0xaad841[_0x44b8('0x27')]=_0xaad841[_0x44b8('0x27')][_0x44b8('0x3f')]?_0xaad841[_0x44b8('0x27')]:_0x149d55[_0x44b8('0x22')];if(_0x585a16['query']['includeAll']){_0xaad841[_0x44b8('0x3a')]=[{'all':!![]}];}_0xaad841=_[_0x44b8('0x35')]({},_0xaad841,_0x585a16[_0x44b8('0x38')]);return db[_0x44b8('0x20')][_0x44b8('0x40')](_0xaad841)[_0x44b8('0x19')](handleEntityNotFound(_0xbad4bb,null))[_0x44b8('0x19')](respondWithResult(_0xbad4bb,null))['catch'](handleError(_0xbad4bb,null));};exports[_0x44b8('0x41')]=function(_0x53edca,_0xebaa39){return db[_0x44b8('0x20')][_0x44b8('0x41')](_0x53edca[_0x44b8('0x42')],{})[_0x44b8('0x19')](respondWithResult(_0xebaa39,0xc9))[_0x44b8('0x3c')](handleError(_0xebaa39,null));};exports['update']=function(_0x2c3b5b,_0xff92fb){if(_0x2c3b5b[_0x44b8('0x42')]['id']){delete _0x2c3b5b[_0x44b8('0x42')]['id'];}return db['ChatTransferReport'][_0x44b8('0x40')]({'where':{'id':_0x2c3b5b[_0x44b8('0x3e')]['id']}})[_0x44b8('0x19')](handleEntityNotFound(_0xff92fb,null))[_0x44b8('0x19')](saveUpdates(_0x2c3b5b[_0x44b8('0x42')],null))[_0x44b8('0x19')](respondWithResult(_0xff92fb,null))['catch'](handleError(_0xff92fb,null));};exports[_0x44b8('0x1a')]=function(_0x450715,_0x2c5c27){return db[_0x44b8('0x20')][_0x44b8('0x40')]({'where':{'id':_0x450715['params']['id']}})['then'](handleEntityNotFound(_0x2c5c27,null))[_0x44b8('0x19')](removeEntity(_0x2c5c27,null))['catch'](handleError(_0x2c5c27,null));};exports[_0x44b8('0x43')]=function(_0x5785ef,_0x40164d){return db[_0x44b8('0x20')][_0x44b8('0x43')]()[_0x44b8('0x19')](respondWithResult(_0x40164d,null))[_0x44b8('0x3c')](handleError(_0x40164d,null));};
\ No newline at end of file
+var _0xb90d=['where','pick','day','merge','map','filter','options','include','then','rows','catch','show','create','body','update','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','limit','set','json','apply','reject','save','destroy','error','stack','name','send','index','ChatTransferReport','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xb90d,0x17a));var _0xdb90=function(_0x3438cf,_0x73b174){_0x3438cf=_0x3438cf-0x0;var _0x278698=_0xb90d[_0x3438cf];return _0x278698;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdb90('0x0'));var rimraf=require(_0xdb90('0x1'));var zipdir=require(_0xdb90('0x2'));var jsonpatch=require(_0xdb90('0x3'));var rp=require(_0xdb90('0x4'));var moment=require(_0xdb90('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdb90('0x6'));var util=require(_0xdb90('0x7'));var path=require(_0xdb90('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdb90('0x9'));var fs=require('fs');var _=require(_0xdb90('0xa'));var squel=require(_0xdb90('0xb'));var crypto=require(_0xdb90('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdb90('0xd'));var toCsv=require(_0xdb90('0xe'));var querystring=require(_0xdb90('0xf'));var Papa=require('papaparse');var qs=require(_0xdb90('0x10'));var logger=require(_0xdb90('0x11'))(_0xdb90('0x12'));var utils=require(_0xdb90('0x13'));var config=require(_0xdb90('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x597572,_0x52f937){_0x52f937=_0x52f937||0xcc;return function(_0x2a9d93){if(_0x2a9d93){return _0x597572[_0xdb90('0x15')](_0x52f937);}return _0x597572[_0xdb90('0x16')](_0x52f937)[_0xdb90('0x17')]();};}function respondWithResult(_0xdc179e,_0x113659){_0x113659=_0x113659||0xc8;return function(_0x5655d2){if(_0x5655d2){return _0xdc179e['status'](_0x113659)['json'](_0x5655d2);}};}function respondWithFilteredResult(_0x511592,_0x569d40){return function(_0x5eb6ef){if(_0x5eb6ef){var _0xe9e793=_0x5eb6ef[_0xdb90('0x18')],_0x118101=_0x569d40['offset'],_0x5b93b1=_0x569d40['offset']+_0x569d40[_0xdb90('0x19')],_0x19b02e;if(_0x5b93b1>=_0xe9e793){_0x5b93b1=_0xe9e793;_0x19b02e=0xc8;}else{_0x19b02e=0xce;}_0x511592[_0xdb90('0x16')](_0x19b02e);return _0x511592[_0xdb90('0x1a')]('Content-Range',_0x118101+'-'+_0x5b93b1+'/'+_0xe9e793)[_0xdb90('0x1b')](_0x5eb6ef);}return null;};}function patchUpdates(_0x13f6df){return function(_0xd50abd){try{jsonpatch[_0xdb90('0x1c')](_0xd50abd,_0x13f6df,!![]);}catch(_0x1673a3){return BPromise[_0xdb90('0x1d')](_0x1673a3);}return _0xd50abd[_0xdb90('0x1e')]();};}function saveUpdates(_0x1838ed,_0x19e1bf){return function(_0x3a2e6f){if(_0x3a2e6f){return _0x3a2e6f['update'](_0x1838ed)['then'](function(_0x4110c7){return _0x4110c7;});}return null;};}function removeEntity(_0x1c2dbe,_0xe8589a){return function(_0x13f84d){if(_0x13f84d){return _0x13f84d[_0xdb90('0x1f')]()['then'](function(){_0x1c2dbe[_0xdb90('0x16')](0xcc)[_0xdb90('0x17')]();});}};}function handleEntityNotFound(_0x590e6a,_0x14a73e){return function(_0x5aecb7){if(!_0x5aecb7){_0x590e6a[_0xdb90('0x15')](0x194);}return _0x5aecb7;};}function handleError(_0x2fdb1b,_0x1fe5ab){_0x1fe5ab=_0x1fe5ab||0x1f4;return function(_0x463199){logger[_0xdb90('0x20')](_0x463199[_0xdb90('0x21')]);if(_0x463199[_0xdb90('0x22')]){delete _0x463199[_0xdb90('0x22')];}_0x2fdb1b[_0xdb90('0x16')](_0x1fe5ab)[_0xdb90('0x23')](_0x463199);};}exports[_0xdb90('0x24')]=function(_0x5d3b63,_0x1a27c3){var _0xedb1a6={},_0x3fcafd={},_0x54f2aa={'count':0x0,'rows':[]};var _0x536eae=db[_0xdb90('0x25')][_0xdb90('0x26')];_0x3fcafd[_0xdb90('0x27')]=_[_0xdb90('0x28')](_0x536eae);var _0x19fd32={'dateStart':_0x5d3b63[_0xdb90('0x29')][_0xdb90('0x2a')],'dateEnd':_0x5d3b63[_0xdb90('0x29')]['dateEnd']};delete _0x5d3b63[_0xdb90('0x29')][_0xdb90('0x2a')];delete _0x5d3b63[_0xdb90('0x29')][_0xdb90('0x2b')];_0x3fcafd[_0xdb90('0x29')]=_[_0xdb90('0x28')](_0x5d3b63[_0xdb90('0x29')]);_0x3fcafd[_0xdb90('0x2c')]=_[_0xdb90('0x2d')](_0x3fcafd[_0xdb90('0x27')],_0x3fcafd[_0xdb90('0x29')]);_0xedb1a6[_0xdb90('0x2e')]=_[_0xdb90('0x2d')](_0x3fcafd[_0xdb90('0x27')],qs['fields'](_0x5d3b63[_0xdb90('0x29')][_0xdb90('0x2f')]));_0xedb1a6[_0xdb90('0x2e')]=_0xedb1a6[_0xdb90('0x2e')][_0xdb90('0x30')]?_0xedb1a6[_0xdb90('0x2e')]:_0x3fcafd[_0xdb90('0x27')];if(!_0x5d3b63[_0xdb90('0x29')][_0xdb90('0x31')](_0xdb90('0x32'))){_0xedb1a6['limit']=qs[_0xdb90('0x19')](_0x5d3b63[_0xdb90('0x29')]['limit']);_0xedb1a6[_0xdb90('0x33')]=qs[_0xdb90('0x33')](_0x5d3b63[_0xdb90('0x29')][_0xdb90('0x33')]);}_0xedb1a6[_0xdb90('0x34')]=qs['sort'](_0x5d3b63[_0xdb90('0x29')][_0xdb90('0x35')]);_0xedb1a6[_0xdb90('0x36')]=qs['filters'](_[_0xdb90('0x37')](_0x5d3b63[_0xdb90('0x29')],_0x3fcafd['filters']));if(_0x19fd32[_0xdb90('0x2a')]){if(_0x19fd32[_0xdb90('0x2b')]){_0x19fd32[_0xdb90('0x2b')]=moment(_0x19fd32[_0xdb90('0x2b')])['add'](0x1,_0xdb90('0x38'));}else{_0x19fd32[_0xdb90('0x2b')]=moment(_0x19fd32['dateStart'])['add'](0x1,_0xdb90('0x38'));}_[_0xdb90('0x39')](_0xedb1a6[_0xdb90('0x36')],{'createdAt':{'$gte':_0x19fd32[_0xdb90('0x2a')],'$lte':_0x19fd32['dateEnd']}});}if(_0x5d3b63[_0xdb90('0x29')]['filter']){_0xedb1a6['where']=_['merge'](_0xedb1a6[_0xdb90('0x36')],{'$or':_[_0xdb90('0x3a')](_0xedb1a6[_0xdb90('0x2e')],function(_0xc5a0e1){var _0x717876={};_0x717876[_0xc5a0e1]={'$like':'%'+_0x5d3b63['query'][_0xdb90('0x3b')]+'%'};return _0x717876;})});}_0xedb1a6=_['merge']({},_0xedb1a6,_0x5d3b63[_0xdb90('0x3c')]);var _0x3c3f4={'where':_0xedb1a6['where']};return db['ChatTransferReport'][_0xdb90('0x18')](_0x3c3f4)['then'](function(_0x38f681){_0x54f2aa[_0xdb90('0x18')]=_0x38f681;if(_0x5d3b63[_0xdb90('0x29')]['includeAll']){_0xedb1a6[_0xdb90('0x3d')]=[{'all':!![]}];}return db[_0xdb90('0x25')]['findAll'](_0xedb1a6);})[_0xdb90('0x3e')](function(_0x3f8a0f){_0x54f2aa[_0xdb90('0x3f')]=_0x3f8a0f;return _0x54f2aa;})[_0xdb90('0x3e')](respondWithFilteredResult(_0x1a27c3,_0xedb1a6))[_0xdb90('0x40')](handleError(_0x1a27c3,null));};exports[_0xdb90('0x41')]=function(_0x1e13fd,_0x292998){var _0x531bb3={'raw':!![],'where':{'id':_0x1e13fd['params']['id']}},_0x3b12e7={};_0x3b12e7['model']=_['keys'](db[_0xdb90('0x25')]['rawAttributes']);_0x3b12e7['query']=_[_0xdb90('0x28')](_0x1e13fd[_0xdb90('0x29')]);_0x3b12e7[_0xdb90('0x2c')]=_[_0xdb90('0x2d')](_0x3b12e7['model'],_0x3b12e7[_0xdb90('0x29')]);_0x531bb3[_0xdb90('0x2e')]=_[_0xdb90('0x2d')](_0x3b12e7[_0xdb90('0x27')],qs[_0xdb90('0x2f')](_0x1e13fd[_0xdb90('0x29')][_0xdb90('0x2f')]));_0x531bb3[_0xdb90('0x2e')]=_0x531bb3[_0xdb90('0x2e')][_0xdb90('0x30')]?_0x531bb3[_0xdb90('0x2e')]:_0x3b12e7[_0xdb90('0x27')];if(_0x1e13fd[_0xdb90('0x29')]['includeAll']){_0x531bb3['include']=[{'all':!![]}];}_0x531bb3=_['merge']({},_0x531bb3,_0x1e13fd['options']);return db[_0xdb90('0x25')]['find'](_0x531bb3)['then'](handleEntityNotFound(_0x292998,null))['then'](respondWithResult(_0x292998,null))[_0xdb90('0x40')](handleError(_0x292998,null));};exports['create']=function(_0x399068,_0x15717b){return db[_0xdb90('0x25')][_0xdb90('0x42')](_0x399068[_0xdb90('0x43')],{})[_0xdb90('0x3e')](respondWithResult(_0x15717b,0xc9))[_0xdb90('0x40')](handleError(_0x15717b,null));};exports[_0xdb90('0x44')]=function(_0x492136,_0x443d92){if(_0x492136[_0xdb90('0x43')]['id']){delete _0x492136['body']['id'];}return db['ChatTransferReport'][_0xdb90('0x45')]({'where':{'id':_0x492136[_0xdb90('0x46')]['id']}})[_0xdb90('0x3e')](handleEntityNotFound(_0x443d92,null))['then'](saveUpdates(_0x492136[_0xdb90('0x43')],null))[_0xdb90('0x3e')](respondWithResult(_0x443d92,null))[_0xdb90('0x40')](handleError(_0x443d92,null));};exports[_0xdb90('0x1f')]=function(_0x17f167,_0x1e7c28){return db[_0xdb90('0x25')][_0xdb90('0x45')]({'where':{'id':_0x17f167[_0xdb90('0x46')]['id']}})[_0xdb90('0x3e')](handleEntityNotFound(_0x1e7c28,null))[_0xdb90('0x3e')](removeEntity(_0x1e7c28,null))[_0xdb90('0x40')](handleError(_0x1e7c28,null));};exports['describe']=function(_0x58dcff,_0x5c0f70){return db[_0xdb90('0x25')][_0xdb90('0x47')]()['then'](respondWithResult(_0x5c0f70,null))['catch'](handleError(_0x5c0f70,null));};
\ No newline at end of file
index 876335d..65b5592 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdba=['uniqueid','lodash','util','api','request-promise','./chatTransferReport.attributes','exports','define','report_chat_transfer'];(function(_0x2fcadf,_0x401da6){var _0x2a2c05=function(_0x54d612){while(--_0x54d612){_0x2fcadf['push'](_0x2fcadf['shift']());}};_0x2a2c05(++_0x401da6);}(_0xbdba,0xd9));var _0xabdb=function(_0x13a909,_0x4bad57){_0x13a909=_0x13a909-0x0;var _0x582a1c=_0xbdba[_0x13a909];return _0x582a1c;};'use strict';var _=require(_0xabdb('0x0'));var util=require(_0xabdb('0x1'));var logger=require('../../config/logger')(_0xabdb('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xabdb('0x3'));var attributes=require(_0xabdb('0x4'));module[_0xabdb('0x5')]=function(_0x599c72,_0x2176cb){return _0x599c72[_0xabdb('0x6')]('ChatTransferReport',attributes,{'tableName':_0xabdb('0x7'),'paranoid':![],'indexes':[{'name':_0xabdb('0x8'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x298c=['report_chat_transfer','uniqueid','api','moment','bluebird','exports','define','ChatTransferReport'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x298c,0x112));var _0xc298=function(_0x279b83,_0xf0d8a8){_0x279b83=_0x279b83-0x0;var _0x192ea7=_0x298c[_0x279b83];return _0x192ea7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc298('0x0'));var moment=require(_0xc298('0x1'));var BPromise=require(_0xc298('0x2'));var rp=require('request-promise');var attributes=require('./chatTransferReport.attributes');module[_0xc298('0x3')]=function(_0x55ca5a,_0x280691){return _0x55ca5a[_0xc298('0x4')](_0xc298('0x5'),attributes,{'tableName':_0xc298('0x6'),'paranoid':![],'indexes':[{'name':_0xc298('0x7'),'fields':[_0xc298('0x7')]}],'timestamps':!![]});};
\ No newline at end of file
index 0798e1f..8eec876 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec22=['result','lodash','util','moment','randomstring','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x23840e,_0x2fb0cb){var _0x277300=function(_0x246e5a){while(--_0x246e5a){_0x23840e['push'](_0x23840e['shift']());}};_0x277300(++_0x2fb0cb);}(_0xec22,0x144));var _0x2ec2=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xec22[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x2ec2('0x0'));var util=require(_0x2ec2('0x1'));var moment=require(_0x2ec2('0x2'));var BPromise=require('bluebird');var rs=require(_0x2ec2('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2ec2('0x4'));var config=require(_0x2ec2('0x5'));var jayson=require(_0x2ec2('0x6'));var client=jayson[_0x2ec2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d9efe,_0x29f67e,_0x4fe690){return new BPromise(function(_0x132e6a,_0x53a0b1){return client[_0x2ec2('0x8')](_0x5d9efe,_0x4fe690)[_0x2ec2('0x9')](function(_0x4672c2){logger[_0x2ec2('0xa')](_0x2ec2('0xb'),_0x29f67e,_0x2ec2('0xc'));logger[_0x2ec2('0xd')](_0x2ec2('0xe'),_0x29f67e,_0x2ec2('0xc'),JSON['stringify'](_0x4672c2));if(_0x4672c2['error']){if(_0x4672c2[_0x2ec2('0xf')][_0x2ec2('0x10')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x29f67e,_0x4672c2[_0x2ec2('0xf')][_0x2ec2('0x11')]);return _0x53a0b1(_0x4672c2[_0x2ec2('0xf')][_0x2ec2('0x11')]);}logger[_0x2ec2('0xf')](_0x2ec2('0xb'),_0x29f67e,_0x4672c2[_0x2ec2('0xf')][_0x2ec2('0x11')]);return _0x132e6a(_0x4672c2['error'][_0x2ec2('0x11')]);}else{logger[_0x2ec2('0xa')](_0x2ec2('0xb'),_0x29f67e,'request\x20sent');_0x132e6a(_0x4672c2[_0x2ec2('0x12')][_0x2ec2('0x11')]);}})['catch'](function(_0x1f288d){logger[_0x2ec2('0xf')](_0x2ec2('0xb'),_0x29f67e,_0x1f288d);_0x53a0b1(_0x1f288d);});});}
\ No newline at end of file
+var _0xd07c=['result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x5a5f29,_0x6fb00c){var _0x485570=function(_0x4d9a8c){while(--_0x4d9a8c){_0x5a5f29['push'](_0x5a5f29['shift']());}};_0x485570(++_0x6fb00c);}(_0xd07c,0x17e));var _0xcd07=function(_0x2b8454,_0x49dbb4){_0x2b8454=_0x2b8454-0x0;var _0x4a57fa=_0xd07c[_0x2b8454];return _0x4a57fa;};'use strict';var _=require(_0xcd07('0x0'));var util=require('util');var moment=require(_0xcd07('0x1'));var BPromise=require(_0xcd07('0x2'));var rs=require('randomstring');var fs=require('fs');var db=require(_0xcd07('0x3'))['db'];var utils=require(_0xcd07('0x4'));var logger=require(_0xcd07('0x5'))(_0xcd07('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcd07('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9dd9ff,_0x5363a7,_0x3049c0){return new BPromise(function(_0x53f804,_0x560c74){return client[_0xcd07('0x8')](_0x9dd9ff,_0x3049c0)[_0xcd07('0x9')](function(_0x48859f){logger[_0xcd07('0xa')](_0xcd07('0xb'),_0x5363a7,_0xcd07('0xc'));logger[_0xcd07('0xd')](_0xcd07('0xe'),_0x5363a7,_0xcd07('0xc'),JSON[_0xcd07('0xf')](_0x48859f));if(_0x48859f['error']){if(_0x48859f[_0xcd07('0x10')]['code']===0x1f4){logger['error'](_0xcd07('0xb'),_0x5363a7,_0x48859f[_0xcd07('0x10')][_0xcd07('0x11')]);return _0x560c74(_0x48859f[_0xcd07('0x10')][_0xcd07('0x11')]);}logger[_0xcd07('0x10')](_0xcd07('0xb'),_0x5363a7,_0x48859f['error']['message']);return _0x53f804(_0x48859f[_0xcd07('0x10')][_0xcd07('0x11')]);}else{logger[_0xcd07('0xa')](_0xcd07('0xb'),_0x5363a7,'request\x20sent');_0x53f804(_0x48859f[_0xcd07('0x12')][_0xcd07('0x11')]);}})[_0xcd07('0x13')](function(_0x882a0a){logger[_0xcd07('0x10')](_0xcd07('0xb'),_0x5363a7,_0x882a0a);_0x560c74(_0x882a0a);});});}
\ No newline at end of file
index b608d43..aabbdf1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','delete','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x281c44,_0x367e13){var _0x44b209=function(_0x255bca){while(--_0x255bca){_0x281c44['push'](_0x281c44['shift']());}};_0x44b209(++_0x367e13);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var express=require(_0x0baf('0x2'));var router=express[_0x0baf('0x3')]();var auth=require(_0x0baf('0x4'));var interaction=require(_0x0baf('0x5'));var config=require('../../config/environment');var controller=require(_0x0baf('0x6'));router[_0x0baf('0x7')]('/',auth[_0x0baf('0x8')](),controller[_0x0baf('0x9')]);router[_0x0baf('0x7')](_0x0baf('0xa'),auth[_0x0baf('0x8')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x7')]('/:id',auth[_0x0baf('0x8')](),controller['show']);router[_0x0baf('0xc')]('/',auth[_0x0baf('0x8')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')](_0x0baf('0xf'),auth[_0x0baf('0x8')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xf'),auth[_0x0baf('0x8')](),controller[_0x0baf('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x4fc2=['show','post','create','put','update','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id'];(function(_0x2dbcef,_0x1cfecb){var _0x5a90ea=function(_0x189054){while(--_0x189054){_0x2dbcef['push'](_0x2dbcef['shift']());}};_0x5a90ea(++_0x1cfecb);}(_0x4fc2,0x111));var _0x24fc=function(_0x45967a,_0x474c44){_0x45967a=_0x45967a-0x0;var _0xf97e90=_0x4fc2[_0x45967a];return _0xf97e90;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var express=require(_0x24fc('0x3'));var router=express['Router']();var auth=require(_0x24fc('0x4'));var interaction=require(_0x24fc('0x5'));var config=require(_0x24fc('0x6'));var controller=require('./chatTransferReport.controller');router[_0x24fc('0x7')]('/',auth[_0x24fc('0x8')](),controller['index']);router[_0x24fc('0x7')](_0x24fc('0x9'),auth['isAuthenticated'](),controller[_0x24fc('0xa')]);router[_0x24fc('0x7')](_0x24fc('0xb'),auth[_0x24fc('0x8')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth['isAuthenticated'](),controller[_0x24fc('0xe')]);router[_0x24fc('0xf')](_0x24fc('0xb'),auth[_0x24fc('0x8')](),controller[_0x24fc('0x10')]);router[_0x24fc('0x11')](_0x24fc('0xb'),auth[_0x24fc('0x8')](),controller['destroy']);module[_0x24fc('0x12')]=router;
\ No newline at end of file
index 9b7e79f..cb32899 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40af=['getDataValue','onlineForm','parse','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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','website_alias','alternate','#fafafa','randomstring','exports','STRING','address','email','Agent','#9f946a','INTEGER','BOOLEAN','ENUM','squared','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','star','stringify','input','name','text'];(function(_0x4d9670,_0xeb99b){var _0x23aa16=function(_0x242334){while(--_0x242334){_0x4d9670['push'](_0x4d9670['shift']());}};_0x23aa16(++_0xeb99b);}(_0x40af,0x8d));var _0xf40a=function(_0xfeabb7,_0x1ffba2){_0xfeabb7=_0xfeabb7-0x0;var _0x409695=_0x40af[_0xfeabb7];return _0x409695;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xf40a('0x0'));module[_0xf40a('0x1')]={'name':{'type':Sequelize[_0xf40a('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xf40a('0x2')],'allowNull':![],'unique':_0xf40a('0x3')},'description':{'type':Sequelize[_0xf40a('0x2')]},'mapKey':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':_0xf40a('0x4')},'mapKeyOffline':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':_0xf40a('0x4')},'key':{'type':Sequelize[_0xf40a('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xf40a('0x5')},'customerAlias':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf40a('0x2')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf40a('0x2')],'allowNull':![],'defaultValue':_0xf40a('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf40a('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf40a('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf40a('0x2')]},'animation':{'type':Sequelize[_0xf40a('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xf40a('0x9')]('rounded',_0xf40a('0xa')),'defaultValue':_0xf40a('0xb')},'header_online':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':_0xf40a('0xc')},'offline_chat_button':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':_0xf40a('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xf40a('0xe')},'download_transcript':{'type':Sequelize[_0xf40a('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':_0xf40a('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xf40a('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf40a('0x10')]},'closingQuestion':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':_0xf40a('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':_0xf40a('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf40a('0x13')},'placeholderMessage':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':_0xf40a('0x14')},'closingMessage':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':_0xf40a('0xd')},'skipMessageButton':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':_0xf40a('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf40a('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf40a('0x8')],'defaultValue':![]},'ratingType':{'type':Sequelize[_0xf40a('0x9')](_0xf40a('0x16'),'thumb'),'defaultValue':_0xf40a('0x16')},'ratingStarsNumber':{'type':Sequelize[_0xf40a('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xf40a('0x17')]({'items':[{'type':_0xf40a('0x18'),'variable':null,'config':{'placeholder':_0xf40a('0x19'),'type':_0xf40a('0x1a'),'required':!![]},'props':{'title':_0xf40a('0x19'),'helpText':''}},{'type':'input','props':{'title':_0xf40a('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xf40a('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf40a('0x1b')](_0xf40a('0x1c'))?JSON[_0xf40a('0x1d')](this[_0xf40a('0x1b')](_0xf40a('0x1c'))):{};},'set':function(_0x401c87){return this[_0xf40a('0x1e')]('onlineForm',JSON[_0xf40a('0x17')](_0x401c87));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0xf40a('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xf40a('0x4'),'type':'email'},'variable':null},{'type':_0xf40a('0x1f'),'config':{'placeholder':_0xf40a('0x20')},'props':{'title':_0xf40a('0x20'),'helpText':_0xf40a('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xf40a('0x1b')](_0xf40a('0x22'))?JSON[_0xf40a('0x1d')](this[_0xf40a('0x1b')](_0xf40a('0x22'))):{};},'set':function(_0x531f33){return this[_0xf40a('0x1e')](_0xf40a('0x22'),JSON[_0xf40a('0x17')](_0x531f33));}},'token':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':function(){return rs[_0xf40a('0x23')]();}},'autoclose':{'type':Sequelize[_0xf40a('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf40a('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf40a('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xf40a('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf40a('0x2')]},'waitingTitle':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':_0xf40a('0x24')},'waitingMessage':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':_0xf40a('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':_0xf40a('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xf40a('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':_0xf40a('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xf40a('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf40a('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf40a('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf40a('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xf40a('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xf40a('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0xf40a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':_0xf40a('0x28')},'defaultTitle':{'type':Sequelize[_0xf40a('0x2')]},'customerAvatar':{'type':Sequelize[_0xf40a('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0xf40a('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xf40a('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf40a('0x2')],'allowNull':![],'defaultValue':_0xf40a('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf40a('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf40a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf40a('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xf40a('0x10')]}};
\ No newline at end of file
+var _0x77d4=['randomstring','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','ENUM','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','star','TEXT','stringify','input','name','text','getDataValue','onlineForm','setDataValue','textarea','Comments','offlineForm','parse','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}}','bottom_right','alternate','#fafafa','System'];(function(_0x2f1e01,_0x3e3e19){var _0x5a1881=function(_0x31276e){while(--_0x31276e){_0x2f1e01['push'](_0x2f1e01['shift']());}};_0x5a1881(++_0x3e3e19);}(_0x77d4,0x108));var _0x477d=function(_0x509312,_0x2f17a3){_0x509312=_0x509312-0x0;var _0x3a6ae9=_0x77d4[_0x509312];return _0x3a6ae9;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x477d('0x0'));module['exports']={'name':{'type':Sequelize[_0x477d('0x1')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x477d('0x2')},'description':{'type':Sequelize[_0x477d('0x1')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x477d('0x1')],'defaultValue':_0x477d('0x3')},'key':{'type':Sequelize[_0x477d('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x477d('0x1')],'defaultValue':_0x477d('0x4')},'customerAlias':{'type':Sequelize[_0x477d('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x477d('0x1')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x477d('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x477d('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x477d('0x1')]},'animation':{'type':Sequelize[_0x477d('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x477d('0x8')]('rounded',_0x477d('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x477d('0x1')],'defaultValue':_0x477d('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x477d('0xb')},'offline_chat_button':{'type':Sequelize[_0x477d('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x477d('0xc')},'download_transcript':{'type':Sequelize[_0x477d('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x477d('0x1')],'defaultValue':_0x477d('0xd')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x477d('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x477d('0x1')],'defaultValue':_0x477d('0xe')},'formSubmitFailureMessage':{'type':Sequelize[_0x477d('0x1')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x477d('0x1')],'defaultValue':_0x477d('0xf')},'placeholderMessage':{'type':Sequelize[_0x477d('0x1')],'defaultValue':_0x477d('0x10')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x477d('0x11')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x477d('0x12')},'skipMessageButton':{'type':Sequelize[_0x477d('0x1')],'defaultValue':_0x477d('0x13')},'conditionAgreement':{'type':Sequelize[_0x477d('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x477d('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x477d('0x7')],'defaultValue':![]},'ratingType':{'type':Sequelize['ENUM'](_0x477d('0x14'),'thumb'),'defaultValue':_0x477d('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x477d('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x477d('0x15')],'defaultValue':function(){return JSON[_0x477d('0x16')]({'items':[{'type':_0x477d('0x17'),'variable':null,'config':{'placeholder':_0x477d('0x18'),'type':_0x477d('0x19'),'required':!![]},'props':{'title':_0x477d('0x18'),'helpText':''}},{'type':_0x477d('0x17'),'props':{'title':_0x477d('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x477d('0x3'),'type':_0x477d('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x477d('0x1a')](_0x477d('0x1b'))?JSON['parse'](this[_0x477d('0x1a')]('onlineForm')):{};},'set':function(_0x239b56){return this[_0x477d('0x1c')](_0x477d('0x1b'),JSON[_0x477d('0x16')](_0x239b56));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x477d('0x16')]({'items':[{'type':_0x477d('0x17'),'props':{'title':_0x477d('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0x477d('0x1d'),'config':{'placeholder':_0x477d('0x1e')},'props':{'title':_0x477d('0x1e'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x477d('0x1a')](_0x477d('0x1f'))?JSON[_0x477d('0x20')](this[_0x477d('0x1a')](_0x477d('0x1f'))):{};},'set':function(_0x537fc4){return this[_0x477d('0x1c')](_0x477d('0x1f'),JSON[_0x477d('0x16')](_0x537fc4));}},'token':{'type':Sequelize[_0x477d('0x1')],'defaultValue':function(){return rs[_0x477d('0x21')]();}},'autoclose':{'type':Sequelize[_0x477d('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x477d('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x477d('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x477d('0x1')]},'forwardOffline':{'type':Sequelize[_0x477d('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x477d('0x1')]},'waitingTitle':{'type':Sequelize[_0x477d('0x1')],'defaultValue':_0x477d('0x22')},'waitingMessage':{'type':Sequelize[_0x477d('0x1')],'defaultValue':_0x477d('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x477d('0x1')],'defaultValue':_0x477d('0x24')},'offlineMessageBody':{'type':Sequelize[_0x477d('0x1')],'defaultValue':_0x477d('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x477d('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x477d('0x26')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x477d('0x13')},'sendUnmanaged':{'type':Sequelize[_0x477d('0x1')],'defaultValue':_0x477d('0x12')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x477d('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x477d('0x15')]},'showAgentAvatar':{'type':Sequelize[_0x477d('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x477d('0x1')]},'notificationTemplate':{'type':Sequelize[_0x477d('0x15')],'defaultValue':function(){return _0x477d('0x27');}},'notificationSound':{'type':Sequelize[_0x477d('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x477d('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x477d('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x477d('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x477d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x477d('0x1')],'defaultValue':_0x477d('0x28')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x477d('0x1')],'defaultValue':_0x477d('0x29')},'defaultTitle':{'type':Sequelize[_0x477d('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x477d('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x477d('0x1')],'allowNull':![],'defaultValue':_0x477d('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x477d('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x477d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x477d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x477d('0x2b')},'systemAvatar':{'type':Sequelize[_0x477d('0x15')]}};
\ No newline at end of file
index b3d0f55..7567894 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x399f=['server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','getResult','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','ChatApplication','account','Applications','list','applications','orderBy','priority','asc','defaults','contact','firstName','customerIp','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','type','threadId','externalUrl','ChatInteraction','interaction','spread','lastName','get','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','findOne','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','user','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','custom','increment','chatLicenseExceeded','all','x-real-ip','connection','remoteAddress','referer','replace','alignment','sequelize','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','online','false','offlineForm','onlineForm','items','getOfflineMessages','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./chatWebsite.socket','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','end','status','count','offset','limit','set','json','apply','reject','save','update','destroy','then','stack','name','send','model','query','dateStart','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','dateEnd','add','day','merge','filter','map','options','ChatWebsite','includeAll','rows','rawAttributes','include','find','catch','create','body','params','describe','addDisposition','ChatWebsiteId','Disposition','hasOwnProperty','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','../../config/license/util','isNil','existsSync','join','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar'];(function(_0x1740ce,_0x40e4f0){var _0x1ecf44=function(_0x850fcd){while(--_0x850fcd){_0x1740ce['push'](_0x1740ce['shift']());}};_0x1ecf44(++_0x40e4f0);}(_0x399f,0x9a));var _0xf399=function(_0x3acab5,_0x5696a9){_0x3acab5=_0x3acab5-0x0;var _0x5b5ab3=_0x399f[_0x3acab5];return _0x5b5ab3;};'use strict';var pdf=require(_0xf399('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf399('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf399('0x2'));var moment=require(_0xf399('0x3'));var BPromise=require(_0xf399('0x4'));var Mustache=require(_0xf399('0x5'));var util=require(_0xf399('0x6'));var path=require('path');var sox=require(_0xf399('0x7'));var csv=require(_0xf399('0x8'));var ejs=require(_0xf399('0x9'));var fs=require('fs');var _=require(_0xf399('0xa'));var squel=require(_0xf399('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf399('0x8'));var querystring=require(_0xf399('0xc'));var Papa=require(_0xf399('0xd'));var qs=require('../../components/parsers/qs');var logger=require(_0xf399('0xe'))(_0xf399('0xf'));var utils=require(_0xf399('0x10'));var config=require(_0xf399('0x11'));var db=require(_0xf399('0x12'))['db'];var socket=require(_0xf399('0x13'))({'host':_0xf399('0x14'),'port':0x18eb});require(_0xf399('0x15'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xf399('0x16')][_0xf399('0x17')]({'port':0x232c});var client9002=jayson[_0xf399('0x16')]['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x336fb5,_0x19cd30,_0x108838,_0x4d25b){return new BPromise(function(_0x5f0614,_0x1c98a3){var _0x1f084=_0x4d25b||client;return _0x1f084[_0xf399('0x18')](_0x336fb5,_0x108838)['then'](function(_0x57ad7d){logger[_0xf399('0x19')](_0xf399('0x1a'),_0x19cd30,_0xf399('0x1b'));logger['debug'](_0xf399('0x1c'),_0x19cd30,_0xf399('0x1b'),JSON[_0xf399('0x1d')](_0x57ad7d));if(_0x57ad7d['error']){if(_0x57ad7d[_0xf399('0x1e')][_0xf399('0x1f')]===0x1f4){logger[_0xf399('0x1e')](_0xf399('0x1a'),_0x19cd30,_0x57ad7d['error'][_0xf399('0x20')]);return _0x1c98a3(_0x57ad7d['error'][_0xf399('0x20')]);}logger[_0xf399('0x1e')](_0xf399('0x1a'),_0x19cd30,_0x57ad7d[_0xf399('0x1e')][_0xf399('0x20')]);return _0x5f0614(_0x57ad7d[_0xf399('0x1e')][_0xf399('0x20')]);}else{logger[_0xf399('0x19')](_0xf399('0x1a'),_0x19cd30,'request\x20sent');_0x5f0614(_0x57ad7d['result'][_0xf399('0x20')]);}})['catch'](function(_0x1d4018){logger['error'](_0xf399('0x1a'),_0x19cd30,_0x1d4018);_0x1c98a3(_0x1d4018);});});}function respondWithStatusCode(_0x3a9537,_0x48c924){_0x48c924=_0x48c924||0xcc;return function(_0x41b357){if(_0x41b357){return _0x3a9537[_0xf399('0x21')](_0x48c924);}return _0x3a9537['status'](_0x48c924)[_0xf399('0x22')]();};}function respondWithResult(_0x42cb3d,_0x11f217){_0x11f217=_0x11f217||0xc8;return function(_0x2f81a0){if(_0x2f81a0){return _0x42cb3d[_0xf399('0x23')](_0x11f217)['json'](_0x2f81a0);}};}function respondWithFilteredResult(_0x55e8a9,_0x5ab72d){return function(_0x1c6343){if(_0x1c6343){var _0x30a516=_0x1c6343[_0xf399('0x24')],_0x40dabd=_0x5ab72d[_0xf399('0x25')],_0x474d19=_0x5ab72d[_0xf399('0x25')]+_0x5ab72d[_0xf399('0x26')],_0x42bedd;if(_0x474d19>=_0x30a516){_0x474d19=_0x30a516;_0x42bedd=0xc8;}else{_0x42bedd=0xce;}_0x55e8a9[_0xf399('0x23')](_0x42bedd);return _0x55e8a9[_0xf399('0x27')]('Content-Range',_0x40dabd+'-'+_0x474d19+'/'+_0x30a516)[_0xf399('0x28')](_0x1c6343);}return null;};}function patchUpdates(_0x92cd56){return function(_0x261a48){try{jsonpatch[_0xf399('0x29')](_0x261a48,_0x92cd56,!![]);}catch(_0x5c7c52){return BPromise[_0xf399('0x2a')](_0x5c7c52);}return _0x261a48[_0xf399('0x2b')]();};}function saveUpdates(_0x422eb7,_0x1c2a83){return function(_0x4b8f8f){if(_0x4b8f8f){return _0x4b8f8f[_0xf399('0x2c')](_0x422eb7)['then'](function(_0x3ecd1a){return _0x3ecd1a;});}return null;};}function removeEntity(_0x52d069,_0xb39675){return function(_0x416a58){if(_0x416a58){return _0x416a58[_0xf399('0x2d')]()[_0xf399('0x2e')](function(){_0x52d069['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31e262,_0xd180b7){return function(_0x23d1c8){if(!_0x23d1c8){_0x31e262[_0xf399('0x21')](0x194);}return _0x23d1c8;};}function handleError(_0x3e20de,_0x6fecdc){_0x6fecdc=_0x6fecdc||0x1f4;return function(_0x311ca4){logger['error'](_0x311ca4[_0xf399('0x2f')]);if(_0x311ca4[_0xf399('0x30')]){delete _0x311ca4[_0xf399('0x30')];}_0x3e20de[_0xf399('0x23')](_0x6fecdc)[_0xf399('0x31')](_0x311ca4);};}exports['index']=function(_0x17e51b,_0x50e796){var _0x5334be={},_0x30f473={},_0x41a563={'count':0x0,'rows':[]};var _0x38a3e6=db['ChatWebsite']['rawAttributes'];_0x30f473[_0xf399('0x32')]=_['keys'](_0x38a3e6);var _0x4fa261={'dateStart':_0x17e51b[_0xf399('0x33')][_0xf399('0x34')],'dateEnd':_0x17e51b[_0xf399('0x33')]['dateEnd']};delete _0x17e51b[_0xf399('0x33')][_0xf399('0x34')];delete _0x17e51b[_0xf399('0x33')]['dateEnd'];_0x30f473[_0xf399('0x33')]=_[_0xf399('0x35')](_0x17e51b[_0xf399('0x33')]);_0x30f473[_0xf399('0x36')]=_[_0xf399('0x37')](_0x30f473['model'],_0x30f473[_0xf399('0x33')]);_0x5334be['attributes']=_[_0xf399('0x37')](_0x30f473[_0xf399('0x32')],qs['fields'](_0x17e51b['query'][_0xf399('0x38')]));_0x5334be[_0xf399('0x39')]=_0x5334be[_0xf399('0x39')][_0xf399('0x3a')]?_0x5334be[_0xf399('0x39')]:_0x30f473['model'];if(!_0x17e51b[_0xf399('0x33')]['hasOwnProperty'](_0xf399('0x3b'))){_0x5334be['limit']=qs['limit'](_0x17e51b['query'][_0xf399('0x26')]);_0x5334be[_0xf399('0x25')]=qs['offset'](_0x17e51b[_0xf399('0x33')][_0xf399('0x25')]);}_0x5334be[_0xf399('0x3c')]=qs['sort'](_0x17e51b[_0xf399('0x33')][_0xf399('0x3d')]);_0x5334be[_0xf399('0x3e')]=qs[_0xf399('0x36')](_[_0xf399('0x3f')](_0x17e51b[_0xf399('0x33')],_0x30f473['filters']));if(_0x4fa261[_0xf399('0x34')]){if(_0x4fa261[_0xf399('0x40')]){_0x4fa261[_0xf399('0x40')]=moment(_0x4fa261[_0xf399('0x40')])[_0xf399('0x41')](0x1,_0xf399('0x42'));}else{_0x4fa261[_0xf399('0x40')]=moment(_0x4fa261[_0xf399('0x34')])[_0xf399('0x41')](0x1,'day');}_[_0xf399('0x43')](_0x5334be['where'],{'createdAt':{'$gte':_0x4fa261[_0xf399('0x34')],'$lte':_0x4fa261[_0xf399('0x40')]}});}if(_0x17e51b[_0xf399('0x33')][_0xf399('0x44')]){_0x5334be[_0xf399('0x3e')]=_[_0xf399('0x43')](_0x5334be[_0xf399('0x3e')],{'$or':_[_0xf399('0x45')](_0x5334be[_0xf399('0x39')],function(_0x40e795){var _0x2273b5={};_0x2273b5[_0x40e795]={'$like':'%'+_0x17e51b[_0xf399('0x33')][_0xf399('0x44')]+'%'};return _0x2273b5;})});}_0x5334be=_[_0xf399('0x43')]({},_0x5334be,_0x17e51b[_0xf399('0x46')]);var _0x30c4ab={'where':_0x5334be[_0xf399('0x3e')]};return db[_0xf399('0x47')]['count'](_0x30c4ab)[_0xf399('0x2e')](function(_0x1d05bd){_0x41a563[_0xf399('0x24')]=_0x1d05bd;if(_0x17e51b['query'][_0xf399('0x48')]){_0x5334be['include']=[{'all':!![]}];}return db[_0xf399('0x47')]['findAll'](_0x5334be);})['then'](function(_0x2421b4){_0x41a563[_0xf399('0x49')]=_0x2421b4;return _0x41a563;})[_0xf399('0x2e')](respondWithFilteredResult(_0x50e796,_0x5334be))['catch'](handleError(_0x50e796,null));};exports['show']=function(_0x83663d,_0x16dfb1){var _0x42ec3f={'raw':![],'where':{'id':_0x83663d['params']['id']}},_0x54d483={};_0x54d483[_0xf399('0x32')]=_[_0xf399('0x35')](db[_0xf399('0x47')][_0xf399('0x4a')]);_0x54d483['query']=_[_0xf399('0x35')](_0x83663d[_0xf399('0x33')]);_0x54d483['filters']=_['intersection'](_0x54d483[_0xf399('0x32')],_0x54d483[_0xf399('0x33')]);_0x42ec3f[_0xf399('0x39')]=_[_0xf399('0x37')](_0x54d483[_0xf399('0x32')],qs['fields'](_0x83663d[_0xf399('0x33')][_0xf399('0x38')]));_0x42ec3f['attributes']=_0x42ec3f['attributes'][_0xf399('0x3a')]?_0x42ec3f[_0xf399('0x39')]:_0x54d483[_0xf399('0x32')];if(_0x83663d[_0xf399('0x33')]['includeAll']){_0x42ec3f[_0xf399('0x4b')]=[{'all':!![]}];}_0x42ec3f=_[_0xf399('0x43')]({},_0x42ec3f,_0x83663d[_0xf399('0x46')]);return db[_0xf399('0x47')][_0xf399('0x4c')](_0x42ec3f)[_0xf399('0x2e')](handleEntityNotFound(_0x16dfb1,null))[_0xf399('0x2e')](respondWithResult(_0x16dfb1,null))[_0xf399('0x4d')](handleError(_0x16dfb1,null));};exports[_0xf399('0x4e')]=function(_0x9c7246,_0x2fe188){return db['ChatWebsite'][_0xf399('0x4e')](_0x9c7246[_0xf399('0x4f')],{})[_0xf399('0x2e')](respondWithResult(_0x2fe188,0xc9))[_0xf399('0x4d')](handleError(_0x2fe188,null));};exports[_0xf399('0x2c')]=function(_0x421b48,_0x404d3c){if(_0x421b48[_0xf399('0x4f')]['id']){delete _0x421b48[_0xf399('0x4f')]['id'];}return db[_0xf399('0x47')][_0xf399('0x4c')]({'where':{'id':_0x421b48['params']['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0x404d3c,null))['then'](saveUpdates(_0x421b48[_0xf399('0x4f')],null))[_0xf399('0x2e')](respondWithResult(_0x404d3c,null))['catch'](handleError(_0x404d3c,null));};exports[_0xf399('0x2d')]=function(_0x3e9366,_0x5e68fe){return db[_0xf399('0x47')][_0xf399('0x4c')]({'where':{'id':_0x3e9366[_0xf399('0x50')]['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0x5e68fe,null))['then'](removeEntity(_0x5e68fe,null))[_0xf399('0x4d')](handleError(_0x5e68fe,null));};exports[_0xf399('0x51')]=function(_0x8376d,_0x355326){return db['ChatWebsite'][_0xf399('0x51')]()['then'](respondWithResult(_0x355326,null))[_0xf399('0x4d')](handleError(_0x355326,null));};exports[_0xf399('0x52')]=function(_0xabe3f4,_0x3f2e39,_0x677b6f){if(_0xabe3f4[_0xf399('0x4f')]['id']){delete _0xabe3f4['body']['id'];}return db[_0xf399('0x47')][_0xf399('0x4c')]({'where':{'id':_0xabe3f4['params']['id']}})['then'](handleEntityNotFound(_0x3f2e39,null))[_0xf399('0x2e')](function(_0xa06ea7){if(_0xa06ea7){_0xabe3f4['body'][_0xf399('0x53')]=_0xa06ea7['id'];return db[_0xf399('0x54')][_0xf399('0x4e')](_0xabe3f4[_0xf399('0x4f')]);}})[_0xf399('0x2e')](respondWithResult(_0x3f2e39,null))[_0xf399('0x4d')](handleError(_0x3f2e39,null));};exports['getDispositions']=function(_0x520d0c,_0xb42219,_0x3998c7){var _0x208f82={'raw':![],'where':{}};var _0x1f8296={};var _0x45e2b0={'count':0x0,'rows':[]};return db[_0xf399('0x47')]['findOne']({'where':{'id':_0x520d0c[_0xf399('0x50')]['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0xb42219,null))[_0xf399('0x2e')](function(_0xf8b3f9){if(_0xf8b3f9){_0x1f8296[_0xf399('0x32')]=_['keys'](db['Disposition'][_0xf399('0x4a')]);_0x1f8296['query']=_[_0xf399('0x35')](_0x520d0c[_0xf399('0x33')]);_0x1f8296[_0xf399('0x36')]=_[_0xf399('0x37')](_0x1f8296[_0xf399('0x32')],_0x1f8296['query']);_0x208f82[_0xf399('0x39')]=_[_0xf399('0x37')](_0x1f8296[_0xf399('0x32')],qs[_0xf399('0x38')](_0x520d0c[_0xf399('0x33')][_0xf399('0x38')]));_0x208f82[_0xf399('0x39')]=_0x208f82[_0xf399('0x39')][_0xf399('0x3a')]?_0x208f82[_0xf399('0x39')]:_0x1f8296[_0xf399('0x32')];if(!_0x520d0c[_0xf399('0x33')][_0xf399('0x55')](_0xf399('0x3b'))){_0x208f82['limit']=qs[_0xf399('0x26')](_0x520d0c['query'][_0xf399('0x26')]);_0x208f82[_0xf399('0x25')]=qs['offset'](_0x520d0c[_0xf399('0x33')][_0xf399('0x25')]);}_0x208f82[_0xf399('0x3c')]=qs[_0xf399('0x3d')](_0x520d0c[_0xf399('0x33')][_0xf399('0x3d')]);_0x208f82[_0xf399('0x3e')]=qs[_0xf399('0x36')](_[_0xf399('0x3f')](_0x520d0c[_0xf399('0x33')],_0x1f8296[_0xf399('0x36')]));_0x208f82[_0xf399('0x3e')][_0xf399('0x53')]=_0xf8b3f9['id'];if(_0x520d0c['query'][_0xf399('0x44')]){_0x208f82[_0xf399('0x3e')]=_[_0xf399('0x43')](_0x208f82['where'],{'$or':_[_0xf399('0x45')](_0x208f82[_0xf399('0x39')],function(_0x504f8f){var _0x42ba81={};_0x42ba81[_0x504f8f]={'$like':'%'+_0x520d0c['query'][_0xf399('0x44')]+'%'};return _0x42ba81;})});}_0x208f82=_[_0xf399('0x43')]({},_0x208f82,_0x520d0c['options']);return db[_0xf399('0x54')][_0xf399('0x24')]({'where':_0x208f82['where']})['then'](function(_0x1eeddc){_0x45e2b0[_0xf399('0x24')]=_0x1eeddc;if(_0x520d0c[_0xf399('0x33')][_0xf399('0x48')]){_0x208f82['include']=[{'all':!![]}];}return db[_0xf399('0x54')][_0xf399('0x56')](_0x208f82);})[_0xf399('0x2e')](function(_0x3f052c){_0x45e2b0['rows']=_0x3f052c;return _0x45e2b0;});}})['then'](respondWithFilteredResult(_0xb42219,_0x208f82))['catch'](handleError(_0xb42219,null));};exports[_0xf399('0x57')]=function(_0xbbe09,_0x225149,_0x57d5fa){var _0x35737b;return db['ChatWebsite']['find']({'where':{'id':_0xbbe09[_0xf399('0x50')]['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0x225149,null))[_0xf399('0x2e')](function(_0x45be7f){if(_0x45be7f){return _0x45be7f['removeDispositions'](_0xbbe09[_0xf399('0x33')][_0xf399('0x58')]);}})['then'](respondWithStatusCode(_0x225149,null))['catch'](handleError(_0x225149,null));};exports[_0xf399('0x59')]=function(_0x24bd16,_0x3bfa6b,_0x261357){if(_0x24bd16[_0xf399('0x4f')]['id']){delete _0x24bd16['body']['id'];}return db[_0xf399('0x47')]['find']({'where':{'id':_0x24bd16[_0xf399('0x50')]['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0x3bfa6b,null))[_0xf399('0x2e')](function(_0x4ac493){if(_0x4ac493){_0x24bd16['body'][_0xf399('0x53')]=_0x4ac493['id'];return db[_0xf399('0x5a')]['create'](_0x24bd16[_0xf399('0x4f')]);}})['then'](respondWithResult(_0x3bfa6b,null))[_0xf399('0x4d')](handleError(_0x3bfa6b,null));};exports[_0xf399('0x5b')]=function(_0x26e502,_0x21c702,_0x1ba421){var _0x4a1019={'raw':![],'where':{}};var _0x3b85f0={};var _0x172f15={'count':0x0,'rows':[]};return db[_0xf399('0x47')]['findOne']({'where':{'id':_0x26e502['params']['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0x21c702,null))[_0xf399('0x2e')](function(_0xdec575){if(_0xdec575){_0x3b85f0[_0xf399('0x32')]=_['keys'](db[_0xf399('0x5a')][_0xf399('0x4a')]);_0x3b85f0[_0xf399('0x33')]=_['keys'](_0x26e502['query']);_0x3b85f0[_0xf399('0x36')]=_[_0xf399('0x37')](_0x3b85f0['model'],_0x3b85f0[_0xf399('0x33')]);_0x4a1019[_0xf399('0x39')]=_[_0xf399('0x37')](_0x3b85f0[_0xf399('0x32')],qs[_0xf399('0x38')](_0x26e502['query'][_0xf399('0x38')]));_0x4a1019[_0xf399('0x39')]=_0x4a1019[_0xf399('0x39')][_0xf399('0x3a')]?_0x4a1019[_0xf399('0x39')]:_0x3b85f0[_0xf399('0x32')];if(!_0x26e502['query'][_0xf399('0x55')]('nolimit')){_0x4a1019['limit']=qs[_0xf399('0x26')](_0x26e502[_0xf399('0x33')][_0xf399('0x26')]);_0x4a1019[_0xf399('0x25')]=qs[_0xf399('0x25')](_0x26e502[_0xf399('0x33')]['offset']);}_0x4a1019[_0xf399('0x3c')]=qs['sort'](_0x26e502['query'][_0xf399('0x3d')]);_0x4a1019[_0xf399('0x3e')]=qs['filters'](_[_0xf399('0x3f')](_0x26e502[_0xf399('0x33')],_0x3b85f0[_0xf399('0x36')]));_0x4a1019[_0xf399('0x3e')][_0xf399('0x53')]=_0xdec575['id'];if(_0x26e502['query'][_0xf399('0x44')]){_0x4a1019[_0xf399('0x3e')]=_[_0xf399('0x43')](_0x4a1019[_0xf399('0x3e')],{'$or':_[_0xf399('0x45')](_0x4a1019['attributes'],function(_0x17c39d){var _0x292f12={};_0x292f12[_0x17c39d]={'$like':'%'+_0x26e502[_0xf399('0x33')][_0xf399('0x44')]+'%'};return _0x292f12;})});}_0x4a1019=_[_0xf399('0x43')]({},_0x4a1019,_0x26e502[_0xf399('0x46')]);return db[_0xf399('0x5a')][_0xf399('0x24')]({'where':_0x4a1019[_0xf399('0x3e')]})[_0xf399('0x2e')](function(_0x2913c6){_0x172f15[_0xf399('0x24')]=_0x2913c6;if(_0x26e502[_0xf399('0x33')]['includeAll']){_0x4a1019[_0xf399('0x4b')]=[{'all':!![]}];}return db[_0xf399('0x5a')]['findAll'](_0x4a1019);})['then'](function(_0x5b0506){_0x172f15[_0xf399('0x49')]=_0x5b0506;return _0x172f15;});}})[_0xf399('0x2e')](respondWithFilteredResult(_0x21c702,_0x4a1019))['catch'](handleError(_0x21c702,null));};exports[_0xf399('0x5c')]=function(_0x450b0e,_0x319b65,_0x38fe57){var _0x40a1fd;return db[_0xf399('0x47')]['find']({'where':{'id':_0x450b0e[_0xf399('0x50')]['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0x319b65,null))[_0xf399('0x2e')](function(_0x2ed7e5){if(_0x2ed7e5){return _0x2ed7e5['removeAnswers'](_0x450b0e[_0xf399('0x33')][_0xf399('0x58')]);}})[_0xf399('0x2e')](respondWithStatusCode(_0x319b65,null))['catch'](handleError(_0x319b65,null));};exports[_0xf399('0x5d')]=function(_0xd13cfa,_0x2d623e,_0xc2c720){_0xd13cfa[_0xf399('0x4f')][_0xf399('0x5e')]=_0xd13cfa[_0xf399('0x5f')][_0xf399('0x60')];return db[_0xf399('0x47')][_0xf399('0x4c')]({'where':{'id':_0xd13cfa[_0xf399('0x50')]['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0x2d623e,null))['then'](saveUpdates(_0xd13cfa[_0xf399('0x4f')],null))[_0xf399('0x2e')](respondWithResult(_0x2d623e,null))[_0xf399('0x4d')](handleError(_0x2d623e,null));};exports[_0xf399('0x61')]=function(_0x4fed11,_0xc0404d,_0x490cf1){_0x4fed11[_0xf399('0x4f')][_0xf399('0x62')]=_0x4fed11['file'][_0xf399('0x60')];return db[_0xf399('0x47')][_0xf399('0x4c')]({'where':{'id':_0x4fed11['params']['id']}})['then'](handleEntityNotFound(_0xc0404d,null))['then'](saveUpdates(_0x4fed11[_0xf399('0x4f')],null))[_0xf399('0x2e')](respondWithResult(_0xc0404d,null))['catch'](handleError(_0xc0404d,null));};exports[_0xf399('0x63')]=function(_0x1dfb09,_0xd0f472,_0x4a947d){_0x1dfb09[_0xf399('0x4f')][_0xf399('0x64')]=_0x1dfb09[_0xf399('0x5f')][_0xf399('0x60')];return db[_0xf399('0x47')][_0xf399('0x4c')]({'where':{'id':_0x1dfb09['params']['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0xd0f472,null))[_0xf399('0x2e')](saveUpdates(_0x1dfb09[_0xf399('0x4f')],null))[_0xf399('0x2e')](respondWithResult(_0xd0f472,null))['catch'](handleError(_0xd0f472,null));};exports[_0xf399('0x65')]=function(_0x216073,_0x547705,_0x1b28f4){_0x216073[_0xf399('0x4f')][_0xf399('0x66')]=_0x216073[_0xf399('0x5f')][_0xf399('0x60')];return db[_0xf399('0x47')][_0xf399('0x4c')]({'where':{'id':_0x216073[_0xf399('0x50')]['id']}})['then'](handleEntityNotFound(_0x547705,null))[_0xf399('0x2e')](saveUpdates(_0x216073[_0xf399('0x4f')],null))['then'](respondWithResult(_0x547705,null))[_0xf399('0x4d')](handleError(_0x547705,null));};exports[_0xf399('0x67')]=function(_0xd5c4ba,_0x3d2bd5,_0x2a9047){var _0x5aae5a=path['join'](config[_0xf399('0x68')],'server/files/images/logos/default_logo.png');var _0x1982e4={'where':{'id':_0xd5c4ba['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x50c2b7=![];return require(_0xf399('0x69'))['getLicense']()[_0xf399('0x2e')](function(_0x267f41){if(_0x267f41){_0x50c2b7=_0x267f41['custom'];}})[_0xf399('0x2e')](function(){return db[_0xf399('0x47')][_0xf399('0x4c')](_0x1982e4);})[_0xf399('0x2e')](handleEntityNotFound(_0x3d2bd5,null))[_0xf399('0x2e')](function(_0x9a435a){if(_0x9a435a){if(!_[_0xf399('0x6a')](_0x9a435a[_0xf399('0x5e')])){if(fs[_0xf399('0x6b')](path[_0xf399('0x6c')](config['root'],'server/files/images/logos/',_0x9a435a[_0xf399('0x5e')]))&&_0x50c2b7){_0x5aae5a=path['join'](config[_0xf399('0x68')],'server/files/images/logos/',_0x9a435a['sitepic']);}}return _0x3d2bd5[_0xf399('0x6d')](_0x5aae5a);}})[_0xf399('0x4d')](handleError(_0x3d2bd5,null));};exports['getAvatar']=function(_0x31361a,_0x466f57,_0x1a96a5){var _0x1cd7e6=path[_0xf399('0x6c')](config[_0xf399('0x68')],_0xf399('0x6e'));var _0x50987e={'where':{'id':_0x31361a[_0xf399('0x50')]['id']},'attributes':['id',_0xf399('0x62')],'raw':!![]};return db[_0xf399('0x47')][_0xf399('0x4c')](_0x50987e)[_0xf399('0x2e')](handleEntityNotFound(_0x466f57,null))[_0xf399('0x2e')](function(_0x4b873f){if(_0x4b873f){if(!_[_0xf399('0x6a')](_0x4b873f['agentAvatar'])){if(fs['existsSync'](path[_0xf399('0x6c')](config[_0xf399('0x68')],_0xf399('0x6f'),_0x4b873f[_0xf399('0x62')]))){_0x1cd7e6=path['join'](config[_0xf399('0x68')],_0xf399('0x6f'),_0x4b873f[_0xf399('0x62')]);}}return _0x466f57[_0xf399('0x6d')](_0x1cd7e6);}})[_0xf399('0x4d')](handleError(_0x466f57,null));};exports[_0xf399('0x70')]=function(_0x273777,_0x498ad8,_0x19c282){var _0x507574=path[_0xf399('0x6c')](config[_0xf399('0x68')],_0xf399('0x71'));var _0x4a043f={'where':{'id':_0x273777[_0xf399('0x50')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0xf399('0x4c')](_0x4a043f)[_0xf399('0x2e')](handleEntityNotFound(_0x498ad8,null))['then'](function(_0x148bc4){if(_0x148bc4){if(!_[_0xf399('0x6a')](_0x148bc4[_0xf399('0x64')])){if(fs[_0xf399('0x6b')](path['join'](config[_0xf399('0x68')],_0xf399('0x6f'),_0x148bc4[_0xf399('0x64')]))&&_0x148bc4[_0xf399('0x72')]){_0x507574=path[_0xf399('0x6c')](config[_0xf399('0x68')],_0xf399('0x6f'),_0x148bc4[_0xf399('0x64')]);}}return _0x498ad8[_0xf399('0x6d')](_0x507574);}})['catch'](handleError(_0x498ad8,null));};exports[_0xf399('0x73')]=function(_0x1dcc6e,_0x5b648a,_0x2a295b){var _0x4ce011=path[_0xf399('0x6c')](config[_0xf399('0x68')],_0xf399('0x74'));var _0xf5e577={'where':{'id':_0x1dcc6e[_0xf399('0x50')]['id']},'attributes':['id',_0xf399('0x66')],'raw':!![]};return db[_0xf399('0x47')][_0xf399('0x4c')](_0xf5e577)[_0xf399('0x2e')](handleEntityNotFound(_0x5b648a,null))[_0xf399('0x2e')](function(_0x2f8083){if(_0x2f8083){if(!_[_0xf399('0x6a')](_0x2f8083['systemAvatar'])){if(fs['existsSync'](path['join'](config[_0xf399('0x68')],'server/files/images/avatars/',_0x2f8083[_0xf399('0x66')]))){_0x4ce011=path[_0xf399('0x6c')](config['root'],_0xf399('0x6f'),_0x2f8083['systemAvatar']);}}return _0x5b648a[_0xf399('0x6d')](_0x4ce011);}})[_0xf399('0x4d')](handleError(_0x5b648a,null));};exports[_0xf399('0x75')]=function(_0x1b93b8,_0x202321,_0x38b884){var _0x28f398=require('user-agent-parser');var _0x40e312=new _0x28f398();var _0x512525=_0x40e312[_0xf399('0x76')](_0x1b93b8[_0xf399('0x77')][_0xf399('0x78')])[_0xf399('0x79')]();var _0x1ddb35={'body':_0x1b93b8[_0xf399('0x4f')],'channel':'chat'};var _0x32311f=[];var _0x5a7cab=[];var _0x106ea5={};var _0x2efe7e=![];return db['CmContact'][_0xf399('0x51')]()[_0xf399('0x2e')](function(_0x1bcdac){if(!_0x1bcdac){throw new db['Sequelize'][(_0xf399('0x7a'))](_0xf399('0x7b'));}_0x32311f=_[_0xf399('0x7c')](_[_0xf399('0x35')](_0x1bcdac),[_0xf399('0x7d'),_0xf399('0x7e')]);_0x5a7cab=_['difference'](_[_0xf399('0x35')](_0x1bcdac),[_0xf399('0x7d'),'updatedAt',_0xf399('0x7f'),_0xf399('0x80')]);if(_0x1b93b8[_0xf399('0x4f')]['id']){delete _0x1b93b8['body']['id'];}if(_[_0xf399('0x6a')](_0x1b93b8[_0xf399('0x4f')][_0xf399('0x81')])){throw new db['Sequelize'][(_0xf399('0x7a'))](_0xf399('0x82'));}if(_['isNil'](_0x1b93b8[_0xf399('0x4f')]['body'])||_0x1b93b8[_0xf399('0x4f')][_0xf399('0x4f')]===''){throw new db[(_0xf399('0x83'))][(_0xf399('0x7a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf399('0x6a')](_0x1b93b8['body'][_0xf399('0x84')])){throw new db[(_0xf399('0x83'))][(_0xf399('0x7a'))](_0xf399('0x85')+_0x5a7cab);}if(!_['includes'](_0x5a7cab,_0x1b93b8[_0xf399('0x4f')][_0xf399('0x84')])){throw new db[(_0xf399('0x83'))][(_0xf399('0x7a'))](_0xf399('0x86')+_0x5a7cab);}_0x106ea5[_0x1b93b8[_0xf399('0x4f')][_0xf399('0x84')]]=_0x1b93b8[_0xf399('0x4f')][_0xf399('0x81')];})[_0xf399('0x2e')](function(){return db[_0xf399('0x47')][_0xf399('0x4c')]({'where':{'id':_0x1b93b8[_0xf399('0x50')]['id']},'include':[{'model':db[_0xf399('0x87')],'as':_0xf399('0x88'),'include':[{'model':db[_0xf399('0x89')],'as':_0xf399('0x8a'),'where':_0x106ea5,'limit':0x1,'order':[[_0xf399('0x7e'),_0xf399('0x8b')]]}]},{'model':db[_0xf399('0x8c')],'as':'Applications'}]});})[_0xf399('0x2e')](handleEntityNotFound(_0x202321,null))[_0xf399('0x2e')](function(_0x1bc575){if(_0x1bc575&&_0x1bc575[_0xf399('0x88')]){_0x1ddb35[_0xf399('0x8d')]=_0x1bc575;_0x1ddb35['applications']=_0x1bc575[_0xf399('0x8e')];_0x1ddb35[_0xf399('0x8f')]=_0x1bc575[_0xf399('0x88')];_0x1ddb35[_0xf399('0x90')]=_[_0xf399('0x91')](_0x1ddb35[_0xf399('0x90')],[_0xf399('0x92')],[_0xf399('0x93')]);if(_0x1ddb35['account']['Applications']){delete _0x1ddb35['account'][_0xf399('0x8e')];}if(_0x1ddb35[_0xf399('0x8d')][_0xf399('0x88')]&&_0x1ddb35[_0xf399('0x8d')][_0xf399('0x88')][_0xf399('0x8a')][_0xf399('0x3a')]){return _0x1ddb35[_0xf399('0x8d')][_0xf399('0x88')][_0xf399('0x8a')][0x0];}var _0x105e20=_[_0xf399('0x94')](_0x1b93b8[_0xf399('0x4f')],{'firstName':_0x1b93b8[_0xf399('0x4f')][_0xf399('0x81')],'ListId':_0x1bc575['ListId']});_0x105e20[_0x1b93b8[_0xf399('0x4f')][_0xf399('0x84')]]=_0x1b93b8[_0xf399('0x4f')][_0xf399('0x81')];return db[_0xf399('0x89')][_0xf399('0x4e')](_0x105e20,{'fields':_0x32311f,'raw':!![]});}})[_0xf399('0x2e')](handleEntityNotFound(_0x202321,null))['then'](function(_0x2793d9){_0x1ddb35[_0xf399('0x95')]=_0x2793d9;if(_0x2793d9){var _0xcdd73e={'ContactId':_0x2793d9['id'],'ChatWebsiteId':_0x1b93b8[_0xf399('0x50')]['id'],'from':(_0x2793d9[_0xf399('0x96')]||'')+'\x20'+(_0x2793d9['lastName']||''),'customerIp':_0x1b93b8[_0xf399('0x4f')][_0xf399('0x97')],'referer':_0x1b93b8[_0xf399('0x4f')]['referer'],'browserName':_0x512525[_0xf399('0x98')][_0xf399('0x30')]&&_0x512525[_0xf399('0x98')][_0xf399('0x99')]?util[_0xf399('0x9a')]('%s\x20%s',_0x512525[_0xf399('0x98')]['name'],_0x512525[_0xf399('0x98')][_0xf399('0x99')]):_0xf399('0x9b'),'browserVersion':_0x512525[_0xf399('0x98')][_0xf399('0x99')]||_0xf399('0x9b'),'osName':util[_0xf399('0x9a')](_0xf399('0x9c'),_0x512525['os']['name'],_0x512525['os'][_0xf399('0x99')]),'osVersion':_0x512525['os'][_0xf399('0x99')],'deviceModel':_0x512525['device']['model']&&_0x512525[_0xf399('0x9d')][_0xf399('0x9e')]?util['format'](_0xf399('0x9f'),_0x512525[_0xf399('0x9d')][_0xf399('0x32')],_0x512525[_0xf399('0x9d')]['vendor'],_0x512525[_0xf399('0x9d')][_0xf399('0xa0')]):null,'deviceVendor':_0x512525[_0xf399('0x9d')][_0xf399('0x9e')],'deviceType':_0x512525['device'][_0xf399('0xa0')],'formData':JSON[_0xf399('0x1d')](_0x1b93b8[_0xf399('0x4f')])};var _0x414c89={'ChatWebsiteId':_0x1b93b8[_0xf399('0x50')]['id'],'closed':![]};if(_0x1b93b8[_0xf399('0x4f')][_0xf399('0xa1')]){_0x414c89[_0xf399('0xa1')]=_0x1b93b8[_0xf399('0x4f')]['threadId'];return db['ChatInteraction'][_0xf399('0x4c')]({'where':_0x414c89})[_0xf399('0x2e')](function(_0x46e583){if(_0x46e583){return[_0x46e583,![]];}_0xcdd73e[_0xf399('0xa1')]=_0x1b93b8[_0xf399('0x4f')]['threadId'];_0xcdd73e[_0xf399('0xa2')]=_0x1b93b8[_0xf399('0x4f')]['externalUrl'];return db[_0xf399('0xa3')][_0xf399('0x4e')](_0xcdd73e)[_0xf399('0x2e')](function(_0x15cce3){return[_0x15cce3,!![]];});});}_0x414c89['ContactId']=_0x2793d9['id'];if(_0x1b93b8[_0xf399('0x4f')][_0xf399('0xa4')]&&_0x1b93b8[_0xf399('0x4f')][_0xf399('0xa4')]['id']){_0x414c89['id']=_0x1b93b8[_0xf399('0x4f')][_0xf399('0xa4')]['id'];return db[_0xf399('0xa3')][_0xf399('0x4c')]({'where':_0x414c89})[_0xf399('0x2e')](function(_0x5daaff){if(_0x5daaff){return[_0x5daaff,![]];}return db[_0xf399('0xa3')]['create'](_0xcdd73e)['then'](function(_0x4a9b56){return[_0x4a9b56,!![]];});});}return db['ChatInteraction']['create'](_0xcdd73e)[_0xf399('0x2e')](function(_0x388b9b){return[_0x388b9b,!![]];});}})[_0xf399('0xa5')](function(_0xd8f4f1,_0x2c91fd){if(_0xd8f4f1){_0x2efe7e=_0x2c91fd;if(!_0x2c91fd){return _0xd8f4f1[_0xf399('0x2c')]({'from':(_0x1ddb35[_0xf399('0x95')][_0xf399('0x96')]||'')+'\x20'+(_0x1ddb35['contact'][_0xf399('0xa6')]||'')});}else{return _0xd8f4f1;}}})[_0xf399('0x2e')](function(_0x42d593){_0x1ddb35[_0xf399('0xa4')]=_0x42d593[_0xf399('0xa7')]({'plain':!![]});_0x1ddb35['interaction']['created']=_0x2efe7e;if(_0x1ddb35['interaction'][_0xf399('0xa8')]){if(_0x1ddb35[_0xf399('0x8d')][_0xf399('0xa9')]){_0x1ddb35[_0xf399('0x90')][_0xf399('0xaa')]({'id':0x0,'priority':_0x1ddb35[_0xf399('0x90')][_0xf399('0x3a')]+0x1,'app':_0xf399('0xab'),'appdata':_0xf399('0xac'),'interval':_0xf399('0xad')});}}return db[_0xf399('0xae')]['create']({'body':_0x1b93b8[_0xf399('0x4f')][_0xf399('0x4f')],'ChatWebsiteId':_0x1b93b8[_0xf399('0x50')]['id'],'ChatInteractionId':_0x42d593['id'],'direction':'in','ContactId':_0x1ddb35['contact']['id'],'AttachmentId':_0x1b93b8[_0xf399('0x4f')][_0xf399('0xaf')]});})[_0xf399('0x2e')](function(_0xa0230e){_0x1ddb35['message']=_0xa0230e;if(_0x1ddb35[_0xf399('0xa4')][_0xf399('0xb0')]){return db[_0xf399('0xb1')]['find']({'attributes':['id',_0xf399('0x30')],'where':{'id':_0x1ddb35[_0xf399('0xa4')][_0xf399('0xb0')]}})[_0xf399('0x2e')](function(_0x13c2d8){if(_0x13c2d8){_0x1ddb35[_0xf399('0x90')][_0xf399('0xb2')]({'id':0x0,'priority':0x0,'app':_0xf399('0xb3'),'appdata':_0x13c2d8['name']+','+(_0x1ddb35[_0xf399('0x8d')][_0xf399('0xb4')]||0xa),'interval':_0xf399('0xad')});_0x1ddb35[_0xf399('0xb5')]=!![];}return respondWithRpcPromise('Start',_0xf399('0xb6'),_0x1ddb35);});}return respondWithRpcPromise(_0xf399('0xb7'),'startRouting',_0x1ddb35);})[_0xf399('0x2e')](function(_0x24a3ae){respondWithRpcPromise(_0xf399('0xb8'),'EventManager',{'event':_0xf399('0x75'),'message':_0x24a3ae},client9002);return _0x24a3ae;})[_0xf399('0x2e')](respondWithResult(_0x202321,null))[_0xf399('0x4d')](handleError(_0x202321,null));};exports['offline']=function(_0x571e95,_0x2d0c8d,_0x118944){var _0x504752,_0x35605b,_0x20719b;var _0x1a9148=[];var _0x4d804d=[];var _0x4f6a4b={};return db[_0xf399('0x89')][_0xf399('0x51')]()['then'](function(_0x29c49f){if(!_0x29c49f){throw new db[(_0xf399('0x83'))][(_0xf399('0x7a'))](_0xf399('0x7b'));}_0x4d804d=_['difference'](_['keys'](_0x29c49f),[_0xf399('0x7d'),_0xf399('0x7e')]);_0x1a9148=_[_0xf399('0x7c')](_[_0xf399('0x35')](_0x29c49f),[_0xf399('0x7d'),_0xf399('0x7e'),_0xf399('0x7f'),_0xf399('0x80')]);if(_0x571e95[_0xf399('0x4f')]['id']){delete _0x571e95[_0xf399('0x4f')]['id'];}if(_[_0xf399('0x6a')](_0x571e95[_0xf399('0x4f')][_0xf399('0x81')])){throw _0x2d0c8d['status'](0x1f4)[_0xf399('0x31')](new db['Sequelize']['ValidationError'](_0xf399('0x82')));}if(_[_0xf399('0x6a')](_0x571e95[_0xf399('0x4f')][_0xf399('0x4f')])||_0x571e95['body'][_0xf399('0x4f')]===''){throw _0x2d0c8d[_0xf399('0x23')](0x1f4)[_0xf399('0x31')](new db['Sequelize'][(_0xf399('0x7a'))](_0xf399('0xb9')));}if(_[_0xf399('0x6a')](_0x571e95['body'][_0xf399('0xba')])){throw _0x2d0c8d[_0xf399('0x23')](0x1f4)[_0xf399('0x31')](new db[(_0xf399('0x83'))][(_0xf399('0x7a'))](_0xf399('0xbb')+_0x1a9148));}if(!_['includes'](_0x1a9148,_0x571e95[_0xf399('0x4f')][_0xf399('0xba')])){throw _0x2d0c8d['status'](0x1f4)[_0xf399('0x31')](new db[(_0xf399('0x83'))]['ValidationError'](_0xf399('0xbc')+_0x1a9148));}_0x4f6a4b[_0x571e95[_0xf399('0x4f')]['mapKeyOffline']]=_0x571e95[_0xf399('0x4f')][_0xf399('0x81')];})[_0xf399('0x2e')](function(){return db['ChatWebsite'][_0xf399('0x4c')]({'where':{'id':_0x571e95[_0xf399('0x50')]['id']},'include':[{'model':db[_0xf399('0x87')],'as':'List'}]});})[_0xf399('0x2e')](handleEntityNotFound(_0x2d0c8d,null))[_0xf399('0x2e')](function(_0x52b7ee){if(_0x52b7ee&&_0x52b7ee[_0xf399('0x88')]){_0x35605b=_0x52b7ee;var _0x397a0b=_[_0xf399('0x94')](_0x571e95[_0xf399('0x4f')],{'firstName':_0x571e95[_0xf399('0x4f')]['from'],'phone':_0x571e95['body'][_0xf399('0x81')],'ListId':_0x52b7ee[_0xf399('0x80')]});_0x397a0b[_0x571e95[_0xf399('0x4f')][_0xf399('0xba')]]=_0x571e95[_0xf399('0x4f')][_0xf399('0x81')];return db[_0xf399('0x89')][_0xf399('0xbd')]({'where':_0x4f6a4b,'defaults':_0x397a0b});}})[_0xf399('0xa5')](function(_0x4a52b0){if(_0x4a52b0){_0x20719b=_0x4a52b0;var _0xc677ed=fs['readFileSync'](path[_0xf399('0x6c')](config['root'],_0xf399('0xbe')),_0xf399('0xbf'));var _0x4b183e=ejs[_0xf399('0xc0')](_0xc677ed,{'body':_[_0xf399('0xc1')](_0x571e95[_0xf399('0x4f')][_0xf399('0x4f')]),'bodyTitle':_0x35605b[_0xf399('0xc2')]});return db[_0xf399('0xc3')][_0xf399('0x4e')]({'body':_0x4b183e,'ContactId':_0x4a52b0['id'],'ChatWebsiteId':_0x35605b['id']});}})['then'](function(_0x265800){if(_0x265800){_0x504752=_0x265800;return db['MailAccount'][_0xf399('0xc4')]({'where':{'service':!![]},'include':[{'model':db[_0xf399('0xc5')],'as':_0xf399('0xc6'),'raw':!![]}]});}})[_0xf399('0x2e')](function(_0x252a47){if(_0x252a47&&_0x252a47[_0xf399('0xc6')]&&_0x35605b[_0xf399('0xc7')]){var _0x3a131c={'tls':{'rejectUnauthorized':![]}};if(_0x252a47[_0xf399('0xc6')]['service']){_0x3a131c[_0xf399('0xc8')]=_0x252a47['Smtp'][_0xf399('0xc8')];}else{_0x3a131c[_0xf399('0xc9')]=_0x252a47[_0xf399('0xc6')]['host'];_0x3a131c[_0xf399('0xca')]=_0x252a47[_0xf399('0xc6')]['port'];_0x3a131c[_0xf399('0xcb')]=_0x252a47['Smtp'][_0xf399('0xcb')];}if(_0x252a47[_0xf399('0xc6')][_0xf399('0xcc')]){_0x3a131c[_0xf399('0xcd')]={'user':_0x252a47[_0xf399('0xc6')][_0xf399('0xce')],'pass':_0x252a47[_0xf399('0xc6')][_0xf399('0xcf')]};}return respondWithRpcPromise(_0xf399('0xd0'),_0xf399('0xd1'),{'account':_0x3a131c,'message':{'from':util['format'](_0xf399('0xd2'),_0x252a47['name'],_0x252a47[_0xf399('0xd3')]||_0x252a47['Smtp'][_0xf399('0xce')]),'to':_0x35605b[_0xf399('0xc7')],'subject':_0x35605b[_0xf399('0xd4')],'text':_0x504752[_0xf399('0x4f')]}},client9003)[_0xf399('0x2e')](function(){return _0x504752;})[_0xf399('0x4d')](function(_0x35f70a){console[_0xf399('0x1e')](_0x35f70a);});}})[_0xf399('0x2e')](function(){if(_0x504752){return _0x504752;}})[_0xf399('0x2e')](respondWithResult(_0x2d0c8d,null))[_0xf399('0x4d')](handleError(_0x2d0c8d,null));};exports[_0xf399('0xd5')]=function(_0x551147,_0x3c7782,_0x3b1c5f){return db['ChatInteraction']['find']({'where':{'id':_0x551147[_0xf399('0x50')]['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0x3c7782,null))[_0xf399('0x2e')](function(_0x5f20c1){if(_0x5f20c1){return _0x5f20c1['addInteraction'](_0x551147[_0xf399('0x4f')][_0xf399('0x58')],_['omit'](_0x551147['body'],[_0xf399('0x58'),'id'])||{});}})[_0xf399('0x2e')](respondWithResult(_0x3c7782,null))[_0xf399('0x4d')](handleError(_0x3c7782,null));};exports[_0xf399('0xd6')]=function(_0x582845,_0x461385,_0x1e5185){var _0x160450={'raw':![],'where':{}};var _0x17ce65={};var _0x124184={'count':0x0,'rows':[]};return db[_0xf399('0x47')]['findOne']({'where':{'id':_0x582845[_0xf399('0x50')]['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0x461385,null))[_0xf399('0x2e')](function(_0x3f1df1){if(_0x3f1df1){_0x17ce65['model']=_[_0xf399('0x35')](db[_0xf399('0xa3')][_0xf399('0x4a')]);_0x17ce65['query']=_[_0xf399('0x35')](_0x582845[_0xf399('0x33')]);_0x17ce65[_0xf399('0x36')]=_[_0xf399('0x37')](_0x17ce65[_0xf399('0x32')],_0x17ce65[_0xf399('0x33')]);_0x160450['attributes']=_[_0xf399('0x37')](_0x17ce65[_0xf399('0x32')],qs['fields'](_0x582845[_0xf399('0x33')][_0xf399('0x38')]));_0x160450[_0xf399('0x39')]=_0x160450['attributes'][_0xf399('0x3a')]?_0x160450[_0xf399('0x39')]:_0x17ce65[_0xf399('0x32')];if(!_0x582845[_0xf399('0x33')][_0xf399('0x55')]('nolimit')){_0x160450[_0xf399('0x26')]=qs[_0xf399('0x26')](_0x582845[_0xf399('0x33')]['limit']);_0x160450[_0xf399('0x25')]=qs[_0xf399('0x25')](_0x582845[_0xf399('0x33')]['offset']);}_0x160450['order']=qs[_0xf399('0x3d')](_0x582845['query'][_0xf399('0x3d')]);_0x160450[_0xf399('0x3e')]=qs['filters'](_['pick'](_0x582845[_0xf399('0x33')],_0x17ce65[_0xf399('0x36')]));_0x160450[_0xf399('0x3e')][_0xf399('0x53')]=_0x3f1df1['id'];if(_0x582845[_0xf399('0x33')][_0xf399('0x44')]){_0x160450[_0xf399('0x3e')]=_['merge'](_0x160450['where'],{'$or':_[_0xf399('0x45')](_0x160450[_0xf399('0x39')],function(_0x31fe75){var _0x3cc3c3={};_0x3cc3c3[_0x31fe75]={'$like':'%'+_0x582845[_0xf399('0x33')]['filter']+'%'};return _0x3cc3c3;})});}_0x160450=_[_0xf399('0x43')]({},_0x160450,_0x582845[_0xf399('0x46')]);return db[_0xf399('0xa3')][_0xf399('0x24')]({'where':_0x160450[_0xf399('0x3e')]})[_0xf399('0x2e')](function(_0xa9770c){_0x124184[_0xf399('0x24')]=_0xa9770c;if(_0x582845[_0xf399('0x33')][_0xf399('0x48')]){_0x160450[_0xf399('0x4b')]=[{'model':db[_0xf399('0x89')],'as':_0xf399('0xd7'),'required':![]},{'model':db[_0xf399('0xb1')],'as':_0xf399('0xd8'),'attributes':[_0xf399('0x30'),_0xf399('0xd9'),_0xf399('0xda')],'required':![]},{'model':db[_0xf399('0xdb')],'as':_0xf399('0xdc'),'attributes':['id',_0xf399('0x30'),_0xf399('0xdd')],'where':_0x582845[_0xf399('0x33')][_0xf399('0xde')]?{'id':_0x582845[_0xf399('0x33')]['tag']}:undefined,'required':_0x582845[_0xf399('0x33')][_0xf399('0xde')]?!![]:![]}];}return db[_0xf399('0xa3')][_0xf399('0x56')](_0x160450);})[_0xf399('0x2e')](function(_0x6da857){_0x124184[_0xf399('0x49')]=_0x6da857;return _0x124184;});}})[_0xf399('0x2e')](respondWithFilteredResult(_0x461385,_0x160450))[_0xf399('0x4d')](handleError(_0x461385,null));};function iftimePromise(_0x19f405,_0x139ff1){return respondWithRpcPromise(_0xf399('0xdf'),'getSnippet',{'command':_0x139ff1[_0xf399('0xe0')]?util[_0xf399('0x9a')](_0xf399('0xe1'),_0x19f405[_0xf399('0xe2')],_0x139ff1[_0xf399('0xe0')]):util['format'](_0xf399('0xe3'),_0x19f405[_0xf399('0xe2')])},client9002)['then'](function(_0x58d43d){var _0x5be960=_0x58d43d&&_0x58d43d['indexOf'](_0xf399('0xe4'))>=0x0?!![]:![];logger['info'](_0xf399('0xe5'),_0x139ff1['id'],_0x19f405['id'],_0x19f405['interval'],_0x5be960?_0xf399('0xe6'):_0xf399('0xe7'),_0x139ff1[_0xf399('0xe0')]?_0x139ff1['timezone']:'No\x20timezone');return _0x5be960;})[_0xf399('0x4d')](function(_0x599a49){logger['error'](_0xf399('0xe5'),_0x139ff1['id'],_0x19f405['id'],_0x19f405['interval'],util[_0xf399('0xe8')](_0x599a49,{'showHidden':![],'depth':null}),_0x139ff1[_0xf399('0xe0')]?_0x139ff1[_0xf399('0xe0')]:'No\x20timezone');return![];});}exports['getSnippet']=function(_0xfdc787,_0x37584a,_0x8ca636){var _0x4abac7=0x0;var _0x22bfbb=0x0;var _0x56946d=![];var _0x3fc90a;var _0x342f76;return db[_0xf399('0x47')]['find']({'where':{'id':_0xfdc787[_0xf399('0x50')]['id']},'include':[{'model':db[_0xf399('0xe9')],'as':_0xf399('0xe9'),'include':[{'model':db['Interval'],'as':_0xf399('0xea'),'attributes':['id',_0xf399('0xe2')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x37584a,null))[_0xf399('0x2e')](function(_0x3d21cd){if(_0x3d21cd){_0x3fc90a=_0x3d21cd;return _0x3d21cd[_0xf399('0xeb')]({'raw':!![]});}})[_0xf399('0x2e')](function(_0x229b54){if(_0x3fc90a){if(_0x229b54){_0x342f76=_0x229b54;}}return require(_0xf399('0x69'))[_0xf399('0xec')]();})['then'](function(_0x5fc3fe){if(_0x5fc3fe){_0x22bfbb=_0x5fc3fe[_0xf399('0xed')];_0x56946d=_0x5fc3fe[_0xf399('0xee')];}})[_0xf399('0x2e')](function(){return db[_0xf399('0xa3')][_0xf399('0x24')]({'where':{'closed':![]}});})[_0xf399('0x2e')](function(_0x2ba1ed){_0x4abac7=_0x2ba1ed;if(_0x22bfbb&&_0x2ba1ed>_0x22bfbb){return db['License'][_0xf399('0xc4')]({'where':{'id':0x1}})[_0xf399('0x2e')](function(_0x399a65){if(_0x399a65){_0x399a65[_0xf399('0xef')](_0xf399('0xf0'));}});}})[_0xf399('0x2e')](function(){if(_0x3fc90a[_0xf399('0xe9')]&&_0x3fc90a['Interval']['Intervals']){var _0x5889d5=[];for(var _0x356908=0x0;_0x356908<_0x3fc90a[_0xf399('0xe9')][_0xf399('0xea')][_0xf399('0x3a')];_0x356908++){var _0x18b372=_0x3fc90a[_0xf399('0xe9')]['Intervals'][_0x356908][_0xf399('0xa7')]({'plain':!![]});_0x5889d5[_0xf399('0xaa')](iftimePromise(_0x18b372,_0x3fc90a));}return BPromise[_0xf399('0xf1')](_0x5889d5)[_0xf399('0x2e')](function(_0x5090ea){return _['some'](_0x5090ea);});}else{return!![];}})[_0xf399('0x2e')](function(_0x4914cc){var _0x5e82ef=fs['readFileSync'](path[_0xf399('0x6c')](config[_0xf399('0x68')],'server/files/chat/iframe.js'),_0xf399('0xbf'));var _0x399e8a={'remote':_0x3fc90a['remote'],'query':querystring[_0xf399('0x1d')](_['merge'](_0x3fc90a[_0xf399('0xa7')]({'plain':!![]}),{'customerIp':_0xfdc787[_0xf399('0x77')]['x-forwarded-for']||_0xfdc787[_0xf399('0x77')][_0xf399('0xf2')]||_0xfdc787[_0xf399('0xf3')][_0xf399('0xf4')]||_0xfdc787['ip'],'referer':_0xfdc787[_0xf399('0x77')][_0xf399('0xf5')],'openedInteractions':_0x4abac7,'maxInteractions':_0x22bfbb,'virtual':_0x56946d[_0xf399('0xed')],'online':_0x4914cc,'custom':_0x56946d}))[_0xf399('0xf6')](/'/g,'\x5c\x27')};_0x37584a[_0xf399('0x31')](ejs[_0xf399('0xc0')](Mustache['render'](_0x5e82ef,_0x399e8a),{'proactiveActions':_0x342f76,'alignment':_0x3fc90a[_0xf399('0xf7')],'verticalAlignment':_0x3fc90a['verticalAlignment']}));})[_0xf399('0x4d')](handleError(_0x37584a,null));};exports['addApplications']=function(_0x2ea5ef,_0x5b301d,_0x404c9f){return db[_0xf399('0x47')][_0xf399('0xc4')]({'where':{'id':_0x2ea5ef[_0xf399('0x50')]['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0x5b301d,null))[_0xf399('0x2e')](function(_0x342397){if(_0x342397){return db[_0xf399('0xf8')]['transaction'](function(_0x4fae1c){return db[_0xf399('0x8c')][_0xf399('0x2d')]({'where':{'ChatWebsiteId':_0x2ea5ef['params']['id']},'transaction':_0x4fae1c})[_0xf399('0x2e')](function(_0x1be5ee){var _0x956bb7=_[_0xf399('0x45')](_0x2ea5ef[_0xf399('0x4f')],function(_0x598cbb){_0x598cbb[_0xf399('0x53')]=_0x2ea5ef[_0xf399('0x50')]['id'];return _0x598cbb;});return db[_0xf399('0x8c')][_0xf399('0xf9')](_0x956bb7,{'transaction':_0x4fae1c});});})[_0xf399('0x2e')](function(){return db[_0xf399('0x8c')][_0xf399('0xfa')]({'where':{'ChatWebsiteId':_0x2ea5ef['params']['id']},'order':_0xf399('0x92')});});}})['then'](respondWithResult(_0x5b301d,null))[_0xf399('0x4d')](handleError(_0x5b301d,null));};exports[_0xf399('0xfb')]=function(_0x5407d9,_0x1746dc,_0x867249){var _0x45b105={};var _0x369ddb={};var _0xbccf7;var _0x173373;return db['ChatWebsite']['findOne']({'where':{'id':_0x5407d9[_0xf399('0x50')]['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0x1746dc,null))[_0xf399('0x2e')](function(_0x5d5741){if(_0x5d5741){_0xbccf7=_0x5d5741;_0x369ddb[_0xf399('0x32')]=_['keys'](db[_0xf399('0x8c')]['rawAttributes']);_0x369ddb[_0xf399('0x33')]=_[_0xf399('0x35')](_0x5407d9[_0xf399('0x33')]);_0x369ddb['filters']=_[_0xf399('0x37')](_0x369ddb[_0xf399('0x32')],_0x369ddb[_0xf399('0x33')]);_0x45b105[_0xf399('0x39')]=_[_0xf399('0x37')](_0x369ddb[_0xf399('0x32')],qs[_0xf399('0x38')](_0x5407d9[_0xf399('0x33')]['fields']));_0x45b105[_0xf399('0x39')]=_0x45b105[_0xf399('0x39')][_0xf399('0x3a')]?_0x45b105[_0xf399('0x39')]:_0x369ddb[_0xf399('0x32')];_0x45b105['order']=qs['sort'](_0x5407d9[_0xf399('0x33')]['sort']);_0x45b105[_0xf399('0x3e')]=qs[_0xf399('0x36')](_[_0xf399('0x3f')](_0x5407d9[_0xf399('0x33')],_0x369ddb[_0xf399('0x36')]));if(_0x5407d9[_0xf399('0x33')][_0xf399('0x44')]){_0x45b105['where']=_[_0xf399('0x43')](_0x45b105[_0xf399('0x3e')],{'$or':_[_0xf399('0x45')](_0x45b105[_0xf399('0x39')],function(_0x2ba742){var _0x292155={};_0x292155[_0x2ba742]={'$like':'%'+_0x5407d9[_0xf399('0x33')][_0xf399('0x44')]+'%'};return _0x292155;})});}_0x45b105=_[_0xf399('0x43')]({},_0x45b105,_0x5407d9[_0xf399('0x46')]);return _0xbccf7['getApplications'](_0x45b105);}})[_0xf399('0x2e')](function(_0x284a50){if(_0x284a50){_0x173373=_0x284a50[_0xf399('0x3a')];if(!_0x5407d9[_0xf399('0x33')][_0xf399('0x55')](_0xf399('0x3b'))){_0x45b105['limit']=qs[_0xf399('0x26')](_0x5407d9[_0xf399('0x33')][_0xf399('0x26')]);_0x45b105[_0xf399('0x25')]=qs[_0xf399('0x25')](_0x5407d9[_0xf399('0x33')]['offset']);}return _0xbccf7[_0xf399('0xfb')](_0x45b105);}})[_0xf399('0x2e')](function(_0x436c11){if(_0x436c11){return _0x436c11?{'count':_0x173373,'rows':_0x436c11}:null;}})[_0xf399('0x2e')](respondWithResult(_0x1746dc,null))[_0xf399('0x4d')](handleError(_0x1746dc,null));};exports[_0xf399('0xfc')]=function(_0x30c37f,_0x4c757d,_0x1876a3){return db[_0xf399('0xfd')][_0xf399('0x4c')]({'where':{'id':_0x30c37f['params']['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0x4c757d,null))[_0xf399('0x2e')](function(_0x3c0b8b){if(_0x3c0b8b){return _0x3c0b8b[_0xf399('0xfc')](_0x30c37f[_0xf399('0x4f')][_0xf399('0x58')],_[_0xf399('0xfe')](_0x30c37f['body'],[_0xf399('0x58'),'id'])||{});}})[_0xf399('0x2e')](respondWithResult(_0x4c757d,null))[_0xf399('0x4d')](handleError(_0x4c757d,null));};exports[_0xf399('0xeb')]=function(_0x29b811,_0x3fa41b,_0x4e3d9e){var _0x1ed9ec={};var _0x4662a3={};var _0x417303;var _0x5ed4c6;return db[_0xf399('0x47')][_0xf399('0xc4')]({'where':{'id':_0x29b811['params']['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0x3fa41b,null))['then'](function(_0x2f6951){if(_0x2f6951){_0x417303=_0x2f6951;_0x4662a3[_0xf399('0x32')]=_[_0xf399('0x35')](db[_0xf399('0xff')][_0xf399('0x4a')]);_0x4662a3[_0xf399('0x33')]=_[_0xf399('0x35')](_0x29b811[_0xf399('0x33')]);_0x4662a3['filters']=_[_0xf399('0x37')](_0x4662a3['model'],_0x4662a3['query']);_0x1ed9ec[_0xf399('0x39')]=_[_0xf399('0x37')](_0x4662a3[_0xf399('0x32')],qs[_0xf399('0x38')](_0x29b811[_0xf399('0x33')]['fields']));_0x1ed9ec['attributes']=_0x1ed9ec['attributes'][_0xf399('0x3a')]?_0x1ed9ec[_0xf399('0x39')]:_0x4662a3[_0xf399('0x32')];_0x1ed9ec[_0xf399('0x3c')]=qs[_0xf399('0x3d')](_0x29b811[_0xf399('0x33')][_0xf399('0x3d')]);_0x1ed9ec[_0xf399('0x3e')]=qs[_0xf399('0x36')](_[_0xf399('0x3f')](_0x29b811['query'],_0x4662a3[_0xf399('0x36')]));if(_0x29b811[_0xf399('0x33')][_0xf399('0x44')]){_0x1ed9ec['where']=_[_0xf399('0x43')](_0x1ed9ec[_0xf399('0x3e')],{'$or':_['map'](_0x1ed9ec[_0xf399('0x39')],function(_0x305c4d){var _0x151b86={};_0x151b86[_0x305c4d]={'$like':'%'+_0x29b811['query']['filter']+'%'};return _0x151b86;})});}_0x1ed9ec=_['merge']({},_0x1ed9ec,_0x29b811['options']);return _0x417303['getProactiveActions'](_0x1ed9ec);}})[_0xf399('0x2e')](function(_0x1331cf){if(_0x1331cf){_0x5ed4c6=_0x1331cf[_0xf399('0x3a')];if(!_0x29b811[_0xf399('0x33')][_0xf399('0x55')]('nolimit')){_0x1ed9ec[_0xf399('0x26')]=qs[_0xf399('0x26')](_0x29b811['query'][_0xf399('0x26')]);_0x1ed9ec['offset']=qs[_0xf399('0x25')](_0x29b811[_0xf399('0x33')][_0xf399('0x25')]);}return _0x417303[_0xf399('0xeb')](_0x1ed9ec);}})['then'](function(_0x2fa376){if(_0x2fa376){return _0x2fa376?{'count':_0x5ed4c6,'rows':_0x2fa376}:null;}})[_0xf399('0x2e')](respondWithResult(_0x3fa41b,null))[_0xf399('0x4d')](handleError(_0x3fa41b,null));};exports['getFields']=function(_0x9a8dde,_0x49b87c,_0x2fb0fd){var _0x2b3da0=_0x9a8dde[_0xf399('0x33')][_0xf399('0x100')]===_0xf399('0x101')?_0xf399('0x102'):_0xf399('0x103');return db[_0xf399('0x47')][_0xf399('0x4c')]({'attributes':['id',_0x2b3da0],'where':{'id':_0x9a8dde[_0xf399('0x50')]['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0x49b87c,null))['then'](function(_0x390697){if(_0x390697){var _0x4865be=_0x390697[_0x2b3da0];var _0x542719=_0x4865be&&_0x4865be[_0xf399('0x104')]?_0x4865be['items']:[];_0x49b87c[_0xf399('0x31')]({'fromKey':_[_0xf399('0x6a')](_0x4865be['fromKey'])?undefined:_0x4865be['fromKey'],'count':_0x542719[_0xf399('0x3a')],'rows':_0x542719});}})['catch'](handleError(_0x49b87c,null));};exports[_0xf399('0x105')]=function(_0x2b615c,_0x120e74,_0x446164){var _0x612ee={'raw':!![],'where':{}};var _0x479d5e={};var _0x1adc22={'count':0x0,'rows':[]};return db[_0xf399('0x47')][_0xf399('0xc4')]({'where':{'id':_0x2b615c[_0xf399('0x50')]['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0x120e74,null))['then'](function(_0x1062be){if(_0x1062be){_0x479d5e[_0xf399('0x32')]=_[_0xf399('0x35')](db[_0xf399('0xc3')]['rawAttributes']);_0x479d5e[_0xf399('0x33')]=_['keys'](_0x2b615c['query']);_0x479d5e[_0xf399('0x36')]=_['intersection'](_0x479d5e[_0xf399('0x32')],_0x479d5e[_0xf399('0x33')]);_0x612ee['attributes']=_['intersection'](_0x479d5e[_0xf399('0x32')],qs['fields'](_0x2b615c[_0xf399('0x33')][_0xf399('0x38')]));_0x612ee[_0xf399('0x39')]=_0x612ee[_0xf399('0x39')][_0xf399('0x3a')]?_0x612ee[_0xf399('0x39')]:_0x479d5e['model'];if(!_0x2b615c[_0xf399('0x33')]['hasOwnProperty'](_0xf399('0x3b'))){_0x612ee['limit']=qs[_0xf399('0x26')](_0x2b615c[_0xf399('0x33')]['limit']);_0x612ee['offset']=qs['offset'](_0x2b615c['query']['offset']);}_0x612ee[_0xf399('0x3c')]=qs[_0xf399('0x3d')](_0x2b615c[_0xf399('0x33')][_0xf399('0x3d')]);_0x612ee['where']=qs[_0xf399('0x36')](_[_0xf399('0x3f')](_0x2b615c['query'],_0x479d5e['filters']));_0x612ee[_0xf399('0x3e')][_0xf399('0x53')]=_0x1062be['id'];if(_0x2b615c[_0xf399('0x33')][_0xf399('0x44')]){_0x612ee['where']=_[_0xf399('0x43')](_0x612ee['where'],{'$or':_[_0xf399('0x45')](_0x612ee[_0xf399('0x39')],function(_0x36bb41){var _0x541a38={};_0x541a38[_0x36bb41]={'$like':'%'+_0x2b615c['query'][_0xf399('0x44')]+'%'};return _0x541a38;})});}_0x612ee=_['merge']({},_0x612ee,_0x2b615c['options']);return db[_0xf399('0xc3')][_0xf399('0x24')]({'where':_0x612ee[_0xf399('0x3e')]})['then'](function(_0x360a66){_0x1adc22[_0xf399('0x24')]=_0x360a66;if(_0x2b615c[_0xf399('0x33')]['includeAll']){_0x612ee[_0xf399('0x4b')]=[{'all':!![]}];}return db[_0xf399('0xc3')][_0xf399('0x56')](_0x612ee);})['then'](function(_0xcdf53b){_0x1adc22['rows']=_0xcdf53b;return _0x1adc22;});}})[_0xf399('0x2e')](respondWithFilteredResult(_0x120e74,_0x612ee))['catch'](handleError(_0x120e74,null));};exports['addAgents']=function(_0x180f9e,_0x2dd5f3,_0x3fb094){return db['ChatWebsite'][_0xf399('0x4c')]({'where':{'id':_0x180f9e[_0xf399('0x50')]['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0x2dd5f3,null))[_0xf399('0x2e')](function(_0x3e0ac8){if(_0x3e0ac8){return _0x3e0ac8['addAgents'](_0x180f9e[_0xf399('0x4f')][_0xf399('0x58')],_[_0xf399('0xfe')](_0x180f9e[_0xf399('0x4f')],[_0xf399('0x58'),'id'])||{})[_0xf399('0xa5')](function(_0x344b27){for(var _0x39fc44=0x0;_0x39fc44<_0x180f9e[_0xf399('0x4f')][_0xf399('0x58')]['length'];_0x39fc44+=0x1){socket[_0xf399('0x106')](_0xf399('0x107'),{'UserId':_0x180f9e[_0xf399('0x4f')][_0xf399('0x58')][_0x39fc44],'ChatWebsiteId':_0x180f9e['params']['id']});}return _0x344b27;});}})[_0xf399('0x2e')](respondWithResult(_0x2dd5f3,null))['catch'](handleError(_0x2dd5f3,null));};exports['removeAgents']=function(_0xc9b835,_0x4511d2,_0x2cb099){var _0x23c6c2;return db[_0xf399('0x47')]['find']({'where':{'id':_0xc9b835[_0xf399('0x50')]['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0x4511d2,null))[_0xf399('0x2e')](function(_0x43f4ed){if(_0x43f4ed){return _0x43f4ed['removeAgents'](_0xc9b835[_0xf399('0x33')]['ids'])['then'](function(_0x419872){if(_[_0xf399('0x108')](_0xc9b835[_0xf399('0x33')][_0xf399('0x58')])){for(var _0x41ce1f=0x0;_0x41ce1f<_0xc9b835[_0xf399('0x33')][_0xf399('0x58')][_0xf399('0x3a')];_0x41ce1f+=0x1){socket[_0xf399('0x106')](_0xf399('0x109'),{'UserId':_0xc9b835[_0xf399('0x33')]['ids'][_0x41ce1f],'ChatWebsiteId':_0xc9b835[_0xf399('0x50')]['id']});}}else{socket[_0xf399('0x106')]('userChatWebsite:remove',{'UserId':_0xc9b835[_0xf399('0x33')]['ids'],'ChatWebsiteId':_0xc9b835[_0xf399('0x50')]['id']});}});}})[_0xf399('0x2e')](respondWithStatusCode(_0x4511d2,null))[_0xf399('0x4d')](handleError(_0x4511d2,null));};exports[_0xf399('0x10a')]=function(_0x65402f,_0x1cc524,_0x2dfe1e){var _0x1937bc={};var _0x7b310b={};var _0x3bfea6;var _0x5dfbe6;return db[_0xf399('0x47')]['findOne']({'where':{'id':_0x65402f['params']['id']}})[_0xf399('0x2e')](handleEntityNotFound(_0x1cc524,null))[_0xf399('0x2e')](function(_0x2e1dee){if(_0x2e1dee){_0x3bfea6=_0x2e1dee;_0x7b310b[_0xf399('0x32')]=_[_0xf399('0x35')](db[_0xf399('0xb1')][_0xf399('0x4a')]);_0x7b310b['query']=_[_0xf399('0x35')](_0x65402f[_0xf399('0x33')]);_0x7b310b['filters']=_[_0xf399('0x37')](_0x7b310b[_0xf399('0x32')],_0x7b310b[_0xf399('0x33')]);_0x1937bc[_0xf399('0x39')]=_[_0xf399('0x37')](_0x7b310b[_0xf399('0x32')],qs[_0xf399('0x38')](_0x65402f[_0xf399('0x33')][_0xf399('0x38')]));_0x1937bc[_0xf399('0x39')]=_0x1937bc[_0xf399('0x39')]['length']?_0x1937bc['attributes']:_0x7b310b[_0xf399('0x32')];_0x1937bc['order']=qs[_0xf399('0x3d')](_0x65402f['query'][_0xf399('0x3d')]);_0x1937bc[_0xf399('0x3e')]=qs[_0xf399('0x36')](_[_0xf399('0x3f')](_0x65402f[_0xf399('0x33')],_0x7b310b['filters']));if(_0x65402f['query'][_0xf399('0x44')]){_0x1937bc[_0xf399('0x3e')]=_[_0xf399('0x43')](_0x1937bc[_0xf399('0x3e')],{'$or':_[_0xf399('0x45')](_0x1937bc['attributes'],function(_0x4c2541){var _0x4b69f7={};_0x4b69f7[_0x4c2541]={'$like':'%'+_0x65402f['query'][_0xf399('0x44')]+'%'};return _0x4b69f7;})});}_0x1937bc=_[_0xf399('0x43')]({},_0x1937bc,_0x65402f[_0xf399('0x46')]);return _0x3bfea6[_0xf399('0x10a')](_0x1937bc);}})[_0xf399('0x2e')](function(_0x1e729b){if(_0x1e729b){_0x5dfbe6=_0x1e729b[_0xf399('0x3a')];if(!_0x65402f[_0xf399('0x33')]['hasOwnProperty'](_0xf399('0x3b'))){_0x1937bc['limit']=qs[_0xf399('0x26')](_0x65402f['query'][_0xf399('0x26')]);_0x1937bc[_0xf399('0x25')]=qs[_0xf399('0x25')](_0x65402f[_0xf399('0x33')][_0xf399('0x25')]);}return _0x3bfea6[_0xf399('0x10a')](_0x1937bc);}})[_0xf399('0x2e')](function(_0xbbafeb){if(_0xbbafeb){return _0xbbafeb?{'count':_0x5dfbe6,'rows':_0xbbafeb}:null;}})[_0xf399('0x2e')](respondWithResult(_0x1cc524,null))[_0xf399('0x4d')](handleError(_0x1cc524,null));};
\ No newline at end of file
+var _0xedd4=['addLogo','sitepic','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','file','getLogo','join','root','server/files/images/logos/default_logo.png','getLicense','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','CmContact','describe','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','Applications','applications','list','priority','account','defaults','contact','firstName','customerIp','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','type','threadId','ChatInteraction','externalUrl','interaction','spread','get','created','autoclose','push','unmanaged','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','from\x20is\x20mandatory','mapKeyOffline','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','user','pass','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','Contact','Owner','fullname','internal','Tag','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','custom','License','increment','all','some','readFileSync','server/files/chat/iframe.js','x-forwarded-for','connection','replace','verticalAlignment','addApplications','sequelize','transaction','destroy','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','items','fromKey','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','api','../../config/utils','../../mysqldb','localhost','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','stack','name','send','index','ChatWebsite','rawAttributes','model','query','dateEnd','keys','filters','attributes','intersection','fields','length','nolimit','limit','sort','pick','day','add','where','dateStart','filter','merge','map','includeAll','include','findAll','show','options','find','create','body','params','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','order','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0xedd4,0xa1));var _0x4edd=function(_0x26a580,_0x3875a3){_0x26a580=_0x26a580-0x0;var _0x38c3a2=_0xedd4[_0x26a580];return _0x38c3a2;};'use strict';var pdf=require(_0x4edd('0x0'));var emlformat=require(_0x4edd('0x1'));var rimraf=require(_0x4edd('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4edd('0x3'));var rp=require('request-promise');var moment=require(_0x4edd('0x4'));var BPromise=require(_0x4edd('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4edd('0x6'));var sox=require('sox');var csv=require(_0x4edd('0x7'));var ejs=require(_0x4edd('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4edd('0x9'));var crypto=require(_0x4edd('0xa'));var jsforce=require(_0x4edd('0xb'));var deskjs=require(_0x4edd('0xc'));var toCsv=require(_0x4edd('0x7'));var querystring=require('querystring');var Papa=require(_0x4edd('0xd'));var qs=require(_0x4edd('0xe'));var logger=require('../../config/logger')(_0x4edd('0xf'));var utils=require(_0x4edd('0x10'));var config=require('../../config/environment');var db=require(_0x4edd('0x11'))['db'];var socket=require('socket.io-emitter')({'host':_0x4edd('0x12'),'port':0x18eb});require('./chatWebsite.socket')['register'](socket);var jayson=require(_0x4edd('0x13'));var client=jayson[_0x4edd('0x14')][_0x4edd('0x15')]({'port':0x232c});var client9002=jayson[_0x4edd('0x14')][_0x4edd('0x15')]({'port':0x232a});var client9003=jayson[_0x4edd('0x14')]['http']({'port':0x232b});function respondWithRpcPromise(_0x239654,_0x337a3d,_0x364672,_0x5e5669){return new BPromise(function(_0x60c050,_0xa3cdf5){var _0x3a9c50=_0x5e5669||client;return _0x3a9c50[_0x4edd('0x16')](_0x239654,_0x364672)[_0x4edd('0x17')](function(_0x42e091){logger[_0x4edd('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x337a3d,_0x4edd('0x19'));logger[_0x4edd('0x1a')](_0x4edd('0x1b'),_0x337a3d,_0x4edd('0x19'),JSON[_0x4edd('0x1c')](_0x42e091));if(_0x42e091[_0x4edd('0x1d')]){if(_0x42e091[_0x4edd('0x1d')][_0x4edd('0x1e')]===0x1f4){logger[_0x4edd('0x1d')](_0x4edd('0x1f'),_0x337a3d,_0x42e091[_0x4edd('0x1d')][_0x4edd('0x20')]);return _0xa3cdf5(_0x42e091['error'][_0x4edd('0x20')]);}logger[_0x4edd('0x1d')](_0x4edd('0x1f'),_0x337a3d,_0x42e091['error'][_0x4edd('0x20')]);return _0x60c050(_0x42e091[_0x4edd('0x1d')]['message']);}else{logger['info'](_0x4edd('0x1f'),_0x337a3d,'request\x20sent');_0x60c050(_0x42e091[_0x4edd('0x21')][_0x4edd('0x20')]);}})[_0x4edd('0x22')](function(_0x32946a){logger[_0x4edd('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x337a3d,_0x32946a);_0xa3cdf5(_0x32946a);});});}function respondWithStatusCode(_0x12cc0a,_0x2622a3){_0x2622a3=_0x2622a3||0xcc;return function(_0xffe04c){if(_0xffe04c){return _0x12cc0a[_0x4edd('0x23')](_0x2622a3);}return _0x12cc0a[_0x4edd('0x24')](_0x2622a3)[_0x4edd('0x25')]();};}function respondWithResult(_0x2e68e3,_0x25ce19){_0x25ce19=_0x25ce19||0xc8;return function(_0x168dd3){if(_0x168dd3){return _0x2e68e3['status'](_0x25ce19)[_0x4edd('0x26')](_0x168dd3);}};}function respondWithFilteredResult(_0x959e63,_0x2a38b6){return function(_0x4e7fb4){if(_0x4e7fb4){var _0x51dc97=_0x4e7fb4[_0x4edd('0x27')],_0x5c8b50=_0x2a38b6['offset'],_0x56176e=_0x2a38b6[_0x4edd('0x28')]+_0x2a38b6['limit'],_0x157717;if(_0x56176e>=_0x51dc97){_0x56176e=_0x51dc97;_0x157717=0xc8;}else{_0x157717=0xce;}_0x959e63['status'](_0x157717);return _0x959e63[_0x4edd('0x29')](_0x4edd('0x2a'),_0x5c8b50+'-'+_0x56176e+'/'+_0x51dc97)[_0x4edd('0x26')](_0x4e7fb4);}return null;};}function patchUpdates(_0x186672){return function(_0x317b2e){try{jsonpatch[_0x4edd('0x2b')](_0x317b2e,_0x186672,!![]);}catch(_0x427e2d){return BPromise['reject'](_0x427e2d);}return _0x317b2e[_0x4edd('0x2c')]();};}function saveUpdates(_0xb3b068,_0x43500b){return function(_0x5bedab){if(_0x5bedab){return _0x5bedab[_0x4edd('0x2d')](_0xb3b068)[_0x4edd('0x17')](function(_0x2896b8){return _0x2896b8;});}return null;};}function removeEntity(_0x5075a6,_0x317412){return function(_0x34dc9f){if(_0x34dc9f){return _0x34dc9f['destroy']()[_0x4edd('0x17')](function(){_0x5075a6['status'](0xcc)[_0x4edd('0x25')]();});}};}function handleEntityNotFound(_0x343716,_0x499c46){return function(_0x8fc7f0){if(!_0x8fc7f0){_0x343716['sendStatus'](0x194);}return _0x8fc7f0;};}function handleError(_0x55b9db,_0x101c45){_0x101c45=_0x101c45||0x1f4;return function(_0x1569a1){logger[_0x4edd('0x1d')](_0x1569a1[_0x4edd('0x2e')]);if(_0x1569a1[_0x4edd('0x2f')]){delete _0x1569a1[_0x4edd('0x2f')];}_0x55b9db[_0x4edd('0x24')](_0x101c45)[_0x4edd('0x30')](_0x1569a1);};}exports[_0x4edd('0x31')]=function(_0x5328b5,_0x204ee9){var _0x2bd47a={},_0x1fe867={},_0x33b1ff={'count':0x0,'rows':[]};var _0x24f3d8=db[_0x4edd('0x32')][_0x4edd('0x33')];_0x1fe867[_0x4edd('0x34')]=_['keys'](_0x24f3d8);var _0x1f18fb={'dateStart':_0x5328b5[_0x4edd('0x35')]['dateStart'],'dateEnd':_0x5328b5[_0x4edd('0x35')][_0x4edd('0x36')]};delete _0x5328b5[_0x4edd('0x35')]['dateStart'];delete _0x5328b5[_0x4edd('0x35')][_0x4edd('0x36')];_0x1fe867['query']=_[_0x4edd('0x37')](_0x5328b5[_0x4edd('0x35')]);_0x1fe867[_0x4edd('0x38')]=_['intersection'](_0x1fe867[_0x4edd('0x34')],_0x1fe867[_0x4edd('0x35')]);_0x2bd47a[_0x4edd('0x39')]=_[_0x4edd('0x3a')](_0x1fe867[_0x4edd('0x34')],qs[_0x4edd('0x3b')](_0x5328b5[_0x4edd('0x35')][_0x4edd('0x3b')]));_0x2bd47a[_0x4edd('0x39')]=_0x2bd47a[_0x4edd('0x39')][_0x4edd('0x3c')]?_0x2bd47a[_0x4edd('0x39')]:_0x1fe867[_0x4edd('0x34')];if(!_0x5328b5[_0x4edd('0x35')]['hasOwnProperty'](_0x4edd('0x3d'))){_0x2bd47a[_0x4edd('0x3e')]=qs[_0x4edd('0x3e')](_0x5328b5[_0x4edd('0x35')][_0x4edd('0x3e')]);_0x2bd47a['offset']=qs[_0x4edd('0x28')](_0x5328b5[_0x4edd('0x35')][_0x4edd('0x28')]);}_0x2bd47a['order']=qs[_0x4edd('0x3f')](_0x5328b5[_0x4edd('0x35')]['sort']);_0x2bd47a['where']=qs[_0x4edd('0x38')](_[_0x4edd('0x40')](_0x5328b5[_0x4edd('0x35')],_0x1fe867['filters']));if(_0x1f18fb['dateStart']){if(_0x1f18fb[_0x4edd('0x36')]){_0x1f18fb['dateEnd']=moment(_0x1f18fb[_0x4edd('0x36')])['add'](0x1,_0x4edd('0x41'));}else{_0x1f18fb[_0x4edd('0x36')]=moment(_0x1f18fb['dateStart'])[_0x4edd('0x42')](0x1,_0x4edd('0x41'));}_['merge'](_0x2bd47a[_0x4edd('0x43')],{'createdAt':{'$gte':_0x1f18fb[_0x4edd('0x44')],'$lte':_0x1f18fb['dateEnd']}});}if(_0x5328b5['query'][_0x4edd('0x45')]){_0x2bd47a[_0x4edd('0x43')]=_[_0x4edd('0x46')](_0x2bd47a[_0x4edd('0x43')],{'$or':_[_0x4edd('0x47')](_0x2bd47a[_0x4edd('0x39')],function(_0x4a9101){var _0x1ef1fa={};_0x1ef1fa[_0x4a9101]={'$like':'%'+_0x5328b5[_0x4edd('0x35')][_0x4edd('0x45')]+'%'};return _0x1ef1fa;})});}_0x2bd47a=_[_0x4edd('0x46')]({},_0x2bd47a,_0x5328b5['options']);var _0x17a70d={'where':_0x2bd47a[_0x4edd('0x43')]};return db[_0x4edd('0x32')][_0x4edd('0x27')](_0x17a70d)[_0x4edd('0x17')](function(_0x5043a5){_0x33b1ff[_0x4edd('0x27')]=_0x5043a5;if(_0x5328b5[_0x4edd('0x35')][_0x4edd('0x48')]){_0x2bd47a[_0x4edd('0x49')]=[{'all':!![]}];}return db[_0x4edd('0x32')][_0x4edd('0x4a')](_0x2bd47a);})[_0x4edd('0x17')](function(_0x41a832){_0x33b1ff['rows']=_0x41a832;return _0x33b1ff;})[_0x4edd('0x17')](respondWithFilteredResult(_0x204ee9,_0x2bd47a))['catch'](handleError(_0x204ee9,null));};exports[_0x4edd('0x4b')]=function(_0x957bee,_0x517604){var _0x4fa3f7={'raw':![],'where':{'id':_0x957bee['params']['id']}},_0x29ae31={};_0x29ae31[_0x4edd('0x34')]=_[_0x4edd('0x37')](db['ChatWebsite'][_0x4edd('0x33')]);_0x29ae31[_0x4edd('0x35')]=_[_0x4edd('0x37')](_0x957bee['query']);_0x29ae31['filters']=_['intersection'](_0x29ae31['model'],_0x29ae31[_0x4edd('0x35')]);_0x4fa3f7[_0x4edd('0x39')]=_[_0x4edd('0x3a')](_0x29ae31['model'],qs[_0x4edd('0x3b')](_0x957bee[_0x4edd('0x35')]['fields']));_0x4fa3f7[_0x4edd('0x39')]=_0x4fa3f7[_0x4edd('0x39')][_0x4edd('0x3c')]?_0x4fa3f7[_0x4edd('0x39')]:_0x29ae31[_0x4edd('0x34')];if(_0x957bee['query'][_0x4edd('0x48')]){_0x4fa3f7[_0x4edd('0x49')]=[{'all':!![]}];}_0x4fa3f7=_[_0x4edd('0x46')]({},_0x4fa3f7,_0x957bee[_0x4edd('0x4c')]);return db[_0x4edd('0x32')][_0x4edd('0x4d')](_0x4fa3f7)[_0x4edd('0x17')](handleEntityNotFound(_0x517604,null))[_0x4edd('0x17')](respondWithResult(_0x517604,null))[_0x4edd('0x22')](handleError(_0x517604,null));};exports[_0x4edd('0x4e')]=function(_0x3463eb,_0x3f1e89){return db[_0x4edd('0x32')]['create'](_0x3463eb[_0x4edd('0x4f')],{})[_0x4edd('0x17')](respondWithResult(_0x3f1e89,0xc9))['catch'](handleError(_0x3f1e89,null));};exports['update']=function(_0xeff89e,_0x14e49f){if(_0xeff89e[_0x4edd('0x4f')]['id']){delete _0xeff89e[_0x4edd('0x4f')]['id'];}return db[_0x4edd('0x32')][_0x4edd('0x4d')]({'where':{'id':_0xeff89e[_0x4edd('0x50')]['id']}})[_0x4edd('0x17')](handleEntityNotFound(_0x14e49f,null))[_0x4edd('0x17')](saveUpdates(_0xeff89e['body'],null))[_0x4edd('0x17')](respondWithResult(_0x14e49f,null))[_0x4edd('0x22')](handleError(_0x14e49f,null));};exports['destroy']=function(_0x50e0a1,_0x4b2344){return db[_0x4edd('0x32')]['find']({'where':{'id':_0x50e0a1[_0x4edd('0x50')]['id']}})[_0x4edd('0x17')](handleEntityNotFound(_0x4b2344,null))[_0x4edd('0x17')](removeEntity(_0x4b2344,null))[_0x4edd('0x22')](handleError(_0x4b2344,null));};exports['describe']=function(_0x96858,_0x29947b){return db[_0x4edd('0x32')]['describe']()[_0x4edd('0x17')](respondWithResult(_0x29947b,null))[_0x4edd('0x22')](handleError(_0x29947b,null));};exports['addDisposition']=function(_0x158115,_0x1fe5f4,_0x4ac82d){if(_0x158115['body']['id']){delete _0x158115[_0x4edd('0x4f')]['id'];}return db['ChatWebsite'][_0x4edd('0x4d')]({'where':{'id':_0x158115[_0x4edd('0x50')]['id']}})[_0x4edd('0x17')](handleEntityNotFound(_0x1fe5f4,null))['then'](function(_0x217205){if(_0x217205){_0x158115[_0x4edd('0x4f')][_0x4edd('0x51')]=_0x217205['id'];return db[_0x4edd('0x52')][_0x4edd('0x4e')](_0x158115[_0x4edd('0x4f')]);}})[_0x4edd('0x17')](respondWithResult(_0x1fe5f4,null))['catch'](handleError(_0x1fe5f4,null));};exports[_0x4edd('0x53')]=function(_0x49074c,_0x30f4f5,_0x116e10){var _0x4d5ab9={'raw':![],'where':{}};var _0x1ed27a={};var _0x520880={'count':0x0,'rows':[]};return db[_0x4edd('0x32')][_0x4edd('0x54')]({'where':{'id':_0x49074c[_0x4edd('0x50')]['id']}})[_0x4edd('0x17')](handleEntityNotFound(_0x30f4f5,null))[_0x4edd('0x17')](function(_0x49a861){if(_0x49a861){_0x1ed27a[_0x4edd('0x34')]=_[_0x4edd('0x37')](db['Disposition'][_0x4edd('0x33')]);_0x1ed27a[_0x4edd('0x35')]=_[_0x4edd('0x37')](_0x49074c[_0x4edd('0x35')]);_0x1ed27a[_0x4edd('0x38')]=_[_0x4edd('0x3a')](_0x1ed27a[_0x4edd('0x34')],_0x1ed27a[_0x4edd('0x35')]);_0x4d5ab9[_0x4edd('0x39')]=_[_0x4edd('0x3a')](_0x1ed27a[_0x4edd('0x34')],qs[_0x4edd('0x3b')](_0x49074c['query'][_0x4edd('0x3b')]));_0x4d5ab9['attributes']=_0x4d5ab9['attributes'][_0x4edd('0x3c')]?_0x4d5ab9[_0x4edd('0x39')]:_0x1ed27a[_0x4edd('0x34')];if(!_0x49074c[_0x4edd('0x35')][_0x4edd('0x55')](_0x4edd('0x3d'))){_0x4d5ab9[_0x4edd('0x3e')]=qs[_0x4edd('0x3e')](_0x49074c[_0x4edd('0x35')][_0x4edd('0x3e')]);_0x4d5ab9['offset']=qs[_0x4edd('0x28')](_0x49074c[_0x4edd('0x35')][_0x4edd('0x28')]);}_0x4d5ab9[_0x4edd('0x56')]=qs['sort'](_0x49074c[_0x4edd('0x35')][_0x4edd('0x3f')]);_0x4d5ab9['where']=qs['filters'](_[_0x4edd('0x40')](_0x49074c[_0x4edd('0x35')],_0x1ed27a[_0x4edd('0x38')]));_0x4d5ab9[_0x4edd('0x43')][_0x4edd('0x51')]=_0x49a861['id'];if(_0x49074c[_0x4edd('0x35')][_0x4edd('0x45')]){_0x4d5ab9[_0x4edd('0x43')]=_['merge'](_0x4d5ab9['where'],{'$or':_[_0x4edd('0x47')](_0x4d5ab9[_0x4edd('0x39')],function(_0x41d684){var _0x4c5769={};_0x4c5769[_0x41d684]={'$like':'%'+_0x49074c[_0x4edd('0x35')][_0x4edd('0x45')]+'%'};return _0x4c5769;})});}_0x4d5ab9=_['merge']({},_0x4d5ab9,_0x49074c[_0x4edd('0x4c')]);return db[_0x4edd('0x52')][_0x4edd('0x27')]({'where':_0x4d5ab9['where']})[_0x4edd('0x17')](function(_0x534230){_0x520880['count']=_0x534230;if(_0x49074c[_0x4edd('0x35')][_0x4edd('0x48')]){_0x4d5ab9['include']=[{'all':!![]}];}return db[_0x4edd('0x52')][_0x4edd('0x4a')](_0x4d5ab9);})['then'](function(_0xbc807d){_0x520880[_0x4edd('0x57')]=_0xbc807d;return _0x520880;});}})[_0x4edd('0x17')](respondWithFilteredResult(_0x30f4f5,_0x4d5ab9))[_0x4edd('0x22')](handleError(_0x30f4f5,null));};exports[_0x4edd('0x58')]=function(_0x2e44de,_0x4368f8,_0x52f14f){var _0x55ec04;return db[_0x4edd('0x32')][_0x4edd('0x4d')]({'where':{'id':_0x2e44de[_0x4edd('0x50')]['id']}})[_0x4edd('0x17')](handleEntityNotFound(_0x4368f8,null))[_0x4edd('0x17')](function(_0x29fd61){if(_0x29fd61){return _0x29fd61[_0x4edd('0x58')](_0x2e44de[_0x4edd('0x35')][_0x4edd('0x59')]);}})[_0x4edd('0x17')](respondWithStatusCode(_0x4368f8,null))[_0x4edd('0x22')](handleError(_0x4368f8,null));};exports[_0x4edd('0x5a')]=function(_0x3664bf,_0x30c90e,_0x4b2778){if(_0x3664bf[_0x4edd('0x4f')]['id']){delete _0x3664bf[_0x4edd('0x4f')]['id'];}return db['ChatWebsite'][_0x4edd('0x4d')]({'where':{'id':_0x3664bf[_0x4edd('0x50')]['id']}})[_0x4edd('0x17')](handleEntityNotFound(_0x30c90e,null))[_0x4edd('0x17')](function(_0x327c77){if(_0x327c77){_0x3664bf[_0x4edd('0x4f')][_0x4edd('0x51')]=_0x327c77['id'];return db[_0x4edd('0x5b')]['create'](_0x3664bf[_0x4edd('0x4f')]);}})['then'](respondWithResult(_0x30c90e,null))[_0x4edd('0x22')](handleError(_0x30c90e,null));};exports[_0x4edd('0x5c')]=function(_0x33ab95,_0x4c27e5,_0x222801){var _0x9eea96={'raw':![],'where':{}};var _0x5174ca={};var _0x43a206={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4edd('0x54')]({'where':{'id':_0x33ab95['params']['id']}})[_0x4edd('0x17')](handleEntityNotFound(_0x4c27e5,null))[_0x4edd('0x17')](function(_0xa19cfc){if(_0xa19cfc){_0x5174ca[_0x4edd('0x34')]=_[_0x4edd('0x37')](db['CannedAnswer'][_0x4edd('0x33')]);_0x5174ca['query']=_['keys'](_0x33ab95['query']);_0x5174ca[_0x4edd('0x38')]=_[_0x4edd('0x3a')](_0x5174ca['model'],_0x5174ca[_0x4edd('0x35')]);_0x9eea96[_0x4edd('0x39')]=_[_0x4edd('0x3a')](_0x5174ca[_0x4edd('0x34')],qs[_0x4edd('0x3b')](_0x33ab95[_0x4edd('0x35')][_0x4edd('0x3b')]));_0x9eea96[_0x4edd('0x39')]=_0x9eea96[_0x4edd('0x39')]['length']?_0x9eea96[_0x4edd('0x39')]:_0x5174ca[_0x4edd('0x34')];if(!_0x33ab95[_0x4edd('0x35')][_0x4edd('0x55')](_0x4edd('0x3d'))){_0x9eea96[_0x4edd('0x3e')]=qs['limit'](_0x33ab95[_0x4edd('0x35')][_0x4edd('0x3e')]);_0x9eea96[_0x4edd('0x28')]=qs[_0x4edd('0x28')](_0x33ab95[_0x4edd('0x35')][_0x4edd('0x28')]);}_0x9eea96[_0x4edd('0x56')]=qs['sort'](_0x33ab95[_0x4edd('0x35')][_0x4edd('0x3f')]);_0x9eea96[_0x4edd('0x43')]=qs[_0x4edd('0x38')](_[_0x4edd('0x40')](_0x33ab95[_0x4edd('0x35')],_0x5174ca[_0x4edd('0x38')]));_0x9eea96[_0x4edd('0x43')]['ChatWebsiteId']=_0xa19cfc['id'];if(_0x33ab95['query'][_0x4edd('0x45')]){_0x9eea96['where']=_[_0x4edd('0x46')](_0x9eea96['where'],{'$or':_['map'](_0x9eea96[_0x4edd('0x39')],function(_0x24ee75){var _0x4e4ce0={};_0x4e4ce0[_0x24ee75]={'$like':'%'+_0x33ab95['query']['filter']+'%'};return _0x4e4ce0;})});}_0x9eea96=_['merge']({},_0x9eea96,_0x33ab95[_0x4edd('0x4c')]);return db[_0x4edd('0x5b')][_0x4edd('0x27')]({'where':_0x9eea96[_0x4edd('0x43')]})[_0x4edd('0x17')](function(_0x595c64){_0x43a206[_0x4edd('0x27')]=_0x595c64;if(_0x33ab95['query'][_0x4edd('0x48')]){_0x9eea96[_0x4edd('0x49')]=[{'all':!![]}];}return db[_0x4edd('0x5b')][_0x4edd('0x4a')](_0x9eea96);})[_0x4edd('0x17')](function(_0x115270){_0x43a206[_0x4edd('0x57')]=_0x115270;return _0x43a206;});}})[_0x4edd('0x17')](respondWithFilteredResult(_0x4c27e5,_0x9eea96))[_0x4edd('0x22')](handleError(_0x4c27e5,null));};exports[_0x4edd('0x5d')]=function(_0x521cb2,_0x3b4716,_0x4ef751){var _0x3932f3;return db[_0x4edd('0x32')][_0x4edd('0x4d')]({'where':{'id':_0x521cb2[_0x4edd('0x50')]['id']}})[_0x4edd('0x17')](handleEntityNotFound(_0x3b4716,null))[_0x4edd('0x17')](function(_0x3564f4){if(_0x3564f4){return _0x3564f4[_0x4edd('0x5d')](_0x521cb2['query'][_0x4edd('0x59')]);}})[_0x4edd('0x17')](respondWithStatusCode(_0x3b4716,null))[_0x4edd('0x22')](handleError(_0x3b4716,null));};exports[_0x4edd('0x5e')]=function(_0x41eef8,_0x55a072,_0x47a5c2){_0x41eef8['body'][_0x4edd('0x5f')]=_0x41eef8['file'][_0x4edd('0x60')];return db[_0x4edd('0x32')][_0x4edd('0x4d')]({'where':{'id':_0x41eef8[_0x4edd('0x50')]['id']}})[_0x4edd('0x17')](handleEntityNotFound(_0x55a072,null))[_0x4edd('0x17')](saveUpdates(_0x41eef8[_0x4edd('0x4f')],null))['then'](respondWithResult(_0x55a072,null))[_0x4edd('0x22')](handleError(_0x55a072,null));};exports[_0x4edd('0x61')]=function(_0x14ecc7,_0x3c790,_0xd144e3){_0x14ecc7[_0x4edd('0x4f')][_0x4edd('0x62')]=_0x14ecc7['file'][_0x4edd('0x60')];return db[_0x4edd('0x32')][_0x4edd('0x4d')]({'where':{'id':_0x14ecc7['params']['id']}})['then'](handleEntityNotFound(_0x3c790,null))['then'](saveUpdates(_0x14ecc7[_0x4edd('0x4f')],null))['then'](respondWithResult(_0x3c790,null))['catch'](handleError(_0x3c790,null));};exports[_0x4edd('0x63')]=function(_0x3f93b,_0x421d47,_0x93a57){_0x3f93b['body'][_0x4edd('0x64')]=_0x3f93b['file'][_0x4edd('0x60')];return db[_0x4edd('0x32')]['find']({'where':{'id':_0x3f93b['params']['id']}})[_0x4edd('0x17')](handleEntityNotFound(_0x421d47,null))[_0x4edd('0x17')](saveUpdates(_0x3f93b[_0x4edd('0x4f')],null))[_0x4edd('0x17')](respondWithResult(_0x421d47,null))['catch'](handleError(_0x421d47,null));};exports[_0x4edd('0x65')]=function(_0x374f10,_0x16d82f,_0x7bd191){_0x374f10[_0x4edd('0x4f')][_0x4edd('0x66')]=_0x374f10[_0x4edd('0x67')][_0x4edd('0x60')];return db[_0x4edd('0x32')][_0x4edd('0x4d')]({'where':{'id':_0x374f10[_0x4edd('0x50')]['id']}})[_0x4edd('0x17')](handleEntityNotFound(_0x16d82f,null))[_0x4edd('0x17')](saveUpdates(_0x374f10[_0x4edd('0x4f')],null))[_0x4edd('0x17')](respondWithResult(_0x16d82f,null))[_0x4edd('0x22')](handleError(_0x16d82f,null));};exports[_0x4edd('0x68')]=function(_0x4a92b0,_0x1b5562,_0x21c983){var _0x57cbcf=path[_0x4edd('0x69')](config[_0x4edd('0x6a')],_0x4edd('0x6b'));var _0x2acdfb={'where':{'id':_0x4a92b0[_0x4edd('0x50')]['id']},'attributes':['id',_0x4edd('0x5f')],'raw':!![]};var _0xbf4fa8=![];return require('../../config/license/util')[_0x4edd('0x6c')]()[_0x4edd('0x17')](function(_0x73f32c){if(_0x73f32c){_0xbf4fa8=_0x73f32c['custom'];}})[_0x4edd('0x17')](function(){return db['ChatWebsite'][_0x4edd('0x4d')](_0x2acdfb);})['then'](handleEntityNotFound(_0x1b5562,null))[_0x4edd('0x17')](function(_0x121f13){if(_0x121f13){if(!_[_0x4edd('0x6d')](_0x121f13[_0x4edd('0x5f')])){if(fs[_0x4edd('0x6e')](path[_0x4edd('0x69')](config[_0x4edd('0x6a')],'server/files/images/logos/',_0x121f13[_0x4edd('0x5f')]))&&_0xbf4fa8){_0x57cbcf=path[_0x4edd('0x69')](config['root'],_0x4edd('0x6f'),_0x121f13[_0x4edd('0x5f')]);}}return _0x1b5562[_0x4edd('0x70')](_0x57cbcf);}})[_0x4edd('0x22')](handleError(_0x1b5562,null));};exports['getAvatar']=function(_0x5ba4b9,_0x419063,_0x580698){var _0x594d4b=path[_0x4edd('0x69')](config[_0x4edd('0x6a')],'server/files/images/avatars/default_avatar.png');var _0x5e6b89={'where':{'id':_0x5ba4b9[_0x4edd('0x50')]['id']},'attributes':['id',_0x4edd('0x62')],'raw':!![]};return db[_0x4edd('0x32')][_0x4edd('0x4d')](_0x5e6b89)['then'](handleEntityNotFound(_0x419063,null))[_0x4edd('0x17')](function(_0xfa919b){if(_0xfa919b){if(!_[_0x4edd('0x6d')](_0xfa919b[_0x4edd('0x62')])){if(fs[_0x4edd('0x6e')](path[_0x4edd('0x69')](config[_0x4edd('0x6a')],_0x4edd('0x71'),_0xfa919b[_0x4edd('0x62')]))){_0x594d4b=path[_0x4edd('0x69')](config[_0x4edd('0x6a')],_0x4edd('0x71'),_0xfa919b[_0x4edd('0x62')]);}}return _0x419063[_0x4edd('0x70')](_0x594d4b);}})[_0x4edd('0x22')](handleError(_0x419063,null));};exports['getCustomerAvatar']=function(_0x1f5c1f,_0x10e978,_0x440708){var _0x9c3128=path['join'](config[_0x4edd('0x6a')],_0x4edd('0x72'));var _0x3ed948={'where':{'id':_0x1f5c1f[_0x4edd('0x50')]['id']},'attributes':['id',_0x4edd('0x64'),_0x4edd('0x73')],'raw':!![]};return db['ChatWebsite'][_0x4edd('0x4d')](_0x3ed948)[_0x4edd('0x17')](handleEntityNotFound(_0x10e978,null))[_0x4edd('0x17')](function(_0x262123){if(_0x262123){if(!_[_0x4edd('0x6d')](_0x262123[_0x4edd('0x64')])){if(fs[_0x4edd('0x6e')](path[_0x4edd('0x69')](config[_0x4edd('0x6a')],'server/files/images/avatars/',_0x262123[_0x4edd('0x64')]))&&_0x262123[_0x4edd('0x73')]){_0x9c3128=path[_0x4edd('0x69')](config[_0x4edd('0x6a')],_0x4edd('0x71'),_0x262123[_0x4edd('0x64')]);}}return _0x10e978[_0x4edd('0x70')](_0x9c3128);}})[_0x4edd('0x22')](handleError(_0x10e978,null));};exports['getSystemAvatar']=function(_0x2af43b,_0x30c8ed,_0x27ff52){var _0x3fb95d=path['join'](config['root'],_0x4edd('0x74'));var _0x45c5ec={'where':{'id':_0x2af43b[_0x4edd('0x50')]['id']},'attributes':['id',_0x4edd('0x66')],'raw':!![]};return db[_0x4edd('0x32')][_0x4edd('0x4d')](_0x45c5ec)[_0x4edd('0x17')](handleEntityNotFound(_0x30c8ed,null))[_0x4edd('0x17')](function(_0x2bcf25){if(_0x2bcf25){if(!_[_0x4edd('0x6d')](_0x2bcf25['systemAvatar'])){if(fs[_0x4edd('0x6e')](path[_0x4edd('0x69')](config['root'],'server/files/images/avatars/',_0x2bcf25[_0x4edd('0x66')]))){_0x3fb95d=path[_0x4edd('0x69')](config['root'],_0x4edd('0x71'),_0x2bcf25[_0x4edd('0x66')]);}}return _0x30c8ed[_0x4edd('0x70')](_0x3fb95d);}})[_0x4edd('0x22')](handleError(_0x30c8ed,null));};exports[_0x4edd('0x75')]=function(_0x3ee9e8,_0x1fd527,_0x1a9ce1){var _0x4de2c3=require('user-agent-parser');var _0x55cbda=new _0x4de2c3();var _0x468892=_0x55cbda[_0x4edd('0x76')](_0x3ee9e8[_0x4edd('0x77')][_0x4edd('0x78')])['getResult']();var _0x596075={'body':_0x3ee9e8[_0x4edd('0x4f')],'channel':'chat'};var _0x207b3c=[];var _0x438fc8=[];var _0x3ab8a1={};var _0x113bf8=![];return db[_0x4edd('0x79')][_0x4edd('0x7a')]()[_0x4edd('0x17')](function(_0x4681d4){if(!_0x4681d4){throw new db[(_0x4edd('0x7b'))][(_0x4edd('0x7c'))]('no\x20available\x20attributes');}_0x207b3c=_[_0x4edd('0x7d')](_[_0x4edd('0x37')](_0x4681d4),[_0x4edd('0x7e'),_0x4edd('0x7f')]);_0x438fc8=_[_0x4edd('0x7d')](_[_0x4edd('0x37')](_0x4681d4),['createdAt',_0x4edd('0x7f'),'CompanyId',_0x4edd('0x80')]);if(_0x3ee9e8['body']['id']){delete _0x3ee9e8[_0x4edd('0x4f')]['id'];}if(_[_0x4edd('0x6d')](_0x3ee9e8['body'][_0x4edd('0x81')])){throw new db[(_0x4edd('0x7b'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x4edd('0x6d')](_0x3ee9e8[_0x4edd('0x4f')][_0x4edd('0x4f')])||_0x3ee9e8[_0x4edd('0x4f')][_0x4edd('0x4f')]===''){throw new db[(_0x4edd('0x7b'))][(_0x4edd('0x7c'))](_0x4edd('0x82'));}if(_['isNil'](_0x3ee9e8[_0x4edd('0x4f')][_0x4edd('0x83')])){throw new db['Sequelize'][(_0x4edd('0x7c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x438fc8);}if(!_['includes'](_0x438fc8,_0x3ee9e8[_0x4edd('0x4f')][_0x4edd('0x83')])){throw new db[(_0x4edd('0x7b'))][(_0x4edd('0x7c'))](_0x4edd('0x84')+_0x438fc8);}_0x3ab8a1[_0x3ee9e8[_0x4edd('0x4f')][_0x4edd('0x83')]]=_0x3ee9e8[_0x4edd('0x4f')][_0x4edd('0x81')];})[_0x4edd('0x17')](function(){return db[_0x4edd('0x32')][_0x4edd('0x4d')]({'where':{'id':_0x3ee9e8[_0x4edd('0x50')]['id']},'include':[{'model':db[_0x4edd('0x85')],'as':_0x4edd('0x86'),'include':[{'model':db[_0x4edd('0x79')],'as':_0x4edd('0x87'),'where':_0x3ab8a1,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x4edd('0x88')],'as':_0x4edd('0x89')}]});})['then'](handleEntityNotFound(_0x1fd527,null))[_0x4edd('0x17')](function(_0x1e5f77){if(_0x1e5f77&&_0x1e5f77[_0x4edd('0x86')]){_0x596075['account']=_0x1e5f77;_0x596075[_0x4edd('0x8a')]=_0x1e5f77['Applications'];_0x596075[_0x4edd('0x8b')]=_0x1e5f77[_0x4edd('0x86')];_0x596075[_0x4edd('0x8a')]=_['orderBy'](_0x596075[_0x4edd('0x8a')],[_0x4edd('0x8c')],['asc']);if(_0x596075[_0x4edd('0x8d')]['Applications']){delete _0x596075[_0x4edd('0x8d')][_0x4edd('0x89')];}if(_0x596075[_0x4edd('0x8d')][_0x4edd('0x86')]&&_0x596075['account'][_0x4edd('0x86')][_0x4edd('0x87')][_0x4edd('0x3c')]){return _0x596075['account'][_0x4edd('0x86')][_0x4edd('0x87')][0x0];}var _0x49fcad=_[_0x4edd('0x8e')](_0x3ee9e8[_0x4edd('0x4f')],{'firstName':_0x3ee9e8['body']['from'],'ListId':_0x1e5f77['ListId']});_0x49fcad[_0x3ee9e8[_0x4edd('0x4f')][_0x4edd('0x83')]]=_0x3ee9e8[_0x4edd('0x4f')][_0x4edd('0x81')];return db['CmContact'][_0x4edd('0x4e')](_0x49fcad,{'fields':_0x207b3c,'raw':!![]});}})['then'](handleEntityNotFound(_0x1fd527,null))[_0x4edd('0x17')](function(_0x20976e){_0x596075[_0x4edd('0x8f')]=_0x20976e;if(_0x20976e){var _0x614041={'ContactId':_0x20976e['id'],'ChatWebsiteId':_0x3ee9e8[_0x4edd('0x50')]['id'],'from':(_0x20976e[_0x4edd('0x90')]||'')+'\x20'+(_0x20976e['lastName']||''),'customerIp':_0x3ee9e8[_0x4edd('0x4f')][_0x4edd('0x91')],'referer':_0x3ee9e8['body'][_0x4edd('0x92')],'browserName':_0x468892[_0x4edd('0x93')]['name']&&_0x468892['browser'][_0x4edd('0x94')]?util['format'](_0x4edd('0x95'),_0x468892[_0x4edd('0x93')][_0x4edd('0x2f')],_0x468892[_0x4edd('0x93')][_0x4edd('0x94')]):_0x4edd('0x96'),'browserVersion':_0x468892[_0x4edd('0x93')][_0x4edd('0x94')]||_0x4edd('0x96'),'osName':util[_0x4edd('0x97')](_0x4edd('0x95'),_0x468892['os']['name'],_0x468892['os'][_0x4edd('0x94')]),'osVersion':_0x468892['os'][_0x4edd('0x94')],'deviceModel':_0x468892[_0x4edd('0x98')][_0x4edd('0x34')]&&_0x468892['device'][_0x4edd('0x99')]?util[_0x4edd('0x97')](_0x4edd('0x9a'),_0x468892[_0x4edd('0x98')][_0x4edd('0x34')],_0x468892[_0x4edd('0x98')][_0x4edd('0x99')],_0x468892[_0x4edd('0x98')][_0x4edd('0x9b')]):null,'deviceVendor':_0x468892[_0x4edd('0x98')][_0x4edd('0x99')],'deviceType':_0x468892['device'][_0x4edd('0x9b')],'formData':JSON['stringify'](_0x3ee9e8[_0x4edd('0x4f')])};var _0x3d4c93={'ChatWebsiteId':_0x3ee9e8['params']['id'],'closed':![]};if(_0x3ee9e8[_0x4edd('0x4f')][_0x4edd('0x9c')]){_0x3d4c93[_0x4edd('0x9c')]=_0x3ee9e8[_0x4edd('0x4f')][_0x4edd('0x9c')];return db[_0x4edd('0x9d')][_0x4edd('0x4d')]({'where':_0x3d4c93})[_0x4edd('0x17')](function(_0x1cd25c){if(_0x1cd25c){return[_0x1cd25c,![]];}_0x614041[_0x4edd('0x9c')]=_0x3ee9e8[_0x4edd('0x4f')]['threadId'];_0x614041[_0x4edd('0x9e')]=_0x3ee9e8['body'][_0x4edd('0x9e')];return db[_0x4edd('0x9d')][_0x4edd('0x4e')](_0x614041)['then'](function(_0x5d12c1){return[_0x5d12c1,!![]];});});}_0x3d4c93['ContactId']=_0x20976e['id'];if(_0x3ee9e8[_0x4edd('0x4f')]['interaction']&&_0x3ee9e8[_0x4edd('0x4f')][_0x4edd('0x9f')]['id']){_0x3d4c93['id']=_0x3ee9e8[_0x4edd('0x4f')][_0x4edd('0x9f')]['id'];return db[_0x4edd('0x9d')][_0x4edd('0x4d')]({'where':_0x3d4c93})[_0x4edd('0x17')](function(_0x13b21f){if(_0x13b21f){return[_0x13b21f,![]];}return db[_0x4edd('0x9d')]['create'](_0x614041)['then'](function(_0x29a70e){return[_0x29a70e,!![]];});});}return db['ChatInteraction']['create'](_0x614041)[_0x4edd('0x17')](function(_0x15774a){return[_0x15774a,!![]];});}})[_0x4edd('0xa0')](function(_0x312080,_0x42eb2d){if(_0x312080){_0x113bf8=_0x42eb2d;if(!_0x42eb2d){return _0x312080[_0x4edd('0x2d')]({'from':(_0x596075[_0x4edd('0x8f')][_0x4edd('0x90')]||'')+'\x20'+(_0x596075[_0x4edd('0x8f')]['lastName']||'')});}else{return _0x312080;}}})[_0x4edd('0x17')](function(_0x4c6376){_0x596075[_0x4edd('0x9f')]=_0x4c6376[_0x4edd('0xa1')]({'plain':!![]});_0x596075[_0x4edd('0x9f')][_0x4edd('0xa2')]=_0x113bf8;if(_0x596075[_0x4edd('0x9f')]['created']){if(_0x596075[_0x4edd('0x8d')][_0x4edd('0xa3')]){_0x596075[_0x4edd('0x8a')][_0x4edd('0xa4')]({'id':0x0,'priority':_0x596075[_0x4edd('0x8a')][_0x4edd('0x3c')]+0x1,'app':'close','appdata':_0x4edd('0xa5'),'interval':'*,*,*,*'});}}return db[_0x4edd('0xa6')][_0x4edd('0x4e')]({'body':_0x3ee9e8[_0x4edd('0x4f')][_0x4edd('0x4f')],'ChatWebsiteId':_0x3ee9e8[_0x4edd('0x50')]['id'],'ChatInteractionId':_0x4c6376['id'],'direction':'in','ContactId':_0x596075[_0x4edd('0x8f')]['id'],'AttachmentId':_0x3ee9e8[_0x4edd('0x4f')][_0x4edd('0xa7')]});})[_0x4edd('0x17')](function(_0x271246){_0x596075[_0x4edd('0x20')]=_0x271246;if(_0x596075[_0x4edd('0x9f')][_0x4edd('0xa8')]){return db[_0x4edd('0xa9')]['find']({'attributes':['id','name'],'where':{'id':_0x596075['interaction']['UserId']}})[_0x4edd('0x17')](function(_0x4e9299){if(_0x4e9299){_0x596075[_0x4edd('0x8a')]['unshift']({'id':0x0,'priority':0x0,'app':_0x4edd('0xaa'),'appdata':_0x4e9299[_0x4edd('0x2f')]+','+(_0x596075[_0x4edd('0x8d')][_0x4edd('0xab')]||0xa),'interval':_0x4edd('0xac')});_0x596075[_0x4edd('0xad')]=!![];}return respondWithRpcPromise(_0x4edd('0xae'),'startRouting',_0x596075);});}return respondWithRpcPromise('Start',_0x4edd('0xaf'),_0x596075);})[_0x4edd('0x17')](function(_0x35f229){respondWithRpcPromise(_0x4edd('0xb0'),_0x4edd('0xb0'),{'event':_0x4edd('0x75'),'message':_0x35f229},client9002);return _0x35f229;})['then'](respondWithResult(_0x1fd527,null))[_0x4edd('0x22')](handleError(_0x1fd527,null));};exports['offline']=function(_0x12a018,_0x35a47a,_0x453de8){var _0x18fcca,_0x4336d5,_0x4e1434;var _0xa69c74=[];var _0x4a6a57=[];var _0x28481d={};return db[_0x4edd('0x79')][_0x4edd('0x7a')]()[_0x4edd('0x17')](function(_0x4260f5){if(!_0x4260f5){throw new db[(_0x4edd('0x7b'))][(_0x4edd('0x7c'))]('no\x20available\x20attributes');}_0x4a6a57=_[_0x4edd('0x7d')](_[_0x4edd('0x37')](_0x4260f5),[_0x4edd('0x7e'),_0x4edd('0x7f')]);_0xa69c74=_[_0x4edd('0x7d')](_[_0x4edd('0x37')](_0x4260f5),[_0x4edd('0x7e'),_0x4edd('0x7f'),'CompanyId',_0x4edd('0x80')]);if(_0x12a018[_0x4edd('0x4f')]['id']){delete _0x12a018[_0x4edd('0x4f')]['id'];}if(_[_0x4edd('0x6d')](_0x12a018[_0x4edd('0x4f')][_0x4edd('0x81')])){throw _0x35a47a[_0x4edd('0x24')](0x1f4)['send'](new db[(_0x4edd('0x7b'))]['ValidationError'](_0x4edd('0xb1')));}if(_[_0x4edd('0x6d')](_0x12a018[_0x4edd('0x4f')][_0x4edd('0x4f')])||_0x12a018[_0x4edd('0x4f')]['body']===''){throw _0x35a47a[_0x4edd('0x24')](0x1f4)[_0x4edd('0x30')](new db[(_0x4edd('0x7b'))][(_0x4edd('0x7c'))](_0x4edd('0x82')));}if(_[_0x4edd('0x6d')](_0x12a018[_0x4edd('0x4f')][_0x4edd('0xb2')])){throw _0x35a47a['status'](0x1f4)['send'](new db[(_0x4edd('0x7b'))][(_0x4edd('0x7c'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xa69c74));}if(!_[_0x4edd('0xb3')](_0xa69c74,_0x12a018['body'][_0x4edd('0xb2')])){throw _0x35a47a['status'](0x1f4)[_0x4edd('0x30')](new db['Sequelize'][(_0x4edd('0x7c'))](_0x4edd('0xb4')+_0xa69c74));}_0x28481d[_0x12a018[_0x4edd('0x4f')][_0x4edd('0xb2')]]=_0x12a018[_0x4edd('0x4f')][_0x4edd('0x81')];})[_0x4edd('0x17')](function(){return db['ChatWebsite'][_0x4edd('0x4d')]({'where':{'id':_0x12a018[_0x4edd('0x50')]['id']},'include':[{'model':db['CmList'],'as':_0x4edd('0x86')}]});})[_0x4edd('0x17')](handleEntityNotFound(_0x35a47a,null))[_0x4edd('0x17')](function(_0x3fbef2){if(_0x3fbef2&&_0x3fbef2['List']){_0x4336d5=_0x3fbef2;var _0x11babe=_[_0x4edd('0x8e')](_0x12a018['body'],{'firstName':_0x12a018['body'][_0x4edd('0x81')],'phone':_0x12a018['body']['from'],'ListId':_0x3fbef2['ListId']});_0x11babe[_0x12a018[_0x4edd('0x4f')][_0x4edd('0xb2')]]=_0x12a018['body'][_0x4edd('0x81')];return db[_0x4edd('0x79')][_0x4edd('0xb5')]({'where':_0x28481d,'defaults':_0x11babe});}})[_0x4edd('0xa0')](function(_0x5e4a78){if(_0x5e4a78){_0x4e1434=_0x5e4a78;var _0x3b8b05=fs['readFileSync'](path[_0x4edd('0x69')](config[_0x4edd('0x6a')],_0x4edd('0xb6')),_0x4edd('0xb7'));var _0x3f5fb4=ejs[_0x4edd('0xb8')](_0x3b8b05,{'body':_[_0x4edd('0xb9')](_0x12a018[_0x4edd('0x4f')][_0x4edd('0x4f')]),'bodyTitle':_0x4336d5['offlineMessageBody']});return db['ChatOfflineMessage']['create']({'body':_0x3f5fb4,'ContactId':_0x5e4a78['id'],'ChatWebsiteId':_0x4336d5['id']});}})[_0x4edd('0x17')](function(_0x2975a4){if(_0x2975a4){_0x18fcca=_0x2975a4;return db[_0x4edd('0xba')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x4edd('0xbb')],'as':_0x4edd('0xbc'),'raw':!![]}]});}})['then'](function(_0x4927f3){if(_0x4927f3&&_0x4927f3[_0x4edd('0xbc')]&&_0x4336d5[_0x4edd('0xbd')]){var _0x576428={'tls':{'rejectUnauthorized':![]}};if(_0x4927f3[_0x4edd('0xbc')][_0x4edd('0xbe')]){_0x576428[_0x4edd('0xbe')]=_0x4927f3[_0x4edd('0xbc')]['service'];}else{_0x576428[_0x4edd('0xbf')]=_0x4927f3[_0x4edd('0xbc')][_0x4edd('0xbf')];_0x576428[_0x4edd('0xc0')]=_0x4927f3['Smtp'][_0x4edd('0xc0')];_0x576428[_0x4edd('0xc1')]=_0x4927f3[_0x4edd('0xbc')][_0x4edd('0xc1')];}if(_0x4927f3[_0x4edd('0xbc')][_0x4edd('0xc2')]){_0x576428['auth']={'user':_0x4927f3['Smtp'][_0x4edd('0xc3')],'pass':_0x4927f3['Smtp'][_0x4edd('0xc4')]};}return respondWithRpcPromise('SendMail',_0x4edd('0xc5'),{'account':_0x576428,'message':{'from':util[_0x4edd('0x97')](_0x4edd('0xc6'),_0x4927f3[_0x4edd('0x2f')],_0x4927f3[_0x4edd('0xc7')]||_0x4927f3['Smtp']['user']),'to':_0x4336d5['forwardOfflineAddress'],'subject':_0x4336d5[_0x4edd('0xc8')],'text':_0x18fcca[_0x4edd('0x4f')]}},client9003)['then'](function(){return _0x18fcca;})['catch'](function(_0x31c905){console[_0x4edd('0x1d')](_0x31c905);});}})['then'](function(){if(_0x18fcca){return _0x18fcca;}})[_0x4edd('0x17')](respondWithResult(_0x35a47a,null))[_0x4edd('0x22')](handleError(_0x35a47a,null));};exports[_0x4edd('0xc9')]=function(_0x4a3675,_0x31d20d,_0x1487bd){return db['ChatInteraction'][_0x4edd('0x4d')]({'where':{'id':_0x4a3675[_0x4edd('0x50')]['id']}})[_0x4edd('0x17')](handleEntityNotFound(_0x31d20d,null))[_0x4edd('0x17')](function(_0x2fcd82){if(_0x2fcd82){return _0x2fcd82[_0x4edd('0xc9')](_0x4a3675[_0x4edd('0x4f')][_0x4edd('0x59')],_[_0x4edd('0xca')](_0x4a3675[_0x4edd('0x4f')],['ids','id'])||{});}})['then'](respondWithResult(_0x31d20d,null))[_0x4edd('0x22')](handleError(_0x31d20d,null));};exports['getInteractions']=function(_0xca79ed,_0x518f2e,_0x1132ea){var _0x225735={'raw':![],'where':{}};var _0x545b76={};var _0x1f7ad1={'count':0x0,'rows':[]};return db[_0x4edd('0x32')]['findOne']({'where':{'id':_0xca79ed[_0x4edd('0x50')]['id']}})['then'](handleEntityNotFound(_0x518f2e,null))['then'](function(_0x312025){if(_0x312025){_0x545b76[_0x4edd('0x34')]=_[_0x4edd('0x37')](db[_0x4edd('0x9d')][_0x4edd('0x33')]);_0x545b76[_0x4edd('0x35')]=_['keys'](_0xca79ed[_0x4edd('0x35')]);_0x545b76[_0x4edd('0x38')]=_['intersection'](_0x545b76['model'],_0x545b76[_0x4edd('0x35')]);_0x225735[_0x4edd('0x39')]=_[_0x4edd('0x3a')](_0x545b76['model'],qs[_0x4edd('0x3b')](_0xca79ed[_0x4edd('0x35')][_0x4edd('0x3b')]));_0x225735[_0x4edd('0x39')]=_0x225735[_0x4edd('0x39')][_0x4edd('0x3c')]?_0x225735[_0x4edd('0x39')]:_0x545b76['model'];if(!_0xca79ed['query'][_0x4edd('0x55')](_0x4edd('0x3d'))){_0x225735['limit']=qs[_0x4edd('0x3e')](_0xca79ed['query'][_0x4edd('0x3e')]);_0x225735[_0x4edd('0x28')]=qs[_0x4edd('0x28')](_0xca79ed['query'][_0x4edd('0x28')]);}_0x225735[_0x4edd('0x56')]=qs[_0x4edd('0x3f')](_0xca79ed[_0x4edd('0x35')]['sort']);_0x225735[_0x4edd('0x43')]=qs[_0x4edd('0x38')](_[_0x4edd('0x40')](_0xca79ed[_0x4edd('0x35')],_0x545b76[_0x4edd('0x38')]));_0x225735[_0x4edd('0x43')][_0x4edd('0x51')]=_0x312025['id'];if(_0xca79ed[_0x4edd('0x35')]['filter']){_0x225735[_0x4edd('0x43')]=_[_0x4edd('0x46')](_0x225735['where'],{'$or':_[_0x4edd('0x47')](_0x225735[_0x4edd('0x39')],function(_0x5e90c6){var _0x549249={};_0x549249[_0x5e90c6]={'$like':'%'+_0xca79ed[_0x4edd('0x35')]['filter']+'%'};return _0x549249;})});}_0x225735=_[_0x4edd('0x46')]({},_0x225735,_0xca79ed['options']);return db[_0x4edd('0x9d')][_0x4edd('0x27')]({'where':_0x225735['where']})[_0x4edd('0x17')](function(_0x3fe0ba){_0x1f7ad1[_0x4edd('0x27')]=_0x3fe0ba;if(_0xca79ed[_0x4edd('0x35')][_0x4edd('0x48')]){_0x225735[_0x4edd('0x49')]=[{'model':db['CmContact'],'as':_0x4edd('0xcb'),'required':![]},{'model':db[_0x4edd('0xa9')],'as':_0x4edd('0xcc'),'attributes':[_0x4edd('0x2f'),_0x4edd('0xcd'),_0x4edd('0xce')],'required':![]},{'model':db[_0x4edd('0xcf')],'as':'Tags','attributes':['id',_0x4edd('0x2f'),'color'],'where':_0xca79ed['query']['tag']?{'id':_0xca79ed[_0x4edd('0x35')][_0x4edd('0xd0')]}:undefined,'required':_0xca79ed[_0x4edd('0x35')]['tag']?!![]:![]}];}return db[_0x4edd('0x9d')][_0x4edd('0x4a')](_0x225735);})[_0x4edd('0x17')](function(_0x36fb3c){_0x1f7ad1[_0x4edd('0x57')]=_0x36fb3c;return _0x1f7ad1;});}})['then'](respondWithFilteredResult(_0x518f2e,_0x225735))['catch'](handleError(_0x518f2e,null));};function iftimePromise(_0x48d492,_0x18add9){return respondWithRpcPromise('Command',_0x4edd('0xd1'),{'command':_0x18add9[_0x4edd('0xd2')]?util[_0x4edd('0x97')](_0x4edd('0xd3'),_0x48d492[_0x4edd('0xd4')],_0x18add9['timezone']):util[_0x4edd('0x97')](_0x4edd('0xd5'),_0x48d492[_0x4edd('0xd4')])},client9002)[_0x4edd('0x17')](function(_0x509133){var _0x4c496f=_0x509133&&_0x509133['indexOf'](_0x4edd('0xd6'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x18add9['id'],_0x48d492['id'],_0x48d492['interval'],_0x4c496f?_0x4edd('0xd7'):'OFFLINE',_0x18add9[_0x4edd('0xd2')]?_0x18add9[_0x4edd('0xd2')]:_0x4edd('0xd8'));return _0x4c496f;})[_0x4edd('0x22')](function(_0x5c28f5){logger[_0x4edd('0x1d')](_0x4edd('0xd9'),_0x18add9['id'],_0x48d492['id'],_0x48d492[_0x4edd('0xd4')],util['inspect'](_0x5c28f5,{'showHidden':![],'depth':null}),_0x18add9[_0x4edd('0xd2')]?_0x18add9[_0x4edd('0xd2')]:_0x4edd('0xd8'));return![];});}exports[_0x4edd('0xd1')]=function(_0x3b4332,_0x219f85,_0x12a57c){var _0x1d2113=0x0;var _0x3f2f6c=0x0;var _0x234ac3=![];var _0x200b01;var _0x1f9d79;return db[_0x4edd('0x32')]['find']({'where':{'id':_0x3b4332[_0x4edd('0x50')]['id']},'include':[{'model':db[_0x4edd('0xda')],'as':_0x4edd('0xda'),'include':[{'model':db[_0x4edd('0xda')],'as':_0x4edd('0xdb'),'attributes':['id',_0x4edd('0xd4')],'raw':!![]}]}]})[_0x4edd('0x17')](handleEntityNotFound(_0x219f85,null))['then'](function(_0x1b7e41){if(_0x1b7e41){_0x200b01=_0x1b7e41;return _0x1b7e41[_0x4edd('0xdc')]({'raw':!![]});}})[_0x4edd('0x17')](function(_0x494bfc){if(_0x200b01){if(_0x494bfc){_0x1f9d79=_0x494bfc;}}return require(_0x4edd('0xdd'))[_0x4edd('0x6c')]();})[_0x4edd('0x17')](function(_0x442865){if(_0x442865){_0x3f2f6c=_0x442865[_0x4edd('0xde')];_0x234ac3=_0x442865[_0x4edd('0xdf')];}})[_0x4edd('0x17')](function(){return db[_0x4edd('0x9d')][_0x4edd('0x27')]({'where':{'closed':![]}});})['then'](function(_0x4f314c){_0x1d2113=_0x4f314c;if(_0x3f2f6c&&_0x4f314c>_0x3f2f6c){return db[_0x4edd('0xe0')][_0x4edd('0x54')]({'where':{'id':0x1}})['then'](function(_0x3ece8c){if(_0x3ece8c){_0x3ece8c[_0x4edd('0xe1')]('chatLicenseExceeded');}});}})[_0x4edd('0x17')](function(){if(_0x200b01[_0x4edd('0xda')]&&_0x200b01[_0x4edd('0xda')][_0x4edd('0xdb')]){var _0x5997cb=[];for(var _0x121352=0x0;_0x121352<_0x200b01[_0x4edd('0xda')][_0x4edd('0xdb')][_0x4edd('0x3c')];_0x121352++){var _0x3d11d9=_0x200b01[_0x4edd('0xda')][_0x4edd('0xdb')][_0x121352][_0x4edd('0xa1')]({'plain':!![]});_0x5997cb[_0x4edd('0xa4')](iftimePromise(_0x3d11d9,_0x200b01));}return BPromise[_0x4edd('0xe2')](_0x5997cb)['then'](function(_0x306aa9){return _[_0x4edd('0xe3')](_0x306aa9);});}else{return!![];}})['then'](function(_0x17d300){var _0x53785f=fs[_0x4edd('0xe4')](path[_0x4edd('0x69')](config[_0x4edd('0x6a')],_0x4edd('0xe5')),'utf8');var _0x4f37f8={'remote':_0x200b01['remote'],'query':querystring[_0x4edd('0x1c')](_[_0x4edd('0x46')](_0x200b01['get']({'plain':!![]}),{'customerIp':_0x3b4332[_0x4edd('0x77')][_0x4edd('0xe6')]||_0x3b4332[_0x4edd('0x77')]['x-real-ip']||_0x3b4332[_0x4edd('0xe7')]['remoteAddress']||_0x3b4332['ip'],'referer':_0x3b4332[_0x4edd('0x77')]['referer'],'openedInteractions':_0x1d2113,'maxInteractions':_0x3f2f6c,'virtual':_0x234ac3[_0x4edd('0xde')],'online':_0x17d300,'custom':_0x234ac3}))[_0x4edd('0xe8')](/'/g,'\x5c\x27')};_0x219f85[_0x4edd('0x30')](ejs[_0x4edd('0xb8')](Mustache['render'](_0x53785f,_0x4f37f8),{'proactiveActions':_0x1f9d79,'alignment':_0x200b01['alignment'],'verticalAlignment':_0x200b01[_0x4edd('0xe9')]}));})['catch'](handleError(_0x219f85,null));};exports[_0x4edd('0xea')]=function(_0x160359,_0x1f007c,_0xb30578){return db[_0x4edd('0x32')]['findOne']({'where':{'id':_0x160359['params']['id']}})[_0x4edd('0x17')](handleEntityNotFound(_0x1f007c,null))[_0x4edd('0x17')](function(_0x228ca3){if(_0x228ca3){return db[_0x4edd('0xeb')][_0x4edd('0xec')](function(_0x540b44){return db[_0x4edd('0x88')][_0x4edd('0xed')]({'where':{'ChatWebsiteId':_0x160359[_0x4edd('0x50')]['id']},'transaction':_0x540b44})['then'](function(_0x55b0fe){var _0x36a885=_['map'](_0x160359[_0x4edd('0x4f')],function(_0x2177a5){_0x2177a5[_0x4edd('0x51')]=_0x160359[_0x4edd('0x50')]['id'];return _0x2177a5;});return db[_0x4edd('0x88')]['bulkCreate'](_0x36a885,{'transaction':_0x540b44});});})[_0x4edd('0x17')](function(){return db[_0x4edd('0x88')][_0x4edd('0xee')]({'where':{'ChatWebsiteId':_0x160359['params']['id']},'order':_0x4edd('0x8c')});});}})[_0x4edd('0x17')](respondWithResult(_0x1f007c,null))[_0x4edd('0x22')](handleError(_0x1f007c,null));};exports[_0x4edd('0xef')]=function(_0x4d4136,_0x2c5ba6,_0x58fecf){var _0x1acfd2={};var _0x3db873={};var _0x5aee2f;var _0x4d7480;return db[_0x4edd('0x32')][_0x4edd('0x54')]({'where':{'id':_0x4d4136[_0x4edd('0x50')]['id']}})[_0x4edd('0x17')](handleEntityNotFound(_0x2c5ba6,null))['then'](function(_0x2382a8){if(_0x2382a8){_0x5aee2f=_0x2382a8;_0x3db873[_0x4edd('0x34')]=_[_0x4edd('0x37')](db[_0x4edd('0x88')][_0x4edd('0x33')]);_0x3db873[_0x4edd('0x35')]=_[_0x4edd('0x37')](_0x4d4136['query']);_0x3db873[_0x4edd('0x38')]=_[_0x4edd('0x3a')](_0x3db873[_0x4edd('0x34')],_0x3db873[_0x4edd('0x35')]);_0x1acfd2[_0x4edd('0x39')]=_[_0x4edd('0x3a')](_0x3db873['model'],qs['fields'](_0x4d4136[_0x4edd('0x35')][_0x4edd('0x3b')]));_0x1acfd2[_0x4edd('0x39')]=_0x1acfd2[_0x4edd('0x39')]['length']?_0x1acfd2[_0x4edd('0x39')]:_0x3db873[_0x4edd('0x34')];_0x1acfd2[_0x4edd('0x56')]=qs['sort'](_0x4d4136['query'][_0x4edd('0x3f')]);_0x1acfd2[_0x4edd('0x43')]=qs[_0x4edd('0x38')](_[_0x4edd('0x40')](_0x4d4136[_0x4edd('0x35')],_0x3db873['filters']));if(_0x4d4136['query'][_0x4edd('0x45')]){_0x1acfd2['where']=_[_0x4edd('0x46')](_0x1acfd2['where'],{'$or':_[_0x4edd('0x47')](_0x1acfd2['attributes'],function(_0x3e2a30){var _0x53c417={};_0x53c417[_0x3e2a30]={'$like':'%'+_0x4d4136[_0x4edd('0x35')]['filter']+'%'};return _0x53c417;})});}_0x1acfd2=_['merge']({},_0x1acfd2,_0x4d4136[_0x4edd('0x4c')]);return _0x5aee2f['getApplications'](_0x1acfd2);}})[_0x4edd('0x17')](function(_0x320d33){if(_0x320d33){_0x4d7480=_0x320d33[_0x4edd('0x3c')];if(!_0x4d4136[_0x4edd('0x35')]['hasOwnProperty'](_0x4edd('0x3d'))){_0x1acfd2[_0x4edd('0x3e')]=qs[_0x4edd('0x3e')](_0x4d4136[_0x4edd('0x35')][_0x4edd('0x3e')]);_0x1acfd2['offset']=qs[_0x4edd('0x28')](_0x4d4136[_0x4edd('0x35')]['offset']);}return _0x5aee2f[_0x4edd('0xef')](_0x1acfd2);}})['then'](function(_0x436f14){if(_0x436f14){return _0x436f14?{'count':_0x4d7480,'rows':_0x436f14}:null;}})[_0x4edd('0x17')](respondWithResult(_0x2c5ba6,null))[_0x4edd('0x22')](handleError(_0x2c5ba6,null));};exports[_0x4edd('0xf0')]=function(_0x411950,_0x1a1411,_0x553285){return db[_0x4edd('0xf1')][_0x4edd('0x4d')]({'where':{'id':_0x411950[_0x4edd('0x50')]['id']}})[_0x4edd('0x17')](handleEntityNotFound(_0x1a1411,null))[_0x4edd('0x17')](function(_0x15214f){if(_0x15214f){return _0x15214f['addProactiveActions'](_0x411950[_0x4edd('0x4f')][_0x4edd('0x59')],_[_0x4edd('0xca')](_0x411950[_0x4edd('0x4f')],[_0x4edd('0x59'),'id'])||{});}})[_0x4edd('0x17')](respondWithResult(_0x1a1411,null))[_0x4edd('0x22')](handleError(_0x1a1411,null));};exports[_0x4edd('0xdc')]=function(_0x580968,_0x17ba1e,_0x334a88){var _0x43bfcd={};var _0x24cd10={};var _0x36565b;var _0x444e86;return db[_0x4edd('0x32')][_0x4edd('0x54')]({'where':{'id':_0x580968[_0x4edd('0x50')]['id']}})[_0x4edd('0x17')](handleEntityNotFound(_0x17ba1e,null))['then'](function(_0x391953){if(_0x391953){_0x36565b=_0x391953;_0x24cd10[_0x4edd('0x34')]=_['keys'](db[_0x4edd('0xf2')][_0x4edd('0x33')]);_0x24cd10[_0x4edd('0x35')]=_[_0x4edd('0x37')](_0x580968[_0x4edd('0x35')]);_0x24cd10[_0x4edd('0x38')]=_['intersection'](_0x24cd10['model'],_0x24cd10['query']);_0x43bfcd[_0x4edd('0x39')]=_['intersection'](_0x24cd10[_0x4edd('0x34')],qs[_0x4edd('0x3b')](_0x580968['query'][_0x4edd('0x3b')]));_0x43bfcd['attributes']=_0x43bfcd[_0x4edd('0x39')][_0x4edd('0x3c')]?_0x43bfcd[_0x4edd('0x39')]:_0x24cd10['model'];_0x43bfcd['order']=qs[_0x4edd('0x3f')](_0x580968[_0x4edd('0x35')][_0x4edd('0x3f')]);_0x43bfcd[_0x4edd('0x43')]=qs[_0x4edd('0x38')](_[_0x4edd('0x40')](_0x580968[_0x4edd('0x35')],_0x24cd10['filters']));if(_0x580968[_0x4edd('0x35')]['filter']){_0x43bfcd[_0x4edd('0x43')]=_[_0x4edd('0x46')](_0x43bfcd[_0x4edd('0x43')],{'$or':_['map'](_0x43bfcd[_0x4edd('0x39')],function(_0x5cd944){var _0x5c28f0={};_0x5c28f0[_0x5cd944]={'$like':'%'+_0x580968['query'][_0x4edd('0x45')]+'%'};return _0x5c28f0;})});}_0x43bfcd=_[_0x4edd('0x46')]({},_0x43bfcd,_0x580968[_0x4edd('0x4c')]);return _0x36565b[_0x4edd('0xdc')](_0x43bfcd);}})[_0x4edd('0x17')](function(_0x10cc4b){if(_0x10cc4b){_0x444e86=_0x10cc4b[_0x4edd('0x3c')];if(!_0x580968['query'][_0x4edd('0x55')](_0x4edd('0x3d'))){_0x43bfcd['limit']=qs[_0x4edd('0x3e')](_0x580968[_0x4edd('0x35')][_0x4edd('0x3e')]);_0x43bfcd[_0x4edd('0x28')]=qs[_0x4edd('0x28')](_0x580968['query'][_0x4edd('0x28')]);}return _0x36565b['getProactiveActions'](_0x43bfcd);}})['then'](function(_0x960ea3){if(_0x960ea3){return _0x960ea3?{'count':_0x444e86,'rows':_0x960ea3}:null;}})[_0x4edd('0x17')](respondWithResult(_0x17ba1e,null))['catch'](handleError(_0x17ba1e,null));};exports[_0x4edd('0xf3')]=function(_0x2949c6,_0x2b7700,_0x4cafb4){var _0x25578b=_0x2949c6[_0x4edd('0x35')]['online']===_0x4edd('0xf4')?'offlineForm':'onlineForm';return db[_0x4edd('0x32')][_0x4edd('0x4d')]({'attributes':['id',_0x25578b],'where':{'id':_0x2949c6[_0x4edd('0x50')]['id']}})[_0x4edd('0x17')](handleEntityNotFound(_0x2b7700,null))['then'](function(_0x58bd49){if(_0x58bd49){var _0x2bfc1b=_0x58bd49[_0x25578b];var _0x574844=_0x2bfc1b&&_0x2bfc1b[_0x4edd('0xf5')]?_0x2bfc1b['items']:[];_0x2b7700[_0x4edd('0x30')]({'fromKey':_[_0x4edd('0x6d')](_0x2bfc1b[_0x4edd('0xf6')])?undefined:_0x2bfc1b[_0x4edd('0xf6')],'count':_0x574844[_0x4edd('0x3c')],'rows':_0x574844});}})[_0x4edd('0x22')](handleError(_0x2b7700,null));};exports['getOfflineMessages']=function(_0x183f65,_0x1bd018,_0x333235){var _0xb211e1={'raw':!![],'where':{}};var _0xddb623={};var _0x1cc894={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x183f65[_0x4edd('0x50')]['id']}})['then'](handleEntityNotFound(_0x1bd018,null))['then'](function(_0x4296a4){if(_0x4296a4){_0xddb623[_0x4edd('0x34')]=_['keys'](db[_0x4edd('0xf7')][_0x4edd('0x33')]);_0xddb623['query']=_[_0x4edd('0x37')](_0x183f65[_0x4edd('0x35')]);_0xddb623[_0x4edd('0x38')]=_[_0x4edd('0x3a')](_0xddb623['model'],_0xddb623[_0x4edd('0x35')]);_0xb211e1[_0x4edd('0x39')]=_[_0x4edd('0x3a')](_0xddb623[_0x4edd('0x34')],qs[_0x4edd('0x3b')](_0x183f65[_0x4edd('0x35')][_0x4edd('0x3b')]));_0xb211e1[_0x4edd('0x39')]=_0xb211e1[_0x4edd('0x39')][_0x4edd('0x3c')]?_0xb211e1[_0x4edd('0x39')]:_0xddb623[_0x4edd('0x34')];if(!_0x183f65[_0x4edd('0x35')][_0x4edd('0x55')](_0x4edd('0x3d'))){_0xb211e1[_0x4edd('0x3e')]=qs['limit'](_0x183f65['query'][_0x4edd('0x3e')]);_0xb211e1[_0x4edd('0x28')]=qs[_0x4edd('0x28')](_0x183f65[_0x4edd('0x35')]['offset']);}_0xb211e1[_0x4edd('0x56')]=qs[_0x4edd('0x3f')](_0x183f65[_0x4edd('0x35')][_0x4edd('0x3f')]);_0xb211e1[_0x4edd('0x43')]=qs['filters'](_['pick'](_0x183f65[_0x4edd('0x35')],_0xddb623['filters']));_0xb211e1[_0x4edd('0x43')]['ChatWebsiteId']=_0x4296a4['id'];if(_0x183f65['query'][_0x4edd('0x45')]){_0xb211e1['where']=_[_0x4edd('0x46')](_0xb211e1['where'],{'$or':_[_0x4edd('0x47')](_0xb211e1[_0x4edd('0x39')],function(_0x5c59dd){var _0x48c5ef={};_0x48c5ef[_0x5c59dd]={'$like':'%'+_0x183f65[_0x4edd('0x35')]['filter']+'%'};return _0x48c5ef;})});}_0xb211e1=_[_0x4edd('0x46')]({},_0xb211e1,_0x183f65[_0x4edd('0x4c')]);return db[_0x4edd('0xf7')][_0x4edd('0x27')]({'where':_0xb211e1[_0x4edd('0x43')]})[_0x4edd('0x17')](function(_0x18a6fe){_0x1cc894['count']=_0x18a6fe;if(_0x183f65['query'][_0x4edd('0x48')]){_0xb211e1[_0x4edd('0x49')]=[{'all':!![]}];}return db[_0x4edd('0xf7')]['findAll'](_0xb211e1);})[_0x4edd('0x17')](function(_0x257810){_0x1cc894[_0x4edd('0x57')]=_0x257810;return _0x1cc894;});}})[_0x4edd('0x17')](respondWithFilteredResult(_0x1bd018,_0xb211e1))[_0x4edd('0x22')](handleError(_0x1bd018,null));};exports[_0x4edd('0xf8')]=function(_0x3a3ee8,_0x3ef573,_0x4fe5f9){return db[_0x4edd('0x32')][_0x4edd('0x4d')]({'where':{'id':_0x3a3ee8[_0x4edd('0x50')]['id']}})[_0x4edd('0x17')](handleEntityNotFound(_0x3ef573,null))['then'](function(_0xe30ff){if(_0xe30ff){return _0xe30ff[_0x4edd('0xf8')](_0x3a3ee8['body']['ids'],_[_0x4edd('0xca')](_0x3a3ee8[_0x4edd('0x4f')],[_0x4edd('0x59'),'id'])||{})[_0x4edd('0xa0')](function(_0x5b9fec){for(var _0x4f8f2a=0x0;_0x4f8f2a<_0x3a3ee8[_0x4edd('0x4f')]['ids']['length'];_0x4f8f2a+=0x1){socket[_0x4edd('0xf9')](_0x4edd('0xfa'),{'UserId':_0x3a3ee8['body'][_0x4edd('0x59')][_0x4f8f2a],'ChatWebsiteId':_0x3a3ee8[_0x4edd('0x50')]['id']});}return _0x5b9fec;});}})[_0x4edd('0x17')](respondWithResult(_0x3ef573,null))[_0x4edd('0x22')](handleError(_0x3ef573,null));};exports['removeAgents']=function(_0x4a873d,_0x36815a,_0x520a03){var _0x3e2c05;return db[_0x4edd('0x32')][_0x4edd('0x4d')]({'where':{'id':_0x4a873d['params']['id']}})['then'](handleEntityNotFound(_0x36815a,null))[_0x4edd('0x17')](function(_0x58df43){if(_0x58df43){return _0x58df43[_0x4edd('0xfb')](_0x4a873d[_0x4edd('0x35')][_0x4edd('0x59')])[_0x4edd('0x17')](function(_0x462820){if(_[_0x4edd('0xfc')](_0x4a873d[_0x4edd('0x35')][_0x4edd('0x59')])){for(var _0x3bb9d9=0x0;_0x3bb9d9<_0x4a873d[_0x4edd('0x35')]['ids'][_0x4edd('0x3c')];_0x3bb9d9+=0x1){socket[_0x4edd('0xf9')](_0x4edd('0xfd'),{'UserId':_0x4a873d[_0x4edd('0x35')][_0x4edd('0x59')][_0x3bb9d9],'ChatWebsiteId':_0x4a873d[_0x4edd('0x50')]['id']});}}else{socket[_0x4edd('0xf9')]('userChatWebsite:remove',{'UserId':_0x4a873d[_0x4edd('0x35')][_0x4edd('0x59')],'ChatWebsiteId':_0x4a873d[_0x4edd('0x50')]['id']});}});}})[_0x4edd('0x17')](respondWithStatusCode(_0x36815a,null))[_0x4edd('0x22')](handleError(_0x36815a,null));};exports[_0x4edd('0xfe')]=function(_0x123404,_0x5c5b07,_0x562cd7){var _0x3dd3ca={};var _0x13f208={};var _0x44c658;var _0x11e124;return db[_0x4edd('0x32')]['findOne']({'where':{'id':_0x123404[_0x4edd('0x50')]['id']}})['then'](handleEntityNotFound(_0x5c5b07,null))[_0x4edd('0x17')](function(_0x186009){if(_0x186009){_0x44c658=_0x186009;_0x13f208[_0x4edd('0x34')]=_[_0x4edd('0x37')](db['User'][_0x4edd('0x33')]);_0x13f208['query']=_[_0x4edd('0x37')](_0x123404[_0x4edd('0x35')]);_0x13f208[_0x4edd('0x38')]=_[_0x4edd('0x3a')](_0x13f208[_0x4edd('0x34')],_0x13f208['query']);_0x3dd3ca[_0x4edd('0x39')]=_['intersection'](_0x13f208[_0x4edd('0x34')],qs[_0x4edd('0x3b')](_0x123404[_0x4edd('0x35')][_0x4edd('0x3b')]));_0x3dd3ca[_0x4edd('0x39')]=_0x3dd3ca[_0x4edd('0x39')][_0x4edd('0x3c')]?_0x3dd3ca[_0x4edd('0x39')]:_0x13f208['model'];_0x3dd3ca[_0x4edd('0x56')]=qs[_0x4edd('0x3f')](_0x123404[_0x4edd('0x35')]['sort']);_0x3dd3ca[_0x4edd('0x43')]=qs['filters'](_['pick'](_0x123404[_0x4edd('0x35')],_0x13f208[_0x4edd('0x38')]));if(_0x123404[_0x4edd('0x35')][_0x4edd('0x45')]){_0x3dd3ca[_0x4edd('0x43')]=_['merge'](_0x3dd3ca[_0x4edd('0x43')],{'$or':_[_0x4edd('0x47')](_0x3dd3ca['attributes'],function(_0x4719ae){var _0x45acc9={};_0x45acc9[_0x4719ae]={'$like':'%'+_0x123404[_0x4edd('0x35')][_0x4edd('0x45')]+'%'};return _0x45acc9;})});}_0x3dd3ca=_['merge']({},_0x3dd3ca,_0x123404[_0x4edd('0x4c')]);return _0x44c658[_0x4edd('0xfe')](_0x3dd3ca);}})[_0x4edd('0x17')](function(_0x4d8b81){if(_0x4d8b81){_0x11e124=_0x4d8b81['length'];if(!_0x123404[_0x4edd('0x35')]['hasOwnProperty'](_0x4edd('0x3d'))){_0x3dd3ca[_0x4edd('0x3e')]=qs[_0x4edd('0x3e')](_0x123404[_0x4edd('0x35')]['limit']);_0x3dd3ca[_0x4edd('0x28')]=qs[_0x4edd('0x28')](_0x123404[_0x4edd('0x35')][_0x4edd('0x28')]);}return _0x44c658[_0x4edd('0xfe')](_0x3dd3ca);}})['then'](function(_0xb59b81){if(_0xb59b81){return _0xb59b81?{'count':_0x11e124,'rows':_0xb59b81}:null;}})[_0x4edd('0x17')](respondWithResult(_0x5c5b07,null))[_0x4edd('0x22')](handleError(_0x5c5b07,null));};
\ No newline at end of file
index ee19d55..52adba3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd730=['exports','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x38782c,_0x5c9fef){var _0x3708bf=function(_0x595e13){while(--_0x595e13){_0x38782c['push'](_0x38782c['shift']());}};_0x3708bf(++_0x5c9fef);}(_0xd730,0xfd));var _0x0d73=function(_0x159bcb,_0x36be84){_0x159bcb=_0x159bcb-0x0;var _0x2783a4=_0xd730[_0x159bcb];return _0x2783a4;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x0d73('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0d73('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0d73('0x2'),'afterDestroy':'remove'};function emitEvent(_0x476846){return function(_0x44d213,_0x1c036c,_0x30e589){ChatWebsiteEvents['emit'](_0x476846+':'+_0x44d213['id'],_0x44d213);ChatWebsiteEvents[_0x0d73('0x3')](_0x476846,_0x44d213);_0x30e589(null);};}for(var e in events){if(events[_0x0d73('0x4')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x0d73('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x63b6=['hook','events','../../mysqldb','ChatWebsite','save','remove','emit'];(function(_0x2b42b2,_0x838da){var _0x5ce3d5=function(_0x44e026){while(--_0x44e026){_0x2b42b2['push'](_0x2b42b2['shift']());}};_0x5ce3d5(++_0x838da);}(_0x63b6,0x127));var _0x663b=function(_0x517845,_0x286435){_0x517845=_0x517845-0x0;var _0x26b15e=_0x63b6[_0x517845];return _0x26b15e;};'use strict';var EventEmitter=require(_0x663b('0x0'));var ChatWebsite=require(_0x663b('0x1'))['db'][_0x663b('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x663b('0x3'),'afterUpdate':'update','afterDestroy':_0x663b('0x4')};function emitEvent(_0x5d9f1d){return function(_0x93bab1,_0x3e2b4b,_0x2d84ca){ChatWebsiteEvents['emit'](_0x5d9f1d+':'+_0x93bab1['id'],_0x93bab1);ChatWebsiteEvents[_0x663b('0x5')](_0x5d9f1d,_0x93bab1);_0x2d84ca(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x663b('0x6')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
index 95c87c0..1c9a76d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['../../config/logger','api','moment','bluebird','request-promise','./chatWebsite.attributes','ChatWebsite','chat_websites'];(function(_0x469202,_0x4a928b){var _0x397097=function(_0x122cfb){while(--_0x122cfb){_0x469202['push'](_0x469202['shift']());}};_0x397097(++_0x4a928b);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var attributes=require(_0x49c4('0x5'));module['exports']=function(_0x4941f1,_0x41a183){return _0x4941f1['define'](_0x49c4('0x6'),attributes,{'tableName':_0x49c4('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x22dd=['../../config/logger','bluebird','request-promise','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util'];(function(_0x3eac08,_0x3b782f){var _0x35b8ac=function(_0x3449a3){while(--_0x3449a3){_0x3eac08['push'](_0x3eac08['shift']());}};_0x35b8ac(++_0x3b782f);}(_0x22dd,0xe4));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd22d('0x0'));var util=require(_0xd22d('0x1'));var logger=require(_0xd22d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd22d('0x3'));var rp=require(_0xd22d('0x4'));var attributes=require(_0xd22d('0x5'));module[_0xd22d('0x6')]=function(_0x26e4ba,_0x1c5cb2){return _0x26e4ba[_0xd22d('0x7')](_0xd22d('0x8'),attributes,{'tableName':_0xd22d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 24822bf..bd298ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6726=['ChatWebsite,\x20%s,\x20%s','result','catch','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','localhost','./chatWebsite.socket','register','request','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x48848d,_0x37778e){var _0x1e18f6=function(_0x2268bb){while(--_0x2268bb){_0x48848d['push'](_0x48848d['shift']());}};_0x1e18f6(++_0x37778e);}(_0x6726,0xdb));var _0x6672=function(_0x18d5d7,_0x19074b){_0x18d5d7=_0x18d5d7-0x0;var _0x30a9ea=_0x6726[_0x18d5d7];return _0x30a9ea;};'use strict';var _=require('lodash');var util=require(_0x6672('0x0'));var moment=require(_0x6672('0x1'));var BPromise=require('bluebird');var rs=require(_0x6672('0x2'));var fs=require('fs');var db=require(_0x6672('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6672('0x4'))('rpc');var config=require(_0x6672('0x5'));var jayson=require(_0x6672('0x6'));var client=jayson[_0x6672('0x7')][_0x6672('0x8')]({'port':0x232a});var socket=require('socket.io-emitter')({'host':_0x6672('0x9'),'port':0x18eb});require(_0x6672('0xa'))[_0x6672('0xb')](socket);function respondWithRpcPromise(_0x379b90,_0xc53855,_0x1d7f31){return new BPromise(function(_0x13add3,_0x3c093b){return client[_0x6672('0xc')](_0x379b90,_0x1d7f31)['then'](function(_0x32a0d6){logger[_0x6672('0xd')]('ChatWebsite,\x20%s,\x20%s',_0xc53855,_0x6672('0xe'));logger[_0x6672('0xf')](_0x6672('0x10'),_0xc53855,_0x6672('0xe'),JSON[_0x6672('0x11')](_0x32a0d6));if(_0x32a0d6[_0x6672('0x12')]){if(_0x32a0d6[_0x6672('0x12')][_0x6672('0x13')]===0x1f4){logger[_0x6672('0x12')]('ChatWebsite,\x20%s,\x20%s',_0xc53855,_0x32a0d6[_0x6672('0x12')][_0x6672('0x14')]);return _0x3c093b(_0x32a0d6[_0x6672('0x12')][_0x6672('0x14')]);}logger[_0x6672('0x12')](_0x6672('0x15'),_0xc53855,_0x32a0d6[_0x6672('0x12')]['message']);return _0x13add3(_0x32a0d6[_0x6672('0x12')][_0x6672('0x14')]);}else{logger[_0x6672('0xd')](_0x6672('0x15'),_0xc53855,_0x6672('0xe'));_0x13add3(_0x32a0d6[_0x6672('0x16')][_0x6672('0x14')]);}})[_0x6672('0x17')](function(_0x4e3fde){logger[_0x6672('0x12')](_0x6672('0x15'),_0xc53855,_0x4e3fde);_0x3c093b(_0x4e3fde);});});}
\ No newline at end of file
+var _0x47da=['request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s'];(function(_0x1072ec,_0x3eb08d){var _0x10e1a4=function(_0x4bad02){while(--_0x4bad02){_0x1072ec['push'](_0x1072ec['shift']());}};_0x10e1a4(++_0x3eb08d);}(_0x47da,0x104));var _0xa47d=function(_0x32463f,_0x36bc87){_0x32463f=_0x32463f-0x0;var _0x4b4b5e=_0x47da[_0x32463f];return _0x4b4b5e;};'use strict';var _=require(_0xa47d('0x0'));var util=require(_0xa47d('0x1'));var moment=require(_0xa47d('0x2'));var BPromise=require(_0xa47d('0x3'));var rs=require(_0xa47d('0x4'));var fs=require('fs');var db=require(_0xa47d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa47d('0x6'));var config=require(_0xa47d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa47d('0x8')][_0xa47d('0x9')]({'port':0x232a});var socket=require(_0xa47d('0xa'))({'host':'localhost','port':0x18eb});require(_0xa47d('0xb'))['register'](socket);function respondWithRpcPromise(_0x1fe717,_0x869c64,_0x20d6ab){return new BPromise(function(_0x158338,_0x41e678){return client[_0xa47d('0xc')](_0x1fe717,_0x20d6ab)[_0xa47d('0xd')](function(_0x3af755){logger[_0xa47d('0xe')](_0xa47d('0xf'),_0x869c64,_0xa47d('0x10'));logger['debug'](_0xa47d('0x11'),_0x869c64,_0xa47d('0x10'),JSON[_0xa47d('0x12')](_0x3af755));if(_0x3af755[_0xa47d('0x13')]){if(_0x3af755[_0xa47d('0x13')][_0xa47d('0x14')]===0x1f4){logger['error'](_0xa47d('0xf'),_0x869c64,_0x3af755[_0xa47d('0x13')][_0xa47d('0x15')]);return _0x41e678(_0x3af755['error']['message']);}logger[_0xa47d('0x13')](_0xa47d('0xf'),_0x869c64,_0x3af755[_0xa47d('0x13')][_0xa47d('0x15')]);return _0x158338(_0x3af755['error'][_0xa47d('0x15')]);}else{logger[_0xa47d('0xe')](_0xa47d('0xf'),_0x869c64,'request\x20sent');_0x158338(_0x3af755['result'][_0xa47d('0x15')]);}})[_0xa47d('0x16')](function(_0x40e4bc){logger[_0xa47d('0x13')](_0xa47d('0xf'),_0x869c64,_0x40e4bc);_0x41e678(_0x40e4bc);});});}
\ No newline at end of file
index a38bd85..ee2d290 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b84=['save','remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0xc2869e,_0x105457){var _0x243be2=function(_0x4876b6){while(--_0x4876b6){_0xc2869e['push'](_0xc2869e['shift']());}};_0x243be2(++_0x105457);}(_0x7b84,0x167));var _0x47b8=function(_0x4695d6,_0x3cbb84){_0x4695d6=_0x4695d6-0x0;var _0x10af48=_0x7b84[_0x4695d6];return _0x10af48;};'use strict';var ChatWebsiteEvents=require(_0x47b8('0x0'));var events=[_0x47b8('0x1'),_0x47b8('0x2'),'update'];function createListener(_0x5d208e,_0x1a9ebb){return function(_0x448f24){_0x1a9ebb[_0x47b8('0x3')](_0x5d208e,_0x448f24);};}function removeListener(_0x1db46b,_0x2a3dac){return function(){ChatWebsiteEvents[_0x47b8('0x4')](_0x1db46b,_0x2a3dac);};}exports[_0x47b8('0x5')]=function(_0x1072a8){for(var _0x172e57=0x0,_0x30c35b=events[_0x47b8('0x6')];_0x172e57<_0x30c35b;_0x172e57++){var _0x1ae3b6=events[_0x172e57];var _0x129a65=createListener(_0x47b8('0x7')+_0x1ae3b6,_0x1072a8);ChatWebsiteEvents['on'](_0x1ae3b6,_0x129a65);}};
\ No newline at end of file
+var _0xeeda=['remove','update','emit','removeListener','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x31a665,_0x3a29d9){var _0x8af70d=function(_0x21ecb2){while(--_0x21ecb2){_0x31a665['push'](_0x31a665['shift']());}};_0x8af70d(++_0x3a29d9);}(_0xeeda,0x1be));var _0xaeed=function(_0x37b10a,_0x1a6321){_0x37b10a=_0x37b10a-0x0;var _0x195ead=_0xeeda[_0x37b10a];return _0x195ead;};'use strict';var ChatWebsiteEvents=require(_0xaeed('0x0'));var events=[_0xaeed('0x1'),_0xaeed('0x2'),_0xaeed('0x3')];function createListener(_0x3caf44,_0x3749c9){return function(_0x37230b){_0x3749c9[_0xaeed('0x4')](_0x3caf44,_0x37230b);};}function removeListener(_0xba99c2,_0x423827){return function(){ChatWebsiteEvents[_0xaeed('0x5')](_0xba99c2,_0x423827);};}exports['register']=function(_0x5b9006){for(var _0x4209e7=0x0,_0x3841d9=events[_0xaeed('0x6')];_0x4209e7<_0x3841d9;_0x4209e7++){var _0xf1c97b=events[_0x4209e7];var _0x165e9c=createListener(_0xaeed('0x7')+_0xf1c97b,_0x5b9006);ChatWebsiteEvents['on'](_0xf1c97b,_0x165e9c);}};
\ No newline at end of file
index 511aee1..650552d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc5e=['addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','now','originalname','/:id/logo','single','addLogo','server/files/images/avatars/','format','file','addAvatar','addSystemAvatar','/:id/notify','notify','offline','addInteraction','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','describe','/:id','show','/:id/dispositions','isAuthenticated','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getAgents','post','addDisposition'];(function(_0xdcfc62,_0x1c9e6d){var _0x4ac936=function(_0x3d5763){while(--_0x3d5763){_0xdcfc62['push'](_0xdcfc62['shift']());}};_0x4ac936(++_0x1c9e6d);}(_0xbc5e,0xa0));var _0xebc5=function(_0xc54d7d,_0x1ab11b){_0xc54d7d=_0xc54d7d-0x0;var _0x3fee94=_0xbc5e[_0xc54d7d];return _0x3fee94;};'use strict';var multer=require(_0xebc5('0x0'));var util=require(_0xebc5('0x1'));var path=require(_0xebc5('0x2'));var express=require(_0xebc5('0x3'));var router=express['Router']();var auth=require(_0xebc5('0x4'));var interaction=require(_0xebc5('0x5'));var config=require(_0xebc5('0x6'));var controller=require(_0xebc5('0x7'));router[_0xebc5('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xebc5('0x9')]);router['get'](_0xebc5('0xa'),auth['isAuthenticated'](),controller[_0xebc5('0xb')]);router[_0xebc5('0x8')](_0xebc5('0xc'),auth[_0xebc5('0xd')](),controller['getDispositions']);router[_0xebc5('0x8')](_0xebc5('0xe'),auth[_0xebc5('0xd')](),controller[_0xebc5('0xf')]);router[_0xebc5('0x8')]('/:id/logo',controller[_0xebc5('0x10')]);router[_0xebc5('0x8')](_0xebc5('0x11'),controller[_0xebc5('0x12')]);router[_0xebc5('0x8')](_0xebc5('0x13'),controller[_0xebc5('0x14')]);router[_0xebc5('0x8')](_0xebc5('0x15'),controller[_0xebc5('0x16')]);router[_0xebc5('0x8')]('/:id/interactions',auth[_0xebc5('0xd')](),controller[_0xebc5('0x17')]);router['get'](_0xebc5('0x18'),controller[_0xebc5('0x19')]);router[_0xebc5('0x8')](_0xebc5('0x1a'),auth[_0xebc5('0xd')](),controller[_0xebc5('0x1b')]);router[_0xebc5('0x8')](_0xebc5('0x1c'),auth[_0xebc5('0xd')](),controller[_0xebc5('0x1d')]);router[_0xebc5('0x8')](_0xebc5('0x1e'),controller['getFields']);router[_0xebc5('0x8')](_0xebc5('0x1f'),auth[_0xebc5('0xd')](),controller['getOfflineMessages']);router[_0xebc5('0x8')]('/:id/users',auth[_0xebc5('0xd')](),controller[_0xebc5('0x20')]);router[_0xebc5('0x21')]('/',auth[_0xebc5('0xd')](),controller['create']);router[_0xebc5('0x21')](_0xebc5('0xc'),auth[_0xebc5('0xd')](),controller[_0xebc5('0x22')]);router[_0xebc5('0x21')](_0xebc5('0xe'),auth[_0xebc5('0xd')](),controller[_0xebc5('0x23')]);var upload=multer({'storage':multer[_0xebc5('0x24')]({'destination':function(_0x47d666,_0x1da0c9,_0x263d71){_0x263d71(null,path[_0xebc5('0x25')](config[_0xebc5('0x26')],_0xebc5('0x27')));},'filename':function(_0x1a2ef8,_0x2d00f2,_0x528111){_0x528111(null,util['format'](_0xebc5('0x28'),Date[_0xebc5('0x29')](),_0x2d00f2[_0xebc5('0x2a')]));}})});router[_0xebc5('0x21')](_0xebc5('0x2b'),upload[_0xebc5('0x2c')]('file'),controller[_0xebc5('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x14c099,_0x3f21d8,_0x5de2b5){_0x5de2b5(null,path[_0xebc5('0x25')](config['root'],_0xebc5('0x2e')));},'filename':function(_0x26ed8c,_0x660bcc,_0x2e8d9c){_0x2e8d9c(null,util[_0xebc5('0x2f')](_0xebc5('0x28'),Date[_0xebc5('0x29')](),_0x660bcc[_0xebc5('0x2a')]));}})});router[_0xebc5('0x21')](_0xebc5('0x11'),upload[_0xebc5('0x2c')](_0xebc5('0x30')),controller[_0xebc5('0x31')]);var upload=multer({'storage':multer[_0xebc5('0x24')]({'destination':function(_0x265af7,_0x3e1f96,_0x219b08){_0x219b08(null,path[_0xebc5('0x25')](config[_0xebc5('0x26')],_0xebc5('0x2e')));},'filename':function(_0x136c6e,_0x1c4454,_0x344af2){_0x344af2(null,util[_0xebc5('0x2f')](_0xebc5('0x28'),Date[_0xebc5('0x29')](),_0x1c4454[_0xebc5('0x2a')]));}})});router['post'](_0xebc5('0x13'),upload[_0xebc5('0x2c')](_0xebc5('0x30')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xebc5('0x24')]({'destination':function(_0x37b4e1,_0x4ae3d3,_0x10879a){_0x10879a(null,path['join'](config[_0xebc5('0x26')],_0xebc5('0x2e')));},'filename':function(_0x4e2166,_0x581b44,_0x1c21ff){_0x1c21ff(null,util[_0xebc5('0x2f')](_0xebc5('0x28'),Date[_0xebc5('0x29')](),_0x581b44[_0xebc5('0x2a')]));}})});router[_0xebc5('0x21')](_0xebc5('0x15'),upload['single'](_0xebc5('0x30')),controller[_0xebc5('0x32')]);router['post'](_0xebc5('0x33'),controller[_0xebc5('0x34')]);router['post']('/:id/offline',controller[_0xebc5('0x35')]);router[_0xebc5('0x21')]('/:id/interactions',auth[_0xebc5('0xd')](),controller[_0xebc5('0x36')]);router['post'](_0xebc5('0x1a'),auth[_0xebc5('0xd')](),controller['addApplications']);router['post'](_0xebc5('0x1c'),auth[_0xebc5('0xd')](),controller[_0xebc5('0x37')]);router[_0xebc5('0x21')]('/:id/users',auth[_0xebc5('0xd')](),controller[_0xebc5('0x38')]);router[_0xebc5('0x39')](_0xebc5('0xa'),auth['isAuthenticated'](),controller[_0xebc5('0x3a')]);router[_0xebc5('0x3b')](_0xebc5('0xa'),auth['isAuthenticated'](),controller[_0xebc5('0x3c')]);router[_0xebc5('0x3b')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xebc5('0x3d')]);router[_0xebc5('0x3b')](_0xebc5('0xe'),auth['isAuthenticated'](),controller[_0xebc5('0x3e')]);router[_0xebc5('0x3b')]('/:id/users',auth['isAuthenticated'](),controller[_0xebc5('0x3f')]);module[_0xebc5('0x40')]=router;
\ No newline at end of file
+var _0x423d=['index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','getAvatar','getCustomerAvatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','single','file','addLogo','diskStorage','server/files/images/avatars/','originalname','/:id/avatar','addAvatar','/:id/customer_avatar','/:id/offline','/:id/interactions','addInteraction','addProactiveActions','addAgents','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','express','Router','../../config/environment','./chatWebsite.controller','get'];(function(_0x4d23b5,_0x17767f){var _0x2b9819=function(_0x2b11df){while(--_0x2b11df){_0x4d23b5['push'](_0x4d23b5['shift']());}};_0x2b9819(++_0x17767f);}(_0x423d,0x74));var _0xd423=function(_0x1918ce,_0x4d8049){_0x1918ce=_0x1918ce-0x0;var _0x2554e4=_0x423d[_0x1918ce];return _0x2554e4;};'use strict';var multer=require(_0xd423('0x0'));var util=require(_0xd423('0x1'));var path=require(_0xd423('0x2'));var express=require(_0xd423('0x3'));var router=express[_0xd423('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd423('0x5'));var controller=require(_0xd423('0x6'));router[_0xd423('0x7')]('/',auth['isAuthenticated'](),controller[_0xd423('0x8')]);router[_0xd423('0x7')](_0xd423('0x9'),auth[_0xd423('0xa')](),controller[_0xd423('0xb')]);router[_0xd423('0x7')](_0xd423('0xc'),auth['isAuthenticated'](),controller[_0xd423('0xd')]);router[_0xd423('0x7')](_0xd423('0xe'),auth[_0xd423('0xa')](),controller[_0xd423('0xf')]);router[_0xd423('0x7')](_0xd423('0x10'),auth[_0xd423('0xa')](),controller['getAnswers']);router['get'](_0xd423('0x11'),controller[_0xd423('0x12')]);router['get']('/:id/avatar',controller[_0xd423('0x13')]);router[_0xd423('0x7')]('/:id/customer_avatar',controller[_0xd423('0x14')]);router[_0xd423('0x7')](_0xd423('0x15'),controller['getSystemAvatar']);router['get']('/:id/interactions',auth[_0xd423('0xa')](),controller[_0xd423('0x16')]);router[_0xd423('0x7')](_0xd423('0x17'),controller[_0xd423('0x18')]);router[_0xd423('0x7')](_0xd423('0x19'),auth[_0xd423('0xa')](),controller[_0xd423('0x1a')]);router[_0xd423('0x7')]('/:id/proactive_actions',auth[_0xd423('0xa')](),controller[_0xd423('0x1b')]);router[_0xd423('0x7')](_0xd423('0x1c'),controller['getFields']);router[_0xd423('0x7')](_0xd423('0x1d'),auth['isAuthenticated'](),controller[_0xd423('0x1e')]);router[_0xd423('0x7')](_0xd423('0x1f'),auth[_0xd423('0xa')](),controller[_0xd423('0x20')]);router[_0xd423('0x21')]('/',auth[_0xd423('0xa')](),controller[_0xd423('0x22')]);router[_0xd423('0x21')](_0xd423('0xe'),auth[_0xd423('0xa')](),controller[_0xd423('0x23')]);router[_0xd423('0x21')](_0xd423('0x10'),auth[_0xd423('0xa')](),controller[_0xd423('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2bd386,_0x5ee7d0,_0x48990d){_0x48990d(null,path[_0xd423('0x25')](config[_0xd423('0x26')],_0xd423('0x27')));},'filename':function(_0x5c384e,_0x200629,_0x3e7c7c){_0x3e7c7c(null,util[_0xd423('0x28')](_0xd423('0x29'),Date[_0xd423('0x2a')](),_0x200629['originalname']));}})});router[_0xd423('0x21')](_0xd423('0x11'),upload[_0xd423('0x2b')](_0xd423('0x2c')),controller[_0xd423('0x2d')]);var upload=multer({'storage':multer[_0xd423('0x2e')]({'destination':function(_0x48def2,_0x5aac60,_0x5d48d2){_0x5d48d2(null,path[_0xd423('0x25')](config[_0xd423('0x26')],_0xd423('0x2f')));},'filename':function(_0x13dd20,_0x1d91bb,_0x5d08ca){_0x5d08ca(null,util[_0xd423('0x28')](_0xd423('0x29'),Date[_0xd423('0x2a')](),_0x1d91bb[_0xd423('0x30')]));}})});router[_0xd423('0x21')](_0xd423('0x31'),upload[_0xd423('0x2b')](_0xd423('0x2c')),controller[_0xd423('0x32')]);var upload=multer({'storage':multer[_0xd423('0x2e')]({'destination':function(_0x489613,_0xce33c2,_0x409850){_0x409850(null,path['join'](config[_0xd423('0x26')],_0xd423('0x2f')));},'filename':function(_0x177004,_0x4e6ce1,_0x41742e){_0x41742e(null,util['format'](_0xd423('0x29'),Date['now'](),_0x4e6ce1[_0xd423('0x30')]));}})});router['post'](_0xd423('0x33'),upload['single'](_0xd423('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xd423('0x2e')]({'destination':function(_0x3da484,_0x18ebb0,_0x2c3ee3){_0x2c3ee3(null,path[_0xd423('0x25')](config[_0xd423('0x26')],_0xd423('0x2f')));},'filename':function(_0xdfac25,_0x485904,_0x3ec760){_0x3ec760(null,util[_0xd423('0x28')](_0xd423('0x29'),Date['now'](),_0x485904[_0xd423('0x30')]));}})});router[_0xd423('0x21')](_0xd423('0x15'),upload[_0xd423('0x2b')](_0xd423('0x2c')),controller['addSystemAvatar']);router['post']('/:id/notify',controller['notify']);router[_0xd423('0x21')](_0xd423('0x34'),controller['offline']);router[_0xd423('0x21')](_0xd423('0x35'),auth[_0xd423('0xa')](),controller[_0xd423('0x36')]);router['post']('/:id/applications',auth[_0xd423('0xa')](),controller['addApplications']);router[_0xd423('0x21')]('/:id/proactive_actions',auth[_0xd423('0xa')](),controller[_0xd423('0x37')]);router['post'](_0xd423('0x1f'),auth[_0xd423('0xa')](),controller[_0xd423('0x38')]);router['put'](_0xd423('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xd423('0x39')](_0xd423('0xc'),auth[_0xd423('0xa')](),controller[_0xd423('0x3a')]);router[_0xd423('0x39')](_0xd423('0xe'),auth['isAuthenticated'](),controller[_0xd423('0x3b')]);router[_0xd423('0x39')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xd423('0x3c')]);router[_0xd423('0x39')](_0xd423('0x1f'),auth[_0xd423('0xa')](),controller['removeAgents']);module[_0xd423('0x3d')]=router;
\ No newline at end of file
index 9ebf756..4561244 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb90=['exports','STRING'];(function(_0x2472ec,_0x92ec4b){var _0x4a5a0a=function(_0x5e117c){while(--_0x5e117c){_0x2472ec['push'](_0x2472ec['shift']());}};_0x4a5a0a(++_0x92ec4b);}(_0xdb90,0x198));var _0x0db9=function(_0x204a46,_0x428ae9){_0x204a46=_0x204a46-0x0;var _0xcd8d81=_0xdb90[_0x204a46];return _0xcd8d81;};'use strict';var Sequelize=require('sequelize');module[_0x0db9('0x0')]={'name':{'type':Sequelize[_0x0db9('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0db9('0x1')]},'companyId':{'type':Sequelize[_0x0db9('0x1')]},'website':{'type':Sequelize[_0x0db9('0x1')]},'phone':{'type':Sequelize[_0x0db9('0x1')]},'fax':{'type':Sequelize[_0x0db9('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x0db9('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0db9('0x1')]},'email':{'type':Sequelize[_0x0db9('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0db9('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x0db9('0x1')]},'sCountry':{'type':Sequelize[_0x0db9('0x1')]},'description':{'type':Sequelize[_0x0db9('0x1')]}};
\ No newline at end of file
+var _0x942a=['exports','STRING','sequelize'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x942a,0x197));var _0xa942=function(_0x3be0c4,_0x5b7eff){_0x3be0c4=_0x3be0c4-0x0;var _0x11af9f=_0x942a[_0x3be0c4];return _0x11af9f;};'use strict';var Sequelize=require(_0xa942('0x0'));module[_0xa942('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa942('0x2')]},'companyId':{'type':Sequelize[_0xa942('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xa942('0x2')]},'fax':{'type':Sequelize[_0xa942('0x2')]},'type':{'type':Sequelize[_0xa942('0x2')]},'street':{'type':Sequelize[_0xa942('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa942('0x2')]},'country':{'type':Sequelize[_0xa942('0x2')]},'email':{'type':Sequelize[_0xa942('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa942('0x2')]},'sStreet':{'type':Sequelize[_0xa942('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xa942('0x2')]},'sCountry':{'type':Sequelize[_0xa942('0x2')]},'description':{'type':Sequelize[_0xa942('0x2')]}};
\ No newline at end of file
index 0c71ceb..382a1d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33af=['create','body','addContacts','CmContact','ids','getContacts','findOne','map','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','limit','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','add','merge','where','filter','options','CmCompany','count','include','findAll','catch','show','params','includeAll','find'];(function(_0x74b262,_0x2f9383){var _0x3de84b=function(_0x55c9f0){while(--_0x55c9f0){_0x74b262['push'](_0x74b262['shift']());}};_0x3de84b(++_0x2f9383);}(_0x33af,0xec));var _0xf33a=function(_0x5a5ffb,_0x3aaf44){_0x5a5ffb=_0x5a5ffb-0x0;var _0x12d821=_0x33af[_0x5a5ffb];return _0x12d821;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf33a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf33a('0x1'));var jsonpatch=require(_0xf33a('0x2'));var rp=require(_0xf33a('0x3'));var moment=require(_0xf33a('0x4'));var BPromise=require(_0xf33a('0x5'));var Mustache=require(_0xf33a('0x6'));var util=require('util');var path=require(_0xf33a('0x7'));var sox=require(_0xf33a('0x8'));var csv=require('to-csv');var ejs=require(_0xf33a('0x9'));var fs=require('fs');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 qs=require(_0xf33a('0x11'));var logger=require(_0xf33a('0x12'))(_0xf33a('0x13'));var utils=require(_0xf33a('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31ccd8,_0xb47cde){_0xb47cde=_0xb47cde||0xcc;return function(_0x170468){if(_0x170468){return _0x31ccd8[_0xf33a('0x15')](_0xb47cde);}return _0x31ccd8[_0xf33a('0x16')](_0xb47cde)['end']();};}function respondWithResult(_0x9f87bc,_0x21b80e){_0x21b80e=_0x21b80e||0xc8;return function(_0x549978){if(_0x549978){return _0x9f87bc['status'](_0x21b80e)[_0xf33a('0x17')](_0x549978);}};}function respondWithFilteredResult(_0x1b3bf0,_0x17043){return function(_0x153bda){if(_0x153bda){var _0x1e9be2=_0x153bda['count'],_0xc01217=_0x17043[_0xf33a('0x18')],_0x45e311=_0x17043['offset']+_0x17043[_0xf33a('0x19')],_0x1f2b1b;if(_0x45e311>=_0x1e9be2){_0x45e311=_0x1e9be2;_0x1f2b1b=0xc8;}else{_0x1f2b1b=0xce;}_0x1b3bf0[_0xf33a('0x16')](_0x1f2b1b);return _0x1b3bf0['set'](_0xf33a('0x1a'),_0xc01217+'-'+_0x45e311+'/'+_0x1e9be2)[_0xf33a('0x17')](_0x153bda);}return null;};}function patchUpdates(_0x524109){return function(_0x2946ef){try{jsonpatch[_0xf33a('0x1b')](_0x2946ef,_0x524109,!![]);}catch(_0x38d69a){return BPromise[_0xf33a('0x1c')](_0x38d69a);}return _0x2946ef['save']();};}function saveUpdates(_0x11efa0,_0x366bda){return function(_0x2c295e){if(_0x2c295e){return _0x2c295e[_0xf33a('0x1d')](_0x11efa0)[_0xf33a('0x1e')](function(_0x6cdf7b){return _0x6cdf7b;});}return null;};}function removeEntity(_0x19986f,_0x288275){return function(_0x19055e){if(_0x19055e){return _0x19055e[_0xf33a('0x1f')]()['then'](function(){_0x19986f[_0xf33a('0x16')](0xcc)[_0xf33a('0x20')]();});}};}function handleEntityNotFound(_0x1bf9bc,_0x27faa1){return function(_0x2ab756){if(!_0x2ab756){_0x1bf9bc['sendStatus'](0x194);}return _0x2ab756;};}function handleError(_0x44654c,_0x5882ba){_0x5882ba=_0x5882ba||0x1f4;return function(_0x492986){logger[_0xf33a('0x21')](_0x492986[_0xf33a('0x22')]);if(_0x492986[_0xf33a('0x23')]){delete _0x492986[_0xf33a('0x23')];}_0x44654c['status'](_0x5882ba)[_0xf33a('0x24')](_0x492986);};}exports[_0xf33a('0x25')]=function(_0x5edf1a,_0x4af24a){var _0x16ef31={},_0x5f0a53={},_0x5cf981={'count':0x0,'rows':[]};var _0x38eba2=db['CmCompany'][_0xf33a('0x26')];_0x5f0a53['model']=_[_0xf33a('0x27')](_0x38eba2);var _0xdc2b34={'dateStart':_0x5edf1a[_0xf33a('0x28')][_0xf33a('0x29')],'dateEnd':_0x5edf1a[_0xf33a('0x28')][_0xf33a('0x2a')]};delete _0x5edf1a[_0xf33a('0x28')][_0xf33a('0x29')];delete _0x5edf1a[_0xf33a('0x28')][_0xf33a('0x2a')];_0x5f0a53[_0xf33a('0x28')]=_[_0xf33a('0x27')](_0x5edf1a[_0xf33a('0x28')]);_0x5f0a53[_0xf33a('0x2b')]=_[_0xf33a('0x2c')](_0x5f0a53['model'],_0x5f0a53[_0xf33a('0x28')]);_0x16ef31[_0xf33a('0x2d')]=_[_0xf33a('0x2c')](_0x5f0a53[_0xf33a('0x2e')],qs['fields'](_0x5edf1a[_0xf33a('0x28')][_0xf33a('0x2f')]));_0x16ef31[_0xf33a('0x2d')]=_0x16ef31[_0xf33a('0x2d')][_0xf33a('0x30')]?_0x16ef31[_0xf33a('0x2d')]:_0x5f0a53['model'];if(!_0x5edf1a[_0xf33a('0x28')][_0xf33a('0x31')](_0xf33a('0x32'))){_0x16ef31[_0xf33a('0x19')]=qs[_0xf33a('0x19')](_0x5edf1a['query']['limit']);_0x16ef31[_0xf33a('0x18')]=qs['offset'](_0x5edf1a['query']['offset']);}_0x16ef31[_0xf33a('0x33')]=qs[_0xf33a('0x34')](_0x5edf1a['query'][_0xf33a('0x34')]);_0x16ef31['where']=qs[_0xf33a('0x2b')](_[_0xf33a('0x35')](_0x5edf1a[_0xf33a('0x28')],_0x5f0a53[_0xf33a('0x2b')]));if(_0xdc2b34[_0xf33a('0x29')]){if(_0xdc2b34[_0xf33a('0x2a')]){_0xdc2b34['dateEnd']=moment(_0xdc2b34[_0xf33a('0x2a')])[_0xf33a('0x36')](0x1,'day');}else{_0xdc2b34[_0xf33a('0x2a')]=moment(_0xdc2b34[_0xf33a('0x29')])[_0xf33a('0x36')](0x1,'day');}_[_0xf33a('0x37')](_0x16ef31[_0xf33a('0x38')],{'createdAt':{'$gte':_0xdc2b34[_0xf33a('0x29')],'$lte':_0xdc2b34[_0xf33a('0x2a')]}});}if(_0x5edf1a[_0xf33a('0x28')][_0xf33a('0x39')]){_0x16ef31[_0xf33a('0x38')]=_[_0xf33a('0x37')](_0x16ef31[_0xf33a('0x38')],{'$or':_['map'](_0x16ef31[_0xf33a('0x2d')],function(_0x3e80b6){var _0x5c2e10={};_0x5c2e10[_0x3e80b6]={'$like':'%'+_0x5edf1a[_0xf33a('0x28')]['filter']+'%'};return _0x5c2e10;})});}_0x16ef31=_['merge']({},_0x16ef31,_0x5edf1a[_0xf33a('0x3a')]);var _0x893cef={'where':_0x16ef31['where']};return db[_0xf33a('0x3b')][_0xf33a('0x3c')](_0x893cef)[_0xf33a('0x1e')](function(_0x5776b1){_0x5cf981[_0xf33a('0x3c')]=_0x5776b1;if(_0x5edf1a[_0xf33a('0x28')]['includeAll']){_0x16ef31[_0xf33a('0x3d')]=[{'all':!![]}];}return db[_0xf33a('0x3b')][_0xf33a('0x3e')](_0x16ef31);})[_0xf33a('0x1e')](function(_0x40954c){_0x5cf981['rows']=_0x40954c;return _0x5cf981;})[_0xf33a('0x1e')](respondWithFilteredResult(_0x4af24a,_0x16ef31))[_0xf33a('0x3f')](handleError(_0x4af24a,null));};exports[_0xf33a('0x40')]=function(_0x259749,_0x253f21){var _0x5ef2b8={'raw':![],'where':{'id':_0x259749[_0xf33a('0x41')]['id']}},_0x175825={};_0x175825[_0xf33a('0x2e')]=_['keys'](db[_0xf33a('0x3b')][_0xf33a('0x26')]);_0x175825[_0xf33a('0x28')]=_[_0xf33a('0x27')](_0x259749[_0xf33a('0x28')]);_0x175825[_0xf33a('0x2b')]=_['intersection'](_0x175825[_0xf33a('0x2e')],_0x175825[_0xf33a('0x28')]);_0x5ef2b8[_0xf33a('0x2d')]=_[_0xf33a('0x2c')](_0x175825[_0xf33a('0x2e')],qs['fields'](_0x259749[_0xf33a('0x28')][_0xf33a('0x2f')]));_0x5ef2b8[_0xf33a('0x2d')]=_0x5ef2b8['attributes'][_0xf33a('0x30')]?_0x5ef2b8[_0xf33a('0x2d')]:_0x175825['model'];if(_0x259749['query'][_0xf33a('0x42')]){_0x5ef2b8['include']=[{'all':!![]}];}_0x5ef2b8=_[_0xf33a('0x37')]({},_0x5ef2b8,_0x259749[_0xf33a('0x3a')]);return db[_0xf33a('0x3b')][_0xf33a('0x43')](_0x5ef2b8)[_0xf33a('0x1e')](handleEntityNotFound(_0x253f21,null))[_0xf33a('0x1e')](respondWithResult(_0x253f21,null))[_0xf33a('0x3f')](handleError(_0x253f21,null));};exports[_0xf33a('0x44')]=function(_0x205409,_0xbe98a9){return db[_0xf33a('0x3b')][_0xf33a('0x44')](_0x205409[_0xf33a('0x45')],{})[_0xf33a('0x1e')](respondWithResult(_0xbe98a9,0xc9))[_0xf33a('0x3f')](handleError(_0xbe98a9,null));};exports[_0xf33a('0x1d')]=function(_0x3270e1,_0x103ec7){if(_0x3270e1[_0xf33a('0x45')]['id']){delete _0x3270e1[_0xf33a('0x45')]['id'];}return db[_0xf33a('0x3b')][_0xf33a('0x43')]({'where':{'id':_0x3270e1[_0xf33a('0x41')]['id']}})[_0xf33a('0x1e')](handleEntityNotFound(_0x103ec7,null))[_0xf33a('0x1e')](saveUpdates(_0x3270e1[_0xf33a('0x45')],null))[_0xf33a('0x1e')](respondWithResult(_0x103ec7,null))[_0xf33a('0x3f')](handleError(_0x103ec7,null));};exports[_0xf33a('0x1f')]=function(_0x59dc17,_0x349d3f){return db[_0xf33a('0x3b')]['find']({'where':{'id':_0x59dc17[_0xf33a('0x41')]['id']}})[_0xf33a('0x1e')](handleEntityNotFound(_0x349d3f,null))[_0xf33a('0x1e')](removeEntity(_0x349d3f,null))['catch'](handleError(_0x349d3f,null));};exports[_0xf33a('0x46')]=function(_0x1f5324,_0x29075a,_0x599580){return db[_0xf33a('0x47')]['find']({'where':{'id':_0x1f5324[_0xf33a('0x41')]['id']}})[_0xf33a('0x1e')](handleEntityNotFound(_0x29075a,null))['then'](function(_0x4b7fd8){if(_0x4b7fd8){return _0x4b7fd8[_0xf33a('0x46')](_0x1f5324[_0xf33a('0x45')][_0xf33a('0x48')],_['omit'](_0x1f5324[_0xf33a('0x45')],[_0xf33a('0x48'),'id'])||{});}})[_0xf33a('0x1e')](respondWithResult(_0x29075a,null))[_0xf33a('0x3f')](handleError(_0x29075a,null));};exports[_0xf33a('0x49')]=function(_0x40e468,_0x1bb26b,_0x5d66a4){var _0xa858b4={};var _0x4fadba={};var _0x48b051;var _0x55c0ae;return db[_0xf33a('0x3b')][_0xf33a('0x4a')]({'where':{'id':_0x40e468[_0xf33a('0x41')]['id']}})['then'](handleEntityNotFound(_0x1bb26b,null))[_0xf33a('0x1e')](function(_0x38f79c){if(_0x38f79c){_0x48b051=_0x38f79c;_0x4fadba[_0xf33a('0x2e')]=_[_0xf33a('0x27')](db[_0xf33a('0x47')]['rawAttributes']);_0x4fadba['query']=_['keys'](_0x40e468[_0xf33a('0x28')]);_0x4fadba['filters']=_[_0xf33a('0x2c')](_0x4fadba[_0xf33a('0x2e')],_0x4fadba[_0xf33a('0x28')]);_0xa858b4[_0xf33a('0x2d')]=_[_0xf33a('0x2c')](_0x4fadba[_0xf33a('0x2e')],qs['fields'](_0x40e468[_0xf33a('0x28')][_0xf33a('0x2f')]));_0xa858b4[_0xf33a('0x2d')]=_0xa858b4['attributes'][_0xf33a('0x30')]?_0xa858b4[_0xf33a('0x2d')]:_0x4fadba[_0xf33a('0x2e')];_0xa858b4[_0xf33a('0x33')]=qs[_0xf33a('0x34')](_0x40e468[_0xf33a('0x28')][_0xf33a('0x34')]);_0xa858b4[_0xf33a('0x38')]=qs[_0xf33a('0x2b')](_[_0xf33a('0x35')](_0x40e468[_0xf33a('0x28')],_0x4fadba[_0xf33a('0x2b')]));if(_0x40e468[_0xf33a('0x28')][_0xf33a('0x39')]){_0xa858b4['where']=_['merge'](_0xa858b4[_0xf33a('0x38')],{'$or':_[_0xf33a('0x4b')](_0xa858b4[_0xf33a('0x2d')],function(_0x161de7){var _0x376f3f={};_0x376f3f[_0x161de7]={'$like':'%'+_0x40e468[_0xf33a('0x28')][_0xf33a('0x39')]+'%'};return _0x376f3f;})});}_0xa858b4=_[_0xf33a('0x37')]({},_0xa858b4,_0x40e468[_0xf33a('0x3a')]);return _0x48b051[_0xf33a('0x49')](_0xa858b4);}})[_0xf33a('0x1e')](function(_0x4e9e69){if(_0x4e9e69){_0x55c0ae=_0x4e9e69[_0xf33a('0x30')];if(!_0x40e468[_0xf33a('0x28')][_0xf33a('0x31')](_0xf33a('0x32'))){_0xa858b4[_0xf33a('0x19')]=qs[_0xf33a('0x19')](_0x40e468[_0xf33a('0x28')][_0xf33a('0x19')]);_0xa858b4[_0xf33a('0x18')]=qs['offset'](_0x40e468[_0xf33a('0x28')][_0xf33a('0x18')]);}return _0x48b051['getContacts'](_0xa858b4);}})[_0xf33a('0x1e')](function(_0x2ebd7e){if(_0x2ebd7e){return _0x2ebd7e?{'count':_0x55c0ae,'rows':_0x2ebd7e}:null;}})[_0xf33a('0x1e')](respondWithResult(_0x1bb26b,null))[_0xf33a('0x3f')](handleError(_0x1bb26b,null));};
\ No newline at end of file
+var _0xba34=['offset','limit','Content-Range','reject','save','destroy','then','error','stack','name','send','index','rawAttributes','model','keys','query','dateStart','dateEnd','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','add','merge','map','filter','options','CmCompany','includeAll','include','findAll','rows','catch','show','length','update','body','params','find','addContacts','CmContact','ids','getContacts','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count'];(function(_0x21bfab,_0x2fee48){var _0x4db318=function(_0x10396d){while(--_0x10396d){_0x21bfab['push'](_0x21bfab['shift']());}};_0x4db318(++_0x2fee48);}(_0xba34,0x119));var _0x4ba3=function(_0x3f7207,_0x49aad7){_0x3f7207=_0x3f7207-0x0;var _0x2c4415=_0xba34[_0x3f7207];return _0x2c4415;};'use strict';var pdf=require(_0x4ba3('0x0'));var emlformat=require(_0x4ba3('0x1'));var rimraf=require(_0x4ba3('0x2'));var zipdir=require(_0x4ba3('0x3'));var jsonpatch=require(_0x4ba3('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4ba3('0x5'));var util=require(_0x4ba3('0x6'));var path=require(_0x4ba3('0x7'));var sox=require(_0x4ba3('0x8'));var csv=require(_0x4ba3('0x9'));var ejs=require(_0x4ba3('0xa'));var fs=require('fs');var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x9'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var qs=require(_0x4ba3('0x11'));var logger=require(_0x4ba3('0x12'))(_0x4ba3('0x13'));var utils=require(_0x4ba3('0x14'));var config=require(_0x4ba3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4619c5,_0x9071){_0x9071=_0x9071||0xcc;return function(_0x485782){if(_0x485782){return _0x4619c5[_0x4ba3('0x16')](_0x9071);}return _0x4619c5['status'](_0x9071)[_0x4ba3('0x17')]();};}function respondWithResult(_0x52f55c,_0x256f02){_0x256f02=_0x256f02||0xc8;return function(_0x4419b4){if(_0x4419b4){return _0x52f55c[_0x4ba3('0x18')](_0x256f02)[_0x4ba3('0x19')](_0x4419b4);}};}function respondWithFilteredResult(_0x2bc796,_0x3d2ace){return function(_0x3a74f7){if(_0x3a74f7){var _0x12ac90=_0x3a74f7[_0x4ba3('0x1a')],_0x1dec48=_0x3d2ace[_0x4ba3('0x1b')],_0x401366=_0x3d2ace[_0x4ba3('0x1b')]+_0x3d2ace[_0x4ba3('0x1c')],_0x36638b;if(_0x401366>=_0x12ac90){_0x401366=_0x12ac90;_0x36638b=0xc8;}else{_0x36638b=0xce;}_0x2bc796[_0x4ba3('0x18')](_0x36638b);return _0x2bc796['set'](_0x4ba3('0x1d'),_0x1dec48+'-'+_0x401366+'/'+_0x12ac90)[_0x4ba3('0x19')](_0x3a74f7);}return null;};}function patchUpdates(_0x5ff7ce){return function(_0x451c92){try{jsonpatch['apply'](_0x451c92,_0x5ff7ce,!![]);}catch(_0x2519bb){return BPromise[_0x4ba3('0x1e')](_0x2519bb);}return _0x451c92[_0x4ba3('0x1f')]();};}function saveUpdates(_0x1e2ce5,_0x184332){return function(_0x125944){if(_0x125944){return _0x125944['update'](_0x1e2ce5)['then'](function(_0x2278b0){return _0x2278b0;});}return null;};}function removeEntity(_0x579d9f,_0x18dff5){return function(_0x163967){if(_0x163967){return _0x163967[_0x4ba3('0x20')]()[_0x4ba3('0x21')](function(){_0x579d9f[_0x4ba3('0x18')](0xcc)[_0x4ba3('0x17')]();});}};}function handleEntityNotFound(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(!_0x1f87e1){_0x4a0823['sendStatus'](0x194);}return _0x1f87e1;};}function handleError(_0x28bb3d,_0x4ffe39){_0x4ffe39=_0x4ffe39||0x1f4;return function(_0x1ae4de){logger[_0x4ba3('0x22')](_0x1ae4de[_0x4ba3('0x23')]);if(_0x1ae4de[_0x4ba3('0x24')]){delete _0x1ae4de[_0x4ba3('0x24')];}_0x28bb3d[_0x4ba3('0x18')](_0x4ffe39)[_0x4ba3('0x25')](_0x1ae4de);};}exports[_0x4ba3('0x26')]=function(_0x6cecf3,_0x2e67a0){var _0x50c729={},_0x252f37={},_0x13c353={'count':0x0,'rows':[]};var _0x2311ed=db['CmCompany'][_0x4ba3('0x27')];_0x252f37[_0x4ba3('0x28')]=_[_0x4ba3('0x29')](_0x2311ed);var _0x5a3588={'dateStart':_0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x2b')],'dateEnd':_0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x2c')]};delete _0x6cecf3['query']['dateStart'];delete _0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x2c')];_0x252f37[_0x4ba3('0x2a')]=_[_0x4ba3('0x29')](_0x6cecf3[_0x4ba3('0x2a')]);_0x252f37[_0x4ba3('0x2d')]=_['intersection'](_0x252f37[_0x4ba3('0x28')],_0x252f37[_0x4ba3('0x2a')]);_0x50c729[_0x4ba3('0x2e')]=_[_0x4ba3('0x2f')](_0x252f37[_0x4ba3('0x28')],qs[_0x4ba3('0x30')](_0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x30')]));_0x50c729[_0x4ba3('0x2e')]=_0x50c729[_0x4ba3('0x2e')]['length']?_0x50c729['attributes']:_0x252f37['model'];if(!_0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x31')](_0x4ba3('0x32'))){_0x50c729[_0x4ba3('0x1c')]=qs[_0x4ba3('0x1c')](_0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x1c')]);_0x50c729[_0x4ba3('0x1b')]=qs[_0x4ba3('0x1b')](_0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x1b')]);}_0x50c729[_0x4ba3('0x33')]=qs['sort'](_0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x34')]);_0x50c729[_0x4ba3('0x35')]=qs['filters'](_[_0x4ba3('0x36')](_0x6cecf3['query'],_0x252f37[_0x4ba3('0x2d')]));if(_0x5a3588[_0x4ba3('0x2b')]){if(_0x5a3588[_0x4ba3('0x2c')]){_0x5a3588[_0x4ba3('0x2c')]=moment(_0x5a3588[_0x4ba3('0x2c')])[_0x4ba3('0x37')](0x1,'day');}else{_0x5a3588[_0x4ba3('0x2c')]=moment(_0x5a3588[_0x4ba3('0x2b')])[_0x4ba3('0x37')](0x1,'day');}_[_0x4ba3('0x38')](_0x50c729[_0x4ba3('0x35')],{'createdAt':{'$gte':_0x5a3588['dateStart'],'$lte':_0x5a3588[_0x4ba3('0x2c')]}});}if(_0x6cecf3['query']['filter']){_0x50c729[_0x4ba3('0x35')]=_[_0x4ba3('0x38')](_0x50c729[_0x4ba3('0x35')],{'$or':_[_0x4ba3('0x39')](_0x50c729[_0x4ba3('0x2e')],function(_0x59d535){var _0x3aeefd={};_0x3aeefd[_0x59d535]={'$like':'%'+_0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x3a')]+'%'};return _0x3aeefd;})});}_0x50c729=_[_0x4ba3('0x38')]({},_0x50c729,_0x6cecf3[_0x4ba3('0x3b')]);var _0x2acc92={'where':_0x50c729[_0x4ba3('0x35')]};return db[_0x4ba3('0x3c')]['count'](_0x2acc92)[_0x4ba3('0x21')](function(_0x3b4240){_0x13c353[_0x4ba3('0x1a')]=_0x3b4240;if(_0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x3d')]){_0x50c729[_0x4ba3('0x3e')]=[{'all':!![]}];}return db[_0x4ba3('0x3c')][_0x4ba3('0x3f')](_0x50c729);})[_0x4ba3('0x21')](function(_0xa692c6){_0x13c353[_0x4ba3('0x40')]=_0xa692c6;return _0x13c353;})[_0x4ba3('0x21')](respondWithFilteredResult(_0x2e67a0,_0x50c729))[_0x4ba3('0x41')](handleError(_0x2e67a0,null));};exports[_0x4ba3('0x42')]=function(_0x4a1522,_0x5af671){var _0x4df0f5={'raw':![],'where':{'id':_0x4a1522['params']['id']}},_0x48280f={};_0x48280f[_0x4ba3('0x28')]=_['keys'](db[_0x4ba3('0x3c')]['rawAttributes']);_0x48280f[_0x4ba3('0x2a')]=_[_0x4ba3('0x29')](_0x4a1522[_0x4ba3('0x2a')]);_0x48280f[_0x4ba3('0x2d')]=_[_0x4ba3('0x2f')](_0x48280f['model'],_0x48280f[_0x4ba3('0x2a')]);_0x4df0f5['attributes']=_[_0x4ba3('0x2f')](_0x48280f['model'],qs[_0x4ba3('0x30')](_0x4a1522[_0x4ba3('0x2a')][_0x4ba3('0x30')]));_0x4df0f5[_0x4ba3('0x2e')]=_0x4df0f5[_0x4ba3('0x2e')][_0x4ba3('0x43')]?_0x4df0f5[_0x4ba3('0x2e')]:_0x48280f['model'];if(_0x4a1522[_0x4ba3('0x2a')][_0x4ba3('0x3d')]){_0x4df0f5[_0x4ba3('0x3e')]=[{'all':!![]}];}_0x4df0f5=_[_0x4ba3('0x38')]({},_0x4df0f5,_0x4a1522[_0x4ba3('0x3b')]);return db['CmCompany']['find'](_0x4df0f5)[_0x4ba3('0x21')](handleEntityNotFound(_0x5af671,null))[_0x4ba3('0x21')](respondWithResult(_0x5af671,null))[_0x4ba3('0x41')](handleError(_0x5af671,null));};exports['create']=function(_0xd466f6,_0xfd30a0){return db[_0x4ba3('0x3c')]['create'](_0xd466f6['body'],{})[_0x4ba3('0x21')](respondWithResult(_0xfd30a0,0xc9))['catch'](handleError(_0xfd30a0,null));};exports[_0x4ba3('0x44')]=function(_0x1b9f76,_0x1aab37){if(_0x1b9f76[_0x4ba3('0x45')]['id']){delete _0x1b9f76[_0x4ba3('0x45')]['id'];}return db[_0x4ba3('0x3c')]['find']({'where':{'id':_0x1b9f76[_0x4ba3('0x46')]['id']}})[_0x4ba3('0x21')](handleEntityNotFound(_0x1aab37,null))['then'](saveUpdates(_0x1b9f76[_0x4ba3('0x45')],null))[_0x4ba3('0x21')](respondWithResult(_0x1aab37,null))[_0x4ba3('0x41')](handleError(_0x1aab37,null));};exports[_0x4ba3('0x20')]=function(_0x360472,_0x4d092d){return db[_0x4ba3('0x3c')][_0x4ba3('0x47')]({'where':{'id':_0x360472['params']['id']}})[_0x4ba3('0x21')](handleEntityNotFound(_0x4d092d,null))[_0x4ba3('0x21')](removeEntity(_0x4d092d,null))[_0x4ba3('0x41')](handleError(_0x4d092d,null));};exports[_0x4ba3('0x48')]=function(_0x1f2690,_0x42a87a,_0x45dae5){return db[_0x4ba3('0x49')][_0x4ba3('0x47')]({'where':{'id':_0x1f2690[_0x4ba3('0x46')]['id']}})[_0x4ba3('0x21')](handleEntityNotFound(_0x42a87a,null))[_0x4ba3('0x21')](function(_0x438ce3){if(_0x438ce3){return _0x438ce3[_0x4ba3('0x48')](_0x1f2690[_0x4ba3('0x45')]['ids'],_['omit'](_0x1f2690['body'],[_0x4ba3('0x4a'),'id'])||{});}})[_0x4ba3('0x21')](respondWithResult(_0x42a87a,null))[_0x4ba3('0x41')](handleError(_0x42a87a,null));};exports[_0x4ba3('0x4b')]=function(_0x40af1d,_0x57e25a,_0x3920c0){var _0x4620ae={};var _0x273141={};var _0x42a443;var _0x5359d1;return db[_0x4ba3('0x3c')][_0x4ba3('0x4c')]({'where':{'id':_0x40af1d[_0x4ba3('0x46')]['id']}})[_0x4ba3('0x21')](handleEntityNotFound(_0x57e25a,null))[_0x4ba3('0x21')](function(_0x16a8d1){if(_0x16a8d1){_0x42a443=_0x16a8d1;_0x273141[_0x4ba3('0x28')]=_[_0x4ba3('0x29')](db[_0x4ba3('0x49')]['rawAttributes']);_0x273141[_0x4ba3('0x2a')]=_[_0x4ba3('0x29')](_0x40af1d[_0x4ba3('0x2a')]);_0x273141[_0x4ba3('0x2d')]=_[_0x4ba3('0x2f')](_0x273141[_0x4ba3('0x28')],_0x273141[_0x4ba3('0x2a')]);_0x4620ae[_0x4ba3('0x2e')]=_['intersection'](_0x273141[_0x4ba3('0x28')],qs[_0x4ba3('0x30')](_0x40af1d[_0x4ba3('0x2a')]['fields']));_0x4620ae[_0x4ba3('0x2e')]=_0x4620ae['attributes'][_0x4ba3('0x43')]?_0x4620ae[_0x4ba3('0x2e')]:_0x273141[_0x4ba3('0x28')];_0x4620ae[_0x4ba3('0x33')]=qs[_0x4ba3('0x34')](_0x40af1d['query'][_0x4ba3('0x34')]);_0x4620ae[_0x4ba3('0x35')]=qs[_0x4ba3('0x2d')](_[_0x4ba3('0x36')](_0x40af1d[_0x4ba3('0x2a')],_0x273141['filters']));if(_0x40af1d[_0x4ba3('0x2a')][_0x4ba3('0x3a')]){_0x4620ae[_0x4ba3('0x35')]=_[_0x4ba3('0x38')](_0x4620ae[_0x4ba3('0x35')],{'$or':_[_0x4ba3('0x39')](_0x4620ae[_0x4ba3('0x2e')],function(_0x38699e){var _0x39ddf3={};_0x39ddf3[_0x38699e]={'$like':'%'+_0x40af1d[_0x4ba3('0x2a')][_0x4ba3('0x3a')]+'%'};return _0x39ddf3;})});}_0x4620ae=_['merge']({},_0x4620ae,_0x40af1d[_0x4ba3('0x3b')]);return _0x42a443[_0x4ba3('0x4b')](_0x4620ae);}})['then'](function(_0x4fd468){if(_0x4fd468){_0x5359d1=_0x4fd468[_0x4ba3('0x43')];if(!_0x40af1d[_0x4ba3('0x2a')]['hasOwnProperty'](_0x4ba3('0x32'))){_0x4620ae[_0x4ba3('0x1c')]=qs[_0x4ba3('0x1c')](_0x40af1d['query'][_0x4ba3('0x1c')]);_0x4620ae[_0x4ba3('0x1b')]=qs[_0x4ba3('0x1b')](_0x40af1d[_0x4ba3('0x2a')][_0x4ba3('0x1b')]);}return _0x42a443[_0x4ba3('0x4b')](_0x4620ae);}})['then'](function(_0x3a1fad){if(_0x3a1fad){return _0x3a1fad?{'count':_0x5359d1,'rows':_0x3a1fad}:null;}})[_0x4ba3('0x21')](respondWithResult(_0x57e25a,null))[_0x4ba3('0x41')](handleError(_0x57e25a,null));};
\ No newline at end of file
index cd4a6c1..c531986 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41bb=['util','api','bluebird','request-promise','./cmCompany.attributes','exports','define','CmCompany','lodash'];(function(_0x5ad9e2,_0x539f63){var _0x287b3c=function(_0xffc8c7){while(--_0xffc8c7){_0x5ad9e2['push'](_0x5ad9e2['shift']());}};_0x287b3c(++_0x539f63);}(_0x41bb,0xc5));var _0xb41b=function(_0x58d2e9,_0x351912){_0x58d2e9=_0x58d2e9-0x0;var _0x56b71f=_0x41bb[_0x58d2e9];return _0x56b71f;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var logger=require('../../config/logger')(_0xb41b('0x2'));var moment=require('moment');var BPromise=require(_0xb41b('0x3'));var rp=require(_0xb41b('0x4'));var attributes=require(_0xb41b('0x5'));module[_0xb41b('0x6')]=function(_0x4ee21b,_0x12cea3){return _0x4ee21b[_0xb41b('0x7')](_0xb41b('0x8'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb91=['cm_companies','../../config/logger','api','moment','bluebird','./cmCompany.attributes','exports','define'];(function(_0x16a380,_0x24e43b){var _0x3133e4=function(_0x31c8da){while(--_0x31c8da){_0x16a380['push'](_0x16a380['shift']());}};_0x3133e4(++_0x24e43b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0xcb91[_0xa8883];return _0x479426;};'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 attributes=require(_0x1cb9('0x4'));module[_0x1cb9('0x5')]=function(_0x545a34,_0x13d5fd){return _0x545a34[_0x1cb9('0x6')]('CmCompany',attributes,{'tableName':_0x1cb9('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 99ebd51..380bcf1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb138=['../../config/utils','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x412686,_0x3fde24){var _0x18619e=function(_0x862bd1){while(--_0x862bd1){_0x412686['push'](_0x412686['shift']());}};_0x18619e(++_0x3fde24);}(_0xb138,0x1dd));var _0x8b13=function(_0x444ef6,_0x45346f){_0x444ef6=_0x444ef6-0x0;var _0x581f77=_0xb138[_0x444ef6];return _0x581f77;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var moment=require(_0x8b13('0x2'));var BPromise=require(_0x8b13('0x3'));var rs=require(_0x8b13('0x4'));var fs=require('fs');var db=require(_0x8b13('0x5'))['db'];var utils=require(_0x8b13('0x6'));var logger=require('../../config/logger')(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var jayson=require(_0x8b13('0x9'));var client=jayson['client'][_0x8b13('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13f7bd,_0x5d51b1,_0x3fdf4d){return new BPromise(function(_0x33d1a7,_0x22e157){return client['request'](_0x13f7bd,_0x3fdf4d)[_0x8b13('0xb')](function(_0x1aed6f){logger['info']('CmCompany,\x20%s,\x20%s',_0x5d51b1,_0x8b13('0xc'));logger[_0x8b13('0xd')](_0x8b13('0xe'),_0x5d51b1,_0x8b13('0xc'),JSON[_0x8b13('0xf')](_0x1aed6f));if(_0x1aed6f['error']){if(_0x1aed6f[_0x8b13('0x10')][_0x8b13('0x11')]===0x1f4){logger[_0x8b13('0x10')](_0x8b13('0x12'),_0x5d51b1,_0x1aed6f[_0x8b13('0x10')][_0x8b13('0x13')]);return _0x22e157(_0x1aed6f['error']['message']);}logger[_0x8b13('0x10')](_0x8b13('0x12'),_0x5d51b1,_0x1aed6f['error']['message']);return _0x33d1a7(_0x1aed6f['error'][_0x8b13('0x13')]);}else{logger[_0x8b13('0x14')](_0x8b13('0x12'),_0x5d51b1,_0x8b13('0xc'));_0x33d1a7(_0x1aed6f[_0x8b13('0x15')]['message']);}})[_0x8b13('0x16')](function(_0xea7881){logger[_0x8b13('0x10')](_0x8b13('0x12'),_0x5d51b1,_0xea7881);_0x22e157(_0xea7881);});});}
\ No newline at end of file
+var _0x33c5=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x161450,_0x5ca76c){var _0x5a3fda=function(_0x18a4bd){while(--_0x18a4bd){_0x161450['push'](_0x161450['shift']());}};_0x5a3fda(++_0x5ca76c);}(_0x33c5,0xe6));var _0x533c=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x33c5[_0x8de54f];return _0x14cba4;};'use strict';var _=require('lodash');var util=require(_0x533c('0x0'));var moment=require(_0x533c('0x1'));var BPromise=require('bluebird');var rs=require(_0x533c('0x2'));var fs=require('fs');var db=require(_0x533c('0x3'))['db'];var utils=require(_0x533c('0x4'));var logger=require(_0x533c('0x5'))(_0x533c('0x6'));var config=require('../../config/environment');var jayson=require(_0x533c('0x7'));var client=jayson[_0x533c('0x8')][_0x533c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x151732,_0x34ca89,_0x1699d5){return new BPromise(function(_0x3a009b,_0x36d74e){return client[_0x533c('0xa')](_0x151732,_0x1699d5)[_0x533c('0xb')](function(_0x1782eb){logger[_0x533c('0xc')](_0x533c('0xd'),_0x34ca89,_0x533c('0xe'));logger[_0x533c('0xf')](_0x533c('0x10'),_0x34ca89,'request\x20sent',JSON[_0x533c('0x11')](_0x1782eb));if(_0x1782eb[_0x533c('0x12')]){if(_0x1782eb[_0x533c('0x12')][_0x533c('0x13')]===0x1f4){logger[_0x533c('0x12')](_0x533c('0xd'),_0x34ca89,_0x1782eb['error'][_0x533c('0x14')]);return _0x36d74e(_0x1782eb[_0x533c('0x12')][_0x533c('0x14')]);}logger[_0x533c('0x12')](_0x533c('0xd'),_0x34ca89,_0x1782eb[_0x533c('0x12')][_0x533c('0x14')]);return _0x3a009b(_0x1782eb[_0x533c('0x12')]['message']);}else{logger[_0x533c('0xc')](_0x533c('0xd'),_0x34ca89,_0x533c('0xe'));_0x3a009b(_0x1782eb[_0x533c('0x15')]['message']);}})[_0x533c('0x16')](function(_0x1ed6ba){logger[_0x533c('0x12')](_0x533c('0xd'),_0x34ca89,_0x1ed6ba);_0x36d74e(_0x1ed6ba);});});}
\ No newline at end of file
index 7238bc9..15bff53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x222b=['isAuthenticated','index','/:id','show','/:id/contacts','getContacts','put','destroy','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./cmCompany.controller','get'];(function(_0x3bddea,_0x57e19c){var _0x42dd66=function(_0x5324bc){while(--_0x5324bc){_0x3bddea['push'](_0x3bddea['shift']());}};_0x42dd66(++_0x57e19c);}(_0x222b,0xc4));var _0xb222=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x222b[_0x1a36a5];return _0x746243;};'use strict';var multer=require('multer');var util=require(_0xb222('0x0'));var path=require(_0xb222('0x1'));var express=require(_0xb222('0x2'));var router=express[_0xb222('0x3')]();var auth=require(_0xb222('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb222('0x5'));var controller=require(_0xb222('0x6'));router[_0xb222('0x7')]('/',auth[_0xb222('0x8')](),controller[_0xb222('0x9')]);router[_0xb222('0x7')](_0xb222('0xa'),auth['isAuthenticated'](),controller[_0xb222('0xb')]);router[_0xb222('0x7')](_0xb222('0xc'),auth[_0xb222('0x8')](),controller[_0xb222('0xd')]);router['post']('/',auth[_0xb222('0x8')](),controller['create']);router['post'](_0xb222('0xc'),auth[_0xb222('0x8')](),controller['addContacts']);router[_0xb222('0xe')](_0xb222('0xa'),auth[_0xb222('0x8')](),controller['update']);router['delete']('/:id',auth[_0xb222('0x8')](),controller[_0xb222('0xf')]);module[_0xb222('0x10')]=router;
\ No newline at end of file
+var _0xcc0f=['/:id/contacts','addContacts','update','delete','/:id','destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','show','getContacts','post'];(function(_0x5adf4d,_0xdfd7ef){var _0x17b2db=function(_0x5a9a2f){while(--_0x5a9a2f){_0x5adf4d['push'](_0x5adf4d['shift']());}};_0x17b2db(++_0xdfd7ef);}(_0xcc0f,0x1e6));var _0xfcc0=function(_0x418c14,_0x47039e){_0x418c14=_0x418c14-0x0;var _0x5a1918=_0xcc0f[_0x418c14];return _0x5a1918;};'use strict';var multer=require(_0xfcc0('0x0'));var util=require(_0xfcc0('0x1'));var path=require(_0xfcc0('0x2'));var express=require(_0xfcc0('0x3'));var router=express[_0xfcc0('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xfcc0('0x5'));var config=require(_0xfcc0('0x6'));var controller=require(_0xfcc0('0x7'));router[_0xfcc0('0x8')]('/',auth[_0xfcc0('0x9')](),controller[_0xfcc0('0xa')]);router[_0xfcc0('0x8')]('/:id',auth[_0xfcc0('0x9')](),controller[_0xfcc0('0xb')]);router[_0xfcc0('0x8')]('/:id/contacts',auth[_0xfcc0('0x9')](),controller[_0xfcc0('0xc')]);router[_0xfcc0('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xfcc0('0xe'),auth['isAuthenticated'](),controller[_0xfcc0('0xf')]);router['put']('/:id',auth[_0xfcc0('0x9')](),controller[_0xfcc0('0x10')]);router[_0xfcc0('0x11')](_0xfcc0('0x12'),auth['isAuthenticated'](),controller[_0xfcc0('0x13')]);module['exports']=router;
\ No newline at end of file
index 8e3352b..8c01cea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75ca=['INTEGER','UNSIGNED','DATE','lodash','sequelize','STRING','TEXT'];(function(_0xc4d0d7,_0x2d9a08){var _0x261ef2=function(_0x32439b){while(--_0x32439b){_0xc4d0d7['push'](_0xc4d0d7['shift']());}};_0x261ef2(++_0x2d9a08);}(_0x75ca,0x7a));var _0xa75c=function(_0x1177d5,_0x22b649){_0x1177d5=_0x1177d5-0x0;var _0xc3ddc2=_0x75ca[_0x1177d5];return _0xc3ddc2;};'use strict';var _=require(_0xa75c('0x0'));var Sequelize=require(_0xa75c('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xa75c('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xa75c('0x2')]},'postalCode':{'type':Sequelize[_0xa75c('0x2')]},'city':{'type':Sequelize[_0xa75c('0x2')]},'country':{'type':Sequelize[_0xa75c('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa75c('0x2')]},'description':{'type':Sequelize[_0xa75c('0x3')]},'phone':{'type':Sequelize[_0xa75c('0x2')]},'mobile':{'type':Sequelize[_0xa75c('0x2')]},'fax':{'type':Sequelize[_0xa75c('0x2')]},'email':{'type':Sequelize[_0xa75c('0x2')]},'url':{'type':Sequelize[_0xa75c('0x2')]},'facebook':{'type':Sequelize[_0xa75c('0x2')]},'twitter':{'type':Sequelize[_0xa75c('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xa75c('0x2')]},'viber':{'type':Sequelize[_0xa75c('0x2')]},'line':{'type':Sequelize[_0xa75c('0x2')]},'wechat':{'type':Sequelize[_0xa75c('0x2')]},'UserId':{'type':Sequelize[_0xa75c('0x4')]},'priority':{'type':Sequelize[_0xa75c('0x4')](0x2)[_0xa75c('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa75c('0x6')],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x366a=['INTEGER','UNSIGNED','DATE','NOW','lodash','exports','STRING','TEXT'];(function(_0x245e2d,_0x1515a6){var _0x2d1b6f=function(_0xd5b890){while(--_0xd5b890){_0x245e2d['push'](_0x245e2d['shift']());}};_0x2d1b6f(++_0x1515a6);}(_0x366a,0xbc));var _0xa366=function(_0x3f94f9,_0x42774b){_0x3f94f9=_0x3f94f9-0x0;var _0x46f84f=_0x366a[_0x3f94f9];return _0x46f84f;};'use strict';var _=require(_0xa366('0x0'));var Sequelize=require('sequelize');module[_0xa366('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xa366('0x2')]},'street':{'type':Sequelize[_0xa366('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa366('0x2')]},'country':{'type':Sequelize[_0xa366('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa366('0x2')]},'description':{'type':Sequelize[_0xa366('0x3')]},'phone':{'type':Sequelize[_0xa366('0x2')]},'mobile':{'type':Sequelize[_0xa366('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xa366('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xa366('0x2')]},'twitter':{'type':Sequelize[_0xa366('0x2')]},'skype':{'type':Sequelize[_0xa366('0x2')]},'teams':{'type':Sequelize[_0xa366('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xa366('0x2')]},'wechat':{'type':Sequelize[_0xa366('0x2')]},'UserId':{'type':Sequelize[_0xa366('0x4')]},'priority':{'type':Sequelize[_0xa366('0x4')](0x2)[_0xa366('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa366('0x6')],'defaultValue':Sequelize[_0xa366('0x7')]}};
\ No newline at end of file
index 8625b5b..0e8da30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd517=['dateEnd','dateStart','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','add','day','merge','where','filter','tag','push','Tag','distinct','includeAll','include','color','ThroughTags','CmContact','findAll','rows','catch','find','describe','body','from','get','mergeWith','isArray','tags','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','ReportAgentPreview','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','join','duplicates','$or','ListId','findOrCreate','spread','show','params','$and','map','format','cf_%d','CmCustomField','omit','pickBy','startsWith','cf_','isEmpty','table','cm_contacts','toParam','sequelize','text','values','phone','getTags','findOne','fields','options','setTags','ids','getHoppers','rawAttributes','getHopperHistories','CmHopperHistory','ContactId','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','split','binding_values','zipObject','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','child_process','CompanyId','createReadStream','parse','meta','import','User','agent','binding','No\x20phone\x20column\x20specified','socket_timestamp','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','socket.io-emitter','./cmContact.socket','register','sendStatus','status','count','limit','set','json','save','update','then','destroy','end','error','name','send','index','model','keys','query'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xd517,0x1dd));var _0x7d51=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0xd517[_0x28394f];return _0x2618d2;};'use strict';var pdf=require(_0x7d51('0x0'));var emlformat=require(_0x7d51('0x1'));var rimraf=require(_0x7d51('0x2'));var zipdir=require(_0x7d51('0x3'));var jsonpatch=require(_0x7d51('0x4'));var rp=require('request-promise');var moment=require(_0x7d51('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7d51('0x6'));var path=require(_0x7d51('0x7'));var sox=require(_0x7d51('0x8'));var csv=require(_0x7d51('0x9'));var ejs=require(_0x7d51('0xa'));var fs=require('fs');var _=require(_0x7d51('0xb'));var squel=require(_0x7d51('0xc'));var crypto=require(_0x7d51('0xd'));var jsforce=require(_0x7d51('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7d51('0xf'));var Papa=require(_0x7d51('0x10'));var qs=require(_0x7d51('0x11'));var logger=require(_0x7d51('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x7d51('0x13'));var db=require(_0x7d51('0x14'))['db'];var socket=require(_0x7d51('0x15'))({'host':'localhost','port':0x18eb});require(_0x7d51('0x16'))[_0x7d51('0x17')](socket);function respondWithStatusCode(_0x5635b3,_0x862d23){_0x862d23=_0x862d23||0xcc;return function(_0x4d2446){if(_0x4d2446){return _0x5635b3[_0x7d51('0x18')](_0x862d23);}return _0x5635b3[_0x7d51('0x19')](_0x862d23)['end']();};}function respondWithResult(_0x5c8f6d,_0xdffda4){_0xdffda4=_0xdffda4||0xc8;return function(_0xe77939){if(_0xe77939){return _0x5c8f6d[_0x7d51('0x19')](_0xdffda4)['json'](_0xe77939);}};}function respondWithFilteredResult(_0x516468,_0x305c26){return function(_0x1ea497){if(_0x1ea497){var _0x31c95c=_0x1ea497[_0x7d51('0x1a')],_0x102eb7=_0x305c26['offset'],_0x5c7122=_0x305c26['offset']+_0x305c26[_0x7d51('0x1b')],_0x5c5bda;if(_0x5c7122>=_0x31c95c){_0x5c7122=_0x31c95c;_0x5c5bda=0xc8;}else{_0x5c5bda=0xce;}_0x516468[_0x7d51('0x19')](_0x5c5bda);return _0x516468[_0x7d51('0x1c')]('Content-Range',_0x102eb7+'-'+_0x5c7122+'/'+_0x31c95c)[_0x7d51('0x1d')](_0x1ea497);}return null;};}function patchUpdates(_0x1f0300){return function(_0x71995c){try{jsonpatch['apply'](_0x71995c,_0x1f0300,!![]);}catch(_0x2f3f44){return BPromise['reject'](_0x2f3f44);}return _0x71995c[_0x7d51('0x1e')]();};}function saveUpdates(_0x5523c1,_0x3401f8){return function(_0x401c96){if(_0x401c96){return _0x401c96[_0x7d51('0x1f')](_0x5523c1)[_0x7d51('0x20')](function(_0x3d889e){return _0x3d889e;});}return null;};}function removeEntity(_0xac560,_0x2ebce3){return function(_0x17463e){if(_0x17463e){return _0x17463e[_0x7d51('0x21')]()[_0x7d51('0x20')](function(){_0xac560[_0x7d51('0x19')](0xcc)[_0x7d51('0x22')]();});}};}function handleEntityNotFound(_0x44f118,_0x1e1f8c){return function(_0x24bf87){if(!_0x24bf87){_0x44f118[_0x7d51('0x18')](0x194);}return _0x24bf87;};}function handleError(_0x1e0201,_0x4efca7){_0x4efca7=_0x4efca7||0x1f4;return function(_0x1e739b){logger[_0x7d51('0x23')](_0x1e739b['stack']);if(_0x1e739b[_0x7d51('0x24')]){delete _0x1e739b[_0x7d51('0x24')];}_0x1e0201[_0x7d51('0x19')](_0x4efca7)[_0x7d51('0x25')](_0x1e739b);};}exports[_0x7d51('0x26')]=function(_0x422c64,_0x3da100){var _0x46942b={},_0x3761cc={},_0x356109={'count':0x0,'rows':[]};return db['CmContact']['describe']()['then'](function(_0x2b5b48){_0x3761cc[_0x7d51('0x27')]=_[_0x7d51('0x28')](_0x2b5b48);var _0x5ae6c6={'dateStart':_0x422c64[_0x7d51('0x29')]['dateStart'],'dateEnd':_0x422c64[_0x7d51('0x29')][_0x7d51('0x2a')]};delete _0x422c64[_0x7d51('0x29')][_0x7d51('0x2b')];delete _0x422c64[_0x7d51('0x29')][_0x7d51('0x2a')];_0x3761cc[_0x7d51('0x29')]=_[_0x7d51('0x28')](_0x422c64[_0x7d51('0x29')]);_0x3761cc[_0x7d51('0x2c')]=_[_0x7d51('0x2d')](_0x3761cc[_0x7d51('0x27')],_0x3761cc[_0x7d51('0x29')]);_0x46942b[_0x7d51('0x2e')]=_[_0x7d51('0x2d')](_0x3761cc['model'],qs['fields'](_0x422c64[_0x7d51('0x29')]['fields']));_0x46942b[_0x7d51('0x2e')]=_0x46942b[_0x7d51('0x2e')][_0x7d51('0x2f')]?_0x46942b['attributes']:_0x3761cc[_0x7d51('0x27')];if(!_0x422c64[_0x7d51('0x29')][_0x7d51('0x30')](_0x7d51('0x31'))){_0x46942b[_0x7d51('0x1b')]=qs[_0x7d51('0x1b')](_0x422c64['query'][_0x7d51('0x1b')]);_0x46942b[_0x7d51('0x32')]=qs[_0x7d51('0x32')](_0x422c64[_0x7d51('0x29')]['offset']);}_0x46942b[_0x7d51('0x33')]=qs[_0x7d51('0x34')](_0x422c64[_0x7d51('0x29')][_0x7d51('0x34')]);_0x46942b['where']=qs[_0x7d51('0x2c')](_[_0x7d51('0x35')](_0x422c64['query'],_0x3761cc['filters']));if(_0x5ae6c6[_0x7d51('0x2b')]){if(_0x5ae6c6[_0x7d51('0x2a')]){_0x5ae6c6[_0x7d51('0x2a')]=moment(_0x5ae6c6[_0x7d51('0x2a')])[_0x7d51('0x36')](0x1,'day');}else{_0x5ae6c6[_0x7d51('0x2a')]=moment(_0x5ae6c6[_0x7d51('0x2b')])['add'](0x1,_0x7d51('0x37'));}_[_0x7d51('0x38')](_0x46942b[_0x7d51('0x39')],{'createdAt':{'$gte':_0x5ae6c6[_0x7d51('0x2b')],'$lte':_0x5ae6c6[_0x7d51('0x2a')]}});}if(_0x422c64[_0x7d51('0x29')][_0x7d51('0x3a')]){_0x46942b['where']=_[_0x7d51('0x38')](_0x46942b[_0x7d51('0x39')],{'$or':_['map'](_0x46942b[_0x7d51('0x2e')],function(_0x3ce886){var _0x49c60d={};_0x49c60d[_0x3ce886]={'$like':'%'+_0x422c64[_0x7d51('0x29')]['filter']+'%'};return _0x49c60d;})});}_0x46942b=_[_0x7d51('0x38')]({},_0x46942b,_0x422c64['options']);var _0x5b87fb={'where':_0x46942b[_0x7d51('0x39')]};_0x5b87fb['include']=[];if(_0x422c64[_0x7d51('0x29')][_0x7d51('0x3b')]){_0x5b87fb['include'][_0x7d51('0x3c')]({'model':db[_0x7d51('0x3d')],'as':'Tags','attributes':['id'],'where':{'id':_0x422c64['query'][_0x7d51('0x3b')]},'required':!![]});_0x5b87fb[_0x7d51('0x3e')]=!![];}return db['CmContact']['count'](_0x5b87fb)[_0x7d51('0x20')](function(_0x20366b){_0x356109[_0x7d51('0x1a')]=_0x20366b;if(_0x422c64['query'][_0x7d51('0x3f')]){_0x46942b[_0x7d51('0x40')]=[{'model':db[_0x7d51('0x3d')],'as':'Tags','attributes':['id',_0x7d51('0x24'),_0x7d51('0x41')],'required':_0x422c64[_0x7d51('0x29')]['tag']?!![]:![]},{'model':db[_0x7d51('0x3d')],'as':_0x7d51('0x42'),'attributes':['id',_0x7d51('0x24'),_0x7d51('0x41')],'through':_0x422c64[_0x7d51('0x29')][_0x7d51('0x3b')]?{'attributes':[],'where':{'TagId':_0x422c64[_0x7d51('0x29')][_0x7d51('0x3b')]||undefined}}:{},'required':_0x422c64[_0x7d51('0x29')][_0x7d51('0x3b')]?!![]:![]}];}return db[_0x7d51('0x43')][_0x7d51('0x44')](_0x46942b);})[_0x7d51('0x20')](function(_0xcea28f){_0x356109[_0x7d51('0x45')]=_0xcea28f;return _0x356109;})[_0x7d51('0x20')](respondWithFilteredResult(_0x3da100,_0x46942b))[_0x7d51('0x46')](handleError(_0x3da100,null));});};exports[_0x7d51('0x21')]=function(_0x124f65,_0x7cf987){return db[_0x7d51('0x43')][_0x7d51('0x47')]({'where':{'id':_0x124f65['params']['id']}})[_0x7d51('0x20')](handleEntityNotFound(_0x7cf987,null))[_0x7d51('0x20')](removeEntity(_0x7cf987,null))[_0x7d51('0x46')](handleError(_0x7cf987,null));};exports[_0x7d51('0x48')]=function(_0x25ee28,_0x2a6d47){return db['CmContact'][_0x7d51('0x48')]()['then'](respondWithResult(_0x2a6d47,null))['catch'](handleError(_0x2a6d47,null));};exports[_0x7d51('0x38')]=function(_0x27669f,_0x56df8e){var _0x4db475;var _0x4388a7;var _0x38424a;if(_0x27669f[_0x7d51('0x49')]['id']){delete _0x27669f[_0x7d51('0x49')]['id'];}return db[_0x7d51('0x43')]['findAll']({'where':{'id':[_0x27669f[_0x7d51('0x49')]['to'],_0x27669f[_0x7d51('0x49')][_0x7d51('0x4a')]]}})[_0x7d51('0x20')](function(_0x36a28c){if(_0x36a28c){if(_0x36a28c[_0x7d51('0x2f')]!==0x2){return null;}_0x36a28c[0x0]=_0x36a28c[0x0]['get']({'plain':!![]});_0x36a28c[0x1]=_0x36a28c[0x1][_0x7d51('0x4b')]({'plain':!![]});delete _0x36a28c[0x0]['id'];delete _0x36a28c[0x1]['id'];return _[_0x7d51('0x4c')](_0x36a28c[0x0],_0x36a28c[0x1],function(_0x5a4e37,_0x510ca1){if(Array[_0x7d51('0x4d')](_0x510ca1)&&!_0x510ca1[_0x7d51('0x2f')]){return _0x5a4e37;}else if(!_0x510ca1){return _0x5a4e37;}});}})[_0x7d51('0x20')](handleEntityNotFound(_0x56df8e,null))[_0x7d51('0x20')](function(_0x1e19fd){if(_0x1e19fd){if(_0x1e19fd['tags']&&_[_0x7d51('0x4d')](_0x1e19fd[_0x7d51('0x4e')])){_0x1e19fd[_0x7d51('0x4e')]=_0x1e19fd[_0x7d51('0x4e')]['join']();}logger[_0x7d51('0x4f')](_0x7d51('0x50'),_0x27669f['body']['to'],_0x27669f[_0x7d51('0x49')][_0x7d51('0x4a')]);return db[_0x7d51('0x51')][_0x7d51('0x21')]({'where':{'ContactId':[_0x27669f[_0x7d51('0x49')]['to'],_0x27669f[_0x7d51('0x49')][_0x7d51('0x4a')]]}})['then'](function(_0x9634a4){logger['info'](_0x7d51('0x52'),_0x9634a4);return db[_0x7d51('0x53')][_0x7d51('0x21')]({'where':{'ContactId':[_0x27669f[_0x7d51('0x49')]['to'],_0x27669f[_0x7d51('0x49')][_0x7d51('0x4a')]]}})[_0x7d51('0x20')](function(_0x2bec21){logger[_0x7d51('0x4f')](_0x7d51('0x54'),_0x2bec21);return db[_0x7d51('0x43')][_0x7d51('0x55')](_0x1e19fd);});});}})[_0x7d51('0x20')](function(_0x2033f8){if(_0x2033f8){_0x4db475=_0x2033f8;_0x4388a7={'ContactId':_0x4db475['id']};_0x38424a={'where':{'ContactId':[_0x27669f[_0x7d51('0x49')]['to'],_0x27669f['body'][_0x7d51('0x4a')]]}};return db[_0x7d51('0x56')][_0x7d51('0x1f')](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db[_0x7d51('0x57')][_0x7d51('0x1f')](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db['ChatOfflineMessage']['update'](_0x4388a7,_0x38424a);}})['then'](function(){if(_0x4db475){return db[_0x7d51('0x58')][_0x7d51('0x1f')](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db[_0x7d51('0x59')][_0x7d51('0x1f')](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db[_0x7d51('0x58')][_0x7d51('0x1f')](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db[_0x7d51('0x59')][_0x7d51('0x1f')](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db[_0x7d51('0x5a')][_0x7d51('0x1f')](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db[_0x7d51('0x5b')]['update'](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db[_0x7d51('0x5c')][_0x7d51('0x1f')](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db['FaxMessage'][_0x7d51('0x1f')](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db[_0x7d51('0x5d')]['update'](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db[_0x7d51('0x5e')][_0x7d51('0x1f')](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db[_0x7d51('0x5f')][_0x7d51('0x1f')](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db['CmHopperHistory']['update'](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db[_0x7d51('0x60')][_0x7d51('0x1f')](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db[_0x7d51('0x61')][_0x7d51('0x1f')](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db['ChatQueueReport'][_0x7d51('0x1f')](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db[_0x7d51('0x62')]['update'](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db[_0x7d51('0x63')][_0x7d51('0x1f')](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db[_0x7d51('0x64')][_0x7d51('0x1f')](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db[_0x7d51('0x65')][_0x7d51('0x1f')](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db['JscriptySessionReport'][_0x7d51('0x1f')](_0x4388a7,_0x38424a);}})[_0x7d51('0x20')](function(){if(_0x4db475){return db[_0x7d51('0x43')][_0x7d51('0x21')]({'where':{'id':[_0x27669f[_0x7d51('0x49')]['to'],_0x27669f[_0x7d51('0x49')][_0x7d51('0x4a')]]}});}})[_0x7d51('0x20')](function(){if(_0x4db475){return _0x4db475;}})['then'](respondWithResult(_0x56df8e,null))[_0x7d51('0x46')](handleError(_0x56df8e,null));};exports[_0x7d51('0x55')]=function(_0x3fe11e,_0x31cf65){return db[_0x7d51('0x43')]['describe']()[_0x7d51('0x20')](function(_0x354f90){if(_0x3fe11e[_0x7d51('0x49')][_0x7d51('0x4e')]&&_['isArray'](_0x3fe11e[_0x7d51('0x49')][_0x7d51('0x4e')])){if(_0x3fe11e['body'][_0x7d51('0x4e')][_0x7d51('0x2f')]){_0x3fe11e['body'][_0x7d51('0x4e')]=_0x3fe11e[_0x7d51('0x49')][_0x7d51('0x4e')][_0x7d51('0x66')](';')+';';}else{_0x3fe11e[_0x7d51('0x49')][_0x7d51('0x4e')]=null;}}else{_0x3fe11e['body'][_0x7d51('0x4e')]=null;}return db[_0x7d51('0x43')]['create'](_0x3fe11e[_0x7d51('0x49')],{'fields':_[_0x7d51('0x28')](_0x354f90),'raw':!![]});})[_0x7d51('0x20')](respondWithResult(_0x31cf65,0xc9))[_0x7d51('0x46')](handleError(_0x31cf65,null));};exports['bulkCreate']=function(_0x926724,_0x46608e){var _0xea6a1c=[];var _0x25b3b5=0x0;var _0x489265=0x0;var _0x3aa11f=0x0;return db[_0x7d51('0x43')][_0x7d51('0x48')]()[_0x7d51('0x20')](function(_0x1af356){return BPromise['each'](_0x926724['body'],function(_0x1be2bf){var _0x415271={'where':{'$or':[]},'defaults':_0x1be2bf,'fields':_[_0x7d51('0x28')](_0x1af356),'raw':!![]};if(_0x1be2bf[_0x7d51('0x67')]){for(var _0x2b422f=0x0;_0x2b422f<_0x1be2bf[_0x7d51('0x67')][_0x7d51('0x2f')];_0x2b422f++){var _0x4703f8={};_0x4703f8[_0x1be2bf[_0x7d51('0x67')][_0x2b422f]]=_0x1be2bf[_0x1be2bf[_0x7d51('0x67')][_0x2b422f]];_0x415271['where'][_0x7d51('0x68')]['push'](_0x4703f8);}_0x415271[_0x7d51('0x39')][_0x7d51('0x69')]=_0x1be2bf['ListId'];}return db[_0x7d51('0x43')][_0x7d51('0x6a')](_0x415271)[_0x7d51('0x6b')](function(_0x7c22b5,_0x55ffa9){if(_0x55ffa9){_0x25b3b5++;}else{_0x3aa11f++;}})[_0x7d51('0x46')](function(_0x30ab96){console[_0x7d51('0x23')](_0x30ab96);_0x489265++;});});})[_0x7d51('0x20')](function(_0x16f0d7){if(_0x16f0d7){return{'success':_0x25b3b5,'failure':_0x489265,'duplicates':_0x3aa11f};}})[_0x7d51('0x20')](respondWithResult(_0x46608e,0xc9))[_0x7d51('0x46')](handleError(_0x46608e,null));};exports[_0x7d51('0x6c')]=function(_0x383734,_0xa1e1cb,_0x426548){var _0x57cb9;return db[_0x7d51('0x43')][_0x7d51('0x48')]()[_0x7d51('0x20')](function(_0x1680b){return db[_0x7d51('0x43')][_0x7d51('0x47')]({'where':{'id':_0x383734[_0x7d51('0x6d')]['id']},'include':[{'model':db[_0x7d51('0x3d')],'as':'Tags','attributes':['id',_0x7d51('0x24'),_0x7d51('0x41')],'required':_0x383734['query'][_0x7d51('0x3b')]?!![]:![]}],'attributes':_[_0x7d51('0x28')](_0x1680b)});})[_0x7d51('0x20')](function(_0x548a7b){_0x57cb9=_0x548a7b[_0x7d51('0x4b')]({'plain':!![]});var _0x559eda={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x548a7b&&_0x548a7b['ListId']){if(_0x548a7b[_0x7d51('0x69')]){_0x559eda[_0x7d51('0x39')][_0x7d51('0x6e')][_0x7d51('0x3c')]({'ListId':{'$ne':_0x548a7b[_0x7d51('0x69')]}});}}return db['CmCustomField'][_0x7d51('0x44')](_0x559eda);})[_0x7d51('0x20')](function(_0x2d8a4d){return _['omit'](_0x57cb9,_[_0x7d51('0x6f')](_0x2d8a4d,function(_0x15f800){return util[_0x7d51('0x70')](_0x7d51('0x71'),_0x15f800['id']);}));})[_0x7d51('0x20')](handleEntityNotFound(_0xa1e1cb,null))['then'](respondWithResult(_0xa1e1cb,null))[_0x7d51('0x46')](handleError(_0xa1e1cb,null));};exports[_0x7d51('0x1f')]=function(_0xacef67,_0xf53e46){var _0x320ee7;if(_0xacef67[_0x7d51('0x49')]['id']){delete _0xacef67[_0x7d51('0x49')]['id'];}return db[_0x7d51('0x43')]['find']({'where':{'id':_0xacef67[_0x7d51('0x6d')]['id']}})[_0x7d51('0x20')](handleEntityNotFound(_0xf53e46,null))[_0x7d51('0x20')](saveUpdates(_0xacef67[_0x7d51('0x49')],null))[_0x7d51('0x20')](function(_0x1e0207){_0x320ee7=_0x1e0207;var _0x482e38={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x1e0207&&_0x1e0207[_0x7d51('0x69')]){if(_0x1e0207['ListId']){_0x482e38['where'][_0x7d51('0x6e')][_0x7d51('0x3c')]({'ListId':{'$ne':_0x1e0207[_0x7d51('0x69')]}});}}return db[_0x7d51('0x72')][_0x7d51('0x44')](_0x482e38);})[_0x7d51('0x20')](function(_0x22459f){if(_0x22459f){return _[_0x7d51('0x73')](_[_0x7d51('0x74')](_0xacef67['body'],function(_0x472746,_0x1a7524){return _[_0x7d51('0x75')](_0x1a7524,_0x7d51('0x76'));}),_[_0x7d51('0x6f')](_0x22459f,function(_0x3946f9){return util[_0x7d51('0x70')](_0x7d51('0x71'),_0x3946f9['id']);}));}})[_0x7d51('0x20')](function(_0x1652b2){if(_0x1652b2&&!_[_0x7d51('0x77')](_0x1652b2)){var _0x1377e3=squel['update']()[_0x7d51('0x78')](_0x7d51('0x79'))['setFields'](_0x1652b2)[_0x7d51('0x39')]('id\x20=\x20?',_0xacef67[_0x7d51('0x6d')]['id'])[_0x7d51('0x7a')]();return db[_0x7d51('0x7b')][_0x7d51('0x29')](_0x1377e3[_0x7d51('0x7c')],{'replacements':_0x1377e3[_0x7d51('0x7d')]});}})[_0x7d51('0x20')](function(){if(_0xacef67['body'][_0x7d51('0x7e')]&&_0x320ee7){return db[_0x7d51('0x51')][_0x7d51('0x1f')]({'phone':_0xacef67[_0x7d51('0x49')][_0x7d51('0x7e')]},{'where':{'ContactId':_0x320ee7['id']}});}})['then'](function(){return _0x320ee7;})[_0x7d51('0x20')](respondWithResult(_0xf53e46,null))[_0x7d51('0x46')](handleError(_0xf53e46,null));};exports[_0x7d51('0x7f')]=function(_0x559c25,_0xf9278d,_0x297432){var _0x6f917={};var _0x1c6c90={};var _0x2a9173;var _0x44e3e7;return db[_0x7d51('0x43')][_0x7d51('0x80')]({'where':{'id':_0x559c25[_0x7d51('0x6d')]['id']}})[_0x7d51('0x20')](handleEntityNotFound(_0xf9278d,null))['then'](function(_0x1fc47c){if(_0x1fc47c){_0x2a9173=_0x1fc47c;_0x1c6c90[_0x7d51('0x27')]=_[_0x7d51('0x28')](db['Tag']['rawAttributes']);_0x1c6c90['query']=_[_0x7d51('0x28')](_0x559c25['query']);_0x1c6c90[_0x7d51('0x2c')]=_[_0x7d51('0x2d')](_0x1c6c90['model'],_0x1c6c90[_0x7d51('0x29')]);_0x6f917['attributes']=_[_0x7d51('0x2d')](_0x1c6c90['model'],qs[_0x7d51('0x81')](_0x559c25[_0x7d51('0x29')][_0x7d51('0x81')]));_0x6f917['attributes']=_0x6f917[_0x7d51('0x2e')]['length']?_0x6f917[_0x7d51('0x2e')]:_0x1c6c90['model'];_0x6f917[_0x7d51('0x33')]=qs[_0x7d51('0x34')](_0x559c25[_0x7d51('0x29')][_0x7d51('0x34')]);_0x6f917[_0x7d51('0x39')]=qs['filters'](_['pick'](_0x559c25['query'],_0x1c6c90[_0x7d51('0x2c')]));if(_0x559c25[_0x7d51('0x29')][_0x7d51('0x3a')]){_0x6f917[_0x7d51('0x39')]=_['merge'](_0x6f917[_0x7d51('0x39')],{'$or':_[_0x7d51('0x6f')](_0x6f917[_0x7d51('0x2e')],function(_0x4ea05d){var _0x4759ad={};_0x4759ad[_0x4ea05d]={'$like':'%'+_0x559c25[_0x7d51('0x29')]['filter']+'%'};return _0x4759ad;})});}_0x6f917=_[_0x7d51('0x38')]({},_0x6f917,_0x559c25[_0x7d51('0x82')]);return _0x2a9173[_0x7d51('0x7f')](_0x6f917);}})[_0x7d51('0x20')](function(_0xedf662){if(_0xedf662){_0x44e3e7=_0xedf662['length'];if(!_0x559c25[_0x7d51('0x29')]['hasOwnProperty']('nolimit')){_0x6f917['limit']=qs[_0x7d51('0x1b')](_0x559c25['query'][_0x7d51('0x1b')]);_0x6f917[_0x7d51('0x32')]=qs[_0x7d51('0x32')](_0x559c25[_0x7d51('0x29')][_0x7d51('0x32')]);}return _0x2a9173[_0x7d51('0x7f')](_0x6f917);}})[_0x7d51('0x20')](function(_0x46d9b8){if(_0x46d9b8){return _0x46d9b8?{'count':_0x44e3e7,'rows':_0x46d9b8}:null;}})[_0x7d51('0x20')](respondWithResult(_0xf9278d,null))['catch'](handleError(_0xf9278d,null));};exports[_0x7d51('0x83')]=function(_0x19a4eb,_0xd7944f,_0xa21a0c){if(_0x19a4eb[_0x7d51('0x49')]['id']){delete _0x19a4eb[_0x7d51('0x49')]['id'];}return db[_0x7d51('0x43')][_0x7d51('0x80')]({'where':{'id':_0x19a4eb[_0x7d51('0x6d')]['id']}})[_0x7d51('0x20')](handleEntityNotFound(_0xd7944f,null))['then'](function(_0x52cfa8){if(_0x52cfa8){return _0x52cfa8[_0x7d51('0x83')](_0x19a4eb[_0x7d51('0x49')][_0x7d51('0x84')]||[]);}return null;})[_0x7d51('0x20')](respondWithResult(_0xd7944f,null))[_0x7d51('0x46')](handleError(_0xd7944f,null));};exports[_0x7d51('0x85')]=function(_0x2289c8,_0x419a9c,_0x2b4d20){var _0x4f09aa={'raw':![],'where':{}};var _0xa78ea4={};var _0x674e51={'count':0x0,'rows':[]};return db[_0x7d51('0x43')][_0x7d51('0x80')]({'where':{'id':_0x2289c8[_0x7d51('0x6d')]['id']}})[_0x7d51('0x20')](handleEntityNotFound(_0x419a9c,null))['then'](function(_0x1e9db4){if(_0x1e9db4){_0xa78ea4['model']=_[_0x7d51('0x28')](db[_0x7d51('0x51')][_0x7d51('0x86')]);_0xa78ea4[_0x7d51('0x29')]=_['keys'](_0x2289c8[_0x7d51('0x29')]);_0xa78ea4[_0x7d51('0x2c')]=_[_0x7d51('0x2d')](_0xa78ea4['model'],_0xa78ea4[_0x7d51('0x29')]);_0x4f09aa[_0x7d51('0x2e')]=_[_0x7d51('0x2d')](_0xa78ea4['model'],qs[_0x7d51('0x81')](_0x2289c8['query'][_0x7d51('0x81')]));_0x4f09aa[_0x7d51('0x2e')]=_0x4f09aa['attributes']['length']?_0x4f09aa[_0x7d51('0x2e')]:_0xa78ea4['model'];if(!_0x2289c8[_0x7d51('0x29')][_0x7d51('0x30')]('nolimit')){_0x4f09aa[_0x7d51('0x1b')]=qs[_0x7d51('0x1b')](_0x2289c8[_0x7d51('0x29')]['limit']);_0x4f09aa[_0x7d51('0x32')]=qs[_0x7d51('0x32')](_0x2289c8['query'][_0x7d51('0x32')]);}_0x4f09aa[_0x7d51('0x33')]=qs[_0x7d51('0x34')](_0x2289c8[_0x7d51('0x29')]['sort']);_0x4f09aa[_0x7d51('0x39')]=qs['filters'](_[_0x7d51('0x35')](_0x2289c8[_0x7d51('0x29')],_0xa78ea4[_0x7d51('0x2c')]));_0x4f09aa[_0x7d51('0x39')]['ContactId']=_0x1e9db4['id'];if(_0x2289c8['query'][_0x7d51('0x3a')]){_0x4f09aa[_0x7d51('0x39')]=_[_0x7d51('0x38')](_0x4f09aa[_0x7d51('0x39')],{'$or':_['map'](_0x4f09aa[_0x7d51('0x2e')],function(_0x102055){var _0x3d58a9={};_0x3d58a9[_0x102055]={'$like':'%'+_0x2289c8[_0x7d51('0x29')][_0x7d51('0x3a')]+'%'};return _0x3d58a9;})});}_0x4f09aa=_[_0x7d51('0x38')]({},_0x4f09aa,_0x2289c8[_0x7d51('0x82')]);return db[_0x7d51('0x51')][_0x7d51('0x1a')]({'where':_0x4f09aa['where']})[_0x7d51('0x20')](function(_0x5f05e0){_0x674e51[_0x7d51('0x1a')]=_0x5f05e0;if(_0x2289c8[_0x7d51('0x29')][_0x7d51('0x3f')]){_0x4f09aa['include']=[{'all':!![]}];}return db[_0x7d51('0x51')][_0x7d51('0x44')](_0x4f09aa);})[_0x7d51('0x20')](function(_0x40a2a2){_0x674e51[_0x7d51('0x45')]=_0x40a2a2;return _0x674e51;});}})['then'](respondWithFilteredResult(_0x419a9c,_0x4f09aa))[_0x7d51('0x46')](handleError(_0x419a9c,null));};exports[_0x7d51('0x87')]=function(_0x5e038b,_0x5e0edf,_0x2359a6){var _0x4341d2={'raw':!![],'where':{}};var _0x152934={};var _0x49ce31={'count':0x0,'rows':[]};return db[_0x7d51('0x43')][_0x7d51('0x80')]({'where':{'id':_0x5e038b[_0x7d51('0x6d')]['id']}})[_0x7d51('0x20')](handleEntityNotFound(_0x5e0edf,null))[_0x7d51('0x20')](function(_0x2bb982){if(_0x2bb982){_0x152934[_0x7d51('0x27')]=_['keys'](db[_0x7d51('0x88')][_0x7d51('0x86')]);_0x152934['query']=_[_0x7d51('0x28')](_0x5e038b['query']);_0x152934['filters']=_[_0x7d51('0x2d')](_0x152934['model'],_0x152934[_0x7d51('0x29')]);_0x4341d2['attributes']=_['intersection'](_0x152934[_0x7d51('0x27')],qs[_0x7d51('0x81')](_0x5e038b[_0x7d51('0x29')][_0x7d51('0x81')]));_0x4341d2[_0x7d51('0x2e')]=_0x4341d2[_0x7d51('0x2e')][_0x7d51('0x2f')]?_0x4341d2['attributes']:_0x152934[_0x7d51('0x27')];if(!_0x5e038b[_0x7d51('0x29')][_0x7d51('0x30')]('nolimit')){_0x4341d2[_0x7d51('0x1b')]=qs[_0x7d51('0x1b')](_0x5e038b[_0x7d51('0x29')][_0x7d51('0x1b')]);_0x4341d2['offset']=qs[_0x7d51('0x32')](_0x5e038b[_0x7d51('0x29')]['offset']);}_0x4341d2[_0x7d51('0x33')]=qs[_0x7d51('0x34')](_0x5e038b[_0x7d51('0x29')][_0x7d51('0x34')]);_0x4341d2[_0x7d51('0x39')]=qs[_0x7d51('0x2c')](_[_0x7d51('0x35')](_0x5e038b['query'],_0x152934['filters']));_0x4341d2['where'][_0x7d51('0x89')]=_0x2bb982['id'];if(_0x5e038b[_0x7d51('0x29')][_0x7d51('0x3a')]){_0x4341d2[_0x7d51('0x39')]=_['merge'](_0x4341d2['where'],{'$or':_[_0x7d51('0x6f')](_0x4341d2['attributes'],function(_0x57046d){var _0x1fe265={};_0x1fe265[_0x57046d]={'$like':'%'+_0x5e038b[_0x7d51('0x29')][_0x7d51('0x3a')]+'%'};return _0x1fe265;})});}_0x4341d2=_[_0x7d51('0x38')]({},_0x4341d2,_0x5e038b[_0x7d51('0x82')]);return db[_0x7d51('0x88')][_0x7d51('0x1a')]({'where':_0x4341d2[_0x7d51('0x39')]})['then'](function(_0x52a259){_0x49ce31['count']=_0x52a259;if(_0x5e038b[_0x7d51('0x29')][_0x7d51('0x3f')]){_0x4341d2['include']=[{'all':!![]}];}return db[_0x7d51('0x88')][_0x7d51('0x44')](_0x4341d2);})['then'](function(_0x47ea57){_0x49ce31[_0x7d51('0x45')]=_0x47ea57;return _0x49ce31;});}})['then'](respondWithFilteredResult(_0x5e0edf,_0x4341d2))[_0x7d51('0x46')](handleError(_0x5e0edf,null));};exports[_0x7d51('0x8a')]=function(_0x5bfa7d,_0x1aa315,_0x1aa518){var _0x290675={'raw':!![],'where':{}};var _0x3cc7dc={};var _0x2ff45b={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x5bfa7d[_0x7d51('0x6d')]['id']}})['then'](handleEntityNotFound(_0x1aa315,null))[_0x7d51('0x20')](function(_0x4cfcae){if(_0x4cfcae){_0x3cc7dc[_0x7d51('0x27')]=_[_0x7d51('0x28')](db[_0x7d51('0x5f')][_0x7d51('0x86')]);_0x3cc7dc[_0x7d51('0x29')]=_[_0x7d51('0x28')](_0x5bfa7d[_0x7d51('0x29')]);_0x3cc7dc[_0x7d51('0x2c')]=_[_0x7d51('0x2d')](_0x3cc7dc[_0x7d51('0x27')],_0x3cc7dc[_0x7d51('0x29')]);_0x290675[_0x7d51('0x2e')]=_[_0x7d51('0x2d')](_0x3cc7dc[_0x7d51('0x27')],qs[_0x7d51('0x81')](_0x5bfa7d[_0x7d51('0x29')][_0x7d51('0x81')]));_0x290675[_0x7d51('0x2e')]=_0x290675[_0x7d51('0x2e')][_0x7d51('0x2f')]?_0x290675['attributes']:_0x3cc7dc[_0x7d51('0x27')];if(!_0x5bfa7d[_0x7d51('0x29')][_0x7d51('0x30')](_0x7d51('0x31'))){_0x290675[_0x7d51('0x1b')]=qs[_0x7d51('0x1b')](_0x5bfa7d[_0x7d51('0x29')][_0x7d51('0x1b')]);_0x290675[_0x7d51('0x32')]=qs[_0x7d51('0x32')](_0x5bfa7d[_0x7d51('0x29')]['offset']);}_0x290675[_0x7d51('0x33')]=qs[_0x7d51('0x34')](_0x5bfa7d[_0x7d51('0x29')][_0x7d51('0x34')]);_0x290675['where']=qs[_0x7d51('0x2c')](_[_0x7d51('0x35')](_0x5bfa7d[_0x7d51('0x29')],_0x3cc7dc['filters']));_0x290675[_0x7d51('0x39')]['ContactId']=_0x4cfcae['id'];if(_0x5bfa7d['query'][_0x7d51('0x3a')]){_0x290675[_0x7d51('0x39')]=_[_0x7d51('0x38')](_0x290675['where'],{'$or':_['map'](_0x290675['attributes'],function(_0x33c2dc){var _0x474b21={};_0x474b21[_0x33c2dc]={'$like':'%'+_0x5bfa7d[_0x7d51('0x29')][_0x7d51('0x3a')]+'%'};return _0x474b21;})});}_0x290675=_[_0x7d51('0x38')]({},_0x290675,_0x5bfa7d[_0x7d51('0x82')]);return db['CmHopperFinal'][_0x7d51('0x1a')]({'where':_0x290675[_0x7d51('0x39')]})['then'](function(_0x2b98c2){_0x2ff45b['count']=_0x2b98c2;if(_0x5bfa7d['query'][_0x7d51('0x3f')]){_0x290675[_0x7d51('0x40')]=[{'all':!![]}];}return db[_0x7d51('0x5f')][_0x7d51('0x44')](_0x290675);})['then'](function(_0x161d3f){_0x2ff45b['rows']=_0x161d3f;return _0x2ff45b;});}})['then'](respondWithFilteredResult(_0x1aa315,_0x290675))[_0x7d51('0x46')](handleError(_0x1aa315,null));};exports[_0x7d51('0x8b')]=function(_0x73af88,_0x29a1e4,_0x45b227){var _0x579de6={'raw':!![],'where':{}};var _0x2d12b7={};var _0x4d6be5={'count':0x0,'rows':[]};return db['CmContact'][_0x7d51('0x80')]({'where':{'id':_0x73af88[_0x7d51('0x6d')]['id']}})[_0x7d51('0x20')](handleEntityNotFound(_0x29a1e4,null))[_0x7d51('0x20')](function(_0x173a12){if(_0x173a12){_0x2d12b7[_0x7d51('0x27')]=_['keys'](db[_0x7d51('0x8c')][_0x7d51('0x86')]);_0x2d12b7['query']=_['keys'](_0x73af88['query']);_0x2d12b7[_0x7d51('0x2c')]=_['intersection'](_0x2d12b7[_0x7d51('0x27')],_0x2d12b7[_0x7d51('0x29')]);_0x579de6[_0x7d51('0x2e')]=_[_0x7d51('0x2d')](_0x2d12b7[_0x7d51('0x27')],qs[_0x7d51('0x81')](_0x73af88[_0x7d51('0x29')][_0x7d51('0x81')]));_0x579de6[_0x7d51('0x2e')]=_0x579de6[_0x7d51('0x2e')][_0x7d51('0x2f')]?_0x579de6[_0x7d51('0x2e')]:_0x2d12b7[_0x7d51('0x27')];if(!_0x73af88[_0x7d51('0x29')][_0x7d51('0x30')](_0x7d51('0x31'))){_0x579de6[_0x7d51('0x1b')]=qs[_0x7d51('0x1b')](_0x73af88[_0x7d51('0x29')]['limit']);_0x579de6['offset']=qs['offset'](_0x73af88[_0x7d51('0x29')][_0x7d51('0x32')]);}_0x579de6['order']=qs['sort'](_0x73af88[_0x7d51('0x29')][_0x7d51('0x34')]);_0x579de6['where']=qs['filters'](_[_0x7d51('0x35')](_0x73af88[_0x7d51('0x29')],_0x2d12b7['filters']));_0x579de6[_0x7d51('0x39')][_0x7d51('0x89')]=_0x173a12['id'];if(_0x73af88[_0x7d51('0x29')][_0x7d51('0x3a')]){_0x579de6[_0x7d51('0x39')]=_[_0x7d51('0x38')](_0x579de6[_0x7d51('0x39')],{'$or':_[_0x7d51('0x6f')](_0x579de6['attributes'],function(_0x3658d4){var _0x3614b4={};_0x3614b4[_0x3658d4]={'$like':'%'+_0x73af88[_0x7d51('0x29')][_0x7d51('0x3a')]+'%'};return _0x3614b4;})});}_0x579de6=_[_0x7d51('0x38')]({},_0x579de6,_0x73af88['options']);return db[_0x7d51('0x8c')][_0x7d51('0x1a')]({'where':_0x579de6[_0x7d51('0x39')]})[_0x7d51('0x20')](function(_0x3618df){_0x4d6be5[_0x7d51('0x1a')]=_0x3618df;if(_0x73af88[_0x7d51('0x29')][_0x7d51('0x3f')]){_0x579de6[_0x7d51('0x40')]=[{'all':!![]}];}return db[_0x7d51('0x8c')][_0x7d51('0x44')](_0x579de6);})['then'](function(_0x4d28bc){_0x4d6be5[_0x7d51('0x45')]=_0x4d28bc;return _0x4d6be5;});}})['then'](respondWithFilteredResult(_0x29a1e4,_0x579de6))[_0x7d51('0x46')](handleError(_0x29a1e4,null));};exports[_0x7d51('0x8d')]=function(_0x3e8c12,_0x41641c,_0x3ffb74){try{if(!_0x3e8c12[_0x7d51('0x49')][_0x7d51('0x69')]){throw new Error(_0x7d51('0x8e'));}if(!_0x3e8c12[_0x7d51('0x49')]['binding_keys']){throw new Error(_0x7d51('0x8f'));}if(!_0x3e8c12['body']['binding_values']){throw new Error(_0x7d51('0x90'));}if(!_0x3e8c12[_0x7d51('0x49')]['socket_timestamp']){throw new Error(_0x7d51('0x91'));}var _0x4ba7c3=_0x3e8c12[_0x7d51('0x49')][_0x7d51('0x92')][_0x7d51('0x93')](',');var _0x4c0c81=_0x3e8c12[_0x7d51('0x49')][_0x7d51('0x94')][_0x7d51('0x93')](',');if(!_0x4ba7c3['length']||!_0x4c0c81['length']||_0x4ba7c3[_0x7d51('0x2f')]!==_0x4c0c81[_0x7d51('0x2f')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x3e8c12[_0x7d51('0x49')][_0x7d51('0x81')]=_[_0x7d51('0x95')](_0x4ba7c3,_0x4c0c81);if(!_0x3e8c12['body'][_0x7d51('0x81')][_0x7d51('0x7e')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x3e8c12[_0x7d51('0x49')][_0x7d51('0x81')][_0x7d51('0x96')]){throw new Error(_0x7d51('0x97'));}var _0x3b2aef=path['join'](config[_0x7d51('0x98')],_0x7d51('0x99'),_0x3e8c12[_0x7d51('0x9a')][_0x7d51('0x9b')]);fs['chmodSync'](_0x3b2aef,parseInt(_0x7d51('0x9c'),0x8));var _0x1b5c97=require(_0x7d51('0x9d'))['fork'](path[_0x7d51('0x66')](__dirname,'../../components/import/cm/csv'),[_0x3b2aef,_0x3e8c12[_0x7d51('0x49')][_0x7d51('0x92')],_0x3e8c12[_0x7d51('0x49')][_0x7d51('0x94')],_0x3e8c12[_0x7d51('0x49')][_0x7d51('0x69')],_0x3e8c12[_0x7d51('0x49')][_0x7d51('0x9e')],_0x3e8c12['body'][_0x7d51('0x67')],_0x3e8c12[_0x7d51('0x49')]['socket_timestamp']]);return _0x41641c[_0x7d51('0x19')](0xc8)['json']({'message':'File\x20uploaded\x20correctly!','pid':_0x1b5c97['pid']});}catch(_0x307bfa){return _0x41641c['status'](0x1f4)['send'](_0x307bfa);}};exports['upload']=function(_0xe24736,_0x5dd495,_0x541f50){var _0x3f75eb=fs[_0x7d51('0x9f')](_0xe24736[_0x7d51('0x9a')][_0x7d51('0x7')]);Papa[_0x7d51('0xa0')](_0x3f75eb,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x3fbd9f){return _0x5dd495['status'](0xc8)[_0x7d51('0x1d')]({'file':_0xe24736[_0x7d51('0x9a')],'fields':_0x3fbd9f[_0x7d51('0xa1')][_0x7d51('0x81')]});}});};exports[_0x7d51('0xa2')]=function(_0x5a277a,_0x35a4ac,_0x237d7a){return db[_0x7d51('0xa3')][_0x7d51('0x44')]({'raw':!![],'attributes':['id'],'where':{'role':_0x7d51('0xa4')}})[_0x7d51('0x20')](function(_0x2e142a){var _0xaf8dd3=![];if(!_0x5a277a['body'][_0x7d51('0x69')]){throw new Error(_0x7d51('0x8e'));}if(!_0x5a277a[_0x7d51('0x49')][_0x7d51('0xa5')][_0x7d51('0x7e')]){throw new Error(_0x7d51('0xa6'));}if(!_0x5a277a[_0x7d51('0x49')][_0x7d51('0xa5')][_0x7d51('0x96')]){throw new Error(_0x7d51('0x97'));}if(!_0x5a277a[_0x7d51('0x49')][_0x7d51('0xa7')]){throw new Error(_0x7d51('0x91'));}var _0x44f1fd=require(_0x7d51('0x9d'))['fork'](path[_0x7d51('0x66')](__dirname,_0x7d51('0xa8')),[_0x5a277a['params']['id'],JSON[_0x7d51('0xa9')](_0x5a277a[_0x7d51('0x49')]),JSON[_0x7d51('0xa9')](_0x2e142a)]);_0x44f1fd['on'](_0x7d51('0xaa'),function(_0x382063){_0xaf8dd3=!![];return _0x35a4ac[_0x7d51('0x19')](0xc8)[_0x7d51('0x1d')]({'message':_0x7d51('0xab'),'pid':_0x44f1fd[_0x7d51('0xac')]});});_0x44f1fd['on']('exit',function(_0x1e2eca){if(_0x1e2eca&&!_0xaf8dd3){return _0x35a4ac[_0x7d51('0x19')](0x1f4)['json']({'message':'error\x20child\x20process','pid':_0x44f1fd[_0x7d51('0xac')]});}});})[_0x7d51('0x46')](handleError(_0x35a4ac,null));};
\ No newline at end of file
+var _0xe678=['json','limit','set','Content-Range','apply','save','update','destroy','sendStatus','stack','name','send','index','describe','then','model','query','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','dateStart','add','day','filter','merge','map','options','include','tag','push','Tags','distinct','count','includeAll','Tag','color','CmContact','findAll','rows','catch','params','body','from','mergeWith','tags','isArray','join','info','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','bulkCreate','each','duplicates','$or','ListId','findOrCreate','error','show','find','keys','$and','omit','format','cf_%d','CmCustomField','pickBy','startsWith','cf_','isEmpty','table','cm_contacts','id\x20=\x20?','toParam','sequelize','phone','CmHopper','getTags','findOne','pick','getHopperHistories','rawAttributes','ContactId','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','split','Incorrect\x20binding\x20parameters\x20passed!','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','chmodSync','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','agent','binding','No\x20phone\x20column\x20specified','firstName','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./cmContact.socket','status','end'];(function(_0x33e402,_0x4933ce){var _0x23f98f=function(_0x2009f0){while(--_0x2009f0){_0x33e402['push'](_0x33e402['shift']());}};_0x23f98f(++_0x4933ce);}(_0xe678,0x95));var _0x8e67=function(_0x186ab2,_0x73746e){_0x186ab2=_0x186ab2-0x0;var _0x117f8a=_0xe678[_0x186ab2];return _0x117f8a;};'use strict';var pdf=require(_0x8e67('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8e67('0x1'));var jsonpatch=require(_0x8e67('0x2'));var rp=require(_0x8e67('0x3'));var moment=require(_0x8e67('0x4'));var BPromise=require(_0x8e67('0x5'));var Mustache=require(_0x8e67('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8e67('0x7'));var csv=require('to-csv');var ejs=require(_0x8e67('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8e67('0x9'));var crypto=require(_0x8e67('0xa'));var jsforce=require(_0x8e67('0xb'));var deskjs=require(_0x8e67('0xc'));var toCsv=require(_0x8e67('0xd'));var querystring=require(_0x8e67('0xe'));var Papa=require('papaparse');var qs=require(_0x8e67('0xf'));var logger=require(_0x8e67('0x10'))(_0x8e67('0x11'));var utils=require('../../config/utils');var config=require(_0x8e67('0x12'));var db=require(_0x8e67('0x13'))['db'];var socket=require(_0x8e67('0x14'))({'host':_0x8e67('0x15'),'port':0x18eb});require(_0x8e67('0x16'))['register'](socket);function respondWithStatusCode(_0x96f3f,_0x5b45c0){_0x5b45c0=_0x5b45c0||0xcc;return function(_0x544764){if(_0x544764){return _0x96f3f['sendStatus'](_0x5b45c0);}return _0x96f3f[_0x8e67('0x17')](_0x5b45c0)[_0x8e67('0x18')]();};}function respondWithResult(_0x3395c4,_0x37b974){_0x37b974=_0x37b974||0xc8;return function(_0xe1b6e4){if(_0xe1b6e4){return _0x3395c4[_0x8e67('0x17')](_0x37b974)[_0x8e67('0x19')](_0xe1b6e4);}};}function respondWithFilteredResult(_0xf36c44,_0x5b53d0){return function(_0x408c93){if(_0x408c93){var _0x91ae28=_0x408c93['count'],_0x44549b=_0x5b53d0['offset'],_0x3f21b1=_0x5b53d0['offset']+_0x5b53d0[_0x8e67('0x1a')],_0x10228c;if(_0x3f21b1>=_0x91ae28){_0x3f21b1=_0x91ae28;_0x10228c=0xc8;}else{_0x10228c=0xce;}_0xf36c44[_0x8e67('0x17')](_0x10228c);return _0xf36c44[_0x8e67('0x1b')](_0x8e67('0x1c'),_0x44549b+'-'+_0x3f21b1+'/'+_0x91ae28)[_0x8e67('0x19')](_0x408c93);}return null;};}function patchUpdates(_0x2d8dec){return function(_0x55a80d){try{jsonpatch[_0x8e67('0x1d')](_0x55a80d,_0x2d8dec,!![]);}catch(_0x5bcda4){return BPromise['reject'](_0x5bcda4);}return _0x55a80d[_0x8e67('0x1e')]();};}function saveUpdates(_0x270657,_0x4f8836){return function(_0x120a86){if(_0x120a86){return _0x120a86[_0x8e67('0x1f')](_0x270657)['then'](function(_0x1a4fc2){return _0x1a4fc2;});}return null;};}function removeEntity(_0x2aa771,_0x3ccbda){return function(_0x40f02a){if(_0x40f02a){return _0x40f02a[_0x8e67('0x20')]()['then'](function(){_0x2aa771['status'](0xcc)[_0x8e67('0x18')]();});}};}function handleEntityNotFound(_0x11f3fd,_0xf66e13){return function(_0x5d0489){if(!_0x5d0489){_0x11f3fd[_0x8e67('0x21')](0x194);}return _0x5d0489;};}function handleError(_0x396c09,_0x42a317){_0x42a317=_0x42a317||0x1f4;return function(_0x15b1a8){logger['error'](_0x15b1a8[_0x8e67('0x22')]);if(_0x15b1a8[_0x8e67('0x23')]){delete _0x15b1a8['name'];}_0x396c09[_0x8e67('0x17')](_0x42a317)[_0x8e67('0x24')](_0x15b1a8);};}exports[_0x8e67('0x25')]=function(_0x173bd3,_0x15b75d){var _0x7bac28={},_0x245837={},_0x1cd481={'count':0x0,'rows':[]};return db['CmContact'][_0x8e67('0x26')]()[_0x8e67('0x27')](function(_0x3ee75b){_0x245837[_0x8e67('0x28')]=_['keys'](_0x3ee75b);var _0x59f898={'dateStart':_0x173bd3[_0x8e67('0x29')]['dateStart'],'dateEnd':_0x173bd3[_0x8e67('0x29')]['dateEnd']};delete _0x173bd3[_0x8e67('0x29')]['dateStart'];delete _0x173bd3[_0x8e67('0x29')][_0x8e67('0x2a')];_0x245837[_0x8e67('0x29')]=_['keys'](_0x173bd3['query']);_0x245837[_0x8e67('0x2b')]=_[_0x8e67('0x2c')](_0x245837[_0x8e67('0x28')],_0x245837[_0x8e67('0x29')]);_0x7bac28[_0x8e67('0x2d')]=_[_0x8e67('0x2c')](_0x245837[_0x8e67('0x28')],qs[_0x8e67('0x2e')](_0x173bd3[_0x8e67('0x29')][_0x8e67('0x2e')]));_0x7bac28[_0x8e67('0x2d')]=_0x7bac28['attributes'][_0x8e67('0x2f')]?_0x7bac28[_0x8e67('0x2d')]:_0x245837[_0x8e67('0x28')];if(!_0x173bd3['query'][_0x8e67('0x30')](_0x8e67('0x31'))){_0x7bac28['limit']=qs[_0x8e67('0x1a')](_0x173bd3[_0x8e67('0x29')][_0x8e67('0x1a')]);_0x7bac28[_0x8e67('0x32')]=qs[_0x8e67('0x32')](_0x173bd3[_0x8e67('0x29')][_0x8e67('0x32')]);}_0x7bac28[_0x8e67('0x33')]=qs[_0x8e67('0x34')](_0x173bd3[_0x8e67('0x29')]['sort']);_0x7bac28[_0x8e67('0x35')]=qs['filters'](_['pick'](_0x173bd3[_0x8e67('0x29')],_0x245837[_0x8e67('0x2b')]));if(_0x59f898[_0x8e67('0x36')]){if(_0x59f898['dateEnd']){_0x59f898[_0x8e67('0x2a')]=moment(_0x59f898[_0x8e67('0x2a')])[_0x8e67('0x37')](0x1,_0x8e67('0x38'));}else{_0x59f898[_0x8e67('0x2a')]=moment(_0x59f898[_0x8e67('0x36')])[_0x8e67('0x37')](0x1,_0x8e67('0x38'));}_['merge'](_0x7bac28['where'],{'createdAt':{'$gte':_0x59f898[_0x8e67('0x36')],'$lte':_0x59f898[_0x8e67('0x2a')]}});}if(_0x173bd3[_0x8e67('0x29')][_0x8e67('0x39')]){_0x7bac28[_0x8e67('0x35')]=_[_0x8e67('0x3a')](_0x7bac28['where'],{'$or':_[_0x8e67('0x3b')](_0x7bac28[_0x8e67('0x2d')],function(_0xab3c70){var _0x57be48={};_0x57be48[_0xab3c70]={'$like':'%'+_0x173bd3[_0x8e67('0x29')][_0x8e67('0x39')]+'%'};return _0x57be48;})});}_0x7bac28=_['merge']({},_0x7bac28,_0x173bd3[_0x8e67('0x3c')]);var _0x185426={'where':_0x7bac28[_0x8e67('0x35')]};_0x185426[_0x8e67('0x3d')]=[];if(_0x173bd3[_0x8e67('0x29')][_0x8e67('0x3e')]){_0x185426['include'][_0x8e67('0x3f')]({'model':db['Tag'],'as':_0x8e67('0x40'),'attributes':['id'],'where':{'id':_0x173bd3['query']['tag']},'required':!![]});_0x185426[_0x8e67('0x41')]=!![];}return db['CmContact'][_0x8e67('0x42')](_0x185426)[_0x8e67('0x27')](function(_0x4cf5cf){_0x1cd481[_0x8e67('0x42')]=_0x4cf5cf;if(_0x173bd3['query'][_0x8e67('0x43')]){_0x7bac28['include']=[{'model':db[_0x8e67('0x44')],'as':_0x8e67('0x40'),'attributes':['id',_0x8e67('0x23'),'color'],'required':_0x173bd3[_0x8e67('0x29')][_0x8e67('0x3e')]?!![]:![]},{'model':db[_0x8e67('0x44')],'as':'ThroughTags','attributes':['id',_0x8e67('0x23'),_0x8e67('0x45')],'through':_0x173bd3[_0x8e67('0x29')][_0x8e67('0x3e')]?{'attributes':[],'where':{'TagId':_0x173bd3[_0x8e67('0x29')][_0x8e67('0x3e')]||undefined}}:{},'required':_0x173bd3[_0x8e67('0x29')]['tag']?!![]:![]}];}return db[_0x8e67('0x46')][_0x8e67('0x47')](_0x7bac28);})['then'](function(_0x5ce480){_0x1cd481[_0x8e67('0x48')]=_0x5ce480;return _0x1cd481;})[_0x8e67('0x27')](respondWithFilteredResult(_0x15b75d,_0x7bac28))[_0x8e67('0x49')](handleError(_0x15b75d,null));});};exports['destroy']=function(_0x3c4796,_0x33efdd){return db[_0x8e67('0x46')]['find']({'where':{'id':_0x3c4796[_0x8e67('0x4a')]['id']}})[_0x8e67('0x27')](handleEntityNotFound(_0x33efdd,null))[_0x8e67('0x27')](removeEntity(_0x33efdd,null))[_0x8e67('0x49')](handleError(_0x33efdd,null));};exports[_0x8e67('0x26')]=function(_0x263228,_0x2eae42){return db['CmContact']['describe']()[_0x8e67('0x27')](respondWithResult(_0x2eae42,null))['catch'](handleError(_0x2eae42,null));};exports['merge']=function(_0xea82b3,_0x3535c7){var _0x671b75;var _0x9ea8a3;var _0x4c3b98;if(_0xea82b3['body']['id']){delete _0xea82b3[_0x8e67('0x4b')]['id'];}return db[_0x8e67('0x46')]['findAll']({'where':{'id':[_0xea82b3[_0x8e67('0x4b')]['to'],_0xea82b3['body'][_0x8e67('0x4c')]]}})[_0x8e67('0x27')](function(_0x2a00b4){if(_0x2a00b4){if(_0x2a00b4[_0x8e67('0x2f')]!==0x2){return null;}_0x2a00b4[0x0]=_0x2a00b4[0x0]['get']({'plain':!![]});_0x2a00b4[0x1]=_0x2a00b4[0x1]['get']({'plain':!![]});delete _0x2a00b4[0x0]['id'];delete _0x2a00b4[0x1]['id'];return _[_0x8e67('0x4d')](_0x2a00b4[0x0],_0x2a00b4[0x1],function(_0x4ed3c4,_0x18eeec){if(Array['isArray'](_0x18eeec)&&!_0x18eeec['length']){return _0x4ed3c4;}else if(!_0x18eeec){return _0x4ed3c4;}});}})[_0x8e67('0x27')](handleEntityNotFound(_0x3535c7,null))[_0x8e67('0x27')](function(_0x14fb3a){if(_0x14fb3a){if(_0x14fb3a[_0x8e67('0x4e')]&&_[_0x8e67('0x4f')](_0x14fb3a['tags'])){_0x14fb3a['tags']=_0x14fb3a[_0x8e67('0x4e')][_0x8e67('0x50')]();}logger[_0x8e67('0x51')]('[CmContact][merge]\x20to\x20%s\x20from\x20%s',_0xea82b3['body']['to'],_0xea82b3[_0x8e67('0x4b')]['from']);return db['CmHopper'][_0x8e67('0x20')]({'where':{'ContactId':[_0xea82b3[_0x8e67('0x4b')]['to'],_0xea82b3[_0x8e67('0x4b')][_0x8e67('0x4c')]]}})[_0x8e67('0x27')](function(_0x119a53){logger[_0x8e67('0x51')](_0x8e67('0x52'),_0x119a53);return db['CmHopperBlack'][_0x8e67('0x20')]({'where':{'ContactId':[_0xea82b3[_0x8e67('0x4b')]['to'],_0xea82b3[_0x8e67('0x4b')][_0x8e67('0x4c')]]}})['then'](function(_0x2ac659){logger[_0x8e67('0x51')](_0x8e67('0x53'),_0x2ac659);return db[_0x8e67('0x46')][_0x8e67('0x54')](_0x14fb3a);});});}})['then'](function(_0x4d7212){if(_0x4d7212){_0x671b75=_0x4d7212;_0x9ea8a3={'ContactId':_0x671b75['id']};_0x4c3b98={'where':{'ContactId':[_0xea82b3[_0x8e67('0x4b')]['to'],_0xea82b3['body'][_0x8e67('0x4c')]]}};return db[_0x8e67('0x55')]['update'](_0x9ea8a3,_0x4c3b98);}})[_0x8e67('0x27')](function(){if(_0x671b75){return db[_0x8e67('0x56')][_0x8e67('0x1f')](_0x9ea8a3,_0x4c3b98);}})[_0x8e67('0x27')](function(){if(_0x671b75){return db[_0x8e67('0x57')]['update'](_0x9ea8a3,_0x4c3b98);}})['then'](function(){if(_0x671b75){return db['MailInteraction'][_0x8e67('0x1f')](_0x9ea8a3,_0x4c3b98);}})[_0x8e67('0x27')](function(){if(_0x671b75){return db[_0x8e67('0x58')][_0x8e67('0x1f')](_0x9ea8a3,_0x4c3b98);}})[_0x8e67('0x27')](function(){if(_0x671b75){return db[_0x8e67('0x59')][_0x8e67('0x1f')](_0x9ea8a3,_0x4c3b98);}})[_0x8e67('0x27')](function(){if(_0x671b75){return db['MailMessage'][_0x8e67('0x1f')](_0x9ea8a3,_0x4c3b98);}})[_0x8e67('0x27')](function(){if(_0x671b75){return db[_0x8e67('0x5a')][_0x8e67('0x1f')](_0x9ea8a3,_0x4c3b98);}})[_0x8e67('0x27')](function(){if(_0x671b75){return db[_0x8e67('0x5b')][_0x8e67('0x1f')](_0x9ea8a3,_0x4c3b98);}})[_0x8e67('0x27')](function(){if(_0x671b75){return db[_0x8e67('0x5c')][_0x8e67('0x1f')](_0x9ea8a3,_0x4c3b98);}})[_0x8e67('0x27')](function(){if(_0x671b75){return db['FaxMessage'][_0x8e67('0x1f')](_0x9ea8a3,_0x4c3b98);}})[_0x8e67('0x27')](function(){if(_0x671b75){return db['OpenchannelInteraction']['update'](_0x9ea8a3,_0x4c3b98);}})['then'](function(){if(_0x671b75){return db[_0x8e67('0x5d')]['update'](_0x9ea8a3,_0x4c3b98);}})['then'](function(){if(_0x671b75){return db[_0x8e67('0x5e')][_0x8e67('0x1f')](_0x9ea8a3,_0x4c3b98);}})[_0x8e67('0x27')](function(){if(_0x671b75){return db[_0x8e67('0x5f')][_0x8e67('0x1f')](_0x9ea8a3,_0x4c3b98);}})[_0x8e67('0x27')](function(){if(_0x671b75){return db[_0x8e67('0x60')][_0x8e67('0x1f')](_0x9ea8a3,_0x4c3b98);}})[_0x8e67('0x27')](function(){if(_0x671b75){return db[_0x8e67('0x61')]['update'](_0x9ea8a3,_0x4c3b98);}})[_0x8e67('0x27')](function(){if(_0x671b75){return db[_0x8e67('0x62')][_0x8e67('0x1f')](_0x9ea8a3,_0x4c3b98);}})[_0x8e67('0x27')](function(){if(_0x671b75){return db[_0x8e67('0x63')][_0x8e67('0x1f')](_0x9ea8a3,_0x4c3b98);}})['then'](function(){if(_0x671b75){return db[_0x8e67('0x64')]['update'](_0x9ea8a3,_0x4c3b98);}})[_0x8e67('0x27')](function(){if(_0x671b75){return db[_0x8e67('0x65')][_0x8e67('0x1f')](_0x9ea8a3,_0x4c3b98);}})['then'](function(){if(_0x671b75){return db[_0x8e67('0x66')][_0x8e67('0x1f')](_0x9ea8a3,_0x4c3b98);}})['then'](function(){if(_0x671b75){return db[_0x8e67('0x67')][_0x8e67('0x1f')](_0x9ea8a3,_0x4c3b98);}})[_0x8e67('0x27')](function(){if(_0x671b75){return db[_0x8e67('0x46')]['destroy']({'where':{'id':[_0xea82b3[_0x8e67('0x4b')]['to'],_0xea82b3[_0x8e67('0x4b')][_0x8e67('0x4c')]]}});}})['then'](function(){if(_0x671b75){return _0x671b75;}})['then'](respondWithResult(_0x3535c7,null))[_0x8e67('0x49')](handleError(_0x3535c7,null));};exports['create']=function(_0x5a07bd,_0x57c3d6){return db[_0x8e67('0x46')]['describe']()[_0x8e67('0x27')](function(_0x435717){if(_0x5a07bd[_0x8e67('0x4b')][_0x8e67('0x4e')]&&_['isArray'](_0x5a07bd[_0x8e67('0x4b')][_0x8e67('0x4e')])){if(_0x5a07bd[_0x8e67('0x4b')]['tags'][_0x8e67('0x2f')]){_0x5a07bd[_0x8e67('0x4b')][_0x8e67('0x4e')]=_0x5a07bd[_0x8e67('0x4b')][_0x8e67('0x4e')][_0x8e67('0x50')](';')+';';}else{_0x5a07bd['body'][_0x8e67('0x4e')]=null;}}else{_0x5a07bd[_0x8e67('0x4b')][_0x8e67('0x4e')]=null;}return db[_0x8e67('0x46')]['create'](_0x5a07bd[_0x8e67('0x4b')],{'fields':_['keys'](_0x435717),'raw':!![]});})[_0x8e67('0x27')](respondWithResult(_0x57c3d6,0xc9))[_0x8e67('0x49')](handleError(_0x57c3d6,null));};exports[_0x8e67('0x68')]=function(_0x5bb9d0,_0x398dde){var _0x34446f=[];var _0x11ebe2=0x0;var _0x2e0ba0=0x0;var _0x144154=0x0;return db[_0x8e67('0x46')][_0x8e67('0x26')]()[_0x8e67('0x27')](function(_0x3fc43d){return BPromise[_0x8e67('0x69')](_0x5bb9d0[_0x8e67('0x4b')],function(_0x598708){var _0x193086={'where':{'$or':[]},'defaults':_0x598708,'fields':_['keys'](_0x3fc43d),'raw':!![]};if(_0x598708[_0x8e67('0x6a')]){for(var _0x50389c=0x0;_0x50389c<_0x598708['duplicates'][_0x8e67('0x2f')];_0x50389c++){var _0x4cc3c2={};_0x4cc3c2[_0x598708[_0x8e67('0x6a')][_0x50389c]]=_0x598708[_0x598708[_0x8e67('0x6a')][_0x50389c]];_0x193086[_0x8e67('0x35')][_0x8e67('0x6b')]['push'](_0x4cc3c2);}_0x193086[_0x8e67('0x35')][_0x8e67('0x6c')]=_0x598708[_0x8e67('0x6c')];}return db[_0x8e67('0x46')][_0x8e67('0x6d')](_0x193086)['spread'](function(_0x128918,_0x4a3540){if(_0x4a3540){_0x11ebe2++;}else{_0x144154++;}})[_0x8e67('0x49')](function(_0x51de97){console[_0x8e67('0x6e')](_0x51de97);_0x2e0ba0++;});});})[_0x8e67('0x27')](function(_0x3f2c0a){if(_0x3f2c0a){return{'success':_0x11ebe2,'failure':_0x2e0ba0,'duplicates':_0x144154};}})[_0x8e67('0x27')](respondWithResult(_0x398dde,0xc9))[_0x8e67('0x49')](handleError(_0x398dde,null));};exports[_0x8e67('0x6f')]=function(_0x5262b2,_0x38c93d,_0x16ef31){var _0x2ab89f;return db[_0x8e67('0x46')][_0x8e67('0x26')]()['then'](function(_0x44bdb4){return db['CmContact'][_0x8e67('0x70')]({'where':{'id':_0x5262b2['params']['id']},'include':[{'model':db[_0x8e67('0x44')],'as':_0x8e67('0x40'),'attributes':['id',_0x8e67('0x23'),_0x8e67('0x45')],'required':_0x5262b2[_0x8e67('0x29')][_0x8e67('0x3e')]?!![]:![]}],'attributes':_[_0x8e67('0x71')](_0x44bdb4)});})[_0x8e67('0x27')](function(_0x1f905a){_0x2ab89f=_0x1f905a['get']({'plain':!![]});var _0x47ea3f={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x1f905a&&_0x1f905a[_0x8e67('0x6c')]){if(_0x1f905a[_0x8e67('0x6c')]){_0x47ea3f['where'][_0x8e67('0x72')][_0x8e67('0x3f')]({'ListId':{'$ne':_0x1f905a[_0x8e67('0x6c')]}});}}return db['CmCustomField'][_0x8e67('0x47')](_0x47ea3f);})['then'](function(_0x56fd07){return _[_0x8e67('0x73')](_0x2ab89f,_[_0x8e67('0x3b')](_0x56fd07,function(_0x231e4e){return util[_0x8e67('0x74')](_0x8e67('0x75'),_0x231e4e['id']);}));})[_0x8e67('0x27')](handleEntityNotFound(_0x38c93d,null))['then'](respondWithResult(_0x38c93d,null))[_0x8e67('0x49')](handleError(_0x38c93d,null));};exports[_0x8e67('0x1f')]=function(_0x2522cc,_0x1bf4d7){var _0x175b62;if(_0x2522cc['body']['id']){delete _0x2522cc[_0x8e67('0x4b')]['id'];}return db['CmContact'][_0x8e67('0x70')]({'where':{'id':_0x2522cc[_0x8e67('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1bf4d7,null))['then'](saveUpdates(_0x2522cc[_0x8e67('0x4b')],null))['then'](function(_0x985c58){_0x175b62=_0x985c58;var _0xfe1d39={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x985c58&&_0x985c58['ListId']){if(_0x985c58['ListId']){_0xfe1d39[_0x8e67('0x35')][_0x8e67('0x72')]['push']({'ListId':{'$ne':_0x985c58[_0x8e67('0x6c')]}});}}return db[_0x8e67('0x76')]['findAll'](_0xfe1d39);})['then'](function(_0x1aceb0){if(_0x1aceb0){return _[_0x8e67('0x73')](_[_0x8e67('0x77')](_0x2522cc[_0x8e67('0x4b')],function(_0x4be3ae,_0x4b7b45){return _[_0x8e67('0x78')](_0x4b7b45,_0x8e67('0x79'));}),_[_0x8e67('0x3b')](_0x1aceb0,function(_0x2f9d47){return util['format'](_0x8e67('0x75'),_0x2f9d47['id']);}));}})['then'](function(_0x245231){if(_0x245231&&!_[_0x8e67('0x7a')](_0x245231)){var _0x3467e3=squel[_0x8e67('0x1f')]()[_0x8e67('0x7b')](_0x8e67('0x7c'))['setFields'](_0x245231)[_0x8e67('0x35')](_0x8e67('0x7d'),_0x2522cc[_0x8e67('0x4a')]['id'])[_0x8e67('0x7e')]();return db[_0x8e67('0x7f')][_0x8e67('0x29')](_0x3467e3['text'],{'replacements':_0x3467e3['values']});}})[_0x8e67('0x27')](function(){if(_0x2522cc[_0x8e67('0x4b')][_0x8e67('0x80')]&&_0x175b62){return db[_0x8e67('0x81')][_0x8e67('0x1f')]({'phone':_0x2522cc[_0x8e67('0x4b')][_0x8e67('0x80')]},{'where':{'ContactId':_0x175b62['id']}});}})[_0x8e67('0x27')](function(){return _0x175b62;})['then'](respondWithResult(_0x1bf4d7,null))[_0x8e67('0x49')](handleError(_0x1bf4d7,null));};exports[_0x8e67('0x82')]=function(_0x306123,_0x44633e,_0x2d0deb){var _0xb3a530={};var _0xc38691={};var _0x2b14aa;var _0x2fbede;return db['CmContact'][_0x8e67('0x83')]({'where':{'id':_0x306123[_0x8e67('0x4a')]['id']}})[_0x8e67('0x27')](handleEntityNotFound(_0x44633e,null))[_0x8e67('0x27')](function(_0x458275){if(_0x458275){_0x2b14aa=_0x458275;_0xc38691['model']=_[_0x8e67('0x71')](db[_0x8e67('0x44')]['rawAttributes']);_0xc38691[_0x8e67('0x29')]=_[_0x8e67('0x71')](_0x306123['query']);_0xc38691[_0x8e67('0x2b')]=_[_0x8e67('0x2c')](_0xc38691['model'],_0xc38691[_0x8e67('0x29')]);_0xb3a530[_0x8e67('0x2d')]=_['intersection'](_0xc38691[_0x8e67('0x28')],qs[_0x8e67('0x2e')](_0x306123['query'][_0x8e67('0x2e')]));_0xb3a530[_0x8e67('0x2d')]=_0xb3a530[_0x8e67('0x2d')][_0x8e67('0x2f')]?_0xb3a530[_0x8e67('0x2d')]:_0xc38691['model'];_0xb3a530['order']=qs[_0x8e67('0x34')](_0x306123[_0x8e67('0x29')][_0x8e67('0x34')]);_0xb3a530['where']=qs[_0x8e67('0x2b')](_[_0x8e67('0x84')](_0x306123[_0x8e67('0x29')],_0xc38691['filters']));if(_0x306123[_0x8e67('0x29')]['filter']){_0xb3a530[_0x8e67('0x35')]=_[_0x8e67('0x3a')](_0xb3a530[_0x8e67('0x35')],{'$or':_[_0x8e67('0x3b')](_0xb3a530[_0x8e67('0x2d')],function(_0x124ae6){var _0x15e812={};_0x15e812[_0x124ae6]={'$like':'%'+_0x306123[_0x8e67('0x29')]['filter']+'%'};return _0x15e812;})});}_0xb3a530=_[_0x8e67('0x3a')]({},_0xb3a530,_0x306123[_0x8e67('0x3c')]);return _0x2b14aa[_0x8e67('0x82')](_0xb3a530);}})[_0x8e67('0x27')](function(_0x5b663e){if(_0x5b663e){_0x2fbede=_0x5b663e[_0x8e67('0x2f')];if(!_0x306123[_0x8e67('0x29')]['hasOwnProperty']('nolimit')){_0xb3a530[_0x8e67('0x1a')]=qs[_0x8e67('0x1a')](_0x306123[_0x8e67('0x29')]['limit']);_0xb3a530['offset']=qs[_0x8e67('0x32')](_0x306123[_0x8e67('0x29')][_0x8e67('0x32')]);}return _0x2b14aa[_0x8e67('0x82')](_0xb3a530);}})['then'](function(_0x4e9ff7){if(_0x4e9ff7){return _0x4e9ff7?{'count':_0x2fbede,'rows':_0x4e9ff7}:null;}})[_0x8e67('0x27')](respondWithResult(_0x44633e,null))[_0x8e67('0x49')](handleError(_0x44633e,null));};exports['setTags']=function(_0x48ef4c,_0x173254,_0x49f498){if(_0x48ef4c['body']['id']){delete _0x48ef4c[_0x8e67('0x4b')]['id'];}return db['CmContact'][_0x8e67('0x83')]({'where':{'id':_0x48ef4c['params']['id']}})[_0x8e67('0x27')](handleEntityNotFound(_0x173254,null))['then'](function(_0x3823ab){if(_0x3823ab){return _0x3823ab['setTags'](_0x48ef4c['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x173254,null))['catch'](handleError(_0x173254,null));};exports['getHoppers']=function(_0x16b126,_0xf3963c,_0x7ce5e6){var _0x2687f6={'raw':![],'where':{}};var _0x10046e={};var _0x3e4e1f={'count':0x0,'rows':[]};return db[_0x8e67('0x46')]['findOne']({'where':{'id':_0x16b126[_0x8e67('0x4a')]['id']}})[_0x8e67('0x27')](handleEntityNotFound(_0xf3963c,null))[_0x8e67('0x27')](function(_0x48cc27){if(_0x48cc27){_0x10046e['model']=_[_0x8e67('0x71')](db['CmHopper']['rawAttributes']);_0x10046e[_0x8e67('0x29')]=_[_0x8e67('0x71')](_0x16b126[_0x8e67('0x29')]);_0x10046e[_0x8e67('0x2b')]=_[_0x8e67('0x2c')](_0x10046e[_0x8e67('0x28')],_0x10046e[_0x8e67('0x29')]);_0x2687f6['attributes']=_[_0x8e67('0x2c')](_0x10046e[_0x8e67('0x28')],qs[_0x8e67('0x2e')](_0x16b126[_0x8e67('0x29')][_0x8e67('0x2e')]));_0x2687f6[_0x8e67('0x2d')]=_0x2687f6[_0x8e67('0x2d')]['length']?_0x2687f6['attributes']:_0x10046e[_0x8e67('0x28')];if(!_0x16b126['query'][_0x8e67('0x30')](_0x8e67('0x31'))){_0x2687f6[_0x8e67('0x1a')]=qs[_0x8e67('0x1a')](_0x16b126[_0x8e67('0x29')]['limit']);_0x2687f6[_0x8e67('0x32')]=qs[_0x8e67('0x32')](_0x16b126['query'][_0x8e67('0x32')]);}_0x2687f6[_0x8e67('0x33')]=qs[_0x8e67('0x34')](_0x16b126['query'][_0x8e67('0x34')]);_0x2687f6[_0x8e67('0x35')]=qs[_0x8e67('0x2b')](_[_0x8e67('0x84')](_0x16b126[_0x8e67('0x29')],_0x10046e[_0x8e67('0x2b')]));_0x2687f6['where']['ContactId']=_0x48cc27['id'];if(_0x16b126[_0x8e67('0x29')][_0x8e67('0x39')]){_0x2687f6[_0x8e67('0x35')]=_[_0x8e67('0x3a')](_0x2687f6[_0x8e67('0x35')],{'$or':_[_0x8e67('0x3b')](_0x2687f6[_0x8e67('0x2d')],function(_0x32f30b){var _0x149fc8={};_0x149fc8[_0x32f30b]={'$like':'%'+_0x16b126[_0x8e67('0x29')][_0x8e67('0x39')]+'%'};return _0x149fc8;})});}_0x2687f6=_[_0x8e67('0x3a')]({},_0x2687f6,_0x16b126['options']);return db[_0x8e67('0x81')]['count']({'where':_0x2687f6[_0x8e67('0x35')]})[_0x8e67('0x27')](function(_0x2438f1){_0x3e4e1f[_0x8e67('0x42')]=_0x2438f1;if(_0x16b126[_0x8e67('0x29')][_0x8e67('0x43')]){_0x2687f6[_0x8e67('0x3d')]=[{'all':!![]}];}return db[_0x8e67('0x81')]['findAll'](_0x2687f6);})[_0x8e67('0x27')](function(_0x1c79b3){_0x3e4e1f[_0x8e67('0x48')]=_0x1c79b3;return _0x3e4e1f;});}})[_0x8e67('0x27')](respondWithFilteredResult(_0xf3963c,_0x2687f6))[_0x8e67('0x49')](handleError(_0xf3963c,null));};exports[_0x8e67('0x85')]=function(_0x2fc0ee,_0x403d54,_0x1881c1){var _0x4f8985={'raw':!![],'where':{}};var _0x2bb630={};var _0x417c20={'count':0x0,'rows':[]};return db[_0x8e67('0x46')][_0x8e67('0x83')]({'where':{'id':_0x2fc0ee[_0x8e67('0x4a')]['id']}})[_0x8e67('0x27')](handleEntityNotFound(_0x403d54,null))[_0x8e67('0x27')](function(_0x833d84){if(_0x833d84){_0x2bb630[_0x8e67('0x28')]=_[_0x8e67('0x71')](db[_0x8e67('0x5f')][_0x8e67('0x86')]);_0x2bb630[_0x8e67('0x29')]=_[_0x8e67('0x71')](_0x2fc0ee[_0x8e67('0x29')]);_0x2bb630['filters']=_[_0x8e67('0x2c')](_0x2bb630[_0x8e67('0x28')],_0x2bb630[_0x8e67('0x29')]);_0x4f8985[_0x8e67('0x2d')]=_[_0x8e67('0x2c')](_0x2bb630[_0x8e67('0x28')],qs[_0x8e67('0x2e')](_0x2fc0ee[_0x8e67('0x29')][_0x8e67('0x2e')]));_0x4f8985[_0x8e67('0x2d')]=_0x4f8985[_0x8e67('0x2d')][_0x8e67('0x2f')]?_0x4f8985[_0x8e67('0x2d')]:_0x2bb630[_0x8e67('0x28')];if(!_0x2fc0ee['query'][_0x8e67('0x30')](_0x8e67('0x31'))){_0x4f8985['limit']=qs[_0x8e67('0x1a')](_0x2fc0ee[_0x8e67('0x29')]['limit']);_0x4f8985[_0x8e67('0x32')]=qs['offset'](_0x2fc0ee[_0x8e67('0x29')][_0x8e67('0x32')]);}_0x4f8985[_0x8e67('0x33')]=qs[_0x8e67('0x34')](_0x2fc0ee[_0x8e67('0x29')]['sort']);_0x4f8985[_0x8e67('0x35')]=qs['filters'](_[_0x8e67('0x84')](_0x2fc0ee[_0x8e67('0x29')],_0x2bb630['filters']));_0x4f8985[_0x8e67('0x35')][_0x8e67('0x87')]=_0x833d84['id'];if(_0x2fc0ee[_0x8e67('0x29')]['filter']){_0x4f8985[_0x8e67('0x35')]=_['merge'](_0x4f8985[_0x8e67('0x35')],{'$or':_[_0x8e67('0x3b')](_0x4f8985[_0x8e67('0x2d')],function(_0x221c2b){var _0x330e89={};_0x330e89[_0x221c2b]={'$like':'%'+_0x2fc0ee[_0x8e67('0x29')][_0x8e67('0x39')]+'%'};return _0x330e89;})});}_0x4f8985=_[_0x8e67('0x3a')]({},_0x4f8985,_0x2fc0ee[_0x8e67('0x3c')]);return db['CmHopperHistory'][_0x8e67('0x42')]({'where':_0x4f8985[_0x8e67('0x35')]})[_0x8e67('0x27')](function(_0xc15519){_0x417c20[_0x8e67('0x42')]=_0xc15519;if(_0x2fc0ee['query'][_0x8e67('0x43')]){_0x4f8985['include']=[{'all':!![]}];}return db[_0x8e67('0x5f')][_0x8e67('0x47')](_0x4f8985);})[_0x8e67('0x27')](function(_0x13f156){_0x417c20[_0x8e67('0x48')]=_0x13f156;return _0x417c20;});}})[_0x8e67('0x27')](respondWithFilteredResult(_0x403d54,_0x4f8985))[_0x8e67('0x49')](handleError(_0x403d54,null));};exports[_0x8e67('0x88')]=function(_0x35fcfb,_0x5a3a15,_0xa36e97){var _0x3a304e={'raw':!![],'where':{}};var _0x52d46e={};var _0x3dabcf={'count':0x0,'rows':[]};return db['CmContact'][_0x8e67('0x83')]({'where':{'id':_0x35fcfb[_0x8e67('0x4a')]['id']}})[_0x8e67('0x27')](handleEntityNotFound(_0x5a3a15,null))[_0x8e67('0x27')](function(_0x30603){if(_0x30603){_0x52d46e[_0x8e67('0x28')]=_[_0x8e67('0x71')](db[_0x8e67('0x5e')][_0x8e67('0x86')]);_0x52d46e[_0x8e67('0x29')]=_[_0x8e67('0x71')](_0x35fcfb[_0x8e67('0x29')]);_0x52d46e['filters']=_['intersection'](_0x52d46e['model'],_0x52d46e[_0x8e67('0x29')]);_0x3a304e[_0x8e67('0x2d')]=_[_0x8e67('0x2c')](_0x52d46e[_0x8e67('0x28')],qs['fields'](_0x35fcfb[_0x8e67('0x29')]['fields']));_0x3a304e[_0x8e67('0x2d')]=_0x3a304e['attributes']['length']?_0x3a304e[_0x8e67('0x2d')]:_0x52d46e[_0x8e67('0x28')];if(!_0x35fcfb[_0x8e67('0x29')]['hasOwnProperty'](_0x8e67('0x31'))){_0x3a304e['limit']=qs[_0x8e67('0x1a')](_0x35fcfb[_0x8e67('0x29')][_0x8e67('0x1a')]);_0x3a304e[_0x8e67('0x32')]=qs['offset'](_0x35fcfb[_0x8e67('0x29')][_0x8e67('0x32')]);}_0x3a304e[_0x8e67('0x33')]=qs[_0x8e67('0x34')](_0x35fcfb[_0x8e67('0x29')][_0x8e67('0x34')]);_0x3a304e[_0x8e67('0x35')]=qs[_0x8e67('0x2b')](_[_0x8e67('0x84')](_0x35fcfb[_0x8e67('0x29')],_0x52d46e[_0x8e67('0x2b')]));_0x3a304e[_0x8e67('0x35')][_0x8e67('0x87')]=_0x30603['id'];if(_0x35fcfb[_0x8e67('0x29')]['filter']){_0x3a304e[_0x8e67('0x35')]=_[_0x8e67('0x3a')](_0x3a304e[_0x8e67('0x35')],{'$or':_[_0x8e67('0x3b')](_0x3a304e[_0x8e67('0x2d')],function(_0x3cac26){var _0x4dc02d={};_0x4dc02d[_0x3cac26]={'$like':'%'+_0x35fcfb[_0x8e67('0x29')][_0x8e67('0x39')]+'%'};return _0x4dc02d;})});}_0x3a304e=_[_0x8e67('0x3a')]({},_0x3a304e,_0x35fcfb[_0x8e67('0x3c')]);return db[_0x8e67('0x5e')][_0x8e67('0x42')]({'where':_0x3a304e[_0x8e67('0x35')]})[_0x8e67('0x27')](function(_0x4f707a){_0x3dabcf[_0x8e67('0x42')]=_0x4f707a;if(_0x35fcfb[_0x8e67('0x29')][_0x8e67('0x43')]){_0x3a304e[_0x8e67('0x3d')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x3a304e);})[_0x8e67('0x27')](function(_0x46a9e3){_0x3dabcf[_0x8e67('0x48')]=_0x46a9e3;return _0x3dabcf;});}})[_0x8e67('0x27')](respondWithFilteredResult(_0x5a3a15,_0x3a304e))[_0x8e67('0x49')](handleError(_0x5a3a15,null));};exports[_0x8e67('0x89')]=function(_0x11ceca,_0x1ad564,_0x353c2d){var _0x327f0e={'raw':!![],'where':{}};var _0x544f4b={};var _0x288652={'count':0x0,'rows':[]};return db[_0x8e67('0x46')][_0x8e67('0x83')]({'where':{'id':_0x11ceca[_0x8e67('0x4a')]['id']}})[_0x8e67('0x27')](handleEntityNotFound(_0x1ad564,null))[_0x8e67('0x27')](function(_0x91505e){if(_0x91505e){_0x544f4b[_0x8e67('0x28')]=_[_0x8e67('0x71')](db[_0x8e67('0x67')][_0x8e67('0x86')]);_0x544f4b['query']=_['keys'](_0x11ceca['query']);_0x544f4b['filters']=_['intersection'](_0x544f4b[_0x8e67('0x28')],_0x544f4b['query']);_0x327f0e[_0x8e67('0x2d')]=_['intersection'](_0x544f4b[_0x8e67('0x28')],qs[_0x8e67('0x2e')](_0x11ceca[_0x8e67('0x29')][_0x8e67('0x2e')]));_0x327f0e[_0x8e67('0x2d')]=_0x327f0e[_0x8e67('0x2d')][_0x8e67('0x2f')]?_0x327f0e[_0x8e67('0x2d')]:_0x544f4b[_0x8e67('0x28')];if(!_0x11ceca[_0x8e67('0x29')]['hasOwnProperty'](_0x8e67('0x31'))){_0x327f0e[_0x8e67('0x1a')]=qs['limit'](_0x11ceca[_0x8e67('0x29')][_0x8e67('0x1a')]);_0x327f0e[_0x8e67('0x32')]=qs[_0x8e67('0x32')](_0x11ceca[_0x8e67('0x29')]['offset']);}_0x327f0e[_0x8e67('0x33')]=qs[_0x8e67('0x34')](_0x11ceca['query'][_0x8e67('0x34')]);_0x327f0e[_0x8e67('0x35')]=qs[_0x8e67('0x2b')](_[_0x8e67('0x84')](_0x11ceca[_0x8e67('0x29')],_0x544f4b[_0x8e67('0x2b')]));_0x327f0e['where'][_0x8e67('0x87')]=_0x91505e['id'];if(_0x11ceca[_0x8e67('0x29')][_0x8e67('0x39')]){_0x327f0e[_0x8e67('0x35')]=_['merge'](_0x327f0e[_0x8e67('0x35')],{'$or':_[_0x8e67('0x3b')](_0x327f0e[_0x8e67('0x2d')],function(_0xbd4ca1){var _0x2c77bc={};_0x2c77bc[_0xbd4ca1]={'$like':'%'+_0x11ceca[_0x8e67('0x29')][_0x8e67('0x39')]+'%'};return _0x2c77bc;})});}_0x327f0e=_[_0x8e67('0x3a')]({},_0x327f0e,_0x11ceca[_0x8e67('0x3c')]);return db[_0x8e67('0x67')]['count']({'where':_0x327f0e['where']})[_0x8e67('0x27')](function(_0x2b420f){_0x288652['count']=_0x2b420f;if(_0x11ceca[_0x8e67('0x29')][_0x8e67('0x43')]){_0x327f0e['include']=[{'all':!![]}];}return db[_0x8e67('0x67')][_0x8e67('0x47')](_0x327f0e);})[_0x8e67('0x27')](function(_0x4d52e6){_0x288652[_0x8e67('0x48')]=_0x4d52e6;return _0x288652;});}})[_0x8e67('0x27')](respondWithFilteredResult(_0x1ad564,_0x327f0e))[_0x8e67('0x49')](handleError(_0x1ad564,null));};exports[_0x8e67('0x8a')]=function(_0x4f30ff,_0x7f5c28,_0x4b7079){try{if(!_0x4f30ff[_0x8e67('0x4b')][_0x8e67('0x6c')]){throw new Error(_0x8e67('0x8b'));}if(!_0x4f30ff[_0x8e67('0x4b')][_0x8e67('0x8c')]){throw new Error(_0x8e67('0x8d'));}if(!_0x4f30ff[_0x8e67('0x4b')][_0x8e67('0x8e')]){throw new Error(_0x8e67('0x8f'));}if(!_0x4f30ff[_0x8e67('0x4b')][_0x8e67('0x90')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x5ea8f8=_0x4f30ff[_0x8e67('0x4b')][_0x8e67('0x8c')][_0x8e67('0x91')](',');var _0x3c6129=_0x4f30ff['body'][_0x8e67('0x8e')][_0x8e67('0x91')](',');if(!_0x5ea8f8[_0x8e67('0x2f')]||!_0x3c6129[_0x8e67('0x2f')]||_0x5ea8f8['length']!==_0x3c6129[_0x8e67('0x2f')]){throw new Error(_0x8e67('0x92'));}_0x4f30ff[_0x8e67('0x4b')][_0x8e67('0x2e')]=_['zipObject'](_0x5ea8f8,_0x3c6129);if(!_0x4f30ff[_0x8e67('0x4b')][_0x8e67('0x2e')][_0x8e67('0x80')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x4f30ff[_0x8e67('0x4b')][_0x8e67('0x2e')]['firstName']){throw new Error(_0x8e67('0x93'));}var _0x5a3683=path[_0x8e67('0x50')](config[_0x8e67('0x94')],_0x8e67('0x95'),_0x4f30ff[_0x8e67('0x96')]['filename']);fs[_0x8e67('0x97')](_0x5a3683,parseInt(_0x8e67('0x98'),0x8));var _0x333f42=require('child_process')[_0x8e67('0x99')](path[_0x8e67('0x50')](__dirname,_0x8e67('0x9a')),[_0x5a3683,_0x4f30ff['body'][_0x8e67('0x8c')],_0x4f30ff[_0x8e67('0x4b')][_0x8e67('0x8e')],_0x4f30ff[_0x8e67('0x4b')][_0x8e67('0x6c')],_0x4f30ff[_0x8e67('0x4b')][_0x8e67('0x9b')],_0x4f30ff[_0x8e67('0x4b')][_0x8e67('0x6a')],_0x4f30ff[_0x8e67('0x4b')][_0x8e67('0x90')]]);return _0x7f5c28[_0x8e67('0x17')](0xc8)[_0x8e67('0x19')]({'message':_0x8e67('0x9c'),'pid':_0x333f42[_0x8e67('0x9d')]});}catch(_0x23e228){return _0x7f5c28[_0x8e67('0x17')](0x1f4)[_0x8e67('0x24')](_0x23e228);}};exports[_0x8e67('0x9e')]=function(_0x5cf8e2,_0x65f135,_0x2978bf){var _0x502b0b=fs[_0x8e67('0x9f')](_0x5cf8e2[_0x8e67('0x96')]['path']);Papa[_0x8e67('0xa0')](_0x502b0b,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x57b531){return _0x65f135[_0x8e67('0x17')](0xc8)[_0x8e67('0x19')]({'file':_0x5cf8e2[_0x8e67('0x96')],'fields':_0x57b531[_0x8e67('0xa1')][_0x8e67('0x2e')]});}});};exports[_0x8e67('0xa2')]=function(_0x4a6645,_0x4a8770,_0x3b93e9){return db['User']['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x8e67('0xa3')}})['then'](function(_0x584b2c){var _0x29cfce=![];if(!_0x4a6645[_0x8e67('0x4b')]['ListId']){throw new Error(_0x8e67('0x8b'));}if(!_0x4a6645[_0x8e67('0x4b')][_0x8e67('0xa4')][_0x8e67('0x80')]){throw new Error(_0x8e67('0xa5'));}if(!_0x4a6645[_0x8e67('0x4b')][_0x8e67('0xa4')][_0x8e67('0xa6')]){throw new Error(_0x8e67('0x93'));}if(!_0x4a6645['body'][_0x8e67('0x90')]){throw new Error(_0x8e67('0xa7'));}var _0x1015c9=require('child_process')[_0x8e67('0x99')](path[_0x8e67('0x50')](__dirname,_0x8e67('0xa8')),[_0x4a6645[_0x8e67('0x4a')]['id'],JSON['stringify'](_0x4a6645[_0x8e67('0x4b')]),JSON[_0x8e67('0xa9')](_0x584b2c)]);_0x1015c9['on'](_0x8e67('0xaa'),function(_0x13b4f3){_0x29cfce=!![];return _0x4a8770['status'](0xc8)[_0x8e67('0x19')]({'message':_0x8e67('0xab'),'pid':_0x1015c9['pid']});});_0x1015c9['on'](_0x8e67('0xac'),function(_0x2f331a){if(_0x2f331a&&!_0x29cfce){return _0x4a8770[_0x8e67('0x17')](0x1f4)[_0x8e67('0x19')]({'message':_0x8e67('0xad'),'pid':_0x1015c9[_0x8e67('0x9d')]});}});})['catch'](handleError(_0x4a8770,null));};
\ No newline at end of file
index 19b23e5..a713e93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0eeb=['../../mysqldb','CmContact','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x28ade3,_0x3849b9){var _0x20ca87=function(_0x47515f){while(--_0x47515f){_0x28ade3['push'](_0x28ade3['shift']());}};_0x20ca87(++_0x3849b9);}(_0x0eeb,0xc5));var _0xb0ee=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0eeb[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0xb0ee('0x0'));var CmContact=require(_0xb0ee('0x1'))['db'][_0xb0ee('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xb0ee('0x3')](0x0);var events={'afterCreate':_0xb0ee('0x4'),'afterUpdate':_0xb0ee('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5add55){return function(_0x3b94a0,_0xfbf0cc,_0x13a7ce){CmContactEvents[_0xb0ee('0x6')](_0x5add55+':'+_0x3b94a0['id'],_0x3b94a0);CmContactEvents[_0xb0ee('0x6')](_0x5add55,_0x3b94a0);_0x13a7ce(null);};}for(var e in events){if(events[_0xb0ee('0x7')](e)){var event=events[e];CmContact[_0xb0ee('0x8')](e,emitEvent(event));}}module['exports']=CmContactEvents;
\ No newline at end of file
+var _0x60e0=['emit','hasOwnProperty','hook','exports','events','CmContact','setMaxListeners','save','update'];(function(_0x1967ef,_0x285143){var _0x4015a3=function(_0x1d9715){while(--_0x1d9715){_0x1967ef['push'](_0x1967ef['shift']());}};_0x4015a3(++_0x285143);}(_0x60e0,0x70));var _0x060e=function(_0x440a33,_0x3ce955){_0x440a33=_0x440a33-0x0;var _0x201bfb=_0x60e0[_0x440a33];return _0x201bfb;};'use strict';var EventEmitter=require(_0x060e('0x0'));var CmContact=require('../../mysqldb')['db'][_0x060e('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x060e('0x2')](0x0);var events={'afterCreate':_0x060e('0x3'),'afterUpdate':_0x060e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2454d1){return function(_0x3df45c,_0x27e6fe,_0x199de4){CmContactEvents[_0x060e('0x5')](_0x2454d1+':'+_0x3df45c['id'],_0x3df45c);CmContactEvents[_0x060e('0x5')](_0x2454d1,_0x3df45c);_0x199de4(null);};}for(var e in events){if(events[_0x060e('0x6')](e)){var event=events[e];CmContact[_0x060e('0x7')](e,emitEvent(event));}}module[_0x060e('0x8')]=CmContactEvents;
\ No newline at end of file
index a753fec..163d9af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8a5=['util','../../config/logger','api','moment','bluebird','request-promise','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','get','cmContact','afterCreate','then','isNil','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','ListId','priority','scheduledAt','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','format','catch','findOne','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','error','inspect','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','length','always','outbound','CmHopperBlack','Campaign','onlyIfOpen','BlackLists','List\x20not\x20found','ContactId','VoiceQueueId','CampaignId','info','[CmContact][afterDestroy][Error]','lodash'];(function(_0x4aa616,_0x130425){var _0x2adb97=function(_0x1b8c7e){while(--_0x1b8c7e){_0x4aa616['push'](_0x4aa616['shift']());}};_0x2adb97(++_0x130425);}(_0xa8a5,0x1b7));var _0x5a8a=function(_0x2f2360,_0x151089){_0x2f2360=_0x2f2360-0x0;var _0x1cc8d3=_0xa8a5[_0x2f2360];return _0x1cc8d3;};'use strict';var _=require(_0x5a8a('0x0'));var util=require(_0x5a8a('0x1'));var logger=require(_0x5a8a('0x2'))(_0x5a8a('0x3'));var moment=require(_0x5a8a('0x4'));var BPromise=require(_0x5a8a('0x5'));var rp=require(_0x5a8a('0x6'));var attributes=require(_0x5a8a('0x7'));module[_0x5a8a('0x8')]=function(_0x598dff,_0x510997){return _0x598dff[_0x5a8a('0x9')](_0x5a8a('0xa'),attributes,{'tableName':_0x5a8a('0xb'),'paranoid':!![],'indexes':[{'name':_0x5a8a('0xc'),'fields':[_0x5a8a('0xc')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d8c18,_0x7032e1,_0x390810){var _0x462b9d=_0x598dff['models'];var _0x2d7558=_0x4d8c18[_0x5a8a('0xd')]({'plain':!![]});function _0x38e046(){return function(_0x4aa79b){logger['error'](_0x5a8a('0xe'),_0x5a8a('0xf'),util['inspect'](_0x4aa79b,{'showHidden':![],'depth':null}));};}var _0x485fff=function(_0x1849b4){return new BPromise(function(_0x148c94,_0x59baa3){_0x462b9d['CmHopper']['findOne']({'where':{'phone':_0x2d7558[_0x5a8a('0xc')],'VoiceQueueId':_0x1849b4['id']}})[_0x5a8a('0x10')](function(_0x584b6a){if(!_[_0x5a8a('0x11')](_0x584b6a)){throw new Error(_0x5a8a('0x12')+_0x2d7558[_0x5a8a('0xc')]+_0x5a8a('0x13')+_0x1849b4['id']);}return _0x462b9d[_0x5a8a('0x14')][_0x5a8a('0x15')]({'phone':_0x2d7558[_0x5a8a('0xc')],'ContactId':_0x2d7558['id'],'ListId':_0x2d7558[_0x5a8a('0x16')],'priority':_0x2d7558[_0x5a8a('0x17')]?_0x2d7558[_0x5a8a('0x17')]:0x2,'scheduledat':_0x2d7558[_0x5a8a('0x18')]?_0x2d7558['scheduledAt']:moment()['format'](_0x5a8a('0x19')),'callback':_0x2d7558[_0x5a8a('0x1a')]?!![]:![],'callbackuniqueid':_0x2d7558[_0x5a8a('0x1a')]?_0x2d7558[_0x5a8a('0x1a')]:undefined,'callbackat':_0x2d7558['callbackUniqueid']?moment()[_0x5a8a('0x1b')](_0x5a8a('0x19')):undefined,'VoiceQueueId':_0x1849b4['id']});})[_0x5a8a('0x1c')](function(_0x335dc5){_0x59baa3(_0x335dc5);});});};var _0x175c77=function(_0x1e8eb5){return new BPromise(function(_0x12ce67,_0x188aa7){_0x462b9d[_0x5a8a('0x14')][_0x5a8a('0x1d')]({'where':{'phone':_0x2d7558[_0x5a8a('0xc')],'VoiceQueueId':_0x1e8eb5['id']}})['then'](function(_0x205379){if(!_['isNil'](_0x205379)){throw new Error(_0x5a8a('0x12')+_0x2d7558[_0x5a8a('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x1e8eb5['id']);}return _0x462b9d[_0x5a8a('0x1e')][_0x5a8a('0x1d')]({'where':{'calleridnum':_0x2d7558[_0x5a8a('0xc')],'VoiceQueueId':_0x1e8eb5['id']}});})['then'](function(_0x58994b){if(!_[_0x5a8a('0x11')](_0x58994b)){throw new Error(_0x5a8a('0x1f')+_0x2d7558['phone']+_0x5a8a('0x20')+_0x1e8eb5['id']);}return _0x462b9d[_0x5a8a('0x14')][_0x5a8a('0x15')]({'phone':_0x2d7558[_0x5a8a('0xc')],'ContactId':_0x2d7558['id'],'ListId':_0x2d7558[_0x5a8a('0x16')],'priority':_0x2d7558['priority']?_0x2d7558[_0x5a8a('0x17')]:0x2,'scheduledat':_0x2d7558[_0x5a8a('0x18')]?_0x2d7558[_0x5a8a('0x18')]:moment()[_0x5a8a('0x1b')](_0x5a8a('0x19')),'callback':_0x2d7558[_0x5a8a('0x1a')]?!![]:![],'callbackuniqueid':_0x2d7558[_0x5a8a('0x1a')]?_0x2d7558['callbackUniqueid']:undefined,'callbackat':_0x2d7558[_0x5a8a('0x1a')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x1e8eb5['id']});})['catch'](function(_0x5939e7){_0x188aa7(_0x5939e7);});});};function _0x208fcf(){return function(_0x4d2f9f){logger[_0x5a8a('0x21')]('cmContact',_0x5a8a('0xf'),util[_0x5a8a('0x22')](_0x4d2f9f,{'showHidden':![],'depth':null}));};}var _0xbd6a71=function(_0xbe2746){return new BPromise(function(_0x2157f4,_0xbcffa4){_0x462b9d[_0x5a8a('0x14')]['findOne']({'where':{'phone':_0x2d7558[_0x5a8a('0xc')],'CampaignId':_0xbe2746['id']}})['then'](function(_0x38e84f){if(!_[_0x5a8a('0x11')](_0x38e84f)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2d7558['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0xbe2746['id']);}return _0x462b9d[_0x5a8a('0x14')][_0x5a8a('0x15')]({'phone':_0x2d7558['phone'],'ContactId':_0x2d7558['id'],'ListId':_0x2d7558[_0x5a8a('0x16')],'priority':_0x2d7558[_0x5a8a('0x17')]?_0x2d7558[_0x5a8a('0x17')]:0x2,'scheduledat':_0x2d7558[_0x5a8a('0x18')]?_0x2d7558['scheduledAt']:moment()[_0x5a8a('0x1b')](_0x5a8a('0x19')),'callback':_0x2d7558['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2d7558[_0x5a8a('0x1a')]?_0x2d7558[_0x5a8a('0x1a')]:undefined,'callbackat':_0x2d7558['callbackUniqueid']?moment()['format'](_0x5a8a('0x19')):undefined,'CampaignId':_0xbe2746['id']});})[_0x5a8a('0x1c')](function(_0x133324){_0xbcffa4(_0x133324);});});};var _0xf791c5=function(_0x5590e6){return new BPromise(function(_0x10a116,_0x442cbf){_0x462b9d[_0x5a8a('0x14')]['findOne']({'where':{'phone':_0x2d7558[_0x5a8a('0xc')],'CampaignId':_0x5590e6['id']}})[_0x5a8a('0x10')](function(_0x3009e0){if(!_[_0x5a8a('0x11')](_0x3009e0)){throw new Error(_0x5a8a('0x12')+_0x2d7558[_0x5a8a('0xc')]+_0x5a8a('0x23')+_0x5590e6['id']);}return _0x462b9d[_0x5a8a('0x1e')][_0x5a8a('0x1d')]({'where':{'calleridnum':_0x2d7558['phone'],'CampaignId':_0x5590e6['id']}});})[_0x5a8a('0x10')](function(_0x2a370b){if(!_[_0x5a8a('0x11')](_0x2a370b)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x2d7558['phone']+_0x5a8a('0x24')+_0x5590e6['id']);}return _0x462b9d[_0x5a8a('0x14')][_0x5a8a('0x15')]({'phone':_0x2d7558[_0x5a8a('0xc')],'ContactId':_0x2d7558['id'],'ListId':_0x2d7558[_0x5a8a('0x16')],'priority':_0x2d7558['priority']?_0x2d7558[_0x5a8a('0x17')]:0x2,'scheduledat':_0x2d7558[_0x5a8a('0x18')]?_0x2d7558[_0x5a8a('0x18')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2d7558[_0x5a8a('0x1a')]?!![]:![],'callbackuniqueid':_0x2d7558[_0x5a8a('0x1a')]?_0x2d7558[_0x5a8a('0x1a')]:undefined,'callbackat':_0x2d7558[_0x5a8a('0x1a')]?moment()[_0x5a8a('0x1b')](_0x5a8a('0x19')):undefined,'CampaignId':_0x5590e6['id']});})[_0x5a8a('0x1c')](function(_0x2efa2e){_0x442cbf(_0x2efa2e);});});};if(_0x2d7558['ListId']){_0x462b9d[_0x5a8a('0x25')][_0x5a8a('0x26')]({'where':{'type':'outbound'},'attributes':['id',_0x5a8a('0x27')],'include':[{'model':_0x462b9d[_0x5a8a('0x28')],'as':_0x5a8a('0x29'),'where':{'id':_0x2d7558[_0x5a8a('0x16')]}}]})[_0x5a8a('0x10')](function(_0x517ceb){if(_0x517ceb){var _0x249c8e=[];for(var _0x4e1ceb=0x0,_0x343512;_0x4e1ceb<_0x517ceb[_0x5a8a('0x2a')];_0x4e1ceb+=0x1){_0x343512=_0x517ceb[_0x4e1ceb][_0x5a8a('0xd')]({'plain':!![]});switch(_0x343512[_0x5a8a('0x27')]){case _0x5a8a('0x2b'):_0x175c77(_0x343512)['catch'](_0x38e046());break;case'onlyIfOpen':_0x485fff(_0x343512)[_0x5a8a('0x1c')](_0x38e046());break;default:_0x462b9d[_0x5a8a('0x14')][_0x5a8a('0x15')]({'phone':_0x2d7558[_0x5a8a('0xc')],'ContactId':_0x2d7558['id'],'ListId':_0x2d7558[_0x5a8a('0x16')],'scheduledat':_0x2d7558[_0x5a8a('0x18')]?_0x2d7558['scheduledAt']:moment()[_0x5a8a('0x1b')](_0x5a8a('0x19')),'priority':_0x2d7558[_0x5a8a('0x17')]?_0x2d7558[_0x5a8a('0x17')]:0x2,'callback':_0x2d7558[_0x5a8a('0x1a')]?!![]:![],'callbackuniqueid':_0x2d7558['callbackUniqueid']?_0x2d7558[_0x5a8a('0x1a')]:undefined,'callbackat':_0x2d7558[_0x5a8a('0x1a')]?moment()['format'](_0x5a8a('0x19')):undefined,'VoiceQueueId':_0x343512['id']})[_0x5a8a('0x1c')](_0x38e046());}}}})[_0x5a8a('0x10')](function(){return _0x462b9d[_0x5a8a('0x25')][_0x5a8a('0x26')]({'where':{'type':_0x5a8a('0x2c')},'attributes':['id'],'include':[{'model':_0x462b9d['CmList'],'as':'BlackLists','where':{'id':_0x2d7558[_0x5a8a('0x16')]}}]})[_0x5a8a('0x10')](function(_0x5bf144){if(_0x5bf144){var _0x2b4dfa=[];for(var _0x141d21=0x0,_0x2aaa5f;_0x141d21<_0x5bf144[_0x5a8a('0x2a')];_0x141d21+=0x1){_0x2aaa5f=_0x5bf144[_0x141d21][_0x5a8a('0xd')]({'plain':!![]});_0x462b9d[_0x5a8a('0x2d')][_0x5a8a('0x15')]({'phone':_0x2d7558[_0x5a8a('0xc')],'ContactId':_0x2d7558['id'],'ListId':_0x2d7558['ListId'],'VoiceQueueId':_0x2aaa5f['id']})['catch'](function(_0x483e1c){logger[_0x5a8a('0x21')]('cmContact,\x20%s,\x20%s',_0x5a8a('0xf'),_0x483e1c['message']);});}}});})[_0x5a8a('0x10')](function(){return _0x462b9d[_0x5a8a('0x2e')]['findAll']({'attributes':['id',_0x5a8a('0x27')],'include':[{'model':_0x462b9d[_0x5a8a('0x28')],'as':'Lists','where':{'id':_0x2d7558[_0x5a8a('0x16')]}}]})[_0x5a8a('0x10')](function(_0x1c480a){if(_0x1c480a){var _0x6d235f=[];for(var _0x575f38=0x0,_0x30a5f4;_0x575f38<_0x1c480a[_0x5a8a('0x2a')];_0x575f38+=0x1){_0x30a5f4=_0x1c480a[_0x575f38][_0x5a8a('0xd')]({'plain':!![]});switch(_0x30a5f4['dialCheckDuplicateType']){case _0x5a8a('0x2b'):_0xf791c5(_0x30a5f4)['catch'](_0x208fcf());break;case _0x5a8a('0x2f'):_0xbd6a71(_0x30a5f4)[_0x5a8a('0x1c')](_0x208fcf());break;default:_0x462b9d[_0x5a8a('0x14')][_0x5a8a('0x15')]({'phone':_0x2d7558[_0x5a8a('0xc')],'ContactId':_0x2d7558['id'],'ListId':_0x2d7558[_0x5a8a('0x16')],'scheduledat':_0x2d7558[_0x5a8a('0x18')]?_0x2d7558[_0x5a8a('0x18')]:moment()[_0x5a8a('0x1b')](_0x5a8a('0x19')),'priority':_0x2d7558[_0x5a8a('0x17')]?_0x2d7558[_0x5a8a('0x17')]:0x2,'callback':_0x2d7558['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2d7558[_0x5a8a('0x1a')]?_0x2d7558['callbackUniqueid']:undefined,'callbackat':_0x2d7558[_0x5a8a('0x1a')]?moment()['format'](_0x5a8a('0x19')):undefined,'CampaignId':_0x30a5f4['id']})['catch'](_0x208fcf());}}}});})['then'](function(){return _0x462b9d['Campaign'][_0x5a8a('0x26')]({'attributes':['id'],'include':[{'model':_0x462b9d['CmList'],'as':_0x5a8a('0x30'),'where':{'id':_0x2d7558[_0x5a8a('0x16')]}}]})['then'](function(_0x416396){if(_0x416396){var _0x730917=[];for(var _0x372a55=0x0,_0x5c5e3a;_0x372a55<_0x416396[_0x5a8a('0x2a')];_0x372a55+=0x1){_0x5c5e3a=_0x416396[_0x372a55][_0x5a8a('0xd')]({'plain':!![]});_0x462b9d['CmHopperBlack'][_0x5a8a('0x15')]({'phone':_0x2d7558['phone'],'ContactId':_0x2d7558['id'],'ListId':_0x2d7558['ListId'],'CampaignId':_0x5c5e3a['id']})['catch'](function(_0x46b753){logger['error']('cmContact,\x20%s,\x20%s',_0x5a8a('0xf'),_0x46b753['message']);});}}});})[_0x5a8a('0x10')](function(){_0x390810();})['catch'](function(_0xcda138){logger['error']('cmContact,\x20%s,\x20%s','afterCreate',_0xcda138['message']);_0x390810(_0xcda138);});}else{_0x390810(new Error(_0x5a8a('0x31')));}},'afterDestroy':function(_0x31dd71,_0x32464f,_0x49facb){var _0x59abc7=_0x598dff['models'];var _0x2ce49b=_0x31dd71['get']({'plain':!![]});return _0x59abc7[_0x5a8a('0x14')][_0x5a8a('0x26')]({'raw':!![],'where':{'ListId':_0x2ce49b[_0x5a8a('0x16')],'ContactId':_0x2ce49b['id']}})[_0x5a8a('0x10')](function(_0x424afa){if(!_['isEmpty'](_0x424afa)){var _0x94156e=[];for(var _0x459eb3=0x0;_0x459eb3<_0x424afa['length'];_0x459eb3+=0x1){var _0x89865=_0x59abc7[_0x5a8a('0x14')]['destroy']({'where':{'ListId':_0x424afa[_0x459eb3]['ListId'],'ContactId':_0x424afa[_0x459eb3][_0x5a8a('0x32')],'VoiceQueueId':_0x424afa[_0x459eb3][_0x5a8a('0x33')],'CampaignId':_0x424afa[_0x459eb3][_0x5a8a('0x34')]}});_0x94156e['push'](_0x89865);}return BPromise['all'](_0x94156e);}})[_0x5a8a('0x10')](function(_0x5a7903){logger[_0x5a8a('0x35')]('[CmContact][afterDestroy][Succesfull]',util[_0x5a8a('0x22')](_0x5a7903,{'showHidden':![],'depth':null}));_0x49facb();})[_0x5a8a('0x1c')](function(_0x3a0ccb){logger[_0x5a8a('0x21')](_0x5a8a('0x36'),util[_0x5a8a('0x22')](_0x3a0ccb,{'showHidden':![],'depth':null}));_0x49facb(_0x3a0ccb);});}}});};
\ No newline at end of file
+var _0xf261=['phone','models','get','error','cmContact','afterCreate','inspect','CmHopper','findOne','then','isNil','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','scheduledAt','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','onlyIfOpen','BlackLists','length','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','List\x20not\x20found','isEmpty','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','lodash','util','../../config/logger','bluebird','./cmContact.attributes','CmContact','cm_contacts'];(function(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0xf261,0x173));var _0x1f26=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf261[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x1f26('0x0'));var util=require(_0x1f26('0x1'));var logger=require(_0x1f26('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1f26('0x3'));var rp=require('request-promise');var attributes=require(_0x1f26('0x4'));module['exports']=function(_0x56be4c,_0x539e40){return _0x56be4c['define'](_0x1f26('0x5'),attributes,{'tableName':_0x1f26('0x6'),'paranoid':!![],'indexes':[{'name':_0x1f26('0x7'),'fields':[_0x1f26('0x7')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x191ebe,_0x35ab74,_0x22eb08){var _0x3df8cb=_0x56be4c[_0x1f26('0x8')];var _0x34288c=_0x191ebe[_0x1f26('0x9')]({'plain':!![]});function _0x5ef632(){return function(_0x12c457){logger[_0x1f26('0xa')](_0x1f26('0xb'),_0x1f26('0xc'),util[_0x1f26('0xd')](_0x12c457,{'showHidden':![],'depth':null}));};}var _0x52c360=function(_0x55ca94){return new BPromise(function(_0x4f0acc,_0x43e437){_0x3df8cb[_0x1f26('0xe')][_0x1f26('0xf')]({'where':{'phone':_0x34288c[_0x1f26('0x7')],'VoiceQueueId':_0x55ca94['id']}})[_0x1f26('0x10')](function(_0x402b69){if(!_[_0x1f26('0x11')](_0x402b69)){throw new Error('cmContact,\x20afterCreate\x20'+_0x34288c[_0x1f26('0x7')]+_0x1f26('0x12')+_0x55ca94['id']);}return _0x3df8cb['CmHopper'][_0x1f26('0x13')]({'phone':_0x34288c['phone'],'ContactId':_0x34288c['id'],'ListId':_0x34288c[_0x1f26('0x14')],'priority':_0x34288c[_0x1f26('0x15')]?_0x34288c[_0x1f26('0x15')]:0x2,'scheduledat':_0x34288c[_0x1f26('0x16')]?_0x34288c[_0x1f26('0x16')]:moment()[_0x1f26('0x17')](_0x1f26('0x18')),'callback':_0x34288c[_0x1f26('0x19')]?!![]:![],'callbackuniqueid':_0x34288c[_0x1f26('0x19')]?_0x34288c[_0x1f26('0x19')]:undefined,'callbackat':_0x34288c[_0x1f26('0x19')]?moment()[_0x1f26('0x17')](_0x1f26('0x18')):undefined,'VoiceQueueId':_0x55ca94['id']});})[_0x1f26('0x1a')](function(_0x498265){_0x43e437(_0x498265);});});};var _0x4bffb7=function(_0x11aa51){return new BPromise(function(_0x5d4929,_0x1b7e02){_0x3df8cb[_0x1f26('0xe')][_0x1f26('0xf')]({'where':{'phone':_0x34288c['phone'],'VoiceQueueId':_0x11aa51['id']}})[_0x1f26('0x10')](function(_0x56a5a8){if(!_[_0x1f26('0x11')](_0x56a5a8)){throw new Error(_0x1f26('0x1b')+_0x34288c[_0x1f26('0x7')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x11aa51['id']);}return _0x3df8cb[_0x1f26('0x1c')][_0x1f26('0xf')]({'where':{'calleridnum':_0x34288c[_0x1f26('0x7')],'VoiceQueueId':_0x11aa51['id']}});})[_0x1f26('0x10')](function(_0x106508){if(!_['isNil'](_0x106508)){throw new Error(_0x1f26('0x1d')+_0x34288c[_0x1f26('0x7')]+_0x1f26('0x1e')+_0x11aa51['id']);}return _0x3df8cb['CmHopper'][_0x1f26('0x13')]({'phone':_0x34288c[_0x1f26('0x7')],'ContactId':_0x34288c['id'],'ListId':_0x34288c[_0x1f26('0x14')],'priority':_0x34288c['priority']?_0x34288c[_0x1f26('0x15')]:0x2,'scheduledat':_0x34288c[_0x1f26('0x16')]?_0x34288c[_0x1f26('0x16')]:moment()['format'](_0x1f26('0x18')),'callback':_0x34288c[_0x1f26('0x19')]?!![]:![],'callbackuniqueid':_0x34288c[_0x1f26('0x19')]?_0x34288c[_0x1f26('0x19')]:undefined,'callbackat':_0x34288c[_0x1f26('0x19')]?moment()[_0x1f26('0x17')](_0x1f26('0x18')):undefined,'VoiceQueueId':_0x11aa51['id']});})[_0x1f26('0x1a')](function(_0x117ddf){_0x1b7e02(_0x117ddf);});});};function _0x519365(){return function(_0x395ed8){logger['error'](_0x1f26('0xb'),_0x1f26('0xc'),util[_0x1f26('0xd')](_0x395ed8,{'showHidden':![],'depth':null}));};}var _0x2ea968=function(_0x351e4c){return new BPromise(function(_0x284915,_0x5f3184){_0x3df8cb['CmHopper'][_0x1f26('0xf')]({'where':{'phone':_0x34288c[_0x1f26('0x7')],'CampaignId':_0x351e4c['id']}})[_0x1f26('0x10')](function(_0x34e942){if(!_[_0x1f26('0x11')](_0x34e942)){throw new Error(_0x1f26('0x1b')+_0x34288c[_0x1f26('0x7')]+_0x1f26('0x1f')+_0x351e4c['id']);}return _0x3df8cb['CmHopper'][_0x1f26('0x13')]({'phone':_0x34288c[_0x1f26('0x7')],'ContactId':_0x34288c['id'],'ListId':_0x34288c['ListId'],'priority':_0x34288c[_0x1f26('0x15')]?_0x34288c['priority']:0x2,'scheduledat':_0x34288c['scheduledAt']?_0x34288c[_0x1f26('0x16')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x34288c[_0x1f26('0x19')]?!![]:![],'callbackuniqueid':_0x34288c['callbackUniqueid']?_0x34288c['callbackUniqueid']:undefined,'callbackat':_0x34288c['callbackUniqueid']?moment()[_0x1f26('0x17')](_0x1f26('0x18')):undefined,'CampaignId':_0x351e4c['id']});})[_0x1f26('0x1a')](function(_0x226ae){_0x5f3184(_0x226ae);});});};var _0xb86c19=function(_0x5c1f70){return new BPromise(function(_0x1c3bd3,_0x44d191){_0x3df8cb[_0x1f26('0xe')]['findOne']({'where':{'phone':_0x34288c[_0x1f26('0x7')],'CampaignId':_0x5c1f70['id']}})[_0x1f26('0x10')](function(_0x5b6916){if(!_['isNil'](_0x5b6916)){throw new Error(_0x1f26('0x1b')+_0x34288c['phone']+_0x1f26('0x20')+_0x5c1f70['id']);}return _0x3df8cb[_0x1f26('0x1c')][_0x1f26('0xf')]({'where':{'calleridnum':_0x34288c[_0x1f26('0x7')],'CampaignId':_0x5c1f70['id']}});})[_0x1f26('0x10')](function(_0x402333){if(!_['isNil'](_0x402333)){throw new Error(_0x1f26('0x1d')+_0x34288c['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x5c1f70['id']);}return _0x3df8cb['CmHopper'][_0x1f26('0x13')]({'phone':_0x34288c['phone'],'ContactId':_0x34288c['id'],'ListId':_0x34288c[_0x1f26('0x14')],'priority':_0x34288c[_0x1f26('0x15')]?_0x34288c[_0x1f26('0x15')]:0x2,'scheduledat':_0x34288c[_0x1f26('0x16')]?_0x34288c['scheduledAt']:moment()[_0x1f26('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x34288c[_0x1f26('0x19')]?!![]:![],'callbackuniqueid':_0x34288c[_0x1f26('0x19')]?_0x34288c[_0x1f26('0x19')]:undefined,'callbackat':_0x34288c[_0x1f26('0x19')]?moment()['format'](_0x1f26('0x18')):undefined,'CampaignId':_0x5c1f70['id']});})[_0x1f26('0x1a')](function(_0x7e6289){_0x44d191(_0x7e6289);});});};if(_0x34288c[_0x1f26('0x14')]){_0x3df8cb[_0x1f26('0x21')][_0x1f26('0x22')]({'where':{'type':'outbound'},'attributes':['id',_0x1f26('0x23')],'include':[{'model':_0x3df8cb[_0x1f26('0x24')],'as':_0x1f26('0x25'),'where':{'id':_0x34288c['ListId']}}]})['then'](function(_0x41663a){if(_0x41663a){var _0x90b2f0=[];for(var _0x1505cb=0x0,_0x432a88;_0x1505cb<_0x41663a['length'];_0x1505cb+=0x1){_0x432a88=_0x41663a[_0x1505cb][_0x1f26('0x9')]({'plain':!![]});switch(_0x432a88[_0x1f26('0x23')]){case'always':_0x4bffb7(_0x432a88)['catch'](_0x5ef632());break;case _0x1f26('0x26'):_0x52c360(_0x432a88)[_0x1f26('0x1a')](_0x5ef632());break;default:_0x3df8cb['CmHopper'][_0x1f26('0x13')]({'phone':_0x34288c[_0x1f26('0x7')],'ContactId':_0x34288c['id'],'ListId':_0x34288c[_0x1f26('0x14')],'scheduledat':_0x34288c[_0x1f26('0x16')]?_0x34288c[_0x1f26('0x16')]:moment()[_0x1f26('0x17')](_0x1f26('0x18')),'priority':_0x34288c['priority']?_0x34288c['priority']:0x2,'callback':_0x34288c['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x34288c[_0x1f26('0x19')]?_0x34288c[_0x1f26('0x19')]:undefined,'callbackat':_0x34288c[_0x1f26('0x19')]?moment()[_0x1f26('0x17')](_0x1f26('0x18')):undefined,'VoiceQueueId':_0x432a88['id']})[_0x1f26('0x1a')](_0x5ef632());}}}})[_0x1f26('0x10')](function(){return _0x3df8cb[_0x1f26('0x21')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x3df8cb[_0x1f26('0x24')],'as':_0x1f26('0x27'),'where':{'id':_0x34288c['ListId']}}]})[_0x1f26('0x10')](function(_0x5cd363){if(_0x5cd363){var _0x4bef3f=[];for(var _0x387e8d=0x0,_0x1a67e5;_0x387e8d<_0x5cd363[_0x1f26('0x28')];_0x387e8d+=0x1){_0x1a67e5=_0x5cd363[_0x387e8d][_0x1f26('0x9')]({'plain':!![]});_0x3df8cb[_0x1f26('0x29')][_0x1f26('0x13')]({'phone':_0x34288c['phone'],'ContactId':_0x34288c['id'],'ListId':_0x34288c['ListId'],'VoiceQueueId':_0x1a67e5['id']})[_0x1f26('0x1a')](function(_0x3b8ff5){logger[_0x1f26('0xa')](_0x1f26('0x2a'),_0x1f26('0xc'),_0x3b8ff5[_0x1f26('0x2b')]);});}}});})['then'](function(){return _0x3df8cb[_0x1f26('0x2c')][_0x1f26('0x22')]({'attributes':['id',_0x1f26('0x23')],'include':[{'model':_0x3df8cb[_0x1f26('0x24')],'as':_0x1f26('0x25'),'where':{'id':_0x34288c[_0x1f26('0x14')]}}]})['then'](function(_0x9192f4){if(_0x9192f4){var _0x90db78=[];for(var _0x2d0b36=0x0,_0x3eb067;_0x2d0b36<_0x9192f4[_0x1f26('0x28')];_0x2d0b36+=0x1){_0x3eb067=_0x9192f4[_0x2d0b36][_0x1f26('0x9')]({'plain':!![]});switch(_0x3eb067[_0x1f26('0x23')]){case'always':_0xb86c19(_0x3eb067)[_0x1f26('0x1a')](_0x519365());break;case'onlyIfOpen':_0x2ea968(_0x3eb067)[_0x1f26('0x1a')](_0x519365());break;default:_0x3df8cb[_0x1f26('0xe')][_0x1f26('0x13')]({'phone':_0x34288c[_0x1f26('0x7')],'ContactId':_0x34288c['id'],'ListId':_0x34288c[_0x1f26('0x14')],'scheduledat':_0x34288c[_0x1f26('0x16')]?_0x34288c[_0x1f26('0x16')]:moment()[_0x1f26('0x17')](_0x1f26('0x18')),'priority':_0x34288c[_0x1f26('0x15')]?_0x34288c['priority']:0x2,'callback':_0x34288c[_0x1f26('0x19')]?!![]:![],'callbackuniqueid':_0x34288c[_0x1f26('0x19')]?_0x34288c[_0x1f26('0x19')]:undefined,'callbackat':_0x34288c[_0x1f26('0x19')]?moment()[_0x1f26('0x17')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x3eb067['id']})[_0x1f26('0x1a')](_0x519365());}}}});})[_0x1f26('0x10')](function(){return _0x3df8cb[_0x1f26('0x2c')][_0x1f26('0x22')]({'attributes':['id'],'include':[{'model':_0x3df8cb[_0x1f26('0x24')],'as':_0x1f26('0x27'),'where':{'id':_0x34288c[_0x1f26('0x14')]}}]})[_0x1f26('0x10')](function(_0x425188){if(_0x425188){var _0x138b6b=[];for(var _0x3a0be8=0x0,_0x5806bd;_0x3a0be8<_0x425188['length'];_0x3a0be8+=0x1){_0x5806bd=_0x425188[_0x3a0be8][_0x1f26('0x9')]({'plain':!![]});_0x3df8cb['CmHopperBlack'][_0x1f26('0x13')]({'phone':_0x34288c[_0x1f26('0x7')],'ContactId':_0x34288c['id'],'ListId':_0x34288c[_0x1f26('0x14')],'CampaignId':_0x5806bd['id']})[_0x1f26('0x1a')](function(_0x1bbcc8){logger[_0x1f26('0xa')](_0x1f26('0x2a'),_0x1f26('0xc'),_0x1bbcc8[_0x1f26('0x2b')]);});}}});})['then'](function(){_0x22eb08();})['catch'](function(_0x3c1d95){logger[_0x1f26('0xa')](_0x1f26('0x2a'),_0x1f26('0xc'),_0x3c1d95['message']);_0x22eb08(_0x3c1d95);});}else{_0x22eb08(new Error(_0x1f26('0x2d')));}},'afterDestroy':function(_0x558796,_0x1ab230,_0x50cf5e){var _0x5b8b6f=_0x56be4c['models'];var _0x4091fe=_0x558796[_0x1f26('0x9')]({'plain':!![]});return _0x5b8b6f[_0x1f26('0xe')][_0x1f26('0x22')]({'raw':!![],'where':{'ListId':_0x4091fe[_0x1f26('0x14')],'ContactId':_0x4091fe['id']}})[_0x1f26('0x10')](function(_0x3b7c04){if(!_[_0x1f26('0x2e')](_0x3b7c04)){var _0x42d000=[];for(var _0x9f9f81=0x0;_0x9f9f81<_0x3b7c04['length'];_0x9f9f81+=0x1){var _0x4cfec2=_0x5b8b6f[_0x1f26('0xe')]['destroy']({'where':{'ListId':_0x3b7c04[_0x9f9f81]['ListId'],'ContactId':_0x3b7c04[_0x9f9f81][_0x1f26('0x2f')],'VoiceQueueId':_0x3b7c04[_0x9f9f81][_0x1f26('0x30')],'CampaignId':_0x3b7c04[_0x9f9f81][_0x1f26('0x31')]}});_0x42d000[_0x1f26('0x32')](_0x4cfec2);}return BPromise[_0x1f26('0x33')](_0x42d000);}})[_0x1f26('0x10')](function(_0x3b6212){logger[_0x1f26('0x34')](_0x1f26('0x35'),util[_0x1f26('0xd')](_0x3b6212,{'showHidden':![],'depth':null}));_0x50cf5e();})['catch'](function(_0x39cd99){logger[_0x1f26('0xa')]('[CmContact][afterDestroy][Error]',util[_0x1f26('0xd')](_0x39cd99,{'showHidden':![],'depth':null}));_0x50cf5e(_0x39cd99);});}}});};
\ No newline at end of file
index 8b6a8fe..195ff2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3752=['CmContact','find','options','raw','where','attributes','include','model','map','CreateCmContact','create','body','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','debug','CmContact,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowCmContact'];(function(_0x55e58c,_0x5278e9){var _0x32ce31=function(_0x4098d2){while(--_0x4098d2){_0x55e58c['push'](_0x55e58c['shift']());}};_0x32ce31(++_0x5278e9);}(_0x3752,0x87));var _0x2375=function(_0x395c24,_0x48d2cb){_0x395c24=_0x395c24-0x0;var _0x1d708b=_0x3752[_0x395c24];return _0x1d708b;};'use strict';var _=require(_0x2375('0x0'));var util=require(_0x2375('0x1'));var moment=require('moment');var BPromise=require(_0x2375('0x2'));var rs=require(_0x2375('0x3'));var fs=require('fs');var db=require(_0x2375('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2375('0x5'))(_0x2375('0x6'));var config=require(_0x2375('0x7'));var jayson=require(_0x2375('0x8'));var client=jayson[_0x2375('0x9')][_0x2375('0xa')]({'port':0x232a});var socket=require(_0x2375('0xb'))({'host':_0x2375('0xc'),'port':0x18eb});require(_0x2375('0xd'))[_0x2375('0xe')](socket);function respondWithRpcPromise(_0x45928e,_0x5df0d4,_0x5ab253){return new BPromise(function(_0x4c4d96,_0x481cd4){return client[_0x2375('0xf')](_0x45928e,_0x5ab253)[_0x2375('0x10')](function(_0x3a3dfd){logger[_0x2375('0x11')](_0x2375('0x12'),_0x5df0d4,'request\x20sent');logger[_0x2375('0x13')](_0x2375('0x14'),_0x5df0d4,_0x2375('0x15'),JSON[_0x2375('0x16')](_0x3a3dfd));if(_0x3a3dfd[_0x2375('0x17')]){if(_0x3a3dfd['error'][_0x2375('0x18')]===0x1f4){logger[_0x2375('0x17')](_0x2375('0x12'),_0x5df0d4,_0x3a3dfd['error']['message']);return _0x481cd4(_0x3a3dfd['error'][_0x2375('0x19')]);}logger[_0x2375('0x17')](_0x2375('0x12'),_0x5df0d4,_0x3a3dfd[_0x2375('0x17')][_0x2375('0x19')]);return _0x4c4d96(_0x3a3dfd[_0x2375('0x17')]['message']);}else{logger[_0x2375('0x11')]('CmContact,\x20%s,\x20%s',_0x5df0d4,_0x2375('0x15'));_0x4c4d96(_0x3a3dfd[_0x2375('0x1a')][_0x2375('0x19')]);}})[_0x2375('0x1b')](function(_0x10a67c){logger[_0x2375('0x17')](_0x2375('0x12'),_0x5df0d4,_0x10a67c);_0x481cd4(_0x10a67c);});});}exports[_0x2375('0x1c')]=function(_0x4727ee){var _0x115242=this;return new Promise(function(_0x59bfc7,_0x134f93){return db[_0x2375('0x1d')][_0x2375('0x1e')]({'raw':_0x4727ee[_0x2375('0x1f')]?_0x4727ee[_0x2375('0x1f')][_0x2375('0x20')]===undefined?!![]:![]:!![],'where':_0x4727ee[_0x2375('0x1f')]?_0x4727ee[_0x2375('0x1f')][_0x2375('0x21')]||null:null,'attributes':_0x4727ee[_0x2375('0x1f')]?_0x4727ee[_0x2375('0x1f')][_0x2375('0x22')]||null:null,'include':_0x4727ee['options']?_0x4727ee['options'][_0x2375('0x23')]?_['map'](_0x4727ee['options'][_0x2375('0x23')],function(_0x57b40f){return{'model':db[_0x57b40f[_0x2375('0x24')]],'as':_0x57b40f['as'],'attributes':_0x57b40f[_0x2375('0x22')],'include':_0x57b40f[_0x2375('0x23')]?_[_0x2375('0x25')](_0x57b40f['include'],function(_0x26154c){return{'model':db[_0x26154c['model']],'as':_0x26154c['as'],'attributes':_0x26154c[_0x2375('0x22')],'include':_0x26154c[_0x2375('0x23')]?_[_0x2375('0x25')](_0x26154c[_0x2375('0x23')],function(_0x467280){return{'model':db[_0x467280['model']],'as':_0x467280['as'],'attributes':_0x467280[_0x2375('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45e5f3){logger[_0x2375('0x11')](_0x2375('0x1c'),_0x4727ee);logger['debug'](_0x2375('0x1c'),_0x4727ee,JSON[_0x2375('0x16')](_0x45e5f3));_0x59bfc7(_0x45e5f3);})['catch'](function(_0x1fc044){logger[_0x2375('0x17')](_0x2375('0x1c'),_0x1fc044[_0x2375('0x19')],_0x4727ee);_0x134f93(_0x115242[_0x2375('0x17')](0x1f4,_0x1fc044['message']));});});};exports[_0x2375('0x26')]=function(_0x485318){var _0x48c722=this;return new Promise(function(_0x176cbc,_0x11d7d6){return db['CmContact'][_0x2375('0x27')](_0x485318[_0x2375('0x28')],{'raw':_0x485318[_0x2375('0x1f')]?_0x485318[_0x2375('0x1f')][_0x2375('0x20')]===undefined?!![]:![]:!![]})[_0x2375('0x10')](function(_0x33b3e5){logger[_0x2375('0x11')]('CreateCmContact',_0x485318);logger[_0x2375('0x13')]('CreateCmContact',_0x485318,JSON[_0x2375('0x16')](_0x33b3e5));_0x176cbc(_0x33b3e5);})[_0x2375('0x1b')](function(_0x1dd803){logger[_0x2375('0x17')]('CreateCmContact',_0x1dd803['message'],_0x485318);_0x11d7d6(_0x48c722[_0x2375('0x17')](0x1f4,_0x1dd803[_0x2375('0x19')]));});});};
\ No newline at end of file
+var _0x7502=['client','http','socket.io-emitter','./cmContact.socket','register','request','then','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContact,\x20%s,\x20%s','message','info','catch','ShowCmContact','CmContact','find','options','raw','where','attributes','include','map','model','CreateCmContact','create','body','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x5e0a4a,_0xf8879c){var _0x210827=function(_0x43302c){while(--_0x43302c){_0x5e0a4a['push'](_0x5e0a4a['shift']());}};_0x210827(++_0xf8879c);}(_0x7502,0x108));var _0x2750=function(_0x978baf,_0x280ada){_0x978baf=_0x978baf-0x0;var _0x2e572f=_0x7502[_0x978baf];return _0x2e572f;};'use strict';var _=require(_0x2750('0x0'));var util=require(_0x2750('0x1'));var moment=require('moment');var BPromise=require(_0x2750('0x2'));var rs=require(_0x2750('0x3'));var fs=require('fs');var db=require(_0x2750('0x4'))['db'];var utils=require(_0x2750('0x5'));var logger=require(_0x2750('0x6'))(_0x2750('0x7'));var config=require('../../config/environment');var jayson=require(_0x2750('0x8'));var client=jayson[_0x2750('0x9')][_0x2750('0xa')]({'port':0x232a});var socket=require(_0x2750('0xb'))({'host':'localhost','port':0x18eb});require(_0x2750('0xc'))[_0x2750('0xd')](socket);function respondWithRpcPromise(_0x2d4db2,_0x53475e,_0x7cb2c2){return new BPromise(function(_0x21a233,_0x45b371){return client[_0x2750('0xe')](_0x2d4db2,_0x7cb2c2)[_0x2750('0xf')](function(_0x250a44){logger['info']('CmContact,\x20%s,\x20%s',_0x53475e,_0x2750('0x10'));logger[_0x2750('0x11')](_0x2750('0x12'),_0x53475e,'request\x20sent',JSON[_0x2750('0x13')](_0x250a44));if(_0x250a44[_0x2750('0x14')]){if(_0x250a44[_0x2750('0x14')][_0x2750('0x15')]===0x1f4){logger[_0x2750('0x14')](_0x2750('0x16'),_0x53475e,_0x250a44[_0x2750('0x14')][_0x2750('0x17')]);return _0x45b371(_0x250a44[_0x2750('0x14')][_0x2750('0x17')]);}logger['error']('CmContact,\x20%s,\x20%s',_0x53475e,_0x250a44[_0x2750('0x14')][_0x2750('0x17')]);return _0x21a233(_0x250a44[_0x2750('0x14')][_0x2750('0x17')]);}else{logger[_0x2750('0x18')](_0x2750('0x16'),_0x53475e,'request\x20sent');_0x21a233(_0x250a44['result'][_0x2750('0x17')]);}})[_0x2750('0x19')](function(_0x3e0160){logger[_0x2750('0x14')]('CmContact,\x20%s,\x20%s',_0x53475e,_0x3e0160);_0x45b371(_0x3e0160);});});}exports[_0x2750('0x1a')]=function(_0x3b3d22){var _0x5925ec=this;return new Promise(function(_0x4c8561,_0x19e84e){return db[_0x2750('0x1b')][_0x2750('0x1c')]({'raw':_0x3b3d22[_0x2750('0x1d')]?_0x3b3d22['options'][_0x2750('0x1e')]===undefined?!![]:![]:!![],'where':_0x3b3d22[_0x2750('0x1d')]?_0x3b3d22[_0x2750('0x1d')][_0x2750('0x1f')]||null:null,'attributes':_0x3b3d22[_0x2750('0x1d')]?_0x3b3d22['options'][_0x2750('0x20')]||null:null,'include':_0x3b3d22[_0x2750('0x1d')]?_0x3b3d22['options'][_0x2750('0x21')]?_[_0x2750('0x22')](_0x3b3d22[_0x2750('0x1d')][_0x2750('0x21')],function(_0x478f28){return{'model':db[_0x478f28['model']],'as':_0x478f28['as'],'attributes':_0x478f28[_0x2750('0x20')],'include':_0x478f28[_0x2750('0x21')]?_[_0x2750('0x22')](_0x478f28[_0x2750('0x21')],function(_0x137c0f){return{'model':db[_0x137c0f[_0x2750('0x23')]],'as':_0x137c0f['as'],'attributes':_0x137c0f[_0x2750('0x20')],'include':_0x137c0f['include']?_['map'](_0x137c0f[_0x2750('0x21')],function(_0x2e2e1a){return{'model':db[_0x2e2e1a[_0x2750('0x23')]],'as':_0x2e2e1a['as'],'attributes':_0x2e2e1a[_0x2750('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31a32f){logger[_0x2750('0x18')]('ShowCmContact',_0x3b3d22);logger[_0x2750('0x11')](_0x2750('0x1a'),_0x3b3d22,JSON['stringify'](_0x31a32f));_0x4c8561(_0x31a32f);})[_0x2750('0x19')](function(_0x418407){logger[_0x2750('0x14')](_0x2750('0x1a'),_0x418407[_0x2750('0x17')],_0x3b3d22);_0x19e84e(_0x5925ec[_0x2750('0x14')](0x1f4,_0x418407[_0x2750('0x17')]));});});};exports[_0x2750('0x24')]=function(_0x36ec2b){var _0x534a1e=this;return new Promise(function(_0x309c43,_0x431b3d){return db[_0x2750('0x1b')][_0x2750('0x25')](_0x36ec2b[_0x2750('0x26')],{'raw':_0x36ec2b[_0x2750('0x1d')]?_0x36ec2b[_0x2750('0x1d')][_0x2750('0x1e')]===undefined?!![]:![]:!![]})[_0x2750('0xf')](function(_0x1644ed){logger[_0x2750('0x18')](_0x2750('0x24'),_0x36ec2b);logger[_0x2750('0x11')](_0x2750('0x24'),_0x36ec2b,JSON[_0x2750('0x13')](_0x1644ed));_0x309c43(_0x1644ed);})[_0x2750('0x19')](function(_0x42e852){logger[_0x2750('0x14')]('CreateCmContact',_0x42e852['message'],_0x36ec2b);_0x431b3d(_0x534a1e['error'](0x1f4,_0x42e852[_0x2750('0x17')]));});});};
\ No newline at end of file
index 583db70..ec89e0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae24=['length','cmContact:','./cmContact.events','remove','removeListener','register'];(function(_0x3b5ada,_0x5f1918){var _0x8fb752=function(_0x3453ab){while(--_0x3453ab){_0x3b5ada['push'](_0x3b5ada['shift']());}};_0x8fb752(++_0x5f1918);}(_0xae24,0x182));var _0x4ae2=function(_0x2526cb,_0x17cb63){_0x2526cb=_0x2526cb-0x0;var _0x5a8974=_0xae24[_0x2526cb];return _0x5a8974;};'use strict';var CmContactEvents=require(_0x4ae2('0x0'));var events=['save',_0x4ae2('0x1'),'update'];function createListener(_0xf4c45d,_0x1bf293){return function(_0x564d54){_0x1bf293['emit'](_0xf4c45d,_0x564d54);};}function removeListener(_0x1afc7a,_0x5b25b5){return function(){CmContactEvents[_0x4ae2('0x2')](_0x1afc7a,_0x5b25b5);};}exports[_0x4ae2('0x3')]=function(_0x20c85c){for(var _0x3e6055=0x0,_0x428054=events[_0x4ae2('0x4')];_0x3e6055<_0x428054;_0x3e6055++){var _0x4f2e84=events[_0x3e6055];var _0x5f589a=createListener(_0x4ae2('0x5')+_0x4f2e84,_0x20c85c);CmContactEvents['on'](_0x4f2e84,_0x5f589a);}};
\ No newline at end of file
+var _0xf53f=['update','emit','removeListener','register','cmContact:','./cmContact.events','save','remove'];(function(_0x2939c7,_0x307507){var _0x449461=function(_0x55356a){while(--_0x55356a){_0x2939c7['push'](_0x2939c7['shift']());}};_0x449461(++_0x307507);}(_0xf53f,0x8d));var _0xff53=function(_0x45e70a,_0x1ee0e2){_0x45e70a=_0x45e70a-0x0;var _0x21414e=_0xf53f[_0x45e70a];return _0x21414e;};'use strict';var CmContactEvents=require(_0xff53('0x0'));var events=[_0xff53('0x1'),_0xff53('0x2'),_0xff53('0x3')];function createListener(_0x3b48fc,_0x4afcd){return function(_0x492e12){_0x4afcd[_0xff53('0x4')](_0x3b48fc,_0x492e12);};}function removeListener(_0x18b504,_0x2077b9){return function(){CmContactEvents[_0xff53('0x5')](_0x18b504,_0x2077b9);};}exports[_0xff53('0x6')]=function(_0x54d39c){for(var _0x54e637=0x0,_0x27b397=events['length'];_0x54e637<_0x27b397;_0x54e637++){var _0x1c27bb=events[_0x54e637];var _0x122746=createListener(_0xff53('0x7')+_0x1c27bb,_0x54d39c);CmContactEvents['on'](_0x1c27bb,_0x122746);}};
\ No newline at end of file
index 6514613..0b80d60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bc8=['./cmContact.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/tags','getTags','getHoppers','/:id/hopper_finals','getHopperFinals','post','/merge','create','/create_many','bulkCreate','setTags','join','root','originalname','replace','basename','now','extname','/csv','single','file','uploadCsv','diskStorage','format','upload','import','put','update','delete','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xaece58,_0x2d0bc4){var _0x596614=function(_0x453ee6){while(--_0x453ee6){_0xaece58['push'](_0xaece58['shift']());}};_0x596614(++_0x2d0bc4);}(_0x5bc8,0x143));var _0x85bc=function(_0x39caaa,_0x1f37bc){_0x39caaa=_0x39caaa-0x0;var _0x9b9c7d=_0x5bc8[_0x39caaa];return _0x9b9c7d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var express=require(_0x85bc('0x0'));var router=express[_0x85bc('0x1')]();var auth=require(_0x85bc('0x2'));var interaction=require(_0x85bc('0x3'));var config=require(_0x85bc('0x4'));var controller=require(_0x85bc('0x5'));router[_0x85bc('0x6')]('/',auth[_0x85bc('0x7')](),controller[_0x85bc('0x8')]);router['get'](_0x85bc('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x85bc('0x6')](_0x85bc('0xa'),auth['isAuthenticated'](),controller[_0x85bc('0xb')]);router[_0x85bc('0x6')](_0x85bc('0xc'),auth[_0x85bc('0x7')](),controller[_0x85bc('0xd')]);router[_0x85bc('0x6')]('/:id/hoppers',auth[_0x85bc('0x7')](),controller[_0x85bc('0xe')]);router[_0x85bc('0x6')]('/:id/hopper_histories',auth[_0x85bc('0x7')](),controller['getHopperHistories']);router['get'](_0x85bc('0xf'),auth['isAuthenticated'](),controller[_0x85bc('0x10')]);router[_0x85bc('0x6')]('/:id/jscripty_sessions',auth[_0x85bc('0x7')](),controller['getJscriptySessions']);router[_0x85bc('0x11')](_0x85bc('0x12'),auth[_0x85bc('0x7')](),controller['merge']);router[_0x85bc('0x11')]('/',auth[_0x85bc('0x7')](),controller[_0x85bc('0x13')]);router[_0x85bc('0x11')](_0x85bc('0x14'),auth[_0x85bc('0x7')](),controller[_0x85bc('0x15')]);router[_0x85bc('0x11')](_0x85bc('0xc'),auth[_0x85bc('0x7')](),controller[_0x85bc('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x6450f2,_0x4bfa49,_0x53b219){_0x53b219(null,path[_0x85bc('0x17')](config[_0x85bc('0x18')],'server/files/tmp'));},'filename':function(_0x2e5d19,_0x228b20,_0x294f57){_0x228b20[_0x85bc('0x19')]=_0x228b20['originalname'][_0x85bc('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x294f57(null,util['format']('%s-%s%s',path[_0x85bc('0x1b')](_0x228b20['originalname'],path['extname'](_0x228b20[_0x85bc('0x19')])),Date[_0x85bc('0x1c')](),path[_0x85bc('0x1d')](_0x228b20[_0x85bc('0x19')])));}})});router[_0x85bc('0x11')](_0x85bc('0x1e'),upload[_0x85bc('0x1f')](_0x85bc('0x20')),controller[_0x85bc('0x21')]);var upload=multer({'storage':multer[_0x85bc('0x22')]({'destination':function(_0x1a8788,_0x26db9a,_0x23d7d6){_0x23d7d6(null,path[_0x85bc('0x17')](config[_0x85bc('0x18')],'server/files/tmp'));},'filename':function(_0x5a6ffd,_0x42458e,_0xb9a1c9){_0x42458e[_0x85bc('0x19')]=_0x42458e[_0x85bc('0x19')][_0x85bc('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xb9a1c9(null,util[_0x85bc('0x23')]('%s-%s%s',path[_0x85bc('0x1b')](_0x42458e[_0x85bc('0x19')],path[_0x85bc('0x1d')](_0x42458e[_0x85bc('0x19')])),Date['now'](),path['extname'](_0x42458e[_0x85bc('0x19')])));}})});router[_0x85bc('0x11')]('/upload',upload[_0x85bc('0x1f')](_0x85bc('0x20')),controller[_0x85bc('0x24')]);router[_0x85bc('0x11')]('/upload/:id',auth['isAuthenticated'](),controller[_0x85bc('0x25')]);router[_0x85bc('0x26')]('/:id',auth[_0x85bc('0x7')](),controller[_0x85bc('0x27')]);router[_0x85bc('0x28')](_0x85bc('0xa'),auth[_0x85bc('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xdb74=['getJscriptySessions','post','/merge','diskStorage','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','/csv','single','uploadCsv','join','now','/upload','file','upload','/upload/:id','import','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/tags','getTags','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb74,0x171));var _0x4db7=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xdb74[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x4db7('0x0'));var util=require(_0x4db7('0x1'));var path=require(_0x4db7('0x2'));var express=require(_0x4db7('0x3'));var router=express[_0x4db7('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4db7('0x5'));var config=require(_0x4db7('0x6'));var controller=require(_0x4db7('0x7'));router[_0x4db7('0x8')]('/',auth[_0x4db7('0x9')](),controller[_0x4db7('0xa')]);router['get'](_0x4db7('0xb'),auth[_0x4db7('0x9')](),controller[_0x4db7('0xc')]);router['get'](_0x4db7('0xd'),auth[_0x4db7('0x9')](),controller[_0x4db7('0xe')]);router['get'](_0x4db7('0xf'),auth['isAuthenticated'](),controller[_0x4db7('0x10')]);router[_0x4db7('0x8')](_0x4db7('0x11'),auth['isAuthenticated'](),controller[_0x4db7('0x12')]);router[_0x4db7('0x8')]('/:id/hopper_histories',auth[_0x4db7('0x9')](),controller[_0x4db7('0x13')]);router[_0x4db7('0x8')](_0x4db7('0x14'),auth[_0x4db7('0x9')](),controller[_0x4db7('0x15')]);router[_0x4db7('0x8')](_0x4db7('0x16'),auth[_0x4db7('0x9')](),controller[_0x4db7('0x17')]);router[_0x4db7('0x18')](_0x4db7('0x19'),auth[_0x4db7('0x9')](),controller['merge']);router[_0x4db7('0x18')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4db7('0x18')]('/create_many',auth[_0x4db7('0x9')](),controller['bulkCreate']);router[_0x4db7('0x18')](_0x4db7('0xf'),auth[_0x4db7('0x9')](),controller['setTags']);var upload=multer({'storage':multer[_0x4db7('0x1a')]({'destination':function(_0x61eb82,_0x4f14f2,_0x17d78a){_0x17d78a(null,path['join'](config[_0x4db7('0x1b')],_0x4db7('0x1c')));},'filename':function(_0x12d398,_0x2b085c,_0x402e66){_0x2b085c[_0x4db7('0x1d')]=_0x2b085c['originalname'][_0x4db7('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x402e66(null,util[_0x4db7('0x1f')](_0x4db7('0x20'),path[_0x4db7('0x21')](_0x2b085c['originalname'],path['extname'](_0x2b085c[_0x4db7('0x1d')])),Date['now'](),path[_0x4db7('0x22')](_0x2b085c['originalname'])));}})});router[_0x4db7('0x18')](_0x4db7('0x23'),upload[_0x4db7('0x24')]('file'),controller[_0x4db7('0x25')]);var upload=multer({'storage':multer[_0x4db7('0x1a')]({'destination':function(_0x17980e,_0x2bc41b,_0x16d466){_0x16d466(null,path[_0x4db7('0x26')](config[_0x4db7('0x1b')],'server/files/tmp'));},'filename':function(_0x34a070,_0x22b2bd,_0x31121a){_0x22b2bd[_0x4db7('0x1d')]=_0x22b2bd[_0x4db7('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x31121a(null,util[_0x4db7('0x1f')]('%s-%s%s',path[_0x4db7('0x21')](_0x22b2bd[_0x4db7('0x1d')],path[_0x4db7('0x22')](_0x22b2bd[_0x4db7('0x1d')])),Date[_0x4db7('0x27')](),path['extname'](_0x22b2bd[_0x4db7('0x1d')])));}})});router['post'](_0x4db7('0x28'),upload[_0x4db7('0x24')](_0x4db7('0x29')),controller[_0x4db7('0x2a')]);router[_0x4db7('0x18')](_0x4db7('0x2b'),auth[_0x4db7('0x9')](),controller[_0x4db7('0x2c')]);router['put'](_0x4db7('0xd'),auth['isAuthenticated'](),controller[_0x4db7('0x2d')]);router[_0x4db7('0x2e')](_0x4db7('0xd'),auth['isAuthenticated'](),controller[_0x4db7('0x2f')]);module[_0x4db7('0x30')]=router;
\ No newline at end of file
index 56ca46f..af63dbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c9c=['exports','VIRTUAL','alias','STRING','getDataValue','name','TEXT','long','type','select','parse','values','setDataValue','stringify','BOOLEAN','sequelize','lodash'];(function(_0x17b50c,_0x595f54){var _0x929b59=function(_0x5870a2){while(--_0x5870a2){_0x17b50c['push'](_0x17b50c['shift']());}};_0x929b59(++_0x595f54);}(_0x9c9c,0x86));var _0xc9c9=function(_0x440fde,_0x445ce0){_0x440fde=_0x440fde-0x0;var _0x11052c=_0x9c9c[_0x440fde];return _0x11052c;};'use strict';var Sequelize=require(_0xc9c9('0x0'));var _=require(_0xc9c9('0x1'));module[_0xc9c9('0x2')]={'name':{'type':Sequelize[_0xc9c9('0x3')],'get':function(_0x5c8718){return this['getDataValue'](_0xc9c9('0x4'));}},'alias':{'type':Sequelize[_0xc9c9('0x5')],'allowNull':![],'set':function(_0x12cc9d){this['setDataValue'](_0xc9c9('0x4'),_0x12cc9d?_0x12cc9d:this[_0xc9c9('0x6')](_0xc9c9('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xc9c9('0x8')](_0xc9c9('0x9')),'get':function(){if(this[_0xc9c9('0x6')](_0xc9c9('0xa'))===_0xc9c9('0xb')){return JSON[_0xc9c9('0xc')](this[_0xc9c9('0x6')](_0xc9c9('0xd')));}else{return this[_0xc9c9('0x6')]('values');}},'set':function(_0x4afae7){if(Array['isArray'](_0x4afae7)){this[_0xc9c9('0xe')](_0xc9c9('0xd'),JSON[_0xc9c9('0xf')](_0x4afae7));}else{this[_0xc9c9('0xe')]('values',_0x4afae7);}}},'required':{'type':Sequelize[_0xc9c9('0x10')],'defaultValue':![]}};
\ No newline at end of file
+var _0x53fa=['select','values','isArray','stringify','BOOLEAN','sequelize','exports','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0x53fa,0x16d));var _0xa53f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53fa[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa53f('0x0'));var _=require('lodash');module[_0xa53f('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2350bd){return this[_0xa53f('0x2')](_0xa53f('0x3'));}},'alias':{'type':Sequelize[_0xa53f('0x4')],'allowNull':![],'set':function(_0x324e0a){this[_0xa53f('0x5')](_0xa53f('0x3'),_0x324e0a?_0x324e0a:this['getDataValue'](_0xa53f('0x6')));}},'type':{'type':Sequelize[_0xa53f('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0xa53f('0x7')](_0xa53f('0x8')),'get':function(){if(this[_0xa53f('0x2')](_0xa53f('0x9'))===_0xa53f('0xa')){return JSON['parse'](this[_0xa53f('0x2')](_0xa53f('0xb')));}else{return this['getDataValue']('values');}},'set':function(_0x5ce966){if(Array[_0xa53f('0xc')](_0x5ce966)){this[_0xa53f('0x5')](_0xa53f('0xb'),JSON[_0xa53f('0xd')](_0x5ce966));}else{this[_0xa53f('0x5')](_0xa53f('0xb'),_0x5ce966);}}},'required':{'type':Sequelize[_0xa53f('0xe')],'defaultValue':![]}};
\ No newline at end of file
index bdb0f76..5d7c62d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa64=['number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cf_%d','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','error','stack','send','index','CmCustomField','rawAttributes','model','keys','name','query','dateStart','dateEnd','filters','intersection','fields','length','attributes','nolimit','order','sort','where','add','day','filter','merge','map','options','includeAll','findAll','rows','catch','show','params','find','body','create','sequelize','Sequelize','TEXT','type'];(function(_0x595491,_0x3a6d88){var _0x332a1a=function(_0x91d995){while(--_0x91d995){_0x595491['push'](_0x595491['shift']());}};_0x332a1a(++_0x3a6d88);}(_0xaa64,0xf7));var _0x4aa6=function(_0x5cb34c,_0x39c633){_0x5cb34c=_0x5cb34c-0x0;var _0xfc1f8f=_0xaa64[_0x5cb34c];return _0xfc1f8f;};'use strict';var pdf=require(_0x4aa6('0x0'));var emlformat=require(_0x4aa6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4aa6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4aa6('0x3'));var moment=require(_0x4aa6('0x4'));var BPromise=require(_0x4aa6('0x5'));var Mustache=require('mustache');var util=require(_0x4aa6('0x6'));var path=require(_0x4aa6('0x7'));var sox=require(_0x4aa6('0x8'));var csv=require(_0x4aa6('0x9'));var ejs=require(_0x4aa6('0xa'));var fs=require('fs');var _=require(_0x4aa6('0xb'));var squel=require(_0x4aa6('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4aa6('0xd'));var toCsv=require(_0x4aa6('0x9'));var querystring=require('querystring');var Papa=require(_0x4aa6('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0x4aa6('0xf'))(_0x4aa6('0x10'));var utils=require(_0x4aa6('0x11'));var config=require(_0x4aa6('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2dfa35,_0x1d23d2){_0x1d23d2=_0x1d23d2||0xcc;return function(_0x2a5d61){if(_0x2a5d61){return _0x2dfa35[_0x4aa6('0x13')](_0x1d23d2);}return _0x2dfa35[_0x4aa6('0x14')](_0x1d23d2)[_0x4aa6('0x15')]();};}function respondWithResult(_0x32401e,_0x14a12a){_0x14a12a=_0x14a12a||0xc8;return function(_0x3e016e){if(_0x3e016e){return _0x32401e[_0x4aa6('0x14')](_0x14a12a)['json'](_0x3e016e);}};}function respondWithFilteredResult(_0x413222,_0x5b0133){return function(_0x561f5d){if(_0x561f5d){var _0x43a0a6=_0x561f5d[_0x4aa6('0x16')],_0x17a0e6=_0x5b0133[_0x4aa6('0x17')],_0x326953=_0x5b0133[_0x4aa6('0x17')]+_0x5b0133[_0x4aa6('0x18')],_0x11e4d7;if(_0x326953>=_0x43a0a6){_0x326953=_0x43a0a6;_0x11e4d7=0xc8;}else{_0x11e4d7=0xce;}_0x413222['status'](_0x11e4d7);return _0x413222[_0x4aa6('0x19')]('Content-Range',_0x17a0e6+'-'+_0x326953+'/'+_0x43a0a6)[_0x4aa6('0x1a')](_0x561f5d);}return null;};}function patchUpdates(_0x5c6d3c){return function(_0x54a6d8){try{jsonpatch[_0x4aa6('0x1b')](_0x54a6d8,_0x5c6d3c,!![]);}catch(_0x15f5e6){return BPromise[_0x4aa6('0x1c')](_0x15f5e6);}return _0x54a6d8[_0x4aa6('0x1d')]();};}function saveUpdates(_0x2aa5d7,_0x1dfd4e){return function(_0x1d4a09){if(_0x1d4a09){return _0x1d4a09[_0x4aa6('0x1e')](_0x2aa5d7)[_0x4aa6('0x1f')](function(_0x4c9159){return _0x4c9159;});}return null;};}function removeEntity(_0x313e73,_0x1c5549){return function(_0x9a1a7e){if(_0x9a1a7e){return _0x9a1a7e[_0x4aa6('0x20')]()[_0x4aa6('0x1f')](function(){_0x313e73[_0x4aa6('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa0f5be,_0x3699f7){return function(_0x3802d8){if(!_0x3802d8){_0xa0f5be[_0x4aa6('0x13')](0x194);}return _0x3802d8;};}function handleError(_0xa18442,_0x44d151){_0x44d151=_0x44d151||0x1f4;return function(_0x568a5c){logger[_0x4aa6('0x21')](_0x568a5c[_0x4aa6('0x22')]);if(_0x568a5c['name']){delete _0x568a5c['name'];}_0xa18442[_0x4aa6('0x14')](_0x44d151)[_0x4aa6('0x23')](_0x568a5c);};}exports[_0x4aa6('0x24')]=function(_0x3425df,_0x2001ce){var _0x5e53a7={},_0x44c6cf={},_0x185fdf={'count':0x0,'rows':[]};var _0x343bd0=db[_0x4aa6('0x25')][_0x4aa6('0x26')];_0x44c6cf[_0x4aa6('0x27')]=_['differenceBy'](_[_0x4aa6('0x28')](_0x343bd0),[_0x4aa6('0x29')]);var _0x5bc756={'dateStart':_0x3425df[_0x4aa6('0x2a')][_0x4aa6('0x2b')],'dateEnd':_0x3425df[_0x4aa6('0x2a')][_0x4aa6('0x2c')]};delete _0x3425df['query'][_0x4aa6('0x2b')];delete _0x3425df[_0x4aa6('0x2a')][_0x4aa6('0x2c')];_0x44c6cf['query']=_[_0x4aa6('0x28')](_0x3425df[_0x4aa6('0x2a')]);_0x44c6cf[_0x4aa6('0x2d')]=_['intersection'](_0x44c6cf[_0x4aa6('0x27')],_0x44c6cf[_0x4aa6('0x2a')]);_0x5e53a7['attributes']=_[_0x4aa6('0x2e')](_0x44c6cf[_0x4aa6('0x27')],qs[_0x4aa6('0x2f')](_0x3425df[_0x4aa6('0x2a')][_0x4aa6('0x2f')]));_0x5e53a7['attributes']=_0x5e53a7['attributes'][_0x4aa6('0x30')]?_0x5e53a7[_0x4aa6('0x31')]:_0x44c6cf[_0x4aa6('0x27')];if(!_0x3425df['query']['hasOwnProperty'](_0x4aa6('0x32'))){_0x5e53a7[_0x4aa6('0x18')]=qs[_0x4aa6('0x18')](_0x3425df[_0x4aa6('0x2a')][_0x4aa6('0x18')]);_0x5e53a7[_0x4aa6('0x17')]=qs[_0x4aa6('0x17')](_0x3425df[_0x4aa6('0x2a')]['offset']);}_0x5e53a7[_0x4aa6('0x33')]=qs[_0x4aa6('0x34')](_0x3425df[_0x4aa6('0x2a')][_0x4aa6('0x34')]);_0x5e53a7[_0x4aa6('0x35')]=qs[_0x4aa6('0x2d')](_['pick'](_0x3425df[_0x4aa6('0x2a')],_0x44c6cf[_0x4aa6('0x2d')]));if(_0x5bc756['dateStart']){if(_0x5bc756[_0x4aa6('0x2c')]){_0x5bc756[_0x4aa6('0x2c')]=moment(_0x5bc756[_0x4aa6('0x2c')])[_0x4aa6('0x36')](0x1,'day');}else{_0x5bc756['dateEnd']=moment(_0x5bc756[_0x4aa6('0x2b')])[_0x4aa6('0x36')](0x1,_0x4aa6('0x37'));}_['merge'](_0x5e53a7[_0x4aa6('0x35')],{'createdAt':{'$gte':_0x5bc756[_0x4aa6('0x2b')],'$lte':_0x5bc756['dateEnd']}});}if(_0x3425df[_0x4aa6('0x2a')][_0x4aa6('0x38')]){_0x5e53a7[_0x4aa6('0x35')]=_[_0x4aa6('0x39')](_0x5e53a7[_0x4aa6('0x35')],{'$or':_[_0x4aa6('0x3a')](_0x5e53a7['attributes'],function(_0x47daed){var _0x3e9dcd={};_0x3e9dcd[_0x47daed]={'$like':'%'+_0x3425df[_0x4aa6('0x2a')][_0x4aa6('0x38')]+'%'};return _0x3e9dcd;})});}_0x5e53a7=_[_0x4aa6('0x39')]({},_0x5e53a7,_0x3425df[_0x4aa6('0x3b')]);var _0x592280={'where':_0x5e53a7[_0x4aa6('0x35')]};return db[_0x4aa6('0x25')]['count'](_0x592280)[_0x4aa6('0x1f')](function(_0x366a8a){_0x185fdf[_0x4aa6('0x16')]=_0x366a8a;if(_0x3425df[_0x4aa6('0x2a')][_0x4aa6('0x3c')]){_0x5e53a7['include']=[{'all':!![]}];}return db[_0x4aa6('0x25')][_0x4aa6('0x3d')](_0x5e53a7);})['then'](function(_0x3fefa6){_0x185fdf[_0x4aa6('0x3e')]=_0x3fefa6;return _0x185fdf;})['then'](respondWithFilteredResult(_0x2001ce,_0x5e53a7))[_0x4aa6('0x3f')](handleError(_0x2001ce,null));};exports[_0x4aa6('0x40')]=function(_0x540c78,_0x1468d1){var _0x3ebc16={'raw':!![],'where':{'id':_0x540c78[_0x4aa6('0x41')]['id']}},_0x263e33={};_0x263e33[_0x4aa6('0x27')]=_[_0x4aa6('0x28')](db[_0x4aa6('0x25')]['rawAttributes']);_0x263e33[_0x4aa6('0x2a')]=_[_0x4aa6('0x28')](_0x540c78[_0x4aa6('0x2a')]);_0x263e33[_0x4aa6('0x2d')]=_[_0x4aa6('0x2e')](_0x263e33[_0x4aa6('0x27')],_0x263e33[_0x4aa6('0x2a')]);_0x3ebc16[_0x4aa6('0x31')]=_['intersection'](_0x263e33[_0x4aa6('0x27')],qs['fields'](_0x540c78[_0x4aa6('0x2a')][_0x4aa6('0x2f')]));_0x3ebc16[_0x4aa6('0x31')]=_0x3ebc16['attributes'][_0x4aa6('0x30')]?_0x3ebc16['attributes']:_0x263e33['model'];if(_0x540c78[_0x4aa6('0x2a')][_0x4aa6('0x3c')]){_0x3ebc16['include']=[{'all':!![]}];}_0x3ebc16=_[_0x4aa6('0x39')]({},_0x3ebc16,_0x540c78[_0x4aa6('0x3b')]);return db['CmCustomField'][_0x4aa6('0x42')](_0x3ebc16)['then'](handleEntityNotFound(_0x1468d1,null))['then'](respondWithResult(_0x1468d1,null))[_0x4aa6('0x3f')](handleError(_0x1468d1,null));};exports['update']=function(_0x36575a,_0x5edfc4){if(_0x36575a[_0x4aa6('0x43')]['id']){delete _0x36575a[_0x4aa6('0x43')]['id'];}return db[_0x4aa6('0x25')][_0x4aa6('0x42')]({'where':{'id':_0x36575a[_0x4aa6('0x41')]['id']}})['then'](handleEntityNotFound(_0x5edfc4,null))['then'](saveUpdates(_0x36575a[_0x4aa6('0x43')],null))[_0x4aa6('0x1f')](respondWithResult(_0x5edfc4,null))[_0x4aa6('0x3f')](handleError(_0x5edfc4,null));};exports['destroy']=function(_0x193d48,_0x3260b0){return db[_0x4aa6('0x25')][_0x4aa6('0x42')]({'where':{'id':_0x193d48['params']['id']}})['then'](handleEntityNotFound(_0x3260b0,null))[_0x4aa6('0x1f')](removeEntity(_0x3260b0,null))[_0x4aa6('0x3f')](handleError(_0x3260b0,null));};exports[_0x4aa6('0x44')]=function(_0x6dd334,_0x5a525c){var _0x2891a4;return db[_0x4aa6('0x45')]['transaction'](function(_0x181d09){return db['CmCustomField'][_0x4aa6('0x44')](_0x6dd334[_0x4aa6('0x43')],{'transaction':_0x181d09})[_0x4aa6('0x1f')](function(_0x1a0860){_0x2891a4=_0x1a0860;var _0x5f1d82={'type':db[_0x4aa6('0x46')][_0x4aa6('0x47')],'transaction':_0x181d09};switch(_0x6dd334[_0x4aa6('0x43')]['type']){case'text':_0x5f1d82[_0x4aa6('0x48')]=db[_0x4aa6('0x46')][_0x4aa6('0x47')];break;case _0x4aa6('0x49'):_0x5f1d82['type']=db[_0x4aa6('0x46')][_0x4aa6('0x4a')];break;case _0x4aa6('0x4b'):_0x5f1d82[_0x4aa6('0x48')]=db[_0x4aa6('0x46')][_0x4aa6('0x4c')];_0x5f1d82[_0x4aa6('0x4d')]=![];break;default:}return db['sequelize'][_0x4aa6('0x4e')]['addColumn']('cm_contacts',util['format'](_0x4aa6('0x4f'),_0x2891a4['id']),_0x5f1d82);})[_0x4aa6('0x1f')](function(){return _0x2891a4;});})[_0x4aa6('0x1f')](respondWithResult(_0x5a525c,0xc9))['catch'](handleError(_0x5a525c,null));};
\ No newline at end of file
+var _0xd070=['../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','end','status','json','count','offset','limit','save','then','destroy','name','send','CmCustomField','rawAttributes','model','differenceBy','keys','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','add','day','filter','merge','map','include','rows','params','options','catch','update','body','find','sequelize','transaction','Sequelize','TEXT','type','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x4a5f6c,_0x4f532e){var _0x281ffd=function(_0x4c68e3){while(--_0x4c68e3){_0x4a5f6c['push'](_0x4a5f6c['shift']());}};_0x281ffd(++_0x4f532e);}(_0xd070,0x8e));var _0x0d07=function(_0x547ed8,_0xc64223){_0x547ed8=_0x547ed8-0x0;var _0x585899=_0xd070[_0x547ed8];return _0x585899;};'use strict';var pdf=require(_0x0d07('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0d07('0x1'));var zipdir=require(_0x0d07('0x2'));var jsonpatch=require(_0x0d07('0x3'));var rp=require(_0x0d07('0x4'));var moment=require(_0x0d07('0x5'));var BPromise=require(_0x0d07('0x6'));var Mustache=require(_0x0d07('0x7'));var util=require(_0x0d07('0x8'));var path=require(_0x0d07('0x9'));var sox=require(_0x0d07('0xa'));var csv=require(_0x0d07('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0d07('0xc'));var squel=require('squel');var crypto=require(_0x0d07('0xd'));var jsforce=require(_0x0d07('0xe'));var deskjs=require(_0x0d07('0xf'));var toCsv=require(_0x0d07('0xb'));var querystring=require(_0x0d07('0x10'));var Papa=require(_0x0d07('0x11'));var qs=require(_0x0d07('0x12'));var logger=require(_0x0d07('0x13'))(_0x0d07('0x14'));var utils=require(_0x0d07('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x385d21,_0x287781){_0x287781=_0x287781||0xcc;return function(_0x490f48){if(_0x490f48){return _0x385d21[_0x0d07('0x16')](_0x287781);}return _0x385d21['status'](_0x287781)[_0x0d07('0x17')]();};}function respondWithResult(_0xe73ad0,_0x5c4ea8){_0x5c4ea8=_0x5c4ea8||0xc8;return function(_0x11a2ee){if(_0x11a2ee){return _0xe73ad0[_0x0d07('0x18')](_0x5c4ea8)[_0x0d07('0x19')](_0x11a2ee);}};}function respondWithFilteredResult(_0x1eb6ba,_0x334556){return function(_0x3ac960){if(_0x3ac960){var _0x4a9b6f=_0x3ac960[_0x0d07('0x1a')],_0x30a86b=_0x334556[_0x0d07('0x1b')],_0x5b91c0=_0x334556[_0x0d07('0x1b')]+_0x334556[_0x0d07('0x1c')],_0x5b0749;if(_0x5b91c0>=_0x4a9b6f){_0x5b91c0=_0x4a9b6f;_0x5b0749=0xc8;}else{_0x5b0749=0xce;}_0x1eb6ba[_0x0d07('0x18')](_0x5b0749);return _0x1eb6ba['set']('Content-Range',_0x30a86b+'-'+_0x5b91c0+'/'+_0x4a9b6f)['json'](_0x3ac960);}return null;};}function patchUpdates(_0x187df2){return function(_0x312015){try{jsonpatch['apply'](_0x312015,_0x187df2,!![]);}catch(_0x410ad2){return BPromise['reject'](_0x410ad2);}return _0x312015[_0x0d07('0x1d')]();};}function saveUpdates(_0x5bacd5,_0x5c63b4){return function(_0x4047c8){if(_0x4047c8){return _0x4047c8['update'](_0x5bacd5)[_0x0d07('0x1e')](function(_0x54790f){return _0x54790f;});}return null;};}function removeEntity(_0x3781f3,_0x581f87){return function(_0x51da24){if(_0x51da24){return _0x51da24[_0x0d07('0x1f')]()[_0x0d07('0x1e')](function(){_0x3781f3[_0x0d07('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x96853e,_0x53d575){return function(_0x504a2e){if(!_0x504a2e){_0x96853e[_0x0d07('0x16')](0x194);}return _0x504a2e;};}function handleError(_0x14a160,_0xd42245){_0xd42245=_0xd42245||0x1f4;return function(_0x19f82f){logger['error'](_0x19f82f['stack']);if(_0x19f82f[_0x0d07('0x20')]){delete _0x19f82f['name'];}_0x14a160[_0x0d07('0x18')](_0xd42245)[_0x0d07('0x21')](_0x19f82f);};}exports['index']=function(_0x44a14c,_0x509fb9){var _0x483cb7={},_0x5da34f={},_0x238bee={'count':0x0,'rows':[]};var _0x3f09c7=db[_0x0d07('0x22')][_0x0d07('0x23')];_0x5da34f[_0x0d07('0x24')]=_[_0x0d07('0x25')](_[_0x0d07('0x26')](_0x3f09c7),[_0x0d07('0x20')]);var _0x4c68d7={'dateStart':_0x44a14c['query'][_0x0d07('0x27')],'dateEnd':_0x44a14c[_0x0d07('0x28')][_0x0d07('0x29')]};delete _0x44a14c[_0x0d07('0x28')][_0x0d07('0x27')];delete _0x44a14c[_0x0d07('0x28')][_0x0d07('0x29')];_0x5da34f[_0x0d07('0x28')]=_[_0x0d07('0x26')](_0x44a14c[_0x0d07('0x28')]);_0x5da34f[_0x0d07('0x2a')]=_[_0x0d07('0x2b')](_0x5da34f[_0x0d07('0x24')],_0x5da34f[_0x0d07('0x28')]);_0x483cb7[_0x0d07('0x2c')]=_[_0x0d07('0x2b')](_0x5da34f[_0x0d07('0x24')],qs[_0x0d07('0x2d')](_0x44a14c['query']['fields']));_0x483cb7['attributes']=_0x483cb7[_0x0d07('0x2c')][_0x0d07('0x2e')]?_0x483cb7['attributes']:_0x5da34f[_0x0d07('0x24')];if(!_0x44a14c[_0x0d07('0x28')][_0x0d07('0x2f')](_0x0d07('0x30'))){_0x483cb7['limit']=qs[_0x0d07('0x1c')](_0x44a14c['query'][_0x0d07('0x1c')]);_0x483cb7['offset']=qs['offset'](_0x44a14c[_0x0d07('0x28')]['offset']);}_0x483cb7['order']=qs[_0x0d07('0x31')](_0x44a14c[_0x0d07('0x28')][_0x0d07('0x31')]);_0x483cb7[_0x0d07('0x32')]=qs[_0x0d07('0x2a')](_['pick'](_0x44a14c['query'],_0x5da34f['filters']));if(_0x4c68d7[_0x0d07('0x27')]){if(_0x4c68d7[_0x0d07('0x29')]){_0x4c68d7[_0x0d07('0x29')]=moment(_0x4c68d7[_0x0d07('0x29')])[_0x0d07('0x33')](0x1,_0x0d07('0x34'));}else{_0x4c68d7[_0x0d07('0x29')]=moment(_0x4c68d7[_0x0d07('0x27')])[_0x0d07('0x33')](0x1,'day');}_['merge'](_0x483cb7[_0x0d07('0x32')],{'createdAt':{'$gte':_0x4c68d7[_0x0d07('0x27')],'$lte':_0x4c68d7[_0x0d07('0x29')]}});}if(_0x44a14c[_0x0d07('0x28')][_0x0d07('0x35')]){_0x483cb7['where']=_[_0x0d07('0x36')](_0x483cb7['where'],{'$or':_[_0x0d07('0x37')](_0x483cb7[_0x0d07('0x2c')],function(_0x3a0797){var _0x4748e6={};_0x4748e6[_0x3a0797]={'$like':'%'+_0x44a14c[_0x0d07('0x28')][_0x0d07('0x35')]+'%'};return _0x4748e6;})});}_0x483cb7=_[_0x0d07('0x36')]({},_0x483cb7,_0x44a14c['options']);var _0x318794={'where':_0x483cb7[_0x0d07('0x32')]};return db[_0x0d07('0x22')][_0x0d07('0x1a')](_0x318794)[_0x0d07('0x1e')](function(_0xd2ad26){_0x238bee[_0x0d07('0x1a')]=_0xd2ad26;if(_0x44a14c[_0x0d07('0x28')]['includeAll']){_0x483cb7[_0x0d07('0x38')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x483cb7);})[_0x0d07('0x1e')](function(_0x253a3b){_0x238bee[_0x0d07('0x39')]=_0x253a3b;return _0x238bee;})[_0x0d07('0x1e')](respondWithFilteredResult(_0x509fb9,_0x483cb7))['catch'](handleError(_0x509fb9,null));};exports['show']=function(_0x4231f8,_0x444123){var _0x1d88e4={'raw':!![],'where':{'id':_0x4231f8[_0x0d07('0x3a')]['id']}},_0x5a4a74={};_0x5a4a74['model']=_[_0x0d07('0x26')](db[_0x0d07('0x22')][_0x0d07('0x23')]);_0x5a4a74['query']=_[_0x0d07('0x26')](_0x4231f8[_0x0d07('0x28')]);_0x5a4a74['filters']=_[_0x0d07('0x2b')](_0x5a4a74[_0x0d07('0x24')],_0x5a4a74[_0x0d07('0x28')]);_0x1d88e4[_0x0d07('0x2c')]=_[_0x0d07('0x2b')](_0x5a4a74['model'],qs['fields'](_0x4231f8['query'][_0x0d07('0x2d')]));_0x1d88e4[_0x0d07('0x2c')]=_0x1d88e4['attributes']['length']?_0x1d88e4[_0x0d07('0x2c')]:_0x5a4a74[_0x0d07('0x24')];if(_0x4231f8[_0x0d07('0x28')]['includeAll']){_0x1d88e4[_0x0d07('0x38')]=[{'all':!![]}];}_0x1d88e4=_[_0x0d07('0x36')]({},_0x1d88e4,_0x4231f8[_0x0d07('0x3b')]);return db[_0x0d07('0x22')]['find'](_0x1d88e4)[_0x0d07('0x1e')](handleEntityNotFound(_0x444123,null))[_0x0d07('0x1e')](respondWithResult(_0x444123,null))[_0x0d07('0x3c')](handleError(_0x444123,null));};exports[_0x0d07('0x3d')]=function(_0xe69435,_0x15455f){if(_0xe69435[_0x0d07('0x3e')]['id']){delete _0xe69435['body']['id'];}return db[_0x0d07('0x22')][_0x0d07('0x3f')]({'where':{'id':_0xe69435[_0x0d07('0x3a')]['id']}})[_0x0d07('0x1e')](handleEntityNotFound(_0x15455f,null))[_0x0d07('0x1e')](saveUpdates(_0xe69435[_0x0d07('0x3e')],null))[_0x0d07('0x1e')](respondWithResult(_0x15455f,null))[_0x0d07('0x3c')](handleError(_0x15455f,null));};exports[_0x0d07('0x1f')]=function(_0x41f6b1,_0xafe5d0){return db[_0x0d07('0x22')]['find']({'where':{'id':_0x41f6b1[_0x0d07('0x3a')]['id']}})['then'](handleEntityNotFound(_0xafe5d0,null))['then'](removeEntity(_0xafe5d0,null))['catch'](handleError(_0xafe5d0,null));};exports['create']=function(_0x24544e,_0x38454f){var _0x5201fb;return db[_0x0d07('0x40')][_0x0d07('0x41')](function(_0x4d14b4){return db[_0x0d07('0x22')]['create'](_0x24544e[_0x0d07('0x3e')],{'transaction':_0x4d14b4})[_0x0d07('0x1e')](function(_0x1c6b45){_0x5201fb=_0x1c6b45;var _0x4d4d43={'type':db[_0x0d07('0x42')][_0x0d07('0x43')],'transaction':_0x4d14b4};switch(_0x24544e[_0x0d07('0x3e')][_0x0d07('0x44')]){case _0x0d07('0x45'):_0x4d4d43[_0x0d07('0x44')]=db['Sequelize'][_0x0d07('0x43')];break;case _0x0d07('0x46'):_0x4d4d43[_0x0d07('0x44')]=db[_0x0d07('0x42')][_0x0d07('0x47')];break;case _0x0d07('0x48'):_0x4d4d43[_0x0d07('0x44')]=db[_0x0d07('0x42')][_0x0d07('0x49')];_0x4d4d43[_0x0d07('0x4a')]=![];break;default:}return db[_0x0d07('0x40')][_0x0d07('0x4b')][_0x0d07('0x4c')](_0x0d07('0x4d'),util[_0x0d07('0x4e')](_0x0d07('0x4f'),_0x5201fb['id']),_0x4d4d43);})[_0x0d07('0x1e')](function(){return _0x5201fb;});})[_0x0d07('0x1e')](respondWithResult(_0x38454f,0xc9))[_0x0d07('0x3c')](handleError(_0x38454f,null));};
\ No newline at end of file
index f764103..2075039 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2d3=['define','cm_custom_fields','lodash','util','../../config/logger','api','request-promise','exports'];(function(_0x26536d,_0x3a8562){var _0x3b1615=function(_0x503b4b){while(--_0x503b4b){_0x26536d['push'](_0x26536d['shift']());}};_0x3b1615(++_0x3a8562);}(_0xc2d3,0x17a));var _0x3c2d=function(_0x439375,_0x4a53b4){_0x439375=_0x439375-0x0;var _0x9753d8=_0xc2d3[_0x439375];return _0x9753d8;};'use strict';var _=require(_0x3c2d('0x0'));var util=require(_0x3c2d('0x1'));var logger=require(_0x3c2d('0x2'))(_0x3c2d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3c2d('0x4'));var attributes=require('./cmCustomField.attributes');module[_0x3c2d('0x5')]=function(_0x46a214,_0x5d5cb9){return _0x46a214[_0x3c2d('0x6')]('CmCustomField',attributes,{'tableName':_0x3c2d('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xed8a=['define','CmCustomField','cm_custom_fields','lodash','util','api','moment','bluebird','./cmCustomField.attributes'];(function(_0x3ebac4,_0x49ae5c){var _0x3b43b6=function(_0x4addc2){while(--_0x4addc2){_0x3ebac4['push'](_0x3ebac4['shift']());}};_0x3b43b6(++_0x49ae5c);}(_0xed8a,0x1e9));var _0xaed8=function(_0x517226,_0x29e11a){_0x517226=_0x517226-0x0;var _0x10e2e6=_0xed8a[_0x517226];return _0x10e2e6;};'use strict';var _=require(_0xaed8('0x0'));var util=require(_0xaed8('0x1'));var logger=require('../../config/logger')(_0xaed8('0x2'));var moment=require(_0xaed8('0x3'));var BPromise=require(_0xaed8('0x4'));var rp=require('request-promise');var attributes=require(_0xaed8('0x5'));module['exports']=function(_0x1fe8bc,_0x135ca3){return _0x1fe8bc[_0xaed8('0x6')](_0xaed8('0x7'),attributes,{'tableName':_0xaed8('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 420ffdf..4288835 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2424=['../../config/environment','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x2424,0x10a));var _0x4242=function(_0x17ae12,_0x19e367){_0x17ae12=_0x17ae12-0x0;var _0x4f4d0a=_0x2424[_0x17ae12];return _0x4f4d0a;};'use strict';var _=require(_0x4242('0x0'));var util=require(_0x4242('0x1'));var moment=require('moment');var BPromise=require(_0x4242('0x2'));var rs=require(_0x4242('0x3'));var fs=require('fs');var db=require(_0x4242('0x4'))['db'];var utils=require(_0x4242('0x5'));var logger=require('../../config/logger')(_0x4242('0x6'));var config=require(_0x4242('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4242('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b251d,_0x485345,_0x2a6be8){return new BPromise(function(_0x43b970,_0x356620){return client[_0x4242('0x9')](_0x3b251d,_0x2a6be8)[_0x4242('0xa')](function(_0x467944){logger[_0x4242('0xb')](_0x4242('0xc'),_0x485345,_0x4242('0xd'));logger[_0x4242('0xe')](_0x4242('0xf'),_0x485345,_0x4242('0xd'),JSON[_0x4242('0x10')](_0x467944));if(_0x467944[_0x4242('0x11')]){if(_0x467944[_0x4242('0x11')][_0x4242('0x12')]===0x1f4){logger[_0x4242('0x11')](_0x4242('0xc'),_0x485345,_0x467944[_0x4242('0x11')]['message']);return _0x356620(_0x467944[_0x4242('0x11')][_0x4242('0x13')]);}logger[_0x4242('0x11')]('CmCustomField,\x20%s,\x20%s',_0x485345,_0x467944['error'][_0x4242('0x13')]);return _0x43b970(_0x467944[_0x4242('0x11')][_0x4242('0x13')]);}else{logger[_0x4242('0xb')]('CmCustomField,\x20%s,\x20%s',_0x485345,'request\x20sent');_0x43b970(_0x467944['result']['message']);}})[_0x4242('0x14')](function(_0x4bd396){logger[_0x4242('0x11')](_0x4242('0xc'),_0x485345,_0x4bd396);_0x356620(_0x4bd396);});});}
\ No newline at end of file
+var _0x34ec=['request\x20sent','error','code','message','catch','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','http','request','info','CmCustomField,\x20%s,\x20%s'];(function(_0x2ac033,_0x5cbc2a){var _0x43b9d3=function(_0x33c71c){while(--_0x33c71c){_0x2ac033['push'](_0x2ac033['shift']());}};_0x43b9d3(++_0x5cbc2a);}(_0x34ec,0x1f4));var _0xc34e=function(_0x4007fa,_0x3974ea){_0x4007fa=_0x4007fa-0x0;var _0x25f5c7=_0x34ec[_0x4007fa];return _0x25f5c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc34e('0x0'));var BPromise=require(_0xc34e('0x1'));var rs=require(_0xc34e('0x2'));var fs=require('fs');var db=require(_0xc34e('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc34e('0x4'));var config=require(_0xc34e('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc34e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x12f004,_0x2bca29,_0x4b3a02){return new BPromise(function(_0x3d2636,_0x8a2a50){return client[_0xc34e('0x7')](_0x12f004,_0x4b3a02)['then'](function(_0x27e57d){logger[_0xc34e('0x8')](_0xc34e('0x9'),_0x2bca29,_0xc34e('0xa'));logger['debug']('CmCustomField,\x20%s,\x20%s,\x20%s',_0x2bca29,_0xc34e('0xa'),JSON['stringify'](_0x27e57d));if(_0x27e57d[_0xc34e('0xb')]){if(_0x27e57d['error'][_0xc34e('0xc')]===0x1f4){logger[_0xc34e('0xb')](_0xc34e('0x9'),_0x2bca29,_0x27e57d[_0xc34e('0xb')][_0xc34e('0xd')]);return _0x8a2a50(_0x27e57d[_0xc34e('0xb')]['message']);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x2bca29,_0x27e57d['error']['message']);return _0x3d2636(_0x27e57d[_0xc34e('0xb')][_0xc34e('0xd')]);}else{logger[_0xc34e('0x8')]('CmCustomField,\x20%s,\x20%s',_0x2bca29,_0xc34e('0xa'));_0x3d2636(_0x27e57d['result'][_0xc34e('0xd')]);}})[_0xc34e('0xe')](function(_0x3aa53a){logger[_0xc34e('0xb')]('CmCustomField,\x20%s,\x20%s',_0x2bca29,_0x3aa53a);_0x8a2a50(_0x3aa53a);});});}
\ No newline at end of file
index 665cd37..1ff4ab9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8de3=['exports','util','path','express','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','index','/:id','show','isAuthenticated','put','delete','destroy'];(function(_0x2b3a40,_0x386ecd){var _0x2ad588=function(_0x4c5829){while(--_0x4c5829){_0x2b3a40['push'](_0x2b3a40['shift']());}};_0x2ad588(++_0x386ecd);}(_0x8de3,0x12d));var _0x38de=function(_0x39d6a8,_0xc9c91a){_0x39d6a8=_0x39d6a8-0x0;var _0x93f3db=_0x8de3[_0x39d6a8];return _0x93f3db;};'use strict';var multer=require('multer');var util=require(_0x38de('0x0'));var path=require(_0x38de('0x1'));var express=require(_0x38de('0x2'));var router=express['Router']();var auth=require(_0x38de('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x38de('0x4'));var controller=require(_0x38de('0x5'));router[_0x38de('0x6')]('/',auth['isAuthenticated'](),controller[_0x38de('0x7')]);router[_0x38de('0x6')](_0x38de('0x8'),auth['isAuthenticated'](),controller[_0x38de('0x9')]);router['post']('/',auth[_0x38de('0xa')](),controller['create']);router[_0x38de('0xb')](_0x38de('0x8'),auth[_0x38de('0xa')](),controller['update']);router[_0x38de('0xc')](_0x38de('0x8'),auth['isAuthenticated'](),controller[_0x38de('0xd')]);module[_0x38de('0xe')]=router;
\ No newline at end of file
+var _0x162f=['destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put'];(function(_0x172948,_0x4262cc){var _0x4aeaa9=function(_0x5ec4b3){while(--_0x5ec4b3){_0x172948['push'](_0x172948['shift']());}};_0x4aeaa9(++_0x4262cc);}(_0x162f,0x142));var _0xf162=function(_0x2f4711,_0x46f852){_0x2f4711=_0x2f4711-0x0;var _0x17f663=_0x162f[_0x2f4711];return _0x17f663;};'use strict';var multer=require(_0xf162('0x0'));var util=require(_0xf162('0x1'));var path=require('path');var express=require(_0xf162('0x2'));var router=express['Router']();var auth=require(_0xf162('0x3'));var interaction=require(_0xf162('0x4'));var config=require(_0xf162('0x5'));var controller=require('./cmCustomField.controller');router[_0xf162('0x6')]('/',auth['isAuthenticated'](),controller[_0xf162('0x7')]);router[_0xf162('0x6')](_0xf162('0x8'),auth[_0xf162('0x9')](),controller[_0xf162('0xa')]);router[_0xf162('0xb')]('/',auth[_0xf162('0x9')](),controller[_0xf162('0xc')]);router[_0xf162('0xd')](_0xf162('0x8'),auth[_0xf162('0x9')](),controller['update']);router['delete']('/:id',auth[_0xf162('0x9')](),controller[_0xf162('0xe')]);module[_0xf162('0xf')]=router;
\ No newline at end of file
index 49fc76c..da22c20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe69b=['DATE','contactListQueue','moment','sequelize','STRING','BOOLEAN','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x3a8b9b,_0x4b1728){var _0x1a3bba=function(_0x37a74e){while(--_0x37a74e){_0x3a8b9b['push'](_0x3a8b9b['shift']());}};_0x1a3bba(++_0x4b1728);}(_0xe69b,0xba));var _0xbe69=function(_0x37f535,_0x3a346e){_0x37f535=_0x37f535-0x0;var _0x1200cc=_0xe69b[_0x37f535];return _0x1200cc;};'use strict';var moment=require(_0xbe69('0x0'));var Sequelize=require(_0xbe69('0x1'));module['exports']={'phone':{'type':Sequelize[_0xbe69('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xbe69('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0xbe69('0x4'))},'countbusyretry':{'type':Sequelize[_0xbe69('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xbe69('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xbe69('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xbe69('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xbe69('0x6')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xbe69('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xbe69('0x5')],'unique':_0xbe69('0x7')},'ListId':{'type':Sequelize[_0xbe69('0x5')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xbe69('0x5')]},'VoiceQueueId':{'type':Sequelize[_0xbe69('0x5')],'unique':_0xbe69('0x7')},'CampaignId':{'type':Sequelize[_0xbe69('0x5')]}};
\ No newline at end of file
+var _0xde9c=['DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue','moment','STRING','BOOLEAN'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xde9c,0x66));var _0xcde9=function(_0x5f1481,_0x5b9248){_0x5f1481=_0x5f1481-0x0;var _0x441ccb=_0xde9c[_0x5f1481];return _0x441ccb;};'use strict';var moment=require(_0xcde9('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0xcde9('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0xcde9('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xcde9('0x3')],'defaultValue':moment()['format'](_0xcde9('0x4'))},'countbusyretry':{'type':Sequelize[_0xcde9('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xcde9('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xcde9('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xcde9('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xcde9('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xcde9('0x3')]},'priority':{'type':Sequelize[_0xcde9('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xcde9('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xcde9('0x6')},'ListId':{'type':Sequelize[_0xcde9('0x5')],'unique':_0xcde9('0x6')},'UserId':{'type':Sequelize[_0xcde9('0x5')]},'VoiceQueueId':{'type':Sequelize[_0xcde9('0x5')],'unique':_0xcde9('0x6')},'CampaignId':{'type':Sequelize[_0xcde9('0x5')]}};
\ No newline at end of file
index 8f1dd70..58266a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3de2=['lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','api','../../config/utils','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','CmHopper','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','pick','add','day','where','filter','merge','map','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','outbound','preview','dialOrderByScheduledAt','length','format','hopperIds','findOne','scheduledat','priority','DESC','scheduledAt','LOCK','UPDATE','CmCompany','Company','CmList','List','dialActive','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv'];(function(_0x47510,_0x1d0b2e){var _0x5d5dbe=function(_0x3e4cd5){while(--_0x3e4cd5){_0x47510['push'](_0x47510['shift']());}};_0x5d5dbe(++_0x1d0b2e);}(_0x3de2,0x153));var _0x23de=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x3de2[_0x46698a];return _0x356db0;};'use strict';var pdf=require(_0x23de('0x0'));var emlformat=require(_0x23de('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x23de('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x23de('0x3'));var moment=require(_0x23de('0x4'));var BPromise=require(_0x23de('0x5'));var Mustache=require(_0x23de('0x6'));var util=require('util');var path=require('path');var sox=require(_0x23de('0x7'));var csv=require(_0x23de('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x23de('0x9'));var squel=require(_0x23de('0xa'));var crypto=require(_0x23de('0xb'));var jsforce=require(_0x23de('0xc'));var deskjs=require(_0x23de('0xd'));var toCsv=require(_0x23de('0x8'));var querystring=require('querystring');var Papa=require(_0x23de('0xe'));var qs=require(_0x23de('0xf'));var logger=require('../../config/logger')(_0x23de('0x10'));var utils=require(_0x23de('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x543a5d,_0x359ced){_0x359ced=_0x359ced||0xcc;return function(_0x45d174){if(_0x45d174){return _0x543a5d['sendStatus'](_0x359ced);}return _0x543a5d[_0x23de('0x12')](_0x359ced)[_0x23de('0x13')]();};}function respondWithResult(_0x2525f8,_0x174bc7){_0x174bc7=_0x174bc7||0xc8;return function(_0x1f6d51){if(_0x1f6d51){return _0x2525f8[_0x23de('0x12')](_0x174bc7)['json'](_0x1f6d51);}};}function respondWithFilteredResult(_0x488803,_0x578bb7){return function(_0x1c50c4){if(_0x1c50c4){var _0x278a9c=_0x1c50c4['count'],_0x4f56c5=_0x578bb7['offset'],_0xa8e4b5=_0x578bb7[_0x23de('0x14')]+_0x578bb7[_0x23de('0x15')],_0x49a377;if(_0xa8e4b5>=_0x278a9c){_0xa8e4b5=_0x278a9c;_0x49a377=0xc8;}else{_0x49a377=0xce;}_0x488803[_0x23de('0x12')](_0x49a377);return _0x488803[_0x23de('0x16')](_0x23de('0x17'),_0x4f56c5+'-'+_0xa8e4b5+'/'+_0x278a9c)[_0x23de('0x18')](_0x1c50c4);}return null;};}function patchUpdates(_0x300aef){return function(_0x57a464){try{jsonpatch[_0x23de('0x19')](_0x57a464,_0x300aef,!![]);}catch(_0x48681e){return BPromise[_0x23de('0x1a')](_0x48681e);}return _0x57a464[_0x23de('0x1b')]();};}function saveUpdates(_0x2ad58e,_0x32b2f9){return function(_0x1fe975){if(_0x1fe975){return _0x1fe975[_0x23de('0x1c')](_0x2ad58e)[_0x23de('0x1d')](function(_0x54c6cf){return _0x54c6cf;});}return null;};}function removeEntity(_0x442a1a,_0x492532){return function(_0x8f1d9e){if(_0x8f1d9e){return _0x8f1d9e[_0x23de('0x1e')]()[_0x23de('0x1d')](function(){_0x442a1a[_0x23de('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfead54,_0x2ec0f4){return function(_0x57b225){if(!_0x57b225){_0xfead54['sendStatus'](0x194);}return _0x57b225;};}function handleError(_0x2f6a78,_0x2f1784){_0x2f1784=_0x2f1784||0x1f4;return function(_0x4d1170){logger['error'](_0x4d1170[_0x23de('0x1f')]);if(_0x4d1170[_0x23de('0x20')]){delete _0x4d1170['name'];}_0x2f6a78[_0x23de('0x12')](_0x2f1784)[_0x23de('0x21')](_0x4d1170);};}exports[_0x23de('0x22')]=function(_0x560b86,_0x547110){var _0x11c6ad={},_0x4a61c6={},_0x19a6f7={'count':0x0,'rows':[]};var _0x5e14cb=db[_0x23de('0x23')][_0x23de('0x24')];_0x4a61c6['model']=_[_0x23de('0x25')](_0x5e14cb);var _0x289081={'dateStart':_0x560b86[_0x23de('0x26')][_0x23de('0x27')],'dateEnd':_0x560b86[_0x23de('0x26')][_0x23de('0x28')]};delete _0x560b86[_0x23de('0x26')][_0x23de('0x27')];delete _0x560b86[_0x23de('0x26')][_0x23de('0x28')];_0x4a61c6[_0x23de('0x26')]=_['keys'](_0x560b86['query']);_0x4a61c6[_0x23de('0x29')]=_[_0x23de('0x2a')](_0x4a61c6['model'],_0x4a61c6['query']);_0x11c6ad[_0x23de('0x2b')]=_['intersection'](_0x4a61c6[_0x23de('0x2c')],qs[_0x23de('0x2d')](_0x560b86[_0x23de('0x26')]['fields']));_0x11c6ad['attributes']=_0x11c6ad[_0x23de('0x2b')]['length']?_0x11c6ad[_0x23de('0x2b')]:_0x4a61c6[_0x23de('0x2c')];if(!_0x560b86['query'][_0x23de('0x2e')]('nolimit')){_0x11c6ad[_0x23de('0x15')]=qs[_0x23de('0x15')](_0x560b86['query'][_0x23de('0x15')]);_0x11c6ad[_0x23de('0x14')]=qs[_0x23de('0x14')](_0x560b86[_0x23de('0x26')][_0x23de('0x14')]);}_0x11c6ad[_0x23de('0x2f')]=qs[_0x23de('0x30')](_0x560b86[_0x23de('0x26')]['sort']);_0x11c6ad['where']=qs['filters'](_[_0x23de('0x31')](_0x560b86['query'],_0x4a61c6[_0x23de('0x29')]));if(_0x289081[_0x23de('0x27')]){if(_0x289081[_0x23de('0x28')]){_0x289081[_0x23de('0x28')]=moment(_0x289081[_0x23de('0x28')])[_0x23de('0x32')](0x1,_0x23de('0x33'));}else{_0x289081['dateEnd']=moment(_0x289081[_0x23de('0x27')])[_0x23de('0x32')](0x1,_0x23de('0x33'));}_['merge'](_0x11c6ad[_0x23de('0x34')],{'createdAt':{'$gte':_0x289081[_0x23de('0x27')],'$lte':_0x289081[_0x23de('0x28')]}});}if(_0x560b86[_0x23de('0x26')][_0x23de('0x35')]){_0x11c6ad['where']=_[_0x23de('0x36')](_0x11c6ad[_0x23de('0x34')],{'$or':_[_0x23de('0x37')](_0x11c6ad[_0x23de('0x2b')],function(_0x26fe70){var _0x6911f3={};_0x6911f3[_0x26fe70]={'$like':'%'+_0x560b86[_0x23de('0x26')][_0x23de('0x35')]+'%'};return _0x6911f3;})});}_0x11c6ad=_[_0x23de('0x36')]({},_0x11c6ad,_0x560b86['options']);var _0x14b110={'where':_0x11c6ad[_0x23de('0x34')]};return db[_0x23de('0x23')]['count'](_0x14b110)[_0x23de('0x1d')](function(_0x156031){_0x19a6f7[_0x23de('0x38')]=_0x156031;if(_0x560b86['query'][_0x23de('0x39')]){_0x11c6ad['include']=[{'all':!![]}];}return db[_0x23de('0x23')][_0x23de('0x3a')](_0x11c6ad);})[_0x23de('0x1d')](function(_0x172f30){_0x19a6f7[_0x23de('0x3b')]=_0x172f30;return _0x19a6f7;})[_0x23de('0x1d')](respondWithFilteredResult(_0x547110,_0x11c6ad))[_0x23de('0x3c')](handleError(_0x547110,null));};exports[_0x23de('0x3d')]=function(_0x45d933,_0x15e64f){var _0x4a39fd={'raw':!![],'where':{'id':_0x45d933['params']['id']}},_0x135467={};_0x135467['model']=_['keys'](db[_0x23de('0x23')]['rawAttributes']);_0x135467['query']=_[_0x23de('0x25')](_0x45d933[_0x23de('0x26')]);_0x135467['filters']=_['intersection'](_0x135467[_0x23de('0x2c')],_0x135467[_0x23de('0x26')]);_0x4a39fd[_0x23de('0x2b')]=_[_0x23de('0x2a')](_0x135467['model'],qs[_0x23de('0x2d')](_0x45d933[_0x23de('0x26')][_0x23de('0x2d')]));_0x4a39fd['attributes']=_0x4a39fd['attributes']['length']?_0x4a39fd['attributes']:_0x135467[_0x23de('0x2c')];if(_0x45d933[_0x23de('0x26')]['includeAll']){_0x4a39fd[_0x23de('0x3e')]=[{'all':!![]}];}_0x4a39fd=_['merge']({},_0x4a39fd,_0x45d933['options']);return db[_0x23de('0x23')][_0x23de('0x3f')](_0x4a39fd)[_0x23de('0x1d')](handleEntityNotFound(_0x15e64f,null))[_0x23de('0x1d')](respondWithResult(_0x15e64f,null))[_0x23de('0x3c')](handleError(_0x15e64f,null));};exports[_0x23de('0x40')]=function(_0x1fd870,_0x3c1d4b){return db[_0x23de('0x23')][_0x23de('0x40')](_0x1fd870[_0x23de('0x41')],{})[_0x23de('0x1d')](respondWithResult(_0x3c1d4b,0xc9))[_0x23de('0x3c')](handleError(_0x3c1d4b,null));};exports['update']=function(_0x15ff92,_0x177f6e){if(_0x15ff92[_0x23de('0x41')]['id']){delete _0x15ff92[_0x23de('0x41')]['id'];}return db[_0x23de('0x23')][_0x23de('0x3f')]({'where':{'id':_0x15ff92[_0x23de('0x42')]['id']}})[_0x23de('0x1d')](handleEntityNotFound(_0x177f6e,null))['then'](saveUpdates(_0x15ff92[_0x23de('0x41')],null))[_0x23de('0x1d')](respondWithResult(_0x177f6e,null))['catch'](handleError(_0x177f6e,null));};exports[_0x23de('0x43')]=function(_0x572e6e,_0x1c3659){return db[_0x23de('0x23')]['describe']()[_0x23de('0x1d')](respondWithResult(_0x1c3659,null))[_0x23de('0x3c')](handleError(_0x1c3659,null));};exports['destroy']=function(_0x11a08c,_0x3c4fd2){var _0x32705a;return db[_0x23de('0x23')][_0x23de('0x3f')]({'where':{'id':_0x11a08c[_0x23de('0x42')]['id']}})[_0x23de('0x1d')](handleEntityNotFound(_0x3c4fd2,null))[_0x23de('0x1d')](function(_0x2588c8){if(_0x2588c8){return _0x2588c8[_0x23de('0x1e')]()[_0x23de('0x1d')](function(_0x36848e){return _0x36848e;});}})[_0x23de('0x1d')](function(_0x1e7276){_0x32705a=_0x1e7276;if(_0x1e7276){if(_0x1e7276[_0x23de('0x44')]||_0x1e7276[_0x23de('0x45')]){return db[_0x1e7276[_0x23de('0x44')]?_0x23de('0x46'):_0x23de('0x47')][_0x23de('0x3f')]({'where':{'id':_0x1e7276[_0x23de('0x44')]?_0x1e7276['VoiceQueueId']:_0x1e7276[_0x23de('0x45')]},'attributes':['id',_0x23de('0x20')],'raw':!![]});}}})['then'](function(_0xdc9661){var _0x256385={};if(_0xdc9661){_[_0x23de('0x36')](_0x256385,_[_0x23de('0x48')](_0x32705a[_0x23de('0x49')],[_0x23de('0x4a'),_0x23de('0x4b'),'id']));_0x256385[_0x23de('0x4c')]=0x15;_0x256385[_0x23de('0x4d')]=_0x23de('0x4e');_0x256385['campaign']=_0xdc9661['name'];_0x256385['membername']=_0x11a08c[_0x23de('0x4f')][_0x23de('0x20')];_0x256385[_0x23de('0x50')]=_0x11a08c[_0x23de('0x4f')]['id'];_0x256385[_0x23de('0x4e')]=!![];_0x256385[_0x23de('0x51')]=moment()['format'](_0x23de('0x52'));_0x256385[_0x23de('0x53')]=_0x32705a[_0x23de('0x54')];_0x256385[_0x23de('0x55')]=_0x32705a[_0x23de('0x44')]?_0x23de('0x56'):_0x23de('0x57');return db[_0x23de('0x58')][_0x23de('0x3f')]({'where':{'id':_0x256385['ContactId']},'attributes':[_0x23de('0x59'),_0x23de('0x5a')]})[_0x23de('0x1d')](function(_0x247886){if(!_[_0x23de('0x5b')](_0x3c4fd2)&&!_[_0x23de('0x5b')](_0x247886[_0x23de('0x59')])){_0x256385[_0x23de('0x5c')]=_0x247886[_0x23de('0x59')];if(!_['isNil'](_0x247886[_0x23de('0x5a')])){_0x256385[_0x23de('0x5c')]+='\x20'+_0x247886['lastName'];}}})[_0x23de('0x5d')](function(){return db[_0x23de('0x5e')][_0x23de('0x40')](_0x256385);});}})[_0x23de('0x1d')](function(){return _0x3c4fd2['status'](0xcc)[_0x23de('0x13')]();})[_0x23de('0x3c')](handleError(_0x3c4fd2,null));};exports['getPreview']=function(_0x5669e9,_0x1f2acc,_0x1c3d04){var _0x1efc6b=[];return db[_0x23de('0x58')][_0x23de('0x43')]()[_0x23de('0x1d')](function(_0x5a1f74){_0x1efc6b=_[_0x23de('0x25')](_0x5a1f74);return _0x5669e9[_0x23de('0x4f')]['getVoiceQueues']({'where':{'type':_0x23de('0x5f'),'dialActive':!![],'dialMethod':_0x23de('0x60')},'attributes':['id',_0x23de('0x61')],'raw':!![]});})[_0x23de('0x1d')](function(_0x433722){if(_0x433722&&_0x433722[_0x23de('0x62')]){return db['sequelize']['transaction'](function(_0x543bcf){var _0x51c4b8={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x23de('0x63')](_0x23de('0x52'))},'VoiceQueueId':{'$in':_[_0x23de('0x37')](_0x433722,'id')},'$or':[{'UserId':null},{'UserId':_0x5669e9['user']['id']}]};if(!_['isEmpty'](_0x5669e9[_0x23de('0x41')][_0x23de('0x64')])){var _0x495ca4={'$notIn':_0x5669e9[_0x23de('0x41')][_0x23de('0x64')]};_0x51c4b8['id']=_0x495ca4;}return db['CmHopper'][_0x23de('0x65')]({'attributes':['id',_0x23de('0x66')],'where':_0x51c4b8,'order':[[_0x23de('0x67'),_0x23de('0x68')],[_0x23de('0x69'),_0x433722[0x0][_0x23de('0x61')]],['UserId',_0x23de('0x68')],['id','ASC']],'transaction':_0x543bcf,'lock':_0x543bcf[_0x23de('0x6a')][_0x23de('0x6b')],'include':[{'model':db[_0x23de('0x58')],'as':'Contact','attributes':_0x1efc6b,'include':[{'model':db[_0x23de('0x6c')],'as':_0x23de('0x6d'),'attributes':['id',_0x23de('0x20')]}]},{'model':db[_0x23de('0x6e')],'as':_0x23de('0x6f'),'attributes':['id',_0x23de('0x20')]},{'model':db[_0x23de('0x46')],'as':'Queue','attributes':['id',_0x23de('0x20'),_0x23de('0x70')]}]})[_0x23de('0x1d')](function(_0x2fab4d){if(_0x2fab4d){return _0x2fab4d[_0x23de('0x1c')]({'UserId':_0x5669e9['user']['id']},{'transaction':_0x543bcf});}});});}})['then'](handleEntityNotFound(_0x1f2acc,null))[_0x23de('0x1d')](respondWithResult(_0x1f2acc,null))[_0x23de('0x3c')](handleError(_0x1f2acc,null));};exports[_0x23de('0x71')]=function(_0x45b549,_0x5b2d27,_0x28e192){return _0x45b549[_0x23de('0x4f')]['getVoiceQueues']({'where':{'type':_0x23de('0x5f'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x23de('0x1d')](function(_0x1f7e89){if(_0x1f7e89&&_0x1f7e89['length']){return db[_0x23de('0x23')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x23de('0x37')](_0x1f7e89,'id')},'$or':[{'UserId':null},{'UserId':_0x45b549[_0x23de('0x4f')]['id']}]}});}return 0x0;})[_0x23de('0x1d')](function(_0x5c1361){if(!_[_0x23de('0x5b')](_0x5c1361)&&_['isNumber'](_0x5c1361)){return _0x5b2d27[_0x23de('0x12')](0xc8)[_0x23de('0x18')]({'contacts':_0x5c1361});}else{logger['error'](_0x23de('0x72'),_0x23de('0x71'),0x194,_0x23de('0x73'));_0x5b2d27['sendStatus'](0x194);}})[_0x23de('0x3c')](handleError(_0x5b2d27,null));};
\ No newline at end of file
+var _0x62fa=['model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','add','day','merge','filter','map','options','includeAll','include','findAll','show','length','create','body','catch','update','find','params','describe','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','createdAt','state','deleted','campaign','membername','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','transaction','isEmpty','hopperIds','findOne','DESC','scheduledAt','ASC','UPDATE','Contact','CmCompany','Company','CmList','List','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','save','then','destroy','sendStatus','error','stack','name','index','CmHopper','rawAttributes'];(function(_0xa32d2c,_0x276dad){var _0x4aa98a=function(_0x36ed27){while(--_0x36ed27){_0xa32d2c['push'](_0xa32d2c['shift']());}};_0x4aa98a(++_0x276dad);}(_0x62fa,0xc8));var _0xa62f=function(_0x511ee8,_0x1934be){_0x511ee8=_0x511ee8-0x0;var _0x4386d6=_0x62fa[_0x511ee8];return _0x4386d6;};'use strict';var pdf=require(_0xa62f('0x0'));var emlformat=require(_0xa62f('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa62f('0x2'));var rp=require(_0xa62f('0x3'));var moment=require(_0xa62f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa62f('0x5'));var util=require(_0xa62f('0x6'));var path=require(_0xa62f('0x7'));var sox=require(_0xa62f('0x8'));var csv=require(_0xa62f('0x9'));var ejs=require(_0xa62f('0xa'));var fs=require('fs');var _=require(_0xa62f('0xb'));var squel=require(_0xa62f('0xc'));var crypto=require(_0xa62f('0xd'));var jsforce=require(_0xa62f('0xe'));var deskjs=require(_0xa62f('0xf'));var toCsv=require(_0xa62f('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var qs=require('../../components/parsers/qs');var logger=require(_0xa62f('0x10'))(_0xa62f('0x11'));var utils=require(_0xa62f('0x12'));var config=require(_0xa62f('0x13'));var db=require(_0xa62f('0x14'))['db'];function respondWithStatusCode(_0x378325,_0xc36bce){_0xc36bce=_0xc36bce||0xcc;return function(_0x2eb67b){if(_0x2eb67b){return _0x378325['sendStatus'](_0xc36bce);}return _0x378325[_0xa62f('0x15')](_0xc36bce)[_0xa62f('0x16')]();};}function respondWithResult(_0x145fa0,_0x35e11e){_0x35e11e=_0x35e11e||0xc8;return function(_0x3be172){if(_0x3be172){return _0x145fa0[_0xa62f('0x15')](_0x35e11e)[_0xa62f('0x17')](_0x3be172);}};}function respondWithFilteredResult(_0x24a766,_0x5ae5e1){return function(_0x5d7de9){if(_0x5d7de9){var _0x3453bf=_0x5d7de9[_0xa62f('0x18')],_0x4bb1a1=_0x5ae5e1[_0xa62f('0x19')],_0x574962=_0x5ae5e1[_0xa62f('0x19')]+_0x5ae5e1[_0xa62f('0x1a')],_0x547be9;if(_0x574962>=_0x3453bf){_0x574962=_0x3453bf;_0x547be9=0xc8;}else{_0x547be9=0xce;}_0x24a766[_0xa62f('0x15')](_0x547be9);return _0x24a766[_0xa62f('0x1b')]('Content-Range',_0x4bb1a1+'-'+_0x574962+'/'+_0x3453bf)[_0xa62f('0x17')](_0x5d7de9);}return null;};}function patchUpdates(_0x5d4469){return function(_0x1a49bb){try{jsonpatch['apply'](_0x1a49bb,_0x5d4469,!![]);}catch(_0x41e19e){return BPromise['reject'](_0x41e19e);}return _0x1a49bb[_0xa62f('0x1c')]();};}function saveUpdates(_0x31d56e,_0x29b230){return function(_0x26368d){if(_0x26368d){return _0x26368d['update'](_0x31d56e)[_0xa62f('0x1d')](function(_0x485b62){return _0x485b62;});}return null;};}function removeEntity(_0x3973ec,_0x29b7b6){return function(_0xdacc37){if(_0xdacc37){return _0xdacc37[_0xa62f('0x1e')]()[_0xa62f('0x1d')](function(){_0x3973ec[_0xa62f('0x15')](0xcc)[_0xa62f('0x16')]();});}};}function handleEntityNotFound(_0x407716,_0xccd24a){return function(_0xbab2a5){if(!_0xbab2a5){_0x407716[_0xa62f('0x1f')](0x194);}return _0xbab2a5;};}function handleError(_0x17e5ae,_0x1b335a){_0x1b335a=_0x1b335a||0x1f4;return function(_0x59cb63){logger[_0xa62f('0x20')](_0x59cb63[_0xa62f('0x21')]);if(_0x59cb63['name']){delete _0x59cb63[_0xa62f('0x22')];}_0x17e5ae['status'](_0x1b335a)['send'](_0x59cb63);};}exports[_0xa62f('0x23')]=function(_0x4bec18,_0x5b0a5d){var _0x4a8991={},_0x27ed55={},_0x547ac4={'count':0x0,'rows':[]};var _0x2da17d=db[_0xa62f('0x24')][_0xa62f('0x25')];_0x27ed55[_0xa62f('0x26')]=_[_0xa62f('0x27')](_0x2da17d);var _0xaa080e={'dateStart':_0x4bec18[_0xa62f('0x28')][_0xa62f('0x29')],'dateEnd':_0x4bec18[_0xa62f('0x28')][_0xa62f('0x2a')]};delete _0x4bec18[_0xa62f('0x28')][_0xa62f('0x29')];delete _0x4bec18[_0xa62f('0x28')][_0xa62f('0x2a')];_0x27ed55[_0xa62f('0x28')]=_[_0xa62f('0x27')](_0x4bec18[_0xa62f('0x28')]);_0x27ed55[_0xa62f('0x2b')]=_[_0xa62f('0x2c')](_0x27ed55[_0xa62f('0x26')],_0x27ed55[_0xa62f('0x28')]);_0x4a8991[_0xa62f('0x2d')]=_[_0xa62f('0x2c')](_0x27ed55[_0xa62f('0x26')],qs['fields'](_0x4bec18[_0xa62f('0x28')][_0xa62f('0x2e')]));_0x4a8991[_0xa62f('0x2d')]=_0x4a8991[_0xa62f('0x2d')]['length']?_0x4a8991[_0xa62f('0x2d')]:_0x27ed55[_0xa62f('0x26')];if(!_0x4bec18['query']['hasOwnProperty'](_0xa62f('0x2f'))){_0x4a8991[_0xa62f('0x1a')]=qs[_0xa62f('0x1a')](_0x4bec18[_0xa62f('0x28')][_0xa62f('0x1a')]);_0x4a8991[_0xa62f('0x19')]=qs['offset'](_0x4bec18[_0xa62f('0x28')][_0xa62f('0x19')]);}_0x4a8991[_0xa62f('0x30')]=qs[_0xa62f('0x31')](_0x4bec18[_0xa62f('0x28')][_0xa62f('0x31')]);_0x4a8991[_0xa62f('0x32')]=qs['filters'](_[_0xa62f('0x33')](_0x4bec18[_0xa62f('0x28')],_0x27ed55[_0xa62f('0x2b')]));if(_0xaa080e[_0xa62f('0x29')]){if(_0xaa080e['dateEnd']){_0xaa080e[_0xa62f('0x2a')]=moment(_0xaa080e[_0xa62f('0x2a')])[_0xa62f('0x34')](0x1,_0xa62f('0x35'));}else{_0xaa080e[_0xa62f('0x2a')]=moment(_0xaa080e['dateStart'])[_0xa62f('0x34')](0x1,_0xa62f('0x35'));}_[_0xa62f('0x36')](_0x4a8991['where'],{'createdAt':{'$gte':_0xaa080e[_0xa62f('0x29')],'$lte':_0xaa080e['dateEnd']}});}if(_0x4bec18[_0xa62f('0x28')][_0xa62f('0x37')]){_0x4a8991[_0xa62f('0x32')]=_[_0xa62f('0x36')](_0x4a8991[_0xa62f('0x32')],{'$or':_[_0xa62f('0x38')](_0x4a8991['attributes'],function(_0x49f79a){var _0x54fbfc={};_0x54fbfc[_0x49f79a]={'$like':'%'+_0x4bec18[_0xa62f('0x28')]['filter']+'%'};return _0x54fbfc;})});}_0x4a8991=_['merge']({},_0x4a8991,_0x4bec18[_0xa62f('0x39')]);var _0x41756={'where':_0x4a8991[_0xa62f('0x32')]};return db[_0xa62f('0x24')][_0xa62f('0x18')](_0x41756)[_0xa62f('0x1d')](function(_0x2f220a){_0x547ac4[_0xa62f('0x18')]=_0x2f220a;if(_0x4bec18[_0xa62f('0x28')][_0xa62f('0x3a')]){_0x4a8991[_0xa62f('0x3b')]=[{'all':!![]}];}return db[_0xa62f('0x24')][_0xa62f('0x3c')](_0x4a8991);})['then'](function(_0x36420b){_0x547ac4['rows']=_0x36420b;return _0x547ac4;})[_0xa62f('0x1d')](respondWithFilteredResult(_0x5b0a5d,_0x4a8991))['catch'](handleError(_0x5b0a5d,null));};exports[_0xa62f('0x3d')]=function(_0x531046,_0x1b04cf){var _0x3e7499={'raw':!![],'where':{'id':_0x531046['params']['id']}},_0x651241={};_0x651241[_0xa62f('0x26')]=_['keys'](db[_0xa62f('0x24')]['rawAttributes']);_0x651241[_0xa62f('0x28')]=_['keys'](_0x531046[_0xa62f('0x28')]);_0x651241[_0xa62f('0x2b')]=_[_0xa62f('0x2c')](_0x651241[_0xa62f('0x26')],_0x651241[_0xa62f('0x28')]);_0x3e7499['attributes']=_[_0xa62f('0x2c')](_0x651241[_0xa62f('0x26')],qs[_0xa62f('0x2e')](_0x531046[_0xa62f('0x28')][_0xa62f('0x2e')]));_0x3e7499[_0xa62f('0x2d')]=_0x3e7499[_0xa62f('0x2d')][_0xa62f('0x3e')]?_0x3e7499[_0xa62f('0x2d')]:_0x651241['model'];if(_0x531046[_0xa62f('0x28')]['includeAll']){_0x3e7499[_0xa62f('0x3b')]=[{'all':!![]}];}_0x3e7499=_['merge']({},_0x3e7499,_0x531046[_0xa62f('0x39')]);return db[_0xa62f('0x24')]['find'](_0x3e7499)['then'](handleEntityNotFound(_0x1b04cf,null))[_0xa62f('0x1d')](respondWithResult(_0x1b04cf,null))['catch'](handleError(_0x1b04cf,null));};exports[_0xa62f('0x3f')]=function(_0x13681e,_0x450076){return db[_0xa62f('0x24')]['create'](_0x13681e[_0xa62f('0x40')],{})[_0xa62f('0x1d')](respondWithResult(_0x450076,0xc9))[_0xa62f('0x41')](handleError(_0x450076,null));};exports[_0xa62f('0x42')]=function(_0x20227c,_0x250fa3){if(_0x20227c[_0xa62f('0x40')]['id']){delete _0x20227c[_0xa62f('0x40')]['id'];}return db['CmHopper'][_0xa62f('0x43')]({'where':{'id':_0x20227c[_0xa62f('0x44')]['id']}})[_0xa62f('0x1d')](handleEntityNotFound(_0x250fa3,null))[_0xa62f('0x1d')](saveUpdates(_0x20227c[_0xa62f('0x40')],null))['then'](respondWithResult(_0x250fa3,null))['catch'](handleError(_0x250fa3,null));};exports[_0xa62f('0x45')]=function(_0x86476e,_0x57bfd8){return db[_0xa62f('0x24')]['describe']()[_0xa62f('0x1d')](respondWithResult(_0x57bfd8,null))[_0xa62f('0x41')](handleError(_0x57bfd8,null));};exports[_0xa62f('0x1e')]=function(_0x1a8de5,_0x3266f1){var _0x3a43b5;return db[_0xa62f('0x24')][_0xa62f('0x43')]({'where':{'id':_0x1a8de5[_0xa62f('0x44')]['id']}})[_0xa62f('0x1d')](handleEntityNotFound(_0x3266f1,null))[_0xa62f('0x1d')](function(_0x38e242){if(_0x38e242){return _0x38e242[_0xa62f('0x1e')]()[_0xa62f('0x1d')](function(_0x3a6735){return _0x3a6735;});}})[_0xa62f('0x1d')](function(_0x4c08dc){_0x3a43b5=_0x4c08dc;if(_0x4c08dc){if(_0x4c08dc['VoiceQueueId']||_0x4c08dc['CampaignId']){return db[_0x4c08dc[_0xa62f('0x46')]?_0xa62f('0x47'):_0xa62f('0x48')][_0xa62f('0x43')]({'where':{'id':_0x4c08dc[_0xa62f('0x46')]?_0x4c08dc[_0xa62f('0x46')]:_0x4c08dc[_0xa62f('0x49')]},'attributes':['id',_0xa62f('0x22')],'raw':!![]});}}})['then'](function(_0x55c0eb){var _0x6e796d={};if(_0x55c0eb){_[_0xa62f('0x36')](_0x6e796d,_[_0xa62f('0x4a')](_0x3a43b5[_0xa62f('0x4b')],[_0xa62f('0x4c'),'updatedAt','id']));_0x6e796d[_0xa62f('0x4d')]=0x15;_0x6e796d['statedesc']=_0xa62f('0x4e');_0x6e796d[_0xa62f('0x4f')]=_0x55c0eb[_0xa62f('0x22')];_0x6e796d[_0xa62f('0x50')]=_0x1a8de5[_0xa62f('0x51')][_0xa62f('0x22')];_0x6e796d[_0xa62f('0x52')]=_0x1a8de5['user']['id'];_0x6e796d[_0xa62f('0x4e')]=!![];_0x6e796d[_0xa62f('0x53')]=moment()['format'](_0xa62f('0x54'));_0x6e796d[_0xa62f('0x55')]=_0x3a43b5[_0xa62f('0x56')];_0x6e796d[_0xa62f('0x57')]=_0x3a43b5[_0xa62f('0x46')]?_0xa62f('0x58'):_0xa62f('0x59');return db[_0xa62f('0x5a')][_0xa62f('0x43')]({'where':{'id':_0x6e796d[_0xa62f('0x5b')]},'attributes':['firstName',_0xa62f('0x5c')]})['then'](function(_0x5d31dd){if(!_[_0xa62f('0x5d')](_0x3266f1)&&!_[_0xa62f('0x5d')](_0x5d31dd[_0xa62f('0x5e')])){_0x6e796d['calleridname']=_0x5d31dd['firstName'];if(!_[_0xa62f('0x5d')](_0x5d31dd['lastName'])){_0x6e796d[_0xa62f('0x5f')]+='\x20'+_0x5d31dd[_0xa62f('0x5c')];}}})[_0xa62f('0x60')](function(){return db[_0xa62f('0x61')][_0xa62f('0x3f')](_0x6e796d);});}})[_0xa62f('0x1d')](function(){return _0x3266f1[_0xa62f('0x15')](0xcc)[_0xa62f('0x16')]();})[_0xa62f('0x41')](handleError(_0x3266f1,null));};exports['getPreview']=function(_0x183ec5,_0x26908f,_0xeb6d5b){var _0x2304ff=[];return db[_0xa62f('0x5a')][_0xa62f('0x45')]()[_0xa62f('0x1d')](function(_0x11816b){_0x2304ff=_[_0xa62f('0x27')](_0x11816b);return _0x183ec5[_0xa62f('0x51')][_0xa62f('0x62')]({'where':{'type':_0xa62f('0x63'),'dialActive':!![],'dialMethod':_0xa62f('0x64')},'attributes':['id',_0xa62f('0x65')],'raw':!![]});})[_0xa62f('0x1d')](function(_0x162331){if(_0x162331&&_0x162331[_0xa62f('0x3e')]){return db['sequelize'][_0xa62f('0x66')](function(_0x24fb89){var _0x1a3761={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xa62f('0x54'))},'VoiceQueueId':{'$in':_[_0xa62f('0x38')](_0x162331,'id')},'$or':[{'UserId':null},{'UserId':_0x183ec5[_0xa62f('0x51')]['id']}]};if(!_[_0xa62f('0x67')](_0x183ec5[_0xa62f('0x40')][_0xa62f('0x68')])){var _0x376aa5={'$notIn':_0x183ec5[_0xa62f('0x40')][_0xa62f('0x68')]};_0x1a3761['id']=_0x376aa5;}return db[_0xa62f('0x24')][_0xa62f('0x69')]({'attributes':['id','scheduledat'],'where':_0x1a3761,'order':[['priority',_0xa62f('0x6a')],[_0xa62f('0x6b'),_0x162331[0x0][_0xa62f('0x65')]],[_0xa62f('0x52'),_0xa62f('0x6a')],['id',_0xa62f('0x6c')]],'transaction':_0x24fb89,'lock':_0x24fb89['LOCK'][_0xa62f('0x6d')],'include':[{'model':db['CmContact'],'as':_0xa62f('0x6e'),'attributes':_0x2304ff,'include':[{'model':db[_0xa62f('0x6f')],'as':_0xa62f('0x70'),'attributes':['id','name']}]},{'model':db[_0xa62f('0x71')],'as':_0xa62f('0x72'),'attributes':['id','name']},{'model':db[_0xa62f('0x47')],'as':'Queue','attributes':['id',_0xa62f('0x22'),'dialActive']}]})[_0xa62f('0x1d')](function(_0x327614){if(_0x327614){return _0x327614[_0xa62f('0x42')]({'UserId':_0x183ec5['user']['id']},{'transaction':_0x24fb89});}});});}})[_0xa62f('0x1d')](handleEntityNotFound(_0x26908f,null))[_0xa62f('0x1d')](respondWithResult(_0x26908f,null))[_0xa62f('0x41')](handleError(_0x26908f,null));};exports['getOpenContacts']=function(_0xfbc853,_0x19e8de,_0x5d01ac){return _0xfbc853[_0xa62f('0x51')][_0xa62f('0x62')]({'where':{'type':_0xa62f('0x63'),'dialActive':!![],'dialMethod':_0xa62f('0x64')},'attributes':['id'],'raw':!![]})['then'](function(_0xca1998){if(_0xca1998&&_0xca1998[_0xa62f('0x3e')]){return db[_0xa62f('0x24')][_0xa62f('0x18')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xa62f('0x54'))},'VoiceQueueId':{'$in':_[_0xa62f('0x38')](_0xca1998,'id')},'$or':[{'UserId':null},{'UserId':_0xfbc853[_0xa62f('0x51')]['id']}]}});}return 0x0;})[_0xa62f('0x1d')](function(_0x49ee93){if(!_['isNil'](_0x49ee93)&&_[_0xa62f('0x73')](_0x49ee93)){return _0x19e8de[_0xa62f('0x15')](0xc8)[_0xa62f('0x17')]({'contacts':_0x49ee93});}else{logger[_0xa62f('0x20')](_0xa62f('0x74'),_0xa62f('0x75'),0x194,_0xa62f('0x76'));_0x19e8de[_0xa62f('0x1f')](0x194);}})['catch'](handleError(_0x19e8de,null));};
\ No newline at end of file
index edec282..64963a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75e5=['moment','bluebird','./cmHopper.attributes','exports','define','cm_hopper','scheduledat','priority','lodash','../../config/logger','api'];(function(_0x2effbc,_0x422b73){var _0x2e0a87=function(_0x445a1f){while(--_0x445a1f){_0x2effbc['push'](_0x2effbc['shift']());}};_0x2e0a87(++_0x422b73);}(_0x75e5,0xef));var _0x575e=function(_0x3cbe1c,_0x4bcabd){_0x3cbe1c=_0x3cbe1c-0x0;var _0x5ee08b=_0x75e5[_0x3cbe1c];return _0x5ee08b;};'use strict';var _=require(_0x575e('0x0'));var util=require('util');var logger=require(_0x575e('0x1'))(_0x575e('0x2'));var moment=require(_0x575e('0x3'));var BPromise=require(_0x575e('0x4'));var rp=require('request-promise');var attributes=require(_0x575e('0x5'));module[_0x575e('0x6')]=function(_0x248167,_0x18e9a7){return _0x248167[_0x575e('0x7')]('CmHopper',attributes,{'tableName':_0x575e('0x8'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x575e('0x9')]},{'name':'phone','fields':['phone']},{'name':_0x575e('0xa'),'fields':[_0x575e('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4b7e=['phone','priority','lodash','util','../../config/logger','moment','bluebird','request-promise','./cmHopper.attributes','exports','define','CmHopper','cm_hopper'];(function(_0x26aedb,_0x355ecd){var _0x47776d=function(_0x3b921f){while(--_0x3b921f){_0x26aedb['push'](_0x26aedb['shift']());}};_0x47776d(++_0x355ecd);}(_0x4b7e,0x120));var _0xe4b7=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x4b7e[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xe4b7('0x0'));var util=require(_0xe4b7('0x1'));var logger=require(_0xe4b7('0x2'))('api');var moment=require(_0xe4b7('0x3'));var BPromise=require(_0xe4b7('0x4'));var rp=require(_0xe4b7('0x5'));var attributes=require(_0xe4b7('0x6'));module[_0xe4b7('0x7')]=function(_0x424cdb,_0xd2fb40){return _0x424cdb[_0xe4b7('0x8')](_0xe4b7('0x9'),attributes,{'tableName':_0xe4b7('0xa'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':['scheduledat']},{'name':_0xe4b7('0xb'),'fields':['phone']},{'name':_0xe4b7('0xc'),'fields':['priority']}],'timestamps':!![]});};
\ No newline at end of file
index ed7f509..19de533 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24e3=['UpdateCmHopper','limit','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','transaction','UPDATE','Contact','keys','length','update','all','MoveContactManagedDialer','sequelize','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','UserId','LOCK','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetCmHopper','CmHopper','findAll','options','where','attributes','include','model','map','stringify','ShowCmHopper','find','raw','CreateCmHopper','create','body'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x24e3,0x1d4));var _0x324e=function(_0x210451,_0x1c9949){_0x210451=_0x210451-0x0;var _0xbccbe0=_0x24e3[_0x210451];return _0xbccbe0;};'use strict';var _=require(_0x324e('0x0'));var util=require(_0x324e('0x1'));var moment=require(_0x324e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0x324e('0x3'))['db'];var utils=require(_0x324e('0x4'));var logger=require(_0x324e('0x5'))(_0x324e('0x6'));var config=require('../../config/environment');var jayson=require(_0x324e('0x7'));var client=jayson['client'][_0x324e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bfddf,_0x2b40d2,_0x551f3f){return new BPromise(function(_0x235c88,_0x92d62e){return client[_0x324e('0x9')](_0x4bfddf,_0x551f3f)[_0x324e('0xa')](function(_0xb319df){logger[_0x324e('0xb')](_0x324e('0xc'),_0x2b40d2,_0x324e('0xd'));logger[_0x324e('0xe')](_0x324e('0xf'),_0x2b40d2,_0x324e('0xd'),JSON['stringify'](_0xb319df));if(_0xb319df[_0x324e('0x10')]){if(_0xb319df[_0x324e('0x10')][_0x324e('0x11')]===0x1f4){logger[_0x324e('0x10')](_0x324e('0xc'),_0x2b40d2,_0xb319df[_0x324e('0x10')]['message']);return _0x92d62e(_0xb319df[_0x324e('0x10')][_0x324e('0x12')]);}logger[_0x324e('0x10')]('CmHopper,\x20%s,\x20%s',_0x2b40d2,_0xb319df['error'][_0x324e('0x12')]);return _0x235c88(_0xb319df[_0x324e('0x10')][_0x324e('0x12')]);}else{logger[_0x324e('0xb')](_0x324e('0xc'),_0x2b40d2,'request\x20sent');_0x235c88(_0xb319df['result'][_0x324e('0x12')]);}})[_0x324e('0x13')](function(_0x59a6e9){logger['error']('CmHopper,\x20%s,\x20%s',_0x2b40d2,_0x59a6e9);_0x92d62e(_0x59a6e9);});});}exports[_0x324e('0x14')]=function(_0x1c8a2f){var _0x1a3c74=this;return new Promise(function(_0x331a55,_0xb64ce4){return db[_0x324e('0x15')][_0x324e('0x16')]({'raw':_0x1c8a2f[_0x324e('0x17')]?_0x1c8a2f[_0x324e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1c8a2f['options']?_0x1c8a2f[_0x324e('0x17')][_0x324e('0x18')]||null:null,'attributes':_0x1c8a2f[_0x324e('0x17')]?_0x1c8a2f[_0x324e('0x17')][_0x324e('0x19')]||null:null,'limit':_0x1c8a2f[_0x324e('0x17')]?_0x1c8a2f['options']['limit']||null:null,'include':_0x1c8a2f[_0x324e('0x17')]?_0x1c8a2f['options'][_0x324e('0x1a')]?_['map'](_0x1c8a2f[_0x324e('0x17')][_0x324e('0x1a')],function(_0x1c8039){return{'model':db[_0x1c8039[_0x324e('0x1b')]],'as':_0x1c8039['as'],'attributes':_0x1c8039[_0x324e('0x19')],'include':_0x1c8039[_0x324e('0x1a')]?_['map'](_0x1c8039[_0x324e('0x1a')],function(_0x4a2b28){return{'model':db[_0x4a2b28[_0x324e('0x1b')]],'as':_0x4a2b28['as'],'attributes':_0x4a2b28['attributes'],'include':_0x4a2b28[_0x324e('0x1a')]?_[_0x324e('0x1c')](_0x4a2b28[_0x324e('0x1a')],function(_0xb1891d){return{'model':db[_0xb1891d['model']],'as':_0xb1891d['as'],'attributes':_0xb1891d['attributes']};}):[]};}):[]};}):[]:[]})[_0x324e('0xa')](function(_0x493a87){logger[_0x324e('0xb')](_0x324e('0x14'),_0x1c8a2f);logger[_0x324e('0xe')](_0x324e('0x14'),_0x1c8a2f,JSON[_0x324e('0x1d')](_0x493a87));_0x331a55(_0x493a87);})['catch'](function(_0x594611){logger[_0x324e('0x10')]('GetCmHopper',_0x594611[_0x324e('0x12')],_0x1c8a2f);_0xb64ce4(_0x1a3c74[_0x324e('0x10')](0x1f4,_0x594611[_0x324e('0x12')]));});});};exports[_0x324e('0x1e')]=function(_0x1f05eb){var _0x4e5186=this;return new Promise(function(_0x421a43,_0x52d8fb){return db[_0x324e('0x15')][_0x324e('0x1f')]({'raw':_0x1f05eb[_0x324e('0x17')]?_0x1f05eb['options'][_0x324e('0x20')]===undefined?!![]:![]:!![],'where':_0x1f05eb[_0x324e('0x17')]?_0x1f05eb[_0x324e('0x17')]['where']||null:null,'attributes':_0x1f05eb[_0x324e('0x17')]?_0x1f05eb[_0x324e('0x17')][_0x324e('0x19')]||null:null,'include':_0x1f05eb[_0x324e('0x17')]?_0x1f05eb[_0x324e('0x17')][_0x324e('0x1a')]?_[_0x324e('0x1c')](_0x1f05eb[_0x324e('0x17')][_0x324e('0x1a')],function(_0x239b8e){return{'model':db[_0x239b8e[_0x324e('0x1b')]],'as':_0x239b8e['as'],'attributes':_0x239b8e['attributes'],'include':_0x239b8e['include']?_[_0x324e('0x1c')](_0x239b8e[_0x324e('0x1a')],function(_0x47ac04){return{'model':db[_0x47ac04[_0x324e('0x1b')]],'as':_0x47ac04['as'],'attributes':_0x47ac04[_0x324e('0x19')],'include':_0x47ac04[_0x324e('0x1a')]?_[_0x324e('0x1c')](_0x47ac04[_0x324e('0x1a')],function(_0x148565){return{'model':db[_0x148565[_0x324e('0x1b')]],'as':_0x148565['as'],'attributes':_0x148565[_0x324e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x324e('0xa')](function(_0x5c7549){logger[_0x324e('0xb')]('ShowCmHopper',_0x1f05eb);logger[_0x324e('0xe')]('ShowCmHopper',_0x1f05eb,JSON[_0x324e('0x1d')](_0x5c7549));_0x421a43(_0x5c7549);})[_0x324e('0x13')](function(_0x47b284){logger[_0x324e('0x10')](_0x324e('0x1e'),_0x47b284['message'],_0x1f05eb);_0x52d8fb(_0x4e5186[_0x324e('0x10')](0x1f4,_0x47b284['message']));});});};exports[_0x324e('0x21')]=function(_0x409e88){var _0x222c54=this;return new Promise(function(_0x15a8da,_0x138ea2){return db[_0x324e('0x15')][_0x324e('0x22')](_0x409e88[_0x324e('0x23')],{'raw':_0x409e88[_0x324e('0x17')]?_0x409e88[_0x324e('0x17')][_0x324e('0x20')]===undefined?!![]:![]:!![]})[_0x324e('0xa')](function(_0x4e929a){logger[_0x324e('0xb')]('CreateCmHopper',_0x409e88);logger[_0x324e('0xe')](_0x324e('0x21'),_0x409e88,JSON[_0x324e('0x1d')](_0x4e929a));_0x15a8da(_0x4e929a);})[_0x324e('0x13')](function(_0x4fd61a){logger[_0x324e('0x10')]('CreateCmHopper',_0x4fd61a['message'],_0x409e88);_0x138ea2(_0x222c54[_0x324e('0x10')](0x1f4,_0x4fd61a[_0x324e('0x12')]));});});};exports[_0x324e('0x24')]=function(_0x1ff3af){var _0x592d2c=this;return new Promise(function(_0x53d3bf,_0x30411f){return db['CmHopper']['update'](_0x1ff3af[_0x324e('0x23')],{'raw':_0x1ff3af[_0x324e('0x17')]?_0x1ff3af[_0x324e('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ff3af[_0x324e('0x17')]?_0x1ff3af[_0x324e('0x17')]['where']||null:null,'attributes':_0x1ff3af[_0x324e('0x17')]?_0x1ff3af[_0x324e('0x17')][_0x324e('0x19')]||null:null,'limit':_0x1ff3af[_0x324e('0x17')]?_0x1ff3af[_0x324e('0x17')][_0x324e('0x25')]||null:null})[_0x324e('0xa')](function(_0x360b1f){logger['info'](_0x324e('0x24'),_0x1ff3af);logger[_0x324e('0xe')](_0x324e('0x24'),_0x1ff3af,JSON[_0x324e('0x1d')](_0x360b1f));_0x53d3bf(_0x360b1f);})[_0x324e('0x13')](function(_0xb56ae2){logger[_0x324e('0x10')](_0x324e('0x24'),_0xb56ae2[_0x324e('0x12')],_0x1ff3af);_0x30411f(_0x592d2c[_0x324e('0x10')](0x1f4,_0xb56ae2[_0x324e('0x12')]));});});};exports[_0x324e('0x26')]=function(_0x342efe){var _0x49d150=this;return new Promise(function(_0x3ee79b,_0x4339f4){return db[_0x324e('0x15')][_0x324e('0x27')]({'where':_0x342efe[_0x324e('0x17')]?_0x342efe[_0x324e('0x17')][_0x324e('0x18')]||null:null})[_0x324e('0xa')](function(_0x4d3a38){logger[_0x324e('0xb')](_0x324e('0x26'),_0x342efe);logger[_0x324e('0xe')](_0x324e('0x26'),_0x342efe,JSON['stringify'](_0x4d3a38));_0x3ee79b(_0x4d3a38);})[_0x324e('0x13')](function(_0x4fc4f6){logger['error'](_0x324e('0x26'),_0x4fc4f6['message'],_0x342efe);_0x4339f4(_0x49d150[_0x324e('0x10')](0x1f4,_0x4fc4f6[_0x324e('0x12')]));});});};exports[_0x324e('0x28')]=function(_0x177ac8){var _0x2ae599=this;return new Promise(function(_0x74e8c5,_0x3124f8){return db[_0x324e('0x29')][_0x324e('0x2a')]()[_0x324e('0xa')](function(_0x366f44){return db['sequelize'][_0x324e('0x2b')](function(_0x364e2e){return db[_0x324e('0x15')]['findAll']({'where':_0x177ac8[_0x324e('0x17')]?_0x177ac8[_0x324e('0x17')][_0x324e('0x18')]||null:null,'attributes':_0x177ac8[_0x324e('0x17')]?_0x177ac8[_0x324e('0x17')][_0x324e('0x19')]||null:null,'limit':_0x177ac8[_0x324e('0x17')]?_0x177ac8[_0x324e('0x17')][_0x324e('0x25')]||null:null,'order':_0x177ac8['options']?_0x177ac8[_0x324e('0x17')]['order']||null:null,'transaction':_0x364e2e,'lock':_0x364e2e['LOCK'][_0x324e('0x2c')],'include':[{'model':db['CmContact'],'as':_0x324e('0x2d'),'attributes':_[_0x324e('0x2e')](_0x366f44)}]})[_0x324e('0xa')](function(_0xc90f87){var _0x48471c=[];for(var _0x5b123e=0x0;_0x5b123e<_0xc90f87[_0x324e('0x2f')];_0x5b123e+=0x1){_0x48471c['push'](_0xc90f87[_0x5b123e][_0x324e('0x30')](_0x177ac8[_0x324e('0x23')],{'transaction':_0x364e2e}));}return BPromise[_0x324e('0x31')](_0x48471c);});})[_0x324e('0xa')](function(_0x52d982){logger[_0x324e('0xb')](_0x324e('0x28'),_0x177ac8);logger[_0x324e('0xe')](_0x324e('0x28'),_0x177ac8,JSON[_0x324e('0x1d')](_0x52d982));_0x74e8c5(_0x52d982);})[_0x324e('0x13')](function(_0x22cc27){logger[_0x324e('0x10')](_0x324e('0x28'),_0x22cc27[_0x324e('0x12')],_0x177ac8);_0x3124f8(_0x2ae599[_0x324e('0x10')](0x1f4,_0x22cc27[_0x324e('0x12')]));});});});};exports[_0x324e('0x32')]=function(_0x446a25){var _0x3feb06=this;return new Promise(function(_0xe6608c,_0x15e312){return db[_0x324e('0x33')][_0x324e('0x2b')](function(_0x20dcc5){return db['CmHopperFinal'][_0x324e('0x22')](_0x446a25[_0x324e('0x23')],{'raw':_0x446a25['options']?_0x446a25[_0x324e('0x17')][_0x324e('0x20')]===undefined?!![]:![]:!![],'transaction':_0x20dcc5})[_0x324e('0xa')](function(){return db[_0x324e('0x15')][_0x324e('0x27')]({'where':_0x446a25[_0x324e('0x17')]?_0x446a25[_0x324e('0x17')][_0x324e('0x18')]||null:null,'transaction':_0x20dcc5});});})['then'](function(_0x4ae942){logger[_0x324e('0xb')]('MoveContactManagedDialer',_0x446a25);logger[_0x324e('0xe')](_0x324e('0x32'),_0x446a25,JSON[_0x324e('0x1d')](_0x4ae942));_0xe6608c(_0x4ae942);})['catch'](function(_0x39ad7f){logger[_0x324e('0x10')](_0x324e('0x32'),_0x39ad7f[_0x324e('0x12')],_0x446a25);_0x15e312(_0x3feb06[_0x324e('0x10')](0x1f4,_0x39ad7f[_0x324e('0x12')]));});});};exports[_0x324e('0x34')]=function(_0x1afccf){var _0x5dbee3=this;return new Promise(function(_0xbfd00,_0x4da2e0){return db[_0x324e('0x15')]['findAll']({'raw':_0x1afccf[_0x324e('0x17')]?_0x1afccf[_0x324e('0x17')][_0x324e('0x20')]===undefined?!![]:![]:!![],'where':_0x1afccf[_0x324e('0x17')]?_0x1afccf['options'][_0x324e('0x18')]||null:null,'attributes':[[db[_0x324e('0x33')]['fn'](_0x324e('0x35'),db['sequelize']['fn']('IF',db[_0x324e('0x33')]['literal'](_0x324e('0x36')+util[_0x324e('0x37')]('\x22%s\x22',moment()[_0x324e('0x37')](_0x324e('0x38')))+_0x324e('0x39')))),_0x324e('0x3a')]]})[_0x324e('0xa')](function(_0xffa602){logger['info'](_0x324e('0x34'),_0x1afccf);logger[_0x324e('0xe')](_0x324e('0x34'),_0x1afccf,JSON[_0x324e('0x1d')](_0xffa602));_0xbfd00(_0xffa602);})[_0x324e('0x13')](function(_0x11801e){logger['error'](_0x324e('0x34'),_0x11801e[_0x324e('0x12')],_0x1afccf);_0x4da2e0(_0x5dbee3[_0x324e('0x10')](0x1f4,_0x11801e[_0x324e('0x12')]));});});};exports[_0x324e('0x3b')]=function(_0x26153b){var _0x4bc9e3=this;return new Promise(function(_0xb91ea9,_0x2bc710){return db[_0x324e('0x29')][_0x324e('0x2a')]()[_0x324e('0xa')](function(_0x224273){return db[_0x324e('0x33')][_0x324e('0x2b')](function(_0xf3f14c){return db[_0x324e('0x15')][_0x324e('0x16')]({'where':_0x26153b['options']?_0x26153b[_0x324e('0x17')][_0x324e('0x18')]||null:null,'attributes':_0x26153b[_0x324e('0x17')]?_0x26153b[_0x324e('0x17')][_0x324e('0x19')]||null:null,'limit':0x1,'order':_0x26153b[_0x324e('0x17')]?_0x26153b[_0x324e('0x17')][_0x324e('0x3c')]||null:null,'group':db[_0x324e('0x15')][_0x324e('0x3d')],'transaction':_0xf3f14c,'lock':_0xf3f14c[_0x324e('0x3e')][_0x324e('0x2c')],'include':_0x26153b['options']?_0x26153b[_0x324e('0x17')][_0x324e('0x1a')]?_['map'](_0x26153b[_0x324e('0x17')][_0x324e('0x1a')],function(_0x332423){return{'model':db[_0x332423[_0x324e('0x1b')]],'as':_0x332423['as'],'attributes':_0x332423['attributes'],'include':_0x332423['include']?_['map'](_0x332423['include'],function(_0x1534cc){return{'model':db[_0x1534cc[_0x324e('0x1b')]],'as':_0x1534cc['as'],'attributes':_0x1534cc[_0x324e('0x19')],'include':_0x1534cc['include']?_['map'](_0x1534cc['include'],function(_0x28b9f0){return{'model':db[_0x28b9f0[_0x324e('0x1b')]],'as':_0x28b9f0['as'],'attributes':_0x28b9f0[_0x324e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x324e('0xa')](function(_0x10791d){var _0x198f49=[];for(var _0x34073d=0x0;_0x34073d<_0x10791d[_0x324e('0x2f')];_0x34073d+=0x1){_0x198f49['push'](_0x10791d[_0x34073d]['update'](_0x26153b[_0x324e('0x23')],{'transaction':_0xf3f14c}));}return BPromise[_0x324e('0x31')](_0x198f49);});})[_0x324e('0xa')](function(_0x3d031a){logger[_0x324e('0xb')](_0x324e('0x3b'),_0x26153b);logger[_0x324e('0xe')](_0x324e('0x3b'),_0x26153b,JSON[_0x324e('0x1d')](_0x3d031a));_0xb91ea9(_0x3d031a);})[_0x324e('0x13')](function(_0x300ea7){logger[_0x324e('0x10')]('GetContactRecallMe',_0x300ea7['message'],_0x26153b);_0x2bc710(_0x4bc9e3[_0x324e('0x10')](0x1f4,_0x300ea7[_0x324e('0x12')]));});});});};
\ No newline at end of file
+var _0xf9fc=['CmContact','length','all','MoveContactManagedDialer','sequelize','CmHopperFinal','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','UserId','push','GetContactRecallMe','lodash','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','message','catch','GetCmHopper','findAll','options','raw','attributes','limit','include','model','map','stringify','CmHopper','find','where','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','describe','transaction','order','LOCK','UPDATE'];(function(_0x1a08e5,_0x44766f){var _0x52e72b=function(_0x117ba0){while(--_0x117ba0){_0x1a08e5['push'](_0x1a08e5['shift']());}};_0x52e72b(++_0x44766f);}(_0xf9fc,0x88));var _0xcf9f=function(_0x491006,_0x183de0){_0x491006=_0x491006-0x0;var _0x231cf8=_0xf9fc[_0x491006];return _0x231cf8;};'use strict';var _=require(_0xcf9f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcf9f('0x1'));var rs=require('randomstring');var fs=require('fs');var db=require(_0xcf9f('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xcf9f('0x3'))(_0xcf9f('0x4'));var config=require(_0xcf9f('0x5'));var jayson=require(_0xcf9f('0x6'));var client=jayson[_0xcf9f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5865a8,_0x4c6b7f,_0x3bbedb){return new BPromise(function(_0x46729c,_0xb16190){return client['request'](_0x5865a8,_0x3bbedb)[_0xcf9f('0x8')](function(_0x3fb74f){logger[_0xcf9f('0x9')](_0xcf9f('0xa'),_0x4c6b7f,_0xcf9f('0xb'));logger[_0xcf9f('0xc')](_0xcf9f('0xd'),_0x4c6b7f,_0xcf9f('0xb'),JSON['stringify'](_0x3fb74f));if(_0x3fb74f[_0xcf9f('0xe')]){if(_0x3fb74f['error']['code']===0x1f4){logger[_0xcf9f('0xe')](_0xcf9f('0xa'),_0x4c6b7f,_0x3fb74f['error'][_0xcf9f('0xf')]);return _0xb16190(_0x3fb74f[_0xcf9f('0xe')][_0xcf9f('0xf')]);}logger[_0xcf9f('0xe')](_0xcf9f('0xa'),_0x4c6b7f,_0x3fb74f[_0xcf9f('0xe')]['message']);return _0x46729c(_0x3fb74f[_0xcf9f('0xe')]['message']);}else{logger[_0xcf9f('0x9')](_0xcf9f('0xa'),_0x4c6b7f,'request\x20sent');_0x46729c(_0x3fb74f['result'][_0xcf9f('0xf')]);}})[_0xcf9f('0x10')](function(_0x44fb70){logger[_0xcf9f('0xe')](_0xcf9f('0xa'),_0x4c6b7f,_0x44fb70);_0xb16190(_0x44fb70);});});}exports[_0xcf9f('0x11')]=function(_0x2932d8){var _0x2c8edc=this;return new Promise(function(_0x3f110d,_0x4a0cbd){return db['CmHopper'][_0xcf9f('0x12')]({'raw':_0x2932d8[_0xcf9f('0x13')]?_0x2932d8[_0xcf9f('0x13')][_0xcf9f('0x14')]===undefined?!![]:![]:!![],'where':_0x2932d8[_0xcf9f('0x13')]?_0x2932d8[_0xcf9f('0x13')]['where']||null:null,'attributes':_0x2932d8[_0xcf9f('0x13')]?_0x2932d8[_0xcf9f('0x13')][_0xcf9f('0x15')]||null:null,'limit':_0x2932d8['options']?_0x2932d8[_0xcf9f('0x13')][_0xcf9f('0x16')]||null:null,'include':_0x2932d8[_0xcf9f('0x13')]?_0x2932d8[_0xcf9f('0x13')][_0xcf9f('0x17')]?_['map'](_0x2932d8[_0xcf9f('0x13')]['include'],function(_0x68e219){return{'model':db[_0x68e219[_0xcf9f('0x18')]],'as':_0x68e219['as'],'attributes':_0x68e219[_0xcf9f('0x15')],'include':_0x68e219[_0xcf9f('0x17')]?_[_0xcf9f('0x19')](_0x68e219[_0xcf9f('0x17')],function(_0x26c387){return{'model':db[_0x26c387[_0xcf9f('0x18')]],'as':_0x26c387['as'],'attributes':_0x26c387[_0xcf9f('0x15')],'include':_0x26c387[_0xcf9f('0x17')]?_['map'](_0x26c387[_0xcf9f('0x17')],function(_0x3757ba){return{'model':db[_0x3757ba[_0xcf9f('0x18')]],'as':_0x3757ba['as'],'attributes':_0x3757ba[_0xcf9f('0x15')]};}):[]};}):[]};}):[]:[]})[_0xcf9f('0x8')](function(_0x2b1cfb){logger[_0xcf9f('0x9')]('GetCmHopper',_0x2932d8);logger[_0xcf9f('0xc')]('GetCmHopper',_0x2932d8,JSON[_0xcf9f('0x1a')](_0x2b1cfb));_0x3f110d(_0x2b1cfb);})[_0xcf9f('0x10')](function(_0x40e8cd){logger[_0xcf9f('0xe')]('GetCmHopper',_0x40e8cd[_0xcf9f('0xf')],_0x2932d8);_0x4a0cbd(_0x2c8edc[_0xcf9f('0xe')](0x1f4,_0x40e8cd['message']));});});};exports['ShowCmHopper']=function(_0x39a021){var _0xcaa673=this;return new Promise(function(_0x3908b8,_0x4d2862){return db[_0xcf9f('0x1b')][_0xcf9f('0x1c')]({'raw':_0x39a021['options']?_0x39a021[_0xcf9f('0x13')][_0xcf9f('0x14')]===undefined?!![]:![]:!![],'where':_0x39a021[_0xcf9f('0x13')]?_0x39a021['options'][_0xcf9f('0x1d')]||null:null,'attributes':_0x39a021[_0xcf9f('0x13')]?_0x39a021[_0xcf9f('0x13')][_0xcf9f('0x15')]||null:null,'include':_0x39a021[_0xcf9f('0x13')]?_0x39a021[_0xcf9f('0x13')][_0xcf9f('0x17')]?_[_0xcf9f('0x19')](_0x39a021[_0xcf9f('0x13')]['include'],function(_0x45a26f){return{'model':db[_0x45a26f[_0xcf9f('0x18')]],'as':_0x45a26f['as'],'attributes':_0x45a26f['attributes'],'include':_0x45a26f[_0xcf9f('0x17')]?_[_0xcf9f('0x19')](_0x45a26f['include'],function(_0x30b789){return{'model':db[_0x30b789[_0xcf9f('0x18')]],'as':_0x30b789['as'],'attributes':_0x30b789['attributes'],'include':_0x30b789[_0xcf9f('0x17')]?_[_0xcf9f('0x19')](_0x30b789['include'],function(_0x1cdd49){return{'model':db[_0x1cdd49[_0xcf9f('0x18')]],'as':_0x1cdd49['as'],'attributes':_0x1cdd49[_0xcf9f('0x15')]};}):[]};}):[]};}):[]:[]})[_0xcf9f('0x8')](function(_0xbafbe7){logger['info']('ShowCmHopper',_0x39a021);logger[_0xcf9f('0xc')](_0xcf9f('0x1e'),_0x39a021,JSON[_0xcf9f('0x1a')](_0xbafbe7));_0x3908b8(_0xbafbe7);})[_0xcf9f('0x10')](function(_0x51ffe3){logger[_0xcf9f('0xe')]('ShowCmHopper',_0x51ffe3[_0xcf9f('0xf')],_0x39a021);_0x4d2862(_0xcaa673[_0xcf9f('0xe')](0x1f4,_0x51ffe3[_0xcf9f('0xf')]));});});};exports[_0xcf9f('0x1f')]=function(_0x17fa7e){var _0x32aad8=this;return new Promise(function(_0x5ea947,_0x441fc4){return db['CmHopper'][_0xcf9f('0x20')](_0x17fa7e[_0xcf9f('0x21')],{'raw':_0x17fa7e[_0xcf9f('0x13')]?_0x17fa7e[_0xcf9f('0x13')][_0xcf9f('0x14')]===undefined?!![]:![]:!![]})[_0xcf9f('0x8')](function(_0x5d3215){logger['info'](_0xcf9f('0x1f'),_0x17fa7e);logger[_0xcf9f('0xc')]('CreateCmHopper',_0x17fa7e,JSON['stringify'](_0x5d3215));_0x5ea947(_0x5d3215);})[_0xcf9f('0x10')](function(_0x1a5940){logger[_0xcf9f('0xe')](_0xcf9f('0x1f'),_0x1a5940['message'],_0x17fa7e);_0x441fc4(_0x32aad8[_0xcf9f('0xe')](0x1f4,_0x1a5940['message']));});});};exports[_0xcf9f('0x22')]=function(_0x562f23){var _0x343bf1=this;return new Promise(function(_0xafcd7b,_0x1d6cef){return db['CmHopper'][_0xcf9f('0x23')](_0x562f23['body'],{'raw':_0x562f23[_0xcf9f('0x13')]?_0x562f23[_0xcf9f('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x562f23[_0xcf9f('0x13')]?_0x562f23[_0xcf9f('0x13')]['where']||null:null,'attributes':_0x562f23[_0xcf9f('0x13')]?_0x562f23[_0xcf9f('0x13')][_0xcf9f('0x15')]||null:null,'limit':_0x562f23[_0xcf9f('0x13')]?_0x562f23[_0xcf9f('0x13')][_0xcf9f('0x16')]||null:null})[_0xcf9f('0x8')](function(_0x47a9a1){logger['info'](_0xcf9f('0x22'),_0x562f23);logger['debug'](_0xcf9f('0x22'),_0x562f23,JSON[_0xcf9f('0x1a')](_0x47a9a1));_0xafcd7b(_0x47a9a1);})['catch'](function(_0x286750){logger[_0xcf9f('0xe')]('UpdateCmHopper',_0x286750[_0xcf9f('0xf')],_0x562f23);_0x1d6cef(_0x343bf1['error'](0x1f4,_0x286750[_0xcf9f('0xf')]));});});};exports[_0xcf9f('0x24')]=function(_0xec534c){var _0x51ca4c=this;return new Promise(function(_0x244e57,_0x56aa1c){return db['CmHopper'][_0xcf9f('0x25')]({'where':_0xec534c[_0xcf9f('0x13')]?_0xec534c[_0xcf9f('0x13')]['where']||null:null})['then'](function(_0x147575){logger['info'](_0xcf9f('0x24'),_0xec534c);logger[_0xcf9f('0xc')](_0xcf9f('0x24'),_0xec534c,JSON[_0xcf9f('0x1a')](_0x147575));_0x244e57(_0x147575);})[_0xcf9f('0x10')](function(_0xeb0e3e){logger[_0xcf9f('0xe')](_0xcf9f('0x24'),_0xeb0e3e['message'],_0xec534c);_0x56aa1c(_0x51ca4c['error'](0x1f4,_0xeb0e3e[_0xcf9f('0xf')]));});});};exports[_0xcf9f('0x26')]=function(_0x5574be){var _0x3cfafd=this;return new Promise(function(_0x1e7442,_0xb2cc29){return db['CmContact'][_0xcf9f('0x27')]()[_0xcf9f('0x8')](function(_0x279228){return db['sequelize'][_0xcf9f('0x28')](function(_0x29691c){return db[_0xcf9f('0x1b')][_0xcf9f('0x12')]({'where':_0x5574be[_0xcf9f('0x13')]?_0x5574be[_0xcf9f('0x13')]['where']||null:null,'attributes':_0x5574be[_0xcf9f('0x13')]?_0x5574be[_0xcf9f('0x13')]['attributes']||null:null,'limit':_0x5574be[_0xcf9f('0x13')]?_0x5574be[_0xcf9f('0x13')][_0xcf9f('0x16')]||null:null,'order':_0x5574be[_0xcf9f('0x13')]?_0x5574be[_0xcf9f('0x13')][_0xcf9f('0x29')]||null:null,'transaction':_0x29691c,'lock':_0x29691c[_0xcf9f('0x2a')][_0xcf9f('0x2b')],'include':[{'model':db[_0xcf9f('0x2c')],'as':'Contact','attributes':_['keys'](_0x279228)}]})[_0xcf9f('0x8')](function(_0x47c566){var _0x45446c=[];for(var _0x54e965=0x0;_0x54e965<_0x47c566[_0xcf9f('0x2d')];_0x54e965+=0x1){_0x45446c['push'](_0x47c566[_0x54e965][_0xcf9f('0x23')](_0x5574be[_0xcf9f('0x21')],{'transaction':_0x29691c}));}return BPromise[_0xcf9f('0x2e')](_0x45446c);});})[_0xcf9f('0x8')](function(_0x2d037b){logger[_0xcf9f('0x9')](_0xcf9f('0x26'),_0x5574be);logger['debug'](_0xcf9f('0x26'),_0x5574be,JSON[_0xcf9f('0x1a')](_0x2d037b));_0x1e7442(_0x2d037b);})[_0xcf9f('0x10')](function(_0x19a763){logger[_0xcf9f('0xe')](_0xcf9f('0x26'),_0x19a763[_0xcf9f('0xf')],_0x5574be);_0xb2cc29(_0x3cfafd[_0xcf9f('0xe')](0x1f4,_0x19a763[_0xcf9f('0xf')]));});});});};exports[_0xcf9f('0x2f')]=function(_0x274ec4){var _0x3c0e25=this;return new Promise(function(_0x476529,_0x3b27d3){return db[_0xcf9f('0x30')][_0xcf9f('0x28')](function(_0x3b38e1){return db[_0xcf9f('0x31')][_0xcf9f('0x20')](_0x274ec4[_0xcf9f('0x21')],{'raw':_0x274ec4['options']?_0x274ec4[_0xcf9f('0x13')][_0xcf9f('0x14')]===undefined?!![]:![]:!![],'transaction':_0x3b38e1})['then'](function(){return db[_0xcf9f('0x1b')][_0xcf9f('0x25')]({'where':_0x274ec4[_0xcf9f('0x13')]?_0x274ec4['options'][_0xcf9f('0x1d')]||null:null,'transaction':_0x3b38e1});});})[_0xcf9f('0x8')](function(_0x29c9e0){logger[_0xcf9f('0x9')]('MoveContactManagedDialer',_0x274ec4);logger[_0xcf9f('0xc')](_0xcf9f('0x2f'),_0x274ec4,JSON[_0xcf9f('0x1a')](_0x29c9e0));_0x476529(_0x29c9e0);})[_0xcf9f('0x10')](function(_0x448fc1){logger['error'](_0xcf9f('0x2f'),_0x448fc1[_0xcf9f('0xf')],_0x274ec4);_0x3b27d3(_0x3c0e25[_0xcf9f('0xe')](0x1f4,_0x448fc1[_0xcf9f('0xf')]));});});};exports[_0xcf9f('0x32')]=function(_0x3d6713){var _0x1bc784=this;return new Promise(function(_0x350c37,_0x8a92eb){return db[_0xcf9f('0x1b')][_0xcf9f('0x12')]({'raw':_0x3d6713['options']?_0x3d6713[_0xcf9f('0x13')][_0xcf9f('0x14')]===undefined?!![]:![]:!![],'where':_0x3d6713['options']?_0x3d6713[_0xcf9f('0x13')]['where']||null:null,'attributes':[[db[_0xcf9f('0x30')]['fn'](_0xcf9f('0x33'),db[_0xcf9f('0x30')]['fn']('IF',db['sequelize']['literal'](_0xcf9f('0x34')+util[_0xcf9f('0x35')]('\x22%s\x22',moment()[_0xcf9f('0x35')](_0xcf9f('0x36')))+_0xcf9f('0x37')))),_0xcf9f('0x38')]]})['then'](function(_0x2e34f4){logger[_0xcf9f('0x9')](_0xcf9f('0x32'),_0x3d6713);logger[_0xcf9f('0xc')](_0xcf9f('0x32'),_0x3d6713,JSON['stringify'](_0x2e34f4));_0x350c37(_0x2e34f4);})[_0xcf9f('0x10')](function(_0x5b4048){logger[_0xcf9f('0xe')](_0xcf9f('0x32'),_0x5b4048[_0xcf9f('0xf')],_0x3d6713);_0x8a92eb(_0x1bc784[_0xcf9f('0xe')](0x1f4,_0x5b4048[_0xcf9f('0xf')]));});});};exports['GetContactRecallMe']=function(_0x2af86a){var _0x52f6f2=this;return new Promise(function(_0x29bf97,_0x35a342){return db[_0xcf9f('0x2c')][_0xcf9f('0x27')]()[_0xcf9f('0x8')](function(_0x342f19){return db[_0xcf9f('0x30')][_0xcf9f('0x28')](function(_0x4b4f87){return db[_0xcf9f('0x1b')][_0xcf9f('0x12')]({'where':_0x2af86a['options']?_0x2af86a[_0xcf9f('0x13')][_0xcf9f('0x1d')]||null:null,'attributes':_0x2af86a[_0xcf9f('0x13')]?_0x2af86a[_0xcf9f('0x13')][_0xcf9f('0x15')]||null:null,'limit':0x1,'order':_0x2af86a[_0xcf9f('0x13')]?_0x2af86a[_0xcf9f('0x13')][_0xcf9f('0x29')]||null:null,'group':db[_0xcf9f('0x1b')][_0xcf9f('0x39')],'transaction':_0x4b4f87,'lock':_0x4b4f87[_0xcf9f('0x2a')]['UPDATE'],'include':_0x2af86a[_0xcf9f('0x13')]?_0x2af86a[_0xcf9f('0x13')][_0xcf9f('0x17')]?_['map'](_0x2af86a['options'][_0xcf9f('0x17')],function(_0xe10268){return{'model':db[_0xe10268[_0xcf9f('0x18')]],'as':_0xe10268['as'],'attributes':_0xe10268[_0xcf9f('0x15')],'include':_0xe10268['include']?_[_0xcf9f('0x19')](_0xe10268[_0xcf9f('0x17')],function(_0x37c325){return{'model':db[_0x37c325[_0xcf9f('0x18')]],'as':_0x37c325['as'],'attributes':_0x37c325[_0xcf9f('0x15')],'include':_0x37c325['include']?_[_0xcf9f('0x19')](_0x37c325[_0xcf9f('0x17')],function(_0x4b9458){return{'model':db[_0x4b9458['model']],'as':_0x4b9458['as'],'attributes':_0x4b9458['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b568d){var _0x332e08=[];for(var _0x468b5f=0x0;_0x468b5f<_0x3b568d[_0xcf9f('0x2d')];_0x468b5f+=0x1){_0x332e08[_0xcf9f('0x3a')](_0x3b568d[_0x468b5f]['update'](_0x2af86a['body'],{'transaction':_0x4b4f87}));}return BPromise[_0xcf9f('0x2e')](_0x332e08);});})[_0xcf9f('0x8')](function(_0x52ed26){logger[_0xcf9f('0x9')](_0xcf9f('0x3b'),_0x2af86a);logger[_0xcf9f('0xc')](_0xcf9f('0x3b'),_0x2af86a,JSON[_0xcf9f('0x1a')](_0x52ed26));_0x29bf97(_0x52ed26);})[_0xcf9f('0x10')](function(_0x108cc9){logger[_0xcf9f('0xe')](_0xcf9f('0x3b'),_0x108cc9[_0xcf9f('0xf')],_0x2af86a);_0x35a342(_0x52f6f2[_0xcf9f('0xe')](0x1f4,_0x108cc9['message']));});});});};
\ No newline at end of file
index e7e7aab..59d81f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['/describe','/opencontacts','getOpenContacts','/:id','show','create','post','/preview','getPreview','update','delete','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xb10b,0x12a));var _0xbb10=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0xb10b[_0x44216d];return _0xeca523;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var express=require(_0xbb10('0x2'));var router=express[_0xbb10('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbb10('0x4'));var config=require(_0xbb10('0x5'));var controller=require(_0xbb10('0x6'));router[_0xbb10('0x7')]('/',auth[_0xbb10('0x8')](),controller[_0xbb10('0x9')]);router['get'](_0xbb10('0xa'),auth[_0xbb10('0x8')](),controller['describe']);router[_0xbb10('0x7')](_0xbb10('0xb'),auth[_0xbb10('0x8')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x7')](_0xbb10('0xd'),auth[_0xbb10('0x8')](),controller[_0xbb10('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbb10('0xf')]);router[_0xbb10('0x10')](_0xbb10('0x11'),auth['isAuthenticated'](),controller[_0xbb10('0x12')]);router['put'](_0xbb10('0xd'),auth[_0xbb10('0x8')](),controller[_0xbb10('0x13')]);router[_0xbb10('0x14')](_0xbb10('0xd'),auth[_0xbb10('0x8')](),controller['destroy']);module[_0xbb10('0x15')]=router;
\ No newline at end of file
+var _0x0713=['delete','destroy','path','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','show','post','create','/preview','getPreview','put','/:id'];(function(_0x49e82e,_0xbbe887){var _0x31c28e=function(_0x505d9f){while(--_0x505d9f){_0x49e82e['push'](_0x49e82e['shift']());}};_0x31c28e(++_0xbbe887);}(_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 express=require(_0x3071('0x1'));var router=express[_0x3071('0x2')]();var auth=require(_0x3071('0x3'));var interaction=require(_0x3071('0x4'));var config=require('../../config/environment');var controller=require(_0x3071('0x5'));router[_0x3071('0x6')]('/',auth[_0x3071('0x7')](),controller[_0x3071('0x8')]);router[_0x3071('0x6')](_0x3071('0x9'),auth[_0x3071('0x7')](),controller[_0x3071('0xa')]);router[_0x3071('0x6')](_0x3071('0xb'),auth[_0x3071('0x7')](),controller[_0x3071('0xc')]);router[_0x3071('0x6')]('/:id',auth[_0x3071('0x7')](),controller[_0x3071('0xd')]);router[_0x3071('0xe')]('/',auth[_0x3071('0x7')](),controller[_0x3071('0xf')]);router['post'](_0x3071('0x10'),auth[_0x3071('0x7')](),controller[_0x3071('0x11')]);router[_0x3071('0x12')](_0x3071('0x13'),auth['isAuthenticated'](),controller['update']);router[_0x3071('0x14')]('/:id',auth[_0x3071('0x7')](),controller[_0x3071('0x15')]);module['exports']=router;
\ No newline at end of file
index 4b95dc9..9da3521 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cfb=['sequelize','exports','INTEGER','contactListQueue','moment'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0x7cfb,0xa9));var _0xb7cf=function(_0x26dda7,_0x33f38a){_0x26dda7=_0x26dda7-0x0;var _0x42466b=_0x7cfb[_0x26dda7];return _0x42466b;};'use strict';var moment=require(_0xb7cf('0x0'));var Sequelize=require(_0xb7cf('0x1'));module[_0xb7cf('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xb7cf('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xb7cf('0x3')],'unique':_0xb7cf('0x4')}};
\ No newline at end of file
+var _0x9c65=['STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x24f18f,_0x24089c){var _0x354058=function(_0x17fa3c){while(--_0x17fa3c){_0x24f18f['push'](_0x24f18f['shift']());}};_0x354058(++_0x24089c);}(_0x9c65,0x1d4));var _0x59c6=function(_0x2646f2,_0x4c93da){_0x2646f2=_0x2646f2-0x0;var _0x96773d=_0x9c65[_0x2646f2];return _0x96773d;};'use strict';var moment=require(_0x59c6('0x0'));var Sequelize=require(_0x59c6('0x1'));module['exports']={'phone':{'type':Sequelize[_0x59c6('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x59c6('0x3')],'unique':_0x59c6('0x4')},'ListId':{'type':Sequelize[_0x59c6('0x3')],'unique':_0x59c6('0x4')},'VoiceQueueId':{'type':Sequelize[_0x59c6('0x3')],'unique':_0x59c6('0x4')}};
\ No newline at end of file
index 6fbb17a..d8d3832 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae9d=['rawAttributes','keys','dateStart','dateEnd','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','day','add','merge','filter','map','options','includeAll','findAll','rows','show','intersection','include','find','params','body','catch','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','json','apply','reject','update','then','destroy','end','stack','name','send','index','CmHopperBlack'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xae9d,0x198));var _0xdae9=function(_0x5dc9ec,_0x407af4){_0x5dc9ec=_0x5dc9ec-0x0;var _0x5b4cdb=_0xae9d[_0x5dc9ec];return _0x5b4cdb;};'use strict';var pdf=require(_0xdae9('0x0'));var emlformat=require(_0xdae9('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdae9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdae9('0x3'));var moment=require(_0xdae9('0x4'));var BPromise=require(_0xdae9('0x5'));var Mustache=require(_0xdae9('0x6'));var util=require(_0xdae9('0x7'));var path=require(_0xdae9('0x8'));var sox=require(_0xdae9('0x9'));var csv=require(_0xdae9('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdae9('0xb'));var squel=require(_0xdae9('0xc'));var crypto=require(_0xdae9('0xd'));var jsforce=require(_0xdae9('0xe'));var deskjs=require(_0xdae9('0xf'));var toCsv=require(_0xdae9('0xa'));var querystring=require(_0xdae9('0x10'));var Papa=require(_0xdae9('0x11'));var qs=require(_0xdae9('0x12'));var logger=require(_0xdae9('0x13'))(_0xdae9('0x14'));var utils=require(_0xdae9('0x15'));var config=require(_0xdae9('0x16'));var db=require(_0xdae9('0x17'))['db'];function respondWithStatusCode(_0x597f20,_0x30903b){_0x30903b=_0x30903b||0xcc;return function(_0x4ade69){if(_0x4ade69){return _0x597f20[_0xdae9('0x18')](_0x30903b);}return _0x597f20[_0xdae9('0x19')](_0x30903b)['end']();};}function respondWithResult(_0x5bca16,_0x4f86ef){_0x4f86ef=_0x4f86ef||0xc8;return function(_0x5cece7){if(_0x5cece7){return _0x5bca16[_0xdae9('0x19')](_0x4f86ef)['json'](_0x5cece7);}};}function respondWithFilteredResult(_0x2f87af,_0x150a79){return function(_0x453a3a){if(_0x453a3a){var _0x3ac3e8=_0x453a3a[_0xdae9('0x1a')],_0x596e40=_0x150a79[_0xdae9('0x1b')],_0x25c1d2=_0x150a79[_0xdae9('0x1b')]+_0x150a79[_0xdae9('0x1c')],_0x391a6f;if(_0x25c1d2>=_0x3ac3e8){_0x25c1d2=_0x3ac3e8;_0x391a6f=0xc8;}else{_0x391a6f=0xce;}_0x2f87af[_0xdae9('0x19')](_0x391a6f);return _0x2f87af['set'](_0xdae9('0x1d'),_0x596e40+'-'+_0x25c1d2+'/'+_0x3ac3e8)[_0xdae9('0x1e')](_0x453a3a);}return null;};}function patchUpdates(_0x22f65a){return function(_0x48cf3d){try{jsonpatch[_0xdae9('0x1f')](_0x48cf3d,_0x22f65a,!![]);}catch(_0x570ea3){return BPromise[_0xdae9('0x20')](_0x570ea3);}return _0x48cf3d['save']();};}function saveUpdates(_0x3f35a1,_0x5c4bce){return function(_0x59ee1b){if(_0x59ee1b){return _0x59ee1b[_0xdae9('0x21')](_0x3f35a1)[_0xdae9('0x22')](function(_0x3cc6b2){return _0x3cc6b2;});}return null;};}function removeEntity(_0x22fece,_0x51680a){return function(_0x56e487){if(_0x56e487){return _0x56e487[_0xdae9('0x23')]()['then'](function(){_0x22fece[_0xdae9('0x19')](0xcc)[_0xdae9('0x24')]();});}};}function handleEntityNotFound(_0x48e7cf,_0x4a1798){return function(_0x4ccc2a){if(!_0x4ccc2a){_0x48e7cf[_0xdae9('0x18')](0x194);}return _0x4ccc2a;};}function handleError(_0x352c0d,_0x3249f3){_0x3249f3=_0x3249f3||0x1f4;return function(_0x1bdbca){logger['error'](_0x1bdbca[_0xdae9('0x25')]);if(_0x1bdbca[_0xdae9('0x26')]){delete _0x1bdbca['name'];}_0x352c0d['status'](_0x3249f3)[_0xdae9('0x27')](_0x1bdbca);};}exports[_0xdae9('0x28')]=function(_0x5541dd,_0x5c01d4){var _0x6bad8={},_0x2ea409={},_0x1c809c={'count':0x0,'rows':[]};var _0x4fdca3=db[_0xdae9('0x29')][_0xdae9('0x2a')];_0x2ea409['model']=_[_0xdae9('0x2b')](_0x4fdca3);var _0x31dcb5={'dateStart':_0x5541dd['query'][_0xdae9('0x2c')],'dateEnd':_0x5541dd['query'][_0xdae9('0x2d')]};delete _0x5541dd[_0xdae9('0x2e')][_0xdae9('0x2c')];delete _0x5541dd[_0xdae9('0x2e')][_0xdae9('0x2d')];_0x2ea409[_0xdae9('0x2e')]=_[_0xdae9('0x2b')](_0x5541dd[_0xdae9('0x2e')]);_0x2ea409[_0xdae9('0x2f')]=_['intersection'](_0x2ea409[_0xdae9('0x30')],_0x2ea409['query']);_0x6bad8['attributes']=_['intersection'](_0x2ea409[_0xdae9('0x30')],qs['fields'](_0x5541dd[_0xdae9('0x2e')][_0xdae9('0x31')]));_0x6bad8['attributes']=_0x6bad8[_0xdae9('0x32')][_0xdae9('0x33')]?_0x6bad8[_0xdae9('0x32')]:_0x2ea409['model'];if(!_0x5541dd[_0xdae9('0x2e')][_0xdae9('0x34')](_0xdae9('0x35'))){_0x6bad8[_0xdae9('0x1c')]=qs[_0xdae9('0x1c')](_0x5541dd[_0xdae9('0x2e')][_0xdae9('0x1c')]);_0x6bad8[_0xdae9('0x1b')]=qs[_0xdae9('0x1b')](_0x5541dd[_0xdae9('0x2e')][_0xdae9('0x1b')]);}_0x6bad8[_0xdae9('0x36')]=qs[_0xdae9('0x37')](_0x5541dd[_0xdae9('0x2e')][_0xdae9('0x37')]);_0x6bad8[_0xdae9('0x38')]=qs[_0xdae9('0x2f')](_[_0xdae9('0x39')](_0x5541dd[_0xdae9('0x2e')],_0x2ea409['filters']));if(_0x31dcb5[_0xdae9('0x2c')]){if(_0x31dcb5['dateEnd']){_0x31dcb5[_0xdae9('0x2d')]=moment(_0x31dcb5[_0xdae9('0x2d')])['add'](0x1,_0xdae9('0x3a'));}else{_0x31dcb5[_0xdae9('0x2d')]=moment(_0x31dcb5['dateStart'])[_0xdae9('0x3b')](0x1,_0xdae9('0x3a'));}_[_0xdae9('0x3c')](_0x6bad8['where'],{'createdAt':{'$gte':_0x31dcb5[_0xdae9('0x2c')],'$lte':_0x31dcb5[_0xdae9('0x2d')]}});}if(_0x5541dd[_0xdae9('0x2e')][_0xdae9('0x3d')]){_0x6bad8[_0xdae9('0x38')]=_['merge'](_0x6bad8['where'],{'$or':_[_0xdae9('0x3e')](_0x6bad8['attributes'],function(_0x409669){var _0x785604={};_0x785604[_0x409669]={'$like':'%'+_0x5541dd[_0xdae9('0x2e')]['filter']+'%'};return _0x785604;})});}_0x6bad8=_[_0xdae9('0x3c')]({},_0x6bad8,_0x5541dd[_0xdae9('0x3f')]);var _0x516016={'where':_0x6bad8[_0xdae9('0x38')]};return db[_0xdae9('0x29')][_0xdae9('0x1a')](_0x516016)[_0xdae9('0x22')](function(_0x2c16d8){_0x1c809c[_0xdae9('0x1a')]=_0x2c16d8;if(_0x5541dd['query'][_0xdae9('0x40')]){_0x6bad8['include']=[{'all':!![]}];}return db[_0xdae9('0x29')][_0xdae9('0x41')](_0x6bad8);})[_0xdae9('0x22')](function(_0x2ecc8e){_0x1c809c[_0xdae9('0x42')]=_0x2ecc8e;return _0x1c809c;})['then'](respondWithFilteredResult(_0x5c01d4,_0x6bad8))['catch'](handleError(_0x5c01d4,null));};exports[_0xdae9('0x43')]=function(_0xd28bf0,_0x43a2e8){var _0x4d4510={'raw':!![],'where':{'id':_0xd28bf0['params']['id']}},_0x2464a5={};_0x2464a5[_0xdae9('0x30')]=_[_0xdae9('0x2b')](db[_0xdae9('0x29')][_0xdae9('0x2a')]);_0x2464a5[_0xdae9('0x2e')]=_[_0xdae9('0x2b')](_0xd28bf0[_0xdae9('0x2e')]);_0x2464a5[_0xdae9('0x2f')]=_[_0xdae9('0x44')](_0x2464a5[_0xdae9('0x30')],_0x2464a5[_0xdae9('0x2e')]);_0x4d4510[_0xdae9('0x32')]=_[_0xdae9('0x44')](_0x2464a5[_0xdae9('0x30')],qs[_0xdae9('0x31')](_0xd28bf0['query'][_0xdae9('0x31')]));_0x4d4510[_0xdae9('0x32')]=_0x4d4510[_0xdae9('0x32')]['length']?_0x4d4510['attributes']:_0x2464a5[_0xdae9('0x30')];if(_0xd28bf0[_0xdae9('0x2e')][_0xdae9('0x40')]){_0x4d4510[_0xdae9('0x45')]=[{'all':!![]}];}_0x4d4510=_[_0xdae9('0x3c')]({},_0x4d4510,_0xd28bf0[_0xdae9('0x3f')]);return db['CmHopperBlack']['find'](_0x4d4510)['then'](handleEntityNotFound(_0x43a2e8,null))[_0xdae9('0x22')](respondWithResult(_0x43a2e8,null))['catch'](handleError(_0x43a2e8,null));};exports[_0xdae9('0x21')]=function(_0x4e4c6e,_0x264b72){if(_0x4e4c6e['body']['id']){delete _0x4e4c6e['body']['id'];}return db[_0xdae9('0x29')][_0xdae9('0x46')]({'where':{'id':_0x4e4c6e[_0xdae9('0x47')]['id']}})[_0xdae9('0x22')](handleEntityNotFound(_0x264b72,null))[_0xdae9('0x22')](saveUpdates(_0x4e4c6e[_0xdae9('0x48')],null))[_0xdae9('0x22')](respondWithResult(_0x264b72,null))[_0xdae9('0x49')](handleError(_0x264b72,null));};exports['destroy']=function(_0x32298a,_0x3a5f84){return db[_0xdae9('0x29')][_0xdae9('0x46')]({'where':{'id':_0x32298a['params']['id']}})[_0xdae9('0x22')](handleEntityNotFound(_0x3a5f84,null))[_0xdae9('0x22')](removeEntity(_0x3a5f84,null))[_0xdae9('0x49')](handleError(_0x3a5f84,null));};exports['describe']=function(_0x32acd0,_0x558920){return db[_0xdae9('0x29')][_0xdae9('0x4a')]()['then'](respondWithResult(_0x558920,null))[_0xdae9('0x49')](handleError(_0x558920,null));};
\ No newline at end of file
+var _0x7df0=['error','stack','name','send','index','CmHopperBlack','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','add','day','merge','filter','options','includeAll','include','findAll','catch','show','params','length','find','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','count','offset','Content-Range','apply','save','update','then','status','sendStatus'];(function(_0x1cd71f,_0x2a9d19){var _0x33d362=function(_0x2ecb41){while(--_0x2ecb41){_0x1cd71f['push'](_0x1cd71f['shift']());}};_0x33d362(++_0x2a9d19);}(_0x7df0,0x1c9));var _0x07df=function(_0x4fbb86,_0x374ed0){_0x4fbb86=_0x4fbb86-0x0;var _0xb141fe=_0x7df0[_0x4fbb86];return _0xb141fe;};'use strict';var pdf=require(_0x07df('0x0'));var emlformat=require(_0x07df('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x07df('0x2'));var jsonpatch=require(_0x07df('0x3'));var rp=require(_0x07df('0x4'));var moment=require(_0x07df('0x5'));var BPromise=require(_0x07df('0x6'));var Mustache=require(_0x07df('0x7'));var util=require(_0x07df('0x8'));var path=require('path');var sox=require(_0x07df('0x9'));var csv=require(_0x07df('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x07df('0xb'));var squel=require(_0x07df('0xc'));var crypto=require(_0x07df('0xd'));var jsforce=require(_0x07df('0xe'));var deskjs=require(_0x07df('0xf'));var toCsv=require(_0x07df('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var qs=require(_0x07df('0x10'));var logger=require(_0x07df('0x11'))(_0x07df('0x12'));var utils=require(_0x07df('0x13'));var config=require(_0x07df('0x14'));var db=require(_0x07df('0x15'))['db'];function respondWithStatusCode(_0x15196d,_0x573a9d){_0x573a9d=_0x573a9d||0xcc;return function(_0x1cdf97){if(_0x1cdf97){return _0x15196d['sendStatus'](_0x573a9d);}return _0x15196d['status'](_0x573a9d)[_0x07df('0x16')]();};}function respondWithResult(_0x1bcaa9,_0x24e294){_0x24e294=_0x24e294||0xc8;return function(_0x3be54){if(_0x3be54){return _0x1bcaa9['status'](_0x24e294)[_0x07df('0x17')](_0x3be54);}};}function respondWithFilteredResult(_0x58da0a,_0x2d8cdf){return function(_0x531bc8){if(_0x531bc8){var _0x22a82a=_0x531bc8[_0x07df('0x18')],_0x203a48=_0x2d8cdf[_0x07df('0x19')],_0x115714=_0x2d8cdf[_0x07df('0x19')]+_0x2d8cdf['limit'],_0x2ec817;if(_0x115714>=_0x22a82a){_0x115714=_0x22a82a;_0x2ec817=0xc8;}else{_0x2ec817=0xce;}_0x58da0a['status'](_0x2ec817);return _0x58da0a['set'](_0x07df('0x1a'),_0x203a48+'-'+_0x115714+'/'+_0x22a82a)[_0x07df('0x17')](_0x531bc8);}return null;};}function patchUpdates(_0x4945cc){return function(_0x3391da){try{jsonpatch[_0x07df('0x1b')](_0x3391da,_0x4945cc,!![]);}catch(_0x4937bd){return BPromise['reject'](_0x4937bd);}return _0x3391da[_0x07df('0x1c')]();};}function saveUpdates(_0x52865e,_0xbd45f6){return function(_0x1bcfea){if(_0x1bcfea){return _0x1bcfea[_0x07df('0x1d')](_0x52865e)[_0x07df('0x1e')](function(_0x4b3cbd){return _0x4b3cbd;});}return null;};}function removeEntity(_0x30556e,_0x2449e5){return function(_0x4b448f){if(_0x4b448f){return _0x4b448f['destroy']()['then'](function(){_0x30556e[_0x07df('0x1f')](0xcc)[_0x07df('0x16')]();});}};}function handleEntityNotFound(_0x21ca39,_0x309e45){return function(_0x2c2216){if(!_0x2c2216){_0x21ca39[_0x07df('0x20')](0x194);}return _0x2c2216;};}function handleError(_0x42d540,_0x52bace){_0x52bace=_0x52bace||0x1f4;return function(_0x2ca921){logger[_0x07df('0x21')](_0x2ca921[_0x07df('0x22')]);if(_0x2ca921[_0x07df('0x23')]){delete _0x2ca921[_0x07df('0x23')];}_0x42d540['status'](_0x52bace)[_0x07df('0x24')](_0x2ca921);};}exports[_0x07df('0x25')]=function(_0x1cc1f0,_0x88a830){var _0x56d212={},_0x524da6={},_0x22c91f={'count':0x0,'rows':[]};var _0x4364bd=db[_0x07df('0x26')][_0x07df('0x27')];_0x524da6[_0x07df('0x28')]=_[_0x07df('0x29')](_0x4364bd);var _0x8c045d={'dateStart':_0x1cc1f0[_0x07df('0x2a')][_0x07df('0x2b')],'dateEnd':_0x1cc1f0['query'][_0x07df('0x2c')]};delete _0x1cc1f0[_0x07df('0x2a')][_0x07df('0x2b')];delete _0x1cc1f0[_0x07df('0x2a')][_0x07df('0x2c')];_0x524da6[_0x07df('0x2a')]=_[_0x07df('0x29')](_0x1cc1f0['query']);_0x524da6[_0x07df('0x2d')]=_[_0x07df('0x2e')](_0x524da6[_0x07df('0x28')],_0x524da6[_0x07df('0x2a')]);_0x56d212[_0x07df('0x2f')]=_[_0x07df('0x2e')](_0x524da6['model'],qs[_0x07df('0x30')](_0x1cc1f0['query'][_0x07df('0x30')]));_0x56d212[_0x07df('0x2f')]=_0x56d212['attributes']['length']?_0x56d212[_0x07df('0x2f')]:_0x524da6[_0x07df('0x28')];if(!_0x1cc1f0[_0x07df('0x2a')]['hasOwnProperty'](_0x07df('0x31'))){_0x56d212[_0x07df('0x32')]=qs[_0x07df('0x32')](_0x1cc1f0['query'][_0x07df('0x32')]);_0x56d212[_0x07df('0x19')]=qs['offset'](_0x1cc1f0[_0x07df('0x2a')][_0x07df('0x19')]);}_0x56d212[_0x07df('0x33')]=qs[_0x07df('0x34')](_0x1cc1f0[_0x07df('0x2a')][_0x07df('0x34')]);_0x56d212[_0x07df('0x35')]=qs['filters'](_[_0x07df('0x36')](_0x1cc1f0[_0x07df('0x2a')],_0x524da6[_0x07df('0x2d')]));if(_0x8c045d[_0x07df('0x2b')]){if(_0x8c045d[_0x07df('0x2c')]){_0x8c045d[_0x07df('0x2c')]=moment(_0x8c045d[_0x07df('0x2c')])[_0x07df('0x37')](0x1,_0x07df('0x38'));}else{_0x8c045d['dateEnd']=moment(_0x8c045d['dateStart'])['add'](0x1,_0x07df('0x38'));}_[_0x07df('0x39')](_0x56d212[_0x07df('0x35')],{'createdAt':{'$gte':_0x8c045d[_0x07df('0x2b')],'$lte':_0x8c045d[_0x07df('0x2c')]}});}if(_0x1cc1f0['query']['filter']){_0x56d212['where']=_[_0x07df('0x39')](_0x56d212[_0x07df('0x35')],{'$or':_['map'](_0x56d212[_0x07df('0x2f')],function(_0x15fed2){var _0x12a3c4={};_0x12a3c4[_0x15fed2]={'$like':'%'+_0x1cc1f0[_0x07df('0x2a')][_0x07df('0x3a')]+'%'};return _0x12a3c4;})});}_0x56d212=_[_0x07df('0x39')]({},_0x56d212,_0x1cc1f0[_0x07df('0x3b')]);var _0x4afe3c={'where':_0x56d212[_0x07df('0x35')]};return db[_0x07df('0x26')]['count'](_0x4afe3c)[_0x07df('0x1e')](function(_0x438aaa){_0x22c91f[_0x07df('0x18')]=_0x438aaa;if(_0x1cc1f0[_0x07df('0x2a')][_0x07df('0x3c')]){_0x56d212[_0x07df('0x3d')]=[{'all':!![]}];}return db[_0x07df('0x26')][_0x07df('0x3e')](_0x56d212);})[_0x07df('0x1e')](function(_0x3c1d6a){_0x22c91f['rows']=_0x3c1d6a;return _0x22c91f;})[_0x07df('0x1e')](respondWithFilteredResult(_0x88a830,_0x56d212))[_0x07df('0x3f')](handleError(_0x88a830,null));};exports[_0x07df('0x40')]=function(_0x909c95,_0x3ac5cd){var _0x11a5f3={'raw':!![],'where':{'id':_0x909c95[_0x07df('0x41')]['id']}},_0x3673ed={};_0x3673ed[_0x07df('0x28')]=_['keys'](db[_0x07df('0x26')][_0x07df('0x27')]);_0x3673ed[_0x07df('0x2a')]=_[_0x07df('0x29')](_0x909c95[_0x07df('0x2a')]);_0x3673ed[_0x07df('0x2d')]=_[_0x07df('0x2e')](_0x3673ed[_0x07df('0x28')],_0x3673ed[_0x07df('0x2a')]);_0x11a5f3[_0x07df('0x2f')]=_['intersection'](_0x3673ed[_0x07df('0x28')],qs[_0x07df('0x30')](_0x909c95[_0x07df('0x2a')]['fields']));_0x11a5f3[_0x07df('0x2f')]=_0x11a5f3['attributes'][_0x07df('0x42')]?_0x11a5f3[_0x07df('0x2f')]:_0x3673ed[_0x07df('0x28')];if(_0x909c95[_0x07df('0x2a')][_0x07df('0x3c')]){_0x11a5f3[_0x07df('0x3d')]=[{'all':!![]}];}_0x11a5f3=_[_0x07df('0x39')]({},_0x11a5f3,_0x909c95['options']);return db[_0x07df('0x26')][_0x07df('0x43')](_0x11a5f3)[_0x07df('0x1e')](handleEntityNotFound(_0x3ac5cd,null))[_0x07df('0x1e')](respondWithResult(_0x3ac5cd,null))[_0x07df('0x3f')](handleError(_0x3ac5cd,null));};exports[_0x07df('0x1d')]=function(_0x3f284d,_0x45ebb6){if(_0x3f284d['body']['id']){delete _0x3f284d[_0x07df('0x44')]['id'];}return db[_0x07df('0x26')][_0x07df('0x43')]({'where':{'id':_0x3f284d[_0x07df('0x41')]['id']}})[_0x07df('0x1e')](handleEntityNotFound(_0x45ebb6,null))['then'](saveUpdates(_0x3f284d['body'],null))['then'](respondWithResult(_0x45ebb6,null))[_0x07df('0x3f')](handleError(_0x45ebb6,null));};exports['destroy']=function(_0x5c4fe5,_0x3490d7){return db[_0x07df('0x26')]['find']({'where':{'id':_0x5c4fe5[_0x07df('0x41')]['id']}})[_0x07df('0x1e')](handleEntityNotFound(_0x3490d7,null))['then'](removeEntity(_0x3490d7,null))[_0x07df('0x3f')](handleError(_0x3490d7,null));};exports[_0x07df('0x45')]=function(_0x3cedfb,_0x33b1b9){return db[_0x07df('0x26')][_0x07df('0x45')]()[_0x07df('0x1e')](respondWithResult(_0x33b1b9,null))[_0x07df('0x3f')](handleError(_0x33b1b9,null));};
\ No newline at end of file
index c72500b..66672f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a07=['util','moment','bluebird','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash'];(function(_0x3810f6,_0x41f38f){var _0x442125=function(_0x394205){while(--_0x394205){_0x3810f6['push'](_0x3810f6['shift']());}};_0x442125(++_0x41f38f);}(_0x0a07,0x98));var _0x70a0=function(_0x55b9de,_0x2e2bef){_0x55b9de=_0x55b9de-0x0;var _0x16cac7=_0x0a07[_0x55b9de];return _0x16cac7;};'use strict';var _=require(_0x70a0('0x0'));var util=require(_0x70a0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x70a0('0x2'));var BPromise=require(_0x70a0('0x3'));var rp=require('request-promise');var attributes=require(_0x70a0('0x4'));module[_0x70a0('0x5')]=function(_0x5bc973,_0x575286){return _0x5bc973[_0x70a0('0x6')](_0x70a0('0x7'),attributes,{'tableName':_0x70a0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0d89=['util','api','moment','bluebird','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black'];(function(_0x593d73,_0x2dbcd6){var _0x493c66=function(_0x323d23){while(--_0x323d23){_0x593d73['push'](_0x593d73['shift']());}};_0x493c66(++_0x2dbcd6);}(_0x0d89,0x190));var _0x90d8=function(_0x34c2b3,_0x46b3fc){_0x34c2b3=_0x34c2b3-0x0;var _0x36a73f=_0x0d89[_0x34c2b3];return _0x36a73f;};'use strict';var _=require('lodash');var util=require(_0x90d8('0x0'));var logger=require('../../config/logger')(_0x90d8('0x1'));var moment=require(_0x90d8('0x2'));var BPromise=require(_0x90d8('0x3'));var rp=require('request-promise');var attributes=require(_0x90d8('0x4'));module[_0x90d8('0x5')]=function(_0x468905,_0x3195ec){return _0x468905['define'](_0x90d8('0x6'),attributes,{'tableName':_0x90d8('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 48d8e9d..8127da7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb31b=['jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','where','limit','include','map','model','attributes','GetCmHopperBlack','UpdateCmHopperBlack','CmHopperBlack','update','body','DestroyCmHopperBlack','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x239dfb,_0x40ee47){var _0x203fca=function(_0x3d6eed){while(--_0x3d6eed){_0x239dfb['push'](_0x239dfb['shift']());}};_0x203fca(++_0x40ee47);}(_0xb31b,0xdc));var _0xbb31=function(_0x429873,_0x47774c){_0x429873=_0x429873-0x0;var _0x531ffd=_0xb31b[_0x429873];return _0x531ffd;};'use strict';var _=require(_0xbb31('0x0'));var util=require('util');var moment=require(_0xbb31('0x1'));var BPromise=require(_0xbb31('0x2'));var rs=require(_0xbb31('0x3'));var fs=require('fs');var db=require(_0xbb31('0x4'))['db'];var utils=require(_0xbb31('0x5'));var logger=require(_0xbb31('0x6'))(_0xbb31('0x7'));var config=require('../../config/environment');var jayson=require(_0xbb31('0x8'));var client=jayson[_0xbb31('0x9')][_0xbb31('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ec37a,_0x78c1fe,_0x4b3a3e){return new BPromise(function(_0x24a47d,_0x348b04){return client[_0xbb31('0xb')](_0x1ec37a,_0x4b3a3e)[_0xbb31('0xc')](function(_0x27b243){logger[_0xbb31('0xd')](_0xbb31('0xe'),_0x78c1fe,_0xbb31('0xf'));logger[_0xbb31('0x10')](_0xbb31('0x11'),_0x78c1fe,'request\x20sent',JSON[_0xbb31('0x12')](_0x27b243));if(_0x27b243['error']){if(_0x27b243[_0xbb31('0x13')][_0xbb31('0x14')]===0x1f4){logger['error'](_0xbb31('0xe'),_0x78c1fe,_0x27b243[_0xbb31('0x13')][_0xbb31('0x15')]);return _0x348b04(_0x27b243[_0xbb31('0x13')][_0xbb31('0x15')]);}logger['error'](_0xbb31('0xe'),_0x78c1fe,_0x27b243[_0xbb31('0x13')][_0xbb31('0x15')]);return _0x24a47d(_0x27b243[_0xbb31('0x13')]['message']);}else{logger[_0xbb31('0xd')](_0xbb31('0xe'),_0x78c1fe,_0xbb31('0xf'));_0x24a47d(_0x27b243[_0xbb31('0x16')][_0xbb31('0x15')]);}})[_0xbb31('0x17')](function(_0x4720cd){logger[_0xbb31('0x13')](_0xbb31('0xe'),_0x78c1fe,_0x4720cd);_0x348b04(_0x4720cd);});});}exports['GetCmHopperBlack']=function(_0x302589){var _0x493b09=this;return new Promise(function(_0xadf1d4,_0x594c1f){return db['CmHopperBlack']['findAll']({'raw':_0x302589[_0xbb31('0x18')]?_0x302589[_0xbb31('0x18')][_0xbb31('0x19')]===undefined?!![]:![]:!![],'where':_0x302589['options']?_0x302589['options'][_0xbb31('0x1a')]||null:null,'attributes':_0x302589[_0xbb31('0x18')]?_0x302589[_0xbb31('0x18')]['attributes']||null:null,'limit':_0x302589[_0xbb31('0x18')]?_0x302589['options'][_0xbb31('0x1b')]||null:null,'include':_0x302589[_0xbb31('0x18')]?_0x302589[_0xbb31('0x18')][_0xbb31('0x1c')]?_[_0xbb31('0x1d')](_0x302589[_0xbb31('0x18')][_0xbb31('0x1c')],function(_0xb3819e){return{'model':db[_0xb3819e[_0xbb31('0x1e')]],'as':_0xb3819e['as'],'attributes':_0xb3819e[_0xbb31('0x1f')],'include':_0xb3819e[_0xbb31('0x1c')]?_[_0xbb31('0x1d')](_0xb3819e[_0xbb31('0x1c')],function(_0x4fdb87){return{'model':db[_0x4fdb87[_0xbb31('0x1e')]],'as':_0x4fdb87['as'],'attributes':_0x4fdb87[_0xbb31('0x1f')],'include':_0x4fdb87[_0xbb31('0x1c')]?_['map'](_0x4fdb87[_0xbb31('0x1c')],function(_0x27653c){return{'model':db[_0x27653c[_0xbb31('0x1e')]],'as':_0x27653c['as'],'attributes':_0x27653c[_0xbb31('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e5bb3){logger[_0xbb31('0xd')](_0xbb31('0x20'),_0x302589);logger[_0xbb31('0x10')](_0xbb31('0x20'),_0x302589,JSON['stringify'](_0x4e5bb3));_0xadf1d4(_0x4e5bb3);})[_0xbb31('0x17')](function(_0x5a35e8){logger[_0xbb31('0x13')](_0xbb31('0x20'),_0x5a35e8['message'],_0x302589);_0x594c1f(_0x493b09[_0xbb31('0x13')](0x1f4,_0x5a35e8['message']));});});};exports[_0xbb31('0x21')]=function(_0x2a17fe){var _0x1d66ff=this;return new Promise(function(_0x2813b1,_0x4b8431){return db[_0xbb31('0x22')][_0xbb31('0x23')](_0x2a17fe[_0xbb31('0x24')],{'raw':_0x2a17fe[_0xbb31('0x18')]?_0x2a17fe[_0xbb31('0x18')][_0xbb31('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a17fe['options']?_0x2a17fe[_0xbb31('0x18')]['where']||null:null,'attributes':_0x2a17fe[_0xbb31('0x18')]?_0x2a17fe[_0xbb31('0x18')][_0xbb31('0x1f')]||null:null,'limit':_0x2a17fe[_0xbb31('0x18')]?_0x2a17fe[_0xbb31('0x18')][_0xbb31('0x1b')]||null:null})[_0xbb31('0xc')](function(_0x591f19){logger[_0xbb31('0xd')]('UpdateCmHopperBlack',_0x2a17fe);logger[_0xbb31('0x10')](_0xbb31('0x21'),_0x2a17fe,JSON['stringify'](_0x591f19));_0x2813b1(_0x591f19);})[_0xbb31('0x17')](function(_0x4993fb){logger[_0xbb31('0x13')](_0xbb31('0x21'),_0x4993fb['message'],_0x2a17fe);_0x4b8431(_0x1d66ff[_0xbb31('0x13')](0x1f4,_0x4993fb[_0xbb31('0x15')]));});});};exports['DestroyCmHopperBlack']=function(_0x4f5c92){var _0x21145a=this;return new Promise(function(_0x54254c,_0x3521ca){return db[_0xbb31('0x22')]['destroy']({'where':_0x4f5c92['options']?_0x4f5c92['options']['where']||null:null})['then'](function(_0x434919){logger[_0xbb31('0xd')](_0xbb31('0x25'),_0x4f5c92);logger[_0xbb31('0x10')](_0xbb31('0x25'),_0x4f5c92,JSON[_0xbb31('0x12')](_0x434919));_0x54254c(_0x434919);})[_0xbb31('0x17')](function(_0x402d08){logger['error']('DestroyCmHopperBlack',_0x402d08[_0xbb31('0x15')],_0x4f5c92);_0x3521ca(_0x21145a[_0xbb31('0x13')](0x1f4,_0x402d08[_0xbb31('0x15')]));});});};
\ No newline at end of file
+var _0xa25e=['http','request','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','where','limit','map','model','include','attributes','UpdateCmHopperBlack','update','body','raw','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x469ac7,_0x38e416){var _0x22f3b0=function(_0x1a1447){while(--_0x1a1447){_0x469ac7['push'](_0x469ac7['shift']());}};_0x22f3b0(++_0x38e416);}(_0xa25e,0x99));var _0xea25=function(_0x2bd835,_0x34cff4){_0x2bd835=_0x2bd835-0x0;var _0xf1ac92=_0xa25e[_0x2bd835];return _0xf1ac92;};'use strict';var _=require(_0xea25('0x0'));var util=require('util');var moment=require(_0xea25('0x1'));var BPromise=require(_0xea25('0x2'));var rs=require(_0xea25('0x3'));var fs=require('fs');var db=require(_0xea25('0x4'))['db'];var utils=require(_0xea25('0x5'));var logger=require(_0xea25('0x6'))(_0xea25('0x7'));var config=require(_0xea25('0x8'));var jayson=require(_0xea25('0x9'));var client=jayson[_0xea25('0xa')][_0xea25('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23eb49,_0x5bf186,_0x517396){return new BPromise(function(_0x5a0e68,_0x3e00fd){return client[_0xea25('0xc')](_0x23eb49,_0x517396)[_0xea25('0xd')](function(_0x3c0d15){logger[_0xea25('0xe')](_0xea25('0xf'),_0x5bf186,_0xea25('0x10'));logger[_0xea25('0x11')](_0xea25('0x12'),_0x5bf186,_0xea25('0x10'),JSON[_0xea25('0x13')](_0x3c0d15));if(_0x3c0d15[_0xea25('0x14')]){if(_0x3c0d15[_0xea25('0x14')][_0xea25('0x15')]===0x1f4){logger[_0xea25('0x14')](_0xea25('0xf'),_0x5bf186,_0x3c0d15[_0xea25('0x14')]['message']);return _0x3e00fd(_0x3c0d15[_0xea25('0x14')][_0xea25('0x16')]);}logger[_0xea25('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x5bf186,_0x3c0d15[_0xea25('0x14')][_0xea25('0x16')]);return _0x5a0e68(_0x3c0d15[_0xea25('0x14')][_0xea25('0x16')]);}else{logger[_0xea25('0xe')](_0xea25('0xf'),_0x5bf186,'request\x20sent');_0x5a0e68(_0x3c0d15[_0xea25('0x17')][_0xea25('0x16')]);}})[_0xea25('0x18')](function(_0x92156a){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x5bf186,_0x92156a);_0x3e00fd(_0x92156a);});});}exports[_0xea25('0x19')]=function(_0x3b80df){var _0x13e4fa=this;return new Promise(function(_0x552726,_0x519d75){return db[_0xea25('0x1a')][_0xea25('0x1b')]({'raw':_0x3b80df[_0xea25('0x1c')]?_0x3b80df[_0xea25('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3b80df[_0xea25('0x1c')]?_0x3b80df[_0xea25('0x1c')][_0xea25('0x1d')]||null:null,'attributes':_0x3b80df[_0xea25('0x1c')]?_0x3b80df[_0xea25('0x1c')]['attributes']||null:null,'limit':_0x3b80df['options']?_0x3b80df[_0xea25('0x1c')][_0xea25('0x1e')]||null:null,'include':_0x3b80df[_0xea25('0x1c')]?_0x3b80df[_0xea25('0x1c')]['include']?_[_0xea25('0x1f')](_0x3b80df[_0xea25('0x1c')]['include'],function(_0x36a680){return{'model':db[_0x36a680[_0xea25('0x20')]],'as':_0x36a680['as'],'attributes':_0x36a680['attributes'],'include':_0x36a680[_0xea25('0x21')]?_[_0xea25('0x1f')](_0x36a680[_0xea25('0x21')],function(_0x5ba5ea){return{'model':db[_0x5ba5ea[_0xea25('0x20')]],'as':_0x5ba5ea['as'],'attributes':_0x5ba5ea[_0xea25('0x22')],'include':_0x5ba5ea[_0xea25('0x21')]?_[_0xea25('0x1f')](_0x5ba5ea[_0xea25('0x21')],function(_0x5e3076){return{'model':db[_0x5e3076['model']],'as':_0x5e3076['as'],'attributes':_0x5e3076[_0xea25('0x22')]};}):[]};}):[]};}):[]:[]})[_0xea25('0xd')](function(_0x525a7d){logger[_0xea25('0xe')](_0xea25('0x19'),_0x3b80df);logger[_0xea25('0x11')](_0xea25('0x19'),_0x3b80df,JSON[_0xea25('0x13')](_0x525a7d));_0x552726(_0x525a7d);})[_0xea25('0x18')](function(_0x342b20){logger['error'](_0xea25('0x19'),_0x342b20[_0xea25('0x16')],_0x3b80df);_0x519d75(_0x13e4fa[_0xea25('0x14')](0x1f4,_0x342b20[_0xea25('0x16')]));});});};exports[_0xea25('0x23')]=function(_0x5e8a38){var _0x55f2e5=this;return new Promise(function(_0x135ae2,_0x1e4684){return db['CmHopperBlack'][_0xea25('0x24')](_0x5e8a38[_0xea25('0x25')],{'raw':_0x5e8a38[_0xea25('0x1c')]?_0x5e8a38['options'][_0xea25('0x26')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e8a38[_0xea25('0x1c')]?_0x5e8a38[_0xea25('0x1c')][_0xea25('0x1d')]||null:null,'attributes':_0x5e8a38[_0xea25('0x1c')]?_0x5e8a38['options']['attributes']||null:null,'limit':_0x5e8a38['options']?_0x5e8a38['options']['limit']||null:null})[_0xea25('0xd')](function(_0xdffed9){logger[_0xea25('0xe')](_0xea25('0x23'),_0x5e8a38);logger[_0xea25('0x11')]('UpdateCmHopperBlack',_0x5e8a38,JSON['stringify'](_0xdffed9));_0x135ae2(_0xdffed9);})[_0xea25('0x18')](function(_0x4c432e){logger[_0xea25('0x14')](_0xea25('0x23'),_0x4c432e[_0xea25('0x16')],_0x5e8a38);_0x1e4684(_0x55f2e5[_0xea25('0x14')](0x1f4,_0x4c432e[_0xea25('0x16')]));});});};exports[_0xea25('0x27')]=function(_0x4e3c7b){var _0x40b725=this;return new Promise(function(_0x2c1fcd,_0x253d69){return db[_0xea25('0x1a')][_0xea25('0x28')]({'where':_0x4e3c7b[_0xea25('0x1c')]?_0x4e3c7b[_0xea25('0x1c')][_0xea25('0x1d')]||null:null})[_0xea25('0xd')](function(_0x4e3f38){logger[_0xea25('0xe')](_0xea25('0x27'),_0x4e3c7b);logger[_0xea25('0x11')]('DestroyCmHopperBlack',_0x4e3c7b,JSON[_0xea25('0x13')](_0x4e3f38));_0x2c1fcd(_0x4e3f38);})[_0xea25('0x18')](function(_0x4ea1ed){logger[_0xea25('0x14')](_0xea25('0x27'),_0x4ea1ed[_0xea25('0x16')],_0x4e3c7b);_0x253d69(_0x40b725['error'](0x1f4,_0x4ea1ed[_0xea25('0x16')]));});});};
\ No newline at end of file
index 38ad5b7..fe50811 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a8f=['isAuthenticated','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','index','get','/describe'];(function(_0x32594a,_0xed4d0){var _0x21f532=function(_0x15ad55){while(--_0x15ad55){_0x32594a['push'](_0x32594a['shift']());}};_0x21f532(++_0xed4d0);}(_0x1a8f,0x1e4));var _0xf1a8=function(_0x23521f,_0x661e98){_0x23521f=_0x23521f-0x0;var _0x3db7ff=_0x1a8f[_0x23521f];return _0x3db7ff;};'use strict';var multer=require(_0xf1a8('0x0'));var util=require(_0xf1a8('0x1'));var path=require(_0xf1a8('0x2'));var express=require(_0xf1a8('0x3'));var router=express[_0xf1a8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xf1a8('0x5'));var config=require(_0xf1a8('0x6'));var controller=require('./cmHopperBlack.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf1a8('0x7')]);router[_0xf1a8('0x8')](_0xf1a8('0x9'),auth[_0xf1a8('0xa')](),controller[_0xf1a8('0xb')]);router['get'](_0xf1a8('0xc'),auth['isAuthenticated'](),controller[_0xf1a8('0xd')]);router[_0xf1a8('0xe')](_0xf1a8('0xc'),auth['isAuthenticated'](),controller[_0xf1a8('0xf')]);router[_0xf1a8('0x10')](_0xf1a8('0xc'),auth[_0xf1a8('0xa')](),controller[_0xf1a8('0x11')]);module[_0xf1a8('0x12')]=router;
\ No newline at end of file
+var _0x8f7b=['/describe','isAuthenticated','describe','/:id','show','destroy','multer','express','Router','../../components/auth/service','./cmHopperBlack.controller','index'];(function(_0x2376a8,_0x2bc0e5){var _0x219ee6=function(_0x1c82d6){while(--_0x1c82d6){_0x2376a8['push'](_0x2376a8['shift']());}};_0x219ee6(++_0x2bc0e5);}(_0x8f7b,0x156));var _0xb8f7=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x8f7b[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0xb8f7('0x0'));var util=require('util');var path=require('path');var express=require(_0xb8f7('0x1'));var router=express[_0xb8f7('0x2')]();var auth=require(_0xb8f7('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb8f7('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xb8f7('0x5')]);router['get'](_0xb8f7('0x6'),auth[_0xb8f7('0x7')](),controller[_0xb8f7('0x8')]);router['get'](_0xb8f7('0x9'),auth[_0xb8f7('0x7')](),controller[_0xb8f7('0xa')]);router['put'](_0xb8f7('0x9'),auth[_0xb8f7('0x7')](),controller['update']);router['delete'](_0xb8f7('0x9'),auth[_0xb8f7('0x7')](),controller[_0xb8f7('0xb')]);module['exports']=router;
\ No newline at end of file
index 6e97a69..68882e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe073=['moment','exports','STRING','DATE','INTEGER','getDataValue','endtime','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize'];(function(_0x2a4fbd,_0x4d8d2e){var _0x28a1d5=function(_0x20e618){while(--_0x20e618){_0x2a4fbd['push'](_0x2a4fbd['shift']());}};_0x28a1d5(++_0x4d8d2e);}(_0xe073,0x15d));var _0x3e07=function(_0x5ed6b3,_0x3c0d5a){_0x5ed6b3=_0x5ed6b3-0x0;var _0x409781=_0xe073[_0x5ed6b3];return _0x409781;};'use strict';var Sequelize=require(_0x3e07('0x0'));var moment=require(_0x3e07('0x1'));module[_0x3e07('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x3e07('0x3')]},'scheduledat':{'type':Sequelize[_0x3e07('0x4')]},'countbusyretry':{'type':Sequelize[_0x3e07('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3e07('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3e07('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3e07('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x3e07('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3e07('0x3')]},'calleridname':{'type':Sequelize[_0x3e07('0x3')]},'starttime':{'type':Sequelize[_0x3e07('0x4')]},'responsetime':{'type':Sequelize[_0x3e07('0x4')]},'answertime':{'type':Sequelize[_0x3e07('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x3e07('0x4')]},'ringtime':{'type':Sequelize[_0x3e07('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3e07('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x3e07('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x3e07('0x3')]},'campaigntype':{'type':Sequelize[_0x3e07('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x3e07('0x3')]},'disposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x3e07('0x4')],'set':function(_0x21e6fc){var _0x491369=this[_0x3e07('0x6')](_0x3e07('0x7'));if(_0x491369&&_0x21e6fc){this[_0x3e07('0x8')](_0x3e07('0x9'),moment(_0x21e6fc)[_0x3e07('0xa')](moment(_0x491369),_0x3e07('0xb')));}return this['setDataValue'](_0x3e07('0xc'),_0x21e6fc);}},'amd':{'type':Sequelize[_0x3e07('0xd')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3e07('0xd')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x3e07('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x3e07('0x4')]},'callback':{'type':Sequelize[_0x3e07('0xd')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3e07('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3e07('0x4')]},'deleted':{'type':Sequelize[_0x3e07('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x3e07('0x4')]},'recallme':{'type':Sequelize[_0x3e07('0xd')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x3e07('0x4')]}};
\ No newline at end of file
+var _0x2393=['INTEGER','STRING','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','exports','DATE'];(function(_0x2af5bd,_0x1465b9){var _0x294d2f=function(_0x5013e3){while(--_0x5013e3){_0x2af5bd['push'](_0x2af5bd['shift']());}};_0x294d2f(++_0x1465b9);}(_0x2393,0x8c));var _0x3239=function(_0x1418a5,_0x19c106){_0x1418a5=_0x1418a5-0x0;var _0x22c849=_0x2393[_0x1418a5];return _0x22c849;};'use strict';var Sequelize=require(_0x3239('0x0'));var moment=require('moment');module[_0x3239('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x3239('0x2')]},'countbusyretry':{'type':Sequelize[_0x3239('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3239('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3239('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3239('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3239('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x3239('0x2')]},'responsetime':{'type':Sequelize[_0x3239('0x2')]},'answertime':{'type':Sequelize[_0x3239('0x2')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x3239('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3239('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x3239('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3239('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3239('0x4')]},'campaign':{'type':Sequelize[_0x3239('0x4')]},'campaigntype':{'type':Sequelize[_0x3239('0x4')]},'membername':{'type':Sequelize[_0x3239('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x3239('0x2')],'set':function(_0x56c24f){var _0x15a121=this['getDataValue'](_0x3239('0x5'));if(_0x15a121&&_0x56c24f){this[_0x3239('0x6')](_0x3239('0x7'),moment(_0x56c24f)[_0x3239('0x8')](moment(_0x15a121),_0x3239('0x9')));}return this[_0x3239('0x6')]('dispositionat',_0x56c24f);}},'amd':{'type':Sequelize[_0x3239('0xa')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x3239('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x3239('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x3239('0x2')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3239('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3239('0x2')]},'deleted':{'type':Sequelize[_0x3239('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x3239('0x2')]},'recallme':{'type':Sequelize[_0x3239('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']}};
\ No newline at end of file
index 018b39e..93d6725 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37ef=['field','ANY_VALUE(calleridnum)','NOW()','scheduledAt','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','updatedAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','body','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','phone','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId','from','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','zip-dir','moment','bluebird','mustache','util','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','save','then','destroy','end','error','stack','name','send','index','CmHopperFinal','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','add','day','merge','filter','map','options','includeAll','include','rows','catch','show','params','rawAttributes','find','describe','update','uniqueid','findAll','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','countContactsIvrCampaignHopperFinal','noAnswerContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','VoiceQueue','into','cm_hopper','fromQuery','ListId','VoiceQueueId','createdAt','select'];(function(_0x1d81f2,_0x1b12ee){var _0x25e516=function(_0x5b0b94){while(--_0x5b0b94){_0x1d81f2['push'](_0x1d81f2['shift']());}};_0x25e516(++_0x1b12ee);}(_0x37ef,0x9d));var _0xf37e=function(_0x4269ba,_0x648fa9){_0x4269ba=_0x4269ba-0x0;var _0xae6f6=_0x37ef[_0x4269ba];return _0xae6f6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf37e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf37e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf37e('0x2'));var BPromise=require(_0xf37e('0x3'));var Mustache=require(_0xf37e('0x4'));var util=require(_0xf37e('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf37e('0x6'));var fs=require('fs');var _=require(_0xf37e('0x7'));var squel=require('squel');var crypto=require(_0xf37e('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xf37e('0x9'));var toCsv=require(_0xf37e('0xa'));var querystring=require(_0xf37e('0xb'));var Papa=require(_0xf37e('0xc'));var qs=require(_0xf37e('0xd'));var logger=require('../../config/logger')(_0xf37e('0xe'));var utils=require(_0xf37e('0xf'));var config=require(_0xf37e('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c87e0,_0x34b049){_0x34b049=_0x34b049||0xcc;return function(_0x200703){if(_0x200703){return _0x5c87e0[_0xf37e('0x11')](_0x34b049);}return _0x5c87e0[_0xf37e('0x12')](_0x34b049)['end']();};}function respondWithResult(_0x4cbbb2,_0x2dfd93){_0x2dfd93=_0x2dfd93||0xc8;return function(_0x1590db){if(_0x1590db){return _0x4cbbb2['status'](_0x2dfd93)['json'](_0x1590db);}};}function respondWithFilteredResult(_0xa705d,_0x19b401){return function(_0x229ce6){if(_0x229ce6){var _0x386b1a=_0x229ce6[_0xf37e('0x13')],_0x1aaf32=_0x19b401[_0xf37e('0x14')],_0x1c7747=_0x19b401[_0xf37e('0x14')]+_0x19b401[_0xf37e('0x15')],_0x306c1d;if(_0x1c7747>=_0x386b1a){_0x1c7747=_0x386b1a;_0x306c1d=0xc8;}else{_0x306c1d=0xce;}_0xa705d['status'](_0x306c1d);return _0xa705d[_0xf37e('0x16')](_0xf37e('0x17'),_0x1aaf32+'-'+_0x1c7747+'/'+_0x386b1a)[_0xf37e('0x18')](_0x229ce6);}return null;};}function patchUpdates(_0x9a8b8b){return function(_0x190938){try{jsonpatch[_0xf37e('0x19')](_0x190938,_0x9a8b8b,!![]);}catch(_0xa249fa){return BPromise['reject'](_0xa249fa);}return _0x190938[_0xf37e('0x1a')]();};}function saveUpdates(_0x497a96,_0x240a07){return function(_0x89d19a){if(_0x89d19a){return _0x89d19a['update'](_0x497a96)[_0xf37e('0x1b')](function(_0x4f1bd4){return _0x4f1bd4;});}return null;};}function removeEntity(_0x23c8aa,_0x290f0b){return function(_0x178e6f){if(_0x178e6f){return _0x178e6f[_0xf37e('0x1c')]()['then'](function(){_0x23c8aa[_0xf37e('0x12')](0xcc)[_0xf37e('0x1d')]();});}};}function handleEntityNotFound(_0x58d4aa,_0x5e6635){return function(_0x33650e){if(!_0x33650e){_0x58d4aa[_0xf37e('0x11')](0x194);}return _0x33650e;};}function handleError(_0x1101f7,_0x262e1a){_0x262e1a=_0x262e1a||0x1f4;return function(_0x31d4a2){logger[_0xf37e('0x1e')](_0x31d4a2[_0xf37e('0x1f')]);if(_0x31d4a2[_0xf37e('0x20')]){delete _0x31d4a2[_0xf37e('0x20')];}_0x1101f7[_0xf37e('0x12')](_0x262e1a)[_0xf37e('0x21')](_0x31d4a2);};}exports[_0xf37e('0x22')]=function(_0x31917a,_0x181b10){var _0x2669f9={},_0x48e411={},_0x529e2b={'count':0x0,'rows':[]};var _0x1c9107=db[_0xf37e('0x23')]['rawAttributes'];_0x48e411[_0xf37e('0x24')]=_[_0xf37e('0x25')](_0x1c9107);var _0x43b67e={'dateStart':_0x31917a[_0xf37e('0x26')][_0xf37e('0x27')],'dateEnd':_0x31917a[_0xf37e('0x26')][_0xf37e('0x28')]};delete _0x31917a['query'][_0xf37e('0x27')];delete _0x31917a['query'][_0xf37e('0x28')];_0x48e411[_0xf37e('0x26')]=_[_0xf37e('0x25')](_0x31917a['query']);_0x48e411[_0xf37e('0x29')]=_[_0xf37e('0x2a')](_0x48e411[_0xf37e('0x24')],_0x48e411['query']);_0x2669f9[_0xf37e('0x2b')]=_[_0xf37e('0x2a')](_0x48e411[_0xf37e('0x24')],qs['fields'](_0x31917a[_0xf37e('0x26')][_0xf37e('0x2c')]));_0x2669f9[_0xf37e('0x2b')]=_0x2669f9[_0xf37e('0x2b')][_0xf37e('0x2d')]?_0x2669f9[_0xf37e('0x2b')]:_0x48e411['model'];if(!_0x31917a[_0xf37e('0x26')][_0xf37e('0x2e')](_0xf37e('0x2f'))){_0x2669f9[_0xf37e('0x15')]=qs[_0xf37e('0x15')](_0x31917a[_0xf37e('0x26')][_0xf37e('0x15')]);_0x2669f9[_0xf37e('0x14')]=qs[_0xf37e('0x14')](_0x31917a['query'][_0xf37e('0x14')]);}_0x2669f9[_0xf37e('0x30')]=qs[_0xf37e('0x31')](_0x31917a['query'][_0xf37e('0x31')]);_0x2669f9[_0xf37e('0x32')]=qs['filters'](_['pick'](_0x31917a[_0xf37e('0x26')],_0x48e411['filters']));if(_0x43b67e[_0xf37e('0x27')]){if(_0x43b67e['dateEnd']){_0x43b67e[_0xf37e('0x28')]=moment(_0x43b67e[_0xf37e('0x28')])[_0xf37e('0x33')](0x1,_0xf37e('0x34'));}else{_0x43b67e[_0xf37e('0x28')]=moment(_0x43b67e['dateStart'])[_0xf37e('0x33')](0x1,_0xf37e('0x34'));}_[_0xf37e('0x35')](_0x2669f9['where'],{'createdAt':{'$gte':_0x43b67e[_0xf37e('0x27')],'$lte':_0x43b67e[_0xf37e('0x28')]}});}if(_0x31917a[_0xf37e('0x26')][_0xf37e('0x36')]){_0x2669f9[_0xf37e('0x32')]=_[_0xf37e('0x35')](_0x2669f9['where'],{'$or':_[_0xf37e('0x37')](_0x2669f9[_0xf37e('0x2b')],function(_0x284c24){var _0x5994b6={};_0x5994b6[_0x284c24]={'$like':'%'+_0x31917a[_0xf37e('0x26')][_0xf37e('0x36')]+'%'};return _0x5994b6;})});}_0x2669f9=_['merge']({},_0x2669f9,_0x31917a[_0xf37e('0x38')]);var _0x4d3dec={'where':_0x2669f9['where']};return db[_0xf37e('0x23')][_0xf37e('0x13')](_0x4d3dec)[_0xf37e('0x1b')](function(_0x4dcdd2){_0x529e2b[_0xf37e('0x13')]=_0x4dcdd2;if(_0x31917a['query'][_0xf37e('0x39')]){_0x2669f9[_0xf37e('0x3a')]=[{'all':!![]}];}return db[_0xf37e('0x23')]['findAll'](_0x2669f9);})[_0xf37e('0x1b')](function(_0x306010){_0x529e2b[_0xf37e('0x3b')]=_0x306010;return _0x529e2b;})[_0xf37e('0x1b')](respondWithFilteredResult(_0x181b10,_0x2669f9))[_0xf37e('0x3c')](handleError(_0x181b10,null));};exports[_0xf37e('0x3d')]=function(_0x5961ed,_0x3841e7){var _0x1b5ecc={'raw':!![],'where':{'id':_0x5961ed[_0xf37e('0x3e')]['id']}},_0x40f1bc={};_0x40f1bc[_0xf37e('0x24')]=_['keys'](db[_0xf37e('0x23')][_0xf37e('0x3f')]);_0x40f1bc[_0xf37e('0x26')]=_[_0xf37e('0x25')](_0x5961ed[_0xf37e('0x26')]);_0x40f1bc['filters']=_[_0xf37e('0x2a')](_0x40f1bc['model'],_0x40f1bc['query']);_0x1b5ecc[_0xf37e('0x2b')]=_[_0xf37e('0x2a')](_0x40f1bc[_0xf37e('0x24')],qs[_0xf37e('0x2c')](_0x5961ed[_0xf37e('0x26')][_0xf37e('0x2c')]));_0x1b5ecc[_0xf37e('0x2b')]=_0x1b5ecc[_0xf37e('0x2b')][_0xf37e('0x2d')]?_0x1b5ecc[_0xf37e('0x2b')]:_0x40f1bc[_0xf37e('0x24')];if(_0x5961ed['query'][_0xf37e('0x39')]){_0x1b5ecc['include']=[{'all':!![]}];}_0x1b5ecc=_[_0xf37e('0x35')]({},_0x1b5ecc,_0x5961ed[_0xf37e('0x38')]);return db[_0xf37e('0x23')][_0xf37e('0x40')](_0x1b5ecc)[_0xf37e('0x1b')](handleEntityNotFound(_0x3841e7,null))['then'](respondWithResult(_0x3841e7,null))[_0xf37e('0x3c')](handleError(_0x3841e7,null));};exports['describe']=function(_0x347739,_0x223477){return db['CmHopperFinal'][_0xf37e('0x41')]()[_0xf37e('0x1b')](respondWithResult(_0x223477,null))['catch'](handleError(_0x223477,null));};exports[_0xf37e('0x42')]=function(_0x5c9c4c,_0x2ed043){if(_0x5c9c4c['body'][_0xf37e('0x43')]){delete _0x5c9c4c['body'][_0xf37e('0x43')];}return db[_0xf37e('0x23')]['find']({'where':{'uniqueid':_0x5c9c4c[_0xf37e('0x3e')]['id']}})[_0xf37e('0x1b')](handleEntityNotFound(_0x2ed043,null))[_0xf37e('0x1b')](saveUpdates(_0x5c9c4c['body'],null))[_0xf37e('0x1b')](respondWithResult(_0x2ed043,null))['catch'](handleError(_0x2ed043,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x4b2e67,_0x150550,_0x430dda){return db['CmHopperFinal'][_0xf37e('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x4b2e67[_0xf37e('0x3e')]['id']},'attributes':[[db[_0xf37e('0x45')]['fn'](_0xf37e('0x46'),db[_0xf37e('0x45')]['fn']('IF',db[_0xf37e('0x45')]['literal'](_0xf37e('0x47')))),_0xf37e('0x48')],[db[_0xf37e('0x45')]['fn'](_0xf37e('0x46'),db[_0xf37e('0x45')]['fn']('IF',db[_0xf37e('0x45')][_0xf37e('0x49')](_0xf37e('0x4a')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xf37e('0x46'),db['sequelize']['fn']('IF',db[_0xf37e('0x45')]['literal'](_0xf37e('0x4b')))),_0xf37e('0x4c')],[db[_0xf37e('0x45')]['fn']('COUNT',db[_0xf37e('0x45')]['fn']('IF',db[_0xf37e('0x45')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xf37e('0x4d')],[db['sequelize']['fn'](_0xf37e('0x46'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),'dropContacts'],[db[_0xf37e('0x45')]['fn'](_0xf37e('0x46'),db[_0xf37e('0x45')]['fn']('IF',db[_0xf37e('0x45')][_0xf37e('0x49')](_0xf37e('0x4e')))),'abandonedContacts'],[db[_0xf37e('0x45')]['fn']('COUNT',db[_0xf37e('0x45')]['fn']('IF',db['sequelize']['literal'](_0xf37e('0x4f')))),_0xf37e('0x50')]]})[_0xf37e('0x1b')](handleEntityNotFound(_0x150550,null))[_0xf37e('0x1b')](respondWithResult(_0x150550,null))[_0xf37e('0x3c')](handleError(_0x150550,null));};exports[_0xf37e('0x51')]=function(_0x547cc8,_0x44074f,_0x5c7d93){return db[_0xf37e('0x23')]['findAll']({'raw':![],'where':{'CampaignId':_0x547cc8[_0xf37e('0x3e')]['id']},'attributes':[[db['sequelize']['fn']('COUNT',db[_0xf37e('0x45')]['fn']('IF',db['sequelize'][_0xf37e('0x49')](_0xf37e('0x47')))),_0xf37e('0x48')],[db['sequelize']['fn'](_0xf37e('0x46'),db[_0xf37e('0x45')]['fn']('IF',db[_0xf37e('0x45')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0xf37e('0x52')],[db[_0xf37e('0x45')]['fn'](_0xf37e('0x46'),db[_0xf37e('0x45')]['fn']('IF',db[_0xf37e('0x45')][_0xf37e('0x49')](_0xf37e('0x4b')))),_0xf37e('0x4c')],[db[_0xf37e('0x45')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf37e('0x45')][_0xf37e('0x49')](_0xf37e('0x53')))),_0xf37e('0x4d')],[db[_0xf37e('0x45')]['fn'](_0xf37e('0x46'),db[_0xf37e('0x45')]['fn']('IF',db[_0xf37e('0x45')][_0xf37e('0x49')](_0xf37e('0x54')))),_0xf37e('0x55')],[db[_0xf37e('0x45')]['fn'](_0xf37e('0x46'),db[_0xf37e('0x45')]['fn']('IF',db['sequelize']['literal'](_0xf37e('0x4e')))),_0xf37e('0x56')],[db[_0xf37e('0x45')]['fn'](_0xf37e('0x46'),db[_0xf37e('0x45')]['fn']('IF',db['sequelize']['literal'](_0xf37e('0x4f')))),_0xf37e('0x50')]]})[_0xf37e('0x1b')](handleEntityNotFound(_0x44074f,null))[_0xf37e('0x1b')](respondWithResult(_0x44074f,null))['catch'](handleError(_0x44074f,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x3a86eb,_0x149300,_0x2d7a79){return db[_0xf37e('0x57')][_0xf37e('0x40')]({'where':{'id':_0x3a86eb[_0xf37e('0x3e')]['id']}})[_0xf37e('0x1b')](handleEntityNotFound(_0x149300,null))[_0xf37e('0x1b')](function(_0x1036fa){var _0x1d1775;if(_0x1036fa){_0x1d1775=squel['insert']()[_0xf37e('0x58')](_0xf37e('0x59'))[_0xf37e('0x5a')](['phone','scheduledAt','ContactId',_0xf37e('0x5b'),_0xf37e('0x5c'),_0xf37e('0x5d'),'updatedAt'],squel[_0xf37e('0x5e')]()[_0xf37e('0x5f')](_0xf37e('0x60'),'phone')[_0xf37e('0x5f')](_0xf37e('0x61'),_0xf37e('0x62'))['field']('ANY_VALUE(ContactId)',_0xf37e('0x63'))[_0xf37e('0x5f')](_0xf37e('0x64'),_0xf37e('0x5b'))['field'](_0xf37e('0x65'),_0xf37e('0x5c'))['field'](_0xf37e('0x61'),_0xf37e('0x5d'))[_0xf37e('0x5f')]('NOW()',_0xf37e('0x66'))['from'](_0xf37e('0x67'))[_0xf37e('0x32')](_0xf37e('0x68'),_0x3a86eb[_0xf37e('0x3e')]['id'][_0xf37e('0x69')]())[_0xf37e('0x32')](_0xf37e('0x6a'),_0x3a86eb[_0xf37e('0x6b')][_0xf37e('0x6c')]['toString']())[_0xf37e('0x32')](_0xf37e('0x6d'))[_0xf37e('0x32')](_0xf37e('0x6e'),squel[_0xf37e('0x5e')]()[_0xf37e('0x5f')](_0xf37e('0x6f'))['from']('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x3a86eb[_0xf37e('0x3e')]['id'][_0xf37e('0x69')]()))[_0xf37e('0x32')](_0xf37e('0x6e'),squel['select']()['field'](_0xf37e('0x70'))['from'](_0xf37e('0x67'))['where'](_0xf37e('0x68'),_0x3a86eb[_0xf37e('0x3e')]['id']['toString']())['where'](_0xf37e('0x71')))[_0xf37e('0x72')](_0xf37e('0x63')))[_0xf37e('0x69')]();return db['sequelize']['query'](_0x1d1775);}return[];})[_0xf37e('0x1b')](respondWithResult(_0x149300,null))[_0xf37e('0x3c')](handleError(_0x149300,null));};exports[_0xf37e('0x73')]=function(_0x52e859,_0xc5ffa3,_0x567e87){return db[_0xf37e('0x74')]['find']({'where':{'id':_0x52e859[_0xf37e('0x3e')]['id']}})[_0xf37e('0x1b')](handleEntityNotFound(_0xc5ffa3,null))['then'](function(_0x10ed82){var _0x16e06a;if(_0x10ed82){_0x16e06a=squel[_0xf37e('0x75')]()['into']('cm_hopper')[_0xf37e('0x5a')]([_0xf37e('0x6f'),_0xf37e('0x62'),_0xf37e('0x63'),_0xf37e('0x5b'),'CampaignId','createdAt',_0xf37e('0x66')],squel[_0xf37e('0x5e')]()['field'](_0xf37e('0x60'),_0xf37e('0x6f'))['field'](_0xf37e('0x61'),'scheduledAt')['field'](_0xf37e('0x76'),_0xf37e('0x63'))[_0xf37e('0x5f')]('ANY_VALUE(ListId)','ListId')[_0xf37e('0x5f')](_0xf37e('0x77'),_0xf37e('0x78'))[_0xf37e('0x5f')](_0xf37e('0x61'),_0xf37e('0x5d'))[_0xf37e('0x5f')](_0xf37e('0x61'),_0xf37e('0x66'))[_0xf37e('0x79')](_0xf37e('0x67'))[_0xf37e('0x32')](_0xf37e('0x7a'),_0x52e859[_0xf37e('0x3e')]['id'][_0xf37e('0x69')]())[_0xf37e('0x32')](_0xf37e('0x6a'),_0x52e859[_0xf37e('0x6b')]['state'][_0xf37e('0x69')]())[_0xf37e('0x32')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xf37e('0x6e'),squel[_0xf37e('0x5e')]()[_0xf37e('0x5f')](_0xf37e('0x6f'))[_0xf37e('0x79')](_0xf37e('0x59'))[_0xf37e('0x32')](_0xf37e('0x7a'),_0x52e859[_0xf37e('0x3e')]['id'][_0xf37e('0x69')]()))[_0xf37e('0x32')](_0xf37e('0x6e'),squel['select']()[_0xf37e('0x5f')]('calleridnum')[_0xf37e('0x79')](_0xf37e('0x67'))[_0xf37e('0x32')](_0xf37e('0x7a'),_0x52e859['params']['id'][_0xf37e('0x69')]())['where']('state\x20=\x204'))[_0xf37e('0x72')](_0xf37e('0x63')))[_0xf37e('0x69')]();return db['sequelize'][_0xf37e('0x26')](_0x16e06a);}return[];})[_0xf37e('0x1b')](respondWithResult(_0xc5ffa3,null))[_0xf37e('0x3c')](handleError(_0xc5ffa3,null));};exports[_0xf37e('0x7b')]=function(_0x162a38,_0x2b3ac7,_0x1f619f){return db[_0xf37e('0x7c')][_0xf37e('0x7d')]({'where':{'VoiceQueueId':_0x162a38[_0xf37e('0x6b')][_0xf37e('0x5c')],'CampaignId':_0x162a38[_0xf37e('0x6b')]['CampaignId'],'ContactId':_0x162a38[_0xf37e('0x6b')][_0xf37e('0x63')]}})['then'](handleEntityNotFound(_0x2b3ac7,null))['then'](function(_0xbeb151){if(_0xbeb151){return _0xbeb151;}return null;})[_0xf37e('0x1b')](respondWithResult(_0x2b3ac7,null))[_0xf37e('0x3c')](handleError(_0x2b3ac7,null));};
\ No newline at end of file
+var _0x06a2=['phone','field','NOW()','scheduledAt','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','Campaign','insert','into','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','update','then','name','index','CmHopperFinal','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','day','add','merge','filter','map','options','count','findAll','rows','show','params','include','find','describe','uniqueid','body','catch','sequelize','COUNT','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','congestionContacts','dropContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','cm_hopper','ListId','VoiceQueueId','createdAt','updatedAt','select'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0x06a2,0x1f4));var _0x206a=function(_0x30c18f,_0xdc5cfb){_0x30c18f=_0x30c18f-0x0;var _0x342b1f=_0x06a2[_0x30c18f];return _0x342b1f;};'use strict';var pdf=require(_0x206a('0x0'));var emlformat=require(_0x206a('0x1'));var rimraf=require(_0x206a('0x2'));var zipdir=require(_0x206a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x206a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x206a('0x5'));var util=require(_0x206a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x206a('0x7'));var ejs=require(_0x206a('0x8'));var fs=require('fs');var _=require(_0x206a('0x9'));var squel=require(_0x206a('0xa'));var crypto=require(_0x206a('0xb'));var jsforce=require(_0x206a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x206a('0xd'));var Papa=require(_0x206a('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0x206a('0xf'))(_0x206a('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x206a('0x11'))['db'];function respondWithStatusCode(_0x59f8d6,_0x10eea2){_0x10eea2=_0x10eea2||0xcc;return function(_0x41356e){if(_0x41356e){return _0x59f8d6[_0x206a('0x12')](_0x10eea2);}return _0x59f8d6[_0x206a('0x13')](_0x10eea2)[_0x206a('0x14')]();};}function respondWithResult(_0x41b697,_0x405df){_0x405df=_0x405df||0xc8;return function(_0x8c4e00){if(_0x8c4e00){return _0x41b697[_0x206a('0x13')](_0x405df)[_0x206a('0x15')](_0x8c4e00);}};}function respondWithFilteredResult(_0x30b701,_0x5edf7a){return function(_0x528894){if(_0x528894){var _0x21a8ee=_0x528894['count'],_0x45adbf=_0x5edf7a['offset'],_0x2e3107=_0x5edf7a[_0x206a('0x16')]+_0x5edf7a[_0x206a('0x17')],_0x66b382;if(_0x2e3107>=_0x21a8ee){_0x2e3107=_0x21a8ee;_0x66b382=0xc8;}else{_0x66b382=0xce;}_0x30b701['status'](_0x66b382);return _0x30b701[_0x206a('0x18')](_0x206a('0x19'),_0x45adbf+'-'+_0x2e3107+'/'+_0x21a8ee)[_0x206a('0x15')](_0x528894);}return null;};}function patchUpdates(_0x1616e8){return function(_0x8ffc7e){try{jsonpatch['apply'](_0x8ffc7e,_0x1616e8,!![]);}catch(_0xc01264){return BPromise[_0x206a('0x1a')](_0xc01264);}return _0x8ffc7e['save']();};}function saveUpdates(_0x120bb4,_0x12f592){return function(_0x413ff){if(_0x413ff){return _0x413ff[_0x206a('0x1b')](_0x120bb4)['then'](function(_0x7c02bd){return _0x7c02bd;});}return null;};}function removeEntity(_0x2cdc7c,_0x28e94c){return function(_0x1cfd87){if(_0x1cfd87){return _0x1cfd87['destroy']()[_0x206a('0x1c')](function(){_0x2cdc7c[_0x206a('0x13')](0xcc)[_0x206a('0x14')]();});}};}function handleEntityNotFound(_0x35f391,_0x4b8deb){return function(_0x19461f){if(!_0x19461f){_0x35f391[_0x206a('0x12')](0x194);}return _0x19461f;};}function handleError(_0x5ea012,_0xc64875){_0xc64875=_0xc64875||0x1f4;return function(_0x21a837){logger['error'](_0x21a837['stack']);if(_0x21a837['name']){delete _0x21a837[_0x206a('0x1d')];}_0x5ea012[_0x206a('0x13')](_0xc64875)['send'](_0x21a837);};}exports[_0x206a('0x1e')]=function(_0x5972bc,_0x449073){var _0x369652={},_0x50fd54={},_0xb7981f={'count':0x0,'rows':[]};var _0x1e8742=db[_0x206a('0x1f')][_0x206a('0x20')];_0x50fd54['model']=_[_0x206a('0x21')](_0x1e8742);var _0x1bd5b6={'dateStart':_0x5972bc[_0x206a('0x22')][_0x206a('0x23')],'dateEnd':_0x5972bc[_0x206a('0x22')][_0x206a('0x24')]};delete _0x5972bc['query'][_0x206a('0x23')];delete _0x5972bc['query'][_0x206a('0x24')];_0x50fd54[_0x206a('0x22')]=_[_0x206a('0x21')](_0x5972bc['query']);_0x50fd54[_0x206a('0x25')]=_[_0x206a('0x26')](_0x50fd54[_0x206a('0x27')],_0x50fd54[_0x206a('0x22')]);_0x369652[_0x206a('0x28')]=_[_0x206a('0x26')](_0x50fd54[_0x206a('0x27')],qs[_0x206a('0x29')](_0x5972bc[_0x206a('0x22')][_0x206a('0x29')]));_0x369652[_0x206a('0x28')]=_0x369652[_0x206a('0x28')][_0x206a('0x2a')]?_0x369652['attributes']:_0x50fd54['model'];if(!_0x5972bc['query'][_0x206a('0x2b')]('nolimit')){_0x369652['limit']=qs['limit'](_0x5972bc[_0x206a('0x22')][_0x206a('0x17')]);_0x369652[_0x206a('0x16')]=qs[_0x206a('0x16')](_0x5972bc[_0x206a('0x22')][_0x206a('0x16')]);}_0x369652[_0x206a('0x2c')]=qs[_0x206a('0x2d')](_0x5972bc['query'][_0x206a('0x2d')]);_0x369652[_0x206a('0x2e')]=qs[_0x206a('0x25')](_[_0x206a('0x2f')](_0x5972bc[_0x206a('0x22')],_0x50fd54[_0x206a('0x25')]));if(_0x1bd5b6[_0x206a('0x23')]){if(_0x1bd5b6[_0x206a('0x24')]){_0x1bd5b6[_0x206a('0x24')]=moment(_0x1bd5b6[_0x206a('0x24')])['add'](0x1,_0x206a('0x30'));}else{_0x1bd5b6[_0x206a('0x24')]=moment(_0x1bd5b6[_0x206a('0x23')])[_0x206a('0x31')](0x1,_0x206a('0x30'));}_[_0x206a('0x32')](_0x369652[_0x206a('0x2e')],{'createdAt':{'$gte':_0x1bd5b6['dateStart'],'$lte':_0x1bd5b6['dateEnd']}});}if(_0x5972bc[_0x206a('0x22')][_0x206a('0x33')]){_0x369652[_0x206a('0x2e')]=_[_0x206a('0x32')](_0x369652[_0x206a('0x2e')],{'$or':_[_0x206a('0x34')](_0x369652['attributes'],function(_0x93655b){var _0x1b6c8e={};_0x1b6c8e[_0x93655b]={'$like':'%'+_0x5972bc[_0x206a('0x22')][_0x206a('0x33')]+'%'};return _0x1b6c8e;})});}_0x369652=_[_0x206a('0x32')]({},_0x369652,_0x5972bc[_0x206a('0x35')]);var _0x49b7de={'where':_0x369652['where']};return db[_0x206a('0x1f')][_0x206a('0x36')](_0x49b7de)[_0x206a('0x1c')](function(_0x31e3d5){_0xb7981f[_0x206a('0x36')]=_0x31e3d5;if(_0x5972bc[_0x206a('0x22')]['includeAll']){_0x369652['include']=[{'all':!![]}];}return db[_0x206a('0x1f')][_0x206a('0x37')](_0x369652);})[_0x206a('0x1c')](function(_0x428023){_0xb7981f[_0x206a('0x38')]=_0x428023;return _0xb7981f;})[_0x206a('0x1c')](respondWithFilteredResult(_0x449073,_0x369652))['catch'](handleError(_0x449073,null));};exports[_0x206a('0x39')]=function(_0x43b6a6,_0x14adeb){var _0x3d833b={'raw':!![],'where':{'id':_0x43b6a6[_0x206a('0x3a')]['id']}},_0x9077d7={};_0x9077d7[_0x206a('0x27')]=_['keys'](db[_0x206a('0x1f')][_0x206a('0x20')]);_0x9077d7['query']=_[_0x206a('0x21')](_0x43b6a6[_0x206a('0x22')]);_0x9077d7['filters']=_[_0x206a('0x26')](_0x9077d7[_0x206a('0x27')],_0x9077d7[_0x206a('0x22')]);_0x3d833b[_0x206a('0x28')]=_[_0x206a('0x26')](_0x9077d7[_0x206a('0x27')],qs[_0x206a('0x29')](_0x43b6a6[_0x206a('0x22')][_0x206a('0x29')]));_0x3d833b[_0x206a('0x28')]=_0x3d833b[_0x206a('0x28')]['length']?_0x3d833b[_0x206a('0x28')]:_0x9077d7['model'];if(_0x43b6a6[_0x206a('0x22')]['includeAll']){_0x3d833b[_0x206a('0x3b')]=[{'all':!![]}];}_0x3d833b=_[_0x206a('0x32')]({},_0x3d833b,_0x43b6a6['options']);return db[_0x206a('0x1f')][_0x206a('0x3c')](_0x3d833b)[_0x206a('0x1c')](handleEntityNotFound(_0x14adeb,null))['then'](respondWithResult(_0x14adeb,null))['catch'](handleError(_0x14adeb,null));};exports[_0x206a('0x3d')]=function(_0x133052,_0x5a8ba9){return db['CmHopperFinal']['describe']()[_0x206a('0x1c')](respondWithResult(_0x5a8ba9,null))['catch'](handleError(_0x5a8ba9,null));};exports[_0x206a('0x1b')]=function(_0x103103,_0x1fb007){if(_0x103103['body'][_0x206a('0x3e')]){delete _0x103103['body'][_0x206a('0x3e')];}return db[_0x206a('0x1f')][_0x206a('0x3c')]({'where':{'uniqueid':_0x103103[_0x206a('0x3a')]['id']}})[_0x206a('0x1c')](handleEntityNotFound(_0x1fb007,null))[_0x206a('0x1c')](saveUpdates(_0x103103[_0x206a('0x3f')],null))[_0x206a('0x1c')](respondWithResult(_0x1fb007,null))[_0x206a('0x40')](handleError(_0x1fb007,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0xdd6ff7,_0x20159b,_0x4a1613){return db['CmHopperFinal'][_0x206a('0x37')]({'raw':![],'where':{'VoiceQueueId':_0xdd6ff7['params']['id']},'attributes':[[db[_0x206a('0x41')]['fn'](_0x206a('0x42'),db['sequelize']['fn']('IF',db[_0x206a('0x41')][_0x206a('0x43')]('`state`\x20=\x200,\x201,\x20null'))),_0x206a('0x44')],[db[_0x206a('0x41')]['fn'](_0x206a('0x42'),db[_0x206a('0x41')]['fn']('IF',db[_0x206a('0x41')][_0x206a('0x43')](_0x206a('0x45')))),_0x206a('0x46')],[db['sequelize']['fn'](_0x206a('0x42'),db[_0x206a('0x41')]['fn']('IF',db['sequelize'][_0x206a('0x43')]('`state`\x20=\x205,\x201,\x20null'))),_0x206a('0x47')],[db[_0x206a('0x41')]['fn']('COUNT',db[_0x206a('0x41')]['fn']('IF',db['sequelize'][_0x206a('0x43')](_0x206a('0x48')))),'congestionContacts'],[db[_0x206a('0x41')]['fn'](_0x206a('0x42'),db[_0x206a('0x41')]['fn']('IF',db[_0x206a('0x41')][_0x206a('0x43')](_0x206a('0x49')))),'dropContacts'],[db['sequelize']['fn'](_0x206a('0x42'),db[_0x206a('0x41')]['fn']('IF',db[_0x206a('0x41')]['literal'](_0x206a('0x4a')))),_0x206a('0x4b')],[db[_0x206a('0x41')]['fn'](_0x206a('0x42'),db[_0x206a('0x41')]['fn']('IF',db[_0x206a('0x41')]['literal'](_0x206a('0x4c')))),_0x206a('0x4d')]]})[_0x206a('0x1c')](handleEntityNotFound(_0x20159b,null))[_0x206a('0x1c')](respondWithResult(_0x20159b,null))['catch'](handleError(_0x20159b,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x1cd1e6,_0x50fffb,_0x2d57d2){return db[_0x206a('0x1f')][_0x206a('0x37')]({'raw':![],'where':{'CampaignId':_0x1cd1e6[_0x206a('0x3a')]['id']},'attributes':[[db[_0x206a('0x41')]['fn'](_0x206a('0x42'),db[_0x206a('0x41')]['fn']('IF',db['sequelize'][_0x206a('0x43')](_0x206a('0x4e')))),_0x206a('0x44')],[db[_0x206a('0x41')]['fn'](_0x206a('0x42'),db[_0x206a('0x41')]['fn']('IF',db['sequelize'][_0x206a('0x43')](_0x206a('0x45')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x206a('0x42'),db[_0x206a('0x41')]['fn']('IF',db['sequelize'][_0x206a('0x43')](_0x206a('0x4f')))),_0x206a('0x47')],[db[_0x206a('0x41')]['fn'](_0x206a('0x42'),db[_0x206a('0x41')]['fn']('IF',db[_0x206a('0x41')][_0x206a('0x43')]('`state`\x20=\x208,\x201,\x20null'))),_0x206a('0x50')],[db[_0x206a('0x41')]['fn'](_0x206a('0x42'),db[_0x206a('0x41')]['fn']('IF',db[_0x206a('0x41')][_0x206a('0x43')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x206a('0x51')],[db[_0x206a('0x41')]['fn']('COUNT',db[_0x206a('0x41')]['fn']('IF',db[_0x206a('0x41')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x206a('0x4b')],[db[_0x206a('0x41')]['fn'](_0x206a('0x42'),db[_0x206a('0x41')]['fn']('IF',db['sequelize']['literal'](_0x206a('0x4c')))),_0x206a('0x4d')]]})[_0x206a('0x1c')](handleEntityNotFound(_0x50fffb,null))[_0x206a('0x1c')](respondWithResult(_0x50fffb,null))[_0x206a('0x40')](handleError(_0x50fffb,null));};exports[_0x206a('0x52')]=function(_0x560738,_0x16f973,_0x598964){return db[_0x206a('0x53')]['find']({'where':{'id':_0x560738[_0x206a('0x3a')]['id']}})[_0x206a('0x1c')](handleEntityNotFound(_0x16f973,null))[_0x206a('0x1c')](function(_0x36bb12){var _0x27c764;if(_0x36bb12){_0x27c764=squel['insert']()['into'](_0x206a('0x54'))['fromQuery'](['phone','scheduledAt','ContactId',_0x206a('0x55'),_0x206a('0x56'),_0x206a('0x57'),_0x206a('0x58')],squel[_0x206a('0x59')]()['field']('ANY_VALUE(calleridnum)',_0x206a('0x5a'))[_0x206a('0x5b')](_0x206a('0x5c'),_0x206a('0x5d'))[_0x206a('0x5b')]('ANY_VALUE(ContactId)',_0x206a('0x5e'))[_0x206a('0x5b')](_0x206a('0x5f'),_0x206a('0x55'))[_0x206a('0x5b')](_0x206a('0x60'),_0x206a('0x56'))['field'](_0x206a('0x5c'),'createdAt')['field']('NOW()',_0x206a('0x58'))[_0x206a('0x61')](_0x206a('0x62'))[_0x206a('0x2e')](_0x206a('0x63'),_0x560738[_0x206a('0x3a')]['id'][_0x206a('0x64')]())['where'](_0x206a('0x65'),_0x560738[_0x206a('0x3f')][_0x206a('0x66')]['toString']())['where'](_0x206a('0x67'))[_0x206a('0x2e')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x206a('0x59')]()['field'](_0x206a('0x5a'))[_0x206a('0x61')](_0x206a('0x54'))[_0x206a('0x2e')]('VoiceQueueId\x20=\x20?',_0x560738['params']['id']['toString']()))['where'](_0x206a('0x68'),squel[_0x206a('0x59')]()[_0x206a('0x5b')]('calleridnum')[_0x206a('0x61')]('cm_hopper_final')[_0x206a('0x2e')](_0x206a('0x63'),_0x560738[_0x206a('0x3a')]['id'][_0x206a('0x64')]())[_0x206a('0x2e')](_0x206a('0x69')))[_0x206a('0x6a')](_0x206a('0x5e')))['toString']();return db[_0x206a('0x41')]['query'](_0x27c764);}return[];})[_0x206a('0x1c')](respondWithResult(_0x16f973,null))[_0x206a('0x40')](handleError(_0x16f973,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x5b8978,_0x2fa4b1,_0x19832e){return db[_0x206a('0x6b')][_0x206a('0x3c')]({'where':{'id':_0x5b8978[_0x206a('0x3a')]['id']}})[_0x206a('0x1c')](handleEntityNotFound(_0x2fa4b1,null))[_0x206a('0x1c')](function(_0x200dfa){var _0x30ba7b;if(_0x200dfa){_0x30ba7b=squel[_0x206a('0x6c')]()[_0x206a('0x6d')](_0x206a('0x54'))['fromQuery']([_0x206a('0x5a'),'scheduledAt','ContactId','ListId',_0x206a('0x6e'),_0x206a('0x57'),'updatedAt'],squel[_0x206a('0x59')]()[_0x206a('0x5b')](_0x206a('0x6f'),_0x206a('0x5a'))[_0x206a('0x5b')](_0x206a('0x5c'),'scheduledAt')[_0x206a('0x5b')](_0x206a('0x70'),_0x206a('0x5e'))[_0x206a('0x5b')](_0x206a('0x5f'),_0x206a('0x55'))[_0x206a('0x5b')]('ANY_VALUE(CampaignId)','CampaignId')[_0x206a('0x5b')](_0x206a('0x5c'),_0x206a('0x57'))[_0x206a('0x5b')]('NOW()',_0x206a('0x58'))[_0x206a('0x61')](_0x206a('0x62'))[_0x206a('0x2e')](_0x206a('0x71'),_0x5b8978[_0x206a('0x3a')]['id'][_0x206a('0x64')]())[_0x206a('0x2e')](_0x206a('0x65'),_0x5b8978[_0x206a('0x3f')]['state'][_0x206a('0x64')]())['where'](_0x206a('0x67'))[_0x206a('0x2e')](_0x206a('0x68'),squel['select']()[_0x206a('0x5b')](_0x206a('0x5a'))[_0x206a('0x61')](_0x206a('0x54'))[_0x206a('0x2e')](_0x206a('0x71'),_0x5b8978[_0x206a('0x3a')]['id'][_0x206a('0x64')]()))[_0x206a('0x2e')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x206a('0x59')]()[_0x206a('0x5b')](_0x206a('0x72'))[_0x206a('0x61')](_0x206a('0x62'))[_0x206a('0x2e')]('CampaignId\x20=\x20?',_0x5b8978[_0x206a('0x3a')]['id'][_0x206a('0x64')]())[_0x206a('0x2e')](_0x206a('0x69')))[_0x206a('0x6a')](_0x206a('0x5e')))[_0x206a('0x64')]();return db[_0x206a('0x41')]['query'](_0x30ba7b);}return[];})[_0x206a('0x1c')](respondWithResult(_0x2fa4b1,null))[_0x206a('0x40')](handleError(_0x2fa4b1,null));};exports[_0x206a('0x73')]=function(_0x3facca,_0x169083,_0x3d8043){return db[_0x206a('0x74')][_0x206a('0x75')]({'where':{'VoiceQueueId':_0x3facca[_0x206a('0x3f')][_0x206a('0x56')],'CampaignId':_0x3facca['body'][_0x206a('0x6e')],'ContactId':_0x3facca[_0x206a('0x3f')][_0x206a('0x5e')]}})[_0x206a('0x1c')](handleEntityNotFound(_0x169083,null))['then'](function(_0x2932ca){if(_0x2932ca){return _0x2932ca;}return null;})[_0x206a('0x1c')](respondWithResult(_0x169083,null))[_0x206a('0x40')](handleError(_0x169083,null));};
\ No newline at end of file
index 3d6e043..7fc780e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['./cmHopperFinal.attributes','exports','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x269ab4,_0x52a1f9){var _0x3831ca=function(_0x53a43c){while(--_0x53a43c){_0x269ab4['push'](_0x269ab4['shift']());}};_0x3831ca(++_0x52a1f9);}(_0x1261,0x144));var _0x1126=function(_0x294726,_0x5db9e9){_0x294726=_0x294726-0x0;var _0x39e2e3=_0x1261[_0x294726];return _0x39e2e3;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var attributes=require(_0x1126('0x6'));module[_0x1126('0x7')]=function(_0x21a480,_0x75a851){return _0x21a480['define']('CmHopperFinal',attributes,{'tableName':_0x1126('0x8'),'paranoid':![],'indexes':[{'name':_0x1126('0x9'),'fields':['calleridnum']},{'name':_0x1126('0xa'),'fields':[_0x1126('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xda2d=['api','moment','bluebird','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xda2d,0x102));var _0xdda2=function(_0x43401e,_0x1b42fe){_0x43401e=_0x43401e-0x0;var _0x385865=_0xda2d[_0x43401e];return _0x385865;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var logger=require(_0xdda2('0x1'))(_0xdda2('0x2'));var moment=require(_0xdda2('0x3'));var BPromise=require(_0xdda2('0x4'));var rp=require('request-promise');var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x357e97,_0x319129){return _0x357e97[_0xdda2('0x5')](_0xdda2('0x6'),attributes,{'tableName':_0xdda2('0x7'),'paranoid':![],'indexes':[{'name':_0xdda2('0x8'),'fields':[_0xdda2('0x8')]},{'name':_0xdda2('0x9'),'fields':[_0xdda2('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 3c119c0..70aa866 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81c8=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateCmHopperFinal','CmHopperFinal','body','options','raw'];(function(_0x1794d4,_0x160614){var _0x1dfca1=function(_0x18dbc6){while(--_0x18dbc6){_0x1794d4['push'](_0x1794d4['shift']());}};_0x1dfca1(++_0x160614);}(_0x81c8,0xea));var _0x881c=function(_0x1ea7b2,_0x7c2345){_0x1ea7b2=_0x1ea7b2-0x0;var _0x249ce1=_0x81c8[_0x1ea7b2];return _0x249ce1;};'use strict';var _=require(_0x881c('0x0'));var util=require(_0x881c('0x1'));var moment=require('moment');var BPromise=require(_0x881c('0x2'));var rs=require(_0x881c('0x3'));var fs=require('fs');var db=require(_0x881c('0x4'))['db'];var utils=require(_0x881c('0x5'));var logger=require(_0x881c('0x6'))(_0x881c('0x7'));var config=require(_0x881c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x881c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xeba0f0,_0x235df4,_0x43c251){return new BPromise(function(_0x500aba,_0x3513c4){return client['request'](_0xeba0f0,_0x43c251)[_0x881c('0xa')](function(_0x2d7954){logger[_0x881c('0xb')](_0x881c('0xc'),_0x235df4,_0x881c('0xd'));logger[_0x881c('0xe')](_0x881c('0xf'),_0x235df4,_0x881c('0xd'),JSON[_0x881c('0x10')](_0x2d7954));if(_0x2d7954['error']){if(_0x2d7954['error']['code']===0x1f4){logger[_0x881c('0x11')](_0x881c('0xc'),_0x235df4,_0x2d7954['error'][_0x881c('0x12')]);return _0x3513c4(_0x2d7954[_0x881c('0x11')][_0x881c('0x12')]);}logger['error'](_0x881c('0xc'),_0x235df4,_0x2d7954[_0x881c('0x11')][_0x881c('0x12')]);return _0x500aba(_0x2d7954['error'][_0x881c('0x12')]);}else{logger['info'](_0x881c('0xc'),_0x235df4,_0x881c('0xd'));_0x500aba(_0x2d7954[_0x881c('0x13')][_0x881c('0x12')]);}})[_0x881c('0x14')](function(_0x4f6b34){logger[_0x881c('0x11')](_0x881c('0xc'),_0x235df4,_0x4f6b34);_0x3513c4(_0x4f6b34);});});}exports[_0x881c('0x15')]=function(_0x5d0a4){var _0x2fe71a=this;return new Promise(function(_0x2ba8e4,_0xb9fbbd){return db[_0x881c('0x16')]['create'](_0x5d0a4[_0x881c('0x17')],{'raw':_0x5d0a4['options']?_0x5d0a4[_0x881c('0x18')][_0x881c('0x19')]===undefined?!![]:![]:!![]})[_0x881c('0xa')](function(_0x2bdaa3){logger[_0x881c('0xb')](_0x881c('0x15'),_0x5d0a4);logger[_0x881c('0xe')](_0x881c('0x15'),_0x5d0a4,JSON[_0x881c('0x10')](_0x2bdaa3));_0x2ba8e4(_0x2bdaa3);})[_0x881c('0x14')](function(_0x57d766){logger[_0x881c('0x11')](_0x881c('0x15'),_0x57d766[_0x881c('0x12')],_0x5d0a4);_0xb9fbbd(_0x2fe71a[_0x881c('0x11')](0x1f4,_0x57d766[_0x881c('0x12')]));});});};
\ No newline at end of file
+var _0x3abd=['jayson/promise','client','request','then','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CmHopperFinal','create','raw','CreateCmHopperFinal','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x423616,_0x10a6f5){var _0x1a0ac1=function(_0x15b559){while(--_0x15b559){_0x423616['push'](_0x423616['shift']());}};_0x1a0ac1(++_0x10a6f5);}(_0x3abd,0x66));var _0xd3ab=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x3abd[_0x1573ea];return _0x51c0e2;};'use strict';var _=require(_0xd3ab('0x0'));var util=require(_0xd3ab('0x1'));var moment=require(_0xd3ab('0x2'));var BPromise=require(_0xd3ab('0x3'));var rs=require(_0xd3ab('0x4'));var fs=require('fs');var db=require(_0xd3ab('0x5'))['db'];var utils=require(_0xd3ab('0x6'));var logger=require(_0xd3ab('0x7'))(_0xd3ab('0x8'));var config=require(_0xd3ab('0x9'));var jayson=require(_0xd3ab('0xa'));var client=jayson[_0xd3ab('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x416fd8,_0x4b78b8,_0xf62d19){return new BPromise(function(_0x194c9a,_0x4e2dc7){return client[_0xd3ab('0xc')](_0x416fd8,_0xf62d19)[_0xd3ab('0xd')](function(_0x409d63){logger['info'](_0xd3ab('0xe'),_0x4b78b8,_0xd3ab('0xf'));logger[_0xd3ab('0x10')](_0xd3ab('0x11'),_0x4b78b8,_0xd3ab('0xf'),JSON[_0xd3ab('0x12')](_0x409d63));if(_0x409d63[_0xd3ab('0x13')]){if(_0x409d63[_0xd3ab('0x13')][_0xd3ab('0x14')]===0x1f4){logger[_0xd3ab('0x13')]('CmHopperFinal,\x20%s,\x20%s',_0x4b78b8,_0x409d63['error'][_0xd3ab('0x15')]);return _0x4e2dc7(_0x409d63['error']['message']);}logger[_0xd3ab('0x13')]('CmHopperFinal,\x20%s,\x20%s',_0x4b78b8,_0x409d63[_0xd3ab('0x13')][_0xd3ab('0x15')]);return _0x194c9a(_0x409d63['error']['message']);}else{logger[_0xd3ab('0x16')]('CmHopperFinal,\x20%s,\x20%s',_0x4b78b8,_0xd3ab('0xf'));_0x194c9a(_0x409d63['result']['message']);}})[_0xd3ab('0x17')](function(_0x2bbe14){logger[_0xd3ab('0x13')]('CmHopperFinal,\x20%s,\x20%s',_0x4b78b8,_0x2bbe14);_0x4e2dc7(_0x2bbe14);});});}exports['CreateCmHopperFinal']=function(_0x1e05a0){var _0x46df76=this;return new Promise(function(_0x1ae999,_0x5db700){return db[_0xd3ab('0x18')][_0xd3ab('0x19')](_0x1e05a0['body'],{'raw':_0x1e05a0['options']?_0x1e05a0['options'][_0xd3ab('0x1a')]===undefined?!![]:![]:!![]})[_0xd3ab('0xd')](function(_0xd3de73){logger[_0xd3ab('0x16')](_0xd3ab('0x1b'),_0x1e05a0);logger[_0xd3ab('0x10')](_0xd3ab('0x1b'),_0x1e05a0,JSON[_0xd3ab('0x12')](_0xd3de73));_0x1ae999(_0xd3de73);})[_0xd3ab('0x17')](function(_0x5cc71a){logger[_0xd3ab('0x13')](_0xd3ab('0x1b'),_0x5cc71a['message'],_0x1e05a0);_0x5db700(_0x46df76[_0xd3ab('0x13')](0x1f4,_0x5cc71a['message']));});});};
\ No newline at end of file
index ab51776..d2bfb9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26cf=['/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','put','update','exports','util','path','Router','../../components/interaction/service','./cmHopperFinal.controller','get','index','/describe','isAuthenticated','describe','show'];(function(_0x469ac8,_0x4a34c6){var _0x22f49f=function(_0x567e09){while(--_0x567e09){_0x469ac8['push'](_0x469ac8['shift']());}};_0x22f49f(++_0x4a34c6);}(_0x26cf,0x135));var _0xf26c=function(_0x1e10d1,_0x27f13f){_0x1e10d1=_0x1e10d1-0x0;var _0x2242ba=_0x26cf[_0x1e10d1];return _0x2242ba;};'use strict';var multer=require('multer');var util=require(_0xf26c('0x0'));var path=require(_0xf26c('0x1'));var express=require('express');var router=express[_0xf26c('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xf26c('0x3'));var config=require('../../config/environment');var controller=require(_0xf26c('0x4'));router[_0xf26c('0x5')]('/',auth['isAuthenticated'](),controller[_0xf26c('0x6')]);router[_0xf26c('0x5')](_0xf26c('0x7'),auth[_0xf26c('0x8')](),controller[_0xf26c('0x9')]);router[_0xf26c('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xf26c('0xa')]);router[_0xf26c('0x5')](_0xf26c('0xb'),auth[_0xf26c('0x8')](),controller[_0xf26c('0xc')]);router[_0xf26c('0x5')](_0xf26c('0xd'),auth[_0xf26c('0x8')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xf26c('0xe')](_0xf26c('0xf'),auth[_0xf26c('0x8')](),controller[_0xf26c('0x10')]);router[_0xf26c('0xe')]('/voice/campaign/moveContacts/:id',auth[_0xf26c('0x8')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xf26c('0xe')]('/checkContactHopper',auth[_0xf26c('0x8')](),controller['checkContactHopper']);router[_0xf26c('0x11')]('/:id',auth[_0xf26c('0x8')](),controller[_0xf26c('0x12')]);module[_0xf26c('0x13')]=router;
\ No newline at end of file
+var _0xbd50=['moveContactsIvrCampaignHopperFinal','post','/checkContactHopper','checkContactHopper','put','update','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','/describe','isAuthenticated','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id'];(function(_0xb48d96,_0x2a9d7d){var _0x2797df=function(_0x47c717){while(--_0x47c717){_0xb48d96['push'](_0xb48d96['shift']());}};_0x2797df(++_0x2a9d7d);}(_0xbd50,0x196));var _0x0bd5=function(_0x113a6c,_0x10df30){_0x113a6c=_0x113a6c-0x0;var _0x1ac632=_0xbd50[_0x113a6c];return _0x1ac632;};'use strict';var multer=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var path=require(_0x0bd5('0x2'));var express=require('express');var router=express[_0x0bd5('0x3')]();var auth=require(_0x0bd5('0x4'));var interaction=require(_0x0bd5('0x5'));var config=require(_0x0bd5('0x6'));var controller=require(_0x0bd5('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0bd5('0x8')](_0x0bd5('0x9'),auth[_0x0bd5('0xa')](),controller[_0x0bd5('0xb')]);router[_0x0bd5('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0bd5('0xc')]);router[_0x0bd5('0x8')](_0x0bd5('0xd'),auth['isAuthenticated'](),controller[_0x0bd5('0xe')]);router[_0x0bd5('0x8')]('/campaign/countAttributes/:id',auth[_0x0bd5('0xa')](),controller[_0x0bd5('0xf')]);router['post'](_0x0bd5('0x10'),auth[_0x0bd5('0xa')](),controller[_0x0bd5('0x11')]);router['post'](_0x0bd5('0x12'),auth[_0x0bd5('0xa')](),controller[_0x0bd5('0x13')]);router[_0x0bd5('0x14')](_0x0bd5('0x15'),auth[_0x0bd5('0xa')](),controller[_0x0bd5('0x16')]);router[_0x0bd5('0x17')]('/:id',auth[_0x0bd5('0xa')](),controller[_0x0bd5('0x18')]);module['exports']=router;
\ No newline at end of file
index c821b1a..f5458f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5162=['INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x365470,_0xfd360f){var _0x3d85fe=function(_0x47baa2){while(--_0x47baa2){_0x365470['push'](_0x365470['shift']());}};_0x3d85fe(++_0xfd360f);}(_0x5162,0x103));var _0x2516=function(_0x549b29,_0x2e2b00){_0x549b29=_0x549b29-0x0;var _0x2b813f=_0x5162[_0x549b29];return _0x2b813f;};'use strict';var Sequelize=require(_0x2516('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x2516('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2516('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2516('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2516('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2516('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x2516('0x2')]},'originatecalleridname':{'type':Sequelize[_0x2516('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x2516('0x3')]},'answertime':{'type':Sequelize[_0x2516('0x3')]},'droptime':{'type':Sequelize[_0x2516('0x3')]},'endtime':{'type':Sequelize[_0x2516('0x3')]},'ringtime':{'type':Sequelize[_0x2516('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2516('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2516('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2516('0x2')]},'campaign':{'type':Sequelize[_0x2516('0x2')]},'campaigntype':{'type':Sequelize[_0x2516('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x2516('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2516('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2516('0x3')]},'recallme':{'type':Sequelize[_0x2516('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x2516('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xf006=['DATE','BOOLEAN','INTEGER','STRING'];(function(_0x5f45fd,_0x2c21c7){var _0xa4ea4a=function(_0x2b0f68){while(--_0x2b0f68){_0x5f45fd['push'](_0x5f45fd['shift']());}};_0xa4ea4a(++_0x2c21c7);}(_0xf006,0x146));var _0x6f00=function(_0x44334f,_0xbee2df){_0x44334f=_0x44334f-0x0;var _0x134ec9=_0xf006[_0x44334f];return _0x134ec9;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x6f00('0x0')](0x2)},'statedesc':{'type':Sequelize[_0x6f00('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x6f00('0x0')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6f00('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x6f00('0x1')]},'originatecalleridname':{'type':Sequelize[_0x6f00('0x1')]},'calleridnum':{'type':Sequelize[_0x6f00('0x1')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x6f00('0x2')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x6f00('0x2')]},'droptime':{'type':Sequelize[_0x6f00('0x2')]},'endtime':{'type':Sequelize[_0x6f00('0x2')]},'ringtime':{'type':Sequelize[_0x6f00('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6f00('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6f00('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6f00('0x0')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6f00('0x1')]},'campaign':{'type':Sequelize[_0x6f00('0x1')]},'campaigntype':{'type':Sequelize[_0x6f00('0x1')]},'membername':{'type':Sequelize[_0x6f00('0x1')]},'reason':{'type':Sequelize[_0x6f00('0x1')]},'amd':{'type':Sequelize[_0x6f00('0x3')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x6f00('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6f00('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6f00('0x2')]},'recallme':{'type':Sequelize[_0x6f00('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x6f00('0x2')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 13be942..8aafc8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64b5=['stack','name','send','index','rawAttributes','keys','query','dateStart','dateEnd','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','pick','add','day','where','filter','merge','map','options','CmHopperHistory','includeAll','include','findAll','rows','show','params','length','find','catch','create','describe','body','uniqueid','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x64b5,0x14d));var _0x564b=function(_0x253e1c,_0x2a7097){_0x253e1c=_0x253e1c-0x0;var _0x2e8e15=_0x64b5[_0x253e1c];return _0x2e8e15;};'use strict';var pdf=require(_0x564b('0x0'));var emlformat=require(_0x564b('0x1'));var rimraf=require(_0x564b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x564b('0x3'));var moment=require(_0x564b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x564b('0x5'));var util=require(_0x564b('0x6'));var path=require('path');var sox=require(_0x564b('0x7'));var csv=require(_0x564b('0x8'));var ejs=require(_0x564b('0x9'));var fs=require('fs');var _=require(_0x564b('0xa'));var squel=require('squel');var crypto=require(_0x564b('0xb'));var jsforce=require(_0x564b('0xc'));var deskjs=require(_0x564b('0xd'));var toCsv=require(_0x564b('0x8'));var querystring=require(_0x564b('0xe'));var Papa=require(_0x564b('0xf'));var qs=require(_0x564b('0x10'));var logger=require('../../config/logger')(_0x564b('0x11'));var utils=require(_0x564b('0x12'));var config=require('../../config/environment');var db=require(_0x564b('0x13'))['db'];function respondWithStatusCode(_0x13f794,_0x79df){_0x79df=_0x79df||0xcc;return function(_0x4a854b){if(_0x4a854b){return _0x13f794[_0x564b('0x14')](_0x79df);}return _0x13f794[_0x564b('0x15')](_0x79df)[_0x564b('0x16')]();};}function respondWithResult(_0x178916,_0x1c2126){_0x1c2126=_0x1c2126||0xc8;return function(_0x1b43ca){if(_0x1b43ca){return _0x178916[_0x564b('0x15')](_0x1c2126)[_0x564b('0x17')](_0x1b43ca);}};}function respondWithFilteredResult(_0x2112ed,_0x497f34){return function(_0x415615){if(_0x415615){var _0x13ee67=_0x415615[_0x564b('0x18')],_0x1e80a6=_0x497f34[_0x564b('0x19')],_0x2e8919=_0x497f34[_0x564b('0x19')]+_0x497f34['limit'],_0x633070;if(_0x2e8919>=_0x13ee67){_0x2e8919=_0x13ee67;_0x633070=0xc8;}else{_0x633070=0xce;}_0x2112ed[_0x564b('0x15')](_0x633070);return _0x2112ed[_0x564b('0x1a')](_0x564b('0x1b'),_0x1e80a6+'-'+_0x2e8919+'/'+_0x13ee67)['json'](_0x415615);}return null;};}function patchUpdates(_0x216805){return function(_0x10a4c3){try{jsonpatch[_0x564b('0x1c')](_0x10a4c3,_0x216805,!![]);}catch(_0x468500){return BPromise[_0x564b('0x1d')](_0x468500);}return _0x10a4c3['save']();};}function saveUpdates(_0x285284,_0xe44576){return function(_0x30409e){if(_0x30409e){return _0x30409e[_0x564b('0x1e')](_0x285284)[_0x564b('0x1f')](function(_0xec6476){return _0xec6476;});}return null;};}function removeEntity(_0x762665,_0x33aab2){return function(_0x4a50f0){if(_0x4a50f0){return _0x4a50f0['destroy']()[_0x564b('0x1f')](function(){_0x762665[_0x564b('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18ab5e,_0x2439c5){return function(_0x4ad730){if(!_0x4ad730){_0x18ab5e['sendStatus'](0x194);}return _0x4ad730;};}function handleError(_0x160d98,_0x44147e){_0x44147e=_0x44147e||0x1f4;return function(_0xf30525){logger['error'](_0xf30525[_0x564b('0x20')]);if(_0xf30525[_0x564b('0x21')]){delete _0xf30525[_0x564b('0x21')];}_0x160d98[_0x564b('0x15')](_0x44147e)[_0x564b('0x22')](_0xf30525);};}exports[_0x564b('0x23')]=function(_0x19cf1d,_0x8ada7d){var _0x207755={},_0x3d332f={},_0x97c769={'count':0x0,'rows':[]};var _0x31a311=db['CmHopperHistory'][_0x564b('0x24')];_0x3d332f['model']=_[_0x564b('0x25')](_0x31a311);var _0x5139ab={'dateStart':_0x19cf1d[_0x564b('0x26')][_0x564b('0x27')],'dateEnd':_0x19cf1d[_0x564b('0x26')][_0x564b('0x28')]};delete _0x19cf1d[_0x564b('0x26')][_0x564b('0x27')];delete _0x19cf1d[_0x564b('0x26')][_0x564b('0x28')];_0x3d332f[_0x564b('0x26')]=_[_0x564b('0x25')](_0x19cf1d['query']);_0x3d332f[_0x564b('0x29')]=_['intersection'](_0x3d332f[_0x564b('0x2a')],_0x3d332f['query']);_0x207755[_0x564b('0x2b')]=_[_0x564b('0x2c')](_0x3d332f[_0x564b('0x2a')],qs['fields'](_0x19cf1d[_0x564b('0x26')][_0x564b('0x2d')]));_0x207755[_0x564b('0x2b')]=_0x207755[_0x564b('0x2b')]['length']?_0x207755[_0x564b('0x2b')]:_0x3d332f[_0x564b('0x2a')];if(!_0x19cf1d[_0x564b('0x26')][_0x564b('0x2e')](_0x564b('0x2f'))){_0x207755[_0x564b('0x30')]=qs[_0x564b('0x30')](_0x19cf1d[_0x564b('0x26')][_0x564b('0x30')]);_0x207755['offset']=qs[_0x564b('0x19')](_0x19cf1d[_0x564b('0x26')]['offset']);}_0x207755[_0x564b('0x31')]=qs[_0x564b('0x32')](_0x19cf1d[_0x564b('0x26')][_0x564b('0x32')]);_0x207755['where']=qs['filters'](_[_0x564b('0x33')](_0x19cf1d[_0x564b('0x26')],_0x3d332f[_0x564b('0x29')]));if(_0x5139ab[_0x564b('0x27')]){if(_0x5139ab[_0x564b('0x28')]){_0x5139ab[_0x564b('0x28')]=moment(_0x5139ab['dateEnd'])[_0x564b('0x34')](0x1,_0x564b('0x35'));}else{_0x5139ab['dateEnd']=moment(_0x5139ab[_0x564b('0x27')])[_0x564b('0x34')](0x1,_0x564b('0x35'));}_['merge'](_0x207755[_0x564b('0x36')],{'createdAt':{'$gte':_0x5139ab['dateStart'],'$lte':_0x5139ab['dateEnd']}});}if(_0x19cf1d['query'][_0x564b('0x37')]){_0x207755[_0x564b('0x36')]=_[_0x564b('0x38')](_0x207755[_0x564b('0x36')],{'$or':_[_0x564b('0x39')](_0x207755[_0x564b('0x2b')],function(_0x5a5c1c){var _0x20f3e8={};_0x20f3e8[_0x5a5c1c]={'$like':'%'+_0x19cf1d[_0x564b('0x26')][_0x564b('0x37')]+'%'};return _0x20f3e8;})});}_0x207755=_[_0x564b('0x38')]({},_0x207755,_0x19cf1d[_0x564b('0x3a')]);var _0xbe6cd3={'where':_0x207755[_0x564b('0x36')]};return db[_0x564b('0x3b')][_0x564b('0x18')](_0xbe6cd3)[_0x564b('0x1f')](function(_0x133a4b){_0x97c769[_0x564b('0x18')]=_0x133a4b;if(_0x19cf1d['query'][_0x564b('0x3c')]){_0x207755[_0x564b('0x3d')]=[{'all':!![]}];}return db[_0x564b('0x3b')][_0x564b('0x3e')](_0x207755);})['then'](function(_0xab844a){_0x97c769[_0x564b('0x3f')]=_0xab844a;return _0x97c769;})[_0x564b('0x1f')](respondWithFilteredResult(_0x8ada7d,_0x207755))['catch'](handleError(_0x8ada7d,null));};exports[_0x564b('0x40')]=function(_0x245164,_0x199d0a){var _0x56adfe={'raw':!![],'where':{'id':_0x245164[_0x564b('0x41')]['id']}},_0x41fcb5={};_0x41fcb5['model']=_[_0x564b('0x25')](db[_0x564b('0x3b')][_0x564b('0x24')]);_0x41fcb5[_0x564b('0x26')]=_[_0x564b('0x25')](_0x245164['query']);_0x41fcb5[_0x564b('0x29')]=_['intersection'](_0x41fcb5[_0x564b('0x2a')],_0x41fcb5[_0x564b('0x26')]);_0x56adfe[_0x564b('0x2b')]=_[_0x564b('0x2c')](_0x41fcb5[_0x564b('0x2a')],qs['fields'](_0x245164['query'][_0x564b('0x2d')]));_0x56adfe[_0x564b('0x2b')]=_0x56adfe[_0x564b('0x2b')][_0x564b('0x42')]?_0x56adfe['attributes']:_0x41fcb5[_0x564b('0x2a')];if(_0x245164[_0x564b('0x26')][_0x564b('0x3c')]){_0x56adfe['include']=[{'all':!![]}];}_0x56adfe=_[_0x564b('0x38')]({},_0x56adfe,_0x245164[_0x564b('0x3a')]);return db[_0x564b('0x3b')][_0x564b('0x43')](_0x56adfe)[_0x564b('0x1f')](handleEntityNotFound(_0x199d0a,null))[_0x564b('0x1f')](respondWithResult(_0x199d0a,null))[_0x564b('0x44')](handleError(_0x199d0a,null));};exports[_0x564b('0x45')]=function(_0x58c741,_0x25d980){return db[_0x564b('0x3b')][_0x564b('0x45')](_0x58c741['body'],{})[_0x564b('0x1f')](respondWithResult(_0x25d980,0xc9))[_0x564b('0x44')](handleError(_0x25d980,null));};exports[_0x564b('0x46')]=function(_0x507566,_0x46689f){return db['CmHopperHistory']['describe']()[_0x564b('0x1f')](respondWithResult(_0x46689f,null))[_0x564b('0x44')](handleError(_0x46689f,null));};exports['update']=function(_0x395bf5,_0x5227c1){if(_0x395bf5[_0x564b('0x47')][_0x564b('0x48')]){delete _0x395bf5[_0x564b('0x47')][_0x564b('0x48')];}return db[_0x564b('0x3b')][_0x564b('0x43')]({'where':{'uniqueid':_0x395bf5['params']['id']}})[_0x564b('0x1f')](handleEntityNotFound(_0x5227c1,null))[_0x564b('0x1f')](saveUpdates(_0x395bf5[_0x564b('0x47')],null))[_0x564b('0x1f')](respondWithResult(_0x5227c1,null))['catch'](handleError(_0x5227c1,null));};
\ No newline at end of file
+var _0x8219=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/environment','sendStatus','status','json','count','offset','set','reject','save','update','then','end','error','stack','name','send','index','CmHopperHistory','rawAttributes','model','keys','dateStart','query','dateEnd','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','add','day','filter','merge','includeAll','include','findAll','catch','show','params','options','find','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox'];(function(_0x527d5e,_0x3aa346){var _0x518388=function(_0x5f39e1){while(--_0x5f39e1){_0x527d5e['push'](_0x527d5e['shift']());}};_0x518388(++_0x3aa346);}(_0x8219,0x82));var _0x9821=function(_0x14d08c,_0x5b7091){_0x14d08c=_0x14d08c-0x0;var _0x5f5bd9=_0x8219[_0x14d08c];return _0x5f5bd9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9821('0x0'));var rimraf=require(_0x9821('0x1'));var zipdir=require(_0x9821('0x2'));var jsonpatch=require(_0x9821('0x3'));var rp=require(_0x9821('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9821('0x5'));var util=require(_0x9821('0x6'));var path=require('path');var sox=require(_0x9821('0x7'));var csv=require('to-csv');var ejs=require(_0x9821('0x8'));var fs=require('fs');var _=require(_0x9821('0x9'));var squel=require(_0x9821('0xa'));var crypto=require(_0x9821('0xb'));var jsforce=require(_0x9821('0xc'));var deskjs=require(_0x9821('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9821('0xe'));var Papa=require(_0x9821('0xf'));var qs=require(_0x9821('0x10'));var logger=require('../../config/logger')(_0x9821('0x11'));var utils=require('../../config/utils');var config=require(_0x9821('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e91d8,_0x1f1842){_0x1f1842=_0x1f1842||0xcc;return function(_0x2380f8){if(_0x2380f8){return _0x5e91d8[_0x9821('0x13')](_0x1f1842);}return _0x5e91d8['status'](_0x1f1842)['end']();};}function respondWithResult(_0x87d797,_0x4f68aa){_0x4f68aa=_0x4f68aa||0xc8;return function(_0x307f45){if(_0x307f45){return _0x87d797[_0x9821('0x14')](_0x4f68aa)[_0x9821('0x15')](_0x307f45);}};}function respondWithFilteredResult(_0x425578,_0x178959){return function(_0x48cfa0){if(_0x48cfa0){var _0x4abee8=_0x48cfa0[_0x9821('0x16')],_0xb2cad9=_0x178959['offset'],_0x16cd8c=_0x178959[_0x9821('0x17')]+_0x178959['limit'],_0x54904e;if(_0x16cd8c>=_0x4abee8){_0x16cd8c=_0x4abee8;_0x54904e=0xc8;}else{_0x54904e=0xce;}_0x425578[_0x9821('0x14')](_0x54904e);return _0x425578[_0x9821('0x18')]('Content-Range',_0xb2cad9+'-'+_0x16cd8c+'/'+_0x4abee8)[_0x9821('0x15')](_0x48cfa0);}return null;};}function patchUpdates(_0x52752a){return function(_0x9eaac6){try{jsonpatch['apply'](_0x9eaac6,_0x52752a,!![]);}catch(_0x18c631){return BPromise[_0x9821('0x19')](_0x18c631);}return _0x9eaac6[_0x9821('0x1a')]();};}function saveUpdates(_0x2d80ac,_0x220507){return function(_0x183584){if(_0x183584){return _0x183584[_0x9821('0x1b')](_0x2d80ac)[_0x9821('0x1c')](function(_0x4f327b){return _0x4f327b;});}return null;};}function removeEntity(_0x4afc89,_0x56440c){return function(_0x2f1f69){if(_0x2f1f69){return _0x2f1f69['destroy']()[_0x9821('0x1c')](function(){_0x4afc89[_0x9821('0x14')](0xcc)[_0x9821('0x1d')]();});}};}function handleEntityNotFound(_0x1b7f3c,_0x12234f){return function(_0x45ca19){if(!_0x45ca19){_0x1b7f3c[_0x9821('0x13')](0x194);}return _0x45ca19;};}function handleError(_0x3170a9,_0x2880ec){_0x2880ec=_0x2880ec||0x1f4;return function(_0x544655){logger[_0x9821('0x1e')](_0x544655[_0x9821('0x1f')]);if(_0x544655[_0x9821('0x20')]){delete _0x544655[_0x9821('0x20')];}_0x3170a9[_0x9821('0x14')](_0x2880ec)[_0x9821('0x21')](_0x544655);};}exports[_0x9821('0x22')]=function(_0x32c1c3,_0x569be1){var _0x463d05={},_0x451127={},_0x548380={'count':0x0,'rows':[]};var _0x5a3165=db[_0x9821('0x23')][_0x9821('0x24')];_0x451127[_0x9821('0x25')]=_[_0x9821('0x26')](_0x5a3165);var _0x507a99={'dateStart':_0x32c1c3['query'][_0x9821('0x27')],'dateEnd':_0x32c1c3[_0x9821('0x28')][_0x9821('0x29')]};delete _0x32c1c3[_0x9821('0x28')]['dateStart'];delete _0x32c1c3['query'][_0x9821('0x29')];_0x451127[_0x9821('0x28')]=_[_0x9821('0x26')](_0x32c1c3[_0x9821('0x28')]);_0x451127[_0x9821('0x2a')]=_['intersection'](_0x451127[_0x9821('0x25')],_0x451127[_0x9821('0x28')]);_0x463d05[_0x9821('0x2b')]=_[_0x9821('0x2c')](_0x451127[_0x9821('0x25')],qs[_0x9821('0x2d')](_0x32c1c3['query'][_0x9821('0x2d')]));_0x463d05['attributes']=_0x463d05[_0x9821('0x2b')][_0x9821('0x2e')]?_0x463d05[_0x9821('0x2b')]:_0x451127['model'];if(!_0x32c1c3['query'][_0x9821('0x2f')](_0x9821('0x30'))){_0x463d05['limit']=qs[_0x9821('0x31')](_0x32c1c3['query']['limit']);_0x463d05['offset']=qs[_0x9821('0x17')](_0x32c1c3[_0x9821('0x28')]['offset']);}_0x463d05[_0x9821('0x32')]=qs[_0x9821('0x33')](_0x32c1c3[_0x9821('0x28')][_0x9821('0x33')]);_0x463d05[_0x9821('0x34')]=qs[_0x9821('0x2a')](_[_0x9821('0x35')](_0x32c1c3[_0x9821('0x28')],_0x451127['filters']));if(_0x507a99[_0x9821('0x27')]){if(_0x507a99[_0x9821('0x29')]){_0x507a99['dateEnd']=moment(_0x507a99[_0x9821('0x29')])[_0x9821('0x36')](0x1,_0x9821('0x37'));}else{_0x507a99['dateEnd']=moment(_0x507a99[_0x9821('0x27')])['add'](0x1,_0x9821('0x37'));}_['merge'](_0x463d05[_0x9821('0x34')],{'createdAt':{'$gte':_0x507a99[_0x9821('0x27')],'$lte':_0x507a99[_0x9821('0x29')]}});}if(_0x32c1c3['query'][_0x9821('0x38')]){_0x463d05[_0x9821('0x34')]=_[_0x9821('0x39')](_0x463d05[_0x9821('0x34')],{'$or':_['map'](_0x463d05[_0x9821('0x2b')],function(_0x2b41bd){var _0x2a0159={};_0x2a0159[_0x2b41bd]={'$like':'%'+_0x32c1c3[_0x9821('0x28')][_0x9821('0x38')]+'%'};return _0x2a0159;})});}_0x463d05=_[_0x9821('0x39')]({},_0x463d05,_0x32c1c3['options']);var _0x49aa9b={'where':_0x463d05['where']};return db[_0x9821('0x23')]['count'](_0x49aa9b)[_0x9821('0x1c')](function(_0x4196ad){_0x548380['count']=_0x4196ad;if(_0x32c1c3[_0x9821('0x28')][_0x9821('0x3a')]){_0x463d05[_0x9821('0x3b')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x9821('0x3c')](_0x463d05);})[_0x9821('0x1c')](function(_0x45c5e5){_0x548380['rows']=_0x45c5e5;return _0x548380;})[_0x9821('0x1c')](respondWithFilteredResult(_0x569be1,_0x463d05))[_0x9821('0x3d')](handleError(_0x569be1,null));};exports[_0x9821('0x3e')]=function(_0x2326e7,_0x345d18){var _0x1577e9={'raw':!![],'where':{'id':_0x2326e7[_0x9821('0x3f')]['id']}},_0x2ff439={};_0x2ff439[_0x9821('0x25')]=_[_0x9821('0x26')](db['CmHopperHistory'][_0x9821('0x24')]);_0x2ff439['query']=_[_0x9821('0x26')](_0x2326e7[_0x9821('0x28')]);_0x2ff439[_0x9821('0x2a')]=_[_0x9821('0x2c')](_0x2ff439[_0x9821('0x25')],_0x2ff439['query']);_0x1577e9[_0x9821('0x2b')]=_['intersection'](_0x2ff439[_0x9821('0x25')],qs['fields'](_0x2326e7['query']['fields']));_0x1577e9['attributes']=_0x1577e9[_0x9821('0x2b')][_0x9821('0x2e')]?_0x1577e9[_0x9821('0x2b')]:_0x2ff439[_0x9821('0x25')];if(_0x2326e7[_0x9821('0x28')][_0x9821('0x3a')]){_0x1577e9[_0x9821('0x3b')]=[{'all':!![]}];}_0x1577e9=_[_0x9821('0x39')]({},_0x1577e9,_0x2326e7[_0x9821('0x40')]);return db[_0x9821('0x23')][_0x9821('0x41')](_0x1577e9)[_0x9821('0x1c')](handleEntityNotFound(_0x345d18,null))[_0x9821('0x1c')](respondWithResult(_0x345d18,null))[_0x9821('0x3d')](handleError(_0x345d18,null));};exports['create']=function(_0x1a6630,_0x4e9741){return db[_0x9821('0x23')]['create'](_0x1a6630[_0x9821('0x42')],{})[_0x9821('0x1c')](respondWithResult(_0x4e9741,0xc9))[_0x9821('0x3d')](handleError(_0x4e9741,null));};exports[_0x9821('0x43')]=function(_0x2d30d1,_0x497447){return db['CmHopperHistory'][_0x9821('0x43')]()['then'](respondWithResult(_0x497447,null))[_0x9821('0x3d')](handleError(_0x497447,null));};exports[_0x9821('0x1b')]=function(_0xd7df00,_0x5cf37c){if(_0xd7df00[_0x9821('0x42')][_0x9821('0x44')]){delete _0xd7df00[_0x9821('0x42')][_0x9821('0x44')];}return db['CmHopperHistory'][_0x9821('0x41')]({'where':{'uniqueid':_0xd7df00[_0x9821('0x3f')]['id']}})[_0x9821('0x1c')](handleEntityNotFound(_0x5cf37c,null))[_0x9821('0x1c')](saveUpdates(_0xd7df00[_0x9821('0x42')],null))['then'](respondWithResult(_0x5cf37c,null))[_0x9821('0x3d')](handleError(_0x5cf37c,null));};
\ No newline at end of file
index 81a7f8f..07b4249 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4edc=['api','moment','bluebird','request-promise','./cmHopperHistory.attributes','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util'];(function(_0x44044a,_0x3a0097){var _0x43bb6e=function(_0x1afe12){while(--_0x1afe12){_0x44044a['push'](_0x44044a['shift']());}};_0x43bb6e(++_0x3a0097);}(_0x4edc,0xa3));var _0xc4ed=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x4edc[_0x39c734];return _0xb2a2f9;};'use strict';var _=require(_0xc4ed('0x0'));var util=require(_0xc4ed('0x1'));var logger=require('../../config/logger')(_0xc4ed('0x2'));var moment=require(_0xc4ed('0x3'));var BPromise=require(_0xc4ed('0x4'));var rp=require(_0xc4ed('0x5'));var attributes=require(_0xc4ed('0x6'));module['exports']=function(_0x52b00d,_0x4af577){return _0x52b00d['define'](_0xc4ed('0x7'),attributes,{'tableName':_0xc4ed('0x8'),'paranoid':![],'indexes':[{'name':_0xc4ed('0x9'),'fields':[_0xc4ed('0x9')]},{'name':_0xc4ed('0xa'),'fields':[_0xc4ed('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7cf=['CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','request-promise','./cmHopperHistory.attributes','exports','define'];(function(_0x6ee82,_0x387cbf){var _0x54c5d7=function(_0x46b614){while(--_0x46b614){_0x6ee82['push'](_0x6ee82['shift']());}};_0x54c5d7(++_0x387cbf);}(_0xb7cf,0x14e));var _0xfb7c=function(_0x3eaf5e,_0x3c9120){_0x3eaf5e=_0x3eaf5e-0x0;var _0x2e7aad=_0xb7cf[_0x3eaf5e];return _0x2e7aad;};'use strict';var _=require(_0xfb7c('0x0'));var util=require(_0xfb7c('0x1'));var logger=require(_0xfb7c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfb7c('0x3'));var attributes=require(_0xfb7c('0x4'));module[_0xfb7c('0x5')]=function(_0x4542db,_0x5612ca){return _0x4542db[_0xfb7c('0x6')](_0xfb7c('0x7'),attributes,{'tableName':_0xfb7c('0x8'),'paranoid':![],'indexes':[{'name':_0xfb7c('0x9'),'fields':[_0xfb7c('0x9')]},{'name':_0xfb7c('0xa'),'fields':[_0xfb7c('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index df03025..3218c23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2ed=['debug','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','then','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','request','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','options','raw','info'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xe2ed,0x1c3));var _0xde2e=function(_0x27d325,_0x3a77df){_0x27d325=_0x27d325-0x0;var _0x4b2210=_0xe2ed[_0x27d325];return _0x4b2210;};'use strict';var _=require(_0xde2e('0x0'));var util=require(_0xde2e('0x1'));var moment=require(_0xde2e('0x2'));var BPromise=require(_0xde2e('0x3'));var rs=require(_0xde2e('0x4'));var fs=require('fs');var db=require(_0xde2e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde2e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xde2e('0x7'));var client=jayson[_0xde2e('0x8')][_0xde2e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfe8aa,_0x147b9b,_0x17d9fe){return new BPromise(function(_0x20f7d5,_0x3af7d8){return client[_0xde2e('0xa')](_0xfe8aa,_0x17d9fe)['then'](function(_0x40989e){logger['info'](_0xde2e('0xb'),_0x147b9b,_0xde2e('0xc'));logger['debug'](_0xde2e('0xd'),_0x147b9b,_0xde2e('0xc'),JSON[_0xde2e('0xe')](_0x40989e));if(_0x40989e[_0xde2e('0xf')]){if(_0x40989e[_0xde2e('0xf')][_0xde2e('0x10')]===0x1f4){logger[_0xde2e('0xf')](_0xde2e('0xb'),_0x147b9b,_0x40989e[_0xde2e('0xf')][_0xde2e('0x11')]);return _0x3af7d8(_0x40989e['error']['message']);}logger[_0xde2e('0xf')](_0xde2e('0xb'),_0x147b9b,_0x40989e[_0xde2e('0xf')][_0xde2e('0x11')]);return _0x20f7d5(_0x40989e[_0xde2e('0xf')]['message']);}else{logger['info'](_0xde2e('0xb'),_0x147b9b,_0xde2e('0xc'));_0x20f7d5(_0x40989e[_0xde2e('0x12')][_0xde2e('0x11')]);}})[_0xde2e('0x13')](function(_0x3f235a){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x147b9b,_0x3f235a);_0x3af7d8(_0x3f235a);});});}exports[_0xde2e('0x14')]=function(_0x29a11a){var _0x5b2420=this;return new Promise(function(_0x173593,_0x4b3440){return db[_0xde2e('0x15')]['create'](_0x29a11a['body'],{'raw':_0x29a11a[_0xde2e('0x16')]?_0x29a11a['options'][_0xde2e('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x383abe){logger[_0xde2e('0x18')](_0xde2e('0x14'),_0x29a11a);logger[_0xde2e('0x19')]('CreateCmHopperHistory',_0x29a11a,JSON[_0xde2e('0xe')](_0x383abe));_0x173593(_0x383abe);})[_0xde2e('0x13')](function(_0x1a4469){logger[_0xde2e('0xf')](_0xde2e('0x14'),_0x1a4469['message'],_0x29a11a);_0x4b3440(_0x5b2420[_0xde2e('0xf')](0x1f4,_0x1a4469[_0xde2e('0x11')]));});});};exports[_0xde2e('0x1a')]=function(_0x327d60){var _0x38fc89=this;return new Promise(function(_0x2884fa,_0x586c9e){return db[_0xde2e('0x15')][_0xde2e('0x1b')]({'raw':_0x327d60[_0xde2e('0x16')]?_0x327d60[_0xde2e('0x16')][_0xde2e('0x17')]===undefined?!![]:![]:!![],'where':_0x327d60[_0xde2e('0x16')]?_0x327d60[_0xde2e('0x16')][_0xde2e('0x1c')]||null:null,'attributes':[[db[_0xde2e('0x1d')]['fn'](_0xde2e('0x1e'),db['sequelize'][_0xde2e('0x1f')]('id')),_0xde2e('0x20')],[db[_0xde2e('0x1d')]['fn'](_0xde2e('0x1e'),db['sequelize']['fn']('IF',db[_0xde2e('0x1d')][_0xde2e('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0xde2e('0x22')],[db[_0xde2e('0x1d')]['fn'](_0xde2e('0x1e'),db[_0xde2e('0x1d')]['fn']('IF',db[_0xde2e('0x1d')]['literal']('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xde2e('0x1d')]['fn'](_0xde2e('0x1e'),db[_0xde2e('0x1d')]['fn']('IF',db[_0xde2e('0x1d')][_0xde2e('0x21')](_0xde2e('0x23')))),_0xde2e('0x24')],[db[_0xde2e('0x1d')]['fn'](_0xde2e('0x25'),db[_0xde2e('0x1d')]['fn']('IF',db[_0xde2e('0x1d')][_0xde2e('0x21')](_0xde2e('0x26')))),_0xde2e('0x27')],[db['sequelize']['fn'](_0xde2e('0x25'),db[_0xde2e('0x1d')]['fn']('IF',db[_0xde2e('0x1d')][_0xde2e('0x21')](_0xde2e('0x28')))),_0xde2e('0x29')]]})[_0xde2e('0x2a')](function(_0x349631){logger[_0xde2e('0x18')](_0xde2e('0x1a'),_0x327d60);logger['debug']('AvgHandleTime',_0x327d60,JSON[_0xde2e('0xe')](_0x349631));_0x2884fa(_0x349631);})[_0xde2e('0x13')](function(_0x527b9a){logger[_0xde2e('0xf')](_0xde2e('0x1a'),_0x527b9a[_0xde2e('0x11')],_0x327d60);_0x586c9e(_0x38fc89[_0xde2e('0xf')](0x1f4,_0x527b9a[_0xde2e('0x11')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x488d5f){var _0x496377=this;return new Promise(function(_0x5a11f2,_0x5b201e){return db['CmHopperHistory'][_0xde2e('0x1b')]({'raw':_0x488d5f[_0xde2e('0x16')]?_0x488d5f[_0xde2e('0x16')][_0xde2e('0x17')]===undefined?!![]:![]:!![],'where':_0x488d5f[_0xde2e('0x16')]?_0x488d5f['options']['where']||null:null,'attributes':[[_0xde2e('0x2b'),_0xde2e('0x2c')],[db['sequelize']['fn'](_0xde2e('0x1e'),db[_0xde2e('0x1d')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),_0xde2e('0x2d')],[db[_0xde2e('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xde2e('0x1d')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db[_0xde2e('0x1d')]['fn'](_0xde2e('0x1e'),db[_0xde2e('0x1d')]['fn']('IF',db['sequelize'][_0xde2e('0x21')](_0xde2e('0x2e')))),_0xde2e('0x2f')],[db[_0xde2e('0x1d')]['fn'](_0xde2e('0x1e'),db[_0xde2e('0x1d')]['fn']('IF',db[_0xde2e('0x1d')][_0xde2e('0x21')](_0xde2e('0x30')))),_0xde2e('0x31')],[db[_0xde2e('0x1d')]['fn'](_0xde2e('0x1e'),db[_0xde2e('0x1d')]['fn']('IF',db[_0xde2e('0x1d')][_0xde2e('0x21')](_0xde2e('0x32')))),'outboundCongestionCallsDay'],[db[_0xde2e('0x1d')]['fn'](_0xde2e('0x1e'),db[_0xde2e('0x1d')]['fn']('IF',db[_0xde2e('0x1d')]['literal'](_0xde2e('0x33')))),_0xde2e('0x34')],[db[_0xde2e('0x1d')]['fn'](_0xde2e('0x1e'),db[_0xde2e('0x1d')]['fn']('IF',db['sequelize'][_0xde2e('0x21')](_0xde2e('0x35')))),_0xde2e('0x36')],[db[_0xde2e('0x1d')]['fn'](_0xde2e('0x1e'),db[_0xde2e('0x1d')]['fn']('IF',db[_0xde2e('0x1d')][_0xde2e('0x21')]('`state`\x20=\x2012,\x201,\x20null'))),_0xde2e('0x37')],[db[_0xde2e('0x1d')]['fn'](_0xde2e('0x1e'),db[_0xde2e('0x1d')]['fn']('IF',db[_0xde2e('0x1d')][_0xde2e('0x21')](_0xde2e('0x38')))),_0xde2e('0x39')],[db[_0xde2e('0x1d')]['fn'](_0xde2e('0x1e'),db[_0xde2e('0x1d')]['fn']('IF',db[_0xde2e('0x1d')]['literal']('`state`\x20=\x2014,\x201,\x20null'))),_0xde2e('0x3a')],[db[_0xde2e('0x1d')]['fn'](_0xde2e('0x1e'),db[_0xde2e('0x1d')]['fn']('IF',db[_0xde2e('0x1d')][_0xde2e('0x21')](_0xde2e('0x3b')))),_0xde2e('0x3c')],[db[_0xde2e('0x1d')]['fn'](_0xde2e('0x1e'),db['sequelize']['fn']('IF',db[_0xde2e('0x1d')][_0xde2e('0x21')]('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn'](_0xde2e('0x1e'),db[_0xde2e('0x1d')]['fn']('IF',db[_0xde2e('0x1d')]['literal'](_0xde2e('0x3d')))),_0xde2e('0x3c')],[db[_0xde2e('0x1d')]['fn'](_0xde2e('0x1e'),db[_0xde2e('0x1d')]['fn']('IF',db['sequelize'][_0xde2e('0x21')](_0xde2e('0x3e')))),_0xde2e('0x3f')]],'group':[_0xde2e('0x2b')]})['then'](function(_0x35ea61){logger[_0xde2e('0x18')](_0xde2e('0x40'),_0x488d5f);logger['debug']('GetVoiceQueueHopperHistory',_0x488d5f,JSON['stringify'](_0x35ea61));_0x5a11f2(_0x35ea61);})[_0xde2e('0x13')](function(_0x3f1f9e){logger[_0xde2e('0xf')](_0xde2e('0x40'),_0x3f1f9e[_0xde2e('0x11')],_0x488d5f);_0x5b201e(_0x496377['error'](0x1f4,_0x3f1f9e[_0xde2e('0x11')]));});});};exports['GetCampaignHopperHistory']=function(_0x3b3398){var _0xf6f1a2=this;return new Promise(function(_0x5ac593,_0x265883){return db[_0xde2e('0x15')][_0xde2e('0x1b')]({'raw':_0x3b3398[_0xde2e('0x16')]?_0x3b3398['options'][_0xde2e('0x17')]===undefined?!![]:![]:!![],'where':_0x3b3398['options']?_0x3b3398[_0xde2e('0x16')]['where']||null:null,'attributes':[['campaign','name'],[db[_0xde2e('0x1d')]['fn']('COUNT',db['sequelize']['col']('id')),_0xde2e('0x41')],[db['sequelize']['fn'](_0xde2e('0x1e'),db[_0xde2e('0x1d')]['fn']('IF',db[_0xde2e('0x1d')][_0xde2e('0x21')](_0xde2e('0x2e')))),_0xde2e('0x42')]],'group':[_0xde2e('0x2b')]})[_0xde2e('0x2a')](function(_0x4a19d5){logger[_0xde2e('0x18')](_0xde2e('0x43'),_0x3b3398);logger[_0xde2e('0x19')](_0xde2e('0x43'),_0x3b3398,JSON[_0xde2e('0xe')](_0x4a19d5));_0x5ac593(_0x4a19d5);})['catch'](function(_0x214245){logger[_0xde2e('0xf')](_0xde2e('0x43'),_0x214245['message'],_0x3b3398);_0x265883(_0xf6f1a2[_0xde2e('0xf')](0x1f4,_0x214245[_0xde2e('0x11')]));});});};
\ No newline at end of file
+var _0x0458=['predictiveIntervalTotalCalls','COUNT','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','literal','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','options','raw','debug','findAll','where','sequelize','col'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x0458,0x12c));var _0x8045=function(_0x96ac24,_0x10fd02){_0x96ac24=_0x96ac24-0x0;var _0x266a9f=_0x0458[_0x96ac24];return _0x266a9f;};'use strict';var _=require('lodash');var util=require(_0x8045('0x0'));var moment=require(_0x8045('0x1'));var BPromise=require(_0x8045('0x2'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x8045('0x3'))['db'];var utils=require(_0x8045('0x4'));var logger=require(_0x8045('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8045('0x6'));var client=jayson[_0x8045('0x7')][_0x8045('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x90e7b2,_0x5bba99,_0xa62ddb){return new BPromise(function(_0xcbabc9,_0xe958c1){return client[_0x8045('0x9')](_0x90e7b2,_0xa62ddb)[_0x8045('0xa')](function(_0x44d8f9){logger[_0x8045('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x5bba99,_0x8045('0xc'));logger['debug'](_0x8045('0xd'),_0x5bba99,_0x8045('0xc'),JSON[_0x8045('0xe')](_0x44d8f9));if(_0x44d8f9[_0x8045('0xf')]){if(_0x44d8f9[_0x8045('0xf')]['code']===0x1f4){logger[_0x8045('0xf')](_0x8045('0x10'),_0x5bba99,_0x44d8f9[_0x8045('0xf')][_0x8045('0x11')]);return _0xe958c1(_0x44d8f9[_0x8045('0xf')][_0x8045('0x11')]);}logger[_0x8045('0xf')](_0x8045('0x10'),_0x5bba99,_0x44d8f9['error'][_0x8045('0x11')]);return _0xcbabc9(_0x44d8f9[_0x8045('0xf')][_0x8045('0x11')]);}else{logger[_0x8045('0xb')](_0x8045('0x10'),_0x5bba99,'request\x20sent');_0xcbabc9(_0x44d8f9[_0x8045('0x12')]['message']);}})[_0x8045('0x13')](function(_0x2d20aa){logger[_0x8045('0xf')](_0x8045('0x10'),_0x5bba99,_0x2d20aa);_0xe958c1(_0x2d20aa);});});}exports[_0x8045('0x14')]=function(_0x5354d6){var _0x18bdc4=this;return new Promise(function(_0x4ff7af,_0x7d0c1e){return db[_0x8045('0x15')][_0x8045('0x16')](_0x5354d6['body'],{'raw':_0x5354d6[_0x8045('0x17')]?_0x5354d6['options'][_0x8045('0x18')]===undefined?!![]:![]:!![]})[_0x8045('0xa')](function(_0x4c4551){logger[_0x8045('0xb')]('CreateCmHopperHistory',_0x5354d6);logger[_0x8045('0x19')](_0x8045('0x14'),_0x5354d6,JSON['stringify'](_0x4c4551));_0x4ff7af(_0x4c4551);})[_0x8045('0x13')](function(_0x421b8b){logger[_0x8045('0xf')](_0x8045('0x14'),_0x421b8b[_0x8045('0x11')],_0x5354d6);_0x7d0c1e(_0x18bdc4[_0x8045('0xf')](0x1f4,_0x421b8b[_0x8045('0x11')]));});});};exports['AvgHandleTime']=function(_0x1dc662){var _0x4542ea=this;return new Promise(function(_0x4cde27,_0x1f9486){return db[_0x8045('0x15')][_0x8045('0x1a')]({'raw':_0x1dc662[_0x8045('0x17')]?_0x1dc662[_0x8045('0x17')][_0x8045('0x18')]===undefined?!![]:![]:!![],'where':_0x1dc662['options']?_0x1dc662['options'][_0x8045('0x1b')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x8045('0x1c')][_0x8045('0x1d')]('id')),_0x8045('0x1e')],[db['sequelize']['fn'](_0x8045('0x1f'),db[_0x8045('0x1c')]['fn']('IF',db[_0x8045('0x1c')]['literal'](_0x8045('0x20')))),_0x8045('0x21')],[db['sequelize']['fn'](_0x8045('0x1f'),db[_0x8045('0x1c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0x8045('0x22')],[db[_0x8045('0x1c')]['fn'](_0x8045('0x1f'),db[_0x8045('0x1c')]['fn']('IF',db[_0x8045('0x1c')][_0x8045('0x23')]('`state`\x20=\x2011,\x201,\x20null'))),_0x8045('0x24')],[db['sequelize']['fn'](_0x8045('0x25'),db[_0x8045('0x1c')]['fn']('IF',db[_0x8045('0x1c')]['literal'](_0x8045('0x26')))),_0x8045('0x27')],[db['sequelize']['fn'](_0x8045('0x25'),db[_0x8045('0x1c')]['fn']('IF',db['sequelize'][_0x8045('0x23')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x8045('0x28')]]})[_0x8045('0xa')](function(_0x494f18){logger['info']('AvgHandleTime',_0x1dc662);logger['debug']('AvgHandleTime',_0x1dc662,JSON[_0x8045('0xe')](_0x494f18));_0x4cde27(_0x494f18);})[_0x8045('0x13')](function(_0x37f76a){logger[_0x8045('0xf')](_0x8045('0x29'),_0x37f76a[_0x8045('0x11')],_0x1dc662);_0x1f9486(_0x4542ea[_0x8045('0xf')](0x1f4,_0x37f76a[_0x8045('0x11')]));});});};exports[_0x8045('0x2a')]=function(_0x2012c2){var _0x200b58=this;return new Promise(function(_0x47a18b,_0x485f3e){return db[_0x8045('0x15')][_0x8045('0x1a')]({'raw':_0x2012c2[_0x8045('0x17')]?_0x2012c2[_0x8045('0x17')][_0x8045('0x18')]===undefined?!![]:![]:!![],'where':_0x2012c2[_0x8045('0x17')]?_0x2012c2[_0x8045('0x17')][_0x8045('0x1b')]||null:null,'attributes':[[_0x8045('0x2b'),_0x8045('0x2c')],[db[_0x8045('0x1c')]['fn'](_0x8045('0x1f'),db[_0x8045('0x1c')]['fn']('IF',db[_0x8045('0x1c')]['literal'](_0x8045('0x2d')))),'outboundNoSuchCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x8045('0x1c')]['fn']('IF',db[_0x8045('0x1c')][_0x8045('0x23')](_0x8045('0x2e')))),'outboundNoAnswerCallsDay'],[db[_0x8045('0x1c')]['fn'](_0x8045('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0x8045('0x23')](_0x8045('0x20')))),_0x8045('0x2f')],[db[_0x8045('0x1c')]['fn'](_0x8045('0x1f'),db['sequelize']['fn']('IF',db[_0x8045('0x1c')][_0x8045('0x23')]('`state`\x20=\x205,\x201,\x20null'))),_0x8045('0x30')],[db['sequelize']['fn']('COUNT',db[_0x8045('0x1c')]['fn']('IF',db[_0x8045('0x1c')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0x8045('0x1c')]['fn'](_0x8045('0x1f'),db[_0x8045('0x1c')]['fn']('IF',db[_0x8045('0x1c')][_0x8045('0x23')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x8045('0x31')],[db[_0x8045('0x1c')]['fn'](_0x8045('0x1f'),db[_0x8045('0x1c')]['fn']('IF',db['sequelize'][_0x8045('0x23')](_0x8045('0x32')))),_0x8045('0x33')],[db[_0x8045('0x1c')]['fn']('COUNT',db[_0x8045('0x1c')]['fn']('IF',db[_0x8045('0x1c')][_0x8045('0x23')](_0x8045('0x34')))),_0x8045('0x35')],[db['sequelize']['fn'](_0x8045('0x1f'),db[_0x8045('0x1c')]['fn']('IF',db[_0x8045('0x1c')][_0x8045('0x23')](_0x8045('0x36')))),_0x8045('0x37')],[db[_0x8045('0x1c')]['fn'](_0x8045('0x1f'),db[_0x8045('0x1c')]['fn']('IF',db[_0x8045('0x1c')][_0x8045('0x23')](_0x8045('0x38')))),'outboundOriginateFailureCallsDay'],[db[_0x8045('0x1c')]['fn']('COUNT',db[_0x8045('0x1c')]['fn']('IF',db[_0x8045('0x1c')]['literal'](_0x8045('0x39')))),_0x8045('0x3a')],[db[_0x8045('0x1c')]['fn'](_0x8045('0x1f'),db[_0x8045('0x1c')]['fn']('IF',db['sequelize']['literal'](_0x8045('0x3b')))),_0x8045('0x3c')],[db[_0x8045('0x1c')]['fn']('COUNT',db[_0x8045('0x1c')]['fn']('IF',db[_0x8045('0x1c')][_0x8045('0x23')](_0x8045('0x3d')))),_0x8045('0x3a')],[db[_0x8045('0x1c')]['fn'](_0x8045('0x1f'),db[_0x8045('0x1c')]['fn']('IF',db[_0x8045('0x1c')][_0x8045('0x23')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x8045('0x3e')]],'group':[_0x8045('0x2b')]})['then'](function(_0x5c3d1b){logger['info']('GetVoiceQueueHopperHistory',_0x2012c2);logger[_0x8045('0x19')](_0x8045('0x2a'),_0x2012c2,JSON[_0x8045('0xe')](_0x5c3d1b));_0x47a18b(_0x5c3d1b);})[_0x8045('0x13')](function(_0x450407){logger[_0x8045('0xf')](_0x8045('0x2a'),_0x450407[_0x8045('0x11')],_0x2012c2);_0x485f3e(_0x200b58[_0x8045('0xf')](0x1f4,_0x450407[_0x8045('0x11')]));});});};exports[_0x8045('0x3f')]=function(_0x523ab7){var _0x2363de=this;return new Promise(function(_0x3b089e,_0x36bf64){return db['CmHopperHistory'][_0x8045('0x1a')]({'raw':_0x523ab7[_0x8045('0x17')]?_0x523ab7[_0x8045('0x17')][_0x8045('0x18')]===undefined?!![]:![]:!![],'where':_0x523ab7[_0x8045('0x17')]?_0x523ab7[_0x8045('0x17')][_0x8045('0x1b')]||null:null,'attributes':[[_0x8045('0x2b'),'name'],[db[_0x8045('0x1c')]['fn'](_0x8045('0x1f'),db['sequelize'][_0x8045('0x1d')]('id')),_0x8045('0x40')],[db[_0x8045('0x1c')]['fn'](_0x8045('0x1f'),db[_0x8045('0x1c')]['fn']('IF',db[_0x8045('0x1c')][_0x8045('0x23')](_0x8045('0x20')))),_0x8045('0x41')]],'group':['campaign']})[_0x8045('0xa')](function(_0x5528d0){logger[_0x8045('0xb')](_0x8045('0x3f'),_0x523ab7);logger[_0x8045('0x19')](_0x8045('0x3f'),_0x523ab7,JSON[_0x8045('0xe')](_0x5528d0));_0x3b089e(_0x5528d0);})['catch'](function(_0x362d52){logger[_0x8045('0xf')]('GetCampaignHopperHistory',_0x362d52[_0x8045('0x11')],_0x523ab7);_0x36bf64(_0x2363de['error'](0x1f4,_0x362d52[_0x8045('0x11')]));});});};
\ No newline at end of file
index 8856203..006507f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['/describe','describe','create','put','/:id','update','multer','util','path','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index'];(function(_0x38cbc8,_0x5b262c){var _0x3d34af=function(_0x32ea8d){while(--_0x32ea8d){_0x38cbc8['push'](_0x38cbc8['shift']());}};_0x3d34af(++_0x5b262c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x0a9e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0a9e('0x4'));var controller=require(_0x0a9e('0x5'));router[_0x0a9e('0x6')]('/',auth[_0x0a9e('0x7')](),controller[_0x0a9e('0x8')]);router['get'](_0x0a9e('0x9'),auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xa')]);router['get']('/:id',auth[_0x0a9e('0x7')](),controller['show']);router['post']('/',auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')](_0x0a9e('0xd'),auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['/describe','describe','create','put','/:id','update','multer','util','path','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index'];(function(_0x3c6ab9,_0x43cb59){var _0x1dc00d=function(_0x2a755b){while(--_0x2a755b){_0x3c6ab9['push'](_0x3c6ab9['shift']());}};_0x1dc00d(++_0x43cb59);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x0a9e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0a9e('0x4'));var controller=require(_0x0a9e('0x5'));router[_0x0a9e('0x6')]('/',auth[_0x0a9e('0x7')](),controller[_0x0a9e('0x8')]);router['get'](_0x0a9e('0x9'),auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xa')]);router['get']('/:id',auth[_0x0a9e('0x7')](),controller['show']);router['post']('/',auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')](_0x0a9e('0xd'),auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xe')]);module['exports']=router;
\ No newline at end of file
index b1a97fc..24bd6c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98a8=['sequelize','exports','STRING','name'];(function(_0x46c13c,_0x48f96c){var _0x494f70=function(_0x468e94){while(--_0x468e94){_0x46c13c['push'](_0x46c13c['shift']());}};_0x494f70(++_0x48f96c);}(_0x98a8,0x12c));var _0x898a=function(_0x1469f9,_0x54f92e){_0x1469f9=_0x1469f9-0x0;var _0x2c3e2d=_0x98a8[_0x1469f9];return _0x2c3e2d;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'unique':_0x898a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x898a('0x2')]},'dialPrefix':{'type':Sequelize[_0x898a('0x2')]}};
\ No newline at end of file
+var _0x7da7=['exports','STRING','sequelize'];(function(_0x56a061,_0x53fb1b){var _0x105fa0=function(_0x164d08){while(--_0x164d08){_0x56a061['push'](_0x56a061['shift']());}};_0x105fa0(++_0x53fb1b);}(_0x7da7,0x10d));var _0x77da=function(_0x58ae8a,_0x3c619e){_0x58ae8a=_0x58ae8a-0x0;var _0x2f0b6b=_0x7da7[_0x58ae8a];return _0x2f0b6b;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'name':{'type':Sequelize[_0x77da('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x77da('0x2')]}};
\ No newline at end of file
index 88cca8e..6d1c0c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./cmList.socket','register','sendStatus','json','offset','limit','status','set','Content-Range','apply','reject','update','then','destroy','end','stack','send','index','CmList','rawAttributes','model','keys','dateStart','query','dateEnd','filters','intersection','fields','attributes','nolimit','order','sort','where','add','day','merge','filter','options','count','includeAll','include','findAll','show','length','find','catch','create','body','params','describe','addDisposition','ListId','Disposition','hasOwnProperty','pick','map','rows','removeDispositions','CmContact','tags','isArray','join','push','each','omit','ids','success','dataValues','errors','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContacts','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','addCustomField','findOne','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','type','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x70e0,0x17b));var _0x070e=function(_0x4ad5eb,_0x3c6b1a){_0x4ad5eb=_0x4ad5eb-0x0;var _0x33a738=_0x70e0[_0x4ad5eb];return _0x33a738;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var qs=require(_0x070e('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0x070e('0xf'));var config=require(_0x070e('0x10'));var db=require(_0x070e('0x11'))['db'];var socket=require(_0x070e('0x12'))({'host':_0x070e('0x13'),'port':0x18eb});require(_0x070e('0x14'))[_0x070e('0x15')](socket);function respondWithStatusCode(_0x1baa12,_0x39d2b9){_0x39d2b9=_0x39d2b9||0xcc;return function(_0x5bf079){if(_0x5bf079){return _0x1baa12[_0x070e('0x16')](_0x39d2b9);}return _0x1baa12['status'](_0x39d2b9)['end']();};}function respondWithResult(_0x24baba,_0x56c7ba){_0x56c7ba=_0x56c7ba||0xc8;return function(_0x4a33d2){if(_0x4a33d2){return _0x24baba['status'](_0x56c7ba)[_0x070e('0x17')](_0x4a33d2);}};}function respondWithFilteredResult(_0x14c3fd,_0x51d14d){return function(_0x5d3a38){if(_0x5d3a38){var _0x373d86=_0x5d3a38['count'],_0xeae1a5=_0x51d14d['offset'],_0x180897=_0x51d14d[_0x070e('0x18')]+_0x51d14d[_0x070e('0x19')],_0x19d9da;if(_0x180897>=_0x373d86){_0x180897=_0x373d86;_0x19d9da=0xc8;}else{_0x19d9da=0xce;}_0x14c3fd[_0x070e('0x1a')](_0x19d9da);return _0x14c3fd[_0x070e('0x1b')](_0x070e('0x1c'),_0xeae1a5+'-'+_0x180897+'/'+_0x373d86)['json'](_0x5d3a38);}return null;};}function patchUpdates(_0x3938b5){return function(_0x168dc6){try{jsonpatch[_0x070e('0x1d')](_0x168dc6,_0x3938b5,!![]);}catch(_0x3ea105){return BPromise[_0x070e('0x1e')](_0x3ea105);}return _0x168dc6['save']();};}function saveUpdates(_0x5b2f48,_0x4e958f){return function(_0x9907cf){if(_0x9907cf){return _0x9907cf[_0x070e('0x1f')](_0x5b2f48)[_0x070e('0x20')](function(_0x4be0d7){return _0x4be0d7;});}return null;};}function removeEntity(_0x5b184,_0x5dc5d2){return function(_0xf8dd5d){if(_0xf8dd5d){return _0xf8dd5d[_0x070e('0x21')]()[_0x070e('0x20')](function(){_0x5b184[_0x070e('0x1a')](0xcc)[_0x070e('0x22')]();});}};}function handleEntityNotFound(_0xa86797,_0xe405e){return function(_0x164cdf){if(!_0x164cdf){_0xa86797['sendStatus'](0x194);}return _0x164cdf;};}function handleError(_0x2f8055,_0x270061){_0x270061=_0x270061||0x1f4;return function(_0x4790eb){logger['error'](_0x4790eb[_0x070e('0x23')]);if(_0x4790eb['name']){delete _0x4790eb['name'];}_0x2f8055[_0x070e('0x1a')](_0x270061)[_0x070e('0x24')](_0x4790eb);};}exports[_0x070e('0x25')]=function(_0x1743cc,_0x4763c6){var _0x497f58={},_0x374c54={},_0x219e48={'count':0x0,'rows':[]};var _0x1d72d6=db[_0x070e('0x26')][_0x070e('0x27')];_0x374c54[_0x070e('0x28')]=_[_0x070e('0x29')](_0x1d72d6);var _0x26373b={'dateStart':_0x1743cc['query'][_0x070e('0x2a')],'dateEnd':_0x1743cc[_0x070e('0x2b')][_0x070e('0x2c')]};delete _0x1743cc['query']['dateStart'];delete _0x1743cc[_0x070e('0x2b')][_0x070e('0x2c')];_0x374c54[_0x070e('0x2b')]=_['keys'](_0x1743cc[_0x070e('0x2b')]);_0x374c54[_0x070e('0x2d')]=_[_0x070e('0x2e')](_0x374c54[_0x070e('0x28')],_0x374c54['query']);_0x497f58['attributes']=_['intersection'](_0x374c54['model'],qs[_0x070e('0x2f')](_0x1743cc['query'][_0x070e('0x2f')]));_0x497f58[_0x070e('0x30')]=_0x497f58['attributes']['length']?_0x497f58[_0x070e('0x30')]:_0x374c54[_0x070e('0x28')];if(!_0x1743cc['query']['hasOwnProperty'](_0x070e('0x31'))){_0x497f58[_0x070e('0x19')]=qs[_0x070e('0x19')](_0x1743cc[_0x070e('0x2b')][_0x070e('0x19')]);_0x497f58['offset']=qs['offset'](_0x1743cc[_0x070e('0x2b')][_0x070e('0x18')]);}_0x497f58[_0x070e('0x32')]=qs[_0x070e('0x33')](_0x1743cc[_0x070e('0x2b')]['sort']);_0x497f58[_0x070e('0x34')]=qs[_0x070e('0x2d')](_['pick'](_0x1743cc[_0x070e('0x2b')],_0x374c54[_0x070e('0x2d')]));if(_0x26373b['dateStart']){if(_0x26373b['dateEnd']){_0x26373b['dateEnd']=moment(_0x26373b[_0x070e('0x2c')])[_0x070e('0x35')](0x1,_0x070e('0x36'));}else{_0x26373b[_0x070e('0x2c')]=moment(_0x26373b[_0x070e('0x2a')])['add'](0x1,_0x070e('0x36'));}_[_0x070e('0x37')](_0x497f58[_0x070e('0x34')],{'createdAt':{'$gte':_0x26373b['dateStart'],'$lte':_0x26373b[_0x070e('0x2c')]}});}if(_0x1743cc[_0x070e('0x2b')][_0x070e('0x38')]){_0x497f58['where']=_[_0x070e('0x37')](_0x497f58[_0x070e('0x34')],{'$or':_['map'](_0x497f58[_0x070e('0x30')],function(_0x5d689b){var _0x18dae9={};_0x18dae9[_0x5d689b]={'$like':'%'+_0x1743cc[_0x070e('0x2b')][_0x070e('0x38')]+'%'};return _0x18dae9;})});}_0x497f58=_[_0x070e('0x37')]({},_0x497f58,_0x1743cc[_0x070e('0x39')]);var _0x47b929={'where':_0x497f58[_0x070e('0x34')]};return db['CmList']['count'](_0x47b929)[_0x070e('0x20')](function(_0x42c448){_0x219e48[_0x070e('0x3a')]=_0x42c448;if(_0x1743cc['query'][_0x070e('0x3b')]){_0x497f58[_0x070e('0x3c')]=[{'all':!![]}];}return db[_0x070e('0x26')][_0x070e('0x3d')](_0x497f58);})['then'](function(_0x13e4e0){_0x219e48['rows']=_0x13e4e0;return _0x219e48;})['then'](respondWithFilteredResult(_0x4763c6,_0x497f58))['catch'](handleError(_0x4763c6,null));};exports[_0x070e('0x3e')]=function(_0x926533,_0x26b3e2){var _0x29dccd={'raw':![],'where':{'id':_0x926533['params']['id']}},_0x34f23e={};_0x34f23e[_0x070e('0x28')]=_['keys'](db[_0x070e('0x26')][_0x070e('0x27')]);_0x34f23e[_0x070e('0x2b')]=_['keys'](_0x926533['query']);_0x34f23e[_0x070e('0x2d')]=_['intersection'](_0x34f23e[_0x070e('0x28')],_0x34f23e[_0x070e('0x2b')]);_0x29dccd[_0x070e('0x30')]=_['intersection'](_0x34f23e[_0x070e('0x28')],qs[_0x070e('0x2f')](_0x926533['query']['fields']));_0x29dccd[_0x070e('0x30')]=_0x29dccd[_0x070e('0x30')][_0x070e('0x3f')]?_0x29dccd[_0x070e('0x30')]:_0x34f23e[_0x070e('0x28')];if(_0x926533['query'][_0x070e('0x3b')]){_0x29dccd[_0x070e('0x3c')]=[{'all':!![]}];}_0x29dccd=_[_0x070e('0x37')]({},_0x29dccd,_0x926533[_0x070e('0x39')]);return db[_0x070e('0x26')][_0x070e('0x40')](_0x29dccd)[_0x070e('0x20')](handleEntityNotFound(_0x26b3e2,null))[_0x070e('0x20')](respondWithResult(_0x26b3e2,null))[_0x070e('0x41')](handleError(_0x26b3e2,null));};exports[_0x070e('0x42')]=function(_0x210c4d,_0x3be553){return db[_0x070e('0x26')][_0x070e('0x42')](_0x210c4d[_0x070e('0x43')],{})['then'](respondWithResult(_0x3be553,0xc9))[_0x070e('0x41')](handleError(_0x3be553,null));};exports[_0x070e('0x1f')]=function(_0x40298a,_0x249e3f){if(_0x40298a[_0x070e('0x43')]['id']){delete _0x40298a[_0x070e('0x43')]['id'];}return db[_0x070e('0x26')][_0x070e('0x40')]({'where':{'id':_0x40298a[_0x070e('0x44')]['id']}})['then'](handleEntityNotFound(_0x249e3f,null))[_0x070e('0x20')](saveUpdates(_0x40298a['body'],null))[_0x070e('0x20')](respondWithResult(_0x249e3f,null))[_0x070e('0x41')](handleError(_0x249e3f,null));};exports['destroy']=function(_0x991d23,_0x130a50){return db[_0x070e('0x26')][_0x070e('0x40')]({'where':{'id':_0x991d23[_0x070e('0x44')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x130a50,null))[_0x070e('0x20')](removeEntity(_0x130a50,null))['catch'](handleError(_0x130a50,null));};exports[_0x070e('0x45')]=function(_0x5bacbd,_0x516161){return db[_0x070e('0x26')][_0x070e('0x45')]()[_0x070e('0x20')](respondWithResult(_0x516161,null))[_0x070e('0x41')](handleError(_0x516161,null));};exports[_0x070e('0x46')]=function(_0x7948ed,_0x440fa1,_0x343785){if(_0x7948ed['body']['id']){delete _0x7948ed[_0x070e('0x43')]['id'];}return db['CmList']['find']({'where':{'id':_0x7948ed[_0x070e('0x44')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x440fa1,null))['then'](function(_0x26af08){if(_0x26af08){_0x7948ed[_0x070e('0x43')][_0x070e('0x47')]=_0x26af08['id'];return db[_0x070e('0x48')][_0x070e('0x42')](_0x7948ed[_0x070e('0x43')]);}})[_0x070e('0x20')](respondWithResult(_0x440fa1,null))['catch'](handleError(_0x440fa1,null));};exports['getDispositions']=function(_0x5943e3,_0x3087e5,_0x1948a5){var _0x29f497={'raw':![],'where':{}};var _0x2f8fcb={};var _0x5ac0b5={'count':0x0,'rows':[]};return db[_0x070e('0x26')]['findOne']({'where':{'id':_0x5943e3[_0x070e('0x44')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x3087e5,null))[_0x070e('0x20')](function(_0x24f303){if(_0x24f303){_0x2f8fcb[_0x070e('0x28')]=_[_0x070e('0x29')](db['Disposition'][_0x070e('0x27')]);_0x2f8fcb[_0x070e('0x2b')]=_[_0x070e('0x29')](_0x5943e3['query']);_0x2f8fcb[_0x070e('0x2d')]=_[_0x070e('0x2e')](_0x2f8fcb['model'],_0x2f8fcb[_0x070e('0x2b')]);_0x29f497['attributes']=_[_0x070e('0x2e')](_0x2f8fcb['model'],qs['fields'](_0x5943e3['query'][_0x070e('0x2f')]));_0x29f497[_0x070e('0x30')]=_0x29f497[_0x070e('0x30')][_0x070e('0x3f')]?_0x29f497[_0x070e('0x30')]:_0x2f8fcb[_0x070e('0x28')];if(!_0x5943e3['query'][_0x070e('0x49')]('nolimit')){_0x29f497[_0x070e('0x19')]=qs['limit'](_0x5943e3[_0x070e('0x2b')][_0x070e('0x19')]);_0x29f497['offset']=qs[_0x070e('0x18')](_0x5943e3['query'][_0x070e('0x18')]);}_0x29f497[_0x070e('0x32')]=qs[_0x070e('0x33')](_0x5943e3[_0x070e('0x2b')][_0x070e('0x33')]);_0x29f497[_0x070e('0x34')]=qs[_0x070e('0x2d')](_[_0x070e('0x4a')](_0x5943e3[_0x070e('0x2b')],_0x2f8fcb[_0x070e('0x2d')]));_0x29f497[_0x070e('0x34')][_0x070e('0x47')]=_0x24f303['id'];if(_0x5943e3[_0x070e('0x2b')][_0x070e('0x38')]){_0x29f497['where']=_[_0x070e('0x37')](_0x29f497[_0x070e('0x34')],{'$or':_[_0x070e('0x4b')](_0x29f497[_0x070e('0x30')],function(_0x5712d1){var _0x2ccd8d={};_0x2ccd8d[_0x5712d1]={'$like':'%'+_0x5943e3[_0x070e('0x2b')][_0x070e('0x38')]+'%'};return _0x2ccd8d;})});}_0x29f497=_[_0x070e('0x37')]({},_0x29f497,_0x5943e3[_0x070e('0x39')]);return db[_0x070e('0x48')]['count']({'where':_0x29f497[_0x070e('0x34')]})[_0x070e('0x20')](function(_0x240ec9){_0x5ac0b5[_0x070e('0x3a')]=_0x240ec9;if(_0x5943e3['query'][_0x070e('0x3b')]){_0x29f497['include']=[{'all':!![]}];}return db[_0x070e('0x48')][_0x070e('0x3d')](_0x29f497);})[_0x070e('0x20')](function(_0x150bf6){_0x5ac0b5[_0x070e('0x4c')]=_0x150bf6;return _0x5ac0b5;});}})['then'](respondWithFilteredResult(_0x3087e5,_0x29f497))[_0x070e('0x41')](handleError(_0x3087e5,null));};exports[_0x070e('0x4d')]=function(_0x8cc913,_0x114bcf,_0x5591dd){var _0x26b2c0;return db['CmList'][_0x070e('0x40')]({'where':{'id':_0x8cc913[_0x070e('0x44')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x114bcf,null))['then'](function(_0x404c9b){if(_0x404c9b){return _0x404c9b['removeDispositions'](_0x8cc913[_0x070e('0x2b')]['ids']);}})[_0x070e('0x20')](respondWithStatusCode(_0x114bcf,null))[_0x070e('0x41')](handleError(_0x114bcf,null));};exports['addContacts']=function(_0x4683c7,_0x53f9a8,_0x1c831f){return db[_0x070e('0x26')]['find']({'where':{'id':_0x4683c7['params']['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x53f9a8,null))[_0x070e('0x20')](function(_0xf67cfd){if(_0xf67cfd){var _0x17cf15=[];var _0x25f1d0={'success':[],'errors':[]};return db[_0x070e('0x4e')][_0x070e('0x45')]()[_0x070e('0x20')](function(_0x25b599){if(_0x4683c7[_0x070e('0x43')][_0x070e('0x4f')]&&_[_0x070e('0x50')](_0x4683c7[_0x070e('0x43')]['tags'])){if(_0x4683c7[_0x070e('0x43')][_0x070e('0x4f')]['length']){_0x4683c7['body'][_0x070e('0x4f')]=_0x4683c7[_0x070e('0x43')][_0x070e('0x4f')][_0x070e('0x51')](';')+';';}else{_0x4683c7[_0x070e('0x43')][_0x070e('0x4f')]=null;}}else{_0x4683c7[_0x070e('0x43')][_0x070e('0x4f')]=null;}if(_0x4683c7[_0x070e('0x43')]&&_[_0x070e('0x50')](_0x4683c7[_0x070e('0x43')])){for(var _0x2084a1=0x0;_0x2084a1<_0x4683c7[_0x070e('0x43')]['length'];_0x2084a1+=0x1){_0x4683c7['body'][_0x2084a1]['ListId']=_0x4683c7[_0x070e('0x44')]['id'];_0x17cf15[_0x070e('0x52')](_0x4683c7[_0x070e('0x43')][_0x2084a1]);}return BPromise[_0x070e('0x53')](_0x17cf15,function(_0x5a7df2){return db[_0x070e('0x4e')][_0x070e('0x42')](_[_0x070e('0x54')](_0x5a7df2,[_0x070e('0x55'),'id'])||{},{'fields':_[_0x070e('0x29')](_0x25b599),'raw':!![]})[_0x070e('0x20')](function(_0x4a7129){_0x25f1d0[_0x070e('0x56')]['push'](_0x4a7129[_0x070e('0x57')]);})[_0x070e('0x41')](function(_0x2f704b){_0x25f1d0[_0x070e('0x58')][_0x070e('0x52')]({'data':_0x5a7df2,'error':_0x2f704b['message']});});})[_0x070e('0x20')](function(_0x15450f){return _0x25f1d0;})['catch'](function(_0x421392){return _0x421392;});}else{_0x53f9a8[_0x070e('0x1a')](0x190)['json']({'message':_0x070e('0x59')});}});}})[_0x070e('0x20')](respondWithResult(_0x53f9a8,null))[_0x070e('0x41')](handleError(_0x53f9a8,null));};exports['getContacts']=function(_0x40d7e6,_0xe8c476,_0x134b72){var _0x1ad0bf;return db[_0x070e('0x26')][_0x070e('0x40')]({'where':{'id':_0x40d7e6[_0x070e('0x44')]['id']},'include':[{'model':db[_0x070e('0x5a')],'as':_0x070e('0x5b')}]})[_0x070e('0x20')](handleEntityNotFound(_0xe8c476,null))[_0x070e('0x20')](function(_0x46d2b7){if(_0x46d2b7){_0x1ad0bf=_0x46d2b7;return db[_0x070e('0x4e')]['rawAttributes'];}})[_0x070e('0x20')](function(_0x2df184){if(_0x2df184){var _0x392c45={};var _0x1b71dd={};_0x1b71dd[_0x070e('0x28')]=_[_0x070e('0x5c')](_['keys'](_0x2df184),_['map'](_0x1ad0bf['CustomFields'],function(_0x3c9abf){return util[_0x070e('0x5d')](_0x070e('0x5e'),_0x3c9abf['id']);}));_0x1b71dd[_0x070e('0x2b')]=_['keys'](_0x40d7e6[_0x070e('0x2b')]);_0x1b71dd[_0x070e('0x2d')]=_[_0x070e('0x2e')](_0x1b71dd['model'],_0x1b71dd[_0x070e('0x2b')]);_0x392c45['attributes']=_[_0x070e('0x2e')](_0x1b71dd[_0x070e('0x28')],qs['fields'](_0x40d7e6['query'][_0x070e('0x2f')]));_0x392c45[_0x070e('0x30')]=_0x392c45['attributes'][_0x070e('0x3f')]?_0x392c45['attributes']:_0x1b71dd['model'];if(!_0x40d7e6['query'][_0x070e('0x49')](_0x070e('0x31'))){_0x392c45[_0x070e('0x19')]=qs[_0x070e('0x19')](_0x40d7e6[_0x070e('0x2b')][_0x070e('0x19')]);_0x392c45[_0x070e('0x18')]=qs[_0x070e('0x18')](_0x40d7e6[_0x070e('0x2b')][_0x070e('0x18')]);}_0x392c45[_0x070e('0x32')]=qs[_0x070e('0x33')](_0x40d7e6[_0x070e('0x2b')][_0x070e('0x33')]);_0x392c45[_0x070e('0x34')]=qs[_0x070e('0x2d')](_[_0x070e('0x4a')](_0x40d7e6[_0x070e('0x2b')],_0x1b71dd[_0x070e('0x2d')]));_0x392c45[_0x070e('0x5f')]=!![];if(_0x40d7e6[_0x070e('0x2b')][_0x070e('0x38')]){_0x392c45['where']=_[_0x070e('0x37')](_0x392c45[_0x070e('0x34')],{'$or':_[_0x070e('0x4b')](_0x392c45[_0x070e('0x30')],function(_0x495403){var _0x2f26d1={};_0x2f26d1[_0x495403]={'$like':'%'+_0x40d7e6[_0x070e('0x2b')][_0x070e('0x38')]+'%'};return _0x2f26d1;})});}_0x392c45=_[_0x070e('0x37')]({},_0x392c45,_0x40d7e6[_0x070e('0x39')]);return _0x1ad0bf[_0x070e('0x60')](_0x392c45);}})['then'](respondWithResult(_0xe8c476,null))['catch'](handleError(_0xe8c476,null));};exports['getContactsCsv']=function(_0x33ef0d,_0x5a482f,_0x26e9c1){var _0x42f6df;return db['CmList'][_0x070e('0x40')]({'where':{'id':_0x33ef0d[_0x070e('0x44')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x070e('0x20')](handleEntityNotFound(_0x5a482f,null))[_0x070e('0x20')](function(_0x138476){if(_0x138476){_0x42f6df=_0x138476;return db[_0x070e('0x4e')][_0x070e('0x27')];}})['then'](function(_0x3aba7a){if(_0x3aba7a){var _0x56e3da={};var _0x44feba={};_0x44feba[_0x070e('0x28')]=_['concat'](_[_0x070e('0x29')](_0x3aba7a),_[_0x070e('0x4b')](_0x42f6df[_0x070e('0x5b')],function(_0x16e190){return util[_0x070e('0x5d')](_0x070e('0x5e'),_0x16e190['id']);}));_0x44feba['query']=_[_0x070e('0x29')](_0x33ef0d[_0x070e('0x2b')]);_0x44feba[_0x070e('0x2d')]=_[_0x070e('0x2e')](_0x44feba[_0x070e('0x28')],_0x44feba['query']);_0x56e3da[_0x070e('0x30')]=_[_0x070e('0x2e')](_0x44feba[_0x070e('0x28')],qs[_0x070e('0x2f')](_0x33ef0d[_0x070e('0x2b')][_0x070e('0x2f')]));_0x56e3da[_0x070e('0x30')]=_0x56e3da[_0x070e('0x30')][_0x070e('0x3f')]?_0x56e3da[_0x070e('0x30')]:_0x44feba[_0x070e('0x28')];if(!_0x33ef0d[_0x070e('0x2b')][_0x070e('0x49')](_0x070e('0x31'))){_0x56e3da[_0x070e('0x19')]=qs[_0x070e('0x19')](_0x33ef0d['query']['limit']);_0x56e3da[_0x070e('0x18')]=qs[_0x070e('0x18')](_0x33ef0d['query']['offset']);}_0x56e3da['order']=qs['sort'](_0x33ef0d[_0x070e('0x2b')][_0x070e('0x33')]);_0x56e3da[_0x070e('0x34')]=qs[_0x070e('0x2d')](_[_0x070e('0x4a')](_0x33ef0d[_0x070e('0x2b')],_0x44feba[_0x070e('0x2d')]));_0x56e3da[_0x070e('0x5f')]=!![];if(_0x33ef0d[_0x070e('0x2b')][_0x070e('0x38')]){_0x56e3da['where']=_[_0x070e('0x37')](_0x56e3da[_0x070e('0x34')],{'$or':_['map'](_0x56e3da[_0x070e('0x30')],function(_0x2890ba){var _0x1bff76={};_0x1bff76[_0x2890ba]={'$like':'%'+_0x33ef0d[_0x070e('0x2b')]['filter']+'%'};return _0x1bff76;})});}_0x56e3da=_[_0x070e('0x37')]({},_0x56e3da,_0x33ef0d[_0x070e('0x39')]);return _0x42f6df[_0x070e('0x60')](_0x56e3da);}})[_0x070e('0x20')](function(_0x51b43f){if(!_[_0x070e('0x61')](_0x51b43f)){var _0x14a769=toCsv(_0x51b43f);var _0xfb9cec=Date[_0x070e('0x62')]();fs[_0x070e('0x63')](util[_0x070e('0x5d')](_0x070e('0x64'),_0x42f6df['id'],_0xfb9cec),_0x14a769);_0x5a482f[_0x070e('0x65')](_0x070e('0x66'),_0x070e('0x67')+util[_0x070e('0x5d')]('list_%d_%s.csv',_0x42f6df['id'],_0xfb9cec));_0x5a482f[_0x070e('0x65')](_0x070e('0x68'),'text/csv');return _0x5a482f['download'](util[_0x070e('0x5d')]('/tmp/list_%d_%s.csv',_0x42f6df['id'],_0xfb9cec));}else{return _0x5a482f[_0x070e('0x16')](0xcc);}})[_0x070e('0x41')](handleError(_0x5a482f,null));};exports[_0x070e('0x69')]=function(_0x1f6e07,_0x23b60f,_0x373575){var _0x3dc050;delete _0x1f6e07['body']['id'];return db[_0x070e('0x26')][_0x070e('0x6a')]({'where':{'id':_0x1f6e07[_0x070e('0x44')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x23b60f,null))['then'](function(_0x4e4065){if(_0x4e4065){return db[_0x070e('0x6b')][_0x070e('0x6c')](function(_0x2e92f0){return db['CmCustomField'][_0x070e('0x42')](_0x1f6e07[_0x070e('0x43')],{'transaction':_0x2e92f0})['then'](function(_0x2e9808){_0x3dc050=_0x2e9808;return _0x4e4065[_0x070e('0x6d')](_0x2e9808,{'transaction':_0x2e92f0});})[_0x070e('0x20')](function(){var _0x33009c={'type':db[_0x070e('0x6e')][_0x070e('0x6f')],'transaction':_0x2e92f0};switch(_0x1f6e07['body']['type']){case _0x070e('0x70'):_0x33009c['type']=db[_0x070e('0x6e')][_0x070e('0x6f')];break;case'number':_0x33009c[_0x070e('0x71')]=db['Sequelize'][_0x070e('0x72')];break;case _0x070e('0x73'):_0x33009c[_0x070e('0x71')]=db[_0x070e('0x6e')][_0x070e('0x74')];_0x33009c[_0x070e('0x75')]=![];break;default:}return db['sequelize'][_0x070e('0x76')][_0x070e('0x77')]('cm_contacts',util['format'](_0x070e('0x78'),_0x3dc050['id']),_0x33009c);})[_0x070e('0x20')](function(){return _0x3dc050;});});}})[_0x070e('0x20')](respondWithResult(_0x23b60f,null))[_0x070e('0x41')](handleError(_0x23b60f,null));};exports[_0x070e('0x79')]=function(_0x3e2c30,_0x42bf72,_0x442cca){var _0x501885={};var _0x1deb2a={};var _0x9a1b90;var _0x26a0be;return db[_0x070e('0x26')][_0x070e('0x6a')]({'where':{'id':_0x3e2c30[_0x070e('0x44')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x42bf72,null))[_0x070e('0x20')](function(_0x522513){if(_0x522513){_0x9a1b90=_0x522513;_0x1deb2a[_0x070e('0x28')]=_[_0x070e('0x29')](db[_0x070e('0x5a')][_0x070e('0x27')]);_0x1deb2a[_0x070e('0x2b')]=_[_0x070e('0x29')](_0x3e2c30[_0x070e('0x2b')]);_0x1deb2a[_0x070e('0x2d')]=_[_0x070e('0x2e')](_0x1deb2a[_0x070e('0x28')],_0x1deb2a['query']);_0x501885['attributes']=_[_0x070e('0x2e')](_0x1deb2a[_0x070e('0x28')],qs[_0x070e('0x2f')](_0x3e2c30['query'][_0x070e('0x2f')]));_0x501885[_0x070e('0x30')]=_0x501885['attributes'][_0x070e('0x3f')]?_0x501885[_0x070e('0x30')]:_0x1deb2a[_0x070e('0x28')];_0x501885[_0x070e('0x32')]=qs[_0x070e('0x33')](_0x3e2c30[_0x070e('0x2b')]['sort']);_0x501885['where']=qs[_0x070e('0x2d')](_[_0x070e('0x4a')](_0x3e2c30['query'],_0x1deb2a[_0x070e('0x2d')]));_0x501885[_0x070e('0x34')]=_[_0x070e('0x37')](_0x501885[_0x070e('0x34')],{'$or':[{'ListId':_0x522513['id']},{'ListId':null}]});if(_0x3e2c30[_0x070e('0x2b')][_0x070e('0x38')]){_0x501885['where']=_[_0x070e('0x37')](_0x501885[_0x070e('0x34')],{'$or':_['map'](_0x501885[_0x070e('0x30')],function(_0x1be191){var _0x1aec7c={};_0x1aec7c[_0x1be191]={'$like':'%'+_0x3e2c30[_0x070e('0x2b')]['filter']+'%'};return _0x1aec7c;})});}_0x501885=_['merge']({},_0x501885,_0x3e2c30[_0x070e('0x39')]);return db[_0x070e('0x5a')][_0x070e('0x7a')](_0x501885);}})[_0x070e('0x20')](respondWithResult(_0x42bf72,null))[_0x070e('0x41')](handleError(_0x42bf72,null));};exports[_0x070e('0x7b')]=function(_0x317f18,_0x2e1753,_0xdca2d3){return db[_0x070e('0x26')]['find']({'where':{'id':_0x317f18[_0x070e('0x44')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x2e1753,null))[_0x070e('0x20')](function(_0x205fc7){if(_0x205fc7){return _0x205fc7['addAgents'](_0x317f18[_0x070e('0x43')][_0x070e('0x55')],_['omit'](_0x317f18['body'],[_0x070e('0x55'),'id'])||{})[_0x070e('0x7c')](function(_0x1abf03){for(var _0x5f0d6a=0x0;_0x5f0d6a<_0x317f18[_0x070e('0x43')][_0x070e('0x55')][_0x070e('0x3f')];_0x5f0d6a+=0x1){socket[_0x070e('0x7d')](_0x070e('0x7e'),{'UserId':_0x317f18['body'][_0x070e('0x55')][_0x5f0d6a],'CmListId':_0x317f18[_0x070e('0x44')]['id']});}return _0x1abf03;});}})['then'](respondWithResult(_0x2e1753,null))[_0x070e('0x41')](handleError(_0x2e1753,null));};exports['removeAgents']=function(_0x5326f2,_0x48b0aa,_0x13c865){var _0x15ef48;return db[_0x070e('0x26')][_0x070e('0x40')]({'where':{'id':_0x5326f2['params']['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x48b0aa,null))[_0x070e('0x20')](function(_0x500fa9){if(_0x500fa9){return _0x500fa9[_0x070e('0x7f')](_0x5326f2[_0x070e('0x2b')][_0x070e('0x55')])[_0x070e('0x20')](function(_0x4ea0a6){if(_[_0x070e('0x50')](_0x5326f2['query'][_0x070e('0x55')])){for(var _0x4c35db=0x0;_0x4c35db<_0x5326f2[_0x070e('0x2b')][_0x070e('0x55')][_0x070e('0x3f')];_0x4c35db+=0x1){socket['emit'](_0x070e('0x80'),{'UserId':_0x5326f2[_0x070e('0x2b')][_0x070e('0x55')][_0x4c35db],'CmListId':_0x5326f2['params']['id']});}}else{socket[_0x070e('0x7d')](_0x070e('0x80'),{'UserId':_0x5326f2['query'][_0x070e('0x55')],'CmListId':_0x5326f2[_0x070e('0x44')]['id']});}});}})['then'](respondWithStatusCode(_0x48b0aa,null))['catch'](handleError(_0x48b0aa,null));};exports['getAgents']=function(_0x5e1fee,_0x1f0ea5,_0x207922){var _0x1aeebb={};var _0x277ca5={};var _0x1204d7;var _0x6ecdb1;return db[_0x070e('0x26')][_0x070e('0x6a')]({'where':{'id':_0x5e1fee['params']['id']}})['then'](handleEntityNotFound(_0x1f0ea5,null))['then'](function(_0x58ae9b){if(_0x58ae9b){_0x1204d7=_0x58ae9b;_0x277ca5[_0x070e('0x28')]=_[_0x070e('0x29')](db[_0x070e('0x81')][_0x070e('0x27')]);_0x277ca5[_0x070e('0x2b')]=_['keys'](_0x5e1fee['query']);_0x277ca5[_0x070e('0x2d')]=_[_0x070e('0x2e')](_0x277ca5['model'],_0x277ca5[_0x070e('0x2b')]);_0x1aeebb[_0x070e('0x30')]=_[_0x070e('0x2e')](_0x277ca5[_0x070e('0x28')],qs[_0x070e('0x2f')](_0x5e1fee[_0x070e('0x2b')]['fields']));_0x1aeebb[_0x070e('0x30')]=_0x1aeebb[_0x070e('0x30')][_0x070e('0x3f')]?_0x1aeebb['attributes']:_0x277ca5[_0x070e('0x28')];_0x1aeebb[_0x070e('0x32')]=qs[_0x070e('0x33')](_0x5e1fee[_0x070e('0x2b')]['sort']);_0x1aeebb[_0x070e('0x34')]=qs[_0x070e('0x2d')](_['pick'](_0x5e1fee[_0x070e('0x2b')],_0x277ca5[_0x070e('0x2d')]));if(_0x5e1fee['query'][_0x070e('0x38')]){_0x1aeebb['where']=_[_0x070e('0x37')](_0x1aeebb['where'],{'$or':_[_0x070e('0x4b')](_0x1aeebb['attributes'],function(_0x5cd12d){var _0x1c4f6c={};_0x1c4f6c[_0x5cd12d]={'$like':'%'+_0x5e1fee['query']['filter']+'%'};return _0x1c4f6c;})});}_0x1aeebb=_[_0x070e('0x37')]({},_0x1aeebb,_0x5e1fee[_0x070e('0x39')]);return _0x1204d7[_0x070e('0x82')](_0x1aeebb);}})[_0x070e('0x20')](function(_0x1a339e){if(_0x1a339e){_0x6ecdb1=_0x1a339e['length'];if(!_0x5e1fee[_0x070e('0x2b')][_0x070e('0x49')](_0x070e('0x31'))){_0x1aeebb[_0x070e('0x19')]=qs[_0x070e('0x19')](_0x5e1fee[_0x070e('0x2b')]['limit']);_0x1aeebb[_0x070e('0x18')]=qs[_0x070e('0x18')](_0x5e1fee[_0x070e('0x2b')][_0x070e('0x18')]);}return _0x1204d7['getAgents'](_0x1aeebb);}})['then'](function(_0xf08686){if(_0xf08686){return _0xf08686?{'count':_0x6ecdb1,'rows':_0xf08686}:null;}})[_0x070e('0x20')](respondWithResult(_0x1f0ea5,null))[_0x070e('0x41')](handleError(_0x1f0ea5,null));};
\ No newline at end of file
+var _0x9c44=['queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','api','../../config/utils','../../mysqldb','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','error','name','send','CmList','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','day','merge','filter','map','options','includeAll','findAll','rows','rawAttributes','include','find','catch','create','body','params','destroy','describe','ListId','Disposition','findOne','pick','removeDispositions','ids','addContacts','CmContact','isArray','tags','join','each','omit','push','dataValues','message','CustomFields','format','cf_%d','nolimit','getContacts','getContactsCsv','CmCustomField','raw','isEmpty','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','text/csv','download','addCustomField','transaction','addCustomFields','TEXT','type','Sequelize','switch','BOOLEAN','defaultValue','sequelize'];(function(_0x2f52f6,_0x463684){var _0xc2dc78=function(_0x5ea46e){while(--_0x5ea46e){_0x2f52f6['push'](_0x2f52f6['shift']());}};_0xc2dc78(++_0x463684);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x49c4('0x0'));var zipdir=require(_0x49c4('0x1'));var jsonpatch=require(_0x49c4('0x2'));var rp=require(_0x49c4('0x3'));var moment=require(_0x49c4('0x4'));var BPromise=require(_0x49c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49c4('0x6'));var sox=require('sox');var csv=require(_0x49c4('0x7'));var ejs=require(_0x49c4('0x8'));var fs=require('fs');var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0x7'));var querystring=require(_0x49c4('0xd'));var Papa=require(_0x49c4('0xe'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x49c4('0xf'));var utils=require(_0x49c4('0x10'));var config=require('../../config/environment');var db=require(_0x49c4('0x11'))['db'];var socket=require(_0x49c4('0x12'))({'host':'localhost','port':0x18eb});require('./cmList.socket')[_0x49c4('0x13')](socket);function respondWithStatusCode(_0x6d1b08,_0x5487cd){_0x5487cd=_0x5487cd||0xcc;return function(_0x7df3a9){if(_0x7df3a9){return _0x6d1b08[_0x49c4('0x14')](_0x5487cd);}return _0x6d1b08['status'](_0x5487cd)[_0x49c4('0x15')]();};}function respondWithResult(_0x280996,_0x21f15a){_0x21f15a=_0x21f15a||0xc8;return function(_0x2decee){if(_0x2decee){return _0x280996[_0x49c4('0x16')](_0x21f15a)[_0x49c4('0x17')](_0x2decee);}};}function respondWithFilteredResult(_0x75ea8,_0x3de397){return function(_0x58d177){if(_0x58d177){var _0x3acd06=_0x58d177[_0x49c4('0x18')],_0x141003=_0x3de397['offset'],_0x13a2db=_0x3de397[_0x49c4('0x19')]+_0x3de397[_0x49c4('0x1a')],_0x81e831;if(_0x13a2db>=_0x3acd06){_0x13a2db=_0x3acd06;_0x81e831=0xc8;}else{_0x81e831=0xce;}_0x75ea8['status'](_0x81e831);return _0x75ea8['set'](_0x49c4('0x1b'),_0x141003+'-'+_0x13a2db+'/'+_0x3acd06)[_0x49c4('0x17')](_0x58d177);}return null;};}function patchUpdates(_0x3addb2){return function(_0x59f29b){try{jsonpatch[_0x49c4('0x1c')](_0x59f29b,_0x3addb2,!![]);}catch(_0x50b151){return BPromise[_0x49c4('0x1d')](_0x50b151);}return _0x59f29b[_0x49c4('0x1e')]();};}function saveUpdates(_0xe31fcc,_0x291526){return function(_0x382040){if(_0x382040){return _0x382040[_0x49c4('0x1f')](_0xe31fcc)[_0x49c4('0x20')](function(_0x46e475){return _0x46e475;});}return null;};}function removeEntity(_0x2197d2,_0x578447){return function(_0x527126){if(_0x527126){return _0x527126['destroy']()[_0x49c4('0x20')](function(){_0x2197d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2263ae,_0x15581b){return function(_0x26c640){if(!_0x26c640){_0x2263ae[_0x49c4('0x14')](0x194);}return _0x26c640;};}function handleError(_0x4811c4,_0x5850f2){_0x5850f2=_0x5850f2||0x1f4;return function(_0x180276){logger[_0x49c4('0x21')](_0x180276['stack']);if(_0x180276[_0x49c4('0x22')]){delete _0x180276[_0x49c4('0x22')];}_0x4811c4[_0x49c4('0x16')](_0x5850f2)[_0x49c4('0x23')](_0x180276);};}exports['index']=function(_0x543ea2,_0x449960){var _0x53c199={},_0x3800b7={},_0x3852b2={'count':0x0,'rows':[]};var _0x3f1708=db[_0x49c4('0x24')]['rawAttributes'];_0x3800b7[_0x49c4('0x25')]=_[_0x49c4('0x26')](_0x3f1708);var _0x46e04d={'dateStart':_0x543ea2[_0x49c4('0x27')][_0x49c4('0x28')],'dateEnd':_0x543ea2[_0x49c4('0x27')][_0x49c4('0x29')]};delete _0x543ea2[_0x49c4('0x27')][_0x49c4('0x28')];delete _0x543ea2[_0x49c4('0x27')][_0x49c4('0x29')];_0x3800b7['query']=_['keys'](_0x543ea2['query']);_0x3800b7[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](_0x3800b7[_0x49c4('0x25')],_0x3800b7[_0x49c4('0x27')]);_0x53c199[_0x49c4('0x2c')]=_['intersection'](_0x3800b7[_0x49c4('0x25')],qs[_0x49c4('0x2d')](_0x543ea2[_0x49c4('0x27')][_0x49c4('0x2d')]));_0x53c199['attributes']=_0x53c199['attributes'][_0x49c4('0x2e')]?_0x53c199[_0x49c4('0x2c')]:_0x3800b7[_0x49c4('0x25')];if(!_0x543ea2[_0x49c4('0x27')][_0x49c4('0x2f')]('nolimit')){_0x53c199[_0x49c4('0x1a')]=qs[_0x49c4('0x1a')](_0x543ea2[_0x49c4('0x27')]['limit']);_0x53c199['offset']=qs[_0x49c4('0x19')](_0x543ea2[_0x49c4('0x27')][_0x49c4('0x19')]);}_0x53c199[_0x49c4('0x30')]=qs[_0x49c4('0x31')](_0x543ea2[_0x49c4('0x27')][_0x49c4('0x31')]);_0x53c199[_0x49c4('0x32')]=qs[_0x49c4('0x2a')](_['pick'](_0x543ea2[_0x49c4('0x27')],_0x3800b7['filters']));if(_0x46e04d[_0x49c4('0x28')]){if(_0x46e04d[_0x49c4('0x29')]){_0x46e04d[_0x49c4('0x29')]=moment(_0x46e04d[_0x49c4('0x29')])['add'](0x1,_0x49c4('0x33'));}else{_0x46e04d[_0x49c4('0x29')]=moment(_0x46e04d[_0x49c4('0x28')])['add'](0x1,_0x49c4('0x33'));}_[_0x49c4('0x34')](_0x53c199[_0x49c4('0x32')],{'createdAt':{'$gte':_0x46e04d[_0x49c4('0x28')],'$lte':_0x46e04d[_0x49c4('0x29')]}});}if(_0x543ea2[_0x49c4('0x27')][_0x49c4('0x35')]){_0x53c199[_0x49c4('0x32')]=_[_0x49c4('0x34')](_0x53c199[_0x49c4('0x32')],{'$or':_[_0x49c4('0x36')](_0x53c199['attributes'],function(_0x2d2510){var _0x20cd21={};_0x20cd21[_0x2d2510]={'$like':'%'+_0x543ea2[_0x49c4('0x27')][_0x49c4('0x35')]+'%'};return _0x20cd21;})});}_0x53c199=_[_0x49c4('0x34')]({},_0x53c199,_0x543ea2[_0x49c4('0x37')]);var _0x1be62d={'where':_0x53c199[_0x49c4('0x32')]};return db[_0x49c4('0x24')][_0x49c4('0x18')](_0x1be62d)[_0x49c4('0x20')](function(_0xa3d59e){_0x3852b2[_0x49c4('0x18')]=_0xa3d59e;if(_0x543ea2['query'][_0x49c4('0x38')]){_0x53c199['include']=[{'all':!![]}];}return db[_0x49c4('0x24')][_0x49c4('0x39')](_0x53c199);})[_0x49c4('0x20')](function(_0x1480da){_0x3852b2[_0x49c4('0x3a')]=_0x1480da;return _0x3852b2;})[_0x49c4('0x20')](respondWithFilteredResult(_0x449960,_0x53c199))['catch'](handleError(_0x449960,null));};exports['show']=function(_0x20490b,_0x1e7bdc){var _0x38349b={'raw':![],'where':{'id':_0x20490b['params']['id']}},_0x117151={};_0x117151[_0x49c4('0x25')]=_[_0x49c4('0x26')](db[_0x49c4('0x24')][_0x49c4('0x3b')]);_0x117151[_0x49c4('0x27')]=_[_0x49c4('0x26')](_0x20490b[_0x49c4('0x27')]);_0x117151[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](_0x117151['model'],_0x117151[_0x49c4('0x27')]);_0x38349b['attributes']=_[_0x49c4('0x2b')](_0x117151[_0x49c4('0x25')],qs[_0x49c4('0x2d')](_0x20490b[_0x49c4('0x27')][_0x49c4('0x2d')]));_0x38349b['attributes']=_0x38349b[_0x49c4('0x2c')][_0x49c4('0x2e')]?_0x38349b[_0x49c4('0x2c')]:_0x117151[_0x49c4('0x25')];if(_0x20490b[_0x49c4('0x27')][_0x49c4('0x38')]){_0x38349b[_0x49c4('0x3c')]=[{'all':!![]}];}_0x38349b=_['merge']({},_0x38349b,_0x20490b[_0x49c4('0x37')]);return db['CmList'][_0x49c4('0x3d')](_0x38349b)[_0x49c4('0x20')](handleEntityNotFound(_0x1e7bdc,null))[_0x49c4('0x20')](respondWithResult(_0x1e7bdc,null))[_0x49c4('0x3e')](handleError(_0x1e7bdc,null));};exports[_0x49c4('0x3f')]=function(_0x30bea5,_0x2c6be1){return db['CmList'][_0x49c4('0x3f')](_0x30bea5[_0x49c4('0x40')],{})['then'](respondWithResult(_0x2c6be1,0xc9))[_0x49c4('0x3e')](handleError(_0x2c6be1,null));};exports[_0x49c4('0x1f')]=function(_0xfbe179,_0x242afc){if(_0xfbe179['body']['id']){delete _0xfbe179['body']['id'];}return db[_0x49c4('0x24')]['find']({'where':{'id':_0xfbe179[_0x49c4('0x41')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x242afc,null))[_0x49c4('0x20')](saveUpdates(_0xfbe179[_0x49c4('0x40')],null))[_0x49c4('0x20')](respondWithResult(_0x242afc,null))[_0x49c4('0x3e')](handleError(_0x242afc,null));};exports[_0x49c4('0x42')]=function(_0x563f0b,_0x1f26c2){return db[_0x49c4('0x24')][_0x49c4('0x3d')]({'where':{'id':_0x563f0b[_0x49c4('0x41')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x1f26c2,null))[_0x49c4('0x20')](removeEntity(_0x1f26c2,null))[_0x49c4('0x3e')](handleError(_0x1f26c2,null));};exports[_0x49c4('0x43')]=function(_0x1e0b4f,_0x1856be){return db['CmList']['describe']()[_0x49c4('0x20')](respondWithResult(_0x1856be,null))[_0x49c4('0x3e')](handleError(_0x1856be,null));};exports['addDisposition']=function(_0x59a8bc,_0x77163d,_0x4a00c5){if(_0x59a8bc['body']['id']){delete _0x59a8bc[_0x49c4('0x40')]['id'];}return db[_0x49c4('0x24')][_0x49c4('0x3d')]({'where':{'id':_0x59a8bc[_0x49c4('0x41')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x77163d,null))[_0x49c4('0x20')](function(_0x35724e){if(_0x35724e){_0x59a8bc['body'][_0x49c4('0x44')]=_0x35724e['id'];return db[_0x49c4('0x45')][_0x49c4('0x3f')](_0x59a8bc[_0x49c4('0x40')]);}})[_0x49c4('0x20')](respondWithResult(_0x77163d,null))[_0x49c4('0x3e')](handleError(_0x77163d,null));};exports['getDispositions']=function(_0x5c7ddd,_0x1ef0c1,_0x155c43){var _0x2a6308={'raw':![],'where':{}};var _0xf7a10f={};var _0x23288e={'count':0x0,'rows':[]};return db[_0x49c4('0x24')][_0x49c4('0x46')]({'where':{'id':_0x5c7ddd['params']['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x1ef0c1,null))[_0x49c4('0x20')](function(_0x4ba4eb){if(_0x4ba4eb){_0xf7a10f[_0x49c4('0x25')]=_['keys'](db[_0x49c4('0x45')][_0x49c4('0x3b')]);_0xf7a10f[_0x49c4('0x27')]=_[_0x49c4('0x26')](_0x5c7ddd[_0x49c4('0x27')]);_0xf7a10f[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](_0xf7a10f[_0x49c4('0x25')],_0xf7a10f['query']);_0x2a6308[_0x49c4('0x2c')]=_[_0x49c4('0x2b')](_0xf7a10f['model'],qs[_0x49c4('0x2d')](_0x5c7ddd[_0x49c4('0x27')]['fields']));_0x2a6308[_0x49c4('0x2c')]=_0x2a6308[_0x49c4('0x2c')]['length']?_0x2a6308['attributes']:_0xf7a10f['model'];if(!_0x5c7ddd['query'][_0x49c4('0x2f')]('nolimit')){_0x2a6308[_0x49c4('0x1a')]=qs[_0x49c4('0x1a')](_0x5c7ddd['query'][_0x49c4('0x1a')]);_0x2a6308[_0x49c4('0x19')]=qs['offset'](_0x5c7ddd[_0x49c4('0x27')][_0x49c4('0x19')]);}_0x2a6308[_0x49c4('0x30')]=qs[_0x49c4('0x31')](_0x5c7ddd['query'][_0x49c4('0x31')]);_0x2a6308[_0x49c4('0x32')]=qs[_0x49c4('0x2a')](_[_0x49c4('0x47')](_0x5c7ddd['query'],_0xf7a10f[_0x49c4('0x2a')]));_0x2a6308['where']['ListId']=_0x4ba4eb['id'];if(_0x5c7ddd['query']['filter']){_0x2a6308[_0x49c4('0x32')]=_[_0x49c4('0x34')](_0x2a6308[_0x49c4('0x32')],{'$or':_[_0x49c4('0x36')](_0x2a6308['attributes'],function(_0x4daa6d){var _0x340523={};_0x340523[_0x4daa6d]={'$like':'%'+_0x5c7ddd[_0x49c4('0x27')][_0x49c4('0x35')]+'%'};return _0x340523;})});}_0x2a6308=_[_0x49c4('0x34')]({},_0x2a6308,_0x5c7ddd[_0x49c4('0x37')]);return db[_0x49c4('0x45')][_0x49c4('0x18')]({'where':_0x2a6308[_0x49c4('0x32')]})['then'](function(_0x2276db){_0x23288e['count']=_0x2276db;if(_0x5c7ddd[_0x49c4('0x27')][_0x49c4('0x38')]){_0x2a6308[_0x49c4('0x3c')]=[{'all':!![]}];}return db[_0x49c4('0x45')][_0x49c4('0x39')](_0x2a6308);})[_0x49c4('0x20')](function(_0x13d657){_0x23288e[_0x49c4('0x3a')]=_0x13d657;return _0x23288e;});}})[_0x49c4('0x20')](respondWithFilteredResult(_0x1ef0c1,_0x2a6308))[_0x49c4('0x3e')](handleError(_0x1ef0c1,null));};exports[_0x49c4('0x48')]=function(_0x1c5315,_0x217ced,_0x14bd09){var _0x2d5f63;return db[_0x49c4('0x24')][_0x49c4('0x3d')]({'where':{'id':_0x1c5315[_0x49c4('0x41')]['id']}})['then'](handleEntityNotFound(_0x217ced,null))['then'](function(_0x10f2ec){if(_0x10f2ec){return _0x10f2ec[_0x49c4('0x48')](_0x1c5315['query'][_0x49c4('0x49')]);}})[_0x49c4('0x20')](respondWithStatusCode(_0x217ced,null))[_0x49c4('0x3e')](handleError(_0x217ced,null));};exports[_0x49c4('0x4a')]=function(_0x4d6aaa,_0x5a14a5,_0x4a85d4){return db[_0x49c4('0x24')][_0x49c4('0x3d')]({'where':{'id':_0x4d6aaa[_0x49c4('0x41')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x5a14a5,null))[_0x49c4('0x20')](function(_0x146706){if(_0x146706){var _0x191afb=[];var _0x3692a4={'success':[],'errors':[]};return db[_0x49c4('0x4b')]['describe']()[_0x49c4('0x20')](function(_0x10fb84){if(_0x4d6aaa[_0x49c4('0x40')]['tags']&&_[_0x49c4('0x4c')](_0x4d6aaa[_0x49c4('0x40')][_0x49c4('0x4d')])){if(_0x4d6aaa[_0x49c4('0x40')][_0x49c4('0x4d')][_0x49c4('0x2e')]){_0x4d6aaa[_0x49c4('0x40')][_0x49c4('0x4d')]=_0x4d6aaa['body'][_0x49c4('0x4d')][_0x49c4('0x4e')](';')+';';}else{_0x4d6aaa[_0x49c4('0x40')][_0x49c4('0x4d')]=null;}}else{_0x4d6aaa[_0x49c4('0x40')]['tags']=null;}if(_0x4d6aaa['body']&&_[_0x49c4('0x4c')](_0x4d6aaa['body'])){for(var _0x34cf49=0x0;_0x34cf49<_0x4d6aaa['body'][_0x49c4('0x2e')];_0x34cf49+=0x1){_0x4d6aaa[_0x49c4('0x40')][_0x34cf49][_0x49c4('0x44')]=_0x4d6aaa[_0x49c4('0x41')]['id'];_0x191afb['push'](_0x4d6aaa[_0x49c4('0x40')][_0x34cf49]);}return BPromise[_0x49c4('0x4f')](_0x191afb,function(_0x2ceada){return db[_0x49c4('0x4b')][_0x49c4('0x3f')](_[_0x49c4('0x50')](_0x2ceada,[_0x49c4('0x49'),'id'])||{},{'fields':_[_0x49c4('0x26')](_0x10fb84),'raw':!![]})[_0x49c4('0x20')](function(_0x2d4ea6){_0x3692a4['success'][_0x49c4('0x51')](_0x2d4ea6[_0x49c4('0x52')]);})['catch'](function(_0x15bee0){_0x3692a4['errors'][_0x49c4('0x51')]({'data':_0x2ceada,'error':_0x15bee0[_0x49c4('0x53')]});});})[_0x49c4('0x20')](function(_0x28b0db){return _0x3692a4;})[_0x49c4('0x3e')](function(_0x58b90c){return _0x58b90c;});}else{_0x5a14a5[_0x49c4('0x16')](0x190)[_0x49c4('0x17')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x49c4('0x20')](respondWithResult(_0x5a14a5,null))[_0x49c4('0x3e')](handleError(_0x5a14a5,null));};exports['getContacts']=function(_0xbd12b9,_0x2cb416,_0x57b137){var _0x37fef1;return db[_0x49c4('0x24')][_0x49c4('0x3d')]({'where':{'id':_0xbd12b9[_0x49c4('0x41')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x49c4('0x54')}]})[_0x49c4('0x20')](handleEntityNotFound(_0x2cb416,null))['then'](function(_0x45df7c){if(_0x45df7c){_0x37fef1=_0x45df7c;return db['CmContact']['rawAttributes'];}})[_0x49c4('0x20')](function(_0x507078){if(_0x507078){var _0x50fd24={};var _0x39cacf={};_0x39cacf[_0x49c4('0x25')]=_['concat'](_[_0x49c4('0x26')](_0x507078),_['map'](_0x37fef1['CustomFields'],function(_0x4c4bed){return util[_0x49c4('0x55')](_0x49c4('0x56'),_0x4c4bed['id']);}));_0x39cacf[_0x49c4('0x27')]=_[_0x49c4('0x26')](_0xbd12b9['query']);_0x39cacf['filters']=_[_0x49c4('0x2b')](_0x39cacf['model'],_0x39cacf[_0x49c4('0x27')]);_0x50fd24['attributes']=_[_0x49c4('0x2b')](_0x39cacf[_0x49c4('0x25')],qs[_0x49c4('0x2d')](_0xbd12b9[_0x49c4('0x27')][_0x49c4('0x2d')]));_0x50fd24[_0x49c4('0x2c')]=_0x50fd24[_0x49c4('0x2c')]['length']?_0x50fd24[_0x49c4('0x2c')]:_0x39cacf[_0x49c4('0x25')];if(!_0xbd12b9[_0x49c4('0x27')][_0x49c4('0x2f')](_0x49c4('0x57'))){_0x50fd24['limit']=qs[_0x49c4('0x1a')](_0xbd12b9[_0x49c4('0x27')][_0x49c4('0x1a')]);_0x50fd24['offset']=qs['offset'](_0xbd12b9[_0x49c4('0x27')][_0x49c4('0x19')]);}_0x50fd24[_0x49c4('0x30')]=qs[_0x49c4('0x31')](_0xbd12b9[_0x49c4('0x27')]['sort']);_0x50fd24[_0x49c4('0x32')]=qs[_0x49c4('0x2a')](_[_0x49c4('0x47')](_0xbd12b9[_0x49c4('0x27')],_0x39cacf['filters']));_0x50fd24['raw']=!![];if(_0xbd12b9[_0x49c4('0x27')][_0x49c4('0x35')]){_0x50fd24[_0x49c4('0x32')]=_[_0x49c4('0x34')](_0x50fd24[_0x49c4('0x32')],{'$or':_['map'](_0x50fd24[_0x49c4('0x2c')],function(_0x3c869e){var _0x44f20d={};_0x44f20d[_0x3c869e]={'$like':'%'+_0xbd12b9[_0x49c4('0x27')][_0x49c4('0x35')]+'%'};return _0x44f20d;})});}_0x50fd24=_[_0x49c4('0x34')]({},_0x50fd24,_0xbd12b9['options']);return _0x37fef1[_0x49c4('0x58')](_0x50fd24);}})[_0x49c4('0x20')](respondWithResult(_0x2cb416,null))[_0x49c4('0x3e')](handleError(_0x2cb416,null));};exports[_0x49c4('0x59')]=function(_0x508ae9,_0x5be767,_0xa96f53){var _0x4933a7;return db[_0x49c4('0x24')]['find']({'where':{'id':_0x508ae9[_0x49c4('0x41')]['id']},'include':[{'model':db[_0x49c4('0x5a')],'as':_0x49c4('0x54')}]})[_0x49c4('0x20')](handleEntityNotFound(_0x5be767,null))['then'](function(_0x4ad966){if(_0x4ad966){_0x4933a7=_0x4ad966;return db[_0x49c4('0x4b')][_0x49c4('0x3b')];}})[_0x49c4('0x20')](function(_0x5f0116){if(_0x5f0116){var _0x4c0e9c={};var _0x3e7ab3={};_0x3e7ab3['model']=_['concat'](_[_0x49c4('0x26')](_0x5f0116),_['map'](_0x4933a7[_0x49c4('0x54')],function(_0x3cfa95){return util['format'](_0x49c4('0x56'),_0x3cfa95['id']);}));_0x3e7ab3[_0x49c4('0x27')]=_['keys'](_0x508ae9['query']);_0x3e7ab3[_0x49c4('0x2a')]=_['intersection'](_0x3e7ab3[_0x49c4('0x25')],_0x3e7ab3[_0x49c4('0x27')]);_0x4c0e9c[_0x49c4('0x2c')]=_[_0x49c4('0x2b')](_0x3e7ab3[_0x49c4('0x25')],qs[_0x49c4('0x2d')](_0x508ae9[_0x49c4('0x27')]['fields']));_0x4c0e9c[_0x49c4('0x2c')]=_0x4c0e9c[_0x49c4('0x2c')][_0x49c4('0x2e')]?_0x4c0e9c[_0x49c4('0x2c')]:_0x3e7ab3[_0x49c4('0x25')];if(!_0x508ae9['query'][_0x49c4('0x2f')]('nolimit')){_0x4c0e9c[_0x49c4('0x1a')]=qs[_0x49c4('0x1a')](_0x508ae9[_0x49c4('0x27')][_0x49c4('0x1a')]);_0x4c0e9c['offset']=qs[_0x49c4('0x19')](_0x508ae9[_0x49c4('0x27')][_0x49c4('0x19')]);}_0x4c0e9c[_0x49c4('0x30')]=qs[_0x49c4('0x31')](_0x508ae9[_0x49c4('0x27')]['sort']);_0x4c0e9c[_0x49c4('0x32')]=qs['filters'](_[_0x49c4('0x47')](_0x508ae9[_0x49c4('0x27')],_0x3e7ab3[_0x49c4('0x2a')]));_0x4c0e9c[_0x49c4('0x5b')]=!![];if(_0x508ae9['query'][_0x49c4('0x35')]){_0x4c0e9c[_0x49c4('0x32')]=_['merge'](_0x4c0e9c[_0x49c4('0x32')],{'$or':_[_0x49c4('0x36')](_0x4c0e9c['attributes'],function(_0x562f47){var _0x25f1c7={};_0x25f1c7[_0x562f47]={'$like':'%'+_0x508ae9[_0x49c4('0x27')][_0x49c4('0x35')]+'%'};return _0x25f1c7;})});}_0x4c0e9c=_[_0x49c4('0x34')]({},_0x4c0e9c,_0x508ae9[_0x49c4('0x37')]);return _0x4933a7[_0x49c4('0x58')](_0x4c0e9c);}})[_0x49c4('0x20')](function(_0x450a38){if(!_[_0x49c4('0x5c')](_0x450a38)){var _0x117c64=toCsv(_0x450a38);var _0x269613=Date['now']();fs['writeFileSync'](util[_0x49c4('0x55')](_0x49c4('0x5d'),_0x4933a7['id'],_0x269613),_0x117c64);_0x5be767[_0x49c4('0x5e')]('Content-disposition',_0x49c4('0x5f')+util[_0x49c4('0x55')]('list_%d_%s.csv',_0x4933a7['id'],_0x269613));_0x5be767[_0x49c4('0x5e')]('Content-type',_0x49c4('0x60'));return _0x5be767[_0x49c4('0x61')](util[_0x49c4('0x55')](_0x49c4('0x5d'),_0x4933a7['id'],_0x269613));}else{return _0x5be767['sendStatus'](0xcc);}})[_0x49c4('0x3e')](handleError(_0x5be767,null));};exports[_0x49c4('0x62')]=function(_0x3e3eb0,_0x431ff1,_0x44a7e3){var _0x54de3e;delete _0x3e3eb0['body']['id'];return db['CmList'][_0x49c4('0x46')]({'where':{'id':_0x3e3eb0[_0x49c4('0x41')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x431ff1,null))[_0x49c4('0x20')](function(_0x3f49cc){if(_0x3f49cc){return db['sequelize'][_0x49c4('0x63')](function(_0x41ef7c){return db[_0x49c4('0x5a')][_0x49c4('0x3f')](_0x3e3eb0['body'],{'transaction':_0x41ef7c})[_0x49c4('0x20')](function(_0x5bfccd){_0x54de3e=_0x5bfccd;return _0x3f49cc[_0x49c4('0x64')](_0x5bfccd,{'transaction':_0x41ef7c});})[_0x49c4('0x20')](function(){var _0x2fda4f={'type':db['Sequelize'][_0x49c4('0x65')],'transaction':_0x41ef7c};switch(_0x3e3eb0[_0x49c4('0x40')][_0x49c4('0x66')]){case'text':_0x2fda4f[_0x49c4('0x66')]=db[_0x49c4('0x67')][_0x49c4('0x65')];break;case'number':_0x2fda4f[_0x49c4('0x66')]=db['Sequelize']['INTEGER'];break;case _0x49c4('0x68'):_0x2fda4f[_0x49c4('0x66')]=db['Sequelize'][_0x49c4('0x69')];_0x2fda4f[_0x49c4('0x6a')]=![];break;default:}return db[_0x49c4('0x6b')][_0x49c4('0x6c')][_0x49c4('0x6d')](_0x49c4('0x6e'),util[_0x49c4('0x55')](_0x49c4('0x6f'),_0x54de3e['id']),_0x2fda4f);})['then'](function(){return _0x54de3e;});});}})['then'](respondWithResult(_0x431ff1,null))[_0x49c4('0x3e')](handleError(_0x431ff1,null));};exports[_0x49c4('0x70')]=function(_0x42f2db,_0x5f04f2,_0x5c809e){var _0x51f80b={};var _0x3222ec={};var _0xd979f7;var _0x45aeeb;return db[_0x49c4('0x24')][_0x49c4('0x46')]({'where':{'id':_0x42f2db[_0x49c4('0x41')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x5f04f2,null))[_0x49c4('0x20')](function(_0x1e2dd3){if(_0x1e2dd3){_0xd979f7=_0x1e2dd3;_0x3222ec[_0x49c4('0x25')]=_[_0x49c4('0x26')](db[_0x49c4('0x5a')][_0x49c4('0x3b')]);_0x3222ec['query']=_[_0x49c4('0x26')](_0x42f2db[_0x49c4('0x27')]);_0x3222ec[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](_0x3222ec['model'],_0x3222ec['query']);_0x51f80b[_0x49c4('0x2c')]=_['intersection'](_0x3222ec[_0x49c4('0x25')],qs[_0x49c4('0x2d')](_0x42f2db[_0x49c4('0x27')][_0x49c4('0x2d')]));_0x51f80b[_0x49c4('0x2c')]=_0x51f80b[_0x49c4('0x2c')][_0x49c4('0x2e')]?_0x51f80b[_0x49c4('0x2c')]:_0x3222ec[_0x49c4('0x25')];_0x51f80b[_0x49c4('0x30')]=qs[_0x49c4('0x31')](_0x42f2db[_0x49c4('0x27')]['sort']);_0x51f80b[_0x49c4('0x32')]=qs[_0x49c4('0x2a')](_[_0x49c4('0x47')](_0x42f2db['query'],_0x3222ec[_0x49c4('0x2a')]));_0x51f80b['where']=_[_0x49c4('0x34')](_0x51f80b[_0x49c4('0x32')],{'$or':[{'ListId':_0x1e2dd3['id']},{'ListId':null}]});if(_0x42f2db[_0x49c4('0x27')][_0x49c4('0x35')]){_0x51f80b['where']=_[_0x49c4('0x34')](_0x51f80b['where'],{'$or':_['map'](_0x51f80b[_0x49c4('0x2c')],function(_0x135ea1){var _0x1c38a5={};_0x1c38a5[_0x135ea1]={'$like':'%'+_0x42f2db['query']['filter']+'%'};return _0x1c38a5;})});}_0x51f80b=_[_0x49c4('0x34')]({},_0x51f80b,_0x42f2db[_0x49c4('0x37')]);return db[_0x49c4('0x5a')][_0x49c4('0x71')](_0x51f80b);}})[_0x49c4('0x20')](respondWithResult(_0x5f04f2,null))[_0x49c4('0x3e')](handleError(_0x5f04f2,null));};exports[_0x49c4('0x72')]=function(_0x19f30b,_0xd3f0b3,_0x54421b){return db[_0x49c4('0x24')][_0x49c4('0x3d')]({'where':{'id':_0x19f30b['params']['id']}})['then'](handleEntityNotFound(_0xd3f0b3,null))[_0x49c4('0x20')](function(_0x4d5481){if(_0x4d5481){return _0x4d5481[_0x49c4('0x72')](_0x19f30b['body'][_0x49c4('0x49')],_['omit'](_0x19f30b[_0x49c4('0x40')],[_0x49c4('0x49'),'id'])||{})[_0x49c4('0x73')](function(_0x1ab574){for(var _0x5b1e3d=0x0;_0x5b1e3d<_0x19f30b['body'][_0x49c4('0x49')][_0x49c4('0x2e')];_0x5b1e3d+=0x1){socket[_0x49c4('0x74')]('userCmList:save',{'UserId':_0x19f30b[_0x49c4('0x40')][_0x49c4('0x49')][_0x5b1e3d],'CmListId':_0x19f30b['params']['id']});}return _0x1ab574;});}})['then'](respondWithResult(_0xd3f0b3,null))[_0x49c4('0x3e')](handleError(_0xd3f0b3,null));};exports[_0x49c4('0x75')]=function(_0xa0698d,_0x49dc8a,_0x15821c){var _0x3da1a3;return db[_0x49c4('0x24')][_0x49c4('0x3d')]({'where':{'id':_0xa0698d['params']['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x49dc8a,null))['then'](function(_0x4d0a28){if(_0x4d0a28){return _0x4d0a28[_0x49c4('0x75')](_0xa0698d[_0x49c4('0x27')][_0x49c4('0x49')])[_0x49c4('0x20')](function(_0x5adb90){if(_[_0x49c4('0x4c')](_0xa0698d[_0x49c4('0x27')][_0x49c4('0x49')])){for(var _0x37dd25=0x0;_0x37dd25<_0xa0698d['query'][_0x49c4('0x49')]['length'];_0x37dd25+=0x1){socket['emit'](_0x49c4('0x76'),{'UserId':_0xa0698d[_0x49c4('0x27')][_0x49c4('0x49')][_0x37dd25],'CmListId':_0xa0698d['params']['id']});}}else{socket[_0x49c4('0x74')]('userCmList:remove',{'UserId':_0xa0698d[_0x49c4('0x27')][_0x49c4('0x49')],'CmListId':_0xa0698d[_0x49c4('0x41')]['id']});}});}})[_0x49c4('0x20')](respondWithStatusCode(_0x49dc8a,null))[_0x49c4('0x3e')](handleError(_0x49dc8a,null));};exports[_0x49c4('0x77')]=function(_0x2b31ac,_0x5a9370,_0x3808e6){var _0x22d687={};var _0x2f3c7e={};var _0x318fdb;var _0x4f30d4;return db['CmList']['findOne']({'where':{'id':_0x2b31ac[_0x49c4('0x41')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x5a9370,null))[_0x49c4('0x20')](function(_0x792fa9){if(_0x792fa9){_0x318fdb=_0x792fa9;_0x2f3c7e[_0x49c4('0x25')]=_[_0x49c4('0x26')](db[_0x49c4('0x78')]['rawAttributes']);_0x2f3c7e[_0x49c4('0x27')]=_[_0x49c4('0x26')](_0x2b31ac['query']);_0x2f3c7e['filters']=_['intersection'](_0x2f3c7e[_0x49c4('0x25')],_0x2f3c7e[_0x49c4('0x27')]);_0x22d687[_0x49c4('0x2c')]=_[_0x49c4('0x2b')](_0x2f3c7e[_0x49c4('0x25')],qs[_0x49c4('0x2d')](_0x2b31ac[_0x49c4('0x27')]['fields']));_0x22d687[_0x49c4('0x2c')]=_0x22d687[_0x49c4('0x2c')][_0x49c4('0x2e')]?_0x22d687[_0x49c4('0x2c')]:_0x2f3c7e['model'];_0x22d687[_0x49c4('0x30')]=qs[_0x49c4('0x31')](_0x2b31ac[_0x49c4('0x27')][_0x49c4('0x31')]);_0x22d687[_0x49c4('0x32')]=qs['filters'](_[_0x49c4('0x47')](_0x2b31ac['query'],_0x2f3c7e['filters']));if(_0x2b31ac[_0x49c4('0x27')][_0x49c4('0x35')]){_0x22d687[_0x49c4('0x32')]=_[_0x49c4('0x34')](_0x22d687[_0x49c4('0x32')],{'$or':_['map'](_0x22d687[_0x49c4('0x2c')],function(_0xe22e22){var _0x20158e={};_0x20158e[_0xe22e22]={'$like':'%'+_0x2b31ac['query'][_0x49c4('0x35')]+'%'};return _0x20158e;})});}_0x22d687=_[_0x49c4('0x34')]({},_0x22d687,_0x2b31ac['options']);return _0x318fdb[_0x49c4('0x77')](_0x22d687);}})[_0x49c4('0x20')](function(_0x20f67c){if(_0x20f67c){_0x4f30d4=_0x20f67c[_0x49c4('0x2e')];if(!_0x2b31ac[_0x49c4('0x27')][_0x49c4('0x2f')](_0x49c4('0x57'))){_0x22d687['limit']=qs[_0x49c4('0x1a')](_0x2b31ac[_0x49c4('0x27')][_0x49c4('0x1a')]);_0x22d687[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x2b31ac['query'][_0x49c4('0x19')]);}return _0x318fdb[_0x49c4('0x77')](_0x22d687);}})[_0x49c4('0x20')](function(_0x3f62a2){if(_0x3f62a2){return _0x3f62a2?{'count':_0x4f30d4,'rows':_0x3f62a2}:null;}})[_0x49c4('0x20')](respondWithResult(_0x5a9370,null))['catch'](handleError(_0x5a9370,null));};
\ No newline at end of file
index 1c65be9..b506cfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1c4=['events','../../mysqldb','CmList','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3bf7ff,_0x6fe820){var _0x4dc2ef=function(_0x419f53){while(--_0x419f53){_0x3bf7ff['push'](_0x3bf7ff['shift']());}};_0x4dc2ef(++_0x6fe820);}(_0xe1c4,0x140));var _0x4e1c=function(_0x16b6e3,_0x5616f5){_0x16b6e3=_0x16b6e3-0x0;var _0x4732cf=_0xe1c4[_0x16b6e3];return _0x4732cf;};'use strict';var EventEmitter=require(_0x4e1c('0x0'));var CmList=require(_0x4e1c('0x1'))['db'][_0x4e1c('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x4e1c('0x3')](0x0);var events={'afterCreate':_0x4e1c('0x4'),'afterUpdate':'update','afterDestroy':_0x4e1c('0x5')};function emitEvent(_0x54ea57){return function(_0x1121b7,_0x493f81,_0x573cf5){CmListEvents[_0x4e1c('0x6')](_0x54ea57+':'+_0x1121b7['id'],_0x1121b7);CmListEvents[_0x4e1c('0x6')](_0x54ea57,_0x1121b7);_0x573cf5(null);};}for(var e in events){if(events[_0x4e1c('0x7')](e)){var event=events[e];CmList[_0x4e1c('0x8')](e,emitEvent(event));}}module[_0x4e1c('0x9')]=CmListEvents;
\ No newline at end of file
+var _0x7b63=['setMaxListeners','save','remove','emit','exports','events','CmList'];(function(_0x440917,_0x3a53d3){var _0x1f055f=function(_0x271c6c){while(--_0x271c6c){_0x440917['push'](_0x440917['shift']());}};_0x1f055f(++_0x3a53d3);}(_0x7b63,0xa6));var _0x37b6=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0x7b63[_0x32b993];return _0x482780;};'use strict';var EventEmitter=require(_0x37b6('0x0'));var CmList=require('../../mysqldb')['db'][_0x37b6('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x37b6('0x2')](0x0);var events={'afterCreate':_0x37b6('0x3'),'afterUpdate':'update','afterDestroy':_0x37b6('0x4')};function emitEvent(_0x2c184f){return function(_0x1e3a4e,_0x97406c,_0x2d9a50){CmListEvents[_0x37b6('0x5')](_0x2c184f+':'+_0x1e3a4e['id'],_0x1e3a4e);CmListEvents[_0x37b6('0x5')](_0x2c184f,_0x1e3a4e);_0x2d9a50(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x37b6('0x6')]=CmListEvents;
\ No newline at end of file
index 0e7c253..7e40708 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e01=['util','../../config/logger','api','moment','bluebird','exports','define','CmList','cm_lists','lodash'];(function(_0x2b9b48,_0x13a0f6){var _0xc28ddf=function(_0x241878){while(--_0x241878){_0x2b9b48['push'](_0x2b9b48['shift']());}};_0xc28ddf(++_0x13a0f6);}(_0x7e01,0x13f));var _0x17e0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7e01[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x17e0('0x0'));var util=require(_0x17e0('0x1'));var logger=require(_0x17e0('0x2'))(_0x17e0('0x3'));var moment=require(_0x17e0('0x4'));var BPromise=require(_0x17e0('0x5'));var rp=require('request-promise');var attributes=require('./cmList.attributes');module[_0x17e0('0x6')]=function(_0x363691,_0x30ef7c){return _0x363691[_0x17e0('0x7')](_0x17e0('0x8'),attributes,{'tableName':_0x17e0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7b01=['cm_lists','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./cmList.attributes','exports'];(function(_0x456541,_0x503c02){var _0x9846fb=function(_0x295ff6){while(--_0x295ff6){_0x456541['push'](_0x456541['shift']());}};_0x9846fb(++_0x503c02);}(_0x7b01,0x1eb));var _0x17b0=function(_0x378479,_0x269eab){_0x378479=_0x378479-0x0;var _0x507e33=_0x7b01[_0x378479];return _0x507e33;};'use strict';var _=require(_0x17b0('0x0'));var util=require(_0x17b0('0x1'));var logger=require(_0x17b0('0x2'))(_0x17b0('0x3'));var moment=require(_0x17b0('0x4'));var BPromise=require(_0x17b0('0x5'));var rp=require(_0x17b0('0x6'));var attributes=require(_0x17b0('0x7'));module[_0x17b0('0x8')]=function(_0x17231e,_0xc84c2b){return _0x17231e['define']('CmList',attributes,{'tableName':_0x17b0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0cabf89..4ffaf63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70dc=['code','message','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x306cd0,_0xb7ef0b){var _0x5863b8=function(_0x2bd5f5){while(--_0x2bd5f5){_0x306cd0['push'](_0x306cd0['shift']());}};_0x5863b8(++_0xb7ef0b);}(_0x70dc,0x1d1));var _0xc70d=function(_0x3b61e7,_0x28386d){_0x3b61e7=_0x3b61e7-0x0;var _0x2d0215=_0x70dc[_0x3b61e7];return _0x2d0215;};'use strict';var _=require(_0xc70d('0x0'));var util=require(_0xc70d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc70d('0x2'));var fs=require('fs');var db=require(_0xc70d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc70d('0x4'))('rpc');var config=require(_0xc70d('0x5'));var jayson=require(_0xc70d('0x6'));var client=jayson[_0xc70d('0x7')][_0xc70d('0x8')]({'port':0x232a});var socket=require(_0xc70d('0x9'))({'host':'localhost','port':0x18eb});require(_0xc70d('0xa'))[_0xc70d('0xb')](socket);function respondWithRpcPromise(_0x2721c7,_0x1a3513,_0x3f8d2d){return new BPromise(function(_0x526d12,_0x2aaba5){return client[_0xc70d('0xc')](_0x2721c7,_0x3f8d2d)[_0xc70d('0xd')](function(_0x4e47b2){logger[_0xc70d('0xe')](_0xc70d('0xf'),_0x1a3513,_0xc70d('0x10'));logger[_0xc70d('0x11')]('CmList,\x20%s,\x20%s,\x20%s',_0x1a3513,_0xc70d('0x10'),JSON['stringify'](_0x4e47b2));if(_0x4e47b2[_0xc70d('0x12')]){if(_0x4e47b2[_0xc70d('0x12')][_0xc70d('0x13')]===0x1f4){logger[_0xc70d('0x12')](_0xc70d('0xf'),_0x1a3513,_0x4e47b2[_0xc70d('0x12')][_0xc70d('0x14')]);return _0x2aaba5(_0x4e47b2[_0xc70d('0x12')][_0xc70d('0x14')]);}logger[_0xc70d('0x12')](_0xc70d('0xf'),_0x1a3513,_0x4e47b2[_0xc70d('0x12')][_0xc70d('0x14')]);return _0x526d12(_0x4e47b2[_0xc70d('0x12')][_0xc70d('0x14')]);}else{logger[_0xc70d('0xe')](_0xc70d('0xf'),_0x1a3513,_0xc70d('0x10'));_0x526d12(_0x4e47b2['result'][_0xc70d('0x14')]);}})[_0xc70d('0x15')](function(_0x3b698a){logger['error'](_0xc70d('0xf'),_0x1a3513,_0x3b698a);_0x2aaba5(_0x3b698a);});});}
\ No newline at end of file
+var _0x4071=['client','http','socket.io-emitter','localhost','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x4071,0x1d2));var _0x1407=function(_0x52ff8c,_0x2249a3){_0x52ff8c=_0x52ff8c-0x0;var _0x5c46a7=_0x4071[_0x52ff8c];return _0x5c46a7;};'use strict';var _=require(_0x1407('0x0'));var util=require('util');var moment=require(_0x1407('0x1'));var BPromise=require(_0x1407('0x2'));var rs=require(_0x1407('0x3'));var fs=require('fs');var db=require(_0x1407('0x4'))['db'];var utils=require(_0x1407('0x5'));var logger=require(_0x1407('0x6'))(_0x1407('0x7'));var config=require(_0x1407('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1407('0x9')][_0x1407('0xa')]({'port':0x232a});var socket=require(_0x1407('0xb'))({'host':_0x1407('0xc'),'port':0x18eb});require('./cmList.socket')[_0x1407('0xd')](socket);function respondWithRpcPromise(_0x2d0673,_0x42e42c,_0x2ff254){return new BPromise(function(_0x25799c,_0x45baed){return client[_0x1407('0xe')](_0x2d0673,_0x2ff254)['then'](function(_0x202427){logger[_0x1407('0xf')](_0x1407('0x10'),_0x42e42c,_0x1407('0x11'));logger[_0x1407('0x12')]('CmList,\x20%s,\x20%s,\x20%s',_0x42e42c,_0x1407('0x11'),JSON[_0x1407('0x13')](_0x202427));if(_0x202427[_0x1407('0x14')]){if(_0x202427['error'][_0x1407('0x15')]===0x1f4){logger[_0x1407('0x14')]('CmList,\x20%s,\x20%s',_0x42e42c,_0x202427[_0x1407('0x14')]['message']);return _0x45baed(_0x202427['error'][_0x1407('0x16')]);}logger[_0x1407('0x14')](_0x1407('0x10'),_0x42e42c,_0x202427['error'][_0x1407('0x16')]);return _0x25799c(_0x202427['error'][_0x1407('0x16')]);}else{logger[_0x1407('0xf')](_0x1407('0x10'),_0x42e42c,_0x1407('0x11'));_0x25799c(_0x202427[_0x1407('0x17')][_0x1407('0x16')]);}})[_0x1407('0x18')](function(_0xc5901f){logger[_0x1407('0x14')](_0x1407('0x10'),_0x42e42c,_0xc5901f);_0x45baed(_0xc5901f);});});}
\ No newline at end of file
index 975584a..4cc853f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fbb=['register','length','cmList:','./cmList.events','save','remove','update','emit','removeListener'];(function(_0x3b7c44,_0x1e203c){var _0x45c171=function(_0x179c98){while(--_0x179c98){_0x3b7c44['push'](_0x3b7c44['shift']());}};_0x45c171(++_0x1e203c);}(_0x8fbb,0x111));var _0xb8fb=function(_0x2f0175,_0x250c03){_0x2f0175=_0x2f0175-0x0;var _0x1d9e63=_0x8fbb[_0x2f0175];return _0x1d9e63;};'use strict';var CmListEvents=require(_0xb8fb('0x0'));var events=[_0xb8fb('0x1'),_0xb8fb('0x2'),_0xb8fb('0x3')];function createListener(_0x371bfb,_0x5b31a9){return function(_0x512d40){_0x5b31a9[_0xb8fb('0x4')](_0x371bfb,_0x512d40);};}function removeListener(_0x157b9c,_0x405e6e){return function(){CmListEvents[_0xb8fb('0x5')](_0x157b9c,_0x405e6e);};}exports[_0xb8fb('0x6')]=function(_0x532152){for(var _0x3c7bc1=0x0,_0x8ab11a=events[_0xb8fb('0x7')];_0x3c7bc1<_0x8ab11a;_0x3c7bc1++){var _0x4415c4=events[_0x3c7bc1];var _0x1af6e3=createListener(_0xb8fb('0x8')+_0x4415c4,_0x532152);CmListEvents['on'](_0x4415c4,_0x1af6e3);}};
\ No newline at end of file
+var _0x0bd9=['emit','removeListener','register','length','cmList:','./cmList.events','save','update'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0x0bd9,0xcd));var _0x90bd=function(_0x3ce2bd,_0x2d2e6f){_0x3ce2bd=_0x3ce2bd-0x0;var _0x530b42=_0x0bd9[_0x3ce2bd];return _0x530b42;};'use strict';var CmListEvents=require(_0x90bd('0x0'));var events=[_0x90bd('0x1'),'remove',_0x90bd('0x2')];function createListener(_0x4b2cec,_0x1bbb38){return function(_0xadebf3){_0x1bbb38[_0x90bd('0x3')](_0x4b2cec,_0xadebf3);};}function removeListener(_0x489066,_0x1870bb){return function(){CmListEvents[_0x90bd('0x4')](_0x489066,_0x1870bb);};}exports[_0x90bd('0x5')]=function(_0x59318d){for(var _0x2bfeaf=0x0,_0x273908=events[_0x90bd('0x6')];_0x2bfeaf<_0x273908;_0x2bfeaf++){var _0x46cb3e=events[_0x2bfeaf];var _0x37c6c4=createListener(_0x90bd('0x7')+_0x46cb3e,_0x59318d);CmListEvents['on'](_0x46cb3e,_0x37c6c4);}};
\ No newline at end of file
index 95bc974..f7a0240 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x355a=['post','/:id/dispositions','addDisposition','addContacts','addCustomField','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./cmList.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','create'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0x355a,0x1c8));var _0xa355=function(_0x9b5420,_0x474553){_0x9b5420=_0x9b5420-0x0;var _0x152c9c=_0x355a[_0x9b5420];return _0x152c9c;};'use strict';var multer=require(_0xa355('0x0'));var util=require(_0xa355('0x1'));var path=require(_0xa355('0x2'));var express=require(_0xa355('0x3'));var router=express[_0xa355('0x4')]();var auth=require(_0xa355('0x5'));var interaction=require(_0xa355('0x6'));var config=require('../../config/environment');var controller=require(_0xa355('0x7'));router['get']('/',auth[_0xa355('0x8')](),controller[_0xa355('0x9')]);router['get'](_0xa355('0xa'),auth[_0xa355('0x8')](),controller[_0xa355('0xb')]);router[_0xa355('0xc')](_0xa355('0xd'),auth[_0xa355('0x8')](),controller[_0xa355('0xe')]);router[_0xa355('0xc')]('/:id/dispositions',auth[_0xa355('0x8')](),controller['getDispositions']);router['get'](_0xa355('0xf'),auth[_0xa355('0x8')](),controller[_0xa355('0x10')]);router[_0xa355('0xc')](_0xa355('0x11'),auth['isAuthenticated'](),controller[_0xa355('0x12')]);router[_0xa355('0xc')](_0xa355('0x13'),auth['isAuthenticated'](),controller[_0xa355('0x14')]);router[_0xa355('0xc')](_0xa355('0x15'),auth['isAuthenticated'](),controller[_0xa355('0x16')]);router['post']('/',auth[_0xa355('0x8')](),controller[_0xa355('0x17')]);router[_0xa355('0x18')](_0xa355('0x19'),auth['isAuthenticated'](),controller[_0xa355('0x1a')]);router[_0xa355('0x18')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xa355('0x1b')]);router['post'](_0xa355('0x13'),auth[_0xa355('0x8')](),controller[_0xa355('0x1c')]);router[_0xa355('0x18')](_0xa355('0x15'),auth[_0xa355('0x8')](),controller['addAgents']);router['put']('/:id',auth[_0xa355('0x8')](),controller[_0xa355('0x1d')]);router[_0xa355('0x1e')](_0xa355('0xd'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xa355('0x19'),auth[_0xa355('0x8')](),controller['removeDispositions']);router[_0xa355('0x1e')](_0xa355('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xa355('0x1f')]=router;
\ No newline at end of file
+var _0x540e=['addContacts','addCustomField','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','index','isAuthenticated','/:id','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','/:id/contacts'];(function(_0x487702,_0x49f5d4){var _0x5e7150=function(_0x2b2b29){while(--_0x2b2b29){_0x487702['push'](_0x487702['shift']());}};_0x5e7150(++_0x49f5d4);}(_0x540e,0xef));var _0xe540=function(_0x206432,_0x304b4a){_0x206432=_0x206432-0x0;var _0x46ac13=_0x540e[_0x206432];return _0x46ac13;};'use strict';var multer=require(_0xe540('0x0'));var util=require(_0xe540('0x1'));var path=require(_0xe540('0x2'));var express=require(_0xe540('0x3'));var router=express['Router']();var auth=require(_0xe540('0x4'));var interaction=require(_0xe540('0x5'));var config=require(_0xe540('0x6'));var controller=require(_0xe540('0x7'));router[_0xe540('0x8')]('/',auth['isAuthenticated'](),controller[_0xe540('0x9')]);router[_0xe540('0x8')]('/describe',auth[_0xe540('0xa')](),controller['describe']);router[_0xe540('0x8')](_0xe540('0xb'),auth[_0xe540('0xa')](),controller['show']);router[_0xe540('0x8')]('/:id/dispositions',auth[_0xe540('0xa')](),controller[_0xe540('0xc')]);router[_0xe540('0x8')]('/:id/contacts',auth[_0xe540('0xa')](),controller[_0xe540('0xd')]);router[_0xe540('0x8')](_0xe540('0xe'),auth[_0xe540('0xa')](),controller[_0xe540('0xf')]);router[_0xe540('0x8')](_0xe540('0x10'),auth[_0xe540('0xa')](),controller[_0xe540('0x11')]);router[_0xe540('0x8')](_0xe540('0x12'),auth[_0xe540('0xa')](),controller[_0xe540('0x13')]);router[_0xe540('0x14')]('/',auth[_0xe540('0xa')](),controller[_0xe540('0x15')]);router['post'](_0xe540('0x16'),auth[_0xe540('0xa')](),controller[_0xe540('0x17')]);router[_0xe540('0x14')](_0xe540('0x18'),auth['isAuthenticated'](),controller[_0xe540('0x19')]);router[_0xe540('0x14')](_0xe540('0x10'),auth[_0xe540('0xa')](),controller[_0xe540('0x1a')]);router[_0xe540('0x14')](_0xe540('0x12'),auth[_0xe540('0xa')](),controller['addAgents']);router['put'](_0xe540('0xb'),auth[_0xe540('0xa')](),controller[_0xe540('0x1b')]);router[_0xe540('0x1c')](_0xe540('0xb'),auth[_0xe540('0xa')](),controller[_0xe540('0x1d')]);router[_0xe540('0x1c')](_0xe540('0x16'),auth[_0xe540('0xa')](),controller[_0xe540('0x1e')]);router['delete']('/:id/users',auth[_0xe540('0xa')](),controller[_0xe540('0x1f')]);module[_0xe540('0x20')]=router;
\ No newline at end of file
index ffdbf77..76afa1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x296e=['STRING','VIRTUAL','getDataValue','field'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x296e,0x11d));var _0xe296=function(_0x5e5930,_0x3248a7){_0x5e5930=_0x5e5930-0x0;var _0x2d00ac=_0x296e[_0x5e5930];return _0x2d00ac;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe296('0x0')],'get':function(_0x1cca92){return this[_0xe296('0x1')](_0xe296('0x2'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xe296('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xe296('0x3')],'allowNull':![]}};
\ No newline at end of file
+var _0xb0bf=['getDataValue','field','STRING','sequelize','VIRTUAL'];(function(_0x15b668,_0x43d6d7){var _0x3411be=function(_0x4eb771){while(--_0x4eb771){_0x15b668['push'](_0x15b668['shift']());}};_0x3411be(++_0x43d6d7);}(_0xb0bf,0x125));var _0xfb0b=function(_0x269653,_0x4f8a59){_0x269653=_0x269653-0x0;var _0x59ed2e=_0xb0bf[_0x269653];return _0x59ed2e;};'use strict';var Sequelize=require(_0xfb0b('0x0'));module['exports']={'name':{'type':Sequelize[_0xfb0b('0x1')],'get':function(_0x3db786){return this[_0xfb0b('0x2')](_0xfb0b('0x3'));}},'field':{'type':Sequelize[_0xfb0b('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xfb0b('0x4')],'allowNull':![]}};
\ No newline at end of file
index bfb9fc3..1f42147 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3204=['name','send','update','body','Condition','find','params','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','limit','set','apply','reject','then','destroy','end','error'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x3204,0x12e));var _0x4320=function(_0x5ba97f,_0x366ae5){_0x5ba97f=_0x5ba97f-0x0;var _0x43d675=_0x3204[_0x5ba97f];return _0x43d675;};'use strict';var pdf=require(_0x4320('0x0'));var emlformat=require(_0x4320('0x1'));var rimraf=require(_0x4320('0x2'));var zipdir=require(_0x4320('0x3'));var jsonpatch=require(_0x4320('0x4'));var rp=require(_0x4320('0x5'));var moment=require(_0x4320('0x6'));var BPromise=require(_0x4320('0x7'));var Mustache=require(_0x4320('0x8'));var util=require('util');var path=require('path');var sox=require(_0x4320('0x9'));var csv=require(_0x4320('0xa'));var ejs=require(_0x4320('0xb'));var fs=require('fs');var _=require(_0x4320('0xc'));var squel=require(_0x4320('0xd'));var crypto=require(_0x4320('0xe'));var jsforce=require(_0x4320('0xf'));var deskjs=require(_0x4320('0x10'));var toCsv=require(_0x4320('0xa'));var querystring=require('querystring');var Papa=require(_0x4320('0x11'));var qs=require(_0x4320('0x12'));var logger=require(_0x4320('0x13'))(_0x4320('0x14'));var utils=require('../../config/utils');var config=require(_0x4320('0x15'));var db=require(_0x4320('0x16'))['db'];function respondWithStatusCode(_0x53cbd7,_0x505b60){_0x505b60=_0x505b60||0xcc;return function(_0x5e7293){if(_0x5e7293){return _0x53cbd7[_0x4320('0x17')](_0x505b60);}return _0x53cbd7[_0x4320('0x18')](_0x505b60)['end']();};}function respondWithResult(_0x55bfa5,_0x405df0){_0x405df0=_0x405df0||0xc8;return function(_0x2a28de){if(_0x2a28de){return _0x55bfa5[_0x4320('0x18')](_0x405df0)[_0x4320('0x19')](_0x2a28de);}};}function respondWithFilteredResult(_0x27be96,_0x14b04e){return function(_0x4994ca){if(_0x4994ca){var _0x4e4fdb=_0x4994ca['count'],_0x4be57e=_0x14b04e['offset'],_0x529ca9=_0x14b04e['offset']+_0x14b04e[_0x4320('0x1a')],_0x39d8e0;if(_0x529ca9>=_0x4e4fdb){_0x529ca9=_0x4e4fdb;_0x39d8e0=0xc8;}else{_0x39d8e0=0xce;}_0x27be96[_0x4320('0x18')](_0x39d8e0);return _0x27be96[_0x4320('0x1b')]('Content-Range',_0x4be57e+'-'+_0x529ca9+'/'+_0x4e4fdb)['json'](_0x4994ca);}return null;};}function patchUpdates(_0x24dbac){return function(_0x17b37e){try{jsonpatch[_0x4320('0x1c')](_0x17b37e,_0x24dbac,!![]);}catch(_0x5649c5){return BPromise[_0x4320('0x1d')](_0x5649c5);}return _0x17b37e['save']();};}function saveUpdates(_0x4237a9,_0x152b11){return function(_0x3e6ef9){if(_0x3e6ef9){return _0x3e6ef9['update'](_0x4237a9)[_0x4320('0x1e')](function(_0x5c1291){return _0x5c1291;});}return null;};}function removeEntity(_0x537df5,_0x25941c){return function(_0x4a8e8b){if(_0x4a8e8b){return _0x4a8e8b[_0x4320('0x1f')]()[_0x4320('0x1e')](function(){_0x537df5[_0x4320('0x18')](0xcc)[_0x4320('0x20')]();});}};}function handleEntityNotFound(_0x2fcb71,_0x53a8a8){return function(_0x584a10){if(!_0x584a10){_0x2fcb71[_0x4320('0x17')](0x194);}return _0x584a10;};}function handleError(_0x589d0e,_0x6d670c){_0x6d670c=_0x6d670c||0x1f4;return function(_0x1c5a5d){logger[_0x4320('0x21')](_0x1c5a5d['stack']);if(_0x1c5a5d[_0x4320('0x22')]){delete _0x1c5a5d['name'];}_0x589d0e['status'](_0x6d670c)[_0x4320('0x23')](_0x1c5a5d);};}exports[_0x4320('0x24')]=function(_0x49951f,_0xc0e688){if(_0x49951f[_0x4320('0x25')]['id']){delete _0x49951f['body']['id'];}return db[_0x4320('0x26')][_0x4320('0x27')]({'where':{'id':_0x49951f[_0x4320('0x28')]['id']}})['then'](handleEntityNotFound(_0xc0e688,null))[_0x4320('0x1e')](saveUpdates(_0x49951f[_0x4320('0x25')],null))[_0x4320('0x1e')](respondWithResult(_0xc0e688,null))[_0x4320('0x29')](handleError(_0xc0e688,null));};exports[_0x4320('0x1f')]=function(_0x3b47c1,_0xd5d890){return db[_0x4320('0x26')][_0x4320('0x27')]({'where':{'id':_0x3b47c1[_0x4320('0x28')]['id']}})[_0x4320('0x1e')](handleEntityNotFound(_0xd5d890,null))['then'](removeEntity(_0xd5d890,null))['catch'](handleError(_0xd5d890,null));};
\ No newline at end of file
+var _0x3663=['catch','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','save','update','then','destroy','error','name','send','body','Condition','find','params'];(function(_0x21b99b,_0x38e50b){var _0x553658=function(_0x35c628){while(--_0x35c628){_0x21b99b['push'](_0x21b99b['shift']());}};_0x553658(++_0x38e50b);}(_0x3663,0x1cf));var _0x3366=function(_0x418c3a,_0xafc508){_0x418c3a=_0x418c3a-0x0;var _0x5ebf73=_0x3663[_0x418c3a];return _0x5ebf73;};'use strict';var pdf=require(_0x3366('0x0'));var emlformat=require(_0x3366('0x1'));var rimraf=require(_0x3366('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3366('0x3'));var rp=require(_0x3366('0x4'));var moment=require('moment');var BPromise=require(_0x3366('0x5'));var Mustache=require(_0x3366('0x6'));var util=require(_0x3366('0x7'));var path=require(_0x3366('0x8'));var sox=require(_0x3366('0x9'));var csv=require('to-csv');var ejs=require(_0x3366('0xa'));var fs=require('fs');var _=require(_0x3366('0xb'));var squel=require('squel');var crypto=require(_0x3366('0xc'));var jsforce=require(_0x3366('0xd'));var deskjs=require(_0x3366('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3366('0xf'));var Papa=require(_0x3366('0x10'));var qs=require(_0x3366('0x11'));var logger=require('../../config/logger')(_0x3366('0x12'));var utils=require(_0x3366('0x13'));var config=require(_0x3366('0x14'));var db=require(_0x3366('0x15'))['db'];function respondWithStatusCode(_0x38d814,_0xcd1252){_0xcd1252=_0xcd1252||0xcc;return function(_0x200c26){if(_0x200c26){return _0x38d814['sendStatus'](_0xcd1252);}return _0x38d814['status'](_0xcd1252)[_0x3366('0x16')]();};}function respondWithResult(_0x783695,_0x693c7d){_0x693c7d=_0x693c7d||0xc8;return function(_0x321468){if(_0x321468){return _0x783695[_0x3366('0x17')](_0x693c7d)[_0x3366('0x18')](_0x321468);}};}function respondWithFilteredResult(_0x5b4063,_0x58e02a){return function(_0x27753e){if(_0x27753e){var _0x51ff8c=_0x27753e[_0x3366('0x19')],_0xa0b467=_0x58e02a[_0x3366('0x1a')],_0x293f69=_0x58e02a['offset']+_0x58e02a[_0x3366('0x1b')],_0x190524;if(_0x293f69>=_0x51ff8c){_0x293f69=_0x51ff8c;_0x190524=0xc8;}else{_0x190524=0xce;}_0x5b4063[_0x3366('0x17')](_0x190524);return _0x5b4063[_0x3366('0x1c')](_0x3366('0x1d'),_0xa0b467+'-'+_0x293f69+'/'+_0x51ff8c)[_0x3366('0x18')](_0x27753e);}return null;};}function patchUpdates(_0x25d56c){return function(_0x4d074a){try{jsonpatch['apply'](_0x4d074a,_0x25d56c,!![]);}catch(_0x25320d){return BPromise['reject'](_0x25320d);}return _0x4d074a[_0x3366('0x1e')]();};}function saveUpdates(_0x117796,_0xd5ff94){return function(_0x2421bf){if(_0x2421bf){return _0x2421bf[_0x3366('0x1f')](_0x117796)[_0x3366('0x20')](function(_0x50bbc9){return _0x50bbc9;});}return null;};}function removeEntity(_0x3471ab,_0x89c427){return function(_0x597d9b){if(_0x597d9b){return _0x597d9b[_0x3366('0x21')]()[_0x3366('0x20')](function(){_0x3471ab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x239872,_0x1d228b){return function(_0x21a2c4){if(!_0x21a2c4){_0x239872['sendStatus'](0x194);}return _0x21a2c4;};}function handleError(_0x5328dd,_0x32e25c){_0x32e25c=_0x32e25c||0x1f4;return function(_0x4760ff){logger[_0x3366('0x22')](_0x4760ff['stack']);if(_0x4760ff[_0x3366('0x23')]){delete _0x4760ff['name'];}_0x5328dd[_0x3366('0x17')](_0x32e25c)[_0x3366('0x24')](_0x4760ff);};}exports[_0x3366('0x1f')]=function(_0x63c903,_0x3266da){if(_0x63c903[_0x3366('0x25')]['id']){delete _0x63c903[_0x3366('0x25')]['id'];}return db[_0x3366('0x26')][_0x3366('0x27')]({'where':{'id':_0x63c903[_0x3366('0x28')]['id']}})['then'](handleEntityNotFound(_0x3266da,null))[_0x3366('0x20')](saveUpdates(_0x63c903[_0x3366('0x25')],null))['then'](respondWithResult(_0x3266da,null))[_0x3366('0x29')](handleError(_0x3266da,null));};exports[_0x3366('0x21')]=function(_0x1354c6,_0x280fda){return db[_0x3366('0x26')][_0x3366('0x27')]({'where':{'id':_0x1354c6[_0x3366('0x28')]['id']}})[_0x3366('0x20')](handleEntityNotFound(_0x280fda,null))[_0x3366('0x20')](removeEntity(_0x280fda,null))[_0x3366('0x29')](handleError(_0x280fda,null));};
\ No newline at end of file
index cf1b5c4..83adea8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1005=['Condition','tools_conditions','util','../../config/logger','api','moment','request-promise','./condition.attributes','exports','define'];(function(_0x2de020,_0x252df0){var _0x182b7c=function(_0xcbcdaa){while(--_0xcbcdaa){_0x2de020['push'](_0x2de020['shift']());}};_0x182b7c(++_0x252df0);}(_0x1005,0x1ec));var _0x5100=function(_0x3c14ca,_0x5b2268){_0x3c14ca=_0x3c14ca-0x0;var _0x424459=_0x1005[_0x3c14ca];return _0x424459;};'use strict';var _=require('lodash');var util=require(_0x5100('0x0'));var logger=require(_0x5100('0x1'))(_0x5100('0x2'));var moment=require(_0x5100('0x3'));var BPromise=require('bluebird');var rp=require(_0x5100('0x4'));var attributes=require(_0x5100('0x5'));module[_0x5100('0x6')]=function(_0x304f0f,_0x144312){return _0x304f0f[_0x5100('0x7')](_0x5100('0x8'),attributes,{'tableName':_0x5100('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x98da=['define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./condition.attributes'];(function(_0x5b5eb4,_0x117c87){var _0x42af53=function(_0xdf6fcb){while(--_0xdf6fcb){_0x5b5eb4['push'](_0x5b5eb4['shift']());}};_0x42af53(++_0x117c87);}(_0x98da,0xe2));var _0xa98d=function(_0x1c03a6,_0x169722){_0x1c03a6=_0x1c03a6-0x0;var _0x3f83f6=_0x98da[_0x1c03a6];return _0x3f83f6;};'use strict';var _=require(_0xa98d('0x0'));var util=require(_0xa98d('0x1'));var logger=require(_0xa98d('0x2'))(_0xa98d('0x3'));var moment=require(_0xa98d('0x4'));var BPromise=require(_0xa98d('0x5'));var rp=require(_0xa98d('0x6'));var attributes=require(_0xa98d('0x7'));module['exports']=function(_0x16f06c,_0x42ada7){return _0x16f06c[_0xa98d('0x8')]('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7abd748..91d171d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bb4=['Condition,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x265ff5,_0xcbea65){var _0x5298fc=function(_0x192d46){while(--_0x192d46){_0x265ff5['push'](_0x265ff5['shift']());}};_0x5298fc(++_0xcbea65);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x1ff497,_0x4093de){_0x1ff497=_0x1ff497-0x0;var _0x46936e=_0x6bb4[_0x1ff497];return _0x46936e;};'use strict';var _=require(_0x46bb('0x0'));var util=require(_0x46bb('0x1'));var moment=require(_0x46bb('0x2'));var BPromise=require('bluebird');var rs=require(_0x46bb('0x3'));var fs=require('fs');var db=require(_0x46bb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x46bb('0x5'))(_0x46bb('0x6'));var config=require(_0x46bb('0x7'));var jayson=require(_0x46bb('0x8'));var client=jayson[_0x46bb('0x9')][_0x46bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5dd7d6,_0x4fa5c4,_0x2f1e64){return new BPromise(function(_0x4338c9,_0x57fb08){return client['request'](_0x5dd7d6,_0x2f1e64)['then'](function(_0x44cf0e){logger[_0x46bb('0xb')]('Condition,\x20%s,\x20%s',_0x4fa5c4,_0x46bb('0xc'));logger[_0x46bb('0xd')](_0x46bb('0xe'),_0x4fa5c4,'request\x20sent',JSON[_0x46bb('0xf')](_0x44cf0e));if(_0x44cf0e[_0x46bb('0x10')]){if(_0x44cf0e['error'][_0x46bb('0x11')]===0x1f4){logger[_0x46bb('0x10')](_0x46bb('0x12'),_0x4fa5c4,_0x44cf0e['error'][_0x46bb('0x13')]);return _0x57fb08(_0x44cf0e['error']['message']);}logger[_0x46bb('0x10')]('Condition,\x20%s,\x20%s',_0x4fa5c4,_0x44cf0e[_0x46bb('0x10')][_0x46bb('0x13')]);return _0x4338c9(_0x44cf0e['error'][_0x46bb('0x13')]);}else{logger['info'](_0x46bb('0x12'),_0x4fa5c4,'request\x20sent');_0x4338c9(_0x44cf0e[_0x46bb('0x14')]['message']);}})['catch'](function(_0x3aedc4){logger[_0x46bb('0x10')]('Condition,\x20%s,\x20%s',_0x4fa5c4,_0x3aedc4);_0x57fb08(_0x3aedc4);});});}
\ No newline at end of file
+var _0xd88b=['../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x355adc,_0xac51ab){var _0x4df04f=function(_0x4a787d){while(--_0x4a787d){_0x355adc['push'](_0x355adc['shift']());}};_0x4df04f(++_0xac51ab);}(_0xd88b,0xa7));var _0xbd88=function(_0x3a6337,_0x1087fb){_0x3a6337=_0x3a6337-0x0;var _0x4d5ae1=_0xd88b[_0x3a6337];return _0x4d5ae1;};'use strict';var _=require(_0xbd88('0x0'));var util=require('util');var moment=require(_0xbd88('0x1'));var BPromise=require(_0xbd88('0x2'));var rs=require(_0xbd88('0x3'));var fs=require('fs');var db=require(_0xbd88('0x4'))['db'];var utils=require(_0xbd88('0x5'));var logger=require(_0xbd88('0x6'))(_0xbd88('0x7'));var config=require(_0xbd88('0x8'));var jayson=require(_0xbd88('0x9'));var client=jayson[_0xbd88('0xa')][_0xbd88('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c4eda,_0x1e9160,_0x51f0ca){return new BPromise(function(_0x231777,_0x42d1d0){return client[_0xbd88('0xc')](_0x4c4eda,_0x51f0ca)[_0xbd88('0xd')](function(_0x241eff){logger[_0xbd88('0xe')](_0xbd88('0xf'),_0x1e9160,'request\x20sent');logger[_0xbd88('0x10')](_0xbd88('0x11'),_0x1e9160,'request\x20sent',JSON[_0xbd88('0x12')](_0x241eff));if(_0x241eff['error']){if(_0x241eff['error'][_0xbd88('0x13')]===0x1f4){logger[_0xbd88('0x14')](_0xbd88('0xf'),_0x1e9160,_0x241eff['error'][_0xbd88('0x15')]);return _0x42d1d0(_0x241eff[_0xbd88('0x14')][_0xbd88('0x15')]);}logger[_0xbd88('0x14')](_0xbd88('0xf'),_0x1e9160,_0x241eff[_0xbd88('0x14')][_0xbd88('0x15')]);return _0x231777(_0x241eff['error'][_0xbd88('0x15')]);}else{logger['info'](_0xbd88('0xf'),_0x1e9160,_0xbd88('0x16'));_0x231777(_0x241eff[_0xbd88('0x17')][_0xbd88('0x15')]);}})[_0xbd88('0x18')](function(_0x4ac9ea){logger[_0xbd88('0x14')](_0xbd88('0xf'),_0x1e9160,_0x4ac9ea);_0x42d1d0(_0x4ac9ea);});});}
\ No newline at end of file
index 677897a..deed41f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02ea=['/:id','isAuthenticated','destroy','util','path','express','Router','../../config/environment','./condition.controller','delete'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x02ea,0xf3));var _0xa02e=function(_0x124298,_0x542004){_0x124298=_0x124298-0x0;var _0x35ac24=_0x02ea[_0x124298];return _0x35ac24;};'use strict';var multer=require('multer');var util=require(_0xa02e('0x0'));var path=require(_0xa02e('0x1'));var express=require(_0xa02e('0x2'));var router=express[_0xa02e('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa02e('0x4'));var controller=require(_0xa02e('0x5'));router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa02e('0x6')](_0xa02e('0x7'),auth[_0xa02e('0x8')](),controller[_0xa02e('0x9')]);module['exports']=router;
\ No newline at end of file
+var _0x0c51=['put','/:id','isAuthenticated','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./condition.controller'];(function(_0x432bd5,_0x24276b){var _0x49e64a=function(_0x5818fb){while(--_0x5818fb){_0x432bd5['push'](_0x432bd5['shift']());}};_0x49e64a(++_0x24276b);}(_0x0c51,0xbb));var _0x10c5=function(_0x558bf8,_0x37ff22){_0x558bf8=_0x558bf8-0x0;var _0x961fce=_0x0c51[_0x558bf8];return _0x961fce;};'use strict';var multer=require(_0x10c5('0x0'));var util=require(_0x10c5('0x1'));var path=require(_0x10c5('0x2'));var express=require(_0x10c5('0x3'));var router=express[_0x10c5('0x4')]();var auth=require(_0x10c5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x10c5('0x6'));var controller=require(_0x10c5('0x7'));router[_0x10c5('0x8')](_0x10c5('0x9'),auth[_0x10c5('0xa')](),controller['update']);router[_0x10c5('0xb')](_0x10c5('0x9'),auth[_0x10c5('0xa')](),controller[_0x10c5('0xc')]);module['exports']=router;
\ No newline at end of file
index f865e6f..73653d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf875=['name','sequelize','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xf875,0x19f));var _0x5f87=function(_0x156d5f,_0x58fd47){_0x156d5f=_0x156d5f-0x0;var _0x487260=_0xf875[_0x156d5f];return _0x487260;};'use strict';var Sequelize=require(_0x5f87('0x0'));module[_0x5f87('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5f87('0x2')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2ac1=['STRING','sequelize','exports'];(function(_0x17e378,_0x5f3aaa){var _0x5a266f=function(_0x17bebe){while(--_0x17bebe){_0x17e378['push'](_0x17e378['shift']());}};_0x5a266f(++_0x5f3aaa);}(_0x2ac1,0x73));var _0x12ac=function(_0x2ac5de,_0x2cebca){_0x2ac5de=_0x2ac5de-0x0;var _0x1415b2=_0x2ac1[_0x2ac5de];return _0x1415b2;};'use strict';var Sequelize=require(_0x12ac('0x0'));module[_0x12ac('0x1')]={'name':{'type':Sequelize[_0x12ac('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x12ac('0x2')]}};
\ No newline at end of file
index abb3894..9c22a3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2ea=['rows','catch','show','params','find','create','omit','createdAt','body','updatedAt','type','iframe','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','stringify','addItem','DashboardItem','getItems','findOne','filter','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','../../config/logger','api','../../config/utils','../../config/environment','socket.io-emitter','./dashboard.socket','register','sendStatus','end','json','count','offset','limit','status','set','Content-Range','update','then','destroy','error','stack','name','send','Dashboard','rawAttributes','model','keys','query','dateEnd','dateStart','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','add','day','merge','map','options','includeAll','include','findAll'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0xd2ea,0x15f));var _0xad2e=function(_0xf3e0bb,_0x242698){_0xf3e0bb=_0xf3e0bb-0x0;var _0x3c5130=_0xd2ea[_0xf3e0bb];return _0x3c5130;};'use strict';var pdf=require(_0xad2e('0x0'));var emlformat=require(_0xad2e('0x1'));var rimraf=require(_0xad2e('0x2'));var zipdir=require(_0xad2e('0x3'));var jsonpatch=require(_0xad2e('0x4'));var rp=require('request-promise');var moment=require(_0xad2e('0x5'));var BPromise=require(_0xad2e('0x6'));var Mustache=require(_0xad2e('0x7'));var util=require(_0xad2e('0x8'));var path=require(_0xad2e('0x9'));var sox=require(_0xad2e('0xa'));var csv=require(_0xad2e('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xad2e('0xc'));var squel=require(_0xad2e('0xd'));var crypto=require(_0xad2e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xad2e('0xf'));var toCsv=require(_0xad2e('0xb'));var querystring=require('querystring');var Papa=require(_0xad2e('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xad2e('0x11'))(_0xad2e('0x12'));var utils=require(_0xad2e('0x13'));var config=require(_0xad2e('0x14'));var db=require('../../mysqldb')['db'];var socket=require(_0xad2e('0x15'))({'host':'localhost','port':0x18eb});require(_0xad2e('0x16'))[_0xad2e('0x17')](socket);function respondWithStatusCode(_0x433696,_0x42e2f2){_0x42e2f2=_0x42e2f2||0xcc;return function(_0x59a342){if(_0x59a342){return _0x433696[_0xad2e('0x18')](_0x42e2f2);}return _0x433696['status'](_0x42e2f2)[_0xad2e('0x19')]();};}function respondWithResult(_0x5772f0,_0x4fbabc){_0x4fbabc=_0x4fbabc||0xc8;return function(_0x4a812b){if(_0x4a812b){return _0x5772f0['status'](_0x4fbabc)[_0xad2e('0x1a')](_0x4a812b);}};}function respondWithFilteredResult(_0x282780,_0x1646d5){return function(_0x2b6945){if(_0x2b6945){var _0x17e6ac=_0x2b6945[_0xad2e('0x1b')],_0x4180aa=_0x1646d5[_0xad2e('0x1c')],_0x2546e2=_0x1646d5[_0xad2e('0x1c')]+_0x1646d5[_0xad2e('0x1d')],_0x5941c5;if(_0x2546e2>=_0x17e6ac){_0x2546e2=_0x17e6ac;_0x5941c5=0xc8;}else{_0x5941c5=0xce;}_0x282780[_0xad2e('0x1e')](_0x5941c5);return _0x282780[_0xad2e('0x1f')](_0xad2e('0x20'),_0x4180aa+'-'+_0x2546e2+'/'+_0x17e6ac)['json'](_0x2b6945);}return null;};}function patchUpdates(_0x245617){return function(_0x30b994){try{jsonpatch['apply'](_0x30b994,_0x245617,!![]);}catch(_0x50eb1a){return BPromise['reject'](_0x50eb1a);}return _0x30b994['save']();};}function saveUpdates(_0x18c38d,_0x293adc){return function(_0x5549db){if(_0x5549db){return _0x5549db[_0xad2e('0x21')](_0x18c38d)[_0xad2e('0x22')](function(_0x41109a){return _0x41109a;});}return null;};}function removeEntity(_0x29dc4f,_0x23c0b6){return function(_0x102169){if(_0x102169){return _0x102169[_0xad2e('0x23')]()[_0xad2e('0x22')](function(){_0x29dc4f[_0xad2e('0x1e')](0xcc)[_0xad2e('0x19')]();});}};}function handleEntityNotFound(_0x20e664,_0x207517){return function(_0x2e1c95){if(!_0x2e1c95){_0x20e664['sendStatus'](0x194);}return _0x2e1c95;};}function handleError(_0x2e727c,_0x2e8887){_0x2e8887=_0x2e8887||0x1f4;return function(_0x22e237){logger[_0xad2e('0x24')](_0x22e237[_0xad2e('0x25')]);if(_0x22e237[_0xad2e('0x26')]){delete _0x22e237[_0xad2e('0x26')];}_0x2e727c[_0xad2e('0x1e')](_0x2e8887)[_0xad2e('0x27')](_0x22e237);};}exports['index']=function(_0x356a19,_0x5d675f){var _0x2b2bc2={},_0x28ef72={},_0x22bc9b={'count':0x0,'rows':[]};var _0x11bfa9=db[_0xad2e('0x28')][_0xad2e('0x29')];_0x28ef72[_0xad2e('0x2a')]=_[_0xad2e('0x2b')](_0x11bfa9);var _0x52fdda={'dateStart':_0x356a19[_0xad2e('0x2c')]['dateStart'],'dateEnd':_0x356a19[_0xad2e('0x2c')][_0xad2e('0x2d')]};delete _0x356a19[_0xad2e('0x2c')][_0xad2e('0x2e')];delete _0x356a19[_0xad2e('0x2c')][_0xad2e('0x2d')];_0x28ef72[_0xad2e('0x2c')]=_[_0xad2e('0x2b')](_0x356a19[_0xad2e('0x2c')]);_0x28ef72[_0xad2e('0x2f')]=_[_0xad2e('0x30')](_0x28ef72['model'],_0x28ef72[_0xad2e('0x2c')]);_0x2b2bc2['attributes']=_[_0xad2e('0x30')](_0x28ef72[_0xad2e('0x2a')],qs[_0xad2e('0x31')](_0x356a19[_0xad2e('0x2c')][_0xad2e('0x31')]));_0x2b2bc2['attributes']=_0x2b2bc2[_0xad2e('0x32')][_0xad2e('0x33')]?_0x2b2bc2['attributes']:_0x28ef72[_0xad2e('0x2a')];if(!_0x356a19[_0xad2e('0x2c')]['hasOwnProperty'](_0xad2e('0x34'))){_0x2b2bc2[_0xad2e('0x1d')]=qs[_0xad2e('0x1d')](_0x356a19[_0xad2e('0x2c')][_0xad2e('0x1d')]);_0x2b2bc2[_0xad2e('0x1c')]=qs[_0xad2e('0x1c')](_0x356a19['query'][_0xad2e('0x1c')]);}_0x2b2bc2[_0xad2e('0x35')]=qs['sort'](_0x356a19[_0xad2e('0x2c')][_0xad2e('0x36')]);_0x2b2bc2[_0xad2e('0x37')]=qs[_0xad2e('0x2f')](_[_0xad2e('0x38')](_0x356a19[_0xad2e('0x2c')],_0x28ef72['filters']));if(_0x52fdda['dateStart']){if(_0x52fdda[_0xad2e('0x2d')]){_0x52fdda['dateEnd']=moment(_0x52fdda[_0xad2e('0x2d')])[_0xad2e('0x39')](0x1,_0xad2e('0x3a'));}else{_0x52fdda[_0xad2e('0x2d')]=moment(_0x52fdda[_0xad2e('0x2e')])['add'](0x1,_0xad2e('0x3a'));}_[_0xad2e('0x3b')](_0x2b2bc2['where'],{'createdAt':{'$gte':_0x52fdda['dateStart'],'$lte':_0x52fdda['dateEnd']}});}if(_0x356a19[_0xad2e('0x2c')]['filter']){_0x2b2bc2['where']=_[_0xad2e('0x3b')](_0x2b2bc2[_0xad2e('0x37')],{'$or':_[_0xad2e('0x3c')](_0x2b2bc2[_0xad2e('0x32')],function(_0x6f4fbc){var _0x2aa6ff={};_0x2aa6ff[_0x6f4fbc]={'$like':'%'+_0x356a19[_0xad2e('0x2c')]['filter']+'%'};return _0x2aa6ff;})});}_0x2b2bc2=_[_0xad2e('0x3b')]({},_0x2b2bc2,_0x356a19[_0xad2e('0x3d')]);var _0x46684d={'where':_0x2b2bc2[_0xad2e('0x37')]};return db[_0xad2e('0x28')]['count'](_0x46684d)[_0xad2e('0x22')](function(_0x554ed8){_0x22bc9b[_0xad2e('0x1b')]=_0x554ed8;if(_0x356a19[_0xad2e('0x2c')][_0xad2e('0x3e')]){_0x2b2bc2[_0xad2e('0x3f')]=[{'all':!![]}];}return db[_0xad2e('0x28')][_0xad2e('0x40')](_0x2b2bc2);})[_0xad2e('0x22')](function(_0x27a0d3){_0x22bc9b[_0xad2e('0x41')]=_0x27a0d3;return _0x22bc9b;})[_0xad2e('0x22')](respondWithFilteredResult(_0x5d675f,_0x2b2bc2))[_0xad2e('0x42')](handleError(_0x5d675f,null));};exports[_0xad2e('0x43')]=function(_0x1d18d0,_0x1b78f9){var _0xf7b911={'raw':![],'where':{'id':_0x1d18d0[_0xad2e('0x44')]['id']}},_0x2ad9a0={};_0x2ad9a0[_0xad2e('0x2a')]=_[_0xad2e('0x2b')](db[_0xad2e('0x28')]['rawAttributes']);_0x2ad9a0[_0xad2e('0x2c')]=_[_0xad2e('0x2b')](_0x1d18d0[_0xad2e('0x2c')]);_0x2ad9a0[_0xad2e('0x2f')]=_[_0xad2e('0x30')](_0x2ad9a0[_0xad2e('0x2a')],_0x2ad9a0[_0xad2e('0x2c')]);_0xf7b911['attributes']=_[_0xad2e('0x30')](_0x2ad9a0['model'],qs[_0xad2e('0x31')](_0x1d18d0[_0xad2e('0x2c')][_0xad2e('0x31')]));_0xf7b911[_0xad2e('0x32')]=_0xf7b911[_0xad2e('0x32')]['length']?_0xf7b911[_0xad2e('0x32')]:_0x2ad9a0[_0xad2e('0x2a')];if(_0x1d18d0[_0xad2e('0x2c')][_0xad2e('0x3e')]){_0xf7b911[_0xad2e('0x3f')]=[{'all':!![]}];}_0xf7b911=_['merge']({},_0xf7b911,_0x1d18d0[_0xad2e('0x3d')]);return db[_0xad2e('0x28')][_0xad2e('0x45')](_0xf7b911)[_0xad2e('0x22')](handleEntityNotFound(_0x1b78f9,null))['then'](respondWithResult(_0x1b78f9,null))['catch'](handleError(_0x1b78f9,null));};exports[_0xad2e('0x46')]=function(_0x343e4f,_0x4d2c66){return db['Dashboard'][_0xad2e('0x46')](_0x343e4f['body'],{})[_0xad2e('0x22')](respondWithResult(_0x4d2c66,0xc9))[_0xad2e('0x42')](handleError(_0x4d2c66,null));};exports['clone']=function(_0x2f4799,_0x2471d0){var _0x275689={'raw':![],'where':{'id':_0x2f4799['params']['id']}},_0x38ff4f={};_0x38ff4f['model']=_[_0xad2e('0x2b')](db[_0xad2e('0x28')][_0xad2e('0x29')]);_0x275689[_0xad2e('0x32')]=_[_0xad2e('0x30')](_0x38ff4f[_0xad2e('0x2a')],qs[_0xad2e('0x31')](_0x2f4799[_0xad2e('0x2c')]['fields']));_0x275689[_0xad2e('0x32')]=_0x275689['attributes'][_0xad2e('0x33')]?_0x275689[_0xad2e('0x32')]:_0x38ff4f[_0xad2e('0x2a')];if(_0x2f4799[_0xad2e('0x2c')][_0xad2e('0x3e')]){_0x275689[_0xad2e('0x3f')]=[{'all':!![]}];}_0x275689=_[_0xad2e('0x3b')]({},_0x275689,_0x2f4799['options']);return db[_0xad2e('0x28')]['find'](_0x275689)[_0xad2e('0x22')](handleEntityNotFound(_0x2471d0,null))[_0xad2e('0x22')](function(_0xbc21e4){if(_0xbc21e4){var _0xf72966=_0xbc21e4['get']({'plain':!![]});_0xf72966=qs[_0xad2e('0x47')](_0xf72966,['id',_0xad2e('0x48'),'updatedAt']);_0x2f4799[_0xad2e('0x49')]=_['omit'](_0x2f4799[_0xad2e('0x49')],['id',_0xad2e('0x48'),_0xad2e('0x4a')]);return db[_0xad2e('0x28')][_0xad2e('0x46')](_[_0xad2e('0x3b')](_0xf72966,_0x2f4799[_0xad2e('0x49')]),{'include':_0x2f4799[_0xad2e('0x2c')][_0xad2e('0x3e')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x2471d0,0xc9))[_0xad2e('0x42')](handleError(_0x2471d0,null));};exports[_0xad2e('0x21')]=function(_0x1bea13,_0x243add){if(_0x1bea13['body']['id']){delete _0x1bea13['body']['id'];}return db[_0xad2e('0x28')][_0xad2e('0x45')]({'where':{'id':_0x1bea13[_0xad2e('0x44')]['id']}})[_0xad2e('0x22')](handleEntityNotFound(_0x243add,null))[_0xad2e('0x22')](saveUpdates(_0x1bea13[_0xad2e('0x49')],null))['then'](respondWithResult(_0x243add,null))[_0xad2e('0x42')](handleError(_0x243add,null));};exports[_0xad2e('0x23')]=function(_0x4dc9a4,_0x45f3e7){return db[_0xad2e('0x28')][_0xad2e('0x45')]({'where':{'id':_0x4dc9a4[_0xad2e('0x44')]['id']}})[_0xad2e('0x22')](handleEntityNotFound(_0x45f3e7,null))[_0xad2e('0x22')](removeEntity(_0x45f3e7,null))[_0xad2e('0x42')](handleError(_0x45f3e7,null));};function widgetAttributes(_0x9a0783){try{switch(_0x9a0783[_0xad2e('0x4b')]){case _0xad2e('0x4c'):return[{'name':'attrUrl','value':_0x9a0783['attrUrl']||(_0x9a0783[_0xad2e('0x4d')]&&_0x9a0783['attrs'][0x0]?_0x9a0783['attrs'][0x0][_0xad2e('0x4e')]:undefined)||_0xad2e('0x4f')}];case _0xad2e('0x50'):return[{'name':'attrPath','value':_0x9a0783[_0xad2e('0x51')]||(_0x9a0783[_0xad2e('0x4d')]&&_0x9a0783[_0xad2e('0x4d')][0x0]?_0x9a0783[_0xad2e('0x4d')][0x0][_0xad2e('0x4e')]:undefined)||''}];case'clock':return[{'name':_0xad2e('0x52'),'value':_0x9a0783['attrHourFormat']||(_0x9a0783['attrs']&&_0x9a0783['attrs'][0x0]?_0x9a0783['attrs'][0x0][_0xad2e('0x4e')]:undefined)||_0xad2e('0x53')},{'name':_0xad2e('0x54'),'value':_0x9a0783[_0xad2e('0x54')]||(_0x9a0783[_0xad2e('0x4d')]&&_0x9a0783[_0xad2e('0x4d')][0x1]?_0x9a0783[_0xad2e('0x4d')][0x1][_0xad2e('0x4e')]:undefined)||_0xad2e('0x55')},{'name':_0xad2e('0x56'),'value':_0x9a0783[_0xad2e('0x56')]||(_0x9a0783['attrs']&&_0x9a0783[_0xad2e('0x4d')][0x2]?_0x9a0783[_0xad2e('0x4d')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0xad2e('0x57'),'value':_0x9a0783['attrMetric']||(_0x9a0783[_0xad2e('0x4d')]&&_0x9a0783[_0xad2e('0x4d')][0x0]?_0x9a0783[_0xad2e('0x4d')][0x0][_0xad2e('0x4e')]:undefined)||_0xad2e('0x58')},{'name':_0xad2e('0x59'),'value':_0x9a0783[_0xad2e('0x59')]||(_0x9a0783[_0xad2e('0x4d')]&&_0x9a0783['attrs'][0x1]?_0x9a0783[_0xad2e('0x4d')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x9a0783[_0xad2e('0x56')]||(_0x9a0783[_0xad2e('0x4d')]&&_0x9a0783['attrs'][0x2]?_0x9a0783[_0xad2e('0x4d')][0x2][_0xad2e('0x4e')]:undefined)||0x14}];case _0xad2e('0x5a'):case'pie-chart':return[{'name':_0xad2e('0x5b'),'value':_0x9a0783['attrSerie1']||(_0x9a0783[_0xad2e('0x4d')]&&_0x9a0783['attrs'][0x0]?_0x9a0783[_0xad2e('0x4d')][0x0][_0xad2e('0x4e')]:undefined)||_0xad2e('0x58')},{'name':_0xad2e('0x5c'),'value':_0x9a0783[_0xad2e('0x5c')]||(_0x9a0783[_0xad2e('0x4d')]&&_0x9a0783['attrs'][0x1]?_0x9a0783['attrs'][0x1][_0xad2e('0x4e')]:undefined)||null},{'name':_0xad2e('0x5d'),'value':_0x9a0783[_0xad2e('0x5d')]||(_0x9a0783[_0xad2e('0x4d')]&&_0x9a0783['attrs'][0x2]?_0x9a0783[_0xad2e('0x4d')][0x2][_0xad2e('0x4e')]:undefined)||null},{'name':_0xad2e('0x59'),'value':_0x9a0783[_0xad2e('0x59')]||(_0x9a0783[_0xad2e('0x4d')]&&_0x9a0783[_0xad2e('0x4d')][0x3]?_0x9a0783[_0xad2e('0x4d')][0x3][_0xad2e('0x4e')]:undefined)||[]}];case _0xad2e('0x5e'):return[{'name':'attrReport','value':_0x9a0783[_0xad2e('0x5f')]||(_0x9a0783[_0xad2e('0x4d')]&&_0x9a0783[_0xad2e('0x4d')][0x0]?_0x9a0783['attrs'][0x0][_0xad2e('0x4e')]:undefined)||null},{'name':_0xad2e('0x60'),'value':_0x9a0783[_0xad2e('0x60')]||(_0x9a0783[_0xad2e('0x4d')]&&_0x9a0783[_0xad2e('0x4d')][0x1]?_0x9a0783[_0xad2e('0x4d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x4989b2){logger['error']('widgetAttributes:\x20%s',JSON[_0xad2e('0x61')](_0x4989b2));return[];}}exports[_0xad2e('0x62')]=function(_0x5a82e6,_0xe18c7f,_0x3fa812){if(_0x5a82e6[_0xad2e('0x49')]['id']){delete _0x5a82e6[_0xad2e('0x49')]['id'];}return db[_0xad2e('0x28')][_0xad2e('0x45')]({'where':{'id':_0x5a82e6[_0xad2e('0x44')]['id']}})[_0xad2e('0x22')](handleEntityNotFound(_0xe18c7f,null))['then'](function(_0x4bcee1){if(_0x4bcee1){_0x5a82e6['body']['DashboardId']=_0x4bcee1['id'];_0x5a82e6['body'][_0xad2e('0x4d')]=widgetAttributes(_0x5a82e6['body']);return db[_0xad2e('0x63')][_0xad2e('0x46')](_0x5a82e6[_0xad2e('0x49')]);}})['then'](respondWithResult(_0xe18c7f,null))['catch'](handleError(_0xe18c7f,null));};exports[_0xad2e('0x64')]=function(_0x5620e0,_0x48725f,_0x779a72){var _0xc1ef25={};var _0x35fce1={};var _0x3e4eb9;var _0x21a69a;return db[_0xad2e('0x28')][_0xad2e('0x65')]({'where':{'id':_0x5620e0[_0xad2e('0x44')]['id']}})[_0xad2e('0x22')](handleEntityNotFound(_0x48725f,null))[_0xad2e('0x22')](function(_0x54cbf2){if(_0x54cbf2){_0x3e4eb9=_0x54cbf2;_0x35fce1['model']=_[_0xad2e('0x2b')](db[_0xad2e('0x63')]['rawAttributes']);_0x35fce1[_0xad2e('0x2c')]=_[_0xad2e('0x2b')](_0x5620e0['query']);_0x35fce1['filters']=_[_0xad2e('0x30')](_0x35fce1[_0xad2e('0x2a')],_0x35fce1[_0xad2e('0x2c')]);_0xc1ef25[_0xad2e('0x32')]=_[_0xad2e('0x30')](_0x35fce1['model'],qs[_0xad2e('0x31')](_0x5620e0['query'][_0xad2e('0x31')]));_0xc1ef25[_0xad2e('0x32')]=_0xc1ef25['attributes'][_0xad2e('0x33')]?_0xc1ef25[_0xad2e('0x32')]:_0x35fce1[_0xad2e('0x2a')];_0xc1ef25['order']=qs[_0xad2e('0x36')](_0x5620e0[_0xad2e('0x2c')][_0xad2e('0x36')]);_0xc1ef25[_0xad2e('0x37')]=qs[_0xad2e('0x2f')](_['pick'](_0x5620e0[_0xad2e('0x2c')],_0x35fce1['filters']));if(_0x5620e0[_0xad2e('0x2c')][_0xad2e('0x66')]){_0xc1ef25[_0xad2e('0x37')]=_[_0xad2e('0x3b')](_0xc1ef25[_0xad2e('0x37')],{'$or':_[_0xad2e('0x3c')](_0xc1ef25[_0xad2e('0x32')],function(_0xd342e4){var _0x3745dc={};_0x3745dc[_0xd342e4]={'$like':'%'+_0x5620e0[_0xad2e('0x2c')][_0xad2e('0x66')]+'%'};return _0x3745dc;})});}_0xc1ef25=_[_0xad2e('0x3b')]({},_0xc1ef25,_0x5620e0[_0xad2e('0x3d')]);return _0x3e4eb9[_0xad2e('0x64')](_0xc1ef25);}})[_0xad2e('0x22')](function(_0x14b701){if(_0x14b701){_0x21a69a=_0x14b701[_0xad2e('0x33')];if(!_0x5620e0['query'][_0xad2e('0x67')](_0xad2e('0x34'))){_0xc1ef25[_0xad2e('0x1d')]=qs[_0xad2e('0x1d')](_0x5620e0['query'][_0xad2e('0x1d')]);_0xc1ef25[_0xad2e('0x1c')]=qs[_0xad2e('0x1c')](_0x5620e0['query'][_0xad2e('0x1c')]);}return _0x3e4eb9[_0xad2e('0x64')](_0xc1ef25);}})[_0xad2e('0x22')](function(_0x312929){if(_0x312929){return _0x312929?{'count':_0x21a69a,'rows':_0x312929}:null;}})['then'](respondWithResult(_0x48725f,null))[_0xad2e('0x42')](handleError(_0x48725f,null));};
\ No newline at end of file
+var _0xe3ee=['stack','name','send','index','model','keys','query','dateStart','dateEnd','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','sort','where','pick','add','day','merge','filter','map','options','Dashboard','count','includeAll','findAll','rows','catch','show','rawAttributes','include','create','body','clone','find','get','omit','createdAt','updatedAt','params','type','iframe','attrUrl','attrs','https://','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrSerie1','total','attrSerie2','attrSerie3','attrReport','attrRefresh','stringify','addItem','getItems','findOne','order','rimraf','zip-dir','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./dashboard.socket','register','status','end','set','Content-Range','json','apply','reject','save','update','then','destroy','error'];(function(_0x542ff5,_0x4833a5){var _0x1170b5=function(_0x57e019){while(--_0x57e019){_0x542ff5['push'](_0x542ff5['shift']());}};_0x1170b5(++_0x4833a5);}(_0xe3ee,0x116));var _0xee3e=function(_0x55f442,_0x4933ac){_0x55f442=_0x55f442-0x0;var _0x5a485c=_0xe3ee[_0x55f442];return _0x5a485c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xee3e('0x0'));var zipdir=require(_0xee3e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xee3e('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xee3e('0x3'));var path=require('path');var sox=require(_0xee3e('0x4'));var csv=require(_0xee3e('0x5'));var ejs=require(_0xee3e('0x6'));var fs=require('fs');var _=require(_0xee3e('0x7'));var squel=require(_0xee3e('0x8'));var crypto=require(_0xee3e('0x9'));var jsforce=require(_0xee3e('0xa'));var deskjs=require(_0xee3e('0xb'));var toCsv=require('to-csv');var querystring=require(_0xee3e('0xc'));var Papa=require(_0xee3e('0xd'));var qs=require('../../components/parsers/qs');var logger=require(_0xee3e('0xe'))(_0xee3e('0xf'));var utils=require('../../config/utils');var config=require(_0xee3e('0x10'));var db=require(_0xee3e('0x11'))['db'];var socket=require(_0xee3e('0x12'))({'host':_0xee3e('0x13'),'port':0x18eb});require(_0xee3e('0x14'))[_0xee3e('0x15')](socket);function respondWithStatusCode(_0x23e275,_0x239052){_0x239052=_0x239052||0xcc;return function(_0x48506e){if(_0x48506e){return _0x23e275['sendStatus'](_0x239052);}return _0x23e275[_0xee3e('0x16')](_0x239052)[_0xee3e('0x17')]();};}function respondWithResult(_0x529b39,_0x209595){_0x209595=_0x209595||0xc8;return function(_0x1c0eb0){if(_0x1c0eb0){return _0x529b39[_0xee3e('0x16')](_0x209595)['json'](_0x1c0eb0);}};}function respondWithFilteredResult(_0x1af079,_0x4743d3){return function(_0x502f47){if(_0x502f47){var _0x51e498=_0x502f47['count'],_0x370f32=_0x4743d3['offset'],_0x450c5b=_0x4743d3['offset']+_0x4743d3['limit'],_0x266449;if(_0x450c5b>=_0x51e498){_0x450c5b=_0x51e498;_0x266449=0xc8;}else{_0x266449=0xce;}_0x1af079[_0xee3e('0x16')](_0x266449);return _0x1af079[_0xee3e('0x18')](_0xee3e('0x19'),_0x370f32+'-'+_0x450c5b+'/'+_0x51e498)[_0xee3e('0x1a')](_0x502f47);}return null;};}function patchUpdates(_0x1b80ae){return function(_0x4b1d63){try{jsonpatch[_0xee3e('0x1b')](_0x4b1d63,_0x1b80ae,!![]);}catch(_0x947aaa){return BPromise[_0xee3e('0x1c')](_0x947aaa);}return _0x4b1d63[_0xee3e('0x1d')]();};}function saveUpdates(_0x39a262,_0x3b6d40){return function(_0x5528f9){if(_0x5528f9){return _0x5528f9[_0xee3e('0x1e')](_0x39a262)[_0xee3e('0x1f')](function(_0x1c55f3){return _0x1c55f3;});}return null;};}function removeEntity(_0x30f0e3,_0x236de7){return function(_0xfbf279){if(_0xfbf279){return _0xfbf279[_0xee3e('0x20')]()[_0xee3e('0x1f')](function(){_0x30f0e3[_0xee3e('0x16')](0xcc)[_0xee3e('0x17')]();});}};}function handleEntityNotFound(_0x57e933,_0x5e4100){return function(_0x4b0d94){if(!_0x4b0d94){_0x57e933['sendStatus'](0x194);}return _0x4b0d94;};}function handleError(_0x24891a,_0xc1a5af){_0xc1a5af=_0xc1a5af||0x1f4;return function(_0x48555e){logger[_0xee3e('0x21')](_0x48555e[_0xee3e('0x22')]);if(_0x48555e[_0xee3e('0x23')]){delete _0x48555e['name'];}_0x24891a[_0xee3e('0x16')](_0xc1a5af)[_0xee3e('0x24')](_0x48555e);};}exports[_0xee3e('0x25')]=function(_0x2ff0d1,_0x5ec872){var _0x59baf3={},_0x1c687c={},_0x3b6c7e={'count':0x0,'rows':[]};var _0x300b39=db['Dashboard']['rawAttributes'];_0x1c687c[_0xee3e('0x26')]=_[_0xee3e('0x27')](_0x300b39);var _0x179406={'dateStart':_0x2ff0d1[_0xee3e('0x28')][_0xee3e('0x29')],'dateEnd':_0x2ff0d1[_0xee3e('0x28')][_0xee3e('0x2a')]};delete _0x2ff0d1['query']['dateStart'];delete _0x2ff0d1[_0xee3e('0x28')][_0xee3e('0x2a')];_0x1c687c['query']=_[_0xee3e('0x27')](_0x2ff0d1['query']);_0x1c687c[_0xee3e('0x2b')]=_[_0xee3e('0x2c')](_0x1c687c[_0xee3e('0x26')],_0x1c687c[_0xee3e('0x28')]);_0x59baf3['attributes']=_[_0xee3e('0x2c')](_0x1c687c[_0xee3e('0x26')],qs[_0xee3e('0x2d')](_0x2ff0d1[_0xee3e('0x28')][_0xee3e('0x2d')]));_0x59baf3[_0xee3e('0x2e')]=_0x59baf3[_0xee3e('0x2e')][_0xee3e('0x2f')]?_0x59baf3[_0xee3e('0x2e')]:_0x1c687c['model'];if(!_0x2ff0d1[_0xee3e('0x28')][_0xee3e('0x30')](_0xee3e('0x31'))){_0x59baf3[_0xee3e('0x32')]=qs[_0xee3e('0x32')](_0x2ff0d1[_0xee3e('0x28')][_0xee3e('0x32')]);_0x59baf3[_0xee3e('0x33')]=qs[_0xee3e('0x33')](_0x2ff0d1[_0xee3e('0x28')][_0xee3e('0x33')]);}_0x59baf3['order']=qs[_0xee3e('0x34')](_0x2ff0d1[_0xee3e('0x28')]['sort']);_0x59baf3[_0xee3e('0x35')]=qs[_0xee3e('0x2b')](_[_0xee3e('0x36')](_0x2ff0d1[_0xee3e('0x28')],_0x1c687c['filters']));if(_0x179406[_0xee3e('0x29')]){if(_0x179406[_0xee3e('0x2a')]){_0x179406[_0xee3e('0x2a')]=moment(_0x179406[_0xee3e('0x2a')])[_0xee3e('0x37')](0x1,_0xee3e('0x38'));}else{_0x179406['dateEnd']=moment(_0x179406[_0xee3e('0x29')])['add'](0x1,_0xee3e('0x38'));}_[_0xee3e('0x39')](_0x59baf3['where'],{'createdAt':{'$gte':_0x179406['dateStart'],'$lte':_0x179406[_0xee3e('0x2a')]}});}if(_0x2ff0d1[_0xee3e('0x28')][_0xee3e('0x3a')]){_0x59baf3['where']=_[_0xee3e('0x39')](_0x59baf3['where'],{'$or':_[_0xee3e('0x3b')](_0x59baf3[_0xee3e('0x2e')],function(_0x553377){var _0x2f0324={};_0x2f0324[_0x553377]={'$like':'%'+_0x2ff0d1[_0xee3e('0x28')][_0xee3e('0x3a')]+'%'};return _0x2f0324;})});}_0x59baf3=_['merge']({},_0x59baf3,_0x2ff0d1[_0xee3e('0x3c')]);var _0x3a1f91={'where':_0x59baf3['where']};return db[_0xee3e('0x3d')][_0xee3e('0x3e')](_0x3a1f91)[_0xee3e('0x1f')](function(_0x11c10a){_0x3b6c7e[_0xee3e('0x3e')]=_0x11c10a;if(_0x2ff0d1[_0xee3e('0x28')][_0xee3e('0x3f')]){_0x59baf3['include']=[{'all':!![]}];}return db[_0xee3e('0x3d')][_0xee3e('0x40')](_0x59baf3);})[_0xee3e('0x1f')](function(_0x4ffd0c){_0x3b6c7e[_0xee3e('0x41')]=_0x4ffd0c;return _0x3b6c7e;})[_0xee3e('0x1f')](respondWithFilteredResult(_0x5ec872,_0x59baf3))[_0xee3e('0x42')](handleError(_0x5ec872,null));};exports[_0xee3e('0x43')]=function(_0x25a322,_0xad61fe){var _0x5c14ec={'raw':![],'where':{'id':_0x25a322['params']['id']}},_0x25bec7={};_0x25bec7[_0xee3e('0x26')]=_[_0xee3e('0x27')](db[_0xee3e('0x3d')][_0xee3e('0x44')]);_0x25bec7[_0xee3e('0x28')]=_['keys'](_0x25a322['query']);_0x25bec7['filters']=_[_0xee3e('0x2c')](_0x25bec7[_0xee3e('0x26')],_0x25bec7[_0xee3e('0x28')]);_0x5c14ec[_0xee3e('0x2e')]=_['intersection'](_0x25bec7[_0xee3e('0x26')],qs['fields'](_0x25a322[_0xee3e('0x28')][_0xee3e('0x2d')]));_0x5c14ec[_0xee3e('0x2e')]=_0x5c14ec[_0xee3e('0x2e')][_0xee3e('0x2f')]?_0x5c14ec[_0xee3e('0x2e')]:_0x25bec7[_0xee3e('0x26')];if(_0x25a322['query'][_0xee3e('0x3f')]){_0x5c14ec[_0xee3e('0x45')]=[{'all':!![]}];}_0x5c14ec=_['merge']({},_0x5c14ec,_0x25a322['options']);return db['Dashboard']['find'](_0x5c14ec)[_0xee3e('0x1f')](handleEntityNotFound(_0xad61fe,null))['then'](respondWithResult(_0xad61fe,null))['catch'](handleError(_0xad61fe,null));};exports[_0xee3e('0x46')]=function(_0x193ca3,_0x44e7b1){return db[_0xee3e('0x3d')][_0xee3e('0x46')](_0x193ca3[_0xee3e('0x47')],{})['then'](respondWithResult(_0x44e7b1,0xc9))[_0xee3e('0x42')](handleError(_0x44e7b1,null));};exports[_0xee3e('0x48')]=function(_0x3473a3,_0x1c1435){var _0x34fc76={'raw':![],'where':{'id':_0x3473a3['params']['id']}},_0x5d3229={};_0x5d3229[_0xee3e('0x26')]=_[_0xee3e('0x27')](db[_0xee3e('0x3d')][_0xee3e('0x44')]);_0x34fc76[_0xee3e('0x2e')]=_[_0xee3e('0x2c')](_0x5d3229[_0xee3e('0x26')],qs[_0xee3e('0x2d')](_0x3473a3[_0xee3e('0x28')][_0xee3e('0x2d')]));_0x34fc76[_0xee3e('0x2e')]=_0x34fc76['attributes'][_0xee3e('0x2f')]?_0x34fc76[_0xee3e('0x2e')]:_0x5d3229[_0xee3e('0x26')];if(_0x3473a3['query'][_0xee3e('0x3f')]){_0x34fc76[_0xee3e('0x45')]=[{'all':!![]}];}_0x34fc76=_[_0xee3e('0x39')]({},_0x34fc76,_0x3473a3[_0xee3e('0x3c')]);return db[_0xee3e('0x3d')][_0xee3e('0x49')](_0x34fc76)[_0xee3e('0x1f')](handleEntityNotFound(_0x1c1435,null))[_0xee3e('0x1f')](function(_0x195725){if(_0x195725){var _0x37083c=_0x195725[_0xee3e('0x4a')]({'plain':!![]});_0x37083c=qs[_0xee3e('0x4b')](_0x37083c,['id',_0xee3e('0x4c'),_0xee3e('0x4d')]);_0x3473a3['body']=_['omit'](_0x3473a3['body'],['id',_0xee3e('0x4c'),_0xee3e('0x4d')]);return db['Dashboard']['create'](_[_0xee3e('0x39')](_0x37083c,_0x3473a3['body']),{'include':_0x3473a3[_0xee3e('0x28')][_0xee3e('0x3f')]?[{'all':!![]}]:undefined});}})[_0xee3e('0x1f')](respondWithResult(_0x1c1435,0xc9))['catch'](handleError(_0x1c1435,null));};exports[_0xee3e('0x1e')]=function(_0x397089,_0x30bac7){if(_0x397089['body']['id']){delete _0x397089['body']['id'];}return db[_0xee3e('0x3d')][_0xee3e('0x49')]({'where':{'id':_0x397089[_0xee3e('0x4e')]['id']}})[_0xee3e('0x1f')](handleEntityNotFound(_0x30bac7,null))[_0xee3e('0x1f')](saveUpdates(_0x397089[_0xee3e('0x47')],null))['then'](respondWithResult(_0x30bac7,null))['catch'](handleError(_0x30bac7,null));};exports[_0xee3e('0x20')]=function(_0x54b834,_0xfb06e1){return db['Dashboard']['find']({'where':{'id':_0x54b834[_0xee3e('0x4e')]['id']}})['then'](handleEntityNotFound(_0xfb06e1,null))['then'](removeEntity(_0xfb06e1,null))['catch'](handleError(_0xfb06e1,null));};function widgetAttributes(_0x209798){try{switch(_0x209798[_0xee3e('0x4f')]){case _0xee3e('0x50'):return[{'name':_0xee3e('0x51'),'value':_0x209798[_0xee3e('0x51')]||(_0x209798[_0xee3e('0x52')]&&_0x209798['attrs'][0x0]?_0x209798[_0xee3e('0x52')][0x0]['value']:undefined)||_0xee3e('0x53')}];case'custom':return[{'name':'attrPath','value':_0x209798['attrPath']||(_0x209798[_0xee3e('0x52')]&&_0x209798[_0xee3e('0x52')][0x0]?_0x209798[_0xee3e('0x52')][0x0][_0xee3e('0x54')]:undefined)||''}];case'clock':return[{'name':_0xee3e('0x55'),'value':_0x209798['attrHourFormat']||(_0x209798[_0xee3e('0x52')]&&_0x209798[_0xee3e('0x52')][0x0]?_0x209798['attrs'][0x0]['value']:undefined)||_0xee3e('0x56')},{'name':_0xee3e('0x57'),'value':_0x209798['attrTimezone']||(_0x209798[_0xee3e('0x52')]&&_0x209798[_0xee3e('0x52')][0x1]?_0x209798[_0xee3e('0x52')][0x1][_0xee3e('0x54')]:undefined)||_0xee3e('0x58')},{'name':'attrFontSize','value':_0x209798[_0xee3e('0x59')]||(_0x209798[_0xee3e('0x52')]&&_0x209798[_0xee3e('0x52')][0x2]?_0x209798['attrs'][0x2][_0xee3e('0x54')]:undefined)||0xc}];case _0xee3e('0x5a'):return[{'name':_0xee3e('0x5b'),'value':_0x209798[_0xee3e('0x5b')]||(_0x209798[_0xee3e('0x52')]&&_0x209798[_0xee3e('0x52')][0x0]?_0x209798[_0xee3e('0x52')][0x0][_0xee3e('0x54')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x209798[_0xee3e('0x5c')]||(_0x209798[_0xee3e('0x52')]&&_0x209798[_0xee3e('0x52')][0x1]?_0x209798[_0xee3e('0x52')][0x1][_0xee3e('0x54')]:undefined)||[]},{'name':_0xee3e('0x59'),'value':_0x209798[_0xee3e('0x59')]||(_0x209798[_0xee3e('0x52')]&&_0x209798[_0xee3e('0x52')][0x2]?_0x209798[_0xee3e('0x52')][0x2]['value']:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':_0xee3e('0x5d'),'value':_0x209798[_0xee3e('0x5d')]||(_0x209798[_0xee3e('0x52')]&&_0x209798['attrs'][0x0]?_0x209798[_0xee3e('0x52')][0x0]['value']:undefined)||_0xee3e('0x5e')},{'name':'attrSerie2','value':_0x209798[_0xee3e('0x5f')]||(_0x209798[_0xee3e('0x52')]&&_0x209798[_0xee3e('0x52')][0x1]?_0x209798[_0xee3e('0x52')][0x1][_0xee3e('0x54')]:undefined)||null},{'name':_0xee3e('0x60'),'value':_0x209798[_0xee3e('0x60')]||(_0x209798[_0xee3e('0x52')]&&_0x209798[_0xee3e('0x52')][0x2]?_0x209798[_0xee3e('0x52')][0x2][_0xee3e('0x54')]:undefined)||null},{'name':_0xee3e('0x5c'),'value':_0x209798['attrVoiceQueues']||(_0x209798[_0xee3e('0x52')]&&_0x209798[_0xee3e('0x52')][0x3]?_0x209798[_0xee3e('0x52')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':'attrReport','value':_0x209798[_0xee3e('0x61')]||(_0x209798[_0xee3e('0x52')]&&_0x209798['attrs'][0x0]?_0x209798[_0xee3e('0x52')][0x0]['value']:undefined)||null},{'name':_0xee3e('0x62'),'value':_0x209798[_0xee3e('0x62')]||(_0x209798[_0xee3e('0x52')]&&_0x209798[_0xee3e('0x52')][0x1]?_0x209798['attrs'][0x1][_0xee3e('0x54')]:undefined)||0x0}];default:return[];}}catch(_0x44195f){logger['error']('widgetAttributes:\x20%s',JSON[_0xee3e('0x63')](_0x44195f));return[];}}exports[_0xee3e('0x64')]=function(_0x2fe191,_0x3d48ee,_0x2db553){if(_0x2fe191['body']['id']){delete _0x2fe191['body']['id'];}return db[_0xee3e('0x3d')]['find']({'where':{'id':_0x2fe191[_0xee3e('0x4e')]['id']}})[_0xee3e('0x1f')](handleEntityNotFound(_0x3d48ee,null))['then'](function(_0x468336){if(_0x468336){_0x2fe191['body']['DashboardId']=_0x468336['id'];_0x2fe191[_0xee3e('0x47')][_0xee3e('0x52')]=widgetAttributes(_0x2fe191[_0xee3e('0x47')]);return db['DashboardItem'][_0xee3e('0x46')](_0x2fe191[_0xee3e('0x47')]);}})['then'](respondWithResult(_0x3d48ee,null))[_0xee3e('0x42')](handleError(_0x3d48ee,null));};exports[_0xee3e('0x65')]=function(_0x4d14d5,_0x4aea05,_0x33f5b2){var _0x43e665={};var _0x1ac459={};var _0x458733;var _0x157f6c;return db['Dashboard'][_0xee3e('0x66')]({'where':{'id':_0x4d14d5[_0xee3e('0x4e')]['id']}})[_0xee3e('0x1f')](handleEntityNotFound(_0x4aea05,null))[_0xee3e('0x1f')](function(_0xda7a2){if(_0xda7a2){_0x458733=_0xda7a2;_0x1ac459['model']=_[_0xee3e('0x27')](db['DashboardItem'][_0xee3e('0x44')]);_0x1ac459[_0xee3e('0x28')]=_[_0xee3e('0x27')](_0x4d14d5['query']);_0x1ac459[_0xee3e('0x2b')]=_[_0xee3e('0x2c')](_0x1ac459[_0xee3e('0x26')],_0x1ac459[_0xee3e('0x28')]);_0x43e665[_0xee3e('0x2e')]=_[_0xee3e('0x2c')](_0x1ac459[_0xee3e('0x26')],qs[_0xee3e('0x2d')](_0x4d14d5[_0xee3e('0x28')][_0xee3e('0x2d')]));_0x43e665['attributes']=_0x43e665[_0xee3e('0x2e')][_0xee3e('0x2f')]?_0x43e665[_0xee3e('0x2e')]:_0x1ac459['model'];_0x43e665[_0xee3e('0x67')]=qs[_0xee3e('0x34')](_0x4d14d5[_0xee3e('0x28')][_0xee3e('0x34')]);_0x43e665[_0xee3e('0x35')]=qs[_0xee3e('0x2b')](_[_0xee3e('0x36')](_0x4d14d5[_0xee3e('0x28')],_0x1ac459[_0xee3e('0x2b')]));if(_0x4d14d5[_0xee3e('0x28')][_0xee3e('0x3a')]){_0x43e665[_0xee3e('0x35')]=_[_0xee3e('0x39')](_0x43e665[_0xee3e('0x35')],{'$or':_[_0xee3e('0x3b')](_0x43e665[_0xee3e('0x2e')],function(_0x2048c8){var _0x3a2103={};_0x3a2103[_0x2048c8]={'$like':'%'+_0x4d14d5[_0xee3e('0x28')][_0xee3e('0x3a')]+'%'};return _0x3a2103;})});}_0x43e665=_[_0xee3e('0x39')]({},_0x43e665,_0x4d14d5['options']);return _0x458733[_0xee3e('0x65')](_0x43e665);}})[_0xee3e('0x1f')](function(_0x4c60fe){if(_0x4c60fe){_0x157f6c=_0x4c60fe['length'];if(!_0x4d14d5[_0xee3e('0x28')]['hasOwnProperty']('nolimit')){_0x43e665['limit']=qs[_0xee3e('0x32')](_0x4d14d5[_0xee3e('0x28')][_0xee3e('0x32')]);_0x43e665[_0xee3e('0x33')]=qs[_0xee3e('0x33')](_0x4d14d5[_0xee3e('0x28')][_0xee3e('0x33')]);}return _0x458733[_0xee3e('0x65')](_0x43e665);}})[_0xee3e('0x1f')](function(_0x1914ff){if(_0x1914ff){return _0x1914ff?{'count':_0x157f6c,'rows':_0x1914ff}:null;}})['then'](respondWithResult(_0x4aea05,null))[_0xee3e('0x42')](handleError(_0x4aea05,null));};
\ No newline at end of file
index 7e7555c..c16fd09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32a9=['hasOwnProperty','hook','events','../../mysqldb','Dashboard','setMaxListeners','save','update','emit'];(function(_0x22b9b9,_0x4987b6){var _0x30adb8=function(_0x2d6eef){while(--_0x2d6eef){_0x22b9b9['push'](_0x22b9b9['shift']());}};_0x30adb8(++_0x4987b6);}(_0x32a9,0xe3));var _0x932a=function(_0x556634,_0x520958){_0x556634=_0x556634-0x0;var _0x4429fd=_0x32a9[_0x556634];return _0x4429fd;};'use strict';var EventEmitter=require(_0x932a('0x0'));var Dashboard=require(_0x932a('0x1'))['db'][_0x932a('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x932a('0x3')](0x0);var events={'afterCreate':_0x932a('0x4'),'afterUpdate':_0x932a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x174fd6){return function(_0x539b20,_0x4f3ca1,_0x2f1cda){DashboardEvents[_0x932a('0x6')](_0x174fd6+':'+_0x539b20['id'],_0x539b20);DashboardEvents[_0x932a('0x6')](_0x174fd6,_0x539b20);_0x2f1cda(null);};}for(var e in events){if(events[_0x932a('0x7')](e)){var event=events[e];Dashboard[_0x932a('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents;
\ No newline at end of file
+var _0xb977=['setMaxListeners','save','update','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x93b0eb,_0x766cce){var _0x1c01b2=function(_0x495d50){while(--_0x495d50){_0x93b0eb['push'](_0x93b0eb['shift']());}};_0x1c01b2(++_0x766cce);}(_0xb977,0xd7));var _0x7b97=function(_0x16f228,_0x175c87){_0x16f228=_0x16f228-0x0;var _0x352517=_0xb977[_0x16f228];return _0x352517;};'use strict';var EventEmitter=require(_0x7b97('0x0'));var Dashboard=require(_0x7b97('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x7b97('0x2')](0x0);var events={'afterCreate':_0x7b97('0x3'),'afterUpdate':_0x7b97('0x4'),'afterDestroy':'remove'};function emitEvent(_0x325ced){return function(_0x350d37,_0x1de172,_0x206e2c){DashboardEvents[_0x7b97('0x5')](_0x325ced+':'+_0x350d37['id'],_0x350d37);DashboardEvents[_0x7b97('0x5')](_0x325ced,_0x350d37);_0x206e2c(null);};}for(var e in events){if(events[_0x7b97('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents;
\ No newline at end of file
index 3fc6772..bd4b483 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89fb=['api','moment','bluebird','./dashboard.attributes','exports','define','dashboards','util','../../config/logger'];(function(_0x17be0b,_0x50c9f9){var _0x3e4c01=function(_0x11fd77){while(--_0x11fd77){_0x17be0b['push'](_0x17be0b['shift']());}};_0x3e4c01(++_0x50c9f9);}(_0x89fb,0x14b));var _0xb89f=function(_0x2f03a9,_0x4c4865){_0x2f03a9=_0x2f03a9-0x0;var _0x133f17=_0x89fb[_0x2f03a9];return _0x133f17;};'use strict';var _=require('lodash');var util=require(_0xb89f('0x0'));var logger=require(_0xb89f('0x1'))(_0xb89f('0x2'));var moment=require(_0xb89f('0x3'));var BPromise=require(_0xb89f('0x4'));var rp=require('request-promise');var attributes=require(_0xb89f('0x5'));module[_0xb89f('0x6')]=function(_0x3d0629,_0x34c4ce){return _0x3d0629[_0xb89f('0x7')]('Dashboard',attributes,{'tableName':_0xb89f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8ba6=['./dashboard.attributes','define','Dashboard','dashboards','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x2c5823,_0x48fee0){var _0x50b9eb=function(_0x290769){while(--_0x290769){_0x2c5823['push'](_0x2c5823['shift']());}};_0x50b9eb(++_0x48fee0);}(_0x8ba6,0x11b));var _0x68ba=function(_0x234de9,_0x2c3244){_0x234de9=_0x234de9-0x0;var _0x1bcad0=_0x8ba6[_0x234de9];return _0x1bcad0;};'use strict';var _=require(_0x68ba('0x0'));var util=require('util');var logger=require(_0x68ba('0x1'))('api');var moment=require(_0x68ba('0x2'));var BPromise=require(_0x68ba('0x3'));var rp=require(_0x68ba('0x4'));var attributes=require(_0x68ba('0x5'));module['exports']=function(_0x4a5138,_0x77a639){return _0x4a5138[_0x68ba('0x6')](_0x68ba('0x7'),attributes,{'tableName':_0x68ba('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1b7f244..a1b2cee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ad8=['register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter','./dashboard.socket'];(function(_0x44d869,_0x49425f){var _0x1ed521=function(_0x2c2968){while(--_0x2c2968){_0x44d869['push'](_0x44d869['shift']());}};_0x1ed521(++_0x49425f);}(_0x3ad8,0x18d));var _0x83ad=function(_0x48c9b4,_0x5e20e7){_0x48c9b4=_0x48c9b4-0x0;var _0x25f0d6=_0x3ad8[_0x48c9b4];return _0x25f0d6;};'use strict';var _=require('lodash');var util=require(_0x83ad('0x0'));var moment=require(_0x83ad('0x1'));var BPromise=require(_0x83ad('0x2'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x83ad('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x83ad('0x4'));var config=require(_0x83ad('0x5'));var jayson=require(_0x83ad('0x6'));var client=jayson[_0x83ad('0x7')][_0x83ad('0x8')]({'port':0x232a});var socket=require(_0x83ad('0x9'))({'host':'localhost','port':0x18eb});require(_0x83ad('0xa'))[_0x83ad('0xb')](socket);function respondWithRpcPromise(_0x5d0b4b,_0x45b197,_0x4b83fa){return new BPromise(function(_0x269380,_0x36e3d0){return client[_0x83ad('0xc')](_0x5d0b4b,_0x4b83fa)[_0x83ad('0xd')](function(_0x4577c0){logger[_0x83ad('0xe')](_0x83ad('0xf'),_0x45b197,_0x83ad('0x10'));logger[_0x83ad('0x11')](_0x83ad('0x12'),_0x45b197,_0x83ad('0x10'),JSON[_0x83ad('0x13')](_0x4577c0));if(_0x4577c0[_0x83ad('0x14')]){if(_0x4577c0[_0x83ad('0x14')][_0x83ad('0x15')]===0x1f4){logger[_0x83ad('0x14')](_0x83ad('0xf'),_0x45b197,_0x4577c0[_0x83ad('0x14')][_0x83ad('0x16')]);return _0x36e3d0(_0x4577c0[_0x83ad('0x14')]['message']);}logger['error'](_0x83ad('0xf'),_0x45b197,_0x4577c0[_0x83ad('0x14')][_0x83ad('0x16')]);return _0x269380(_0x4577c0[_0x83ad('0x14')][_0x83ad('0x16')]);}else{logger['info'](_0x83ad('0xf'),_0x45b197,_0x83ad('0x10'));_0x269380(_0x4577c0[_0x83ad('0x17')][_0x83ad('0x16')]);}})['catch'](function(_0x1336a6){logger[_0x83ad('0x14')]('Dashboard,\x20%s,\x20%s',_0x45b197,_0x1336a6);_0x36e3d0(_0x1336a6);});});}
\ No newline at end of file
+var _0xf08c=['rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter','localhost','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils'];(function(_0x49e913,_0x586379){var _0x87b5f5=function(_0x38de27){while(--_0x38de27){_0x49e913['push'](_0x49e913['shift']());}};_0x87b5f5(++_0x586379);}(_0xf08c,0xeb));var _0xcf08=function(_0x18c211,_0x1b9096){_0x18c211=_0x18c211-0x0;var _0x50e803=_0xf08c[_0x18c211];return _0x50e803;};'use strict';var _=require(_0xcf08('0x0'));var util=require(_0xcf08('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcf08('0x2'));var fs=require('fs');var db=require(_0xcf08('0x3'))['db'];var utils=require(_0xcf08('0x4'));var logger=require('../../config/logger')(_0xcf08('0x5'));var config=require(_0xcf08('0x6'));var jayson=require(_0xcf08('0x7'));var client=jayson[_0xcf08('0x8')][_0xcf08('0x9')]({'port':0x232a});var socket=require(_0xcf08('0xa'))({'host':_0xcf08('0xb'),'port':0x18eb});require('./dashboard.socket')[_0xcf08('0xc')](socket);function respondWithRpcPromise(_0x266736,_0x45f8f5,_0x227502){return new BPromise(function(_0x850b01,_0x5e7185){return client['request'](_0x266736,_0x227502)[_0xcf08('0xd')](function(_0x389db5){logger[_0xcf08('0xe')](_0xcf08('0xf'),_0x45f8f5,_0xcf08('0x10'));logger[_0xcf08('0x11')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x45f8f5,_0xcf08('0x10'),JSON[_0xcf08('0x12')](_0x389db5));if(_0x389db5[_0xcf08('0x13')]){if(_0x389db5[_0xcf08('0x13')][_0xcf08('0x14')]===0x1f4){logger[_0xcf08('0x13')]('Dashboard,\x20%s,\x20%s',_0x45f8f5,_0x389db5['error']['message']);return _0x5e7185(_0x389db5['error'][_0xcf08('0x15')]);}logger[_0xcf08('0x13')]('Dashboard,\x20%s,\x20%s',_0x45f8f5,_0x389db5['error'][_0xcf08('0x15')]);return _0x850b01(_0x389db5[_0xcf08('0x13')][_0xcf08('0x15')]);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x45f8f5,_0xcf08('0x10'));_0x850b01(_0x389db5[_0xcf08('0x16')][_0xcf08('0x15')]);}})[_0xcf08('0x17')](function(_0x279fbf){logger[_0xcf08('0x13')]('Dashboard,\x20%s,\x20%s',_0x45f8f5,_0x279fbf);_0x5e7185(_0x279fbf);});});}
\ No newline at end of file
index dbe133c..2f93463 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3c7=['length','./dashboard.events','save','remove','emit'];(function(_0x4480b9,_0x5c2949){var _0x3f0f02=function(_0x43502f){while(--_0x43502f){_0x4480b9['push'](_0x4480b9['shift']());}};_0x3f0f02(++_0x5c2949);}(_0xc3c7,0x9c));var _0x7c3c=function(_0x32a6ea,_0x44e86e){_0x32a6ea=_0x32a6ea-0x0;var _0x898353=_0xc3c7[_0x32a6ea];return _0x898353;};'use strict';var DashboardEvents=require(_0x7c3c('0x0'));var events=[_0x7c3c('0x1'),_0x7c3c('0x2'),'update'];function createListener(_0xdb1c2c,_0x5ef350){return function(_0x4130fc){_0x5ef350[_0x7c3c('0x3')](_0xdb1c2c,_0x4130fc);};}function removeListener(_0x24e4f7,_0x46dc81){return function(){DashboardEvents['removeListener'](_0x24e4f7,_0x46dc81);};}exports['register']=function(_0x25dc57){for(var _0xa05541=0x0,_0x14761b=events[_0x7c3c('0x4')];_0xa05541<_0x14761b;_0xa05541++){var _0x3120ec=events[_0xa05541];var _0x13085e=createListener('dashboard:'+_0x3120ec,_0x25dc57);DashboardEvents['on'](_0x3120ec,_0x13085e);}};
\ No newline at end of file
+var _0xd32d=['./dashboard.events','removeListener','register','length','dashboard:'];(function(_0xccfddf,_0x52c486){var _0x4d5fed=function(_0x2d7ef6){while(--_0x2d7ef6){_0xccfddf['push'](_0xccfddf['shift']());}};_0x4d5fed(++_0x52c486);}(_0xd32d,0x1a4));var _0xdd32=function(_0x68dd14,_0xf7049c){_0x68dd14=_0x68dd14-0x0;var _0x43f731=_0xd32d[_0x68dd14];return _0x43f731;};'use strict';var DashboardEvents=require(_0xdd32('0x0'));var events=['save','remove','update'];function createListener(_0x14075c,_0x2c2ccf){return function(_0x407037){_0x2c2ccf['emit'](_0x14075c,_0x407037);};}function removeListener(_0x258846,_0x313688){return function(){DashboardEvents[_0xdd32('0x1')](_0x258846,_0x313688);};}exports[_0xdd32('0x2')]=function(_0x302bf2){for(var _0x28d6c4=0x0,_0x415351=events[_0xdd32('0x3')];_0x28d6c4<_0x415351;_0x28d6c4++){var _0x1e9420=events[_0x28d6c4];var _0x246c6f=createListener(_0xdd32('0x4')+_0x1e9420,_0x302bf2);DashboardEvents['on'](_0x1e9420,_0x246c6f);}};
\ No newline at end of file
index 2c50b96..d05d3e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x349f=['get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','/:id/clone','clone','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x349f,0xa8));var _0xf349=function(_0x5f5a7a,_0x350d85){_0x5f5a7a=_0x5f5a7a-0x0;var _0x1955cf=_0x349f[_0x5f5a7a];return _0x1955cf;};'use strict';var multer=require(_0xf349('0x0'));var util=require(_0xf349('0x1'));var path=require(_0xf349('0x2'));var express=require('express');var router=express[_0xf349('0x3')]();var auth=require(_0xf349('0x4'));var interaction=require(_0xf349('0x5'));var config=require(_0xf349('0x6'));var controller=require(_0xf349('0x7'));router[_0xf349('0x8')]('/',auth[_0xf349('0x9')](),controller[_0xf349('0xa')]);router[_0xf349('0x8')](_0xf349('0xb'),auth['isAuthenticated'](),controller[_0xf349('0xc')]);router[_0xf349('0x8')](_0xf349('0xd'),auth[_0xf349('0x9')](),controller[_0xf349('0xe')]);router[_0xf349('0xf')]('/',auth[_0xf349('0x9')](),controller['create']);router['post'](_0xf349('0x10'),auth[_0xf349('0x9')](),controller[_0xf349('0x11')]);router[_0xf349('0xf')](_0xf349('0xd'),auth['isAuthenticated'](),controller['addItem']);router['put'](_0xf349('0xb'),auth[_0xf349('0x9')](),controller[_0xf349('0x12')]);router[_0xf349('0x13')](_0xf349('0xb'),auth['isAuthenticated'](),controller[_0xf349('0x14')]);module[_0xf349('0x15')]=router;
\ No newline at end of file
+var _0x084b=['/:id','isAuthenticated','show','getItems','post','create','/:id/clone','clone','/:id/items','addItem','put','update','destroy','multer','Router','../../components/auth/service','../../config/environment','./dashboard.controller','get','index'];(function(_0x4a6c61,_0x3a54ae){var _0x116a20=function(_0x3bc4ce){while(--_0x3bc4ce){_0x4a6c61['push'](_0x4a6c61['shift']());}};_0x116a20(++_0x3a54ae);}(_0x084b,0xd5));var _0xb084=function(_0x33067e,_0x3d1056){_0x33067e=_0x33067e-0x0;var _0x121905=_0x084b[_0x33067e];return _0x121905;};'use strict';var multer=require(_0xb084('0x0'));var util=require('util');var path=require('path');var express=require('express');var router=express[_0xb084('0x1')]();var auth=require(_0xb084('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xb084('0x3'));var controller=require(_0xb084('0x4'));router[_0xb084('0x5')]('/',auth['isAuthenticated'](),controller[_0xb084('0x6')]);router['get'](_0xb084('0x7'),auth[_0xb084('0x8')](),controller[_0xb084('0x9')]);router['get']('/:id/items',auth[_0xb084('0x8')](),controller[_0xb084('0xa')]);router[_0xb084('0xb')]('/',auth[_0xb084('0x8')](),controller[_0xb084('0xc')]);router[_0xb084('0xb')](_0xb084('0xd'),auth[_0xb084('0x8')](),controller[_0xb084('0xe')]);router[_0xb084('0xb')](_0xb084('0xf'),auth[_0xb084('0x8')](),controller[_0xb084('0x10')]);router[_0xb084('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb084('0x12')]);router['delete']('/:id',auth[_0xb084('0x8')](),controller[_0xb084('0x13')]);module['exports']=router;
\ No newline at end of file
index 2b3ba0d..3e2f96e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd13=['#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','setDataValue','attrs','stringify','INTEGER'];(function(_0x2903a6,_0xaaf2ce){var _0x331c53=function(_0x5bf08d){while(--_0x5bf08d){_0x2903a6['push'](_0x2903a6['shift']());}};_0x331c53(++_0xaaf2ce);}(_0xdd13,0xe1));var _0x3dd1=function(_0x19cf00,_0x56446b){_0x19cf00=_0x19cf00-0x0;var _0x49bd28=_0xdd13[_0x19cf00];return _0x49bd28;};'use strict';var Sequelize=require(_0x3dd1('0x0'));var squel=require(_0x3dd1('0x1'));var _=require(_0x3dd1('0x2'));module[_0x3dd1('0x3')]={'title':{'type':Sequelize[_0x3dd1('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x3dd1('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x3dd1('0x5')](_0x3dd1('0x6')),'get':function(){try{return JSON[_0x3dd1('0x7')](this[_0x3dd1('0x8')]('attrs'));}catch(_0x44782f){return[];}},'set':function(_0x1a5f1e){try{this[_0x3dd1('0x9')](_0x3dd1('0xa'),JSON[_0x3dd1('0xb')](_0x1a5f1e));}catch(_0x1395d1){this[_0x3dd1('0x9')](_0x3dd1('0xa'),JSON[_0x3dd1('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0x3dd1('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x3dd1('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x3dd1('0xc')]},'col':{'type':Sequelize[_0x3dd1('0xc')]},'background':{'type':Sequelize[_0x3dd1('0x4')],'allowNull':![],'defaultValue':_0x3dd1('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x3dd1('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2a31=['exports','STRING','TEXT','long','parse','attrs','setDataValue','stringify','INTEGER','#2196f3','squel','lodash'];(function(_0xc3c15f,_0x120016){var _0x1bb44d=function(_0x16fc24){while(--_0x16fc24){_0xc3c15f['push'](_0xc3c15f['shift']());}};_0x1bb44d(++_0x120016);}(_0x2a31,0xca));var _0x12a3=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x2a31[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x12a3('0x0'));var _=require(_0x12a3('0x1'));module[_0x12a3('0x2')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x12a3('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x12a3('0x4')](_0x12a3('0x5')),'get':function(){try{return JSON[_0x12a3('0x6')](this['getDataValue'](_0x12a3('0x7')));}catch(_0x5212d8){return[];}},'set':function(_0x5dbd8f){try{this[_0x12a3('0x8')]('attrs',JSON[_0x12a3('0x9')](_0x5dbd8f));}catch(_0x5b6b59){this[_0x12a3('0x8')](_0x12a3('0x7'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x12a3('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x12a3('0xa')]},'background':{'type':Sequelize[_0x12a3('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x12a3('0x3')],'allowNull':![],'defaultValue':_0x12a3('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x12a3('0x3')]}};
\ No newline at end of file
index 232d8c0..3591d2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25d0=['length','includeAll','include','merge','options','destroy','find','params','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./dashboardItem.socket','register','sendStatus','status','end','json','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','show','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields'];(function(_0x4232d8,_0x13fd09){var _0x324de2=function(_0x167ad5){while(--_0x167ad5){_0x4232d8['push'](_0x4232d8['shift']());}};_0x324de2(++_0x13fd09);}(_0x25d0,0x7e));var _0x025d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25d0[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x025d('0x0'));var emlformat=require(_0x025d('0x1'));var rimraf=require(_0x025d('0x2'));var zipdir=require(_0x025d('0x3'));var jsonpatch=require(_0x025d('0x4'));var rp=require('request-promise');var moment=require(_0x025d('0x5'));var BPromise=require(_0x025d('0x6'));var Mustache=require('mustache');var util=require(_0x025d('0x7'));var path=require(_0x025d('0x8'));var sox=require(_0x025d('0x9'));var csv=require(_0x025d('0xa'));var ejs=require(_0x025d('0xb'));var fs=require('fs');var _=require(_0x025d('0xc'));var squel=require(_0x025d('0xd'));var crypto=require(_0x025d('0xe'));var jsforce=require(_0x025d('0xf'));var deskjs=require(_0x025d('0x10'));var toCsv=require(_0x025d('0xa'));var querystring=require(_0x025d('0x11'));var Papa=require(_0x025d('0x12'));var qs=require(_0x025d('0x13'));var logger=require(_0x025d('0x14'))(_0x025d('0x15'));var utils=require(_0x025d('0x16'));var config=require(_0x025d('0x17'));var db=require(_0x025d('0x18'))['db'];var socket=require(_0x025d('0x19'))({'host':_0x025d('0x1a'),'port':0x18eb});require(_0x025d('0x1b'))[_0x025d('0x1c')](socket);function respondWithStatusCode(_0x343beb,_0x528664){_0x528664=_0x528664||0xcc;return function(_0x440eed){if(_0x440eed){return _0x343beb[_0x025d('0x1d')](_0x528664);}return _0x343beb[_0x025d('0x1e')](_0x528664)[_0x025d('0x1f')]();};}function respondWithResult(_0x57a0bc,_0x26a15){_0x26a15=_0x26a15||0xc8;return function(_0xe84c42){if(_0xe84c42){return _0x57a0bc[_0x025d('0x1e')](_0x26a15)[_0x025d('0x20')](_0xe84c42);}};}function respondWithFilteredResult(_0x2aa653,_0x54db7b){return function(_0x5506ee){if(_0x5506ee){var _0x44d761=_0x5506ee['count'],_0x1981dc=_0x54db7b['offset'],_0x24c17c=_0x54db7b['offset']+_0x54db7b[_0x025d('0x21')],_0xd1f98a;if(_0x24c17c>=_0x44d761){_0x24c17c=_0x44d761;_0xd1f98a=0xc8;}else{_0xd1f98a=0xce;}_0x2aa653[_0x025d('0x1e')](_0xd1f98a);return _0x2aa653[_0x025d('0x22')](_0x025d('0x23'),_0x1981dc+'-'+_0x24c17c+'/'+_0x44d761)[_0x025d('0x20')](_0x5506ee);}return null;};}function patchUpdates(_0x119862){return function(_0x41e8ba){try{jsonpatch[_0x025d('0x24')](_0x41e8ba,_0x119862,!![]);}catch(_0x1a00e7){return BPromise['reject'](_0x1a00e7);}return _0x41e8ba[_0x025d('0x25')]();};}function saveUpdates(_0x9d0819,_0x998366){return function(_0x2c3c47){if(_0x2c3c47){return _0x2c3c47[_0x025d('0x26')](_0x9d0819)[_0x025d('0x27')](function(_0x46c4bf){return _0x46c4bf;});}return null;};}function removeEntity(_0x1a904e,_0x3663c7){return function(_0x56864d){if(_0x56864d){return _0x56864d['destroy']()[_0x025d('0x27')](function(){_0x1a904e['status'](0xcc)[_0x025d('0x1f')]();});}};}function handleEntityNotFound(_0x1f8954,_0x1b9589){return function(_0x49716c){if(!_0x49716c){_0x1f8954['sendStatus'](0x194);}return _0x49716c;};}function handleError(_0xb7ced5,_0x3edbf3){_0x3edbf3=_0x3edbf3||0x1f4;return function(_0x313e65){logger[_0x025d('0x28')](_0x313e65[_0x025d('0x29')]);if(_0x313e65['name']){delete _0x313e65[_0x025d('0x2a')];}_0xb7ced5[_0x025d('0x1e')](_0x3edbf3)[_0x025d('0x2b')](_0x313e65);};}exports[_0x025d('0x2c')]=function(_0x504461,_0x3c7d80){var _0x47c7b4={'raw':![],'where':{'id':_0x504461['params']['id']}},_0x14f1f9={};_0x14f1f9[_0x025d('0x2d')]=_[_0x025d('0x2e')](db[_0x025d('0x2f')][_0x025d('0x30')]);_0x14f1f9[_0x025d('0x31')]=_[_0x025d('0x2e')](_0x504461['query']);_0x14f1f9[_0x025d('0x32')]=_[_0x025d('0x33')](_0x14f1f9[_0x025d('0x2d')],_0x14f1f9[_0x025d('0x31')]);_0x47c7b4[_0x025d('0x34')]=_['intersection'](_0x14f1f9[_0x025d('0x2d')],qs[_0x025d('0x35')](_0x504461[_0x025d('0x31')][_0x025d('0x35')]));_0x47c7b4[_0x025d('0x34')]=_0x47c7b4[_0x025d('0x34')][_0x025d('0x36')]?_0x47c7b4[_0x025d('0x34')]:_0x14f1f9['model'];if(_0x504461[_0x025d('0x31')][_0x025d('0x37')]){_0x47c7b4[_0x025d('0x38')]=[{'all':!![]}];}_0x47c7b4=_[_0x025d('0x39')]({},_0x47c7b4,_0x504461[_0x025d('0x3a')]);return db[_0x025d('0x2f')]['find'](_0x47c7b4)['then'](handleEntityNotFound(_0x3c7d80,null))['then'](respondWithResult(_0x3c7d80,null))['catch'](handleError(_0x3c7d80,null));};exports[_0x025d('0x3b')]=function(_0x1b90fc,_0x166bbd){return db['DashboardItem'][_0x025d('0x3c')]({'where':{'id':_0x1b90fc[_0x025d('0x3d')]['id']}})['then'](handleEntityNotFound(_0x166bbd,null))[_0x025d('0x27')](removeEntity(_0x166bbd,null))['catch'](handleError(_0x166bbd,null));};function widgetAttributes(_0x15f481){try{switch(_0x15f481['type']){case _0x025d('0x3e'):return[{'name':'attrUrl','value':_0x15f481[_0x025d('0x3f')]||(_0x15f481['attrs']&&_0x15f481[_0x025d('0x40')][0x0]?_0x15f481[_0x025d('0x40')][0x0][_0x025d('0x41')]:undefined)||_0x025d('0x42')}];case _0x025d('0x43'):return[{'name':_0x025d('0x44'),'value':_0x15f481[_0x025d('0x44')]||(_0x15f481[_0x025d('0x40')]&&_0x15f481[_0x025d('0x40')][0x0]?_0x15f481[_0x025d('0x40')][0x0]['value']:undefined)||''}];case _0x025d('0x45'):return[{'name':_0x025d('0x46'),'value':_0x15f481['attrHourFormat']||(_0x15f481['attrs']&&_0x15f481[_0x025d('0x40')][0x0]?_0x15f481[_0x025d('0x40')][0x0]['value']:undefined)||_0x025d('0x47')},{'name':_0x025d('0x48'),'value':_0x15f481[_0x025d('0x48')]||(_0x15f481[_0x025d('0x40')]&&_0x15f481[_0x025d('0x40')][0x1]?_0x15f481[_0x025d('0x40')][0x1][_0x025d('0x41')]:undefined)||'0.00'},{'name':_0x025d('0x49'),'value':_0x15f481[_0x025d('0x49')]||(_0x15f481[_0x025d('0x40')]&&_0x15f481[_0x025d('0x40')][0x2]?_0x15f481[_0x025d('0x40')][0x2]['value']:undefined)||0xc}];case _0x025d('0x4a'):return[{'name':'attrMetric','value':_0x15f481[_0x025d('0x4b')]||(_0x15f481[_0x025d('0x40')]&&_0x15f481[_0x025d('0x40')][0x0]?_0x15f481['attrs'][0x0]['value']:undefined)||_0x025d('0x4c')},{'name':_0x025d('0x4d'),'value':_0x15f481[_0x025d('0x4d')]||(_0x15f481[_0x025d('0x40')]&&_0x15f481[_0x025d('0x40')][0x1]?_0x15f481[_0x025d('0x40')][0x1][_0x025d('0x41')]:undefined)||[]},{'name':_0x025d('0x49'),'value':_0x15f481[_0x025d('0x49')]||(_0x15f481[_0x025d('0x40')]&&_0x15f481[_0x025d('0x40')][0x2]?_0x15f481[_0x025d('0x40')][0x2]['value']:undefined)||0x14}];case'multibar-chart':case _0x025d('0x4e'):return[{'name':_0x025d('0x4f'),'value':_0x15f481[_0x025d('0x4f')]||(_0x15f481[_0x025d('0x40')]&&_0x15f481['attrs'][0x0]?_0x15f481[_0x025d('0x40')][0x0]['value']:undefined)||_0x025d('0x4c')},{'name':_0x025d('0x50'),'value':_0x15f481[_0x025d('0x50')]||(_0x15f481[_0x025d('0x40')]&&_0x15f481[_0x025d('0x40')][0x1]?_0x15f481[_0x025d('0x40')][0x1][_0x025d('0x41')]:undefined)||null},{'name':_0x025d('0x51'),'value':_0x15f481[_0x025d('0x51')]||(_0x15f481[_0x025d('0x40')]&&_0x15f481[_0x025d('0x40')][0x2]?_0x15f481[_0x025d('0x40')][0x2]['value']:undefined)||null},{'name':_0x025d('0x4d'),'value':_0x15f481[_0x025d('0x4d')]||(_0x15f481[_0x025d('0x40')]&&_0x15f481[_0x025d('0x40')][0x3]?_0x15f481[_0x025d('0x40')][0x3][_0x025d('0x41')]:undefined)||[]}];case _0x025d('0x52'):return[{'name':'attrReport','value':_0x15f481[_0x025d('0x53')]||(_0x15f481['attrs']&&_0x15f481[_0x025d('0x40')][0x0]?_0x15f481[_0x025d('0x40')][0x0][_0x025d('0x41')]:undefined)||null},{'name':_0x025d('0x54'),'value':_0x15f481['attrRefresh']||(_0x15f481[_0x025d('0x40')]&&_0x15f481[_0x025d('0x40')][0x1]?_0x15f481['attrs'][0x1][_0x025d('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x5d5fc3){logger['error'](_0x025d('0x55'),JSON[_0x025d('0x56')](_0x5d5fc3));return[];}}exports[_0x025d('0x57')]=function(_0x5066a6,_0x2eec2c){if(_0x5066a6['body']){_0x5066a6[_0x025d('0x58')][_0x025d('0x40')]=widgetAttributes(_0x5066a6[_0x025d('0x58')]);}return db['DashboardItem'][_0x025d('0x57')](_0x5066a6[_0x025d('0x58')],{})[_0x025d('0x27')](respondWithResult(_0x2eec2c,0xc9))[_0x025d('0x59')](handleError(_0x2eec2c,null));};exports[_0x025d('0x26')]=function(_0x2062cc,_0x351c18){if(_0x2062cc[_0x025d('0x58')]['id']){delete _0x2062cc[_0x025d('0x58')]['id'];}_0x2062cc[_0x025d('0x58')][_0x025d('0x40')]=widgetAttributes(_0x2062cc[_0x025d('0x58')]);return db['DashboardItem'][_0x025d('0x3c')]({'where':{'id':_0x2062cc['params']['id']}})['then'](handleEntityNotFound(_0x351c18,null))[_0x025d('0x27')](saveUpdates(_0x2062cc[_0x025d('0x58')],null))[_0x025d('0x27')](respondWithResult(_0x351c18,null))[_0x025d('0x59')](handleError(_0x351c18,null));};
\ No newline at end of file
+var _0x0566=['../../mysqldb','localhost','register','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','params','model','keys','rawAttributes','query','filters','intersection','attributes','length','includeAll','include','options','DashboardItem','catch','find','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0xe634b5,_0x3df709){var _0x3125cc=function(_0x2f3aac){while(--_0x2f3aac){_0xe634b5['push'](_0xe634b5['shift']());}};_0x3125cc(++_0x3df709);}(_0x0566,0x96));var _0x6056=function(_0x408b4b,_0x2077ae){_0x408b4b=_0x408b4b-0x0;var _0x37c2ce=_0x0566[_0x408b4b];return _0x37c2ce;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6056('0x0'));var rimraf=require(_0x6056('0x1'));var zipdir=require(_0x6056('0x2'));var jsonpatch=require(_0x6056('0x3'));var rp=require(_0x6056('0x4'));var moment=require(_0x6056('0x5'));var BPromise=require(_0x6056('0x6'));var Mustache=require(_0x6056('0x7'));var util=require(_0x6056('0x8'));var path=require(_0x6056('0x9'));var sox=require('sox');var csv=require(_0x6056('0xa'));var ejs=require(_0x6056('0xb'));var fs=require('fs');var _=require(_0x6056('0xc'));var squel=require(_0x6056('0xd'));var crypto=require(_0x6056('0xe'));var jsforce=require(_0x6056('0xf'));var deskjs=require(_0x6056('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6056('0x11'));var Papa=require(_0x6056('0x12'));var qs=require(_0x6056('0x13'));var logger=require(_0x6056('0x14'))(_0x6056('0x15'));var utils=require(_0x6056('0x16'));var config=require(_0x6056('0x17'));var db=require(_0x6056('0x18'))['db'];var socket=require('socket.io-emitter')({'host':_0x6056('0x19'),'port':0x18eb});require('./dashboardItem.socket')[_0x6056('0x1a')](socket);function respondWithStatusCode(_0x24bb3c,_0x47a1f1){_0x47a1f1=_0x47a1f1||0xcc;return function(_0x4d4b45){if(_0x4d4b45){return _0x24bb3c[_0x6056('0x1b')](_0x47a1f1);}return _0x24bb3c[_0x6056('0x1c')](_0x47a1f1)['end']();};}function respondWithResult(_0x450f6e,_0x1e65bb){_0x1e65bb=_0x1e65bb||0xc8;return function(_0x121637){if(_0x121637){return _0x450f6e[_0x6056('0x1c')](_0x1e65bb)['json'](_0x121637);}};}function respondWithFilteredResult(_0x2fd24a,_0x50f001){return function(_0x5c38c1){if(_0x5c38c1){var _0x46d049=_0x5c38c1[_0x6056('0x1d')],_0x4c997b=_0x50f001[_0x6056('0x1e')],_0xa19789=_0x50f001[_0x6056('0x1e')]+_0x50f001[_0x6056('0x1f')],_0x305f6e;if(_0xa19789>=_0x46d049){_0xa19789=_0x46d049;_0x305f6e=0xc8;}else{_0x305f6e=0xce;}_0x2fd24a[_0x6056('0x1c')](_0x305f6e);return _0x2fd24a[_0x6056('0x20')](_0x6056('0x21'),_0x4c997b+'-'+_0xa19789+'/'+_0x46d049)[_0x6056('0x22')](_0x5c38c1);}return null;};}function patchUpdates(_0x557cd3){return function(_0x2e7dda){try{jsonpatch[_0x6056('0x23')](_0x2e7dda,_0x557cd3,!![]);}catch(_0x452325){return BPromise['reject'](_0x452325);}return _0x2e7dda[_0x6056('0x24')]();};}function saveUpdates(_0x241691,_0x2a4686){return function(_0x17b5d5){if(_0x17b5d5){return _0x17b5d5['update'](_0x241691)[_0x6056('0x25')](function(_0x42a477){return _0x42a477;});}return null;};}function removeEntity(_0x14f22b,_0x104498){return function(_0x430459){if(_0x430459){return _0x430459[_0x6056('0x26')]()[_0x6056('0x25')](function(){_0x14f22b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x616329,_0x4c00d1){return function(_0x5228f2){if(!_0x5228f2){_0x616329[_0x6056('0x1b')](0x194);}return _0x5228f2;};}function handleError(_0x491d29,_0x29bc84){_0x29bc84=_0x29bc84||0x1f4;return function(_0x43202f){logger[_0x6056('0x27')](_0x43202f[_0x6056('0x28')]);if(_0x43202f[_0x6056('0x29')]){delete _0x43202f[_0x6056('0x29')];}_0x491d29[_0x6056('0x1c')](_0x29bc84)[_0x6056('0x2a')](_0x43202f);};}exports['show']=function(_0x30242e,_0x2bb819){var _0x3f8a6e={'raw':![],'where':{'id':_0x30242e[_0x6056('0x2b')]['id']}},_0x49a920={};_0x49a920[_0x6056('0x2c')]=_[_0x6056('0x2d')](db['DashboardItem'][_0x6056('0x2e')]);_0x49a920[_0x6056('0x2f')]=_[_0x6056('0x2d')](_0x30242e[_0x6056('0x2f')]);_0x49a920[_0x6056('0x30')]=_[_0x6056('0x31')](_0x49a920[_0x6056('0x2c')],_0x49a920[_0x6056('0x2f')]);_0x3f8a6e['attributes']=_[_0x6056('0x31')](_0x49a920[_0x6056('0x2c')],qs['fields'](_0x30242e['query']['fields']));_0x3f8a6e[_0x6056('0x32')]=_0x3f8a6e[_0x6056('0x32')][_0x6056('0x33')]?_0x3f8a6e[_0x6056('0x32')]:_0x49a920['model'];if(_0x30242e[_0x6056('0x2f')][_0x6056('0x34')]){_0x3f8a6e[_0x6056('0x35')]=[{'all':!![]}];}_0x3f8a6e=_['merge']({},_0x3f8a6e,_0x30242e[_0x6056('0x36')]);return db[_0x6056('0x37')]['find'](_0x3f8a6e)[_0x6056('0x25')](handleEntityNotFound(_0x2bb819,null))['then'](respondWithResult(_0x2bb819,null))[_0x6056('0x38')](handleError(_0x2bb819,null));};exports[_0x6056('0x26')]=function(_0x39a50c,_0x5a29bc){return db[_0x6056('0x37')][_0x6056('0x39')]({'where':{'id':_0x39a50c['params']['id']}})[_0x6056('0x25')](handleEntityNotFound(_0x5a29bc,null))[_0x6056('0x25')](removeEntity(_0x5a29bc,null))[_0x6056('0x38')](handleError(_0x5a29bc,null));};function widgetAttributes(_0x14d3b3){try{switch(_0x14d3b3[_0x6056('0x3a')]){case _0x6056('0x3b'):return[{'name':_0x6056('0x3c'),'value':_0x14d3b3['attrUrl']||(_0x14d3b3[_0x6056('0x3d')]&&_0x14d3b3[_0x6056('0x3d')][0x0]?_0x14d3b3[_0x6056('0x3d')][0x0]['value']:undefined)||_0x6056('0x3e')}];case _0x6056('0x3f'):return[{'name':_0x6056('0x40'),'value':_0x14d3b3['attrPath']||(_0x14d3b3['attrs']&&_0x14d3b3[_0x6056('0x3d')][0x0]?_0x14d3b3['attrs'][0x0][_0x6056('0x41')]:undefined)||''}];case _0x6056('0x42'):return[{'name':'attrHourFormat','value':_0x14d3b3[_0x6056('0x43')]||(_0x14d3b3['attrs']&&_0x14d3b3[_0x6056('0x3d')][0x0]?_0x14d3b3[_0x6056('0x3d')][0x0][_0x6056('0x41')]:undefined)||_0x6056('0x44')},{'name':'attrTimezone','value':_0x14d3b3[_0x6056('0x45')]||(_0x14d3b3[_0x6056('0x3d')]&&_0x14d3b3[_0x6056('0x3d')][0x1]?_0x14d3b3[_0x6056('0x3d')][0x1][_0x6056('0x41')]:undefined)||_0x6056('0x46')},{'name':'attrFontSize','value':_0x14d3b3[_0x6056('0x47')]||(_0x14d3b3[_0x6056('0x3d')]&&_0x14d3b3['attrs'][0x2]?_0x14d3b3['attrs'][0x2][_0x6056('0x41')]:undefined)||0xc}];case _0x6056('0x48'):return[{'name':'attrMetric','value':_0x14d3b3[_0x6056('0x49')]||(_0x14d3b3['attrs']&&_0x14d3b3[_0x6056('0x3d')][0x0]?_0x14d3b3[_0x6056('0x3d')][0x0][_0x6056('0x41')]:undefined)||_0x6056('0x4a')},{'name':_0x6056('0x4b'),'value':_0x14d3b3[_0x6056('0x4b')]||(_0x14d3b3[_0x6056('0x3d')]&&_0x14d3b3[_0x6056('0x3d')][0x1]?_0x14d3b3[_0x6056('0x3d')][0x1][_0x6056('0x41')]:undefined)||[]},{'name':_0x6056('0x47'),'value':_0x14d3b3[_0x6056('0x47')]||(_0x14d3b3[_0x6056('0x3d')]&&_0x14d3b3[_0x6056('0x3d')][0x2]?_0x14d3b3[_0x6056('0x3d')][0x2][_0x6056('0x41')]:undefined)||0x14}];case _0x6056('0x4c'):case _0x6056('0x4d'):return[{'name':'attrSerie1','value':_0x14d3b3['attrSerie1']||(_0x14d3b3[_0x6056('0x3d')]&&_0x14d3b3[_0x6056('0x3d')][0x0]?_0x14d3b3[_0x6056('0x3d')][0x0][_0x6056('0x41')]:undefined)||_0x6056('0x4a')},{'name':_0x6056('0x4e'),'value':_0x14d3b3[_0x6056('0x4e')]||(_0x14d3b3[_0x6056('0x3d')]&&_0x14d3b3[_0x6056('0x3d')][0x1]?_0x14d3b3[_0x6056('0x3d')][0x1][_0x6056('0x41')]:undefined)||null},{'name':_0x6056('0x4f'),'value':_0x14d3b3[_0x6056('0x4f')]||(_0x14d3b3['attrs']&&_0x14d3b3[_0x6056('0x3d')][0x2]?_0x14d3b3[_0x6056('0x3d')][0x2][_0x6056('0x41')]:undefined)||null},{'name':_0x6056('0x4b'),'value':_0x14d3b3['attrVoiceQueues']||(_0x14d3b3[_0x6056('0x3d')]&&_0x14d3b3[_0x6056('0x3d')][0x3]?_0x14d3b3[_0x6056('0x3d')][0x3][_0x6056('0x41')]:undefined)||[]}];case _0x6056('0x50'):return[{'name':'attrReport','value':_0x14d3b3[_0x6056('0x51')]||(_0x14d3b3[_0x6056('0x3d')]&&_0x14d3b3[_0x6056('0x3d')][0x0]?_0x14d3b3[_0x6056('0x3d')][0x0][_0x6056('0x41')]:undefined)||null},{'name':_0x6056('0x52'),'value':_0x14d3b3[_0x6056('0x52')]||(_0x14d3b3[_0x6056('0x3d')]&&_0x14d3b3['attrs'][0x1]?_0x14d3b3[_0x6056('0x3d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3f8779){logger['error'](_0x6056('0x53'),JSON[_0x6056('0x54')](_0x3f8779));return[];}}exports['create']=function(_0x26b477,_0x3361cf){if(_0x26b477[_0x6056('0x55')]){_0x26b477['body'][_0x6056('0x3d')]=widgetAttributes(_0x26b477[_0x6056('0x55')]);}return db[_0x6056('0x37')]['create'](_0x26b477[_0x6056('0x55')],{})[_0x6056('0x25')](respondWithResult(_0x3361cf,0xc9))[_0x6056('0x38')](handleError(_0x3361cf,null));};exports[_0x6056('0x56')]=function(_0xcbb9f1,_0x315d93){if(_0xcbb9f1['body']['id']){delete _0xcbb9f1[_0x6056('0x55')]['id'];}_0xcbb9f1['body'][_0x6056('0x3d')]=widgetAttributes(_0xcbb9f1[_0x6056('0x55')]);return db['DashboardItem'][_0x6056('0x39')]({'where':{'id':_0xcbb9f1['params']['id']}})[_0x6056('0x25')](handleEntityNotFound(_0x315d93,null))[_0x6056('0x25')](saveUpdates(_0xcbb9f1[_0x6056('0x55')],null))[_0x6056('0x25')](respondWithResult(_0x315d93,null))[_0x6056('0x38')](handleError(_0x315d93,null));};
\ No newline at end of file
index 3ba2ae9..fe4d72b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7270=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem'];(function(_0x1af577,_0x1bd440){var _0x18ec4f=function(_0x4c9f95){while(--_0x4c9f95){_0x1af577['push'](_0x1af577['shift']());}};_0x18ec4f(++_0x1bd440);}(_0x7270,0x102));var _0x0727=function(_0x3806e6,_0x2f55d1){_0x3806e6=_0x3806e6-0x0;var _0x43aea8=_0x7270[_0x3806e6];return _0x43aea8;};'use strict';var EventEmitter=require(_0x0727('0x0'));var DashboardItem=require(_0x0727('0x1'))['db'][_0x0727('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0727('0x3'),'afterUpdate':'update','afterDestroy':_0x0727('0x4')};function emitEvent(_0x26771d){return function(_0xd2408b,_0x96fa66,_0x5cc0da){DashboardItemEvents[_0x0727('0x5')](_0x26771d+':'+_0xd2408b['id'],_0xd2408b);DashboardItemEvents[_0x0727('0x5')](_0x26771d,_0xd2408b);_0x5cc0da(null);};}for(var e in events){if(events[_0x0727('0x6')](e)){var event=events[e];DashboardItem[_0x0727('0x7')](e,emitEvent(event));}}module[_0x0727('0x8')]=DashboardItemEvents;
\ No newline at end of file
+var _0x2ad2=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','update'];(function(_0xa4f82a,_0x5696b8){var _0x176ecb=function(_0x180354){while(--_0x180354){_0xa4f82a['push'](_0xa4f82a['shift']());}};_0x176ecb(++_0x5696b8);}(_0x2ad2,0xa5));var _0x22ad=function(_0x24b245,_0x1b3508){_0x24b245=_0x24b245-0x0;var _0x56f828=_0x2ad2[_0x24b245];return _0x56f828;};'use strict';var EventEmitter=require(_0x22ad('0x0'));var DashboardItem=require(_0x22ad('0x1'))['db'][_0x22ad('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x22ad('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x22ad('0x4'),'afterDestroy':_0x22ad('0x5')};function emitEvent(_0x2e4963){return function(_0x19c3d9,_0x35c126,_0x4dab7c){DashboardItemEvents['emit'](_0x2e4963+':'+_0x19c3d9['id'],_0x19c3d9);DashboardItemEvents[_0x22ad('0x6')](_0x2e4963,_0x19c3d9);_0x4dab7c(null);};}for(var e in events){if(events[_0x22ad('0x7')](e)){var event=events[e];DashboardItem[_0x22ad('0x8')](e,emitEvent(event));}}module[_0x22ad('0x9')]=DashboardItemEvents;
\ No newline at end of file
index 074c9ae..564e593 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['dashboard_items','lodash','util','../../config/logger','moment','bluebird','./dashboardItem.attributes','exports','define'];(function(_0xaa656e,_0x250a02){var _0x2b2d99=function(_0x56d72f){while(--_0x56d72f){_0xaa656e['push'](_0xaa656e['shift']());}};_0x2b2d99(++_0x250a02);}(_0x7a54,0x106));var _0x47a5=function(_0x12848b,_0x37f6a8){_0x12848b=_0x12848b-0x0;var _0xff8da9=_0x7a54[_0x12848b];return _0xff8da9;};'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 attributes=require(_0x47a5('0x5'));module[_0x47a5('0x6')]=function(_0x2a1a7e,_0x3717e1){return _0x2a1a7e[_0x47a5('0x7')]('DashboardItem',attributes,{'tableName':_0x47a5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['dashboard_items','lodash','util','../../config/logger','moment','bluebird','./dashboardItem.attributes','exports','define'];(function(_0xea35d1,_0x302471){var _0x1d7a7c=function(_0x1bc101){while(--_0x1bc101){_0xea35d1['push'](_0xea35d1['shift']());}};_0x1d7a7c(++_0x302471);}(_0x7a54,0x106));var _0x47a5=function(_0x1c43d5,_0x3f7e12){_0x1c43d5=_0x1c43d5-0x0;var _0x5ecd83=_0x7a54[_0x1c43d5];return _0x5ecd83;};'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 attributes=require(_0x47a5('0x5'));module[_0x47a5('0x6')]=function(_0x2a1a7e,_0x3717e1){return _0x2a1a7e[_0x47a5('0x7')]('DashboardItem',attributes,{'tableName':_0x47a5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fe41dca..ed21d33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['client','socket.io-emitter','localhost','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x20c205,_0x39bc5e){var _0x3d6cf2=function(_0x209286){while(--_0x209286){_0x20c205['push'](_0x20c205['shift']());}};_0x3d6cf2(++_0x39bc5e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0x0a9e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a9e('0x4'))(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var jayson=require(_0x0a9e('0x7'));var client=jayson[_0x0a9e('0x8')]['http']({'port':0x232a});var socket=require(_0x0a9e('0x9'))({'host':_0x0a9e('0xa'),'port':0x18eb});require(_0x0a9e('0xb'))['register'](socket);function respondWithRpcPromise(_0x503809,_0xe42b77,_0x56465b){return new BPromise(function(_0x52cace,_0x39753a){return client[_0x0a9e('0xc')](_0x503809,_0x56465b)[_0x0a9e('0xd')](function(_0x3ab53f){logger[_0x0a9e('0xe')](_0x0a9e('0xf'),_0xe42b77,'request\x20sent');logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0xe42b77,'request\x20sent',JSON[_0x0a9e('0x10')](_0x3ab53f));if(_0x3ab53f[_0x0a9e('0x11')]){if(_0x3ab53f[_0x0a9e('0x11')][_0x0a9e('0x12')]===0x1f4){logger[_0x0a9e('0x11')](_0x0a9e('0xf'),_0xe42b77,_0x3ab53f['error'][_0x0a9e('0x13')]);return _0x39753a(_0x3ab53f[_0x0a9e('0x11')][_0x0a9e('0x13')]);}logger[_0x0a9e('0x11')](_0x0a9e('0xf'),_0xe42b77,_0x3ab53f[_0x0a9e('0x11')]['message']);return _0x52cace(_0x3ab53f[_0x0a9e('0x11')]['message']);}else{logger[_0x0a9e('0xe')]('DashboardItem,\x20%s,\x20%s',_0xe42b77,_0x0a9e('0x14'));_0x52cace(_0x3ab53f[_0x0a9e('0x15')]['message']);}})[_0x0a9e('0x16')](function(_0x5a0a06){logger[_0x0a9e('0x11')](_0x0a9e('0xf'),_0xe42b77,_0x5a0a06);_0x39753a(_0x5a0a06);});});}
\ No newline at end of file
+var _0xa9e0=['client','socket.io-emitter','localhost','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x494223,_0x2c1f71){var _0xdaf98=function(_0x1f790e){while(--_0x1f790e){_0x494223['push'](_0x494223['shift']());}};_0xdaf98(++_0x2c1f71);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 db=require(_0x0a9e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a9e('0x4'))(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var jayson=require(_0x0a9e('0x7'));var client=jayson[_0x0a9e('0x8')]['http']({'port':0x232a});var socket=require(_0x0a9e('0x9'))({'host':_0x0a9e('0xa'),'port':0x18eb});require(_0x0a9e('0xb'))['register'](socket);function respondWithRpcPromise(_0x503809,_0xe42b77,_0x56465b){return new BPromise(function(_0x52cace,_0x39753a){return client[_0x0a9e('0xc')](_0x503809,_0x56465b)[_0x0a9e('0xd')](function(_0x3ab53f){logger[_0x0a9e('0xe')](_0x0a9e('0xf'),_0xe42b77,'request\x20sent');logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0xe42b77,'request\x20sent',JSON[_0x0a9e('0x10')](_0x3ab53f));if(_0x3ab53f[_0x0a9e('0x11')]){if(_0x3ab53f[_0x0a9e('0x11')][_0x0a9e('0x12')]===0x1f4){logger[_0x0a9e('0x11')](_0x0a9e('0xf'),_0xe42b77,_0x3ab53f['error'][_0x0a9e('0x13')]);return _0x39753a(_0x3ab53f[_0x0a9e('0x11')][_0x0a9e('0x13')]);}logger[_0x0a9e('0x11')](_0x0a9e('0xf'),_0xe42b77,_0x3ab53f[_0x0a9e('0x11')]['message']);return _0x52cace(_0x3ab53f[_0x0a9e('0x11')]['message']);}else{logger[_0x0a9e('0xe')]('DashboardItem,\x20%s,\x20%s',_0xe42b77,_0x0a9e('0x14'));_0x52cace(_0x3ab53f[_0x0a9e('0x15')]['message']);}})[_0x0a9e('0x16')](function(_0x5a0a06){logger[_0x0a9e('0x11')](_0x0a9e('0xf'),_0xe42b77,_0x5a0a06);_0x39753a(_0x5a0a06);});});}
\ No newline at end of file
index 50406c2..67bb45f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['emit','removeListener','register','length','dashboardItem:','./dashboardItem.events','remove','update'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x3e74,0x175));var _0x43e7=function(_0x10f533,_0x125530){_0x10f533=_0x10f533-0x0;var _0x2a0599=_0x3e74[_0x10f533];return _0x2a0599;};'use strict';var DashboardItemEvents=require(_0x43e7('0x0'));var events=['save',_0x43e7('0x1'),_0x43e7('0x2')];function createListener(_0x151ad2,_0x494e45){return function(_0x490ced){_0x494e45[_0x43e7('0x3')](_0x151ad2,_0x490ced);};}function removeListener(_0x4f9bbe,_0x128b0f){return function(){DashboardItemEvents[_0x43e7('0x4')](_0x4f9bbe,_0x128b0f);};}exports[_0x43e7('0x5')]=function(_0x1c503b){for(var _0xc98b9c=0x0,_0x503698=events[_0x43e7('0x6')];_0xc98b9c<_0x503698;_0xc98b9c++){var _0x3491d6=events[_0xc98b9c];var _0x2ede2d=createListener(_0x43e7('0x7')+_0x3491d6,_0x1c503b);DashboardItemEvents['on'](_0x3491d6,_0x2ede2d);}};
\ No newline at end of file
+var _0x008c=['./dashboardItem.events','save','remove','update','emit','removeListener','register','dashboardItem:'];(function(_0x372459,_0x33b1ac){var _0x14b40e=function(_0x23d4a6){while(--_0x23d4a6){_0x372459['push'](_0x372459['shift']());}};_0x14b40e(++_0x33b1ac);}(_0x008c,0x188));var _0xc008=function(_0x2f32c4,_0x2597ba){_0x2f32c4=_0x2f32c4-0x0;var _0x95b5dc=_0x008c[_0x2f32c4];return _0x95b5dc;};'use strict';var DashboardItemEvents=require(_0xc008('0x0'));var events=[_0xc008('0x1'),_0xc008('0x2'),_0xc008('0x3')];function createListener(_0x1d119a,_0x544fdf){return function(_0x3641af){_0x544fdf[_0xc008('0x4')](_0x1d119a,_0x3641af);};}function removeListener(_0x10b33c,_0x163bd9){return function(){DashboardItemEvents[_0xc008('0x5')](_0x10b33c,_0x163bd9);};}exports[_0xc008('0x6')]=function(_0x13aa7){for(var _0x39bb5e=0x0,_0x9c8cb2=events['length'];_0x39bb5e<_0x9c8cb2;_0x39bb5e++){var _0x428fa9=events[_0x39bb5e];var _0x5aa09b=createListener(_0xc008('0x7')+_0x428fa9,_0x13aa7);DashboardItemEvents['on'](_0x428fa9,_0x5aa09b);}};
\ No newline at end of file
index 8a916b2..4c79882 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8f8=['../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','put','destroy','multer','util','path','express','Router','../../components/interaction/service'];(function(_0x3a8174,_0x11e7b0){var _0x4c1c5a=function(_0x33355c){while(--_0x33355c){_0x3a8174['push'](_0x3a8174['shift']());}};_0x4c1c5a(++_0x11e7b0);}(_0xd8f8,0xda));var _0x8d8f=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xd8f8[_0x36ed3c];return _0x52a2e0;};'use strict';var multer=require(_0x8d8f('0x0'));var util=require(_0x8d8f('0x1'));var path=require(_0x8d8f('0x2'));var express=require(_0x8d8f('0x3'));var router=express[_0x8d8f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8d8f('0x5'));var config=require(_0x8d8f('0x6'));var controller=require(_0x8d8f('0x7'));router[_0x8d8f('0x8')](_0x8d8f('0x9'),auth[_0x8d8f('0xa')](),controller[_0x8d8f('0xb')]);router[_0x8d8f('0xc')]('/',auth[_0x8d8f('0xa')](),controller[_0x8d8f('0xd')]);router[_0x8d8f('0xe')](_0x8d8f('0x9'),auth[_0x8d8f('0xa')](),controller['update']);router['delete'](_0x8d8f('0x9'),auth[_0x8d8f('0xa')](),controller[_0x8d8f('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xaaff=['../../components/interaction/service','./dashboardItem.controller','get','isAuthenticated','show','post','put','/:id','update','delete','exports','util','path','Router','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaaff,0x1be));var _0xfaaf=function(_0x4a42f0,_0x2da65d){_0x4a42f0=_0x4a42f0-0x0;var _0x3dc532=_0xaaff[_0x4a42f0];return _0x3dc532;};'use strict';var multer=require('multer');var util=require(_0xfaaf('0x0'));var path=require(_0xfaaf('0x1'));var express=require('express');var router=express[_0xfaaf('0x2')]();var auth=require(_0xfaaf('0x3'));var interaction=require(_0xfaaf('0x4'));var config=require('../../config/environment');var controller=require(_0xfaaf('0x5'));router[_0xfaaf('0x6')]('/:id',auth[_0xfaaf('0x7')](),controller[_0xfaaf('0x8')]);router[_0xfaaf('0x9')]('/',auth[_0xfaaf('0x7')](),controller['create']);router[_0xfaaf('0xa')](_0xfaaf('0xb'),auth[_0xfaaf('0x7')](),controller[_0xfaaf('0xc')]);router[_0xfaaf('0xd')]('/:id',auth[_0xfaaf('0x7')](),controller['destroy']);module[_0xfaaf('0xe')]=router;
\ No newline at end of file
index 2237982..3277104 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4191=['STRING','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4191,0x1ed));var _0x1419=function(_0x197d8e,_0x3e7cdc){_0x197d8e=_0x197d8e-0x0;var _0x425081=_0x4191[_0x197d8e];return _0x425081;};'use strict';var Sequelize=require('sequelize');module[_0x1419('0x0')]={'name':{'type':Sequelize[_0x1419('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xa55e=['STRING','sequelize','exports'];(function(_0x5f066a,_0x59e171){var _0x46cd08=function(_0x1a61f3){while(--_0x1a61f3){_0x5f066a['push'](_0x5f066a['shift']());}};_0x46cd08(++_0x59e171);}(_0xa55e,0xca));var _0xea55=function(_0x1eacf1,_0x19cb24){_0x1eacf1=_0x1eacf1-0x0;var _0x2ffaf6=_0xa55e[_0x1eacf1];return _0x2ffaf6;};'use strict';var Sequelize=require(_0xea55('0x0'));module[_0xea55('0x1')]={'name':{'type':Sequelize[_0xea55('0x2')],'allowNull':![]}};
\ No newline at end of file
index 025a8e4..5c3a76e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a4e=['filter','options','includeAll','include','findAll','catch','params','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Disposition','rawAttributes','model','keys','query','dateEnd','dateStart','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','day','add','merge','map'];(function(_0x295429,_0x42f59a){var _0x1910f9=function(_0x4809e9){while(--_0x4809e9){_0x295429['push'](_0x295429['shift']());}};_0x1910f9(++_0x42f59a);}(_0x8a4e,0xee));var _0xe8a4=function(_0x4d6a8f,_0x565271){_0x4d6a8f=_0x4d6a8f-0x0;var _0x537980=_0x8a4e[_0x4d6a8f];return _0x537980;};'use strict';var pdf=require(_0xe8a4('0x0'));var emlformat=require(_0xe8a4('0x1'));var rimraf=require(_0xe8a4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe8a4('0x3'));var rp=require(_0xe8a4('0x4'));var moment=require(_0xe8a4('0x5'));var BPromise=require(_0xe8a4('0x6'));var Mustache=require(_0xe8a4('0x7'));var util=require(_0xe8a4('0x8'));var path=require(_0xe8a4('0x9'));var sox=require(_0xe8a4('0xa'));var csv=require(_0xe8a4('0xb'));var ejs=require(_0xe8a4('0xc'));var fs=require('fs');var _=require(_0xe8a4('0xd'));var squel=require(_0xe8a4('0xe'));var crypto=require(_0xe8a4('0xf'));var jsforce=require(_0xe8a4('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe8a4('0xb'));var querystring=require(_0xe8a4('0x11'));var Papa=require(_0xe8a4('0x12'));var qs=require(_0xe8a4('0x13'));var logger=require(_0xe8a4('0x14'))(_0xe8a4('0x15'));var utils=require(_0xe8a4('0x16'));var config=require(_0xe8a4('0x17'));var db=require(_0xe8a4('0x18'))['db'];function respondWithStatusCode(_0x3d8928,_0x39549d){_0x39549d=_0x39549d||0xcc;return function(_0x44ae3a){if(_0x44ae3a){return _0x3d8928[_0xe8a4('0x19')](_0x39549d);}return _0x3d8928[_0xe8a4('0x1a')](_0x39549d)[_0xe8a4('0x1b')]();};}function respondWithResult(_0x40b00c,_0x10fcfa){_0x10fcfa=_0x10fcfa||0xc8;return function(_0x54c354){if(_0x54c354){return _0x40b00c['status'](_0x10fcfa)[_0xe8a4('0x1c')](_0x54c354);}};}function respondWithFilteredResult(_0x6bccbb,_0x15b050){return function(_0xcb5678){if(_0xcb5678){var _0x4d5805=_0xcb5678[_0xe8a4('0x1d')],_0x148c6f=_0x15b050[_0xe8a4('0x1e')],_0xa433c1=_0x15b050[_0xe8a4('0x1e')]+_0x15b050['limit'],_0x3e4c1b;if(_0xa433c1>=_0x4d5805){_0xa433c1=_0x4d5805;_0x3e4c1b=0xc8;}else{_0x3e4c1b=0xce;}_0x6bccbb[_0xe8a4('0x1a')](_0x3e4c1b);return _0x6bccbb[_0xe8a4('0x1f')](_0xe8a4('0x20'),_0x148c6f+'-'+_0xa433c1+'/'+_0x4d5805)[_0xe8a4('0x1c')](_0xcb5678);}return null;};}function patchUpdates(_0xa8c0cc){return function(_0x2dac5){try{jsonpatch['apply'](_0x2dac5,_0xa8c0cc,!![]);}catch(_0x36a76a){return BPromise[_0xe8a4('0x21')](_0x36a76a);}return _0x2dac5[_0xe8a4('0x22')]();};}function saveUpdates(_0x3db59a,_0x1ff828){return function(_0x294c2f){if(_0x294c2f){return _0x294c2f[_0xe8a4('0x23')](_0x3db59a)[_0xe8a4('0x24')](function(_0x51cf78){return _0x51cf78;});}return null;};}function removeEntity(_0x448dca,_0x143459){return function(_0x2c24b6){if(_0x2c24b6){return _0x2c24b6[_0xe8a4('0x25')]()[_0xe8a4('0x24')](function(){_0x448dca[_0xe8a4('0x1a')](0xcc)[_0xe8a4('0x1b')]();});}};}function handleEntityNotFound(_0x112ee8,_0x4f9b99){return function(_0x50bf3e){if(!_0x50bf3e){_0x112ee8['sendStatus'](0x194);}return _0x50bf3e;};}function handleError(_0x509210,_0x48d5de){_0x48d5de=_0x48d5de||0x1f4;return function(_0x5d6df5){logger[_0xe8a4('0x26')](_0x5d6df5[_0xe8a4('0x27')]);if(_0x5d6df5[_0xe8a4('0x28')]){delete _0x5d6df5[_0xe8a4('0x28')];}_0x509210[_0xe8a4('0x1a')](_0x48d5de)[_0xe8a4('0x29')](_0x5d6df5);};}exports[_0xe8a4('0x2a')]=function(_0x4c94ce,_0x22f7a4){var _0x454e25={},_0x2e6a90={},_0x2016ca={'count':0x0,'rows':[]};var _0x532600=db[_0xe8a4('0x2b')][_0xe8a4('0x2c')];_0x2e6a90[_0xe8a4('0x2d')]=_[_0xe8a4('0x2e')](_0x532600);var _0x4f972c={'dateStart':_0x4c94ce[_0xe8a4('0x2f')]['dateStart'],'dateEnd':_0x4c94ce[_0xe8a4('0x2f')][_0xe8a4('0x30')]};delete _0x4c94ce[_0xe8a4('0x2f')][_0xe8a4('0x31')];delete _0x4c94ce[_0xe8a4('0x2f')][_0xe8a4('0x30')];_0x2e6a90[_0xe8a4('0x2f')]=_[_0xe8a4('0x2e')](_0x4c94ce[_0xe8a4('0x2f')]);_0x2e6a90[_0xe8a4('0x32')]=_[_0xe8a4('0x33')](_0x2e6a90['model'],_0x2e6a90['query']);_0x454e25['attributes']=_[_0xe8a4('0x33')](_0x2e6a90[_0xe8a4('0x2d')],qs[_0xe8a4('0x34')](_0x4c94ce['query']['fields']));_0x454e25['attributes']=_0x454e25[_0xe8a4('0x35')][_0xe8a4('0x36')]?_0x454e25[_0xe8a4('0x35')]:_0x2e6a90[_0xe8a4('0x2d')];if(!_0x4c94ce[_0xe8a4('0x2f')][_0xe8a4('0x37')](_0xe8a4('0x38'))){_0x454e25['limit']=qs[_0xe8a4('0x39')](_0x4c94ce[_0xe8a4('0x2f')][_0xe8a4('0x39')]);_0x454e25[_0xe8a4('0x1e')]=qs['offset'](_0x4c94ce['query'][_0xe8a4('0x1e')]);}_0x454e25[_0xe8a4('0x3a')]=qs[_0xe8a4('0x3b')](_0x4c94ce[_0xe8a4('0x2f')][_0xe8a4('0x3b')]);_0x454e25[_0xe8a4('0x3c')]=qs[_0xe8a4('0x32')](_[_0xe8a4('0x3d')](_0x4c94ce[_0xe8a4('0x2f')],_0x2e6a90[_0xe8a4('0x32')]));if(_0x4f972c[_0xe8a4('0x31')]){if(_0x4f972c[_0xe8a4('0x30')]){_0x4f972c[_0xe8a4('0x30')]=moment(_0x4f972c[_0xe8a4('0x30')])['add'](0x1,_0xe8a4('0x3e'));}else{_0x4f972c[_0xe8a4('0x30')]=moment(_0x4f972c['dateStart'])[_0xe8a4('0x3f')](0x1,'day');}_['merge'](_0x454e25[_0xe8a4('0x3c')],{'createdAt':{'$gte':_0x4f972c[_0xe8a4('0x31')],'$lte':_0x4f972c[_0xe8a4('0x30')]}});}if(_0x4c94ce[_0xe8a4('0x2f')]['filter']){_0x454e25['where']=_[_0xe8a4('0x40')](_0x454e25[_0xe8a4('0x3c')],{'$or':_[_0xe8a4('0x41')](_0x454e25[_0xe8a4('0x35')],function(_0x23f72c){var _0x299814={};_0x299814[_0x23f72c]={'$like':'%'+_0x4c94ce['query'][_0xe8a4('0x42')]+'%'};return _0x299814;})});}_0x454e25=_[_0xe8a4('0x40')]({},_0x454e25,_0x4c94ce[_0xe8a4('0x43')]);var _0x2b542e={'where':_0x454e25['where']};return db['Disposition'][_0xe8a4('0x1d')](_0x2b542e)['then'](function(_0x596fb0){_0x2016ca[_0xe8a4('0x1d')]=_0x596fb0;if(_0x4c94ce[_0xe8a4('0x2f')][_0xe8a4('0x44')]){_0x454e25[_0xe8a4('0x45')]=[{'all':!![]}];}return db['Disposition'][_0xe8a4('0x46')](_0x454e25);})[_0xe8a4('0x24')](function(_0x1c7d1c){_0x2016ca['rows']=_0x1c7d1c;return _0x2016ca;})['then'](respondWithFilteredResult(_0x22f7a4,_0x454e25))[_0xe8a4('0x47')](handleError(_0x22f7a4,null));};exports['show']=function(_0x77b56a,_0x224fe8){var _0x4557fe={'raw':!![],'where':{'id':_0x77b56a[_0xe8a4('0x48')]['id']}},_0x4db046={};_0x4db046[_0xe8a4('0x2d')]=_['keys'](db['Disposition'][_0xe8a4('0x2c')]);_0x4db046[_0xe8a4('0x2f')]=_[_0xe8a4('0x2e')](_0x77b56a['query']);_0x4db046['filters']=_[_0xe8a4('0x33')](_0x4db046[_0xe8a4('0x2d')],_0x4db046[_0xe8a4('0x2f')]);_0x4557fe[_0xe8a4('0x35')]=_[_0xe8a4('0x33')](_0x4db046[_0xe8a4('0x2d')],qs[_0xe8a4('0x34')](_0x77b56a['query'][_0xe8a4('0x34')]));_0x4557fe[_0xe8a4('0x35')]=_0x4557fe[_0xe8a4('0x35')][_0xe8a4('0x36')]?_0x4557fe[_0xe8a4('0x35')]:_0x4db046[_0xe8a4('0x2d')];if(_0x77b56a[_0xe8a4('0x2f')][_0xe8a4('0x44')]){_0x4557fe['include']=[{'all':!![]}];}_0x4557fe=_['merge']({},_0x4557fe,_0x77b56a[_0xe8a4('0x43')]);return db[_0xe8a4('0x2b')][_0xe8a4('0x49')](_0x4557fe)[_0xe8a4('0x24')](handleEntityNotFound(_0x224fe8,null))['then'](respondWithResult(_0x224fe8,null))[_0xe8a4('0x47')](handleError(_0x224fe8,null));};exports[_0xe8a4('0x4a')]=function(_0x44192e,_0x4c1bb9){return db[_0xe8a4('0x2b')][_0xe8a4('0x4a')](_0x44192e['body'],{})['then'](respondWithResult(_0x4c1bb9,0xc9))[_0xe8a4('0x47')](handleError(_0x4c1bb9,null));};exports[_0xe8a4('0x23')]=function(_0x3eeca6,_0x226183){if(_0x3eeca6[_0xe8a4('0x4b')]['id']){delete _0x3eeca6[_0xe8a4('0x4b')]['id'];}return db[_0xe8a4('0x2b')]['find']({'where':{'id':_0x3eeca6['params']['id']}})[_0xe8a4('0x24')](handleEntityNotFound(_0x226183,null))[_0xe8a4('0x24')](saveUpdates(_0x3eeca6[_0xe8a4('0x4b')],null))[_0xe8a4('0x24')](respondWithResult(_0x226183,null))[_0xe8a4('0x47')](handleError(_0x226183,null));};exports['destroy']=function(_0x3ef6f4,_0x10fa58){return db[_0xe8a4('0x2b')][_0xe8a4('0x49')]({'where':{'id':_0x3ef6f4[_0xe8a4('0x48')]['id']}})['then'](handleEntityNotFound(_0x10fa58,null))[_0xe8a4('0x24')](removeEntity(_0x10fa58,null))[_0xe8a4('0x47')](handleError(_0x10fa58,null));};
\ No newline at end of file
+var _0xefd3=['keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','add','day','merge','map','filter','options','includeAll','findAll','rows','params','length','include','find','catch','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','lodash','squel','desk.js','to-csv','querystring','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','Disposition','rawAttributes','model'];(function(_0x38cb58,_0x203de5){var _0x57fc2a=function(_0x51466f){while(--_0x51466f){_0x38cb58['push'](_0x38cb58['shift']());}};_0x57fc2a(++_0x203de5);}(_0xefd3,0xec));var _0x3efd=function(_0x331041,_0x171a45){_0x331041=_0x331041-0x0;var _0x11a376=_0xefd3[_0x331041];return _0x11a376;};'use strict';var pdf=require(_0x3efd('0x0'));var emlformat=require(_0x3efd('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3efd('0x2'));var jsonpatch=require(_0x3efd('0x3'));var rp=require('request-promise');var moment=require(_0x3efd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3efd('0x5'));var util=require(_0x3efd('0x6'));var path=require('path');var sox=require(_0x3efd('0x7'));var csv=require('to-csv');var ejs=require(_0x3efd('0x8'));var fs=require('fs');var _=require(_0x3efd('0x9'));var squel=require(_0x3efd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3efd('0xb'));var toCsv=require(_0x3efd('0xc'));var querystring=require(_0x3efd('0xd'));var Papa=require('papaparse');var qs=require('../../components/parsers/qs');var logger=require(_0x3efd('0xe'))(_0x3efd('0xf'));var utils=require(_0x3efd('0x10'));var config=require(_0x3efd('0x11'));var db=require(_0x3efd('0x12'))['db'];function respondWithStatusCode(_0x5896be,_0x5a9ef9){_0x5a9ef9=_0x5a9ef9||0xcc;return function(_0xfa6d8d){if(_0xfa6d8d){return _0x5896be[_0x3efd('0x13')](_0x5a9ef9);}return _0x5896be[_0x3efd('0x14')](_0x5a9ef9)['end']();};}function respondWithResult(_0x1469a0,_0x2b0bc0){_0x2b0bc0=_0x2b0bc0||0xc8;return function(_0x303dba){if(_0x303dba){return _0x1469a0[_0x3efd('0x14')](_0x2b0bc0)[_0x3efd('0x15')](_0x303dba);}};}function respondWithFilteredResult(_0x4b3d95,_0x3c9085){return function(_0x1afa96){if(_0x1afa96){var _0x202396=_0x1afa96[_0x3efd('0x16')],_0x3cc362=_0x3c9085[_0x3efd('0x17')],_0x3e6368=_0x3c9085['offset']+_0x3c9085[_0x3efd('0x18')],_0x5c7be6;if(_0x3e6368>=_0x202396){_0x3e6368=_0x202396;_0x5c7be6=0xc8;}else{_0x5c7be6=0xce;}_0x4b3d95[_0x3efd('0x14')](_0x5c7be6);return _0x4b3d95[_0x3efd('0x19')]('Content-Range',_0x3cc362+'-'+_0x3e6368+'/'+_0x202396)[_0x3efd('0x15')](_0x1afa96);}return null;};}function patchUpdates(_0x21d723){return function(_0x472e89){try{jsonpatch[_0x3efd('0x1a')](_0x472e89,_0x21d723,!![]);}catch(_0x679fd9){return BPromise[_0x3efd('0x1b')](_0x679fd9);}return _0x472e89[_0x3efd('0x1c')]();};}function saveUpdates(_0x230476,_0x654290){return function(_0x446cae){if(_0x446cae){return _0x446cae[_0x3efd('0x1d')](_0x230476)[_0x3efd('0x1e')](function(_0x10a4d5){return _0x10a4d5;});}return null;};}function removeEntity(_0x474aeb,_0x4f9878){return function(_0x543d67){if(_0x543d67){return _0x543d67[_0x3efd('0x1f')]()[_0x3efd('0x1e')](function(){_0x474aeb[_0x3efd('0x14')](0xcc)[_0x3efd('0x20')]();});}};}function handleEntityNotFound(_0x120e45,_0x11aa95){return function(_0x3c0d3c){if(!_0x3c0d3c){_0x120e45[_0x3efd('0x13')](0x194);}return _0x3c0d3c;};}function handleError(_0x12193e,_0x428c9c){_0x428c9c=_0x428c9c||0x1f4;return function(_0x3ad4f4){logger[_0x3efd('0x21')](_0x3ad4f4[_0x3efd('0x22')]);if(_0x3ad4f4['name']){delete _0x3ad4f4[_0x3efd('0x23')];}_0x12193e[_0x3efd('0x14')](_0x428c9c)[_0x3efd('0x24')](_0x3ad4f4);};}exports['index']=function(_0x40f8ec,_0x231bc0){var _0x5ca08d={},_0x32afa4={},_0x4d8e14={'count':0x0,'rows':[]};var _0x222ae0=db[_0x3efd('0x25')][_0x3efd('0x26')];_0x32afa4[_0x3efd('0x27')]=_[_0x3efd('0x28')](_0x222ae0);var _0x570eb2={'dateStart':_0x40f8ec[_0x3efd('0x29')][_0x3efd('0x2a')],'dateEnd':_0x40f8ec['query'][_0x3efd('0x2b')]};delete _0x40f8ec[_0x3efd('0x29')][_0x3efd('0x2a')];delete _0x40f8ec[_0x3efd('0x29')]['dateEnd'];_0x32afa4[_0x3efd('0x29')]=_[_0x3efd('0x28')](_0x40f8ec[_0x3efd('0x29')]);_0x32afa4[_0x3efd('0x2c')]=_[_0x3efd('0x2d')](_0x32afa4[_0x3efd('0x27')],_0x32afa4[_0x3efd('0x29')]);_0x5ca08d[_0x3efd('0x2e')]=_[_0x3efd('0x2d')](_0x32afa4[_0x3efd('0x27')],qs[_0x3efd('0x2f')](_0x40f8ec[_0x3efd('0x29')]['fields']));_0x5ca08d[_0x3efd('0x2e')]=_0x5ca08d[_0x3efd('0x2e')]['length']?_0x5ca08d['attributes']:_0x32afa4[_0x3efd('0x27')];if(!_0x40f8ec[_0x3efd('0x29')]['hasOwnProperty'](_0x3efd('0x30'))){_0x5ca08d[_0x3efd('0x18')]=qs[_0x3efd('0x18')](_0x40f8ec['query']['limit']);_0x5ca08d['offset']=qs[_0x3efd('0x17')](_0x40f8ec[_0x3efd('0x29')]['offset']);}_0x5ca08d[_0x3efd('0x31')]=qs[_0x3efd('0x32')](_0x40f8ec[_0x3efd('0x29')]['sort']);_0x5ca08d[_0x3efd('0x33')]=qs[_0x3efd('0x2c')](_[_0x3efd('0x34')](_0x40f8ec[_0x3efd('0x29')],_0x32afa4['filters']));if(_0x570eb2[_0x3efd('0x2a')]){if(_0x570eb2[_0x3efd('0x2b')]){_0x570eb2['dateEnd']=moment(_0x570eb2[_0x3efd('0x2b')])[_0x3efd('0x35')](0x1,_0x3efd('0x36'));}else{_0x570eb2[_0x3efd('0x2b')]=moment(_0x570eb2[_0x3efd('0x2a')])[_0x3efd('0x35')](0x1,_0x3efd('0x36'));}_[_0x3efd('0x37')](_0x5ca08d[_0x3efd('0x33')],{'createdAt':{'$gte':_0x570eb2[_0x3efd('0x2a')],'$lte':_0x570eb2['dateEnd']}});}if(_0x40f8ec['query']['filter']){_0x5ca08d['where']=_[_0x3efd('0x37')](_0x5ca08d['where'],{'$or':_[_0x3efd('0x38')](_0x5ca08d[_0x3efd('0x2e')],function(_0x19ede7){var _0xdb6bdf={};_0xdb6bdf[_0x19ede7]={'$like':'%'+_0x40f8ec[_0x3efd('0x29')][_0x3efd('0x39')]+'%'};return _0xdb6bdf;})});}_0x5ca08d=_[_0x3efd('0x37')]({},_0x5ca08d,_0x40f8ec[_0x3efd('0x3a')]);var _0x15d277={'where':_0x5ca08d[_0x3efd('0x33')]};return db[_0x3efd('0x25')][_0x3efd('0x16')](_0x15d277)[_0x3efd('0x1e')](function(_0x17aa4f){_0x4d8e14[_0x3efd('0x16')]=_0x17aa4f;if(_0x40f8ec['query'][_0x3efd('0x3b')]){_0x5ca08d['include']=[{'all':!![]}];}return db['Disposition'][_0x3efd('0x3c')](_0x5ca08d);})['then'](function(_0x46763e){_0x4d8e14[_0x3efd('0x3d')]=_0x46763e;return _0x4d8e14;})[_0x3efd('0x1e')](respondWithFilteredResult(_0x231bc0,_0x5ca08d))['catch'](handleError(_0x231bc0,null));};exports['show']=function(_0x46571c,_0x55de25){var _0x29d6e6={'raw':!![],'where':{'id':_0x46571c[_0x3efd('0x3e')]['id']}},_0x43b695={};_0x43b695[_0x3efd('0x27')]=_[_0x3efd('0x28')](db['Disposition'][_0x3efd('0x26')]);_0x43b695['query']=_[_0x3efd('0x28')](_0x46571c['query']);_0x43b695[_0x3efd('0x2c')]=_[_0x3efd('0x2d')](_0x43b695[_0x3efd('0x27')],_0x43b695[_0x3efd('0x29')]);_0x29d6e6[_0x3efd('0x2e')]=_[_0x3efd('0x2d')](_0x43b695['model'],qs[_0x3efd('0x2f')](_0x46571c[_0x3efd('0x29')][_0x3efd('0x2f')]));_0x29d6e6[_0x3efd('0x2e')]=_0x29d6e6[_0x3efd('0x2e')][_0x3efd('0x3f')]?_0x29d6e6[_0x3efd('0x2e')]:_0x43b695['model'];if(_0x46571c['query'][_0x3efd('0x3b')]){_0x29d6e6[_0x3efd('0x40')]=[{'all':!![]}];}_0x29d6e6=_[_0x3efd('0x37')]({},_0x29d6e6,_0x46571c[_0x3efd('0x3a')]);return db[_0x3efd('0x25')][_0x3efd('0x41')](_0x29d6e6)['then'](handleEntityNotFound(_0x55de25,null))[_0x3efd('0x1e')](respondWithResult(_0x55de25,null))[_0x3efd('0x42')](handleError(_0x55de25,null));};exports[_0x3efd('0x43')]=function(_0x508d5e,_0x4b8b3a){return db['Disposition'][_0x3efd('0x43')](_0x508d5e[_0x3efd('0x44')],{})[_0x3efd('0x1e')](respondWithResult(_0x4b8b3a,0xc9))['catch'](handleError(_0x4b8b3a,null));};exports['update']=function(_0x247678,_0x12bfa8){if(_0x247678['body']['id']){delete _0x247678[_0x3efd('0x44')]['id'];}return db['Disposition'][_0x3efd('0x41')]({'where':{'id':_0x247678[_0x3efd('0x3e')]['id']}})['then'](handleEntityNotFound(_0x12bfa8,null))[_0x3efd('0x1e')](saveUpdates(_0x247678['body'],null))[_0x3efd('0x1e')](respondWithResult(_0x12bfa8,null))[_0x3efd('0x42')](handleError(_0x12bfa8,null));};exports[_0x3efd('0x1f')]=function(_0x384738,_0x5dfd4c){return db[_0x3efd('0x25')][_0x3efd('0x41')]({'where':{'id':_0x384738[_0x3efd('0x3e')]['id']}})[_0x3efd('0x1e')](handleEntityNotFound(_0x5dfd4c,null))[_0x3efd('0x1e')](removeEntity(_0x5dfd4c,null))[_0x3efd('0x42')](handleError(_0x5dfd4c,null));};
\ No newline at end of file
index 66094ae..a46532c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda2d=['name_mail','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','util','../../config/logger','api','moment','bluebird','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat'];(function(_0x44d0cc,_0x342593){var _0x34fe4f=function(_0x43c450){while(--_0x43c450){_0x44d0cc['push'](_0x44d0cc['shift']());}};_0x34fe4f(++_0x342593);}(_0xda2d,0x102));var _0xdda2=function(_0x3cfe5b,_0x2e919c){_0x3cfe5b=_0x3cfe5b-0x0;var _0x3bdb2a=_0xda2d[_0x3cfe5b];return _0x3bdb2a;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var logger=require(_0xdda2('0x1'))(_0xdda2('0x2'));var moment=require(_0xdda2('0x3'));var BPromise=require(_0xdda2('0x4'));var rp=require('request-promise');var attributes=require('./disposition.attributes');module['exports']=function(_0x357e97,_0x319129){return _0x357e97[_0xdda2('0x5')](_0xdda2('0x6'),attributes,{'tableName':_0xdda2('0x7'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xdda2('0x8'),'fields':[_0xdda2('0x9'),_0xdda2('0xa')]},{'unique':!![],'name':_0xdda2('0xb'),'fields':[_0xdda2('0x9'),'ChatWebsiteId']},{'unique':!![],'name':_0xdda2('0xc'),'fields':[_0xdda2('0x9'),'MailAccountId']},{'unique':!![],'name':_0xdda2('0xd'),'fields':[_0xdda2('0x9'),_0xdda2('0xe')]},{'unique':!![],'name':_0xdda2('0xf'),'fields':[_0xdda2('0x9'),_0xdda2('0x10')]},{'unique':!![],'name':_0xdda2('0x11'),'fields':[_0xdda2('0x9'),'OpenchannelAccountId']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x57ca=['moment','bluebird','request-promise','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId','name_fax','name_openchannel','OpenchannelAccountId','util','../../config/logger'];(function(_0x41bdd4,_0x3d5c76){var _0x5c03a6=function(_0x59634a){while(--_0x59634a){_0x41bdd4['push'](_0x41bdd4['shift']());}};_0x5c03a6(++_0x3d5c76);}(_0x57ca,0x108));var _0xa57c=function(_0xd952af,_0x23eeb3){_0xd952af=_0xd952af-0x0;var _0x541e72=_0x57ca[_0xd952af];return _0x541e72;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var logger=require(_0xa57c('0x1'))('api');var moment=require(_0xa57c('0x2'));var BPromise=require(_0xa57c('0x3'));var rp=require(_0xa57c('0x4'));var attributes=require(_0xa57c('0x5'));module[_0xa57c('0x6')]=function(_0x48be2d,_0x40ba22){return _0x48be2d[_0xa57c('0x7')](_0xa57c('0x8'),attributes,{'tableName':_0xa57c('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xa57c('0xa'),'fields':[_0xa57c('0xb'),_0xa57c('0xc')]},{'unique':!![],'name':_0xa57c('0xd'),'fields':['name',_0xa57c('0xe')]},{'unique':!![],'name':'name_mail','fields':[_0xa57c('0xb'),_0xa57c('0xf')]},{'unique':!![],'name':'name_sms','fields':[_0xa57c('0xb'),'SmsAccountId']},{'unique':!![],'name':_0xa57c('0x10'),'fields':[_0xa57c('0xb'),'FaxAccountId']},{'unique':!![],'name':_0xa57c('0x11'),'fields':['name',_0xa57c('0x12')]}],'timestamps':!![]});};
\ No newline at end of file
index 3a1bc36..dbb4028 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd914=['Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info'];(function(_0x561f25,_0x2d95c1){var _0x150e4c=function(_0x266e99){while(--_0x266e99){_0x561f25['push'](_0x561f25['shift']());}};_0x150e4c(++_0x2d95c1);}(_0xd914,0x17f));var _0x4d91=function(_0x2067e9,_0x5e6a97){_0x2067e9=_0x2067e9-0x0;var _0x280ce4=_0xd914[_0x2067e9];return _0x280ce4;};'use strict';var _=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var moment=require('moment');var BPromise=require(_0x4d91('0x2'));var rs=require(_0x4d91('0x3'));var fs=require('fs');var db=require(_0x4d91('0x4'))['db'];var utils=require(_0x4d91('0x5'));var logger=require(_0x4d91('0x6'))(_0x4d91('0x7'));var config=require('../../config/environment');var jayson=require(_0x4d91('0x8'));var client=jayson['client'][_0x4d91('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42d7ae,_0x175ce3,_0x27c0d5){return new BPromise(function(_0x22f2a4,_0x150767){return client[_0x4d91('0xa')](_0x42d7ae,_0x27c0d5)[_0x4d91('0xb')](function(_0x4de4f9){logger[_0x4d91('0xc')](_0x4d91('0xd'),_0x175ce3,_0x4d91('0xe'));logger[_0x4d91('0xf')](_0x4d91('0x10'),_0x175ce3,_0x4d91('0xe'),JSON['stringify'](_0x4de4f9));if(_0x4de4f9['error']){if(_0x4de4f9[_0x4d91('0x11')][_0x4d91('0x12')]===0x1f4){logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x175ce3,_0x4de4f9[_0x4d91('0x11')][_0x4d91('0x13')]);return _0x150767(_0x4de4f9['error']['message']);}logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x175ce3,_0x4de4f9[_0x4d91('0x11')][_0x4d91('0x13')]);return _0x22f2a4(_0x4de4f9[_0x4d91('0x11')][_0x4d91('0x13')]);}else{logger[_0x4d91('0xc')]('Disposition,\x20%s,\x20%s',_0x175ce3,_0x4d91('0xe'));_0x22f2a4(_0x4de4f9[_0x4d91('0x14')][_0x4d91('0x13')]);}})[_0x4d91('0x15')](function(_0x280e80){logger['error'](_0x4d91('0xd'),_0x175ce3,_0x280e80);_0x150767(_0x280e80);});});}
\ No newline at end of file
+var _0xcf66=['client','http','request','then','debug','request\x20sent','stringify','error','message','Disposition,\x20%s,\x20%s','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xcf66,0x71));var _0x6cf6=function(_0x2b2e73,_0x33ba49){_0x2b2e73=_0x2b2e73-0x0;var _0x3da79c=_0xcf66[_0x2b2e73];return _0x3da79c;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var moment=require(_0x6cf6('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cf6('0x3'));var fs=require('fs');var db=require(_0x6cf6('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6cf6('0x5'));var config=require(_0x6cf6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6cf6('0x7')][_0x6cf6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a573e,_0x5eb082,_0x94c6a9){return new BPromise(function(_0x308d0d,_0x36b892){return client[_0x6cf6('0x9')](_0x2a573e,_0x94c6a9)[_0x6cf6('0xa')](function(_0x8a30f1){logger['info']('Disposition,\x20%s,\x20%s',_0x5eb082,'request\x20sent');logger[_0x6cf6('0xb')]('Disposition,\x20%s,\x20%s,\x20%s',_0x5eb082,_0x6cf6('0xc'),JSON[_0x6cf6('0xd')](_0x8a30f1));if(_0x8a30f1[_0x6cf6('0xe')]){if(_0x8a30f1[_0x6cf6('0xe')]['code']===0x1f4){logger['error']('Disposition,\x20%s,\x20%s',_0x5eb082,_0x8a30f1[_0x6cf6('0xe')][_0x6cf6('0xf')]);return _0x36b892(_0x8a30f1[_0x6cf6('0xe')][_0x6cf6('0xf')]);}logger[_0x6cf6('0xe')](_0x6cf6('0x10'),_0x5eb082,_0x8a30f1['error'][_0x6cf6('0xf')]);return _0x308d0d(_0x8a30f1['error'][_0x6cf6('0xf')]);}else{logger[_0x6cf6('0x11')]('Disposition,\x20%s,\x20%s',_0x5eb082,_0x6cf6('0xc'));_0x308d0d(_0x8a30f1[_0x6cf6('0x12')][_0x6cf6('0xf')]);}})[_0x6cf6('0x13')](function(_0x2b6d7b){logger[_0x6cf6('0xe')](_0x6cf6('0x10'),_0x5eb082,_0x2b6d7b);_0x36b892(_0x2b6d7b);});});}
\ No newline at end of file
index 5f2f75c..274505d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaa6=['util','path','express','Router','../../components/interaction/service','./disposition.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer'];(function(_0x514bdb,_0xc80816){var _0x3b6ce4=function(_0x435443){while(--_0x435443){_0x514bdb['push'](_0x514bdb['shift']());}};_0x3b6ce4(++_0xc80816);}(_0xcaa6,0x1a8));var _0x6caa=function(_0x1ea897,_0x4c45e1){_0x1ea897=_0x1ea897-0x0;var _0x16a13e=_0xcaa6[_0x1ea897];return _0x16a13e;};'use strict';var multer=require(_0x6caa('0x0'));var util=require(_0x6caa('0x1'));var path=require(_0x6caa('0x2'));var express=require(_0x6caa('0x3'));var router=express[_0x6caa('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6caa('0x5'));var config=require('../../config/environment');var controller=require(_0x6caa('0x6'));router[_0x6caa('0x7')]('/',auth[_0x6caa('0x8')](),controller[_0x6caa('0x9')]);router['get']('/:id',auth[_0x6caa('0x8')](),controller[_0x6caa('0xa')]);router[_0x6caa('0xb')]('/',auth[_0x6caa('0x8')](),controller[_0x6caa('0xc')]);router['put'](_0x6caa('0xd'),auth[_0x6caa('0x8')](),controller['update']);router[_0x6caa('0xe')](_0x6caa('0xd'),auth[_0x6caa('0x8')](),controller[_0x6caa('0xf')]);module[_0x6caa('0x10')]=router;
\ No newline at end of file
+var _0xf0bf=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','index','/:id','show','post','create','put','update','exports'];(function(_0x2fde91,_0x33425c){var _0x5a99c1=function(_0x4b29bf){while(--_0x4b29bf){_0x2fde91['push'](_0x2fde91['shift']());}};_0x5a99c1(++_0x33425c);}(_0xf0bf,0x100));var _0xff0b=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xf0bf[_0x2aecb2];return _0x3ebb80;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xff0b('0x0'));var express=require(_0xff0b('0x1'));var router=express[_0xff0b('0x2')]();var auth=require(_0xff0b('0x3'));var interaction=require(_0xff0b('0x4'));var config=require(_0xff0b('0x5'));var controller=require(_0xff0b('0x6'));router['get']('/',auth[_0xff0b('0x7')](),controller[_0xff0b('0x8')]);router['get'](_0xff0b('0x9'),auth[_0xff0b('0x7')](),controller[_0xff0b('0xa')]);router[_0xff0b('0xb')]('/',auth[_0xff0b('0x7')](),controller[_0xff0b('0xc')]);router[_0xff0b('0xd')](_0xff0b('0x9'),auth[_0xff0b('0x7')](),controller[_0xff0b('0xe')]);router['delete'](_0xff0b('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xff0b('0xf')]=router;
\ No newline at end of file
index 9cf97e3..8b9353d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0427=['INTEGER','DADHI','KHOMP','SIP','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','4800','7200','9600','12000','14400','2400','v17,v27,v29'];(function(_0x3c935a,_0x521067){var _0x46a29c=function(_0x354762){while(--_0x354762){_0x3c935a['push'](_0x3c935a['shift']());}};_0x46a29c(++_0x521067);}(_0x0427,0x137));var _0x7042=function(_0x582e0e,_0x2ccff7){_0x582e0e=_0x582e0e-0x0;var _0x10d988=_0x0427[_0x582e0e];return _0x10d988;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7042('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7042('0x0')]},'ecm':{'type':Sequelize['ENUM'](_0x7042('0x1'),'no'),'defaultValue':_0x7042('0x1')},'headerinfo':{'type':Sequelize[_0x7042('0x0')],'defaultValue':_0x7042('0x2')},'localstationid':{'type':Sequelize[_0x7042('0x0')],'unique':_0x7042('0x3')},'minrate':{'type':Sequelize[_0x7042('0x4')]('2400',_0x7042('0x5'),_0x7042('0x6'),_0x7042('0x7'),_0x7042('0x8'),_0x7042('0x9')),'defaultValue':_0x7042('0x5')},'maxrate':{'type':Sequelize[_0x7042('0x4')](_0x7042('0xa'),_0x7042('0x5'),'7200',_0x7042('0x7'),'12000','14400'),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x7042('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x7042('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x7042('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x7042('0x4')]('SIP','IAX',_0x7042('0xd'),_0x7042('0xe')),'defaultValue':_0x7042('0xf')},'key':{'type':Sequelize[_0x7042('0x0')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7042('0x10')],'defaultValue':function(){return _0x7042('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7042('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7042('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7042('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7042('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7042('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c}};
\ No newline at end of file
+var _0xf6e8=['7200','9600','12000','14400','2400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800'];(function(_0x425b19,_0x2dcf14){var _0x15ecab=function(_0x317d46){while(--_0x317d46){_0x425b19['push'](_0x425b19['shift']());}};_0x15ecab(++_0x2dcf14);}(_0xf6e8,0xc1));var _0x8f6e=function(_0x4dd5d0,_0x582d07){_0x4dd5d0=_0x4dd5d0-0x0;var _0x5d2f7a=_0xf6e8[_0x4dd5d0];return _0x5d2f7a;};'use strict';var Sequelize=require('sequelize');module[_0x8f6e('0x0')]={'name':{'type':Sequelize[_0x8f6e('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8f6e('0x1')]},'ecm':{'type':Sequelize[_0x8f6e('0x2')](_0x8f6e('0x3'),'no'),'defaultValue':_0x8f6e('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x8f6e('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x8f6e('0x5')},'minrate':{'type':Sequelize[_0x8f6e('0x2')]('2400',_0x8f6e('0x6'),_0x8f6e('0x7'),_0x8f6e('0x8'),_0x8f6e('0x9'),_0x8f6e('0xa')),'defaultValue':_0x8f6e('0x6')},'maxrate':{'type':Sequelize[_0x8f6e('0x2')](_0x8f6e('0xb'),_0x8f6e('0x6'),_0x8f6e('0x7'),'9600',_0x8f6e('0x9'),_0x8f6e('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x8f6e('0x1')],'defaultValue':_0x8f6e('0xc')},'gateway':{'type':Sequelize[_0x8f6e('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x8f6e('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x8f6e('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x8f6e('0x2')](_0x8f6e('0xe'),_0x8f6e('0xf'),_0x8f6e('0x10'),_0x8f6e('0x11')),'defaultValue':_0x8f6e('0xe')},'key':{'type':Sequelize[_0x8f6e('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8f6e('0x12')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x8f6e('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8f6e('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8f6e('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8f6e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8f6e('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c}};
\ No newline at end of file
index 739dc47..2e4bbf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['app','type','system','description','Fax\x20Extension','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','get','VoiceExtension','updateAccountApplications','transaction','tech','key','updatedAt','TrunkId','ListId','findById','findOne','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','format','fax','List\x20not\x20found','Send\x20Fax\x20failed','user','filename','Messages','spread','out','ContactId','dataValues','SendFax','info','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/parsers/qs','api','../../config/utils','../../mysqldb','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','FaxAccount','rawAttributes','model','query','dateStart','dateEnd','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','add','day','merge','filter','options','includeAll','include','catch','params','keys','length','create','body','find','describe','addDisposition','FaxAccountId','getDispositions','map','Disposition','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','fullname','Tag','Tags','color','tag','sequelize','FaxApplication','destroy','bulkCreate','getApplications','context','from-voip-provider','localstationid'];(function(_0x231055,_0xe23510){var _0xe51be3=function(_0x1a9cdd){while(--_0x1a9cdd){_0x231055['push'](_0x231055['shift']());}};_0xe51be3(++_0xe23510);}(_0xedd9,0xfc));var _0x9edd=function(_0xf4e057,_0x49a332){_0xf4e057=_0xf4e057-0x0;var _0x9bd165=_0xedd9[_0xf4e057];return _0x9bd165;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');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('0xa'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var qs=require(_0x9edd('0x10'));var logger=require('../../config/logger')(_0x9edd('0x11'));var utils=require(_0x9edd('0x12'));var config=require('../../config/environment');var db=require(_0x9edd('0x13'))['db'];var socket=require(_0x9edd('0x14'))({'host':'localhost','port':0x18eb});require(_0x9edd('0x15'))[_0x9edd('0x16')](socket);var jayson=require(_0x9edd('0x17'));var client=jayson[_0x9edd('0x18')][_0x9edd('0x19')]({'port':0x232c});var client9002=jayson[_0x9edd('0x18')][_0x9edd('0x19')]({'port':0x232a});function respondWithRpcPromise(_0xef5498,_0x47eb64,_0x176bfa,_0x44fc7c){return new BPromise(function(_0x891832,_0x4d9a7){var _0x13b6b6=_0x44fc7c||client;return _0x13b6b6[_0x9edd('0x1a')](_0xef5498,_0x176bfa)[_0x9edd('0x1b')](function(_0x75a4ab){logger['info'](_0x9edd('0x1c'),_0x47eb64,_0x9edd('0x1d'));logger[_0x9edd('0x1e')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x47eb64,_0x9edd('0x1d'),JSON[_0x9edd('0x1f')](_0x75a4ab));if(_0x75a4ab[_0x9edd('0x20')]){if(_0x75a4ab['error'][_0x9edd('0x21')]===0x1f4){logger['error'](_0x9edd('0x1c'),_0x47eb64,_0x75a4ab[_0x9edd('0x20')]['message']);return _0x4d9a7(_0x75a4ab['error'][_0x9edd('0x22')]);}logger['error'](_0x9edd('0x1c'),_0x47eb64,_0x75a4ab['error']['message']);return _0x891832(_0x75a4ab[_0x9edd('0x20')][_0x9edd('0x22')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x47eb64,_0x9edd('0x1d'));_0x891832(_0x75a4ab[_0x9edd('0x23')][_0x9edd('0x22')]);}})['catch'](function(_0x3741c8){logger[_0x9edd('0x20')](_0x9edd('0x1c'),_0x47eb64,_0x3741c8);_0x4d9a7(_0x3741c8);});});}function respondWithStatusCode(_0x2ca65f,_0x339a0d){_0x339a0d=_0x339a0d||0xcc;return function(_0x4c75d2){if(_0x4c75d2){return _0x2ca65f[_0x9edd('0x24')](_0x339a0d);}return _0x2ca65f[_0x9edd('0x25')](_0x339a0d)[_0x9edd('0x26')]();};}function respondWithResult(_0x2f9f86,_0x310a4d){_0x310a4d=_0x310a4d||0xc8;return function(_0x4d507f){if(_0x4d507f){return _0x2f9f86['status'](_0x310a4d)[_0x9edd('0x27')](_0x4d507f);}};}function respondWithFilteredResult(_0xfeca7b,_0x8d67aa){return function(_0x25e135){if(_0x25e135){var _0x3c2227=_0x25e135[_0x9edd('0x28')],_0x4fe471=_0x8d67aa[_0x9edd('0x29')],_0x57a2cc=_0x8d67aa['offset']+_0x8d67aa[_0x9edd('0x2a')],_0x214d0a;if(_0x57a2cc>=_0x3c2227){_0x57a2cc=_0x3c2227;_0x214d0a=0xc8;}else{_0x214d0a=0xce;}_0xfeca7b[_0x9edd('0x25')](_0x214d0a);return _0xfeca7b[_0x9edd('0x2b')](_0x9edd('0x2c'),_0x4fe471+'-'+_0x57a2cc+'/'+_0x3c2227)['json'](_0x25e135);}return null;};}function patchUpdates(_0x2155a1){return function(_0x3fb556){try{jsonpatch[_0x9edd('0x2d')](_0x3fb556,_0x2155a1,!![]);}catch(_0x12c1bc){return BPromise[_0x9edd('0x2e')](_0x12c1bc);}return _0x3fb556[_0x9edd('0x2f')]();};}function saveUpdates(_0x209aba,_0x1fba7b){return function(_0x19b6c1){if(_0x19b6c1){return _0x19b6c1[_0x9edd('0x30')](_0x209aba)[_0x9edd('0x1b')](function(_0x138002){return _0x138002;});}return null;};}function removeEntity(_0x6907a5,_0xa55906){return function(_0x1a6c23){if(_0x1a6c23){return _0x1a6c23['destroy']()[_0x9edd('0x1b')](function(){_0x6907a5[_0x9edd('0x25')](0xcc)[_0x9edd('0x26')]();});}};}function handleEntityNotFound(_0x5d1707,_0x2d2f88){return function(_0x3990fb){if(!_0x3990fb){_0x5d1707[_0x9edd('0x24')](0x194);}return _0x3990fb;};}function handleError(_0x38a7be,_0x21bc30){_0x21bc30=_0x21bc30||0x1f4;return function(_0x2bc4ed){logger[_0x9edd('0x20')](_0x2bc4ed[_0x9edd('0x31')]);if(_0x2bc4ed[_0x9edd('0x32')]){delete _0x2bc4ed[_0x9edd('0x32')];}_0x38a7be[_0x9edd('0x25')](_0x21bc30)[_0x9edd('0x33')](_0x2bc4ed);};}exports[_0x9edd('0x34')]=function(_0x14f780,_0x5757fc){var _0x37fcb2={},_0x5ed62d={},_0x968303={'count':0x0,'rows':[]};var _0x148630=db[_0x9edd('0x35')][_0x9edd('0x36')];_0x5ed62d[_0x9edd('0x37')]=_['keys'](_0x148630);var _0x6de835={'dateStart':_0x14f780[_0x9edd('0x38')][_0x9edd('0x39')],'dateEnd':_0x14f780[_0x9edd('0x38')][_0x9edd('0x3a')]};delete _0x14f780[_0x9edd('0x38')][_0x9edd('0x39')];delete _0x14f780[_0x9edd('0x38')][_0x9edd('0x3a')];_0x5ed62d[_0x9edd('0x38')]=_['keys'](_0x14f780[_0x9edd('0x38')]);_0x5ed62d['filters']=_[_0x9edd('0x3b')](_0x5ed62d['model'],_0x5ed62d[_0x9edd('0x38')]);_0x37fcb2[_0x9edd('0x3c')]=_[_0x9edd('0x3b')](_0x5ed62d['model'],qs[_0x9edd('0x3d')](_0x14f780[_0x9edd('0x38')][_0x9edd('0x3d')]));_0x37fcb2['attributes']=_0x37fcb2[_0x9edd('0x3c')]['length']?_0x37fcb2[_0x9edd('0x3c')]:_0x5ed62d[_0x9edd('0x37')];if(!_0x14f780['query'][_0x9edd('0x3e')](_0x9edd('0x3f'))){_0x37fcb2[_0x9edd('0x2a')]=qs[_0x9edd('0x2a')](_0x14f780['query'][_0x9edd('0x2a')]);_0x37fcb2['offset']=qs[_0x9edd('0x29')](_0x14f780[_0x9edd('0x38')]['offset']);}_0x37fcb2[_0x9edd('0x40')]=qs['sort'](_0x14f780['query'][_0x9edd('0x41')]);_0x37fcb2[_0x9edd('0x42')]=qs[_0x9edd('0x43')](_[_0x9edd('0x44')](_0x14f780[_0x9edd('0x38')],_0x5ed62d[_0x9edd('0x43')]));if(_0x6de835[_0x9edd('0x39')]){if(_0x6de835[_0x9edd('0x3a')]){_0x6de835[_0x9edd('0x3a')]=moment(_0x6de835[_0x9edd('0x3a')])[_0x9edd('0x45')](0x1,_0x9edd('0x46'));}else{_0x6de835[_0x9edd('0x3a')]=moment(_0x6de835[_0x9edd('0x39')])[_0x9edd('0x45')](0x1,'day');}_[_0x9edd('0x47')](_0x37fcb2[_0x9edd('0x42')],{'createdAt':{'$gte':_0x6de835[_0x9edd('0x39')],'$lte':_0x6de835[_0x9edd('0x3a')]}});}if(_0x14f780[_0x9edd('0x38')][_0x9edd('0x48')]){_0x37fcb2[_0x9edd('0x42')]=_['merge'](_0x37fcb2['where'],{'$or':_['map'](_0x37fcb2[_0x9edd('0x3c')],function(_0x58a1dd){var _0x8b1fdb={};_0x8b1fdb[_0x58a1dd]={'$like':'%'+_0x14f780[_0x9edd('0x38')][_0x9edd('0x48')]+'%'};return _0x8b1fdb;})});}_0x37fcb2=_[_0x9edd('0x47')]({},_0x37fcb2,_0x14f780[_0x9edd('0x49')]);var _0x53005b={'where':_0x37fcb2[_0x9edd('0x42')]};return db[_0x9edd('0x35')][_0x9edd('0x28')](_0x53005b)['then'](function(_0x3626bc){_0x968303[_0x9edd('0x28')]=_0x3626bc;if(_0x14f780[_0x9edd('0x38')][_0x9edd('0x4a')]){_0x37fcb2[_0x9edd('0x4b')]=[{'all':!![]}];}return db[_0x9edd('0x35')]['findAll'](_0x37fcb2);})[_0x9edd('0x1b')](function(_0x237e91){_0x968303['rows']=_0x237e91;return _0x968303;})[_0x9edd('0x1b')](respondWithFilteredResult(_0x5757fc,_0x37fcb2))[_0x9edd('0x4c')](handleError(_0x5757fc,null));};exports['show']=function(_0x2bd089,_0x8134cd){var _0x468239={'raw':![],'where':{'id':_0x2bd089[_0x9edd('0x4d')]['id']}},_0x5215b0={};_0x5215b0[_0x9edd('0x37')]=_[_0x9edd('0x4e')](db[_0x9edd('0x35')]['rawAttributes']);_0x5215b0[_0x9edd('0x38')]=_[_0x9edd('0x4e')](_0x2bd089[_0x9edd('0x38')]);_0x5215b0['filters']=_[_0x9edd('0x3b')](_0x5215b0[_0x9edd('0x37')],_0x5215b0['query']);_0x468239[_0x9edd('0x3c')]=_['intersection'](_0x5215b0[_0x9edd('0x37')],qs[_0x9edd('0x3d')](_0x2bd089[_0x9edd('0x38')][_0x9edd('0x3d')]));_0x468239[_0x9edd('0x3c')]=_0x468239[_0x9edd('0x3c')][_0x9edd('0x4f')]?_0x468239[_0x9edd('0x3c')]:_0x5215b0[_0x9edd('0x37')];if(_0x2bd089[_0x9edd('0x38')][_0x9edd('0x4a')]){_0x468239['include']=[{'all':!![]}];}_0x468239=_[_0x9edd('0x47')]({},_0x468239,_0x2bd089[_0x9edd('0x49')]);return db[_0x9edd('0x35')]['find'](_0x468239)[_0x9edd('0x1b')](handleEntityNotFound(_0x8134cd,null))['then'](respondWithResult(_0x8134cd,null))['catch'](handleError(_0x8134cd,null));};exports['create']=function(_0x1348a7,_0x45f47c){return db[_0x9edd('0x35')][_0x9edd('0x50')](_0x1348a7['body'],{})['then'](respondWithResult(_0x45f47c,0xc9))['catch'](handleError(_0x45f47c,null));};exports[_0x9edd('0x30')]=function(_0x5f666b,_0xd5090a){if(_0x5f666b[_0x9edd('0x51')]['id']){delete _0x5f666b[_0x9edd('0x51')]['id'];}return db[_0x9edd('0x35')][_0x9edd('0x52')]({'where':{'id':_0x5f666b[_0x9edd('0x4d')]['id']}})['then'](handleEntityNotFound(_0xd5090a,null))[_0x9edd('0x1b')](saveUpdates(_0x5f666b['body'],null))[_0x9edd('0x1b')](respondWithResult(_0xd5090a,null))[_0x9edd('0x4c')](handleError(_0xd5090a,null));};exports['destroy']=function(_0x22b91a,_0x322359){return db[_0x9edd('0x35')]['find']({'where':{'id':_0x22b91a[_0x9edd('0x4d')]['id']}})[_0x9edd('0x1b')](handleEntityNotFound(_0x322359,null))[_0x9edd('0x1b')](removeEntity(_0x322359,null))[_0x9edd('0x4c')](handleError(_0x322359,null));};exports[_0x9edd('0x53')]=function(_0x2c3173,_0x53f55b){return db['FaxAccount'][_0x9edd('0x53')]()['then'](respondWithResult(_0x53f55b,null))[_0x9edd('0x4c')](handleError(_0x53f55b,null));};exports[_0x9edd('0x54')]=function(_0x439083,_0x17d2f2,_0x5df1d7){if(_0x439083[_0x9edd('0x51')]['id']){delete _0x439083['body']['id'];}return db[_0x9edd('0x35')][_0x9edd('0x52')]({'where':{'id':_0x439083[_0x9edd('0x4d')]['id']}})['then'](handleEntityNotFound(_0x17d2f2,null))[_0x9edd('0x1b')](function(_0x57da5b){if(_0x57da5b){_0x439083[_0x9edd('0x51')][_0x9edd('0x55')]=_0x57da5b['id'];return db['Disposition'][_0x9edd('0x50')](_0x439083['body']);}})[_0x9edd('0x1b')](respondWithResult(_0x17d2f2,null))[_0x9edd('0x4c')](handleError(_0x17d2f2,null));};exports[_0x9edd('0x56')]=function(_0x50f4fc,_0x4181b9,_0x321485){var _0x45c17d={'raw':![],'where':{}};var _0x2015fc={};var _0x467512={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x50f4fc[_0x9edd('0x4d')]['id']}})[_0x9edd('0x1b')](handleEntityNotFound(_0x4181b9,null))['then'](function(_0x5496e9){if(_0x5496e9){_0x2015fc['model']=_[_0x9edd('0x4e')](db['Disposition']['rawAttributes']);_0x2015fc[_0x9edd('0x38')]=_[_0x9edd('0x4e')](_0x50f4fc['query']);_0x2015fc[_0x9edd('0x43')]=_[_0x9edd('0x3b')](_0x2015fc[_0x9edd('0x37')],_0x2015fc['query']);_0x45c17d[_0x9edd('0x3c')]=_['intersection'](_0x2015fc[_0x9edd('0x37')],qs[_0x9edd('0x3d')](_0x50f4fc['query'][_0x9edd('0x3d')]));_0x45c17d[_0x9edd('0x3c')]=_0x45c17d['attributes'][_0x9edd('0x4f')]?_0x45c17d[_0x9edd('0x3c')]:_0x2015fc[_0x9edd('0x37')];if(!_0x50f4fc[_0x9edd('0x38')]['hasOwnProperty'](_0x9edd('0x3f'))){_0x45c17d['limit']=qs[_0x9edd('0x2a')](_0x50f4fc[_0x9edd('0x38')][_0x9edd('0x2a')]);_0x45c17d['offset']=qs[_0x9edd('0x29')](_0x50f4fc[_0x9edd('0x38')][_0x9edd('0x29')]);}_0x45c17d[_0x9edd('0x40')]=qs[_0x9edd('0x41')](_0x50f4fc[_0x9edd('0x38')][_0x9edd('0x41')]);_0x45c17d['where']=qs['filters'](_[_0x9edd('0x44')](_0x50f4fc[_0x9edd('0x38')],_0x2015fc[_0x9edd('0x43')]));_0x45c17d[_0x9edd('0x42')][_0x9edd('0x55')]=_0x5496e9['id'];if(_0x50f4fc['query'][_0x9edd('0x48')]){_0x45c17d[_0x9edd('0x42')]=_[_0x9edd('0x47')](_0x45c17d['where'],{'$or':_[_0x9edd('0x57')](_0x45c17d[_0x9edd('0x3c')],function(_0x4b1c12){var _0x3f3093={};_0x3f3093[_0x4b1c12]={'$like':'%'+_0x50f4fc[_0x9edd('0x38')]['filter']+'%'};return _0x3f3093;})});}_0x45c17d=_[_0x9edd('0x47')]({},_0x45c17d,_0x50f4fc[_0x9edd('0x49')]);return db['Disposition'][_0x9edd('0x28')]({'where':_0x45c17d['where']})['then'](function(_0x45c9ef){_0x467512[_0x9edd('0x28')]=_0x45c9ef;if(_0x50f4fc[_0x9edd('0x38')]['includeAll']){_0x45c17d[_0x9edd('0x4b')]=[{'all':!![]}];}return db[_0x9edd('0x58')]['findAll'](_0x45c17d);})[_0x9edd('0x1b')](function(_0x1f55ea){_0x467512[_0x9edd('0x59')]=_0x1f55ea;return _0x467512;});}})[_0x9edd('0x1b')](respondWithFilteredResult(_0x4181b9,_0x45c17d))['catch'](handleError(_0x4181b9,null));};exports['removeDispositions']=function(_0x1129b7,_0x5bb28c,_0x350c15){var _0x2c71ce;return db[_0x9edd('0x35')][_0x9edd('0x52')]({'where':{'id':_0x1129b7[_0x9edd('0x4d')]['id']}})[_0x9edd('0x1b')](handleEntityNotFound(_0x5bb28c,null))[_0x9edd('0x1b')](function(_0x5a4d4b){if(_0x5a4d4b){return _0x5a4d4b[_0x9edd('0x5a')](_0x1129b7['query'][_0x9edd('0x5b')]);}})[_0x9edd('0x1b')](respondWithStatusCode(_0x5bb28c,null))[_0x9edd('0x4c')](handleError(_0x5bb28c,null));};exports[_0x9edd('0x5c')]=function(_0x206131,_0x3e284d,_0x14fa8a){if(_0x206131['body']['id']){delete _0x206131[_0x9edd('0x51')]['id'];}return db[_0x9edd('0x35')]['find']({'where':{'id':_0x206131[_0x9edd('0x4d')]['id']}})[_0x9edd('0x1b')](handleEntityNotFound(_0x3e284d,null))['then'](function(_0x304e56){if(_0x304e56){_0x206131[_0x9edd('0x51')][_0x9edd('0x55')]=_0x304e56['id'];return db['CannedAnswer'][_0x9edd('0x50')](_0x206131[_0x9edd('0x51')]);}})[_0x9edd('0x1b')](respondWithResult(_0x3e284d,null))['catch'](handleError(_0x3e284d,null));};exports['getAnswers']=function(_0x5378ca,_0x56e981,_0x3db9db){var _0x1a6d3d={'raw':![],'where':{}};var _0x179b7f={};var _0x521810={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x5378ca[_0x9edd('0x4d')]['id']}})[_0x9edd('0x1b')](handleEntityNotFound(_0x56e981,null))[_0x9edd('0x1b')](function(_0x35c7d4){if(_0x35c7d4){_0x179b7f[_0x9edd('0x37')]=_[_0x9edd('0x4e')](db[_0x9edd('0x5d')][_0x9edd('0x36')]);_0x179b7f[_0x9edd('0x38')]=_[_0x9edd('0x4e')](_0x5378ca[_0x9edd('0x38')]);_0x179b7f[_0x9edd('0x43')]=_['intersection'](_0x179b7f[_0x9edd('0x37')],_0x179b7f[_0x9edd('0x38')]);_0x1a6d3d[_0x9edd('0x3c')]=_[_0x9edd('0x3b')](_0x179b7f[_0x9edd('0x37')],qs[_0x9edd('0x3d')](_0x5378ca[_0x9edd('0x38')][_0x9edd('0x3d')]));_0x1a6d3d['attributes']=_0x1a6d3d['attributes'][_0x9edd('0x4f')]?_0x1a6d3d['attributes']:_0x179b7f[_0x9edd('0x37')];if(!_0x5378ca['query'][_0x9edd('0x3e')](_0x9edd('0x3f'))){_0x1a6d3d['limit']=qs[_0x9edd('0x2a')](_0x5378ca[_0x9edd('0x38')]['limit']);_0x1a6d3d[_0x9edd('0x29')]=qs[_0x9edd('0x29')](_0x5378ca[_0x9edd('0x38')][_0x9edd('0x29')]);}_0x1a6d3d[_0x9edd('0x40')]=qs['sort'](_0x5378ca[_0x9edd('0x38')][_0x9edd('0x41')]);_0x1a6d3d[_0x9edd('0x42')]=qs[_0x9edd('0x43')](_[_0x9edd('0x44')](_0x5378ca['query'],_0x179b7f['filters']));_0x1a6d3d['where']['FaxAccountId']=_0x35c7d4['id'];if(_0x5378ca['query'][_0x9edd('0x48')]){_0x1a6d3d['where']=_['merge'](_0x1a6d3d[_0x9edd('0x42')],{'$or':_[_0x9edd('0x57')](_0x1a6d3d[_0x9edd('0x3c')],function(_0x10e427){var _0x27785b={};_0x27785b[_0x10e427]={'$like':'%'+_0x5378ca[_0x9edd('0x38')][_0x9edd('0x48')]+'%'};return _0x27785b;})});}_0x1a6d3d=_[_0x9edd('0x47')]({},_0x1a6d3d,_0x5378ca[_0x9edd('0x49')]);return db[_0x9edd('0x5d')]['count']({'where':_0x1a6d3d[_0x9edd('0x42')]})[_0x9edd('0x1b')](function(_0x40df6e){_0x521810[_0x9edd('0x28')]=_0x40df6e;if(_0x5378ca[_0x9edd('0x38')][_0x9edd('0x4a')]){_0x1a6d3d[_0x9edd('0x4b')]=[{'all':!![]}];}return db[_0x9edd('0x5d')]['findAll'](_0x1a6d3d);})['then'](function(_0x401ad3){_0x521810[_0x9edd('0x59')]=_0x401ad3;return _0x521810;});}})[_0x9edd('0x1b')](respondWithFilteredResult(_0x56e981,_0x1a6d3d))[_0x9edd('0x4c')](handleError(_0x56e981,null));};exports[_0x9edd('0x5e')]=function(_0x3d15b5,_0x3e1d46,_0x22590d){var _0x93fef1;return db[_0x9edd('0x35')][_0x9edd('0x52')]({'where':{'id':_0x3d15b5[_0x9edd('0x4d')]['id']}})[_0x9edd('0x1b')](handleEntityNotFound(_0x3e1d46,null))[_0x9edd('0x1b')](function(_0x55bc19){if(_0x55bc19){return _0x55bc19[_0x9edd('0x5e')](_0x3d15b5[_0x9edd('0x38')]['ids']);}})[_0x9edd('0x1b')](respondWithStatusCode(_0x3e1d46,null))[_0x9edd('0x4c')](handleError(_0x3e1d46,null));};exports[_0x9edd('0x5f')]=function(_0x2b4d4c,_0x559503,_0x3429b6){return db[_0x9edd('0x60')][_0x9edd('0x52')]({'where':{'id':_0x2b4d4c[_0x9edd('0x4d')]['id']}})[_0x9edd('0x1b')](handleEntityNotFound(_0x559503,null))['then'](function(_0x2fe939){if(_0x2fe939){return _0x2fe939[_0x9edd('0x5f')](_0x2b4d4c[_0x9edd('0x51')][_0x9edd('0x5b')],_[_0x9edd('0x61')](_0x2b4d4c['body'],['ids','id'])||{});}})[_0x9edd('0x1b')](respondWithResult(_0x559503,null))['catch'](handleError(_0x559503,null));};exports[_0x9edd('0x62')]=function(_0x52308a,_0xe9ab48,_0x82f31a){var _0x39c037={'raw':![],'where':{}};var _0x1c7c84={};var _0x2c7245={'count':0x0,'rows':[]};return db[_0x9edd('0x35')]['findOne']({'where':{'id':_0x52308a[_0x9edd('0x4d')]['id']}})[_0x9edd('0x1b')](handleEntityNotFound(_0xe9ab48,null))[_0x9edd('0x1b')](function(_0x39d6dd){if(_0x39d6dd){_0x1c7c84[_0x9edd('0x37')]=_[_0x9edd('0x4e')](db[_0x9edd('0x60')][_0x9edd('0x36')]);_0x1c7c84['query']=_[_0x9edd('0x4e')](_0x52308a[_0x9edd('0x38')]);_0x1c7c84[_0x9edd('0x43')]=_[_0x9edd('0x3b')](_0x1c7c84[_0x9edd('0x37')],_0x1c7c84[_0x9edd('0x38')]);_0x39c037[_0x9edd('0x3c')]=_[_0x9edd('0x3b')](_0x1c7c84[_0x9edd('0x37')],qs[_0x9edd('0x3d')](_0x52308a[_0x9edd('0x38')][_0x9edd('0x3d')]));_0x39c037[_0x9edd('0x3c')]=_0x39c037[_0x9edd('0x3c')][_0x9edd('0x4f')]?_0x39c037[_0x9edd('0x3c')]:_0x1c7c84[_0x9edd('0x37')];if(!_0x52308a[_0x9edd('0x38')][_0x9edd('0x3e')](_0x9edd('0x3f'))){_0x39c037[_0x9edd('0x2a')]=qs['limit'](_0x52308a[_0x9edd('0x38')]['limit']);_0x39c037['offset']=qs[_0x9edd('0x29')](_0x52308a[_0x9edd('0x38')][_0x9edd('0x29')]);}_0x39c037[_0x9edd('0x40')]=qs[_0x9edd('0x41')](_0x52308a[_0x9edd('0x38')][_0x9edd('0x41')]);_0x39c037[_0x9edd('0x42')]=qs[_0x9edd('0x43')](_[_0x9edd('0x44')](_0x52308a['query'],_0x1c7c84[_0x9edd('0x43')]));_0x39c037[_0x9edd('0x42')]['FaxAccountId']=_0x39d6dd['id'];if(_0x52308a['query'][_0x9edd('0x48')]){_0x39c037[_0x9edd('0x42')]=_[_0x9edd('0x47')](_0x39c037[_0x9edd('0x42')],{'$or':_['map'](_0x39c037['attributes'],function(_0x272623){var _0x5a63db={};_0x5a63db[_0x272623]={'$like':'%'+_0x52308a[_0x9edd('0x38')][_0x9edd('0x48')]+'%'};return _0x5a63db;})});}_0x39c037=_[_0x9edd('0x47')]({},_0x39c037,_0x52308a['options']);return db['FaxInteraction']['count']({'where':_0x39c037[_0x9edd('0x42')]})[_0x9edd('0x1b')](function(_0x7b0fc8){_0x2c7245['count']=_0x7b0fc8;if(_0x52308a[_0x9edd('0x38')][_0x9edd('0x4a')]){_0x39c037['include']=[{'model':db[_0x9edd('0x63')],'as':_0x9edd('0x64'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x9edd('0x32'),_0x9edd('0x65'),'internal'],'required':![]},{'model':db[_0x9edd('0x66')],'as':_0x9edd('0x67'),'attributes':['id','name',_0x9edd('0x68')],'where':_0x52308a['query'][_0x9edd('0x69')]?{'id':_0x52308a[_0x9edd('0x38')][_0x9edd('0x69')]}:undefined,'required':_0x52308a[_0x9edd('0x38')][_0x9edd('0x69')]?!![]:![]}];}return db[_0x9edd('0x60')]['findAll'](_0x39c037);})[_0x9edd('0x1b')](function(_0x22aa2b){_0x2c7245[_0x9edd('0x59')]=_0x22aa2b;return _0x2c7245;});}})['then'](respondWithFilteredResult(_0xe9ab48,_0x39c037))[_0x9edd('0x4c')](handleError(_0xe9ab48,null));};exports['addApplications']=function(_0x24ec69,_0x17e867,_0x25da04){return db[_0x9edd('0x35')]['findOne']({'where':{'id':_0x24ec69['params']['id']}})['then'](handleEntityNotFound(_0x17e867,null))[_0x9edd('0x1b')](function(_0x306d74){if(_0x306d74){return db[_0x9edd('0x6a')]['transaction'](function(_0x41a761){return db[_0x9edd('0x6b')][_0x9edd('0x6c')]({'where':{'FaxAccountId':_0x24ec69[_0x9edd('0x4d')]['id']},'transaction':_0x41a761})[_0x9edd('0x1b')](function(_0x4345eb){var _0x558d0a=_['map'](_0x24ec69[_0x9edd('0x51')],function(_0x47676c){_0x47676c[_0x9edd('0x55')]=_0x24ec69['params']['id'];return _0x47676c;});return db[_0x9edd('0x6b')][_0x9edd('0x6d')](_0x558d0a,{'transaction':_0x41a761});});})[_0x9edd('0x1b')](function(){return db[_0x9edd('0x6b')]['findAndCountAll']({'where':{'FaxAccountId':_0x24ec69[_0x9edd('0x4d')]['id']},'order':'priority'});});}})[_0x9edd('0x1b')](respondWithResult(_0x17e867,null))[_0x9edd('0x4c')](handleError(_0x17e867,null));};exports[_0x9edd('0x6e')]=function(_0x33b798,_0x8f9d01,_0x48c2f2){var _0x3e07f1={};var _0x5a7898={};var _0x521279;var _0x557f5c;return db[_0x9edd('0x35')]['findOne']({'where':{'id':_0x33b798[_0x9edd('0x4d')]['id']}})[_0x9edd('0x1b')](handleEntityNotFound(_0x8f9d01,null))[_0x9edd('0x1b')](function(_0x575377){if(_0x575377){_0x521279=_0x575377;_0x5a7898[_0x9edd('0x37')]=_[_0x9edd('0x4e')](db[_0x9edd('0x6b')][_0x9edd('0x36')]);_0x5a7898[_0x9edd('0x38')]=_[_0x9edd('0x4e')](_0x33b798[_0x9edd('0x38')]);_0x5a7898[_0x9edd('0x43')]=_[_0x9edd('0x3b')](_0x5a7898[_0x9edd('0x37')],_0x5a7898[_0x9edd('0x38')]);_0x3e07f1[_0x9edd('0x3c')]=_[_0x9edd('0x3b')](_0x5a7898[_0x9edd('0x37')],qs[_0x9edd('0x3d')](_0x33b798[_0x9edd('0x38')][_0x9edd('0x3d')]));_0x3e07f1[_0x9edd('0x3c')]=_0x3e07f1[_0x9edd('0x3c')][_0x9edd('0x4f')]?_0x3e07f1[_0x9edd('0x3c')]:_0x5a7898[_0x9edd('0x37')];_0x3e07f1['order']=qs[_0x9edd('0x41')](_0x33b798['query'][_0x9edd('0x41')]);_0x3e07f1[_0x9edd('0x42')]=qs[_0x9edd('0x43')](_[_0x9edd('0x44')](_0x33b798[_0x9edd('0x38')],_0x5a7898['filters']));if(_0x33b798[_0x9edd('0x38')]['filter']){_0x3e07f1[_0x9edd('0x42')]=_[_0x9edd('0x47')](_0x3e07f1[_0x9edd('0x42')],{'$or':_[_0x9edd('0x57')](_0x3e07f1[_0x9edd('0x3c')],function(_0xe8b842){var _0x47a91a={};_0x47a91a[_0xe8b842]={'$like':'%'+_0x33b798[_0x9edd('0x38')][_0x9edd('0x48')]+'%'};return _0x47a91a;})});}_0x3e07f1=_['merge']({},_0x3e07f1,_0x33b798['options']);return _0x521279['getApplications'](_0x3e07f1);}})['then'](function(_0x2a8525){if(_0x2a8525){_0x557f5c=_0x2a8525[_0x9edd('0x4f')];if(!_0x33b798[_0x9edd('0x38')][_0x9edd('0x3e')](_0x9edd('0x3f'))){_0x3e07f1[_0x9edd('0x2a')]=qs[_0x9edd('0x2a')](_0x33b798[_0x9edd('0x38')][_0x9edd('0x2a')]);_0x3e07f1[_0x9edd('0x29')]=qs['offset'](_0x33b798[_0x9edd('0x38')]['offset']);}return _0x521279['getApplications'](_0x3e07f1);}})[_0x9edd('0x1b')](function(_0x2dafd2){if(_0x2dafd2){return _0x2dafd2?{'count':_0x557f5c,'rows':_0x2dafd2}:null;}})[_0x9edd('0x1b')](respondWithResult(_0x8f9d01,null))[_0x9edd('0x4c')](handleError(_0x8f9d01,null));};function Extension(_0x3ee216,_0x4c352e,_0x1895ed,_0x38693b){this[_0x9edd('0x6f')]=_0x9edd('0x70');this['exten']=_0x3ee216[_0x9edd('0x71')];this[_0x9edd('0x72')]=_0x38693b;this[_0x9edd('0x73')]=_0x9edd('0x74');this[_0x9edd('0x75')]=_0x9edd('0x76');this[_0x9edd('0x55')]=_0x3ee216['id'];this[_0x9edd('0x77')]=_0x4c352e;this[_0x9edd('0x78')]=_0x1895ed;}function createExtensionsReciveFax(_0xa8c1f7){var _0x3de56e=0x1;var _0x47fa05=[];_0x47fa05[_0x9edd('0x79')](new Extension(_0xa8c1f7,_0x3de56e,'',_0x9edd('0x7a')));_0x3de56e+=0x1;_0x47fa05[_0x9edd('0x79')](new Extension(_0xa8c1f7,_0x3de56e,_0x9edd('0x7b'),_0x9edd('0x7c')));_0x3de56e+=0x1;for(var _0x312093 in _0xa8c1f7){if(_0xa8c1f7[_0x9edd('0x3e')](_0x312093)&&(_0x312093===_0x9edd('0x7d')||_0x312093==='localstationid'||_0x312093==='gateway'||_0x312093==='faxdetect'||_0x312093===_0x9edd('0x7e')||_0x312093===_0x9edd('0x7f')||_0x312093===_0x9edd('0x80')||_0x312093===_0x9edd('0x81')||_0x312093===_0x9edd('0x82'))){_0x47fa05[_0x9edd('0x79')](new Extension(_0xa8c1f7,_0x3de56e,_0x9edd('0x83')+_0x312093+')='+_0xa8c1f7[_0x312093],_0x9edd('0x7c')));_0x3de56e+=0x1;}}_0x47fa05[_0x9edd('0x79')](new Extension(_0xa8c1f7,_0x3de56e,'6',_0x9edd('0x84')));_0x3de56e+=0x1;_0x47fa05['push'](new Extension(_0xa8c1f7,_0x3de56e,_0x9edd('0x85'),'ReceiveFax'));_0x3de56e=0x0;return _0x47fa05;}exports['addAccountApplications']=function(_0x26fdd7,_0x15ae6,_0x2d2ce9){var _0x55119c;return db['sequelize']['transaction'](function(_0x56bdb9){return db['FaxAccount'][_0x9edd('0x50')](_0x26fdd7[_0x9edd('0x51')],{'transaction':_0x56bdb9})[_0x9edd('0x1b')](function(_0x4d5c03){_0x55119c=_0x4d5c03[_0x9edd('0x86')]({'plain':!![]});return db[_0x9edd('0x87')][_0x9edd('0x6d')](createExtensionsReciveFax(_0x55119c),{'transaction':_0x56bdb9});});})['then'](function(){return _0x55119c;})[_0x9edd('0x1b')](respondWithResult(_0x15ae6,null))['catch'](handleError(_0x15ae6,null));};exports[_0x9edd('0x88')]=function(_0x1a2376,_0xc84fb7,_0x259d33){var _0x5a52e2;return db[_0x9edd('0x6a')][_0x9edd('0x89')](function(_0x499e2a){return db[_0x9edd('0x35')][_0x9edd('0x30')](_0x1a2376[_0x9edd('0x51')],{'where':{'id':_0x1a2376[_0x9edd('0x51')]['id']},'transaction':_0x499e2a})['then'](function(_0x1a57de){return db[_0x9edd('0x87')][_0x9edd('0x6c')]({'where':{'FaxAccountId':_0x1a2376[_0x9edd('0x51')]['id']},'transaction':_0x499e2a})[_0x9edd('0x1b')](function(_0x35d21e){return db[_0x9edd('0x87')]['bulkCreate'](createExtensionsReciveFax(_[_0x9edd('0x61')](_0x1a2376['body'],[_0x9edd('0x8a'),_0x9edd('0x8b'),'createdAt',_0x9edd('0x8c'),_0x9edd('0x8d'),_0x9edd('0x8e')])),{'transaction':_0x499e2a});});});})['then'](function(){return db[_0x9edd('0x35')][_0x9edd('0x8f')](_0x1a2376[_0x9edd('0x51')]['id']);})['then'](respondWithResult(_0xc84fb7,null))[_0x9edd('0x4c')](handleError(_0xc84fb7,null));};exports['getMessages']=function(_0x288ecc,_0x30d03a,_0x169ea7){var _0x20be7d={'raw':!![],'where':{}};var _0x4edeed={};var _0x4843f2={'count':0x0,'rows':[]};return db[_0x9edd('0x35')][_0x9edd('0x90')]({'where':{'id':_0x288ecc[_0x9edd('0x4d')]['id']}})[_0x9edd('0x1b')](handleEntityNotFound(_0x30d03a,null))[_0x9edd('0x1b')](function(_0x4b92fc){if(_0x4b92fc){_0x4edeed[_0x9edd('0x37')]=_[_0x9edd('0x4e')](db[_0x9edd('0x91')][_0x9edd('0x36')]);_0x4edeed[_0x9edd('0x38')]=_[_0x9edd('0x4e')](_0x288ecc[_0x9edd('0x38')]);_0x4edeed[_0x9edd('0x43')]=_[_0x9edd('0x3b')](_0x4edeed[_0x9edd('0x37')],_0x4edeed[_0x9edd('0x38')]);_0x20be7d[_0x9edd('0x3c')]=_[_0x9edd('0x3b')](_0x4edeed['model'],qs[_0x9edd('0x3d')](_0x288ecc[_0x9edd('0x38')][_0x9edd('0x3d')]));_0x20be7d[_0x9edd('0x3c')]=_0x20be7d['attributes'][_0x9edd('0x4f')]?_0x20be7d[_0x9edd('0x3c')]:_0x4edeed[_0x9edd('0x37')];if(!_0x288ecc['query'][_0x9edd('0x3e')]('nolimit')){_0x20be7d['limit']=qs[_0x9edd('0x2a')](_0x288ecc[_0x9edd('0x38')][_0x9edd('0x2a')]);_0x20be7d[_0x9edd('0x29')]=qs['offset'](_0x288ecc[_0x9edd('0x38')][_0x9edd('0x29')]);}_0x20be7d[_0x9edd('0x40')]=qs[_0x9edd('0x41')](_0x288ecc[_0x9edd('0x38')][_0x9edd('0x41')]);_0x20be7d[_0x9edd('0x42')]=qs[_0x9edd('0x43')](_[_0x9edd('0x44')](_0x288ecc[_0x9edd('0x38')],_0x4edeed[_0x9edd('0x43')]));_0x20be7d[_0x9edd('0x42')]['FaxAccountId']=_0x4b92fc['id'];if(_0x288ecc[_0x9edd('0x38')][_0x9edd('0x48')]){_0x20be7d[_0x9edd('0x42')]=_[_0x9edd('0x47')](_0x20be7d[_0x9edd('0x42')],{'$or':_['map'](_0x20be7d[_0x9edd('0x3c')],function(_0x4a4581){var _0x162571={};_0x162571[_0x4a4581]={'$like':'%'+_0x288ecc[_0x9edd('0x38')]['filter']+'%'};return _0x162571;})});}if(_0x288ecc['query'][_0x9edd('0x92')]){var _0x3686c0=_0x288ecc[_0x9edd('0x38')][_0x9edd('0x92')][_0x9edd('0x93')](',');var _0x53535e={};_0x53535e[_0x3686c0[0x0]]={'$gte':moment(_0x3686c0[0x1])['format'](_0x9edd('0x94'))};_0x20be7d[_0x9edd('0x42')]=_[_0x9edd('0x47')](_0x20be7d[_0x9edd('0x42')],_0x53535e);}_0x20be7d=_['merge']({},_0x20be7d,_0x288ecc[_0x9edd('0x49')]);return db[_0x9edd('0x91')][_0x9edd('0x28')]({'where':_0x20be7d[_0x9edd('0x42')]})[_0x9edd('0x1b')](function(_0x264759){_0x4843f2[_0x9edd('0x28')]=_0x264759;if(_0x288ecc['query'][_0x9edd('0x4a')]){_0x20be7d[_0x9edd('0x4b')]=[{'all':!![]}];}return db[_0x9edd('0x91')][_0x9edd('0x95')](_0x20be7d);})[_0x9edd('0x1b')](function(_0x252617){_0x4843f2[_0x9edd('0x59')]=_0x252617;return _0x4843f2;});}})[_0x9edd('0x1b')](respondWithFilteredResult(_0x30d03a,_0x20be7d))[_0x9edd('0x4c')](handleError(_0x30d03a,null));};exports[_0x9edd('0x33')]=function(_0x288bc8,_0x190305,_0xd590){var _0x50bfd5,_0x14ea8f={},_0x32cb87;if(_0x288bc8[_0x9edd('0x51')]['to']){_0x32cb87=_0x288bc8[_0x9edd('0x51')]['to'][0x0];}return db['FaxAccount'][_0x9edd('0x52')]({'where':{'id':_0x288bc8[_0x9edd('0x4d')]['id']},'include':[{'model':db[_0x9edd('0x96')],'as':_0x9edd('0x97'),'include':[{'model':db[_0x9edd('0x63')],'as':_0x9edd('0x98'),'where':{'fax':_0x32cb87},'limit':0x1,'order':[[_0x9edd('0x8c'),_0x9edd('0x99')]]}]}]})[_0x9edd('0x1b')](handleEntityNotFound(_0x190305,null))[_0x9edd('0x1b')](function(_0x304e90){_0x50bfd5=_0x304e90;if(_0x288bc8['body'][_0x9edd('0x9a')]&&_0x288bc8[_0x9edd('0x51')][_0x9edd('0x9a')][_0x9edd('0x4f')]){for(var _0x1aa3e5=0x0;_0x1aa3e5<_0x288bc8[_0x9edd('0x51')][_0x9edd('0x9a')]['length'];_0x1aa3e5+=0x1){_0x288bc8[_0x9edd('0x51')][_0x9edd('0x9a')][_0x1aa3e5]={'filename':_0x288bc8[_0x9edd('0x51')][_0x9edd('0x9a')][_0x1aa3e5][_0x9edd('0x32')],'id':_0x288bc8[_0x9edd('0x51')][_0x9edd('0x9a')][_0x1aa3e5]['id'],'path':path[_0x9edd('0x9b')](config[_0x9edd('0x9c')],_0x9edd('0x9d'),_0x288bc8[_0x9edd('0x51')][_0x9edd('0x9a')][_0x1aa3e5][_0x9edd('0x9e')])};}}return respondWithRpcPromise(_0x9edd('0x9f'),_0x9edd('0x9f'),{'FaxAccountId':_[_0x9edd('0xa0')](_0x288bc8[_0x9edd('0x4d')]['id'])?undefined:_0x288bc8['params']['id'],'path':_[_0x9edd('0xa0')](_0x288bc8[_0x9edd('0x51')][_0x9edd('0x9a')][0x0][_0x9edd('0x8')])?undefined:_0x288bc8[_0x9edd('0x51')][_0x9edd('0x9a')][0x0][_0x9edd('0x8')],'fax':_[_0x9edd('0xa0')](_0x288bc8[_0x9edd('0x51')]['to'][0x0])?undefined:_0x288bc8['body']['to'][0x0]},client9002);})[_0x9edd('0x1b')](function(){if(_0x50bfd5){if(_[_0x9edd('0xa0')](_0x288bc8[_0x9edd('0x51')]['from'])){_0x288bc8[_0x9edd('0x51')]['from']=util[_0x9edd('0xa1')]('\x22%s\x22\x20<%s>',_0x50bfd5[_0x9edd('0x32')],_0x50bfd5[_0x9edd('0xa2')]);}if(_0x50bfd5['List']){if(_0x50bfd5[_0x9edd('0x97')][_0x9edd('0x98')][_0x9edd('0x4f')]){return _0x50bfd5[_0x9edd('0x97')][_0x9edd('0x98')][0x0];}else{return db[_0x9edd('0x63')][_0x9edd('0x50')](_['defaults'](_0x288bc8[_0x9edd('0x51')],{'firstName':_0x288bc8[_0x9edd('0x51')]['to'][0x0],'phone':_0x288bc8['body']['to'][0x0],'fax':_0x288bc8[_0x9edd('0x51')]['to'][0x0],'ListId':_0x50bfd5['ListId']}));}}else{throw new Error(_0x9edd('0xa3'));}}else{throw new Error(_0x9edd('0xa4'));}})[_0x9edd('0x1b')](function(_0x354a19){if(_0x354a19){return db[_0x9edd('0x60')][_0x9edd('0x52')]({'where':{'ContactId':_0x354a19['id'],'closed':![],'FaxAccountId':_0x50bfd5['id']}})[_0x9edd('0x1b')](function(_0xcb1c83){if(_0xcb1c83){return[_0xcb1c83,![]];}return db[_0x9edd('0x60')][_0x9edd('0x50')]({'UserId':_0x288bc8[_0x9edd('0xa5')]['id'],'ContactId':_0x354a19['id'],'FaxAccountId':_0x50bfd5['id'],'fax':_0x288bc8[_0x9edd('0x51')]['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x288bc8[_0x9edd('0x51')],{'read':![],'body':_0x288bc8[_0x9edd('0x51')][_0x9edd('0x9a')][0x0][_0x9edd('0xa6')],'FaxAccountId':_0x50bfd5['id'],'UserId':_0x288bc8[_0x9edd('0xa5')]['id'],'ContactId':_0x354a19['id'],'AttachmentId':_0x288bc8[_0x9edd('0x51')][_0x9edd('0x9a')][0x0]['id']})]},{'include':[{'model':db[_0x9edd('0x91')],'as':_0x9edd('0xa7')}]})['then'](function(_0x1395fa){return[_0x1395fa,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x9edd('0xa8')](function(_0x44c0bb,_0x27a46d){if(_0x27a46d){return _0x44c0bb;}return db[_0x9edd('0x91')][_0x9edd('0x50')]({'direction':_0x9edd('0xa9'),'read':![],'body':_0x288bc8[_0x9edd('0x51')][_0x9edd('0x9a')][0x0][_0x9edd('0xa6')],'FaxAccountId':_0x50bfd5['id'],'FaxInteractionId':_0x44c0bb['id'],'UserId':_0x288bc8[_0x9edd('0xa5')]['id'],'ContactId':_0x44c0bb[_0x9edd('0xaa')],'AttachmentId':_0x288bc8[_0x9edd('0x51')][_0x9edd('0x9a')][0x0]['id']})[_0x9edd('0x1b')](function(_0x19c565){_0x44c0bb[_0x9edd('0xab')][_0x9edd('0xa7')]=[];_0x44c0bb[_0x9edd('0xab')][_0x9edd('0xa7')]['push'](_0x19c565['dataValues']);return _0x44c0bb;});})[_0x9edd('0x1b')](function(_0x4b238c){respondWithRpcPromise(_0x9edd('0xac'),_0x9edd('0xac'),{'FaxAccountId':_[_0x9edd('0xa0')](_0x288bc8[_0x9edd('0x4d')]['id'])?undefined:_0x288bc8['params']['id'],'path':_['isNil'](_0x288bc8[_0x9edd('0x51')][_0x9edd('0x9a')][0x0][_0x9edd('0x8')])?undefined:_0x288bc8[_0x9edd('0x51')][_0x9edd('0x9a')][0x0]['path'],'fax':_[_0x9edd('0xa0')](_0x288bc8['body']['to'][0x0])?undefined:_0x288bc8[_0x9edd('0x51')]['to'][0x0],'AttachmentId':_0x288bc8[_0x9edd('0x51')][_0x9edd('0x9a')][0x0]['id']},client9002)[_0x9edd('0x1b')](function(_0x5c8edb){logger['info']('SendFaxRpc,\x20%s',_0x5c8edb);})[_0x9edd('0x4c')](function(_0x11b5be){logger[_0x9edd('0xad')](_0x9edd('0xae'),_0x11b5be);});return _0x4b238c;})[_0x9edd('0x1b')](respondWithResult(_0x190305,null))[_0x9edd('0x4c')](handleError(_0x190305,null));};exports['addAgents']=function(_0xc602b6,_0x2779a8,_0x56428e){return db['FaxAccount'][_0x9edd('0x52')]({'where':{'id':_0xc602b6[_0x9edd('0x4d')]['id']}})[_0x9edd('0x1b')](handleEntityNotFound(_0x2779a8,null))['then'](function(_0x41314a){if(_0x41314a){return _0x41314a[_0x9edd('0xaf')](_0xc602b6[_0x9edd('0x51')][_0x9edd('0x5b')],_['omit'](_0xc602b6[_0x9edd('0x51')],[_0x9edd('0x5b'),'id'])||{})[_0x9edd('0xa8')](function(_0x18924e){for(var _0x128bc9=0x0;_0x128bc9<_0xc602b6[_0x9edd('0x51')]['ids'][_0x9edd('0x4f')];_0x128bc9+=0x1){socket[_0x9edd('0xb0')](_0x9edd('0xb1'),{'UserId':_0xc602b6[_0x9edd('0x51')]['ids'][_0x128bc9],'FaxAccountId':_0xc602b6['params']['id']});}return _0x18924e;});}})[_0x9edd('0x1b')](respondWithResult(_0x2779a8,null))[_0x9edd('0x4c')](handleError(_0x2779a8,null));};exports[_0x9edd('0xb2')]=function(_0x3e7781,_0xb60994,_0x3b1a81){var _0x457a29;return db[_0x9edd('0x35')][_0x9edd('0x52')]({'where':{'id':_0x3e7781[_0x9edd('0x4d')]['id']}})[_0x9edd('0x1b')](handleEntityNotFound(_0xb60994,null))[_0x9edd('0x1b')](function(_0x591000){if(_0x591000){return _0x591000['removeAgents'](_0x3e7781[_0x9edd('0x38')][_0x9edd('0x5b')])[_0x9edd('0x1b')](function(_0x2ae309){if(_[_0x9edd('0xb3')](_0x3e7781[_0x9edd('0x38')][_0x9edd('0x5b')])){for(var _0x433c19=0x0;_0x433c19<_0x3e7781['query'][_0x9edd('0x5b')][_0x9edd('0x4f')];_0x433c19+=0x1){socket[_0x9edd('0xb0')](_0x9edd('0xb4'),{'UserId':_0x3e7781[_0x9edd('0x38')][_0x9edd('0x5b')][_0x433c19],'FaxAccountId':_0x3e7781['params']['id']});}}else{socket['emit'](_0x9edd('0xb4'),{'UserId':_0x3e7781[_0x9edd('0x38')][_0x9edd('0x5b')],'FaxAccountId':_0x3e7781['params']['id']});}});}})['then'](respondWithStatusCode(_0xb60994,null))[_0x9edd('0x4c')](handleError(_0xb60994,null));};exports[_0x9edd('0xb5')]=function(_0x33250c,_0x324e1f,_0x406c1f){var _0x256ae8={};var _0x21ef56={};var _0x1a6fa2;var _0x18ea0d;return db[_0x9edd('0x35')][_0x9edd('0x90')]({'where':{'id':_0x33250c['params']['id']}})[_0x9edd('0x1b')](handleEntityNotFound(_0x324e1f,null))['then'](function(_0x48275e){if(_0x48275e){_0x1a6fa2=_0x48275e;_0x21ef56['model']=_[_0x9edd('0x4e')](db[_0x9edd('0xb6')]['rawAttributes']);_0x21ef56['query']=_['keys'](_0x33250c['query']);_0x21ef56[_0x9edd('0x43')]=_[_0x9edd('0x3b')](_0x21ef56[_0x9edd('0x37')],_0x21ef56['query']);_0x256ae8[_0x9edd('0x3c')]=_[_0x9edd('0x3b')](_0x21ef56[_0x9edd('0x37')],qs[_0x9edd('0x3d')](_0x33250c[_0x9edd('0x38')]['fields']));_0x256ae8[_0x9edd('0x3c')]=_0x256ae8['attributes'][_0x9edd('0x4f')]?_0x256ae8['attributes']:_0x21ef56[_0x9edd('0x37')];_0x256ae8[_0x9edd('0x40')]=qs[_0x9edd('0x41')](_0x33250c['query'][_0x9edd('0x41')]);_0x256ae8[_0x9edd('0x42')]=qs[_0x9edd('0x43')](_['pick'](_0x33250c['query'],_0x21ef56[_0x9edd('0x43')]));if(_0x33250c[_0x9edd('0x38')][_0x9edd('0x48')]){_0x256ae8[_0x9edd('0x42')]=_[_0x9edd('0x47')](_0x256ae8[_0x9edd('0x42')],{'$or':_[_0x9edd('0x57')](_0x256ae8[_0x9edd('0x3c')],function(_0x17c288){var _0x2ed41c={};_0x2ed41c[_0x17c288]={'$like':'%'+_0x33250c['query'][_0x9edd('0x48')]+'%'};return _0x2ed41c;})});}_0x256ae8=_[_0x9edd('0x47')]({},_0x256ae8,_0x33250c['options']);return _0x1a6fa2['getAgents'](_0x256ae8);}})[_0x9edd('0x1b')](function(_0x44e5f4){if(_0x44e5f4){_0x18ea0d=_0x44e5f4[_0x9edd('0x4f')];if(!_0x33250c[_0x9edd('0x38')]['hasOwnProperty'](_0x9edd('0x3f'))){_0x256ae8[_0x9edd('0x2a')]=qs[_0x9edd('0x2a')](_0x33250c[_0x9edd('0x38')]['limit']);_0x256ae8[_0x9edd('0x29')]=qs[_0x9edd('0x29')](_0x33250c[_0x9edd('0x38')]['offset']);}return _0x1a6fa2[_0x9edd('0xb5')](_0x256ae8);}})[_0x9edd('0x1b')](function(_0x1bc167){if(_0x1bc167){return _0x1bc167?{'count':_0x18ea0d,'rows':_0x1bc167}:null;}})[_0x9edd('0x1b')](respondWithResult(_0x324e1f,null))[_0x9edd('0x4c')](handleError(_0x324e1f,null));};
\ No newline at end of file
+var _0x34e8=['FaxAccount','count','includeAll','include','findAll','rows','show','params','options','create','body','update','find','describe','addDisposition','FaxAccountId','Disposition','findOne','nolimit','map','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','CmContact','Owner','fullname','internal','Tag','Tags','color','tag','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','exten','localstationid','app','type','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','minrate','modem','t38timeout','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','get','VoiceExtension','sequelize','transaction','tech','createdAt','updatedAt','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','defaults','List\x20not\x20found','out','filename','user','Messages','Contact\x20not\x20found','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./faxAccount.socket','register','client','http','request','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','catch','sendStatus','status','json','set','Content-Range','apply','reject','save','then','destroy','end','name','rawAttributes','keys','dateStart','query','dateEnd','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','offset','order','sort','where','pick','add','day','merge','filter'];(function(_0x2dd858,_0x3d6e00){var _0x384b75=function(_0x351aef){while(--_0x351aef){_0x2dd858['push'](_0x2dd858['shift']());}};_0x384b75(++_0x3d6e00);}(_0x34e8,0x12c));var _0x834e=function(_0x2d3cf5,_0x1626bc){_0x2d3cf5=_0x2d3cf5-0x0;var _0x377cc5=_0x34e8[_0x2d3cf5];return _0x377cc5;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var qs=require(_0x834e('0x13'));var logger=require(_0x834e('0x14'))(_0x834e('0x15'));var utils=require(_0x834e('0x16'));var config=require(_0x834e('0x17'));var db=require(_0x834e('0x18'))['db'];var socket=require(_0x834e('0x19'))({'host':_0x834e('0x1a'),'port':0x18eb});require(_0x834e('0x1b'))[_0x834e('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x834e('0x1d')][_0x834e('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x834e('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2d95f2,_0x28e659,_0x21cc0a,_0x50e860){return new BPromise(function(_0x43156c,_0x302cbd){var _0x57274a=_0x50e860||client;return _0x57274a[_0x834e('0x1f')](_0x2d95f2,_0x21cc0a)['then'](function(_0x38a8cd){logger[_0x834e('0x20')]('FaxAccount,\x20%s,\x20%s',_0x28e659,_0x834e('0x21'));logger[_0x834e('0x22')](_0x834e('0x23'),_0x28e659,'request\x20sent',JSON[_0x834e('0x24')](_0x38a8cd));if(_0x38a8cd[_0x834e('0x25')]){if(_0x38a8cd[_0x834e('0x25')][_0x834e('0x26')]===0x1f4){logger[_0x834e('0x25')](_0x834e('0x27'),_0x28e659,_0x38a8cd[_0x834e('0x25')]['message']);return _0x302cbd(_0x38a8cd[_0x834e('0x25')][_0x834e('0x28')]);}logger[_0x834e('0x25')](_0x834e('0x27'),_0x28e659,_0x38a8cd['error'][_0x834e('0x28')]);return _0x43156c(_0x38a8cd[_0x834e('0x25')]['message']);}else{logger[_0x834e('0x20')](_0x834e('0x27'),_0x28e659,_0x834e('0x21'));_0x43156c(_0x38a8cd['result']['message']);}})[_0x834e('0x29')](function(_0x34563b){logger['error'](_0x834e('0x27'),_0x28e659,_0x34563b);_0x302cbd(_0x34563b);});});}function respondWithStatusCode(_0x1dc1e0,_0x58f4fd){_0x58f4fd=_0x58f4fd||0xcc;return function(_0x3bc4f7){if(_0x3bc4f7){return _0x1dc1e0[_0x834e('0x2a')](_0x58f4fd);}return _0x1dc1e0[_0x834e('0x2b')](_0x58f4fd)['end']();};}function respondWithResult(_0x24fcf7,_0x3e310f){_0x3e310f=_0x3e310f||0xc8;return function(_0x5e1cc5){if(_0x5e1cc5){return _0x24fcf7['status'](_0x3e310f)[_0x834e('0x2c')](_0x5e1cc5);}};}function respondWithFilteredResult(_0x508a1d,_0x2826ec){return function(_0x3f1b0b){if(_0x3f1b0b){var _0x3db026=_0x3f1b0b['count'],_0x2cc2eb=_0x2826ec['offset'],_0x3cd928=_0x2826ec['offset']+_0x2826ec['limit'],_0x130cc5;if(_0x3cd928>=_0x3db026){_0x3cd928=_0x3db026;_0x130cc5=0xc8;}else{_0x130cc5=0xce;}_0x508a1d[_0x834e('0x2b')](_0x130cc5);return _0x508a1d[_0x834e('0x2d')](_0x834e('0x2e'),_0x2cc2eb+'-'+_0x3cd928+'/'+_0x3db026)['json'](_0x3f1b0b);}return null;};}function patchUpdates(_0xb5bc06){return function(_0x11f1ce){try{jsonpatch[_0x834e('0x2f')](_0x11f1ce,_0xb5bc06,!![]);}catch(_0x1e026a){return BPromise[_0x834e('0x30')](_0x1e026a);}return _0x11f1ce[_0x834e('0x31')]();};}function saveUpdates(_0x3d149d,_0xfaf716){return function(_0x278db3){if(_0x278db3){return _0x278db3['update'](_0x3d149d)[_0x834e('0x32')](function(_0x5cad11){return _0x5cad11;});}return null;};}function removeEntity(_0x2c75c2,_0x3787b0){return function(_0x9ab921){if(_0x9ab921){return _0x9ab921[_0x834e('0x33')]()[_0x834e('0x32')](function(){_0x2c75c2[_0x834e('0x2b')](0xcc)[_0x834e('0x34')]();});}};}function handleEntityNotFound(_0x38cd29,_0x358c31){return function(_0x12b2bc){if(!_0x12b2bc){_0x38cd29['sendStatus'](0x194);}return _0x12b2bc;};}function handleError(_0x2a3c7f,_0x2f408a){_0x2f408a=_0x2f408a||0x1f4;return function(_0x24a9df){logger[_0x834e('0x25')](_0x24a9df['stack']);if(_0x24a9df[_0x834e('0x35')]){delete _0x24a9df[_0x834e('0x35')];}_0x2a3c7f['status'](_0x2f408a)['send'](_0x24a9df);};}exports['index']=function(_0x3e58fa,_0x41bf4d){var _0x20c6ae={},_0x34fefb={},_0x339e28={'count':0x0,'rows':[]};var _0x1b76dd=db['FaxAccount'][_0x834e('0x36')];_0x34fefb['model']=_[_0x834e('0x37')](_0x1b76dd);var _0x6a3ac={'dateStart':_0x3e58fa['query'][_0x834e('0x38')],'dateEnd':_0x3e58fa[_0x834e('0x39')]['dateEnd']};delete _0x3e58fa['query'][_0x834e('0x38')];delete _0x3e58fa[_0x834e('0x39')][_0x834e('0x3a')];_0x34fefb[_0x834e('0x39')]=_[_0x834e('0x37')](_0x3e58fa['query']);_0x34fefb[_0x834e('0x3b')]=_['intersection'](_0x34fefb['model'],_0x34fefb[_0x834e('0x39')]);_0x20c6ae['attributes']=_[_0x834e('0x3c')](_0x34fefb[_0x834e('0x3d')],qs[_0x834e('0x3e')](_0x3e58fa[_0x834e('0x39')][_0x834e('0x3e')]));_0x20c6ae['attributes']=_0x20c6ae[_0x834e('0x3f')][_0x834e('0x40')]?_0x20c6ae[_0x834e('0x3f')]:_0x34fefb['model'];if(!_0x3e58fa[_0x834e('0x39')][_0x834e('0x41')]('nolimit')){_0x20c6ae[_0x834e('0x42')]=qs['limit'](_0x3e58fa[_0x834e('0x39')][_0x834e('0x42')]);_0x20c6ae['offset']=qs['offset'](_0x3e58fa[_0x834e('0x39')][_0x834e('0x43')]);}_0x20c6ae[_0x834e('0x44')]=qs[_0x834e('0x45')](_0x3e58fa[_0x834e('0x39')][_0x834e('0x45')]);_0x20c6ae[_0x834e('0x46')]=qs['filters'](_[_0x834e('0x47')](_0x3e58fa['query'],_0x34fefb[_0x834e('0x3b')]));if(_0x6a3ac['dateStart']){if(_0x6a3ac[_0x834e('0x3a')]){_0x6a3ac['dateEnd']=moment(_0x6a3ac[_0x834e('0x3a')])[_0x834e('0x48')](0x1,'day');}else{_0x6a3ac[_0x834e('0x3a')]=moment(_0x6a3ac[_0x834e('0x38')])[_0x834e('0x48')](0x1,_0x834e('0x49'));}_[_0x834e('0x4a')](_0x20c6ae[_0x834e('0x46')],{'createdAt':{'$gte':_0x6a3ac[_0x834e('0x38')],'$lte':_0x6a3ac[_0x834e('0x3a')]}});}if(_0x3e58fa[_0x834e('0x39')][_0x834e('0x4b')]){_0x20c6ae['where']=_[_0x834e('0x4a')](_0x20c6ae[_0x834e('0x46')],{'$or':_['map'](_0x20c6ae[_0x834e('0x3f')],function(_0x42fd90){var _0x25b035={};_0x25b035[_0x42fd90]={'$like':'%'+_0x3e58fa[_0x834e('0x39')][_0x834e('0x4b')]+'%'};return _0x25b035;})});}_0x20c6ae=_[_0x834e('0x4a')]({},_0x20c6ae,_0x3e58fa['options']);var _0x59c855={'where':_0x20c6ae[_0x834e('0x46')]};return db[_0x834e('0x4c')][_0x834e('0x4d')](_0x59c855)[_0x834e('0x32')](function(_0x3da408){_0x339e28[_0x834e('0x4d')]=_0x3da408;if(_0x3e58fa[_0x834e('0x39')][_0x834e('0x4e')]){_0x20c6ae[_0x834e('0x4f')]=[{'all':!![]}];}return db[_0x834e('0x4c')][_0x834e('0x50')](_0x20c6ae);})[_0x834e('0x32')](function(_0x1a28f6){_0x339e28[_0x834e('0x51')]=_0x1a28f6;return _0x339e28;})[_0x834e('0x32')](respondWithFilteredResult(_0x41bf4d,_0x20c6ae))[_0x834e('0x29')](handleError(_0x41bf4d,null));};exports[_0x834e('0x52')]=function(_0x32b8f7,_0x420841){var _0x1adf86={'raw':![],'where':{'id':_0x32b8f7[_0x834e('0x53')]['id']}},_0x4cfacd={};_0x4cfacd[_0x834e('0x3d')]=_['keys'](db[_0x834e('0x4c')][_0x834e('0x36')]);_0x4cfacd['query']=_[_0x834e('0x37')](_0x32b8f7[_0x834e('0x39')]);_0x4cfacd[_0x834e('0x3b')]=_[_0x834e('0x3c')](_0x4cfacd[_0x834e('0x3d')],_0x4cfacd[_0x834e('0x39')]);_0x1adf86[_0x834e('0x3f')]=_['intersection'](_0x4cfacd[_0x834e('0x3d')],qs[_0x834e('0x3e')](_0x32b8f7[_0x834e('0x39')][_0x834e('0x3e')]));_0x1adf86[_0x834e('0x3f')]=_0x1adf86[_0x834e('0x3f')][_0x834e('0x40')]?_0x1adf86[_0x834e('0x3f')]:_0x4cfacd['model'];if(_0x32b8f7[_0x834e('0x39')]['includeAll']){_0x1adf86[_0x834e('0x4f')]=[{'all':!![]}];}_0x1adf86=_['merge']({},_0x1adf86,_0x32b8f7[_0x834e('0x54')]);return db['FaxAccount']['find'](_0x1adf86)[_0x834e('0x32')](handleEntityNotFound(_0x420841,null))[_0x834e('0x32')](respondWithResult(_0x420841,null))['catch'](handleError(_0x420841,null));};exports['create']=function(_0x2c8155,_0x2452b4){return db[_0x834e('0x4c')][_0x834e('0x55')](_0x2c8155[_0x834e('0x56')],{})[_0x834e('0x32')](respondWithResult(_0x2452b4,0xc9))[_0x834e('0x29')](handleError(_0x2452b4,null));};exports[_0x834e('0x57')]=function(_0x528e66,_0x142334){if(_0x528e66[_0x834e('0x56')]['id']){delete _0x528e66['body']['id'];}return db[_0x834e('0x4c')]['find']({'where':{'id':_0x528e66[_0x834e('0x53')]['id']}})[_0x834e('0x32')](handleEntityNotFound(_0x142334,null))['then'](saveUpdates(_0x528e66[_0x834e('0x56')],null))[_0x834e('0x32')](respondWithResult(_0x142334,null))[_0x834e('0x29')](handleError(_0x142334,null));};exports[_0x834e('0x33')]=function(_0x5a2924,_0xe35ded){return db[_0x834e('0x4c')][_0x834e('0x58')]({'where':{'id':_0x5a2924['params']['id']}})[_0x834e('0x32')](handleEntityNotFound(_0xe35ded,null))[_0x834e('0x32')](removeEntity(_0xe35ded,null))[_0x834e('0x29')](handleError(_0xe35ded,null));};exports[_0x834e('0x59')]=function(_0x3183c5,_0x125f37){return db[_0x834e('0x4c')][_0x834e('0x59')]()[_0x834e('0x32')](respondWithResult(_0x125f37,null))[_0x834e('0x29')](handleError(_0x125f37,null));};exports[_0x834e('0x5a')]=function(_0x1dfa95,_0x1b7045,_0x1659c8){if(_0x1dfa95[_0x834e('0x56')]['id']){delete _0x1dfa95[_0x834e('0x56')]['id'];}return db[_0x834e('0x4c')][_0x834e('0x58')]({'where':{'id':_0x1dfa95[_0x834e('0x53')]['id']}})[_0x834e('0x32')](handleEntityNotFound(_0x1b7045,null))[_0x834e('0x32')](function(_0x2cb233){if(_0x2cb233){_0x1dfa95['body'][_0x834e('0x5b')]=_0x2cb233['id'];return db[_0x834e('0x5c')][_0x834e('0x55')](_0x1dfa95[_0x834e('0x56')]);}})['then'](respondWithResult(_0x1b7045,null))[_0x834e('0x29')](handleError(_0x1b7045,null));};exports['getDispositions']=function(_0x56a152,_0x2fdb1b,_0x2b1ec7){var _0x1644dd={'raw':![],'where':{}};var _0xe79465={};var _0x216105={'count':0x0,'rows':[]};return db[_0x834e('0x4c')][_0x834e('0x5d')]({'where':{'id':_0x56a152[_0x834e('0x53')]['id']}})['then'](handleEntityNotFound(_0x2fdb1b,null))[_0x834e('0x32')](function(_0x5a99e6){if(_0x5a99e6){_0xe79465[_0x834e('0x3d')]=_[_0x834e('0x37')](db['Disposition']['rawAttributes']);_0xe79465[_0x834e('0x39')]=_[_0x834e('0x37')](_0x56a152[_0x834e('0x39')]);_0xe79465[_0x834e('0x3b')]=_[_0x834e('0x3c')](_0xe79465['model'],_0xe79465[_0x834e('0x39')]);_0x1644dd[_0x834e('0x3f')]=_[_0x834e('0x3c')](_0xe79465[_0x834e('0x3d')],qs[_0x834e('0x3e')](_0x56a152[_0x834e('0x39')][_0x834e('0x3e')]));_0x1644dd[_0x834e('0x3f')]=_0x1644dd[_0x834e('0x3f')][_0x834e('0x40')]?_0x1644dd['attributes']:_0xe79465[_0x834e('0x3d')];if(!_0x56a152[_0x834e('0x39')][_0x834e('0x41')](_0x834e('0x5e'))){_0x1644dd['limit']=qs[_0x834e('0x42')](_0x56a152['query']['limit']);_0x1644dd['offset']=qs[_0x834e('0x43')](_0x56a152[_0x834e('0x39')]['offset']);}_0x1644dd[_0x834e('0x44')]=qs[_0x834e('0x45')](_0x56a152['query'][_0x834e('0x45')]);_0x1644dd[_0x834e('0x46')]=qs['filters'](_['pick'](_0x56a152[_0x834e('0x39')],_0xe79465[_0x834e('0x3b')]));_0x1644dd[_0x834e('0x46')][_0x834e('0x5b')]=_0x5a99e6['id'];if(_0x56a152[_0x834e('0x39')]['filter']){_0x1644dd[_0x834e('0x46')]=_['merge'](_0x1644dd[_0x834e('0x46')],{'$or':_[_0x834e('0x5f')](_0x1644dd[_0x834e('0x3f')],function(_0x5afb41){var _0x33a3cd={};_0x33a3cd[_0x5afb41]={'$like':'%'+_0x56a152[_0x834e('0x39')]['filter']+'%'};return _0x33a3cd;})});}_0x1644dd=_[_0x834e('0x4a')]({},_0x1644dd,_0x56a152[_0x834e('0x54')]);return db[_0x834e('0x5c')]['count']({'where':_0x1644dd[_0x834e('0x46')]})[_0x834e('0x32')](function(_0x402692){_0x216105[_0x834e('0x4d')]=_0x402692;if(_0x56a152[_0x834e('0x39')][_0x834e('0x4e')]){_0x1644dd[_0x834e('0x4f')]=[{'all':!![]}];}return db[_0x834e('0x5c')][_0x834e('0x50')](_0x1644dd);})[_0x834e('0x32')](function(_0x57d898){_0x216105['rows']=_0x57d898;return _0x216105;});}})['then'](respondWithFilteredResult(_0x2fdb1b,_0x1644dd))[_0x834e('0x29')](handleError(_0x2fdb1b,null));};exports[_0x834e('0x60')]=function(_0x313c03,_0x37fa2c,_0x2faa0d){var _0x5758fb;return db['FaxAccount'][_0x834e('0x58')]({'where':{'id':_0x313c03[_0x834e('0x53')]['id']}})[_0x834e('0x32')](handleEntityNotFound(_0x37fa2c,null))[_0x834e('0x32')](function(_0x40a705){if(_0x40a705){return _0x40a705['removeDispositions'](_0x313c03[_0x834e('0x39')][_0x834e('0x61')]);}})[_0x834e('0x32')](respondWithStatusCode(_0x37fa2c,null))['catch'](handleError(_0x37fa2c,null));};exports[_0x834e('0x62')]=function(_0x18fde1,_0x2d5c13,_0x443633){if(_0x18fde1[_0x834e('0x56')]['id']){delete _0x18fde1['body']['id'];}return db['FaxAccount'][_0x834e('0x58')]({'where':{'id':_0x18fde1[_0x834e('0x53')]['id']}})['then'](handleEntityNotFound(_0x2d5c13,null))[_0x834e('0x32')](function(_0x509427){if(_0x509427){_0x18fde1[_0x834e('0x56')][_0x834e('0x5b')]=_0x509427['id'];return db[_0x834e('0x63')]['create'](_0x18fde1[_0x834e('0x56')]);}})['then'](respondWithResult(_0x2d5c13,null))['catch'](handleError(_0x2d5c13,null));};exports['getAnswers']=function(_0x6735e6,_0x4627ac,_0x1d7bab){var _0x1d76c6={'raw':![],'where':{}};var _0x3b18d0={};var _0x2dad55={'count':0x0,'rows':[]};return db[_0x834e('0x4c')][_0x834e('0x5d')]({'where':{'id':_0x6735e6[_0x834e('0x53')]['id']}})['then'](handleEntityNotFound(_0x4627ac,null))[_0x834e('0x32')](function(_0x54e70d){if(_0x54e70d){_0x3b18d0[_0x834e('0x3d')]=_[_0x834e('0x37')](db[_0x834e('0x63')][_0x834e('0x36')]);_0x3b18d0[_0x834e('0x39')]=_[_0x834e('0x37')](_0x6735e6['query']);_0x3b18d0['filters']=_[_0x834e('0x3c')](_0x3b18d0[_0x834e('0x3d')],_0x3b18d0['query']);_0x1d76c6[_0x834e('0x3f')]=_[_0x834e('0x3c')](_0x3b18d0[_0x834e('0x3d')],qs[_0x834e('0x3e')](_0x6735e6[_0x834e('0x39')]['fields']));_0x1d76c6[_0x834e('0x3f')]=_0x1d76c6[_0x834e('0x3f')]['length']?_0x1d76c6['attributes']:_0x3b18d0['model'];if(!_0x6735e6[_0x834e('0x39')][_0x834e('0x41')]('nolimit')){_0x1d76c6[_0x834e('0x42')]=qs[_0x834e('0x42')](_0x6735e6['query'][_0x834e('0x42')]);_0x1d76c6['offset']=qs['offset'](_0x6735e6[_0x834e('0x39')][_0x834e('0x43')]);}_0x1d76c6[_0x834e('0x44')]=qs[_0x834e('0x45')](_0x6735e6['query'][_0x834e('0x45')]);_0x1d76c6[_0x834e('0x46')]=qs[_0x834e('0x3b')](_[_0x834e('0x47')](_0x6735e6[_0x834e('0x39')],_0x3b18d0[_0x834e('0x3b')]));_0x1d76c6[_0x834e('0x46')][_0x834e('0x5b')]=_0x54e70d['id'];if(_0x6735e6[_0x834e('0x39')][_0x834e('0x4b')]){_0x1d76c6[_0x834e('0x46')]=_[_0x834e('0x4a')](_0x1d76c6[_0x834e('0x46')],{'$or':_[_0x834e('0x5f')](_0x1d76c6[_0x834e('0x3f')],function(_0x35bb19){var _0x3453c7={};_0x3453c7[_0x35bb19]={'$like':'%'+_0x6735e6[_0x834e('0x39')][_0x834e('0x4b')]+'%'};return _0x3453c7;})});}_0x1d76c6=_[_0x834e('0x4a')]({},_0x1d76c6,_0x6735e6[_0x834e('0x54')]);return db[_0x834e('0x63')]['count']({'where':_0x1d76c6[_0x834e('0x46')]})[_0x834e('0x32')](function(_0x9ab45e){_0x2dad55[_0x834e('0x4d')]=_0x9ab45e;if(_0x6735e6[_0x834e('0x39')][_0x834e('0x4e')]){_0x1d76c6[_0x834e('0x4f')]=[{'all':!![]}];}return db[_0x834e('0x63')][_0x834e('0x50')](_0x1d76c6);})['then'](function(_0x5ce790){_0x2dad55['rows']=_0x5ce790;return _0x2dad55;});}})[_0x834e('0x32')](respondWithFilteredResult(_0x4627ac,_0x1d76c6))['catch'](handleError(_0x4627ac,null));};exports[_0x834e('0x64')]=function(_0xf2b35,_0x1dec03,_0x49021c){var _0xae00f;return db[_0x834e('0x4c')][_0x834e('0x58')]({'where':{'id':_0xf2b35[_0x834e('0x53')]['id']}})[_0x834e('0x32')](handleEntityNotFound(_0x1dec03,null))[_0x834e('0x32')](function(_0x528052){if(_0x528052){return _0x528052[_0x834e('0x64')](_0xf2b35[_0x834e('0x39')][_0x834e('0x61')]);}})[_0x834e('0x32')](respondWithStatusCode(_0x1dec03,null))[_0x834e('0x29')](handleError(_0x1dec03,null));};exports['addInteraction']=function(_0x4ebeba,_0x508b3e,_0x5cbb14){return db[_0x834e('0x65')][_0x834e('0x58')]({'where':{'id':_0x4ebeba['params']['id']}})[_0x834e('0x32')](handleEntityNotFound(_0x508b3e,null))[_0x834e('0x32')](function(_0x4fb709){if(_0x4fb709){return _0x4fb709[_0x834e('0x66')](_0x4ebeba[_0x834e('0x56')][_0x834e('0x61')],_[_0x834e('0x67')](_0x4ebeba[_0x834e('0x56')],[_0x834e('0x61'),'id'])||{});}})['then'](respondWithResult(_0x508b3e,null))['catch'](handleError(_0x508b3e,null));};exports[_0x834e('0x68')]=function(_0x30ab20,_0x1d2e12,_0x58bdd6){var _0x34fb30={'raw':![],'where':{}};var _0x3753cc={};var _0x582b24={'count':0x0,'rows':[]};return db[_0x834e('0x4c')][_0x834e('0x5d')]({'where':{'id':_0x30ab20[_0x834e('0x53')]['id']}})[_0x834e('0x32')](handleEntityNotFound(_0x1d2e12,null))['then'](function(_0x366a9f){if(_0x366a9f){_0x3753cc['model']=_['keys'](db[_0x834e('0x65')][_0x834e('0x36')]);_0x3753cc[_0x834e('0x39')]=_[_0x834e('0x37')](_0x30ab20[_0x834e('0x39')]);_0x3753cc[_0x834e('0x3b')]=_['intersection'](_0x3753cc['model'],_0x3753cc[_0x834e('0x39')]);_0x34fb30[_0x834e('0x3f')]=_[_0x834e('0x3c')](_0x3753cc[_0x834e('0x3d')],qs[_0x834e('0x3e')](_0x30ab20[_0x834e('0x39')][_0x834e('0x3e')]));_0x34fb30['attributes']=_0x34fb30[_0x834e('0x3f')][_0x834e('0x40')]?_0x34fb30['attributes']:_0x3753cc[_0x834e('0x3d')];if(!_0x30ab20[_0x834e('0x39')][_0x834e('0x41')](_0x834e('0x5e'))){_0x34fb30[_0x834e('0x42')]=qs[_0x834e('0x42')](_0x30ab20[_0x834e('0x39')][_0x834e('0x42')]);_0x34fb30[_0x834e('0x43')]=qs[_0x834e('0x43')](_0x30ab20[_0x834e('0x39')][_0x834e('0x43')]);}_0x34fb30[_0x834e('0x44')]=qs[_0x834e('0x45')](_0x30ab20['query'][_0x834e('0x45')]);_0x34fb30[_0x834e('0x46')]=qs['filters'](_[_0x834e('0x47')](_0x30ab20['query'],_0x3753cc[_0x834e('0x3b')]));_0x34fb30['where'][_0x834e('0x5b')]=_0x366a9f['id'];if(_0x30ab20['query'][_0x834e('0x4b')]){_0x34fb30[_0x834e('0x46')]=_[_0x834e('0x4a')](_0x34fb30[_0x834e('0x46')],{'$or':_['map'](_0x34fb30[_0x834e('0x3f')],function(_0x38085e){var _0x375fec={};_0x375fec[_0x38085e]={'$like':'%'+_0x30ab20[_0x834e('0x39')][_0x834e('0x4b')]+'%'};return _0x375fec;})});}_0x34fb30=_[_0x834e('0x4a')]({},_0x34fb30,_0x30ab20[_0x834e('0x54')]);return db[_0x834e('0x65')][_0x834e('0x4d')]({'where':_0x34fb30[_0x834e('0x46')]})[_0x834e('0x32')](function(_0x1cb4d0){_0x582b24[_0x834e('0x4d')]=_0x1cb4d0;if(_0x30ab20[_0x834e('0x39')][_0x834e('0x4e')]){_0x34fb30[_0x834e('0x4f')]=[{'model':db[_0x834e('0x69')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x834e('0x6a'),'attributes':[_0x834e('0x35'),_0x834e('0x6b'),_0x834e('0x6c')],'required':![]},{'model':db[_0x834e('0x6d')],'as':_0x834e('0x6e'),'attributes':['id',_0x834e('0x35'),_0x834e('0x6f')],'where':_0x30ab20[_0x834e('0x39')][_0x834e('0x70')]?{'id':_0x30ab20[_0x834e('0x39')][_0x834e('0x70')]}:undefined,'required':_0x30ab20['query'][_0x834e('0x70')]?!![]:![]}];}return db['FaxInteraction'][_0x834e('0x50')](_0x34fb30);})[_0x834e('0x32')](function(_0x19e3a2){_0x582b24['rows']=_0x19e3a2;return _0x582b24;});}})[_0x834e('0x32')](respondWithFilteredResult(_0x1d2e12,_0x34fb30))[_0x834e('0x29')](handleError(_0x1d2e12,null));};exports['addApplications']=function(_0x4f7c62,_0x62ea1,_0x3b7b1a){return db['FaxAccount'][_0x834e('0x5d')]({'where':{'id':_0x4f7c62[_0x834e('0x53')]['id']}})[_0x834e('0x32')](handleEntityNotFound(_0x62ea1,null))[_0x834e('0x32')](function(_0x170ec2){if(_0x170ec2){return db['sequelize']['transaction'](function(_0x453e58){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x4f7c62['params']['id']},'transaction':_0x453e58})[_0x834e('0x32')](function(_0x3634f7){var _0x5cba58=_[_0x834e('0x5f')](_0x4f7c62[_0x834e('0x56')],function(_0x470568){_0x470568[_0x834e('0x5b')]=_0x4f7c62['params']['id'];return _0x470568;});return db[_0x834e('0x71')][_0x834e('0x72')](_0x5cba58,{'transaction':_0x453e58});});})[_0x834e('0x32')](function(){return db['FaxApplication'][_0x834e('0x73')]({'where':{'FaxAccountId':_0x4f7c62['params']['id']},'order':_0x834e('0x74')});});}})['then'](respondWithResult(_0x62ea1,null))[_0x834e('0x29')](handleError(_0x62ea1,null));};exports[_0x834e('0x75')]=function(_0x510023,_0xce4f45,_0xfaaa58){var _0x41e7a8={};var _0x1b81ca={};var _0x410895;var _0x24d77c;return db['FaxAccount'][_0x834e('0x5d')]({'where':{'id':_0x510023[_0x834e('0x53')]['id']}})[_0x834e('0x32')](handleEntityNotFound(_0xce4f45,null))[_0x834e('0x32')](function(_0x306db2){if(_0x306db2){_0x410895=_0x306db2;_0x1b81ca[_0x834e('0x3d')]=_['keys'](db[_0x834e('0x71')]['rawAttributes']);_0x1b81ca['query']=_[_0x834e('0x37')](_0x510023['query']);_0x1b81ca['filters']=_[_0x834e('0x3c')](_0x1b81ca[_0x834e('0x3d')],_0x1b81ca[_0x834e('0x39')]);_0x41e7a8[_0x834e('0x3f')]=_[_0x834e('0x3c')](_0x1b81ca[_0x834e('0x3d')],qs[_0x834e('0x3e')](_0x510023[_0x834e('0x39')][_0x834e('0x3e')]));_0x41e7a8[_0x834e('0x3f')]=_0x41e7a8[_0x834e('0x3f')][_0x834e('0x40')]?_0x41e7a8[_0x834e('0x3f')]:_0x1b81ca[_0x834e('0x3d')];_0x41e7a8['order']=qs[_0x834e('0x45')](_0x510023['query'][_0x834e('0x45')]);_0x41e7a8[_0x834e('0x46')]=qs[_0x834e('0x3b')](_[_0x834e('0x47')](_0x510023['query'],_0x1b81ca['filters']));if(_0x510023[_0x834e('0x39')][_0x834e('0x4b')]){_0x41e7a8['where']=_[_0x834e('0x4a')](_0x41e7a8[_0x834e('0x46')],{'$or':_['map'](_0x41e7a8[_0x834e('0x3f')],function(_0x38d955){var _0x12c4d9={};_0x12c4d9[_0x38d955]={'$like':'%'+_0x510023[_0x834e('0x39')]['filter']+'%'};return _0x12c4d9;})});}_0x41e7a8=_['merge']({},_0x41e7a8,_0x510023['options']);return _0x410895['getApplications'](_0x41e7a8);}})[_0x834e('0x32')](function(_0x3c4847){if(_0x3c4847){_0x24d77c=_0x3c4847['length'];if(!_0x510023[_0x834e('0x39')]['hasOwnProperty'](_0x834e('0x5e'))){_0x41e7a8[_0x834e('0x42')]=qs[_0x834e('0x42')](_0x510023[_0x834e('0x39')][_0x834e('0x42')]);_0x41e7a8[_0x834e('0x43')]=qs[_0x834e('0x43')](_0x510023['query'][_0x834e('0x43')]);}return _0x410895[_0x834e('0x75')](_0x41e7a8);}})['then'](function(_0x22f4c7){if(_0x22f4c7){return _0x22f4c7?{'count':_0x24d77c,'rows':_0x22f4c7}:null;}})[_0x834e('0x32')](respondWithResult(_0xce4f45,null))['catch'](handleError(_0xce4f45,null));};function Extension(_0x486c18,_0x4f2ede,_0x3edbbb,_0x19e17b){this[_0x834e('0x76')]='from-voip-provider';this[_0x834e('0x77')]=_0x486c18[_0x834e('0x78')];this[_0x834e('0x79')]=_0x19e17b;this[_0x834e('0x7a')]=_0x834e('0x7b');this[_0x834e('0x7c')]=_0x834e('0x7d');this[_0x834e('0x5b')]=_0x486c18['id'];this[_0x834e('0x74')]=_0x4f2ede;this[_0x834e('0x7e')]=_0x3edbbb;}function createExtensionsReciveFax(_0x48b6c4){var _0x5d6b66=0x1;var _0x117e8f=[];_0x117e8f[_0x834e('0x7f')](new Extension(_0x48b6c4,_0x5d6b66,'',_0x834e('0x80')));_0x5d6b66+=0x1;_0x117e8f[_0x834e('0x7f')](new Extension(_0x48b6c4,_0x5d6b66,_0x834e('0x81'),_0x834e('0x82')));_0x5d6b66+=0x1;for(var _0x281922 in _0x48b6c4){if(_0x48b6c4[_0x834e('0x41')](_0x281922)&&(_0x281922===_0x834e('0x83')||_0x281922===_0x834e('0x78')||_0x281922===_0x834e('0x84')||_0x281922===_0x834e('0x85')||_0x281922===_0x834e('0x86')||_0x281922==='maxrate'||_0x281922===_0x834e('0x87')||_0x281922===_0x834e('0x88')||_0x281922===_0x834e('0x89'))){_0x117e8f[_0x834e('0x7f')](new Extension(_0x48b6c4,_0x5d6b66,'FAXOPT('+_0x281922+')='+_0x48b6c4[_0x281922],'Set'));_0x5d6b66+=0x1;}}_0x117e8f['push'](new Extension(_0x48b6c4,_0x5d6b66,'6',_0x834e('0x8a')));_0x5d6b66+=0x1;_0x117e8f[_0x834e('0x7f')](new Extension(_0x48b6c4,_0x5d6b66,_0x834e('0x8b'),_0x834e('0x8c')));_0x5d6b66=0x0;return _0x117e8f;}exports[_0x834e('0x8d')]=function(_0x13380f,_0x2a1f87,_0x3144d7){var _0x4d15a0;return db['sequelize']['transaction'](function(_0x5a5602){return db[_0x834e('0x4c')][_0x834e('0x55')](_0x13380f[_0x834e('0x56')],{'transaction':_0x5a5602})[_0x834e('0x32')](function(_0x72f950){_0x4d15a0=_0x72f950[_0x834e('0x8e')]({'plain':!![]});return db[_0x834e('0x8f')][_0x834e('0x72')](createExtensionsReciveFax(_0x4d15a0),{'transaction':_0x5a5602});});})[_0x834e('0x32')](function(){return _0x4d15a0;})['then'](respondWithResult(_0x2a1f87,null))['catch'](handleError(_0x2a1f87,null));};exports['updateAccountApplications']=function(_0x5dc651,_0x11aff8,_0x17025e){var _0x284183;return db[_0x834e('0x90')][_0x834e('0x91')](function(_0xcb9751){return db[_0x834e('0x4c')][_0x834e('0x57')](_0x5dc651[_0x834e('0x56')],{'where':{'id':_0x5dc651[_0x834e('0x56')]['id']},'transaction':_0xcb9751})[_0x834e('0x32')](function(_0x44167c){return db[_0x834e('0x8f')][_0x834e('0x33')]({'where':{'FaxAccountId':_0x5dc651[_0x834e('0x56')]['id']},'transaction':_0xcb9751})[_0x834e('0x32')](function(_0x5022f2){return db[_0x834e('0x8f')]['bulkCreate'](createExtensionsReciveFax(_[_0x834e('0x67')](_0x5dc651[_0x834e('0x56')],[_0x834e('0x92'),'key',_0x834e('0x93'),_0x834e('0x94'),'TrunkId','ListId'])),{'transaction':_0xcb9751});});});})[_0x834e('0x32')](function(){return db[_0x834e('0x4c')][_0x834e('0x95')](_0x5dc651[_0x834e('0x56')]['id']);})[_0x834e('0x32')](respondWithResult(_0x11aff8,null))[_0x834e('0x29')](handleError(_0x11aff8,null));};exports[_0x834e('0x96')]=function(_0x239a4e,_0x569a80,_0x2feca4){var _0xd2532b={'raw':!![],'where':{}};var _0x375e40={};var _0x1d4947={'count':0x0,'rows':[]};return db[_0x834e('0x4c')][_0x834e('0x5d')]({'where':{'id':_0x239a4e[_0x834e('0x53')]['id']}})['then'](handleEntityNotFound(_0x569a80,null))[_0x834e('0x32')](function(_0x59e298){if(_0x59e298){_0x375e40['model']=_[_0x834e('0x37')](db[_0x834e('0x97')]['rawAttributes']);_0x375e40[_0x834e('0x39')]=_[_0x834e('0x37')](_0x239a4e['query']);_0x375e40[_0x834e('0x3b')]=_[_0x834e('0x3c')](_0x375e40['model'],_0x375e40['query']);_0xd2532b[_0x834e('0x3f')]=_[_0x834e('0x3c')](_0x375e40['model'],qs['fields'](_0x239a4e[_0x834e('0x39')][_0x834e('0x3e')]));_0xd2532b['attributes']=_0xd2532b['attributes']['length']?_0xd2532b['attributes']:_0x375e40[_0x834e('0x3d')];if(!_0x239a4e['query'][_0x834e('0x41')]('nolimit')){_0xd2532b[_0x834e('0x42')]=qs[_0x834e('0x42')](_0x239a4e[_0x834e('0x39')][_0x834e('0x42')]);_0xd2532b['offset']=qs[_0x834e('0x43')](_0x239a4e[_0x834e('0x39')][_0x834e('0x43')]);}_0xd2532b[_0x834e('0x44')]=qs[_0x834e('0x45')](_0x239a4e[_0x834e('0x39')][_0x834e('0x45')]);_0xd2532b[_0x834e('0x46')]=qs[_0x834e('0x3b')](_[_0x834e('0x47')](_0x239a4e['query'],_0x375e40[_0x834e('0x3b')]));_0xd2532b['where'][_0x834e('0x5b')]=_0x59e298['id'];if(_0x239a4e[_0x834e('0x39')][_0x834e('0x4b')]){_0xd2532b[_0x834e('0x46')]=_[_0x834e('0x4a')](_0xd2532b['where'],{'$or':_[_0x834e('0x5f')](_0xd2532b['attributes'],function(_0x4e5798){var _0x21bf6a={};_0x21bf6a[_0x4e5798]={'$like':'%'+_0x239a4e[_0x834e('0x39')][_0x834e('0x4b')]+'%'};return _0x21bf6a;})});}if(_0x239a4e['query'][_0x834e('0x98')]){var _0xce96ae=_0x239a4e[_0x834e('0x39')][_0x834e('0x98')][_0x834e('0x99')](',');var _0x398f94={};_0x398f94[_0xce96ae[0x0]]={'$gte':moment(_0xce96ae[0x1])[_0x834e('0x9a')](_0x834e('0x9b'))};_0xd2532b[_0x834e('0x46')]=_[_0x834e('0x4a')](_0xd2532b[_0x834e('0x46')],_0x398f94);}_0xd2532b=_['merge']({},_0xd2532b,_0x239a4e[_0x834e('0x54')]);return db[_0x834e('0x97')][_0x834e('0x4d')]({'where':_0xd2532b[_0x834e('0x46')]})[_0x834e('0x32')](function(_0x30d338){_0x1d4947['count']=_0x30d338;if(_0x239a4e[_0x834e('0x39')][_0x834e('0x4e')]){_0xd2532b[_0x834e('0x4f')]=[{'all':!![]}];}return db[_0x834e('0x97')][_0x834e('0x50')](_0xd2532b);})[_0x834e('0x32')](function(_0xdb8ab6){_0x1d4947[_0x834e('0x51')]=_0xdb8ab6;return _0x1d4947;});}})[_0x834e('0x32')](respondWithFilteredResult(_0x569a80,_0xd2532b))[_0x834e('0x29')](handleError(_0x569a80,null));};exports['send']=function(_0x571645,_0x5f339f,_0x4b81a8){var _0x4094d5,_0x449530={},_0x1a79e0;if(_0x571645[_0x834e('0x56')]['to']){_0x1a79e0=_0x571645[_0x834e('0x56')]['to'][0x0];}return db[_0x834e('0x4c')]['find']({'where':{'id':_0x571645[_0x834e('0x53')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x834e('0x9c'),'where':{'fax':_0x1a79e0},'limit':0x1,'order':[[_0x834e('0x94'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x5f339f,null))['then'](function(_0x2515f6){_0x4094d5=_0x2515f6;if(_0x571645[_0x834e('0x56')][_0x834e('0x9d')]&&_0x571645['body'][_0x834e('0x9d')][_0x834e('0x40')]){for(var _0x384402=0x0;_0x384402<_0x571645[_0x834e('0x56')][_0x834e('0x9d')][_0x834e('0x40')];_0x384402+=0x1){_0x571645['body']['attachments'][_0x384402]={'filename':_0x571645['body']['attachments'][_0x384402][_0x834e('0x35')],'id':_0x571645[_0x834e('0x56')][_0x834e('0x9d')][_0x384402]['id'],'path':path[_0x834e('0x9e')](config[_0x834e('0x9f')],_0x834e('0xa0'),_0x571645[_0x834e('0x56')][_0x834e('0x9d')][_0x384402][_0x834e('0xa1')])};}}return respondWithRpcPromise(_0x834e('0xa2'),_0x834e('0xa2'),{'FaxAccountId':_[_0x834e('0xa3')](_0x571645[_0x834e('0x53')]['id'])?undefined:_0x571645[_0x834e('0x53')]['id'],'path':_[_0x834e('0xa3')](_0x571645['body']['attachments'][0x0][_0x834e('0x9')])?undefined:_0x571645[_0x834e('0x56')][_0x834e('0x9d')][0x0]['path'],'fax':_[_0x834e('0xa3')](_0x571645[_0x834e('0x56')]['to'][0x0])?undefined:_0x571645[_0x834e('0x56')]['to'][0x0]},client9002);})[_0x834e('0x32')](function(){if(_0x4094d5){if(_[_0x834e('0xa3')](_0x571645[_0x834e('0x56')][_0x834e('0xa4')])){_0x571645[_0x834e('0x56')][_0x834e('0xa4')]=util['format'](_0x834e('0xa5'),_0x4094d5[_0x834e('0x35')],_0x4094d5[_0x834e('0xa6')]);}if(_0x4094d5[_0x834e('0xa7')]){if(_0x4094d5['List'][_0x834e('0x9c')][_0x834e('0x40')]){return _0x4094d5[_0x834e('0xa7')][_0x834e('0x9c')][0x0];}else{return db[_0x834e('0x69')][_0x834e('0x55')](_[_0x834e('0xa8')](_0x571645[_0x834e('0x56')],{'firstName':_0x571645[_0x834e('0x56')]['to'][0x0],'phone':_0x571645['body']['to'][0x0],'fax':_0x571645[_0x834e('0x56')]['to'][0x0],'ListId':_0x4094d5['ListId']}));}}else{throw new Error(_0x834e('0xa9'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x834e('0x32')](function(_0x32f2f0){if(_0x32f2f0){return db[_0x834e('0x65')][_0x834e('0x58')]({'where':{'ContactId':_0x32f2f0['id'],'closed':![],'FaxAccountId':_0x4094d5['id']}})[_0x834e('0x32')](function(_0x481850){if(_0x481850){return[_0x481850,![]];}return db[_0x834e('0x65')][_0x834e('0x55')]({'UserId':_0x571645['user']['id'],'ContactId':_0x32f2f0['id'],'FaxAccountId':_0x4094d5['id'],'fax':_0x571645['body']['to'][0x0],'firstMsgDirection':_0x834e('0xaa'),'Messages':[_['merge'](_0x571645['body'],{'read':![],'body':_0x571645['body'][_0x834e('0x9d')][0x0][_0x834e('0xab')],'FaxAccountId':_0x4094d5['id'],'UserId':_0x571645[_0x834e('0xac')]['id'],'ContactId':_0x32f2f0['id'],'AttachmentId':_0x571645[_0x834e('0x56')][_0x834e('0x9d')][0x0]['id']})]},{'include':[{'model':db[_0x834e('0x97')],'as':_0x834e('0xad')}]})['then'](function(_0x28825c){return[_0x28825c,!![]];});});}else{throw new Error(_0x834e('0xae'));}})['spread'](function(_0x5df60f,_0x29f45b){if(_0x29f45b){return _0x5df60f;}return db[_0x834e('0x97')]['create']({'direction':'out','read':![],'body':_0x571645[_0x834e('0x56')][_0x834e('0x9d')][0x0][_0x834e('0xab')],'FaxAccountId':_0x4094d5['id'],'FaxInteractionId':_0x5df60f['id'],'UserId':_0x571645['user']['id'],'ContactId':_0x5df60f[_0x834e('0xaf')],'AttachmentId':_0x571645[_0x834e('0x56')][_0x834e('0x9d')][0x0]['id']})['then'](function(_0x24570f){_0x5df60f['dataValues'][_0x834e('0xad')]=[];_0x5df60f[_0x834e('0xb0')][_0x834e('0xad')][_0x834e('0x7f')](_0x24570f[_0x834e('0xb0')]);return _0x5df60f;});})['then'](function(_0x4357db){respondWithRpcPromise(_0x834e('0xb1'),_0x834e('0xb1'),{'FaxAccountId':_[_0x834e('0xa3')](_0x571645[_0x834e('0x53')]['id'])?undefined:_0x571645['params']['id'],'path':_['isNil'](_0x571645[_0x834e('0x56')][_0x834e('0x9d')][0x0][_0x834e('0x9')])?undefined:_0x571645['body'][_0x834e('0x9d')][0x0][_0x834e('0x9')],'fax':_[_0x834e('0xa3')](_0x571645[_0x834e('0x56')]['to'][0x0])?undefined:_0x571645['body']['to'][0x0],'AttachmentId':_0x571645[_0x834e('0x56')][_0x834e('0x9d')][0x0]['id']},client9002)['then'](function(_0xa4c54){logger[_0x834e('0x20')](_0x834e('0xb2'),_0xa4c54);})[_0x834e('0x29')](function(_0x4b0246){logger[_0x834e('0x20')]('SendFaxRpc,\x20%s',_0x4b0246);});return _0x4357db;})[_0x834e('0x32')](respondWithResult(_0x5f339f,null))[_0x834e('0x29')](handleError(_0x5f339f,null));};exports[_0x834e('0xb3')]=function(_0x23c72a,_0x3698cf,_0x153d4c){return db['FaxAccount']['find']({'where':{'id':_0x23c72a[_0x834e('0x53')]['id']}})[_0x834e('0x32')](handleEntityNotFound(_0x3698cf,null))['then'](function(_0x260596){if(_0x260596){return _0x260596['addAgents'](_0x23c72a[_0x834e('0x56')][_0x834e('0x61')],_[_0x834e('0x67')](_0x23c72a[_0x834e('0x56')],[_0x834e('0x61'),'id'])||{})[_0x834e('0xb4')](function(_0x36836f){for(var _0x56ae60=0x0;_0x56ae60<_0x23c72a[_0x834e('0x56')][_0x834e('0x61')][_0x834e('0x40')];_0x56ae60+=0x1){socket[_0x834e('0xb5')](_0x834e('0xb6'),{'UserId':_0x23c72a['body'][_0x834e('0x61')][_0x56ae60],'FaxAccountId':_0x23c72a[_0x834e('0x53')]['id']});}return _0x36836f;});}})[_0x834e('0x32')](respondWithResult(_0x3698cf,null))['catch'](handleError(_0x3698cf,null));};exports['removeAgents']=function(_0x4fb3d0,_0x2f05b6,_0x2cad75){var _0x431bd3;return db[_0x834e('0x4c')][_0x834e('0x58')]({'where':{'id':_0x4fb3d0[_0x834e('0x53')]['id']}})[_0x834e('0x32')](handleEntityNotFound(_0x2f05b6,null))[_0x834e('0x32')](function(_0xdc3728){if(_0xdc3728){return _0xdc3728[_0x834e('0xb7')](_0x4fb3d0[_0x834e('0x39')]['ids'])[_0x834e('0x32')](function(_0x3552b1){if(_[_0x834e('0xb8')](_0x4fb3d0[_0x834e('0x39')][_0x834e('0x61')])){for(var _0x2283fe=0x0;_0x2283fe<_0x4fb3d0[_0x834e('0x39')][_0x834e('0x61')]['length'];_0x2283fe+=0x1){socket[_0x834e('0xb5')](_0x834e('0xb9'),{'UserId':_0x4fb3d0['query'][_0x834e('0x61')][_0x2283fe],'FaxAccountId':_0x4fb3d0[_0x834e('0x53')]['id']});}}else{socket[_0x834e('0xb5')](_0x834e('0xb9'),{'UserId':_0x4fb3d0['query']['ids'],'FaxAccountId':_0x4fb3d0[_0x834e('0x53')]['id']});}});}})['then'](respondWithStatusCode(_0x2f05b6,null))[_0x834e('0x29')](handleError(_0x2f05b6,null));};exports[_0x834e('0xba')]=function(_0x18638d,_0x1ec895,_0xc1639d){var _0x533043={};var _0x2f6633={};var _0x5a4fbf;var _0x4ae94e;return db[_0x834e('0x4c')][_0x834e('0x5d')]({'where':{'id':_0x18638d[_0x834e('0x53')]['id']}})[_0x834e('0x32')](handleEntityNotFound(_0x1ec895,null))[_0x834e('0x32')](function(_0x29d396){if(_0x29d396){_0x5a4fbf=_0x29d396;_0x2f6633['model']=_[_0x834e('0x37')](db[_0x834e('0xbb')]['rawAttributes']);_0x2f6633[_0x834e('0x39')]=_[_0x834e('0x37')](_0x18638d['query']);_0x2f6633[_0x834e('0x3b')]=_[_0x834e('0x3c')](_0x2f6633['model'],_0x2f6633[_0x834e('0x39')]);_0x533043[_0x834e('0x3f')]=_[_0x834e('0x3c')](_0x2f6633[_0x834e('0x3d')],qs[_0x834e('0x3e')](_0x18638d[_0x834e('0x39')][_0x834e('0x3e')]));_0x533043[_0x834e('0x3f')]=_0x533043[_0x834e('0x3f')][_0x834e('0x40')]?_0x533043['attributes']:_0x2f6633[_0x834e('0x3d')];_0x533043[_0x834e('0x44')]=qs[_0x834e('0x45')](_0x18638d[_0x834e('0x39')][_0x834e('0x45')]);_0x533043[_0x834e('0x46')]=qs[_0x834e('0x3b')](_[_0x834e('0x47')](_0x18638d[_0x834e('0x39')],_0x2f6633[_0x834e('0x3b')]));if(_0x18638d[_0x834e('0x39')][_0x834e('0x4b')]){_0x533043['where']=_[_0x834e('0x4a')](_0x533043[_0x834e('0x46')],{'$or':_['map'](_0x533043['attributes'],function(_0x563f20){var _0x39afdc={};_0x39afdc[_0x563f20]={'$like':'%'+_0x18638d[_0x834e('0x39')][_0x834e('0x4b')]+'%'};return _0x39afdc;})});}_0x533043=_[_0x834e('0x4a')]({},_0x533043,_0x18638d[_0x834e('0x54')]);return _0x5a4fbf[_0x834e('0xba')](_0x533043);}})[_0x834e('0x32')](function(_0x543f08){if(_0x543f08){_0x4ae94e=_0x543f08['length'];if(!_0x18638d['query']['hasOwnProperty'](_0x834e('0x5e'))){_0x533043[_0x834e('0x42')]=qs[_0x834e('0x42')](_0x18638d['query']['limit']);_0x533043['offset']=qs[_0x834e('0x43')](_0x18638d['query']['offset']);}return _0x5a4fbf[_0x834e('0xba')](_0x533043);}})[_0x834e('0x32')](function(_0x36eb92){if(_0x36eb92){return _0x36eb92?{'count':_0x4ae94e,'rows':_0x36eb92}:null;}})[_0x834e('0x32')](respondWithResult(_0x1ec895,null))[_0x834e('0x29')](handleError(_0x1ec895,null));};
\ No newline at end of file
index f4de57f..f59f1c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b32=['update','remove','emit','hasOwnProperty','hook','events','FaxAccount','setMaxListeners','save'];(function(_0x4f9dc4,_0x213d17){var _0x2ff3be=function(_0x489a3f){while(--_0x489a3f){_0x4f9dc4['push'](_0x4f9dc4['shift']());}};_0x2ff3be(++_0x213d17);}(_0x3b32,0x125));var _0x23b3=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x3b32[_0x13d07a];return _0x5ee0ee;};'use strict';var EventEmitter=require(_0x23b3('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x23b3('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x23b3('0x2')](0x0);var events={'afterCreate':_0x23b3('0x3'),'afterUpdate':_0x23b3('0x4'),'afterDestroy':_0x23b3('0x5')};function emitEvent(_0x10f370){return function(_0x490d14,_0x36c874,_0x3e6a45){FaxAccountEvents[_0x23b3('0x6')](_0x10f370+':'+_0x490d14['id'],_0x490d14);FaxAccountEvents[_0x23b3('0x6')](_0x10f370,_0x490d14);_0x3e6a45(null);};}for(var e in events){if(events[_0x23b3('0x7')](e)){var event=events[e];FaxAccount[_0x23b3('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents;
\ No newline at end of file
+var _0x83d1=['events','../../mysqldb','FaxAccount','setMaxListeners','emit','hasOwnProperty','hook'];(function(_0x1f2574,_0x198da9){var _0x1ba5b7=function(_0x2d84ff){while(--_0x2d84ff){_0x1f2574['push'](_0x1f2574['shift']());}};_0x1ba5b7(++_0x198da9);}(_0x83d1,0x142));var _0x183d=function(_0x3ce901,_0x24aa03){_0x3ce901=_0x3ce901-0x0;var _0x217b81=_0x83d1[_0x3ce901];return _0x217b81;};'use strict';var EventEmitter=require(_0x183d('0x0'));var FaxAccount=require(_0x183d('0x1'))['db'][_0x183d('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x183d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x27cc65){return function(_0x4355df,_0x17a83c,_0x140611){FaxAccountEvents[_0x183d('0x4')](_0x27cc65+':'+_0x4355df['id'],_0x4355df);FaxAccountEvents[_0x183d('0x4')](_0x27cc65,_0x4355df);_0x140611(null);};}for(var e in events){if(events[_0x183d('0x5')](e)){var event=events[e];FaxAccount[_0x183d('0x6')](e,emitEvent(event));}}module['exports']=FaxAccountEvents;
\ No newline at end of file
index af43776..2b3dd86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0ae=['../../config/logger','api','bluebird','./faxAccount.attributes','exports','define','FaxAccount','lodash','util'];(function(_0x590e11,_0x4ddcbd){var _0xdc1d3=function(_0x1aed65){while(--_0x1aed65){_0x590e11['push'](_0x590e11['shift']());}};_0xdc1d3(++_0x4ddcbd);}(_0xd0ae,0x1ae));var _0xed0a=function(_0x486ffe,_0x588d2f){_0x486ffe=_0x486ffe-0x0;var _0x464d99=_0xd0ae[_0x486ffe];return _0x464d99;};'use strict';var _=require(_0xed0a('0x0'));var util=require(_0xed0a('0x1'));var logger=require(_0xed0a('0x2'))(_0xed0a('0x3'));var moment=require('moment');var BPromise=require(_0xed0a('0x4'));var rp=require('request-promise');var attributes=require(_0xed0a('0x5'));module[_0xed0a('0x6')]=function(_0x11cb66,_0x34e372){return _0x11cb66[_0xed0a('0x7')](_0xed0a('0x8'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf09f=['util','../../config/logger','api','moment','bluebird','request-promise','exports','define','FaxAccount','fax_accounts'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xf09f,0x1cc));var _0xff09=function(_0x28e3fb,_0x34ceff){_0x28e3fb=_0x28e3fb-0x0;var _0x146101=_0xf09f[_0x28e3fb];return _0x146101;};'use strict';var _=require('lodash');var util=require(_0xff09('0x0'));var logger=require(_0xff09('0x1'))(_0xff09('0x2'));var moment=require(_0xff09('0x3'));var BPromise=require(_0xff09('0x4'));var rp=require(_0xff09('0x5'));var attributes=require('./faxAccount.attributes');module[_0xff09('0x6')]=function(_0x3249f0,_0x40e9e1){return _0x3249f0[_0xff09('0x7')](_0xff09('0x8'),attributes,{'tableName':_0xff09('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b14d2d5..e8ccaca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11ee=['Start','startRouting','util','moment','bluebird','randomstring','rpc','../../config/environment','http','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','GetFaxAccount','findAll','options','raw','where','limit','include','map','model','attributes','stringify','catch','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','find','account','List','Contacts','get','Applications','list','applications','priority','asc','length','defaults','ListId','create','contact','FaxInteraction','spread','push','close','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','name','unshift','agent'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x11ee,0x1ee));var _0xe11e=function(_0x185a5a,_0x19442b){_0x185a5a=_0x185a5a-0x0;var _0x39bd2d=_0x11ee[_0x185a5a];return _0x39bd2d;};'use strict';var _=require('lodash');var util=require(_0xe11e('0x0'));var moment=require(_0xe11e('0x1'));var BPromise=require(_0xe11e('0x2'));var rs=require(_0xe11e('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe11e('0x4'));var config=require(_0xe11e('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe11e('0x6')]({'port':0x232c});var socket=require(_0xe11e('0x7'))({'host':'localhost','port':0x18eb});require(_0xe11e('0x8'))[_0xe11e('0x9')](socket);function respondWithRpcPromise(_0x27f70f,_0xe6772f,_0x21d937){return new BPromise(function(_0x1504b5,_0x2fc48b){return client[_0xe11e('0xa')](_0x27f70f,_0x21d937)[_0xe11e('0xb')](function(_0x4029e0){logger[_0xe11e('0xc')](_0xe11e('0xd'),_0xe6772f,_0xe11e('0xe'));logger[_0xe11e('0xf')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0xe6772f,_0xe11e('0xe'),JSON['stringify'](_0x4029e0));if(_0x4029e0['error']){if(_0x4029e0['error'][_0xe11e('0x10')]===0x1f4){logger[_0xe11e('0x11')](_0xe11e('0xd'),_0xe6772f,_0x4029e0[_0xe11e('0x11')][_0xe11e('0x12')]);return _0x2fc48b(_0x4029e0['error']['message']);}logger[_0xe11e('0x11')](_0xe11e('0xd'),_0xe6772f,_0x4029e0[_0xe11e('0x11')][_0xe11e('0x12')]);return _0x1504b5(_0x4029e0[_0xe11e('0x11')][_0xe11e('0x12')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0xe6772f,_0xe11e('0xe'));_0x1504b5(_0x4029e0[_0xe11e('0x13')][_0xe11e('0x12')]);}})['catch'](function(_0x238c5c){logger['error'](_0xe11e('0xd'),_0xe6772f,_0x238c5c);_0x2fc48b(_0x238c5c);});});}exports[_0xe11e('0x14')]=function(_0x1ff956){var _0x73e1f7=this;return new Promise(function(_0x49624a,_0x1f57d2){return db['FaxAccount'][_0xe11e('0x15')]({'raw':_0x1ff956[_0xe11e('0x16')]?_0x1ff956[_0xe11e('0x16')][_0xe11e('0x17')]===undefined?!![]:![]:!![],'where':_0x1ff956[_0xe11e('0x16')]?_0x1ff956[_0xe11e('0x16')][_0xe11e('0x18')]||null:null,'attributes':_0x1ff956[_0xe11e('0x16')]?_0x1ff956['options']['attributes']||null:null,'limit':_0x1ff956[_0xe11e('0x16')]?_0x1ff956[_0xe11e('0x16')][_0xe11e('0x19')]||null:null,'include':_0x1ff956[_0xe11e('0x16')]?_0x1ff956[_0xe11e('0x16')][_0xe11e('0x1a')]?_[_0xe11e('0x1b')](_0x1ff956[_0xe11e('0x16')][_0xe11e('0x1a')],function(_0x1b3b09){return{'model':db[_0x1b3b09[_0xe11e('0x1c')]],'as':_0x1b3b09['as'],'attributes':_0x1b3b09[_0xe11e('0x1d')],'include':_0x1b3b09[_0xe11e('0x1a')]?_[_0xe11e('0x1b')](_0x1b3b09['include'],function(_0x74ac37){return{'model':db[_0x74ac37['model']],'as':_0x74ac37['as'],'attributes':_0x74ac37[_0xe11e('0x1d')],'include':_0x74ac37['include']?_['map'](_0x74ac37[_0xe11e('0x1a')],function(_0x4bfb43){return{'model':db[_0x4bfb43['model']],'as':_0x4bfb43['as'],'attributes':_0x4bfb43[_0xe11e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe11e('0xb')](function(_0x4728da){logger[_0xe11e('0xc')](_0xe11e('0x14'),_0x1ff956);logger[_0xe11e('0xf')](_0xe11e('0x14'),_0x1ff956,JSON[_0xe11e('0x1e')](_0x4728da));_0x49624a(_0x4728da);})[_0xe11e('0x1f')](function(_0x3c75d2){logger[_0xe11e('0x11')](_0xe11e('0x14'),_0x3c75d2[_0xe11e('0x12')],_0x1ff956);_0x1f57d2(_0x73e1f7['error'](0x1f4,_0x3c75d2[_0xe11e('0x12')]));});});};exports[_0xe11e('0x20')]=function(_0x16e20f,_0x535728,_0x3c340f){var _0x58c990=this;return new Promise(function(_0x2b012a,_0x13b0cf){var _0x34ccde={'body':_0x16e20f[_0xe11e('0x21')],'channel':_0xe11e('0x22')};var _0x297781=[];var _0x29d165=[];var _0x5d4b88={};return db[_0xe11e('0x23')][_0xe11e('0x24')]()[_0xe11e('0xb')](function(_0x2073f3){if(!_0x2073f3){throw new db[(_0xe11e('0x25'))][(_0xe11e('0x26'))]('no\x20available\x20attributes');}_0x297781=_[_0xe11e('0x27')](_[_0xe11e('0x28')](_0x2073f3),[_0xe11e('0x29'),_0xe11e('0x2a')]);_0x29d165=_[_0xe11e('0x27')](_[_0xe11e('0x28')](_0x2073f3),['createdAt',_0xe11e('0x2a'),_0xe11e('0x2b'),'ListId']);if(_0x16e20f['body']['id']){delete _0x16e20f['body']['id'];}if(_[_0xe11e('0x2c')](_0x16e20f[_0xe11e('0x21')][_0xe11e('0x2d')])){throw new db['Sequelize'][(_0xe11e('0x26'))](_0xe11e('0x2e'));}if(_[_0xe11e('0x2c')](_0x16e20f[_0xe11e('0x21')][_0xe11e('0x21')])||_0x16e20f[_0xe11e('0x21')][_0xe11e('0x21')]===''){throw new db[(_0xe11e('0x25'))]['ValidationError'](_0xe11e('0x2f'));}if(_['isNil'](_0x16e20f[_0xe11e('0x21')]['mapKey'])){throw new db[(_0xe11e('0x25'))][(_0xe11e('0x26'))](_0xe11e('0x30')+_0x29d165);}if(!_[_0xe11e('0x31')](_0x29d165,_0x16e20f[_0xe11e('0x21')][_0xe11e('0x32')])){throw new db[(_0xe11e('0x25'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x29d165);}_0x5d4b88[_0x16e20f[_0xe11e('0x21')]['mapKey']]=_0x16e20f[_0xe11e('0x21')]['from'];})[_0xe11e('0xb')](function(){return db['FaxAccount'][_0xe11e('0x33')]({'where':{'id':_0x16e20f[_0xe11e('0x34')]['id']},'include':[{'model':db['CmList'],'as':_0xe11e('0x35'),'include':[{'model':db[_0xe11e('0x23')],'as':_0xe11e('0x36'),'where':_0x5d4b88,'limit':0x1,'order':[[_0xe11e('0x2a'),'DESC']]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0xe11e('0xb')](function(_0x35c76a){if(_0x35c76a&&_0x35c76a[_0xe11e('0x35')]){var _0x478bd7=_0x35c76a[_0xe11e('0x37')]({'plain':!![]});_0x34ccde[_0xe11e('0x34')]=_0x478bd7;_0x34ccde['applications']=_0x478bd7[_0xe11e('0x38')];_0x34ccde[_0xe11e('0x39')]=_0x478bd7['List'];_0x34ccde[_0xe11e('0x3a')]=_['orderBy'](_0x34ccde[_0xe11e('0x3a')],[_0xe11e('0x3b')],[_0xe11e('0x3c')]);if(_0x34ccde['account'][_0xe11e('0x38')]){delete _0x34ccde[_0xe11e('0x34')][_0xe11e('0x38')];}if(_0x34ccde['account'][_0xe11e('0x35')]&&_0x34ccde[_0xe11e('0x34')]['List'][_0xe11e('0x36')][_0xe11e('0x3d')]){return _0x34ccde[_0xe11e('0x34')][_0xe11e('0x35')][_0xe11e('0x36')][0x0];}var _0x5981b0=_[_0xe11e('0x3e')](_0x16e20f[_0xe11e('0x21')],{'firstName':_0x16e20f['body'][_0xe11e('0x2d')],'ListId':_0x478bd7[_0xe11e('0x3f')]});_0x5981b0[_0x16e20f['body']['mapKey']]=_0x16e20f[_0xe11e('0x21')]['from'];return db[_0xe11e('0x23')][_0xe11e('0x40')](_0x5981b0,{'fields':_0x297781,'raw':!![]});}})[_0xe11e('0xb')](function(_0xdd1ce1){_0x34ccde[_0xe11e('0x41')]=_0xdd1ce1;if(_0xdd1ce1){var _0x35194a={'ContactId':_0xdd1ce1['id'],'FaxAccountId':_0x16e20f[_0xe11e('0x34')]['id'],'fax':_0xdd1ce1[_0xe11e('0x22')]};return db['FaxInteraction'][_0xe11e('0x33')]({'where':{'ContactId':_0xdd1ce1['id'],'closed':![],'FaxAccountId':_0x16e20f[_0xe11e('0x34')]['id']}})[_0xe11e('0xb')](function(_0x32fc4e){if(_0x32fc4e){return[_0x32fc4e,![]];}return db[_0xe11e('0x42')][_0xe11e('0x40')](_0x35194a)[_0xe11e('0xb')](function(_0x2f5d67){return[_0x2f5d67,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xe11e('0x43')](function(_0x5dfc56,_0x51a979){var _0x523d27=_0x5dfc56[_0xe11e('0x37')]({'plain':!![]});if(_0x51a979){if(_0x34ccde[_0xe11e('0x34')]['autoclose']){_0x34ccde[_0xe11e('0x3a')][_0xe11e('0x44')]({'id':0x0,'priority':_0x34ccde['applications'][_0xe11e('0x3d')]+0x1,'app':_0xe11e('0x45'),'appdata':'unmanaged','interval':_0xe11e('0x46')});}_0x523d27['created']=!![];}else{_0x523d27[_0xe11e('0x47')]=![];}_0x34ccde['interaction']=_0x523d27;return db[_0xe11e('0x48')]['create']({'body':_0x16e20f[_0xe11e('0x21')]['body'],'FaxAccountId':_0x16e20f['account']['id'],'FaxInteractionId':_0x5dfc56['id'],'direction':'in','ContactId':_0x5dfc56[_0xe11e('0x49')],'AttachmentId':_0x16e20f[_0xe11e('0x21')][_0xe11e('0x4a')]});})['then'](function(_0x4ba0eb){_0x34ccde[_0xe11e('0x12')]=_0x4ba0eb;if(_0x34ccde[_0xe11e('0x4b')][_0xe11e('0x4c')]){return db['User'][_0xe11e('0x33')]({'attributes':['id',_0xe11e('0x4d')],'where':{'id':_0x34ccde[_0xe11e('0x4b')][_0xe11e('0x4c')]}})[_0xe11e('0xb')](function(_0x4c74d7){if(_0x4c74d7){_0x34ccde[_0xe11e('0x3a')][_0xe11e('0x4e')]({'id':0x0,'priority':0x0,'app':_0xe11e('0x4f'),'appdata':_0x4c74d7[_0xe11e('0x4d')]+','+(_0x34ccde[_0xe11e('0x34')]['waitForTheAssignedAgent']||0xa),'interval':_0xe11e('0x46')});}return respondWithRpcPromise(_0xe11e('0x50'),_0xe11e('0x51'),_0x34ccde);});}return respondWithRpcPromise(_0xe11e('0x50'),_0xe11e('0x51'),_0x34ccde);})[_0xe11e('0xb')](function(_0xa0a60e){_0x2b012a(_0xa0a60e);})[_0xe11e('0x1f')](function(_0x4693e5){_0x13b0cf(_0x58c990[_0xe11e('0x11')](0x1f4,_0x4693e5[_0xe11e('0x12')]));});});};
\ No newline at end of file
+var _0xf09a=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','./faxAccount.socket','register','then','info','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','FaxAccount,\x20%s,\x20%s','result','GetFaxAccount','FaxAccount','findAll','options','where','attributes','limit','include','map','model','stringify','catch','NotifyFaxAccount','body','fax','CmContact','describe','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','Sequelize','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','account','applications','orderBy','priority','asc','defaults','from','FaxInteraction','create','Contact\x20not\x20found','get','autoclose','length','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment'];(function(_0x3cb0fa,_0x25c2bc){var _0x1a85fb=function(_0x103dee){while(--_0x103dee){_0x3cb0fa['push'](_0x3cb0fa['shift']());}};_0x1a85fb(++_0x25c2bc);}(_0xf09a,0xb0));var _0xaf09=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0xf09a[_0xa388a2];return _0x7ce7f6;};'use strict';var _=require(_0xaf09('0x0'));var util=require('util');var moment=require(_0xaf09('0x1'));var BPromise=require(_0xaf09('0x2'));var rs=require(_0xaf09('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0xaf09('0x4'));var logger=require(_0xaf09('0x5'))(_0xaf09('0x6'));var config=require(_0xaf09('0x7'));var jayson=require(_0xaf09('0x8'));var client=jayson[_0xaf09('0x9')]['http']({'port':0x232c});var socket=require('socket.io-emitter')({'host':'localhost','port':0x18eb});require(_0xaf09('0xa'))[_0xaf09('0xb')](socket);function respondWithRpcPromise(_0x1d619b,_0x2eb9a9,_0x12cb7f){return new BPromise(function(_0x3f3618,_0x1701b5){return client['request'](_0x1d619b,_0x12cb7f)[_0xaf09('0xc')](function(_0x3eff60){logger[_0xaf09('0xd')]('FaxAccount,\x20%s,\x20%s',_0x2eb9a9,_0xaf09('0xe'));logger['debug'](_0xaf09('0xf'),_0x2eb9a9,_0xaf09('0xe'),JSON['stringify'](_0x3eff60));if(_0x3eff60[_0xaf09('0x10')]){if(_0x3eff60[_0xaf09('0x10')][_0xaf09('0x11')]===0x1f4){logger[_0xaf09('0x10')]('FaxAccount,\x20%s,\x20%s',_0x2eb9a9,_0x3eff60[_0xaf09('0x10')][_0xaf09('0x12')]);return _0x1701b5(_0x3eff60[_0xaf09('0x10')][_0xaf09('0x12')]);}logger[_0xaf09('0x10')](_0xaf09('0x13'),_0x2eb9a9,_0x3eff60['error']['message']);return _0x3f3618(_0x3eff60['error'][_0xaf09('0x12')]);}else{logger[_0xaf09('0xd')]('FaxAccount,\x20%s,\x20%s',_0x2eb9a9,'request\x20sent');_0x3f3618(_0x3eff60[_0xaf09('0x14')][_0xaf09('0x12')]);}})['catch'](function(_0x14f243){logger[_0xaf09('0x10')](_0xaf09('0x13'),_0x2eb9a9,_0x14f243);_0x1701b5(_0x14f243);});});}exports[_0xaf09('0x15')]=function(_0x36cb74){var _0x29cadd=this;return new Promise(function(_0x488b0b,_0x22197a){return db[_0xaf09('0x16')][_0xaf09('0x17')]({'raw':_0x36cb74['options']?_0x36cb74['options']['raw']===undefined?!![]:![]:!![],'where':_0x36cb74[_0xaf09('0x18')]?_0x36cb74[_0xaf09('0x18')][_0xaf09('0x19')]||null:null,'attributes':_0x36cb74['options']?_0x36cb74[_0xaf09('0x18')][_0xaf09('0x1a')]||null:null,'limit':_0x36cb74[_0xaf09('0x18')]?_0x36cb74[_0xaf09('0x18')][_0xaf09('0x1b')]||null:null,'include':_0x36cb74[_0xaf09('0x18')]?_0x36cb74[_0xaf09('0x18')][_0xaf09('0x1c')]?_[_0xaf09('0x1d')](_0x36cb74[_0xaf09('0x18')][_0xaf09('0x1c')],function(_0x2e7194){return{'model':db[_0x2e7194[_0xaf09('0x1e')]],'as':_0x2e7194['as'],'attributes':_0x2e7194['attributes'],'include':_0x2e7194[_0xaf09('0x1c')]?_[_0xaf09('0x1d')](_0x2e7194[_0xaf09('0x1c')],function(_0x191871){return{'model':db[_0x191871['model']],'as':_0x191871['as'],'attributes':_0x191871[_0xaf09('0x1a')],'include':_0x191871['include']?_[_0xaf09('0x1d')](_0x191871[_0xaf09('0x1c')],function(_0x389e55){return{'model':db[_0x389e55['model']],'as':_0x389e55['as'],'attributes':_0x389e55[_0xaf09('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xaf09('0xc')](function(_0x5c534f){logger[_0xaf09('0xd')](_0xaf09('0x15'),_0x36cb74);logger['debug'](_0xaf09('0x15'),_0x36cb74,JSON[_0xaf09('0x1f')](_0x5c534f));_0x488b0b(_0x5c534f);})[_0xaf09('0x20')](function(_0x5c8930){logger[_0xaf09('0x10')](_0xaf09('0x15'),_0x5c8930[_0xaf09('0x12')],_0x36cb74);_0x22197a(_0x29cadd['error'](0x1f4,_0x5c8930['message']));});});};exports[_0xaf09('0x21')]=function(_0x17c2f7,_0x551b28,_0x23a0a4){var _0x259eaa=this;return new Promise(function(_0x193369,_0x14eeb7){var _0x397d8d={'body':_0x17c2f7[_0xaf09('0x22')],'channel':_0xaf09('0x23')};var _0x2942a1=[];var _0x1ac2b3=[];var _0x377e53={};return db[_0xaf09('0x24')][_0xaf09('0x25')]()[_0xaf09('0xc')](function(_0x21a67b){if(!_0x21a67b){throw new db['Sequelize']['ValidationError'](_0xaf09('0x26'));}_0x2942a1=_[_0xaf09('0x27')](_[_0xaf09('0x28')](_0x21a67b),[_0xaf09('0x29'),_0xaf09('0x2a')]);_0x1ac2b3=_[_0xaf09('0x27')](_[_0xaf09('0x28')](_0x21a67b),[_0xaf09('0x29'),_0xaf09('0x2a'),'CompanyId',_0xaf09('0x2b')]);if(_0x17c2f7[_0xaf09('0x22')]['id']){delete _0x17c2f7[_0xaf09('0x22')]['id'];}if(_[_0xaf09('0x2c')](_0x17c2f7[_0xaf09('0x22')]['from'])){throw new db['Sequelize'][(_0xaf09('0x2d'))](_0xaf09('0x2e'));}if(_[_0xaf09('0x2c')](_0x17c2f7[_0xaf09('0x22')][_0xaf09('0x22')])||_0x17c2f7[_0xaf09('0x22')]['body']===''){throw new db['Sequelize'][(_0xaf09('0x2d'))](_0xaf09('0x2f'));}if(_[_0xaf09('0x2c')](_0x17c2f7['body'][_0xaf09('0x30')])){throw new db[(_0xaf09('0x31'))][(_0xaf09('0x2d'))](_0xaf09('0x32')+_0x1ac2b3);}if(!_[_0xaf09('0x33')](_0x1ac2b3,_0x17c2f7[_0xaf09('0x22')]['mapKey'])){throw new db[(_0xaf09('0x31'))][(_0xaf09('0x2d'))](_0xaf09('0x34')+_0x1ac2b3);}_0x377e53[_0x17c2f7['body'][_0xaf09('0x30')]]=_0x17c2f7[_0xaf09('0x22')]['from'];})[_0xaf09('0xc')](function(){return db[_0xaf09('0x16')][_0xaf09('0x35')]({'where':{'id':_0x17c2f7['account']['id']},'include':[{'model':db[_0xaf09('0x36')],'as':_0xaf09('0x37'),'include':[{'model':db[_0xaf09('0x24')],'as':_0xaf09('0x38'),'where':_0x377e53,'limit':0x1,'order':[[_0xaf09('0x2a'),_0xaf09('0x39')]]}]},{'model':db[_0xaf09('0x3a')],'as':_0xaf09('0x3b')}]});})[_0xaf09('0xc')](function(_0x1b397b){if(_0x1b397b&&_0x1b397b['List']){var _0x5954d9=_0x1b397b['get']({'plain':!![]});_0x397d8d[_0xaf09('0x3c')]=_0x5954d9;_0x397d8d[_0xaf09('0x3d')]=_0x5954d9[_0xaf09('0x3b')];_0x397d8d['list']=_0x5954d9[_0xaf09('0x37')];_0x397d8d[_0xaf09('0x3d')]=_[_0xaf09('0x3e')](_0x397d8d['applications'],[_0xaf09('0x3f')],[_0xaf09('0x40')]);if(_0x397d8d[_0xaf09('0x3c')]['Applications']){delete _0x397d8d['account']['Applications'];}if(_0x397d8d[_0xaf09('0x3c')][_0xaf09('0x37')]&&_0x397d8d[_0xaf09('0x3c')][_0xaf09('0x37')][_0xaf09('0x38')]['length']){return _0x397d8d[_0xaf09('0x3c')][_0xaf09('0x37')][_0xaf09('0x38')][0x0];}var _0x5d0d66=_[_0xaf09('0x41')](_0x17c2f7[_0xaf09('0x22')],{'firstName':_0x17c2f7[_0xaf09('0x22')]['from'],'ListId':_0x5954d9['ListId']});_0x5d0d66[_0x17c2f7[_0xaf09('0x22')][_0xaf09('0x30')]]=_0x17c2f7[_0xaf09('0x22')][_0xaf09('0x42')];return db[_0xaf09('0x24')]['create'](_0x5d0d66,{'fields':_0x2942a1,'raw':!![]});}})[_0xaf09('0xc')](function(_0x232be1){_0x397d8d['contact']=_0x232be1;if(_0x232be1){var _0x12eab7={'ContactId':_0x232be1['id'],'FaxAccountId':_0x17c2f7[_0xaf09('0x3c')]['id'],'fax':_0x232be1[_0xaf09('0x23')]};return db[_0xaf09('0x43')][_0xaf09('0x35')]({'where':{'ContactId':_0x232be1['id'],'closed':![],'FaxAccountId':_0x17c2f7[_0xaf09('0x3c')]['id']}})[_0xaf09('0xc')](function(_0x8b44a9){if(_0x8b44a9){return[_0x8b44a9,![]];}return db[_0xaf09('0x43')][_0xaf09('0x44')](_0x12eab7)['then'](function(_0x348dcb){return[_0x348dcb,!![]];});});}else{throw new Error(_0xaf09('0x45'));}})['spread'](function(_0x4ef419,_0x3125b0){var _0x368aaf=_0x4ef419[_0xaf09('0x46')]({'plain':!![]});if(_0x3125b0){if(_0x397d8d[_0xaf09('0x3c')][_0xaf09('0x47')]){_0x397d8d[_0xaf09('0x3d')]['push']({'id':0x0,'priority':_0x397d8d[_0xaf09('0x3d')][_0xaf09('0x48')]+0x1,'app':_0xaf09('0x49'),'appdata':_0xaf09('0x4a'),'interval':_0xaf09('0x4b')});}_0x368aaf['created']=!![];}else{_0x368aaf[_0xaf09('0x4c')]=![];}_0x397d8d[_0xaf09('0x4d')]=_0x368aaf;return db[_0xaf09('0x4e')][_0xaf09('0x44')]({'body':_0x17c2f7[_0xaf09('0x22')][_0xaf09('0x22')],'FaxAccountId':_0x17c2f7[_0xaf09('0x3c')]['id'],'FaxInteractionId':_0x4ef419['id'],'direction':'in','ContactId':_0x4ef419[_0xaf09('0x4f')],'AttachmentId':_0x17c2f7['body'][_0xaf09('0x50')]});})['then'](function(_0x43fbed){_0x397d8d['message']=_0x43fbed;if(_0x397d8d['interaction'][_0xaf09('0x51')]){return db[_0xaf09('0x52')]['find']({'attributes':['id','name'],'where':{'id':_0x397d8d[_0xaf09('0x4d')][_0xaf09('0x51')]}})[_0xaf09('0xc')](function(_0x1adb64){if(_0x1adb64){_0x397d8d[_0xaf09('0x3d')][_0xaf09('0x53')]({'id':0x0,'priority':0x0,'app':_0xaf09('0x54'),'appdata':_0x1adb64[_0xaf09('0x55')]+','+(_0x397d8d['account'][_0xaf09('0x56')]||0xa),'interval':_0xaf09('0x4b')});}return respondWithRpcPromise(_0xaf09('0x57'),'startRouting',_0x397d8d);});}return respondWithRpcPromise(_0xaf09('0x57'),_0xaf09('0x58'),_0x397d8d);})[_0xaf09('0xc')](function(_0xf06aa3){_0x193369(_0xf06aa3);})[_0xaf09('0x20')](function(_0x1de462){_0x14eeb7(_0x259eaa[_0xaf09('0x10')](0x1f4,_0x1de462['message']));});});};
\ No newline at end of file
index c4ce53d..3500e37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2da8=['./faxAccount.events','save','remove','update','emit','removeListener','register','length','faxAccount:'];(function(_0x1ada8b,_0x2b4817){var _0x5ca2e7=function(_0x72b2f){while(--_0x72b2f){_0x1ada8b['push'](_0x1ada8b['shift']());}};_0x5ca2e7(++_0x2b4817);}(_0x2da8,0x7e));var _0x82da=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2da8[_0x40a045];return _0x1a687c;};'use strict';var FaxAccountEvents=require(_0x82da('0x0'));var events=[_0x82da('0x1'),_0x82da('0x2'),_0x82da('0x3')];function createListener(_0x395087,_0x5eea16){return function(_0x1056e0){_0x5eea16[_0x82da('0x4')](_0x395087,_0x1056e0);};}function removeListener(_0x3eb27b,_0x1d2cce){return function(){FaxAccountEvents[_0x82da('0x5')](_0x3eb27b,_0x1d2cce);};}exports[_0x82da('0x6')]=function(_0x10d924){for(var _0x2675be=0x0,_0x2f5985=events[_0x82da('0x7')];_0x2675be<_0x2f5985;_0x2675be++){var _0x363d74=events[_0x2675be];var _0x309a56=createListener(_0x82da('0x8')+_0x363d74,_0x10d924);FaxAccountEvents['on'](_0x363d74,_0x309a56);}};
\ No newline at end of file
+var _0xd9d3=['./faxAccount.events','save','remove','emit','register','length','faxAccount:'];(function(_0x49b9bb,_0x9bd8cf){var _0x14776e=function(_0x4e5233){while(--_0x4e5233){_0x49b9bb['push'](_0x49b9bb['shift']());}};_0x14776e(++_0x9bd8cf);}(_0xd9d3,0xd2));var _0x3d9d=function(_0x1a9241,_0x1f978d){_0x1a9241=_0x1a9241-0x0;var _0x2b9944=_0xd9d3[_0x1a9241];return _0x2b9944;};'use strict';var FaxAccountEvents=require(_0x3d9d('0x0'));var events=[_0x3d9d('0x1'),_0x3d9d('0x2'),'update'];function createListener(_0x91e116,_0x2eec72){return function(_0x5b30b7){_0x2eec72[_0x3d9d('0x3')](_0x91e116,_0x5b30b7);};}function removeListener(_0x2bf729,_0x3fffc0){return function(){FaxAccountEvents['removeListener'](_0x2bf729,_0x3fffc0);};}exports[_0x3d9d('0x4')]=function(_0x4e7b7b){for(var _0x3d01b5=0x0,_0x15919e=events[_0x3d9d('0x5')];_0x3d01b5<_0x15919e;_0x3d01b5++){var _0x463fc5=events[_0x3d01b5];var _0x1ce3db=createListener(_0x3d9d('0x6')+_0x463fc5,_0x4e7b7b);FaxAccountEvents['on'](_0x463fc5,_0x1ce3db);}};
\ No newline at end of file
index 385baea..29ac2d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41e0=['isAuthenticated','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/messages','getMessages','post','create','/:id/dispositions','addAnswer','/:id/interactions','addApplications','/addaccountapplications','addAccountApplications','updateAccountApplications','/:id/send','send','/:id/users','addAgents','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0x41e0,0x107));var _0x041e=function(_0x2ea6c1,_0x13c12b){_0x2ea6c1=_0x2ea6c1-0x0;var _0x11cf31=_0x41e0[_0x2ea6c1];return _0x11cf31;};'use strict';var multer=require(_0x041e('0x0'));var util=require(_0x041e('0x1'));var path=require(_0x041e('0x2'));var express=require(_0x041e('0x3'));var router=express[_0x041e('0x4')]();var auth=require(_0x041e('0x5'));var interaction=require(_0x041e('0x6'));var config=require(_0x041e('0x7'));var controller=require('./faxAccount.controller');router[_0x041e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x041e('0x8')](_0x041e('0x9'),auth[_0x041e('0xa')](),controller[_0x041e('0xb')]);router['get'](_0x041e('0xc'),auth[_0x041e('0xa')](),controller['show']);router[_0x041e('0x8')]('/:id/dispositions',auth[_0x041e('0xa')](),controller[_0x041e('0xd')]);router[_0x041e('0x8')](_0x041e('0xe'),auth[_0x041e('0xa')](),controller[_0x041e('0xf')]);router[_0x041e('0x8')]('/:id/interactions',auth[_0x041e('0xa')](),controller['getInteractions']);router[_0x041e('0x8')](_0x041e('0x10'),auth['isAuthenticated'](),controller['getApplications']);router[_0x041e('0x8')](_0x041e('0x11'),auth[_0x041e('0xa')](),controller[_0x041e('0x12')]);router[_0x041e('0x8')]('/:id/users',auth[_0x041e('0xa')](),controller['getAgents']);router[_0x041e('0x13')]('/',auth[_0x041e('0xa')](),controller[_0x041e('0x14')]);router['post'](_0x041e('0x15'),auth[_0x041e('0xa')](),controller['addDisposition']);router['post'](_0x041e('0xe'),auth[_0x041e('0xa')](),controller[_0x041e('0x16')]);router[_0x041e('0x13')](_0x041e('0x17'),auth[_0x041e('0xa')](),controller['addInteraction']);router[_0x041e('0x13')](_0x041e('0x10'),auth[_0x041e('0xa')](),controller[_0x041e('0x18')]);router[_0x041e('0x13')](_0x041e('0x19'),auth[_0x041e('0xa')](),controller[_0x041e('0x1a')]);router['post']('/updateaccountapplications',auth[_0x041e('0xa')](),controller[_0x041e('0x1b')]);router[_0x041e('0x13')](_0x041e('0x1c'),auth['isAuthenticated'](),controller[_0x041e('0x1d')]);router['post'](_0x041e('0x1e'),auth[_0x041e('0xa')](),controller[_0x041e('0x1f')]);router[_0x041e('0x20')]('/:id',auth[_0x041e('0xa')](),controller['update']);router[_0x041e('0x21')](_0x041e('0xc'),auth[_0x041e('0xa')](),controller[_0x041e('0x22')]);router[_0x041e('0x21')](_0x041e('0x15'),auth[_0x041e('0xa')](),controller[_0x041e('0x23')]);router[_0x041e('0x21')](_0x041e('0xe'),auth[_0x041e('0xa')](),controller[_0x041e('0x24')]);router[_0x041e('0x21')](_0x041e('0x1e'),auth['isAuthenticated'](),controller[_0x041e('0x25')]);module[_0x041e('0x26')]=router;
\ No newline at end of file
+var _0xe0f5=['isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','post','create','addAnswer','/:id/interactions','addApplications','addAccountApplications','/updateaccountapplications','/:id/users','addAgents','put','/:id','update','destroy','delete','removeAnswers','exports','multer','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get'];(function(_0x4c975c,_0x3f71b6){var _0xf90e1f=function(_0xf7ee81){while(--_0xf7ee81){_0x4c975c['push'](_0x4c975c['shift']());}};_0xf90e1f(++_0x3f71b6);}(_0xe0f5,0x1a9));var _0x5e0f=function(_0x37f79c,_0x38f023){_0x37f79c=_0x37f79c-0x0;var _0x3e8566=_0xe0f5[_0x37f79c];return _0x3e8566;};'use strict';var multer=require(_0x5e0f('0x0'));var util=require('util');var path=require(_0x5e0f('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x5e0f('0x2'));var interaction=require(_0x5e0f('0x3'));var config=require(_0x5e0f('0x4'));var controller=require(_0x5e0f('0x5'));router[_0x5e0f('0x6')]('/',auth[_0x5e0f('0x7')](),controller[_0x5e0f('0x8')]);router[_0x5e0f('0x6')](_0x5e0f('0x9'),auth[_0x5e0f('0x7')](),controller['describe']);router[_0x5e0f('0x6')]('/:id',auth[_0x5e0f('0x7')](),controller[_0x5e0f('0xa')]);router['get'](_0x5e0f('0xb'),auth[_0x5e0f('0x7')](),controller[_0x5e0f('0xc')]);router[_0x5e0f('0x6')](_0x5e0f('0xd'),auth['isAuthenticated'](),controller[_0x5e0f('0xe')]);router[_0x5e0f('0x6')]('/:id/interactions',auth[_0x5e0f('0x7')](),controller[_0x5e0f('0xf')]);router[_0x5e0f('0x6')](_0x5e0f('0x10'),auth[_0x5e0f('0x7')](),controller[_0x5e0f('0x11')]);router[_0x5e0f('0x6')](_0x5e0f('0x12'),auth['isAuthenticated'](),controller[_0x5e0f('0x13')]);router['get']('/:id/users',auth[_0x5e0f('0x7')](),controller['getAgents']);router[_0x5e0f('0x14')]('/',auth[_0x5e0f('0x7')](),controller[_0x5e0f('0x15')]);router[_0x5e0f('0x14')](_0x5e0f('0xb'),auth[_0x5e0f('0x7')](),controller['addDisposition']);router[_0x5e0f('0x14')](_0x5e0f('0xd'),auth[_0x5e0f('0x7')](),controller[_0x5e0f('0x16')]);router['post'](_0x5e0f('0x17'),auth[_0x5e0f('0x7')](),controller['addInteraction']);router['post'](_0x5e0f('0x10'),auth['isAuthenticated'](),controller[_0x5e0f('0x18')]);router[_0x5e0f('0x14')]('/addaccountapplications',auth[_0x5e0f('0x7')](),controller[_0x5e0f('0x19')]);router[_0x5e0f('0x14')](_0x5e0f('0x1a'),auth[_0x5e0f('0x7')](),controller['updateAccountApplications']);router['post']('/:id/send',auth[_0x5e0f('0x7')](),controller['send']);router[_0x5e0f('0x14')](_0x5e0f('0x1b'),auth[_0x5e0f('0x7')](),controller[_0x5e0f('0x1c')]);router[_0x5e0f('0x1d')](_0x5e0f('0x1e'),auth[_0x5e0f('0x7')](),controller[_0x5e0f('0x1f')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5e0f('0x20')]);router[_0x5e0f('0x21')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x5e0f('0x21')](_0x5e0f('0xd'),auth[_0x5e0f('0x7')](),controller[_0x5e0f('0x22')]);router[_0x5e0f('0x21')]('/:id/users',auth[_0x5e0f('0x7')](),controller['removeAgents']);module[_0x5e0f('0x23')]=router;
\ No newline at end of file
index 0ee1550..177cc3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44c6=['exports','STRING','noop'];(function(_0x526e3b,_0x3404e0){var _0x37c068=function(_0x3d9694){while(--_0x3d9694){_0x526e3b['push'](_0x526e3b['shift']());}};_0x37c068(++_0x3404e0);}(_0x44c6,0xae));var _0x644c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x44c6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x644c('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x644c('0x1')],'allowNull':![],'defaultValue':_0x644c('0x2')},'appdata':{'type':Sequelize['STRING'](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0x644c('0x1')]},'interval':{'type':Sequelize[_0x644c('0x1')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xb84e=['STRING','noop','sequelize','exports','INTEGER'];(function(_0x5eb20b,_0x4b8c24){var _0x408b22=function(_0x2e1903){while(--_0x2e1903){_0x5eb20b['push'](_0x5eb20b['shift']());}};_0x408b22(++_0x4b8c24);}(_0xb84e,0x19c));var _0xeb84=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0xb84e[_0x44a64f];return _0x52024b;};'use strict';var Sequelize=require(_0xeb84('0x0'));module[_0xeb84('0x1')]={'priority':{'type':Sequelize[_0xeb84('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xeb84('0x3')],'allowNull':![],'defaultValue':_0xeb84('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'defaultValue':''},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xeb84('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 91343e3..a2426eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05ff=['model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','add','day','where','filter','map','merge','options','count','includeAll','include','rows','show','find','catch','create','body','params','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','FaxApplication','rawAttributes'];(function(_0x179e11,_0xf65436){var _0x549f04=function(_0x610545){while(--_0x610545){_0x179e11['push'](_0x179e11['shift']());}};_0x549f04(++_0xf65436);}(_0x05ff,0xeb));var _0xf05f=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x05ff[_0x187ee1];return _0x388160;};'use strict';var pdf=require(_0xf05f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf05f('0x1'));var zipdir=require(_0xf05f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf05f('0x3'));var moment=require(_0xf05f('0x4'));var BPromise=require(_0xf05f('0x5'));var Mustache=require(_0xf05f('0x6'));var util=require('util');var path=require(_0xf05f('0x7'));var sox=require(_0xf05f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf05f('0x9'));var squel=require(_0xf05f('0xa'));var crypto=require(_0xf05f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf05f('0xc'));var toCsv=require(_0xf05f('0xd'));var querystring=require(_0xf05f('0xe'));var Papa=require(_0xf05f('0xf'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf05f('0x10'));var db=require(_0xf05f('0x11'))['db'];function respondWithStatusCode(_0x392358,_0x55298e){_0x55298e=_0x55298e||0xcc;return function(_0x3b7ade){if(_0x3b7ade){return _0x392358[_0xf05f('0x12')](_0x55298e);}return _0x392358[_0xf05f('0x13')](_0x55298e)[_0xf05f('0x14')]();};}function respondWithResult(_0x63086c,_0x235303){_0x235303=_0x235303||0xc8;return function(_0x5a4c2e){if(_0x5a4c2e){return _0x63086c[_0xf05f('0x13')](_0x235303)[_0xf05f('0x15')](_0x5a4c2e);}};}function respondWithFilteredResult(_0x3e4c5e,_0x60bc68){return function(_0x4a71a3){if(_0x4a71a3){var _0x6e1094=_0x4a71a3['count'],_0x981334=_0x60bc68[_0xf05f('0x16')],_0x51ffb8=_0x60bc68['offset']+_0x60bc68[_0xf05f('0x17')],_0x3cdfa1;if(_0x51ffb8>=_0x6e1094){_0x51ffb8=_0x6e1094;_0x3cdfa1=0xc8;}else{_0x3cdfa1=0xce;}_0x3e4c5e['status'](_0x3cdfa1);return _0x3e4c5e[_0xf05f('0x18')](_0xf05f('0x19'),_0x981334+'-'+_0x51ffb8+'/'+_0x6e1094)['json'](_0x4a71a3);}return null;};}function patchUpdates(_0xfe5c06){return function(_0x4a69d6){try{jsonpatch['apply'](_0x4a69d6,_0xfe5c06,!![]);}catch(_0xd9e00b){return BPromise[_0xf05f('0x1a')](_0xd9e00b);}return _0x4a69d6[_0xf05f('0x1b')]();};}function saveUpdates(_0x190fb3,_0x5b6616){return function(_0x5331ac){if(_0x5331ac){return _0x5331ac[_0xf05f('0x1c')](_0x190fb3)[_0xf05f('0x1d')](function(_0x5a1d74){return _0x5a1d74;});}return null;};}function removeEntity(_0x2a7054,_0x5df2b2){return function(_0x45e1f1){if(_0x45e1f1){return _0x45e1f1[_0xf05f('0x1e')]()[_0xf05f('0x1d')](function(){_0x2a7054[_0xf05f('0x13')](0xcc)[_0xf05f('0x14')]();});}};}function handleEntityNotFound(_0x5119b2,_0x9a0495){return function(_0x2fbf15){if(!_0x2fbf15){_0x5119b2[_0xf05f('0x12')](0x194);}return _0x2fbf15;};}function handleError(_0xfe5edd,_0x3c8355){_0x3c8355=_0x3c8355||0x1f4;return function(_0x32fb79){logger[_0xf05f('0x1f')](_0x32fb79[_0xf05f('0x20')]);if(_0x32fb79[_0xf05f('0x21')]){delete _0x32fb79[_0xf05f('0x21')];}_0xfe5edd[_0xf05f('0x13')](_0x3c8355)[_0xf05f('0x22')](_0x32fb79);};}exports['index']=function(_0x44958d,_0x560a47){var _0x270b01={},_0x22d800={},_0x46edec={'count':0x0,'rows':[]};var _0x4e4219=db[_0xf05f('0x23')][_0xf05f('0x24')];_0x22d800[_0xf05f('0x25')]=_[_0xf05f('0x26')](_0x4e4219);var _0x195fcb={'dateStart':_0x44958d[_0xf05f('0x27')][_0xf05f('0x28')],'dateEnd':_0x44958d['query'][_0xf05f('0x29')]};delete _0x44958d[_0xf05f('0x27')]['dateStart'];delete _0x44958d[_0xf05f('0x27')]['dateEnd'];_0x22d800[_0xf05f('0x27')]=_[_0xf05f('0x26')](_0x44958d[_0xf05f('0x27')]);_0x22d800[_0xf05f('0x2a')]=_[_0xf05f('0x2b')](_0x22d800['model'],_0x22d800['query']);_0x270b01[_0xf05f('0x2c')]=_['intersection'](_0x22d800[_0xf05f('0x25')],qs[_0xf05f('0x2d')](_0x44958d[_0xf05f('0x27')][_0xf05f('0x2d')]));_0x270b01[_0xf05f('0x2c')]=_0x270b01[_0xf05f('0x2c')][_0xf05f('0x2e')]?_0x270b01[_0xf05f('0x2c')]:_0x22d800[_0xf05f('0x25')];if(!_0x44958d[_0xf05f('0x27')][_0xf05f('0x2f')](_0xf05f('0x30'))){_0x270b01['limit']=qs['limit'](_0x44958d[_0xf05f('0x27')][_0xf05f('0x17')]);_0x270b01[_0xf05f('0x16')]=qs[_0xf05f('0x16')](_0x44958d['query']['offset']);}_0x270b01['order']=qs[_0xf05f('0x31')](_0x44958d['query'][_0xf05f('0x31')]);_0x270b01['where']=qs[_0xf05f('0x2a')](_[_0xf05f('0x32')](_0x44958d[_0xf05f('0x27')],_0x22d800['filters']));if(_0x195fcb['dateStart']){if(_0x195fcb[_0xf05f('0x29')]){_0x195fcb[_0xf05f('0x29')]=moment(_0x195fcb['dateEnd'])[_0xf05f('0x33')](0x1,_0xf05f('0x34'));}else{_0x195fcb[_0xf05f('0x29')]=moment(_0x195fcb[_0xf05f('0x28')])[_0xf05f('0x33')](0x1,_0xf05f('0x34'));}_['merge'](_0x270b01[_0xf05f('0x35')],{'createdAt':{'$gte':_0x195fcb[_0xf05f('0x28')],'$lte':_0x195fcb['dateEnd']}});}if(_0x44958d['query'][_0xf05f('0x36')]){_0x270b01['where']=_['merge'](_0x270b01['where'],{'$or':_[_0xf05f('0x37')](_0x270b01[_0xf05f('0x2c')],function(_0x564481){var _0x2b338d={};_0x2b338d[_0x564481]={'$like':'%'+_0x44958d[_0xf05f('0x27')]['filter']+'%'};return _0x2b338d;})});}_0x270b01=_[_0xf05f('0x38')]({},_0x270b01,_0x44958d[_0xf05f('0x39')]);var _0x29812b={'where':_0x270b01[_0xf05f('0x35')]};return db['FaxApplication']['count'](_0x29812b)['then'](function(_0x4d2f2a){_0x46edec[_0xf05f('0x3a')]=_0x4d2f2a;if(_0x44958d[_0xf05f('0x27')][_0xf05f('0x3b')]){_0x270b01[_0xf05f('0x3c')]=[{'all':!![]}];}return db[_0xf05f('0x23')]['findAll'](_0x270b01);})[_0xf05f('0x1d')](function(_0x5d2840){_0x46edec[_0xf05f('0x3d')]=_0x5d2840;return _0x46edec;})[_0xf05f('0x1d')](respondWithFilteredResult(_0x560a47,_0x270b01))['catch'](handleError(_0x560a47,null));};exports[_0xf05f('0x3e')]=function(_0x3384dc,_0x29798f){var _0x2ada4f={'raw':!![],'where':{'id':_0x3384dc['params']['id']}},_0x331bc7={};_0x331bc7[_0xf05f('0x25')]=_[_0xf05f('0x26')](db[_0xf05f('0x23')][_0xf05f('0x24')]);_0x331bc7[_0xf05f('0x27')]=_['keys'](_0x3384dc['query']);_0x331bc7[_0xf05f('0x2a')]=_[_0xf05f('0x2b')](_0x331bc7[_0xf05f('0x25')],_0x331bc7[_0xf05f('0x27')]);_0x2ada4f[_0xf05f('0x2c')]=_['intersection'](_0x331bc7['model'],qs[_0xf05f('0x2d')](_0x3384dc[_0xf05f('0x27')][_0xf05f('0x2d')]));_0x2ada4f[_0xf05f('0x2c')]=_0x2ada4f[_0xf05f('0x2c')][_0xf05f('0x2e')]?_0x2ada4f[_0xf05f('0x2c')]:_0x331bc7[_0xf05f('0x25')];if(_0x3384dc[_0xf05f('0x27')][_0xf05f('0x3b')]){_0x2ada4f[_0xf05f('0x3c')]=[{'all':!![]}];}_0x2ada4f=_[_0xf05f('0x38')]({},_0x2ada4f,_0x3384dc[_0xf05f('0x39')]);return db['FaxApplication'][_0xf05f('0x3f')](_0x2ada4f)[_0xf05f('0x1d')](handleEntityNotFound(_0x29798f,null))[_0xf05f('0x1d')](respondWithResult(_0x29798f,null))[_0xf05f('0x40')](handleError(_0x29798f,null));};exports[_0xf05f('0x41')]=function(_0x3d2641,_0x27ccdb){return db[_0xf05f('0x23')][_0xf05f('0x41')](_0x3d2641[_0xf05f('0x42')],{})[_0xf05f('0x1d')](respondWithResult(_0x27ccdb,0xc9))[_0xf05f('0x40')](handleError(_0x27ccdb,null));};exports[_0xf05f('0x1c')]=function(_0x3eff98,_0x402196){if(_0x3eff98[_0xf05f('0x42')]['id']){delete _0x3eff98[_0xf05f('0x42')]['id'];}return db[_0xf05f('0x23')][_0xf05f('0x3f')]({'where':{'id':_0x3eff98[_0xf05f('0x43')]['id']}})[_0xf05f('0x1d')](handleEntityNotFound(_0x402196,null))[_0xf05f('0x1d')](saveUpdates(_0x3eff98[_0xf05f('0x42')],null))[_0xf05f('0x1d')](respondWithResult(_0x402196,null))['catch'](handleError(_0x402196,null));};exports[_0xf05f('0x1e')]=function(_0xfc2aa6,_0x31d064){return db[_0xf05f('0x23')][_0xf05f('0x3f')]({'where':{'id':_0xfc2aa6[_0xf05f('0x43')]['id']}})[_0xf05f('0x1d')](handleEntityNotFound(_0x31d064,null))[_0xf05f('0x1d')](removeEntity(_0x31d064,null))[_0xf05f('0x40')](handleError(_0x31d064,null));};
\ No newline at end of file
+var _0xa44f=['papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','apply','update','then','destroy','error','stack','name','send','index','FaxApplication','model','keys','query','dateEnd','dateStart','filters','attributes','intersection','fields','length','order','sort','where','add','day','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x4358f5,_0x5b1ac6){var _0x4d8104=function(_0x1d4aee){while(--_0x1d4aee){_0x4358f5['push'](_0x4358f5['shift']());}};_0x4d8104(++_0x5b1ac6);}(_0xa44f,0xf9));var _0xfa44=function(_0x3126f5,_0x417015){_0x3126f5=_0x3126f5-0x0;var _0x4bc77d=_0xa44f[_0x3126f5];return _0x4bc77d;};'use strict';var pdf=require(_0xfa44('0x0'));var emlformat=require(_0xfa44('0x1'));var rimraf=require(_0xfa44('0x2'));var zipdir=require(_0xfa44('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfa44('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfa44('0x5'));var util=require('util');var path=require(_0xfa44('0x6'));var sox=require('sox');var csv=require(_0xfa44('0x7'));var ejs=require(_0xfa44('0x8'));var fs=require('fs');var _=require(_0xfa44('0x9'));var squel=require(_0xfa44('0xa'));var crypto=require(_0xfa44('0xb'));var jsforce=require(_0xfa44('0xc'));var deskjs=require(_0xfa44('0xd'));var toCsv=require(_0xfa44('0x7'));var querystring=require(_0xfa44('0xe'));var Papa=require(_0xfa44('0xf'));var qs=require(_0xfa44('0x10'));var logger=require(_0xfa44('0x11'))('api');var utils=require(_0xfa44('0x12'));var config=require('../../config/environment');var db=require(_0xfa44('0x13'))['db'];function respondWithStatusCode(_0x2142c0,_0x5b203b){_0x5b203b=_0x5b203b||0xcc;return function(_0x133358){if(_0x133358){return _0x2142c0[_0xfa44('0x14')](_0x5b203b);}return _0x2142c0[_0xfa44('0x15')](_0x5b203b)[_0xfa44('0x16')]();};}function respondWithResult(_0x156b11,_0x288906){_0x288906=_0x288906||0xc8;return function(_0xcfac22){if(_0xcfac22){return _0x156b11[_0xfa44('0x15')](_0x288906)['json'](_0xcfac22);}};}function respondWithFilteredResult(_0x125240,_0x26b022){return function(_0x2b70e4){if(_0x2b70e4){var _0x4dd269=_0x2b70e4[_0xfa44('0x17')],_0x14363e=_0x26b022[_0xfa44('0x18')],_0x1312db=_0x26b022[_0xfa44('0x18')]+_0x26b022[_0xfa44('0x19')],_0x611328;if(_0x1312db>=_0x4dd269){_0x1312db=_0x4dd269;_0x611328=0xc8;}else{_0x611328=0xce;}_0x125240[_0xfa44('0x15')](_0x611328);return _0x125240[_0xfa44('0x1a')]('Content-Range',_0x14363e+'-'+_0x1312db+'/'+_0x4dd269)['json'](_0x2b70e4);}return null;};}function patchUpdates(_0x16549c){return function(_0xd25ebd){try{jsonpatch[_0xfa44('0x1b')](_0xd25ebd,_0x16549c,!![]);}catch(_0xb81bf4){return BPromise['reject'](_0xb81bf4);}return _0xd25ebd['save']();};}function saveUpdates(_0x48017a,_0x47950e){return function(_0x1e908d){if(_0x1e908d){return _0x1e908d[_0xfa44('0x1c')](_0x48017a)[_0xfa44('0x1d')](function(_0x167460){return _0x167460;});}return null;};}function removeEntity(_0xea8f09,_0x75a5b4){return function(_0x52c680){if(_0x52c680){return _0x52c680[_0xfa44('0x1e')]()[_0xfa44('0x1d')](function(){_0xea8f09[_0xfa44('0x15')](0xcc)[_0xfa44('0x16')]();});}};}function handleEntityNotFound(_0x32ed57,_0x3fa226){return function(_0x124f27){if(!_0x124f27){_0x32ed57['sendStatus'](0x194);}return _0x124f27;};}function handleError(_0x5b57ef,_0x83e1d3){_0x83e1d3=_0x83e1d3||0x1f4;return function(_0x3f3b7b){logger[_0xfa44('0x1f')](_0x3f3b7b[_0xfa44('0x20')]);if(_0x3f3b7b[_0xfa44('0x21')]){delete _0x3f3b7b[_0xfa44('0x21')];}_0x5b57ef[_0xfa44('0x15')](_0x83e1d3)[_0xfa44('0x22')](_0x3f3b7b);};}exports[_0xfa44('0x23')]=function(_0x584e95,_0x109d21){var _0xdb7dcd={},_0xdb6de4={},_0x4bede7={'count':0x0,'rows':[]};var _0x1a9f1c=db[_0xfa44('0x24')]['rawAttributes'];_0xdb6de4[_0xfa44('0x25')]=_[_0xfa44('0x26')](_0x1a9f1c);var _0x1e6243={'dateStart':_0x584e95[_0xfa44('0x27')]['dateStart'],'dateEnd':_0x584e95[_0xfa44('0x27')][_0xfa44('0x28')]};delete _0x584e95[_0xfa44('0x27')][_0xfa44('0x29')];delete _0x584e95[_0xfa44('0x27')][_0xfa44('0x28')];_0xdb6de4[_0xfa44('0x27')]=_[_0xfa44('0x26')](_0x584e95['query']);_0xdb6de4[_0xfa44('0x2a')]=_['intersection'](_0xdb6de4['model'],_0xdb6de4[_0xfa44('0x27')]);_0xdb7dcd[_0xfa44('0x2b')]=_[_0xfa44('0x2c')](_0xdb6de4['model'],qs[_0xfa44('0x2d')](_0x584e95[_0xfa44('0x27')][_0xfa44('0x2d')]));_0xdb7dcd['attributes']=_0xdb7dcd[_0xfa44('0x2b')][_0xfa44('0x2e')]?_0xdb7dcd[_0xfa44('0x2b')]:_0xdb6de4[_0xfa44('0x25')];if(!_0x584e95[_0xfa44('0x27')]['hasOwnProperty']('nolimit')){_0xdb7dcd['limit']=qs['limit'](_0x584e95[_0xfa44('0x27')]['limit']);_0xdb7dcd[_0xfa44('0x18')]=qs[_0xfa44('0x18')](_0x584e95[_0xfa44('0x27')][_0xfa44('0x18')]);}_0xdb7dcd[_0xfa44('0x2f')]=qs[_0xfa44('0x30')](_0x584e95[_0xfa44('0x27')][_0xfa44('0x30')]);_0xdb7dcd[_0xfa44('0x31')]=qs[_0xfa44('0x2a')](_['pick'](_0x584e95[_0xfa44('0x27')],_0xdb6de4[_0xfa44('0x2a')]));if(_0x1e6243[_0xfa44('0x29')]){if(_0x1e6243[_0xfa44('0x28')]){_0x1e6243['dateEnd']=moment(_0x1e6243[_0xfa44('0x28')])[_0xfa44('0x32')](0x1,_0xfa44('0x33'));}else{_0x1e6243[_0xfa44('0x28')]=moment(_0x1e6243[_0xfa44('0x29')])[_0xfa44('0x32')](0x1,_0xfa44('0x33'));}_['merge'](_0xdb7dcd[_0xfa44('0x31')],{'createdAt':{'$gte':_0x1e6243[_0xfa44('0x29')],'$lte':_0x1e6243[_0xfa44('0x28')]}});}if(_0x584e95[_0xfa44('0x27')][_0xfa44('0x34')]){_0xdb7dcd[_0xfa44('0x31')]=_[_0xfa44('0x35')](_0xdb7dcd['where'],{'$or':_[_0xfa44('0x36')](_0xdb7dcd[_0xfa44('0x2b')],function(_0x487401){var _0x3a869b={};_0x3a869b[_0x487401]={'$like':'%'+_0x584e95[_0xfa44('0x27')]['filter']+'%'};return _0x3a869b;})});}_0xdb7dcd=_[_0xfa44('0x35')]({},_0xdb7dcd,_0x584e95[_0xfa44('0x37')]);var _0x20dc31={'where':_0xdb7dcd[_0xfa44('0x31')]};return db[_0xfa44('0x24')][_0xfa44('0x17')](_0x20dc31)['then'](function(_0x1efe23){_0x4bede7[_0xfa44('0x17')]=_0x1efe23;if(_0x584e95['query'][_0xfa44('0x38')]){_0xdb7dcd[_0xfa44('0x39')]=[{'all':!![]}];}return db[_0xfa44('0x24')][_0xfa44('0x3a')](_0xdb7dcd);})[_0xfa44('0x1d')](function(_0x47df98){_0x4bede7[_0xfa44('0x3b')]=_0x47df98;return _0x4bede7;})[_0xfa44('0x1d')](respondWithFilteredResult(_0x109d21,_0xdb7dcd))[_0xfa44('0x3c')](handleError(_0x109d21,null));};exports[_0xfa44('0x3d')]=function(_0x489c25,_0x152f58){var _0x1c0604={'raw':!![],'where':{'id':_0x489c25['params']['id']}},_0xae095e={};_0xae095e[_0xfa44('0x25')]=_[_0xfa44('0x26')](db[_0xfa44('0x24')]['rawAttributes']);_0xae095e[_0xfa44('0x27')]=_[_0xfa44('0x26')](_0x489c25[_0xfa44('0x27')]);_0xae095e['filters']=_[_0xfa44('0x2c')](_0xae095e['model'],_0xae095e['query']);_0x1c0604['attributes']=_[_0xfa44('0x2c')](_0xae095e[_0xfa44('0x25')],qs[_0xfa44('0x2d')](_0x489c25[_0xfa44('0x27')][_0xfa44('0x2d')]));_0x1c0604['attributes']=_0x1c0604[_0xfa44('0x2b')][_0xfa44('0x2e')]?_0x1c0604['attributes']:_0xae095e[_0xfa44('0x25')];if(_0x489c25[_0xfa44('0x27')]['includeAll']){_0x1c0604['include']=[{'all':!![]}];}_0x1c0604=_[_0xfa44('0x35')]({},_0x1c0604,_0x489c25[_0xfa44('0x37')]);return db[_0xfa44('0x24')][_0xfa44('0x3e')](_0x1c0604)['then'](handleEntityNotFound(_0x152f58,null))['then'](respondWithResult(_0x152f58,null))[_0xfa44('0x3c')](handleError(_0x152f58,null));};exports[_0xfa44('0x3f')]=function(_0x2bc0f0,_0x20cebc){return db[_0xfa44('0x24')][_0xfa44('0x3f')](_0x2bc0f0[_0xfa44('0x40')],{})[_0xfa44('0x1d')](respondWithResult(_0x20cebc,0xc9))[_0xfa44('0x3c')](handleError(_0x20cebc,null));};exports[_0xfa44('0x1c')]=function(_0x1bcc40,_0x418604){if(_0x1bcc40[_0xfa44('0x40')]['id']){delete _0x1bcc40['body']['id'];}return db[_0xfa44('0x24')][_0xfa44('0x3e')]({'where':{'id':_0x1bcc40[_0xfa44('0x41')]['id']}})[_0xfa44('0x1d')](handleEntityNotFound(_0x418604,null))[_0xfa44('0x1d')](saveUpdates(_0x1bcc40[_0xfa44('0x40')],null))[_0xfa44('0x1d')](respondWithResult(_0x418604,null))[_0xfa44('0x3c')](handleError(_0x418604,null));};exports[_0xfa44('0x1e')]=function(_0x3c840c,_0x3f3c20){return db[_0xfa44('0x24')][_0xfa44('0x3e')]({'where':{'id':_0x3c840c[_0xfa44('0x41')]['id']}})[_0xfa44('0x1d')](handleEntityNotFound(_0x3f3c20,null))[_0xfa44('0x1d')](removeEntity(_0x3f3c20,null))[_0xfa44('0x3c')](handleError(_0x3f3c20,null));};
\ No newline at end of file
index 28614b5..7b4ae59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6b2=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','./faxApplication.attributes','exports','define','fax_applications'];(function(_0x53170d,_0xf3ce44){var _0x2008d2=function(_0x11c452){while(--_0x11c452){_0x53170d['push'](_0x53170d['shift']());}};_0x2008d2(++_0xf3ce44);}(_0xf6b2,0xdc));var _0x2f6b=function(_0x3acfc3,_0x4393b6){_0x3acfc3=_0x3acfc3-0x0;var _0x355bb1=_0xf6b2[_0x3acfc3];return _0x355bb1;};'use strict';var _=require(_0x2f6b('0x0'));var util=require(_0x2f6b('0x1'));var logger=require(_0x2f6b('0x2'))(_0x2f6b('0x3'));var moment=require(_0x2f6b('0x4'));var BPromise=require(_0x2f6b('0x5'));var rp=require(_0x2f6b('0x6'));var attributes=require(_0x2f6b('0x7'));module[_0x2f6b('0x8')]=function(_0xe85e52,_0x86fc64){return _0xe85e52[_0x2f6b('0x9')]('FaxApplication',attributes,{'tableName':_0x2f6b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc840=['define','FaxApplication','fax_applications','lodash','util','moment','bluebird','request-promise','./faxApplication.attributes','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc840,0x157));var _0x0c84=function(_0x353622,_0x2253b3){_0x353622=_0x353622-0x0;var _0xe9f64d=_0xc840[_0x353622];return _0xe9f64d;};'use strict';var _=require(_0x0c84('0x0'));var util=require(_0x0c84('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0c84('0x2'));var BPromise=require(_0x0c84('0x3'));var rp=require(_0x0c84('0x4'));var attributes=require(_0x0c84('0x5'));module[_0x0c84('0x6')]=function(_0x1d2b84,_0x2f2aed){return _0x1d2b84[_0x0c84('0x7')](_0x0c84('0x8'),attributes,{'tableName':_0x0c84('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f440d68..6b24f3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc76=['stringify','error','code','message','FaxApplication,\x20%s,\x20%s','catch','UpdateFaxApplication','FaxApplication','body','options','raw','where','attributes','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s'];(function(_0x51c143,_0x454386){var _0x65d4f6=function(_0x183c9b){while(--_0x183c9b){_0x51c143['push'](_0x51c143['shift']());}};_0x65d4f6(++_0x454386);}(_0xfc76,0xb5));var _0x6fc7=function(_0x244b4f,_0x10102a){_0x244b4f=_0x244b4f-0x0;var _0x39dab8=_0xfc76[_0x244b4f];return _0x39dab8;};'use strict';var _=require('lodash');var util=require(_0x6fc7('0x0'));var moment=require(_0x6fc7('0x1'));var BPromise=require(_0x6fc7('0x2'));var rs=require(_0x6fc7('0x3'));var fs=require('fs');var db=require(_0x6fc7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6fc7('0x5'))(_0x6fc7('0x6'));var config=require('../../config/environment');var jayson=require(_0x6fc7('0x7'));var client=jayson['client'][_0x6fc7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x82a35a,_0x385a5a,_0x4da7c3){return new BPromise(function(_0x21a64d,_0x407b0a){return client[_0x6fc7('0x9')](_0x82a35a,_0x4da7c3)[_0x6fc7('0xa')](function(_0x36cb16){logger[_0x6fc7('0xb')]('FaxApplication,\x20%s,\x20%s',_0x385a5a,_0x6fc7('0xc'));logger[_0x6fc7('0xd')](_0x6fc7('0xe'),_0x385a5a,_0x6fc7('0xc'),JSON[_0x6fc7('0xf')](_0x36cb16));if(_0x36cb16[_0x6fc7('0x10')]){if(_0x36cb16['error'][_0x6fc7('0x11')]===0x1f4){logger[_0x6fc7('0x10')]('FaxApplication,\x20%s,\x20%s',_0x385a5a,_0x36cb16[_0x6fc7('0x10')][_0x6fc7('0x12')]);return _0x407b0a(_0x36cb16['error'][_0x6fc7('0x12')]);}logger[_0x6fc7('0x10')]('FaxApplication,\x20%s,\x20%s',_0x385a5a,_0x36cb16[_0x6fc7('0x10')][_0x6fc7('0x12')]);return _0x21a64d(_0x36cb16[_0x6fc7('0x10')]['message']);}else{logger['info'](_0x6fc7('0x13'),_0x385a5a,_0x6fc7('0xc'));_0x21a64d(_0x36cb16['result'][_0x6fc7('0x12')]);}})[_0x6fc7('0x14')](function(_0x124cd6){logger[_0x6fc7('0x10')]('FaxApplication,\x20%s,\x20%s',_0x385a5a,_0x124cd6);_0x407b0a(_0x124cd6);});});}exports[_0x6fc7('0x15')]=function(_0x69ea70){var _0x280c69=this;return new Promise(function(_0x62ec76,_0x12be21){return db[_0x6fc7('0x16')]['update'](_0x69ea70[_0x6fc7('0x17')],{'raw':_0x69ea70[_0x6fc7('0x18')]?_0x69ea70[_0x6fc7('0x18')][_0x6fc7('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x69ea70[_0x6fc7('0x18')]?_0x69ea70['options'][_0x6fc7('0x1a')]||null:null,'attributes':_0x69ea70[_0x6fc7('0x18')]?_0x69ea70['options'][_0x6fc7('0x1b')]||null:null,'limit':_0x69ea70['options']?_0x69ea70[_0x6fc7('0x18')]['limit']||null:null})[_0x6fc7('0xa')](function(_0xdb5974){logger[_0x6fc7('0xb')]('UpdateFaxApplication',_0x69ea70);logger[_0x6fc7('0xd')]('UpdateFaxApplication',_0x69ea70,JSON[_0x6fc7('0xf')](_0xdb5974));_0x62ec76(_0xdb5974);})[_0x6fc7('0x14')](function(_0x2229a1){logger[_0x6fc7('0x10')](_0x6fc7('0x15'),_0x2229a1[_0x6fc7('0x12')],_0x69ea70);_0x12be21(_0x280c69[_0x6fc7('0x10')](0x1f4,_0x2229a1[_0x6fc7('0x12')]));});});};
\ No newline at end of file
+var _0x2123=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FaxApplication,\x20%s,\x20%s','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','body','options','raw','where','attributes','debug','lodash','util','moment'];(function(_0x37ea7a,_0x569587){var _0x155dd3=function(_0x239ecf){while(--_0x239ecf){_0x37ea7a['push'](_0x37ea7a['shift']());}};_0x155dd3(++_0x569587);}(_0x2123,0x190));var _0x3212=function(_0x649e9e,_0x549c01){_0x649e9e=_0x649e9e-0x0;var _0x2ff8a5=_0x2123[_0x649e9e];return _0x2ff8a5;};'use strict';var _=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var moment=require(_0x3212('0x2'));var BPromise=require(_0x3212('0x3'));var rs=require(_0x3212('0x4'));var fs=require('fs');var db=require(_0x3212('0x5'))['db'];var utils=require(_0x3212('0x6'));var logger=require(_0x3212('0x7'))(_0x3212('0x8'));var config=require(_0x3212('0x9'));var jayson=require(_0x3212('0xa'));var client=jayson[_0x3212('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3859e4,_0x2b1302,_0x1fec5d){return new BPromise(function(_0x4b35e9,_0x3e17a3){return client['request'](_0x3859e4,_0x1fec5d)[_0x3212('0xc')](function(_0x16bb75){logger[_0x3212('0xd')](_0x3212('0xe'),_0x2b1302,'request\x20sent');logger['debug'](_0x3212('0xf'),_0x2b1302,_0x3212('0x10'),JSON[_0x3212('0x11')](_0x16bb75));if(_0x16bb75[_0x3212('0x12')]){if(_0x16bb75[_0x3212('0x12')][_0x3212('0x13')]===0x1f4){logger[_0x3212('0x12')](_0x3212('0xe'),_0x2b1302,_0x16bb75[_0x3212('0x12')][_0x3212('0x14')]);return _0x3e17a3(_0x16bb75[_0x3212('0x12')][_0x3212('0x14')]);}logger[_0x3212('0x12')](_0x3212('0xe'),_0x2b1302,_0x16bb75[_0x3212('0x12')][_0x3212('0x14')]);return _0x4b35e9(_0x16bb75[_0x3212('0x12')][_0x3212('0x14')]);}else{logger[_0x3212('0xd')](_0x3212('0xe'),_0x2b1302,_0x3212('0x10'));_0x4b35e9(_0x16bb75[_0x3212('0x15')]['message']);}})[_0x3212('0x16')](function(_0x1719a5){logger[_0x3212('0x12')](_0x3212('0xe'),_0x2b1302,_0x1719a5);_0x3e17a3(_0x1719a5);});});}exports[_0x3212('0x17')]=function(_0x34ce95){var _0x21954a=this;return new Promise(function(_0x5b952f,_0x4c1158){return db[_0x3212('0x18')]['update'](_0x34ce95[_0x3212('0x19')],{'raw':_0x34ce95[_0x3212('0x1a')]?_0x34ce95[_0x3212('0x1a')][_0x3212('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34ce95[_0x3212('0x1a')]?_0x34ce95['options'][_0x3212('0x1c')]||null:null,'attributes':_0x34ce95[_0x3212('0x1a')]?_0x34ce95['options'][_0x3212('0x1d')]||null:null,'limit':_0x34ce95[_0x3212('0x1a')]?_0x34ce95[_0x3212('0x1a')]['limit']||null:null})['then'](function(_0x255d00){logger[_0x3212('0xd')](_0x3212('0x17'),_0x34ce95);logger[_0x3212('0x1e')](_0x3212('0x17'),_0x34ce95,JSON[_0x3212('0x11')](_0x255d00));_0x5b952f(_0x255d00);})['catch'](function(_0x565812){logger[_0x3212('0x12')]('UpdateFaxApplication',_0x565812[_0x3212('0x14')],_0x34ce95);_0x4c1158(_0x21954a[_0x3212('0x12')](0x1f4,_0x565812[_0x3212('0x14')]));});});};
\ No newline at end of file
index 1e33532..79409d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['./faxApplication.controller','isAuthenticated','index','get','/:id','show','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0x33d150,_0x1ca8d7){var _0x236ad7=function(_0x338058){while(--_0x338058){_0x33d150['push'](_0x33d150['shift']());}};_0x236ad7(++_0x1ca8d7);}(_0x1cb9,0x14e));var _0x91cb=function(_0x50269c,_0x588bb0){_0x50269c=_0x50269c-0x0;var _0x3cfc04=_0x1cb9[_0x50269c];return _0x3cfc04;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var express=require(_0x91cb('0x2'));var router=express[_0x91cb('0x3')]();var auth=require(_0x91cb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x91cb('0x5'));var controller=require(_0x91cb('0x6'));router['get']('/',auth[_0x91cb('0x7')](),controller[_0x91cb('0x8')]);router[_0x91cb('0x9')](_0x91cb('0xa'),auth[_0x91cb('0x7')](),controller[_0x91cb('0xb')]);router['post']('/',auth[_0x91cb('0x7')](),controller['create']);router[_0x91cb('0xc')]('/:id',auth[_0x91cb('0x7')](),controller[_0x91cb('0xd')]);router[_0x91cb('0xe')](_0x91cb('0xa'),auth[_0x91cb('0x7')](),controller[_0x91cb('0xf')]);module[_0x91cb('0x10')]=router;
\ No newline at end of file
+var _0xabce=['delete','destroy','exports','multer','util','path','express','Router','../../config/environment','./faxApplication.controller','get','isAuthenticated','post','create','/:id','update'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xabce,0x103));var _0xeabc=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xabce[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var express=require(_0xeabc('0x3'));var router=express[_0xeabc('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xeabc('0x5'));var controller=require(_0xeabc('0x6'));router[_0xeabc('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xeabc('0x7')]('/:id',auth[_0xeabc('0x8')](),controller['show']);router[_0xeabc('0x9')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router['put'](_0xeabc('0xb'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xc')]);router[_0xeabc('0xd')](_0xeabc('0xb'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xe')]);module[_0xeabc('0xf')]=router;
\ No newline at end of file
index a50f61e..2439a5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd88=['exports','BOOLEAN','DATE','STRING','out'];(function(_0x2eb9ac,_0x3c8ddb){var _0x5283c6=function(_0x2575bc){while(--_0x2575bc){_0x2eb9ac['push'](_0x2eb9ac['shift']());}};_0x5283c6(++_0x3c8ddb);}(_0xfd88,0x19a));var _0x8fd8=function(_0x3fc97b,_0x20ca29){_0x3fc97b=_0x3fc97b-0x0;var _0x3a0c82=_0xfd88[_0x3fc97b];return _0x3a0c82;};'use strict';var Sequelize=require('sequelize');module[_0x8fd8('0x0')]={'closed':{'type':Sequelize[_0x8fd8('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8fd8('0x2')]},'disposition':{'type':Sequelize[_0x8fd8('0x3')]},'note':{'type':Sequelize[_0x8fd8('0x3')]},'read1stAt':{'type':Sequelize[_0x8fd8('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x8fd8('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8fd8('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8fd8('0x4')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xe790=['ENUM','out','DATE','exports','BOOLEAN'];(function(_0x227e24,_0x573dd6){var _0x2ccc99=function(_0x177963){while(--_0x177963){_0x227e24['push'](_0x227e24['shift']());}};_0x2ccc99(++_0x573dd6);}(_0xe790,0x175));var _0x0e79=function(_0x594b8f,_0x5ebc77){_0x594b8f=_0x594b8f-0x0;var _0x45c31c=_0xe790[_0x594b8f];return _0x45c31c;};'use strict';var Sequelize=require('sequelize');module[_0x0e79('0x0')]={'closed':{'type':Sequelize[_0x0e79('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x0e79('0x2')]('in',_0x0e79('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0e79('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x0e79('0x2')]('in',_0x0e79('0x3')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index fd06975..b1e297b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd261=['mustache','path','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./faxInteraction.socket','register','status','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','index','FaxInteraction','rawAttributes','model','keys','query','dateStart','dateEnd','filters','attributes','intersection','fields','nolimit','order','sort','where','add','day','filter','map','merge','options','include','tag','Tag','Tags','read','push','FaxMessage','direction','createdAt','includeAll','CmContact','Contact','User','internal','Account','key','Messages','color','ThroughTags','findAll','rows','show','params','length','find','create','body','catch','update','describe','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','pick','FaxInteractionId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','toString','server','files','attachments','join','root','tmp','interaction-%s.zip','Attachment','mkdirSync','basename','createReadStream','log','err','unlinkSync','sendStatus','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x410b7c,_0x2ab2ce){var _0x4aa751=function(_0x37185b){while(--_0x37185b){_0x410b7c['push'](_0x410b7c['shift']());}};_0x4aa751(++_0x2ab2ce);}(_0xd261,0x17b));var _0x1d26=function(_0x42613d,_0x499d5d){_0x42613d=_0x42613d-0x0;var _0x31d2d2=_0xd261[_0x42613d];return _0x31d2d2;};'use strict';var pdf=require(_0x1d26('0x0'));var emlformat=require(_0x1d26('0x1'));var rimraf=require(_0x1d26('0x2'));var zipdir=require(_0x1d26('0x3'));var jsonpatch=require(_0x1d26('0x4'));var rp=require(_0x1d26('0x5'));var moment=require(_0x1d26('0x6'));var BPromise=require(_0x1d26('0x7'));var Mustache=require(_0x1d26('0x8'));var util=require('util');var path=require(_0x1d26('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1d26('0xa'));var squel=require('squel');var crypto=require(_0x1d26('0xb'));var jsforce=require(_0x1d26('0xc'));var deskjs=require(_0x1d26('0xd'));var toCsv=require(_0x1d26('0xe'));var querystring=require(_0x1d26('0xf'));var Papa=require(_0x1d26('0x10'));var qs=require(_0x1d26('0x11'));var logger=require(_0x1d26('0x12'))(_0x1d26('0x13'));var utils=require(_0x1d26('0x14'));var config=require(_0x1d26('0x15'));var db=require(_0x1d26('0x16'))['db'];var socket=require(_0x1d26('0x17'))({'host':_0x1d26('0x18'),'port':0x18eb});require(_0x1d26('0x19'))[_0x1d26('0x1a')](socket);function respondWithStatusCode(_0x33a0d1,_0x5d19a3){_0x5d19a3=_0x5d19a3||0xcc;return function(_0x4ac070){if(_0x4ac070){return _0x33a0d1['sendStatus'](_0x5d19a3);}return _0x33a0d1[_0x1d26('0x1b')](_0x5d19a3)['end']();};}function respondWithResult(_0x108a5b,_0xbaf656){_0xbaf656=_0xbaf656||0xc8;return function(_0x45207b){if(_0x45207b){return _0x108a5b['status'](_0xbaf656)['json'](_0x45207b);}};}function respondWithFilteredResult(_0x2f781d,_0xe7529){return function(_0x6cbf20){if(_0x6cbf20){var _0x4cc506=_0x6cbf20[_0x1d26('0x1c')],_0x809c31=_0xe7529['offset'],_0x23147b=_0xe7529[_0x1d26('0x1d')]+_0xe7529[_0x1d26('0x1e')],_0x2aa50c;if(_0x23147b>=_0x4cc506){_0x23147b=_0x4cc506;_0x2aa50c=0xc8;}else{_0x2aa50c=0xce;}_0x2f781d[_0x1d26('0x1b')](_0x2aa50c);return _0x2f781d[_0x1d26('0x1f')](_0x1d26('0x20'),_0x809c31+'-'+_0x23147b+'/'+_0x4cc506)[_0x1d26('0x21')](_0x6cbf20);}return null;};}function patchUpdates(_0x105025){return function(_0x1ae9a7){try{jsonpatch[_0x1d26('0x22')](_0x1ae9a7,_0x105025,!![]);}catch(_0x535b1f){return BPromise[_0x1d26('0x23')](_0x535b1f);}return _0x1ae9a7[_0x1d26('0x24')]();};}function saveUpdates(_0x3ed421,_0x29ae3a){return function(_0x550ecc){if(_0x550ecc){return _0x550ecc['update'](_0x3ed421)[_0x1d26('0x25')](function(_0x162be6){return _0x162be6;});}return null;};}function removeEntity(_0x3f3985,_0x563a7d){return function(_0x479c52){if(_0x479c52){return _0x479c52[_0x1d26('0x26')]()[_0x1d26('0x25')](function(){_0x3f3985[_0x1d26('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2671b1,_0x29563f){return function(_0x4c1d5d){if(!_0x4c1d5d){_0x2671b1['sendStatus'](0x194);}return _0x4c1d5d;};}function handleError(_0x3bce8a,_0x26658a){_0x26658a=_0x26658a||0x1f4;return function(_0x264d90){logger['error'](_0x264d90[_0x1d26('0x27')]);if(_0x264d90[_0x1d26('0x28')]){delete _0x264d90['name'];}_0x3bce8a[_0x1d26('0x1b')](_0x26658a)['send'](_0x264d90);};}exports[_0x1d26('0x29')]=function(_0x289c15,_0x8d9307){var _0x210637={},_0x18ae1c={},_0x1f16e8={'count':0x0,'rows':[]};var _0x56906b=db[_0x1d26('0x2a')][_0x1d26('0x2b')];_0x18ae1c[_0x1d26('0x2c')]=_[_0x1d26('0x2d')](_0x56906b);var _0x24f3fa={'dateStart':_0x289c15[_0x1d26('0x2e')][_0x1d26('0x2f')],'dateEnd':_0x289c15[_0x1d26('0x2e')][_0x1d26('0x30')]};delete _0x289c15[_0x1d26('0x2e')][_0x1d26('0x2f')];delete _0x289c15[_0x1d26('0x2e')][_0x1d26('0x30')];_0x18ae1c['query']=_['keys'](_0x289c15['query']);_0x18ae1c[_0x1d26('0x31')]=_['intersection'](_0x18ae1c[_0x1d26('0x2c')],_0x18ae1c[_0x1d26('0x2e')]);_0x210637[_0x1d26('0x32')]=_[_0x1d26('0x33')](_0x18ae1c[_0x1d26('0x2c')],qs[_0x1d26('0x34')](_0x289c15[_0x1d26('0x2e')][_0x1d26('0x34')]));_0x210637[_0x1d26('0x32')]=_0x210637[_0x1d26('0x32')]['length']?_0x210637[_0x1d26('0x32')]:_0x18ae1c['model'];if(!_0x289c15[_0x1d26('0x2e')]['hasOwnProperty'](_0x1d26('0x35'))){_0x210637[_0x1d26('0x1e')]=qs[_0x1d26('0x1e')](_0x289c15[_0x1d26('0x2e')][_0x1d26('0x1e')]);_0x210637[_0x1d26('0x1d')]=qs[_0x1d26('0x1d')](_0x289c15['query'][_0x1d26('0x1d')]);}_0x210637[_0x1d26('0x36')]=qs[_0x1d26('0x37')](_0x289c15[_0x1d26('0x2e')][_0x1d26('0x37')]);_0x210637[_0x1d26('0x38')]=qs[_0x1d26('0x31')](_['pick'](_0x289c15[_0x1d26('0x2e')],_0x18ae1c[_0x1d26('0x31')]));if(_0x24f3fa['dateStart']){if(_0x24f3fa[_0x1d26('0x30')]){_0x24f3fa[_0x1d26('0x30')]=moment(_0x24f3fa[_0x1d26('0x30')])[_0x1d26('0x39')](0x1,_0x1d26('0x3a'));}else{_0x24f3fa[_0x1d26('0x30')]=moment(_0x24f3fa[_0x1d26('0x2f')])[_0x1d26('0x39')](0x1,'day');}_['merge'](_0x210637['where'],{'createdAt':{'$gte':_0x24f3fa['dateStart'],'$lte':_0x24f3fa[_0x1d26('0x30')]}});}if(_0x289c15[_0x1d26('0x2e')][_0x1d26('0x3b')]){_0x210637[_0x1d26('0x38')]=_['merge'](_0x210637['where'],{'$or':_[_0x1d26('0x3c')](_0x210637[_0x1d26('0x32')],function(_0x4d6b74){var _0x567ea2={};_0x567ea2[_0x4d6b74]={'$like':'%'+_0x289c15[_0x1d26('0x2e')]['filter']+'%'};return _0x567ea2;})});}_0x210637=_[_0x1d26('0x3d')]({},_0x210637,_0x289c15[_0x1d26('0x3e')]);var _0x20024b={'where':_0x210637['where']};_0x20024b[_0x1d26('0x3f')]=[];if(_0x289c15[_0x1d26('0x2e')][_0x1d26('0x40')]){_0x20024b[_0x1d26('0x3f')]['push']({'model':db[_0x1d26('0x41')],'as':_0x1d26('0x42'),'attributes':['id'],'where':{'id':_0x289c15[_0x1d26('0x2e')][_0x1d26('0x40')]},'required':!![]});_0x20024b['distinct']=!![];}if(_0x289c15[_0x1d26('0x2e')][_0x1d26('0x43')]){_0x20024b[_0x1d26('0x3f')][_0x1d26('0x44')]({'model':db[_0x1d26('0x45')],'as':'Messages','attributes':['id',_0x1d26('0x46'),_0x1d26('0x47'),_0x1d26('0x43')],'where':{'direction':'in','read':_0x289c15['query'][_0x1d26('0x43')]||![]},'required':!![]});_0x20024b['distinct']=!![];}return db[_0x1d26('0x2a')][_0x1d26('0x1c')](_0x20024b)['then'](function(_0x22ed21){_0x1f16e8[_0x1d26('0x1c')]=_0x22ed21;if(_0x289c15[_0x1d26('0x2e')][_0x1d26('0x48')]){_0x210637['include']=[{'model':db['User'],'as':'Users','required':![],'attributes':['id',_0x1d26('0x28'),'fullname']},{'model':db[_0x1d26('0x49')],'as':_0x1d26('0x4a'),'required':![]},{'model':db[_0x1d26('0x4b')],'as':'Owner','attributes':[_0x1d26('0x28'),'fullname',_0x1d26('0x4c')],'required':![]},{'model':db['FaxAccount'],'as':_0x1d26('0x4d'),'attributes':[_0x1d26('0x28'),_0x1d26('0x4e')],'required':![]},{'model':db[_0x1d26('0x45')],'as':_0x1d26('0x4f'),'attributes':['id',_0x1d26('0x46'),'createdAt','read'],'where':{'direction':'in','read':_0x289c15[_0x1d26('0x2e')]['read']||![]},'required':_0x289c15[_0x1d26('0x2e')]['read']||![]},{'model':db[_0x1d26('0x41')],'as':_0x1d26('0x42'),'attributes':['id',_0x1d26('0x28'),_0x1d26('0x50')],'required':_0x289c15[_0x1d26('0x2e')]['tag']?!![]:![]},{'model':db[_0x1d26('0x41')],'as':_0x1d26('0x51'),'attributes':['id',_0x1d26('0x28'),_0x1d26('0x50')],'through':_0x289c15[_0x1d26('0x2e')][_0x1d26('0x40')]?{'attributes':[],'where':{'TagId':_0x289c15[_0x1d26('0x2e')][_0x1d26('0x40')]||undefined}}:{},'required':_0x289c15[_0x1d26('0x2e')][_0x1d26('0x40')]?!![]:![]}];}return db['FaxInteraction'][_0x1d26('0x52')](_0x210637);})['then'](function(_0x37150a){_0x1f16e8[_0x1d26('0x53')]=_0x37150a;return _0x1f16e8;})[_0x1d26('0x25')](respondWithFilteredResult(_0x8d9307,_0x210637))['catch'](handleError(_0x8d9307,null));};exports[_0x1d26('0x54')]=function(_0x2b54e7,_0x5013b7){var _0x4c0f57={'raw':![],'where':{'id':_0x2b54e7[_0x1d26('0x55')]['id']}},_0x29d68e={};_0x29d68e['model']=_[_0x1d26('0x2d')](db[_0x1d26('0x2a')]['rawAttributes']);_0x29d68e[_0x1d26('0x2e')]=_[_0x1d26('0x2d')](_0x2b54e7['query']);_0x29d68e[_0x1d26('0x31')]=_[_0x1d26('0x33')](_0x29d68e[_0x1d26('0x2c')],_0x29d68e[_0x1d26('0x2e')]);_0x4c0f57[_0x1d26('0x32')]=_['intersection'](_0x29d68e[_0x1d26('0x2c')],qs[_0x1d26('0x34')](_0x2b54e7['query']['fields']));_0x4c0f57[_0x1d26('0x32')]=_0x4c0f57['attributes'][_0x1d26('0x56')]?_0x4c0f57[_0x1d26('0x32')]:_0x29d68e['model'];if(_0x2b54e7[_0x1d26('0x2e')]['includeAll']){_0x4c0f57['include']=[{'all':!![]}];}_0x4c0f57=_[_0x1d26('0x3d')]({},_0x4c0f57,_0x2b54e7[_0x1d26('0x3e')]);return db[_0x1d26('0x2a')][_0x1d26('0x57')](_0x4c0f57)[_0x1d26('0x25')](handleEntityNotFound(_0x5013b7,null))[_0x1d26('0x25')](respondWithResult(_0x5013b7,null))['catch'](handleError(_0x5013b7,null));};exports[_0x1d26('0x58')]=function(_0x3c95d3,_0x54e101){return db['FaxInteraction'][_0x1d26('0x58')](_0x3c95d3[_0x1d26('0x59')],{})[_0x1d26('0x25')](respondWithResult(_0x54e101,0xc9))[_0x1d26('0x5a')](handleError(_0x54e101,null));};exports[_0x1d26('0x5b')]=function(_0x23a4ab,_0x451c5d){if(_0x23a4ab[_0x1d26('0x59')]['id']){delete _0x23a4ab['body']['id'];}return db[_0x1d26('0x2a')][_0x1d26('0x57')]({'where':{'id':_0x23a4ab['params']['id']}})[_0x1d26('0x25')](handleEntityNotFound(_0x451c5d,null))[_0x1d26('0x25')](saveUpdates(_0x23a4ab[_0x1d26('0x59')],null))['then'](respondWithResult(_0x451c5d,null))[_0x1d26('0x5a')](handleError(_0x451c5d,null));};exports[_0x1d26('0x26')]=function(_0x46b8ac,_0x1824c5){return db[_0x1d26('0x2a')][_0x1d26('0x57')]({'where':{'id':_0x46b8ac[_0x1d26('0x55')]['id']}})[_0x1d26('0x25')](handleEntityNotFound(_0x1824c5,null))[_0x1d26('0x25')](removeEntity(_0x1824c5,null))[_0x1d26('0x5a')](handleError(_0x1824c5,null));};exports['describe']=function(_0x45fbca,_0x374a87){return db[_0x1d26('0x2a')][_0x1d26('0x5c')]()[_0x1d26('0x25')](respondWithResult(_0x374a87,null))[_0x1d26('0x5a')](handleError(_0x374a87,null));};exports[_0x1d26('0x5d')]=function(_0x5b35c0,_0x3be689,_0x11d1d4){return db[_0x1d26('0x45')]['find']({'where':{'id':_0x5b35c0[_0x1d26('0x55')]['id']}})[_0x1d26('0x25')](handleEntityNotFound(_0x3be689,null))[_0x1d26('0x25')](function(_0x5c6253){if(_0x5c6253){return _0x5c6253[_0x1d26('0x5d')](_0x5b35c0[_0x1d26('0x59')][_0x1d26('0x5e')],_[_0x1d26('0x5f')](_0x5b35c0['body'],[_0x1d26('0x5e'),'id'])||{});}})['then'](respondWithResult(_0x3be689,null))['catch'](handleError(_0x3be689,null));};exports[_0x1d26('0x60')]=function(_0x48a6c4,_0x32c602,_0x249dae){var _0x477de3={'raw':![],'where':{}};var _0x5d5bd1={};var _0x4e40ba={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x1d26('0x61')]({'where':{'id':_0x48a6c4[_0x1d26('0x55')]['id']}})[_0x1d26('0x25')](handleEntityNotFound(_0x32c602,null))[_0x1d26('0x25')](function(_0x307281){if(_0x307281){_0x5d5bd1['model']=_['keys'](db[_0x1d26('0x45')]['rawAttributes']);_0x5d5bd1[_0x1d26('0x2e')]=_['keys'](_0x48a6c4[_0x1d26('0x2e')]);_0x5d5bd1[_0x1d26('0x31')]=_[_0x1d26('0x33')](_0x5d5bd1[_0x1d26('0x2c')],_0x5d5bd1[_0x1d26('0x2e')]);_0x477de3[_0x1d26('0x32')]=_['intersection'](_0x5d5bd1[_0x1d26('0x2c')],qs[_0x1d26('0x34')](_0x48a6c4[_0x1d26('0x2e')]['fields']));_0x477de3[_0x1d26('0x32')]=_0x477de3['attributes'][_0x1d26('0x56')]?_0x477de3[_0x1d26('0x32')]:_0x5d5bd1[_0x1d26('0x2c')];if(!_0x48a6c4[_0x1d26('0x2e')][_0x1d26('0x62')]('nolimit')){_0x477de3['limit']=qs[_0x1d26('0x1e')](_0x48a6c4[_0x1d26('0x2e')][_0x1d26('0x1e')]);_0x477de3[_0x1d26('0x1d')]=qs['offset'](_0x48a6c4[_0x1d26('0x2e')][_0x1d26('0x1d')]);}_0x477de3[_0x1d26('0x36')]=qs['sort'](_0x48a6c4[_0x1d26('0x2e')]['sort']);_0x477de3[_0x1d26('0x38')]=qs['filters'](_[_0x1d26('0x63')](_0x48a6c4[_0x1d26('0x2e')],_0x5d5bd1[_0x1d26('0x31')]));_0x477de3[_0x1d26('0x38')][_0x1d26('0x64')]=_0x307281['id'];if(_0x48a6c4['query'][_0x1d26('0x3b')]){_0x477de3[_0x1d26('0x38')]=_[_0x1d26('0x3d')](_0x477de3['where'],{'$or':_[_0x1d26('0x3c')](_0x477de3['attributes'],function(_0x32e310){var _0x10bb9b={};_0x10bb9b[_0x32e310]={'$like':'%'+_0x48a6c4[_0x1d26('0x2e')]['filter']+'%'};return _0x10bb9b;})});}if(_0x48a6c4[_0x1d26('0x2e')][_0x1d26('0x65')]){var _0xb92821=_0x48a6c4['query'][_0x1d26('0x65')][_0x1d26('0x66')](',');var _0x5b5c45={};_0x5b5c45[_0xb92821[0x0]]={'$gte':moment(_0xb92821[0x1])[_0x1d26('0x67')](_0x1d26('0x68'))};_0x477de3[_0x1d26('0x38')]=_[_0x1d26('0x3d')](_0x477de3[_0x1d26('0x38')],_0x5b5c45);}_0x477de3=_[_0x1d26('0x3d')]({},_0x477de3,_0x48a6c4[_0x1d26('0x3e')]);return db[_0x1d26('0x45')][_0x1d26('0x1c')]({'where':_0x477de3[_0x1d26('0x38')]})[_0x1d26('0x25')](function(_0x4aaabd){_0x4e40ba['count']=_0x4aaabd;if(_0x48a6c4['query'][_0x1d26('0x48')]){_0x477de3['include']=[{'all':!![]}];}return db[_0x1d26('0x45')][_0x1d26('0x52')](_0x477de3);})[_0x1d26('0x25')](function(_0x4e5e3e){_0x4e40ba['rows']=_0x4e5e3e;return _0x4e40ba;});}})[_0x1d26('0x25')](respondWithFilteredResult(_0x32c602,_0x477de3))['catch'](handleError(_0x32c602,null));};exports[_0x1d26('0x69')]=function(_0x53b4ed,_0xad3e23,_0x3e01a3){return db[_0x1d26('0x2a')]['find']({'where':{'id':_0x53b4ed['params']['id']}})[_0x1d26('0x25')](handleEntityNotFound(_0xad3e23,null))[_0x1d26('0x25')](function(_0x5cd56c){if(_0x5cd56c){return _0x5cd56c[_0x1d26('0x6a')](_0x53b4ed[_0x1d26('0x59')][_0x1d26('0x5e')],_[_0x1d26('0x5f')](_0x53b4ed[_0x1d26('0x59')],[_0x1d26('0x5e'),'id'])||{})[_0x1d26('0x6b')](function(){return db[_0x1d26('0x41')]['findAll']({'attributes':['id',_0x1d26('0x28'),'color'],'where':{'id':_0x53b4ed['body'][_0x1d26('0x5e')]}});})[_0x1d26('0x25')](function(_0x2351eb){socket[_0x1d26('0x6c')](_0x1d26('0x6d'),{'id':Number(_0x53b4ed[_0x1d26('0x55')]['id']),'tags':_0x2351eb||[]});return{'id':Number(_0x53b4ed[_0x1d26('0x55')]['id']),'tags':_0x2351eb||[]};});}})[_0x1d26('0x25')](respondWithResult(_0xad3e23,null))['catch'](handleError(_0xad3e23,null));};exports[_0x1d26('0x6e')]=function(_0x75f1c6,_0xe3f61e,_0x36287c){var _0x13547e;return db[_0x1d26('0x2a')][_0x1d26('0x57')]({'where':{'id':_0x75f1c6['params']['id']}})['then'](handleEntityNotFound(_0xe3f61e,null))[_0x1d26('0x25')](function(_0x28b607){if(_0x28b607){return _0x28b607['removeTags'](_0x75f1c6['query']['ids']);}})['then'](respondWithStatusCode(_0xe3f61e,null))[_0x1d26('0x5a')](handleError(_0xe3f61e,null));};exports[_0x1d26('0x6f')]=function(_0x3e907d,_0x434498){var _0x31154c=moment()[_0x1d26('0x70')]()[_0x1d26('0x71')]();var _0x1eb0c3=path['join'](config['root'],_0x1d26('0x72'),_0x1d26('0x73'),_0x1d26('0x74'));var _0x3f4d9f=path[_0x1d26('0x75')](config[_0x1d26('0x76')],'server',_0x1d26('0x73'),_0x1d26('0x77'));var _0x2c35b4=path[_0x1d26('0x75')](_0x3f4d9f,_0x31154c);var _0x567716=util[_0x1d26('0x67')](_0x1d26('0x78'),_0x31154c);var _0xc4588b=path[_0x1d26('0x75')](_0x3f4d9f,_0x567716);var _0xaf2fbc=![];return db['FaxInteraction'][_0x1d26('0x57')]({'where':{'id':_0x3e907d[_0x1d26('0x55')]['id']}})['then'](handleEntityNotFound(_0x434498,null))[_0x1d26('0x25')](function(_0x4085a0){if(_0x4085a0){return _0x4085a0[_0x1d26('0x60')]({'attributes':['id',_0x1d26('0x59'),_0x1d26('0x47')],'include':[{'model':db[_0x1d26('0x79')],'as':'Attachment'}]});}return[];})['then'](function(_0x17db3a){_0xaf2fbc=_0x17db3a[_0x1d26('0x56')];if(_0x17db3a['length']){fs[_0x1d26('0x7a')](_0x2c35b4);for(var _0xe1f6c3=0x0;_0xe1f6c3<_0x17db3a[_0x1d26('0x56')];_0xe1f6c3++){var _0x318f5f=_0x17db3a[_0xe1f6c3];var _0x488c02=_0x318f5f[_0x1d26('0x79')];if(_0x488c02){var _0x18cf8d=path[_0x1d26('0x75')](_0x1eb0c3,_0x488c02[_0x1d26('0x7b')]);if(fs['existsSync'](_0x18cf8d)){fs[_0x1d26('0x7c')](_0x18cf8d)['pipe'](fs['createWriteStream'](path[_0x1d26('0x75')](_0x2c35b4,_0x488c02[_0x1d26('0x7b')])));}}}}})[_0x1d26('0x25')](function(){if(_0xaf2fbc){return new BPromise(function(_0x23d1b3,_0x3011a7){zipdir(_0x2c35b4,{'saveTo':_0xc4588b},function(_0x1f4e30,_0x35480b){if(_0x1f4e30)return _0x3011a7(_0x1f4e30);return _0x23d1b3(_0x35480b);});});}})[_0x1d26('0x25')](function(){if(_0xaf2fbc){return new BPromise(function(_0x218878,_0x528bfc){rimraf(_0x2c35b4,function(_0x56899e){if(_0x56899e)_0x528bfc(_0x56899e);return _0x218878();});});}})[_0x1d26('0x25')](function(){if(_0xaf2fbc){return _0x434498[_0x1d26('0x6f')](_0xc4588b,_0x567716,function(_0x1aa400){if(_0x1aa400){console[_0x1d26('0x7d')](_0x1d26('0x7e'),_0x1aa400);}else{fs[_0x1d26('0x7f')](_0xc4588b);}});}else{return _0x434498[_0x1d26('0x80')](0xc8);}})[_0x1d26('0x5a')](handleError(_0x434498,null));};
\ No newline at end of file
+var _0x2651=['describe','addMessage','ids','omit','FaxInteractionId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','faxInteractionTags:save','removeTags','download','unix','join','root','server','attachments','files','tmp','interaction-%s.zip','Attachment','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./faxInteraction.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','index','FaxInteraction','model','query','dateEnd','dateStart','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','day','add','merge','map','filter','options','include','push','Tag','distinct','read','FaxMessage','createdAt','includeAll','User','Users','fullname','CmContact','Contact','Owner','internal','Account','key','direction','color','tag','ThroughTags','findAll','rows','show','rawAttributes','length','find','catch','create','body','params'];(function(_0x378720,_0xa711f1){var _0x47920a=function(_0xc5056){while(--_0xc5056){_0x378720['push'](_0x378720['shift']());}};_0x47920a(++_0xa711f1);}(_0x2651,0x198));var _0x1265=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x2651[_0x1477ef];return _0x164acd;};'use strict';var pdf=require(_0x1265('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1265('0x1'));var zipdir=require(_0x1265('0x2'));var jsonpatch=require(_0x1265('0x3'));var rp=require(_0x1265('0x4'));var moment=require(_0x1265('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1265('0x6'));var path=require(_0x1265('0x7'));var sox=require(_0x1265('0x8'));var csv=require(_0x1265('0x9'));var ejs=require(_0x1265('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1265('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1265('0xc'));var toCsv=require(_0x1265('0x9'));var querystring=require(_0x1265('0xd'));var Papa=require('papaparse');var qs=require('../../components/parsers/qs');var logger=require(_0x1265('0xe'))(_0x1265('0xf'));var utils=require('../../config/utils');var config=require(_0x1265('0x10'));var db=require(_0x1265('0x11'))['db'];var socket=require(_0x1265('0x12'))({'host':_0x1265('0x13'),'port':0x18eb});require(_0x1265('0x14'))[_0x1265('0x15')](socket);function respondWithStatusCode(_0x199b67,_0x4318d2){_0x4318d2=_0x4318d2||0xcc;return function(_0xdc7ee5){if(_0xdc7ee5){return _0x199b67['sendStatus'](_0x4318d2);}return _0x199b67[_0x1265('0x16')](_0x4318d2)[_0x1265('0x17')]();};}function respondWithResult(_0x379404,_0x36758a){_0x36758a=_0x36758a||0xc8;return function(_0x2123ed){if(_0x2123ed){return _0x379404['status'](_0x36758a)[_0x1265('0x18')](_0x2123ed);}};}function respondWithFilteredResult(_0x40809d,_0x3d4617){return function(_0xe2b7f8){if(_0xe2b7f8){var _0x4188d3=_0xe2b7f8[_0x1265('0x19')],_0x26f779=_0x3d4617['offset'],_0x185f25=_0x3d4617[_0x1265('0x1a')]+_0x3d4617[_0x1265('0x1b')],_0x3d3aa4;if(_0x185f25>=_0x4188d3){_0x185f25=_0x4188d3;_0x3d3aa4=0xc8;}else{_0x3d3aa4=0xce;}_0x40809d[_0x1265('0x16')](_0x3d3aa4);return _0x40809d[_0x1265('0x1c')](_0x1265('0x1d'),_0x26f779+'-'+_0x185f25+'/'+_0x4188d3)['json'](_0xe2b7f8);}return null;};}function patchUpdates(_0x3f3b58){return function(_0x6b4b38){try{jsonpatch[_0x1265('0x1e')](_0x6b4b38,_0x3f3b58,!![]);}catch(_0x2e0480){return BPromise['reject'](_0x2e0480);}return _0x6b4b38[_0x1265('0x1f')]();};}function saveUpdates(_0x16e5b0,_0x155117){return function(_0x4f2cca){if(_0x4f2cca){return _0x4f2cca['update'](_0x16e5b0)[_0x1265('0x20')](function(_0x274324){return _0x274324;});}return null;};}function removeEntity(_0x47f963,_0x2145cd){return function(_0x2dfd2a){if(_0x2dfd2a){return _0x2dfd2a[_0x1265('0x21')]()['then'](function(){_0x47f963[_0x1265('0x16')](0xcc)[_0x1265('0x17')]();});}};}function handleEntityNotFound(_0xbfff02,_0x1cd807){return function(_0x394d58){if(!_0x394d58){_0xbfff02[_0x1265('0x22')](0x194);}return _0x394d58;};}function handleError(_0x559b24,_0x381f85){_0x381f85=_0x381f85||0x1f4;return function(_0x1fc3fc){logger[_0x1265('0x23')](_0x1fc3fc[_0x1265('0x24')]);if(_0x1fc3fc[_0x1265('0x25')]){delete _0x1fc3fc['name'];}_0x559b24[_0x1265('0x16')](_0x381f85)['send'](_0x1fc3fc);};}exports[_0x1265('0x26')]=function(_0x5b576d,_0x44e33f){var _0x2b5994={},_0x48644d={},_0x5a05a3={'count':0x0,'rows':[]};var _0x61faff=db[_0x1265('0x27')]['rawAttributes'];_0x48644d[_0x1265('0x28')]=_['keys'](_0x61faff);var _0x5ecf49={'dateStart':_0x5b576d[_0x1265('0x29')]['dateStart'],'dateEnd':_0x5b576d[_0x1265('0x29')][_0x1265('0x2a')]};delete _0x5b576d[_0x1265('0x29')][_0x1265('0x2b')];delete _0x5b576d[_0x1265('0x29')][_0x1265('0x2a')];_0x48644d[_0x1265('0x29')]=_[_0x1265('0x2c')](_0x5b576d[_0x1265('0x29')]);_0x48644d[_0x1265('0x2d')]=_[_0x1265('0x2e')](_0x48644d[_0x1265('0x28')],_0x48644d[_0x1265('0x29')]);_0x2b5994['attributes']=_['intersection'](_0x48644d[_0x1265('0x28')],qs[_0x1265('0x2f')](_0x5b576d[_0x1265('0x29')][_0x1265('0x2f')]));_0x2b5994['attributes']=_0x2b5994[_0x1265('0x30')]['length']?_0x2b5994[_0x1265('0x30')]:_0x48644d['model'];if(!_0x5b576d[_0x1265('0x29')][_0x1265('0x31')](_0x1265('0x32'))){_0x2b5994['limit']=qs[_0x1265('0x1b')](_0x5b576d[_0x1265('0x29')][_0x1265('0x1b')]);_0x2b5994[_0x1265('0x1a')]=qs[_0x1265('0x1a')](_0x5b576d['query'][_0x1265('0x1a')]);}_0x2b5994[_0x1265('0x33')]=qs['sort'](_0x5b576d[_0x1265('0x29')][_0x1265('0x34')]);_0x2b5994[_0x1265('0x35')]=qs[_0x1265('0x2d')](_[_0x1265('0x36')](_0x5b576d['query'],_0x48644d[_0x1265('0x2d')]));if(_0x5ecf49[_0x1265('0x2b')]){if(_0x5ecf49[_0x1265('0x2a')]){_0x5ecf49['dateEnd']=moment(_0x5ecf49[_0x1265('0x2a')])['add'](0x1,_0x1265('0x37'));}else{_0x5ecf49[_0x1265('0x2a')]=moment(_0x5ecf49[_0x1265('0x2b')])[_0x1265('0x38')](0x1,_0x1265('0x37'));}_[_0x1265('0x39')](_0x2b5994['where'],{'createdAt':{'$gte':_0x5ecf49['dateStart'],'$lte':_0x5ecf49[_0x1265('0x2a')]}});}if(_0x5b576d[_0x1265('0x29')]['filter']){_0x2b5994[_0x1265('0x35')]=_[_0x1265('0x39')](_0x2b5994[_0x1265('0x35')],{'$or':_[_0x1265('0x3a')](_0x2b5994[_0x1265('0x30')],function(_0x449ebf){var _0x1bea0a={};_0x1bea0a[_0x449ebf]={'$like':'%'+_0x5b576d['query'][_0x1265('0x3b')]+'%'};return _0x1bea0a;})});}_0x2b5994=_[_0x1265('0x39')]({},_0x2b5994,_0x5b576d[_0x1265('0x3c')]);var _0x4e1cc1={'where':_0x2b5994['where']};_0x4e1cc1[_0x1265('0x3d')]=[];if(_0x5b576d['query']['tag']){_0x4e1cc1['include'][_0x1265('0x3e')]({'model':db[_0x1265('0x3f')],'as':'Tags','attributes':['id'],'where':{'id':_0x5b576d['query']['tag']},'required':!![]});_0x4e1cc1[_0x1265('0x40')]=!![];}if(_0x5b576d[_0x1265('0x29')][_0x1265('0x41')]){_0x4e1cc1[_0x1265('0x3d')][_0x1265('0x3e')]({'model':db[_0x1265('0x42')],'as':'Messages','attributes':['id','direction',_0x1265('0x43'),_0x1265('0x41')],'where':{'direction':'in','read':_0x5b576d[_0x1265('0x29')][_0x1265('0x41')]||![]},'required':!![]});_0x4e1cc1[_0x1265('0x40')]=!![];}return db['FaxInteraction'][_0x1265('0x19')](_0x4e1cc1)[_0x1265('0x20')](function(_0x549d81){_0x5a05a3[_0x1265('0x19')]=_0x549d81;if(_0x5b576d[_0x1265('0x29')][_0x1265('0x44')]){_0x2b5994['include']=[{'model':db[_0x1265('0x45')],'as':_0x1265('0x46'),'required':![],'attributes':['id',_0x1265('0x25'),_0x1265('0x47')]},{'model':db[_0x1265('0x48')],'as':_0x1265('0x49'),'required':![]},{'model':db[_0x1265('0x45')],'as':_0x1265('0x4a'),'attributes':[_0x1265('0x25'),'fullname',_0x1265('0x4b')],'required':![]},{'model':db['FaxAccount'],'as':_0x1265('0x4c'),'attributes':[_0x1265('0x25'),_0x1265('0x4d')],'required':![]},{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0x1265('0x4e'),'createdAt',_0x1265('0x41')],'where':{'direction':'in','read':_0x5b576d['query'][_0x1265('0x41')]||![]},'required':_0x5b576d[_0x1265('0x29')][_0x1265('0x41')]||![]},{'model':db[_0x1265('0x3f')],'as':'Tags','attributes':['id','name',_0x1265('0x4f')],'required':_0x5b576d[_0x1265('0x29')][_0x1265('0x50')]?!![]:![]},{'model':db[_0x1265('0x3f')],'as':_0x1265('0x51'),'attributes':['id',_0x1265('0x25'),_0x1265('0x4f')],'through':_0x5b576d[_0x1265('0x29')][_0x1265('0x50')]?{'attributes':[],'where':{'TagId':_0x5b576d[_0x1265('0x29')][_0x1265('0x50')]||undefined}}:{},'required':_0x5b576d['query'][_0x1265('0x50')]?!![]:![]}];}return db[_0x1265('0x27')][_0x1265('0x52')](_0x2b5994);})['then'](function(_0x8f8b8a){_0x5a05a3[_0x1265('0x53')]=_0x8f8b8a;return _0x5a05a3;})[_0x1265('0x20')](respondWithFilteredResult(_0x44e33f,_0x2b5994))['catch'](handleError(_0x44e33f,null));};exports[_0x1265('0x54')]=function(_0x4996bd,_0x2d685d){var _0x24eee3={'raw':![],'where':{'id':_0x4996bd['params']['id']}},_0x1e8895={};_0x1e8895[_0x1265('0x28')]=_[_0x1265('0x2c')](db[_0x1265('0x27')][_0x1265('0x55')]);_0x1e8895[_0x1265('0x29')]=_['keys'](_0x4996bd[_0x1265('0x29')]);_0x1e8895[_0x1265('0x2d')]=_[_0x1265('0x2e')](_0x1e8895[_0x1265('0x28')],_0x1e8895['query']);_0x24eee3[_0x1265('0x30')]=_[_0x1265('0x2e')](_0x1e8895[_0x1265('0x28')],qs[_0x1265('0x2f')](_0x4996bd[_0x1265('0x29')][_0x1265('0x2f')]));_0x24eee3[_0x1265('0x30')]=_0x24eee3[_0x1265('0x30')][_0x1265('0x56')]?_0x24eee3[_0x1265('0x30')]:_0x1e8895[_0x1265('0x28')];if(_0x4996bd[_0x1265('0x29')][_0x1265('0x44')]){_0x24eee3[_0x1265('0x3d')]=[{'all':!![]}];}_0x24eee3=_[_0x1265('0x39')]({},_0x24eee3,_0x4996bd[_0x1265('0x3c')]);return db['FaxInteraction'][_0x1265('0x57')](_0x24eee3)[_0x1265('0x20')](handleEntityNotFound(_0x2d685d,null))[_0x1265('0x20')](respondWithResult(_0x2d685d,null))[_0x1265('0x58')](handleError(_0x2d685d,null));};exports[_0x1265('0x59')]=function(_0x8e7c2c,_0x5cf0cd){return db[_0x1265('0x27')][_0x1265('0x59')](_0x8e7c2c[_0x1265('0x5a')],{})[_0x1265('0x20')](respondWithResult(_0x5cf0cd,0xc9))[_0x1265('0x58')](handleError(_0x5cf0cd,null));};exports['update']=function(_0x7e2571,_0x508ea4){if(_0x7e2571[_0x1265('0x5a')]['id']){delete _0x7e2571[_0x1265('0x5a')]['id'];}return db[_0x1265('0x27')][_0x1265('0x57')]({'where':{'id':_0x7e2571[_0x1265('0x5b')]['id']}})['then'](handleEntityNotFound(_0x508ea4,null))['then'](saveUpdates(_0x7e2571['body'],null))['then'](respondWithResult(_0x508ea4,null))[_0x1265('0x58')](handleError(_0x508ea4,null));};exports[_0x1265('0x21')]=function(_0x42c388,_0x463755){return db[_0x1265('0x27')]['find']({'where':{'id':_0x42c388[_0x1265('0x5b')]['id']}})[_0x1265('0x20')](handleEntityNotFound(_0x463755,null))[_0x1265('0x20')](removeEntity(_0x463755,null))[_0x1265('0x58')](handleError(_0x463755,null));};exports[_0x1265('0x5c')]=function(_0x3764fa,_0x2d571e){return db[_0x1265('0x27')][_0x1265('0x5c')]()[_0x1265('0x20')](respondWithResult(_0x2d571e,null))[_0x1265('0x58')](handleError(_0x2d571e,null));};exports[_0x1265('0x5d')]=function(_0xd5da8c,_0x55e25e,_0x1ed28b){return db[_0x1265('0x42')][_0x1265('0x57')]({'where':{'id':_0xd5da8c['params']['id']}})[_0x1265('0x20')](handleEntityNotFound(_0x55e25e,null))[_0x1265('0x20')](function(_0x4a7b8b){if(_0x4a7b8b){return _0x4a7b8b[_0x1265('0x5d')](_0xd5da8c[_0x1265('0x5a')][_0x1265('0x5e')],_[_0x1265('0x5f')](_0xd5da8c[_0x1265('0x5a')],['ids','id'])||{});}})['then'](respondWithResult(_0x55e25e,null))[_0x1265('0x58')](handleError(_0x55e25e,null));};exports['getMessages']=function(_0x2a9319,_0x1e3aa2,_0x172360){var _0x97e8d2={'raw':![],'where':{}};var _0x48e349={};var _0x4a836f={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x2a9319[_0x1265('0x5b')]['id']}})[_0x1265('0x20')](handleEntityNotFound(_0x1e3aa2,null))[_0x1265('0x20')](function(_0x4a8f0c){if(_0x4a8f0c){_0x48e349[_0x1265('0x28')]=_['keys'](db[_0x1265('0x42')]['rawAttributes']);_0x48e349[_0x1265('0x29')]=_['keys'](_0x2a9319[_0x1265('0x29')]);_0x48e349['filters']=_[_0x1265('0x2e')](_0x48e349[_0x1265('0x28')],_0x48e349[_0x1265('0x29')]);_0x97e8d2[_0x1265('0x30')]=_[_0x1265('0x2e')](_0x48e349['model'],qs[_0x1265('0x2f')](_0x2a9319[_0x1265('0x29')][_0x1265('0x2f')]));_0x97e8d2['attributes']=_0x97e8d2[_0x1265('0x30')]['length']?_0x97e8d2['attributes']:_0x48e349[_0x1265('0x28')];if(!_0x2a9319[_0x1265('0x29')]['hasOwnProperty']('nolimit')){_0x97e8d2[_0x1265('0x1b')]=qs[_0x1265('0x1b')](_0x2a9319[_0x1265('0x29')][_0x1265('0x1b')]);_0x97e8d2['offset']=qs[_0x1265('0x1a')](_0x2a9319[_0x1265('0x29')][_0x1265('0x1a')]);}_0x97e8d2[_0x1265('0x33')]=qs['sort'](_0x2a9319[_0x1265('0x29')][_0x1265('0x34')]);_0x97e8d2[_0x1265('0x35')]=qs[_0x1265('0x2d')](_[_0x1265('0x36')](_0x2a9319[_0x1265('0x29')],_0x48e349[_0x1265('0x2d')]));_0x97e8d2[_0x1265('0x35')][_0x1265('0x60')]=_0x4a8f0c['id'];if(_0x2a9319[_0x1265('0x29')][_0x1265('0x3b')]){_0x97e8d2[_0x1265('0x35')]=_[_0x1265('0x39')](_0x97e8d2[_0x1265('0x35')],{'$or':_[_0x1265('0x3a')](_0x97e8d2['attributes'],function(_0x408551){var _0x5c71f3={};_0x5c71f3[_0x408551]={'$like':'%'+_0x2a9319[_0x1265('0x29')]['filter']+'%'};return _0x5c71f3;})});}if(_0x2a9319[_0x1265('0x29')][_0x1265('0x61')]){var _0x23722c=_0x2a9319[_0x1265('0x29')]['$gte'][_0x1265('0x62')](',');var _0x5701d8={};_0x5701d8[_0x23722c[0x0]]={'$gte':moment(_0x23722c[0x1])[_0x1265('0x63')](_0x1265('0x64'))};_0x97e8d2[_0x1265('0x35')]=_[_0x1265('0x39')](_0x97e8d2[_0x1265('0x35')],_0x5701d8);}_0x97e8d2=_[_0x1265('0x39')]({},_0x97e8d2,_0x2a9319[_0x1265('0x3c')]);return db[_0x1265('0x42')][_0x1265('0x19')]({'where':_0x97e8d2[_0x1265('0x35')]})['then'](function(_0x1f5790){_0x4a836f['count']=_0x1f5790;if(_0x2a9319[_0x1265('0x29')][_0x1265('0x44')]){_0x97e8d2['include']=[{'all':!![]}];}return db[_0x1265('0x42')][_0x1265('0x52')](_0x97e8d2);})['then'](function(_0x56d44d){_0x4a836f[_0x1265('0x53')]=_0x56d44d;return _0x4a836f;});}})[_0x1265('0x20')](respondWithFilteredResult(_0x1e3aa2,_0x97e8d2))[_0x1265('0x58')](handleError(_0x1e3aa2,null));};exports[_0x1265('0x65')]=function(_0x4fba32,_0x30481e,_0x496528){return db[_0x1265('0x27')][_0x1265('0x57')]({'where':{'id':_0x4fba32[_0x1265('0x5b')]['id']}})[_0x1265('0x20')](handleEntityNotFound(_0x30481e,null))[_0x1265('0x20')](function(_0x55d8c9){if(_0x55d8c9){return _0x55d8c9[_0x1265('0x66')](_0x4fba32['body'][_0x1265('0x5e')],_[_0x1265('0x5f')](_0x4fba32[_0x1265('0x5a')],[_0x1265('0x5e'),'id'])||{})[_0x1265('0x67')](function(){return db[_0x1265('0x3f')][_0x1265('0x52')]({'attributes':['id',_0x1265('0x25'),_0x1265('0x4f')],'where':{'id':_0x4fba32[_0x1265('0x5a')]['ids']}});})[_0x1265('0x20')](function(_0xc4f33c){socket['emit'](_0x1265('0x68'),{'id':Number(_0x4fba32[_0x1265('0x5b')]['id']),'tags':_0xc4f33c||[]});return{'id':Number(_0x4fba32['params']['id']),'tags':_0xc4f33c||[]};});}})[_0x1265('0x20')](respondWithResult(_0x30481e,null))[_0x1265('0x58')](handleError(_0x30481e,null));};exports['removeTags']=function(_0x4f7577,_0x50d27e,_0x5ebc11){var _0x5c06e9;return db[_0x1265('0x27')][_0x1265('0x57')]({'where':{'id':_0x4f7577['params']['id']}})[_0x1265('0x20')](handleEntityNotFound(_0x50d27e,null))[_0x1265('0x20')](function(_0x4a8346){if(_0x4a8346){return _0x4a8346[_0x1265('0x69')](_0x4f7577[_0x1265('0x29')]['ids']);}})['then'](respondWithStatusCode(_0x50d27e,null))[_0x1265('0x58')](handleError(_0x50d27e,null));};exports[_0x1265('0x6a')]=function(_0x1988a7,_0x373c16){var _0x2b0093=moment()[_0x1265('0x6b')]()['toString']();var _0x460a0c=path[_0x1265('0x6c')](config[_0x1265('0x6d')],_0x1265('0x6e'),'files',_0x1265('0x6f'));var _0x6abf41=path[_0x1265('0x6c')](config[_0x1265('0x6d')],_0x1265('0x6e'),_0x1265('0x70'),_0x1265('0x71'));var _0x1609bf=path[_0x1265('0x6c')](_0x6abf41,_0x2b0093);var _0x501622=util[_0x1265('0x63')](_0x1265('0x72'),_0x2b0093);var _0x26cac0=path[_0x1265('0x6c')](_0x6abf41,_0x501622);var _0x2501fc=![];return db[_0x1265('0x27')][_0x1265('0x57')]({'where':{'id':_0x1988a7['params']['id']}})[_0x1265('0x20')](handleEntityNotFound(_0x373c16,null))[_0x1265('0x20')](function(_0x55926d){if(_0x55926d){return _0x55926d['getMessages']({'attributes':['id',_0x1265('0x5a'),_0x1265('0x43')],'include':[{'model':db[_0x1265('0x73')],'as':'Attachment'}]});}return[];})[_0x1265('0x20')](function(_0x4a3f59){_0x2501fc=_0x4a3f59[_0x1265('0x56')];if(_0x4a3f59[_0x1265('0x56')]){fs[_0x1265('0x74')](_0x1609bf);for(var _0x2b68dc=0x0;_0x2b68dc<_0x4a3f59[_0x1265('0x56')];_0x2b68dc++){var _0x3d1063=_0x4a3f59[_0x2b68dc];var _0x52ae9e=_0x3d1063[_0x1265('0x73')];if(_0x52ae9e){var _0x4b0aed=path['join'](_0x460a0c,_0x52ae9e[_0x1265('0x75')]);if(fs[_0x1265('0x76')](_0x4b0aed)){fs[_0x1265('0x77')](_0x4b0aed)[_0x1265('0x78')](fs[_0x1265('0x79')](path[_0x1265('0x6c')](_0x1609bf,_0x52ae9e['basename'])));}}}}})['then'](function(){if(_0x2501fc){return new BPromise(function(_0xc80374,_0x171063){zipdir(_0x1609bf,{'saveTo':_0x26cac0},function(_0x352427,_0x14d154){if(_0x352427)return _0x171063(_0x352427);return _0xc80374(_0x14d154);});});}})['then'](function(){if(_0x2501fc){return new BPromise(function(_0x135a83,_0x194f57){rimraf(_0x1609bf,function(_0x14d83f){if(_0x14d83f)_0x194f57(_0x14d83f);return _0x135a83();});});}})[_0x1265('0x20')](function(){if(_0x2501fc){return _0x373c16['download'](_0x26cac0,_0x501622,function(_0x476225){if(_0x476225){console[_0x1265('0x7a')](_0x1265('0x7b'),_0x476225);}else{fs[_0x1265('0x7c')](_0x26cac0);}});}else{return _0x373c16[_0x1265('0x22')](0xc8);}})[_0x1265('0x58')](handleError(_0x373c16,null));};
\ No newline at end of file
index 7c9b4f4..4cc4aa7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7af2=['hook','../../mysqldb','FaxInteraction','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x4a105b,_0x10a163){var _0x1cf91b=function(_0x153654){while(--_0x153654){_0x4a105b['push'](_0x4a105b['shift']());}};_0x1cf91b(++_0x10a163);}(_0x7af2,0x119));var _0x27af=function(_0x49ad17,_0x110747){_0x49ad17=_0x49ad17-0x0;var _0x1d6230=_0x7af2[_0x49ad17];return _0x1d6230;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x27af('0x0'))['db'][_0x27af('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x27af('0x2')](0x0);var events={'afterCreate':_0x27af('0x3'),'afterUpdate':'update','afterDestroy':_0x27af('0x4')};function emitEvent(_0x1067e7){return function(_0x709cb6,_0x2a542f,_0x22ae46){FaxInteractionEvents[_0x27af('0x5')](_0x1067e7+':'+_0x709cb6['id'],_0x709cb6);FaxInteractionEvents[_0x27af('0x5')](_0x1067e7,_0x709cb6);_0x22ae46(null);};}for(var e in events){if(events[_0x27af('0x6')](e)){var event=events[e];FaxInteraction[_0x27af('0x7')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file
+var _0xfc03=['emit','hasOwnProperty','hook','events','FaxInteraction','setMaxListeners','update'];(function(_0x3c6835,_0x952d5c){var _0x1adeb9=function(_0xfefab3){while(--_0xfefab3){_0x3c6835['push'](_0x3c6835['shift']());}};_0x1adeb9(++_0x952d5c);}(_0xfc03,0x16f));var _0x3fc0=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xfc03[_0x4c445a];return _0x2f611c;};'use strict';var EventEmitter=require(_0x3fc0('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x3fc0('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x3fc0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3fc0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x13c308){return function(_0x1eeb62,_0x390f7e,_0x29d814){FaxInteractionEvents[_0x3fc0('0x4')](_0x13c308+':'+_0x1eeb62['id'],_0x1eeb62);FaxInteractionEvents[_0x3fc0('0x4')](_0x13c308,_0x1eeb62);_0x29d814(null);};}for(var e in events){if(events[_0x3fc0('0x5')](e)){var event=events[e];FaxInteraction[_0x3fc0('0x6')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file
index 3114b63..3047496 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdab=['define','FaxInteraction','fax_interactions','lodash','bluebird','request-promise','./faxInteraction.attributes','exports'];(function(_0xbda849,_0x2dcb1a){var _0x2d3e9d=function(_0x2c8f10){while(--_0x2c8f10){_0xbda849['push'](_0xbda849['shift']());}};_0x2d3e9d(++_0x2dcb1a);}(_0xbdab,0x11b));var _0xbbda=function(_0x4319e1,_0xace91d){_0x4319e1=_0x4319e1-0x0;var _0x3cabcd=_0xbdab[_0x4319e1];return _0x3cabcd;};'use strict';var _=require(_0xbbda('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbbda('0x1'));var rp=require(_0xbbda('0x2'));var attributes=require(_0xbbda('0x3'));module[_0xbbda('0x4')]=function(_0x2fdede,_0x123bc1){return _0x2fdede[_0xbbda('0x5')](_0xbbda('0x6'),attributes,{'tableName':_0xbbda('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x34cf=['../../config/logger','moment','bluebird','request-promise','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','lodash','util'];(function(_0x1e1965,_0x55785c){var _0x1a2e96=function(_0x27d366){while(--_0x27d366){_0x1e1965['push'](_0x1e1965['shift']());}};_0x1a2e96(++_0x55785c);}(_0x34cf,0xda));var _0xf34c=function(_0x5b465b,_0x42531a){_0x5b465b=_0x5b465b-0x0;var _0xa2f659=_0x34cf[_0x5b465b];return _0xa2f659;};'use strict';var _=require(_0xf34c('0x0'));var util=require(_0xf34c('0x1'));var logger=require(_0xf34c('0x2'))('api');var moment=require(_0xf34c('0x3'));var BPromise=require(_0xf34c('0x4'));var rp=require(_0xf34c('0x5'));var attributes=require(_0xf34c('0x6'));module[_0xf34c('0x7')]=function(_0x1e684a,_0x3d8ea2){return _0x1e684a[_0xf34c('0x8')](_0xf34c('0x9'),attributes,{'tableName':_0xf34c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c74b489..50b1762 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb85=['FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','attributes','limit','then','stringify','AddTagsToFaxInteraction','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter','./faxInteraction.socket','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4e7454,_0x280441){var _0x539ab9=function(_0x148d4c){while(--_0x148d4c){_0x4e7454['push'](_0x4e7454['shift']());}};_0x539ab9(++_0x280441);}(_0xfb85,0x190));var _0x5fb8=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xfb85[_0x209941];return _0x1e8729;};'use strict';var _=require(_0x5fb8('0x0'));var util=require(_0x5fb8('0x1'));var moment=require('moment');var BPromise=require(_0x5fb8('0x2'));var rs=require(_0x5fb8('0x3'));var fs=require('fs');var db=require(_0x5fb8('0x4'))['db'];var utils=require(_0x5fb8('0x5'));var logger=require(_0x5fb8('0x6'))(_0x5fb8('0x7'));var config=require(_0x5fb8('0x8'));var jayson=require(_0x5fb8('0x9'));var client=jayson[_0x5fb8('0xa')][_0x5fb8('0xb')]({'port':0x232a});var socket=require(_0x5fb8('0xc'))({'host':'localhost','port':0x18eb});require(_0x5fb8('0xd'))['register'](socket);function respondWithRpcPromise(_0x448aae,_0x4a2862,_0x594201){return new BPromise(function(_0x219652,_0x280c77){return client['request'](_0x448aae,_0x594201)['then'](function(_0x5cdf38){logger[_0x5fb8('0xe')](_0x5fb8('0xf'),_0x4a2862,_0x5fb8('0x10'));logger[_0x5fb8('0x11')](_0x5fb8('0x12'),_0x4a2862,'request\x20sent',JSON['stringify'](_0x5cdf38));if(_0x5cdf38[_0x5fb8('0x13')]){if(_0x5cdf38[_0x5fb8('0x13')][_0x5fb8('0x14')]===0x1f4){logger[_0x5fb8('0x13')](_0x5fb8('0xf'),_0x4a2862,_0x5cdf38[_0x5fb8('0x13')][_0x5fb8('0x15')]);return _0x280c77(_0x5cdf38[_0x5fb8('0x13')][_0x5fb8('0x15')]);}logger['error'](_0x5fb8('0xf'),_0x4a2862,_0x5cdf38[_0x5fb8('0x13')]['message']);return _0x219652(_0x5cdf38['error']['message']);}else{logger[_0x5fb8('0xe')](_0x5fb8('0xf'),_0x4a2862,_0x5fb8('0x10'));_0x219652(_0x5cdf38['result'][_0x5fb8('0x15')]);}})[_0x5fb8('0x16')](function(_0xd05752){logger['error'](_0x5fb8('0xf'),_0x4a2862,_0xd05752);_0x280c77(_0xd05752);});});}exports[_0x5fb8('0x17')]=function(_0x317123){var _0x318896=this;return new Promise(function(_0x22fdd1,_0x59f152){return db[_0x5fb8('0x18')][_0x5fb8('0x19')](_0x317123[_0x5fb8('0x1a')],{'raw':_0x317123['options']?_0x317123[_0x5fb8('0x1b')][_0x5fb8('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x317123['options']?_0x317123[_0x5fb8('0x1b')]['where']||null:null,'attributes':_0x317123[_0x5fb8('0x1b')]?_0x317123[_0x5fb8('0x1b')][_0x5fb8('0x1d')]||null:null,'limit':_0x317123[_0x5fb8('0x1b')]?_0x317123['options'][_0x5fb8('0x1e')]||null:null})[_0x5fb8('0x1f')](function(_0x46d6dd){logger[_0x5fb8('0xe')](_0x5fb8('0x17'),_0x317123);logger['debug'](_0x5fb8('0x17'),_0x317123,JSON[_0x5fb8('0x20')](_0x46d6dd));_0x22fdd1(_0x46d6dd);})[_0x5fb8('0x16')](function(_0x64b8e8){logger[_0x5fb8('0x13')]('UpdateFaxInteraction',_0x64b8e8[_0x5fb8('0x15')],_0x317123);_0x59f152(_0x318896[_0x5fb8('0x13')](0x1f4,_0x64b8e8[_0x5fb8('0x15')]));});});};exports[_0x5fb8('0x21')]=function(_0x2c225e){return new Promise(function(_0x58a9e9,_0x34134a){return db['FaxInteraction']['find']({'where':_0x2c225e['options']?_0x2c225e[_0x5fb8('0x1b')]['where']||null:null})[_0x5fb8('0x1f')](function(_0x2ba72c){if(_0x2ba72c){return _0x2ba72c['addTags'](_0x2c225e[_0x5fb8('0x1a')][_0x5fb8('0x22')],_[_0x5fb8('0x23')](_0x2c225e[_0x5fb8('0x1a')],[_0x5fb8('0x22'),'id'])||{});}})[_0x5fb8('0x24')](function(_0x22e102){logger['info'](_0x5fb8('0x25'),_0x2c225e);logger['debug']('AddTags',_0x2c225e,JSON[_0x5fb8('0x20')](_0x22e102));_0x58a9e9(_0x22e102);})[_0x5fb8('0x16')](function(_0x3d9821){logger[_0x5fb8('0x13')]('AddTags',_0x3d9821[_0x5fb8('0x15')],_0x2c225e);_0x34134a(_this[_0x5fb8('0x13')](0x1f4,_0x3d9821[_0x5fb8('0x15')]));});});};
\ No newline at end of file
+var _0x5ef7=['attributes','body','ids','omit','spread','AddTags','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','UpdateFaxInteraction','FaxInteraction','update','options','raw','where'];(function(_0xd2548e,_0x556106){var _0x1258d3=function(_0x4d4b7f){while(--_0x4d4b7f){_0xd2548e['push'](_0xd2548e['shift']());}};_0x1258d3(++_0x556106);}(_0x5ef7,0x118));var _0x75ef=function(_0x4489ea,_0x35d6e0){_0x4489ea=_0x4489ea-0x0;var _0x208a64=_0x5ef7[_0x4489ea];return _0x208a64;};'use strict';var _=require(_0x75ef('0x0'));var util=require(_0x75ef('0x1'));var moment=require(_0x75ef('0x2'));var BPromise=require(_0x75ef('0x3'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x75ef('0x4'))['db'];var utils=require(_0x75ef('0x5'));var logger=require(_0x75ef('0x6'))(_0x75ef('0x7'));var config=require(_0x75ef('0x8'));var jayson=require(_0x75ef('0x9'));var client=jayson[_0x75ef('0xa')][_0x75ef('0xb')]({'port':0x232a});var socket=require(_0x75ef('0xc'))({'host':'localhost','port':0x18eb});require(_0x75ef('0xd'))[_0x75ef('0xe')](socket);function respondWithRpcPromise(_0x51e9ee,_0x561fc5,_0x3c8479){return new BPromise(function(_0x1e69f8,_0x501666){return client[_0x75ef('0xf')](_0x51e9ee,_0x3c8479)[_0x75ef('0x10')](function(_0x1809f7){logger['info'](_0x75ef('0x11'),_0x561fc5,_0x75ef('0x12'));logger[_0x75ef('0x13')](_0x75ef('0x14'),_0x561fc5,_0x75ef('0x12'),JSON['stringify'](_0x1809f7));if(_0x1809f7[_0x75ef('0x15')]){if(_0x1809f7[_0x75ef('0x15')][_0x75ef('0x16')]===0x1f4){logger[_0x75ef('0x15')](_0x75ef('0x11'),_0x561fc5,_0x1809f7[_0x75ef('0x15')][_0x75ef('0x17')]);return _0x501666(_0x1809f7[_0x75ef('0x15')][_0x75ef('0x17')]);}logger[_0x75ef('0x15')](_0x75ef('0x11'),_0x561fc5,_0x1809f7[_0x75ef('0x15')][_0x75ef('0x17')]);return _0x1e69f8(_0x1809f7[_0x75ef('0x15')][_0x75ef('0x17')]);}else{logger[_0x75ef('0x18')](_0x75ef('0x11'),_0x561fc5,_0x75ef('0x12'));_0x1e69f8(_0x1809f7['result'][_0x75ef('0x17')]);}})[_0x75ef('0x19')](function(_0xdb40bb){logger[_0x75ef('0x15')](_0x75ef('0x11'),_0x561fc5,_0xdb40bb);_0x501666(_0xdb40bb);});});}exports[_0x75ef('0x1a')]=function(_0x3a4bd9){var _0x3bb8f7=this;return new Promise(function(_0xcfbf44,_0x1b7d4c){return db[_0x75ef('0x1b')][_0x75ef('0x1c')](_0x3a4bd9['body'],{'raw':_0x3a4bd9[_0x75ef('0x1d')]?_0x3a4bd9['options'][_0x75ef('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a4bd9[_0x75ef('0x1d')]?_0x3a4bd9[_0x75ef('0x1d')][_0x75ef('0x1f')]||null:null,'attributes':_0x3a4bd9['options']?_0x3a4bd9['options'][_0x75ef('0x20')]||null:null,'limit':_0x3a4bd9[_0x75ef('0x1d')]?_0x3a4bd9['options']['limit']||null:null})[_0x75ef('0x10')](function(_0x500fdd){logger[_0x75ef('0x18')](_0x75ef('0x1a'),_0x3a4bd9);logger[_0x75ef('0x13')]('UpdateFaxInteraction',_0x3a4bd9,JSON['stringify'](_0x500fdd));_0xcfbf44(_0x500fdd);})['catch'](function(_0x403f13){logger[_0x75ef('0x15')](_0x75ef('0x1a'),_0x403f13[_0x75ef('0x17')],_0x3a4bd9);_0x1b7d4c(_0x3bb8f7[_0x75ef('0x15')](0x1f4,_0x403f13[_0x75ef('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0x4fbfa4){return new Promise(function(_0x171c29,_0x58b705){return db['FaxInteraction']['find']({'where':_0x4fbfa4[_0x75ef('0x1d')]?_0x4fbfa4['options']['where']||null:null})['then'](function(_0x2f4c17){if(_0x2f4c17){return _0x2f4c17['addTags'](_0x4fbfa4[_0x75ef('0x21')][_0x75ef('0x22')],_[_0x75ef('0x23')](_0x4fbfa4[_0x75ef('0x21')],[_0x75ef('0x22'),'id'])||{});}})[_0x75ef('0x24')](function(_0x488455){logger[_0x75ef('0x18')]('AddTags',_0x4fbfa4);logger['debug'](_0x75ef('0x25'),_0x4fbfa4,JSON[_0x75ef('0x26')](_0x488455));_0x171c29(_0x488455);})[_0x75ef('0x19')](function(_0x9f8568){logger[_0x75ef('0x15')](_0x75ef('0x25'),_0x9f8568[_0x75ef('0x17')],_0x4fbfa4);_0x58b705(_this[_0x75ef('0x15')](0x1f4,_0x9f8568[_0x75ef('0x17')]));});});};
\ No newline at end of file
index 2f94450..c36d62a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfba=['faxInteraction:','emit','register'];(function(_0x39efa9,_0x28ae45){var _0x3d0802=function(_0x49481d){while(--_0x49481d){_0x39efa9['push'](_0x39efa9['shift']());}};_0x3d0802(++_0x28ae45);}(_0xdfba,0xc1));var _0xadfb=function(_0x5d6a84,_0x10929c){_0x5d6a84=_0x5d6a84-0x0;var _0x930f0=_0xdfba[_0x5d6a84];return _0x930f0;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save','remove','update'];function createListener(_0x4d5133,_0x31977c){return function(_0x129d2d){_0x31977c[_0xadfb('0x0')](_0x4d5133,_0x129d2d);};}function removeListener(_0x4cb428,_0x20fa05){return function(){FaxInteractionEvents['removeListener'](_0x4cb428,_0x20fa05);};}exports[_0xadfb('0x1')]=function(_0x40e465){for(var _0x544dfb=0x0,_0x259ea9=events['length'];_0x544dfb<_0x259ea9;_0x544dfb++){var _0x543ca2=events[_0x544dfb];var _0x4177b7=createListener(_0xadfb('0x2')+_0x543ca2,_0x40e465);FaxInteractionEvents['on'](_0x543ca2,_0x4177b7);}};
\ No newline at end of file
+var _0x9d39=['register','length','faxInteraction:','./faxInteraction.events','save','remove','removeListener'];(function(_0x7a78cb,_0x9f4571){var _0x1a5c0c=function(_0x263738){while(--_0x263738){_0x7a78cb['push'](_0x7a78cb['shift']());}};_0x1a5c0c(++_0x9f4571);}(_0x9d39,0x153));var _0x99d3=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9d39[_0x42cae2];return _0x5f256f;};'use strict';var FaxInteractionEvents=require(_0x99d3('0x0'));var events=[_0x99d3('0x1'),_0x99d3('0x2'),'update'];function createListener(_0x105ff0,_0x4546a7){return function(_0x400858){_0x4546a7['emit'](_0x105ff0,_0x400858);};}function removeListener(_0x3da3fb,_0x54e570){return function(){FaxInteractionEvents[_0x99d3('0x3')](_0x3da3fb,_0x54e570);};}exports[_0x99d3('0x4')]=function(_0x786773){for(var _0xe26951=0x0,_0x122c3c=events[_0x99d3('0x5')];_0xe26951<_0x122c3c;_0xe26951++){var _0x2a1ccd=events[_0xe26951];var _0x3a5c8a=createListener(_0x99d3('0x6')+_0x2a1ccd,_0x786773);FaxInteractionEvents['on'](_0x2a1ccd,_0x3a5c8a);}};
\ No newline at end of file
index f52e5a7..1e15f50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb29d=['create','addMessage','post','/:id/tags','tracked','faxinteraction:addtags','fax','faxinteraction:update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','get','isAuthenticated','describe','/:id','show','/:id/messages','download'];(function(_0x3a2d09,_0x3ba445){var _0xf6547=function(_0x3aa5db){while(--_0x3aa5db){_0x3a2d09['push'](_0x3a2d09['shift']());}};_0xf6547(++_0x3ba445);}(_0xb29d,0x107));var _0xdb29=function(_0x37fefe,_0xf0176b){_0x37fefe=_0x37fefe-0x0;var _0x41a516=_0xb29d[_0x37fefe];return _0x41a516;};'use strict';var multer=require(_0xdb29('0x0'));var util=require(_0xdb29('0x1'));var path=require(_0xdb29('0x2'));var express=require(_0xdb29('0x3'));var router=express[_0xdb29('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router[_0xdb29('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdb29('0x5')]('/describe',auth[_0xdb29('0x6')](),controller[_0xdb29('0x7')]);router[_0xdb29('0x5')](_0xdb29('0x8'),auth[_0xdb29('0x6')](),controller[_0xdb29('0x9')]);router[_0xdb29('0x5')](_0xdb29('0xa'),auth[_0xdb29('0x6')](),controller['getMessages']);router[_0xdb29('0x5')]('/:id/download',auth[_0xdb29('0x6')](),controller[_0xdb29('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdb29('0xc')]);router['post']('/:id/messages',auth[_0xdb29('0x6')](),controller[_0xdb29('0xd')]);router[_0xdb29('0xe')](_0xdb29('0xf'),auth[_0xdb29('0x6')](),interaction[_0xdb29('0x10')]('fax',_0xdb29('0x11')),controller['addTags']);router['put'](_0xdb29('0x8'),auth['isAuthenticated'](),interaction[_0xdb29('0x10')](_0xdb29('0x12'),_0xdb29('0x13')),controller['update']);router[_0xdb29('0x14')]('/:id',auth[_0xdb29('0x6')](),interaction[_0xdb29('0x10')](_0xdb29('0x12'),_0xdb29('0x15')),controller[_0xdb29('0x16')]);router[_0xdb29('0x14')](_0xdb29('0xf'),auth[_0xdb29('0x6')](),controller[_0xdb29('0x17')]);module[_0xdb29('0x18')]=router;
\ No newline at end of file
+var _0x1c5e=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe','describe','/:id/messages','/:id/download','download','create','post','/:id/tags','fax','put','/:id','tracked','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','multer','util','path','express'];(function(_0x3438cf,_0x73b174){var _0x278698=function(_0xbba932){while(--_0xbba932){_0x3438cf['push'](_0x3438cf['shift']());}};_0x278698(++_0x73b174);}(_0x1c5e,0xc0));var _0xe1c5=function(_0x272d8a,_0x45184b){_0x272d8a=_0x272d8a-0x0;var _0x26286e=_0x1c5e[_0x272d8a];return _0x26286e;};'use strict';var multer=require(_0xe1c5('0x0'));var util=require(_0xe1c5('0x1'));var path=require(_0xe1c5('0x2'));var express=require(_0xe1c5('0x3'));var router=express[_0xe1c5('0x4')]();var auth=require(_0xe1c5('0x5'));var interaction=require(_0xe1c5('0x6'));var config=require(_0xe1c5('0x7'));var controller=require(_0xe1c5('0x8'));router[_0xe1c5('0x9')]('/',auth[_0xe1c5('0xa')](),controller['index']);router[_0xe1c5('0x9')](_0xe1c5('0xb'),auth['isAuthenticated'](),controller[_0xe1c5('0xc')]);router[_0xe1c5('0x9')]('/:id',auth[_0xe1c5('0xa')](),controller['show']);router[_0xe1c5('0x9')](_0xe1c5('0xd'),auth[_0xe1c5('0xa')](),controller['getMessages']);router[_0xe1c5('0x9')](_0xe1c5('0xe'),auth[_0xe1c5('0xa')](),controller[_0xe1c5('0xf')]);router['post']('/',auth[_0xe1c5('0xa')](),controller[_0xe1c5('0x10')]);router[_0xe1c5('0x11')](_0xe1c5('0xd'),auth[_0xe1c5('0xa')](),controller['addMessage']);router['post'](_0xe1c5('0x12'),auth[_0xe1c5('0xa')](),interaction['tracked'](_0xe1c5('0x13'),'faxinteraction:addtags'),controller['addTags']);router[_0xe1c5('0x14')](_0xe1c5('0x15'),auth[_0xe1c5('0xa')](),interaction[_0xe1c5('0x16')](_0xe1c5('0x13'),_0xe1c5('0x17')),controller[_0xe1c5('0x18')]);router[_0xe1c5('0x19')](_0xe1c5('0x15'),auth['isAuthenticated'](),interaction[_0xe1c5('0x16')](_0xe1c5('0x13'),_0xe1c5('0x1a')),controller['destroy']);router[_0xe1c5('0x19')](_0xe1c5('0x12'),auth[_0xe1c5('0xa')](),controller[_0xe1c5('0x1b')]);module['exports']=router;
\ No newline at end of file
index 2244218..83dc5b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8e9=['DATE','sequelize','exports','medium','BOOLEAN','ENUM','out','TEXT'];(function(_0x460694,_0x20e0a7){var _0x41d0c9=function(_0x21c2cf){while(--_0x21c2cf){_0x460694['push'](_0x460694['shift']());}};_0x41d0c9(++_0x20e0a7);}(_0xe8e9,0x129));var _0x9e8e=function(_0x6b4634,_0x477b57){_0x6b4634=_0x6b4634-0x0;var _0x1e9a78=_0xe8e9[_0x6b4634];return _0x1e9a78;};'use strict';var Sequelize=require(_0x9e8e('0x0'));module[_0x9e8e('0x1')]={'body':{'type':Sequelize['TEXT'](_0x9e8e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9e8e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9e8e('0x4')]('in','out'),'defaultValue':_0x9e8e('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x9e8e('0x6')],'defaultValue':null},'readAt':{'type':Sequelize[_0x9e8e('0x7')]}};
\ No newline at end of file
+var _0xb323=['TEXT','medium','ENUM','out','DATE','sequelize','exports'];(function(_0x480032,_0x368cd8){var _0x28d998=function(_0x45e34b){while(--_0x45e34b){_0x480032['push'](_0x480032['shift']());}};_0x28d998(++_0x368cd8);}(_0xb323,0x83));var _0x3b32=function(_0x40ec12,_0x1dc193){_0x40ec12=_0x40ec12-0x0;var _0x42ccc1=_0xb323[_0x40ec12];return _0x42ccc1;};'use strict';var Sequelize=require(_0x3b32('0x0'));module[_0x3b32('0x1')]={'body':{'type':Sequelize[_0x3b32('0x2')](_0x3b32('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3b32('0x4')]('in','out'),'defaultValue':_0x3b32('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x3b32('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x3b32('0x6')]}};
\ No newline at end of file
index 7043aa8..5bea5ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9c3=['destroy','stack','name','send','index','FaxMessage','model','keys','query','dateStart','dateEnd','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','add','day','merge','where','filter','map','options','includeAll','findAll','rows','catch','show','params','include','find','body','describe','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','CmContact','Contact','get','FaxInteraction','FaxInteractionId','isNil','info','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','interaction','stringify','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','accept','EventManager','fax-interactions','fax','agent','UserId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','create','Attachment','SendFax','FaxAccountId','basename','AttachmentId','download','join','root','server','files','attachments','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../mysqldb','socket.io-emitter','localhost','./faxMessage.socket','client','http','request','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then'];(function(_0x18e987,_0x5d2624){var _0x258534=function(_0x534e88){while(--_0x534e88){_0x18e987['push'](_0x18e987['shift']());}};_0x258534(++_0x5d2624);}(_0xc9c3,0xd0));var _0x3c9c=function(_0x1cf581,_0x55fc90){_0x1cf581=_0x1cf581-0x0;var _0x2117cd=_0xc9c3[_0x1cf581];return _0x2117cd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3c9c('0x0'));var rimraf=require(_0x3c9c('0x1'));var zipdir=require(_0x3c9c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3c9c('0x3'));var BPromise=require(_0x3c9c('0x4'));var Mustache=require('mustache');var util=require(_0x3c9c('0x5'));var path=require(_0x3c9c('0x6'));var sox=require(_0x3c9c('0x7'));var csv=require(_0x3c9c('0x8'));var ejs=require(_0x3c9c('0x9'));var fs=require('fs');var _=require(_0x3c9c('0xa'));var squel=require(_0x3c9c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3c9c('0xc'));var toCsv=require(_0x3c9c('0x8'));var querystring=require('querystring');var Papa=require(_0x3c9c('0xd'));var qs=require(_0x3c9c('0xe'));var logger=require(_0x3c9c('0xf'))(_0x3c9c('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3c9c('0x11'))['db'];var socket=require(_0x3c9c('0x12'))({'host':_0x3c9c('0x13'),'port':0x18eb});require(_0x3c9c('0x14'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x3c9c('0x15')][_0x3c9c('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x548dc7,_0x10d72e,_0x50a62d,_0x2de024){return new BPromise(function(_0x12dd2d,_0x1def09){var _0x541830=_0x2de024||client;return _0x541830[_0x3c9c('0x17')](_0x548dc7,_0x50a62d)['then'](function(_0x3b9fef){logger['info'](_0x3c9c('0x18'),_0x10d72e,_0x3c9c('0x19'));logger[_0x3c9c('0x1a')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x10d72e,_0x3c9c('0x19'),JSON['stringify'](_0x3b9fef));if(_0x3b9fef[_0x3c9c('0x1b')]){if(_0x3b9fef[_0x3c9c('0x1b')][_0x3c9c('0x1c')]===0x1f4){logger[_0x3c9c('0x1b')](_0x3c9c('0x18'),_0x10d72e,_0x3b9fef[_0x3c9c('0x1b')][_0x3c9c('0x1d')]);return _0x1def09(_0x3b9fef[_0x3c9c('0x1b')][_0x3c9c('0x1d')]);}logger[_0x3c9c('0x1b')](_0x3c9c('0x18'),_0x10d72e,_0x3b9fef[_0x3c9c('0x1b')]['message']);return _0x12dd2d(_0x3b9fef[_0x3c9c('0x1b')]['message']);}else{logger['info'](_0x3c9c('0x18'),_0x10d72e,_0x3c9c('0x19'));_0x12dd2d(_0x3b9fef[_0x3c9c('0x1e')]['message']);}})['catch'](function(_0x1bed10){logger['error']('FaxMessage,\x20%s,\x20%s',_0x10d72e,_0x1bed10);_0x1def09(_0x1bed10);});});}function respondWithStatusCode(_0x219076,_0x32161b){_0x32161b=_0x32161b||0xcc;return function(_0x589fbf){if(_0x589fbf){return _0x219076[_0x3c9c('0x1f')](_0x32161b);}return _0x219076[_0x3c9c('0x20')](_0x32161b)[_0x3c9c('0x21')]();};}function respondWithResult(_0x169ba4,_0x43c18b){_0x43c18b=_0x43c18b||0xc8;return function(_0x335bb4){if(_0x335bb4){return _0x169ba4['status'](_0x43c18b)[_0x3c9c('0x22')](_0x335bb4);}};}function respondWithFilteredResult(_0x599d1b,_0x52924e){return function(_0x2ea2dc){if(_0x2ea2dc){var _0x25618d=_0x2ea2dc[_0x3c9c('0x23')],_0x2a2469=_0x52924e[_0x3c9c('0x24')],_0x2016e0=_0x52924e[_0x3c9c('0x24')]+_0x52924e[_0x3c9c('0x25')],_0x44f22f;if(_0x2016e0>=_0x25618d){_0x2016e0=_0x25618d;_0x44f22f=0xc8;}else{_0x44f22f=0xce;}_0x599d1b['status'](_0x44f22f);return _0x599d1b[_0x3c9c('0x26')](_0x3c9c('0x27'),_0x2a2469+'-'+_0x2016e0+'/'+_0x25618d)[_0x3c9c('0x22')](_0x2ea2dc);}return null;};}function patchUpdates(_0x545cde){return function(_0x5af462){try{jsonpatch[_0x3c9c('0x28')](_0x5af462,_0x545cde,!![]);}catch(_0x3bdccc){return BPromise[_0x3c9c('0x29')](_0x3bdccc);}return _0x5af462['save']();};}function saveUpdates(_0x27d568,_0x164230){return function(_0x51dd7f){if(_0x51dd7f){return _0x51dd7f[_0x3c9c('0x2a')](_0x27d568)[_0x3c9c('0x2b')](function(_0x4f488c){return _0x4f488c;});}return null;};}function removeEntity(_0x679d0a,_0x180467){return function(_0x21d49e){if(_0x21d49e){return _0x21d49e[_0x3c9c('0x2c')]()[_0x3c9c('0x2b')](function(){_0x679d0a[_0x3c9c('0x20')](0xcc)[_0x3c9c('0x21')]();});}};}function handleEntityNotFound(_0x5e661b,_0x1ee8c1){return function(_0x496e09){if(!_0x496e09){_0x5e661b[_0x3c9c('0x1f')](0x194);}return _0x496e09;};}function handleError(_0x31a59b,_0x417abe){_0x417abe=_0x417abe||0x1f4;return function(_0x5e6e2){logger[_0x3c9c('0x1b')](_0x5e6e2[_0x3c9c('0x2d')]);if(_0x5e6e2[_0x3c9c('0x2e')]){delete _0x5e6e2['name'];}_0x31a59b[_0x3c9c('0x20')](_0x417abe)[_0x3c9c('0x2f')](_0x5e6e2);};}exports[_0x3c9c('0x30')]=function(_0x4a3341,_0x504b75){var _0xcd7b6b={},_0x247611={},_0x20e17e={'count':0x0,'rows':[]};var _0x2a576a=db[_0x3c9c('0x31')]['rawAttributes'];_0x247611[_0x3c9c('0x32')]=_[_0x3c9c('0x33')](_0x2a576a);var _0x3f4a59={'dateStart':_0x4a3341[_0x3c9c('0x34')][_0x3c9c('0x35')],'dateEnd':_0x4a3341[_0x3c9c('0x34')][_0x3c9c('0x36')]};delete _0x4a3341['query'][_0x3c9c('0x35')];delete _0x4a3341[_0x3c9c('0x34')][_0x3c9c('0x36')];_0x247611[_0x3c9c('0x34')]=_['keys'](_0x4a3341[_0x3c9c('0x34')]);_0x247611['filters']=_[_0x3c9c('0x37')](_0x247611['model'],_0x247611[_0x3c9c('0x34')]);_0xcd7b6b['attributes']=_[_0x3c9c('0x37')](_0x247611['model'],qs[_0x3c9c('0x38')](_0x4a3341[_0x3c9c('0x34')][_0x3c9c('0x38')]));_0xcd7b6b[_0x3c9c('0x39')]=_0xcd7b6b['attributes'][_0x3c9c('0x3a')]?_0xcd7b6b[_0x3c9c('0x39')]:_0x247611['model'];if(!_0x4a3341[_0x3c9c('0x34')][_0x3c9c('0x3b')](_0x3c9c('0x3c'))){_0xcd7b6b[_0x3c9c('0x25')]=qs[_0x3c9c('0x25')](_0x4a3341['query']['limit']);_0xcd7b6b['offset']=qs['offset'](_0x4a3341[_0x3c9c('0x34')][_0x3c9c('0x24')]);}_0xcd7b6b[_0x3c9c('0x3d')]=qs[_0x3c9c('0x3e')](_0x4a3341['query'][_0x3c9c('0x3e')]);_0xcd7b6b['where']=qs[_0x3c9c('0x3f')](_[_0x3c9c('0x40')](_0x4a3341[_0x3c9c('0x34')],_0x247611[_0x3c9c('0x3f')]));if(_0x3f4a59[_0x3c9c('0x35')]){if(_0x3f4a59[_0x3c9c('0x36')]){_0x3f4a59['dateEnd']=moment(_0x3f4a59[_0x3c9c('0x36')])[_0x3c9c('0x41')](0x1,_0x3c9c('0x42'));}else{_0x3f4a59[_0x3c9c('0x36')]=moment(_0x3f4a59[_0x3c9c('0x35')])[_0x3c9c('0x41')](0x1,_0x3c9c('0x42'));}_[_0x3c9c('0x43')](_0xcd7b6b[_0x3c9c('0x44')],{'createdAt':{'$gte':_0x3f4a59['dateStart'],'$lte':_0x3f4a59['dateEnd']}});}if(_0x4a3341[_0x3c9c('0x34')][_0x3c9c('0x45')]){_0xcd7b6b[_0x3c9c('0x44')]=_[_0x3c9c('0x43')](_0xcd7b6b['where'],{'$or':_[_0x3c9c('0x46')](_0xcd7b6b[_0x3c9c('0x39')],function(_0x4194a3){var _0x126ea2={};_0x126ea2[_0x4194a3]={'$like':'%'+_0x4a3341[_0x3c9c('0x34')][_0x3c9c('0x45')]+'%'};return _0x126ea2;})});}_0xcd7b6b=_[_0x3c9c('0x43')]({},_0xcd7b6b,_0x4a3341[_0x3c9c('0x47')]);var _0x1b09f7={'where':_0xcd7b6b[_0x3c9c('0x44')]};return db[_0x3c9c('0x31')][_0x3c9c('0x23')](_0x1b09f7)[_0x3c9c('0x2b')](function(_0x5bdbdf){_0x20e17e[_0x3c9c('0x23')]=_0x5bdbdf;if(_0x4a3341['query'][_0x3c9c('0x48')]){_0xcd7b6b['include']=[{'all':!![]}];}return db['FaxMessage'][_0x3c9c('0x49')](_0xcd7b6b);})['then'](function(_0x265094){_0x20e17e[_0x3c9c('0x4a')]=_0x265094;return _0x20e17e;})[_0x3c9c('0x2b')](respondWithFilteredResult(_0x504b75,_0xcd7b6b))[_0x3c9c('0x4b')](handleError(_0x504b75,null));};exports[_0x3c9c('0x4c')]=function(_0xed9d46,_0x907232){var _0x224412={'raw':!![],'where':{'id':_0xed9d46[_0x3c9c('0x4d')]['id']}},_0xf95ffa={};_0xf95ffa['model']=_[_0x3c9c('0x33')](db[_0x3c9c('0x31')]['rawAttributes']);_0xf95ffa[_0x3c9c('0x34')]=_[_0x3c9c('0x33')](_0xed9d46[_0x3c9c('0x34')]);_0xf95ffa[_0x3c9c('0x3f')]=_[_0x3c9c('0x37')](_0xf95ffa['model'],_0xf95ffa[_0x3c9c('0x34')]);_0x224412[_0x3c9c('0x39')]=_[_0x3c9c('0x37')](_0xf95ffa[_0x3c9c('0x32')],qs[_0x3c9c('0x38')](_0xed9d46[_0x3c9c('0x34')][_0x3c9c('0x38')]));_0x224412[_0x3c9c('0x39')]=_0x224412['attributes'][_0x3c9c('0x3a')]?_0x224412['attributes']:_0xf95ffa[_0x3c9c('0x32')];if(_0xed9d46[_0x3c9c('0x34')][_0x3c9c('0x48')]){_0x224412[_0x3c9c('0x4e')]=[{'all':!![]}];}_0x224412=_[_0x3c9c('0x43')]({},_0x224412,_0xed9d46[_0x3c9c('0x47')]);return db['FaxMessage'][_0x3c9c('0x4f')](_0x224412)[_0x3c9c('0x2b')](handleEntityNotFound(_0x907232,null))[_0x3c9c('0x2b')](respondWithResult(_0x907232,null))[_0x3c9c('0x4b')](handleError(_0x907232,null));};exports['update']=function(_0x267c2a,_0x2d703e){if(_0x267c2a[_0x3c9c('0x50')]['id']){delete _0x267c2a[_0x3c9c('0x50')]['id'];}return db['FaxMessage'][_0x3c9c('0x4f')]({'where':{'id':_0x267c2a[_0x3c9c('0x4d')]['id']}})[_0x3c9c('0x2b')](handleEntityNotFound(_0x2d703e,null))[_0x3c9c('0x2b')](saveUpdates(_0x267c2a[_0x3c9c('0x50')],null))[_0x3c9c('0x2b')](respondWithResult(_0x2d703e,null))[_0x3c9c('0x4b')](handleError(_0x2d703e,null));};exports[_0x3c9c('0x2c')]=function(_0x262173,_0x4c2680){return db[_0x3c9c('0x31')][_0x3c9c('0x4f')]({'where':{'id':_0x262173['params']['id']}})[_0x3c9c('0x2b')](handleEntityNotFound(_0x4c2680,null))[_0x3c9c('0x2b')](removeEntity(_0x4c2680,null))[_0x3c9c('0x4b')](handleError(_0x4c2680,null));};exports[_0x3c9c('0x51')]=function(_0x57d0e9,_0x4daada){return db[_0x3c9c('0x31')][_0x3c9c('0x51')]()[_0x3c9c('0x2b')](respondWithResult(_0x4daada,null))[_0x3c9c('0x4b')](handleError(_0x4daada,null));};var interaction_log=require(_0x3c9c('0xf'))('fax-interactions');exports['accept']=function(_0x1cadaa,_0x567753,_0x275c78){var _0x12344d={'channel':'fax'};if(_0x1cadaa['body']['id']){delete _0x1cadaa[_0x3c9c('0x50')]['id'];}_0x1cadaa[_0x3c9c('0x50')][_0x3c9c('0x52')]=!![];_0x1cadaa['body'][_0x3c9c('0x53')]=moment()[_0x3c9c('0x54')](_0x3c9c('0x55'));_0x1cadaa['body']['UserId']=_0x1cadaa[_0x3c9c('0x50')]['UserId']||_0x1cadaa['user']['id'];return db[_0x3c9c('0x31')]['find']({'where':{'id':_0x1cadaa[_0x3c9c('0x4d')]['id'],'UserId':null},'include':[{'model':db[_0x3c9c('0x56')],'as':_0x3c9c('0x57')}]})[_0x3c9c('0x2b')](handleEntityNotFound(_0x567753,null))[_0x3c9c('0x2b')](saveUpdates(_0x1cadaa['body'],null))[_0x3c9c('0x2b')](function(_0x40c42e){if(_0x40c42e){_0x12344d[_0x3c9c('0x1d')]=_0x40c42e[_0x3c9c('0x58')]({'plain':!![]});return db[_0x3c9c('0x59')]['find']({'where':{'id':_0x40c42e[_0x3c9c('0x5a')]}});}return null;})[_0x3c9c('0x2b')](handleEntityNotFound(_0x567753,null))[_0x3c9c('0x2b')](function(_0x4b6267){if(_0x4b6267){return _0x4b6267[_0x3c9c('0x2a')]({'UserId':_0x1cadaa[_0x3c9c('0x50')]['UserId'],'read1stAt':_[_0x3c9c('0x5b')](_0x4b6267['read1stAt'])?moment()[_0x3c9c('0x54')](_0x3c9c('0x55')):undefined});}return null;})['then'](function(_0x361638){if(_0x361638){_0x12344d['interaction']=_0x361638['get']({'plain':!![]});interaction_log[_0x3c9c('0x5c')](_0x3c9c('0x5d'),_0x1cadaa['user']['id'],_0x1cadaa['user'][_0x3c9c('0x2e')],_0x1cadaa[_0x3c9c('0x5e')]['role'],_0x12344d[_0x3c9c('0x5f')]['id'],_0x1cadaa[_0x3c9c('0x50')]?JSON[_0x3c9c('0x60')](_0x1cadaa[_0x3c9c('0x50')]):_0x3c9c('0x61'));return respondWithRpcPromise(_0x3c9c('0x62'),_0x3c9c('0x63'),_0x12344d);}return null;})[_0x3c9c('0x2b')](function(_0x16f5d5){if(_0x16f5d5){if(_0x1cadaa[_0x3c9c('0x50')]['manual']){_0x12344d[_0x3c9c('0x1d')][_0x3c9c('0x64')]=util['format'](_0x3c9c('0x65'),_0x1cadaa[_0x3c9c('0x5e')]['name']);_0x12344d[_0x3c9c('0x1d')][_0x3c9c('0x66')]=_0x12344d[_0x3c9c('0x66')];_0x12344d[_0x3c9c('0x1d')][_0x3c9c('0x67')]=_0x3c9c('0x68');return respondWithRpcPromise(_0x3c9c('0x69'),'EventManager',{'event':'acceptmessage','message':_0x12344d[_0x3c9c('0x1d')]},client9002)['then'](function(){return _0x12344d;});}return _0x12344d;}return null;})[_0x3c9c('0x2b')](respondWithResult(_0x567753,null))[_0x3c9c('0x4b')](handleError(_0x567753,null));};var interaction_log=require(_0x3c9c('0xf'))(_0x3c9c('0x6a'));exports[_0x3c9c('0x29')]=function(_0x55e795,_0x4134a1,_0x1534b1){var _0x5cc9ba={'agent':{},'channel':_0x3c9c('0x6b')};if(_0x55e795[_0x3c9c('0x50')]['id']){delete _0x55e795['body']['id'];}_0x55e795[_0x3c9c('0x50')]['UserId']=_0x55e795[_0x3c9c('0x50')]['UserId']||_0x55e795[_0x3c9c('0x5e')]['id'];_0x5cc9ba[_0x3c9c('0x6c')]['id']=_0x55e795[_0x3c9c('0x50')][_0x3c9c('0x6d')];return db[_0x3c9c('0x31')][_0x3c9c('0x4f')]({'where':{'id':_0x55e795[_0x3c9c('0x4d')]['id'],'UserId':null}})[_0x3c9c('0x2b')](handleEntityNotFound(_0x4134a1,null))['then'](function(_0x4e9f7b){if(_0x4e9f7b){_0x5cc9ba[_0x3c9c('0x1d')]=_0x4e9f7b[_0x3c9c('0x58')]({'plain':!![]});return db['FaxInteraction'][_0x3c9c('0x4f')]({'where':{'id':_0x4e9f7b[_0x3c9c('0x5a')]}});}return null;})['then'](handleEntityNotFound(_0x4134a1,null))['then'](function(_0x418445){if(_0x418445){_0x5cc9ba[_0x3c9c('0x5f')]=_0x418445[_0x3c9c('0x58')]({'plain':!![]});interaction_log[_0x3c9c('0x5c')](_0x3c9c('0x6e'),_0x55e795[_0x3c9c('0x5e')]['id'],_0x55e795[_0x3c9c('0x5e')][_0x3c9c('0x2e')],_0x55e795[_0x3c9c('0x5e')]['role'],_0x5cc9ba['interaction']['id'],_0x55e795[_0x3c9c('0x50')]?JSON[_0x3c9c('0x60')](_0x55e795[_0x3c9c('0x50')]):_0x3c9c('0x61'));return respondWithRpcPromise(_0x3c9c('0x6f'),_0x3c9c('0x70'),_0x5cc9ba);}return null;})[_0x3c9c('0x2b')](function(_0x29f920){if(_0x29f920){_0x29f920['message'][_0x3c9c('0x64')]=util[_0x3c9c('0x54')]('SIP/%s',_0x55e795['user'][_0x3c9c('0x2e')]);_0x29f920[_0x3c9c('0x1d')]['channel']=_0x5cc9ba[_0x3c9c('0x66')];_0x29f920[_0x3c9c('0x1d')]['event']='reject';respondWithRpcPromise('EventManager','EventManager',{'event':_0x3c9c('0x71'),'message':_0x29f920['message']},client9002);return _0x5cc9ba;}return null;})[_0x3c9c('0x2b')](respondWithResult(_0x4134a1,null))[_0x3c9c('0x4b')](handleError(_0x4134a1,null));};exports[_0x3c9c('0x72')]=function(_0x4365c8,_0xd1a10e){var _0xca13a6;return db[_0x3c9c('0x31')]['create'](_0x4365c8['body'],{})[_0x3c9c('0x2b')](function(_0xbe8435){_0xca13a6=_0xbe8435;return db[_0x3c9c('0x56')]['findOne']({'where':{'id':_0xca13a6['ContactId']}});})[_0x3c9c('0x2b')](function(_0x4a1724){if(_['isNil'](_0x4a1724)){return;}else{_0xca13a6[_0x3c9c('0x6b')]=_0x4a1724[_0x3c9c('0x6b')];return db[_0x3c9c('0x73')]['findOne']({'where':{'id':_0xca13a6['AttachmentId']}});}})[_0x3c9c('0x2b')](function(_0x2acbcb){return respondWithRpcPromise(_0x3c9c('0x74'),_0x3c9c('0x74'),{'FaxAccountId':_['isNil'](_0x4365c8[_0x3c9c('0x50')])?undefined:_0x4365c8['body'][_0x3c9c('0x75')],'path':_['isNil'](_0x2acbcb)?undefined:util[_0x3c9c('0x54')]('/var/opt/motion2/server/files/attachments/%s',_0x2acbcb[_0x3c9c('0x76')]),'fax':_[_0x3c9c('0x5b')](_0xca13a6[_0x3c9c('0x6b')])?undefined:_0xca13a6[_0x3c9c('0x6b')],'AttachmentId':_0xca13a6[_0x3c9c('0x77')]},client9002);})[_0x3c9c('0x2b')](respondWithResult(_0xd1a10e,0xc9))[_0x3c9c('0x4b')](handleError(_0xd1a10e,null));};exports[_0x3c9c('0x78')]=function(_0x3dd39c,_0xa30d5a){var _0x1a6b2c=path[_0x3c9c('0x79')](config[_0x3c9c('0x7a')],_0x3c9c('0x7b'),_0x3c9c('0x7c'),_0x3c9c('0x7d'));return db[_0x3c9c('0x31')][_0x3c9c('0x4f')]({'where':{'id':_0x3dd39c[_0x3c9c('0x4d')]['id']},'include':[{'model':db['Attachment'],'as':_0x3c9c('0x73')}]})[_0x3c9c('0x2b')](handleEntityNotFound(_0xa30d5a,null))[_0x3c9c('0x2b')](function(_0x3a6990){if(_0x3a6990){return _0xa30d5a[_0x3c9c('0x78')](path[_0x3c9c('0x79')](_0x1a6b2c,_0x3a6990[_0x3c9c('0x73')][_0x3c9c('0x76')]));}})[_0x3c9c('0x4b')](handleError(_0xa30d5a,null));};
\ No newline at end of file
+var _0x1bb2=['rawAttributes','model','keys','query','dateEnd','dateStart','filters','attributes','intersection','fields','length','order','sort','where','add','day','filter','merge','map','options','includeAll','include','findAll','rows','show','params','find','body','destroy','describe','../../config/logger','fax-interactions','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','FaxInteraction','FaxInteractionId','isNil','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','channel','event','accept','EventManager','acceptmessage','agent','get','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','create','CmContact','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','root','files','attachments','join','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./faxMessage.socket','register','client','http','request','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','count','offset','limit','set','json','apply','reject','update','then','stack','name','send','index','FaxMessage'];(function(_0x11c050,_0x14fcab){var _0x3e06e2=function(_0x401ee6){while(--_0x401ee6){_0x11c050['push'](_0x11c050['shift']());}};_0x3e06e2(++_0x14fcab);}(_0x1bb2,0x152));var _0x21bb=function(_0x3ac8c3,_0x2bd358){_0x3ac8c3=_0x3ac8c3-0x0;var _0x1e43db=_0x1bb2[_0x3ac8c3];return _0x1e43db;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x21bb('0x0'));var rimraf=require(_0x21bb('0x1'));var zipdir=require(_0x21bb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x21bb('0x3'));var BPromise=require(_0x21bb('0x4'));var Mustache=require(_0x21bb('0x5'));var util=require(_0x21bb('0x6'));var path=require(_0x21bb('0x7'));var sox=require(_0x21bb('0x8'));var csv=require(_0x21bb('0x9'));var ejs=require(_0x21bb('0xa'));var fs=require('fs');var _=require(_0x21bb('0xb'));var squel=require(_0x21bb('0xc'));var crypto=require(_0x21bb('0xd'));var jsforce=require(_0x21bb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x21bb('0x9'));var querystring=require('querystring');var Papa=require(_0x21bb('0xf'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x21bb('0x10'));var utils=require(_0x21bb('0x11'));var config=require(_0x21bb('0x12'));var db=require(_0x21bb('0x13'))['db'];var socket=require(_0x21bb('0x14'))({'host':_0x21bb('0x15'),'port':0x18eb});require(_0x21bb('0x16'))[_0x21bb('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0x21bb('0x18')][_0x21bb('0x19')]({'port':0x232c});var client9002=jayson['client'][_0x21bb('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x21a282,_0x4aefcd,_0x42ad54,_0xae34f3){return new BPromise(function(_0x3444e1,_0x3fd2d9){var _0x5a66d5=_0xae34f3||client;return _0x5a66d5[_0x21bb('0x1a')](_0x21a282,_0x42ad54)['then'](function(_0x5eb3d2){logger[_0x21bb('0x1b')](_0x21bb('0x1c'),_0x4aefcd,_0x21bb('0x1d'));logger[_0x21bb('0x1e')](_0x21bb('0x1f'),_0x4aefcd,_0x21bb('0x1d'),JSON[_0x21bb('0x20')](_0x5eb3d2));if(_0x5eb3d2[_0x21bb('0x21')]){if(_0x5eb3d2[_0x21bb('0x21')][_0x21bb('0x22')]===0x1f4){logger[_0x21bb('0x21')]('FaxMessage,\x20%s,\x20%s',_0x4aefcd,_0x5eb3d2[_0x21bb('0x21')][_0x21bb('0x23')]);return _0x3fd2d9(_0x5eb3d2[_0x21bb('0x21')]['message']);}logger[_0x21bb('0x21')](_0x21bb('0x1c'),_0x4aefcd,_0x5eb3d2[_0x21bb('0x21')][_0x21bb('0x23')]);return _0x3444e1(_0x5eb3d2[_0x21bb('0x21')][_0x21bb('0x23')]);}else{logger[_0x21bb('0x1b')](_0x21bb('0x1c'),_0x4aefcd,_0x21bb('0x1d'));_0x3444e1(_0x5eb3d2[_0x21bb('0x24')][_0x21bb('0x23')]);}})[_0x21bb('0x25')](function(_0x5ed52b){logger[_0x21bb('0x21')](_0x21bb('0x1c'),_0x4aefcd,_0x5ed52b);_0x3fd2d9(_0x5ed52b);});});}function respondWithStatusCode(_0x358c1a,_0x490266){_0x490266=_0x490266||0xcc;return function(_0x35a313){if(_0x35a313){return _0x358c1a[_0x21bb('0x26')](_0x490266);}return _0x358c1a[_0x21bb('0x27')](_0x490266)[_0x21bb('0x28')]();};}function respondWithResult(_0x40d801,_0x3239e2){_0x3239e2=_0x3239e2||0xc8;return function(_0x112412){if(_0x112412){return _0x40d801[_0x21bb('0x27')](_0x3239e2)['json'](_0x112412);}};}function respondWithFilteredResult(_0x22a467,_0xed3ab2){return function(_0xccd597){if(_0xccd597){var _0x3d5571=_0xccd597[_0x21bb('0x29')],_0x5ddcd6=_0xed3ab2[_0x21bb('0x2a')],_0x44d720=_0xed3ab2[_0x21bb('0x2a')]+_0xed3ab2[_0x21bb('0x2b')],_0x26c46a;if(_0x44d720>=_0x3d5571){_0x44d720=_0x3d5571;_0x26c46a=0xc8;}else{_0x26c46a=0xce;}_0x22a467[_0x21bb('0x27')](_0x26c46a);return _0x22a467[_0x21bb('0x2c')]('Content-Range',_0x5ddcd6+'-'+_0x44d720+'/'+_0x3d5571)[_0x21bb('0x2d')](_0xccd597);}return null;};}function patchUpdates(_0xfd3327){return function(_0x4fc34d){try{jsonpatch[_0x21bb('0x2e')](_0x4fc34d,_0xfd3327,!![]);}catch(_0x38857e){return BPromise[_0x21bb('0x2f')](_0x38857e);}return _0x4fc34d['save']();};}function saveUpdates(_0x28548b,_0x4a3087){return function(_0x2ca209){if(_0x2ca209){return _0x2ca209[_0x21bb('0x30')](_0x28548b)[_0x21bb('0x31')](function(_0x3c58d5){return _0x3c58d5;});}return null;};}function removeEntity(_0x5713d8,_0x32b374){return function(_0x24dac3){if(_0x24dac3){return _0x24dac3['destroy']()[_0x21bb('0x31')](function(){_0x5713d8[_0x21bb('0x27')](0xcc)[_0x21bb('0x28')]();});}};}function handleEntityNotFound(_0x390fa0,_0x1ea462){return function(_0x2e8d63){if(!_0x2e8d63){_0x390fa0['sendStatus'](0x194);}return _0x2e8d63;};}function handleError(_0x4166a5,_0x2bf5bc){_0x2bf5bc=_0x2bf5bc||0x1f4;return function(_0x50bde9){logger[_0x21bb('0x21')](_0x50bde9[_0x21bb('0x32')]);if(_0x50bde9['name']){delete _0x50bde9[_0x21bb('0x33')];}_0x4166a5[_0x21bb('0x27')](_0x2bf5bc)[_0x21bb('0x34')](_0x50bde9);};}exports[_0x21bb('0x35')]=function(_0x58e25a,_0x5f2b10){var _0x2b8d0d={},_0x5c418c={},_0x41a772={'count':0x0,'rows':[]};var _0x59aedf=db[_0x21bb('0x36')][_0x21bb('0x37')];_0x5c418c[_0x21bb('0x38')]=_[_0x21bb('0x39')](_0x59aedf);var _0x3049ea={'dateStart':_0x58e25a['query']['dateStart'],'dateEnd':_0x58e25a[_0x21bb('0x3a')][_0x21bb('0x3b')]};delete _0x58e25a[_0x21bb('0x3a')][_0x21bb('0x3c')];delete _0x58e25a[_0x21bb('0x3a')]['dateEnd'];_0x5c418c['query']=_[_0x21bb('0x39')](_0x58e25a[_0x21bb('0x3a')]);_0x5c418c[_0x21bb('0x3d')]=_['intersection'](_0x5c418c[_0x21bb('0x38')],_0x5c418c['query']);_0x2b8d0d[_0x21bb('0x3e')]=_[_0x21bb('0x3f')](_0x5c418c[_0x21bb('0x38')],qs['fields'](_0x58e25a['query'][_0x21bb('0x40')]));_0x2b8d0d[_0x21bb('0x3e')]=_0x2b8d0d[_0x21bb('0x3e')][_0x21bb('0x41')]?_0x2b8d0d['attributes']:_0x5c418c[_0x21bb('0x38')];if(!_0x58e25a[_0x21bb('0x3a')]['hasOwnProperty']('nolimit')){_0x2b8d0d['limit']=qs[_0x21bb('0x2b')](_0x58e25a[_0x21bb('0x3a')][_0x21bb('0x2b')]);_0x2b8d0d[_0x21bb('0x2a')]=qs[_0x21bb('0x2a')](_0x58e25a[_0x21bb('0x3a')][_0x21bb('0x2a')]);}_0x2b8d0d[_0x21bb('0x42')]=qs[_0x21bb('0x43')](_0x58e25a['query'][_0x21bb('0x43')]);_0x2b8d0d[_0x21bb('0x44')]=qs[_0x21bb('0x3d')](_['pick'](_0x58e25a['query'],_0x5c418c['filters']));if(_0x3049ea[_0x21bb('0x3c')]){if(_0x3049ea['dateEnd']){_0x3049ea[_0x21bb('0x3b')]=moment(_0x3049ea[_0x21bb('0x3b')])[_0x21bb('0x45')](0x1,'day');}else{_0x3049ea[_0x21bb('0x3b')]=moment(_0x3049ea['dateStart'])[_0x21bb('0x45')](0x1,_0x21bb('0x46'));}_['merge'](_0x2b8d0d[_0x21bb('0x44')],{'createdAt':{'$gte':_0x3049ea[_0x21bb('0x3c')],'$lte':_0x3049ea[_0x21bb('0x3b')]}});}if(_0x58e25a[_0x21bb('0x3a')][_0x21bb('0x47')]){_0x2b8d0d[_0x21bb('0x44')]=_[_0x21bb('0x48')](_0x2b8d0d['where'],{'$or':_[_0x21bb('0x49')](_0x2b8d0d['attributes'],function(_0x52ce0d){var _0x5c7e4b={};_0x5c7e4b[_0x52ce0d]={'$like':'%'+_0x58e25a[_0x21bb('0x3a')][_0x21bb('0x47')]+'%'};return _0x5c7e4b;})});}_0x2b8d0d=_[_0x21bb('0x48')]({},_0x2b8d0d,_0x58e25a[_0x21bb('0x4a')]);var _0xed14f6={'where':_0x2b8d0d[_0x21bb('0x44')]};return db[_0x21bb('0x36')][_0x21bb('0x29')](_0xed14f6)[_0x21bb('0x31')](function(_0x42e1e4){_0x41a772[_0x21bb('0x29')]=_0x42e1e4;if(_0x58e25a['query'][_0x21bb('0x4b')]){_0x2b8d0d[_0x21bb('0x4c')]=[{'all':!![]}];}return db[_0x21bb('0x36')][_0x21bb('0x4d')](_0x2b8d0d);})[_0x21bb('0x31')](function(_0x253cbe){_0x41a772[_0x21bb('0x4e')]=_0x253cbe;return _0x41a772;})['then'](respondWithFilteredResult(_0x5f2b10,_0x2b8d0d))[_0x21bb('0x25')](handleError(_0x5f2b10,null));};exports[_0x21bb('0x4f')]=function(_0x2c7e54,_0x20e7ad){var _0x18c490={'raw':!![],'where':{'id':_0x2c7e54[_0x21bb('0x50')]['id']}},_0x522a79={};_0x522a79[_0x21bb('0x38')]=_[_0x21bb('0x39')](db[_0x21bb('0x36')]['rawAttributes']);_0x522a79[_0x21bb('0x3a')]=_['keys'](_0x2c7e54[_0x21bb('0x3a')]);_0x522a79[_0x21bb('0x3d')]=_[_0x21bb('0x3f')](_0x522a79[_0x21bb('0x38')],_0x522a79[_0x21bb('0x3a')]);_0x18c490['attributes']=_['intersection'](_0x522a79[_0x21bb('0x38')],qs[_0x21bb('0x40')](_0x2c7e54[_0x21bb('0x3a')][_0x21bb('0x40')]));_0x18c490[_0x21bb('0x3e')]=_0x18c490[_0x21bb('0x3e')][_0x21bb('0x41')]?_0x18c490[_0x21bb('0x3e')]:_0x522a79[_0x21bb('0x38')];if(_0x2c7e54[_0x21bb('0x3a')][_0x21bb('0x4b')]){_0x18c490['include']=[{'all':!![]}];}_0x18c490=_[_0x21bb('0x48')]({},_0x18c490,_0x2c7e54[_0x21bb('0x4a')]);return db[_0x21bb('0x36')][_0x21bb('0x51')](_0x18c490)[_0x21bb('0x31')](handleEntityNotFound(_0x20e7ad,null))[_0x21bb('0x31')](respondWithResult(_0x20e7ad,null))['catch'](handleError(_0x20e7ad,null));};exports[_0x21bb('0x30')]=function(_0xb6a79d,_0x52be08){if(_0xb6a79d[_0x21bb('0x52')]['id']){delete _0xb6a79d['body']['id'];}return db[_0x21bb('0x36')][_0x21bb('0x51')]({'where':{'id':_0xb6a79d[_0x21bb('0x50')]['id']}})['then'](handleEntityNotFound(_0x52be08,null))[_0x21bb('0x31')](saveUpdates(_0xb6a79d[_0x21bb('0x52')],null))[_0x21bb('0x31')](respondWithResult(_0x52be08,null))[_0x21bb('0x25')](handleError(_0x52be08,null));};exports[_0x21bb('0x53')]=function(_0x3d0e21,_0x238a8e){return db[_0x21bb('0x36')][_0x21bb('0x51')]({'where':{'id':_0x3d0e21['params']['id']}})[_0x21bb('0x31')](handleEntityNotFound(_0x238a8e,null))[_0x21bb('0x31')](removeEntity(_0x238a8e,null))[_0x21bb('0x25')](handleError(_0x238a8e,null));};exports[_0x21bb('0x54')]=function(_0x29555c,_0x3a7be8){return db['FaxMessage']['describe']()[_0x21bb('0x31')](respondWithResult(_0x3a7be8,null))[_0x21bb('0x25')](handleError(_0x3a7be8,null));};var interaction_log=require(_0x21bb('0x55'))(_0x21bb('0x56'));exports['accept']=function(_0x5e427c,_0x3abdba,_0x5236a5){var _0x4d007f={'channel':_0x21bb('0x57')};if(_0x5e427c[_0x21bb('0x52')]['id']){delete _0x5e427c[_0x21bb('0x52')]['id'];}_0x5e427c[_0x21bb('0x52')][_0x21bb('0x58')]=!![];_0x5e427c[_0x21bb('0x52')][_0x21bb('0x59')]=moment()['format'](_0x21bb('0x5a'));_0x5e427c[_0x21bb('0x52')][_0x21bb('0x5b')]=_0x5e427c['body']['UserId']||_0x5e427c[_0x21bb('0x5c')]['id'];return db[_0x21bb('0x36')][_0x21bb('0x51')]({'where':{'id':_0x5e427c[_0x21bb('0x50')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x21bb('0x5d')}]})['then'](handleEntityNotFound(_0x3abdba,null))['then'](saveUpdates(_0x5e427c[_0x21bb('0x52')],null))[_0x21bb('0x31')](function(_0x4ee4b1){if(_0x4ee4b1){_0x4d007f[_0x21bb('0x23')]=_0x4ee4b1['get']({'plain':!![]});return db[_0x21bb('0x5e')]['find']({'where':{'id':_0x4ee4b1[_0x21bb('0x5f')]}});}return null;})[_0x21bb('0x31')](handleEntityNotFound(_0x3abdba,null))[_0x21bb('0x31')](function(_0x1cf029){if(_0x1cf029){return _0x1cf029[_0x21bb('0x30')]({'UserId':_0x5e427c[_0x21bb('0x52')][_0x21bb('0x5b')],'read1stAt':_[_0x21bb('0x60')](_0x1cf029['read1stAt'])?moment()[_0x21bb('0x61')](_0x21bb('0x5a')):undefined});}return null;})[_0x21bb('0x31')](function(_0x4fd2ae){if(_0x4fd2ae){_0x4d007f[_0x21bb('0x62')]=_0x4fd2ae['get']({'plain':!![]});interaction_log[_0x21bb('0x1b')](_0x21bb('0x63'),_0x5e427c[_0x21bb('0x5c')]['id'],_0x5e427c['user'][_0x21bb('0x33')],_0x5e427c[_0x21bb('0x5c')][_0x21bb('0x64')],_0x4d007f[_0x21bb('0x62')]['id'],_0x5e427c[_0x21bb('0x52')]?JSON['stringify'](_0x5e427c['body']):_0x21bb('0x65'));return respondWithRpcPromise(_0x21bb('0x66'),_0x21bb('0x67'),_0x4d007f);}return null;})[_0x21bb('0x31')](function(_0x3c3eb5){if(_0x3c3eb5){if(_0x5e427c['body'][_0x21bb('0x68')]){_0x4d007f[_0x21bb('0x23')][_0x21bb('0x69')]=util[_0x21bb('0x61')]('SIP/%s',_0x5e427c[_0x21bb('0x5c')][_0x21bb('0x33')]);_0x4d007f[_0x21bb('0x23')][_0x21bb('0x6a')]=_0x4d007f['channel'];_0x4d007f['message'][_0x21bb('0x6b')]=_0x21bb('0x6c');return respondWithRpcPromise(_0x21bb('0x6d'),'EventManager',{'event':_0x21bb('0x6e'),'message':_0x4d007f[_0x21bb('0x23')]},client9002)[_0x21bb('0x31')](function(){return _0x4d007f;});}return _0x4d007f;}return null;})[_0x21bb('0x31')](respondWithResult(_0x3abdba,null))[_0x21bb('0x25')](handleError(_0x3abdba,null));};var interaction_log=require('../../config/logger')(_0x21bb('0x56'));exports['reject']=function(_0x551967,_0x23e937,_0xb1713d){var _0x1385c6={'agent':{},'channel':_0x21bb('0x57')};if(_0x551967['body']['id']){delete _0x551967[_0x21bb('0x52')]['id'];}_0x551967['body'][_0x21bb('0x5b')]=_0x551967[_0x21bb('0x52')]['UserId']||_0x551967[_0x21bb('0x5c')]['id'];_0x1385c6[_0x21bb('0x6f')]['id']=_0x551967['body'][_0x21bb('0x5b')];return db['FaxMessage'][_0x21bb('0x51')]({'where':{'id':_0x551967[_0x21bb('0x50')]['id'],'UserId':null}})[_0x21bb('0x31')](handleEntityNotFound(_0x23e937,null))[_0x21bb('0x31')](function(_0x1bc169){if(_0x1bc169){_0x1385c6[_0x21bb('0x23')]=_0x1bc169['get']({'plain':!![]});return db[_0x21bb('0x5e')]['find']({'where':{'id':_0x1bc169['FaxInteractionId']}});}return null;})[_0x21bb('0x31')](handleEntityNotFound(_0x23e937,null))['then'](function(_0x1fc242){if(_0x1fc242){_0x1385c6[_0x21bb('0x62')]=_0x1fc242[_0x21bb('0x70')]({'plain':!![]});interaction_log[_0x21bb('0x1b')](_0x21bb('0x71'),_0x551967[_0x21bb('0x5c')]['id'],_0x551967[_0x21bb('0x5c')][_0x21bb('0x33')],_0x551967[_0x21bb('0x5c')][_0x21bb('0x64')],_0x1385c6[_0x21bb('0x62')]['id'],_0x551967[_0x21bb('0x52')]?JSON[_0x21bb('0x20')](_0x551967[_0x21bb('0x52')]):'null');return respondWithRpcPromise(_0x21bb('0x72'),_0x21bb('0x73'),_0x1385c6);}return null;})['then'](function(_0x1acfa0){if(_0x1acfa0){_0x1acfa0[_0x21bb('0x23')][_0x21bb('0x69')]=util[_0x21bb('0x61')](_0x21bb('0x74'),_0x551967[_0x21bb('0x5c')][_0x21bb('0x33')]);_0x1acfa0['message'][_0x21bb('0x6a')]=_0x1385c6[_0x21bb('0x6a')];_0x1acfa0[_0x21bb('0x23')][_0x21bb('0x6b')]=_0x21bb('0x2f');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x1acfa0[_0x21bb('0x23')]},client9002);return _0x1385c6;}return null;})[_0x21bb('0x31')](respondWithResult(_0x23e937,null))['catch'](handleError(_0x23e937,null));};exports[_0x21bb('0x75')]=function(_0x5cf294,_0x71dac3){var _0x480864;return db[_0x21bb('0x36')][_0x21bb('0x75')](_0x5cf294[_0x21bb('0x52')],{})[_0x21bb('0x31')](function(_0x2751a8){_0x480864=_0x2751a8;return db[_0x21bb('0x76')]['findOne']({'where':{'id':_0x480864[_0x21bb('0x77')]}});})[_0x21bb('0x31')](function(_0xb12ab3){if(_[_0x21bb('0x60')](_0xb12ab3)){return;}else{_0x480864[_0x21bb('0x57')]=_0xb12ab3[_0x21bb('0x57')];return db[_0x21bb('0x78')]['findOne']({'where':{'id':_0x480864[_0x21bb('0x79')]}});}})['then'](function(_0x5bb6bf){return respondWithRpcPromise('SendFax',_0x21bb('0x7a'),{'FaxAccountId':_[_0x21bb('0x60')](_0x5cf294['body'])?undefined:_0x5cf294[_0x21bb('0x52')][_0x21bb('0x7b')],'path':_[_0x21bb('0x60')](_0x5bb6bf)?undefined:util[_0x21bb('0x61')](_0x21bb('0x7c'),_0x5bb6bf[_0x21bb('0x7d')]),'fax':_[_0x21bb('0x60')](_0x480864[_0x21bb('0x57')])?undefined:_0x480864[_0x21bb('0x57')],'AttachmentId':_0x480864['AttachmentId']},client9002);})[_0x21bb('0x31')](respondWithResult(_0x71dac3,0xc9))[_0x21bb('0x25')](handleError(_0x71dac3,null));};exports[_0x21bb('0x7e')]=function(_0x3375d3,_0x38f305){var _0x1fe300=path['join'](config[_0x21bb('0x7f')],'server',_0x21bb('0x80'),_0x21bb('0x81'));return db['FaxMessage'][_0x21bb('0x51')]({'where':{'id':_0x3375d3[_0x21bb('0x50')]['id']},'include':[{'model':db[_0x21bb('0x78')],'as':_0x21bb('0x78')}]})['then'](handleEntityNotFound(_0x38f305,null))[_0x21bb('0x31')](function(_0x5cd546){if(_0x5cd546){return _0x38f305['download'](path[_0x21bb('0x82')](_0x1fe300,_0x5cd546['Attachment'][_0x21bb('0x7d')]));}})[_0x21bb('0x25')](handleError(_0x38f305,null));};
\ No newline at end of file
index af9452e..5c469d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fcc=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x1857d0,_0x6eade0){var _0x3e3c46=function(_0x3915b8){while(--_0x3915b8){_0x1857d0['push'](_0x1857d0['shift']());}};_0x3e3c46(++_0x6eade0);}(_0x7fcc,0x8b));var _0xc7fc=function(_0x723a86,_0x3d8c53){_0x723a86=_0x723a86-0x0;var _0x193f26=_0x7fcc[_0x723a86];return _0x193f26;};'use strict';var EventEmitter=require(_0xc7fc('0x0'));var FaxMessage=require(_0xc7fc('0x1'))['db'][_0xc7fc('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xc7fc('0x3')](0x0);var events={'afterCreate':_0xc7fc('0x4'),'afterUpdate':_0xc7fc('0x5'),'afterDestroy':_0xc7fc('0x6')};function emitEvent(_0x3226e0){return function(_0x286db2,_0x44ac13,_0x6ed588){FaxMessageEvents['emit'](_0x3226e0+':'+_0x286db2['id'],_0x286db2);FaxMessageEvents[_0xc7fc('0x7')](_0x3226e0,_0x286db2);_0x6ed588(null);};}for(var e in events){if(events[_0xc7fc('0x8')](e)){var event=events[e];FaxMessage[_0xc7fc('0x9')](e,emitEvent(event));}}module[_0xc7fc('0xa')]=FaxMessageEvents;
\ No newline at end of file
+var _0x486d=['remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','update'];(function(_0x2c78b0,_0x24bf54){var _0x4af61f=function(_0xccefab){while(--_0xccefab){_0x2c78b0['push'](_0x2c78b0['shift']());}};_0x4af61f(++_0x24bf54);}(_0x486d,0xdd));var _0xd486=function(_0x136681,_0x173b14){_0x136681=_0x136681-0x0;var _0x541afe=_0x486d[_0x136681];return _0x541afe;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0xd486('0x0'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xd486('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd486('0x2'),'afterDestroy':_0xd486('0x3')};function emitEvent(_0x2768ee){return function(_0x36715d,_0x1d85de,_0x26a99a){FaxMessageEvents[_0xd486('0x4')](_0x2768ee+':'+_0x36715d['id'],_0x36715d);FaxMessageEvents['emit'](_0x2768ee,_0x36715d);_0x26a99a(null);};}for(var e in events){if(events[_0xd486('0x5')](e)){var event=events[e];FaxMessage[_0xd486('0x6')](e,emitEvent(event));}}module['exports']=FaxMessageEvents;
\ No newline at end of file
index 89e0778..079937a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5fc=['fax_messages','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','./faxMessage.attributes','FaxMessage'];(function(_0x5db40f,_0x3df7cb){var _0x22d4d4=function(_0x29690d){while(--_0x29690d){_0x5db40f['push'](_0x5db40f['shift']());}};_0x22d4d4(++_0x3df7cb);}(_0xe5fc,0x125));var _0xce5f=function(_0x5012c6,_0x47ea60){_0x5012c6=_0x5012c6-0x0;var _0x44f449=_0xe5fc[_0x5012c6];return _0x44f449;};'use strict';var _=require('lodash');var util=require(_0xce5f('0x0'));var logger=require(_0xce5f('0x1'))('api');var moment=require(_0xce5f('0x2'));var BPromise=require('bluebird');var rp=require(_0xce5f('0x3'));var attributes=require(_0xce5f('0x4'));module['exports']=function(_0x53f3c0,_0x1ac90c){return _0x53f3c0['define'](_0xce5f('0x5'),attributes,{'tableName':_0xce5f('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x25c0dd,_0x5af195,_0x15a50c){var _0x1df871=_0x53f3c0[_0xce5f('0x7')];var _0x34859f=_0x25c0dd[_0xce5f('0x8')]({'plain':!![]});if(_0x34859f[_0xce5f('0x9')][_0xce5f('0xa')]()==='in'||_0x34859f['direction']['toLowerCase']()===_0xce5f('0xb')&&!_0x34859f[_0xce5f('0xc')]&&!_[_0xce5f('0xd')](_0x34859f[_0xce5f('0xe')])){_0x1df871['FaxInteraction']['findOne']({'where':{'id':_0x34859f[_0xce5f('0xf')]}})[_0xce5f('0x10')](function(_0x6d6272){if(_0x6d6272){_0x6d6272[_0xce5f('0x11')]({'lastMsgAt':_0x34859f[_0xce5f('0x12')],'lastMsgDirection':_0x34859f['direction'][_0xce5f('0xa')](),'lastMsgBody':_0x34859f['body']});}})[_0xce5f('0x13')](function(_0x27584a){console[_0xce5f('0x14')](_0x27584a);});}_0x15a50c();}},'charset':_0xce5f('0x15'),'collate':_0xce5f('0x16')});};
\ No newline at end of file
+var _0x24ab=['createdAt','toLowerCase','body','catch','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./faxMessage.attributes','exports','define','FaxMessage','models','direction','out','isNil','UserId','findOne','FaxInteractionId','update'];(function(_0x3685c3,_0x54b36b){var _0x3aee5e=function(_0x22cc51){while(--_0x22cc51){_0x3685c3['push'](_0x3685c3['shift']());}};_0x3aee5e(++_0x54b36b);}(_0x24ab,0xb5));var _0xb24a=function(_0x2a5ee5,_0x5cbfd2){_0x2a5ee5=_0x2a5ee5-0x0;var _0x36ec33=_0x24ab[_0x2a5ee5];return _0x36ec33;};'use strict';var _=require(_0xb24a('0x0'));var util=require(_0xb24a('0x1'));var logger=require(_0xb24a('0x2'))(_0xb24a('0x3'));var moment=require(_0xb24a('0x4'));var BPromise=require(_0xb24a('0x5'));var rp=require(_0xb24a('0x6'));var attributes=require(_0xb24a('0x7'));module[_0xb24a('0x8')]=function(_0x2bd230,_0x45886a){return _0x2bd230[_0xb24a('0x9')](_0xb24a('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2762d3,_0x55a5fc,_0x236780){var _0x577d61=_0x2bd230[_0xb24a('0xb')];var _0x2d41ae=_0x2762d3['get']({'plain':!![]});if(_0x2d41ae[_0xb24a('0xc')]['toLowerCase']()==='in'||_0x2d41ae['direction']['toLowerCase']()===_0xb24a('0xd')&&!_0x2d41ae['secret']&&!_[_0xb24a('0xe')](_0x2d41ae[_0xb24a('0xf')])){_0x577d61['FaxInteraction'][_0xb24a('0x10')]({'where':{'id':_0x2d41ae[_0xb24a('0x11')]}})['then'](function(_0xe9a262){if(_0xe9a262){_0xe9a262[_0xb24a('0x12')]({'lastMsgAt':_0x2d41ae[_0xb24a('0x13')],'lastMsgDirection':_0x2d41ae[_0xb24a('0xc')][_0xb24a('0x14')](),'lastMsgBody':_0x2d41ae[_0xb24a('0x15')]});}})[_0xb24a('0x16')](function(_0xbccfdb){console[_0xb24a('0x17')](_0xbccfdb);});}_0x236780();}},'charset':_0xb24a('0x18'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 68516cf..df07ab0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd6b=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','localhost','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateFaxMessage','FaxMessage','create','body','options','debug','UpdateFaxMessage','raw','where','limit','lodash'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xdd6b,0xa9));var _0xbdd6=function(_0x4dbaec,_0x202b19){_0x4dbaec=_0x4dbaec-0x0;var _0x1d0d81=_0xdd6b[_0x4dbaec];return _0x1d0d81;};'use strict';var _=require(_0xbdd6('0x0'));var util=require(_0xbdd6('0x1'));var moment=require(_0xbdd6('0x2'));var BPromise=require(_0xbdd6('0x3'));var rs=require(_0xbdd6('0x4'));var fs=require('fs');var db=require(_0xbdd6('0x5'))['db'];var utils=require(_0xbdd6('0x6'));var logger=require('../../config/logger')(_0xbdd6('0x7'));var config=require(_0xbdd6('0x8'));var jayson=require(_0xbdd6('0x9'));var client=jayson[_0xbdd6('0xa')][_0xbdd6('0xb')]({'port':0x232a});var socket=require('socket.io-emitter')({'host':_0xbdd6('0xc'),'port':0x18eb});require('./faxMessage.socket')[_0xbdd6('0xd')](socket);function respondWithRpcPromise(_0x1bfb24,_0x2fd2d2,_0x8b4051){return new BPromise(function(_0x40ce8a,_0xc8ac55){return client[_0xbdd6('0xe')](_0x1bfb24,_0x8b4051)[_0xbdd6('0xf')](function(_0x58e6fb){logger[_0xbdd6('0x10')](_0xbdd6('0x11'),_0x2fd2d2,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x2fd2d2,_0xbdd6('0x12'),JSON[_0xbdd6('0x13')](_0x58e6fb));if(_0x58e6fb['error']){if(_0x58e6fb[_0xbdd6('0x14')][_0xbdd6('0x15')]===0x1f4){logger[_0xbdd6('0x14')](_0xbdd6('0x11'),_0x2fd2d2,_0x58e6fb['error']['message']);return _0xc8ac55(_0x58e6fb[_0xbdd6('0x14')][_0xbdd6('0x16')]);}logger[_0xbdd6('0x14')](_0xbdd6('0x11'),_0x2fd2d2,_0x58e6fb[_0xbdd6('0x14')][_0xbdd6('0x16')]);return _0x40ce8a(_0x58e6fb[_0xbdd6('0x14')][_0xbdd6('0x16')]);}else{logger[_0xbdd6('0x10')](_0xbdd6('0x11'),_0x2fd2d2,_0xbdd6('0x12'));_0x40ce8a(_0x58e6fb['result']['message']);}})[_0xbdd6('0x17')](function(_0x3047b2){logger[_0xbdd6('0x14')]('FaxMessage,\x20%s,\x20%s',_0x2fd2d2,_0x3047b2);_0xc8ac55(_0x3047b2);});});}exports[_0xbdd6('0x18')]=function(_0x8c2763){var _0x4111cc=this;return new Promise(function(_0x14f496,_0x1a1fb1){return db[_0xbdd6('0x19')][_0xbdd6('0x1a')](_0x8c2763[_0xbdd6('0x1b')],{'raw':_0x8c2763[_0xbdd6('0x1c')]?_0x8c2763[_0xbdd6('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xbdd6('0xf')](function(_0x4b1a00){logger['info'](_0xbdd6('0x18'),_0x8c2763);logger[_0xbdd6('0x1d')](_0xbdd6('0x18'),_0x8c2763,JSON[_0xbdd6('0x13')](_0x4b1a00));_0x14f496(_0x4b1a00);})[_0xbdd6('0x17')](function(_0x4ec8e7){logger[_0xbdd6('0x14')](_0xbdd6('0x18'),_0x4ec8e7['message'],_0x8c2763);_0x1a1fb1(_0x4111cc[_0xbdd6('0x14')](0x1f4,_0x4ec8e7[_0xbdd6('0x16')]));});});};exports[_0xbdd6('0x1e')]=function(_0x1e942d){var _0x30e8ff=this;return new Promise(function(_0x1dabbd,_0x13c8ad){return db[_0xbdd6('0x19')]['update'](_0x1e942d[_0xbdd6('0x1b')],{'raw':_0x1e942d[_0xbdd6('0x1c')]?_0x1e942d[_0xbdd6('0x1c')][_0xbdd6('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e942d['options']?_0x1e942d[_0xbdd6('0x1c')][_0xbdd6('0x20')]||null:null,'attributes':_0x1e942d['options']?_0x1e942d[_0xbdd6('0x1c')]['attributes']||null:null,'limit':_0x1e942d[_0xbdd6('0x1c')]?_0x1e942d['options'][_0xbdd6('0x21')]||null:null})[_0xbdd6('0xf')](function(_0x4be5fb){logger['info'](_0xbdd6('0x1e'),_0x1e942d);logger['debug'](_0xbdd6('0x1e'),_0x1e942d,JSON['stringify'](_0x4be5fb));_0x1dabbd(_0x4be5fb);})[_0xbdd6('0x17')](function(_0x6c7ac6){logger[_0xbdd6('0x14')](_0xbdd6('0x1e'),_0x6c7ac6[_0xbdd6('0x16')],_0x1e942d);_0x13c8ad(_0x30e8ff['error'](0x1f4,_0x6c7ac6[_0xbdd6('0x16')]));});});};
\ No newline at end of file
+var _0x0dfc=['raw','debug','UpdateFaxMessage','update','attributes','stringify','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','socket.io-emitter','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','catch','CreateFaxMessage','create','body','options'];(function(_0x4278d3,_0x39eb43){var _0x143dcf=function(_0xb5587e){while(--_0xb5587e){_0x4278d3['push'](_0x4278d3['shift']());}};_0x143dcf(++_0x39eb43);}(_0x0dfc,0xee));var _0xc0df=function(_0x42adeb,_0x2aa56f){_0x42adeb=_0x42adeb-0x0;var _0x18defa=_0x0dfc[_0x42adeb];return _0x18defa;};'use strict';var _=require('lodash');var util=require(_0xc0df('0x0'));var moment=require(_0xc0df('0x1'));var BPromise=require('bluebird');var rs=require(_0xc0df('0x2'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc0df('0x3'))(_0xc0df('0x4'));var config=require(_0xc0df('0x5'));var jayson=require(_0xc0df('0x6'));var client=jayson[_0xc0df('0x7')]['http']({'port':0x232a});var socket=require(_0xc0df('0x8'))({'host':'localhost','port':0x18eb});require('./faxMessage.socket')[_0xc0df('0x9')](socket);function respondWithRpcPromise(_0x49a7ce,_0x418978,_0xf3f1e8){return new BPromise(function(_0x26c27a,_0x162b81){return client[_0xc0df('0xa')](_0x49a7ce,_0xf3f1e8)[_0xc0df('0xb')](function(_0x3eaa9a){logger[_0xc0df('0xc')](_0xc0df('0xd'),_0x418978,_0xc0df('0xe'));logger['debug'](_0xc0df('0xf'),_0x418978,_0xc0df('0xe'),JSON['stringify'](_0x3eaa9a));if(_0x3eaa9a[_0xc0df('0x10')]){if(_0x3eaa9a[_0xc0df('0x10')]['code']===0x1f4){logger[_0xc0df('0x10')](_0xc0df('0xd'),_0x418978,_0x3eaa9a[_0xc0df('0x10')][_0xc0df('0x11')]);return _0x162b81(_0x3eaa9a[_0xc0df('0x10')][_0xc0df('0x11')]);}logger['error'](_0xc0df('0xd'),_0x418978,_0x3eaa9a[_0xc0df('0x10')]['message']);return _0x26c27a(_0x3eaa9a[_0xc0df('0x10')][_0xc0df('0x11')]);}else{logger[_0xc0df('0xc')](_0xc0df('0xd'),_0x418978,_0xc0df('0xe'));_0x26c27a(_0x3eaa9a['result'][_0xc0df('0x11')]);}})[_0xc0df('0x12')](function(_0x4807aa){logger['error'](_0xc0df('0xd'),_0x418978,_0x4807aa);_0x162b81(_0x4807aa);});});}exports[_0xc0df('0x13')]=function(_0x1bd455){var _0x48ca49=this;return new Promise(function(_0x3aa36d,_0x8ca4fb){return db['FaxMessage'][_0xc0df('0x14')](_0x1bd455[_0xc0df('0x15')],{'raw':_0x1bd455[_0xc0df('0x16')]?_0x1bd455[_0xc0df('0x16')][_0xc0df('0x17')]===undefined?!![]:![]:!![]})[_0xc0df('0xb')](function(_0x524eb3){logger[_0xc0df('0xc')](_0xc0df('0x13'),_0x1bd455);logger[_0xc0df('0x18')](_0xc0df('0x13'),_0x1bd455,JSON['stringify'](_0x524eb3));_0x3aa36d(_0x524eb3);})[_0xc0df('0x12')](function(_0x8f678a){logger['error'](_0xc0df('0x13'),_0x8f678a[_0xc0df('0x11')],_0x1bd455);_0x8ca4fb(_0x48ca49[_0xc0df('0x10')](0x1f4,_0x8f678a['message']));});});};exports[_0xc0df('0x19')]=function(_0x3aa957){var _0x2137cc=this;return new Promise(function(_0x54a2e0,_0x44ecf){return db['FaxMessage'][_0xc0df('0x1a')](_0x3aa957[_0xc0df('0x15')],{'raw':_0x3aa957[_0xc0df('0x16')]?_0x3aa957[_0xc0df('0x16')][_0xc0df('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3aa957['options']?_0x3aa957['options']['where']||null:null,'attributes':_0x3aa957[_0xc0df('0x16')]?_0x3aa957[_0xc0df('0x16')][_0xc0df('0x1b')]||null:null,'limit':_0x3aa957[_0xc0df('0x16')]?_0x3aa957[_0xc0df('0x16')]['limit']||null:null})[_0xc0df('0xb')](function(_0x14b7f1){logger[_0xc0df('0xc')](_0xc0df('0x19'),_0x3aa957);logger[_0xc0df('0x18')](_0xc0df('0x19'),_0x3aa957,JSON[_0xc0df('0x1c')](_0x14b7f1));_0x54a2e0(_0x14b7f1);})[_0xc0df('0x12')](function(_0x3b1538){logger[_0xc0df('0x10')]('UpdateFaxMessage',_0x3b1538['message'],_0x3aa957);_0x44ecf(_0x2137cc['error'](0x1f4,_0x3b1538[_0xc0df('0x11')]));});});};
\ No newline at end of file
index 209b729..d9d794d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafa5=['remove','update','emit','removeListener','register','length','faxMessage:','save'];(function(_0x2d80d8,_0x37521c){var _0x225e72=function(_0x2c43f4){while(--_0x2c43f4){_0x2d80d8['push'](_0x2d80d8['shift']());}};_0x225e72(++_0x37521c);}(_0xafa5,0x1af));var _0x5afa=function(_0x26c1a2,_0x2674f6){_0x26c1a2=_0x26c1a2-0x0;var _0x4e0904=_0xafa5[_0x26c1a2];return _0x4e0904;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x5afa('0x0'),_0x5afa('0x1'),_0x5afa('0x2')];function createListener(_0x2deb15,_0x15fc66){return function(_0x5e59cf){_0x15fc66[_0x5afa('0x3')](_0x2deb15,_0x5e59cf);};}function removeListener(_0x21b649,_0xac7ca5){return function(){FaxMessageEvents[_0x5afa('0x4')](_0x21b649,_0xac7ca5);};}exports[_0x5afa('0x5')]=function(_0x58998c){for(var _0x166388=0x0,_0x43488f=events[_0x5afa('0x6')];_0x166388<_0x43488f;_0x166388++){var _0x132e07=events[_0x166388];var _0xa85da8=createListener(_0x5afa('0x7')+_0x132e07,_0x58998c);FaxMessageEvents['on'](_0x132e07,_0xa85da8);}};
\ No newline at end of file
+var _0xcf75=['update','emit','removeListener','register','faxMessage:','save','remove'];(function(_0x399338,_0x11496b){var _0x3c4485=function(_0x17e385){while(--_0x17e385){_0x399338['push'](_0x399338['shift']());}};_0x3c4485(++_0x11496b);}(_0xcf75,0x83));var _0x5cf7=function(_0x3d301d,_0x49a46f){_0x3d301d=_0x3d301d-0x0;var _0x3d57c5=_0xcf75[_0x3d301d];return _0x3d57c5;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x5cf7('0x0'),_0x5cf7('0x1'),_0x5cf7('0x2')];function createListener(_0x50a52c,_0x49518b){return function(_0x38652e){_0x49518b[_0x5cf7('0x3')](_0x50a52c,_0x38652e);};}function removeListener(_0x5ef72f,_0x4e4b1e){return function(){FaxMessageEvents[_0x5cf7('0x4')](_0x5ef72f,_0x4e4b1e);};}exports[_0x5cf7('0x5')]=function(_0x4d6d52){for(var _0x3eb82a=0x0,_0xa33b7a=events['length'];_0x3eb82a<_0xa33b7a;_0x3eb82a++){var _0x1df33e=events[_0x3eb82a];var _0x38d9fd=createListener(_0x5cf7('0x6')+_0x1df33e,_0x4d6d52);FaxMessageEvents['on'](_0x1df33e,_0x38d9fd);}};
\ No newline at end of file
index f1645b4..f78969d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99eb=['tracked','faxmessage:create','create','put','update','/:id/accept','reject','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','post'];(function(_0x4201de,_0x43ac07){var _0x3fef97=function(_0x92694c){while(--_0x92694c){_0x4201de['push'](_0x4201de['shift']());}};_0x3fef97(++_0x43ac07);}(_0x99eb,0xda));var _0xb99e=function(_0x415e98,_0xeee476){_0x415e98=_0x415e98-0x0;var _0x1b405a=_0x99eb[_0x415e98];return _0x1b405a;};'use strict';var multer=require(_0xb99e('0x0'));var util=require(_0xb99e('0x1'));var path=require(_0xb99e('0x2'));var express=require(_0xb99e('0x3'));var router=express[_0xb99e('0x4')]();var auth=require(_0xb99e('0x5'));var interaction=require(_0xb99e('0x6'));var config=require(_0xb99e('0x7'));var controller=require(_0xb99e('0x8'));router[_0xb99e('0x9')]('/',auth[_0xb99e('0xa')](),controller[_0xb99e('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xb99e('0x9')](_0xb99e('0xc'),auth[_0xb99e('0xa')](),controller[_0xb99e('0xd')]);router['get'](_0xb99e('0xe'),auth[_0xb99e('0xa')](),controller['download']);router[_0xb99e('0xf')]('/',auth['isAuthenticated'](),interaction[_0xb99e('0x10')]('fax',_0xb99e('0x11')),controller[_0xb99e('0x12')]);router[_0xb99e('0x13')](_0xb99e('0xc'),auth[_0xb99e('0xa')](),controller[_0xb99e('0x14')]);router[_0xb99e('0x13')](_0xb99e('0x15'),auth['isAuthenticated'](),controller['accept']);router[_0xb99e('0x13')]('/:id/reject',auth['isAuthenticated'](),controller[_0xb99e('0x16')]);router[_0xb99e('0x17')](_0xb99e('0xc'),auth['isAuthenticated'](),controller[_0xb99e('0x18')]);module[_0xb99e('0x19')]=router;
\ No newline at end of file
+var _0xb0c5=['show','/:id/download','isAuthenticated','download','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','index','get','/describe','describe','/:id'];(function(_0x568f26,_0x40afd9){var _0x57f5b4=function(_0x1fd124){while(--_0x1fd124){_0x568f26['push'](_0x568f26['shift']());}};_0x57f5b4(++_0x40afd9);}(_0xb0c5,0x100));var _0x5b0c=function(_0x3b7e8f,_0x360bb5){_0x3b7e8f=_0x3b7e8f-0x0;var _0x330783=_0xb0c5[_0x3b7e8f];return _0x330783;};'use strict';var multer=require(_0x5b0c('0x0'));var util=require(_0x5b0c('0x1'));var path=require(_0x5b0c('0x2'));var express=require(_0x5b0c('0x3'));var router=express[_0x5b0c('0x4')]();var auth=require(_0x5b0c('0x5'));var interaction=require(_0x5b0c('0x6'));var config=require(_0x5b0c('0x7'));var controller=require(_0x5b0c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x5b0c('0x9')]);router[_0x5b0c('0xa')](_0x5b0c('0xb'),auth['isAuthenticated'](),controller[_0x5b0c('0xc')]);router[_0x5b0c('0xa')](_0x5b0c('0xd'),auth['isAuthenticated'](),controller[_0x5b0c('0xe')]);router['get'](_0x5b0c('0xf'),auth[_0x5b0c('0x10')](),controller[_0x5b0c('0x11')]);router['post']('/',auth[_0x5b0c('0x10')](),interaction[_0x5b0c('0x12')](_0x5b0c('0x13'),_0x5b0c('0x14')),controller[_0x5b0c('0x15')]);router[_0x5b0c('0x16')](_0x5b0c('0xd'),auth[_0x5b0c('0x10')](),controller[_0x5b0c('0x17')]);router[_0x5b0c('0x16')](_0x5b0c('0x18'),auth[_0x5b0c('0x10')](),controller[_0x5b0c('0x19')]);router[_0x5b0c('0x16')](_0x5b0c('0x1a'),auth[_0x5b0c('0x10')](),controller[_0x5b0c('0x1b')]);router[_0x5b0c('0x1c')](_0x5b0c('0xd'),auth['isAuthenticated'](),controller[_0x5b0c('0x1d')]);module['exports']=router;
\ No newline at end of file
index f294b55..35e8d93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5ae=['sequelize','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf5ae,0x118));var _0xef5a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf5ae[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0xef5a('0x0'));module['exports']={'name':{'type':Sequelize[_0xef5a('0x1')],'unique':_0xef5a('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xef5a('0x1')]},'timeout':{'type':Sequelize[_0xef5a('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xef5a('0x4')](_0xef5a('0x5'),_0xef5a('0x6'),_0xef5a('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xef5a('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3256=['rrmemory','roundrobin','INTEGER','sequelize','exports','name','STRING'];(function(_0x9431bf,_0x1954c3){var _0x1f629a=function(_0x3c5799){while(--_0x3c5799){_0x9431bf['push'](_0x9431bf['shift']());}};_0x1f629a(++_0x1954c3);}(_0x3256,0x137));var _0x6325=function(_0x578a14,_0x55cd6c){_0x578a14=_0x578a14-0x0;var _0x5f195c=_0x3256[_0x578a14];return _0x5f195c;};'use strict';var Sequelize=require(_0x6325('0x0'));module[_0x6325('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6325('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6325('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x6325('0x4'),'beepall',_0x6325('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x6325('0x6')],'defaultValue':0x0}};
\ No newline at end of file
index fbfd67f..1e7e012 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1c7=['addTeams','Agents','union','addAgents','ids','removeAgents','removeTeams','omit','spread','emit','userFaxQueue:save','userFaxQueue:remove','getAgents','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','socket.io-emitter','localhost','sendStatus','status','end','count','limit','set','json','apply','reject','save','update','then','error','stack','name','index','FaxQueue','model','dateStart','query','dateEnd','keys','filters','intersection','attributes','fields','nolimit','offset','order','sort','where','day','add','merge','filter','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','describe','findOne','get','hasOwnProperty','pick','FaxQueueId','UserFaxQueue','User','findAndCountAll','agent','faxPause','updatedAt','format','%s/%s','SIP','getTeams','Team'];(function(_0x5b2fcf,_0x4b5a5d){var _0x4257af=function(_0x44b348){while(--_0x44b348){_0x5b2fcf['push'](_0x5b2fcf['shift']());}};_0x4257af(++_0x4b5a5d);}(_0xe1c7,0x71));var _0x7e1c=function(_0x2211ed,_0x1bca0b){_0x2211ed=_0x2211ed-0x0;var _0x4d78cc=_0xe1c7[_0x2211ed];return _0x4d78cc;};'use strict';var pdf=require(_0x7e1c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7e1c('0x1'));var zipdir=require(_0x7e1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e1c('0x3'));var moment=require(_0x7e1c('0x4'));var BPromise=require(_0x7e1c('0x5'));var Mustache=require(_0x7e1c('0x6'));var util=require(_0x7e1c('0x7'));var path=require('path');var sox=require(_0x7e1c('0x8'));var csv=require(_0x7e1c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7e1c('0xa'));var squel=require(_0x7e1c('0xb'));var crypto=require(_0x7e1c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7e1c('0xd'));var toCsv=require(_0x7e1c('0x9'));var querystring=require(_0x7e1c('0xe'));var Papa=require(_0x7e1c('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x7e1c('0x10'))(_0x7e1c('0x11'));var utils=require(_0x7e1c('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var socket=require(_0x7e1c('0x13'))({'host':_0x7e1c('0x14'),'port':0x18eb});require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x2babb4,_0x33ecba){_0x33ecba=_0x33ecba||0xcc;return function(_0x5c9310){if(_0x5c9310){return _0x2babb4[_0x7e1c('0x15')](_0x33ecba);}return _0x2babb4[_0x7e1c('0x16')](_0x33ecba)[_0x7e1c('0x17')]();};}function respondWithResult(_0x181783,_0x46f76b){_0x46f76b=_0x46f76b||0xc8;return function(_0x471e86){if(_0x471e86){return _0x181783[_0x7e1c('0x16')](_0x46f76b)['json'](_0x471e86);}};}function respondWithFilteredResult(_0x53582f,_0xe9c69e){return function(_0x104012){if(_0x104012){var _0x1dee54=_0x104012[_0x7e1c('0x18')],_0x1d5240=_0xe9c69e['offset'],_0x62576a=_0xe9c69e['offset']+_0xe9c69e[_0x7e1c('0x19')],_0x3ad04f;if(_0x62576a>=_0x1dee54){_0x62576a=_0x1dee54;_0x3ad04f=0xc8;}else{_0x3ad04f=0xce;}_0x53582f['status'](_0x3ad04f);return _0x53582f[_0x7e1c('0x1a')]('Content-Range',_0x1d5240+'-'+_0x62576a+'/'+_0x1dee54)[_0x7e1c('0x1b')](_0x104012);}return null;};}function patchUpdates(_0x2edf52){return function(_0x5d99e0){try{jsonpatch[_0x7e1c('0x1c')](_0x5d99e0,_0x2edf52,!![]);}catch(_0x30dbf5){return BPromise[_0x7e1c('0x1d')](_0x30dbf5);}return _0x5d99e0[_0x7e1c('0x1e')]();};}function saveUpdates(_0x34c4de,_0x884005){return function(_0x49160f){if(_0x49160f){return _0x49160f[_0x7e1c('0x1f')](_0x34c4de)[_0x7e1c('0x20')](function(_0xf46ff7){return _0xf46ff7;});}return null;};}function removeEntity(_0x4351c2,_0x2be29d){return function(_0xc073c1){if(_0xc073c1){return _0xc073c1['destroy']()['then'](function(){_0x4351c2[_0x7e1c('0x16')](0xcc)[_0x7e1c('0x17')]();});}};}function handleEntityNotFound(_0x458fd9,_0x45aff7){return function(_0x142249){if(!_0x142249){_0x458fd9[_0x7e1c('0x15')](0x194);}return _0x142249;};}function handleError(_0x1c4276,_0x1fc469){_0x1fc469=_0x1fc469||0x1f4;return function(_0x5ec07d){logger[_0x7e1c('0x21')](_0x5ec07d[_0x7e1c('0x22')]);if(_0x5ec07d[_0x7e1c('0x23')]){delete _0x5ec07d[_0x7e1c('0x23')];}_0x1c4276[_0x7e1c('0x16')](_0x1fc469)['send'](_0x5ec07d);};}exports[_0x7e1c('0x24')]=function(_0x1c1835,_0x4ccbe7){var _0xe68b64={},_0xc16110={},_0x4d41b8={'count':0x0,'rows':[]};var _0x471287=db[_0x7e1c('0x25')]['rawAttributes'];_0xc16110[_0x7e1c('0x26')]=_['keys'](_0x471287);var _0x33cb39={'dateStart':_0x1c1835['query'][_0x7e1c('0x27')],'dateEnd':_0x1c1835['query']['dateEnd']};delete _0x1c1835[_0x7e1c('0x28')]['dateStart'];delete _0x1c1835['query'][_0x7e1c('0x29')];_0xc16110[_0x7e1c('0x28')]=_[_0x7e1c('0x2a')](_0x1c1835['query']);_0xc16110[_0x7e1c('0x2b')]=_[_0x7e1c('0x2c')](_0xc16110[_0x7e1c('0x26')],_0xc16110['query']);_0xe68b64[_0x7e1c('0x2d')]=_[_0x7e1c('0x2c')](_0xc16110[_0x7e1c('0x26')],qs[_0x7e1c('0x2e')](_0x1c1835[_0x7e1c('0x28')][_0x7e1c('0x2e')]));_0xe68b64[_0x7e1c('0x2d')]=_0xe68b64[_0x7e1c('0x2d')]['length']?_0xe68b64[_0x7e1c('0x2d')]:_0xc16110[_0x7e1c('0x26')];if(!_0x1c1835[_0x7e1c('0x28')]['hasOwnProperty'](_0x7e1c('0x2f'))){_0xe68b64[_0x7e1c('0x19')]=qs['limit'](_0x1c1835[_0x7e1c('0x28')][_0x7e1c('0x19')]);_0xe68b64[_0x7e1c('0x30')]=qs[_0x7e1c('0x30')](_0x1c1835[_0x7e1c('0x28')][_0x7e1c('0x30')]);}_0xe68b64[_0x7e1c('0x31')]=qs[_0x7e1c('0x32')](_0x1c1835[_0x7e1c('0x28')]['sort']);_0xe68b64[_0x7e1c('0x33')]=qs[_0x7e1c('0x2b')](_['pick'](_0x1c1835[_0x7e1c('0x28')],_0xc16110[_0x7e1c('0x2b')]));if(_0x33cb39[_0x7e1c('0x27')]){if(_0x33cb39[_0x7e1c('0x29')]){_0x33cb39[_0x7e1c('0x29')]=moment(_0x33cb39['dateEnd'])['add'](0x1,_0x7e1c('0x34'));}else{_0x33cb39['dateEnd']=moment(_0x33cb39[_0x7e1c('0x27')])[_0x7e1c('0x35')](0x1,_0x7e1c('0x34'));}_[_0x7e1c('0x36')](_0xe68b64[_0x7e1c('0x33')],{'createdAt':{'$gte':_0x33cb39[_0x7e1c('0x27')],'$lte':_0x33cb39['dateEnd']}});}if(_0x1c1835[_0x7e1c('0x28')][_0x7e1c('0x37')]){_0xe68b64['where']=_[_0x7e1c('0x36')](_0xe68b64[_0x7e1c('0x33')],{'$or':_[_0x7e1c('0x38')](_0xe68b64[_0x7e1c('0x2d')],function(_0x556e96){var _0x4ae3c5={};_0x4ae3c5[_0x556e96]={'$like':'%'+_0x1c1835[_0x7e1c('0x28')][_0x7e1c('0x37')]+'%'};return _0x4ae3c5;})});}_0xe68b64=_[_0x7e1c('0x36')]({},_0xe68b64,_0x1c1835[_0x7e1c('0x39')]);var _0x280a80={'where':_0xe68b64[_0x7e1c('0x33')]};return db[_0x7e1c('0x25')][_0x7e1c('0x18')](_0x280a80)[_0x7e1c('0x20')](function(_0x50d769){_0x4d41b8[_0x7e1c('0x18')]=_0x50d769;if(_0x1c1835[_0x7e1c('0x28')][_0x7e1c('0x3a')]){_0xe68b64[_0x7e1c('0x3b')]=[{'all':!![]}];}return db['FaxQueue'][_0x7e1c('0x3c')](_0xe68b64);})[_0x7e1c('0x20')](function(_0x4daf10){_0x4d41b8[_0x7e1c('0x3d')]=_0x4daf10;return _0x4d41b8;})[_0x7e1c('0x20')](respondWithFilteredResult(_0x4ccbe7,_0xe68b64))[_0x7e1c('0x3e')](handleError(_0x4ccbe7,null));};exports[_0x7e1c('0x3f')]=function(_0x4d1314,_0x15bbc6){var _0x57d1fe={'raw':!![],'where':{'id':_0x4d1314[_0x7e1c('0x40')]['id']}},_0x412cd4={};_0x412cd4['model']=_[_0x7e1c('0x2a')](db[_0x7e1c('0x25')][_0x7e1c('0x41')]);_0x412cd4[_0x7e1c('0x28')]=_['keys'](_0x4d1314[_0x7e1c('0x28')]);_0x412cd4['filters']=_[_0x7e1c('0x2c')](_0x412cd4[_0x7e1c('0x26')],_0x412cd4[_0x7e1c('0x28')]);_0x57d1fe['attributes']=_[_0x7e1c('0x2c')](_0x412cd4[_0x7e1c('0x26')],qs[_0x7e1c('0x2e')](_0x4d1314[_0x7e1c('0x28')][_0x7e1c('0x2e')]));_0x57d1fe[_0x7e1c('0x2d')]=_0x57d1fe[_0x7e1c('0x2d')][_0x7e1c('0x42')]?_0x57d1fe[_0x7e1c('0x2d')]:_0x412cd4[_0x7e1c('0x26')];if(_0x4d1314[_0x7e1c('0x28')][_0x7e1c('0x3a')]){_0x57d1fe[_0x7e1c('0x3b')]=[{'all':!![]}];}_0x57d1fe=_['merge']({},_0x57d1fe,_0x4d1314[_0x7e1c('0x39')]);return db[_0x7e1c('0x25')][_0x7e1c('0x43')](_0x57d1fe)[_0x7e1c('0x20')](handleEntityNotFound(_0x15bbc6,null))[_0x7e1c('0x20')](respondWithResult(_0x15bbc6,null))[_0x7e1c('0x3e')](handleError(_0x15bbc6,null));};exports[_0x7e1c('0x44')]=function(_0x181e5c,_0x578d2b){return db[_0x7e1c('0x25')]['create'](_0x181e5c[_0x7e1c('0x45')],{})[_0x7e1c('0x20')](respondWithResult(_0x578d2b,0xc9))['catch'](handleError(_0x578d2b,null));};exports[_0x7e1c('0x1f')]=function(_0x374cb7,_0x10c1e4){if(_0x374cb7[_0x7e1c('0x45')]['id']){delete _0x374cb7['body']['id'];}return db[_0x7e1c('0x25')]['find']({'where':{'id':_0x374cb7[_0x7e1c('0x40')]['id']}})[_0x7e1c('0x20')](handleEntityNotFound(_0x10c1e4,null))[_0x7e1c('0x20')](saveUpdates(_0x374cb7[_0x7e1c('0x45')],null))['then'](respondWithResult(_0x10c1e4,null))[_0x7e1c('0x3e')](handleError(_0x10c1e4,null));};exports['destroy']=function(_0x3f8505,_0x115ba6){return db[_0x7e1c('0x25')]['find']({'where':{'id':_0x3f8505[_0x7e1c('0x40')]['id']}})[_0x7e1c('0x20')](handleEntityNotFound(_0x115ba6,null))['then'](removeEntity(_0x115ba6,null))['catch'](handleError(_0x115ba6,null));};exports[_0x7e1c('0x46')]=function(_0x2b3e7d,_0x44fad3){return db['FaxQueue'][_0x7e1c('0x46')]()['then'](respondWithResult(_0x44fad3,null))[_0x7e1c('0x3e')](handleError(_0x44fad3,null));};exports['getMembers']=function(_0x545cf0,_0x473dc2,_0x5232bf){var _0x46abb1={'raw':!![],'where':{}},_0x406743={},_0x560852;return db[_0x7e1c('0x25')][_0x7e1c('0x47')]({'where':{'id':_0x545cf0['params']['id']}})[_0x7e1c('0x20')](handleEntityNotFound(_0x473dc2,null))[_0x7e1c('0x20')](function(_0x5c2c3d){if(_0x5c2c3d){_0x560852=_0x5c2c3d[_0x7e1c('0x48')]({'plain':!![]});_0x406743[_0x7e1c('0x26')]=_[_0x7e1c('0x2a')](db['UserFaxQueue'][_0x7e1c('0x41')]);_0x406743['query']=_[_0x7e1c('0x2a')](_0x545cf0[_0x7e1c('0x28')]);_0x406743[_0x7e1c('0x2b')]=_[_0x7e1c('0x2c')](_0x406743['model'],_0x406743[_0x7e1c('0x28')]);_0x46abb1[_0x7e1c('0x2d')]=_['intersection'](_0x406743[_0x7e1c('0x26')],qs[_0x7e1c('0x2e')](_0x545cf0[_0x7e1c('0x28')][_0x7e1c('0x2e')]));_0x46abb1[_0x7e1c('0x2d')]=_0x46abb1[_0x7e1c('0x2d')][_0x7e1c('0x42')]?_0x46abb1['attributes']:_0x406743[_0x7e1c('0x26')];if(!_0x545cf0[_0x7e1c('0x28')][_0x7e1c('0x49')]('nolimit')){_0x46abb1[_0x7e1c('0x19')]=qs[_0x7e1c('0x19')](_0x545cf0[_0x7e1c('0x28')]['limit']);_0x46abb1[_0x7e1c('0x30')]=qs[_0x7e1c('0x30')](_0x545cf0['query'][_0x7e1c('0x30')]);}_0x46abb1['order']=qs[_0x7e1c('0x32')](_0x545cf0[_0x7e1c('0x28')][_0x7e1c('0x32')]);_0x46abb1[_0x7e1c('0x33')]=qs['filters'](_[_0x7e1c('0x4a')](_0x545cf0['query'],_0x406743['filters']));_0x46abb1['where'][_0x7e1c('0x4b')]=_0x5c2c3d['id'];if(_0x545cf0[_0x7e1c('0x28')][_0x7e1c('0x37')]){_0x46abb1[_0x7e1c('0x33')]=_['merge'](_0x46abb1[_0x7e1c('0x33')],{'$or':_[_0x7e1c('0x38')](_0x46abb1[_0x7e1c('0x2d')],function(_0xf1f5b0){var _0x16c432={};_0x16c432[_0xf1f5b0]={'$like':'%'+_0x545cf0[_0x7e1c('0x28')]['filter']+'%'};return _0x16c432;})});}_0x46abb1=_[_0x7e1c('0x36')]({},_0x46abb1,_0x545cf0[_0x7e1c('0x39')]);return db[_0x7e1c('0x4c')][_0x7e1c('0x3c')](_0x46abb1);}})['then'](function(_0x1d0e60){if(_0x1d0e60){return db[_0x7e1c('0x4d')][_0x7e1c('0x4e')]({'where':{'id':_[_0x7e1c('0x38')](_0x1d0e60,'UserId'),'role':_0x7e1c('0x4f')},'attributes':['id',_0x7e1c('0x23'),_0x7e1c('0x50'),_0x7e1c('0x51'),'createdAt']});}})[_0x7e1c('0x20')](function(_0x1c83aa){if(_0x1c83aa){return{'count':_0x1c83aa[_0x7e1c('0x18')],'rows':_[_0x7e1c('0x38')](_0x1c83aa['rows'],function(_0x3a15c7){return{'membername':_0x3a15c7['name'],'UserId':_0x3a15c7['id'],'queue_name':_0x560852[_0x7e1c('0x23')],'FaxQueueId':_0x560852['id'],'interface':util[_0x7e1c('0x52')](_0x7e1c('0x53'),_0x7e1c('0x54'),_0x3a15c7[_0x7e1c('0x23')]),'penalty':0x0,'paused':_0x3a15c7[_0x7e1c('0x50')],'createdAt':_0x3a15c7['createdAt'],'updatedAt':_0x3a15c7[_0x7e1c('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7e1c('0x20')](respondWithFilteredResult(_0x473dc2,_0x46abb1))[_0x7e1c('0x3e')](handleError(_0x473dc2,null));};exports[_0x7e1c('0x55')]=function(_0x574cd6,_0x29c272,_0x2d91ac){var _0x26a4b3={};var _0x2647cf={};var _0x25ffc0;var _0x40956f;return db[_0x7e1c('0x25')][_0x7e1c('0x47')]({'where':{'id':_0x574cd6[_0x7e1c('0x40')]['id']}})[_0x7e1c('0x20')](handleEntityNotFound(_0x29c272,null))[_0x7e1c('0x20')](function(_0x35b4a0){if(_0x35b4a0){_0x25ffc0=_0x35b4a0;_0x2647cf[_0x7e1c('0x26')]=_['keys'](db[_0x7e1c('0x56')][_0x7e1c('0x41')]);_0x2647cf[_0x7e1c('0x28')]=_['keys'](_0x574cd6[_0x7e1c('0x28')]);_0x2647cf[_0x7e1c('0x2b')]=_[_0x7e1c('0x2c')](_0x2647cf[_0x7e1c('0x26')],_0x2647cf[_0x7e1c('0x28')]);_0x26a4b3[_0x7e1c('0x2d')]=_[_0x7e1c('0x2c')](_0x2647cf[_0x7e1c('0x26')],qs[_0x7e1c('0x2e')](_0x574cd6[_0x7e1c('0x28')][_0x7e1c('0x2e')]));_0x26a4b3[_0x7e1c('0x2d')]=_0x26a4b3[_0x7e1c('0x2d')]['length']?_0x26a4b3[_0x7e1c('0x2d')]:_0x2647cf['model'];_0x26a4b3[_0x7e1c('0x31')]=qs[_0x7e1c('0x32')](_0x574cd6[_0x7e1c('0x28')][_0x7e1c('0x32')]);_0x26a4b3[_0x7e1c('0x33')]=qs[_0x7e1c('0x2b')](_['pick'](_0x574cd6['query'],_0x2647cf[_0x7e1c('0x2b')]));if(_0x574cd6[_0x7e1c('0x28')][_0x7e1c('0x37')]){_0x26a4b3[_0x7e1c('0x33')]=_[_0x7e1c('0x36')](_0x26a4b3[_0x7e1c('0x33')],{'$or':_[_0x7e1c('0x38')](_0x26a4b3[_0x7e1c('0x2d')],function(_0x56ec8b){var _0x1c2015={};_0x1c2015[_0x56ec8b]={'$like':'%'+_0x574cd6[_0x7e1c('0x28')][_0x7e1c('0x37')]+'%'};return _0x1c2015;})});}_0x26a4b3=_['merge']({},_0x26a4b3,_0x574cd6['options']);return _0x25ffc0['getTeams'](_0x26a4b3);}})['then'](function(_0x375afa){if(_0x375afa){_0x40956f=_0x375afa[_0x7e1c('0x42')];if(!_0x574cd6[_0x7e1c('0x28')][_0x7e1c('0x49')](_0x7e1c('0x2f'))){_0x26a4b3[_0x7e1c('0x19')]=qs[_0x7e1c('0x19')](_0x574cd6[_0x7e1c('0x28')]['limit']);_0x26a4b3[_0x7e1c('0x30')]=qs[_0x7e1c('0x30')](_0x574cd6[_0x7e1c('0x28')][_0x7e1c('0x30')]);}return _0x25ffc0['getTeams'](_0x26a4b3);}})['then'](function(_0x4c9c54){if(_0x4c9c54){return _0x4c9c54?{'count':_0x40956f,'rows':_0x4c9c54}:null;}})[_0x7e1c('0x20')](respondWithResult(_0x29c272,null))[_0x7e1c('0x3e')](handleError(_0x29c272,null));};exports[_0x7e1c('0x57')]=function(_0x42bd63,_0x3012d7,_0x45a548){var _0x33d939=[];var _0x372995;return db[_0x7e1c('0x56')][_0x7e1c('0x3c')]({'where':{'id':_0x42bd63[_0x7e1c('0x45')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7e1c('0x4d')],'as':_0x7e1c('0x58'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x136998){if(_0x136998){for(var _0x18e5d2=0x0;_0x18e5d2<_0x136998['length'];_0x18e5d2+=0x1){for(var _0x8cc882=0x0;_0x8cc882<_0x136998[_0x18e5d2][_0x7e1c('0x58')][_0x7e1c('0x42')];_0x8cc882+=0x1){_0x33d939=_[_0x7e1c('0x59')](_0x33d939,[_0x136998[_0x18e5d2][_0x7e1c('0x58')][_0x8cc882]['id']]);}}return _0x33d939;}})['then'](function(_0x3f202f){if(_0x3f202f){return db[_0x7e1c('0x25')]['find']({'where':{'id':_0x42bd63['params']['id']}});}})['then'](function(_0x99108c){if(_0x99108c){_0x372995=_0x99108c;return _0x372995[_0x7e1c('0x5a')](_0x33d939,{'penalty':_0x42bd63[_0x7e1c('0x45')]['penalty']});}})[_0x7e1c('0x20')](function(_0x11f5e2){if(_0x11f5e2){return _0x372995[_0x7e1c('0x57')](_0x42bd63['body'][_0x7e1c('0x5b')]);}})[_0x7e1c('0x20')](handleEntityNotFound(_0x3012d7,null))[_0x7e1c('0x20')](respondWithStatusCode(_0x3012d7,null))[_0x7e1c('0x3e')](handleError(_0x3012d7,null));};exports['removeTeams']=function(_0x27cfea,_0x3730b8,_0x3693d9){var _0x24f591=[];var _0x98deb6;return db['Team'][_0x7e1c('0x3c')]({'where':{'id':_0x27cfea['query'][_0x7e1c('0x5b')]},'attributes':['id'],'include':[{'model':db[_0x7e1c('0x4d')],'as':_0x7e1c('0x58'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x4f1bb6){if(_0x4f1bb6){for(var _0x1ea291=0x0;_0x1ea291<_0x4f1bb6[_0x7e1c('0x42')];_0x1ea291+=0x1){for(var _0x5266c9=0x0;_0x5266c9<_0x4f1bb6[_0x1ea291][_0x7e1c('0x58')]['length'];_0x5266c9+=0x1){_0x24f591=_[_0x7e1c('0x59')](_0x24f591,[_0x4f1bb6[_0x1ea291][_0x7e1c('0x58')][_0x5266c9]['id']]);}}return _0x24f591;}})['then'](function(_0x35ad3a){if(_0x35ad3a){return db['FaxQueue'][_0x7e1c('0x43')]({'where':{'id':_0x27cfea[_0x7e1c('0x40')]['id']}});}})[_0x7e1c('0x20')](function(_0x35581d){if(_0x35581d){_0x98deb6=_0x35581d;return _0x98deb6[_0x7e1c('0x5c')](_0x24f591);}})[_0x7e1c('0x20')](function(_0x16e5a3){if(_0x98deb6){return _0x98deb6[_0x7e1c('0x5d')](_0x27cfea['query'][_0x7e1c('0x5b')]);}})[_0x7e1c('0x20')](handleEntityNotFound(_0x3730b8,null))['then'](respondWithStatusCode(_0x3730b8,null))[_0x7e1c('0x3e')](handleError(_0x3730b8,null));};exports[_0x7e1c('0x5a')]=function(_0x5acb0a,_0x320afc,_0x1cf23f){return db[_0x7e1c('0x25')][_0x7e1c('0x43')]({'where':{'id':_0x5acb0a[_0x7e1c('0x40')]['id']}})[_0x7e1c('0x20')](handleEntityNotFound(_0x320afc,null))[_0x7e1c('0x20')](function(_0x14c3be){if(_0x14c3be){return _0x14c3be[_0x7e1c('0x5a')](_0x5acb0a[_0x7e1c('0x45')][_0x7e1c('0x5b')],_[_0x7e1c('0x5e')](_0x5acb0a[_0x7e1c('0x45')],[_0x7e1c('0x5b'),'id'])||{})[_0x7e1c('0x5f')](function(_0x4ee477){for(var _0x2c971a=0x0;_0x2c971a<_0x5acb0a[_0x7e1c('0x45')][_0x7e1c('0x5b')]['length'];_0x2c971a+=0x1){socket[_0x7e1c('0x60')](_0x7e1c('0x61'),{'UserId':_0x5acb0a[_0x7e1c('0x45')][_0x7e1c('0x5b')][_0x2c971a],'FaxQueueId':_0x5acb0a[_0x7e1c('0x40')]['id']});}return _0x4ee477;});}})['then'](respondWithResult(_0x320afc,null))['catch'](handleError(_0x320afc,null));};exports[_0x7e1c('0x5c')]=function(_0x5cda42,_0x1df0d7,_0xab95d7){var _0x201c42;return db['FaxQueue'][_0x7e1c('0x43')]({'where':{'id':_0x5cda42[_0x7e1c('0x40')]['id']}})['then'](handleEntityNotFound(_0x1df0d7,null))['then'](function(_0x388ace){if(_0x388ace){return _0x388ace['removeAgents'](_0x5cda42[_0x7e1c('0x28')][_0x7e1c('0x5b')])[_0x7e1c('0x20')](function(_0x22ba19){if(_['isArray'](_0x5cda42[_0x7e1c('0x28')][_0x7e1c('0x5b')])){for(var _0x581d17=0x0;_0x581d17<_0x5cda42[_0x7e1c('0x28')]['ids'][_0x7e1c('0x42')];_0x581d17+=0x1){socket[_0x7e1c('0x60')](_0x7e1c('0x62'),{'UserId':_0x5cda42[_0x7e1c('0x28')][_0x7e1c('0x5b')][_0x581d17],'FaxQueueId':_0x5cda42[_0x7e1c('0x40')]['id']});}}else{socket[_0x7e1c('0x60')](_0x7e1c('0x62'),{'UserId':_0x5cda42[_0x7e1c('0x28')][_0x7e1c('0x5b')],'FaxQueueId':_0x5cda42[_0x7e1c('0x40')]['id']});}});}})['then'](respondWithStatusCode(_0x1df0d7,null))['catch'](handleError(_0x1df0d7,null));};exports['getAgents']=function(_0xeee13b,_0x442ea0,_0x2a1946){var _0x19096e={};var _0x433e78={};var _0x369072;var _0x336e2d;return db[_0x7e1c('0x25')][_0x7e1c('0x47')]({'where':{'id':_0xeee13b[_0x7e1c('0x40')]['id']}})[_0x7e1c('0x20')](handleEntityNotFound(_0x442ea0,null))[_0x7e1c('0x20')](function(_0x1ec274){if(_0x1ec274){_0x369072=_0x1ec274;_0x433e78[_0x7e1c('0x26')]=_[_0x7e1c('0x2a')](db[_0x7e1c('0x4d')][_0x7e1c('0x41')]);_0x433e78[_0x7e1c('0x28')]=_[_0x7e1c('0x2a')](_0xeee13b[_0x7e1c('0x28')]);_0x433e78[_0x7e1c('0x2b')]=_['intersection'](_0x433e78['model'],_0x433e78['query']);_0x19096e[_0x7e1c('0x2d')]=_[_0x7e1c('0x2c')](_0x433e78[_0x7e1c('0x26')],qs['fields'](_0xeee13b['query'][_0x7e1c('0x2e')]));_0x19096e[_0x7e1c('0x2d')]=_0x19096e[_0x7e1c('0x2d')][_0x7e1c('0x42')]?_0x19096e[_0x7e1c('0x2d')]:_0x433e78[_0x7e1c('0x26')];_0x19096e['order']=qs[_0x7e1c('0x32')](_0xeee13b[_0x7e1c('0x28')]['sort']);_0x19096e[_0x7e1c('0x33')]=qs[_0x7e1c('0x2b')](_['pick'](_0xeee13b[_0x7e1c('0x28')],_0x433e78['filters']));if(_0xeee13b[_0x7e1c('0x28')][_0x7e1c('0x37')]){_0x19096e[_0x7e1c('0x33')]=_[_0x7e1c('0x36')](_0x19096e['where'],{'$or':_[_0x7e1c('0x38')](_0x19096e[_0x7e1c('0x2d')],function(_0x2a63e8){var _0x1291d3={};_0x1291d3[_0x2a63e8]={'$like':'%'+_0xeee13b[_0x7e1c('0x28')][_0x7e1c('0x37')]+'%'};return _0x1291d3;})});}_0x19096e=_['merge']({},_0x19096e,_0xeee13b[_0x7e1c('0x39')]);return _0x369072[_0x7e1c('0x63')](_0x19096e);}})['then'](function(_0x1833f7){if(_0x1833f7){_0x336e2d=_0x1833f7[_0x7e1c('0x42')];if(!_0xeee13b[_0x7e1c('0x28')]['hasOwnProperty']('nolimit')){_0x19096e[_0x7e1c('0x19')]=qs[_0x7e1c('0x19')](_0xeee13b[_0x7e1c('0x28')][_0x7e1c('0x19')]);_0x19096e['offset']=qs[_0x7e1c('0x30')](_0xeee13b['query']['offset']);}return _0x369072[_0x7e1c('0x63')](_0x19096e);}})['then'](function(_0xdf79ff){if(_0xdf79ff){return _0xdf79ff?{'count':_0x336e2d,'rows':_0xdf79ff}:null;}})['then'](respondWithResult(_0x442ea0,null))[_0x7e1c('0x3e')](handleError(_0x442ea0,null));};
\ No newline at end of file
+var _0x2175=['name','index','model','query','dateStart','dateEnd','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','add','day','merge','filter','options','FaxQueue','count','include','rows','show','params','rawAttributes','includeAll','find','catch','create','body','describe','getMembers','findOne','get','UserFaxQueue','map','findAll','User','findAndCountAll','UserId','agent','updatedAt','createdAt','%s/%s','SIP','faxPause','getTeams','Team','Agents','addAgents','penalty','removeTeams','ids','union','removeAgents','spread','emit','userFaxQueue:save','userFaxQueue:remove','getAgents','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','sendStatus','status','end','json','limit','set','Content-Range','reject','save','update','then','destroy','error','stack'];(function(_0x460296,_0x58011a){var _0x2251c8=function(_0x5a2e44){while(--_0x5a2e44){_0x460296['push'](_0x460296['shift']());}};_0x2251c8(++_0x58011a);}(_0x2175,0xa7));var _0x5217=function(_0x8b8f6b,_0x120d1e){_0x8b8f6b=_0x8b8f6b-0x0;var _0x2142f5=_0x2175[_0x8b8f6b];return _0x2142f5;};'use strict';var pdf=require(_0x5217('0x0'));var emlformat=require(_0x5217('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5217('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5217('0x3'));var BPromise=require(_0x5217('0x4'));var Mustache=require(_0x5217('0x5'));var util=require(_0x5217('0x6'));var path=require('path');var sox=require(_0x5217('0x7'));var csv=require(_0x5217('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5217('0x9'));var squel=require('squel');var crypto=require(_0x5217('0xa'));var jsforce=require(_0x5217('0xb'));var deskjs=require(_0x5217('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5217('0xd'));var Papa=require(_0x5217('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0x5217('0xf'))(_0x5217('0x10'));var utils=require(_0x5217('0x11'));var config=require(_0x5217('0x12'));var db=require(_0x5217('0x13'))['db'];var socket=require(_0x5217('0x14'))({'host':'localhost','port':0x18eb});require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x288d02,_0x1c8c59){_0x1c8c59=_0x1c8c59||0xcc;return function(_0x4e744d){if(_0x4e744d){return _0x288d02[_0x5217('0x15')](_0x1c8c59);}return _0x288d02[_0x5217('0x16')](_0x1c8c59)[_0x5217('0x17')]();};}function respondWithResult(_0xf6f4a2,_0x5242ac){_0x5242ac=_0x5242ac||0xc8;return function(_0xc71825){if(_0xc71825){return _0xf6f4a2[_0x5217('0x16')](_0x5242ac)[_0x5217('0x18')](_0xc71825);}};}function respondWithFilteredResult(_0x5bd613,_0x19d4ac){return function(_0x49c2da){if(_0x49c2da){var _0x58008a=_0x49c2da['count'],_0x31303d=_0x19d4ac['offset'],_0x2d81c0=_0x19d4ac['offset']+_0x19d4ac[_0x5217('0x19')],_0x593acc;if(_0x2d81c0>=_0x58008a){_0x2d81c0=_0x58008a;_0x593acc=0xc8;}else{_0x593acc=0xce;}_0x5bd613[_0x5217('0x16')](_0x593acc);return _0x5bd613[_0x5217('0x1a')](_0x5217('0x1b'),_0x31303d+'-'+_0x2d81c0+'/'+_0x58008a)[_0x5217('0x18')](_0x49c2da);}return null;};}function patchUpdates(_0x53ddcc){return function(_0x268cf2){try{jsonpatch['apply'](_0x268cf2,_0x53ddcc,!![]);}catch(_0x3d0631){return BPromise[_0x5217('0x1c')](_0x3d0631);}return _0x268cf2[_0x5217('0x1d')]();};}function saveUpdates(_0x481181,_0x836b5){return function(_0x181683){if(_0x181683){return _0x181683[_0x5217('0x1e')](_0x481181)[_0x5217('0x1f')](function(_0x222763){return _0x222763;});}return null;};}function removeEntity(_0x233507,_0x724a4e){return function(_0x21b850){if(_0x21b850){return _0x21b850[_0x5217('0x20')]()['then'](function(){_0x233507[_0x5217('0x16')](0xcc)[_0x5217('0x17')]();});}};}function handleEntityNotFound(_0xcc13e3,_0x21ac15){return function(_0x5ba1a2){if(!_0x5ba1a2){_0xcc13e3[_0x5217('0x15')](0x194);}return _0x5ba1a2;};}function handleError(_0x136852,_0x3b8fa5){_0x3b8fa5=_0x3b8fa5||0x1f4;return function(_0x4bcd2a){logger[_0x5217('0x21')](_0x4bcd2a[_0x5217('0x22')]);if(_0x4bcd2a[_0x5217('0x23')]){delete _0x4bcd2a[_0x5217('0x23')];}_0x136852[_0x5217('0x16')](_0x3b8fa5)['send'](_0x4bcd2a);};}exports[_0x5217('0x24')]=function(_0x15d114,_0x362ae8){var _0x5e513e={},_0x283ecd={},_0x1963fa={'count':0x0,'rows':[]};var _0x395756=db['FaxQueue']['rawAttributes'];_0x283ecd[_0x5217('0x25')]=_['keys'](_0x395756);var _0x216449={'dateStart':_0x15d114[_0x5217('0x26')][_0x5217('0x27')],'dateEnd':_0x15d114[_0x5217('0x26')][_0x5217('0x28')]};delete _0x15d114[_0x5217('0x26')][_0x5217('0x27')];delete _0x15d114[_0x5217('0x26')][_0x5217('0x28')];_0x283ecd[_0x5217('0x26')]=_[_0x5217('0x29')](_0x15d114[_0x5217('0x26')]);_0x283ecd['filters']=_[_0x5217('0x2a')](_0x283ecd['model'],_0x283ecd[_0x5217('0x26')]);_0x5e513e[_0x5217('0x2b')]=_[_0x5217('0x2a')](_0x283ecd[_0x5217('0x25')],qs[_0x5217('0x2c')](_0x15d114[_0x5217('0x26')][_0x5217('0x2c')]));_0x5e513e[_0x5217('0x2b')]=_0x5e513e[_0x5217('0x2b')][_0x5217('0x2d')]?_0x5e513e[_0x5217('0x2b')]:_0x283ecd[_0x5217('0x25')];if(!_0x15d114[_0x5217('0x26')][_0x5217('0x2e')](_0x5217('0x2f'))){_0x5e513e['limit']=qs[_0x5217('0x19')](_0x15d114[_0x5217('0x26')][_0x5217('0x19')]);_0x5e513e['offset']=qs[_0x5217('0x30')](_0x15d114[_0x5217('0x26')][_0x5217('0x30')]);}_0x5e513e[_0x5217('0x31')]=qs[_0x5217('0x32')](_0x15d114[_0x5217('0x26')][_0x5217('0x32')]);_0x5e513e[_0x5217('0x33')]=qs[_0x5217('0x34')](_[_0x5217('0x35')](_0x15d114['query'],_0x283ecd[_0x5217('0x34')]));if(_0x216449['dateStart']){if(_0x216449[_0x5217('0x28')]){_0x216449[_0x5217('0x28')]=moment(_0x216449['dateEnd'])[_0x5217('0x36')](0x1,_0x5217('0x37'));}else{_0x216449[_0x5217('0x28')]=moment(_0x216449[_0x5217('0x27')])['add'](0x1,'day');}_[_0x5217('0x38')](_0x5e513e[_0x5217('0x33')],{'createdAt':{'$gte':_0x216449['dateStart'],'$lte':_0x216449[_0x5217('0x28')]}});}if(_0x15d114[_0x5217('0x26')][_0x5217('0x39')]){_0x5e513e['where']=_[_0x5217('0x38')](_0x5e513e[_0x5217('0x33')],{'$or':_['map'](_0x5e513e[_0x5217('0x2b')],function(_0x5e3399){var _0xeefb30={};_0xeefb30[_0x5e3399]={'$like':'%'+_0x15d114[_0x5217('0x26')][_0x5217('0x39')]+'%'};return _0xeefb30;})});}_0x5e513e=_[_0x5217('0x38')]({},_0x5e513e,_0x15d114[_0x5217('0x3a')]);var _0x327f81={'where':_0x5e513e[_0x5217('0x33')]};return db[_0x5217('0x3b')]['count'](_0x327f81)[_0x5217('0x1f')](function(_0x30005a){_0x1963fa[_0x5217('0x3c')]=_0x30005a;if(_0x15d114[_0x5217('0x26')]['includeAll']){_0x5e513e[_0x5217('0x3d')]=[{'all':!![]}];}return db[_0x5217('0x3b')]['findAll'](_0x5e513e);})[_0x5217('0x1f')](function(_0x4cba54){_0x1963fa[_0x5217('0x3e')]=_0x4cba54;return _0x1963fa;})[_0x5217('0x1f')](respondWithFilteredResult(_0x362ae8,_0x5e513e))['catch'](handleError(_0x362ae8,null));};exports[_0x5217('0x3f')]=function(_0x2bb27b,_0x3c8c91){var _0x58099f={'raw':!![],'where':{'id':_0x2bb27b[_0x5217('0x40')]['id']}},_0xf45f96={};_0xf45f96[_0x5217('0x25')]=_[_0x5217('0x29')](db[_0x5217('0x3b')][_0x5217('0x41')]);_0xf45f96[_0x5217('0x26')]=_[_0x5217('0x29')](_0x2bb27b[_0x5217('0x26')]);_0xf45f96[_0x5217('0x34')]=_['intersection'](_0xf45f96[_0x5217('0x25')],_0xf45f96['query']);_0x58099f[_0x5217('0x2b')]=_['intersection'](_0xf45f96[_0x5217('0x25')],qs[_0x5217('0x2c')](_0x2bb27b[_0x5217('0x26')]['fields']));_0x58099f[_0x5217('0x2b')]=_0x58099f[_0x5217('0x2b')][_0x5217('0x2d')]?_0x58099f['attributes']:_0xf45f96[_0x5217('0x25')];if(_0x2bb27b[_0x5217('0x26')][_0x5217('0x42')]){_0x58099f[_0x5217('0x3d')]=[{'all':!![]}];}_0x58099f=_[_0x5217('0x38')]({},_0x58099f,_0x2bb27b[_0x5217('0x3a')]);return db['FaxQueue'][_0x5217('0x43')](_0x58099f)[_0x5217('0x1f')](handleEntityNotFound(_0x3c8c91,null))['then'](respondWithResult(_0x3c8c91,null))[_0x5217('0x44')](handleError(_0x3c8c91,null));};exports[_0x5217('0x45')]=function(_0x48b8a5,_0x1a424c){return db[_0x5217('0x3b')][_0x5217('0x45')](_0x48b8a5[_0x5217('0x46')],{})[_0x5217('0x1f')](respondWithResult(_0x1a424c,0xc9))['catch'](handleError(_0x1a424c,null));};exports[_0x5217('0x1e')]=function(_0x1fbb93,_0xc3479){if(_0x1fbb93['body']['id']){delete _0x1fbb93['body']['id'];}return db['FaxQueue'][_0x5217('0x43')]({'where':{'id':_0x1fbb93['params']['id']}})['then'](handleEntityNotFound(_0xc3479,null))[_0x5217('0x1f')](saveUpdates(_0x1fbb93[_0x5217('0x46')],null))[_0x5217('0x1f')](respondWithResult(_0xc3479,null))[_0x5217('0x44')](handleError(_0xc3479,null));};exports[_0x5217('0x20')]=function(_0x2dd3bc,_0x5bd0aa){return db['FaxQueue'][_0x5217('0x43')]({'where':{'id':_0x2dd3bc[_0x5217('0x40')]['id']}})[_0x5217('0x1f')](handleEntityNotFound(_0x5bd0aa,null))[_0x5217('0x1f')](removeEntity(_0x5bd0aa,null))['catch'](handleError(_0x5bd0aa,null));};exports['describe']=function(_0x140ae8,_0x176945){return db[_0x5217('0x3b')][_0x5217('0x47')]()[_0x5217('0x1f')](respondWithResult(_0x176945,null))[_0x5217('0x44')](handleError(_0x176945,null));};exports[_0x5217('0x48')]=function(_0x3ed325,_0x479787,_0x1a5ae6){var _0x2b8cd5={'raw':!![],'where':{}},_0x4dc99c={},_0x1f45dc;return db[_0x5217('0x3b')][_0x5217('0x49')]({'where':{'id':_0x3ed325[_0x5217('0x40')]['id']}})[_0x5217('0x1f')](handleEntityNotFound(_0x479787,null))[_0x5217('0x1f')](function(_0x5ddbd2){if(_0x5ddbd2){_0x1f45dc=_0x5ddbd2[_0x5217('0x4a')]({'plain':!![]});_0x4dc99c['model']=_[_0x5217('0x29')](db[_0x5217('0x4b')][_0x5217('0x41')]);_0x4dc99c['query']=_[_0x5217('0x29')](_0x3ed325['query']);_0x4dc99c[_0x5217('0x34')]=_[_0x5217('0x2a')](_0x4dc99c[_0x5217('0x25')],_0x4dc99c[_0x5217('0x26')]);_0x2b8cd5[_0x5217('0x2b')]=_['intersection'](_0x4dc99c[_0x5217('0x25')],qs[_0x5217('0x2c')](_0x3ed325[_0x5217('0x26')][_0x5217('0x2c')]));_0x2b8cd5['attributes']=_0x2b8cd5[_0x5217('0x2b')][_0x5217('0x2d')]?_0x2b8cd5['attributes']:_0x4dc99c[_0x5217('0x25')];if(!_0x3ed325['query']['hasOwnProperty'](_0x5217('0x2f'))){_0x2b8cd5[_0x5217('0x19')]=qs[_0x5217('0x19')](_0x3ed325[_0x5217('0x26')][_0x5217('0x19')]);_0x2b8cd5['offset']=qs[_0x5217('0x30')](_0x3ed325[_0x5217('0x26')][_0x5217('0x30')]);}_0x2b8cd5[_0x5217('0x31')]=qs[_0x5217('0x32')](_0x3ed325[_0x5217('0x26')]['sort']);_0x2b8cd5[_0x5217('0x33')]=qs[_0x5217('0x34')](_[_0x5217('0x35')](_0x3ed325[_0x5217('0x26')],_0x4dc99c[_0x5217('0x34')]));_0x2b8cd5[_0x5217('0x33')]['FaxQueueId']=_0x5ddbd2['id'];if(_0x3ed325[_0x5217('0x26')][_0x5217('0x39')]){_0x2b8cd5[_0x5217('0x33')]=_['merge'](_0x2b8cd5['where'],{'$or':_[_0x5217('0x4c')](_0x2b8cd5[_0x5217('0x2b')],function(_0x35f421){var _0x280e28={};_0x280e28[_0x35f421]={'$like':'%'+_0x3ed325[_0x5217('0x26')][_0x5217('0x39')]+'%'};return _0x280e28;})});}_0x2b8cd5=_[_0x5217('0x38')]({},_0x2b8cd5,_0x3ed325[_0x5217('0x3a')]);return db['UserFaxQueue'][_0x5217('0x4d')](_0x2b8cd5);}})[_0x5217('0x1f')](function(_0x33aa23){if(_0x33aa23){return db[_0x5217('0x4e')][_0x5217('0x4f')]({'where':{'id':_[_0x5217('0x4c')](_0x33aa23,_0x5217('0x50')),'role':_0x5217('0x51')},'attributes':['id',_0x5217('0x23'),'faxPause',_0x5217('0x52'),_0x5217('0x53')]});}})[_0x5217('0x1f')](function(_0x4b4327){if(_0x4b4327){return{'count':_0x4b4327[_0x5217('0x3c')],'rows':_[_0x5217('0x4c')](_0x4b4327[_0x5217('0x3e')],function(_0x417121){return{'membername':_0x417121[_0x5217('0x23')],'UserId':_0x417121['id'],'queue_name':_0x1f45dc[_0x5217('0x23')],'FaxQueueId':_0x1f45dc['id'],'interface':util['format'](_0x5217('0x54'),_0x5217('0x55'),_0x417121[_0x5217('0x23')]),'penalty':0x0,'paused':_0x417121[_0x5217('0x56')],'createdAt':_0x417121[_0x5217('0x53')],'updatedAt':_0x417121[_0x5217('0x52')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5217('0x1f')](respondWithFilteredResult(_0x479787,_0x2b8cd5))[_0x5217('0x44')](handleError(_0x479787,null));};exports[_0x5217('0x57')]=function(_0x284c51,_0x583a1d,_0x513339){var _0x1a5fcd={};var _0x202cad={};var _0x135bfd;var _0x23d127;return db[_0x5217('0x3b')][_0x5217('0x49')]({'where':{'id':_0x284c51['params']['id']}})['then'](handleEntityNotFound(_0x583a1d,null))[_0x5217('0x1f')](function(_0x2c6e26){if(_0x2c6e26){_0x135bfd=_0x2c6e26;_0x202cad['model']=_[_0x5217('0x29')](db[_0x5217('0x58')][_0x5217('0x41')]);_0x202cad[_0x5217('0x26')]=_['keys'](_0x284c51['query']);_0x202cad[_0x5217('0x34')]=_['intersection'](_0x202cad[_0x5217('0x25')],_0x202cad[_0x5217('0x26')]);_0x1a5fcd[_0x5217('0x2b')]=_[_0x5217('0x2a')](_0x202cad[_0x5217('0x25')],qs[_0x5217('0x2c')](_0x284c51[_0x5217('0x26')][_0x5217('0x2c')]));_0x1a5fcd[_0x5217('0x2b')]=_0x1a5fcd[_0x5217('0x2b')]['length']?_0x1a5fcd[_0x5217('0x2b')]:_0x202cad['model'];_0x1a5fcd[_0x5217('0x31')]=qs['sort'](_0x284c51['query'][_0x5217('0x32')]);_0x1a5fcd[_0x5217('0x33')]=qs[_0x5217('0x34')](_[_0x5217('0x35')](_0x284c51[_0x5217('0x26')],_0x202cad[_0x5217('0x34')]));if(_0x284c51[_0x5217('0x26')][_0x5217('0x39')]){_0x1a5fcd[_0x5217('0x33')]=_[_0x5217('0x38')](_0x1a5fcd['where'],{'$or':_['map'](_0x1a5fcd['attributes'],function(_0x1551a3){var _0xb24848={};_0xb24848[_0x1551a3]={'$like':'%'+_0x284c51[_0x5217('0x26')][_0x5217('0x39')]+'%'};return _0xb24848;})});}_0x1a5fcd=_[_0x5217('0x38')]({},_0x1a5fcd,_0x284c51[_0x5217('0x3a')]);return _0x135bfd[_0x5217('0x57')](_0x1a5fcd);}})[_0x5217('0x1f')](function(_0x54633a){if(_0x54633a){_0x23d127=_0x54633a[_0x5217('0x2d')];if(!_0x284c51[_0x5217('0x26')][_0x5217('0x2e')]('nolimit')){_0x1a5fcd[_0x5217('0x19')]=qs[_0x5217('0x19')](_0x284c51[_0x5217('0x26')][_0x5217('0x19')]);_0x1a5fcd[_0x5217('0x30')]=qs[_0x5217('0x30')](_0x284c51[_0x5217('0x26')]['offset']);}return _0x135bfd['getTeams'](_0x1a5fcd);}})[_0x5217('0x1f')](function(_0x53e109){if(_0x53e109){return _0x53e109?{'count':_0x23d127,'rows':_0x53e109}:null;}})[_0x5217('0x1f')](respondWithResult(_0x583a1d,null))['catch'](handleError(_0x583a1d,null));};exports['addTeams']=function(_0x31660a,_0x23ef31,_0x3158f6){var _0x3e5735=[];var _0x202b62;return db[_0x5217('0x58')][_0x5217('0x4d')]({'where':{'id':_0x31660a[_0x5217('0x46')]['ids']},'attributes':['id'],'include':[{'model':db[_0x5217('0x4e')],'as':_0x5217('0x59'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x50dfa2){if(_0x50dfa2){for(var _0x149057=0x0;_0x149057<_0x50dfa2['length'];_0x149057+=0x1){for(var _0x3530c6=0x0;_0x3530c6<_0x50dfa2[_0x149057][_0x5217('0x59')][_0x5217('0x2d')];_0x3530c6+=0x1){_0x3e5735=_['union'](_0x3e5735,[_0x50dfa2[_0x149057]['Agents'][_0x3530c6]['id']]);}}return _0x3e5735;}})[_0x5217('0x1f')](function(_0x37c400){if(_0x37c400){return db['FaxQueue'][_0x5217('0x43')]({'where':{'id':_0x31660a[_0x5217('0x40')]['id']}});}})['then'](function(_0xc4f106){if(_0xc4f106){_0x202b62=_0xc4f106;return _0x202b62[_0x5217('0x5a')](_0x3e5735,{'penalty':_0x31660a[_0x5217('0x46')][_0x5217('0x5b')]});}})[_0x5217('0x1f')](function(_0x1fc3b6){if(_0x1fc3b6){return _0x202b62['addTeams'](_0x31660a[_0x5217('0x46')]['ids']);}})[_0x5217('0x1f')](handleEntityNotFound(_0x23ef31,null))[_0x5217('0x1f')](respondWithStatusCode(_0x23ef31,null))[_0x5217('0x44')](handleError(_0x23ef31,null));};exports[_0x5217('0x5c')]=function(_0x21c511,_0x5a2855,_0x56b459){var _0x4adeab=[];var _0x3432de;return db[_0x5217('0x58')][_0x5217('0x4d')]({'where':{'id':_0x21c511[_0x5217('0x26')][_0x5217('0x5d')]},'attributes':['id'],'include':[{'model':db[_0x5217('0x4e')],'as':_0x5217('0x59'),'attributes':['id'],'raw':!![]}]})[_0x5217('0x1f')](function(_0x28604e){if(_0x28604e){for(var _0x519b5c=0x0;_0x519b5c<_0x28604e[_0x5217('0x2d')];_0x519b5c+=0x1){for(var _0x2627bc=0x0;_0x2627bc<_0x28604e[_0x519b5c][_0x5217('0x59')]['length'];_0x2627bc+=0x1){_0x4adeab=_[_0x5217('0x5e')](_0x4adeab,[_0x28604e[_0x519b5c]['Agents'][_0x2627bc]['id']]);}}return _0x4adeab;}})[_0x5217('0x1f')](function(_0x42666e){if(_0x42666e){return db[_0x5217('0x3b')]['find']({'where':{'id':_0x21c511[_0x5217('0x40')]['id']}});}})[_0x5217('0x1f')](function(_0x328c05){if(_0x328c05){_0x3432de=_0x328c05;return _0x3432de[_0x5217('0x5f')](_0x4adeab);}})['then'](function(_0x376c8e){if(_0x3432de){return _0x3432de[_0x5217('0x5c')](_0x21c511[_0x5217('0x26')]['ids']);}})[_0x5217('0x1f')](handleEntityNotFound(_0x5a2855,null))[_0x5217('0x1f')](respondWithStatusCode(_0x5a2855,null))[_0x5217('0x44')](handleError(_0x5a2855,null));};exports['addAgents']=function(_0x2039cf,_0x3ffcda,_0x59c45a){return db[_0x5217('0x3b')][_0x5217('0x43')]({'where':{'id':_0x2039cf[_0x5217('0x40')]['id']}})[_0x5217('0x1f')](handleEntityNotFound(_0x3ffcda,null))[_0x5217('0x1f')](function(_0x5f15d8){if(_0x5f15d8){return _0x5f15d8['addAgents'](_0x2039cf['body'][_0x5217('0x5d')],_['omit'](_0x2039cf['body'],[_0x5217('0x5d'),'id'])||{})[_0x5217('0x60')](function(_0xc390b3){for(var _0x29f010=0x0;_0x29f010<_0x2039cf[_0x5217('0x46')][_0x5217('0x5d')][_0x5217('0x2d')];_0x29f010+=0x1){socket[_0x5217('0x61')](_0x5217('0x62'),{'UserId':_0x2039cf['body']['ids'][_0x29f010],'FaxQueueId':_0x2039cf[_0x5217('0x40')]['id']});}return _0xc390b3;});}})[_0x5217('0x1f')](respondWithResult(_0x3ffcda,null))[_0x5217('0x44')](handleError(_0x3ffcda,null));};exports['removeAgents']=function(_0x22540a,_0x4e516c,_0x3ab2e1){var _0x288cac;return db[_0x5217('0x3b')][_0x5217('0x43')]({'where':{'id':_0x22540a[_0x5217('0x40')]['id']}})[_0x5217('0x1f')](handleEntityNotFound(_0x4e516c,null))[_0x5217('0x1f')](function(_0x5ac952){if(_0x5ac952){return _0x5ac952['removeAgents'](_0x22540a['query'][_0x5217('0x5d')])[_0x5217('0x1f')](function(_0x4af041){if(_['isArray'](_0x22540a[_0x5217('0x26')][_0x5217('0x5d')])){for(var _0x7d2fe3=0x0;_0x7d2fe3<_0x22540a[_0x5217('0x26')]['ids'][_0x5217('0x2d')];_0x7d2fe3+=0x1){socket[_0x5217('0x61')](_0x5217('0x63'),{'UserId':_0x22540a[_0x5217('0x26')][_0x5217('0x5d')][_0x7d2fe3],'FaxQueueId':_0x22540a[_0x5217('0x40')]['id']});}}else{socket[_0x5217('0x61')](_0x5217('0x63'),{'UserId':_0x22540a[_0x5217('0x26')][_0x5217('0x5d')],'FaxQueueId':_0x22540a[_0x5217('0x40')]['id']});}});}})[_0x5217('0x1f')](respondWithStatusCode(_0x4e516c,null))[_0x5217('0x44')](handleError(_0x4e516c,null));};exports[_0x5217('0x64')]=function(_0x3ab6be,_0xc49a41,_0x3c78b2){var _0x2c84db={};var _0x2b69b6={};var _0x297c2a;var _0x98223f;return db[_0x5217('0x3b')][_0x5217('0x49')]({'where':{'id':_0x3ab6be[_0x5217('0x40')]['id']}})[_0x5217('0x1f')](handleEntityNotFound(_0xc49a41,null))['then'](function(_0x5d81c6){if(_0x5d81c6){_0x297c2a=_0x5d81c6;_0x2b69b6['model']=_[_0x5217('0x29')](db['User'][_0x5217('0x41')]);_0x2b69b6[_0x5217('0x26')]=_[_0x5217('0x29')](_0x3ab6be[_0x5217('0x26')]);_0x2b69b6[_0x5217('0x34')]=_['intersection'](_0x2b69b6['model'],_0x2b69b6[_0x5217('0x26')]);_0x2c84db[_0x5217('0x2b')]=_['intersection'](_0x2b69b6[_0x5217('0x25')],qs[_0x5217('0x2c')](_0x3ab6be[_0x5217('0x26')]['fields']));_0x2c84db[_0x5217('0x2b')]=_0x2c84db[_0x5217('0x2b')][_0x5217('0x2d')]?_0x2c84db[_0x5217('0x2b')]:_0x2b69b6[_0x5217('0x25')];_0x2c84db[_0x5217('0x31')]=qs['sort'](_0x3ab6be[_0x5217('0x26')][_0x5217('0x32')]);_0x2c84db['where']=qs[_0x5217('0x34')](_[_0x5217('0x35')](_0x3ab6be[_0x5217('0x26')],_0x2b69b6[_0x5217('0x34')]));if(_0x3ab6be[_0x5217('0x26')][_0x5217('0x39')]){_0x2c84db['where']=_[_0x5217('0x38')](_0x2c84db[_0x5217('0x33')],{'$or':_['map'](_0x2c84db[_0x5217('0x2b')],function(_0x48559c){var _0x166147={};_0x166147[_0x48559c]={'$like':'%'+_0x3ab6be[_0x5217('0x26')][_0x5217('0x39')]+'%'};return _0x166147;})});}_0x2c84db=_[_0x5217('0x38')]({},_0x2c84db,_0x3ab6be[_0x5217('0x3a')]);return _0x297c2a[_0x5217('0x64')](_0x2c84db);}})[_0x5217('0x1f')](function(_0x5e5997){if(_0x5e5997){_0x98223f=_0x5e5997[_0x5217('0x2d')];if(!_0x3ab6be[_0x5217('0x26')][_0x5217('0x2e')](_0x5217('0x2f'))){_0x2c84db[_0x5217('0x19')]=qs['limit'](_0x3ab6be['query']['limit']);_0x2c84db[_0x5217('0x30')]=qs[_0x5217('0x30')](_0x3ab6be[_0x5217('0x26')][_0x5217('0x30')]);}return _0x297c2a[_0x5217('0x64')](_0x2c84db);}})[_0x5217('0x1f')](function(_0x4fa0f1){if(_0x4fa0f1){return _0x4fa0f1?{'count':_0x98223f,'rows':_0x4fa0f1}:null;}})[_0x5217('0x1f')](respondWithResult(_0xc49a41,null))[_0x5217('0x44')](handleError(_0xc49a41,null));};
\ No newline at end of file
index 60207b2..b8b25df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bc3=['emit','hook','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0x43e9b8,_0x464dfd){var _0x54c9a9=function(_0x39aeac){while(--_0x39aeac){_0x43e9b8['push'](_0x43e9b8['shift']());}};_0x54c9a9(++_0x464dfd);}(_0x4bc3,0x16e));var _0x34bc=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x4bc3[_0x32b542];return _0x554d54;};'use strict';var EventEmitter=require(_0x34bc('0x0'));var FaxQueue=require(_0x34bc('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x34bc('0x2')](0x0);var events={'afterCreate':_0x34bc('0x3'),'afterUpdate':'update','afterDestroy':_0x34bc('0x4')};function emitEvent(_0x616014){return function(_0x3ce1c3,_0x2e043e,_0x232f40){FaxQueueEvents[_0x34bc('0x5')](_0x616014+':'+_0x3ce1c3['id'],_0x3ce1c3);FaxQueueEvents[_0x34bc('0x5')](_0x616014,_0x3ce1c3);_0x232f40(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x34bc('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
+var _0x8d0e=['exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','hasOwnProperty','hook'];(function(_0x25c9ec,_0xb49be8){var _0xd27f5d=function(_0x3c811e){while(--_0x3c811e){_0x25c9ec['push'](_0x25c9ec['shift']());}};_0xd27f5d(++_0xb49be8);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x5132e7,_0x4f2e9d){_0x5132e7=_0x5132e7-0x0;var _0x2e731e=_0x8d0e[_0x5132e7];return _0x2e731e;};'use strict';var EventEmitter=require(_0xe8d0('0x0'));var FaxQueue=require(_0xe8d0('0x1'))['db'][_0xe8d0('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe8d0('0x3')](0x0);var events={'afterCreate':_0xe8d0('0x4'),'afterUpdate':_0xe8d0('0x5'),'afterDestroy':_0xe8d0('0x6')};function emitEvent(_0x940176){return function(_0x32cee9,_0x579cb9,_0x39caa6){FaxQueueEvents['emit'](_0x940176+':'+_0x32cee9['id'],_0x32cee9);FaxQueueEvents['emit'](_0x940176,_0x32cee9);_0x39caa6(null);};}for(var e in events){if(events[_0xe8d0('0x7')](e)){var event=events[e];FaxQueue[_0xe8d0('0x8')](e,emitEvent(event));}}module[_0xe8d0('0x9')]=FaxQueueEvents;
\ No newline at end of file
index c90571e..21e107e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c09=['api','moment','bluebird','./faxQueue.attributes','exports','define','FaxQueue','lodash','../../config/logger'];(function(_0x644560,_0x1783aa){var _0x41b76b=function(_0xff8c89){while(--_0xff8c89){_0x644560['push'](_0x644560['shift']());}};_0x41b76b(++_0x1783aa);}(_0x5c09,0x1c0));var _0x95c0=function(_0x50d4c2,_0x56c6b2){_0x50d4c2=_0x50d4c2-0x0;var _0x360834=_0x5c09[_0x50d4c2];return _0x360834;};'use strict';var _=require(_0x95c0('0x0'));var util=require('util');var logger=require(_0x95c0('0x1'))(_0x95c0('0x2'));var moment=require(_0x95c0('0x3'));var BPromise=require(_0x95c0('0x4'));var rp=require('request-promise');var attributes=require(_0x95c0('0x5'));module[_0x95c0('0x6')]=function(_0x249c2d,_0x500bc3){return _0x249c2d[_0x95c0('0x7')](_0x95c0('0x8'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x89ec=['FaxQueue','fax_queues','lodash','util','api','moment','bluebird','request-promise','./faxQueue.attributes','exports','define'];(function(_0xe28d5b,_0x531a9a){var _0xf15314=function(_0x5b4996){while(--_0x5b4996){_0xe28d5b['push'](_0xe28d5b['shift']());}};_0xf15314(++_0x531a9a);}(_0x89ec,0x91));var _0xc89e=function(_0x5cb98c,_0x1b7ca5){_0x5cb98c=_0x5cb98c-0x0;var _0x2dfc08=_0x89ec[_0x5cb98c];return _0x2dfc08;};'use strict';var _=require(_0xc89e('0x0'));var util=require(_0xc89e('0x1'));var logger=require('../../config/logger')(_0xc89e('0x2'));var moment=require(_0xc89e('0x3'));var BPromise=require(_0xc89e('0x4'));var rp=require(_0xc89e('0x5'));var attributes=require(_0xc89e('0x6'));module[_0xc89e('0x7')]=function(_0x25c48f,_0x2a0ea6){return _0x25c48f[_0xc89e('0x8')](_0xc89e('0x9'),attributes,{'tableName':_0xc89e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 265f211..499f387 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x183d=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter','localhost','register','request','then','info','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','limit','include','map','model','debug','find','ShowFaxQueue','lodash','util','moment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x183d,0xc5));var _0xd183=function(_0x28594b,_0xff8573){_0x28594b=_0x28594b-0x0;var _0x2976c6=_0x183d[_0x28594b];return _0x2976c6;};'use strict';var _=require(_0xd183('0x0'));var util=require(_0xd183('0x1'));var moment=require(_0xd183('0x2'));var BPromise=require('bluebird');var rs=require(_0xd183('0x3'));var fs=require('fs');var db=require(_0xd183('0x4'))['db'];var utils=require(_0xd183('0x5'));var logger=require(_0xd183('0x6'))(_0xd183('0x7'));var config=require(_0xd183('0x8'));var jayson=require(_0xd183('0x9'));var client=jayson[_0xd183('0xa')][_0xd183('0xb')]({'port':0x232a});var socket=require(_0xd183('0xc'))({'host':_0xd183('0xd'),'port':0x18eb});require('./faxQueue.socket')[_0xd183('0xe')](socket);function respondWithRpcPromise(_0x3c958b,_0x1b6723,_0x22ccc0){return new BPromise(function(_0x48591f,_0x4175d1){return client[_0xd183('0xf')](_0x3c958b,_0x22ccc0)[_0xd183('0x10')](function(_0x1a1706){logger[_0xd183('0x11')]('FaxQueue,\x20%s,\x20%s',_0x1b6723,_0xd183('0x12'));logger['debug'](_0xd183('0x13'),_0x1b6723,_0xd183('0x12'),JSON[_0xd183('0x14')](_0x1a1706));if(_0x1a1706[_0xd183('0x15')]){if(_0x1a1706[_0xd183('0x15')][_0xd183('0x16')]===0x1f4){logger['error'](_0xd183('0x17'),_0x1b6723,_0x1a1706[_0xd183('0x15')][_0xd183('0x18')]);return _0x4175d1(_0x1a1706[_0xd183('0x15')][_0xd183('0x18')]);}logger['error'](_0xd183('0x17'),_0x1b6723,_0x1a1706[_0xd183('0x15')][_0xd183('0x18')]);return _0x48591f(_0x1a1706[_0xd183('0x15')][_0xd183('0x18')]);}else{logger[_0xd183('0x11')](_0xd183('0x17'),_0x1b6723,_0xd183('0x12'));_0x48591f(_0x1a1706[_0xd183('0x19')][_0xd183('0x18')]);}})[_0xd183('0x1a')](function(_0x3b469d){logger['error']('FaxQueue,\x20%s,\x20%s',_0x1b6723,_0x3b469d);_0x4175d1(_0x3b469d);});});}exports[_0xd183('0x1b')]=function(_0x13affe){var _0x10f799=this;return new Promise(function(_0x1ec5b7,_0x3a6e36){return db[_0xd183('0x1c')][_0xd183('0x1d')]({'raw':_0x13affe[_0xd183('0x1e')]?_0x13affe[_0xd183('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x13affe[_0xd183('0x1e')]?_0x13affe[_0xd183('0x1e')][_0xd183('0x1f')]||null:null,'attributes':_0x13affe[_0xd183('0x1e')]?_0x13affe[_0xd183('0x1e')][_0xd183('0x20')]||null:null,'limit':_0x13affe[_0xd183('0x1e')]?_0x13affe[_0xd183('0x1e')][_0xd183('0x21')]||null:null,'include':_0x13affe[_0xd183('0x1e')]?_0x13affe[_0xd183('0x1e')][_0xd183('0x22')]?_[_0xd183('0x23')](_0x13affe[_0xd183('0x1e')][_0xd183('0x22')],function(_0x287d3e){return{'model':db[_0x287d3e['model']],'as':_0x287d3e['as'],'attributes':_0x287d3e[_0xd183('0x20')],'include':_0x287d3e[_0xd183('0x22')]?_['map'](_0x287d3e[_0xd183('0x22')],function(_0x8f8f0b){return{'model':db[_0x8f8f0b[_0xd183('0x24')]],'as':_0x8f8f0b['as'],'attributes':_0x8f8f0b[_0xd183('0x20')],'include':_0x8f8f0b[_0xd183('0x22')]?_[_0xd183('0x23')](_0x8f8f0b['include'],function(_0x2491d8){return{'model':db[_0x2491d8['model']],'as':_0x2491d8['as'],'attributes':_0x2491d8[_0xd183('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd183('0x10')](function(_0xbf1373){logger[_0xd183('0x11')](_0xd183('0x1b'),_0x13affe);logger[_0xd183('0x25')](_0xd183('0x1b'),_0x13affe,JSON[_0xd183('0x14')](_0xbf1373));_0x1ec5b7(_0xbf1373);})[_0xd183('0x1a')](function(_0x2d27cb){logger[_0xd183('0x15')](_0xd183('0x1b'),_0x2d27cb['message'],_0x13affe);_0x3a6e36(_0x10f799[_0xd183('0x15')](0x1f4,_0x2d27cb[_0xd183('0x18')]));});});};exports['ShowFaxQueue']=function(_0x488c47){var _0x3069f=this;return new Promise(function(_0x557875,_0xe826ed){return db[_0xd183('0x1c')][_0xd183('0x26')]({'raw':_0x488c47[_0xd183('0x1e')]?_0x488c47[_0xd183('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x488c47['options']?_0x488c47[_0xd183('0x1e')][_0xd183('0x1f')]||null:null,'attributes':_0x488c47[_0xd183('0x1e')]?_0x488c47[_0xd183('0x1e')]['attributes']||null:null,'include':_0x488c47[_0xd183('0x1e')]?_0x488c47[_0xd183('0x1e')]['include']?_['map'](_0x488c47[_0xd183('0x1e')][_0xd183('0x22')],function(_0xedbf11){return{'model':db[_0xedbf11[_0xd183('0x24')]],'as':_0xedbf11['as'],'attributes':_0xedbf11[_0xd183('0x20')],'include':_0xedbf11['include']?_['map'](_0xedbf11['include'],function(_0x2f0328){return{'model':db[_0x2f0328[_0xd183('0x24')]],'as':_0x2f0328['as'],'attributes':_0x2f0328[_0xd183('0x20')],'include':_0x2f0328[_0xd183('0x22')]?_[_0xd183('0x23')](_0x2f0328[_0xd183('0x22')],function(_0xf9d7b3){return{'model':db[_0xf9d7b3[_0xd183('0x24')]],'as':_0xf9d7b3['as'],'attributes':_0xf9d7b3[_0xd183('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd183('0x10')](function(_0x3698f6){logger[_0xd183('0x11')](_0xd183('0x27'),_0x488c47);logger[_0xd183('0x25')]('ShowFaxQueue',_0x488c47,JSON[_0xd183('0x14')](_0x3698f6));_0x557875(_0x3698f6);})[_0xd183('0x1a')](function(_0x32e1fe){logger['error']('ShowFaxQueue',_0x32e1fe[_0xd183('0x18')],_0x488c47);_0xe826ed(_0x3069f[_0xd183('0x15')](0x1f4,_0x32e1fe[_0xd183('0x18')]));});});};
\ No newline at end of file
+var _0xa251=['model','map','attributes','stringify','catch','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','socket.io-emitter','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','GetFaxQueue','FaxQueue','findAll','options','raw','where','include'];(function(_0x355b96,_0x4c2293){var _0x3b8c89=function(_0xcdcfc){while(--_0xcdcfc){_0x355b96['push'](_0x355b96['shift']());}};_0x3b8c89(++_0x4c2293);}(_0xa251,0x1da));var _0x1a25=function(_0x295a32,_0x541815){_0x295a32=_0x295a32-0x0;var _0x369a14=_0xa251[_0x295a32];return _0x369a14;};'use strict';var _=require(_0x1a25('0x0'));var util=require(_0x1a25('0x1'));var moment=require(_0x1a25('0x2'));var BPromise=require(_0x1a25('0x3'));var rs=require(_0x1a25('0x4'));var fs=require('fs');var db=require(_0x1a25('0x5'))['db'];var utils=require(_0x1a25('0x6'));var logger=require(_0x1a25('0x7'))(_0x1a25('0x8'));var config=require(_0x1a25('0x9'));var jayson=require(_0x1a25('0xa'));var client=jayson['client'][_0x1a25('0xb')]({'port':0x232a});var socket=require(_0x1a25('0xc'))({'host':'localhost','port':0x18eb});require('./faxQueue.socket')[_0x1a25('0xd')](socket);function respondWithRpcPromise(_0x3a61d1,_0x501bef,_0x554ad1){return new BPromise(function(_0x409cd5,_0x3b02df){return client[_0x1a25('0xe')](_0x3a61d1,_0x554ad1)[_0x1a25('0xf')](function(_0x3ef557){logger['info'](_0x1a25('0x10'),_0x501bef,_0x1a25('0x11'));logger[_0x1a25('0x12')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x501bef,_0x1a25('0x11'),JSON['stringify'](_0x3ef557));if(_0x3ef557[_0x1a25('0x13')]){if(_0x3ef557[_0x1a25('0x13')]['code']===0x1f4){logger[_0x1a25('0x13')](_0x1a25('0x10'),_0x501bef,_0x3ef557[_0x1a25('0x13')][_0x1a25('0x14')]);return _0x3b02df(_0x3ef557[_0x1a25('0x13')][_0x1a25('0x14')]);}logger[_0x1a25('0x13')]('FaxQueue,\x20%s,\x20%s',_0x501bef,_0x3ef557[_0x1a25('0x13')][_0x1a25('0x14')]);return _0x409cd5(_0x3ef557[_0x1a25('0x13')]['message']);}else{logger[_0x1a25('0x15')](_0x1a25('0x10'),_0x501bef,_0x1a25('0x11'));_0x409cd5(_0x3ef557[_0x1a25('0x16')][_0x1a25('0x14')]);}})['catch'](function(_0xa7bafa){logger['error'](_0x1a25('0x10'),_0x501bef,_0xa7bafa);_0x3b02df(_0xa7bafa);});});}exports[_0x1a25('0x17')]=function(_0x15c58f){var _0xd81753=this;return new Promise(function(_0x23e773,_0x43aa6d){return db[_0x1a25('0x18')][_0x1a25('0x19')]({'raw':_0x15c58f[_0x1a25('0x1a')]?_0x15c58f['options'][_0x1a25('0x1b')]===undefined?!![]:![]:!![],'where':_0x15c58f[_0x1a25('0x1a')]?_0x15c58f[_0x1a25('0x1a')][_0x1a25('0x1c')]||null:null,'attributes':_0x15c58f[_0x1a25('0x1a')]?_0x15c58f[_0x1a25('0x1a')]['attributes']||null:null,'limit':_0x15c58f['options']?_0x15c58f[_0x1a25('0x1a')]['limit']||null:null,'include':_0x15c58f['options']?_0x15c58f[_0x1a25('0x1a')][_0x1a25('0x1d')]?_['map'](_0x15c58f[_0x1a25('0x1a')][_0x1a25('0x1d')],function(_0x39e859){return{'model':db[_0x39e859[_0x1a25('0x1e')]],'as':_0x39e859['as'],'attributes':_0x39e859['attributes'],'include':_0x39e859['include']?_[_0x1a25('0x1f')](_0x39e859[_0x1a25('0x1d')],function(_0x1a91ae){return{'model':db[_0x1a91ae[_0x1a25('0x1e')]],'as':_0x1a91ae['as'],'attributes':_0x1a91ae['attributes'],'include':_0x1a91ae[_0x1a25('0x1d')]?_[_0x1a25('0x1f')](_0x1a91ae[_0x1a25('0x1d')],function(_0x174749){return{'model':db[_0x174749[_0x1a25('0x1e')]],'as':_0x174749['as'],'attributes':_0x174749[_0x1a25('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4122f6){logger[_0x1a25('0x15')](_0x1a25('0x17'),_0x15c58f);logger[_0x1a25('0x12')]('GetFaxQueue',_0x15c58f,JSON[_0x1a25('0x21')](_0x4122f6));_0x23e773(_0x4122f6);})[_0x1a25('0x22')](function(_0x5cd176){logger[_0x1a25('0x13')]('GetFaxQueue',_0x5cd176['message'],_0x15c58f);_0x43aa6d(_0xd81753[_0x1a25('0x13')](0x1f4,_0x5cd176[_0x1a25('0x14')]));});});};exports['ShowFaxQueue']=function(_0x292958){var _0xd65d6a=this;return new Promise(function(_0x31f8e8,_0x4615b1){return db[_0x1a25('0x18')]['find']({'raw':_0x292958['options']?_0x292958[_0x1a25('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x292958['options']?_0x292958[_0x1a25('0x1a')][_0x1a25('0x1c')]||null:null,'attributes':_0x292958[_0x1a25('0x1a')]?_0x292958['options'][_0x1a25('0x20')]||null:null,'include':_0x292958['options']?_0x292958['options'][_0x1a25('0x1d')]?_[_0x1a25('0x1f')](_0x292958[_0x1a25('0x1a')]['include'],function(_0x58f8b9){return{'model':db[_0x58f8b9[_0x1a25('0x1e')]],'as':_0x58f8b9['as'],'attributes':_0x58f8b9[_0x1a25('0x20')],'include':_0x58f8b9[_0x1a25('0x1d')]?_[_0x1a25('0x1f')](_0x58f8b9[_0x1a25('0x1d')],function(_0x200b10){return{'model':db[_0x200b10[_0x1a25('0x1e')]],'as':_0x200b10['as'],'attributes':_0x200b10[_0x1a25('0x20')],'include':_0x200b10['include']?_[_0x1a25('0x1f')](_0x200b10[_0x1a25('0x1d')],function(_0x3181eb){return{'model':db[_0x3181eb[_0x1a25('0x1e')]],'as':_0x3181eb['as'],'attributes':_0x3181eb[_0x1a25('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1a25('0xf')](function(_0x5af0fd){logger[_0x1a25('0x15')](_0x1a25('0x23'),_0x292958);logger[_0x1a25('0x12')]('ShowFaxQueue',_0x292958,JSON[_0x1a25('0x21')](_0x5af0fd));_0x31f8e8(_0x5af0fd);})['catch'](function(_0x4e9872){logger[_0x1a25('0x13')]('ShowFaxQueue',_0x4e9872['message'],_0x292958);_0x4615b1(_0xd65d6a[_0x1a25('0x13')](0x1f4,_0x4e9872[_0x1a25('0x14')]));});});};
\ No newline at end of file
index 07a59b9..5a4d108 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x380f=['update','emit','faxQueue:','save'];(function(_0x36a9fd,_0x3fe119){var _0x3abaf4=function(_0x42c824){while(--_0x42c824){_0x36a9fd['push'](_0x36a9fd['shift']());}};_0x3abaf4(++_0x3fe119);}(_0x380f,0x1c3));var _0xf380=function(_0x5a82ee,_0x799f80){_0x5a82ee=_0x5a82ee-0x0;var _0x44c376=_0x380f[_0x5a82ee];return _0x44c376;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xf380('0x0'),'remove',_0xf380('0x1')];function createListener(_0x5da59a,_0x368be8){return function(_0xb802a0){_0x368be8[_0xf380('0x2')](_0x5da59a,_0xb802a0);};}function removeListener(_0x2125ab,_0x3cd678){return function(){FaxQueueEvents['removeListener'](_0x2125ab,_0x3cd678);};}exports['register']=function(_0x5ef70c){for(var _0x43b86b=0x0,_0x223c77=events['length'];_0x43b86b<_0x223c77;_0x43b86b++){var _0x56ae1e=events[_0x43b86b];var _0x23c6b7=createListener(_0xf380('0x3')+_0x56ae1e,_0x5ef70c);FaxQueueEvents['on'](_0x56ae1e,_0x23c6b7);}};
\ No newline at end of file
+var _0xe78c=['update','emit','register','length','faxQueue:','./faxQueue.events'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xe78c,0x89));var _0xce78=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xe78c[_0x46e363];return _0x3fb059;};'use strict';var FaxQueueEvents=require(_0xce78('0x0'));var events=['save','remove',_0xce78('0x1')];function createListener(_0x354037,_0x8e4157){return function(_0x3d052c){_0x8e4157[_0xce78('0x2')](_0x354037,_0x3d052c);};}function removeListener(_0x29cdcc,_0x462ac1){return function(){FaxQueueEvents['removeListener'](_0x29cdcc,_0x462ac1);};}exports[_0xce78('0x3')]=function(_0x4502aa){for(var _0x351c08=0x0,_0x2fe26d=events[_0xce78('0x4')];_0x351c08<_0x2fe26d;_0x351c08++){var _0x25e22e=events[_0x351c08];var _0x1663bf=createListener(_0xce78('0x5')+_0x25e22e,_0x4502aa);FaxQueueEvents['on'](_0x25e22e,_0x1663bf);}};
\ No newline at end of file
index 83e4eae..12f7c57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd4f=['removeTeams','removeAgents','exports','multer','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','delete'];(function(_0x233feb,_0x3755ae){var _0x21fd3c=function(_0x17f4c5){while(--_0x17f4c5){_0x233feb['push'](_0x233feb['shift']());}};_0x21fd3c(++_0x3755ae);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x5e36b3,_0x485289){_0x5e36b3=_0x5e36b3-0x0;var _0x313637=_0xdd4f[_0x5e36b3];return _0x313637;};'use strict';var multer=require(_0xfdd4('0x0'));var util=require('util');var path=require('path');var express=require('express');var router=express[_0xfdd4('0x1')]();var auth=require(_0xfdd4('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xfdd4('0x3'));var controller=require(_0xfdd4('0x4'));router[_0xfdd4('0x5')]('/',auth['isAuthenticated'](),controller[_0xfdd4('0x6')]);router[_0xfdd4('0x5')](_0xfdd4('0x7'),auth[_0xfdd4('0x8')](),controller[_0xfdd4('0x9')]);router['get'](_0xfdd4('0xa'),auth['isAuthenticated'](),controller[_0xfdd4('0xb')]);router[_0xfdd4('0x5')](_0xfdd4('0xc'),auth['isAuthenticated'](),controller[_0xfdd4('0xd')]);router['get'](_0xfdd4('0xe'),auth[_0xfdd4('0x8')](),controller[_0xfdd4('0xf')]);router[_0xfdd4('0x5')](_0xfdd4('0x10'),auth[_0xfdd4('0x8')](),controller[_0xfdd4('0x11')]);router[_0xfdd4('0x12')]('/',auth[_0xfdd4('0x8')](),controller[_0xfdd4('0x13')]);router[_0xfdd4('0x12')]('/:id/teams',auth[_0xfdd4('0x8')](),controller[_0xfdd4('0x14')]);router[_0xfdd4('0x12')]('/:id/users',auth[_0xfdd4('0x8')](),controller['addAgents']);router[_0xfdd4('0x15')](_0xfdd4('0xa'),auth[_0xfdd4('0x8')](),controller[_0xfdd4('0x16')]);router[_0xfdd4('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xfdd4('0x17')](_0xfdd4('0xe'),auth[_0xfdd4('0x8')](),controller[_0xfdd4('0x18')]);router[_0xfdd4('0x17')](_0xfdd4('0x10'),auth[_0xfdd4('0x8')](),controller[_0xfdd4('0x19')]);module[_0xfdd4('0x1a')]=router;
\ No newline at end of file
+var _0x2015=['/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','update','delete','removeAgents','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x5e5dbf,_0x1e8c22){var _0xfd8d51=function(_0x8d8e28){while(--_0x8d8e28){_0x5e5dbf['push'](_0x5e5dbf['shift']());}};_0xfd8d51(++_0x1e8c22);}(_0x2015,0x193));var _0x5201=function(_0x4ceacf,_0x34c292){_0x4ceacf=_0x4ceacf-0x0;var _0x5285fb=_0x2015[_0x4ceacf];return _0x5285fb;};'use strict';var multer=require(_0x5201('0x0'));var util=require(_0x5201('0x1'));var path=require(_0x5201('0x2'));var express=require(_0x5201('0x3'));var router=express[_0x5201('0x4')]();var auth=require(_0x5201('0x5'));var interaction=require(_0x5201('0x6'));var config=require(_0x5201('0x7'));var controller=require('./faxQueue.controller');router[_0x5201('0x8')]('/',auth[_0x5201('0x9')](),controller[_0x5201('0xa')]);router[_0x5201('0x8')](_0x5201('0xb'),auth[_0x5201('0x9')](),controller[_0x5201('0xc')]);router[_0x5201('0x8')](_0x5201('0xd'),auth[_0x5201('0x9')](),controller['show']);router[_0x5201('0x8')](_0x5201('0xe'),auth['isAuthenticated'](),controller[_0x5201('0xf')]);router[_0x5201('0x8')](_0x5201('0x10'),auth['isAuthenticated'](),controller[_0x5201('0x11')]);router[_0x5201('0x8')](_0x5201('0x12'),auth[_0x5201('0x9')](),controller[_0x5201('0x13')]);router[_0x5201('0x14')]('/',auth[_0x5201('0x9')](),controller[_0x5201('0x15')]);router[_0x5201('0x14')](_0x5201('0x10'),auth[_0x5201('0x9')](),controller[_0x5201('0x16')]);router['post'](_0x5201('0x12'),auth[_0x5201('0x9')](),controller['addAgents']);router['put'](_0x5201('0xd'),auth[_0x5201('0x9')](),controller[_0x5201('0x17')]);router['delete']('/:id',auth[_0x5201('0x9')](),controller['destroy']);router[_0x5201('0x18')]('/:id/teams',auth[_0x5201('0x9')](),controller['removeTeams']);router[_0x5201('0x18')](_0x5201('0x12'),auth[_0x5201('0x9')](),controller[_0x5201('0x19')]);module['exports']=router;
\ No newline at end of file
index e0adf7e..29db826 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cef=['DATE','sequelize','exports','STRING'];(function(_0x3b35a7,_0x415c79){var _0xd60c66=function(_0x53f386){while(--_0x53f386){_0x3b35a7['push'](_0x3b35a7['shift']());}};_0xd60c66(++_0x415c79);}(_0x3cef,0xe1));var _0xf3ce=function(_0x258346,_0x447aeb){_0x258346=_0x258346-0x0;var _0x56fb0e=_0x3cef[_0x258346];return _0x56fb0e;};'use strict';var moment=require('moment');var Sequelize=require(_0xf3ce('0x0'));module[_0xf3ce('0x1')]={'uniqueid':{'type':Sequelize[_0xf3ce('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf3ce('0x2')]},'joinAt':{'type':Sequelize[_0xf3ce('0x3')]},'leaveAt':{'type':Sequelize[_0xf3ce('0x3')]},'acceptAt':{'type':Sequelize[_0xf3ce('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf3ce('0x2')]}};
\ No newline at end of file
+var _0xcd54=['sequelize','exports','STRING','DATE','moment'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0xcd54,0xf4));var _0x4cd5=function(_0x57a421,_0x2674b4){_0x57a421=_0x57a421-0x0;var _0x48e81d=_0xcd54[_0x57a421];return _0x48e81d;};'use strict';var moment=require(_0x4cd5('0x0'));var Sequelize=require(_0x4cd5('0x1'));module[_0x4cd5('0x2')]={'uniqueid':{'type':Sequelize[_0x4cd5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4cd5('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x4cd5('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x4cd5('0x3')]}};
\ No newline at end of file
index e741540..255e605 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x793a=['sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','FaxQueueReport','keys','query','dateStart','dateEnd','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','add','merge','filter','map','options','include','rows','show','params','rawAttributes','includeAll','find','catch','create','body','describe','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x23ca4d,_0x5c2a32){var _0x435432=function(_0xe1a5e5){while(--_0xe1a5e5){_0x23ca4d['push'](_0x23ca4d['shift']());}};_0x435432(++_0x5c2a32);}(_0x793a,0x86));var _0xa793=function(_0x29d14b,_0x2094ff){_0x29d14b=_0x29d14b-0x0;var _0x4f29de=_0x793a[_0x29d14b];return _0x4f29de;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa793('0x0'));var rp=require(_0xa793('0x1'));var moment=require(_0xa793('0x2'));var BPromise=require(_0xa793('0x3'));var Mustache=require(_0xa793('0x4'));var util=require(_0xa793('0x5'));var path=require('path');var sox=require(_0xa793('0x6'));var csv=require(_0xa793('0x7'));var ejs=require(_0xa793('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa793('0x9'));var crypto=require(_0xa793('0xa'));var jsforce=require(_0xa793('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa793('0x7'));var querystring=require(_0xa793('0xc'));var Papa=require(_0xa793('0xd'));var qs=require(_0xa793('0xe'));var logger=require('../../config/logger')(_0xa793('0xf'));var utils=require('../../config/utils');var config=require(_0xa793('0x10'));var db=require(_0xa793('0x11'))['db'];function respondWithStatusCode(_0x384de1,_0x579c21){_0x579c21=_0x579c21||0xcc;return function(_0x1c88cb){if(_0x1c88cb){return _0x384de1['sendStatus'](_0x579c21);}return _0x384de1['status'](_0x579c21)['end']();};}function respondWithResult(_0xa25466,_0x198712){_0x198712=_0x198712||0xc8;return function(_0x42546b){if(_0x42546b){return _0xa25466[_0xa793('0x12')](_0x198712)['json'](_0x42546b);}};}function respondWithFilteredResult(_0x30c2ae,_0x181ac5){return function(_0x3a4456){if(_0x3a4456){var _0x14e6dd=_0x3a4456[_0xa793('0x13')],_0x33a1b7=_0x181ac5[_0xa793('0x14')],_0x398ca4=_0x181ac5[_0xa793('0x14')]+_0x181ac5[_0xa793('0x15')],_0x5abfc4;if(_0x398ca4>=_0x14e6dd){_0x398ca4=_0x14e6dd;_0x5abfc4=0xc8;}else{_0x5abfc4=0xce;}_0x30c2ae[_0xa793('0x12')](_0x5abfc4);return _0x30c2ae[_0xa793('0x16')](_0xa793('0x17'),_0x33a1b7+'-'+_0x398ca4+'/'+_0x14e6dd)[_0xa793('0x18')](_0x3a4456);}return null;};}function patchUpdates(_0x5aefc7){return function(_0x196bac){try{jsonpatch[_0xa793('0x19')](_0x196bac,_0x5aefc7,!![]);}catch(_0x5ac034){return BPromise[_0xa793('0x1a')](_0x5ac034);}return _0x196bac[_0xa793('0x1b')]();};}function saveUpdates(_0x143d6a,_0x239e64){return function(_0x3ad353){if(_0x3ad353){return _0x3ad353[_0xa793('0x1c')](_0x143d6a)['then'](function(_0x3e9781){return _0x3e9781;});}return null;};}function removeEntity(_0x3f6757,_0x11d8f2){return function(_0x25425d){if(_0x25425d){return _0x25425d[_0xa793('0x1d')]()[_0xa793('0x1e')](function(){_0x3f6757['status'](0xcc)[_0xa793('0x1f')]();});}};}function handleEntityNotFound(_0x40a726,_0x2ff07f){return function(_0x33e0b9){if(!_0x33e0b9){_0x40a726[_0xa793('0x20')](0x194);}return _0x33e0b9;};}function handleError(_0x2be98f,_0x46e490){_0x46e490=_0x46e490||0x1f4;return function(_0x4d87af){logger[_0xa793('0x21')](_0x4d87af[_0xa793('0x22')]);if(_0x4d87af['name']){delete _0x4d87af[_0xa793('0x23')];}_0x2be98f[_0xa793('0x12')](_0x46e490)[_0xa793('0x24')](_0x4d87af);};}exports[_0xa793('0x25')]=function(_0x3d846b,_0x41bca7){var _0x43227b={},_0x55036e={},_0x104bc5={'count':0x0,'rows':[]};var _0x14ffe5=db[_0xa793('0x26')]['rawAttributes'];_0x55036e['model']=_[_0xa793('0x27')](_0x14ffe5);var _0x1c24a8={'dateStart':_0x3d846b[_0xa793('0x28')][_0xa793('0x29')],'dateEnd':_0x3d846b[_0xa793('0x28')][_0xa793('0x2a')]};delete _0x3d846b[_0xa793('0x28')][_0xa793('0x29')];delete _0x3d846b[_0xa793('0x28')][_0xa793('0x2a')];_0x55036e[_0xa793('0x28')]=_[_0xa793('0x27')](_0x3d846b[_0xa793('0x28')]);_0x55036e[_0xa793('0x2b')]=_[_0xa793('0x2c')](_0x55036e[_0xa793('0x2d')],_0x55036e[_0xa793('0x28')]);_0x43227b[_0xa793('0x2e')]=_[_0xa793('0x2c')](_0x55036e[_0xa793('0x2d')],qs[_0xa793('0x2f')](_0x3d846b[_0xa793('0x28')][_0xa793('0x2f')]));_0x43227b['attributes']=_0x43227b['attributes'][_0xa793('0x30')]?_0x43227b[_0xa793('0x2e')]:_0x55036e['model'];if(!_0x3d846b[_0xa793('0x28')][_0xa793('0x31')]('nolimit')){_0x43227b[_0xa793('0x15')]=qs['limit'](_0x3d846b[_0xa793('0x28')]['limit']);_0x43227b['offset']=qs[_0xa793('0x14')](_0x3d846b['query'][_0xa793('0x14')]);}_0x43227b[_0xa793('0x32')]=qs['sort'](_0x3d846b['query'][_0xa793('0x33')]);_0x43227b[_0xa793('0x34')]=qs['filters'](_[_0xa793('0x35')](_0x3d846b[_0xa793('0x28')],_0x55036e[_0xa793('0x2b')]));if(_0x1c24a8['dateStart']){if(_0x1c24a8['dateEnd']){_0x1c24a8[_0xa793('0x2a')]=moment(_0x1c24a8[_0xa793('0x2a')])[_0xa793('0x36')](0x1,'day');}else{_0x1c24a8[_0xa793('0x2a')]=moment(_0x1c24a8[_0xa793('0x29')])[_0xa793('0x36')](0x1,'day');}_[_0xa793('0x37')](_0x43227b[_0xa793('0x34')],{'createdAt':{'$gte':_0x1c24a8['dateStart'],'$lte':_0x1c24a8[_0xa793('0x2a')]}});}if(_0x3d846b['query'][_0xa793('0x38')]){_0x43227b[_0xa793('0x34')]=_[_0xa793('0x37')](_0x43227b[_0xa793('0x34')],{'$or':_[_0xa793('0x39')](_0x43227b['attributes'],function(_0x23342c){var _0x4bbad2={};_0x4bbad2[_0x23342c]={'$like':'%'+_0x3d846b['query']['filter']+'%'};return _0x4bbad2;})});}_0x43227b=_['merge']({},_0x43227b,_0x3d846b[_0xa793('0x3a')]);var _0x47e4e7={'where':_0x43227b[_0xa793('0x34')]};return db[_0xa793('0x26')]['count'](_0x47e4e7)[_0xa793('0x1e')](function(_0x31e472){_0x104bc5[_0xa793('0x13')]=_0x31e472;if(_0x3d846b[_0xa793('0x28')]['includeAll']){_0x43227b[_0xa793('0x3b')]=[{'all':!![]}];}return db[_0xa793('0x26')]['findAll'](_0x43227b);})[_0xa793('0x1e')](function(_0x298cab){_0x104bc5[_0xa793('0x3c')]=_0x298cab;return _0x104bc5;})[_0xa793('0x1e')](respondWithFilteredResult(_0x41bca7,_0x43227b))['catch'](handleError(_0x41bca7,null));};exports[_0xa793('0x3d')]=function(_0x4d0923,_0x5bc675){var _0x192a24={'raw':!![],'where':{'id':_0x4d0923[_0xa793('0x3e')]['id']}},_0x421d80={};_0x421d80[_0xa793('0x2d')]=_[_0xa793('0x27')](db[_0xa793('0x26')][_0xa793('0x3f')]);_0x421d80['query']=_['keys'](_0x4d0923[_0xa793('0x28')]);_0x421d80[_0xa793('0x2b')]=_[_0xa793('0x2c')](_0x421d80['model'],_0x421d80[_0xa793('0x28')]);_0x192a24[_0xa793('0x2e')]=_['intersection'](_0x421d80[_0xa793('0x2d')],qs[_0xa793('0x2f')](_0x4d0923[_0xa793('0x28')][_0xa793('0x2f')]));_0x192a24[_0xa793('0x2e')]=_0x192a24[_0xa793('0x2e')][_0xa793('0x30')]?_0x192a24[_0xa793('0x2e')]:_0x421d80[_0xa793('0x2d')];if(_0x4d0923[_0xa793('0x28')][_0xa793('0x40')]){_0x192a24['include']=[{'all':!![]}];}_0x192a24=_[_0xa793('0x37')]({},_0x192a24,_0x4d0923['options']);return db[_0xa793('0x26')][_0xa793('0x41')](_0x192a24)[_0xa793('0x1e')](handleEntityNotFound(_0x5bc675,null))[_0xa793('0x1e')](respondWithResult(_0x5bc675,null))[_0xa793('0x42')](handleError(_0x5bc675,null));};exports[_0xa793('0x43')]=function(_0x2a8497,_0x130980){return db[_0xa793('0x26')][_0xa793('0x43')](_0x2a8497['body'],{})[_0xa793('0x1e')](respondWithResult(_0x130980,0xc9))[_0xa793('0x42')](handleError(_0x130980,null));};exports['update']=function(_0x53c7d9,_0x18772d){if(_0x53c7d9[_0xa793('0x44')]['id']){delete _0x53c7d9[_0xa793('0x44')]['id'];}return db['FaxQueueReport'][_0xa793('0x41')]({'where':{'id':_0x53c7d9[_0xa793('0x3e')]['id']}})[_0xa793('0x1e')](handleEntityNotFound(_0x18772d,null))['then'](saveUpdates(_0x53c7d9[_0xa793('0x44')],null))[_0xa793('0x1e')](respondWithResult(_0x18772d,null))['catch'](handleError(_0x18772d,null));};exports[_0xa793('0x1d')]=function(_0x34eee2,_0x58d2d7){return db[_0xa793('0x26')][_0xa793('0x41')]({'where':{'id':_0x34eee2[_0xa793('0x3e')]['id']}})['then'](handleEntityNotFound(_0x58d2d7,null))[_0xa793('0x1e')](removeEntity(_0x58d2d7,null))[_0xa793('0x42')](handleError(_0x58d2d7,null));};exports[_0xa793('0x45')]=function(_0x46f985,_0x47780f){return db['FaxQueueReport']['describe']()['then'](respondWithResult(_0x47780f,null))[_0xa793('0x42')](handleError(_0x47780f,null));};
\ No newline at end of file
+var _0x049e=['dateStart','query','dateEnd','keys','filters','intersection','attributes','length','nolimit','limit','sort','where','pick','add','day','merge','filter','map','options','count','includeAll','include','FaxQueueReport','catch','show','rawAttributes','fields','find','create','body','params','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','set','json','apply','save','update','then','destroy','stack','send','model'];(function(_0x3caeb5,_0x219363){var _0x5eca7e=function(_0x4cae6b){while(--_0x4cae6b){_0x3caeb5['push'](_0x3caeb5['shift']());}};_0x5eca7e(++_0x219363);}(_0x049e,0x16a));var _0xe049=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0x049e[_0x383356];return _0x32ee5a;};'use strict';var pdf=require(_0xe049('0x0'));var emlformat=require(_0xe049('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe049('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe049('0x3'));var moment=require(_0xe049('0x4'));var BPromise=require(_0xe049('0x5'));var Mustache=require(_0xe049('0x6'));var util=require(_0xe049('0x7'));var path=require('path');var sox=require(_0xe049('0x8'));var csv=require(_0xe049('0x9'));var ejs=require(_0xe049('0xa'));var fs=require('fs');var _=require(_0xe049('0xb'));var squel=require(_0xe049('0xc'));var crypto=require(_0xe049('0xd'));var jsforce=require(_0xe049('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe049('0x9'));var querystring=require(_0xe049('0xf'));var Papa=require(_0xe049('0x10'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xe049('0x11'));var utils=require(_0xe049('0x12'));var config=require(_0xe049('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49e2fe,_0x574549){_0x574549=_0x574549||0xcc;return function(_0x25830d){if(_0x25830d){return _0x49e2fe[_0xe049('0x14')](_0x574549);}return _0x49e2fe[_0xe049('0x15')](_0x574549)[_0xe049('0x16')]();};}function respondWithResult(_0x301c7e,_0x1021e7){_0x1021e7=_0x1021e7||0xc8;return function(_0xdd1814){if(_0xdd1814){return _0x301c7e[_0xe049('0x15')](_0x1021e7)['json'](_0xdd1814);}};}function respondWithFilteredResult(_0x20c286,_0x3f4a57){return function(_0x3924a4){if(_0x3924a4){var _0x35fd0d=_0x3924a4['count'],_0x5f57d3=_0x3f4a57[_0xe049('0x17')],_0x3a539b=_0x3f4a57[_0xe049('0x17')]+_0x3f4a57['limit'],_0xcc35b6;if(_0x3a539b>=_0x35fd0d){_0x3a539b=_0x35fd0d;_0xcc35b6=0xc8;}else{_0xcc35b6=0xce;}_0x20c286[_0xe049('0x15')](_0xcc35b6);return _0x20c286[_0xe049('0x18')]('Content-Range',_0x5f57d3+'-'+_0x3a539b+'/'+_0x35fd0d)[_0xe049('0x19')](_0x3924a4);}return null;};}function patchUpdates(_0x54c303){return function(_0x520dd9){try{jsonpatch[_0xe049('0x1a')](_0x520dd9,_0x54c303,!![]);}catch(_0x5e617b){return BPromise['reject'](_0x5e617b);}return _0x520dd9[_0xe049('0x1b')]();};}function saveUpdates(_0x1092ec,_0x5ae414){return function(_0x4cf18d){if(_0x4cf18d){return _0x4cf18d[_0xe049('0x1c')](_0x1092ec)[_0xe049('0x1d')](function(_0x1d2f5b){return _0x1d2f5b;});}return null;};}function removeEntity(_0x430421,_0x517aea){return function(_0x572f29){if(_0x572f29){return _0x572f29[_0xe049('0x1e')]()[_0xe049('0x1d')](function(){_0x430421['status'](0xcc)[_0xe049('0x16')]();});}};}function handleEntityNotFound(_0x3f14eb,_0x10cb90){return function(_0x5c0007){if(!_0x5c0007){_0x3f14eb[_0xe049('0x14')](0x194);}return _0x5c0007;};}function handleError(_0x3b0f54,_0x4c7492){_0x4c7492=_0x4c7492||0x1f4;return function(_0x4848c9){logger['error'](_0x4848c9[_0xe049('0x1f')]);if(_0x4848c9['name']){delete _0x4848c9['name'];}_0x3b0f54[_0xe049('0x15')](_0x4c7492)[_0xe049('0x20')](_0x4848c9);};}exports['index']=function(_0x1f5233,_0x181432){var _0x3e5c7f={},_0x423ba4={},_0x293dd2={'count':0x0,'rows':[]};var _0x1843b8=db['FaxQueueReport']['rawAttributes'];_0x423ba4[_0xe049('0x21')]=_['keys'](_0x1843b8);var _0x38ff5b={'dateStart':_0x1f5233['query'][_0xe049('0x22')],'dateEnd':_0x1f5233[_0xe049('0x23')]['dateEnd']};delete _0x1f5233[_0xe049('0x23')][_0xe049('0x22')];delete _0x1f5233[_0xe049('0x23')][_0xe049('0x24')];_0x423ba4[_0xe049('0x23')]=_[_0xe049('0x25')](_0x1f5233[_0xe049('0x23')]);_0x423ba4[_0xe049('0x26')]=_[_0xe049('0x27')](_0x423ba4[_0xe049('0x21')],_0x423ba4[_0xe049('0x23')]);_0x3e5c7f['attributes']=_[_0xe049('0x27')](_0x423ba4[_0xe049('0x21')],qs['fields'](_0x1f5233['query']['fields']));_0x3e5c7f['attributes']=_0x3e5c7f[_0xe049('0x28')][_0xe049('0x29')]?_0x3e5c7f[_0xe049('0x28')]:_0x423ba4[_0xe049('0x21')];if(!_0x1f5233[_0xe049('0x23')]['hasOwnProperty'](_0xe049('0x2a'))){_0x3e5c7f[_0xe049('0x2b')]=qs[_0xe049('0x2b')](_0x1f5233[_0xe049('0x23')][_0xe049('0x2b')]);_0x3e5c7f['offset']=qs[_0xe049('0x17')](_0x1f5233['query'][_0xe049('0x17')]);}_0x3e5c7f['order']=qs[_0xe049('0x2c')](_0x1f5233[_0xe049('0x23')][_0xe049('0x2c')]);_0x3e5c7f[_0xe049('0x2d')]=qs[_0xe049('0x26')](_[_0xe049('0x2e')](_0x1f5233[_0xe049('0x23')],_0x423ba4[_0xe049('0x26')]));if(_0x38ff5b[_0xe049('0x22')]){if(_0x38ff5b[_0xe049('0x24')]){_0x38ff5b[_0xe049('0x24')]=moment(_0x38ff5b['dateEnd'])[_0xe049('0x2f')](0x1,_0xe049('0x30'));}else{_0x38ff5b[_0xe049('0x24')]=moment(_0x38ff5b[_0xe049('0x22')])[_0xe049('0x2f')](0x1,_0xe049('0x30'));}_[_0xe049('0x31')](_0x3e5c7f[_0xe049('0x2d')],{'createdAt':{'$gte':_0x38ff5b['dateStart'],'$lte':_0x38ff5b[_0xe049('0x24')]}});}if(_0x1f5233[_0xe049('0x23')][_0xe049('0x32')]){_0x3e5c7f[_0xe049('0x2d')]=_[_0xe049('0x31')](_0x3e5c7f[_0xe049('0x2d')],{'$or':_[_0xe049('0x33')](_0x3e5c7f[_0xe049('0x28')],function(_0x2a840f){var _0x3d6a4b={};_0x3d6a4b[_0x2a840f]={'$like':'%'+_0x1f5233['query'][_0xe049('0x32')]+'%'};return _0x3d6a4b;})});}_0x3e5c7f=_[_0xe049('0x31')]({},_0x3e5c7f,_0x1f5233[_0xe049('0x34')]);var _0x5d7998={'where':_0x3e5c7f[_0xe049('0x2d')]};return db['FaxQueueReport']['count'](_0x5d7998)[_0xe049('0x1d')](function(_0x5f06d9){_0x293dd2[_0xe049('0x35')]=_0x5f06d9;if(_0x1f5233[_0xe049('0x23')][_0xe049('0x36')]){_0x3e5c7f[_0xe049('0x37')]=[{'all':!![]}];}return db[_0xe049('0x38')]['findAll'](_0x3e5c7f);})[_0xe049('0x1d')](function(_0x921743){_0x293dd2['rows']=_0x921743;return _0x293dd2;})['then'](respondWithFilteredResult(_0x181432,_0x3e5c7f))[_0xe049('0x39')](handleError(_0x181432,null));};exports[_0xe049('0x3a')]=function(_0x482072,_0x215eea){var _0x82e245={'raw':!![],'where':{'id':_0x482072['params']['id']}},_0x1d5da2={};_0x1d5da2[_0xe049('0x21')]=_[_0xe049('0x25')](db['FaxQueueReport'][_0xe049('0x3b')]);_0x1d5da2[_0xe049('0x23')]=_[_0xe049('0x25')](_0x482072[_0xe049('0x23')]);_0x1d5da2[_0xe049('0x26')]=_['intersection'](_0x1d5da2['model'],_0x1d5da2[_0xe049('0x23')]);_0x82e245[_0xe049('0x28')]=_[_0xe049('0x27')](_0x1d5da2[_0xe049('0x21')],qs[_0xe049('0x3c')](_0x482072[_0xe049('0x23')]['fields']));_0x82e245[_0xe049('0x28')]=_0x82e245[_0xe049('0x28')]['length']?_0x82e245[_0xe049('0x28')]:_0x1d5da2['model'];if(_0x482072[_0xe049('0x23')]['includeAll']){_0x82e245[_0xe049('0x37')]=[{'all':!![]}];}_0x82e245=_['merge']({},_0x82e245,_0x482072[_0xe049('0x34')]);return db[_0xe049('0x38')][_0xe049('0x3d')](_0x82e245)[_0xe049('0x1d')](handleEntityNotFound(_0x215eea,null))[_0xe049('0x1d')](respondWithResult(_0x215eea,null))['catch'](handleError(_0x215eea,null));};exports[_0xe049('0x3e')]=function(_0x2310ff,_0x43ae26){return db[_0xe049('0x38')][_0xe049('0x3e')](_0x2310ff[_0xe049('0x3f')],{})[_0xe049('0x1d')](respondWithResult(_0x43ae26,0xc9))[_0xe049('0x39')](handleError(_0x43ae26,null));};exports[_0xe049('0x1c')]=function(_0x493962,_0x57be9d){if(_0x493962[_0xe049('0x3f')]['id']){delete _0x493962[_0xe049('0x3f')]['id'];}return db[_0xe049('0x38')][_0xe049('0x3d')]({'where':{'id':_0x493962[_0xe049('0x40')]['id']}})[_0xe049('0x1d')](handleEntityNotFound(_0x57be9d,null))[_0xe049('0x1d')](saveUpdates(_0x493962[_0xe049('0x3f')],null))[_0xe049('0x1d')](respondWithResult(_0x57be9d,null))[_0xe049('0x39')](handleError(_0x57be9d,null));};exports[_0xe049('0x1e')]=function(_0x5f2c2b,_0x36346a){return db[_0xe049('0x38')][_0xe049('0x3d')]({'where':{'id':_0x5f2c2b[_0xe049('0x40')]['id']}})[_0xe049('0x1d')](handleEntityNotFound(_0x36346a,null))[_0xe049('0x1d')](removeEntity(_0x36346a,null))[_0xe049('0x39')](handleError(_0x36346a,null));};exports['describe']=function(_0x4e34da,_0x57b3ff){return db[_0xe049('0x38')][_0xe049('0x41')]()['then'](respondWithResult(_0x57b3ff,null))[_0xe049('0x39')](handleError(_0x57b3ff,null));};
\ No newline at end of file
index 451e71c..5d4a73a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83b1=['FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','./faxQueueReport.attributes','exports','define'];(function(_0x10bd59,_0x5e4203){var _0x5e454b=function(_0x403169){while(--_0x403169){_0x10bd59['push'](_0x10bd59['shift']());}};_0x5e454b(++_0x5e4203);}(_0x83b1,0x71));var _0x183b=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x83b1[_0x34021d];return _0x16597b;};'use strict';var _=require(_0x183b('0x0'));var util=require('util');var logger=require(_0x183b('0x1'))(_0x183b('0x2'));var moment=require('moment');var BPromise=require(_0x183b('0x3'));var rp=require(_0x183b('0x4'));var attributes=require(_0x183b('0x5'));module[_0x183b('0x6')]=function(_0x1ba37d,_0x260d2a){return _0x1ba37d[_0x183b('0x7')](_0x183b('0x8'),attributes,{'tableName':_0x183b('0x9'),'paranoid':![],'indexes':[{'name':_0x183b('0xa'),'fields':[_0x183b('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d8c=['exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','api','moment','bluebird','request-promise','./faxQueueReport.attributes'];(function(_0x58ea9d,_0x24e6c1){var _0x1f0794=function(_0x2b326c){while(--_0x2b326c){_0x58ea9d['push'](_0x58ea9d['shift']());}};_0x1f0794(++_0x24e6c1);}(_0x9d8c,0x191));var _0xc9d8=function(_0x3446b2,_0x2450e7){_0x3446b2=_0x3446b2-0x0;var _0x1077d5=_0x9d8c[_0x3446b2];return _0x1077d5;};'use strict';var _=require(_0xc9d8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc9d8('0x1'));var moment=require(_0xc9d8('0x2'));var BPromise=require(_0xc9d8('0x3'));var rp=require(_0xc9d8('0x4'));var attributes=require(_0xc9d8('0x5'));module[_0xc9d8('0x6')]=function(_0x365e79,_0x1c1b5b){return _0x365e79[_0xc9d8('0x7')](_0xc9d8('0x8'),attributes,{'tableName':_0xc9d8('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc9d8('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index a612821..caf7747 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4006=['stringify','error','message','result','catch','FaxQueueReport','create','options','raw','CreateFaxQueueReport','update','where','UpdateFaxQueueReport','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','http','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x24ab9c,_0x181670){var _0x5abcd4=function(_0x5743a0){while(--_0x5743a0){_0x24ab9c['push'](_0x24ab9c['shift']());}};_0x5abcd4(++_0x181670);}(_0x4006,0x1c7));var _0x6400=function(_0xdc8c7c,_0x4a16f3){_0xdc8c7c=_0xdc8c7c-0x0;var _0x4f33c6=_0x4006[_0xdc8c7c];return _0x4f33c6;};'use strict';var _=require('lodash');var util=require(_0x6400('0x0'));var moment=require(_0x6400('0x1'));var BPromise=require(_0x6400('0x2'));var rs=require(_0x6400('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6400('0x4'))('rpc');var config=require(_0x6400('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6400('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x599e6f,_0x32c0db,_0x2d365b){return new BPromise(function(_0x2bf4f8,_0x250dba){return client['request'](_0x599e6f,_0x2d365b)[_0x6400('0x7')](function(_0x46819e){logger[_0x6400('0x8')](_0x6400('0x9'),_0x32c0db,_0x6400('0xa'));logger[_0x6400('0xb')](_0x6400('0xc'),_0x32c0db,_0x6400('0xa'),JSON[_0x6400('0xd')](_0x46819e));if(_0x46819e[_0x6400('0xe')]){if(_0x46819e[_0x6400('0xe')]['code']===0x1f4){logger[_0x6400('0xe')](_0x6400('0x9'),_0x32c0db,_0x46819e[_0x6400('0xe')][_0x6400('0xf')]);return _0x250dba(_0x46819e['error'][_0x6400('0xf')]);}logger[_0x6400('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x32c0db,_0x46819e['error']['message']);return _0x2bf4f8(_0x46819e[_0x6400('0xe')][_0x6400('0xf')]);}else{logger['info'](_0x6400('0x9'),_0x32c0db,'request\x20sent');_0x2bf4f8(_0x46819e[_0x6400('0x10')]['message']);}})[_0x6400('0x11')](function(_0x430cb4){logger[_0x6400('0xe')](_0x6400('0x9'),_0x32c0db,_0x430cb4);_0x250dba(_0x430cb4);});});}exports['CreateFaxQueueReport']=function(_0x444bce){var _0x14c036=this;return new Promise(function(_0xce9fd1,_0x50524f){return db[_0x6400('0x12')][_0x6400('0x13')](_0x444bce['body'],{'raw':_0x444bce[_0x6400('0x14')]?_0x444bce[_0x6400('0x14')][_0x6400('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0xf4ce95){logger[_0x6400('0x8')](_0x6400('0x16'),_0x444bce);logger[_0x6400('0xb')](_0x6400('0x16'),_0x444bce,JSON[_0x6400('0xd')](_0xf4ce95));_0xce9fd1(_0xf4ce95);})[_0x6400('0x11')](function(_0x171e39){logger[_0x6400('0xe')](_0x6400('0x16'),_0x171e39['message'],_0x444bce);_0x50524f(_0x14c036[_0x6400('0xe')](0x1f4,_0x171e39['message']));});});};exports['UpdateFaxQueueReport']=function(_0x257d80){var _0xb79c62=this;return new Promise(function(_0x7c3948,_0x43fab2){return db['FaxQueueReport'][_0x6400('0x17')](_0x257d80['body'],{'raw':_0x257d80[_0x6400('0x14')]?_0x257d80['options'][_0x6400('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x257d80[_0x6400('0x14')]?_0x257d80['options'][_0x6400('0x18')]||null:null,'attributes':_0x257d80[_0x6400('0x14')]?_0x257d80[_0x6400('0x14')]['attributes']||null:null,'limit':_0x257d80[_0x6400('0x14')]?_0x257d80['options']['limit']||null:null})[_0x6400('0x7')](function(_0x4bb214){logger[_0x6400('0x8')](_0x6400('0x19'),_0x257d80);logger['debug'](_0x6400('0x19'),_0x257d80,JSON['stringify'](_0x4bb214));_0x7c3948(_0x4bb214);})['catch'](function(_0x2ab43e){logger[_0x6400('0xe')](_0x6400('0x19'),_0x2ab43e[_0x6400('0xf')],_0x257d80);_0x43fab2(_0xb79c62[_0x6400('0xe')](0x1f4,_0x2ab43e['message']));});});};
\ No newline at end of file
+var _0xc3db=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','stringify','update','where','attributes','limit','UpdateFaxQueueReport','debug','lodash','util','bluebird'];(function(_0x2197c1,_0x5d09a5){var _0x438d1e=function(_0x184bcd){while(--_0x184bcd){_0x2197c1['push'](_0x2197c1['shift']());}};_0x438d1e(++_0x5d09a5);}(_0xc3db,0xfd));var _0xbc3d=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xc3db[_0x4d07cc];return _0x42de3b;};'use strict';var _=require(_0xbc3d('0x0'));var util=require(_0xbc3d('0x1'));var moment=require('moment');var BPromise=require(_0xbc3d('0x2'));var rs=require(_0xbc3d('0x3'));var fs=require('fs');var db=require(_0xbc3d('0x4'))['db'];var utils=require(_0xbc3d('0x5'));var logger=require(_0xbc3d('0x6'))(_0xbc3d('0x7'));var config=require('../../config/environment');var jayson=require(_0xbc3d('0x8'));var client=jayson[_0xbc3d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2624d2,_0x14ec8b,_0x1dad06){return new BPromise(function(_0x55757a,_0x2f9eec){return client[_0xbc3d('0xa')](_0x2624d2,_0x1dad06)[_0xbc3d('0xb')](function(_0x32e7ba){logger['info'](_0xbc3d('0xc'),_0x14ec8b,_0xbc3d('0xd'));logger['debug'](_0xbc3d('0xe'),_0x14ec8b,_0xbc3d('0xd'),JSON['stringify'](_0x32e7ba));if(_0x32e7ba[_0xbc3d('0xf')]){if(_0x32e7ba[_0xbc3d('0xf')][_0xbc3d('0x10')]===0x1f4){logger['error'](_0xbc3d('0xc'),_0x14ec8b,_0x32e7ba['error'][_0xbc3d('0x11')]);return _0x2f9eec(_0x32e7ba[_0xbc3d('0xf')][_0xbc3d('0x11')]);}logger[_0xbc3d('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x14ec8b,_0x32e7ba[_0xbc3d('0xf')]['message']);return _0x55757a(_0x32e7ba[_0xbc3d('0xf')][_0xbc3d('0x11')]);}else{logger[_0xbc3d('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x14ec8b,_0xbc3d('0xd'));_0x55757a(_0x32e7ba['result']['message']);}})[_0xbc3d('0x13')](function(_0x26fd4d){logger['error'](_0xbc3d('0xc'),_0x14ec8b,_0x26fd4d);_0x2f9eec(_0x26fd4d);});});}exports[_0xbc3d('0x14')]=function(_0x411352){var _0x5cdc6b=this;return new Promise(function(_0x194664,_0x293aaf){return db[_0xbc3d('0x15')][_0xbc3d('0x16')](_0x411352[_0xbc3d('0x17')],{'raw':_0x411352[_0xbc3d('0x18')]?_0x411352['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1c1f02){logger[_0xbc3d('0x12')](_0xbc3d('0x14'),_0x411352);logger['debug'](_0xbc3d('0x14'),_0x411352,JSON[_0xbc3d('0x19')](_0x1c1f02));_0x194664(_0x1c1f02);})[_0xbc3d('0x13')](function(_0x27746d){logger[_0xbc3d('0xf')](_0xbc3d('0x14'),_0x27746d[_0xbc3d('0x11')],_0x411352);_0x293aaf(_0x5cdc6b[_0xbc3d('0xf')](0x1f4,_0x27746d['message']));});});};exports['UpdateFaxQueueReport']=function(_0x206037){var _0x16893f=this;return new Promise(function(_0x152728,_0x147fe6){return db[_0xbc3d('0x15')][_0xbc3d('0x1a')](_0x206037[_0xbc3d('0x17')],{'raw':_0x206037['options']?_0x206037[_0xbc3d('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x206037[_0xbc3d('0x18')]?_0x206037[_0xbc3d('0x18')][_0xbc3d('0x1b')]||null:null,'attributes':_0x206037['options']?_0x206037['options'][_0xbc3d('0x1c')]||null:null,'limit':_0x206037[_0xbc3d('0x18')]?_0x206037['options'][_0xbc3d('0x1d')]||null:null})['then'](function(_0x1c6681){logger[_0xbc3d('0x12')](_0xbc3d('0x1e'),_0x206037);logger[_0xbc3d('0x1f')](_0xbc3d('0x1e'),_0x206037,JSON[_0xbc3d('0x19')](_0x1c6681));_0x152728(_0x1c6681);})[_0xbc3d('0x13')](function(_0x1c85f4){logger[_0xbc3d('0xf')](_0xbc3d('0x1e'),_0x1c85f4[_0xbc3d('0x11')],_0x206037);_0x147fe6(_0x16893f[_0xbc3d('0xf')](0x1f4,_0x1c85f4['message']));});});};
\ No newline at end of file
index df67e9b..832c725 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5db6=['update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put'];(function(_0x1890b9,_0x4bc103){var _0x46d9c6=function(_0x4f9c68){while(--_0x4f9c68){_0x1890b9['push'](_0x1890b9['shift']());}};_0x46d9c6(++_0x4bc103);}(_0x5db6,0x17a));var _0x65db=function(_0x476068,_0x6f216e){_0x476068=_0x476068-0x0;var _0x4887b7=_0x5db6[_0x476068];return _0x4887b7;};'use strict';var multer=require(_0x65db('0x0'));var util=require(_0x65db('0x1'));var path=require('path');var express=require('express');var router=express[_0x65db('0x2')]();var auth=require(_0x65db('0x3'));var interaction=require(_0x65db('0x4'));var config=require(_0x65db('0x5'));var controller=require('./faxQueueReport.controller');router[_0x65db('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x65db('0x6')]('/describe',auth[_0x65db('0x7')](),controller['describe']);router[_0x65db('0x6')](_0x65db('0x8'),auth['isAuthenticated'](),controller[_0x65db('0x9')]);router[_0x65db('0xa')]('/',auth[_0x65db('0x7')](),controller[_0x65db('0xb')]);router[_0x65db('0xc')](_0x65db('0x8'),auth[_0x65db('0x7')](),controller[_0x65db('0xd')]);router[_0x65db('0xe')](_0x65db('0x8'),auth['isAuthenticated'](),controller[_0x65db('0xf')]);module[_0x65db('0x10')]=router;
\ No newline at end of file
+var _0x80dc=['show','post','put','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id'];(function(_0x50f9ef,_0x18f5e2){var _0x15f60f=function(_0x2198ec){while(--_0x2198ec){_0x50f9ef['push'](_0x50f9ef['shift']());}};_0x15f60f(++_0x18f5e2);}(_0x80dc,0xd2));var _0xc80d=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x80dc[_0x40220a];return _0x3903cc;};'use strict';var multer=require(_0xc80d('0x0'));var util=require(_0xc80d('0x1'));var path=require(_0xc80d('0x2'));var express=require(_0xc80d('0x3'));var router=express[_0xc80d('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc80d('0x5'));var config=require(_0xc80d('0x6'));var controller=require('./faxQueueReport.controller');router[_0xc80d('0x7')]('/',auth[_0xc80d('0x8')](),controller['index']);router[_0xc80d('0x7')]('/describe',auth[_0xc80d('0x8')](),controller[_0xc80d('0x9')]);router['get'](_0xc80d('0xa'),auth[_0xc80d('0x8')](),controller[_0xc80d('0xb')]);router[_0xc80d('0xc')]('/',auth[_0xc80d('0x8')](),controller['create']);router[_0xc80d('0xd')](_0xc80d('0xa'),auth[_0xc80d('0x8')](),controller['update']);router[_0xc80d('0xe')](_0xc80d('0xa'),auth[_0xc80d('0x8')](),controller[_0xc80d('0xf')]);module[_0xc80d('0x10')]=router;
\ No newline at end of file
index 9faba23..9d9a8a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fec=['queue','DATE','NOW','moment','exports','STRING','account','agent'];(function(_0x3df946,_0x272382){var _0x11123a=function(_0x45ce2f){while(--_0x45ce2f){_0x3df946['push'](_0x3df946['shift']());}};_0x11123a(++_0x272382);}(_0x1fec,0x17b));var _0xc1fe=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x1fec[_0x1ccdf7];return _0x52a0ae;};'use strict';var moment=require(_0xc1fe('0x0'));var Sequelize=require('sequelize');module[_0xc1fe('0x1')]={'uniqueid':{'type':Sequelize[_0xc1fe('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xc1fe('0x3'),_0xc1fe('0x4'),'queue'),'allowNull':![],'defaultValue':_0xc1fe('0x5')},'transferredAt':{'type':Sequelize[_0xc1fe('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xc1fe('0x7')]}};
\ No newline at end of file
+var _0x3a74=['STRING','ENUM','agent','queue','DATE','NOW','moment','exports'];(function(_0x116f95,_0x46d673){var _0xec9801=function(_0x69a72){while(--_0x69a72){_0x116f95['push'](_0x116f95['shift']());}};_0xec9801(++_0x46d673);}(_0x3a74,0x1e6));var _0x43a7=function(_0x182f0f,_0xfd5bb7){_0x182f0f=_0x182f0f-0x0;var _0xb571cf=_0x3a74[_0x182f0f];return _0xb571cf;};'use strict';var moment=require(_0x43a7('0x0'));var Sequelize=require('sequelize');module[_0x43a7('0x1')]={'uniqueid':{'type':Sequelize[_0x43a7('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x43a7('0x3')]('account',_0x43a7('0x4'),_0x43a7('0x5')),'allowNull':![],'defaultValue':_0x43a7('0x5')},'transferredAt':{'type':Sequelize[_0x43a7('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x43a7('0x7')]}};
\ No newline at end of file
index 7a7f28c..83abe11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3266=['offset','apply','update','then','error','name','FaxTransferReport','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','add','day','merge','map','filter','options','includeAll','include','findAll','catch','show','create','body','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count'];(function(_0x4b4c52,_0x387ec2){var _0x4d0dec=function(_0x59c760){while(--_0x59c760){_0x4b4c52['push'](_0x4b4c52['shift']());}};_0x4d0dec(++_0x387ec2);}(_0x3266,0x6a));var _0x6326=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x3266[_0x51c819];return _0x15c5d2;};'use strict';var pdf=require(_0x6326('0x0'));var emlformat=require(_0x6326('0x1'));var rimraf=require(_0x6326('0x2'));var zipdir=require(_0x6326('0x3'));var jsonpatch=require(_0x6326('0x4'));var rp=require(_0x6326('0x5'));var moment=require(_0x6326('0x6'));var BPromise=require(_0x6326('0x7'));var Mustache=require(_0x6326('0x8'));var util=require('util');var path=require(_0x6326('0x9'));var sox=require('sox');var csv=require(_0x6326('0xa'));var ejs=require(_0x6326('0xb'));var fs=require('fs');var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xa'));var querystring=require(_0x6326('0xf'));var Papa=require(_0x6326('0x10'));var qs=require(_0x6326('0x11'));var logger=require('../../config/logger')(_0x6326('0x12'));var utils=require(_0x6326('0x13'));var config=require(_0x6326('0x14'));var db=require(_0x6326('0x15'))['db'];function respondWithStatusCode(_0x416844,_0x3b056c){_0x3b056c=_0x3b056c||0xcc;return function(_0x1ba67d){if(_0x1ba67d){return _0x416844[_0x6326('0x16')](_0x3b056c);}return _0x416844[_0x6326('0x17')](_0x3b056c)[_0x6326('0x18')]();};}function respondWithResult(_0x5c07e1,_0x5381d0){_0x5381d0=_0x5381d0||0xc8;return function(_0x301f34){if(_0x301f34){return _0x5c07e1[_0x6326('0x17')](_0x5381d0)['json'](_0x301f34);}};}function respondWithFilteredResult(_0x425878,_0x4caef3){return function(_0x2d2d9b){if(_0x2d2d9b){var _0x20dcc6=_0x2d2d9b[_0x6326('0x19')],_0x3d6ac0=_0x4caef3['offset'],_0x41c352=_0x4caef3[_0x6326('0x1a')]+_0x4caef3['limit'],_0x1ed3a3;if(_0x41c352>=_0x20dcc6){_0x41c352=_0x20dcc6;_0x1ed3a3=0xc8;}else{_0x1ed3a3=0xce;}_0x425878['status'](_0x1ed3a3);return _0x425878['set']('Content-Range',_0x3d6ac0+'-'+_0x41c352+'/'+_0x20dcc6)['json'](_0x2d2d9b);}return null;};}function patchUpdates(_0x58e960){return function(_0xdf5ced){try{jsonpatch[_0x6326('0x1b')](_0xdf5ced,_0x58e960,!![]);}catch(_0x2be78e){return BPromise['reject'](_0x2be78e);}return _0xdf5ced['save']();};}function saveUpdates(_0x954ed5,_0x42319c){return function(_0x272b5c){if(_0x272b5c){return _0x272b5c[_0x6326('0x1c')](_0x954ed5)[_0x6326('0x1d')](function(_0x25957a){return _0x25957a;});}return null;};}function removeEntity(_0x21ee7d,_0x53b437){return function(_0x22307f){if(_0x22307f){return _0x22307f['destroy']()[_0x6326('0x1d')](function(){_0x21ee7d[_0x6326('0x17')](0xcc)[_0x6326('0x18')]();});}};}function handleEntityNotFound(_0x24fb78,_0x43cdfc){return function(_0x39fff1){if(!_0x39fff1){_0x24fb78[_0x6326('0x16')](0x194);}return _0x39fff1;};}function handleError(_0x429bb0,_0x4781cc){_0x4781cc=_0x4781cc||0x1f4;return function(_0x2d0d00){logger[_0x6326('0x1e')](_0x2d0d00['stack']);if(_0x2d0d00[_0x6326('0x1f')]){delete _0x2d0d00[_0x6326('0x1f')];}_0x429bb0['status'](_0x4781cc)['send'](_0x2d0d00);};}exports['index']=function(_0x405474,_0x4dae28){var _0x33c466={},_0x1a48da={},_0x5a907f={'count':0x0,'rows':[]};var _0x15e33d=db[_0x6326('0x20')][_0x6326('0x21')];_0x1a48da[_0x6326('0x22')]=_[_0x6326('0x23')](_0x15e33d);var _0x45d037={'dateStart':_0x405474[_0x6326('0x24')][_0x6326('0x25')],'dateEnd':_0x405474[_0x6326('0x24')][_0x6326('0x26')]};delete _0x405474[_0x6326('0x24')][_0x6326('0x25')];delete _0x405474[_0x6326('0x24')][_0x6326('0x26')];_0x1a48da[_0x6326('0x24')]=_[_0x6326('0x23')](_0x405474['query']);_0x1a48da[_0x6326('0x27')]=_[_0x6326('0x28')](_0x1a48da[_0x6326('0x22')],_0x1a48da['query']);_0x33c466[_0x6326('0x29')]=_['intersection'](_0x1a48da['model'],qs[_0x6326('0x2a')](_0x405474[_0x6326('0x24')][_0x6326('0x2a')]));_0x33c466[_0x6326('0x29')]=_0x33c466[_0x6326('0x29')][_0x6326('0x2b')]?_0x33c466[_0x6326('0x29')]:_0x1a48da[_0x6326('0x22')];if(!_0x405474[_0x6326('0x24')][_0x6326('0x2c')](_0x6326('0x2d'))){_0x33c466[_0x6326('0x2e')]=qs['limit'](_0x405474[_0x6326('0x24')][_0x6326('0x2e')]);_0x33c466['offset']=qs[_0x6326('0x1a')](_0x405474[_0x6326('0x24')][_0x6326('0x1a')]);}_0x33c466['order']=qs[_0x6326('0x2f')](_0x405474['query']['sort']);_0x33c466[_0x6326('0x30')]=qs[_0x6326('0x27')](_[_0x6326('0x31')](_0x405474['query'],_0x1a48da[_0x6326('0x27')]));if(_0x45d037['dateStart']){if(_0x45d037[_0x6326('0x26')]){_0x45d037['dateEnd']=moment(_0x45d037[_0x6326('0x26')])[_0x6326('0x32')](0x1,_0x6326('0x33'));}else{_0x45d037[_0x6326('0x26')]=moment(_0x45d037[_0x6326('0x25')])[_0x6326('0x32')](0x1,'day');}_[_0x6326('0x34')](_0x33c466[_0x6326('0x30')],{'createdAt':{'$gte':_0x45d037['dateStart'],'$lte':_0x45d037[_0x6326('0x26')]}});}if(_0x405474['query']['filter']){_0x33c466[_0x6326('0x30')]=_[_0x6326('0x34')](_0x33c466[_0x6326('0x30')],{'$or':_[_0x6326('0x35')](_0x33c466[_0x6326('0x29')],function(_0xd51c5f){var _0x5de1c3={};_0x5de1c3[_0xd51c5f]={'$like':'%'+_0x405474['query'][_0x6326('0x36')]+'%'};return _0x5de1c3;})});}_0x33c466=_['merge']({},_0x33c466,_0x405474[_0x6326('0x37')]);var _0x4c9242={'where':_0x33c466[_0x6326('0x30')]};return db[_0x6326('0x20')][_0x6326('0x19')](_0x4c9242)[_0x6326('0x1d')](function(_0x1e0c44){_0x5a907f[_0x6326('0x19')]=_0x1e0c44;if(_0x405474[_0x6326('0x24')][_0x6326('0x38')]){_0x33c466[_0x6326('0x39')]=[{'all':!![]}];}return db[_0x6326('0x20')][_0x6326('0x3a')](_0x33c466);})['then'](function(_0x181864){_0x5a907f['rows']=_0x181864;return _0x5a907f;})[_0x6326('0x1d')](respondWithFilteredResult(_0x4dae28,_0x33c466))[_0x6326('0x3b')](handleError(_0x4dae28,null));};exports[_0x6326('0x3c')]=function(_0x50582a,_0x533936){var _0x3a346e={'raw':!![],'where':{'id':_0x50582a['params']['id']}},_0x255a70={};_0x255a70[_0x6326('0x22')]=_[_0x6326('0x23')](db[_0x6326('0x20')][_0x6326('0x21')]);_0x255a70['query']=_[_0x6326('0x23')](_0x50582a[_0x6326('0x24')]);_0x255a70[_0x6326('0x27')]=_[_0x6326('0x28')](_0x255a70[_0x6326('0x22')],_0x255a70[_0x6326('0x24')]);_0x3a346e[_0x6326('0x29')]=_['intersection'](_0x255a70[_0x6326('0x22')],qs[_0x6326('0x2a')](_0x50582a[_0x6326('0x24')][_0x6326('0x2a')]));_0x3a346e['attributes']=_0x3a346e[_0x6326('0x29')]['length']?_0x3a346e[_0x6326('0x29')]:_0x255a70[_0x6326('0x22')];if(_0x50582a[_0x6326('0x24')][_0x6326('0x38')]){_0x3a346e[_0x6326('0x39')]=[{'all':!![]}];}_0x3a346e=_['merge']({},_0x3a346e,_0x50582a[_0x6326('0x37')]);return db['FaxTransferReport']['find'](_0x3a346e)[_0x6326('0x1d')](handleEntityNotFound(_0x533936,null))[_0x6326('0x1d')](respondWithResult(_0x533936,null))['catch'](handleError(_0x533936,null));};exports[_0x6326('0x3d')]=function(_0x2dc964,_0x327f93){return db[_0x6326('0x20')][_0x6326('0x3d')](_0x2dc964['body'],{})['then'](respondWithResult(_0x327f93,0xc9))[_0x6326('0x3b')](handleError(_0x327f93,null));};exports[_0x6326('0x1c')]=function(_0x1661a9,_0x21d034){if(_0x1661a9[_0x6326('0x3e')]['id']){delete _0x1661a9[_0x6326('0x3e')]['id'];}return db[_0x6326('0x20')]['find']({'where':{'id':_0x1661a9[_0x6326('0x3f')]['id']}})[_0x6326('0x1d')](handleEntityNotFound(_0x21d034,null))[_0x6326('0x1d')](saveUpdates(_0x1661a9[_0x6326('0x3e')],null))[_0x6326('0x1d')](respondWithResult(_0x21d034,null))['catch'](handleError(_0x21d034,null));};exports[_0x6326('0x40')]=function(_0x55537a,_0x216972){return db[_0x6326('0x20')]['find']({'where':{'id':_0x55537a[_0x6326('0x3f')]['id']}})['then'](handleEntityNotFound(_0x216972,null))[_0x6326('0x1d')](removeEntity(_0x216972,null))[_0x6326('0x3b')](handleError(_0x216972,null));};exports[_0x6326('0x41')]=function(_0x35400e,_0x58731d){return db[_0x6326('0x20')][_0x6326('0x41')]()['then'](respondWithResult(_0x58731d,null))[_0x6326('0x3b')](handleError(_0x58731d,null));};
\ No newline at end of file
+var _0xd117=['set','Content-Range','reject','update','then','destroy','error','stack','name','rawAttributes','model','keys','query','dateStart','dateEnd','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','add','day','filter','map','merge','FaxTransferReport','include','findAll','rows','catch','params','intersection','length','includeAll','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','sendStatus','end','status','count','offset','limit'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xd117,0x182));var _0x7d11=function(_0x16e0c8,_0x4861eb){_0x16e0c8=_0x16e0c8-0x0;var _0xe4b5af=_0xd117[_0x16e0c8];return _0xe4b5af;};'use strict';var pdf=require(_0x7d11('0x0'));var emlformat=require(_0x7d11('0x1'));var rimraf=require(_0x7d11('0x2'));var zipdir=require(_0x7d11('0x3'));var jsonpatch=require(_0x7d11('0x4'));var rp=require(_0x7d11('0x5'));var moment=require(_0x7d11('0x6'));var BPromise=require(_0x7d11('0x7'));var Mustache=require(_0x7d11('0x8'));var util=require(_0x7d11('0x9'));var path=require(_0x7d11('0xa'));var sox=require(_0x7d11('0xb'));var csv=require(_0x7d11('0xc'));var ejs=require(_0x7d11('0xd'));var fs=require('fs');var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xc'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var qs=require(_0x7d11('0x13'));var logger=require(_0x7d11('0x14'))('api');var utils=require(_0x7d11('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb15984,_0x5c6d5d){_0x5c6d5d=_0x5c6d5d||0xcc;return function(_0x4a8668){if(_0x4a8668){return _0xb15984[_0x7d11('0x16')](_0x5c6d5d);}return _0xb15984['status'](_0x5c6d5d)[_0x7d11('0x17')]();};}function respondWithResult(_0x471f46,_0x5ee572){_0x5ee572=_0x5ee572||0xc8;return function(_0x401bb7){if(_0x401bb7){return _0x471f46[_0x7d11('0x18')](_0x5ee572)['json'](_0x401bb7);}};}function respondWithFilteredResult(_0x324de5,_0x16949d){return function(_0x20a2df){if(_0x20a2df){var _0x2978da=_0x20a2df[_0x7d11('0x19')],_0x417e2d=_0x16949d['offset'],_0xeae744=_0x16949d[_0x7d11('0x1a')]+_0x16949d[_0x7d11('0x1b')],_0x2a269e;if(_0xeae744>=_0x2978da){_0xeae744=_0x2978da;_0x2a269e=0xc8;}else{_0x2a269e=0xce;}_0x324de5[_0x7d11('0x18')](_0x2a269e);return _0x324de5[_0x7d11('0x1c')](_0x7d11('0x1d'),_0x417e2d+'-'+_0xeae744+'/'+_0x2978da)['json'](_0x20a2df);}return null;};}function patchUpdates(_0x456cb9){return function(_0x49a34b){try{jsonpatch['apply'](_0x49a34b,_0x456cb9,!![]);}catch(_0x5459df){return BPromise[_0x7d11('0x1e')](_0x5459df);}return _0x49a34b['save']();};}function saveUpdates(_0x1f9990,_0x5c0af8){return function(_0xbe0a79){if(_0xbe0a79){return _0xbe0a79[_0x7d11('0x1f')](_0x1f9990)[_0x7d11('0x20')](function(_0x46f662){return _0x46f662;});}return null;};}function removeEntity(_0x30df70,_0x117bb9){return function(_0x4297f8){if(_0x4297f8){return _0x4297f8[_0x7d11('0x21')]()['then'](function(){_0x30df70[_0x7d11('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58455b,_0x5c3898){return function(_0x27a818){if(!_0x27a818){_0x58455b[_0x7d11('0x16')](0x194);}return _0x27a818;};}function handleError(_0x44476c,_0x1a7853){_0x1a7853=_0x1a7853||0x1f4;return function(_0x355d14){logger[_0x7d11('0x22')](_0x355d14[_0x7d11('0x23')]);if(_0x355d14[_0x7d11('0x24')]){delete _0x355d14['name'];}_0x44476c[_0x7d11('0x18')](_0x1a7853)['send'](_0x355d14);};}exports['index']=function(_0x5126cf,_0x3ba092){var _0x59cdba={},_0x180e1e={},_0x30e4c6={'count':0x0,'rows':[]};var _0x328ab7=db['FaxTransferReport'][_0x7d11('0x25')];_0x180e1e[_0x7d11('0x26')]=_[_0x7d11('0x27')](_0x328ab7);var _0x5d38dd={'dateStart':_0x5126cf[_0x7d11('0x28')][_0x7d11('0x29')],'dateEnd':_0x5126cf[_0x7d11('0x28')][_0x7d11('0x2a')]};delete _0x5126cf['query'][_0x7d11('0x29')];delete _0x5126cf['query'][_0x7d11('0x2a')];_0x180e1e['query']=_[_0x7d11('0x27')](_0x5126cf[_0x7d11('0x28')]);_0x180e1e[_0x7d11('0x2b')]=_['intersection'](_0x180e1e['model'],_0x180e1e[_0x7d11('0x28')]);_0x59cdba[_0x7d11('0x2c')]=_['intersection'](_0x180e1e[_0x7d11('0x26')],qs[_0x7d11('0x2d')](_0x5126cf[_0x7d11('0x28')]['fields']));_0x59cdba[_0x7d11('0x2c')]=_0x59cdba['attributes']['length']?_0x59cdba[_0x7d11('0x2c')]:_0x180e1e['model'];if(!_0x5126cf[_0x7d11('0x28')][_0x7d11('0x2e')](_0x7d11('0x2f'))){_0x59cdba[_0x7d11('0x1b')]=qs['limit'](_0x5126cf[_0x7d11('0x28')][_0x7d11('0x1b')]);_0x59cdba['offset']=qs['offset'](_0x5126cf[_0x7d11('0x28')][_0x7d11('0x1a')]);}_0x59cdba['order']=qs[_0x7d11('0x30')](_0x5126cf['query']['sort']);_0x59cdba[_0x7d11('0x31')]=qs['filters'](_['pick'](_0x5126cf[_0x7d11('0x28')],_0x180e1e[_0x7d11('0x2b')]));if(_0x5d38dd[_0x7d11('0x29')]){if(_0x5d38dd[_0x7d11('0x2a')]){_0x5d38dd[_0x7d11('0x2a')]=moment(_0x5d38dd[_0x7d11('0x2a')])[_0x7d11('0x32')](0x1,_0x7d11('0x33'));}else{_0x5d38dd[_0x7d11('0x2a')]=moment(_0x5d38dd[_0x7d11('0x29')])[_0x7d11('0x32')](0x1,_0x7d11('0x33'));}_['merge'](_0x59cdba[_0x7d11('0x31')],{'createdAt':{'$gte':_0x5d38dd['dateStart'],'$lte':_0x5d38dd[_0x7d11('0x2a')]}});}if(_0x5126cf[_0x7d11('0x28')][_0x7d11('0x34')]){_0x59cdba[_0x7d11('0x31')]=_['merge'](_0x59cdba[_0x7d11('0x31')],{'$or':_[_0x7d11('0x35')](_0x59cdba[_0x7d11('0x2c')],function(_0xa900fc){var _0x597071={};_0x597071[_0xa900fc]={'$like':'%'+_0x5126cf[_0x7d11('0x28')]['filter']+'%'};return _0x597071;})});}_0x59cdba=_[_0x7d11('0x36')]({},_0x59cdba,_0x5126cf['options']);var _0xede1cc={'where':_0x59cdba[_0x7d11('0x31')]};return db[_0x7d11('0x37')][_0x7d11('0x19')](_0xede1cc)['then'](function(_0x57b827){_0x30e4c6[_0x7d11('0x19')]=_0x57b827;if(_0x5126cf[_0x7d11('0x28')]['includeAll']){_0x59cdba[_0x7d11('0x38')]=[{'all':!![]}];}return db[_0x7d11('0x37')][_0x7d11('0x39')](_0x59cdba);})[_0x7d11('0x20')](function(_0x1831e6){_0x30e4c6[_0x7d11('0x3a')]=_0x1831e6;return _0x30e4c6;})['then'](respondWithFilteredResult(_0x3ba092,_0x59cdba))[_0x7d11('0x3b')](handleError(_0x3ba092,null));};exports['show']=function(_0x2f4a76,_0x44eeed){var _0x23c2b6={'raw':!![],'where':{'id':_0x2f4a76[_0x7d11('0x3c')]['id']}},_0x3c5491={};_0x3c5491[_0x7d11('0x26')]=_['keys'](db['FaxTransferReport']['rawAttributes']);_0x3c5491[_0x7d11('0x28')]=_[_0x7d11('0x27')](_0x2f4a76[_0x7d11('0x28')]);_0x3c5491[_0x7d11('0x2b')]=_[_0x7d11('0x3d')](_0x3c5491['model'],_0x3c5491[_0x7d11('0x28')]);_0x23c2b6[_0x7d11('0x2c')]=_['intersection'](_0x3c5491[_0x7d11('0x26')],qs[_0x7d11('0x2d')](_0x2f4a76[_0x7d11('0x28')]['fields']));_0x23c2b6[_0x7d11('0x2c')]=_0x23c2b6[_0x7d11('0x2c')][_0x7d11('0x3e')]?_0x23c2b6['attributes']:_0x3c5491[_0x7d11('0x26')];if(_0x2f4a76['query'][_0x7d11('0x3f')]){_0x23c2b6[_0x7d11('0x38')]=[{'all':!![]}];}_0x23c2b6=_[_0x7d11('0x36')]({},_0x23c2b6,_0x2f4a76[_0x7d11('0x40')]);return db[_0x7d11('0x37')][_0x7d11('0x41')](_0x23c2b6)[_0x7d11('0x20')](handleEntityNotFound(_0x44eeed,null))[_0x7d11('0x20')](respondWithResult(_0x44eeed,null))[_0x7d11('0x3b')](handleError(_0x44eeed,null));};exports['create']=function(_0x50d458,_0x49a21c){return db[_0x7d11('0x37')][_0x7d11('0x42')](_0x50d458[_0x7d11('0x43')],{})[_0x7d11('0x20')](respondWithResult(_0x49a21c,0xc9))[_0x7d11('0x3b')](handleError(_0x49a21c,null));};exports[_0x7d11('0x1f')]=function(_0x164d58,_0x356c46){if(_0x164d58[_0x7d11('0x43')]['id']){delete _0x164d58[_0x7d11('0x43')]['id'];}return db[_0x7d11('0x37')][_0x7d11('0x41')]({'where':{'id':_0x164d58['params']['id']}})[_0x7d11('0x20')](handleEntityNotFound(_0x356c46,null))[_0x7d11('0x20')](saveUpdates(_0x164d58[_0x7d11('0x43')],null))['then'](respondWithResult(_0x356c46,null))['catch'](handleError(_0x356c46,null));};exports[_0x7d11('0x21')]=function(_0x2972bf,_0x218485){return db['FaxTransferReport']['find']({'where':{'id':_0x2972bf[_0x7d11('0x3c')]['id']}})[_0x7d11('0x20')](handleEntityNotFound(_0x218485,null))['then'](removeEntity(_0x218485,null))[_0x7d11('0x3b')](handleError(_0x218485,null));};exports[_0x7d11('0x44')]=function(_0xafc529,_0x3d6a00){return db['FaxTransferReport'][_0x7d11('0x44')]()[_0x7d11('0x20')](respondWithResult(_0x3d6a00,null))[_0x7d11('0x3b')](handleError(_0x3d6a00,null));};
\ No newline at end of file
index 02e51df..605392d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb590=['exports','define','uniqueid','lodash','util','api','request-promise'];(function(_0x148645,_0x5df9c0){var _0x258f8b=function(_0x517710){while(--_0x517710){_0x148645['push'](_0x148645['shift']());}};_0x258f8b(++_0x5df9c0);}(_0xb590,0x1bc));var _0x0b59=function(_0x189686,_0x55d34f){_0x189686=_0x189686-0x0;var _0x207ea3=_0xb590[_0x189686];return _0x207ea3;};'use strict';var _=require(_0x0b59('0x0'));var util=require(_0x0b59('0x1'));var logger=require('../../config/logger')(_0x0b59('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0b59('0x3'));var attributes=require('./faxTransferReport.attributes');module[_0x0b59('0x4')]=function(_0x7481e7,_0x5d044a){return _0x7481e7[_0x0b59('0x5')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x0b59('0x6'),'fields':[_0x0b59('0x6')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb477=['request-promise','./faxTransferReport.attributes','define','FaxTransferReport','uniqueid','lodash','moment','bluebird'];(function(_0x3f55c6,_0x3943dc){var _0x39f70=function(_0x504081){while(--_0x504081){_0x3f55c6['push'](_0x3f55c6['shift']());}};_0x39f70(++_0x3943dc);}(_0xb477,0x1ed));var _0x7b47=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb477[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x7b47('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7b47('0x1'));var BPromise=require(_0x7b47('0x2'));var rp=require(_0x7b47('0x3'));var attributes=require(_0x7b47('0x4'));module['exports']=function(_0x28f016,_0x5fb029){return _0x28f016[_0x7b47('0x5')](_0x7b47('0x6'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x7b47('0x7'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index a2a66d3..6e656ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfce9=['FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xfce9,0x9f));var _0x9fce=function(_0x4bf923,_0x177293){_0x4bf923=_0x4bf923-0x0;var _0x22c595=_0xfce9[_0x4bf923];return _0x22c595;};'use strict';var _=require(_0x9fce('0x0'));var util=require(_0x9fce('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0x9fce('0x2'))['db'];var utils=require(_0x9fce('0x3'));var logger=require('../../config/logger')(_0x9fce('0x4'));var config=require(_0x9fce('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a4fd8,_0x470d8c,_0x49a29e){return new BPromise(function(_0x59e75e,_0x4cc3aa){return client[_0x9fce('0x6')](_0x1a4fd8,_0x49a29e)[_0x9fce('0x7')](function(_0x42d6b4){logger[_0x9fce('0x8')](_0x9fce('0x9'),_0x470d8c,_0x9fce('0xa'));logger['debug'](_0x9fce('0xb'),_0x470d8c,'request\x20sent',JSON[_0x9fce('0xc')](_0x42d6b4));if(_0x42d6b4['error']){if(_0x42d6b4[_0x9fce('0xd')]['code']===0x1f4){logger[_0x9fce('0xd')](_0x9fce('0x9'),_0x470d8c,_0x42d6b4[_0x9fce('0xd')][_0x9fce('0xe')]);return _0x4cc3aa(_0x42d6b4['error'][_0x9fce('0xe')]);}logger[_0x9fce('0xd')](_0x9fce('0x9'),_0x470d8c,_0x42d6b4[_0x9fce('0xd')][_0x9fce('0xe')]);return _0x59e75e(_0x42d6b4['error'][_0x9fce('0xe')]);}else{logger['info'](_0x9fce('0x9'),_0x470d8c,_0x9fce('0xa'));_0x59e75e(_0x42d6b4[_0x9fce('0xf')]['message']);}})[_0x9fce('0x10')](function(_0x743ac){logger[_0x9fce('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x470d8c,_0x743ac);_0x4cc3aa(_0x743ac);});});}
\ No newline at end of file
+var _0xa501=['moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','then','FaxTransferReport,\x20%s,\x20%s','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash'];(function(_0x1be18e,_0xe190d0){var _0x11ad47=function(_0x31649b){while(--_0x31649b){_0x1be18e['push'](_0x1be18e['shift']());}};_0x11ad47(++_0xe190d0);}(_0xa501,0xd0));var _0x1a50=function(_0x2544eb,_0x2804f3){_0x2544eb=_0x2544eb-0x0;var _0x4484d0=_0xa501[_0x2544eb];return _0x4484d0;};'use strict';var _=require(_0x1a50('0x0'));var util=require('util');var moment=require(_0x1a50('0x1'));var BPromise=require(_0x1a50('0x2'));var rs=require(_0x1a50('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x1a50('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x1a50('0x5'));var jayson=require(_0x1a50('0x6'));var client=jayson[_0x1a50('0x7')][_0x1a50('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a9f58,_0x3816ac,_0x3f0381){return new BPromise(function(_0x366ba2,_0x46ecec){return client['request'](_0x1a9f58,_0x3f0381)[_0x1a50('0x9')](function(_0x4e90f9){logger['info'](_0x1a50('0xa'),_0x3816ac,'request\x20sent');logger['debug'](_0x1a50('0xb'),_0x3816ac,_0x1a50('0xc'),JSON[_0x1a50('0xd')](_0x4e90f9));if(_0x4e90f9[_0x1a50('0xe')]){if(_0x4e90f9[_0x1a50('0xe')]['code']===0x1f4){logger[_0x1a50('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x3816ac,_0x4e90f9[_0x1a50('0xe')]['message']);return _0x46ecec(_0x4e90f9[_0x1a50('0xe')][_0x1a50('0xf')]);}logger[_0x1a50('0xe')](_0x1a50('0xa'),_0x3816ac,_0x4e90f9[_0x1a50('0xe')][_0x1a50('0xf')]);return _0x366ba2(_0x4e90f9['error'][_0x1a50('0xf')]);}else{logger[_0x1a50('0x10')](_0x1a50('0xa'),_0x3816ac,_0x1a50('0xc'));_0x366ba2(_0x4e90f9[_0x1a50('0x11')][_0x1a50('0xf')]);}})[_0x1a50('0x12')](function(_0x1de937){logger['error'](_0x1a50('0xa'),_0x3816ac,_0x1de937);_0x46ecec(_0x1de937);});});}
\ No newline at end of file
index 551dd25..387bed9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c72=['create','put','update','destroy','multer','path','express','./faxTransferReport.controller','get','index','isAuthenticated','describe','/:id','show','post'];(function(_0x1c6330,_0x45f7ac){var _0x45613e=function(_0x5d0fa8){while(--_0x5d0fa8){_0x1c6330['push'](_0x1c6330['shift']());}};_0x45613e(++_0x45f7ac);}(_0x4c72,0x1e4));var _0x24c7=function(_0x1128a9,_0x174512){_0x1128a9=_0x1128a9-0x0;var _0x2e2e13=_0x4c72[_0x1128a9];return _0x2e2e13;};'use strict';var multer=require(_0x24c7('0x0'));var util=require('util');var path=require(_0x24c7('0x1'));var express=require(_0x24c7('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x24c7('0x3'));router[_0x24c7('0x4')]('/',auth['isAuthenticated'](),controller[_0x24c7('0x5')]);router['get']('/describe',auth[_0x24c7('0x6')](),controller[_0x24c7('0x7')]);router[_0x24c7('0x4')](_0x24c7('0x8'),auth['isAuthenticated'](),controller[_0x24c7('0x9')]);router[_0x24c7('0xa')]('/',auth[_0x24c7('0x6')](),controller[_0x24c7('0xb')]);router[_0x24c7('0xc')](_0x24c7('0x8'),auth[_0x24c7('0x6')](),controller[_0x24c7('0xd')]);router['delete'](_0x24c7('0x8'),auth[_0x24c7('0x6')](),controller[_0x24c7('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xa3b9=['post','create','put','delete','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x30e8c9,_0x51ee8f){var _0x4200c1=function(_0x56d74b){while(--_0x56d74b){_0x30e8c9['push'](_0x30e8c9['shift']());}};_0x4200c1(++_0x51ee8f);}(_0xa3b9,0x112));var _0x9a3b=function(_0x1268ed,_0x5721a7){_0x1268ed=_0x1268ed-0x0;var _0x184428=_0xa3b9[_0x1268ed];return _0x184428;};'use strict';var multer=require(_0x9a3b('0x0'));var util=require(_0x9a3b('0x1'));var path=require(_0x9a3b('0x2'));var express=require(_0x9a3b('0x3'));var router=express[_0x9a3b('0x4')]();var auth=require(_0x9a3b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9a3b('0x6'));var controller=require(_0x9a3b('0x7'));router[_0x9a3b('0x8')]('/',auth[_0x9a3b('0x9')](),controller[_0x9a3b('0xa')]);router['get']('/describe',auth[_0x9a3b('0x9')](),controller[_0x9a3b('0xb')]);router[_0x9a3b('0x8')](_0x9a3b('0xc'),auth[_0x9a3b('0x9')](),controller[_0x9a3b('0xd')]);router[_0x9a3b('0xe')]('/',auth['isAuthenticated'](),controller[_0x9a3b('0xf')]);router[_0x9a3b('0x10')](_0x9a3b('0xc'),auth[_0x9a3b('0x9')](),controller['update']);router[_0x9a3b('0x11')](_0x9a3b('0xc'),auth[_0x9a3b('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index a9a4989..ab36c85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5636=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','update','delete','exports','multer','util','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x4e664c,_0x47abb9){var _0x5f3913=function(_0x3a205f){while(--_0x3a205f){_0x4e664c['push'](_0x4e664c['shift']());}};_0x5f3913(++_0x47abb9);}(_0x5636,0x102));var _0x6563=function(_0x3fd709,_0x2aa620){_0x3fd709=_0x3fd709-0x0;var _0x53c4fe=_0x5636[_0x3fd709];return _0x53c4fe;};'use strict';var multer=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var path=require('path');var express=require('express');var router=express['Router']();var auth=require(_0x6563('0x2'));var interaction=require(_0x6563('0x3'));var config=require(_0x6563('0x4'));var controller=require('./intDeskAccount.controller');router[_0x6563('0x5')]('/',auth[_0x6563('0x6')](),controller[_0x6563('0x7')]);router[_0x6563('0x5')](_0x6563('0x8'),auth[_0x6563('0x6')](),controller[_0x6563('0x9')]);router[_0x6563('0x5')](_0x6563('0xa'),auth[_0x6563('0x6')](),controller[_0x6563('0xb')]);router[_0x6563('0x5')](_0x6563('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0x6563('0xd')]('/',auth[_0x6563('0x6')](),controller['create']);router['post']('/:id/configurations',auth[_0x6563('0x6')](),controller[_0x6563('0xe')]);router[_0x6563('0xf')](_0x6563('0x8'),auth[_0x6563('0x6')](),controller[_0x6563('0x10')]);router[_0x6563('0x11')](_0x6563('0x8'),auth[_0x6563('0x6')](),controller['destroy']);module[_0x6563('0x12')]=router;
\ No newline at end of file
+var _0xd2ea=['util','path','express','Router','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','/:id','delete','multer'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd2ea,0x15f));var _0xad2e=function(_0x2d7ade,_0x577eb8){_0x2d7ade=_0x2d7ade-0x0;var _0x31393c=_0xd2ea[_0x2d7ade];return _0x31393c;};'use strict';var multer=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var path=require(_0xad2e('0x2'));var express=require(_0xad2e('0x3'));var router=express[_0xad2e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xad2e('0x5'));var config=require(_0xad2e('0x6'));var controller=require(_0xad2e('0x7'));router[_0xad2e('0x8')]('/',auth[_0xad2e('0x9')](),controller[_0xad2e('0xa')]);router[_0xad2e('0x8')]('/:id',auth[_0xad2e('0x9')](),controller[_0xad2e('0xb')]);router[_0xad2e('0x8')]('/:id/configurations',auth[_0xad2e('0x9')](),controller[_0xad2e('0xc')]);router['get'](_0xad2e('0xd'),auth['isAuthenticated'](),controller[_0xad2e('0xe')]);router[_0xad2e('0xf')]('/',auth[_0xad2e('0x9')](),controller[_0xad2e('0x10')]);router['post'](_0xad2e('0x11'),auth['isAuthenticated'](),controller[_0xad2e('0x12')]);router[_0xad2e('0x13')](_0xad2e('0x14'),auth[_0xad2e('0x9')](),controller['update']);router[_0xad2e('0x15')]('/:id',auth[_0xad2e('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 321c5bb..d09f4c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2250=['newTab','integrationTab','sequelize','STRING','ENUM','basic'];(function(_0x5a9205,_0x23a272){var _0x42f51d=function(_0x5de0b6){while(--_0x5de0b6){_0x5a9205['push'](_0x5a9205['shift']());}};_0x42f51d(++_0x23a272);}(_0x2250,0x9e));var _0x0225=function(_0x4f0217,_0x29aa7e){_0x4f0217=_0x4f0217-0x0;var _0x4da152=_0x2250[_0x4f0217];return _0x4da152;};'use strict';var Sequelize=require(_0x0225('0x0'));module['exports']={'name':{'type':Sequelize[_0x0225('0x1')]},'description':{'type':Sequelize[_0x0225('0x1')]},'username':{'type':Sequelize[_0x0225('0x1')]},'remoteUri':{'type':Sequelize[_0x0225('0x1')]},'authType':{'type':Sequelize[_0x0225('0x2')](_0x0225('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x0225('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x0225('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x0225('0x1')]},'serverUrl':{'type':Sequelize[_0x0225('0x1')]},'type':{'type':Sequelize[_0x0225('0x2')]('integrationTab',_0x0225('0x4')),'defaultValue':_0x0225('0x5')}};
\ No newline at end of file
+var _0x6943=['exports','STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0x541936,_0xaac3c3){var _0x310416=function(_0x1e69a7){while(--_0x1e69a7){_0x541936['push'](_0x541936['shift']());}};_0x310416(++_0xaac3c3);}(_0x6943,0x1e2));var _0x3694=function(_0x5c5c52,_0x36d085){_0x5c5c52=_0x5c5c52-0x0;var _0x4229ff=_0x6943[_0x5c5c52];return _0x4229ff;};'use strict';var Sequelize=require(_0x3694('0x0'));module[_0x3694('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3694('0x2')]},'username':{'type':Sequelize[_0x3694('0x2')]},'remoteUri':{'type':Sequelize[_0x3694('0x2')]},'authType':{'type':Sequelize[_0x3694('0x3')](_0x3694('0x4')),'defaultValue':_0x3694('0x4')},'password':{'type':Sequelize[_0x3694('0x2')]},'consumerKey':{'type':Sequelize[_0x3694('0x2')]},'consumerSecret':{'type':Sequelize[_0x3694('0x2')]},'token':{'type':Sequelize[_0x3694('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x3694('0x2')]},'type':{'type':Sequelize[_0x3694('0x3')](_0x3694('0x5'),_0x3694('0x6')),'defaultValue':_0x3694('0x5')}};
\ No newline at end of file
index 5d11efc..df1df59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe77c=['label','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','request','then','info','DeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','add','day','merge','filter','map','options','DeskAccount','includeAll','findAll','show','length','include','find','create','body','params','destroy','getConfigurations','DeskConfiguration','order','pick','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','type','DeskField','Descriptions','getFields','priority','authType','username','password','consumerSecret','token','tokenSecret','GET','format','%s/custom_fields','remoteUri','application/json','headers','Authorization','Basic\x20%s','toString','base64','concat','_embedded','entries','active'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xe77c,0x176));var _0xce77=function(_0x450e11,_0x3e53cd){_0x450e11=_0x450e11-0x0;var _0x426dd4=_0xe77c[_0x450e11];return _0x426dd4;};'use strict';var pdf=require(_0xce77('0x0'));var emlformat=require(_0xce77('0x1'));var rimraf=require(_0xce77('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xce77('0x3'));var rp=require(_0xce77('0x4'));var moment=require(_0xce77('0x5'));var BPromise=require(_0xce77('0x6'));var Mustache=require(_0xce77('0x7'));var util=require(_0xce77('0x8'));var path=require(_0xce77('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xce77('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xce77('0xb'));var crypto=require(_0xce77('0xc'));var jsforce=require(_0xce77('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xce77('0xe'));var querystring=require(_0xce77('0xf'));var Papa=require(_0xce77('0x10'));var qs=require(_0xce77('0x11'));var logger=require(_0xce77('0x12'))('api');var utils=require(_0xce77('0x13'));var config=require('../../config/environment');var db=require(_0xce77('0x14'))['db'];var integrations=require(_0xce77('0x15'));var jayson=require(_0xce77('0x16'));var client=jayson['client'][_0xce77('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x5600df,_0x564d7f,_0x4a8b8e,_0x5e1cdb){return new BPromise(function(_0xac18ec,_0x558764){var _0x443b30=_0x5e1cdb||client;return _0x443b30[_0xce77('0x18')](_0x5600df,_0x4a8b8e)[_0xce77('0x19')](function(_0x1e964f){logger[_0xce77('0x1a')](_0xce77('0x1b'),_0x564d7f,'request\x20sent');logger[_0xce77('0x1c')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x564d7f,_0xce77('0x1d'),JSON[_0xce77('0x1e')](_0x1e964f));if(_0x1e964f[_0xce77('0x1f')]){if(_0x1e964f['error'][_0xce77('0x20')]===0x1f4){logger[_0xce77('0x1f')](_0xce77('0x1b'),_0x564d7f,_0x1e964f[_0xce77('0x1f')][_0xce77('0x21')]);return _0x558764(_0x1e964f['error'][_0xce77('0x21')]);}logger['error'](_0xce77('0x1b'),_0x564d7f,_0x1e964f[_0xce77('0x1f')][_0xce77('0x21')]);return _0xac18ec(_0x1e964f[_0xce77('0x1f')]['message']);}else{logger[_0xce77('0x1a')](_0xce77('0x1b'),_0x564d7f,_0xce77('0x1d'));_0xac18ec(_0x1e964f[_0xce77('0x22')]['message']);}})[_0xce77('0x23')](function(_0x5b3c75){logger[_0xce77('0x1f')](_0xce77('0x1b'),_0x564d7f,_0x5b3c75);_0x558764(_0x5b3c75);});});}function respondWithStatusCode(_0x490ce3,_0x363bd5){_0x363bd5=_0x363bd5||0xcc;return function(_0x414aa9){if(_0x414aa9){return _0x490ce3['sendStatus'](_0x363bd5);}return _0x490ce3[_0xce77('0x24')](_0x363bd5)[_0xce77('0x25')]();};}function respondWithResult(_0x3ffd4a,_0x592c61){_0x592c61=_0x592c61||0xc8;return function(_0x55c108){if(_0x55c108){return _0x3ffd4a[_0xce77('0x24')](_0x592c61)[_0xce77('0x26')](_0x55c108);}};}function respondWithFilteredResult(_0x223511,_0x14f4b8){return function(_0x580994){if(_0x580994){var _0x56bb75=_0x580994[_0xce77('0x27')],_0x471b79=_0x14f4b8[_0xce77('0x28')],_0x3b6a61=_0x14f4b8[_0xce77('0x28')]+_0x14f4b8[_0xce77('0x29')],_0xa9b7cf;if(_0x3b6a61>=_0x56bb75){_0x3b6a61=_0x56bb75;_0xa9b7cf=0xc8;}else{_0xa9b7cf=0xce;}_0x223511['status'](_0xa9b7cf);return _0x223511[_0xce77('0x2a')](_0xce77('0x2b'),_0x471b79+'-'+_0x3b6a61+'/'+_0x56bb75)[_0xce77('0x26')](_0x580994);}return null;};}function patchUpdates(_0x231aac){return function(_0x4d0466){try{jsonpatch[_0xce77('0x2c')](_0x4d0466,_0x231aac,!![]);}catch(_0x19fddb){return BPromise[_0xce77('0x2d')](_0x19fddb);}return _0x4d0466[_0xce77('0x2e')]();};}function saveUpdates(_0x5a9d58,_0xdac34){return function(_0x11ac42){if(_0x11ac42){return _0x11ac42[_0xce77('0x2f')](_0x5a9d58)[_0xce77('0x19')](function(_0x1720e2){return _0x1720e2;});}return null;};}function removeEntity(_0x495f08,_0x49aedd){return function(_0x358b54){if(_0x358b54){return _0x358b54['destroy']()[_0xce77('0x19')](function(){_0x495f08[_0xce77('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38bf0f,_0x265d1f){return function(_0x4cb45c){if(!_0x4cb45c){_0x38bf0f['sendStatus'](0x194);}return _0x4cb45c;};}function handleError(_0x5ea492,_0x29b764){_0x29b764=_0x29b764||0x1f4;return function(_0x572332){logger[_0xce77('0x1f')](_0x572332[_0xce77('0x30')]);if(_0x572332[_0xce77('0x31')]){delete _0x572332[_0xce77('0x31')];}_0x5ea492['status'](_0x29b764)[_0xce77('0x32')](_0x572332);};}exports[_0xce77('0x33')]=function(_0x38797c,_0x280161){var _0x419752={},_0x219920={},_0x5c0019={'count':0x0,'rows':[]};var _0xf28986=db['DeskAccount'][_0xce77('0x34')];_0x219920[_0xce77('0x35')]=_[_0xce77('0x36')](_0xf28986);var _0x2acc03={'dateStart':_0x38797c[_0xce77('0x37')][_0xce77('0x38')],'dateEnd':_0x38797c[_0xce77('0x37')][_0xce77('0x39')]};delete _0x38797c[_0xce77('0x37')][_0xce77('0x38')];delete _0x38797c[_0xce77('0x37')][_0xce77('0x39')];_0x219920['query']=_[_0xce77('0x36')](_0x38797c[_0xce77('0x37')]);_0x219920['filters']=_[_0xce77('0x3a')](_0x219920[_0xce77('0x35')],_0x219920[_0xce77('0x37')]);_0x419752[_0xce77('0x3b')]=_[_0xce77('0x3a')](_0x219920['model'],qs['fields'](_0x38797c[_0xce77('0x37')][_0xce77('0x3c')]));_0x419752[_0xce77('0x3b')]=_0x419752[_0xce77('0x3b')]['length']?_0x419752[_0xce77('0x3b')]:_0x219920['model'];if(!_0x38797c['query'][_0xce77('0x3d')](_0xce77('0x3e'))){_0x419752[_0xce77('0x29')]=qs['limit'](_0x38797c[_0xce77('0x37')][_0xce77('0x29')]);_0x419752[_0xce77('0x28')]=qs['offset'](_0x38797c[_0xce77('0x37')][_0xce77('0x28')]);}_0x419752['order']=qs[_0xce77('0x3f')](_0x38797c['query'][_0xce77('0x3f')]);_0x419752[_0xce77('0x40')]=qs['filters'](_['pick'](_0x38797c['query'],_0x219920[_0xce77('0x41')]));if(_0x2acc03['dateStart']){if(_0x2acc03[_0xce77('0x39')]){_0x2acc03[_0xce77('0x39')]=moment(_0x2acc03[_0xce77('0x39')])[_0xce77('0x42')](0x1,'day');}else{_0x2acc03['dateEnd']=moment(_0x2acc03[_0xce77('0x38')])['add'](0x1,_0xce77('0x43'));}_[_0xce77('0x44')](_0x419752[_0xce77('0x40')],{'createdAt':{'$gte':_0x2acc03['dateStart'],'$lte':_0x2acc03[_0xce77('0x39')]}});}if(_0x38797c[_0xce77('0x37')][_0xce77('0x45')]){_0x419752[_0xce77('0x40')]=_[_0xce77('0x44')](_0x419752[_0xce77('0x40')],{'$or':_[_0xce77('0x46')](_0x419752['attributes'],function(_0x6ea82e){var _0x914d69={};_0x914d69[_0x6ea82e]={'$like':'%'+_0x38797c['query']['filter']+'%'};return _0x914d69;})});}_0x419752=_[_0xce77('0x44')]({},_0x419752,_0x38797c[_0xce77('0x47')]);var _0x5bb9fa={'where':_0x419752[_0xce77('0x40')]};return db[_0xce77('0x48')][_0xce77('0x27')](_0x5bb9fa)[_0xce77('0x19')](function(_0x4f8b83){_0x5c0019['count']=_0x4f8b83;if(_0x38797c[_0xce77('0x37')][_0xce77('0x49')]){_0x419752['include']=[{'all':!![]}];}return db[_0xce77('0x48')][_0xce77('0x4a')](_0x419752);})[_0xce77('0x19')](function(_0x35bc35){_0x5c0019['rows']=_0x35bc35;return _0x5c0019;})[_0xce77('0x19')](respondWithFilteredResult(_0x280161,_0x419752))[_0xce77('0x23')](handleError(_0x280161,null));};exports[_0xce77('0x4b')]=function(_0x384c4d,_0x9ffe8e){var _0x4d382a={'raw':![],'where':{'id':_0x384c4d['params']['id']}},_0x5e95bd={};_0x5e95bd[_0xce77('0x35')]=_['keys'](db[_0xce77('0x48')][_0xce77('0x34')]);_0x5e95bd[_0xce77('0x37')]=_[_0xce77('0x36')](_0x384c4d[_0xce77('0x37')]);_0x5e95bd[_0xce77('0x41')]=_[_0xce77('0x3a')](_0x5e95bd[_0xce77('0x35')],_0x5e95bd[_0xce77('0x37')]);_0x4d382a[_0xce77('0x3b')]=_['intersection'](_0x5e95bd[_0xce77('0x35')],qs[_0xce77('0x3c')](_0x384c4d[_0xce77('0x37')][_0xce77('0x3c')]));_0x4d382a[_0xce77('0x3b')]=_0x4d382a[_0xce77('0x3b')][_0xce77('0x4c')]?_0x4d382a[_0xce77('0x3b')]:_0x5e95bd[_0xce77('0x35')];if(_0x384c4d[_0xce77('0x37')]['includeAll']){_0x4d382a[_0xce77('0x4d')]=[{'all':!![]}];}_0x4d382a=_[_0xce77('0x44')]({},_0x4d382a,_0x384c4d[_0xce77('0x47')]);return db[_0xce77('0x48')][_0xce77('0x4e')](_0x4d382a)[_0xce77('0x19')](handleEntityNotFound(_0x9ffe8e,null))['then'](respondWithResult(_0x9ffe8e,null))[_0xce77('0x23')](handleError(_0x9ffe8e,null));};exports[_0xce77('0x4f')]=function(_0xd80996,_0x18ffc5){return db[_0xce77('0x48')][_0xce77('0x4f')](_0xd80996['body'],{})[_0xce77('0x19')](respondWithResult(_0x18ffc5,0xc9))[_0xce77('0x23')](handleError(_0x18ffc5,null));};exports['update']=function(_0x5341a5,_0x472b8f){if(_0x5341a5[_0xce77('0x50')]['id']){delete _0x5341a5[_0xce77('0x50')]['id'];}return db[_0xce77('0x48')][_0xce77('0x4e')]({'where':{'id':_0x5341a5[_0xce77('0x51')]['id']}})[_0xce77('0x19')](handleEntityNotFound(_0x472b8f,null))[_0xce77('0x19')](saveUpdates(_0x5341a5[_0xce77('0x50')],null))['then'](respondWithResult(_0x472b8f,null))[_0xce77('0x23')](handleError(_0x472b8f,null));};exports[_0xce77('0x52')]=function(_0x4d6487,_0x5cd1f3){return db[_0xce77('0x48')][_0xce77('0x4e')]({'where':{'id':_0x4d6487[_0xce77('0x51')]['id']}})[_0xce77('0x19')](handleEntityNotFound(_0x5cd1f3,null))[_0xce77('0x19')](removeEntity(_0x5cd1f3,null))[_0xce77('0x23')](handleError(_0x5cd1f3,null));};exports[_0xce77('0x53')]=function(_0x4b49ad,_0x52acdb,_0x120359){var _0x1670d1={};var _0xd27519={};var _0x3c06f0;var _0x106bbf;return db[_0xce77('0x48')]['findOne']({'where':{'id':_0x4b49ad[_0xce77('0x51')]['id']}})[_0xce77('0x19')](handleEntityNotFound(_0x52acdb,null))[_0xce77('0x19')](function(_0xc2ef00){if(_0xc2ef00){_0x3c06f0=_0xc2ef00;_0xd27519[_0xce77('0x35')]=_[_0xce77('0x36')](db[_0xce77('0x54')][_0xce77('0x34')]);_0xd27519[_0xce77('0x37')]=_[_0xce77('0x36')](_0x4b49ad[_0xce77('0x37')]);_0xd27519[_0xce77('0x41')]=_[_0xce77('0x3a')](_0xd27519[_0xce77('0x35')],_0xd27519[_0xce77('0x37')]);_0x1670d1[_0xce77('0x3b')]=_[_0xce77('0x3a')](_0xd27519[_0xce77('0x35')],qs[_0xce77('0x3c')](_0x4b49ad['query'][_0xce77('0x3c')]));_0x1670d1[_0xce77('0x3b')]=_0x1670d1['attributes'][_0xce77('0x4c')]?_0x1670d1[_0xce77('0x3b')]:_0xd27519['model'];_0x1670d1[_0xce77('0x55')]=qs['sort'](_0x4b49ad['query'][_0xce77('0x3f')]);_0x1670d1[_0xce77('0x40')]=qs[_0xce77('0x41')](_[_0xce77('0x56')](_0x4b49ad[_0xce77('0x37')],_0xd27519[_0xce77('0x41')]));if(_0x4b49ad[_0xce77('0x37')][_0xce77('0x45')]){_0x1670d1[_0xce77('0x40')]=_[_0xce77('0x44')](_0x1670d1[_0xce77('0x40')],{'$or':_[_0xce77('0x46')](_0x1670d1[_0xce77('0x3b')],function(_0x3d55dd){var _0x4f8cc1={};_0x4f8cc1[_0x3d55dd]={'$like':'%'+_0x4b49ad[_0xce77('0x37')][_0xce77('0x45')]+'%'};return _0x4f8cc1;})});}_0x1670d1=_['merge']({},_0x1670d1,_0x4b49ad[_0xce77('0x47')]);return _0x3c06f0['getConfigurations'](_0x1670d1);}})['then'](function(_0x5e648a){if(_0x5e648a){_0x106bbf=_0x5e648a['length'];if(!_0x4b49ad[_0xce77('0x37')][_0xce77('0x3d')](_0xce77('0x3e'))){_0x1670d1[_0xce77('0x29')]=qs[_0xce77('0x29')](_0x4b49ad[_0xce77('0x37')][_0xce77('0x29')]);_0x1670d1[_0xce77('0x28')]=qs['offset'](_0x4b49ad[_0xce77('0x37')]['offset']);}return _0x3c06f0['getConfigurations'](_0x1670d1);}})['then'](function(_0x25f9e2){if(_0x25f9e2){return _0x25f9e2?{'count':_0x106bbf,'rows':_0x25f9e2}:null;}})[_0xce77('0x19')](respondWithResult(_0x52acdb,null))['catch'](handleError(_0x52acdb,null));};exports[_0xce77('0x57')]=function(_0x31d0c0,_0x8fd315,_0x95c2c2){if(_0x31d0c0[_0xce77('0x50')]['id']){delete _0x31d0c0[_0xce77('0x50')]['id'];}return db['DeskAccount'][_0xce77('0x58')]({'where':{'id':_0x31d0c0[_0xce77('0x51')]['id']}})[_0xce77('0x19')](handleEntityNotFound(_0x8fd315,null))[_0xce77('0x19')](function(_0x3b93b8){if(_0x3b93b8){_0x31d0c0['body'][_0xce77('0x59')]=_0x3b93b8['id'];_0x31d0c0[_0xce77('0x50')][_0xce77('0x5a')]=integrations[_0xce77('0x5b')](_0x31d0c0[_0xce77('0x50')][_0xce77('0x5c')],_0x31d0c0['body'][_0xce77('0x5d')]);_0x31d0c0[_0xce77('0x50')]['Descriptions']=integrations['getDescriptions'](_0x31d0c0[_0xce77('0x50')]['channel'],_0x31d0c0[_0xce77('0x50')][_0xce77('0x5d')]);return db['DeskConfiguration']['create'](_0x31d0c0['body'],{'include':[{'model':db[_0xce77('0x5e')],'as':_0xce77('0x5a')},{'model':db['DeskField'],'as':_0xce77('0x5f')}]});}return null;})[_0xce77('0x19')](respondWithResult(_0x8fd315,null))[_0xce77('0x23')](handleError(_0x8fd315,null));};exports[_0xce77('0x60')]=function(_0x592227,_0x31138d,_0x1e7618){var _0x4358fb=[{'name':_0xce77('0x61'),'label':_0xce77('0x61'),'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}]}];return db[_0xce77('0x48')][_0xce77('0x58')]({'where':{'id':_0x592227['params']['id']},'attributes':['id','remoteUri',_0xce77('0x62'),_0xce77('0x63'),_0xce77('0x64'),'consumerKey',_0xce77('0x65'),_0xce77('0x66'),_0xce77('0x67')]})[_0xce77('0x19')](handleEntityNotFound(_0x31138d,null))[_0xce77('0x19')](function(_0x1d023a){if(_0x1d023a){var _0x10c702={'method':_0xce77('0x68'),'uri':util[_0xce77('0x69')](_0xce77('0x6a'),_0x1d023a[_0xce77('0x6b')]),'headers':{'Content-Type':'application/json','Accept':_0xce77('0x6c')},'json':!![]};if(_0x1d023a[_0xce77('0x62')]==='basic'){_0x10c702[_0xce77('0x6d')][_0xce77('0x6e')]=util['format'](_0xce77('0x6f'),new Buffer(util[_0xce77('0x69')]('%s:%s',_0x1d023a['username'],_0x1d023a[_0xce77('0x64')]))[_0xce77('0x70')](_0xce77('0x71')));}return rp(_0x10c702)[_0xce77('0x19')](function(_0x48631b){return _0x4358fb[_0xce77('0x72')](_[_0xce77('0x46')](_0x48631b[_0xce77('0x73')][_0xce77('0x74')],function(_0x1a1849){return{'id':_0x1a1849[_0xce77('0x31')],'name':_0x1a1849[_0xce77('0x31')],'type':_0x1a1849[_0xce77('0x5d')],'active':_0x1a1849[_0xce77('0x75')],'label':_0x1a1849[_0xce77('0x76')],'custom':!![]};}));});}})[_0xce77('0x19')](function(_0x5df361){return{'count':_0x5df361[_0xce77('0x4c')],'rows':_0x5df361};})['then'](respondWithResult(_0x31138d,null))[_0xce77('0x23')](function(_0x433af7){var _0x257f09=_0x592227[_0xce77('0x37')][_0xce77('0x77')]?0x1f4:_0x433af7['statusCode']||0x1f4;logger['error'](_0xce77('0x78'),_0xce77('0x60'),_0x257f09,JSON[_0xce77('0x1e')](_0x433af7));delete _0x433af7['name'];if(_0x257f09===0x191){_0x257f09=0x190;}_0x31138d[_0xce77('0x24')](_0x257f09)[_0xce77('0x32')](_0x592227[_0xce77('0x37')][_0xce77('0x77')]?{'message':_0xce77('0x79'),'statusCode':_0x433af7[_0xce77('0x7a')]}:_0x433af7);});};
\ No newline at end of file
+var _0x1df7=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','json','count','offset','Content-Range','apply','reject','save','update','stack','name','index','model','keys','query','dateEnd','filters','intersection','attributes','fields','limit','order','sort','add','dateStart','day','merge','where','filter','map','options','DeskAccount','includeAll','findAll','rows','catch','params','rawAttributes','length','find','create','body','getConfigurations','findOne','DeskConfiguration','pick','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','username','password','consumerKey','token','tokenSecret','GET','%s/custom_fields','application/json','authType','Authorization','format','%s:%s','toString','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3a73bc,_0x550aef){var _0x32891b=function(_0x20b4cb){while(--_0x20b4cb){_0x3a73bc['push'](_0x3a73bc['shift']());}};_0x32891b(++_0x550aef);}(_0x1df7,0x6e));var _0x71df=function(_0x4c70ec,_0x3823ee){_0x4c70ec=_0x4c70ec-0x0;var _0x5bc825=_0x1df7[_0x4c70ec];return _0x5bc825;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x71df('0x0'));var rimraf=require(_0x71df('0x1'));var zipdir=require(_0x71df('0x2'));var jsonpatch=require(_0x71df('0x3'));var rp=require(_0x71df('0x4'));var moment=require(_0x71df('0x5'));var BPromise=require(_0x71df('0x6'));var Mustache=require(_0x71df('0x7'));var util=require(_0x71df('0x8'));var path=require(_0x71df('0x9'));var sox=require(_0x71df('0xa'));var csv=require(_0x71df('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x71df('0xc'));var squel=require('squel');var crypto=require(_0x71df('0xd'));var jsforce=require(_0x71df('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x71df('0xb'));var querystring=require('querystring');var Papa=require(_0x71df('0xf'));var qs=require(_0x71df('0x10'));var logger=require('../../config/logger')(_0x71df('0x11'));var utils=require(_0x71df('0x12'));var config=require(_0x71df('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0x71df('0x14'));var jayson=require(_0x71df('0x15'));var client=jayson['client'][_0x71df('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x349233,_0xca1e85,_0x5d5776,_0x50de5b){return new BPromise(function(_0x43cae3,_0x1374cc){var _0x4ae2f4=_0x50de5b||client;return _0x4ae2f4[_0x71df('0x17')](_0x349233,_0x5d5776)[_0x71df('0x18')](function(_0x420bac){logger[_0x71df('0x19')](_0x71df('0x1a'),_0xca1e85,_0x71df('0x1b'));logger[_0x71df('0x1c')](_0x71df('0x1d'),_0xca1e85,_0x71df('0x1b'),JSON[_0x71df('0x1e')](_0x420bac));if(_0x420bac[_0x71df('0x1f')]){if(_0x420bac[_0x71df('0x1f')]['code']===0x1f4){logger[_0x71df('0x1f')](_0x71df('0x1a'),_0xca1e85,_0x420bac[_0x71df('0x1f')][_0x71df('0x20')]);return _0x1374cc(_0x420bac['error'][_0x71df('0x20')]);}logger[_0x71df('0x1f')](_0x71df('0x1a'),_0xca1e85,_0x420bac[_0x71df('0x1f')][_0x71df('0x20')]);return _0x43cae3(_0x420bac['error'][_0x71df('0x20')]);}else{logger[_0x71df('0x19')](_0x71df('0x1a'),_0xca1e85,'request\x20sent');_0x43cae3(_0x420bac[_0x71df('0x21')]['message']);}})['catch'](function(_0x3baf4c){logger['error']('DeskAccount,\x20%s,\x20%s',_0xca1e85,_0x3baf4c);_0x1374cc(_0x3baf4c);});});}function respondWithStatusCode(_0x416933,_0x38eccf){_0x38eccf=_0x38eccf||0xcc;return function(_0x59ab74){if(_0x59ab74){return _0x416933[_0x71df('0x22')](_0x38eccf);}return _0x416933[_0x71df('0x23')](_0x38eccf)['end']();};}function respondWithResult(_0x9f23ea,_0x2cda51){_0x2cda51=_0x2cda51||0xc8;return function(_0x2bb449){if(_0x2bb449){return _0x9f23ea[_0x71df('0x23')](_0x2cda51)[_0x71df('0x24')](_0x2bb449);}};}function respondWithFilteredResult(_0x4e7b46,_0x2c8ca6){return function(_0x295a67){if(_0x295a67){var _0x592ee2=_0x295a67[_0x71df('0x25')],_0x2c0b8d=_0x2c8ca6[_0x71df('0x26')],_0x5d1c52=_0x2c8ca6['offset']+_0x2c8ca6['limit'],_0xcbf773;if(_0x5d1c52>=_0x592ee2){_0x5d1c52=_0x592ee2;_0xcbf773=0xc8;}else{_0xcbf773=0xce;}_0x4e7b46[_0x71df('0x23')](_0xcbf773);return _0x4e7b46['set'](_0x71df('0x27'),_0x2c0b8d+'-'+_0x5d1c52+'/'+_0x592ee2)[_0x71df('0x24')](_0x295a67);}return null;};}function patchUpdates(_0x15fdb0){return function(_0x45c813){try{jsonpatch[_0x71df('0x28')](_0x45c813,_0x15fdb0,!![]);}catch(_0x48fb25){return BPromise[_0x71df('0x29')](_0x48fb25);}return _0x45c813[_0x71df('0x2a')]();};}function saveUpdates(_0x42f69a,_0x9b7d8){return function(_0x583799){if(_0x583799){return _0x583799[_0x71df('0x2b')](_0x42f69a)['then'](function(_0x14e6df){return _0x14e6df;});}return null;};}function removeEntity(_0x87dbe8,_0x283d96){return function(_0xc818e4){if(_0xc818e4){return _0xc818e4['destroy']()[_0x71df('0x18')](function(){_0x87dbe8[_0x71df('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x115d9b,_0x382bce){return function(_0x4d0c55){if(!_0x4d0c55){_0x115d9b[_0x71df('0x22')](0x194);}return _0x4d0c55;};}function handleError(_0x352b7c,_0x43b8f4){_0x43b8f4=_0x43b8f4||0x1f4;return function(_0x207b14){logger[_0x71df('0x1f')](_0x207b14[_0x71df('0x2c')]);if(_0x207b14[_0x71df('0x2d')]){delete _0x207b14[_0x71df('0x2d')];}_0x352b7c[_0x71df('0x23')](_0x43b8f4)['send'](_0x207b14);};}exports[_0x71df('0x2e')]=function(_0x4c8552,_0x3a39f9){var _0x45e3c4={},_0x557410={},_0x3a26ea={'count':0x0,'rows':[]};var _0xd3cc67=db['DeskAccount']['rawAttributes'];_0x557410[_0x71df('0x2f')]=_[_0x71df('0x30')](_0xd3cc67);var _0x3957fc={'dateStart':_0x4c8552[_0x71df('0x31')]['dateStart'],'dateEnd':_0x4c8552[_0x71df('0x31')][_0x71df('0x32')]};delete _0x4c8552[_0x71df('0x31')]['dateStart'];delete _0x4c8552['query']['dateEnd'];_0x557410['query']=_['keys'](_0x4c8552[_0x71df('0x31')]);_0x557410[_0x71df('0x33')]=_[_0x71df('0x34')](_0x557410[_0x71df('0x2f')],_0x557410['query']);_0x45e3c4[_0x71df('0x35')]=_[_0x71df('0x34')](_0x557410[_0x71df('0x2f')],qs['fields'](_0x4c8552[_0x71df('0x31')][_0x71df('0x36')]));_0x45e3c4[_0x71df('0x35')]=_0x45e3c4[_0x71df('0x35')]['length']?_0x45e3c4[_0x71df('0x35')]:_0x557410['model'];if(!_0x4c8552[_0x71df('0x31')]['hasOwnProperty']('nolimit')){_0x45e3c4[_0x71df('0x37')]=qs[_0x71df('0x37')](_0x4c8552['query'][_0x71df('0x37')]);_0x45e3c4['offset']=qs[_0x71df('0x26')](_0x4c8552['query'][_0x71df('0x26')]);}_0x45e3c4[_0x71df('0x38')]=qs[_0x71df('0x39')](_0x4c8552[_0x71df('0x31')]['sort']);_0x45e3c4['where']=qs[_0x71df('0x33')](_['pick'](_0x4c8552[_0x71df('0x31')],_0x557410[_0x71df('0x33')]));if(_0x3957fc['dateStart']){if(_0x3957fc[_0x71df('0x32')]){_0x3957fc[_0x71df('0x32')]=moment(_0x3957fc['dateEnd'])[_0x71df('0x3a')](0x1,'day');}else{_0x3957fc['dateEnd']=moment(_0x3957fc[_0x71df('0x3b')])[_0x71df('0x3a')](0x1,_0x71df('0x3c'));}_[_0x71df('0x3d')](_0x45e3c4[_0x71df('0x3e')],{'createdAt':{'$gte':_0x3957fc['dateStart'],'$lte':_0x3957fc[_0x71df('0x32')]}});}if(_0x4c8552['query'][_0x71df('0x3f')]){_0x45e3c4[_0x71df('0x3e')]=_[_0x71df('0x3d')](_0x45e3c4[_0x71df('0x3e')],{'$or':_[_0x71df('0x40')](_0x45e3c4[_0x71df('0x35')],function(_0xfee3ae){var _0x32ff34={};_0x32ff34[_0xfee3ae]={'$like':'%'+_0x4c8552[_0x71df('0x31')][_0x71df('0x3f')]+'%'};return _0x32ff34;})});}_0x45e3c4=_['merge']({},_0x45e3c4,_0x4c8552[_0x71df('0x41')]);var _0xd8a813={'where':_0x45e3c4[_0x71df('0x3e')]};return db[_0x71df('0x42')][_0x71df('0x25')](_0xd8a813)['then'](function(_0x4ce38c){_0x3a26ea[_0x71df('0x25')]=_0x4ce38c;if(_0x4c8552['query'][_0x71df('0x43')]){_0x45e3c4['include']=[{'all':!![]}];}return db[_0x71df('0x42')][_0x71df('0x44')](_0x45e3c4);})[_0x71df('0x18')](function(_0x4e1bd7){_0x3a26ea[_0x71df('0x45')]=_0x4e1bd7;return _0x3a26ea;})[_0x71df('0x18')](respondWithFilteredResult(_0x3a39f9,_0x45e3c4))[_0x71df('0x46')](handleError(_0x3a39f9,null));};exports['show']=function(_0x3e822f,_0x55f2f8){var _0x3ca940={'raw':![],'where':{'id':_0x3e822f[_0x71df('0x47')]['id']}},_0x1c69ff={};_0x1c69ff[_0x71df('0x2f')]=_['keys'](db['DeskAccount'][_0x71df('0x48')]);_0x1c69ff['query']=_[_0x71df('0x30')](_0x3e822f[_0x71df('0x31')]);_0x1c69ff[_0x71df('0x33')]=_[_0x71df('0x34')](_0x1c69ff['model'],_0x1c69ff['query']);_0x3ca940[_0x71df('0x35')]=_['intersection'](_0x1c69ff[_0x71df('0x2f')],qs[_0x71df('0x36')](_0x3e822f[_0x71df('0x31')][_0x71df('0x36')]));_0x3ca940[_0x71df('0x35')]=_0x3ca940[_0x71df('0x35')][_0x71df('0x49')]?_0x3ca940[_0x71df('0x35')]:_0x1c69ff[_0x71df('0x2f')];if(_0x3e822f[_0x71df('0x31')][_0x71df('0x43')]){_0x3ca940['include']=[{'all':!![]}];}_0x3ca940=_[_0x71df('0x3d')]({},_0x3ca940,_0x3e822f[_0x71df('0x41')]);return db[_0x71df('0x42')][_0x71df('0x4a')](_0x3ca940)[_0x71df('0x18')](handleEntityNotFound(_0x55f2f8,null))[_0x71df('0x18')](respondWithResult(_0x55f2f8,null))['catch'](handleError(_0x55f2f8,null));};exports[_0x71df('0x4b')]=function(_0x8004bf,_0x580362){return db[_0x71df('0x42')][_0x71df('0x4b')](_0x8004bf[_0x71df('0x4c')],{})[_0x71df('0x18')](respondWithResult(_0x580362,0xc9))[_0x71df('0x46')](handleError(_0x580362,null));};exports['update']=function(_0x21553e,_0x2f8edf){if(_0x21553e[_0x71df('0x4c')]['id']){delete _0x21553e['body']['id'];}return db[_0x71df('0x42')][_0x71df('0x4a')]({'where':{'id':_0x21553e['params']['id']}})[_0x71df('0x18')](handleEntityNotFound(_0x2f8edf,null))[_0x71df('0x18')](saveUpdates(_0x21553e['body'],null))[_0x71df('0x18')](respondWithResult(_0x2f8edf,null))[_0x71df('0x46')](handleError(_0x2f8edf,null));};exports['destroy']=function(_0x31f3b2,_0x1d909f){return db[_0x71df('0x42')]['find']({'where':{'id':_0x31f3b2[_0x71df('0x47')]['id']}})[_0x71df('0x18')](handleEntityNotFound(_0x1d909f,null))[_0x71df('0x18')](removeEntity(_0x1d909f,null))[_0x71df('0x46')](handleError(_0x1d909f,null));};exports[_0x71df('0x4d')]=function(_0x966256,_0x55438c,_0x326a86){var _0x8dd720={};var _0x5a9dc0={};var _0x246114;var _0x2fd3a0;return db[_0x71df('0x42')][_0x71df('0x4e')]({'where':{'id':_0x966256[_0x71df('0x47')]['id']}})[_0x71df('0x18')](handleEntityNotFound(_0x55438c,null))[_0x71df('0x18')](function(_0xea814d){if(_0xea814d){_0x246114=_0xea814d;_0x5a9dc0['model']=_[_0x71df('0x30')](db[_0x71df('0x4f')][_0x71df('0x48')]);_0x5a9dc0['query']=_[_0x71df('0x30')](_0x966256['query']);_0x5a9dc0['filters']=_['intersection'](_0x5a9dc0[_0x71df('0x2f')],_0x5a9dc0[_0x71df('0x31')]);_0x8dd720[_0x71df('0x35')]=_[_0x71df('0x34')](_0x5a9dc0['model'],qs[_0x71df('0x36')](_0x966256[_0x71df('0x31')][_0x71df('0x36')]));_0x8dd720['attributes']=_0x8dd720[_0x71df('0x35')]['length']?_0x8dd720[_0x71df('0x35')]:_0x5a9dc0['model'];_0x8dd720['order']=qs[_0x71df('0x39')](_0x966256[_0x71df('0x31')]['sort']);_0x8dd720[_0x71df('0x3e')]=qs['filters'](_[_0x71df('0x50')](_0x966256[_0x71df('0x31')],_0x5a9dc0[_0x71df('0x33')]));if(_0x966256[_0x71df('0x31')][_0x71df('0x3f')]){_0x8dd720[_0x71df('0x3e')]=_[_0x71df('0x3d')](_0x8dd720['where'],{'$or':_['map'](_0x8dd720['attributes'],function(_0x3b63ca){var _0xd55cd9={};_0xd55cd9[_0x3b63ca]={'$like':'%'+_0x966256[_0x71df('0x31')][_0x71df('0x3f')]+'%'};return _0xd55cd9;})});}_0x8dd720=_[_0x71df('0x3d')]({},_0x8dd720,_0x966256['options']);return _0x246114[_0x71df('0x4d')](_0x8dd720);}})['then'](function(_0x35cf38){if(_0x35cf38){_0x2fd3a0=_0x35cf38[_0x71df('0x49')];if(!_0x966256[_0x71df('0x31')]['hasOwnProperty'](_0x71df('0x51'))){_0x8dd720[_0x71df('0x37')]=qs[_0x71df('0x37')](_0x966256[_0x71df('0x31')][_0x71df('0x37')]);_0x8dd720['offset']=qs[_0x71df('0x26')](_0x966256[_0x71df('0x31')]['offset']);}return _0x246114[_0x71df('0x4d')](_0x8dd720);}})[_0x71df('0x18')](function(_0x90dc3a){if(_0x90dc3a){return _0x90dc3a?{'count':_0x2fd3a0,'rows':_0x90dc3a}:null;}})[_0x71df('0x18')](respondWithResult(_0x55438c,null))[_0x71df('0x46')](handleError(_0x55438c,null));};exports[_0x71df('0x52')]=function(_0x284c00,_0x28c6a5,_0x51b6f1){if(_0x284c00[_0x71df('0x4c')]['id']){delete _0x284c00['body']['id'];}return db[_0x71df('0x42')][_0x71df('0x4e')]({'where':{'id':_0x284c00[_0x71df('0x47')]['id']}})[_0x71df('0x18')](handleEntityNotFound(_0x28c6a5,null))[_0x71df('0x18')](function(_0x413b5a){if(_0x413b5a){_0x284c00[_0x71df('0x4c')][_0x71df('0x53')]=_0x413b5a['id'];_0x284c00[_0x71df('0x4c')][_0x71df('0x54')]=integrations[_0x71df('0x55')](_0x284c00[_0x71df('0x4c')]['channel'],_0x284c00[_0x71df('0x4c')]['type']);_0x284c00['body'][_0x71df('0x56')]=integrations[_0x71df('0x57')](_0x284c00[_0x71df('0x4c')]['channel'],_0x284c00[_0x71df('0x4c')]['type']);return db[_0x71df('0x4f')]['create'](_0x284c00[_0x71df('0x4c')],{'include':[{'model':db[_0x71df('0x58')],'as':_0x71df('0x54')},{'model':db[_0x71df('0x58')],'as':_0x71df('0x56')}]});}return null;})[_0x71df('0x18')](respondWithResult(_0x28c6a5,null))[_0x71df('0x46')](handleError(_0x28c6a5,null));};exports[_0x71df('0x59')]=function(_0xd510dd,_0x3d9522,_0x1fd2b6){var _0x292c4f=[{'name':_0x71df('0x5a'),'label':_0x71df('0x5a'),'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}]}];return db[_0x71df('0x42')]['findOne']({'where':{'id':_0xd510dd[_0x71df('0x47')]['id']},'attributes':['id',_0x71df('0x5b'),'authType',_0x71df('0x5c'),_0x71df('0x5d'),_0x71df('0x5e'),'consumerSecret',_0x71df('0x5f'),_0x71df('0x60')]})[_0x71df('0x18')](handleEntityNotFound(_0x3d9522,null))[_0x71df('0x18')](function(_0x354c58){if(_0x354c58){var _0xc66347={'method':_0x71df('0x61'),'uri':util['format'](_0x71df('0x62'),_0x354c58[_0x71df('0x5b')]),'headers':{'Content-Type':_0x71df('0x63'),'Accept':_0x71df('0x63')},'json':!![]};if(_0x354c58[_0x71df('0x64')]==='basic'){_0xc66347['headers'][_0x71df('0x65')]=util[_0x71df('0x66')]('Basic\x20%s',new Buffer(util[_0x71df('0x66')](_0x71df('0x67'),_0x354c58[_0x71df('0x5c')],_0x354c58['password']))[_0x71df('0x68')](_0x71df('0x69')));}return rp(_0xc66347)['then'](function(_0x463fa8){return _0x292c4f[_0x71df('0x6a')](_[_0x71df('0x40')](_0x463fa8[_0x71df('0x6b')][_0x71df('0x6c')],function(_0x4bdd15){return{'id':_0x4bdd15['name'],'name':_0x4bdd15['name'],'type':_0x4bdd15['type'],'active':_0x4bdd15[_0x71df('0x6d')],'label':_0x4bdd15[_0x71df('0x6e')],'custom':!![]};}));});}})['then'](function(_0xa27bd4){return{'count':_0xa27bd4[_0x71df('0x49')],'rows':_0xa27bd4};})[_0x71df('0x18')](respondWithResult(_0x3d9522,null))[_0x71df('0x46')](function(_0x1d0448){var _0x551381=_0xd510dd['query'][_0x71df('0x6f')]?0x1f4:_0x1d0448[_0x71df('0x70')]||0x1f4;logger['error'](_0x71df('0x71'),_0x71df('0x59'),_0x551381,JSON[_0x71df('0x1e')](_0x1d0448));delete _0x1d0448[_0x71df('0x2d')];if(_0x551381===0x191){_0x551381=0x190;}_0x3d9522[_0x71df('0x23')](_0x551381)['send'](_0xd510dd[_0x71df('0x31')][_0x71df('0x6f')]?{'message':'Wrong\x20credentials','statusCode':_0x1d0448['statusCode']}:_0x1d0448);});};
\ No newline at end of file
index 5450313..e9a33d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01d9=['../../config/logger','api','bluebird','request-promise','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','util'];(function(_0x47aa7c,_0xbdd3a){var _0x21f05b=function(_0x31f7b5){while(--_0x31f7b5){_0x47aa7c['push'](_0x47aa7c['shift']());}};_0x21f05b(++_0xbdd3a);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var logger=require(_0x901d('0x2'))(_0x901d('0x3'));var moment=require('moment');var BPromise=require(_0x901d('0x4'));var rp=require(_0x901d('0x5'));var attributes=require(_0x901d('0x6'));var integrations=require(_0x901d('0x7'));module[_0x901d('0x8')]=function(_0x456f31,_0xb96b86){return _0x456f31['define'](_0x901d('0x9'),attributes,{'tableName':_0x901d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeda7=['define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intDeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xeda7,0x196));var _0x7eda=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0xeda7[_0xbf8ebe];return _0x1e25e8;};'use strict';var _=require(_0x7eda('0x0'));var util=require(_0x7eda('0x1'));var logger=require(_0x7eda('0x2'))(_0x7eda('0x3'));var moment=require(_0x7eda('0x4'));var BPromise=require(_0x7eda('0x5'));var rp=require(_0x7eda('0x6'));var attributes=require(_0x7eda('0x7'));var integrations=require(_0x7eda('0x8'));module[_0x7eda('0x9')]=function(_0x15856b,_0x3bf92f){return _0x15856b[_0x7eda('0xa')](_0x7eda('0xb'),attributes,{'tableName':_0x7eda('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 02a26c8..1106c2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x680f=['DeskAccount,\x20%s,\x20%s,\x20%s','code','error','DeskAccount,\x20%s,\x20%s','message','catch','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','include','map','model','stringify','ShowDeskAccount','find','where','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug'];(function(_0x40d80c,_0x3e184a){var _0x14d42a=function(_0x5ce57c){while(--_0x5ce57c){_0x40d80c['push'](_0x40d80c['shift']());}};_0x14d42a(++_0x3e184a);}(_0x680f,0x79));var _0xf680=function(_0x5382f1,_0x5704ec){_0x5382f1=_0x5382f1-0x0;var _0x914fae=_0x680f[_0x5382f1];return _0x914fae;};'use strict';var _=require(_0xf680('0x0'));var util=require('util');var moment=require(_0xf680('0x1'));var BPromise=require(_0xf680('0x2'));var rs=require(_0xf680('0x3'));var fs=require('fs');var db=require(_0xf680('0x4'))['db'];var utils=require(_0xf680('0x5'));var logger=require(_0xf680('0x6'))(_0xf680('0x7'));var config=require(_0xf680('0x8'));var jayson=require(_0xf680('0x9'));var client=jayson['client'][_0xf680('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c6fcf,_0x21ca27,_0x38ebcd){return new BPromise(function(_0x516fc0,_0x2857ea){return client['request'](_0x5c6fcf,_0x38ebcd)[_0xf680('0xb')](function(_0x4b7b19){logger[_0xf680('0xc')]('DeskAccount,\x20%s,\x20%s',_0x21ca27,_0xf680('0xd'));logger[_0xf680('0xe')](_0xf680('0xf'),_0x21ca27,_0xf680('0xd'),JSON['stringify'](_0x4b7b19));if(_0x4b7b19['error']){if(_0x4b7b19['error'][_0xf680('0x10')]===0x1f4){logger[_0xf680('0x11')](_0xf680('0x12'),_0x21ca27,_0x4b7b19['error'][_0xf680('0x13')]);return _0x2857ea(_0x4b7b19[_0xf680('0x11')][_0xf680('0x13')]);}logger['error'](_0xf680('0x12'),_0x21ca27,_0x4b7b19[_0xf680('0x11')]['message']);return _0x516fc0(_0x4b7b19[_0xf680('0x11')]['message']);}else{logger[_0xf680('0xc')](_0xf680('0x12'),_0x21ca27,_0xf680('0xd'));_0x516fc0(_0x4b7b19['result'][_0xf680('0x13')]);}})[_0xf680('0x14')](function(_0x206b1e){logger['error'](_0xf680('0x12'),_0x21ca27,_0x206b1e);_0x2857ea(_0x206b1e);});});}exports[_0xf680('0x15')]=function(_0x228b40){var _0x1dd41b=this;return new Promise(function(_0x3935d3,_0x14d8bd){return db[_0xf680('0x16')][_0xf680('0x17')]({'raw':_0x228b40[_0xf680('0x18')]?_0x228b40[_0xf680('0x18')][_0xf680('0x19')]===undefined?!![]:![]:!![],'where':_0x228b40[_0xf680('0x18')]?_0x228b40['options']['where']||null:null,'attributes':_0x228b40[_0xf680('0x18')]?_0x228b40[_0xf680('0x18')][_0xf680('0x1a')]||null:null,'limit':_0x228b40['options']?_0x228b40[_0xf680('0x18')]['limit']||null:null,'include':_0x228b40[_0xf680('0x18')]?_0x228b40[_0xf680('0x18')][_0xf680('0x1b')]?_[_0xf680('0x1c')](_0x228b40[_0xf680('0x18')][_0xf680('0x1b')],function(_0x272064){return{'model':db[_0x272064[_0xf680('0x1d')]],'as':_0x272064['as'],'attributes':_0x272064[_0xf680('0x1a')],'include':_0x272064[_0xf680('0x1b')]?_[_0xf680('0x1c')](_0x272064['include'],function(_0x250709){return{'model':db[_0x250709[_0xf680('0x1d')]],'as':_0x250709['as'],'attributes':_0x250709[_0xf680('0x1a')],'include':_0x250709[_0xf680('0x1b')]?_[_0xf680('0x1c')](_0x250709['include'],function(_0x2c7590){return{'model':db[_0x2c7590['model']],'as':_0x2c7590['as'],'attributes':_0x2c7590[_0xf680('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf680('0xb')](function(_0x5a975f){logger[_0xf680('0xc')]('GetDeskAccount',_0x228b40);logger[_0xf680('0xe')](_0xf680('0x15'),_0x228b40,JSON[_0xf680('0x1e')](_0x5a975f));_0x3935d3(_0x5a975f);})[_0xf680('0x14')](function(_0x39a885){logger[_0xf680('0x11')](_0xf680('0x15'),_0x39a885[_0xf680('0x13')],_0x228b40);_0x14d8bd(_0x1dd41b[_0xf680('0x11')](0x1f4,_0x39a885[_0xf680('0x13')]));});});};exports[_0xf680('0x1f')]=function(_0x53a04f){var _0x425efd=this;return new Promise(function(_0x18c6c7,_0x39f708){return db[_0xf680('0x16')][_0xf680('0x20')]({'raw':_0x53a04f[_0xf680('0x18')]?_0x53a04f[_0xf680('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x53a04f['options']?_0x53a04f[_0xf680('0x18')][_0xf680('0x21')]||null:null,'attributes':_0x53a04f[_0xf680('0x18')]?_0x53a04f[_0xf680('0x18')][_0xf680('0x1a')]||null:null,'include':_0x53a04f[_0xf680('0x18')]?_0x53a04f[_0xf680('0x18')][_0xf680('0x1b')]?_[_0xf680('0x1c')](_0x53a04f['options'][_0xf680('0x1b')],function(_0x2fc7a1){return{'model':db[_0x2fc7a1['model']],'as':_0x2fc7a1['as'],'attributes':_0x2fc7a1['attributes'],'include':_0x2fc7a1[_0xf680('0x1b')]?_[_0xf680('0x1c')](_0x2fc7a1[_0xf680('0x1b')],function(_0x39496c){return{'model':db[_0x39496c[_0xf680('0x1d')]],'as':_0x39496c['as'],'attributes':_0x39496c['attributes'],'include':_0x39496c['include']?_[_0xf680('0x1c')](_0x39496c['include'],function(_0x32f758){return{'model':db[_0x32f758[_0xf680('0x1d')]],'as':_0x32f758['as'],'attributes':_0x32f758[_0xf680('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf680('0xb')](function(_0x3a3901){logger[_0xf680('0xc')](_0xf680('0x1f'),_0x53a04f);logger['debug'](_0xf680('0x1f'),_0x53a04f,JSON[_0xf680('0x1e')](_0x3a3901));_0x18c6c7(_0x3a3901);})[_0xf680('0x14')](function(_0x47a674){logger[_0xf680('0x11')](_0xf680('0x1f'),_0x47a674['message'],_0x53a04f);_0x39f708(_0x425efd[_0xf680('0x11')](0x1f4,_0x47a674[_0xf680('0x13')]));});});};
\ No newline at end of file
+var _0x8580=['http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetDeskAccount','ShowDeskAccount','DeskAccount','find','stringify','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x21e1e6,_0x185548){var _0x3d3216=function(_0x16a66d){while(--_0x16a66d){_0x21e1e6['push'](_0x21e1e6['shift']());}};_0x3d3216(++_0x185548);}(_0x8580,0xec));var _0x0858=function(_0x741bd0,_0x323267){_0x741bd0=_0x741bd0-0x0;var _0x2d6c18=_0x8580[_0x741bd0];return _0x2d6c18;};'use strict';var _=require('lodash');var util=require(_0x0858('0x0'));var moment=require('moment');var BPromise=require(_0x0858('0x1'));var rs=require(_0x0858('0x2'));var fs=require('fs');var db=require(_0x0858('0x3'))['db'];var utils=require(_0x0858('0x4'));var logger=require(_0x0858('0x5'))(_0x0858('0x6'));var config=require(_0x0858('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0858('0x8')][_0x0858('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ede89,_0xbe4142,_0x50b030){return new BPromise(function(_0x2053bf,_0x95ce55){return client[_0x0858('0xa')](_0x5ede89,_0x50b030)[_0x0858('0xb')](function(_0x531ffb){logger[_0x0858('0xc')](_0x0858('0xd'),_0xbe4142,_0x0858('0xe'));logger[_0x0858('0xf')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0xbe4142,'request\x20sent',JSON['stringify'](_0x531ffb));if(_0x531ffb[_0x0858('0x10')]){if(_0x531ffb[_0x0858('0x10')][_0x0858('0x11')]===0x1f4){logger[_0x0858('0x10')](_0x0858('0xd'),_0xbe4142,_0x531ffb['error']['message']);return _0x95ce55(_0x531ffb['error'][_0x0858('0x12')]);}logger[_0x0858('0x10')]('DeskAccount,\x20%s,\x20%s',_0xbe4142,_0x531ffb['error'][_0x0858('0x12')]);return _0x2053bf(_0x531ffb[_0x0858('0x10')][_0x0858('0x12')]);}else{logger['info'](_0x0858('0xd'),_0xbe4142,_0x0858('0xe'));_0x2053bf(_0x531ffb[_0x0858('0x13')][_0x0858('0x12')]);}})[_0x0858('0x14')](function(_0x42b067){logger['error']('DeskAccount,\x20%s,\x20%s',_0xbe4142,_0x42b067);_0x95ce55(_0x42b067);});});}exports['GetDeskAccount']=function(_0x2ab86c){var _0x267f68=this;return new Promise(function(_0x2fbf1d,_0x740faf){return db['DeskAccount'][_0x0858('0x15')]({'raw':_0x2ab86c[_0x0858('0x16')]?_0x2ab86c[_0x0858('0x16')][_0x0858('0x17')]===undefined?!![]:![]:!![],'where':_0x2ab86c[_0x0858('0x16')]?_0x2ab86c[_0x0858('0x16')][_0x0858('0x18')]||null:null,'attributes':_0x2ab86c[_0x0858('0x16')]?_0x2ab86c[_0x0858('0x16')][_0x0858('0x19')]||null:null,'limit':_0x2ab86c[_0x0858('0x16')]?_0x2ab86c[_0x0858('0x16')][_0x0858('0x1a')]||null:null,'include':_0x2ab86c[_0x0858('0x16')]?_0x2ab86c[_0x0858('0x16')]['include']?_['map'](_0x2ab86c['options'][_0x0858('0x1b')],function(_0x5a7cc9){return{'model':db[_0x5a7cc9['model']],'as':_0x5a7cc9['as'],'attributes':_0x5a7cc9[_0x0858('0x19')],'include':_0x5a7cc9[_0x0858('0x1b')]?_[_0x0858('0x1c')](_0x5a7cc9[_0x0858('0x1b')],function(_0x5ed279){return{'model':db[_0x5ed279[_0x0858('0x1d')]],'as':_0x5ed279['as'],'attributes':_0x5ed279['attributes'],'include':_0x5ed279['include']?_[_0x0858('0x1c')](_0x5ed279['include'],function(_0x20a555){return{'model':db[_0x20a555[_0x0858('0x1d')]],'as':_0x20a555['as'],'attributes':_0x20a555[_0x0858('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0858('0xb')](function(_0x2dcb83){logger['info']('GetDeskAccount',_0x2ab86c);logger['debug'](_0x0858('0x1e'),_0x2ab86c,JSON['stringify'](_0x2dcb83));_0x2fbf1d(_0x2dcb83);})[_0x0858('0x14')](function(_0x239837){logger[_0x0858('0x10')](_0x0858('0x1e'),_0x239837[_0x0858('0x12')],_0x2ab86c);_0x740faf(_0x267f68[_0x0858('0x10')](0x1f4,_0x239837['message']));});});};exports[_0x0858('0x1f')]=function(_0x573571){var _0x50ed65=this;return new Promise(function(_0x6de0e,_0x4e0f64){return db[_0x0858('0x20')][_0x0858('0x21')]({'raw':_0x573571[_0x0858('0x16')]?_0x573571[_0x0858('0x16')][_0x0858('0x17')]===undefined?!![]:![]:!![],'where':_0x573571[_0x0858('0x16')]?_0x573571['options'][_0x0858('0x18')]||null:null,'attributes':_0x573571[_0x0858('0x16')]?_0x573571[_0x0858('0x16')][_0x0858('0x19')]||null:null,'include':_0x573571[_0x0858('0x16')]?_0x573571[_0x0858('0x16')][_0x0858('0x1b')]?_['map'](_0x573571[_0x0858('0x16')][_0x0858('0x1b')],function(_0x14ba38){return{'model':db[_0x14ba38[_0x0858('0x1d')]],'as':_0x14ba38['as'],'attributes':_0x14ba38['attributes'],'include':_0x14ba38[_0x0858('0x1b')]?_[_0x0858('0x1c')](_0x14ba38[_0x0858('0x1b')],function(_0x3aff89){return{'model':db[_0x3aff89[_0x0858('0x1d')]],'as':_0x3aff89['as'],'attributes':_0x3aff89[_0x0858('0x19')],'include':_0x3aff89[_0x0858('0x1b')]?_[_0x0858('0x1c')](_0x3aff89[_0x0858('0x1b')],function(_0x492932){return{'model':db[_0x492932[_0x0858('0x1d')]],'as':_0x492932['as'],'attributes':_0x492932[_0x0858('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a6d84){logger[_0x0858('0xc')](_0x0858('0x1f'),_0x573571);logger[_0x0858('0xf')](_0x0858('0x1f'),_0x573571,JSON[_0x0858('0x22')](_0x5a6d84));_0x6de0e(_0x5a6d84);})[_0x0858('0x14')](function(_0x4f5d1a){logger[_0x0858('0x10')](_0x0858('0x1f'),_0x4f5d1a[_0x0858('0x12')],_0x573571);_0x4e0f64(_0x50ed65['error'](0x1f4,_0x4f5d1a[_0x0858('0x12')]));});});};
\ No newline at end of file
index 99183f2..ebfe83f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['delete','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','update'];(function(_0x2fdb63,_0x324907){var _0x39faa4=function(_0x510e41){while(--_0x510e41){_0x2fdb63['push'](_0x2fdb63['shift']());}};_0x39faa4(++_0x324907);}(_0xedd9,0xfc));var _0x9edd=function(_0x284900,_0x580d3b){_0x284900=_0x284900-0x0;var _0x2e35ce=_0xedd9[_0x284900];return _0x2e35ce;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var express=require(_0x9edd('0x2'));var router=express[_0x9edd('0x3')]();var auth=require(_0x9edd('0x4'));var interaction=require(_0x9edd('0x5'));var config=require(_0x9edd('0x6'));var controller=require(_0x9edd('0x7'));router['get']('/',auth[_0x9edd('0x8')](),controller[_0x9edd('0x9')]);router[_0x9edd('0xa')](_0x9edd('0xb'),auth['isAuthenticated'](),controller[_0x9edd('0xc')]);router['get'](_0x9edd('0xd'),auth[_0x9edd('0x8')](),controller[_0x9edd('0xe')]);router[_0x9edd('0xa')]('/:id/subjects',auth[_0x9edd('0x8')](),controller['getSubjects']);router[_0x9edd('0xa')](_0x9edd('0xf'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0xa')]('/:id/tags',auth[_0x9edd('0x8')](),controller[_0x9edd('0x11')]);router[_0x9edd('0x12')]('/',auth[_0x9edd('0x8')](),controller[_0x9edd('0x13')]);router[_0x9edd('0x12')](_0x9edd('0x14'),auth[_0x9edd('0x8')](),controller['setTags']);router[_0x9edd('0x15')](_0x9edd('0xb'),auth[_0x9edd('0x8')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x17')](_0x9edd('0xb'),auth[_0x9edd('0x8')](),controller[_0x9edd('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x008c=['./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','getDescriptions','/:id/tags','getTags','post','create','setTags','update','delete','multer','util','path','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x74ead2,_0x6c4f4a){var _0x30aa57=function(_0x3b1154){while(--_0x3b1154){_0x74ead2['push'](_0x74ead2['shift']());}};_0x30aa57(++_0x6c4f4a);}(_0x008c,0x188));var _0xc008=function(_0x5d2523,_0x14bc7e){_0x5d2523=_0x5d2523-0x0;var _0x4b0e39=_0x008c[_0x5d2523];return _0x4b0e39;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var express=require(_0xc008('0x3'));var router=express[_0xc008('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc008('0x5'));var config=require(_0xc008('0x6'));var controller=require(_0xc008('0x7'));router[_0xc008('0x8')]('/',auth[_0xc008('0x9')](),controller[_0xc008('0xa')]);router[_0xc008('0x8')](_0xc008('0xb'),auth[_0xc008('0x9')](),controller['show']);router[_0xc008('0x8')]('/:id/fields',auth[_0xc008('0x9')](),controller['getFields']);router['get'](_0xc008('0xc'),auth[_0xc008('0x9')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0xc008('0x9')](),controller[_0xc008('0xd')]);router['get'](_0xc008('0xe'),auth[_0xc008('0x9')](),controller[_0xc008('0xf')]);router[_0xc008('0x10')]('/',auth[_0xc008('0x9')](),controller[_0xc008('0x11')]);router[_0xc008('0x10')]('/:id/tags',auth['isAuthenticated'](),controller[_0xc008('0x12')]);router['put'](_0xc008('0xb'),auth[_0xc008('0x9')](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 090623b..0b5bdfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb271=['sequelize','STRING'];(function(_0x238aa2,_0x4ace51){var _0x2e1dde=function(_0x3a5d86){while(--_0x3a5d86){_0x238aa2['push'](_0x238aa2['shift']());}};_0x2e1dde(++_0x4ace51);}(_0xb271,0x7a));var _0x1b27=function(_0x565768,_0x9bb3e){_0x565768=_0x565768-0x0;var _0xcbd16a=_0xb271[_0x565768];return _0xcbd16a;};'use strict';var Sequelize=require(_0x1b27('0x0'));module['exports']={'name':{'type':Sequelize[_0x1b27('0x1')]},'description':{'type':Sequelize[_0x1b27('0x1')]}};
\ No newline at end of file
+var _0xbf35=['STRING','sequelize'];(function(_0x1deee5,_0x1d4485){var _0x1d6c3a=function(_0x433abf){while(--_0x433abf){_0x1deee5['push'](_0x1deee5['shift']());}};_0x1d6c3a(++_0x1d4485);}(_0xbf35,0x1b7));var _0x5bf3=function(_0x468d06,_0x2e8f2d){_0x468d06=_0x468d06-0x0;var _0x1542d2=_0xbf35[_0x468d06];return _0x1542d2;};'use strict';var Sequelize=require(_0x5bf3('0x0'));module['exports']={'name':{'type':Sequelize[_0x5bf3('0x1')]},'description':{'type':Sequelize[_0x5bf3('0x1')]}};
\ No newline at end of file
index 7f5a3e5..aef4736 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0af5=['options','find','create','body','getFields','findOne','DeskField','order','map','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','querystring','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','DeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','update','destroy','then','stack','name','model','keys','query','dateStart','dateEnd','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','add','merge','filter','count','includeAll','findAll','rows','params','DeskConfiguration','rawAttributes','include'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0x0af5,0x158));var _0x50af=function(_0x52ba9f,_0x185b33){_0x52ba9f=_0x52ba9f-0x0;var _0x27a900=_0x0af5[_0x52ba9f];return _0x27a900;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x50af('0x0'));var rimraf=require(_0x50af('0x1'));var zipdir=require(_0x50af('0x2'));var jsonpatch=require(_0x50af('0x3'));var rp=require(_0x50af('0x4'));var moment=require(_0x50af('0x5'));var BPromise=require(_0x50af('0x6'));var Mustache=require(_0x50af('0x7'));var util=require(_0x50af('0x8'));var path=require(_0x50af('0x9'));var sox=require(_0x50af('0xa'));var csv=require(_0x50af('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x50af('0xc'));var crypto=require(_0x50af('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x50af('0xb'));var querystring=require(_0x50af('0xe'));var Papa=require('papaparse');var qs=require('../../components/parsers/qs');var logger=require(_0x50af('0xf'))(_0x50af('0x10'));var utils=require('../../config/utils');var config=require(_0x50af('0x11'));var db=require(_0x50af('0x12'))['db'];var jayson=require(_0x50af('0x13'));var client=jayson[_0x50af('0x14')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29c082,_0x338967,_0x2792bb,_0x3373bf){return new BPromise(function(_0x252a02,_0x38bac0){var _0x534589=_0x3373bf||client;return _0x534589['request'](_0x29c082,_0x2792bb)['then'](function(_0x620389){logger['info'](_0x50af('0x15'),_0x338967,_0x50af('0x16'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x338967,_0x50af('0x16'),JSON[_0x50af('0x17')](_0x620389));if(_0x620389['error']){if(_0x620389['error'][_0x50af('0x18')]===0x1f4){logger[_0x50af('0x19')](_0x50af('0x15'),_0x338967,_0x620389[_0x50af('0x19')][_0x50af('0x1a')]);return _0x38bac0(_0x620389[_0x50af('0x19')][_0x50af('0x1a')]);}logger[_0x50af('0x19')](_0x50af('0x15'),_0x338967,_0x620389[_0x50af('0x19')]['message']);return _0x252a02(_0x620389[_0x50af('0x19')][_0x50af('0x1a')]);}else{logger[_0x50af('0x1b')](_0x50af('0x15'),_0x338967,'request\x20sent');_0x252a02(_0x620389[_0x50af('0x1c')][_0x50af('0x1a')]);}})[_0x50af('0x1d')](function(_0x147da3){logger[_0x50af('0x19')](_0x50af('0x15'),_0x338967,_0x147da3);_0x38bac0(_0x147da3);});});}function respondWithStatusCode(_0x2d093c,_0xb6de0d){_0xb6de0d=_0xb6de0d||0xcc;return function(_0x1a122c){if(_0x1a122c){return _0x2d093c[_0x50af('0x1e')](_0xb6de0d);}return _0x2d093c['status'](_0xb6de0d)[_0x50af('0x1f')]();};}function respondWithResult(_0x156154,_0x3c6388){_0x3c6388=_0x3c6388||0xc8;return function(_0x7eeeaf){if(_0x7eeeaf){return _0x156154[_0x50af('0x20')](_0x3c6388)[_0x50af('0x21')](_0x7eeeaf);}};}function respondWithFilteredResult(_0x4db72d,_0xb3c15a){return function(_0x1550ee){if(_0x1550ee){var _0x5e096d=_0x1550ee['count'],_0xd085ec=_0xb3c15a['offset'],_0x3fa2da=_0xb3c15a[_0x50af('0x22')]+_0xb3c15a[_0x50af('0x23')],_0x311b08;if(_0x3fa2da>=_0x5e096d){_0x3fa2da=_0x5e096d;_0x311b08=0xc8;}else{_0x311b08=0xce;}_0x4db72d[_0x50af('0x20')](_0x311b08);return _0x4db72d[_0x50af('0x24')](_0x50af('0x25'),_0xd085ec+'-'+_0x3fa2da+'/'+_0x5e096d)[_0x50af('0x21')](_0x1550ee);}return null;};}function patchUpdates(_0x520bd6){return function(_0x212fc2){try{jsonpatch['apply'](_0x212fc2,_0x520bd6,!![]);}catch(_0x1a1104){return BPromise[_0x50af('0x26')](_0x1a1104);}return _0x212fc2[_0x50af('0x27')]();};}function saveUpdates(_0x4db406,_0x43f1c8){return function(_0x5bd732){if(_0x5bd732){return _0x5bd732[_0x50af('0x28')](_0x4db406)['then'](function(_0x4a6ea4){return _0x4a6ea4;});}return null;};}function removeEntity(_0x52ce35,_0x27b476){return function(_0x353a28){if(_0x353a28){return _0x353a28[_0x50af('0x29')]()[_0x50af('0x2a')](function(){_0x52ce35[_0x50af('0x20')](0xcc)[_0x50af('0x1f')]();});}};}function handleEntityNotFound(_0xe321f7,_0x2ce608){return function(_0x239cf2){if(!_0x239cf2){_0xe321f7[_0x50af('0x1e')](0x194);}return _0x239cf2;};}function handleError(_0x522982,_0x4ad19b){_0x4ad19b=_0x4ad19b||0x1f4;return function(_0xc8976f){logger[_0x50af('0x19')](_0xc8976f[_0x50af('0x2b')]);if(_0xc8976f[_0x50af('0x2c')]){delete _0xc8976f['name'];}_0x522982[_0x50af('0x20')](_0x4ad19b)['send'](_0xc8976f);};}exports['index']=function(_0x5bedd9,_0x65462f){var _0x1da181={},_0xb1ed5b={},_0x3e63eb={'count':0x0,'rows':[]};var _0x5d6cbc=db['DeskConfiguration']['rawAttributes'];_0xb1ed5b[_0x50af('0x2d')]=_[_0x50af('0x2e')](_0x5d6cbc);var _0x342c9b={'dateStart':_0x5bedd9[_0x50af('0x2f')][_0x50af('0x30')],'dateEnd':_0x5bedd9['query'][_0x50af('0x31')]};delete _0x5bedd9[_0x50af('0x2f')][_0x50af('0x30')];delete _0x5bedd9[_0x50af('0x2f')]['dateEnd'];_0xb1ed5b[_0x50af('0x2f')]=_[_0x50af('0x2e')](_0x5bedd9[_0x50af('0x2f')]);_0xb1ed5b[_0x50af('0x32')]=_[_0x50af('0x33')](_0xb1ed5b['model'],_0xb1ed5b['query']);_0x1da181['attributes']=_[_0x50af('0x33')](_0xb1ed5b[_0x50af('0x2d')],qs[_0x50af('0x34')](_0x5bedd9[_0x50af('0x2f')][_0x50af('0x34')]));_0x1da181[_0x50af('0x35')]=_0x1da181[_0x50af('0x35')][_0x50af('0x36')]?_0x1da181[_0x50af('0x35')]:_0xb1ed5b[_0x50af('0x2d')];if(!_0x5bedd9[_0x50af('0x2f')][_0x50af('0x37')](_0x50af('0x38'))){_0x1da181[_0x50af('0x23')]=qs[_0x50af('0x23')](_0x5bedd9[_0x50af('0x2f')]['limit']);_0x1da181[_0x50af('0x22')]=qs[_0x50af('0x22')](_0x5bedd9[_0x50af('0x2f')]['offset']);}_0x1da181['order']=qs[_0x50af('0x39')](_0x5bedd9[_0x50af('0x2f')][_0x50af('0x39')]);_0x1da181[_0x50af('0x3a')]=qs[_0x50af('0x32')](_[_0x50af('0x3b')](_0x5bedd9[_0x50af('0x2f')],_0xb1ed5b[_0x50af('0x32')]));if(_0x342c9b['dateStart']){if(_0x342c9b['dateEnd']){_0x342c9b[_0x50af('0x31')]=moment(_0x342c9b[_0x50af('0x31')])['add'](0x1,'day');}else{_0x342c9b[_0x50af('0x31')]=moment(_0x342c9b[_0x50af('0x30')])[_0x50af('0x3c')](0x1,'day');}_[_0x50af('0x3d')](_0x1da181[_0x50af('0x3a')],{'createdAt':{'$gte':_0x342c9b[_0x50af('0x30')],'$lte':_0x342c9b[_0x50af('0x31')]}});}if(_0x5bedd9[_0x50af('0x2f')][_0x50af('0x3e')]){_0x1da181[_0x50af('0x3a')]=_[_0x50af('0x3d')](_0x1da181[_0x50af('0x3a')],{'$or':_['map'](_0x1da181[_0x50af('0x35')],function(_0x460567){var _0x36cda0={};_0x36cda0[_0x460567]={'$like':'%'+_0x5bedd9[_0x50af('0x2f')]['filter']+'%'};return _0x36cda0;})});}_0x1da181=_['merge']({},_0x1da181,_0x5bedd9['options']);var _0xf9ed7={'where':_0x1da181[_0x50af('0x3a')]};return db['DeskConfiguration'][_0x50af('0x3f')](_0xf9ed7)[_0x50af('0x2a')](function(_0x398dad){_0x3e63eb[_0x50af('0x3f')]=_0x398dad;if(_0x5bedd9[_0x50af('0x2f')][_0x50af('0x40')]){_0x1da181['include']=[{'all':!![]}];}return db['DeskConfiguration'][_0x50af('0x41')](_0x1da181);})[_0x50af('0x2a')](function(_0x26c466){_0x3e63eb[_0x50af('0x42')]=_0x26c466;return _0x3e63eb;})[_0x50af('0x2a')](respondWithFilteredResult(_0x65462f,_0x1da181))[_0x50af('0x1d')](handleError(_0x65462f,null));};exports['show']=function(_0x37cfd4,_0x51aba3){var _0x48fb88={'raw':![],'where':{'id':_0x37cfd4[_0x50af('0x43')]['id']}},_0x48448e={};_0x48448e[_0x50af('0x2d')]=_[_0x50af('0x2e')](db[_0x50af('0x44')][_0x50af('0x45')]);_0x48448e[_0x50af('0x2f')]=_[_0x50af('0x2e')](_0x37cfd4[_0x50af('0x2f')]);_0x48448e[_0x50af('0x32')]=_[_0x50af('0x33')](_0x48448e['model'],_0x48448e[_0x50af('0x2f')]);_0x48fb88[_0x50af('0x35')]=_[_0x50af('0x33')](_0x48448e[_0x50af('0x2d')],qs[_0x50af('0x34')](_0x37cfd4['query']['fields']));_0x48fb88['attributes']=_0x48fb88[_0x50af('0x35')]['length']?_0x48fb88[_0x50af('0x35')]:_0x48448e[_0x50af('0x2d')];if(_0x37cfd4[_0x50af('0x2f')][_0x50af('0x40')]){_0x48fb88[_0x50af('0x46')]=[{'all':!![]}];}_0x48fb88=_['merge']({},_0x48fb88,_0x37cfd4[_0x50af('0x47')]);return db[_0x50af('0x44')][_0x50af('0x48')](_0x48fb88)[_0x50af('0x2a')](handleEntityNotFound(_0x51aba3,null))[_0x50af('0x2a')](respondWithResult(_0x51aba3,null))[_0x50af('0x1d')](handleError(_0x51aba3,null));};exports[_0x50af('0x49')]=function(_0x48dcd8,_0x46d819){return db['DeskConfiguration'][_0x50af('0x49')](_0x48dcd8[_0x50af('0x4a')],{})[_0x50af('0x2a')](respondWithResult(_0x46d819,0xc9))[_0x50af('0x1d')](handleError(_0x46d819,null));};exports['update']=function(_0x254664,_0x2ecb67){if(_0x254664[_0x50af('0x4a')]['id']){delete _0x254664[_0x50af('0x4a')]['id'];}return db[_0x50af('0x44')][_0x50af('0x48')]({'where':{'id':_0x254664['params']['id']}})[_0x50af('0x2a')](handleEntityNotFound(_0x2ecb67,null))[_0x50af('0x2a')](saveUpdates(_0x254664[_0x50af('0x4a')],null))[_0x50af('0x2a')](respondWithResult(_0x2ecb67,null))[_0x50af('0x1d')](handleError(_0x2ecb67,null));};exports[_0x50af('0x29')]=function(_0x3a042a,_0x20b585){return db[_0x50af('0x44')][_0x50af('0x48')]({'where':{'id':_0x3a042a[_0x50af('0x43')]['id']}})['then'](handleEntityNotFound(_0x20b585,null))[_0x50af('0x2a')](removeEntity(_0x20b585,null))[_0x50af('0x1d')](handleError(_0x20b585,null));};exports[_0x50af('0x4b')]=function(_0x263abb,_0x436fc0,_0x4e3a5e){var _0x19f898={};var _0x3b0ca6={};var _0x49cd0d;var _0x241380;return db[_0x50af('0x44')][_0x50af('0x4c')]({'where':{'id':_0x263abb[_0x50af('0x43')]['id']}})[_0x50af('0x2a')](handleEntityNotFound(_0x436fc0,null))[_0x50af('0x2a')](function(_0x374f2d){if(_0x374f2d){_0x49cd0d=_0x374f2d;_0x3b0ca6[_0x50af('0x2d')]=_[_0x50af('0x2e')](db[_0x50af('0x4d')][_0x50af('0x45')]);_0x3b0ca6[_0x50af('0x2f')]=_[_0x50af('0x2e')](_0x263abb[_0x50af('0x2f')]);_0x3b0ca6['filters']=_[_0x50af('0x33')](_0x3b0ca6[_0x50af('0x2d')],_0x3b0ca6[_0x50af('0x2f')]);_0x19f898[_0x50af('0x35')]=_[_0x50af('0x33')](_0x3b0ca6[_0x50af('0x2d')],qs[_0x50af('0x34')](_0x263abb['query'][_0x50af('0x34')]));_0x19f898[_0x50af('0x35')]=_0x19f898[_0x50af('0x35')]['length']?_0x19f898[_0x50af('0x35')]:_0x3b0ca6[_0x50af('0x2d')];_0x19f898[_0x50af('0x4e')]=qs[_0x50af('0x39')](_0x263abb['query'][_0x50af('0x39')]);_0x19f898[_0x50af('0x3a')]=qs[_0x50af('0x32')](_['pick'](_0x263abb[_0x50af('0x2f')],_0x3b0ca6[_0x50af('0x32')]));if(_0x263abb[_0x50af('0x2f')][_0x50af('0x3e')]){_0x19f898['where']=_[_0x50af('0x3d')](_0x19f898[_0x50af('0x3a')],{'$or':_[_0x50af('0x4f')](_0x19f898[_0x50af('0x35')],function(_0x1a7a10){var _0x599ba2={};_0x599ba2[_0x1a7a10]={'$like':'%'+_0x263abb[_0x50af('0x2f')][_0x50af('0x3e')]+'%'};return _0x599ba2;})});}_0x19f898=_['merge']({},_0x19f898,_0x263abb[_0x50af('0x47')]);return _0x49cd0d['getFields'](_0x19f898);}})[_0x50af('0x2a')](function(_0x169bad){if(_0x169bad){_0x241380=_0x169bad[_0x50af('0x36')];if(!_0x263abb[_0x50af('0x2f')][_0x50af('0x37')](_0x50af('0x38'))){_0x19f898[_0x50af('0x23')]=qs[_0x50af('0x23')](_0x263abb[_0x50af('0x2f')][_0x50af('0x23')]);_0x19f898[_0x50af('0x22')]=qs[_0x50af('0x22')](_0x263abb['query'][_0x50af('0x22')]);}return _0x49cd0d[_0x50af('0x4b')](_0x19f898);}})[_0x50af('0x2a')](function(_0x33bcfa){if(_0x33bcfa){return _0x33bcfa?{'count':_0x241380,'rows':_0x33bcfa}:null;}})['then'](respondWithResult(_0x436fc0,null))[_0x50af('0x1d')](handleError(_0x436fc0,null));};exports['getSubjects']=function(_0x28ce74,_0x12d478,_0x2915b8){var _0x58528a={};var _0x56a577={};var _0xfaa218;var _0x35b373;return db[_0x50af('0x44')]['findOne']({'where':{'id':_0x28ce74['params']['id']}})[_0x50af('0x2a')](handleEntityNotFound(_0x12d478,null))[_0x50af('0x2a')](function(_0x3b71e0){if(_0x3b71e0){_0xfaa218=_0x3b71e0;_0x56a577[_0x50af('0x2d')]=_[_0x50af('0x2e')](db[_0x50af('0x4d')][_0x50af('0x45')]);_0x56a577[_0x50af('0x2f')]=_[_0x50af('0x2e')](_0x28ce74[_0x50af('0x2f')]);_0x56a577[_0x50af('0x32')]=_[_0x50af('0x33')](_0x56a577['model'],_0x56a577[_0x50af('0x2f')]);_0x58528a[_0x50af('0x35')]=_['intersection'](_0x56a577[_0x50af('0x2d')],qs[_0x50af('0x34')](_0x28ce74['query'][_0x50af('0x34')]));_0x58528a[_0x50af('0x35')]=_0x58528a['attributes']['length']?_0x58528a[_0x50af('0x35')]:_0x56a577['model'];_0x58528a['order']=qs[_0x50af('0x39')](_0x28ce74['query'][_0x50af('0x39')]);_0x58528a['where']=qs['filters'](_[_0x50af('0x3b')](_0x28ce74[_0x50af('0x2f')],_0x56a577['filters']));if(_0x28ce74[_0x50af('0x2f')][_0x50af('0x3e')]){_0x58528a[_0x50af('0x3a')]=_[_0x50af('0x3d')](_0x58528a[_0x50af('0x3a')],{'$or':_['map'](_0x58528a[_0x50af('0x35')],function(_0x333ea5){var _0x57f096={};_0x57f096[_0x333ea5]={'$like':'%'+_0x28ce74[_0x50af('0x2f')][_0x50af('0x3e')]+'%'};return _0x57f096;})});}_0x58528a=_[_0x50af('0x3d')]({},_0x58528a,_0x28ce74[_0x50af('0x47')]);return _0xfaa218['getSubjects'](_0x58528a);}})[_0x50af('0x2a')](function(_0x1d5ce8){if(_0x1d5ce8){_0x35b373=_0x1d5ce8['length'];if(!_0x28ce74[_0x50af('0x2f')][_0x50af('0x37')](_0x50af('0x38'))){_0x58528a[_0x50af('0x23')]=qs['limit'](_0x28ce74[_0x50af('0x2f')][_0x50af('0x23')]);_0x58528a['offset']=qs[_0x50af('0x22')](_0x28ce74['query'][_0x50af('0x22')]);}return _0xfaa218['getSubjects'](_0x58528a);}})[_0x50af('0x2a')](function(_0x433f0e){if(_0x433f0e){return _0x433f0e?{'count':_0x35b373,'rows':_0x433f0e}:null;}})[_0x50af('0x2a')](respondWithResult(_0x12d478,null))[_0x50af('0x1d')](handleError(_0x12d478,null));};exports[_0x50af('0x50')]=function(_0x3a3b7b,_0xe9f5ed,_0x26d230){var _0x19e95b={};var _0x3bee86={};var _0x461d12;var _0x348e13;return db[_0x50af('0x44')]['findOne']({'where':{'id':_0x3a3b7b[_0x50af('0x43')]['id']}})[_0x50af('0x2a')](handleEntityNotFound(_0xe9f5ed,null))[_0x50af('0x2a')](function(_0x3b73a7){if(_0x3b73a7){_0x461d12=_0x3b73a7;_0x3bee86[_0x50af('0x2d')]=_[_0x50af('0x2e')](db['DeskField']['rawAttributes']);_0x3bee86['query']=_['keys'](_0x3a3b7b[_0x50af('0x2f')]);_0x3bee86['filters']=_[_0x50af('0x33')](_0x3bee86[_0x50af('0x2d')],_0x3bee86[_0x50af('0x2f')]);_0x19e95b[_0x50af('0x35')]=_[_0x50af('0x33')](_0x3bee86[_0x50af('0x2d')],qs[_0x50af('0x34')](_0x3a3b7b['query']['fields']));_0x19e95b['attributes']=_0x19e95b[_0x50af('0x35')][_0x50af('0x36')]?_0x19e95b['attributes']:_0x3bee86[_0x50af('0x2d')];_0x19e95b[_0x50af('0x4e')]=qs[_0x50af('0x39')](_0x3a3b7b[_0x50af('0x2f')][_0x50af('0x39')]);_0x19e95b[_0x50af('0x3a')]=qs['filters'](_[_0x50af('0x3b')](_0x3a3b7b[_0x50af('0x2f')],_0x3bee86[_0x50af('0x32')]));if(_0x3a3b7b[_0x50af('0x2f')][_0x50af('0x3e')]){_0x19e95b['where']=_[_0x50af('0x3d')](_0x19e95b['where'],{'$or':_[_0x50af('0x4f')](_0x19e95b[_0x50af('0x35')],function(_0x3928d8){var _0x46a588={};_0x46a588[_0x3928d8]={'$like':'%'+_0x3a3b7b[_0x50af('0x2f')][_0x50af('0x3e')]+'%'};return _0x46a588;})});}_0x19e95b=_['merge']({},_0x19e95b,_0x3a3b7b['options']);return _0x461d12[_0x50af('0x50')](_0x19e95b);}})[_0x50af('0x2a')](function(_0x4bd935){if(_0x4bd935){_0x348e13=_0x4bd935[_0x50af('0x36')];if(!_0x3a3b7b[_0x50af('0x2f')][_0x50af('0x37')](_0x50af('0x38'))){_0x19e95b[_0x50af('0x23')]=qs['limit'](_0x3a3b7b['query'][_0x50af('0x23')]);_0x19e95b[_0x50af('0x22')]=qs['offset'](_0x3a3b7b[_0x50af('0x2f')][_0x50af('0x22')]);}return _0x461d12[_0x50af('0x50')](_0x19e95b);}})[_0x50af('0x2a')](function(_0x55a04a){if(_0x55a04a){return _0x55a04a?{'count':_0x348e13,'rows':_0x55a04a}:null;}})[_0x50af('0x2a')](respondWithResult(_0xe9f5ed,null))[_0x50af('0x1d')](handleError(_0xe9f5ed,null));};exports[_0x50af('0x51')]=function(_0x3a52d1,_0xa38bfe,_0x5ca675){var _0x121a36={};var _0xcd0fa2={};var _0x14a014;var _0x543ec1;return db[_0x50af('0x44')][_0x50af('0x4c')]({'where':{'id':_0x3a52d1[_0x50af('0x43')]['id']}})[_0x50af('0x2a')](handleEntityNotFound(_0xa38bfe,null))['then'](function(_0x2f283a){if(_0x2f283a){_0x14a014=_0x2f283a;_0xcd0fa2['model']=_[_0x50af('0x2e')](db['Tag']['rawAttributes']);_0xcd0fa2[_0x50af('0x2f')]=_[_0x50af('0x2e')](_0x3a52d1[_0x50af('0x2f')]);_0xcd0fa2[_0x50af('0x32')]=_['intersection'](_0xcd0fa2[_0x50af('0x2d')],_0xcd0fa2['query']);_0x121a36[_0x50af('0x35')]=_[_0x50af('0x33')](_0xcd0fa2['model'],qs[_0x50af('0x34')](_0x3a52d1[_0x50af('0x2f')][_0x50af('0x34')]));_0x121a36[_0x50af('0x35')]=_0x121a36[_0x50af('0x35')][_0x50af('0x36')]?_0x121a36[_0x50af('0x35')]:_0xcd0fa2[_0x50af('0x2d')];_0x121a36[_0x50af('0x4e')]=qs['sort'](_0x3a52d1[_0x50af('0x2f')][_0x50af('0x39')]);_0x121a36[_0x50af('0x3a')]=qs['filters'](_[_0x50af('0x3b')](_0x3a52d1[_0x50af('0x2f')],_0xcd0fa2[_0x50af('0x32')]));if(_0x3a52d1[_0x50af('0x2f')][_0x50af('0x3e')]){_0x121a36[_0x50af('0x3a')]=_[_0x50af('0x3d')](_0x121a36[_0x50af('0x3a')],{'$or':_['map'](_0x121a36[_0x50af('0x35')],function(_0x3c461d){var _0x3b59c6={};_0x3b59c6[_0x3c461d]={'$like':'%'+_0x3a52d1[_0x50af('0x2f')][_0x50af('0x3e')]+'%'};return _0x3b59c6;})});}_0x121a36=_[_0x50af('0x3d')]({},_0x121a36,_0x3a52d1['options']);return _0x14a014[_0x50af('0x51')](_0x121a36);}})[_0x50af('0x2a')](function(_0x5cd55f){if(_0x5cd55f){_0x543ec1=_0x5cd55f[_0x50af('0x36')];if(!_0x3a52d1[_0x50af('0x2f')][_0x50af('0x37')](_0x50af('0x38'))){_0x121a36['limit']=qs[_0x50af('0x23')](_0x3a52d1[_0x50af('0x2f')][_0x50af('0x23')]);_0x121a36[_0x50af('0x22')]=qs[_0x50af('0x22')](_0x3a52d1[_0x50af('0x2f')][_0x50af('0x22')]);}return _0x14a014['getTags'](_0x121a36);}})['then'](function(_0x425d6f){if(_0x425d6f){return _0x425d6f?{'count':_0x543ec1,'rows':_0x425d6f}:null;}})['then'](respondWithResult(_0xa38bfe,null))[_0x50af('0x1d')](handleError(_0xa38bfe,null));};exports[_0x50af('0x52')]=function(_0x4e7c4b,_0x20720b,_0x34ce92){if(_0x4e7c4b[_0x50af('0x4a')]['id']){delete _0x4e7c4b['body']['id'];}return db[_0x50af('0x44')]['findOne']({'where':{'id':_0x4e7c4b[_0x50af('0x43')]['id']}})[_0x50af('0x2a')](handleEntityNotFound(_0x20720b,null))[_0x50af('0x2a')](function(_0x37f13d){if(_0x37f13d){return _0x37f13d[_0x50af('0x52')](_0x4e7c4b[_0x50af('0x4a')]['ids']||[]);}return null;})[_0x50af('0x2a')](respondWithResult(_0x20720b,null))[_0x50af('0x1d')](handleError(_0x20720b,null));};
\ No newline at end of file
+var _0x8f9d=['info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','DeskConfiguration,\x20%s,\x20%s','result','message','catch','sendStatus','end','status','count','offset','limit','reject','destroy','send','index','rawAttributes','model','keys','dateEnd','query','dateStart','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','day','merge','filter','options','DeskConfiguration','includeAll','include','findAll','show','params','find','create','body','update','getFields','findOne','DeskField','map','getSubjects','getDescriptions','Tag','getTags','setTags','ids','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then'];(function(_0x1c4337,_0x3fd707){var _0x53aca6=function(_0x14ad2d){while(--_0x14ad2d){_0x1c4337['push'](_0x1c4337['shift']());}};_0x53aca6(++_0x3fd707);}(_0x8f9d,0x93));var _0xd8f9=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8f9d[_0xfae23b];return _0x200640;};'use strict';var pdf=require(_0xd8f9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd8f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8f9('0x2'));var rp=require(_0xd8f9('0x3'));var moment=require(_0xd8f9('0x4'));var BPromise=require(_0xd8f9('0x5'));var Mustache=require(_0xd8f9('0x6'));var util=require(_0xd8f9('0x7'));var path=require(_0xd8f9('0x8'));var sox=require('sox');var csv=require(_0xd8f9('0x9'));var ejs=require(_0xd8f9('0xa'));var fs=require('fs');var _=require(_0xd8f9('0xb'));var squel=require(_0xd8f9('0xc'));var crypto=require(_0xd8f9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd8f9('0xe'));var toCsv=require(_0xd8f9('0x9'));var querystring=require('querystring');var Papa=require(_0xd8f9('0xf'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xd8f9('0x10'));var utils=require(_0xd8f9('0x11'));var config=require(_0xd8f9('0x12'));var db=require(_0xd8f9('0x13'))['db'];var jayson=require(_0xd8f9('0x14'));var client=jayson[_0xd8f9('0x15')][_0xd8f9('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x4bd11c,_0x3a214b,_0x56e0d6,_0x39aca0){return new BPromise(function(_0x45aba0,_0x11c122){var _0x5b01ce=_0x39aca0||client;return _0x5b01ce[_0xd8f9('0x17')](_0x4bd11c,_0x56e0d6)[_0xd8f9('0x18')](function(_0x4cfebf){logger[_0xd8f9('0x19')]('DeskConfiguration,\x20%s,\x20%s',_0x3a214b,_0xd8f9('0x1a'));logger[_0xd8f9('0x1b')](_0xd8f9('0x1c'),_0x3a214b,_0xd8f9('0x1a'),JSON[_0xd8f9('0x1d')](_0x4cfebf));if(_0x4cfebf[_0xd8f9('0x1e')]){if(_0x4cfebf[_0xd8f9('0x1e')]['code']===0x1f4){logger['error'](_0xd8f9('0x1f'),_0x3a214b,_0x4cfebf[_0xd8f9('0x1e')]['message']);return _0x11c122(_0x4cfebf[_0xd8f9('0x1e')]['message']);}logger[_0xd8f9('0x1e')]('DeskConfiguration,\x20%s,\x20%s',_0x3a214b,_0x4cfebf['error']['message']);return _0x45aba0(_0x4cfebf[_0xd8f9('0x1e')]['message']);}else{logger[_0xd8f9('0x19')](_0xd8f9('0x1f'),_0x3a214b,_0xd8f9('0x1a'));_0x45aba0(_0x4cfebf[_0xd8f9('0x20')][_0xd8f9('0x21')]);}})[_0xd8f9('0x22')](function(_0x5863ad){logger[_0xd8f9('0x1e')](_0xd8f9('0x1f'),_0x3a214b,_0x5863ad);_0x11c122(_0x5863ad);});});}function respondWithStatusCode(_0x164bf6,_0x36d740){_0x36d740=_0x36d740||0xcc;return function(_0x1bf210){if(_0x1bf210){return _0x164bf6[_0xd8f9('0x23')](_0x36d740);}return _0x164bf6['status'](_0x36d740)[_0xd8f9('0x24')]();};}function respondWithResult(_0xbd09da,_0x1fcd45){_0x1fcd45=_0x1fcd45||0xc8;return function(_0x956cc3){if(_0x956cc3){return _0xbd09da[_0xd8f9('0x25')](_0x1fcd45)['json'](_0x956cc3);}};}function respondWithFilteredResult(_0xcc9b18,_0x1d6796){return function(_0x28854a){if(_0x28854a){var _0xd15475=_0x28854a[_0xd8f9('0x26')],_0x3e68dc=_0x1d6796['offset'],_0x9e1d6d=_0x1d6796[_0xd8f9('0x27')]+_0x1d6796[_0xd8f9('0x28')],_0x175123;if(_0x9e1d6d>=_0xd15475){_0x9e1d6d=_0xd15475;_0x175123=0xc8;}else{_0x175123=0xce;}_0xcc9b18[_0xd8f9('0x25')](_0x175123);return _0xcc9b18['set']('Content-Range',_0x3e68dc+'-'+_0x9e1d6d+'/'+_0xd15475)['json'](_0x28854a);}return null;};}function patchUpdates(_0x3f85a2){return function(_0x2c25c2){try{jsonpatch['apply'](_0x2c25c2,_0x3f85a2,!![]);}catch(_0x2bda39){return BPromise[_0xd8f9('0x29')](_0x2bda39);}return _0x2c25c2['save']();};}function saveUpdates(_0x4b0de7,_0x13fa4b){return function(_0x2786db){if(_0x2786db){return _0x2786db['update'](_0x4b0de7)[_0xd8f9('0x18')](function(_0x48f7c0){return _0x48f7c0;});}return null;};}function removeEntity(_0x1a280a,_0x2f3cb9){return function(_0x4ab385){if(_0x4ab385){return _0x4ab385[_0xd8f9('0x2a')]()['then'](function(){_0x1a280a[_0xd8f9('0x25')](0xcc)[_0xd8f9('0x24')]();});}};}function handleEntityNotFound(_0x26b7ff,_0x394399){return function(_0x402b73){if(!_0x402b73){_0x26b7ff[_0xd8f9('0x23')](0x194);}return _0x402b73;};}function handleError(_0xcfd867,_0x5211c2){_0x5211c2=_0x5211c2||0x1f4;return function(_0x11d865){logger['error'](_0x11d865['stack']);if(_0x11d865['name']){delete _0x11d865['name'];}_0xcfd867[_0xd8f9('0x25')](_0x5211c2)[_0xd8f9('0x2b')](_0x11d865);};}exports[_0xd8f9('0x2c')]=function(_0x1ec068,_0x36b8fa){var _0x5b197a={},_0x4e7265={},_0x1d5c7d={'count':0x0,'rows':[]};var _0x97278d=db['DeskConfiguration'][_0xd8f9('0x2d')];_0x4e7265[_0xd8f9('0x2e')]=_[_0xd8f9('0x2f')](_0x97278d);var _0x5cd7a7={'dateStart':_0x1ec068['query']['dateStart'],'dateEnd':_0x1ec068['query'][_0xd8f9('0x30')]};delete _0x1ec068[_0xd8f9('0x31')][_0xd8f9('0x32')];delete _0x1ec068[_0xd8f9('0x31')][_0xd8f9('0x30')];_0x4e7265['query']=_[_0xd8f9('0x2f')](_0x1ec068[_0xd8f9('0x31')]);_0x4e7265[_0xd8f9('0x33')]=_[_0xd8f9('0x34')](_0x4e7265[_0xd8f9('0x2e')],_0x4e7265[_0xd8f9('0x31')]);_0x5b197a[_0xd8f9('0x35')]=_[_0xd8f9('0x34')](_0x4e7265[_0xd8f9('0x2e')],qs[_0xd8f9('0x36')](_0x1ec068[_0xd8f9('0x31')]['fields']));_0x5b197a[_0xd8f9('0x35')]=_0x5b197a[_0xd8f9('0x35')][_0xd8f9('0x37')]?_0x5b197a[_0xd8f9('0x35')]:_0x4e7265['model'];if(!_0x1ec068[_0xd8f9('0x31')][_0xd8f9('0x38')](_0xd8f9('0x39'))){_0x5b197a[_0xd8f9('0x28')]=qs[_0xd8f9('0x28')](_0x1ec068[_0xd8f9('0x31')]['limit']);_0x5b197a['offset']=qs['offset'](_0x1ec068[_0xd8f9('0x31')][_0xd8f9('0x27')]);}_0x5b197a[_0xd8f9('0x3a')]=qs[_0xd8f9('0x3b')](_0x1ec068[_0xd8f9('0x31')][_0xd8f9('0x3b')]);_0x5b197a[_0xd8f9('0x3c')]=qs[_0xd8f9('0x33')](_[_0xd8f9('0x3d')](_0x1ec068['query'],_0x4e7265['filters']));if(_0x5cd7a7[_0xd8f9('0x32')]){if(_0x5cd7a7[_0xd8f9('0x30')]){_0x5cd7a7[_0xd8f9('0x30')]=moment(_0x5cd7a7['dateEnd'])['add'](0x1,_0xd8f9('0x3e'));}else{_0x5cd7a7[_0xd8f9('0x30')]=moment(_0x5cd7a7[_0xd8f9('0x32')])['add'](0x1,_0xd8f9('0x3e'));}_[_0xd8f9('0x3f')](_0x5b197a[_0xd8f9('0x3c')],{'createdAt':{'$gte':_0x5cd7a7[_0xd8f9('0x32')],'$lte':_0x5cd7a7[_0xd8f9('0x30')]}});}if(_0x1ec068[_0xd8f9('0x31')][_0xd8f9('0x40')]){_0x5b197a[_0xd8f9('0x3c')]=_[_0xd8f9('0x3f')](_0x5b197a['where'],{'$or':_['map'](_0x5b197a['attributes'],function(_0x1ba90a){var _0x2c8f19={};_0x2c8f19[_0x1ba90a]={'$like':'%'+_0x1ec068[_0xd8f9('0x31')][_0xd8f9('0x40')]+'%'};return _0x2c8f19;})});}_0x5b197a=_[_0xd8f9('0x3f')]({},_0x5b197a,_0x1ec068[_0xd8f9('0x41')]);var _0x1b1782={'where':_0x5b197a[_0xd8f9('0x3c')]};return db[_0xd8f9('0x42')][_0xd8f9('0x26')](_0x1b1782)[_0xd8f9('0x18')](function(_0xd5bb17){_0x1d5c7d[_0xd8f9('0x26')]=_0xd5bb17;if(_0x1ec068['query'][_0xd8f9('0x43')]){_0x5b197a[_0xd8f9('0x44')]=[{'all':!![]}];}return db[_0xd8f9('0x42')][_0xd8f9('0x45')](_0x5b197a);})['then'](function(_0x243d47){_0x1d5c7d['rows']=_0x243d47;return _0x1d5c7d;})['then'](respondWithFilteredResult(_0x36b8fa,_0x5b197a))[_0xd8f9('0x22')](handleError(_0x36b8fa,null));};exports[_0xd8f9('0x46')]=function(_0x1614aa,_0x1361c4){var _0x11a20f={'raw':![],'where':{'id':_0x1614aa[_0xd8f9('0x47')]['id']}},_0x44eea8={};_0x44eea8[_0xd8f9('0x2e')]=_[_0xd8f9('0x2f')](db[_0xd8f9('0x42')]['rawAttributes']);_0x44eea8['query']=_['keys'](_0x1614aa[_0xd8f9('0x31')]);_0x44eea8[_0xd8f9('0x33')]=_['intersection'](_0x44eea8[_0xd8f9('0x2e')],_0x44eea8[_0xd8f9('0x31')]);_0x11a20f[_0xd8f9('0x35')]=_[_0xd8f9('0x34')](_0x44eea8[_0xd8f9('0x2e')],qs[_0xd8f9('0x36')](_0x1614aa[_0xd8f9('0x31')][_0xd8f9('0x36')]));_0x11a20f['attributes']=_0x11a20f[_0xd8f9('0x35')][_0xd8f9('0x37')]?_0x11a20f[_0xd8f9('0x35')]:_0x44eea8[_0xd8f9('0x2e')];if(_0x1614aa[_0xd8f9('0x31')][_0xd8f9('0x43')]){_0x11a20f[_0xd8f9('0x44')]=[{'all':!![]}];}_0x11a20f=_[_0xd8f9('0x3f')]({},_0x11a20f,_0x1614aa[_0xd8f9('0x41')]);return db[_0xd8f9('0x42')][_0xd8f9('0x48')](_0x11a20f)['then'](handleEntityNotFound(_0x1361c4,null))[_0xd8f9('0x18')](respondWithResult(_0x1361c4,null))[_0xd8f9('0x22')](handleError(_0x1361c4,null));};exports[_0xd8f9('0x49')]=function(_0x273eda,_0x5a0e67){return db[_0xd8f9('0x42')][_0xd8f9('0x49')](_0x273eda[_0xd8f9('0x4a')],{})['then'](respondWithResult(_0x5a0e67,0xc9))[_0xd8f9('0x22')](handleError(_0x5a0e67,null));};exports[_0xd8f9('0x4b')]=function(_0x2218da,_0x2499e4){if(_0x2218da['body']['id']){delete _0x2218da[_0xd8f9('0x4a')]['id'];}return db[_0xd8f9('0x42')]['find']({'where':{'id':_0x2218da['params']['id']}})[_0xd8f9('0x18')](handleEntityNotFound(_0x2499e4,null))[_0xd8f9('0x18')](saveUpdates(_0x2218da[_0xd8f9('0x4a')],null))['then'](respondWithResult(_0x2499e4,null))[_0xd8f9('0x22')](handleError(_0x2499e4,null));};exports['destroy']=function(_0x1a45a8,_0x488c4b){return db[_0xd8f9('0x42')][_0xd8f9('0x48')]({'where':{'id':_0x1a45a8[_0xd8f9('0x47')]['id']}})[_0xd8f9('0x18')](handleEntityNotFound(_0x488c4b,null))['then'](removeEntity(_0x488c4b,null))[_0xd8f9('0x22')](handleError(_0x488c4b,null));};exports[_0xd8f9('0x4c')]=function(_0x10aa0a,_0xe2e546,_0x3b1db1){var _0x46487b={};var _0x381daf={};var _0x1d4c12;var _0x58f898;return db[_0xd8f9('0x42')][_0xd8f9('0x4d')]({'where':{'id':_0x10aa0a[_0xd8f9('0x47')]['id']}})[_0xd8f9('0x18')](handleEntityNotFound(_0xe2e546,null))[_0xd8f9('0x18')](function(_0x5063fa){if(_0x5063fa){_0x1d4c12=_0x5063fa;_0x381daf['model']=_['keys'](db[_0xd8f9('0x4e')][_0xd8f9('0x2d')]);_0x381daf['query']=_['keys'](_0x10aa0a[_0xd8f9('0x31')]);_0x381daf[_0xd8f9('0x33')]=_[_0xd8f9('0x34')](_0x381daf[_0xd8f9('0x2e')],_0x381daf[_0xd8f9('0x31')]);_0x46487b[_0xd8f9('0x35')]=_['intersection'](_0x381daf[_0xd8f9('0x2e')],qs[_0xd8f9('0x36')](_0x10aa0a[_0xd8f9('0x31')][_0xd8f9('0x36')]));_0x46487b['attributes']=_0x46487b[_0xd8f9('0x35')][_0xd8f9('0x37')]?_0x46487b[_0xd8f9('0x35')]:_0x381daf[_0xd8f9('0x2e')];_0x46487b[_0xd8f9('0x3a')]=qs[_0xd8f9('0x3b')](_0x10aa0a[_0xd8f9('0x31')][_0xd8f9('0x3b')]);_0x46487b[_0xd8f9('0x3c')]=qs['filters'](_['pick'](_0x10aa0a['query'],_0x381daf[_0xd8f9('0x33')]));if(_0x10aa0a[_0xd8f9('0x31')][_0xd8f9('0x40')]){_0x46487b[_0xd8f9('0x3c')]=_[_0xd8f9('0x3f')](_0x46487b[_0xd8f9('0x3c')],{'$or':_[_0xd8f9('0x4f')](_0x46487b[_0xd8f9('0x35')],function(_0x5865ec){var _0x387bc4={};_0x387bc4[_0x5865ec]={'$like':'%'+_0x10aa0a['query'][_0xd8f9('0x40')]+'%'};return _0x387bc4;})});}_0x46487b=_[_0xd8f9('0x3f')]({},_0x46487b,_0x10aa0a[_0xd8f9('0x41')]);return _0x1d4c12[_0xd8f9('0x4c')](_0x46487b);}})[_0xd8f9('0x18')](function(_0x19b6c0){if(_0x19b6c0){_0x58f898=_0x19b6c0[_0xd8f9('0x37')];if(!_0x10aa0a[_0xd8f9('0x31')]['hasOwnProperty'](_0xd8f9('0x39'))){_0x46487b['limit']=qs[_0xd8f9('0x28')](_0x10aa0a['query']['limit']);_0x46487b[_0xd8f9('0x27')]=qs['offset'](_0x10aa0a['query'][_0xd8f9('0x27')]);}return _0x1d4c12[_0xd8f9('0x4c')](_0x46487b);}})[_0xd8f9('0x18')](function(_0x3c555a){if(_0x3c555a){return _0x3c555a?{'count':_0x58f898,'rows':_0x3c555a}:null;}})[_0xd8f9('0x18')](respondWithResult(_0xe2e546,null))['catch'](handleError(_0xe2e546,null));};exports[_0xd8f9('0x50')]=function(_0x44e31f,_0x58e951,_0xbd80a9){var _0x1ca6a9={};var _0x2230af={};var _0x113a04;var _0x5e9c68;return db[_0xd8f9('0x42')]['findOne']({'where':{'id':_0x44e31f[_0xd8f9('0x47')]['id']}})[_0xd8f9('0x18')](handleEntityNotFound(_0x58e951,null))[_0xd8f9('0x18')](function(_0x2544ae){if(_0x2544ae){_0x113a04=_0x2544ae;_0x2230af[_0xd8f9('0x2e')]=_[_0xd8f9('0x2f')](db[_0xd8f9('0x4e')][_0xd8f9('0x2d')]);_0x2230af[_0xd8f9('0x31')]=_[_0xd8f9('0x2f')](_0x44e31f[_0xd8f9('0x31')]);_0x2230af[_0xd8f9('0x33')]=_[_0xd8f9('0x34')](_0x2230af[_0xd8f9('0x2e')],_0x2230af[_0xd8f9('0x31')]);_0x1ca6a9[_0xd8f9('0x35')]=_[_0xd8f9('0x34')](_0x2230af[_0xd8f9('0x2e')],qs['fields'](_0x44e31f[_0xd8f9('0x31')][_0xd8f9('0x36')]));_0x1ca6a9['attributes']=_0x1ca6a9[_0xd8f9('0x35')][_0xd8f9('0x37')]?_0x1ca6a9[_0xd8f9('0x35')]:_0x2230af[_0xd8f9('0x2e')];_0x1ca6a9[_0xd8f9('0x3a')]=qs['sort'](_0x44e31f[_0xd8f9('0x31')]['sort']);_0x1ca6a9[_0xd8f9('0x3c')]=qs['filters'](_[_0xd8f9('0x3d')](_0x44e31f[_0xd8f9('0x31')],_0x2230af['filters']));if(_0x44e31f[_0xd8f9('0x31')]['filter']){_0x1ca6a9['where']=_[_0xd8f9('0x3f')](_0x1ca6a9['where'],{'$or':_['map'](_0x1ca6a9[_0xd8f9('0x35')],function(_0x4ce332){var _0xebea11={};_0xebea11[_0x4ce332]={'$like':'%'+_0x44e31f['query'][_0xd8f9('0x40')]+'%'};return _0xebea11;})});}_0x1ca6a9=_[_0xd8f9('0x3f')]({},_0x1ca6a9,_0x44e31f['options']);return _0x113a04[_0xd8f9('0x50')](_0x1ca6a9);}})[_0xd8f9('0x18')](function(_0x3754bd){if(_0x3754bd){_0x5e9c68=_0x3754bd[_0xd8f9('0x37')];if(!_0x44e31f['query'][_0xd8f9('0x38')](_0xd8f9('0x39'))){_0x1ca6a9[_0xd8f9('0x28')]=qs[_0xd8f9('0x28')](_0x44e31f[_0xd8f9('0x31')][_0xd8f9('0x28')]);_0x1ca6a9[_0xd8f9('0x27')]=qs[_0xd8f9('0x27')](_0x44e31f['query'][_0xd8f9('0x27')]);}return _0x113a04[_0xd8f9('0x50')](_0x1ca6a9);}})['then'](function(_0x495427){if(_0x495427){return _0x495427?{'count':_0x5e9c68,'rows':_0x495427}:null;}})['then'](respondWithResult(_0x58e951,null))[_0xd8f9('0x22')](handleError(_0x58e951,null));};exports[_0xd8f9('0x51')]=function(_0x20ffdc,_0xe8ca0b,_0x1a04d7){var _0x49b26f={};var _0x13d440={};var _0x139ece;var _0x305b5c;return db[_0xd8f9('0x42')][_0xd8f9('0x4d')]({'where':{'id':_0x20ffdc['params']['id']}})[_0xd8f9('0x18')](handleEntityNotFound(_0xe8ca0b,null))['then'](function(_0x7d2deb){if(_0x7d2deb){_0x139ece=_0x7d2deb;_0x13d440['model']=_[_0xd8f9('0x2f')](db['DeskField'][_0xd8f9('0x2d')]);_0x13d440[_0xd8f9('0x31')]=_[_0xd8f9('0x2f')](_0x20ffdc['query']);_0x13d440[_0xd8f9('0x33')]=_['intersection'](_0x13d440[_0xd8f9('0x2e')],_0x13d440[_0xd8f9('0x31')]);_0x49b26f[_0xd8f9('0x35')]=_[_0xd8f9('0x34')](_0x13d440[_0xd8f9('0x2e')],qs[_0xd8f9('0x36')](_0x20ffdc['query'][_0xd8f9('0x36')]));_0x49b26f[_0xd8f9('0x35')]=_0x49b26f[_0xd8f9('0x35')][_0xd8f9('0x37')]?_0x49b26f[_0xd8f9('0x35')]:_0x13d440[_0xd8f9('0x2e')];_0x49b26f[_0xd8f9('0x3a')]=qs['sort'](_0x20ffdc[_0xd8f9('0x31')]['sort']);_0x49b26f[_0xd8f9('0x3c')]=qs[_0xd8f9('0x33')](_[_0xd8f9('0x3d')](_0x20ffdc['query'],_0x13d440['filters']));if(_0x20ffdc[_0xd8f9('0x31')][_0xd8f9('0x40')]){_0x49b26f['where']=_['merge'](_0x49b26f[_0xd8f9('0x3c')],{'$or':_[_0xd8f9('0x4f')](_0x49b26f[_0xd8f9('0x35')],function(_0x3d6103){var _0x460ddb={};_0x460ddb[_0x3d6103]={'$like':'%'+_0x20ffdc[_0xd8f9('0x31')]['filter']+'%'};return _0x460ddb;})});}_0x49b26f=_[_0xd8f9('0x3f')]({},_0x49b26f,_0x20ffdc['options']);return _0x139ece[_0xd8f9('0x51')](_0x49b26f);}})[_0xd8f9('0x18')](function(_0x460620){if(_0x460620){_0x305b5c=_0x460620['length'];if(!_0x20ffdc[_0xd8f9('0x31')]['hasOwnProperty'](_0xd8f9('0x39'))){_0x49b26f[_0xd8f9('0x28')]=qs[_0xd8f9('0x28')](_0x20ffdc['query'][_0xd8f9('0x28')]);_0x49b26f[_0xd8f9('0x27')]=qs[_0xd8f9('0x27')](_0x20ffdc[_0xd8f9('0x31')][_0xd8f9('0x27')]);}return _0x139ece[_0xd8f9('0x51')](_0x49b26f);}})[_0xd8f9('0x18')](function(_0x220c37){if(_0x220c37){return _0x220c37?{'count':_0x305b5c,'rows':_0x220c37}:null;}})[_0xd8f9('0x18')](respondWithResult(_0xe8ca0b,null))[_0xd8f9('0x22')](handleError(_0xe8ca0b,null));};exports['getTags']=function(_0x2b2bfc,_0x18737b,_0x4d24a0){var _0x203f2c={};var _0x503da3={};var _0x11e5f9;var _0x1b48ee;return db[_0xd8f9('0x42')][_0xd8f9('0x4d')]({'where':{'id':_0x2b2bfc[_0xd8f9('0x47')]['id']}})['then'](handleEntityNotFound(_0x18737b,null))[_0xd8f9('0x18')](function(_0x2d59d4){if(_0x2d59d4){_0x11e5f9=_0x2d59d4;_0x503da3[_0xd8f9('0x2e')]=_[_0xd8f9('0x2f')](db[_0xd8f9('0x52')][_0xd8f9('0x2d')]);_0x503da3[_0xd8f9('0x31')]=_[_0xd8f9('0x2f')](_0x2b2bfc[_0xd8f9('0x31')]);_0x503da3[_0xd8f9('0x33')]=_[_0xd8f9('0x34')](_0x503da3[_0xd8f9('0x2e')],_0x503da3[_0xd8f9('0x31')]);_0x203f2c[_0xd8f9('0x35')]=_[_0xd8f9('0x34')](_0x503da3[_0xd8f9('0x2e')],qs[_0xd8f9('0x36')](_0x2b2bfc[_0xd8f9('0x31')]['fields']));_0x203f2c[_0xd8f9('0x35')]=_0x203f2c[_0xd8f9('0x35')][_0xd8f9('0x37')]?_0x203f2c[_0xd8f9('0x35')]:_0x503da3[_0xd8f9('0x2e')];_0x203f2c[_0xd8f9('0x3a')]=qs[_0xd8f9('0x3b')](_0x2b2bfc['query']['sort']);_0x203f2c[_0xd8f9('0x3c')]=qs['filters'](_['pick'](_0x2b2bfc[_0xd8f9('0x31')],_0x503da3['filters']));if(_0x2b2bfc[_0xd8f9('0x31')][_0xd8f9('0x40')]){_0x203f2c[_0xd8f9('0x3c')]=_[_0xd8f9('0x3f')](_0x203f2c[_0xd8f9('0x3c')],{'$or':_[_0xd8f9('0x4f')](_0x203f2c[_0xd8f9('0x35')],function(_0x564472){var _0x22bd60={};_0x22bd60[_0x564472]={'$like':'%'+_0x2b2bfc[_0xd8f9('0x31')][_0xd8f9('0x40')]+'%'};return _0x22bd60;})});}_0x203f2c=_['merge']({},_0x203f2c,_0x2b2bfc['options']);return _0x11e5f9[_0xd8f9('0x53')](_0x203f2c);}})[_0xd8f9('0x18')](function(_0x31bf8f){if(_0x31bf8f){_0x1b48ee=_0x31bf8f['length'];if(!_0x2b2bfc['query']['hasOwnProperty'](_0xd8f9('0x39'))){_0x203f2c[_0xd8f9('0x28')]=qs['limit'](_0x2b2bfc[_0xd8f9('0x31')]['limit']);_0x203f2c['offset']=qs[_0xd8f9('0x27')](_0x2b2bfc[_0xd8f9('0x31')][_0xd8f9('0x27')]);}return _0x11e5f9[_0xd8f9('0x53')](_0x203f2c);}})['then'](function(_0x2eab44){if(_0x2eab44){return _0x2eab44?{'count':_0x1b48ee,'rows':_0x2eab44}:null;}})[_0xd8f9('0x18')](respondWithResult(_0x18737b,null))[_0xd8f9('0x22')](handleError(_0x18737b,null));};exports[_0xd8f9('0x54')]=function(_0x35e0b1,_0x1a156d,_0x204096){if(_0x35e0b1['body']['id']){delete _0x35e0b1[_0xd8f9('0x4a')]['id'];}return db[_0xd8f9('0x42')]['findOne']({'where':{'id':_0x35e0b1['params']['id']}})[_0xd8f9('0x18')](handleEntityNotFound(_0x1a156d,null))[_0xd8f9('0x18')](function(_0xd16a68){if(_0xd16a68){return _0xd16a68[_0xd8f9('0x54')](_0x35e0b1[_0xd8f9('0x4a')][_0xd8f9('0x55')]||[]);}return null;})[_0xd8f9('0x18')](respondWithResult(_0x1a156d,null))[_0xd8f9('0x22')](handleError(_0x1a156d,null));};
\ No newline at end of file
index aef7cea..4872211 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cf8=['define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intDeskConfiguration.attributes','exports'];(function(_0x4ff00c,_0x7e938b){var _0x5dca5d=function(_0x3a18b6){while(--_0x3a18b6){_0x4ff00c['push'](_0x4ff00c['shift']());}};_0x5dca5d(++_0x7e938b);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x3a0863,_0x4cd5ef){_0x3a0863=_0x3a0863-0x0;var _0x85c557=_0x4cf8[_0x3a0863];return _0x85c557;};'use strict';var _=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var logger=require(_0x84cf('0x2'))(_0x84cf('0x3'));var moment=require(_0x84cf('0x4'));var BPromise=require(_0x84cf('0x5'));var rp=require(_0x84cf('0x6'));var attributes=require(_0x84cf('0x7'));module[_0x84cf('0x8')]=function(_0x2d38c0,_0x5844d7){return _0x2d38c0[_0x84cf('0x9')]('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3423=['DeskConfiguration','int_desk_configurations','../../config/logger','api','moment','bluebird','request-promise','./intDeskConfiguration.attributes','exports','define'];(function(_0x2d8fdb,_0x30e70c){var _0x3bc1c2=function(_0x592716){while(--_0x592716){_0x2d8fdb['push'](_0x2d8fdb['shift']());}};_0x3bc1c2(++_0x30e70c);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3342('0x0'))(_0x3342('0x1'));var moment=require(_0x3342('0x2'));var BPromise=require(_0x3342('0x3'));var rp=require(_0x3342('0x4'));var attributes=require(_0x3342('0x5'));module[_0x3342('0x6')]=function(_0x3c5d8d,_0x3075f8){return _0x3c5d8d[_0x3342('0x7')](_0x3342('0x8'),attributes,{'tableName':_0x3342('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 85faa56..a3bee3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2096b2,_0x53c8bd){var _0x540b16=function(_0x4f7d38){while(--_0x4f7d38){_0x2096b2['push'](_0x2096b2['shift']());}};_0x540b16(++_0x53c8bd);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0x0d8b('0x2'))['db'];var utils=require(_0x0d8b('0x3'));var logger=require(_0x0d8b('0x4'))(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0d8b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x227c63,_0x39f43a,_0x4a4470){return new BPromise(function(_0x413284,_0x284169){return client['request'](_0x227c63,_0x4a4470)[_0x0d8b('0x8')](function(_0x348e65){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x39f43a,_0x0d8b('0xb'));logger[_0x0d8b('0xc')](_0x0d8b('0xd'),_0x39f43a,_0x0d8b('0xb'),JSON['stringify'](_0x348e65));if(_0x348e65[_0x0d8b('0xe')]){if(_0x348e65['error'][_0x0d8b('0xf')]===0x1f4){logger[_0x0d8b('0xe')](_0x0d8b('0xa'),_0x39f43a,_0x348e65[_0x0d8b('0xe')][_0x0d8b('0x10')]);return _0x284169(_0x348e65[_0x0d8b('0xe')][_0x0d8b('0x10')]);}logger[_0x0d8b('0xe')](_0x0d8b('0xa'),_0x39f43a,_0x348e65[_0x0d8b('0xe')][_0x0d8b('0x10')]);return _0x413284(_0x348e65[_0x0d8b('0xe')][_0x0d8b('0x10')]);}else{logger[_0x0d8b('0x9')]('DeskConfiguration,\x20%s,\x20%s',_0x39f43a,_0x0d8b('0xb'));_0x413284(_0x348e65[_0x0d8b('0x11')][_0x0d8b('0x10')]);}})[_0x0d8b('0x12')](function(_0x2cb03c){logger['error'](_0x0d8b('0xa'),_0x39f43a,_0x2cb03c);_0x284169(_0x2cb03c);});});}
\ No newline at end of file
+var _0x0713=['result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var db=require(_0x3071('0x3'))['db'];var utils=require(_0x3071('0x4'));var logger=require('../../config/logger')(_0x3071('0x5'));var config=require(_0x3071('0x6'));var jayson=require(_0x3071('0x7'));var client=jayson[_0x3071('0x8')][_0x3071('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41cf76,_0x1d3dd6,_0x2f1e87){return new BPromise(function(_0xbd737f,_0x22274c){return client[_0x3071('0xa')](_0x41cf76,_0x2f1e87)[_0x3071('0xb')](function(_0x1a868e){logger['info'](_0x3071('0xc'),_0x1d3dd6,_0x3071('0xd'));logger[_0x3071('0xe')](_0x3071('0xf'),_0x1d3dd6,_0x3071('0xd'),JSON['stringify'](_0x1a868e));if(_0x1a868e[_0x3071('0x10')]){if(_0x1a868e[_0x3071('0x10')][_0x3071('0x11')]===0x1f4){logger[_0x3071('0x10')](_0x3071('0xc'),_0x1d3dd6,_0x1a868e['error']['message']);return _0x22274c(_0x1a868e[_0x3071('0x10')]['message']);}logger[_0x3071('0x10')](_0x3071('0xc'),_0x1d3dd6,_0x1a868e['error'][_0x3071('0x12')]);return _0xbd737f(_0x1a868e['error'][_0x3071('0x12')]);}else{logger[_0x3071('0x13')](_0x3071('0xc'),_0x1d3dd6,_0x3071('0xd'));_0xbd737f(_0x1a868e[_0x3071('0x14')][_0x3071('0x12')]);}})[_0x3071('0x15')](function(_0x11bdc9){logger[_0x3071('0x10')](_0x3071('0xc'),_0x1d3dd6,_0x11bdc9);_0x22274c(_0x11bdc9);});});}
\ No newline at end of file
index 1ada72b..fa07754 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd825=['isAuthenticated','/:id','show','post','delete','destroy','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./intDeskField.controller','get'];(function(_0x4f2fa1,_0x100e7e){var _0x5afbb1=function(_0x187ecb){while(--_0x187ecb){_0x4f2fa1['push'](_0x4f2fa1['shift']());}};_0x5afbb1(++_0x100e7e);}(_0xd825,0x7f));var _0x5d82=function(_0x1a3a8a,_0x211a09){_0x1a3a8a=_0x1a3a8a-0x0;var _0xad9401=_0xd825[_0x1a3a8a];return _0xad9401;};'use strict';var multer=require(_0x5d82('0x0'));var util=require(_0x5d82('0x1'));var path=require('path');var express=require(_0x5d82('0x2'));var router=express[_0x5d82('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5d82('0x4'));var config=require(_0x5d82('0x5'));var controller=require(_0x5d82('0x6'));router[_0x5d82('0x7')]('/',auth[_0x5d82('0x8')](),controller['index']);router[_0x5d82('0x7')](_0x5d82('0x9'),auth['isAuthenticated'](),controller[_0x5d82('0xa')]);router[_0x5d82('0xb')]('/',auth[_0x5d82('0x8')](),controller['create']);router['put']('/:id',auth[_0x5d82('0x8')](),controller['update']);router[_0x5d82('0xc')](_0x5d82('0x9'),auth['isAuthenticated'](),controller[_0x5d82('0xd')]);module[_0x5d82('0xe')]=router;
\ No newline at end of file
+var _0x840f=['delete','destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x840f,0x1ab));var _0xf840=function(_0x29de33,_0x1f9130){_0x29de33=_0x29de33-0x0;var _0x49f023=_0x840f[_0x29de33];return _0x49f023;};'use strict';var multer=require(_0xf840('0x0'));var util=require('util');var path=require(_0xf840('0x1'));var express=require(_0xf840('0x2'));var router=express[_0xf840('0x3')]();var auth=require(_0xf840('0x4'));var interaction=require(_0xf840('0x5'));var config=require(_0xf840('0x6'));var controller=require(_0xf840('0x7'));router[_0xf840('0x8')]('/',auth[_0xf840('0x9')](),controller[_0xf840('0xa')]);router[_0xf840('0x8')](_0xf840('0xb'),auth['isAuthenticated'](),controller[_0xf840('0xc')]);router[_0xf840('0xd')]('/',auth[_0xf840('0x9')](),controller[_0xf840('0xe')]);router['put'](_0xf840('0xb'),auth[_0xf840('0x9')](),controller['update']);router[_0xf840('0xf')](_0xf840('0xb'),auth[_0xf840('0x9')](),controller[_0xf840('0x10')]);module['exports']=router;
\ No newline at end of file
index f4b6eb6..203b40e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3f=['keyValue','STRING','string','variable','BOOLEAN','exports','ENUM'];(function(_0x24b4f2,_0x238011){var _0x55b5b5=function(_0x440c81){while(--_0x440c81){_0x24b4f2['push'](_0x24b4f2['shift']());}};_0x55b5b5(++_0x238011);}(_0xda3f,0xec));var _0xfda3=function(_0xa52c86,_0xc2e0a2){_0xa52c86=_0xa52c86-0x0;var _0x225825=_0xda3f[_0xa52c86];return _0x225825;};'use strict';var Sequelize=require('sequelize');module[_0xfda3('0x0')]={'type':{'type':Sequelize[_0xfda3('0x1')]('string','variable','customVariable',_0xfda3('0x2')),'defaultValue':'string'},'content':{'type':Sequelize[_0xfda3('0x3')]},'key':{'type':Sequelize[_0xfda3('0x3')]},'keyType':{'type':Sequelize['ENUM'](_0xfda3('0x4'),_0xfda3('0x5'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfda3('0x3')]},'nameField':{'type':Sequelize[_0xfda3('0x3')]},'customField':{'type':Sequelize[_0xfda3('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfda3('0x3')]}};
\ No newline at end of file
+var _0x2750=['sequelize','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x1c101f,_0x52141d){var _0xe02ee4=function(_0x1d9034){while(--_0x1d9034){_0x1c101f['push'](_0x1c101f['shift']());}};_0xe02ee4(++_0x52141d);}(_0x2750,0x13b));var _0x0275=function(_0x5b38ad,_0x35b4bc){_0x5b38ad=_0x5b38ad-0x0;var _0x1847b3=_0x2750[_0x5b38ad];return _0x1847b3;};'use strict';var Sequelize=require(_0x0275('0x0'));module['exports']={'type':{'type':Sequelize[_0x0275('0x1')](_0x0275('0x2'),_0x0275('0x3'),_0x0275('0x4'),_0x0275('0x5')),'defaultValue':_0x0275('0x2')},'content':{'type':Sequelize[_0x0275('0x6')]},'key':{'type':Sequelize[_0x0275('0x6')]},'keyType':{'type':Sequelize[_0x0275('0x1')](_0x0275('0x2'),'variable',_0x0275('0x4'))},'keyContent':{'type':Sequelize[_0x0275('0x6')]},'idField':{'type':Sequelize[_0x0275('0x6')]},'nameField':{'type':Sequelize[_0x0275('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0275('0x6')]}};
\ No newline at end of file
index fb2eeae..b01fc91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95cb=['moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','apply','reject','save','update','then','end','error','stack','name','send','index','DeskField','rawAttributes','keys','query','dateEnd','dateStart','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','day','add','where','merge','map','filter','options','include','findAll','catch','show','params','length','includeAll','find','create','body','destroy','html-pdf','eml-format','fast-json-patch','request-promise'];(function(_0x5d6c09,_0x374f93){var _0x503825=function(_0x2f9ef6){while(--_0x2f9ef6){_0x5d6c09['push'](_0x5d6c09['shift']());}};_0x503825(++_0x374f93);}(_0x95cb,0xda));var _0xb95c=function(_0x25e1bb,_0x5880fe){_0x25e1bb=_0x25e1bb-0x0;var _0x273373=_0x95cb[_0x25e1bb];return _0x273373;};'use strict';var pdf=require(_0xb95c('0x0'));var emlformat=require(_0xb95c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb95c('0x2'));var rp=require(_0xb95c('0x3'));var moment=require(_0xb95c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb95c('0x5'));var util=require(_0xb95c('0x6'));var path=require(_0xb95c('0x7'));var sox=require(_0xb95c('0x8'));var csv=require('to-csv');var ejs=require(_0xb95c('0x9'));var fs=require('fs');var _=require(_0xb95c('0xa'));var squel=require(_0xb95c('0xb'));var crypto=require(_0xb95c('0xc'));var jsforce=require(_0xb95c('0xd'));var deskjs=require(_0xb95c('0xe'));var toCsv=require(_0xb95c('0xf'));var querystring=require(_0xb95c('0x10'));var Papa=require(_0xb95c('0x11'));var qs=require(_0xb95c('0x12'));var logger=require('../../config/logger')(_0xb95c('0x13'));var utils=require(_0xb95c('0x14'));var config=require(_0xb95c('0x15'));var db=require(_0xb95c('0x16'))['db'];function respondWithStatusCode(_0x33d245,_0x1d0d55){_0x1d0d55=_0x1d0d55||0xcc;return function(_0x20eae5){if(_0x20eae5){return _0x33d245[_0xb95c('0x17')](_0x1d0d55);}return _0x33d245['status'](_0x1d0d55)['end']();};}function respondWithResult(_0x1f4261,_0x2e28b6){_0x2e28b6=_0x2e28b6||0xc8;return function(_0x172512){if(_0x172512){return _0x1f4261[_0xb95c('0x18')](_0x2e28b6)['json'](_0x172512);}};}function respondWithFilteredResult(_0x3c3d55,_0x32551){return function(_0x5869c4){if(_0x5869c4){var _0x581e69=_0x5869c4[_0xb95c('0x19')],_0x5ef3d3=_0x32551[_0xb95c('0x1a')],_0x39f1df=_0x32551[_0xb95c('0x1a')]+_0x32551[_0xb95c('0x1b')],_0x10e04f;if(_0x39f1df>=_0x581e69){_0x39f1df=_0x581e69;_0x10e04f=0xc8;}else{_0x10e04f=0xce;}_0x3c3d55[_0xb95c('0x18')](_0x10e04f);return _0x3c3d55[_0xb95c('0x1c')]('Content-Range',_0x5ef3d3+'-'+_0x39f1df+'/'+_0x581e69)['json'](_0x5869c4);}return null;};}function patchUpdates(_0xf6ec61){return function(_0x4305c5){try{jsonpatch[_0xb95c('0x1d')](_0x4305c5,_0xf6ec61,!![]);}catch(_0x40e21e){return BPromise[_0xb95c('0x1e')](_0x40e21e);}return _0x4305c5[_0xb95c('0x1f')]();};}function saveUpdates(_0x4630ee,_0x162a24){return function(_0x1aec37){if(_0x1aec37){return _0x1aec37[_0xb95c('0x20')](_0x4630ee)[_0xb95c('0x21')](function(_0x4e2318){return _0x4e2318;});}return null;};}function removeEntity(_0x37a9b9,_0x5d72a6){return function(_0x5e1ab2){if(_0x5e1ab2){return _0x5e1ab2['destroy']()[_0xb95c('0x21')](function(){_0x37a9b9['status'](0xcc)[_0xb95c('0x22')]();});}};}function handleEntityNotFound(_0x7fcb8b,_0x1b7537){return function(_0x4165cf){if(!_0x4165cf){_0x7fcb8b['sendStatus'](0x194);}return _0x4165cf;};}function handleError(_0x4212e3,_0xbeef7a){_0xbeef7a=_0xbeef7a||0x1f4;return function(_0x3994a7){logger[_0xb95c('0x23')](_0x3994a7[_0xb95c('0x24')]);if(_0x3994a7[_0xb95c('0x25')]){delete _0x3994a7[_0xb95c('0x25')];}_0x4212e3['status'](_0xbeef7a)[_0xb95c('0x26')](_0x3994a7);};}exports[_0xb95c('0x27')]=function(_0x40a951,_0x2a2c4a){var _0xb7d7fb={},_0x46b3b7={},_0x47b5f1={'count':0x0,'rows':[]};var _0x3dfdd2=db[_0xb95c('0x28')][_0xb95c('0x29')];_0x46b3b7['model']=_[_0xb95c('0x2a')](_0x3dfdd2);var _0x462792={'dateStart':_0x40a951[_0xb95c('0x2b')]['dateStart'],'dateEnd':_0x40a951['query'][_0xb95c('0x2c')]};delete _0x40a951[_0xb95c('0x2b')][_0xb95c('0x2d')];delete _0x40a951[_0xb95c('0x2b')][_0xb95c('0x2c')];_0x46b3b7['query']=_[_0xb95c('0x2a')](_0x40a951['query']);_0x46b3b7[_0xb95c('0x2e')]=_[_0xb95c('0x2f')](_0x46b3b7[_0xb95c('0x30')],_0x46b3b7[_0xb95c('0x2b')]);_0xb7d7fb[_0xb95c('0x31')]=_[_0xb95c('0x2f')](_0x46b3b7[_0xb95c('0x30')],qs[_0xb95c('0x32')](_0x40a951['query'][_0xb95c('0x32')]));_0xb7d7fb['attributes']=_0xb7d7fb[_0xb95c('0x31')]['length']?_0xb7d7fb[_0xb95c('0x31')]:_0x46b3b7['model'];if(!_0x40a951['query'][_0xb95c('0x33')](_0xb95c('0x34'))){_0xb7d7fb[_0xb95c('0x1b')]=qs[_0xb95c('0x1b')](_0x40a951[_0xb95c('0x2b')][_0xb95c('0x1b')]);_0xb7d7fb[_0xb95c('0x1a')]=qs[_0xb95c('0x1a')](_0x40a951[_0xb95c('0x2b')][_0xb95c('0x1a')]);}_0xb7d7fb[_0xb95c('0x35')]=qs[_0xb95c('0x36')](_0x40a951[_0xb95c('0x2b')][_0xb95c('0x36')]);_0xb7d7fb['where']=qs[_0xb95c('0x2e')](_[_0xb95c('0x37')](_0x40a951['query'],_0x46b3b7['filters']));if(_0x462792[_0xb95c('0x2d')]){if(_0x462792[_0xb95c('0x2c')]){_0x462792[_0xb95c('0x2c')]=moment(_0x462792[_0xb95c('0x2c')])['add'](0x1,_0xb95c('0x38'));}else{_0x462792['dateEnd']=moment(_0x462792[_0xb95c('0x2d')])[_0xb95c('0x39')](0x1,'day');}_['merge'](_0xb7d7fb[_0xb95c('0x3a')],{'createdAt':{'$gte':_0x462792['dateStart'],'$lte':_0x462792[_0xb95c('0x2c')]}});}if(_0x40a951[_0xb95c('0x2b')]['filter']){_0xb7d7fb[_0xb95c('0x3a')]=_[_0xb95c('0x3b')](_0xb7d7fb[_0xb95c('0x3a')],{'$or':_[_0xb95c('0x3c')](_0xb7d7fb[_0xb95c('0x31')],function(_0x2109e4){var _0x10e70a={};_0x10e70a[_0x2109e4]={'$like':'%'+_0x40a951['query'][_0xb95c('0x3d')]+'%'};return _0x10e70a;})});}_0xb7d7fb=_['merge']({},_0xb7d7fb,_0x40a951[_0xb95c('0x3e')]);var _0x29b139={'where':_0xb7d7fb['where']};return db[_0xb95c('0x28')][_0xb95c('0x19')](_0x29b139)[_0xb95c('0x21')](function(_0xae1518){_0x47b5f1[_0xb95c('0x19')]=_0xae1518;if(_0x40a951['query']['includeAll']){_0xb7d7fb[_0xb95c('0x3f')]=[{'all':!![]}];}return db[_0xb95c('0x28')][_0xb95c('0x40')](_0xb7d7fb);})[_0xb95c('0x21')](function(_0x2cffa1){_0x47b5f1['rows']=_0x2cffa1;return _0x47b5f1;})[_0xb95c('0x21')](respondWithFilteredResult(_0x2a2c4a,_0xb7d7fb))[_0xb95c('0x41')](handleError(_0x2a2c4a,null));};exports[_0xb95c('0x42')]=function(_0x450572,_0x7182f){var _0x164ea4={'raw':!![],'where':{'id':_0x450572[_0xb95c('0x43')]['id']}},_0x7ac844={};_0x7ac844[_0xb95c('0x30')]=_[_0xb95c('0x2a')](db[_0xb95c('0x28')][_0xb95c('0x29')]);_0x7ac844[_0xb95c('0x2b')]=_[_0xb95c('0x2a')](_0x450572['query']);_0x7ac844[_0xb95c('0x2e')]=_[_0xb95c('0x2f')](_0x7ac844[_0xb95c('0x30')],_0x7ac844[_0xb95c('0x2b')]);_0x164ea4['attributes']=_[_0xb95c('0x2f')](_0x7ac844[_0xb95c('0x30')],qs[_0xb95c('0x32')](_0x450572[_0xb95c('0x2b')][_0xb95c('0x32')]));_0x164ea4[_0xb95c('0x31')]=_0x164ea4[_0xb95c('0x31')][_0xb95c('0x44')]?_0x164ea4[_0xb95c('0x31')]:_0x7ac844[_0xb95c('0x30')];if(_0x450572[_0xb95c('0x2b')][_0xb95c('0x45')]){_0x164ea4[_0xb95c('0x3f')]=[{'all':!![]}];}_0x164ea4=_[_0xb95c('0x3b')]({},_0x164ea4,_0x450572[_0xb95c('0x3e')]);return db['DeskField'][_0xb95c('0x46')](_0x164ea4)[_0xb95c('0x21')](handleEntityNotFound(_0x7182f,null))['then'](respondWithResult(_0x7182f,null))['catch'](handleError(_0x7182f,null));};exports[_0xb95c('0x47')]=function(_0x58508d,_0xd8feac){return db[_0xb95c('0x28')][_0xb95c('0x47')](_0x58508d[_0xb95c('0x48')],{})[_0xb95c('0x21')](respondWithResult(_0xd8feac,0xc9))['catch'](handleError(_0xd8feac,null));};exports[_0xb95c('0x20')]=function(_0x346df6,_0x44f57f){if(_0x346df6[_0xb95c('0x48')]['id']){delete _0x346df6['body']['id'];}return db[_0xb95c('0x28')][_0xb95c('0x46')]({'where':{'id':_0x346df6[_0xb95c('0x43')]['id']}})[_0xb95c('0x21')](handleEntityNotFound(_0x44f57f,null))[_0xb95c('0x21')](saveUpdates(_0x346df6[_0xb95c('0x48')],null))[_0xb95c('0x21')](respondWithResult(_0x44f57f,null))['catch'](handleError(_0x44f57f,null));};exports[_0xb95c('0x49')]=function(_0x57c91d,_0x130a6d){return db[_0xb95c('0x28')][_0xb95c('0x46')]({'where':{'id':_0x57c91d[_0xb95c('0x43')]['id']}})[_0xb95c('0x21')](handleEntityNotFound(_0x130a6d,null))[_0xb95c('0x21')](removeEntity(_0x130a6d,null))['catch'](handleError(_0x130a6d,null));};
\ No newline at end of file
+var _0x35e1=['querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','error','name','send','DeskField','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','day','add','merge','where','filter','map','count','then','includeAll','include','rows','catch','params','length','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x59a04a,_0x5f0f51){var _0x5eadc5=function(_0x68ad3a){while(--_0x68ad3a){_0x59a04a['push'](_0x59a04a['shift']());}};_0x5eadc5(++_0x5f0f51);}(_0x35e1,0x1a5));var _0x135e=function(_0x4487f3,_0x281248){_0x4487f3=_0x4487f3-0x0;var _0x34a15d=_0x35e1[_0x4487f3];return _0x34a15d;};'use strict';var pdf=require(_0x135e('0x0'));var emlformat=require(_0x135e('0x1'));var rimraf=require(_0x135e('0x2'));var zipdir=require(_0x135e('0x3'));var jsonpatch=require(_0x135e('0x4'));var rp=require(_0x135e('0x5'));var moment=require(_0x135e('0x6'));var BPromise=require(_0x135e('0x7'));var Mustache=require(_0x135e('0x8'));var util=require(_0x135e('0x9'));var path=require('path');var sox=require(_0x135e('0xa'));var csv=require(_0x135e('0xb'));var ejs=require(_0x135e('0xc'));var fs=require('fs');var _=require(_0x135e('0xd'));var squel=require(_0x135e('0xe'));var crypto=require(_0x135e('0xf'));var jsforce=require(_0x135e('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x135e('0xb'));var querystring=require(_0x135e('0x11'));var Papa=require(_0x135e('0x12'));var qs=require(_0x135e('0x13'));var logger=require(_0x135e('0x14'))('api');var utils=require(_0x135e('0x15'));var config=require(_0x135e('0x16'));var db=require(_0x135e('0x17'))['db'];function respondWithStatusCode(_0x1911ce,_0x13f014){_0x13f014=_0x13f014||0xcc;return function(_0x59a076){if(_0x59a076){return _0x1911ce[_0x135e('0x18')](_0x13f014);}return _0x1911ce[_0x135e('0x19')](_0x13f014)[_0x135e('0x1a')]();};}function respondWithResult(_0xacb4c5,_0x4bb5d4){_0x4bb5d4=_0x4bb5d4||0xc8;return function(_0x5313c0){if(_0x5313c0){return _0xacb4c5[_0x135e('0x19')](_0x4bb5d4)[_0x135e('0x1b')](_0x5313c0);}};}function respondWithFilteredResult(_0x14f859,_0x7436c2){return function(_0x9f4cc6){if(_0x9f4cc6){var _0x18cd3a=_0x9f4cc6['count'],_0xecf023=_0x7436c2['offset'],_0x122e57=_0x7436c2[_0x135e('0x1c')]+_0x7436c2[_0x135e('0x1d')],_0x3e3228;if(_0x122e57>=_0x18cd3a){_0x122e57=_0x18cd3a;_0x3e3228=0xc8;}else{_0x3e3228=0xce;}_0x14f859['status'](_0x3e3228);return _0x14f859[_0x135e('0x1e')](_0x135e('0x1f'),_0xecf023+'-'+_0x122e57+'/'+_0x18cd3a)[_0x135e('0x1b')](_0x9f4cc6);}return null;};}function patchUpdates(_0x48551b){return function(_0x27d4af){try{jsonpatch[_0x135e('0x20')](_0x27d4af,_0x48551b,!![]);}catch(_0x7cc7a6){return BPromise[_0x135e('0x21')](_0x7cc7a6);}return _0x27d4af[_0x135e('0x22')]();};}function saveUpdates(_0x34381c,_0x44cb5c){return function(_0x1f9c50){if(_0x1f9c50){return _0x1f9c50[_0x135e('0x23')](_0x34381c)['then'](function(_0x2eeeb7){return _0x2eeeb7;});}return null;};}function removeEntity(_0x43f8d2,_0x3658dd){return function(_0x11e6d0){if(_0x11e6d0){return _0x11e6d0[_0x135e('0x24')]()['then'](function(){_0x43f8d2[_0x135e('0x19')](0xcc)[_0x135e('0x1a')]();});}};}function handleEntityNotFound(_0x2e2ab4,_0x467843){return function(_0x4537d5){if(!_0x4537d5){_0x2e2ab4[_0x135e('0x18')](0x194);}return _0x4537d5;};}function handleError(_0x116967,_0x5e32a4){_0x5e32a4=_0x5e32a4||0x1f4;return function(_0x502495){logger[_0x135e('0x25')](_0x502495['stack']);if(_0x502495[_0x135e('0x26')]){delete _0x502495[_0x135e('0x26')];}_0x116967[_0x135e('0x19')](_0x5e32a4)[_0x135e('0x27')](_0x502495);};}exports['index']=function(_0x155a22,_0x3f27c7){var _0x511d0b={},_0x4df469={},_0x491b80={'count':0x0,'rows':[]};var _0x5410ce=db[_0x135e('0x28')][_0x135e('0x29')];_0x4df469[_0x135e('0x2a')]=_[_0x135e('0x2b')](_0x5410ce);var _0x33e218={'dateStart':_0x155a22[_0x135e('0x2c')][_0x135e('0x2d')],'dateEnd':_0x155a22['query'][_0x135e('0x2e')]};delete _0x155a22[_0x135e('0x2c')][_0x135e('0x2d')];delete _0x155a22[_0x135e('0x2c')]['dateEnd'];_0x4df469[_0x135e('0x2c')]=_[_0x135e('0x2b')](_0x155a22[_0x135e('0x2c')]);_0x4df469[_0x135e('0x2f')]=_[_0x135e('0x30')](_0x4df469['model'],_0x4df469[_0x135e('0x2c')]);_0x511d0b[_0x135e('0x31')]=_[_0x135e('0x30')](_0x4df469[_0x135e('0x2a')],qs['fields'](_0x155a22[_0x135e('0x2c')][_0x135e('0x32')]));_0x511d0b[_0x135e('0x31')]=_0x511d0b[_0x135e('0x31')]['length']?_0x511d0b[_0x135e('0x31')]:_0x4df469[_0x135e('0x2a')];if(!_0x155a22[_0x135e('0x2c')][_0x135e('0x33')]('nolimit')){_0x511d0b['limit']=qs[_0x135e('0x1d')](_0x155a22[_0x135e('0x2c')][_0x135e('0x1d')]);_0x511d0b[_0x135e('0x1c')]=qs[_0x135e('0x1c')](_0x155a22[_0x135e('0x2c')][_0x135e('0x1c')]);}_0x511d0b[_0x135e('0x34')]=qs[_0x135e('0x35')](_0x155a22[_0x135e('0x2c')][_0x135e('0x35')]);_0x511d0b['where']=qs[_0x135e('0x2f')](_[_0x135e('0x36')](_0x155a22[_0x135e('0x2c')],_0x4df469[_0x135e('0x2f')]));if(_0x33e218['dateStart']){if(_0x33e218['dateEnd']){_0x33e218[_0x135e('0x2e')]=moment(_0x33e218[_0x135e('0x2e')])['add'](0x1,_0x135e('0x37'));}else{_0x33e218['dateEnd']=moment(_0x33e218[_0x135e('0x2d')])[_0x135e('0x38')](0x1,'day');}_[_0x135e('0x39')](_0x511d0b[_0x135e('0x3a')],{'createdAt':{'$gte':_0x33e218[_0x135e('0x2d')],'$lte':_0x33e218[_0x135e('0x2e')]}});}if(_0x155a22[_0x135e('0x2c')][_0x135e('0x3b')]){_0x511d0b[_0x135e('0x3a')]=_[_0x135e('0x39')](_0x511d0b[_0x135e('0x3a')],{'$or':_[_0x135e('0x3c')](_0x511d0b['attributes'],function(_0x3dc2fc){var _0x531332={};_0x531332[_0x3dc2fc]={'$like':'%'+_0x155a22[_0x135e('0x2c')][_0x135e('0x3b')]+'%'};return _0x531332;})});}_0x511d0b=_[_0x135e('0x39')]({},_0x511d0b,_0x155a22['options']);var _0x3a25bd={'where':_0x511d0b[_0x135e('0x3a')]};return db[_0x135e('0x28')][_0x135e('0x3d')](_0x3a25bd)[_0x135e('0x3e')](function(_0x198d8b){_0x491b80[_0x135e('0x3d')]=_0x198d8b;if(_0x155a22['query'][_0x135e('0x3f')]){_0x511d0b[_0x135e('0x40')]=[{'all':!![]}];}return db[_0x135e('0x28')]['findAll'](_0x511d0b);})[_0x135e('0x3e')](function(_0x519600){_0x491b80[_0x135e('0x41')]=_0x519600;return _0x491b80;})['then'](respondWithFilteredResult(_0x3f27c7,_0x511d0b))[_0x135e('0x42')](handleError(_0x3f27c7,null));};exports['show']=function(_0x3f6ba1,_0x5bd951){var _0x5cf354={'raw':!![],'where':{'id':_0x3f6ba1[_0x135e('0x43')]['id']}},_0x4a0873={};_0x4a0873[_0x135e('0x2a')]=_['keys'](db[_0x135e('0x28')][_0x135e('0x29')]);_0x4a0873[_0x135e('0x2c')]=_[_0x135e('0x2b')](_0x3f6ba1['query']);_0x4a0873['filters']=_[_0x135e('0x30')](_0x4a0873[_0x135e('0x2a')],_0x4a0873[_0x135e('0x2c')]);_0x5cf354['attributes']=_[_0x135e('0x30')](_0x4a0873[_0x135e('0x2a')],qs[_0x135e('0x32')](_0x3f6ba1[_0x135e('0x2c')][_0x135e('0x32')]));_0x5cf354[_0x135e('0x31')]=_0x5cf354[_0x135e('0x31')][_0x135e('0x44')]?_0x5cf354[_0x135e('0x31')]:_0x4a0873[_0x135e('0x2a')];if(_0x3f6ba1['query'][_0x135e('0x3f')]){_0x5cf354[_0x135e('0x40')]=[{'all':!![]}];}_0x5cf354=_['merge']({},_0x5cf354,_0x3f6ba1[_0x135e('0x45')]);return db['DeskField'][_0x135e('0x46')](_0x5cf354)[_0x135e('0x3e')](handleEntityNotFound(_0x5bd951,null))['then'](respondWithResult(_0x5bd951,null))['catch'](handleError(_0x5bd951,null));};exports[_0x135e('0x47')]=function(_0x4759e7,_0x4c7a7c){return db[_0x135e('0x28')][_0x135e('0x47')](_0x4759e7[_0x135e('0x48')],{})[_0x135e('0x3e')](respondWithResult(_0x4c7a7c,0xc9))[_0x135e('0x42')](handleError(_0x4c7a7c,null));};exports[_0x135e('0x23')]=function(_0x56480b,_0x362466){if(_0x56480b[_0x135e('0x48')]['id']){delete _0x56480b[_0x135e('0x48')]['id'];}return db[_0x135e('0x28')][_0x135e('0x46')]({'where':{'id':_0x56480b[_0x135e('0x43')]['id']}})[_0x135e('0x3e')](handleEntityNotFound(_0x362466,null))[_0x135e('0x3e')](saveUpdates(_0x56480b[_0x135e('0x48')],null))[_0x135e('0x3e')](respondWithResult(_0x362466,null))['catch'](handleError(_0x362466,null));};exports[_0x135e('0x24')]=function(_0x4bc450,_0x3f898c){return db[_0x135e('0x28')][_0x135e('0x46')]({'where':{'id':_0x4bc450[_0x135e('0x43')]['id']}})[_0x135e('0x3e')](handleEntityNotFound(_0x3f898c,null))['then'](removeEntity(_0x3f898c,null))['catch'](handleError(_0x3f898c,null));};
\ No newline at end of file
index f24fd14..ee8d7c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf873=['DeskField','int_desk_fields','util','../../config/logger','api','moment','bluebird','request-promise','./intDeskField.attributes','exports','define'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xf873,0xb2));var _0x3f87=function(_0x44e38d,_0x1347e8){_0x44e38d=_0x44e38d-0x0;var _0x3f9de3=_0xf873[_0x44e38d];return _0x3f9de3;};'use strict';var _=require('lodash');var util=require(_0x3f87('0x0'));var logger=require(_0x3f87('0x1'))(_0x3f87('0x2'));var moment=require(_0x3f87('0x3'));var BPromise=require(_0x3f87('0x4'));var rp=require(_0x3f87('0x5'));var attributes=require(_0x3f87('0x6'));module[_0x3f87('0x7')]=function(_0x3c80d6,_0x4a909e){return _0x3c80d6[_0x3f87('0x8')](_0x3f87('0x9'),attributes,{'tableName':_0x3f87('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xac9d=['define','DeskField','int_desk_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intDeskField.attributes'];(function(_0x3e10c0,_0x385bdc){var _0x2fb415=function(_0x2bfb7b){while(--_0x2bfb7b){_0x3e10c0['push'](_0x3e10c0['shift']());}};_0x2fb415(++_0x385bdc);}(_0xac9d,0x14d));var _0xdac9=function(_0x3998ff,_0x58f511){_0x3998ff=_0x3998ff-0x0;var _0xfd997d=_0xac9d[_0x3998ff];return _0xfd997d;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var logger=require(_0xdac9('0x2'))(_0xdac9('0x3'));var moment=require(_0xdac9('0x4'));var BPromise=require(_0xdac9('0x5'));var rp=require(_0xdac9('0x6'));var attributes=require(_0xdac9('0x7'));module['exports']=function(_0x1c17a6,_0x5a984a){return _0x1c17a6[_0xdac9('0x8')](_0xdac9('0x9'),attributes,{'tableName':_0xdac9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 804fda6..a969b58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda90=['result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x5dcb5e,_0x69e544){var _0x8a42aa=function(_0x265c97){while(--_0x265c97){_0x5dcb5e['push'](_0x5dcb5e['shift']());}};_0x8a42aa(++_0x69e544);}(_0xda90,0x152));var _0x0da9=function(_0x4d34fa,_0x2daf21){_0x4d34fa=_0x4d34fa-0x0;var _0x32c973=_0xda90[_0x4d34fa];return _0x32c973;};'use strict';var _=require(_0x0da9('0x0'));var util=require(_0x0da9('0x1'));var moment=require(_0x0da9('0x2'));var BPromise=require('bluebird');var rs=require(_0x0da9('0x3'));var fs=require('fs');var db=require(_0x0da9('0x4'))['db'];var utils=require(_0x0da9('0x5'));var logger=require(_0x0da9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0da9('0x7'));var client=jayson['client'][_0x0da9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9f475b,_0x29e458,_0x451e32){return new BPromise(function(_0x278032,_0x162611){return client[_0x0da9('0x9')](_0x9f475b,_0x451e32)[_0x0da9('0xa')](function(_0x42c8ca){logger[_0x0da9('0xb')](_0x0da9('0xc'),_0x29e458,_0x0da9('0xd'));logger[_0x0da9('0xe')](_0x0da9('0xf'),_0x29e458,'request\x20sent',JSON[_0x0da9('0x10')](_0x42c8ca));if(_0x42c8ca[_0x0da9('0x11')]){if(_0x42c8ca['error']['code']===0x1f4){logger[_0x0da9('0x11')](_0x0da9('0xc'),_0x29e458,_0x42c8ca['error'][_0x0da9('0x12')]);return _0x162611(_0x42c8ca['error'][_0x0da9('0x12')]);}logger[_0x0da9('0x11')](_0x0da9('0xc'),_0x29e458,_0x42c8ca[_0x0da9('0x11')]['message']);return _0x278032(_0x42c8ca[_0x0da9('0x11')][_0x0da9('0x12')]);}else{logger['info'](_0x0da9('0xc'),_0x29e458,'request\x20sent');_0x278032(_0x42c8ca[_0x0da9('0x13')][_0x0da9('0x12')]);}})[_0x0da9('0x14')](function(_0x4fd5cd){logger['error'](_0x0da9('0xc'),_0x29e458,_0x4fd5cd);_0x162611(_0x4fd5cd);});});}
\ No newline at end of file
+var _0xebb6=['request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','DeskField,\x20%s,\x20%s'];(function(_0x23eff7,_0x446911){var _0x55c76a=function(_0x3425c5){while(--_0x3425c5){_0x23eff7['push'](_0x23eff7['shift']());}};_0x55c76a(++_0x446911);}(_0xebb6,0xf9));var _0x6ebb=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xebb6[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0x6ebb('0x0'));var util=require(_0x6ebb('0x1'));var moment=require(_0x6ebb('0x2'));var BPromise=require(_0x6ebb('0x3'));var rs=require(_0x6ebb('0x4'));var fs=require('fs');var db=require(_0x6ebb('0x5'))['db'];var utils=require(_0x6ebb('0x6'));var logger=require(_0x6ebb('0x7'))(_0x6ebb('0x8'));var config=require(_0x6ebb('0x9'));var jayson=require(_0x6ebb('0xa'));var client=jayson['client'][_0x6ebb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5df047,_0x34f698,_0x4ae041){return new BPromise(function(_0x2f9615,_0x53bd2a){return client[_0x6ebb('0xc')](_0x5df047,_0x4ae041)[_0x6ebb('0xd')](function(_0x3511e4){logger['info'](_0x6ebb('0xe'),_0x34f698,_0x6ebb('0xf'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x34f698,'request\x20sent',JSON[_0x6ebb('0x10')](_0x3511e4));if(_0x3511e4[_0x6ebb('0x11')]){if(_0x3511e4[_0x6ebb('0x11')]['code']===0x1f4){logger[_0x6ebb('0x11')](_0x6ebb('0xe'),_0x34f698,_0x3511e4[_0x6ebb('0x11')][_0x6ebb('0x12')]);return _0x53bd2a(_0x3511e4[_0x6ebb('0x11')][_0x6ebb('0x12')]);}logger[_0x6ebb('0x11')]('DeskField,\x20%s,\x20%s',_0x34f698,_0x3511e4[_0x6ebb('0x11')][_0x6ebb('0x12')]);return _0x2f9615(_0x3511e4[_0x6ebb('0x11')]['message']);}else{logger[_0x6ebb('0x13')](_0x6ebb('0xe'),_0x34f698,_0x6ebb('0xf'));_0x2f9615(_0x3511e4[_0x6ebb('0x14')][_0x6ebb('0x12')]);}})[_0x6ebb('0x15')](function(_0x358da0){logger[_0x6ebb('0x11')]('DeskField,\x20%s,\x20%s',_0x34f698,_0x358da0);_0x53bd2a(_0x358da0);});});}
\ No newline at end of file
index cc1f663..954181a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d73=['/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','index'];(function(_0x2e1af3,_0x2a077b){var _0x4150cd=function(_0x1e08f3){while(--_0x1e08f3){_0x2e1af3['push'](_0x2e1af3['shift']());}};_0x4150cd(++_0x2a077b);}(_0x6d73,0xd3));var _0x36d7=function(_0x4adf06,_0x23beb5){_0x4adf06=_0x4adf06-0x0;var _0x42d1eb=_0x6d73[_0x4adf06];return _0x42d1eb;};'use strict';var multer=require('multer');var util=require(_0x36d7('0x0'));var path=require(_0x36d7('0x1'));var express=require(_0x36d7('0x2'));var router=express['Router']();var auth=require(_0x36d7('0x3'));var interaction=require(_0x36d7('0x4'));var config=require(_0x36d7('0x5'));var controller=require(_0x36d7('0x6'));router[_0x36d7('0x7')]('/',auth['isAuthenticated'](),controller[_0x36d7('0x8')]);router[_0x36d7('0x7')](_0x36d7('0x9'),auth[_0x36d7('0xa')](),controller[_0x36d7('0xb')]);router['get']('/:id/configurations',auth[_0x36d7('0xa')](),controller[_0x36d7('0xc')]);router[_0x36d7('0x7')](_0x36d7('0xd'),auth[_0x36d7('0xa')](),controller[_0x36d7('0xe')]);router[_0x36d7('0xf')]('/',auth[_0x36d7('0xa')](),controller['create']);router[_0x36d7('0xf')](_0x36d7('0x10'),auth[_0x36d7('0xa')](),controller[_0x36d7('0x11')]);router['put'](_0x36d7('0x9'),auth[_0x36d7('0xa')](),controller[_0x36d7('0x12')]);router[_0x36d7('0x13')](_0x36d7('0x9'),auth[_0x36d7('0xa')](),controller[_0x36d7('0x14')]);module[_0x36d7('0x15')]=router;
\ No newline at end of file
+var _0xb47b=['multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','post','create','addConfiguration','put','update','delete','destroy','exports'];(function(_0x414f32,_0x127b3d){var _0x72ab24=function(_0x153531){while(--_0x153531){_0x414f32['push'](_0x414f32['shift']());}};_0x72ab24(++_0x127b3d);}(_0xb47b,0xa8));var _0xbb47=function(_0x57fd01,_0x1f01cf){_0x57fd01=_0x57fd01-0x0;var _0x3dc8bc=_0xb47b[_0x57fd01];return _0x3dc8bc;};'use strict';var multer=require(_0xbb47('0x0'));var util=require(_0xbb47('0x1'));var path=require(_0xbb47('0x2'));var express=require(_0xbb47('0x3'));var router=express[_0xbb47('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbb47('0x5'));var config=require(_0xbb47('0x6'));var controller=require(_0xbb47('0x7'));router[_0xbb47('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xbb47('0x9'),auth[_0xbb47('0xa')](),controller['show']);router['get'](_0xbb47('0xb'),auth['isAuthenticated'](),controller[_0xbb47('0xc')]);router['get']('/:id/fields',auth[_0xbb47('0xa')](),controller['getFields']);router[_0xbb47('0xd')]('/',auth[_0xbb47('0xa')](),controller[_0xbb47('0xe')]);router[_0xbb47('0xd')](_0xbb47('0xb'),auth[_0xbb47('0xa')](),controller[_0xbb47('0xf')]);router[_0xbb47('0x10')]('/:id',auth[_0xbb47('0xa')](),controller[_0xbb47('0x11')]);router[_0xbb47('0x12')](_0xbb47('0x9'),auth[_0xbb47('0xa')](),controller[_0xbb47('0x13')]);module[_0xbb47('0x14')]=router;
\ No newline at end of file
index 7b3ad6f..199521a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a72=['exports','STRING','username','remoteUri','sequelize'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0x2a72,0x1c6));var _0x22a7=function(_0x3a19d4,_0x3f19a4){_0x3a19d4=_0x3a19d4-0x0;var _0x5b858b=_0x2a72[_0x3a19d4];return _0x5b858b;};'use strict';var Sequelize=require(_0x22a7('0x0'));module[_0x22a7('0x1')]={'name':{'type':Sequelize[_0x22a7('0x2')]},'description':{'type':Sequelize[_0x22a7('0x2')]},'username':{'type':Sequelize[_0x22a7('0x2')],'unique':_0x22a7('0x3')},'apiKey':{'type':Sequelize[_0x22a7('0x2')]},'remoteUri':{'type':Sequelize[_0x22a7('0x2')],'unique':_0x22a7('0x4')},'serverUrl':{'type':Sequelize[_0x22a7('0x2')]}};
\ No newline at end of file
+var _0x2525=['STRING','username','remoteUri','sequelize'];(function(_0x4207e7,_0x1e7a2a){var _0xf129b3=function(_0xe96091){while(--_0xe96091){_0x4207e7['push'](_0x4207e7['shift']());}};_0xf129b3(++_0x1e7a2a);}(_0x2525,0x9f));var _0x5252=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x2525[_0x1b828b];return _0x98da1a;};'use strict';var Sequelize=require(_0x5252('0x0'));module['exports']={'name':{'type':Sequelize[_0x5252('0x1')]},'description':{'type':Sequelize[_0x5252('0x1')]},'username':{'type':Sequelize[_0x5252('0x1')],'unique':_0x5252('0x2')},'apiKey':{'type':Sequelize[_0x5252('0x1')]},'remoteUri':{'type':Sequelize[_0x5252('0x1')],'unique':_0x5252('0x3')},'serverUrl':{'type':Sequelize[_0x5252('0x1')]}};
\ No newline at end of file
index 01bfb79..c1f48c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcde3=['sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','destroy','end','stack','name','index','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','add','day','merge','filter','options','FreshdeskAccount','includeAll','include','findAll','rows','show','find','create','update','body','params','getConfigurations','findOne','rawAttributes','order','map','addConfiguration','AccountId','getSubjects','type','getDescriptions','FreshdeskConfiguration','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','GET','format','%s%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','agent','group','source','ticket_type','company','remove','custom_text','label','default','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x53a567,_0x367c47){var _0xc45d2d=function(_0x514504){while(--_0x514504){_0x53a567['push'](_0x53a567['shift']());}};_0xc45d2d(++_0x367c47);}(_0xcde3,0x14e));var _0x3cde=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0xcde3[_0x215dc8];return _0x583ea3;};'use strict';var pdf=require(_0x3cde('0x0'));var emlformat=require(_0x3cde('0x1'));var rimraf=require(_0x3cde('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3cde('0x3'));var rp=require(_0x3cde('0x4'));var moment=require(_0x3cde('0x5'));var BPromise=require(_0x3cde('0x6'));var Mustache=require(_0x3cde('0x7'));var util=require(_0x3cde('0x8'));var path=require(_0x3cde('0x9'));var sox=require(_0x3cde('0xa'));var csv=require(_0x3cde('0xb'));var ejs=require(_0x3cde('0xc'));var fs=require('fs');var _=require(_0x3cde('0xd'));var squel=require(_0x3cde('0xe'));var crypto=require(_0x3cde('0xf'));var jsforce=require(_0x3cde('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x3cde('0xb'));var querystring=require(_0x3cde('0x11'));var Papa=require(_0x3cde('0x12'));var qs=require(_0x3cde('0x13'));var logger=require(_0x3cde('0x14'))(_0x3cde('0x15'));var utils=require(_0x3cde('0x16'));var config=require(_0x3cde('0x17'));var db=require(_0x3cde('0x18'))['db'];var integrations=require(_0x3cde('0x19'));var jayson=require(_0x3cde('0x1a'));var client=jayson[_0x3cde('0x1b')][_0x3cde('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x55a3c7,_0x3fdeec,_0x228833,_0x5f42f1){return new BPromise(function(_0x1b7720,_0x533674){var _0x33d7b3=_0x5f42f1||client;return _0x33d7b3['request'](_0x55a3c7,_0x228833)[_0x3cde('0x1d')](function(_0xa51265){logger['info'](_0x3cde('0x1e'),_0x3fdeec,_0x3cde('0x1f'));logger[_0x3cde('0x20')](_0x3cde('0x21'),_0x3fdeec,_0x3cde('0x1f'),JSON['stringify'](_0xa51265));if(_0xa51265[_0x3cde('0x22')]){if(_0xa51265['error'][_0x3cde('0x23')]===0x1f4){logger[_0x3cde('0x22')](_0x3cde('0x1e'),_0x3fdeec,_0xa51265[_0x3cde('0x22')]['message']);return _0x533674(_0xa51265[_0x3cde('0x22')][_0x3cde('0x24')]);}logger['error'](_0x3cde('0x1e'),_0x3fdeec,_0xa51265[_0x3cde('0x22')]['message']);return _0x1b7720(_0xa51265[_0x3cde('0x22')][_0x3cde('0x24')]);}else{logger['info'](_0x3cde('0x1e'),_0x3fdeec,_0x3cde('0x1f'));_0x1b7720(_0xa51265['result'][_0x3cde('0x24')]);}})[_0x3cde('0x25')](function(_0xd9413c){logger[_0x3cde('0x22')]('FreshdeskAccount,\x20%s,\x20%s',_0x3fdeec,_0xd9413c);_0x533674(_0xd9413c);});});}function respondWithStatusCode(_0x3fd36f,_0x57ba96){_0x57ba96=_0x57ba96||0xcc;return function(_0x564e37){if(_0x564e37){return _0x3fd36f[_0x3cde('0x26')](_0x57ba96);}return _0x3fd36f[_0x3cde('0x27')](_0x57ba96)['end']();};}function respondWithResult(_0x894e54,_0x38e1e6){_0x38e1e6=_0x38e1e6||0xc8;return function(_0x10fa38){if(_0x10fa38){return _0x894e54[_0x3cde('0x27')](_0x38e1e6)[_0x3cde('0x28')](_0x10fa38);}};}function respondWithFilteredResult(_0x3887e3,_0x543fde){return function(_0x41e859){if(_0x41e859){var _0x1e8eb4=_0x41e859[_0x3cde('0x29')],_0x3fb5f2=_0x543fde[_0x3cde('0x2a')],_0x1f8a44=_0x543fde[_0x3cde('0x2a')]+_0x543fde[_0x3cde('0x2b')],_0x5bca17;if(_0x1f8a44>=_0x1e8eb4){_0x1f8a44=_0x1e8eb4;_0x5bca17=0xc8;}else{_0x5bca17=0xce;}_0x3887e3[_0x3cde('0x27')](_0x5bca17);return _0x3887e3[_0x3cde('0x2c')](_0x3cde('0x2d'),_0x3fb5f2+'-'+_0x1f8a44+'/'+_0x1e8eb4)[_0x3cde('0x28')](_0x41e859);}return null;};}function patchUpdates(_0x3c0071){return function(_0x1c9771){try{jsonpatch[_0x3cde('0x2e')](_0x1c9771,_0x3c0071,!![]);}catch(_0x850d20){return BPromise['reject'](_0x850d20);}return _0x1c9771[_0x3cde('0x2f')]();};}function saveUpdates(_0x5031a7,_0x349b99){return function(_0x18c06f){if(_0x18c06f){return _0x18c06f['update'](_0x5031a7)[_0x3cde('0x1d')](function(_0x1965ee){return _0x1965ee;});}return null;};}function removeEntity(_0x2387fb,_0x359349){return function(_0x10507a){if(_0x10507a){return _0x10507a[_0x3cde('0x30')]()[_0x3cde('0x1d')](function(){_0x2387fb['status'](0xcc)[_0x3cde('0x31')]();});}};}function handleEntityNotFound(_0x5f33ff,_0x3d93d2){return function(_0x4122e5){if(!_0x4122e5){_0x5f33ff[_0x3cde('0x26')](0x194);}return _0x4122e5;};}function handleError(_0x15c7a6,_0x480ef7){_0x480ef7=_0x480ef7||0x1f4;return function(_0x2bd374){logger['error'](_0x2bd374[_0x3cde('0x32')]);if(_0x2bd374[_0x3cde('0x33')]){delete _0x2bd374[_0x3cde('0x33')];}_0x15c7a6[_0x3cde('0x27')](_0x480ef7)['send'](_0x2bd374);};}exports[_0x3cde('0x34')]=function(_0x1e588c,_0x3a64eb){var _0x306d85={},_0x3fa63a={},_0x46be81={'count':0x0,'rows':[]};var _0x563b7c=db['FreshdeskAccount']['rawAttributes'];_0x3fa63a[_0x3cde('0x35')]=_[_0x3cde('0x36')](_0x563b7c);var _0x4dbc77={'dateStart':_0x1e588c[_0x3cde('0x37')][_0x3cde('0x38')],'dateEnd':_0x1e588c['query'][_0x3cde('0x39')]};delete _0x1e588c[_0x3cde('0x37')][_0x3cde('0x38')];delete _0x1e588c['query']['dateEnd'];_0x3fa63a[_0x3cde('0x37')]=_[_0x3cde('0x36')](_0x1e588c[_0x3cde('0x37')]);_0x3fa63a[_0x3cde('0x3a')]=_[_0x3cde('0x3b')](_0x3fa63a[_0x3cde('0x35')],_0x3fa63a['query']);_0x306d85[_0x3cde('0x3c')]=_['intersection'](_0x3fa63a[_0x3cde('0x35')],qs['fields'](_0x1e588c[_0x3cde('0x37')][_0x3cde('0x3d')]));_0x306d85[_0x3cde('0x3c')]=_0x306d85[_0x3cde('0x3c')][_0x3cde('0x3e')]?_0x306d85[_0x3cde('0x3c')]:_0x3fa63a[_0x3cde('0x35')];if(!_0x1e588c[_0x3cde('0x37')][_0x3cde('0x3f')](_0x3cde('0x40'))){_0x306d85[_0x3cde('0x2b')]=qs[_0x3cde('0x2b')](_0x1e588c[_0x3cde('0x37')][_0x3cde('0x2b')]);_0x306d85[_0x3cde('0x2a')]=qs[_0x3cde('0x2a')](_0x1e588c[_0x3cde('0x37')]['offset']);}_0x306d85['order']=qs[_0x3cde('0x41')](_0x1e588c[_0x3cde('0x37')]['sort']);_0x306d85[_0x3cde('0x42')]=qs['filters'](_[_0x3cde('0x43')](_0x1e588c[_0x3cde('0x37')],_0x3fa63a[_0x3cde('0x3a')]));if(_0x4dbc77[_0x3cde('0x38')]){if(_0x4dbc77[_0x3cde('0x39')]){_0x4dbc77[_0x3cde('0x39')]=moment(_0x4dbc77[_0x3cde('0x39')])[_0x3cde('0x44')](0x1,'day');}else{_0x4dbc77['dateEnd']=moment(_0x4dbc77[_0x3cde('0x38')])[_0x3cde('0x44')](0x1,_0x3cde('0x45'));}_['merge'](_0x306d85['where'],{'createdAt':{'$gte':_0x4dbc77['dateStart'],'$lte':_0x4dbc77[_0x3cde('0x39')]}});}if(_0x1e588c['query']['filter']){_0x306d85[_0x3cde('0x42')]=_[_0x3cde('0x46')](_0x306d85[_0x3cde('0x42')],{'$or':_['map'](_0x306d85['attributes'],function(_0x5cb210){var _0x3b3db7={};_0x3b3db7[_0x5cb210]={'$like':'%'+_0x1e588c[_0x3cde('0x37')][_0x3cde('0x47')]+'%'};return _0x3b3db7;})});}_0x306d85=_[_0x3cde('0x46')]({},_0x306d85,_0x1e588c[_0x3cde('0x48')]);var _0x639c78={'where':_0x306d85[_0x3cde('0x42')]};return db[_0x3cde('0x49')][_0x3cde('0x29')](_0x639c78)[_0x3cde('0x1d')](function(_0x14ff67){_0x46be81[_0x3cde('0x29')]=_0x14ff67;if(_0x1e588c[_0x3cde('0x37')][_0x3cde('0x4a')]){_0x306d85[_0x3cde('0x4b')]=[{'all':!![]}];}return db[_0x3cde('0x49')][_0x3cde('0x4c')](_0x306d85);})[_0x3cde('0x1d')](function(_0x355a34){_0x46be81[_0x3cde('0x4d')]=_0x355a34;return _0x46be81;})['then'](respondWithFilteredResult(_0x3a64eb,_0x306d85))['catch'](handleError(_0x3a64eb,null));};exports[_0x3cde('0x4e')]=function(_0x402d06,_0x41de9f){var _0x33279b={'raw':![],'where':{'id':_0x402d06['params']['id']}},_0x3c8f76={};_0x3c8f76[_0x3cde('0x35')]=_[_0x3cde('0x36')](db['FreshdeskAccount']['rawAttributes']);_0x3c8f76[_0x3cde('0x37')]=_[_0x3cde('0x36')](_0x402d06[_0x3cde('0x37')]);_0x3c8f76[_0x3cde('0x3a')]=_[_0x3cde('0x3b')](_0x3c8f76[_0x3cde('0x35')],_0x3c8f76[_0x3cde('0x37')]);_0x33279b[_0x3cde('0x3c')]=_[_0x3cde('0x3b')](_0x3c8f76[_0x3cde('0x35')],qs['fields'](_0x402d06[_0x3cde('0x37')][_0x3cde('0x3d')]));_0x33279b['attributes']=_0x33279b[_0x3cde('0x3c')]['length']?_0x33279b[_0x3cde('0x3c')]:_0x3c8f76[_0x3cde('0x35')];if(_0x402d06[_0x3cde('0x37')][_0x3cde('0x4a')]){_0x33279b[_0x3cde('0x4b')]=[{'all':!![]}];}_0x33279b=_['merge']({},_0x33279b,_0x402d06[_0x3cde('0x48')]);return db[_0x3cde('0x49')][_0x3cde('0x4f')](_0x33279b)[_0x3cde('0x1d')](handleEntityNotFound(_0x41de9f,null))[_0x3cde('0x1d')](respondWithResult(_0x41de9f,null))[_0x3cde('0x25')](handleError(_0x41de9f,null));};exports[_0x3cde('0x50')]=function(_0x1afed9,_0x49b4b0){return db['FreshdeskAccount'][_0x3cde('0x50')](_0x1afed9['body'],{})[_0x3cde('0x1d')](respondWithResult(_0x49b4b0,0xc9))[_0x3cde('0x25')](handleError(_0x49b4b0,null));};exports[_0x3cde('0x51')]=function(_0x339d6d,_0x21182f){if(_0x339d6d[_0x3cde('0x52')]['id']){delete _0x339d6d[_0x3cde('0x52')]['id'];}return db[_0x3cde('0x49')]['find']({'where':{'id':_0x339d6d['params']['id']}})[_0x3cde('0x1d')](handleEntityNotFound(_0x21182f,null))['then'](saveUpdates(_0x339d6d['body'],null))[_0x3cde('0x1d')](respondWithResult(_0x21182f,null))[_0x3cde('0x25')](handleError(_0x21182f,null));};exports['destroy']=function(_0x4051d8,_0x5015a2){return db['FreshdeskAccount'][_0x3cde('0x4f')]({'where':{'id':_0x4051d8[_0x3cde('0x53')]['id']}})[_0x3cde('0x1d')](handleEntityNotFound(_0x5015a2,null))[_0x3cde('0x1d')](removeEntity(_0x5015a2,null))['catch'](handleError(_0x5015a2,null));};exports[_0x3cde('0x54')]=function(_0x195849,_0x342711,_0xa3883b){var _0x14affe={};var _0x162b4c={};var _0xfbf2e4;var _0x59c228;return db[_0x3cde('0x49')][_0x3cde('0x55')]({'where':{'id':_0x195849[_0x3cde('0x53')]['id']}})[_0x3cde('0x1d')](handleEntityNotFound(_0x342711,null))[_0x3cde('0x1d')](function(_0x4f2d95){if(_0x4f2d95){_0xfbf2e4=_0x4f2d95;_0x162b4c['model']=_[_0x3cde('0x36')](db['FreshdeskConfiguration'][_0x3cde('0x56')]);_0x162b4c[_0x3cde('0x37')]=_['keys'](_0x195849[_0x3cde('0x37')]);_0x162b4c[_0x3cde('0x3a')]=_[_0x3cde('0x3b')](_0x162b4c[_0x3cde('0x35')],_0x162b4c[_0x3cde('0x37')]);_0x14affe[_0x3cde('0x3c')]=_[_0x3cde('0x3b')](_0x162b4c[_0x3cde('0x35')],qs[_0x3cde('0x3d')](_0x195849[_0x3cde('0x37')]['fields']));_0x14affe['attributes']=_0x14affe[_0x3cde('0x3c')]['length']?_0x14affe[_0x3cde('0x3c')]:_0x162b4c['model'];_0x14affe[_0x3cde('0x57')]=qs[_0x3cde('0x41')](_0x195849[_0x3cde('0x37')][_0x3cde('0x41')]);_0x14affe[_0x3cde('0x42')]=qs[_0x3cde('0x3a')](_['pick'](_0x195849[_0x3cde('0x37')],_0x162b4c[_0x3cde('0x3a')]));if(_0x195849[_0x3cde('0x37')][_0x3cde('0x47')]){_0x14affe[_0x3cde('0x42')]=_[_0x3cde('0x46')](_0x14affe[_0x3cde('0x42')],{'$or':_[_0x3cde('0x58')](_0x14affe[_0x3cde('0x3c')],function(_0x513af7){var _0x394bb6={};_0x394bb6[_0x513af7]={'$like':'%'+_0x195849['query'][_0x3cde('0x47')]+'%'};return _0x394bb6;})});}_0x14affe=_[_0x3cde('0x46')]({},_0x14affe,_0x195849[_0x3cde('0x48')]);return _0xfbf2e4[_0x3cde('0x54')](_0x14affe);}})['then'](function(_0x372552){if(_0x372552){_0x59c228=_0x372552['length'];if(!_0x195849[_0x3cde('0x37')][_0x3cde('0x3f')](_0x3cde('0x40'))){_0x14affe[_0x3cde('0x2b')]=qs[_0x3cde('0x2b')](_0x195849[_0x3cde('0x37')][_0x3cde('0x2b')]);_0x14affe[_0x3cde('0x2a')]=qs[_0x3cde('0x2a')](_0x195849[_0x3cde('0x37')][_0x3cde('0x2a')]);}return _0xfbf2e4['getConfigurations'](_0x14affe);}})[_0x3cde('0x1d')](function(_0x1d2352){if(_0x1d2352){return _0x1d2352?{'count':_0x59c228,'rows':_0x1d2352}:null;}})[_0x3cde('0x1d')](respondWithResult(_0x342711,null))[_0x3cde('0x25')](handleError(_0x342711,null));};exports[_0x3cde('0x59')]=function(_0x35c7a1,_0x15a404,_0x32d0c2){if(_0x35c7a1[_0x3cde('0x52')]['id']){delete _0x35c7a1[_0x3cde('0x52')]['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0x35c7a1['params']['id']}})[_0x3cde('0x1d')](handleEntityNotFound(_0x15a404,null))[_0x3cde('0x1d')](function(_0x1103ec){if(_0x1103ec){_0x35c7a1[_0x3cde('0x52')][_0x3cde('0x5a')]=_0x1103ec['id'];_0x35c7a1[_0x3cde('0x52')]['Subjects']=integrations[_0x3cde('0x5b')](_0x35c7a1[_0x3cde('0x52')]['channel'],_0x35c7a1[_0x3cde('0x52')][_0x3cde('0x5c')]);_0x35c7a1[_0x3cde('0x52')]['Descriptions']=integrations[_0x3cde('0x5d')](_0x35c7a1[_0x3cde('0x52')]['channel'],_0x35c7a1[_0x3cde('0x52')]['type']);return db[_0x3cde('0x5e')][_0x3cde('0x50')](_0x35c7a1[_0x3cde('0x52')],{'include':[{'model':db[_0x3cde('0x5f')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':_0x3cde('0x60')}]});}return null;})['then'](respondWithResult(_0x15a404,null))[_0x3cde('0x25')](handleError(_0x15a404,null));};exports[_0x3cde('0x61')]=function(_0x577d3e,_0x101447,_0x16074e){return db[_0x3cde('0x49')][_0x3cde('0x55')]({'where':{'id':_0x577d3e[_0x3cde('0x53')]['id']},'attributes':['id',_0x3cde('0x62'),_0x3cde('0x63')]})[_0x3cde('0x1d')](handleEntityNotFound(_0x101447,null))['then'](function(_0xd3e929){if(_0xd3e929){return rp({'method':_0x3cde('0x64'),'uri':util[_0x3cde('0x65')](_0x3cde('0x66'),_0xd3e929[_0x3cde('0x62')],_0x3cde('0x67')),'headers':{'Authorization':util[_0x3cde('0x65')](_0x3cde('0x68'),new Buffer(util['format'](_0x3cde('0x69'),_0xd3e929[_0x3cde('0x63')]))[_0x3cde('0x6a')](_0x3cde('0x6b')))},'json':!![]});}})[_0x3cde('0x1d')](function(_0x4e50e7){if(_0x4e50e7){var _0x40b74=[_0x3cde('0x6c'),'subject',_0x3cde('0x6d'),'description',_0x3cde('0x27'),'priority',_0x3cde('0x6e'),_0x3cde('0x6f'),_0x3cde('0x70'),_0x3cde('0x6e'),_0x3cde('0x71')];_[_0x3cde('0x72')](_0x4e50e7,function(_0x4187ce){return _0x40b74['includes'](_0x4187ce[_0x3cde('0x33')])||!_0x4187ce['default']&&_0x4187ce[_0x3cde('0x5c')]!==_0x3cde('0x73');});return{'count':_0x4e50e7['length'],'rows':_[_0x3cde('0x58')](_0x4e50e7,function(_0x4d7813){return{'id':_0x4d7813[_0x3cde('0x33')],'name':_0x4d7813[_0x3cde('0x74')],'custom':!_0x4d7813[_0x3cde('0x75')],'options':_0x4d7813[_0x3cde('0x76')]?_[_0x3cde('0x58')](_0x4d7813[_0x3cde('0x76')],function(_0x16d8e4){return{'name':_[_0x3cde('0x77')](_0x16d8e4),'value':_0x16d8e4};}):[]};})};}})['then'](respondWithResult(_0x101447,null))[_0x3cde('0x25')](function(_0x302646){var _0x58ce05=_0x577d3e[_0x3cde('0x37')]['test']?0x1f4:_0x302646[_0x3cde('0x78')]||0x1f4;logger['error'](_0x3cde('0x79'),_0x3cde('0x61'),_0x58ce05,JSON[_0x3cde('0x7a')](_0x302646));delete _0x302646[_0x3cde('0x33')];if(_0x58ce05===0x191){_0x58ce05=0x190;}_0x101447['status'](_0x58ce05)['send'](_0x577d3e['query']['test']?{'message':_0x3cde('0x7b'),'statusCode':_0x302646[_0x3cde('0x78')]}:_0x302646);});};
\ No newline at end of file
+var _0xb06d=['map','getConfigurations','addConfiguration','AccountId','channel','getDescriptions','type','FreshdeskConfiguration','FreshdeskField','Subjects','Descriptions','getFields','apiKey','GET','format','%s%s','remoteUri','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','agent','description','priority','group','ticket_type','company','includes','default','custom_text','label','choices','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','end','json','count','offset','status','set','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','index','FreshdeskAccount','rawAttributes','keys','query','dateStart','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','dateEnd','day','merge','filter','options','includeAll','include','rows','catch','params','find','create','body','findOne'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb06d,0x195));var _0xdb06=function(_0x53b524,_0xbced8b){_0x53b524=_0x53b524-0x0;var _0x276a1a=_0xb06d[_0x53b524];return _0x276a1a;};'use strict';var pdf=require(_0xdb06('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdb06('0x1'));var rp=require(_0xdb06('0x2'));var moment=require(_0xdb06('0x3'));var BPromise=require(_0xdb06('0x4'));var Mustache=require(_0xdb06('0x5'));var util=require(_0xdb06('0x6'));var path=require(_0xdb06('0x7'));var sox=require(_0xdb06('0x8'));var csv=require(_0xdb06('0x9'));var ejs=require(_0xdb06('0xa'));var fs=require('fs');var _=require(_0xdb06('0xb'));var squel=require(_0xdb06('0xc'));var crypto=require(_0xdb06('0xd'));var jsforce=require(_0xdb06('0xe'));var deskjs=require(_0xdb06('0xf'));var toCsv=require(_0xdb06('0x9'));var querystring=require(_0xdb06('0x10'));var Papa=require(_0xdb06('0x11'));var qs=require(_0xdb06('0x12'));var logger=require(_0xdb06('0x13'))(_0xdb06('0x14'));var utils=require(_0xdb06('0x15'));var config=require(_0xdb06('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xdb06('0x17'));var client=jayson[_0xdb06('0x18')][_0xdb06('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x495a73,_0x271bdf,_0x13bffa,_0x34f5ca){return new BPromise(function(_0x3c8398,_0x4528cb){var _0x5b7604=_0x34f5ca||client;return _0x5b7604[_0xdb06('0x1a')](_0x495a73,_0x13bffa)[_0xdb06('0x1b')](function(_0xc5b2b6){logger[_0xdb06('0x1c')](_0xdb06('0x1d'),_0x271bdf,'request\x20sent');logger[_0xdb06('0x1e')](_0xdb06('0x1f'),_0x271bdf,_0xdb06('0x20'),JSON['stringify'](_0xc5b2b6));if(_0xc5b2b6[_0xdb06('0x21')]){if(_0xc5b2b6[_0xdb06('0x21')]['code']===0x1f4){logger['error'](_0xdb06('0x1d'),_0x271bdf,_0xc5b2b6[_0xdb06('0x21')][_0xdb06('0x22')]);return _0x4528cb(_0xc5b2b6[_0xdb06('0x21')][_0xdb06('0x22')]);}logger[_0xdb06('0x21')]('FreshdeskAccount,\x20%s,\x20%s',_0x271bdf,_0xc5b2b6[_0xdb06('0x21')]['message']);return _0x3c8398(_0xc5b2b6[_0xdb06('0x21')][_0xdb06('0x22')]);}else{logger['info'](_0xdb06('0x1d'),_0x271bdf,_0xdb06('0x20'));_0x3c8398(_0xc5b2b6[_0xdb06('0x23')][_0xdb06('0x22')]);}})['catch'](function(_0x32f61f){logger[_0xdb06('0x21')](_0xdb06('0x1d'),_0x271bdf,_0x32f61f);_0x4528cb(_0x32f61f);});});}function respondWithStatusCode(_0x5e6904,_0x1e3895){_0x1e3895=_0x1e3895||0xcc;return function(_0x372b0e){if(_0x372b0e){return _0x5e6904['sendStatus'](_0x1e3895);}return _0x5e6904['status'](_0x1e3895)[_0xdb06('0x24')]();};}function respondWithResult(_0x403bd1,_0xb492ef){_0xb492ef=_0xb492ef||0xc8;return function(_0x18c70f){if(_0x18c70f){return _0x403bd1['status'](_0xb492ef)[_0xdb06('0x25')](_0x18c70f);}};}function respondWithFilteredResult(_0x20fa5c,_0x588c05){return function(_0x34c3f1){if(_0x34c3f1){var _0x3be626=_0x34c3f1[_0xdb06('0x26')],_0x571b69=_0x588c05['offset'],_0x371da1=_0x588c05[_0xdb06('0x27')]+_0x588c05['limit'],_0x44e9ad;if(_0x371da1>=_0x3be626){_0x371da1=_0x3be626;_0x44e9ad=0xc8;}else{_0x44e9ad=0xce;}_0x20fa5c[_0xdb06('0x28')](_0x44e9ad);return _0x20fa5c[_0xdb06('0x29')](_0xdb06('0x2a'),_0x571b69+'-'+_0x371da1+'/'+_0x3be626)[_0xdb06('0x25')](_0x34c3f1);}return null;};}function patchUpdates(_0x31130b){return function(_0x4e6ee0){try{jsonpatch[_0xdb06('0x2b')](_0x4e6ee0,_0x31130b,!![]);}catch(_0x10f1a4){return BPromise[_0xdb06('0x2c')](_0x10f1a4);}return _0x4e6ee0['save']();};}function saveUpdates(_0x1f56aa,_0x24db0a){return function(_0x1e17dd){if(_0x1e17dd){return _0x1e17dd[_0xdb06('0x2d')](_0x1f56aa)[_0xdb06('0x1b')](function(_0x6508c6){return _0x6508c6;});}return null;};}function removeEntity(_0x5233c9,_0x2fbc42){return function(_0x5d89f4){if(_0x5d89f4){return _0x5d89f4[_0xdb06('0x2e')]()['then'](function(){_0x5233c9[_0xdb06('0x28')](0xcc)[_0xdb06('0x24')]();});}};}function handleEntityNotFound(_0x5545dc,_0x2bb0b7){return function(_0x56be3f){if(!_0x56be3f){_0x5545dc[_0xdb06('0x2f')](0x194);}return _0x56be3f;};}function handleError(_0x190bbd,_0x3ba754){_0x3ba754=_0x3ba754||0x1f4;return function(_0x3687b3){logger[_0xdb06('0x21')](_0x3687b3[_0xdb06('0x30')]);if(_0x3687b3[_0xdb06('0x31')]){delete _0x3687b3[_0xdb06('0x31')];}_0x190bbd[_0xdb06('0x28')](_0x3ba754)['send'](_0x3687b3);};}exports[_0xdb06('0x32')]=function(_0x38c567,_0x4c206a){var _0x1e6e52={},_0x3d541f={},_0x575f11={'count':0x0,'rows':[]};var _0x6558fa=db[_0xdb06('0x33')][_0xdb06('0x34')];_0x3d541f['model']=_[_0xdb06('0x35')](_0x6558fa);var _0x231300={'dateStart':_0x38c567[_0xdb06('0x36')][_0xdb06('0x37')],'dateEnd':_0x38c567[_0xdb06('0x36')]['dateEnd']};delete _0x38c567['query'][_0xdb06('0x37')];delete _0x38c567[_0xdb06('0x36')]['dateEnd'];_0x3d541f[_0xdb06('0x36')]=_[_0xdb06('0x35')](_0x38c567[_0xdb06('0x36')]);_0x3d541f[_0xdb06('0x38')]=_[_0xdb06('0x39')](_0x3d541f[_0xdb06('0x3a')],_0x3d541f[_0xdb06('0x36')]);_0x1e6e52[_0xdb06('0x3b')]=_[_0xdb06('0x39')](_0x3d541f[_0xdb06('0x3a')],qs[_0xdb06('0x3c')](_0x38c567[_0xdb06('0x36')][_0xdb06('0x3c')]));_0x1e6e52[_0xdb06('0x3b')]=_0x1e6e52[_0xdb06('0x3b')][_0xdb06('0x3d')]?_0x1e6e52[_0xdb06('0x3b')]:_0x3d541f[_0xdb06('0x3a')];if(!_0x38c567[_0xdb06('0x36')][_0xdb06('0x3e')](_0xdb06('0x3f'))){_0x1e6e52[_0xdb06('0x40')]=qs[_0xdb06('0x40')](_0x38c567['query']['limit']);_0x1e6e52[_0xdb06('0x27')]=qs[_0xdb06('0x27')](_0x38c567['query'][_0xdb06('0x27')]);}_0x1e6e52[_0xdb06('0x41')]=qs['sort'](_0x38c567[_0xdb06('0x36')][_0xdb06('0x42')]);_0x1e6e52[_0xdb06('0x43')]=qs[_0xdb06('0x38')](_[_0xdb06('0x44')](_0x38c567[_0xdb06('0x36')],_0x3d541f['filters']));if(_0x231300[_0xdb06('0x37')]){if(_0x231300[_0xdb06('0x45')]){_0x231300[_0xdb06('0x45')]=moment(_0x231300[_0xdb06('0x45')])['add'](0x1,_0xdb06('0x46'));}else{_0x231300['dateEnd']=moment(_0x231300[_0xdb06('0x37')])['add'](0x1,_0xdb06('0x46'));}_[_0xdb06('0x47')](_0x1e6e52[_0xdb06('0x43')],{'createdAt':{'$gte':_0x231300['dateStart'],'$lte':_0x231300[_0xdb06('0x45')]}});}if(_0x38c567[_0xdb06('0x36')][_0xdb06('0x48')]){_0x1e6e52[_0xdb06('0x43')]=_[_0xdb06('0x47')](_0x1e6e52[_0xdb06('0x43')],{'$or':_['map'](_0x1e6e52[_0xdb06('0x3b')],function(_0x3e8ab8){var _0x3ce167={};_0x3ce167[_0x3e8ab8]={'$like':'%'+_0x38c567[_0xdb06('0x36')][_0xdb06('0x48')]+'%'};return _0x3ce167;})});}_0x1e6e52=_[_0xdb06('0x47')]({},_0x1e6e52,_0x38c567[_0xdb06('0x49')]);var _0x1b6014={'where':_0x1e6e52['where']};return db[_0xdb06('0x33')][_0xdb06('0x26')](_0x1b6014)[_0xdb06('0x1b')](function(_0x590700){_0x575f11[_0xdb06('0x26')]=_0x590700;if(_0x38c567[_0xdb06('0x36')][_0xdb06('0x4a')]){_0x1e6e52[_0xdb06('0x4b')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x1e6e52);})[_0xdb06('0x1b')](function(_0x19b815){_0x575f11[_0xdb06('0x4c')]=_0x19b815;return _0x575f11;})[_0xdb06('0x1b')](respondWithFilteredResult(_0x4c206a,_0x1e6e52))[_0xdb06('0x4d')](handleError(_0x4c206a,null));};exports['show']=function(_0x5d0b50,_0x47ac00){var _0x557ed1={'raw':![],'where':{'id':_0x5d0b50[_0xdb06('0x4e')]['id']}},_0x4019f4={};_0x4019f4['model']=_['keys'](db[_0xdb06('0x33')]['rawAttributes']);_0x4019f4[_0xdb06('0x36')]=_['keys'](_0x5d0b50[_0xdb06('0x36')]);_0x4019f4[_0xdb06('0x38')]=_[_0xdb06('0x39')](_0x4019f4[_0xdb06('0x3a')],_0x4019f4[_0xdb06('0x36')]);_0x557ed1[_0xdb06('0x3b')]=_[_0xdb06('0x39')](_0x4019f4[_0xdb06('0x3a')],qs[_0xdb06('0x3c')](_0x5d0b50[_0xdb06('0x36')][_0xdb06('0x3c')]));_0x557ed1[_0xdb06('0x3b')]=_0x557ed1[_0xdb06('0x3b')][_0xdb06('0x3d')]?_0x557ed1[_0xdb06('0x3b')]:_0x4019f4[_0xdb06('0x3a')];if(_0x5d0b50['query'][_0xdb06('0x4a')]){_0x557ed1[_0xdb06('0x4b')]=[{'all':!![]}];}_0x557ed1=_[_0xdb06('0x47')]({},_0x557ed1,_0x5d0b50['options']);return db[_0xdb06('0x33')][_0xdb06('0x4f')](_0x557ed1)['then'](handleEntityNotFound(_0x47ac00,null))[_0xdb06('0x1b')](respondWithResult(_0x47ac00,null))[_0xdb06('0x4d')](handleError(_0x47ac00,null));};exports[_0xdb06('0x50')]=function(_0xd386bb,_0x6d9a72){return db[_0xdb06('0x33')][_0xdb06('0x50')](_0xd386bb['body'],{})['then'](respondWithResult(_0x6d9a72,0xc9))['catch'](handleError(_0x6d9a72,null));};exports[_0xdb06('0x2d')]=function(_0x56fe34,_0xd5d359){if(_0x56fe34['body']['id']){delete _0x56fe34['body']['id'];}return db[_0xdb06('0x33')][_0xdb06('0x4f')]({'where':{'id':_0x56fe34[_0xdb06('0x4e')]['id']}})[_0xdb06('0x1b')](handleEntityNotFound(_0xd5d359,null))[_0xdb06('0x1b')](saveUpdates(_0x56fe34[_0xdb06('0x51')],null))[_0xdb06('0x1b')](respondWithResult(_0xd5d359,null))['catch'](handleError(_0xd5d359,null));};exports[_0xdb06('0x2e')]=function(_0xebba7c,_0x1e61b1){return db[_0xdb06('0x33')][_0xdb06('0x4f')]({'where':{'id':_0xebba7c['params']['id']}})[_0xdb06('0x1b')](handleEntityNotFound(_0x1e61b1,null))['then'](removeEntity(_0x1e61b1,null))['catch'](handleError(_0x1e61b1,null));};exports['getConfigurations']=function(_0x3f3f24,_0x1434b3,_0x505153){var _0x5c9efe={};var _0x530c93={};var _0xb30e82;var _0x185665;return db['FreshdeskAccount'][_0xdb06('0x52')]({'where':{'id':_0x3f3f24[_0xdb06('0x4e')]['id']}})[_0xdb06('0x1b')](handleEntityNotFound(_0x1434b3,null))[_0xdb06('0x1b')](function(_0x2dd916){if(_0x2dd916){_0xb30e82=_0x2dd916;_0x530c93[_0xdb06('0x3a')]=_['keys'](db['FreshdeskConfiguration']['rawAttributes']);_0x530c93[_0xdb06('0x36')]=_['keys'](_0x3f3f24[_0xdb06('0x36')]);_0x530c93[_0xdb06('0x38')]=_[_0xdb06('0x39')](_0x530c93[_0xdb06('0x3a')],_0x530c93[_0xdb06('0x36')]);_0x5c9efe['attributes']=_[_0xdb06('0x39')](_0x530c93[_0xdb06('0x3a')],qs[_0xdb06('0x3c')](_0x3f3f24['query'][_0xdb06('0x3c')]));_0x5c9efe[_0xdb06('0x3b')]=_0x5c9efe[_0xdb06('0x3b')][_0xdb06('0x3d')]?_0x5c9efe[_0xdb06('0x3b')]:_0x530c93[_0xdb06('0x3a')];_0x5c9efe[_0xdb06('0x41')]=qs[_0xdb06('0x42')](_0x3f3f24[_0xdb06('0x36')][_0xdb06('0x42')]);_0x5c9efe[_0xdb06('0x43')]=qs[_0xdb06('0x38')](_['pick'](_0x3f3f24[_0xdb06('0x36')],_0x530c93[_0xdb06('0x38')]));if(_0x3f3f24[_0xdb06('0x36')][_0xdb06('0x48')]){_0x5c9efe['where']=_['merge'](_0x5c9efe[_0xdb06('0x43')],{'$or':_[_0xdb06('0x53')](_0x5c9efe[_0xdb06('0x3b')],function(_0x4aa263){var _0x44cb3a={};_0x44cb3a[_0x4aa263]={'$like':'%'+_0x3f3f24['query']['filter']+'%'};return _0x44cb3a;})});}_0x5c9efe=_['merge']({},_0x5c9efe,_0x3f3f24[_0xdb06('0x49')]);return _0xb30e82[_0xdb06('0x54')](_0x5c9efe);}})[_0xdb06('0x1b')](function(_0x225820){if(_0x225820){_0x185665=_0x225820[_0xdb06('0x3d')];if(!_0x3f3f24['query']['hasOwnProperty'](_0xdb06('0x3f'))){_0x5c9efe[_0xdb06('0x40')]=qs[_0xdb06('0x40')](_0x3f3f24[_0xdb06('0x36')]['limit']);_0x5c9efe[_0xdb06('0x27')]=qs[_0xdb06('0x27')](_0x3f3f24[_0xdb06('0x36')][_0xdb06('0x27')]);}return _0xb30e82[_0xdb06('0x54')](_0x5c9efe);}})[_0xdb06('0x1b')](function(_0x31f24a){if(_0x31f24a){return _0x31f24a?{'count':_0x185665,'rows':_0x31f24a}:null;}})[_0xdb06('0x1b')](respondWithResult(_0x1434b3,null))[_0xdb06('0x4d')](handleError(_0x1434b3,null));};exports[_0xdb06('0x55')]=function(_0x30d001,_0x52849e,_0x55d22d){if(_0x30d001[_0xdb06('0x51')]['id']){delete _0x30d001[_0xdb06('0x51')]['id'];}return db[_0xdb06('0x33')]['findOne']({'where':{'id':_0x30d001[_0xdb06('0x4e')]['id']}})[_0xdb06('0x1b')](handleEntityNotFound(_0x52849e,null))['then'](function(_0x31c359){if(_0x31c359){_0x30d001[_0xdb06('0x51')][_0xdb06('0x56')]=_0x31c359['id'];_0x30d001[_0xdb06('0x51')]['Subjects']=integrations['getSubjects'](_0x30d001[_0xdb06('0x51')][_0xdb06('0x57')],_0x30d001[_0xdb06('0x51')]['type']);_0x30d001[_0xdb06('0x51')]['Descriptions']=integrations[_0xdb06('0x58')](_0x30d001[_0xdb06('0x51')][_0xdb06('0x57')],_0x30d001[_0xdb06('0x51')][_0xdb06('0x59')]);return db[_0xdb06('0x5a')][_0xdb06('0x50')](_0x30d001[_0xdb06('0x51')],{'include':[{'model':db[_0xdb06('0x5b')],'as':_0xdb06('0x5c')},{'model':db[_0xdb06('0x5b')],'as':_0xdb06('0x5d')}]});}return null;})[_0xdb06('0x1b')](respondWithResult(_0x52849e,null))[_0xdb06('0x4d')](handleError(_0x52849e,null));};exports[_0xdb06('0x5e')]=function(_0x4c24f3,_0x170fff,_0x3f1a6f){return db[_0xdb06('0x33')][_0xdb06('0x52')]({'where':{'id':_0x4c24f3[_0xdb06('0x4e')]['id']},'attributes':['id','remoteUri',_0xdb06('0x5f')]})['then'](handleEntityNotFound(_0x170fff,null))[_0xdb06('0x1b')](function(_0x4d08f3){if(_0x4d08f3){return rp({'method':_0xdb06('0x60'),'uri':util[_0xdb06('0x61')](_0xdb06('0x62'),_0x4d08f3[_0xdb06('0x63')],_0xdb06('0x64')),'headers':{'Authorization':util[_0xdb06('0x61')](_0xdb06('0x65'),new Buffer(util['format'](_0xdb06('0x66'),_0x4d08f3[_0xdb06('0x5f')]))[_0xdb06('0x67')](_0xdb06('0x68')))},'json':!![]});}})[_0xdb06('0x1b')](function(_0x57231b){if(_0x57231b){var _0x259d44=[_0xdb06('0x69'),'subject',_0xdb06('0x6a'),_0xdb06('0x6b'),_0xdb06('0x28'),_0xdb06('0x6c'),_0xdb06('0x6d'),'source',_0xdb06('0x6e'),'group',_0xdb06('0x6f')];_['remove'](_0x57231b,function(_0x54238a){return _0x259d44[_0xdb06('0x70')](_0x54238a[_0xdb06('0x31')])||!_0x54238a[_0xdb06('0x71')]&&_0x54238a[_0xdb06('0x59')]!==_0xdb06('0x72');});return{'count':_0x57231b['length'],'rows':_[_0xdb06('0x53')](_0x57231b,function(_0xbd745c){return{'id':_0xbd745c[_0xdb06('0x31')],'name':_0xbd745c[_0xdb06('0x73')],'custom':!_0xbd745c[_0xdb06('0x71')],'options':_0xbd745c[_0xdb06('0x74')]?_['map'](_0xbd745c[_0xdb06('0x74')],function(_0x5ad7bf){return{'name':_['capitalize'](_0x5ad7bf),'value':_0x5ad7bf};}):[]};})};}})['then'](respondWithResult(_0x170fff,null))[_0xdb06('0x4d')](function(_0xf78225){var _0x3464a6=_0x4c24f3[_0xdb06('0x36')]['test']?0x1f4:_0xf78225['statusCode']||0x1f4;logger[_0xdb06('0x21')](_0xdb06('0x75'),_0xdb06('0x5e'),_0x3464a6,JSON[_0xdb06('0x76')](_0xf78225));delete _0xf78225[_0xdb06('0x31')];if(_0x3464a6===0x191){_0x3464a6=0x190;}_0x170fff[_0xdb06('0x28')](_0x3464a6)[_0xdb06('0x77')](_0x4c24f3[_0xdb06('0x36')]['test']?{'message':_0xdb06('0x78'),'statusCode':_0xf78225[_0xdb06('0x79')]}:_0xf78225);});};
\ No newline at end of file
index 681aa4c..cb7e0be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b84=['moment','bluebird','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api'];(function(_0x530674,_0x1d7fb3){var _0x5b934c=function(_0xc2a927){while(--_0xc2a927){_0x530674['push'](_0x530674['shift']());}};_0x5b934c(++_0x1d7fb3);}(_0x2b84,0x105));var _0x42b8=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x2b84[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x42b8('0x0'));var util=require('util');var logger=require(_0x42b8('0x1'))(_0x42b8('0x2'));var moment=require(_0x42b8('0x3'));var BPromise=require(_0x42b8('0x4'));var rp=require('request-promise');var attributes=require(_0x42b8('0x5'));var integrations=require(_0x42b8('0x6'));module[_0x42b8('0x7')]=function(_0xd38487,_0x179ad2){return _0xd38487[_0x42b8('0x8')](_0x42b8('0x9'),attributes,{'tableName':_0x42b8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa739=['../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','util','api','moment','request-promise','./intFreshdeskAccount.attributes'];(function(_0x381dde,_0x5cbe92){var _0x12098c=function(_0x2d2da1){while(--_0x2d2da1){_0x381dde['push'](_0x381dde['shift']());}};_0x12098c(++_0x5cbe92);}(_0xa739,0x1e1));var _0x9a73=function(_0x112cbf,_0x2f77eb){_0x112cbf=_0x112cbf-0x0;var _0xd8bee5=_0xa739[_0x112cbf];return _0xd8bee5;};'use strict';var _=require('lodash');var util=require(_0x9a73('0x0'));var logger=require('../../config/logger')(_0x9a73('0x1'));var moment=require(_0x9a73('0x2'));var BPromise=require('bluebird');var rp=require(_0x9a73('0x3'));var attributes=require(_0x9a73('0x4'));var integrations=require(_0x9a73('0x5'));module['exports']=function(_0x6da224,_0x10252a){return _0x6da224[_0x9a73('0x6')](_0x9a73('0x7'),attributes,{'tableName':_0x9a73('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3c58fc0..1c95a9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b20=['util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','GetFreshdeskAccount','ShowFreshdeskAccount','find','debug','lodash'];(function(_0x4c25ea,_0xd168b4){var _0x33a7ed=function(_0x6e933e){while(--_0x6e933e){_0x4c25ea['push'](_0x4c25ea['shift']());}};_0x33a7ed(++_0xd168b4);}(_0x6b20,0xd1));var _0x06b2=function(_0x4b9f77,_0x5f5651){_0x4b9f77=_0x4b9f77-0x0;var _0x56c31c=_0x6b20[_0x4b9f77];return _0x56c31c;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var moment=require('moment');var BPromise=require(_0x06b2('0x2'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x06b2('0x3'))['db'];var utils=require(_0x06b2('0x4'));var logger=require(_0x06b2('0x5'))('rpc');var config=require(_0x06b2('0x6'));var jayson=require(_0x06b2('0x7'));var client=jayson[_0x06b2('0x8')][_0x06b2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b792b,_0x37b825,_0x26a325){return new BPromise(function(_0x4e6d3b,_0x21cd31){return client[_0x06b2('0xa')](_0x3b792b,_0x26a325)[_0x06b2('0xb')](function(_0x58538a){logger[_0x06b2('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x37b825,_0x06b2('0xd'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x37b825,_0x06b2('0xd'),JSON[_0x06b2('0xe')](_0x58538a));if(_0x58538a['error']){if(_0x58538a[_0x06b2('0xf')][_0x06b2('0x10')]===0x1f4){logger[_0x06b2('0xf')](_0x06b2('0x11'),_0x37b825,_0x58538a[_0x06b2('0xf')][_0x06b2('0x12')]);return _0x21cd31(_0x58538a[_0x06b2('0xf')][_0x06b2('0x12')]);}logger[_0x06b2('0xf')](_0x06b2('0x11'),_0x37b825,_0x58538a[_0x06b2('0xf')][_0x06b2('0x12')]);return _0x4e6d3b(_0x58538a[_0x06b2('0xf')]['message']);}else{logger[_0x06b2('0xc')](_0x06b2('0x11'),_0x37b825,_0x06b2('0xd'));_0x4e6d3b(_0x58538a[_0x06b2('0x13')][_0x06b2('0x12')]);}})[_0x06b2('0x14')](function(_0x4b148c){logger[_0x06b2('0xf')](_0x06b2('0x11'),_0x37b825,_0x4b148c);_0x21cd31(_0x4b148c);});});}exports['GetFreshdeskAccount']=function(_0x1e16d1){var _0x594b48=this;return new Promise(function(_0x4c9cae,_0x192270){return db[_0x06b2('0x15')][_0x06b2('0x16')]({'raw':_0x1e16d1[_0x06b2('0x17')]?_0x1e16d1['options'][_0x06b2('0x18')]===undefined?!![]:![]:!![],'where':_0x1e16d1[_0x06b2('0x17')]?_0x1e16d1[_0x06b2('0x17')][_0x06b2('0x19')]||null:null,'attributes':_0x1e16d1[_0x06b2('0x17')]?_0x1e16d1[_0x06b2('0x17')][_0x06b2('0x1a')]||null:null,'limit':_0x1e16d1['options']?_0x1e16d1[_0x06b2('0x17')][_0x06b2('0x1b')]||null:null,'include':_0x1e16d1[_0x06b2('0x17')]?_0x1e16d1[_0x06b2('0x17')]['include']?_['map'](_0x1e16d1[_0x06b2('0x17')][_0x06b2('0x1c')],function(_0x4fc95f){return{'model':db[_0x4fc95f[_0x06b2('0x1d')]],'as':_0x4fc95f['as'],'attributes':_0x4fc95f['attributes'],'include':_0x4fc95f[_0x06b2('0x1c')]?_[_0x06b2('0x1e')](_0x4fc95f[_0x06b2('0x1c')],function(_0x593d3a){return{'model':db[_0x593d3a[_0x06b2('0x1d')]],'as':_0x593d3a['as'],'attributes':_0x593d3a[_0x06b2('0x1a')],'include':_0x593d3a[_0x06b2('0x1c')]?_[_0x06b2('0x1e')](_0x593d3a[_0x06b2('0x1c')],function(_0x4f5e90){return{'model':db[_0x4f5e90[_0x06b2('0x1d')]],'as':_0x4f5e90['as'],'attributes':_0x4f5e90[_0x06b2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x06b2('0xb')](function(_0x1a99c1){logger[_0x06b2('0xc')](_0x06b2('0x1f'),_0x1e16d1);logger['debug'](_0x06b2('0x1f'),_0x1e16d1,JSON[_0x06b2('0xe')](_0x1a99c1));_0x4c9cae(_0x1a99c1);})[_0x06b2('0x14')](function(_0x13c0eb){logger[_0x06b2('0xf')](_0x06b2('0x1f'),_0x13c0eb[_0x06b2('0x12')],_0x1e16d1);_0x192270(_0x594b48['error'](0x1f4,_0x13c0eb[_0x06b2('0x12')]));});});};exports[_0x06b2('0x20')]=function(_0x1637c2){var _0x15a78b=this;return new Promise(function(_0x1cc725,_0x37d391){return db[_0x06b2('0x15')][_0x06b2('0x21')]({'raw':_0x1637c2['options']?_0x1637c2[_0x06b2('0x17')][_0x06b2('0x18')]===undefined?!![]:![]:!![],'where':_0x1637c2[_0x06b2('0x17')]?_0x1637c2[_0x06b2('0x17')][_0x06b2('0x19')]||null:null,'attributes':_0x1637c2[_0x06b2('0x17')]?_0x1637c2[_0x06b2('0x17')]['attributes']||null:null,'include':_0x1637c2['options']?_0x1637c2[_0x06b2('0x17')][_0x06b2('0x1c')]?_[_0x06b2('0x1e')](_0x1637c2['options'][_0x06b2('0x1c')],function(_0x25ec1a){return{'model':db[_0x25ec1a[_0x06b2('0x1d')]],'as':_0x25ec1a['as'],'attributes':_0x25ec1a[_0x06b2('0x1a')],'include':_0x25ec1a[_0x06b2('0x1c')]?_[_0x06b2('0x1e')](_0x25ec1a['include'],function(_0x6d8fe0){return{'model':db[_0x6d8fe0[_0x06b2('0x1d')]],'as':_0x6d8fe0['as'],'attributes':_0x6d8fe0[_0x06b2('0x1a')],'include':_0x6d8fe0['include']?_[_0x06b2('0x1e')](_0x6d8fe0[_0x06b2('0x1c')],function(_0x53cbfa){return{'model':db[_0x53cbfa[_0x06b2('0x1d')]],'as':_0x53cbfa['as'],'attributes':_0x53cbfa[_0x06b2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x06b2('0xb')](function(_0xdb75cb){logger[_0x06b2('0xc')](_0x06b2('0x20'),_0x1637c2);logger[_0x06b2('0x22')](_0x06b2('0x20'),_0x1637c2,JSON[_0x06b2('0xe')](_0xdb75cb));_0x1cc725(_0xdb75cb);})[_0x06b2('0x14')](function(_0x21d048){logger[_0x06b2('0xf')]('ShowFreshdeskAccount',_0x21d048[_0x06b2('0x12')],_0x1637c2);_0x37d391(_0x15a78b['error'](0x1f4,_0x21d048['message']));});});};
\ No newline at end of file
+var _0xd5fc=['stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','GetFreshdeskAccount','FreshdeskAccount','options','where','attributes','include','map','model','then','ShowFreshdeskAccount','find','raw','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x3f06e2,_0x2c3d11){var _0x4567c6=function(_0x31cd16){while(--_0x31cd16){_0x3f06e2['push'](_0x3f06e2['shift']());}};_0x4567c6(++_0x2c3d11);}(_0xd5fc,0xae));var _0xcd5f=function(_0x50652c,_0x15295f){_0x50652c=_0x50652c-0x0;var _0x3ee824=_0xd5fc[_0x50652c];return _0x3ee824;};'use strict';var _=require(_0xcd5f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcd5f('0x1'));var fs=require('fs');var db=require(_0xcd5f('0x2'))['db'];var utils=require(_0xcd5f('0x3'));var logger=require(_0xcd5f('0x4'))(_0xcd5f('0x5'));var config=require(_0xcd5f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcd5f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x95b8bb,_0x159b3f,_0x5af696){return new BPromise(function(_0x58d65d,_0x4e668e){return client[_0xcd5f('0x8')](_0x95b8bb,_0x5af696)['then'](function(_0xa1dae3){logger[_0xcd5f('0x9')]('FreshdeskAccount,\x20%s,\x20%s',_0x159b3f,_0xcd5f('0xa'));logger['debug'](_0xcd5f('0xb'),_0x159b3f,'request\x20sent',JSON[_0xcd5f('0xc')](_0xa1dae3));if(_0xa1dae3[_0xcd5f('0xd')]){if(_0xa1dae3[_0xcd5f('0xd')][_0xcd5f('0xe')]===0x1f4){logger['error'](_0xcd5f('0xf'),_0x159b3f,_0xa1dae3[_0xcd5f('0xd')]['message']);return _0x4e668e(_0xa1dae3[_0xcd5f('0xd')][_0xcd5f('0x10')]);}logger[_0xcd5f('0xd')](_0xcd5f('0xf'),_0x159b3f,_0xa1dae3[_0xcd5f('0xd')]['message']);return _0x58d65d(_0xa1dae3[_0xcd5f('0xd')][_0xcd5f('0x10')]);}else{logger[_0xcd5f('0x9')](_0xcd5f('0xf'),_0x159b3f,_0xcd5f('0xa'));_0x58d65d(_0xa1dae3[_0xcd5f('0x11')][_0xcd5f('0x10')]);}})['catch'](function(_0x398e16){logger[_0xcd5f('0xd')](_0xcd5f('0xf'),_0x159b3f,_0x398e16);_0x4e668e(_0x398e16);});});}exports[_0xcd5f('0x12')]=function(_0x566200){var _0x1a4cb6=this;return new Promise(function(_0x56a874,_0xb23761){return db[_0xcd5f('0x13')]['findAll']({'raw':_0x566200[_0xcd5f('0x14')]?_0x566200[_0xcd5f('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x566200[_0xcd5f('0x14')]?_0x566200['options'][_0xcd5f('0x15')]||null:null,'attributes':_0x566200['options']?_0x566200['options'][_0xcd5f('0x16')]||null:null,'limit':_0x566200['options']?_0x566200['options']['limit']||null:null,'include':_0x566200[_0xcd5f('0x14')]?_0x566200['options'][_0xcd5f('0x17')]?_[_0xcd5f('0x18')](_0x566200[_0xcd5f('0x14')][_0xcd5f('0x17')],function(_0x2a671a){return{'model':db[_0x2a671a['model']],'as':_0x2a671a['as'],'attributes':_0x2a671a[_0xcd5f('0x16')],'include':_0x2a671a[_0xcd5f('0x17')]?_[_0xcd5f('0x18')](_0x2a671a[_0xcd5f('0x17')],function(_0x11e7e9){return{'model':db[_0x11e7e9[_0xcd5f('0x19')]],'as':_0x11e7e9['as'],'attributes':_0x11e7e9[_0xcd5f('0x16')],'include':_0x11e7e9[_0xcd5f('0x17')]?_[_0xcd5f('0x18')](_0x11e7e9[_0xcd5f('0x17')],function(_0x41f682){return{'model':db[_0x41f682[_0xcd5f('0x19')]],'as':_0x41f682['as'],'attributes':_0x41f682[_0xcd5f('0x16')]};}):[]};}):[]};}):[]:[]})[_0xcd5f('0x1a')](function(_0x237331){logger[_0xcd5f('0x9')](_0xcd5f('0x12'),_0x566200);logger['debug'](_0xcd5f('0x12'),_0x566200,JSON[_0xcd5f('0xc')](_0x237331));_0x56a874(_0x237331);})['catch'](function(_0xd7f50f){logger['error'](_0xcd5f('0x12'),_0xd7f50f[_0xcd5f('0x10')],_0x566200);_0xb23761(_0x1a4cb6[_0xcd5f('0xd')](0x1f4,_0xd7f50f[_0xcd5f('0x10')]));});});};exports[_0xcd5f('0x1b')]=function(_0x22e87e){var _0x57e5cf=this;return new Promise(function(_0x5955bb,_0x116223){return db[_0xcd5f('0x13')][_0xcd5f('0x1c')]({'raw':_0x22e87e[_0xcd5f('0x14')]?_0x22e87e[_0xcd5f('0x14')][_0xcd5f('0x1d')]===undefined?!![]:![]:!![],'where':_0x22e87e[_0xcd5f('0x14')]?_0x22e87e['options'][_0xcd5f('0x15')]||null:null,'attributes':_0x22e87e[_0xcd5f('0x14')]?_0x22e87e[_0xcd5f('0x14')][_0xcd5f('0x16')]||null:null,'include':_0x22e87e['options']?_0x22e87e[_0xcd5f('0x14')][_0xcd5f('0x17')]?_[_0xcd5f('0x18')](_0x22e87e['options'][_0xcd5f('0x17')],function(_0x1293d2){return{'model':db[_0x1293d2[_0xcd5f('0x19')]],'as':_0x1293d2['as'],'attributes':_0x1293d2[_0xcd5f('0x16')],'include':_0x1293d2[_0xcd5f('0x17')]?_[_0xcd5f('0x18')](_0x1293d2[_0xcd5f('0x17')],function(_0x4049d7){return{'model':db[_0x4049d7['model']],'as':_0x4049d7['as'],'attributes':_0x4049d7['attributes'],'include':_0x4049d7[_0xcd5f('0x17')]?_['map'](_0x4049d7[_0xcd5f('0x17')],function(_0x442fa5){return{'model':db[_0x442fa5[_0xcd5f('0x19')]],'as':_0x442fa5['as'],'attributes':_0x442fa5['attributes']};}):[]};}):[]};}):[]:[]})[_0xcd5f('0x1a')](function(_0x1aa5cc){logger[_0xcd5f('0x9')](_0xcd5f('0x1b'),_0x22e87e);logger['debug'](_0xcd5f('0x1b'),_0x22e87e,JSON['stringify'](_0x1aa5cc));_0x5955bb(_0x1aa5cc);})[_0xcd5f('0x1e')](function(_0x3ebe00){logger[_0xcd5f('0xd')](_0xcd5f('0x1b'),_0x3ebe00[_0xcd5f('0x10')],_0x22e87e);_0x116223(_0x57e5cf[_0xcd5f('0xd')](0x1f4,_0x3ebe00['message']));});});};
\ No newline at end of file
index 2b9a4c0..139ccbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','exports','multer','util','path','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated'];(function(_0x121bb4,_0x672e51){var _0x147f90=function(_0x180224){while(--_0x180224){_0x121bb4['push'](_0x121bb4['shift']());}};_0x147f90(++_0x672e51);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x0a9e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0a9e('0x4'));var controller=require(_0x0a9e('0x5'));router[_0x0a9e('0x6')]('/',auth[_0x0a9e('0x7')](),controller[_0x0a9e('0x8')]);router['get'](_0x0a9e('0x9'),auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xa')]);router['get']('/:id/fields',auth[_0x0a9e('0x7')](),controller['getFields']);router['get'](_0x0a9e('0xb'),auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x6')](_0x0a9e('0xd'),auth[_0x0a9e('0x7')](),controller['getDescriptions']);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth[_0x0a9e('0x7')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0x11'),auth['isAuthenticated'](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0x9'),auth[_0x0a9e('0x7')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x15')]('/:id',auth[_0x0a9e('0x7')](),controller['destroy']);module[_0x0a9e('0x16')]=router;
\ No newline at end of file
+var _0xa9e0=['index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','exports','multer','util','path','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated'];(function(_0x2cfa8b,_0x10830c){var _0x5b1032=function(_0x223f9f){while(--_0x223f9f){_0x2cfa8b['push'](_0x2cfa8b['shift']());}};_0x5b1032(++_0x10830c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x0a9e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0a9e('0x4'));var controller=require(_0x0a9e('0x5'));router[_0x0a9e('0x6')]('/',auth[_0x0a9e('0x7')](),controller[_0x0a9e('0x8')]);router['get'](_0x0a9e('0x9'),auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xa')]);router['get']('/:id/fields',auth[_0x0a9e('0x7')](),controller['getFields']);router['get'](_0x0a9e('0xb'),auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x6')](_0x0a9e('0xd'),auth[_0x0a9e('0x7')](),controller['getDescriptions']);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth[_0x0a9e('0x7')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0x11'),auth['isAuthenticated'](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0x9'),auth[_0x0a9e('0x7')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x15')]('/:id',auth[_0x0a9e('0x7')](),controller['destroy']);module[_0x0a9e('0x16')]=router;
\ No newline at end of file
index 644b625..98b6a27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3647=['exports','STRING','sequelize'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x3647,0x1dc));var _0x7364=function(_0x225ed1,_0x256462){_0x225ed1=_0x225ed1-0x0;var _0x52c5c1=_0x3647[_0x225ed1];return _0x52c5c1;};'use strict';var Sequelize=require(_0x7364('0x0'));module[_0x7364('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7364('0x2')]}};
\ No newline at end of file
+var _0xe2bb=['sequelize','exports','STRING'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xe2bb,0x87));var _0xbe2b=function(_0x264d4d,_0x118fb5){_0x264d4d=_0x264d4d-0x0;var _0xc917e2=_0xe2bb[_0x264d4d];return _0xc917e2;};'use strict';var Sequelize=require(_0xbe2b('0x0'));module[_0xbe2b('0x1')]={'name':{'type':Sequelize[_0xbe2b('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 69acefe..f6d25ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf03f=['day','merge','where','filter','options','count','include','findAll','params','find','catch','create','body','getFields','findOne','map','FreshdeskField','getSubjects','getTags','Tag','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','offset','limit','Content-Range','apply','save','update','then','name','send','index','FreshdeskConfiguration','rawAttributes','model','query','dateStart','dateEnd','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','add'];(function(_0x23afff,_0x356f7e){var _0x5f57db=function(_0x827c0){while(--_0x827c0){_0x23afff['push'](_0x23afff['shift']());}};_0x5f57db(++_0x356f7e);}(_0xf03f,0x170));var _0xff03=function(_0x18dc34,_0x205f71){_0x18dc34=_0x18dc34-0x0;var _0x4ab15b=_0xf03f[_0x18dc34];return _0x4ab15b;};'use strict';var pdf=require(_0xff03('0x0'));var emlformat=require(_0xff03('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xff03('0x2'));var jsonpatch=require(_0xff03('0x3'));var rp=require(_0xff03('0x4'));var moment=require(_0xff03('0x5'));var BPromise=require(_0xff03('0x6'));var Mustache=require(_0xff03('0x7'));var util=require(_0xff03('0x8'));var path=require(_0xff03('0x9'));var sox=require(_0xff03('0xa'));var csv=require(_0xff03('0xb'));var ejs=require(_0xff03('0xc'));var fs=require('fs');var _=require(_0xff03('0xd'));var squel=require(_0xff03('0xe'));var crypto=require(_0xff03('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xff03('0x10'));var toCsv=require(_0xff03('0xb'));var querystring=require(_0xff03('0x11'));var Papa=require(_0xff03('0x12'));var qs=require(_0xff03('0x13'));var logger=require('../../config/logger')(_0xff03('0x14'));var utils=require(_0xff03('0x15'));var config=require(_0xff03('0x16'));var db=require(_0xff03('0x17'))['db'];var jayson=require(_0xff03('0x18'));var client=jayson['client'][_0xff03('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x244248,_0x3f626e,_0x1f778f,_0x2c5d36){return new BPromise(function(_0x412c41,_0x403ed7){var _0x1f4279=_0x2c5d36||client;return _0x1f4279[_0xff03('0x1a')](_0x244248,_0x1f778f)['then'](function(_0x254e8e){logger[_0xff03('0x1b')](_0xff03('0x1c'),_0x3f626e,'request\x20sent');logger[_0xff03('0x1d')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3f626e,_0xff03('0x1e'),JSON[_0xff03('0x1f')](_0x254e8e));if(_0x254e8e[_0xff03('0x20')]){if(_0x254e8e['error'][_0xff03('0x21')]===0x1f4){logger[_0xff03('0x20')](_0xff03('0x1c'),_0x3f626e,_0x254e8e[_0xff03('0x20')][_0xff03('0x22')]);return _0x403ed7(_0x254e8e[_0xff03('0x20')][_0xff03('0x22')]);}logger[_0xff03('0x20')](_0xff03('0x1c'),_0x3f626e,_0x254e8e[_0xff03('0x20')][_0xff03('0x22')]);return _0x412c41(_0x254e8e['error']['message']);}else{logger[_0xff03('0x1b')](_0xff03('0x1c'),_0x3f626e,_0xff03('0x1e'));_0x412c41(_0x254e8e[_0xff03('0x23')][_0xff03('0x22')]);}})['catch'](function(_0x5b8a7a){logger[_0xff03('0x20')](_0xff03('0x1c'),_0x3f626e,_0x5b8a7a);_0x403ed7(_0x5b8a7a);});});}function respondWithStatusCode(_0x2ebbaa,_0x1a8ff5){_0x1a8ff5=_0x1a8ff5||0xcc;return function(_0x5b67ff){if(_0x5b67ff){return _0x2ebbaa[_0xff03('0x24')](_0x1a8ff5);}return _0x2ebbaa[_0xff03('0x25')](_0x1a8ff5)['end']();};}function respondWithResult(_0x18c4aa,_0x4d5045){_0x4d5045=_0x4d5045||0xc8;return function(_0x5b740b){if(_0x5b740b){return _0x18c4aa[_0xff03('0x25')](_0x4d5045)[_0xff03('0x26')](_0x5b740b);}};}function respondWithFilteredResult(_0x4b342c,_0x5e1d4f){return function(_0x4ffe79){if(_0x4ffe79){var _0x2b6d42=_0x4ffe79['count'],_0x4c3f61=_0x5e1d4f[_0xff03('0x27')],_0x38bd7f=_0x5e1d4f[_0xff03('0x27')]+_0x5e1d4f[_0xff03('0x28')],_0x5c3abd;if(_0x38bd7f>=_0x2b6d42){_0x38bd7f=_0x2b6d42;_0x5c3abd=0xc8;}else{_0x5c3abd=0xce;}_0x4b342c['status'](_0x5c3abd);return _0x4b342c['set'](_0xff03('0x29'),_0x4c3f61+'-'+_0x38bd7f+'/'+_0x2b6d42)[_0xff03('0x26')](_0x4ffe79);}return null;};}function patchUpdates(_0x1365d5){return function(_0x1595dd){try{jsonpatch[_0xff03('0x2a')](_0x1595dd,_0x1365d5,!![]);}catch(_0x9eefb3){return BPromise['reject'](_0x9eefb3);}return _0x1595dd[_0xff03('0x2b')]();};}function saveUpdates(_0x27a606,_0x32e473){return function(_0xa8e5f8){if(_0xa8e5f8){return _0xa8e5f8[_0xff03('0x2c')](_0x27a606)[_0xff03('0x2d')](function(_0x41fc38){return _0x41fc38;});}return null;};}function removeEntity(_0x1c700e,_0x5df041){return function(_0x31f1d2){if(_0x31f1d2){return _0x31f1d2['destroy']()[_0xff03('0x2d')](function(){_0x1c700e[_0xff03('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b9a14,_0x43ca7d){return function(_0x35bc1d){if(!_0x35bc1d){_0x1b9a14['sendStatus'](0x194);}return _0x35bc1d;};}function handleError(_0xa72bb6,_0x2c1d9b){_0x2c1d9b=_0x2c1d9b||0x1f4;return function(_0x123c34){logger[_0xff03('0x20')](_0x123c34['stack']);if(_0x123c34[_0xff03('0x2e')]){delete _0x123c34['name'];}_0xa72bb6[_0xff03('0x25')](_0x2c1d9b)[_0xff03('0x2f')](_0x123c34);};}exports[_0xff03('0x30')]=function(_0x4a947e,_0x440757){var _0xe710b7={},_0x308901={},_0x21b164={'count':0x0,'rows':[]};var _0x9ec560=db[_0xff03('0x31')][_0xff03('0x32')];_0x308901[_0xff03('0x33')]=_['keys'](_0x9ec560);var _0x2f6c3c={'dateStart':_0x4a947e[_0xff03('0x34')][_0xff03('0x35')],'dateEnd':_0x4a947e[_0xff03('0x34')][_0xff03('0x36')]};delete _0x4a947e[_0xff03('0x34')]['dateStart'];delete _0x4a947e[_0xff03('0x34')][_0xff03('0x36')];_0x308901[_0xff03('0x34')]=_[_0xff03('0x37')](_0x4a947e[_0xff03('0x34')]);_0x308901['filters']=_[_0xff03('0x38')](_0x308901[_0xff03('0x33')],_0x308901['query']);_0xe710b7['attributes']=_[_0xff03('0x38')](_0x308901['model'],qs[_0xff03('0x39')](_0x4a947e[_0xff03('0x34')][_0xff03('0x39')]));_0xe710b7[_0xff03('0x3a')]=_0xe710b7['attributes'][_0xff03('0x3b')]?_0xe710b7['attributes']:_0x308901[_0xff03('0x33')];if(!_0x4a947e[_0xff03('0x34')][_0xff03('0x3c')](_0xff03('0x3d'))){_0xe710b7[_0xff03('0x28')]=qs[_0xff03('0x28')](_0x4a947e[_0xff03('0x34')]['limit']);_0xe710b7['offset']=qs['offset'](_0x4a947e[_0xff03('0x34')][_0xff03('0x27')]);}_0xe710b7[_0xff03('0x3e')]=qs[_0xff03('0x3f')](_0x4a947e[_0xff03('0x34')]['sort']);_0xe710b7['where']=qs[_0xff03('0x40')](_[_0xff03('0x41')](_0x4a947e[_0xff03('0x34')],_0x308901[_0xff03('0x40')]));if(_0x2f6c3c['dateStart']){if(_0x2f6c3c[_0xff03('0x36')]){_0x2f6c3c[_0xff03('0x36')]=moment(_0x2f6c3c['dateEnd'])[_0xff03('0x42')](0x1,'day');}else{_0x2f6c3c[_0xff03('0x36')]=moment(_0x2f6c3c['dateStart'])[_0xff03('0x42')](0x1,_0xff03('0x43'));}_[_0xff03('0x44')](_0xe710b7[_0xff03('0x45')],{'createdAt':{'$gte':_0x2f6c3c[_0xff03('0x35')],'$lte':_0x2f6c3c[_0xff03('0x36')]}});}if(_0x4a947e['query'][_0xff03('0x46')]){_0xe710b7[_0xff03('0x45')]=_['merge'](_0xe710b7['where'],{'$or':_['map'](_0xe710b7[_0xff03('0x3a')],function(_0x263966){var _0x1f09ee={};_0x1f09ee[_0x263966]={'$like':'%'+_0x4a947e[_0xff03('0x34')][_0xff03('0x46')]+'%'};return _0x1f09ee;})});}_0xe710b7=_[_0xff03('0x44')]({},_0xe710b7,_0x4a947e[_0xff03('0x47')]);var _0x5e850a={'where':_0xe710b7[_0xff03('0x45')]};return db[_0xff03('0x31')][_0xff03('0x48')](_0x5e850a)[_0xff03('0x2d')](function(_0xdd168b){_0x21b164[_0xff03('0x48')]=_0xdd168b;if(_0x4a947e[_0xff03('0x34')]['includeAll']){_0xe710b7[_0xff03('0x49')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xff03('0x4a')](_0xe710b7);})[_0xff03('0x2d')](function(_0x2a8607){_0x21b164['rows']=_0x2a8607;return _0x21b164;})[_0xff03('0x2d')](respondWithFilteredResult(_0x440757,_0xe710b7))['catch'](handleError(_0x440757,null));};exports['show']=function(_0x476a65,_0x13ac1c){var _0x3df5fa={'raw':![],'where':{'id':_0x476a65[_0xff03('0x4b')]['id']}},_0x3fec84={};_0x3fec84[_0xff03('0x33')]=_[_0xff03('0x37')](db[_0xff03('0x31')][_0xff03('0x32')]);_0x3fec84[_0xff03('0x34')]=_[_0xff03('0x37')](_0x476a65[_0xff03('0x34')]);_0x3fec84[_0xff03('0x40')]=_[_0xff03('0x38')](_0x3fec84[_0xff03('0x33')],_0x3fec84[_0xff03('0x34')]);_0x3df5fa[_0xff03('0x3a')]=_[_0xff03('0x38')](_0x3fec84[_0xff03('0x33')],qs['fields'](_0x476a65[_0xff03('0x34')]['fields']));_0x3df5fa['attributes']=_0x3df5fa['attributes'][_0xff03('0x3b')]?_0x3df5fa[_0xff03('0x3a')]:_0x3fec84[_0xff03('0x33')];if(_0x476a65[_0xff03('0x34')]['includeAll']){_0x3df5fa[_0xff03('0x49')]=[{'all':!![]}];}_0x3df5fa=_['merge']({},_0x3df5fa,_0x476a65['options']);return db[_0xff03('0x31')][_0xff03('0x4c')](_0x3df5fa)['then'](handleEntityNotFound(_0x13ac1c,null))[_0xff03('0x2d')](respondWithResult(_0x13ac1c,null))[_0xff03('0x4d')](handleError(_0x13ac1c,null));};exports[_0xff03('0x4e')]=function(_0x2be057,_0x2f8e37){return db[_0xff03('0x31')][_0xff03('0x4e')](_0x2be057['body'],{})[_0xff03('0x2d')](respondWithResult(_0x2f8e37,0xc9))[_0xff03('0x4d')](handleError(_0x2f8e37,null));};exports['update']=function(_0x214ed4,_0x21bc39){if(_0x214ed4[_0xff03('0x4f')]['id']){delete _0x214ed4[_0xff03('0x4f')]['id'];}return db[_0xff03('0x31')][_0xff03('0x4c')]({'where':{'id':_0x214ed4[_0xff03('0x4b')]['id']}})[_0xff03('0x2d')](handleEntityNotFound(_0x21bc39,null))[_0xff03('0x2d')](saveUpdates(_0x214ed4[_0xff03('0x4f')],null))[_0xff03('0x2d')](respondWithResult(_0x21bc39,null))[_0xff03('0x4d')](handleError(_0x21bc39,null));};exports['destroy']=function(_0x31cf2e,_0xf9d90c){return db[_0xff03('0x31')][_0xff03('0x4c')]({'where':{'id':_0x31cf2e[_0xff03('0x4b')]['id']}})[_0xff03('0x2d')](handleEntityNotFound(_0xf9d90c,null))[_0xff03('0x2d')](removeEntity(_0xf9d90c,null))[_0xff03('0x4d')](handleError(_0xf9d90c,null));};exports[_0xff03('0x50')]=function(_0x5e90b4,_0x584905,_0x51000d){var _0x407a26={};var _0x4bc9c4={};var _0x46ea7a;var _0x5b4dd9;return db[_0xff03('0x31')][_0xff03('0x51')]({'where':{'id':_0x5e90b4['params']['id']}})[_0xff03('0x2d')](handleEntityNotFound(_0x584905,null))['then'](function(_0x4eb987){if(_0x4eb987){_0x46ea7a=_0x4eb987;_0x4bc9c4['model']=_[_0xff03('0x37')](db['FreshdeskField'][_0xff03('0x32')]);_0x4bc9c4['query']=_[_0xff03('0x37')](_0x5e90b4[_0xff03('0x34')]);_0x4bc9c4[_0xff03('0x40')]=_[_0xff03('0x38')](_0x4bc9c4[_0xff03('0x33')],_0x4bc9c4[_0xff03('0x34')]);_0x407a26[_0xff03('0x3a')]=_['intersection'](_0x4bc9c4['model'],qs['fields'](_0x5e90b4[_0xff03('0x34')]['fields']));_0x407a26[_0xff03('0x3a')]=_0x407a26[_0xff03('0x3a')][_0xff03('0x3b')]?_0x407a26[_0xff03('0x3a')]:_0x4bc9c4[_0xff03('0x33')];_0x407a26['order']=qs[_0xff03('0x3f')](_0x5e90b4[_0xff03('0x34')][_0xff03('0x3f')]);_0x407a26['where']=qs['filters'](_[_0xff03('0x41')](_0x5e90b4[_0xff03('0x34')],_0x4bc9c4[_0xff03('0x40')]));if(_0x5e90b4[_0xff03('0x34')]['filter']){_0x407a26[_0xff03('0x45')]=_[_0xff03('0x44')](_0x407a26['where'],{'$or':_[_0xff03('0x52')](_0x407a26[_0xff03('0x3a')],function(_0x429202){var _0x1aa466={};_0x1aa466[_0x429202]={'$like':'%'+_0x5e90b4[_0xff03('0x34')][_0xff03('0x46')]+'%'};return _0x1aa466;})});}_0x407a26=_[_0xff03('0x44')]({},_0x407a26,_0x5e90b4[_0xff03('0x47')]);return _0x46ea7a[_0xff03('0x50')](_0x407a26);}})[_0xff03('0x2d')](function(_0x2d1dba){if(_0x2d1dba){_0x5b4dd9=_0x2d1dba['length'];if(!_0x5e90b4[_0xff03('0x34')][_0xff03('0x3c')](_0xff03('0x3d'))){_0x407a26[_0xff03('0x28')]=qs[_0xff03('0x28')](_0x5e90b4['query'][_0xff03('0x28')]);_0x407a26[_0xff03('0x27')]=qs[_0xff03('0x27')](_0x5e90b4[_0xff03('0x34')][_0xff03('0x27')]);}return _0x46ea7a[_0xff03('0x50')](_0x407a26);}})['then'](function(_0x3e9a7f){if(_0x3e9a7f){return _0x3e9a7f?{'count':_0x5b4dd9,'rows':_0x3e9a7f}:null;}})[_0xff03('0x2d')](respondWithResult(_0x584905,null))[_0xff03('0x4d')](handleError(_0x584905,null));};exports['getSubjects']=function(_0x5c5f61,_0x292bbf,_0x55140b){var _0x482563={};var _0x5a62ec={};var _0x254f28;var _0x1c4fe2;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x5c5f61[_0xff03('0x4b')]['id']}})[_0xff03('0x2d')](handleEntityNotFound(_0x292bbf,null))[_0xff03('0x2d')](function(_0x32bea7){if(_0x32bea7){_0x254f28=_0x32bea7;_0x5a62ec[_0xff03('0x33')]=_[_0xff03('0x37')](db[_0xff03('0x53')][_0xff03('0x32')]);_0x5a62ec[_0xff03('0x34')]=_['keys'](_0x5c5f61['query']);_0x5a62ec['filters']=_['intersection'](_0x5a62ec[_0xff03('0x33')],_0x5a62ec[_0xff03('0x34')]);_0x482563['attributes']=_[_0xff03('0x38')](_0x5a62ec[_0xff03('0x33')],qs[_0xff03('0x39')](_0x5c5f61[_0xff03('0x34')][_0xff03('0x39')]));_0x482563[_0xff03('0x3a')]=_0x482563[_0xff03('0x3a')][_0xff03('0x3b')]?_0x482563[_0xff03('0x3a')]:_0x5a62ec[_0xff03('0x33')];_0x482563[_0xff03('0x3e')]=qs[_0xff03('0x3f')](_0x5c5f61['query']['sort']);_0x482563[_0xff03('0x45')]=qs[_0xff03('0x40')](_[_0xff03('0x41')](_0x5c5f61[_0xff03('0x34')],_0x5a62ec[_0xff03('0x40')]));if(_0x5c5f61[_0xff03('0x34')][_0xff03('0x46')]){_0x482563['where']=_[_0xff03('0x44')](_0x482563[_0xff03('0x45')],{'$or':_[_0xff03('0x52')](_0x482563['attributes'],function(_0x2ee78f){var _0x51887d={};_0x51887d[_0x2ee78f]={'$like':'%'+_0x5c5f61['query']['filter']+'%'};return _0x51887d;})});}_0x482563=_[_0xff03('0x44')]({},_0x482563,_0x5c5f61['options']);return _0x254f28[_0xff03('0x54')](_0x482563);}})['then'](function(_0x17f717){if(_0x17f717){_0x1c4fe2=_0x17f717[_0xff03('0x3b')];if(!_0x5c5f61[_0xff03('0x34')][_0xff03('0x3c')](_0xff03('0x3d'))){_0x482563[_0xff03('0x28')]=qs[_0xff03('0x28')](_0x5c5f61[_0xff03('0x34')][_0xff03('0x28')]);_0x482563[_0xff03('0x27')]=qs[_0xff03('0x27')](_0x5c5f61[_0xff03('0x34')]['offset']);}return _0x254f28[_0xff03('0x54')](_0x482563);}})[_0xff03('0x2d')](function(_0x58416d){if(_0x58416d){return _0x58416d?{'count':_0x1c4fe2,'rows':_0x58416d}:null;}})[_0xff03('0x2d')](respondWithResult(_0x292bbf,null))[_0xff03('0x4d')](handleError(_0x292bbf,null));};exports['getDescriptions']=function(_0x39e874,_0x365178,_0x3aa189){var _0x4ce38a={};var _0x1eb70a={};var _0x452e2a;var _0x270f03;return db[_0xff03('0x31')]['findOne']({'where':{'id':_0x39e874['params']['id']}})[_0xff03('0x2d')](handleEntityNotFound(_0x365178,null))['then'](function(_0x1fed7c){if(_0x1fed7c){_0x452e2a=_0x1fed7c;_0x1eb70a[_0xff03('0x33')]=_[_0xff03('0x37')](db[_0xff03('0x53')][_0xff03('0x32')]);_0x1eb70a[_0xff03('0x34')]=_[_0xff03('0x37')](_0x39e874[_0xff03('0x34')]);_0x1eb70a['filters']=_[_0xff03('0x38')](_0x1eb70a[_0xff03('0x33')],_0x1eb70a[_0xff03('0x34')]);_0x4ce38a[_0xff03('0x3a')]=_[_0xff03('0x38')](_0x1eb70a['model'],qs[_0xff03('0x39')](_0x39e874[_0xff03('0x34')]['fields']));_0x4ce38a['attributes']=_0x4ce38a[_0xff03('0x3a')][_0xff03('0x3b')]?_0x4ce38a[_0xff03('0x3a')]:_0x1eb70a[_0xff03('0x33')];_0x4ce38a[_0xff03('0x3e')]=qs[_0xff03('0x3f')](_0x39e874[_0xff03('0x34')]['sort']);_0x4ce38a['where']=qs[_0xff03('0x40')](_[_0xff03('0x41')](_0x39e874[_0xff03('0x34')],_0x1eb70a[_0xff03('0x40')]));if(_0x39e874['query'][_0xff03('0x46')]){_0x4ce38a[_0xff03('0x45')]=_['merge'](_0x4ce38a['where'],{'$or':_[_0xff03('0x52')](_0x4ce38a['attributes'],function(_0x5ebd59){var _0x5895e0={};_0x5895e0[_0x5ebd59]={'$like':'%'+_0x39e874['query']['filter']+'%'};return _0x5895e0;})});}_0x4ce38a=_[_0xff03('0x44')]({},_0x4ce38a,_0x39e874[_0xff03('0x47')]);return _0x452e2a['getDescriptions'](_0x4ce38a);}})[_0xff03('0x2d')](function(_0x4ba943){if(_0x4ba943){_0x270f03=_0x4ba943[_0xff03('0x3b')];if(!_0x39e874[_0xff03('0x34')][_0xff03('0x3c')](_0xff03('0x3d'))){_0x4ce38a[_0xff03('0x28')]=qs[_0xff03('0x28')](_0x39e874['query']['limit']);_0x4ce38a[_0xff03('0x27')]=qs['offset'](_0x39e874['query'][_0xff03('0x27')]);}return _0x452e2a['getDescriptions'](_0x4ce38a);}})['then'](function(_0x48dd2e){if(_0x48dd2e){return _0x48dd2e?{'count':_0x270f03,'rows':_0x48dd2e}:null;}})[_0xff03('0x2d')](respondWithResult(_0x365178,null))[_0xff03('0x4d')](handleError(_0x365178,null));};exports[_0xff03('0x55')]=function(_0x241a53,_0x56389c,_0x42c6c3){var _0x440642={};var _0x44075f={};var _0xc06d08;var _0x72a94f;return db[_0xff03('0x31')]['findOne']({'where':{'id':_0x241a53['params']['id']}})[_0xff03('0x2d')](handleEntityNotFound(_0x56389c,null))[_0xff03('0x2d')](function(_0x3bde6f){if(_0x3bde6f){_0xc06d08=_0x3bde6f;_0x44075f[_0xff03('0x33')]=_[_0xff03('0x37')](db[_0xff03('0x56')][_0xff03('0x32')]);_0x44075f[_0xff03('0x34')]=_[_0xff03('0x37')](_0x241a53['query']);_0x44075f[_0xff03('0x40')]=_[_0xff03('0x38')](_0x44075f['model'],_0x44075f['query']);_0x440642['attributes']=_[_0xff03('0x38')](_0x44075f[_0xff03('0x33')],qs['fields'](_0x241a53[_0xff03('0x34')][_0xff03('0x39')]));_0x440642[_0xff03('0x3a')]=_0x440642[_0xff03('0x3a')]['length']?_0x440642['attributes']:_0x44075f[_0xff03('0x33')];_0x440642[_0xff03('0x3e')]=qs[_0xff03('0x3f')](_0x241a53['query'][_0xff03('0x3f')]);_0x440642[_0xff03('0x45')]=qs[_0xff03('0x40')](_[_0xff03('0x41')](_0x241a53[_0xff03('0x34')],_0x44075f[_0xff03('0x40')]));if(_0x241a53[_0xff03('0x34')][_0xff03('0x46')]){_0x440642['where']=_[_0xff03('0x44')](_0x440642[_0xff03('0x45')],{'$or':_[_0xff03('0x52')](_0x440642[_0xff03('0x3a')],function(_0xdbce95){var _0x483a83={};_0x483a83[_0xdbce95]={'$like':'%'+_0x241a53['query'][_0xff03('0x46')]+'%'};return _0x483a83;})});}_0x440642=_[_0xff03('0x44')]({},_0x440642,_0x241a53['options']);return _0xc06d08[_0xff03('0x55')](_0x440642);}})[_0xff03('0x2d')](function(_0x4f2c44){if(_0x4f2c44){_0x72a94f=_0x4f2c44[_0xff03('0x3b')];if(!_0x241a53['query']['hasOwnProperty'](_0xff03('0x3d'))){_0x440642['limit']=qs[_0xff03('0x28')](_0x241a53['query'][_0xff03('0x28')]);_0x440642[_0xff03('0x27')]=qs[_0xff03('0x27')](_0x241a53['query']['offset']);}return _0xc06d08['getTags'](_0x440642);}})[_0xff03('0x2d')](function(_0x447c34){if(_0x447c34){return _0x447c34?{'count':_0x72a94f,'rows':_0x447c34}:null;}})[_0xff03('0x2d')](respondWithResult(_0x56389c,null))[_0xff03('0x4d')](handleError(_0x56389c,null));};exports['setTags']=function(_0x15a799,_0x4b17d4,_0x5b23c3){if(_0x15a799[_0xff03('0x4f')]['id']){delete _0x15a799[_0xff03('0x4f')]['id'];}return db[_0xff03('0x31')][_0xff03('0x51')]({'where':{'id':_0x15a799[_0xff03('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4b17d4,null))[_0xff03('0x2d')](function(_0x395edd){if(_0x395edd){return _0x395edd['setTags'](_0x15a799[_0xff03('0x4f')]['ids']||[]);}return null;})[_0xff03('0x2d')](respondWithResult(_0x4b17d4,null))[_0xff03('0x4d')](handleError(_0x4b17d4,null));};
\ No newline at end of file
+var _0x1a82=['name','send','index','FreshdeskConfiguration','model','query','dateStart','dateEnd','keys','attributes','fields','length','nolimit','offset','order','sort','where','filters','pick','add','day','merge','filter','map','options','include','rows','catch','params','intersection','find','create','body','getFields','findOne','FreshdeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','api','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','sendStatus','status','end','json','count','limit','set','Content-Range','reject','update','destroy','stack'];(function(_0x4c4cff,_0x524319){var _0x5a150c=function(_0x5bcf77){while(--_0x5bcf77){_0x4c4cff['push'](_0x4c4cff['shift']());}};_0x5a150c(++_0x524319);}(_0x1a82,0xd6));var _0x21a8=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0x1a82[_0x2dd390];return _0x3afe47;};'use strict';var pdf=require(_0x21a8('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x21a8('0x1'));var jsonpatch=require(_0x21a8('0x2'));var rp=require(_0x21a8('0x3'));var moment=require('moment');var BPromise=require(_0x21a8('0x4'));var Mustache=require(_0x21a8('0x5'));var util=require('util');var path=require(_0x21a8('0x6'));var sox=require(_0x21a8('0x7'));var csv=require('to-csv');var ejs=require(_0x21a8('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x21a8('0x9'));var jsforce=require(_0x21a8('0xa'));var deskjs=require(_0x21a8('0xb'));var toCsv=require(_0x21a8('0xc'));var querystring=require(_0x21a8('0xd'));var Papa=require(_0x21a8('0xe'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x21a8('0xf'));var utils=require(_0x21a8('0x10'));var config=require(_0x21a8('0x11'));var db=require('../../mysqldb')['db'];var jayson=require(_0x21a8('0x12'));var client=jayson[_0x21a8('0x13')][_0x21a8('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x1e976f,_0xa29da7,_0x1e3e20,_0x3b96e1){return new BPromise(function(_0x5afd09,_0x52238d){var _0x3b8717=_0x3b96e1||client;return _0x3b8717['request'](_0x1e976f,_0x1e3e20)[_0x21a8('0x15')](function(_0x4f2d7d){logger[_0x21a8('0x16')](_0x21a8('0x17'),_0xa29da7,'request\x20sent');logger[_0x21a8('0x18')](_0x21a8('0x19'),_0xa29da7,'request\x20sent',JSON[_0x21a8('0x1a')](_0x4f2d7d));if(_0x4f2d7d['error']){if(_0x4f2d7d[_0x21a8('0x1b')][_0x21a8('0x1c')]===0x1f4){logger[_0x21a8('0x1b')](_0x21a8('0x17'),_0xa29da7,_0x4f2d7d['error'][_0x21a8('0x1d')]);return _0x52238d(_0x4f2d7d['error'][_0x21a8('0x1d')]);}logger[_0x21a8('0x1b')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xa29da7,_0x4f2d7d[_0x21a8('0x1b')][_0x21a8('0x1d')]);return _0x5afd09(_0x4f2d7d[_0x21a8('0x1b')][_0x21a8('0x1d')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0xa29da7,_0x21a8('0x1e'));_0x5afd09(_0x4f2d7d[_0x21a8('0x1f')][_0x21a8('0x1d')]);}})['catch'](function(_0xafd740){logger[_0x21a8('0x1b')](_0x21a8('0x17'),_0xa29da7,_0xafd740);_0x52238d(_0xafd740);});});}function respondWithStatusCode(_0x4f2dc2,_0x321230){_0x321230=_0x321230||0xcc;return function(_0x148ae3){if(_0x148ae3){return _0x4f2dc2[_0x21a8('0x20')](_0x321230);}return _0x4f2dc2[_0x21a8('0x21')](_0x321230)[_0x21a8('0x22')]();};}function respondWithResult(_0x205206,_0x2adf50){_0x2adf50=_0x2adf50||0xc8;return function(_0x13a363){if(_0x13a363){return _0x205206[_0x21a8('0x21')](_0x2adf50)[_0x21a8('0x23')](_0x13a363);}};}function respondWithFilteredResult(_0x4b32d9,_0x3fbaf2){return function(_0x5dea9a){if(_0x5dea9a){var _0x4061e2=_0x5dea9a[_0x21a8('0x24')],_0x579fb3=_0x3fbaf2['offset'],_0x3186d7=_0x3fbaf2['offset']+_0x3fbaf2[_0x21a8('0x25')],_0x5d99fa;if(_0x3186d7>=_0x4061e2){_0x3186d7=_0x4061e2;_0x5d99fa=0xc8;}else{_0x5d99fa=0xce;}_0x4b32d9['status'](_0x5d99fa);return _0x4b32d9[_0x21a8('0x26')](_0x21a8('0x27'),_0x579fb3+'-'+_0x3186d7+'/'+_0x4061e2)[_0x21a8('0x23')](_0x5dea9a);}return null;};}function patchUpdates(_0x1fb22f){return function(_0x2e4c47){try{jsonpatch['apply'](_0x2e4c47,_0x1fb22f,!![]);}catch(_0x50ebbe){return BPromise[_0x21a8('0x28')](_0x50ebbe);}return _0x2e4c47['save']();};}function saveUpdates(_0x41bf5b,_0x5df254){return function(_0x2a80b2){if(_0x2a80b2){return _0x2a80b2[_0x21a8('0x29')](_0x41bf5b)['then'](function(_0x26274d){return _0x26274d;});}return null;};}function removeEntity(_0x288668,_0x3daeaf){return function(_0x475b3d){if(_0x475b3d){return _0x475b3d[_0x21a8('0x2a')]()[_0x21a8('0x15')](function(){_0x288668[_0x21a8('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8f075e,_0x1df917){return function(_0x4da0bf){if(!_0x4da0bf){_0x8f075e[_0x21a8('0x20')](0x194);}return _0x4da0bf;};}function handleError(_0x2a9661,_0x229eaf){_0x229eaf=_0x229eaf||0x1f4;return function(_0x3de87b){logger['error'](_0x3de87b[_0x21a8('0x2b')]);if(_0x3de87b[_0x21a8('0x2c')]){delete _0x3de87b['name'];}_0x2a9661[_0x21a8('0x21')](_0x229eaf)[_0x21a8('0x2d')](_0x3de87b);};}exports[_0x21a8('0x2e')]=function(_0x490266,_0x2b93c9){var _0xaab743={},_0xabd6f={},_0x3e56d8={'count':0x0,'rows':[]};var _0x5138d1=db[_0x21a8('0x2f')]['rawAttributes'];_0xabd6f[_0x21a8('0x30')]=_['keys'](_0x5138d1);var _0x3cf760={'dateStart':_0x490266[_0x21a8('0x31')][_0x21a8('0x32')],'dateEnd':_0x490266[_0x21a8('0x31')][_0x21a8('0x33')]};delete _0x490266[_0x21a8('0x31')][_0x21a8('0x32')];delete _0x490266[_0x21a8('0x31')][_0x21a8('0x33')];_0xabd6f[_0x21a8('0x31')]=_[_0x21a8('0x34')](_0x490266[_0x21a8('0x31')]);_0xabd6f['filters']=_['intersection'](_0xabd6f['model'],_0xabd6f[_0x21a8('0x31')]);_0xaab743[_0x21a8('0x35')]=_['intersection'](_0xabd6f['model'],qs[_0x21a8('0x36')](_0x490266[_0x21a8('0x31')][_0x21a8('0x36')]));_0xaab743['attributes']=_0xaab743[_0x21a8('0x35')][_0x21a8('0x37')]?_0xaab743['attributes']:_0xabd6f['model'];if(!_0x490266[_0x21a8('0x31')]['hasOwnProperty'](_0x21a8('0x38'))){_0xaab743[_0x21a8('0x25')]=qs[_0x21a8('0x25')](_0x490266[_0x21a8('0x31')][_0x21a8('0x25')]);_0xaab743['offset']=qs[_0x21a8('0x39')](_0x490266[_0x21a8('0x31')][_0x21a8('0x39')]);}_0xaab743[_0x21a8('0x3a')]=qs[_0x21a8('0x3b')](_0x490266['query']['sort']);_0xaab743[_0x21a8('0x3c')]=qs[_0x21a8('0x3d')](_[_0x21a8('0x3e')](_0x490266[_0x21a8('0x31')],_0xabd6f[_0x21a8('0x3d')]));if(_0x3cf760['dateStart']){if(_0x3cf760[_0x21a8('0x33')]){_0x3cf760[_0x21a8('0x33')]=moment(_0x3cf760[_0x21a8('0x33')])[_0x21a8('0x3f')](0x1,_0x21a8('0x40'));}else{_0x3cf760['dateEnd']=moment(_0x3cf760[_0x21a8('0x32')])[_0x21a8('0x3f')](0x1,'day');}_[_0x21a8('0x41')](_0xaab743[_0x21a8('0x3c')],{'createdAt':{'$gte':_0x3cf760[_0x21a8('0x32')],'$lte':_0x3cf760[_0x21a8('0x33')]}});}if(_0x490266[_0x21a8('0x31')][_0x21a8('0x42')]){_0xaab743[_0x21a8('0x3c')]=_[_0x21a8('0x41')](_0xaab743[_0x21a8('0x3c')],{'$or':_[_0x21a8('0x43')](_0xaab743[_0x21a8('0x35')],function(_0x13c088){var _0x1c062c={};_0x1c062c[_0x13c088]={'$like':'%'+_0x490266['query'][_0x21a8('0x42')]+'%'};return _0x1c062c;})});}_0xaab743=_[_0x21a8('0x41')]({},_0xaab743,_0x490266[_0x21a8('0x44')]);var _0x86d831={'where':_0xaab743[_0x21a8('0x3c')]};return db['FreshdeskConfiguration'][_0x21a8('0x24')](_0x86d831)[_0x21a8('0x15')](function(_0x513cee){_0x3e56d8[_0x21a8('0x24')]=_0x513cee;if(_0x490266[_0x21a8('0x31')]['includeAll']){_0xaab743[_0x21a8('0x45')]=[{'all':!![]}];}return db[_0x21a8('0x2f')]['findAll'](_0xaab743);})[_0x21a8('0x15')](function(_0x54dc84){_0x3e56d8[_0x21a8('0x46')]=_0x54dc84;return _0x3e56d8;})[_0x21a8('0x15')](respondWithFilteredResult(_0x2b93c9,_0xaab743))[_0x21a8('0x47')](handleError(_0x2b93c9,null));};exports['show']=function(_0x492a01,_0x5f4773){var _0x4c9add={'raw':![],'where':{'id':_0x492a01[_0x21a8('0x48')]['id']}},_0xf41ef5={};_0xf41ef5[_0x21a8('0x30')]=_[_0x21a8('0x34')](db[_0x21a8('0x2f')]['rawAttributes']);_0xf41ef5[_0x21a8('0x31')]=_[_0x21a8('0x34')](_0x492a01[_0x21a8('0x31')]);_0xf41ef5[_0x21a8('0x3d')]=_[_0x21a8('0x49')](_0xf41ef5['model'],_0xf41ef5[_0x21a8('0x31')]);_0x4c9add[_0x21a8('0x35')]=_[_0x21a8('0x49')](_0xf41ef5[_0x21a8('0x30')],qs[_0x21a8('0x36')](_0x492a01[_0x21a8('0x31')][_0x21a8('0x36')]));_0x4c9add[_0x21a8('0x35')]=_0x4c9add['attributes'][_0x21a8('0x37')]?_0x4c9add[_0x21a8('0x35')]:_0xf41ef5[_0x21a8('0x30')];if(_0x492a01[_0x21a8('0x31')]['includeAll']){_0x4c9add[_0x21a8('0x45')]=[{'all':!![]}];}_0x4c9add=_['merge']({},_0x4c9add,_0x492a01[_0x21a8('0x44')]);return db[_0x21a8('0x2f')][_0x21a8('0x4a')](_0x4c9add)[_0x21a8('0x15')](handleEntityNotFound(_0x5f4773,null))[_0x21a8('0x15')](respondWithResult(_0x5f4773,null))[_0x21a8('0x47')](handleError(_0x5f4773,null));};exports[_0x21a8('0x4b')]=function(_0x4227bb,_0x1ddae5){return db[_0x21a8('0x2f')][_0x21a8('0x4b')](_0x4227bb['body'],{})['then'](respondWithResult(_0x1ddae5,0xc9))[_0x21a8('0x47')](handleError(_0x1ddae5,null));};exports[_0x21a8('0x29')]=function(_0x4f290c,_0x538b9e){if(_0x4f290c[_0x21a8('0x4c')]['id']){delete _0x4f290c['body']['id'];}return db[_0x21a8('0x2f')][_0x21a8('0x4a')]({'where':{'id':_0x4f290c['params']['id']}})[_0x21a8('0x15')](handleEntityNotFound(_0x538b9e,null))[_0x21a8('0x15')](saveUpdates(_0x4f290c[_0x21a8('0x4c')],null))[_0x21a8('0x15')](respondWithResult(_0x538b9e,null))[_0x21a8('0x47')](handleError(_0x538b9e,null));};exports[_0x21a8('0x2a')]=function(_0x3de6b7,_0x5990f8){return db[_0x21a8('0x2f')][_0x21a8('0x4a')]({'where':{'id':_0x3de6b7[_0x21a8('0x48')]['id']}})['then'](handleEntityNotFound(_0x5990f8,null))[_0x21a8('0x15')](removeEntity(_0x5990f8,null))['catch'](handleError(_0x5990f8,null));};exports[_0x21a8('0x4d')]=function(_0x289dbf,_0x5818d6,_0x106b81){var _0x2177e6={};var _0x3e8af1={};var _0x387e47;var _0x7fdb5b;return db[_0x21a8('0x2f')][_0x21a8('0x4e')]({'where':{'id':_0x289dbf['params']['id']}})[_0x21a8('0x15')](handleEntityNotFound(_0x5818d6,null))['then'](function(_0x2756ca){if(_0x2756ca){_0x387e47=_0x2756ca;_0x3e8af1[_0x21a8('0x30')]=_[_0x21a8('0x34')](db[_0x21a8('0x4f')]['rawAttributes']);_0x3e8af1['query']=_[_0x21a8('0x34')](_0x289dbf[_0x21a8('0x31')]);_0x3e8af1['filters']=_['intersection'](_0x3e8af1[_0x21a8('0x30')],_0x3e8af1[_0x21a8('0x31')]);_0x2177e6[_0x21a8('0x35')]=_[_0x21a8('0x49')](_0x3e8af1[_0x21a8('0x30')],qs[_0x21a8('0x36')](_0x289dbf[_0x21a8('0x31')]['fields']));_0x2177e6[_0x21a8('0x35')]=_0x2177e6[_0x21a8('0x35')]['length']?_0x2177e6[_0x21a8('0x35')]:_0x3e8af1[_0x21a8('0x30')];_0x2177e6[_0x21a8('0x3a')]=qs[_0x21a8('0x3b')](_0x289dbf[_0x21a8('0x31')][_0x21a8('0x3b')]);_0x2177e6['where']=qs[_0x21a8('0x3d')](_[_0x21a8('0x3e')](_0x289dbf[_0x21a8('0x31')],_0x3e8af1[_0x21a8('0x3d')]));if(_0x289dbf[_0x21a8('0x31')][_0x21a8('0x42')]){_0x2177e6[_0x21a8('0x3c')]=_[_0x21a8('0x41')](_0x2177e6[_0x21a8('0x3c')],{'$or':_[_0x21a8('0x43')](_0x2177e6[_0x21a8('0x35')],function(_0x3ed039){var _0x3aade0={};_0x3aade0[_0x3ed039]={'$like':'%'+_0x289dbf[_0x21a8('0x31')][_0x21a8('0x42')]+'%'};return _0x3aade0;})});}_0x2177e6=_['merge']({},_0x2177e6,_0x289dbf[_0x21a8('0x44')]);return _0x387e47[_0x21a8('0x4d')](_0x2177e6);}})[_0x21a8('0x15')](function(_0x2ebf80){if(_0x2ebf80){_0x7fdb5b=_0x2ebf80['length'];if(!_0x289dbf[_0x21a8('0x31')][_0x21a8('0x50')](_0x21a8('0x38'))){_0x2177e6[_0x21a8('0x25')]=qs[_0x21a8('0x25')](_0x289dbf[_0x21a8('0x31')][_0x21a8('0x25')]);_0x2177e6['offset']=qs['offset'](_0x289dbf['query'][_0x21a8('0x39')]);}return _0x387e47['getFields'](_0x2177e6);}})['then'](function(_0x5395de){if(_0x5395de){return _0x5395de?{'count':_0x7fdb5b,'rows':_0x5395de}:null;}})[_0x21a8('0x15')](respondWithResult(_0x5818d6,null))['catch'](handleError(_0x5818d6,null));};exports['getSubjects']=function(_0xed6c68,_0x4847cb,_0x3a213b){var _0x3ce6c2={};var _0x57e6f0={};var _0x51489d;var _0x364c1;return db[_0x21a8('0x2f')][_0x21a8('0x4e')]({'where':{'id':_0xed6c68[_0x21a8('0x48')]['id']}})[_0x21a8('0x15')](handleEntityNotFound(_0x4847cb,null))[_0x21a8('0x15')](function(_0x66d435){if(_0x66d435){_0x51489d=_0x66d435;_0x57e6f0[_0x21a8('0x30')]=_[_0x21a8('0x34')](db[_0x21a8('0x4f')]['rawAttributes']);_0x57e6f0[_0x21a8('0x31')]=_[_0x21a8('0x34')](_0xed6c68[_0x21a8('0x31')]);_0x57e6f0['filters']=_[_0x21a8('0x49')](_0x57e6f0[_0x21a8('0x30')],_0x57e6f0[_0x21a8('0x31')]);_0x3ce6c2[_0x21a8('0x35')]=_['intersection'](_0x57e6f0[_0x21a8('0x30')],qs[_0x21a8('0x36')](_0xed6c68['query'][_0x21a8('0x36')]));_0x3ce6c2[_0x21a8('0x35')]=_0x3ce6c2[_0x21a8('0x35')][_0x21a8('0x37')]?_0x3ce6c2['attributes']:_0x57e6f0[_0x21a8('0x30')];_0x3ce6c2['order']=qs['sort'](_0xed6c68['query'][_0x21a8('0x3b')]);_0x3ce6c2[_0x21a8('0x3c')]=qs['filters'](_[_0x21a8('0x3e')](_0xed6c68[_0x21a8('0x31')],_0x57e6f0[_0x21a8('0x3d')]));if(_0xed6c68[_0x21a8('0x31')][_0x21a8('0x42')]){_0x3ce6c2[_0x21a8('0x3c')]=_[_0x21a8('0x41')](_0x3ce6c2[_0x21a8('0x3c')],{'$or':_[_0x21a8('0x43')](_0x3ce6c2[_0x21a8('0x35')],function(_0x4b9bbc){var _0x4ff6cf={};_0x4ff6cf[_0x4b9bbc]={'$like':'%'+_0xed6c68[_0x21a8('0x31')][_0x21a8('0x42')]+'%'};return _0x4ff6cf;})});}_0x3ce6c2=_[_0x21a8('0x41')]({},_0x3ce6c2,_0xed6c68[_0x21a8('0x44')]);return _0x51489d[_0x21a8('0x51')](_0x3ce6c2);}})['then'](function(_0x113286){if(_0x113286){_0x364c1=_0x113286[_0x21a8('0x37')];if(!_0xed6c68[_0x21a8('0x31')][_0x21a8('0x50')](_0x21a8('0x38'))){_0x3ce6c2[_0x21a8('0x25')]=qs[_0x21a8('0x25')](_0xed6c68[_0x21a8('0x31')][_0x21a8('0x25')]);_0x3ce6c2['offset']=qs['offset'](_0xed6c68[_0x21a8('0x31')][_0x21a8('0x39')]);}return _0x51489d[_0x21a8('0x51')](_0x3ce6c2);}})[_0x21a8('0x15')](function(_0x773a97){if(_0x773a97){return _0x773a97?{'count':_0x364c1,'rows':_0x773a97}:null;}})[_0x21a8('0x15')](respondWithResult(_0x4847cb,null))[_0x21a8('0x47')](handleError(_0x4847cb,null));};exports[_0x21a8('0x52')]=function(_0x55a93c,_0x246a4d,_0x349223){var _0x25ad88={};var _0x5713c1={};var _0x278584;var _0xdd5b4;return db[_0x21a8('0x2f')][_0x21a8('0x4e')]({'where':{'id':_0x55a93c[_0x21a8('0x48')]['id']}})[_0x21a8('0x15')](handleEntityNotFound(_0x246a4d,null))[_0x21a8('0x15')](function(_0x59c505){if(_0x59c505){_0x278584=_0x59c505;_0x5713c1[_0x21a8('0x30')]=_[_0x21a8('0x34')](db[_0x21a8('0x4f')]['rawAttributes']);_0x5713c1[_0x21a8('0x31')]=_['keys'](_0x55a93c[_0x21a8('0x31')]);_0x5713c1[_0x21a8('0x3d')]=_[_0x21a8('0x49')](_0x5713c1['model'],_0x5713c1[_0x21a8('0x31')]);_0x25ad88[_0x21a8('0x35')]=_[_0x21a8('0x49')](_0x5713c1['model'],qs[_0x21a8('0x36')](_0x55a93c[_0x21a8('0x31')][_0x21a8('0x36')]));_0x25ad88[_0x21a8('0x35')]=_0x25ad88[_0x21a8('0x35')][_0x21a8('0x37')]?_0x25ad88['attributes']:_0x5713c1['model'];_0x25ad88[_0x21a8('0x3a')]=qs[_0x21a8('0x3b')](_0x55a93c[_0x21a8('0x31')][_0x21a8('0x3b')]);_0x25ad88['where']=qs[_0x21a8('0x3d')](_[_0x21a8('0x3e')](_0x55a93c['query'],_0x5713c1['filters']));if(_0x55a93c[_0x21a8('0x31')][_0x21a8('0x42')]){_0x25ad88[_0x21a8('0x3c')]=_[_0x21a8('0x41')](_0x25ad88[_0x21a8('0x3c')],{'$or':_[_0x21a8('0x43')](_0x25ad88[_0x21a8('0x35')],function(_0x34793d){var _0x76e7b2={};_0x76e7b2[_0x34793d]={'$like':'%'+_0x55a93c[_0x21a8('0x31')][_0x21a8('0x42')]+'%'};return _0x76e7b2;})});}_0x25ad88=_[_0x21a8('0x41')]({},_0x25ad88,_0x55a93c[_0x21a8('0x44')]);return _0x278584[_0x21a8('0x52')](_0x25ad88);}})['then'](function(_0x22cf04){if(_0x22cf04){_0xdd5b4=_0x22cf04[_0x21a8('0x37')];if(!_0x55a93c['query']['hasOwnProperty'](_0x21a8('0x38'))){_0x25ad88[_0x21a8('0x25')]=qs[_0x21a8('0x25')](_0x55a93c['query']['limit']);_0x25ad88[_0x21a8('0x39')]=qs[_0x21a8('0x39')](_0x55a93c[_0x21a8('0x31')][_0x21a8('0x39')]);}return _0x278584[_0x21a8('0x52')](_0x25ad88);}})['then'](function(_0x15a697){if(_0x15a697){return _0x15a697?{'count':_0xdd5b4,'rows':_0x15a697}:null;}})['then'](respondWithResult(_0x246a4d,null))['catch'](handleError(_0x246a4d,null));};exports[_0x21a8('0x53')]=function(_0x3f6b84,_0x29af84,_0x6eef34){var _0x602311={};var _0x313f29={};var _0x38a559;var _0x5cc197;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x3f6b84[_0x21a8('0x48')]['id']}})[_0x21a8('0x15')](handleEntityNotFound(_0x29af84,null))[_0x21a8('0x15')](function(_0x827cc8){if(_0x827cc8){_0x38a559=_0x827cc8;_0x313f29[_0x21a8('0x30')]=_[_0x21a8('0x34')](db[_0x21a8('0x54')]['rawAttributes']);_0x313f29['query']=_[_0x21a8('0x34')](_0x3f6b84[_0x21a8('0x31')]);_0x313f29[_0x21a8('0x3d')]=_[_0x21a8('0x49')](_0x313f29[_0x21a8('0x30')],_0x313f29[_0x21a8('0x31')]);_0x602311[_0x21a8('0x35')]=_[_0x21a8('0x49')](_0x313f29[_0x21a8('0x30')],qs['fields'](_0x3f6b84[_0x21a8('0x31')][_0x21a8('0x36')]));_0x602311['attributes']=_0x602311[_0x21a8('0x35')][_0x21a8('0x37')]?_0x602311['attributes']:_0x313f29[_0x21a8('0x30')];_0x602311['order']=qs['sort'](_0x3f6b84['query']['sort']);_0x602311[_0x21a8('0x3c')]=qs[_0x21a8('0x3d')](_[_0x21a8('0x3e')](_0x3f6b84[_0x21a8('0x31')],_0x313f29[_0x21a8('0x3d')]));if(_0x3f6b84[_0x21a8('0x31')][_0x21a8('0x42')]){_0x602311[_0x21a8('0x3c')]=_[_0x21a8('0x41')](_0x602311[_0x21a8('0x3c')],{'$or':_[_0x21a8('0x43')](_0x602311['attributes'],function(_0x2674c7){var _0x47a8cf={};_0x47a8cf[_0x2674c7]={'$like':'%'+_0x3f6b84[_0x21a8('0x31')][_0x21a8('0x42')]+'%'};return _0x47a8cf;})});}_0x602311=_['merge']({},_0x602311,_0x3f6b84['options']);return _0x38a559[_0x21a8('0x53')](_0x602311);}})[_0x21a8('0x15')](function(_0x3b6fd8){if(_0x3b6fd8){_0x5cc197=_0x3b6fd8[_0x21a8('0x37')];if(!_0x3f6b84['query'][_0x21a8('0x50')](_0x21a8('0x38'))){_0x602311[_0x21a8('0x25')]=qs['limit'](_0x3f6b84[_0x21a8('0x31')][_0x21a8('0x25')]);_0x602311[_0x21a8('0x39')]=qs['offset'](_0x3f6b84[_0x21a8('0x31')][_0x21a8('0x39')]);}return _0x38a559[_0x21a8('0x53')](_0x602311);}})[_0x21a8('0x15')](function(_0x38c249){if(_0x38c249){return _0x38c249?{'count':_0x5cc197,'rows':_0x38c249}:null;}})[_0x21a8('0x15')](respondWithResult(_0x29af84,null))[_0x21a8('0x47')](handleError(_0x29af84,null));};exports[_0x21a8('0x55')]=function(_0x1c665e,_0x20bbb5,_0x147e00){if(_0x1c665e[_0x21a8('0x4c')]['id']){delete _0x1c665e[_0x21a8('0x4c')]['id'];}return db['FreshdeskConfiguration'][_0x21a8('0x4e')]({'where':{'id':_0x1c665e['params']['id']}})[_0x21a8('0x15')](handleEntityNotFound(_0x20bbb5,null))['then'](function(_0x43ecb3){if(_0x43ecb3){return _0x43ecb3['setTags'](_0x1c665e[_0x21a8('0x4c')]['ids']||[]);}return null;})[_0x21a8('0x15')](respondWithResult(_0x20bbb5,null))['catch'](handleError(_0x20bbb5,null));};
\ No newline at end of file
index 52b0bef..89976dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7579=['FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','./intFreshdeskConfiguration.attributes','exports'];(function(_0xe92bc6,_0x35937e){var _0x4d5b66=function(_0x22c6b4){while(--_0x22c6b4){_0xe92bc6['push'](_0xe92bc6['shift']());}};_0x4d5b66(++_0x35937e);}(_0x7579,0x1e2));var _0x9757=function(_0x5c047f,_0xbfdb5d){_0x5c047f=_0x5c047f-0x0;var _0x265c61=_0x7579[_0x5c047f];return _0x265c61;};'use strict';var _=require(_0x9757('0x0'));var util=require(_0x9757('0x1'));var logger=require(_0x9757('0x2'))(_0x9757('0x3'));var moment=require(_0x9757('0x4'));var BPromise=require(_0x9757('0x5'));var rp=require('request-promise');var attributes=require(_0x9757('0x6'));module[_0x9757('0x7')]=function(_0xcffaa0,_0x213a7a){return _0xcffaa0['define'](_0x9757('0x8'),attributes,{'tableName':_0x9757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xafdd=['define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intFreshdeskConfiguration.attributes'];(function(_0xb120ae,_0x537839){var _0x5a64e9=function(_0x4f77eb){while(--_0x4f77eb){_0xb120ae['push'](_0xb120ae['shift']());}};_0x5a64e9(++_0x537839);}(_0xafdd,0x19a));var _0xdafd=function(_0x386430,_0x382858){_0x386430=_0x386430-0x0;var _0xb546d5=_0xafdd[_0x386430];return _0xb546d5;};'use strict';var _=require(_0xdafd('0x0'));var util=require(_0xdafd('0x1'));var logger=require(_0xdafd('0x2'))(_0xdafd('0x3'));var moment=require(_0xdafd('0x4'));var BPromise=require(_0xdafd('0x5'));var rp=require(_0xdafd('0x6'));var attributes=require(_0xdafd('0x7'));module['exports']=function(_0x283ab1,_0x799727){return _0x283ab1[_0xdafd('0x8')](_0xdafd('0x9'),attributes,{'tableName':_0xdafd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e17a840..b86bc9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe47c=['error','code','message','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1ba43c,_0x5bd2e8){var _0x2f60eb=function(_0x349dff){while(--_0x349dff){_0x1ba43c['push'](_0x1ba43c['shift']());}};_0x2f60eb(++_0x5bd2e8);}(_0xe47c,0x97));var _0xce47=function(_0x36e7c0,_0x270d77){_0x36e7c0=_0x36e7c0-0x0;var _0xbab3f1=_0xe47c[_0x36e7c0];return _0xbab3f1;};'use strict';var _=require(_0xce47('0x0'));var util=require(_0xce47('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xce47('0x2'));var fs=require('fs');var db=require(_0xce47('0x3'))['db'];var utils=require(_0xce47('0x4'));var logger=require(_0xce47('0x5'))(_0xce47('0x6'));var config=require(_0xce47('0x7'));var jayson=require(_0xce47('0x8'));var client=jayson['client'][_0xce47('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ad824,_0x45c837,_0x341ba9){return new BPromise(function(_0x1e3241,_0x3651fd){return client[_0xce47('0xa')](_0x4ad824,_0x341ba9)[_0xce47('0xb')](function(_0x71ec16){logger[_0xce47('0xc')](_0xce47('0xd'),_0x45c837,'request\x20sent');logger['debug'](_0xce47('0xe'),_0x45c837,_0xce47('0xf'),JSON[_0xce47('0x10')](_0x71ec16));if(_0x71ec16[_0xce47('0x11')]){if(_0x71ec16['error'][_0xce47('0x12')]===0x1f4){logger[_0xce47('0x11')](_0xce47('0xd'),_0x45c837,_0x71ec16['error']['message']);return _0x3651fd(_0x71ec16['error'][_0xce47('0x13')]);}logger[_0xce47('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x45c837,_0x71ec16['error'][_0xce47('0x13')]);return _0x1e3241(_0x71ec16[_0xce47('0x11')]['message']);}else{logger[_0xce47('0xc')](_0xce47('0xd'),_0x45c837,'request\x20sent');_0x1e3241(_0x71ec16['result'][_0xce47('0x13')]);}})[_0xce47('0x14')](function(_0xeb4db0){logger[_0xce47('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x45c837,_0xeb4db0);_0x3651fd(_0xeb4db0);});});}
\ No newline at end of file
+var _0x4560=['lodash','util','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x3fd3a3,_0x36c863){var _0xa3e4d5=function(_0x1fd03b){while(--_0x1fd03b){_0x3fd3a3['push'](_0x3fd3a3['shift']());}};_0xa3e4d5(++_0x36c863);}(_0x4560,0x1d4));var _0x0456=function(_0x44c2b4,_0x5b058){_0x44c2b4=_0x44c2b4-0x0;var _0x4a2b3c=_0x4560[_0x44c2b4];return _0x4a2b3c;};'use strict';var _=require(_0x0456('0x0'));var util=require(_0x0456('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0456('0x2'))(_0x0456('0x3'));var config=require(_0x0456('0x4'));var jayson=require(_0x0456('0x5'));var client=jayson[_0x0456('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f0a65,_0x5d2f09,_0x457ce3){return new BPromise(function(_0x1b0858,_0x5bde65){return client[_0x0456('0x7')](_0x4f0a65,_0x457ce3)[_0x0456('0x8')](function(_0x1ec08d){logger['info'](_0x0456('0x9'),_0x5d2f09,_0x0456('0xa'));logger['debug'](_0x0456('0xb'),_0x5d2f09,'request\x20sent',JSON[_0x0456('0xc')](_0x1ec08d));if(_0x1ec08d[_0x0456('0xd')]){if(_0x1ec08d['error']['code']===0x1f4){logger['error'](_0x0456('0x9'),_0x5d2f09,_0x1ec08d[_0x0456('0xd')][_0x0456('0xe')]);return _0x5bde65(_0x1ec08d[_0x0456('0xd')][_0x0456('0xe')]);}logger[_0x0456('0xd')](_0x0456('0x9'),_0x5d2f09,_0x1ec08d[_0x0456('0xd')][_0x0456('0xe')]);return _0x1b0858(_0x1ec08d[_0x0456('0xd')][_0x0456('0xe')]);}else{logger[_0x0456('0xf')](_0x0456('0x9'),_0x5d2f09,_0x0456('0xa'));_0x1b0858(_0x1ec08d[_0x0456('0x10')][_0x0456('0xe')]);}})[_0x0456('0x11')](function(_0x223696){logger['error'](_0x0456('0x9'),_0x5d2f09,_0x223696);_0x5bde65(_0x223696);});});}
\ No newline at end of file
index b9ef6ff..bb9e2d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0da=['create','/:id','update','destroy','multer','util','path','express','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index'];(function(_0x1e1ad3,_0x4da150){var _0x4694f2=function(_0x2e66df){while(--_0x2e66df){_0x1e1ad3['push'](_0x1e1ad3['shift']());}};_0x4694f2(++_0x4da150);}(_0xb0da,0xc8));var _0xab0d=function(_0x22d773,_0x533ad3){_0x22d773=_0x22d773-0x0;var _0x24e7a5=_0xb0da[_0x22d773];return _0x24e7a5;};'use strict';var multer=require(_0xab0d('0x0'));var util=require(_0xab0d('0x1'));var path=require(_0xab0d('0x2'));var express=require(_0xab0d('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xab0d('0x4'));var config=require(_0xab0d('0x5'));var controller=require(_0xab0d('0x6'));router[_0xab0d('0x7')]('/',auth[_0xab0d('0x8')](),controller[_0xab0d('0x9')]);router['get']('/:id',auth[_0xab0d('0x8')](),controller['show']);router['post']('/',auth[_0xab0d('0x8')](),controller[_0xab0d('0xa')]);router['put'](_0xab0d('0xb'),auth[_0xab0d('0x8')](),controller[_0xab0d('0xc')]);router['delete'](_0xab0d('0xb'),auth[_0xab0d('0x8')](),controller[_0xab0d('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x88d8=['isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get'];(function(_0x3ab2e8,_0x479009){var _0x446d16=function(_0x233d59){while(--_0x233d59){_0x3ab2e8['push'](_0x3ab2e8['shift']());}};_0x446d16(++_0x479009);}(_0x88d8,0x184));var _0x888d=function(_0x2c43ca,_0xe5db75){_0x2c43ca=_0x2c43ca-0x0;var _0x92813d=_0x88d8[_0x2c43ca];return _0x92813d;};'use strict';var multer=require(_0x888d('0x0'));var util=require(_0x888d('0x1'));var path=require(_0x888d('0x2'));var express=require(_0x888d('0x3'));var router=express['Router']();var auth=require(_0x888d('0x4'));var interaction=require(_0x888d('0x5'));var config=require('../../config/environment');var controller=require(_0x888d('0x6'));router[_0x888d('0x7')]('/',auth[_0x888d('0x8')](),controller[_0x888d('0x9')]);router['get'](_0x888d('0xa'),auth['isAuthenticated'](),controller[_0x888d('0xb')]);router[_0x888d('0xc')]('/',auth[_0x888d('0x8')](),controller[_0x888d('0xd')]);router[_0x888d('0xe')](_0x888d('0xa'),auth[_0x888d('0x8')](),controller[_0x888d('0xf')]);router['delete']('/:id',auth[_0x888d('0x8')](),controller[_0x888d('0x10')]);module[_0x888d('0x11')]=router;
\ No newline at end of file
index eccd3b8..4fa267e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91a7=['STRING','exports','ENUM','string','customVariable'];(function(_0x5a24e6,_0x3340b5){var _0x25d3a1=function(_0x4d5328){while(--_0x4d5328){_0x5a24e6['push'](_0x5a24e6['shift']());}};_0x25d3a1(++_0x3340b5);}(_0x91a7,0xe7));var _0x791a=function(_0xef1855,_0xe6c371){_0xef1855=_0xef1855-0x0;var _0x2169d0=_0x91a7[_0xef1855];return _0x2169d0;};'use strict';var Sequelize=require('sequelize');module[_0x791a('0x0')]={'type':{'type':Sequelize[_0x791a('0x1')](_0x791a('0x2'),'variable',_0x791a('0x3'),'keyValue'),'defaultValue':_0x791a('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x791a('0x1')](_0x791a('0x2'),'variable',_0x791a('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x791a('0x4')]},'nameField':{'type':Sequelize[_0x791a('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x791a('0x4')]}};
\ No newline at end of file
+var _0xac4a=['exports','ENUM','string','variable','customVariable','STRING','BOOLEAN','sequelize'];(function(_0x2445e2,_0xc4a747){var _0x1e5736=function(_0x4a6509){while(--_0x4a6509){_0x2445e2['push'](_0x2445e2['shift']());}};_0x1e5736(++_0xc4a747);}(_0xac4a,0x13f));var _0xaac4=function(_0x59560b,_0x223f10){_0x59560b=_0x59560b-0x0;var _0x4bdc1c=_0xac4a[_0x59560b];return _0x4bdc1c;};'use strict';var Sequelize=require(_0xaac4('0x0'));module[_0xaac4('0x1')]={'type':{'type':Sequelize[_0xaac4('0x2')](_0xaac4('0x3'),_0xaac4('0x4'),_0xaac4('0x5'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0xaac4('0x6')]},'key':{'type':Sequelize[_0xaac4('0x6')]},'keyType':{'type':Sequelize[_0xaac4('0x2')]('string',_0xaac4('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xaac4('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xaac4('0x6')]},'customField':{'type':Sequelize[_0xaac4('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index cd50971..59c4781 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb0b=['set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','model','query','dateEnd','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','dateStart','add','day','filter','merge','map','options','FreshdeskField','includeAll','include','findAll','show','params','find','catch','create','body','update','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit'];(function(_0x230c85,_0x51e859){var _0x4796c4=function(_0x6db6f8){while(--_0x6db6f8){_0x230c85['push'](_0x230c85['shift']());}};_0x4796c4(++_0x51e859);}(_0xfb0b,0x104));var _0xbfb0=function(_0x18c53b,_0x2c3bdd){_0x18c53b=_0x18c53b-0x0;var _0x4d0ad1=_0xfb0b[_0x18c53b];return _0x4d0ad1;};'use strict';var pdf=require(_0xbfb0('0x0'));var emlformat=require(_0xbfb0('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbfb0('0x2'));var moment=require(_0xbfb0('0x3'));var BPromise=require(_0xbfb0('0x4'));var Mustache=require(_0xbfb0('0x5'));var util=require(_0xbfb0('0x6'));var path=require(_0xbfb0('0x7'));var sox=require(_0xbfb0('0x8'));var csv=require(_0xbfb0('0x9'));var ejs=require(_0xbfb0('0xa'));var fs=require('fs');var _=require(_0xbfb0('0xb'));var squel=require(_0xbfb0('0xc'));var crypto=require(_0xbfb0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbfb0('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbfb0('0xf'));var Papa=require('papaparse');var qs=require(_0xbfb0('0x10'));var logger=require(_0xbfb0('0x11'))(_0xbfb0('0x12'));var utils=require(_0xbfb0('0x13'));var config=require(_0xbfb0('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x176678,_0x214608){_0x214608=_0x214608||0xcc;return function(_0x187d2c){if(_0x187d2c){return _0x176678[_0xbfb0('0x15')](_0x214608);}return _0x176678[_0xbfb0('0x16')](_0x214608)[_0xbfb0('0x17')]();};}function respondWithResult(_0x53a01a,_0x1410a5){_0x1410a5=_0x1410a5||0xc8;return function(_0x293d00){if(_0x293d00){return _0x53a01a['status'](_0x1410a5)[_0xbfb0('0x18')](_0x293d00);}};}function respondWithFilteredResult(_0x1149eb,_0x3bd048){return function(_0x643fc1){if(_0x643fc1){var _0x4cca59=_0x643fc1[_0xbfb0('0x19')],_0x3a29f6=_0x3bd048[_0xbfb0('0x1a')],_0xb266c5=_0x3bd048['offset']+_0x3bd048[_0xbfb0('0x1b')],_0x82a18c;if(_0xb266c5>=_0x4cca59){_0xb266c5=_0x4cca59;_0x82a18c=0xc8;}else{_0x82a18c=0xce;}_0x1149eb[_0xbfb0('0x16')](_0x82a18c);return _0x1149eb[_0xbfb0('0x1c')](_0xbfb0('0x1d'),_0x3a29f6+'-'+_0xb266c5+'/'+_0x4cca59)[_0xbfb0('0x18')](_0x643fc1);}return null;};}function patchUpdates(_0x4489c7){return function(_0x3d544a){try{jsonpatch[_0xbfb0('0x1e')](_0x3d544a,_0x4489c7,!![]);}catch(_0x3d42d9){return BPromise['reject'](_0x3d42d9);}return _0x3d544a[_0xbfb0('0x1f')]();};}function saveUpdates(_0x59c067,_0x38e4ba){return function(_0x37eecd){if(_0x37eecd){return _0x37eecd['update'](_0x59c067)[_0xbfb0('0x20')](function(_0x232fc2){return _0x232fc2;});}return null;};}function removeEntity(_0x58460d,_0x1b0615){return function(_0x4d4304){if(_0x4d4304){return _0x4d4304[_0xbfb0('0x21')]()[_0xbfb0('0x20')](function(){_0x58460d[_0xbfb0('0x16')](0xcc)[_0xbfb0('0x17')]();});}};}function handleEntityNotFound(_0xf3a81a,_0x2459a0){return function(_0x1fceb0){if(!_0x1fceb0){_0xf3a81a[_0xbfb0('0x15')](0x194);}return _0x1fceb0;};}function handleError(_0x5de213,_0x942323){_0x942323=_0x942323||0x1f4;return function(_0x43b55f){logger[_0xbfb0('0x22')](_0x43b55f[_0xbfb0('0x23')]);if(_0x43b55f[_0xbfb0('0x24')]){delete _0x43b55f['name'];}_0x5de213[_0xbfb0('0x16')](_0x942323)[_0xbfb0('0x25')](_0x43b55f);};}exports[_0xbfb0('0x26')]=function(_0x1bf84c,_0x75094e){var _0x1123b2={},_0x3d933c={},_0x3cee67={'count':0x0,'rows':[]};var _0x4e57bd=db['FreshdeskField']['rawAttributes'];_0x3d933c[_0xbfb0('0x27')]=_['keys'](_0x4e57bd);var _0x2b3bb0={'dateStart':_0x1bf84c[_0xbfb0('0x28')]['dateStart'],'dateEnd':_0x1bf84c['query'][_0xbfb0('0x29')]};delete _0x1bf84c[_0xbfb0('0x28')]['dateStart'];delete _0x1bf84c[_0xbfb0('0x28')][_0xbfb0('0x29')];_0x3d933c[_0xbfb0('0x28')]=_[_0xbfb0('0x2a')](_0x1bf84c[_0xbfb0('0x28')]);_0x3d933c[_0xbfb0('0x2b')]=_[_0xbfb0('0x2c')](_0x3d933c['model'],_0x3d933c[_0xbfb0('0x28')]);_0x1123b2[_0xbfb0('0x2d')]=_[_0xbfb0('0x2c')](_0x3d933c[_0xbfb0('0x27')],qs[_0xbfb0('0x2e')](_0x1bf84c[_0xbfb0('0x28')][_0xbfb0('0x2e')]));_0x1123b2[_0xbfb0('0x2d')]=_0x1123b2[_0xbfb0('0x2d')][_0xbfb0('0x2f')]?_0x1123b2['attributes']:_0x3d933c[_0xbfb0('0x27')];if(!_0x1bf84c[_0xbfb0('0x28')][_0xbfb0('0x30')](_0xbfb0('0x31'))){_0x1123b2[_0xbfb0('0x1b')]=qs[_0xbfb0('0x1b')](_0x1bf84c[_0xbfb0('0x28')][_0xbfb0('0x1b')]);_0x1123b2[_0xbfb0('0x1a')]=qs[_0xbfb0('0x1a')](_0x1bf84c['query'][_0xbfb0('0x1a')]);}_0x1123b2[_0xbfb0('0x32')]=qs[_0xbfb0('0x33')](_0x1bf84c['query'][_0xbfb0('0x33')]);_0x1123b2[_0xbfb0('0x34')]=qs['filters'](_[_0xbfb0('0x35')](_0x1bf84c[_0xbfb0('0x28')],_0x3d933c[_0xbfb0('0x2b')]));if(_0x2b3bb0[_0xbfb0('0x36')]){if(_0x2b3bb0[_0xbfb0('0x29')]){_0x2b3bb0[_0xbfb0('0x29')]=moment(_0x2b3bb0[_0xbfb0('0x29')])[_0xbfb0('0x37')](0x1,_0xbfb0('0x38'));}else{_0x2b3bb0[_0xbfb0('0x29')]=moment(_0x2b3bb0[_0xbfb0('0x36')])[_0xbfb0('0x37')](0x1,_0xbfb0('0x38'));}_['merge'](_0x1123b2[_0xbfb0('0x34')],{'createdAt':{'$gte':_0x2b3bb0[_0xbfb0('0x36')],'$lte':_0x2b3bb0[_0xbfb0('0x29')]}});}if(_0x1bf84c[_0xbfb0('0x28')][_0xbfb0('0x39')]){_0x1123b2[_0xbfb0('0x34')]=_[_0xbfb0('0x3a')](_0x1123b2[_0xbfb0('0x34')],{'$or':_[_0xbfb0('0x3b')](_0x1123b2[_0xbfb0('0x2d')],function(_0x55145b){var _0x439df5={};_0x439df5[_0x55145b]={'$like':'%'+_0x1bf84c[_0xbfb0('0x28')][_0xbfb0('0x39')]+'%'};return _0x439df5;})});}_0x1123b2=_[_0xbfb0('0x3a')]({},_0x1123b2,_0x1bf84c[_0xbfb0('0x3c')]);var _0x56ee07={'where':_0x1123b2[_0xbfb0('0x34')]};return db[_0xbfb0('0x3d')][_0xbfb0('0x19')](_0x56ee07)['then'](function(_0x2c9eeb){_0x3cee67[_0xbfb0('0x19')]=_0x2c9eeb;if(_0x1bf84c[_0xbfb0('0x28')][_0xbfb0('0x3e')]){_0x1123b2[_0xbfb0('0x3f')]=[{'all':!![]}];}return db[_0xbfb0('0x3d')][_0xbfb0('0x40')](_0x1123b2);})[_0xbfb0('0x20')](function(_0x4c3779){_0x3cee67['rows']=_0x4c3779;return _0x3cee67;})[_0xbfb0('0x20')](respondWithFilteredResult(_0x75094e,_0x1123b2))['catch'](handleError(_0x75094e,null));};exports[_0xbfb0('0x41')]=function(_0x369421,_0x6a8498){var _0x477d67={'raw':!![],'where':{'id':_0x369421[_0xbfb0('0x42')]['id']}},_0x1020b5={};_0x1020b5[_0xbfb0('0x27')]=_['keys'](db[_0xbfb0('0x3d')]['rawAttributes']);_0x1020b5['query']=_[_0xbfb0('0x2a')](_0x369421[_0xbfb0('0x28')]);_0x1020b5[_0xbfb0('0x2b')]=_[_0xbfb0('0x2c')](_0x1020b5[_0xbfb0('0x27')],_0x1020b5[_0xbfb0('0x28')]);_0x477d67[_0xbfb0('0x2d')]=_[_0xbfb0('0x2c')](_0x1020b5['model'],qs[_0xbfb0('0x2e')](_0x369421['query'][_0xbfb0('0x2e')]));_0x477d67[_0xbfb0('0x2d')]=_0x477d67[_0xbfb0('0x2d')]['length']?_0x477d67[_0xbfb0('0x2d')]:_0x1020b5[_0xbfb0('0x27')];if(_0x369421[_0xbfb0('0x28')][_0xbfb0('0x3e')]){_0x477d67[_0xbfb0('0x3f')]=[{'all':!![]}];}_0x477d67=_['merge']({},_0x477d67,_0x369421['options']);return db[_0xbfb0('0x3d')][_0xbfb0('0x43')](_0x477d67)[_0xbfb0('0x20')](handleEntityNotFound(_0x6a8498,null))[_0xbfb0('0x20')](respondWithResult(_0x6a8498,null))[_0xbfb0('0x44')](handleError(_0x6a8498,null));};exports[_0xbfb0('0x45')]=function(_0x1403b6,_0x106915){return db[_0xbfb0('0x3d')][_0xbfb0('0x45')](_0x1403b6[_0xbfb0('0x46')],{})[_0xbfb0('0x20')](respondWithResult(_0x106915,0xc9))[_0xbfb0('0x44')](handleError(_0x106915,null));};exports[_0xbfb0('0x47')]=function(_0x5f43ee,_0x351943){if(_0x5f43ee[_0xbfb0('0x46')]['id']){delete _0x5f43ee['body']['id'];}return db[_0xbfb0('0x3d')][_0xbfb0('0x43')]({'where':{'id':_0x5f43ee[_0xbfb0('0x42')]['id']}})[_0xbfb0('0x20')](handleEntityNotFound(_0x351943,null))['then'](saveUpdates(_0x5f43ee[_0xbfb0('0x46')],null))[_0xbfb0('0x20')](respondWithResult(_0x351943,null))['catch'](handleError(_0x351943,null));};exports[_0xbfb0('0x21')]=function(_0x4e972e,_0x2a8cb5){return db[_0xbfb0('0x3d')][_0xbfb0('0x43')]({'where':{'id':_0x4e972e[_0xbfb0('0x42')]['id']}})[_0xbfb0('0x20')](handleEntityNotFound(_0x2a8cb5,null))[_0xbfb0('0x20')](removeEntity(_0x2a8cb5,null))[_0xbfb0('0x44')](handleError(_0x2a8cb5,null));};
\ No newline at end of file
+var _0xbe96=['nolimit','limit','order','sort','where','filters','pick','dateStart','add','day','merge','filter','options','count','includeAll','include','rows','catch','show','params','find','create','body','html-pdf','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','offset','set','apply','reject','save','then','destroy','sendStatus','error','name','send','FreshdeskField','rawAttributes','model','keys','query','dateEnd','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x5de166,_0x1d7b0c){var _0x44e59f=function(_0x42dc9a){while(--_0x42dc9a){_0x5de166['push'](_0x5de166['shift']());}};_0x44e59f(++_0x1d7b0c);}(_0xbe96,0x1ec));var _0x6be9=function(_0x375215,_0x1f1c56){_0x375215=_0x375215-0x0;var _0x1400bd=_0xbe96[_0x375215];return _0x1400bd;};'use strict';var pdf=require(_0x6be9('0x0'));var emlformat=require(_0x6be9('0x1'));var rimraf=require(_0x6be9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6be9('0x3'));var BPromise=require(_0x6be9('0x4'));var Mustache=require(_0x6be9('0x5'));var util=require(_0x6be9('0x6'));var path=require(_0x6be9('0x7'));var sox=require(_0x6be9('0x8'));var csv=require(_0x6be9('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6be9('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6be9('0xb'));var toCsv=require(_0x6be9('0x9'));var querystring=require(_0x6be9('0xc'));var Papa=require(_0x6be9('0xd'));var qs=require(_0x6be9('0xe'));var logger=require(_0x6be9('0xf'))(_0x6be9('0x10'));var utils=require(_0x6be9('0x11'));var config=require('../../config/environment');var db=require(_0x6be9('0x12'))['db'];function respondWithStatusCode(_0x5a4d2e,_0x5d5bc9){_0x5d5bc9=_0x5d5bc9||0xcc;return function(_0x58e6d4){if(_0x58e6d4){return _0x5a4d2e['sendStatus'](_0x5d5bc9);}return _0x5a4d2e['status'](_0x5d5bc9)[_0x6be9('0x13')]();};}function respondWithResult(_0x37a073,_0x3dd36f){_0x3dd36f=_0x3dd36f||0xc8;return function(_0x116085){if(_0x116085){return _0x37a073[_0x6be9('0x14')](_0x3dd36f)[_0x6be9('0x15')](_0x116085);}};}function respondWithFilteredResult(_0x5818aa,_0x5d0a6b){return function(_0x76fe58){if(_0x76fe58){var _0x9941dc=_0x76fe58['count'],_0x1aa0ca=_0x5d0a6b[_0x6be9('0x16')],_0x13ecff=_0x5d0a6b[_0x6be9('0x16')]+_0x5d0a6b['limit'],_0x13871c;if(_0x13ecff>=_0x9941dc){_0x13ecff=_0x9941dc;_0x13871c=0xc8;}else{_0x13871c=0xce;}_0x5818aa[_0x6be9('0x14')](_0x13871c);return _0x5818aa[_0x6be9('0x17')]('Content-Range',_0x1aa0ca+'-'+_0x13ecff+'/'+_0x9941dc)[_0x6be9('0x15')](_0x76fe58);}return null;};}function patchUpdates(_0x4ea90a){return function(_0x14fef0){try{jsonpatch[_0x6be9('0x18')](_0x14fef0,_0x4ea90a,!![]);}catch(_0x1b4fc6){return BPromise[_0x6be9('0x19')](_0x1b4fc6);}return _0x14fef0[_0x6be9('0x1a')]();};}function saveUpdates(_0x20aa16,_0x4d6e10){return function(_0x2ebea4){if(_0x2ebea4){return _0x2ebea4['update'](_0x20aa16)[_0x6be9('0x1b')](function(_0x2c7a58){return _0x2c7a58;});}return null;};}function removeEntity(_0x3efa90,_0x2a6686){return function(_0x2db0a0){if(_0x2db0a0){return _0x2db0a0[_0x6be9('0x1c')]()['then'](function(){_0x3efa90[_0x6be9('0x14')](0xcc)[_0x6be9('0x13')]();});}};}function handleEntityNotFound(_0x3a0f52,_0x3e7f0f){return function(_0xe3fd85){if(!_0xe3fd85){_0x3a0f52[_0x6be9('0x1d')](0x194);}return _0xe3fd85;};}function handleError(_0x436b87,_0x535d41){_0x535d41=_0x535d41||0x1f4;return function(_0x191d82){logger[_0x6be9('0x1e')](_0x191d82['stack']);if(_0x191d82['name']){delete _0x191d82[_0x6be9('0x1f')];}_0x436b87[_0x6be9('0x14')](_0x535d41)[_0x6be9('0x20')](_0x191d82);};}exports['index']=function(_0x2eb92d,_0xbb0277){var _0x236ce8={},_0x28a500={},_0x388f4e={'count':0x0,'rows':[]};var _0x1519d7=db[_0x6be9('0x21')][_0x6be9('0x22')];_0x28a500[_0x6be9('0x23')]=_[_0x6be9('0x24')](_0x1519d7);var _0x5d7e98={'dateStart':_0x2eb92d[_0x6be9('0x25')]['dateStart'],'dateEnd':_0x2eb92d[_0x6be9('0x25')][_0x6be9('0x26')]};delete _0x2eb92d[_0x6be9('0x25')]['dateStart'];delete _0x2eb92d[_0x6be9('0x25')][_0x6be9('0x26')];_0x28a500[_0x6be9('0x25')]=_[_0x6be9('0x24')](_0x2eb92d[_0x6be9('0x25')]);_0x28a500['filters']=_[_0x6be9('0x27')](_0x28a500[_0x6be9('0x23')],_0x28a500[_0x6be9('0x25')]);_0x236ce8[_0x6be9('0x28')]=_['intersection'](_0x28a500[_0x6be9('0x23')],qs[_0x6be9('0x29')](_0x2eb92d[_0x6be9('0x25')][_0x6be9('0x29')]));_0x236ce8['attributes']=_0x236ce8[_0x6be9('0x28')][_0x6be9('0x2a')]?_0x236ce8[_0x6be9('0x28')]:_0x28a500[_0x6be9('0x23')];if(!_0x2eb92d['query'][_0x6be9('0x2b')](_0x6be9('0x2c'))){_0x236ce8[_0x6be9('0x2d')]=qs[_0x6be9('0x2d')](_0x2eb92d[_0x6be9('0x25')][_0x6be9('0x2d')]);_0x236ce8[_0x6be9('0x16')]=qs[_0x6be9('0x16')](_0x2eb92d[_0x6be9('0x25')][_0x6be9('0x16')]);}_0x236ce8[_0x6be9('0x2e')]=qs['sort'](_0x2eb92d['query'][_0x6be9('0x2f')]);_0x236ce8[_0x6be9('0x30')]=qs[_0x6be9('0x31')](_[_0x6be9('0x32')](_0x2eb92d[_0x6be9('0x25')],_0x28a500[_0x6be9('0x31')]));if(_0x5d7e98[_0x6be9('0x33')]){if(_0x5d7e98[_0x6be9('0x26')]){_0x5d7e98[_0x6be9('0x26')]=moment(_0x5d7e98[_0x6be9('0x26')])[_0x6be9('0x34')](0x1,'day');}else{_0x5d7e98[_0x6be9('0x26')]=moment(_0x5d7e98[_0x6be9('0x33')])[_0x6be9('0x34')](0x1,_0x6be9('0x35'));}_[_0x6be9('0x36')](_0x236ce8[_0x6be9('0x30')],{'createdAt':{'$gte':_0x5d7e98[_0x6be9('0x33')],'$lte':_0x5d7e98[_0x6be9('0x26')]}});}if(_0x2eb92d[_0x6be9('0x25')][_0x6be9('0x37')]){_0x236ce8['where']=_[_0x6be9('0x36')](_0x236ce8[_0x6be9('0x30')],{'$or':_['map'](_0x236ce8[_0x6be9('0x28')],function(_0x53049e){var _0x22eda0={};_0x22eda0[_0x53049e]={'$like':'%'+_0x2eb92d[_0x6be9('0x25')][_0x6be9('0x37')]+'%'};return _0x22eda0;})});}_0x236ce8=_[_0x6be9('0x36')]({},_0x236ce8,_0x2eb92d[_0x6be9('0x38')]);var _0x38b798={'where':_0x236ce8[_0x6be9('0x30')]};return db[_0x6be9('0x21')][_0x6be9('0x39')](_0x38b798)['then'](function(_0x29405e){_0x388f4e[_0x6be9('0x39')]=_0x29405e;if(_0x2eb92d['query'][_0x6be9('0x3a')]){_0x236ce8[_0x6be9('0x3b')]=[{'all':!![]}];}return db[_0x6be9('0x21')]['findAll'](_0x236ce8);})[_0x6be9('0x1b')](function(_0x26485f){_0x388f4e[_0x6be9('0x3c')]=_0x26485f;return _0x388f4e;})['then'](respondWithFilteredResult(_0xbb0277,_0x236ce8))[_0x6be9('0x3d')](handleError(_0xbb0277,null));};exports[_0x6be9('0x3e')]=function(_0x3eed39,_0x299833){var _0x42d66f={'raw':!![],'where':{'id':_0x3eed39[_0x6be9('0x3f')]['id']}},_0x3e2e17={};_0x3e2e17[_0x6be9('0x23')]=_[_0x6be9('0x24')](db[_0x6be9('0x21')]['rawAttributes']);_0x3e2e17[_0x6be9('0x25')]=_[_0x6be9('0x24')](_0x3eed39[_0x6be9('0x25')]);_0x3e2e17[_0x6be9('0x31')]=_[_0x6be9('0x27')](_0x3e2e17[_0x6be9('0x23')],_0x3e2e17[_0x6be9('0x25')]);_0x42d66f[_0x6be9('0x28')]=_['intersection'](_0x3e2e17['model'],qs['fields'](_0x3eed39[_0x6be9('0x25')]['fields']));_0x42d66f['attributes']=_0x42d66f['attributes']['length']?_0x42d66f[_0x6be9('0x28')]:_0x3e2e17['model'];if(_0x3eed39['query'][_0x6be9('0x3a')]){_0x42d66f[_0x6be9('0x3b')]=[{'all':!![]}];}_0x42d66f=_[_0x6be9('0x36')]({},_0x42d66f,_0x3eed39[_0x6be9('0x38')]);return db['FreshdeskField'][_0x6be9('0x40')](_0x42d66f)['then'](handleEntityNotFound(_0x299833,null))[_0x6be9('0x1b')](respondWithResult(_0x299833,null))['catch'](handleError(_0x299833,null));};exports[_0x6be9('0x41')]=function(_0x379503,_0x3ee313){return db[_0x6be9('0x21')][_0x6be9('0x41')](_0x379503[_0x6be9('0x42')],{})[_0x6be9('0x1b')](respondWithResult(_0x3ee313,0xc9))[_0x6be9('0x3d')](handleError(_0x3ee313,null));};exports['update']=function(_0x5c72b7,_0x40c804){if(_0x5c72b7[_0x6be9('0x42')]['id']){delete _0x5c72b7['body']['id'];}return db['FreshdeskField'][_0x6be9('0x40')]({'where':{'id':_0x5c72b7[_0x6be9('0x3f')]['id']}})[_0x6be9('0x1b')](handleEntityNotFound(_0x40c804,null))[_0x6be9('0x1b')](saveUpdates(_0x5c72b7['body'],null))[_0x6be9('0x1b')](respondWithResult(_0x40c804,null))[_0x6be9('0x3d')](handleError(_0x40c804,null));};exports['destroy']=function(_0x54c688,_0x2984c7){return db[_0x6be9('0x21')][_0x6be9('0x40')]({'where':{'id':_0x54c688[_0x6be9('0x3f')]['id']}})[_0x6be9('0x1b')](handleEntityNotFound(_0x2984c7,null))[_0x6be9('0x1b')](removeEntity(_0x2984c7,null))[_0x6be9('0x3d')](handleError(_0x2984c7,null));};
\ No newline at end of file
index e204a58..651f59e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2da6=['./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x32e18a,_0x31a9c4){var _0x54a5fe=function(_0x305322){while(--_0x305322){_0x32e18a['push'](_0x32e18a['shift']());}};_0x54a5fe(++_0x31a9c4);}(_0x2da6,0x1dd));var _0x62da=function(_0xea6a0d,_0x383d1d){_0xea6a0d=_0xea6a0d-0x0;var _0x12dfcb=_0x2da6[_0xea6a0d];return _0x12dfcb;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var logger=require(_0x62da('0x2'))(_0x62da('0x3'));var moment=require(_0x62da('0x4'));var BPromise=require(_0x62da('0x5'));var rp=require(_0x62da('0x6'));var attributes=require(_0x62da('0x7'));module['exports']=function(_0x4a8428,_0xe28204){return _0x4a8428[_0x62da('0x8')](_0x62da('0x9'),attributes,{'tableName':_0x62da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xde9f=['lodash','api','moment','request-promise','./intFreshdeskField.attributes','define','FreshdeskField'];(function(_0x127d55,_0x90027b){var _0x508ed8=function(_0x252633){while(--_0x252633){_0x127d55['push'](_0x127d55['shift']());}};_0x508ed8(++_0x90027b);}(_0xde9f,0x118));var _0xfde9=function(_0x138d06,_0x33edf2){_0x138d06=_0x138d06-0x0;var _0x1a01eb=_0xde9f[_0x138d06];return _0x1a01eb;};'use strict';var _=require(_0xfde9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfde9('0x1'));var moment=require(_0xfde9('0x2'));var BPromise=require('bluebird');var rp=require(_0xfde9('0x3'));var attributes=require(_0xfde9('0x4'));module['exports']=function(_0x3a6e6d,_0x4767ba){return _0x3a6e6d[_0xfde9('0x5')](_0xfde9('0x6'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cfa280a..4ca5612 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd6f=['code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x212fcc,_0x1a8867){var _0x4d8190=function(_0x347f7b){while(--_0x347f7b){_0x212fcc['push'](_0x212fcc['shift']());}};_0x4d8190(++_0x1a8867);}(_0xfd6f,0x1cf));var _0xffd6=function(_0x16fba8,_0x34af0c){_0x16fba8=_0x16fba8-0x0;var _0x224b07=_0xfd6f[_0x16fba8];return _0x224b07;};'use strict';var _=require('lodash');var util=require(_0xffd6('0x0'));var moment=require(_0xffd6('0x1'));var BPromise=require(_0xffd6('0x2'));var rs=require(_0xffd6('0x3'));var fs=require('fs');var db=require(_0xffd6('0x4'))['db'];var utils=require(_0xffd6('0x5'));var logger=require(_0xffd6('0x6'))(_0xffd6('0x7'));var config=require('../../config/environment');var jayson=require(_0xffd6('0x8'));var client=jayson[_0xffd6('0x9')][_0xffd6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c92a8,_0x3c106c,_0x56e10c){return new BPromise(function(_0x55cc8b,_0x3473ad){return client[_0xffd6('0xb')](_0x2c92a8,_0x56e10c)[_0xffd6('0xc')](function(_0x2d1e5a){logger[_0xffd6('0xd')](_0xffd6('0xe'),_0x3c106c,_0xffd6('0xf'));logger[_0xffd6('0x10')](_0xffd6('0x11'),_0x3c106c,_0xffd6('0xf'),JSON[_0xffd6('0x12')](_0x2d1e5a));if(_0x2d1e5a[_0xffd6('0x13')]){if(_0x2d1e5a[_0xffd6('0x13')][_0xffd6('0x14')]===0x1f4){logger['error'](_0xffd6('0xe'),_0x3c106c,_0x2d1e5a[_0xffd6('0x13')][_0xffd6('0x15')]);return _0x3473ad(_0x2d1e5a[_0xffd6('0x13')][_0xffd6('0x15')]);}logger['error'](_0xffd6('0xe'),_0x3c106c,_0x2d1e5a[_0xffd6('0x13')][_0xffd6('0x15')]);return _0x55cc8b(_0x2d1e5a['error'][_0xffd6('0x15')]);}else{logger['info']('FreshdeskField,\x20%s,\x20%s',_0x3c106c,_0xffd6('0xf'));_0x55cc8b(_0x2d1e5a[_0xffd6('0x16')][_0xffd6('0x15')]);}})['catch'](function(_0x29e07d){logger[_0xffd6('0x13')](_0xffd6('0xe'),_0x3c106c,_0x29e07d);_0x3473ad(_0x29e07d);});});}
\ No newline at end of file
+var _0xf18b=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskField,\x20%s,\x20%s','message','result','bluebird'];(function(_0x19b00d,_0x1180fb){var _0x33be4f=function(_0xc4023e){while(--_0xc4023e){_0x19b00d['push'](_0x19b00d['shift']());}};_0x33be4f(++_0x1180fb);}(_0xf18b,0x120));var _0xbf18=function(_0x5bf0d8,_0x40d013){_0x5bf0d8=_0x5bf0d8-0x0;var _0x20fcab=_0xf18b[_0x5bf0d8];return _0x20fcab;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xbf18('0x0'));var rs=require('randomstring');var fs=require('fs');var db=require(_0xbf18('0x1'))['db'];var utils=require(_0xbf18('0x2'));var logger=require('../../config/logger')(_0xbf18('0x3'));var config=require(_0xbf18('0x4'));var jayson=require(_0xbf18('0x5'));var client=jayson['client'][_0xbf18('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xa126bc,_0x11d31d,_0x172ce9){return new BPromise(function(_0x5b7b52,_0x274a8a){return client[_0xbf18('0x7')](_0xa126bc,_0x172ce9)[_0xbf18('0x8')](function(_0x41480d){logger[_0xbf18('0x9')]('FreshdeskField,\x20%s,\x20%s',_0x11d31d,_0xbf18('0xa'));logger['debug'](_0xbf18('0xb'),_0x11d31d,_0xbf18('0xa'),JSON[_0xbf18('0xc')](_0x41480d));if(_0x41480d[_0xbf18('0xd')]){if(_0x41480d[_0xbf18('0xd')]['code']===0x1f4){logger[_0xbf18('0xd')](_0xbf18('0xe'),_0x11d31d,_0x41480d[_0xbf18('0xd')]['message']);return _0x274a8a(_0x41480d[_0xbf18('0xd')][_0xbf18('0xf')]);}logger[_0xbf18('0xd')](_0xbf18('0xe'),_0x11d31d,_0x41480d[_0xbf18('0xd')][_0xbf18('0xf')]);return _0x5b7b52(_0x41480d['error'][_0xbf18('0xf')]);}else{logger['info']('FreshdeskField,\x20%s,\x20%s',_0x11d31d,'request\x20sent');_0x5b7b52(_0x41480d[_0xbf18('0x10')][_0xbf18('0xf')]);}})['catch'](function(_0x51e5e3){logger[_0xbf18('0xd')](_0xbf18('0xe'),_0x11d31d,_0x51e5e3);_0x274a8a(_0x51e5e3);});});}
\ No newline at end of file
index 87fa068..d034497 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c21=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller'];(function(_0x1009c6,_0x548277){var _0x40dc08=function(_0x11218c){while(--_0x11218c){_0x1009c6['push'](_0x1009c6['shift']());}};_0x40dc08(++_0x548277);}(_0x0c21,0x1f3));var _0x10c2=function(_0x50f95e,_0x23d802){_0x50f95e=_0x50f95e-0x0;var _0x534daf=_0x0c21[_0x50f95e];return _0x534daf;};'use strict';var multer=require(_0x10c2('0x0'));var util=require(_0x10c2('0x1'));var path=require('path');var express=require(_0x10c2('0x2'));var router=express[_0x10c2('0x3')]();var auth=require(_0x10c2('0x4'));var interaction=require(_0x10c2('0x5'));var config=require('../../config/environment');var controller=require(_0x10c2('0x6'));router[_0x10c2('0x7')]('/',auth[_0x10c2('0x8')](),controller[_0x10c2('0x9')]);router[_0x10c2('0x7')](_0x10c2('0xa'),auth['isAuthenticated'](),controller[_0x10c2('0xb')]);router[_0x10c2('0x7')](_0x10c2('0xc'),auth[_0x10c2('0x8')](),controller[_0x10c2('0xd')]);router['get'](_0x10c2('0xe'),auth[_0x10c2('0x8')](),controller[_0x10c2('0xf')]);router[_0x10c2('0x10')]('/',auth[_0x10c2('0x8')](),controller[_0x10c2('0x11')]);router[_0x10c2('0x10')](_0x10c2('0xc'),auth[_0x10c2('0x8')](),controller[_0x10c2('0x12')]);router['put'](_0x10c2('0xa'),auth['isAuthenticated'](),controller[_0x10c2('0x13')]);router[_0x10c2('0x14')](_0x10c2('0xa'),auth['isAuthenticated'](),controller[_0x10c2('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x0d34=['update','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x0d34,0x1bb));var _0x40d3=function(_0x2fd1f6,_0x279d6b){_0x2fd1f6=_0x2fd1f6-0x0;var _0x531ce0=_0x0d34[_0x2fd1f6];return _0x531ce0;};'use strict';var multer=require(_0x40d3('0x0'));var util=require(_0x40d3('0x1'));var path=require('path');var express=require('express');var router=express[_0x40d3('0x2')]();var auth=require(_0x40d3('0x3'));var interaction=require(_0x40d3('0x4'));var config=require(_0x40d3('0x5'));var controller=require(_0x40d3('0x6'));router[_0x40d3('0x7')]('/',auth[_0x40d3('0x8')](),controller[_0x40d3('0x9')]);router['get'](_0x40d3('0xa'),auth['isAuthenticated'](),controller[_0x40d3('0xb')]);router[_0x40d3('0x7')](_0x40d3('0xc'),auth[_0x40d3('0x8')](),controller[_0x40d3('0xd')]);router[_0x40d3('0x7')](_0x40d3('0xe'),auth[_0x40d3('0x8')](),controller[_0x40d3('0xf')]);router[_0x40d3('0x10')]('/',auth[_0x40d3('0x8')](),controller['create']);router['post'](_0x40d3('0xc'),auth[_0x40d3('0x8')](),controller[_0x40d3('0x11')]);router[_0x40d3('0x12')](_0x40d3('0xa'),auth[_0x40d3('0x8')](),controller[_0x40d3('0x13')]);router['delete'](_0x40d3('0xa'),auth[_0x40d3('0x8')](),controller['destroy']);module[_0x40d3('0x14')]=router;
\ No newline at end of file
index ca33e1d..0fef08e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e57=['sequelize','STRING','username','ENUM','integrationTab'];(function(_0xf6e75d,_0xc70967){var _0x27514d=function(_0xc2c6dd){while(--_0xc2c6dd){_0xf6e75d['push'](_0xf6e75d['shift']());}};_0x27514d(++_0xc70967);}(_0x5e57,0x127));var _0x75e5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5e57[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x75e5('0x0'));module['exports']={'name':{'type':Sequelize[_0x75e5('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x75e5('0x1')],'unique':_0x75e5('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x75e5('0x1')]},'clientId':{'type':Sequelize[_0x75e5('0x1')]},'clientSecret':{'type':Sequelize[_0x75e5('0x1')]},'securityToken':{'type':Sequelize[_0x75e5('0x1')]},'serverUrl':{'type':Sequelize[_0x75e5('0x1')]},'type':{'type':Sequelize[_0x75e5('0x3')](_0x75e5('0x4'),'newTab'),'defaultValue':_0x75e5('0x4')}};
\ No newline at end of file
+var _0x4bb9=['ENUM','integrationTab','newTab','sequelize','username','STRING'];(function(_0x5b1c50,_0x56e694){var _0x2d379b=function(_0x981b9c){while(--_0x981b9c){_0x5b1c50['push'](_0x5b1c50['shift']());}};_0x2d379b(++_0x56e694);}(_0x4bb9,0x123));var _0x94bb=function(_0x204bdc,_0xa5872d){_0x204bdc=_0x204bdc-0x0;var _0x3b1554=_0x4bb9[_0x204bdc];return _0x3b1554;};'use strict';var Sequelize=require(_0x94bb('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x94bb('0x1')},'remoteUri':{'type':Sequelize[_0x94bb('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x94bb('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x94bb('0x2')]},'serverUrl':{'type':Sequelize[_0x94bb('0x2')]},'type':{'type':Sequelize[_0x94bb('0x3')](_0x94bb('0x4'),_0x94bb('0x5')),'defaultValue':_0x94bb('0x4')}};
\ No newline at end of file
index 5243935..ecfb5b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ec5=['client','http','request','info','SalesforceAccount,\x20%s,\x20%s','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','index','rawAttributes','model','keys','query','dateStart','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','dateEnd','day','add','merge','filter','includeAll','include','SalesforceAccount','findAll','show','params','options','find','create','body','update','findOne','SalesforceConfiguration','map','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','securityToken','Connection','login','password','concat','sobject','CallDisposition','CallDurationInSeconds','CallObject','Status','Type','remove','custom','picklistValues','label','test','statusCode','stringify','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../components/integrations/configuration'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ec5,0x150));var _0x59ec=function(_0x34bc94,_0x74f0fd){_0x34bc94=_0x34bc94-0x0;var _0xee41e7=_0x9ec5[_0x34bc94];return _0xee41e7;};'use strict';var pdf=require(_0x59ec('0x0'));var emlformat=require(_0x59ec('0x1'));var rimraf=require(_0x59ec('0x2'));var zipdir=require(_0x59ec('0x3'));var jsonpatch=require(_0x59ec('0x4'));var rp=require(_0x59ec('0x5'));var moment=require(_0x59ec('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x59ec('0x7'));var util=require(_0x59ec('0x8'));var path=require(_0x59ec('0x9'));var sox=require(_0x59ec('0xa'));var csv=require(_0x59ec('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x59ec('0xc'));var squel=require(_0x59ec('0xd'));var crypto=require(_0x59ec('0xe'));var jsforce=require(_0x59ec('0xf'));var deskjs=require(_0x59ec('0x10'));var toCsv=require(_0x59ec('0xb'));var querystring=require(_0x59ec('0x11'));var Papa=require(_0x59ec('0x12'));var qs=require(_0x59ec('0x13'));var logger=require(_0x59ec('0x14'))(_0x59ec('0x15'));var utils=require('../../config/utils');var config=require(_0x59ec('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x59ec('0x17'));var jayson=require('jayson/promise');var client=jayson[_0x59ec('0x18')][_0x59ec('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x167eb7,_0x72d5e7,_0x2c020d,_0x44f4c4){return new BPromise(function(_0x55669b,_0x5eaa0e){var _0x4619fa=_0x44f4c4||client;return _0x4619fa[_0x59ec('0x1a')](_0x167eb7,_0x2c020d)['then'](function(_0x3abbbd){logger[_0x59ec('0x1b')](_0x59ec('0x1c'),_0x72d5e7,'request\x20sent');logger['debug'](_0x59ec('0x1d'),_0x72d5e7,_0x59ec('0x1e'),JSON['stringify'](_0x3abbbd));if(_0x3abbbd[_0x59ec('0x1f')]){if(_0x3abbbd[_0x59ec('0x1f')][_0x59ec('0x20')]===0x1f4){logger[_0x59ec('0x1f')](_0x59ec('0x1c'),_0x72d5e7,_0x3abbbd['error'][_0x59ec('0x21')]);return _0x5eaa0e(_0x3abbbd[_0x59ec('0x1f')][_0x59ec('0x21')]);}logger[_0x59ec('0x1f')](_0x59ec('0x1c'),_0x72d5e7,_0x3abbbd[_0x59ec('0x1f')][_0x59ec('0x21')]);return _0x55669b(_0x3abbbd[_0x59ec('0x1f')][_0x59ec('0x21')]);}else{logger[_0x59ec('0x1b')](_0x59ec('0x1c'),_0x72d5e7,_0x59ec('0x1e'));_0x55669b(_0x3abbbd[_0x59ec('0x22')][_0x59ec('0x21')]);}})[_0x59ec('0x23')](function(_0x492915){logger['error'](_0x59ec('0x1c'),_0x72d5e7,_0x492915);_0x5eaa0e(_0x492915);});});}function respondWithStatusCode(_0x238100,_0x4dd766){_0x4dd766=_0x4dd766||0xcc;return function(_0x588778){if(_0x588778){return _0x238100[_0x59ec('0x24')](_0x4dd766);}return _0x238100['status'](_0x4dd766)[_0x59ec('0x25')]();};}function respondWithResult(_0x220847,_0x1ebacd){_0x1ebacd=_0x1ebacd||0xc8;return function(_0x16a793){if(_0x16a793){return _0x220847[_0x59ec('0x26')](_0x1ebacd)['json'](_0x16a793);}};}function respondWithFilteredResult(_0xe5f7a9,_0x256af7){return function(_0x5f16ff){if(_0x5f16ff){var _0x43e1e8=_0x5f16ff[_0x59ec('0x27')],_0x3cd8f7=_0x256af7[_0x59ec('0x28')],_0x34cd0a=_0x256af7['offset']+_0x256af7[_0x59ec('0x29')],_0xd9ff56;if(_0x34cd0a>=_0x43e1e8){_0x34cd0a=_0x43e1e8;_0xd9ff56=0xc8;}else{_0xd9ff56=0xce;}_0xe5f7a9[_0x59ec('0x26')](_0xd9ff56);return _0xe5f7a9[_0x59ec('0x2a')](_0x59ec('0x2b'),_0x3cd8f7+'-'+_0x34cd0a+'/'+_0x43e1e8)[_0x59ec('0x2c')](_0x5f16ff);}return null;};}function patchUpdates(_0x135493){return function(_0xb69eea){try{jsonpatch[_0x59ec('0x2d')](_0xb69eea,_0x135493,!![]);}catch(_0x18e294){return BPromise[_0x59ec('0x2e')](_0x18e294);}return _0xb69eea[_0x59ec('0x2f')]();};}function saveUpdates(_0x20445f,_0x2278ca){return function(_0x2b2cdf){if(_0x2b2cdf){return _0x2b2cdf['update'](_0x20445f)[_0x59ec('0x30')](function(_0x514f55){return _0x514f55;});}return null;};}function removeEntity(_0x3f3ad4,_0xf5d532){return function(_0x1351a1){if(_0x1351a1){return _0x1351a1[_0x59ec('0x31')]()[_0x59ec('0x30')](function(){_0x3f3ad4[_0x59ec('0x26')](0xcc)[_0x59ec('0x25')]();});}};}function handleEntityNotFound(_0x3513e3,_0x4ba57c){return function(_0x4ad17c){if(!_0x4ad17c){_0x3513e3[_0x59ec('0x24')](0x194);}return _0x4ad17c;};}function handleError(_0x892341,_0x40d828){_0x40d828=_0x40d828||0x1f4;return function(_0x2cec79){logger['error'](_0x2cec79[_0x59ec('0x32')]);if(_0x2cec79[_0x59ec('0x33')]){delete _0x2cec79[_0x59ec('0x33')];}_0x892341[_0x59ec('0x26')](_0x40d828)['send'](_0x2cec79);};}exports[_0x59ec('0x34')]=function(_0x421d93,_0x12c973){var _0x178952={},_0x4cab7e={},_0x224cc2={'count':0x0,'rows':[]};var _0x134ff7=db['SalesforceAccount'][_0x59ec('0x35')];_0x4cab7e[_0x59ec('0x36')]=_[_0x59ec('0x37')](_0x134ff7);var _0x3128eb={'dateStart':_0x421d93[_0x59ec('0x38')]['dateStart'],'dateEnd':_0x421d93[_0x59ec('0x38')]['dateEnd']};delete _0x421d93['query'][_0x59ec('0x39')];delete _0x421d93[_0x59ec('0x38')]['dateEnd'];_0x4cab7e[_0x59ec('0x38')]=_[_0x59ec('0x37')](_0x421d93[_0x59ec('0x38')]);_0x4cab7e['filters']=_[_0x59ec('0x3a')](_0x4cab7e[_0x59ec('0x36')],_0x4cab7e[_0x59ec('0x38')]);_0x178952[_0x59ec('0x3b')]=_[_0x59ec('0x3a')](_0x4cab7e[_0x59ec('0x36')],qs[_0x59ec('0x3c')](_0x421d93['query'][_0x59ec('0x3c')]));_0x178952[_0x59ec('0x3b')]=_0x178952[_0x59ec('0x3b')][_0x59ec('0x3d')]?_0x178952[_0x59ec('0x3b')]:_0x4cab7e[_0x59ec('0x36')];if(!_0x421d93[_0x59ec('0x38')][_0x59ec('0x3e')](_0x59ec('0x3f'))){_0x178952[_0x59ec('0x29')]=qs[_0x59ec('0x29')](_0x421d93[_0x59ec('0x38')][_0x59ec('0x29')]);_0x178952[_0x59ec('0x28')]=qs[_0x59ec('0x28')](_0x421d93[_0x59ec('0x38')]['offset']);}_0x178952[_0x59ec('0x40')]=qs[_0x59ec('0x41')](_0x421d93[_0x59ec('0x38')]['sort']);_0x178952[_0x59ec('0x42')]=qs[_0x59ec('0x43')](_['pick'](_0x421d93[_0x59ec('0x38')],_0x4cab7e[_0x59ec('0x43')]));if(_0x3128eb[_0x59ec('0x39')]){if(_0x3128eb['dateEnd']){_0x3128eb[_0x59ec('0x44')]=moment(_0x3128eb['dateEnd'])['add'](0x1,_0x59ec('0x45'));}else{_0x3128eb[_0x59ec('0x44')]=moment(_0x3128eb['dateStart'])[_0x59ec('0x46')](0x1,_0x59ec('0x45'));}_[_0x59ec('0x47')](_0x178952[_0x59ec('0x42')],{'createdAt':{'$gte':_0x3128eb[_0x59ec('0x39')],'$lte':_0x3128eb['dateEnd']}});}if(_0x421d93[_0x59ec('0x38')][_0x59ec('0x48')]){_0x178952[_0x59ec('0x42')]=_[_0x59ec('0x47')](_0x178952[_0x59ec('0x42')],{'$or':_['map'](_0x178952['attributes'],function(_0x268fad){var _0x13489d={};_0x13489d[_0x268fad]={'$like':'%'+_0x421d93[_0x59ec('0x38')][_0x59ec('0x48')]+'%'};return _0x13489d;})});}_0x178952=_[_0x59ec('0x47')]({},_0x178952,_0x421d93['options']);var _0x4d6cf5={'where':_0x178952[_0x59ec('0x42')]};return db['SalesforceAccount']['count'](_0x4d6cf5)[_0x59ec('0x30')](function(_0x27565f){_0x224cc2[_0x59ec('0x27')]=_0x27565f;if(_0x421d93['query'][_0x59ec('0x49')]){_0x178952[_0x59ec('0x4a')]=[{'all':!![]}];}return db[_0x59ec('0x4b')][_0x59ec('0x4c')](_0x178952);})[_0x59ec('0x30')](function(_0x18b5f0){_0x224cc2['rows']=_0x18b5f0;return _0x224cc2;})[_0x59ec('0x30')](respondWithFilteredResult(_0x12c973,_0x178952))[_0x59ec('0x23')](handleError(_0x12c973,null));};exports[_0x59ec('0x4d')]=function(_0x50e101,_0x512f3b){var _0x4a3007={'raw':![],'where':{'id':_0x50e101[_0x59ec('0x4e')]['id']}},_0x1f8619={};_0x1f8619[_0x59ec('0x36')]=_[_0x59ec('0x37')](db[_0x59ec('0x4b')][_0x59ec('0x35')]);_0x1f8619['query']=_['keys'](_0x50e101[_0x59ec('0x38')]);_0x1f8619[_0x59ec('0x43')]=_['intersection'](_0x1f8619[_0x59ec('0x36')],_0x1f8619['query']);_0x4a3007[_0x59ec('0x3b')]=_[_0x59ec('0x3a')](_0x1f8619[_0x59ec('0x36')],qs[_0x59ec('0x3c')](_0x50e101[_0x59ec('0x38')][_0x59ec('0x3c')]));_0x4a3007[_0x59ec('0x3b')]=_0x4a3007[_0x59ec('0x3b')][_0x59ec('0x3d')]?_0x4a3007['attributes']:_0x1f8619[_0x59ec('0x36')];if(_0x50e101['query'][_0x59ec('0x49')]){_0x4a3007[_0x59ec('0x4a')]=[{'all':!![]}];}_0x4a3007=_[_0x59ec('0x47')]({},_0x4a3007,_0x50e101[_0x59ec('0x4f')]);return db['SalesforceAccount'][_0x59ec('0x50')](_0x4a3007)[_0x59ec('0x30')](handleEntityNotFound(_0x512f3b,null))[_0x59ec('0x30')](respondWithResult(_0x512f3b,null))[_0x59ec('0x23')](handleError(_0x512f3b,null));};exports[_0x59ec('0x51')]=function(_0xd02836,_0x5093d0){return db[_0x59ec('0x4b')][_0x59ec('0x51')](_0xd02836[_0x59ec('0x52')],{})[_0x59ec('0x30')](respondWithResult(_0x5093d0,0xc9))[_0x59ec('0x23')](handleError(_0x5093d0,null));};exports[_0x59ec('0x53')]=function(_0x289eea,_0x324742){if(_0x289eea[_0x59ec('0x52')]['id']){delete _0x289eea[_0x59ec('0x52')]['id'];}return db[_0x59ec('0x4b')][_0x59ec('0x50')]({'where':{'id':_0x289eea[_0x59ec('0x4e')]['id']}})[_0x59ec('0x30')](handleEntityNotFound(_0x324742,null))[_0x59ec('0x30')](saveUpdates(_0x289eea[_0x59ec('0x52')],null))[_0x59ec('0x30')](respondWithResult(_0x324742,null))[_0x59ec('0x23')](handleError(_0x324742,null));};exports['destroy']=function(_0xb7b7fd,_0x39b06a){return db[_0x59ec('0x4b')][_0x59ec('0x50')]({'where':{'id':_0xb7b7fd[_0x59ec('0x4e')]['id']}})[_0x59ec('0x30')](handleEntityNotFound(_0x39b06a,null))[_0x59ec('0x30')](removeEntity(_0x39b06a,null))[_0x59ec('0x23')](handleError(_0x39b06a,null));};exports['getConfigurations']=function(_0x56071b,_0x4ed931,_0x36cb32){var _0x5bfb1b={};var _0x39049f={};var _0x1b8551;var _0x578784;return db[_0x59ec('0x4b')][_0x59ec('0x54')]({'where':{'id':_0x56071b[_0x59ec('0x4e')]['id']}})[_0x59ec('0x30')](handleEntityNotFound(_0x4ed931,null))['then'](function(_0x1328dd){if(_0x1328dd){_0x1b8551=_0x1328dd;_0x39049f[_0x59ec('0x36')]=_[_0x59ec('0x37')](db[_0x59ec('0x55')]['rawAttributes']);_0x39049f[_0x59ec('0x38')]=_['keys'](_0x56071b[_0x59ec('0x38')]);_0x39049f['filters']=_['intersection'](_0x39049f[_0x59ec('0x36')],_0x39049f['query']);_0x5bfb1b[_0x59ec('0x3b')]=_['intersection'](_0x39049f[_0x59ec('0x36')],qs['fields'](_0x56071b[_0x59ec('0x38')][_0x59ec('0x3c')]));_0x5bfb1b['attributes']=_0x5bfb1b[_0x59ec('0x3b')][_0x59ec('0x3d')]?_0x5bfb1b['attributes']:_0x39049f[_0x59ec('0x36')];_0x5bfb1b[_0x59ec('0x40')]=qs[_0x59ec('0x41')](_0x56071b[_0x59ec('0x38')]['sort']);_0x5bfb1b[_0x59ec('0x42')]=qs['filters'](_['pick'](_0x56071b[_0x59ec('0x38')],_0x39049f[_0x59ec('0x43')]));if(_0x56071b['query'][_0x59ec('0x48')]){_0x5bfb1b[_0x59ec('0x42')]=_[_0x59ec('0x47')](_0x5bfb1b[_0x59ec('0x42')],{'$or':_[_0x59ec('0x56')](_0x5bfb1b[_0x59ec('0x3b')],function(_0x45dfce){var _0x4d3ae4={};_0x4d3ae4[_0x45dfce]={'$like':'%'+_0x56071b['query']['filter']+'%'};return _0x4d3ae4;})});}_0x5bfb1b=_[_0x59ec('0x47')]({},_0x5bfb1b,_0x56071b[_0x59ec('0x4f')]);return _0x1b8551[_0x59ec('0x57')](_0x5bfb1b);}})[_0x59ec('0x30')](function(_0x507900){if(_0x507900){_0x578784=_0x507900[_0x59ec('0x3d')];if(!_0x56071b[_0x59ec('0x38')]['hasOwnProperty'](_0x59ec('0x3f'))){_0x5bfb1b['limit']=qs[_0x59ec('0x29')](_0x56071b[_0x59ec('0x38')][_0x59ec('0x29')]);_0x5bfb1b[_0x59ec('0x28')]=qs[_0x59ec('0x28')](_0x56071b[_0x59ec('0x38')][_0x59ec('0x28')]);}return _0x1b8551[_0x59ec('0x57')](_0x5bfb1b);}})[_0x59ec('0x30')](function(_0x15a498){if(_0x15a498){return _0x15a498?{'count':_0x578784,'rows':_0x15a498}:null;}})['then'](respondWithResult(_0x4ed931,null))[_0x59ec('0x23')](handleError(_0x4ed931,null));};exports[_0x59ec('0x58')]=function(_0x3c4e47,_0x56c843,_0x5b6859){if(_0x3c4e47[_0x59ec('0x52')]['id']){delete _0x3c4e47[_0x59ec('0x52')]['id'];}return db[_0x59ec('0x4b')]['findOne']({'where':{'id':_0x3c4e47[_0x59ec('0x4e')]['id']}})['then'](handleEntityNotFound(_0x56c843,null))[_0x59ec('0x30')](function(_0x2c7666){if(_0x2c7666){_0x3c4e47[_0x59ec('0x52')][_0x59ec('0x59')]=_0x2c7666['id'];_0x3c4e47[_0x59ec('0x52')][_0x59ec('0x5a')]=integrations[_0x59ec('0x5b')](_0x3c4e47['body'][_0x59ec('0x5c')],_0x3c4e47['body'][_0x59ec('0x5d')]);_0x3c4e47['body'][_0x59ec('0x5e')]=integrations['getDescriptions'](_0x3c4e47[_0x59ec('0x52')][_0x59ec('0x5c')],_0x3c4e47['body']['type']);return db[_0x59ec('0x55')][_0x59ec('0x51')](_0x3c4e47['body'],{'include':[{'model':db[_0x59ec('0x5f')],'as':_0x59ec('0x5a')},{'model':db[_0x59ec('0x5f')],'as':'Descriptions'}]});}return null;})[_0x59ec('0x30')](respondWithResult(_0x56c843,null))[_0x59ec('0x23')](handleError(_0x56c843,null));};exports[_0x59ec('0x60')]=function(_0x3132e2,_0x53676a,_0xfa03f){var _0x55fa8b;return db[_0x59ec('0x4b')][_0x59ec('0x54')]({'where':{'id':_0x3132e2[_0x59ec('0x4e')]['id']},'attributes':['id',_0x59ec('0x61'),_0x59ec('0x62'),_0x59ec('0x63'),_0x59ec('0x64'),'password',_0x59ec('0x65')]})[_0x59ec('0x30')](handleEntityNotFound(_0x53676a,null))[_0x59ec('0x30')](function(_0x260c23){if(_0x260c23){_0x55fa8b=new jsforce[(_0x59ec('0x66'))]({'oauth2':{'loginUrl':_0x260c23[_0x59ec('0x61')],'clientId':_0x260c23[_0x59ec('0x62')],'clientSecret':_0x260c23['clientSecret']}});return _0x55fa8b[_0x59ec('0x67')](_0x260c23[_0x59ec('0x64')],_0x260c23[_0x59ec('0x68')][_0x59ec('0x69')](_0x260c23['securityToken']));}})[_0x59ec('0x30')](function(_0x42f3f2){if(_0x42f3f2){return _0x55fa8b[_0x59ec('0x6a')]('Task')['describe']();}})[_0x59ec('0x30')](function(_0xd0ac32){var _0x7acd88=[_0x59ec('0x6b'),_0x59ec('0x6c'),_0x59ec('0x6d'),'CallType','IsArchived','Priority',_0x59ec('0x6e'),_0x59ec('0x6f')];if(_0xd0ac32){_[_0x59ec('0x70')](_0xd0ac32[_0x59ec('0x3c')],function(_0xd7accf){return _0xd7accf[_0x59ec('0x71')]===![]&&!_0x7acd88['includes'](_0xd7accf['name']);});return{'count':_0xd0ac32[_0x59ec('0x3c')][_0x59ec('0x3d')],'rows':_['map'](_0xd0ac32[_0x59ec('0x3c')],function(_0x367cb2){return{'id':_0x367cb2['name'],'name':_0x367cb2['label'],'custom':_0x367cb2[_0x59ec('0x71')],'options':_0x367cb2[_0x59ec('0x72')]?_[_0x59ec('0x56')](_0x367cb2[_0x59ec('0x72')],function(_0x3e2311){return{'name':_0x3e2311[_0x59ec('0x73')],'value':_0x3e2311['value']};}):[]};})};}})[_0x59ec('0x30')](respondWithResult(_0x53676a,null))[_0x59ec('0x23')](function(_0x50b036){var _0x35757a=_0x3132e2['query'][_0x59ec('0x74')]?0x1f4:_0x50b036[_0x59ec('0x75')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x59ec('0x60'),_0x35757a,JSON[_0x59ec('0x76')](_0x50b036));delete _0x50b036[_0x59ec('0x33')];if(_0x35757a===0x191){_0x35757a=0x190;}_0x53676a['status'](_0x35757a)['send'](_0x3132e2[_0x59ec('0x38')][_0x59ec('0x74')]?{'message':_0x59ec('0x77'),'statusCode':_0x50b036['statusCode']}:_0x50b036);});};
\ No newline at end of file
+var _0xa192=['add','day','merge','filter','map','SalesforceAccount','includeAll','findAll','catch','show','include','find','create','body','params','getConfigurations','findOne','pick','options','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','channel','type','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','Connection','login','password','concat','securityToken','sobject','describe','CallDisposition','CallDurationInSeconds','CallObject','Priority','Status','Type','remove','custom','includes','label','picklistValues','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','end','stack','name','index','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','order','sort','where'];(function(_0x5a3081,_0x5c8e96){var _0x4c3449=function(_0x5ca5e5){while(--_0x5ca5e5){_0x5a3081['push'](_0x5a3081['shift']());}};_0x4c3449(++_0x5c8e96);}(_0xa192,0xb4));var _0x2a19=function(_0xe18f5,_0x3e9953){_0xe18f5=_0xe18f5-0x0;var _0x2e9ae1=_0xa192[_0xe18f5];return _0x2e9ae1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2a19('0x0'));var rimraf=require(_0x2a19('0x1'));var zipdir=require(_0x2a19('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2a19('0x3'));var moment=require(_0x2a19('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2a19('0x5'));var util=require(_0x2a19('0x6'));var path=require(_0x2a19('0x7'));var sox=require(_0x2a19('0x8'));var csv=require(_0x2a19('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2a19('0xa'));var squel=require(_0x2a19('0xb'));var crypto=require(_0x2a19('0xc'));var jsforce=require(_0x2a19('0xd'));var deskjs=require(_0x2a19('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2a19('0xf'));var Papa=require(_0x2a19('0x10'));var qs=require(_0x2a19('0x11'));var logger=require('../../config/logger')(_0x2a19('0x12'));var utils=require('../../config/utils');var config=require(_0x2a19('0x13'));var db=require(_0x2a19('0x14'))['db'];var integrations=require(_0x2a19('0x15'));var jayson=require(_0x2a19('0x16'));var client=jayson[_0x2a19('0x17')][_0x2a19('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x1aa0d5,_0x21db88,_0x43f5cc,_0x1a4704){return new BPromise(function(_0x1b6818,_0x43fc82){var _0x1a37e7=_0x1a4704||client;return _0x1a37e7[_0x2a19('0x19')](_0x1aa0d5,_0x43f5cc)[_0x2a19('0x1a')](function(_0x2b7edf){logger[_0x2a19('0x1b')](_0x2a19('0x1c'),_0x21db88,'request\x20sent');logger[_0x2a19('0x1d')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x21db88,_0x2a19('0x1e'),JSON[_0x2a19('0x1f')](_0x2b7edf));if(_0x2b7edf[_0x2a19('0x20')]){if(_0x2b7edf[_0x2a19('0x20')][_0x2a19('0x21')]===0x1f4){logger[_0x2a19('0x20')](_0x2a19('0x1c'),_0x21db88,_0x2b7edf[_0x2a19('0x20')][_0x2a19('0x22')]);return _0x43fc82(_0x2b7edf['error'][_0x2a19('0x22')]);}logger[_0x2a19('0x20')](_0x2a19('0x1c'),_0x21db88,_0x2b7edf[_0x2a19('0x20')][_0x2a19('0x22')]);return _0x1b6818(_0x2b7edf[_0x2a19('0x20')][_0x2a19('0x22')]);}else{logger['info'](_0x2a19('0x1c'),_0x21db88,_0x2a19('0x1e'));_0x1b6818(_0x2b7edf[_0x2a19('0x23')][_0x2a19('0x22')]);}})['catch'](function(_0x1f97f9){logger[_0x2a19('0x20')](_0x2a19('0x1c'),_0x21db88,_0x1f97f9);_0x43fc82(_0x1f97f9);});});}function respondWithStatusCode(_0x383252,_0x29bce0){_0x29bce0=_0x29bce0||0xcc;return function(_0x2ab6f0){if(_0x2ab6f0){return _0x383252[_0x2a19('0x24')](_0x29bce0);}return _0x383252[_0x2a19('0x25')](_0x29bce0)['end']();};}function respondWithResult(_0x255b87,_0x4d89ee){_0x4d89ee=_0x4d89ee||0xc8;return function(_0x5c19ff){if(_0x5c19ff){return _0x255b87[_0x2a19('0x25')](_0x4d89ee)[_0x2a19('0x26')](_0x5c19ff);}};}function respondWithFilteredResult(_0x5414e1,_0xa4498c){return function(_0x982391){if(_0x982391){var _0x27a7eb=_0x982391[_0x2a19('0x27')],_0x4b2a20=_0xa4498c[_0x2a19('0x28')],_0x5e322c=_0xa4498c[_0x2a19('0x28')]+_0xa4498c[_0x2a19('0x29')],_0x344c17;if(_0x5e322c>=_0x27a7eb){_0x5e322c=_0x27a7eb;_0x344c17=0xc8;}else{_0x344c17=0xce;}_0x5414e1[_0x2a19('0x25')](_0x344c17);return _0x5414e1[_0x2a19('0x2a')](_0x2a19('0x2b'),_0x4b2a20+'-'+_0x5e322c+'/'+_0x27a7eb)[_0x2a19('0x26')](_0x982391);}return null;};}function patchUpdates(_0x321517){return function(_0x1e6990){try{jsonpatch[_0x2a19('0x2c')](_0x1e6990,_0x321517,!![]);}catch(_0x45435f){return BPromise[_0x2a19('0x2d')](_0x45435f);}return _0x1e6990['save']();};}function saveUpdates(_0x3d9033,_0x1aa18d){return function(_0x1f706a){if(_0x1f706a){return _0x1f706a[_0x2a19('0x2e')](_0x3d9033)[_0x2a19('0x1a')](function(_0x55a163){return _0x55a163;});}return null;};}function removeEntity(_0x106d50,_0xba163f){return function(_0x375451){if(_0x375451){return _0x375451[_0x2a19('0x2f')]()[_0x2a19('0x1a')](function(){_0x106d50['status'](0xcc)[_0x2a19('0x30')]();});}};}function handleEntityNotFound(_0x1d0427,_0x30f1d4){return function(_0x223cf6){if(!_0x223cf6){_0x1d0427[_0x2a19('0x24')](0x194);}return _0x223cf6;};}function handleError(_0x4da286,_0x28569c){_0x28569c=_0x28569c||0x1f4;return function(_0x4303bc){logger[_0x2a19('0x20')](_0x4303bc[_0x2a19('0x31')]);if(_0x4303bc['name']){delete _0x4303bc[_0x2a19('0x32')];}_0x4da286[_0x2a19('0x25')](_0x28569c)['send'](_0x4303bc);};}exports[_0x2a19('0x33')]=function(_0x49eeed,_0x24156e){var _0x5ecd42={},_0x60dd4={},_0x22df85={'count':0x0,'rows':[]};var _0x320ee4=db['SalesforceAccount'][_0x2a19('0x34')];_0x60dd4[_0x2a19('0x35')]=_[_0x2a19('0x36')](_0x320ee4);var _0x2ca03b={'dateStart':_0x49eeed[_0x2a19('0x37')][_0x2a19('0x38')],'dateEnd':_0x49eeed[_0x2a19('0x37')][_0x2a19('0x39')]};delete _0x49eeed[_0x2a19('0x37')][_0x2a19('0x38')];delete _0x49eeed[_0x2a19('0x37')][_0x2a19('0x39')];_0x60dd4[_0x2a19('0x37')]=_[_0x2a19('0x36')](_0x49eeed[_0x2a19('0x37')]);_0x60dd4[_0x2a19('0x3a')]=_[_0x2a19('0x3b')](_0x60dd4['model'],_0x60dd4[_0x2a19('0x37')]);_0x5ecd42[_0x2a19('0x3c')]=_[_0x2a19('0x3b')](_0x60dd4[_0x2a19('0x35')],qs['fields'](_0x49eeed[_0x2a19('0x37')][_0x2a19('0x3d')]));_0x5ecd42[_0x2a19('0x3c')]=_0x5ecd42['attributes'][_0x2a19('0x3e')]?_0x5ecd42[_0x2a19('0x3c')]:_0x60dd4[_0x2a19('0x35')];if(!_0x49eeed['query']['hasOwnProperty']('nolimit')){_0x5ecd42['limit']=qs[_0x2a19('0x29')](_0x49eeed[_0x2a19('0x37')][_0x2a19('0x29')]);_0x5ecd42[_0x2a19('0x28')]=qs[_0x2a19('0x28')](_0x49eeed['query']['offset']);}_0x5ecd42[_0x2a19('0x3f')]=qs[_0x2a19('0x40')](_0x49eeed[_0x2a19('0x37')][_0x2a19('0x40')]);_0x5ecd42[_0x2a19('0x41')]=qs[_0x2a19('0x3a')](_['pick'](_0x49eeed[_0x2a19('0x37')],_0x60dd4['filters']));if(_0x2ca03b[_0x2a19('0x38')]){if(_0x2ca03b['dateEnd']){_0x2ca03b[_0x2a19('0x39')]=moment(_0x2ca03b[_0x2a19('0x39')])[_0x2a19('0x42')](0x1,'day');}else{_0x2ca03b[_0x2a19('0x39')]=moment(_0x2ca03b[_0x2a19('0x38')])['add'](0x1,_0x2a19('0x43'));}_[_0x2a19('0x44')](_0x5ecd42[_0x2a19('0x41')],{'createdAt':{'$gte':_0x2ca03b[_0x2a19('0x38')],'$lte':_0x2ca03b[_0x2a19('0x39')]}});}if(_0x49eeed[_0x2a19('0x37')][_0x2a19('0x45')]){_0x5ecd42[_0x2a19('0x41')]=_[_0x2a19('0x44')](_0x5ecd42[_0x2a19('0x41')],{'$or':_[_0x2a19('0x46')](_0x5ecd42[_0x2a19('0x3c')],function(_0x57e3d3){var _0x31d7bb={};_0x31d7bb[_0x57e3d3]={'$like':'%'+_0x49eeed[_0x2a19('0x37')][_0x2a19('0x45')]+'%'};return _0x31d7bb;})});}_0x5ecd42=_['merge']({},_0x5ecd42,_0x49eeed['options']);var _0x4d0d26={'where':_0x5ecd42[_0x2a19('0x41')]};return db[_0x2a19('0x47')][_0x2a19('0x27')](_0x4d0d26)['then'](function(_0x3ef98f){_0x22df85[_0x2a19('0x27')]=_0x3ef98f;if(_0x49eeed[_0x2a19('0x37')][_0x2a19('0x48')]){_0x5ecd42['include']=[{'all':!![]}];}return db[_0x2a19('0x47')][_0x2a19('0x49')](_0x5ecd42);})[_0x2a19('0x1a')](function(_0x294c6a){_0x22df85['rows']=_0x294c6a;return _0x22df85;})[_0x2a19('0x1a')](respondWithFilteredResult(_0x24156e,_0x5ecd42))[_0x2a19('0x4a')](handleError(_0x24156e,null));};exports[_0x2a19('0x4b')]=function(_0x428829,_0x2d0ef5){var _0x1e8508={'raw':![],'where':{'id':_0x428829['params']['id']}},_0x3d1d32={};_0x3d1d32[_0x2a19('0x35')]=_['keys'](db[_0x2a19('0x47')][_0x2a19('0x34')]);_0x3d1d32['query']=_[_0x2a19('0x36')](_0x428829['query']);_0x3d1d32[_0x2a19('0x3a')]=_[_0x2a19('0x3b')](_0x3d1d32[_0x2a19('0x35')],_0x3d1d32[_0x2a19('0x37')]);_0x1e8508[_0x2a19('0x3c')]=_[_0x2a19('0x3b')](_0x3d1d32[_0x2a19('0x35')],qs['fields'](_0x428829[_0x2a19('0x37')][_0x2a19('0x3d')]));_0x1e8508[_0x2a19('0x3c')]=_0x1e8508[_0x2a19('0x3c')][_0x2a19('0x3e')]?_0x1e8508[_0x2a19('0x3c')]:_0x3d1d32[_0x2a19('0x35')];if(_0x428829['query'][_0x2a19('0x48')]){_0x1e8508[_0x2a19('0x4c')]=[{'all':!![]}];}_0x1e8508=_[_0x2a19('0x44')]({},_0x1e8508,_0x428829['options']);return db[_0x2a19('0x47')][_0x2a19('0x4d')](_0x1e8508)[_0x2a19('0x1a')](handleEntityNotFound(_0x2d0ef5,null))[_0x2a19('0x1a')](respondWithResult(_0x2d0ef5,null))[_0x2a19('0x4a')](handleError(_0x2d0ef5,null));};exports[_0x2a19('0x4e')]=function(_0x27172e,_0x36db4d){return db[_0x2a19('0x47')][_0x2a19('0x4e')](_0x27172e[_0x2a19('0x4f')],{})[_0x2a19('0x1a')](respondWithResult(_0x36db4d,0xc9))[_0x2a19('0x4a')](handleError(_0x36db4d,null));};exports[_0x2a19('0x2e')]=function(_0x1a745f,_0x2a8ba8){if(_0x1a745f[_0x2a19('0x4f')]['id']){delete _0x1a745f[_0x2a19('0x4f')]['id'];}return db[_0x2a19('0x47')][_0x2a19('0x4d')]({'where':{'id':_0x1a745f[_0x2a19('0x50')]['id']}})[_0x2a19('0x1a')](handleEntityNotFound(_0x2a8ba8,null))[_0x2a19('0x1a')](saveUpdates(_0x1a745f[_0x2a19('0x4f')],null))['then'](respondWithResult(_0x2a8ba8,null))[_0x2a19('0x4a')](handleError(_0x2a8ba8,null));};exports[_0x2a19('0x2f')]=function(_0x2e976a,_0x4af90d){return db[_0x2a19('0x47')][_0x2a19('0x4d')]({'where':{'id':_0x2e976a[_0x2a19('0x50')]['id']}})[_0x2a19('0x1a')](handleEntityNotFound(_0x4af90d,null))[_0x2a19('0x1a')](removeEntity(_0x4af90d,null))[_0x2a19('0x4a')](handleError(_0x4af90d,null));};exports[_0x2a19('0x51')]=function(_0x36a12,_0x5b06a4,_0x5a5328){var _0x2bff66={};var _0x2b46a4={};var _0x238caa;var _0x17b5ab;return db[_0x2a19('0x47')][_0x2a19('0x52')]({'where':{'id':_0x36a12['params']['id']}})[_0x2a19('0x1a')](handleEntityNotFound(_0x5b06a4,null))[_0x2a19('0x1a')](function(_0x2c3efb){if(_0x2c3efb){_0x238caa=_0x2c3efb;_0x2b46a4[_0x2a19('0x35')]=_['keys'](db['SalesforceConfiguration'][_0x2a19('0x34')]);_0x2b46a4[_0x2a19('0x37')]=_[_0x2a19('0x36')](_0x36a12[_0x2a19('0x37')]);_0x2b46a4[_0x2a19('0x3a')]=_[_0x2a19('0x3b')](_0x2b46a4[_0x2a19('0x35')],_0x2b46a4[_0x2a19('0x37')]);_0x2bff66[_0x2a19('0x3c')]=_[_0x2a19('0x3b')](_0x2b46a4['model'],qs[_0x2a19('0x3d')](_0x36a12[_0x2a19('0x37')][_0x2a19('0x3d')]));_0x2bff66['attributes']=_0x2bff66[_0x2a19('0x3c')]['length']?_0x2bff66[_0x2a19('0x3c')]:_0x2b46a4[_0x2a19('0x35')];_0x2bff66[_0x2a19('0x3f')]=qs['sort'](_0x36a12[_0x2a19('0x37')][_0x2a19('0x40')]);_0x2bff66[_0x2a19('0x41')]=qs['filters'](_[_0x2a19('0x53')](_0x36a12[_0x2a19('0x37')],_0x2b46a4['filters']));if(_0x36a12[_0x2a19('0x37')][_0x2a19('0x45')]){_0x2bff66['where']=_['merge'](_0x2bff66[_0x2a19('0x41')],{'$or':_[_0x2a19('0x46')](_0x2bff66['attributes'],function(_0x4384f6){var _0x4e4bac={};_0x4e4bac[_0x4384f6]={'$like':'%'+_0x36a12[_0x2a19('0x37')][_0x2a19('0x45')]+'%'};return _0x4e4bac;})});}_0x2bff66=_['merge']({},_0x2bff66,_0x36a12[_0x2a19('0x54')]);return _0x238caa['getConfigurations'](_0x2bff66);}})[_0x2a19('0x1a')](function(_0x174f1b){if(_0x174f1b){_0x17b5ab=_0x174f1b[_0x2a19('0x3e')];if(!_0x36a12['query'][_0x2a19('0x55')](_0x2a19('0x56'))){_0x2bff66[_0x2a19('0x29')]=qs[_0x2a19('0x29')](_0x36a12[_0x2a19('0x37')][_0x2a19('0x29')]);_0x2bff66[_0x2a19('0x28')]=qs[_0x2a19('0x28')](_0x36a12[_0x2a19('0x37')]['offset']);}return _0x238caa[_0x2a19('0x51')](_0x2bff66);}})[_0x2a19('0x1a')](function(_0x25fac1){if(_0x25fac1){return _0x25fac1?{'count':_0x17b5ab,'rows':_0x25fac1}:null;}})[_0x2a19('0x1a')](respondWithResult(_0x5b06a4,null))[_0x2a19('0x4a')](handleError(_0x5b06a4,null));};exports[_0x2a19('0x57')]=function(_0x5789e1,_0x307785,_0x29aaad){if(_0x5789e1['body']['id']){delete _0x5789e1['body']['id'];}return db['SalesforceAccount'][_0x2a19('0x52')]({'where':{'id':_0x5789e1[_0x2a19('0x50')]['id']}})[_0x2a19('0x1a')](handleEntityNotFound(_0x307785,null))[_0x2a19('0x1a')](function(_0x5f786e){if(_0x5f786e){_0x5789e1[_0x2a19('0x4f')][_0x2a19('0x58')]=_0x5f786e['id'];_0x5789e1['body'][_0x2a19('0x59')]=integrations['getSubjects'](_0x5789e1['body'][_0x2a19('0x5a')],_0x5789e1[_0x2a19('0x4f')][_0x2a19('0x5b')]);_0x5789e1[_0x2a19('0x4f')][_0x2a19('0x5c')]=integrations[_0x2a19('0x5d')](_0x5789e1[_0x2a19('0x4f')][_0x2a19('0x5a')],_0x5789e1[_0x2a19('0x4f')][_0x2a19('0x5b')]);return db[_0x2a19('0x5e')]['create'](_0x5789e1['body'],{'include':[{'model':db[_0x2a19('0x5f')],'as':_0x2a19('0x59')},{'model':db['SalesforceField'],'as':_0x2a19('0x5c')}]});}return null;})[_0x2a19('0x1a')](respondWithResult(_0x307785,null))[_0x2a19('0x4a')](handleError(_0x307785,null));};exports[_0x2a19('0x60')]=function(_0x4d1154,_0x59a0f7,_0x57a1f5){var _0x4ef8bc;return db[_0x2a19('0x47')][_0x2a19('0x52')]({'where':{'id':_0x4d1154[_0x2a19('0x50')]['id']},'attributes':['id',_0x2a19('0x61'),_0x2a19('0x62'),_0x2a19('0x63'),_0x2a19('0x64'),'password','securityToken']})['then'](handleEntityNotFound(_0x59a0f7,null))[_0x2a19('0x1a')](function(_0x1e1ed3){if(_0x1e1ed3){_0x4ef8bc=new jsforce[(_0x2a19('0x65'))]({'oauth2':{'loginUrl':_0x1e1ed3['remoteUri'],'clientId':_0x1e1ed3['clientId'],'clientSecret':_0x1e1ed3['clientSecret']}});return _0x4ef8bc[_0x2a19('0x66')](_0x1e1ed3['username'],_0x1e1ed3[_0x2a19('0x67')][_0x2a19('0x68')](_0x1e1ed3[_0x2a19('0x69')]));}})[_0x2a19('0x1a')](function(_0x468b7f){if(_0x468b7f){return _0x4ef8bc[_0x2a19('0x6a')]('Task')[_0x2a19('0x6b')]();}})['then'](function(_0x4150d4){var _0xa9f6c5=[_0x2a19('0x6c'),_0x2a19('0x6d'),_0x2a19('0x6e'),'CallType','IsArchived',_0x2a19('0x6f'),_0x2a19('0x70'),_0x2a19('0x71')];if(_0x4150d4){_[_0x2a19('0x72')](_0x4150d4[_0x2a19('0x3d')],function(_0x48615f){return _0x48615f[_0x2a19('0x73')]===![]&&!_0xa9f6c5[_0x2a19('0x74')](_0x48615f['name']);});return{'count':_0x4150d4[_0x2a19('0x3d')]['length'],'rows':_[_0x2a19('0x46')](_0x4150d4['fields'],function(_0x159ee4){return{'id':_0x159ee4[_0x2a19('0x32')],'name':_0x159ee4[_0x2a19('0x75')],'custom':_0x159ee4[_0x2a19('0x73')],'options':_0x159ee4[_0x2a19('0x76')]?_[_0x2a19('0x46')](_0x159ee4[_0x2a19('0x76')],function(_0xd6db23){return{'name':_0xd6db23[_0x2a19('0x75')],'value':_0xd6db23['value']};}):[]};})};}})[_0x2a19('0x1a')](respondWithResult(_0x59a0f7,null))[_0x2a19('0x4a')](function(_0x5be7f0){var _0x1e07ea=_0x4d1154[_0x2a19('0x37')][_0x2a19('0x77')]?0x1f4:_0x5be7f0[_0x2a19('0x78')]||0x1f4;logger[_0x2a19('0x20')](_0x2a19('0x79'),'getFields',_0x1e07ea,JSON[_0x2a19('0x1f')](_0x5be7f0));delete _0x5be7f0[_0x2a19('0x32')];if(_0x1e07ea===0x191){_0x1e07ea=0x190;}_0x59a0f7['status'](_0x1e07ea)[_0x2a19('0x7a')](_0x4d1154['query'][_0x2a19('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x5be7f0[_0x2a19('0x78')]}:_0x5be7f0);});};
\ No newline at end of file
index f5c812b..3f29539 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7ca=['api','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger'];(function(_0x24b5ec,_0x2bca78){var _0x530752=function(_0x2dc753){while(--_0x2dc753){_0x24b5ec['push'](_0x24b5ec['shift']());}};_0x530752(++_0x2bca78);}(_0xb7ca,0x1ae));var _0xab7c=function(_0x1c3442,_0x1e560f){_0x1c3442=_0x1c3442-0x0;var _0x44e088=_0xb7ca[_0x1c3442];return _0x44e088;};'use strict';var _=require('lodash');var util=require(_0xab7c('0x0'));var logger=require(_0xab7c('0x1'))(_0xab7c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xab7c('0x3'));var integrations=require(_0xab7c('0x4'));module[_0xab7c('0x5')]=function(_0x43e81c,_0x5ad702){return _0x43e81c[_0xab7c('0x6')](_0xab7c('0x7'),attributes,{'tableName':_0xab7c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xab03=['SalesforceAccount','int_salesforce_accounts','lodash','api','bluebird','request-promise','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x284870,_0x1c5dd2){var _0x1ff454=function(_0x3018f9){while(--_0x3018f9){_0x284870['push'](_0x284870['shift']());}};_0x1ff454(++_0x1c5dd2);}(_0xab03,0xca));var _0x3ab0=function(_0x28529c,_0x4aeb66){_0x28529c=_0x28529c-0x0;var _0x283a96=_0xab03[_0x28529c];return _0x283a96;};'use strict';var _=require(_0x3ab0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3ab0('0x1'));var moment=require('moment');var BPromise=require(_0x3ab0('0x2'));var rp=require(_0x3ab0('0x3'));var attributes=require(_0x3ab0('0x4'));var integrations=require(_0x3ab0('0x5'));module['exports']=function(_0x316ea2,_0xc167bb){return _0x316ea2['define'](_0x3ab0('0x6'),attributes,{'tableName':_0x3ab0('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ed891ee..672e799 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x097f=['info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetSalesforceAccount','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowSalesforceAccount','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x097f,0xf5));var _0xf097=function(_0x330d1f,_0x47c710){_0x330d1f=_0x330d1f-0x0;var _0x1df784=_0x097f[_0x330d1f];return _0x1df784;};'use strict';var _=require(_0xf097('0x0'));var util=require(_0xf097('0x1'));var moment=require(_0xf097('0x2'));var BPromise=require(_0xf097('0x3'));var rs=require('randomstring');var fs=require('fs');var db=require(_0xf097('0x4'))['db'];var utils=require(_0xf097('0x5'));var logger=require(_0xf097('0x6'))(_0xf097('0x7'));var config=require('../../config/environment');var jayson=require(_0xf097('0x8'));var client=jayson['client'][_0xf097('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eb9d7,_0x565a0a,_0x2bf4a8){return new BPromise(function(_0x499d1b,_0x32bbba){return client['request'](_0x5eb9d7,_0x2bf4a8)[_0xf097('0xa')](function(_0x33e5a9){logger[_0xf097('0xb')](_0xf097('0xc'),_0x565a0a,'request\x20sent');logger[_0xf097('0xd')](_0xf097('0xe'),_0x565a0a,_0xf097('0xf'),JSON['stringify'](_0x33e5a9));if(_0x33e5a9['error']){if(_0x33e5a9['error']['code']===0x1f4){logger[_0xf097('0x10')](_0xf097('0xc'),_0x565a0a,_0x33e5a9['error'][_0xf097('0x11')]);return _0x32bbba(_0x33e5a9[_0xf097('0x10')]['message']);}logger['error'](_0xf097('0xc'),_0x565a0a,_0x33e5a9['error'][_0xf097('0x11')]);return _0x499d1b(_0x33e5a9[_0xf097('0x10')][_0xf097('0x11')]);}else{logger[_0xf097('0xb')](_0xf097('0xc'),_0x565a0a,_0xf097('0xf'));_0x499d1b(_0x33e5a9[_0xf097('0x12')][_0xf097('0x11')]);}})[_0xf097('0x13')](function(_0x352622){logger['error'](_0xf097('0xc'),_0x565a0a,_0x352622);_0x32bbba(_0x352622);});});}exports[_0xf097('0x14')]=function(_0x17577){var _0x20cdfa=this;return new Promise(function(_0x12cca8,_0x5c76b7){return db['SalesforceAccount']['findAll']({'raw':_0x17577[_0xf097('0x15')]?_0x17577['options'][_0xf097('0x16')]===undefined?!![]:![]:!![],'where':_0x17577[_0xf097('0x15')]?_0x17577[_0xf097('0x15')][_0xf097('0x17')]||null:null,'attributes':_0x17577[_0xf097('0x15')]?_0x17577['options'][_0xf097('0x18')]||null:null,'limit':_0x17577[_0xf097('0x15')]?_0x17577[_0xf097('0x15')][_0xf097('0x19')]||null:null,'include':_0x17577[_0xf097('0x15')]?_0x17577[_0xf097('0x15')][_0xf097('0x1a')]?_['map'](_0x17577[_0xf097('0x15')][_0xf097('0x1a')],function(_0x517fd2){return{'model':db[_0x517fd2['model']],'as':_0x517fd2['as'],'attributes':_0x517fd2['attributes'],'include':_0x517fd2[_0xf097('0x1a')]?_[_0xf097('0x1b')](_0x517fd2['include'],function(_0x23164e){return{'model':db[_0x23164e[_0xf097('0x1c')]],'as':_0x23164e['as'],'attributes':_0x23164e[_0xf097('0x18')],'include':_0x23164e[_0xf097('0x1a')]?_[_0xf097('0x1b')](_0x23164e[_0xf097('0x1a')],function(_0x15ac79){return{'model':db[_0x15ac79[_0xf097('0x1c')]],'as':_0x15ac79['as'],'attributes':_0x15ac79[_0xf097('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f8e75){logger[_0xf097('0xb')](_0xf097('0x14'),_0x17577);logger['debug']('GetSalesforceAccount',_0x17577,JSON[_0xf097('0x1d')](_0x1f8e75));_0x12cca8(_0x1f8e75);})[_0xf097('0x13')](function(_0x806595){logger[_0xf097('0x10')](_0xf097('0x14'),_0x806595[_0xf097('0x11')],_0x17577);_0x5c76b7(_0x20cdfa[_0xf097('0x10')](0x1f4,_0x806595[_0xf097('0x11')]));});});};exports['ShowSalesforceAccount']=function(_0x119247){var _0x13297f=this;return new Promise(function(_0x369161,_0x375ab5){return db['SalesforceAccount'][_0xf097('0x1e')]({'raw':_0x119247[_0xf097('0x15')]?_0x119247[_0xf097('0x15')][_0xf097('0x16')]===undefined?!![]:![]:!![],'where':_0x119247[_0xf097('0x15')]?_0x119247[_0xf097('0x15')][_0xf097('0x17')]||null:null,'attributes':_0x119247['options']?_0x119247[_0xf097('0x15')][_0xf097('0x18')]||null:null,'include':_0x119247[_0xf097('0x15')]?_0x119247['options'][_0xf097('0x1a')]?_[_0xf097('0x1b')](_0x119247[_0xf097('0x15')][_0xf097('0x1a')],function(_0x1a6a8b){return{'model':db[_0x1a6a8b[_0xf097('0x1c')]],'as':_0x1a6a8b['as'],'attributes':_0x1a6a8b[_0xf097('0x18')],'include':_0x1a6a8b[_0xf097('0x1a')]?_[_0xf097('0x1b')](_0x1a6a8b[_0xf097('0x1a')],function(_0x104370){return{'model':db[_0x104370[_0xf097('0x1c')]],'as':_0x104370['as'],'attributes':_0x104370[_0xf097('0x18')],'include':_0x104370[_0xf097('0x1a')]?_[_0xf097('0x1b')](_0x104370[_0xf097('0x1a')],function(_0x48d9a4){return{'model':db[_0x48d9a4[_0xf097('0x1c')]],'as':_0x48d9a4['as'],'attributes':_0x48d9a4['attributes']};}):[]};}):[]};}):[]:[]})[_0xf097('0xa')](function(_0x3941d3){logger['info'](_0xf097('0x1f'),_0x119247);logger[_0xf097('0xd')]('ShowSalesforceAccount',_0x119247,JSON['stringify'](_0x3941d3));_0x369161(_0x3941d3);})['catch'](function(_0x4385d5){logger[_0xf097('0x10')](_0xf097('0x1f'),_0x4385d5[_0xf097('0x11')],_0x119247);_0x375ab5(_0x13297f[_0xf097('0x10')](0x1f4,_0x4385d5[_0xf097('0x11')]));});});};
\ No newline at end of file
+var _0xa280=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','SalesforceAccount,\x20%s,\x20%s','message','result','catch','GetSalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowSalesforceAccount','SalesforceAccount','find','lodash'];(function(_0x3ab0f1,_0x31acba){var _0x2c2fb8=function(_0x5da5c4){while(--_0x5da5c4){_0x3ab0f1['push'](_0x3ab0f1['shift']());}};_0x2c2fb8(++_0x31acba);}(_0xa280,0x65));var _0x0a28=function(_0xecdc8,_0x37baa2){_0xecdc8=_0xecdc8-0x0;var _0x494fab=_0xa280[_0xecdc8];return _0x494fab;};'use strict';var _=require(_0x0a28('0x0'));var util=require(_0x0a28('0x1'));var moment=require(_0x0a28('0x2'));var BPromise=require(_0x0a28('0x3'));var rs=require(_0x0a28('0x4'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x0a28('0x5'));var logger=require(_0x0a28('0x6'))(_0x0a28('0x7'));var config=require('../../config/environment');var jayson=require(_0x0a28('0x8'));var client=jayson['client'][_0x0a28('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x271342,_0x2ab54e,_0x151b21){return new BPromise(function(_0x4bc33e,_0x5d67ef){return client[_0x0a28('0xa')](_0x271342,_0x151b21)[_0x0a28('0xb')](function(_0xe4dbf9){logger[_0x0a28('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x2ab54e,_0x0a28('0xd'));logger[_0x0a28('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x2ab54e,_0x0a28('0xd'),JSON[_0x0a28('0xf')](_0xe4dbf9));if(_0xe4dbf9[_0x0a28('0x10')]){if(_0xe4dbf9[_0x0a28('0x10')]['code']===0x1f4){logger[_0x0a28('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x2ab54e,_0xe4dbf9[_0x0a28('0x10')]['message']);return _0x5d67ef(_0xe4dbf9[_0x0a28('0x10')]['message']);}logger[_0x0a28('0x10')](_0x0a28('0x11'),_0x2ab54e,_0xe4dbf9[_0x0a28('0x10')]['message']);return _0x4bc33e(_0xe4dbf9[_0x0a28('0x10')][_0x0a28('0x12')]);}else{logger[_0x0a28('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x2ab54e,'request\x20sent');_0x4bc33e(_0xe4dbf9[_0x0a28('0x13')][_0x0a28('0x12')]);}})[_0x0a28('0x14')](function(_0x5a89dc){logger[_0x0a28('0x10')](_0x0a28('0x11'),_0x2ab54e,_0x5a89dc);_0x5d67ef(_0x5a89dc);});});}exports[_0x0a28('0x15')]=function(_0x23b88d){var _0x353da9=this;return new Promise(function(_0x52ce66,_0x315bed){return db['SalesforceAccount'][_0x0a28('0x16')]({'raw':_0x23b88d[_0x0a28('0x17')]?_0x23b88d['options'][_0x0a28('0x18')]===undefined?!![]:![]:!![],'where':_0x23b88d['options']?_0x23b88d[_0x0a28('0x17')][_0x0a28('0x19')]||null:null,'attributes':_0x23b88d[_0x0a28('0x17')]?_0x23b88d[_0x0a28('0x17')][_0x0a28('0x1a')]||null:null,'limit':_0x23b88d[_0x0a28('0x17')]?_0x23b88d[_0x0a28('0x17')][_0x0a28('0x1b')]||null:null,'include':_0x23b88d[_0x0a28('0x17')]?_0x23b88d[_0x0a28('0x17')][_0x0a28('0x1c')]?_['map'](_0x23b88d[_0x0a28('0x17')][_0x0a28('0x1c')],function(_0x594713){return{'model':db[_0x594713['model']],'as':_0x594713['as'],'attributes':_0x594713[_0x0a28('0x1a')],'include':_0x594713[_0x0a28('0x1c')]?_[_0x0a28('0x1d')](_0x594713['include'],function(_0x14a0aa){return{'model':db[_0x14a0aa[_0x0a28('0x1e')]],'as':_0x14a0aa['as'],'attributes':_0x14a0aa['attributes'],'include':_0x14a0aa['include']?_[_0x0a28('0x1d')](_0x14a0aa[_0x0a28('0x1c')],function(_0x5ca847){return{'model':db[_0x5ca847[_0x0a28('0x1e')]],'as':_0x5ca847['as'],'attributes':_0x5ca847[_0x0a28('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20d6de){logger['info'](_0x0a28('0x15'),_0x23b88d);logger[_0x0a28('0xe')](_0x0a28('0x15'),_0x23b88d,JSON[_0x0a28('0xf')](_0x20d6de));_0x52ce66(_0x20d6de);})['catch'](function(_0x4b1006){logger[_0x0a28('0x10')]('GetSalesforceAccount',_0x4b1006[_0x0a28('0x12')],_0x23b88d);_0x315bed(_0x353da9[_0x0a28('0x10')](0x1f4,_0x4b1006[_0x0a28('0x12')]));});});};exports[_0x0a28('0x1f')]=function(_0x3b0af4){var _0x140d90=this;return new Promise(function(_0x4c20de,_0x162ce7){return db[_0x0a28('0x20')][_0x0a28('0x21')]({'raw':_0x3b0af4[_0x0a28('0x17')]?_0x3b0af4[_0x0a28('0x17')][_0x0a28('0x18')]===undefined?!![]:![]:!![],'where':_0x3b0af4[_0x0a28('0x17')]?_0x3b0af4[_0x0a28('0x17')][_0x0a28('0x19')]||null:null,'attributes':_0x3b0af4[_0x0a28('0x17')]?_0x3b0af4['options']['attributes']||null:null,'include':_0x3b0af4[_0x0a28('0x17')]?_0x3b0af4['options'][_0x0a28('0x1c')]?_[_0x0a28('0x1d')](_0x3b0af4[_0x0a28('0x17')][_0x0a28('0x1c')],function(_0x25162a){return{'model':db[_0x25162a[_0x0a28('0x1e')]],'as':_0x25162a['as'],'attributes':_0x25162a[_0x0a28('0x1a')],'include':_0x25162a[_0x0a28('0x1c')]?_[_0x0a28('0x1d')](_0x25162a[_0x0a28('0x1c')],function(_0xb45df2){return{'model':db[_0xb45df2[_0x0a28('0x1e')]],'as':_0xb45df2['as'],'attributes':_0xb45df2[_0x0a28('0x1a')],'include':_0xb45df2['include']?_['map'](_0xb45df2['include'],function(_0x58fef1){return{'model':db[_0x58fef1[_0x0a28('0x1e')]],'as':_0x58fef1['as'],'attributes':_0x58fef1[_0x0a28('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0a28('0xb')](function(_0x49022d){logger['info'](_0x0a28('0x1f'),_0x3b0af4);logger[_0x0a28('0xe')]('ShowSalesforceAccount',_0x3b0af4,JSON[_0x0a28('0xf')](_0x49022d));_0x4c20de(_0x49022d);})[_0x0a28('0x14')](function(_0xdf967){logger['error']('ShowSalesforceAccount',_0xdf967['message'],_0x3b0af4);_0x162ce7(_0x140d90[_0x0a28('0x10')](0x1f4,_0xdf967[_0x0a28('0x12')]));});});};
\ No newline at end of file
index 391073e..975afcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3af=['index','get','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','update','destroy','exports','multer','util','express','../../components/auth/service','./intSalesforceConfiguration.controller','isAuthenticated'];(function(_0x372515,_0xdd11f){var _0xa3bf4e=function(_0x212cc8){while(--_0x212cc8){_0x372515['push'](_0x372515['shift']());}};_0xa3bf4e(++_0xdd11f);}(_0xc3af,0x112));var _0xfc3a=function(_0x1aeda2,_0x1217eb){_0x1aeda2=_0x1aeda2-0x0;var _0x32dc6d=_0xc3af[_0x1aeda2];return _0x32dc6d;};'use strict';var multer=require(_0xfc3a('0x0'));var util=require(_0xfc3a('0x1'));var path=require('path');var express=require(_0xfc3a('0x2'));var router=express['Router']();var auth=require(_0xfc3a('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfc3a('0x4'));router['get']('/',auth[_0xfc3a('0x5')](),controller[_0xfc3a('0x6')]);router[_0xfc3a('0x7')]('/:id',auth[_0xfc3a('0x5')](),controller[_0xfc3a('0x8')]);router[_0xfc3a('0x7')](_0xfc3a('0x9'),auth[_0xfc3a('0x5')](),controller[_0xfc3a('0xa')]);router[_0xfc3a('0x7')]('/:id/subjects',auth[_0xfc3a('0x5')](),controller[_0xfc3a('0xb')]);router[_0xfc3a('0x7')](_0xfc3a('0xc'),auth[_0xfc3a('0x5')](),controller[_0xfc3a('0xd')]);router[_0xfc3a('0xe')]('/',auth[_0xfc3a('0x5')](),controller['create']);router[_0xfc3a('0xf')](_0xfc3a('0x10'),auth[_0xfc3a('0x5')](),controller[_0xfc3a('0x11')]);router['delete']('/:id',auth[_0xfc3a('0x5')](),controller[_0xfc3a('0x12')]);module[_0xfc3a('0x13')]=router;
\ No newline at end of file
+var _0x2b47=['index','/:id/fields','getFields','isAuthenticated','getSubjects','post','create','put','update','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x27d10a,_0x35ff44){var _0x63302e=function(_0x302156){while(--_0x302156){_0x27d10a['push'](_0x27d10a['shift']());}};_0x63302e(++_0x35ff44);}(_0x2b47,0x77));var _0x72b4=function(_0x5b6de1,_0x35c407){_0x5b6de1=_0x5b6de1-0x0;var _0x678aba=_0x2b47[_0x5b6de1];return _0x678aba;};'use strict';var multer=require(_0x72b4('0x0'));var util=require('util');var path=require('path');var express=require(_0x72b4('0x1'));var router=express[_0x72b4('0x2')]();var auth=require(_0x72b4('0x3'));var interaction=require(_0x72b4('0x4'));var config=require(_0x72b4('0x5'));var controller=require('./intSalesforceConfiguration.controller');router[_0x72b4('0x6')]('/',auth['isAuthenticated'](),controller[_0x72b4('0x7')]);router[_0x72b4('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x72b4('0x6')](_0x72b4('0x8'),auth['isAuthenticated'](),controller[_0x72b4('0x9')]);router['get']('/:id/subjects',auth[_0x72b4('0xa')](),controller[_0x72b4('0xb')]);router['get']('/:id/descriptions',auth[_0x72b4('0xa')](),controller['getDescriptions']);router[_0x72b4('0xc')]('/',auth[_0x72b4('0xa')](),controller[_0x72b4('0xd')]);router[_0x72b4('0xe')]('/:id',auth[_0x72b4('0xa')](),controller[_0x72b4('0xf')]);router['delete']('/:id',auth[_0x72b4('0xa')](),controller[_0x72b4('0x10')]);module[_0x72b4('0x11')]=router;
\ No newline at end of file
index 18ed121..0c4fadf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d55=['ENUM','contact_lead','contact','lead','STRING'];(function(_0x1c1555,_0x5fdd4c){var _0x11c4fa=function(_0x5736de){while(--_0x5736de){_0x1c1555['push'](_0x1c1555['shift']());}};_0x11c4fa(++_0x5fdd4c);}(_0x9d55,0xfe));var _0x59d5=function(_0x3d96e1,_0x12cb7f){_0x3d96e1=_0x3d96e1-0x0;var _0x1f88ff=_0x9d55[_0x3d96e1];return _0x1f88ff;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x59d5('0x0')]},'moduleSearch':{'type':Sequelize[_0x59d5('0x1')](_0x59d5('0x2'),_0x59d5('0x3'),'lead'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x59d5('0x1')]('nothing',_0x59d5('0x3'),_0x59d5('0x4')),'defaultValue':_0x59d5('0x4')}};
\ No newline at end of file
+var _0xd339=['nothing','contact','sequelize','exports','STRING','contact_lead','lead','ENUM'];(function(_0x31d477,_0x3cebee){var _0x52d11e=function(_0x5d354e){while(--_0x5d354e){_0x31d477['push'](_0x31d477['shift']());}};_0x52d11e(++_0x3cebee);}(_0xd339,0x1ca));var _0x9d33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd339[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9d33('0x0'));module[_0x9d33('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9d33('0x2')]},'moduleSearch':{'type':Sequelize['ENUM'](_0x9d33('0x3'),'contact',_0x9d33('0x4')),'defaultValue':_0x9d33('0x3')},'moduleCreate':{'type':Sequelize[_0x9d33('0x5')](_0x9d33('0x6'),_0x9d33('0x7'),_0x9d33('0x4')),'defaultValue':_0x9d33('0x4')}};
\ No newline at end of file
index 163de5a..0d902cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x613e=['catch','sendStatus','status','end','json','count','offset','limit','Content-Range','update','destroy','stack','name','index','SalesforceConfiguration','rawAttributes','keys','query','dateEnd','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','pick','add','day','merge','where','filter','options','includeAll','include','rows','show','params','find','body','getFields','SalesforceField','map','getSubjects','getDescriptions','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','lodash','squel','crypto','jsforce','querystring','papaparse','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceConfiguration,\x20%s,\x20%s','message'];(function(_0x2fb380,_0x29c527){var _0x2ae75f=function(_0x4dcef6){while(--_0x4dcef6){_0x2fb380['push'](_0x2fb380['shift']());}};_0x2ae75f(++_0x29c527);}(_0x613e,0xd2));var _0xe613=function(_0xfe0e7f,_0x5451be){_0xfe0e7f=_0xfe0e7f-0x0;var _0x36495b=_0x613e[_0xfe0e7f];return _0x36495b;};'use strict';var pdf=require(_0xe613('0x0'));var emlformat=require(_0xe613('0x1'));var rimraf=require(_0xe613('0x2'));var zipdir=require(_0xe613('0x3'));var jsonpatch=require(_0xe613('0x4'));var rp=require(_0xe613('0x5'));var moment=require('moment');var BPromise=require(_0xe613('0x6'));var Mustache=require('mustache');var util=require(_0xe613('0x7'));var path=require(_0xe613('0x8'));var sox=require(_0xe613('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe613('0xa'));var squel=require(_0xe613('0xb'));var crypto=require(_0xe613('0xc'));var jsforce=require(_0xe613('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe613('0xe'));var Papa=require(_0xe613('0xf'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xe613('0x10'));var utils=require(_0xe613('0x11'));var config=require(_0xe613('0x12'));var db=require(_0xe613('0x13'))['db'];var jayson=require(_0xe613('0x14'));var client=jayson[_0xe613('0x15')][_0xe613('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x2945d1,_0x22af38,_0x3813e0,_0xa91de2){return new BPromise(function(_0x6949dc,_0x4cab4f){var _0x3894f4=_0xa91de2||client;return _0x3894f4[_0xe613('0x17')](_0x2945d1,_0x3813e0)[_0xe613('0x18')](function(_0x5b6ab1){logger[_0xe613('0x19')]('SalesforceConfiguration,\x20%s,\x20%s',_0x22af38,_0xe613('0x1a'));logger[_0xe613('0x1b')](_0xe613('0x1c'),_0x22af38,_0xe613('0x1a'),JSON[_0xe613('0x1d')](_0x5b6ab1));if(_0x5b6ab1[_0xe613('0x1e')]){if(_0x5b6ab1[_0xe613('0x1e')]['code']===0x1f4){logger[_0xe613('0x1e')](_0xe613('0x1f'),_0x22af38,_0x5b6ab1[_0xe613('0x1e')][_0xe613('0x20')]);return _0x4cab4f(_0x5b6ab1[_0xe613('0x1e')][_0xe613('0x20')]);}logger['error'](_0xe613('0x1f'),_0x22af38,_0x5b6ab1['error'][_0xe613('0x20')]);return _0x6949dc(_0x5b6ab1[_0xe613('0x1e')][_0xe613('0x20')]);}else{logger[_0xe613('0x19')](_0xe613('0x1f'),_0x22af38,_0xe613('0x1a'));_0x6949dc(_0x5b6ab1['result'][_0xe613('0x20')]);}})[_0xe613('0x21')](function(_0x2145cd){logger[_0xe613('0x1e')](_0xe613('0x1f'),_0x22af38,_0x2145cd);_0x4cab4f(_0x2145cd);});});}function respondWithStatusCode(_0x339504,_0x33a2bf){_0x33a2bf=_0x33a2bf||0xcc;return function(_0x39879a){if(_0x39879a){return _0x339504[_0xe613('0x22')](_0x33a2bf);}return _0x339504[_0xe613('0x23')](_0x33a2bf)[_0xe613('0x24')]();};}function respondWithResult(_0x312a10,_0x364eff){_0x364eff=_0x364eff||0xc8;return function(_0x2db11f){if(_0x2db11f){return _0x312a10[_0xe613('0x23')](_0x364eff)[_0xe613('0x25')](_0x2db11f);}};}function respondWithFilteredResult(_0x49b259,_0x142e20){return function(_0x66f5cb){if(_0x66f5cb){var _0x158e40=_0x66f5cb[_0xe613('0x26')],_0x2397b=_0x142e20[_0xe613('0x27')],_0x10431e=_0x142e20[_0xe613('0x27')]+_0x142e20[_0xe613('0x28')],_0x351e99;if(_0x10431e>=_0x158e40){_0x10431e=_0x158e40;_0x351e99=0xc8;}else{_0x351e99=0xce;}_0x49b259[_0xe613('0x23')](_0x351e99);return _0x49b259['set'](_0xe613('0x29'),_0x2397b+'-'+_0x10431e+'/'+_0x158e40)['json'](_0x66f5cb);}return null;};}function patchUpdates(_0x31452a){return function(_0x1bde7c){try{jsonpatch['apply'](_0x1bde7c,_0x31452a,!![]);}catch(_0x468122){return BPromise['reject'](_0x468122);}return _0x1bde7c['save']();};}function saveUpdates(_0x4553c3,_0x1d4460){return function(_0x42010d){if(_0x42010d){return _0x42010d[_0xe613('0x2a')](_0x4553c3)[_0xe613('0x18')](function(_0x519f71){return _0x519f71;});}return null;};}function removeEntity(_0x5c0e44,_0x2ee113){return function(_0x169ad8){if(_0x169ad8){return _0x169ad8[_0xe613('0x2b')]()[_0xe613('0x18')](function(){_0x5c0e44[_0xe613('0x23')](0xcc)[_0xe613('0x24')]();});}};}function handleEntityNotFound(_0xfdfb8,_0x5445f8){return function(_0x445410){if(!_0x445410){_0xfdfb8[_0xe613('0x22')](0x194);}return _0x445410;};}function handleError(_0x2490f1,_0x3b7e35){_0x3b7e35=_0x3b7e35||0x1f4;return function(_0x14c03c){logger[_0xe613('0x1e')](_0x14c03c[_0xe613('0x2c')]);if(_0x14c03c[_0xe613('0x2d')]){delete _0x14c03c[_0xe613('0x2d')];}_0x2490f1[_0xe613('0x23')](_0x3b7e35)['send'](_0x14c03c);};}exports[_0xe613('0x2e')]=function(_0x228791,_0x1f738d){var _0x25a1d1={},_0x49b510={},_0x4e25e8={'count':0x0,'rows':[]};var _0xce6c7=db[_0xe613('0x2f')][_0xe613('0x30')];_0x49b510['model']=_[_0xe613('0x31')](_0xce6c7);var _0x289690={'dateStart':_0x228791['query']['dateStart'],'dateEnd':_0x228791[_0xe613('0x32')]['dateEnd']};delete _0x228791[_0xe613('0x32')]['dateStart'];delete _0x228791[_0xe613('0x32')][_0xe613('0x33')];_0x49b510['query']=_[_0xe613('0x31')](_0x228791[_0xe613('0x32')]);_0x49b510[_0xe613('0x34')]=_[_0xe613('0x35')](_0x49b510['model'],_0x49b510['query']);_0x25a1d1[_0xe613('0x36')]=_[_0xe613('0x35')](_0x49b510[_0xe613('0x37')],qs[_0xe613('0x38')](_0x228791[_0xe613('0x32')][_0xe613('0x38')]));_0x25a1d1[_0xe613('0x36')]=_0x25a1d1[_0xe613('0x36')][_0xe613('0x39')]?_0x25a1d1[_0xe613('0x36')]:_0x49b510[_0xe613('0x37')];if(!_0x228791[_0xe613('0x32')][_0xe613('0x3a')]('nolimit')){_0x25a1d1['limit']=qs[_0xe613('0x28')](_0x228791[_0xe613('0x32')]['limit']);_0x25a1d1[_0xe613('0x27')]=qs[_0xe613('0x27')](_0x228791['query']['offset']);}_0x25a1d1[_0xe613('0x3b')]=qs['sort'](_0x228791['query'][_0xe613('0x3c')]);_0x25a1d1['where']=qs[_0xe613('0x34')](_[_0xe613('0x3d')](_0x228791['query'],_0x49b510[_0xe613('0x34')]));if(_0x289690['dateStart']){if(_0x289690[_0xe613('0x33')]){_0x289690[_0xe613('0x33')]=moment(_0x289690[_0xe613('0x33')])[_0xe613('0x3e')](0x1,_0xe613('0x3f'));}else{_0x289690[_0xe613('0x33')]=moment(_0x289690['dateStart'])[_0xe613('0x3e')](0x1,'day');}_[_0xe613('0x40')](_0x25a1d1[_0xe613('0x41')],{'createdAt':{'$gte':_0x289690['dateStart'],'$lte':_0x289690[_0xe613('0x33')]}});}if(_0x228791[_0xe613('0x32')]['filter']){_0x25a1d1[_0xe613('0x41')]=_[_0xe613('0x40')](_0x25a1d1['where'],{'$or':_['map'](_0x25a1d1[_0xe613('0x36')],function(_0x37c1fc){var _0x5027f6={};_0x5027f6[_0x37c1fc]={'$like':'%'+_0x228791[_0xe613('0x32')][_0xe613('0x42')]+'%'};return _0x5027f6;})});}_0x25a1d1=_[_0xe613('0x40')]({},_0x25a1d1,_0x228791[_0xe613('0x43')]);var _0x392506={'where':_0x25a1d1[_0xe613('0x41')]};return db[_0xe613('0x2f')][_0xe613('0x26')](_0x392506)['then'](function(_0x1abdad){_0x4e25e8['count']=_0x1abdad;if(_0x228791[_0xe613('0x32')][_0xe613('0x44')]){_0x25a1d1[_0xe613('0x45')]=[{'all':!![]}];}return db[_0xe613('0x2f')]['findAll'](_0x25a1d1);})['then'](function(_0x520564){_0x4e25e8[_0xe613('0x46')]=_0x520564;return _0x4e25e8;})[_0xe613('0x18')](respondWithFilteredResult(_0x1f738d,_0x25a1d1))[_0xe613('0x21')](handleError(_0x1f738d,null));};exports[_0xe613('0x47')]=function(_0x3cfd02,_0x583803){var _0x509663={'raw':![],'where':{'id':_0x3cfd02[_0xe613('0x48')]['id']}},_0x56f9ee={};_0x56f9ee[_0xe613('0x37')]=_['keys'](db[_0xe613('0x2f')][_0xe613('0x30')]);_0x56f9ee['query']=_['keys'](_0x3cfd02[_0xe613('0x32')]);_0x56f9ee[_0xe613('0x34')]=_[_0xe613('0x35')](_0x56f9ee[_0xe613('0x37')],_0x56f9ee[_0xe613('0x32')]);_0x509663[_0xe613('0x36')]=_['intersection'](_0x56f9ee[_0xe613('0x37')],qs[_0xe613('0x38')](_0x3cfd02[_0xe613('0x32')][_0xe613('0x38')]));_0x509663[_0xe613('0x36')]=_0x509663['attributes'][_0xe613('0x39')]?_0x509663[_0xe613('0x36')]:_0x56f9ee['model'];if(_0x3cfd02[_0xe613('0x32')]['includeAll']){_0x509663[_0xe613('0x45')]=[{'all':!![]}];}_0x509663=_[_0xe613('0x40')]({},_0x509663,_0x3cfd02[_0xe613('0x43')]);return db[_0xe613('0x2f')][_0xe613('0x49')](_0x509663)[_0xe613('0x18')](handleEntityNotFound(_0x583803,null))['then'](respondWithResult(_0x583803,null))[_0xe613('0x21')](handleError(_0x583803,null));};exports['create']=function(_0x47645b,_0xd298e4){return db['SalesforceConfiguration']['create'](_0x47645b[_0xe613('0x4a')],{})[_0xe613('0x18')](respondWithResult(_0xd298e4,0xc9))[_0xe613('0x21')](handleError(_0xd298e4,null));};exports[_0xe613('0x2a')]=function(_0x449dcd,_0x3ef764){if(_0x449dcd[_0xe613('0x4a')]['id']){delete _0x449dcd[_0xe613('0x4a')]['id'];}return db[_0xe613('0x2f')]['find']({'where':{'id':_0x449dcd[_0xe613('0x48')]['id']}})[_0xe613('0x18')](handleEntityNotFound(_0x3ef764,null))[_0xe613('0x18')](saveUpdates(_0x449dcd['body'],null))[_0xe613('0x18')](respondWithResult(_0x3ef764,null))[_0xe613('0x21')](handleError(_0x3ef764,null));};exports['destroy']=function(_0x2c37ae,_0x596ed7){return db[_0xe613('0x2f')][_0xe613('0x49')]({'where':{'id':_0x2c37ae[_0xe613('0x48')]['id']}})[_0xe613('0x18')](handleEntityNotFound(_0x596ed7,null))[_0xe613('0x18')](removeEntity(_0x596ed7,null))['catch'](handleError(_0x596ed7,null));};exports[_0xe613('0x4b')]=function(_0x18d228,_0x3b4c29,_0x54c868){var _0x337a29={};var _0x3787ef={};var _0xeca36;var _0x54f77f;return db[_0xe613('0x2f')]['findOne']({'where':{'id':_0x18d228['params']['id']}})[_0xe613('0x18')](handleEntityNotFound(_0x3b4c29,null))[_0xe613('0x18')](function(_0x31d0c5){if(_0x31d0c5){_0xeca36=_0x31d0c5;_0x3787ef[_0xe613('0x37')]=_[_0xe613('0x31')](db[_0xe613('0x4c')][_0xe613('0x30')]);_0x3787ef[_0xe613('0x32')]=_[_0xe613('0x31')](_0x18d228[_0xe613('0x32')]);_0x3787ef[_0xe613('0x34')]=_['intersection'](_0x3787ef['model'],_0x3787ef[_0xe613('0x32')]);_0x337a29['attributes']=_[_0xe613('0x35')](_0x3787ef[_0xe613('0x37')],qs[_0xe613('0x38')](_0x18d228['query'][_0xe613('0x38')]));_0x337a29[_0xe613('0x36')]=_0x337a29[_0xe613('0x36')][_0xe613('0x39')]?_0x337a29[_0xe613('0x36')]:_0x3787ef['model'];_0x337a29['order']=qs['sort'](_0x18d228[_0xe613('0x32')][_0xe613('0x3c')]);_0x337a29[_0xe613('0x41')]=qs[_0xe613('0x34')](_[_0xe613('0x3d')](_0x18d228[_0xe613('0x32')],_0x3787ef[_0xe613('0x34')]));if(_0x18d228['query'][_0xe613('0x42')]){_0x337a29[_0xe613('0x41')]=_[_0xe613('0x40')](_0x337a29[_0xe613('0x41')],{'$or':_[_0xe613('0x4d')](_0x337a29[_0xe613('0x36')],function(_0x5fe325){var _0x4eba88={};_0x4eba88[_0x5fe325]={'$like':'%'+_0x18d228[_0xe613('0x32')][_0xe613('0x42')]+'%'};return _0x4eba88;})});}_0x337a29=_[_0xe613('0x40')]({},_0x337a29,_0x18d228[_0xe613('0x43')]);return _0xeca36[_0xe613('0x4b')](_0x337a29);}})[_0xe613('0x18')](function(_0x15b32d){if(_0x15b32d){_0x54f77f=_0x15b32d['length'];if(!_0x18d228[_0xe613('0x32')][_0xe613('0x3a')]('nolimit')){_0x337a29[_0xe613('0x28')]=qs[_0xe613('0x28')](_0x18d228[_0xe613('0x32')][_0xe613('0x28')]);_0x337a29['offset']=qs[_0xe613('0x27')](_0x18d228[_0xe613('0x32')][_0xe613('0x27')]);}return _0xeca36['getFields'](_0x337a29);}})[_0xe613('0x18')](function(_0x4a923a){if(_0x4a923a){return _0x4a923a?{'count':_0x54f77f,'rows':_0x4a923a}:null;}})['then'](respondWithResult(_0x3b4c29,null))[_0xe613('0x21')](handleError(_0x3b4c29,null));};exports[_0xe613('0x4e')]=function(_0x53fbe6,_0x1605dc,_0x120932){var _0x517429={};var _0x1eccc6={};var _0x27eaee;var _0x244771;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x53fbe6['params']['id']}})[_0xe613('0x18')](handleEntityNotFound(_0x1605dc,null))[_0xe613('0x18')](function(_0x33a7fb){if(_0x33a7fb){_0x27eaee=_0x33a7fb;_0x1eccc6[_0xe613('0x37')]=_[_0xe613('0x31')](db[_0xe613('0x4c')][_0xe613('0x30')]);_0x1eccc6[_0xe613('0x32')]=_[_0xe613('0x31')](_0x53fbe6['query']);_0x1eccc6['filters']=_[_0xe613('0x35')](_0x1eccc6[_0xe613('0x37')],_0x1eccc6[_0xe613('0x32')]);_0x517429[_0xe613('0x36')]=_[_0xe613('0x35')](_0x1eccc6[_0xe613('0x37')],qs[_0xe613('0x38')](_0x53fbe6['query'][_0xe613('0x38')]));_0x517429['attributes']=_0x517429['attributes'][_0xe613('0x39')]?_0x517429[_0xe613('0x36')]:_0x1eccc6['model'];_0x517429['order']=qs[_0xe613('0x3c')](_0x53fbe6[_0xe613('0x32')]['sort']);_0x517429[_0xe613('0x41')]=qs['filters'](_['pick'](_0x53fbe6['query'],_0x1eccc6[_0xe613('0x34')]));if(_0x53fbe6['query']['filter']){_0x517429[_0xe613('0x41')]=_[_0xe613('0x40')](_0x517429[_0xe613('0x41')],{'$or':_['map'](_0x517429[_0xe613('0x36')],function(_0x469208){var _0x4bad55={};_0x4bad55[_0x469208]={'$like':'%'+_0x53fbe6['query']['filter']+'%'};return _0x4bad55;})});}_0x517429=_[_0xe613('0x40')]({},_0x517429,_0x53fbe6[_0xe613('0x43')]);return _0x27eaee[_0xe613('0x4e')](_0x517429);}})['then'](function(_0x150840){if(_0x150840){_0x244771=_0x150840[_0xe613('0x39')];if(!_0x53fbe6[_0xe613('0x32')][_0xe613('0x3a')]('nolimit')){_0x517429[_0xe613('0x28')]=qs[_0xe613('0x28')](_0x53fbe6[_0xe613('0x32')][_0xe613('0x28')]);_0x517429['offset']=qs['offset'](_0x53fbe6[_0xe613('0x32')]['offset']);}return _0x27eaee[_0xe613('0x4e')](_0x517429);}})[_0xe613('0x18')](function(_0x5ed78){if(_0x5ed78){return _0x5ed78?{'count':_0x244771,'rows':_0x5ed78}:null;}})[_0xe613('0x18')](respondWithResult(_0x1605dc,null))[_0xe613('0x21')](handleError(_0x1605dc,null));};exports['getDescriptions']=function(_0x5bbb30,_0x3033f1,_0x54a429){var _0x2e59a7={};var _0x3289c9={};var _0x57baf7;var _0x22a01b;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x5bbb30[_0xe613('0x48')]['id']}})[_0xe613('0x18')](handleEntityNotFound(_0x3033f1,null))[_0xe613('0x18')](function(_0x392408){if(_0x392408){_0x57baf7=_0x392408;_0x3289c9[_0xe613('0x37')]=_[_0xe613('0x31')](db[_0xe613('0x4c')]['rawAttributes']);_0x3289c9[_0xe613('0x32')]=_[_0xe613('0x31')](_0x5bbb30['query']);_0x3289c9[_0xe613('0x34')]=_[_0xe613('0x35')](_0x3289c9[_0xe613('0x37')],_0x3289c9['query']);_0x2e59a7[_0xe613('0x36')]=_['intersection'](_0x3289c9['model'],qs[_0xe613('0x38')](_0x5bbb30[_0xe613('0x32')][_0xe613('0x38')]));_0x2e59a7[_0xe613('0x36')]=_0x2e59a7['attributes']['length']?_0x2e59a7['attributes']:_0x3289c9[_0xe613('0x37')];_0x2e59a7[_0xe613('0x3b')]=qs[_0xe613('0x3c')](_0x5bbb30[_0xe613('0x32')]['sort']);_0x2e59a7['where']=qs[_0xe613('0x34')](_['pick'](_0x5bbb30[_0xe613('0x32')],_0x3289c9[_0xe613('0x34')]));if(_0x5bbb30[_0xe613('0x32')]['filter']){_0x2e59a7[_0xe613('0x41')]=_[_0xe613('0x40')](_0x2e59a7[_0xe613('0x41')],{'$or':_[_0xe613('0x4d')](_0x2e59a7['attributes'],function(_0x233198){var _0x6862c8={};_0x6862c8[_0x233198]={'$like':'%'+_0x5bbb30[_0xe613('0x32')][_0xe613('0x42')]+'%'};return _0x6862c8;})});}_0x2e59a7=_[_0xe613('0x40')]({},_0x2e59a7,_0x5bbb30[_0xe613('0x43')]);return _0x57baf7[_0xe613('0x4f')](_0x2e59a7);}})[_0xe613('0x18')](function(_0x1fe645){if(_0x1fe645){_0x22a01b=_0x1fe645[_0xe613('0x39')];if(!_0x5bbb30[_0xe613('0x32')][_0xe613('0x3a')](_0xe613('0x50'))){_0x2e59a7[_0xe613('0x28')]=qs[_0xe613('0x28')](_0x5bbb30[_0xe613('0x32')][_0xe613('0x28')]);_0x2e59a7[_0xe613('0x27')]=qs[_0xe613('0x27')](_0x5bbb30[_0xe613('0x32')]['offset']);}return _0x57baf7[_0xe613('0x4f')](_0x2e59a7);}})[_0xe613('0x18')](function(_0x1aaca3){if(_0x1aaca3){return _0x1aaca3?{'count':_0x22a01b,'rows':_0x1aaca3}:null;}})[_0xe613('0x18')](respondWithResult(_0x3033f1,null))[_0xe613('0x21')](handleError(_0x3033f1,null));};
\ No newline at end of file
+var _0xb4fb=['message','result','catch','end','status','json','count','offset','set','Content-Range','apply','save','then','destroy','sendStatus','name','send','index','SalesforceConfiguration','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','add','day','merge','filter','map','options','includeAll','include','findAll','rows','find','create','update','body','params','findOne','SalesforceField','pick','getFields','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4376ad,_0x19888e){var _0x2fb4c1=function(_0x4e1823){while(--_0x4e1823){_0x4376ad['push'](_0x4376ad['shift']());}};_0x2fb4c1(++_0x19888e);}(_0xb4fb,0x92));var _0xbb4f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb4fb[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xbb4f('0x0'));var emlformat=require(_0xbb4f('0x1'));var rimraf=require(_0xbb4f('0x2'));var zipdir=require(_0xbb4f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbb4f('0x4'));var moment=require('moment');var BPromise=require(_0xbb4f('0x5'));var Mustache=require(_0xbb4f('0x6'));var util=require('util');var path=require(_0xbb4f('0x7'));var sox=require('sox');var csv=require(_0xbb4f('0x8'));var ejs=require(_0xbb4f('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbb4f('0xa'));var crypto=require(_0xbb4f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbb4f('0xc'));var toCsv=require(_0xbb4f('0x8'));var querystring=require(_0xbb4f('0xd'));var Papa=require('papaparse');var qs=require(_0xbb4f('0xe'));var logger=require(_0xbb4f('0xf'))(_0xbb4f('0x10'));var utils=require(_0xbb4f('0x11'));var config=require(_0xbb4f('0x12'));var db=require(_0xbb4f('0x13'))['db'];var jayson=require(_0xbb4f('0x14'));var client=jayson[_0xbb4f('0x15')][_0xbb4f('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x353ca2,_0x18a4eb,_0x12dd0d,_0x5d0bdb){return new BPromise(function(_0x2426d2,_0xd483fa){var _0x1d0116=_0x5d0bdb||client;return _0x1d0116[_0xbb4f('0x17')](_0x353ca2,_0x12dd0d)['then'](function(_0x1a593c){logger[_0xbb4f('0x18')](_0xbb4f('0x19'),_0x18a4eb,_0xbb4f('0x1a'));logger[_0xbb4f('0x1b')](_0xbb4f('0x1c'),_0x18a4eb,_0xbb4f('0x1a'),JSON[_0xbb4f('0x1d')](_0x1a593c));if(_0x1a593c[_0xbb4f('0x1e')]){if(_0x1a593c['error'][_0xbb4f('0x1f')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x18a4eb,_0x1a593c[_0xbb4f('0x1e')]['message']);return _0xd483fa(_0x1a593c[_0xbb4f('0x1e')][_0xbb4f('0x20')]);}logger['error'](_0xbb4f('0x19'),_0x18a4eb,_0x1a593c['error'][_0xbb4f('0x20')]);return _0x2426d2(_0x1a593c[_0xbb4f('0x1e')]['message']);}else{logger['info'](_0xbb4f('0x19'),_0x18a4eb,_0xbb4f('0x1a'));_0x2426d2(_0x1a593c[_0xbb4f('0x21')]['message']);}})[_0xbb4f('0x22')](function(_0x27c8de){logger[_0xbb4f('0x1e')](_0xbb4f('0x19'),_0x18a4eb,_0x27c8de);_0xd483fa(_0x27c8de);});});}function respondWithStatusCode(_0x58efd2,_0x4b7c87){_0x4b7c87=_0x4b7c87||0xcc;return function(_0x4d4e20){if(_0x4d4e20){return _0x58efd2['sendStatus'](_0x4b7c87);}return _0x58efd2['status'](_0x4b7c87)[_0xbb4f('0x23')]();};}function respondWithResult(_0x4127b1,_0x2bf8e4){_0x2bf8e4=_0x2bf8e4||0xc8;return function(_0x56f393){if(_0x56f393){return _0x4127b1[_0xbb4f('0x24')](_0x2bf8e4)[_0xbb4f('0x25')](_0x56f393);}};}function respondWithFilteredResult(_0x315a50,_0x4c3740){return function(_0x252ac6){if(_0x252ac6){var _0x3d2247=_0x252ac6[_0xbb4f('0x26')],_0x4227f7=_0x4c3740[_0xbb4f('0x27')],_0x128f26=_0x4c3740[_0xbb4f('0x27')]+_0x4c3740['limit'],_0x16721a;if(_0x128f26>=_0x3d2247){_0x128f26=_0x3d2247;_0x16721a=0xc8;}else{_0x16721a=0xce;}_0x315a50['status'](_0x16721a);return _0x315a50[_0xbb4f('0x28')](_0xbb4f('0x29'),_0x4227f7+'-'+_0x128f26+'/'+_0x3d2247)[_0xbb4f('0x25')](_0x252ac6);}return null;};}function patchUpdates(_0x9b03cb){return function(_0x5b8d66){try{jsonpatch[_0xbb4f('0x2a')](_0x5b8d66,_0x9b03cb,!![]);}catch(_0x3eca72){return BPromise['reject'](_0x3eca72);}return _0x5b8d66[_0xbb4f('0x2b')]();};}function saveUpdates(_0x15b1ee,_0x111086){return function(_0xd19345){if(_0xd19345){return _0xd19345['update'](_0x15b1ee)[_0xbb4f('0x2c')](function(_0x3e7615){return _0x3e7615;});}return null;};}function removeEntity(_0x4522cd,_0x329589){return function(_0x31f9e3){if(_0x31f9e3){return _0x31f9e3[_0xbb4f('0x2d')]()[_0xbb4f('0x2c')](function(){_0x4522cd[_0xbb4f('0x24')](0xcc)[_0xbb4f('0x23')]();});}};}function handleEntityNotFound(_0x3c1f7c,_0x2b3790){return function(_0x2e3298){if(!_0x2e3298){_0x3c1f7c[_0xbb4f('0x2e')](0x194);}return _0x2e3298;};}function handleError(_0xa17050,_0x16aa7d){_0x16aa7d=_0x16aa7d||0x1f4;return function(_0x188a60){logger[_0xbb4f('0x1e')](_0x188a60['stack']);if(_0x188a60['name']){delete _0x188a60[_0xbb4f('0x2f')];}_0xa17050['status'](_0x16aa7d)[_0xbb4f('0x30')](_0x188a60);};}exports[_0xbb4f('0x31')]=function(_0x16e7ba,_0x14fa4a){var _0x3578ea={},_0x4f9f7e={},_0x5b71af={'count':0x0,'rows':[]};var _0x32c62c=db[_0xbb4f('0x32')][_0xbb4f('0x33')];_0x4f9f7e[_0xbb4f('0x34')]=_[_0xbb4f('0x35')](_0x32c62c);var _0x1eaa77={'dateStart':_0x16e7ba[_0xbb4f('0x36')][_0xbb4f('0x37')],'dateEnd':_0x16e7ba[_0xbb4f('0x36')]['dateEnd']};delete _0x16e7ba[_0xbb4f('0x36')][_0xbb4f('0x37')];delete _0x16e7ba[_0xbb4f('0x36')][_0xbb4f('0x38')];_0x4f9f7e[_0xbb4f('0x36')]=_[_0xbb4f('0x35')](_0x16e7ba[_0xbb4f('0x36')]);_0x4f9f7e['filters']=_[_0xbb4f('0x39')](_0x4f9f7e[_0xbb4f('0x34')],_0x4f9f7e[_0xbb4f('0x36')]);_0x3578ea[_0xbb4f('0x3a')]=_['intersection'](_0x4f9f7e[_0xbb4f('0x34')],qs[_0xbb4f('0x3b')](_0x16e7ba[_0xbb4f('0x36')][_0xbb4f('0x3b')]));_0x3578ea[_0xbb4f('0x3a')]=_0x3578ea[_0xbb4f('0x3a')][_0xbb4f('0x3c')]?_0x3578ea[_0xbb4f('0x3a')]:_0x4f9f7e[_0xbb4f('0x34')];if(!_0x16e7ba[_0xbb4f('0x36')][_0xbb4f('0x3d')](_0xbb4f('0x3e'))){_0x3578ea[_0xbb4f('0x3f')]=qs[_0xbb4f('0x3f')](_0x16e7ba[_0xbb4f('0x36')][_0xbb4f('0x3f')]);_0x3578ea[_0xbb4f('0x27')]=qs['offset'](_0x16e7ba[_0xbb4f('0x36')][_0xbb4f('0x27')]);}_0x3578ea[_0xbb4f('0x40')]=qs['sort'](_0x16e7ba[_0xbb4f('0x36')][_0xbb4f('0x41')]);_0x3578ea[_0xbb4f('0x42')]=qs[_0xbb4f('0x43')](_['pick'](_0x16e7ba[_0xbb4f('0x36')],_0x4f9f7e['filters']));if(_0x1eaa77[_0xbb4f('0x37')]){if(_0x1eaa77[_0xbb4f('0x38')]){_0x1eaa77[_0xbb4f('0x38')]=moment(_0x1eaa77[_0xbb4f('0x38')])[_0xbb4f('0x44')](0x1,'day');}else{_0x1eaa77[_0xbb4f('0x38')]=moment(_0x1eaa77[_0xbb4f('0x37')])[_0xbb4f('0x44')](0x1,_0xbb4f('0x45'));}_[_0xbb4f('0x46')](_0x3578ea[_0xbb4f('0x42')],{'createdAt':{'$gte':_0x1eaa77['dateStart'],'$lte':_0x1eaa77[_0xbb4f('0x38')]}});}if(_0x16e7ba[_0xbb4f('0x36')][_0xbb4f('0x47')]){_0x3578ea['where']=_[_0xbb4f('0x46')](_0x3578ea['where'],{'$or':_[_0xbb4f('0x48')](_0x3578ea[_0xbb4f('0x3a')],function(_0x37f25d){var _0x3fe798={};_0x3fe798[_0x37f25d]={'$like':'%'+_0x16e7ba[_0xbb4f('0x36')][_0xbb4f('0x47')]+'%'};return _0x3fe798;})});}_0x3578ea=_[_0xbb4f('0x46')]({},_0x3578ea,_0x16e7ba[_0xbb4f('0x49')]);var _0x2dbabd={'where':_0x3578ea['where']};return db[_0xbb4f('0x32')]['count'](_0x2dbabd)[_0xbb4f('0x2c')](function(_0x533312){_0x5b71af[_0xbb4f('0x26')]=_0x533312;if(_0x16e7ba[_0xbb4f('0x36')][_0xbb4f('0x4a')]){_0x3578ea[_0xbb4f('0x4b')]=[{'all':!![]}];}return db[_0xbb4f('0x32')][_0xbb4f('0x4c')](_0x3578ea);})[_0xbb4f('0x2c')](function(_0x16651d){_0x5b71af[_0xbb4f('0x4d')]=_0x16651d;return _0x5b71af;})['then'](respondWithFilteredResult(_0x14fa4a,_0x3578ea))[_0xbb4f('0x22')](handleError(_0x14fa4a,null));};exports['show']=function(_0x12721a,_0x48a2a2){var _0x274439={'raw':![],'where':{'id':_0x12721a['params']['id']}},_0x1dad15={};_0x1dad15[_0xbb4f('0x34')]=_[_0xbb4f('0x35')](db[_0xbb4f('0x32')]['rawAttributes']);_0x1dad15[_0xbb4f('0x36')]=_[_0xbb4f('0x35')](_0x12721a['query']);_0x1dad15[_0xbb4f('0x43')]=_[_0xbb4f('0x39')](_0x1dad15[_0xbb4f('0x34')],_0x1dad15[_0xbb4f('0x36')]);_0x274439['attributes']=_[_0xbb4f('0x39')](_0x1dad15[_0xbb4f('0x34')],qs[_0xbb4f('0x3b')](_0x12721a[_0xbb4f('0x36')]['fields']));_0x274439[_0xbb4f('0x3a')]=_0x274439[_0xbb4f('0x3a')][_0xbb4f('0x3c')]?_0x274439[_0xbb4f('0x3a')]:_0x1dad15[_0xbb4f('0x34')];if(_0x12721a[_0xbb4f('0x36')][_0xbb4f('0x4a')]){_0x274439['include']=[{'all':!![]}];}_0x274439=_['merge']({},_0x274439,_0x12721a['options']);return db[_0xbb4f('0x32')][_0xbb4f('0x4e')](_0x274439)[_0xbb4f('0x2c')](handleEntityNotFound(_0x48a2a2,null))[_0xbb4f('0x2c')](respondWithResult(_0x48a2a2,null))[_0xbb4f('0x22')](handleError(_0x48a2a2,null));};exports[_0xbb4f('0x4f')]=function(_0x371398,_0x41a7a7){return db[_0xbb4f('0x32')][_0xbb4f('0x4f')](_0x371398['body'],{})[_0xbb4f('0x2c')](respondWithResult(_0x41a7a7,0xc9))[_0xbb4f('0x22')](handleError(_0x41a7a7,null));};exports[_0xbb4f('0x50')]=function(_0x273f3b,_0x1fbfcd){if(_0x273f3b['body']['id']){delete _0x273f3b['body']['id'];}return db['SalesforceConfiguration'][_0xbb4f('0x4e')]({'where':{'id':_0x273f3b['params']['id']}})[_0xbb4f('0x2c')](handleEntityNotFound(_0x1fbfcd,null))[_0xbb4f('0x2c')](saveUpdates(_0x273f3b[_0xbb4f('0x51')],null))[_0xbb4f('0x2c')](respondWithResult(_0x1fbfcd,null))[_0xbb4f('0x22')](handleError(_0x1fbfcd,null));};exports[_0xbb4f('0x2d')]=function(_0x48bbe0,_0x715d95){return db['SalesforceConfiguration'][_0xbb4f('0x4e')]({'where':{'id':_0x48bbe0[_0xbb4f('0x52')]['id']}})[_0xbb4f('0x2c')](handleEntityNotFound(_0x715d95,null))[_0xbb4f('0x2c')](removeEntity(_0x715d95,null))[_0xbb4f('0x22')](handleError(_0x715d95,null));};exports['getFields']=function(_0x506ac1,_0x86607f,_0x367082){var _0x185a7b={};var _0x5575cc={};var _0x1716d3;var _0x49003a;return db[_0xbb4f('0x32')][_0xbb4f('0x53')]({'where':{'id':_0x506ac1[_0xbb4f('0x52')]['id']}})[_0xbb4f('0x2c')](handleEntityNotFound(_0x86607f,null))[_0xbb4f('0x2c')](function(_0x3c81bc){if(_0x3c81bc){_0x1716d3=_0x3c81bc;_0x5575cc['model']=_['keys'](db[_0xbb4f('0x54')][_0xbb4f('0x33')]);_0x5575cc[_0xbb4f('0x36')]=_['keys'](_0x506ac1['query']);_0x5575cc[_0xbb4f('0x43')]=_[_0xbb4f('0x39')](_0x5575cc[_0xbb4f('0x34')],_0x5575cc[_0xbb4f('0x36')]);_0x185a7b[_0xbb4f('0x3a')]=_['intersection'](_0x5575cc[_0xbb4f('0x34')],qs[_0xbb4f('0x3b')](_0x506ac1[_0xbb4f('0x36')]['fields']));_0x185a7b[_0xbb4f('0x3a')]=_0x185a7b[_0xbb4f('0x3a')][_0xbb4f('0x3c')]?_0x185a7b[_0xbb4f('0x3a')]:_0x5575cc[_0xbb4f('0x34')];_0x185a7b['order']=qs[_0xbb4f('0x41')](_0x506ac1['query'][_0xbb4f('0x41')]);_0x185a7b[_0xbb4f('0x42')]=qs[_0xbb4f('0x43')](_[_0xbb4f('0x55')](_0x506ac1[_0xbb4f('0x36')],_0x5575cc['filters']));if(_0x506ac1[_0xbb4f('0x36')][_0xbb4f('0x47')]){_0x185a7b['where']=_[_0xbb4f('0x46')](_0x185a7b['where'],{'$or':_[_0xbb4f('0x48')](_0x185a7b[_0xbb4f('0x3a')],function(_0xf883b){var _0x4ab777={};_0x4ab777[_0xf883b]={'$like':'%'+_0x506ac1[_0xbb4f('0x36')][_0xbb4f('0x47')]+'%'};return _0x4ab777;})});}_0x185a7b=_['merge']({},_0x185a7b,_0x506ac1['options']);return _0x1716d3[_0xbb4f('0x56')](_0x185a7b);}})['then'](function(_0x568f19){if(_0x568f19){_0x49003a=_0x568f19[_0xbb4f('0x3c')];if(!_0x506ac1[_0xbb4f('0x36')]['hasOwnProperty'](_0xbb4f('0x3e'))){_0x185a7b[_0xbb4f('0x3f')]=qs[_0xbb4f('0x3f')](_0x506ac1['query']['limit']);_0x185a7b[_0xbb4f('0x27')]=qs[_0xbb4f('0x27')](_0x506ac1[_0xbb4f('0x36')][_0xbb4f('0x27')]);}return _0x1716d3['getFields'](_0x185a7b);}})[_0xbb4f('0x2c')](function(_0x5e8164){if(_0x5e8164){return _0x5e8164?{'count':_0x49003a,'rows':_0x5e8164}:null;}})[_0xbb4f('0x2c')](respondWithResult(_0x86607f,null))['catch'](handleError(_0x86607f,null));};exports[_0xbb4f('0x57')]=function(_0x1d0d49,_0x2d7142,_0x536e91){var _0x3ceb4d={};var _0x489323={};var _0x144e88;var _0xb891c3;return db[_0xbb4f('0x32')]['findOne']({'where':{'id':_0x1d0d49['params']['id']}})[_0xbb4f('0x2c')](handleEntityNotFound(_0x2d7142,null))[_0xbb4f('0x2c')](function(_0x42a010){if(_0x42a010){_0x144e88=_0x42a010;_0x489323[_0xbb4f('0x34')]=_[_0xbb4f('0x35')](db[_0xbb4f('0x54')]['rawAttributes']);_0x489323['query']=_['keys'](_0x1d0d49[_0xbb4f('0x36')]);_0x489323[_0xbb4f('0x43')]=_[_0xbb4f('0x39')](_0x489323[_0xbb4f('0x34')],_0x489323['query']);_0x3ceb4d[_0xbb4f('0x3a')]=_[_0xbb4f('0x39')](_0x489323[_0xbb4f('0x34')],qs[_0xbb4f('0x3b')](_0x1d0d49[_0xbb4f('0x36')][_0xbb4f('0x3b')]));_0x3ceb4d[_0xbb4f('0x3a')]=_0x3ceb4d[_0xbb4f('0x3a')][_0xbb4f('0x3c')]?_0x3ceb4d[_0xbb4f('0x3a')]:_0x489323[_0xbb4f('0x34')];_0x3ceb4d[_0xbb4f('0x40')]=qs['sort'](_0x1d0d49[_0xbb4f('0x36')][_0xbb4f('0x41')]);_0x3ceb4d[_0xbb4f('0x42')]=qs['filters'](_[_0xbb4f('0x55')](_0x1d0d49['query'],_0x489323['filters']));if(_0x1d0d49[_0xbb4f('0x36')][_0xbb4f('0x47')]){_0x3ceb4d[_0xbb4f('0x42')]=_[_0xbb4f('0x46')](_0x3ceb4d[_0xbb4f('0x42')],{'$or':_[_0xbb4f('0x48')](_0x3ceb4d[_0xbb4f('0x3a')],function(_0x406d82){var _0x57d9dd={};_0x57d9dd[_0x406d82]={'$like':'%'+_0x1d0d49[_0xbb4f('0x36')][_0xbb4f('0x47')]+'%'};return _0x57d9dd;})});}_0x3ceb4d=_[_0xbb4f('0x46')]({},_0x3ceb4d,_0x1d0d49['options']);return _0x144e88[_0xbb4f('0x57')](_0x3ceb4d);}})['then'](function(_0xf858c2){if(_0xf858c2){_0xb891c3=_0xf858c2[_0xbb4f('0x3c')];if(!_0x1d0d49[_0xbb4f('0x36')][_0xbb4f('0x3d')](_0xbb4f('0x3e'))){_0x3ceb4d[_0xbb4f('0x3f')]=qs['limit'](_0x1d0d49[_0xbb4f('0x36')][_0xbb4f('0x3f')]);_0x3ceb4d[_0xbb4f('0x27')]=qs[_0xbb4f('0x27')](_0x1d0d49[_0xbb4f('0x36')][_0xbb4f('0x27')]);}return _0x144e88[_0xbb4f('0x57')](_0x3ceb4d);}})['then'](function(_0x93ba3a){if(_0x93ba3a){return _0x93ba3a?{'count':_0xb891c3,'rows':_0x93ba3a}:null;}})['then'](respondWithResult(_0x2d7142,null))['catch'](handleError(_0x2d7142,null));};exports[_0xbb4f('0x58')]=function(_0x28bd87,_0x2bfbda,_0x31801b){var _0x423cd3={};var _0x36c507={};var _0x384ca4;var _0x197fab;return db[_0xbb4f('0x32')][_0xbb4f('0x53')]({'where':{'id':_0x28bd87[_0xbb4f('0x52')]['id']}})[_0xbb4f('0x2c')](handleEntityNotFound(_0x2bfbda,null))[_0xbb4f('0x2c')](function(_0x3ac8f8){if(_0x3ac8f8){_0x384ca4=_0x3ac8f8;_0x36c507[_0xbb4f('0x34')]=_['keys'](db[_0xbb4f('0x54')][_0xbb4f('0x33')]);_0x36c507[_0xbb4f('0x36')]=_[_0xbb4f('0x35')](_0x28bd87[_0xbb4f('0x36')]);_0x36c507[_0xbb4f('0x43')]=_[_0xbb4f('0x39')](_0x36c507[_0xbb4f('0x34')],_0x36c507[_0xbb4f('0x36')]);_0x423cd3[_0xbb4f('0x3a')]=_[_0xbb4f('0x39')](_0x36c507[_0xbb4f('0x34')],qs['fields'](_0x28bd87[_0xbb4f('0x36')]['fields']));_0x423cd3[_0xbb4f('0x3a')]=_0x423cd3[_0xbb4f('0x3a')][_0xbb4f('0x3c')]?_0x423cd3[_0xbb4f('0x3a')]:_0x36c507[_0xbb4f('0x34')];_0x423cd3['order']=qs[_0xbb4f('0x41')](_0x28bd87[_0xbb4f('0x36')][_0xbb4f('0x41')]);_0x423cd3['where']=qs[_0xbb4f('0x43')](_[_0xbb4f('0x55')](_0x28bd87[_0xbb4f('0x36')],_0x36c507['filters']));if(_0x28bd87[_0xbb4f('0x36')]['filter']){_0x423cd3['where']=_[_0xbb4f('0x46')](_0x423cd3[_0xbb4f('0x42')],{'$or':_[_0xbb4f('0x48')](_0x423cd3['attributes'],function(_0x3752c0){var _0x1e0845={};_0x1e0845[_0x3752c0]={'$like':'%'+_0x28bd87['query']['filter']+'%'};return _0x1e0845;})});}_0x423cd3=_[_0xbb4f('0x46')]({},_0x423cd3,_0x28bd87['options']);return _0x384ca4[_0xbb4f('0x58')](_0x423cd3);}})['then'](function(_0x310f9d){if(_0x310f9d){_0x197fab=_0x310f9d['length'];if(!_0x28bd87[_0xbb4f('0x36')][_0xbb4f('0x3d')](_0xbb4f('0x3e'))){_0x423cd3[_0xbb4f('0x3f')]=qs[_0xbb4f('0x3f')](_0x28bd87['query'][_0xbb4f('0x3f')]);_0x423cd3['offset']=qs['offset'](_0x28bd87[_0xbb4f('0x36')]['offset']);}return _0x384ca4[_0xbb4f('0x58')](_0x423cd3);}})[_0xbb4f('0x2c')](function(_0xc153d2){if(_0xc153d2){return _0xc153d2?{'count':_0x197fab,'rows':_0xc153d2}:null;}})[_0xbb4f('0x2c')](respondWithResult(_0x2bfbda,null))[_0xbb4f('0x22')](handleError(_0x2bfbda,null));};
\ No newline at end of file
index 8bfa90f..7ccdd4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62f8=['request-promise','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','bluebird'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x62f8,0xec));var _0x862f=function(_0x4ab44e,_0x42ed73){_0x4ab44e=_0x4ab44e-0x0;var _0xafcdf6=_0x62f8[_0x4ab44e];return _0xafcdf6;};'use strict';var _=require(_0x862f('0x0'));var util=require(_0x862f('0x1'));var logger=require(_0x862f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x862f('0x3'));var rp=require(_0x862f('0x4'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x3b0029,_0x334d12){return _0x3b0029[_0x862f('0x5')](_0x862f('0x6'),attributes,{'tableName':_0x862f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x02a7=['../../config/logger','api','moment','bluebird','request-promise','./intSalesforceConfiguration.attributes','exports','int_salesforce_configurations','util'];(function(_0x246148,_0x1358ee){var _0x453d94=function(_0x59920e){while(--_0x59920e){_0x246148['push'](_0x246148['shift']());}};_0x453d94(++_0x1358ee);}(_0x02a7,0x1a6));var _0x702a=function(_0xdabd46,_0x5a8190){_0xdabd46=_0xdabd46-0x0;var _0x8294ac=_0x02a7[_0xdabd46];return _0x8294ac;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var logger=require(_0x702a('0x1'))(_0x702a('0x2'));var moment=require(_0x702a('0x3'));var BPromise=require(_0x702a('0x4'));var rp=require(_0x702a('0x5'));var attributes=require(_0x702a('0x6'));module[_0x702a('0x7')]=function(_0x2d9b1c,_0x358c63){return _0x2d9b1c['define']('SalesforceConfiguration',attributes,{'tableName':_0x702a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 847f41a..1207f6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6630=['../../config/utils','../../config/logger','jayson/promise','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','moment','bluebird','randomstring','../../mysqldb'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x6630,0x12e));var _0x0663=function(_0x5d3a27,_0x27743a){_0x5d3a27=_0x5d3a27-0x0;var _0x4a0443=_0x6630[_0x5d3a27];return _0x4a0443;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0663('0x0'));var BPromise=require(_0x0663('0x1'));var rs=require(_0x0663('0x2'));var fs=require('fs');var db=require(_0x0663('0x3'))['db'];var utils=require(_0x0663('0x4'));var logger=require(_0x0663('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0663('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xe93c41,_0x3506fe,_0x5ab37f){return new BPromise(function(_0x1e5135,_0x5648be){return client[_0x0663('0x7')](_0xe93c41,_0x5ab37f)[_0x0663('0x8')](function(_0x4cae9f){logger[_0x0663('0x9')](_0x0663('0xa'),_0x3506fe,'request\x20sent');logger[_0x0663('0xb')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x3506fe,_0x0663('0xc'),JSON['stringify'](_0x4cae9f));if(_0x4cae9f[_0x0663('0xd')]){if(_0x4cae9f[_0x0663('0xd')][_0x0663('0xe')]===0x1f4){logger[_0x0663('0xd')](_0x0663('0xa'),_0x3506fe,_0x4cae9f[_0x0663('0xd')][_0x0663('0xf')]);return _0x5648be(_0x4cae9f['error'][_0x0663('0xf')]);}logger[_0x0663('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3506fe,_0x4cae9f['error']['message']);return _0x1e5135(_0x4cae9f[_0x0663('0xd')][_0x0663('0xf')]);}else{logger[_0x0663('0x9')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3506fe,_0x0663('0xc'));_0x1e5135(_0x4cae9f[_0x0663('0x10')][_0x0663('0xf')]);}})['catch'](function(_0x2efdd5){logger[_0x0663('0xd')](_0x0663('0xa'),_0x3506fe,_0x2efdd5);_0x5648be(_0x2efdd5);});});}
\ No newline at end of file
+var _0xb2b8=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring'];(function(_0x312394,_0x268d6c){var _0x55ab6b=function(_0x117c5c){while(--_0x117c5c){_0x312394['push'](_0x312394['shift']());}};_0x55ab6b(++_0x268d6c);}(_0xb2b8,0x1e2));var _0x8b2b=function(_0x2c4cbd,_0x1bf601){_0x2c4cbd=_0x2c4cbd-0x0;var _0x1f11c1=_0xb2b8[_0x2c4cbd];return _0x1f11c1;};'use strict';var _=require(_0x8b2b('0x0'));var util=require(_0x8b2b('0x1'));var moment=require('moment');var BPromise=require(_0x8b2b('0x2'));var rs=require(_0x8b2b('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8b2b('0x4'))(_0x8b2b('0x5'));var config=require(_0x8b2b('0x6'));var jayson=require(_0x8b2b('0x7'));var client=jayson[_0x8b2b('0x8')][_0x8b2b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fa240,_0x12df77,_0x28400d){return new BPromise(function(_0x2dc7d0,_0xe66e4b){return client[_0x8b2b('0xa')](_0x3fa240,_0x28400d)['then'](function(_0x23884c){logger['info'](_0x8b2b('0xb'),_0x12df77,'request\x20sent');logger[_0x8b2b('0xc')](_0x8b2b('0xd'),_0x12df77,'request\x20sent',JSON[_0x8b2b('0xe')](_0x23884c));if(_0x23884c[_0x8b2b('0xf')]){if(_0x23884c[_0x8b2b('0xf')]['code']===0x1f4){logger[_0x8b2b('0xf')](_0x8b2b('0xb'),_0x12df77,_0x23884c[_0x8b2b('0xf')][_0x8b2b('0x10')]);return _0xe66e4b(_0x23884c[_0x8b2b('0xf')]['message']);}logger[_0x8b2b('0xf')](_0x8b2b('0xb'),_0x12df77,_0x23884c[_0x8b2b('0xf')][_0x8b2b('0x10')]);return _0x2dc7d0(_0x23884c[_0x8b2b('0xf')][_0x8b2b('0x10')]);}else{logger['info'](_0x8b2b('0xb'),_0x12df77,'request\x20sent');_0x2dc7d0(_0x23884c['result']['message']);}})[_0x8b2b('0x11')](function(_0x1465e5){logger[_0x8b2b('0xf')](_0x8b2b('0xb'),_0x12df77,_0x1465e5);_0xe66e4b(_0x1465e5);});});}
\ No newline at end of file
index dd3ad5a..8ef4f2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25d3=['create','put','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x59e9f3,_0xe4042a){var _0x39eeee=function(_0x51e5f0){while(--_0x51e5f0){_0x59e9f3['push'](_0x59e9f3['shift']());}};_0x39eeee(++_0xe4042a);}(_0x25d3,0x153));var _0x325d=function(_0x219fc2,_0x5ad000){_0x219fc2=_0x219fc2-0x0;var _0x34a9ec=_0x25d3[_0x219fc2];return _0x34a9ec;};'use strict';var multer=require(_0x325d('0x0'));var util=require(_0x325d('0x1'));var path=require(_0x325d('0x2'));var express=require('express');var router=express[_0x325d('0x3')]();var auth=require(_0x325d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x325d('0x5'));var controller=require(_0x325d('0x6'));router[_0x325d('0x7')]('/',auth[_0x325d('0x8')](),controller[_0x325d('0x9')]);router[_0x325d('0x7')](_0x325d('0xa'),auth[_0x325d('0x8')](),controller[_0x325d('0xb')]);router[_0x325d('0xc')]('/',auth[_0x325d('0x8')](),controller[_0x325d('0xd')]);router[_0x325d('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x325d('0x8')](),controller['destroy']);module[_0x325d('0xf')]=router;
\ No newline at end of file
+var _0x4872=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','util'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x4872,0x70));var _0x2487=function(_0x5a0d19,_0x55381f){_0x5a0d19=_0x5a0d19-0x0;var _0x404289=_0x4872[_0x5a0d19];return _0x404289;};'use strict';var multer=require(_0x2487('0x0'));var util=require(_0x2487('0x1'));var path=require(_0x2487('0x2'));var express=require(_0x2487('0x3'));var router=express[_0x2487('0x4')]();var auth=require(_0x2487('0x5'));var interaction=require(_0x2487('0x6'));var config=require(_0x2487('0x7'));var controller=require(_0x2487('0x8'));router[_0x2487('0x9')]('/',auth[_0x2487('0xa')](),controller[_0x2487('0xb')]);router['get'](_0x2487('0xc'),auth['isAuthenticated'](),controller[_0x2487('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2487('0xe')]);router['put'](_0x2487('0xc'),auth[_0x2487('0xa')](),controller[_0x2487('0xf')]);router[_0x2487('0x10')](_0x2487('0xc'),auth[_0x2487('0xa')](),controller[_0x2487('0x11')]);module[_0x2487('0x12')]=router;
\ No newline at end of file
index fda0fdd..e050017 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7767=['variable','keyValue','STRING','customVariable','exports','string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7767,0x112));var _0x7776=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x7767[_0x186376];return _0x2dbdd9;};'use strict';var Sequelize=require('sequelize');module[_0x7776('0x0')]={'type':{'type':Sequelize['ENUM'](_0x7776('0x1'),_0x7776('0x2'),'customVariable',_0x7776('0x3')),'defaultValue':_0x7776('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7776('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x7776('0x1'),_0x7776('0x2'),_0x7776('0x5'))},'keyContent':{'type':Sequelize[_0x7776('0x4')]},'idField':{'type':Sequelize[_0x7776('0x4')]},'variableName':{'type':Sequelize[_0x7776('0x4')]}};
\ No newline at end of file
+var _0xf28f=['keyValue','STRING','sequelize','ENUM','string'];(function(_0xd95b05,_0x46018d){var _0x109df8=function(_0x1747b3){while(--_0x1747b3){_0xd95b05['push'](_0xd95b05['shift']());}};_0x109df8(++_0x46018d);}(_0xf28f,0xa2));var _0xff28=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0xf28f[_0xc67528];return _0x38e26d;};'use strict';var Sequelize=require(_0xff28('0x0'));module['exports']={'type':{'type':Sequelize[_0xff28('0x1')](_0xff28('0x2'),'variable','customVariable',_0xff28('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0xff28('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xff28('0x1')](_0xff28('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xff28('0x4')]},'idField':{'type':Sequelize[_0xff28('0x4')]},'variableName':{'type':Sequelize[_0xff28('0x4')]}};
\ No newline at end of file
index 5836064..b6822d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cf1=['count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SalesforceField','rawAttributes','model','query','dateEnd','dateStart','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day','filter','merge','options','includeAll','rows','catch','show','params','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','desk.js','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8cf1,0x101));var _0x18cf=function(_0x56c070,_0x30abe4){_0x56c070=_0x56c070-0x0;var _0x224cb5=_0x8cf1[_0x56c070];return _0x224cb5;};'use strict';var pdf=require(_0x18cf('0x0'));var emlformat=require(_0x18cf('0x1'));var rimraf=require(_0x18cf('0x2'));var zipdir=require(_0x18cf('0x3'));var jsonpatch=require(_0x18cf('0x4'));var rp=require(_0x18cf('0x5'));var moment=require(_0x18cf('0x6'));var BPromise=require(_0x18cf('0x7'));var Mustache=require(_0x18cf('0x8'));var util=require('util');var path=require('path');var sox=require(_0x18cf('0x9'));var csv=require(_0x18cf('0xa'));var ejs=require(_0x18cf('0xb'));var fs=require('fs');var _=require(_0x18cf('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x18cf('0xd'));var toCsv=require(_0x18cf('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var qs=require(_0x18cf('0xe'));var logger=require(_0x18cf('0xf'))(_0x18cf('0x10'));var utils=require(_0x18cf('0x11'));var config=require(_0x18cf('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x259f1b,_0x5468b1){_0x5468b1=_0x5468b1||0xcc;return function(_0x5ce5b9){if(_0x5ce5b9){return _0x259f1b[_0x18cf('0x13')](_0x5468b1);}return _0x259f1b[_0x18cf('0x14')](_0x5468b1)[_0x18cf('0x15')]();};}function respondWithResult(_0x5ef102,_0x5b8c83){_0x5b8c83=_0x5b8c83||0xc8;return function(_0x3a0143){if(_0x3a0143){return _0x5ef102[_0x18cf('0x14')](_0x5b8c83)[_0x18cf('0x16')](_0x3a0143);}};}function respondWithFilteredResult(_0x42c0fb,_0x2161a0){return function(_0x2f2fcc){if(_0x2f2fcc){var _0x16bda5=_0x2f2fcc[_0x18cf('0x17')],_0x262ebd=_0x2161a0[_0x18cf('0x18')],_0x3a2789=_0x2161a0[_0x18cf('0x18')]+_0x2161a0[_0x18cf('0x19')],_0x3c2cf1;if(_0x3a2789>=_0x16bda5){_0x3a2789=_0x16bda5;_0x3c2cf1=0xc8;}else{_0x3c2cf1=0xce;}_0x42c0fb[_0x18cf('0x14')](_0x3c2cf1);return _0x42c0fb['set'](_0x18cf('0x1a'),_0x262ebd+'-'+_0x3a2789+'/'+_0x16bda5)['json'](_0x2f2fcc);}return null;};}function patchUpdates(_0x1be284){return function(_0x5cb522){try{jsonpatch[_0x18cf('0x1b')](_0x5cb522,_0x1be284,!![]);}catch(_0xfa7bca){return BPromise[_0x18cf('0x1c')](_0xfa7bca);}return _0x5cb522[_0x18cf('0x1d')]();};}function saveUpdates(_0x245a3d,_0x3e4e10){return function(_0x5eac92){if(_0x5eac92){return _0x5eac92[_0x18cf('0x1e')](_0x245a3d)[_0x18cf('0x1f')](function(_0x480a89){return _0x480a89;});}return null;};}function removeEntity(_0x3c4621,_0x52bbd5){return function(_0x42f2d2){if(_0x42f2d2){return _0x42f2d2[_0x18cf('0x20')]()[_0x18cf('0x1f')](function(){_0x3c4621[_0x18cf('0x14')](0xcc)[_0x18cf('0x15')]();});}};}function handleEntityNotFound(_0x5c19cc,_0x365e75){return function(_0x9232f4){if(!_0x9232f4){_0x5c19cc['sendStatus'](0x194);}return _0x9232f4;};}function handleError(_0x5c7705,_0x511677){_0x511677=_0x511677||0x1f4;return function(_0x50fa56){logger[_0x18cf('0x21')](_0x50fa56[_0x18cf('0x22')]);if(_0x50fa56[_0x18cf('0x23')]){delete _0x50fa56[_0x18cf('0x23')];}_0x5c7705[_0x18cf('0x14')](_0x511677)[_0x18cf('0x24')](_0x50fa56);};}exports[_0x18cf('0x25')]=function(_0x546ad3,_0x3f8910){var _0x1b33f9={},_0x895c73={},_0x4f7eae={'count':0x0,'rows':[]};var _0x47df7e=db[_0x18cf('0x26')][_0x18cf('0x27')];_0x895c73[_0x18cf('0x28')]=_['keys'](_0x47df7e);var _0x402146={'dateStart':_0x546ad3[_0x18cf('0x29')]['dateStart'],'dateEnd':_0x546ad3[_0x18cf('0x29')][_0x18cf('0x2a')]};delete _0x546ad3['query'][_0x18cf('0x2b')];delete _0x546ad3[_0x18cf('0x29')][_0x18cf('0x2a')];_0x895c73['query']=_[_0x18cf('0x2c')](_0x546ad3[_0x18cf('0x29')]);_0x895c73[_0x18cf('0x2d')]=_[_0x18cf('0x2e')](_0x895c73['model'],_0x895c73[_0x18cf('0x29')]);_0x1b33f9[_0x18cf('0x2f')]=_[_0x18cf('0x2e')](_0x895c73[_0x18cf('0x28')],qs[_0x18cf('0x30')](_0x546ad3[_0x18cf('0x29')][_0x18cf('0x30')]));_0x1b33f9[_0x18cf('0x2f')]=_0x1b33f9[_0x18cf('0x2f')][_0x18cf('0x31')]?_0x1b33f9['attributes']:_0x895c73['model'];if(!_0x546ad3[_0x18cf('0x29')][_0x18cf('0x32')](_0x18cf('0x33'))){_0x1b33f9[_0x18cf('0x19')]=qs[_0x18cf('0x19')](_0x546ad3[_0x18cf('0x29')][_0x18cf('0x19')]);_0x1b33f9[_0x18cf('0x18')]=qs['offset'](_0x546ad3[_0x18cf('0x29')]['offset']);}_0x1b33f9[_0x18cf('0x34')]=qs[_0x18cf('0x35')](_0x546ad3[_0x18cf('0x29')][_0x18cf('0x35')]);_0x1b33f9[_0x18cf('0x36')]=qs[_0x18cf('0x2d')](_[_0x18cf('0x37')](_0x546ad3[_0x18cf('0x29')],_0x895c73[_0x18cf('0x2d')]));if(_0x402146[_0x18cf('0x2b')]){if(_0x402146[_0x18cf('0x2a')]){_0x402146[_0x18cf('0x2a')]=moment(_0x402146['dateEnd'])[_0x18cf('0x38')](0x1,_0x18cf('0x39'));}else{_0x402146[_0x18cf('0x2a')]=moment(_0x402146[_0x18cf('0x2b')])[_0x18cf('0x38')](0x1,_0x18cf('0x39'));}_['merge'](_0x1b33f9[_0x18cf('0x36')],{'createdAt':{'$gte':_0x402146[_0x18cf('0x2b')],'$lte':_0x402146['dateEnd']}});}if(_0x546ad3['query'][_0x18cf('0x3a')]){_0x1b33f9[_0x18cf('0x36')]=_[_0x18cf('0x3b')](_0x1b33f9[_0x18cf('0x36')],{'$or':_['map'](_0x1b33f9[_0x18cf('0x2f')],function(_0x58f7cd){var _0x7c3fbc={};_0x7c3fbc[_0x58f7cd]={'$like':'%'+_0x546ad3[_0x18cf('0x29')]['filter']+'%'};return _0x7c3fbc;})});}_0x1b33f9=_[_0x18cf('0x3b')]({},_0x1b33f9,_0x546ad3[_0x18cf('0x3c')]);var _0x4460c9={'where':_0x1b33f9['where']};return db[_0x18cf('0x26')][_0x18cf('0x17')](_0x4460c9)[_0x18cf('0x1f')](function(_0x507869){_0x4f7eae[_0x18cf('0x17')]=_0x507869;if(_0x546ad3[_0x18cf('0x29')][_0x18cf('0x3d')]){_0x1b33f9['include']=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x1b33f9);})[_0x18cf('0x1f')](function(_0x5d72ff){_0x4f7eae[_0x18cf('0x3e')]=_0x5d72ff;return _0x4f7eae;})[_0x18cf('0x1f')](respondWithFilteredResult(_0x3f8910,_0x1b33f9))[_0x18cf('0x3f')](handleError(_0x3f8910,null));};exports[_0x18cf('0x40')]=function(_0x496c4a,_0x38c67f){var _0x7f1771={'raw':!![],'where':{'id':_0x496c4a[_0x18cf('0x41')]['id']}},_0x21b1d1={};_0x21b1d1['model']=_[_0x18cf('0x2c')](db[_0x18cf('0x26')][_0x18cf('0x27')]);_0x21b1d1[_0x18cf('0x29')]=_[_0x18cf('0x2c')](_0x496c4a[_0x18cf('0x29')]);_0x21b1d1[_0x18cf('0x2d')]=_[_0x18cf('0x2e')](_0x21b1d1[_0x18cf('0x28')],_0x21b1d1['query']);_0x7f1771[_0x18cf('0x2f')]=_[_0x18cf('0x2e')](_0x21b1d1[_0x18cf('0x28')],qs[_0x18cf('0x30')](_0x496c4a[_0x18cf('0x29')][_0x18cf('0x30')]));_0x7f1771['attributes']=_0x7f1771[_0x18cf('0x2f')]['length']?_0x7f1771['attributes']:_0x21b1d1[_0x18cf('0x28')];if(_0x496c4a[_0x18cf('0x29')][_0x18cf('0x3d')]){_0x7f1771[_0x18cf('0x42')]=[{'all':!![]}];}_0x7f1771=_[_0x18cf('0x3b')]({},_0x7f1771,_0x496c4a[_0x18cf('0x3c')]);return db[_0x18cf('0x26')][_0x18cf('0x43')](_0x7f1771)[_0x18cf('0x1f')](handleEntityNotFound(_0x38c67f,null))[_0x18cf('0x1f')](respondWithResult(_0x38c67f,null))['catch'](handleError(_0x38c67f,null));};exports[_0x18cf('0x44')]=function(_0x51c605,_0x222cac){return db[_0x18cf('0x26')][_0x18cf('0x44')](_0x51c605[_0x18cf('0x45')],{})['then'](respondWithResult(_0x222cac,0xc9))['catch'](handleError(_0x222cac,null));};exports[_0x18cf('0x1e')]=function(_0x5d9cff,_0x456a3f){if(_0x5d9cff['body']['id']){delete _0x5d9cff[_0x18cf('0x45')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x5d9cff[_0x18cf('0x41')]['id']}})['then'](handleEntityNotFound(_0x456a3f,null))[_0x18cf('0x1f')](saveUpdates(_0x5d9cff[_0x18cf('0x45')],null))[_0x18cf('0x1f')](respondWithResult(_0x456a3f,null))[_0x18cf('0x3f')](handleError(_0x456a3f,null));};exports[_0x18cf('0x20')]=function(_0x27f8bf,_0x336112){return db['SalesforceField'][_0x18cf('0x43')]({'where':{'id':_0x27f8bf[_0x18cf('0x41')]['id']}})[_0x18cf('0x1f')](handleEntityNotFound(_0x336112,null))[_0x18cf('0x1f')](removeEntity(_0x336112,null))[_0x18cf('0x3f')](handleError(_0x336112,null));};
\ No newline at end of file
+var _0x7ab0=['save','then','destroy','sendStatus','error','stack','name','send','index','SalesforceField','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','add','day','merge','filter','map','options','includeAll','include','findAll','catch','show','params','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/utils','../../mysqldb','status','json','count','offset','limit','set','Content-Range','reject'];(function(_0x80dae8,_0x56d100){var _0x4954b0=function(_0x43c022){while(--_0x43c022){_0x80dae8['push'](_0x80dae8['shift']());}};_0x4954b0(++_0x56d100);}(_0x7ab0,0x1ce));var _0x07ab=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x7ab0[_0x46aff0];return _0x9d78cf;};'use strict';var pdf=require(_0x07ab('0x0'));var emlformat=require(_0x07ab('0x1'));var rimraf=require(_0x07ab('0x2'));var zipdir=require(_0x07ab('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x07ab('0x4'));var moment=require(_0x07ab('0x5'));var BPromise=require(_0x07ab('0x6'));var Mustache=require('mustache');var util=require(_0x07ab('0x7'));var path=require(_0x07ab('0x8'));var sox=require(_0x07ab('0x9'));var csv=require(_0x07ab('0xa'));var ejs=require(_0x07ab('0xb'));var fs=require('fs');var _=require(_0x07ab('0xc'));var squel=require('squel');var crypto=require(_0x07ab('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x07ab('0xe'));var toCsv=require('to-csv');var querystring=require(_0x07ab('0xf'));var Papa=require(_0x07ab('0x10'));var qs=require(_0x07ab('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x07ab('0x12'));var config=require('../../config/environment');var db=require(_0x07ab('0x13'))['db'];function respondWithStatusCode(_0x3c8346,_0x5c78d7){_0x5c78d7=_0x5c78d7||0xcc;return function(_0x59eada){if(_0x59eada){return _0x3c8346['sendStatus'](_0x5c78d7);}return _0x3c8346[_0x07ab('0x14')](_0x5c78d7)['end']();};}function respondWithResult(_0x23eaee,_0x36411b){_0x36411b=_0x36411b||0xc8;return function(_0x4d1f6b){if(_0x4d1f6b){return _0x23eaee[_0x07ab('0x14')](_0x36411b)[_0x07ab('0x15')](_0x4d1f6b);}};}function respondWithFilteredResult(_0x6f9df7,_0x5e9cb6){return function(_0x300fb9){if(_0x300fb9){var _0x465d68=_0x300fb9[_0x07ab('0x16')],_0x3d6d01=_0x5e9cb6[_0x07ab('0x17')],_0x3e9dd6=_0x5e9cb6[_0x07ab('0x17')]+_0x5e9cb6[_0x07ab('0x18')],_0x416112;if(_0x3e9dd6>=_0x465d68){_0x3e9dd6=_0x465d68;_0x416112=0xc8;}else{_0x416112=0xce;}_0x6f9df7[_0x07ab('0x14')](_0x416112);return _0x6f9df7[_0x07ab('0x19')](_0x07ab('0x1a'),_0x3d6d01+'-'+_0x3e9dd6+'/'+_0x465d68)['json'](_0x300fb9);}return null;};}function patchUpdates(_0x3f9435){return function(_0x394410){try{jsonpatch['apply'](_0x394410,_0x3f9435,!![]);}catch(_0x380a59){return BPromise[_0x07ab('0x1b')](_0x380a59);}return _0x394410[_0x07ab('0x1c')]();};}function saveUpdates(_0x284315,_0x1fae4a){return function(_0x4e1638){if(_0x4e1638){return _0x4e1638['update'](_0x284315)[_0x07ab('0x1d')](function(_0x349a20){return _0x349a20;});}return null;};}function removeEntity(_0x29d36e,_0x168602){return function(_0x139cc7){if(_0x139cc7){return _0x139cc7[_0x07ab('0x1e')]()['then'](function(){_0x29d36e[_0x07ab('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc15519,_0x1d53b1){return function(_0x49c63a){if(!_0x49c63a){_0xc15519[_0x07ab('0x1f')](0x194);}return _0x49c63a;};}function handleError(_0x5c1e19,_0x268d71){_0x268d71=_0x268d71||0x1f4;return function(_0x3cd04a){logger[_0x07ab('0x20')](_0x3cd04a[_0x07ab('0x21')]);if(_0x3cd04a['name']){delete _0x3cd04a[_0x07ab('0x22')];}_0x5c1e19[_0x07ab('0x14')](_0x268d71)[_0x07ab('0x23')](_0x3cd04a);};}exports[_0x07ab('0x24')]=function(_0x6735fe,_0xea9a2a){var _0x4c3d6c={},_0xc8ecfe={},_0x22b934={'count':0x0,'rows':[]};var _0x113b8b=db[_0x07ab('0x25')][_0x07ab('0x26')];_0xc8ecfe[_0x07ab('0x27')]=_[_0x07ab('0x28')](_0x113b8b);var _0xbd6d8e={'dateStart':_0x6735fe[_0x07ab('0x29')][_0x07ab('0x2a')],'dateEnd':_0x6735fe[_0x07ab('0x29')][_0x07ab('0x2b')]};delete _0x6735fe[_0x07ab('0x29')][_0x07ab('0x2a')];delete _0x6735fe[_0x07ab('0x29')][_0x07ab('0x2b')];_0xc8ecfe[_0x07ab('0x29')]=_[_0x07ab('0x28')](_0x6735fe['query']);_0xc8ecfe['filters']=_[_0x07ab('0x2c')](_0xc8ecfe[_0x07ab('0x27')],_0xc8ecfe[_0x07ab('0x29')]);_0x4c3d6c['attributes']=_[_0x07ab('0x2c')](_0xc8ecfe['model'],qs[_0x07ab('0x2d')](_0x6735fe['query'][_0x07ab('0x2d')]));_0x4c3d6c[_0x07ab('0x2e')]=_0x4c3d6c['attributes'][_0x07ab('0x2f')]?_0x4c3d6c['attributes']:_0xc8ecfe[_0x07ab('0x27')];if(!_0x6735fe[_0x07ab('0x29')][_0x07ab('0x30')](_0x07ab('0x31'))){_0x4c3d6c[_0x07ab('0x18')]=qs[_0x07ab('0x18')](_0x6735fe[_0x07ab('0x29')][_0x07ab('0x18')]);_0x4c3d6c[_0x07ab('0x17')]=qs[_0x07ab('0x17')](_0x6735fe[_0x07ab('0x29')]['offset']);}_0x4c3d6c['order']=qs[_0x07ab('0x32')](_0x6735fe[_0x07ab('0x29')][_0x07ab('0x32')]);_0x4c3d6c[_0x07ab('0x33')]=qs[_0x07ab('0x34')](_[_0x07ab('0x35')](_0x6735fe[_0x07ab('0x29')],_0xc8ecfe[_0x07ab('0x34')]));if(_0xbd6d8e['dateStart']){if(_0xbd6d8e[_0x07ab('0x2b')]){_0xbd6d8e['dateEnd']=moment(_0xbd6d8e['dateEnd'])[_0x07ab('0x36')](0x1,'day');}else{_0xbd6d8e[_0x07ab('0x2b')]=moment(_0xbd6d8e[_0x07ab('0x2a')])[_0x07ab('0x36')](0x1,_0x07ab('0x37'));}_[_0x07ab('0x38')](_0x4c3d6c[_0x07ab('0x33')],{'createdAt':{'$gte':_0xbd6d8e[_0x07ab('0x2a')],'$lte':_0xbd6d8e[_0x07ab('0x2b')]}});}if(_0x6735fe[_0x07ab('0x29')][_0x07ab('0x39')]){_0x4c3d6c[_0x07ab('0x33')]=_[_0x07ab('0x38')](_0x4c3d6c[_0x07ab('0x33')],{'$or':_[_0x07ab('0x3a')](_0x4c3d6c[_0x07ab('0x2e')],function(_0x4624f0){var _0x500383={};_0x500383[_0x4624f0]={'$like':'%'+_0x6735fe[_0x07ab('0x29')]['filter']+'%'};return _0x500383;})});}_0x4c3d6c=_['merge']({},_0x4c3d6c,_0x6735fe[_0x07ab('0x3b')]);var _0x57802d={'where':_0x4c3d6c[_0x07ab('0x33')]};return db[_0x07ab('0x25')][_0x07ab('0x16')](_0x57802d)[_0x07ab('0x1d')](function(_0x33c42c){_0x22b934[_0x07ab('0x16')]=_0x33c42c;if(_0x6735fe['query'][_0x07ab('0x3c')]){_0x4c3d6c[_0x07ab('0x3d')]=[{'all':!![]}];}return db[_0x07ab('0x25')][_0x07ab('0x3e')](_0x4c3d6c);})[_0x07ab('0x1d')](function(_0x5cee67){_0x22b934['rows']=_0x5cee67;return _0x22b934;})['then'](respondWithFilteredResult(_0xea9a2a,_0x4c3d6c))[_0x07ab('0x3f')](handleError(_0xea9a2a,null));};exports[_0x07ab('0x40')]=function(_0x5d144d,_0x304742){var _0x5478c2={'raw':!![],'where':{'id':_0x5d144d[_0x07ab('0x41')]['id']}},_0x5a2609={};_0x5a2609[_0x07ab('0x27')]=_[_0x07ab('0x28')](db[_0x07ab('0x25')][_0x07ab('0x26')]);_0x5a2609[_0x07ab('0x29')]=_[_0x07ab('0x28')](_0x5d144d[_0x07ab('0x29')]);_0x5a2609[_0x07ab('0x34')]=_[_0x07ab('0x2c')](_0x5a2609[_0x07ab('0x27')],_0x5a2609[_0x07ab('0x29')]);_0x5478c2[_0x07ab('0x2e')]=_[_0x07ab('0x2c')](_0x5a2609[_0x07ab('0x27')],qs[_0x07ab('0x2d')](_0x5d144d[_0x07ab('0x29')][_0x07ab('0x2d')]));_0x5478c2['attributes']=_0x5478c2[_0x07ab('0x2e')][_0x07ab('0x2f')]?_0x5478c2[_0x07ab('0x2e')]:_0x5a2609['model'];if(_0x5d144d[_0x07ab('0x29')]['includeAll']){_0x5478c2[_0x07ab('0x3d')]=[{'all':!![]}];}_0x5478c2=_['merge']({},_0x5478c2,_0x5d144d['options']);return db[_0x07ab('0x25')][_0x07ab('0x42')](_0x5478c2)['then'](handleEntityNotFound(_0x304742,null))[_0x07ab('0x1d')](respondWithResult(_0x304742,null))[_0x07ab('0x3f')](handleError(_0x304742,null));};exports[_0x07ab('0x43')]=function(_0x1febf1,_0x39de7b){return db[_0x07ab('0x25')]['create'](_0x1febf1[_0x07ab('0x44')],{})['then'](respondWithResult(_0x39de7b,0xc9))['catch'](handleError(_0x39de7b,null));};exports[_0x07ab('0x45')]=function(_0x38e5c7,_0x15bbd0){if(_0x38e5c7[_0x07ab('0x44')]['id']){delete _0x38e5c7[_0x07ab('0x44')]['id'];}return db['SalesforceField'][_0x07ab('0x42')]({'where':{'id':_0x38e5c7[_0x07ab('0x41')]['id']}})['then'](handleEntityNotFound(_0x15bbd0,null))[_0x07ab('0x1d')](saveUpdates(_0x38e5c7['body'],null))['then'](respondWithResult(_0x15bbd0,null))['catch'](handleError(_0x15bbd0,null));};exports[_0x07ab('0x1e')]=function(_0x3c5f79,_0x272ee1){return db['SalesforceField'][_0x07ab('0x42')]({'where':{'id':_0x3c5f79['params']['id']}})[_0x07ab('0x1d')](handleEntityNotFound(_0x272ee1,null))[_0x07ab('0x1d')](removeEntity(_0x272ee1,null))[_0x07ab('0x3f')](handleError(_0x272ee1,null));};
\ No newline at end of file
index 399985b..4d89656 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71a5=['lodash','util','moment','bluebird','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields'];(function(_0x4144eb,_0x396e6b){var _0x59e2f1=function(_0x56eefd){while(--_0x56eefd){_0x4144eb['push'](_0x4144eb['shift']());}};_0x59e2f1(++_0x396e6b);}(_0x71a5,0x168));var _0x571a=function(_0x2d86cf,_0x1ac2be){_0x2d86cf=_0x2d86cf-0x0;var _0x1043ca=_0x71a5[_0x2d86cf];return _0x1043ca;};'use strict';var _=require(_0x571a('0x0'));var util=require(_0x571a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x571a('0x2'));var BPromise=require(_0x571a('0x3'));var rp=require('request-promise');var attributes=require(_0x571a('0x4'));module[_0x571a('0x5')]=function(_0x5b4931,_0x4262fb){return _0x5b4931['define'](_0x571a('0x6'),attributes,{'tableName':_0x571a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2709=['SalesforceField','lodash','../../config/logger','api','bluebird','./intSalesforceField.attributes','exports','define'];(function(_0xd1aaf8,_0x472fe7){var _0x51f4f9=function(_0x21a218){while(--_0x21a218){_0xd1aaf8['push'](_0xd1aaf8['shift']());}};_0x51f4f9(++_0x472fe7);}(_0x2709,0x189));var _0x9270=function(_0x4845c4,_0x454184){_0x4845c4=_0x4845c4-0x0;var _0x17e512=_0x2709[_0x4845c4];return _0x17e512;};'use strict';var _=require(_0x9270('0x0'));var util=require('util');var logger=require(_0x9270('0x1'))(_0x9270('0x2'));var moment=require('moment');var BPromise=require(_0x9270('0x3'));var rp=require('request-promise');var attributes=require(_0x9270('0x4'));module[_0x9270('0x5')]=function(_0x326c2a,_0x2c09b6){return _0x326c2a[_0x9270('0x6')](_0x9270('0x7'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0a61f89..900b470 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x403b=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x138d14,_0x3118b6){var _0x26f13a=function(_0x5c3d44){while(--_0x5c3d44){_0x138d14['push'](_0x138d14['shift']());}};_0x26f13a(++_0x3118b6);}(_0x403b,0xd0));var _0xb403=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x403b[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xb403('0x0'));var util=require(_0xb403('0x1'));var moment=require('moment');var BPromise=require(_0xb403('0x2'));var rs=require(_0xb403('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0xb403('0x4'));var logger=require(_0xb403('0x5'))(_0xb403('0x6'));var config=require(_0xb403('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb403('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56c79a,_0x52f1e2,_0x4a2eb4){return new BPromise(function(_0xa57dca,_0x436bcc){return client['request'](_0x56c79a,_0x4a2eb4)[_0xb403('0x9')](function(_0x3c62ed){logger[_0xb403('0xa')](_0xb403('0xb'),_0x52f1e2,_0xb403('0xc'));logger[_0xb403('0xd')](_0xb403('0xe'),_0x52f1e2,_0xb403('0xc'),JSON[_0xb403('0xf')](_0x3c62ed));if(_0x3c62ed[_0xb403('0x10')]){if(_0x3c62ed['error'][_0xb403('0x11')]===0x1f4){logger['error'](_0xb403('0xb'),_0x52f1e2,_0x3c62ed[_0xb403('0x10')][_0xb403('0x12')]);return _0x436bcc(_0x3c62ed['error'][_0xb403('0x12')]);}logger[_0xb403('0x10')](_0xb403('0xb'),_0x52f1e2,_0x3c62ed[_0xb403('0x10')][_0xb403('0x12')]);return _0xa57dca(_0x3c62ed[_0xb403('0x10')][_0xb403('0x12')]);}else{logger[_0xb403('0xa')](_0xb403('0xb'),_0x52f1e2,_0xb403('0xc'));_0xa57dca(_0x3c62ed[_0xb403('0x13')][_0xb403('0x12')]);}})[_0xb403('0x14')](function(_0x53f5a7){logger['error']('SalesforceField,\x20%s,\x20%s',_0x52f1e2,_0x53f5a7);_0x436bcc(_0x53f5a7);});});}
\ No newline at end of file
+var _0x0c55=['rpc','jayson/promise','client','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','../../config/utils'];(function(_0x24e701,_0x384f2d){var _0x386593=function(_0x34043f){while(--_0x34043f){_0x24e701['push'](_0x24e701['shift']());}};_0x386593(++_0x384f2d);}(_0x0c55,0x74));var _0x50c5=function(_0x55409a,_0x53cae7){_0x55409a=_0x55409a-0x0;var _0x199afa=_0x0c55[_0x55409a];return _0x199afa;};'use strict';var _=require(_0x50c5('0x0'));var util=require('util');var moment=require(_0x50c5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x50c5('0x2'));var logger=require('../../config/logger')(_0x50c5('0x3'));var config=require('../../config/environment');var jayson=require(_0x50c5('0x4'));var client=jayson[_0x50c5('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28cb13,_0x16d8e6,_0x2459b0){return new BPromise(function(_0x505f5d,_0x3eaba3){return client[_0x50c5('0x6')](_0x28cb13,_0x2459b0)[_0x50c5('0x7')](function(_0x43ea5b){logger[_0x50c5('0x8')](_0x50c5('0x9'),_0x16d8e6,_0x50c5('0xa'));logger['debug'](_0x50c5('0xb'),_0x16d8e6,_0x50c5('0xa'),JSON['stringify'](_0x43ea5b));if(_0x43ea5b[_0x50c5('0xc')]){if(_0x43ea5b[_0x50c5('0xc')][_0x50c5('0xd')]===0x1f4){logger['error'](_0x50c5('0x9'),_0x16d8e6,_0x43ea5b['error'][_0x50c5('0xe')]);return _0x3eaba3(_0x43ea5b[_0x50c5('0xc')][_0x50c5('0xe')]);}logger[_0x50c5('0xc')](_0x50c5('0x9'),_0x16d8e6,_0x43ea5b[_0x50c5('0xc')][_0x50c5('0xe')]);return _0x505f5d(_0x43ea5b['error'][_0x50c5('0xe')]);}else{logger[_0x50c5('0x8')](_0x50c5('0x9'),_0x16d8e6,_0x50c5('0xa'));_0x505f5d(_0x43ea5b[_0x50c5('0xf')]['message']);}})[_0x50c5('0x10')](function(_0xcfbbbf){logger[_0x50c5('0xc')]('SalesforceField,\x20%s,\x20%s',_0x16d8e6,_0xcfbbbf);_0x3eaba3(_0xcfbbbf);});});}
\ No newline at end of file
index 45fe4a4..71c665d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17a8=['put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration'];(function(_0x537a19,_0x564063){var _0x523283=function(_0x3048c4){while(--_0x3048c4){_0x537a19['push'](_0x537a19['shift']());}};_0x523283(++_0x564063);}(_0x17a8,0x1e7));var _0x817a=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0x17a8[_0x503950];return _0x1657a9;};'use strict';var multer=require(_0x817a('0x0'));var util=require(_0x817a('0x1'));var path=require(_0x817a('0x2'));var express=require(_0x817a('0x3'));var router=express[_0x817a('0x4')]();var auth=require(_0x817a('0x5'));var interaction=require(_0x817a('0x6'));var config=require(_0x817a('0x7'));var controller=require('./intSugarcrmAccount.controller');router['get']('/',auth[_0x817a('0x8')](),controller['index']);router[_0x817a('0x9')](_0x817a('0xa'),auth[_0x817a('0x8')](),controller[_0x817a('0xb')]);router[_0x817a('0x9')](_0x817a('0xc'),auth[_0x817a('0x8')](),controller['getConfigurations']);router[_0x817a('0x9')](_0x817a('0xd'),auth['isAuthenticated'](),controller[_0x817a('0xe')]);router['post']('/',auth[_0x817a('0x8')](),controller['create']);router[_0x817a('0xf')](_0x817a('0xc'),auth['isAuthenticated'](),controller[_0x817a('0x10')]);router[_0x817a('0x11')](_0x817a('0xa'),auth[_0x817a('0x8')](),controller[_0x817a('0x12')]);router['delete'](_0x817a('0xa'),auth[_0x817a('0x8')](),controller[_0x817a('0x13')]);module[_0x817a('0x14')]=router;
\ No newline at end of file
+var _0x65ec=['exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x65ec,0x139));var _0xc65e=function(_0x390c1c,_0x28536c){_0x390c1c=_0x390c1c-0x0;var _0x5d0b8a=_0x65ec[_0x390c1c];return _0x5d0b8a;};'use strict';var multer=require(_0xc65e('0x0'));var util=require(_0xc65e('0x1'));var path=require('path');var express=require(_0xc65e('0x2'));var router=express[_0xc65e('0x3')]();var auth=require(_0xc65e('0x4'));var interaction=require(_0xc65e('0x5'));var config=require(_0xc65e('0x6'));var controller=require(_0xc65e('0x7'));router[_0xc65e('0x8')]('/',auth[_0xc65e('0x9')](),controller[_0xc65e('0xa')]);router[_0xc65e('0x8')](_0xc65e('0xb'),auth['isAuthenticated'](),controller[_0xc65e('0xc')]);router['get'](_0xc65e('0xd'),auth[_0xc65e('0x9')](),controller[_0xc65e('0xe')]);router[_0xc65e('0x8')](_0xc65e('0xf'),auth[_0xc65e('0x9')](),controller[_0xc65e('0x10')]);router[_0xc65e('0x11')]('/',auth[_0xc65e('0x9')](),controller[_0xc65e('0x12')]);router[_0xc65e('0x11')](_0xc65e('0xd'),auth[_0xc65e('0x9')](),controller[_0xc65e('0x13')]);router['put'](_0xc65e('0xb'),auth[_0xc65e('0x9')](),controller[_0xc65e('0x14')]);router[_0xc65e('0x15')](_0xc65e('0xb'),auth[_0xc65e('0x9')](),controller[_0xc65e('0x16')]);module[_0xc65e('0x17')]=router;
\ No newline at end of file
index 8d41cc0..a1ae0ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7288=['exports','STRING','sequelize'];(function(_0x2b7675,_0x5969c9){var _0x4c4f97=function(_0x233188){while(--_0x233188){_0x2b7675['push'](_0x2b7675['shift']());}};_0x4c4f97(++_0x5969c9);}(_0x7288,0x11c));var _0x8728=function(_0x438377,_0x466127){_0x438377=_0x438377-0x0;var _0x44aa91=_0x7288[_0x438377];return _0x44aa91;};'use strict';var Sequelize=require(_0x8728('0x0'));module[_0x8728('0x1')]={'name':{'type':Sequelize[_0x8728('0x2')]},'description':{'type':Sequelize[_0x8728('0x2')]},'username':{'type':Sequelize[_0x8728('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x8728('0x2')]},'remoteUri':{'type':Sequelize[_0x8728('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x8728('0x2')]}};
\ No newline at end of file
+var _0x1c91=['username','remoteUri','sequelize','exports','STRING'];(function(_0x4524d1,_0x1723b8){var _0x3a240d=function(_0x28efb9){while(--_0x28efb9){_0x4524d1['push'](_0x4524d1['shift']());}};_0x3a240d(++_0x1723b8);}(_0x1c91,0x192));var _0x11c9=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x1c91[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require(_0x11c9('0x0'));module[_0x11c9('0x1')]={'name':{'type':Sequelize[_0x11c9('0x2')]},'description':{'type':Sequelize[_0x11c9('0x2')]},'username':{'type':Sequelize[_0x11c9('0x2')],'unique':_0x11c9('0x3')},'password':{'type':Sequelize[_0x11c9('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x11c9('0x4')},'serverUrl':{'type':Sequelize[_0x11c9('0x2')]}};
\ No newline at end of file
index 924a731..eb1f8dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb66c=['findAll','show','params','include','find','create','body','findOne','SugarcrmConfiguration','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','SugarcrmField','getFields','username','remoteUri','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','get_module_fields','Calls','values','module_fields','label','endsWith','value','test','statusCode','Wrong\x20credentials','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','request','SugarcrmAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','update','then','destroy','end','stack','name','index','SugarcrmAccount','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','add','merge','filter','map','options','includeAll'];(function(_0x2ae3e4,_0x1916ff){var _0x4d0dce=function(_0x43ab14){while(--_0x43ab14){_0x2ae3e4['push'](_0x2ae3e4['shift']());}};_0x4d0dce(++_0x1916ff);}(_0xb66c,0x175));var _0xcb66=function(_0x835582,_0x1bdec1){_0x835582=_0x835582-0x0;var _0x921560=_0xb66c[_0x835582];return _0x921560;};'use strict';var pdf=require(_0xcb66('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcb66('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcb66('0x2'));var rp=require(_0xcb66('0x3'));var moment=require(_0xcb66('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcb66('0x5'));var util=require(_0xcb66('0x6'));var path=require(_0xcb66('0x7'));var sox=require(_0xcb66('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xcb66('0x9'));var squel=require(_0xcb66('0xa'));var crypto=require(_0xcb66('0xb'));var jsforce=require(_0xcb66('0xc'));var deskjs=require(_0xcb66('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcb66('0xe'));var Papa=require(_0xcb66('0xf'));var qs=require(_0xcb66('0x10'));var logger=require(_0xcb66('0x11'))(_0xcb66('0x12'));var utils=require('../../config/utils');var config=require(_0xcb66('0x13'));var db=require(_0xcb66('0x14'))['db'];var integrations=require(_0xcb66('0x15'));var jayson=require(_0xcb66('0x16'));var client=jayson['client'][_0xcb66('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x3471f3,_0x4105d2,_0x2339bb,_0x582523){return new BPromise(function(_0x4079ae,_0x40c810){var _0x36c846=_0x582523||client;return _0x36c846[_0xcb66('0x18')](_0x3471f3,_0x2339bb)['then'](function(_0x19072b){logger['info'](_0xcb66('0x19'),_0x4105d2,'request\x20sent');logger[_0xcb66('0x1a')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x4105d2,'request\x20sent',JSON[_0xcb66('0x1b')](_0x19072b));if(_0x19072b[_0xcb66('0x1c')]){if(_0x19072b[_0xcb66('0x1c')][_0xcb66('0x1d')]===0x1f4){logger['error'](_0xcb66('0x19'),_0x4105d2,_0x19072b[_0xcb66('0x1c')][_0xcb66('0x1e')]);return _0x40c810(_0x19072b['error'][_0xcb66('0x1e')]);}logger['error'](_0xcb66('0x19'),_0x4105d2,_0x19072b[_0xcb66('0x1c')][_0xcb66('0x1e')]);return _0x4079ae(_0x19072b[_0xcb66('0x1c')]['message']);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x4105d2,_0xcb66('0x1f'));_0x4079ae(_0x19072b['result']['message']);}})[_0xcb66('0x20')](function(_0x507d5a){logger[_0xcb66('0x1c')](_0xcb66('0x19'),_0x4105d2,_0x507d5a);_0x40c810(_0x507d5a);});});}function respondWithStatusCode(_0x602b44,_0x433909){_0x433909=_0x433909||0xcc;return function(_0x1261d2){if(_0x1261d2){return _0x602b44[_0xcb66('0x21')](_0x433909);}return _0x602b44[_0xcb66('0x22')](_0x433909)['end']();};}function respondWithResult(_0x36faba,_0x51b5ce){_0x51b5ce=_0x51b5ce||0xc8;return function(_0x4cdcd9){if(_0x4cdcd9){return _0x36faba[_0xcb66('0x22')](_0x51b5ce)[_0xcb66('0x23')](_0x4cdcd9);}};}function respondWithFilteredResult(_0x19da3b,_0x5f389f){return function(_0x341554){if(_0x341554){var _0x196ef6=_0x341554[_0xcb66('0x24')],_0x43cd8f=_0x5f389f[_0xcb66('0x25')],_0x40e3de=_0x5f389f[_0xcb66('0x25')]+_0x5f389f[_0xcb66('0x26')],_0x5affdb;if(_0x40e3de>=_0x196ef6){_0x40e3de=_0x196ef6;_0x5affdb=0xc8;}else{_0x5affdb=0xce;}_0x19da3b[_0xcb66('0x22')](_0x5affdb);return _0x19da3b[_0xcb66('0x27')](_0xcb66('0x28'),_0x43cd8f+'-'+_0x40e3de+'/'+_0x196ef6)[_0xcb66('0x23')](_0x341554);}return null;};}function patchUpdates(_0x28fc0b){return function(_0x178a06){try{jsonpatch['apply'](_0x178a06,_0x28fc0b,!![]);}catch(_0x2152dc){return BPromise['reject'](_0x2152dc);}return _0x178a06['save']();};}function saveUpdates(_0x58cd2b,_0x31a10a){return function(_0x4ca8b4){if(_0x4ca8b4){return _0x4ca8b4[_0xcb66('0x29')](_0x58cd2b)[_0xcb66('0x2a')](function(_0x1b8a79){return _0x1b8a79;});}return null;};}function removeEntity(_0x5d3fb5,_0x123787){return function(_0x1df50e){if(_0x1df50e){return _0x1df50e[_0xcb66('0x2b')]()[_0xcb66('0x2a')](function(){_0x5d3fb5[_0xcb66('0x22')](0xcc)[_0xcb66('0x2c')]();});}};}function handleEntityNotFound(_0x2a5e56,_0x36dfe3){return function(_0x2d27f7){if(!_0x2d27f7){_0x2a5e56[_0xcb66('0x21')](0x194);}return _0x2d27f7;};}function handleError(_0x521350,_0x4529e8){_0x4529e8=_0x4529e8||0x1f4;return function(_0x1c5051){logger[_0xcb66('0x1c')](_0x1c5051[_0xcb66('0x2d')]);if(_0x1c5051[_0xcb66('0x2e')]){delete _0x1c5051[_0xcb66('0x2e')];}_0x521350[_0xcb66('0x22')](_0x4529e8)['send'](_0x1c5051);};}exports[_0xcb66('0x2f')]=function(_0x331305,_0x216072){var _0x37f522={},_0x4c97b4={},_0x1a9545={'count':0x0,'rows':[]};var _0x17a21a=db[_0xcb66('0x30')][_0xcb66('0x31')];_0x4c97b4[_0xcb66('0x32')]=_[_0xcb66('0x33')](_0x17a21a);var _0x150c6b={'dateStart':_0x331305[_0xcb66('0x34')][_0xcb66('0x35')],'dateEnd':_0x331305[_0xcb66('0x34')][_0xcb66('0x36')]};delete _0x331305[_0xcb66('0x34')]['dateStart'];delete _0x331305['query']['dateEnd'];_0x4c97b4[_0xcb66('0x34')]=_[_0xcb66('0x33')](_0x331305[_0xcb66('0x34')]);_0x4c97b4[_0xcb66('0x37')]=_[_0xcb66('0x38')](_0x4c97b4[_0xcb66('0x32')],_0x4c97b4['query']);_0x37f522[_0xcb66('0x39')]=_['intersection'](_0x4c97b4['model'],qs['fields'](_0x331305[_0xcb66('0x34')][_0xcb66('0x3a')]));_0x37f522[_0xcb66('0x39')]=_0x37f522[_0xcb66('0x39')][_0xcb66('0x3b')]?_0x37f522[_0xcb66('0x39')]:_0x4c97b4[_0xcb66('0x32')];if(!_0x331305[_0xcb66('0x34')][_0xcb66('0x3c')]('nolimit')){_0x37f522[_0xcb66('0x26')]=qs[_0xcb66('0x26')](_0x331305[_0xcb66('0x34')]['limit']);_0x37f522[_0xcb66('0x25')]=qs[_0xcb66('0x25')](_0x331305['query']['offset']);}_0x37f522[_0xcb66('0x3d')]=qs['sort'](_0x331305['query'][_0xcb66('0x3e')]);_0x37f522[_0xcb66('0x3f')]=qs[_0xcb66('0x37')](_[_0xcb66('0x40')](_0x331305[_0xcb66('0x34')],_0x4c97b4[_0xcb66('0x37')]));if(_0x150c6b[_0xcb66('0x35')]){if(_0x150c6b[_0xcb66('0x36')]){_0x150c6b[_0xcb66('0x36')]=moment(_0x150c6b['dateEnd'])['add'](0x1,'day');}else{_0x150c6b[_0xcb66('0x36')]=moment(_0x150c6b['dateStart'])[_0xcb66('0x41')](0x1,'day');}_[_0xcb66('0x42')](_0x37f522[_0xcb66('0x3f')],{'createdAt':{'$gte':_0x150c6b[_0xcb66('0x35')],'$lte':_0x150c6b[_0xcb66('0x36')]}});}if(_0x331305[_0xcb66('0x34')][_0xcb66('0x43')]){_0x37f522['where']=_['merge'](_0x37f522[_0xcb66('0x3f')],{'$or':_[_0xcb66('0x44')](_0x37f522[_0xcb66('0x39')],function(_0xc4026){var _0xf2c532={};_0xf2c532[_0xc4026]={'$like':'%'+_0x331305[_0xcb66('0x34')][_0xcb66('0x43')]+'%'};return _0xf2c532;})});}_0x37f522=_[_0xcb66('0x42')]({},_0x37f522,_0x331305[_0xcb66('0x45')]);var _0x5a0123={'where':_0x37f522[_0xcb66('0x3f')]};return db[_0xcb66('0x30')][_0xcb66('0x24')](_0x5a0123)[_0xcb66('0x2a')](function(_0x4a2465){_0x1a9545[_0xcb66('0x24')]=_0x4a2465;if(_0x331305[_0xcb66('0x34')][_0xcb66('0x46')]){_0x37f522['include']=[{'all':!![]}];}return db[_0xcb66('0x30')][_0xcb66('0x47')](_0x37f522);})[_0xcb66('0x2a')](function(_0x3a8192){_0x1a9545['rows']=_0x3a8192;return _0x1a9545;})[_0xcb66('0x2a')](respondWithFilteredResult(_0x216072,_0x37f522))[_0xcb66('0x20')](handleError(_0x216072,null));};exports[_0xcb66('0x48')]=function(_0x4b1d46,_0x4d4e08){var _0x3e967c={'raw':![],'where':{'id':_0x4b1d46[_0xcb66('0x49')]['id']}},_0x5defd3={};_0x5defd3['model']=_[_0xcb66('0x33')](db[_0xcb66('0x30')][_0xcb66('0x31')]);_0x5defd3['query']=_[_0xcb66('0x33')](_0x4b1d46['query']);_0x5defd3[_0xcb66('0x37')]=_[_0xcb66('0x38')](_0x5defd3[_0xcb66('0x32')],_0x5defd3[_0xcb66('0x34')]);_0x3e967c[_0xcb66('0x39')]=_['intersection'](_0x5defd3[_0xcb66('0x32')],qs['fields'](_0x4b1d46[_0xcb66('0x34')][_0xcb66('0x3a')]));_0x3e967c[_0xcb66('0x39')]=_0x3e967c['attributes']['length']?_0x3e967c['attributes']:_0x5defd3[_0xcb66('0x32')];if(_0x4b1d46[_0xcb66('0x34')][_0xcb66('0x46')]){_0x3e967c[_0xcb66('0x4a')]=[{'all':!![]}];}_0x3e967c=_[_0xcb66('0x42')]({},_0x3e967c,_0x4b1d46[_0xcb66('0x45')]);return db[_0xcb66('0x30')][_0xcb66('0x4b')](_0x3e967c)[_0xcb66('0x2a')](handleEntityNotFound(_0x4d4e08,null))[_0xcb66('0x2a')](respondWithResult(_0x4d4e08,null))['catch'](handleError(_0x4d4e08,null));};exports[_0xcb66('0x4c')]=function(_0x29daa9,_0x194b81){return db[_0xcb66('0x30')]['create'](_0x29daa9['body'],{})[_0xcb66('0x2a')](respondWithResult(_0x194b81,0xc9))[_0xcb66('0x20')](handleError(_0x194b81,null));};exports[_0xcb66('0x29')]=function(_0x37bd10,_0xff3820){if(_0x37bd10[_0xcb66('0x4d')]['id']){delete _0x37bd10['body']['id'];}return db[_0xcb66('0x30')][_0xcb66('0x4b')]({'where':{'id':_0x37bd10[_0xcb66('0x49')]['id']}})[_0xcb66('0x2a')](handleEntityNotFound(_0xff3820,null))['then'](saveUpdates(_0x37bd10[_0xcb66('0x4d')],null))['then'](respondWithResult(_0xff3820,null))[_0xcb66('0x20')](handleError(_0xff3820,null));};exports['destroy']=function(_0x11e42d,_0x274949){return db[_0xcb66('0x30')]['find']({'where':{'id':_0x11e42d['params']['id']}})[_0xcb66('0x2a')](handleEntityNotFound(_0x274949,null))[_0xcb66('0x2a')](removeEntity(_0x274949,null))['catch'](handleError(_0x274949,null));};exports['getConfigurations']=function(_0x23e6d6,_0x4f95c6,_0x3c9106){var _0x56e524={};var _0x341687={};var _0x26c39e;var _0x24671a;return db['SugarcrmAccount'][_0xcb66('0x4e')]({'where':{'id':_0x23e6d6[_0xcb66('0x49')]['id']}})['then'](handleEntityNotFound(_0x4f95c6,null))[_0xcb66('0x2a')](function(_0x27e83c){if(_0x27e83c){_0x26c39e=_0x27e83c;_0x341687[_0xcb66('0x32')]=_[_0xcb66('0x33')](db[_0xcb66('0x4f')][_0xcb66('0x31')]);_0x341687['query']=_[_0xcb66('0x33')](_0x23e6d6[_0xcb66('0x34')]);_0x341687[_0xcb66('0x37')]=_[_0xcb66('0x38')](_0x341687[_0xcb66('0x32')],_0x341687[_0xcb66('0x34')]);_0x56e524[_0xcb66('0x39')]=_[_0xcb66('0x38')](_0x341687[_0xcb66('0x32')],qs['fields'](_0x23e6d6[_0xcb66('0x34')][_0xcb66('0x3a')]));_0x56e524[_0xcb66('0x39')]=_0x56e524[_0xcb66('0x39')][_0xcb66('0x3b')]?_0x56e524[_0xcb66('0x39')]:_0x341687['model'];_0x56e524[_0xcb66('0x3d')]=qs[_0xcb66('0x3e')](_0x23e6d6['query'][_0xcb66('0x3e')]);_0x56e524[_0xcb66('0x3f')]=qs[_0xcb66('0x37')](_[_0xcb66('0x40')](_0x23e6d6['query'],_0x341687[_0xcb66('0x37')]));if(_0x23e6d6[_0xcb66('0x34')][_0xcb66('0x43')]){_0x56e524[_0xcb66('0x3f')]=_[_0xcb66('0x42')](_0x56e524[_0xcb66('0x3f')],{'$or':_[_0xcb66('0x44')](_0x56e524[_0xcb66('0x39')],function(_0x275dfd){var _0x22ae6d={};_0x22ae6d[_0x275dfd]={'$like':'%'+_0x23e6d6['query'][_0xcb66('0x43')]+'%'};return _0x22ae6d;})});}_0x56e524=_[_0xcb66('0x42')]({},_0x56e524,_0x23e6d6[_0xcb66('0x45')]);return _0x26c39e[_0xcb66('0x50')](_0x56e524);}})['then'](function(_0x3c4776){if(_0x3c4776){_0x24671a=_0x3c4776[_0xcb66('0x3b')];if(!_0x23e6d6[_0xcb66('0x34')][_0xcb66('0x3c')](_0xcb66('0x51'))){_0x56e524[_0xcb66('0x26')]=qs[_0xcb66('0x26')](_0x23e6d6['query']['limit']);_0x56e524[_0xcb66('0x25')]=qs[_0xcb66('0x25')](_0x23e6d6[_0xcb66('0x34')][_0xcb66('0x25')]);}return _0x26c39e[_0xcb66('0x50')](_0x56e524);}})[_0xcb66('0x2a')](function(_0x5678a3){if(_0x5678a3){return _0x5678a3?{'count':_0x24671a,'rows':_0x5678a3}:null;}})[_0xcb66('0x2a')](respondWithResult(_0x4f95c6,null))[_0xcb66('0x20')](handleError(_0x4f95c6,null));};exports[_0xcb66('0x52')]=function(_0x534cf4,_0x31036f,_0x16e0ec){if(_0x534cf4['body']['id']){delete _0x534cf4[_0xcb66('0x4d')]['id'];}return db[_0xcb66('0x30')][_0xcb66('0x4e')]({'where':{'id':_0x534cf4[_0xcb66('0x49')]['id']}})[_0xcb66('0x2a')](handleEntityNotFound(_0x31036f,null))[_0xcb66('0x2a')](function(_0xbf1a90){if(_0xbf1a90){_0x534cf4[_0xcb66('0x4d')][_0xcb66('0x53')]=_0xbf1a90['id'];_0x534cf4[_0xcb66('0x4d')][_0xcb66('0x54')]=integrations[_0xcb66('0x55')](_0x534cf4[_0xcb66('0x4d')][_0xcb66('0x56')],_0x534cf4[_0xcb66('0x4d')][_0xcb66('0x57')]);_0x534cf4[_0xcb66('0x4d')][_0xcb66('0x58')]=integrations[_0xcb66('0x59')](_0x534cf4['body'][_0xcb66('0x56')],_0x534cf4['body'][_0xcb66('0x57')]);return db['SugarcrmConfiguration'][_0xcb66('0x4c')](_0x534cf4[_0xcb66('0x4d')],{'include':[{'model':db[_0xcb66('0x5a')],'as':_0xcb66('0x54')},{'model':db[_0xcb66('0x5a')],'as':_0xcb66('0x58')}]});}return null;})[_0xcb66('0x2a')](respondWithResult(_0x31036f,null))[_0xcb66('0x20')](handleError(_0x31036f,null));};exports[_0xcb66('0x5b')]=function(_0x471a26,_0xf7c710,_0x309b72){var _0x44b995;return db['SugarcrmAccount'][_0xcb66('0x4e')]({'where':{'id':_0x471a26[_0xcb66('0x49')]['id']},'attributes':['id',_0xcb66('0x5c'),'password',_0xcb66('0x5d')]})[_0xcb66('0x2a')](handleEntityNotFound(_0xf7c710,null))[_0xcb66('0x2a')](function(_0x49db05){if(_0x49db05){_0x44b995=_0x49db05[_0xcb66('0x5d')];return rp({'method':_0xcb66('0x5e'),'uri':util[_0xcb66('0x5f')](_0xcb66('0x60'),_0x44b995,_0xcb66('0x61')),'json':!![],'form':{'method':_0xcb66('0x62'),'input_type':'JSON','response_type':_0xcb66('0x63'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x49db05[_0xcb66('0x5c')],'password':_0x49db05['password'],'encryption':_0xcb66('0x64')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xcb66('0x2a')](function(_0x20fb30){if(_0x20fb30){return rp({'method':_0xcb66('0x5e'),'uri':util['format'](_0xcb66('0x60'),_0x44b995,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xcb66('0x65'),'input_type':_0xcb66('0x63'),'response_type':_0xcb66('0x63'),'rest_data':JSON[_0xcb66('0x1b')]({'session':_0x20fb30['id'],'module_name':_0xcb66('0x66')})}});}})['then'](function(_0x2a8a82){if(_0x2a8a82){var _0xfa72ee=_[_0xcb66('0x67')](_0x2a8a82[_0xcb66('0x68')]);return{'count':_0xfa72ee['length'],'rows':_[_0xcb66('0x44')](_0xfa72ee,function(_0x469b1f){return{'id':_0x469b1f['name'],'name':_0x469b1f[_0xcb66('0x69')],'custom':_[_0xcb66('0x6a')](_0x469b1f[_0xcb66('0x2e')],'_c')?!![]:![],'options':_0x469b1f[_0xcb66('0x45')]?_['map'](_[_0xcb66('0x67')](_0x469b1f[_0xcb66('0x45')]),function(_0x2a7063){return{'name':_0x2a7063[_0xcb66('0x6b')],'value':_0x2a7063[_0xcb66('0x2e')]};}):[]};})};}})['then'](respondWithResult(_0xf7c710,null))[_0xcb66('0x20')](function(_0x1549b1){var _0x1c4b48=_0x471a26[_0xcb66('0x34')][_0xcb66('0x6c')]?0x1f4:_0x1549b1[_0xcb66('0x6d')]||0x1f4;logger[_0xcb66('0x1c')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x1c4b48,JSON['stringify'](_0x1549b1));delete _0x1549b1[_0xcb66('0x2e')];if(_0x1c4b48===0x191){_0x1c4b48=0x190;}_0xf7c710[_0xcb66('0x22')](_0x1c4b48)['send'](_0x471a26[_0xcb66('0x34')]['test']?{'message':_0xcb66('0x6e'),'statusCode':_0x1549b1[_0xcb66('0x6d')]}:_0x1549b1);});};
\ No newline at end of file
+var _0xfc76=['SugarcrmAccount','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','dateStart','dateEnd','day','add','merge','filter','includeAll','include','show','params','options','find','create','catch','update','body','findOne','SugarcrmConfiguration','rawAttributes','getConfigurations','nolimit','addConfiguration','Subjects','getSubjects','type','Descriptions','getDescriptions','channel','SugarcrmField','username','password','remoteUri','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','POST','get_module_fields','Calls','values','module_fields','map','label','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','request','then','request\x20sent','debug','stringify','error','SugarcrmAccount,\x20%s,\x20%s','message','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','stack','name','send','index'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xfc76,0xb5));var _0x6fc7=function(_0x43b750,_0x440bff){_0x43b750=_0x43b750-0x0;var _0x3d997a=_0xfc76[_0x43b750];return _0x3d997a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6fc7('0x0'));var rimraf=require(_0x6fc7('0x1'));var zipdir=require(_0x6fc7('0x2'));var jsonpatch=require(_0x6fc7('0x3'));var rp=require(_0x6fc7('0x4'));var moment=require('moment');var BPromise=require(_0x6fc7('0x5'));var Mustache=require(_0x6fc7('0x6'));var util=require('util');var path=require(_0x6fc7('0x7'));var sox=require('sox');var csv=require(_0x6fc7('0x8'));var ejs=require(_0x6fc7('0x9'));var fs=require('fs');var _=require(_0x6fc7('0xa'));var squel=require('squel');var crypto=require(_0x6fc7('0xb'));var jsforce=require(_0x6fc7('0xc'));var deskjs=require(_0x6fc7('0xd'));var toCsv=require(_0x6fc7('0x8'));var querystring=require(_0x6fc7('0xe'));var Papa=require(_0x6fc7('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x6fc7('0x10'))(_0x6fc7('0x11'));var utils=require(_0x6fc7('0x12'));var config=require(_0x6fc7('0x13'));var db=require(_0x6fc7('0x14'))['db'];var integrations=require(_0x6fc7('0x15'));var jayson=require('jayson/promise');var client=jayson[_0x6fc7('0x16')][_0x6fc7('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x5cd139,_0x433adc,_0x2c32b8,_0x5f438d){return new BPromise(function(_0x1728ef,_0xd537f){var _0x4af729=_0x5f438d||client;return _0x4af729[_0x6fc7('0x18')](_0x5cd139,_0x2c32b8)[_0x6fc7('0x19')](function(_0x10a482){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x433adc,_0x6fc7('0x1a'));logger[_0x6fc7('0x1b')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x433adc,_0x6fc7('0x1a'),JSON[_0x6fc7('0x1c')](_0x10a482));if(_0x10a482[_0x6fc7('0x1d')]){if(_0x10a482[_0x6fc7('0x1d')]['code']===0x1f4){logger[_0x6fc7('0x1d')](_0x6fc7('0x1e'),_0x433adc,_0x10a482[_0x6fc7('0x1d')][_0x6fc7('0x1f')]);return _0xd537f(_0x10a482[_0x6fc7('0x1d')][_0x6fc7('0x1f')]);}logger['error'](_0x6fc7('0x1e'),_0x433adc,_0x10a482[_0x6fc7('0x1d')][_0x6fc7('0x1f')]);return _0x1728ef(_0x10a482[_0x6fc7('0x1d')][_0x6fc7('0x1f')]);}else{logger['info'](_0x6fc7('0x1e'),_0x433adc,_0x6fc7('0x1a'));_0x1728ef(_0x10a482['result'][_0x6fc7('0x1f')]);}})['catch'](function(_0x453bae){logger['error'](_0x6fc7('0x1e'),_0x433adc,_0x453bae);_0xd537f(_0x453bae);});});}function respondWithStatusCode(_0xdb5974,_0x1bfa75){_0x1bfa75=_0x1bfa75||0xcc;return function(_0x5c83ad){if(_0x5c83ad){return _0xdb5974[_0x6fc7('0x20')](_0x1bfa75);}return _0xdb5974['status'](_0x1bfa75)[_0x6fc7('0x21')]();};}function respondWithResult(_0xdd4827,_0x2229a1){_0x2229a1=_0x2229a1||0xc8;return function(_0x1e79b9){if(_0x1e79b9){return _0xdd4827[_0x6fc7('0x22')](_0x2229a1)[_0x6fc7('0x23')](_0x1e79b9);}};}function respondWithFilteredResult(_0x190680,_0x817221){return function(_0x2b6b55){if(_0x2b6b55){var _0x2759ad=_0x2b6b55[_0x6fc7('0x24')],_0xaa2687=_0x817221[_0x6fc7('0x25')],_0x426872=_0x817221['offset']+_0x817221[_0x6fc7('0x26')],_0x4612d4;if(_0x426872>=_0x2759ad){_0x426872=_0x2759ad;_0x4612d4=0xc8;}else{_0x4612d4=0xce;}_0x190680[_0x6fc7('0x22')](_0x4612d4);return _0x190680[_0x6fc7('0x27')](_0x6fc7('0x28'),_0xaa2687+'-'+_0x426872+'/'+_0x2759ad)['json'](_0x2b6b55);}return null;};}function patchUpdates(_0xfff989){return function(_0x30e579){try{jsonpatch[_0x6fc7('0x29')](_0x30e579,_0xfff989,!![]);}catch(_0x2aa91c){return BPromise[_0x6fc7('0x2a')](_0x2aa91c);}return _0x30e579[_0x6fc7('0x2b')]();};}function saveUpdates(_0x367b37,_0x2428c9){return function(_0x59a70e){if(_0x59a70e){return _0x59a70e['update'](_0x367b37)[_0x6fc7('0x19')](function(_0x17ddfe){return _0x17ddfe;});}return null;};}function removeEntity(_0x3e796a,_0x2ce491){return function(_0x3f89f2){if(_0x3f89f2){return _0x3f89f2[_0x6fc7('0x2c')]()['then'](function(){_0x3e796a[_0x6fc7('0x22')](0xcc)[_0x6fc7('0x21')]();});}};}function handleEntityNotFound(_0x16c514,_0x197a54){return function(_0x5a6355){if(!_0x5a6355){_0x16c514['sendStatus'](0x194);}return _0x5a6355;};}function handleError(_0x4973d6,_0xb80178){_0xb80178=_0xb80178||0x1f4;return function(_0x23bd52){logger[_0x6fc7('0x1d')](_0x23bd52[_0x6fc7('0x2d')]);if(_0x23bd52[_0x6fc7('0x2e')]){delete _0x23bd52[_0x6fc7('0x2e')];}_0x4973d6[_0x6fc7('0x22')](_0xb80178)[_0x6fc7('0x2f')](_0x23bd52);};}exports[_0x6fc7('0x30')]=function(_0x54e5d5,_0x13c800){var _0x549b27={},_0x40ee9c={},_0x10ea08={'count':0x0,'rows':[]};var _0x3c2167=db[_0x6fc7('0x31')]['rawAttributes'];_0x40ee9c[_0x6fc7('0x32')]=_[_0x6fc7('0x33')](_0x3c2167);var _0x182d04={'dateStart':_0x54e5d5[_0x6fc7('0x34')]['dateStart'],'dateEnd':_0x54e5d5[_0x6fc7('0x34')]['dateEnd']};delete _0x54e5d5[_0x6fc7('0x34')]['dateStart'];delete _0x54e5d5['query']['dateEnd'];_0x40ee9c[_0x6fc7('0x34')]=_['keys'](_0x54e5d5[_0x6fc7('0x34')]);_0x40ee9c[_0x6fc7('0x35')]=_[_0x6fc7('0x36')](_0x40ee9c[_0x6fc7('0x32')],_0x40ee9c[_0x6fc7('0x34')]);_0x549b27[_0x6fc7('0x37')]=_[_0x6fc7('0x36')](_0x40ee9c[_0x6fc7('0x32')],qs[_0x6fc7('0x38')](_0x54e5d5[_0x6fc7('0x34')][_0x6fc7('0x38')]));_0x549b27[_0x6fc7('0x37')]=_0x549b27[_0x6fc7('0x37')][_0x6fc7('0x39')]?_0x549b27[_0x6fc7('0x37')]:_0x40ee9c[_0x6fc7('0x32')];if(!_0x54e5d5[_0x6fc7('0x34')][_0x6fc7('0x3a')]('nolimit')){_0x549b27['limit']=qs[_0x6fc7('0x26')](_0x54e5d5[_0x6fc7('0x34')][_0x6fc7('0x26')]);_0x549b27[_0x6fc7('0x25')]=qs['offset'](_0x54e5d5[_0x6fc7('0x34')][_0x6fc7('0x25')]);}_0x549b27[_0x6fc7('0x3b')]=qs[_0x6fc7('0x3c')](_0x54e5d5[_0x6fc7('0x34')][_0x6fc7('0x3c')]);_0x549b27[_0x6fc7('0x3d')]=qs[_0x6fc7('0x35')](_[_0x6fc7('0x3e')](_0x54e5d5[_0x6fc7('0x34')],_0x40ee9c[_0x6fc7('0x35')]));if(_0x182d04[_0x6fc7('0x3f')]){if(_0x182d04['dateEnd']){_0x182d04[_0x6fc7('0x40')]=moment(_0x182d04[_0x6fc7('0x40')])['add'](0x1,_0x6fc7('0x41'));}else{_0x182d04[_0x6fc7('0x40')]=moment(_0x182d04[_0x6fc7('0x3f')])[_0x6fc7('0x42')](0x1,_0x6fc7('0x41'));}_[_0x6fc7('0x43')](_0x549b27[_0x6fc7('0x3d')],{'createdAt':{'$gte':_0x182d04[_0x6fc7('0x3f')],'$lte':_0x182d04[_0x6fc7('0x40')]}});}if(_0x54e5d5[_0x6fc7('0x34')]['filter']){_0x549b27[_0x6fc7('0x3d')]=_[_0x6fc7('0x43')](_0x549b27['where'],{'$or':_['map'](_0x549b27[_0x6fc7('0x37')],function(_0x38ba18){var _0x4496e4={};_0x4496e4[_0x38ba18]={'$like':'%'+_0x54e5d5['query'][_0x6fc7('0x44')]+'%'};return _0x4496e4;})});}_0x549b27=_[_0x6fc7('0x43')]({},_0x549b27,_0x54e5d5['options']);var _0x12d65f={'where':_0x549b27[_0x6fc7('0x3d')]};return db[_0x6fc7('0x31')][_0x6fc7('0x24')](_0x12d65f)[_0x6fc7('0x19')](function(_0x2b24e8){_0x10ea08[_0x6fc7('0x24')]=_0x2b24e8;if(_0x54e5d5[_0x6fc7('0x34')][_0x6fc7('0x45')]){_0x549b27[_0x6fc7('0x46')]=[{'all':!![]}];}return db[_0x6fc7('0x31')]['findAll'](_0x549b27);})['then'](function(_0x4f4266){_0x10ea08['rows']=_0x4f4266;return _0x10ea08;})[_0x6fc7('0x19')](respondWithFilteredResult(_0x13c800,_0x549b27))['catch'](handleError(_0x13c800,null));};exports[_0x6fc7('0x47')]=function(_0x25e671,_0x297ad8){var _0x2a3ed0={'raw':![],'where':{'id':_0x25e671[_0x6fc7('0x48')]['id']}},_0x31f905={};_0x31f905['model']=_[_0x6fc7('0x33')](db[_0x6fc7('0x31')]['rawAttributes']);_0x31f905[_0x6fc7('0x34')]=_[_0x6fc7('0x33')](_0x25e671[_0x6fc7('0x34')]);_0x31f905[_0x6fc7('0x35')]=_[_0x6fc7('0x36')](_0x31f905[_0x6fc7('0x32')],_0x31f905[_0x6fc7('0x34')]);_0x2a3ed0[_0x6fc7('0x37')]=_[_0x6fc7('0x36')](_0x31f905[_0x6fc7('0x32')],qs['fields'](_0x25e671[_0x6fc7('0x34')][_0x6fc7('0x38')]));_0x2a3ed0[_0x6fc7('0x37')]=_0x2a3ed0['attributes'][_0x6fc7('0x39')]?_0x2a3ed0['attributes']:_0x31f905[_0x6fc7('0x32')];if(_0x25e671['query'][_0x6fc7('0x45')]){_0x2a3ed0[_0x6fc7('0x46')]=[{'all':!![]}];}_0x2a3ed0=_[_0x6fc7('0x43')]({},_0x2a3ed0,_0x25e671[_0x6fc7('0x49')]);return db[_0x6fc7('0x31')][_0x6fc7('0x4a')](_0x2a3ed0)[_0x6fc7('0x19')](handleEntityNotFound(_0x297ad8,null))[_0x6fc7('0x19')](respondWithResult(_0x297ad8,null))['catch'](handleError(_0x297ad8,null));};exports[_0x6fc7('0x4b')]=function(_0x3bcd5b,_0x262de2){return db[_0x6fc7('0x31')][_0x6fc7('0x4b')](_0x3bcd5b['body'],{})[_0x6fc7('0x19')](respondWithResult(_0x262de2,0xc9))[_0x6fc7('0x4c')](handleError(_0x262de2,null));};exports[_0x6fc7('0x4d')]=function(_0x1307da,_0x1927d6){if(_0x1307da[_0x6fc7('0x4e')]['id']){delete _0x1307da[_0x6fc7('0x4e')]['id'];}return db[_0x6fc7('0x31')][_0x6fc7('0x4a')]({'where':{'id':_0x1307da[_0x6fc7('0x48')]['id']}})[_0x6fc7('0x19')](handleEntityNotFound(_0x1927d6,null))['then'](saveUpdates(_0x1307da[_0x6fc7('0x4e')],null))[_0x6fc7('0x19')](respondWithResult(_0x1927d6,null))[_0x6fc7('0x4c')](handleError(_0x1927d6,null));};exports[_0x6fc7('0x2c')]=function(_0x4006a3,_0x2d2338){return db[_0x6fc7('0x31')][_0x6fc7('0x4a')]({'where':{'id':_0x4006a3['params']['id']}})[_0x6fc7('0x19')](handleEntityNotFound(_0x2d2338,null))['then'](removeEntity(_0x2d2338,null))['catch'](handleError(_0x2d2338,null));};exports['getConfigurations']=function(_0x674a1f,_0x41d634,_0xa01ad4){var _0x4a166c={};var _0x5d64bb={};var _0x1f2651;var _0x5a6411;return db[_0x6fc7('0x31')][_0x6fc7('0x4f')]({'where':{'id':_0x674a1f[_0x6fc7('0x48')]['id']}})[_0x6fc7('0x19')](handleEntityNotFound(_0x41d634,null))[_0x6fc7('0x19')](function(_0x376047){if(_0x376047){_0x1f2651=_0x376047;_0x5d64bb[_0x6fc7('0x32')]=_[_0x6fc7('0x33')](db[_0x6fc7('0x50')][_0x6fc7('0x51')]);_0x5d64bb['query']=_[_0x6fc7('0x33')](_0x674a1f[_0x6fc7('0x34')]);_0x5d64bb['filters']=_['intersection'](_0x5d64bb['model'],_0x5d64bb[_0x6fc7('0x34')]);_0x4a166c[_0x6fc7('0x37')]=_[_0x6fc7('0x36')](_0x5d64bb[_0x6fc7('0x32')],qs[_0x6fc7('0x38')](_0x674a1f[_0x6fc7('0x34')]['fields']));_0x4a166c[_0x6fc7('0x37')]=_0x4a166c[_0x6fc7('0x37')]['length']?_0x4a166c['attributes']:_0x5d64bb[_0x6fc7('0x32')];_0x4a166c[_0x6fc7('0x3b')]=qs[_0x6fc7('0x3c')](_0x674a1f[_0x6fc7('0x34')][_0x6fc7('0x3c')]);_0x4a166c[_0x6fc7('0x3d')]=qs[_0x6fc7('0x35')](_[_0x6fc7('0x3e')](_0x674a1f[_0x6fc7('0x34')],_0x5d64bb[_0x6fc7('0x35')]));if(_0x674a1f['query'][_0x6fc7('0x44')]){_0x4a166c[_0x6fc7('0x3d')]=_[_0x6fc7('0x43')](_0x4a166c['where'],{'$or':_['map'](_0x4a166c[_0x6fc7('0x37')],function(_0x743917){var _0x10eab0={};_0x10eab0[_0x743917]={'$like':'%'+_0x674a1f[_0x6fc7('0x34')][_0x6fc7('0x44')]+'%'};return _0x10eab0;})});}_0x4a166c=_[_0x6fc7('0x43')]({},_0x4a166c,_0x674a1f['options']);return _0x1f2651[_0x6fc7('0x52')](_0x4a166c);}})['then'](function(_0x44e649){if(_0x44e649){_0x5a6411=_0x44e649[_0x6fc7('0x39')];if(!_0x674a1f['query'][_0x6fc7('0x3a')](_0x6fc7('0x53'))){_0x4a166c[_0x6fc7('0x26')]=qs[_0x6fc7('0x26')](_0x674a1f[_0x6fc7('0x34')][_0x6fc7('0x26')]);_0x4a166c['offset']=qs['offset'](_0x674a1f[_0x6fc7('0x34')]['offset']);}return _0x1f2651[_0x6fc7('0x52')](_0x4a166c);}})['then'](function(_0x410476){if(_0x410476){return _0x410476?{'count':_0x5a6411,'rows':_0x410476}:null;}})[_0x6fc7('0x19')](respondWithResult(_0x41d634,null))[_0x6fc7('0x4c')](handleError(_0x41d634,null));};exports[_0x6fc7('0x54')]=function(_0x1984d3,_0x472330,_0x4383ce){if(_0x1984d3[_0x6fc7('0x4e')]['id']){delete _0x1984d3[_0x6fc7('0x4e')]['id'];}return db[_0x6fc7('0x31')][_0x6fc7('0x4f')]({'where':{'id':_0x1984d3[_0x6fc7('0x48')]['id']}})[_0x6fc7('0x19')](handleEntityNotFound(_0x472330,null))['then'](function(_0x585fd4){if(_0x585fd4){_0x1984d3['body']['AccountId']=_0x585fd4['id'];_0x1984d3[_0x6fc7('0x4e')][_0x6fc7('0x55')]=integrations[_0x6fc7('0x56')](_0x1984d3['body']['channel'],_0x1984d3[_0x6fc7('0x4e')][_0x6fc7('0x57')]);_0x1984d3['body'][_0x6fc7('0x58')]=integrations[_0x6fc7('0x59')](_0x1984d3[_0x6fc7('0x4e')][_0x6fc7('0x5a')],_0x1984d3['body'][_0x6fc7('0x57')]);return db['SugarcrmConfiguration']['create'](_0x1984d3[_0x6fc7('0x4e')],{'include':[{'model':db[_0x6fc7('0x5b')],'as':_0x6fc7('0x55')},{'model':db[_0x6fc7('0x5b')],'as':_0x6fc7('0x58')}]});}return null;})[_0x6fc7('0x19')](respondWithResult(_0x472330,null))['catch'](handleError(_0x472330,null));};exports['getFields']=function(_0x419d06,_0x351919,_0x388556){var _0xa6cf2b;return db[_0x6fc7('0x31')]['findOne']({'where':{'id':_0x419d06[_0x6fc7('0x48')]['id']},'attributes':['id',_0x6fc7('0x5c'),_0x6fc7('0x5d'),_0x6fc7('0x5e')]})['then'](handleEntityNotFound(_0x351919,null))[_0x6fc7('0x19')](function(_0x27890d){if(_0x27890d){_0xa6cf2b=_0x27890d[_0x6fc7('0x5e')];return rp({'method':'POST','uri':util['format'](_0x6fc7('0x5f'),_0xa6cf2b,_0x6fc7('0x60')),'json':!![],'form':{'method':_0x6fc7('0x61'),'input_type':_0x6fc7('0x62'),'response_type':_0x6fc7('0x62'),'rest_data':JSON[_0x6fc7('0x1c')]({'user_auth':{'user_name':_0x27890d[_0x6fc7('0x5c')],'password':_0x27890d[_0x6fc7('0x5d')],'encryption':_0x6fc7('0x63')},'application':_0x6fc7('0x64')})}});}})['then'](function(_0x40f3a1){if(_0x40f3a1){return rp({'method':_0x6fc7('0x65'),'uri':util['format'](_0x6fc7('0x5f'),_0xa6cf2b,_0x6fc7('0x60')),'json':!![],'form':{'method':_0x6fc7('0x66'),'input_type':_0x6fc7('0x62'),'response_type':'JSON','rest_data':JSON[_0x6fc7('0x1c')]({'session':_0x40f3a1['id'],'module_name':_0x6fc7('0x67')})}});}})[_0x6fc7('0x19')](function(_0x3c4692){if(_0x3c4692){var _0x50134d=_[_0x6fc7('0x68')](_0x3c4692[_0x6fc7('0x69')]);return{'count':_0x50134d[_0x6fc7('0x39')],'rows':_[_0x6fc7('0x6a')](_0x50134d,function(_0x326329){return{'id':_0x326329[_0x6fc7('0x2e')],'name':_0x326329[_0x6fc7('0x6b')],'custom':_[_0x6fc7('0x6c')](_0x326329[_0x6fc7('0x2e')],'_c')?!![]:![],'options':_0x326329['options']?_[_0x6fc7('0x6a')](_['values'](_0x326329['options']),function(_0x27bde9){return{'name':_0x27bde9[_0x6fc7('0x6d')],'value':_0x27bde9['name']};}):[]};})};}})[_0x6fc7('0x19')](respondWithResult(_0x351919,null))[_0x6fc7('0x4c')](function(_0x314f6c){var _0x576c63=_0x419d06[_0x6fc7('0x34')][_0x6fc7('0x6e')]?0x1f4:_0x314f6c['statusCode']||0x1f4;logger[_0x6fc7('0x1d')](_0x6fc7('0x6f'),_0x6fc7('0x70'),_0x576c63,JSON[_0x6fc7('0x1c')](_0x314f6c));delete _0x314f6c['name'];if(_0x576c63===0x191){_0x576c63=0x190;}_0x351919[_0x6fc7('0x22')](_0x576c63)[_0x6fc7('0x2f')](_0x419d06['query']['test']?{'message':_0x6fc7('0x71'),'statusCode':_0x314f6c[_0x6fc7('0x72')]}:_0x314f6c);});};
\ No newline at end of file
index e2f8c55..01c101c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x886f=['moment','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','api'];(function(_0x109751,_0x1c8c21){var _0x44fd3d=function(_0x77f5cb){while(--_0x77f5cb){_0x109751['push'](_0x109751['shift']());}};_0x44fd3d(++_0x1c8c21);}(_0x886f,0x7d));var _0xf886=function(_0x68bf79,_0x48513f){_0x68bf79=_0x68bf79-0x0;var _0x57386d=_0x886f[_0x68bf79];return _0x57386d;};'use strict';var _=require('lodash');var util=require(_0xf886('0x0'));var logger=require(_0xf886('0x1'))(_0xf886('0x2'));var moment=require(_0xf886('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xf886('0x4'));module['exports']=function(_0x4eab0f,_0x370783){return _0x4eab0f[_0xf886('0x5')](_0xf886('0x6'),attributes,{'tableName':_0xf886('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f79=['request-promise','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','int_sugarcrm_accounts','util','moment','bluebird'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3f79,0x1c8));var _0x93f7=function(_0x1c82d3,_0x516439){_0x1c82d3=_0x1c82d3-0x0;var _0x195742=_0x3f79[_0x1c82d3];return _0x195742;};'use strict';var _=require('lodash');var util=require(_0x93f7('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x93f7('0x1'));var BPromise=require(_0x93f7('0x2'));var rp=require(_0x93f7('0x3'));var attributes=require(_0x93f7('0x4'));var integrations=require(_0x93f7('0x5'));module[_0x93f7('0x6')]=function(_0x135bd9,_0xaa1fd4){return _0x135bd9[_0x93f7('0x7')]('SugarcrmAccount',attributes,{'tableName':_0x93f7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d1ed31b..7e04a7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d2e=['code','message','result','catch','SugarcrmAccount','findAll','options','where','limit','map','include','model','attributes','info','GetSugarcrmAccount','ShowSugarcrmAccount','find','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x523306,_0x557232){var _0x16842f=function(_0x4cd8f5){while(--_0x4cd8f5){_0x523306['push'](_0x523306['shift']());}};_0x16842f(++_0x557232);}(_0x6d2e,0x184));var _0xe6d2=function(_0x45d5ef,_0x10c29b){_0x45d5ef=_0x45d5ef-0x0;var _0x474d19=_0x6d2e[_0x45d5ef];return _0x474d19;};'use strict';var _=require(_0xe6d2('0x0'));var util=require(_0xe6d2('0x1'));var moment=require(_0xe6d2('0x2'));var BPromise=require('bluebird');var rs=require(_0xe6d2('0x3'));var fs=require('fs');var db=require(_0xe6d2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe6d2('0x5'))(_0xe6d2('0x6'));var config=require(_0xe6d2('0x7'));var jayson=require(_0xe6d2('0x8'));var client=jayson[_0xe6d2('0x9')][_0xe6d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d0dbe,_0x2bd33a,_0x5d1d43){return new BPromise(function(_0x4446f2,_0x49848f){return client[_0xe6d2('0xb')](_0x2d0dbe,_0x5d1d43)[_0xe6d2('0xc')](function(_0x403778){logger['info'](_0xe6d2('0xd'),_0x2bd33a,_0xe6d2('0xe'));logger[_0xe6d2('0xf')](_0xe6d2('0x10'),_0x2bd33a,_0xe6d2('0xe'),JSON[_0xe6d2('0x11')](_0x403778));if(_0x403778[_0xe6d2('0x12')]){if(_0x403778['error'][_0xe6d2('0x13')]===0x1f4){logger[_0xe6d2('0x12')](_0xe6d2('0xd'),_0x2bd33a,_0x403778[_0xe6d2('0x12')]['message']);return _0x49848f(_0x403778['error']['message']);}logger[_0xe6d2('0x12')](_0xe6d2('0xd'),_0x2bd33a,_0x403778['error'][_0xe6d2('0x14')]);return _0x4446f2(_0x403778['error'][_0xe6d2('0x14')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x2bd33a,_0xe6d2('0xe'));_0x4446f2(_0x403778[_0xe6d2('0x15')][_0xe6d2('0x14')]);}})[_0xe6d2('0x16')](function(_0x16d26e){logger[_0xe6d2('0x12')](_0xe6d2('0xd'),_0x2bd33a,_0x16d26e);_0x49848f(_0x16d26e);});});}exports['GetSugarcrmAccount']=function(_0x5dacf9){var _0x481291=this;return new Promise(function(_0x1661a7,_0x2292d9){return db[_0xe6d2('0x17')][_0xe6d2('0x18')]({'raw':_0x5dacf9[_0xe6d2('0x19')]?_0x5dacf9[_0xe6d2('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5dacf9['options']?_0x5dacf9[_0xe6d2('0x19')][_0xe6d2('0x1a')]||null:null,'attributes':_0x5dacf9[_0xe6d2('0x19')]?_0x5dacf9['options']['attributes']||null:null,'limit':_0x5dacf9[_0xe6d2('0x19')]?_0x5dacf9['options'][_0xe6d2('0x1b')]||null:null,'include':_0x5dacf9[_0xe6d2('0x19')]?_0x5dacf9[_0xe6d2('0x19')]['include']?_[_0xe6d2('0x1c')](_0x5dacf9[_0xe6d2('0x19')][_0xe6d2('0x1d')],function(_0x4e30df){return{'model':db[_0x4e30df[_0xe6d2('0x1e')]],'as':_0x4e30df['as'],'attributes':_0x4e30df[_0xe6d2('0x1f')],'include':_0x4e30df[_0xe6d2('0x1d')]?_[_0xe6d2('0x1c')](_0x4e30df[_0xe6d2('0x1d')],function(_0x36e579){return{'model':db[_0x36e579[_0xe6d2('0x1e')]],'as':_0x36e579['as'],'attributes':_0x36e579[_0xe6d2('0x1f')],'include':_0x36e579[_0xe6d2('0x1d')]?_[_0xe6d2('0x1c')](_0x36e579[_0xe6d2('0x1d')],function(_0x2d7730){return{'model':db[_0x2d7730[_0xe6d2('0x1e')]],'as':_0x2d7730['as'],'attributes':_0x2d7730[_0xe6d2('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd6ba8d){logger[_0xe6d2('0x20')](_0xe6d2('0x21'),_0x5dacf9);logger[_0xe6d2('0xf')](_0xe6d2('0x21'),_0x5dacf9,JSON[_0xe6d2('0x11')](_0xd6ba8d));_0x1661a7(_0xd6ba8d);})['catch'](function(_0x5e9b61){logger[_0xe6d2('0x12')](_0xe6d2('0x21'),_0x5e9b61[_0xe6d2('0x14')],_0x5dacf9);_0x2292d9(_0x481291['error'](0x1f4,_0x5e9b61[_0xe6d2('0x14')]));});});};exports[_0xe6d2('0x22')]=function(_0xed8b6c){var _0x10cf41=this;return new Promise(function(_0x155335,_0x321668){return db[_0xe6d2('0x17')][_0xe6d2('0x23')]({'raw':_0xed8b6c[_0xe6d2('0x19')]?_0xed8b6c['options'][_0xe6d2('0x24')]===undefined?!![]:![]:!![],'where':_0xed8b6c['options']?_0xed8b6c[_0xe6d2('0x19')][_0xe6d2('0x1a')]||null:null,'attributes':_0xed8b6c[_0xe6d2('0x19')]?_0xed8b6c[_0xe6d2('0x19')]['attributes']||null:null,'include':_0xed8b6c[_0xe6d2('0x19')]?_0xed8b6c[_0xe6d2('0x19')]['include']?_[_0xe6d2('0x1c')](_0xed8b6c[_0xe6d2('0x19')]['include'],function(_0x25cf54){return{'model':db[_0x25cf54[_0xe6d2('0x1e')]],'as':_0x25cf54['as'],'attributes':_0x25cf54[_0xe6d2('0x1f')],'include':_0x25cf54[_0xe6d2('0x1d')]?_[_0xe6d2('0x1c')](_0x25cf54[_0xe6d2('0x1d')],function(_0x43e84b){return{'model':db[_0x43e84b[_0xe6d2('0x1e')]],'as':_0x43e84b['as'],'attributes':_0x43e84b['attributes'],'include':_0x43e84b[_0xe6d2('0x1d')]?_['map'](_0x43e84b[_0xe6d2('0x1d')],function(_0x549c04){return{'model':db[_0x549c04[_0xe6d2('0x1e')]],'as':_0x549c04['as'],'attributes':_0x549c04[_0xe6d2('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23dea4){logger[_0xe6d2('0x20')](_0xe6d2('0x22'),_0xed8b6c);logger[_0xe6d2('0xf')](_0xe6d2('0x22'),_0xed8b6c,JSON['stringify'](_0x23dea4));_0x155335(_0x23dea4);})['catch'](function(_0x324d19){logger[_0xe6d2('0x12')](_0xe6d2('0x22'),_0x324d19[_0xe6d2('0x14')],_0xed8b6c);_0x321668(_0x10cf41[_0xe6d2('0x12')](0x1f4,_0x324d19['message']));});});};
\ No newline at end of file
+var _0x8fa8=['jayson/promise','client','http','request','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','SugarcrmAccount','options','attributes','limit','include','map','model','then','GetSugarcrmAccount','ShowSugarcrmAccount','find','where','stringify','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x44e881,_0x5eeb73){var _0x165631=function(_0x4b73f0){while(--_0x4b73f0){_0x44e881['push'](_0x44e881['shift']());}};_0x165631(++_0x5eeb73);}(_0x8fa8,0xed));var _0x88fa=function(_0x2ab23c,_0x31cae3){_0x2ab23c=_0x2ab23c-0x0;var _0x1325d9=_0x8fa8[_0x2ab23c];return _0x1325d9;};'use strict';var _=require(_0x88fa('0x0'));var util=require('util');var moment=require(_0x88fa('0x1'));var BPromise=require(_0x88fa('0x2'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x88fa('0x3'))['db'];var utils=require(_0x88fa('0x4'));var logger=require(_0x88fa('0x5'))(_0x88fa('0x6'));var config=require(_0x88fa('0x7'));var jayson=require(_0x88fa('0x8'));var client=jayson[_0x88fa('0x9')][_0x88fa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x270171,_0x3c370f,_0xea5b4b){return new BPromise(function(_0x2e4529,_0x399abf){return client[_0x88fa('0xb')](_0x270171,_0xea5b4b)['then'](function(_0x428793){logger['info'](_0x88fa('0xc'),_0x3c370f,_0x88fa('0xd'));logger[_0x88fa('0xe')](_0x88fa('0xf'),_0x3c370f,_0x88fa('0xd'),JSON['stringify'](_0x428793));if(_0x428793[_0x88fa('0x10')]){if(_0x428793[_0x88fa('0x10')][_0x88fa('0x11')]===0x1f4){logger[_0x88fa('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x3c370f,_0x428793[_0x88fa('0x10')]['message']);return _0x399abf(_0x428793[_0x88fa('0x10')]['message']);}logger[_0x88fa('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x3c370f,_0x428793[_0x88fa('0x10')][_0x88fa('0x12')]);return _0x2e4529(_0x428793[_0x88fa('0x10')]['message']);}else{logger[_0x88fa('0x13')](_0x88fa('0xc'),_0x3c370f,_0x88fa('0xd'));_0x2e4529(_0x428793[_0x88fa('0x14')][_0x88fa('0x12')]);}})[_0x88fa('0x15')](function(_0x285a7c){logger[_0x88fa('0x10')](_0x88fa('0xc'),_0x3c370f,_0x285a7c);_0x399abf(_0x285a7c);});});}exports['GetSugarcrmAccount']=function(_0xdef35d){var _0xf57c7a=this;return new Promise(function(_0x41faab,_0x483e66){return db[_0x88fa('0x16')]['findAll']({'raw':_0xdef35d[_0x88fa('0x17')]?_0xdef35d[_0x88fa('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xdef35d[_0x88fa('0x17')]?_0xdef35d['options']['where']||null:null,'attributes':_0xdef35d[_0x88fa('0x17')]?_0xdef35d[_0x88fa('0x17')][_0x88fa('0x18')]||null:null,'limit':_0xdef35d[_0x88fa('0x17')]?_0xdef35d[_0x88fa('0x17')][_0x88fa('0x19')]||null:null,'include':_0xdef35d[_0x88fa('0x17')]?_0xdef35d[_0x88fa('0x17')][_0x88fa('0x1a')]?_[_0x88fa('0x1b')](_0xdef35d['options'][_0x88fa('0x1a')],function(_0x1bc5e0){return{'model':db[_0x1bc5e0[_0x88fa('0x1c')]],'as':_0x1bc5e0['as'],'attributes':_0x1bc5e0[_0x88fa('0x18')],'include':_0x1bc5e0[_0x88fa('0x1a')]?_[_0x88fa('0x1b')](_0x1bc5e0[_0x88fa('0x1a')],function(_0x3364fa){return{'model':db[_0x3364fa[_0x88fa('0x1c')]],'as':_0x3364fa['as'],'attributes':_0x3364fa['attributes'],'include':_0x3364fa['include']?_[_0x88fa('0x1b')](_0x3364fa['include'],function(_0x1eeda0){return{'model':db[_0x1eeda0[_0x88fa('0x1c')]],'as':_0x1eeda0['as'],'attributes':_0x1eeda0[_0x88fa('0x18')]};}):[]};}):[]};}):[]:[]})[_0x88fa('0x1d')](function(_0x6635f){logger['info'](_0x88fa('0x1e'),_0xdef35d);logger['debug'](_0x88fa('0x1e'),_0xdef35d,JSON['stringify'](_0x6635f));_0x41faab(_0x6635f);})[_0x88fa('0x15')](function(_0x34c26c){logger[_0x88fa('0x10')](_0x88fa('0x1e'),_0x34c26c[_0x88fa('0x12')],_0xdef35d);_0x483e66(_0xf57c7a[_0x88fa('0x10')](0x1f4,_0x34c26c[_0x88fa('0x12')]));});});};exports[_0x88fa('0x1f')]=function(_0x210fb3){var _0x29c36d=this;return new Promise(function(_0x4d930c,_0x3ac3e2){return db['SugarcrmAccount'][_0x88fa('0x20')]({'raw':_0x210fb3[_0x88fa('0x17')]?_0x210fb3[_0x88fa('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x210fb3['options']?_0x210fb3['options'][_0x88fa('0x21')]||null:null,'attributes':_0x210fb3[_0x88fa('0x17')]?_0x210fb3[_0x88fa('0x17')]['attributes']||null:null,'include':_0x210fb3[_0x88fa('0x17')]?_0x210fb3[_0x88fa('0x17')][_0x88fa('0x1a')]?_[_0x88fa('0x1b')](_0x210fb3[_0x88fa('0x17')][_0x88fa('0x1a')],function(_0x7b1fc){return{'model':db[_0x7b1fc[_0x88fa('0x1c')]],'as':_0x7b1fc['as'],'attributes':_0x7b1fc['attributes'],'include':_0x7b1fc['include']?_[_0x88fa('0x1b')](_0x7b1fc[_0x88fa('0x1a')],function(_0x145f93){return{'model':db[_0x145f93['model']],'as':_0x145f93['as'],'attributes':_0x145f93[_0x88fa('0x18')],'include':_0x145f93[_0x88fa('0x1a')]?_['map'](_0x145f93[_0x88fa('0x1a')],function(_0x50373b){return{'model':db[_0x50373b[_0x88fa('0x1c')]],'as':_0x50373b['as'],'attributes':_0x50373b[_0x88fa('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b3c26){logger[_0x88fa('0x13')]('ShowSugarcrmAccount',_0x210fb3);logger['debug'](_0x88fa('0x1f'),_0x210fb3,JSON[_0x88fa('0x22')](_0x5b3c26));_0x4d930c(_0x5b3c26);})[_0x88fa('0x15')](function(_0x56e649){logger[_0x88fa('0x10')](_0x88fa('0x1f'),_0x56e649['message'],_0x210fb3);_0x3ac3e2(_0x29c36d[_0x88fa('0x10')](0x1f4,_0x56e649['message']));});});};
\ No newline at end of file
index 6afe4bb..a212ff3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9be8=['getDescriptions','create','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','get','/:id','show','getFields','getSubjects'];(function(_0x1442a6,_0x44bd1e){var _0x1fb9c1=function(_0x34204b){while(--_0x34204b){_0x1442a6['push'](_0x1442a6['shift']());}};_0x1fb9c1(++_0x44bd1e);}(_0x9be8,0x103));var _0x89be=function(_0x5ac84c,_0x287781){_0x5ac84c=_0x5ac84c-0x0;var _0x3c53d2=_0x9be8[_0x5ac84c];return _0x3c53d2;};'use strict';var multer=require(_0x89be('0x0'));var util=require('util');var path=require(_0x89be('0x1'));var express=require(_0x89be('0x2'));var router=express[_0x89be('0x3')]();var auth=require(_0x89be('0x4'));var interaction=require(_0x89be('0x5'));var config=require(_0x89be('0x6'));var controller=require(_0x89be('0x7'));router['get']('/',auth[_0x89be('0x8')](),controller['index']);router[_0x89be('0x9')](_0x89be('0xa'),auth[_0x89be('0x8')](),controller[_0x89be('0xb')]);router['get']('/:id/fields',auth[_0x89be('0x8')](),controller[_0x89be('0xc')]);router[_0x89be('0x9')]('/:id/subjects',auth[_0x89be('0x8')](),controller[_0x89be('0xd')]);router[_0x89be('0x9')]('/:id/descriptions',auth[_0x89be('0x8')](),controller[_0x89be('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x89be('0xf')]);router[_0x89be('0x10')](_0x89be('0xa'),auth[_0x89be('0x8')](),controller[_0x89be('0x11')]);router[_0x89be('0x12')](_0x89be('0xa'),auth[_0x89be('0x8')](),controller[_0x89be('0x13')]);module[_0x89be('0x14')]=router;
\ No newline at end of file
+var _0xfab2=['util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x3d5aef,_0x64e2d5){var _0x33e385=function(_0x24c86e){while(--_0x24c86e){_0x3d5aef['push'](_0x3d5aef['shift']());}};_0x33e385(++_0x64e2d5);}(_0xfab2,0xef));var _0x2fab=function(_0x1d6445,_0x28d75c){_0x1d6445=_0x1d6445-0x0;var _0x523032=_0xfab2[_0x1d6445];return _0x523032;};'use strict';var multer=require(_0x2fab('0x0'));var util=require(_0x2fab('0x1'));var path=require('path');var express=require(_0x2fab('0x2'));var router=express['Router']();var auth=require(_0x2fab('0x3'));var interaction=require(_0x2fab('0x4'));var config=require(_0x2fab('0x5'));var controller=require(_0x2fab('0x6'));router[_0x2fab('0x7')]('/',auth[_0x2fab('0x8')](),controller[_0x2fab('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2fab('0xa')]);router[_0x2fab('0x7')](_0x2fab('0xb'),auth[_0x2fab('0x8')](),controller[_0x2fab('0xc')]);router[_0x2fab('0x7')](_0x2fab('0xd'),auth[_0x2fab('0x8')](),controller[_0x2fab('0xe')]);router[_0x2fab('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x2fab('0xf')]);router[_0x2fab('0x10')]('/',auth[_0x2fab('0x8')](),controller[_0x2fab('0x11')]);router[_0x2fab('0x12')](_0x2fab('0x13'),auth[_0x2fab('0x8')](),controller[_0x2fab('0x14')]);router[_0x2fab('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x2fab('0x16')]);module[_0x2fab('0x17')]=router;
\ No newline at end of file
index 8a64008..cb8c49b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d43=['sequelize','STRING'];(function(_0x21df0b,_0x2f87b5){var _0x31cb9b=function(_0x1ce4d9){while(--_0x1ce4d9){_0x21df0b['push'](_0x21df0b['shift']());}};_0x31cb9b(++_0x2f87b5);}(_0x0d43,0x118));var _0x30d4=function(_0x5eeb0b,_0x293c14){_0x5eeb0b=_0x5eeb0b-0x0;var _0x270295=_0x0d43[_0x5eeb0b];return _0x270295;};'use strict';var Sequelize=require(_0x30d4('0x0'));module['exports']={'name':{'type':Sequelize[_0x30d4('0x1')]},'description':{'type':Sequelize[_0x30d4('0x1')]}};
\ No newline at end of file
+var _0xa659=['sequelize','exports','STRING'];(function(_0x323eef,_0xafb74f){var _0x4f93f3=function(_0x1c3d24){while(--_0x1c3d24){_0x323eef['push'](_0x323eef['shift']());}};_0x4f93f3(++_0xafb74f);}(_0xa659,0x153));var _0x9a65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa659[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9a65('0x0'));module[_0x9a65('0x1')]={'name':{'type':Sequelize[_0x9a65('0x2')]},'description':{'type':Sequelize[_0x9a65('0x2')]}};
\ No newline at end of file
index d82936d..d8a3b47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bb0=['../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','http','request','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','sendStatus','status','end','count','offset','limit','set','json','apply','save','update','then','stack','name','send','index','SugarcrmConfiguration','rawAttributes','model','dateStart','query','dateEnd','keys','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','day','add','filter','map','merge','options','includeAll','include','rows','show','params','fields','find','create','body','destroy','getFields','SugarcrmField','order','getSubjects','getDescriptions','findOne','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x2bb0,0xf3));var _0x02bb=function(_0x384c13,_0xaae259){_0x384c13=_0x384c13-0x0;var _0x5ac83c=_0x2bb0[_0x384c13];return _0x5ac83c;};'use strict';var pdf=require(_0x02bb('0x0'));var emlformat=require(_0x02bb('0x1'));var rimraf=require(_0x02bb('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x02bb('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x02bb('0x4'));var Mustache=require('mustache');var util=require(_0x02bb('0x5'));var path=require(_0x02bb('0x6'));var sox=require(_0x02bb('0x7'));var csv=require(_0x02bb('0x8'));var ejs=require(_0x02bb('0x9'));var fs=require('fs');var _=require(_0x02bb('0xa'));var squel=require(_0x02bb('0xb'));var crypto=require('crypto');var jsforce=require(_0x02bb('0xc'));var deskjs=require(_0x02bb('0xd'));var toCsv=require(_0x02bb('0x8'));var querystring=require('querystring');var Papa=require(_0x02bb('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0x02bb('0xf'))(_0x02bb('0x10'));var utils=require('../../config/utils');var config=require(_0x02bb('0x11'));var db=require(_0x02bb('0x12'))['db'];var jayson=require(_0x02bb('0x13'));var client=jayson['client'][_0x02bb('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x4e409d,_0x3fa733,_0x294078,_0x1079f9){return new BPromise(function(_0x5c8728,_0x16330c){var _0x40c5d0=_0x1079f9||client;return _0x40c5d0[_0x02bb('0x15')](_0x4e409d,_0x294078)['then'](function(_0x2a03ac){logger['info'](_0x02bb('0x16'),_0x3fa733,_0x02bb('0x17'));logger[_0x02bb('0x18')](_0x02bb('0x19'),_0x3fa733,_0x02bb('0x17'),JSON[_0x02bb('0x1a')](_0x2a03ac));if(_0x2a03ac['error']){if(_0x2a03ac['error'][_0x02bb('0x1b')]===0x1f4){logger[_0x02bb('0x1c')](_0x02bb('0x16'),_0x3fa733,_0x2a03ac[_0x02bb('0x1c')][_0x02bb('0x1d')]);return _0x16330c(_0x2a03ac[_0x02bb('0x1c')]['message']);}logger[_0x02bb('0x1c')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3fa733,_0x2a03ac[_0x02bb('0x1c')][_0x02bb('0x1d')]);return _0x5c8728(_0x2a03ac[_0x02bb('0x1c')]['message']);}else{logger[_0x02bb('0x1e')](_0x02bb('0x16'),_0x3fa733,_0x02bb('0x17'));_0x5c8728(_0x2a03ac['result'][_0x02bb('0x1d')]);}})[_0x02bb('0x1f')](function(_0x597adf){logger[_0x02bb('0x1c')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3fa733,_0x597adf);_0x16330c(_0x597adf);});});}function respondWithStatusCode(_0x1195f3,_0x4a91a4){_0x4a91a4=_0x4a91a4||0xcc;return function(_0x21e550){if(_0x21e550){return _0x1195f3[_0x02bb('0x20')](_0x4a91a4);}return _0x1195f3[_0x02bb('0x21')](_0x4a91a4)[_0x02bb('0x22')]();};}function respondWithResult(_0x144731,_0x54ac46){_0x54ac46=_0x54ac46||0xc8;return function(_0x58467f){if(_0x58467f){return _0x144731[_0x02bb('0x21')](_0x54ac46)['json'](_0x58467f);}};}function respondWithFilteredResult(_0x3d4742,_0x9db03f){return function(_0x8ae103){if(_0x8ae103){var _0x4d3dad=_0x8ae103[_0x02bb('0x23')],_0x20b55e=_0x9db03f[_0x02bb('0x24')],_0x96298e=_0x9db03f[_0x02bb('0x24')]+_0x9db03f[_0x02bb('0x25')],_0x5caeb5;if(_0x96298e>=_0x4d3dad){_0x96298e=_0x4d3dad;_0x5caeb5=0xc8;}else{_0x5caeb5=0xce;}_0x3d4742[_0x02bb('0x21')](_0x5caeb5);return _0x3d4742[_0x02bb('0x26')]('Content-Range',_0x20b55e+'-'+_0x96298e+'/'+_0x4d3dad)[_0x02bb('0x27')](_0x8ae103);}return null;};}function patchUpdates(_0x54ca2b){return function(_0x1fffab){try{jsonpatch[_0x02bb('0x28')](_0x1fffab,_0x54ca2b,!![]);}catch(_0x426c90){return BPromise['reject'](_0x426c90);}return _0x1fffab[_0x02bb('0x29')]();};}function saveUpdates(_0x3cd365,_0x179c13){return function(_0x4c94a2){if(_0x4c94a2){return _0x4c94a2[_0x02bb('0x2a')](_0x3cd365)[_0x02bb('0x2b')](function(_0x283f54){return _0x283f54;});}return null;};}function removeEntity(_0x5d53dd,_0x4d0d88){return function(_0x40b887){if(_0x40b887){return _0x40b887['destroy']()['then'](function(){_0x5d53dd[_0x02bb('0x21')](0xcc)[_0x02bb('0x22')]();});}};}function handleEntityNotFound(_0x491085,_0x32eae2){return function(_0x105c9c){if(!_0x105c9c){_0x491085[_0x02bb('0x20')](0x194);}return _0x105c9c;};}function handleError(_0x4aaf67,_0xf43491){_0xf43491=_0xf43491||0x1f4;return function(_0x1d7723){logger[_0x02bb('0x1c')](_0x1d7723[_0x02bb('0x2c')]);if(_0x1d7723[_0x02bb('0x2d')]){delete _0x1d7723[_0x02bb('0x2d')];}_0x4aaf67[_0x02bb('0x21')](_0xf43491)[_0x02bb('0x2e')](_0x1d7723);};}exports[_0x02bb('0x2f')]=function(_0x3468c5,_0x5e1b7b){var _0x4270bd={},_0x472e81={},_0x49f0f6={'count':0x0,'rows':[]};var _0x1de429=db[_0x02bb('0x30')][_0x02bb('0x31')];_0x472e81[_0x02bb('0x32')]=_['keys'](_0x1de429);var _0x3e4233={'dateStart':_0x3468c5['query'][_0x02bb('0x33')],'dateEnd':_0x3468c5[_0x02bb('0x34')][_0x02bb('0x35')]};delete _0x3468c5[_0x02bb('0x34')][_0x02bb('0x33')];delete _0x3468c5[_0x02bb('0x34')][_0x02bb('0x35')];_0x472e81['query']=_[_0x02bb('0x36')](_0x3468c5[_0x02bb('0x34')]);_0x472e81['filters']=_[_0x02bb('0x37')](_0x472e81[_0x02bb('0x32')],_0x472e81[_0x02bb('0x34')]);_0x4270bd[_0x02bb('0x38')]=_[_0x02bb('0x37')](_0x472e81[_0x02bb('0x32')],qs['fields'](_0x3468c5[_0x02bb('0x34')]['fields']));_0x4270bd[_0x02bb('0x38')]=_0x4270bd[_0x02bb('0x38')][_0x02bb('0x39')]?_0x4270bd[_0x02bb('0x38')]:_0x472e81[_0x02bb('0x32')];if(!_0x3468c5[_0x02bb('0x34')][_0x02bb('0x3a')](_0x02bb('0x3b'))){_0x4270bd[_0x02bb('0x25')]=qs['limit'](_0x3468c5[_0x02bb('0x34')][_0x02bb('0x25')]);_0x4270bd['offset']=qs[_0x02bb('0x24')](_0x3468c5[_0x02bb('0x34')]['offset']);}_0x4270bd['order']=qs[_0x02bb('0x3c')](_0x3468c5[_0x02bb('0x34')][_0x02bb('0x3c')]);_0x4270bd[_0x02bb('0x3d')]=qs[_0x02bb('0x3e')](_[_0x02bb('0x3f')](_0x3468c5['query'],_0x472e81[_0x02bb('0x3e')]));if(_0x3e4233['dateStart']){if(_0x3e4233['dateEnd']){_0x3e4233[_0x02bb('0x35')]=moment(_0x3e4233[_0x02bb('0x35')])['add'](0x1,_0x02bb('0x40'));}else{_0x3e4233['dateEnd']=moment(_0x3e4233[_0x02bb('0x33')])[_0x02bb('0x41')](0x1,_0x02bb('0x40'));}_['merge'](_0x4270bd['where'],{'createdAt':{'$gte':_0x3e4233['dateStart'],'$lte':_0x3e4233['dateEnd']}});}if(_0x3468c5[_0x02bb('0x34')][_0x02bb('0x42')]){_0x4270bd[_0x02bb('0x3d')]=_['merge'](_0x4270bd[_0x02bb('0x3d')],{'$or':_[_0x02bb('0x43')](_0x4270bd[_0x02bb('0x38')],function(_0x493a2c){var _0x130e38={};_0x130e38[_0x493a2c]={'$like':'%'+_0x3468c5[_0x02bb('0x34')][_0x02bb('0x42')]+'%'};return _0x130e38;})});}_0x4270bd=_[_0x02bb('0x44')]({},_0x4270bd,_0x3468c5[_0x02bb('0x45')]);var _0x55ca10={'where':_0x4270bd['where']};return db[_0x02bb('0x30')]['count'](_0x55ca10)['then'](function(_0x21965a){_0x49f0f6[_0x02bb('0x23')]=_0x21965a;if(_0x3468c5['query'][_0x02bb('0x46')]){_0x4270bd[_0x02bb('0x47')]=[{'all':!![]}];}return db[_0x02bb('0x30')]['findAll'](_0x4270bd);})[_0x02bb('0x2b')](function(_0x13d3a3){_0x49f0f6[_0x02bb('0x48')]=_0x13d3a3;return _0x49f0f6;})[_0x02bb('0x2b')](respondWithFilteredResult(_0x5e1b7b,_0x4270bd))[_0x02bb('0x1f')](handleError(_0x5e1b7b,null));};exports[_0x02bb('0x49')]=function(_0x1de181,_0x5b766b){var _0x2be006={'raw':![],'where':{'id':_0x1de181[_0x02bb('0x4a')]['id']}},_0x1c1070={};_0x1c1070[_0x02bb('0x32')]=_['keys'](db[_0x02bb('0x30')][_0x02bb('0x31')]);_0x1c1070[_0x02bb('0x34')]=_[_0x02bb('0x36')](_0x1de181[_0x02bb('0x34')]);_0x1c1070[_0x02bb('0x3e')]=_[_0x02bb('0x37')](_0x1c1070[_0x02bb('0x32')],_0x1c1070[_0x02bb('0x34')]);_0x2be006[_0x02bb('0x38')]=_[_0x02bb('0x37')](_0x1c1070['model'],qs[_0x02bb('0x4b')](_0x1de181['query'][_0x02bb('0x4b')]));_0x2be006[_0x02bb('0x38')]=_0x2be006[_0x02bb('0x38')][_0x02bb('0x39')]?_0x2be006[_0x02bb('0x38')]:_0x1c1070[_0x02bb('0x32')];if(_0x1de181[_0x02bb('0x34')][_0x02bb('0x46')]){_0x2be006['include']=[{'all':!![]}];}_0x2be006=_[_0x02bb('0x44')]({},_0x2be006,_0x1de181[_0x02bb('0x45')]);return db[_0x02bb('0x30')][_0x02bb('0x4c')](_0x2be006)[_0x02bb('0x2b')](handleEntityNotFound(_0x5b766b,null))[_0x02bb('0x2b')](respondWithResult(_0x5b766b,null))['catch'](handleError(_0x5b766b,null));};exports[_0x02bb('0x4d')]=function(_0x22ad38,_0x82a8f6){return db['SugarcrmConfiguration'][_0x02bb('0x4d')](_0x22ad38['body'],{})[_0x02bb('0x2b')](respondWithResult(_0x82a8f6,0xc9))[_0x02bb('0x1f')](handleError(_0x82a8f6,null));};exports[_0x02bb('0x2a')]=function(_0x17ecc8,_0x1045fd){if(_0x17ecc8[_0x02bb('0x4e')]['id']){delete _0x17ecc8[_0x02bb('0x4e')]['id'];}return db[_0x02bb('0x30')][_0x02bb('0x4c')]({'where':{'id':_0x17ecc8[_0x02bb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1045fd,null))[_0x02bb('0x2b')](saveUpdates(_0x17ecc8[_0x02bb('0x4e')],null))[_0x02bb('0x2b')](respondWithResult(_0x1045fd,null))['catch'](handleError(_0x1045fd,null));};exports[_0x02bb('0x4f')]=function(_0x337ece,_0x31952){return db[_0x02bb('0x30')][_0x02bb('0x4c')]({'where':{'id':_0x337ece['params']['id']}})[_0x02bb('0x2b')](handleEntityNotFound(_0x31952,null))[_0x02bb('0x2b')](removeEntity(_0x31952,null))[_0x02bb('0x1f')](handleError(_0x31952,null));};exports[_0x02bb('0x50')]=function(_0x27aa4d,_0x11de02,_0x4341d8){var _0x3b7598={};var _0x1ab0ee={};var _0x841e78;var _0x20080a;return db[_0x02bb('0x30')]['findOne']({'where':{'id':_0x27aa4d[_0x02bb('0x4a')]['id']}})[_0x02bb('0x2b')](handleEntityNotFound(_0x11de02,null))['then'](function(_0x45caae){if(_0x45caae){_0x841e78=_0x45caae;_0x1ab0ee[_0x02bb('0x32')]=_[_0x02bb('0x36')](db[_0x02bb('0x51')][_0x02bb('0x31')]);_0x1ab0ee[_0x02bb('0x34')]=_['keys'](_0x27aa4d[_0x02bb('0x34')]);_0x1ab0ee[_0x02bb('0x3e')]=_[_0x02bb('0x37')](_0x1ab0ee[_0x02bb('0x32')],_0x1ab0ee[_0x02bb('0x34')]);_0x3b7598[_0x02bb('0x38')]=_[_0x02bb('0x37')](_0x1ab0ee[_0x02bb('0x32')],qs['fields'](_0x27aa4d[_0x02bb('0x34')][_0x02bb('0x4b')]));_0x3b7598['attributes']=_0x3b7598[_0x02bb('0x38')][_0x02bb('0x39')]?_0x3b7598[_0x02bb('0x38')]:_0x1ab0ee[_0x02bb('0x32')];_0x3b7598[_0x02bb('0x52')]=qs[_0x02bb('0x3c')](_0x27aa4d[_0x02bb('0x34')][_0x02bb('0x3c')]);_0x3b7598[_0x02bb('0x3d')]=qs[_0x02bb('0x3e')](_[_0x02bb('0x3f')](_0x27aa4d[_0x02bb('0x34')],_0x1ab0ee[_0x02bb('0x3e')]));if(_0x27aa4d[_0x02bb('0x34')][_0x02bb('0x42')]){_0x3b7598[_0x02bb('0x3d')]=_['merge'](_0x3b7598[_0x02bb('0x3d')],{'$or':_[_0x02bb('0x43')](_0x3b7598[_0x02bb('0x38')],function(_0xa1607e){var _0x2d1e23={};_0x2d1e23[_0xa1607e]={'$like':'%'+_0x27aa4d[_0x02bb('0x34')][_0x02bb('0x42')]+'%'};return _0x2d1e23;})});}_0x3b7598=_['merge']({},_0x3b7598,_0x27aa4d['options']);return _0x841e78[_0x02bb('0x50')](_0x3b7598);}})[_0x02bb('0x2b')](function(_0xd577bd){if(_0xd577bd){_0x20080a=_0xd577bd[_0x02bb('0x39')];if(!_0x27aa4d[_0x02bb('0x34')][_0x02bb('0x3a')](_0x02bb('0x3b'))){_0x3b7598[_0x02bb('0x25')]=qs[_0x02bb('0x25')](_0x27aa4d['query'][_0x02bb('0x25')]);_0x3b7598[_0x02bb('0x24')]=qs['offset'](_0x27aa4d[_0x02bb('0x34')][_0x02bb('0x24')]);}return _0x841e78['getFields'](_0x3b7598);}})[_0x02bb('0x2b')](function(_0x5efcc3){if(_0x5efcc3){return _0x5efcc3?{'count':_0x20080a,'rows':_0x5efcc3}:null;}})['then'](respondWithResult(_0x11de02,null))['catch'](handleError(_0x11de02,null));};exports[_0x02bb('0x53')]=function(_0x1d7095,_0x3b33c1,_0x31f98d){var _0x4a6d30={};var _0x312c0f={};var _0x2bee65;var _0x255927;return db[_0x02bb('0x30')]['findOne']({'where':{'id':_0x1d7095[_0x02bb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b33c1,null))['then'](function(_0x36b659){if(_0x36b659){_0x2bee65=_0x36b659;_0x312c0f[_0x02bb('0x32')]=_['keys'](db[_0x02bb('0x51')]['rawAttributes']);_0x312c0f[_0x02bb('0x34')]=_[_0x02bb('0x36')](_0x1d7095[_0x02bb('0x34')]);_0x312c0f[_0x02bb('0x3e')]=_[_0x02bb('0x37')](_0x312c0f[_0x02bb('0x32')],_0x312c0f[_0x02bb('0x34')]);_0x4a6d30[_0x02bb('0x38')]=_[_0x02bb('0x37')](_0x312c0f[_0x02bb('0x32')],qs['fields'](_0x1d7095[_0x02bb('0x34')][_0x02bb('0x4b')]));_0x4a6d30[_0x02bb('0x38')]=_0x4a6d30[_0x02bb('0x38')][_0x02bb('0x39')]?_0x4a6d30['attributes']:_0x312c0f['model'];_0x4a6d30[_0x02bb('0x52')]=qs[_0x02bb('0x3c')](_0x1d7095['query'][_0x02bb('0x3c')]);_0x4a6d30[_0x02bb('0x3d')]=qs[_0x02bb('0x3e')](_[_0x02bb('0x3f')](_0x1d7095[_0x02bb('0x34')],_0x312c0f[_0x02bb('0x3e')]));if(_0x1d7095[_0x02bb('0x34')]['filter']){_0x4a6d30['where']=_[_0x02bb('0x44')](_0x4a6d30[_0x02bb('0x3d')],{'$or':_[_0x02bb('0x43')](_0x4a6d30[_0x02bb('0x38')],function(_0x2c177e){var _0x940d74={};_0x940d74[_0x2c177e]={'$like':'%'+_0x1d7095[_0x02bb('0x34')][_0x02bb('0x42')]+'%'};return _0x940d74;})});}_0x4a6d30=_[_0x02bb('0x44')]({},_0x4a6d30,_0x1d7095[_0x02bb('0x45')]);return _0x2bee65['getSubjects'](_0x4a6d30);}})[_0x02bb('0x2b')](function(_0x580349){if(_0x580349){_0x255927=_0x580349[_0x02bb('0x39')];if(!_0x1d7095[_0x02bb('0x34')][_0x02bb('0x3a')](_0x02bb('0x3b'))){_0x4a6d30[_0x02bb('0x25')]=qs[_0x02bb('0x25')](_0x1d7095[_0x02bb('0x34')][_0x02bb('0x25')]);_0x4a6d30[_0x02bb('0x24')]=qs[_0x02bb('0x24')](_0x1d7095[_0x02bb('0x34')][_0x02bb('0x24')]);}return _0x2bee65['getSubjects'](_0x4a6d30);}})[_0x02bb('0x2b')](function(_0x4ebd77){if(_0x4ebd77){return _0x4ebd77?{'count':_0x255927,'rows':_0x4ebd77}:null;}})['then'](respondWithResult(_0x3b33c1,null))[_0x02bb('0x1f')](handleError(_0x3b33c1,null));};exports[_0x02bb('0x54')]=function(_0x2fb03d,_0x14a65c,_0xab6908){var _0x3b4a0a={};var _0x49443f={};var _0x32dda5;var _0x4c6b1e;return db['SugarcrmConfiguration'][_0x02bb('0x55')]({'where':{'id':_0x2fb03d[_0x02bb('0x4a')]['id']}})[_0x02bb('0x2b')](handleEntityNotFound(_0x14a65c,null))[_0x02bb('0x2b')](function(_0x8a4e12){if(_0x8a4e12){_0x32dda5=_0x8a4e12;_0x49443f[_0x02bb('0x32')]=_[_0x02bb('0x36')](db[_0x02bb('0x51')][_0x02bb('0x31')]);_0x49443f['query']=_[_0x02bb('0x36')](_0x2fb03d[_0x02bb('0x34')]);_0x49443f[_0x02bb('0x3e')]=_['intersection'](_0x49443f[_0x02bb('0x32')],_0x49443f[_0x02bb('0x34')]);_0x3b4a0a['attributes']=_['intersection'](_0x49443f[_0x02bb('0x32')],qs[_0x02bb('0x4b')](_0x2fb03d[_0x02bb('0x34')][_0x02bb('0x4b')]));_0x3b4a0a[_0x02bb('0x38')]=_0x3b4a0a[_0x02bb('0x38')][_0x02bb('0x39')]?_0x3b4a0a[_0x02bb('0x38')]:_0x49443f[_0x02bb('0x32')];_0x3b4a0a['order']=qs[_0x02bb('0x3c')](_0x2fb03d[_0x02bb('0x34')]['sort']);_0x3b4a0a[_0x02bb('0x3d')]=qs[_0x02bb('0x3e')](_[_0x02bb('0x3f')](_0x2fb03d[_0x02bb('0x34')],_0x49443f[_0x02bb('0x3e')]));if(_0x2fb03d[_0x02bb('0x34')][_0x02bb('0x42')]){_0x3b4a0a['where']=_[_0x02bb('0x44')](_0x3b4a0a[_0x02bb('0x3d')],{'$or':_[_0x02bb('0x43')](_0x3b4a0a['attributes'],function(_0x38f4de){var _0xd9a87f={};_0xd9a87f[_0x38f4de]={'$like':'%'+_0x2fb03d['query']['filter']+'%'};return _0xd9a87f;})});}_0x3b4a0a=_[_0x02bb('0x44')]({},_0x3b4a0a,_0x2fb03d[_0x02bb('0x45')]);return _0x32dda5['getDescriptions'](_0x3b4a0a);}})[_0x02bb('0x2b')](function(_0xf77848){if(_0xf77848){_0x4c6b1e=_0xf77848[_0x02bb('0x39')];if(!_0x2fb03d[_0x02bb('0x34')][_0x02bb('0x3a')](_0x02bb('0x3b'))){_0x3b4a0a[_0x02bb('0x25')]=qs[_0x02bb('0x25')](_0x2fb03d[_0x02bb('0x34')][_0x02bb('0x25')]);_0x3b4a0a['offset']=qs[_0x02bb('0x24')](_0x2fb03d[_0x02bb('0x34')][_0x02bb('0x24')]);}return _0x32dda5[_0x02bb('0x54')](_0x3b4a0a);}})[_0x02bb('0x2b')](function(_0x34a269){if(_0x34a269){return _0x34a269?{'count':_0x4c6b1e,'rows':_0x34a269}:null;}})['then'](respondWithResult(_0x14a65c,null))[_0x02bb('0x1f')](handleError(_0x14a65c,null));};
\ No newline at end of file
+var _0x3ef0=['http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','rawAttributes','keys','dateStart','dateEnd','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','add','day','merge','filter','map','options','SugarcrmConfiguration','findAll','rows','show','params','includeAll','include','create','body','getFields','findOne','SugarcrmField','hasOwnProperty','getSubjects','getDescriptions','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x53de37,_0x3314b5){var _0x9ba138=function(_0x621cc0){while(--_0x621cc0){_0x53de37['push'](_0x53de37['shift']());}};_0x9ba138(++_0x3314b5);}(_0x3ef0,0x19a));var _0x03ef=function(_0x363c71,_0x2d34a5){_0x363c71=_0x363c71-0x0;var _0x4a2c29=_0x3ef0[_0x363c71];return _0x4a2c29;};'use strict';var pdf=require(_0x03ef('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x03ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x03ef('0x2'));var rp=require('request-promise');var moment=require(_0x03ef('0x3'));var BPromise=require(_0x03ef('0x4'));var Mustache=require(_0x03ef('0x5'));var util=require('util');var path=require('path');var sox=require(_0x03ef('0x6'));var csv=require(_0x03ef('0x7'));var ejs=require(_0x03ef('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x03ef('0x9'));var crypto=require(_0x03ef('0xa'));var jsforce=require(_0x03ef('0xb'));var deskjs=require(_0x03ef('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x03ef('0xd'));var qs=require(_0x03ef('0xe'));var logger=require(_0x03ef('0xf'))('api');var utils=require(_0x03ef('0x10'));var config=require(_0x03ef('0x11'));var db=require('../../mysqldb')['db'];var jayson=require(_0x03ef('0x12'));var client=jayson[_0x03ef('0x13')][_0x03ef('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x4ff8b7,_0x3af019,_0x8f3fb,_0x390cc2){return new BPromise(function(_0x1e138e,_0x459f67){var _0x2eb81a=_0x390cc2||client;return _0x2eb81a[_0x03ef('0x15')](_0x4ff8b7,_0x8f3fb)[_0x03ef('0x16')](function(_0x1702a0){logger[_0x03ef('0x17')](_0x03ef('0x18'),_0x3af019,'request\x20sent');logger['debug'](_0x03ef('0x19'),_0x3af019,_0x03ef('0x1a'),JSON[_0x03ef('0x1b')](_0x1702a0));if(_0x1702a0[_0x03ef('0x1c')]){if(_0x1702a0[_0x03ef('0x1c')]['code']===0x1f4){logger['error'](_0x03ef('0x18'),_0x3af019,_0x1702a0[_0x03ef('0x1c')]['message']);return _0x459f67(_0x1702a0['error'][_0x03ef('0x1d')]);}logger[_0x03ef('0x1c')](_0x03ef('0x18'),_0x3af019,_0x1702a0[_0x03ef('0x1c')][_0x03ef('0x1d')]);return _0x1e138e(_0x1702a0['error'][_0x03ef('0x1d')]);}else{logger[_0x03ef('0x17')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3af019,_0x03ef('0x1a'));_0x1e138e(_0x1702a0[_0x03ef('0x1e')][_0x03ef('0x1d')]);}})[_0x03ef('0x1f')](function(_0x3c156d){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x3af019,_0x3c156d);_0x459f67(_0x3c156d);});});}function respondWithStatusCode(_0x41d7d7,_0x5d56e1){_0x5d56e1=_0x5d56e1||0xcc;return function(_0x11073e){if(_0x11073e){return _0x41d7d7['sendStatus'](_0x5d56e1);}return _0x41d7d7['status'](_0x5d56e1)[_0x03ef('0x20')]();};}function respondWithResult(_0x27ac0d,_0x5efaf0){_0x5efaf0=_0x5efaf0||0xc8;return function(_0x5f0084){if(_0x5f0084){return _0x27ac0d[_0x03ef('0x21')](_0x5efaf0)[_0x03ef('0x22')](_0x5f0084);}};}function respondWithFilteredResult(_0x4fb37f,_0x305829){return function(_0x4d3908){if(_0x4d3908){var _0x2a4c7f=_0x4d3908[_0x03ef('0x23')],_0x54b217=_0x305829[_0x03ef('0x24')],_0x16e6ee=_0x305829[_0x03ef('0x24')]+_0x305829[_0x03ef('0x25')],_0x3dd14f;if(_0x16e6ee>=_0x2a4c7f){_0x16e6ee=_0x2a4c7f;_0x3dd14f=0xc8;}else{_0x3dd14f=0xce;}_0x4fb37f['status'](_0x3dd14f);return _0x4fb37f['set'](_0x03ef('0x26'),_0x54b217+'-'+_0x16e6ee+'/'+_0x2a4c7f)['json'](_0x4d3908);}return null;};}function patchUpdates(_0x39f762){return function(_0x2b77cd){try{jsonpatch[_0x03ef('0x27')](_0x2b77cd,_0x39f762,!![]);}catch(_0x4d9e6a){return BPromise[_0x03ef('0x28')](_0x4d9e6a);}return _0x2b77cd[_0x03ef('0x29')]();};}function saveUpdates(_0x301caa,_0x3319d2){return function(_0x53658c){if(_0x53658c){return _0x53658c[_0x03ef('0x2a')](_0x301caa)[_0x03ef('0x16')](function(_0xf38b61){return _0xf38b61;});}return null;};}function removeEntity(_0x154c6f,_0x54c07e){return function(_0x2432f2){if(_0x2432f2){return _0x2432f2[_0x03ef('0x2b')]()[_0x03ef('0x16')](function(){_0x154c6f['status'](0xcc)[_0x03ef('0x20')]();});}};}function handleEntityNotFound(_0x5accf2,_0x6b7a9d){return function(_0x1e2a48){if(!_0x1e2a48){_0x5accf2[_0x03ef('0x2c')](0x194);}return _0x1e2a48;};}function handleError(_0x4c350e,_0x13ab37){_0x13ab37=_0x13ab37||0x1f4;return function(_0x4107be){logger[_0x03ef('0x1c')](_0x4107be[_0x03ef('0x2d')]);if(_0x4107be[_0x03ef('0x2e')]){delete _0x4107be['name'];}_0x4c350e[_0x03ef('0x21')](_0x13ab37)[_0x03ef('0x2f')](_0x4107be);};}exports[_0x03ef('0x30')]=function(_0x20aea2,_0x5f6b98){var _0x5d20a3={},_0x53df30={},_0xa1bbf8={'count':0x0,'rows':[]};var _0x218290=db['SugarcrmConfiguration'][_0x03ef('0x31')];_0x53df30['model']=_[_0x03ef('0x32')](_0x218290);var _0x3fb164={'dateStart':_0x20aea2['query'][_0x03ef('0x33')],'dateEnd':_0x20aea2['query'][_0x03ef('0x34')]};delete _0x20aea2[_0x03ef('0x35')]['dateStart'];delete _0x20aea2['query'][_0x03ef('0x34')];_0x53df30[_0x03ef('0x35')]=_['keys'](_0x20aea2[_0x03ef('0x35')]);_0x53df30[_0x03ef('0x36')]=_[_0x03ef('0x37')](_0x53df30[_0x03ef('0x38')],_0x53df30[_0x03ef('0x35')]);_0x5d20a3[_0x03ef('0x39')]=_[_0x03ef('0x37')](_0x53df30[_0x03ef('0x38')],qs['fields'](_0x20aea2[_0x03ef('0x35')][_0x03ef('0x3a')]));_0x5d20a3[_0x03ef('0x39')]=_0x5d20a3['attributes'][_0x03ef('0x3b')]?_0x5d20a3[_0x03ef('0x39')]:_0x53df30[_0x03ef('0x38')];if(!_0x20aea2[_0x03ef('0x35')]['hasOwnProperty'](_0x03ef('0x3c'))){_0x5d20a3[_0x03ef('0x25')]=qs[_0x03ef('0x25')](_0x20aea2[_0x03ef('0x35')]['limit']);_0x5d20a3[_0x03ef('0x24')]=qs[_0x03ef('0x24')](_0x20aea2[_0x03ef('0x35')][_0x03ef('0x24')]);}_0x5d20a3[_0x03ef('0x3d')]=qs[_0x03ef('0x3e')](_0x20aea2[_0x03ef('0x35')][_0x03ef('0x3e')]);_0x5d20a3[_0x03ef('0x3f')]=qs[_0x03ef('0x36')](_[_0x03ef('0x40')](_0x20aea2[_0x03ef('0x35')],_0x53df30[_0x03ef('0x36')]));if(_0x3fb164[_0x03ef('0x33')]){if(_0x3fb164[_0x03ef('0x34')]){_0x3fb164[_0x03ef('0x34')]=moment(_0x3fb164[_0x03ef('0x34')])[_0x03ef('0x41')](0x1,_0x03ef('0x42'));}else{_0x3fb164[_0x03ef('0x34')]=moment(_0x3fb164[_0x03ef('0x33')])[_0x03ef('0x41')](0x1,'day');}_[_0x03ef('0x43')](_0x5d20a3[_0x03ef('0x3f')],{'createdAt':{'$gte':_0x3fb164[_0x03ef('0x33')],'$lte':_0x3fb164[_0x03ef('0x34')]}});}if(_0x20aea2[_0x03ef('0x35')][_0x03ef('0x44')]){_0x5d20a3[_0x03ef('0x3f')]=_[_0x03ef('0x43')](_0x5d20a3[_0x03ef('0x3f')],{'$or':_[_0x03ef('0x45')](_0x5d20a3[_0x03ef('0x39')],function(_0x459213){var _0x592070={};_0x592070[_0x459213]={'$like':'%'+_0x20aea2[_0x03ef('0x35')][_0x03ef('0x44')]+'%'};return _0x592070;})});}_0x5d20a3=_['merge']({},_0x5d20a3,_0x20aea2[_0x03ef('0x46')]);var _0x2d7ed8={'where':_0x5d20a3['where']};return db[_0x03ef('0x47')][_0x03ef('0x23')](_0x2d7ed8)[_0x03ef('0x16')](function(_0x560a85){_0xa1bbf8[_0x03ef('0x23')]=_0x560a85;if(_0x20aea2[_0x03ef('0x35')]['includeAll']){_0x5d20a3['include']=[{'all':!![]}];}return db[_0x03ef('0x47')][_0x03ef('0x48')](_0x5d20a3);})[_0x03ef('0x16')](function(_0x4030b3){_0xa1bbf8[_0x03ef('0x49')]=_0x4030b3;return _0xa1bbf8;})[_0x03ef('0x16')](respondWithFilteredResult(_0x5f6b98,_0x5d20a3))[_0x03ef('0x1f')](handleError(_0x5f6b98,null));};exports[_0x03ef('0x4a')]=function(_0xdaf61d,_0x51688a){var _0x1e4196={'raw':![],'where':{'id':_0xdaf61d[_0x03ef('0x4b')]['id']}},_0x4b86ce={};_0x4b86ce[_0x03ef('0x38')]=_['keys'](db[_0x03ef('0x47')][_0x03ef('0x31')]);_0x4b86ce[_0x03ef('0x35')]=_[_0x03ef('0x32')](_0xdaf61d[_0x03ef('0x35')]);_0x4b86ce['filters']=_[_0x03ef('0x37')](_0x4b86ce[_0x03ef('0x38')],_0x4b86ce['query']);_0x1e4196[_0x03ef('0x39')]=_[_0x03ef('0x37')](_0x4b86ce['model'],qs[_0x03ef('0x3a')](_0xdaf61d['query']['fields']));_0x1e4196[_0x03ef('0x39')]=_0x1e4196[_0x03ef('0x39')]['length']?_0x1e4196['attributes']:_0x4b86ce[_0x03ef('0x38')];if(_0xdaf61d['query'][_0x03ef('0x4c')]){_0x1e4196[_0x03ef('0x4d')]=[{'all':!![]}];}_0x1e4196=_[_0x03ef('0x43')]({},_0x1e4196,_0xdaf61d[_0x03ef('0x46')]);return db[_0x03ef('0x47')]['find'](_0x1e4196)[_0x03ef('0x16')](handleEntityNotFound(_0x51688a,null))['then'](respondWithResult(_0x51688a,null))[_0x03ef('0x1f')](handleError(_0x51688a,null));};exports[_0x03ef('0x4e')]=function(_0x322bf8,_0x1ce22a){return db[_0x03ef('0x47')][_0x03ef('0x4e')](_0x322bf8[_0x03ef('0x4f')],{})[_0x03ef('0x16')](respondWithResult(_0x1ce22a,0xc9))[_0x03ef('0x1f')](handleError(_0x1ce22a,null));};exports['update']=function(_0x5b46a8,_0x152bb5){if(_0x5b46a8[_0x03ef('0x4f')]['id']){delete _0x5b46a8[_0x03ef('0x4f')]['id'];}return db[_0x03ef('0x47')]['find']({'where':{'id':_0x5b46a8[_0x03ef('0x4b')]['id']}})[_0x03ef('0x16')](handleEntityNotFound(_0x152bb5,null))[_0x03ef('0x16')](saveUpdates(_0x5b46a8[_0x03ef('0x4f')],null))[_0x03ef('0x16')](respondWithResult(_0x152bb5,null))[_0x03ef('0x1f')](handleError(_0x152bb5,null));};exports['destroy']=function(_0x30fe3b,_0x38330c){return db[_0x03ef('0x47')]['find']({'where':{'id':_0x30fe3b[_0x03ef('0x4b')]['id']}})[_0x03ef('0x16')](handleEntityNotFound(_0x38330c,null))[_0x03ef('0x16')](removeEntity(_0x38330c,null))[_0x03ef('0x1f')](handleError(_0x38330c,null));};exports[_0x03ef('0x50')]=function(_0x43d200,_0x5b280f,_0x8923b9){var _0x1194ad={};var _0x4dad13={};var _0x111e0d;var _0x14dada;return db[_0x03ef('0x47')][_0x03ef('0x51')]({'where':{'id':_0x43d200['params']['id']}})[_0x03ef('0x16')](handleEntityNotFound(_0x5b280f,null))[_0x03ef('0x16')](function(_0x376d60){if(_0x376d60){_0x111e0d=_0x376d60;_0x4dad13[_0x03ef('0x38')]=_[_0x03ef('0x32')](db[_0x03ef('0x52')][_0x03ef('0x31')]);_0x4dad13[_0x03ef('0x35')]=_[_0x03ef('0x32')](_0x43d200[_0x03ef('0x35')]);_0x4dad13[_0x03ef('0x36')]=_['intersection'](_0x4dad13[_0x03ef('0x38')],_0x4dad13[_0x03ef('0x35')]);_0x1194ad[_0x03ef('0x39')]=_[_0x03ef('0x37')](_0x4dad13[_0x03ef('0x38')],qs[_0x03ef('0x3a')](_0x43d200[_0x03ef('0x35')][_0x03ef('0x3a')]));_0x1194ad[_0x03ef('0x39')]=_0x1194ad[_0x03ef('0x39')]['length']?_0x1194ad[_0x03ef('0x39')]:_0x4dad13[_0x03ef('0x38')];_0x1194ad[_0x03ef('0x3d')]=qs[_0x03ef('0x3e')](_0x43d200[_0x03ef('0x35')][_0x03ef('0x3e')]);_0x1194ad[_0x03ef('0x3f')]=qs[_0x03ef('0x36')](_[_0x03ef('0x40')](_0x43d200[_0x03ef('0x35')],_0x4dad13['filters']));if(_0x43d200[_0x03ef('0x35')][_0x03ef('0x44')]){_0x1194ad[_0x03ef('0x3f')]=_[_0x03ef('0x43')](_0x1194ad[_0x03ef('0x3f')],{'$or':_[_0x03ef('0x45')](_0x1194ad[_0x03ef('0x39')],function(_0x30f2f0){var _0x449e7f={};_0x449e7f[_0x30f2f0]={'$like':'%'+_0x43d200[_0x03ef('0x35')][_0x03ef('0x44')]+'%'};return _0x449e7f;})});}_0x1194ad=_[_0x03ef('0x43')]({},_0x1194ad,_0x43d200['options']);return _0x111e0d[_0x03ef('0x50')](_0x1194ad);}})[_0x03ef('0x16')](function(_0x1cdbd5){if(_0x1cdbd5){_0x14dada=_0x1cdbd5[_0x03ef('0x3b')];if(!_0x43d200[_0x03ef('0x35')][_0x03ef('0x53')](_0x03ef('0x3c'))){_0x1194ad[_0x03ef('0x25')]=qs[_0x03ef('0x25')](_0x43d200[_0x03ef('0x35')]['limit']);_0x1194ad[_0x03ef('0x24')]=qs[_0x03ef('0x24')](_0x43d200['query'][_0x03ef('0x24')]);}return _0x111e0d[_0x03ef('0x50')](_0x1194ad);}})[_0x03ef('0x16')](function(_0x5e281a){if(_0x5e281a){return _0x5e281a?{'count':_0x14dada,'rows':_0x5e281a}:null;}})[_0x03ef('0x16')](respondWithResult(_0x5b280f,null))[_0x03ef('0x1f')](handleError(_0x5b280f,null));};exports[_0x03ef('0x54')]=function(_0x2c7e64,_0xbf44ea,_0x506bac){var _0x12e6ee={};var _0x90fc79={};var _0x2320dd;var _0x2b6baa;return db[_0x03ef('0x47')][_0x03ef('0x51')]({'where':{'id':_0x2c7e64[_0x03ef('0x4b')]['id']}})['then'](handleEntityNotFound(_0xbf44ea,null))[_0x03ef('0x16')](function(_0x446d44){if(_0x446d44){_0x2320dd=_0x446d44;_0x90fc79['model']=_['keys'](db[_0x03ef('0x52')][_0x03ef('0x31')]);_0x90fc79['query']=_[_0x03ef('0x32')](_0x2c7e64[_0x03ef('0x35')]);_0x90fc79[_0x03ef('0x36')]=_[_0x03ef('0x37')](_0x90fc79[_0x03ef('0x38')],_0x90fc79[_0x03ef('0x35')]);_0x12e6ee[_0x03ef('0x39')]=_[_0x03ef('0x37')](_0x90fc79[_0x03ef('0x38')],qs['fields'](_0x2c7e64['query'][_0x03ef('0x3a')]));_0x12e6ee[_0x03ef('0x39')]=_0x12e6ee[_0x03ef('0x39')]['length']?_0x12e6ee[_0x03ef('0x39')]:_0x90fc79[_0x03ef('0x38')];_0x12e6ee[_0x03ef('0x3d')]=qs['sort'](_0x2c7e64[_0x03ef('0x35')]['sort']);_0x12e6ee[_0x03ef('0x3f')]=qs[_0x03ef('0x36')](_['pick'](_0x2c7e64[_0x03ef('0x35')],_0x90fc79['filters']));if(_0x2c7e64[_0x03ef('0x35')][_0x03ef('0x44')]){_0x12e6ee[_0x03ef('0x3f')]=_[_0x03ef('0x43')](_0x12e6ee['where'],{'$or':_[_0x03ef('0x45')](_0x12e6ee['attributes'],function(_0x4f58fe){var _0x4a2d4a={};_0x4a2d4a[_0x4f58fe]={'$like':'%'+_0x2c7e64[_0x03ef('0x35')][_0x03ef('0x44')]+'%'};return _0x4a2d4a;})});}_0x12e6ee=_[_0x03ef('0x43')]({},_0x12e6ee,_0x2c7e64[_0x03ef('0x46')]);return _0x2320dd[_0x03ef('0x54')](_0x12e6ee);}})[_0x03ef('0x16')](function(_0x22e629){if(_0x22e629){_0x2b6baa=_0x22e629[_0x03ef('0x3b')];if(!_0x2c7e64[_0x03ef('0x35')]['hasOwnProperty']('nolimit')){_0x12e6ee['limit']=qs['limit'](_0x2c7e64['query'][_0x03ef('0x25')]);_0x12e6ee[_0x03ef('0x24')]=qs[_0x03ef('0x24')](_0x2c7e64[_0x03ef('0x35')][_0x03ef('0x24')]);}return _0x2320dd[_0x03ef('0x54')](_0x12e6ee);}})['then'](function(_0x429657){if(_0x429657){return _0x429657?{'count':_0x2b6baa,'rows':_0x429657}:null;}})[_0x03ef('0x16')](respondWithResult(_0xbf44ea,null))[_0x03ef('0x1f')](handleError(_0xbf44ea,null));};exports[_0x03ef('0x55')]=function(_0x3f23c0,_0x3dc24b,_0x16f977){var _0x2b7ec0={};var _0x2d5cd2={};var _0x17524f;var _0x1d7cd0;return db[_0x03ef('0x47')][_0x03ef('0x51')]({'where':{'id':_0x3f23c0['params']['id']}})[_0x03ef('0x16')](handleEntityNotFound(_0x3dc24b,null))[_0x03ef('0x16')](function(_0x386e6d){if(_0x386e6d){_0x17524f=_0x386e6d;_0x2d5cd2[_0x03ef('0x38')]=_[_0x03ef('0x32')](db[_0x03ef('0x52')]['rawAttributes']);_0x2d5cd2['query']=_['keys'](_0x3f23c0[_0x03ef('0x35')]);_0x2d5cd2['filters']=_[_0x03ef('0x37')](_0x2d5cd2[_0x03ef('0x38')],_0x2d5cd2[_0x03ef('0x35')]);_0x2b7ec0[_0x03ef('0x39')]=_[_0x03ef('0x37')](_0x2d5cd2[_0x03ef('0x38')],qs['fields'](_0x3f23c0['query']['fields']));_0x2b7ec0[_0x03ef('0x39')]=_0x2b7ec0[_0x03ef('0x39')][_0x03ef('0x3b')]?_0x2b7ec0['attributes']:_0x2d5cd2[_0x03ef('0x38')];_0x2b7ec0[_0x03ef('0x3d')]=qs[_0x03ef('0x3e')](_0x3f23c0[_0x03ef('0x35')]['sort']);_0x2b7ec0['where']=qs[_0x03ef('0x36')](_[_0x03ef('0x40')](_0x3f23c0[_0x03ef('0x35')],_0x2d5cd2['filters']));if(_0x3f23c0[_0x03ef('0x35')][_0x03ef('0x44')]){_0x2b7ec0[_0x03ef('0x3f')]=_[_0x03ef('0x43')](_0x2b7ec0[_0x03ef('0x3f')],{'$or':_['map'](_0x2b7ec0['attributes'],function(_0x39b20d){var _0x2eea71={};_0x2eea71[_0x39b20d]={'$like':'%'+_0x3f23c0['query'][_0x03ef('0x44')]+'%'};return _0x2eea71;})});}_0x2b7ec0=_[_0x03ef('0x43')]({},_0x2b7ec0,_0x3f23c0[_0x03ef('0x46')]);return _0x17524f[_0x03ef('0x55')](_0x2b7ec0);}})[_0x03ef('0x16')](function(_0x32cd21){if(_0x32cd21){_0x1d7cd0=_0x32cd21['length'];if(!_0x3f23c0[_0x03ef('0x35')][_0x03ef('0x53')](_0x03ef('0x3c'))){_0x2b7ec0[_0x03ef('0x25')]=qs['limit'](_0x3f23c0[_0x03ef('0x35')][_0x03ef('0x25')]);_0x2b7ec0['offset']=qs[_0x03ef('0x24')](_0x3f23c0[_0x03ef('0x35')][_0x03ef('0x24')]);}return _0x17524f[_0x03ef('0x55')](_0x2b7ec0);}})[_0x03ef('0x16')](function(_0x191750){if(_0x191750){return _0x191750?{'count':_0x1d7cd0,'rows':_0x191750}:null;}})['then'](respondWithResult(_0x3dc24b,null))[_0x03ef('0x1f')](handleError(_0x3dc24b,null));};
\ No newline at end of file
index aedb3ec..2a8bb29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0eb=['./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','util','../../config/logger','api','moment','request-promise'];(function(_0x589147,_0x4f20e4){var _0x45239d=function(_0x3dc3af){while(--_0x3dc3af){_0x589147['push'](_0x589147['shift']());}};_0x45239d(++_0x4f20e4);}(_0xd0eb,0x15b));var _0xbd0e=function(_0xb6e43,_0x1568fc){_0xb6e43=_0xb6e43-0x0;var _0x47c40f=_0xd0eb[_0xb6e43];return _0x47c40f;};'use strict';var _=require('lodash');var util=require(_0xbd0e('0x0'));var logger=require(_0xbd0e('0x1'))(_0xbd0e('0x2'));var moment=require(_0xbd0e('0x3'));var BPromise=require('bluebird');var rp=require(_0xbd0e('0x4'));var attributes=require(_0xbd0e('0x5'));module['exports']=function(_0x2759b6,_0x3c7ef6){return _0x2759b6[_0xbd0e('0x6')](_0xbd0e('0x7'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xebae=['int_sugarcrm_configurations','lodash','util','../../config/logger','api','request-promise','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration'];(function(_0x3372ae,_0x3cb28c){var _0x4e9338=function(_0x8d9a4a){while(--_0x8d9a4a){_0x3372ae['push'](_0x3372ae['shift']());}};_0x4e9338(++_0x3cb28c);}(_0xebae,0x83));var _0xeeba=function(_0x11fc7e,_0x2fa1a2){_0x11fc7e=_0x11fc7e-0x0;var _0x572f83=_0xebae[_0x11fc7e];return _0x572f83;};'use strict';var _=require(_0xeeba('0x0'));var util=require(_0xeeba('0x1'));var logger=require(_0xeeba('0x2'))(_0xeeba('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xeeba('0x4'));var attributes=require(_0xeeba('0x5'));module[_0xeeba('0x6')]=function(_0x12942b,_0x1f0248){return _0x12942b[_0xeeba('0x7')](_0xeeba('0x8'),attributes,{'tableName':_0xeeba('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 224de81..d1f9e9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1628=['catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x195e27,_0x1bce60){var _0x2583f7=function(_0x639881){while(--_0x639881){_0x195e27['push'](_0x195e27['shift']());}};_0x2583f7(++_0x1bce60);}(_0x1628,0xbe));var _0x8162=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0x1628[_0x5d8018];return _0x151ac4;};'use strict';var _=require(_0x8162('0x0'));var util=require(_0x8162('0x1'));var moment=require(_0x8162('0x2'));var BPromise=require('bluebird');var rs=require(_0x8162('0x3'));var fs=require('fs');var db=require(_0x8162('0x4'))['db'];var utils=require(_0x8162('0x5'));var logger=require(_0x8162('0x6'))(_0x8162('0x7'));var config=require(_0x8162('0x8'));var jayson=require(_0x8162('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2df52f,_0x3030c4,_0x36a3f7){return new BPromise(function(_0x27dd1e,_0x2c309c){return client[_0x8162('0xa')](_0x2df52f,_0x36a3f7)[_0x8162('0xb')](function(_0x2f064d){logger[_0x8162('0xc')](_0x8162('0xd'),_0x3030c4,_0x8162('0xe'));logger['debug'](_0x8162('0xf'),_0x3030c4,_0x8162('0xe'),JSON[_0x8162('0x10')](_0x2f064d));if(_0x2f064d[_0x8162('0x11')]){if(_0x2f064d[_0x8162('0x11')]['code']===0x1f4){logger[_0x8162('0x11')](_0x8162('0xd'),_0x3030c4,_0x2f064d['error'][_0x8162('0x12')]);return _0x2c309c(_0x2f064d[_0x8162('0x11')][_0x8162('0x12')]);}logger[_0x8162('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3030c4,_0x2f064d[_0x8162('0x11')][_0x8162('0x12')]);return _0x27dd1e(_0x2f064d[_0x8162('0x11')][_0x8162('0x12')]);}else{logger[_0x8162('0xc')](_0x8162('0xd'),_0x3030c4,_0x8162('0xe'));_0x27dd1e(_0x2f064d[_0x8162('0x13')]['message']);}})[_0x8162('0x14')](function(_0x5c2275){logger['error'](_0x8162('0xd'),_0x3030c4,_0x5c2275);_0x2c309c(_0x5c2275);});});}
\ No newline at end of file
+var _0x9657=['message','info','result','catch','lodash','../../mysqldb','../../config/environment','jayson/promise','client','http','request','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0x20022a,_0x406c94){var _0x11ee01=function(_0x2b91a1){while(--_0x2b91a1){_0x20022a['push'](_0x20022a['shift']());}};_0x11ee01(++_0x406c94);}(_0x9657,0x64));var _0x7965=function(_0x427523,_0x5a833e){_0x427523=_0x427523-0x0;var _0x1196fe=_0x9657[_0x427523];return _0x1196fe;};'use strict';var _=require(_0x7965('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0x7965('0x1'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7965('0x2'));var jayson=require(_0x7965('0x3'));var client=jayson[_0x7965('0x4')][_0x7965('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x1b2127,_0x10bbaf,_0x2c7d84){return new BPromise(function(_0x58f8bc,_0x29b17f){return client[_0x7965('0x6')](_0x1b2127,_0x2c7d84)['then'](function(_0xe8cf17){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x10bbaf,_0x7965('0x7'));logger['debug'](_0x7965('0x8'),_0x10bbaf,_0x7965('0x7'),JSON['stringify'](_0xe8cf17));if(_0xe8cf17[_0x7965('0x9')]){if(_0xe8cf17[_0x7965('0x9')][_0x7965('0xa')]===0x1f4){logger[_0x7965('0x9')](_0x7965('0xb'),_0x10bbaf,_0xe8cf17['error'][_0x7965('0xc')]);return _0x29b17f(_0xe8cf17[_0x7965('0x9')]['message']);}logger[_0x7965('0x9')](_0x7965('0xb'),_0x10bbaf,_0xe8cf17[_0x7965('0x9')][_0x7965('0xc')]);return _0x58f8bc(_0xe8cf17[_0x7965('0x9')][_0x7965('0xc')]);}else{logger[_0x7965('0xd')](_0x7965('0xb'),_0x10bbaf,_0x7965('0x7'));_0x58f8bc(_0xe8cf17[_0x7965('0xe')]['message']);}})[_0x7965('0xf')](function(_0x8003af){logger[_0x7965('0x9')](_0x7965('0xb'),_0x10bbaf,_0x8003af);_0x29b17f(_0x8003af);});});}
\ No newline at end of file
index adadb4d..185b4ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56e7=['update','destroy','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','/:id','show','put'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x56e7,0x7b));var _0x756e=function(_0x411e55,_0x500863){_0x411e55=_0x411e55-0x0;var _0x374330=_0x56e7[_0x411e55];return _0x374330;};'use strict';var multer=require('multer');var util=require(_0x756e('0x0'));var path=require(_0x756e('0x1'));var express=require('express');var router=express[_0x756e('0x2')]();var auth=require(_0x756e('0x3'));var interaction=require(_0x756e('0x4'));var config=require(_0x756e('0x5'));var controller=require(_0x756e('0x6'));router[_0x756e('0x7')]('/',auth[_0x756e('0x8')](),controller['index']);router[_0x756e('0x7')](_0x756e('0x9'),auth[_0x756e('0x8')](),controller[_0x756e('0xa')]);router['post']('/',auth[_0x756e('0x8')](),controller['create']);router[_0x756e('0xb')](_0x756e('0x9'),auth[_0x756e('0x8')](),controller[_0x756e('0xc')]);router['delete']('/:id',auth[_0x756e('0x8')](),controller[_0x756e('0xd')]);module[_0x756e('0xe')]=router;
\ No newline at end of file
+var _0x8958=['post','create','put','update','delete','destroy','exports','util','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','/:id','show'];(function(_0x233716,_0x346676){var _0x302298=function(_0x53d84c){while(--_0x53d84c){_0x233716['push'](_0x233716['shift']());}};_0x302298(++_0x346676);}(_0x8958,0x93));var _0x8895=function(_0x2f05c6,_0x42673e){_0x2f05c6=_0x2f05c6-0x0;var _0x21df7c=_0x8958[_0x2f05c6];return _0x21df7c;};'use strict';var multer=require('multer');var util=require(_0x8895('0x0'));var path=require('path');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8895('0x1'));var config=require('../../config/environment');var controller=require(_0x8895('0x2'));router[_0x8895('0x3')]('/',auth[_0x8895('0x4')](),controller['index']);router[_0x8895('0x3')](_0x8895('0x5'),auth[_0x8895('0x4')](),controller[_0x8895('0x6')]);router[_0x8895('0x7')]('/',auth['isAuthenticated'](),controller[_0x8895('0x8')]);router[_0x8895('0x9')](_0x8895('0x5'),auth[_0x8895('0x4')](),controller[_0x8895('0xa')]);router[_0x8895('0xb')](_0x8895('0x5'),auth[_0x8895('0x4')](),controller[_0x8895('0xc')]);module[_0x8895('0xd')]=router;
\ No newline at end of file
index 6dcdfee..769fdbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c00=['sequelize','exports','variable','customVariable','string','STRING','ENUM','BOOLEAN'];(function(_0x321c35,_0x577e53){var _0x1f2d41=function(_0x1732e3){while(--_0x1732e3){_0x321c35['push'](_0x321c35['shift']());}};_0x1f2d41(++_0x577e53);}(_0x9c00,0x1a0));var _0x09c0=function(_0x336adb,_0x1c3608){_0x336adb=_0x336adb-0x0;var _0x5be7f5=_0x9c00[_0x336adb];return _0x5be7f5;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x09c0('0x2'),_0x09c0('0x3'),'keyValue'),'defaultValue':_0x09c0('0x4')},'content':{'type':Sequelize[_0x09c0('0x5')]},'key':{'type':Sequelize[_0x09c0('0x5')]},'keyType':{'type':Sequelize[_0x09c0('0x6')](_0x09c0('0x4'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x09c0('0x5')]},'idField':{'type':Sequelize[_0x09c0('0x5')]},'nameField':{'type':Sequelize[_0x09c0('0x5')]},'customField':{'type':Sequelize[_0x09c0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x09c0('0x5')]}};
\ No newline at end of file
+var _0x6c76=['customVariable','STRING','string','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x6c76,0x184));var _0x66c7=function(_0x373447,_0x32a264){_0x373447=_0x373447-0x0;var _0x283e0b=_0x6c76[_0x373447];return _0x283e0b;};'use strict';var Sequelize=require(_0x66c7('0x0'));module[_0x66c7('0x1')]={'type':{'type':Sequelize[_0x66c7('0x2')]('string',_0x66c7('0x3'),_0x66c7('0x4'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x66c7('0x5')]},'key':{'type':Sequelize[_0x66c7('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x66c7('0x6'),_0x66c7('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x66c7('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x66c7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x66c7('0x5')]}};
\ No newline at end of file
index be3d73a..1318217 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12f1=['model','keys','dateStart','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','dateEnd','add','day','filter','merge','map','options','count','includeAll','include','findAll','catch','params','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','SugarcrmField','rawAttributes'];(function(_0x5f3d45,_0x260d78){var _0x135c19=function(_0x2a095f){while(--_0x2a095f){_0x5f3d45['push'](_0x5f3d45['shift']());}};_0x135c19(++_0x260d78);}(_0x12f1,0xf4));var _0x112f=function(_0x29cc56,_0x572e53){_0x29cc56=_0x29cc56-0x0;var _0x816a75=_0x12f1[_0x29cc56];return _0x816a75;};'use strict';var pdf=require(_0x112f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x112f('0x1'));var zipdir=require(_0x112f('0x2'));var jsonpatch=require(_0x112f('0x3'));var rp=require(_0x112f('0x4'));var moment=require(_0x112f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x112f('0x6'));var sox=require('sox');var csv=require(_0x112f('0x7'));var ejs=require(_0x112f('0x8'));var fs=require('fs');var _=require(_0x112f('0x9'));var squel=require(_0x112f('0xa'));var crypto=require(_0x112f('0xb'));var jsforce=require(_0x112f('0xc'));var deskjs=require(_0x112f('0xd'));var toCsv=require(_0x112f('0x7'));var querystring=require(_0x112f('0xe'));var Papa=require('papaparse');var qs=require(_0x112f('0xf'));var logger=require(_0x112f('0x10'))(_0x112f('0x11'));var utils=require(_0x112f('0x12'));var config=require(_0x112f('0x13'));var db=require(_0x112f('0x14'))['db'];function respondWithStatusCode(_0x3e88d6,_0x5099c2){_0x5099c2=_0x5099c2||0xcc;return function(_0x115351){if(_0x115351){return _0x3e88d6[_0x112f('0x15')](_0x5099c2);}return _0x3e88d6[_0x112f('0x16')](_0x5099c2)[_0x112f('0x17')]();};}function respondWithResult(_0x378a42,_0x28c3a0){_0x28c3a0=_0x28c3a0||0xc8;return function(_0x533de2){if(_0x533de2){return _0x378a42[_0x112f('0x16')](_0x28c3a0)[_0x112f('0x18')](_0x533de2);}};}function respondWithFilteredResult(_0xd8e366,_0x444542){return function(_0x3bf7d5){if(_0x3bf7d5){var _0x2d0ecf=_0x3bf7d5['count'],_0x51d155=_0x444542[_0x112f('0x19')],_0x5923df=_0x444542[_0x112f('0x19')]+_0x444542[_0x112f('0x1a')],_0x3c7bd2;if(_0x5923df>=_0x2d0ecf){_0x5923df=_0x2d0ecf;_0x3c7bd2=0xc8;}else{_0x3c7bd2=0xce;}_0xd8e366[_0x112f('0x16')](_0x3c7bd2);return _0xd8e366[_0x112f('0x1b')](_0x112f('0x1c'),_0x51d155+'-'+_0x5923df+'/'+_0x2d0ecf)[_0x112f('0x18')](_0x3bf7d5);}return null;};}function patchUpdates(_0xc8a6c5){return function(_0x3354b0){try{jsonpatch[_0x112f('0x1d')](_0x3354b0,_0xc8a6c5,!![]);}catch(_0x33f43a){return BPromise[_0x112f('0x1e')](_0x33f43a);}return _0x3354b0['save']();};}function saveUpdates(_0x332059,_0x2ebda4){return function(_0x309f20){if(_0x309f20){return _0x309f20[_0x112f('0x1f')](_0x332059)[_0x112f('0x20')](function(_0x2e2ce9){return _0x2e2ce9;});}return null;};}function removeEntity(_0x36f69c,_0x3b5dd5){return function(_0x5c160d){if(_0x5c160d){return _0x5c160d[_0x112f('0x21')]()['then'](function(){_0x36f69c[_0x112f('0x16')](0xcc)[_0x112f('0x17')]();});}};}function handleEntityNotFound(_0x116b51,_0x4cb4fd){return function(_0x6ad0e1){if(!_0x6ad0e1){_0x116b51['sendStatus'](0x194);}return _0x6ad0e1;};}function handleError(_0x2785b2,_0x59b949){_0x59b949=_0x59b949||0x1f4;return function(_0x158d4c){logger[_0x112f('0x22')](_0x158d4c['stack']);if(_0x158d4c[_0x112f('0x23')]){delete _0x158d4c[_0x112f('0x23')];}_0x2785b2[_0x112f('0x16')](_0x59b949)[_0x112f('0x24')](_0x158d4c);};}exports[_0x112f('0x25')]=function(_0x2de0e2,_0x5ec49e){var _0x5ce658={},_0x32a0b8={},_0x5d6e3a={'count':0x0,'rows':[]};var _0x424431=db[_0x112f('0x26')][_0x112f('0x27')];_0x32a0b8[_0x112f('0x28')]=_[_0x112f('0x29')](_0x424431);var _0x4b0e9b={'dateStart':_0x2de0e2['query'][_0x112f('0x2a')],'dateEnd':_0x2de0e2[_0x112f('0x2b')]['dateEnd']};delete _0x2de0e2['query'][_0x112f('0x2a')];delete _0x2de0e2['query']['dateEnd'];_0x32a0b8[_0x112f('0x2b')]=_[_0x112f('0x29')](_0x2de0e2[_0x112f('0x2b')]);_0x32a0b8['filters']=_['intersection'](_0x32a0b8['model'],_0x32a0b8[_0x112f('0x2b')]);_0x5ce658[_0x112f('0x2c')]=_[_0x112f('0x2d')](_0x32a0b8[_0x112f('0x28')],qs[_0x112f('0x2e')](_0x2de0e2[_0x112f('0x2b')][_0x112f('0x2e')]));_0x5ce658[_0x112f('0x2c')]=_0x5ce658[_0x112f('0x2c')][_0x112f('0x2f')]?_0x5ce658[_0x112f('0x2c')]:_0x32a0b8[_0x112f('0x28')];if(!_0x2de0e2[_0x112f('0x2b')][_0x112f('0x30')](_0x112f('0x31'))){_0x5ce658[_0x112f('0x1a')]=qs[_0x112f('0x1a')](_0x2de0e2[_0x112f('0x2b')][_0x112f('0x1a')]);_0x5ce658[_0x112f('0x19')]=qs[_0x112f('0x19')](_0x2de0e2[_0x112f('0x2b')][_0x112f('0x19')]);}_0x5ce658[_0x112f('0x32')]=qs[_0x112f('0x33')](_0x2de0e2[_0x112f('0x2b')]['sort']);_0x5ce658[_0x112f('0x34')]=qs[_0x112f('0x35')](_[_0x112f('0x36')](_0x2de0e2[_0x112f('0x2b')],_0x32a0b8[_0x112f('0x35')]));if(_0x4b0e9b[_0x112f('0x2a')]){if(_0x4b0e9b['dateEnd']){_0x4b0e9b[_0x112f('0x37')]=moment(_0x4b0e9b[_0x112f('0x37')])[_0x112f('0x38')](0x1,'day');}else{_0x4b0e9b['dateEnd']=moment(_0x4b0e9b[_0x112f('0x2a')])['add'](0x1,_0x112f('0x39'));}_['merge'](_0x5ce658[_0x112f('0x34')],{'createdAt':{'$gte':_0x4b0e9b['dateStart'],'$lte':_0x4b0e9b[_0x112f('0x37')]}});}if(_0x2de0e2[_0x112f('0x2b')][_0x112f('0x3a')]){_0x5ce658[_0x112f('0x34')]=_[_0x112f('0x3b')](_0x5ce658[_0x112f('0x34')],{'$or':_[_0x112f('0x3c')](_0x5ce658[_0x112f('0x2c')],function(_0x548421){var _0x56f4a9={};_0x56f4a9[_0x548421]={'$like':'%'+_0x2de0e2['query'][_0x112f('0x3a')]+'%'};return _0x56f4a9;})});}_0x5ce658=_['merge']({},_0x5ce658,_0x2de0e2[_0x112f('0x3d')]);var _0x42b1d9={'where':_0x5ce658[_0x112f('0x34')]};return db[_0x112f('0x26')][_0x112f('0x3e')](_0x42b1d9)[_0x112f('0x20')](function(_0x403a16){_0x5d6e3a['count']=_0x403a16;if(_0x2de0e2[_0x112f('0x2b')][_0x112f('0x3f')]){_0x5ce658[_0x112f('0x40')]=[{'all':!![]}];}return db['SugarcrmField'][_0x112f('0x41')](_0x5ce658);})['then'](function(_0x2472c6){_0x5d6e3a['rows']=_0x2472c6;return _0x5d6e3a;})['then'](respondWithFilteredResult(_0x5ec49e,_0x5ce658))[_0x112f('0x42')](handleError(_0x5ec49e,null));};exports['show']=function(_0x353d3a,_0x25a773){var _0x305eec={'raw':!![],'where':{'id':_0x353d3a[_0x112f('0x43')]['id']}},_0x5a730e={};_0x5a730e['model']=_[_0x112f('0x29')](db[_0x112f('0x26')][_0x112f('0x27')]);_0x5a730e[_0x112f('0x2b')]=_[_0x112f('0x29')](_0x353d3a[_0x112f('0x2b')]);_0x5a730e[_0x112f('0x35')]=_[_0x112f('0x2d')](_0x5a730e['model'],_0x5a730e[_0x112f('0x2b')]);_0x305eec['attributes']=_[_0x112f('0x2d')](_0x5a730e[_0x112f('0x28')],qs[_0x112f('0x2e')](_0x353d3a[_0x112f('0x2b')][_0x112f('0x2e')]));_0x305eec[_0x112f('0x2c')]=_0x305eec[_0x112f('0x2c')][_0x112f('0x2f')]?_0x305eec[_0x112f('0x2c')]:_0x5a730e['model'];if(_0x353d3a[_0x112f('0x2b')]['includeAll']){_0x305eec[_0x112f('0x40')]=[{'all':!![]}];}_0x305eec=_['merge']({},_0x305eec,_0x353d3a[_0x112f('0x3d')]);return db[_0x112f('0x26')][_0x112f('0x44')](_0x305eec)['then'](handleEntityNotFound(_0x25a773,null))[_0x112f('0x20')](respondWithResult(_0x25a773,null))[_0x112f('0x42')](handleError(_0x25a773,null));};exports[_0x112f('0x45')]=function(_0x4baab1,_0x477e76){return db[_0x112f('0x26')]['create'](_0x4baab1[_0x112f('0x46')],{})[_0x112f('0x20')](respondWithResult(_0x477e76,0xc9))[_0x112f('0x42')](handleError(_0x477e76,null));};exports['update']=function(_0x49d7ed,_0x3dafbd){if(_0x49d7ed[_0x112f('0x46')]['id']){delete _0x49d7ed[_0x112f('0x46')]['id'];}return db[_0x112f('0x26')][_0x112f('0x44')]({'where':{'id':_0x49d7ed[_0x112f('0x43')]['id']}})[_0x112f('0x20')](handleEntityNotFound(_0x3dafbd,null))['then'](saveUpdates(_0x49d7ed[_0x112f('0x46')],null))[_0x112f('0x20')](respondWithResult(_0x3dafbd,null))[_0x112f('0x42')](handleError(_0x3dafbd,null));};exports['destroy']=function(_0x5acd10,_0x162908){return db[_0x112f('0x26')][_0x112f('0x44')]({'where':{'id':_0x5acd10[_0x112f('0x43')]['id']}})['then'](handleEntityNotFound(_0x162908,null))[_0x112f('0x20')](removeEntity(_0x162908,null))[_0x112f('0x42')](handleError(_0x162908,null));};
\ No newline at end of file
+var _0xde23=['lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','json','apply','save','update','then','sendStatus','error','stack','name','send','SugarcrmField','rawAttributes','model','keys','query','dateEnd','attributes','intersection','order','sort','where','pick','filters','dateStart','day','add','merge','filter','map','options','includeAll','include','catch','show','params','fields','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0x4f6d16,_0xec3008){var _0x1b1014=function(_0x4e00ba){while(--_0x4e00ba){_0x4f6d16['push'](_0x4f6d16['shift']());}};_0x1b1014(++_0xec3008);}(_0xde23,0xc0));var _0x3de2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xde23[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x3de2('0x0'));var emlformat=require(_0x3de2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3de2('0x2'));var jsonpatch=require(_0x3de2('0x3'));var rp=require(_0x3de2('0x4'));var moment=require(_0x3de2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3de2('0x6'));var util=require(_0x3de2('0x7'));var path=require(_0x3de2('0x8'));var sox=require(_0x3de2('0x9'));var csv=require(_0x3de2('0xa'));var ejs=require(_0x3de2('0xb'));var fs=require('fs');var _=require(_0x3de2('0xc'));var squel=require(_0x3de2('0xd'));var crypto=require(_0x3de2('0xe'));var jsforce=require(_0x3de2('0xf'));var deskjs=require(_0x3de2('0x10'));var toCsv=require('to-csv');var querystring=require(_0x3de2('0x11'));var Papa=require('papaparse');var qs=require(_0x3de2('0x12'));var logger=require(_0x3de2('0x13'))(_0x3de2('0x14'));var utils=require(_0x3de2('0x15'));var config=require(_0x3de2('0x16'));var db=require(_0x3de2('0x17'))['db'];function respondWithStatusCode(_0x1887d3,_0x4a9dd5){_0x4a9dd5=_0x4a9dd5||0xcc;return function(_0x3eefbf){if(_0x3eefbf){return _0x1887d3['sendStatus'](_0x4a9dd5);}return _0x1887d3[_0x3de2('0x18')](_0x4a9dd5)[_0x3de2('0x19')]();};}function respondWithResult(_0x2fd4e1,_0x4a9563){_0x4a9563=_0x4a9563||0xc8;return function(_0x2d6b7){if(_0x2d6b7){return _0x2fd4e1['status'](_0x4a9563)['json'](_0x2d6b7);}};}function respondWithFilteredResult(_0x727708,_0x261d02){return function(_0x379c31){if(_0x379c31){var _0x3b383b=_0x379c31[_0x3de2('0x1a')],_0xc2d6d1=_0x261d02[_0x3de2('0x1b')],_0x2a4a1d=_0x261d02[_0x3de2('0x1b')]+_0x261d02[_0x3de2('0x1c')],_0x434649;if(_0x2a4a1d>=_0x3b383b){_0x2a4a1d=_0x3b383b;_0x434649=0xc8;}else{_0x434649=0xce;}_0x727708[_0x3de2('0x18')](_0x434649);return _0x727708['set']('Content-Range',_0xc2d6d1+'-'+_0x2a4a1d+'/'+_0x3b383b)[_0x3de2('0x1d')](_0x379c31);}return null;};}function patchUpdates(_0x3b3620){return function(_0x31fc34){try{jsonpatch[_0x3de2('0x1e')](_0x31fc34,_0x3b3620,!![]);}catch(_0x52a06d){return BPromise['reject'](_0x52a06d);}return _0x31fc34[_0x3de2('0x1f')]();};}function saveUpdates(_0x52fda2,_0x2a20e2){return function(_0x2204be){if(_0x2204be){return _0x2204be[_0x3de2('0x20')](_0x52fda2)['then'](function(_0x4bddcf){return _0x4bddcf;});}return null;};}function removeEntity(_0xfd3bbf,_0x28d3b1){return function(_0x4caa52){if(_0x4caa52){return _0x4caa52['destroy']()[_0x3de2('0x21')](function(){_0xfd3bbf[_0x3de2('0x18')](0xcc)[_0x3de2('0x19')]();});}};}function handleEntityNotFound(_0x5561eb,_0x1d4f2d){return function(_0xef9490){if(!_0xef9490){_0x5561eb[_0x3de2('0x22')](0x194);}return _0xef9490;};}function handleError(_0x25b96a,_0x2c0a29){_0x2c0a29=_0x2c0a29||0x1f4;return function(_0x2fcae5){logger[_0x3de2('0x23')](_0x2fcae5[_0x3de2('0x24')]);if(_0x2fcae5[_0x3de2('0x25')]){delete _0x2fcae5['name'];}_0x25b96a[_0x3de2('0x18')](_0x2c0a29)[_0x3de2('0x26')](_0x2fcae5);};}exports['index']=function(_0x3d0262,_0x3ced2e){var _0x1f356e={},_0x1c44c5={},_0x2c5953={'count':0x0,'rows':[]};var _0x362126=db[_0x3de2('0x27')][_0x3de2('0x28')];_0x1c44c5[_0x3de2('0x29')]=_[_0x3de2('0x2a')](_0x362126);var _0x3b4d9c={'dateStart':_0x3d0262[_0x3de2('0x2b')]['dateStart'],'dateEnd':_0x3d0262[_0x3de2('0x2b')][_0x3de2('0x2c')]};delete _0x3d0262[_0x3de2('0x2b')]['dateStart'];delete _0x3d0262[_0x3de2('0x2b')][_0x3de2('0x2c')];_0x1c44c5['query']=_[_0x3de2('0x2a')](_0x3d0262[_0x3de2('0x2b')]);_0x1c44c5['filters']=_['intersection'](_0x1c44c5['model'],_0x1c44c5[_0x3de2('0x2b')]);_0x1f356e[_0x3de2('0x2d')]=_[_0x3de2('0x2e')](_0x1c44c5[_0x3de2('0x29')],qs['fields'](_0x3d0262[_0x3de2('0x2b')]['fields']));_0x1f356e[_0x3de2('0x2d')]=_0x1f356e[_0x3de2('0x2d')]['length']?_0x1f356e['attributes']:_0x1c44c5['model'];if(!_0x3d0262[_0x3de2('0x2b')]['hasOwnProperty']('nolimit')){_0x1f356e[_0x3de2('0x1c')]=qs[_0x3de2('0x1c')](_0x3d0262[_0x3de2('0x2b')][_0x3de2('0x1c')]);_0x1f356e[_0x3de2('0x1b')]=qs['offset'](_0x3d0262['query'][_0x3de2('0x1b')]);}_0x1f356e[_0x3de2('0x2f')]=qs[_0x3de2('0x30')](_0x3d0262[_0x3de2('0x2b')][_0x3de2('0x30')]);_0x1f356e[_0x3de2('0x31')]=qs['filters'](_[_0x3de2('0x32')](_0x3d0262[_0x3de2('0x2b')],_0x1c44c5[_0x3de2('0x33')]));if(_0x3b4d9c[_0x3de2('0x34')]){if(_0x3b4d9c['dateEnd']){_0x3b4d9c[_0x3de2('0x2c')]=moment(_0x3b4d9c[_0x3de2('0x2c')])['add'](0x1,_0x3de2('0x35'));}else{_0x3b4d9c[_0x3de2('0x2c')]=moment(_0x3b4d9c[_0x3de2('0x34')])[_0x3de2('0x36')](0x1,'day');}_[_0x3de2('0x37')](_0x1f356e['where'],{'createdAt':{'$gte':_0x3b4d9c[_0x3de2('0x34')],'$lte':_0x3b4d9c[_0x3de2('0x2c')]}});}if(_0x3d0262[_0x3de2('0x2b')][_0x3de2('0x38')]){_0x1f356e[_0x3de2('0x31')]=_['merge'](_0x1f356e[_0x3de2('0x31')],{'$or':_[_0x3de2('0x39')](_0x1f356e[_0x3de2('0x2d')],function(_0x1c2a4e){var _0x2e2809={};_0x2e2809[_0x1c2a4e]={'$like':'%'+_0x3d0262[_0x3de2('0x2b')][_0x3de2('0x38')]+'%'};return _0x2e2809;})});}_0x1f356e=_[_0x3de2('0x37')]({},_0x1f356e,_0x3d0262[_0x3de2('0x3a')]);var _0xbfe721={'where':_0x1f356e[_0x3de2('0x31')]};return db[_0x3de2('0x27')][_0x3de2('0x1a')](_0xbfe721)[_0x3de2('0x21')](function(_0x42009f){_0x2c5953[_0x3de2('0x1a')]=_0x42009f;if(_0x3d0262[_0x3de2('0x2b')][_0x3de2('0x3b')]){_0x1f356e[_0x3de2('0x3c')]=[{'all':!![]}];}return db[_0x3de2('0x27')]['findAll'](_0x1f356e);})[_0x3de2('0x21')](function(_0x1cb39b){_0x2c5953['rows']=_0x1cb39b;return _0x2c5953;})[_0x3de2('0x21')](respondWithFilteredResult(_0x3ced2e,_0x1f356e))[_0x3de2('0x3d')](handleError(_0x3ced2e,null));};exports[_0x3de2('0x3e')]=function(_0xcce60e,_0x521136){var _0x20b7a7={'raw':!![],'where':{'id':_0xcce60e[_0x3de2('0x3f')]['id']}},_0x46237c={};_0x46237c[_0x3de2('0x29')]=_['keys'](db[_0x3de2('0x27')][_0x3de2('0x28')]);_0x46237c[_0x3de2('0x2b')]=_['keys'](_0xcce60e[_0x3de2('0x2b')]);_0x46237c[_0x3de2('0x33')]=_[_0x3de2('0x2e')](_0x46237c[_0x3de2('0x29')],_0x46237c[_0x3de2('0x2b')]);_0x20b7a7['attributes']=_[_0x3de2('0x2e')](_0x46237c[_0x3de2('0x29')],qs[_0x3de2('0x40')](_0xcce60e[_0x3de2('0x2b')]['fields']));_0x20b7a7[_0x3de2('0x2d')]=_0x20b7a7[_0x3de2('0x2d')]['length']?_0x20b7a7['attributes']:_0x46237c[_0x3de2('0x29')];if(_0xcce60e[_0x3de2('0x2b')][_0x3de2('0x3b')]){_0x20b7a7['include']=[{'all':!![]}];}_0x20b7a7=_['merge']({},_0x20b7a7,_0xcce60e[_0x3de2('0x3a')]);return db[_0x3de2('0x27')][_0x3de2('0x41')](_0x20b7a7)[_0x3de2('0x21')](handleEntityNotFound(_0x521136,null))[_0x3de2('0x21')](respondWithResult(_0x521136,null))[_0x3de2('0x3d')](handleError(_0x521136,null));};exports[_0x3de2('0x42')]=function(_0x2ea7f1,_0x1c6ed0){return db[_0x3de2('0x27')]['create'](_0x2ea7f1[_0x3de2('0x43')],{})[_0x3de2('0x21')](respondWithResult(_0x1c6ed0,0xc9))[_0x3de2('0x3d')](handleError(_0x1c6ed0,null));};exports[_0x3de2('0x20')]=function(_0x12da7a,_0x51a89b){if(_0x12da7a['body']['id']){delete _0x12da7a[_0x3de2('0x43')]['id'];}return db[_0x3de2('0x27')][_0x3de2('0x41')]({'where':{'id':_0x12da7a[_0x3de2('0x3f')]['id']}})[_0x3de2('0x21')](handleEntityNotFound(_0x51a89b,null))[_0x3de2('0x21')](saveUpdates(_0x12da7a[_0x3de2('0x43')],null))[_0x3de2('0x21')](respondWithResult(_0x51a89b,null))[_0x3de2('0x3d')](handleError(_0x51a89b,null));};exports['destroy']=function(_0x28f340,_0x3c178f){return db[_0x3de2('0x27')]['find']({'where':{'id':_0x28f340[_0x3de2('0x3f')]['id']}})[_0x3de2('0x21')](handleEntityNotFound(_0x3c178f,null))['then'](removeEntity(_0x3c178f,null))[_0x3de2('0x3d')](handleError(_0x3c178f,null));};
\ No newline at end of file
index cdc0f82..fbc33d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb141=['request-promise','./intSugarcrmField.attributes','exports','define','int_sugarcrm_fields','lodash','util','../../config/logger','moment','bluebird'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xb141,0x19f));var _0x1b14=function(_0x404734,_0x4b2b1a){_0x404734=_0x404734-0x0;var _0x35054e=_0xb141[_0x404734];return _0x35054e;};'use strict';var _=require(_0x1b14('0x0'));var util=require(_0x1b14('0x1'));var logger=require(_0x1b14('0x2'))('api');var moment=require(_0x1b14('0x3'));var BPromise=require(_0x1b14('0x4'));var rp=require(_0x1b14('0x5'));var attributes=require(_0x1b14('0x6'));module[_0x1b14('0x7')]=function(_0x371fbd,_0x271171){return _0x371fbd[_0x1b14('0x8')]('SugarcrmField',attributes,{'tableName':_0x1b14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0292=['lodash','util','../../config/logger','bluebird','./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields'];(function(_0xfd5a3f,_0x1119e1){var _0x2db607=function(_0x3ea571){while(--_0x3ea571){_0xfd5a3f['push'](_0xfd5a3f['shift']());}};_0x2db607(++_0x1119e1);}(_0x0292,0x118));var _0x2029=function(_0x4d6bfd,_0x8d79ff){_0x4d6bfd=_0x4d6bfd-0x0;var _0x243a46=_0x0292[_0x4d6bfd];return _0x243a46;};'use strict';var _=require(_0x2029('0x0'));var util=require(_0x2029('0x1'));var logger=require(_0x2029('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2029('0x3'));var rp=require('request-promise');var attributes=require(_0x2029('0x4'));module[_0x2029('0x5')]=function(_0x308893,_0xe8b904){return _0x308893['define'](_0x2029('0x6'),attributes,{'tableName':_0x2029('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d0ae5a3..cd27e08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8d5=['../../config/environment','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xd1bf08,_0x20f633){var _0x373089=function(_0x57f4f6){while(--_0x57f4f6){_0xd1bf08['push'](_0xd1bf08['shift']());}};_0x373089(++_0x20f633);}(_0xf8d5,0x1ad));var _0x5f8d=function(_0x3ad78c,_0x33ecda){_0x3ad78c=_0x3ad78c-0x0;var _0x338718=_0xf8d5[_0x3ad78c];return _0x338718;};'use strict';var _=require(_0x5f8d('0x0'));var util=require('util');var moment=require(_0x5f8d('0x1'));var BPromise=require(_0x5f8d('0x2'));var rs=require(_0x5f8d('0x3'));var fs=require('fs');var db=require(_0x5f8d('0x4'))['db'];var utils=require(_0x5f8d('0x5'));var logger=require(_0x5f8d('0x6'))(_0x5f8d('0x7'));var config=require(_0x5f8d('0x8'));var jayson=require(_0x5f8d('0x9'));var client=jayson['client'][_0x5f8d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x479406,_0x55ef36,_0x3125a0){return new BPromise(function(_0x2c99f9,_0x585fb4){return client[_0x5f8d('0xb')](_0x479406,_0x3125a0)[_0x5f8d('0xc')](function(_0x1e631f){logger[_0x5f8d('0xd')](_0x5f8d('0xe'),_0x55ef36,_0x5f8d('0xf'));logger[_0x5f8d('0x10')](_0x5f8d('0x11'),_0x55ef36,_0x5f8d('0xf'),JSON[_0x5f8d('0x12')](_0x1e631f));if(_0x1e631f['error']){if(_0x1e631f[_0x5f8d('0x13')][_0x5f8d('0x14')]===0x1f4){logger['error'](_0x5f8d('0xe'),_0x55ef36,_0x1e631f[_0x5f8d('0x13')]['message']);return _0x585fb4(_0x1e631f['error']['message']);}logger[_0x5f8d('0x13')](_0x5f8d('0xe'),_0x55ef36,_0x1e631f[_0x5f8d('0x13')][_0x5f8d('0x15')]);return _0x2c99f9(_0x1e631f[_0x5f8d('0x13')]['message']);}else{logger[_0x5f8d('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x55ef36,'request\x20sent');_0x2c99f9(_0x1e631f[_0x5f8d('0x16')][_0x5f8d('0x15')]);}})['catch'](function(_0x38c8f4){logger[_0x5f8d('0x13')](_0x5f8d('0xe'),_0x55ef36,_0x38c8f4);_0x585fb4(_0x38c8f4);});});}
\ No newline at end of file
+var _0xcf52=['SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcf52,0x183));var _0x2cf5=function(_0x2fa208,_0xa86f91){_0x2fa208=_0x2fa208-0x0;var _0x1940fd=_0xcf52[_0x2fa208];return _0x1940fd;};'use strict';var _=require('lodash');var util=require(_0x2cf5('0x0'));var moment=require(_0x2cf5('0x1'));var BPromise=require(_0x2cf5('0x2'));var rs=require(_0x2cf5('0x3'));var fs=require('fs');var db=require(_0x2cf5('0x4'))['db'];var utils=require(_0x2cf5('0x5'));var logger=require('../../config/logger')(_0x2cf5('0x6'));var config=require(_0x2cf5('0x7'));var jayson=require(_0x2cf5('0x8'));var client=jayson['client'][_0x2cf5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40b4c2,_0x3dba48,_0x48983a){return new BPromise(function(_0x5e138a,_0x5dab5d){return client[_0x2cf5('0xa')](_0x40b4c2,_0x48983a)['then'](function(_0x18e491){logger[_0x2cf5('0xb')](_0x2cf5('0xc'),_0x3dba48,_0x2cf5('0xd'));logger[_0x2cf5('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x3dba48,_0x2cf5('0xd'),JSON[_0x2cf5('0xf')](_0x18e491));if(_0x18e491['error']){if(_0x18e491[_0x2cf5('0x10')][_0x2cf5('0x11')]===0x1f4){logger[_0x2cf5('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x3dba48,_0x18e491[_0x2cf5('0x10')]['message']);return _0x5dab5d(_0x18e491[_0x2cf5('0x10')][_0x2cf5('0x12')]);}logger[_0x2cf5('0x10')](_0x2cf5('0xc'),_0x3dba48,_0x18e491[_0x2cf5('0x10')][_0x2cf5('0x12')]);return _0x5e138a(_0x18e491['error']['message']);}else{logger[_0x2cf5('0xb')](_0x2cf5('0xc'),_0x3dba48,_0x2cf5('0xd'));_0x5e138a(_0x18e491[_0x2cf5('0x13')][_0x2cf5('0x12')]);}})[_0x2cf5('0x14')](function(_0x407270){logger[_0x2cf5('0x10')](_0x2cf5('0xc'),_0x3dba48,_0x407270);_0x5dab5d(_0x407270);});});}
\ No newline at end of file
index 8f8b48b..cbe3e28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a4a=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a4a,0x1ad));var _0xa0a4=function(_0x124609,_0x2f0025){_0x124609=_0x124609-0x0;var _0x6d1fd6=_0x0a4a[_0x124609];return _0x6d1fd6;};'use strict';var multer=require(_0xa0a4('0x0'));var util=require(_0xa0a4('0x1'));var path=require('path');var express=require(_0xa0a4('0x2'));var router=express[_0xa0a4('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xa0a4('0x4'));var config=require(_0xa0a4('0x5'));var controller=require(_0xa0a4('0x6'));router[_0xa0a4('0x7')]('/',auth[_0xa0a4('0x8')](),controller[_0xa0a4('0x9')]);router[_0xa0a4('0x7')]('/:id',auth[_0xa0a4('0x8')](),controller[_0xa0a4('0xa')]);router[_0xa0a4('0x7')](_0xa0a4('0xb'),auth[_0xa0a4('0x8')](),controller[_0xa0a4('0xc')]);router[_0xa0a4('0x7')](_0xa0a4('0xd'),auth[_0xa0a4('0x8')](),controller[_0xa0a4('0xe')]);router[_0xa0a4('0xf')]('/',auth[_0xa0a4('0x8')](),controller[_0xa0a4('0x10')]);router[_0xa0a4('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xa0a4('0x11')]);router[_0xa0a4('0x12')](_0xa0a4('0x13'),auth[_0xa0a4('0x8')](),controller[_0xa0a4('0x14')]);router['delete']('/:id',auth[_0xa0a4('0x8')](),controller['destroy']);module[_0xa0a4('0x15')]=router;
\ No newline at end of file
+var _0xf4e5=['isAuthenticated','/:id','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','./intVtigerAccount.controller','get'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xf4e5,0xd4));var _0x5f4e=function(_0x149a90,_0x20a953){_0x149a90=_0x149a90-0x0;var _0x3f5e44=_0xf4e5[_0x149a90];return _0x3f5e44;};'use strict';var multer=require(_0x5f4e('0x0'));var util=require(_0x5f4e('0x1'));var path=require(_0x5f4e('0x2'));var express=require(_0x5f4e('0x3'));var router=express[_0x5f4e('0x4')]();var auth=require(_0x5f4e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5f4e('0x6'));router[_0x5f4e('0x7')]('/',auth[_0x5f4e('0x8')](),controller['index']);router[_0x5f4e('0x7')](_0x5f4e('0x9'),auth[_0x5f4e('0x8')](),controller[_0x5f4e('0xa')]);router[_0x5f4e('0x7')](_0x5f4e('0xb'),auth[_0x5f4e('0x8')](),controller[_0x5f4e('0xc')]);router[_0x5f4e('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x5f4e('0xd')]);router[_0x5f4e('0xe')]('/',auth[_0x5f4e('0x8')](),controller['create']);router[_0x5f4e('0xe')](_0x5f4e('0xb'),auth[_0x5f4e('0x8')](),controller[_0x5f4e('0xf')]);router[_0x5f4e('0x10')](_0x5f4e('0x9'),auth[_0x5f4e('0x8')](),controller[_0x5f4e('0x11')]);router[_0x5f4e('0x12')](_0x5f4e('0x9'),auth[_0x5f4e('0x8')](),controller['destroy']);module[_0x5f4e('0x13')]=router;
\ No newline at end of file
index e41c108..77c3cf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf294=['exports','STRING','sequelize'];(function(_0x33c8b3,_0x27dc52){var _0x25089b=function(_0x392058){while(--_0x392058){_0x33c8b3['push'](_0x33c8b3['shift']());}};_0x25089b(++_0x27dc52);}(_0xf294,0xda));var _0x4f29=function(_0x2e2f84,_0x24e46f){_0x2e2f84=_0x2e2f84-0x0;var _0x448191=_0xf294[_0x2e2f84];return _0x448191;};'use strict';var Sequelize=require(_0x4f29('0x0'));module[_0x4f29('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x4f29('0x2')]},'username':{'type':Sequelize[_0x4f29('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x4f29('0x2')]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x77a9=['exports','STRING','sequelize'];(function(_0x2d9cc0,_0x5729ce){var _0x12d1d0=function(_0x651631){while(--_0x651631){_0x2d9cc0['push'](_0x2d9cc0['shift']());}};_0x12d1d0(++_0x5729ce);}(_0x77a9,0x110));var _0x977a=function(_0x1f951b,_0x654997){_0x1f951b=_0x1f951b-0x0;var _0x503af0=_0x77a9[_0x1f951b];return _0x503af0;};'use strict';var Sequelize=require(_0x977a('0x0'));module[_0x977a('0x1')]={'name':{'type':Sequelize[_0x977a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x977a('0x2')]},'username':{'type':Sequelize[_0x977a('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x977a('0x2')]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 5eb56be..edb53fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x056b=['options','VtigerAccount','includeAll','findAll','rows','catch','show','params','include','find','create','body','getConfigurations','findOne','VtigerConfiguration','filter','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','type','VtigerField','Descriptions','md5','getFields','description','moduleName','remoteUri','serverUrl','username','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','sessionName','autogenerated','reference','remove','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','count','offset','limit','set','json','reject','update','destroy','end','stack','name','index','rawAttributes','model','query','dateStart','dateEnd','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','add','day','merge','map'];(function(_0x4f3f71,_0x1e35ce){var _0x559c25=function(_0x1d874e){while(--_0x1d874e){_0x4f3f71['push'](_0x4f3f71['shift']());}};_0x559c25(++_0x1e35ce);}(_0x056b,0xb6));var _0xb056=function(_0x2ad0ca,_0x59624e){_0x2ad0ca=_0x2ad0ca-0x0;var _0x50ebb9=_0x056b[_0x2ad0ca];return _0x50ebb9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb056('0x0'));var rimraf=require(_0xb056('0x1'));var zipdir=require(_0xb056('0x2'));var jsonpatch=require(_0xb056('0x3'));var rp=require(_0xb056('0x4'));var moment=require(_0xb056('0x5'));var BPromise=require(_0xb056('0x6'));var Mustache=require(_0xb056('0x7'));var util=require(_0xb056('0x8'));var path=require(_0xb056('0x9'));var sox=require(_0xb056('0xa'));var csv=require('to-csv');var ejs=require(_0xb056('0xb'));var fs=require('fs');var _=require(_0xb056('0xc'));var squel=require(_0xb056('0xd'));var crypto=require(_0xb056('0xe'));var jsforce=require(_0xb056('0xf'));var deskjs=require(_0xb056('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb056('0x11'));var qs=require(_0xb056('0x12'));var logger=require(_0xb056('0x13'))(_0xb056('0x14'));var utils=require('../../config/utils');var config=require(_0xb056('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xb056('0x16'));var jayson=require(_0xb056('0x17'));var client=jayson[_0xb056('0x18')][_0xb056('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2cdb5f,_0x5d8306,_0x49c5ec,_0xf3e80f){return new BPromise(function(_0x33acb2,_0x51999c){var _0x81c9fc=_0xf3e80f||client;return _0x81c9fc[_0xb056('0x1a')](_0x2cdb5f,_0x49c5ec)[_0xb056('0x1b')](function(_0x1197e5){logger[_0xb056('0x1c')](_0xb056('0x1d'),_0x5d8306,_0xb056('0x1e'));logger['debug'](_0xb056('0x1f'),_0x5d8306,_0xb056('0x1e'),JSON[_0xb056('0x20')](_0x1197e5));if(_0x1197e5[_0xb056('0x21')]){if(_0x1197e5['error'][_0xb056('0x22')]===0x1f4){logger['error'](_0xb056('0x1d'),_0x5d8306,_0x1197e5[_0xb056('0x21')]['message']);return _0x51999c(_0x1197e5[_0xb056('0x21')]['message']);}logger[_0xb056('0x21')](_0xb056('0x1d'),_0x5d8306,_0x1197e5['error'][_0xb056('0x23')]);return _0x33acb2(_0x1197e5['error'][_0xb056('0x23')]);}else{logger[_0xb056('0x1c')](_0xb056('0x1d'),_0x5d8306,_0xb056('0x1e'));_0x33acb2(_0x1197e5['result'][_0xb056('0x23')]);}})['catch'](function(_0x1565d8){logger['error'](_0xb056('0x1d'),_0x5d8306,_0x1565d8);_0x51999c(_0x1565d8);});});}function respondWithStatusCode(_0x40ac2d,_0x1de11b){_0x1de11b=_0x1de11b||0xcc;return function(_0x3e0298){if(_0x3e0298){return _0x40ac2d[_0xb056('0x24')](_0x1de11b);}return _0x40ac2d[_0xb056('0x25')](_0x1de11b)['end']();};}function respondWithResult(_0x1016da,_0x18a3f2){_0x18a3f2=_0x18a3f2||0xc8;return function(_0x341544){if(_0x341544){return _0x1016da[_0xb056('0x25')](_0x18a3f2)['json'](_0x341544);}};}function respondWithFilteredResult(_0x44a14f,_0x10b9b3){return function(_0x5c39db){if(_0x5c39db){var _0x6d0483=_0x5c39db[_0xb056('0x26')],_0x265782=_0x10b9b3[_0xb056('0x27')],_0x2ae873=_0x10b9b3[_0xb056('0x27')]+_0x10b9b3[_0xb056('0x28')],_0x1d2c66;if(_0x2ae873>=_0x6d0483){_0x2ae873=_0x6d0483;_0x1d2c66=0xc8;}else{_0x1d2c66=0xce;}_0x44a14f['status'](_0x1d2c66);return _0x44a14f[_0xb056('0x29')]('Content-Range',_0x265782+'-'+_0x2ae873+'/'+_0x6d0483)[_0xb056('0x2a')](_0x5c39db);}return null;};}function patchUpdates(_0x9c6f4a){return function(_0x294874){try{jsonpatch['apply'](_0x294874,_0x9c6f4a,!![]);}catch(_0xd53267){return BPromise[_0xb056('0x2b')](_0xd53267);}return _0x294874['save']();};}function saveUpdates(_0x3a9e7d,_0x43aa63){return function(_0x329eaa){if(_0x329eaa){return _0x329eaa[_0xb056('0x2c')](_0x3a9e7d)[_0xb056('0x1b')](function(_0x4ebca5){return _0x4ebca5;});}return null;};}function removeEntity(_0x87f31e,_0x2de7ef){return function(_0x1f67ee){if(_0x1f67ee){return _0x1f67ee[_0xb056('0x2d')]()[_0xb056('0x1b')](function(){_0x87f31e['status'](0xcc)[_0xb056('0x2e')]();});}};}function handleEntityNotFound(_0x290807,_0x16c1d6){return function(_0x3afb2c){if(!_0x3afb2c){_0x290807[_0xb056('0x24')](0x194);}return _0x3afb2c;};}function handleError(_0x3b6b09,_0x19f277){_0x19f277=_0x19f277||0x1f4;return function(_0x4522ef){logger['error'](_0x4522ef[_0xb056('0x2f')]);if(_0x4522ef['name']){delete _0x4522ef[_0xb056('0x30')];}_0x3b6b09['status'](_0x19f277)['send'](_0x4522ef);};}exports[_0xb056('0x31')]=function(_0x3ba313,_0x13f9dc){var _0x1b7934={},_0x2c5a2c={},_0x293f5c={'count':0x0,'rows':[]};var _0x32b332=db['VtigerAccount'][_0xb056('0x32')];_0x2c5a2c[_0xb056('0x33')]=_['keys'](_0x32b332);var _0x50d9c6={'dateStart':_0x3ba313[_0xb056('0x34')][_0xb056('0x35')],'dateEnd':_0x3ba313[_0xb056('0x34')]['dateEnd']};delete _0x3ba313[_0xb056('0x34')][_0xb056('0x35')];delete _0x3ba313[_0xb056('0x34')][_0xb056('0x36')];_0x2c5a2c[_0xb056('0x34')]=_[_0xb056('0x37')](_0x3ba313[_0xb056('0x34')]);_0x2c5a2c[_0xb056('0x38')]=_[_0xb056('0x39')](_0x2c5a2c[_0xb056('0x33')],_0x2c5a2c[_0xb056('0x34')]);_0x1b7934[_0xb056('0x3a')]=_['intersection'](_0x2c5a2c[_0xb056('0x33')],qs['fields'](_0x3ba313[_0xb056('0x34')][_0xb056('0x3b')]));_0x1b7934[_0xb056('0x3a')]=_0x1b7934[_0xb056('0x3a')][_0xb056('0x3c')]?_0x1b7934[_0xb056('0x3a')]:_0x2c5a2c[_0xb056('0x33')];if(!_0x3ba313[_0xb056('0x34')]['hasOwnProperty'](_0xb056('0x3d'))){_0x1b7934[_0xb056('0x28')]=qs[_0xb056('0x28')](_0x3ba313[_0xb056('0x34')][_0xb056('0x28')]);_0x1b7934['offset']=qs[_0xb056('0x27')](_0x3ba313[_0xb056('0x34')][_0xb056('0x27')]);}_0x1b7934[_0xb056('0x3e')]=qs[_0xb056('0x3f')](_0x3ba313[_0xb056('0x34')]['sort']);_0x1b7934[_0xb056('0x40')]=qs['filters'](_[_0xb056('0x41')](_0x3ba313[_0xb056('0x34')],_0x2c5a2c[_0xb056('0x38')]));if(_0x50d9c6[_0xb056('0x35')]){if(_0x50d9c6[_0xb056('0x36')]){_0x50d9c6[_0xb056('0x36')]=moment(_0x50d9c6[_0xb056('0x36')])[_0xb056('0x42')](0x1,_0xb056('0x43'));}else{_0x50d9c6[_0xb056('0x36')]=moment(_0x50d9c6['dateStart'])[_0xb056('0x42')](0x1,_0xb056('0x43'));}_[_0xb056('0x44')](_0x1b7934['where'],{'createdAt':{'$gte':_0x50d9c6[_0xb056('0x35')],'$lte':_0x50d9c6[_0xb056('0x36')]}});}if(_0x3ba313['query']['filter']){_0x1b7934[_0xb056('0x40')]=_[_0xb056('0x44')](_0x1b7934[_0xb056('0x40')],{'$or':_[_0xb056('0x45')](_0x1b7934['attributes'],function(_0x4a1c68){var _0x4889b6={};_0x4889b6[_0x4a1c68]={'$like':'%'+_0x3ba313['query']['filter']+'%'};return _0x4889b6;})});}_0x1b7934=_['merge']({},_0x1b7934,_0x3ba313[_0xb056('0x46')]);var _0x5f07ef={'where':_0x1b7934[_0xb056('0x40')]};return db[_0xb056('0x47')][_0xb056('0x26')](_0x5f07ef)[_0xb056('0x1b')](function(_0x24a71b){_0x293f5c[_0xb056('0x26')]=_0x24a71b;if(_0x3ba313[_0xb056('0x34')][_0xb056('0x48')]){_0x1b7934['include']=[{'all':!![]}];}return db[_0xb056('0x47')][_0xb056('0x49')](_0x1b7934);})['then'](function(_0x354af1){_0x293f5c[_0xb056('0x4a')]=_0x354af1;return _0x293f5c;})[_0xb056('0x1b')](respondWithFilteredResult(_0x13f9dc,_0x1b7934))[_0xb056('0x4b')](handleError(_0x13f9dc,null));};exports[_0xb056('0x4c')]=function(_0x1356d4,_0x5ba227){var _0x119c5c={'raw':![],'where':{'id':_0x1356d4[_0xb056('0x4d')]['id']}},_0x5e2224={};_0x5e2224[_0xb056('0x33')]=_[_0xb056('0x37')](db[_0xb056('0x47')][_0xb056('0x32')]);_0x5e2224[_0xb056('0x34')]=_[_0xb056('0x37')](_0x1356d4[_0xb056('0x34')]);_0x5e2224['filters']=_[_0xb056('0x39')](_0x5e2224[_0xb056('0x33')],_0x5e2224[_0xb056('0x34')]);_0x119c5c[_0xb056('0x3a')]=_[_0xb056('0x39')](_0x5e2224[_0xb056('0x33')],qs[_0xb056('0x3b')](_0x1356d4[_0xb056('0x34')]['fields']));_0x119c5c[_0xb056('0x3a')]=_0x119c5c[_0xb056('0x3a')][_0xb056('0x3c')]?_0x119c5c[_0xb056('0x3a')]:_0x5e2224[_0xb056('0x33')];if(_0x1356d4[_0xb056('0x34')]['includeAll']){_0x119c5c[_0xb056('0x4e')]=[{'all':!![]}];}_0x119c5c=_[_0xb056('0x44')]({},_0x119c5c,_0x1356d4[_0xb056('0x46')]);return db['VtigerAccount'][_0xb056('0x4f')](_0x119c5c)['then'](handleEntityNotFound(_0x5ba227,null))[_0xb056('0x1b')](respondWithResult(_0x5ba227,null))[_0xb056('0x4b')](handleError(_0x5ba227,null));};exports[_0xb056('0x50')]=function(_0x3a1386,_0x58c533){return db[_0xb056('0x47')][_0xb056('0x50')](_0x3a1386['body'],{})[_0xb056('0x1b')](respondWithResult(_0x58c533,0xc9))[_0xb056('0x4b')](handleError(_0x58c533,null));};exports[_0xb056('0x2c')]=function(_0x1546e5,_0x357ba5){if(_0x1546e5['body']['id']){delete _0x1546e5[_0xb056('0x51')]['id'];}return db[_0xb056('0x47')][_0xb056('0x4f')]({'where':{'id':_0x1546e5[_0xb056('0x4d')]['id']}})[_0xb056('0x1b')](handleEntityNotFound(_0x357ba5,null))[_0xb056('0x1b')](saveUpdates(_0x1546e5[_0xb056('0x51')],null))[_0xb056('0x1b')](respondWithResult(_0x357ba5,null))[_0xb056('0x4b')](handleError(_0x357ba5,null));};exports[_0xb056('0x2d')]=function(_0x1b4a0d,_0x1aac7c){return db[_0xb056('0x47')][_0xb056('0x4f')]({'where':{'id':_0x1b4a0d[_0xb056('0x4d')]['id']}})[_0xb056('0x1b')](handleEntityNotFound(_0x1aac7c,null))[_0xb056('0x1b')](removeEntity(_0x1aac7c,null))[_0xb056('0x4b')](handleError(_0x1aac7c,null));};exports[_0xb056('0x52')]=function(_0x1f466e,_0x3a617d,_0x5e96c5){var _0x249d51={};var _0x39b34d={};var _0x41ae10;var _0x1ffa10;return db[_0xb056('0x47')][_0xb056('0x53')]({'where':{'id':_0x1f466e[_0xb056('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3a617d,null))['then'](function(_0x30441e){if(_0x30441e){_0x41ae10=_0x30441e;_0x39b34d[_0xb056('0x33')]=_[_0xb056('0x37')](db[_0xb056('0x54')][_0xb056('0x32')]);_0x39b34d['query']=_[_0xb056('0x37')](_0x1f466e[_0xb056('0x34')]);_0x39b34d[_0xb056('0x38')]=_[_0xb056('0x39')](_0x39b34d['model'],_0x39b34d[_0xb056('0x34')]);_0x249d51[_0xb056('0x3a')]=_[_0xb056('0x39')](_0x39b34d['model'],qs[_0xb056('0x3b')](_0x1f466e[_0xb056('0x34')][_0xb056('0x3b')]));_0x249d51['attributes']=_0x249d51[_0xb056('0x3a')][_0xb056('0x3c')]?_0x249d51[_0xb056('0x3a')]:_0x39b34d['model'];_0x249d51[_0xb056('0x3e')]=qs['sort'](_0x1f466e[_0xb056('0x34')][_0xb056('0x3f')]);_0x249d51[_0xb056('0x40')]=qs['filters'](_[_0xb056('0x41')](_0x1f466e[_0xb056('0x34')],_0x39b34d['filters']));if(_0x1f466e[_0xb056('0x34')][_0xb056('0x55')]){_0x249d51[_0xb056('0x40')]=_[_0xb056('0x44')](_0x249d51[_0xb056('0x40')],{'$or':_['map'](_0x249d51['attributes'],function(_0xca55f9){var _0x5cff6c={};_0x5cff6c[_0xca55f9]={'$like':'%'+_0x1f466e[_0xb056('0x34')]['filter']+'%'};return _0x5cff6c;})});}_0x249d51=_[_0xb056('0x44')]({},_0x249d51,_0x1f466e[_0xb056('0x46')]);return _0x41ae10[_0xb056('0x52')](_0x249d51);}})[_0xb056('0x1b')](function(_0x4b4a67){if(_0x4b4a67){_0x1ffa10=_0x4b4a67['length'];if(!_0x1f466e[_0xb056('0x34')][_0xb056('0x56')](_0xb056('0x3d'))){_0x249d51[_0xb056('0x28')]=qs['limit'](_0x1f466e[_0xb056('0x34')]['limit']);_0x249d51[_0xb056('0x27')]=qs['offset'](_0x1f466e[_0xb056('0x34')]['offset']);}return _0x41ae10[_0xb056('0x52')](_0x249d51);}})[_0xb056('0x1b')](function(_0x2bff6b){if(_0x2bff6b){return _0x2bff6b?{'count':_0x1ffa10,'rows':_0x2bff6b}:null;}})[_0xb056('0x1b')](respondWithResult(_0x3a617d,null))['catch'](handleError(_0x3a617d,null));};exports[_0xb056('0x57')]=function(_0x479332,_0x227ab0,_0x1f084a){if(_0x479332[_0xb056('0x51')]['id']){delete _0x479332[_0xb056('0x51')]['id'];}return db[_0xb056('0x47')][_0xb056('0x53')]({'where':{'id':_0x479332[_0xb056('0x4d')]['id']}})[_0xb056('0x1b')](handleEntityNotFound(_0x227ab0,null))[_0xb056('0x1b')](function(_0x2fb22f){if(_0x2fb22f){_0x479332[_0xb056('0x51')][_0xb056('0x58')]=_0x2fb22f['id'];_0x479332['body']['Subjects']=integrations[_0xb056('0x59')](_0x479332['body'][_0xb056('0x5a')],_0x479332['body'][_0xb056('0x5b')]);_0x479332['body']['Descriptions']=integrations['getDescriptions'](_0x479332[_0xb056('0x51')]['channel'],_0x479332['body'][_0xb056('0x5b')]);return db[_0xb056('0x54')][_0xb056('0x50')](_0x479332['body'],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0xb056('0x5c')],'as':_0xb056('0x5d')}]});}return null;})[_0xb056('0x1b')](respondWithResult(_0x227ab0,null))[_0xb056('0x4b')](handleError(_0x227ab0,null));};var md5=require(_0xb056('0x5e'));exports[_0xb056('0x5f')]=function(_0x627a5e,_0x377cd6,_0x2dec80){var _0xd88228=null;var _0x365049=null;var _0x366cba=null;var _0x216920=null;return db[_0xb056('0x47')]['findOne']({'where':{'id':_0x627a5e['params']['id']},'attributes':['id',_0xb056('0x30'),'username',_0xb056('0x60'),_0xb056('0x61'),_0xb056('0x62'),_0xb056('0x63'),'accessKey']})['then'](handleEntityNotFound(_0x377cd6,null))[_0xb056('0x1b')](function(_0x13a0f1){if(_0x13a0f1){_0xd88228=_0x13a0f1[_0xb056('0x64')];_0x365049=_0x13a0f1['accessKey'];_0x366cba=_0x13a0f1['moduleName'];_0x216920=util[_0xb056('0x65')](_0xb056('0x66'),_0x13a0f1['remoteUri']);var _0x345cf9={'method':_0xb056('0x67'),'uri':_0x216920,'qs':{'operation':_0xb056('0x68'),'username':_0x13a0f1[_0xb056('0x64')]},'json':!![]};return rp(_0x345cf9);}})[_0xb056('0x1b')](function(_0x315b19){if(_0x315b19[_0xb056('0x69')]){var _0x27b31f={'method':_0xb056('0x6a'),'uri':_0x216920,'form':{'operation':_0xb056('0x6b'),'username':_0xd88228,'accessKey':md5(_0x315b19[_0xb056('0x6c')]['token']+_0x365049)},'json':!![]};return rp(_0x27b31f);}})[_0xb056('0x1b')](function(_0x2d0d1e){if(_0x2d0d1e[_0xb056('0x69')]){var _0x4dda81={'method':_0xb056('0x67'),'uri':_0x216920,'qs':{'operation':'describe','username':_0xd88228,'sessionName':_0x2d0d1e['result'][_0xb056('0x6d')],'elementType':_0x366cba},'json':!![]};return rp(_0x4dda81);}})[_0xb056('0x1b')](function(_0x2d7c96){if(_0x2d7c96['success']){var _0x493d0d=[_0xb056('0x6e'),_0xb056('0x6f'),'owner'];_[_0xb056('0x70')](_0x2d7c96['result'][_0xb056('0x3b')],function(_0x3c25ac){return _0x493d0d['includes'](_0x3c25ac['type'][_0xb056('0x30')]);});_[_0xb056('0x70')](_0x2d7c96['result'][_0xb056('0x3b')],function(_0x4fb4ec){return _0x4fb4ec['editable']===_0xb056('0x71');});return{'count':_0x2d7c96[_0xb056('0x6c')][_0xb056('0x3b')][_0xb056('0x3c')],'rows':_[_0xb056('0x45')](_0x2d7c96[_0xb056('0x6c')]['fields'],function(_0x444342){return{'id':_0x444342['name'],'name':_0x444342[_0xb056('0x72')],'custom':_[_0xb056('0x73')](_0x444342['name'],_0xb056('0x74'))?!![]:![],'options':_0x444342[_0xb056('0x5b')]['name']===_0xb056('0x75')&&_0x444342['type'][_0xb056('0x76')]['length']>0x0?_[_0xb056('0x45')](_0x444342[_0xb056('0x5b')]['picklistValues'],function(_0x2c48a2){return{'name':_0x2c48a2['label'],'value':_0x2c48a2[_0xb056('0x77')]};}):[]};})};}})[_0xb056('0x1b')](respondWithResult(_0x377cd6,null))[_0xb056('0x4b')](function(_0xf53df4){console[_0xb056('0x78')](_0xb056('0x79')+_0xf53df4);var _0x1bac84=_0x627a5e[_0xb056('0x34')]['test']?0x1f4:_0xf53df4[_0xb056('0x7a')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x1bac84,JSON[_0xb056('0x20')](_0xf53df4));delete _0xf53df4[_0xb056('0x30')];if(_0x1bac84===0x191){_0x1bac84=0x190;}_0x377cd6[_0xb056('0x25')](_0x1bac84)[_0xb056('0x7b')](_0x627a5e['query'][_0xb056('0x7c')]?{'message':_0xb056('0x7d'),'statusCode':_0xf53df4[_0xb056('0x7a')]}:_0xf53df4);});};
\ No newline at end of file
+var _0xd4a2=['querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','stack','name','send','index','VtigerAccount','rawAttributes','model','keys','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day','filter','merge','map','includeAll','include','findAll','rows','show','params','options','create','body','update','destroy','find','findOne','VtigerConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','type','VtigerField','Descriptions','md5','getFields','description','moduleName','remoteUri','serverUrl','accessKey','username','format','%s/webservice.php','GET','getchallenge','login','token','success','describe','sessionName','reference','owner','remove','includes','editable','false','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js'];(function(_0x1c2767,_0x255a3f){var _0x3c57e0=function(_0xf68225){while(--_0xf68225){_0x1c2767['push'](_0x1c2767['shift']());}};_0x3c57e0(++_0x255a3f);}(_0xd4a2,0x173));var _0x2d4a=function(_0x475ae8,_0x5d5068){_0x475ae8=_0x475ae8-0x0;var _0x37d411=_0xd4a2[_0x475ae8];return _0x37d411;};'use strict';var pdf=require(_0x2d4a('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2d4a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2d4a('0x2'));var moment=require('moment');var BPromise=require(_0x2d4a('0x3'));var Mustache=require('mustache');var util=require(_0x2d4a('0x4'));var path=require(_0x2d4a('0x5'));var sox=require(_0x2d4a('0x6'));var csv=require(_0x2d4a('0x7'));var ejs=require(_0x2d4a('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2d4a('0x9'));var crypto=require(_0x2d4a('0xa'));var jsforce=require(_0x2d4a('0xb'));var deskjs=require(_0x2d4a('0xc'));var toCsv=require(_0x2d4a('0x7'));var querystring=require(_0x2d4a('0xd'));var Papa=require(_0x2d4a('0xe'));var qs=require(_0x2d4a('0xf'));var logger=require(_0x2d4a('0x10'))(_0x2d4a('0x11'));var utils=require(_0x2d4a('0x12'));var config=require(_0x2d4a('0x13'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x2d4a('0x14'));var client=jayson['client'][_0x2d4a('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x42cb63,_0x45b9fb,_0x5ac803,_0x2f785f){return new BPromise(function(_0x3341e3,_0xe5c62c){var _0x2c4569=_0x2f785f||client;return _0x2c4569['request'](_0x42cb63,_0x5ac803)['then'](function(_0x2a1d0f){logger['info'](_0x2d4a('0x16'),_0x45b9fb,_0x2d4a('0x17'));logger[_0x2d4a('0x18')](_0x2d4a('0x19'),_0x45b9fb,'request\x20sent',JSON[_0x2d4a('0x1a')](_0x2a1d0f));if(_0x2a1d0f['error']){if(_0x2a1d0f[_0x2d4a('0x1b')]['code']===0x1f4){logger[_0x2d4a('0x1b')](_0x2d4a('0x16'),_0x45b9fb,_0x2a1d0f[_0x2d4a('0x1b')][_0x2d4a('0x1c')]);return _0xe5c62c(_0x2a1d0f['error']['message']);}logger['error'](_0x2d4a('0x16'),_0x45b9fb,_0x2a1d0f[_0x2d4a('0x1b')][_0x2d4a('0x1c')]);return _0x3341e3(_0x2a1d0f[_0x2d4a('0x1b')][_0x2d4a('0x1c')]);}else{logger[_0x2d4a('0x1d')]('VtigerAccount,\x20%s,\x20%s',_0x45b9fb,'request\x20sent');_0x3341e3(_0x2a1d0f[_0x2d4a('0x1e')][_0x2d4a('0x1c')]);}})[_0x2d4a('0x1f')](function(_0x17d72e){logger[_0x2d4a('0x1b')](_0x2d4a('0x16'),_0x45b9fb,_0x17d72e);_0xe5c62c(_0x17d72e);});});}function respondWithStatusCode(_0x22dd0b,_0xa43fb1){_0xa43fb1=_0xa43fb1||0xcc;return function(_0x5d5daa){if(_0x5d5daa){return _0x22dd0b[_0x2d4a('0x20')](_0xa43fb1);}return _0x22dd0b[_0x2d4a('0x21')](_0xa43fb1)[_0x2d4a('0x22')]();};}function respondWithResult(_0x42d813,_0x2c845c){_0x2c845c=_0x2c845c||0xc8;return function(_0xed2822){if(_0xed2822){return _0x42d813[_0x2d4a('0x21')](_0x2c845c)[_0x2d4a('0x23')](_0xed2822);}};}function respondWithFilteredResult(_0x54c910,_0x544b9b){return function(_0x5cc7d8){if(_0x5cc7d8){var _0x2bb9f0=_0x5cc7d8[_0x2d4a('0x24')],_0x5029f3=_0x544b9b[_0x2d4a('0x25')],_0x410f7d=_0x544b9b[_0x2d4a('0x25')]+_0x544b9b[_0x2d4a('0x26')],_0x3a2fd3;if(_0x410f7d>=_0x2bb9f0){_0x410f7d=_0x2bb9f0;_0x3a2fd3=0xc8;}else{_0x3a2fd3=0xce;}_0x54c910[_0x2d4a('0x21')](_0x3a2fd3);return _0x54c910[_0x2d4a('0x27')]('Content-Range',_0x5029f3+'-'+_0x410f7d+'/'+_0x2bb9f0)[_0x2d4a('0x23')](_0x5cc7d8);}return null;};}function patchUpdates(_0x5ce262){return function(_0x221602){try{jsonpatch[_0x2d4a('0x28')](_0x221602,_0x5ce262,!![]);}catch(_0xc497ce){return BPromise[_0x2d4a('0x29')](_0xc497ce);}return _0x221602[_0x2d4a('0x2a')]();};}function saveUpdates(_0x1dfc5d,_0x25ac5c){return function(_0x2e8063){if(_0x2e8063){return _0x2e8063['update'](_0x1dfc5d)[_0x2d4a('0x2b')](function(_0x3d94b7){return _0x3d94b7;});}return null;};}function removeEntity(_0xda1ef2,_0x286150){return function(_0x2b66af){if(_0x2b66af){return _0x2b66af['destroy']()[_0x2d4a('0x2b')](function(){_0xda1ef2[_0x2d4a('0x21')](0xcc)[_0x2d4a('0x22')]();});}};}function handleEntityNotFound(_0x24bcc2,_0x2bb93d){return function(_0x555317){if(!_0x555317){_0x24bcc2[_0x2d4a('0x20')](0x194);}return _0x555317;};}function handleError(_0x2ae694,_0x46b623){_0x46b623=_0x46b623||0x1f4;return function(_0x76e966){logger[_0x2d4a('0x1b')](_0x76e966[_0x2d4a('0x2c')]);if(_0x76e966['name']){delete _0x76e966[_0x2d4a('0x2d')];}_0x2ae694[_0x2d4a('0x21')](_0x46b623)[_0x2d4a('0x2e')](_0x76e966);};}exports[_0x2d4a('0x2f')]=function(_0x3486c9,_0x4b20e4){var _0x1a421c={},_0x2c0a76={},_0x54d652={'count':0x0,'rows':[]};var _0x2b3093=db[_0x2d4a('0x30')][_0x2d4a('0x31')];_0x2c0a76[_0x2d4a('0x32')]=_[_0x2d4a('0x33')](_0x2b3093);var _0x318ff0={'dateStart':_0x3486c9['query'][_0x2d4a('0x34')],'dateEnd':_0x3486c9[_0x2d4a('0x35')][_0x2d4a('0x36')]};delete _0x3486c9[_0x2d4a('0x35')][_0x2d4a('0x34')];delete _0x3486c9[_0x2d4a('0x35')]['dateEnd'];_0x2c0a76['query']=_[_0x2d4a('0x33')](_0x3486c9['query']);_0x2c0a76[_0x2d4a('0x37')]=_[_0x2d4a('0x38')](_0x2c0a76['model'],_0x2c0a76[_0x2d4a('0x35')]);_0x1a421c[_0x2d4a('0x39')]=_[_0x2d4a('0x38')](_0x2c0a76[_0x2d4a('0x32')],qs[_0x2d4a('0x3a')](_0x3486c9[_0x2d4a('0x35')][_0x2d4a('0x3a')]));_0x1a421c[_0x2d4a('0x39')]=_0x1a421c[_0x2d4a('0x39')][_0x2d4a('0x3b')]?_0x1a421c[_0x2d4a('0x39')]:_0x2c0a76['model'];if(!_0x3486c9[_0x2d4a('0x35')][_0x2d4a('0x3c')](_0x2d4a('0x3d'))){_0x1a421c[_0x2d4a('0x26')]=qs[_0x2d4a('0x26')](_0x3486c9['query']['limit']);_0x1a421c['offset']=qs['offset'](_0x3486c9[_0x2d4a('0x35')][_0x2d4a('0x25')]);}_0x1a421c[_0x2d4a('0x3e')]=qs[_0x2d4a('0x3f')](_0x3486c9['query'][_0x2d4a('0x3f')]);_0x1a421c[_0x2d4a('0x40')]=qs['filters'](_[_0x2d4a('0x41')](_0x3486c9[_0x2d4a('0x35')],_0x2c0a76[_0x2d4a('0x37')]));if(_0x318ff0[_0x2d4a('0x34')]){if(_0x318ff0[_0x2d4a('0x36')]){_0x318ff0[_0x2d4a('0x36')]=moment(_0x318ff0['dateEnd'])[_0x2d4a('0x42')](0x1,_0x2d4a('0x43'));}else{_0x318ff0[_0x2d4a('0x36')]=moment(_0x318ff0[_0x2d4a('0x34')])[_0x2d4a('0x42')](0x1,_0x2d4a('0x43'));}_['merge'](_0x1a421c[_0x2d4a('0x40')],{'createdAt':{'$gte':_0x318ff0[_0x2d4a('0x34')],'$lte':_0x318ff0[_0x2d4a('0x36')]}});}if(_0x3486c9['query'][_0x2d4a('0x44')]){_0x1a421c['where']=_[_0x2d4a('0x45')](_0x1a421c[_0x2d4a('0x40')],{'$or':_[_0x2d4a('0x46')](_0x1a421c[_0x2d4a('0x39')],function(_0x2bd86){var _0x5001cc={};_0x5001cc[_0x2bd86]={'$like':'%'+_0x3486c9['query'][_0x2d4a('0x44')]+'%'};return _0x5001cc;})});}_0x1a421c=_[_0x2d4a('0x45')]({},_0x1a421c,_0x3486c9['options']);var _0x3b4b38={'where':_0x1a421c['where']};return db[_0x2d4a('0x30')][_0x2d4a('0x24')](_0x3b4b38)[_0x2d4a('0x2b')](function(_0x591de3){_0x54d652[_0x2d4a('0x24')]=_0x591de3;if(_0x3486c9['query'][_0x2d4a('0x47')]){_0x1a421c[_0x2d4a('0x48')]=[{'all':!![]}];}return db[_0x2d4a('0x30')][_0x2d4a('0x49')](_0x1a421c);})[_0x2d4a('0x2b')](function(_0x4210d9){_0x54d652[_0x2d4a('0x4a')]=_0x4210d9;return _0x54d652;})[_0x2d4a('0x2b')](respondWithFilteredResult(_0x4b20e4,_0x1a421c))[_0x2d4a('0x1f')](handleError(_0x4b20e4,null));};exports[_0x2d4a('0x4b')]=function(_0x299065,_0x5e2f07){var _0x225a9c={'raw':![],'where':{'id':_0x299065[_0x2d4a('0x4c')]['id']}},_0x26a070={};_0x26a070[_0x2d4a('0x32')]=_[_0x2d4a('0x33')](db['VtigerAccount'][_0x2d4a('0x31')]);_0x26a070[_0x2d4a('0x35')]=_[_0x2d4a('0x33')](_0x299065[_0x2d4a('0x35')]);_0x26a070[_0x2d4a('0x37')]=_['intersection'](_0x26a070['model'],_0x26a070[_0x2d4a('0x35')]);_0x225a9c[_0x2d4a('0x39')]=_['intersection'](_0x26a070[_0x2d4a('0x32')],qs[_0x2d4a('0x3a')](_0x299065[_0x2d4a('0x35')][_0x2d4a('0x3a')]));_0x225a9c['attributes']=_0x225a9c[_0x2d4a('0x39')]['length']?_0x225a9c[_0x2d4a('0x39')]:_0x26a070[_0x2d4a('0x32')];if(_0x299065[_0x2d4a('0x35')][_0x2d4a('0x47')]){_0x225a9c[_0x2d4a('0x48')]=[{'all':!![]}];}_0x225a9c=_[_0x2d4a('0x45')]({},_0x225a9c,_0x299065[_0x2d4a('0x4d')]);return db[_0x2d4a('0x30')]['find'](_0x225a9c)[_0x2d4a('0x2b')](handleEntityNotFound(_0x5e2f07,null))[_0x2d4a('0x2b')](respondWithResult(_0x5e2f07,null))[_0x2d4a('0x1f')](handleError(_0x5e2f07,null));};exports[_0x2d4a('0x4e')]=function(_0x3e3925,_0x334d6a){return db[_0x2d4a('0x30')][_0x2d4a('0x4e')](_0x3e3925[_0x2d4a('0x4f')],{})[_0x2d4a('0x2b')](respondWithResult(_0x334d6a,0xc9))[_0x2d4a('0x1f')](handleError(_0x334d6a,null));};exports[_0x2d4a('0x50')]=function(_0x1b4ae7,_0xf3df0f){if(_0x1b4ae7[_0x2d4a('0x4f')]['id']){delete _0x1b4ae7[_0x2d4a('0x4f')]['id'];}return db[_0x2d4a('0x30')]['find']({'where':{'id':_0x1b4ae7[_0x2d4a('0x4c')]['id']}})[_0x2d4a('0x2b')](handleEntityNotFound(_0xf3df0f,null))['then'](saveUpdates(_0x1b4ae7[_0x2d4a('0x4f')],null))[_0x2d4a('0x2b')](respondWithResult(_0xf3df0f,null))[_0x2d4a('0x1f')](handleError(_0xf3df0f,null));};exports[_0x2d4a('0x51')]=function(_0x165c00,_0x206c30){return db[_0x2d4a('0x30')][_0x2d4a('0x52')]({'where':{'id':_0x165c00[_0x2d4a('0x4c')]['id']}})[_0x2d4a('0x2b')](handleEntityNotFound(_0x206c30,null))[_0x2d4a('0x2b')](removeEntity(_0x206c30,null))[_0x2d4a('0x1f')](handleError(_0x206c30,null));};exports['getConfigurations']=function(_0x1e6661,_0x448307,_0x48c1f9){var _0xb5042d={};var _0x3f42eb={};var _0x1930c6;var _0xb4f74c;return db[_0x2d4a('0x30')][_0x2d4a('0x53')]({'where':{'id':_0x1e6661[_0x2d4a('0x4c')]['id']}})[_0x2d4a('0x2b')](handleEntityNotFound(_0x448307,null))[_0x2d4a('0x2b')](function(_0x282df8){if(_0x282df8){_0x1930c6=_0x282df8;_0x3f42eb['model']=_[_0x2d4a('0x33')](db[_0x2d4a('0x54')][_0x2d4a('0x31')]);_0x3f42eb['query']=_[_0x2d4a('0x33')](_0x1e6661[_0x2d4a('0x35')]);_0x3f42eb[_0x2d4a('0x37')]=_[_0x2d4a('0x38')](_0x3f42eb[_0x2d4a('0x32')],_0x3f42eb[_0x2d4a('0x35')]);_0xb5042d[_0x2d4a('0x39')]=_[_0x2d4a('0x38')](_0x3f42eb[_0x2d4a('0x32')],qs['fields'](_0x1e6661[_0x2d4a('0x35')][_0x2d4a('0x3a')]));_0xb5042d[_0x2d4a('0x39')]=_0xb5042d[_0x2d4a('0x39')][_0x2d4a('0x3b')]?_0xb5042d[_0x2d4a('0x39')]:_0x3f42eb['model'];_0xb5042d[_0x2d4a('0x3e')]=qs[_0x2d4a('0x3f')](_0x1e6661[_0x2d4a('0x35')]['sort']);_0xb5042d[_0x2d4a('0x40')]=qs[_0x2d4a('0x37')](_['pick'](_0x1e6661[_0x2d4a('0x35')],_0x3f42eb[_0x2d4a('0x37')]));if(_0x1e6661['query'][_0x2d4a('0x44')]){_0xb5042d['where']=_['merge'](_0xb5042d[_0x2d4a('0x40')],{'$or':_[_0x2d4a('0x46')](_0xb5042d[_0x2d4a('0x39')],function(_0xe78826){var _0x4b9a3d={};_0x4b9a3d[_0xe78826]={'$like':'%'+_0x1e6661[_0x2d4a('0x35')][_0x2d4a('0x44')]+'%'};return _0x4b9a3d;})});}_0xb5042d=_[_0x2d4a('0x45')]({},_0xb5042d,_0x1e6661[_0x2d4a('0x4d')]);return _0x1930c6['getConfigurations'](_0xb5042d);}})['then'](function(_0x34f1d0){if(_0x34f1d0){_0xb4f74c=_0x34f1d0[_0x2d4a('0x3b')];if(!_0x1e6661[_0x2d4a('0x35')][_0x2d4a('0x3c')](_0x2d4a('0x3d'))){_0xb5042d[_0x2d4a('0x26')]=qs[_0x2d4a('0x26')](_0x1e6661['query'][_0x2d4a('0x26')]);_0xb5042d[_0x2d4a('0x25')]=qs[_0x2d4a('0x25')](_0x1e6661[_0x2d4a('0x35')]['offset']);}return _0x1930c6[_0x2d4a('0x55')](_0xb5042d);}})[_0x2d4a('0x2b')](function(_0x32a048){if(_0x32a048){return _0x32a048?{'count':_0xb4f74c,'rows':_0x32a048}:null;}})[_0x2d4a('0x2b')](respondWithResult(_0x448307,null))['catch'](handleError(_0x448307,null));};exports[_0x2d4a('0x56')]=function(_0x118a3b,_0x55d565,_0x13fc38){if(_0x118a3b[_0x2d4a('0x4f')]['id']){delete _0x118a3b[_0x2d4a('0x4f')]['id'];}return db['VtigerAccount'][_0x2d4a('0x53')]({'where':{'id':_0x118a3b[_0x2d4a('0x4c')]['id']}})[_0x2d4a('0x2b')](handleEntityNotFound(_0x55d565,null))[_0x2d4a('0x2b')](function(_0x251d40){if(_0x251d40){_0x118a3b[_0x2d4a('0x4f')][_0x2d4a('0x57')]=_0x251d40['id'];_0x118a3b['body'][_0x2d4a('0x58')]=integrations[_0x2d4a('0x59')](_0x118a3b[_0x2d4a('0x4f')][_0x2d4a('0x5a')],_0x118a3b[_0x2d4a('0x4f')]['type']);_0x118a3b[_0x2d4a('0x4f')]['Descriptions']=integrations[_0x2d4a('0x5b')](_0x118a3b[_0x2d4a('0x4f')][_0x2d4a('0x5a')],_0x118a3b[_0x2d4a('0x4f')][_0x2d4a('0x5c')]);return db[_0x2d4a('0x54')][_0x2d4a('0x4e')](_0x118a3b[_0x2d4a('0x4f')],{'include':[{'model':db[_0x2d4a('0x5d')],'as':_0x2d4a('0x58')},{'model':db['VtigerField'],'as':_0x2d4a('0x5e')}]});}return null;})['then'](respondWithResult(_0x55d565,null))[_0x2d4a('0x1f')](handleError(_0x55d565,null));};var md5=require(_0x2d4a('0x5f'));exports[_0x2d4a('0x60')]=function(_0x45153d,_0x21517f,_0x43a2b3){var _0x30b58b=null;var _0xefcbf6=null;var _0x21633a=null;var _0x51b96b=null;return db[_0x2d4a('0x30')][_0x2d4a('0x53')]({'where':{'id':_0x45153d[_0x2d4a('0x4c')]['id']},'attributes':['id',_0x2d4a('0x2d'),'username',_0x2d4a('0x61'),_0x2d4a('0x62'),_0x2d4a('0x63'),_0x2d4a('0x64'),_0x2d4a('0x65')]})[_0x2d4a('0x2b')](handleEntityNotFound(_0x21517f,null))['then'](function(_0x1617d1){if(_0x1617d1){_0x30b58b=_0x1617d1[_0x2d4a('0x66')];_0xefcbf6=_0x1617d1['accessKey'];_0x21633a=_0x1617d1[_0x2d4a('0x62')];_0x51b96b=util[_0x2d4a('0x67')](_0x2d4a('0x68'),_0x1617d1[_0x2d4a('0x63')]);var _0x429579={'method':_0x2d4a('0x69'),'uri':_0x51b96b,'qs':{'operation':_0x2d4a('0x6a'),'username':_0x1617d1[_0x2d4a('0x66')]},'json':!![]};return rp(_0x429579);}})[_0x2d4a('0x2b')](function(_0x70c4a0){if(_0x70c4a0['success']){var _0x212fcf={'method':'POST','uri':_0x51b96b,'form':{'operation':_0x2d4a('0x6b'),'username':_0x30b58b,'accessKey':md5(_0x70c4a0[_0x2d4a('0x1e')][_0x2d4a('0x6c')]+_0xefcbf6)},'json':!![]};return rp(_0x212fcf);}})[_0x2d4a('0x2b')](function(_0x18d7f3){if(_0x18d7f3[_0x2d4a('0x6d')]){var _0x305d45={'method':'GET','uri':_0x51b96b,'qs':{'operation':_0x2d4a('0x6e'),'username':_0x30b58b,'sessionName':_0x18d7f3[_0x2d4a('0x1e')][_0x2d4a('0x6f')],'elementType':_0x21633a},'json':!![]};return rp(_0x305d45);}})[_0x2d4a('0x2b')](function(_0x47377e){if(_0x47377e['success']){var _0x4ebda1=['autogenerated',_0x2d4a('0x70'),_0x2d4a('0x71')];_[_0x2d4a('0x72')](_0x47377e['result'][_0x2d4a('0x3a')],function(_0x7ca04e){return _0x4ebda1[_0x2d4a('0x73')](_0x7ca04e[_0x2d4a('0x5c')][_0x2d4a('0x2d')]);});_[_0x2d4a('0x72')](_0x47377e['result'][_0x2d4a('0x3a')],function(_0x579bdf){return _0x579bdf[_0x2d4a('0x74')]===_0x2d4a('0x75');});return{'count':_0x47377e['result'][_0x2d4a('0x3a')]['length'],'rows':_['map'](_0x47377e['result'][_0x2d4a('0x3a')],function(_0xd175e5){return{'id':_0xd175e5[_0x2d4a('0x2d')],'name':_0xd175e5['label'],'custom':_[_0x2d4a('0x76')](_0xd175e5[_0x2d4a('0x2d')],_0x2d4a('0x77'))?!![]:![],'options':_0xd175e5[_0x2d4a('0x5c')]['name']===_0x2d4a('0x78')&&_0xd175e5[_0x2d4a('0x5c')]['picklistValues'][_0x2d4a('0x3b')]>0x0?_[_0x2d4a('0x46')](_0xd175e5['type'][_0x2d4a('0x79')],function(_0x57ece5){return{'name':_0x57ece5['label'],'value':_0x57ece5[_0x2d4a('0x7a')]};}):[]};})};}})['then'](respondWithResult(_0x21517f,null))[_0x2d4a('0x1f')](function(_0x12eccd){console[_0x2d4a('0x7b')](_0x2d4a('0x7c')+_0x12eccd);var _0x5e939f=_0x45153d[_0x2d4a('0x35')]['test']?0x1f4:_0x12eccd[_0x2d4a('0x7d')]||0x1f4;logger[_0x2d4a('0x1b')](_0x2d4a('0x7e'),_0x2d4a('0x60'),_0x5e939f,JSON[_0x2d4a('0x1a')](_0x12eccd));delete _0x12eccd['name'];if(_0x5e939f===0x191){_0x5e939f=0x190;}_0x21517f[_0x2d4a('0x21')](_0x5e939f)[_0x2d4a('0x2e')](_0x45153d[_0x2d4a('0x35')]['test']?{'message':_0x2d4a('0x7f'),'statusCode':_0x12eccd['statusCode']}:_0x12eccd);});};
\ No newline at end of file
index f40cec8..4e8715e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d35=['./intVtigerAccount.attributes','exports','int_vtiger_accounts','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8d35,0xe4));var _0x58d3=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x8d35[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x58d3('0x0'));var util=require(_0x58d3('0x1'));var logger=require(_0x58d3('0x2'))(_0x58d3('0x3'));var moment=require('moment');var BPromise=require(_0x58d3('0x4'));var rp=require(_0x58d3('0x5'));var attributes=require(_0x58d3('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x58d3('0x7')]=function(_0x27c5fe,_0x5b038d){return _0x27c5fe['define']('VtigerAccount',attributes,{'tableName':_0x58d3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5275=['util','../../config/logger','api','moment','./intVtigerAccount.attributes','exports','define','VtigerAccount','lodash'];(function(_0x5e6ebe,_0x373752){var _0x5d80a0=function(_0x145677){while(--_0x145677){_0x5e6ebe['push'](_0x5e6ebe['shift']());}};_0x5d80a0(++_0x373752);}(_0x5275,0x167));var _0x5527=function(_0x10cfc2,_0x1cffff){_0x10cfc2=_0x10cfc2-0x0;var _0x19f55e=_0x5275[_0x10cfc2];return _0x19f55e;};'use strict';var _=require(_0x5527('0x0'));var util=require(_0x5527('0x1'));var logger=require(_0x5527('0x2'))(_0x5527('0x3'));var moment=require(_0x5527('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x5527('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x5527('0x6')]=function(_0x20d2c8,_0x42e9fc){return _0x20d2c8[_0x5527('0x7')](_0x5527('0x8'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0b7116a..6cf8237 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x362c=['jayson/promise','client','request','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','GetVtigerAccount','findAll','options','raw','attributes','map','include','model','then','catch','ShowVtigerAccount','VtigerAccount','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x1c02de,_0x31d8d5){var _0x178b69=function(_0x304076){while(--_0x304076){_0x1c02de['push'](_0x1c02de['shift']());}};_0x178b69(++_0x31d8d5);}(_0x362c,0x16d));var _0xc362=function(_0x3cb4b2,_0x5045ec){_0x3cb4b2=_0x3cb4b2-0x0;var _0x3343e2=_0x362c[_0x3cb4b2];return _0x3343e2;};'use strict';var _=require('lodash');var util=require(_0xc362('0x0'));var moment=require(_0xc362('0x1'));var BPromise=require(_0xc362('0x2'));var rs=require(_0xc362('0x3'));var fs=require('fs');var db=require(_0xc362('0x4'))['db'];var utils=require(_0xc362('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc362('0x6'));var jayson=require(_0xc362('0x7'));var client=jayson[_0xc362('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fc6b3,_0x4b14f6,_0x2e6327){return new BPromise(function(_0x34b932,_0x4a287e){return client[_0xc362('0x9')](_0x3fc6b3,_0x2e6327)['then'](function(_0x2def68){logger['info'](_0xc362('0xa'),_0x4b14f6,'request\x20sent');logger[_0xc362('0xb')](_0xc362('0xc'),_0x4b14f6,'request\x20sent',JSON[_0xc362('0xd')](_0x2def68));if(_0x2def68['error']){if(_0x2def68[_0xc362('0xe')]['code']===0x1f4){logger[_0xc362('0xe')](_0xc362('0xa'),_0x4b14f6,_0x2def68['error'][_0xc362('0xf')]);return _0x4a287e(_0x2def68['error'][_0xc362('0xf')]);}logger[_0xc362('0xe')](_0xc362('0xa'),_0x4b14f6,_0x2def68['error'][_0xc362('0xf')]);return _0x34b932(_0x2def68[_0xc362('0xe')][_0xc362('0xf')]);}else{logger[_0xc362('0x10')](_0xc362('0xa'),_0x4b14f6,_0xc362('0x11'));_0x34b932(_0x2def68[_0xc362('0x12')][_0xc362('0xf')]);}})['catch'](function(_0x127efe){logger[_0xc362('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x4b14f6,_0x127efe);_0x4a287e(_0x127efe);});});}exports[_0xc362('0x13')]=function(_0x400f9a){var _0x2f6c47=this;return new Promise(function(_0x172e2f,_0x358858){return db['VtigerAccount'][_0xc362('0x14')]({'raw':_0x400f9a[_0xc362('0x15')]?_0x400f9a[_0xc362('0x15')][_0xc362('0x16')]===undefined?!![]:![]:!![],'where':_0x400f9a[_0xc362('0x15')]?_0x400f9a[_0xc362('0x15')]['where']||null:null,'attributes':_0x400f9a[_0xc362('0x15')]?_0x400f9a['options'][_0xc362('0x17')]||null:null,'limit':_0x400f9a[_0xc362('0x15')]?_0x400f9a[_0xc362('0x15')]['limit']||null:null,'include':_0x400f9a[_0xc362('0x15')]?_0x400f9a[_0xc362('0x15')]['include']?_[_0xc362('0x18')](_0x400f9a[_0xc362('0x15')][_0xc362('0x19')],function(_0x532430){return{'model':db[_0x532430['model']],'as':_0x532430['as'],'attributes':_0x532430[_0xc362('0x17')],'include':_0x532430[_0xc362('0x19')]?_['map'](_0x532430[_0xc362('0x19')],function(_0x3354d1){return{'model':db[_0x3354d1[_0xc362('0x1a')]],'as':_0x3354d1['as'],'attributes':_0x3354d1[_0xc362('0x17')],'include':_0x3354d1['include']?_[_0xc362('0x18')](_0x3354d1[_0xc362('0x19')],function(_0x21d617){return{'model':db[_0x21d617[_0xc362('0x1a')]],'as':_0x21d617['as'],'attributes':_0x21d617[_0xc362('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc362('0x1b')](function(_0x5a9d89){logger[_0xc362('0x10')]('GetVtigerAccount',_0x400f9a);logger[_0xc362('0xb')](_0xc362('0x13'),_0x400f9a,JSON['stringify'](_0x5a9d89));_0x172e2f(_0x5a9d89);})[_0xc362('0x1c')](function(_0x6a1894){logger[_0xc362('0xe')](_0xc362('0x13'),_0x6a1894[_0xc362('0xf')],_0x400f9a);_0x358858(_0x2f6c47['error'](0x1f4,_0x6a1894[_0xc362('0xf')]));});});};exports[_0xc362('0x1d')]=function(_0x43842a){var _0x38d674=this;return new Promise(function(_0x5b9264,_0x9078e8){return db[_0xc362('0x1e')]['find']({'raw':_0x43842a[_0xc362('0x15')]?_0x43842a['options'][_0xc362('0x16')]===undefined?!![]:![]:!![],'where':_0x43842a[_0xc362('0x15')]?_0x43842a[_0xc362('0x15')]['where']||null:null,'attributes':_0x43842a[_0xc362('0x15')]?_0x43842a[_0xc362('0x15')][_0xc362('0x17')]||null:null,'include':_0x43842a['options']?_0x43842a[_0xc362('0x15')][_0xc362('0x19')]?_[_0xc362('0x18')](_0x43842a['options']['include'],function(_0x5c173f){return{'model':db[_0x5c173f[_0xc362('0x1a')]],'as':_0x5c173f['as'],'attributes':_0x5c173f['attributes'],'include':_0x5c173f[_0xc362('0x19')]?_['map'](_0x5c173f[_0xc362('0x19')],function(_0x43f87a){return{'model':db[_0x43f87a[_0xc362('0x1a')]],'as':_0x43f87a['as'],'attributes':_0x43f87a[_0xc362('0x17')],'include':_0x43f87a[_0xc362('0x19')]?_['map'](_0x43f87a[_0xc362('0x19')],function(_0x18ec68){return{'model':db[_0x18ec68[_0xc362('0x1a')]],'as':_0x18ec68['as'],'attributes':_0x18ec68[_0xc362('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc362('0x1b')](function(_0x9386ef){logger['info'](_0xc362('0x1d'),_0x43842a);logger[_0xc362('0xb')](_0xc362('0x1d'),_0x43842a,JSON[_0xc362('0xd')](_0x9386ef));_0x5b9264(_0x9386ef);})['catch'](function(_0x3436fd){logger['error'](_0xc362('0x1d'),_0x3436fd[_0xc362('0xf')],_0x43842a);_0x9078e8(_0x38d674['error'](0x1f4,_0x3436fd['message']));});});};
\ No newline at end of file
+var _0xa36b=['limit','include','model','map','GetVtigerAccount','catch','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VtigerAccount','findAll','options','raw','where','attributes'];(function(_0x395dbb,_0x3c745e){var _0x432c8a=function(_0x185515){while(--_0x185515){_0x395dbb['push'](_0x395dbb['shift']());}};_0x432c8a(++_0x3c745e);}(_0xa36b,0x98));var _0xba36=function(_0x256153,_0x358d2e){_0x256153=_0x256153-0x0;var _0x5648ac=_0xa36b[_0x256153];return _0x5648ac;};'use strict';var _=require(_0xba36('0x0'));var util=require(_0xba36('0x1'));var moment=require(_0xba36('0x2'));var BPromise=require(_0xba36('0x3'));var rs=require(_0xba36('0x4'));var fs=require('fs');var db=require(_0xba36('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xba36('0x6'))(_0xba36('0x7'));var config=require('../../config/environment');var jayson=require(_0xba36('0x8'));var client=jayson[_0xba36('0x9')][_0xba36('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e159e,_0x4f58ad,_0x473db1){return new BPromise(function(_0x151614,_0x151d27){return client['request'](_0x5e159e,_0x473db1)[_0xba36('0xb')](function(_0x3bb992){logger[_0xba36('0xc')](_0xba36('0xd'),_0x4f58ad,_0xba36('0xe'));logger[_0xba36('0xf')](_0xba36('0x10'),_0x4f58ad,_0xba36('0xe'),JSON[_0xba36('0x11')](_0x3bb992));if(_0x3bb992[_0xba36('0x12')]){if(_0x3bb992[_0xba36('0x12')][_0xba36('0x13')]===0x1f4){logger['error'](_0xba36('0xd'),_0x4f58ad,_0x3bb992[_0xba36('0x12')][_0xba36('0x14')]);return _0x151d27(_0x3bb992['error'][_0xba36('0x14')]);}logger[_0xba36('0x12')](_0xba36('0xd'),_0x4f58ad,_0x3bb992[_0xba36('0x12')]['message']);return _0x151614(_0x3bb992[_0xba36('0x12')][_0xba36('0x14')]);}else{logger[_0xba36('0xc')](_0xba36('0xd'),_0x4f58ad,_0xba36('0xe'));_0x151614(_0x3bb992[_0xba36('0x15')]['message']);}})['catch'](function(_0x2feba3){logger['error'](_0xba36('0xd'),_0x4f58ad,_0x2feba3);_0x151d27(_0x2feba3);});});}exports['GetVtigerAccount']=function(_0x1ee0ba){var _0x3dd555=this;return new Promise(function(_0x3ee23c,_0x38f9f1){return db[_0xba36('0x16')][_0xba36('0x17')]({'raw':_0x1ee0ba['options']?_0x1ee0ba[_0xba36('0x18')][_0xba36('0x19')]===undefined?!![]:![]:!![],'where':_0x1ee0ba['options']?_0x1ee0ba['options'][_0xba36('0x1a')]||null:null,'attributes':_0x1ee0ba['options']?_0x1ee0ba[_0xba36('0x18')][_0xba36('0x1b')]||null:null,'limit':_0x1ee0ba[_0xba36('0x18')]?_0x1ee0ba[_0xba36('0x18')][_0xba36('0x1c')]||null:null,'include':_0x1ee0ba['options']?_0x1ee0ba['options']['include']?_['map'](_0x1ee0ba['options'][_0xba36('0x1d')],function(_0x210385){return{'model':db[_0x210385[_0xba36('0x1e')]],'as':_0x210385['as'],'attributes':_0x210385['attributes'],'include':_0x210385[_0xba36('0x1d')]?_[_0xba36('0x1f')](_0x210385[_0xba36('0x1d')],function(_0x42d11c){return{'model':db[_0x42d11c[_0xba36('0x1e')]],'as':_0x42d11c['as'],'attributes':_0x42d11c[_0xba36('0x1b')],'include':_0x42d11c[_0xba36('0x1d')]?_[_0xba36('0x1f')](_0x42d11c[_0xba36('0x1d')],function(_0x20b6ea){return{'model':db[_0x20b6ea[_0xba36('0x1e')]],'as':_0x20b6ea['as'],'attributes':_0x20b6ea['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2af674){logger[_0xba36('0xc')](_0xba36('0x20'),_0x1ee0ba);logger[_0xba36('0xf')](_0xba36('0x20'),_0x1ee0ba,JSON[_0xba36('0x11')](_0x2af674));_0x3ee23c(_0x2af674);})[_0xba36('0x21')](function(_0x4efbcf){logger[_0xba36('0x12')](_0xba36('0x20'),_0x4efbcf[_0xba36('0x14')],_0x1ee0ba);_0x38f9f1(_0x3dd555[_0xba36('0x12')](0x1f4,_0x4efbcf[_0xba36('0x14')]));});});};exports[_0xba36('0x22')]=function(_0xab74a1){var _0x4cf67d=this;return new Promise(function(_0x8921fa,_0x4d6408){return db[_0xba36('0x16')][_0xba36('0x23')]({'raw':_0xab74a1[_0xba36('0x18')]?_0xab74a1[_0xba36('0x18')][_0xba36('0x19')]===undefined?!![]:![]:!![],'where':_0xab74a1[_0xba36('0x18')]?_0xab74a1[_0xba36('0x18')][_0xba36('0x1a')]||null:null,'attributes':_0xab74a1[_0xba36('0x18')]?_0xab74a1[_0xba36('0x18')][_0xba36('0x1b')]||null:null,'include':_0xab74a1[_0xba36('0x18')]?_0xab74a1[_0xba36('0x18')][_0xba36('0x1d')]?_[_0xba36('0x1f')](_0xab74a1[_0xba36('0x18')]['include'],function(_0x285e5c){return{'model':db[_0x285e5c[_0xba36('0x1e')]],'as':_0x285e5c['as'],'attributes':_0x285e5c['attributes'],'include':_0x285e5c[_0xba36('0x1d')]?_[_0xba36('0x1f')](_0x285e5c[_0xba36('0x1d')],function(_0x207a34){return{'model':db[_0x207a34['model']],'as':_0x207a34['as'],'attributes':_0x207a34[_0xba36('0x1b')],'include':_0x207a34[_0xba36('0x1d')]?_['map'](_0x207a34[_0xba36('0x1d')],function(_0x580b6a){return{'model':db[_0x580b6a[_0xba36('0x1e')]],'as':_0x580b6a['as'],'attributes':_0x580b6a['attributes']};}):[]};}):[]};}):[]:[]})[_0xba36('0xb')](function(_0x172f39){logger['info'](_0xba36('0x22'),_0xab74a1);logger[_0xba36('0xf')]('ShowVtigerAccount',_0xab74a1,JSON['stringify'](_0x172f39));_0x8921fa(_0x172f39);})[_0xba36('0x21')](function(_0x1f4752){logger['error'](_0xba36('0x22'),_0x1f4752[_0xba36('0x14')],_0xab74a1);_0x4d6408(_0x4cf67d[_0xba36('0x12')](0x1f4,_0x1f4752[_0xba36('0x14')]));});});};
\ No newline at end of file
index b52a5c5..94fcdd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaaee=['update','delete','multer','util','path','express','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x5700ad,_0x16dc0e){var _0x5a3c14=function(_0x2dc0df){while(--_0x2dc0df){_0x5700ad['push'](_0x5700ad['shift']());}};_0x5a3c14(++_0x16dc0e);}(_0xaaee,0x10a));var _0xeaae=function(_0x165394,_0x521d9b){_0x165394=_0x165394-0x0;var _0x12b883=_0xaaee[_0x165394];return _0x12b883;};'use strict';var multer=require(_0xeaae('0x0'));var util=require(_0xeaae('0x1'));var path=require(_0xeaae('0x2'));var express=require(_0xeaae('0x3'));var router=express['Router']();var auth=require(_0xeaae('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xeaae('0x5'));var controller=require(_0xeaae('0x6'));router[_0xeaae('0x7')]('/',auth['isAuthenticated'](),controller[_0xeaae('0x8')]);router[_0xeaae('0x7')](_0xeaae('0x9'),auth[_0xeaae('0xa')](),controller[_0xeaae('0xb')]);router[_0xeaae('0x7')](_0xeaae('0xc'),auth[_0xeaae('0xa')](),controller[_0xeaae('0xd')]);router['get'](_0xeaae('0xe'),auth[_0xeaae('0xa')](),controller['getSubjects']);router[_0xeaae('0x7')](_0xeaae('0xf'),auth[_0xeaae('0xa')](),controller[_0xeaae('0x10')]);router[_0xeaae('0x11')]('/',auth[_0xeaae('0xa')](),controller[_0xeaae('0x12')]);router[_0xeaae('0x13')](_0xeaae('0x9'),auth[_0xeaae('0xa')](),controller[_0xeaae('0x14')]);router[_0xeaae('0x15')](_0xeaae('0x9'),auth[_0xeaae('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x64fd=['/:id/descriptions','getDescriptions','post','put','update','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects'];(function(_0x37aef0,_0xd94101){var _0x5b4f66=function(_0x2e8e3a){while(--_0x2e8e3a){_0x37aef0['push'](_0x37aef0['shift']());}};_0x5b4f66(++_0xd94101);}(_0x64fd,0x167));var _0xd64f=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x64fd[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0xd64f('0x0'));var util=require(_0xd64f('0x1'));var path=require('path');var express=require('express');var router=express[_0xd64f('0x2')]();var auth=require(_0xd64f('0x3'));var interaction=require(_0xd64f('0x4'));var config=require(_0xd64f('0x5'));var controller=require(_0xd64f('0x6'));router[_0xd64f('0x7')]('/',auth[_0xd64f('0x8')](),controller[_0xd64f('0x9')]);router[_0xd64f('0x7')](_0xd64f('0xa'),auth[_0xd64f('0x8')](),controller[_0xd64f('0xb')]);router['get'](_0xd64f('0xc'),auth[_0xd64f('0x8')](),controller[_0xd64f('0xd')]);router['get']('/:id/subjects',auth[_0xd64f('0x8')](),controller[_0xd64f('0xe')]);router['get'](_0xd64f('0xf'),auth[_0xd64f('0x8')](),controller[_0xd64f('0x10')]);router[_0xd64f('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd64f('0x12')](_0xd64f('0xa'),auth[_0xd64f('0x8')](),controller[_0xd64f('0x13')]);router['delete'](_0xd64f('0xa'),auth[_0xd64f('0x8')](),controller[_0xd64f('0x14')]);module[_0xd64f('0x15')]=router;
\ No newline at end of file
index 8d2d31d..c4237c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf96d=['sequelize','STRING'];(function(_0x271b17,_0x196002){var _0x1b7578=function(_0x1c011a){while(--_0x1c011a){_0x271b17['push'](_0x271b17['shift']());}};_0x1b7578(++_0x196002);}(_0xf96d,0x160));var _0xdf96=function(_0x15d0b3,_0xffbba2){_0x15d0b3=_0x15d0b3-0x0;var _0x3df0ab=_0xf96d[_0x15d0b3];return _0x3df0ab;};'use strict';var Sequelize=require(_0xdf96('0x0'));module['exports']={'name':{'type':Sequelize[_0xdf96('0x1')]},'description':{'type':Sequelize[_0xdf96('0x1')]}};
\ No newline at end of file
+var _0xd0a6=['sequelize','exports','STRING'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xd0a6,0x1a1));var _0x6d0a=function(_0x49d503,_0x5e7ccd){_0x49d503=_0x49d503-0x0;var _0x271627=_0xd0a6[_0x49d503];return _0x271627;};'use strict';var Sequelize=require(_0x6d0a('0x0'));module[_0x6d0a('0x1')]={'name':{'type':Sequelize[_0x6d0a('0x2')]},'description':{'type':Sequelize[_0x6d0a('0x2')]}};
\ No newline at end of file
index e6d1f40..56a4549 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99c6=['then','name','send','VtigerConfiguration','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','day','add','merge','filter','map','options','includeAll','include','findAll','rows','catch','show','fields','create','update','body','params','getFields','VtigerField','pick','length','getSubjects','findOne','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save'];(function(_0x59eeb5,_0xf455f2){var _0x405c85=function(_0x405292){while(--_0x405292){_0x59eeb5['push'](_0x59eeb5['shift']());}};_0x405c85(++_0xf455f2);}(_0x99c6,0x81));var _0x699c=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x99c6[_0x15c421];return _0x5e5ed5;};'use strict';var pdf=require(_0x699c('0x0'));var emlformat=require(_0x699c('0x1'));var rimraf=require(_0x699c('0x2'));var zipdir=require(_0x699c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x699c('0x4'));var Mustache=require('mustache');var util=require(_0x699c('0x5'));var path=require(_0x699c('0x6'));var sox=require(_0x699c('0x7'));var csv=require('to-csv');var ejs=require(_0x699c('0x8'));var fs=require('fs');var _=require(_0x699c('0x9'));var squel=require(_0x699c('0xa'));var crypto=require(_0x699c('0xb'));var jsforce=require(_0x699c('0xc'));var deskjs=require(_0x699c('0xd'));var toCsv=require(_0x699c('0xe'));var querystring=require(_0x699c('0xf'));var Papa=require(_0x699c('0x10'));var qs=require(_0x699c('0x11'));var logger=require('../../config/logger')(_0x699c('0x12'));var utils=require(_0x699c('0x13'));var config=require('../../config/environment');var db=require(_0x699c('0x14'))['db'];var jayson=require(_0x699c('0x15'));var client=jayson[_0x699c('0x16')][_0x699c('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x369f30,_0x23e414,_0x1c04ac,_0x224a28){return new BPromise(function(_0x400671,_0x52c008){var _0x7076ed=_0x224a28||client;return _0x7076ed[_0x699c('0x18')](_0x369f30,_0x1c04ac)['then'](function(_0x2758fb){logger[_0x699c('0x19')](_0x699c('0x1a'),_0x23e414,_0x699c('0x1b'));logger[_0x699c('0x1c')](_0x699c('0x1d'),_0x23e414,_0x699c('0x1b'),JSON['stringify'](_0x2758fb));if(_0x2758fb[_0x699c('0x1e')]){if(_0x2758fb[_0x699c('0x1e')][_0x699c('0x1f')]===0x1f4){logger[_0x699c('0x1e')](_0x699c('0x1a'),_0x23e414,_0x2758fb[_0x699c('0x1e')][_0x699c('0x20')]);return _0x52c008(_0x2758fb[_0x699c('0x1e')]['message']);}logger[_0x699c('0x1e')]('VtigerConfiguration,\x20%s,\x20%s',_0x23e414,_0x2758fb['error'][_0x699c('0x20')]);return _0x400671(_0x2758fb['error'][_0x699c('0x20')]);}else{logger[_0x699c('0x19')](_0x699c('0x1a'),_0x23e414,_0x699c('0x1b'));_0x400671(_0x2758fb[_0x699c('0x21')][_0x699c('0x20')]);}})['catch'](function(_0x851757){logger[_0x699c('0x1e')](_0x699c('0x1a'),_0x23e414,_0x851757);_0x52c008(_0x851757);});});}function respondWithStatusCode(_0x2b1328,_0x589104){_0x589104=_0x589104||0xcc;return function(_0x2f6f3d){if(_0x2f6f3d){return _0x2b1328[_0x699c('0x22')](_0x589104);}return _0x2b1328['status'](_0x589104)[_0x699c('0x23')]();};}function respondWithResult(_0x4d65e2,_0x4a54ab){_0x4a54ab=_0x4a54ab||0xc8;return function(_0x213116){if(_0x213116){return _0x4d65e2[_0x699c('0x24')](_0x4a54ab)[_0x699c('0x25')](_0x213116);}};}function respondWithFilteredResult(_0x3b9247,_0x599dda){return function(_0x27a7c1){if(_0x27a7c1){var _0x4a18f4=_0x27a7c1[_0x699c('0x26')],_0x5d064d=_0x599dda['offset'],_0x158f63=_0x599dda[_0x699c('0x27')]+_0x599dda[_0x699c('0x28')],_0x3e61f5;if(_0x158f63>=_0x4a18f4){_0x158f63=_0x4a18f4;_0x3e61f5=0xc8;}else{_0x3e61f5=0xce;}_0x3b9247[_0x699c('0x24')](_0x3e61f5);return _0x3b9247['set'](_0x699c('0x29'),_0x5d064d+'-'+_0x158f63+'/'+_0x4a18f4)[_0x699c('0x25')](_0x27a7c1);}return null;};}function patchUpdates(_0x8f823b){return function(_0x23c58e){try{jsonpatch[_0x699c('0x2a')](_0x23c58e,_0x8f823b,!![]);}catch(_0x49da07){return BPromise[_0x699c('0x2b')](_0x49da07);}return _0x23c58e[_0x699c('0x2c')]();};}function saveUpdates(_0xb9d71,_0x58a9f1){return function(_0x290243){if(_0x290243){return _0x290243['update'](_0xb9d71)[_0x699c('0x2d')](function(_0x2a451f){return _0x2a451f;});}return null;};}function removeEntity(_0x159a2c,_0x1f20ed){return function(_0xeb94bf){if(_0xeb94bf){return _0xeb94bf['destroy']()[_0x699c('0x2d')](function(){_0x159a2c[_0x699c('0x24')](0xcc)[_0x699c('0x23')]();});}};}function handleEntityNotFound(_0x2ee207,_0x256e26){return function(_0x5422fc){if(!_0x5422fc){_0x2ee207['sendStatus'](0x194);}return _0x5422fc;};}function handleError(_0x35f45c,_0x55c280){_0x55c280=_0x55c280||0x1f4;return function(_0x55b39f){logger['error'](_0x55b39f['stack']);if(_0x55b39f[_0x699c('0x2e')]){delete _0x55b39f[_0x699c('0x2e')];}_0x35f45c['status'](_0x55c280)[_0x699c('0x2f')](_0x55b39f);};}exports['index']=function(_0x27a992,_0x287b1c){var _0x563228={},_0x4b84d7={},_0x3770d1={'count':0x0,'rows':[]};var _0x4e5626=db[_0x699c('0x30')][_0x699c('0x31')];_0x4b84d7[_0x699c('0x32')]=_[_0x699c('0x33')](_0x4e5626);var _0x30e6ea={'dateStart':_0x27a992[_0x699c('0x34')][_0x699c('0x35')],'dateEnd':_0x27a992[_0x699c('0x34')]['dateEnd']};delete _0x27a992[_0x699c('0x34')][_0x699c('0x35')];delete _0x27a992[_0x699c('0x34')][_0x699c('0x36')];_0x4b84d7[_0x699c('0x34')]=_[_0x699c('0x33')](_0x27a992[_0x699c('0x34')]);_0x4b84d7[_0x699c('0x37')]=_[_0x699c('0x38')](_0x4b84d7[_0x699c('0x32')],_0x4b84d7[_0x699c('0x34')]);_0x563228[_0x699c('0x39')]=_['intersection'](_0x4b84d7[_0x699c('0x32')],qs['fields'](_0x27a992[_0x699c('0x34')]['fields']));_0x563228['attributes']=_0x563228[_0x699c('0x39')]['length']?_0x563228[_0x699c('0x39')]:_0x4b84d7[_0x699c('0x32')];if(!_0x27a992[_0x699c('0x34')][_0x699c('0x3a')](_0x699c('0x3b'))){_0x563228[_0x699c('0x28')]=qs[_0x699c('0x28')](_0x27a992[_0x699c('0x34')][_0x699c('0x28')]);_0x563228[_0x699c('0x27')]=qs['offset'](_0x27a992[_0x699c('0x34')][_0x699c('0x27')]);}_0x563228[_0x699c('0x3c')]=qs[_0x699c('0x3d')](_0x27a992[_0x699c('0x34')][_0x699c('0x3d')]);_0x563228[_0x699c('0x3e')]=qs[_0x699c('0x37')](_['pick'](_0x27a992[_0x699c('0x34')],_0x4b84d7[_0x699c('0x37')]));if(_0x30e6ea[_0x699c('0x35')]){if(_0x30e6ea[_0x699c('0x36')]){_0x30e6ea[_0x699c('0x36')]=moment(_0x30e6ea[_0x699c('0x36')])['add'](0x1,_0x699c('0x3f'));}else{_0x30e6ea['dateEnd']=moment(_0x30e6ea[_0x699c('0x35')])[_0x699c('0x40')](0x1,_0x699c('0x3f'));}_[_0x699c('0x41')](_0x563228[_0x699c('0x3e')],{'createdAt':{'$gte':_0x30e6ea[_0x699c('0x35')],'$lte':_0x30e6ea[_0x699c('0x36')]}});}if(_0x27a992[_0x699c('0x34')][_0x699c('0x42')]){_0x563228[_0x699c('0x3e')]=_[_0x699c('0x41')](_0x563228[_0x699c('0x3e')],{'$or':_[_0x699c('0x43')](_0x563228[_0x699c('0x39')],function(_0x6f1249){var _0x59908b={};_0x59908b[_0x6f1249]={'$like':'%'+_0x27a992[_0x699c('0x34')]['filter']+'%'};return _0x59908b;})});}_0x563228=_['merge']({},_0x563228,_0x27a992[_0x699c('0x44')]);var _0x48dec6={'where':_0x563228[_0x699c('0x3e')]};return db[_0x699c('0x30')]['count'](_0x48dec6)[_0x699c('0x2d')](function(_0x160fcd){_0x3770d1[_0x699c('0x26')]=_0x160fcd;if(_0x27a992[_0x699c('0x34')][_0x699c('0x45')]){_0x563228[_0x699c('0x46')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x699c('0x47')](_0x563228);})[_0x699c('0x2d')](function(_0x2cbf53){_0x3770d1[_0x699c('0x48')]=_0x2cbf53;return _0x3770d1;})[_0x699c('0x2d')](respondWithFilteredResult(_0x287b1c,_0x563228))[_0x699c('0x49')](handleError(_0x287b1c,null));};exports[_0x699c('0x4a')]=function(_0x59831b,_0xaad1ec){var _0x538d7c={'raw':![],'where':{'id':_0x59831b['params']['id']}},_0x468fde={};_0x468fde['model']=_['keys'](db['VtigerConfiguration'][_0x699c('0x31')]);_0x468fde[_0x699c('0x34')]=_[_0x699c('0x33')](_0x59831b[_0x699c('0x34')]);_0x468fde[_0x699c('0x37')]=_['intersection'](_0x468fde['model'],_0x468fde[_0x699c('0x34')]);_0x538d7c[_0x699c('0x39')]=_[_0x699c('0x38')](_0x468fde[_0x699c('0x32')],qs[_0x699c('0x4b')](_0x59831b[_0x699c('0x34')][_0x699c('0x4b')]));_0x538d7c['attributes']=_0x538d7c[_0x699c('0x39')]['length']?_0x538d7c[_0x699c('0x39')]:_0x468fde[_0x699c('0x32')];if(_0x59831b[_0x699c('0x34')]['includeAll']){_0x538d7c[_0x699c('0x46')]=[{'all':!![]}];}_0x538d7c=_['merge']({},_0x538d7c,_0x59831b[_0x699c('0x44')]);return db['VtigerConfiguration']['find'](_0x538d7c)[_0x699c('0x2d')](handleEntityNotFound(_0xaad1ec,null))[_0x699c('0x2d')](respondWithResult(_0xaad1ec,null))[_0x699c('0x49')](handleError(_0xaad1ec,null));};exports[_0x699c('0x4c')]=function(_0x2545fb,_0x333a45){return db[_0x699c('0x30')][_0x699c('0x4c')](_0x2545fb['body'],{})[_0x699c('0x2d')](respondWithResult(_0x333a45,0xc9))[_0x699c('0x49')](handleError(_0x333a45,null));};exports[_0x699c('0x4d')]=function(_0x59e804,_0x38d09a){if(_0x59e804['body']['id']){delete _0x59e804[_0x699c('0x4e')]['id'];}return db[_0x699c('0x30')]['find']({'where':{'id':_0x59e804[_0x699c('0x4f')]['id']}})[_0x699c('0x2d')](handleEntityNotFound(_0x38d09a,null))[_0x699c('0x2d')](saveUpdates(_0x59e804[_0x699c('0x4e')],null))[_0x699c('0x2d')](respondWithResult(_0x38d09a,null))[_0x699c('0x49')](handleError(_0x38d09a,null));};exports['destroy']=function(_0x14899e,_0x449e83){return db[_0x699c('0x30')]['find']({'where':{'id':_0x14899e[_0x699c('0x4f')]['id']}})[_0x699c('0x2d')](handleEntityNotFound(_0x449e83,null))['then'](removeEntity(_0x449e83,null))[_0x699c('0x49')](handleError(_0x449e83,null));};exports[_0x699c('0x50')]=function(_0x2b9724,_0x4c6bde,_0x54db81){var _0x43ee8b={};var _0x1a58c4={};var _0x2ee70c;var _0x2ddb38;return db[_0x699c('0x30')]['findOne']({'where':{'id':_0x2b9724[_0x699c('0x4f')]['id']}})[_0x699c('0x2d')](handleEntityNotFound(_0x4c6bde,null))['then'](function(_0x57fef5){if(_0x57fef5){_0x2ee70c=_0x57fef5;_0x1a58c4['model']=_['keys'](db[_0x699c('0x51')]['rawAttributes']);_0x1a58c4['query']=_['keys'](_0x2b9724[_0x699c('0x34')]);_0x1a58c4[_0x699c('0x37')]=_[_0x699c('0x38')](_0x1a58c4[_0x699c('0x32')],_0x1a58c4[_0x699c('0x34')]);_0x43ee8b[_0x699c('0x39')]=_[_0x699c('0x38')](_0x1a58c4['model'],qs[_0x699c('0x4b')](_0x2b9724[_0x699c('0x34')][_0x699c('0x4b')]));_0x43ee8b[_0x699c('0x39')]=_0x43ee8b[_0x699c('0x39')]['length']?_0x43ee8b[_0x699c('0x39')]:_0x1a58c4[_0x699c('0x32')];_0x43ee8b[_0x699c('0x3c')]=qs['sort'](_0x2b9724[_0x699c('0x34')][_0x699c('0x3d')]);_0x43ee8b[_0x699c('0x3e')]=qs['filters'](_[_0x699c('0x52')](_0x2b9724['query'],_0x1a58c4[_0x699c('0x37')]));if(_0x2b9724['query'][_0x699c('0x42')]){_0x43ee8b[_0x699c('0x3e')]=_[_0x699c('0x41')](_0x43ee8b[_0x699c('0x3e')],{'$or':_['map'](_0x43ee8b['attributes'],function(_0x3bd610){var _0xf07808={};_0xf07808[_0x3bd610]={'$like':'%'+_0x2b9724[_0x699c('0x34')][_0x699c('0x42')]+'%'};return _0xf07808;})});}_0x43ee8b=_['merge']({},_0x43ee8b,_0x2b9724[_0x699c('0x44')]);return _0x2ee70c[_0x699c('0x50')](_0x43ee8b);}})[_0x699c('0x2d')](function(_0x4d185f){if(_0x4d185f){_0x2ddb38=_0x4d185f[_0x699c('0x53')];if(!_0x2b9724[_0x699c('0x34')][_0x699c('0x3a')](_0x699c('0x3b'))){_0x43ee8b[_0x699c('0x28')]=qs[_0x699c('0x28')](_0x2b9724[_0x699c('0x34')][_0x699c('0x28')]);_0x43ee8b['offset']=qs[_0x699c('0x27')](_0x2b9724['query'][_0x699c('0x27')]);}return _0x2ee70c[_0x699c('0x50')](_0x43ee8b);}})[_0x699c('0x2d')](function(_0x590e1a){if(_0x590e1a){return _0x590e1a?{'count':_0x2ddb38,'rows':_0x590e1a}:null;}})['then'](respondWithResult(_0x4c6bde,null))['catch'](handleError(_0x4c6bde,null));};exports[_0x699c('0x54')]=function(_0x4accbf,_0x125e49,_0x265d68){var _0x5b8077={};var _0x27518f={};var _0x444a2c;var _0x26732a;return db[_0x699c('0x30')][_0x699c('0x55')]({'where':{'id':_0x4accbf['params']['id']}})[_0x699c('0x2d')](handleEntityNotFound(_0x125e49,null))['then'](function(_0x4ebc37){if(_0x4ebc37){_0x444a2c=_0x4ebc37;_0x27518f[_0x699c('0x32')]=_[_0x699c('0x33')](db[_0x699c('0x51')][_0x699c('0x31')]);_0x27518f['query']=_[_0x699c('0x33')](_0x4accbf['query']);_0x27518f['filters']=_[_0x699c('0x38')](_0x27518f['model'],_0x27518f[_0x699c('0x34')]);_0x5b8077[_0x699c('0x39')]=_[_0x699c('0x38')](_0x27518f[_0x699c('0x32')],qs[_0x699c('0x4b')](_0x4accbf[_0x699c('0x34')]['fields']));_0x5b8077['attributes']=_0x5b8077[_0x699c('0x39')][_0x699c('0x53')]?_0x5b8077['attributes']:_0x27518f[_0x699c('0x32')];_0x5b8077['order']=qs[_0x699c('0x3d')](_0x4accbf['query'][_0x699c('0x3d')]);_0x5b8077['where']=qs[_0x699c('0x37')](_[_0x699c('0x52')](_0x4accbf[_0x699c('0x34')],_0x27518f[_0x699c('0x37')]));if(_0x4accbf['query']['filter']){_0x5b8077[_0x699c('0x3e')]=_['merge'](_0x5b8077[_0x699c('0x3e')],{'$or':_[_0x699c('0x43')](_0x5b8077[_0x699c('0x39')],function(_0x21592e){var _0x2d7b68={};_0x2d7b68[_0x21592e]={'$like':'%'+_0x4accbf['query'][_0x699c('0x42')]+'%'};return _0x2d7b68;})});}_0x5b8077=_[_0x699c('0x41')]({},_0x5b8077,_0x4accbf[_0x699c('0x44')]);return _0x444a2c['getSubjects'](_0x5b8077);}})[_0x699c('0x2d')](function(_0x46fc22){if(_0x46fc22){_0x26732a=_0x46fc22[_0x699c('0x53')];if(!_0x4accbf[_0x699c('0x34')]['hasOwnProperty'](_0x699c('0x3b'))){_0x5b8077['limit']=qs[_0x699c('0x28')](_0x4accbf[_0x699c('0x34')][_0x699c('0x28')]);_0x5b8077[_0x699c('0x27')]=qs['offset'](_0x4accbf[_0x699c('0x34')][_0x699c('0x27')]);}return _0x444a2c[_0x699c('0x54')](_0x5b8077);}})[_0x699c('0x2d')](function(_0x4d8bfa){if(_0x4d8bfa){return _0x4d8bfa?{'count':_0x26732a,'rows':_0x4d8bfa}:null;}})[_0x699c('0x2d')](respondWithResult(_0x125e49,null))[_0x699c('0x49')](handleError(_0x125e49,null));};exports['getDescriptions']=function(_0x102aa1,_0x47f6df,_0x4a9ecd){var _0x3ceb89={};var _0x35a3ae={};var _0x314066;var _0x561b6f;return db[_0x699c('0x30')][_0x699c('0x55')]({'where':{'id':_0x102aa1[_0x699c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x47f6df,null))['then'](function(_0x1aa1c9){if(_0x1aa1c9){_0x314066=_0x1aa1c9;_0x35a3ae[_0x699c('0x32')]=_['keys'](db[_0x699c('0x51')]['rawAttributes']);_0x35a3ae[_0x699c('0x34')]=_[_0x699c('0x33')](_0x102aa1['query']);_0x35a3ae[_0x699c('0x37')]=_[_0x699c('0x38')](_0x35a3ae[_0x699c('0x32')],_0x35a3ae['query']);_0x3ceb89[_0x699c('0x39')]=_[_0x699c('0x38')](_0x35a3ae[_0x699c('0x32')],qs['fields'](_0x102aa1[_0x699c('0x34')][_0x699c('0x4b')]));_0x3ceb89[_0x699c('0x39')]=_0x3ceb89[_0x699c('0x39')]['length']?_0x3ceb89['attributes']:_0x35a3ae[_0x699c('0x32')];_0x3ceb89['order']=qs[_0x699c('0x3d')](_0x102aa1[_0x699c('0x34')][_0x699c('0x3d')]);_0x3ceb89[_0x699c('0x3e')]=qs['filters'](_['pick'](_0x102aa1[_0x699c('0x34')],_0x35a3ae[_0x699c('0x37')]));if(_0x102aa1[_0x699c('0x34')][_0x699c('0x42')]){_0x3ceb89['where']=_[_0x699c('0x41')](_0x3ceb89[_0x699c('0x3e')],{'$or':_[_0x699c('0x43')](_0x3ceb89[_0x699c('0x39')],function(_0x19511e){var _0x5d8d89={};_0x5d8d89[_0x19511e]={'$like':'%'+_0x102aa1['query'][_0x699c('0x42')]+'%'};return _0x5d8d89;})});}_0x3ceb89=_['merge']({},_0x3ceb89,_0x102aa1[_0x699c('0x44')]);return _0x314066['getDescriptions'](_0x3ceb89);}})[_0x699c('0x2d')](function(_0x5a865f){if(_0x5a865f){_0x561b6f=_0x5a865f[_0x699c('0x53')];if(!_0x102aa1[_0x699c('0x34')][_0x699c('0x3a')](_0x699c('0x3b'))){_0x3ceb89['limit']=qs['limit'](_0x102aa1['query'][_0x699c('0x28')]);_0x3ceb89[_0x699c('0x27')]=qs[_0x699c('0x27')](_0x102aa1[_0x699c('0x34')][_0x699c('0x27')]);}return _0x314066[_0x699c('0x56')](_0x3ceb89);}})['then'](function(_0x5113e8){if(_0x5113e8){return _0x5113e8?{'count':_0x561b6f,'rows':_0x5113e8}:null;}})[_0x699c('0x2d')](respondWithResult(_0x47f6df,null))['catch'](handleError(_0x47f6df,null));};
\ No newline at end of file
+var _0x3e7f=['info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','apply','stack','name','send','index','VtigerConfiguration','rawAttributes','model','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','nolimit','order','sort','add','day','where','merge','filter','options','includeAll','findAll','show','params','keys','include','find','body','update','destroy','getFields','findOne','VtigerField','pick','map','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../config/logger','api','../../config/utils','http','request','then'];(function(_0x402e60,_0x2ff278){var _0x57ac7d=function(_0x1817b5){while(--_0x1817b5){_0x402e60['push'](_0x402e60['shift']());}};_0x57ac7d(++_0x2ff278);}(_0x3e7f,0x138));var _0xf3e7=function(_0x214a7f,_0x2e93a9){_0x214a7f=_0x214a7f-0x0;var _0x6980d9=_0x3e7f[_0x214a7f];return _0x6980d9;};'use strict';var pdf=require(_0xf3e7('0x0'));var emlformat=require(_0xf3e7('0x1'));var rimraf=require(_0xf3e7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf3e7('0x3'));var rp=require(_0xf3e7('0x4'));var moment=require(_0xf3e7('0x5'));var BPromise=require(_0xf3e7('0x6'));var Mustache=require(_0xf3e7('0x7'));var util=require(_0xf3e7('0x8'));var path=require(_0xf3e7('0x9'));var sox=require(_0xf3e7('0xa'));var csv=require('to-csv');var ejs=require(_0xf3e7('0xb'));var fs=require('fs');var _=require(_0xf3e7('0xc'));var squel=require(_0xf3e7('0xd'));var crypto=require(_0xf3e7('0xe'));var jsforce=require(_0xf3e7('0xf'));var deskjs=require(_0xf3e7('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var qs=require(_0xf3e7('0x11'));var logger=require(_0xf3e7('0x12'))(_0xf3e7('0x13'));var utils=require(_0xf3e7('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf3e7('0x15')]({'port':0x232a});function respondWithRpcPromise(_0xae9aac,_0x4a86ef,_0x333162,_0x31621e){return new BPromise(function(_0xb3ea3d,_0x40bf33){var _0x11b285=_0x31621e||client;return _0x11b285[_0xf3e7('0x16')](_0xae9aac,_0x333162)[_0xf3e7('0x17')](function(_0x52733b){logger[_0xf3e7('0x18')](_0xf3e7('0x19'),_0x4a86ef,_0xf3e7('0x1a'));logger[_0xf3e7('0x1b')](_0xf3e7('0x1c'),_0x4a86ef,_0xf3e7('0x1a'),JSON[_0xf3e7('0x1d')](_0x52733b));if(_0x52733b['error']){if(_0x52733b[_0xf3e7('0x1e')][_0xf3e7('0x1f')]===0x1f4){logger['error'](_0xf3e7('0x19'),_0x4a86ef,_0x52733b[_0xf3e7('0x1e')]['message']);return _0x40bf33(_0x52733b[_0xf3e7('0x1e')][_0xf3e7('0x20')]);}logger[_0xf3e7('0x1e')]('VtigerConfiguration,\x20%s,\x20%s',_0x4a86ef,_0x52733b['error'][_0xf3e7('0x20')]);return _0xb3ea3d(_0x52733b['error'][_0xf3e7('0x20')]);}else{logger[_0xf3e7('0x18')](_0xf3e7('0x19'),_0x4a86ef,_0xf3e7('0x1a'));_0xb3ea3d(_0x52733b['result'][_0xf3e7('0x20')]);}})[_0xf3e7('0x21')](function(_0xa18b0f){logger['error'](_0xf3e7('0x19'),_0x4a86ef,_0xa18b0f);_0x40bf33(_0xa18b0f);});});}function respondWithStatusCode(_0x5f5912,_0x218e38){_0x218e38=_0x218e38||0xcc;return function(_0x4d223b){if(_0x4d223b){return _0x5f5912[_0xf3e7('0x22')](_0x218e38);}return _0x5f5912[_0xf3e7('0x23')](_0x218e38)[_0xf3e7('0x24')]();};}function respondWithResult(_0x3117c2,_0x1408c2){_0x1408c2=_0x1408c2||0xc8;return function(_0x666b02){if(_0x666b02){return _0x3117c2['status'](_0x1408c2)[_0xf3e7('0x25')](_0x666b02);}};}function respondWithFilteredResult(_0x3d5d6c,_0xa4f76a){return function(_0xba4e40){if(_0xba4e40){var _0x5c10b0=_0xba4e40[_0xf3e7('0x26')],_0x4f26e4=_0xa4f76a[_0xf3e7('0x27')],_0x372787=_0xa4f76a[_0xf3e7('0x27')]+_0xa4f76a[_0xf3e7('0x28')],_0x1a24b6;if(_0x372787>=_0x5c10b0){_0x372787=_0x5c10b0;_0x1a24b6=0xc8;}else{_0x1a24b6=0xce;}_0x3d5d6c[_0xf3e7('0x23')](_0x1a24b6);return _0x3d5d6c['set']('Content-Range',_0x4f26e4+'-'+_0x372787+'/'+_0x5c10b0)[_0xf3e7('0x25')](_0xba4e40);}return null;};}function patchUpdates(_0x23d500){return function(_0x58bc6e){try{jsonpatch[_0xf3e7('0x29')](_0x58bc6e,_0x23d500,!![]);}catch(_0x14a91f){return BPromise['reject'](_0x14a91f);}return _0x58bc6e['save']();};}function saveUpdates(_0x1239f4,_0x5bcdb8){return function(_0x2b542c){if(_0x2b542c){return _0x2b542c['update'](_0x1239f4)[_0xf3e7('0x17')](function(_0x209eb7){return _0x209eb7;});}return null;};}function removeEntity(_0x3cd8a4,_0x64d8d8){return function(_0x216621){if(_0x216621){return _0x216621['destroy']()[_0xf3e7('0x17')](function(){_0x3cd8a4[_0xf3e7('0x23')](0xcc)[_0xf3e7('0x24')]();});}};}function handleEntityNotFound(_0x83b32a,_0x598a8f){return function(_0x4a983e){if(!_0x4a983e){_0x83b32a[_0xf3e7('0x22')](0x194);}return _0x4a983e;};}function handleError(_0xf96326,_0x22b672){_0x22b672=_0x22b672||0x1f4;return function(_0x425eeb){logger['error'](_0x425eeb[_0xf3e7('0x2a')]);if(_0x425eeb[_0xf3e7('0x2b')]){delete _0x425eeb[_0xf3e7('0x2b')];}_0xf96326[_0xf3e7('0x23')](_0x22b672)[_0xf3e7('0x2c')](_0x425eeb);};}exports[_0xf3e7('0x2d')]=function(_0x544386,_0x4712dd){var _0x348e8a={},_0x409c6f={},_0x169cb9={'count':0x0,'rows':[]};var _0x4d5ab7=db[_0xf3e7('0x2e')][_0xf3e7('0x2f')];_0x409c6f[_0xf3e7('0x30')]=_['keys'](_0x4d5ab7);var _0x180f67={'dateStart':_0x544386[_0xf3e7('0x31')][_0xf3e7('0x32')],'dateEnd':_0x544386[_0xf3e7('0x31')][_0xf3e7('0x33')]};delete _0x544386['query']['dateStart'];delete _0x544386[_0xf3e7('0x31')][_0xf3e7('0x33')];_0x409c6f['query']=_['keys'](_0x544386[_0xf3e7('0x31')]);_0x409c6f[_0xf3e7('0x34')]=_[_0xf3e7('0x35')](_0x409c6f[_0xf3e7('0x30')],_0x409c6f[_0xf3e7('0x31')]);_0x348e8a[_0xf3e7('0x36')]=_[_0xf3e7('0x35')](_0x409c6f['model'],qs[_0xf3e7('0x37')](_0x544386[_0xf3e7('0x31')][_0xf3e7('0x37')]));_0x348e8a['attributes']=_0x348e8a[_0xf3e7('0x36')][_0xf3e7('0x38')]?_0x348e8a[_0xf3e7('0x36')]:_0x409c6f[_0xf3e7('0x30')];if(!_0x544386[_0xf3e7('0x31')]['hasOwnProperty'](_0xf3e7('0x39'))){_0x348e8a[_0xf3e7('0x28')]=qs[_0xf3e7('0x28')](_0x544386[_0xf3e7('0x31')][_0xf3e7('0x28')]);_0x348e8a[_0xf3e7('0x27')]=qs[_0xf3e7('0x27')](_0x544386[_0xf3e7('0x31')][_0xf3e7('0x27')]);}_0x348e8a[_0xf3e7('0x3a')]=qs[_0xf3e7('0x3b')](_0x544386[_0xf3e7('0x31')]['sort']);_0x348e8a['where']=qs[_0xf3e7('0x34')](_['pick'](_0x544386[_0xf3e7('0x31')],_0x409c6f[_0xf3e7('0x34')]));if(_0x180f67['dateStart']){if(_0x180f67['dateEnd']){_0x180f67['dateEnd']=moment(_0x180f67[_0xf3e7('0x33')])[_0xf3e7('0x3c')](0x1,_0xf3e7('0x3d'));}else{_0x180f67[_0xf3e7('0x33')]=moment(_0x180f67[_0xf3e7('0x32')])[_0xf3e7('0x3c')](0x1,'day');}_['merge'](_0x348e8a[_0xf3e7('0x3e')],{'createdAt':{'$gte':_0x180f67['dateStart'],'$lte':_0x180f67['dateEnd']}});}if(_0x544386[_0xf3e7('0x31')]['filter']){_0x348e8a['where']=_[_0xf3e7('0x3f')](_0x348e8a[_0xf3e7('0x3e')],{'$or':_['map'](_0x348e8a[_0xf3e7('0x36')],function(_0x2f6ae9){var _0x7796f0={};_0x7796f0[_0x2f6ae9]={'$like':'%'+_0x544386[_0xf3e7('0x31')][_0xf3e7('0x40')]+'%'};return _0x7796f0;})});}_0x348e8a=_['merge']({},_0x348e8a,_0x544386[_0xf3e7('0x41')]);var _0x31e811={'where':_0x348e8a[_0xf3e7('0x3e')]};return db[_0xf3e7('0x2e')]['count'](_0x31e811)[_0xf3e7('0x17')](function(_0x2479a1){_0x169cb9[_0xf3e7('0x26')]=_0x2479a1;if(_0x544386['query'][_0xf3e7('0x42')]){_0x348e8a['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0xf3e7('0x43')](_0x348e8a);})[_0xf3e7('0x17')](function(_0x2e92de){_0x169cb9['rows']=_0x2e92de;return _0x169cb9;})[_0xf3e7('0x17')](respondWithFilteredResult(_0x4712dd,_0x348e8a))[_0xf3e7('0x21')](handleError(_0x4712dd,null));};exports[_0xf3e7('0x44')]=function(_0x3a6359,_0x1856b7){var _0x34187a={'raw':![],'where':{'id':_0x3a6359[_0xf3e7('0x45')]['id']}},_0x467493={};_0x467493[_0xf3e7('0x30')]=_['keys'](db[_0xf3e7('0x2e')][_0xf3e7('0x2f')]);_0x467493[_0xf3e7('0x31')]=_[_0xf3e7('0x46')](_0x3a6359[_0xf3e7('0x31')]);_0x467493['filters']=_['intersection'](_0x467493[_0xf3e7('0x30')],_0x467493[_0xf3e7('0x31')]);_0x34187a[_0xf3e7('0x36')]=_[_0xf3e7('0x35')](_0x467493['model'],qs[_0xf3e7('0x37')](_0x3a6359[_0xf3e7('0x31')][_0xf3e7('0x37')]));_0x34187a[_0xf3e7('0x36')]=_0x34187a['attributes'][_0xf3e7('0x38')]?_0x34187a[_0xf3e7('0x36')]:_0x467493['model'];if(_0x3a6359[_0xf3e7('0x31')]['includeAll']){_0x34187a[_0xf3e7('0x47')]=[{'all':!![]}];}_0x34187a=_[_0xf3e7('0x3f')]({},_0x34187a,_0x3a6359['options']);return db[_0xf3e7('0x2e')][_0xf3e7('0x48')](_0x34187a)[_0xf3e7('0x17')](handleEntityNotFound(_0x1856b7,null))[_0xf3e7('0x17')](respondWithResult(_0x1856b7,null))[_0xf3e7('0x21')](handleError(_0x1856b7,null));};exports['create']=function(_0x9863e2,_0x502608){return db[_0xf3e7('0x2e')]['create'](_0x9863e2[_0xf3e7('0x49')],{})[_0xf3e7('0x17')](respondWithResult(_0x502608,0xc9))[_0xf3e7('0x21')](handleError(_0x502608,null));};exports[_0xf3e7('0x4a')]=function(_0x267f17,_0x3d7eb4){if(_0x267f17['body']['id']){delete _0x267f17['body']['id'];}return db['VtigerConfiguration'][_0xf3e7('0x48')]({'where':{'id':_0x267f17[_0xf3e7('0x45')]['id']}})[_0xf3e7('0x17')](handleEntityNotFound(_0x3d7eb4,null))[_0xf3e7('0x17')](saveUpdates(_0x267f17[_0xf3e7('0x49')],null))[_0xf3e7('0x17')](respondWithResult(_0x3d7eb4,null))[_0xf3e7('0x21')](handleError(_0x3d7eb4,null));};exports[_0xf3e7('0x4b')]=function(_0x340720,_0xb7fa02){return db['VtigerConfiguration'][_0xf3e7('0x48')]({'where':{'id':_0x340720[_0xf3e7('0x45')]['id']}})['then'](handleEntityNotFound(_0xb7fa02,null))[_0xf3e7('0x17')](removeEntity(_0xb7fa02,null))[_0xf3e7('0x21')](handleError(_0xb7fa02,null));};exports[_0xf3e7('0x4c')]=function(_0x5e1589,_0x48f97c,_0x9be9fc){var _0x3c8c24={};var _0x3d055d={};var _0x1f84c1;var _0x31047b;return db[_0xf3e7('0x2e')][_0xf3e7('0x4d')]({'where':{'id':_0x5e1589[_0xf3e7('0x45')]['id']}})[_0xf3e7('0x17')](handleEntityNotFound(_0x48f97c,null))['then'](function(_0x1b7d92){if(_0x1b7d92){_0x1f84c1=_0x1b7d92;_0x3d055d[_0xf3e7('0x30')]=_['keys'](db[_0xf3e7('0x4e')][_0xf3e7('0x2f')]);_0x3d055d[_0xf3e7('0x31')]=_[_0xf3e7('0x46')](_0x5e1589[_0xf3e7('0x31')]);_0x3d055d[_0xf3e7('0x34')]=_[_0xf3e7('0x35')](_0x3d055d['model'],_0x3d055d[_0xf3e7('0x31')]);_0x3c8c24[_0xf3e7('0x36')]=_[_0xf3e7('0x35')](_0x3d055d[_0xf3e7('0x30')],qs[_0xf3e7('0x37')](_0x5e1589[_0xf3e7('0x31')]['fields']));_0x3c8c24['attributes']=_0x3c8c24['attributes'][_0xf3e7('0x38')]?_0x3c8c24['attributes']:_0x3d055d[_0xf3e7('0x30')];_0x3c8c24[_0xf3e7('0x3a')]=qs[_0xf3e7('0x3b')](_0x5e1589[_0xf3e7('0x31')][_0xf3e7('0x3b')]);_0x3c8c24[_0xf3e7('0x3e')]=qs[_0xf3e7('0x34')](_[_0xf3e7('0x4f')](_0x5e1589[_0xf3e7('0x31')],_0x3d055d['filters']));if(_0x5e1589[_0xf3e7('0x31')][_0xf3e7('0x40')]){_0x3c8c24[_0xf3e7('0x3e')]=_[_0xf3e7('0x3f')](_0x3c8c24[_0xf3e7('0x3e')],{'$or':_[_0xf3e7('0x50')](_0x3c8c24[_0xf3e7('0x36')],function(_0x5db889){var _0x5c3847={};_0x5c3847[_0x5db889]={'$like':'%'+_0x5e1589['query']['filter']+'%'};return _0x5c3847;})});}_0x3c8c24=_[_0xf3e7('0x3f')]({},_0x3c8c24,_0x5e1589[_0xf3e7('0x41')]);return _0x1f84c1[_0xf3e7('0x4c')](_0x3c8c24);}})[_0xf3e7('0x17')](function(_0x2a4350){if(_0x2a4350){_0x31047b=_0x2a4350[_0xf3e7('0x38')];if(!_0x5e1589['query'][_0xf3e7('0x51')](_0xf3e7('0x39'))){_0x3c8c24[_0xf3e7('0x28')]=qs[_0xf3e7('0x28')](_0x5e1589[_0xf3e7('0x31')][_0xf3e7('0x28')]);_0x3c8c24[_0xf3e7('0x27')]=qs['offset'](_0x5e1589[_0xf3e7('0x31')][_0xf3e7('0x27')]);}return _0x1f84c1[_0xf3e7('0x4c')](_0x3c8c24);}})['then'](function(_0x37897b){if(_0x37897b){return _0x37897b?{'count':_0x31047b,'rows':_0x37897b}:null;}})[_0xf3e7('0x17')](respondWithResult(_0x48f97c,null))['catch'](handleError(_0x48f97c,null));};exports[_0xf3e7('0x52')]=function(_0x39d1aa,_0x540b80,_0x4b55a1){var _0x4b1fd0={};var _0x93264={};var _0x1bf6df;var _0x235371;return db['VtigerConfiguration'][_0xf3e7('0x4d')]({'where':{'id':_0x39d1aa[_0xf3e7('0x45')]['id']}})[_0xf3e7('0x17')](handleEntityNotFound(_0x540b80,null))['then'](function(_0x4766f0){if(_0x4766f0){_0x1bf6df=_0x4766f0;_0x93264['model']=_[_0xf3e7('0x46')](db[_0xf3e7('0x4e')][_0xf3e7('0x2f')]);_0x93264[_0xf3e7('0x31')]=_['keys'](_0x39d1aa[_0xf3e7('0x31')]);_0x93264[_0xf3e7('0x34')]=_[_0xf3e7('0x35')](_0x93264[_0xf3e7('0x30')],_0x93264[_0xf3e7('0x31')]);_0x4b1fd0[_0xf3e7('0x36')]=_[_0xf3e7('0x35')](_0x93264[_0xf3e7('0x30')],qs[_0xf3e7('0x37')](_0x39d1aa[_0xf3e7('0x31')][_0xf3e7('0x37')]));_0x4b1fd0['attributes']=_0x4b1fd0[_0xf3e7('0x36')]['length']?_0x4b1fd0[_0xf3e7('0x36')]:_0x93264[_0xf3e7('0x30')];_0x4b1fd0['order']=qs['sort'](_0x39d1aa[_0xf3e7('0x31')]['sort']);_0x4b1fd0[_0xf3e7('0x3e')]=qs['filters'](_[_0xf3e7('0x4f')](_0x39d1aa[_0xf3e7('0x31')],_0x93264[_0xf3e7('0x34')]));if(_0x39d1aa[_0xf3e7('0x31')][_0xf3e7('0x40')]){_0x4b1fd0[_0xf3e7('0x3e')]=_['merge'](_0x4b1fd0['where'],{'$or':_['map'](_0x4b1fd0[_0xf3e7('0x36')],function(_0x55f7d2){var _0x1dfcb0={};_0x1dfcb0[_0x55f7d2]={'$like':'%'+_0x39d1aa[_0xf3e7('0x31')]['filter']+'%'};return _0x1dfcb0;})});}_0x4b1fd0=_[_0xf3e7('0x3f')]({},_0x4b1fd0,_0x39d1aa[_0xf3e7('0x41')]);return _0x1bf6df[_0xf3e7('0x52')](_0x4b1fd0);}})[_0xf3e7('0x17')](function(_0xa35a1e){if(_0xa35a1e){_0x235371=_0xa35a1e['length'];if(!_0x39d1aa[_0xf3e7('0x31')][_0xf3e7('0x51')]('nolimit')){_0x4b1fd0[_0xf3e7('0x28')]=qs[_0xf3e7('0x28')](_0x39d1aa[_0xf3e7('0x31')][_0xf3e7('0x28')]);_0x4b1fd0[_0xf3e7('0x27')]=qs['offset'](_0x39d1aa['query']['offset']);}return _0x1bf6df[_0xf3e7('0x52')](_0x4b1fd0);}})[_0xf3e7('0x17')](function(_0x3dc798){if(_0x3dc798){return _0x3dc798?{'count':_0x235371,'rows':_0x3dc798}:null;}})['then'](respondWithResult(_0x540b80,null))[_0xf3e7('0x21')](handleError(_0x540b80,null));};exports[_0xf3e7('0x53')]=function(_0x4af584,_0x22e78a,_0x13d968){var _0x1998d2={};var _0x27ec66={};var _0x332007;var _0x412ea7;return db[_0xf3e7('0x2e')][_0xf3e7('0x4d')]({'where':{'id':_0x4af584['params']['id']}})[_0xf3e7('0x17')](handleEntityNotFound(_0x22e78a,null))[_0xf3e7('0x17')](function(_0x4f2219){if(_0x4f2219){_0x332007=_0x4f2219;_0x27ec66['model']=_[_0xf3e7('0x46')](db[_0xf3e7('0x4e')]['rawAttributes']);_0x27ec66[_0xf3e7('0x31')]=_['keys'](_0x4af584[_0xf3e7('0x31')]);_0x27ec66[_0xf3e7('0x34')]=_[_0xf3e7('0x35')](_0x27ec66[_0xf3e7('0x30')],_0x27ec66[_0xf3e7('0x31')]);_0x1998d2[_0xf3e7('0x36')]=_[_0xf3e7('0x35')](_0x27ec66[_0xf3e7('0x30')],qs['fields'](_0x4af584[_0xf3e7('0x31')]['fields']));_0x1998d2[_0xf3e7('0x36')]=_0x1998d2[_0xf3e7('0x36')][_0xf3e7('0x38')]?_0x1998d2['attributes']:_0x27ec66[_0xf3e7('0x30')];_0x1998d2[_0xf3e7('0x3a')]=qs[_0xf3e7('0x3b')](_0x4af584[_0xf3e7('0x31')][_0xf3e7('0x3b')]);_0x1998d2[_0xf3e7('0x3e')]=qs[_0xf3e7('0x34')](_[_0xf3e7('0x4f')](_0x4af584[_0xf3e7('0x31')],_0x27ec66[_0xf3e7('0x34')]));if(_0x4af584[_0xf3e7('0x31')][_0xf3e7('0x40')]){_0x1998d2['where']=_['merge'](_0x1998d2[_0xf3e7('0x3e')],{'$or':_[_0xf3e7('0x50')](_0x1998d2[_0xf3e7('0x36')],function(_0xc0ae75){var _0x3a166c={};_0x3a166c[_0xc0ae75]={'$like':'%'+_0x4af584[_0xf3e7('0x31')]['filter']+'%'};return _0x3a166c;})});}_0x1998d2=_[_0xf3e7('0x3f')]({},_0x1998d2,_0x4af584['options']);return _0x332007['getDescriptions'](_0x1998d2);}})[_0xf3e7('0x17')](function(_0x17660c){if(_0x17660c){_0x412ea7=_0x17660c[_0xf3e7('0x38')];if(!_0x4af584[_0xf3e7('0x31')][_0xf3e7('0x51')](_0xf3e7('0x39'))){_0x1998d2[_0xf3e7('0x28')]=qs['limit'](_0x4af584[_0xf3e7('0x31')][_0xf3e7('0x28')]);_0x1998d2[_0xf3e7('0x27')]=qs[_0xf3e7('0x27')](_0x4af584['query']['offset']);}return _0x332007[_0xf3e7('0x53')](_0x1998d2);}})[_0xf3e7('0x17')](function(_0x23cb7e){if(_0x23cb7e){return _0x23cb7e?{'count':_0x412ea7,'rows':_0x23cb7e}:null;}})[_0xf3e7('0x17')](respondWithResult(_0x22e78a,null))['catch'](handleError(_0x22e78a,null));};
\ No newline at end of file
index 702f138..6ce5976 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70c9=['exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','./intVtigerConfiguration.attributes'];(function(_0x22a059,_0x1b9e8c){var _0x1d6845=function(_0x58ca4c){while(--_0x58ca4c){_0x22a059['push'](_0x22a059['shift']());}};_0x1d6845(++_0x1b9e8c);}(_0x70c9,0x1bc));var _0x970c=function(_0x57d263,_0x396be9){_0x57d263=_0x57d263-0x0;var _0x129a7e=_0x70c9[_0x57d263];return _0x129a7e;};'use strict';var _=require(_0x970c('0x0'));var util=require('util');var logger=require(_0x970c('0x1'))(_0x970c('0x2'));var moment=require(_0x970c('0x3'));var BPromise=require(_0x970c('0x4'));var rp=require(_0x970c('0x5'));var attributes=require(_0x970c('0x6'));module[_0x970c('0x7')]=function(_0x44fd98,_0x515cb7){return _0x44fd98[_0x970c('0x8')](_0x970c('0x9'),attributes,{'tableName':_0x970c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa816=['VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intVtigerConfiguration.attributes','exports'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0xa816,0x1d0));var _0x6a81=function(_0x33bcdb,_0x11846b){_0x33bcdb=_0x33bcdb-0x0;var _0x18a9bf=_0xa816[_0x33bcdb];return _0x18a9bf;};'use strict';var _=require(_0x6a81('0x0'));var util=require(_0x6a81('0x1'));var logger=require(_0x6a81('0x2'))(_0x6a81('0x3'));var moment=require(_0x6a81('0x4'));var BPromise=require(_0x6a81('0x5'));var rp=require(_0x6a81('0x6'));var attributes=require(_0x6a81('0x7'));module[_0x6a81('0x8')]=function(_0x19fae3,_0xc346b3){return _0x19fae3['define'](_0x6a81('0x9'),attributes,{'tableName':_0x6a81('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d63fd1f..25c1f74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe409=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','randomstring','../../mysqldb'];(function(_0x275fc9,_0x5402ad){var _0x3faee6=function(_0x55dd02){while(--_0x55dd02){_0x275fc9['push'](_0x275fc9['shift']());}};_0x3faee6(++_0x5402ad);}(_0xe409,0x1a0));var _0x9e40=function(_0x5b6658,_0x224236){_0x5b6658=_0x5b6658-0x0;var _0x87e667=_0xe409[_0x5b6658];return _0x87e667;};'use strict';var _=require(_0x9e40('0x0'));var util=require('util');var moment=require(_0x9e40('0x1'));var BPromise=require('bluebird');var rs=require(_0x9e40('0x2'));var fs=require('fs');var db=require(_0x9e40('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9e40('0x4'))(_0x9e40('0x5'));var config=require(_0x9e40('0x6'));var jayson=require(_0x9e40('0x7'));var client=jayson[_0x9e40('0x8')][_0x9e40('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44381b,_0x3bc444,_0x257d67){return new BPromise(function(_0x47ccc4,_0x40d60e){return client[_0x9e40('0xa')](_0x44381b,_0x257d67)['then'](function(_0x48f98f){logger['info'](_0x9e40('0xb'),_0x3bc444,_0x9e40('0xc'));logger['debug'](_0x9e40('0xd'),_0x3bc444,_0x9e40('0xc'),JSON[_0x9e40('0xe')](_0x48f98f));if(_0x48f98f[_0x9e40('0xf')]){if(_0x48f98f['error'][_0x9e40('0x10')]===0x1f4){logger[_0x9e40('0xf')](_0x9e40('0xb'),_0x3bc444,_0x48f98f['error'][_0x9e40('0x11')]);return _0x40d60e(_0x48f98f[_0x9e40('0xf')][_0x9e40('0x11')]);}logger[_0x9e40('0xf')](_0x9e40('0xb'),_0x3bc444,_0x48f98f[_0x9e40('0xf')][_0x9e40('0x11')]);return _0x47ccc4(_0x48f98f[_0x9e40('0xf')]['message']);}else{logger[_0x9e40('0x12')](_0x9e40('0xb'),_0x3bc444,_0x9e40('0xc'));_0x47ccc4(_0x48f98f[_0x9e40('0x13')][_0x9e40('0x11')]);}})['catch'](function(_0x588f51){logger[_0x9e40('0xf')](_0x9e40('0xb'),_0x3bc444,_0x588f51);_0x40d60e(_0x588f51);});});}
\ No newline at end of file
+var _0x8604=['then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xb01517,_0x77cc0c){var _0x1ef3d7=function(_0x2eeafc){while(--_0x2eeafc){_0xb01517['push'](_0xb01517['shift']());}};_0x1ef3d7(++_0x77cc0c);}(_0x8604,0xa4));var _0x4860=function(_0x27c46e,_0x21c72f){_0x27c46e=_0x27c46e-0x0;var _0x892aa7=_0x8604[_0x27c46e];return _0x892aa7;};'use strict';var _=require('lodash');var util=require(_0x4860('0x0'));var moment=require(_0x4860('0x1'));var BPromise=require('bluebird');var rs=require(_0x4860('0x2'));var fs=require('fs');var db=require(_0x4860('0x3'))['db'];var utils=require(_0x4860('0x4'));var logger=require(_0x4860('0x5'))(_0x4860('0x6'));var config=require(_0x4860('0x7'));var jayson=require(_0x4860('0x8'));var client=jayson[_0x4860('0x9')][_0x4860('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24c4a6,_0x366dd4,_0x32df1d){return new BPromise(function(_0x4bfb26,_0x2f0f47){return client[_0x4860('0xb')](_0x24c4a6,_0x32df1d)[_0x4860('0xc')](function(_0xb0d6af){logger[_0x4860('0xd')](_0x4860('0xe'),_0x366dd4,_0x4860('0xf'));logger[_0x4860('0x10')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x366dd4,'request\x20sent',JSON[_0x4860('0x11')](_0xb0d6af));if(_0xb0d6af[_0x4860('0x12')]){if(_0xb0d6af[_0x4860('0x12')]['code']===0x1f4){logger[_0x4860('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x366dd4,_0xb0d6af[_0x4860('0x12')][_0x4860('0x13')]);return _0x2f0f47(_0xb0d6af[_0x4860('0x12')]['message']);}logger[_0x4860('0x12')](_0x4860('0xe'),_0x366dd4,_0xb0d6af[_0x4860('0x12')][_0x4860('0x13')]);return _0x4bfb26(_0xb0d6af[_0x4860('0x12')]['message']);}else{logger[_0x4860('0xd')](_0x4860('0xe'),_0x366dd4,_0x4860('0xf'));_0x4bfb26(_0xb0d6af[_0x4860('0x14')][_0x4860('0x13')]);}})[_0x4860('0x15')](function(_0x351614){logger[_0x4860('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x366dd4,_0x351614);_0x2f0f47(_0x351614);});});}
\ No newline at end of file
index 2f36c97..e7420c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd991=['get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intVtigerField.controller'];(function(_0x4e71a2,_0x299d64){var _0x45e27b=function(_0x401a5f){while(--_0x401a5f){_0x4e71a2['push'](_0x4e71a2['shift']());}};_0x45e27b(++_0x299d64);}(_0xd991,0x115));var _0x1d99=function(_0x7c91dc,_0x14f457){_0x7c91dc=_0x7c91dc-0x0;var _0x427294=_0xd991[_0x7c91dc];return _0x427294;};'use strict';var multer=require(_0x1d99('0x0'));var util=require(_0x1d99('0x1'));var path=require(_0x1d99('0x2'));var express=require(_0x1d99('0x3'));var router=express[_0x1d99('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x1d99('0x5'));var config=require(_0x1d99('0x6'));var controller=require(_0x1d99('0x7'));router[_0x1d99('0x8')]('/',auth[_0x1d99('0x9')](),controller[_0x1d99('0xa')]);router['get'](_0x1d99('0xb'),auth[_0x1d99('0x9')](),controller['show']);router[_0x1d99('0xc')]('/',auth[_0x1d99('0x9')](),controller[_0x1d99('0xd')]);router[_0x1d99('0xe')](_0x1d99('0xb'),auth[_0x1d99('0x9')](),controller[_0x1d99('0xf')]);router[_0x1d99('0x10')](_0x1d99('0xb'),auth['isAuthenticated'](),controller[_0x1d99('0x11')]);module[_0x1d99('0x12')]=router;
\ No newline at end of file
+var _0x2df7=['/:id','create','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x2df7,0x1f4));var _0x72df=function(_0x17d520,_0x42a594){_0x17d520=_0x17d520-0x0;var _0x3b358a=_0x2df7[_0x17d520];return _0x3b358a;};'use strict';var multer=require(_0x72df('0x0'));var util=require('util');var path=require(_0x72df('0x1'));var express=require(_0x72df('0x2'));var router=express[_0x72df('0x3')]();var auth=require(_0x72df('0x4'));var interaction=require(_0x72df('0x5'));var config=require(_0x72df('0x6'));var controller=require('./intVtigerField.controller');router[_0x72df('0x7')]('/',auth[_0x72df('0x8')](),controller[_0x72df('0x9')]);router['get'](_0x72df('0xa'),auth[_0x72df('0x8')](),controller['show']);router['post']('/',auth[_0x72df('0x8')](),controller[_0x72df('0xb')]);router['put'](_0x72df('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x72df('0xc')](_0x72df('0xa'),auth[_0x72df('0x8')](),controller[_0x72df('0xd')]);module[_0x72df('0xe')]=router;
\ No newline at end of file
index ad52c27..583b828 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e6c=['variable','STRING','BOOLEAN','sequelize','exports','string'];(function(_0x29e8a7,_0xe10940){var _0x2fd9ec=function(_0x36afe4){while(--_0x36afe4){_0x29e8a7['push'](_0x29e8a7['shift']());}};_0x2fd9ec(++_0xe10940);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]={'type':{'type':Sequelize['ENUM'](_0xc6e6('0x2'),_0xc6e6('0x3'),'customVariable','keyValue'),'defaultValue':_0xc6e6('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc6e6('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xc6e6('0x2'),_0xc6e6('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xc6e6('0x4')]},'idField':{'type':Sequelize[_0xc6e6('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc6e6('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc6e6('0x4')]}};
\ No newline at end of file
+var _0xe605=['STRING','ENUM','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0x579b09,_0x565504){var _0x5e266a=function(_0x54b33f){while(--_0x54b33f){_0x579b09['push'](_0x579b09['shift']());}};_0x5e266a(++_0x565504);}(_0xe605,0x92));var _0x5e60=function(_0x4b6b77,_0x457b32){_0x4b6b77=_0x4b6b77-0x0;var _0x1e0be0=_0xe605[_0x4b6b77];return _0x1e0be0;};'use strict';var Sequelize=require(_0x5e60('0x0'));module[_0x5e60('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5e60('0x2'),_0x5e60('0x3'),_0x5e60('0x4'),_0x5e60('0x5')),'defaultValue':_0x5e60('0x2')},'content':{'type':Sequelize[_0x5e60('0x6')]},'key':{'type':Sequelize[_0x5e60('0x6')]},'keyType':{'type':Sequelize[_0x5e60('0x7')](_0x5e60('0x2'),_0x5e60('0x3'),_0x5e60('0x4'))},'keyContent':{'type':Sequelize[_0x5e60('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5e60('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 4f0347d..54362fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c98=['sort','where','pick','add','day','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','length','find','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','limit','set','Content-Range','save','update','then','end','stack','name','send','VtigerField','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','offset'];(function(_0x283b7c,_0x53bb1f){var _0x2a26ea=function(_0x305736){while(--_0x305736){_0x283b7c['push'](_0x283b7c['shift']());}};_0x2a26ea(++_0x53bb1f);}(_0x2c98,0x93));var _0x82c9=function(_0x3a01f3,_0x568ef2){_0x3a01f3=_0x3a01f3-0x0;var _0x414104=_0x2c98[_0x3a01f3];return _0x414104;};'use strict';var pdf=require(_0x82c9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x82c9('0x1'));var zipdir=require(_0x82c9('0x2'));var jsonpatch=require(_0x82c9('0x3'));var rp=require(_0x82c9('0x4'));var moment=require(_0x82c9('0x5'));var BPromise=require(_0x82c9('0x6'));var Mustache=require(_0x82c9('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x82c9('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x82c9('0x9'));var crypto=require(_0x82c9('0xa'));var jsforce=require(_0x82c9('0xb'));var deskjs=require(_0x82c9('0xc'));var toCsv=require(_0x82c9('0x8'));var querystring=require(_0x82c9('0xd'));var Papa=require('papaparse');var qs=require(_0x82c9('0xe'));var logger=require(_0x82c9('0xf'))(_0x82c9('0x10'));var utils=require(_0x82c9('0x11'));var config=require('../../config/environment');var db=require(_0x82c9('0x12'))['db'];function respondWithStatusCode(_0x4ba7bb,_0x34f685){_0x34f685=_0x34f685||0xcc;return function(_0x5cfe1b){if(_0x5cfe1b){return _0x4ba7bb[_0x82c9('0x13')](_0x34f685);}return _0x4ba7bb[_0x82c9('0x14')](_0x34f685)['end']();};}function respondWithResult(_0x4ca68d,_0x4f6231){_0x4f6231=_0x4f6231||0xc8;return function(_0x55a306){if(_0x55a306){return _0x4ca68d['status'](_0x4f6231)[_0x82c9('0x15')](_0x55a306);}};}function respondWithFilteredResult(_0x534d43,_0x32016f){return function(_0x35f01a){if(_0x35f01a){var _0x2d06d2=_0x35f01a[_0x82c9('0x16')],_0x3c8602=_0x32016f['offset'],_0xd66675=_0x32016f['offset']+_0x32016f[_0x82c9('0x17')],_0x53a0c5;if(_0xd66675>=_0x2d06d2){_0xd66675=_0x2d06d2;_0x53a0c5=0xc8;}else{_0x53a0c5=0xce;}_0x534d43[_0x82c9('0x14')](_0x53a0c5);return _0x534d43[_0x82c9('0x18')](_0x82c9('0x19'),_0x3c8602+'-'+_0xd66675+'/'+_0x2d06d2)[_0x82c9('0x15')](_0x35f01a);}return null;};}function patchUpdates(_0x4aa6e5){return function(_0x4f2eaf){try{jsonpatch['apply'](_0x4f2eaf,_0x4aa6e5,!![]);}catch(_0x57d8dc){return BPromise['reject'](_0x57d8dc);}return _0x4f2eaf[_0x82c9('0x1a')]();};}function saveUpdates(_0x555718,_0x1f7b66){return function(_0x10e616){if(_0x10e616){return _0x10e616[_0x82c9('0x1b')](_0x555718)[_0x82c9('0x1c')](function(_0x208c04){return _0x208c04;});}return null;};}function removeEntity(_0x2036e1,_0x3bf1bd){return function(_0x23d71b){if(_0x23d71b){return _0x23d71b['destroy']()['then'](function(){_0x2036e1['status'](0xcc)[_0x82c9('0x1d')]();});}};}function handleEntityNotFound(_0x4a50ca,_0x39b132){return function(_0x1795f9){if(!_0x1795f9){_0x4a50ca[_0x82c9('0x13')](0x194);}return _0x1795f9;};}function handleError(_0x5df285,_0x122ee6){_0x122ee6=_0x122ee6||0x1f4;return function(_0x205fd0){logger['error'](_0x205fd0[_0x82c9('0x1e')]);if(_0x205fd0[_0x82c9('0x1f')]){delete _0x205fd0[_0x82c9('0x1f')];}_0x5df285['status'](_0x122ee6)[_0x82c9('0x20')](_0x205fd0);};}exports['index']=function(_0x391913,_0x1ac13f){var _0x5ea28a={},_0x25515b={},_0x4adbbf={'count':0x0,'rows':[]};var _0x56f56c=db[_0x82c9('0x21')][_0x82c9('0x22')];_0x25515b[_0x82c9('0x23')]=_[_0x82c9('0x24')](_0x56f56c);var _0x1cd52e={'dateStart':_0x391913[_0x82c9('0x25')][_0x82c9('0x26')],'dateEnd':_0x391913[_0x82c9('0x25')]['dateEnd']};delete _0x391913[_0x82c9('0x25')][_0x82c9('0x26')];delete _0x391913[_0x82c9('0x25')][_0x82c9('0x27')];_0x25515b['query']=_[_0x82c9('0x24')](_0x391913[_0x82c9('0x25')]);_0x25515b[_0x82c9('0x28')]=_[_0x82c9('0x29')](_0x25515b[_0x82c9('0x23')],_0x25515b[_0x82c9('0x25')]);_0x5ea28a[_0x82c9('0x2a')]=_[_0x82c9('0x29')](_0x25515b[_0x82c9('0x23')],qs[_0x82c9('0x2b')](_0x391913['query'][_0x82c9('0x2b')]));_0x5ea28a['attributes']=_0x5ea28a[_0x82c9('0x2a')]['length']?_0x5ea28a[_0x82c9('0x2a')]:_0x25515b[_0x82c9('0x23')];if(!_0x391913[_0x82c9('0x25')]['hasOwnProperty']('nolimit')){_0x5ea28a[_0x82c9('0x17')]=qs[_0x82c9('0x17')](_0x391913[_0x82c9('0x25')][_0x82c9('0x17')]);_0x5ea28a['offset']=qs[_0x82c9('0x2c')](_0x391913[_0x82c9('0x25')]['offset']);}_0x5ea28a['order']=qs['sort'](_0x391913[_0x82c9('0x25')][_0x82c9('0x2d')]);_0x5ea28a[_0x82c9('0x2e')]=qs['filters'](_[_0x82c9('0x2f')](_0x391913['query'],_0x25515b['filters']));if(_0x1cd52e['dateStart']){if(_0x1cd52e[_0x82c9('0x27')]){_0x1cd52e['dateEnd']=moment(_0x1cd52e['dateEnd'])[_0x82c9('0x30')](0x1,_0x82c9('0x31'));}else{_0x1cd52e[_0x82c9('0x27')]=moment(_0x1cd52e[_0x82c9('0x26')])['add'](0x1,_0x82c9('0x31'));}_['merge'](_0x5ea28a[_0x82c9('0x2e')],{'createdAt':{'$gte':_0x1cd52e['dateStart'],'$lte':_0x1cd52e['dateEnd']}});}if(_0x391913[_0x82c9('0x25')][_0x82c9('0x32')]){_0x5ea28a['where']=_[_0x82c9('0x33')](_0x5ea28a[_0x82c9('0x2e')],{'$or':_[_0x82c9('0x34')](_0x5ea28a[_0x82c9('0x2a')],function(_0x4a0bd5){var _0x4112de={};_0x4112de[_0x4a0bd5]={'$like':'%'+_0x391913[_0x82c9('0x25')][_0x82c9('0x32')]+'%'};return _0x4112de;})});}_0x5ea28a=_['merge']({},_0x5ea28a,_0x391913[_0x82c9('0x35')]);var _0xe01874={'where':_0x5ea28a[_0x82c9('0x2e')]};return db[_0x82c9('0x21')][_0x82c9('0x16')](_0xe01874)['then'](function(_0x3768f6){_0x4adbbf[_0x82c9('0x16')]=_0x3768f6;if(_0x391913[_0x82c9('0x25')][_0x82c9('0x36')]){_0x5ea28a[_0x82c9('0x37')]=[{'all':!![]}];}return db[_0x82c9('0x21')][_0x82c9('0x38')](_0x5ea28a);})[_0x82c9('0x1c')](function(_0x5c908c){_0x4adbbf[_0x82c9('0x39')]=_0x5c908c;return _0x4adbbf;})[_0x82c9('0x1c')](respondWithFilteredResult(_0x1ac13f,_0x5ea28a))[_0x82c9('0x3a')](handleError(_0x1ac13f,null));};exports[_0x82c9('0x3b')]=function(_0x235927,_0x8124ed){var _0x3998dc={'raw':!![],'where':{'id':_0x235927['params']['id']}},_0x227d01={};_0x227d01['model']=_[_0x82c9('0x24')](db[_0x82c9('0x21')]['rawAttributes']);_0x227d01['query']=_[_0x82c9('0x24')](_0x235927[_0x82c9('0x25')]);_0x227d01[_0x82c9('0x28')]=_[_0x82c9('0x29')](_0x227d01[_0x82c9('0x23')],_0x227d01[_0x82c9('0x25')]);_0x3998dc[_0x82c9('0x2a')]=_['intersection'](_0x227d01[_0x82c9('0x23')],qs['fields'](_0x235927[_0x82c9('0x25')]['fields']));_0x3998dc[_0x82c9('0x2a')]=_0x3998dc[_0x82c9('0x2a')][_0x82c9('0x3c')]?_0x3998dc[_0x82c9('0x2a')]:_0x227d01[_0x82c9('0x23')];if(_0x235927['query'][_0x82c9('0x36')]){_0x3998dc[_0x82c9('0x37')]=[{'all':!![]}];}_0x3998dc=_['merge']({},_0x3998dc,_0x235927[_0x82c9('0x35')]);return db[_0x82c9('0x21')][_0x82c9('0x3d')](_0x3998dc)[_0x82c9('0x1c')](handleEntityNotFound(_0x8124ed,null))[_0x82c9('0x1c')](respondWithResult(_0x8124ed,null))[_0x82c9('0x3a')](handleError(_0x8124ed,null));};exports['create']=function(_0x186819,_0x515bff){return db[_0x82c9('0x21')]['create'](_0x186819[_0x82c9('0x3e')],{})['then'](respondWithResult(_0x515bff,0xc9))['catch'](handleError(_0x515bff,null));};exports['update']=function(_0x32af0b,_0x4e71d2){if(_0x32af0b[_0x82c9('0x3e')]['id']){delete _0x32af0b[_0x82c9('0x3e')]['id'];}return db['VtigerField']['find']({'where':{'id':_0x32af0b[_0x82c9('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4e71d2,null))[_0x82c9('0x1c')](saveUpdates(_0x32af0b[_0x82c9('0x3e')],null))[_0x82c9('0x1c')](respondWithResult(_0x4e71d2,null))['catch'](handleError(_0x4e71d2,null));};exports['destroy']=function(_0x436b2c,_0x2bb461){return db[_0x82c9('0x21')][_0x82c9('0x3d')]({'where':{'id':_0x436b2c[_0x82c9('0x3f')]['id']}})[_0x82c9('0x1c')](handleEntityNotFound(_0x2bb461,null))['then'](removeEntity(_0x2bb461,null))['catch'](handleError(_0x2bb461,null));};
\ No newline at end of file
+var _0xb789=['lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','stack','name','send','index','VtigerField','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','attributes','fields','length','nolimit','order','sort','where','day','add','merge','filter','options','includeAll','include','findAll','catch','params','filters','find','create','body','html-pdf','eml-format','rimraf','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x3b0c9d,_0x3ddeb5){var _0xcfc8d7=function(_0x320dc6){while(--_0x320dc6){_0x3b0c9d['push'](_0x3b0c9d['shift']());}};_0xcfc8d7(++_0x3ddeb5);}(_0xb789,0xff));var _0x9b78=function(_0x38be9c,_0xa4c4fa){_0x38be9c=_0x38be9c-0x0;var _0x6bbb47=_0xb789[_0x38be9c];return _0x6bbb47;};'use strict';var pdf=require(_0x9b78('0x0'));var emlformat=require(_0x9b78('0x1'));var rimraf=require(_0x9b78('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9b78('0x3'));var BPromise=require(_0x9b78('0x4'));var Mustache=require(_0x9b78('0x5'));var util=require('util');var path=require(_0x9b78('0x6'));var sox=require(_0x9b78('0x7'));var csv=require(_0x9b78('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9b78('0x9'));var squel=require(_0x9b78('0xa'));var crypto=require(_0x9b78('0xb'));var jsforce=require(_0x9b78('0xc'));var deskjs=require(_0x9b78('0xd'));var toCsv=require(_0x9b78('0x8'));var querystring=require(_0x9b78('0xe'));var Papa=require('papaparse');var qs=require(_0x9b78('0xf'));var logger=require(_0x9b78('0x10'))(_0x9b78('0x11'));var utils=require(_0x9b78('0x12'));var config=require('../../config/environment');var db=require(_0x9b78('0x13'))['db'];function respondWithStatusCode(_0x1fa4f9,_0x57a4fc){_0x57a4fc=_0x57a4fc||0xcc;return function(_0x11a47a){if(_0x11a47a){return _0x1fa4f9[_0x9b78('0x14')](_0x57a4fc);}return _0x1fa4f9[_0x9b78('0x15')](_0x57a4fc)[_0x9b78('0x16')]();};}function respondWithResult(_0x56ed43,_0x6557dc){_0x6557dc=_0x6557dc||0xc8;return function(_0x4a0ccc){if(_0x4a0ccc){return _0x56ed43[_0x9b78('0x15')](_0x6557dc)[_0x9b78('0x17')](_0x4a0ccc);}};}function respondWithFilteredResult(_0x20e33f,_0xa113ad){return function(_0x1babda){if(_0x1babda){var _0x51fd8e=_0x1babda[_0x9b78('0x18')],_0x29ff6c=_0xa113ad[_0x9b78('0x19')],_0x163e1b=_0xa113ad[_0x9b78('0x19')]+_0xa113ad[_0x9b78('0x1a')],_0x1b172a;if(_0x163e1b>=_0x51fd8e){_0x163e1b=_0x51fd8e;_0x1b172a=0xc8;}else{_0x1b172a=0xce;}_0x20e33f[_0x9b78('0x15')](_0x1b172a);return _0x20e33f['set'](_0x9b78('0x1b'),_0x29ff6c+'-'+_0x163e1b+'/'+_0x51fd8e)[_0x9b78('0x17')](_0x1babda);}return null;};}function patchUpdates(_0x30f61c){return function(_0x52e29d){try{jsonpatch[_0x9b78('0x1c')](_0x52e29d,_0x30f61c,!![]);}catch(_0x300e49){return BPromise[_0x9b78('0x1d')](_0x300e49);}return _0x52e29d[_0x9b78('0x1e')]();};}function saveUpdates(_0x4214fa,_0x1ca77d){return function(_0x55847e){if(_0x55847e){return _0x55847e[_0x9b78('0x1f')](_0x4214fa)[_0x9b78('0x20')](function(_0x25d6bb){return _0x25d6bb;});}return null;};}function removeEntity(_0x363751,_0x4a2d74){return function(_0x54c474){if(_0x54c474){return _0x54c474['destroy']()[_0x9b78('0x20')](function(){_0x363751[_0x9b78('0x15')](0xcc)[_0x9b78('0x16')]();});}};}function handleEntityNotFound(_0x22d3ff,_0x3b8193){return function(_0x7fe406){if(!_0x7fe406){_0x22d3ff[_0x9b78('0x14')](0x194);}return _0x7fe406;};}function handleError(_0x1fcca3,_0x21f895){_0x21f895=_0x21f895||0x1f4;return function(_0x2c4452){logger['error'](_0x2c4452[_0x9b78('0x21')]);if(_0x2c4452[_0x9b78('0x22')]){delete _0x2c4452[_0x9b78('0x22')];}_0x1fcca3[_0x9b78('0x15')](_0x21f895)[_0x9b78('0x23')](_0x2c4452);};}exports[_0x9b78('0x24')]=function(_0x1d3ed7,_0x5a2d14){var _0x3cc1e4={},_0x473108={},_0x3e1f23={'count':0x0,'rows':[]};var _0xa00a29=db[_0x9b78('0x25')][_0x9b78('0x26')];_0x473108[_0x9b78('0x27')]=_[_0x9b78('0x28')](_0xa00a29);var _0x475eb6={'dateStart':_0x1d3ed7[_0x9b78('0x29')][_0x9b78('0x2a')],'dateEnd':_0x1d3ed7[_0x9b78('0x29')][_0x9b78('0x2b')]};delete _0x1d3ed7[_0x9b78('0x29')][_0x9b78('0x2a')];delete _0x1d3ed7[_0x9b78('0x29')][_0x9b78('0x2b')];_0x473108[_0x9b78('0x29')]=_[_0x9b78('0x28')](_0x1d3ed7[_0x9b78('0x29')]);_0x473108['filters']=_[_0x9b78('0x2c')](_0x473108['model'],_0x473108['query']);_0x3cc1e4[_0x9b78('0x2d')]=_[_0x9b78('0x2c')](_0x473108[_0x9b78('0x27')],qs[_0x9b78('0x2e')](_0x1d3ed7[_0x9b78('0x29')]['fields']));_0x3cc1e4[_0x9b78('0x2d')]=_0x3cc1e4[_0x9b78('0x2d')][_0x9b78('0x2f')]?_0x3cc1e4[_0x9b78('0x2d')]:_0x473108[_0x9b78('0x27')];if(!_0x1d3ed7[_0x9b78('0x29')]['hasOwnProperty'](_0x9b78('0x30'))){_0x3cc1e4['limit']=qs[_0x9b78('0x1a')](_0x1d3ed7[_0x9b78('0x29')]['limit']);_0x3cc1e4[_0x9b78('0x19')]=qs[_0x9b78('0x19')](_0x1d3ed7[_0x9b78('0x29')][_0x9b78('0x19')]);}_0x3cc1e4[_0x9b78('0x31')]=qs['sort'](_0x1d3ed7[_0x9b78('0x29')][_0x9b78('0x32')]);_0x3cc1e4[_0x9b78('0x33')]=qs['filters'](_['pick'](_0x1d3ed7['query'],_0x473108['filters']));if(_0x475eb6[_0x9b78('0x2a')]){if(_0x475eb6[_0x9b78('0x2b')]){_0x475eb6[_0x9b78('0x2b')]=moment(_0x475eb6[_0x9b78('0x2b')])['add'](0x1,_0x9b78('0x34'));}else{_0x475eb6['dateEnd']=moment(_0x475eb6[_0x9b78('0x2a')])[_0x9b78('0x35')](0x1,_0x9b78('0x34'));}_[_0x9b78('0x36')](_0x3cc1e4[_0x9b78('0x33')],{'createdAt':{'$gte':_0x475eb6[_0x9b78('0x2a')],'$lte':_0x475eb6['dateEnd']}});}if(_0x1d3ed7[_0x9b78('0x29')][_0x9b78('0x37')]){_0x3cc1e4[_0x9b78('0x33')]=_['merge'](_0x3cc1e4[_0x9b78('0x33')],{'$or':_['map'](_0x3cc1e4[_0x9b78('0x2d')],function(_0x39a6e3){var _0xad2cd1={};_0xad2cd1[_0x39a6e3]={'$like':'%'+_0x1d3ed7[_0x9b78('0x29')]['filter']+'%'};return _0xad2cd1;})});}_0x3cc1e4=_[_0x9b78('0x36')]({},_0x3cc1e4,_0x1d3ed7[_0x9b78('0x38')]);var _0x1d3253={'where':_0x3cc1e4[_0x9b78('0x33')]};return db['VtigerField']['count'](_0x1d3253)[_0x9b78('0x20')](function(_0x423c68){_0x3e1f23['count']=_0x423c68;if(_0x1d3ed7[_0x9b78('0x29')][_0x9b78('0x39')]){_0x3cc1e4[_0x9b78('0x3a')]=[{'all':!![]}];}return db['VtigerField'][_0x9b78('0x3b')](_0x3cc1e4);})[_0x9b78('0x20')](function(_0x5ebe99){_0x3e1f23['rows']=_0x5ebe99;return _0x3e1f23;})[_0x9b78('0x20')](respondWithFilteredResult(_0x5a2d14,_0x3cc1e4))[_0x9b78('0x3c')](handleError(_0x5a2d14,null));};exports['show']=function(_0x305cc0,_0x297030){var _0x40e5a8={'raw':!![],'where':{'id':_0x305cc0[_0x9b78('0x3d')]['id']}},_0x1b8e29={};_0x1b8e29[_0x9b78('0x27')]=_[_0x9b78('0x28')](db['VtigerField'][_0x9b78('0x26')]);_0x1b8e29[_0x9b78('0x29')]=_['keys'](_0x305cc0['query']);_0x1b8e29[_0x9b78('0x3e')]=_[_0x9b78('0x2c')](_0x1b8e29[_0x9b78('0x27')],_0x1b8e29[_0x9b78('0x29')]);_0x40e5a8['attributes']=_[_0x9b78('0x2c')](_0x1b8e29[_0x9b78('0x27')],qs[_0x9b78('0x2e')](_0x305cc0[_0x9b78('0x29')][_0x9b78('0x2e')]));_0x40e5a8[_0x9b78('0x2d')]=_0x40e5a8[_0x9b78('0x2d')][_0x9b78('0x2f')]?_0x40e5a8[_0x9b78('0x2d')]:_0x1b8e29[_0x9b78('0x27')];if(_0x305cc0['query'][_0x9b78('0x39')]){_0x40e5a8[_0x9b78('0x3a')]=[{'all':!![]}];}_0x40e5a8=_[_0x9b78('0x36')]({},_0x40e5a8,_0x305cc0[_0x9b78('0x38')]);return db[_0x9b78('0x25')][_0x9b78('0x3f')](_0x40e5a8)['then'](handleEntityNotFound(_0x297030,null))['then'](respondWithResult(_0x297030,null))[_0x9b78('0x3c')](handleError(_0x297030,null));};exports[_0x9b78('0x40')]=function(_0x5af46a,_0x3a8f01){return db['VtigerField'][_0x9b78('0x40')](_0x5af46a[_0x9b78('0x41')],{})['then'](respondWithResult(_0x3a8f01,0xc9))[_0x9b78('0x3c')](handleError(_0x3a8f01,null));};exports[_0x9b78('0x1f')]=function(_0x527479,_0x25e17b){if(_0x527479[_0x9b78('0x41')]['id']){delete _0x527479[_0x9b78('0x41')]['id'];}return db['VtigerField']['find']({'where':{'id':_0x527479['params']['id']}})[_0x9b78('0x20')](handleEntityNotFound(_0x25e17b,null))[_0x9b78('0x20')](saveUpdates(_0x527479[_0x9b78('0x41')],null))['then'](respondWithResult(_0x25e17b,null))[_0x9b78('0x3c')](handleError(_0x25e17b,null));};exports['destroy']=function(_0x3f9928,_0x58e483){return db[_0x9b78('0x25')][_0x9b78('0x3f')]({'where':{'id':_0x3f9928['params']['id']}})[_0x9b78('0x20')](handleEntityNotFound(_0x58e483,null))[_0x9b78('0x20')](removeEntity(_0x58e483,null))[_0x9b78('0x3c')](handleError(_0x58e483,null));};
\ No newline at end of file
index fd80cfc..c22496a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6ed=['../../config/logger','api','moment','bluebird','request-promise','./intVtigerField.attributes','exports','int_vtiger_fields','lodash','util'];(function(_0x24fca9,_0x11c6e9){var _0x16e5e5=function(_0x1c12b4){while(--_0x1c12b4){_0x24fca9['push'](_0x24fca9['shift']());}};_0x16e5e5(++_0x11c6e9);}(_0xc6ed,0x152));var _0xdc6e=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xc6ed[_0x3070dc];return _0x431489;};'use strict';var _=require(_0xdc6e('0x0'));var util=require(_0xdc6e('0x1'));var logger=require(_0xdc6e('0x2'))(_0xdc6e('0x3'));var moment=require(_0xdc6e('0x4'));var BPromise=require(_0xdc6e('0x5'));var rp=require(_0xdc6e('0x6'));var attributes=require(_0xdc6e('0x7'));module[_0xdc6e('0x8')]=function(_0x2a1038,_0x419a7a){return _0x2a1038['define']('VtigerField',attributes,{'tableName':_0xdc6e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdf19=['define','VtigerField','int_vtiger_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xd69a4c,_0x38eca1){var _0x5e2fe4=function(_0x133401){while(--_0x133401){_0xd69a4c['push'](_0xd69a4c['shift']());}};_0x5e2fe4(++_0x38eca1);}(_0xdf19,0x139));var _0x9df1=function(_0x8eb9d,_0x320ee6){_0x8eb9d=_0x8eb9d-0x0;var _0x28c28=_0xdf19[_0x8eb9d];return _0x28c28;};'use strict';var _=require(_0x9df1('0x0'));var util=require(_0x9df1('0x1'));var logger=require(_0x9df1('0x2'))(_0x9df1('0x3'));var moment=require(_0x9df1('0x4'));var BPromise=require(_0x9df1('0x5'));var rp=require(_0x9df1('0x6'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x23efb1,_0x21be52){return _0x23efb1[_0x9df1('0x7')](_0x9df1('0x8'),attributes,{'tableName':_0x9df1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 632787b..796a7d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe844=['code','message','info','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x22ac6f,_0x44dcfc){var _0x1c3780=function(_0x5358bc){while(--_0x5358bc){_0x22ac6f['push'](_0x22ac6f['shift']());}};_0x1c3780(++_0x44dcfc);}(_0xe844,0xad));var _0x4e84=function(_0x3b9afd,_0x5c04ff){_0x3b9afd=_0x3b9afd-0x0;var _0x1cede9=_0xe844[_0x3b9afd];return _0x1cede9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4e84('0x0'));var BPromise=require(_0x4e84('0x1'));var rs=require(_0x4e84('0x2'));var fs=require('fs');var db=require(_0x4e84('0x3'))['db'];var utils=require(_0x4e84('0x4'));var logger=require(_0x4e84('0x5'))(_0x4e84('0x6'));var config=require(_0x4e84('0x7'));var jayson=require(_0x4e84('0x8'));var client=jayson['client'][_0x4e84('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49451b,_0x57616d,_0xb1af4f){return new BPromise(function(_0xbd6858,_0x3651c1){return client[_0x4e84('0xa')](_0x49451b,_0xb1af4f)[_0x4e84('0xb')](function(_0x5d61cc){logger['info'](_0x4e84('0xc'),_0x57616d,_0x4e84('0xd'));logger['debug']('VtigerField,\x20%s,\x20%s,\x20%s',_0x57616d,_0x4e84('0xd'),JSON[_0x4e84('0xe')](_0x5d61cc));if(_0x5d61cc[_0x4e84('0xf')]){if(_0x5d61cc[_0x4e84('0xf')][_0x4e84('0x10')]===0x1f4){logger[_0x4e84('0xf')](_0x4e84('0xc'),_0x57616d,_0x5d61cc[_0x4e84('0xf')]['message']);return _0x3651c1(_0x5d61cc['error'][_0x4e84('0x11')]);}logger[_0x4e84('0xf')]('VtigerField,\x20%s,\x20%s',_0x57616d,_0x5d61cc['error'][_0x4e84('0x11')]);return _0xbd6858(_0x5d61cc['error'][_0x4e84('0x11')]);}else{logger[_0x4e84('0x12')](_0x4e84('0xc'),_0x57616d,'request\x20sent');_0xbd6858(_0x5d61cc[_0x4e84('0x13')][_0x4e84('0x11')]);}})[_0x4e84('0x14')](function(_0x17ef31){logger[_0x4e84('0xf')](_0x4e84('0xc'),_0x57616d,_0x17ef31);_0x3651c1(_0x17ef31);});});}
\ No newline at end of file
+var _0xd67b=['../../config/logger','rpc','http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x41ed25,_0xa17e95){var _0x2ad25e=function(_0x48fab3){while(--_0x48fab3){_0x41ed25['push'](_0x41ed25['shift']());}};_0x2ad25e(++_0xa17e95);}(_0xd67b,0x14e));var _0xbd67=function(_0x111fd3,_0x4f35e5){_0x111fd3=_0x111fd3-0x0;var _0x256068=_0xd67b[_0x111fd3];return _0x256068;};'use strict';var _=require(_0xbd67('0x0'));var util=require(_0xbd67('0x1'));var moment=require(_0xbd67('0x2'));var BPromise=require(_0xbd67('0x3'));var rs=require('randomstring');var fs=require('fs');var db=require(_0xbd67('0x4'))['db'];var utils=require(_0xbd67('0x5'));var logger=require(_0xbd67('0x6'))(_0xbd67('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbd67('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19d48f,_0x5d1d82,_0x1c8326){return new BPromise(function(_0x2a7b3e,_0x176c0c){return client['request'](_0x19d48f,_0x1c8326)[_0xbd67('0x9')](function(_0x322f13){logger[_0xbd67('0xa')](_0xbd67('0xb'),_0x5d1d82,_0xbd67('0xc'));logger[_0xbd67('0xd')](_0xbd67('0xe'),_0x5d1d82,_0xbd67('0xc'),JSON['stringify'](_0x322f13));if(_0x322f13[_0xbd67('0xf')]){if(_0x322f13['error'][_0xbd67('0x10')]===0x1f4){logger['error'](_0xbd67('0xb'),_0x5d1d82,_0x322f13['error'][_0xbd67('0x11')]);return _0x176c0c(_0x322f13[_0xbd67('0xf')][_0xbd67('0x11')]);}logger[_0xbd67('0xf')]('VtigerField,\x20%s,\x20%s',_0x5d1d82,_0x322f13[_0xbd67('0xf')]['message']);return _0x2a7b3e(_0x322f13['error'][_0xbd67('0x11')]);}else{logger[_0xbd67('0xa')](_0xbd67('0xb'),_0x5d1d82,_0xbd67('0xc'));_0x2a7b3e(_0x322f13[_0xbd67('0x12')][_0xbd67('0x11')]);}})[_0xbd67('0x13')](function(_0x2810cb){logger['error']('VtigerField,\x20%s,\x20%s',_0x5d1d82,_0x2810cb);_0x176c0c(_0x2810cb);});});}
\ No newline at end of file
index 4e016e6..86a9979 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0b3=['post','create','addConfiguration','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','getFields'];(function(_0x5d52ca,_0x3fff2a){var _0x54eab4=function(_0x114123){while(--_0x114123){_0x5d52ca['push'](_0x5d52ca['shift']());}};_0x54eab4(++_0x3fff2a);}(_0xb0b3,0x1bf));var _0x3b0b=function(_0x22e756,_0x491934){_0x22e756=_0x22e756-0x0;var _0xb3990d=_0xb0b3[_0x22e756];return _0xb3990d;};'use strict';var multer=require(_0x3b0b('0x0'));var util=require(_0x3b0b('0x1'));var path=require(_0x3b0b('0x2'));var express=require(_0x3b0b('0x3'));var router=express[_0x3b0b('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x3b0b('0x5'));var config=require(_0x3b0b('0x6'));var controller=require('./intZendeskAccount.controller');router[_0x3b0b('0x7')]('/',auth[_0x3b0b('0x8')](),controller['index']);router['get'](_0x3b0b('0x9'),auth['isAuthenticated'](),controller[_0x3b0b('0xa')]);router[_0x3b0b('0x7')](_0x3b0b('0xb'),auth[_0x3b0b('0x8')](),controller['getConfigurations']);router[_0x3b0b('0x7')]('/:id/fields',auth[_0x3b0b('0x8')](),controller[_0x3b0b('0xc')]);router[_0x3b0b('0xd')]('/',auth['isAuthenticated'](),controller[_0x3b0b('0xe')]);router['post'](_0x3b0b('0xb'),auth[_0x3b0b('0x8')](),controller[_0x3b0b('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3b0b('0x10')]);router[_0x3b0b('0x11')](_0x3b0b('0x9'),auth['isAuthenticated'](),controller[_0x3b0b('0x12')]);module[_0x3b0b('0x13')]=router;
\ No newline at end of file
+var _0x85e6=['exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','get','/:id','/:id/configurations','getConfigurations','post','create','addConfiguration','put','update','delete','destroy'];(function(_0x47f7a9,_0x55cd6b){var _0x17b4ea=function(_0x43d151){while(--_0x43d151){_0x47f7a9['push'](_0x47f7a9['shift']());}};_0x17b4ea(++_0x55cd6b);}(_0x85e6,0x1a5));var _0x685e=function(_0x45676d,_0x2172a8){_0x45676d=_0x45676d-0x0;var _0x4537a7=_0x85e6[_0x45676d];return _0x4537a7;};'use strict';var multer=require(_0x685e('0x0'));var util=require(_0x685e('0x1'));var path=require('path');var express=require(_0x685e('0x2'));var router=express[_0x685e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x685e('0x4'));var config=require(_0x685e('0x5'));var controller=require(_0x685e('0x6'));router['get']('/',auth[_0x685e('0x7')](),controller['index']);router[_0x685e('0x8')](_0x685e('0x9'),auth[_0x685e('0x7')](),controller['show']);router[_0x685e('0x8')](_0x685e('0xa'),auth[_0x685e('0x7')](),controller[_0x685e('0xb')]);router[_0x685e('0x8')]('/:id/fields',auth[_0x685e('0x7')](),controller['getFields']);router[_0x685e('0xc')]('/',auth['isAuthenticated'](),controller[_0x685e('0xd')]);router[_0x685e('0xc')](_0x685e('0xa'),auth[_0x685e('0x7')](),controller[_0x685e('0xe')]);router[_0x685e('0xf')](_0x685e('0x9'),auth[_0x685e('0x7')](),controller[_0x685e('0x10')]);router[_0x685e('0x11')](_0x685e('0x9'),auth[_0x685e('0x7')](),controller[_0x685e('0x12')]);module[_0x685e('0x13')]=router;
\ No newline at end of file
index bac2f6d..6964b4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47aa=['ENUM','password','token','integrationTab','newTab','sequelize','exports','STRING','remoteUri'];(function(_0x16d3c7,_0x82a2c4){var _0x1f6edc=function(_0x3719a8){while(--_0x3719a8){_0x16d3c7['push'](_0x16d3c7['shift']());}};_0x1f6edc(++_0x82a2c4);}(_0x47aa,0x9e));var _0xa47a=function(_0x596099,_0x2ee264){_0x596099=_0x596099-0x0;var _0x3e9d48=_0x47aa[_0x596099];return _0x3e9d48;};'use strict';var Sequelize=require(_0xa47a('0x0'));module[_0xa47a('0x1')]={'name':{'type':Sequelize[_0xa47a('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa47a('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xa47a('0x2')]},'token':{'type':Sequelize[_0xa47a('0x2')]},'remoteUri':{'type':Sequelize[_0xa47a('0x2')],'unique':_0xa47a('0x3')},'authType':{'type':Sequelize[_0xa47a('0x4')](_0xa47a('0x5'),_0xa47a('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0xa47a('0x2')]},'type':{'type':Sequelize['ENUM'](_0xa47a('0x7'),_0xa47a('0x8')),'defaultValue':_0xa47a('0x7')}};
\ No newline at end of file
+var _0x98f9=['exports','STRING','username','remoteUri','ENUM','integrationTab','newTab'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0x98f9,0x150));var _0x998f=function(_0x388d3f,_0x42bf44){_0x388d3f=_0x388d3f-0x0;var _0x306e32=_0x98f9[_0x388d3f];return _0x306e32;};'use strict';var Sequelize=require('sequelize');module[_0x998f('0x0')]={'name':{'type':Sequelize[_0x998f('0x1')]},'description':{'type':Sequelize[_0x998f('0x1')]},'username':{'type':Sequelize[_0x998f('0x1')],'unique':_0x998f('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x998f('0x1')]},'remoteUri':{'type':Sequelize[_0x998f('0x1')],'unique':_0x998f('0x3')},'authType':{'type':Sequelize['ENUM']('password','token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x998f('0x1')]},'type':{'type':Sequelize[_0x998f('0x4')](_0x998f('0x5'),_0x998f('0x6')),'defaultValue':_0x998f('0x5')}};
\ No newline at end of file
index eb69ad3..f280db4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65b3=['index','ZendeskAccount','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','add','day','merge','filter','options','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','addConfiguration','findOne','AccountId','getSubjects','channel','type','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','Subjects','getFields','username','password','GET','format','%s%s','remoteUri','ticket_fields','headers','Basic\x20%s','toString','base64','token','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','includes','map','position','system_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','zip-dir','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','save','update','stack','name','send'];(function(_0x401ccd,_0x140815){var _0x5a57ad=function(_0x8ad698){while(--_0x8ad698){_0x401ccd['push'](_0x401ccd['shift']());}};_0x5a57ad(++_0x140815);}(_0x65b3,0x13a));var _0x365b=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0x65b3[_0x211fef];return _0x5447bf;};'use strict';var pdf=require(_0x365b('0x0'));var emlformat=require(_0x365b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x365b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x365b('0x3'));var Mustache=require('mustache');var util=require(_0x365b('0x4'));var path=require('path');var sox=require(_0x365b('0x5'));var csv=require(_0x365b('0x6'));var ejs=require(_0x365b('0x7'));var fs=require('fs');var _=require(_0x365b('0x8'));var squel=require('squel');var crypto=require(_0x365b('0x9'));var jsforce=require(_0x365b('0xa'));var deskjs=require(_0x365b('0xb'));var toCsv=require(_0x365b('0x6'));var querystring=require(_0x365b('0xc'));var Papa=require('papaparse');var qs=require('../../components/parsers/qs');var logger=require(_0x365b('0xd'))(_0x365b('0xe'));var utils=require(_0x365b('0xf'));var config=require(_0x365b('0x10'));var db=require('../../mysqldb')['db'];var integrations=require(_0x365b('0x11'));var jayson=require(_0x365b('0x12'));var client=jayson[_0x365b('0x13')][_0x365b('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x4d0570,_0x1c5c43,_0x487082,_0x4940b7){return new BPromise(function(_0x564c95,_0x3e283d){var _0x44f688=_0x4940b7||client;return _0x44f688[_0x365b('0x15')](_0x4d0570,_0x487082)[_0x365b('0x16')](function(_0x50623c){logger['info'](_0x365b('0x17'),_0x1c5c43,'request\x20sent');logger[_0x365b('0x18')](_0x365b('0x19'),_0x1c5c43,_0x365b('0x1a'),JSON[_0x365b('0x1b')](_0x50623c));if(_0x50623c[_0x365b('0x1c')]){if(_0x50623c['error'][_0x365b('0x1d')]===0x1f4){logger[_0x365b('0x1c')](_0x365b('0x17'),_0x1c5c43,_0x50623c[_0x365b('0x1c')][_0x365b('0x1e')]);return _0x3e283d(_0x50623c[_0x365b('0x1c')][_0x365b('0x1e')]);}logger[_0x365b('0x1c')](_0x365b('0x17'),_0x1c5c43,_0x50623c[_0x365b('0x1c')][_0x365b('0x1e')]);return _0x564c95(_0x50623c['error'][_0x365b('0x1e')]);}else{logger['info'](_0x365b('0x17'),_0x1c5c43,_0x365b('0x1a'));_0x564c95(_0x50623c[_0x365b('0x1f')][_0x365b('0x1e')]);}})[_0x365b('0x20')](function(_0x4652d1){logger[_0x365b('0x1c')]('ZendeskAccount,\x20%s,\x20%s',_0x1c5c43,_0x4652d1);_0x3e283d(_0x4652d1);});});}function respondWithStatusCode(_0x318512,_0x4f2f9d){_0x4f2f9d=_0x4f2f9d||0xcc;return function(_0x59f4cb){if(_0x59f4cb){return _0x318512[_0x365b('0x21')](_0x4f2f9d);}return _0x318512[_0x365b('0x22')](_0x4f2f9d)[_0x365b('0x23')]();};}function respondWithResult(_0x5ebb90,_0x32ca1c){_0x32ca1c=_0x32ca1c||0xc8;return function(_0x5c4a89){if(_0x5c4a89){return _0x5ebb90[_0x365b('0x22')](_0x32ca1c)[_0x365b('0x24')](_0x5c4a89);}};}function respondWithFilteredResult(_0xaffa08,_0x510546){return function(_0x1e6609){if(_0x1e6609){var _0x275dda=_0x1e6609[_0x365b('0x25')],_0x582690=_0x510546[_0x365b('0x26')],_0x186a66=_0x510546[_0x365b('0x26')]+_0x510546['limit'],_0x555a27;if(_0x186a66>=_0x275dda){_0x186a66=_0x275dda;_0x555a27=0xc8;}else{_0x555a27=0xce;}_0xaffa08['status'](_0x555a27);return _0xaffa08[_0x365b('0x27')](_0x365b('0x28'),_0x582690+'-'+_0x186a66+'/'+_0x275dda)[_0x365b('0x24')](_0x1e6609);}return null;};}function patchUpdates(_0x3efe0a){return function(_0x405b2d){try{jsonpatch['apply'](_0x405b2d,_0x3efe0a,!![]);}catch(_0x17761d){return BPromise['reject'](_0x17761d);}return _0x405b2d[_0x365b('0x29')]();};}function saveUpdates(_0x40ce27,_0x5a823b){return function(_0x295fe0){if(_0x295fe0){return _0x295fe0[_0x365b('0x2a')](_0x40ce27)[_0x365b('0x16')](function(_0x585a69){return _0x585a69;});}return null;};}function removeEntity(_0x4985fc,_0x293bec){return function(_0x273f52){if(_0x273f52){return _0x273f52['destroy']()[_0x365b('0x16')](function(){_0x4985fc[_0x365b('0x22')](0xcc)[_0x365b('0x23')]();});}};}function handleEntityNotFound(_0x16ee1b,_0x41a126){return function(_0x4a832b){if(!_0x4a832b){_0x16ee1b[_0x365b('0x21')](0x194);}return _0x4a832b;};}function handleError(_0x5d7a20,_0x385147){_0x385147=_0x385147||0x1f4;return function(_0xc7d7ab){logger[_0x365b('0x1c')](_0xc7d7ab[_0x365b('0x2b')]);if(_0xc7d7ab[_0x365b('0x2c')]){delete _0xc7d7ab[_0x365b('0x2c')];}_0x5d7a20[_0x365b('0x22')](_0x385147)[_0x365b('0x2d')](_0xc7d7ab);};}exports[_0x365b('0x2e')]=function(_0x22bbf6,_0x2d9daf){var _0x8ae28c={},_0x480276={},_0x60933b={'count':0x0,'rows':[]};var _0x26a3d7=db[_0x365b('0x2f')][_0x365b('0x30')];_0x480276[_0x365b('0x31')]=_[_0x365b('0x32')](_0x26a3d7);var _0x45ffc0={'dateStart':_0x22bbf6[_0x365b('0x33')][_0x365b('0x34')],'dateEnd':_0x22bbf6[_0x365b('0x33')][_0x365b('0x35')]};delete _0x22bbf6['query'][_0x365b('0x34')];delete _0x22bbf6[_0x365b('0x33')][_0x365b('0x35')];_0x480276[_0x365b('0x33')]=_[_0x365b('0x32')](_0x22bbf6['query']);_0x480276[_0x365b('0x36')]=_[_0x365b('0x37')](_0x480276[_0x365b('0x31')],_0x480276[_0x365b('0x33')]);_0x8ae28c[_0x365b('0x38')]=_[_0x365b('0x37')](_0x480276[_0x365b('0x31')],qs[_0x365b('0x39')](_0x22bbf6[_0x365b('0x33')][_0x365b('0x39')]));_0x8ae28c[_0x365b('0x38')]=_0x8ae28c['attributes'][_0x365b('0x3a')]?_0x8ae28c[_0x365b('0x38')]:_0x480276['model'];if(!_0x22bbf6[_0x365b('0x33')][_0x365b('0x3b')](_0x365b('0x3c'))){_0x8ae28c[_0x365b('0x3d')]=qs[_0x365b('0x3d')](_0x22bbf6[_0x365b('0x33')][_0x365b('0x3d')]);_0x8ae28c[_0x365b('0x26')]=qs[_0x365b('0x26')](_0x22bbf6[_0x365b('0x33')][_0x365b('0x26')]);}_0x8ae28c[_0x365b('0x3e')]=qs[_0x365b('0x3f')](_0x22bbf6[_0x365b('0x33')]['sort']);_0x8ae28c[_0x365b('0x40')]=qs[_0x365b('0x36')](_[_0x365b('0x41')](_0x22bbf6[_0x365b('0x33')],_0x480276[_0x365b('0x36')]));if(_0x45ffc0['dateStart']){if(_0x45ffc0[_0x365b('0x35')]){_0x45ffc0[_0x365b('0x35')]=moment(_0x45ffc0[_0x365b('0x35')])[_0x365b('0x42')](0x1,_0x365b('0x43'));}else{_0x45ffc0['dateEnd']=moment(_0x45ffc0['dateStart'])[_0x365b('0x42')](0x1,_0x365b('0x43'));}_[_0x365b('0x44')](_0x8ae28c['where'],{'createdAt':{'$gte':_0x45ffc0['dateStart'],'$lte':_0x45ffc0[_0x365b('0x35')]}});}if(_0x22bbf6['query'][_0x365b('0x45')]){_0x8ae28c[_0x365b('0x40')]=_[_0x365b('0x44')](_0x8ae28c[_0x365b('0x40')],{'$or':_['map'](_0x8ae28c[_0x365b('0x38')],function(_0x359d36){var _0x7b82d2={};_0x7b82d2[_0x359d36]={'$like':'%'+_0x22bbf6['query']['filter']+'%'};return _0x7b82d2;})});}_0x8ae28c=_['merge']({},_0x8ae28c,_0x22bbf6[_0x365b('0x46')]);var _0x3839a2={'where':_0x8ae28c['where']};return db[_0x365b('0x2f')][_0x365b('0x25')](_0x3839a2)[_0x365b('0x16')](function(_0x6b565d){_0x60933b[_0x365b('0x25')]=_0x6b565d;if(_0x22bbf6[_0x365b('0x33')][_0x365b('0x47')]){_0x8ae28c[_0x365b('0x48')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x365b('0x49')](_0x8ae28c);})[_0x365b('0x16')](function(_0x202f83){_0x60933b[_0x365b('0x4a')]=_0x202f83;return _0x60933b;})[_0x365b('0x16')](respondWithFilteredResult(_0x2d9daf,_0x8ae28c))[_0x365b('0x20')](handleError(_0x2d9daf,null));};exports[_0x365b('0x4b')]=function(_0x219a57,_0x13eb89){var _0x3ed2ee={'raw':![],'where':{'id':_0x219a57[_0x365b('0x4c')]['id']}},_0x598e3e={};_0x598e3e[_0x365b('0x31')]=_[_0x365b('0x32')](db[_0x365b('0x2f')]['rawAttributes']);_0x598e3e[_0x365b('0x33')]=_[_0x365b('0x32')](_0x219a57['query']);_0x598e3e['filters']=_['intersection'](_0x598e3e[_0x365b('0x31')],_0x598e3e[_0x365b('0x33')]);_0x3ed2ee['attributes']=_[_0x365b('0x37')](_0x598e3e[_0x365b('0x31')],qs['fields'](_0x219a57['query'][_0x365b('0x39')]));_0x3ed2ee[_0x365b('0x38')]=_0x3ed2ee[_0x365b('0x38')]['length']?_0x3ed2ee[_0x365b('0x38')]:_0x598e3e[_0x365b('0x31')];if(_0x219a57[_0x365b('0x33')][_0x365b('0x47')]){_0x3ed2ee[_0x365b('0x48')]=[{'all':!![]}];}_0x3ed2ee=_[_0x365b('0x44')]({},_0x3ed2ee,_0x219a57[_0x365b('0x46')]);return db[_0x365b('0x2f')][_0x365b('0x4d')](_0x3ed2ee)[_0x365b('0x16')](handleEntityNotFound(_0x13eb89,null))['then'](respondWithResult(_0x13eb89,null))[_0x365b('0x20')](handleError(_0x13eb89,null));};exports['create']=function(_0x1082e8,_0x255d75){return db[_0x365b('0x2f')][_0x365b('0x4e')](_0x1082e8['body'],{})[_0x365b('0x16')](respondWithResult(_0x255d75,0xc9))[_0x365b('0x20')](handleError(_0x255d75,null));};exports['update']=function(_0x566513,_0x5c3538){if(_0x566513[_0x365b('0x4f')]['id']){delete _0x566513[_0x365b('0x4f')]['id'];}return db[_0x365b('0x2f')][_0x365b('0x4d')]({'where':{'id':_0x566513[_0x365b('0x4c')]['id']}})[_0x365b('0x16')](handleEntityNotFound(_0x5c3538,null))[_0x365b('0x16')](saveUpdates(_0x566513[_0x365b('0x4f')],null))[_0x365b('0x16')](respondWithResult(_0x5c3538,null))['catch'](handleError(_0x5c3538,null));};exports['destroy']=function(_0x192bb6,_0x41175c){return db[_0x365b('0x2f')]['find']({'where':{'id':_0x192bb6[_0x365b('0x4c')]['id']}})[_0x365b('0x16')](handleEntityNotFound(_0x41175c,null))[_0x365b('0x16')](removeEntity(_0x41175c,null))['catch'](handleError(_0x41175c,null));};exports['getConfigurations']=function(_0x537a97,_0x558f2a,_0x20dab8){var _0x42a298={};var _0x3994a3={};var _0xe55d;var _0x5c0dfe;return db[_0x365b('0x2f')]['findOne']({'where':{'id':_0x537a97[_0x365b('0x4c')]['id']}})[_0x365b('0x16')](handleEntityNotFound(_0x558f2a,null))[_0x365b('0x16')](function(_0x368b92){if(_0x368b92){_0xe55d=_0x368b92;_0x3994a3[_0x365b('0x31')]=_['keys'](db['ZendeskConfiguration']['rawAttributes']);_0x3994a3[_0x365b('0x33')]=_[_0x365b('0x32')](_0x537a97[_0x365b('0x33')]);_0x3994a3[_0x365b('0x36')]=_['intersection'](_0x3994a3[_0x365b('0x31')],_0x3994a3['query']);_0x42a298['attributes']=_[_0x365b('0x37')](_0x3994a3[_0x365b('0x31')],qs[_0x365b('0x39')](_0x537a97['query'][_0x365b('0x39')]));_0x42a298['attributes']=_0x42a298['attributes']['length']?_0x42a298[_0x365b('0x38')]:_0x3994a3[_0x365b('0x31')];_0x42a298[_0x365b('0x3e')]=qs[_0x365b('0x3f')](_0x537a97['query'][_0x365b('0x3f')]);_0x42a298['where']=qs[_0x365b('0x36')](_[_0x365b('0x41')](_0x537a97[_0x365b('0x33')],_0x3994a3['filters']));if(_0x537a97[_0x365b('0x33')][_0x365b('0x45')]){_0x42a298[_0x365b('0x40')]=_[_0x365b('0x44')](_0x42a298[_0x365b('0x40')],{'$or':_['map'](_0x42a298['attributes'],function(_0x32fa8a){var _0x5370da={};_0x5370da[_0x32fa8a]={'$like':'%'+_0x537a97[_0x365b('0x33')][_0x365b('0x45')]+'%'};return _0x5370da;})});}_0x42a298=_[_0x365b('0x44')]({},_0x42a298,_0x537a97[_0x365b('0x46')]);return _0xe55d[_0x365b('0x50')](_0x42a298);}})[_0x365b('0x16')](function(_0x23f5b5){if(_0x23f5b5){_0x5c0dfe=_0x23f5b5[_0x365b('0x3a')];if(!_0x537a97[_0x365b('0x33')][_0x365b('0x3b')](_0x365b('0x3c'))){_0x42a298['limit']=qs['limit'](_0x537a97[_0x365b('0x33')][_0x365b('0x3d')]);_0x42a298[_0x365b('0x26')]=qs[_0x365b('0x26')](_0x537a97['query'][_0x365b('0x26')]);}return _0xe55d[_0x365b('0x50')](_0x42a298);}})[_0x365b('0x16')](function(_0xc197f1){if(_0xc197f1){return _0xc197f1?{'count':_0x5c0dfe,'rows':_0xc197f1}:null;}})['then'](respondWithResult(_0x558f2a,null))[_0x365b('0x20')](handleError(_0x558f2a,null));};exports[_0x365b('0x51')]=function(_0x5e4ecf,_0x54b322,_0x1a0317){if(_0x5e4ecf[_0x365b('0x4f')]['id']){delete _0x5e4ecf['body']['id'];}return db[_0x365b('0x2f')][_0x365b('0x52')]({'where':{'id':_0x5e4ecf['params']['id']}})['then'](handleEntityNotFound(_0x54b322,null))[_0x365b('0x16')](function(_0x324cb6){if(_0x324cb6){_0x5e4ecf[_0x365b('0x4f')][_0x365b('0x53')]=_0x324cb6['id'];_0x5e4ecf[_0x365b('0x4f')]['Subjects']=integrations[_0x365b('0x54')](_0x5e4ecf['body'][_0x365b('0x55')],_0x5e4ecf[_0x365b('0x4f')][_0x365b('0x56')]);_0x5e4ecf[_0x365b('0x4f')][_0x365b('0x57')]=integrations[_0x365b('0x58')](_0x5e4ecf['body'][_0x365b('0x55')],_0x5e4ecf[_0x365b('0x4f')][_0x365b('0x56')]);return db[_0x365b('0x59')]['create'](_0x5e4ecf[_0x365b('0x4f')],{'include':[{'model':db[_0x365b('0x5a')],'as':_0x365b('0x5b')},{'model':db[_0x365b('0x5a')],'as':_0x365b('0x57')}]});}return null;})[_0x365b('0x16')](respondWithResult(_0x54b322,null))['catch'](handleError(_0x54b322,null));};exports[_0x365b('0x5c')]=function(_0x543b10,_0x30cb71,_0x558905){return db[_0x365b('0x2f')][_0x365b('0x52')]({'where':{'id':_0x543b10['params']['id']},'attributes':['id',_0x365b('0x5d'),_0x365b('0x5e'),'token','authType','remoteUri']})[_0x365b('0x16')](handleEntityNotFound(_0x30cb71,null))[_0x365b('0x16')](function(_0x2a474c){if(_0x2a474c){var _0x5e78e4={'method':_0x365b('0x5f'),'uri':util[_0x365b('0x60')](_0x365b('0x61'),_0x2a474c[_0x365b('0x62')],_0x365b('0x63')),'json':!![]};switch(_0x2a474c['authType']){case'password':_0x5e78e4[_0x365b('0x64')]={'Authorization':util['format'](_0x365b('0x65'),new Buffer(util[_0x365b('0x60')]('%s:%s',_0x2a474c[_0x365b('0x5d')],_0x2a474c['password']))[_0x365b('0x66')](_0x365b('0x67')))};break;case _0x365b('0x68'):_0x5e78e4[_0x365b('0x64')]={'Authorization':util[_0x365b('0x60')](_0x365b('0x65'),new Buffer(util[_0x365b('0x60')](_0x365b('0x69'),_0x2a474c['username'],_0x2a474c[_0x365b('0x68')]))[_0x365b('0x66')](_0x365b('0x67')))};break;default:throw new db[(_0x365b('0x6a'))][(_0x365b('0x6b'))](_0x365b('0x6c'));}return rp(_0x5e78e4);}})[_0x365b('0x16')](function(_0x2af127){if(_0x2af127){var _0x407f54=[_0x365b('0x6d'),_0x365b('0x6e'),_0x365b('0x6f'),_0x365b('0x70')];_['remove'](_0x2af127[_0x365b('0x63')],function(_0x3c48f5){return _0x407f54[_0x365b('0x71')](_0x3c48f5[_0x365b('0x56')]);});return{'count':_0x2af127[_0x365b('0x63')]['length'],'rows':_[_0x365b('0x72')](_0x2af127[_0x365b('0x63')],function(_0x59ba70){return{'id':_0x59ba70['id'],'name':_0x59ba70[_0x365b('0x73')]>0x7?_0x59ba70['title']:_0x59ba70[_0x365b('0x56')],'custom':_0x59ba70[_0x365b('0x73')]>0x7?!![]:![],'options':_0x59ba70['system_field_options']?_0x59ba70[_0x365b('0x74')]:[]};})};}})[_0x365b('0x16')](respondWithResult(_0x30cb71,null))[_0x365b('0x20')](function(_0x4b282c){var _0x151966=_0x543b10[_0x365b('0x33')][_0x365b('0x75')]?0x1f4:_0x4b282c[_0x365b('0x76')]||0x1f4;logger[_0x365b('0x1c')](_0x365b('0x77'),_0x365b('0x5c'),_0x151966,JSON[_0x365b('0x1b')](_0x4b282c));delete _0x4b282c[_0x365b('0x2c')];if(_0x151966===0x191){_0x151966=0x190;}_0x30cb71[_0x365b('0x22')](_0x151966)[_0x365b('0x2d')](_0x543b10['query'][_0x365b('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0x4b282c[_0x365b('0x76')]}:_0x4b282c);});};
\ No newline at end of file
+var _0x24d8=['system_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','client','http','request','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','count','offset','limit','apply','reject','save','then','name','send','ZendeskAccount','rawAttributes','query','dateStart','dateEnd','intersection','model','attributes','fields','length','nolimit','order','sort','filters','pick','add','day','merge','where','filter','map','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','update','destroy','getConfigurations','ZendeskConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','remoteUri','GET','%s%s','ticket_fields','authType','headers','format','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','Unknown\x20authentication\x20type','description','group','assignee','includes','type','title','position'];(function(_0x35d214,_0x146b61){var _0x4f3003=function(_0x42047a){while(--_0x42047a){_0x35d214['push'](_0x35d214['shift']());}};_0x4f3003(++_0x146b61);}(_0x24d8,0x7f));var _0x824d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x24d8[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x824d('0x0'));var emlformat=require(_0x824d('0x1'));var rimraf=require(_0x824d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x824d('0x3'));var rp=require(_0x824d('0x4'));var moment=require(_0x824d('0x5'));var BPromise=require(_0x824d('0x6'));var Mustache=require(_0x824d('0x7'));var util=require('util');var path=require('path');var sox=require(_0x824d('0x8'));var csv=require(_0x824d('0x9'));var ejs=require(_0x824d('0xa'));var fs=require('fs');var _=require(_0x824d('0xb'));var squel=require(_0x824d('0xc'));var crypto=require(_0x824d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x824d('0xe'));var toCsv=require(_0x824d('0x9'));var querystring=require(_0x824d('0xf'));var Papa=require(_0x824d('0x10'));var qs=require(_0x824d('0x11'));var logger=require(_0x824d('0x12'))(_0x824d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x824d('0x14'))['db'];var integrations=require(_0x824d('0x15'));var jayson=require('jayson/promise');var client=jayson[_0x824d('0x16')][_0x824d('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x364867,_0x2f9cf2,_0x25bfa7,_0xe72435){return new BPromise(function(_0x45c26a,_0x3068cf){var _0x4a4a4c=_0xe72435||client;return _0x4a4a4c[_0x824d('0x18')](_0x364867,_0x25bfa7)['then'](function(_0x10acc5){logger[_0x824d('0x19')]('ZendeskAccount,\x20%s,\x20%s',_0x2f9cf2,_0x824d('0x1a'));logger[_0x824d('0x1b')](_0x824d('0x1c'),_0x2f9cf2,'request\x20sent',JSON[_0x824d('0x1d')](_0x10acc5));if(_0x10acc5[_0x824d('0x1e')]){if(_0x10acc5['error'][_0x824d('0x1f')]===0x1f4){logger[_0x824d('0x1e')](_0x824d('0x20'),_0x2f9cf2,_0x10acc5[_0x824d('0x1e')][_0x824d('0x21')]);return _0x3068cf(_0x10acc5['error'][_0x824d('0x21')]);}logger['error'](_0x824d('0x20'),_0x2f9cf2,_0x10acc5[_0x824d('0x1e')]['message']);return _0x45c26a(_0x10acc5[_0x824d('0x1e')]['message']);}else{logger['info'](_0x824d('0x20'),_0x2f9cf2,'request\x20sent');_0x45c26a(_0x10acc5['result'][_0x824d('0x21')]);}})[_0x824d('0x22')](function(_0x58854b){logger['error'](_0x824d('0x20'),_0x2f9cf2,_0x58854b);_0x3068cf(_0x58854b);});});}function respondWithStatusCode(_0x685117,_0x5dda03){_0x5dda03=_0x5dda03||0xcc;return function(_0x455e34){if(_0x455e34){return _0x685117[_0x824d('0x23')](_0x5dda03);}return _0x685117[_0x824d('0x24')](_0x5dda03)[_0x824d('0x25')]();};}function respondWithResult(_0x41c59c,_0x8fa016){_0x8fa016=_0x8fa016||0xc8;return function(_0x1595a1){if(_0x1595a1){return _0x41c59c[_0x824d('0x24')](_0x8fa016)[_0x824d('0x26')](_0x1595a1);}};}function respondWithFilteredResult(_0x28fad3,_0x1643d5){return function(_0x8950ae){if(_0x8950ae){var _0x19d167=_0x8950ae[_0x824d('0x27')],_0x3f5639=_0x1643d5[_0x824d('0x28')],_0x27abb4=_0x1643d5[_0x824d('0x28')]+_0x1643d5[_0x824d('0x29')],_0x336008;if(_0x27abb4>=_0x19d167){_0x27abb4=_0x19d167;_0x336008=0xc8;}else{_0x336008=0xce;}_0x28fad3['status'](_0x336008);return _0x28fad3['set']('Content-Range',_0x3f5639+'-'+_0x27abb4+'/'+_0x19d167)['json'](_0x8950ae);}return null;};}function patchUpdates(_0x23941e){return function(_0x547ab3){try{jsonpatch[_0x824d('0x2a')](_0x547ab3,_0x23941e,!![]);}catch(_0xccc1e1){return BPromise[_0x824d('0x2b')](_0xccc1e1);}return _0x547ab3[_0x824d('0x2c')]();};}function saveUpdates(_0x3dac08,_0xba626e){return function(_0x29193a){if(_0x29193a){return _0x29193a['update'](_0x3dac08)[_0x824d('0x2d')](function(_0x149ba9){return _0x149ba9;});}return null;};}function removeEntity(_0x15cd57,_0xede47c){return function(_0x475e5a){if(_0x475e5a){return _0x475e5a['destroy']()[_0x824d('0x2d')](function(){_0x15cd57[_0x824d('0x24')](0xcc)[_0x824d('0x25')]();});}};}function handleEntityNotFound(_0xa512a4,_0x1491ed){return function(_0x44bf51){if(!_0x44bf51){_0xa512a4[_0x824d('0x23')](0x194);}return _0x44bf51;};}function handleError(_0x597f45,_0x512178){_0x512178=_0x512178||0x1f4;return function(_0x487097){logger[_0x824d('0x1e')](_0x487097['stack']);if(_0x487097['name']){delete _0x487097[_0x824d('0x2e')];}_0x597f45[_0x824d('0x24')](_0x512178)[_0x824d('0x2f')](_0x487097);};}exports['index']=function(_0xb74265,_0xe11928){var _0x440b={},_0x58408e={},_0x3ece51={'count':0x0,'rows':[]};var _0x40b4b6=db[_0x824d('0x30')][_0x824d('0x31')];_0x58408e['model']=_['keys'](_0x40b4b6);var _0x309e6f={'dateStart':_0xb74265[_0x824d('0x32')][_0x824d('0x33')],'dateEnd':_0xb74265['query'][_0x824d('0x34')]};delete _0xb74265['query'][_0x824d('0x33')];delete _0xb74265[_0x824d('0x32')][_0x824d('0x34')];_0x58408e[_0x824d('0x32')]=_['keys'](_0xb74265[_0x824d('0x32')]);_0x58408e['filters']=_[_0x824d('0x35')](_0x58408e[_0x824d('0x36')],_0x58408e[_0x824d('0x32')]);_0x440b[_0x824d('0x37')]=_[_0x824d('0x35')](_0x58408e[_0x824d('0x36')],qs[_0x824d('0x38')](_0xb74265['query'][_0x824d('0x38')]));_0x440b['attributes']=_0x440b[_0x824d('0x37')][_0x824d('0x39')]?_0x440b[_0x824d('0x37')]:_0x58408e[_0x824d('0x36')];if(!_0xb74265[_0x824d('0x32')]['hasOwnProperty'](_0x824d('0x3a'))){_0x440b[_0x824d('0x29')]=qs[_0x824d('0x29')](_0xb74265[_0x824d('0x32')][_0x824d('0x29')]);_0x440b[_0x824d('0x28')]=qs['offset'](_0xb74265[_0x824d('0x32')][_0x824d('0x28')]);}_0x440b[_0x824d('0x3b')]=qs[_0x824d('0x3c')](_0xb74265[_0x824d('0x32')][_0x824d('0x3c')]);_0x440b['where']=qs[_0x824d('0x3d')](_[_0x824d('0x3e')](_0xb74265[_0x824d('0x32')],_0x58408e['filters']));if(_0x309e6f[_0x824d('0x33')]){if(_0x309e6f['dateEnd']){_0x309e6f[_0x824d('0x34')]=moment(_0x309e6f[_0x824d('0x34')])[_0x824d('0x3f')](0x1,_0x824d('0x40'));}else{_0x309e6f[_0x824d('0x34')]=moment(_0x309e6f[_0x824d('0x33')])[_0x824d('0x3f')](0x1,_0x824d('0x40'));}_[_0x824d('0x41')](_0x440b[_0x824d('0x42')],{'createdAt':{'$gte':_0x309e6f['dateStart'],'$lte':_0x309e6f[_0x824d('0x34')]}});}if(_0xb74265[_0x824d('0x32')][_0x824d('0x43')]){_0x440b['where']=_['merge'](_0x440b[_0x824d('0x42')],{'$or':_[_0x824d('0x44')](_0x440b[_0x824d('0x37')],function(_0x1b868b){var _0x34eafe={};_0x34eafe[_0x1b868b]={'$like':'%'+_0xb74265[_0x824d('0x32')]['filter']+'%'};return _0x34eafe;})});}_0x440b=_[_0x824d('0x41')]({},_0x440b,_0xb74265['options']);var _0x3bf1e3={'where':_0x440b[_0x824d('0x42')]};return db['ZendeskAccount']['count'](_0x3bf1e3)['then'](function(_0x2e754b){_0x3ece51[_0x824d('0x27')]=_0x2e754b;if(_0xb74265['query'][_0x824d('0x45')]){_0x440b[_0x824d('0x46')]=[{'all':!![]}];}return db[_0x824d('0x30')][_0x824d('0x47')](_0x440b);})[_0x824d('0x2d')](function(_0x317934){_0x3ece51[_0x824d('0x48')]=_0x317934;return _0x3ece51;})[_0x824d('0x2d')](respondWithFilteredResult(_0xe11928,_0x440b))['catch'](handleError(_0xe11928,null));};exports[_0x824d('0x49')]=function(_0x34df16,_0x5db985){var _0x5ac402={'raw':![],'where':{'id':_0x34df16[_0x824d('0x4a')]['id']}},_0x4d8800={};_0x4d8800['model']=_[_0x824d('0x4b')](db[_0x824d('0x30')][_0x824d('0x31')]);_0x4d8800[_0x824d('0x32')]=_[_0x824d('0x4b')](_0x34df16['query']);_0x4d8800['filters']=_['intersection'](_0x4d8800[_0x824d('0x36')],_0x4d8800[_0x824d('0x32')]);_0x5ac402[_0x824d('0x37')]=_[_0x824d('0x35')](_0x4d8800[_0x824d('0x36')],qs[_0x824d('0x38')](_0x34df16[_0x824d('0x32')][_0x824d('0x38')]));_0x5ac402[_0x824d('0x37')]=_0x5ac402[_0x824d('0x37')]['length']?_0x5ac402[_0x824d('0x37')]:_0x4d8800[_0x824d('0x36')];if(_0x34df16[_0x824d('0x32')][_0x824d('0x45')]){_0x5ac402['include']=[{'all':!![]}];}_0x5ac402=_['merge']({},_0x5ac402,_0x34df16[_0x824d('0x4c')]);return db[_0x824d('0x30')][_0x824d('0x4d')](_0x5ac402)[_0x824d('0x2d')](handleEntityNotFound(_0x5db985,null))['then'](respondWithResult(_0x5db985,null))[_0x824d('0x22')](handleError(_0x5db985,null));};exports[_0x824d('0x4e')]=function(_0x151c12,_0x1c320a){return db[_0x824d('0x30')]['create'](_0x151c12[_0x824d('0x4f')],{})['then'](respondWithResult(_0x1c320a,0xc9))[_0x824d('0x22')](handleError(_0x1c320a,null));};exports[_0x824d('0x50')]=function(_0xc76535,_0x2d0a07){if(_0xc76535[_0x824d('0x4f')]['id']){delete _0xc76535[_0x824d('0x4f')]['id'];}return db[_0x824d('0x30')][_0x824d('0x4d')]({'where':{'id':_0xc76535['params']['id']}})[_0x824d('0x2d')](handleEntityNotFound(_0x2d0a07,null))['then'](saveUpdates(_0xc76535[_0x824d('0x4f')],null))[_0x824d('0x2d')](respondWithResult(_0x2d0a07,null))[_0x824d('0x22')](handleError(_0x2d0a07,null));};exports[_0x824d('0x51')]=function(_0x351dd8,_0x28f2af){return db[_0x824d('0x30')][_0x824d('0x4d')]({'where':{'id':_0x351dd8['params']['id']}})[_0x824d('0x2d')](handleEntityNotFound(_0x28f2af,null))[_0x824d('0x2d')](removeEntity(_0x28f2af,null))[_0x824d('0x22')](handleError(_0x28f2af,null));};exports[_0x824d('0x52')]=function(_0x2bc39d,_0x1c6a0c,_0x107ce5){var _0x543c47={};var _0x26f24d={};var _0x5bd868;var _0x3b40c5;return db[_0x824d('0x30')]['findOne']({'where':{'id':_0x2bc39d[_0x824d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1c6a0c,null))['then'](function(_0x584cd2){if(_0x584cd2){_0x5bd868=_0x584cd2;_0x26f24d[_0x824d('0x36')]=_['keys'](db[_0x824d('0x53')][_0x824d('0x31')]);_0x26f24d['query']=_[_0x824d('0x4b')](_0x2bc39d[_0x824d('0x32')]);_0x26f24d[_0x824d('0x3d')]=_[_0x824d('0x35')](_0x26f24d[_0x824d('0x36')],_0x26f24d['query']);_0x543c47[_0x824d('0x37')]=_[_0x824d('0x35')](_0x26f24d[_0x824d('0x36')],qs[_0x824d('0x38')](_0x2bc39d[_0x824d('0x32')][_0x824d('0x38')]));_0x543c47['attributes']=_0x543c47[_0x824d('0x37')][_0x824d('0x39')]?_0x543c47['attributes']:_0x26f24d[_0x824d('0x36')];_0x543c47[_0x824d('0x3b')]=qs['sort'](_0x2bc39d[_0x824d('0x32')][_0x824d('0x3c')]);_0x543c47['where']=qs['filters'](_[_0x824d('0x3e')](_0x2bc39d[_0x824d('0x32')],_0x26f24d[_0x824d('0x3d')]));if(_0x2bc39d[_0x824d('0x32')]['filter']){_0x543c47['where']=_[_0x824d('0x41')](_0x543c47[_0x824d('0x42')],{'$or':_[_0x824d('0x44')](_0x543c47[_0x824d('0x37')],function(_0x301b8d){var _0x5150e1={};_0x5150e1[_0x301b8d]={'$like':'%'+_0x2bc39d['query'][_0x824d('0x43')]+'%'};return _0x5150e1;})});}_0x543c47=_[_0x824d('0x41')]({},_0x543c47,_0x2bc39d[_0x824d('0x4c')]);return _0x5bd868[_0x824d('0x52')](_0x543c47);}})[_0x824d('0x2d')](function(_0x10ea42){if(_0x10ea42){_0x3b40c5=_0x10ea42[_0x824d('0x39')];if(!_0x2bc39d[_0x824d('0x32')][_0x824d('0x54')](_0x824d('0x3a'))){_0x543c47[_0x824d('0x29')]=qs[_0x824d('0x29')](_0x2bc39d[_0x824d('0x32')][_0x824d('0x29')]);_0x543c47[_0x824d('0x28')]=qs[_0x824d('0x28')](_0x2bc39d['query']['offset']);}return _0x5bd868[_0x824d('0x52')](_0x543c47);}})['then'](function(_0x55d385){if(_0x55d385){return _0x55d385?{'count':_0x3b40c5,'rows':_0x55d385}:null;}})[_0x824d('0x2d')](respondWithResult(_0x1c6a0c,null))[_0x824d('0x22')](handleError(_0x1c6a0c,null));};exports[_0x824d('0x55')]=function(_0x2be3a1,_0x4db210,_0x372a8f){if(_0x2be3a1[_0x824d('0x4f')]['id']){delete _0x2be3a1[_0x824d('0x4f')]['id'];}return db[_0x824d('0x30')][_0x824d('0x56')]({'where':{'id':_0x2be3a1[_0x824d('0x4a')]['id']}})[_0x824d('0x2d')](handleEntityNotFound(_0x4db210,null))[_0x824d('0x2d')](function(_0xef9acc){if(_0xef9acc){_0x2be3a1[_0x824d('0x4f')][_0x824d('0x57')]=_0xef9acc['id'];_0x2be3a1['body'][_0x824d('0x58')]=integrations[_0x824d('0x59')](_0x2be3a1[_0x824d('0x4f')][_0x824d('0x5a')],_0x2be3a1[_0x824d('0x4f')]['type']);_0x2be3a1['body'][_0x824d('0x5b')]=integrations[_0x824d('0x5c')](_0x2be3a1[_0x824d('0x4f')]['channel'],_0x2be3a1[_0x824d('0x4f')]['type']);return db[_0x824d('0x53')][_0x824d('0x4e')](_0x2be3a1[_0x824d('0x4f')],{'include':[{'model':db[_0x824d('0x5d')],'as':'Subjects'},{'model':db[_0x824d('0x5d')],'as':_0x824d('0x5b')}]});}return null;})[_0x824d('0x2d')](respondWithResult(_0x4db210,null))[_0x824d('0x22')](handleError(_0x4db210,null));};exports[_0x824d('0x5e')]=function(_0x3cbbb0,_0xbdfc39,_0x1fc1f9){return db[_0x824d('0x30')][_0x824d('0x56')]({'where':{'id':_0x3cbbb0['params']['id']},'attributes':['id',_0x824d('0x5f'),_0x824d('0x60'),_0x824d('0x61'),'authType',_0x824d('0x62')]})[_0x824d('0x2d')](handleEntityNotFound(_0xbdfc39,null))[_0x824d('0x2d')](function(_0x541d3b){if(_0x541d3b){var _0x29c652={'method':_0x824d('0x63'),'uri':util['format'](_0x824d('0x64'),_0x541d3b[_0x824d('0x62')],_0x824d('0x65')),'json':!![]};switch(_0x541d3b[_0x824d('0x66')]){case _0x824d('0x60'):_0x29c652[_0x824d('0x67')]={'Authorization':util[_0x824d('0x68')](_0x824d('0x69'),new Buffer(util['format'](_0x824d('0x6a'),_0x541d3b[_0x824d('0x5f')],_0x541d3b[_0x824d('0x60')]))[_0x824d('0x6b')](_0x824d('0x6c')))};break;case'token':_0x29c652['headers']={'Authorization':util['format'](_0x824d('0x69'),new Buffer(util['format'](_0x824d('0x6d'),_0x541d3b[_0x824d('0x5f')],_0x541d3b['token']))[_0x824d('0x6b')](_0x824d('0x6c')))};break;default:throw new db[(_0x824d('0x6e'))]['ValidationError'](_0x824d('0x6f'));}return rp(_0x29c652);}})[_0x824d('0x2d')](function(_0x205340){if(_0x205340){var _0x121f82=['subject',_0x824d('0x70'),_0x824d('0x71'),_0x824d('0x72')];_['remove'](_0x205340[_0x824d('0x65')],function(_0x4e82a2){return _0x121f82[_0x824d('0x73')](_0x4e82a2[_0x824d('0x74')]);});return{'count':_0x205340[_0x824d('0x65')][_0x824d('0x39')],'rows':_[_0x824d('0x44')](_0x205340['ticket_fields'],function(_0x5079c4){return{'id':_0x5079c4['id'],'name':_0x5079c4['position']>0x7?_0x5079c4[_0x824d('0x75')]:_0x5079c4[_0x824d('0x74')],'custom':_0x5079c4[_0x824d('0x76')]>0x7?!![]:![],'options':_0x5079c4[_0x824d('0x77')]?_0x5079c4[_0x824d('0x77')]:[]};})};}})['then'](respondWithResult(_0xbdfc39,null))[_0x824d('0x22')](function(_0x3be816){var _0x8a2095=_0x3cbbb0[_0x824d('0x32')]['test']?0x1f4:_0x3be816[_0x824d('0x78')]||0x1f4;logger[_0x824d('0x1e')](_0x824d('0x79'),_0x824d('0x5e'),_0x8a2095,JSON[_0x824d('0x1d')](_0x3be816));delete _0x3be816[_0x824d('0x2e')];if(_0x8a2095===0x191){_0x8a2095=0x190;}_0xbdfc39['status'](_0x8a2095)[_0x824d('0x2f')](_0x3cbbb0[_0x824d('0x32')]['test']?{'message':_0x824d('0x7a'),'statusCode':_0x3be816[_0x824d('0x78')]}:_0x3be816);});};
\ No newline at end of file
index 7adbf9f..4e29925 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25bd=['exports','define','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x20e555,_0x40aea6){var _0x182077=function(_0x1d0d69){while(--_0x1d0d69){_0x20e555['push'](_0x20e555['shift']());}};_0x182077(++_0x40aea6);}(_0x25bd,0x86));var _0xd25b=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x25bd[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xd25b('0x0'));var util=require('util');var logger=require(_0xd25b('0x1'))(_0xd25b('0x2'));var moment=require(_0xd25b('0x3'));var BPromise=require(_0xd25b('0x4'));var rp=require(_0xd25b('0x5'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xd25b('0x6')]=function(_0x3bcff,_0x4b66a9){return _0x3bcff[_0xd25b('0x7')](_0xd25b('0x8'),attributes,{'tableName':_0xd25b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeaca=['exports','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','bluebird','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x1df9be,_0x27266d){var _0x56c872=function(_0x288c8c){while(--_0x288c8c){_0x1df9be['push'](_0x1df9be['shift']());}};_0x56c872(++_0x27266d);}(_0xeaca,0x17f));var _0xaeac=function(_0x324eaa,_0x5751c6){_0x324eaa=_0x324eaa-0x0;var _0x4ce6d6=_0xeaca[_0x324eaa];return _0x4ce6d6;};'use strict';var _=require(_0xaeac('0x0'));var util=require(_0xaeac('0x1'));var logger=require(_0xaeac('0x2'))(_0xaeac('0x3'));var moment=require('moment');var BPromise=require(_0xaeac('0x4'));var rp=require('request-promise');var attributes=require(_0xaeac('0x5'));var integrations=require(_0xaeac('0x6'));module[_0xaeac('0x7')]=function(_0x3ea673,_0x2038c2){return _0x3ea673['define'](_0xaeac('0x8'),attributes,{'tableName':_0xaeac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7349f68..ae5b76a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7116=['map','model','then','ShowZendeskAccount','find','debug','util','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','include'];(function(_0x3eda0c,_0x253a89){var _0x1ad2a4=function(_0x93d062){while(--_0x93d062){_0x3eda0c['push'](_0x3eda0c['shift']());}};_0x1ad2a4(++_0x253a89);}(_0x7116,0x66));var _0x6711=function(_0x4bec4e,_0x55d42d){_0x4bec4e=_0x4bec4e-0x0;var _0x29d933=_0x7116[_0x4bec4e];return _0x29d933;};'use strict';var _=require('lodash');var util=require(_0x6711('0x0'));var moment=require(_0x6711('0x1'));var BPromise=require(_0x6711('0x2'));var rs=require(_0x6711('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6711('0x4'));var config=require(_0x6711('0x5'));var jayson=require(_0x6711('0x6'));var client=jayson[_0x6711('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fac8a,_0x3eeacb,_0x4a107a){return new BPromise(function(_0x129a79,_0x47bb6f){return client[_0x6711('0x8')](_0x1fac8a,_0x4a107a)['then'](function(_0xf88131){logger[_0x6711('0x9')](_0x6711('0xa'),_0x3eeacb,_0x6711('0xb'));logger['debug'](_0x6711('0xc'),_0x3eeacb,_0x6711('0xb'),JSON[_0x6711('0xd')](_0xf88131));if(_0xf88131[_0x6711('0xe')]){if(_0xf88131[_0x6711('0xe')][_0x6711('0xf')]===0x1f4){logger[_0x6711('0xe')](_0x6711('0xa'),_0x3eeacb,_0xf88131['error'][_0x6711('0x10')]);return _0x47bb6f(_0xf88131['error'][_0x6711('0x10')]);}logger[_0x6711('0xe')](_0x6711('0xa'),_0x3eeacb,_0xf88131[_0x6711('0xe')][_0x6711('0x10')]);return _0x129a79(_0xf88131['error'][_0x6711('0x10')]);}else{logger[_0x6711('0x9')]('ZendeskAccount,\x20%s,\x20%s',_0x3eeacb,_0x6711('0xb'));_0x129a79(_0xf88131[_0x6711('0x11')][_0x6711('0x10')]);}})['catch'](function(_0x429eca){logger[_0x6711('0xe')](_0x6711('0xa'),_0x3eeacb,_0x429eca);_0x47bb6f(_0x429eca);});});}exports[_0x6711('0x12')]=function(_0x382d3d){var _0x5a80fb=this;return new Promise(function(_0x3e1559,_0x1cbb11){return db[_0x6711('0x13')][_0x6711('0x14')]({'raw':_0x382d3d[_0x6711('0x15')]?_0x382d3d['options'][_0x6711('0x16')]===undefined?!![]:![]:!![],'where':_0x382d3d[_0x6711('0x15')]?_0x382d3d['options'][_0x6711('0x17')]||null:null,'attributes':_0x382d3d[_0x6711('0x15')]?_0x382d3d[_0x6711('0x15')][_0x6711('0x18')]||null:null,'limit':_0x382d3d[_0x6711('0x15')]?_0x382d3d[_0x6711('0x15')]['limit']||null:null,'include':_0x382d3d[_0x6711('0x15')]?_0x382d3d[_0x6711('0x15')][_0x6711('0x19')]?_[_0x6711('0x1a')](_0x382d3d['options'][_0x6711('0x19')],function(_0x23d0ef){return{'model':db[_0x23d0ef['model']],'as':_0x23d0ef['as'],'attributes':_0x23d0ef[_0x6711('0x18')],'include':_0x23d0ef[_0x6711('0x19')]?_[_0x6711('0x1a')](_0x23d0ef[_0x6711('0x19')],function(_0x1ca385){return{'model':db[_0x1ca385[_0x6711('0x1b')]],'as':_0x1ca385['as'],'attributes':_0x1ca385['attributes'],'include':_0x1ca385[_0x6711('0x19')]?_[_0x6711('0x1a')](_0x1ca385[_0x6711('0x19')],function(_0x4f306d){return{'model':db[_0x4f306d['model']],'as':_0x4f306d['as'],'attributes':_0x4f306d[_0x6711('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6711('0x1c')](function(_0x3421c5){logger[_0x6711('0x9')](_0x6711('0x12'),_0x382d3d);logger['debug'](_0x6711('0x12'),_0x382d3d,JSON[_0x6711('0xd')](_0x3421c5));_0x3e1559(_0x3421c5);})['catch'](function(_0x3fa347){logger['error']('GetZendeskAccount',_0x3fa347[_0x6711('0x10')],_0x382d3d);_0x1cbb11(_0x5a80fb[_0x6711('0xe')](0x1f4,_0x3fa347[_0x6711('0x10')]));});});};exports[_0x6711('0x1d')]=function(_0x5ccdc7){var _0x10fc5b=this;return new Promise(function(_0x574959,_0x52e663){return db['ZendeskAccount'][_0x6711('0x1e')]({'raw':_0x5ccdc7[_0x6711('0x15')]?_0x5ccdc7[_0x6711('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5ccdc7[_0x6711('0x15')]?_0x5ccdc7[_0x6711('0x15')][_0x6711('0x17')]||null:null,'attributes':_0x5ccdc7[_0x6711('0x15')]?_0x5ccdc7['options']['attributes']||null:null,'include':_0x5ccdc7['options']?_0x5ccdc7[_0x6711('0x15')][_0x6711('0x19')]?_['map'](_0x5ccdc7['options'][_0x6711('0x19')],function(_0x2dff37){return{'model':db[_0x2dff37['model']],'as':_0x2dff37['as'],'attributes':_0x2dff37[_0x6711('0x18')],'include':_0x2dff37[_0x6711('0x19')]?_[_0x6711('0x1a')](_0x2dff37['include'],function(_0x1d5b38){return{'model':db[_0x1d5b38[_0x6711('0x1b')]],'as':_0x1d5b38['as'],'attributes':_0x1d5b38[_0x6711('0x18')],'include':_0x1d5b38['include']?_['map'](_0x1d5b38[_0x6711('0x19')],function(_0x2390e6){return{'model':db[_0x2390e6[_0x6711('0x1b')]],'as':_0x2390e6['as'],'attributes':_0x2390e6[_0x6711('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6711('0x1c')](function(_0x193d20){logger['info']('ShowZendeskAccount',_0x5ccdc7);logger[_0x6711('0x1f')]('ShowZendeskAccount',_0x5ccdc7,JSON['stringify'](_0x193d20));_0x574959(_0x193d20);})['catch'](function(_0x23f019){logger[_0x6711('0xe')](_0x6711('0x1d'),_0x23f019[_0x6711('0x10')],_0x5ccdc7);_0x52e663(_0x10fc5b[_0x6711('0xe')](0x1f4,_0x23f019['message']));});});};
\ No newline at end of file
+var _0xde07=['include','map','model','then','catch','ShowZendeskAccount','ZendeskAccount','find','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetZendeskAccount','options','raw','where','attributes','limit'];(function(_0x18ea99,_0x5d0dc6){var _0x4e1a63=function(_0x560366){while(--_0x560366){_0x18ea99['push'](_0x18ea99['shift']());}};_0x4e1a63(++_0x5d0dc6);}(_0xde07,0x110));var _0x7de0=function(_0x545260,_0x3176a0){_0x545260=_0x545260-0x0;var _0x4195fb=_0xde07[_0x545260];return _0x4195fb;};'use strict';var _=require('lodash');var util=require(_0x7de0('0x0'));var moment=require(_0x7de0('0x1'));var BPromise=require('bluebird');var rs=require(_0x7de0('0x2'));var fs=require('fs');var db=require(_0x7de0('0x3'))['db'];var utils=require(_0x7de0('0x4'));var logger=require(_0x7de0('0x5'))(_0x7de0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7de0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xefcb5f,_0x25d926,_0x4eb1ba){return new BPromise(function(_0x27f0d2,_0x5a1dd3){return client[_0x7de0('0x8')](_0xefcb5f,_0x4eb1ba)['then'](function(_0x18023f){logger[_0x7de0('0x9')](_0x7de0('0xa'),_0x25d926,_0x7de0('0xb'));logger[_0x7de0('0xc')](_0x7de0('0xd'),_0x25d926,_0x7de0('0xb'),JSON[_0x7de0('0xe')](_0x18023f));if(_0x18023f[_0x7de0('0xf')]){if(_0x18023f[_0x7de0('0xf')][_0x7de0('0x10')]===0x1f4){logger[_0x7de0('0xf')](_0x7de0('0xa'),_0x25d926,_0x18023f['error'][_0x7de0('0x11')]);return _0x5a1dd3(_0x18023f[_0x7de0('0xf')]['message']);}logger[_0x7de0('0xf')](_0x7de0('0xa'),_0x25d926,_0x18023f[_0x7de0('0xf')][_0x7de0('0x11')]);return _0x27f0d2(_0x18023f['error']['message']);}else{logger[_0x7de0('0x9')]('ZendeskAccount,\x20%s,\x20%s',_0x25d926,_0x7de0('0xb'));_0x27f0d2(_0x18023f[_0x7de0('0x12')][_0x7de0('0x11')]);}})['catch'](function(_0x40b7c9){logger[_0x7de0('0xf')](_0x7de0('0xa'),_0x25d926,_0x40b7c9);_0x5a1dd3(_0x40b7c9);});});}exports[_0x7de0('0x13')]=function(_0x3ebc22){var _0x297a2b=this;return new Promise(function(_0x13ae25,_0x4233dc){return db['ZendeskAccount']['findAll']({'raw':_0x3ebc22[_0x7de0('0x14')]?_0x3ebc22[_0x7de0('0x14')][_0x7de0('0x15')]===undefined?!![]:![]:!![],'where':_0x3ebc22[_0x7de0('0x14')]?_0x3ebc22[_0x7de0('0x14')][_0x7de0('0x16')]||null:null,'attributes':_0x3ebc22[_0x7de0('0x14')]?_0x3ebc22['options'][_0x7de0('0x17')]||null:null,'limit':_0x3ebc22['options']?_0x3ebc22['options'][_0x7de0('0x18')]||null:null,'include':_0x3ebc22['options']?_0x3ebc22['options'][_0x7de0('0x19')]?_[_0x7de0('0x1a')](_0x3ebc22['options']['include'],function(_0x2452a0){return{'model':db[_0x2452a0['model']],'as':_0x2452a0['as'],'attributes':_0x2452a0[_0x7de0('0x17')],'include':_0x2452a0['include']?_[_0x7de0('0x1a')](_0x2452a0[_0x7de0('0x19')],function(_0xc36c76){return{'model':db[_0xc36c76[_0x7de0('0x1b')]],'as':_0xc36c76['as'],'attributes':_0xc36c76[_0x7de0('0x17')],'include':_0xc36c76['include']?_['map'](_0xc36c76[_0x7de0('0x19')],function(_0x529148){return{'model':db[_0x529148[_0x7de0('0x1b')]],'as':_0x529148['as'],'attributes':_0x529148['attributes']};}):[]};}):[]};}):[]:[]})[_0x7de0('0x1c')](function(_0x564186){logger[_0x7de0('0x9')](_0x7de0('0x13'),_0x3ebc22);logger[_0x7de0('0xc')]('GetZendeskAccount',_0x3ebc22,JSON[_0x7de0('0xe')](_0x564186));_0x13ae25(_0x564186);})[_0x7de0('0x1d')](function(_0x4c0b47){logger[_0x7de0('0xf')](_0x7de0('0x13'),_0x4c0b47[_0x7de0('0x11')],_0x3ebc22);_0x4233dc(_0x297a2b['error'](0x1f4,_0x4c0b47['message']));});});};exports[_0x7de0('0x1e')]=function(_0x2d4974){var _0x41364c=this;return new Promise(function(_0x2eba6f,_0x32dc12){return db[_0x7de0('0x1f')][_0x7de0('0x20')]({'raw':_0x2d4974[_0x7de0('0x14')]?_0x2d4974['options'][_0x7de0('0x15')]===undefined?!![]:![]:!![],'where':_0x2d4974[_0x7de0('0x14')]?_0x2d4974[_0x7de0('0x14')][_0x7de0('0x16')]||null:null,'attributes':_0x2d4974[_0x7de0('0x14')]?_0x2d4974[_0x7de0('0x14')]['attributes']||null:null,'include':_0x2d4974[_0x7de0('0x14')]?_0x2d4974[_0x7de0('0x14')][_0x7de0('0x19')]?_[_0x7de0('0x1a')](_0x2d4974[_0x7de0('0x14')][_0x7de0('0x19')],function(_0x491db0){return{'model':db[_0x491db0['model']],'as':_0x491db0['as'],'attributes':_0x491db0[_0x7de0('0x17')],'include':_0x491db0[_0x7de0('0x19')]?_[_0x7de0('0x1a')](_0x491db0[_0x7de0('0x19')],function(_0x4ae713){return{'model':db[_0x4ae713[_0x7de0('0x1b')]],'as':_0x4ae713['as'],'attributes':_0x4ae713[_0x7de0('0x17')],'include':_0x4ae713[_0x7de0('0x19')]?_[_0x7de0('0x1a')](_0x4ae713['include'],function(_0x4565fe){return{'model':db[_0x4565fe['model']],'as':_0x4565fe['as'],'attributes':_0x4565fe['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x51bd88){logger[_0x7de0('0x9')](_0x7de0('0x1e'),_0x2d4974);logger[_0x7de0('0xc')](_0x7de0('0x1e'),_0x2d4974,JSON[_0x7de0('0xe')](_0x51bd88));_0x2eba6f(_0x51bd88);})[_0x7de0('0x1d')](function(_0x4a3b02){logger[_0x7de0('0xf')](_0x7de0('0x1e'),_0x4a3b02[_0x7de0('0x11')],_0x2d4974);_0x32dc12(_0x41364c[_0x7de0('0xf')](0x1f4,_0x4a3b02['message']));});});};
\ No newline at end of file
index 3d465ff..052aad5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8396=['../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','getFields','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','exports','multer','path','express','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8396,0x8c));var _0x6839=function(_0x1d6310,_0x4e7b07){_0x1d6310=_0x1d6310-0x0;var _0x5db56e=_0x8396[_0x1d6310];return _0x5db56e;};'use strict';var multer=require(_0x6839('0x0'));var util=require('util');var path=require(_0x6839('0x1'));var express=require(_0x6839('0x2'));var router=express['Router']();var auth=require(_0x6839('0x3'));var interaction=require(_0x6839('0x4'));var config=require(_0x6839('0x5'));var controller=require(_0x6839('0x6'));router[_0x6839('0x7')]('/',auth[_0x6839('0x8')](),controller[_0x6839('0x9')]);router[_0x6839('0x7')]('/:id',auth[_0x6839('0x8')](),controller[_0x6839('0xa')]);router[_0x6839('0x7')]('/:id/fields',auth[_0x6839('0x8')](),controller[_0x6839('0xb')]);router[_0x6839('0x7')]('/:id/subjects',auth[_0x6839('0x8')](),controller[_0x6839('0xc')]);router['get'](_0x6839('0xd'),auth[_0x6839('0x8')](),controller['getDescriptions']);router['get'](_0x6839('0xe'),auth[_0x6839('0x8')](),controller[_0x6839('0xf')]);router[_0x6839('0x10')]('/',auth[_0x6839('0x8')](),controller[_0x6839('0x11')]);router['post']('/:id/tags',auth[_0x6839('0x8')](),controller[_0x6839('0x12')]);router[_0x6839('0x13')]('/:id',auth[_0x6839('0x8')](),controller[_0x6839('0x14')]);router[_0x6839('0x15')]('/:id',auth[_0x6839('0x8')](),controller[_0x6839('0x16')]);module[_0x6839('0x17')]=router;
\ No newline at end of file
+var _0xff86=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','exports','multer','express','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','index','get','/:id','isAuthenticated','show'];(function(_0x5cf331,_0xac8643){var _0x23b744=function(_0x3220fc){while(--_0x3220fc){_0x5cf331['push'](_0x5cf331['shift']());}};_0x23b744(++_0xac8643);}(_0xff86,0x186));var _0x6ff8=function(_0x2c45fc,_0x5ce05d){_0x2c45fc=_0x2c45fc-0x0;var _0x5da728=_0xff86[_0x2c45fc];return _0x5da728;};'use strict';var multer=require(_0x6ff8('0x0'));var util=require('util');var path=require('path');var express=require(_0x6ff8('0x1'));var router=express['Router']();var auth=require(_0x6ff8('0x2'));var interaction=require(_0x6ff8('0x3'));var config=require('../../config/environment');var controller=require(_0x6ff8('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x6ff8('0x5')]);router[_0x6ff8('0x6')](_0x6ff8('0x7'),auth[_0x6ff8('0x8')](),controller[_0x6ff8('0x9')]);router[_0x6ff8('0x6')]('/:id/fields',auth['isAuthenticated'](),controller[_0x6ff8('0xa')]);router[_0x6ff8('0x6')](_0x6ff8('0xb'),auth['isAuthenticated'](),controller[_0x6ff8('0xc')]);router[_0x6ff8('0x6')](_0x6ff8('0xd'),auth['isAuthenticated'](),controller[_0x6ff8('0xe')]);router[_0x6ff8('0x6')](_0x6ff8('0xf'),auth[_0x6ff8('0x8')](),controller[_0x6ff8('0x10')]);router[_0x6ff8('0x11')]('/',auth[_0x6ff8('0x8')](),controller[_0x6ff8('0x12')]);router[_0x6ff8('0x11')](_0x6ff8('0xf'),auth['isAuthenticated'](),controller[_0x6ff8('0x13')]);router[_0x6ff8('0x14')](_0x6ff8('0x7'),auth['isAuthenticated'](),controller[_0x6ff8('0x15')]);router[_0x6ff8('0x16')](_0x6ff8('0x7'),auth['isAuthenticated'](),controller[_0x6ff8('0x17')]);module[_0x6ff8('0x18')]=router;
\ No newline at end of file
index 183613c..24949ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcee2=['sequelize','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xcee2,0xf8));var _0x2cee=function(_0x5c0b96,_0x51d17c){_0x5c0b96=_0x5c0b96-0x0;var _0x510497=_0xcee2[_0x5c0b96];return _0x510497;};'use strict';var Sequelize=require(_0x2cee('0x0'));module['exports']={'name':{'type':Sequelize[_0x2cee('0x1')]},'description':{'type':Sequelize[_0x2cee('0x1')]}};
\ No newline at end of file
+var _0x502d=['STRING','sequelize','exports'];(function(_0x35b195,_0x8893d5){var _0x2433bf=function(_0x22be07){while(--_0x22be07){_0x35b195['push'](_0x35b195['shift']());}};_0x2433bf(++_0x8893d5);}(_0x502d,0x1a8));var _0xd502=function(_0x11ec6c,_0x1a8169){_0x11ec6c=_0x11ec6c-0x0;var _0xb59506=_0x502d[_0x11ec6c];return _0xb59506;};'use strict';var Sequelize=require(_0xd502('0x0'));module[_0xd502('0x1')]={'name':{'type':Sequelize[_0xd502('0x2')]},'description':{'type':Sequelize[_0xd502('0x2')]}};
\ No newline at end of file
index 639f75e..d38f7ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eae=['params','getFields','findOne','getSubjects','ZendeskField','pick','getDescriptions','getTags','Tag','setTags','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','end','count','offset','Content-Range','json','reject','save','destroy','stack','ZendeskConfiguration','rawAttributes','model','keys','dateStart','query','dateEnd','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','day','add','merge','filter','map','options','includeAll','include','show','find','create','update','body'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x3eae,0x162));var _0xe3ea=function(_0x5b64a1,_0x2ec810){_0x5b64a1=_0x5b64a1-0x0;var _0x4b6f55=_0x3eae[_0x5b64a1];return _0x4b6f55;};'use strict';var pdf=require(_0xe3ea('0x0'));var emlformat=require(_0xe3ea('0x1'));var rimraf=require(_0xe3ea('0x2'));var zipdir=require(_0xe3ea('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe3ea('0x4'));var moment=require(_0xe3ea('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xe3ea('0x6'));var csv=require(_0xe3ea('0x7'));var ejs=require(_0xe3ea('0x8'));var fs=require('fs');var _=require(_0xe3ea('0x9'));var squel=require(_0xe3ea('0xa'));var crypto=require(_0xe3ea('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe3ea('0xc'));var toCsv=require(_0xe3ea('0x7'));var querystring=require(_0xe3ea('0xd'));var Papa=require(_0xe3ea('0xe'));var qs=require(_0xe3ea('0xf'));var logger=require(_0xe3ea('0x10'))(_0xe3ea('0x11'));var utils=require(_0xe3ea('0x12'));var config=require('../../config/environment');var db=require(_0xe3ea('0x13'))['db'];var jayson=require(_0xe3ea('0x14'));var client=jayson[_0xe3ea('0x15')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52a222,_0x5d6620,_0x57e3f8,_0x2fda2e){return new BPromise(function(_0x1986ab,_0x1deff8){var _0x371152=_0x2fda2e||client;return _0x371152[_0xe3ea('0x16')](_0x52a222,_0x57e3f8)[_0xe3ea('0x17')](function(_0x3ca29b){logger['info'](_0xe3ea('0x18'),_0x5d6620,_0xe3ea('0x19'));logger[_0xe3ea('0x1a')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5d6620,_0xe3ea('0x19'),JSON[_0xe3ea('0x1b')](_0x3ca29b));if(_0x3ca29b[_0xe3ea('0x1c')]){if(_0x3ca29b[_0xe3ea('0x1c')][_0xe3ea('0x1d')]===0x1f4){logger[_0xe3ea('0x1c')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5d6620,_0x3ca29b['error'][_0xe3ea('0x1e')]);return _0x1deff8(_0x3ca29b['error'][_0xe3ea('0x1e')]);}logger[_0xe3ea('0x1c')](_0xe3ea('0x18'),_0x5d6620,_0x3ca29b[_0xe3ea('0x1c')][_0xe3ea('0x1e')]);return _0x1986ab(_0x3ca29b[_0xe3ea('0x1c')][_0xe3ea('0x1e')]);}else{logger[_0xe3ea('0x1f')](_0xe3ea('0x18'),_0x5d6620,_0xe3ea('0x19'));_0x1986ab(_0x3ca29b[_0xe3ea('0x20')][_0xe3ea('0x1e')]);}})[_0xe3ea('0x21')](function(_0x89e7a5){logger['error'](_0xe3ea('0x18'),_0x5d6620,_0x89e7a5);_0x1deff8(_0x89e7a5);});});}function respondWithStatusCode(_0x5ed256,_0x4add58){_0x4add58=_0x4add58||0xcc;return function(_0x344114){if(_0x344114){return _0x5ed256[_0xe3ea('0x22')](_0x4add58);}return _0x5ed256[_0xe3ea('0x23')](_0x4add58)[_0xe3ea('0x24')]();};}function respondWithResult(_0x2a7861,_0x5677bc){_0x5677bc=_0x5677bc||0xc8;return function(_0x33003c){if(_0x33003c){return _0x2a7861[_0xe3ea('0x23')](_0x5677bc)['json'](_0x33003c);}};}function respondWithFilteredResult(_0x180aa6,_0x303a31){return function(_0x1f7ac9){if(_0x1f7ac9){var _0x442db8=_0x1f7ac9[_0xe3ea('0x25')],_0x4e4d11=_0x303a31[_0xe3ea('0x26')],_0x383754=_0x303a31[_0xe3ea('0x26')]+_0x303a31['limit'],_0x20ab70;if(_0x383754>=_0x442db8){_0x383754=_0x442db8;_0x20ab70=0xc8;}else{_0x20ab70=0xce;}_0x180aa6['status'](_0x20ab70);return _0x180aa6['set'](_0xe3ea('0x27'),_0x4e4d11+'-'+_0x383754+'/'+_0x442db8)[_0xe3ea('0x28')](_0x1f7ac9);}return null;};}function patchUpdates(_0xbf5fab){return function(_0x5691ac){try{jsonpatch['apply'](_0x5691ac,_0xbf5fab,!![]);}catch(_0x29caf6){return BPromise[_0xe3ea('0x29')](_0x29caf6);}return _0x5691ac[_0xe3ea('0x2a')]();};}function saveUpdates(_0x272649,_0x4fc3ee){return function(_0x3350c3){if(_0x3350c3){return _0x3350c3['update'](_0x272649)['then'](function(_0x2f6bd6){return _0x2f6bd6;});}return null;};}function removeEntity(_0x4ba3d1,_0x57d296){return function(_0x1978e6){if(_0x1978e6){return _0x1978e6[_0xe3ea('0x2b')]()[_0xe3ea('0x17')](function(){_0x4ba3d1[_0xe3ea('0x23')](0xcc)[_0xe3ea('0x24')]();});}};}function handleEntityNotFound(_0x456d58,_0x555336){return function(_0x25c13e){if(!_0x25c13e){_0x456d58[_0xe3ea('0x22')](0x194);}return _0x25c13e;};}function handleError(_0x26bc02,_0xfc6ee8){_0xfc6ee8=_0xfc6ee8||0x1f4;return function(_0x21c770){logger[_0xe3ea('0x1c')](_0x21c770[_0xe3ea('0x2c')]);if(_0x21c770['name']){delete _0x21c770['name'];}_0x26bc02['status'](_0xfc6ee8)['send'](_0x21c770);};}exports['index']=function(_0x266472,_0x51e397){var _0x278160={},_0x6d413e={},_0x369e4f={'count':0x0,'rows':[]};var _0x246712=db[_0xe3ea('0x2d')][_0xe3ea('0x2e')];_0x6d413e[_0xe3ea('0x2f')]=_[_0xe3ea('0x30')](_0x246712);var _0x39e07b={'dateStart':_0x266472['query'][_0xe3ea('0x31')],'dateEnd':_0x266472[_0xe3ea('0x32')][_0xe3ea('0x33')]};delete _0x266472[_0xe3ea('0x32')][_0xe3ea('0x31')];delete _0x266472[_0xe3ea('0x32')][_0xe3ea('0x33')];_0x6d413e['query']=_['keys'](_0x266472[_0xe3ea('0x32')]);_0x6d413e[_0xe3ea('0x34')]=_[_0xe3ea('0x35')](_0x6d413e['model'],_0x6d413e['query']);_0x278160['attributes']=_['intersection'](_0x6d413e[_0xe3ea('0x2f')],qs[_0xe3ea('0x36')](_0x266472[_0xe3ea('0x32')][_0xe3ea('0x36')]));_0x278160[_0xe3ea('0x37')]=_0x278160[_0xe3ea('0x37')][_0xe3ea('0x38')]?_0x278160[_0xe3ea('0x37')]:_0x6d413e[_0xe3ea('0x2f')];if(!_0x266472[_0xe3ea('0x32')][_0xe3ea('0x39')](_0xe3ea('0x3a'))){_0x278160[_0xe3ea('0x3b')]=qs[_0xe3ea('0x3b')](_0x266472[_0xe3ea('0x32')][_0xe3ea('0x3b')]);_0x278160[_0xe3ea('0x26')]=qs[_0xe3ea('0x26')](_0x266472[_0xe3ea('0x32')][_0xe3ea('0x26')]);}_0x278160[_0xe3ea('0x3c')]=qs[_0xe3ea('0x3d')](_0x266472[_0xe3ea('0x32')]['sort']);_0x278160[_0xe3ea('0x3e')]=qs[_0xe3ea('0x34')](_['pick'](_0x266472[_0xe3ea('0x32')],_0x6d413e[_0xe3ea('0x34')]));if(_0x39e07b[_0xe3ea('0x31')]){if(_0x39e07b['dateEnd']){_0x39e07b[_0xe3ea('0x33')]=moment(_0x39e07b[_0xe3ea('0x33')])['add'](0x1,_0xe3ea('0x3f'));}else{_0x39e07b[_0xe3ea('0x33')]=moment(_0x39e07b[_0xe3ea('0x31')])[_0xe3ea('0x40')](0x1,_0xe3ea('0x3f'));}_[_0xe3ea('0x41')](_0x278160[_0xe3ea('0x3e')],{'createdAt':{'$gte':_0x39e07b[_0xe3ea('0x31')],'$lte':_0x39e07b[_0xe3ea('0x33')]}});}if(_0x266472[_0xe3ea('0x32')][_0xe3ea('0x42')]){_0x278160['where']=_['merge'](_0x278160[_0xe3ea('0x3e')],{'$or':_[_0xe3ea('0x43')](_0x278160[_0xe3ea('0x37')],function(_0xcafed9){var _0x56788c={};_0x56788c[_0xcafed9]={'$like':'%'+_0x266472[_0xe3ea('0x32')][_0xe3ea('0x42')]+'%'};return _0x56788c;})});}_0x278160=_[_0xe3ea('0x41')]({},_0x278160,_0x266472[_0xe3ea('0x44')]);var _0x46b0cc={'where':_0x278160[_0xe3ea('0x3e')]};return db[_0xe3ea('0x2d')][_0xe3ea('0x25')](_0x46b0cc)[_0xe3ea('0x17')](function(_0x38bd4f){_0x369e4f[_0xe3ea('0x25')]=_0x38bd4f;if(_0x266472[_0xe3ea('0x32')][_0xe3ea('0x45')]){_0x278160[_0xe3ea('0x46')]=[{'all':!![]}];}return db[_0xe3ea('0x2d')]['findAll'](_0x278160);})[_0xe3ea('0x17')](function(_0x5f39a5){_0x369e4f['rows']=_0x5f39a5;return _0x369e4f;})[_0xe3ea('0x17')](respondWithFilteredResult(_0x51e397,_0x278160))['catch'](handleError(_0x51e397,null));};exports[_0xe3ea('0x47')]=function(_0x5ec414,_0x4633b8){var _0x3e792b={'raw':![],'where':{'id':_0x5ec414['params']['id']}},_0x108fd3={};_0x108fd3[_0xe3ea('0x2f')]=_['keys'](db[_0xe3ea('0x2d')][_0xe3ea('0x2e')]);_0x108fd3[_0xe3ea('0x32')]=_[_0xe3ea('0x30')](_0x5ec414[_0xe3ea('0x32')]);_0x108fd3[_0xe3ea('0x34')]=_[_0xe3ea('0x35')](_0x108fd3['model'],_0x108fd3[_0xe3ea('0x32')]);_0x3e792b[_0xe3ea('0x37')]=_[_0xe3ea('0x35')](_0x108fd3[_0xe3ea('0x2f')],qs[_0xe3ea('0x36')](_0x5ec414[_0xe3ea('0x32')][_0xe3ea('0x36')]));_0x3e792b[_0xe3ea('0x37')]=_0x3e792b['attributes'][_0xe3ea('0x38')]?_0x3e792b[_0xe3ea('0x37')]:_0x108fd3[_0xe3ea('0x2f')];if(_0x5ec414[_0xe3ea('0x32')][_0xe3ea('0x45')]){_0x3e792b[_0xe3ea('0x46')]=[{'all':!![]}];}_0x3e792b=_['merge']({},_0x3e792b,_0x5ec414[_0xe3ea('0x44')]);return db['ZendeskConfiguration'][_0xe3ea('0x48')](_0x3e792b)[_0xe3ea('0x17')](handleEntityNotFound(_0x4633b8,null))[_0xe3ea('0x17')](respondWithResult(_0x4633b8,null))[_0xe3ea('0x21')](handleError(_0x4633b8,null));};exports[_0xe3ea('0x49')]=function(_0x1be8e2,_0x3e537e){return db[_0xe3ea('0x2d')][_0xe3ea('0x49')](_0x1be8e2['body'],{})['then'](respondWithResult(_0x3e537e,0xc9))['catch'](handleError(_0x3e537e,null));};exports[_0xe3ea('0x4a')]=function(_0x4e0ee1,_0x2265c6){if(_0x4e0ee1[_0xe3ea('0x4b')]['id']){delete _0x4e0ee1[_0xe3ea('0x4b')]['id'];}return db[_0xe3ea('0x2d')][_0xe3ea('0x48')]({'where':{'id':_0x4e0ee1['params']['id']}})[_0xe3ea('0x17')](handleEntityNotFound(_0x2265c6,null))[_0xe3ea('0x17')](saveUpdates(_0x4e0ee1[_0xe3ea('0x4b')],null))[_0xe3ea('0x17')](respondWithResult(_0x2265c6,null))[_0xe3ea('0x21')](handleError(_0x2265c6,null));};exports[_0xe3ea('0x2b')]=function(_0xbd4e56,_0x42b666){return db[_0xe3ea('0x2d')][_0xe3ea('0x48')]({'where':{'id':_0xbd4e56[_0xe3ea('0x4c')]['id']}})['then'](handleEntityNotFound(_0x42b666,null))['then'](removeEntity(_0x42b666,null))[_0xe3ea('0x21')](handleError(_0x42b666,null));};exports[_0xe3ea('0x4d')]=function(_0x211dce,_0x4587ee,_0x52e39e){var _0x5a1828={};var _0x54bd17={};var _0x1353f9;var _0x1d8447;return db['ZendeskConfiguration'][_0xe3ea('0x4e')]({'where':{'id':_0x211dce[_0xe3ea('0x4c')]['id']}})[_0xe3ea('0x17')](handleEntityNotFound(_0x4587ee,null))[_0xe3ea('0x17')](function(_0x333dc8){if(_0x333dc8){_0x1353f9=_0x333dc8;_0x54bd17[_0xe3ea('0x2f')]=_['keys'](db['ZendeskField']['rawAttributes']);_0x54bd17['query']=_[_0xe3ea('0x30')](_0x211dce['query']);_0x54bd17[_0xe3ea('0x34')]=_['intersection'](_0x54bd17[_0xe3ea('0x2f')],_0x54bd17[_0xe3ea('0x32')]);_0x5a1828['attributes']=_[_0xe3ea('0x35')](_0x54bd17[_0xe3ea('0x2f')],qs[_0xe3ea('0x36')](_0x211dce[_0xe3ea('0x32')][_0xe3ea('0x36')]));_0x5a1828[_0xe3ea('0x37')]=_0x5a1828['attributes']['length']?_0x5a1828[_0xe3ea('0x37')]:_0x54bd17[_0xe3ea('0x2f')];_0x5a1828[_0xe3ea('0x3c')]=qs['sort'](_0x211dce['query'][_0xe3ea('0x3d')]);_0x5a1828['where']=qs[_0xe3ea('0x34')](_['pick'](_0x211dce[_0xe3ea('0x32')],_0x54bd17['filters']));if(_0x211dce['query'][_0xe3ea('0x42')]){_0x5a1828['where']=_['merge'](_0x5a1828['where'],{'$or':_[_0xe3ea('0x43')](_0x5a1828[_0xe3ea('0x37')],function(_0x4dbe3b){var _0x423f49={};_0x423f49[_0x4dbe3b]={'$like':'%'+_0x211dce['query'][_0xe3ea('0x42')]+'%'};return _0x423f49;})});}_0x5a1828=_['merge']({},_0x5a1828,_0x211dce[_0xe3ea('0x44')]);return _0x1353f9[_0xe3ea('0x4d')](_0x5a1828);}})[_0xe3ea('0x17')](function(_0x536a47){if(_0x536a47){_0x1d8447=_0x536a47[_0xe3ea('0x38')];if(!_0x211dce[_0xe3ea('0x32')]['hasOwnProperty'](_0xe3ea('0x3a'))){_0x5a1828[_0xe3ea('0x3b')]=qs[_0xe3ea('0x3b')](_0x211dce['query'][_0xe3ea('0x3b')]);_0x5a1828[_0xe3ea('0x26')]=qs[_0xe3ea('0x26')](_0x211dce['query'][_0xe3ea('0x26')]);}return _0x1353f9[_0xe3ea('0x4d')](_0x5a1828);}})['then'](function(_0x2089a3){if(_0x2089a3){return _0x2089a3?{'count':_0x1d8447,'rows':_0x2089a3}:null;}})['then'](respondWithResult(_0x4587ee,null))[_0xe3ea('0x21')](handleError(_0x4587ee,null));};exports[_0xe3ea('0x4f')]=function(_0x4b5f99,_0x347a68,_0x293f55){var _0x2c0ae2={};var _0x3ff72d={};var _0x5aab2c;var _0x433765;return db[_0xe3ea('0x2d')][_0xe3ea('0x4e')]({'where':{'id':_0x4b5f99[_0xe3ea('0x4c')]['id']}})[_0xe3ea('0x17')](handleEntityNotFound(_0x347a68,null))[_0xe3ea('0x17')](function(_0x3d6e90){if(_0x3d6e90){_0x5aab2c=_0x3d6e90;_0x3ff72d[_0xe3ea('0x2f')]=_[_0xe3ea('0x30')](db[_0xe3ea('0x50')]['rawAttributes']);_0x3ff72d[_0xe3ea('0x32')]=_[_0xe3ea('0x30')](_0x4b5f99[_0xe3ea('0x32')]);_0x3ff72d[_0xe3ea('0x34')]=_['intersection'](_0x3ff72d[_0xe3ea('0x2f')],_0x3ff72d[_0xe3ea('0x32')]);_0x2c0ae2[_0xe3ea('0x37')]=_[_0xe3ea('0x35')](_0x3ff72d[_0xe3ea('0x2f')],qs[_0xe3ea('0x36')](_0x4b5f99[_0xe3ea('0x32')][_0xe3ea('0x36')]));_0x2c0ae2[_0xe3ea('0x37')]=_0x2c0ae2[_0xe3ea('0x37')][_0xe3ea('0x38')]?_0x2c0ae2[_0xe3ea('0x37')]:_0x3ff72d[_0xe3ea('0x2f')];_0x2c0ae2['order']=qs[_0xe3ea('0x3d')](_0x4b5f99[_0xe3ea('0x32')][_0xe3ea('0x3d')]);_0x2c0ae2[_0xe3ea('0x3e')]=qs[_0xe3ea('0x34')](_[_0xe3ea('0x51')](_0x4b5f99[_0xe3ea('0x32')],_0x3ff72d[_0xe3ea('0x34')]));if(_0x4b5f99[_0xe3ea('0x32')][_0xe3ea('0x42')]){_0x2c0ae2[_0xe3ea('0x3e')]=_[_0xe3ea('0x41')](_0x2c0ae2['where'],{'$or':_[_0xe3ea('0x43')](_0x2c0ae2[_0xe3ea('0x37')],function(_0x549e74){var _0x574ef5={};_0x574ef5[_0x549e74]={'$like':'%'+_0x4b5f99[_0xe3ea('0x32')][_0xe3ea('0x42')]+'%'};return _0x574ef5;})});}_0x2c0ae2=_[_0xe3ea('0x41')]({},_0x2c0ae2,_0x4b5f99[_0xe3ea('0x44')]);return _0x5aab2c[_0xe3ea('0x4f')](_0x2c0ae2);}})[_0xe3ea('0x17')](function(_0x3c5ef9){if(_0x3c5ef9){_0x433765=_0x3c5ef9[_0xe3ea('0x38')];if(!_0x4b5f99[_0xe3ea('0x32')]['hasOwnProperty'](_0xe3ea('0x3a'))){_0x2c0ae2['limit']=qs[_0xe3ea('0x3b')](_0x4b5f99['query']['limit']);_0x2c0ae2['offset']=qs['offset'](_0x4b5f99['query'][_0xe3ea('0x26')]);}return _0x5aab2c[_0xe3ea('0x4f')](_0x2c0ae2);}})[_0xe3ea('0x17')](function(_0xeab587){if(_0xeab587){return _0xeab587?{'count':_0x433765,'rows':_0xeab587}:null;}})[_0xe3ea('0x17')](respondWithResult(_0x347a68,null))[_0xe3ea('0x21')](handleError(_0x347a68,null));};exports[_0xe3ea('0x52')]=function(_0x5884d3,_0x58b44b,_0x60f270){var _0x14630e={};var _0x1efaf0={};var _0x1a2bab;var _0x566f66;return db[_0xe3ea('0x2d')][_0xe3ea('0x4e')]({'where':{'id':_0x5884d3[_0xe3ea('0x4c')]['id']}})[_0xe3ea('0x17')](handleEntityNotFound(_0x58b44b,null))[_0xe3ea('0x17')](function(_0x1e4e87){if(_0x1e4e87){_0x1a2bab=_0x1e4e87;_0x1efaf0[_0xe3ea('0x2f')]=_['keys'](db['ZendeskField'][_0xe3ea('0x2e')]);_0x1efaf0[_0xe3ea('0x32')]=_[_0xe3ea('0x30')](_0x5884d3['query']);_0x1efaf0['filters']=_[_0xe3ea('0x35')](_0x1efaf0[_0xe3ea('0x2f')],_0x1efaf0[_0xe3ea('0x32')]);_0x14630e[_0xe3ea('0x37')]=_[_0xe3ea('0x35')](_0x1efaf0[_0xe3ea('0x2f')],qs[_0xe3ea('0x36')](_0x5884d3[_0xe3ea('0x32')][_0xe3ea('0x36')]));_0x14630e[_0xe3ea('0x37')]=_0x14630e['attributes']['length']?_0x14630e[_0xe3ea('0x37')]:_0x1efaf0['model'];_0x14630e[_0xe3ea('0x3c')]=qs[_0xe3ea('0x3d')](_0x5884d3['query'][_0xe3ea('0x3d')]);_0x14630e[_0xe3ea('0x3e')]=qs[_0xe3ea('0x34')](_[_0xe3ea('0x51')](_0x5884d3['query'],_0x1efaf0[_0xe3ea('0x34')]));if(_0x5884d3[_0xe3ea('0x32')][_0xe3ea('0x42')]){_0x14630e[_0xe3ea('0x3e')]=_[_0xe3ea('0x41')](_0x14630e[_0xe3ea('0x3e')],{'$or':_[_0xe3ea('0x43')](_0x14630e[_0xe3ea('0x37')],function(_0x389a93){var _0x22c04a={};_0x22c04a[_0x389a93]={'$like':'%'+_0x5884d3[_0xe3ea('0x32')][_0xe3ea('0x42')]+'%'};return _0x22c04a;})});}_0x14630e=_[_0xe3ea('0x41')]({},_0x14630e,_0x5884d3[_0xe3ea('0x44')]);return _0x1a2bab['getDescriptions'](_0x14630e);}})[_0xe3ea('0x17')](function(_0x58f755){if(_0x58f755){_0x566f66=_0x58f755[_0xe3ea('0x38')];if(!_0x5884d3[_0xe3ea('0x32')][_0xe3ea('0x39')](_0xe3ea('0x3a'))){_0x14630e['limit']=qs[_0xe3ea('0x3b')](_0x5884d3[_0xe3ea('0x32')][_0xe3ea('0x3b')]);_0x14630e[_0xe3ea('0x26')]=qs[_0xe3ea('0x26')](_0x5884d3[_0xe3ea('0x32')]['offset']);}return _0x1a2bab[_0xe3ea('0x52')](_0x14630e);}})[_0xe3ea('0x17')](function(_0x539e0d){if(_0x539e0d){return _0x539e0d?{'count':_0x566f66,'rows':_0x539e0d}:null;}})[_0xe3ea('0x17')](respondWithResult(_0x58b44b,null))['catch'](handleError(_0x58b44b,null));};exports[_0xe3ea('0x53')]=function(_0x1d47b4,_0x2ad2c1,_0x2946d9){var _0x1dbe66={};var _0x1f0e84={};var _0x5a58b2;var _0x534bb5;return db[_0xe3ea('0x2d')][_0xe3ea('0x4e')]({'where':{'id':_0x1d47b4[_0xe3ea('0x4c')]['id']}})[_0xe3ea('0x17')](handleEntityNotFound(_0x2ad2c1,null))[_0xe3ea('0x17')](function(_0x3b9fe4){if(_0x3b9fe4){_0x5a58b2=_0x3b9fe4;_0x1f0e84[_0xe3ea('0x2f')]=_[_0xe3ea('0x30')](db[_0xe3ea('0x54')][_0xe3ea('0x2e')]);_0x1f0e84[_0xe3ea('0x32')]=_[_0xe3ea('0x30')](_0x1d47b4[_0xe3ea('0x32')]);_0x1f0e84[_0xe3ea('0x34')]=_[_0xe3ea('0x35')](_0x1f0e84[_0xe3ea('0x2f')],_0x1f0e84[_0xe3ea('0x32')]);_0x1dbe66[_0xe3ea('0x37')]=_[_0xe3ea('0x35')](_0x1f0e84[_0xe3ea('0x2f')],qs[_0xe3ea('0x36')](_0x1d47b4['query'][_0xe3ea('0x36')]));_0x1dbe66[_0xe3ea('0x37')]=_0x1dbe66[_0xe3ea('0x37')][_0xe3ea('0x38')]?_0x1dbe66[_0xe3ea('0x37')]:_0x1f0e84[_0xe3ea('0x2f')];_0x1dbe66['order']=qs[_0xe3ea('0x3d')](_0x1d47b4[_0xe3ea('0x32')][_0xe3ea('0x3d')]);_0x1dbe66[_0xe3ea('0x3e')]=qs[_0xe3ea('0x34')](_['pick'](_0x1d47b4['query'],_0x1f0e84['filters']));if(_0x1d47b4[_0xe3ea('0x32')]['filter']){_0x1dbe66[_0xe3ea('0x3e')]=_[_0xe3ea('0x41')](_0x1dbe66[_0xe3ea('0x3e')],{'$or':_['map'](_0x1dbe66['attributes'],function(_0x4961ed){var _0x12d685={};_0x12d685[_0x4961ed]={'$like':'%'+_0x1d47b4[_0xe3ea('0x32')][_0xe3ea('0x42')]+'%'};return _0x12d685;})});}_0x1dbe66=_['merge']({},_0x1dbe66,_0x1d47b4[_0xe3ea('0x44')]);return _0x5a58b2['getTags'](_0x1dbe66);}})[_0xe3ea('0x17')](function(_0x1cfe27){if(_0x1cfe27){_0x534bb5=_0x1cfe27['length'];if(!_0x1d47b4['query'][_0xe3ea('0x39')]('nolimit')){_0x1dbe66['limit']=qs[_0xe3ea('0x3b')](_0x1d47b4[_0xe3ea('0x32')]['limit']);_0x1dbe66[_0xe3ea('0x26')]=qs[_0xe3ea('0x26')](_0x1d47b4['query']['offset']);}return _0x5a58b2[_0xe3ea('0x53')](_0x1dbe66);}})[_0xe3ea('0x17')](function(_0x263a4){if(_0x263a4){return _0x263a4?{'count':_0x534bb5,'rows':_0x263a4}:null;}})[_0xe3ea('0x17')](respondWithResult(_0x2ad2c1,null))[_0xe3ea('0x21')](handleError(_0x2ad2c1,null));};exports[_0xe3ea('0x55')]=function(_0x286834,_0x161221,_0xe75dde){if(_0x286834[_0xe3ea('0x4b')]['id']){delete _0x286834[_0xe3ea('0x4b')]['id'];}return db[_0xe3ea('0x2d')]['findOne']({'where':{'id':_0x286834[_0xe3ea('0x4c')]['id']}})['then'](handleEntityNotFound(_0x161221,null))[_0xe3ea('0x17')](function(_0x1d0aad){if(_0x1d0aad){return _0x1d0aad[_0xe3ea('0x55')](_0x286834[_0xe3ea('0x4b')]['ids']||[]);}return null;})[_0xe3ea('0x17')](respondWithResult(_0x161221,null))[_0xe3ea('0x21')](handleError(_0x161221,null));};
\ No newline at end of file
+var _0x11a2=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','end','status','json','count','offset','limit','reject','save','update','destroy','stack','name','index','ZendeskConfiguration','keys','query','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','dateStart','dateEnd','day','add','filter','merge','map','options','includeAll','findAll','show','params','intersection','include','find','create','body','getFields','findOne','ZendeskField','rawAttributes','getSubjects','getDescriptions','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3f552b,_0x436d59){var _0x47043d=function(_0x476db5){while(--_0x476db5){_0x3f552b['push'](_0x3f552b['shift']());}};_0x47043d(++_0x436d59);}(_0x11a2,0x10c));var _0x211a=function(_0x27587c,_0xae80a7){_0x27587c=_0x27587c-0x0;var _0x537c5d=_0x11a2[_0x27587c];return _0x537c5d;};'use strict';var pdf=require(_0x211a('0x0'));var emlformat=require(_0x211a('0x1'));var rimraf=require(_0x211a('0x2'));var zipdir=require(_0x211a('0x3'));var jsonpatch=require(_0x211a('0x4'));var rp=require(_0x211a('0x5'));var moment=require(_0x211a('0x6'));var BPromise=require(_0x211a('0x7'));var Mustache=require(_0x211a('0x8'));var util=require(_0x211a('0x9'));var path=require(_0x211a('0xa'));var sox=require(_0x211a('0xb'));var csv=require(_0x211a('0xc'));var ejs=require(_0x211a('0xd'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x211a('0xe'));var jsforce=require(_0x211a('0xf'));var deskjs=require(_0x211a('0x10'));var toCsv=require(_0x211a('0xc'));var querystring=require(_0x211a('0x11'));var Papa=require(_0x211a('0x12'));var qs=require(_0x211a('0x13'));var logger=require(_0x211a('0x14'))(_0x211a('0x15'));var utils=require(_0x211a('0x16'));var config=require(_0x211a('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x211a('0x18'));var client=jayson[_0x211a('0x19')][_0x211a('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x48a58a,_0x4b051b,_0x3ac753,_0xc3de50){return new BPromise(function(_0x104cef,_0x2d7c68){var _0x2b26b1=_0xc3de50||client;return _0x2b26b1[_0x211a('0x1b')](_0x48a58a,_0x3ac753)[_0x211a('0x1c')](function(_0x3b8ef5){logger[_0x211a('0x1d')](_0x211a('0x1e'),_0x4b051b,_0x211a('0x1f'));logger[_0x211a('0x20')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4b051b,_0x211a('0x1f'),JSON[_0x211a('0x21')](_0x3b8ef5));if(_0x3b8ef5[_0x211a('0x22')]){if(_0x3b8ef5['error'][_0x211a('0x23')]===0x1f4){logger[_0x211a('0x22')](_0x211a('0x1e'),_0x4b051b,_0x3b8ef5[_0x211a('0x22')][_0x211a('0x24')]);return _0x2d7c68(_0x3b8ef5[_0x211a('0x22')][_0x211a('0x24')]);}logger[_0x211a('0x22')](_0x211a('0x1e'),_0x4b051b,_0x3b8ef5['error'][_0x211a('0x24')]);return _0x104cef(_0x3b8ef5[_0x211a('0x22')]['message']);}else{logger[_0x211a('0x1d')](_0x211a('0x1e'),_0x4b051b,_0x211a('0x1f'));_0x104cef(_0x3b8ef5['result'][_0x211a('0x24')]);}})[_0x211a('0x25')](function(_0x535929){logger['error'](_0x211a('0x1e'),_0x4b051b,_0x535929);_0x2d7c68(_0x535929);});});}function respondWithStatusCode(_0x56e0c0,_0x21a9e9){_0x21a9e9=_0x21a9e9||0xcc;return function(_0x7fb5dc){if(_0x7fb5dc){return _0x56e0c0['sendStatus'](_0x21a9e9);}return _0x56e0c0['status'](_0x21a9e9)[_0x211a('0x26')]();};}function respondWithResult(_0x489c86,_0x21cbd3){_0x21cbd3=_0x21cbd3||0xc8;return function(_0x37c601){if(_0x37c601){return _0x489c86[_0x211a('0x27')](_0x21cbd3)[_0x211a('0x28')](_0x37c601);}};}function respondWithFilteredResult(_0x5264f5,_0x4907fe){return function(_0x4d4e9e){if(_0x4d4e9e){var _0x357146=_0x4d4e9e[_0x211a('0x29')],_0x5304f2=_0x4907fe[_0x211a('0x2a')],_0x3d79dc=_0x4907fe[_0x211a('0x2a')]+_0x4907fe[_0x211a('0x2b')],_0x2cada8;if(_0x3d79dc>=_0x357146){_0x3d79dc=_0x357146;_0x2cada8=0xc8;}else{_0x2cada8=0xce;}_0x5264f5[_0x211a('0x27')](_0x2cada8);return _0x5264f5['set']('Content-Range',_0x5304f2+'-'+_0x3d79dc+'/'+_0x357146)[_0x211a('0x28')](_0x4d4e9e);}return null;};}function patchUpdates(_0x7b0cb){return function(_0x516b2f){try{jsonpatch['apply'](_0x516b2f,_0x7b0cb,!![]);}catch(_0x4552bc){return BPromise[_0x211a('0x2c')](_0x4552bc);}return _0x516b2f[_0x211a('0x2d')]();};}function saveUpdates(_0x1ec8b3,_0x59adf0){return function(_0x501a49){if(_0x501a49){return _0x501a49[_0x211a('0x2e')](_0x1ec8b3)['then'](function(_0x1fbeeb){return _0x1fbeeb;});}return null;};}function removeEntity(_0x3def86,_0x19a891){return function(_0x3193c4){if(_0x3193c4){return _0x3193c4[_0x211a('0x2f')]()[_0x211a('0x1c')](function(){_0x3def86[_0x211a('0x27')](0xcc)[_0x211a('0x26')]();});}};}function handleEntityNotFound(_0x4f6aa5,_0x56f574){return function(_0x1f2aac){if(!_0x1f2aac){_0x4f6aa5['sendStatus'](0x194);}return _0x1f2aac;};}function handleError(_0x185235,_0x2fc062){_0x2fc062=_0x2fc062||0x1f4;return function(_0x144fa0){logger[_0x211a('0x22')](_0x144fa0[_0x211a('0x30')]);if(_0x144fa0[_0x211a('0x31')]){delete _0x144fa0[_0x211a('0x31')];}_0x185235['status'](_0x2fc062)['send'](_0x144fa0);};}exports[_0x211a('0x32')]=function(_0x50c206,_0x444f75){var _0x51d30a={},_0x44eacd={},_0x52ca9f={'count':0x0,'rows':[]};var _0x632b20=db[_0x211a('0x33')]['rawAttributes'];_0x44eacd['model']=_[_0x211a('0x34')](_0x632b20);var _0x53810d={'dateStart':_0x50c206[_0x211a('0x35')]['dateStart'],'dateEnd':_0x50c206[_0x211a('0x35')]['dateEnd']};delete _0x50c206['query']['dateStart'];delete _0x50c206['query']['dateEnd'];_0x44eacd[_0x211a('0x35')]=_[_0x211a('0x34')](_0x50c206[_0x211a('0x35')]);_0x44eacd['filters']=_['intersection'](_0x44eacd['model'],_0x44eacd[_0x211a('0x35')]);_0x51d30a['attributes']=_['intersection'](_0x44eacd[_0x211a('0x36')],qs[_0x211a('0x37')](_0x50c206[_0x211a('0x35')]['fields']));_0x51d30a[_0x211a('0x38')]=_0x51d30a[_0x211a('0x38')][_0x211a('0x39')]?_0x51d30a[_0x211a('0x38')]:_0x44eacd['model'];if(!_0x50c206['query'][_0x211a('0x3a')](_0x211a('0x3b'))){_0x51d30a['limit']=qs[_0x211a('0x2b')](_0x50c206['query'][_0x211a('0x2b')]);_0x51d30a[_0x211a('0x2a')]=qs[_0x211a('0x2a')](_0x50c206['query'][_0x211a('0x2a')]);}_0x51d30a[_0x211a('0x3c')]=qs['sort'](_0x50c206[_0x211a('0x35')][_0x211a('0x3d')]);_0x51d30a[_0x211a('0x3e')]=qs[_0x211a('0x3f')](_[_0x211a('0x40')](_0x50c206['query'],_0x44eacd[_0x211a('0x3f')]));if(_0x53810d[_0x211a('0x41')]){if(_0x53810d[_0x211a('0x42')]){_0x53810d[_0x211a('0x42')]=moment(_0x53810d['dateEnd'])['add'](0x1,_0x211a('0x43'));}else{_0x53810d[_0x211a('0x42')]=moment(_0x53810d[_0x211a('0x41')])[_0x211a('0x44')](0x1,_0x211a('0x43'));}_['merge'](_0x51d30a[_0x211a('0x3e')],{'createdAt':{'$gte':_0x53810d[_0x211a('0x41')],'$lte':_0x53810d[_0x211a('0x42')]}});}if(_0x50c206[_0x211a('0x35')][_0x211a('0x45')]){_0x51d30a[_0x211a('0x3e')]=_[_0x211a('0x46')](_0x51d30a[_0x211a('0x3e')],{'$or':_[_0x211a('0x47')](_0x51d30a['attributes'],function(_0xdd810f){var _0x4cf96d={};_0x4cf96d[_0xdd810f]={'$like':'%'+_0x50c206[_0x211a('0x35')][_0x211a('0x45')]+'%'};return _0x4cf96d;})});}_0x51d30a=_[_0x211a('0x46')]({},_0x51d30a,_0x50c206[_0x211a('0x48')]);var _0x2fb68f={'where':_0x51d30a[_0x211a('0x3e')]};return db[_0x211a('0x33')][_0x211a('0x29')](_0x2fb68f)[_0x211a('0x1c')](function(_0x535b62){_0x52ca9f['count']=_0x535b62;if(_0x50c206['query'][_0x211a('0x49')]){_0x51d30a['include']=[{'all':!![]}];}return db[_0x211a('0x33')][_0x211a('0x4a')](_0x51d30a);})['then'](function(_0x447903){_0x52ca9f['rows']=_0x447903;return _0x52ca9f;})[_0x211a('0x1c')](respondWithFilteredResult(_0x444f75,_0x51d30a))[_0x211a('0x25')](handleError(_0x444f75,null));};exports[_0x211a('0x4b')]=function(_0x26f060,_0x37d252){var _0x2289db={'raw':![],'where':{'id':_0x26f060[_0x211a('0x4c')]['id']}},_0x25a5c3={};_0x25a5c3[_0x211a('0x36')]=_[_0x211a('0x34')](db[_0x211a('0x33')]['rawAttributes']);_0x25a5c3[_0x211a('0x35')]=_[_0x211a('0x34')](_0x26f060[_0x211a('0x35')]);_0x25a5c3['filters']=_[_0x211a('0x4d')](_0x25a5c3[_0x211a('0x36')],_0x25a5c3[_0x211a('0x35')]);_0x2289db[_0x211a('0x38')]=_[_0x211a('0x4d')](_0x25a5c3[_0x211a('0x36')],qs['fields'](_0x26f060['query'][_0x211a('0x37')]));_0x2289db['attributes']=_0x2289db[_0x211a('0x38')]['length']?_0x2289db[_0x211a('0x38')]:_0x25a5c3[_0x211a('0x36')];if(_0x26f060['query'][_0x211a('0x49')]){_0x2289db[_0x211a('0x4e')]=[{'all':!![]}];}_0x2289db=_[_0x211a('0x46')]({},_0x2289db,_0x26f060['options']);return db['ZendeskConfiguration'][_0x211a('0x4f')](_0x2289db)['then'](handleEntityNotFound(_0x37d252,null))[_0x211a('0x1c')](respondWithResult(_0x37d252,null))[_0x211a('0x25')](handleError(_0x37d252,null));};exports[_0x211a('0x50')]=function(_0x3555d3,_0x1abf5c){return db['ZendeskConfiguration'][_0x211a('0x50')](_0x3555d3[_0x211a('0x51')],{})[_0x211a('0x1c')](respondWithResult(_0x1abf5c,0xc9))[_0x211a('0x25')](handleError(_0x1abf5c,null));};exports['update']=function(_0x3b8b6d,_0x265e83){if(_0x3b8b6d['body']['id']){delete _0x3b8b6d[_0x211a('0x51')]['id'];}return db[_0x211a('0x33')][_0x211a('0x4f')]({'where':{'id':_0x3b8b6d['params']['id']}})[_0x211a('0x1c')](handleEntityNotFound(_0x265e83,null))[_0x211a('0x1c')](saveUpdates(_0x3b8b6d['body'],null))[_0x211a('0x1c')](respondWithResult(_0x265e83,null))[_0x211a('0x25')](handleError(_0x265e83,null));};exports['destroy']=function(_0x24d5ea,_0x224fbc){return db[_0x211a('0x33')][_0x211a('0x4f')]({'where':{'id':_0x24d5ea[_0x211a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x224fbc,null))[_0x211a('0x1c')](removeEntity(_0x224fbc,null))[_0x211a('0x25')](handleError(_0x224fbc,null));};exports[_0x211a('0x52')]=function(_0x1ba2a3,_0x1f53eb,_0x228534){var _0x1ad6f0={};var _0x1df7ad={};var _0x3281b2;var _0x5df933;return db['ZendeskConfiguration'][_0x211a('0x53')]({'where':{'id':_0x1ba2a3[_0x211a('0x4c')]['id']}})[_0x211a('0x1c')](handleEntityNotFound(_0x1f53eb,null))[_0x211a('0x1c')](function(_0x3a2fe9){if(_0x3a2fe9){_0x3281b2=_0x3a2fe9;_0x1df7ad[_0x211a('0x36')]=_[_0x211a('0x34')](db[_0x211a('0x54')][_0x211a('0x55')]);_0x1df7ad[_0x211a('0x35')]=_['keys'](_0x1ba2a3['query']);_0x1df7ad[_0x211a('0x3f')]=_[_0x211a('0x4d')](_0x1df7ad['model'],_0x1df7ad[_0x211a('0x35')]);_0x1ad6f0[_0x211a('0x38')]=_['intersection'](_0x1df7ad[_0x211a('0x36')],qs['fields'](_0x1ba2a3[_0x211a('0x35')]['fields']));_0x1ad6f0[_0x211a('0x38')]=_0x1ad6f0['attributes'][_0x211a('0x39')]?_0x1ad6f0[_0x211a('0x38')]:_0x1df7ad[_0x211a('0x36')];_0x1ad6f0['order']=qs['sort'](_0x1ba2a3[_0x211a('0x35')][_0x211a('0x3d')]);_0x1ad6f0['where']=qs['filters'](_['pick'](_0x1ba2a3[_0x211a('0x35')],_0x1df7ad[_0x211a('0x3f')]));if(_0x1ba2a3['query'][_0x211a('0x45')]){_0x1ad6f0[_0x211a('0x3e')]=_[_0x211a('0x46')](_0x1ad6f0['where'],{'$or':_[_0x211a('0x47')](_0x1ad6f0['attributes'],function(_0x5c1deb){var _0x44a99a={};_0x44a99a[_0x5c1deb]={'$like':'%'+_0x1ba2a3[_0x211a('0x35')][_0x211a('0x45')]+'%'};return _0x44a99a;})});}_0x1ad6f0=_[_0x211a('0x46')]({},_0x1ad6f0,_0x1ba2a3[_0x211a('0x48')]);return _0x3281b2[_0x211a('0x52')](_0x1ad6f0);}})[_0x211a('0x1c')](function(_0x545526){if(_0x545526){_0x5df933=_0x545526['length'];if(!_0x1ba2a3[_0x211a('0x35')][_0x211a('0x3a')](_0x211a('0x3b'))){_0x1ad6f0[_0x211a('0x2b')]=qs['limit'](_0x1ba2a3[_0x211a('0x35')]['limit']);_0x1ad6f0['offset']=qs[_0x211a('0x2a')](_0x1ba2a3[_0x211a('0x35')][_0x211a('0x2a')]);}return _0x3281b2[_0x211a('0x52')](_0x1ad6f0);}})['then'](function(_0x16a980){if(_0x16a980){return _0x16a980?{'count':_0x5df933,'rows':_0x16a980}:null;}})[_0x211a('0x1c')](respondWithResult(_0x1f53eb,null))[_0x211a('0x25')](handleError(_0x1f53eb,null));};exports[_0x211a('0x56')]=function(_0x33a601,_0x31bfab,_0x4fd1ae){var _0x5d1443={};var _0x522840={};var _0x5c6f0e;var _0x76d2ff;return db[_0x211a('0x33')]['findOne']({'where':{'id':_0x33a601['params']['id']}})[_0x211a('0x1c')](handleEntityNotFound(_0x31bfab,null))[_0x211a('0x1c')](function(_0x5a228d){if(_0x5a228d){_0x5c6f0e=_0x5a228d;_0x522840[_0x211a('0x36')]=_[_0x211a('0x34')](db[_0x211a('0x54')]['rawAttributes']);_0x522840[_0x211a('0x35')]=_[_0x211a('0x34')](_0x33a601[_0x211a('0x35')]);_0x522840[_0x211a('0x3f')]=_['intersection'](_0x522840[_0x211a('0x36')],_0x522840[_0x211a('0x35')]);_0x5d1443[_0x211a('0x38')]=_[_0x211a('0x4d')](_0x522840[_0x211a('0x36')],qs[_0x211a('0x37')](_0x33a601[_0x211a('0x35')][_0x211a('0x37')]));_0x5d1443['attributes']=_0x5d1443['attributes'][_0x211a('0x39')]?_0x5d1443[_0x211a('0x38')]:_0x522840[_0x211a('0x36')];_0x5d1443[_0x211a('0x3c')]=qs[_0x211a('0x3d')](_0x33a601[_0x211a('0x35')][_0x211a('0x3d')]);_0x5d1443[_0x211a('0x3e')]=qs[_0x211a('0x3f')](_[_0x211a('0x40')](_0x33a601[_0x211a('0x35')],_0x522840[_0x211a('0x3f')]));if(_0x33a601['query'][_0x211a('0x45')]){_0x5d1443[_0x211a('0x3e')]=_[_0x211a('0x46')](_0x5d1443[_0x211a('0x3e')],{'$or':_[_0x211a('0x47')](_0x5d1443['attributes'],function(_0x2a5d59){var _0x5a4ecf={};_0x5a4ecf[_0x2a5d59]={'$like':'%'+_0x33a601[_0x211a('0x35')][_0x211a('0x45')]+'%'};return _0x5a4ecf;})});}_0x5d1443=_['merge']({},_0x5d1443,_0x33a601['options']);return _0x5c6f0e[_0x211a('0x56')](_0x5d1443);}})[_0x211a('0x1c')](function(_0x3c4ee7){if(_0x3c4ee7){_0x76d2ff=_0x3c4ee7[_0x211a('0x39')];if(!_0x33a601[_0x211a('0x35')][_0x211a('0x3a')](_0x211a('0x3b'))){_0x5d1443[_0x211a('0x2b')]=qs[_0x211a('0x2b')](_0x33a601[_0x211a('0x35')][_0x211a('0x2b')]);_0x5d1443['offset']=qs['offset'](_0x33a601[_0x211a('0x35')][_0x211a('0x2a')]);}return _0x5c6f0e[_0x211a('0x56')](_0x5d1443);}})[_0x211a('0x1c')](function(_0x5b71af){if(_0x5b71af){return _0x5b71af?{'count':_0x76d2ff,'rows':_0x5b71af}:null;}})[_0x211a('0x1c')](respondWithResult(_0x31bfab,null))[_0x211a('0x25')](handleError(_0x31bfab,null));};exports[_0x211a('0x57')]=function(_0x5ae1ca,_0x1d5f40,_0x537d8c){var _0x2645ea={};var _0x131ca6={};var _0x30208e;var _0x1e36d8;return db[_0x211a('0x33')][_0x211a('0x53')]({'where':{'id':_0x5ae1ca[_0x211a('0x4c')]['id']}})[_0x211a('0x1c')](handleEntityNotFound(_0x1d5f40,null))[_0x211a('0x1c')](function(_0x71de38){if(_0x71de38){_0x30208e=_0x71de38;_0x131ca6[_0x211a('0x36')]=_[_0x211a('0x34')](db[_0x211a('0x54')][_0x211a('0x55')]);_0x131ca6[_0x211a('0x35')]=_[_0x211a('0x34')](_0x5ae1ca[_0x211a('0x35')]);_0x131ca6['filters']=_[_0x211a('0x4d')](_0x131ca6[_0x211a('0x36')],_0x131ca6[_0x211a('0x35')]);_0x2645ea[_0x211a('0x38')]=_[_0x211a('0x4d')](_0x131ca6[_0x211a('0x36')],qs[_0x211a('0x37')](_0x5ae1ca[_0x211a('0x35')][_0x211a('0x37')]));_0x2645ea[_0x211a('0x38')]=_0x2645ea[_0x211a('0x38')][_0x211a('0x39')]?_0x2645ea[_0x211a('0x38')]:_0x131ca6[_0x211a('0x36')];_0x2645ea[_0x211a('0x3c')]=qs[_0x211a('0x3d')](_0x5ae1ca[_0x211a('0x35')]['sort']);_0x2645ea[_0x211a('0x3e')]=qs[_0x211a('0x3f')](_[_0x211a('0x40')](_0x5ae1ca[_0x211a('0x35')],_0x131ca6[_0x211a('0x3f')]));if(_0x5ae1ca[_0x211a('0x35')]['filter']){_0x2645ea[_0x211a('0x3e')]=_[_0x211a('0x46')](_0x2645ea[_0x211a('0x3e')],{'$or':_[_0x211a('0x47')](_0x2645ea[_0x211a('0x38')],function(_0x5c9313){var _0x44b013={};_0x44b013[_0x5c9313]={'$like':'%'+_0x5ae1ca[_0x211a('0x35')]['filter']+'%'};return _0x44b013;})});}_0x2645ea=_[_0x211a('0x46')]({},_0x2645ea,_0x5ae1ca['options']);return _0x30208e[_0x211a('0x57')](_0x2645ea);}})[_0x211a('0x1c')](function(_0x532b8f){if(_0x532b8f){_0x1e36d8=_0x532b8f[_0x211a('0x39')];if(!_0x5ae1ca[_0x211a('0x35')][_0x211a('0x3a')](_0x211a('0x3b'))){_0x2645ea[_0x211a('0x2b')]=qs[_0x211a('0x2b')](_0x5ae1ca[_0x211a('0x35')][_0x211a('0x2b')]);_0x2645ea[_0x211a('0x2a')]=qs[_0x211a('0x2a')](_0x5ae1ca[_0x211a('0x35')][_0x211a('0x2a')]);}return _0x30208e[_0x211a('0x57')](_0x2645ea);}})[_0x211a('0x1c')](function(_0x34bc1b){if(_0x34bc1b){return _0x34bc1b?{'count':_0x1e36d8,'rows':_0x34bc1b}:null;}})[_0x211a('0x1c')](respondWithResult(_0x1d5f40,null))[_0x211a('0x25')](handleError(_0x1d5f40,null));};exports[_0x211a('0x58')]=function(_0x156c61,_0x475c33,_0x8b4b85){var _0x50991d={};var _0xaedc1a={};var _0x21ee6e;var _0x40a3d8;return db[_0x211a('0x33')]['findOne']({'where':{'id':_0x156c61[_0x211a('0x4c')]['id']}})[_0x211a('0x1c')](handleEntityNotFound(_0x475c33,null))[_0x211a('0x1c')](function(_0x51f57b){if(_0x51f57b){_0x21ee6e=_0x51f57b;_0xaedc1a[_0x211a('0x36')]=_[_0x211a('0x34')](db['Tag']['rawAttributes']);_0xaedc1a['query']=_['keys'](_0x156c61[_0x211a('0x35')]);_0xaedc1a[_0x211a('0x3f')]=_[_0x211a('0x4d')](_0xaedc1a[_0x211a('0x36')],_0xaedc1a[_0x211a('0x35')]);_0x50991d[_0x211a('0x38')]=_[_0x211a('0x4d')](_0xaedc1a[_0x211a('0x36')],qs[_0x211a('0x37')](_0x156c61[_0x211a('0x35')]['fields']));_0x50991d[_0x211a('0x38')]=_0x50991d[_0x211a('0x38')]['length']?_0x50991d['attributes']:_0xaedc1a[_0x211a('0x36')];_0x50991d[_0x211a('0x3c')]=qs['sort'](_0x156c61['query'][_0x211a('0x3d')]);_0x50991d[_0x211a('0x3e')]=qs[_0x211a('0x3f')](_[_0x211a('0x40')](_0x156c61[_0x211a('0x35')],_0xaedc1a[_0x211a('0x3f')]));if(_0x156c61[_0x211a('0x35')][_0x211a('0x45')]){_0x50991d[_0x211a('0x3e')]=_['merge'](_0x50991d['where'],{'$or':_[_0x211a('0x47')](_0x50991d['attributes'],function(_0x4aa466){var _0x28d6a3={};_0x28d6a3[_0x4aa466]={'$like':'%'+_0x156c61[_0x211a('0x35')][_0x211a('0x45')]+'%'};return _0x28d6a3;})});}_0x50991d=_[_0x211a('0x46')]({},_0x50991d,_0x156c61[_0x211a('0x48')]);return _0x21ee6e[_0x211a('0x58')](_0x50991d);}})['then'](function(_0x11b335){if(_0x11b335){_0x40a3d8=_0x11b335[_0x211a('0x39')];if(!_0x156c61[_0x211a('0x35')][_0x211a('0x3a')](_0x211a('0x3b'))){_0x50991d[_0x211a('0x2b')]=qs[_0x211a('0x2b')](_0x156c61[_0x211a('0x35')][_0x211a('0x2b')]);_0x50991d[_0x211a('0x2a')]=qs[_0x211a('0x2a')](_0x156c61['query'][_0x211a('0x2a')]);}return _0x21ee6e[_0x211a('0x58')](_0x50991d);}})[_0x211a('0x1c')](function(_0x1e27d3){if(_0x1e27d3){return _0x1e27d3?{'count':_0x40a3d8,'rows':_0x1e27d3}:null;}})[_0x211a('0x1c')](respondWithResult(_0x475c33,null))[_0x211a('0x25')](handleError(_0x475c33,null));};exports[_0x211a('0x59')]=function(_0x450c60,_0x5b0378,_0x42e543){if(_0x450c60[_0x211a('0x51')]['id']){delete _0x450c60['body']['id'];}return db[_0x211a('0x33')][_0x211a('0x53')]({'where':{'id':_0x450c60[_0x211a('0x4c')]['id']}})[_0x211a('0x1c')](handleEntityNotFound(_0x5b0378,null))[_0x211a('0x1c')](function(_0x27a6ca){if(_0x27a6ca){return _0x27a6ca['setTags'](_0x450c60[_0x211a('0x51')][_0x211a('0x5a')]||[]);}return null;})[_0x211a('0x1c')](respondWithResult(_0x5b0378,null))[_0x211a('0x25')](handleError(_0x5b0378,null));};
\ No newline at end of file
index d642d8c..989bcdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a51=['ZendeskConfiguration','lodash','api','moment','bluebird','request-promise','./intZendeskConfiguration.attributes','exports'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x3a51,0x69));var _0x13a5=function(_0x22afe5,_0x5497b9){_0x22afe5=_0x22afe5-0x0;var _0x3108a4=_0x3a51[_0x22afe5];return _0x3108a4;};'use strict';var _=require(_0x13a5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x13a5('0x1'));var moment=require(_0x13a5('0x2'));var BPromise=require(_0x13a5('0x3'));var rp=require(_0x13a5('0x4'));var attributes=require(_0x13a5('0x5'));module[_0x13a5('0x6')]=function(_0x3d6e1d,_0xbd8b85){return _0x3d6e1d['define'](_0x13a5('0x7'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x38f3=['define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','request-promise','./intZendeskConfiguration.attributes','exports'];(function(_0x8dbe00,_0x59d03e){var _0x1ddf56=function(_0x2ae6d2){while(--_0x2ae6d2){_0x8dbe00['push'](_0x8dbe00['shift']());}};_0x1ddf56(++_0x59d03e);}(_0x38f3,0xd4));var _0x338f=function(_0x2e1907,_0x229a70){_0x2e1907=_0x2e1907-0x0;var _0x401555=_0x38f3[_0x2e1907];return _0x401555;};'use strict';var _=require(_0x338f('0x0'));var util=require(_0x338f('0x1'));var logger=require(_0x338f('0x2'))(_0x338f('0x3'));var moment=require(_0x338f('0x4'));var BPromise=require('bluebird');var rp=require(_0x338f('0x5'));var attributes=require(_0x338f('0x6'));module[_0x338f('0x7')]=function(_0x8b052,_0x514611){return _0x8b052[_0x338f('0x8')](_0x338f('0x9'),attributes,{'tableName':_0x338f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1c01170..2f04a79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9656=['info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x45319d,_0x5a0653){var _0x20f076=function(_0x3da82c){while(--_0x3da82c){_0x45319d['push'](_0x45319d['shift']());}};_0x20f076(++_0x5a0653);}(_0x9656,0x86));var _0x6965=function(_0x505389,_0x4667e7){_0x505389=_0x505389-0x0;var _0x4347a8=_0x9656[_0x505389];return _0x4347a8;};'use strict';var _=require(_0x6965('0x0'));var util=require(_0x6965('0x1'));var moment=require('moment');var BPromise=require(_0x6965('0x2'));var rs=require(_0x6965('0x3'));var fs=require('fs');var db=require(_0x6965('0x4'))['db'];var utils=require(_0x6965('0x5'));var logger=require('../../config/logger')(_0x6965('0x6'));var config=require(_0x6965('0x7'));var jayson=require(_0x6965('0x8'));var client=jayson[_0x6965('0x9')][_0x6965('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35bc2c,_0x19b4eb,_0x556aa7){return new BPromise(function(_0x118d87,_0x34f343){return client[_0x6965('0xb')](_0x35bc2c,_0x556aa7)[_0x6965('0xc')](function(_0x5a6e3d){logger[_0x6965('0xd')](_0x6965('0xe'),_0x19b4eb,_0x6965('0xf'));logger[_0x6965('0x10')](_0x6965('0x11'),_0x19b4eb,_0x6965('0xf'),JSON['stringify'](_0x5a6e3d));if(_0x5a6e3d[_0x6965('0x12')]){if(_0x5a6e3d['error']['code']===0x1f4){logger['error'](_0x6965('0xe'),_0x19b4eb,_0x5a6e3d[_0x6965('0x12')][_0x6965('0x13')]);return _0x34f343(_0x5a6e3d[_0x6965('0x12')][_0x6965('0x13')]);}logger[_0x6965('0x12')](_0x6965('0xe'),_0x19b4eb,_0x5a6e3d[_0x6965('0x12')][_0x6965('0x13')]);return _0x118d87(_0x5a6e3d[_0x6965('0x12')][_0x6965('0x13')]);}else{logger[_0x6965('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x19b4eb,_0x6965('0xf'));_0x118d87(_0x5a6e3d[_0x6965('0x14')][_0x6965('0x13')]);}})['catch'](function(_0x4bf1d0){logger[_0x6965('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x19b4eb,_0x4bf1d0);_0x34f343(_0x4bf1d0);});});}
\ No newline at end of file
+var _0x431d=['../../config/environment','jayson/promise','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5c904b,_0x5b384b){var _0x4ea5d5=function(_0x22def5){while(--_0x22def5){_0x5c904b['push'](_0x5c904b['shift']());}};_0x4ea5d5(++_0x5b384b);}(_0x431d,0x10b));var _0xd431=function(_0x50439d,_0x3aed4c){_0x50439d=_0x50439d-0x0;var _0x5dc279=_0x431d[_0x50439d];return _0x5dc279;};'use strict';var _=require('lodash');var util=require(_0xd431('0x0'));var moment=require('moment');var BPromise=require(_0xd431('0x1'));var rs=require(_0xd431('0x2'));var fs=require('fs');var db=require(_0xd431('0x3'))['db'];var utils=require(_0xd431('0x4'));var logger=require(_0xd431('0x5'))('rpc');var config=require(_0xd431('0x6'));var jayson=require(_0xd431('0x7'));var client=jayson[_0xd431('0x8')][_0xd431('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5dbbb2,_0x19206d,_0x283bb0){return new BPromise(function(_0x5899bb,_0x10c19e){return client[_0xd431('0xa')](_0x5dbbb2,_0x283bb0)['then'](function(_0x30e4c1){logger[_0xd431('0xb')](_0xd431('0xc'),_0x19206d,'request\x20sent');logger[_0xd431('0xd')](_0xd431('0xe'),_0x19206d,'request\x20sent',JSON['stringify'](_0x30e4c1));if(_0x30e4c1[_0xd431('0xf')]){if(_0x30e4c1['error'][_0xd431('0x10')]===0x1f4){logger[_0xd431('0xf')](_0xd431('0xc'),_0x19206d,_0x30e4c1['error'][_0xd431('0x11')]);return _0x10c19e(_0x30e4c1[_0xd431('0xf')][_0xd431('0x11')]);}logger[_0xd431('0xf')](_0xd431('0xc'),_0x19206d,_0x30e4c1['error']['message']);return _0x5899bb(_0x30e4c1[_0xd431('0xf')][_0xd431('0x11')]);}else{logger[_0xd431('0xb')](_0xd431('0xc'),_0x19206d,_0xd431('0x12'));_0x5899bb(_0x30e4c1[_0xd431('0x13')][_0xd431('0x11')]);}})[_0xd431('0x14')](function(_0x9d2fae){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x19206d,_0x9d2fae);_0x10c19e(_0x9d2fae);});});}
\ No newline at end of file
index 24bb918..3d84212 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d2b=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','/:id','show','post','create','update','delete','exports','path'];(function(_0x5ac6b4,_0x13f7c0){var _0x55db28=function(_0x3c757b){while(--_0x3c757b){_0x5ac6b4['push'](_0x5ac6b4['shift']());}};_0x55db28(++_0x13f7c0);}(_0x0d2b,0x7f));var _0xb0d2=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x0d2b[_0x342baa];return _0x1208f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb0d2('0x0'));var express=require(_0xb0d2('0x1'));var router=express[_0xb0d2('0x2')]();var auth=require(_0xb0d2('0x3'));var interaction=require(_0xb0d2('0x4'));var config=require(_0xb0d2('0x5'));var controller=require(_0xb0d2('0x6'));router[_0xb0d2('0x7')]('/',auth[_0xb0d2('0x8')](),controller['index']);router[_0xb0d2('0x7')](_0xb0d2('0x9'),auth['isAuthenticated'](),controller[_0xb0d2('0xa')]);router[_0xb0d2('0xb')]('/',auth[_0xb0d2('0x8')](),controller[_0xb0d2('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb0d2('0xd')]);router[_0xb0d2('0xe')](_0xb0d2('0x9'),auth[_0xb0d2('0x8')](),controller['destroy']);module[_0xb0d2('0xf')]=router;
\ No newline at end of file
+var _0xc461=['update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','get','/:id','post','create'];(function(_0x9c0e32,_0xd54fbb){var _0x5d8f47=function(_0x2b5e3a){while(--_0x2b5e3a){_0x9c0e32['push'](_0x9c0e32['shift']());}};_0x5d8f47(++_0xd54fbb);}(_0xc461,0x8b));var _0x1c46=function(_0x257c0e,_0x4631da){_0x257c0e=_0x257c0e-0x0;var _0x393c16=_0xc461[_0x257c0e];return _0x393c16;};'use strict';var multer=require(_0x1c46('0x0'));var util=require(_0x1c46('0x1'));var path=require(_0x1c46('0x2'));var express=require(_0x1c46('0x3'));var router=express[_0x1c46('0x4')]();var auth=require(_0x1c46('0x5'));var interaction=require(_0x1c46('0x6'));var config=require(_0x1c46('0x7'));var controller=require(_0x1c46('0x8'));router['get']('/',auth[_0x1c46('0x9')](),controller['index']);router[_0x1c46('0xa')](_0x1c46('0xb'),auth[_0x1c46('0x9')](),controller['show']);router[_0x1c46('0xc')]('/',auth['isAuthenticated'](),controller[_0x1c46('0xd')]);router['put'](_0x1c46('0xb'),auth[_0x1c46('0x9')](),controller[_0x1c46('0xe')]);router['delete'](_0x1c46('0xb'),auth[_0x1c46('0x9')](),controller[_0x1c46('0xf')]);module[_0x1c46('0x10')]=router;
\ No newline at end of file
index 4ca1af6..f2b1f1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9348=['exports','ENUM','string','variable','keyValue','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x14253b,_0x5a189a){var _0x32bf95=function(_0x2f238c){while(--_0x2f238c){_0x14253b['push'](_0x14253b['shift']());}};_0x32bf95(++_0x5a189a);}(_0x9348,0x10d));var _0x8934=function(_0x238878,_0x22da01){_0x238878=_0x238878-0x0;var _0x504c34=_0x9348[_0x238878];return _0x504c34;};'use strict';var Sequelize=require(_0x8934('0x0'));module[_0x8934('0x1')]={'type':{'type':Sequelize[_0x8934('0x2')](_0x8934('0x3'),_0x8934('0x4'),'customVariable',_0x8934('0x5')),'defaultValue':_0x8934('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8934('0x6')]},'keyType':{'type':Sequelize[_0x8934('0x2')](_0x8934('0x3'),_0x8934('0x4'),_0x8934('0x7'))},'keyContent':{'type':Sequelize[_0x8934('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8934('0x6')]},'customField':{'type':Sequelize[_0x8934('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8934('0x6')]}};
\ No newline at end of file
+var _0xac4a=['exports','ENUM','string','variable','customVariable','STRING','BOOLEAN','sequelize'];(function(_0x2c33aa,_0x13f08d){var _0x46f89b=function(_0x34a68b){while(--_0x34a68b){_0x2c33aa['push'](_0x2c33aa['shift']());}};_0x46f89b(++_0x13f08d);}(_0xac4a,0x13f));var _0xaac4=function(_0x3dbfcc,_0x46c3c8){_0x3dbfcc=_0x3dbfcc-0x0;var _0x53d788=_0xac4a[_0x3dbfcc];return _0x53d788;};'use strict';var Sequelize=require(_0xaac4('0x0'));module[_0xaac4('0x1')]={'type':{'type':Sequelize[_0xaac4('0x2')](_0xaac4('0x3'),_0xaac4('0x4'),_0xaac4('0x5'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0xaac4('0x6')]},'key':{'type':Sequelize[_0xaac4('0x6')]},'keyType':{'type':Sequelize[_0xaac4('0x2')]('string',_0xaac4('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xaac4('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xaac4('0x6')]},'customField':{'type':Sequelize[_0xaac4('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 6deabe6..65b28e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3333=['keys','dateStart','query','dateEnd','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day','filter','merge','map','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','ZendeskField','rawAttributes'];(function(_0x62c938,_0x52c0ae){var _0x398dff=function(_0x1799c2){while(--_0x1799c2){_0x62c938['push'](_0x62c938['shift']());}};_0x398dff(++_0x52c0ae);}(_0x3333,0x154));var _0x3333=function(_0x602ca8,_0x568e82){_0x602ca8=_0x602ca8-0x0;var _0x26e8ab=_0x3333[_0x602ca8];return _0x26e8ab;};'use strict';var pdf=require(_0x3333('0x0'));var emlformat=require(_0x3333('0x1'));var rimraf=require(_0x3333('0x2'));var zipdir=require(_0x3333('0x3'));var jsonpatch=require(_0x3333('0x4'));var rp=require(_0x3333('0x5'));var moment=require(_0x3333('0x6'));var BPromise=require(_0x3333('0x7'));var Mustache=require(_0x3333('0x8'));var util=require(_0x3333('0x9'));var path=require(_0x3333('0xa'));var sox=require('sox');var csv=require(_0x3333('0xb'));var ejs=require(_0x3333('0xc'));var fs=require('fs');var _=require(_0x3333('0xd'));var squel=require(_0x3333('0xe'));var crypto=require(_0x3333('0xf'));var jsforce=require(_0x3333('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3333('0x11'));var Papa=require(_0x3333('0x12'));var qs=require(_0x3333('0x13'));var logger=require(_0x3333('0x14'))(_0x3333('0x15'));var utils=require(_0x3333('0x16'));var config=require(_0x3333('0x17'));var db=require(_0x3333('0x18'))['db'];function respondWithStatusCode(_0x321321,_0x5dc73f){_0x5dc73f=_0x5dc73f||0xcc;return function(_0x465c5c){if(_0x465c5c){return _0x321321['sendStatus'](_0x5dc73f);}return _0x321321[_0x3333('0x19')](_0x5dc73f)[_0x3333('0x1a')]();};}function respondWithResult(_0x320303,_0x41ee24){_0x41ee24=_0x41ee24||0xc8;return function(_0x30eb3f){if(_0x30eb3f){return _0x320303[_0x3333('0x19')](_0x41ee24)[_0x3333('0x1b')](_0x30eb3f);}};}function respondWithFilteredResult(_0x3b30e5,_0x1b5d8f){return function(_0xa710f7){if(_0xa710f7){var _0x19b7c4=_0xa710f7[_0x3333('0x1c')],_0x3e6650=_0x1b5d8f['offset'],_0x32aadf=_0x1b5d8f[_0x3333('0x1d')]+_0x1b5d8f[_0x3333('0x1e')],_0x2fc553;if(_0x32aadf>=_0x19b7c4){_0x32aadf=_0x19b7c4;_0x2fc553=0xc8;}else{_0x2fc553=0xce;}_0x3b30e5[_0x3333('0x19')](_0x2fc553);return _0x3b30e5[_0x3333('0x1f')](_0x3333('0x20'),_0x3e6650+'-'+_0x32aadf+'/'+_0x19b7c4)[_0x3333('0x1b')](_0xa710f7);}return null;};}function patchUpdates(_0xebbe11){return function(_0xa77272){try{jsonpatch[_0x3333('0x21')](_0xa77272,_0xebbe11,!![]);}catch(_0x779a54){return BPromise[_0x3333('0x22')](_0x779a54);}return _0xa77272[_0x3333('0x23')]();};}function saveUpdates(_0x51858d,_0x18a9a0){return function(_0x4cd5a8){if(_0x4cd5a8){return _0x4cd5a8[_0x3333('0x24')](_0x51858d)[_0x3333('0x25')](function(_0x45212f){return _0x45212f;});}return null;};}function removeEntity(_0x565137,_0xa96a04){return function(_0x15940a){if(_0x15940a){return _0x15940a[_0x3333('0x26')]()[_0x3333('0x25')](function(){_0x565137[_0x3333('0x19')](0xcc)[_0x3333('0x1a')]();});}};}function handleEntityNotFound(_0x8185cf,_0x1d3aca){return function(_0x2b5cd7){if(!_0x2b5cd7){_0x8185cf['sendStatus'](0x194);}return _0x2b5cd7;};}function handleError(_0x29a392,_0x363e07){_0x363e07=_0x363e07||0x1f4;return function(_0x2df599){logger[_0x3333('0x27')](_0x2df599['stack']);if(_0x2df599[_0x3333('0x28')]){delete _0x2df599[_0x3333('0x28')];}_0x29a392[_0x3333('0x19')](_0x363e07)[_0x3333('0x29')](_0x2df599);};}exports[_0x3333('0x2a')]=function(_0x48d51b,_0x362cb2){var _0x44e45e={},_0x447e78={},_0x5efaae={'count':0x0,'rows':[]};var _0x7f0d9d=db[_0x3333('0x2b')][_0x3333('0x2c')];_0x447e78['model']=_[_0x3333('0x2d')](_0x7f0d9d);var _0x5e8b2f={'dateStart':_0x48d51b['query'][_0x3333('0x2e')],'dateEnd':_0x48d51b[_0x3333('0x2f')][_0x3333('0x30')]};delete _0x48d51b[_0x3333('0x2f')][_0x3333('0x2e')];delete _0x48d51b[_0x3333('0x2f')][_0x3333('0x30')];_0x447e78[_0x3333('0x2f')]=_[_0x3333('0x2d')](_0x48d51b['query']);_0x447e78[_0x3333('0x31')]=_[_0x3333('0x32')](_0x447e78['model'],_0x447e78[_0x3333('0x2f')]);_0x44e45e['attributes']=_[_0x3333('0x32')](_0x447e78[_0x3333('0x33')],qs[_0x3333('0x34')](_0x48d51b[_0x3333('0x2f')][_0x3333('0x34')]));_0x44e45e[_0x3333('0x35')]=_0x44e45e[_0x3333('0x35')][_0x3333('0x36')]?_0x44e45e['attributes']:_0x447e78[_0x3333('0x33')];if(!_0x48d51b[_0x3333('0x2f')][_0x3333('0x37')](_0x3333('0x38'))){_0x44e45e[_0x3333('0x1e')]=qs['limit'](_0x48d51b[_0x3333('0x2f')][_0x3333('0x1e')]);_0x44e45e[_0x3333('0x1d')]=qs['offset'](_0x48d51b['query']['offset']);}_0x44e45e[_0x3333('0x39')]=qs[_0x3333('0x3a')](_0x48d51b['query'][_0x3333('0x3a')]);_0x44e45e[_0x3333('0x3b')]=qs[_0x3333('0x31')](_[_0x3333('0x3c')](_0x48d51b[_0x3333('0x2f')],_0x447e78[_0x3333('0x31')]));if(_0x5e8b2f[_0x3333('0x2e')]){if(_0x5e8b2f[_0x3333('0x30')]){_0x5e8b2f[_0x3333('0x30')]=moment(_0x5e8b2f[_0x3333('0x30')])[_0x3333('0x3d')](0x1,'day');}else{_0x5e8b2f[_0x3333('0x30')]=moment(_0x5e8b2f[_0x3333('0x2e')])[_0x3333('0x3d')](0x1,_0x3333('0x3e'));}_['merge'](_0x44e45e[_0x3333('0x3b')],{'createdAt':{'$gte':_0x5e8b2f[_0x3333('0x2e')],'$lte':_0x5e8b2f[_0x3333('0x30')]}});}if(_0x48d51b[_0x3333('0x2f')][_0x3333('0x3f')]){_0x44e45e['where']=_[_0x3333('0x40')](_0x44e45e[_0x3333('0x3b')],{'$or':_[_0x3333('0x41')](_0x44e45e[_0x3333('0x35')],function(_0x2db6c1){var _0x169a90={};_0x169a90[_0x2db6c1]={'$like':'%'+_0x48d51b[_0x3333('0x2f')][_0x3333('0x3f')]+'%'};return _0x169a90;})});}_0x44e45e=_[_0x3333('0x40')]({},_0x44e45e,_0x48d51b[_0x3333('0x42')]);var _0x55e20f={'where':_0x44e45e[_0x3333('0x3b')]};return db[_0x3333('0x2b')]['count'](_0x55e20f)['then'](function(_0x473540){_0x5efaae[_0x3333('0x1c')]=_0x473540;if(_0x48d51b[_0x3333('0x2f')]['includeAll']){_0x44e45e[_0x3333('0x43')]=[{'all':!![]}];}return db[_0x3333('0x2b')][_0x3333('0x44')](_0x44e45e);})['then'](function(_0x7ec33c){_0x5efaae[_0x3333('0x45')]=_0x7ec33c;return _0x5efaae;})[_0x3333('0x25')](respondWithFilteredResult(_0x362cb2,_0x44e45e))[_0x3333('0x46')](handleError(_0x362cb2,null));};exports[_0x3333('0x47')]=function(_0x421c26,_0x5bf7e7){var _0x2f9cf1={'raw':!![],'where':{'id':_0x421c26[_0x3333('0x48')]['id']}},_0x55555a={};_0x55555a[_0x3333('0x33')]=_[_0x3333('0x2d')](db[_0x3333('0x2b')]['rawAttributes']);_0x55555a[_0x3333('0x2f')]=_[_0x3333('0x2d')](_0x421c26[_0x3333('0x2f')]);_0x55555a[_0x3333('0x31')]=_['intersection'](_0x55555a['model'],_0x55555a[_0x3333('0x2f')]);_0x2f9cf1['attributes']=_['intersection'](_0x55555a[_0x3333('0x33')],qs[_0x3333('0x34')](_0x421c26[_0x3333('0x2f')]['fields']));_0x2f9cf1[_0x3333('0x35')]=_0x2f9cf1[_0x3333('0x35')][_0x3333('0x36')]?_0x2f9cf1[_0x3333('0x35')]:_0x55555a[_0x3333('0x33')];if(_0x421c26[_0x3333('0x2f')][_0x3333('0x49')]){_0x2f9cf1[_0x3333('0x43')]=[{'all':!![]}];}_0x2f9cf1=_[_0x3333('0x40')]({},_0x2f9cf1,_0x421c26['options']);return db[_0x3333('0x2b')][_0x3333('0x4a')](_0x2f9cf1)[_0x3333('0x25')](handleEntityNotFound(_0x5bf7e7,null))[_0x3333('0x25')](respondWithResult(_0x5bf7e7,null))['catch'](handleError(_0x5bf7e7,null));};exports['create']=function(_0x3ffe5f,_0x4fc2e0){return db[_0x3333('0x2b')][_0x3333('0x4b')](_0x3ffe5f[_0x3333('0x4c')],{})[_0x3333('0x25')](respondWithResult(_0x4fc2e0,0xc9))[_0x3333('0x46')](handleError(_0x4fc2e0,null));};exports['update']=function(_0x4058ea,_0x37b55a){if(_0x4058ea[_0x3333('0x4c')]['id']){delete _0x4058ea[_0x3333('0x4c')]['id'];}return db[_0x3333('0x2b')]['find']({'where':{'id':_0x4058ea[_0x3333('0x48')]['id']}})['then'](handleEntityNotFound(_0x37b55a,null))[_0x3333('0x25')](saveUpdates(_0x4058ea[_0x3333('0x4c')],null))['then'](respondWithResult(_0x37b55a,null))[_0x3333('0x46')](handleError(_0x37b55a,null));};exports[_0x3333('0x26')]=function(_0x2ad070,_0xc67641){return db[_0x3333('0x2b')][_0x3333('0x4a')]({'where':{'id':_0x2ad070[_0x3333('0x48')]['id']}})[_0x3333('0x25')](handleEntityNotFound(_0xc67641,null))[_0x3333('0x25')](removeEntity(_0xc67641,null))['catch'](handleError(_0xc67641,null));};
\ No newline at end of file
+var _0x823e=['fields','hasOwnProperty','nolimit','sort','where','pick','add','day','merge','filter','map','includeAll','include','findAll','rows','catch','rawAttributes','keys','length','options','find','create','body','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','apply','reject','save','update','then','error','stack','name','send','index','ZendeskField','model','query','dateStart','dateEnd','filters','intersection','attributes'];(function(_0x54c042,_0x742544){var _0x2821cc=function(_0x131c0e){while(--_0x131c0e){_0x54c042['push'](_0x54c042['shift']());}};_0x2821cc(++_0x742544);}(_0x823e,0x124));var _0xe823=function(_0x24bcc1,_0x20e858){_0x24bcc1=_0x24bcc1-0x0;var _0x226df1=_0x823e[_0x24bcc1];return _0x226df1;};'use strict';var pdf=require(_0xe823('0x0'));var emlformat=require(_0xe823('0x1'));var rimraf=require(_0xe823('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe823('0x3'));var rp=require(_0xe823('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe823('0x5'));var util=require('util');var path=require(_0xe823('0x6'));var sox=require('sox');var csv=require(_0xe823('0x7'));var ejs=require(_0xe823('0x8'));var fs=require('fs');var _=require(_0xe823('0x9'));var squel=require(_0xe823('0xa'));var crypto=require(_0xe823('0xb'));var jsforce=require(_0xe823('0xc'));var deskjs=require(_0xe823('0xd'));var toCsv=require(_0xe823('0x7'));var querystring=require(_0xe823('0xe'));var Papa=require(_0xe823('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0xe823('0x10'))(_0xe823('0x11'));var utils=require(_0xe823('0x12'));var config=require(_0xe823('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bceef,_0x3274ff){_0x3274ff=_0x3274ff||0xcc;return function(_0x45de2c){if(_0x45de2c){return _0x2bceef[_0xe823('0x14')](_0x3274ff);}return _0x2bceef[_0xe823('0x15')](_0x3274ff)[_0xe823('0x16')]();};}function respondWithResult(_0x47c1ac,_0x35511b){_0x35511b=_0x35511b||0xc8;return function(_0x33f697){if(_0x33f697){return _0x47c1ac['status'](_0x35511b)['json'](_0x33f697);}};}function respondWithFilteredResult(_0x483067,_0x493933){return function(_0x427aee){if(_0x427aee){var _0x4f4508=_0x427aee['count'],_0xeffc6=_0x493933[_0xe823('0x17')],_0x4762f7=_0x493933[_0xe823('0x17')]+_0x493933[_0xe823('0x18')],_0x522e7b;if(_0x4762f7>=_0x4f4508){_0x4762f7=_0x4f4508;_0x522e7b=0xc8;}else{_0x522e7b=0xce;}_0x483067['status'](_0x522e7b);return _0x483067['set']('Content-Range',_0xeffc6+'-'+_0x4762f7+'/'+_0x4f4508)['json'](_0x427aee);}return null;};}function patchUpdates(_0x285e23){return function(_0x2dadb2){try{jsonpatch[_0xe823('0x19')](_0x2dadb2,_0x285e23,!![]);}catch(_0x4cc59d){return BPromise[_0xe823('0x1a')](_0x4cc59d);}return _0x2dadb2[_0xe823('0x1b')]();};}function saveUpdates(_0x487ec2,_0x3fc438){return function(_0x4c562a){if(_0x4c562a){return _0x4c562a[_0xe823('0x1c')](_0x487ec2)[_0xe823('0x1d')](function(_0x543b06){return _0x543b06;});}return null;};}function removeEntity(_0x2dfbf6,_0x3ec6e9){return function(_0xcc1547){if(_0xcc1547){return _0xcc1547['destroy']()[_0xe823('0x1d')](function(){_0x2dfbf6['status'](0xcc)[_0xe823('0x16')]();});}};}function handleEntityNotFound(_0x5a3526,_0xba4bf4){return function(_0x9cffa9){if(!_0x9cffa9){_0x5a3526[_0xe823('0x14')](0x194);}return _0x9cffa9;};}function handleError(_0x1a84e4,_0x5573bc){_0x5573bc=_0x5573bc||0x1f4;return function(_0xe0c384){logger[_0xe823('0x1e')](_0xe0c384[_0xe823('0x1f')]);if(_0xe0c384[_0xe823('0x20')]){delete _0xe0c384[_0xe823('0x20')];}_0x1a84e4[_0xe823('0x15')](_0x5573bc)[_0xe823('0x21')](_0xe0c384);};}exports[_0xe823('0x22')]=function(_0x51bcb8,_0x1727e7){var _0x3df391={},_0x5840ca={},_0xdcb2b7={'count':0x0,'rows':[]};var _0x50716b=db[_0xe823('0x23')]['rawAttributes'];_0x5840ca[_0xe823('0x24')]=_['keys'](_0x50716b);var _0x61e821={'dateStart':_0x51bcb8[_0xe823('0x25')][_0xe823('0x26')],'dateEnd':_0x51bcb8[_0xe823('0x25')][_0xe823('0x27')]};delete _0x51bcb8[_0xe823('0x25')][_0xe823('0x26')];delete _0x51bcb8[_0xe823('0x25')][_0xe823('0x27')];_0x5840ca['query']=_['keys'](_0x51bcb8['query']);_0x5840ca[_0xe823('0x28')]=_[_0xe823('0x29')](_0x5840ca[_0xe823('0x24')],_0x5840ca[_0xe823('0x25')]);_0x3df391[_0xe823('0x2a')]=_['intersection'](_0x5840ca[_0xe823('0x24')],qs[_0xe823('0x2b')](_0x51bcb8[_0xe823('0x25')]['fields']));_0x3df391[_0xe823('0x2a')]=_0x3df391[_0xe823('0x2a')]['length']?_0x3df391[_0xe823('0x2a')]:_0x5840ca[_0xe823('0x24')];if(!_0x51bcb8[_0xe823('0x25')][_0xe823('0x2c')](_0xe823('0x2d'))){_0x3df391[_0xe823('0x18')]=qs['limit'](_0x51bcb8['query']['limit']);_0x3df391['offset']=qs[_0xe823('0x17')](_0x51bcb8[_0xe823('0x25')][_0xe823('0x17')]);}_0x3df391['order']=qs['sort'](_0x51bcb8[_0xe823('0x25')][_0xe823('0x2e')]);_0x3df391[_0xe823('0x2f')]=qs[_0xe823('0x28')](_[_0xe823('0x30')](_0x51bcb8[_0xe823('0x25')],_0x5840ca[_0xe823('0x28')]));if(_0x61e821[_0xe823('0x26')]){if(_0x61e821[_0xe823('0x27')]){_0x61e821['dateEnd']=moment(_0x61e821[_0xe823('0x27')])[_0xe823('0x31')](0x1,_0xe823('0x32'));}else{_0x61e821[_0xe823('0x27')]=moment(_0x61e821[_0xe823('0x26')])[_0xe823('0x31')](0x1,'day');}_[_0xe823('0x33')](_0x3df391['where'],{'createdAt':{'$gte':_0x61e821[_0xe823('0x26')],'$lte':_0x61e821['dateEnd']}});}if(_0x51bcb8['query'][_0xe823('0x34')]){_0x3df391['where']=_[_0xe823('0x33')](_0x3df391['where'],{'$or':_[_0xe823('0x35')](_0x3df391['attributes'],function(_0x2b73c3){var _0x22aa10={};_0x22aa10[_0x2b73c3]={'$like':'%'+_0x51bcb8[_0xe823('0x25')]['filter']+'%'};return _0x22aa10;})});}_0x3df391=_[_0xe823('0x33')]({},_0x3df391,_0x51bcb8['options']);var _0x4ba7b6={'where':_0x3df391[_0xe823('0x2f')]};return db['ZendeskField']['count'](_0x4ba7b6)[_0xe823('0x1d')](function(_0x5688f8){_0xdcb2b7['count']=_0x5688f8;if(_0x51bcb8['query'][_0xe823('0x36')]){_0x3df391[_0xe823('0x37')]=[{'all':!![]}];}return db[_0xe823('0x23')][_0xe823('0x38')](_0x3df391);})[_0xe823('0x1d')](function(_0x5eb554){_0xdcb2b7[_0xe823('0x39')]=_0x5eb554;return _0xdcb2b7;})['then'](respondWithFilteredResult(_0x1727e7,_0x3df391))[_0xe823('0x3a')](handleError(_0x1727e7,null));};exports['show']=function(_0x285645,_0x14cb27){var _0x96e4a4={'raw':!![],'where':{'id':_0x285645['params']['id']}},_0x3b743c={};_0x3b743c[_0xe823('0x24')]=_['keys'](db[_0xe823('0x23')][_0xe823('0x3b')]);_0x3b743c[_0xe823('0x25')]=_[_0xe823('0x3c')](_0x285645[_0xe823('0x25')]);_0x3b743c['filters']=_[_0xe823('0x29')](_0x3b743c[_0xe823('0x24')],_0x3b743c[_0xe823('0x25')]);_0x96e4a4[_0xe823('0x2a')]=_[_0xe823('0x29')](_0x3b743c[_0xe823('0x24')],qs['fields'](_0x285645['query'][_0xe823('0x2b')]));_0x96e4a4[_0xe823('0x2a')]=_0x96e4a4[_0xe823('0x2a')][_0xe823('0x3d')]?_0x96e4a4[_0xe823('0x2a')]:_0x3b743c[_0xe823('0x24')];if(_0x285645[_0xe823('0x25')][_0xe823('0x36')]){_0x96e4a4['include']=[{'all':!![]}];}_0x96e4a4=_['merge']({},_0x96e4a4,_0x285645[_0xe823('0x3e')]);return db[_0xe823('0x23')][_0xe823('0x3f')](_0x96e4a4)['then'](handleEntityNotFound(_0x14cb27,null))[_0xe823('0x1d')](respondWithResult(_0x14cb27,null))[_0xe823('0x3a')](handleError(_0x14cb27,null));};exports[_0xe823('0x40')]=function(_0x3a6792,_0x4b0cf9){return db[_0xe823('0x23')]['create'](_0x3a6792[_0xe823('0x41')],{})[_0xe823('0x1d')](respondWithResult(_0x4b0cf9,0xc9))[_0xe823('0x3a')](handleError(_0x4b0cf9,null));};exports[_0xe823('0x1c')]=function(_0xd1d1b3,_0x198535){if(_0xd1d1b3[_0xe823('0x41')]['id']){delete _0xd1d1b3[_0xe823('0x41')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0xd1d1b3[_0xe823('0x42')]['id']}})[_0xe823('0x1d')](handleEntityNotFound(_0x198535,null))[_0xe823('0x1d')](saveUpdates(_0xd1d1b3['body'],null))[_0xe823('0x1d')](respondWithResult(_0x198535,null))[_0xe823('0x3a')](handleError(_0x198535,null));};exports['destroy']=function(_0x1e3a97,_0x3609bc){return db[_0xe823('0x23')][_0xe823('0x3f')]({'where':{'id':_0x1e3a97[_0xe823('0x42')]['id']}})['then'](handleEntityNotFound(_0x3609bc,null))[_0xe823('0x1d')](removeEntity(_0x3609bc,null))['catch'](handleError(_0x3609bc,null));};
\ No newline at end of file
index aa33384..ecaacd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8f1=['ZendeskField','int_zendesk_fields','lodash','util','bluebird','./intZendeskField.attributes'];(function(_0xe890f2,_0x192d76){var _0x192aeb=function(_0x1e0146){while(--_0x1e0146){_0xe890f2['push'](_0xe890f2['shift']());}};_0x192aeb(++_0x192d76);}(_0xb8f1,0x86));var _0x1b8f=function(_0xae5746,_0x4b7251){_0xae5746=_0xae5746-0x0;var _0x3a39c3=_0xb8f1[_0xae5746];return _0x3a39c3;};'use strict';var _=require(_0x1b8f('0x0'));var util=require(_0x1b8f('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1b8f('0x2'));var rp=require('request-promise');var attributes=require(_0x1b8f('0x3'));module['exports']=function(_0x509183,_0xf63fe7){return _0x509183['define'](_0x1b8f('0x4'),attributes,{'tableName':_0x1b8f('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0464=['./intZendeskField.attributes','exports','ZendeskField','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x9edfd5,_0x286486){var _0x330738=function(_0x4aceb3){while(--_0x4aceb3){_0x9edfd5['push'](_0x9edfd5['shift']());}};_0x330738(++_0x286486);}(_0x0464,0x13b));var _0x4046=function(_0x3683a3,_0x39bca2){_0x3683a3=_0x3683a3-0x0;var _0x2a9666=_0x0464[_0x3683a3];return _0x2a9666;};'use strict';var _=require(_0x4046('0x0'));var util=require('util');var logger=require(_0x4046('0x1'))(_0x4046('0x2'));var moment=require('moment');var BPromise=require(_0x4046('0x3'));var rp=require(_0x4046('0x4'));var attributes=require(_0x4046('0x5'));module[_0x4046('0x6')]=function(_0x5d0929,_0x1535d2){return _0x5d0929['define'](_0x4046('0x7'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 005621a..3517b38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc271=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring'];(function(_0x1999eb,_0xd0adb9){var _0x1a53a7=function(_0x5a5aef){while(--_0x5a5aef){_0x1999eb['push'](_0x1999eb['shift']());}};_0x1a53a7(++_0xd0adb9);}(_0xc271,0x177));var _0x1c27=function(_0x2087e7,_0x1ce77c){_0x2087e7=_0x2087e7-0x0;var _0x21f316=_0xc271[_0x2087e7];return _0x21f316;};'use strict';var _=require(_0x1c27('0x0'));var util=require(_0x1c27('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1c27('0x2'));var fs=require('fs');var db=require(_0x1c27('0x3'))['db'];var utils=require(_0x1c27('0x4'));var logger=require(_0x1c27('0x5'))(_0x1c27('0x6'));var config=require(_0x1c27('0x7'));var jayson=require(_0x1c27('0x8'));var client=jayson['client'][_0x1c27('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16ef62,_0xc56298,_0x3794c6){return new BPromise(function(_0x16cef4,_0x2d72e4){return client[_0x1c27('0xa')](_0x16ef62,_0x3794c6)[_0x1c27('0xb')](function(_0x49fa7d){logger[_0x1c27('0xc')]('ZendeskField,\x20%s,\x20%s',_0xc56298,_0x1c27('0xd'));logger['debug'](_0x1c27('0xe'),_0xc56298,_0x1c27('0xd'),JSON[_0x1c27('0xf')](_0x49fa7d));if(_0x49fa7d[_0x1c27('0x10')]){if(_0x49fa7d['error']['code']===0x1f4){logger[_0x1c27('0x10')](_0x1c27('0x11'),_0xc56298,_0x49fa7d[_0x1c27('0x10')][_0x1c27('0x12')]);return _0x2d72e4(_0x49fa7d[_0x1c27('0x10')]['message']);}logger[_0x1c27('0x10')](_0x1c27('0x11'),_0xc56298,_0x49fa7d[_0x1c27('0x10')][_0x1c27('0x12')]);return _0x16cef4(_0x49fa7d[_0x1c27('0x10')]['message']);}else{logger[_0x1c27('0xc')](_0x1c27('0x11'),_0xc56298,_0x1c27('0xd'));_0x16cef4(_0x49fa7d[_0x1c27('0x13')][_0x1c27('0x12')]);}})[_0x1c27('0x14')](function(_0x24d699){logger[_0x1c27('0x10')](_0x1c27('0x11'),_0xc56298,_0x24d699);_0x2d72e4(_0x24d699);});});}
\ No newline at end of file
+var _0xc093=['result','catch','ZendeskField,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x50ee4e,_0x1a326e){var _0x37a074=function(_0x56d3f9){while(--_0x56d3f9){_0x50ee4e['push'](_0x50ee4e['shift']());}};_0x37a074(++_0x1a326e);}(_0xc093,0xe4));var _0x3c09=function(_0x36bff5,_0x3156cb){_0x36bff5=_0x36bff5-0x0;var _0x80ade5=_0xc093[_0x36bff5];return _0x80ade5;};'use strict';var _=require(_0x3c09('0x0'));var util=require(_0x3c09('0x1'));var moment=require(_0x3c09('0x2'));var BPromise=require(_0x3c09('0x3'));var rs=require(_0x3c09('0x4'));var fs=require('fs');var db=require(_0x3c09('0x5'))['db'];var utils=require(_0x3c09('0x6'));var logger=require(_0x3c09('0x7'))(_0x3c09('0x8'));var config=require(_0x3c09('0x9'));var jayson=require(_0x3c09('0xa'));var client=jayson[_0x3c09('0xb')][_0x3c09('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1566ee,_0x3bd924,_0x4798d8){return new BPromise(function(_0x542925,_0x349a60){return client[_0x3c09('0xd')](_0x1566ee,_0x4798d8)['then'](function(_0x5d9b42){logger[_0x3c09('0xe')]('ZendeskField,\x20%s,\x20%s',_0x3bd924,_0x3c09('0xf'));logger[_0x3c09('0x10')](_0x3c09('0x11'),_0x3bd924,_0x3c09('0xf'),JSON[_0x3c09('0x12')](_0x5d9b42));if(_0x5d9b42['error']){if(_0x5d9b42[_0x3c09('0x13')][_0x3c09('0x14')]===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x3bd924,_0x5d9b42[_0x3c09('0x13')][_0x3c09('0x15')]);return _0x349a60(_0x5d9b42[_0x3c09('0x13')]['message']);}logger[_0x3c09('0x13')]('ZendeskField,\x20%s,\x20%s',_0x3bd924,_0x5d9b42[_0x3c09('0x13')][_0x3c09('0x15')]);return _0x542925(_0x5d9b42[_0x3c09('0x13')][_0x3c09('0x15')]);}else{logger[_0x3c09('0xe')]('ZendeskField,\x20%s,\x20%s',_0x3bd924,_0x3c09('0xf'));_0x542925(_0x5d9b42[_0x3c09('0x16')][_0x3c09('0x15')]);}})[_0x3c09('0x17')](function(_0x1a7fec){logger['error'](_0x3c09('0x18'),_0x3bd924,_0x1a7fec);_0x349a60(_0x1a7fec);});});}
\ No newline at end of file
index 69d89f6..3abc49d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2c2=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../config/environment','get'];(function(_0x1dfad3,_0x7045e8){var _0x563390=function(_0x54ce76){while(--_0x54ce76){_0x1dfad3['push'](_0x1dfad3['shift']());}};_0x563390(++_0x7045e8);}(_0xa2c2,0x101));var _0x2a2c=function(_0xd95e0f,_0x3d1135){_0xd95e0f=_0xd95e0f-0x0;var _0x423ba1=_0xa2c2[_0xd95e0f];return _0x423ba1;};'use strict';var multer=require('multer');var util=require(_0x2a2c('0x0'));var path=require(_0x2a2c('0x1'));var express=require(_0x2a2c('0x2'));var router=express[_0x2a2c('0x3')]();var auth=require(_0x2a2c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2a2c('0x5'));var controller=require('./intZohoAccount.controller');router[_0x2a2c('0x6')]('/',auth[_0x2a2c('0x7')](),controller[_0x2a2c('0x8')]);router[_0x2a2c('0x6')](_0x2a2c('0x9'),auth[_0x2a2c('0x7')](),controller[_0x2a2c('0xa')]);router[_0x2a2c('0x6')](_0x2a2c('0xb'),auth['isAuthenticated'](),controller[_0x2a2c('0xc')]);router[_0x2a2c('0x6')]('/:id/fields',auth[_0x2a2c('0x7')](),controller[_0x2a2c('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2a2c('0xe')]);router[_0x2a2c('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x2a2c('0x10')]);router[_0x2a2c('0x11')]('/:id',auth[_0x2a2c('0x7')](),controller[_0x2a2c('0x12')]);router[_0x2a2c('0x13')](_0x2a2c('0x9'),auth[_0x2a2c('0x7')](),controller[_0x2a2c('0x14')]);module[_0x2a2c('0x15')]=router;
\ No newline at end of file
+var _0xa550=['/:id','/:id/configurations','getConfigurations','getFields','post','put','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated'];(function(_0x5dd983,_0x156af6){var _0x3772f9=function(_0x22aa31){while(--_0x22aa31){_0x5dd983['push'](_0x5dd983['shift']());}};_0x3772f9(++_0x156af6);}(_0xa550,0xdf));var _0x0a55=function(_0x1465dc,_0x4d684d){_0x1465dc=_0x1465dc-0x0;var _0x226206=_0xa550[_0x1465dc];return _0x226206;};'use strict';var multer=require(_0x0a55('0x0'));var util=require(_0x0a55('0x1'));var path=require(_0x0a55('0x2'));var express=require(_0x0a55('0x3'));var router=express[_0x0a55('0x4')]();var auth=require(_0x0a55('0x5'));var interaction=require(_0x0a55('0x6'));var config=require(_0x0a55('0x7'));var controller=require(_0x0a55('0x8'));router[_0x0a55('0x9')]('/',auth[_0x0a55('0xa')](),controller['index']);router[_0x0a55('0x9')](_0x0a55('0xb'),auth[_0x0a55('0xa')](),controller['show']);router[_0x0a55('0x9')](_0x0a55('0xc'),auth[_0x0a55('0xa')](),controller[_0x0a55('0xd')]);router[_0x0a55('0x9')]('/:id/fields',auth[_0x0a55('0xa')](),controller[_0x0a55('0xe')]);router[_0x0a55('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x0a55('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x0a55('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x0a55('0xb'),auth['isAuthenticated'](),controller[_0x0a55('0x11')]);module['exports']=router;
\ No newline at end of file
index 1a5da28..8a63855 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79c2=['sequelize','exports','STRING'];(function(_0x434b73,_0x55b000){var _0x5e1484=function(_0x47bf00){while(--_0x47bf00){_0x434b73['push'](_0x434b73['shift']());}};_0x5e1484(++_0x55b000);}(_0x79c2,0x6f));var _0x279c=function(_0x40d8d7,_0x30dd5e){_0x40d8d7=_0x40d8d7-0x0;var _0x3454cc=_0x79c2[_0x40d8d7];return _0x3454cc;};'use strict';var Sequelize=require(_0x279c('0x0'));module[_0x279c('0x1')]={'name':{'type':Sequelize[_0x279c('0x2')]},'description':{'type':Sequelize[_0x279c('0x2')]},'authToken':{'type':Sequelize[_0x279c('0x2')]},'host':{'type':Sequelize[_0x279c('0x2')]},'serverUrl':{'type':Sequelize[_0x279c('0x2')]}};
\ No newline at end of file
+var _0x851f=['sequelize','exports','STRING'];(function(_0x4135b0,_0x4ba159){var _0x32a860=function(_0x36ca79){while(--_0x36ca79){_0x4135b0['push'](_0x4135b0['shift']());}};_0x32a860(++_0x4ba159);}(_0x851f,0x14a));var _0xf851=function(_0x343090,_0x433a80){_0x343090=_0x343090-0x0;var _0x3ff3e8=_0x851f[_0x343090];return _0x3ff3e8;};'use strict';var Sequelize=require(_0xf851('0x0'));module[_0xf851('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xf851('0x2')]},'host':{'type':Sequelize[_0xf851('0x2')]},'serverUrl':{'type':Sequelize[_0xf851('0x2')]}};
\ No newline at end of file
index 7f2f716..60893e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x950a=['include','findAll','rows','catch','show','params','create','body','destroy','find','getConfigurations','findOne','ZohoConfiguration','pick','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ZohoField','getFields','host','authToken','GET','https://crm.%s/crm/private/json/Calls/getFields','crmapi','response','Calls','section','Call\x20Purpose','includes','push','customfield','true','Pick\x20List','val','map','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','name','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/environment','../../components/integrations/configuration','jayson/promise','client','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','sendStatus','stack','send','index','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','fields','attributes','length','nolimit','order','sort','where','filters','add','merge','filter','options','ZohoAccount','includeAll'];(function(_0x32bfe1,_0x5ea81f){var _0x2b7bad=function(_0x187994){while(--_0x187994){_0x32bfe1['push'](_0x32bfe1['shift']());}};_0x2b7bad(++_0x5ea81f);}(_0x950a,0x111));var _0xa950=function(_0x5af4cd,_0x36c611){_0x5af4cd=_0x5af4cd-0x0;var _0x5ebb20=_0x950a[_0x5af4cd];return _0x5ebb20;};'use strict';var pdf=require(_0xa950('0x0'));var emlformat=require(_0xa950('0x1'));var rimraf=require(_0xa950('0x2'));var zipdir=require(_0xa950('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa950('0x4'));var moment=require(_0xa950('0x5'));var BPromise=require(_0xa950('0x6'));var Mustache=require(_0xa950('0x7'));var util=require('util');var path=require(_0xa950('0x8'));var sox=require(_0xa950('0x9'));var csv=require('to-csv');var ejs=require(_0xa950('0xa'));var fs=require('fs');var _=require(_0xa950('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa950('0xc'));var deskjs=require(_0xa950('0xd'));var toCsv=require(_0xa950('0xe'));var querystring=require(_0xa950('0xf'));var Papa=require(_0xa950('0x10'));var qs=require(_0xa950('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa950('0x12'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa950('0x13'));var jayson=require(_0xa950('0x14'));var client=jayson[_0xa950('0x15')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc7e9bd,_0x4f9c04,_0x10e64a,_0x439097){return new BPromise(function(_0x3cdf5d,_0x4c217c){var _0xf1582=_0x439097||client;return _0xf1582[_0xa950('0x16')](_0xc7e9bd,_0x10e64a)[_0xa950('0x17')](function(_0x4ba74f){logger[_0xa950('0x18')](_0xa950('0x19'),_0x4f9c04,_0xa950('0x1a'));logger['debug'](_0xa950('0x1b'),_0x4f9c04,_0xa950('0x1a'),JSON[_0xa950('0x1c')](_0x4ba74f));if(_0x4ba74f['error']){if(_0x4ba74f[_0xa950('0x1d')][_0xa950('0x1e')]===0x1f4){logger[_0xa950('0x1d')](_0xa950('0x19'),_0x4f9c04,_0x4ba74f[_0xa950('0x1d')][_0xa950('0x1f')]);return _0x4c217c(_0x4ba74f[_0xa950('0x1d')][_0xa950('0x1f')]);}logger[_0xa950('0x1d')](_0xa950('0x19'),_0x4f9c04,_0x4ba74f[_0xa950('0x1d')][_0xa950('0x1f')]);return _0x3cdf5d(_0x4ba74f[_0xa950('0x1d')]['message']);}else{logger[_0xa950('0x18')](_0xa950('0x19'),_0x4f9c04,'request\x20sent');_0x3cdf5d(_0x4ba74f[_0xa950('0x20')][_0xa950('0x1f')]);}})['catch'](function(_0x2e6f72){logger['error'](_0xa950('0x19'),_0x4f9c04,_0x2e6f72);_0x4c217c(_0x2e6f72);});});}function respondWithStatusCode(_0x14ada5,_0x616269){_0x616269=_0x616269||0xcc;return function(_0x36a16c){if(_0x36a16c){return _0x14ada5['sendStatus'](_0x616269);}return _0x14ada5[_0xa950('0x21')](_0x616269)[_0xa950('0x22')]();};}function respondWithResult(_0x31c135,_0x897178){_0x897178=_0x897178||0xc8;return function(_0x292c73){if(_0x292c73){return _0x31c135[_0xa950('0x21')](_0x897178)[_0xa950('0x23')](_0x292c73);}};}function respondWithFilteredResult(_0x23cb20,_0x12dcb8){return function(_0xc4894b){if(_0xc4894b){var _0x3c8c98=_0xc4894b[_0xa950('0x24')],_0x26f366=_0x12dcb8[_0xa950('0x25')],_0x43f8c8=_0x12dcb8[_0xa950('0x25')]+_0x12dcb8[_0xa950('0x26')],_0x5d82d8;if(_0x43f8c8>=_0x3c8c98){_0x43f8c8=_0x3c8c98;_0x5d82d8=0xc8;}else{_0x5d82d8=0xce;}_0x23cb20[_0xa950('0x21')](_0x5d82d8);return _0x23cb20[_0xa950('0x27')](_0xa950('0x28'),_0x26f366+'-'+_0x43f8c8+'/'+_0x3c8c98)['json'](_0xc4894b);}return null;};}function patchUpdates(_0x19ad7a){return function(_0x442a94){try{jsonpatch['apply'](_0x442a94,_0x19ad7a,!![]);}catch(_0x44ee6e){return BPromise[_0xa950('0x29')](_0x44ee6e);}return _0x442a94[_0xa950('0x2a')]();};}function saveUpdates(_0x1875eb,_0x152f53){return function(_0x1945ca){if(_0x1945ca){return _0x1945ca[_0xa950('0x2b')](_0x1875eb)[_0xa950('0x17')](function(_0x203703){return _0x203703;});}return null;};}function removeEntity(_0x3c6ea8,_0x4de9f0){return function(_0x3b0910){if(_0x3b0910){return _0x3b0910['destroy']()['then'](function(){_0x3c6ea8[_0xa950('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x118d96,_0x2b43f5){return function(_0x3ba469){if(!_0x3ba469){_0x118d96[_0xa950('0x2c')](0x194);}return _0x3ba469;};}function handleError(_0x55f3da,_0x107e08){_0x107e08=_0x107e08||0x1f4;return function(_0x53333a){logger[_0xa950('0x1d')](_0x53333a[_0xa950('0x2d')]);if(_0x53333a['name']){delete _0x53333a['name'];}_0x55f3da[_0xa950('0x21')](_0x107e08)[_0xa950('0x2e')](_0x53333a);};}exports[_0xa950('0x2f')]=function(_0x1de9b0,_0x3410cf){var _0x155106={},_0x55e535={},_0x4b8e0d={'count':0x0,'rows':[]};var _0x356258=db['ZohoAccount'][_0xa950('0x30')];_0x55e535[_0xa950('0x31')]=_[_0xa950('0x32')](_0x356258);var _0x2c664e={'dateStart':_0x1de9b0[_0xa950('0x33')][_0xa950('0x34')],'dateEnd':_0x1de9b0[_0xa950('0x33')][_0xa950('0x35')]};delete _0x1de9b0[_0xa950('0x33')][_0xa950('0x34')];delete _0x1de9b0['query'][_0xa950('0x35')];_0x55e535['query']=_[_0xa950('0x32')](_0x1de9b0[_0xa950('0x33')]);_0x55e535['filters']=_['intersection'](_0x55e535[_0xa950('0x31')],_0x55e535[_0xa950('0x33')]);_0x155106['attributes']=_[_0xa950('0x36')](_0x55e535[_0xa950('0x31')],qs['fields'](_0x1de9b0[_0xa950('0x33')][_0xa950('0x37')]));_0x155106[_0xa950('0x38')]=_0x155106[_0xa950('0x38')][_0xa950('0x39')]?_0x155106[_0xa950('0x38')]:_0x55e535[_0xa950('0x31')];if(!_0x1de9b0[_0xa950('0x33')]['hasOwnProperty'](_0xa950('0x3a'))){_0x155106[_0xa950('0x26')]=qs['limit'](_0x1de9b0[_0xa950('0x33')][_0xa950('0x26')]);_0x155106[_0xa950('0x25')]=qs['offset'](_0x1de9b0[_0xa950('0x33')][_0xa950('0x25')]);}_0x155106[_0xa950('0x3b')]=qs['sort'](_0x1de9b0['query'][_0xa950('0x3c')]);_0x155106[_0xa950('0x3d')]=qs[_0xa950('0x3e')](_['pick'](_0x1de9b0['query'],_0x55e535['filters']));if(_0x2c664e[_0xa950('0x34')]){if(_0x2c664e[_0xa950('0x35')]){_0x2c664e[_0xa950('0x35')]=moment(_0x2c664e[_0xa950('0x35')])[_0xa950('0x3f')](0x1,'day');}else{_0x2c664e[_0xa950('0x35')]=moment(_0x2c664e[_0xa950('0x34')])['add'](0x1,'day');}_[_0xa950('0x40')](_0x155106[_0xa950('0x3d')],{'createdAt':{'$gte':_0x2c664e['dateStart'],'$lte':_0x2c664e['dateEnd']}});}if(_0x1de9b0['query']['filter']){_0x155106[_0xa950('0x3d')]=_[_0xa950('0x40')](_0x155106['where'],{'$or':_['map'](_0x155106[_0xa950('0x38')],function(_0x4c1121){var _0x2ee8b4={};_0x2ee8b4[_0x4c1121]={'$like':'%'+_0x1de9b0[_0xa950('0x33')][_0xa950('0x41')]+'%'};return _0x2ee8b4;})});}_0x155106=_[_0xa950('0x40')]({},_0x155106,_0x1de9b0[_0xa950('0x42')]);var _0x2836f0={'where':_0x155106[_0xa950('0x3d')]};return db[_0xa950('0x43')]['count'](_0x2836f0)[_0xa950('0x17')](function(_0x4ede77){_0x4b8e0d[_0xa950('0x24')]=_0x4ede77;if(_0x1de9b0[_0xa950('0x33')][_0xa950('0x44')]){_0x155106[_0xa950('0x45')]=[{'all':!![]}];}return db[_0xa950('0x43')][_0xa950('0x46')](_0x155106);})[_0xa950('0x17')](function(_0x88e759){_0x4b8e0d[_0xa950('0x47')]=_0x88e759;return _0x4b8e0d;})['then'](respondWithFilteredResult(_0x3410cf,_0x155106))[_0xa950('0x48')](handleError(_0x3410cf,null));};exports[_0xa950('0x49')]=function(_0x36ddb8,_0x1c30ff){var _0x41b828={'raw':![],'where':{'id':_0x36ddb8[_0xa950('0x4a')]['id']}},_0x5a2b2f={};_0x5a2b2f[_0xa950('0x31')]=_[_0xa950('0x32')](db[_0xa950('0x43')][_0xa950('0x30')]);_0x5a2b2f[_0xa950('0x33')]=_[_0xa950('0x32')](_0x36ddb8['query']);_0x5a2b2f[_0xa950('0x3e')]=_[_0xa950('0x36')](_0x5a2b2f[_0xa950('0x31')],_0x5a2b2f['query']);_0x41b828['attributes']=_[_0xa950('0x36')](_0x5a2b2f[_0xa950('0x31')],qs[_0xa950('0x37')](_0x36ddb8[_0xa950('0x33')][_0xa950('0x37')]));_0x41b828[_0xa950('0x38')]=_0x41b828[_0xa950('0x38')][_0xa950('0x39')]?_0x41b828['attributes']:_0x5a2b2f[_0xa950('0x31')];if(_0x36ddb8[_0xa950('0x33')][_0xa950('0x44')]){_0x41b828[_0xa950('0x45')]=[{'all':!![]}];}_0x41b828=_[_0xa950('0x40')]({},_0x41b828,_0x36ddb8['options']);return db[_0xa950('0x43')]['find'](_0x41b828)[_0xa950('0x17')](handleEntityNotFound(_0x1c30ff,null))[_0xa950('0x17')](respondWithResult(_0x1c30ff,null))[_0xa950('0x48')](handleError(_0x1c30ff,null));};exports[_0xa950('0x4b')]=function(_0x24fbc3,_0x329b72){return db['ZohoAccount']['create'](_0x24fbc3['body'],{})[_0xa950('0x17')](respondWithResult(_0x329b72,0xc9))[_0xa950('0x48')](handleError(_0x329b72,null));};exports[_0xa950('0x2b')]=function(_0x109b9b,_0x447459){if(_0x109b9b[_0xa950('0x4c')]['id']){delete _0x109b9b[_0xa950('0x4c')]['id'];}return db[_0xa950('0x43')]['find']({'where':{'id':_0x109b9b[_0xa950('0x4a')]['id']}})['then'](handleEntityNotFound(_0x447459,null))[_0xa950('0x17')](saveUpdates(_0x109b9b['body'],null))[_0xa950('0x17')](respondWithResult(_0x447459,null))['catch'](handleError(_0x447459,null));};exports[_0xa950('0x4d')]=function(_0x53e809,_0x1b71a5){return db[_0xa950('0x43')][_0xa950('0x4e')]({'where':{'id':_0x53e809[_0xa950('0x4a')]['id']}})[_0xa950('0x17')](handleEntityNotFound(_0x1b71a5,null))['then'](removeEntity(_0x1b71a5,null))[_0xa950('0x48')](handleError(_0x1b71a5,null));};exports[_0xa950('0x4f')]=function(_0x16832d,_0x42282f,_0x3f3a60){var _0x56fa5b={};var _0x22eb5c={};var _0x117a56;var _0x4c48b5;return db[_0xa950('0x43')][_0xa950('0x50')]({'where':{'id':_0x16832d['params']['id']}})[_0xa950('0x17')](handleEntityNotFound(_0x42282f,null))['then'](function(_0x5a32c1){if(_0x5a32c1){_0x117a56=_0x5a32c1;_0x22eb5c[_0xa950('0x31')]=_[_0xa950('0x32')](db[_0xa950('0x51')][_0xa950('0x30')]);_0x22eb5c['query']=_['keys'](_0x16832d[_0xa950('0x33')]);_0x22eb5c[_0xa950('0x3e')]=_[_0xa950('0x36')](_0x22eb5c['model'],_0x22eb5c[_0xa950('0x33')]);_0x56fa5b[_0xa950('0x38')]=_[_0xa950('0x36')](_0x22eb5c[_0xa950('0x31')],qs[_0xa950('0x37')](_0x16832d[_0xa950('0x33')][_0xa950('0x37')]));_0x56fa5b[_0xa950('0x38')]=_0x56fa5b[_0xa950('0x38')]['length']?_0x56fa5b[_0xa950('0x38')]:_0x22eb5c['model'];_0x56fa5b[_0xa950('0x3b')]=qs[_0xa950('0x3c')](_0x16832d[_0xa950('0x33')][_0xa950('0x3c')]);_0x56fa5b[_0xa950('0x3d')]=qs[_0xa950('0x3e')](_[_0xa950('0x52')](_0x16832d[_0xa950('0x33')],_0x22eb5c[_0xa950('0x3e')]));if(_0x16832d[_0xa950('0x33')][_0xa950('0x41')]){_0x56fa5b[_0xa950('0x3d')]=_[_0xa950('0x40')](_0x56fa5b['where'],{'$or':_['map'](_0x56fa5b[_0xa950('0x38')],function(_0x3ac5d8){var _0x174e48={};_0x174e48[_0x3ac5d8]={'$like':'%'+_0x16832d[_0xa950('0x33')][_0xa950('0x41')]+'%'};return _0x174e48;})});}_0x56fa5b=_[_0xa950('0x40')]({},_0x56fa5b,_0x16832d[_0xa950('0x42')]);return _0x117a56['getConfigurations'](_0x56fa5b);}})[_0xa950('0x17')](function(_0x411e90){if(_0x411e90){_0x4c48b5=_0x411e90[_0xa950('0x39')];if(!_0x16832d[_0xa950('0x33')][_0xa950('0x53')](_0xa950('0x3a'))){_0x56fa5b[_0xa950('0x26')]=qs[_0xa950('0x26')](_0x16832d['query'][_0xa950('0x26')]);_0x56fa5b[_0xa950('0x25')]=qs[_0xa950('0x25')](_0x16832d[_0xa950('0x33')][_0xa950('0x25')]);}return _0x117a56['getConfigurations'](_0x56fa5b);}})[_0xa950('0x17')](function(_0x230d77){if(_0x230d77){return _0x230d77?{'count':_0x4c48b5,'rows':_0x230d77}:null;}})[_0xa950('0x17')](respondWithResult(_0x42282f,null))[_0xa950('0x48')](handleError(_0x42282f,null));};exports[_0xa950('0x54')]=function(_0x579378,_0x145a6a,_0x12383e){if(_0x579378[_0xa950('0x4c')]['id']){delete _0x579378['body']['id'];}return db[_0xa950('0x43')][_0xa950('0x50')]({'where':{'id':_0x579378[_0xa950('0x4a')]['id']}})[_0xa950('0x17')](handleEntityNotFound(_0x145a6a,null))['then'](function(_0x159427){if(_0x159427){_0x579378[_0xa950('0x4c')]['AccountId']=_0x159427['id'];_0x579378[_0xa950('0x4c')][_0xa950('0x55')]=integrations[_0xa950('0x56')](_0x579378[_0xa950('0x4c')][_0xa950('0x57')],_0x579378[_0xa950('0x4c')][_0xa950('0x58')]);_0x579378[_0xa950('0x4c')][_0xa950('0x59')]=integrations[_0xa950('0x5a')](_0x579378[_0xa950('0x4c')][_0xa950('0x57')],_0x579378[_0xa950('0x4c')]['type']);return db['ZohoConfiguration']['create'](_0x579378['body'],{'include':[{'model':db[_0xa950('0x5b')],'as':_0xa950('0x55')},{'model':db[_0xa950('0x5b')],'as':'Descriptions'}]});}return null;})[_0xa950('0x17')](respondWithResult(_0x145a6a,null))[_0xa950('0x48')](handleError(_0x145a6a,null));};exports[_0xa950('0x5c')]=function(_0x46c8ca,_0x2f07f7,_0x2b8c7){return db[_0xa950('0x43')]['findOne']({'where':{'id':_0x46c8ca[_0xa950('0x4a')]['id']},'attributes':['id',_0xa950('0x5d'),_0xa950('0x5e')]})[_0xa950('0x17')](handleEntityNotFound(_0x2f07f7,null))[_0xa950('0x17')](function(_0x14f3bb){if(_0x14f3bb){return rp({'method':_0xa950('0x5f'),'uri':util['format'](_0xa950('0x60'),_0x14f3bb[_0xa950('0x5d')]),'qs':{'authtoken':_0x14f3bb['authToken'],'scope':_0xa950('0x61')},'json':!![]});}})[_0xa950('0x17')](function(_0x4209b8){if(_0x4209b8){if(_0x4209b8[_0xa950('0x62')]&&_0x4209b8[_0xa950('0x62')][_0xa950('0x1d')]){throw new Error(_0x4209b8[_0xa950('0x62')]['error'][_0xa950('0x1f')]);}var _0x2b3fa2=[];if(_0x4209b8[_0xa950('0x63')]&&_0x4209b8[_0xa950('0x63')][_0xa950('0x64')]){if(_0x4209b8[_0xa950('0x63')]['section']['FL']){var _0x3c9d36=[_0xa950('0x65')];for(var _0x5b5b02=0x0,_0x4caa09=_0x4209b8['Calls']['section']['FL'][_0xa950('0x39')];_0x5b5b02<_0x4caa09;_0x5b5b02++){if(_[_0xa950('0x66')](_0x3c9d36,_0x4209b8['Calls'][_0xa950('0x64')]['FL'][_0x5b5b02]['dv'])){_0x2b3fa2[_0xa950('0x67')]({'id':_0x4209b8['Calls'][_0xa950('0x64')]['FL'][_0x5b5b02]['dv'],'name':_0x4209b8[_0xa950('0x63')][_0xa950('0x64')]['FL'][_0x5b5b02]['label'],'custom':_0x4209b8['Calls'][_0xa950('0x64')]['FL'][_0x5b5b02][_0xa950('0x68')]===_0xa950('0x69')?!![]:![],'options':_0x4209b8[_0xa950('0x63')][_0xa950('0x64')]['FL'][_0x5b5b02][_0xa950('0x58')]===_0xa950('0x6a')&&_0x4209b8[_0xa950('0x63')][_0xa950('0x64')]['FL'][_0x5b5b02][_0xa950('0x6b')]?_[_0xa950('0x6c')](_0x4209b8[_0xa950('0x63')]['section']['FL'][_0x5b5b02][_0xa950('0x6b')],function(_0x56822f){return{'name':_0x56822f,'value':_0x56822f};}):[]});}}}}return{'count':_0x2b3fa2[_0xa950('0x39')],'rows':_0x2b3fa2};}})[_0xa950('0x17')](respondWithResult(_0x2f07f7,null))['catch'](function(_0x3d87fb){var _0xb049e3=_0x46c8ca['query'][_0xa950('0x6d')]?0x1f4:_0x3d87fb[_0xa950('0x6e')]||0x1f4;logger['error'](_0xa950('0x6f'),'getFields',_0xb049e3,JSON[_0xa950('0x1c')](_0x3d87fb));delete _0x3d87fb[_0xa950('0x70')];if(_0xb049e3===0x191){_0xb049e3=0x190;}_0x2f07f7['status'](_0xb049e3)[_0xa950('0x2e')](_0x46c8ca[_0xa950('0x33')][_0xa950('0x6d')]?{'message':_0xa950('0x71'),'statusCode':_0x3d87fb[_0xa950('0x6e')]}:_0x3d87fb);});};
\ No newline at end of file
+var _0xc03e=['statusCode','getFields,\x20%s,\x20%s,\x20%s','name','Wrong\x20credentials','html-pdf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','send','index','ZohoAccount','rawAttributes','model','query','dateStart','dateEnd','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','add','day','where','filter','map','options','includeAll','include','findAll','rows','show','params','find','create','body','update','length','merge','getConfigurations','nolimit','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','type','ZohoConfiguration','ZohoField','getFields','host','authToken','GET','format','https://crm.%s/crm/private/json/Calls/getFields','crmapi','response','Calls','section','push','customfield','true','val','test'];(function(_0x4b4cd3,_0xbaa8ac){var _0x1d605f=function(_0x413a3f){while(--_0x413a3f){_0x4b4cd3['push'](_0x4b4cd3['shift']());}};_0x1d605f(++_0xbaa8ac);}(_0xc03e,0x15a));var _0xec03=function(_0x11ad65,_0x352d3c){_0x11ad65=_0x11ad65-0x0;var _0x35590c=_0xc03e[_0x11ad65];return _0x35590c;};'use strict';var pdf=require(_0xec03('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xec03('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec03('0x2'));var moment=require('moment');var BPromise=require(_0xec03('0x3'));var Mustache=require(_0xec03('0x4'));var util=require(_0xec03('0x5'));var path=require(_0xec03('0x6'));var sox=require(_0xec03('0x7'));var csv=require(_0xec03('0x8'));var ejs=require(_0xec03('0x9'));var fs=require('fs');var _=require(_0xec03('0xa'));var squel=require(_0xec03('0xb'));var crypto=require('crypto');var jsforce=require(_0xec03('0xc'));var deskjs=require(_0xec03('0xd'));var toCsv=require(_0xec03('0x8'));var querystring=require(_0xec03('0xe'));var Papa=require('papaparse');var qs=require(_0xec03('0xf'));var logger=require(_0xec03('0x10'))(_0xec03('0x11'));var utils=require(_0xec03('0x12'));var config=require(_0xec03('0x13'));var db=require(_0xec03('0x14'))['db'];var integrations=require(_0xec03('0x15'));var jayson=require(_0xec03('0x16'));var client=jayson['client'][_0xec03('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x190f46,_0x398720,_0x2f65a1,_0x9908ef){return new BPromise(function(_0x10418c,_0x8e5f46){var _0x9a818f=_0x9908ef||client;return _0x9a818f['request'](_0x190f46,_0x2f65a1)['then'](function(_0x5ca0e2){logger[_0xec03('0x18')](_0xec03('0x19'),_0x398720,_0xec03('0x1a'));logger[_0xec03('0x1b')](_0xec03('0x1c'),_0x398720,_0xec03('0x1a'),JSON[_0xec03('0x1d')](_0x5ca0e2));if(_0x5ca0e2[_0xec03('0x1e')]){if(_0x5ca0e2['error'][_0xec03('0x1f')]===0x1f4){logger['error'](_0xec03('0x19'),_0x398720,_0x5ca0e2['error'][_0xec03('0x20')]);return _0x8e5f46(_0x5ca0e2['error']['message']);}logger[_0xec03('0x1e')](_0xec03('0x19'),_0x398720,_0x5ca0e2[_0xec03('0x1e')][_0xec03('0x20')]);return _0x10418c(_0x5ca0e2['error'][_0xec03('0x20')]);}else{logger['info'](_0xec03('0x19'),_0x398720,_0xec03('0x1a'));_0x10418c(_0x5ca0e2[_0xec03('0x21')][_0xec03('0x20')]);}})[_0xec03('0x22')](function(_0x41b729){logger[_0xec03('0x1e')](_0xec03('0x19'),_0x398720,_0x41b729);_0x8e5f46(_0x41b729);});});}function respondWithStatusCode(_0x5df6cc,_0x205fc9){_0x205fc9=_0x205fc9||0xcc;return function(_0x568c36){if(_0x568c36){return _0x5df6cc[_0xec03('0x23')](_0x205fc9);}return _0x5df6cc[_0xec03('0x24')](_0x205fc9)[_0xec03('0x25')]();};}function respondWithResult(_0x15ef87,_0x59936d){_0x59936d=_0x59936d||0xc8;return function(_0x3880b0){if(_0x3880b0){return _0x15ef87[_0xec03('0x24')](_0x59936d)['json'](_0x3880b0);}};}function respondWithFilteredResult(_0x2bfcf6,_0xa5b580){return function(_0x26875e){if(_0x26875e){var _0x445452=_0x26875e[_0xec03('0x26')],_0x1c6870=_0xa5b580[_0xec03('0x27')],_0x581322=_0xa5b580[_0xec03('0x27')]+_0xa5b580[_0xec03('0x28')],_0x73cc4f;if(_0x581322>=_0x445452){_0x581322=_0x445452;_0x73cc4f=0xc8;}else{_0x73cc4f=0xce;}_0x2bfcf6['status'](_0x73cc4f);return _0x2bfcf6[_0xec03('0x29')](_0xec03('0x2a'),_0x1c6870+'-'+_0x581322+'/'+_0x445452)['json'](_0x26875e);}return null;};}function patchUpdates(_0x530251){return function(_0x2063ba){try{jsonpatch[_0xec03('0x2b')](_0x2063ba,_0x530251,!![]);}catch(_0x35a9eb){return BPromise[_0xec03('0x2c')](_0x35a9eb);}return _0x2063ba[_0xec03('0x2d')]();};}function saveUpdates(_0x16a5d8,_0xda963b){return function(_0x28753c){if(_0x28753c){return _0x28753c['update'](_0x16a5d8)[_0xec03('0x2e')](function(_0x31c08d){return _0x31c08d;});}return null;};}function removeEntity(_0x2bd889,_0x145a13){return function(_0x13ba31){if(_0x13ba31){return _0x13ba31[_0xec03('0x2f')]()[_0xec03('0x2e')](function(){_0x2bd889[_0xec03('0x24')](0xcc)[_0xec03('0x25')]();});}};}function handleEntityNotFound(_0x4a4d6a,_0x5d441b){return function(_0x56cfd4){if(!_0x56cfd4){_0x4a4d6a[_0xec03('0x23')](0x194);}return _0x56cfd4;};}function handleError(_0x440284,_0xdfd244){_0xdfd244=_0xdfd244||0x1f4;return function(_0x1ec98e){logger['error'](_0x1ec98e['stack']);if(_0x1ec98e['name']){delete _0x1ec98e['name'];}_0x440284[_0xec03('0x24')](_0xdfd244)[_0xec03('0x30')](_0x1ec98e);};}exports[_0xec03('0x31')]=function(_0x3756db,_0x11c75b){var _0x3d7d98={},_0x23a26b={},_0x1cee38={'count':0x0,'rows':[]};var _0x44ccf4=db[_0xec03('0x32')][_0xec03('0x33')];_0x23a26b[_0xec03('0x34')]=_['keys'](_0x44ccf4);var _0x214098={'dateStart':_0x3756db[_0xec03('0x35')][_0xec03('0x36')],'dateEnd':_0x3756db['query'][_0xec03('0x37')]};delete _0x3756db[_0xec03('0x35')][_0xec03('0x36')];delete _0x3756db[_0xec03('0x35')][_0xec03('0x37')];_0x23a26b[_0xec03('0x35')]=_[_0xec03('0x38')](_0x3756db[_0xec03('0x35')]);_0x23a26b[_0xec03('0x39')]=_[_0xec03('0x3a')](_0x23a26b[_0xec03('0x34')],_0x23a26b['query']);_0x3d7d98[_0xec03('0x3b')]=_[_0xec03('0x3a')](_0x23a26b[_0xec03('0x34')],qs[_0xec03('0x3c')](_0x3756db[_0xec03('0x35')][_0xec03('0x3c')]));_0x3d7d98[_0xec03('0x3b')]=_0x3d7d98[_0xec03('0x3b')]['length']?_0x3d7d98[_0xec03('0x3b')]:_0x23a26b['model'];if(!_0x3756db['query'][_0xec03('0x3d')]('nolimit')){_0x3d7d98['limit']=qs[_0xec03('0x28')](_0x3756db[_0xec03('0x35')]['limit']);_0x3d7d98[_0xec03('0x27')]=qs['offset'](_0x3756db['query']['offset']);}_0x3d7d98[_0xec03('0x3e')]=qs[_0xec03('0x3f')](_0x3756db[_0xec03('0x35')][_0xec03('0x3f')]);_0x3d7d98['where']=qs[_0xec03('0x39')](_[_0xec03('0x40')](_0x3756db[_0xec03('0x35')],_0x23a26b[_0xec03('0x39')]));if(_0x214098[_0xec03('0x36')]){if(_0x214098[_0xec03('0x37')]){_0x214098[_0xec03('0x37')]=moment(_0x214098[_0xec03('0x37')])[_0xec03('0x41')](0x1,'day');}else{_0x214098[_0xec03('0x37')]=moment(_0x214098[_0xec03('0x36')])[_0xec03('0x41')](0x1,_0xec03('0x42'));}_['merge'](_0x3d7d98[_0xec03('0x43')],{'createdAt':{'$gte':_0x214098[_0xec03('0x36')],'$lte':_0x214098[_0xec03('0x37')]}});}if(_0x3756db[_0xec03('0x35')][_0xec03('0x44')]){_0x3d7d98[_0xec03('0x43')]=_['merge'](_0x3d7d98['where'],{'$or':_[_0xec03('0x45')](_0x3d7d98[_0xec03('0x3b')],function(_0x1cd711){var _0x19e390={};_0x19e390[_0x1cd711]={'$like':'%'+_0x3756db[_0xec03('0x35')]['filter']+'%'};return _0x19e390;})});}_0x3d7d98=_['merge']({},_0x3d7d98,_0x3756db[_0xec03('0x46')]);var _0x561d0f={'where':_0x3d7d98[_0xec03('0x43')]};return db[_0xec03('0x32')][_0xec03('0x26')](_0x561d0f)[_0xec03('0x2e')](function(_0x58e200){_0x1cee38[_0xec03('0x26')]=_0x58e200;if(_0x3756db[_0xec03('0x35')][_0xec03('0x47')]){_0x3d7d98[_0xec03('0x48')]=[{'all':!![]}];}return db['ZohoAccount'][_0xec03('0x49')](_0x3d7d98);})['then'](function(_0x2814b4){_0x1cee38[_0xec03('0x4a')]=_0x2814b4;return _0x1cee38;})[_0xec03('0x2e')](respondWithFilteredResult(_0x11c75b,_0x3d7d98))[_0xec03('0x22')](handleError(_0x11c75b,null));};exports[_0xec03('0x4b')]=function(_0x15fe1d,_0x381822){var _0x5647af={'raw':![],'where':{'id':_0x15fe1d[_0xec03('0x4c')]['id']}},_0x321e6e={};_0x321e6e[_0xec03('0x34')]=_[_0xec03('0x38')](db['ZohoAccount'][_0xec03('0x33')]);_0x321e6e['query']=_[_0xec03('0x38')](_0x15fe1d[_0xec03('0x35')]);_0x321e6e[_0xec03('0x39')]=_[_0xec03('0x3a')](_0x321e6e['model'],_0x321e6e[_0xec03('0x35')]);_0x5647af[_0xec03('0x3b')]=_[_0xec03('0x3a')](_0x321e6e[_0xec03('0x34')],qs[_0xec03('0x3c')](_0x15fe1d['query'][_0xec03('0x3c')]));_0x5647af[_0xec03('0x3b')]=_0x5647af[_0xec03('0x3b')]['length']?_0x5647af['attributes']:_0x321e6e[_0xec03('0x34')];if(_0x15fe1d[_0xec03('0x35')][_0xec03('0x47')]){_0x5647af[_0xec03('0x48')]=[{'all':!![]}];}_0x5647af=_['merge']({},_0x5647af,_0x15fe1d[_0xec03('0x46')]);return db[_0xec03('0x32')][_0xec03('0x4d')](_0x5647af)[_0xec03('0x2e')](handleEntityNotFound(_0x381822,null))['then'](respondWithResult(_0x381822,null))[_0xec03('0x22')](handleError(_0x381822,null));};exports[_0xec03('0x4e')]=function(_0x2354b5,_0x555fa8){return db[_0xec03('0x32')][_0xec03('0x4e')](_0x2354b5[_0xec03('0x4f')],{})[_0xec03('0x2e')](respondWithResult(_0x555fa8,0xc9))['catch'](handleError(_0x555fa8,null));};exports[_0xec03('0x50')]=function(_0xe07bf2,_0x2c6ca9){if(_0xe07bf2[_0xec03('0x4f')]['id']){delete _0xe07bf2['body']['id'];}return db[_0xec03('0x32')][_0xec03('0x4d')]({'where':{'id':_0xe07bf2[_0xec03('0x4c')]['id']}})[_0xec03('0x2e')](handleEntityNotFound(_0x2c6ca9,null))['then'](saveUpdates(_0xe07bf2[_0xec03('0x4f')],null))[_0xec03('0x2e')](respondWithResult(_0x2c6ca9,null))[_0xec03('0x22')](handleError(_0x2c6ca9,null));};exports[_0xec03('0x2f')]=function(_0x7715b0,_0x19272d){return db[_0xec03('0x32')][_0xec03('0x4d')]({'where':{'id':_0x7715b0['params']['id']}})[_0xec03('0x2e')](handleEntityNotFound(_0x19272d,null))['then'](removeEntity(_0x19272d,null))[_0xec03('0x22')](handleError(_0x19272d,null));};exports['getConfigurations']=function(_0x2ea560,_0x2956fb,_0x1fcac0){var _0x3e2498={};var _0x41cf31={};var _0x1bdb06;var _0x2140e1;return db[_0xec03('0x32')]['findOne']({'where':{'id':_0x2ea560[_0xec03('0x4c')]['id']}})[_0xec03('0x2e')](handleEntityNotFound(_0x2956fb,null))['then'](function(_0x430e4b){if(_0x430e4b){_0x1bdb06=_0x430e4b;_0x41cf31[_0xec03('0x34')]=_['keys'](db['ZohoConfiguration'][_0xec03('0x33')]);_0x41cf31[_0xec03('0x35')]=_[_0xec03('0x38')](_0x2ea560[_0xec03('0x35')]);_0x41cf31[_0xec03('0x39')]=_[_0xec03('0x3a')](_0x41cf31[_0xec03('0x34')],_0x41cf31[_0xec03('0x35')]);_0x3e2498[_0xec03('0x3b')]=_[_0xec03('0x3a')](_0x41cf31[_0xec03('0x34')],qs[_0xec03('0x3c')](_0x2ea560[_0xec03('0x35')][_0xec03('0x3c')]));_0x3e2498[_0xec03('0x3b')]=_0x3e2498['attributes'][_0xec03('0x51')]?_0x3e2498['attributes']:_0x41cf31[_0xec03('0x34')];_0x3e2498[_0xec03('0x3e')]=qs[_0xec03('0x3f')](_0x2ea560[_0xec03('0x35')][_0xec03('0x3f')]);_0x3e2498[_0xec03('0x43')]=qs['filters'](_[_0xec03('0x40')](_0x2ea560[_0xec03('0x35')],_0x41cf31[_0xec03('0x39')]));if(_0x2ea560[_0xec03('0x35')][_0xec03('0x44')]){_0x3e2498[_0xec03('0x43')]=_[_0xec03('0x52')](_0x3e2498[_0xec03('0x43')],{'$or':_['map'](_0x3e2498[_0xec03('0x3b')],function(_0x1fb108){var _0x4a5e18={};_0x4a5e18[_0x1fb108]={'$like':'%'+_0x2ea560[_0xec03('0x35')][_0xec03('0x44')]+'%'};return _0x4a5e18;})});}_0x3e2498=_[_0xec03('0x52')]({},_0x3e2498,_0x2ea560[_0xec03('0x46')]);return _0x1bdb06[_0xec03('0x53')](_0x3e2498);}})['then'](function(_0x59a9a7){if(_0x59a9a7){_0x2140e1=_0x59a9a7[_0xec03('0x51')];if(!_0x2ea560[_0xec03('0x35')][_0xec03('0x3d')](_0xec03('0x54'))){_0x3e2498[_0xec03('0x28')]=qs[_0xec03('0x28')](_0x2ea560['query'][_0xec03('0x28')]);_0x3e2498[_0xec03('0x27')]=qs[_0xec03('0x27')](_0x2ea560['query'][_0xec03('0x27')]);}return _0x1bdb06['getConfigurations'](_0x3e2498);}})['then'](function(_0xa6fde3){if(_0xa6fde3){return _0xa6fde3?{'count':_0x2140e1,'rows':_0xa6fde3}:null;}})[_0xec03('0x2e')](respondWithResult(_0x2956fb,null))[_0xec03('0x22')](handleError(_0x2956fb,null));};exports[_0xec03('0x55')]=function(_0x2896b4,_0x5aab2c,_0x4cb1a0){if(_0x2896b4['body']['id']){delete _0x2896b4[_0xec03('0x4f')]['id'];}return db[_0xec03('0x32')][_0xec03('0x56')]({'where':{'id':_0x2896b4['params']['id']}})['then'](handleEntityNotFound(_0x5aab2c,null))[_0xec03('0x2e')](function(_0x53e4ab){if(_0x53e4ab){_0x2896b4[_0xec03('0x4f')][_0xec03('0x57')]=_0x53e4ab['id'];_0x2896b4[_0xec03('0x4f')]['Subjects']=integrations[_0xec03('0x58')](_0x2896b4['body'][_0xec03('0x59')],_0x2896b4['body']['type']);_0x2896b4['body'][_0xec03('0x5a')]=integrations[_0xec03('0x5b')](_0x2896b4[_0xec03('0x4f')][_0xec03('0x59')],_0x2896b4[_0xec03('0x4f')][_0xec03('0x5c')]);return db[_0xec03('0x5d')]['create'](_0x2896b4[_0xec03('0x4f')],{'include':[{'model':db[_0xec03('0x5e')],'as':'Subjects'},{'model':db[_0xec03('0x5e')],'as':'Descriptions'}]});}return null;})[_0xec03('0x2e')](respondWithResult(_0x5aab2c,null))[_0xec03('0x22')](handleError(_0x5aab2c,null));};exports[_0xec03('0x5f')]=function(_0x573679,_0x17b507,_0xe831cf){return db['ZohoAccount']['findOne']({'where':{'id':_0x573679[_0xec03('0x4c')]['id']},'attributes':['id',_0xec03('0x60'),_0xec03('0x61')]})[_0xec03('0x2e')](handleEntityNotFound(_0x17b507,null))[_0xec03('0x2e')](function(_0x29e0da){if(_0x29e0da){return rp({'method':_0xec03('0x62'),'uri':util[_0xec03('0x63')](_0xec03('0x64'),_0x29e0da['host']),'qs':{'authtoken':_0x29e0da[_0xec03('0x61')],'scope':_0xec03('0x65')},'json':!![]});}})[_0xec03('0x2e')](function(_0x3629d1){if(_0x3629d1){if(_0x3629d1[_0xec03('0x66')]&&_0x3629d1['response']['error']){throw new Error(_0x3629d1['response'][_0xec03('0x1e')]['message']);}var _0x1c75bc=[];if(_0x3629d1[_0xec03('0x67')]&&_0x3629d1[_0xec03('0x67')][_0xec03('0x68')]){if(_0x3629d1['Calls'][_0xec03('0x68')]['FL']){var _0xb77894=['Call\x20Purpose'];for(var _0x2d3172=0x0,_0x4fa223=_0x3629d1[_0xec03('0x67')][_0xec03('0x68')]['FL'][_0xec03('0x51')];_0x2d3172<_0x4fa223;_0x2d3172++){if(_['includes'](_0xb77894,_0x3629d1['Calls'][_0xec03('0x68')]['FL'][_0x2d3172]['dv'])){_0x1c75bc[_0xec03('0x69')]({'id':_0x3629d1[_0xec03('0x67')][_0xec03('0x68')]['FL'][_0x2d3172]['dv'],'name':_0x3629d1[_0xec03('0x67')][_0xec03('0x68')]['FL'][_0x2d3172]['label'],'custom':_0x3629d1[_0xec03('0x67')][_0xec03('0x68')]['FL'][_0x2d3172][_0xec03('0x6a')]===_0xec03('0x6b')?!![]:![],'options':_0x3629d1[_0xec03('0x67')][_0xec03('0x68')]['FL'][_0x2d3172][_0xec03('0x5c')]==='Pick\x20List'&&_0x3629d1[_0xec03('0x67')][_0xec03('0x68')]['FL'][_0x2d3172]['val']?_['map'](_0x3629d1[_0xec03('0x67')]['section']['FL'][_0x2d3172][_0xec03('0x6c')],function(_0x205d44){return{'name':_0x205d44,'value':_0x205d44};}):[]});}}}}return{'count':_0x1c75bc[_0xec03('0x51')],'rows':_0x1c75bc};}})[_0xec03('0x2e')](respondWithResult(_0x17b507,null))[_0xec03('0x22')](function(_0x2ffdd5){var _0x505347=_0x573679['query'][_0xec03('0x6d')]?0x1f4:_0x2ffdd5[_0xec03('0x6e')]||0x1f4;logger[_0xec03('0x1e')](_0xec03('0x6f'),_0xec03('0x5f'),_0x505347,JSON[_0xec03('0x1d')](_0x2ffdd5));delete _0x2ffdd5[_0xec03('0x70')];if(_0x505347===0x191){_0x505347=0x190;}_0x17b507[_0xec03('0x24')](_0x505347)[_0xec03('0x30')](_0x573679[_0xec03('0x35')][_0xec03('0x6d')]?{'message':_0xec03('0x71'),'statusCode':_0x2ffdd5[_0xec03('0x6e')]}:_0x2ffdd5);});};
\ No newline at end of file
index 21a75ca..c5a8a38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x904a=['int_zoho_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','exports','define'];(function(_0x3eaaf9,_0x411cc5){var _0x59d0a6=function(_0x1c1a2b){while(--_0x1c1a2b){_0x3eaaf9['push'](_0x3eaaf9['shift']());}};_0x59d0a6(++_0x411cc5);}(_0x904a,0x1cd));var _0xa904=function(_0x3e9aaa,_0xf99f57){_0x3e9aaa=_0x3e9aaa-0x0;var _0x38c0fe=_0x904a[_0x3e9aaa];return _0x38c0fe;};'use strict';var _=require(_0xa904('0x0'));var util=require(_0xa904('0x1'));var logger=require(_0xa904('0x2'))(_0xa904('0x3'));var moment=require(_0xa904('0x4'));var BPromise=require(_0xa904('0x5'));var rp=require(_0xa904('0x6'));var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xa904('0x7')]=function(_0x47a7c1,_0x297cf8){return _0x47a7c1[_0xa904('0x8')]('ZohoAccount',attributes,{'tableName':_0xa904('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd7ce=['request-promise','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1cc133,_0x4273b2){var _0x43d52d=function(_0x2a8bae){while(--_0x2a8bae){_0x1cc133['push'](_0x1cc133['shift']());}};_0x43d52d(++_0x4273b2);}(_0xd7ce,0xf6));var _0xed7c=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0xd7ce[_0x1a8f86];return _0x20d876;};'use strict';var _=require(_0xed7c('0x0'));var util=require(_0xed7c('0x1'));var logger=require(_0xed7c('0x2'))(_0xed7c('0x3'));var moment=require(_0xed7c('0x4'));var BPromise=require(_0xed7c('0x5'));var rp=require(_0xed7c('0x6'));var attributes=require(_0xed7c('0x7'));var integrations=require(_0xed7c('0x8'));module['exports']=function(_0x1adfc8,_0x52cc05){return _0x1adfc8[_0xed7c('0x9')](_0xed7c('0xa'),attributes,{'tableName':_0xed7c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 92e800d..f23730b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5cf=['then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','GetZohoAccount','ZohoAccount','findAll','raw','options','attributes','limit','include','map','model','catch','ShowZohoAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xc5cf,0x15b));var _0xfc5c=function(_0x322d57,_0x3a931a){_0x322d57=_0x322d57-0x0;var _0x216afd=_0xc5cf[_0x322d57];return _0x216afd;};'use strict';var _=require(_0xfc5c('0x0'));var util=require(_0xfc5c('0x1'));var moment=require(_0xfc5c('0x2'));var BPromise=require(_0xfc5c('0x3'));var rs=require(_0xfc5c('0x4'));var fs=require('fs');var db=require(_0xfc5c('0x5'))['db'];var utils=require(_0xfc5c('0x6'));var logger=require(_0xfc5c('0x7'))(_0xfc5c('0x8'));var config=require('../../config/environment');var jayson=require(_0xfc5c('0x9'));var client=jayson[_0xfc5c('0xa')][_0xfc5c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23ae81,_0x2e99e9,_0x5e2429){return new BPromise(function(_0x56a628,_0x5b53e1){return client[_0xfc5c('0xc')](_0x23ae81,_0x5e2429)[_0xfc5c('0xd')](function(_0x2d23fa){logger[_0xfc5c('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x2e99e9,_0xfc5c('0xf'));logger[_0xfc5c('0x10')](_0xfc5c('0x11'),_0x2e99e9,_0xfc5c('0xf'),JSON[_0xfc5c('0x12')](_0x2d23fa));if(_0x2d23fa[_0xfc5c('0x13')]){if(_0x2d23fa[_0xfc5c('0x13')][_0xfc5c('0x14')]===0x1f4){logger[_0xfc5c('0x13')](_0xfc5c('0x15'),_0x2e99e9,_0x2d23fa[_0xfc5c('0x13')][_0xfc5c('0x16')]);return _0x5b53e1(_0x2d23fa[_0xfc5c('0x13')][_0xfc5c('0x16')]);}logger[_0xfc5c('0x13')]('ZohoAccount,\x20%s,\x20%s',_0x2e99e9,_0x2d23fa[_0xfc5c('0x13')]['message']);return _0x56a628(_0x2d23fa[_0xfc5c('0x13')][_0xfc5c('0x16')]);}else{logger[_0xfc5c('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x2e99e9,_0xfc5c('0xf'));_0x56a628(_0x2d23fa['result']['message']);}})['catch'](function(_0x48cc3a){logger[_0xfc5c('0x13')]('ZohoAccount,\x20%s,\x20%s',_0x2e99e9,_0x48cc3a);_0x5b53e1(_0x48cc3a);});});}exports[_0xfc5c('0x17')]=function(_0x4e2c18){var _0x1c12e9=this;return new Promise(function(_0x3b90f4,_0x3e5f01){return db[_0xfc5c('0x18')][_0xfc5c('0x19')]({'raw':_0x4e2c18['options']?_0x4e2c18['options'][_0xfc5c('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e2c18['options']?_0x4e2c18[_0xfc5c('0x1b')]['where']||null:null,'attributes':_0x4e2c18[_0xfc5c('0x1b')]?_0x4e2c18[_0xfc5c('0x1b')][_0xfc5c('0x1c')]||null:null,'limit':_0x4e2c18[_0xfc5c('0x1b')]?_0x4e2c18[_0xfc5c('0x1b')][_0xfc5c('0x1d')]||null:null,'include':_0x4e2c18[_0xfc5c('0x1b')]?_0x4e2c18[_0xfc5c('0x1b')][_0xfc5c('0x1e')]?_[_0xfc5c('0x1f')](_0x4e2c18[_0xfc5c('0x1b')][_0xfc5c('0x1e')],function(_0x354217){return{'model':db[_0x354217['model']],'as':_0x354217['as'],'attributes':_0x354217['attributes'],'include':_0x354217['include']?_[_0xfc5c('0x1f')](_0x354217['include'],function(_0x575a9b){return{'model':db[_0x575a9b[_0xfc5c('0x20')]],'as':_0x575a9b['as'],'attributes':_0x575a9b[_0xfc5c('0x1c')],'include':_0x575a9b[_0xfc5c('0x1e')]?_[_0xfc5c('0x1f')](_0x575a9b[_0xfc5c('0x1e')],function(_0x3ad3e5){return{'model':db[_0x3ad3e5[_0xfc5c('0x20')]],'as':_0x3ad3e5['as'],'attributes':_0x3ad3e5[_0xfc5c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xfc5c('0xd')](function(_0x45bad5){logger[_0xfc5c('0xe')](_0xfc5c('0x17'),_0x4e2c18);logger[_0xfc5c('0x10')](_0xfc5c('0x17'),_0x4e2c18,JSON[_0xfc5c('0x12')](_0x45bad5));_0x3b90f4(_0x45bad5);})[_0xfc5c('0x21')](function(_0x191c5d){logger[_0xfc5c('0x13')]('GetZohoAccount',_0x191c5d[_0xfc5c('0x16')],_0x4e2c18);_0x3e5f01(_0x1c12e9[_0xfc5c('0x13')](0x1f4,_0x191c5d['message']));});});};exports[_0xfc5c('0x22')]=function(_0x4829df){var _0x42cc94=this;return new Promise(function(_0xf16998,_0x1ed6d8){return db['ZohoAccount'][_0xfc5c('0x23')]({'raw':_0x4829df[_0xfc5c('0x1b')]?_0x4829df[_0xfc5c('0x1b')][_0xfc5c('0x1a')]===undefined?!![]:![]:!![],'where':_0x4829df[_0xfc5c('0x1b')]?_0x4829df['options']['where']||null:null,'attributes':_0x4829df[_0xfc5c('0x1b')]?_0x4829df['options'][_0xfc5c('0x1c')]||null:null,'include':_0x4829df['options']?_0x4829df[_0xfc5c('0x1b')][_0xfc5c('0x1e')]?_[_0xfc5c('0x1f')](_0x4829df[_0xfc5c('0x1b')][_0xfc5c('0x1e')],function(_0x1de196){return{'model':db[_0x1de196[_0xfc5c('0x20')]],'as':_0x1de196['as'],'attributes':_0x1de196[_0xfc5c('0x1c')],'include':_0x1de196[_0xfc5c('0x1e')]?_[_0xfc5c('0x1f')](_0x1de196[_0xfc5c('0x1e')],function(_0x282752){return{'model':db[_0x282752[_0xfc5c('0x20')]],'as':_0x282752['as'],'attributes':_0x282752[_0xfc5c('0x1c')],'include':_0x282752[_0xfc5c('0x1e')]?_['map'](_0x282752['include'],function(_0x45928b){return{'model':db[_0x45928b[_0xfc5c('0x20')]],'as':_0x45928b['as'],'attributes':_0x45928b['attributes']};}):[]};}):[]};}):[]:[]})[_0xfc5c('0xd')](function(_0xc973b1){logger[_0xfc5c('0xe')](_0xfc5c('0x22'),_0x4829df);logger[_0xfc5c('0x10')](_0xfc5c('0x22'),_0x4829df,JSON[_0xfc5c('0x12')](_0xc973b1));_0xf16998(_0xc973b1);})[_0xfc5c('0x21')](function(_0x59ab91){logger[_0xfc5c('0x13')](_0xfc5c('0x22'),_0x59ab91[_0xfc5c('0x16')],_0x4829df);_0x1ed6d8(_0x42cc94[_0xfc5c('0x13')](0x1f4,_0x59ab91[_0xfc5c('0x16')]));});});};
\ No newline at end of file
+var _0x32e6=['../../config/logger','rpc','jayson/promise','client','http','then','info','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ZohoAccount,\x20%s,\x20%s','message','result','GetZohoAccount','ZohoAccount','findAll','options','raw','where','include','map','model','attributes','ShowZohoAccount','find','catch','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x26158b,_0x15593e){var _0x413e2b=function(_0x304255){while(--_0x304255){_0x26158b['push'](_0x26158b['shift']());}};_0x413e2b(++_0x15593e);}(_0x32e6,0x82));var _0x632e=function(_0x56c1e6,_0x145596){_0x56c1e6=_0x56c1e6-0x0;var _0x474e2c=_0x32e6[_0x56c1e6];return _0x474e2c;};'use strict';var _=require(_0x632e('0x0'));var util=require(_0x632e('0x1'));var moment=require(_0x632e('0x2'));var BPromise=require(_0x632e('0x3'));var rs=require(_0x632e('0x4'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x632e('0x5'));var logger=require(_0x632e('0x6'))(_0x632e('0x7'));var config=require('../../config/environment');var jayson=require(_0x632e('0x8'));var client=jayson[_0x632e('0x9')][_0x632e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d2800,_0x40411d,_0x11dea4){return new BPromise(function(_0x25e6a7,_0x4665a5){return client['request'](_0x1d2800,_0x11dea4)[_0x632e('0xb')](function(_0x32b732){logger[_0x632e('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x40411d,'request\x20sent');logger[_0x632e('0xd')](_0x632e('0xe'),_0x40411d,_0x632e('0xf'),JSON[_0x632e('0x10')](_0x32b732));if(_0x32b732[_0x632e('0x11')]){if(_0x32b732[_0x632e('0x11')]['code']===0x1f4){logger[_0x632e('0x11')](_0x632e('0x12'),_0x40411d,_0x32b732[_0x632e('0x11')][_0x632e('0x13')]);return _0x4665a5(_0x32b732[_0x632e('0x11')][_0x632e('0x13')]);}logger[_0x632e('0x11')](_0x632e('0x12'),_0x40411d,_0x32b732['error'][_0x632e('0x13')]);return _0x25e6a7(_0x32b732[_0x632e('0x11')]['message']);}else{logger[_0x632e('0xc')](_0x632e('0x12'),_0x40411d,_0x632e('0xf'));_0x25e6a7(_0x32b732[_0x632e('0x14')][_0x632e('0x13')]);}})['catch'](function(_0x569f2b){logger[_0x632e('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x40411d,_0x569f2b);_0x4665a5(_0x569f2b);});});}exports[_0x632e('0x15')]=function(_0x557141){var _0x4aa3e3=this;return new Promise(function(_0x1167e3,_0x2a06b3){return db[_0x632e('0x16')][_0x632e('0x17')]({'raw':_0x557141[_0x632e('0x18')]?_0x557141[_0x632e('0x18')][_0x632e('0x19')]===undefined?!![]:![]:!![],'where':_0x557141[_0x632e('0x18')]?_0x557141[_0x632e('0x18')][_0x632e('0x1a')]||null:null,'attributes':_0x557141[_0x632e('0x18')]?_0x557141[_0x632e('0x18')]['attributes']||null:null,'limit':_0x557141[_0x632e('0x18')]?_0x557141[_0x632e('0x18')]['limit']||null:null,'include':_0x557141[_0x632e('0x18')]?_0x557141[_0x632e('0x18')][_0x632e('0x1b')]?_[_0x632e('0x1c')](_0x557141[_0x632e('0x18')]['include'],function(_0x3cd1ac){return{'model':db[_0x3cd1ac[_0x632e('0x1d')]],'as':_0x3cd1ac['as'],'attributes':_0x3cd1ac[_0x632e('0x1e')],'include':_0x3cd1ac['include']?_[_0x632e('0x1c')](_0x3cd1ac['include'],function(_0x5dea8b){return{'model':db[_0x5dea8b[_0x632e('0x1d')]],'as':_0x5dea8b['as'],'attributes':_0x5dea8b[_0x632e('0x1e')],'include':_0x5dea8b[_0x632e('0x1b')]?_['map'](_0x5dea8b[_0x632e('0x1b')],function(_0x53f1fe){return{'model':db[_0x53f1fe['model']],'as':_0x53f1fe['as'],'attributes':_0x53f1fe[_0x632e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x632e('0xb')](function(_0x55fea4){logger['info']('GetZohoAccount',_0x557141);logger['debug'](_0x632e('0x15'),_0x557141,JSON[_0x632e('0x10')](_0x55fea4));_0x1167e3(_0x55fea4);})['catch'](function(_0x13ed87){logger[_0x632e('0x11')](_0x632e('0x15'),_0x13ed87['message'],_0x557141);_0x2a06b3(_0x4aa3e3[_0x632e('0x11')](0x1f4,_0x13ed87[_0x632e('0x13')]));});});};exports[_0x632e('0x1f')]=function(_0x2f7183){var _0x3fd7ac=this;return new Promise(function(_0x89c722,_0xe575e9){return db[_0x632e('0x16')][_0x632e('0x20')]({'raw':_0x2f7183[_0x632e('0x18')]?_0x2f7183[_0x632e('0x18')][_0x632e('0x19')]===undefined?!![]:![]:!![],'where':_0x2f7183[_0x632e('0x18')]?_0x2f7183[_0x632e('0x18')][_0x632e('0x1a')]||null:null,'attributes':_0x2f7183['options']?_0x2f7183[_0x632e('0x18')][_0x632e('0x1e')]||null:null,'include':_0x2f7183[_0x632e('0x18')]?_0x2f7183['options'][_0x632e('0x1b')]?_[_0x632e('0x1c')](_0x2f7183[_0x632e('0x18')]['include'],function(_0x57f4c2){return{'model':db[_0x57f4c2[_0x632e('0x1d')]],'as':_0x57f4c2['as'],'attributes':_0x57f4c2[_0x632e('0x1e')],'include':_0x57f4c2[_0x632e('0x1b')]?_[_0x632e('0x1c')](_0x57f4c2[_0x632e('0x1b')],function(_0x284be0){return{'model':db[_0x284be0[_0x632e('0x1d')]],'as':_0x284be0['as'],'attributes':_0x284be0[_0x632e('0x1e')],'include':_0x284be0[_0x632e('0x1b')]?_[_0x632e('0x1c')](_0x284be0[_0x632e('0x1b')],function(_0x2a7eb1){return{'model':db[_0x2a7eb1['model']],'as':_0x2a7eb1['as'],'attributes':_0x2a7eb1[_0x632e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x632e('0xb')](function(_0x24edc7){logger[_0x632e('0xc')](_0x632e('0x1f'),_0x2f7183);logger[_0x632e('0xd')]('ShowZohoAccount',_0x2f7183,JSON[_0x632e('0x10')](_0x24edc7));_0x89c722(_0x24edc7);})[_0x632e('0x21')](function(_0x57fe2b){logger[_0x632e('0x11')](_0x632e('0x1f'),_0x57fe2b[_0x632e('0x13')],_0x2f7183);_0xe575e9(_0x3fd7ac[_0x632e('0x11')](0x1f4,_0x57fe2b[_0x632e('0x13')]));});});};
\ No newline at end of file
index f52fb5b..c837212 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24d5=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/subjects','getDescriptions','post','put','update','delete','destroy','exports','util'];(function(_0x2c89f9,_0x9921e){var _0x269858=function(_0xaef195){while(--_0xaef195){_0x2c89f9['push'](_0x2c89f9['shift']());}};_0x269858(++_0x9921e);}(_0x24d5,0x1a1));var _0x524d=function(_0x2bf292,_0x11e6dd){_0x2bf292=_0x2bf292-0x0;var _0x13b69b=_0x24d5[_0x2bf292];return _0x13b69b;};'use strict';var multer=require('multer');var util=require(_0x524d('0x0'));var path=require(_0x524d('0x1'));var express=require(_0x524d('0x2'));var router=express[_0x524d('0x3')]();var auth=require(_0x524d('0x4'));var interaction=require(_0x524d('0x5'));var config=require(_0x524d('0x6'));var controller=require('./intZohoConfiguration.controller');router[_0x524d('0x7')]('/',auth['isAuthenticated'](),controller[_0x524d('0x8')]);router['get'](_0x524d('0x9'),auth[_0x524d('0xa')](),controller['show']);router[_0x524d('0x7')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x524d('0x7')](_0x524d('0xb'),auth['isAuthenticated'](),controller['getSubjects']);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x524d('0xc')]);router[_0x524d('0xd')]('/',auth[_0x524d('0xa')](),controller['create']);router[_0x524d('0xe')](_0x524d('0x9'),auth[_0x524d('0xa')](),controller[_0x524d('0xf')]);router[_0x524d('0x10')](_0x524d('0x9'),auth[_0x524d('0xa')](),controller[_0x524d('0x11')]);module[_0x524d('0x12')]=router;
\ No newline at end of file
+var _0xcf52=['exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','destroy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcf52,0x1ef));var _0x2cf5=function(_0x5cb70d,_0x1dae4b){_0x5cb70d=_0x5cb70d-0x0;var _0x54da82=_0xcf52[_0x5cb70d];return _0x54da82;};'use strict';var multer=require(_0x2cf5('0x0'));var util=require('util');var path=require(_0x2cf5('0x1'));var express=require(_0x2cf5('0x2'));var router=express[_0x2cf5('0x3')]();var auth=require(_0x2cf5('0x4'));var interaction=require(_0x2cf5('0x5'));var config=require(_0x2cf5('0x6'));var controller=require('./intZohoConfiguration.controller');router[_0x2cf5('0x7')]('/',auth['isAuthenticated'](),controller[_0x2cf5('0x8')]);router[_0x2cf5('0x7')](_0x2cf5('0x9'),auth[_0x2cf5('0xa')](),controller['show']);router[_0x2cf5('0x7')](_0x2cf5('0xb'),auth[_0x2cf5('0xa')](),controller[_0x2cf5('0xc')]);router[_0x2cf5('0x7')](_0x2cf5('0xd'),auth[_0x2cf5('0xa')](),controller[_0x2cf5('0xe')]);router['get']('/:id/descriptions',auth[_0x2cf5('0xa')](),controller[_0x2cf5('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2cf5('0x10')]);router['put'](_0x2cf5('0x9'),auth[_0x2cf5('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2cf5('0x11')]);module[_0x2cf5('0x12')]=router;
\ No newline at end of file
index afc6880..c2126f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7065=['STRING','sequelize','exports'];(function(_0x14437b,_0xe9c398){var _0x463de0=function(_0x220e54){while(--_0x220e54){_0x14437b['push'](_0x14437b['shift']());}};_0x463de0(++_0xe9c398);}(_0x7065,0x1db));var _0x5706=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7065[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5706('0x0'));module[_0x5706('0x1')]={'name':{'type':Sequelize[_0x5706('0x2')]},'description':{'type':Sequelize[_0x5706('0x2')]}};
\ No newline at end of file
+var _0xa254=['exports'];(function(_0x19106c,_0x22da38){var _0xbe5a82=function(_0x45d112){while(--_0x45d112){_0x19106c['push'](_0x19106c['shift']());}};_0xbe5a82(++_0x22da38);}(_0xa254,0x7d));var _0x4a25=function(_0x4cdcdc,_0x34eac7){_0x4cdcdc=_0x4cdcdc-0x0;var _0x4704ce=_0xa254[_0x4cdcdc];return _0x4704ce;};'use strict';var Sequelize=require('sequelize');module[_0x4a25('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 12a0852..e6b60c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc310=['../../config/utils','../../config/environment','../../mysqldb','client','http','request','info','debug','request\x20sent','error','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','apply','reject','save','destroy','then','stack','name','send','index','ZohoConfiguration','model','query','dateEnd','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','dateStart','add','day','merge','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','update','findOne','ZohoField','map','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api'];(function(_0x51446b,_0x538de7){var _0x38c321=function(_0x40e35c){while(--_0x40e35c){_0x51446b['push'](_0x51446b['shift']());}};_0x38c321(++_0x538de7);}(_0xc310,0xf7));var _0x0c31=function(_0x128d3a,_0x4f8183){_0x128d3a=_0x128d3a-0x0;var _0x1c6d75=_0xc310[_0x128d3a];return _0x1c6d75;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0c31('0x0'));var rimraf=require(_0x0c31('0x1'));var zipdir=require(_0x0c31('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0c31('0x3'));var moment=require(_0x0c31('0x4'));var BPromise=require(_0x0c31('0x5'));var Mustache=require(_0x0c31('0x6'));var util=require(_0x0c31('0x7'));var path=require('path');var sox=require(_0x0c31('0x8'));var csv=require(_0x0c31('0x9'));var ejs=require(_0x0c31('0xa'));var fs=require('fs');var _=require(_0x0c31('0xb'));var squel=require(_0x0c31('0xc'));var crypto=require(_0x0c31('0xd'));var jsforce=require(_0x0c31('0xe'));var deskjs=require(_0x0c31('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0c31('0x10'));var qs=require(_0x0c31('0x11'));var logger=require(_0x0c31('0x12'))(_0x0c31('0x13'));var utils=require(_0x0c31('0x14'));var config=require(_0x0c31('0x15'));var db=require(_0x0c31('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x0c31('0x17')][_0x0c31('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x14d37b,_0x3b64d4,_0x1a5215,_0x35194e){return new BPromise(function(_0x1210e6,_0x599073){var _0x5bff9e=_0x35194e||client;return _0x5bff9e[_0x0c31('0x19')](_0x14d37b,_0x1a5215)['then'](function(_0x5e5453){logger[_0x0c31('0x1a')]('ZohoConfiguration,\x20%s,\x20%s',_0x3b64d4,'request\x20sent');logger[_0x0c31('0x1b')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3b64d4,_0x0c31('0x1c'),JSON['stringify'](_0x5e5453));if(_0x5e5453[_0x0c31('0x1d')]){if(_0x5e5453[_0x0c31('0x1d')]['code']===0x1f4){logger['error'](_0x0c31('0x1e'),_0x3b64d4,_0x5e5453[_0x0c31('0x1d')][_0x0c31('0x1f')]);return _0x599073(_0x5e5453[_0x0c31('0x1d')][_0x0c31('0x1f')]);}logger[_0x0c31('0x1d')](_0x0c31('0x1e'),_0x3b64d4,_0x5e5453['error'][_0x0c31('0x1f')]);return _0x1210e6(_0x5e5453[_0x0c31('0x1d')][_0x0c31('0x1f')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x3b64d4,_0x0c31('0x1c'));_0x1210e6(_0x5e5453[_0x0c31('0x20')][_0x0c31('0x1f')]);}})[_0x0c31('0x21')](function(_0xafca48){logger[_0x0c31('0x1d')](_0x0c31('0x1e'),_0x3b64d4,_0xafca48);_0x599073(_0xafca48);});});}function respondWithStatusCode(_0x1a6262,_0x55afa0){_0x55afa0=_0x55afa0||0xcc;return function(_0x33234f){if(_0x33234f){return _0x1a6262[_0x0c31('0x22')](_0x55afa0);}return _0x1a6262[_0x0c31('0x23')](_0x55afa0)[_0x0c31('0x24')]();};}function respondWithResult(_0x21df62,_0x1e5f33){_0x1e5f33=_0x1e5f33||0xc8;return function(_0x4cd7f9){if(_0x4cd7f9){return _0x21df62['status'](_0x1e5f33)[_0x0c31('0x25')](_0x4cd7f9);}};}function respondWithFilteredResult(_0x465578,_0x310d13){return function(_0x5c8a75){if(_0x5c8a75){var _0x3dcf22=_0x5c8a75[_0x0c31('0x26')],_0x3de794=_0x310d13[_0x0c31('0x27')],_0x5dc48e=_0x310d13[_0x0c31('0x27')]+_0x310d13['limit'],_0x100404;if(_0x5dc48e>=_0x3dcf22){_0x5dc48e=_0x3dcf22;_0x100404=0xc8;}else{_0x100404=0xce;}_0x465578['status'](_0x100404);return _0x465578['set']('Content-Range',_0x3de794+'-'+_0x5dc48e+'/'+_0x3dcf22)[_0x0c31('0x25')](_0x5c8a75);}return null;};}function patchUpdates(_0x4399e7){return function(_0x3f7644){try{jsonpatch[_0x0c31('0x28')](_0x3f7644,_0x4399e7,!![]);}catch(_0x496afb){return BPromise[_0x0c31('0x29')](_0x496afb);}return _0x3f7644[_0x0c31('0x2a')]();};}function saveUpdates(_0x134d49,_0x1e34e5){return function(_0x278d42){if(_0x278d42){return _0x278d42['update'](_0x134d49)['then'](function(_0x43d808){return _0x43d808;});}return null;};}function removeEntity(_0x347873,_0x30cda1){return function(_0x32b679){if(_0x32b679){return _0x32b679[_0x0c31('0x2b')]()[_0x0c31('0x2c')](function(){_0x347873[_0x0c31('0x23')](0xcc)[_0x0c31('0x24')]();});}};}function handleEntityNotFound(_0x43d61d,_0x588cae){return function(_0x144698){if(!_0x144698){_0x43d61d[_0x0c31('0x22')](0x194);}return _0x144698;};}function handleError(_0x40388e,_0x532b87){_0x532b87=_0x532b87||0x1f4;return function(_0x5f0c2a){logger[_0x0c31('0x1d')](_0x5f0c2a[_0x0c31('0x2d')]);if(_0x5f0c2a[_0x0c31('0x2e')]){delete _0x5f0c2a[_0x0c31('0x2e')];}_0x40388e[_0x0c31('0x23')](_0x532b87)[_0x0c31('0x2f')](_0x5f0c2a);};}exports[_0x0c31('0x30')]=function(_0x13fa42,_0x233d72){var _0x12b446={},_0x4a9bf6={},_0x53481a={'count':0x0,'rows':[]};var _0x1caa26=db[_0x0c31('0x31')]['rawAttributes'];_0x4a9bf6[_0x0c31('0x32')]=_['keys'](_0x1caa26);var _0x1a3df6={'dateStart':_0x13fa42[_0x0c31('0x33')]['dateStart'],'dateEnd':_0x13fa42[_0x0c31('0x33')][_0x0c31('0x34')]};delete _0x13fa42['query']['dateStart'];delete _0x13fa42[_0x0c31('0x33')]['dateEnd'];_0x4a9bf6[_0x0c31('0x33')]=_[_0x0c31('0x35')](_0x13fa42['query']);_0x4a9bf6[_0x0c31('0x36')]=_[_0x0c31('0x37')](_0x4a9bf6[_0x0c31('0x32')],_0x4a9bf6['query']);_0x12b446['attributes']=_[_0x0c31('0x37')](_0x4a9bf6['model'],qs[_0x0c31('0x38')](_0x13fa42[_0x0c31('0x33')][_0x0c31('0x38')]));_0x12b446[_0x0c31('0x39')]=_0x12b446[_0x0c31('0x39')][_0x0c31('0x3a')]?_0x12b446[_0x0c31('0x39')]:_0x4a9bf6[_0x0c31('0x32')];if(!_0x13fa42['query']['hasOwnProperty'](_0x0c31('0x3b'))){_0x12b446['limit']=qs[_0x0c31('0x3c')](_0x13fa42['query'][_0x0c31('0x3c')]);_0x12b446[_0x0c31('0x27')]=qs[_0x0c31('0x27')](_0x13fa42[_0x0c31('0x33')][_0x0c31('0x27')]);}_0x12b446[_0x0c31('0x3d')]=qs[_0x0c31('0x3e')](_0x13fa42[_0x0c31('0x33')][_0x0c31('0x3e')]);_0x12b446[_0x0c31('0x3f')]=qs['filters'](_[_0x0c31('0x40')](_0x13fa42[_0x0c31('0x33')],_0x4a9bf6['filters']));if(_0x1a3df6[_0x0c31('0x41')]){if(_0x1a3df6['dateEnd']){_0x1a3df6['dateEnd']=moment(_0x1a3df6[_0x0c31('0x34')])[_0x0c31('0x42')](0x1,_0x0c31('0x43'));}else{_0x1a3df6[_0x0c31('0x34')]=moment(_0x1a3df6[_0x0c31('0x41')])['add'](0x1,_0x0c31('0x43'));}_[_0x0c31('0x44')](_0x12b446['where'],{'createdAt':{'$gte':_0x1a3df6[_0x0c31('0x41')],'$lte':_0x1a3df6['dateEnd']}});}if(_0x13fa42['query'][_0x0c31('0x45')]){_0x12b446[_0x0c31('0x3f')]=_[_0x0c31('0x44')](_0x12b446[_0x0c31('0x3f')],{'$or':_['map'](_0x12b446[_0x0c31('0x39')],function(_0x44b1b5){var _0x4b0db2={};_0x4b0db2[_0x44b1b5]={'$like':'%'+_0x13fa42[_0x0c31('0x33')][_0x0c31('0x45')]+'%'};return _0x4b0db2;})});}_0x12b446=_[_0x0c31('0x44')]({},_0x12b446,_0x13fa42[_0x0c31('0x46')]);var _0x2c7812={'where':_0x12b446['where']};return db[_0x0c31('0x31')]['count'](_0x2c7812)['then'](function(_0x2dc9ee){_0x53481a[_0x0c31('0x26')]=_0x2dc9ee;if(_0x13fa42[_0x0c31('0x33')][_0x0c31('0x47')]){_0x12b446[_0x0c31('0x48')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x0c31('0x49')](_0x12b446);})[_0x0c31('0x2c')](function(_0x5497a4){_0x53481a[_0x0c31('0x4a')]=_0x5497a4;return _0x53481a;})[_0x0c31('0x2c')](respondWithFilteredResult(_0x233d72,_0x12b446))[_0x0c31('0x21')](handleError(_0x233d72,null));};exports[_0x0c31('0x4b')]=function(_0x503216,_0x50b5c3){var _0x2f823d={'raw':![],'where':{'id':_0x503216[_0x0c31('0x4c')]['id']}},_0x5acd22={};_0x5acd22[_0x0c31('0x32')]=_['keys'](db[_0x0c31('0x31')][_0x0c31('0x4d')]);_0x5acd22[_0x0c31('0x33')]=_[_0x0c31('0x35')](_0x503216[_0x0c31('0x33')]);_0x5acd22[_0x0c31('0x36')]=_[_0x0c31('0x37')](_0x5acd22[_0x0c31('0x32')],_0x5acd22[_0x0c31('0x33')]);_0x2f823d[_0x0c31('0x39')]=_[_0x0c31('0x37')](_0x5acd22[_0x0c31('0x32')],qs[_0x0c31('0x38')](_0x503216[_0x0c31('0x33')]['fields']));_0x2f823d['attributes']=_0x2f823d['attributes']['length']?_0x2f823d[_0x0c31('0x39')]:_0x5acd22[_0x0c31('0x32')];if(_0x503216[_0x0c31('0x33')][_0x0c31('0x47')]){_0x2f823d['include']=[{'all':!![]}];}_0x2f823d=_[_0x0c31('0x44')]({},_0x2f823d,_0x503216[_0x0c31('0x46')]);return db[_0x0c31('0x31')][_0x0c31('0x4e')](_0x2f823d)['then'](handleEntityNotFound(_0x50b5c3,null))['then'](respondWithResult(_0x50b5c3,null))[_0x0c31('0x21')](handleError(_0x50b5c3,null));};exports[_0x0c31('0x4f')]=function(_0x29f839,_0x2db426){return db[_0x0c31('0x31')]['create'](_0x29f839[_0x0c31('0x50')],{})['then'](respondWithResult(_0x2db426,0xc9))['catch'](handleError(_0x2db426,null));};exports[_0x0c31('0x51')]=function(_0x5f07ab,_0x3caa1e){if(_0x5f07ab['body']['id']){delete _0x5f07ab['body']['id'];}return db[_0x0c31('0x31')][_0x0c31('0x4e')]({'where':{'id':_0x5f07ab['params']['id']}})[_0x0c31('0x2c')](handleEntityNotFound(_0x3caa1e,null))['then'](saveUpdates(_0x5f07ab[_0x0c31('0x50')],null))['then'](respondWithResult(_0x3caa1e,null))[_0x0c31('0x21')](handleError(_0x3caa1e,null));};exports[_0x0c31('0x2b')]=function(_0x361592,_0x4fe0af){return db['ZohoConfiguration'][_0x0c31('0x4e')]({'where':{'id':_0x361592[_0x0c31('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4fe0af,null))[_0x0c31('0x2c')](removeEntity(_0x4fe0af,null))[_0x0c31('0x21')](handleError(_0x4fe0af,null));};exports['getFields']=function(_0x39d7cc,_0x3198e0,_0x2cf274){var _0x460cb0={};var _0x1b1493={};var _0x123da8;var _0x38b57c;return db[_0x0c31('0x31')][_0x0c31('0x52')]({'where':{'id':_0x39d7cc['params']['id']}})[_0x0c31('0x2c')](handleEntityNotFound(_0x3198e0,null))[_0x0c31('0x2c')](function(_0x375f8a){if(_0x375f8a){_0x123da8=_0x375f8a;_0x1b1493[_0x0c31('0x32')]=_['keys'](db[_0x0c31('0x53')][_0x0c31('0x4d')]);_0x1b1493[_0x0c31('0x33')]=_[_0x0c31('0x35')](_0x39d7cc['query']);_0x1b1493[_0x0c31('0x36')]=_['intersection'](_0x1b1493[_0x0c31('0x32')],_0x1b1493['query']);_0x460cb0[_0x0c31('0x39')]=_[_0x0c31('0x37')](_0x1b1493[_0x0c31('0x32')],qs[_0x0c31('0x38')](_0x39d7cc[_0x0c31('0x33')][_0x0c31('0x38')]));_0x460cb0['attributes']=_0x460cb0[_0x0c31('0x39')][_0x0c31('0x3a')]?_0x460cb0[_0x0c31('0x39')]:_0x1b1493[_0x0c31('0x32')];_0x460cb0['order']=qs[_0x0c31('0x3e')](_0x39d7cc[_0x0c31('0x33')][_0x0c31('0x3e')]);_0x460cb0[_0x0c31('0x3f')]=qs[_0x0c31('0x36')](_[_0x0c31('0x40')](_0x39d7cc[_0x0c31('0x33')],_0x1b1493[_0x0c31('0x36')]));if(_0x39d7cc[_0x0c31('0x33')][_0x0c31('0x45')]){_0x460cb0[_0x0c31('0x3f')]=_[_0x0c31('0x44')](_0x460cb0['where'],{'$or':_[_0x0c31('0x54')](_0x460cb0[_0x0c31('0x39')],function(_0x535030){var _0x1e7966={};_0x1e7966[_0x535030]={'$like':'%'+_0x39d7cc[_0x0c31('0x33')][_0x0c31('0x45')]+'%'};return _0x1e7966;})});}_0x460cb0=_[_0x0c31('0x44')]({},_0x460cb0,_0x39d7cc[_0x0c31('0x46')]);return _0x123da8[_0x0c31('0x55')](_0x460cb0);}})[_0x0c31('0x2c')](function(_0x2f356a){if(_0x2f356a){_0x38b57c=_0x2f356a[_0x0c31('0x3a')];if(!_0x39d7cc['query'][_0x0c31('0x56')](_0x0c31('0x3b'))){_0x460cb0[_0x0c31('0x3c')]=qs[_0x0c31('0x3c')](_0x39d7cc[_0x0c31('0x33')][_0x0c31('0x3c')]);_0x460cb0[_0x0c31('0x27')]=qs[_0x0c31('0x27')](_0x39d7cc[_0x0c31('0x33')][_0x0c31('0x27')]);}return _0x123da8[_0x0c31('0x55')](_0x460cb0);}})[_0x0c31('0x2c')](function(_0x85b03f){if(_0x85b03f){return _0x85b03f?{'count':_0x38b57c,'rows':_0x85b03f}:null;}})[_0x0c31('0x2c')](respondWithResult(_0x3198e0,null))[_0x0c31('0x21')](handleError(_0x3198e0,null));};exports['getSubjects']=function(_0x530cc3,_0x4d7dc8,_0x332839){var _0x364e96={};var _0x18033c={};var _0xdd0cfc;var _0x345847;return db[_0x0c31('0x31')][_0x0c31('0x52')]({'where':{'id':_0x530cc3['params']['id']}})[_0x0c31('0x2c')](handleEntityNotFound(_0x4d7dc8,null))[_0x0c31('0x2c')](function(_0x1db418){if(_0x1db418){_0xdd0cfc=_0x1db418;_0x18033c['model']=_[_0x0c31('0x35')](db[_0x0c31('0x53')][_0x0c31('0x4d')]);_0x18033c[_0x0c31('0x33')]=_[_0x0c31('0x35')](_0x530cc3[_0x0c31('0x33')]);_0x18033c[_0x0c31('0x36')]=_[_0x0c31('0x37')](_0x18033c[_0x0c31('0x32')],_0x18033c[_0x0c31('0x33')]);_0x364e96[_0x0c31('0x39')]=_[_0x0c31('0x37')](_0x18033c['model'],qs[_0x0c31('0x38')](_0x530cc3[_0x0c31('0x33')][_0x0c31('0x38')]));_0x364e96[_0x0c31('0x39')]=_0x364e96[_0x0c31('0x39')][_0x0c31('0x3a')]?_0x364e96[_0x0c31('0x39')]:_0x18033c[_0x0c31('0x32')];_0x364e96[_0x0c31('0x3d')]=qs[_0x0c31('0x3e')](_0x530cc3['query'][_0x0c31('0x3e')]);_0x364e96['where']=qs[_0x0c31('0x36')](_[_0x0c31('0x40')](_0x530cc3[_0x0c31('0x33')],_0x18033c[_0x0c31('0x36')]));if(_0x530cc3['query']['filter']){_0x364e96[_0x0c31('0x3f')]=_[_0x0c31('0x44')](_0x364e96[_0x0c31('0x3f')],{'$or':_['map'](_0x364e96[_0x0c31('0x39')],function(_0x16270c){var _0x28f0cd={};_0x28f0cd[_0x16270c]={'$like':'%'+_0x530cc3[_0x0c31('0x33')][_0x0c31('0x45')]+'%'};return _0x28f0cd;})});}_0x364e96=_[_0x0c31('0x44')]({},_0x364e96,_0x530cc3[_0x0c31('0x46')]);return _0xdd0cfc[_0x0c31('0x57')](_0x364e96);}})[_0x0c31('0x2c')](function(_0x461dad){if(_0x461dad){_0x345847=_0x461dad[_0x0c31('0x3a')];if(!_0x530cc3[_0x0c31('0x33')][_0x0c31('0x56')](_0x0c31('0x3b'))){_0x364e96[_0x0c31('0x3c')]=qs['limit'](_0x530cc3[_0x0c31('0x33')]['limit']);_0x364e96[_0x0c31('0x27')]=qs[_0x0c31('0x27')](_0x530cc3[_0x0c31('0x33')]['offset']);}return _0xdd0cfc['getSubjects'](_0x364e96);}})['then'](function(_0x3440ec){if(_0x3440ec){return _0x3440ec?{'count':_0x345847,'rows':_0x3440ec}:null;}})[_0x0c31('0x2c')](respondWithResult(_0x4d7dc8,null))['catch'](handleError(_0x4d7dc8,null));};exports[_0x0c31('0x58')]=function(_0x26f750,_0x53a49e,_0x49c306){var _0x3aed97={};var _0x107a64={};var _0x5a6429;var _0x1f2c80;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x26f750[_0x0c31('0x4c')]['id']}})[_0x0c31('0x2c')](handleEntityNotFound(_0x53a49e,null))[_0x0c31('0x2c')](function(_0x4466fe){if(_0x4466fe){_0x5a6429=_0x4466fe;_0x107a64[_0x0c31('0x32')]=_[_0x0c31('0x35')](db[_0x0c31('0x53')]['rawAttributes']);_0x107a64['query']=_[_0x0c31('0x35')](_0x26f750[_0x0c31('0x33')]);_0x107a64[_0x0c31('0x36')]=_['intersection'](_0x107a64[_0x0c31('0x32')],_0x107a64['query']);_0x3aed97[_0x0c31('0x39')]=_['intersection'](_0x107a64[_0x0c31('0x32')],qs[_0x0c31('0x38')](_0x26f750[_0x0c31('0x33')]['fields']));_0x3aed97[_0x0c31('0x39')]=_0x3aed97['attributes'][_0x0c31('0x3a')]?_0x3aed97[_0x0c31('0x39')]:_0x107a64[_0x0c31('0x32')];_0x3aed97[_0x0c31('0x3d')]=qs[_0x0c31('0x3e')](_0x26f750['query']['sort']);_0x3aed97[_0x0c31('0x3f')]=qs[_0x0c31('0x36')](_['pick'](_0x26f750['query'],_0x107a64['filters']));if(_0x26f750[_0x0c31('0x33')]['filter']){_0x3aed97[_0x0c31('0x3f')]=_['merge'](_0x3aed97[_0x0c31('0x3f')],{'$or':_['map'](_0x3aed97['attributes'],function(_0x317e4a){var _0x1a2b46={};_0x1a2b46[_0x317e4a]={'$like':'%'+_0x26f750[_0x0c31('0x33')][_0x0c31('0x45')]+'%'};return _0x1a2b46;})});}_0x3aed97=_[_0x0c31('0x44')]({},_0x3aed97,_0x26f750[_0x0c31('0x46')]);return _0x5a6429['getDescriptions'](_0x3aed97);}})[_0x0c31('0x2c')](function(_0x4af65d){if(_0x4af65d){_0x1f2c80=_0x4af65d[_0x0c31('0x3a')];if(!_0x26f750[_0x0c31('0x33')]['hasOwnProperty'](_0x0c31('0x3b'))){_0x3aed97[_0x0c31('0x3c')]=qs[_0x0c31('0x3c')](_0x26f750['query'][_0x0c31('0x3c')]);_0x3aed97[_0x0c31('0x27')]=qs['offset'](_0x26f750[_0x0c31('0x33')][_0x0c31('0x27')]);}return _0x5a6429[_0x0c31('0x58')](_0x3aed97);}})[_0x0c31('0x2c')](function(_0x1b4b2d){if(_0x1b4b2d){return _0x1b4b2d?{'count':_0x1f2c80,'rows':_0x1b4b2d}:null;}})[_0x0c31('0x2c')](respondWithResult(_0x53a49e,null))['catch'](handleError(_0x53a49e,null));};
\ No newline at end of file
+var _0x9812=['querystring','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','send','index','rawAttributes','model','query','dateStart','dateEnd','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','add','day','merge','filter','map','options','ZohoConfiguration','include','rows','show','params','keys','length','includeAll','find','create','body','getFields','findOne','ZohoField','pick','nolimit','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','moment','bluebird','util','to-csv','squel','crypto','desk.js'];(function(_0x4e630a,_0x3c006b){var _0x2cc905=function(_0x2057e9){while(--_0x2057e9){_0x4e630a['push'](_0x4e630a['shift']());}};_0x2cc905(++_0x3c006b);}(_0x9812,0x195));var _0x2981=function(_0x3e7630,_0x438e9c){_0x3e7630=_0x3e7630-0x0;var _0x579024=_0x9812[_0x3e7630];return _0x579024;};'use strict';var pdf=require(_0x2981('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2981('0x1'));var zipdir=require(_0x2981('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2981('0x3'));var BPromise=require(_0x2981('0x4'));var Mustache=require('mustache');var util=require(_0x2981('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x2981('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2981('0x7'));var crypto=require(_0x2981('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x2981('0x9'));var toCsv=require(_0x2981('0x6'));var querystring=require(_0x2981('0xa'));var Papa=require('papaparse');var qs=require(_0x2981('0xb'));var logger=require('../../config/logger')(_0x2981('0xc'));var utils=require(_0x2981('0xd'));var config=require(_0x2981('0xe'));var db=require(_0x2981('0xf'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x2981('0x10')][_0x2981('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x346ab0,_0x51372c,_0x257413,_0x4ccf4d){return new BPromise(function(_0x4be0e8,_0x37c80a){var _0x2a4f00=_0x4ccf4d||client;return _0x2a4f00[_0x2981('0x12')](_0x346ab0,_0x257413)[_0x2981('0x13')](function(_0x41e1f5){logger['info'](_0x2981('0x14'),_0x51372c,_0x2981('0x15'));logger[_0x2981('0x16')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x51372c,'request\x20sent',JSON[_0x2981('0x17')](_0x41e1f5));if(_0x41e1f5[_0x2981('0x18')]){if(_0x41e1f5[_0x2981('0x18')][_0x2981('0x19')]===0x1f4){logger[_0x2981('0x18')](_0x2981('0x14'),_0x51372c,_0x41e1f5[_0x2981('0x18')][_0x2981('0x1a')]);return _0x37c80a(_0x41e1f5[_0x2981('0x18')]['message']);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x51372c,_0x41e1f5[_0x2981('0x18')][_0x2981('0x1a')]);return _0x4be0e8(_0x41e1f5[_0x2981('0x18')][_0x2981('0x1a')]);}else{logger[_0x2981('0x1b')](_0x2981('0x14'),_0x51372c,_0x2981('0x15'));_0x4be0e8(_0x41e1f5['result'][_0x2981('0x1a')]);}})[_0x2981('0x1c')](function(_0x466a7c){logger[_0x2981('0x18')]('ZohoConfiguration,\x20%s,\x20%s',_0x51372c,_0x466a7c);_0x37c80a(_0x466a7c);});});}function respondWithStatusCode(_0x441370,_0x49cb33){_0x49cb33=_0x49cb33||0xcc;return function(_0x2dbea1){if(_0x2dbea1){return _0x441370[_0x2981('0x1d')](_0x49cb33);}return _0x441370[_0x2981('0x1e')](_0x49cb33)[_0x2981('0x1f')]();};}function respondWithResult(_0x3111d1,_0x2eefb4){_0x2eefb4=_0x2eefb4||0xc8;return function(_0x276c9f){if(_0x276c9f){return _0x3111d1['status'](_0x2eefb4)[_0x2981('0x20')](_0x276c9f);}};}function respondWithFilteredResult(_0xe110cc,_0x1b121c){return function(_0x51516d){if(_0x51516d){var _0x10f7ec=_0x51516d[_0x2981('0x21')],_0x34b0ad=_0x1b121c['offset'],_0x227fae=_0x1b121c[_0x2981('0x22')]+_0x1b121c[_0x2981('0x23')],_0x23eca3;if(_0x227fae>=_0x10f7ec){_0x227fae=_0x10f7ec;_0x23eca3=0xc8;}else{_0x23eca3=0xce;}_0xe110cc['status'](_0x23eca3);return _0xe110cc[_0x2981('0x24')](_0x2981('0x25'),_0x34b0ad+'-'+_0x227fae+'/'+_0x10f7ec)[_0x2981('0x20')](_0x51516d);}return null;};}function patchUpdates(_0x1c952c){return function(_0x2e2659){try{jsonpatch[_0x2981('0x26')](_0x2e2659,_0x1c952c,!![]);}catch(_0x2632c2){return BPromise[_0x2981('0x27')](_0x2632c2);}return _0x2e2659[_0x2981('0x28')]();};}function saveUpdates(_0xf0dea2,_0x39a9bc){return function(_0x1e6ff0){if(_0x1e6ff0){return _0x1e6ff0[_0x2981('0x29')](_0xf0dea2)[_0x2981('0x13')](function(_0xb71dbd){return _0xb71dbd;});}return null;};}function removeEntity(_0x34b9e1,_0x4d3309){return function(_0x1b6a49){if(_0x1b6a49){return _0x1b6a49[_0x2981('0x2a')]()['then'](function(){_0x34b9e1[_0x2981('0x1e')](0xcc)[_0x2981('0x1f')]();});}};}function handleEntityNotFound(_0x405333,_0x1df2b7){return function(_0x2bd7ba){if(!_0x2bd7ba){_0x405333[_0x2981('0x1d')](0x194);}return _0x2bd7ba;};}function handleError(_0xfa54d5,_0x3129a9){_0x3129a9=_0x3129a9||0x1f4;return function(_0x586186){logger[_0x2981('0x18')](_0x586186[_0x2981('0x2b')]);if(_0x586186['name']){delete _0x586186['name'];}_0xfa54d5[_0x2981('0x1e')](_0x3129a9)[_0x2981('0x2c')](_0x586186);};}exports[_0x2981('0x2d')]=function(_0x580c47,_0x1a8d38){var _0x27cbcf={},_0x26d46c={},_0x54b0df={'count':0x0,'rows':[]};var _0x81c064=db['ZohoConfiguration'][_0x2981('0x2e')];_0x26d46c[_0x2981('0x2f')]=_['keys'](_0x81c064);var _0x12e209={'dateStart':_0x580c47['query']['dateStart'],'dateEnd':_0x580c47[_0x2981('0x30')]['dateEnd']};delete _0x580c47['query'][_0x2981('0x31')];delete _0x580c47[_0x2981('0x30')][_0x2981('0x32')];_0x26d46c[_0x2981('0x30')]=_['keys'](_0x580c47[_0x2981('0x30')]);_0x26d46c[_0x2981('0x33')]=_[_0x2981('0x34')](_0x26d46c['model'],_0x26d46c[_0x2981('0x30')]);_0x27cbcf[_0x2981('0x35')]=_[_0x2981('0x34')](_0x26d46c['model'],qs['fields'](_0x580c47[_0x2981('0x30')][_0x2981('0x36')]));_0x27cbcf['attributes']=_0x27cbcf[_0x2981('0x35')]['length']?_0x27cbcf['attributes']:_0x26d46c[_0x2981('0x2f')];if(!_0x580c47[_0x2981('0x30')][_0x2981('0x37')]('nolimit')){_0x27cbcf[_0x2981('0x23')]=qs['limit'](_0x580c47['query'][_0x2981('0x23')]);_0x27cbcf['offset']=qs[_0x2981('0x22')](_0x580c47[_0x2981('0x30')][_0x2981('0x22')]);}_0x27cbcf[_0x2981('0x38')]=qs[_0x2981('0x39')](_0x580c47[_0x2981('0x30')][_0x2981('0x39')]);_0x27cbcf[_0x2981('0x3a')]=qs[_0x2981('0x33')](_['pick'](_0x580c47[_0x2981('0x30')],_0x26d46c[_0x2981('0x33')]));if(_0x12e209[_0x2981('0x31')]){if(_0x12e209[_0x2981('0x32')]){_0x12e209[_0x2981('0x32')]=moment(_0x12e209['dateEnd'])[_0x2981('0x3b')](0x1,_0x2981('0x3c'));}else{_0x12e209[_0x2981('0x32')]=moment(_0x12e209[_0x2981('0x31')])['add'](0x1,_0x2981('0x3c'));}_[_0x2981('0x3d')](_0x27cbcf[_0x2981('0x3a')],{'createdAt':{'$gte':_0x12e209[_0x2981('0x31')],'$lte':_0x12e209[_0x2981('0x32')]}});}if(_0x580c47[_0x2981('0x30')][_0x2981('0x3e')]){_0x27cbcf[_0x2981('0x3a')]=_[_0x2981('0x3d')](_0x27cbcf[_0x2981('0x3a')],{'$or':_[_0x2981('0x3f')](_0x27cbcf['attributes'],function(_0x59cb18){var _0x2519e5={};_0x2519e5[_0x59cb18]={'$like':'%'+_0x580c47[_0x2981('0x30')][_0x2981('0x3e')]+'%'};return _0x2519e5;})});}_0x27cbcf=_[_0x2981('0x3d')]({},_0x27cbcf,_0x580c47[_0x2981('0x40')]);var _0x5334a7={'where':_0x27cbcf[_0x2981('0x3a')]};return db[_0x2981('0x41')][_0x2981('0x21')](_0x5334a7)['then'](function(_0x1dc23d){_0x54b0df['count']=_0x1dc23d;if(_0x580c47[_0x2981('0x30')]['includeAll']){_0x27cbcf[_0x2981('0x42')]=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0x27cbcf);})[_0x2981('0x13')](function(_0x5f5917){_0x54b0df[_0x2981('0x43')]=_0x5f5917;return _0x54b0df;})['then'](respondWithFilteredResult(_0x1a8d38,_0x27cbcf))['catch'](handleError(_0x1a8d38,null));};exports[_0x2981('0x44')]=function(_0x368490,_0x2bf3fb){var _0x478674={'raw':![],'where':{'id':_0x368490[_0x2981('0x45')]['id']}},_0x3e6b29={};_0x3e6b29[_0x2981('0x2f')]=_[_0x2981('0x46')](db[_0x2981('0x41')]['rawAttributes']);_0x3e6b29['query']=_['keys'](_0x368490[_0x2981('0x30')]);_0x3e6b29[_0x2981('0x33')]=_[_0x2981('0x34')](_0x3e6b29[_0x2981('0x2f')],_0x3e6b29[_0x2981('0x30')]);_0x478674[_0x2981('0x35')]=_['intersection'](_0x3e6b29['model'],qs[_0x2981('0x36')](_0x368490['query'][_0x2981('0x36')]));_0x478674[_0x2981('0x35')]=_0x478674[_0x2981('0x35')][_0x2981('0x47')]?_0x478674[_0x2981('0x35')]:_0x3e6b29[_0x2981('0x2f')];if(_0x368490[_0x2981('0x30')][_0x2981('0x48')]){_0x478674[_0x2981('0x42')]=[{'all':!![]}];}_0x478674=_['merge']({},_0x478674,_0x368490[_0x2981('0x40')]);return db[_0x2981('0x41')][_0x2981('0x49')](_0x478674)[_0x2981('0x13')](handleEntityNotFound(_0x2bf3fb,null))[_0x2981('0x13')](respondWithResult(_0x2bf3fb,null))['catch'](handleError(_0x2bf3fb,null));};exports['create']=function(_0x5c463e,_0x4ae171){return db[_0x2981('0x41')][_0x2981('0x4a')](_0x5c463e[_0x2981('0x4b')],{})[_0x2981('0x13')](respondWithResult(_0x4ae171,0xc9))[_0x2981('0x1c')](handleError(_0x4ae171,null));};exports[_0x2981('0x29')]=function(_0x206b6e,_0x50ece9){if(_0x206b6e[_0x2981('0x4b')]['id']){delete _0x206b6e['body']['id'];}return db[_0x2981('0x41')][_0x2981('0x49')]({'where':{'id':_0x206b6e[_0x2981('0x45')]['id']}})[_0x2981('0x13')](handleEntityNotFound(_0x50ece9,null))[_0x2981('0x13')](saveUpdates(_0x206b6e['body'],null))[_0x2981('0x13')](respondWithResult(_0x50ece9,null))['catch'](handleError(_0x50ece9,null));};exports[_0x2981('0x2a')]=function(_0x2304d4,_0x4c5215){return db[_0x2981('0x41')][_0x2981('0x49')]({'where':{'id':_0x2304d4['params']['id']}})[_0x2981('0x13')](handleEntityNotFound(_0x4c5215,null))[_0x2981('0x13')](removeEntity(_0x4c5215,null))['catch'](handleError(_0x4c5215,null));};exports[_0x2981('0x4c')]=function(_0x3df529,_0x2277df,_0x4a2966){var _0x32dfa0={};var _0x4bf23e={};var _0x25619e;var _0x1bc104;return db[_0x2981('0x41')][_0x2981('0x4d')]({'where':{'id':_0x3df529[_0x2981('0x45')]['id']}})[_0x2981('0x13')](handleEntityNotFound(_0x2277df,null))['then'](function(_0x5c1872){if(_0x5c1872){_0x25619e=_0x5c1872;_0x4bf23e['model']=_[_0x2981('0x46')](db[_0x2981('0x4e')][_0x2981('0x2e')]);_0x4bf23e[_0x2981('0x30')]=_[_0x2981('0x46')](_0x3df529['query']);_0x4bf23e[_0x2981('0x33')]=_[_0x2981('0x34')](_0x4bf23e[_0x2981('0x2f')],_0x4bf23e[_0x2981('0x30')]);_0x32dfa0[_0x2981('0x35')]=_[_0x2981('0x34')](_0x4bf23e['model'],qs[_0x2981('0x36')](_0x3df529[_0x2981('0x30')][_0x2981('0x36')]));_0x32dfa0[_0x2981('0x35')]=_0x32dfa0['attributes']['length']?_0x32dfa0[_0x2981('0x35')]:_0x4bf23e[_0x2981('0x2f')];_0x32dfa0['order']=qs[_0x2981('0x39')](_0x3df529[_0x2981('0x30')][_0x2981('0x39')]);_0x32dfa0[_0x2981('0x3a')]=qs[_0x2981('0x33')](_[_0x2981('0x4f')](_0x3df529['query'],_0x4bf23e['filters']));if(_0x3df529[_0x2981('0x30')][_0x2981('0x3e')]){_0x32dfa0[_0x2981('0x3a')]=_[_0x2981('0x3d')](_0x32dfa0[_0x2981('0x3a')],{'$or':_[_0x2981('0x3f')](_0x32dfa0['attributes'],function(_0x19ed50){var _0x25fbcc={};_0x25fbcc[_0x19ed50]={'$like':'%'+_0x3df529[_0x2981('0x30')][_0x2981('0x3e')]+'%'};return _0x25fbcc;})});}_0x32dfa0=_[_0x2981('0x3d')]({},_0x32dfa0,_0x3df529[_0x2981('0x40')]);return _0x25619e[_0x2981('0x4c')](_0x32dfa0);}})[_0x2981('0x13')](function(_0x90be60){if(_0x90be60){_0x1bc104=_0x90be60[_0x2981('0x47')];if(!_0x3df529[_0x2981('0x30')][_0x2981('0x37')](_0x2981('0x50'))){_0x32dfa0[_0x2981('0x23')]=qs[_0x2981('0x23')](_0x3df529[_0x2981('0x30')][_0x2981('0x23')]);_0x32dfa0[_0x2981('0x22')]=qs[_0x2981('0x22')](_0x3df529[_0x2981('0x30')][_0x2981('0x22')]);}return _0x25619e['getFields'](_0x32dfa0);}})['then'](function(_0x152500){if(_0x152500){return _0x152500?{'count':_0x1bc104,'rows':_0x152500}:null;}})[_0x2981('0x13')](respondWithResult(_0x2277df,null))[_0x2981('0x1c')](handleError(_0x2277df,null));};exports['getSubjects']=function(_0x778a31,_0x5c892f,_0x55de58){var _0x2ece9c={};var _0x1f350f={};var _0x34b835;var _0x486891;return db[_0x2981('0x41')][_0x2981('0x4d')]({'where':{'id':_0x778a31[_0x2981('0x45')]['id']}})[_0x2981('0x13')](handleEntityNotFound(_0x5c892f,null))[_0x2981('0x13')](function(_0x258ced){if(_0x258ced){_0x34b835=_0x258ced;_0x1f350f[_0x2981('0x2f')]=_[_0x2981('0x46')](db[_0x2981('0x4e')][_0x2981('0x2e')]);_0x1f350f[_0x2981('0x30')]=_[_0x2981('0x46')](_0x778a31['query']);_0x1f350f[_0x2981('0x33')]=_[_0x2981('0x34')](_0x1f350f[_0x2981('0x2f')],_0x1f350f['query']);_0x2ece9c['attributes']=_[_0x2981('0x34')](_0x1f350f[_0x2981('0x2f')],qs['fields'](_0x778a31[_0x2981('0x30')][_0x2981('0x36')]));_0x2ece9c[_0x2981('0x35')]=_0x2ece9c[_0x2981('0x35')]['length']?_0x2ece9c[_0x2981('0x35')]:_0x1f350f[_0x2981('0x2f')];_0x2ece9c['order']=qs['sort'](_0x778a31[_0x2981('0x30')]['sort']);_0x2ece9c[_0x2981('0x3a')]=qs[_0x2981('0x33')](_[_0x2981('0x4f')](_0x778a31[_0x2981('0x30')],_0x1f350f[_0x2981('0x33')]));if(_0x778a31[_0x2981('0x30')][_0x2981('0x3e')]){_0x2ece9c[_0x2981('0x3a')]=_[_0x2981('0x3d')](_0x2ece9c[_0x2981('0x3a')],{'$or':_['map'](_0x2ece9c[_0x2981('0x35')],function(_0x4e3de4){var _0x4f1325={};_0x4f1325[_0x4e3de4]={'$like':'%'+_0x778a31[_0x2981('0x30')][_0x2981('0x3e')]+'%'};return _0x4f1325;})});}_0x2ece9c=_['merge']({},_0x2ece9c,_0x778a31[_0x2981('0x40')]);return _0x34b835[_0x2981('0x51')](_0x2ece9c);}})[_0x2981('0x13')](function(_0x42762b){if(_0x42762b){_0x486891=_0x42762b[_0x2981('0x47')];if(!_0x778a31[_0x2981('0x30')][_0x2981('0x37')]('nolimit')){_0x2ece9c[_0x2981('0x23')]=qs['limit'](_0x778a31['query'][_0x2981('0x23')]);_0x2ece9c[_0x2981('0x22')]=qs[_0x2981('0x22')](_0x778a31[_0x2981('0x30')]['offset']);}return _0x34b835[_0x2981('0x51')](_0x2ece9c);}})[_0x2981('0x13')](function(_0x4262e0){if(_0x4262e0){return _0x4262e0?{'count':_0x486891,'rows':_0x4262e0}:null;}})[_0x2981('0x13')](respondWithResult(_0x5c892f,null))[_0x2981('0x1c')](handleError(_0x5c892f,null));};exports[_0x2981('0x52')]=function(_0x50f8b6,_0x3edc84,_0x1445fa){var _0x506347={};var _0x15fe84={};var _0x55cd02;var _0x4a12df;return db[_0x2981('0x41')][_0x2981('0x4d')]({'where':{'id':_0x50f8b6[_0x2981('0x45')]['id']}})[_0x2981('0x13')](handleEntityNotFound(_0x3edc84,null))['then'](function(_0x15f41b){if(_0x15f41b){_0x55cd02=_0x15f41b;_0x15fe84[_0x2981('0x2f')]=_[_0x2981('0x46')](db['ZohoField'][_0x2981('0x2e')]);_0x15fe84[_0x2981('0x30')]=_[_0x2981('0x46')](_0x50f8b6[_0x2981('0x30')]);_0x15fe84[_0x2981('0x33')]=_[_0x2981('0x34')](_0x15fe84[_0x2981('0x2f')],_0x15fe84[_0x2981('0x30')]);_0x506347[_0x2981('0x35')]=_[_0x2981('0x34')](_0x15fe84[_0x2981('0x2f')],qs[_0x2981('0x36')](_0x50f8b6[_0x2981('0x30')][_0x2981('0x36')]));_0x506347[_0x2981('0x35')]=_0x506347[_0x2981('0x35')][_0x2981('0x47')]?_0x506347[_0x2981('0x35')]:_0x15fe84[_0x2981('0x2f')];_0x506347[_0x2981('0x38')]=qs[_0x2981('0x39')](_0x50f8b6[_0x2981('0x30')]['sort']);_0x506347[_0x2981('0x3a')]=qs[_0x2981('0x33')](_[_0x2981('0x4f')](_0x50f8b6[_0x2981('0x30')],_0x15fe84[_0x2981('0x33')]));if(_0x50f8b6[_0x2981('0x30')]['filter']){_0x506347['where']=_[_0x2981('0x3d')](_0x506347[_0x2981('0x3a')],{'$or':_[_0x2981('0x3f')](_0x506347['attributes'],function(_0x51ee36){var _0x32a223={};_0x32a223[_0x51ee36]={'$like':'%'+_0x50f8b6[_0x2981('0x30')][_0x2981('0x3e')]+'%'};return _0x32a223;})});}_0x506347=_[_0x2981('0x3d')]({},_0x506347,_0x50f8b6['options']);return _0x55cd02[_0x2981('0x52')](_0x506347);}})['then'](function(_0x5e10d4){if(_0x5e10d4){_0x4a12df=_0x5e10d4[_0x2981('0x47')];if(!_0x50f8b6[_0x2981('0x30')][_0x2981('0x37')]('nolimit')){_0x506347[_0x2981('0x23')]=qs['limit'](_0x50f8b6[_0x2981('0x30')]['limit']);_0x506347[_0x2981('0x22')]=qs[_0x2981('0x22')](_0x50f8b6[_0x2981('0x30')]['offset']);}return _0x55cd02[_0x2981('0x52')](_0x506347);}})[_0x2981('0x13')](function(_0x8f940){if(_0x8f940){return _0x8f940?{'count':_0x4a12df,'rows':_0x8f940}:null;}})[_0x2981('0x13')](respondWithResult(_0x3edc84,null))[_0x2981('0x1c')](handleError(_0x3edc84,null));};
\ No newline at end of file
index acd1f9f..68b62a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c64=['../../config/logger','api','moment','bluebird','request-promise','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','util'];(function(_0x4650a5,_0x47b2e5){var _0x32f3e0=function(_0x34d5e6){while(--_0x34d5e6){_0x4650a5['push'](_0x4650a5['shift']());}};_0x32f3e0(++_0x47b2e5);}(_0x9c64,0x16a));var _0x49c6=function(_0x39cf95,_0x37d3b1){_0x39cf95=_0x39cf95-0x0;var _0x5c33a2=_0x9c64[_0x39cf95];return _0x5c33a2;};'use strict';var _=require('lodash');var util=require(_0x49c6('0x0'));var logger=require(_0x49c6('0x1'))(_0x49c6('0x2'));var moment=require(_0x49c6('0x3'));var BPromise=require(_0x49c6('0x4'));var rp=require(_0x49c6('0x5'));var attributes=require(_0x49c6('0x6'));module[_0x49c6('0x7')]=function(_0x90d380,_0x3a393a){return _0x90d380[_0x49c6('0x8')](_0x49c6('0x9'),attributes,{'tableName':_0x49c6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x03ce=['api','bluebird','request-promise','./intZohoConfiguration.attributes','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger'];(function(_0x58fade,_0xdf8458){var _0x2546c0=function(_0x475cc7){while(--_0x475cc7){_0x58fade['push'](_0x58fade['shift']());}};_0x2546c0(++_0xdf8458);}(_0x03ce,0x1a1));var _0xe03c=function(_0x48f075,_0x16c996){_0x48f075=_0x48f075-0x0;var _0x3b8285=_0x03ce[_0x48f075];return _0x3b8285;};'use strict';var _=require(_0xe03c('0x0'));var util=require(_0xe03c('0x1'));var logger=require(_0xe03c('0x2'))(_0xe03c('0x3'));var moment=require('moment');var BPromise=require(_0xe03c('0x4'));var rp=require(_0xe03c('0x5'));var attributes=require(_0xe03c('0x6'));module['exports']=function(_0x317708,_0x1917e3){return _0x317708[_0xe03c('0x7')](_0xe03c('0x8'),attributes,{'tableName':_0xe03c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 11d32a4..63f760c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['client','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x484819,_0x552f91){var _0x2bc37e=function(_0x3c9142){while(--_0x3c9142){_0x484819['push'](_0x484819['shift']());}};_0x2bc37e(++_0x552f91);}(_0x0b0e,0x187));var _0xe0b0=function(_0x173113,_0x316a7c){_0x173113=_0x173113-0x0;var _0x3bea89=_0x0b0e[_0x173113];return _0x3bea89;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var db=require(_0xe0b0('0x3'))['db'];var utils=require(_0xe0b0('0x4'));var logger=require(_0xe0b0('0x5'))(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var jayson=require(_0xe0b0('0x8'));var client=jayson[_0xe0b0('0x9')][_0xe0b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28e40f,_0x219b1c,_0x5cf9cc){return new BPromise(function(_0x50be7f,_0x11effc){return client[_0xe0b0('0xb')](_0x28e40f,_0x5cf9cc)[_0xe0b0('0xc')](function(_0x2ac27e){logger['info'](_0xe0b0('0xd'),_0x219b1c,_0xe0b0('0xe'));logger['debug'](_0xe0b0('0xf'),_0x219b1c,_0xe0b0('0xe'),JSON['stringify'](_0x2ac27e));if(_0x2ac27e[_0xe0b0('0x10')]){if(_0x2ac27e[_0xe0b0('0x10')][_0xe0b0('0x11')]===0x1f4){logger['error'](_0xe0b0('0xd'),_0x219b1c,_0x2ac27e[_0xe0b0('0x10')][_0xe0b0('0x12')]);return _0x11effc(_0x2ac27e[_0xe0b0('0x10')][_0xe0b0('0x12')]);}logger['error'](_0xe0b0('0xd'),_0x219b1c,_0x2ac27e[_0xe0b0('0x10')][_0xe0b0('0x12')]);return _0x50be7f(_0x2ac27e[_0xe0b0('0x10')][_0xe0b0('0x12')]);}else{logger['info'](_0xe0b0('0xd'),_0x219b1c,'request\x20sent');_0x50be7f(_0x2ac27e[_0xe0b0('0x13')][_0xe0b0('0x12')]);}})['catch'](function(_0x11fdca){logger['error'](_0xe0b0('0xd'),_0x219b1c,_0x11fdca);_0x11effc(_0x11fdca);});});}
\ No newline at end of file
+var _0xadb5=['client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x4cb296,_0x36f4f8){var _0x2c7a83=function(_0x2a5c57){while(--_0x2a5c57){_0x4cb296['push'](_0x4cb296['shift']());}};_0x2c7a83(++_0x36f4f8);}(_0xadb5,0xad));var _0x5adb=function(_0x3612f8,_0x44b19a){_0x3612f8=_0x3612f8-0x0;var _0x347d6b=_0xadb5[_0x3612f8];return _0x347d6b;};'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 db=require(_0x5adb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5adb('0x4'))(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5adb('0x7')][_0x5adb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e2555,_0x3213e8,_0xdf3776){return new BPromise(function(_0x353885,_0x47228a){return client[_0x5adb('0x9')](_0x3e2555,_0xdf3776)[_0x5adb('0xa')](function(_0x7293ab){logger[_0x5adb('0xb')](_0x5adb('0xc'),_0x3213e8,_0x5adb('0xd'));logger[_0x5adb('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3213e8,'request\x20sent',JSON[_0x5adb('0xf')](_0x7293ab));if(_0x7293ab[_0x5adb('0x10')]){if(_0x7293ab[_0x5adb('0x10')]['code']===0x1f4){logger[_0x5adb('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x3213e8,_0x7293ab[_0x5adb('0x10')]['message']);return _0x47228a(_0x7293ab[_0x5adb('0x10')][_0x5adb('0x11')]);}logger[_0x5adb('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x3213e8,_0x7293ab[_0x5adb('0x10')][_0x5adb('0x11')]);return _0x353885(_0x7293ab[_0x5adb('0x10')]['message']);}else{logger[_0x5adb('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x3213e8,_0x5adb('0xd'));_0x353885(_0x7293ab[_0x5adb('0x12')][_0x5adb('0x11')]);}})[_0x5adb('0x13')](function(_0x1c0f97){logger[_0x5adb('0x10')](_0x5adb('0xc'),_0x3213e8,_0x1c0f97);_0x47228a(_0x1c0f97);});});}
\ No newline at end of file
index 031d3c5..910d0ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3a3=['update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index','get','/:id','show','post','put'];(function(_0x1a0682,_0x51f081){var _0x20d741=function(_0x41398c){while(--_0x41398c){_0x1a0682['push'](_0x1a0682['shift']());}};_0x20d741(++_0x51f081);}(_0xf3a3,0x10e));var _0x3f3a=function(_0x23bf22,_0x2f662a){_0x23bf22=_0x23bf22-0x0;var _0x48e994=_0xf3a3[_0x23bf22];return _0x48e994;};'use strict';var multer=require(_0x3f3a('0x0'));var util=require(_0x3f3a('0x1'));var path=require('path');var express=require(_0x3f3a('0x2'));var router=express[_0x3f3a('0x3')]();var auth=require(_0x3f3a('0x4'));var interaction=require(_0x3f3a('0x5'));var config=require(_0x3f3a('0x6'));var controller=require(_0x3f3a('0x7'));router['get']('/',auth[_0x3f3a('0x8')](),controller[_0x3f3a('0x9')]);router[_0x3f3a('0xa')](_0x3f3a('0xb'),auth['isAuthenticated'](),controller[_0x3f3a('0xc')]);router[_0x3f3a('0xd')]('/',auth[_0x3f3a('0x8')](),controller['create']);router[_0x3f3a('0xe')](_0x3f3a('0xb'),auth['isAuthenticated'](),controller[_0x3f3a('0xf')]);router[_0x3f3a('0x10')](_0x3f3a('0xb'),auth[_0x3f3a('0x8')](),controller[_0x3f3a('0x11')]);module[_0x3f3a('0x12')]=router;
\ No newline at end of file
+var _0x82e1=['show','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x159f35,_0x3c0073){var _0x252778=function(_0x14aead){while(--_0x14aead){_0x159f35['push'](_0x159f35['shift']());}};_0x252778(++_0x3c0073);}(_0x82e1,0x15d));var _0x182e=function(_0x424bd3,_0x8760d8){_0x424bd3=_0x424bd3-0x0;var _0x1fdade=_0x82e1[_0x424bd3];return _0x1fdade;};'use strict';var multer=require(_0x182e('0x0'));var util=require(_0x182e('0x1'));var path=require(_0x182e('0x2'));var express=require(_0x182e('0x3'));var router=express[_0x182e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x182e('0x5'));var config=require(_0x182e('0x6'));var controller=require('./intZohoField.controller');router['get']('/',auth[_0x182e('0x7')](),controller[_0x182e('0x8')]);router[_0x182e('0x9')](_0x182e('0xa'),auth[_0x182e('0x7')](),controller[_0x182e('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x182e('0xc')]);router[_0x182e('0xd')](_0x182e('0xa'),auth[_0x182e('0x7')](),controller[_0x182e('0xe')]);router[_0x182e('0xf')](_0x182e('0xa'),auth[_0x182e('0x7')](),controller[_0x182e('0x10')]);module[_0x182e('0x11')]=router;
\ No newline at end of file
index 6c8c725..48c8f5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e6c=['variable','STRING','BOOLEAN','sequelize','exports','string'];(function(_0x3a1054,_0x2f6513){var _0x14c102=function(_0x5eb222){while(--_0x5eb222){_0x3a1054['push'](_0x3a1054['shift']());}};_0x14c102(++_0x2f6513);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]={'type':{'type':Sequelize['ENUM'](_0xc6e6('0x2'),_0xc6e6('0x3'),'customVariable','keyValue'),'defaultValue':_0xc6e6('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc6e6('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xc6e6('0x2'),_0xc6e6('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xc6e6('0x4')]},'idField':{'type':Sequelize[_0xc6e6('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc6e6('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc6e6('0x4')]}};
\ No newline at end of file
+var _0xec56=['customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize','string','variable'];(function(_0x3ab021,_0x44a9a6){var _0x3a3b3f=function(_0x588993){while(--_0x588993){_0x3ab021['push'](_0x3ab021['shift']());}};_0x3a3b3f(++_0x44a9a6);}(_0xec56,0x1bd));var _0x6ec5=function(_0x1738be,_0x3f5743){_0x1738be=_0x1738be-0x0;var _0x329c6f=_0xec56[_0x1738be];return _0x329c6f;};'use strict';var Sequelize=require(_0x6ec5('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x6ec5('0x1'),_0x6ec5('0x2'),_0x6ec5('0x3'),_0x6ec5('0x4')),'defaultValue':_0x6ec5('0x1')},'content':{'type':Sequelize[_0x6ec5('0x5')]},'key':{'type':Sequelize[_0x6ec5('0x5')]},'keyType':{'type':Sequelize[_0x6ec5('0x6')](_0x6ec5('0x1'),_0x6ec5('0x2'),_0x6ec5('0x3'))},'keyContent':{'type':Sequelize[_0x6ec5('0x5')]},'idField':{'type':Sequelize[_0x6ec5('0x5')]},'nameField':{'type':Sequelize[_0x6ec5('0x5')]},'customField':{'type':Sequelize[_0x6ec5('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6ec5('0x5')]}};
\ No newline at end of file
index 15514de..2e8328b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x682e=['model','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','add','day','merge','map','filter','options','includeAll','rows','catch','show','params','rawAttributes','length','include','find','create','ZohoField','update','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','set','Content-Range','save','then','destroy','stack','name','send','keys','dateStart','dateEnd','query','filters','intersection'];(function(_0x2189ba,_0x4e74f7){var _0x18d3ae=function(_0x19d088){while(--_0x19d088){_0x2189ba['push'](_0x2189ba['shift']());}};_0x18d3ae(++_0x4e74f7);}(_0x682e,0x1ce));var _0xe682=function(_0x55d968,_0x9c74e6){_0x55d968=_0x55d968-0x0;var _0x2599bf=_0x682e[_0x55d968];return _0x2599bf;};'use strict';var pdf=require(_0xe682('0x0'));var emlformat=require(_0xe682('0x1'));var rimraf=require(_0xe682('0x2'));var zipdir=require(_0xe682('0x3'));var jsonpatch=require(_0xe682('0x4'));var rp=require(_0xe682('0x5'));var moment=require('moment');var BPromise=require(_0xe682('0x6'));var Mustache=require(_0xe682('0x7'));var util=require(_0xe682('0x8'));var path=require(_0xe682('0x9'));var sox=require(_0xe682('0xa'));var csv=require(_0xe682('0xb'));var ejs=require(_0xe682('0xc'));var fs=require('fs');var _=require(_0xe682('0xd'));var squel=require(_0xe682('0xe'));var crypto=require(_0xe682('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xe682('0x10'));var toCsv=require(_0xe682('0xb'));var querystring=require(_0xe682('0x11'));var Papa=require(_0xe682('0x12'));var qs=require(_0xe682('0x13'));var logger=require(_0xe682('0x14'))('api');var utils=require(_0xe682('0x15'));var config=require('../../config/environment');var db=require(_0xe682('0x16'))['db'];function respondWithStatusCode(_0x569605,_0x493a34){_0x493a34=_0x493a34||0xcc;return function(_0x36d739){if(_0x36d739){return _0x569605[_0xe682('0x17')](_0x493a34);}return _0x569605[_0xe682('0x18')](_0x493a34)[_0xe682('0x19')]();};}function respondWithResult(_0x9d0c78,_0x27ead7){_0x27ead7=_0x27ead7||0xc8;return function(_0x55d7ee){if(_0x55d7ee){return _0x9d0c78[_0xe682('0x18')](_0x27ead7)[_0xe682('0x1a')](_0x55d7ee);}};}function respondWithFilteredResult(_0x1e4755,_0x32b45a){return function(_0x29ec5a){if(_0x29ec5a){var _0x2ee33f=_0x29ec5a[_0xe682('0x1b')],_0x3481a9=_0x32b45a['offset'],_0x30da5d=_0x32b45a['offset']+_0x32b45a['limit'],_0x5940b8;if(_0x30da5d>=_0x2ee33f){_0x30da5d=_0x2ee33f;_0x5940b8=0xc8;}else{_0x5940b8=0xce;}_0x1e4755[_0xe682('0x18')](_0x5940b8);return _0x1e4755[_0xe682('0x1c')](_0xe682('0x1d'),_0x3481a9+'-'+_0x30da5d+'/'+_0x2ee33f)[_0xe682('0x1a')](_0x29ec5a);}return null;};}function patchUpdates(_0x51166c){return function(_0x189331){try{jsonpatch['apply'](_0x189331,_0x51166c,!![]);}catch(_0x2dcfdd){return BPromise['reject'](_0x2dcfdd);}return _0x189331[_0xe682('0x1e')]();};}function saveUpdates(_0x5a2b51,_0x31d8e4){return function(_0x5b27f6){if(_0x5b27f6){return _0x5b27f6['update'](_0x5a2b51)[_0xe682('0x1f')](function(_0x5ebf37){return _0x5ebf37;});}return null;};}function removeEntity(_0x36c7e0,_0x368349){return function(_0x3c8f12){if(_0x3c8f12){return _0x3c8f12[_0xe682('0x20')]()[_0xe682('0x1f')](function(){_0x36c7e0[_0xe682('0x18')](0xcc)[_0xe682('0x19')]();});}};}function handleEntityNotFound(_0x220eb3,_0x3ab870){return function(_0x1d364c){if(!_0x1d364c){_0x220eb3[_0xe682('0x17')](0x194);}return _0x1d364c;};}function handleError(_0x3e9018,_0x46402f){_0x46402f=_0x46402f||0x1f4;return function(_0x5bfb75){logger['error'](_0x5bfb75[_0xe682('0x21')]);if(_0x5bfb75[_0xe682('0x22')]){delete _0x5bfb75[_0xe682('0x22')];}_0x3e9018['status'](_0x46402f)[_0xe682('0x23')](_0x5bfb75);};}exports['index']=function(_0x53f95a,_0x2164dc){var _0x108a09={},_0x422539={},_0x2be6d2={'count':0x0,'rows':[]};var _0x25a32f=db['ZohoField']['rawAttributes'];_0x422539['model']=_[_0xe682('0x24')](_0x25a32f);var _0x50fae3={'dateStart':_0x53f95a['query'][_0xe682('0x25')],'dateEnd':_0x53f95a['query'][_0xe682('0x26')]};delete _0x53f95a['query']['dateStart'];delete _0x53f95a[_0xe682('0x27')][_0xe682('0x26')];_0x422539[_0xe682('0x27')]=_[_0xe682('0x24')](_0x53f95a['query']);_0x422539[_0xe682('0x28')]=_[_0xe682('0x29')](_0x422539[_0xe682('0x2a')],_0x422539[_0xe682('0x27')]);_0x108a09['attributes']=_[_0xe682('0x29')](_0x422539['model'],qs[_0xe682('0x2b')](_0x53f95a[_0xe682('0x27')]['fields']));_0x108a09[_0xe682('0x2c')]=_0x108a09[_0xe682('0x2c')]['length']?_0x108a09[_0xe682('0x2c')]:_0x422539[_0xe682('0x2a')];if(!_0x53f95a[_0xe682('0x27')][_0xe682('0x2d')](_0xe682('0x2e'))){_0x108a09['limit']=qs[_0xe682('0x2f')](_0x53f95a[_0xe682('0x27')][_0xe682('0x2f')]);_0x108a09['offset']=qs[_0xe682('0x30')](_0x53f95a[_0xe682('0x27')]['offset']);}_0x108a09[_0xe682('0x31')]=qs[_0xe682('0x32')](_0x53f95a['query'][_0xe682('0x32')]);_0x108a09[_0xe682('0x33')]=qs[_0xe682('0x28')](_[_0xe682('0x34')](_0x53f95a['query'],_0x422539[_0xe682('0x28')]));if(_0x50fae3[_0xe682('0x25')]){if(_0x50fae3[_0xe682('0x26')]){_0x50fae3[_0xe682('0x26')]=moment(_0x50fae3[_0xe682('0x26')])[_0xe682('0x35')](0x1,_0xe682('0x36'));}else{_0x50fae3[_0xe682('0x26')]=moment(_0x50fae3[_0xe682('0x25')])[_0xe682('0x35')](0x1,_0xe682('0x36'));}_[_0xe682('0x37')](_0x108a09[_0xe682('0x33')],{'createdAt':{'$gte':_0x50fae3[_0xe682('0x25')],'$lte':_0x50fae3[_0xe682('0x26')]}});}if(_0x53f95a['query']['filter']){_0x108a09[_0xe682('0x33')]=_[_0xe682('0x37')](_0x108a09[_0xe682('0x33')],{'$or':_[_0xe682('0x38')](_0x108a09[_0xe682('0x2c')],function(_0x377ab8){var _0x429862={};_0x429862[_0x377ab8]={'$like':'%'+_0x53f95a[_0xe682('0x27')][_0xe682('0x39')]+'%'};return _0x429862;})});}_0x108a09=_[_0xe682('0x37')]({},_0x108a09,_0x53f95a[_0xe682('0x3a')]);var _0x46e40f={'where':_0x108a09['where']};return db['ZohoField'][_0xe682('0x1b')](_0x46e40f)[_0xe682('0x1f')](function(_0x354df1){_0x2be6d2['count']=_0x354df1;if(_0x53f95a['query'][_0xe682('0x3b')]){_0x108a09['include']=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x108a09);})['then'](function(_0xf20b0e){_0x2be6d2[_0xe682('0x3c')]=_0xf20b0e;return _0x2be6d2;})[_0xe682('0x1f')](respondWithFilteredResult(_0x2164dc,_0x108a09))[_0xe682('0x3d')](handleError(_0x2164dc,null));};exports[_0xe682('0x3e')]=function(_0x171cae,_0x193a3a){var _0x1881ef={'raw':!![],'where':{'id':_0x171cae[_0xe682('0x3f')]['id']}},_0x297b33={};_0x297b33['model']=_[_0xe682('0x24')](db['ZohoField'][_0xe682('0x40')]);_0x297b33[_0xe682('0x27')]=_[_0xe682('0x24')](_0x171cae[_0xe682('0x27')]);_0x297b33[_0xe682('0x28')]=_[_0xe682('0x29')](_0x297b33[_0xe682('0x2a')],_0x297b33['query']);_0x1881ef['attributes']=_[_0xe682('0x29')](_0x297b33[_0xe682('0x2a')],qs[_0xe682('0x2b')](_0x171cae['query'][_0xe682('0x2b')]));_0x1881ef[_0xe682('0x2c')]=_0x1881ef[_0xe682('0x2c')][_0xe682('0x41')]?_0x1881ef[_0xe682('0x2c')]:_0x297b33[_0xe682('0x2a')];if(_0x171cae[_0xe682('0x27')][_0xe682('0x3b')]){_0x1881ef[_0xe682('0x42')]=[{'all':!![]}];}_0x1881ef=_[_0xe682('0x37')]({},_0x1881ef,_0x171cae[_0xe682('0x3a')]);return db['ZohoField'][_0xe682('0x43')](_0x1881ef)['then'](handleEntityNotFound(_0x193a3a,null))['then'](respondWithResult(_0x193a3a,null))[_0xe682('0x3d')](handleError(_0x193a3a,null));};exports[_0xe682('0x44')]=function(_0x3d0421,_0x11bbb3){return db[_0xe682('0x45')]['create'](_0x3d0421['body'],{})[_0xe682('0x1f')](respondWithResult(_0x11bbb3,0xc9))[_0xe682('0x3d')](handleError(_0x11bbb3,null));};exports[_0xe682('0x46')]=function(_0x24053e,_0xc08af6){if(_0x24053e[_0xe682('0x47')]['id']){delete _0x24053e[_0xe682('0x47')]['id'];}return db[_0xe682('0x45')][_0xe682('0x43')]({'where':{'id':_0x24053e['params']['id']}})['then'](handleEntityNotFound(_0xc08af6,null))['then'](saveUpdates(_0x24053e['body'],null))[_0xe682('0x1f')](respondWithResult(_0xc08af6,null))[_0xe682('0x3d')](handleError(_0xc08af6,null));};exports[_0xe682('0x20')]=function(_0xcd6dc9,_0xbf1491){return db[_0xe682('0x45')][_0xe682('0x43')]({'where':{'id':_0xcd6dc9[_0xe682('0x3f')]['id']}})[_0xe682('0x1f')](handleEntityNotFound(_0xbf1491,null))[_0xe682('0x1f')](removeEntity(_0xbf1491,null))[_0xe682('0x3d')](handleError(_0xbf1491,null));};
\ No newline at end of file
+var _0xc997=['order','sort','where','pick','add','day','merge','filter','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','../../config/utils','sendStatus','status','end','json','count','offset','apply','reject','save','then','error','stack','name','send','index','ZohoField','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','model','attributes','fields','hasOwnProperty','limit'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0xc997,0x1ac));var _0x7c99=function(_0x15f3b8,_0x2f73ce){_0x15f3b8=_0x15f3b8-0x0;var _0x486f79=_0xc997[_0x15f3b8];return _0x486f79;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7c99('0x0'));var rimraf=require(_0x7c99('0x1'));var zipdir=require(_0x7c99('0x2'));var jsonpatch=require(_0x7c99('0x3'));var rp=require(_0x7c99('0x4'));var moment=require('moment');var BPromise=require(_0x7c99('0x5'));var Mustache=require(_0x7c99('0x6'));var util=require(_0x7c99('0x7'));var path=require(_0x7c99('0x8'));var sox=require(_0x7c99('0x9'));var csv=require(_0x7c99('0xa'));var ejs=require(_0x7c99('0xb'));var fs=require('fs');var _=require(_0x7c99('0xc'));var squel=require('squel');var crypto=require(_0x7c99('0xd'));var jsforce=require(_0x7c99('0xe'));var deskjs=require(_0x7c99('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7c99('0x10'));var Papa=require(_0x7c99('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x7c99('0x12'))('api');var utils=require(_0x7c99('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x262ce9,_0x3540ac){_0x3540ac=_0x3540ac||0xcc;return function(_0xb32968){if(_0xb32968){return _0x262ce9[_0x7c99('0x14')](_0x3540ac);}return _0x262ce9[_0x7c99('0x15')](_0x3540ac)[_0x7c99('0x16')]();};}function respondWithResult(_0x466e96,_0x2d1596){_0x2d1596=_0x2d1596||0xc8;return function(_0xa7f5b0){if(_0xa7f5b0){return _0x466e96[_0x7c99('0x15')](_0x2d1596)[_0x7c99('0x17')](_0xa7f5b0);}};}function respondWithFilteredResult(_0x330c02,_0x3e167e){return function(_0x33bd5f){if(_0x33bd5f){var _0x368db4=_0x33bd5f[_0x7c99('0x18')],_0x2758a4=_0x3e167e[_0x7c99('0x19')],_0x1bfc54=_0x3e167e[_0x7c99('0x19')]+_0x3e167e['limit'],_0x29a2a8;if(_0x1bfc54>=_0x368db4){_0x1bfc54=_0x368db4;_0x29a2a8=0xc8;}else{_0x29a2a8=0xce;}_0x330c02[_0x7c99('0x15')](_0x29a2a8);return _0x330c02['set']('Content-Range',_0x2758a4+'-'+_0x1bfc54+'/'+_0x368db4)[_0x7c99('0x17')](_0x33bd5f);}return null;};}function patchUpdates(_0x133e96){return function(_0x7baa0b){try{jsonpatch[_0x7c99('0x1a')](_0x7baa0b,_0x133e96,!![]);}catch(_0x32306b){return BPromise[_0x7c99('0x1b')](_0x32306b);}return _0x7baa0b[_0x7c99('0x1c')]();};}function saveUpdates(_0x1b5cb6,_0x14a655){return function(_0x3faa91){if(_0x3faa91){return _0x3faa91['update'](_0x1b5cb6)[_0x7c99('0x1d')](function(_0x3da4d6){return _0x3da4d6;});}return null;};}function removeEntity(_0x326e8d,_0x536425){return function(_0x53ec6b){if(_0x53ec6b){return _0x53ec6b['destroy']()['then'](function(){_0x326e8d['status'](0xcc)[_0x7c99('0x16')]();});}};}function handleEntityNotFound(_0x36437b,_0x5e37d0){return function(_0xbe266d){if(!_0xbe266d){_0x36437b[_0x7c99('0x14')](0x194);}return _0xbe266d;};}function handleError(_0x1ee3d0,_0x3bac4a){_0x3bac4a=_0x3bac4a||0x1f4;return function(_0x5dceaf){logger[_0x7c99('0x1e')](_0x5dceaf[_0x7c99('0x1f')]);if(_0x5dceaf[_0x7c99('0x20')]){delete _0x5dceaf[_0x7c99('0x20')];}_0x1ee3d0[_0x7c99('0x15')](_0x3bac4a)[_0x7c99('0x21')](_0x5dceaf);};}exports[_0x7c99('0x22')]=function(_0xbd1712,_0x80857d){var _0xdbe0e8={},_0x25b108={},_0x35be2a={'count':0x0,'rows':[]};var _0x57349a=db[_0x7c99('0x23')][_0x7c99('0x24')];_0x25b108['model']=_[_0x7c99('0x25')](_0x57349a);var _0x1cf3cb={'dateStart':_0xbd1712[_0x7c99('0x26')][_0x7c99('0x27')],'dateEnd':_0xbd1712[_0x7c99('0x26')][_0x7c99('0x28')]};delete _0xbd1712[_0x7c99('0x26')]['dateStart'];delete _0xbd1712['query']['dateEnd'];_0x25b108[_0x7c99('0x26')]=_[_0x7c99('0x25')](_0xbd1712[_0x7c99('0x26')]);_0x25b108[_0x7c99('0x29')]=_[_0x7c99('0x2a')](_0x25b108[_0x7c99('0x2b')],_0x25b108[_0x7c99('0x26')]);_0xdbe0e8[_0x7c99('0x2c')]=_[_0x7c99('0x2a')](_0x25b108[_0x7c99('0x2b')],qs[_0x7c99('0x2d')](_0xbd1712[_0x7c99('0x26')][_0x7c99('0x2d')]));_0xdbe0e8['attributes']=_0xdbe0e8[_0x7c99('0x2c')]['length']?_0xdbe0e8[_0x7c99('0x2c')]:_0x25b108['model'];if(!_0xbd1712[_0x7c99('0x26')][_0x7c99('0x2e')]('nolimit')){_0xdbe0e8[_0x7c99('0x2f')]=qs[_0x7c99('0x2f')](_0xbd1712['query'][_0x7c99('0x2f')]);_0xdbe0e8[_0x7c99('0x19')]=qs[_0x7c99('0x19')](_0xbd1712[_0x7c99('0x26')][_0x7c99('0x19')]);}_0xdbe0e8[_0x7c99('0x30')]=qs[_0x7c99('0x31')](_0xbd1712[_0x7c99('0x26')][_0x7c99('0x31')]);_0xdbe0e8[_0x7c99('0x32')]=qs[_0x7c99('0x29')](_[_0x7c99('0x33')](_0xbd1712[_0x7c99('0x26')],_0x25b108['filters']));if(_0x1cf3cb['dateStart']){if(_0x1cf3cb['dateEnd']){_0x1cf3cb[_0x7c99('0x28')]=moment(_0x1cf3cb[_0x7c99('0x28')])[_0x7c99('0x34')](0x1,_0x7c99('0x35'));}else{_0x1cf3cb[_0x7c99('0x28')]=moment(_0x1cf3cb['dateStart'])[_0x7c99('0x34')](0x1,'day');}_[_0x7c99('0x36')](_0xdbe0e8['where'],{'createdAt':{'$gte':_0x1cf3cb[_0x7c99('0x27')],'$lte':_0x1cf3cb[_0x7c99('0x28')]}});}if(_0xbd1712['query'][_0x7c99('0x37')]){_0xdbe0e8[_0x7c99('0x32')]=_['merge'](_0xdbe0e8[_0x7c99('0x32')],{'$or':_['map'](_0xdbe0e8[_0x7c99('0x2c')],function(_0x42f0a4){var _0x40783f={};_0x40783f[_0x42f0a4]={'$like':'%'+_0xbd1712[_0x7c99('0x26')][_0x7c99('0x37')]+'%'};return _0x40783f;})});}_0xdbe0e8=_[_0x7c99('0x36')]({},_0xdbe0e8,_0xbd1712['options']);var _0x5bb396={'where':_0xdbe0e8[_0x7c99('0x32')]};return db[_0x7c99('0x23')]['count'](_0x5bb396)[_0x7c99('0x1d')](function(_0x552fb3){_0x35be2a[_0x7c99('0x18')]=_0x552fb3;if(_0xbd1712[_0x7c99('0x26')][_0x7c99('0x38')]){_0xdbe0e8[_0x7c99('0x39')]=[{'all':!![]}];}return db[_0x7c99('0x23')][_0x7c99('0x3a')](_0xdbe0e8);})[_0x7c99('0x1d')](function(_0x313065){_0x35be2a[_0x7c99('0x3b')]=_0x313065;return _0x35be2a;})[_0x7c99('0x1d')](respondWithFilteredResult(_0x80857d,_0xdbe0e8))[_0x7c99('0x3c')](handleError(_0x80857d,null));};exports[_0x7c99('0x3d')]=function(_0x15746e,_0x40100b){var _0x20b275={'raw':!![],'where':{'id':_0x15746e[_0x7c99('0x3e')]['id']}},_0x5ef34b={};_0x5ef34b['model']=_[_0x7c99('0x25')](db[_0x7c99('0x23')][_0x7c99('0x24')]);_0x5ef34b['query']=_[_0x7c99('0x25')](_0x15746e[_0x7c99('0x26')]);_0x5ef34b[_0x7c99('0x29')]=_['intersection'](_0x5ef34b[_0x7c99('0x2b')],_0x5ef34b[_0x7c99('0x26')]);_0x20b275['attributes']=_[_0x7c99('0x2a')](_0x5ef34b[_0x7c99('0x2b')],qs[_0x7c99('0x2d')](_0x15746e[_0x7c99('0x26')]['fields']));_0x20b275[_0x7c99('0x2c')]=_0x20b275['attributes'][_0x7c99('0x3f')]?_0x20b275['attributes']:_0x5ef34b[_0x7c99('0x2b')];if(_0x15746e['query'][_0x7c99('0x38')]){_0x20b275[_0x7c99('0x39')]=[{'all':!![]}];}_0x20b275=_[_0x7c99('0x36')]({},_0x20b275,_0x15746e['options']);return db[_0x7c99('0x23')][_0x7c99('0x40')](_0x20b275)[_0x7c99('0x1d')](handleEntityNotFound(_0x40100b,null))[_0x7c99('0x1d')](respondWithResult(_0x40100b,null))['catch'](handleError(_0x40100b,null));};exports[_0x7c99('0x41')]=function(_0x187548,_0x34e53e){return db[_0x7c99('0x23')][_0x7c99('0x41')](_0x187548[_0x7c99('0x42')],{})[_0x7c99('0x1d')](respondWithResult(_0x34e53e,0xc9))[_0x7c99('0x3c')](handleError(_0x34e53e,null));};exports[_0x7c99('0x43')]=function(_0x34d3da,_0xf18a2c){if(_0x34d3da[_0x7c99('0x42')]['id']){delete _0x34d3da['body']['id'];}return db[_0x7c99('0x23')][_0x7c99('0x40')]({'where':{'id':_0x34d3da['params']['id']}})[_0x7c99('0x1d')](handleEntityNotFound(_0xf18a2c,null))['then'](saveUpdates(_0x34d3da['body'],null))[_0x7c99('0x1d')](respondWithResult(_0xf18a2c,null))['catch'](handleError(_0xf18a2c,null));};exports['destroy']=function(_0x401d3d,_0x113d3c){return db[_0x7c99('0x23')][_0x7c99('0x40')]({'where':{'id':_0x401d3d[_0x7c99('0x3e')]['id']}})[_0x7c99('0x1d')](handleEntityNotFound(_0x113d3c,null))['then'](removeEntity(_0x113d3c,null))[_0x7c99('0x3c')](handleError(_0x113d3c,null));};
\ No newline at end of file
index 7bbd99b..26bdd0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cc7=['exports','define','ZohoField','int_zoho_fields','lodash','api','moment','bluebird','request-promise','./intZohoField.attributes'];(function(_0x2122f8,_0x52c32c){var _0x228912=function(_0x286d0a){while(--_0x286d0a){_0x2122f8['push'](_0x2122f8['shift']());}};_0x228912(++_0x52c32c);}(_0x8cc7,0x126));var _0x78cc=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x8cc7[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x78cc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x78cc('0x1'));var moment=require(_0x78cc('0x2'));var BPromise=require(_0x78cc('0x3'));var rp=require(_0x78cc('0x4'));var attributes=require(_0x78cc('0x5'));module[_0x78cc('0x6')]=function(_0x577b4b,_0x14ede8){return _0x577b4b[_0x78cc('0x7')](_0x78cc('0x8'),attributes,{'tableName':_0x78cc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b23=['util','../../config/logger','api','moment','./intZohoField.attributes','exports','define'];(function(_0x345dde,_0x45db95){var _0x2de9eb=function(_0x244567){while(--_0x244567){_0x345dde['push'](_0x345dde['shift']());}};_0x2de9eb(++_0x45db95);}(_0x6b23,0x10a));var _0x36b2=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0x6b23[_0x339129];return _0x1570df;};'use strict';var _=require('lodash');var util=require(_0x36b2('0x0'));var logger=require(_0x36b2('0x1'))(_0x36b2('0x2'));var moment=require(_0x36b2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x36b2('0x4'));module[_0x36b2('0x5')]=function(_0x8ff73,_0x2d06cb){return _0x8ff73[_0x36b2('0x6')]('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 951f625..b75c78e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9d5=['message','request\x20sent','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x5cf058,_0x1a53f2){var _0x2dd6a0=function(_0x19a60d){while(--_0x19a60d){_0x5cf058['push'](_0x5cf058['shift']());}};_0x2dd6a0(++_0x1a53f2);}(_0xf9d5,0x122));var _0x5f9d=function(_0xdf9b3c,_0xb472f0){_0xdf9b3c=_0xdf9b3c-0x0;var _0x5d7d6b=_0xf9d5[_0xdf9b3c];return _0x5d7d6b;};'use strict';var _=require('lodash');var util=require(_0x5f9d('0x0'));var moment=require(_0x5f9d('0x1'));var BPromise=require('bluebird');var rs=require(_0x5f9d('0x2'));var fs=require('fs');var db=require(_0x5f9d('0x3'))['db'];var utils=require(_0x5f9d('0x4'));var logger=require(_0x5f9d('0x5'))(_0x5f9d('0x6'));var config=require(_0x5f9d('0x7'));var jayson=require(_0x5f9d('0x8'));var client=jayson['client'][_0x5f9d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59027b,_0x24999e,_0x38fb6b){return new BPromise(function(_0x4fb9f7,_0x3420b2){return client[_0x5f9d('0xa')](_0x59027b,_0x38fb6b)[_0x5f9d('0xb')](function(_0x250f6c){logger[_0x5f9d('0xc')](_0x5f9d('0xd'),_0x24999e,'request\x20sent');logger[_0x5f9d('0xe')](_0x5f9d('0xf'),_0x24999e,'request\x20sent',JSON['stringify'](_0x250f6c));if(_0x250f6c[_0x5f9d('0x10')]){if(_0x250f6c[_0x5f9d('0x10')][_0x5f9d('0x11')]===0x1f4){logger['error'](_0x5f9d('0xd'),_0x24999e,_0x250f6c[_0x5f9d('0x10')][_0x5f9d('0x12')]);return _0x3420b2(_0x250f6c[_0x5f9d('0x10')]['message']);}logger[_0x5f9d('0x10')](_0x5f9d('0xd'),_0x24999e,_0x250f6c[_0x5f9d('0x10')]['message']);return _0x4fb9f7(_0x250f6c[_0x5f9d('0x10')][_0x5f9d('0x12')]);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0x24999e,_0x5f9d('0x13'));_0x4fb9f7(_0x250f6c[_0x5f9d('0x14')][_0x5f9d('0x12')]);}})[_0x5f9d('0x15')](function(_0x3ffb29){logger['error']('ZohoField,\x20%s,\x20%s',_0x24999e,_0x3ffb29);_0x3420b2(_0x3ffb29);});});}
\ No newline at end of file
+var _0xed1c=['lodash','util','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch'];(function(_0x27aeb1,_0x41b5da){var _0x3f4eb8=function(_0x434f9e){while(--_0x434f9e){_0x27aeb1['push'](_0x27aeb1['shift']());}};_0x3f4eb8(++_0x41b5da);}(_0xed1c,0xe4));var _0xced1=function(_0x56e6fb,_0x59efa7){_0x56e6fb=_0x56e6fb-0x0;var _0x766c3a=_0xed1c[_0x56e6fb];return _0x766c3a;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0xced1('0x2'));var logger=require(_0xced1('0x3'))(_0xced1('0x4'));var config=require('../../config/environment');var jayson=require(_0xced1('0x5'));var client=jayson[_0xced1('0x6')][_0xced1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x37b22b,_0x59399e,_0x2bcf42){return new BPromise(function(_0x38bca8,_0x39d5df){return client[_0xced1('0x8')](_0x37b22b,_0x2bcf42)[_0xced1('0x9')](function(_0x3221b6){logger[_0xced1('0xa')](_0xced1('0xb'),_0x59399e,'request\x20sent');logger[_0xced1('0xc')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x59399e,_0xced1('0xd'),JSON[_0xced1('0xe')](_0x3221b6));if(_0x3221b6[_0xced1('0xf')]){if(_0x3221b6[_0xced1('0xf')][_0xced1('0x10')]===0x1f4){logger[_0xced1('0xf')](_0xced1('0xb'),_0x59399e,_0x3221b6['error'][_0xced1('0x11')]);return _0x39d5df(_0x3221b6[_0xced1('0xf')][_0xced1('0x11')]);}logger[_0xced1('0xf')]('ZohoField,\x20%s,\x20%s',_0x59399e,_0x3221b6[_0xced1('0xf')][_0xced1('0x11')]);return _0x38bca8(_0x3221b6['error'][_0xced1('0x11')]);}else{logger[_0xced1('0xa')](_0xced1('0xb'),_0x59399e,_0xced1('0xd'));_0x38bca8(_0x3221b6['result']['message']);}})[_0xced1('0x12')](function(_0x4178d8){logger[_0xced1('0xf')](_0xced1('0xb'),_0x59399e,_0x4178d8);_0x39d5df(_0x4178d8);});});}
\ No newline at end of file
index 0b79886..de72263 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc39=['../../components/auth/service','../../config/environment','multer','util','path','express'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xdc39,0x1b8));var _0x9dc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc39[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9dc3('0x0'));var util=require(_0x9dc3('0x1'));var path=require(_0x9dc3('0x2'));var express=require(_0x9dc3('0x3'));var router=express['Router']();var auth=require(_0x9dc3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9dc3('0x5'));module['exports']=router;
\ No newline at end of file
+var _0x58c3=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','express'];(function(_0x1fc961,_0x2a9c84){var _0x1ff564=function(_0x10246e){while(--_0x10246e){_0x1fc961['push'](_0x1fc961['shift']());}};_0x1ff564(++_0x2a9c84);}(_0x58c3,0x1eb));var _0x358c=function(_0x201ab2,_0x19ba32){_0x201ab2=_0x201ab2-0x0;var _0x440db9=_0x58c3[_0x201ab2];return _0x440db9;};'use strict';var multer=require(_0x358c('0x0'));var util=require(_0x358c('0x1'));var path=require(_0x358c('0x2'));var express=require(_0x358c('0x3'));var router=express[_0x358c('0x4')]();var auth=require(_0x358c('0x5'));var interaction=require(_0x358c('0x6'));var config=require(_0x358c('0x7'));module[_0x358c('0x8')]=router;
\ No newline at end of file
index e537c97..4e3989f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e5d=['exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state'];(function(_0x24901d,_0x5dbe6c){var _0x2177d5=function(_0x3784c8){while(--_0x3784c8){_0x24901d['push'](_0x24901d['shift']());}};_0x2177d5(++_0x5dbe6c);}(_0x2e5d,0x13b));var _0xd2e5=function(_0x3a0c4f,_0x5dd1a3){_0x3a0c4f=_0x3a0c4f-0x0;var _0x247049=_0x2e5d[_0x3a0c4f];return _0x247049;};'use strict';var Sequelize=require('sequelize');module[_0xd2e5('0x0')]={'name':{'type':Sequelize[_0xd2e5('0x1')],'allowNull':![],'unique':_0xd2e5('0x2')},'version':{'type':Sequelize[_0xd2e5('0x1')],'allowNull':![],'unique':_0xd2e5('0x2')},'main':{'type':Sequelize[_0xd2e5('0x1')],'defaultValue':_0xd2e5('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd2e5('0x1')]},'size':{'type':Sequelize[_0xd2e5('0x4')]},'active':{'type':Sequelize[_0xd2e5('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xd2e5('0x1')]},'logo':{'type':Sequelize[_0xd2e5('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0xd2e5('0x6')},'description':{'type':Sequelize[_0xd2e5('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xd2e5('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}};
\ No newline at end of file
+var _0xe893=['exports','unique_name_and_version','STRING','app.js','INTEGER','BOOLEAN','state','sequelize'];(function(_0x834ad4,_0x3a706a){var _0x758d61=function(_0x48405a){while(--_0x48405a){_0x834ad4['push'](_0x834ad4['shift']());}};_0x758d61(++_0x3a706a);}(_0xe893,0xb7));var _0x3e89=function(_0x1da8f5,_0xc052c4){_0x1da8f5=_0x1da8f5-0x0;var _0x2973a4=_0xe893[_0x1da8f5];return _0x2973a4;};'use strict';var Sequelize=require(_0x3e89('0x0'));module[_0x3e89('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3e89('0x2')},'main':{'type':Sequelize[_0x3e89('0x3')],'defaultValue':_0x3e89('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x3e89('0x3')]},'type':{'type':Sequelize[_0x3e89('0x3')]},'size':{'type':Sequelize[_0x3e89('0x5')]},'active':{'type':Sequelize[_0x3e89('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':_0x3e89('0x7')},'description':{'type':Sequelize[_0x3e89('0x3')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3e89('0x3')]},'link':{'type':Sequelize[_0x3e89('0x3')],'defaultValue':'#'}};
\ No newline at end of file
index b9d7320..e7d9dbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba34=['path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','destroy','then','error','stack','name','send','index','rawAttributes','model','keys','query','dateStart','dateEnd','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','add','merge','map','filter','options','Integration','includeAll','include','findAll','rows','catch','show','length','update','body','params','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util'];(function(_0x427a4f,_0x500cd1){var _0x46f8c8=function(_0x30899a){while(--_0x30899a){_0x427a4f['push'](_0x427a4f['shift']());}};_0x46f8c8(++_0x500cd1);}(_0xba34,0x119));var _0x4ba3=function(_0x14fd3a,_0x55592b){_0x14fd3a=_0x14fd3a-0x0;var _0x3de593=_0xba34[_0x14fd3a];return _0x3de593;};'use strict';var pdf=require(_0x4ba3('0x0'));var emlformat=require(_0x4ba3('0x1'));var rimraf=require(_0x4ba3('0x2'));var zipdir=require(_0x4ba3('0x3'));var jsonpatch=require(_0x4ba3('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4ba3('0x5'));var util=require(_0x4ba3('0x6'));var path=require(_0x4ba3('0x7'));var sox=require(_0x4ba3('0x8'));var csv=require(_0x4ba3('0x9'));var ejs=require(_0x4ba3('0xa'));var fs=require('fs');var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x9'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var qs=require(_0x4ba3('0x11'));var logger=require(_0x4ba3('0x12'))(_0x4ba3('0x13'));var utils=require(_0x4ba3('0x14'));var config=require(_0x4ba3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4619c5,_0x9071){_0x9071=_0x9071||0xcc;return function(_0x485782){if(_0x485782){return _0x4619c5[_0x4ba3('0x16')](_0x9071);}return _0x4619c5['status'](_0x9071)[_0x4ba3('0x17')]();};}function respondWithResult(_0x52f55c,_0x256f02){_0x256f02=_0x256f02||0xc8;return function(_0x4419b4){if(_0x4419b4){return _0x52f55c[_0x4ba3('0x18')](_0x256f02)[_0x4ba3('0x19')](_0x4419b4);}};}function respondWithFilteredResult(_0x2bc796,_0x3d2ace){return function(_0x3a74f7){if(_0x3a74f7){var _0x12ac90=_0x3a74f7[_0x4ba3('0x1a')],_0x1dec48=_0x3d2ace[_0x4ba3('0x1b')],_0x401366=_0x3d2ace[_0x4ba3('0x1b')]+_0x3d2ace[_0x4ba3('0x1c')],_0x36638b;if(_0x401366>=_0x12ac90){_0x401366=_0x12ac90;_0x36638b=0xc8;}else{_0x36638b=0xce;}_0x2bc796[_0x4ba3('0x18')](_0x36638b);return _0x2bc796['set'](_0x4ba3('0x1d'),_0x1dec48+'-'+_0x401366+'/'+_0x12ac90)[_0x4ba3('0x19')](_0x3a74f7);}return null;};}function patchUpdates(_0x5ff7ce){return function(_0x451c92){try{jsonpatch['apply'](_0x451c92,_0x5ff7ce,!![]);}catch(_0x2519bb){return BPromise[_0x4ba3('0x1e')](_0x2519bb);}return _0x451c92[_0x4ba3('0x1f')]();};}function saveUpdates(_0x1e2ce5,_0x184332){return function(_0x125944){if(_0x125944){return _0x125944['update'](_0x1e2ce5)['then'](function(_0x2278b0){return _0x2278b0;});}return null;};}function removeEntity(_0x579d9f,_0x18dff5){return function(_0x163967){if(_0x163967){return _0x163967[_0x4ba3('0x20')]()[_0x4ba3('0x21')](function(){_0x579d9f[_0x4ba3('0x18')](0xcc)[_0x4ba3('0x17')]();});}};}function handleEntityNotFound(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(!_0x1f87e1){_0x4a0823['sendStatus'](0x194);}return _0x1f87e1;};}function handleError(_0x28bb3d,_0x4ffe39){_0x4ffe39=_0x4ffe39||0x1f4;return function(_0x1ae4de){logger[_0x4ba3('0x22')](_0x1ae4de[_0x4ba3('0x23')]);if(_0x1ae4de[_0x4ba3('0x24')]){delete _0x1ae4de[_0x4ba3('0x24')];}_0x28bb3d[_0x4ba3('0x18')](_0x4ffe39)[_0x4ba3('0x25')](_0x1ae4de);};}exports[_0x4ba3('0x26')]=function(_0x6cecf3,_0x2e67a0){var _0x50c729={},_0x252f37={},_0x13c353={'count':0x0,'rows':[]};var _0x2311ed=db['Integration'][_0x4ba3('0x27')];_0x252f37[_0x4ba3('0x28')]=_[_0x4ba3('0x29')](_0x2311ed);var _0x5a3588={'dateStart':_0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x2b')],'dateEnd':_0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x2c')]};delete _0x6cecf3['query']['dateStart'];delete _0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x2c')];_0x252f37[_0x4ba3('0x2a')]=_[_0x4ba3('0x29')](_0x6cecf3[_0x4ba3('0x2a')]);_0x252f37[_0x4ba3('0x2d')]=_['intersection'](_0x252f37[_0x4ba3('0x28')],_0x252f37[_0x4ba3('0x2a')]);_0x50c729[_0x4ba3('0x2e')]=_[_0x4ba3('0x2f')](_0x252f37[_0x4ba3('0x28')],qs[_0x4ba3('0x30')](_0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x30')]));_0x50c729[_0x4ba3('0x2e')]=_0x50c729[_0x4ba3('0x2e')]['length']?_0x50c729['attributes']:_0x252f37['model'];if(!_0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x31')](_0x4ba3('0x32'))){_0x50c729[_0x4ba3('0x1c')]=qs[_0x4ba3('0x1c')](_0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x1c')]);_0x50c729[_0x4ba3('0x1b')]=qs[_0x4ba3('0x1b')](_0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x1b')]);}_0x50c729[_0x4ba3('0x33')]=qs['sort'](_0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x34')]);_0x50c729[_0x4ba3('0x35')]=qs['filters'](_[_0x4ba3('0x36')](_0x6cecf3['query'],_0x252f37[_0x4ba3('0x2d')]));if(_0x5a3588[_0x4ba3('0x2b')]){if(_0x5a3588[_0x4ba3('0x2c')]){_0x5a3588[_0x4ba3('0x2c')]=moment(_0x5a3588[_0x4ba3('0x2c')])[_0x4ba3('0x37')](0x1,'day');}else{_0x5a3588[_0x4ba3('0x2c')]=moment(_0x5a3588[_0x4ba3('0x2b')])[_0x4ba3('0x37')](0x1,'day');}_[_0x4ba3('0x38')](_0x50c729[_0x4ba3('0x35')],{'createdAt':{'$gte':_0x5a3588['dateStart'],'$lte':_0x5a3588[_0x4ba3('0x2c')]}});}if(_0x6cecf3['query']['filter']){_0x50c729[_0x4ba3('0x35')]=_[_0x4ba3('0x38')](_0x50c729[_0x4ba3('0x35')],{'$or':_[_0x4ba3('0x39')](_0x50c729[_0x4ba3('0x2e')],function(_0x59d535){var _0x3aeefd={};_0x3aeefd[_0x59d535]={'$like':'%'+_0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x3a')]+'%'};return _0x3aeefd;})});}_0x50c729=_[_0x4ba3('0x38')]({},_0x50c729,_0x6cecf3[_0x4ba3('0x3b')]);var _0x2acc92={'where':_0x50c729[_0x4ba3('0x35')]};return db[_0x4ba3('0x3c')]['count'](_0x2acc92)[_0x4ba3('0x21')](function(_0x3b4240){_0x13c353[_0x4ba3('0x1a')]=_0x3b4240;if(_0x6cecf3[_0x4ba3('0x2a')][_0x4ba3('0x3d')]){_0x50c729[_0x4ba3('0x3e')]=[{'all':!![]}];}return db[_0x4ba3('0x3c')][_0x4ba3('0x3f')](_0x50c729);})[_0x4ba3('0x21')](function(_0xa692c6){_0x13c353[_0x4ba3('0x40')]=_0xa692c6;return _0x13c353;})[_0x4ba3('0x21')](respondWithFilteredResult(_0x2e67a0,_0x50c729))[_0x4ba3('0x41')](handleError(_0x2e67a0,null));};exports[_0x4ba3('0x42')]=function(_0x4a1522,_0x5af671){var _0x4df0f5={'raw':![],'where':{'id':_0x4a1522['params']['id']}},_0x48280f={};_0x48280f[_0x4ba3('0x28')]=_['keys'](db[_0x4ba3('0x3c')]['rawAttributes']);_0x48280f[_0x4ba3('0x2a')]=_[_0x4ba3('0x29')](_0x4a1522[_0x4ba3('0x2a')]);_0x48280f[_0x4ba3('0x2d')]=_[_0x4ba3('0x2f')](_0x48280f['model'],_0x48280f[_0x4ba3('0x2a')]);_0x4df0f5['attributes']=_[_0x4ba3('0x2f')](_0x48280f['model'],qs[_0x4ba3('0x30')](_0x4a1522[_0x4ba3('0x2a')][_0x4ba3('0x30')]));_0x4df0f5[_0x4ba3('0x2e')]=_0x4df0f5[_0x4ba3('0x2e')][_0x4ba3('0x43')]?_0x4df0f5[_0x4ba3('0x2e')]:_0x48280f['model'];if(_0x4a1522[_0x4ba3('0x2a')][_0x4ba3('0x3d')]){_0x4df0f5[_0x4ba3('0x3e')]=[{'all':!![]}];}_0x4df0f5=_[_0x4ba3('0x38')]({},_0x4df0f5,_0x4a1522[_0x4ba3('0x3b')]);return db['Integration']['find'](_0x4df0f5)[_0x4ba3('0x21')](handleEntityNotFound(_0x5af671,null))[_0x4ba3('0x21')](respondWithResult(_0x5af671,null))[_0x4ba3('0x41')](handleError(_0x5af671,null));};exports['create']=function(_0xd466f6,_0xfd30a0){return db[_0x4ba3('0x3c')]['create'](_0xd466f6['body'],{})[_0x4ba3('0x21')](respondWithResult(_0xfd30a0,0xc9))['catch'](handleError(_0xfd30a0,null));};exports[_0x4ba3('0x44')]=function(_0x1b9f76,_0x1aab37){if(_0x1b9f76[_0x4ba3('0x45')]['id']){delete _0x1b9f76[_0x4ba3('0x45')]['id'];}return db[_0x4ba3('0x3c')]['find']({'where':{'id':_0x1b9f76[_0x4ba3('0x46')]['id']}})[_0x4ba3('0x21')](handleEntityNotFound(_0x1aab37,null))['then'](saveUpdates(_0x1b9f76[_0x4ba3('0x45')],null))[_0x4ba3('0x21')](respondWithResult(_0x1aab37,null))[_0x4ba3('0x41')](handleError(_0x1aab37,null));};exports[_0x4ba3('0x20')]=function(_0x360472,_0x4d092d){return db[_0x4ba3('0x3c')][_0x4ba3('0x47')]({'where':{'id':_0x360472['params']['id']}})[_0x4ba3('0x21')](handleEntityNotFound(_0x4d092d,null))[_0x4ba3('0x21')](removeEntity(_0x4d092d,null))[_0x4ba3('0x41')](handleError(_0x4d092d,null));};
\ No newline at end of file
+var _0xdb28=['api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','name','send','index','Integration','model','keys','query','dateStart','dateEnd','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','add','day','filter','where','merge','map','options','rows','catch','show','params','rawAttributes','length','includeAll','include','create','body','find','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger'];(function(_0xfa531c,_0x98e69e){var _0x2eef5a=function(_0x59114b){while(--_0x59114b){_0xfa531c['push'](_0xfa531c['shift']());}};_0x2eef5a(++_0x98e69e);}(_0xdb28,0x106));var _0x8db2=function(_0xd73564,_0x33d686){_0xd73564=_0xd73564-0x0;var _0x241e54=_0xdb28[_0xd73564];return _0x241e54;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0xa'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x8db2('0x11'))(_0x8db2('0x12'));var utils=require(_0x8db2('0x13'));var config=require('../../config/environment');var db=require(_0x8db2('0x14'))['db'];function respondWithStatusCode(_0x150942,_0x576475){_0x576475=_0x576475||0xcc;return function(_0x41beda){if(_0x41beda){return _0x150942[_0x8db2('0x15')](_0x576475);}return _0x150942[_0x8db2('0x16')](_0x576475)[_0x8db2('0x17')]();};}function respondWithResult(_0x37d017,_0x559fb1){_0x559fb1=_0x559fb1||0xc8;return function(_0x49fadc){if(_0x49fadc){return _0x37d017[_0x8db2('0x16')](_0x559fb1)[_0x8db2('0x18')](_0x49fadc);}};}function respondWithFilteredResult(_0x350d61,_0x1d6a15){return function(_0x227355){if(_0x227355){var _0xfa285b=_0x227355[_0x8db2('0x19')],_0x2f177a=_0x1d6a15['offset'],_0x3c96a7=_0x1d6a15[_0x8db2('0x1a')]+_0x1d6a15[_0x8db2('0x1b')],_0x131252;if(_0x3c96a7>=_0xfa285b){_0x3c96a7=_0xfa285b;_0x131252=0xc8;}else{_0x131252=0xce;}_0x350d61['status'](_0x131252);return _0x350d61[_0x8db2('0x1c')](_0x8db2('0x1d'),_0x2f177a+'-'+_0x3c96a7+'/'+_0xfa285b)[_0x8db2('0x18')](_0x227355);}return null;};}function patchUpdates(_0x3fddc2){return function(_0x2efd06){try{jsonpatch[_0x8db2('0x1e')](_0x2efd06,_0x3fddc2,!![]);}catch(_0x51d60d){return BPromise['reject'](_0x51d60d);}return _0x2efd06[_0x8db2('0x1f')]();};}function saveUpdates(_0x104e33,_0x1310d3){return function(_0x1b64e4){if(_0x1b64e4){return _0x1b64e4['update'](_0x104e33)[_0x8db2('0x20')](function(_0x36a9ff){return _0x36a9ff;});}return null;};}function removeEntity(_0x260940,_0x297ba3){return function(_0x3dbe8e){if(_0x3dbe8e){return _0x3dbe8e['destroy']()[_0x8db2('0x20')](function(){_0x260940[_0x8db2('0x16')](0xcc)[_0x8db2('0x17')]();});}};}function handleEntityNotFound(_0x125be2,_0x2260d8){return function(_0x21704c){if(!_0x21704c){_0x125be2[_0x8db2('0x15')](0x194);}return _0x21704c;};}function handleError(_0x5c6614,_0x256202){_0x256202=_0x256202||0x1f4;return function(_0x4f6516){logger['error'](_0x4f6516['stack']);if(_0x4f6516['name']){delete _0x4f6516[_0x8db2('0x21')];}_0x5c6614[_0x8db2('0x16')](_0x256202)[_0x8db2('0x22')](_0x4f6516);};}exports[_0x8db2('0x23')]=function(_0x145328,_0x8d4f54){var _0x58cd9d={},_0x3544ba={},_0x372311={'count':0x0,'rows':[]};var _0x430dd5=db[_0x8db2('0x24')]['rawAttributes'];_0x3544ba[_0x8db2('0x25')]=_[_0x8db2('0x26')](_0x430dd5);var _0x241baf={'dateStart':_0x145328[_0x8db2('0x27')][_0x8db2('0x28')],'dateEnd':_0x145328[_0x8db2('0x27')][_0x8db2('0x29')]};delete _0x145328[_0x8db2('0x27')][_0x8db2('0x28')];delete _0x145328['query'][_0x8db2('0x29')];_0x3544ba['query']=_['keys'](_0x145328[_0x8db2('0x27')]);_0x3544ba[_0x8db2('0x2a')]=_[_0x8db2('0x2b')](_0x3544ba['model'],_0x3544ba[_0x8db2('0x27')]);_0x58cd9d['attributes']=_[_0x8db2('0x2b')](_0x3544ba[_0x8db2('0x25')],qs[_0x8db2('0x2c')](_0x145328['query']['fields']));_0x58cd9d[_0x8db2('0x2d')]=_0x58cd9d[_0x8db2('0x2d')]['length']?_0x58cd9d['attributes']:_0x3544ba[_0x8db2('0x25')];if(!_0x145328[_0x8db2('0x27')][_0x8db2('0x2e')](_0x8db2('0x2f'))){_0x58cd9d[_0x8db2('0x1b')]=qs[_0x8db2('0x1b')](_0x145328[_0x8db2('0x27')][_0x8db2('0x1b')]);_0x58cd9d[_0x8db2('0x1a')]=qs[_0x8db2('0x1a')](_0x145328['query'][_0x8db2('0x1a')]);}_0x58cd9d[_0x8db2('0x30')]=qs['sort'](_0x145328[_0x8db2('0x27')][_0x8db2('0x31')]);_0x58cd9d['where']=qs['filters'](_[_0x8db2('0x32')](_0x145328['query'],_0x3544ba[_0x8db2('0x2a')]));if(_0x241baf[_0x8db2('0x28')]){if(_0x241baf[_0x8db2('0x29')]){_0x241baf[_0x8db2('0x29')]=moment(_0x241baf['dateEnd'])[_0x8db2('0x33')](0x1,'day');}else{_0x241baf[_0x8db2('0x29')]=moment(_0x241baf[_0x8db2('0x28')])[_0x8db2('0x33')](0x1,_0x8db2('0x34'));}_['merge'](_0x58cd9d['where'],{'createdAt':{'$gte':_0x241baf[_0x8db2('0x28')],'$lte':_0x241baf[_0x8db2('0x29')]}});}if(_0x145328['query'][_0x8db2('0x35')]){_0x58cd9d[_0x8db2('0x36')]=_[_0x8db2('0x37')](_0x58cd9d['where'],{'$or':_[_0x8db2('0x38')](_0x58cd9d[_0x8db2('0x2d')],function(_0x953349){var _0x279e74={};_0x279e74[_0x953349]={'$like':'%'+_0x145328[_0x8db2('0x27')][_0x8db2('0x35')]+'%'};return _0x279e74;})});}_0x58cd9d=_[_0x8db2('0x37')]({},_0x58cd9d,_0x145328[_0x8db2('0x39')]);var _0x3793a4={'where':_0x58cd9d[_0x8db2('0x36')]};return db[_0x8db2('0x24')][_0x8db2('0x19')](_0x3793a4)[_0x8db2('0x20')](function(_0x4a1c60){_0x372311[_0x8db2('0x19')]=_0x4a1c60;if(_0x145328[_0x8db2('0x27')]['includeAll']){_0x58cd9d['include']=[{'all':!![]}];}return db[_0x8db2('0x24')]['findAll'](_0x58cd9d);})[_0x8db2('0x20')](function(_0x654b8c){_0x372311[_0x8db2('0x3a')]=_0x654b8c;return _0x372311;})[_0x8db2('0x20')](respondWithFilteredResult(_0x8d4f54,_0x58cd9d))[_0x8db2('0x3b')](handleError(_0x8d4f54,null));};exports[_0x8db2('0x3c')]=function(_0xa53fba,_0x5c97ef){var _0x2f86b1={'raw':![],'where':{'id':_0xa53fba[_0x8db2('0x3d')]['id']}},_0x3d44de={};_0x3d44de[_0x8db2('0x25')]=_['keys'](db[_0x8db2('0x24')][_0x8db2('0x3e')]);_0x3d44de[_0x8db2('0x27')]=_[_0x8db2('0x26')](_0xa53fba['query']);_0x3d44de[_0x8db2('0x2a')]=_['intersection'](_0x3d44de[_0x8db2('0x25')],_0x3d44de[_0x8db2('0x27')]);_0x2f86b1[_0x8db2('0x2d')]=_['intersection'](_0x3d44de['model'],qs[_0x8db2('0x2c')](_0xa53fba['query'][_0x8db2('0x2c')]));_0x2f86b1[_0x8db2('0x2d')]=_0x2f86b1[_0x8db2('0x2d')][_0x8db2('0x3f')]?_0x2f86b1[_0x8db2('0x2d')]:_0x3d44de[_0x8db2('0x25')];if(_0xa53fba[_0x8db2('0x27')][_0x8db2('0x40')]){_0x2f86b1[_0x8db2('0x41')]=[{'all':!![]}];}_0x2f86b1=_[_0x8db2('0x37')]({},_0x2f86b1,_0xa53fba[_0x8db2('0x39')]);return db[_0x8db2('0x24')]['find'](_0x2f86b1)[_0x8db2('0x20')](handleEntityNotFound(_0x5c97ef,null))[_0x8db2('0x20')](respondWithResult(_0x5c97ef,null))[_0x8db2('0x3b')](handleError(_0x5c97ef,null));};exports[_0x8db2('0x42')]=function(_0x4f5018,_0x4ffd9d){return db[_0x8db2('0x24')][_0x8db2('0x42')](_0x4f5018[_0x8db2('0x43')],{})['then'](respondWithResult(_0x4ffd9d,0xc9))['catch'](handleError(_0x4ffd9d,null));};exports['update']=function(_0x44ac56,_0x368c37){if(_0x44ac56[_0x8db2('0x43')]['id']){delete _0x44ac56[_0x8db2('0x43')]['id'];}return db[_0x8db2('0x24')][_0x8db2('0x44')]({'where':{'id':_0x44ac56[_0x8db2('0x3d')]['id']}})['then'](handleEntityNotFound(_0x368c37,null))['then'](saveUpdates(_0x44ac56[_0x8db2('0x43')],null))[_0x8db2('0x20')](respondWithResult(_0x368c37,null))[_0x8db2('0x3b')](handleError(_0x368c37,null));};exports[_0x8db2('0x45')]=function(_0x3daed6,_0x2bf408){return db[_0x8db2('0x24')][_0x8db2('0x44')]({'where':{'id':_0x3daed6[_0x8db2('0x3d')]['id']}})[_0x8db2('0x20')](handleEntityNotFound(_0x2bf408,null))[_0x8db2('0x20')](removeEntity(_0x2bf408,null))[_0x8db2('0x3b')](handleError(_0x2bf408,null));};
\ No newline at end of file
index ab40b3f..f9d4660 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['request-promise','./integration.attributes','exports','define','Integration','lodash','util','api','moment','bluebird'];(function(_0x3076d9,_0x4e5da4){var _0x6075de=function(_0x2ddecd){while(--_0x2ddecd){_0x3076d9['push'](_0x3076d9['shift']());}};_0x6075de(++_0x4e5da4);}(_0x5fab,0x177));var _0xb5fa=function(_0x6bbb11,_0x44e6b5){_0x6bbb11=_0x6bbb11-0x0;var _0x4c4dc3=_0x5fab[_0x6bbb11];return _0x4c4dc3;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var attributes=require(_0xb5fa('0x6'));module[_0xb5fa('0x7')]=function(_0x29390a,_0x4341d3){return _0x29390a[_0xb5fa('0x8')](_0xb5fa('0x9'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xadb5=['Integration','integrations','util','api','moment','bluebird','./integration.attributes','exports','define'];(function(_0xfbd4ed,_0x5be528){var _0x10633d=function(_0x546573){while(--_0x546573){_0xfbd4ed['push'](_0xfbd4ed['shift']());}};_0x10633d(++_0x5be528);}(_0xadb5,0xad));var _0x5adb=function(_0x484e79,_0x547e11){_0x484e79=_0x484e79-0x0;var _0x3016ef=_0xadb5[_0x484e79];return _0x3016ef;};'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 attributes=require(_0x5adb('0x4'));module[_0x5adb('0x5')]=function(_0x2e3ef4,_0x4cb1d1){return _0x2e3ef4[_0x5adb('0x6')](_0x5adb('0x7'),attributes,{'tableName':_0x5adb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d8e7036..f0b6f39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9fb=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','message','error','result','catch','lodash','util','moment'];(function(_0x81fbf7,_0x9395b6){var _0x5348f7=function(_0x298dd6){while(--_0x298dd6){_0x81fbf7['push'](_0x81fbf7['shift']());}};_0x5348f7(++_0x9395b6);}(_0xd9fb,0x189));var _0xbd9f=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xd9fb[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0xbd9f('0x0'));var util=require(_0xbd9f('0x1'));var moment=require(_0xbd9f('0x2'));var BPromise=require(_0xbd9f('0x3'));var rs=require(_0xbd9f('0x4'));var fs=require('fs');var db=require(_0xbd9f('0x5'))['db'];var utils=require(_0xbd9f('0x6'));var logger=require('../../config/logger')(_0xbd9f('0x7'));var config=require(_0xbd9f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbd9f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e7eea,_0x43a5a2,_0x5e2143){return new BPromise(function(_0x30f0ae,_0x16f086){return client[_0xbd9f('0xa')](_0x2e7eea,_0x5e2143)[_0xbd9f('0xb')](function(_0x4c007b){logger[_0xbd9f('0xc')](_0xbd9f('0xd'),_0x43a5a2,_0xbd9f('0xe'));logger[_0xbd9f('0xf')](_0xbd9f('0x10'),_0x43a5a2,_0xbd9f('0xe'),JSON[_0xbd9f('0x11')](_0x4c007b));if(_0x4c007b['error']){if(_0x4c007b['error']['code']===0x1f4){logger['error'](_0xbd9f('0xd'),_0x43a5a2,_0x4c007b['error'][_0xbd9f('0x12')]);return _0x16f086(_0x4c007b[_0xbd9f('0x13')][_0xbd9f('0x12')]);}logger['error'](_0xbd9f('0xd'),_0x43a5a2,_0x4c007b['error'][_0xbd9f('0x12')]);return _0x30f0ae(_0x4c007b[_0xbd9f('0x13')][_0xbd9f('0x12')]);}else{logger[_0xbd9f('0xc')]('Integration,\x20%s,\x20%s',_0x43a5a2,_0xbd9f('0xe'));_0x30f0ae(_0x4c007b[_0xbd9f('0x14')][_0xbd9f('0x12')]);}})[_0xbd9f('0x15')](function(_0x24dde0){logger[_0xbd9f('0x13')](_0xbd9f('0xd'),_0x43a5a2,_0x24dde0);_0x16f086(_0x24dde0);});});}
\ No newline at end of file
+var _0x49f8=['lodash','bluebird','randomstring','../../config/utils','rpc','jayson/promise','http','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x5b740b,_0x381833){var _0x6f8f4e=function(_0x86d068){while(--_0x86d068){_0x5b740b['push'](_0x5b740b['shift']());}};_0x6f8f4e(++_0x381833);}(_0x49f8,0xff));var _0x849f=function(_0x2b7b04,_0x5491aa){_0x2b7b04=_0x2b7b04-0x0;var _0x4b0728=_0x49f8[_0x2b7b04];return _0x4b0728;};'use strict';var _=require(_0x849f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x849f('0x1'));var rs=require(_0x849f('0x2'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x849f('0x3'));var logger=require('../../config/logger')(_0x849f('0x4'));var config=require('../../config/environment');var jayson=require(_0x849f('0x5'));var client=jayson['client'][_0x849f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x30ebab,_0x21f577,_0xb4c798){return new BPromise(function(_0x33b630,_0xc6443e){return client['request'](_0x30ebab,_0xb4c798)['then'](function(_0x5c013d){logger[_0x849f('0x7')](_0x849f('0x8'),_0x21f577,_0x849f('0x9'));logger[_0x849f('0xa')](_0x849f('0xb'),_0x21f577,_0x849f('0x9'),JSON[_0x849f('0xc')](_0x5c013d));if(_0x5c013d['error']){if(_0x5c013d[_0x849f('0xd')]['code']===0x1f4){logger[_0x849f('0xd')](_0x849f('0x8'),_0x21f577,_0x5c013d[_0x849f('0xd')][_0x849f('0xe')]);return _0xc6443e(_0x5c013d['error'][_0x849f('0xe')]);}logger[_0x849f('0xd')](_0x849f('0x8'),_0x21f577,_0x5c013d[_0x849f('0xd')][_0x849f('0xe')]);return _0x33b630(_0x5c013d['error']['message']);}else{logger[_0x849f('0x7')]('Integration,\x20%s,\x20%s',_0x21f577,_0x849f('0x9'));_0x33b630(_0x5c013d[_0x849f('0xf')][_0x849f('0xe')]);}})[_0x849f('0x10')](function(_0x3e721f){logger[_0x849f('0xd')](_0x849f('0x8'),_0x21f577,_0x3e721f);_0xc6443e(_0x3e721f);});});}
\ No newline at end of file
index 8bbff8c..a6da66f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22ed=['/describe','/:id','show','create','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x22ed,0x1a9));var _0xd22e=function(_0x133e18,_0x45d65b){_0x133e18=_0x133e18-0x0;var _0x5df697=_0x22ed[_0x133e18];return _0x5df697;};'use strict';var multer=require(_0xd22e('0x0'));var util=require(_0xd22e('0x1'));var path=require(_0xd22e('0x2'));var express=require(_0xd22e('0x3'));var router=express[_0xd22e('0x4')]();var auth=require(_0xd22e('0x5'));var interaction=require(_0xd22e('0x6'));var config=require(_0xd22e('0x7'));var controller=require(_0xd22e('0x8'));router[_0xd22e('0x9')]('/',auth[_0xd22e('0xa')](),controller[_0xd22e('0xb')]);router['get'](_0xd22e('0xc'),auth[_0xd22e('0xa')](),controller['describe']);router[_0xd22e('0x9')](_0xd22e('0xd'),auth['isAuthenticated'](),controller[_0xd22e('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd22e('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd22e('0x10')]);router[_0xd22e('0x11')](_0xd22e('0xd'),auth[_0xd22e('0xa')](),controller['destroy']);module[_0xd22e('0x12')]=router;
\ No newline at end of file
+var _0x4545=['../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3d96c7,_0x25955e){var _0x44adce=function(_0x25fd9e){while(--_0x25fd9e){_0x3d96c7['push'](_0x3d96c7['shift']());}};_0x44adce(++_0x25955e);}(_0x4545,0x1bc));var _0x5454=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4545[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x5454('0x0'));var util=require(_0x5454('0x1'));var path=require(_0x5454('0x2'));var express=require('express');var router=express[_0x5454('0x3')]();var auth=require(_0x5454('0x4'));var interaction=require(_0x5454('0x5'));var config=require(_0x5454('0x6'));var controller=require('./integrationReport.controller');router[_0x5454('0x7')]('/',auth[_0x5454('0x8')](),controller['index']);router[_0x5454('0x7')]('/describe',auth[_0x5454('0x8')](),controller[_0x5454('0x9')]);router['get'](_0x5454('0xa'),auth[_0x5454('0x8')](),controller[_0x5454('0xb')]);router[_0x5454('0xc')]('/',auth[_0x5454('0x8')](),controller[_0x5454('0xd')]);router['put'](_0x5454('0xa'),auth[_0x5454('0x8')](),controller[_0x5454('0xe')]);router[_0x5454('0xf')](_0x5454('0xa'),auth['isAuthenticated'](),controller[_0x5454('0x10')]);module[_0x5454('0x11')]=router;
\ No newline at end of file
index 12736ee..b4f3f63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2624=['FAILED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','ENUM','RECEIVED'];(function(_0x3dbdb8,_0x2dd53c){var _0x37fcd6=function(_0x150999){while(--_0x150999){_0x3dbdb8['push'](_0x3dbdb8['shift']());}};_0x37fcd6(++_0x2dd53c);}(_0x2624,0x196));var _0x4262=function(_0x3505d8,_0x495ad5){_0x3505d8=_0x3505d8-0x0;var _0x3d60bd=_0x2624[_0x3505d8];return _0x3d60bd;};'use strict';var Sequelize=require(_0x4262('0x0'));module[_0x4262('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x4262('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x4262('0x2')]},'uniqueid':{'type':Sequelize[_0x4262('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4262('0x2')]},'queue':{'type':Sequelize[_0x4262('0x2')]},'interface':{'type':Sequelize[_0x4262('0x2')]},'membername':{'type':Sequelize[_0x4262('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x4262('0x3')]},'holdtime':{'type':Sequelize[_0x4262('0x4')]},'agentcomplete':{'type':Sequelize[_0x4262('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x4262('0x3')]},'talktime':{'type':Sequelize[_0x4262('0x4')]},'agentacw':{'type':Sequelize[_0x4262('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4262('0x4')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x4262('0x3')]},'lastevent':{'type':Sequelize[_0x4262('0x2')]},'channel':{'type':Sequelize[_0x4262('0x2')]},'channelstate':{'type':Sequelize[_0x4262('0x4')]},'channelstatedesc':{'type':Sequelize[_0x4262('0x2')]},'connectedlinenum':{'type':Sequelize[_0x4262('0x2')]},'connectedlinename':{'type':Sequelize[_0x4262('0x2')]},'language':{'type':Sequelize[_0x4262('0x2')]},'accountcode':{'type':Sequelize[_0x4262('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x4262('0x2')]},'priority':{'type':Sequelize[_0x4262('0x2')]},'destchannel':{'type':Sequelize[_0x4262('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x4262('0x2')]},'destcalleridname':{'type':Sequelize[_0x4262('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x4262('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x4262('0x2')]},'destlanguage':{'type':Sequelize[_0x4262('0x2')]},'destaccountcode':{'type':Sequelize[_0x4262('0x2')]},'destcontext':{'type':Sequelize[_0x4262('0x2')]},'destexten':{'type':Sequelize[_0x4262('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x4262('0x2')]},'messageId':{'type':Sequelize[_0x4262('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x4262('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x4262('0x2')]},'cc':{'type':Sequelize[_0x4262('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x4262('0x6')]('SENT','SENDING',_0x4262('0x7'),_0x4262('0x8'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x4262('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x4262('0x4')]}};
\ No newline at end of file
+var _0x5fd5=['SENT','SENDING','FAILED','sequelize','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x5ad7e5,_0x32becf){var _0x26e0f3=function(_0x126751){while(--_0x126751){_0x5ad7e5['push'](_0x5ad7e5['shift']());}};_0x26e0f3(++_0x32becf);}(_0x5fd5,0x6f));var _0x55fd=function(_0x20ca5a,_0x1b2de0){_0x20ca5a=_0x20ca5a-0x0;var _0x421b96=_0x5fd5[_0x20ca5a];return _0x421b96;};'use strict';var Sequelize=require(_0x55fd('0x0'));module['exports']={'integration':{'type':Sequelize[_0x55fd('0x1')]},'eventChannel':{'type':Sequelize[_0x55fd('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x55fd('0x1')]},'integrationId':{'type':Sequelize[_0x55fd('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x55fd('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x55fd('0x1')]},'interface':{'type':Sequelize[_0x55fd('0x1')]},'membername':{'type':Sequelize[_0x55fd('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x55fd('0x3')]},'holdtime':{'type':Sequelize[_0x55fd('0x2')]},'agentcomplete':{'type':Sequelize[_0x55fd('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x55fd('0x3')]},'talktime':{'type':Sequelize[_0x55fd('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x55fd('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x55fd('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x55fd('0x3')]},'agentdump':{'type':Sequelize[_0x55fd('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x55fd('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x55fd('0x1')]},'connectedlinenum':{'type':Sequelize[_0x55fd('0x1')]},'connectedlinename':{'type':Sequelize[_0x55fd('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x55fd('0x1')]},'context':{'type':Sequelize[_0x55fd('0x1')]},'exten':{'type':Sequelize[_0x55fd('0x1')]},'priority':{'type':Sequelize[_0x55fd('0x1')]},'destchannel':{'type':Sequelize[_0x55fd('0x1')]},'destchannelstate':{'type':Sequelize[_0x55fd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x55fd('0x1')]},'destcalleridnum':{'type':Sequelize[_0x55fd('0x1')]},'destcalleridname':{'type':Sequelize[_0x55fd('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x55fd('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x55fd('0x1')]},'destexten':{'type':Sequelize[_0x55fd('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x55fd('0x1')]},'messageId':{'type':Sequelize[_0x55fd('0x1')]},'inReplyTo':{'type':Sequelize[_0x55fd('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x55fd('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x55fd('0x1')]},'attachment':{'type':Sequelize[_0x55fd('0x5')]},'html':{'type':Sequelize[_0x55fd('0x5')]},'text':{'type':Sequelize[_0x55fd('0x5')]},'status':{'type':Sequelize['ENUM'](_0x55fd('0x6'),_0x55fd('0x7'),'RECEIVED',_0x55fd('0x8'))},'url':{'type':Sequelize[_0x55fd('0x1')]},'app':{'type':Sequelize[_0x55fd('0x1')]},'appdata':{'type':Sequelize[_0x55fd('0x1')]},'projectId':{'type':Sequelize[_0x55fd('0x2')]}};
\ No newline at end of file
index 172896c..ac7dad4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa41a=['count','offset','limit','set','Content-Range','apply','then','sendStatus','error','stack','IntegrationReport','rawAttributes','model','query','dateStart','dateEnd','filters','intersection','attributes','fields','nolimit','order','where','pick','add','day','merge','filter','options','includeAll','include','findAll','catch','params','keys','length','find','create','body','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json'];(function(_0x430c50,_0x17005a){var _0x6f61f1=function(_0x416c1e){while(--_0x416c1e){_0x430c50['push'](_0x430c50['shift']());}};_0x6f61f1(++_0x17005a);}(_0xa41a,0x6b));var _0xaa41=function(_0x2ee791,_0x1257d4){_0x2ee791=_0x2ee791-0x0;var _0x170144=_0xa41a[_0x2ee791];return _0x170144;};'use strict';var pdf=require(_0xaa41('0x0'));var emlformat=require(_0xaa41('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xaa41('0x2'));var jsonpatch=require(_0xaa41('0x3'));var rp=require(_0xaa41('0x4'));var moment=require(_0xaa41('0x5'));var BPromise=require(_0xaa41('0x6'));var Mustache=require(_0xaa41('0x7'));var util=require(_0xaa41('0x8'));var path=require(_0xaa41('0x9'));var sox=require('sox');var csv=require(_0xaa41('0xa'));var ejs=require(_0xaa41('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xa'));var querystring=require(_0xaa41('0xe'));var Papa=require(_0xaa41('0xf'));var qs=require(_0xaa41('0x10'));var logger=require(_0xaa41('0x11'))(_0xaa41('0x12'));var utils=require(_0xaa41('0x13'));var config=require(_0xaa41('0x14'));var db=require(_0xaa41('0x15'))['db'];function respondWithStatusCode(_0x5c9fc7,_0x1d3aac){_0x1d3aac=_0x1d3aac||0xcc;return function(_0x10cda9){if(_0x10cda9){return _0x5c9fc7['sendStatus'](_0x1d3aac);}return _0x5c9fc7['status'](_0x1d3aac)[_0xaa41('0x16')]();};}function respondWithResult(_0x518b5b,_0x19bd69){_0x19bd69=_0x19bd69||0xc8;return function(_0x12d9e6){if(_0x12d9e6){return _0x518b5b[_0xaa41('0x17')](_0x19bd69)[_0xaa41('0x18')](_0x12d9e6);}};}function respondWithFilteredResult(_0x6f9ade,_0x4eaf81){return function(_0x1e9d7f){if(_0x1e9d7f){var _0x178170=_0x1e9d7f[_0xaa41('0x19')],_0x1934e9=_0x4eaf81[_0xaa41('0x1a')],_0x1ef7d9=_0x4eaf81['offset']+_0x4eaf81[_0xaa41('0x1b')],_0x2a6988;if(_0x1ef7d9>=_0x178170){_0x1ef7d9=_0x178170;_0x2a6988=0xc8;}else{_0x2a6988=0xce;}_0x6f9ade[_0xaa41('0x17')](_0x2a6988);return _0x6f9ade[_0xaa41('0x1c')](_0xaa41('0x1d'),_0x1934e9+'-'+_0x1ef7d9+'/'+_0x178170)[_0xaa41('0x18')](_0x1e9d7f);}return null;};}function patchUpdates(_0xd20ddf){return function(_0x29efe5){try{jsonpatch[_0xaa41('0x1e')](_0x29efe5,_0xd20ddf,!![]);}catch(_0x150ddf){return BPromise['reject'](_0x150ddf);}return _0x29efe5['save']();};}function saveUpdates(_0x1f502a,_0x22de55){return function(_0x35c753){if(_0x35c753){return _0x35c753['update'](_0x1f502a)[_0xaa41('0x1f')](function(_0x1f692b){return _0x1f692b;});}return null;};}function removeEntity(_0x4e768e,_0x513c61){return function(_0x1b1910){if(_0x1b1910){return _0x1b1910['destroy']()[_0xaa41('0x1f')](function(){_0x4e768e[_0xaa41('0x17')](0xcc)[_0xaa41('0x16')]();});}};}function handleEntityNotFound(_0x1f27f3,_0x1d623c){return function(_0x4eb01f){if(!_0x4eb01f){_0x1f27f3[_0xaa41('0x20')](0x194);}return _0x4eb01f;};}function handleError(_0x43a85c,_0x448a21){_0x448a21=_0x448a21||0x1f4;return function(_0x21f596){logger[_0xaa41('0x21')](_0x21f596[_0xaa41('0x22')]);if(_0x21f596['name']){delete _0x21f596['name'];}_0x43a85c[_0xaa41('0x17')](_0x448a21)['send'](_0x21f596);};}exports['index']=function(_0x12e362,_0x59707f){var _0x536bed={},_0x2d0ac0={},_0x9c8c21={'count':0x0,'rows':[]};var _0x392214=db[_0xaa41('0x23')][_0xaa41('0x24')];_0x2d0ac0[_0xaa41('0x25')]=_['keys'](_0x392214);var _0x30a174={'dateStart':_0x12e362[_0xaa41('0x26')][_0xaa41('0x27')],'dateEnd':_0x12e362[_0xaa41('0x26')][_0xaa41('0x28')]};delete _0x12e362[_0xaa41('0x26')][_0xaa41('0x27')];delete _0x12e362[_0xaa41('0x26')]['dateEnd'];_0x2d0ac0[_0xaa41('0x26')]=_['keys'](_0x12e362['query']);_0x2d0ac0[_0xaa41('0x29')]=_[_0xaa41('0x2a')](_0x2d0ac0['model'],_0x2d0ac0[_0xaa41('0x26')]);_0x536bed[_0xaa41('0x2b')]=_['intersection'](_0x2d0ac0['model'],qs['fields'](_0x12e362[_0xaa41('0x26')][_0xaa41('0x2c')]));_0x536bed[_0xaa41('0x2b')]=_0x536bed[_0xaa41('0x2b')]['length']?_0x536bed[_0xaa41('0x2b')]:_0x2d0ac0[_0xaa41('0x25')];if(!_0x12e362[_0xaa41('0x26')]['hasOwnProperty'](_0xaa41('0x2d'))){_0x536bed[_0xaa41('0x1b')]=qs[_0xaa41('0x1b')](_0x12e362['query'][_0xaa41('0x1b')]);_0x536bed[_0xaa41('0x1a')]=qs['offset'](_0x12e362[_0xaa41('0x26')][_0xaa41('0x1a')]);}_0x536bed[_0xaa41('0x2e')]=qs['sort'](_0x12e362[_0xaa41('0x26')]['sort']);_0x536bed[_0xaa41('0x2f')]=qs[_0xaa41('0x29')](_[_0xaa41('0x30')](_0x12e362['query'],_0x2d0ac0['filters']));if(_0x30a174['dateStart']){if(_0x30a174[_0xaa41('0x28')]){_0x30a174[_0xaa41('0x28')]=moment(_0x30a174[_0xaa41('0x28')])[_0xaa41('0x31')](0x1,'day');}else{_0x30a174['dateEnd']=moment(_0x30a174[_0xaa41('0x27')])[_0xaa41('0x31')](0x1,_0xaa41('0x32'));}_[_0xaa41('0x33')](_0x536bed[_0xaa41('0x2f')],{'createdAt':{'$gte':_0x30a174[_0xaa41('0x27')],'$lte':_0x30a174[_0xaa41('0x28')]}});}if(_0x12e362['query'][_0xaa41('0x34')]){_0x536bed[_0xaa41('0x2f')]=_[_0xaa41('0x33')](_0x536bed[_0xaa41('0x2f')],{'$or':_['map'](_0x536bed['attributes'],function(_0x42b759){var _0x275fa3={};_0x275fa3[_0x42b759]={'$like':'%'+_0x12e362['query'][_0xaa41('0x34')]+'%'};return _0x275fa3;})});}_0x536bed=_['merge']({},_0x536bed,_0x12e362[_0xaa41('0x35')]);var _0x25f2df={'where':_0x536bed[_0xaa41('0x2f')]};return db[_0xaa41('0x23')][_0xaa41('0x19')](_0x25f2df)[_0xaa41('0x1f')](function(_0x3ce95c){_0x9c8c21[_0xaa41('0x19')]=_0x3ce95c;if(_0x12e362['query'][_0xaa41('0x36')]){_0x536bed[_0xaa41('0x37')]=[{'all':!![]}];}return db[_0xaa41('0x23')][_0xaa41('0x38')](_0x536bed);})[_0xaa41('0x1f')](function(_0x1e2eb2){_0x9c8c21['rows']=_0x1e2eb2;return _0x9c8c21;})['then'](respondWithFilteredResult(_0x59707f,_0x536bed))[_0xaa41('0x39')](handleError(_0x59707f,null));};exports['show']=function(_0x1ed366,_0x215896){var _0x316d8={'raw':![],'where':{'id':_0x1ed366[_0xaa41('0x3a')]['id']}},_0x4600a9={};_0x4600a9[_0xaa41('0x25')]=_[_0xaa41('0x3b')](db['IntegrationReport'][_0xaa41('0x24')]);_0x4600a9['query']=_['keys'](_0x1ed366[_0xaa41('0x26')]);_0x4600a9['filters']=_['intersection'](_0x4600a9['model'],_0x4600a9[_0xaa41('0x26')]);_0x316d8['attributes']=_[_0xaa41('0x2a')](_0x4600a9[_0xaa41('0x25')],qs['fields'](_0x1ed366['query'][_0xaa41('0x2c')]));_0x316d8[_0xaa41('0x2b')]=_0x316d8[_0xaa41('0x2b')][_0xaa41('0x3c')]?_0x316d8[_0xaa41('0x2b')]:_0x4600a9[_0xaa41('0x25')];if(_0x1ed366[_0xaa41('0x26')][_0xaa41('0x36')]){_0x316d8[_0xaa41('0x37')]=[{'all':!![]}];}_0x316d8=_['merge']({},_0x316d8,_0x1ed366[_0xaa41('0x35')]);return db[_0xaa41('0x23')][_0xaa41('0x3d')](_0x316d8)[_0xaa41('0x1f')](handleEntityNotFound(_0x215896,null))[_0xaa41('0x1f')](respondWithResult(_0x215896,null))[_0xaa41('0x39')](handleError(_0x215896,null));};exports['create']=function(_0x406824,_0x16bd22){return db[_0xaa41('0x23')][_0xaa41('0x3e')](_0x406824['body'],{})[_0xaa41('0x1f')](respondWithResult(_0x16bd22,0xc9))['catch'](handleError(_0x16bd22,null));};exports['update']=function(_0x1415f5,_0xe0eec0){if(_0x1415f5[_0xaa41('0x3f')]['id']){delete _0x1415f5['body']['id'];}return db[_0xaa41('0x23')][_0xaa41('0x3d')]({'where':{'id':_0x1415f5[_0xaa41('0x3a')]['id']}})['then'](handleEntityNotFound(_0xe0eec0,null))[_0xaa41('0x1f')](saveUpdates(_0x1415f5[_0xaa41('0x3f')],null))[_0xaa41('0x1f')](respondWithResult(_0xe0eec0,null))[_0xaa41('0x39')](handleError(_0xe0eec0,null));};exports[_0xaa41('0x40')]=function(_0x237b8a,_0x333a9f){return db[_0xaa41('0x23')]['find']({'where':{'id':_0x237b8a[_0xaa41('0x3a')]['id']}})['then'](handleEntityNotFound(_0x333a9f,null))['then'](removeEntity(_0x333a9f,null))[_0xaa41('0x39')](handleError(_0x333a9f,null));};exports[_0xaa41('0x41')]=function(_0x3fef3e,_0x11f7d9){return db[_0xaa41('0x23')][_0xaa41('0x41')]()[_0xaa41('0x1f')](respondWithResult(_0x11f7d9,null))[_0xaa41('0x39')](handleError(_0x11f7d9,null));};
\ No newline at end of file
+var _0xf2ca=['params','include','find','catch','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','keys','query','dateEnd','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','dateStart','add','day','filter','merge','map','options','then','includeAll','IntegrationReport','findAll','show'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x1d9e40,_0x1c44db){_0x1d9e40=_0x1d9e40-0x0;var _0x2ee94f=_0xf2ca[_0x1d9e40];return _0x2ee94f;};'use strict';var pdf=require(_0xaf2c('0x0'));var emlformat=require(_0xaf2c('0x1'));var rimraf=require(_0xaf2c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaf2c('0x3'));var rp=require(_0xaf2c('0x4'));var moment=require(_0xaf2c('0x5'));var BPromise=require(_0xaf2c('0x6'));var Mustache=require(_0xaf2c('0x7'));var util=require(_0xaf2c('0x8'));var path=require('path');var sox=require(_0xaf2c('0x9'));var csv=require(_0xaf2c('0xa'));var ejs=require(_0xaf2c('0xb'));var fs=require('fs');var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0xa'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0xaf2c('0x10'))(_0xaf2c('0x11'));var utils=require(_0xaf2c('0x12'));var config=require(_0xaf2c('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4adc8c,_0x2c0d88){_0x2c0d88=_0x2c0d88||0xcc;return function(_0x41a5a0){if(_0x41a5a0){return _0x4adc8c[_0xaf2c('0x14')](_0x2c0d88);}return _0x4adc8c[_0xaf2c('0x15')](_0x2c0d88)[_0xaf2c('0x16')]();};}function respondWithResult(_0x59a59b,_0x590126){_0x590126=_0x590126||0xc8;return function(_0x15ccb4){if(_0x15ccb4){return _0x59a59b[_0xaf2c('0x15')](_0x590126)[_0xaf2c('0x17')](_0x15ccb4);}};}function respondWithFilteredResult(_0x18a8a5,_0x293ca6){return function(_0x152c73){if(_0x152c73){var _0x214f47=_0x152c73[_0xaf2c('0x18')],_0x3c1088=_0x293ca6[_0xaf2c('0x19')],_0x2119c8=_0x293ca6[_0xaf2c('0x19')]+_0x293ca6[_0xaf2c('0x1a')],_0x1d0633;if(_0x2119c8>=_0x214f47){_0x2119c8=_0x214f47;_0x1d0633=0xc8;}else{_0x1d0633=0xce;}_0x18a8a5[_0xaf2c('0x15')](_0x1d0633);return _0x18a8a5['set'](_0xaf2c('0x1b'),_0x3c1088+'-'+_0x2119c8+'/'+_0x214f47)['json'](_0x152c73);}return null;};}function patchUpdates(_0x278a28){return function(_0x474c80){try{jsonpatch[_0xaf2c('0x1c')](_0x474c80,_0x278a28,!![]);}catch(_0x578492){return BPromise[_0xaf2c('0x1d')](_0x578492);}return _0x474c80[_0xaf2c('0x1e')]();};}function saveUpdates(_0x1fec4c,_0x20000b){return function(_0x3f977c){if(_0x3f977c){return _0x3f977c[_0xaf2c('0x1f')](_0x1fec4c)['then'](function(_0x35e712){return _0x35e712;});}return null;};}function removeEntity(_0x164bcb,_0x8ffe13){return function(_0x3bfd3f){if(_0x3bfd3f){return _0x3bfd3f[_0xaf2c('0x20')]()['then'](function(){_0x164bcb[_0xaf2c('0x15')](0xcc)[_0xaf2c('0x16')]();});}};}function handleEntityNotFound(_0x18153c,_0x4be6ed){return function(_0x59b113){if(!_0x59b113){_0x18153c[_0xaf2c('0x14')](0x194);}return _0x59b113;};}function handleError(_0x303546,_0x1cafad){_0x1cafad=_0x1cafad||0x1f4;return function(_0x99f78d){logger['error'](_0x99f78d[_0xaf2c('0x21')]);if(_0x99f78d[_0xaf2c('0x22')]){delete _0x99f78d[_0xaf2c('0x22')];}_0x303546[_0xaf2c('0x15')](_0x1cafad)[_0xaf2c('0x23')](_0x99f78d);};}exports[_0xaf2c('0x24')]=function(_0xf0a56c,_0x4a8dd8){var _0x29f8b0={},_0x2051be={},_0x36f37c={'count':0x0,'rows':[]};var _0x410536=db['IntegrationReport'][_0xaf2c('0x25')];_0x2051be['model']=_[_0xaf2c('0x26')](_0x410536);var _0x42f980={'dateStart':_0xf0a56c[_0xaf2c('0x27')]['dateStart'],'dateEnd':_0xf0a56c[_0xaf2c('0x27')][_0xaf2c('0x28')]};delete _0xf0a56c[_0xaf2c('0x27')]['dateStart'];delete _0xf0a56c[_0xaf2c('0x27')][_0xaf2c('0x28')];_0x2051be[_0xaf2c('0x27')]=_[_0xaf2c('0x26')](_0xf0a56c['query']);_0x2051be[_0xaf2c('0x29')]=_[_0xaf2c('0x2a')](_0x2051be[_0xaf2c('0x2b')],_0x2051be['query']);_0x29f8b0['attributes']=_[_0xaf2c('0x2a')](_0x2051be['model'],qs[_0xaf2c('0x2c')](_0xf0a56c['query'][_0xaf2c('0x2c')]));_0x29f8b0[_0xaf2c('0x2d')]=_0x29f8b0['attributes'][_0xaf2c('0x2e')]?_0x29f8b0[_0xaf2c('0x2d')]:_0x2051be['model'];if(!_0xf0a56c[_0xaf2c('0x27')][_0xaf2c('0x2f')](_0xaf2c('0x30'))){_0x29f8b0[_0xaf2c('0x1a')]=qs[_0xaf2c('0x1a')](_0xf0a56c[_0xaf2c('0x27')]['limit']);_0x29f8b0[_0xaf2c('0x19')]=qs['offset'](_0xf0a56c[_0xaf2c('0x27')]['offset']);}_0x29f8b0[_0xaf2c('0x31')]=qs['sort'](_0xf0a56c[_0xaf2c('0x27')]['sort']);_0x29f8b0[_0xaf2c('0x32')]=qs['filters'](_[_0xaf2c('0x33')](_0xf0a56c[_0xaf2c('0x27')],_0x2051be[_0xaf2c('0x29')]));if(_0x42f980[_0xaf2c('0x34')]){if(_0x42f980[_0xaf2c('0x28')]){_0x42f980['dateEnd']=moment(_0x42f980['dateEnd'])[_0xaf2c('0x35')](0x1,_0xaf2c('0x36'));}else{_0x42f980[_0xaf2c('0x28')]=moment(_0x42f980[_0xaf2c('0x34')])[_0xaf2c('0x35')](0x1,_0xaf2c('0x36'));}_['merge'](_0x29f8b0[_0xaf2c('0x32')],{'createdAt':{'$gte':_0x42f980[_0xaf2c('0x34')],'$lte':_0x42f980['dateEnd']}});}if(_0xf0a56c[_0xaf2c('0x27')][_0xaf2c('0x37')]){_0x29f8b0[_0xaf2c('0x32')]=_[_0xaf2c('0x38')](_0x29f8b0[_0xaf2c('0x32')],{'$or':_[_0xaf2c('0x39')](_0x29f8b0[_0xaf2c('0x2d')],function(_0x310d3b){var _0x296ca8={};_0x296ca8[_0x310d3b]={'$like':'%'+_0xf0a56c[_0xaf2c('0x27')][_0xaf2c('0x37')]+'%'};return _0x296ca8;})});}_0x29f8b0=_[_0xaf2c('0x38')]({},_0x29f8b0,_0xf0a56c[_0xaf2c('0x3a')]);var _0x4b524d={'where':_0x29f8b0['where']};return db['IntegrationReport'][_0xaf2c('0x18')](_0x4b524d)[_0xaf2c('0x3b')](function(_0xf22918){_0x36f37c[_0xaf2c('0x18')]=_0xf22918;if(_0xf0a56c[_0xaf2c('0x27')][_0xaf2c('0x3c')]){_0x29f8b0['include']=[{'all':!![]}];}return db[_0xaf2c('0x3d')][_0xaf2c('0x3e')](_0x29f8b0);})[_0xaf2c('0x3b')](function(_0x4c5c89){_0x36f37c['rows']=_0x4c5c89;return _0x36f37c;})[_0xaf2c('0x3b')](respondWithFilteredResult(_0x4a8dd8,_0x29f8b0))['catch'](handleError(_0x4a8dd8,null));};exports[_0xaf2c('0x3f')]=function(_0x25ba26,_0x20fb99){var _0xd851d={'raw':![],'where':{'id':_0x25ba26[_0xaf2c('0x40')]['id']}},_0x4f3db5={};_0x4f3db5['model']=_[_0xaf2c('0x26')](db[_0xaf2c('0x3d')]['rawAttributes']);_0x4f3db5[_0xaf2c('0x27')]=_['keys'](_0x25ba26[_0xaf2c('0x27')]);_0x4f3db5[_0xaf2c('0x29')]=_[_0xaf2c('0x2a')](_0x4f3db5[_0xaf2c('0x2b')],_0x4f3db5[_0xaf2c('0x27')]);_0xd851d[_0xaf2c('0x2d')]=_[_0xaf2c('0x2a')](_0x4f3db5[_0xaf2c('0x2b')],qs[_0xaf2c('0x2c')](_0x25ba26['query']['fields']));_0xd851d[_0xaf2c('0x2d')]=_0xd851d['attributes']['length']?_0xd851d['attributes']:_0x4f3db5[_0xaf2c('0x2b')];if(_0x25ba26[_0xaf2c('0x27')][_0xaf2c('0x3c')]){_0xd851d[_0xaf2c('0x41')]=[{'all':!![]}];}_0xd851d=_['merge']({},_0xd851d,_0x25ba26[_0xaf2c('0x3a')]);return db['IntegrationReport'][_0xaf2c('0x42')](_0xd851d)['then'](handleEntityNotFound(_0x20fb99,null))[_0xaf2c('0x3b')](respondWithResult(_0x20fb99,null))[_0xaf2c('0x43')](handleError(_0x20fb99,null));};exports[_0xaf2c('0x44')]=function(_0x11e054,_0x3762bd){return db['IntegrationReport'][_0xaf2c('0x44')](_0x11e054[_0xaf2c('0x45')],{})['then'](respondWithResult(_0x3762bd,0xc9))['catch'](handleError(_0x3762bd,null));};exports[_0xaf2c('0x1f')]=function(_0x5c12a7,_0x2dc597){if(_0x5c12a7[_0xaf2c('0x45')]['id']){delete _0x5c12a7[_0xaf2c('0x45')]['id'];}return db[_0xaf2c('0x3d')][_0xaf2c('0x42')]({'where':{'id':_0x5c12a7[_0xaf2c('0x40')]['id']}})[_0xaf2c('0x3b')](handleEntityNotFound(_0x2dc597,null))[_0xaf2c('0x3b')](saveUpdates(_0x5c12a7[_0xaf2c('0x45')],null))[_0xaf2c('0x3b')](respondWithResult(_0x2dc597,null))[_0xaf2c('0x43')](handleError(_0x2dc597,null));};exports['destroy']=function(_0x22919a,_0x57547e){return db['IntegrationReport']['find']({'where':{'id':_0x22919a['params']['id']}})[_0xaf2c('0x3b')](handleEntityNotFound(_0x57547e,null))[_0xaf2c('0x3b')](removeEntity(_0x57547e,null))['catch'](handleError(_0x57547e,null));};exports[_0xaf2c('0x46')]=function(_0x2893c4,_0x1497fa){return db[_0xaf2c('0x3d')][_0xaf2c('0x46')]()[_0xaf2c('0x3b')](respondWithResult(_0x1497fa,null))[_0xaf2c('0x43')](handleError(_0x1497fa,null));};
\ No newline at end of file
index dd2d636..9390a3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcca7=['define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','request-promise','exports'];(function(_0x5bdec7,_0x221846){var _0x3bf792=function(_0xe8ee83){while(--_0xe8ee83){_0x5bdec7['push'](_0x5bdec7['shift']());}};_0x3bf792(++_0x221846);}(_0xcca7,0x1aa));var _0x7cca=function(_0xdbdb5f,_0x10f18b){_0xdbdb5f=_0xdbdb5f-0x0;var _0x4dfa9d=_0xcca7[_0xdbdb5f];return _0x4dfa9d;};'use strict';var _=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var logger=require(_0x7cca('0x2'))(_0x7cca('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7cca('0x4'));var attributes=require('./integrationReport.attributes');module[_0x7cca('0x5')]=function(_0x9523f7,_0x2126f7){return _0x9523f7[_0x7cca('0x6')](_0x7cca('0x7'),attributes,{'tableName':_0x7cca('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8fb=['report_integration','lodash','util','../../config/logger','api','./integrationReport.attributes','exports','define'];(function(_0x30c3f4,_0x3eebe6){var _0x30fe6c=function(_0x5d35c5){while(--_0x5d35c5){_0x30c3f4['push'](_0x30c3f4['shift']());}};_0x30fe6c(++_0x3eebe6);}(_0xd8fb,0x99));var _0xbd8f=function(_0x5e61b9,_0x29f89a){_0x5e61b9=_0x5e61b9-0x0;var _0xdbf251=_0xd8fb[_0x5e61b9];return _0xdbf251;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var logger=require(_0xbd8f('0x2'))(_0xbd8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xbd8f('0x4'));module[_0xbd8f('0x5')]=function(_0x53cccc,_0x400dfb){return _0x53cccc[_0xbd8f('0x6')]('IntegrationReport',attributes,{'tableName':_0xbd8f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 87d8418..786d136 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28ff=['http','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5f5d28,_0x448261){var _0x3e77f4=function(_0x499d44){while(--_0x499d44){_0x5f5d28['push'](_0x5f5d28['shift']());}};_0x3e77f4(++_0x448261);}(_0x28ff,0x77));var _0xf28f=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x28ff[_0x618414];return _0x21c19a;};'use strict';var _=require('lodash');var util=require(_0xf28f('0x0'));var moment=require(_0xf28f('0x1'));var BPromise=require('bluebird');var rs=require(_0xf28f('0x2'));var fs=require('fs');var db=require(_0xf28f('0x3'))['db'];var utils=require(_0xf28f('0x4'));var logger=require(_0xf28f('0x5'))('rpc');var config=require(_0xf28f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf28f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1d81ca,_0x57e44a,_0x351311){return new BPromise(function(_0x2fcdfd,_0x410e33){return client['request'](_0x1d81ca,_0x351311)[_0xf28f('0x8')](function(_0x1c87c6){logger['info'](_0xf28f('0x9'),_0x57e44a,_0xf28f('0xa'));logger[_0xf28f('0xb')](_0xf28f('0xc'),_0x57e44a,'request\x20sent',JSON['stringify'](_0x1c87c6));if(_0x1c87c6[_0xf28f('0xd')]){if(_0x1c87c6[_0xf28f('0xd')][_0xf28f('0xe')]===0x1f4){logger['error'](_0xf28f('0x9'),_0x57e44a,_0x1c87c6[_0xf28f('0xd')][_0xf28f('0xf')]);return _0x410e33(_0x1c87c6[_0xf28f('0xd')][_0xf28f('0xf')]);}logger[_0xf28f('0xd')](_0xf28f('0x9'),_0x57e44a,_0x1c87c6[_0xf28f('0xd')][_0xf28f('0xf')]);return _0x2fcdfd(_0x1c87c6[_0xf28f('0xd')][_0xf28f('0xf')]);}else{logger[_0xf28f('0x10')](_0xf28f('0x9'),_0x57e44a,_0xf28f('0xa'));_0x2fcdfd(_0x1c87c6[_0xf28f('0x11')]['message']);}})['catch'](function(_0x5ad0c1){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x57e44a,_0x5ad0c1);_0x410e33(_0x5ad0c1);});});}
\ No newline at end of file
+var _0x9c79=['request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','IntegrationReport,\x20%s,\x20%s'];(function(_0x3647df,_0x136160){var _0x15e50b=function(_0x1a41cf){while(--_0x1a41cf){_0x3647df['push'](_0x3647df['shift']());}};_0x15e50b(++_0x136160);}(_0x9c79,0x1d6));var _0x99c7=function(_0x245505,_0x2cfe7b){_0x245505=_0x245505-0x0;var _0x424bcb=_0x9c79[_0x245505];return _0x424bcb;};'use strict';var _=require(_0x99c7('0x0'));var util=require(_0x99c7('0x1'));var moment=require(_0x99c7('0x2'));var BPromise=require(_0x99c7('0x3'));var rs=require(_0x99c7('0x4'));var fs=require('fs');var db=require(_0x99c7('0x5'))['db'];var utils=require(_0x99c7('0x6'));var logger=require('../../config/logger')(_0x99c7('0x7'));var config=require(_0x99c7('0x8'));var jayson=require(_0x99c7('0x9'));var client=jayson[_0x99c7('0xa')][_0x99c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ecba2,_0xc4c07f,_0xd30d88){return new BPromise(function(_0x154e4b,_0x53d756){return client['request'](_0x3ecba2,_0xd30d88)[_0x99c7('0xc')](function(_0x4e9ec7){logger['info'](_0x99c7('0xd'),_0xc4c07f,_0x99c7('0xe'));logger[_0x99c7('0xf')](_0x99c7('0x10'),_0xc4c07f,_0x99c7('0xe'),JSON['stringify'](_0x4e9ec7));if(_0x4e9ec7[_0x99c7('0x11')]){if(_0x4e9ec7[_0x99c7('0x11')][_0x99c7('0x12')]===0x1f4){logger['error']('IntegrationReport,\x20%s,\x20%s',_0xc4c07f,_0x4e9ec7[_0x99c7('0x11')][_0x99c7('0x13')]);return _0x53d756(_0x4e9ec7['error'][_0x99c7('0x13')]);}logger['error'](_0x99c7('0xd'),_0xc4c07f,_0x4e9ec7['error'][_0x99c7('0x13')]);return _0x154e4b(_0x4e9ec7['error'][_0x99c7('0x13')]);}else{logger[_0x99c7('0x14')](_0x99c7('0xd'),_0xc4c07f,_0x99c7('0xe'));_0x154e4b(_0x4e9ec7[_0x99c7('0x15')][_0x99c7('0x13')]);}})['catch'](function(_0xdf3466){logger[_0x99c7('0x11')](_0x99c7('0xd'),_0xc4c07f,_0xdf3466);_0x53d756(_0xdf3466);});});}
\ No newline at end of file
index b359ca2..344ac39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5949=['../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','getIntervals','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','update','delete','destroy','exports','multer','util','path','express'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x5949,0x1ca));var _0x9594=function(_0xa98302,_0x844f27){_0xa98302=_0xa98302-0x0;var _0x1ad8e3=_0x5949[_0xa98302];return _0x1ad8e3;};'use strict';var multer=require(_0x9594('0x0'));var util=require(_0x9594('0x1'));var path=require(_0x9594('0x2'));var express=require(_0x9594('0x3'));var router=express['Router']();var auth=require(_0x9594('0x4'));var interaction=require(_0x9594('0x5'));var config=require(_0x9594('0x6'));var controller=require(_0x9594('0x7'));router[_0x9594('0x8')]('/',auth[_0x9594('0x9')](),controller[_0x9594('0xa')]);router[_0x9594('0x8')](_0x9594('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x9594('0x8')]('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x9594('0xc')]);router[_0x9594('0xd')]('/',auth[_0x9594('0x9')](),controller[_0x9594('0xe')]);router['post'](_0x9594('0xf'),auth[_0x9594('0x9')](),controller[_0x9594('0x10')]);router[_0x9594('0xd')](_0x9594('0x11'),auth['isAuthenticated'](),controller['addIntervals']);router['put'](_0x9594('0xb'),auth[_0x9594('0x9')](),controller[_0x9594('0x12')]);router[_0x9594('0x13')](_0x9594('0xb'),auth['isAuthenticated'](),controller[_0x9594('0x14')]);module[_0x9594('0x15')]=router;
\ No newline at end of file
+var _0xa756=['post','addInterval','/:id/sub_intervals/create_many','addIntervals','update','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sub_intervals'];(function(_0x3a9635,_0x1ab817){var _0x10d08c=function(_0x222242){while(--_0x222242){_0x3a9635['push'](_0x3a9635['shift']());}};_0x10d08c(++_0x1ab817);}(_0xa756,0x136));var _0x6a75=function(_0xb54b31,_0x4ac97c){_0xb54b31=_0xb54b31-0x0;var _0x49d88b=_0xa756[_0xb54b31];return _0x49d88b;};'use strict';var multer=require(_0x6a75('0x0'));var util=require(_0x6a75('0x1'));var path=require(_0x6a75('0x2'));var express=require(_0x6a75('0x3'));var router=express[_0x6a75('0x4')]();var auth=require(_0x6a75('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6a75('0x6'));var controller=require('./interval.controller');router[_0x6a75('0x7')]('/',auth[_0x6a75('0x8')](),controller[_0x6a75('0x9')]);router[_0x6a75('0x7')](_0x6a75('0xa'),auth[_0x6a75('0x8')](),controller[_0x6a75('0xb')]);router[_0x6a75('0x7')](_0x6a75('0xc'),auth['isAuthenticated'](),controller['getIntervals']);router[_0x6a75('0xd')]('/',auth[_0x6a75('0x8')](),controller['create']);router[_0x6a75('0xd')](_0x6a75('0xc'),auth[_0x6a75('0x8')](),controller[_0x6a75('0xe')]);router[_0x6a75('0xd')](_0x6a75('0xf'),auth[_0x6a75('0x8')](),controller[_0x6a75('0x10')]);router['put'](_0x6a75('0xa'),auth['isAuthenticated'](),controller[_0x6a75('0x11')]);router['delete'](_0x6a75('0xa'),auth[_0x6a75('0x8')](),controller[_0x6a75('0x12')]);module['exports']=router;
\ No newline at end of file
index 6964738..9347cec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1bb=['sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd1bb,0x141));var _0xbd1b=function(_0x3e2876,_0x36a9cd){_0x3e2876=_0x3e2876-0x0;var _0x158781=_0xd1bb[_0x3e2876];return _0x158781;};'use strict';var Sequelize=require(_0xbd1b('0x0'));module[_0xbd1b('0x1')]={'name':{'type':Sequelize[_0xbd1b('0x2')]},'description':{'type':Sequelize[_0xbd1b('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0x1782=['STRING','sequelize','exports'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x1782,0x199));var _0x2178=function(_0x56ddd3,_0x5a931d){_0x56ddd3=_0x56ddd3-0x0;var _0x62cf7b=_0x1782[_0x56ddd3];return _0x62cf7b;};'use strict';var Sequelize=require(_0x2178('0x0'));module[_0x2178('0x1')]={'name':{'type':Sequelize[_0x2178('0x2')]},'description':{'type':Sequelize[_0x2178('0x2')]},'interval':{'type':Sequelize[_0x2178('0x2')],'allowNull':!![]}};
\ No newline at end of file
index a712bc1..203a014 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc930=['sequelize','transaction','bulkCreate','html-pdf','eml-format','zip-dir','fast-json-patch','moment','path','sox','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','count','offset','set','apply','save','update','then','error','stack','name','send','index','Interval','rawAttributes','model','dateEnd','dateStart','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','filters','pick','add','day','merge','where','filter','includeAll','include','findAll','catch','params','find','create','body','destroy','addInterval','getIntervals','findOne','length','map','options','addIntervals'];(function(_0x410c47,_0x2471b0){var _0x4673d0=function(_0x194963){while(--_0x194963){_0x410c47['push'](_0x410c47['shift']());}};_0x4673d0(++_0x2471b0);}(_0xc930,0x127));var _0x0c93=function(_0x1bffc9,_0x505bf0){_0x1bffc9=_0x1bffc9-0x0;var _0x26177e=_0xc930[_0x1bffc9];return _0x26177e;};'use strict';var pdf=require(_0x0c93('0x0'));var emlformat=require(_0x0c93('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0c93('0x2'));var jsonpatch=require(_0x0c93('0x3'));var rp=require('request-promise');var moment=require(_0x0c93('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x0c93('0x5'));var sox=require(_0x0c93('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0c93('0x7'));var crypto=require(_0x0c93('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x0c93('0x9'));var toCsv=require('to-csv');var querystring=require(_0x0c93('0xa'));var Papa=require(_0x0c93('0xb'));var qs=require(_0x0c93('0xc'));var logger=require('../../config/logger')(_0x0c93('0xd'));var utils=require(_0x0c93('0xe'));var config=require(_0x0c93('0xf'));var db=require(_0x0c93('0x10'))['db'];var extensions=require(_0x0c93('0x11'));function respondWithStatusCode(_0x575ecd,_0x5d94d7){_0x5d94d7=_0x5d94d7||0xcc;return function(_0x196a26){if(_0x196a26){return _0x575ecd[_0x0c93('0x12')](_0x5d94d7);}return _0x575ecd[_0x0c93('0x13')](_0x5d94d7)[_0x0c93('0x14')]();};}function respondWithResult(_0x1e87eb,_0x3da7ce){_0x3da7ce=_0x3da7ce||0xc8;return function(_0x3aa8e0){if(_0x3aa8e0){return _0x1e87eb[_0x0c93('0x13')](_0x3da7ce)['json'](_0x3aa8e0);}};}function respondWithFilteredResult(_0x24d268,_0x2e8ae2){return function(_0x383267){if(_0x383267){var _0x30cd2d=_0x383267[_0x0c93('0x15')],_0x3b1d4f=_0x2e8ae2['offset'],_0x5e05a4=_0x2e8ae2[_0x0c93('0x16')]+_0x2e8ae2['limit'],_0x53ea2c;if(_0x5e05a4>=_0x30cd2d){_0x5e05a4=_0x30cd2d;_0x53ea2c=0xc8;}else{_0x53ea2c=0xce;}_0x24d268['status'](_0x53ea2c);return _0x24d268[_0x0c93('0x17')]('Content-Range',_0x3b1d4f+'-'+_0x5e05a4+'/'+_0x30cd2d)['json'](_0x383267);}return null;};}function patchUpdates(_0x2ae812){return function(_0x22397a){try{jsonpatch[_0x0c93('0x18')](_0x22397a,_0x2ae812,!![]);}catch(_0x34a70e){return BPromise['reject'](_0x34a70e);}return _0x22397a[_0x0c93('0x19')]();};}function saveUpdates(_0x18bf74,_0x5ba029){return function(_0x5a3d89){if(_0x5a3d89){return _0x5a3d89[_0x0c93('0x1a')](_0x18bf74)['then'](function(_0x34020e){return _0x34020e;});}return null;};}function removeEntity(_0x3a3ff8,_0x51ab4f){return function(_0x742e16){if(_0x742e16){return _0x742e16['destroy']()[_0x0c93('0x1b')](function(){_0x3a3ff8[_0x0c93('0x13')](0xcc)[_0x0c93('0x14')]();});}};}function handleEntityNotFound(_0x4b1d08,_0x4dde93){return function(_0x230486){if(!_0x230486){_0x4b1d08[_0x0c93('0x12')](0x194);}return _0x230486;};}function handleError(_0x4208ad,_0x448f5f){_0x448f5f=_0x448f5f||0x1f4;return function(_0x47ef86){logger[_0x0c93('0x1c')](_0x47ef86[_0x0c93('0x1d')]);if(_0x47ef86['name']){delete _0x47ef86[_0x0c93('0x1e')];}_0x4208ad[_0x0c93('0x13')](_0x448f5f)[_0x0c93('0x1f')](_0x47ef86);};}exports[_0x0c93('0x20')]=function(_0xe53c8d,_0x175b83){var _0x218032={},_0x3c5157={},_0x458dfe={'count':0x0,'rows':[]};var _0x35da62=db[_0x0c93('0x21')][_0x0c93('0x22')];_0x3c5157[_0x0c93('0x23')]=_['keys'](_0x35da62);var _0x5e3dc7={'dateStart':_0xe53c8d['query']['dateStart'],'dateEnd':_0xe53c8d['query'][_0x0c93('0x24')]};delete _0xe53c8d['query'][_0x0c93('0x25')];delete _0xe53c8d['query'][_0x0c93('0x24')];_0x3c5157['query']=_[_0x0c93('0x26')](_0xe53c8d[_0x0c93('0x27')]);_0x3c5157['filters']=_[_0x0c93('0x28')](_0x3c5157[_0x0c93('0x23')],_0x3c5157[_0x0c93('0x27')]);_0x218032[_0x0c93('0x29')]=_[_0x0c93('0x28')](_0x3c5157[_0x0c93('0x23')],qs[_0x0c93('0x2a')](_0xe53c8d[_0x0c93('0x27')][_0x0c93('0x2a')]));_0x218032['attributes']=_0x218032[_0x0c93('0x29')]['length']?_0x218032[_0x0c93('0x29')]:_0x3c5157[_0x0c93('0x23')];if(!_0xe53c8d['query'][_0x0c93('0x2b')](_0x0c93('0x2c'))){_0x218032[_0x0c93('0x2d')]=qs[_0x0c93('0x2d')](_0xe53c8d[_0x0c93('0x27')][_0x0c93('0x2d')]);_0x218032['offset']=qs[_0x0c93('0x16')](_0xe53c8d[_0x0c93('0x27')]['offset']);}_0x218032['order']=qs[_0x0c93('0x2e')](_0xe53c8d[_0x0c93('0x27')]['sort']);_0x218032['where']=qs[_0x0c93('0x2f')](_[_0x0c93('0x30')](_0xe53c8d[_0x0c93('0x27')],_0x3c5157[_0x0c93('0x2f')]));if(_0x5e3dc7[_0x0c93('0x25')]){if(_0x5e3dc7[_0x0c93('0x24')]){_0x5e3dc7[_0x0c93('0x24')]=moment(_0x5e3dc7[_0x0c93('0x24')])[_0x0c93('0x31')](0x1,_0x0c93('0x32'));}else{_0x5e3dc7['dateEnd']=moment(_0x5e3dc7['dateStart'])['add'](0x1,_0x0c93('0x32'));}_[_0x0c93('0x33')](_0x218032[_0x0c93('0x34')],{'createdAt':{'$gte':_0x5e3dc7['dateStart'],'$lte':_0x5e3dc7[_0x0c93('0x24')]}});}if(_0xe53c8d[_0x0c93('0x27')][_0x0c93('0x35')]){_0x218032[_0x0c93('0x34')]=_[_0x0c93('0x33')](_0x218032['where'],{'$or':_['map'](_0x218032[_0x0c93('0x29')],function(_0x58f64d){var _0x403421={};_0x403421[_0x58f64d]={'$like':'%'+_0xe53c8d[_0x0c93('0x27')][_0x0c93('0x35')]+'%'};return _0x403421;})});}_0x218032=_[_0x0c93('0x33')]({},_0x218032,_0xe53c8d['options']);var _0x3c4035={'where':_0x218032['where']};return db[_0x0c93('0x21')]['count'](_0x3c4035)['then'](function(_0x2b2e20){_0x458dfe[_0x0c93('0x15')]=_0x2b2e20;if(_0xe53c8d[_0x0c93('0x27')][_0x0c93('0x36')]){_0x218032[_0x0c93('0x37')]=[{'all':!![]}];}return db[_0x0c93('0x21')][_0x0c93('0x38')](_0x218032);})[_0x0c93('0x1b')](function(_0x146e82){_0x458dfe['rows']=_0x146e82;return _0x458dfe;})[_0x0c93('0x1b')](respondWithFilteredResult(_0x175b83,_0x218032))[_0x0c93('0x39')](handleError(_0x175b83,null));};exports['show']=function(_0xe31d20,_0x4d3d82){var _0x3b87bd={'raw':!![],'where':{'id':_0xe31d20[_0x0c93('0x3a')]['id']}},_0x4d43dd={};_0x4d43dd[_0x0c93('0x23')]=_['keys'](db['Interval'][_0x0c93('0x22')]);_0x4d43dd['query']=_['keys'](_0xe31d20[_0x0c93('0x27')]);_0x4d43dd[_0x0c93('0x2f')]=_[_0x0c93('0x28')](_0x4d43dd['model'],_0x4d43dd[_0x0c93('0x27')]);_0x3b87bd[_0x0c93('0x29')]=_['intersection'](_0x4d43dd[_0x0c93('0x23')],qs[_0x0c93('0x2a')](_0xe31d20['query'][_0x0c93('0x2a')]));_0x3b87bd[_0x0c93('0x29')]=_0x3b87bd[_0x0c93('0x29')]['length']?_0x3b87bd[_0x0c93('0x29')]:_0x4d43dd[_0x0c93('0x23')];if(_0xe31d20['query']['includeAll']){_0x3b87bd[_0x0c93('0x37')]=[{'all':!![]}];}_0x3b87bd=_[_0x0c93('0x33')]({},_0x3b87bd,_0xe31d20['options']);return db[_0x0c93('0x21')][_0x0c93('0x3b')](_0x3b87bd)[_0x0c93('0x1b')](handleEntityNotFound(_0x4d3d82,null))[_0x0c93('0x1b')](respondWithResult(_0x4d3d82,null))[_0x0c93('0x39')](handleError(_0x4d3d82,null));};exports[_0x0c93('0x3c')]=function(_0x25542e,_0xbb96ff){return db[_0x0c93('0x21')][_0x0c93('0x3c')](_0x25542e[_0x0c93('0x3d')],{})['then'](respondWithResult(_0xbb96ff,0xc9))[_0x0c93('0x39')](handleError(_0xbb96ff,null));};exports[_0x0c93('0x1a')]=function(_0x19ba15,_0x2c382d){if(_0x19ba15[_0x0c93('0x3d')]['id']){delete _0x19ba15[_0x0c93('0x3d')]['id'];}return db[_0x0c93('0x21')][_0x0c93('0x3b')]({'where':{'id':_0x19ba15[_0x0c93('0x3a')]['id']}})['then'](handleEntityNotFound(_0x2c382d,null))[_0x0c93('0x1b')](saveUpdates(_0x19ba15[_0x0c93('0x3d')],null))[_0x0c93('0x1b')](respondWithResult(_0x2c382d,null))[_0x0c93('0x39')](handleError(_0x2c382d,null));};exports[_0x0c93('0x3e')]=function(_0x1ea0bb,_0x2ef259){return db[_0x0c93('0x21')][_0x0c93('0x3b')]({'where':{'id':_0x1ea0bb[_0x0c93('0x3a')]['id']}})[_0x0c93('0x1b')](handleEntityNotFound(_0x2ef259,null))['then'](removeEntity(_0x2ef259,null))[_0x0c93('0x39')](handleError(_0x2ef259,null));};exports[_0x0c93('0x3f')]=function(_0x4f9816,_0x3dd94f,_0x422daf){if(_0x4f9816[_0x0c93('0x3d')]['id']){delete _0x4f9816['body']['id'];}return db[_0x0c93('0x21')][_0x0c93('0x3b')]({'where':{'id':_0x4f9816[_0x0c93('0x3a')]['id']}})[_0x0c93('0x1b')](handleEntityNotFound(_0x3dd94f,null))['then'](function(_0x103ead){if(_0x103ead){_0x4f9816[_0x0c93('0x3d')]['IntervalId']=_0x103ead['id'];return db[_0x0c93('0x21')][_0x0c93('0x3c')](_0x4f9816['body']);}})[_0x0c93('0x1b')](respondWithResult(_0x3dd94f,null))[_0x0c93('0x39')](handleError(_0x3dd94f,null));};exports[_0x0c93('0x40')]=function(_0x4279fd,_0x2e6f29,_0x4b9abf){var _0x3279ac={};var _0x1c609a={};var _0x1ec02f;var _0x5c0e41;return db[_0x0c93('0x21')][_0x0c93('0x41')]({'where':{'id':_0x4279fd[_0x0c93('0x3a')]['id']}})[_0x0c93('0x1b')](handleEntityNotFound(_0x2e6f29,null))[_0x0c93('0x1b')](function(_0x59add2){if(_0x59add2){_0x1ec02f=_0x59add2;_0x1c609a[_0x0c93('0x23')]=_[_0x0c93('0x26')](db[_0x0c93('0x21')][_0x0c93('0x22')]);_0x1c609a[_0x0c93('0x27')]=_[_0x0c93('0x26')](_0x4279fd[_0x0c93('0x27')]);_0x1c609a[_0x0c93('0x2f')]=_[_0x0c93('0x28')](_0x1c609a[_0x0c93('0x23')],_0x1c609a['query']);_0x3279ac['attributes']=_['intersection'](_0x1c609a['model'],qs['fields'](_0x4279fd['query']['fields']));_0x3279ac[_0x0c93('0x29')]=_0x3279ac[_0x0c93('0x29')][_0x0c93('0x42')]?_0x3279ac[_0x0c93('0x29')]:_0x1c609a[_0x0c93('0x23')];_0x3279ac['order']=qs[_0x0c93('0x2e')](_0x4279fd[_0x0c93('0x27')][_0x0c93('0x2e')]);_0x3279ac[_0x0c93('0x34')]=qs[_0x0c93('0x2f')](_['pick'](_0x4279fd[_0x0c93('0x27')],_0x1c609a['filters']));if(_0x4279fd[_0x0c93('0x27')][_0x0c93('0x35')]){_0x3279ac[_0x0c93('0x34')]=_[_0x0c93('0x33')](_0x3279ac['where'],{'$or':_[_0x0c93('0x43')](_0x3279ac['attributes'],function(_0x4d3c60){var _0x3db05c={};_0x3db05c[_0x4d3c60]={'$like':'%'+_0x4279fd[_0x0c93('0x27')][_0x0c93('0x35')]+'%'};return _0x3db05c;})});}_0x3279ac=_[_0x0c93('0x33')]({},_0x3279ac,_0x4279fd[_0x0c93('0x44')]);return _0x1ec02f[_0x0c93('0x40')](_0x3279ac);}})[_0x0c93('0x1b')](function(_0x1e49a3){if(_0x1e49a3){_0x5c0e41=_0x1e49a3[_0x0c93('0x42')];if(!_0x4279fd[_0x0c93('0x27')][_0x0c93('0x2b')]('nolimit')){_0x3279ac[_0x0c93('0x2d')]=qs[_0x0c93('0x2d')](_0x4279fd[_0x0c93('0x27')][_0x0c93('0x2d')]);_0x3279ac[_0x0c93('0x16')]=qs['offset'](_0x4279fd[_0x0c93('0x27')]['offset']);}return _0x1ec02f[_0x0c93('0x40')](_0x3279ac);}})[_0x0c93('0x1b')](function(_0x51b40b){if(_0x51b40b){return _0x51b40b?{'count':_0x5c0e41,'rows':_0x51b40b}:null;}})[_0x0c93('0x1b')](respondWithResult(_0x2e6f29,null))['catch'](handleError(_0x2e6f29,null));};exports[_0x0c93('0x45')]=function(_0x2155ab,_0x121400,_0xc6fa68){return db['Interval'][_0x0c93('0x41')]({'where':{'id':_0x2155ab[_0x0c93('0x3a')]['id']}})[_0x0c93('0x1b')](handleEntityNotFound(_0x121400,null))[_0x0c93('0x1b')](function(_0x27074b){if(_0x27074b){return db[_0x0c93('0x46')][_0x0c93('0x47')](function(_0xb24a83){return db['Interval'][_0x0c93('0x3e')]({'where':{'IntervalId':_0x2155ab[_0x0c93('0x3a')]['id']},'transaction':_0xb24a83})[_0x0c93('0x1b')](function(_0x55579e){var _0x42c23d=_[_0x0c93('0x43')](_0x2155ab[_0x0c93('0x3d')],function(_0xfaeda0){delete _0xfaeda0['id'];_0xfaeda0['IntervalId']=_0x2155ab['params']['id'];return _0xfaeda0;});return db[_0x0c93('0x21')][_0x0c93('0x48')](_0x42c23d,{'transaction':_0xb24a83});});})[_0x0c93('0x1b')](function(){return db[_0x0c93('0x21')][_0x0c93('0x38')]({'where':{'IntervalId':_0x2155ab['params']['id']}});});}})[_0x0c93('0x1b')](respondWithResult(_0x121400,null))[_0x0c93('0x39')](handleError(_0x121400,null));};
\ No newline at end of file
+var _0x2e38=['getIntervals','findOne','order','pick','addIntervals','sequelize','transaction','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','../../config/logger','api','../../config/utils','../../mysqldb','../../components/extensions/rewrite','status','end','json','count','offset','limit','set','reject','save','update','then','destroy','stack','name','send','index','Interval','rawAttributes','keys','query','dateStart','dateEnd','model','attributes','intersection','length','hasOwnProperty','sort','where','filters','add','day','merge','filter','map','options','includeAll','include','findAll','rows','catch','show','fields','find','body','params','IntervalId','create'];(function(_0x1c06f4,_0x2feba6){var _0x1a727e=function(_0x2e83af){while(--_0x2e83af){_0x1c06f4['push'](_0x1c06f4['shift']());}};_0x1a727e(++_0x2feba6);}(_0x2e38,0x9f));var _0x82e3=function(_0x29595d,_0x13af63){_0x29595d=_0x29595d-0x0;var _0x2cfb06=_0x2e38[_0x29595d];return _0x2cfb06;};'use strict';var pdf=require(_0x82e3('0x0'));var emlformat=require(_0x82e3('0x1'));var rimraf=require(_0x82e3('0x2'));var zipdir=require(_0x82e3('0x3'));var jsonpatch=require(_0x82e3('0x4'));var rp=require('request-promise');var moment=require(_0x82e3('0x5'));var BPromise=require(_0x82e3('0x6'));var Mustache=require(_0x82e3('0x7'));var util=require(_0x82e3('0x8'));var path=require(_0x82e3('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x82e3('0xa'));var fs=require('fs');var _=require(_0x82e3('0xb'));var squel=require(_0x82e3('0xc'));var crypto=require(_0x82e3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x82e3('0xe'));var toCsv=require(_0x82e3('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var qs=require('../../components/parsers/qs');var logger=require(_0x82e3('0x10'))(_0x82e3('0x11'));var utils=require(_0x82e3('0x12'));var config=require('../../config/environment');var db=require(_0x82e3('0x13'))['db'];var extensions=require(_0x82e3('0x14'));function respondWithStatusCode(_0xcc209f,_0x122a95){_0x122a95=_0x122a95||0xcc;return function(_0x4442da){if(_0x4442da){return _0xcc209f['sendStatus'](_0x122a95);}return _0xcc209f[_0x82e3('0x15')](_0x122a95)[_0x82e3('0x16')]();};}function respondWithResult(_0x2e8b1e,_0x22a6f9){_0x22a6f9=_0x22a6f9||0xc8;return function(_0x119684){if(_0x119684){return _0x2e8b1e[_0x82e3('0x15')](_0x22a6f9)[_0x82e3('0x17')](_0x119684);}};}function respondWithFilteredResult(_0x585325,_0x5d2e9b){return function(_0x69fd75){if(_0x69fd75){var _0x43efde=_0x69fd75[_0x82e3('0x18')],_0x53a9ef=_0x5d2e9b[_0x82e3('0x19')],_0x56534d=_0x5d2e9b[_0x82e3('0x19')]+_0x5d2e9b[_0x82e3('0x1a')],_0x4c14b5;if(_0x56534d>=_0x43efde){_0x56534d=_0x43efde;_0x4c14b5=0xc8;}else{_0x4c14b5=0xce;}_0x585325[_0x82e3('0x15')](_0x4c14b5);return _0x585325[_0x82e3('0x1b')]('Content-Range',_0x53a9ef+'-'+_0x56534d+'/'+_0x43efde)[_0x82e3('0x17')](_0x69fd75);}return null;};}function patchUpdates(_0x4372ac){return function(_0x21813a){try{jsonpatch['apply'](_0x21813a,_0x4372ac,!![]);}catch(_0x3004f6){return BPromise[_0x82e3('0x1c')](_0x3004f6);}return _0x21813a[_0x82e3('0x1d')]();};}function saveUpdates(_0x2576b5,_0x319bc5){return function(_0x3134a1){if(_0x3134a1){return _0x3134a1[_0x82e3('0x1e')](_0x2576b5)[_0x82e3('0x1f')](function(_0x4711cb){return _0x4711cb;});}return null;};}function removeEntity(_0x534fed,_0x486558){return function(_0x59609e){if(_0x59609e){return _0x59609e[_0x82e3('0x20')]()[_0x82e3('0x1f')](function(){_0x534fed[_0x82e3('0x15')](0xcc)[_0x82e3('0x16')]();});}};}function handleEntityNotFound(_0x3cdfb8,_0x4a69e7){return function(_0x21af12){if(!_0x21af12){_0x3cdfb8['sendStatus'](0x194);}return _0x21af12;};}function handleError(_0x2ba8d6,_0x3c1978){_0x3c1978=_0x3c1978||0x1f4;return function(_0x1df5ac){logger['error'](_0x1df5ac[_0x82e3('0x21')]);if(_0x1df5ac[_0x82e3('0x22')]){delete _0x1df5ac[_0x82e3('0x22')];}_0x2ba8d6['status'](_0x3c1978)[_0x82e3('0x23')](_0x1df5ac);};}exports[_0x82e3('0x24')]=function(_0x6dd6be,_0x4415ec){var _0x59f117={},_0x17859b={},_0x423255={'count':0x0,'rows':[]};var _0x2e7bb4=db[_0x82e3('0x25')][_0x82e3('0x26')];_0x17859b['model']=_[_0x82e3('0x27')](_0x2e7bb4);var _0x3a9844={'dateStart':_0x6dd6be[_0x82e3('0x28')][_0x82e3('0x29')],'dateEnd':_0x6dd6be['query'][_0x82e3('0x2a')]};delete _0x6dd6be[_0x82e3('0x28')]['dateStart'];delete _0x6dd6be[_0x82e3('0x28')][_0x82e3('0x2a')];_0x17859b[_0x82e3('0x28')]=_[_0x82e3('0x27')](_0x6dd6be[_0x82e3('0x28')]);_0x17859b['filters']=_['intersection'](_0x17859b[_0x82e3('0x2b')],_0x17859b[_0x82e3('0x28')]);_0x59f117[_0x82e3('0x2c')]=_[_0x82e3('0x2d')](_0x17859b[_0x82e3('0x2b')],qs['fields'](_0x6dd6be['query']['fields']));_0x59f117['attributes']=_0x59f117['attributes'][_0x82e3('0x2e')]?_0x59f117[_0x82e3('0x2c')]:_0x17859b[_0x82e3('0x2b')];if(!_0x6dd6be[_0x82e3('0x28')][_0x82e3('0x2f')]('nolimit')){_0x59f117[_0x82e3('0x1a')]=qs['limit'](_0x6dd6be[_0x82e3('0x28')][_0x82e3('0x1a')]);_0x59f117[_0x82e3('0x19')]=qs[_0x82e3('0x19')](_0x6dd6be[_0x82e3('0x28')][_0x82e3('0x19')]);}_0x59f117['order']=qs[_0x82e3('0x30')](_0x6dd6be[_0x82e3('0x28')][_0x82e3('0x30')]);_0x59f117[_0x82e3('0x31')]=qs[_0x82e3('0x32')](_['pick'](_0x6dd6be['query'],_0x17859b[_0x82e3('0x32')]));if(_0x3a9844[_0x82e3('0x29')]){if(_0x3a9844[_0x82e3('0x2a')]){_0x3a9844[_0x82e3('0x2a')]=moment(_0x3a9844[_0x82e3('0x2a')])[_0x82e3('0x33')](0x1,'day');}else{_0x3a9844[_0x82e3('0x2a')]=moment(_0x3a9844[_0x82e3('0x29')])[_0x82e3('0x33')](0x1,_0x82e3('0x34'));}_[_0x82e3('0x35')](_0x59f117['where'],{'createdAt':{'$gte':_0x3a9844[_0x82e3('0x29')],'$lte':_0x3a9844[_0x82e3('0x2a')]}});}if(_0x6dd6be[_0x82e3('0x28')][_0x82e3('0x36')]){_0x59f117['where']=_[_0x82e3('0x35')](_0x59f117['where'],{'$or':_[_0x82e3('0x37')](_0x59f117[_0x82e3('0x2c')],function(_0x3e287b){var _0x5b78e5={};_0x5b78e5[_0x3e287b]={'$like':'%'+_0x6dd6be[_0x82e3('0x28')][_0x82e3('0x36')]+'%'};return _0x5b78e5;})});}_0x59f117=_[_0x82e3('0x35')]({},_0x59f117,_0x6dd6be[_0x82e3('0x38')]);var _0x707d4b={'where':_0x59f117[_0x82e3('0x31')]};return db[_0x82e3('0x25')][_0x82e3('0x18')](_0x707d4b)[_0x82e3('0x1f')](function(_0x40628a){_0x423255[_0x82e3('0x18')]=_0x40628a;if(_0x6dd6be[_0x82e3('0x28')][_0x82e3('0x39')]){_0x59f117[_0x82e3('0x3a')]=[{'all':!![]}];}return db[_0x82e3('0x25')][_0x82e3('0x3b')](_0x59f117);})[_0x82e3('0x1f')](function(_0xdfdb35){_0x423255[_0x82e3('0x3c')]=_0xdfdb35;return _0x423255;})[_0x82e3('0x1f')](respondWithFilteredResult(_0x4415ec,_0x59f117))[_0x82e3('0x3d')](handleError(_0x4415ec,null));};exports[_0x82e3('0x3e')]=function(_0x25b645,_0x3002c1){var _0x367143={'raw':!![],'where':{'id':_0x25b645['params']['id']}},_0x17eaf8={};_0x17eaf8[_0x82e3('0x2b')]=_[_0x82e3('0x27')](db[_0x82e3('0x25')][_0x82e3('0x26')]);_0x17eaf8['query']=_[_0x82e3('0x27')](_0x25b645[_0x82e3('0x28')]);_0x17eaf8[_0x82e3('0x32')]=_[_0x82e3('0x2d')](_0x17eaf8[_0x82e3('0x2b')],_0x17eaf8[_0x82e3('0x28')]);_0x367143[_0x82e3('0x2c')]=_[_0x82e3('0x2d')](_0x17eaf8[_0x82e3('0x2b')],qs[_0x82e3('0x3f')](_0x25b645['query'][_0x82e3('0x3f')]));_0x367143[_0x82e3('0x2c')]=_0x367143[_0x82e3('0x2c')][_0x82e3('0x2e')]?_0x367143[_0x82e3('0x2c')]:_0x17eaf8[_0x82e3('0x2b')];if(_0x25b645[_0x82e3('0x28')][_0x82e3('0x39')]){_0x367143[_0x82e3('0x3a')]=[{'all':!![]}];}_0x367143=_[_0x82e3('0x35')]({},_0x367143,_0x25b645[_0x82e3('0x38')]);return db[_0x82e3('0x25')][_0x82e3('0x40')](_0x367143)['then'](handleEntityNotFound(_0x3002c1,null))['then'](respondWithResult(_0x3002c1,null))[_0x82e3('0x3d')](handleError(_0x3002c1,null));};exports['create']=function(_0x41428f,_0x195872){return db[_0x82e3('0x25')]['create'](_0x41428f[_0x82e3('0x41')],{})[_0x82e3('0x1f')](respondWithResult(_0x195872,0xc9))[_0x82e3('0x3d')](handleError(_0x195872,null));};exports[_0x82e3('0x1e')]=function(_0xfcacf5,_0x3615be){if(_0xfcacf5['body']['id']){delete _0xfcacf5[_0x82e3('0x41')]['id'];}return db[_0x82e3('0x25')][_0x82e3('0x40')]({'where':{'id':_0xfcacf5['params']['id']}})[_0x82e3('0x1f')](handleEntityNotFound(_0x3615be,null))['then'](saveUpdates(_0xfcacf5[_0x82e3('0x41')],null))[_0x82e3('0x1f')](respondWithResult(_0x3615be,null))[_0x82e3('0x3d')](handleError(_0x3615be,null));};exports['destroy']=function(_0x1581f0,_0x3cdfcf){return db[_0x82e3('0x25')][_0x82e3('0x40')]({'where':{'id':_0x1581f0[_0x82e3('0x42')]['id']}})[_0x82e3('0x1f')](handleEntityNotFound(_0x3cdfcf,null))[_0x82e3('0x1f')](removeEntity(_0x3cdfcf,null))[_0x82e3('0x3d')](handleError(_0x3cdfcf,null));};exports['addInterval']=function(_0x16bb37,_0x441e92,_0x4ceb6d){if(_0x16bb37['body']['id']){delete _0x16bb37[_0x82e3('0x41')]['id'];}return db[_0x82e3('0x25')]['find']({'where':{'id':_0x16bb37['params']['id']}})[_0x82e3('0x1f')](handleEntityNotFound(_0x441e92,null))['then'](function(_0x5572bd){if(_0x5572bd){_0x16bb37[_0x82e3('0x41')][_0x82e3('0x43')]=_0x5572bd['id'];return db[_0x82e3('0x25')][_0x82e3('0x44')](_0x16bb37[_0x82e3('0x41')]);}})[_0x82e3('0x1f')](respondWithResult(_0x441e92,null))[_0x82e3('0x3d')](handleError(_0x441e92,null));};exports[_0x82e3('0x45')]=function(_0x5727c0,_0x4a103e,_0x220c0d){var _0x1042ed={};var _0x1e19ca={};var _0x59c1f1;var _0x2fca34;return db['Interval'][_0x82e3('0x46')]({'where':{'id':_0x5727c0[_0x82e3('0x42')]['id']}})[_0x82e3('0x1f')](handleEntityNotFound(_0x4a103e,null))[_0x82e3('0x1f')](function(_0x43ff2e){if(_0x43ff2e){_0x59c1f1=_0x43ff2e;_0x1e19ca[_0x82e3('0x2b')]=_[_0x82e3('0x27')](db['Interval']['rawAttributes']);_0x1e19ca[_0x82e3('0x28')]=_['keys'](_0x5727c0[_0x82e3('0x28')]);_0x1e19ca['filters']=_['intersection'](_0x1e19ca[_0x82e3('0x2b')],_0x1e19ca[_0x82e3('0x28')]);_0x1042ed['attributes']=_[_0x82e3('0x2d')](_0x1e19ca[_0x82e3('0x2b')],qs[_0x82e3('0x3f')](_0x5727c0['query'][_0x82e3('0x3f')]));_0x1042ed[_0x82e3('0x2c')]=_0x1042ed[_0x82e3('0x2c')][_0x82e3('0x2e')]?_0x1042ed['attributes']:_0x1e19ca[_0x82e3('0x2b')];_0x1042ed[_0x82e3('0x47')]=qs[_0x82e3('0x30')](_0x5727c0[_0x82e3('0x28')][_0x82e3('0x30')]);_0x1042ed[_0x82e3('0x31')]=qs[_0x82e3('0x32')](_[_0x82e3('0x48')](_0x5727c0[_0x82e3('0x28')],_0x1e19ca[_0x82e3('0x32')]));if(_0x5727c0[_0x82e3('0x28')]['filter']){_0x1042ed['where']=_[_0x82e3('0x35')](_0x1042ed[_0x82e3('0x31')],{'$or':_['map'](_0x1042ed[_0x82e3('0x2c')],function(_0x3c8c81){var _0x301b1f={};_0x301b1f[_0x3c8c81]={'$like':'%'+_0x5727c0['query'][_0x82e3('0x36')]+'%'};return _0x301b1f;})});}_0x1042ed=_['merge']({},_0x1042ed,_0x5727c0[_0x82e3('0x38')]);return _0x59c1f1[_0x82e3('0x45')](_0x1042ed);}})[_0x82e3('0x1f')](function(_0x515930){if(_0x515930){_0x2fca34=_0x515930[_0x82e3('0x2e')];if(!_0x5727c0[_0x82e3('0x28')]['hasOwnProperty']('nolimit')){_0x1042ed['limit']=qs[_0x82e3('0x1a')](_0x5727c0[_0x82e3('0x28')]['limit']);_0x1042ed['offset']=qs['offset'](_0x5727c0[_0x82e3('0x28')][_0x82e3('0x19')]);}return _0x59c1f1['getIntervals'](_0x1042ed);}})['then'](function(_0x2b55e0){if(_0x2b55e0){return _0x2b55e0?{'count':_0x2fca34,'rows':_0x2b55e0}:null;}})[_0x82e3('0x1f')](respondWithResult(_0x4a103e,null))[_0x82e3('0x3d')](handleError(_0x4a103e,null));};exports[_0x82e3('0x49')]=function(_0xef7bcd,_0x4ed064,_0x1706b2){return db[_0x82e3('0x25')][_0x82e3('0x46')]({'where':{'id':_0xef7bcd[_0x82e3('0x42')]['id']}})[_0x82e3('0x1f')](handleEntityNotFound(_0x4ed064,null))[_0x82e3('0x1f')](function(_0x4ae6f4){if(_0x4ae6f4){return db[_0x82e3('0x4a')][_0x82e3('0x4b')](function(_0x494cef){return db['Interval']['destroy']({'where':{'IntervalId':_0xef7bcd[_0x82e3('0x42')]['id']},'transaction':_0x494cef})[_0x82e3('0x1f')](function(_0x4430d0){var _0x51b0fc=_[_0x82e3('0x37')](_0xef7bcd[_0x82e3('0x41')],function(_0xa78d3c){delete _0xa78d3c['id'];_0xa78d3c[_0x82e3('0x43')]=_0xef7bcd['params']['id'];return _0xa78d3c;});return db['Interval']['bulkCreate'](_0x51b0fc,{'transaction':_0x494cef});});})['then'](function(){return db[_0x82e3('0x25')][_0x82e3('0x3b')]({'where':{'IntervalId':_0xef7bcd[_0x82e3('0x42')]['id']}});});}})[_0x82e3('0x1f')](respondWithResult(_0x4ed064,null))[_0x82e3('0x3d')](handleError(_0x4ed064,null));};
\ No newline at end of file
index f189c77..33d1349 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90b1=['lodash','util','api','moment','bluebird','request-promise','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite'];(function(_0xd6bcd6,_0x4b0adf){var _0x4c907c=function(_0x2a5fbb){while(--_0x2a5fbb){_0xd6bcd6['push'](_0xd6bcd6['shift']());}};_0x4c907c(++_0x4b0adf);}(_0x90b1,0x1d4));var _0x190b=function(_0x7da12d,_0x5d1d84){_0x7da12d=_0x7da12d-0x0;var _0x5719b4=_0x90b1[_0x7da12d];return _0x5719b4;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require('../../config/logger')(_0x190b('0x2'));var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var rp=require(_0x190b('0x5'));var attributes=require(_0x190b('0x6'));var extensions=require(_0x190b('0x7'));module[_0x190b('0x8')]=function(_0x442212,_0x185c6e){return _0x442212[_0x190b('0x9')](_0x190b('0xa'),attributes,{'tableName':_0x190b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x25b32d,_0x1fd0a0){extensions[_0x190b('0xc')](_0x442212,_0x25b32d);},'afterBulkCreate':function(_0x3d3b82,_0x228003,_0x117cf5){_0x117cf5();extensions['rewrite'](_0x442212,_0x3d3b82[0x0]);},'afterUpdate':function(_0x4c2a1d,_0x189486){extensions[_0x190b('0xc')](_0x442212,_0x4c2a1d);},'afterDestroy':function(_0x3851e8,_0x3c5042){extensions['rewrite'](_0x442212,_0x3851e8);}}});};
\ No newline at end of file
+var _0xbb54=['Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment','bluebird','./interval.attributes','../../components/extensions/rewrite','exports'];(function(_0x449d6c,_0x18fdfb){var _0x4e37fa=function(_0x22d897){while(--_0x22d897){_0x449d6c['push'](_0x449d6c['shift']());}};_0x4e37fa(++_0x18fdfb);}(_0xbb54,0x1cb));var _0x4bb5=function(_0x3eb713,_0x437874){_0x3eb713=_0x3eb713-0x0;var _0x1d7128=_0xbb54[_0x3eb713];return _0x1d7128;};'use strict';var _=require(_0x4bb5('0x0'));var util=require(_0x4bb5('0x1'));var logger=require(_0x4bb5('0x2'))(_0x4bb5('0x3'));var moment=require(_0x4bb5('0x4'));var BPromise=require(_0x4bb5('0x5'));var rp=require('request-promise');var attributes=require(_0x4bb5('0x6'));var extensions=require(_0x4bb5('0x7'));module[_0x4bb5('0x8')]=function(_0xe22400,_0x3fef1a){return _0xe22400['define'](_0x4bb5('0x9'),attributes,{'tableName':_0x4bb5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x26b6b8,_0x47ccbf){extensions[_0x4bb5('0xb')](_0xe22400,_0x26b6b8);},'afterBulkCreate':function(_0x440633,_0x44afd7,_0x370c8f){_0x370c8f();extensions[_0x4bb5('0xb')](_0xe22400,_0x440633[0x0]);},'afterUpdate':function(_0x12bf4d,_0x3f8722){extensions['rewrite'](_0xe22400,_0x12bf4d);},'afterDestroy':function(_0x58de7f,_0x57ead4){extensions[_0x4bb5('0xb')](_0xe22400,_0x58de7f);}}});};
\ No newline at end of file
index 606e8af..bd844e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f12=['options','raw','where','attributes','include','map','model','stringify','catch','find','ShowInterval','debug','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Interval,\x20%s,\x20%s','Interval,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','GetInterval','Interval','findAll'];(function(_0x21f931,_0x598b2d){var _0x3f083c=function(_0x1c7c49){while(--_0x1c7c49){_0x21f931['push'](_0x21f931['shift']());}};_0x3f083c(++_0x598b2d);}(_0x8f12,0x18d));var _0x28f1=function(_0x12f5f7,_0xa58b52){_0x12f5f7=_0x12f5f7-0x0;var _0x345c1b=_0x8f12[_0x12f5f7];return _0x345c1b;};'use strict';var _=require(_0x28f1('0x0'));var util=require('util');var moment=require(_0x28f1('0x1'));var BPromise=require('bluebird');var rs=require(_0x28f1('0x2'));var fs=require('fs');var db=require(_0x28f1('0x3'))['db'];var utils=require(_0x28f1('0x4'));var logger=require(_0x28f1('0x5'))(_0x28f1('0x6'));var config=require(_0x28f1('0x7'));var jayson=require(_0x28f1('0x8'));var client=jayson['client'][_0x28f1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a57c4,_0x6e117d,_0x31a6e5){return new BPromise(function(_0x3e462a,_0x478555){return client[_0x28f1('0xa')](_0x5a57c4,_0x31a6e5)[_0x28f1('0xb')](function(_0x3c96b3){logger[_0x28f1('0xc')](_0x28f1('0xd'),_0x6e117d,'request\x20sent');logger['debug'](_0x28f1('0xe'),_0x6e117d,'request\x20sent',JSON['stringify'](_0x3c96b3));if(_0x3c96b3[_0x28f1('0xf')]){if(_0x3c96b3[_0x28f1('0xf')][_0x28f1('0x10')]===0x1f4){logger['error'](_0x28f1('0xd'),_0x6e117d,_0x3c96b3[_0x28f1('0xf')][_0x28f1('0x11')]);return _0x478555(_0x3c96b3[_0x28f1('0xf')][_0x28f1('0x11')]);}logger[_0x28f1('0xf')](_0x28f1('0xd'),_0x6e117d,_0x3c96b3[_0x28f1('0xf')][_0x28f1('0x11')]);return _0x3e462a(_0x3c96b3[_0x28f1('0xf')]['message']);}else{logger[_0x28f1('0xc')](_0x28f1('0xd'),_0x6e117d,_0x28f1('0x12'));_0x3e462a(_0x3c96b3[_0x28f1('0x13')][_0x28f1('0x11')]);}})['catch'](function(_0x98b6c){logger[_0x28f1('0xf')](_0x28f1('0xd'),_0x6e117d,_0x98b6c);_0x478555(_0x98b6c);});});}exports[_0x28f1('0x14')]=function(_0x39ebef){var _0x37fc67=this;return new Promise(function(_0x2d376,_0x4f0b5b){return db[_0x28f1('0x15')][_0x28f1('0x16')]({'raw':_0x39ebef[_0x28f1('0x17')]?_0x39ebef[_0x28f1('0x17')][_0x28f1('0x18')]===undefined?!![]:![]:!![],'where':_0x39ebef[_0x28f1('0x17')]?_0x39ebef[_0x28f1('0x17')][_0x28f1('0x19')]||null:null,'attributes':_0x39ebef[_0x28f1('0x17')]?_0x39ebef[_0x28f1('0x17')][_0x28f1('0x1a')]||null:null,'limit':_0x39ebef[_0x28f1('0x17')]?_0x39ebef[_0x28f1('0x17')]['limit']||null:null,'include':_0x39ebef['options']?_0x39ebef[_0x28f1('0x17')][_0x28f1('0x1b')]?_[_0x28f1('0x1c')](_0x39ebef[_0x28f1('0x17')][_0x28f1('0x1b')],function(_0x2bb75b){return{'model':db[_0x2bb75b[_0x28f1('0x1d')]],'as':_0x2bb75b['as'],'attributes':_0x2bb75b[_0x28f1('0x1a')],'include':_0x2bb75b['include']?_['map'](_0x2bb75b[_0x28f1('0x1b')],function(_0x3667bb){return{'model':db[_0x3667bb[_0x28f1('0x1d')]],'as':_0x3667bb['as'],'attributes':_0x3667bb[_0x28f1('0x1a')],'include':_0x3667bb[_0x28f1('0x1b')]?_[_0x28f1('0x1c')](_0x3667bb[_0x28f1('0x1b')],function(_0x1c10d7){return{'model':db[_0x1c10d7['model']],'as':_0x1c10d7['as'],'attributes':_0x1c10d7[_0x28f1('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x175374){logger['info'](_0x28f1('0x14'),_0x39ebef);logger['debug'](_0x28f1('0x14'),_0x39ebef,JSON[_0x28f1('0x1e')](_0x175374));_0x2d376(_0x175374);})[_0x28f1('0x1f')](function(_0x45c59e){logger['error'](_0x28f1('0x14'),_0x45c59e[_0x28f1('0x11')],_0x39ebef);_0x4f0b5b(_0x37fc67['error'](0x1f4,_0x45c59e[_0x28f1('0x11')]));});});};exports['ShowInterval']=function(_0x4f910a){var _0x24c3dd=this;return new Promise(function(_0x266df0,_0x18a55f){return db['Interval'][_0x28f1('0x20')]({'raw':_0x4f910a['options']?_0x4f910a[_0x28f1('0x17')][_0x28f1('0x18')]===undefined?!![]:![]:!![],'where':_0x4f910a[_0x28f1('0x17')]?_0x4f910a[_0x28f1('0x17')][_0x28f1('0x19')]||null:null,'attributes':_0x4f910a[_0x28f1('0x17')]?_0x4f910a[_0x28f1('0x17')][_0x28f1('0x1a')]||null:null,'include':_0x4f910a['options']?_0x4f910a['options'][_0x28f1('0x1b')]?_[_0x28f1('0x1c')](_0x4f910a[_0x28f1('0x17')][_0x28f1('0x1b')],function(_0x566656){return{'model':db[_0x566656[_0x28f1('0x1d')]],'as':_0x566656['as'],'attributes':_0x566656['attributes'],'include':_0x566656[_0x28f1('0x1b')]?_[_0x28f1('0x1c')](_0x566656[_0x28f1('0x1b')],function(_0x47a9cf){return{'model':db[_0x47a9cf[_0x28f1('0x1d')]],'as':_0x47a9cf['as'],'attributes':_0x47a9cf[_0x28f1('0x1a')],'include':_0x47a9cf[_0x28f1('0x1b')]?_[_0x28f1('0x1c')](_0x47a9cf[_0x28f1('0x1b')],function(_0x4800b9){return{'model':db[_0x4800b9['model']],'as':_0x4800b9['as'],'attributes':_0x4800b9[_0x28f1('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1facc1){logger['info'](_0x28f1('0x21'),_0x4f910a);logger[_0x28f1('0x22')](_0x28f1('0x21'),_0x4f910a,JSON[_0x28f1('0x1e')](_0x1facc1));_0x266df0(_0x1facc1);})[_0x28f1('0x1f')](function(_0x383488){logger[_0x28f1('0xf')](_0x28f1('0x21'),_0x383488[_0x28f1('0x11')],_0x4f910a);_0x18a55f(_0x24c3dd[_0x28f1('0xf')](0x1f4,_0x383488[_0x28f1('0x11')]));});});};
\ No newline at end of file
+var _0x4cc0=['Interval,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','Interval','findAll','options','where','attributes','map','model','include','GetInterval','ShowInterval','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info'];(function(_0x494368,_0x56d9a3){var _0x1491a3=function(_0x81e189){while(--_0x81e189){_0x494368['push'](_0x494368['shift']());}};_0x1491a3(++_0x56d9a3);}(_0x4cc0,0xec));var _0x04cc=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x4cc0[_0x12d033];return _0x3b4e80;};'use strict';var _=require(_0x04cc('0x0'));var util=require(_0x04cc('0x1'));var moment=require('moment');var BPromise=require(_0x04cc('0x2'));var rs=require(_0x04cc('0x3'));var fs=require('fs');var db=require(_0x04cc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x04cc('0x5'))(_0x04cc('0x6'));var config=require(_0x04cc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x04cc('0x8')][_0x04cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x239a09,_0x40741c,_0x4f7b01){return new BPromise(function(_0x3a3b1a,_0x41c2b0){return client['request'](_0x239a09,_0x4f7b01)[_0x04cc('0xa')](function(_0x39d74a){logger[_0x04cc('0xb')](_0x04cc('0xc'),_0x40741c,_0x04cc('0xd'));logger[_0x04cc('0xe')]('Interval,\x20%s,\x20%s,\x20%s',_0x40741c,_0x04cc('0xd'),JSON[_0x04cc('0xf')](_0x39d74a));if(_0x39d74a['error']){if(_0x39d74a[_0x04cc('0x10')]['code']===0x1f4){logger[_0x04cc('0x10')]('Interval,\x20%s,\x20%s',_0x40741c,_0x39d74a[_0x04cc('0x10')]['message']);return _0x41c2b0(_0x39d74a[_0x04cc('0x10')]['message']);}logger['error'](_0x04cc('0xc'),_0x40741c,_0x39d74a['error'][_0x04cc('0x11')]);return _0x3a3b1a(_0x39d74a[_0x04cc('0x10')][_0x04cc('0x11')]);}else{logger[_0x04cc('0xb')](_0x04cc('0xc'),_0x40741c,'request\x20sent');_0x3a3b1a(_0x39d74a[_0x04cc('0x12')][_0x04cc('0x11')]);}})[_0x04cc('0x13')](function(_0x413076){logger['error'](_0x04cc('0xc'),_0x40741c,_0x413076);_0x41c2b0(_0x413076);});});}exports['GetInterval']=function(_0xe9875c){var _0x55419e=this;return new Promise(function(_0x443491,_0x5f4801){return db[_0x04cc('0x14')][_0x04cc('0x15')]({'raw':_0xe9875c[_0x04cc('0x16')]?_0xe9875c['options']['raw']===undefined?!![]:![]:!![],'where':_0xe9875c['options']?_0xe9875c[_0x04cc('0x16')][_0x04cc('0x17')]||null:null,'attributes':_0xe9875c['options']?_0xe9875c[_0x04cc('0x16')][_0x04cc('0x18')]||null:null,'limit':_0xe9875c[_0x04cc('0x16')]?_0xe9875c['options']['limit']||null:null,'include':_0xe9875c[_0x04cc('0x16')]?_0xe9875c[_0x04cc('0x16')]['include']?_[_0x04cc('0x19')](_0xe9875c[_0x04cc('0x16')]['include'],function(_0x59a591){return{'model':db[_0x59a591[_0x04cc('0x1a')]],'as':_0x59a591['as'],'attributes':_0x59a591['attributes'],'include':_0x59a591[_0x04cc('0x1b')]?_[_0x04cc('0x19')](_0x59a591[_0x04cc('0x1b')],function(_0x3ada17){return{'model':db[_0x3ada17[_0x04cc('0x1a')]],'as':_0x3ada17['as'],'attributes':_0x3ada17[_0x04cc('0x18')],'include':_0x3ada17['include']?_[_0x04cc('0x19')](_0x3ada17['include'],function(_0x1a0d8d){return{'model':db[_0x1a0d8d[_0x04cc('0x1a')]],'as':_0x1a0d8d['as'],'attributes':_0x1a0d8d[_0x04cc('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55af2a){logger[_0x04cc('0xb')](_0x04cc('0x1c'),_0xe9875c);logger[_0x04cc('0xe')](_0x04cc('0x1c'),_0xe9875c,JSON[_0x04cc('0xf')](_0x55af2a));_0x443491(_0x55af2a);})[_0x04cc('0x13')](function(_0x12c739){logger[_0x04cc('0x10')]('GetInterval',_0x12c739[_0x04cc('0x11')],_0xe9875c);_0x5f4801(_0x55419e[_0x04cc('0x10')](0x1f4,_0x12c739[_0x04cc('0x11')]));});});};exports[_0x04cc('0x1d')]=function(_0x384c6e){var _0x17e317=this;return new Promise(function(_0x2f0a64,_0x5ac44f){return db['Interval'][_0x04cc('0x1e')]({'raw':_0x384c6e['options']?_0x384c6e[_0x04cc('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x384c6e[_0x04cc('0x16')]?_0x384c6e[_0x04cc('0x16')]['where']||null:null,'attributes':_0x384c6e[_0x04cc('0x16')]?_0x384c6e['options'][_0x04cc('0x18')]||null:null,'include':_0x384c6e[_0x04cc('0x16')]?_0x384c6e[_0x04cc('0x16')][_0x04cc('0x1b')]?_[_0x04cc('0x19')](_0x384c6e[_0x04cc('0x16')]['include'],function(_0x4de076){return{'model':db[_0x4de076[_0x04cc('0x1a')]],'as':_0x4de076['as'],'attributes':_0x4de076[_0x04cc('0x18')],'include':_0x4de076[_0x04cc('0x1b')]?_[_0x04cc('0x19')](_0x4de076[_0x04cc('0x1b')],function(_0x141ec7){return{'model':db[_0x141ec7[_0x04cc('0x1a')]],'as':_0x141ec7['as'],'attributes':_0x141ec7['attributes'],'include':_0x141ec7[_0x04cc('0x1b')]?_[_0x04cc('0x19')](_0x141ec7[_0x04cc('0x1b')],function(_0x129c65){return{'model':db[_0x129c65[_0x04cc('0x1a')]],'as':_0x129c65['as'],'attributes':_0x129c65['attributes']};}):[]};}):[]};}):[]:[]})[_0x04cc('0xa')](function(_0x38baa4){logger[_0x04cc('0xb')](_0x04cc('0x1d'),_0x384c6e);logger['debug'](_0x04cc('0x1d'),_0x384c6e,JSON[_0x04cc('0xf')](_0x38baa4));_0x2f0a64(_0x38baa4);})[_0x04cc('0x13')](function(_0x51d426){logger[_0x04cc('0x10')](_0x04cc('0x1d'),_0x51d426[_0x04cc('0x11')],_0x384c6e);_0x5ac44f(_0x17e317[_0x04cc('0x10')](0x1f4,_0x51d426[_0x04cc('0x11')]));});});};
\ No newline at end of file
index 6fed96c..849ad1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x2034de,_0x10b170){var _0x49dfa1=function(_0x3def4b){while(--_0x3def4b){_0x2034de['push'](_0x2034de['shift']());}};_0x49dfa1(++_0x10b170);}(_0x2032,0xd9));var _0x2203=function(_0x140b40,_0x555a13){_0x140b40=_0x140b40-0x0;var _0x920456=_0x2032[_0x140b40];return _0x920456;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router;
\ No newline at end of file
+var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x1ac6a3,_0x1699af){var _0x5cea4b=function(_0x1f29a8){while(--_0x1f29a8){_0x1ac6a3['push'](_0x1ac6a3['shift']());}};_0x5cea4b(++_0x1699af);}(_0xdb28,0x106));var _0x8db2=function(_0x38b741,_0x5e1206){_0x38b741=_0x38b741-0x0;var _0x5039be=_0xdb28[_0x38b741];return _0x5039be;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router;
\ No newline at end of file
index 43f57f0..ebd54ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','toString','utf8','end','statusCode','json','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','remoteAddress','socket','bluebird','https','../../config/logger','support','3eAmWpBVP0'];(function(_0xa6c516,_0x1c1595){var _0x45cddf=function(_0x265935){while(--_0x265935){_0xa6c516['push'](_0xa6c516['shift']());}};_0x45cddf(++_0x1c1595);}(_0xe706,0xa3));var _0x6e70=function(_0xdd31c,_0x484018){_0xdd31c=_0xdd31c-0x0;var _0x11b6ce=_0xe706[_0xdd31c];return _0x11b6ce;};'use strict';var BPromise=require(_0x6e70('0x0'));var https=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var USERNAME=_0x6e70('0x3');var PASSWORD=_0x6e70('0x4');function openIssue(_0x2ca810,_0x7dfbc3){var _0x142c27={'fields':{'project':{'key':_0x2ca810[_0x6e70('0x5')]||_0x6e70('0x6')},'summary':(_0x2ca810[_0x6e70('0x7')]||_0x6e70('0x8'))+_0x6e70('0x9')+_0x2ca810['ip'],'description':_0x2ca810[_0x6e70('0xa')]||JSON[_0x6e70('0xb')](_0x2ca810),'issuetype':{'name':_0x2ca810[_0x6e70('0xc')]||_0x6e70('0xd')}}};_0x142c27[_0x6e70('0xe')][_0x6e70('0xf')]=_0x2ca810[_0x6e70('0x10')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x11')]=_0x2ca810[_0x6e70('0x12')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x13')]=_0x2ca810[_0x6e70('0x14')];_0x142c27[_0x6e70('0xe')]['customfield_11503']=_0x2ca810['name'];_0x142c27[_0x6e70('0xe')][_0x6e70('0x15')]=_0x2ca810[_0x6e70('0x16')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x17')]=_0x2ca810['ip'];var _0x310eb7={'host':_0x6e70('0x18'),'port':0x1bb,'path':_0x6e70('0x19'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x6e70('0x1a')]('base64')}};var _0x53aed0=JSON[_0x6e70('0xb')](_0x142c27);var _0x22c50c=https['request'](_0x310eb7,function(_0x24f3ac){_0x24f3ac['setEncoding'](_0x6e70('0x1b'));var _0x161f23='';_0x24f3ac['on']('data',function(_0x49029f){_0x161f23+=_0x49029f;});_0x24f3ac['on'](_0x6e70('0x1c'),function(){if(_0x7dfbc3){return _0x7dfbc3['status'](_0x24f3ac[_0x6e70('0x1d')])[_0x6e70('0x1e')](JSON['parse'](_0x161f23));}});});_0x22c50c['on']('error',function(_0xc238ba){if(_0x7dfbc3){return _0x7dfbc3[_0x6e70('0x1f')](0x1f4)[_0x6e70('0x1e')]({'errors':[{'message':_0x6e70('0x20'),'type':_0x6e70('0x21')}]});}});_0x22c50c[_0x6e70('0x22')](_0x53aed0);_0x22c50c[_0x6e70('0x1c')]();}exports[_0x6e70('0x23')]=openIssue;exports[_0x6e70('0x24')]=function(_0xb29a2a,_0x4a0cfe){_0xb29a2a[_0x6e70('0x25')]['ip']=_0xb29a2a[_0x6e70('0x26')][_0x6e70('0x27')]||_0xb29a2a['connection'][_0x6e70('0x28')]||_0xb29a2a[_0x6e70('0x29')][_0x6e70('0x28')]||_0xb29a2a['connection'][_0x6e70('0x29')]['remoteAddress'];return openIssue(_0xb29a2a['body'],_0x4a0cfe);};
\ No newline at end of file
+var _0xd8b0=['fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','remoteAddress','socket','connection','bluebird','https','3eAmWpBVP0','key','Report','\x20from\x20','description','issuetype','Bug','customfield_11500','email'];(function(_0x1f8999,_0x58ef02){var _0x4a4d99=function(_0x3ed847){while(--_0x3ed847){_0x1f8999['push'](_0x1f8999['shift']());}};_0x4a4d99(++_0x58ef02);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require(_0x0d8b('0x0'));var https=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var USERNAME='support';var PASSWORD=_0x0d8b('0x2');function openIssue(_0x5b9b89,_0x43bca1){var _0x364286={'fields':{'project':{'key':_0x5b9b89[_0x0d8b('0x3')]||'MOTGUI'},'summary':(_0x5b9b89['summary']||_0x0d8b('0x4'))+_0x0d8b('0x5')+_0x5b9b89['ip'],'description':_0x5b9b89[_0x0d8b('0x6')]||JSON['stringify'](_0x5b9b89),'issuetype':{'name':_0x5b9b89[_0x0d8b('0x7')]||_0x0d8b('0x8')}}};_0x364286['fields'][_0x0d8b('0x9')]=_0x5b9b89[_0x0d8b('0xa')];_0x364286[_0x0d8b('0xb')][_0x0d8b('0xc')]=_0x5b9b89[_0x0d8b('0xd')];_0x364286[_0x0d8b('0xb')][_0x0d8b('0xe')]=_0x5b9b89[_0x0d8b('0xf')];_0x364286['fields'][_0x0d8b('0x10')]=_0x5b9b89['name'];_0x364286[_0x0d8b('0xb')][_0x0d8b('0x11')]=_0x5b9b89[_0x0d8b('0x12')];_0x364286[_0x0d8b('0xb')][_0x0d8b('0x13')]=_0x5b9b89['ip'];var _0x32bb1a={'host':_0x0d8b('0x14'),'port':0x1bb,'path':_0x0d8b('0x15'),'method':_0x0d8b('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x0d8b('0x17'),'Authorization':_0x0d8b('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x0d8b('0x19')](_0x0d8b('0x1a'))}};var _0x2d4e1c=JSON['stringify'](_0x364286);var _0x23eb7b=https[_0x0d8b('0x1b')](_0x32bb1a,function(_0x17f7df){_0x17f7df[_0x0d8b('0x1c')](_0x0d8b('0x1d'));var _0x5cd485='';_0x17f7df['on'](_0x0d8b('0x1e'),function(_0x4586c2){_0x5cd485+=_0x4586c2;});_0x17f7df['on'](_0x0d8b('0x1f'),function(){if(_0x43bca1){return _0x43bca1[_0x0d8b('0x20')](_0x17f7df[_0x0d8b('0x21')])[_0x0d8b('0x22')](JSON[_0x0d8b('0x23')](_0x5cd485));}});});_0x23eb7b['on'](_0x0d8b('0x24'),function(_0x4a15bf){if(_0x43bca1){return _0x43bca1[_0x0d8b('0x20')](0x1f4)[_0x0d8b('0x22')]({'errors':[{'message':_0x0d8b('0x25'),'type':_0x0d8b('0x26')}]});}});_0x23eb7b[_0x0d8b('0x27')](_0x2d4e1c);_0x23eb7b[_0x0d8b('0x1f')]();}exports[_0x0d8b('0x28')]=openIssue;exports[_0x0d8b('0x29')]=function(_0x50ec1e,_0x4f0a1a){_0x50ec1e[_0x0d8b('0x2a')]['ip']=_0x50ec1e['headers']['x-forwarded-for']||_0x50ec1e['connection'][_0x0d8b('0x2b')]||_0x50ec1e[_0x0d8b('0x2c')][_0x0d8b('0x2b')]||_0x50ec1e[_0x0d8b('0x2d')][_0x0d8b('0x2c')][_0x0d8b('0x2b')];return openIssue(_0x50ec1e[_0x0d8b('0x2a')],_0x4f0a1a);};
\ No newline at end of file
index 94444af..128aaa8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad78=['show','post','create','put','/:id','update','delete','destroy','exports','multer','express','Router','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x439e3d,_0x58c93d){var _0x577dd1=function(_0x4a0e93){while(--_0x4a0e93){_0x439e3d['push'](_0x439e3d['shift']());}};_0x577dd1(++_0x58c93d);}(_0xad78,0x149));var _0x8ad7=function(_0x37219d,_0x5572f6){_0x37219d=_0x37219d-0x0;var _0x4338aa=_0xad78[_0x37219d];return _0x4338aa;};'use strict';var multer=require(_0x8ad7('0x0'));var util=require('util');var path=require('path');var express=require(_0x8ad7('0x1'));var router=express[_0x8ad7('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x8ad7('0x3'));var config=require(_0x8ad7('0x4'));var controller=require(_0x8ad7('0x5'));router[_0x8ad7('0x6')]('/',auth[_0x8ad7('0x7')](),controller[_0x8ad7('0x8')]);router[_0x8ad7('0x6')](_0x8ad7('0x9'),auth[_0x8ad7('0x7')](),controller[_0x8ad7('0xa')]);router['get']('/:id',auth[_0x8ad7('0x7')](),controller[_0x8ad7('0xb')]);router[_0x8ad7('0xc')]('/',auth[_0x8ad7('0x7')](),controller[_0x8ad7('0xd')]);router[_0x8ad7('0xe')](_0x8ad7('0xf'),auth['isAuthenticated'](),controller[_0x8ad7('0x10')]);router[_0x8ad7('0x11')](_0x8ad7('0xf'),auth['isAuthenticated'](),controller[_0x8ad7('0x12')]);module[_0x8ad7('0x13')]=router;
\ No newline at end of file
+var _0xb815=['/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','multer','util','Router','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb815,0x160));var _0x5b81=function(_0x461a5b,_0xe01763){_0x461a5b=_0x461a5b-0x0;var _0x39c376=_0xb815[_0x461a5b];return _0x39c376;};'use strict';var multer=require(_0x5b81('0x0'));var util=require(_0x5b81('0x1'));var path=require('path');var express=require('express');var router=express[_0x5b81('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x5b81('0x3'));var config=require(_0x5b81('0x4'));var controller=require(_0x5b81('0x5'));router[_0x5b81('0x6')]('/',auth['isAuthenticated'](),controller[_0x5b81('0x7')]);router[_0x5b81('0x6')](_0x5b81('0x8'),auth[_0x5b81('0x9')](),controller[_0x5b81('0xa')]);router[_0x5b81('0x6')](_0x5b81('0xb'),auth[_0x5b81('0x9')](),controller[_0x5b81('0xc')]);router[_0x5b81('0xd')]('/',auth[_0x5b81('0x9')](),controller[_0x5b81('0xe')]);router[_0x5b81('0xf')]('/:id',auth[_0x5b81('0x9')](),controller[_0x5b81('0x10')]);router['delete'](_0x5b81('0xb'),auth[_0x5b81('0x9')](),controller[_0x5b81('0x11')]);module['exports']=router;
\ No newline at end of file
index 9c0f086..14704b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa902=['long','sequelize','exports','STRING','TEXT'];(function(_0x5deda9,_0xb06c05){var _0x453001=function(_0x35d17e){while(--_0x35d17e){_0x5deda9['push'](_0x5deda9['shift']());}};_0x453001(++_0xb06c05);}(_0xa902,0x8d));var _0x2a90=function(_0x56e32e,_0x9eb2f6){_0x56e32e=_0x56e32e-0x0;var _0x2a757b=_0xa902[_0x56e32e];return _0x2a757b;};'use strict';var Sequelize=require(_0x2a90('0x0'));module[_0x2a90('0x1')]={'question':{'type':Sequelize[_0x2a90('0x2')]},'answer':{'type':Sequelize[_0x2a90('0x3')](_0x2a90('0x4'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x2a90('0x2')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2a90('0x2')]},'calleridnum':{'type':Sequelize[_0x2a90('0x2')]},'questionId':{'type':Sequelize[_0x2a90('0x2')]}};
\ No newline at end of file
+var _0xd64b=['long','sequelize','STRING'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0xd64b,0xc1));var _0xbd64=function(_0x13ef3f,_0x54b026){_0x13ef3f=_0x13ef3f-0x0;var _0x2fe438=_0xd64b[_0x13ef3f];return _0x2fe438;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'question':{'type':Sequelize[_0xbd64('0x1')]},'answer':{'type':Sequelize['TEXT'](_0xbd64('0x2'))},'membername':{'type':Sequelize[_0xbd64('0x1')]},'projectname':{'type':Sequelize[_0xbd64('0x1')]},'queue':{'type':Sequelize[_0xbd64('0x1')]},'uniqueid':{'type':Sequelize[_0xbd64('0x1')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 0cee0fb..839cf03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x700f=['bluebird','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','save','destroy','error','name','send','index','rawAttributes','model','keys','query','dateEnd','dateStart','intersection','attributes','fields','length','order','sort','where','filters','pick','add','day','filter','merge','map','options','then','include','JscriptyAnswerReport','findAll','rows','show','params','includeAll','catch','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x437cd4,_0x1288e){var _0x461bc5=function(_0xd3d055){while(--_0xd3d055){_0x437cd4['push'](_0x437cd4['shift']());}};_0x461bc5(++_0x1288e);}(_0x700f,0x153));var _0xf700=function(_0x27ee04,_0x242184){_0x27ee04=_0x27ee04-0x0;var _0x272693=_0x700f[_0x27ee04];return _0x272693;};'use strict';var pdf=require(_0xf700('0x0'));var emlformat=require(_0xf700('0x1'));var rimraf=require(_0xf700('0x2'));var zipdir=require(_0xf700('0x3'));var jsonpatch=require(_0xf700('0x4'));var rp=require(_0xf700('0x5'));var moment=require('moment');var BPromise=require(_0xf700('0x6'));var Mustache=require('mustache');var util=require(_0xf700('0x7'));var path=require(_0xf700('0x8'));var sox=require(_0xf700('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf700('0xa'));var squel=require(_0xf700('0xb'));var crypto=require(_0xf700('0xc'));var jsforce=require(_0xf700('0xd'));var deskjs=require(_0xf700('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf700('0xf'));var Papa=require(_0xf700('0x10'));var qs=require(_0xf700('0x11'));var logger=require(_0xf700('0x12'))('api');var utils=require(_0xf700('0x13'));var config=require(_0xf700('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c5e4a,_0x171915){_0x171915=_0x171915||0xcc;return function(_0x31c414){if(_0x31c414){return _0x2c5e4a[_0xf700('0x15')](_0x171915);}return _0x2c5e4a[_0xf700('0x16')](_0x171915)[_0xf700('0x17')]();};}function respondWithResult(_0x4a95a9,_0x53a173){_0x53a173=_0x53a173||0xc8;return function(_0x15ee03){if(_0x15ee03){return _0x4a95a9[_0xf700('0x16')](_0x53a173)[_0xf700('0x18')](_0x15ee03);}};}function respondWithFilteredResult(_0x28c3c0,_0x28937c){return function(_0x5501d3){if(_0x5501d3){var _0x27ca5e=_0x5501d3[_0xf700('0x19')],_0x45de68=_0x28937c[_0xf700('0x1a')],_0x232a35=_0x28937c[_0xf700('0x1a')]+_0x28937c[_0xf700('0x1b')],_0x1105a1;if(_0x232a35>=_0x27ca5e){_0x232a35=_0x27ca5e;_0x1105a1=0xc8;}else{_0x1105a1=0xce;}_0x28c3c0['status'](_0x1105a1);return _0x28c3c0['set'](_0xf700('0x1c'),_0x45de68+'-'+_0x232a35+'/'+_0x27ca5e)[_0xf700('0x18')](_0x5501d3);}return null;};}function patchUpdates(_0x3e62ca){return function(_0x3265b7){try{jsonpatch['apply'](_0x3265b7,_0x3e62ca,!![]);}catch(_0x4b86d6){return BPromise['reject'](_0x4b86d6);}return _0x3265b7[_0xf700('0x1d')]();};}function saveUpdates(_0x62fb2b,_0x13660b){return function(_0x262e1f){if(_0x262e1f){return _0x262e1f['update'](_0x62fb2b)['then'](function(_0x292365){return _0x292365;});}return null;};}function removeEntity(_0x53c0a3,_0x2d6840){return function(_0x5ed31e){if(_0x5ed31e){return _0x5ed31e[_0xf700('0x1e')]()['then'](function(){_0x53c0a3[_0xf700('0x16')](0xcc)[_0xf700('0x17')]();});}};}function handleEntityNotFound(_0x189a48,_0x3ffd7a){return function(_0x2e1f9b){if(!_0x2e1f9b){_0x189a48[_0xf700('0x15')](0x194);}return _0x2e1f9b;};}function handleError(_0x42919f,_0x581c69){_0x581c69=_0x581c69||0x1f4;return function(_0x5ecf9a){logger[_0xf700('0x1f')](_0x5ecf9a['stack']);if(_0x5ecf9a['name']){delete _0x5ecf9a[_0xf700('0x20')];}_0x42919f[_0xf700('0x16')](_0x581c69)[_0xf700('0x21')](_0x5ecf9a);};}exports[_0xf700('0x22')]=function(_0x42f37c,_0x4137f1){var _0xd959cf={},_0x444f60={},_0x17bf57={'count':0x0,'rows':[]};var _0x5c23c2=db['JscriptyAnswerReport'][_0xf700('0x23')];_0x444f60[_0xf700('0x24')]=_[_0xf700('0x25')](_0x5c23c2);var _0x59d5a7={'dateStart':_0x42f37c['query']['dateStart'],'dateEnd':_0x42f37c[_0xf700('0x26')][_0xf700('0x27')]};delete _0x42f37c[_0xf700('0x26')][_0xf700('0x28')];delete _0x42f37c['query']['dateEnd'];_0x444f60[_0xf700('0x26')]=_[_0xf700('0x25')](_0x42f37c[_0xf700('0x26')]);_0x444f60['filters']=_[_0xf700('0x29')](_0x444f60['model'],_0x444f60['query']);_0xd959cf[_0xf700('0x2a')]=_[_0xf700('0x29')](_0x444f60['model'],qs['fields'](_0x42f37c[_0xf700('0x26')][_0xf700('0x2b')]));_0xd959cf['attributes']=_0xd959cf[_0xf700('0x2a')][_0xf700('0x2c')]?_0xd959cf[_0xf700('0x2a')]:_0x444f60[_0xf700('0x24')];if(!_0x42f37c[_0xf700('0x26')]['hasOwnProperty']('nolimit')){_0xd959cf['limit']=qs[_0xf700('0x1b')](_0x42f37c[_0xf700('0x26')][_0xf700('0x1b')]);_0xd959cf[_0xf700('0x1a')]=qs[_0xf700('0x1a')](_0x42f37c[_0xf700('0x26')][_0xf700('0x1a')]);}_0xd959cf[_0xf700('0x2d')]=qs[_0xf700('0x2e')](_0x42f37c['query']['sort']);_0xd959cf[_0xf700('0x2f')]=qs[_0xf700('0x30')](_[_0xf700('0x31')](_0x42f37c['query'],_0x444f60[_0xf700('0x30')]));if(_0x59d5a7[_0xf700('0x28')]){if(_0x59d5a7[_0xf700('0x27')]){_0x59d5a7[_0xf700('0x27')]=moment(_0x59d5a7[_0xf700('0x27')])[_0xf700('0x32')](0x1,_0xf700('0x33'));}else{_0x59d5a7[_0xf700('0x27')]=moment(_0x59d5a7[_0xf700('0x28')])[_0xf700('0x32')](0x1,_0xf700('0x33'));}_['merge'](_0xd959cf['where'],{'createdAt':{'$gte':_0x59d5a7[_0xf700('0x28')],'$lte':_0x59d5a7[_0xf700('0x27')]}});}if(_0x42f37c['query'][_0xf700('0x34')]){_0xd959cf['where']=_[_0xf700('0x35')](_0xd959cf[_0xf700('0x2f')],{'$or':_[_0xf700('0x36')](_0xd959cf['attributes'],function(_0x5047a4){var _0x53d563={};_0x53d563[_0x5047a4]={'$like':'%'+_0x42f37c['query']['filter']+'%'};return _0x53d563;})});}_0xd959cf=_[_0xf700('0x35')]({},_0xd959cf,_0x42f37c[_0xf700('0x37')]);var _0x40a126={'where':_0xd959cf[_0xf700('0x2f')]};return db['JscriptyAnswerReport']['count'](_0x40a126)[_0xf700('0x38')](function(_0x54514b){_0x17bf57['count']=_0x54514b;if(_0x42f37c[_0xf700('0x26')]['includeAll']){_0xd959cf[_0xf700('0x39')]=[{'all':!![]}];}return db[_0xf700('0x3a')][_0xf700('0x3b')](_0xd959cf);})[_0xf700('0x38')](function(_0x2bac41){_0x17bf57[_0xf700('0x3c')]=_0x2bac41;return _0x17bf57;})[_0xf700('0x38')](respondWithFilteredResult(_0x4137f1,_0xd959cf))['catch'](handleError(_0x4137f1,null));};exports[_0xf700('0x3d')]=function(_0x5f024c,_0xb94bd5){var _0x7c6e0f={'raw':!![],'where':{'id':_0x5f024c[_0xf700('0x3e')]['id']}},_0x5d3fe2={};_0x5d3fe2[_0xf700('0x24')]=_[_0xf700('0x25')](db[_0xf700('0x3a')][_0xf700('0x23')]);_0x5d3fe2['query']=_['keys'](_0x5f024c['query']);_0x5d3fe2['filters']=_[_0xf700('0x29')](_0x5d3fe2[_0xf700('0x24')],_0x5d3fe2['query']);_0x7c6e0f[_0xf700('0x2a')]=_['intersection'](_0x5d3fe2[_0xf700('0x24')],qs[_0xf700('0x2b')](_0x5f024c[_0xf700('0x26')][_0xf700('0x2b')]));_0x7c6e0f[_0xf700('0x2a')]=_0x7c6e0f[_0xf700('0x2a')][_0xf700('0x2c')]?_0x7c6e0f[_0xf700('0x2a')]:_0x5d3fe2[_0xf700('0x24')];if(_0x5f024c[_0xf700('0x26')][_0xf700('0x3f')]){_0x7c6e0f['include']=[{'all':!![]}];}_0x7c6e0f=_[_0xf700('0x35')]({},_0x7c6e0f,_0x5f024c[_0xf700('0x37')]);return db[_0xf700('0x3a')]['find'](_0x7c6e0f)[_0xf700('0x38')](handleEntityNotFound(_0xb94bd5,null))[_0xf700('0x38')](respondWithResult(_0xb94bd5,null))[_0xf700('0x40')](handleError(_0xb94bd5,null));};exports[_0xf700('0x41')]=function(_0x5e9c66,_0x40773b){return db['JscriptyAnswerReport'][_0xf700('0x41')](_0x5e9c66[_0xf700('0x42')],{})['then'](respondWithResult(_0x40773b,0xc9))['catch'](handleError(_0x40773b,null));};exports['update']=function(_0x427fd1,_0x30bed4){if(_0x427fd1[_0xf700('0x42')]['id']){delete _0x427fd1[_0xf700('0x42')]['id'];}return db[_0xf700('0x3a')][_0xf700('0x43')]({'where':{'id':_0x427fd1[_0xf700('0x3e')]['id']}})[_0xf700('0x38')](handleEntityNotFound(_0x30bed4,null))[_0xf700('0x38')](saveUpdates(_0x427fd1['body'],null))[_0xf700('0x38')](respondWithResult(_0x30bed4,null))[_0xf700('0x40')](handleError(_0x30bed4,null));};exports[_0xf700('0x1e')]=function(_0x3918bb,_0x315612){return db[_0xf700('0x3a')]['find']({'where':{'id':_0x3918bb['params']['id']}})['then'](handleEntityNotFound(_0x315612,null))[_0xf700('0x38')](removeEntity(_0x315612,null))[_0xf700('0x40')](handleError(_0x315612,null));};exports['describe']=function(_0x1b0303,_0x1f0465){return db['JscriptyAnswerReport'][_0xf700('0x44')]()[_0xf700('0x38')](respondWithResult(_0x1f0465,null))[_0xf700('0x40')](handleError(_0x1f0465,null));};
\ No newline at end of file
+var _0xa93c=['query','dateStart','dateEnd','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','day','add','merge','where','map','filter','options','JscriptyAnswerReport','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','Content-Range','apply','reject','then','destroy','sendStatus','error','stack','index','model','keys'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xa93c,0x143));var _0xca93=function(_0x495b3d,_0x4d3da4){_0x495b3d=_0x495b3d-0x0;var _0x4cb329=_0xa93c[_0x495b3d];return _0x4cb329;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xca93('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xca93('0x1'));var jsonpatch=require(_0xca93('0x2'));var rp=require(_0xca93('0x3'));var moment=require(_0xca93('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xca93('0x5'));var util=require(_0xca93('0x6'));var path=require('path');var sox=require(_0xca93('0x7'));var csv=require(_0xca93('0x8'));var ejs=require(_0xca93('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xca93('0xa'));var crypto=require(_0xca93('0xb'));var jsforce=require(_0xca93('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xca93('0xd'));var Papa=require(_0xca93('0xe'));var qs=require(_0xca93('0xf'));var logger=require(_0xca93('0x10'))(_0xca93('0x11'));var utils=require(_0xca93('0x12'));var config=require(_0xca93('0x13'));var db=require(_0xca93('0x14'))['db'];function respondWithStatusCode(_0x3eca20,_0x3d244c){_0x3d244c=_0x3d244c||0xcc;return function(_0x168fd3){if(_0x168fd3){return _0x3eca20['sendStatus'](_0x3d244c);}return _0x3eca20[_0xca93('0x15')](_0x3d244c)[_0xca93('0x16')]();};}function respondWithResult(_0x39bcbe,_0x3166b0){_0x3166b0=_0x3166b0||0xc8;return function(_0x27bd89){if(_0x27bd89){return _0x39bcbe[_0xca93('0x15')](_0x3166b0)[_0xca93('0x17')](_0x27bd89);}};}function respondWithFilteredResult(_0x47d6c8,_0x38f57f){return function(_0x114775){if(_0x114775){var _0x3fe99a=_0x114775['count'],_0x3fd0e9=_0x38f57f[_0xca93('0x18')],_0x7a3d78=_0x38f57f['offset']+_0x38f57f[_0xca93('0x19')],_0x8e94e8;if(_0x7a3d78>=_0x3fe99a){_0x7a3d78=_0x3fe99a;_0x8e94e8=0xc8;}else{_0x8e94e8=0xce;}_0x47d6c8[_0xca93('0x15')](_0x8e94e8);return _0x47d6c8['set'](_0xca93('0x1a'),_0x3fd0e9+'-'+_0x7a3d78+'/'+_0x3fe99a)[_0xca93('0x17')](_0x114775);}return null;};}function patchUpdates(_0x8f97d5){return function(_0x23d977){try{jsonpatch[_0xca93('0x1b')](_0x23d977,_0x8f97d5,!![]);}catch(_0x7974a1){return BPromise[_0xca93('0x1c')](_0x7974a1);}return _0x23d977['save']();};}function saveUpdates(_0x482a83,_0x4eea8f){return function(_0x46854b){if(_0x46854b){return _0x46854b['update'](_0x482a83)[_0xca93('0x1d')](function(_0x2d6661){return _0x2d6661;});}return null;};}function removeEntity(_0x239228,_0x1534ac){return function(_0x4591a3){if(_0x4591a3){return _0x4591a3[_0xca93('0x1e')]()[_0xca93('0x1d')](function(){_0x239228[_0xca93('0x15')](0xcc)[_0xca93('0x16')]();});}};}function handleEntityNotFound(_0x44cae2,_0x179b8a){return function(_0x1c5eea){if(!_0x1c5eea){_0x44cae2[_0xca93('0x1f')](0x194);}return _0x1c5eea;};}function handleError(_0x331c44,_0x32e674){_0x32e674=_0x32e674||0x1f4;return function(_0x4f3ed8){logger[_0xca93('0x20')](_0x4f3ed8[_0xca93('0x21')]);if(_0x4f3ed8['name']){delete _0x4f3ed8['name'];}_0x331c44['status'](_0x32e674)['send'](_0x4f3ed8);};}exports[_0xca93('0x22')]=function(_0x252471,_0xf1c6ff){var _0x54de12={},_0x5619e0={},_0x2cf752={'count':0x0,'rows':[]};var _0x129fbc=db['JscriptyAnswerReport']['rawAttributes'];_0x5619e0[_0xca93('0x23')]=_[_0xca93('0x24')](_0x129fbc);var _0x2d1f05={'dateStart':_0x252471[_0xca93('0x25')][_0xca93('0x26')],'dateEnd':_0x252471[_0xca93('0x25')][_0xca93('0x27')]};delete _0x252471[_0xca93('0x25')]['dateStart'];delete _0x252471[_0xca93('0x25')]['dateEnd'];_0x5619e0[_0xca93('0x25')]=_[_0xca93('0x24')](_0x252471['query']);_0x5619e0[_0xca93('0x28')]=_['intersection'](_0x5619e0[_0xca93('0x23')],_0x5619e0[_0xca93('0x25')]);_0x54de12['attributes']=_[_0xca93('0x29')](_0x5619e0[_0xca93('0x23')],qs[_0xca93('0x2a')](_0x252471[_0xca93('0x25')][_0xca93('0x2a')]));_0x54de12[_0xca93('0x2b')]=_0x54de12[_0xca93('0x2b')][_0xca93('0x2c')]?_0x54de12[_0xca93('0x2b')]:_0x5619e0[_0xca93('0x23')];if(!_0x252471[_0xca93('0x25')][_0xca93('0x2d')](_0xca93('0x2e'))){_0x54de12['limit']=qs[_0xca93('0x19')](_0x252471[_0xca93('0x25')]['limit']);_0x54de12[_0xca93('0x18')]=qs[_0xca93('0x18')](_0x252471[_0xca93('0x25')][_0xca93('0x18')]);}_0x54de12[_0xca93('0x2f')]=qs[_0xca93('0x30')](_0x252471[_0xca93('0x25')]['sort']);_0x54de12['where']=qs[_0xca93('0x28')](_[_0xca93('0x31')](_0x252471[_0xca93('0x25')],_0x5619e0['filters']));if(_0x2d1f05[_0xca93('0x26')]){if(_0x2d1f05['dateEnd']){_0x2d1f05[_0xca93('0x27')]=moment(_0x2d1f05[_0xca93('0x27')])['add'](0x1,_0xca93('0x32'));}else{_0x2d1f05[_0xca93('0x27')]=moment(_0x2d1f05['dateStart'])[_0xca93('0x33')](0x1,_0xca93('0x32'));}_[_0xca93('0x34')](_0x54de12[_0xca93('0x35')],{'createdAt':{'$gte':_0x2d1f05[_0xca93('0x26')],'$lte':_0x2d1f05['dateEnd']}});}if(_0x252471[_0xca93('0x25')]['filter']){_0x54de12['where']=_['merge'](_0x54de12['where'],{'$or':_[_0xca93('0x36')](_0x54de12[_0xca93('0x2b')],function(_0x4a70b5){var _0x4eda1a={};_0x4eda1a[_0x4a70b5]={'$like':'%'+_0x252471[_0xca93('0x25')][_0xca93('0x37')]+'%'};return _0x4eda1a;})});}_0x54de12=_[_0xca93('0x34')]({},_0x54de12,_0x252471[_0xca93('0x38')]);var _0x4b195={'where':_0x54de12[_0xca93('0x35')]};return db[_0xca93('0x39')][_0xca93('0x3a')](_0x4b195)[_0xca93('0x1d')](function(_0x1a05d2){_0x2cf752[_0xca93('0x3a')]=_0x1a05d2;if(_0x252471['query'][_0xca93('0x3b')]){_0x54de12[_0xca93('0x3c')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xca93('0x3d')](_0x54de12);})[_0xca93('0x1d')](function(_0xecc1f5){_0x2cf752[_0xca93('0x3e')]=_0xecc1f5;return _0x2cf752;})[_0xca93('0x1d')](respondWithFilteredResult(_0xf1c6ff,_0x54de12))['catch'](handleError(_0xf1c6ff,null));};exports[_0xca93('0x3f')]=function(_0x45fdd8,_0x50db09){var _0x3c5148={'raw':!![],'where':{'id':_0x45fdd8[_0xca93('0x40')]['id']}},_0x4dbdc2={};_0x4dbdc2[_0xca93('0x23')]=_['keys'](db[_0xca93('0x39')][_0xca93('0x41')]);_0x4dbdc2[_0xca93('0x25')]=_[_0xca93('0x24')](_0x45fdd8[_0xca93('0x25')]);_0x4dbdc2[_0xca93('0x28')]=_[_0xca93('0x29')](_0x4dbdc2[_0xca93('0x23')],_0x4dbdc2[_0xca93('0x25')]);_0x3c5148[_0xca93('0x2b')]=_[_0xca93('0x29')](_0x4dbdc2['model'],qs[_0xca93('0x2a')](_0x45fdd8['query'][_0xca93('0x2a')]));_0x3c5148[_0xca93('0x2b')]=_0x3c5148[_0xca93('0x2b')][_0xca93('0x2c')]?_0x3c5148[_0xca93('0x2b')]:_0x4dbdc2['model'];if(_0x45fdd8[_0xca93('0x25')]['includeAll']){_0x3c5148[_0xca93('0x3c')]=[{'all':!![]}];}_0x3c5148=_[_0xca93('0x34')]({},_0x3c5148,_0x45fdd8[_0xca93('0x38')]);return db[_0xca93('0x39')][_0xca93('0x42')](_0x3c5148)[_0xca93('0x1d')](handleEntityNotFound(_0x50db09,null))[_0xca93('0x1d')](respondWithResult(_0x50db09,null))[_0xca93('0x43')](handleError(_0x50db09,null));};exports[_0xca93('0x44')]=function(_0xf3ad34,_0x3bdedf){return db[_0xca93('0x39')][_0xca93('0x44')](_0xf3ad34[_0xca93('0x45')],{})[_0xca93('0x1d')](respondWithResult(_0x3bdedf,0xc9))[_0xca93('0x43')](handleError(_0x3bdedf,null));};exports[_0xca93('0x46')]=function(_0x457097,_0x44a573){if(_0x457097[_0xca93('0x45')]['id']){delete _0x457097[_0xca93('0x45')]['id'];}return db[_0xca93('0x39')][_0xca93('0x42')]({'where':{'id':_0x457097['params']['id']}})[_0xca93('0x1d')](handleEntityNotFound(_0x44a573,null))[_0xca93('0x1d')](saveUpdates(_0x457097[_0xca93('0x45')],null))['then'](respondWithResult(_0x44a573,null))[_0xca93('0x43')](handleError(_0x44a573,null));};exports['destroy']=function(_0x113cef,_0x138c75){return db['JscriptyAnswerReport'][_0xca93('0x42')]({'where':{'id':_0x113cef['params']['id']}})['then'](handleEntityNotFound(_0x138c75,null))[_0xca93('0x1d')](removeEntity(_0x138c75,null))['catch'](handleError(_0x138c75,null));};exports[_0xca93('0x47')]=function(_0x90f290,_0x4b4168){return db['JscriptyAnswerReport'][_0xca93('0x47')]()[_0xca93('0x1d')](respondWithResult(_0x4b4168,null))[_0xca93('0x43')](handleError(_0x4b4168,null));};
\ No newline at end of file
index f7b6c8a..90192b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb2d=['api','bluebird','request-promise','exports','define','JscriptyAnswerReport','util','../../config/logger'];(function(_0x269732,_0x4f67e2){var _0x4db28d=function(_0x148270){while(--_0x148270){_0x269732['push'](_0x269732['shift']());}};_0x4db28d(++_0x4f67e2);}(_0xeb2d,0x16e));var _0xdeb2=function(_0x4cdda8,_0xe100f){_0x4cdda8=_0x4cdda8-0x0;var _0x27f82c=_0xeb2d[_0x4cdda8];return _0x27f82c;};'use strict';var _=require('lodash');var util=require(_0xdeb2('0x0'));var logger=require(_0xdeb2('0x1'))(_0xdeb2('0x2'));var moment=require('moment');var BPromise=require(_0xdeb2('0x3'));var rp=require(_0xdeb2('0x4'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xdeb2('0x5')]=function(_0x82fd73,_0x3d94ea){return _0x82fd73[_0xdeb2('0x6')](_0xdeb2('0x7'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb37=['exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','request-promise','./jscriptyAnswerReport.attributes'];(function(_0x3ebc12,_0xb99390){var _0x1ab379=function(_0x35fdbd){while(--_0x35fdbd){_0x3ebc12['push'](_0x3ebc12['shift']());}};_0x1ab379(++_0xb99390);}(_0xfb37,0xd2));var _0x7fb3=function(_0x4907de,_0x5bbdc6){_0x4907de=_0x4907de-0x0;var _0x482054=_0xfb37[_0x4907de];return _0x482054;};'use strict';var _=require(_0x7fb3('0x0'));var util=require(_0x7fb3('0x1'));var logger=require(_0x7fb3('0x2'))(_0x7fb3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7fb3('0x4'));var attributes=require(_0x7fb3('0x5'));module[_0x7fb3('0x6')]=function(_0x48dbb8,_0x23635d){return _0x48dbb8['define'](_0x7fb3('0x7'),attributes,{'tableName':_0x7fb3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fe8a7e8..cab5438 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x237a=['debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4d58bc,_0x2c3899){var _0x56cd22=function(_0x1782e5){while(--_0x1782e5){_0x4d58bc['push'](_0x4d58bc['shift']());}};_0x56cd22(++_0x2c3899);}(_0x237a,0xfe));var _0xa237=function(_0x486ed7,_0x5df3f5){_0x486ed7=_0x486ed7-0x0;var _0x3ac021=_0x237a[_0x486ed7];return _0x3ac021;};'use strict';var _=require(_0xa237('0x0'));var util=require(_0xa237('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0xa237('0x2'))['db'];var utils=require(_0xa237('0x3'));var logger=require(_0xa237('0x4'))(_0xa237('0x5'));var config=require(_0xa237('0x6'));var jayson=require(_0xa237('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1e1cdf,_0x1e7284,_0x215e58){return new BPromise(function(_0x3cbc05,_0xd13b78){return client[_0xa237('0x8')](_0x1e1cdf,_0x215e58)[_0xa237('0x9')](function(_0xbadb89){logger['info'](_0xa237('0xa'),_0x1e7284,_0xa237('0xb'));logger[_0xa237('0xc')](_0xa237('0xd'),_0x1e7284,_0xa237('0xb'),JSON[_0xa237('0xe')](_0xbadb89));if(_0xbadb89[_0xa237('0xf')]){if(_0xbadb89[_0xa237('0xf')]['code']===0x1f4){logger[_0xa237('0xf')](_0xa237('0xa'),_0x1e7284,_0xbadb89['error'][_0xa237('0x10')]);return _0xd13b78(_0xbadb89[_0xa237('0xf')][_0xa237('0x10')]);}logger[_0xa237('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1e7284,_0xbadb89['error'][_0xa237('0x10')]);return _0x3cbc05(_0xbadb89[_0xa237('0xf')][_0xa237('0x10')]);}else{logger['info'](_0xa237('0xa'),_0x1e7284,'request\x20sent');_0x3cbc05(_0xbadb89[_0xa237('0x11')][_0xa237('0x10')]);}})[_0xa237('0x12')](function(_0x2706a1){logger[_0xa237('0xf')](_0xa237('0xa'),_0x1e7284,_0x2706a1);_0xd13b78(_0x2706a1);});});}
\ No newline at end of file
+var _0x3b25=['client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x59eacf,_0x56ec4a){var _0x5d74f2=function(_0x5476ed){while(--_0x5476ed){_0x59eacf['push'](_0x59eacf['shift']());}};_0x5d74f2(++_0x56ec4a);}(_0x3b25,0xd8));var _0x53b2=function(_0x7e348d,_0x4ccecd){_0x7e348d=_0x7e348d-0x0;var _0x32ff18=_0x3b25[_0x7e348d];return _0x32ff18;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x53b2('0x0'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x53b2('0x1'))['db'];var utils=require(_0x53b2('0x2'));var logger=require('../../config/logger')(_0x53b2('0x3'));var config=require('../../config/environment');var jayson=require(_0x53b2('0x4'));var client=jayson[_0x53b2('0x5')][_0x53b2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3ca33d,_0x25f460,_0x2f5f30){return new BPromise(function(_0x5cdea6,_0x38671d){return client[_0x53b2('0x7')](_0x3ca33d,_0x2f5f30)[_0x53b2('0x8')](function(_0x1f02a9){logger[_0x53b2('0x9')](_0x53b2('0xa'),_0x25f460,_0x53b2('0xb'));logger[_0x53b2('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x25f460,_0x53b2('0xb'),JSON[_0x53b2('0xd')](_0x1f02a9));if(_0x1f02a9[_0x53b2('0xe')]){if(_0x1f02a9['error'][_0x53b2('0xf')]===0x1f4){logger[_0x53b2('0xe')](_0x53b2('0xa'),_0x25f460,_0x1f02a9[_0x53b2('0xe')]['message']);return _0x38671d(_0x1f02a9[_0x53b2('0xe')][_0x53b2('0x10')]);}logger['error'](_0x53b2('0xa'),_0x25f460,_0x1f02a9[_0x53b2('0xe')]['message']);return _0x5cdea6(_0x1f02a9[_0x53b2('0xe')][_0x53b2('0x10')]);}else{logger[_0x53b2('0x9')](_0x53b2('0xa'),_0x25f460,_0x53b2('0xb'));_0x5cdea6(_0x1f02a9['result']['message']);}})['catch'](function(_0x30ec4f){logger[_0x53b2('0xe')](_0x53b2('0xa'),_0x25f460,_0x30ec4f);_0x38671d(_0x30ec4f);});});}
\ No newline at end of file
index ab9e039..99d13d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd51=['put','/:id','destroy','exports','multer','path','express','Router','../../components/auth/service','isAuthenticated','index','get','show','/:id/sessions','getAnswers','/:id/summary','getSummary','post','/:id/clone','clone'];(function(_0x369cf2,_0x47e28c){var _0x5c7d3e=function(_0x4143d9){while(--_0x4143d9){_0x369cf2['push'](_0x369cf2['shift']());}};_0x5c7d3e(++_0x47e28c);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x15213d,_0x42d4f2){_0x15213d=_0x15213d-0x0;var _0x2caad4=_0xbd51[_0x15213d];return _0x2caad4;};'use strict';var multer=require(_0x1bd5('0x0'));var util=require('util');var path=require(_0x1bd5('0x1'));var express=require(_0x1bd5('0x2'));var router=express[_0x1bd5('0x3')]();var auth=require(_0x1bd5('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router['get']('/',auth[_0x1bd5('0x5')](),controller[_0x1bd5('0x6')]);router[_0x1bd5('0x7')]('/:id',auth[_0x1bd5('0x5')](),controller[_0x1bd5('0x8')]);router[_0x1bd5('0x7')](_0x1bd5('0x9'),auth[_0x1bd5('0x5')](),controller['getSessions']);router[_0x1bd5('0x7')]('/:id/answers',auth[_0x1bd5('0x5')](),controller[_0x1bd5('0xa')]);router[_0x1bd5('0x7')](_0x1bd5('0xb'),auth[_0x1bd5('0x5')](),controller[_0x1bd5('0xc')]);router['post']('/',auth[_0x1bd5('0x5')](),controller['create']);router[_0x1bd5('0xd')](_0x1bd5('0xe'),auth[_0x1bd5('0x5')](),controller[_0x1bd5('0xf')]);router[_0x1bd5('0x10')](_0x1bd5('0x11'),auth[_0x1bd5('0x5')](),controller['update']);router['delete'](_0x1bd5('0x11'),auth[_0x1bd5('0x5')](),controller[_0x1bd5('0x12')]);module[_0x1bd5('0x13')]=router;
\ No newline at end of file
+var _0xee14=['destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','/:id/summary','getSummary','create','post','/:id/clone','clone','/:id','update','delete'];(function(_0xa2bac1,_0x3a01c2){var _0x1d53e2=function(_0x48cb29){while(--_0x48cb29){_0xa2bac1['push'](_0xa2bac1['shift']());}};_0x1d53e2(++_0x3a01c2);}(_0xee14,0x13a));var _0x4ee1=function(_0xf3e700,_0x48ea99){_0xf3e700=_0xf3e700-0x0;var _0x573be4=_0xee14[_0xf3e700];return _0x573be4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ee1('0x0'));var express=require(_0x4ee1('0x1'));var router=express[_0x4ee1('0x2')]();var auth=require(_0x4ee1('0x3'));var interaction=require(_0x4ee1('0x4'));var config=require(_0x4ee1('0x5'));var controller=require(_0x4ee1('0x6'));router[_0x4ee1('0x7')]('/',auth[_0x4ee1('0x8')](),controller['index']);router[_0x4ee1('0x7')]('/:id',auth[_0x4ee1('0x8')](),controller[_0x4ee1('0x9')]);router[_0x4ee1('0x7')](_0x4ee1('0xa'),auth[_0x4ee1('0x8')](),controller[_0x4ee1('0xb')]);router['get'](_0x4ee1('0xc'),auth[_0x4ee1('0x8')](),controller['getAnswers']);router[_0x4ee1('0x7')](_0x4ee1('0xd'),auth[_0x4ee1('0x8')](),controller[_0x4ee1('0xe')]);router['post']('/',auth[_0x4ee1('0x8')](),controller[_0x4ee1('0xf')]);router[_0x4ee1('0x10')](_0x4ee1('0x11'),auth[_0x4ee1('0x8')](),controller[_0x4ee1('0x12')]);router['put'](_0x4ee1('0x13'),auth[_0x4ee1('0x8')](),controller[_0x4ee1('0x14')]);router[_0x4ee1('0x15')](_0x4ee1('0x13'),auth[_0x4ee1('0x8')](),controller[_0x4ee1('0x16')]);module[_0x4ee1('0x17')]=router;
\ No newline at end of file
index 39e19b1..93a00fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1496=['name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','util','exports','STRING'];(function(_0xe2d04,_0x29a8c2){var _0x22a576=function(_0x51a1f2){while(--_0x51a1f2){_0xe2d04['push'](_0xe2d04['shift']());}};_0x22a576(++_0x29a8c2);}(_0x1496,0x193));var _0x6149=function(_0x1bc13c,_0x4483a0){_0x1bc13c=_0x1bc13c-0x0;var _0x4a7ceb=_0x1496[_0x1bc13c];return _0x4a7ceb;};'use strict';var Sequelize=require(_0x6149('0x0'));var _=require(_0x6149('0x1'));var util=require(_0x6149('0x2'));module[_0x6149('0x3')]={'name':{'type':Sequelize[_0x6149('0x4')],'unique':_0x6149('0x5')},'description':{'type':Sequelize[_0x6149('0x4')]},'formData':{'type':Sequelize[_0x6149('0x6')](_0x6149('0x7')),'set':function(_0x440df2){if(_[_0x6149('0x8')](_0x440df2)){this[_0x6149('0x9')](_0x6149('0xa'),JSON[_0x6149('0xb')](_0x440df2));}else if(_[_0x6149('0xc')](_0x440df2)){this[_0x6149('0x9')](_0x6149('0xa'),_0x440df2);}else{this[_0x6149('0x9')]('formData',util[_0x6149('0xd')](_0x6149('0xe'),this[_0x6149('0xf')](_0x6149('0x5'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x6149('0x10')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x10b0=['BOOLEAN','sequelize','lodash','util','STRING','name','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description'];(function(_0x12a201,_0x30aaba){var _0x52a4d2=function(_0x5ca28d){while(--_0x5ca28d){_0x12a201['push'](_0x12a201['shift']());}};_0x52a4d2(++_0x30aaba);}(_0x10b0,0x144));var _0x010b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x10b0[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x010b('0x0'));var _=require(_0x010b('0x1'));var util=require(_0x010b('0x2'));module['exports']={'name':{'type':Sequelize[_0x010b('0x3')],'unique':_0x010b('0x4')},'description':{'type':Sequelize[_0x010b('0x3')]},'formData':{'type':Sequelize[_0x010b('0x5')](_0x010b('0x6')),'set':function(_0x11dd1f){if(_[_0x010b('0x7')](_0x11dd1f)){this[_0x010b('0x8')]('formData',JSON[_0x010b('0x9')](_0x11dd1f));}else if(_[_0x010b('0xa')](_0x11dd1f)){this[_0x010b('0x8')]('formData',_0x11dd1f);}else{this[_0x010b('0x8')](_0x010b('0xb'),util[_0x010b('0xc')](_0x010b('0xd'),this[_0x010b('0xe')](_0x010b('0x4'))||'',this[_0x010b('0xe')](_0x010b('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x010b('0x10')],'defaultValue':!![]}};
\ No newline at end of file
index 197abb1..172f5d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8311=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','day','add','merge','filter','options','includeAll','include','findAll','rows','catch','find','create','clone','get','omit','updatedAt','body','createdAt','params','destroy','getSessions','findOne','JscriptySessionReport','sort','ProjectId','map','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','replace','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','SessionId','answer','push','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','/tmp/Jscripty_Project_%d_Summary_%s.csv','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','sendStatus','stack','name','send','JscriptyProject','rawAttributes','model','keys','query','dateStart','dateEnd'];(function(_0x2161ac,_0x35d657){var _0x1b6093=function(_0x23eeb9){while(--_0x23eeb9){_0x2161ac['push'](_0x2161ac['shift']());}};_0x1b6093(++_0x35d657);}(_0x8311,0x111));var _0x1831=function(_0x2bc9e2,_0x1f4772){_0x2bc9e2=_0x2bc9e2-0x0;var _0x598e41=_0x8311[_0x2bc9e2];return _0x598e41;};'use strict';var pdf=require(_0x1831('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1831('0x1'));var jsonpatch=require(_0x1831('0x2'));var rp=require(_0x1831('0x3'));var moment=require(_0x1831('0x4'));var BPromise=require(_0x1831('0x5'));var Mustache=require(_0x1831('0x6'));var util=require(_0x1831('0x7'));var path=require(_0x1831('0x8'));var sox=require(_0x1831('0x9'));var csv=require(_0x1831('0xa'));var ejs=require(_0x1831('0xb'));var fs=require('fs');var _=require(_0x1831('0xc'));var squel=require('squel');var crypto=require(_0x1831('0xd'));var jsforce=require(_0x1831('0xe'));var deskjs=require(_0x1831('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1831('0x10'));var qs=require(_0x1831('0x11'));var logger=require(_0x1831('0x12'))(_0x1831('0x13'));var utils=require('../../config/utils');var config=require(_0x1831('0x14'));var db=require(_0x1831('0x15'))['db'];function respondWithStatusCode(_0x23152e,_0x105079){_0x105079=_0x105079||0xcc;return function(_0x2ba6bc){if(_0x2ba6bc){return _0x23152e['sendStatus'](_0x105079);}return _0x23152e[_0x1831('0x16')](_0x105079)[_0x1831('0x17')]();};}function respondWithResult(_0x30bc16,_0x420c0b){_0x420c0b=_0x420c0b||0xc8;return function(_0x4336ee){if(_0x4336ee){return _0x30bc16[_0x1831('0x16')](_0x420c0b)['json'](_0x4336ee);}};}function respondWithFilteredResult(_0x424246,_0x33e90a){return function(_0x18a031){if(_0x18a031){var _0x53482e=_0x18a031[_0x1831('0x18')],_0x39912c=_0x33e90a[_0x1831('0x19')],_0x3f765d=_0x33e90a[_0x1831('0x19')]+_0x33e90a[_0x1831('0x1a')],_0x16c983;if(_0x3f765d>=_0x53482e){_0x3f765d=_0x53482e;_0x16c983=0xc8;}else{_0x16c983=0xce;}_0x424246['status'](_0x16c983);return _0x424246[_0x1831('0x1b')](_0x1831('0x1c'),_0x39912c+'-'+_0x3f765d+'/'+_0x53482e)[_0x1831('0x1d')](_0x18a031);}return null;};}function patchUpdates(_0x15e658){return function(_0x4e80d6){try{jsonpatch['apply'](_0x4e80d6,_0x15e658,!![]);}catch(_0xc75349){return BPromise[_0x1831('0x1e')](_0xc75349);}return _0x4e80d6[_0x1831('0x1f')]();};}function saveUpdates(_0x13baf2,_0x428d36){return function(_0x40a126){if(_0x40a126){return _0x40a126[_0x1831('0x20')](_0x13baf2)['then'](function(_0x5c0ef8){return _0x5c0ef8;});}return null;};}function removeEntity(_0x5c64a6,_0x4e5ef5){return function(_0x2a6137){if(_0x2a6137){return _0x2a6137['destroy']()[_0x1831('0x21')](function(){_0x5c64a6[_0x1831('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11cf96,_0x47c8d6){return function(_0xa1639c){if(!_0xa1639c){_0x11cf96[_0x1831('0x22')](0x194);}return _0xa1639c;};}function handleError(_0x40ca8c,_0x285441){_0x285441=_0x285441||0x1f4;return function(_0x30520c){logger['error'](_0x30520c[_0x1831('0x23')]);if(_0x30520c['name']){delete _0x30520c[_0x1831('0x24')];}_0x40ca8c[_0x1831('0x16')](_0x285441)[_0x1831('0x25')](_0x30520c);};}exports['index']=function(_0x561a12,_0x29c5ed){var _0x1bbbe9={},_0x13ff11={},_0x47d8c4={'count':0x0,'rows':[]};var _0x14b817=db[_0x1831('0x26')][_0x1831('0x27')];_0x13ff11[_0x1831('0x28')]=_[_0x1831('0x29')](_0x14b817);var _0x395b30={'dateStart':_0x561a12[_0x1831('0x2a')][_0x1831('0x2b')],'dateEnd':_0x561a12[_0x1831('0x2a')][_0x1831('0x2c')]};delete _0x561a12['query']['dateStart'];delete _0x561a12[_0x1831('0x2a')]['dateEnd'];_0x13ff11['query']=_[_0x1831('0x29')](_0x561a12['query']);_0x13ff11[_0x1831('0x2d')]=_[_0x1831('0x2e')](_0x13ff11['model'],_0x13ff11['query']);_0x1bbbe9['attributes']=_[_0x1831('0x2e')](_0x13ff11[_0x1831('0x28')],qs['fields'](_0x561a12['query'][_0x1831('0x2f')]));_0x1bbbe9[_0x1831('0x30')]=_0x1bbbe9[_0x1831('0x30')][_0x1831('0x31')]?_0x1bbbe9['attributes']:_0x13ff11[_0x1831('0x28')];if(!_0x561a12[_0x1831('0x2a')][_0x1831('0x32')](_0x1831('0x33'))){_0x1bbbe9['limit']=qs[_0x1831('0x1a')](_0x561a12['query'][_0x1831('0x1a')]);_0x1bbbe9[_0x1831('0x19')]=qs['offset'](_0x561a12['query']['offset']);}_0x1bbbe9[_0x1831('0x34')]=qs['sort'](_0x561a12[_0x1831('0x2a')]['sort']);_0x1bbbe9[_0x1831('0x35')]=qs[_0x1831('0x2d')](_[_0x1831('0x36')](_0x561a12['query'],_0x13ff11[_0x1831('0x2d')]));if(_0x395b30[_0x1831('0x2b')]){if(_0x395b30[_0x1831('0x2c')]){_0x395b30[_0x1831('0x2c')]=moment(_0x395b30[_0x1831('0x2c')])['add'](0x1,_0x1831('0x37'));}else{_0x395b30[_0x1831('0x2c')]=moment(_0x395b30[_0x1831('0x2b')])[_0x1831('0x38')](0x1,_0x1831('0x37'));}_[_0x1831('0x39')](_0x1bbbe9[_0x1831('0x35')],{'createdAt':{'$gte':_0x395b30[_0x1831('0x2b')],'$lte':_0x395b30[_0x1831('0x2c')]}});}if(_0x561a12[_0x1831('0x2a')][_0x1831('0x3a')]){_0x1bbbe9[_0x1831('0x35')]=_[_0x1831('0x39')](_0x1bbbe9[_0x1831('0x35')],{'$or':_['map'](_0x1bbbe9[_0x1831('0x30')],function(_0x378235){var _0x5bf094={};_0x5bf094[_0x378235]={'$like':'%'+_0x561a12[_0x1831('0x2a')][_0x1831('0x3a')]+'%'};return _0x5bf094;})});}_0x1bbbe9=_[_0x1831('0x39')]({},_0x1bbbe9,_0x561a12[_0x1831('0x3b')]);var _0x107f8d={'where':_0x1bbbe9[_0x1831('0x35')]};return db[_0x1831('0x26')][_0x1831('0x18')](_0x107f8d)[_0x1831('0x21')](function(_0x2109fe){_0x47d8c4[_0x1831('0x18')]=_0x2109fe;if(_0x561a12[_0x1831('0x2a')][_0x1831('0x3c')]){_0x1bbbe9[_0x1831('0x3d')]=[{'all':!![]}];}return db['JscriptyProject'][_0x1831('0x3e')](_0x1bbbe9);})[_0x1831('0x21')](function(_0x20b429){_0x47d8c4[_0x1831('0x3f')]=_0x20b429;return _0x47d8c4;})[_0x1831('0x21')](respondWithFilteredResult(_0x29c5ed,_0x1bbbe9))[_0x1831('0x40')](handleError(_0x29c5ed,null));};exports['show']=function(_0x26b806,_0x27ca5b){var _0x4909fa={'raw':![],'where':{'id':_0x26b806['params']['id']}},_0x21e362={};_0x21e362[_0x1831('0x28')]=_[_0x1831('0x29')](db['JscriptyProject'][_0x1831('0x27')]);_0x21e362[_0x1831('0x2a')]=_['keys'](_0x26b806[_0x1831('0x2a')]);_0x21e362['filters']=_[_0x1831('0x2e')](_0x21e362[_0x1831('0x28')],_0x21e362[_0x1831('0x2a')]);_0x4909fa['attributes']=_['intersection'](_0x21e362[_0x1831('0x28')],qs[_0x1831('0x2f')](_0x26b806[_0x1831('0x2a')]['fields']));_0x4909fa['attributes']=_0x4909fa[_0x1831('0x30')][_0x1831('0x31')]?_0x4909fa[_0x1831('0x30')]:_0x21e362[_0x1831('0x28')];if(_0x26b806[_0x1831('0x2a')]['includeAll']){_0x4909fa[_0x1831('0x3d')]=[{'all':!![]}];}_0x4909fa=_['merge']({},_0x4909fa,_0x26b806['options']);return db['JscriptyProject'][_0x1831('0x41')](_0x4909fa)[_0x1831('0x21')](handleEntityNotFound(_0x27ca5b,null))[_0x1831('0x21')](respondWithResult(_0x27ca5b,null))[_0x1831('0x40')](handleError(_0x27ca5b,null));};exports[_0x1831('0x42')]=function(_0x1b4403,_0x117f5f){return db[_0x1831('0x26')][_0x1831('0x42')](_0x1b4403['body'],{})[_0x1831('0x21')](respondWithResult(_0x117f5f,0xc9))[_0x1831('0x40')](handleError(_0x117f5f,null));};exports[_0x1831('0x43')]=function(_0x352c48,_0x20bdf3){var _0x4f1689={'raw':![],'where':{'id':_0x352c48['params']['id']}},_0x2c3d47={};_0x2c3d47[_0x1831('0x28')]=_[_0x1831('0x29')](db[_0x1831('0x26')][_0x1831('0x27')]);_0x4f1689[_0x1831('0x30')]=_['intersection'](_0x2c3d47['model'],qs[_0x1831('0x2f')](_0x352c48[_0x1831('0x2a')]['fields']));_0x4f1689[_0x1831('0x30')]=_0x4f1689[_0x1831('0x30')][_0x1831('0x31')]?_0x4f1689['attributes']:_0x2c3d47[_0x1831('0x28')];if(_0x352c48[_0x1831('0x2a')][_0x1831('0x3c')]){_0x4f1689[_0x1831('0x3d')]=[{'all':!![]}];}_0x4f1689=_[_0x1831('0x39')]({},_0x4f1689,_0x352c48[_0x1831('0x3b')]);return db['JscriptyProject'][_0x1831('0x41')](_0x4f1689)[_0x1831('0x21')](handleEntityNotFound(_0x20bdf3,null))[_0x1831('0x21')](function(_0x496675){if(_0x496675){var _0x42895c=_0x496675[_0x1831('0x44')]({'plain':!![]});_0x42895c=qs[_0x1831('0x45')](_0x42895c,['id','createdAt',_0x1831('0x46')]);_0x352c48[_0x1831('0x47')]=_[_0x1831('0x45')](_0x352c48[_0x1831('0x47')],['id',_0x1831('0x48'),'updatedAt']);return db[_0x1831('0x26')][_0x1831('0x42')](_[_0x1831('0x39')](_0x42895c,_0x352c48[_0x1831('0x47')]),{'include':_0x352c48[_0x1831('0x2a')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x1831('0x21')](respondWithResult(_0x20bdf3,0xc9))['catch'](handleError(_0x20bdf3,null));};exports[_0x1831('0x20')]=function(_0x1aac58,_0x1e4086){if(_0x1aac58['body']['id']){delete _0x1aac58[_0x1831('0x47')]['id'];}return db[_0x1831('0x26')]['find']({'where':{'id':_0x1aac58[_0x1831('0x49')]['id']}})['then'](handleEntityNotFound(_0x1e4086,null))[_0x1831('0x21')](saveUpdates(_0x1aac58[_0x1831('0x47')],null))[_0x1831('0x21')](respondWithResult(_0x1e4086,null))[_0x1831('0x40')](handleError(_0x1e4086,null));};exports[_0x1831('0x4a')]=function(_0x2c58bf,_0x152696){return db['JscriptyProject']['find']({'where':{'id':_0x2c58bf[_0x1831('0x49')]['id']}})[_0x1831('0x21')](handleEntityNotFound(_0x152696,null))[_0x1831('0x21')](removeEntity(_0x152696,null))['catch'](handleError(_0x152696,null));};exports[_0x1831('0x4b')]=function(_0x4ff3fe,_0x556c82,_0x48dc09){var _0x550217={'raw':!![],'where':{}};var _0x250a23={};var _0x835a4={'count':0x0,'rows':[]};return db[_0x1831('0x26')][_0x1831('0x4c')]({'where':{'id':_0x4ff3fe[_0x1831('0x49')]['id']}})['then'](handleEntityNotFound(_0x556c82,null))[_0x1831('0x21')](function(_0x36a3da){if(_0x36a3da){_0x250a23[_0x1831('0x28')]=_[_0x1831('0x29')](db[_0x1831('0x4d')][_0x1831('0x27')]);_0x250a23[_0x1831('0x2a')]=_[_0x1831('0x29')](_0x4ff3fe[_0x1831('0x2a')]);_0x250a23[_0x1831('0x2d')]=_[_0x1831('0x2e')](_0x250a23[_0x1831('0x28')],_0x250a23[_0x1831('0x2a')]);_0x550217[_0x1831('0x30')]=_['intersection'](_0x250a23[_0x1831('0x28')],qs[_0x1831('0x2f')](_0x4ff3fe[_0x1831('0x2a')][_0x1831('0x2f')]));_0x550217[_0x1831('0x30')]=_0x550217[_0x1831('0x30')][_0x1831('0x31')]?_0x550217['attributes']:_0x250a23['model'];if(!_0x4ff3fe[_0x1831('0x2a')][_0x1831('0x32')]('nolimit')){_0x550217[_0x1831('0x1a')]=qs[_0x1831('0x1a')](_0x4ff3fe[_0x1831('0x2a')][_0x1831('0x1a')]);_0x550217[_0x1831('0x19')]=qs['offset'](_0x4ff3fe[_0x1831('0x2a')]['offset']);}_0x550217['order']=qs[_0x1831('0x4e')](_0x4ff3fe[_0x1831('0x2a')][_0x1831('0x4e')]);_0x550217[_0x1831('0x35')]=qs[_0x1831('0x2d')](_[_0x1831('0x36')](_0x4ff3fe[_0x1831('0x2a')],_0x250a23[_0x1831('0x2d')]));_0x550217['where'][_0x1831('0x4f')]=_0x36a3da['id'];if(_0x4ff3fe[_0x1831('0x2a')][_0x1831('0x3a')]){_0x550217[_0x1831('0x35')]=_[_0x1831('0x39')](_0x550217[_0x1831('0x35')],{'$or':_['map'](_0x550217[_0x1831('0x30')],function(_0x3d519d){var _0x4e6f58={};_0x4e6f58[_0x3d519d]={'$like':'%'+_0x4ff3fe[_0x1831('0x2a')]['filter']+'%'};return _0x4e6f58;})});}_0x550217=_[_0x1831('0x39')]({},_0x550217,_0x4ff3fe[_0x1831('0x3b')]);return db[_0x1831('0x4d')]['count']({'where':_0x550217['where']})[_0x1831('0x21')](function(_0x5e6bbc){_0x835a4[_0x1831('0x18')]=_0x5e6bbc;if(_0x4ff3fe['query'][_0x1831('0x3c')]){_0x550217['include']=[{'all':!![]}];}return db[_0x1831('0x4d')][_0x1831('0x3e')](_0x550217);})[_0x1831('0x21')](function(_0x55429f){_0x835a4['rows']=_0x55429f;return _0x835a4;});}})['then'](respondWithFilteredResult(_0x556c82,_0x550217))[_0x1831('0x40')](handleError(_0x556c82,null));};exports['getAnswers']=function(_0x764b7,_0x1a1c78,_0x4b57f4){var _0x3a9c46={'raw':!![],'where':{}};var _0x282ffb={};var _0x23f6c6={'count':0x0,'rows':[]};var _0x152027={'dateStart':_0x764b7[_0x1831('0x2a')]['dateStart'],'dateEnd':_0x764b7[_0x1831('0x2a')][_0x1831('0x2c')]};delete _0x764b7['query']['dateStart'];delete _0x764b7[_0x1831('0x2a')][_0x1831('0x2c')];return db[_0x1831('0x26')][_0x1831('0x4c')]({'where':{'id':_0x764b7[_0x1831('0x49')]['id']}})[_0x1831('0x21')](handleEntityNotFound(_0x1a1c78,null))['then'](function(_0x21cb62){if(_0x21cb62){_0x282ffb[_0x1831('0x28')]=_['keys'](db['JscriptyAnswerReport']['rawAttributes']);_0x282ffb['query']=_[_0x1831('0x29')](_0x764b7['query']);_0x282ffb[_0x1831('0x2d')]=_['intersection'](_0x282ffb[_0x1831('0x28')],_0x282ffb[_0x1831('0x2a')]);_0x3a9c46[_0x1831('0x30')]=_['intersection'](_0x282ffb['model'],qs[_0x1831('0x2f')](_0x764b7[_0x1831('0x2a')][_0x1831('0x2f')]));_0x3a9c46[_0x1831('0x30')]=_0x3a9c46[_0x1831('0x30')][_0x1831('0x31')]?_0x3a9c46[_0x1831('0x30')]:_0x282ffb[_0x1831('0x28')];if(!_0x764b7[_0x1831('0x2a')][_0x1831('0x32')](_0x1831('0x33'))){_0x3a9c46['limit']=qs['limit'](_0x764b7[_0x1831('0x2a')][_0x1831('0x1a')]);_0x3a9c46['offset']=qs['offset'](_0x764b7[_0x1831('0x2a')][_0x1831('0x19')]);}_0x3a9c46[_0x1831('0x34')]=qs[_0x1831('0x4e')](_0x764b7[_0x1831('0x2a')][_0x1831('0x4e')]);_0x3a9c46[_0x1831('0x35')]=qs[_0x1831('0x2d')](_[_0x1831('0x36')](_0x764b7[_0x1831('0x2a')],_0x282ffb[_0x1831('0x2d')]));_0x3a9c46[_0x1831('0x35')][_0x1831('0x4f')]=_0x21cb62['id'];if(_0x152027['dateStart']){if(_0x152027[_0x1831('0x2c')]){_0x152027[_0x1831('0x2c')]=moment(_0x152027[_0x1831('0x2c')])[_0x1831('0x38')](0x1,_0x1831('0x37'));}else{_0x152027['dateEnd']=moment(_0x152027['dateStart'])[_0x1831('0x38')](0x1,'day');}_['merge'](_0x3a9c46[_0x1831('0x35')],{'createdAt':{'$gte':_0x152027[_0x1831('0x2b')],'$lte':_0x152027[_0x1831('0x2c')]}});}if(_0x764b7[_0x1831('0x2a')]['filter']){_0x3a9c46['where']=_[_0x1831('0x39')](_0x3a9c46['where'],{'$or':_[_0x1831('0x50')](_0x3a9c46['attributes'],function(_0x582416){var _0x2d5e40={};_0x2d5e40[_0x582416]={'$like':'%'+_0x764b7[_0x1831('0x2a')][_0x1831('0x3a')]+'%'};return _0x2d5e40;})});}_0x3a9c46=_[_0x1831('0x39')]({},_0x3a9c46,_0x764b7[_0x1831('0x3b')]);return db[_0x1831('0x51')][_0x1831('0x18')]({'where':_0x3a9c46[_0x1831('0x35')]})[_0x1831('0x21')](function(_0x2d4cf1){_0x23f6c6['count']=_0x2d4cf1;if(_0x764b7['query']['includeAll']){_0x3a9c46['include']=[{'all':!![]}];}return db[_0x1831('0x51')][_0x1831('0x3e')](_0x3a9c46);})[_0x1831('0x21')](function(_0xcf643d){_0x23f6c6[_0x1831('0x3f')]=_0xcf643d;return _0x23f6c6;});}})['then'](respondWithFilteredResult(_0x1a1c78,_0x3a9c46))[_0x1831('0x40')](handleError(_0x1a1c78,null));};function char(_0x513fd0){return _0x1831('0x52')===typeof _0x513fd0?String[_0x1831('0x53')][_0x1831('0x54')](null,arguments):_0x513fd0;}function needsEncapsulation(_0x255d2d){return!!_0x255d2d&&(_0x255d2d[_0x1831('0x55')]()[_0x1831('0x56')](char(0xd))>=0x0||_0x255d2d[_0x1831('0x55')]()[_0x1831('0x56')](char(0xa))>=0x0||_0x255d2d['toString']()[_0x1831('0x56')](char(0x2c))>=0x0||_0x255d2d[_0x1831('0x55')]()[_0x1831('0x56')](char(0x22))>=0x0);}function encapsulate(_0x11c315){var _0x3f7edd=char(0x22),_0x1a9713='\x5c'+char(0x22),_0x534bd1=_0x11c315[_0x1831('0x55')]()[_0x1831('0x57')](new RegExp(_0x3f7edd,'g'),_0x1a9713);return _0x3f7edd+_0x534bd1+_0x3f7edd;}exports['getSummary']=function(_0x104921,_0x2ca54b,_0x3fda98){var _0x235565,_0x25b280;var _0x5274ab={'dateStart':_0x104921[_0x1831('0x2a')][_0x1831('0x2b')],'dateEnd':_0x104921[_0x1831('0x2a')]['dateEnd']};delete _0x104921[_0x1831('0x2a')]['dateStart'];delete _0x104921['query'][_0x1831('0x2c')];if(_0x5274ab[_0x1831('0x2b')]){if(_0x5274ab[_0x1831('0x2c')]){_0x5274ab[_0x1831('0x2c')]=moment(_0x5274ab[_0x1831('0x2c')])['add'](0x1,_0x1831('0x37'));}else{_0x5274ab[_0x1831('0x2c')]=moment(_0x5274ab[_0x1831('0x2b')])[_0x1831('0x38')](0x1,_0x1831('0x37'));}}return db['JscriptySessionReport'][_0x1831('0x3e')]({'where':{'ProjectId':_0x104921['params']['id'],'starttime':{'$gte':_0x5274ab[_0x1831('0x2b')],'$lte':_0x5274ab[_0x1831('0x2c')]}}})[_0x1831('0x21')](handleEntityNotFound(_0x2ca54b,null))[_0x1831('0x21')](function(_0x11e881){if(_0x11e881){_0x235565=_0x11e881;return db[_0x1831('0x58')][_0x1831('0x3e')]({'where':{'SessionId':{'$in':_[_0x1831('0x50')](_0x235565,'id')},'ProjectId':_0x104921[_0x1831('0x49')]['id']},'order':_0x1831('0x59')});}})['then'](handleEntityNotFound(_0x2ca54b,null))[_0x1831('0x21')](function(_0x3c2fbb){if(_0x3c2fbb){_0x25b280=_0x3c2fbb;var _0x56413c={};for(var _0x488ef5=0x0,_0x4559ff=_0x25b280['length'];_0x488ef5<_0x4559ff;_0x488ef5++){if(!_0x56413c[_0x1831('0x32')](_0x25b280[_0x488ef5][_0x1831('0x5a')])){_0x56413c[_0x25b280[_0x488ef5][_0x1831('0x5a')]]=needsEncapsulation(_0x25b280[_0x488ef5][_0x1831('0x5b')])?encapsulate(_0x25b280[_0x488ef5][_0x1831('0x5b')]):_0x25b280[_0x488ef5][_0x1831('0x5b')];}}var _0x4bb832=[],_0x453ad7={};for(var _0x289d58=0x0,_0xd8b146=_0x235565['length'];_0x289d58<_0xd8b146;_0x289d58++){_0x453ad7={'ProjectId':_0x104921[_0x1831('0x49')]['id'],'SessionId':_0x235565[_0x289d58]['id'],'StartTime':moment(_0x235565[_0x289d58][_0x1831('0x5c')])[_0x1831('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x4ce515=0x0,_0xc3f57d=_0x25b280[_0x1831('0x31')];_0x4ce515<_0xc3f57d;_0x4ce515++){if(_0x25b280[_0x4ce515][_0x1831('0x5e')]==_0x235565[_0x289d58]['id']&&_0x56413c['hasOwnProperty'](_0x25b280[_0x4ce515]['questionId'])){_0x453ad7[_0x56413c[_0x25b280[_0x4ce515][_0x1831('0x5a')]]]=_0x25b280[_0x4ce515][_0x1831('0x5f')];}}for(var _0x430399 in _0x56413c){if(!_0x453ad7[_0x1831('0x32')](_0x56413c[_0x430399])){_0x453ad7[_0x56413c[_0x430399]]=null;}}_0x4bb832[_0x1831('0x60')](_0x453ad7);}return _0x4bb832;}})[_0x1831('0x21')](function(_0x5cf667){if(!_[_0x1831('0x61')](_0x5cf667)){var _0x34366d=toCsv(_0x5cf667);var _0x4e2af3=Date[_0x1831('0x62')]();fs[_0x1831('0x63')](util[_0x1831('0x5d')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x104921['params']['id'],_0x4e2af3),_0x34366d);_0x2ca54b[_0x1831('0x64')](_0x1831('0x65'),_0x1831('0x66')+util[_0x1831('0x5d')]('Jscripty_Project_%d_Summary_%s.csv',_0x104921[_0x1831('0x49')]['id'],_0x4e2af3));_0x2ca54b[_0x1831('0x64')](_0x1831('0x67'),_0x1831('0x68'));return _0x2ca54b['download'](util[_0x1831('0x5d')](_0x1831('0x69'),_0x104921[_0x1831('0x49')]['id'],_0x4e2af3));}else{return _0x2ca54b[_0x1831('0x22')](0xcc);}})[_0x1831('0x40')](handleError(_0x2ca54b,null));};
\ No newline at end of file
+var _0x2679=['rawAttributes','model','query','dateStart','dateEnd','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','add','day','merge','filter','map','options','includeAll','include','JscriptyProject','findAll','rows','catch','show','params','find','create','clone','omit','createdAt','updatedAt','body','findOne','JscriptySessionReport','order','ProjectId','getAnswers','JscriptyAnswerReport','nolimit','toString','indexOf','replace','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send'];(function(_0x71290e,_0x1c5c87){var _0x102650=function(_0x4ac5be){while(--_0x4ac5be){_0x71290e['push'](_0x71290e['shift']());}};_0x102650(++_0x1c5c87);}(_0x2679,0x1ea));var _0x9267=function(_0x320296,_0x245139){_0x320296=_0x320296-0x0;var _0x31d05a=_0x2679[_0x320296];return _0x31d05a;};'use strict';var pdf=require(_0x9267('0x0'));var emlformat=require(_0x9267('0x1'));var rimraf=require(_0x9267('0x2'));var zipdir=require(_0x9267('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9267('0x4'));var moment=require(_0x9267('0x5'));var BPromise=require(_0x9267('0x6'));var Mustache=require('mustache');var util=require(_0x9267('0x7'));var path=require(_0x9267('0x8'));var sox=require(_0x9267('0x9'));var csv=require('to-csv');var ejs=require(_0x9267('0xa'));var fs=require('fs');var _=require(_0x9267('0xb'));var squel=require(_0x9267('0xc'));var crypto=require('crypto');var jsforce=require(_0x9267('0xd'));var deskjs=require(_0x9267('0xe'));var toCsv=require(_0x9267('0xf'));var querystring=require(_0x9267('0x10'));var Papa=require(_0x9267('0x11'));var qs=require(_0x9267('0x12'));var logger=require('../../config/logger')(_0x9267('0x13'));var utils=require(_0x9267('0x14'));var config=require(_0x9267('0x15'));var db=require(_0x9267('0x16'))['db'];function respondWithStatusCode(_0x53b14f,_0x2050c0){_0x2050c0=_0x2050c0||0xcc;return function(_0x53ed72){if(_0x53ed72){return _0x53b14f['sendStatus'](_0x2050c0);}return _0x53b14f[_0x9267('0x17')](_0x2050c0)[_0x9267('0x18')]();};}function respondWithResult(_0x28e9aa,_0xe971e6){_0xe971e6=_0xe971e6||0xc8;return function(_0x3fa85a){if(_0x3fa85a){return _0x28e9aa[_0x9267('0x17')](_0xe971e6)[_0x9267('0x19')](_0x3fa85a);}};}function respondWithFilteredResult(_0x36c370,_0xdc7f8d){return function(_0x40c051){if(_0x40c051){var _0x34f435=_0x40c051[_0x9267('0x1a')],_0x1ed6b0=_0xdc7f8d[_0x9267('0x1b')],_0x36c4e9=_0xdc7f8d[_0x9267('0x1b')]+_0xdc7f8d['limit'],_0x4e05fb;if(_0x36c4e9>=_0x34f435){_0x36c4e9=_0x34f435;_0x4e05fb=0xc8;}else{_0x4e05fb=0xce;}_0x36c370[_0x9267('0x17')](_0x4e05fb);return _0x36c370[_0x9267('0x1c')]('Content-Range',_0x1ed6b0+'-'+_0x36c4e9+'/'+_0x34f435)['json'](_0x40c051);}return null;};}function patchUpdates(_0x903e4f){return function(_0x537294){try{jsonpatch[_0x9267('0x1d')](_0x537294,_0x903e4f,!![]);}catch(_0x18f462){return BPromise[_0x9267('0x1e')](_0x18f462);}return _0x537294[_0x9267('0x1f')]();};}function saveUpdates(_0x1cadbe,_0x336412){return function(_0x377e11){if(_0x377e11){return _0x377e11[_0x9267('0x20')](_0x1cadbe)[_0x9267('0x21')](function(_0x4dab98){return _0x4dab98;});}return null;};}function removeEntity(_0x271e45,_0x4b9dec){return function(_0x307847){if(_0x307847){return _0x307847[_0x9267('0x22')]()[_0x9267('0x21')](function(){_0x271e45[_0x9267('0x17')](0xcc)[_0x9267('0x18')]();});}};}function handleEntityNotFound(_0x2d1b34,_0x31481e){return function(_0x60fa1c){if(!_0x60fa1c){_0x2d1b34[_0x9267('0x23')](0x194);}return _0x60fa1c;};}function handleError(_0xb3d865,_0x266445){_0x266445=_0x266445||0x1f4;return function(_0x39e8ae){logger[_0x9267('0x24')](_0x39e8ae[_0x9267('0x25')]);if(_0x39e8ae[_0x9267('0x26')]){delete _0x39e8ae[_0x9267('0x26')];}_0xb3d865[_0x9267('0x17')](_0x266445)[_0x9267('0x27')](_0x39e8ae);};}exports['index']=function(_0x97dbfa,_0x164d71){var _0xfc2b24={},_0x5c1064={},_0x1dd410={'count':0x0,'rows':[]};var _0xa5e499=db['JscriptyProject'][_0x9267('0x28')];_0x5c1064[_0x9267('0x29')]=_['keys'](_0xa5e499);var _0x17bb86={'dateStart':_0x97dbfa[_0x9267('0x2a')][_0x9267('0x2b')],'dateEnd':_0x97dbfa[_0x9267('0x2a')][_0x9267('0x2c')]};delete _0x97dbfa['query']['dateStart'];delete _0x97dbfa['query']['dateEnd'];_0x5c1064[_0x9267('0x2a')]=_[_0x9267('0x2d')](_0x97dbfa[_0x9267('0x2a')]);_0x5c1064[_0x9267('0x2e')]=_[_0x9267('0x2f')](_0x5c1064['model'],_0x5c1064['query']);_0xfc2b24[_0x9267('0x30')]=_[_0x9267('0x2f')](_0x5c1064[_0x9267('0x29')],qs[_0x9267('0x31')](_0x97dbfa[_0x9267('0x2a')][_0x9267('0x31')]));_0xfc2b24[_0x9267('0x30')]=_0xfc2b24['attributes'][_0x9267('0x32')]?_0xfc2b24[_0x9267('0x30')]:_0x5c1064['model'];if(!_0x97dbfa[_0x9267('0x2a')][_0x9267('0x33')]('nolimit')){_0xfc2b24[_0x9267('0x34')]=qs[_0x9267('0x34')](_0x97dbfa[_0x9267('0x2a')]['limit']);_0xfc2b24[_0x9267('0x1b')]=qs[_0x9267('0x1b')](_0x97dbfa[_0x9267('0x2a')][_0x9267('0x1b')]);}_0xfc2b24['order']=qs[_0x9267('0x35')](_0x97dbfa['query'][_0x9267('0x35')]);_0xfc2b24[_0x9267('0x36')]=qs[_0x9267('0x2e')](_[_0x9267('0x37')](_0x97dbfa['query'],_0x5c1064[_0x9267('0x2e')]));if(_0x17bb86['dateStart']){if(_0x17bb86[_0x9267('0x2c')]){_0x17bb86[_0x9267('0x2c')]=moment(_0x17bb86[_0x9267('0x2c')])[_0x9267('0x38')](0x1,_0x9267('0x39'));}else{_0x17bb86[_0x9267('0x2c')]=moment(_0x17bb86['dateStart'])[_0x9267('0x38')](0x1,'day');}_[_0x9267('0x3a')](_0xfc2b24[_0x9267('0x36')],{'createdAt':{'$gte':_0x17bb86[_0x9267('0x2b')],'$lte':_0x17bb86['dateEnd']}});}if(_0x97dbfa[_0x9267('0x2a')][_0x9267('0x3b')]){_0xfc2b24['where']=_[_0x9267('0x3a')](_0xfc2b24[_0x9267('0x36')],{'$or':_[_0x9267('0x3c')](_0xfc2b24['attributes'],function(_0x380280){var _0x20920e={};_0x20920e[_0x380280]={'$like':'%'+_0x97dbfa['query'][_0x9267('0x3b')]+'%'};return _0x20920e;})});}_0xfc2b24=_[_0x9267('0x3a')]({},_0xfc2b24,_0x97dbfa[_0x9267('0x3d')]);var _0x3784da={'where':_0xfc2b24[_0x9267('0x36')]};return db['JscriptyProject'][_0x9267('0x1a')](_0x3784da)[_0x9267('0x21')](function(_0x29a34c){_0x1dd410[_0x9267('0x1a')]=_0x29a34c;if(_0x97dbfa['query'][_0x9267('0x3e')]){_0xfc2b24[_0x9267('0x3f')]=[{'all':!![]}];}return db[_0x9267('0x40')][_0x9267('0x41')](_0xfc2b24);})['then'](function(_0x5b48f3){_0x1dd410[_0x9267('0x42')]=_0x5b48f3;return _0x1dd410;})[_0x9267('0x21')](respondWithFilteredResult(_0x164d71,_0xfc2b24))[_0x9267('0x43')](handleError(_0x164d71,null));};exports[_0x9267('0x44')]=function(_0x5eb268,_0x16161c){var _0x129984={'raw':![],'where':{'id':_0x5eb268[_0x9267('0x45')]['id']}},_0x5a9cec={};_0x5a9cec[_0x9267('0x29')]=_[_0x9267('0x2d')](db[_0x9267('0x40')]['rawAttributes']);_0x5a9cec[_0x9267('0x2a')]=_['keys'](_0x5eb268['query']);_0x5a9cec[_0x9267('0x2e')]=_[_0x9267('0x2f')](_0x5a9cec[_0x9267('0x29')],_0x5a9cec['query']);_0x129984[_0x9267('0x30')]=_[_0x9267('0x2f')](_0x5a9cec[_0x9267('0x29')],qs[_0x9267('0x31')](_0x5eb268[_0x9267('0x2a')]['fields']));_0x129984[_0x9267('0x30')]=_0x129984[_0x9267('0x30')]['length']?_0x129984[_0x9267('0x30')]:_0x5a9cec[_0x9267('0x29')];if(_0x5eb268[_0x9267('0x2a')]['includeAll']){_0x129984['include']=[{'all':!![]}];}_0x129984=_[_0x9267('0x3a')]({},_0x129984,_0x5eb268[_0x9267('0x3d')]);return db['JscriptyProject'][_0x9267('0x46')](_0x129984)[_0x9267('0x21')](handleEntityNotFound(_0x16161c,null))[_0x9267('0x21')](respondWithResult(_0x16161c,null))['catch'](handleError(_0x16161c,null));};exports['create']=function(_0x272c2e,_0x313dae){return db[_0x9267('0x40')][_0x9267('0x47')](_0x272c2e['body'],{})[_0x9267('0x21')](respondWithResult(_0x313dae,0xc9))[_0x9267('0x43')](handleError(_0x313dae,null));};exports[_0x9267('0x48')]=function(_0x20b016,_0x55af8f){var _0x4973c0={'raw':![],'where':{'id':_0x20b016['params']['id']}},_0x3722b6={};_0x3722b6[_0x9267('0x29')]=_[_0x9267('0x2d')](db['JscriptyProject'][_0x9267('0x28')]);_0x4973c0[_0x9267('0x30')]=_[_0x9267('0x2f')](_0x3722b6[_0x9267('0x29')],qs[_0x9267('0x31')](_0x20b016['query']['fields']));_0x4973c0['attributes']=_0x4973c0[_0x9267('0x30')][_0x9267('0x32')]?_0x4973c0['attributes']:_0x3722b6[_0x9267('0x29')];if(_0x20b016[_0x9267('0x2a')]['includeAll']){_0x4973c0['include']=[{'all':!![]}];}_0x4973c0=_[_0x9267('0x3a')]({},_0x4973c0,_0x20b016[_0x9267('0x3d')]);return db[_0x9267('0x40')][_0x9267('0x46')](_0x4973c0)[_0x9267('0x21')](handleEntityNotFound(_0x55af8f,null))[_0x9267('0x21')](function(_0x1d18a6){if(_0x1d18a6){var _0x5d3ab5=_0x1d18a6['get']({'plain':!![]});_0x5d3ab5=qs[_0x9267('0x49')](_0x5d3ab5,['id',_0x9267('0x4a'),_0x9267('0x4b')]);_0x20b016[_0x9267('0x4c')]=_[_0x9267('0x49')](_0x20b016['body'],['id','createdAt',_0x9267('0x4b')]);return db['JscriptyProject']['create'](_[_0x9267('0x3a')](_0x5d3ab5,_0x20b016[_0x9267('0x4c')]),{'include':_0x20b016[_0x9267('0x2a')]['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x55af8f,0xc9))[_0x9267('0x43')](handleError(_0x55af8f,null));};exports[_0x9267('0x20')]=function(_0x55ff2a,_0x3e57b2){if(_0x55ff2a['body']['id']){delete _0x55ff2a[_0x9267('0x4c')]['id'];}return db[_0x9267('0x40')][_0x9267('0x46')]({'where':{'id':_0x55ff2a[_0x9267('0x45')]['id']}})[_0x9267('0x21')](handleEntityNotFound(_0x3e57b2,null))[_0x9267('0x21')](saveUpdates(_0x55ff2a[_0x9267('0x4c')],null))[_0x9267('0x21')](respondWithResult(_0x3e57b2,null))[_0x9267('0x43')](handleError(_0x3e57b2,null));};exports[_0x9267('0x22')]=function(_0x4fca19,_0x1cd58c){return db[_0x9267('0x40')][_0x9267('0x46')]({'where':{'id':_0x4fca19['params']['id']}})['then'](handleEntityNotFound(_0x1cd58c,null))[_0x9267('0x21')](removeEntity(_0x1cd58c,null))[_0x9267('0x43')](handleError(_0x1cd58c,null));};exports['getSessions']=function(_0x2f6d81,_0x33cf68,_0x48a911){var _0x9c167d={'raw':!![],'where':{}};var _0xf44441={};var _0x458142={'count':0x0,'rows':[]};return db[_0x9267('0x40')][_0x9267('0x4d')]({'where':{'id':_0x2f6d81[_0x9267('0x45')]['id']}})[_0x9267('0x21')](handleEntityNotFound(_0x33cf68,null))[_0x9267('0x21')](function(_0x45a340){if(_0x45a340){_0xf44441['model']=_[_0x9267('0x2d')](db[_0x9267('0x4e')][_0x9267('0x28')]);_0xf44441[_0x9267('0x2a')]=_[_0x9267('0x2d')](_0x2f6d81[_0x9267('0x2a')]);_0xf44441['filters']=_[_0x9267('0x2f')](_0xf44441[_0x9267('0x29')],_0xf44441[_0x9267('0x2a')]);_0x9c167d[_0x9267('0x30')]=_[_0x9267('0x2f')](_0xf44441[_0x9267('0x29')],qs['fields'](_0x2f6d81[_0x9267('0x2a')]['fields']));_0x9c167d['attributes']=_0x9c167d[_0x9267('0x30')][_0x9267('0x32')]?_0x9c167d[_0x9267('0x30')]:_0xf44441[_0x9267('0x29')];if(!_0x2f6d81[_0x9267('0x2a')][_0x9267('0x33')]('nolimit')){_0x9c167d[_0x9267('0x34')]=qs[_0x9267('0x34')](_0x2f6d81[_0x9267('0x2a')]['limit']);_0x9c167d[_0x9267('0x1b')]=qs[_0x9267('0x1b')](_0x2f6d81[_0x9267('0x2a')][_0x9267('0x1b')]);}_0x9c167d[_0x9267('0x4f')]=qs[_0x9267('0x35')](_0x2f6d81['query'][_0x9267('0x35')]);_0x9c167d[_0x9267('0x36')]=qs[_0x9267('0x2e')](_[_0x9267('0x37')](_0x2f6d81[_0x9267('0x2a')],_0xf44441[_0x9267('0x2e')]));_0x9c167d[_0x9267('0x36')][_0x9267('0x50')]=_0x45a340['id'];if(_0x2f6d81[_0x9267('0x2a')][_0x9267('0x3b')]){_0x9c167d[_0x9267('0x36')]=_[_0x9267('0x3a')](_0x9c167d[_0x9267('0x36')],{'$or':_[_0x9267('0x3c')](_0x9c167d[_0x9267('0x30')],function(_0x2d55d8){var _0x1ade4b={};_0x1ade4b[_0x2d55d8]={'$like':'%'+_0x2f6d81[_0x9267('0x2a')][_0x9267('0x3b')]+'%'};return _0x1ade4b;})});}_0x9c167d=_['merge']({},_0x9c167d,_0x2f6d81['options']);return db[_0x9267('0x4e')][_0x9267('0x1a')]({'where':_0x9c167d[_0x9267('0x36')]})[_0x9267('0x21')](function(_0x43a743){_0x458142[_0x9267('0x1a')]=_0x43a743;if(_0x2f6d81[_0x9267('0x2a')]['includeAll']){_0x9c167d[_0x9267('0x3f')]=[{'all':!![]}];}return db[_0x9267('0x4e')][_0x9267('0x41')](_0x9c167d);})['then'](function(_0x57204e){_0x458142[_0x9267('0x42')]=_0x57204e;return _0x458142;});}})[_0x9267('0x21')](respondWithFilteredResult(_0x33cf68,_0x9c167d))['catch'](handleError(_0x33cf68,null));};exports[_0x9267('0x51')]=function(_0x2acd1a,_0x11359b,_0x5504c0){var _0x769445={'raw':!![],'where':{}};var _0x172b0e={};var _0x4f1ac6={'count':0x0,'rows':[]};var _0x14b9d3={'dateStart':_0x2acd1a[_0x9267('0x2a')][_0x9267('0x2b')],'dateEnd':_0x2acd1a[_0x9267('0x2a')][_0x9267('0x2c')]};delete _0x2acd1a[_0x9267('0x2a')][_0x9267('0x2b')];delete _0x2acd1a['query'][_0x9267('0x2c')];return db[_0x9267('0x40')]['findOne']({'where':{'id':_0x2acd1a[_0x9267('0x45')]['id']}})[_0x9267('0x21')](handleEntityNotFound(_0x11359b,null))[_0x9267('0x21')](function(_0xff260b){if(_0xff260b){_0x172b0e[_0x9267('0x29')]=_['keys'](db[_0x9267('0x52')]['rawAttributes']);_0x172b0e[_0x9267('0x2a')]=_['keys'](_0x2acd1a[_0x9267('0x2a')]);_0x172b0e[_0x9267('0x2e')]=_['intersection'](_0x172b0e[_0x9267('0x29')],_0x172b0e[_0x9267('0x2a')]);_0x769445['attributes']=_[_0x9267('0x2f')](_0x172b0e[_0x9267('0x29')],qs[_0x9267('0x31')](_0x2acd1a[_0x9267('0x2a')][_0x9267('0x31')]));_0x769445[_0x9267('0x30')]=_0x769445[_0x9267('0x30')][_0x9267('0x32')]?_0x769445[_0x9267('0x30')]:_0x172b0e['model'];if(!_0x2acd1a['query'][_0x9267('0x33')](_0x9267('0x53'))){_0x769445[_0x9267('0x34')]=qs[_0x9267('0x34')](_0x2acd1a[_0x9267('0x2a')][_0x9267('0x34')]);_0x769445['offset']=qs[_0x9267('0x1b')](_0x2acd1a['query'][_0x9267('0x1b')]);}_0x769445[_0x9267('0x4f')]=qs[_0x9267('0x35')](_0x2acd1a['query'][_0x9267('0x35')]);_0x769445[_0x9267('0x36')]=qs['filters'](_[_0x9267('0x37')](_0x2acd1a[_0x9267('0x2a')],_0x172b0e[_0x9267('0x2e')]));_0x769445['where']['ProjectId']=_0xff260b['id'];if(_0x14b9d3[_0x9267('0x2b')]){if(_0x14b9d3['dateEnd']){_0x14b9d3[_0x9267('0x2c')]=moment(_0x14b9d3[_0x9267('0x2c')])[_0x9267('0x38')](0x1,_0x9267('0x39'));}else{_0x14b9d3[_0x9267('0x2c')]=moment(_0x14b9d3['dateStart'])['add'](0x1,_0x9267('0x39'));}_['merge'](_0x769445[_0x9267('0x36')],{'createdAt':{'$gte':_0x14b9d3[_0x9267('0x2b')],'$lte':_0x14b9d3[_0x9267('0x2c')]}});}if(_0x2acd1a[_0x9267('0x2a')]['filter']){_0x769445['where']=_['merge'](_0x769445[_0x9267('0x36')],{'$or':_[_0x9267('0x3c')](_0x769445['attributes'],function(_0x231e3b){var _0x18ce85={};_0x18ce85[_0x231e3b]={'$like':'%'+_0x2acd1a[_0x9267('0x2a')][_0x9267('0x3b')]+'%'};return _0x18ce85;})});}_0x769445=_[_0x9267('0x3a')]({},_0x769445,_0x2acd1a[_0x9267('0x3d')]);return db[_0x9267('0x52')][_0x9267('0x1a')]({'where':_0x769445[_0x9267('0x36')]})[_0x9267('0x21')](function(_0x129fbc){_0x4f1ac6['count']=_0x129fbc;if(_0x2acd1a['query'][_0x9267('0x3e')]){_0x769445[_0x9267('0x3f')]=[{'all':!![]}];}return db[_0x9267('0x52')]['findAll'](_0x769445);})[_0x9267('0x21')](function(_0x18f9f3){_0x4f1ac6[_0x9267('0x42')]=_0x18f9f3;return _0x4f1ac6;});}})['then'](respondWithFilteredResult(_0x11359b,_0x769445))['catch'](handleError(_0x11359b,null));};function char(_0x4035e9){return'number'===typeof _0x4035e9?String['fromCharCode'][_0x9267('0x1d')](null,arguments):_0x4035e9;}function needsEncapsulation(_0x5f1930){return!!_0x5f1930&&(_0x5f1930[_0x9267('0x54')]()['indexOf'](char(0xd))>=0x0||_0x5f1930['toString']()[_0x9267('0x55')](char(0xa))>=0x0||_0x5f1930['toString']()[_0x9267('0x55')](char(0x2c))>=0x0||_0x5f1930[_0x9267('0x54')]()[_0x9267('0x55')](char(0x22))>=0x0);}function encapsulate(_0x24fada){var _0x189ea1=char(0x22),_0x1efed8='\x5c'+char(0x22),_0x2bcfbc=_0x24fada[_0x9267('0x54')]()[_0x9267('0x56')](new RegExp(_0x189ea1,'g'),_0x1efed8);return _0x189ea1+_0x2bcfbc+_0x189ea1;}exports['getSummary']=function(_0x5c18b0,_0x41560f,_0x503107){var _0x47698f,_0x167ea9;var _0xfef286={'dateStart':_0x5c18b0[_0x9267('0x2a')][_0x9267('0x2b')],'dateEnd':_0x5c18b0[_0x9267('0x2a')][_0x9267('0x2c')]};delete _0x5c18b0[_0x9267('0x2a')]['dateStart'];delete _0x5c18b0[_0x9267('0x2a')][_0x9267('0x2c')];if(_0xfef286[_0x9267('0x2b')]){if(_0xfef286['dateEnd']){_0xfef286[_0x9267('0x2c')]=moment(_0xfef286[_0x9267('0x2c')])['add'](0x1,_0x9267('0x39'));}else{_0xfef286['dateEnd']=moment(_0xfef286['dateStart'])[_0x9267('0x38')](0x1,_0x9267('0x39'));}}return db[_0x9267('0x4e')][_0x9267('0x41')]({'where':{'ProjectId':_0x5c18b0[_0x9267('0x45')]['id'],'starttime':{'$gte':_0xfef286['dateStart'],'$lte':_0xfef286['dateEnd']}}})['then'](handleEntityNotFound(_0x41560f,null))[_0x9267('0x21')](function(_0x3aebc3){if(_0x3aebc3){_0x47698f=_0x3aebc3;return db[_0x9267('0x57')]['findAll']({'where':{'SessionId':{'$in':_[_0x9267('0x3c')](_0x47698f,'id')},'ProjectId':_0x5c18b0[_0x9267('0x45')]['id']},'order':_0x9267('0x58')});}})[_0x9267('0x21')](handleEntityNotFound(_0x41560f,null))['then'](function(_0x31a6b3){if(_0x31a6b3){_0x167ea9=_0x31a6b3;var _0x1e093a={};for(var _0x303687=0x0,_0x1786a3=_0x167ea9['length'];_0x303687<_0x1786a3;_0x303687++){if(!_0x1e093a[_0x9267('0x33')](_0x167ea9[_0x303687][_0x9267('0x59')])){_0x1e093a[_0x167ea9[_0x303687][_0x9267('0x59')]]=needsEncapsulation(_0x167ea9[_0x303687]['question'])?encapsulate(_0x167ea9[_0x303687][_0x9267('0x5a')]):_0x167ea9[_0x303687][_0x9267('0x5a')];}}var _0x5d186e=[],_0x4d8562={};for(var _0x2259a9=0x0,_0x1c3d85=_0x47698f[_0x9267('0x32')];_0x2259a9<_0x1c3d85;_0x2259a9++){_0x4d8562={'ProjectId':_0x5c18b0['params']['id'],'SessionId':_0x47698f[_0x2259a9]['id'],'StartTime':moment(_0x47698f[_0x2259a9][_0x9267('0x5b')])[_0x9267('0x5c')](_0x9267('0x5d'))};for(var _0x2eb88c=0x0,_0x21b123=_0x167ea9['length'];_0x2eb88c<_0x21b123;_0x2eb88c++){if(_0x167ea9[_0x2eb88c][_0x9267('0x5e')]==_0x47698f[_0x2259a9]['id']&&_0x1e093a['hasOwnProperty'](_0x167ea9[_0x2eb88c][_0x9267('0x59')])){_0x4d8562[_0x1e093a[_0x167ea9[_0x2eb88c][_0x9267('0x59')]]]=_0x167ea9[_0x2eb88c][_0x9267('0x5f')];}}for(var _0x1a891c in _0x1e093a){if(!_0x4d8562[_0x9267('0x33')](_0x1e093a[_0x1a891c])){_0x4d8562[_0x1e093a[_0x1a891c]]=null;}}_0x5d186e['push'](_0x4d8562);}return _0x5d186e;}})[_0x9267('0x21')](function(_0x2b81cb){if(!_['isEmpty'](_0x2b81cb)){var _0x254236=toCsv(_0x2b81cb);var _0x4e5717=Date[_0x9267('0x60')]();fs[_0x9267('0x61')](util['format'](_0x9267('0x62'),_0x5c18b0[_0x9267('0x45')]['id'],_0x4e5717),_0x254236);_0x41560f[_0x9267('0x63')](_0x9267('0x64'),_0x9267('0x65')+util[_0x9267('0x5c')](_0x9267('0x66'),_0x5c18b0[_0x9267('0x45')]['id'],_0x4e5717));_0x41560f['setHeader'](_0x9267('0x67'),_0x9267('0x68'));return _0x41560f[_0x9267('0x69')](util['format'](_0x9267('0x62'),_0x5c18b0[_0x9267('0x45')]['id'],_0x4e5717));}else{return _0x41560f[_0x9267('0x23')](0xcc);}})[_0x9267('0x43')](handleError(_0x41560f,null));};
\ No newline at end of file
index 2f4cdb0..afa13ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa61=['../../config/logger','api','bluebird','request-promise','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','util'];(function(_0x2cae43,_0x5972ed){var _0x3600a6=function(_0x1fba03){while(--_0x1fba03){_0x2cae43['push'](_0x2cae43['shift']());}};_0x3600a6(++_0x5972ed);}(_0xaa61,0x1cc));var _0x1aa6=function(_0x48625b,_0x4b805b){_0x48625b=_0x48625b-0x0;var _0x520842=_0xaa61[_0x48625b];return _0x520842;};'use strict';var _=require(_0x1aa6('0x0'));var util=require(_0x1aa6('0x1'));var logger=require(_0x1aa6('0x2'))(_0x1aa6('0x3'));var moment=require('moment');var BPromise=require(_0x1aa6('0x4'));var rp=require(_0x1aa6('0x5'));var attributes=require(_0x1aa6('0x6'));module[_0x1aa6('0x7')]=function(_0x6d49d9,_0x5ef598){return _0x6d49d9[_0x1aa6('0x8')](_0x1aa6('0x9'),attributes,{'tableName':_0x1aa6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d80=['util','../../config/logger','api','moment','bluebird','request-promise','exports','define','JscriptyProject'];(function(_0x323d81,_0x4f6d1b){var _0x238453=function(_0xe3f31c){while(--_0xe3f31c){_0x323d81['push'](_0x323d81['shift']());}};_0x238453(++_0x4f6d1b);}(_0x7d80,0x17a));var _0x07d8=function(_0x4e6e50,_0x2f251d){_0x4e6e50=_0x4e6e50-0x0;var _0x1750b2=_0x7d80[_0x4e6e50];return _0x1750b2;};'use strict';var _=require('lodash');var util=require(_0x07d8('0x0'));var logger=require(_0x07d8('0x1'))(_0x07d8('0x2'));var moment=require(_0x07d8('0x3'));var BPromise=require(_0x07d8('0x4'));var rp=require(_0x07d8('0x5'));var attributes=require('./jscriptyProject.attributes');module[_0x07d8('0x6')]=function(_0x52071c,_0x10ec70){return _0x52071c[_0x07d8('0x7')](_0x07d8('0x8'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 36efcf7..5e3a72b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc50=['error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x3f2b71,_0x25b5de){var _0x189279=function(_0x3e9ae6){while(--_0x3e9ae6){_0x3f2b71['push'](_0x3f2b71['shift']());}};_0x189279(++_0x25b5de);}(_0xdc50,0x1bd));var _0x0dc5=function(_0x284ce2,_0x189b7c){_0x284ce2=_0x284ce2-0x0;var _0x51d01f=_0xdc50[_0x284ce2];return _0x51d01f;};'use strict';var _=require('lodash');var util=require(_0x0dc5('0x0'));var moment=require(_0x0dc5('0x1'));var BPromise=require('bluebird');var rs=require(_0x0dc5('0x2'));var fs=require('fs');var db=require(_0x0dc5('0x3'))['db'];var utils=require(_0x0dc5('0x4'));var logger=require('../../config/logger')(_0x0dc5('0x5'));var config=require(_0x0dc5('0x6'));var jayson=require(_0x0dc5('0x7'));var client=jayson[_0x0dc5('0x8')][_0x0dc5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3771fb,_0x3c85c4,_0x517144){return new BPromise(function(_0xadd3e7,_0xb436b2){return client[_0x0dc5('0xa')](_0x3771fb,_0x517144)[_0x0dc5('0xb')](function(_0x2e7bc3){logger[_0x0dc5('0xc')](_0x0dc5('0xd'),_0x3c85c4,_0x0dc5('0xe'));logger[_0x0dc5('0xf')](_0x0dc5('0x10'),_0x3c85c4,_0x0dc5('0xe'),JSON['stringify'](_0x2e7bc3));if(_0x2e7bc3[_0x0dc5('0x11')]){if(_0x2e7bc3['error'][_0x0dc5('0x12')]===0x1f4){logger[_0x0dc5('0x11')](_0x0dc5('0xd'),_0x3c85c4,_0x2e7bc3[_0x0dc5('0x11')][_0x0dc5('0x13')]);return _0xb436b2(_0x2e7bc3[_0x0dc5('0x11')]['message']);}logger['error'](_0x0dc5('0xd'),_0x3c85c4,_0x2e7bc3[_0x0dc5('0x11')][_0x0dc5('0x13')]);return _0xadd3e7(_0x2e7bc3['error']['message']);}else{logger[_0x0dc5('0xc')](_0x0dc5('0xd'),_0x3c85c4,_0x0dc5('0xe'));_0xadd3e7(_0x2e7bc3[_0x0dc5('0x14')][_0x0dc5('0x13')]);}})[_0x0dc5('0x15')](function(_0x214224){logger[_0x0dc5('0x11')](_0x0dc5('0xd'),_0x3c85c4,_0x214224);_0xb436b2(_0x214224);});});}
\ No newline at end of file
+var _0xf105=['request','then','JscriptyProject,\x20%s,\x20%s','request\x20sent','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1e1e23,_0x242e50){var _0x1c1a60=function(_0x47be3a){while(--_0x47be3a){_0x1e1e23['push'](_0x1e1e23['shift']());}};_0x1c1a60(++_0x242e50);}(_0xf105,0x11c));var _0x5f10=function(_0x33d510,_0xcaf882){_0x33d510=_0x33d510-0x0;var _0x31de74=_0xf105[_0x33d510];return _0x31de74;};'use strict';var _=require(_0x5f10('0x0'));var util=require(_0x5f10('0x1'));var moment=require(_0x5f10('0x2'));var BPromise=require(_0x5f10('0x3'));var rs=require('randomstring');var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x5f10('0x4'));var logger=require(_0x5f10('0x5'))(_0x5f10('0x6'));var config=require(_0x5f10('0x7'));var jayson=require(_0x5f10('0x8'));var client=jayson[_0x5f10('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb22013,_0x1584b2,_0x189ebd){return new BPromise(function(_0x570c20,_0x371d6c){return client[_0x5f10('0xa')](_0xb22013,_0x189ebd)[_0x5f10('0xb')](function(_0x22f703){logger['info'](_0x5f10('0xc'),_0x1584b2,_0x5f10('0xd'));logger['debug'](_0x5f10('0xe'),_0x1584b2,_0x5f10('0xd'),JSON[_0x5f10('0xf')](_0x22f703));if(_0x22f703[_0x5f10('0x10')]){if(_0x22f703[_0x5f10('0x10')]['code']===0x1f4){logger[_0x5f10('0x10')](_0x5f10('0xc'),_0x1584b2,_0x22f703[_0x5f10('0x10')][_0x5f10('0x11')]);return _0x371d6c(_0x22f703[_0x5f10('0x10')][_0x5f10('0x11')]);}logger['error'](_0x5f10('0xc'),_0x1584b2,_0x22f703[_0x5f10('0x10')][_0x5f10('0x11')]);return _0x570c20(_0x22f703['error'][_0x5f10('0x11')]);}else{logger[_0x5f10('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x1584b2,_0x5f10('0xd'));_0x570c20(_0x22f703[_0x5f10('0x13')][_0x5f10('0x11')]);}})[_0x5f10('0x14')](function(_0x2688f3){logger[_0x5f10('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x1584b2,_0x2688f3);_0x371d6c(_0x2688f3);});});}
\ No newline at end of file
index 14a9828..8f5ee78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5a5=['/:id','show','post','create','put','update','delete','destroy','util','path','express','Router','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x59fe4f,_0x5e2660){var _0x1651a1=function(_0x30c183){while(--_0x30c183){_0x59fe4f['push'](_0x59fe4f['shift']());}};_0x1651a1(++_0x5e2660);}(_0xa5a5,0x6c));var _0x5a5a=function(_0x3a0ebd,_0x47f368){_0x3a0ebd=_0x3a0ebd-0x0;var _0x51a660=_0xa5a5[_0x3a0ebd];return _0x51a660;};'use strict';var multer=require('multer');var util=require(_0x5a5a('0x0'));var path=require(_0x5a5a('0x1'));var express=require(_0x5a5a('0x2'));var router=express[_0x5a5a('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5a5a('0x4'));var config=require(_0x5a5a('0x5'));var controller=require(_0x5a5a('0x6'));router['get']('/',auth[_0x5a5a('0x7')](),controller[_0x5a5a('0x8')]);router[_0x5a5a('0x9')](_0x5a5a('0xa'),auth[_0x5a5a('0x7')](),controller[_0x5a5a('0xb')]);router[_0x5a5a('0x9')](_0x5a5a('0xc'),auth[_0x5a5a('0x7')](),controller[_0x5a5a('0xd')]);router[_0x5a5a('0xe')]('/',auth[_0x5a5a('0x7')](),controller[_0x5a5a('0xf')]);router[_0x5a5a('0x10')](_0x5a5a('0xc'),auth[_0x5a5a('0x7')](),controller[_0x5a5a('0x11')]);router[_0x5a5a('0x12')](_0x5a5a('0xc'),auth['isAuthenticated'](),controller[_0x5a5a('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x0851=['put','/:id','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x5da0d9,_0x49ee54){var _0x4b6d2f=function(_0x9832cf){while(--_0x9832cf){_0x5da0d9['push'](_0x5da0d9['shift']());}};_0x4b6d2f(++_0x49ee54);}(_0x0851,0x8a));var _0x1085=function(_0x27b2b1,_0x23466d){_0x27b2b1=_0x27b2b1-0x0;var _0x44640e=_0x0851[_0x27b2b1];return _0x44640e;};'use strict';var multer=require(_0x1085('0x0'));var util=require(_0x1085('0x1'));var path=require(_0x1085('0x2'));var express=require(_0x1085('0x3'));var router=express['Router']();var auth=require(_0x1085('0x4'));var interaction=require(_0x1085('0x5'));var config=require(_0x1085('0x6'));var controller=require(_0x1085('0x7'));router[_0x1085('0x8')]('/',auth[_0x1085('0x9')](),controller[_0x1085('0xa')]);router[_0x1085('0x8')](_0x1085('0xb'),auth[_0x1085('0x9')](),controller[_0x1085('0xc')]);router[_0x1085('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1085('0xd')]);router[_0x1085('0xe')]('/',auth[_0x1085('0x9')](),controller[_0x1085('0xf')]);router[_0x1085('0x10')](_0x1085('0x11'),auth['isAuthenticated'](),controller[_0x1085('0x12')]);router[_0x1085('0x13')](_0x1085('0x11'),auth[_0x1085('0x9')](),controller[_0x1085('0x14')]);module[_0x1085('0x15')]=router;
\ No newline at end of file
index cfea116..5d61e69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd6f=['STRING','TEXT','long','sequelize','exports'];(function(_0x121d4f,_0xfcfa14){var _0x4ad781=function(_0xbabea6){while(--_0xbabea6){_0x121d4f['push'](_0x121d4f['shift']());}};_0x4ad781(++_0xfcfa14);}(_0xfd6f,0x19d));var _0xffd6=function(_0x41362f,_0x298c37){_0x41362f=_0x41362f-0x0;var _0xe397fb=_0xfd6f[_0x41362f];return _0xe397fb;};'use strict';var Sequelize=require(_0xffd6('0x0'));module[_0xffd6('0x1')]={'question':{'type':Sequelize[_0xffd6('0x2')]},'answer':{'type':Sequelize[_0xffd6('0x3')](_0xffd6('0x4'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xffd6('0x2')]},'queue':{'type':Sequelize[_0xffd6('0x2')]},'uniqueid':{'type':Sequelize[_0xffd6('0x2')]},'calleridname':{'type':Sequelize[_0xffd6('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0xffd6('0x2')]}};
\ No newline at end of file
+var _0x453b=['long','sequelize','exports','STRING','TEXT'];(function(_0x1f8d3d,_0xb7de72){var _0x468684=function(_0x227c1a){while(--_0x227c1a){_0x1f8d3d['push'](_0x1f8d3d['shift']());}};_0x468684(++_0xb7de72);}(_0x453b,0x164));var _0xb453=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x453b[_0x1b7368];return _0x25d54c;};'use strict';var Sequelize=require(_0xb453('0x0'));module[_0xb453('0x1')]={'question':{'type':Sequelize[_0xb453('0x2')]},'answer':{'type':Sequelize[_0xb453('0x3')](_0xb453('0x4'))},'membername':{'type':Sequelize[_0xb453('0x2')]},'projectname':{'type':Sequelize[_0xb453('0x2')]},'queue':{'type':Sequelize[_0xb453('0x2')]},'uniqueid':{'type':Sequelize[_0xb453('0x2')]},'calleridname':{'type':Sequelize[_0xb453('0x2')]},'calleridnum':{'type':Sequelize[_0xb453('0x2')]},'questionId':{'type':Sequelize[_0xb453('0x2')]}};
\ No newline at end of file
index a3aca8f..8c93405 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfea9=['squel','crypto','jsforce','desk.js','to-csv','papaparse','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','JscriptyQuestionReport','model','query','dateStart','dateEnd','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','add','day','merge','filter','map','options','count','findAll','rows','catch','show','params','includeAll','include','create','update','body','find','describe','rimraf','request-promise','moment','mustache','util','path','sox','ejs','lodash'];(function(_0x5bca31,_0x538625){var _0x255e5d=function(_0x4ecd8a){while(--_0x4ecd8a){_0x5bca31['push'](_0x5bca31['shift']());}};_0x255e5d(++_0x538625);}(_0xfea9,0x10b));var _0x9fea=function(_0x4103c8,_0x4fc91a){_0x4103c8=_0x4103c8-0x0;var _0x386216=_0xfea9[_0x4103c8];return _0x386216;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9fea('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9fea('0x1'));var moment=require(_0x9fea('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9fea('0x3'));var util=require(_0x9fea('0x4'));var path=require(_0x9fea('0x5'));var sox=require(_0x9fea('0x6'));var csv=require('to-csv');var ejs=require(_0x9fea('0x7'));var fs=require('fs');var _=require(_0x9fea('0x8'));var squel=require(_0x9fea('0x9'));var crypto=require(_0x9fea('0xa'));var jsforce=require(_0x9fea('0xb'));var deskjs=require(_0x9fea('0xc'));var toCsv=require(_0x9fea('0xd'));var querystring=require('querystring');var Papa=require(_0x9fea('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0x9fea('0xf'))(_0x9fea('0x10'));var utils=require('../../config/utils');var config=require(_0x9fea('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fce08,_0x183dd4){_0x183dd4=_0x183dd4||0xcc;return function(_0x496fbe){if(_0x496fbe){return _0x1fce08[_0x9fea('0x12')](_0x183dd4);}return _0x1fce08[_0x9fea('0x13')](_0x183dd4)[_0x9fea('0x14')]();};}function respondWithResult(_0x1e5488,_0x1a3ec1){_0x1a3ec1=_0x1a3ec1||0xc8;return function(_0x32dea4){if(_0x32dea4){return _0x1e5488['status'](_0x1a3ec1)[_0x9fea('0x15')](_0x32dea4);}};}function respondWithFilteredResult(_0x9168a9,_0x3a6a33){return function(_0x322adb){if(_0x322adb){var _0x41225b=_0x322adb['count'],_0x3ab542=_0x3a6a33[_0x9fea('0x16')],_0x4f2a59=_0x3a6a33[_0x9fea('0x16')]+_0x3a6a33[_0x9fea('0x17')],_0x4c0d00;if(_0x4f2a59>=_0x41225b){_0x4f2a59=_0x41225b;_0x4c0d00=0xc8;}else{_0x4c0d00=0xce;}_0x9168a9[_0x9fea('0x13')](_0x4c0d00);return _0x9168a9[_0x9fea('0x18')](_0x9fea('0x19'),_0x3ab542+'-'+_0x4f2a59+'/'+_0x41225b)[_0x9fea('0x15')](_0x322adb);}return null;};}function patchUpdates(_0x288add){return function(_0x411a65){try{jsonpatch[_0x9fea('0x1a')](_0x411a65,_0x288add,!![]);}catch(_0x49da34){return BPromise['reject'](_0x49da34);}return _0x411a65[_0x9fea('0x1b')]();};}function saveUpdates(_0x5dc44b,_0x30826c){return function(_0x425822){if(_0x425822){return _0x425822['update'](_0x5dc44b)['then'](function(_0x486f19){return _0x486f19;});}return null;};}function removeEntity(_0x4a8957,_0x30ab30){return function(_0x535496){if(_0x535496){return _0x535496[_0x9fea('0x1c')]()[_0x9fea('0x1d')](function(){_0x4a8957[_0x9fea('0x13')](0xcc)[_0x9fea('0x14')]();});}};}function handleEntityNotFound(_0x550afc,_0x4e4fe7){return function(_0x40e194){if(!_0x40e194){_0x550afc[_0x9fea('0x12')](0x194);}return _0x40e194;};}function handleError(_0x38eab5,_0x31ace0){_0x31ace0=_0x31ace0||0x1f4;return function(_0x2e4c1f){logger[_0x9fea('0x1e')](_0x2e4c1f[_0x9fea('0x1f')]);if(_0x2e4c1f['name']){delete _0x2e4c1f[_0x9fea('0x20')];}_0x38eab5[_0x9fea('0x13')](_0x31ace0)[_0x9fea('0x21')](_0x2e4c1f);};}exports[_0x9fea('0x22')]=function(_0x39b2e4,_0x15b2c0){var _0x3df3bc={},_0x1bf781={},_0x4eb60e={'count':0x0,'rows':[]};var _0xee3052=db[_0x9fea('0x23')]['rawAttributes'];_0x1bf781[_0x9fea('0x24')]=_['keys'](_0xee3052);var _0x4ddeff={'dateStart':_0x39b2e4[_0x9fea('0x25')][_0x9fea('0x26')],'dateEnd':_0x39b2e4[_0x9fea('0x25')]['dateEnd']};delete _0x39b2e4['query'][_0x9fea('0x26')];delete _0x39b2e4[_0x9fea('0x25')][_0x9fea('0x27')];_0x1bf781[_0x9fea('0x25')]=_[_0x9fea('0x28')](_0x39b2e4[_0x9fea('0x25')]);_0x1bf781[_0x9fea('0x29')]=_[_0x9fea('0x2a')](_0x1bf781['model'],_0x1bf781[_0x9fea('0x25')]);_0x3df3bc[_0x9fea('0x2b')]=_[_0x9fea('0x2a')](_0x1bf781[_0x9fea('0x24')],qs[_0x9fea('0x2c')](_0x39b2e4['query'][_0x9fea('0x2c')]));_0x3df3bc[_0x9fea('0x2b')]=_0x3df3bc[_0x9fea('0x2b')][_0x9fea('0x2d')]?_0x3df3bc[_0x9fea('0x2b')]:_0x1bf781[_0x9fea('0x24')];if(!_0x39b2e4['query']['hasOwnProperty'](_0x9fea('0x2e'))){_0x3df3bc[_0x9fea('0x17')]=qs[_0x9fea('0x17')](_0x39b2e4['query'][_0x9fea('0x17')]);_0x3df3bc[_0x9fea('0x16')]=qs[_0x9fea('0x16')](_0x39b2e4['query'][_0x9fea('0x16')]);}_0x3df3bc['order']=qs[_0x9fea('0x2f')](_0x39b2e4['query'][_0x9fea('0x2f')]);_0x3df3bc[_0x9fea('0x30')]=qs[_0x9fea('0x29')](_[_0x9fea('0x31')](_0x39b2e4['query'],_0x1bf781['filters']));if(_0x4ddeff[_0x9fea('0x26')]){if(_0x4ddeff[_0x9fea('0x27')]){_0x4ddeff['dateEnd']=moment(_0x4ddeff[_0x9fea('0x27')])[_0x9fea('0x32')](0x1,_0x9fea('0x33'));}else{_0x4ddeff[_0x9fea('0x27')]=moment(_0x4ddeff[_0x9fea('0x26')])[_0x9fea('0x32')](0x1,_0x9fea('0x33'));}_[_0x9fea('0x34')](_0x3df3bc[_0x9fea('0x30')],{'createdAt':{'$gte':_0x4ddeff['dateStart'],'$lte':_0x4ddeff[_0x9fea('0x27')]}});}if(_0x39b2e4[_0x9fea('0x25')][_0x9fea('0x35')]){_0x3df3bc['where']=_['merge'](_0x3df3bc[_0x9fea('0x30')],{'$or':_[_0x9fea('0x36')](_0x3df3bc[_0x9fea('0x2b')],function(_0x3be4a1){var _0x204c39={};_0x204c39[_0x3be4a1]={'$like':'%'+_0x39b2e4[_0x9fea('0x25')][_0x9fea('0x35')]+'%'};return _0x204c39;})});}_0x3df3bc=_['merge']({},_0x3df3bc,_0x39b2e4[_0x9fea('0x37')]);var _0x1000ce={'where':_0x3df3bc[_0x9fea('0x30')]};return db[_0x9fea('0x23')][_0x9fea('0x38')](_0x1000ce)[_0x9fea('0x1d')](function(_0x4d0204){_0x4eb60e[_0x9fea('0x38')]=_0x4d0204;if(_0x39b2e4['query']['includeAll']){_0x3df3bc['include']=[{'all':!![]}];}return db[_0x9fea('0x23')][_0x9fea('0x39')](_0x3df3bc);})[_0x9fea('0x1d')](function(_0x4390bb){_0x4eb60e[_0x9fea('0x3a')]=_0x4390bb;return _0x4eb60e;})[_0x9fea('0x1d')](respondWithFilteredResult(_0x15b2c0,_0x3df3bc))[_0x9fea('0x3b')](handleError(_0x15b2c0,null));};exports[_0x9fea('0x3c')]=function(_0x4a47c0,_0x1abdbf){var _0x484469={'raw':!![],'where':{'id':_0x4a47c0[_0x9fea('0x3d')]['id']}},_0x313eef={};_0x313eef[_0x9fea('0x24')]=_[_0x9fea('0x28')](db[_0x9fea('0x23')]['rawAttributes']);_0x313eef[_0x9fea('0x25')]=_[_0x9fea('0x28')](_0x4a47c0[_0x9fea('0x25')]);_0x313eef[_0x9fea('0x29')]=_[_0x9fea('0x2a')](_0x313eef[_0x9fea('0x24')],_0x313eef[_0x9fea('0x25')]);_0x484469[_0x9fea('0x2b')]=_[_0x9fea('0x2a')](_0x313eef[_0x9fea('0x24')],qs['fields'](_0x4a47c0[_0x9fea('0x25')][_0x9fea('0x2c')]));_0x484469[_0x9fea('0x2b')]=_0x484469[_0x9fea('0x2b')][_0x9fea('0x2d')]?_0x484469[_0x9fea('0x2b')]:_0x313eef['model'];if(_0x4a47c0[_0x9fea('0x25')][_0x9fea('0x3e')]){_0x484469[_0x9fea('0x3f')]=[{'all':!![]}];}_0x484469=_[_0x9fea('0x34')]({},_0x484469,_0x4a47c0[_0x9fea('0x37')]);return db[_0x9fea('0x23')]['find'](_0x484469)[_0x9fea('0x1d')](handleEntityNotFound(_0x1abdbf,null))['then'](respondWithResult(_0x1abdbf,null))[_0x9fea('0x3b')](handleError(_0x1abdbf,null));};exports[_0x9fea('0x40')]=function(_0x168de1,_0x40bea0){return db[_0x9fea('0x23')]['create'](_0x168de1['body'],{})[_0x9fea('0x1d')](respondWithResult(_0x40bea0,0xc9))['catch'](handleError(_0x40bea0,null));};exports[_0x9fea('0x41')]=function(_0x5df3de,_0x294081){if(_0x5df3de[_0x9fea('0x42')]['id']){delete _0x5df3de[_0x9fea('0x42')]['id'];}return db[_0x9fea('0x23')][_0x9fea('0x43')]({'where':{'id':_0x5df3de['params']['id']}})[_0x9fea('0x1d')](handleEntityNotFound(_0x294081,null))['then'](saveUpdates(_0x5df3de[_0x9fea('0x42')],null))[_0x9fea('0x1d')](respondWithResult(_0x294081,null))[_0x9fea('0x3b')](handleError(_0x294081,null));};exports[_0x9fea('0x1c')]=function(_0x5c81ef,_0x34829e){return db['JscriptyQuestionReport'][_0x9fea('0x43')]({'where':{'id':_0x5c81ef['params']['id']}})[_0x9fea('0x1d')](handleEntityNotFound(_0x34829e,null))[_0x9fea('0x1d')](removeEntity(_0x34829e,null))[_0x9fea('0x3b')](handleError(_0x34829e,null));};exports['describe']=function(_0x84564d,_0x1a77aa){return db[_0x9fea('0x23')][_0x9fea('0x44')]()['then'](respondWithResult(_0x1a77aa,null))[_0x9fea('0x3b')](handleError(_0x1a77aa,null));};
\ No newline at end of file
+var _0x10c1=['then','destroy','end','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','attributes','model','fields','length','nolimit','sort','where','add','day','merge','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update'];(function(_0x220b53,_0x4eb522){var _0x324c13=function(_0x49fc9d){while(--_0x49fc9d){_0x220b53['push'](_0x220b53['shift']());}};_0x324c13(++_0x4eb522);}(_0x10c1,0x101));var _0x110c=function(_0x5b219d,_0x41d73c){_0x5b219d=_0x5b219d-0x0;var _0x51f5cb=_0x10c1[_0x5b219d];return _0x51f5cb;};'use strict';var pdf=require(_0x110c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x110c('0x1'));var zipdir=require(_0x110c('0x2'));var jsonpatch=require(_0x110c('0x3'));var rp=require(_0x110c('0x4'));var moment=require('moment');var BPromise=require(_0x110c('0x5'));var Mustache=require(_0x110c('0x6'));var util=require(_0x110c('0x7'));var path=require(_0x110c('0x8'));var sox=require(_0x110c('0x9'));var csv=require('to-csv');var ejs=require(_0x110c('0xa'));var fs=require('fs');var _=require(_0x110c('0xb'));var squel=require(_0x110c('0xc'));var crypto=require('crypto');var jsforce=require(_0x110c('0xd'));var deskjs=require(_0x110c('0xe'));var toCsv=require(_0x110c('0xf'));var querystring=require(_0x110c('0x10'));var Papa=require(_0x110c('0x11'));var qs=require(_0x110c('0x12'));var logger=require(_0x110c('0x13'))(_0x110c('0x14'));var utils=require(_0x110c('0x15'));var config=require(_0x110c('0x16'));var db=require(_0x110c('0x17'))['db'];function respondWithStatusCode(_0x500f73,_0x4d738d){_0x4d738d=_0x4d738d||0xcc;return function(_0x35d367){if(_0x35d367){return _0x500f73[_0x110c('0x18')](_0x4d738d);}return _0x500f73[_0x110c('0x19')](_0x4d738d)['end']();};}function respondWithResult(_0x1dff4b,_0x347753){_0x347753=_0x347753||0xc8;return function(_0xbf07b9){if(_0xbf07b9){return _0x1dff4b['status'](_0x347753)[_0x110c('0x1a')](_0xbf07b9);}};}function respondWithFilteredResult(_0x218683,_0x473459){return function(_0x163f0e){if(_0x163f0e){var _0xb68a7f=_0x163f0e[_0x110c('0x1b')],_0x456ffa=_0x473459[_0x110c('0x1c')],_0x2c4306=_0x473459[_0x110c('0x1c')]+_0x473459[_0x110c('0x1d')],_0x4d045a;if(_0x2c4306>=_0xb68a7f){_0x2c4306=_0xb68a7f;_0x4d045a=0xc8;}else{_0x4d045a=0xce;}_0x218683[_0x110c('0x19')](_0x4d045a);return _0x218683['set'](_0x110c('0x1e'),_0x456ffa+'-'+_0x2c4306+'/'+_0xb68a7f)[_0x110c('0x1a')](_0x163f0e);}return null;};}function patchUpdates(_0x1417b9){return function(_0x27ada4){try{jsonpatch[_0x110c('0x1f')](_0x27ada4,_0x1417b9,!![]);}catch(_0x590978){return BPromise[_0x110c('0x20')](_0x590978);}return _0x27ada4[_0x110c('0x21')]();};}function saveUpdates(_0x2eefd8,_0x3820e1){return function(_0x112fb1){if(_0x112fb1){return _0x112fb1[_0x110c('0x22')](_0x2eefd8)[_0x110c('0x23')](function(_0xaaaac2){return _0xaaaac2;});}return null;};}function removeEntity(_0x4afcf4,_0x45a48d){return function(_0x2ce06f){if(_0x2ce06f){return _0x2ce06f[_0x110c('0x24')]()[_0x110c('0x23')](function(){_0x4afcf4[_0x110c('0x19')](0xcc)[_0x110c('0x25')]();});}};}function handleEntityNotFound(_0x329a92,_0x4b6d8c){return function(_0x5ea84d){if(!_0x5ea84d){_0x329a92[_0x110c('0x18')](0x194);}return _0x5ea84d;};}function handleError(_0x34ae10,_0xb3c83){_0xb3c83=_0xb3c83||0x1f4;return function(_0x621d8){logger[_0x110c('0x26')](_0x621d8[_0x110c('0x27')]);if(_0x621d8[_0x110c('0x28')]){delete _0x621d8[_0x110c('0x28')];}_0x34ae10[_0x110c('0x19')](_0xb3c83)[_0x110c('0x29')](_0x621d8);};}exports[_0x110c('0x2a')]=function(_0x9daeaf,_0x22cdba){var _0x9e24d5={},_0x4d100d={},_0x59e740={'count':0x0,'rows':[]};var _0x7414f2=db[_0x110c('0x2b')][_0x110c('0x2c')];_0x4d100d['model']=_[_0x110c('0x2d')](_0x7414f2);var _0x559d9d={'dateStart':_0x9daeaf[_0x110c('0x2e')][_0x110c('0x2f')],'dateEnd':_0x9daeaf[_0x110c('0x2e')][_0x110c('0x30')]};delete _0x9daeaf[_0x110c('0x2e')]['dateStart'];delete _0x9daeaf['query'][_0x110c('0x30')];_0x4d100d['query']=_[_0x110c('0x2d')](_0x9daeaf[_0x110c('0x2e')]);_0x4d100d[_0x110c('0x31')]=_[_0x110c('0x32')](_0x4d100d['model'],_0x4d100d[_0x110c('0x2e')]);_0x9e24d5[_0x110c('0x33')]=_[_0x110c('0x32')](_0x4d100d[_0x110c('0x34')],qs[_0x110c('0x35')](_0x9daeaf[_0x110c('0x2e')][_0x110c('0x35')]));_0x9e24d5[_0x110c('0x33')]=_0x9e24d5[_0x110c('0x33')][_0x110c('0x36')]?_0x9e24d5[_0x110c('0x33')]:_0x4d100d[_0x110c('0x34')];if(!_0x9daeaf[_0x110c('0x2e')]['hasOwnProperty'](_0x110c('0x37'))){_0x9e24d5[_0x110c('0x1d')]=qs[_0x110c('0x1d')](_0x9daeaf[_0x110c('0x2e')][_0x110c('0x1d')]);_0x9e24d5[_0x110c('0x1c')]=qs['offset'](_0x9daeaf['query'][_0x110c('0x1c')]);}_0x9e24d5['order']=qs[_0x110c('0x38')](_0x9daeaf[_0x110c('0x2e')]['sort']);_0x9e24d5[_0x110c('0x39')]=qs[_0x110c('0x31')](_['pick'](_0x9daeaf[_0x110c('0x2e')],_0x4d100d['filters']));if(_0x559d9d['dateStart']){if(_0x559d9d[_0x110c('0x30')]){_0x559d9d[_0x110c('0x30')]=moment(_0x559d9d[_0x110c('0x30')])[_0x110c('0x3a')](0x1,_0x110c('0x3b'));}else{_0x559d9d[_0x110c('0x30')]=moment(_0x559d9d[_0x110c('0x2f')])[_0x110c('0x3a')](0x1,_0x110c('0x3b'));}_[_0x110c('0x3c')](_0x9e24d5[_0x110c('0x39')],{'createdAt':{'$gte':_0x559d9d[_0x110c('0x2f')],'$lte':_0x559d9d[_0x110c('0x30')]}});}if(_0x9daeaf[_0x110c('0x2e')][_0x110c('0x3d')]){_0x9e24d5['where']=_[_0x110c('0x3c')](_0x9e24d5[_0x110c('0x39')],{'$or':_['map'](_0x9e24d5[_0x110c('0x33')],function(_0x51f704){var _0x2c605b={};_0x2c605b[_0x51f704]={'$like':'%'+_0x9daeaf['query']['filter']+'%'};return _0x2c605b;})});}_0x9e24d5=_[_0x110c('0x3c')]({},_0x9e24d5,_0x9daeaf[_0x110c('0x3e')]);var _0xba8c71={'where':_0x9e24d5[_0x110c('0x39')]};return db[_0x110c('0x2b')]['count'](_0xba8c71)[_0x110c('0x23')](function(_0xf425f1){_0x59e740[_0x110c('0x1b')]=_0xf425f1;if(_0x9daeaf[_0x110c('0x2e')][_0x110c('0x3f')]){_0x9e24d5[_0x110c('0x40')]=[{'all':!![]}];}return db[_0x110c('0x2b')][_0x110c('0x41')](_0x9e24d5);})[_0x110c('0x23')](function(_0x4bc10d){_0x59e740[_0x110c('0x42')]=_0x4bc10d;return _0x59e740;})[_0x110c('0x23')](respondWithFilteredResult(_0x22cdba,_0x9e24d5))[_0x110c('0x43')](handleError(_0x22cdba,null));};exports['show']=function(_0x263741,_0x273f87){var _0x57ed4a={'raw':!![],'where':{'id':_0x263741[_0x110c('0x44')]['id']}},_0x49af55={};_0x49af55[_0x110c('0x34')]=_[_0x110c('0x2d')](db[_0x110c('0x2b')]['rawAttributes']);_0x49af55[_0x110c('0x2e')]=_[_0x110c('0x2d')](_0x263741[_0x110c('0x2e')]);_0x49af55['filters']=_[_0x110c('0x32')](_0x49af55[_0x110c('0x34')],_0x49af55['query']);_0x57ed4a[_0x110c('0x33')]=_['intersection'](_0x49af55[_0x110c('0x34')],qs[_0x110c('0x35')](_0x263741[_0x110c('0x2e')][_0x110c('0x35')]));_0x57ed4a['attributes']=_0x57ed4a[_0x110c('0x33')][_0x110c('0x36')]?_0x57ed4a[_0x110c('0x33')]:_0x49af55[_0x110c('0x34')];if(_0x263741[_0x110c('0x2e')]['includeAll']){_0x57ed4a[_0x110c('0x40')]=[{'all':!![]}];}_0x57ed4a=_[_0x110c('0x3c')]({},_0x57ed4a,_0x263741[_0x110c('0x3e')]);return db['JscriptyQuestionReport'][_0x110c('0x45')](_0x57ed4a)[_0x110c('0x23')](handleEntityNotFound(_0x273f87,null))[_0x110c('0x23')](respondWithResult(_0x273f87,null))[_0x110c('0x43')](handleError(_0x273f87,null));};exports[_0x110c('0x46')]=function(_0x11b017,_0x3e220c){return db['JscriptyQuestionReport'][_0x110c('0x46')](_0x11b017['body'],{})['then'](respondWithResult(_0x3e220c,0xc9))[_0x110c('0x43')](handleError(_0x3e220c,null));};exports[_0x110c('0x22')]=function(_0x556ec5,_0x2c293e){if(_0x556ec5[_0x110c('0x47')]['id']){delete _0x556ec5[_0x110c('0x47')]['id'];}return db[_0x110c('0x2b')][_0x110c('0x45')]({'where':{'id':_0x556ec5[_0x110c('0x44')]['id']}})[_0x110c('0x23')](handleEntityNotFound(_0x2c293e,null))[_0x110c('0x23')](saveUpdates(_0x556ec5['body'],null))[_0x110c('0x23')](respondWithResult(_0x2c293e,null))[_0x110c('0x43')](handleError(_0x2c293e,null));};exports[_0x110c('0x24')]=function(_0x17b46c,_0x4c91d1){return db[_0x110c('0x2b')][_0x110c('0x45')]({'where':{'id':_0x17b46c[_0x110c('0x44')]['id']}})[_0x110c('0x23')](handleEntityNotFound(_0x4c91d1,null))[_0x110c('0x23')](removeEntity(_0x4c91d1,null))['catch'](handleError(_0x4c91d1,null));};exports[_0x110c('0x48')]=function(_0x527c58,_0x791c61){return db['JscriptyQuestionReport'][_0x110c('0x48')]()[_0x110c('0x23')](respondWithResult(_0x791c61,null))[_0x110c('0x43')](handleError(_0x791c61,null));};
\ No newline at end of file
index ccf1c5c..9deb2fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd291=['request-promise','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1ddb6d,_0x1fd2c9){var _0x31065c=function(_0x150297){while(--_0x150297){_0x1ddb6d['push'](_0x1ddb6d['shift']());}};_0x31065c(++_0x1fd2c9);}(_0xd291,0xae));var _0x1d29=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd291[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1d29('0x0'));var util=require(_0x1d29('0x1'));var logger=require(_0x1d29('0x2'))(_0x1d29('0x3'));var moment=require(_0x1d29('0x4'));var BPromise=require(_0x1d29('0x5'));var rp=require(_0x1d29('0x6'));var attributes=require(_0x1d29('0x7'));module[_0x1d29('0x8')]=function(_0x15ac82,_0x14e5ba){return _0x15ac82[_0x1d29('0x9')](_0x1d29('0xa'),attributes,{'tableName':_0x1d29('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8109=['../../config/logger','api','bluebird','request-promise','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash'];(function(_0x37dc6f,_0x353d01){var _0x20131e=function(_0x4eff52){while(--_0x4eff52){_0x37dc6f['push'](_0x37dc6f['shift']());}};_0x20131e(++_0x353d01);}(_0x8109,0xa9));var _0x9810=function(_0x42cd05,_0x44ad1d){_0x42cd05=_0x42cd05-0x0;var _0x440870=_0x8109[_0x42cd05];return _0x440870;};'use strict';var _=require(_0x9810('0x0'));var util=require('util');var logger=require(_0x9810('0x1'))(_0x9810('0x2'));var moment=require('moment');var BPromise=require(_0x9810('0x3'));var rp=require(_0x9810('0x4'));var attributes=require(_0x9810('0x5'));module[_0x9810('0x6')]=function(_0x2a93a6,_0xf73940){return _0x2a93a6[_0x9810('0x7')](_0x9810('0x8'),attributes,{'tableName':_0x9810('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ee23729..35781b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x727e=['../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb'];(function(_0x159eab,_0x22d972){var _0x47e933=function(_0x58e802){while(--_0x58e802){_0x159eab['push'](_0x159eab['shift']());}};_0x47e933(++_0x22d972);}(_0x727e,0xd8));var _0xe727=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x727e[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe727('0x0'));var BPromise=require(_0xe727('0x1'));var rs=require(_0xe727('0x2'));var fs=require('fs');var db=require(_0xe727('0x3'))['db'];var utils=require(_0xe727('0x4'));var logger=require(_0xe727('0x5'))('rpc');var config=require(_0xe727('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe727('0x7')][_0xe727('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x254f3f,_0x560cdf,_0x53ac84){return new BPromise(function(_0x40b736,_0x208a3a){return client[_0xe727('0x9')](_0x254f3f,_0x53ac84)[_0xe727('0xa')](function(_0x9c0be3){logger[_0xe727('0xb')](_0xe727('0xc'),_0x560cdf,_0xe727('0xd'));logger[_0xe727('0xe')](_0xe727('0xf'),_0x560cdf,_0xe727('0xd'),JSON[_0xe727('0x10')](_0x9c0be3));if(_0x9c0be3[_0xe727('0x11')]){if(_0x9c0be3[_0xe727('0x11')][_0xe727('0x12')]===0x1f4){logger['error'](_0xe727('0xc'),_0x560cdf,_0x9c0be3[_0xe727('0x11')][_0xe727('0x13')]);return _0x208a3a(_0x9c0be3['error'][_0xe727('0x13')]);}logger[_0xe727('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x560cdf,_0x9c0be3[_0xe727('0x11')][_0xe727('0x13')]);return _0x40b736(_0x9c0be3['error']['message']);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x560cdf,'request\x20sent');_0x40b736(_0x9c0be3[_0xe727('0x14')][_0xe727('0x13')]);}})[_0xe727('0x15')](function(_0x57a689){logger['error'](_0xe727('0xc'),_0x560cdf,_0x57a689);_0x208a3a(_0x57a689);});});}
\ No newline at end of file
+var _0x4b97=['info','request\x20sent','debug','stringify','error','message','JscriptyQuestionReport,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then'];(function(_0x59162a,_0x10e547){var _0x35e50d=function(_0x578425){while(--_0x578425){_0x59162a['push'](_0x59162a['shift']());}};_0x35e50d(++_0x10e547);}(_0x4b97,0x1c1));var _0x74b9=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4b97[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x74b9('0x0'));var moment=require(_0x74b9('0x1'));var BPromise=require(_0x74b9('0x2'));var rs=require(_0x74b9('0x3'));var fs=require('fs');var db=require(_0x74b9('0x4'))['db'];var utils=require(_0x74b9('0x5'));var logger=require(_0x74b9('0x6'))(_0x74b9('0x7'));var config=require('../../config/environment');var jayson=require(_0x74b9('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f7f1c,_0x9fde47,_0x18912f){return new BPromise(function(_0x3d22df,_0x34507f){return client[_0x74b9('0x9')](_0x1f7f1c,_0x18912f)[_0x74b9('0xa')](function(_0x27e740){logger[_0x74b9('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x9fde47,_0x74b9('0xc'));logger[_0x74b9('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x9fde47,'request\x20sent',JSON[_0x74b9('0xe')](_0x27e740));if(_0x27e740[_0x74b9('0xf')]){if(_0x27e740[_0x74b9('0xf')]['code']===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x9fde47,_0x27e740[_0x74b9('0xf')][_0x74b9('0x10')]);return _0x34507f(_0x27e740['error'][_0x74b9('0x10')]);}logger[_0x74b9('0xf')](_0x74b9('0x11'),_0x9fde47,_0x27e740['error'][_0x74b9('0x10')]);return _0x3d22df(_0x27e740[_0x74b9('0xf')][_0x74b9('0x10')]);}else{logger['info'](_0x74b9('0x11'),_0x9fde47,_0x74b9('0xc'));_0x3d22df(_0x27e740[_0x74b9('0x12')]['message']);}})[_0x74b9('0x13')](function(_0x41a2e2){logger[_0x74b9('0xf')](_0x74b9('0x11'),_0x9fde47,_0x41a2e2);_0x34507f(_0x41a2e2);});});}
\ No newline at end of file
index 7a194a4..4194545 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00b7=['getQuestions','post','create','put','/:id','update','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x00b7,0x8d));var _0x700b=function(_0xee7018,_0x35df61){_0xee7018=_0xee7018-0x0;var _0x4bc203=_0x00b7[_0xee7018];return _0x4bc203;};'use strict';var multer=require(_0x700b('0x0'));var util=require(_0x700b('0x1'));var path=require(_0x700b('0x2'));var express=require('express');var router=express[_0x700b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x700b('0x4'));var config=require(_0x700b('0x5'));var controller=require(_0x700b('0x6'));router[_0x700b('0x7')]('/',auth[_0x700b('0x8')](),controller['index']);router[_0x700b('0x7')](_0x700b('0x9'),auth[_0x700b('0x8')](),controller[_0x700b('0xa')]);router[_0x700b('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x700b('0x7')]('/:id/questions',auth[_0x700b('0x8')](),controller[_0x700b('0xb')]);router[_0x700b('0xc')]('/',auth[_0x700b('0x8')](),controller[_0x700b('0xd')]);router[_0x700b('0xe')](_0x700b('0xf'),auth[_0x700b('0x8')](),controller[_0x700b('0x10')]);router[_0x700b('0x11')](_0x700b('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x700b('0x12')]=router;
\ No newline at end of file
+var _0xbf92=['destroy','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete'];(function(_0x1f54dc,_0xe30fd8){var _0x4cd74e=function(_0xd4fdfc){while(--_0xd4fdfc){_0x1f54dc['push'](_0x1f54dc['shift']());}};_0x4cd74e(++_0xe30fd8);}(_0xbf92,0x15b));var _0x2bf9=function(_0x413ec7,_0x20780d){_0x413ec7=_0x413ec7-0x0;var _0x5f1adb=_0xbf92[_0x413ec7];return _0x5f1adb;};'use strict';var multer=require('multer');var util=require(_0x2bf9('0x0'));var path=require(_0x2bf9('0x1'));var express=require(_0x2bf9('0x2'));var router=express[_0x2bf9('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x2bf9('0x4'));var config=require(_0x2bf9('0x5'));var controller=require(_0x2bf9('0x6'));router[_0x2bf9('0x7')]('/',auth['isAuthenticated'](),controller[_0x2bf9('0x8')]);router[_0x2bf9('0x7')](_0x2bf9('0x9'),auth[_0x2bf9('0xa')](),controller[_0x2bf9('0xb')]);router[_0x2bf9('0x7')](_0x2bf9('0xc'),auth[_0x2bf9('0xa')](),controller[_0x2bf9('0xd')]);router[_0x2bf9('0x7')](_0x2bf9('0xe'),auth[_0x2bf9('0xa')](),controller[_0x2bf9('0xf')]);router[_0x2bf9('0x10')]('/',auth[_0x2bf9('0xa')](),controller[_0x2bf9('0x11')]);router[_0x2bf9('0x12')]('/:id',auth[_0x2bf9('0xa')](),controller[_0x2bf9('0x13')]);router[_0x2bf9('0x14')]('/:id',auth[_0x2bf9('0xa')](),controller[_0x2bf9('0x15')]);module[_0x2bf9('0x16')]=router;
\ No newline at end of file
index d8a12d2..6527e30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1410=['moment','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x1410,0x19e));var _0x0141=function(_0x50ab92,_0x2b1469){_0x50ab92=_0x50ab92-0x0;var _0x39042a=_0x1410[_0x50ab92];return _0x39042a;};'use strict';var moment=require(_0x0141('0x0'));var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize[_0x0141('0x1')],'set':function(_0x412eec){this[_0x0141('0x2')](_0x0141('0x3'),_0x412eec);this['setDataValue'](_0x0141('0x4'),moment()[_0x0141('0x5')](_0x0141('0x6')));}},'endtime':{'type':Sequelize[_0x0141('0x1')]},'membername':{'type':Sequelize[_0x0141('0x7')]},'projectname':{'type':Sequelize[_0x0141('0x7')]},'queue':{'type':Sequelize[_0x0141('0x7')]},'uniqueid':{'type':Sequelize[_0x0141('0x7')]},'calleridname':{'type':Sequelize[_0x0141('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x0141('0x8')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2caf=['YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports','DATE','setDataValue','endtime'];(function(_0x26abfc,_0x11db06){var _0xc48c12=function(_0x487737){while(--_0x487737){_0x26abfc['push'](_0x26abfc['shift']());}};_0xc48c12(++_0x11db06);}(_0x2caf,0x10a));var _0xf2ca=function(_0x3f7489,_0x231326){_0x3f7489=_0x3f7489-0x0;var _0x5b9179=_0x2caf[_0x3f7489];return _0x5b9179;};'use strict';var moment=require(_0xf2ca('0x0'));var Sequelize=require(_0xf2ca('0x1'));module[_0xf2ca('0x2')]={'starttime':{'type':Sequelize[_0xf2ca('0x3')],'set':function(_0x2b84df){this[_0xf2ca('0x4')]('starttime',_0x2b84df);this[_0xf2ca('0x4')](_0xf2ca('0x5'),moment()['format'](_0xf2ca('0x6')));}},'endtime':{'type':Sequelize[_0xf2ca('0x3')]},'membername':{'type':Sequelize[_0xf2ca('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xf2ca('0x7')]},'uniqueid':{'type':Sequelize[_0xf2ca('0x7')]},'calleridname':{'type':Sequelize[_0xf2ca('0x7')]},'calleridnum':{'type':Sequelize[_0xf2ca('0x7')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index eae167e..299f3a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2de=['status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','JscriptySessionReport','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','add','merge','filter','map','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','findOne','length','sort','SessionId','JscriptyQuestionReport','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/logger','api','../../config/utils','../../config/environment','sendStatus'];(function(_0x242d66,_0x550c10){var _0x4d12c9=function(_0x249bcf){while(--_0x249bcf){_0x242d66['push'](_0x242d66['shift']());}};_0x4d12c9(++_0x550c10);}(_0xa2de,0x16a));var _0xea2d=function(_0x2e3dd3,_0x3922ea){_0x2e3dd3=_0x2e3dd3-0x0;var _0x188937=_0xa2de[_0x2e3dd3];return _0x188937;};'use strict';var pdf=require(_0xea2d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xea2d('0x1'));var zipdir=require(_0xea2d('0x2'));var jsonpatch=require(_0xea2d('0x3'));var rp=require(_0xea2d('0x4'));var moment=require(_0xea2d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xea2d('0x6'));var util=require(_0xea2d('0x7'));var path=require(_0xea2d('0x8'));var sox=require(_0xea2d('0x9'));var csv=require(_0xea2d('0xa'));var ejs=require(_0xea2d('0xb'));var fs=require('fs');var _=require(_0xea2d('0xc'));var squel=require(_0xea2d('0xd'));var crypto=require(_0xea2d('0xe'));var jsforce=require(_0xea2d('0xf'));var deskjs=require(_0xea2d('0x10'));var toCsv=require(_0xea2d('0xa'));var querystring=require('querystring');var Papa=require(_0xea2d('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0xea2d('0x12'))(_0xea2d('0x13'));var utils=require(_0xea2d('0x14'));var config=require(_0xea2d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x546942,_0x10f59c){_0x10f59c=_0x10f59c||0xcc;return function(_0x3dfc2e){if(_0x3dfc2e){return _0x546942[_0xea2d('0x16')](_0x10f59c);}return _0x546942[_0xea2d('0x17')](_0x10f59c)[_0xea2d('0x18')]();};}function respondWithResult(_0x27473d,_0x54f743){_0x54f743=_0x54f743||0xc8;return function(_0x466a94){if(_0x466a94){return _0x27473d[_0xea2d('0x17')](_0x54f743)['json'](_0x466a94);}};}function respondWithFilteredResult(_0x3c9119,_0x206db){return function(_0x4c0e1a){if(_0x4c0e1a){var _0x3f0dcf=_0x4c0e1a[_0xea2d('0x19')],_0x377ca8=_0x206db[_0xea2d('0x1a')],_0x522fc1=_0x206db[_0xea2d('0x1a')]+_0x206db[_0xea2d('0x1b')],_0xb0245d;if(_0x522fc1>=_0x3f0dcf){_0x522fc1=_0x3f0dcf;_0xb0245d=0xc8;}else{_0xb0245d=0xce;}_0x3c9119[_0xea2d('0x17')](_0xb0245d);return _0x3c9119[_0xea2d('0x1c')]('Content-Range',_0x377ca8+'-'+_0x522fc1+'/'+_0x3f0dcf)[_0xea2d('0x1d')](_0x4c0e1a);}return null;};}function patchUpdates(_0x3d542e){return function(_0x4eb32c){try{jsonpatch[_0xea2d('0x1e')](_0x4eb32c,_0x3d542e,!![]);}catch(_0x3c0af){return BPromise[_0xea2d('0x1f')](_0x3c0af);}return _0x4eb32c[_0xea2d('0x20')]();};}function saveUpdates(_0x7eea6b,_0x32b62e){return function(_0xf941cd){if(_0xf941cd){return _0xf941cd[_0xea2d('0x21')](_0x7eea6b)[_0xea2d('0x22')](function(_0x11db91){return _0x11db91;});}return null;};}function removeEntity(_0x597e8a,_0x52394a){return function(_0x121b44){if(_0x121b44){return _0x121b44[_0xea2d('0x23')]()[_0xea2d('0x22')](function(){_0x597e8a[_0xea2d('0x17')](0xcc)[_0xea2d('0x18')]();});}};}function handleEntityNotFound(_0xfe541,_0x4c36bf){return function(_0x242963){if(!_0x242963){_0xfe541[_0xea2d('0x16')](0x194);}return _0x242963;};}function handleError(_0x12963b,_0x5b48f4){_0x5b48f4=_0x5b48f4||0x1f4;return function(_0x1b7e03){logger[_0xea2d('0x24')](_0x1b7e03[_0xea2d('0x25')]);if(_0x1b7e03[_0xea2d('0x26')]){delete _0x1b7e03[_0xea2d('0x26')];}_0x12963b[_0xea2d('0x17')](_0x5b48f4)[_0xea2d('0x27')](_0x1b7e03);};}exports[_0xea2d('0x28')]=function(_0x1bd11f,_0x25c65a){var _0x3ee6cf={},_0xac2ee4={},_0x560727={'count':0x0,'rows':[]};var _0x13b732=db[_0xea2d('0x29')][_0xea2d('0x2a')];_0xac2ee4[_0xea2d('0x2b')]=_[_0xea2d('0x2c')](_0x13b732);var _0x42a06a={'dateStart':_0x1bd11f[_0xea2d('0x2d')][_0xea2d('0x2e')],'dateEnd':_0x1bd11f['query'][_0xea2d('0x2f')]};delete _0x1bd11f[_0xea2d('0x2d')][_0xea2d('0x2e')];delete _0x1bd11f[_0xea2d('0x2d')][_0xea2d('0x2f')];_0xac2ee4['query']=_['keys'](_0x1bd11f[_0xea2d('0x2d')]);_0xac2ee4[_0xea2d('0x30')]=_[_0xea2d('0x31')](_0xac2ee4[_0xea2d('0x2b')],_0xac2ee4['query']);_0x3ee6cf[_0xea2d('0x32')]=_[_0xea2d('0x31')](_0xac2ee4[_0xea2d('0x2b')],qs[_0xea2d('0x33')](_0x1bd11f[_0xea2d('0x2d')][_0xea2d('0x33')]));_0x3ee6cf[_0xea2d('0x32')]=_0x3ee6cf[_0xea2d('0x32')]['length']?_0x3ee6cf[_0xea2d('0x32')]:_0xac2ee4['model'];if(!_0x1bd11f[_0xea2d('0x2d')][_0xea2d('0x34')](_0xea2d('0x35'))){_0x3ee6cf[_0xea2d('0x1b')]=qs['limit'](_0x1bd11f[_0xea2d('0x2d')][_0xea2d('0x1b')]);_0x3ee6cf['offset']=qs[_0xea2d('0x1a')](_0x1bd11f[_0xea2d('0x2d')][_0xea2d('0x1a')]);}_0x3ee6cf[_0xea2d('0x36')]=qs['sort'](_0x1bd11f[_0xea2d('0x2d')]['sort']);_0x3ee6cf[_0xea2d('0x37')]=qs[_0xea2d('0x30')](_['pick'](_0x1bd11f[_0xea2d('0x2d')],_0xac2ee4[_0xea2d('0x30')]));if(_0x42a06a['dateStart']){if(_0x42a06a[_0xea2d('0x2f')]){_0x42a06a['dateEnd']=moment(_0x42a06a['dateEnd'])[_0xea2d('0x38')](0x1,'day');}else{_0x42a06a[_0xea2d('0x2f')]=moment(_0x42a06a[_0xea2d('0x2e')])[_0xea2d('0x38')](0x1,'day');}_[_0xea2d('0x39')](_0x3ee6cf[_0xea2d('0x37')],{'createdAt':{'$gte':_0x42a06a[_0xea2d('0x2e')],'$lte':_0x42a06a[_0xea2d('0x2f')]}});}if(_0x1bd11f[_0xea2d('0x2d')][_0xea2d('0x3a')]){_0x3ee6cf[_0xea2d('0x37')]=_[_0xea2d('0x39')](_0x3ee6cf['where'],{'$or':_[_0xea2d('0x3b')](_0x3ee6cf[_0xea2d('0x32')],function(_0x8c8286){var _0xb5ff42={};_0xb5ff42[_0x8c8286]={'$like':'%'+_0x1bd11f[_0xea2d('0x2d')][_0xea2d('0x3a')]+'%'};return _0xb5ff42;})});}_0x3ee6cf=_[_0xea2d('0x39')]({},_0x3ee6cf,_0x1bd11f[_0xea2d('0x3c')]);var _0x4d0af5={'where':_0x3ee6cf[_0xea2d('0x37')]};return db[_0xea2d('0x29')]['count'](_0x4d0af5)[_0xea2d('0x22')](function(_0x255390){_0x560727['count']=_0x255390;if(_0x1bd11f[_0xea2d('0x2d')][_0xea2d('0x3d')]){_0x3ee6cf[_0xea2d('0x3e')]=[{'all':!![]}];}return db[_0xea2d('0x29')][_0xea2d('0x3f')](_0x3ee6cf);})['then'](function(_0x10e34e){_0x560727[_0xea2d('0x40')]=_0x10e34e;return _0x560727;})[_0xea2d('0x22')](respondWithFilteredResult(_0x25c65a,_0x3ee6cf))['catch'](handleError(_0x25c65a,null));};exports[_0xea2d('0x41')]=function(_0xe6b682,_0x431963){var _0x40054d={'raw':!![],'where':{'id':_0xe6b682[_0xea2d('0x42')]['id']}},_0x1ba830={};_0x1ba830['model']=_[_0xea2d('0x2c')](db[_0xea2d('0x29')]['rawAttributes']);_0x1ba830['query']=_['keys'](_0xe6b682[_0xea2d('0x2d')]);_0x1ba830[_0xea2d('0x30')]=_[_0xea2d('0x31')](_0x1ba830['model'],_0x1ba830['query']);_0x40054d[_0xea2d('0x32')]=_[_0xea2d('0x31')](_0x1ba830[_0xea2d('0x2b')],qs[_0xea2d('0x33')](_0xe6b682[_0xea2d('0x2d')][_0xea2d('0x33')]));_0x40054d['attributes']=_0x40054d[_0xea2d('0x32')]['length']?_0x40054d['attributes']:_0x1ba830[_0xea2d('0x2b')];if(_0xe6b682[_0xea2d('0x2d')][_0xea2d('0x3d')]){_0x40054d[_0xea2d('0x3e')]=[{'all':!![]}];}_0x40054d=_[_0xea2d('0x39')]({},_0x40054d,_0xe6b682[_0xea2d('0x3c')]);return db['JscriptySessionReport'][_0xea2d('0x43')](_0x40054d)[_0xea2d('0x22')](handleEntityNotFound(_0x431963,null))[_0xea2d('0x22')](respondWithResult(_0x431963,null))[_0xea2d('0x44')](handleError(_0x431963,null));};exports[_0xea2d('0x45')]=function(_0x4936fd,_0x14f33b){return db['JscriptySessionReport'][_0xea2d('0x45')](_0x4936fd[_0xea2d('0x46')],{})[_0xea2d('0x22')](respondWithResult(_0x14f33b,0xc9))[_0xea2d('0x44')](handleError(_0x14f33b,null));};exports[_0xea2d('0x21')]=function(_0x3bc510,_0x2531b2){if(_0x3bc510[_0xea2d('0x46')]['id']){delete _0x3bc510[_0xea2d('0x46')]['id'];}return db[_0xea2d('0x29')][_0xea2d('0x43')]({'where':{'id':_0x3bc510[_0xea2d('0x42')]['id']}})[_0xea2d('0x22')](handleEntityNotFound(_0x2531b2,null))[_0xea2d('0x22')](saveUpdates(_0x3bc510[_0xea2d('0x46')],null))['then'](respondWithResult(_0x2531b2,null))['catch'](handleError(_0x2531b2,null));};exports[_0xea2d('0x23')]=function(_0x498c9f,_0x1c606c){return db[_0xea2d('0x29')][_0xea2d('0x43')]({'where':{'id':_0x498c9f[_0xea2d('0x42')]['id']}})['then'](handleEntityNotFound(_0x1c606c,null))[_0xea2d('0x22')](removeEntity(_0x1c606c,null))[_0xea2d('0x44')](handleError(_0x1c606c,null));};exports['describe']=function(_0x1f9b6b,_0x26cfcb){return db[_0xea2d('0x29')][_0xea2d('0x47')]()['then'](respondWithResult(_0x26cfcb,null))[_0xea2d('0x44')](handleError(_0x26cfcb,null));};exports['getQuestions']=function(_0x2e863c,_0x4ac334,_0x2124db){var _0x353f83={'raw':!![],'where':{}};var _0x205082={};var _0x560694={'count':0x0,'rows':[]};return db[_0xea2d('0x29')][_0xea2d('0x48')]({'where':{'id':_0x2e863c[_0xea2d('0x42')]['id']}})['then'](handleEntityNotFound(_0x4ac334,null))[_0xea2d('0x22')](function(_0x14a0a0){if(_0x14a0a0){_0x205082[_0xea2d('0x2b')]=_['keys'](db['JscriptyQuestionReport']['rawAttributes']);_0x205082['query']=_[_0xea2d('0x2c')](_0x2e863c['query']);_0x205082[_0xea2d('0x30')]=_['intersection'](_0x205082[_0xea2d('0x2b')],_0x205082[_0xea2d('0x2d')]);_0x353f83[_0xea2d('0x32')]=_[_0xea2d('0x31')](_0x205082[_0xea2d('0x2b')],qs[_0xea2d('0x33')](_0x2e863c[_0xea2d('0x2d')]['fields']));_0x353f83[_0xea2d('0x32')]=_0x353f83[_0xea2d('0x32')][_0xea2d('0x49')]?_0x353f83['attributes']:_0x205082[_0xea2d('0x2b')];if(!_0x2e863c[_0xea2d('0x2d')][_0xea2d('0x34')](_0xea2d('0x35'))){_0x353f83[_0xea2d('0x1b')]=qs[_0xea2d('0x1b')](_0x2e863c[_0xea2d('0x2d')][_0xea2d('0x1b')]);_0x353f83['offset']=qs[_0xea2d('0x1a')](_0x2e863c[_0xea2d('0x2d')][_0xea2d('0x1a')]);}_0x353f83['order']=qs[_0xea2d('0x4a')](_0x2e863c[_0xea2d('0x2d')][_0xea2d('0x4a')]);_0x353f83[_0xea2d('0x37')]=qs[_0xea2d('0x30')](_['pick'](_0x2e863c[_0xea2d('0x2d')],_0x205082['filters']));_0x353f83[_0xea2d('0x37')][_0xea2d('0x4b')]=_0x14a0a0['id'];if(_0x2e863c[_0xea2d('0x2d')]['filter']){_0x353f83[_0xea2d('0x37')]=_['merge'](_0x353f83[_0xea2d('0x37')],{'$or':_['map'](_0x353f83['attributes'],function(_0x25e7b7){var _0x26fb82={};_0x26fb82[_0x25e7b7]={'$like':'%'+_0x2e863c[_0xea2d('0x2d')][_0xea2d('0x3a')]+'%'};return _0x26fb82;})});}_0x353f83=_[_0xea2d('0x39')]({},_0x353f83,_0x2e863c['options']);return db['JscriptyQuestionReport'][_0xea2d('0x19')]({'where':_0x353f83[_0xea2d('0x37')]})[_0xea2d('0x22')](function(_0x547862){_0x560694['count']=_0x547862;if(_0x2e863c[_0xea2d('0x2d')][_0xea2d('0x3d')]){_0x353f83[_0xea2d('0x3e')]=[{'all':!![]}];}return db[_0xea2d('0x4c')]['findAll'](_0x353f83);})[_0xea2d('0x22')](function(_0x3dd241){_0x560694[_0xea2d('0x40')]=_0x3dd241;return _0x560694;});}})[_0xea2d('0x22')](respondWithFilteredResult(_0x4ac334,_0x353f83))[_0xea2d('0x44')](handleError(_0x4ac334,null));};
\ No newline at end of file
+var _0xc479=['create','body','describe','getQuestions','JscriptyQuestionReport','SessionId','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','add','day','merge','where','filter','map','JscriptySessionReport','includeAll','include','findAll','rows','show','params','options','find','catch'];(function(_0x25b83a,_0xa00abd){var _0x452888=function(_0x506bc7){while(--_0x506bc7){_0x25b83a['push'](_0x25b83a['shift']());}};_0x452888(++_0xa00abd);}(_0xc479,0xed));var _0x9c47=function(_0x153230,_0x1ae7df){_0x153230=_0x153230-0x0;var _0x574ccc=_0xc479[_0x153230];return _0x574ccc;};'use strict';var pdf=require(_0x9c47('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9c47('0x1'));var zipdir=require(_0x9c47('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c47('0x3'));var moment=require(_0x9c47('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c47('0x5'));var util=require(_0x9c47('0x6'));var path=require('path');var sox=require(_0x9c47('0x7'));var csv=require(_0x9c47('0x8'));var ejs=require(_0x9c47('0x9'));var fs=require('fs');var _=require(_0x9c47('0xa'));var squel=require(_0x9c47('0xb'));var crypto=require(_0x9c47('0xc'));var jsforce=require(_0x9c47('0xd'));var deskjs=require(_0x9c47('0xe'));var toCsv=require(_0x9c47('0x8'));var querystring=require(_0x9c47('0xf'));var Papa=require(_0x9c47('0x10'));var qs=require(_0x9c47('0x11'));var logger=require(_0x9c47('0x12'))('api');var utils=require(_0x9c47('0x13'));var config=require(_0x9c47('0x14'));var db=require(_0x9c47('0x15'))['db'];function respondWithStatusCode(_0x56ffa5,_0x1f08d9){_0x1f08d9=_0x1f08d9||0xcc;return function(_0x52fd4c){if(_0x52fd4c){return _0x56ffa5[_0x9c47('0x16')](_0x1f08d9);}return _0x56ffa5[_0x9c47('0x17')](_0x1f08d9)[_0x9c47('0x18')]();};}function respondWithResult(_0x5203ac,_0x448bd6){_0x448bd6=_0x448bd6||0xc8;return function(_0x4d33cb){if(_0x4d33cb){return _0x5203ac[_0x9c47('0x17')](_0x448bd6)[_0x9c47('0x19')](_0x4d33cb);}};}function respondWithFilteredResult(_0x35a8f5,_0x2bebf2){return function(_0x13347c){if(_0x13347c){var _0x2aad8d=_0x13347c[_0x9c47('0x1a')],_0xbaa0ef=_0x2bebf2['offset'],_0x4c70ed=_0x2bebf2[_0x9c47('0x1b')]+_0x2bebf2[_0x9c47('0x1c')],_0x1ea169;if(_0x4c70ed>=_0x2aad8d){_0x4c70ed=_0x2aad8d;_0x1ea169=0xc8;}else{_0x1ea169=0xce;}_0x35a8f5[_0x9c47('0x17')](_0x1ea169);return _0x35a8f5['set'](_0x9c47('0x1d'),_0xbaa0ef+'-'+_0x4c70ed+'/'+_0x2aad8d)[_0x9c47('0x19')](_0x13347c);}return null;};}function patchUpdates(_0x505653){return function(_0x23f309){try{jsonpatch[_0x9c47('0x1e')](_0x23f309,_0x505653,!![]);}catch(_0xb4b07){return BPromise[_0x9c47('0x1f')](_0xb4b07);}return _0x23f309[_0x9c47('0x20')]();};}function saveUpdates(_0x15698c,_0x1a6142){return function(_0x31016d){if(_0x31016d){return _0x31016d[_0x9c47('0x21')](_0x15698c)[_0x9c47('0x22')](function(_0x2ba1b4){return _0x2ba1b4;});}return null;};}function removeEntity(_0x2065a0,_0x10c04b){return function(_0x2d114a){if(_0x2d114a){return _0x2d114a[_0x9c47('0x23')]()[_0x9c47('0x22')](function(){_0x2065a0['status'](0xcc)[_0x9c47('0x18')]();});}};}function handleEntityNotFound(_0xed7eb2,_0x5bc425){return function(_0x4d81d5){if(!_0x4d81d5){_0xed7eb2['sendStatus'](0x194);}return _0x4d81d5;};}function handleError(_0x47742b,_0x1bb016){_0x1bb016=_0x1bb016||0x1f4;return function(_0x139298){logger[_0x9c47('0x24')](_0x139298[_0x9c47('0x25')]);if(_0x139298[_0x9c47('0x26')]){delete _0x139298[_0x9c47('0x26')];}_0x47742b['status'](_0x1bb016)['send'](_0x139298);};}exports[_0x9c47('0x27')]=function(_0x2e5b17,_0x572337){var _0x9d6282={},_0x423df1={},_0x10694c={'count':0x0,'rows':[]};var _0x58e326=db['JscriptySessionReport'][_0x9c47('0x28')];_0x423df1[_0x9c47('0x29')]=_[_0x9c47('0x2a')](_0x58e326);var _0x374b2f={'dateStart':_0x2e5b17[_0x9c47('0x2b')][_0x9c47('0x2c')],'dateEnd':_0x2e5b17['query'][_0x9c47('0x2d')]};delete _0x2e5b17[_0x9c47('0x2b')][_0x9c47('0x2c')];delete _0x2e5b17[_0x9c47('0x2b')][_0x9c47('0x2d')];_0x423df1[_0x9c47('0x2b')]=_['keys'](_0x2e5b17[_0x9c47('0x2b')]);_0x423df1[_0x9c47('0x2e')]=_[_0x9c47('0x2f')](_0x423df1[_0x9c47('0x29')],_0x423df1[_0x9c47('0x2b')]);_0x9d6282[_0x9c47('0x30')]=_['intersection'](_0x423df1['model'],qs[_0x9c47('0x31')](_0x2e5b17[_0x9c47('0x2b')][_0x9c47('0x31')]));_0x9d6282[_0x9c47('0x30')]=_0x9d6282[_0x9c47('0x30')][_0x9c47('0x32')]?_0x9d6282[_0x9c47('0x30')]:_0x423df1[_0x9c47('0x29')];if(!_0x2e5b17[_0x9c47('0x2b')][_0x9c47('0x33')]('nolimit')){_0x9d6282['limit']=qs['limit'](_0x2e5b17[_0x9c47('0x2b')][_0x9c47('0x1c')]);_0x9d6282[_0x9c47('0x1b')]=qs[_0x9c47('0x1b')](_0x2e5b17[_0x9c47('0x2b')]['offset']);}_0x9d6282[_0x9c47('0x34')]=qs[_0x9c47('0x35')](_0x2e5b17['query'][_0x9c47('0x35')]);_0x9d6282['where']=qs['filters'](_[_0x9c47('0x36')](_0x2e5b17[_0x9c47('0x2b')],_0x423df1[_0x9c47('0x2e')]));if(_0x374b2f[_0x9c47('0x2c')]){if(_0x374b2f[_0x9c47('0x2d')]){_0x374b2f[_0x9c47('0x2d')]=moment(_0x374b2f[_0x9c47('0x2d')])[_0x9c47('0x37')](0x1,_0x9c47('0x38'));}else{_0x374b2f['dateEnd']=moment(_0x374b2f['dateStart'])[_0x9c47('0x37')](0x1,_0x9c47('0x38'));}_[_0x9c47('0x39')](_0x9d6282[_0x9c47('0x3a')],{'createdAt':{'$gte':_0x374b2f[_0x9c47('0x2c')],'$lte':_0x374b2f[_0x9c47('0x2d')]}});}if(_0x2e5b17['query'][_0x9c47('0x3b')]){_0x9d6282[_0x9c47('0x3a')]=_[_0x9c47('0x39')](_0x9d6282[_0x9c47('0x3a')],{'$or':_[_0x9c47('0x3c')](_0x9d6282[_0x9c47('0x30')],function(_0x47d16e){var _0xabf004={};_0xabf004[_0x47d16e]={'$like':'%'+_0x2e5b17[_0x9c47('0x2b')][_0x9c47('0x3b')]+'%'};return _0xabf004;})});}_0x9d6282=_['merge']({},_0x9d6282,_0x2e5b17['options']);var _0x26d508={'where':_0x9d6282[_0x9c47('0x3a')]};return db[_0x9c47('0x3d')][_0x9c47('0x1a')](_0x26d508)[_0x9c47('0x22')](function(_0x51390d){_0x10694c[_0x9c47('0x1a')]=_0x51390d;if(_0x2e5b17['query'][_0x9c47('0x3e')]){_0x9d6282[_0x9c47('0x3f')]=[{'all':!![]}];}return db[_0x9c47('0x3d')][_0x9c47('0x40')](_0x9d6282);})[_0x9c47('0x22')](function(_0x1211d9){_0x10694c[_0x9c47('0x41')]=_0x1211d9;return _0x10694c;})[_0x9c47('0x22')](respondWithFilteredResult(_0x572337,_0x9d6282))['catch'](handleError(_0x572337,null));};exports[_0x9c47('0x42')]=function(_0x5decd4,_0x3b7e3b){var _0x2054f9={'raw':!![],'where':{'id':_0x5decd4[_0x9c47('0x43')]['id']}},_0x273bcd={};_0x273bcd[_0x9c47('0x29')]=_['keys'](db['JscriptySessionReport']['rawAttributes']);_0x273bcd[_0x9c47('0x2b')]=_[_0x9c47('0x2a')](_0x5decd4['query']);_0x273bcd['filters']=_['intersection'](_0x273bcd[_0x9c47('0x29')],_0x273bcd[_0x9c47('0x2b')]);_0x2054f9['attributes']=_['intersection'](_0x273bcd[_0x9c47('0x29')],qs[_0x9c47('0x31')](_0x5decd4['query'][_0x9c47('0x31')]));_0x2054f9[_0x9c47('0x30')]=_0x2054f9[_0x9c47('0x30')][_0x9c47('0x32')]?_0x2054f9['attributes']:_0x273bcd['model'];if(_0x5decd4['query']['includeAll']){_0x2054f9[_0x9c47('0x3f')]=[{'all':!![]}];}_0x2054f9=_[_0x9c47('0x39')]({},_0x2054f9,_0x5decd4[_0x9c47('0x44')]);return db[_0x9c47('0x3d')][_0x9c47('0x45')](_0x2054f9)['then'](handleEntityNotFound(_0x3b7e3b,null))['then'](respondWithResult(_0x3b7e3b,null))[_0x9c47('0x46')](handleError(_0x3b7e3b,null));};exports[_0x9c47('0x47')]=function(_0x422cf2,_0x4bd0b3){return db[_0x9c47('0x3d')][_0x9c47('0x47')](_0x422cf2[_0x9c47('0x48')],{})[_0x9c47('0x22')](respondWithResult(_0x4bd0b3,0xc9))[_0x9c47('0x46')](handleError(_0x4bd0b3,null));};exports['update']=function(_0x45c314,_0x82ea6){if(_0x45c314[_0x9c47('0x48')]['id']){delete _0x45c314['body']['id'];}return db[_0x9c47('0x3d')][_0x9c47('0x45')]({'where':{'id':_0x45c314[_0x9c47('0x43')]['id']}})['then'](handleEntityNotFound(_0x82ea6,null))[_0x9c47('0x22')](saveUpdates(_0x45c314[_0x9c47('0x48')],null))[_0x9c47('0x22')](respondWithResult(_0x82ea6,null))[_0x9c47('0x46')](handleError(_0x82ea6,null));};exports['destroy']=function(_0x4efec1,_0x1ad1e0){return db[_0x9c47('0x3d')]['find']({'where':{'id':_0x4efec1[_0x9c47('0x43')]['id']}})['then'](handleEntityNotFound(_0x1ad1e0,null))[_0x9c47('0x22')](removeEntity(_0x1ad1e0,null))[_0x9c47('0x46')](handleError(_0x1ad1e0,null));};exports[_0x9c47('0x49')]=function(_0x1e3a04,_0x2d6a01){return db[_0x9c47('0x3d')][_0x9c47('0x49')]()['then'](respondWithResult(_0x2d6a01,null))[_0x9c47('0x46')](handleError(_0x2d6a01,null));};exports[_0x9c47('0x4a')]=function(_0x1a9def,_0x3674a3,_0x2570dc){var _0x3eeed5={'raw':!![],'where':{}};var _0x1e027e={};var _0x55360e={'count':0x0,'rows':[]};return db[_0x9c47('0x3d')]['findOne']({'where':{'id':_0x1a9def[_0x9c47('0x43')]['id']}})[_0x9c47('0x22')](handleEntityNotFound(_0x3674a3,null))[_0x9c47('0x22')](function(_0x4a9526){if(_0x4a9526){_0x1e027e[_0x9c47('0x29')]=_[_0x9c47('0x2a')](db[_0x9c47('0x4b')]['rawAttributes']);_0x1e027e['query']=_[_0x9c47('0x2a')](_0x1a9def['query']);_0x1e027e['filters']=_[_0x9c47('0x2f')](_0x1e027e[_0x9c47('0x29')],_0x1e027e[_0x9c47('0x2b')]);_0x3eeed5[_0x9c47('0x30')]=_['intersection'](_0x1e027e[_0x9c47('0x29')],qs[_0x9c47('0x31')](_0x1a9def[_0x9c47('0x2b')][_0x9c47('0x31')]));_0x3eeed5[_0x9c47('0x30')]=_0x3eeed5[_0x9c47('0x30')][_0x9c47('0x32')]?_0x3eeed5[_0x9c47('0x30')]:_0x1e027e['model'];if(!_0x1a9def['query'][_0x9c47('0x33')]('nolimit')){_0x3eeed5['limit']=qs[_0x9c47('0x1c')](_0x1a9def['query'][_0x9c47('0x1c')]);_0x3eeed5[_0x9c47('0x1b')]=qs[_0x9c47('0x1b')](_0x1a9def['query'][_0x9c47('0x1b')]);}_0x3eeed5[_0x9c47('0x34')]=qs[_0x9c47('0x35')](_0x1a9def[_0x9c47('0x2b')][_0x9c47('0x35')]);_0x3eeed5[_0x9c47('0x3a')]=qs[_0x9c47('0x2e')](_[_0x9c47('0x36')](_0x1a9def[_0x9c47('0x2b')],_0x1e027e[_0x9c47('0x2e')]));_0x3eeed5[_0x9c47('0x3a')][_0x9c47('0x4c')]=_0x4a9526['id'];if(_0x1a9def[_0x9c47('0x2b')]['filter']){_0x3eeed5[_0x9c47('0x3a')]=_[_0x9c47('0x39')](_0x3eeed5[_0x9c47('0x3a')],{'$or':_[_0x9c47('0x3c')](_0x3eeed5['attributes'],function(_0x3677da){var _0x5a53b4={};_0x5a53b4[_0x3677da]={'$like':'%'+_0x1a9def[_0x9c47('0x2b')][_0x9c47('0x3b')]+'%'};return _0x5a53b4;})});}_0x3eeed5=_[_0x9c47('0x39')]({},_0x3eeed5,_0x1a9def[_0x9c47('0x44')]);return db['JscriptyQuestionReport'][_0x9c47('0x1a')]({'where':_0x3eeed5[_0x9c47('0x3a')]})[_0x9c47('0x22')](function(_0x22b29c){_0x55360e['count']=_0x22b29c;if(_0x1a9def[_0x9c47('0x2b')]['includeAll']){_0x3eeed5['include']=[{'all':!![]}];}return db[_0x9c47('0x4b')][_0x9c47('0x40')](_0x3eeed5);})[_0x9c47('0x22')](function(_0x1f7948){_0x55360e['rows']=_0x1f7948;return _0x55360e;});}})[_0x9c47('0x22')](respondWithFilteredResult(_0x3674a3,_0x3eeed5))[_0x9c47('0x46')](handleError(_0x3674a3,null));};
\ No newline at end of file
index 7627c1d..0d36af7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd42b=['report_jscripty_sessions','util','api','moment','request-promise','./jscriptySessionReport.attributes','define','JscriptySessionReport'];(function(_0xac02d0,_0x3643c8){var _0x535259=function(_0x3c6615){while(--_0x3c6615){_0xac02d0['push'](_0xac02d0['shift']());}};_0x535259(++_0x3643c8);}(_0xd42b,0x91));var _0xbd42=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xd42b[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require(_0xbd42('0x0'));var logger=require('../../config/logger')(_0xbd42('0x1'));var moment=require(_0xbd42('0x2'));var BPromise=require('bluebird');var rp=require(_0xbd42('0x3'));var attributes=require(_0xbd42('0x4'));module['exports']=function(_0x184ca7,_0x158b4b){return _0x184ca7[_0xbd42('0x5')](_0xbd42('0x6'),attributes,{'tableName':_0xbd42('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xff98=['./jscriptySessionReport.attributes','exports','define','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x382164,_0x5375d8){var _0x466ab7=function(_0x4db7e5){while(--_0x4db7e5){_0x382164['push'](_0x382164['shift']());}};_0x466ab7(++_0x5375d8);}(_0xff98,0x135));var _0x8ff9=function(_0x1805e6,_0x571a32){_0x1805e6=_0x1805e6-0x0;var _0x42f54e=_0xff98[_0x1805e6];return _0x42f54e;};'use strict';var _=require(_0x8ff9('0x0'));var util=require(_0x8ff9('0x1'));var logger=require(_0x8ff9('0x2'))('api');var moment=require(_0x8ff9('0x3'));var BPromise=require(_0x8ff9('0x4'));var rp=require(_0x8ff9('0x5'));var attributes=require(_0x8ff9('0x6'));module[_0x8ff9('0x7')]=function(_0x497fc4,_0x245fc6){return _0x497fc4[_0x8ff9('0x8')]('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c256ca9..cba2c69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a97=['jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x51674a,_0x77ccff){var _0x13fca6=function(_0x3d6c27){while(--_0x3d6c27){_0x51674a['push'](_0x51674a['shift']());}};_0x13fca6(++_0x77ccff);}(_0x4a97,0xbf));var _0x74a9=function(_0x1e2671,_0x4cf90a){_0x1e2671=_0x1e2671-0x0;var _0x492489=_0x4a97[_0x1e2671];return _0x492489;};'use strict';var _=require(_0x74a9('0x0'));var util=require(_0x74a9('0x1'));var moment=require('moment');var BPromise=require(_0x74a9('0x2'));var rs=require(_0x74a9('0x3'));var fs=require('fs');var db=require(_0x74a9('0x4'))['db'];var utils=require(_0x74a9('0x5'));var logger=require('../../config/logger')(_0x74a9('0x6'));var config=require('../../config/environment');var jayson=require(_0x74a9('0x7'));var client=jayson[_0x74a9('0x8')][_0x74a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x368888,_0x539983,_0x25e84b){return new BPromise(function(_0x45fca6,_0x442eb2){return client[_0x74a9('0xa')](_0x368888,_0x25e84b)[_0x74a9('0xb')](function(_0x48531e){logger[_0x74a9('0xc')](_0x74a9('0xd'),_0x539983,_0x74a9('0xe'));logger['debug'](_0x74a9('0xf'),_0x539983,_0x74a9('0xe'),JSON[_0x74a9('0x10')](_0x48531e));if(_0x48531e[_0x74a9('0x11')]){if(_0x48531e['error'][_0x74a9('0x12')]===0x1f4){logger[_0x74a9('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x539983,_0x48531e[_0x74a9('0x11')][_0x74a9('0x13')]);return _0x442eb2(_0x48531e[_0x74a9('0x11')][_0x74a9('0x13')]);}logger[_0x74a9('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x539983,_0x48531e[_0x74a9('0x11')]['message']);return _0x45fca6(_0x48531e[_0x74a9('0x11')]['message']);}else{logger[_0x74a9('0xc')](_0x74a9('0xd'),_0x539983,_0x74a9('0xe'));_0x45fca6(_0x48531e[_0x74a9('0x14')][_0x74a9('0x13')]);}})[_0x74a9('0x15')](function(_0x40c2a7){logger[_0x74a9('0x11')](_0x74a9('0xd'),_0x539983,_0x40c2a7);_0x442eb2(_0x40c2a7);});});}
\ No newline at end of file
+var _0xb8ef=['stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s'];(function(_0xa64a7,_0x438859){var _0x2e96d9=function(_0x8a6d97){while(--_0x8a6d97){_0xa64a7['push'](_0xa64a7['shift']());}};_0x2e96d9(++_0x438859);}(_0xb8ef,0xf7));var _0xfb8e=function(_0x495809,_0x40fdd5){_0x495809=_0x495809-0x0;var _0x2c9286=_0xb8ef[_0x495809];return _0x2c9286;};'use strict';var _=require('lodash');var util=require(_0xfb8e('0x0'));var moment=require(_0xfb8e('0x1'));var BPromise=require(_0xfb8e('0x2'));var rs=require(_0xfb8e('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0xfb8e('0x4'));var logger=require(_0xfb8e('0x5'))(_0xfb8e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfb8e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb97a19,_0x48b6bf,_0x10218a){return new BPromise(function(_0x5256b7,_0x7b5dd1){return client['request'](_0xb97a19,_0x10218a)[_0xfb8e('0x8')](function(_0x260ac6){logger[_0xfb8e('0x9')]('JscriptySessionReport,\x20%s,\x20%s',_0x48b6bf,_0xfb8e('0xa'));logger[_0xfb8e('0xb')](_0xfb8e('0xc'),_0x48b6bf,_0xfb8e('0xa'),JSON[_0xfb8e('0xd')](_0x260ac6));if(_0x260ac6[_0xfb8e('0xe')]){if(_0x260ac6[_0xfb8e('0xe')][_0xfb8e('0xf')]===0x1f4){logger['error'](_0xfb8e('0x10'),_0x48b6bf,_0x260ac6['error'][_0xfb8e('0x11')]);return _0x7b5dd1(_0x260ac6['error'][_0xfb8e('0x11')]);}logger['error'](_0xfb8e('0x10'),_0x48b6bf,_0x260ac6['error']['message']);return _0x5256b7(_0x260ac6[_0xfb8e('0xe')][_0xfb8e('0x11')]);}else{logger['info'](_0xfb8e('0x10'),_0x48b6bf,'request\x20sent');_0x5256b7(_0x260ac6[_0xfb8e('0x12')]['message']);}})[_0xfb8e('0x13')](function(_0x5ce3ae){logger['error'](_0xfb8e('0x10'),_0x48b6bf,_0x5ce3ae);_0x7b5dd1(_0x5ce3ae);});});}
\ No newline at end of file
index d4829b2..d4f30cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fa0=['exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index'];(function(_0x1a8414,_0x4f735e){var _0x430a62=function(_0xc05ed4){while(--_0xc05ed4){_0x1a8414['push'](_0x1a8414['shift']());}};_0x430a62(++_0x4f735e);}(_0x9fa0,0x156));var _0x09fa=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x9fa0[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require(_0x09fa('0x0'));var util=require('util');var path=require(_0x09fa('0x1'));var express=require(_0x09fa('0x2'));var router=express[_0x09fa('0x3')]();var auth=require(_0x09fa('0x4'));var interaction=require(_0x09fa('0x5'));var config=require(_0x09fa('0x6'));var controller=require(_0x09fa('0x7'));router[_0x09fa('0x8')]('/',controller[_0x09fa('0x9')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);module[_0x09fa('0xa')]=router;
\ No newline at end of file
+var _0x3b27=['put','isAuthenticated','util','express','../../components/interaction/service','../../config/environment','get','index'];(function(_0x262323,_0x4a81f1){var _0xa963c3=function(_0x5c715e){while(--_0x5c715e){_0x262323['push'](_0x262323['shift']());}};_0xa963c3(++_0x4a81f1);}(_0x3b27,0x1c2));var _0x73b2=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x3b27[_0x1477ef];return _0x164acd;};'use strict';var multer=require('multer');var util=require(_0x73b2('0x0'));var path=require('path');var express=require(_0x73b2('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x73b2('0x2'));var config=require(_0x73b2('0x3'));var controller=require('./license.controller');router[_0x73b2('0x4')]('/',controller[_0x73b2('0x5')]);router[_0x73b2('0x6')]('/:id',auth[_0x73b2('0x7')](),controller['update']);module['exports']=router;
\ No newline at end of file
index 16e79ea..a772988 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d4d=['sequelize','exports','STRING'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x0d4d,0x1d4));var _0xd0d4=function(_0x27d7cb,_0x444745){_0x27d7cb=_0x27d7cb-0x0;var _0x1fb13c=_0x0d4d[_0x27d7cb];return _0x1fb13c;};'use strict';var Sequelize=require(_0xd0d4('0x0'));module[_0xd0d4('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xd0d4('0x2')]},'data2':{'type':Sequelize[_0xd0d4('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x2337=['TEXT','STRING','INTEGER','sequelize'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x2337,0x137));var _0x7233=function(_0x1e67e8,_0x15998f){_0x1e67e8=_0x1e67e8-0x0;var _0x230260=_0x2337[_0x1e67e8];return _0x230260;};'use strict';var Sequelize=require(_0x7233('0x0'));module['exports']={'license':{'type':Sequelize[_0x7233('0x1')]},'data1':{'type':Sequelize[_0x7233('0x2')]},'data2':{'type':Sequelize[_0x7233('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x7233('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index c9bb99b..447e8e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x151e=['../../config/utils','../../config/environment','../../mysqldb','status','end','offset','set','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','../../config/license/util','index','model','License','query','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','key','demo','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../config/logger','api'];(function(_0x58aaf4,_0xd2c0d5){var _0x5d6cd4=function(_0x7873d1){while(--_0x7873d1){_0x58aaf4['push'](_0x58aaf4['shift']());}};_0x5d6cd4(++_0xd2c0d5);}(_0x151e,0x1b5));var _0xe151=function(_0x26b622,_0x237e9e){_0x26b622=_0x26b622-0x0;var _0x58a028=_0x151e[_0x26b622];return _0x58a028;};'use strict';var pdf=require(_0xe151('0x0'));var emlformat=require(_0xe151('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe151('0x2'));var jsonpatch=require(_0xe151('0x3'));var rp=require(_0xe151('0x4'));var moment=require(_0xe151('0x5'));var BPromise=require(_0xe151('0x6'));var Mustache=require(_0xe151('0x7'));var util=require(_0xe151('0x8'));var path=require('path');var sox=require(_0xe151('0x9'));var csv=require(_0xe151('0xa'));var ejs=require(_0xe151('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe151('0xc'));var crypto=require('crypto');var jsforce=require(_0xe151('0xd'));var deskjs=require(_0xe151('0xe'));var toCsv=require(_0xe151('0xa'));var querystring=require(_0xe151('0xf'));var Papa=require(_0xe151('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xe151('0x11'))(_0xe151('0x12'));var utils=require(_0xe151('0x13'));var config=require(_0xe151('0x14'));var db=require(_0xe151('0x15'))['db'];function respondWithStatusCode(_0x38e40e,_0x2ce6fc){_0x2ce6fc=_0x2ce6fc||0xcc;return function(_0x2794e3){if(_0x2794e3){return _0x38e40e['sendStatus'](_0x2ce6fc);}return _0x38e40e[_0xe151('0x16')](_0x2ce6fc)[_0xe151('0x17')]();};}function respondWithResult(_0x29c173,_0x2e442e){_0x2e442e=_0x2e442e||0xc8;return function(_0x191aa0){if(_0x191aa0){return _0x29c173['status'](_0x2e442e)['json'](_0x191aa0);}};}function respondWithFilteredResult(_0xcb939a,_0x163622){return function(_0x1c020e){if(_0x1c020e){var _0x3b36a=_0x1c020e['count'],_0x3f2c19=_0x163622[_0xe151('0x18')],_0x1f4553=_0x163622['offset']+_0x163622['limit'],_0x34a654;if(_0x1f4553>=_0x3b36a){_0x1f4553=_0x3b36a;_0x34a654=0xc8;}else{_0x34a654=0xce;}_0xcb939a[_0xe151('0x16')](_0x34a654);return _0xcb939a[_0xe151('0x19')]('Content-Range',_0x3f2c19+'-'+_0x1f4553+'/'+_0x3b36a)[_0xe151('0x1a')](_0x1c020e);}return null;};}function patchUpdates(_0x363941){return function(_0x57b1f8){try{jsonpatch[_0xe151('0x1b')](_0x57b1f8,_0x363941,!![]);}catch(_0x28ef49){return BPromise[_0xe151('0x1c')](_0x28ef49);}return _0x57b1f8[_0xe151('0x1d')]();};}function saveUpdates(_0x29b6ca,_0x469f46){return function(_0x36f942){if(_0x36f942){return _0x36f942[_0xe151('0x1e')](_0x29b6ca)[_0xe151('0x1f')](function(_0x37f3ef){return _0x37f3ef;});}return null;};}function removeEntity(_0x52f0bf,_0x3388f5){return function(_0x258b23){if(_0x258b23){return _0x258b23['destroy']()[_0xe151('0x1f')](function(){_0x52f0bf[_0xe151('0x16')](0xcc)[_0xe151('0x17')]();});}};}function handleEntityNotFound(_0x46b7c2,_0x5055bc){return function(_0x2a2f6e){if(!_0x2a2f6e){_0x46b7c2[_0xe151('0x20')](0x194);}return _0x2a2f6e;};}function handleError(_0x46ce04,_0x483cd9){_0x483cd9=_0x483cd9||0x1f4;return function(_0x224746){logger[_0xe151('0x21')](_0x224746[_0xe151('0x22')]);if(_0x224746[_0xe151('0x23')]){delete _0x224746[_0xe151('0x23')];}_0x46ce04['status'](_0x483cd9)[_0xe151('0x24')](_0x224746);};}var utilLicense=require(_0xe151('0x25'));exports[_0xe151('0x26')]=function(_0x2030cd,_0x1925e3){var _0x35037b={'raw':!![],'where':{'id':0x1}},_0x2dc187={};_0x2dc187[_0xe151('0x27')]=_['keys'](db[_0xe151('0x28')]['rawAttributes']);_0x2dc187[_0xe151('0x29')]=_['keys'](_0x2030cd['query']);_0x2dc187['filters']=_[_0xe151('0x2a')](_0x2dc187[_0xe151('0x27')],_0x2dc187[_0xe151('0x29')]);_0x35037b[_0xe151('0x2b')]=_[_0xe151('0x2a')](_0x2dc187[_0xe151('0x27')],qs[_0xe151('0x2c')](_0x2030cd[_0xe151('0x29')][_0xe151('0x2c')]));_0x35037b[_0xe151('0x2b')]=_0x35037b[_0xe151('0x2b')][_0xe151('0x2d')]?_0x35037b[_0xe151('0x2b')]:_0x2dc187[_0xe151('0x27')];_0x35037b=_[_0xe151('0x2e')]({},_0x35037b,_0x2030cd[_0xe151('0x2f')]);return utilLicense[_0xe151('0x30')](_0x35037b)[_0xe151('0x1f')](respondWithResult(_0x1925e3,null))[_0xe151('0x31')](handleError(_0x1925e3,null));};exports[_0xe151('0x1e')]=function(_0x26d26f,_0x37af43){if(_0x26d26f['body']['id']){delete _0x26d26f[_0xe151('0x32')]['id'];}return db[_0xe151('0x28')][_0xe151('0x33')]({'where':{'id':_0x26d26f[_0xe151('0x34')]['id']}})[_0xe151('0x1f')](handleEntityNotFound(_0x37af43,null))['then'](function(_0x296d7d){var _0xc6a220=_0x296d7d[_0xe151('0x35')]({'plain':!![]});return utilLicense[_0xe151('0x36')](_0xc6a220,_0x26d26f['body'][_0xe151('0x37')]);})[_0xe151('0x1f')](function(_0x3cc8c6){if(!_0x3cc8c6[_0xe151('0x38')]){return saveUpdates(_0x26d26f['body'],null);}return _0x3cc8c6;})[_0xe151('0x1f')](respondWithResult(_0x37af43,null))[_0xe151('0x31')](handleError(_0x37af43,null));};
\ No newline at end of file
+var _0xbc85=['querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','count','limit','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','../../config/license/util','index','model','rawAttributes','keys','filters','query','attributes','intersection','fields','catch','body','License','params','checkLicense','key','demo','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc85,0x104));var _0x5bc8=function(_0x3b1705,_0x17bf2e){_0x3b1705=_0x3b1705-0x0;var _0x5157a3=_0xbc85[_0x3b1705];return _0x5157a3;};'use strict';var pdf=require(_0x5bc8('0x0'));var emlformat=require(_0x5bc8('0x1'));var rimraf=require(_0x5bc8('0x2'));var zipdir=require(_0x5bc8('0x3'));var jsonpatch=require(_0x5bc8('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5bc8('0x5'));var Mustache=require(_0x5bc8('0x6'));var util=require(_0x5bc8('0x7'));var path=require(_0x5bc8('0x8'));var sox=require(_0x5bc8('0x9'));var csv=require(_0x5bc8('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5bc8('0xb'));var squel=require(_0x5bc8('0xc'));var crypto=require(_0x5bc8('0xd'));var jsforce=require(_0x5bc8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5bc8('0xa'));var querystring=require(_0x5bc8('0xf'));var Papa=require(_0x5bc8('0x10'));var qs=require(_0x5bc8('0x11'));var logger=require(_0x5bc8('0x12'))(_0x5bc8('0x13'));var utils=require(_0x5bc8('0x14'));var config=require(_0x5bc8('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cf748,_0x34c28e){_0x34c28e=_0x34c28e||0xcc;return function(_0xb4958c){if(_0xb4958c){return _0x1cf748['sendStatus'](_0x34c28e);}return _0x1cf748['status'](_0x34c28e)[_0x5bc8('0x16')]();};}function respondWithResult(_0x4a19f2,_0x4f6417){_0x4f6417=_0x4f6417||0xc8;return function(_0x5411c1){if(_0x5411c1){return _0x4a19f2[_0x5bc8('0x17')](_0x4f6417)[_0x5bc8('0x18')](_0x5411c1);}};}function respondWithFilteredResult(_0x4479ff,_0x35ffd3){return function(_0x1989b5){if(_0x1989b5){var _0x47de0a=_0x1989b5[_0x5bc8('0x19')],_0x16b060=_0x35ffd3['offset'],_0x4659c2=_0x35ffd3['offset']+_0x35ffd3[_0x5bc8('0x1a')],_0x372e34;if(_0x4659c2>=_0x47de0a){_0x4659c2=_0x47de0a;_0x372e34=0xc8;}else{_0x372e34=0xce;}_0x4479ff[_0x5bc8('0x17')](_0x372e34);return _0x4479ff[_0x5bc8('0x1b')]('Content-Range',_0x16b060+'-'+_0x4659c2+'/'+_0x47de0a)[_0x5bc8('0x18')](_0x1989b5);}return null;};}function patchUpdates(_0x535840){return function(_0x1120ea){try{jsonpatch[_0x5bc8('0x1c')](_0x1120ea,_0x535840,!![]);}catch(_0x703b1c){return BPromise[_0x5bc8('0x1d')](_0x703b1c);}return _0x1120ea[_0x5bc8('0x1e')]();};}function saveUpdates(_0x292c6e,_0x495081){return function(_0x442b54){if(_0x442b54){return _0x442b54[_0x5bc8('0x1f')](_0x292c6e)[_0x5bc8('0x20')](function(_0x11309e){return _0x11309e;});}return null;};}function removeEntity(_0x547c49,_0x47bbf0){return function(_0x1fc1b7){if(_0x1fc1b7){return _0x1fc1b7['destroy']()[_0x5bc8('0x20')](function(){_0x547c49[_0x5bc8('0x17')](0xcc)[_0x5bc8('0x16')]();});}};}function handleEntityNotFound(_0x4c5486,_0x2e93d0){return function(_0x9878ea){if(!_0x9878ea){_0x4c5486[_0x5bc8('0x21')](0x194);}return _0x9878ea;};}function handleError(_0x41a141,_0x184df0){_0x184df0=_0x184df0||0x1f4;return function(_0xcb22eb){logger[_0x5bc8('0x22')](_0xcb22eb[_0x5bc8('0x23')]);if(_0xcb22eb[_0x5bc8('0x24')]){delete _0xcb22eb['name'];}_0x41a141[_0x5bc8('0x17')](_0x184df0)[_0x5bc8('0x25')](_0xcb22eb);};}var utilLicense=require(_0x5bc8('0x26'));exports[_0x5bc8('0x27')]=function(_0x5ce01d,_0x52ef0d){var _0x4e951d={'raw':!![],'where':{'id':0x1}},_0xf23d9a={};_0xf23d9a[_0x5bc8('0x28')]=_['keys'](db['License'][_0x5bc8('0x29')]);_0xf23d9a['query']=_[_0x5bc8('0x2a')](_0x5ce01d['query']);_0xf23d9a[_0x5bc8('0x2b')]=_['intersection'](_0xf23d9a['model'],_0xf23d9a[_0x5bc8('0x2c')]);_0x4e951d[_0x5bc8('0x2d')]=_[_0x5bc8('0x2e')](_0xf23d9a[_0x5bc8('0x28')],qs[_0x5bc8('0x2f')](_0x5ce01d[_0x5bc8('0x2c')]['fields']));_0x4e951d[_0x5bc8('0x2d')]=_0x4e951d[_0x5bc8('0x2d')]['length']?_0x4e951d[_0x5bc8('0x2d')]:_0xf23d9a[_0x5bc8('0x28')];_0x4e951d=_['merge']({},_0x4e951d,_0x5ce01d['options']);return utilLicense['getLicense'](_0x4e951d)['then'](respondWithResult(_0x52ef0d,null))[_0x5bc8('0x30')](handleError(_0x52ef0d,null));};exports[_0x5bc8('0x1f')]=function(_0x102e4b,_0x4aedf4){if(_0x102e4b[_0x5bc8('0x31')]['id']){delete _0x102e4b[_0x5bc8('0x31')]['id'];}return db[_0x5bc8('0x32')]['find']({'where':{'id':_0x102e4b[_0x5bc8('0x33')]['id']}})[_0x5bc8('0x20')](handleEntityNotFound(_0x4aedf4,null))['then'](function(_0x16fa42){var _0x522ffe=_0x16fa42['get']({'plain':!![]});return utilLicense[_0x5bc8('0x34')](_0x522ffe,_0x102e4b[_0x5bc8('0x31')][_0x5bc8('0x35')]);})[_0x5bc8('0x20')](function(_0x12658b){if(!_0x12658b[_0x5bc8('0x36')]){return saveUpdates(_0x102e4b['body'],null);}return _0x12658b;})[_0x5bc8('0x20')](respondWithResult(_0x4aedf4,null))['catch'](handleError(_0x4aedf4,null));};
\ No newline at end of file
index 64fad70..db718e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x851d=['license','lodash','../../config/logger','api','bluebird','request-promise','./license.attributes','exports'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x851d,0x69));var _0xd851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd851('0x0'));var util=require('util');var logger=require(_0xd851('0x1'))(_0xd851('0x2'));var moment=require('moment');var BPromise=require(_0xd851('0x3'));var rp=require(_0xd851('0x4'));var attributes=require(_0xd851('0x5'));module[_0xd851('0x6')]=function(_0x36eb20,_0x456821){return _0x36eb20['define']('License',attributes,{'tableName':_0xd851('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8ce3=['request-promise','./license.attributes','exports','License','license','lodash','util','api','moment','bluebird'];(function(_0x4136b2,_0x39a2cc){var _0x35ab59=function(_0x2d070e){while(--_0x2d070e){_0x4136b2['push'](_0x4136b2['shift']());}};_0x35ab59(++_0x39a2cc);}(_0x8ce3,0xc3));var _0x38ce=function(_0x1ccf3d,_0x461209){_0x1ccf3d=_0x1ccf3d-0x0;var _0x5345c1=_0x8ce3[_0x1ccf3d];return _0x5345c1;};'use strict';var _=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var logger=require('../../config/logger')(_0x38ce('0x2'));var moment=require(_0x38ce('0x3'));var BPromise=require(_0x38ce('0x4'));var rp=require(_0x38ce('0x5'));var attributes=require(_0x38ce('0x6'));module[_0x38ce('0x7')]=function(_0x1efae3,_0x381fa0){return _0x1efae3['define'](_0x38ce('0x8'),attributes,{'tableName':_0x38ce('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 102bcf1..1290e97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1296=['../../config/logger','rpc','jayson/promise','client','http','request','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x1296,0x144));var _0x6129=function(_0x431c62,_0x25e66b){_0x431c62=_0x431c62-0x0;var _0x427a5e=_0x1296[_0x431c62];return _0x427a5e;};'use strict';var _=require(_0x6129('0x0'));var util=require(_0x6129('0x1'));var moment=require(_0x6129('0x2'));var BPromise=require(_0x6129('0x3'));var rs=require(_0x6129('0x4'));var fs=require('fs');var db=require(_0x6129('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6129('0x6'))(_0x6129('0x7'));var config=require('../../config/environment');var jayson=require(_0x6129('0x8'));var client=jayson[_0x6129('0x9')][_0x6129('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b5c37,_0x5efb5a,_0x33c727){return new BPromise(function(_0x365978,_0x10f734){return client[_0x6129('0xb')](_0x3b5c37,_0x33c727)['then'](function(_0x67e6c5){logger[_0x6129('0xc')](_0x6129('0xd'),_0x5efb5a,'request\x20sent');logger[_0x6129('0xe')](_0x6129('0xf'),_0x5efb5a,_0x6129('0x10'),JSON[_0x6129('0x11')](_0x67e6c5));if(_0x67e6c5[_0x6129('0x12')]){if(_0x67e6c5[_0x6129('0x12')][_0x6129('0x13')]===0x1f4){logger[_0x6129('0x12')](_0x6129('0xd'),_0x5efb5a,_0x67e6c5[_0x6129('0x12')]['message']);return _0x10f734(_0x67e6c5[_0x6129('0x12')][_0x6129('0x14')]);}logger[_0x6129('0x12')](_0x6129('0xd'),_0x5efb5a,_0x67e6c5[_0x6129('0x12')][_0x6129('0x14')]);return _0x365978(_0x67e6c5[_0x6129('0x12')][_0x6129('0x14')]);}else{logger[_0x6129('0xc')](_0x6129('0xd'),_0x5efb5a,_0x6129('0x10'));_0x365978(_0x67e6c5['result'][_0x6129('0x14')]);}})[_0x6129('0x15')](function(_0x5a1a2a){logger[_0x6129('0x12')](_0x6129('0xd'),_0x5efb5a,_0x5a1a2a);_0x10f734(_0x5a1a2a);});});}
\ No newline at end of file
+var _0x6630=['then','info','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','License,\x20%s,\x20%s','request\x20sent','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x41b14b,_0x38c67b){var _0x5f16a6=function(_0x14ccf8){while(--_0x14ccf8){_0x41b14b['push'](_0x41b14b['shift']());}};_0x5f16a6(++_0x38c67b);}(_0x6630,0x12b));var _0x0663=function(_0x4f519d,_0x49d6f0){_0x4f519d=_0x4f519d-0x0;var _0x5c862e=_0x6630[_0x4f519d];return _0x5c862e;};'use strict';var _=require(_0x0663('0x0'));var util=require(_0x0663('0x1'));var moment=require(_0x0663('0x2'));var BPromise=require(_0x0663('0x3'));var rs=require(_0x0663('0x4'));var fs=require('fs');var db=require(_0x0663('0x5'))['db'];var utils=require(_0x0663('0x6'));var logger=require(_0x0663('0x7'))(_0x0663('0x8'));var config=require(_0x0663('0x9'));var jayson=require(_0x0663('0xa'));var client=jayson[_0x0663('0xb')][_0x0663('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47c0c7,_0x4f2e11,_0xef74b7){return new BPromise(function(_0x5806ce,_0x48e0a4){return client['request'](_0x47c0c7,_0xef74b7)[_0x0663('0xd')](function(_0x2ca187){logger[_0x0663('0xe')]('License,\x20%s,\x20%s',_0x4f2e11,'request\x20sent');logger[_0x0663('0xf')](_0x0663('0x10'),_0x4f2e11,'request\x20sent',JSON[_0x0663('0x11')](_0x2ca187));if(_0x2ca187[_0x0663('0x12')]){if(_0x2ca187[_0x0663('0x12')][_0x0663('0x13')]===0x1f4){logger[_0x0663('0x12')]('License,\x20%s,\x20%s',_0x4f2e11,_0x2ca187[_0x0663('0x12')][_0x0663('0x14')]);return _0x48e0a4(_0x2ca187[_0x0663('0x12')][_0x0663('0x14')]);}logger[_0x0663('0x12')](_0x0663('0x15'),_0x4f2e11,_0x2ca187[_0x0663('0x12')][_0x0663('0x14')]);return _0x5806ce(_0x2ca187[_0x0663('0x12')][_0x0663('0x14')]);}else{logger[_0x0663('0xe')](_0x0663('0x15'),_0x4f2e11,_0x0663('0x16'));_0x5806ce(_0x2ca187[_0x0663('0x17')][_0x0663('0x14')]);}})['catch'](function(_0x1d16ff){logger['error']('License,\x20%s,\x20%s',_0x4f2e11,_0x1d16ff);_0x48e0a4(_0x1d16ff);});});}
\ No newline at end of file
index d704374..2885495 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4202=['express','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','/:id/dispositions','addDisposition','addAnswer','create','/:id/in_servers','addImap','/:id/out_servers','addSmtp','addInteraction','/:id/send','send','addAgents','put','delete','removeDispositions','removeSmtp','/:id/users','removeAgents','exports','multer','util','path'];(function(_0x3590ed,_0x3a4587){var _0x21f72f=function(_0x45be21){while(--_0x45be21){_0x3590ed['push'](_0x3590ed['shift']());}};_0x21f72f(++_0x3a4587);}(_0x4202,0xe8));var _0x2420=function(_0x1f1511,_0x4ea911){_0x1f1511=_0x1f1511-0x0;var _0x1d9ab8=_0x4202[_0x1f1511];return _0x1d9ab8;};'use strict';var multer=require(_0x2420('0x0'));var util=require(_0x2420('0x1'));var path=require(_0x2420('0x2'));var express=require(_0x2420('0x3'));var router=express['Router']();var auth=require(_0x2420('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2420('0x5'));var controller=require(_0x2420('0x6'));router[_0x2420('0x7')]('/',auth[_0x2420('0x8')](),controller[_0x2420('0x9')]);router['get'](_0x2420('0xa'),auth['isAuthenticated'](),controller[_0x2420('0xb')]);router['get'](_0x2420('0xc'),auth[_0x2420('0x8')](),controller['show']);router[_0x2420('0x7')]('/:id/dispositions',auth[_0x2420('0x8')](),controller[_0x2420('0xd')]);router['get'](_0x2420('0xe'),auth[_0x2420('0x8')](),controller[_0x2420('0xf')]);router[_0x2420('0x7')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x2420('0x10')]);router[_0x2420('0x7')]('/:id/out_servers',auth[_0x2420('0x8')](),controller[_0x2420('0x11')]);router[_0x2420('0x7')](_0x2420('0x12'),auth[_0x2420('0x8')](),controller[_0x2420('0x13')]);router[_0x2420('0x7')](_0x2420('0x14'),auth[_0x2420('0x8')](),controller[_0x2420('0x15')]);router[_0x2420('0x7')](_0x2420('0x16'),auth['isAuthenticated'](),controller[_0x2420('0x17')]);router[_0x2420('0x7')](_0x2420('0x18'),auth[_0x2420('0x8')](),controller[_0x2420('0x19')]);router[_0x2420('0x7')]('/:id/users',auth[_0x2420('0x8')](),controller[_0x2420('0x1a')]);router[_0x2420('0x1b')](_0x2420('0x1c'),auth[_0x2420('0x8')](),controller[_0x2420('0x1d')]);router[_0x2420('0x1b')](_0x2420('0xe'),auth[_0x2420('0x8')](),controller[_0x2420('0x1e')]);router[_0x2420('0x1b')]('/',auth[_0x2420('0x8')](),controller[_0x2420('0x1f')]);router[_0x2420('0x1b')](_0x2420('0x20'),auth[_0x2420('0x8')](),controller[_0x2420('0x21')]);router[_0x2420('0x1b')](_0x2420('0x22'),auth[_0x2420('0x8')](),controller[_0x2420('0x23')]);router[_0x2420('0x1b')](_0x2420('0x12'),auth[_0x2420('0x8')](),controller[_0x2420('0x24')]);router['post']('/:id/applications',auth[_0x2420('0x8')](),controller['addApplications']);router[_0x2420('0x1b')](_0x2420('0x25'),auth[_0x2420('0x8')](),controller[_0x2420('0x26')]);router[_0x2420('0x1b')]('/:id/users',auth[_0x2420('0x8')](),controller[_0x2420('0x27')]);router[_0x2420('0x28')](_0x2420('0xc'),auth[_0x2420('0x8')](),controller['update']);router[_0x2420('0x29')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x2420('0x2a')]);router[_0x2420('0x29')](_0x2420('0xe'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x2420('0x29')](_0x2420('0x20'),auth[_0x2420('0x8')](),controller['removeImap']);router[_0x2420('0x29')]('/:id/out_servers',auth[_0x2420('0x8')](),controller[_0x2420('0x2b')]);router['delete'](_0x2420('0xc'),auth[_0x2420('0x8')](),controller['destroy']);router['delete'](_0x2420('0x2c'),auth['isAuthenticated'](),controller[_0x2420('0x2d')]);module[_0x2420('0x2e')]=router;
\ No newline at end of file
+var _0xd9d7=['getDispositions','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','/:id','update','delete','/:id/canned_answers','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions'];(function(_0x28a60d,_0x3aa303){var _0x1b465e=function(_0x54e665){while(--_0x54e665){_0x28a60d['push'](_0x28a60d['shift']());}};_0x1b465e(++_0x3aa303);}(_0xd9d7,0x1dc));var _0x7d9d=function(_0x1bce27,_0x468041){_0x1bce27=_0x1bce27-0x0;var _0x18747d=_0xd9d7[_0x1bce27];return _0x18747d;};'use strict';var multer=require(_0x7d9d('0x0'));var util=require('util');var path=require(_0x7d9d('0x1'));var express=require(_0x7d9d('0x2'));var router=express[_0x7d9d('0x3')]();var auth=require(_0x7d9d('0x4'));var interaction=require(_0x7d9d('0x5'));var config=require(_0x7d9d('0x6'));var controller=require(_0x7d9d('0x7'));router[_0x7d9d('0x8')]('/',auth[_0x7d9d('0x9')](),controller['index']);router[_0x7d9d('0x8')](_0x7d9d('0xa'),auth['isAuthenticated'](),controller[_0x7d9d('0xb')]);router[_0x7d9d('0x8')]('/:id',auth[_0x7d9d('0x9')](),controller[_0x7d9d('0xc')]);router['get'](_0x7d9d('0xd'),auth[_0x7d9d('0x9')](),controller[_0x7d9d('0xe')]);router[_0x7d9d('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x7d9d('0x8')](_0x7d9d('0xf'),auth[_0x7d9d('0x9')](),controller[_0x7d9d('0x10')]);router[_0x7d9d('0x8')](_0x7d9d('0x11'),auth[_0x7d9d('0x9')](),controller['getSmtp']);router[_0x7d9d('0x8')](_0x7d9d('0x12'),auth[_0x7d9d('0x9')](),controller[_0x7d9d('0x13')]);router['get'](_0x7d9d('0x14'),auth[_0x7d9d('0x9')](),controller[_0x7d9d('0x15')]);router[_0x7d9d('0x8')](_0x7d9d('0x16'),auth['isAuthenticated'](),controller[_0x7d9d('0x17')]);router[_0x7d9d('0x8')](_0x7d9d('0x18'),auth[_0x7d9d('0x9')](),controller[_0x7d9d('0x19')]);router[_0x7d9d('0x8')](_0x7d9d('0x1a'),auth[_0x7d9d('0x9')](),controller[_0x7d9d('0x1b')]);router[_0x7d9d('0x1c')](_0x7d9d('0xd'),auth['isAuthenticated'](),controller[_0x7d9d('0x1d')]);router['post']('/:id/canned_answers',auth[_0x7d9d('0x9')](),controller[_0x7d9d('0x1e')]);router[_0x7d9d('0x1c')]('/',auth[_0x7d9d('0x9')](),controller[_0x7d9d('0x1f')]);router[_0x7d9d('0x1c')](_0x7d9d('0xf'),auth[_0x7d9d('0x9')](),controller[_0x7d9d('0x20')]);router[_0x7d9d('0x1c')](_0x7d9d('0x11'),auth[_0x7d9d('0x9')](),controller[_0x7d9d('0x21')]);router['post']('/:id/interactions',auth[_0x7d9d('0x9')](),controller[_0x7d9d('0x22')]);router[_0x7d9d('0x1c')](_0x7d9d('0x14'),auth[_0x7d9d('0x9')](),controller[_0x7d9d('0x23')]);router[_0x7d9d('0x1c')](_0x7d9d('0x24'),auth[_0x7d9d('0x9')](),controller[_0x7d9d('0x25')]);router['post'](_0x7d9d('0x1a'),auth[_0x7d9d('0x9')](),controller[_0x7d9d('0x26')]);router[_0x7d9d('0x27')](_0x7d9d('0x28'),auth[_0x7d9d('0x9')](),controller[_0x7d9d('0x29')]);router[_0x7d9d('0x2a')]('/:id/dispositions',auth[_0x7d9d('0x9')](),controller['removeDispositions']);router[_0x7d9d('0x2a')](_0x7d9d('0x2b'),auth[_0x7d9d('0x9')](),controller[_0x7d9d('0x2c')]);router[_0x7d9d('0x2a')](_0x7d9d('0xf'),auth['isAuthenticated'](),controller[_0x7d9d('0x2d')]);router[_0x7d9d('0x2a')](_0x7d9d('0x11'),auth[_0x7d9d('0x9')](),controller[_0x7d9d('0x2e')]);router[_0x7d9d('0x2a')]('/:id',auth[_0x7d9d('0x9')](),controller[_0x7d9d('0x2f')]);router['delete'](_0x7d9d('0x1a'),auth[_0x7d9d('0x9')](),controller[_0x7d9d('0x30')]);module['exports']=router;
\ No newline at end of file
index 7bd4342..749d56e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd138=['Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x1ef656,_0x4c68b0){var _0x543e7b=function(_0x2a4758){while(--_0x2a4758){_0x1ef656['push'](_0x1ef656['shift']());}};_0x543e7b(++_0x4c68b0);}(_0xd138,0x1dc));var _0x8d13=function(_0xdcfb66,_0x549a30){_0xdcfb66=_0xdcfb66-0x0;var _0x386c2a=_0xd138[_0xdcfb66];return _0x386c2a;};'use strict';var Sequelize=require(_0x8d13('0x0'));module[_0x8d13('0x1')]={'description':{'type':Sequelize[_0x8d13('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x8d13('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x8d13('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x8d13('0x4');}},'notificationSound':{'type':Sequelize[_0x8d13('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8d13('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8d13('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8d13('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8d13('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c}};
\ No newline at end of file
+var _0x6075=['STRING','BOOLEAN','INTEGER','TEXT','sequelize','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6075,0x142));var _0x5607=function(_0x213bd0,_0x4444d2){_0x213bd0=_0x213bd0-0x0;var _0x34361a=_0x6075[_0x213bd0];return _0x34361a;};'use strict';var Sequelize=require(_0x5607('0x0'));module[_0x5607('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x5607('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x5607('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x5607('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x5607('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x5607('0x4')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x5607('0x5')],'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[_0x5607('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5607('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5607('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5607('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5607('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5607('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5607('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c}};
\ No newline at end of file
index 9fc6c63..55aaa7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd371=['MailAccountId','Disposition','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','removeAnswers','isNil','active','description','cservice','cauthentication','user','cuser','password','authentication','host','port','service','pass','cpassword','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','map','Contact','Owner','fullname','internal','Tags','tag','addApplications','sequelize','transaction','MailApplication','destroy','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','send','CmContact','Contacts','DESC','from','%s\x20<%s>','email','attachments','root','server/files/attachments','basename','secure','auth','SendMail','sendMail','List','defaults','ListId','subject','attach','out','messageId','Messages','verifySmtp','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','User','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','socket.io-emitter','localhost','register','jayson/promise','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','index','MailServerIn','Imap','MailServerOut','Smtp','MailAccount','rawAttributes','model','keys','query','dateStart','dateEnd','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filters','add','day','merge','filter','includeAll','include','findAll','rows','show','params','intersection','length','options','find','body','describe','addDisposition'];(function(_0x1722e7,_0x57e171){var _0x43e4d7=function(_0xc4389d){while(--_0xc4389d){_0x1722e7['push'](_0x1722e7['shift']());}};_0x43e4d7(++_0x57e171);}(_0xd371,0x10f));var _0x1d37=function(_0x843880,_0x1516d1){_0x843880=_0x843880-0x0;var _0x49943f=_0xd371[_0x843880];return _0x49943f;};'use strict';var pdf=require(_0x1d37('0x0'));var emlformat=require(_0x1d37('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1d37('0x2'));var moment=require(_0x1d37('0x3'));var BPromise=require(_0x1d37('0x4'));var Mustache=require(_0x1d37('0x5'));var util=require(_0x1d37('0x6'));var path=require('path');var sox=require(_0x1d37('0x7'));var csv=require(_0x1d37('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1d37('0x9'));var squel=require(_0x1d37('0xa'));var crypto=require('crypto');var jsforce=require(_0x1d37('0xb'));var deskjs=require(_0x1d37('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1d37('0xd'));var Papa=require(_0x1d37('0xe'));var qs=require(_0x1d37('0xf'));var logger=require(_0x1d37('0x10'))(_0x1d37('0x11'));var utils=require(_0x1d37('0x12'));var config=require('../../config/environment');var db=require(_0x1d37('0x13'))['db'];var socket=require(_0x1d37('0x14'))({'host':_0x1d37('0x15'),'port':0x18eb});require('./mailAccount.socket')[_0x1d37('0x16')](socket);var jayson=require(_0x1d37('0x17'));var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x204b08,_0x3987a1,_0x4fab11,_0x5098c6){return new BPromise(function(_0x469d67,_0x53d8df){var _0xd24363=_0x5098c6||client;return _0xd24363[_0x1d37('0x18')](_0x204b08,_0x4fab11)['then'](function(_0xb8610d){logger[_0x1d37('0x19')](_0x1d37('0x1a'),_0x3987a1,_0x1d37('0x1b'));logger[_0x1d37('0x1c')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x3987a1,_0x1d37('0x1b'),JSON[_0x1d37('0x1d')](_0xb8610d));if(_0xb8610d[_0x1d37('0x1e')]){if(_0xb8610d[_0x1d37('0x1e')][_0x1d37('0x1f')]===0x1f4){logger[_0x1d37('0x1e')](_0x1d37('0x1a'),_0x3987a1,_0xb8610d['error'][_0x1d37('0x20')]);return _0x53d8df(_0xb8610d[_0x1d37('0x1e')]['message']);}logger[_0x1d37('0x1e')](_0x1d37('0x1a'),_0x3987a1,_0xb8610d[_0x1d37('0x1e')][_0x1d37('0x20')]);return _0x469d67(_0xb8610d[_0x1d37('0x1e')][_0x1d37('0x20')]);}else{logger[_0x1d37('0x19')]('MailAccount,\x20%s,\x20%s',_0x3987a1,_0x1d37('0x1b'));_0x469d67(_0xb8610d['result'][_0x1d37('0x20')]);}})[_0x1d37('0x21')](function(_0xcf1b69){logger[_0x1d37('0x1e')](_0x1d37('0x1a'),_0x3987a1,_0xcf1b69);_0x53d8df(_0xcf1b69);});});}function respondWithStatusCode(_0x217bcc,_0x467220){_0x467220=_0x467220||0xcc;return function(_0x1a445a){if(_0x1a445a){return _0x217bcc[_0x1d37('0x22')](_0x467220);}return _0x217bcc[_0x1d37('0x23')](_0x467220)[_0x1d37('0x24')]();};}function respondWithResult(_0x48f62f,_0x95c02e){_0x95c02e=_0x95c02e||0xc8;return function(_0x1abcb9){if(_0x1abcb9){return _0x48f62f['status'](_0x95c02e)[_0x1d37('0x25')](_0x1abcb9);}};}function respondWithFilteredResult(_0x2f8559,_0x174264){return function(_0x45bddb){if(_0x45bddb){var _0x356a5e=_0x45bddb[_0x1d37('0x26')],_0x2fd795=_0x174264[_0x1d37('0x27')],_0x57799d=_0x174264['offset']+_0x174264['limit'],_0x4ebea1;if(_0x57799d>=_0x356a5e){_0x57799d=_0x356a5e;_0x4ebea1=0xc8;}else{_0x4ebea1=0xce;}_0x2f8559[_0x1d37('0x23')](_0x4ebea1);return _0x2f8559[_0x1d37('0x28')](_0x1d37('0x29'),_0x2fd795+'-'+_0x57799d+'/'+_0x356a5e)[_0x1d37('0x25')](_0x45bddb);}return null;};}function patchUpdates(_0x12f788){return function(_0x17a51a){try{jsonpatch[_0x1d37('0x2a')](_0x17a51a,_0x12f788,!![]);}catch(_0x3fa866){return BPromise[_0x1d37('0x2b')](_0x3fa866);}return _0x17a51a[_0x1d37('0x2c')]();};}function saveUpdates(_0xbe7e84,_0x2ffa0a){return function(_0x5bf018){if(_0x5bf018){return _0x5bf018[_0x1d37('0x2d')](_0xbe7e84)[_0x1d37('0x2e')](function(_0x14ff90){return _0x14ff90;});}return null;};}function removeEntity(_0x454802,_0x55a445){return function(_0x479a2e){if(_0x479a2e){return _0x479a2e['destroy']()[_0x1d37('0x2e')](function(){_0x454802[_0x1d37('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x214180,_0xbed7cb){return function(_0xcb6692){if(!_0xcb6692){_0x214180['sendStatus'](0x194);}return _0xcb6692;};}function handleError(_0x2beef8,_0x2e6409){_0x2e6409=_0x2e6409||0x1f4;return function(_0xb1d172){logger['error'](_0xb1d172[_0x1d37('0x2f')]);if(_0xb1d172[_0x1d37('0x30')]){delete _0xb1d172[_0x1d37('0x30')];}_0x2beef8[_0x1d37('0x23')](_0x2e6409)['send'](_0xb1d172);};}exports[_0x1d37('0x31')]=function(_0x24433f,_0x50afe0){var _0x22e35b={'include':[{'model':db[_0x1d37('0x32')],'as':_0x1d37('0x33')},{'model':db[_0x1d37('0x34')],'as':_0x1d37('0x35')}]},_0x160191={},_0x11b89c={'count':0x0,'rows':[]};var _0x1b703a=db[_0x1d37('0x36')][_0x1d37('0x37')];_0x160191[_0x1d37('0x38')]=_[_0x1d37('0x39')](_0x1b703a);var _0x34e12c={'dateStart':_0x24433f[_0x1d37('0x3a')][_0x1d37('0x3b')],'dateEnd':_0x24433f[_0x1d37('0x3a')][_0x1d37('0x3c')]};delete _0x24433f[_0x1d37('0x3a')][_0x1d37('0x3b')];delete _0x24433f[_0x1d37('0x3a')][_0x1d37('0x3c')];_0x160191[_0x1d37('0x3a')]=_['keys'](_0x24433f[_0x1d37('0x3a')]);_0x160191['filters']=_['intersection'](_0x160191[_0x1d37('0x38')],_0x160191[_0x1d37('0x3a')]);_0x22e35b[_0x1d37('0x3d')]=_['intersection'](_0x160191[_0x1d37('0x38')],qs['fields'](_0x24433f[_0x1d37('0x3a')][_0x1d37('0x3e')]));_0x22e35b[_0x1d37('0x3d')]=_0x22e35b[_0x1d37('0x3d')]['length']?_0x22e35b[_0x1d37('0x3d')]:_0x160191['model'];if(!_0x24433f[_0x1d37('0x3a')][_0x1d37('0x3f')]('nolimit')){_0x22e35b[_0x1d37('0x40')]=qs['limit'](_0x24433f[_0x1d37('0x3a')][_0x1d37('0x40')]);_0x22e35b[_0x1d37('0x27')]=qs[_0x1d37('0x27')](_0x24433f['query'][_0x1d37('0x27')]);}_0x22e35b[_0x1d37('0x41')]=qs[_0x1d37('0x42')](_0x24433f[_0x1d37('0x3a')][_0x1d37('0x42')]);_0x22e35b[_0x1d37('0x43')]=qs['filters'](_[_0x1d37('0x44')](_0x24433f[_0x1d37('0x3a')],_0x160191[_0x1d37('0x45')]));if(_0x34e12c['dateStart']){if(_0x34e12c['dateEnd']){_0x34e12c['dateEnd']=moment(_0x34e12c['dateEnd'])[_0x1d37('0x46')](0x1,'day');}else{_0x34e12c[_0x1d37('0x3c')]=moment(_0x34e12c[_0x1d37('0x3b')])[_0x1d37('0x46')](0x1,_0x1d37('0x47'));}_[_0x1d37('0x48')](_0x22e35b[_0x1d37('0x43')],{'createdAt':{'$gte':_0x34e12c[_0x1d37('0x3b')],'$lte':_0x34e12c[_0x1d37('0x3c')]}});}if(_0x24433f[_0x1d37('0x3a')][_0x1d37('0x49')]){_0x22e35b[_0x1d37('0x43')]=_[_0x1d37('0x48')](_0x22e35b[_0x1d37('0x43')],{'$or':_['map'](_0x22e35b[_0x1d37('0x3d')],function(_0x2b3daf){var _0x29251f={};_0x29251f[_0x2b3daf]={'$like':'%'+_0x24433f['query'][_0x1d37('0x49')]+'%'};return _0x29251f;})});}_0x22e35b=_[_0x1d37('0x48')]({},_0x22e35b,_0x24433f['options']);var _0x2acfd5={'where':_0x22e35b['where']};return db[_0x1d37('0x36')][_0x1d37('0x26')](_0x2acfd5)[_0x1d37('0x2e')](function(_0x34b4de){_0x11b89c[_0x1d37('0x26')]=_0x34b4de;if(_0x24433f[_0x1d37('0x3a')][_0x1d37('0x4a')]){_0x22e35b[_0x1d37('0x4b')]=[{'all':!![]}];}return db[_0x1d37('0x36')][_0x1d37('0x4c')](_0x22e35b);})[_0x1d37('0x2e')](function(_0x48de43){_0x11b89c[_0x1d37('0x4d')]=_0x48de43;return _0x11b89c;})[_0x1d37('0x2e')](respondWithFilteredResult(_0x50afe0,_0x22e35b))[_0x1d37('0x21')](handleError(_0x50afe0,null));};exports[_0x1d37('0x4e')]=function(_0x210c33,_0x43fcc5){var _0x4772bb={'raw':![],'where':{'id':_0x210c33[_0x1d37('0x4f')]['id']},'include':[{'model':db[_0x1d37('0x32')],'as':'Imap'},{'model':db[_0x1d37('0x34')],'as':_0x1d37('0x35')}]},_0x555d24={};_0x555d24['model']=_[_0x1d37('0x39')](db[_0x1d37('0x36')]['rawAttributes']);_0x555d24[_0x1d37('0x3a')]=_[_0x1d37('0x39')](_0x210c33[_0x1d37('0x3a')]);_0x555d24[_0x1d37('0x45')]=_[_0x1d37('0x50')](_0x555d24[_0x1d37('0x38')],_0x555d24[_0x1d37('0x3a')]);_0x4772bb[_0x1d37('0x3d')]=_[_0x1d37('0x50')](_0x555d24[_0x1d37('0x38')],qs['fields'](_0x210c33[_0x1d37('0x3a')][_0x1d37('0x3e')]));_0x4772bb[_0x1d37('0x3d')]=_0x4772bb[_0x1d37('0x3d')][_0x1d37('0x51')]?_0x4772bb['attributes']:_0x555d24['model'];if(_0x210c33[_0x1d37('0x3a')][_0x1d37('0x4a')]){_0x4772bb['include']=[{'all':!![]}];}_0x4772bb=_[_0x1d37('0x48')]({},_0x4772bb,_0x210c33[_0x1d37('0x52')]);return db[_0x1d37('0x36')][_0x1d37('0x53')](_0x4772bb)[_0x1d37('0x2e')](handleEntityNotFound(_0x43fcc5,null))[_0x1d37('0x2e')](respondWithResult(_0x43fcc5,null))[_0x1d37('0x21')](handleError(_0x43fcc5,null));};exports[_0x1d37('0x2d')]=function(_0x1caeba,_0x883bb8){if(_0x1caeba[_0x1d37('0x54')]['id']){delete _0x1caeba[_0x1d37('0x54')]['id'];}return db[_0x1d37('0x36')][_0x1d37('0x53')]({'where':{'id':_0x1caeba[_0x1d37('0x4f')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x1d37('0x33')},{'model':db[_0x1d37('0x34')],'as':_0x1d37('0x35')}]})[_0x1d37('0x2e')](handleEntityNotFound(_0x883bb8,null))[_0x1d37('0x2e')](saveUpdates(_0x1caeba[_0x1d37('0x54')],null))['then'](function(_0x255193){if(_0x255193&&_0x1caeba['body'][_0x1d37('0x33')]){return db[_0x1d37('0x32')]['update'](_0x1caeba[_0x1d37('0x54')][_0x1d37('0x33')],{'where':{'MailAccountId':_0x255193['id']}})[_0x1d37('0x2e')](function(){return _0x255193;});}return _0x255193;})[_0x1d37('0x2e')](function(_0x20f366){if(_0x20f366&&_0x1caeba[_0x1d37('0x54')][_0x1d37('0x35')]){return db[_0x1d37('0x34')][_0x1d37('0x2d')](_0x1caeba[_0x1d37('0x54')][_0x1d37('0x35')],{'where':{'MailAccountId':_0x20f366['id']}})[_0x1d37('0x2e')](function(){return _0x20f366;});}return _0x20f366;})[_0x1d37('0x2e')](respondWithResult(_0x883bb8,null))['catch'](handleError(_0x883bb8,null));};exports['describe']=function(_0xc12276,_0x389359){return db[_0x1d37('0x36')][_0x1d37('0x55')]()[_0x1d37('0x2e')](respondWithResult(_0x389359,null))[_0x1d37('0x21')](handleError(_0x389359,null));};exports[_0x1d37('0x56')]=function(_0x28f9e5,_0x1e7dde,_0x43b2cd){if(_0x28f9e5[_0x1d37('0x54')]['id']){delete _0x28f9e5[_0x1d37('0x54')]['id'];}return db[_0x1d37('0x36')][_0x1d37('0x53')]({'where':{'id':_0x28f9e5[_0x1d37('0x4f')]['id']}})[_0x1d37('0x2e')](handleEntityNotFound(_0x1e7dde,null))[_0x1d37('0x2e')](function(_0x31d5df){if(_0x31d5df){_0x28f9e5[_0x1d37('0x54')][_0x1d37('0x57')]=_0x31d5df['id'];return db[_0x1d37('0x58')]['create'](_0x28f9e5[_0x1d37('0x54')]);}})[_0x1d37('0x2e')](respondWithResult(_0x1e7dde,null))[_0x1d37('0x21')](handleError(_0x1e7dde,null));};exports['getDispositions']=function(_0xe45932,_0x49b514,_0x19876e){var _0x5f151c={'raw':![],'where':{}};var _0x2f1190={};var _0x40759a={'count':0x0,'rows':[]};return db['MailAccount'][_0x1d37('0x59')]({'where':{'id':_0xe45932[_0x1d37('0x4f')]['id']}})[_0x1d37('0x2e')](handleEntityNotFound(_0x49b514,null))[_0x1d37('0x2e')](function(_0x4e08dd){if(_0x4e08dd){_0x2f1190['model']=_[_0x1d37('0x39')](db[_0x1d37('0x58')]['rawAttributes']);_0x2f1190[_0x1d37('0x3a')]=_[_0x1d37('0x39')](_0xe45932[_0x1d37('0x3a')]);_0x2f1190[_0x1d37('0x45')]=_['intersection'](_0x2f1190[_0x1d37('0x38')],_0x2f1190[_0x1d37('0x3a')]);_0x5f151c[_0x1d37('0x3d')]=_[_0x1d37('0x50')](_0x2f1190[_0x1d37('0x38')],qs[_0x1d37('0x3e')](_0xe45932['query']['fields']));_0x5f151c[_0x1d37('0x3d')]=_0x5f151c[_0x1d37('0x3d')]['length']?_0x5f151c['attributes']:_0x2f1190[_0x1d37('0x38')];if(!_0xe45932[_0x1d37('0x3a')][_0x1d37('0x3f')](_0x1d37('0x5a'))){_0x5f151c[_0x1d37('0x40')]=qs['limit'](_0xe45932[_0x1d37('0x3a')][_0x1d37('0x40')]);_0x5f151c[_0x1d37('0x27')]=qs[_0x1d37('0x27')](_0xe45932[_0x1d37('0x3a')][_0x1d37('0x27')]);}_0x5f151c[_0x1d37('0x41')]=qs[_0x1d37('0x42')](_0xe45932[_0x1d37('0x3a')][_0x1d37('0x42')]);_0x5f151c[_0x1d37('0x43')]=qs['filters'](_[_0x1d37('0x44')](_0xe45932[_0x1d37('0x3a')],_0x2f1190['filters']));_0x5f151c['where'][_0x1d37('0x57')]=_0x4e08dd['id'];if(_0xe45932[_0x1d37('0x3a')][_0x1d37('0x49')]){_0x5f151c[_0x1d37('0x43')]=_[_0x1d37('0x48')](_0x5f151c[_0x1d37('0x43')],{'$or':_['map'](_0x5f151c[_0x1d37('0x3d')],function(_0x4a2bae){var _0x420566={};_0x420566[_0x4a2bae]={'$like':'%'+_0xe45932[_0x1d37('0x3a')][_0x1d37('0x49')]+'%'};return _0x420566;})});}_0x5f151c=_['merge']({},_0x5f151c,_0xe45932[_0x1d37('0x52')]);return db[_0x1d37('0x58')]['count']({'where':_0x5f151c['where']})[_0x1d37('0x2e')](function(_0x295eff){_0x40759a[_0x1d37('0x26')]=_0x295eff;if(_0xe45932[_0x1d37('0x3a')][_0x1d37('0x4a')]){_0x5f151c['include']=[{'all':!![]}];}return db[_0x1d37('0x58')][_0x1d37('0x4c')](_0x5f151c);})[_0x1d37('0x2e')](function(_0x16e763){_0x40759a[_0x1d37('0x4d')]=_0x16e763;return _0x40759a;});}})['then'](respondWithFilteredResult(_0x49b514,_0x5f151c))[_0x1d37('0x21')](handleError(_0x49b514,null));};exports[_0x1d37('0x5b')]=function(_0x2a6d11,_0x1ff24a,_0x33fde8){var _0x55d2bd;return db[_0x1d37('0x36')]['find']({'where':{'id':_0x2a6d11['params']['id']}})[_0x1d37('0x2e')](handleEntityNotFound(_0x1ff24a,null))[_0x1d37('0x2e')](function(_0x543891){if(_0x543891){return _0x543891['removeDispositions'](_0x2a6d11[_0x1d37('0x3a')][_0x1d37('0x5c')]);}})[_0x1d37('0x2e')](respondWithStatusCode(_0x1ff24a,null))[_0x1d37('0x21')](handleError(_0x1ff24a,null));};exports[_0x1d37('0x5d')]=function(_0x26dba2,_0x4b7bdf,_0x4b5ae9){if(_0x26dba2['body']['id']){delete _0x26dba2[_0x1d37('0x54')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x26dba2[_0x1d37('0x4f')]['id']}})[_0x1d37('0x2e')](handleEntityNotFound(_0x4b7bdf,null))[_0x1d37('0x2e')](function(_0x34bec9){if(_0x34bec9){_0x26dba2[_0x1d37('0x54')][_0x1d37('0x57')]=_0x34bec9['id'];return db[_0x1d37('0x5e')][_0x1d37('0x5f')](_0x26dba2[_0x1d37('0x54')]);}})[_0x1d37('0x2e')](respondWithResult(_0x4b7bdf,null))['catch'](handleError(_0x4b7bdf,null));};exports[_0x1d37('0x60')]=function(_0xd8f662,_0x194a71,_0x4b404f){var _0x20de8a={'raw':![],'where':{}};var _0x4cf0be={};var _0x1d58fb={'count':0x0,'rows':[]};return db[_0x1d37('0x36')]['findOne']({'where':{'id':_0xd8f662['params']['id']}})[_0x1d37('0x2e')](handleEntityNotFound(_0x194a71,null))[_0x1d37('0x2e')](function(_0x3ef4c8){if(_0x3ef4c8){_0x4cf0be[_0x1d37('0x38')]=_[_0x1d37('0x39')](db[_0x1d37('0x5e')]['rawAttributes']);_0x4cf0be[_0x1d37('0x3a')]=_[_0x1d37('0x39')](_0xd8f662[_0x1d37('0x3a')]);_0x4cf0be[_0x1d37('0x45')]=_['intersection'](_0x4cf0be[_0x1d37('0x38')],_0x4cf0be[_0x1d37('0x3a')]);_0x20de8a['attributes']=_['intersection'](_0x4cf0be[_0x1d37('0x38')],qs['fields'](_0xd8f662[_0x1d37('0x3a')]['fields']));_0x20de8a[_0x1d37('0x3d')]=_0x20de8a[_0x1d37('0x3d')]['length']?_0x20de8a[_0x1d37('0x3d')]:_0x4cf0be[_0x1d37('0x38')];if(!_0xd8f662[_0x1d37('0x3a')][_0x1d37('0x3f')](_0x1d37('0x5a'))){_0x20de8a[_0x1d37('0x40')]=qs[_0x1d37('0x40')](_0xd8f662[_0x1d37('0x3a')][_0x1d37('0x40')]);_0x20de8a[_0x1d37('0x27')]=qs[_0x1d37('0x27')](_0xd8f662[_0x1d37('0x3a')][_0x1d37('0x27')]);}_0x20de8a[_0x1d37('0x41')]=qs[_0x1d37('0x42')](_0xd8f662[_0x1d37('0x3a')][_0x1d37('0x42')]);_0x20de8a[_0x1d37('0x43')]=qs[_0x1d37('0x45')](_[_0x1d37('0x44')](_0xd8f662[_0x1d37('0x3a')],_0x4cf0be[_0x1d37('0x45')]));_0x20de8a['where'][_0x1d37('0x57')]=_0x3ef4c8['id'];if(_0xd8f662[_0x1d37('0x3a')][_0x1d37('0x49')]){_0x20de8a[_0x1d37('0x43')]=_[_0x1d37('0x48')](_0x20de8a[_0x1d37('0x43')],{'$or':_['map'](_0x20de8a[_0x1d37('0x3d')],function(_0x3596cd){var _0x274a5e={};_0x274a5e[_0x3596cd]={'$like':'%'+_0xd8f662[_0x1d37('0x3a')][_0x1d37('0x49')]+'%'};return _0x274a5e;})});}_0x20de8a=_['merge']({},_0x20de8a,_0xd8f662['options']);return db['CannedAnswer']['count']({'where':_0x20de8a['where']})[_0x1d37('0x2e')](function(_0x155c1c){_0x1d58fb[_0x1d37('0x26')]=_0x155c1c;if(_0xd8f662[_0x1d37('0x3a')][_0x1d37('0x4a')]){_0x20de8a['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x1d37('0x4c')](_0x20de8a);})['then'](function(_0x4e57c1){_0x1d58fb['rows']=_0x4e57c1;return _0x1d58fb;});}})[_0x1d37('0x2e')](respondWithFilteredResult(_0x194a71,_0x20de8a))[_0x1d37('0x21')](handleError(_0x194a71,null));};exports[_0x1d37('0x61')]=function(_0x437425,_0x46281d,_0x493358){var _0x4743cf;return db['MailAccount'][_0x1d37('0x53')]({'where':{'id':_0x437425[_0x1d37('0x4f')]['id']}})[_0x1d37('0x2e')](handleEntityNotFound(_0x46281d,null))['then'](function(_0x280e1e){if(_0x280e1e){return _0x280e1e[_0x1d37('0x61')](_0x437425[_0x1d37('0x3a')][_0x1d37('0x5c')]);}})[_0x1d37('0x2e')](respondWithStatusCode(_0x46281d,null))[_0x1d37('0x21')](handleError(_0x46281d,null));};exports['create']=function(_0x27180,_0x485468){var _0x2b8177={'name':_0x27180['body'][_0x1d37('0x30')],'key':_0x27180[_0x1d37('0x54')]['key'],'email':_0x27180[_0x1d37('0x54')]['email'],'ListId':_0x27180[_0x1d37('0x54')]['ListId'],'active':!_[_0x1d37('0x62')](_0x27180[_0x1d37('0x54')][_0x1d37('0x63')])?_0x27180[_0x1d37('0x54')][_0x1d37('0x63')]:!![],'description':_0x27180[_0x1d37('0x54')][_0x1d37('0x64')]||null,'Imap':{},'Smtp':{}};if(_[_0x1d37('0x62')](_0x27180[_0x1d37('0x54')][_0x1d37('0x65')])){if(_0x27180[_0x1d37('0x54')][_0x1d37('0x66')]){_0x2b8177['Imap'][_0x1d37('0x67')]=_0x2b8177[_0x1d37('0x35')][_0x1d37('0x67')]=_0x27180[_0x1d37('0x54')][_0x1d37('0x68')];_0x2b8177[_0x1d37('0x33')][_0x1d37('0x69')]=_0x2b8177['Smtp']['pass']=_0x27180[_0x1d37('0x54')]['cpassword'];}else{_0x2b8177[_0x1d37('0x33')][_0x1d37('0x6a')]=_0x2b8177[_0x1d37('0x35')][_0x1d37('0x6a')]=![];}_0x2b8177['Imap'][_0x1d37('0x6b')]=_0x27180[_0x1d37('0x54')][_0x1d37('0x33')][_0x1d37('0x6b')];_0x2b8177[_0x1d37('0x33')][_0x1d37('0x6c')]=_0x27180['body']['Imap'][_0x1d37('0x6c')];_0x2b8177[_0x1d37('0x35')][_0x1d37('0x6b')]=_0x27180['body'][_0x1d37('0x35')][_0x1d37('0x6b')];_0x2b8177[_0x1d37('0x35')]['port']=_0x27180[_0x1d37('0x54')][_0x1d37('0x35')][_0x1d37('0x6c')];}else{_0x2b8177[_0x1d37('0x33')]['service']=_0x2b8177['Smtp'][_0x1d37('0x6d')]=_0x27180[_0x1d37('0x54')][_0x1d37('0x65')];_0x2b8177[_0x1d37('0x33')][_0x1d37('0x67')]=_0x2b8177[_0x1d37('0x35')][_0x1d37('0x67')]=_0x27180[_0x1d37('0x54')][_0x1d37('0x68')];_0x2b8177[_0x1d37('0x33')][_0x1d37('0x69')]=_0x2b8177[_0x1d37('0x35')][_0x1d37('0x6e')]=_0x27180[_0x1d37('0x54')][_0x1d37('0x6f')];}return db[_0x1d37('0x36')][_0x1d37('0x5f')](_0x2b8177,{'include':[{'model':db[_0x1d37('0x34')],'as':_0x1d37('0x35')},{'model':db[_0x1d37('0x32')],'as':_0x1d37('0x33')}]})[_0x1d37('0x2e')](respondWithResult(_0x485468,0xc9))[_0x1d37('0x21')](handleError(_0x485468,null));};exports[_0x1d37('0x70')]=function(_0xa8856a,_0x2cdef5,_0x4595b8){return db[_0x1d37('0x36')][_0x1d37('0x59')]({'where':{'id':_0xa8856a[_0x1d37('0x4f')]['id']}})[_0x1d37('0x2e')](handleEntityNotFound(_0x2cdef5,null))[_0x1d37('0x2e')](function(_0x58f1d1){if(_0x58f1d1){return _0x58f1d1[_0x1d37('0x70')]();}return null;})[_0x1d37('0x2e')](respondWithResult(_0x2cdef5,null))['catch'](handleError(_0x2cdef5,null));};exports[_0x1d37('0x71')]=function(_0x1db69a,_0x554a7b,_0x3d8292){if(_0x1db69a[_0x1d37('0x54')]['id']){delete _0x1db69a[_0x1d37('0x54')]['id'];}return db[_0x1d37('0x36')][_0x1d37('0x53')]({'where':{'id':_0x1db69a[_0x1d37('0x4f')]['id']}})[_0x1d37('0x2e')](handleEntityNotFound(_0x554a7b,null))[_0x1d37('0x2e')](function(_0xce3fd9){if(_0xce3fd9){_0x1db69a[_0x1d37('0x54')][_0x1d37('0x57')]=_0xce3fd9['id'];return db[_0x1d37('0x32')][_0x1d37('0x5f')](_0x1db69a[_0x1d37('0x54')]);}})['then'](respondWithResult(_0x554a7b,null))[_0x1d37('0x21')](handleError(_0x554a7b,null));};exports[_0x1d37('0x72')]=function(_0x39414b,_0x131194,_0x45408e){return db[_0x1d37('0x36')][_0x1d37('0x59')]({'where':{'id':_0x39414b[_0x1d37('0x4f')]['id']}})['then'](handleEntityNotFound(_0x131194,null))[_0x1d37('0x2e')](function(_0x4640c9){if(_0x4640c9){return _0x4640c9[_0x1d37('0x73')](null);}return null;})['then'](respondWithStatusCode(_0x131194,null))[_0x1d37('0x21')](handleError(_0x131194,null));};exports[_0x1d37('0x74')]=function(_0x249a6f,_0x511ded,_0x31aa84){return db[_0x1d37('0x36')]['findOne']({'where':{'id':_0x249a6f['params']['id']}})[_0x1d37('0x2e')](handleEntityNotFound(_0x511ded,null))[_0x1d37('0x2e')](function(_0x4a7dd5){if(_0x4a7dd5){return _0x4a7dd5[_0x1d37('0x74')]();}return null;})[_0x1d37('0x2e')](respondWithResult(_0x511ded,null))[_0x1d37('0x21')](handleError(_0x511ded,null));};exports[_0x1d37('0x75')]=function(_0x35f19c,_0x5d9f86,_0x289a7a){if(_0x35f19c[_0x1d37('0x54')]['id']){delete _0x35f19c[_0x1d37('0x54')]['id'];}return db[_0x1d37('0x36')][_0x1d37('0x53')]({'where':{'id':_0x35f19c[_0x1d37('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5d9f86,null))['then'](function(_0x33c171){if(_0x33c171){_0x35f19c[_0x1d37('0x54')][_0x1d37('0x57')]=_0x33c171['id'];return db[_0x1d37('0x34')][_0x1d37('0x5f')](_0x35f19c[_0x1d37('0x54')]);}})['then'](respondWithResult(_0x5d9f86,null))[_0x1d37('0x21')](handleError(_0x5d9f86,null));};exports[_0x1d37('0x76')]=function(_0x28e9b3,_0x555f78,_0x2d4cbc){return db[_0x1d37('0x36')][_0x1d37('0x59')]({'where':{'id':_0x28e9b3[_0x1d37('0x4f')]['id']}})[_0x1d37('0x2e')](handleEntityNotFound(_0x555f78,null))[_0x1d37('0x2e')](function(_0x49e20f){if(_0x49e20f){return _0x49e20f[_0x1d37('0x77')](null);}return null;})[_0x1d37('0x2e')](respondWithStatusCode(_0x555f78,null))[_0x1d37('0x21')](handleError(_0x555f78,null));};exports[_0x1d37('0x78')]=function(_0x41692c,_0x449fe6,_0x114d06){return db[_0x1d37('0x79')][_0x1d37('0x53')]({'where':{'id':_0x41692c[_0x1d37('0x4f')]['id']}})[_0x1d37('0x2e')](handleEntityNotFound(_0x449fe6,null))[_0x1d37('0x2e')](function(_0x208cbb){if(_0x208cbb){return _0x208cbb[_0x1d37('0x78')](_0x41692c['body'][_0x1d37('0x5c')],_[_0x1d37('0x7a')](_0x41692c[_0x1d37('0x54')],['ids','id'])||{});}})['then'](respondWithResult(_0x449fe6,null))[_0x1d37('0x21')](handleError(_0x449fe6,null));};exports['getInteractions']=function(_0x2f0a44,_0x7afb1c,_0x180e3b){var _0x52122d={'raw':![],'where':{}};var _0x4bfd18={};var _0x3a9216={'count':0x0,'rows':[]};return db[_0x1d37('0x36')][_0x1d37('0x59')]({'where':{'id':_0x2f0a44[_0x1d37('0x4f')]['id']}})['then'](handleEntityNotFound(_0x7afb1c,null))[_0x1d37('0x2e')](function(_0x4ca7c3){if(_0x4ca7c3){_0x4bfd18[_0x1d37('0x38')]=_[_0x1d37('0x39')](db[_0x1d37('0x79')]['rawAttributes']);_0x4bfd18['query']=_['keys'](_0x2f0a44['query']);_0x4bfd18['filters']=_['intersection'](_0x4bfd18[_0x1d37('0x38')],_0x4bfd18[_0x1d37('0x3a')]);_0x52122d[_0x1d37('0x3d')]=_[_0x1d37('0x50')](_0x4bfd18['model'],qs[_0x1d37('0x3e')](_0x2f0a44[_0x1d37('0x3a')][_0x1d37('0x3e')]));_0x52122d[_0x1d37('0x3d')]=_0x52122d[_0x1d37('0x3d')]['length']?_0x52122d[_0x1d37('0x3d')]:_0x4bfd18[_0x1d37('0x38')];if(!_0x2f0a44['query']['hasOwnProperty'](_0x1d37('0x5a'))){_0x52122d['limit']=qs[_0x1d37('0x40')](_0x2f0a44[_0x1d37('0x3a')][_0x1d37('0x40')]);_0x52122d[_0x1d37('0x27')]=qs[_0x1d37('0x27')](_0x2f0a44[_0x1d37('0x3a')][_0x1d37('0x27')]);}_0x52122d['order']=qs['sort'](_0x2f0a44[_0x1d37('0x3a')]['sort']);_0x52122d[_0x1d37('0x43')]=qs['filters'](_[_0x1d37('0x44')](_0x2f0a44[_0x1d37('0x3a')],_0x4bfd18[_0x1d37('0x45')]));_0x52122d[_0x1d37('0x43')][_0x1d37('0x57')]=_0x4ca7c3['id'];if(_0x2f0a44[_0x1d37('0x3a')][_0x1d37('0x49')]){_0x52122d[_0x1d37('0x43')]=_[_0x1d37('0x48')](_0x52122d[_0x1d37('0x43')],{'$or':_[_0x1d37('0x7b')](_0x52122d[_0x1d37('0x3d')],function(_0x20431c){var _0x51593e={};_0x51593e[_0x20431c]={'$like':'%'+_0x2f0a44[_0x1d37('0x3a')][_0x1d37('0x49')]+'%'};return _0x51593e;})});}_0x52122d=_[_0x1d37('0x48')]({},_0x52122d,_0x2f0a44['options']);return db['MailInteraction'][_0x1d37('0x26')]({'where':_0x52122d['where']})[_0x1d37('0x2e')](function(_0x2236ab){_0x3a9216[_0x1d37('0x26')]=_0x2236ab;if(_0x2f0a44[_0x1d37('0x3a')][_0x1d37('0x4a')]){_0x52122d[_0x1d37('0x4b')]=[{'model':db['CmContact'],'as':_0x1d37('0x7c'),'required':![]},{'model':db['User'],'as':_0x1d37('0x7d'),'attributes':[_0x1d37('0x30'),_0x1d37('0x7e'),_0x1d37('0x7f')],'required':![]},{'model':db['Tag'],'as':_0x1d37('0x80'),'attributes':['id',_0x1d37('0x30'),'color'],'where':_0x2f0a44[_0x1d37('0x3a')][_0x1d37('0x81')]?{'id':_0x2f0a44[_0x1d37('0x3a')][_0x1d37('0x81')]}:undefined,'required':_0x2f0a44[_0x1d37('0x3a')][_0x1d37('0x81')]?!![]:![]}];}return db['MailInteraction'][_0x1d37('0x4c')](_0x52122d);})[_0x1d37('0x2e')](function(_0x383702){_0x3a9216[_0x1d37('0x4d')]=_0x383702;return _0x3a9216;});}})[_0x1d37('0x2e')](respondWithFilteredResult(_0x7afb1c,_0x52122d))[_0x1d37('0x21')](handleError(_0x7afb1c,null));};exports[_0x1d37('0x82')]=function(_0xbb4db2,_0x4adef3,_0x1ab140){return db[_0x1d37('0x36')][_0x1d37('0x59')]({'where':{'id':_0xbb4db2[_0x1d37('0x4f')]['id']}})[_0x1d37('0x2e')](handleEntityNotFound(_0x4adef3,null))[_0x1d37('0x2e')](function(_0x6f21df){if(_0x6f21df){return db[_0x1d37('0x83')][_0x1d37('0x84')](function(_0x3c61bc){return db[_0x1d37('0x85')][_0x1d37('0x86')]({'where':{'MailAccountId':_0xbb4db2[_0x1d37('0x4f')]['id']},'transaction':_0x3c61bc})['then'](function(_0x2a49cd){var _0x9f3d7=_[_0x1d37('0x7b')](_0xbb4db2[_0x1d37('0x54')],function(_0x35afd8){_0x35afd8[_0x1d37('0x57')]=_0xbb4db2[_0x1d37('0x4f')]['id'];return _0x35afd8;});return db[_0x1d37('0x85')][_0x1d37('0x87')](_0x9f3d7,{'transaction':_0x3c61bc});});})['then'](function(){return db[_0x1d37('0x85')][_0x1d37('0x88')]({'where':{'MailAccountId':_0xbb4db2[_0x1d37('0x4f')]['id']},'order':_0x1d37('0x89')});});}})[_0x1d37('0x2e')](respondWithResult(_0x4adef3,null))[_0x1d37('0x21')](handleError(_0x4adef3,null));};exports[_0x1d37('0x8a')]=function(_0x5e923f,_0x35a6e8,_0x38a6e0){var _0x19b6b8={};var _0x1eed69={};var _0x2b4bd2;var _0x387196;return db[_0x1d37('0x36')]['findOne']({'where':{'id':_0x5e923f['params']['id']}})[_0x1d37('0x2e')](handleEntityNotFound(_0x35a6e8,null))[_0x1d37('0x2e')](function(_0x30ec7b){if(_0x30ec7b){_0x2b4bd2=_0x30ec7b;_0x1eed69[_0x1d37('0x38')]=_['keys'](db[_0x1d37('0x85')][_0x1d37('0x37')]);_0x1eed69[_0x1d37('0x3a')]=_['keys'](_0x5e923f[_0x1d37('0x3a')]);_0x1eed69[_0x1d37('0x45')]=_[_0x1d37('0x50')](_0x1eed69[_0x1d37('0x38')],_0x1eed69[_0x1d37('0x3a')]);_0x19b6b8[_0x1d37('0x3d')]=_[_0x1d37('0x50')](_0x1eed69[_0x1d37('0x38')],qs[_0x1d37('0x3e')](_0x5e923f[_0x1d37('0x3a')][_0x1d37('0x3e')]));_0x19b6b8['attributes']=_0x19b6b8[_0x1d37('0x3d')][_0x1d37('0x51')]?_0x19b6b8['attributes']:_0x1eed69[_0x1d37('0x38')];_0x19b6b8['order']=qs['sort'](_0x5e923f[_0x1d37('0x3a')][_0x1d37('0x42')]);_0x19b6b8[_0x1d37('0x43')]=qs[_0x1d37('0x45')](_[_0x1d37('0x44')](_0x5e923f[_0x1d37('0x3a')],_0x1eed69[_0x1d37('0x45')]));if(_0x5e923f[_0x1d37('0x3a')][_0x1d37('0x49')]){_0x19b6b8[_0x1d37('0x43')]=_[_0x1d37('0x48')](_0x19b6b8['where'],{'$or':_[_0x1d37('0x7b')](_0x19b6b8['attributes'],function(_0x5c004b){var _0x7093c6={};_0x7093c6[_0x5c004b]={'$like':'%'+_0x5e923f['query'][_0x1d37('0x49')]+'%'};return _0x7093c6;})});}_0x19b6b8=_[_0x1d37('0x48')]({},_0x19b6b8,_0x5e923f['options']);return _0x2b4bd2[_0x1d37('0x8a')](_0x19b6b8);}})[_0x1d37('0x2e')](function(_0x59368e){if(_0x59368e){_0x387196=_0x59368e[_0x1d37('0x51')];if(!_0x5e923f[_0x1d37('0x3a')]['hasOwnProperty'](_0x1d37('0x5a'))){_0x19b6b8['limit']=qs['limit'](_0x5e923f[_0x1d37('0x3a')]['limit']);_0x19b6b8[_0x1d37('0x27')]=qs[_0x1d37('0x27')](_0x5e923f['query'][_0x1d37('0x27')]);}return _0x2b4bd2['getApplications'](_0x19b6b8);}})[_0x1d37('0x2e')](function(_0x474848){if(_0x474848){return _0x474848?{'count':_0x387196,'rows':_0x474848}:null;}})[_0x1d37('0x2e')](respondWithResult(_0x35a6e8,null))[_0x1d37('0x21')](handleError(_0x35a6e8,null));};exports[_0x1d37('0x8b')]=function(_0x3d8b28,_0x361971,_0x12e800){var _0x1949fe={'raw':!![],'where':{}};var _0x150b9e={};var _0x1e93e5={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x3d8b28[_0x1d37('0x4f')]['id']}})['then'](handleEntityNotFound(_0x361971,null))['then'](function(_0x27af1c){if(_0x27af1c){_0x150b9e[_0x1d37('0x38')]=_[_0x1d37('0x39')](db[_0x1d37('0x8c')]['rawAttributes']);_0x150b9e[_0x1d37('0x3a')]=_[_0x1d37('0x39')](_0x3d8b28[_0x1d37('0x3a')]);_0x150b9e[_0x1d37('0x45')]=_[_0x1d37('0x50')](_0x150b9e[_0x1d37('0x38')],_0x150b9e[_0x1d37('0x3a')]);_0x1949fe[_0x1d37('0x3d')]=_[_0x1d37('0x50')](_0x150b9e[_0x1d37('0x38')],qs[_0x1d37('0x3e')](_0x3d8b28[_0x1d37('0x3a')][_0x1d37('0x3e')]));_0x1949fe['attributes']=_0x1949fe[_0x1d37('0x3d')][_0x1d37('0x51')]?_0x1949fe[_0x1d37('0x3d')]:_0x150b9e[_0x1d37('0x38')];if(!_0x3d8b28[_0x1d37('0x3a')][_0x1d37('0x3f')](_0x1d37('0x5a'))){_0x1949fe[_0x1d37('0x40')]=qs[_0x1d37('0x40')](_0x3d8b28['query']['limit']);_0x1949fe['offset']=qs[_0x1d37('0x27')](_0x3d8b28[_0x1d37('0x3a')][_0x1d37('0x27')]);}_0x1949fe['order']=qs[_0x1d37('0x42')](_0x3d8b28[_0x1d37('0x3a')][_0x1d37('0x42')]);_0x1949fe[_0x1d37('0x43')]=qs[_0x1d37('0x45')](_[_0x1d37('0x44')](_0x3d8b28['query'],_0x150b9e[_0x1d37('0x45')]));_0x1949fe[_0x1d37('0x43')][_0x1d37('0x57')]=_0x27af1c['id'];if(_0x3d8b28[_0x1d37('0x3a')]['filter']){_0x1949fe['where']=_[_0x1d37('0x48')](_0x1949fe['where'],{'$or':_[_0x1d37('0x7b')](_0x1949fe[_0x1d37('0x3d')],function(_0xfefa0){var _0x5aa808={};_0x5aa808[_0xfefa0]={'$like':'%'+_0x3d8b28[_0x1d37('0x3a')][_0x1d37('0x49')]+'%'};return _0x5aa808;})});}if(_0x3d8b28[_0x1d37('0x3a')]['$gte']){var _0x3180fe=_0x3d8b28[_0x1d37('0x3a')][_0x1d37('0x8d')][_0x1d37('0x8e')](',');var _0x20b6f4={};_0x20b6f4[_0x3180fe[0x0]]={'$gte':moment(_0x3180fe[0x1])[_0x1d37('0x8f')](_0x1d37('0x90'))};_0x1949fe['where']=_[_0x1d37('0x48')](_0x1949fe[_0x1d37('0x43')],_0x20b6f4);}_0x1949fe=_[_0x1d37('0x48')]({},_0x1949fe,_0x3d8b28[_0x1d37('0x52')]);return db[_0x1d37('0x8c')][_0x1d37('0x26')]({'where':_0x1949fe['where']})[_0x1d37('0x2e')](function(_0x2b67b3){_0x1e93e5[_0x1d37('0x26')]=_0x2b67b3;if(_0x3d8b28['query'][_0x1d37('0x4a')]){_0x1949fe[_0x1d37('0x4b')]=[{'all':!![]}];}return db[_0x1d37('0x8c')][_0x1d37('0x4c')](_0x1949fe);})[_0x1d37('0x2e')](function(_0x356548){_0x1e93e5[_0x1d37('0x4d')]=_0x356548;return _0x1e93e5;});}})[_0x1d37('0x2e')](respondWithFilteredResult(_0x361971,_0x1949fe))[_0x1d37('0x21')](handleError(_0x361971,null));};exports[_0x1d37('0x91')]=function(_0x4312e6,_0x4a4a50,_0x20192c){var _0x5980d2,_0x5d18f9={},_0x101333;if(_0x4312e6[_0x1d37('0x54')]['to']){_0x101333=_0x4312e6['body']['to'][_0x1d37('0x8e')](',')[0x0];}return db[_0x1d37('0x36')][_0x1d37('0x53')]({'where':{'id':_0x4312e6[_0x1d37('0x4f')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x1d37('0x92')],'as':_0x1d37('0x93'),'where':{'email':_0x101333},'limit':0x1,'order':[['updatedAt',_0x1d37('0x94')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0x1d37('0x2e')](handleEntityNotFound(_0x4a4a50,null))[_0x1d37('0x2e')](function(_0x192808){if(_0x192808){_0x5980d2=_0x192808;if(_0x192808['Smtp']){if(_[_0x1d37('0x62')](_0x4312e6[_0x1d37('0x54')]['from'])){_0x4312e6[_0x1d37('0x54')][_0x1d37('0x95')]=util[_0x1d37('0x8f')](_0x1d37('0x96'),_0x192808[_0x1d37('0x30')],_0x192808[_0x1d37('0x97')]||_0x192808[_0x1d37('0x35')][_0x1d37('0x67')]);}if(_0x4312e6['body'][_0x1d37('0x98')]&&_0x4312e6[_0x1d37('0x54')][_0x1d37('0x98')][_0x1d37('0x51')]){for(var _0xdd5a08=0x0;_0xdd5a08<_0x4312e6[_0x1d37('0x54')][_0x1d37('0x98')]['length'];_0xdd5a08+=0x1){_0x4312e6['body'][_0x1d37('0x98')][_0xdd5a08]={'filename':_0x4312e6['body'][_0x1d37('0x98')][_0xdd5a08][_0x1d37('0x30')],'path':path['join'](config[_0x1d37('0x99')],_0x1d37('0x9a'),_0x4312e6['body']['attachments'][_0xdd5a08][_0x1d37('0x9b')])};}}var _0x35e0d5={'tls':{'rejectUnauthorized':![]}};if(_[_0x1d37('0x62')](_0x192808[_0x1d37('0x35')][_0x1d37('0x6d')])){if(_0x192808[_0x1d37('0x35')][_0x1d37('0x6a')]){_0x35e0d5['auth']={'user':_0x192808[_0x1d37('0x35')][_0x1d37('0x67')],'pass':_0x192808[_0x1d37('0x35')][_0x1d37('0x6e')]};}_0x35e0d5[_0x1d37('0x6b')]=_0x192808[_0x1d37('0x35')]['host'];_0x35e0d5[_0x1d37('0x6c')]=_0x192808[_0x1d37('0x35')]['port'];_0x35e0d5['secure']=_0x192808['Smtp'][_0x1d37('0x9c')];}else{_0x35e0d5[_0x1d37('0x6d')]=_0x192808['Smtp'][_0x1d37('0x6d')];_0x35e0d5[_0x1d37('0x9d')]={'user':_0x192808[_0x1d37('0x35')][_0x1d37('0x67')],'pass':_0x192808[_0x1d37('0x35')][_0x1d37('0x6e')]};}return respondWithRpcPromise(_0x1d37('0x9e'),_0x1d37('0x9f'),{'account':_0x35e0d5,'message':_0x4312e6[_0x1d37('0x54')]});}else{throw new Error('List\x20not\x20found');}}})[_0x1d37('0x2e')](function(_0x244e37){if(_0x244e37){_0x5d18f9=_0x244e37;if(_0x5980d2[_0x1d37('0xa0')]){if(_0x5980d2['List'][_0x1d37('0x93')][_0x1d37('0x51')]){return _0x5980d2[_0x1d37('0xa0')][_0x1d37('0x93')][0x0];}else{return db['CmContact'][_0x1d37('0x5f')](_[_0x1d37('0xa1')](_0x4312e6[_0x1d37('0x54')],{'firstName':_0x4312e6[_0x1d37('0x54')]['to'],'email':_0x4312e6['body']['to'],'phone':_0x4312e6[_0x1d37('0x54')]['to'],'ListId':_0x5980d2[_0x1d37('0xa2')]}));}}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x64dd00){if(_0x64dd00){var _0x50673a={'UserId':_0x4312e6[_0x1d37('0x67')]['id'],'ContactId':_0x64dd00['id'],'MailAccountId':_0x5980d2['id'],'inReplyTo':_0x5d18f9['messageId'],'to':_0x4312e6['body']['from'],'cc':_0x4312e6['body']['cc'],'subject':_0x4312e6['body'][_0x1d37('0xa3')],'attach':_0x4312e6['body'][_0x1d37('0xa4')],'firstMsgDirection':_0x1d37('0xa5'),'lastMsgAt':moment()[_0x1d37('0x8f')](_0x1d37('0x90')),'lastMsgDirection':_0x1d37('0xa5'),'lastMsgBody':_0x4312e6[_0x1d37('0x54')][_0x1d37('0x54')],'Messages':[_[_0x1d37('0x48')](_0x4312e6[_0x1d37('0x54')],{'messageId':_0x5d18f9[_0x1d37('0xa6')],'sentAt':moment()[_0x1d37('0x8f')](_0x1d37('0x90')),'read':!![],'MailAccountId':_0x5980d2['id'],'UserId':_0x4312e6['user']['id'],'ContactId':_0x64dd00['id']})]};if(_0x4312e6[_0x1d37('0x54')]['Interaction']){_0x50673a=_[_0x1d37('0x48')](_0x50673a,_0x4312e6[_0x1d37('0x54')]['Interaction']);}return db[_0x1d37('0x79')]['create'](_0x50673a,{'include':[{'model':db[_0x1d37('0x8c')],'as':_0x1d37('0xa7')}]});}})[_0x1d37('0x2e')](respondWithResult(_0x4a4a50,null))[_0x1d37('0x21')](handleError(_0x4a4a50,null));};exports[_0x1d37('0xa8')]=function(_0x56ba56,_0xdc22ad,_0x228b4f){return db[_0x1d37('0x36')][_0x1d37('0x53')]({'where':{'id':_0x56ba56[_0x1d37('0x4f')]['id']},'include':[{'model':db[_0x1d37('0x34')],'as':'Smtp','raw':!![]}]})[_0x1d37('0x2e')](handleEntityNotFound(_0xdc22ad,null))[_0x1d37('0x2e')](function(_0x291fbc){if(_0x291fbc&&_0x291fbc[_0x1d37('0x35')]){var _0x986374={'id':_0x291fbc['id'],'tls':{'rejectUnauthorized':![]}};if(_0x291fbc[_0x1d37('0x35')][_0x1d37('0x6d')]){_0x986374[_0x1d37('0x6d')]=_0x291fbc[_0x1d37('0x35')][_0x1d37('0x6d')];}else{_0x986374[_0x1d37('0x6b')]=_0x291fbc['Smtp'][_0x1d37('0x6b')];_0x986374[_0x1d37('0x6c')]=_0x291fbc['Smtp'][_0x1d37('0x6c')];_0x986374[_0x1d37('0x9c')]=_0x291fbc['Smtp'][_0x1d37('0x9c')];}if(_0x291fbc['Smtp'][_0x1d37('0x6a')]){_0x986374[_0x1d37('0x9d')]={'user':_0x291fbc['Smtp'][_0x1d37('0x67')],'pass':_0x291fbc[_0x1d37('0x35')]['pass']};}return respondWithRpcPromise('VerifySmtp',_0x1d37('0xa8'),{'account':_0x986374});}})[_0x1d37('0x2e')](respondWithResult(_0xdc22ad,null))[_0x1d37('0x21')](handleError(_0xdc22ad,null));};exports[_0x1d37('0x86')]=function(_0x33a3f,_0xb5ec61){return db[_0x1d37('0x36')]['find']({'where':{'id':_0x33a3f['params']['id']}})[_0x1d37('0x2e')](handleEntityNotFound(_0xb5ec61,null))[_0x1d37('0x2e')](function(_0x5a685f){if(_0x5a685f&&_0x5a685f[_0x1d37('0x6d')]){throw new db[(_0x1d37('0xa9'))][(_0x1d37('0xaa'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x5a685f;})[_0x1d37('0x2e')](removeEntity(_0xb5ec61,null))[_0x1d37('0x21')](handleError(_0xb5ec61,null));};exports[_0x1d37('0xab')]=function(_0x4c6ff9,_0x275d11,_0x296b11){return db[_0x1d37('0x36')][_0x1d37('0x53')]({'where':{'id':_0x4c6ff9[_0x1d37('0x4f')]['id']}})[_0x1d37('0x2e')](handleEntityNotFound(_0x275d11,null))[_0x1d37('0x2e')](function(_0x4b5d16){if(_0x4b5d16){return _0x4b5d16[_0x1d37('0xab')](_0x4c6ff9[_0x1d37('0x54')][_0x1d37('0x5c')],_[_0x1d37('0x7a')](_0x4c6ff9['body'],['ids','id'])||{})[_0x1d37('0xac')](function(_0x1a2423){for(var _0x22b27c=0x0;_0x22b27c<_0x4c6ff9['body'][_0x1d37('0x5c')][_0x1d37('0x51')];_0x22b27c+=0x1){socket[_0x1d37('0xad')](_0x1d37('0xae'),{'UserId':_0x4c6ff9[_0x1d37('0x54')][_0x1d37('0x5c')][_0x22b27c],'MailAccountId':_0x4c6ff9[_0x1d37('0x4f')]['id']});}return _0x1a2423;});}})[_0x1d37('0x2e')](respondWithResult(_0x275d11,null))['catch'](handleError(_0x275d11,null));};exports[_0x1d37('0xaf')]=function(_0x47f51d,_0x3f0f75,_0x4a2e7){var _0x369457;return db[_0x1d37('0x36')][_0x1d37('0x53')]({'where':{'id':_0x47f51d[_0x1d37('0x4f')]['id']}})[_0x1d37('0x2e')](handleEntityNotFound(_0x3f0f75,null))[_0x1d37('0x2e')](function(_0x5d5c26){if(_0x5d5c26){return _0x5d5c26[_0x1d37('0xaf')](_0x47f51d['query'][_0x1d37('0x5c')])['then'](function(_0x2e9d6c){if(_['isArray'](_0x47f51d[_0x1d37('0x3a')]['ids'])){for(var _0x565307=0x0;_0x565307<_0x47f51d['query'][_0x1d37('0x5c')][_0x1d37('0x51')];_0x565307+=0x1){socket[_0x1d37('0xad')](_0x1d37('0xb0'),{'UserId':_0x47f51d['query'][_0x1d37('0x5c')][_0x565307],'MailAccountId':_0x47f51d['params']['id']});}}else{socket[_0x1d37('0xad')](_0x1d37('0xb0'),{'UserId':_0x47f51d['query'][_0x1d37('0x5c')],'MailAccountId':_0x47f51d[_0x1d37('0x4f')]['id']});}});}})['then'](respondWithStatusCode(_0x3f0f75,null))[_0x1d37('0x21')](handleError(_0x3f0f75,null));};exports[_0x1d37('0xb1')]=function(_0x2dc82f,_0x2b5386,_0x114e59){var _0x1f2899={};var _0x19764f={};var _0x460d6b;var _0x352df8;return db['MailAccount'][_0x1d37('0x59')]({'where':{'id':_0x2dc82f[_0x1d37('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2b5386,null))[_0x1d37('0x2e')](function(_0x58f85b){if(_0x58f85b){_0x460d6b=_0x58f85b;_0x19764f[_0x1d37('0x38')]=_[_0x1d37('0x39')](db[_0x1d37('0xb2')]['rawAttributes']);_0x19764f[_0x1d37('0x3a')]=_[_0x1d37('0x39')](_0x2dc82f['query']);_0x19764f['filters']=_[_0x1d37('0x50')](_0x19764f['model'],_0x19764f[_0x1d37('0x3a')]);_0x1f2899['attributes']=_[_0x1d37('0x50')](_0x19764f['model'],qs[_0x1d37('0x3e')](_0x2dc82f['query']['fields']));_0x1f2899[_0x1d37('0x3d')]=_0x1f2899[_0x1d37('0x3d')][_0x1d37('0x51')]?_0x1f2899[_0x1d37('0x3d')]:_0x19764f['model'];_0x1f2899[_0x1d37('0x41')]=qs['sort'](_0x2dc82f['query']['sort']);_0x1f2899['where']=qs[_0x1d37('0x45')](_[_0x1d37('0x44')](_0x2dc82f[_0x1d37('0x3a')],_0x19764f[_0x1d37('0x45')]));if(_0x2dc82f[_0x1d37('0x3a')][_0x1d37('0x49')]){_0x1f2899[_0x1d37('0x43')]=_[_0x1d37('0x48')](_0x1f2899['where'],{'$or':_['map'](_0x1f2899[_0x1d37('0x3d')],function(_0x56c49d){var _0x4d4633={};_0x4d4633[_0x56c49d]={'$like':'%'+_0x2dc82f[_0x1d37('0x3a')][_0x1d37('0x49')]+'%'};return _0x4d4633;})});}_0x1f2899=_[_0x1d37('0x48')]({},_0x1f2899,_0x2dc82f['options']);return _0x460d6b[_0x1d37('0xb1')](_0x1f2899);}})[_0x1d37('0x2e')](function(_0x57f2b3){if(_0x57f2b3){_0x352df8=_0x57f2b3[_0x1d37('0x51')];if(!_0x2dc82f[_0x1d37('0x3a')][_0x1d37('0x3f')](_0x1d37('0x5a'))){_0x1f2899['limit']=qs['limit'](_0x2dc82f['query'][_0x1d37('0x40')]);_0x1f2899['offset']=qs[_0x1d37('0x27')](_0x2dc82f[_0x1d37('0x3a')][_0x1d37('0x27')]);}return _0x460d6b[_0x1d37('0xb1')](_0x1f2899);}})[_0x1d37('0x2e')](function(_0x43cd8c){if(_0x43cd8c){return _0x43cd8c?{'count':_0x352df8,'rows':_0x43cd8c}:null;}})[_0x1d37('0x2e')](respondWithResult(_0x2b5386,null))[_0x1d37('0x21')](handleError(_0x2b5386,null));};
\ No newline at end of file
+var _0x53eb=['format','CmList','List','Contacts','updatedAt','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','CmContact','defaults','ListId','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','isArray','emit','getAgents','User','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','limit','reject','update','end','stack','name','send','index','MailServerIn','Imap','Smtp','MailAccount','model','keys','query','dateStart','dateEnd','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick','filters','add','merge','filter','map','options','count','include','rows','params','MailServerOut','rawAttributes','includeAll','find','body','describe','addDisposition','MailAccountId','Disposition','create','findOne','hasOwnProperty','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','key','isNil','active','cservice','cauthentication','user','password','pass','cpassword','authentication','host','port','service','cuser','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','getInteractions','Owner','fullname','internal','Tags','color','tag','sequelize','MailApplication','destroy','priority','getApplications','getMessages','MailMessage','$gte','split'];(function(_0x5c7505,_0x279084){var _0x4b1117=function(_0x22595d){while(--_0x22595d){_0x5c7505['push'](_0x5c7505['shift']());}};_0x4b1117(++_0x279084);}(_0x53eb,0x186));var _0xb53e=function(_0x51aef4,_0x14248d){_0x51aef4=_0x51aef4-0x0;var _0x50dd8b=_0x53eb[_0x51aef4];return _0x50dd8b;};'use strict';var pdf=require(_0xb53e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb53e('0x1'));var jsonpatch=require(_0xb53e('0x2'));var rp=require(_0xb53e('0x3'));var moment=require(_0xb53e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb53e('0x5'));var util=require('util');var path=require(_0xb53e('0x6'));var sox=require(_0xb53e('0x7'));var csv=require('to-csv');var ejs=require(_0xb53e('0x8'));var fs=require('fs');var _=require(_0xb53e('0x9'));var squel=require(_0xb53e('0xa'));var crypto=require(_0xb53e('0xb'));var jsforce=require(_0xb53e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb53e('0xd'));var querystring=require(_0xb53e('0xe'));var Papa=require(_0xb53e('0xf'));var qs=require(_0xb53e('0x10'));var logger=require(_0xb53e('0x11'))('api');var utils=require(_0xb53e('0x12'));var config=require(_0xb53e('0x13'));var db=require(_0xb53e('0x14'))['db'];var socket=require(_0xb53e('0x15'))({'host':'localhost','port':0x18eb});require(_0xb53e('0x16'))[_0xb53e('0x17')](socket);var jayson=require(_0xb53e('0x18'));var client=jayson[_0xb53e('0x19')][_0xb53e('0x1a')]({'port':0x232b});function respondWithRpcPromise(_0x5b5160,_0x1f5580,_0x114b07,_0x3b6f43){return new BPromise(function(_0x35fb77,_0x193a52){var _0x1d0fe3=_0x3b6f43||client;return _0x1d0fe3[_0xb53e('0x1b')](_0x5b5160,_0x114b07)[_0xb53e('0x1c')](function(_0x22be38){logger[_0xb53e('0x1d')]('MailAccount,\x20%s,\x20%s',_0x1f5580,'request\x20sent');logger['debug'](_0xb53e('0x1e'),_0x1f5580,_0xb53e('0x1f'),JSON[_0xb53e('0x20')](_0x22be38));if(_0x22be38[_0xb53e('0x21')]){if(_0x22be38[_0xb53e('0x21')][_0xb53e('0x22')]===0x1f4){logger[_0xb53e('0x21')](_0xb53e('0x23'),_0x1f5580,_0x22be38[_0xb53e('0x21')][_0xb53e('0x24')]);return _0x193a52(_0x22be38[_0xb53e('0x21')]['message']);}logger['error'](_0xb53e('0x23'),_0x1f5580,_0x22be38[_0xb53e('0x21')][_0xb53e('0x24')]);return _0x35fb77(_0x22be38[_0xb53e('0x21')][_0xb53e('0x24')]);}else{logger[_0xb53e('0x1d')](_0xb53e('0x23'),_0x1f5580,_0xb53e('0x1f'));_0x35fb77(_0x22be38[_0xb53e('0x25')]['message']);}})[_0xb53e('0x26')](function(_0x2d10e0){logger['error'](_0xb53e('0x23'),_0x1f5580,_0x2d10e0);_0x193a52(_0x2d10e0);});});}function respondWithStatusCode(_0x407933,_0x17901c){_0x17901c=_0x17901c||0xcc;return function(_0x523fce){if(_0x523fce){return _0x407933[_0xb53e('0x27')](_0x17901c);}return _0x407933[_0xb53e('0x28')](_0x17901c)['end']();};}function respondWithResult(_0x1b6033,_0x4083c1){_0x4083c1=_0x4083c1||0xc8;return function(_0x1775be){if(_0x1775be){return _0x1b6033[_0xb53e('0x28')](_0x4083c1)[_0xb53e('0x29')](_0x1775be);}};}function respondWithFilteredResult(_0x25ee83,_0x262972){return function(_0x15618b){if(_0x15618b){var _0x50ea84=_0x15618b['count'],_0x5c84bb=_0x262972['offset'],_0x306576=_0x262972['offset']+_0x262972[_0xb53e('0x2a')],_0x4754bc;if(_0x306576>=_0x50ea84){_0x306576=_0x50ea84;_0x4754bc=0xc8;}else{_0x4754bc=0xce;}_0x25ee83[_0xb53e('0x28')](_0x4754bc);return _0x25ee83['set']('Content-Range',_0x5c84bb+'-'+_0x306576+'/'+_0x50ea84)['json'](_0x15618b);}return null;};}function patchUpdates(_0x5f588a){return function(_0x2f97b0){try{jsonpatch['apply'](_0x2f97b0,_0x5f588a,!![]);}catch(_0x1c9d20){return BPromise[_0xb53e('0x2b')](_0x1c9d20);}return _0x2f97b0['save']();};}function saveUpdates(_0x2b459f,_0x38fb5a){return function(_0x2b8691){if(_0x2b8691){return _0x2b8691[_0xb53e('0x2c')](_0x2b459f)[_0xb53e('0x1c')](function(_0x2c53e8){return _0x2c53e8;});}return null;};}function removeEntity(_0x38e949,_0x290bd6){return function(_0xa9b100){if(_0xa9b100){return _0xa9b100['destroy']()[_0xb53e('0x1c')](function(){_0x38e949['status'](0xcc)[_0xb53e('0x2d')]();});}};}function handleEntityNotFound(_0x359c51,_0x410afc){return function(_0x9ca944){if(!_0x9ca944){_0x359c51[_0xb53e('0x27')](0x194);}return _0x9ca944;};}function handleError(_0x385b79,_0x150712){_0x150712=_0x150712||0x1f4;return function(_0xe633db){logger['error'](_0xe633db[_0xb53e('0x2e')]);if(_0xe633db[_0xb53e('0x2f')]){delete _0xe633db[_0xb53e('0x2f')];}_0x385b79[_0xb53e('0x28')](_0x150712)[_0xb53e('0x30')](_0xe633db);};}exports[_0xb53e('0x31')]=function(_0x33d040,_0x4ddd5d){var _0x57e414={'include':[{'model':db[_0xb53e('0x32')],'as':_0xb53e('0x33')},{'model':db['MailServerOut'],'as':_0xb53e('0x34')}]},_0x2e3f16={},_0x5cebed={'count':0x0,'rows':[]};var _0x1b73d9=db[_0xb53e('0x35')]['rawAttributes'];_0x2e3f16[_0xb53e('0x36')]=_[_0xb53e('0x37')](_0x1b73d9);var _0xe6ab8b={'dateStart':_0x33d040[_0xb53e('0x38')][_0xb53e('0x39')],'dateEnd':_0x33d040[_0xb53e('0x38')][_0xb53e('0x3a')]};delete _0x33d040[_0xb53e('0x38')][_0xb53e('0x39')];delete _0x33d040[_0xb53e('0x38')][_0xb53e('0x3a')];_0x2e3f16[_0xb53e('0x38')]=_['keys'](_0x33d040[_0xb53e('0x38')]);_0x2e3f16['filters']=_[_0xb53e('0x3b')](_0x2e3f16[_0xb53e('0x36')],_0x2e3f16[_0xb53e('0x38')]);_0x57e414[_0xb53e('0x3c')]=_['intersection'](_0x2e3f16[_0xb53e('0x36')],qs[_0xb53e('0x3d')](_0x33d040[_0xb53e('0x38')][_0xb53e('0x3d')]));_0x57e414[_0xb53e('0x3c')]=_0x57e414['attributes'][_0xb53e('0x3e')]?_0x57e414[_0xb53e('0x3c')]:_0x2e3f16['model'];if(!_0x33d040[_0xb53e('0x38')]['hasOwnProperty'](_0xb53e('0x3f'))){_0x57e414[_0xb53e('0x2a')]=qs['limit'](_0x33d040[_0xb53e('0x38')][_0xb53e('0x2a')]);_0x57e414[_0xb53e('0x40')]=qs['offset'](_0x33d040[_0xb53e('0x38')][_0xb53e('0x40')]);}_0x57e414[_0xb53e('0x41')]=qs[_0xb53e('0x42')](_0x33d040['query'][_0xb53e('0x42')]);_0x57e414[_0xb53e('0x43')]=qs['filters'](_[_0xb53e('0x44')](_0x33d040[_0xb53e('0x38')],_0x2e3f16[_0xb53e('0x45')]));if(_0xe6ab8b[_0xb53e('0x39')]){if(_0xe6ab8b[_0xb53e('0x3a')]){_0xe6ab8b['dateEnd']=moment(_0xe6ab8b[_0xb53e('0x3a')])[_0xb53e('0x46')](0x1,'day');}else{_0xe6ab8b[_0xb53e('0x3a')]=moment(_0xe6ab8b[_0xb53e('0x39')])['add'](0x1,'day');}_[_0xb53e('0x47')](_0x57e414[_0xb53e('0x43')],{'createdAt':{'$gte':_0xe6ab8b[_0xb53e('0x39')],'$lte':_0xe6ab8b['dateEnd']}});}if(_0x33d040[_0xb53e('0x38')][_0xb53e('0x48')]){_0x57e414[_0xb53e('0x43')]=_[_0xb53e('0x47')](_0x57e414[_0xb53e('0x43')],{'$or':_[_0xb53e('0x49')](_0x57e414[_0xb53e('0x3c')],function(_0x4a685b){var _0x114608={};_0x114608[_0x4a685b]={'$like':'%'+_0x33d040['query'][_0xb53e('0x48')]+'%'};return _0x114608;})});}_0x57e414=_[_0xb53e('0x47')]({},_0x57e414,_0x33d040[_0xb53e('0x4a')]);var _0x1de526={'where':_0x57e414[_0xb53e('0x43')]};return db['MailAccount']['count'](_0x1de526)[_0xb53e('0x1c')](function(_0x5e68fd){_0x5cebed[_0xb53e('0x4b')]=_0x5e68fd;if(_0x33d040[_0xb53e('0x38')]['includeAll']){_0x57e414[_0xb53e('0x4c')]=[{'all':!![]}];}return db[_0xb53e('0x35')]['findAll'](_0x57e414);})[_0xb53e('0x1c')](function(_0x598348){_0x5cebed[_0xb53e('0x4d')]=_0x598348;return _0x5cebed;})['then'](respondWithFilteredResult(_0x4ddd5d,_0x57e414))['catch'](handleError(_0x4ddd5d,null));};exports['show']=function(_0x48ff7b,_0x683638){var _0x6d7b61={'raw':![],'where':{'id':_0x48ff7b[_0xb53e('0x4e')]['id']},'include':[{'model':db[_0xb53e('0x32')],'as':_0xb53e('0x33')},{'model':db[_0xb53e('0x4f')],'as':'Smtp'}]},_0x41f174={};_0x41f174[_0xb53e('0x36')]=_[_0xb53e('0x37')](db['MailAccount'][_0xb53e('0x50')]);_0x41f174[_0xb53e('0x38')]=_[_0xb53e('0x37')](_0x48ff7b[_0xb53e('0x38')]);_0x41f174[_0xb53e('0x45')]=_[_0xb53e('0x3b')](_0x41f174[_0xb53e('0x36')],_0x41f174[_0xb53e('0x38')]);_0x6d7b61[_0xb53e('0x3c')]=_[_0xb53e('0x3b')](_0x41f174[_0xb53e('0x36')],qs[_0xb53e('0x3d')](_0x48ff7b[_0xb53e('0x38')]['fields']));_0x6d7b61[_0xb53e('0x3c')]=_0x6d7b61[_0xb53e('0x3c')][_0xb53e('0x3e')]?_0x6d7b61['attributes']:_0x41f174['model'];if(_0x48ff7b[_0xb53e('0x38')][_0xb53e('0x51')]){_0x6d7b61[_0xb53e('0x4c')]=[{'all':!![]}];}_0x6d7b61=_['merge']({},_0x6d7b61,_0x48ff7b[_0xb53e('0x4a')]);return db[_0xb53e('0x35')][_0xb53e('0x52')](_0x6d7b61)['then'](handleEntityNotFound(_0x683638,null))[_0xb53e('0x1c')](respondWithResult(_0x683638,null))[_0xb53e('0x26')](handleError(_0x683638,null));};exports[_0xb53e('0x2c')]=function(_0xd1d05c,_0x31eb6a){if(_0xd1d05c[_0xb53e('0x53')]['id']){delete _0xd1d05c[_0xb53e('0x53')]['id'];}return db[_0xb53e('0x35')][_0xb53e('0x52')]({'where':{'id':_0xd1d05c[_0xb53e('0x4e')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xb53e('0x33')},{'model':db[_0xb53e('0x4f')],'as':_0xb53e('0x34')}]})[_0xb53e('0x1c')](handleEntityNotFound(_0x31eb6a,null))['then'](saveUpdates(_0xd1d05c[_0xb53e('0x53')],null))[_0xb53e('0x1c')](function(_0x545fd8){if(_0x545fd8&&_0xd1d05c[_0xb53e('0x53')]['Imap']){return db[_0xb53e('0x32')][_0xb53e('0x2c')](_0xd1d05c[_0xb53e('0x53')][_0xb53e('0x33')],{'where':{'MailAccountId':_0x545fd8['id']}})[_0xb53e('0x1c')](function(){return _0x545fd8;});}return _0x545fd8;})[_0xb53e('0x1c')](function(_0x7276c7){if(_0x7276c7&&_0xd1d05c[_0xb53e('0x53')][_0xb53e('0x34')]){return db[_0xb53e('0x4f')][_0xb53e('0x2c')](_0xd1d05c['body'][_0xb53e('0x34')],{'where':{'MailAccountId':_0x7276c7['id']}})[_0xb53e('0x1c')](function(){return _0x7276c7;});}return _0x7276c7;})[_0xb53e('0x1c')](respondWithResult(_0x31eb6a,null))[_0xb53e('0x26')](handleError(_0x31eb6a,null));};exports[_0xb53e('0x54')]=function(_0x433a15,_0xdc7a2b){return db[_0xb53e('0x35')][_0xb53e('0x54')]()['then'](respondWithResult(_0xdc7a2b,null))[_0xb53e('0x26')](handleError(_0xdc7a2b,null));};exports[_0xb53e('0x55')]=function(_0x4abcf1,_0x4b8a87,_0x117bc2){if(_0x4abcf1[_0xb53e('0x53')]['id']){delete _0x4abcf1['body']['id'];}return db[_0xb53e('0x35')]['find']({'where':{'id':_0x4abcf1[_0xb53e('0x4e')]['id']}})[_0xb53e('0x1c')](handleEntityNotFound(_0x4b8a87,null))['then'](function(_0x3dc570){if(_0x3dc570){_0x4abcf1['body'][_0xb53e('0x56')]=_0x3dc570['id'];return db[_0xb53e('0x57')][_0xb53e('0x58')](_0x4abcf1[_0xb53e('0x53')]);}})[_0xb53e('0x1c')](respondWithResult(_0x4b8a87,null))['catch'](handleError(_0x4b8a87,null));};exports['getDispositions']=function(_0x1e8aa3,_0x35d7af,_0xcea024){var _0x450ef0={'raw':![],'where':{}};var _0xd9588={};var _0x470d21={'count':0x0,'rows':[]};return db[_0xb53e('0x35')][_0xb53e('0x59')]({'where':{'id':_0x1e8aa3['params']['id']}})[_0xb53e('0x1c')](handleEntityNotFound(_0x35d7af,null))['then'](function(_0x45d34e){if(_0x45d34e){_0xd9588[_0xb53e('0x36')]=_[_0xb53e('0x37')](db['Disposition']['rawAttributes']);_0xd9588['query']=_[_0xb53e('0x37')](_0x1e8aa3[_0xb53e('0x38')]);_0xd9588[_0xb53e('0x45')]=_[_0xb53e('0x3b')](_0xd9588[_0xb53e('0x36')],_0xd9588['query']);_0x450ef0[_0xb53e('0x3c')]=_[_0xb53e('0x3b')](_0xd9588[_0xb53e('0x36')],qs[_0xb53e('0x3d')](_0x1e8aa3[_0xb53e('0x38')]['fields']));_0x450ef0[_0xb53e('0x3c')]=_0x450ef0[_0xb53e('0x3c')][_0xb53e('0x3e')]?_0x450ef0[_0xb53e('0x3c')]:_0xd9588[_0xb53e('0x36')];if(!_0x1e8aa3['query'][_0xb53e('0x5a')]('nolimit')){_0x450ef0[_0xb53e('0x2a')]=qs[_0xb53e('0x2a')](_0x1e8aa3[_0xb53e('0x38')][_0xb53e('0x2a')]);_0x450ef0[_0xb53e('0x40')]=qs[_0xb53e('0x40')](_0x1e8aa3[_0xb53e('0x38')][_0xb53e('0x40')]);}_0x450ef0['order']=qs['sort'](_0x1e8aa3[_0xb53e('0x38')][_0xb53e('0x42')]);_0x450ef0[_0xb53e('0x43')]=qs[_0xb53e('0x45')](_[_0xb53e('0x44')](_0x1e8aa3['query'],_0xd9588[_0xb53e('0x45')]));_0x450ef0[_0xb53e('0x43')][_0xb53e('0x56')]=_0x45d34e['id'];if(_0x1e8aa3[_0xb53e('0x38')][_0xb53e('0x48')]){_0x450ef0[_0xb53e('0x43')]=_[_0xb53e('0x47')](_0x450ef0['where'],{'$or':_[_0xb53e('0x49')](_0x450ef0[_0xb53e('0x3c')],function(_0xa401d){var _0x3b0868={};_0x3b0868[_0xa401d]={'$like':'%'+_0x1e8aa3[_0xb53e('0x38')][_0xb53e('0x48')]+'%'};return _0x3b0868;})});}_0x450ef0=_[_0xb53e('0x47')]({},_0x450ef0,_0x1e8aa3[_0xb53e('0x4a')]);return db[_0xb53e('0x57')]['count']({'where':_0x450ef0[_0xb53e('0x43')]})[_0xb53e('0x1c')](function(_0xa6406a){_0x470d21[_0xb53e('0x4b')]=_0xa6406a;if(_0x1e8aa3[_0xb53e('0x38')]['includeAll']){_0x450ef0[_0xb53e('0x4c')]=[{'all':!![]}];}return db[_0xb53e('0x57')][_0xb53e('0x5b')](_0x450ef0);})[_0xb53e('0x1c')](function(_0x11b0a7){_0x470d21[_0xb53e('0x4d')]=_0x11b0a7;return _0x470d21;});}})['then'](respondWithFilteredResult(_0x35d7af,_0x450ef0))['catch'](handleError(_0x35d7af,null));};exports['removeDispositions']=function(_0x554b5e,_0x474b28,_0x530983){var _0x86c161;return db[_0xb53e('0x35')][_0xb53e('0x52')]({'where':{'id':_0x554b5e['params']['id']}})['then'](handleEntityNotFound(_0x474b28,null))['then'](function(_0x1be4f7){if(_0x1be4f7){return _0x1be4f7[_0xb53e('0x5c')](_0x554b5e[_0xb53e('0x38')][_0xb53e('0x5d')]);}})['then'](respondWithStatusCode(_0x474b28,null))['catch'](handleError(_0x474b28,null));};exports[_0xb53e('0x5e')]=function(_0x2ed44e,_0x3db9d2,_0x154474){if(_0x2ed44e['body']['id']){delete _0x2ed44e[_0xb53e('0x53')]['id'];}return db[_0xb53e('0x35')][_0xb53e('0x52')]({'where':{'id':_0x2ed44e[_0xb53e('0x4e')]['id']}})[_0xb53e('0x1c')](handleEntityNotFound(_0x3db9d2,null))[_0xb53e('0x1c')](function(_0x4d6001){if(_0x4d6001){_0x2ed44e[_0xb53e('0x53')][_0xb53e('0x56')]=_0x4d6001['id'];return db[_0xb53e('0x5f')][_0xb53e('0x58')](_0x2ed44e[_0xb53e('0x53')]);}})[_0xb53e('0x1c')](respondWithResult(_0x3db9d2,null))[_0xb53e('0x26')](handleError(_0x3db9d2,null));};exports[_0xb53e('0x60')]=function(_0x48027d,_0x13cc34,_0x399f06){var _0x5c9c2c={'raw':![],'where':{}};var _0x22d130={};var _0x53b277={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x48027d[_0xb53e('0x4e')]['id']}})[_0xb53e('0x1c')](handleEntityNotFound(_0x13cc34,null))['then'](function(_0x44b379){if(_0x44b379){_0x22d130[_0xb53e('0x36')]=_[_0xb53e('0x37')](db[_0xb53e('0x5f')][_0xb53e('0x50')]);_0x22d130[_0xb53e('0x38')]=_[_0xb53e('0x37')](_0x48027d['query']);_0x22d130[_0xb53e('0x45')]=_[_0xb53e('0x3b')](_0x22d130[_0xb53e('0x36')],_0x22d130[_0xb53e('0x38')]);_0x5c9c2c[_0xb53e('0x3c')]=_[_0xb53e('0x3b')](_0x22d130[_0xb53e('0x36')],qs[_0xb53e('0x3d')](_0x48027d[_0xb53e('0x38')][_0xb53e('0x3d')]));_0x5c9c2c[_0xb53e('0x3c')]=_0x5c9c2c[_0xb53e('0x3c')][_0xb53e('0x3e')]?_0x5c9c2c[_0xb53e('0x3c')]:_0x22d130['model'];if(!_0x48027d['query']['hasOwnProperty'](_0xb53e('0x3f'))){_0x5c9c2c[_0xb53e('0x2a')]=qs[_0xb53e('0x2a')](_0x48027d[_0xb53e('0x38')][_0xb53e('0x2a')]);_0x5c9c2c['offset']=qs[_0xb53e('0x40')](_0x48027d[_0xb53e('0x38')]['offset']);}_0x5c9c2c['order']=qs[_0xb53e('0x42')](_0x48027d[_0xb53e('0x38')][_0xb53e('0x42')]);_0x5c9c2c[_0xb53e('0x43')]=qs['filters'](_['pick'](_0x48027d[_0xb53e('0x38')],_0x22d130[_0xb53e('0x45')]));_0x5c9c2c[_0xb53e('0x43')][_0xb53e('0x56')]=_0x44b379['id'];if(_0x48027d[_0xb53e('0x38')]['filter']){_0x5c9c2c[_0xb53e('0x43')]=_[_0xb53e('0x47')](_0x5c9c2c[_0xb53e('0x43')],{'$or':_[_0xb53e('0x49')](_0x5c9c2c['attributes'],function(_0x553c82){var _0x43812c={};_0x43812c[_0x553c82]={'$like':'%'+_0x48027d[_0xb53e('0x38')][_0xb53e('0x48')]+'%'};return _0x43812c;})});}_0x5c9c2c=_[_0xb53e('0x47')]({},_0x5c9c2c,_0x48027d[_0xb53e('0x4a')]);return db[_0xb53e('0x5f')][_0xb53e('0x4b')]({'where':_0x5c9c2c[_0xb53e('0x43')]})[_0xb53e('0x1c')](function(_0x3927a2){_0x53b277[_0xb53e('0x4b')]=_0x3927a2;if(_0x48027d['query']['includeAll']){_0x5c9c2c[_0xb53e('0x4c')]=[{'all':!![]}];}return db[_0xb53e('0x5f')][_0xb53e('0x5b')](_0x5c9c2c);})[_0xb53e('0x1c')](function(_0x48bf38){_0x53b277[_0xb53e('0x4d')]=_0x48bf38;return _0x53b277;});}})[_0xb53e('0x1c')](respondWithFilteredResult(_0x13cc34,_0x5c9c2c))[_0xb53e('0x26')](handleError(_0x13cc34,null));};exports[_0xb53e('0x61')]=function(_0x39bc7c,_0x563e8a,_0x3cfbec){var _0x3abae6;return db['MailAccount'][_0xb53e('0x52')]({'where':{'id':_0x39bc7c[_0xb53e('0x4e')]['id']}})[_0xb53e('0x1c')](handleEntityNotFound(_0x563e8a,null))['then'](function(_0x41f01b){if(_0x41f01b){return _0x41f01b[_0xb53e('0x61')](_0x39bc7c[_0xb53e('0x38')][_0xb53e('0x5d')]);}})[_0xb53e('0x1c')](respondWithStatusCode(_0x563e8a,null))['catch'](handleError(_0x563e8a,null));};exports['create']=function(_0x9500f4,_0x2bf752){var _0x87867a={'name':_0x9500f4[_0xb53e('0x53')]['name'],'key':_0x9500f4[_0xb53e('0x53')][_0xb53e('0x62')],'email':_0x9500f4['body']['email'],'ListId':_0x9500f4[_0xb53e('0x53')]['ListId'],'active':!_[_0xb53e('0x63')](_0x9500f4['body'][_0xb53e('0x64')])?_0x9500f4[_0xb53e('0x53')][_0xb53e('0x64')]:!![],'description':_0x9500f4[_0xb53e('0x53')]['description']||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x9500f4[_0xb53e('0x53')][_0xb53e('0x65')])){if(_0x9500f4[_0xb53e('0x53')][_0xb53e('0x66')]){_0x87867a[_0xb53e('0x33')][_0xb53e('0x67')]=_0x87867a[_0xb53e('0x34')][_0xb53e('0x67')]=_0x9500f4[_0xb53e('0x53')]['cuser'];_0x87867a[_0xb53e('0x33')][_0xb53e('0x68')]=_0x87867a[_0xb53e('0x34')][_0xb53e('0x69')]=_0x9500f4[_0xb53e('0x53')][_0xb53e('0x6a')];}else{_0x87867a[_0xb53e('0x33')][_0xb53e('0x6b')]=_0x87867a[_0xb53e('0x34')][_0xb53e('0x6b')]=![];}_0x87867a[_0xb53e('0x33')][_0xb53e('0x6c')]=_0x9500f4[_0xb53e('0x53')][_0xb53e('0x33')]['host'];_0x87867a[_0xb53e('0x33')][_0xb53e('0x6d')]=_0x9500f4[_0xb53e('0x53')][_0xb53e('0x33')]['port'];_0x87867a[_0xb53e('0x34')][_0xb53e('0x6c')]=_0x9500f4[_0xb53e('0x53')][_0xb53e('0x34')][_0xb53e('0x6c')];_0x87867a[_0xb53e('0x34')][_0xb53e('0x6d')]=_0x9500f4[_0xb53e('0x53')][_0xb53e('0x34')][_0xb53e('0x6d')];}else{_0x87867a[_0xb53e('0x33')][_0xb53e('0x6e')]=_0x87867a[_0xb53e('0x34')][_0xb53e('0x6e')]=_0x9500f4['body']['cservice'];_0x87867a[_0xb53e('0x33')][_0xb53e('0x67')]=_0x87867a[_0xb53e('0x34')][_0xb53e('0x67')]=_0x9500f4[_0xb53e('0x53')][_0xb53e('0x6f')];_0x87867a[_0xb53e('0x33')][_0xb53e('0x68')]=_0x87867a[_0xb53e('0x34')]['pass']=_0x9500f4[_0xb53e('0x53')][_0xb53e('0x6a')];}return db[_0xb53e('0x35')]['create'](_0x87867a,{'include':[{'model':db[_0xb53e('0x4f')],'as':'Smtp'},{'model':db[_0xb53e('0x32')],'as':_0xb53e('0x33')}]})[_0xb53e('0x1c')](respondWithResult(_0x2bf752,0xc9))[_0xb53e('0x26')](handleError(_0x2bf752,null));};exports[_0xb53e('0x70')]=function(_0x2991f3,_0x42f463,_0x2a5e03){return db[_0xb53e('0x35')][_0xb53e('0x59')]({'where':{'id':_0x2991f3[_0xb53e('0x4e')]['id']}})[_0xb53e('0x1c')](handleEntityNotFound(_0x42f463,null))[_0xb53e('0x1c')](function(_0x299744){if(_0x299744){return _0x299744[_0xb53e('0x70')]();}return null;})[_0xb53e('0x1c')](respondWithResult(_0x42f463,null))[_0xb53e('0x26')](handleError(_0x42f463,null));};exports[_0xb53e('0x71')]=function(_0x150a12,_0x793e43,_0x267903){if(_0x150a12['body']['id']){delete _0x150a12[_0xb53e('0x53')]['id'];}return db[_0xb53e('0x35')][_0xb53e('0x52')]({'where':{'id':_0x150a12[_0xb53e('0x4e')]['id']}})[_0xb53e('0x1c')](handleEntityNotFound(_0x793e43,null))['then'](function(_0x4c3d7f){if(_0x4c3d7f){_0x150a12['body'][_0xb53e('0x56')]=_0x4c3d7f['id'];return db[_0xb53e('0x32')][_0xb53e('0x58')](_0x150a12[_0xb53e('0x53')]);}})['then'](respondWithResult(_0x793e43,null))[_0xb53e('0x26')](handleError(_0x793e43,null));};exports[_0xb53e('0x72')]=function(_0x549c26,_0x447e44,_0x1f3b34){return db[_0xb53e('0x35')][_0xb53e('0x59')]({'where':{'id':_0x549c26['params']['id']}})[_0xb53e('0x1c')](handleEntityNotFound(_0x447e44,null))[_0xb53e('0x1c')](function(_0x113d20){if(_0x113d20){return _0x113d20[_0xb53e('0x73')](null);}return null;})['then'](respondWithStatusCode(_0x447e44,null))[_0xb53e('0x26')](handleError(_0x447e44,null));};exports['getSmtp']=function(_0x4688de,_0x5b228e,_0x1fe540){return db[_0xb53e('0x35')][_0xb53e('0x59')]({'where':{'id':_0x4688de['params']['id']}})[_0xb53e('0x1c')](handleEntityNotFound(_0x5b228e,null))['then'](function(_0x2c22c3){if(_0x2c22c3){return _0x2c22c3[_0xb53e('0x74')]();}return null;})[_0xb53e('0x1c')](respondWithResult(_0x5b228e,null))['catch'](handleError(_0x5b228e,null));};exports[_0xb53e('0x75')]=function(_0x1fe546,_0x331aeb,_0x2ae3a8){if(_0x1fe546['body']['id']){delete _0x1fe546['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x1fe546[_0xb53e('0x4e')]['id']}})[_0xb53e('0x1c')](handleEntityNotFound(_0x331aeb,null))[_0xb53e('0x1c')](function(_0x20ac9d){if(_0x20ac9d){_0x1fe546[_0xb53e('0x53')]['MailAccountId']=_0x20ac9d['id'];return db[_0xb53e('0x4f')][_0xb53e('0x58')](_0x1fe546[_0xb53e('0x53')]);}})[_0xb53e('0x1c')](respondWithResult(_0x331aeb,null))['catch'](handleError(_0x331aeb,null));};exports[_0xb53e('0x76')]=function(_0x578db3,_0x25359b,_0xf0587d){return db[_0xb53e('0x35')][_0xb53e('0x59')]({'where':{'id':_0x578db3[_0xb53e('0x4e')]['id']}})[_0xb53e('0x1c')](handleEntityNotFound(_0x25359b,null))[_0xb53e('0x1c')](function(_0xdee8e4){if(_0xdee8e4){return _0xdee8e4['setSmtp'](null);}return null;})[_0xb53e('0x1c')](respondWithStatusCode(_0x25359b,null))[_0xb53e('0x26')](handleError(_0x25359b,null));};exports[_0xb53e('0x77')]=function(_0x44dfba,_0x9f1190,_0x1439d5){return db[_0xb53e('0x78')][_0xb53e('0x52')]({'where':{'id':_0x44dfba[_0xb53e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x9f1190,null))[_0xb53e('0x1c')](function(_0x732219){if(_0x732219){return _0x732219[_0xb53e('0x77')](_0x44dfba['body'][_0xb53e('0x5d')],_[_0xb53e('0x79')](_0x44dfba['body'],[_0xb53e('0x5d'),'id'])||{});}})[_0xb53e('0x1c')](respondWithResult(_0x9f1190,null))['catch'](handleError(_0x9f1190,null));};exports[_0xb53e('0x7a')]=function(_0x4f19df,_0x156d5c,_0x27fc27){var _0x1c2756={'raw':![],'where':{}};var _0x150d97={};var _0x41f8fa={'count':0x0,'rows':[]};return db[_0xb53e('0x35')][_0xb53e('0x59')]({'where':{'id':_0x4f19df[_0xb53e('0x4e')]['id']}})[_0xb53e('0x1c')](handleEntityNotFound(_0x156d5c,null))[_0xb53e('0x1c')](function(_0x186d62){if(_0x186d62){_0x150d97['model']=_[_0xb53e('0x37')](db[_0xb53e('0x78')][_0xb53e('0x50')]);_0x150d97[_0xb53e('0x38')]=_['keys'](_0x4f19df[_0xb53e('0x38')]);_0x150d97['filters']=_[_0xb53e('0x3b')](_0x150d97['model'],_0x150d97[_0xb53e('0x38')]);_0x1c2756[_0xb53e('0x3c')]=_[_0xb53e('0x3b')](_0x150d97[_0xb53e('0x36')],qs[_0xb53e('0x3d')](_0x4f19df[_0xb53e('0x38')][_0xb53e('0x3d')]));_0x1c2756[_0xb53e('0x3c')]=_0x1c2756[_0xb53e('0x3c')][_0xb53e('0x3e')]?_0x1c2756[_0xb53e('0x3c')]:_0x150d97[_0xb53e('0x36')];if(!_0x4f19df[_0xb53e('0x38')][_0xb53e('0x5a')]('nolimit')){_0x1c2756[_0xb53e('0x2a')]=qs[_0xb53e('0x2a')](_0x4f19df[_0xb53e('0x38')][_0xb53e('0x2a')]);_0x1c2756[_0xb53e('0x40')]=qs[_0xb53e('0x40')](_0x4f19df[_0xb53e('0x38')][_0xb53e('0x40')]);}_0x1c2756[_0xb53e('0x41')]=qs['sort'](_0x4f19df['query'][_0xb53e('0x42')]);_0x1c2756[_0xb53e('0x43')]=qs[_0xb53e('0x45')](_[_0xb53e('0x44')](_0x4f19df[_0xb53e('0x38')],_0x150d97[_0xb53e('0x45')]));_0x1c2756[_0xb53e('0x43')][_0xb53e('0x56')]=_0x186d62['id'];if(_0x4f19df[_0xb53e('0x38')][_0xb53e('0x48')]){_0x1c2756[_0xb53e('0x43')]=_[_0xb53e('0x47')](_0x1c2756[_0xb53e('0x43')],{'$or':_[_0xb53e('0x49')](_0x1c2756[_0xb53e('0x3c')],function(_0x4e3012){var _0x48b29a={};_0x48b29a[_0x4e3012]={'$like':'%'+_0x4f19df[_0xb53e('0x38')][_0xb53e('0x48')]+'%'};return _0x48b29a;})});}_0x1c2756=_[_0xb53e('0x47')]({},_0x1c2756,_0x4f19df['options']);return db[_0xb53e('0x78')]['count']({'where':_0x1c2756['where']})[_0xb53e('0x1c')](function(_0x96a220){_0x41f8fa[_0xb53e('0x4b')]=_0x96a220;if(_0x4f19df[_0xb53e('0x38')]['includeAll']){_0x1c2756[_0xb53e('0x4c')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0xb53e('0x7b'),'attributes':[_0xb53e('0x2f'),_0xb53e('0x7c'),_0xb53e('0x7d')],'required':![]},{'model':db['Tag'],'as':_0xb53e('0x7e'),'attributes':['id',_0xb53e('0x2f'),_0xb53e('0x7f')],'where':_0x4f19df[_0xb53e('0x38')][_0xb53e('0x80')]?{'id':_0x4f19df[_0xb53e('0x38')][_0xb53e('0x80')]}:undefined,'required':_0x4f19df['query'][_0xb53e('0x80')]?!![]:![]}];}return db['MailInteraction'][_0xb53e('0x5b')](_0x1c2756);})[_0xb53e('0x1c')](function(_0x1748f1){_0x41f8fa['rows']=_0x1748f1;return _0x41f8fa;});}})['then'](respondWithFilteredResult(_0x156d5c,_0x1c2756))[_0xb53e('0x26')](handleError(_0x156d5c,null));};exports['addApplications']=function(_0x57f2b1,_0x294c41,_0x2f960c){return db[_0xb53e('0x35')][_0xb53e('0x59')]({'where':{'id':_0x57f2b1[_0xb53e('0x4e')]['id']}})[_0xb53e('0x1c')](handleEntityNotFound(_0x294c41,null))[_0xb53e('0x1c')](function(_0x31b0f8){if(_0x31b0f8){return db[_0xb53e('0x81')]['transaction'](function(_0x376565){return db[_0xb53e('0x82')][_0xb53e('0x83')]({'where':{'MailAccountId':_0x57f2b1[_0xb53e('0x4e')]['id']},'transaction':_0x376565})['then'](function(_0x2841e8){var _0x50c5af=_[_0xb53e('0x49')](_0x57f2b1[_0xb53e('0x53')],function(_0x49edd8){_0x49edd8['MailAccountId']=_0x57f2b1[_0xb53e('0x4e')]['id'];return _0x49edd8;});return db[_0xb53e('0x82')]['bulkCreate'](_0x50c5af,{'transaction':_0x376565});});})[_0xb53e('0x1c')](function(){return db[_0xb53e('0x82')]['findAndCountAll']({'where':{'MailAccountId':_0x57f2b1[_0xb53e('0x4e')]['id']},'order':_0xb53e('0x84')});});}})[_0xb53e('0x1c')](respondWithResult(_0x294c41,null))[_0xb53e('0x26')](handleError(_0x294c41,null));};exports[_0xb53e('0x85')]=function(_0x3e5f7f,_0x10d307,_0x116c33){var _0x24a8a1={};var _0x360c97={};var _0x71c4bb;var _0x381001;return db[_0xb53e('0x35')][_0xb53e('0x59')]({'where':{'id':_0x3e5f7f[_0xb53e('0x4e')]['id']}})[_0xb53e('0x1c')](handleEntityNotFound(_0x10d307,null))['then'](function(_0x1b644a){if(_0x1b644a){_0x71c4bb=_0x1b644a;_0x360c97[_0xb53e('0x36')]=_[_0xb53e('0x37')](db[_0xb53e('0x82')][_0xb53e('0x50')]);_0x360c97['query']=_[_0xb53e('0x37')](_0x3e5f7f[_0xb53e('0x38')]);_0x360c97[_0xb53e('0x45')]=_['intersection'](_0x360c97[_0xb53e('0x36')],_0x360c97[_0xb53e('0x38')]);_0x24a8a1[_0xb53e('0x3c')]=_[_0xb53e('0x3b')](_0x360c97[_0xb53e('0x36')],qs['fields'](_0x3e5f7f[_0xb53e('0x38')][_0xb53e('0x3d')]));_0x24a8a1[_0xb53e('0x3c')]=_0x24a8a1['attributes'][_0xb53e('0x3e')]?_0x24a8a1[_0xb53e('0x3c')]:_0x360c97[_0xb53e('0x36')];_0x24a8a1[_0xb53e('0x41')]=qs[_0xb53e('0x42')](_0x3e5f7f[_0xb53e('0x38')]['sort']);_0x24a8a1[_0xb53e('0x43')]=qs[_0xb53e('0x45')](_[_0xb53e('0x44')](_0x3e5f7f[_0xb53e('0x38')],_0x360c97[_0xb53e('0x45')]));if(_0x3e5f7f[_0xb53e('0x38')][_0xb53e('0x48')]){_0x24a8a1['where']=_[_0xb53e('0x47')](_0x24a8a1[_0xb53e('0x43')],{'$or':_[_0xb53e('0x49')](_0x24a8a1[_0xb53e('0x3c')],function(_0x4a2fe3){var _0x57f70a={};_0x57f70a[_0x4a2fe3]={'$like':'%'+_0x3e5f7f[_0xb53e('0x38')][_0xb53e('0x48')]+'%'};return _0x57f70a;})});}_0x24a8a1=_[_0xb53e('0x47')]({},_0x24a8a1,_0x3e5f7f['options']);return _0x71c4bb[_0xb53e('0x85')](_0x24a8a1);}})['then'](function(_0x588d11){if(_0x588d11){_0x381001=_0x588d11[_0xb53e('0x3e')];if(!_0x3e5f7f['query'][_0xb53e('0x5a')]('nolimit')){_0x24a8a1[_0xb53e('0x2a')]=qs[_0xb53e('0x2a')](_0x3e5f7f[_0xb53e('0x38')][_0xb53e('0x2a')]);_0x24a8a1[_0xb53e('0x40')]=qs[_0xb53e('0x40')](_0x3e5f7f['query']['offset']);}return _0x71c4bb[_0xb53e('0x85')](_0x24a8a1);}})[_0xb53e('0x1c')](function(_0x491aee){if(_0x491aee){return _0x491aee?{'count':_0x381001,'rows':_0x491aee}:null;}})[_0xb53e('0x1c')](respondWithResult(_0x10d307,null))[_0xb53e('0x26')](handleError(_0x10d307,null));};exports[_0xb53e('0x86')]=function(_0x2e35e9,_0x260d88,_0x3991b1){var _0x434fc5={'raw':!![],'where':{}};var _0x2d4829={};var _0x5856cc={'count':0x0,'rows':[]};return db[_0xb53e('0x35')][_0xb53e('0x59')]({'where':{'id':_0x2e35e9[_0xb53e('0x4e')]['id']}})[_0xb53e('0x1c')](handleEntityNotFound(_0x260d88,null))[_0xb53e('0x1c')](function(_0x38cf46){if(_0x38cf46){_0x2d4829[_0xb53e('0x36')]=_[_0xb53e('0x37')](db[_0xb53e('0x87')]['rawAttributes']);_0x2d4829[_0xb53e('0x38')]=_[_0xb53e('0x37')](_0x2e35e9['query']);_0x2d4829['filters']=_[_0xb53e('0x3b')](_0x2d4829[_0xb53e('0x36')],_0x2d4829[_0xb53e('0x38')]);_0x434fc5[_0xb53e('0x3c')]=_[_0xb53e('0x3b')](_0x2d4829['model'],qs[_0xb53e('0x3d')](_0x2e35e9['query']['fields']));_0x434fc5[_0xb53e('0x3c')]=_0x434fc5['attributes'][_0xb53e('0x3e')]?_0x434fc5['attributes']:_0x2d4829[_0xb53e('0x36')];if(!_0x2e35e9[_0xb53e('0x38')]['hasOwnProperty'](_0xb53e('0x3f'))){_0x434fc5[_0xb53e('0x2a')]=qs['limit'](_0x2e35e9[_0xb53e('0x38')]['limit']);_0x434fc5['offset']=qs['offset'](_0x2e35e9[_0xb53e('0x38')][_0xb53e('0x40')]);}_0x434fc5['order']=qs[_0xb53e('0x42')](_0x2e35e9[_0xb53e('0x38')][_0xb53e('0x42')]);_0x434fc5[_0xb53e('0x43')]=qs[_0xb53e('0x45')](_[_0xb53e('0x44')](_0x2e35e9[_0xb53e('0x38')],_0x2d4829[_0xb53e('0x45')]));_0x434fc5[_0xb53e('0x43')][_0xb53e('0x56')]=_0x38cf46['id'];if(_0x2e35e9[_0xb53e('0x38')][_0xb53e('0x48')]){_0x434fc5['where']=_[_0xb53e('0x47')](_0x434fc5[_0xb53e('0x43')],{'$or':_[_0xb53e('0x49')](_0x434fc5[_0xb53e('0x3c')],function(_0x913455){var _0x41b650={};_0x41b650[_0x913455]={'$like':'%'+_0x2e35e9['query']['filter']+'%'};return _0x41b650;})});}if(_0x2e35e9[_0xb53e('0x38')][_0xb53e('0x88')]){var _0x3f3281=_0x2e35e9[_0xb53e('0x38')][_0xb53e('0x88')][_0xb53e('0x89')](',');var _0x5a2966={};_0x5a2966[_0x3f3281[0x0]]={'$gte':moment(_0x3f3281[0x1])[_0xb53e('0x8a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x434fc5['where']=_[_0xb53e('0x47')](_0x434fc5['where'],_0x5a2966);}_0x434fc5=_[_0xb53e('0x47')]({},_0x434fc5,_0x2e35e9['options']);return db['MailMessage'][_0xb53e('0x4b')]({'where':_0x434fc5[_0xb53e('0x43')]})['then'](function(_0x96f41a){_0x5856cc[_0xb53e('0x4b')]=_0x96f41a;if(_0x2e35e9['query'][_0xb53e('0x51')]){_0x434fc5[_0xb53e('0x4c')]=[{'all':!![]}];}return db[_0xb53e('0x87')][_0xb53e('0x5b')](_0x434fc5);})['then'](function(_0x3f2ff8){_0x5856cc['rows']=_0x3f2ff8;return _0x5856cc;});}})['then'](respondWithFilteredResult(_0x260d88,_0x434fc5))[_0xb53e('0x26')](handleError(_0x260d88,null));};exports['send']=function(_0x473b7f,_0x5949a1,_0x2eaabf){var _0x2e665e,_0x26cdd6={},_0x207fa5;if(_0x473b7f[_0xb53e('0x53')]['to']){_0x207fa5=_0x473b7f[_0xb53e('0x53')]['to'][_0xb53e('0x89')](',')[0x0];}return db[_0xb53e('0x35')][_0xb53e('0x52')]({'where':{'id':_0x473b7f[_0xb53e('0x4e')]['id']},'include':[{'model':db[_0xb53e('0x8b')],'as':_0xb53e('0x8c'),'include':[{'model':db['CmContact'],'as':_0xb53e('0x8d'),'where':{'email':_0x207fa5},'limit':0x1,'order':[[_0xb53e('0x8e'),'DESC']]}]},{'model':db[_0xb53e('0x4f')],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x5949a1,null))[_0xb53e('0x1c')](function(_0x24a628){if(_0x24a628){_0x2e665e=_0x24a628;if(_0x24a628[_0xb53e('0x34')]){if(_[_0xb53e('0x63')](_0x473b7f[_0xb53e('0x53')][_0xb53e('0x8f')])){_0x473b7f[_0xb53e('0x53')][_0xb53e('0x8f')]=util['format'](_0xb53e('0x90'),_0x24a628['name'],_0x24a628['email']||_0x24a628[_0xb53e('0x34')][_0xb53e('0x67')]);}if(_0x473b7f['body']['attachments']&&_0x473b7f[_0xb53e('0x53')][_0xb53e('0x91')][_0xb53e('0x3e')]){for(var _0x4c06fc=0x0;_0x4c06fc<_0x473b7f[_0xb53e('0x53')][_0xb53e('0x91')][_0xb53e('0x3e')];_0x4c06fc+=0x1){_0x473b7f['body'][_0xb53e('0x91')][_0x4c06fc]={'filename':_0x473b7f[_0xb53e('0x53')][_0xb53e('0x91')][_0x4c06fc][_0xb53e('0x2f')],'path':path[_0xb53e('0x92')](config[_0xb53e('0x93')],_0xb53e('0x94'),_0x473b7f[_0xb53e('0x53')][_0xb53e('0x91')][_0x4c06fc][_0xb53e('0x95')])};}}var _0x4e6f2e={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x24a628[_0xb53e('0x34')][_0xb53e('0x6e')])){if(_0x24a628[_0xb53e('0x34')][_0xb53e('0x6b')]){_0x4e6f2e[_0xb53e('0x96')]={'user':_0x24a628['Smtp'][_0xb53e('0x67')],'pass':_0x24a628[_0xb53e('0x34')][_0xb53e('0x69')]};}_0x4e6f2e[_0xb53e('0x6c')]=_0x24a628[_0xb53e('0x34')][_0xb53e('0x6c')];_0x4e6f2e[_0xb53e('0x6d')]=_0x24a628[_0xb53e('0x34')][_0xb53e('0x6d')];_0x4e6f2e[_0xb53e('0x97')]=_0x24a628[_0xb53e('0x34')]['secure'];}else{_0x4e6f2e['service']=_0x24a628[_0xb53e('0x34')][_0xb53e('0x6e')];_0x4e6f2e[_0xb53e('0x96')]={'user':_0x24a628[_0xb53e('0x34')]['user'],'pass':_0x24a628[_0xb53e('0x34')][_0xb53e('0x69')]};}return respondWithRpcPromise(_0xb53e('0x98'),_0xb53e('0x99'),{'account':_0x4e6f2e,'message':_0x473b7f[_0xb53e('0x53')]});}else{throw new Error(_0xb53e('0x9a'));}}})[_0xb53e('0x1c')](function(_0x574037){if(_0x574037){_0x26cdd6=_0x574037;if(_0x2e665e['List']){if(_0x2e665e[_0xb53e('0x8c')][_0xb53e('0x8d')][_0xb53e('0x3e')]){return _0x2e665e[_0xb53e('0x8c')][_0xb53e('0x8d')][0x0];}else{return db[_0xb53e('0x9b')][_0xb53e('0x58')](_[_0xb53e('0x9c')](_0x473b7f[_0xb53e('0x53')],{'firstName':_0x473b7f['body']['to'],'email':_0x473b7f['body']['to'],'phone':_0x473b7f[_0xb53e('0x53')]['to'],'ListId':_0x2e665e[_0xb53e('0x9d')]}));}}else{throw new Error(_0xb53e('0x9a'));}}})['then'](function(_0x24ea84){if(_0x24ea84){var _0x1a2b13={'UserId':_0x473b7f[_0xb53e('0x67')]['id'],'ContactId':_0x24ea84['id'],'MailAccountId':_0x2e665e['id'],'inReplyTo':_0x26cdd6[_0xb53e('0x9e')],'to':_0x473b7f[_0xb53e('0x53')]['from'],'cc':_0x473b7f[_0xb53e('0x53')]['cc'],'subject':_0x473b7f[_0xb53e('0x53')][_0xb53e('0x9f')],'attach':_0x473b7f[_0xb53e('0x53')][_0xb53e('0xa0')],'firstMsgDirection':_0xb53e('0xa1'),'lastMsgAt':moment()[_0xb53e('0x8a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','lastMsgBody':_0x473b7f[_0xb53e('0x53')][_0xb53e('0x53')],'Messages':[_[_0xb53e('0x47')](_0x473b7f[_0xb53e('0x53')],{'messageId':_0x26cdd6['messageId'],'sentAt':moment()[_0xb53e('0x8a')](_0xb53e('0xa2')),'read':!![],'MailAccountId':_0x2e665e['id'],'UserId':_0x473b7f[_0xb53e('0x67')]['id'],'ContactId':_0x24ea84['id']})]};if(_0x473b7f[_0xb53e('0x53')][_0xb53e('0xa3')]){_0x1a2b13=_[_0xb53e('0x47')](_0x1a2b13,_0x473b7f[_0xb53e('0x53')][_0xb53e('0xa3')]);}return db[_0xb53e('0x78')][_0xb53e('0x58')](_0x1a2b13,{'include':[{'model':db[_0xb53e('0x87')],'as':_0xb53e('0xa4')}]});}})[_0xb53e('0x1c')](respondWithResult(_0x5949a1,null))['catch'](handleError(_0x5949a1,null));};exports[_0xb53e('0xa5')]=function(_0x377c43,_0x1f8fdc,_0x35d74a){return db['MailAccount']['find']({'where':{'id':_0x377c43['params']['id']},'include':[{'model':db[_0xb53e('0x4f')],'as':_0xb53e('0x34'),'raw':!![]}]})[_0xb53e('0x1c')](handleEntityNotFound(_0x1f8fdc,null))[_0xb53e('0x1c')](function(_0x38025d){if(_0x38025d&&_0x38025d[_0xb53e('0x34')]){var _0x4c0d2c={'id':_0x38025d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x38025d[_0xb53e('0x34')][_0xb53e('0x6e')]){_0x4c0d2c[_0xb53e('0x6e')]=_0x38025d[_0xb53e('0x34')]['service'];}else{_0x4c0d2c[_0xb53e('0x6c')]=_0x38025d['Smtp'][_0xb53e('0x6c')];_0x4c0d2c[_0xb53e('0x6d')]=_0x38025d[_0xb53e('0x34')][_0xb53e('0x6d')];_0x4c0d2c[_0xb53e('0x97')]=_0x38025d[_0xb53e('0x34')][_0xb53e('0x97')];}if(_0x38025d['Smtp']['authentication']){_0x4c0d2c['auth']={'user':_0x38025d[_0xb53e('0x34')][_0xb53e('0x67')],'pass':_0x38025d[_0xb53e('0x34')][_0xb53e('0x69')]};}return respondWithRpcPromise(_0xb53e('0xa6'),'verifySmtp',{'account':_0x4c0d2c});}})[_0xb53e('0x1c')](respondWithResult(_0x1f8fdc,null))[_0xb53e('0x26')](handleError(_0x1f8fdc,null));};exports[_0xb53e('0x83')]=function(_0x6419d4,_0x3e8c9a){return db['MailAccount'][_0xb53e('0x52')]({'where':{'id':_0x6419d4[_0xb53e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3e8c9a,null))[_0xb53e('0x1c')](function(_0x51f65f){if(_0x51f65f&&_0x51f65f[_0xb53e('0x6e')]){throw new db['Sequelize'][(_0xb53e('0xa7'))](_0xb53e('0xa8'));}return _0x51f65f;})[_0xb53e('0x1c')](removeEntity(_0x3e8c9a,null))[_0xb53e('0x26')](handleError(_0x3e8c9a,null));};exports[_0xb53e('0xa9')]=function(_0x2bc073,_0x4acdda,_0x5ead98){return db[_0xb53e('0x35')][_0xb53e('0x52')]({'where':{'id':_0x2bc073[_0xb53e('0x4e')]['id']}})[_0xb53e('0x1c')](handleEntityNotFound(_0x4acdda,null))[_0xb53e('0x1c')](function(_0x557389){if(_0x557389){return _0x557389[_0xb53e('0xa9')](_0x2bc073[_0xb53e('0x53')][_0xb53e('0x5d')],_[_0xb53e('0x79')](_0x2bc073[_0xb53e('0x53')],['ids','id'])||{})[_0xb53e('0xaa')](function(_0x5821de){for(var _0x35a98d=0x0;_0x35a98d<_0x2bc073[_0xb53e('0x53')][_0xb53e('0x5d')][_0xb53e('0x3e')];_0x35a98d+=0x1){socket['emit']('userMailAccount:save',{'UserId':_0x2bc073[_0xb53e('0x53')][_0xb53e('0x5d')][_0x35a98d],'MailAccountId':_0x2bc073[_0xb53e('0x4e')]['id']});}return _0x5821de;});}})[_0xb53e('0x1c')](respondWithResult(_0x4acdda,null))['catch'](handleError(_0x4acdda,null));};exports[_0xb53e('0xab')]=function(_0x24369b,_0x8b2c78,_0x539323){var _0x93718b;return db[_0xb53e('0x35')][_0xb53e('0x52')]({'where':{'id':_0x24369b[_0xb53e('0x4e')]['id']}})[_0xb53e('0x1c')](handleEntityNotFound(_0x8b2c78,null))[_0xb53e('0x1c')](function(_0x2fbfe3){if(_0x2fbfe3){return _0x2fbfe3[_0xb53e('0xab')](_0x24369b['query']['ids'])[_0xb53e('0x1c')](function(_0x2afd27){if(_[_0xb53e('0xac')](_0x24369b[_0xb53e('0x38')][_0xb53e('0x5d')])){for(var _0x19c2f3=0x0;_0x19c2f3<_0x24369b[_0xb53e('0x38')]['ids']['length'];_0x19c2f3+=0x1){socket[_0xb53e('0xad')]('userMailAccount:remove',{'UserId':_0x24369b['query'][_0xb53e('0x5d')][_0x19c2f3],'MailAccountId':_0x24369b[_0xb53e('0x4e')]['id']});}}else{socket[_0xb53e('0xad')]('userMailAccount:remove',{'UserId':_0x24369b[_0xb53e('0x38')][_0xb53e('0x5d')],'MailAccountId':_0x24369b[_0xb53e('0x4e')]['id']});}});}})[_0xb53e('0x1c')](respondWithStatusCode(_0x8b2c78,null))[_0xb53e('0x26')](handleError(_0x8b2c78,null));};exports[_0xb53e('0xae')]=function(_0x2b9262,_0x4b8729,_0x10b571){var _0x506224={};var _0x55c700={};var _0x5cd853;var _0x2d4708;return db[_0xb53e('0x35')][_0xb53e('0x59')]({'where':{'id':_0x2b9262[_0xb53e('0x4e')]['id']}})[_0xb53e('0x1c')](handleEntityNotFound(_0x4b8729,null))[_0xb53e('0x1c')](function(_0x440ece){if(_0x440ece){_0x5cd853=_0x440ece;_0x55c700['model']=_[_0xb53e('0x37')](db[_0xb53e('0xaf')][_0xb53e('0x50')]);_0x55c700[_0xb53e('0x38')]=_[_0xb53e('0x37')](_0x2b9262[_0xb53e('0x38')]);_0x55c700[_0xb53e('0x45')]=_[_0xb53e('0x3b')](_0x55c700[_0xb53e('0x36')],_0x55c700[_0xb53e('0x38')]);_0x506224[_0xb53e('0x3c')]=_[_0xb53e('0x3b')](_0x55c700[_0xb53e('0x36')],qs[_0xb53e('0x3d')](_0x2b9262[_0xb53e('0x38')]['fields']));_0x506224['attributes']=_0x506224['attributes'][_0xb53e('0x3e')]?_0x506224[_0xb53e('0x3c')]:_0x55c700[_0xb53e('0x36')];_0x506224['order']=qs[_0xb53e('0x42')](_0x2b9262['query'][_0xb53e('0x42')]);_0x506224['where']=qs[_0xb53e('0x45')](_[_0xb53e('0x44')](_0x2b9262['query'],_0x55c700[_0xb53e('0x45')]));if(_0x2b9262[_0xb53e('0x38')][_0xb53e('0x48')]){_0x506224[_0xb53e('0x43')]=_[_0xb53e('0x47')](_0x506224['where'],{'$or':_['map'](_0x506224[_0xb53e('0x3c')],function(_0x48d089){var _0x5ea932={};_0x5ea932[_0x48d089]={'$like':'%'+_0x2b9262[_0xb53e('0x38')][_0xb53e('0x48')]+'%'};return _0x5ea932;})});}_0x506224=_[_0xb53e('0x47')]({},_0x506224,_0x2b9262[_0xb53e('0x4a')]);return _0x5cd853['getAgents'](_0x506224);}})[_0xb53e('0x1c')](function(_0x4c17e7){if(_0x4c17e7){_0x2d4708=_0x4c17e7[_0xb53e('0x3e')];if(!_0x2b9262[_0xb53e('0x38')][_0xb53e('0x5a')](_0xb53e('0x3f'))){_0x506224[_0xb53e('0x2a')]=qs[_0xb53e('0x2a')](_0x2b9262[_0xb53e('0x38')][_0xb53e('0x2a')]);_0x506224[_0xb53e('0x40')]=qs[_0xb53e('0x40')](_0x2b9262[_0xb53e('0x38')]['offset']);}return _0x5cd853[_0xb53e('0xae')](_0x506224);}})[_0xb53e('0x1c')](function(_0x820ec3){if(_0x820ec3){return _0x820ec3?{'count':_0x2d4708,'rows':_0x820ec3}:null;}})[_0xb53e('0x1c')](respondWithResult(_0x4b8729,null))[_0xb53e('0x26')](handleError(_0x4b8729,null));};
\ No newline at end of file
index 1e3d316..bb16686 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cbc=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x143e89,_0x5cb0ba){var _0x4aa264=function(_0x434d7c){while(--_0x434d7c){_0x143e89['push'](_0x143e89['shift']());}};_0x4aa264(++_0x5cb0ba);}(_0x3cbc,0x1bf));var _0xc3cb=function(_0x17e539,_0x14d34d){_0x17e539=_0x17e539-0x0;var _0x29d1b7=_0x3cbc[_0x17e539];return _0x29d1b7;};'use strict';var EventEmitter=require(_0xc3cb('0x0'));var MailAccount=require(_0xc3cb('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xc3cb('0x2')](0x0);var events={'afterCreate':_0xc3cb('0x3'),'afterUpdate':_0xc3cb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x54f07b){return function(_0x439c2f,_0x451e41,_0x339439){MailAccountEvents[_0xc3cb('0x5')](_0x54f07b+':'+_0x439c2f['id'],_0x439c2f);MailAccountEvents['emit'](_0x54f07b,_0x439c2f);_0x339439(null);};}for(var e in events){if(events[_0xc3cb('0x6')](e)){var event=events[e];MailAccount[_0xc3cb('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents;
\ No newline at end of file
+var _0x3189=['update','remove','emit','hasOwnProperty','events','../../mysqldb','MailAccount','save'];(function(_0x52096b,_0x20bab4){var _0x2b1cc7=function(_0x3f7021){while(--_0x3f7021){_0x52096b['push'](_0x52096b['shift']());}};_0x2b1cc7(++_0x20bab4);}(_0x3189,0x1dc));var _0x9318=function(_0x9ead33,_0x330699){_0x9ead33=_0x9ead33-0x0;var _0x18eff0=_0x3189[_0x9ead33];return _0x18eff0;};'use strict';var EventEmitter=require(_0x9318('0x0'));var MailAccount=require(_0x9318('0x1'))['db'][_0x9318('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9318('0x3'),'afterUpdate':_0x9318('0x4'),'afterDestroy':_0x9318('0x5')};function emitEvent(_0x84234c){return function(_0x303ecd,_0x2fb61a,_0x7e10d8){MailAccountEvents['emit'](_0x84234c+':'+_0x303ecd['id'],_0x303ecd);MailAccountEvents[_0x9318('0x6')](_0x84234c,_0x303ecd);_0x7e10d8(null);};}for(var e in events){if(events[_0x9318('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents;
\ No newline at end of file
index 348c86d..219a050 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1737=['MailAccount','mail_accounts','util','../../config/logger','api','./mailAccount.attributes','exports','define'];(function(_0x1aa2d9,_0x586518){var _0x20684d=function(_0xbd9490){while(--_0xbd9490){_0x1aa2d9['push'](_0x1aa2d9['shift']());}};_0x20684d(++_0x586518);}(_0x1737,0x8a));var _0x7173=function(_0x8f041e,_0x5f03c8){_0x8f041e=_0x8f041e-0x0;var _0x2a067d=_0x1737[_0x8f041e];return _0x2a067d;};'use strict';var _=require('lodash');var util=require(_0x7173('0x0'));var logger=require(_0x7173('0x1'))(_0x7173('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x7173('0x3'));module[_0x7173('0x4')]=function(_0x2ad74d,_0x12a961){return _0x2ad74d[_0x7173('0x5')](_0x7173('0x6'),attributes,{'tableName':_0x7173('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x447a=['util','../../config/logger','api','moment','bluebird','request-promise','./mailAccount.attributes','exports','define','MailAccount','lodash'];(function(_0x536870,_0x4e52b4){var _0x273622=function(_0x1f3ed0){while(--_0x1f3ed0){_0x536870['push'](_0x536870['shift']());}};_0x273622(++_0x4e52b4);}(_0x447a,0xfc));var _0xa447=function(_0x52a8da,_0x5d9213){_0x52a8da=_0x52a8da-0x0;var _0x5e9460=_0x447a[_0x52a8da];return _0x5e9460;};'use strict';var _=require(_0xa447('0x0'));var util=require(_0xa447('0x1'));var logger=require(_0xa447('0x2'))(_0xa447('0x3'));var moment=require(_0xa447('0x4'));var BPromise=require(_0xa447('0x5'));var rp=require(_0xa447('0x6'));var attributes=require(_0xa447('0x7'));module[_0xa447('0x8')]=function(_0x78724d,_0x3e91f1){return _0x78724d[_0xa447('0x9')](_0xa447('0xa'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4ee0ecf..c9bcb76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cf0=['asc','autoclose','length','close','*,*,*,*','defaults','create','List\x20not\x20found','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','format','interaction','created','attachments','originCc','bcc','Attachments','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','socket.io-emitter','localhost','register','then','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','model','map','info','stringify','ShowMailAccount','find','NotifyMailAccount','body','difference','keys','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','account','CmList','List','CmContact','Contacts','DESC','Applications','MailServerOut','Smtp','applications','list','orderBy','priority'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x5cf0,0x87));var _0x05cf=function(_0x432682,_0x514474){_0x432682=_0x432682-0x0;var _0x571e46=_0x5cf0[_0x432682];return _0x571e46;};'use strict';var _=require(_0x05cf('0x0'));var util=require(_0x05cf('0x1'));var moment=require(_0x05cf('0x2'));var BPromise=require(_0x05cf('0x3'));var rs=require('randomstring');var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x05cf('0x4'));var logger=require(_0x05cf('0x5'))(_0x05cf('0x6'));var config=require(_0x05cf('0x7'));var jayson=require(_0x05cf('0x8'));var client=jayson['client'][_0x05cf('0x9')]({'port':0x232c});var socket=require(_0x05cf('0xa'))({'host':_0x05cf('0xb'),'port':0x18eb});require('./mailAccount.socket')[_0x05cf('0xc')](socket);function respondWithRpcPromise(_0x13444b,_0x429a18,_0x1738c7){return new BPromise(function(_0xe5b114,_0x384f15){return client['request'](_0x13444b,_0x1738c7)[_0x05cf('0xd')](function(_0x3ecbb6){logger['info']('MailAccount,\x20%s,\x20%s',_0x429a18,_0x05cf('0xe'));logger[_0x05cf('0xf')](_0x05cf('0x10'),_0x429a18,_0x05cf('0xe'),JSON['stringify'](_0x3ecbb6));if(_0x3ecbb6[_0x05cf('0x11')]){if(_0x3ecbb6[_0x05cf('0x11')][_0x05cf('0x12')]===0x1f4){logger[_0x05cf('0x11')](_0x05cf('0x13'),_0x429a18,_0x3ecbb6[_0x05cf('0x11')]['message']);return _0x384f15(_0x3ecbb6[_0x05cf('0x11')][_0x05cf('0x14')]);}logger[_0x05cf('0x11')](_0x05cf('0x13'),_0x429a18,_0x3ecbb6[_0x05cf('0x11')]['message']);return _0xe5b114(_0x3ecbb6[_0x05cf('0x11')][_0x05cf('0x14')]);}else{logger['info'](_0x05cf('0x13'),_0x429a18,_0x05cf('0xe'));_0xe5b114(_0x3ecbb6['result'][_0x05cf('0x14')]);}})[_0x05cf('0x15')](function(_0x43c935){logger[_0x05cf('0x11')](_0x05cf('0x13'),_0x429a18,_0x43c935);_0x384f15(_0x43c935);});});}exports[_0x05cf('0x16')]=function(_0x12c6a4){var _0x4ba909=this;return new Promise(function(_0x42be22,_0x104c6e){return db[_0x05cf('0x17')][_0x05cf('0x18')]({'raw':_0x12c6a4['options']?_0x12c6a4[_0x05cf('0x19')][_0x05cf('0x1a')]===undefined?!![]:![]:!![],'where':_0x12c6a4[_0x05cf('0x19')]?_0x12c6a4['options'][_0x05cf('0x1b')]||null:null,'attributes':_0x12c6a4[_0x05cf('0x19')]?_0x12c6a4['options'][_0x05cf('0x1c')]||null:null,'limit':_0x12c6a4[_0x05cf('0x19')]?_0x12c6a4[_0x05cf('0x19')][_0x05cf('0x1d')]||null:null,'include':_0x12c6a4['options']?_0x12c6a4[_0x05cf('0x19')]['include']?_['map'](_0x12c6a4[_0x05cf('0x19')][_0x05cf('0x1e')],function(_0x682f4){return{'model':db[_0x682f4[_0x05cf('0x1f')]],'as':_0x682f4['as'],'attributes':_0x682f4[_0x05cf('0x1c')],'include':_0x682f4[_0x05cf('0x1e')]?_[_0x05cf('0x20')](_0x682f4['include'],function(_0x44cb59){return{'model':db[_0x44cb59['model']],'as':_0x44cb59['as'],'attributes':_0x44cb59['attributes'],'include':_0x44cb59['include']?_[_0x05cf('0x20')](_0x44cb59['include'],function(_0x17d567){return{'model':db[_0x17d567['model']],'as':_0x17d567['as'],'attributes':_0x17d567[_0x05cf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x05cf('0xd')](function(_0x387dc9){logger[_0x05cf('0x21')](_0x05cf('0x16'),_0x12c6a4);logger[_0x05cf('0xf')]('GetMailAccount',_0x12c6a4,JSON[_0x05cf('0x22')](_0x387dc9));_0x42be22(_0x387dc9);})[_0x05cf('0x15')](function(_0x443a45){logger['error']('GetMailAccount',_0x443a45[_0x05cf('0x14')],_0x12c6a4);_0x104c6e(_0x4ba909[_0x05cf('0x11')](0x1f4,_0x443a45[_0x05cf('0x14')]));});});};exports[_0x05cf('0x23')]=function(_0x35a516){var _0x3e2a82=this;return new Promise(function(_0x58f258,_0x58fd23){return db[_0x05cf('0x17')][_0x05cf('0x24')]({'raw':_0x35a516[_0x05cf('0x19')]?_0x35a516['options'][_0x05cf('0x1a')]===undefined?!![]:![]:!![],'where':_0x35a516[_0x05cf('0x19')]?_0x35a516[_0x05cf('0x19')]['where']||null:null,'attributes':_0x35a516[_0x05cf('0x19')]?_0x35a516[_0x05cf('0x19')][_0x05cf('0x1c')]||null:null,'include':_0x35a516['options']?_0x35a516[_0x05cf('0x19')][_0x05cf('0x1e')]?_[_0x05cf('0x20')](_0x35a516[_0x05cf('0x19')][_0x05cf('0x1e')],function(_0x2f19e9){return{'model':db[_0x2f19e9[_0x05cf('0x1f')]],'as':_0x2f19e9['as'],'attributes':_0x2f19e9[_0x05cf('0x1c')],'include':_0x2f19e9[_0x05cf('0x1e')]?_['map'](_0x2f19e9[_0x05cf('0x1e')],function(_0x5b305c){return{'model':db[_0x5b305c[_0x05cf('0x1f')]],'as':_0x5b305c['as'],'attributes':_0x5b305c[_0x05cf('0x1c')],'include':_0x5b305c[_0x05cf('0x1e')]?_[_0x05cf('0x20')](_0x5b305c['include'],function(_0xc0100c){return{'model':db[_0xc0100c[_0x05cf('0x1f')]],'as':_0xc0100c['as'],'attributes':_0xc0100c[_0x05cf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x05cf('0xd')](function(_0x69a1cb){logger[_0x05cf('0x21')]('ShowMailAccount',_0x35a516);logger[_0x05cf('0xf')](_0x05cf('0x23'),_0x35a516,JSON[_0x05cf('0x22')](_0x69a1cb));_0x58f258(_0x69a1cb);})[_0x05cf('0x15')](function(_0x335623){logger[_0x05cf('0x11')](_0x05cf('0x23'),_0x335623[_0x05cf('0x14')],_0x35a516);_0x58fd23(_0x3e2a82['error'](0x1f4,_0x335623[_0x05cf('0x14')]));});});};exports[_0x05cf('0x25')]=function(_0x4253b4){var _0x1c89bc=this;return new Promise(function(_0x5bf568,_0x59a1af){var _0x361e04={'body':_0x4253b4[_0x05cf('0x26')],'channel':'mail'};var _0x2f0c3b=_[_0x05cf('0x27')](_[_0x05cf('0x28')](db['CmContact']['rawAttributes']),[_0x05cf('0x29'),'updatedAt',_0x05cf('0x2a'),_0x05cf('0x2b')]);var _0x5d408f=![];if(_0x4253b4['body']['id']){delete _0x4253b4[_0x05cf('0x26')]['id'];}if(_[_0x05cf('0x2c')](_0x4253b4[_0x05cf('0x26')][_0x05cf('0x2d')])){return _0x59a1af(_0x1c89bc[_0x05cf('0x11')](0x1f4,_0x05cf('0x2e')));}if(_[_0x05cf('0x2c')](_0x4253b4[_0x05cf('0x26')]['body'])||_0x4253b4['body']['body']===''){return _0x59a1af(_0x1c89bc[_0x05cf('0x11')](0x1f4,_0x05cf('0x2f')));}if(_[_0x05cf('0x2c')](_0x4253b4[_0x05cf('0x26')]['mapKey'])){return _0x59a1af(_0x1c89bc[_0x05cf('0x11')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2f0c3b));}if(!_[_0x05cf('0x30')](_0x2f0c3b,_0x4253b4[_0x05cf('0x26')][_0x05cf('0x31')])){return _0x59a1af(_0x1c89bc[_0x05cf('0x11')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2f0c3b));}var _0x1330c3={};_0x1330c3[_0x4253b4[_0x05cf('0x26')]['mapKey']]=_0x4253b4['body']['from'];return db['MailAccount'][_0x05cf('0x24')]({'where':{'id':_0x4253b4[_0x05cf('0x32')]['id']},'include':[{'model':db[_0x05cf('0x33')],'as':_0x05cf('0x34'),'include':[{'model':db[_0x05cf('0x35')],'as':_0x05cf('0x36'),'where':_0x1330c3,'limit':0x1,'order':[['updatedAt',_0x05cf('0x37')]]}]},{'model':db['MailApplication'],'as':_0x05cf('0x38')},{'model':db[_0x05cf('0x39')],'as':_0x05cf('0x3a')}]})[_0x05cf('0xd')](function(_0xd737ed){if(_0xd737ed&&_0xd737ed[_0x05cf('0x34')]){var _0x50bd3a=_0xd737ed['get']({'plain':!![]});_0x361e04[_0x05cf('0x32')]=_['omit'](_0x50bd3a,[_0x05cf('0x38'),'List']);_0x361e04[_0x05cf('0x3b')]=_0x50bd3a[_0x05cf('0x38')];_0x361e04[_0x05cf('0x3c')]=_0x50bd3a[_0x05cf('0x34')];_0x361e04[_0x05cf('0x3b')]=_[_0x05cf('0x3d')](_0x361e04[_0x05cf('0x3b')],[_0x05cf('0x3e')],[_0x05cf('0x3f')]);if(_0x361e04[_0x05cf('0x32')]&&_0x361e04['account'][_0x05cf('0x40')]){_0x361e04[_0x05cf('0x3b')]['push']({'id':0x0,'priority':_0x361e04[_0x05cf('0x3b')][_0x05cf('0x41')]+0x1,'app':_0x05cf('0x42'),'appdata':'autoclose','interval':_0x05cf('0x43')});}if(_0x361e04[_0x05cf('0x32')][_0x05cf('0x38')]){delete _0x361e04['account'][_0x05cf('0x38')];}if(_0x361e04['account'][_0x05cf('0x34')]){delete _0x361e04[_0x05cf('0x32')][_0x05cf('0x34')];}if(_0x50bd3a[_0x05cf('0x34')][_0x05cf('0x36')][_0x05cf('0x41')]){return _0x50bd3a[_0x05cf('0x34')]['Contacts'][0x0];}var _0x2b3587=_[_0x05cf('0x44')](_0x4253b4['body'],{'firstName':_0x4253b4['body']['from'],'ListId':_0x50bd3a['ListId']});_0x2b3587[_0x4253b4[_0x05cf('0x26')][_0x05cf('0x31')]]=_0x4253b4[_0x05cf('0x26')][_0x05cf('0x2d')];return db[_0x05cf('0x35')][_0x05cf('0x45')](_0x2b3587);}else{throw new Error(_0x05cf('0x46'));}})['then'](function(_0x563c9a){_0x361e04[_0x05cf('0x47')]=_0x563c9a;if(_0x563c9a){if(!_0x4253b4[_0x05cf('0x26')][_0x05cf('0x14')][_0x05cf('0x48')]){_0x4253b4['body'][_0x05cf('0x14')][_0x05cf('0x48')]=rs[_0x05cf('0x49')]()+'\x20'+_0x4253b4[_0x05cf('0x26')][_0x05cf('0x14')][_0x05cf('0x2d')];}var _0x540593={'ContactId':_0x563c9a['id'],'MailAccountId':_0x4253b4[_0x05cf('0x32')]['id'],'inReplyTo':_0x4253b4[_0x05cf('0x26')]['message'][_0x05cf('0x48')],'to':_0x4253b4[_0x05cf('0x26')][_0x05cf('0x14')][_0x05cf('0x2d')],'cc':_0x4253b4[_0x05cf('0x26')][_0x05cf('0x14')]['cc'],'subject':_0x4253b4['body'][_0x05cf('0x14')][_0x05cf('0x4a')],'attach':_0x4253b4[_0x05cf('0x26')]['message'][_0x05cf('0x4b')],'lastMsgAt':moment()['format'](_0x05cf('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0x4253b4[_0x05cf('0x26')][_0x05cf('0x26')]};return db[_0x05cf('0x4d')][_0x05cf('0x24')]({'where':{'closed':![],'MailAccountId':_0x4253b4[_0x05cf('0x32')]['id']},'include':[{'model':db[_0x05cf('0x4e')],'as':_0x05cf('0x4f'),'attributes':['messageId'],'where':{'messageId':_0x4253b4['body'][_0x05cf('0x14')][_0x05cf('0x50')]}}]})[_0x05cf('0xd')](function(_0x585b6f){if(_0x585b6f){return[_0x585b6f,![]];}return db[_0x05cf('0x4d')][_0x05cf('0x45')](_0x540593)[_0x05cf('0xd')](function(_0x21c075){return[_0x21c075,!![]];});});}else{throw new Error(_0x05cf('0x51'));}})[_0x05cf('0x52')](function(_0x1e9c2b,_0x3bbc12){if(_0x1e9c2b){_0x5d408f=_0x3bbc12;if(!_0x3bbc12){return _0x1e9c2b[_0x05cf('0x53')]({'inReplyTo':_0x4253b4[_0x05cf('0x26')]['message'][_0x05cf('0x48')],'to':_0x4253b4[_0x05cf('0x26')]['message'][_0x05cf('0x2d')],'cc':_0x4253b4['body']['message']['cc'],'subject':_0x4253b4['body'][_0x05cf('0x14')]['subject'],'attach':_0x1e9c2b[_0x05cf('0x4b')]?_0x1e9c2b[_0x05cf('0x4b')]:_0x4253b4[_0x05cf('0x26')][_0x05cf('0x14')][_0x05cf('0x4b')],'substatus':null,'substatusAt':moment()['format'](_0x05cf('0x4c')),'lastMsgAt':moment()[_0x05cf('0x54')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x4253b4[_0x05cf('0x26')][_0x05cf('0x26')]});}else{return _0x1e9c2b;}}})[_0x05cf('0xd')](function(_0x175f8e){_0x361e04[_0x05cf('0x55')]=_0x175f8e['get']({'plain':!![]});_0x361e04[_0x05cf('0x55')][_0x05cf('0x56')]=_0x5d408f;return db[_0x05cf('0x4e')]['create']({'body':_0x4253b4['body']['body'],'MailAccountId':_0x4253b4['account']['id'],'MailInteractionId':_0x175f8e['id'],'direction':'in','ContactId':_0x361e04[_0x05cf('0x47')]['id'],'messageId':_0x4253b4[_0x05cf('0x26')]['message']['messageId'],'from':_0x4253b4['body'][_0x05cf('0x14')][_0x05cf('0x2d')],'to':_0x4253b4[_0x05cf('0x26')][_0x05cf('0x14')]['to'],'cc':_0x4253b4[_0x05cf('0x26')][_0x05cf('0x14')]['cc'],'subject':_0x4253b4[_0x05cf('0x26')][_0x05cf('0x14')][_0x05cf('0x4a')],'attach':_0x4253b4[_0x05cf('0x26')][_0x05cf('0x14')][_0x05cf('0x4b')],'Attachments':_0x4253b4['body'][_0x05cf('0x14')][_0x05cf('0x57')],'originTo':_0x4253b4['body'][_0x05cf('0x14')]['originTo'],'originCc':_0x4253b4[_0x05cf('0x26')][_0x05cf('0x14')][_0x05cf('0x58')],'bcc':_0x4253b4[_0x05cf('0x26')]['message'][_0x05cf('0x59')]},{'include':[{'model':db['Attachment'],'as':_0x05cf('0x5a')}]});})[_0x05cf('0xd')](function(_0x40d1f8){_0x361e04['message']=_0x40d1f8;if(_0x361e04[_0x05cf('0x55')][_0x05cf('0x5b')]){return db[_0x05cf('0x5c')]['find']({'attributes':['id','name'],'where':{'id':_0x361e04['interaction'][_0x05cf('0x5b')]}})[_0x05cf('0xd')](function(_0xa785b7){if(_0xa785b7){_0x361e04[_0x05cf('0x3b')][_0x05cf('0x5d')]({'id':0x0,'priority':0x0,'app':_0x05cf('0x5e'),'appdata':_0xa785b7[_0x05cf('0x5f')]+','+(_0x361e04[_0x05cf('0x32')][_0x05cf('0x60')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x05cf('0x61'),'startRouting',_0x361e04);});}return respondWithRpcPromise(_0x05cf('0x61'),_0x05cf('0x62'),_0x361e04);})[_0x05cf('0xd')](function(_0x3c0f83){_0x5bf568(_0x3c0f83);})[_0x05cf('0x15')](function(_0x133d67){_0x59a1af(_0x1c89bc[_0x05cf('0x11')](0x1f4,_0x133d67[_0x05cf('0x14')]));});});};
\ No newline at end of file
+var _0x9a0f=['options','raw','where','limit','include','map','model','attributes','stringify','ShowMailAccount','find','catch','NotifyMailAccount','mail','difference','CmContact','createdAt','CompanyId','ListId','body','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','account','List','Contacts','updatedAt','DESC','MailApplication','Applications','Smtp','get','omit','applications','list','orderBy','priority','asc','autoclose','push','length','*,*,*,*','create','List\x20not\x20found','contact','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','spread','update','format','interaction','created','originTo','originCc','bcc','Attachment','Attachments','UserId','name','unshift','Start','startRouting','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','./mailAccount.socket','register','request','then','info','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll'];(function(_0x52b07c,_0x45d069){var _0x1f32f7=function(_0x504cfe){while(--_0x504cfe){_0x52b07c['push'](_0x52b07c['shift']());}};_0x1f32f7(++_0x45d069);}(_0x9a0f,0x113));var _0xf9a0=function(_0x3eeaee,_0x55727e){_0x3eeaee=_0x3eeaee-0x0;var _0x182ece=_0x9a0f[_0x3eeaee];return _0x182ece;};'use strict';var _=require(_0xf9a0('0x0'));var util=require(_0xf9a0('0x1'));var moment=require(_0xf9a0('0x2'));var BPromise=require('bluebird');var rs=require(_0xf9a0('0x3'));var fs=require('fs');var db=require(_0xf9a0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf9a0('0x5'))(_0xf9a0('0x6'));var config=require(_0xf9a0('0x7'));var jayson=require(_0xf9a0('0x8'));var client=jayson[_0xf9a0('0x9')][_0xf9a0('0xa')]({'port':0x232c});var socket=require('socket.io-emitter')({'host':_0xf9a0('0xb'),'port':0x18eb});require(_0xf9a0('0xc'))[_0xf9a0('0xd')](socket);function respondWithRpcPromise(_0x521efb,_0xfd4b04,_0x174550){return new BPromise(function(_0x296d41,_0x35ea2d){return client[_0xf9a0('0xe')](_0x521efb,_0x174550)[_0xf9a0('0xf')](function(_0x160a98){logger[_0xf9a0('0x10')]('MailAccount,\x20%s,\x20%s',_0xfd4b04,'request\x20sent');logger[_0xf9a0('0x11')](_0xf9a0('0x12'),_0xfd4b04,_0xf9a0('0x13'),JSON['stringify'](_0x160a98));if(_0x160a98[_0xf9a0('0x14')]){if(_0x160a98[_0xf9a0('0x14')][_0xf9a0('0x15')]===0x1f4){logger[_0xf9a0('0x14')](_0xf9a0('0x16'),_0xfd4b04,_0x160a98[_0xf9a0('0x14')][_0xf9a0('0x17')]);return _0x35ea2d(_0x160a98['error'][_0xf9a0('0x17')]);}logger[_0xf9a0('0x14')]('MailAccount,\x20%s,\x20%s',_0xfd4b04,_0x160a98[_0xf9a0('0x14')]['message']);return _0x296d41(_0x160a98[_0xf9a0('0x14')][_0xf9a0('0x17')]);}else{logger[_0xf9a0('0x10')](_0xf9a0('0x16'),_0xfd4b04,'request\x20sent');_0x296d41(_0x160a98[_0xf9a0('0x18')]['message']);}})['catch'](function(_0x5503){logger['error'](_0xf9a0('0x16'),_0xfd4b04,_0x5503);_0x35ea2d(_0x5503);});});}exports[_0xf9a0('0x19')]=function(_0x406314){var _0x3e5ff0=this;return new Promise(function(_0x20006e,_0x86162a){return db[_0xf9a0('0x1a')][_0xf9a0('0x1b')]({'raw':_0x406314[_0xf9a0('0x1c')]?_0x406314['options'][_0xf9a0('0x1d')]===undefined?!![]:![]:!![],'where':_0x406314[_0xf9a0('0x1c')]?_0x406314['options'][_0xf9a0('0x1e')]||null:null,'attributes':_0x406314[_0xf9a0('0x1c')]?_0x406314[_0xf9a0('0x1c')]['attributes']||null:null,'limit':_0x406314['options']?_0x406314[_0xf9a0('0x1c')][_0xf9a0('0x1f')]||null:null,'include':_0x406314[_0xf9a0('0x1c')]?_0x406314[_0xf9a0('0x1c')][_0xf9a0('0x20')]?_[_0xf9a0('0x21')](_0x406314['options'][_0xf9a0('0x20')],function(_0x475734){return{'model':db[_0x475734[_0xf9a0('0x22')]],'as':_0x475734['as'],'attributes':_0x475734[_0xf9a0('0x23')],'include':_0x475734[_0xf9a0('0x20')]?_[_0xf9a0('0x21')](_0x475734[_0xf9a0('0x20')],function(_0x526ffc){return{'model':db[_0x526ffc['model']],'as':_0x526ffc['as'],'attributes':_0x526ffc[_0xf9a0('0x23')],'include':_0x526ffc[_0xf9a0('0x20')]?_[_0xf9a0('0x21')](_0x526ffc[_0xf9a0('0x20')],function(_0x589748){return{'model':db[_0x589748[_0xf9a0('0x22')]],'as':_0x589748['as'],'attributes':_0x589748[_0xf9a0('0x23')]};}):[]};}):[]};}):[]:[]})[_0xf9a0('0xf')](function(_0x226912){logger['info'](_0xf9a0('0x19'),_0x406314);logger['debug'](_0xf9a0('0x19'),_0x406314,JSON[_0xf9a0('0x24')](_0x226912));_0x20006e(_0x226912);})['catch'](function(_0x591d2a){logger['error'](_0xf9a0('0x19'),_0x591d2a[_0xf9a0('0x17')],_0x406314);_0x86162a(_0x3e5ff0[_0xf9a0('0x14')](0x1f4,_0x591d2a[_0xf9a0('0x17')]));});});};exports[_0xf9a0('0x25')]=function(_0x3994df){var _0x46b716=this;return new Promise(function(_0x44b96e,_0x2e2d6b){return db[_0xf9a0('0x1a')][_0xf9a0('0x26')]({'raw':_0x3994df[_0xf9a0('0x1c')]?_0x3994df[_0xf9a0('0x1c')][_0xf9a0('0x1d')]===undefined?!![]:![]:!![],'where':_0x3994df['options']?_0x3994df['options'][_0xf9a0('0x1e')]||null:null,'attributes':_0x3994df['options']?_0x3994df[_0xf9a0('0x1c')][_0xf9a0('0x23')]||null:null,'include':_0x3994df[_0xf9a0('0x1c')]?_0x3994df[_0xf9a0('0x1c')][_0xf9a0('0x20')]?_[_0xf9a0('0x21')](_0x3994df[_0xf9a0('0x1c')]['include'],function(_0x33270c){return{'model':db[_0x33270c[_0xf9a0('0x22')]],'as':_0x33270c['as'],'attributes':_0x33270c[_0xf9a0('0x23')],'include':_0x33270c[_0xf9a0('0x20')]?_['map'](_0x33270c[_0xf9a0('0x20')],function(_0x1a06cc){return{'model':db[_0x1a06cc[_0xf9a0('0x22')]],'as':_0x1a06cc['as'],'attributes':_0x1a06cc['attributes'],'include':_0x1a06cc[_0xf9a0('0x20')]?_[_0xf9a0('0x21')](_0x1a06cc['include'],function(_0xed1eb){return{'model':db[_0xed1eb[_0xf9a0('0x22')]],'as':_0xed1eb['as'],'attributes':_0xed1eb['attributes']};}):[]};}):[]};}):[]:[]})[_0xf9a0('0xf')](function(_0x5d9cf7){logger[_0xf9a0('0x10')](_0xf9a0('0x25'),_0x3994df);logger['debug'](_0xf9a0('0x25'),_0x3994df,JSON[_0xf9a0('0x24')](_0x5d9cf7));_0x44b96e(_0x5d9cf7);})[_0xf9a0('0x27')](function(_0x1046c9){logger['error'](_0xf9a0('0x25'),_0x1046c9[_0xf9a0('0x17')],_0x3994df);_0x2e2d6b(_0x46b716[_0xf9a0('0x14')](0x1f4,_0x1046c9['message']));});});};exports[_0xf9a0('0x28')]=function(_0x21b98b){var _0x77f780=this;return new Promise(function(_0x27a2eb,_0x1a6fa0){var _0xe8d51f={'body':_0x21b98b['body'],'channel':_0xf9a0('0x29')};var _0x18ad83=_[_0xf9a0('0x2a')](_['keys'](db[_0xf9a0('0x2b')]['rawAttributes']),[_0xf9a0('0x2c'),'updatedAt',_0xf9a0('0x2d'),_0xf9a0('0x2e')]);var _0x4a0c68=![];if(_0x21b98b[_0xf9a0('0x2f')]['id']){delete _0x21b98b['body']['id'];}if(_[_0xf9a0('0x30')](_0x21b98b['body'][_0xf9a0('0x31')])){return _0x1a6fa0(_0x77f780[_0xf9a0('0x14')](0x1f4,_0xf9a0('0x32')));}if(_[_0xf9a0('0x30')](_0x21b98b['body'][_0xf9a0('0x2f')])||_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x2f')]===''){return _0x1a6fa0(_0x77f780[_0xf9a0('0x14')](0x1f4,_0xf9a0('0x33')));}if(_[_0xf9a0('0x30')](_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x34')])){return _0x1a6fa0(_0x77f780[_0xf9a0('0x14')](0x1f4,_0xf9a0('0x35')+_0x18ad83));}if(!_[_0xf9a0('0x36')](_0x18ad83,_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x34')])){return _0x1a6fa0(_0x77f780['error'](0x1f4,_0xf9a0('0x37')+_0x18ad83));}var _0x4797c6={};_0x4797c6[_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x34')]]=_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x31')];return db[_0xf9a0('0x1a')][_0xf9a0('0x26')]({'where':{'id':_0x21b98b[_0xf9a0('0x38')]['id']},'include':[{'model':db['CmList'],'as':_0xf9a0('0x39'),'include':[{'model':db[_0xf9a0('0x2b')],'as':_0xf9a0('0x3a'),'where':_0x4797c6,'limit':0x1,'order':[[_0xf9a0('0x3b'),_0xf9a0('0x3c')]]}]},{'model':db[_0xf9a0('0x3d')],'as':_0xf9a0('0x3e')},{'model':db['MailServerOut'],'as':_0xf9a0('0x3f')}]})[_0xf9a0('0xf')](function(_0x19ace1){if(_0x19ace1&&_0x19ace1[_0xf9a0('0x39')]){var _0x25d682=_0x19ace1[_0xf9a0('0x40')]({'plain':!![]});_0xe8d51f[_0xf9a0('0x38')]=_[_0xf9a0('0x41')](_0x25d682,['Applications',_0xf9a0('0x39')]);_0xe8d51f[_0xf9a0('0x42')]=_0x25d682[_0xf9a0('0x3e')];_0xe8d51f[_0xf9a0('0x43')]=_0x25d682['List'];_0xe8d51f[_0xf9a0('0x42')]=_[_0xf9a0('0x44')](_0xe8d51f[_0xf9a0('0x42')],[_0xf9a0('0x45')],[_0xf9a0('0x46')]);if(_0xe8d51f['account']&&_0xe8d51f[_0xf9a0('0x38')][_0xf9a0('0x47')]){_0xe8d51f[_0xf9a0('0x42')][_0xf9a0('0x48')]({'id':0x0,'priority':_0xe8d51f[_0xf9a0('0x42')][_0xf9a0('0x49')]+0x1,'app':'close','appdata':'autoclose','interval':_0xf9a0('0x4a')});}if(_0xe8d51f['account'][_0xf9a0('0x3e')]){delete _0xe8d51f[_0xf9a0('0x38')][_0xf9a0('0x3e')];}if(_0xe8d51f[_0xf9a0('0x38')][_0xf9a0('0x39')]){delete _0xe8d51f['account']['List'];}if(_0x25d682['List']['Contacts'][_0xf9a0('0x49')]){return _0x25d682[_0xf9a0('0x39')][_0xf9a0('0x3a')][0x0];}var _0x2a5330=_['defaults'](_0x21b98b[_0xf9a0('0x2f')],{'firstName':_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x31')],'ListId':_0x25d682['ListId']});_0x2a5330[_0x21b98b['body']['mapKey']]=_0x21b98b['body']['from'];return db[_0xf9a0('0x2b')][_0xf9a0('0x4b')](_0x2a5330);}else{throw new Error(_0xf9a0('0x4c'));}})[_0xf9a0('0xf')](function(_0x59caff){_0xe8d51f[_0xf9a0('0x4d')]=_0x59caff;if(_0x59caff){if(!_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x17')][_0xf9a0('0x4e')]){_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x17')][_0xf9a0('0x4e')]=rs['generate']()+'\x20'+_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x17')]['from'];}var _0x24e7a1={'ContactId':_0x59caff['id'],'MailAccountId':_0x21b98b[_0xf9a0('0x38')]['id'],'inReplyTo':_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x17')][_0xf9a0('0x4e')],'to':_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x17')]['from'],'cc':_0x21b98b[_0xf9a0('0x2f')]['message']['cc'],'subject':_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x17')][_0xf9a0('0x4f')],'attach':_0x21b98b['body'][_0xf9a0('0x17')][_0xf9a0('0x50')],'lastMsgAt':moment()['format'](_0xf9a0('0x51')),'lastMsgDirection':'in','lastMsgBody':_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x2f')]};return db[_0xf9a0('0x52')][_0xf9a0('0x26')]({'where':{'closed':![],'MailAccountId':_0x21b98b[_0xf9a0('0x38')]['id']},'include':[{'model':db[_0xf9a0('0x53')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x21b98b['body'][_0xf9a0('0x17')][_0xf9a0('0x54')]}}]})['then'](function(_0xa43d02){if(_0xa43d02){return[_0xa43d02,![]];}return db['MailInteraction']['create'](_0x24e7a1)['then'](function(_0x2b9eaf){return[_0x2b9eaf,!![]];});});}else{throw new Error(_0xf9a0('0x55'));}})[_0xf9a0('0x56')](function(_0xec99c7,_0x6517b6){if(_0xec99c7){_0x4a0c68=_0x6517b6;if(!_0x6517b6){return _0xec99c7[_0xf9a0('0x57')]({'inReplyTo':_0x21b98b[_0xf9a0('0x2f')]['message']['messageId'],'to':_0x21b98b[_0xf9a0('0x2f')]['message']['from'],'cc':_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x17')]['cc'],'subject':_0x21b98b['body']['message'][_0xf9a0('0x4f')],'attach':_0xec99c7[_0xf9a0('0x50')]?_0xec99c7[_0xf9a0('0x50')]:_0x21b98b[_0xf9a0('0x2f')]['message'][_0xf9a0('0x50')],'substatus':null,'substatusAt':moment()[_0xf9a0('0x58')](_0xf9a0('0x51')),'lastMsgAt':moment()[_0xf9a0('0x58')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x2f')]});}else{return _0xec99c7;}}})[_0xf9a0('0xf')](function(_0x14c5a2){_0xe8d51f[_0xf9a0('0x59')]=_0x14c5a2[_0xf9a0('0x40')]({'plain':!![]});_0xe8d51f[_0xf9a0('0x59')][_0xf9a0('0x5a')]=_0x4a0c68;return db[_0xf9a0('0x53')]['create']({'body':_0x21b98b[_0xf9a0('0x2f')]['body'],'MailAccountId':_0x21b98b['account']['id'],'MailInteractionId':_0x14c5a2['id'],'direction':'in','ContactId':_0xe8d51f['contact']['id'],'messageId':_0x21b98b['body'][_0xf9a0('0x17')][_0xf9a0('0x4e')],'from':_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x17')]['from'],'to':_0x21b98b['body'][_0xf9a0('0x17')]['to'],'cc':_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x17')]['cc'],'subject':_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x17')][_0xf9a0('0x4f')],'attach':_0x21b98b['body'][_0xf9a0('0x17')][_0xf9a0('0x50')],'Attachments':_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x17')]['attachments'],'originTo':_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x17')][_0xf9a0('0x5b')],'originCc':_0x21b98b[_0xf9a0('0x2f')][_0xf9a0('0x17')][_0xf9a0('0x5c')],'bcc':_0x21b98b['body'][_0xf9a0('0x17')][_0xf9a0('0x5d')]},{'include':[{'model':db[_0xf9a0('0x5e')],'as':_0xf9a0('0x5f')}]});})['then'](function(_0x358372){_0xe8d51f[_0xf9a0('0x17')]=_0x358372;if(_0xe8d51f[_0xf9a0('0x59')][_0xf9a0('0x60')]){return db['User']['find']({'attributes':['id',_0xf9a0('0x61')],'where':{'id':_0xe8d51f[_0xf9a0('0x59')]['UserId']}})[_0xf9a0('0xf')](function(_0x4a0ebe){if(_0x4a0ebe){_0xe8d51f['applications'][_0xf9a0('0x62')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4a0ebe[_0xf9a0('0x61')]+','+(_0xe8d51f[_0xf9a0('0x38')]['waitForTheAssignedAgent']||0xa),'interval':_0xf9a0('0x4a')});}return respondWithRpcPromise(_0xf9a0('0x63'),_0xf9a0('0x64'),_0xe8d51f);});}return respondWithRpcPromise(_0xf9a0('0x63'),'startRouting',_0xe8d51f);})[_0xf9a0('0xf')](function(_0x9fa7a5){_0x27a2eb(_0x9fa7a5);})['catch'](function(_0xf8e427){_0x1a6fa0(_0x77f780[_0xf9a0('0x14')](0x1f4,_0xf8e427['message']));});});};
\ No newline at end of file
index 6da7c10..cf10aa4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde24=['mailAccount:','./mailAccount.events','save','remove','removeListener','register','length'];(function(_0x10d92e,_0x4803fd){var _0x5e95f2=function(_0x4dede1){while(--_0x4dede1){_0x10d92e['push'](_0x10d92e['shift']());}};_0x5e95f2(++_0x4803fd);}(_0xde24,0x7f));var _0x4de2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xde24[_0x14add3];return _0x4a174f;};'use strict';var MailAccountEvents=require(_0x4de2('0x0'));var events=[_0x4de2('0x1'),_0x4de2('0x2'),'update'];function createListener(_0x531d25,_0x3ad762){return function(_0x12a82a){_0x3ad762['emit'](_0x531d25,_0x12a82a);};}function removeListener(_0x32d19a,_0x498f45){return function(){MailAccountEvents[_0x4de2('0x3')](_0x32d19a,_0x498f45);};}exports[_0x4de2('0x4')]=function(_0xc0d249){for(var _0x4eba59=0x0,_0x50c3bf=events[_0x4de2('0x5')];_0x4eba59<_0x50c3bf;_0x4eba59++){var _0x330dc3=events[_0x4eba59];var _0x2bc03b=createListener(_0x4de2('0x6')+_0x330dc3,_0xc0d249);MailAccountEvents['on'](_0x330dc3,_0x2bc03b);}};
\ No newline at end of file
+var _0x0d8c=['removeListener','register','length','mailAccount:','./mailAccount.events','save','remove','update','emit'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x0d8c,0x148));var _0xc0d8=function(_0x496f50,_0x3d4833){_0x496f50=_0x496f50-0x0;var _0x5dae29=_0x0d8c[_0x496f50];return _0x5dae29;};'use strict';var MailAccountEvents=require(_0xc0d8('0x0'));var events=[_0xc0d8('0x1'),_0xc0d8('0x2'),_0xc0d8('0x3')];function createListener(_0x1b1784,_0x5577cd){return function(_0x402906){_0x5577cd[_0xc0d8('0x4')](_0x1b1784,_0x402906);};}function removeListener(_0x34a416,_0x462e61){return function(){MailAccountEvents[_0xc0d8('0x5')](_0x34a416,_0x462e61);};}exports[_0xc0d8('0x6')]=function(_0x3ee88d){for(var _0x5024d3=0x0,_0x341744=events[_0xc0d8('0x7')];_0x5024d3<_0x341744;_0x5024d3++){var _0x21b6d3=events[_0x5024d3];var _0x3a228c=createListener(_0xc0d8('0x8')+_0x21b6d3,_0x3ee88d);MailAccountEvents['on'](_0x21b6d3,_0x3a228c);}};
\ No newline at end of file
index b8c5130..f82d48a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ad8=['multer','util','path','express','Router','../../components/auth/service','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports'];(function(_0x32ed51,_0x231ff0){var _0x268a9e=function(_0x258946){while(--_0x258946){_0x32ed51['push'](_0x32ed51['shift']());}};_0x268a9e(++_0x231ff0);}(_0x1ad8,0xb0));var _0x81ad=function(_0x4fe0c2,_0x3a5a59){_0x4fe0c2=_0x4fe0c2-0x0;var _0x518870=_0x1ad8[_0x4fe0c2];return _0x518870;};'use strict';var multer=require(_0x81ad('0x0'));var util=require(_0x81ad('0x1'));var path=require(_0x81ad('0x2'));var express=require(_0x81ad('0x3'));var router=express[_0x81ad('0x4')]();var auth=require(_0x81ad('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x81ad('0x6'));router[_0x81ad('0x7')](_0x81ad('0x8'),auth[_0x81ad('0x9')](),controller[_0x81ad('0xa')]);router[_0x81ad('0xb')](_0x81ad('0x8'),auth[_0x81ad('0x9')](),controller[_0x81ad('0xc')]);router[_0x81ad('0xd')](_0x81ad('0x8'),auth[_0x81ad('0x9')](),controller[_0x81ad('0xe')]);module[_0x81ad('0xf')]=router;
\ No newline at end of file
+var _0xa478=['../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','put','update','delete','destroy','multer','util','express','Router'];(function(_0x2f9c02,_0x15719e){var _0x5d33f3=function(_0x534f68){while(--_0x534f68){_0x2f9c02['push'](_0x2f9c02['shift']());}};_0x5d33f3(++_0x15719e);}(_0xa478,0x1ea));var _0x8a47=function(_0x31ddba,_0x28ec26){_0x31ddba=_0x31ddba-0x0;var _0x3f014c=_0xa478[_0x31ddba];return _0x3f014c;};'use strict';var multer=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var path=require('path');var express=require(_0x8a47('0x2'));var router=express[_0x8a47('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8a47('0x4'));var controller=require(_0x8a47('0x5'));router['get'](_0x8a47('0x6'),auth[_0x8a47('0x7')](),controller[_0x8a47('0x8')]);router[_0x8a47('0x9')](_0x8a47('0x6'),auth['isAuthenticated'](),controller[_0x8a47('0xa')]);router[_0x8a47('0xb')](_0x8a47('0x6'),auth[_0x8a47('0x7')](),controller[_0x8a47('0xc')]);module['exports']=router;
\ No newline at end of file
index 5d52272..83f9eb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4079=['*,*,*,*','sequelize','INTEGER','noop','STRING'];(function(_0x7ff523,_0x2ff760){var _0x31ae3d=function(_0x2d7ecb){while(--_0x2d7ecb){_0x7ff523['push'](_0x7ff523['shift']());}};_0x31ae3d(++_0x2ff760);}(_0x4079,0x1e6));var _0x9407=function(_0x136a19,_0x29e4a3){_0x136a19=_0x136a19-0x0;var _0x38245a=_0x4079[_0x136a19];return _0x38245a;};'use strict';var Sequelize=require(_0x9407('0x0'));module['exports']={'priority':{'type':Sequelize[_0x9407('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9407('0x2')},'appdata':{'type':Sequelize[_0x9407('0x3')](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0x9407('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9407('0x4')}};
\ No newline at end of file
+var _0xa626=['exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x2849a7,_0x154314){var _0x2f5e4e=function(_0x3f7a3b){while(--_0x3f7a3b){_0x2849a7['push'](_0x2849a7['shift']());}};_0x2f5e4e(++_0x154314);}(_0xa626,0x186));var _0x6a62=function(_0x212a0b,_0x392556){_0x212a0b=_0x212a0b-0x0;var _0x454160=_0xa626[_0x212a0b];return _0x454160;};'use strict';var Sequelize=require('sequelize');module[_0x6a62('0x0')]={'priority':{'type':Sequelize[_0x6a62('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x6a62('0x2')],'allowNull':![],'defaultValue':_0x6a62('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0x6a62('0x2')]},'interval':{'type':Sequelize[_0x6a62('0x2')],'defaultValue':_0x6a62('0x4')}};
\ No newline at end of file
index 361ef48..13023fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5998=['body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','then','error','stack','name','show','params','keys','MailApplication','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','include','merge','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5998,0xc7));var _0x8599=function(_0x27a204,_0x32d832){_0x27a204=_0x27a204-0x0;var _0x39d686=_0x5998[_0x27a204];return _0x39d686;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8599('0x0'));var rimraf=require(_0x8599('0x1'));var zipdir=require(_0x8599('0x2'));var jsonpatch=require(_0x8599('0x3'));var rp=require(_0x8599('0x4'));var moment=require(_0x8599('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8599('0x6'));var path=require('path');var sox=require(_0x8599('0x7'));var csv=require(_0x8599('0x8'));var ejs=require(_0x8599('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8599('0xa'));var jsforce=require(_0x8599('0xb'));var deskjs=require(_0x8599('0xc'));var toCsv=require(_0x8599('0x8'));var querystring=require('querystring');var Papa=require(_0x8599('0xd'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8599('0xe'));var db=require(_0x8599('0xf'))['db'];function respondWithStatusCode(_0x120e94,_0x580a0d){_0x580a0d=_0x580a0d||0xcc;return function(_0x1f321f){if(_0x1f321f){return _0x120e94[_0x8599('0x10')](_0x580a0d);}return _0x120e94['status'](_0x580a0d)[_0x8599('0x11')]();};}function respondWithResult(_0x17d9c5,_0x5e3091){_0x5e3091=_0x5e3091||0xc8;return function(_0x26b187){if(_0x26b187){return _0x17d9c5[_0x8599('0x12')](_0x5e3091)[_0x8599('0x13')](_0x26b187);}};}function respondWithFilteredResult(_0x41fea4,_0x360565){return function(_0x48f4f6){if(_0x48f4f6){var _0x1dd41e=_0x48f4f6[_0x8599('0x14')],_0xd19559=_0x360565[_0x8599('0x15')],_0x3f542e=_0x360565[_0x8599('0x15')]+_0x360565[_0x8599('0x16')],_0x4d7ed3;if(_0x3f542e>=_0x1dd41e){_0x3f542e=_0x1dd41e;_0x4d7ed3=0xc8;}else{_0x4d7ed3=0xce;}_0x41fea4[_0x8599('0x12')](_0x4d7ed3);return _0x41fea4['set'](_0x8599('0x17'),_0xd19559+'-'+_0x3f542e+'/'+_0x1dd41e)[_0x8599('0x13')](_0x48f4f6);}return null;};}function patchUpdates(_0x51c8c7){return function(_0x192ed6){try{jsonpatch['apply'](_0x192ed6,_0x51c8c7,!![]);}catch(_0x7470b6){return BPromise[_0x8599('0x18')](_0x7470b6);}return _0x192ed6[_0x8599('0x19')]();};}function saveUpdates(_0x1140ce,_0x1263b9){return function(_0x4e569e){if(_0x4e569e){return _0x4e569e['update'](_0x1140ce)['then'](function(_0x36e053){return _0x36e053;});}return null;};}function removeEntity(_0x4c3859,_0x4c3ae7){return function(_0x54c1f6){if(_0x54c1f6){return _0x54c1f6['destroy']()[_0x8599('0x1a')](function(){_0x4c3859['status'](0xcc)[_0x8599('0x11')]();});}};}function handleEntityNotFound(_0x36bade,_0x5a079a){return function(_0x4a426f){if(!_0x4a426f){_0x36bade[_0x8599('0x10')](0x194);}return _0x4a426f;};}function handleError(_0x431d80,_0x2d5996){_0x2d5996=_0x2d5996||0x1f4;return function(_0x3d7ea0){logger[_0x8599('0x1b')](_0x3d7ea0[_0x8599('0x1c')]);if(_0x3d7ea0[_0x8599('0x1d')]){delete _0x3d7ea0[_0x8599('0x1d')];}_0x431d80[_0x8599('0x12')](_0x2d5996)['send'](_0x3d7ea0);};}exports[_0x8599('0x1e')]=function(_0x305418,_0x1c939e){var _0x176310={'raw':!![],'where':{'id':_0x305418[_0x8599('0x1f')]['id']}},_0x3c79c2={};_0x3c79c2['model']=_[_0x8599('0x20')](db[_0x8599('0x21')][_0x8599('0x22')]);_0x3c79c2[_0x8599('0x23')]=_[_0x8599('0x20')](_0x305418[_0x8599('0x23')]);_0x3c79c2[_0x8599('0x24')]=_[_0x8599('0x25')](_0x3c79c2[_0x8599('0x26')],_0x3c79c2['query']);_0x176310['attributes']=_['intersection'](_0x3c79c2['model'],qs[_0x8599('0x27')](_0x305418[_0x8599('0x23')]['fields']));_0x176310['attributes']=_0x176310[_0x8599('0x28')][_0x8599('0x29')]?_0x176310[_0x8599('0x28')]:_0x3c79c2[_0x8599('0x26')];if(_0x305418[_0x8599('0x23')][_0x8599('0x2a')]){_0x176310[_0x8599('0x2b')]=[{'all':!![]}];}_0x176310=_[_0x8599('0x2c')]({},_0x176310,_0x305418['options']);return db['MailApplication'][_0x8599('0x2d')](_0x176310)[_0x8599('0x1a')](handleEntityNotFound(_0x1c939e,null))[_0x8599('0x1a')](respondWithResult(_0x1c939e,null))['catch'](handleError(_0x1c939e,null));};exports['update']=function(_0xdbeb48,_0x3d56db){if(_0xdbeb48[_0x8599('0x2e')]['id']){delete _0xdbeb48[_0x8599('0x2e')]['id'];}return db[_0x8599('0x21')]['find']({'where':{'id':_0xdbeb48[_0x8599('0x1f')]['id']}})[_0x8599('0x1a')](handleEntityNotFound(_0x3d56db,null))[_0x8599('0x1a')](saveUpdates(_0xdbeb48[_0x8599('0x2e')],null))[_0x8599('0x1a')](respondWithResult(_0x3d56db,null))[_0x8599('0x2f')](handleError(_0x3d56db,null));};exports[_0x8599('0x30')]=function(_0xf04739,_0x37a651){return db[_0x8599('0x21')][_0x8599('0x2d')]({'where':{'id':_0xf04739[_0x8599('0x1f')]['id']}})[_0x8599('0x1a')](handleEntityNotFound(_0x37a651,null))[_0x8599('0x1a')](removeEntity(_0x37a651,null))[_0x8599('0x2f')](handleError(_0x37a651,null));};
\ No newline at end of file
+var _0xff7c=['filters','intersection','attributes','length','includeAll','merge','options','MailApplication','find','catch','body','html-pdf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','stack','name','send','show','params','model','keys','rawAttributes','query'];(function(_0x2e340c,_0xe40420){var _0x561395=function(_0x4f3ae4){while(--_0x4f3ae4){_0x2e340c['push'](_0x2e340c['shift']());}};_0x561395(++_0xe40420);}(_0xff7c,0x1bb));var _0xcff7=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0xff7c[_0x2b9b7f];return _0x4ed19a;};'use strict';var pdf=require(_0xcff7('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcff7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcff7('0x2'));var moment=require('moment');var BPromise=require(_0xcff7('0x3'));var Mustache=require(_0xcff7('0x4'));var util=require(_0xcff7('0x5'));var path=require(_0xcff7('0x6'));var sox=require(_0xcff7('0x7'));var csv=require('to-csv');var ejs=require(_0xcff7('0x8'));var fs=require('fs');var _=require(_0xcff7('0x9'));var squel=require(_0xcff7('0xa'));var crypto=require(_0xcff7('0xb'));var jsforce=require(_0xcff7('0xc'));var deskjs=require(_0xcff7('0xd'));var toCsv=require(_0xcff7('0xe'));var querystring=require(_0xcff7('0xf'));var Papa=require(_0xcff7('0x10'));var qs=require(_0xcff7('0x11'));var logger=require('../../config/logger')(_0xcff7('0x12'));var utils=require('../../config/utils');var config=require(_0xcff7('0x13'));var db=require(_0xcff7('0x14'))['db'];function respondWithStatusCode(_0x51fb91,_0x25567d){_0x25567d=_0x25567d||0xcc;return function(_0x132d39){if(_0x132d39){return _0x51fb91[_0xcff7('0x15')](_0x25567d);}return _0x51fb91[_0xcff7('0x16')](_0x25567d)[_0xcff7('0x17')]();};}function respondWithResult(_0x2895d5,_0xfc8e1b){_0xfc8e1b=_0xfc8e1b||0xc8;return function(_0x2f6b81){if(_0x2f6b81){return _0x2895d5['status'](_0xfc8e1b)[_0xcff7('0x18')](_0x2f6b81);}};}function respondWithFilteredResult(_0x40ab39,_0x45b01c){return function(_0xd03355){if(_0xd03355){var _0x42b2ca=_0xd03355[_0xcff7('0x19')],_0x297404=_0x45b01c[_0xcff7('0x1a')],_0x34ae6e=_0x45b01c[_0xcff7('0x1a')]+_0x45b01c[_0xcff7('0x1b')],_0x2844d7;if(_0x34ae6e>=_0x42b2ca){_0x34ae6e=_0x42b2ca;_0x2844d7=0xc8;}else{_0x2844d7=0xce;}_0x40ab39[_0xcff7('0x16')](_0x2844d7);return _0x40ab39['set'](_0xcff7('0x1c'),_0x297404+'-'+_0x34ae6e+'/'+_0x42b2ca)['json'](_0xd03355);}return null;};}function patchUpdates(_0x5bb9e4){return function(_0x293ec1){try{jsonpatch[_0xcff7('0x1d')](_0x293ec1,_0x5bb9e4,!![]);}catch(_0x4b9c56){return BPromise[_0xcff7('0x1e')](_0x4b9c56);}return _0x293ec1['save']();};}function saveUpdates(_0x11c0bb,_0x4b8fe9){return function(_0x256f46){if(_0x256f46){return _0x256f46[_0xcff7('0x1f')](_0x11c0bb)[_0xcff7('0x20')](function(_0x140468){return _0x140468;});}return null;};}function removeEntity(_0x5b7375,_0x33acfd){return function(_0x5820b0){if(_0x5820b0){return _0x5820b0[_0xcff7('0x21')]()[_0xcff7('0x20')](function(){_0x5b7375[_0xcff7('0x16')](0xcc)[_0xcff7('0x17')]();});}};}function handleEntityNotFound(_0x304dbd,_0x11093f){return function(_0x24e2cc){if(!_0x24e2cc){_0x304dbd[_0xcff7('0x15')](0x194);}return _0x24e2cc;};}function handleError(_0x5c9392,_0x3e49b9){_0x3e49b9=_0x3e49b9||0x1f4;return function(_0x4caebd){logger['error'](_0x4caebd[_0xcff7('0x22')]);if(_0x4caebd[_0xcff7('0x23')]){delete _0x4caebd[_0xcff7('0x23')];}_0x5c9392[_0xcff7('0x16')](_0x3e49b9)[_0xcff7('0x24')](_0x4caebd);};}exports[_0xcff7('0x25')]=function(_0x1f4d97,_0x3e00ee){var _0x1d7bbd={'raw':!![],'where':{'id':_0x1f4d97[_0xcff7('0x26')]['id']}},_0x42db77={};_0x42db77[_0xcff7('0x27')]=_[_0xcff7('0x28')](db['MailApplication'][_0xcff7('0x29')]);_0x42db77[_0xcff7('0x2a')]=_['keys'](_0x1f4d97[_0xcff7('0x2a')]);_0x42db77[_0xcff7('0x2b')]=_[_0xcff7('0x2c')](_0x42db77['model'],_0x42db77[_0xcff7('0x2a')]);_0x1d7bbd['attributes']=_['intersection'](_0x42db77[_0xcff7('0x27')],qs['fields'](_0x1f4d97[_0xcff7('0x2a')]['fields']));_0x1d7bbd[_0xcff7('0x2d')]=_0x1d7bbd[_0xcff7('0x2d')][_0xcff7('0x2e')]?_0x1d7bbd['attributes']:_0x42db77[_0xcff7('0x27')];if(_0x1f4d97['query'][_0xcff7('0x2f')]){_0x1d7bbd['include']=[{'all':!![]}];}_0x1d7bbd=_[_0xcff7('0x30')]({},_0x1d7bbd,_0x1f4d97[_0xcff7('0x31')]);return db[_0xcff7('0x32')][_0xcff7('0x33')](_0x1d7bbd)['then'](handleEntityNotFound(_0x3e00ee,null))[_0xcff7('0x20')](respondWithResult(_0x3e00ee,null))[_0xcff7('0x34')](handleError(_0x3e00ee,null));};exports[_0xcff7('0x1f')]=function(_0x227c75,_0x32452c){if(_0x227c75[_0xcff7('0x35')]['id']){delete _0x227c75['body']['id'];}return db[_0xcff7('0x32')][_0xcff7('0x33')]({'where':{'id':_0x227c75[_0xcff7('0x26')]['id']}})[_0xcff7('0x20')](handleEntityNotFound(_0x32452c,null))[_0xcff7('0x20')](saveUpdates(_0x227c75[_0xcff7('0x35')],null))[_0xcff7('0x20')](respondWithResult(_0x32452c,null))['catch'](handleError(_0x32452c,null));};exports[_0xcff7('0x21')]=function(_0x5c8cb0,_0x57b4ec){return db[_0xcff7('0x32')]['find']({'where':{'id':_0x5c8cb0['params']['id']}})[_0xcff7('0x20')](handleEntityNotFound(_0x57b4ec,null))[_0xcff7('0x20')](removeEntity(_0x57b4ec,null))['catch'](handleError(_0x57b4ec,null));};
\ No newline at end of file
index b5b6766..fab796a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a1a=['api','moment','bluebird','./mailApplication.attributes','exports','define','MailApplication','mail_applications','lodash','util'];(function(_0x405821,_0x51d7a3){var _0x1a0210=function(_0x5ac979){while(--_0x5ac979){_0x405821['push'](_0x405821['shift']());}};_0x1a0210(++_0x51d7a3);}(_0x9a1a,0xe4));var _0xa9a1=function(_0x2d8e83,_0x454e19){_0x2d8e83=_0x2d8e83-0x0;var _0x3a121c=_0x9a1a[_0x2d8e83];return _0x3a121c;};'use strict';var _=require(_0xa9a1('0x0'));var util=require(_0xa9a1('0x1'));var logger=require('../../config/logger')(_0xa9a1('0x2'));var moment=require(_0xa9a1('0x3'));var BPromise=require(_0xa9a1('0x4'));var rp=require('request-promise');var attributes=require(_0xa9a1('0x5'));module[_0xa9a1('0x6')]=function(_0x1d81e6,_0x56e96f){return _0x1d81e6[_0xa9a1('0x7')](_0xa9a1('0x8'),attributes,{'tableName':_0xa9a1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaa6d=['api','moment','./mailApplication.attributes','MailApplication','lodash'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xaa6d,0x13f));var _0xdaa6=function(_0x57b3d8,_0x146a81){_0x57b3d8=_0x57b3d8-0x0;var _0x4094a2=_0xaa6d[_0x57b3d8];return _0x4094a2;};'use strict';var _=require(_0xdaa6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdaa6('0x1'));var moment=require(_0xdaa6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xdaa6('0x3'));module['exports']=function(_0x508145,_0xb48450){return _0x508145['define'](_0xdaa6('0x4'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f651160..522dd8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ece=['UpdateMailApplication','stringify','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','MailApplication','update','options','raw','where','attributes','then'];(function(_0x1fb4e1,_0x3d4ce6){var _0x22d1b0=function(_0x553822){while(--_0x553822){_0x1fb4e1['push'](_0x1fb4e1['shift']());}};_0x22d1b0(++_0x3d4ce6);}(_0x9ece,0x8e));var _0xe9ec=function(_0x5c9e84,_0xc4682e){_0x5c9e84=_0x5c9e84-0x0;var _0x13897f=_0x9ece[_0x5c9e84];return _0x13897f;};'use strict';var _=require(_0xe9ec('0x0'));var util=require(_0xe9ec('0x1'));var moment=require('moment');var BPromise=require(_0xe9ec('0x2'));var rs=require(_0xe9ec('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0xe9ec('0x4'));var logger=require(_0xe9ec('0x5'))(_0xe9ec('0x6'));var config=require(_0xe9ec('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe9ec('0x8')][_0xe9ec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5475bc,_0x24388e,_0x32fc26){return new BPromise(function(_0x50eac9,_0x18b1de){return client['request'](_0x5475bc,_0x32fc26)['then'](function(_0x59b52f){logger[_0xe9ec('0xa')](_0xe9ec('0xb'),_0x24388e,'request\x20sent');logger[_0xe9ec('0xc')](_0xe9ec('0xd'),_0x24388e,_0xe9ec('0xe'),JSON['stringify'](_0x59b52f));if(_0x59b52f[_0xe9ec('0xf')]){if(_0x59b52f['error']['code']===0x1f4){logger[_0xe9ec('0xf')](_0xe9ec('0xb'),_0x24388e,_0x59b52f[_0xe9ec('0xf')]['message']);return _0x18b1de(_0x59b52f[_0xe9ec('0xf')]['message']);}logger[_0xe9ec('0xf')](_0xe9ec('0xb'),_0x24388e,_0x59b52f[_0xe9ec('0xf')][_0xe9ec('0x10')]);return _0x50eac9(_0x59b52f[_0xe9ec('0xf')][_0xe9ec('0x10')]);}else{logger[_0xe9ec('0xa')](_0xe9ec('0xb'),_0x24388e,_0xe9ec('0xe'));_0x50eac9(_0x59b52f[_0xe9ec('0x11')][_0xe9ec('0x10')]);}})[_0xe9ec('0x12')](function(_0x5152cb){logger[_0xe9ec('0xf')]('MailApplication,\x20%s,\x20%s',_0x24388e,_0x5152cb);_0x18b1de(_0x5152cb);});});}exports['UpdateMailApplication']=function(_0x7e24bf){var _0x258598=this;return new Promise(function(_0xca99e,_0x3e1f09){return db[_0xe9ec('0x13')][_0xe9ec('0x14')](_0x7e24bf['body'],{'raw':_0x7e24bf[_0xe9ec('0x15')]?_0x7e24bf[_0xe9ec('0x15')][_0xe9ec('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7e24bf[_0xe9ec('0x15')]?_0x7e24bf[_0xe9ec('0x15')][_0xe9ec('0x17')]||null:null,'attributes':_0x7e24bf[_0xe9ec('0x15')]?_0x7e24bf[_0xe9ec('0x15')][_0xe9ec('0x18')]||null:null,'limit':_0x7e24bf['options']?_0x7e24bf['options']['limit']||null:null})[_0xe9ec('0x19')](function(_0x3c6778){logger[_0xe9ec('0xa')](_0xe9ec('0x1a'),_0x7e24bf);logger[_0xe9ec('0xc')](_0xe9ec('0x1a'),_0x7e24bf,JSON[_0xe9ec('0x1b')](_0x3c6778));_0xca99e(_0x3c6778);})[_0xe9ec('0x12')](function(_0x44eb92){logger[_0xe9ec('0xf')]('UpdateMailApplication',_0x44eb92[_0xe9ec('0x10')],_0x7e24bf);_0x3e1f09(_0x258598['error'](0x1f4,_0x44eb92[_0xe9ec('0x10')]));});});};
\ No newline at end of file
+var _0x9f75=['message','result','catch','UpdateMailApplication','options','raw','attributes','limit','stringify','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x345695,_0x2ba140){var _0x5002d3=function(_0x1f6cbb){while(--_0x1f6cbb){_0x345695['push'](_0x345695['shift']());}};_0x5002d3(++_0x2ba140);}(_0x9f75,0xab));var _0x59f7=function(_0x357f73,_0x31cd37){_0x357f73=_0x357f73-0x0;var _0x55edf9=_0x9f75[_0x357f73];return _0x55edf9;};'use strict';var _=require('lodash');var util=require(_0x59f7('0x0'));var moment=require(_0x59f7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0x59f7('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x59f7('0x3'))(_0x59f7('0x4'));var config=require(_0x59f7('0x5'));var jayson=require(_0x59f7('0x6'));var client=jayson[_0x59f7('0x7')][_0x59f7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5de8c4,_0x4c92bb,_0x56aaa1){return new BPromise(function(_0x403019,_0x3b26fb){return client[_0x59f7('0x9')](_0x5de8c4,_0x56aaa1)[_0x59f7('0xa')](function(_0x570b2d){logger[_0x59f7('0xb')](_0x59f7('0xc'),_0x4c92bb,'request\x20sent');logger[_0x59f7('0xd')](_0x59f7('0xe'),_0x4c92bb,_0x59f7('0xf'),JSON['stringify'](_0x570b2d));if(_0x570b2d[_0x59f7('0x10')]){if(_0x570b2d[_0x59f7('0x10')][_0x59f7('0x11')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0x4c92bb,_0x570b2d[_0x59f7('0x10')][_0x59f7('0x12')]);return _0x3b26fb(_0x570b2d[_0x59f7('0x10')][_0x59f7('0x12')]);}logger[_0x59f7('0x10')](_0x59f7('0xc'),_0x4c92bb,_0x570b2d[_0x59f7('0x10')][_0x59f7('0x12')]);return _0x403019(_0x570b2d[_0x59f7('0x10')][_0x59f7('0x12')]);}else{logger[_0x59f7('0xb')](_0x59f7('0xc'),_0x4c92bb,'request\x20sent');_0x403019(_0x570b2d[_0x59f7('0x13')][_0x59f7('0x12')]);}})[_0x59f7('0x14')](function(_0x3d3735){logger[_0x59f7('0x10')](_0x59f7('0xc'),_0x4c92bb,_0x3d3735);_0x3b26fb(_0x3d3735);});});}exports[_0x59f7('0x15')]=function(_0x533385){var _0xdd7ef2=this;return new Promise(function(_0x34dd14,_0x3a024e){return db['MailApplication']['update'](_0x533385['body'],{'raw':_0x533385[_0x59f7('0x16')]?_0x533385['options'][_0x59f7('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x533385[_0x59f7('0x16')]?_0x533385[_0x59f7('0x16')]['where']||null:null,'attributes':_0x533385['options']?_0x533385[_0x59f7('0x16')][_0x59f7('0x18')]||null:null,'limit':_0x533385[_0x59f7('0x16')]?_0x533385[_0x59f7('0x16')][_0x59f7('0x19')]||null:null})[_0x59f7('0xa')](function(_0x43860e){logger[_0x59f7('0xb')](_0x59f7('0x15'),_0x533385);logger['debug'](_0x59f7('0x15'),_0x533385,JSON[_0x59f7('0x1a')](_0x43860e));_0x34dd14(_0x43860e);})[_0x59f7('0x14')](function(_0x879024){logger[_0x59f7('0x10')](_0x59f7('0x15'),_0x879024[_0x59f7('0x12')],_0x533385);_0x3a024e(_0xdd7ef2[_0x59f7('0x10')](0x1f4,_0x879024['message']));});});};
\ No newline at end of file
index 64af1e9..d22ae78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9aa=['index','get','/describe','describe','getMessages','post','create','addMessage','/:id/tags','mail','put','/:id','tracked','mailinteraction:update','delete','mailinteraction:destroy','exports','multer','util','path','express','../../components/interaction/service','isAuthenticated'];(function(_0x4164df,_0x32ed1a){var _0x3d1f64=function(_0x515258){while(--_0x515258){_0x4164df['push'](_0x4164df['shift']());}};_0x3d1f64(++_0x32ed1a);}(_0xc9aa,0xb2));var _0xac9a=function(_0x115d5b,_0x26aff2){_0x115d5b=_0x115d5b-0x0;var _0x6cfc50=_0xc9aa[_0x115d5b];return _0x6cfc50;};'use strict';var multer=require(_0xac9a('0x0'));var util=require(_0xac9a('0x1'));var path=require(_0xac9a('0x2'));var express=require(_0xac9a('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xac9a('0x4'));var config=require('../../config/environment');var controller=require('./mailInteraction.controller');router['get']('/',auth[_0xac9a('0x5')](),controller[_0xac9a('0x6')]);router[_0xac9a('0x7')](_0xac9a('0x8'),auth[_0xac9a('0x5')](),controller[_0xac9a('0x9')]);router[_0xac9a('0x7')]('/:id',auth[_0xac9a('0x5')](),controller['show']);router[_0xac9a('0x7')]('/:id/messages',auth[_0xac9a('0x5')](),controller[_0xac9a('0xa')]);router['get']('/:id/download',auth[_0xac9a('0x5')](),controller['download']);router[_0xac9a('0xb')]('/',auth['isAuthenticated'](),controller[_0xac9a('0xc')]);router[_0xac9a('0xb')]('/:id/messages',auth[_0xac9a('0x5')](),controller[_0xac9a('0xd')]);router[_0xac9a('0xb')](_0xac9a('0xe'),auth['isAuthenticated'](),interaction['tracked'](_0xac9a('0xf'),'mailinteraction:addtags'),controller['addTags']);router[_0xac9a('0x10')](_0xac9a('0x11'),auth[_0xac9a('0x5')](),interaction[_0xac9a('0x12')](_0xac9a('0xf'),_0xac9a('0x13')),controller['update']);router[_0xac9a('0x14')]('/:id',auth[_0xac9a('0x5')](),interaction[_0xac9a('0x12')]('mail',_0xac9a('0x15')),controller['destroy']);router[_0xac9a('0x14')]('/:id/tags',auth[_0xac9a('0x5')](),controller['removeTags']);module[_0xac9a('0x16')]=router;
\ No newline at end of file
+var _0x6e46=['/:id','show','/:id/messages','getMessages','download','post','create','addMessage','tracked','mail','addTags','put','update','delete','mailinteraction:destroy','removeTags','exports','multer','path','Router','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','describe'];(function(_0x224836,_0x525012){var _0x317877=function(_0x5a2ac3){while(--_0x5a2ac3){_0x224836['push'](_0x224836['shift']());}};_0x317877(++_0x525012);}(_0x6e46,0x197));var _0x66e4=function(_0x270036,_0xac1e7b){_0x270036=_0x270036-0x0;var _0x1f6993=_0x6e46[_0x270036];return _0x1f6993;};'use strict';var multer=require(_0x66e4('0x0'));var util=require('util');var path=require(_0x66e4('0x1'));var express=require('express');var router=express[_0x66e4('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x66e4('0x3'));var config=require(_0x66e4('0x4'));var controller=require(_0x66e4('0x5'));router[_0x66e4('0x6')]('/',auth[_0x66e4('0x7')](),controller['index']);router[_0x66e4('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x66e4('0x8')]);router[_0x66e4('0x6')](_0x66e4('0x9'),auth[_0x66e4('0x7')](),controller[_0x66e4('0xa')]);router[_0x66e4('0x6')](_0x66e4('0xb'),auth[_0x66e4('0x7')](),controller[_0x66e4('0xc')]);router[_0x66e4('0x6')]('/:id/download',auth[_0x66e4('0x7')](),controller[_0x66e4('0xd')]);router[_0x66e4('0xe')]('/',auth[_0x66e4('0x7')](),controller[_0x66e4('0xf')]);router[_0x66e4('0xe')](_0x66e4('0xb'),auth[_0x66e4('0x7')](),controller[_0x66e4('0x10')]);router['post']('/:id/tags',auth[_0x66e4('0x7')](),interaction[_0x66e4('0x11')](_0x66e4('0x12'),'mailinteraction:addtags'),controller[_0x66e4('0x13')]);router[_0x66e4('0x14')]('/:id',auth[_0x66e4('0x7')](),interaction[_0x66e4('0x11')](_0x66e4('0x12'),'mailinteraction:update'),controller[_0x66e4('0x15')]);router[_0x66e4('0x16')](_0x66e4('0x9'),auth['isAuthenticated'](),interaction[_0x66e4('0x11')]('mail',_0x66e4('0x17')),controller['destroy']);router[_0x66e4('0x16')]('/:id/tags',auth['isAuthenticated'](),controller[_0x66e4('0x18')]);module[_0x66e4('0x19')]=router;
\ No newline at end of file
index 88ffa1a..5fb165c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d11=['split','slice','join','sequelize','iconv','exports','BOOLEAN','STRING','TEXT','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DATE','ENUM','getDataValue','lastMsgBody'];(function(_0x88e0ae,_0x22cdbf){var _0x300795=function(_0x2529a9){while(--_0x2529a9){_0x88e0ae['push'](_0x88e0ae['shift']());}};_0x300795(++_0x22cdbf);}(_0x0d11,0x14d));var _0x10d1=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0x0d11[_0x3afe18];return _0x19ed1f;};'use strict';var Sequelize=require(_0x10d1('0x0'));var htmlToText=require('html-to-text');var iconv=require(_0x10d1('0x1'));module[_0x10d1('0x2')]={'closed':{'type':Sequelize[_0x10d1('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x10d1('0x4')]},'inReplyTo':{'type':Sequelize[_0x10d1('0x4')](0xbe)},'to':{'type':Sequelize[_0x10d1('0x4')]},'cc':{'type':Sequelize[_0x10d1('0x5')](_0x10d1('0x6'))},'subject':{'type':Sequelize[_0x10d1('0x5')]('')+_0x10d1('0x7')},'attach':{'type':Sequelize[_0x10d1('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x10d1('0x8')]},'substatus':{'type':Sequelize[_0x10d1('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x10d1('0x8')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x10d1('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x10d1('0x9')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x10d1('0x5')](_0x10d1('0x6'))+_0x10d1('0x7'),'get':function(){try{return this[_0x10d1('0xa')](_0x10d1('0xb'))?htmlToText['fromString'](this[_0x10d1('0xa')](_0x10d1('0xb')),{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'ignoreImage':!![]})[_0x10d1('0xc')]('\x0a')[_0x10d1('0xd')](0x0,0x6)[_0x10d1('0xe')]('\x0a'):null;}catch(_0x177469){return null;}}}};
\ No newline at end of file
+var _0x90a8=['STRING','TEXT','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DATE','ENUM','out','long','getDataValue','lastMsgBody','split','slice','sequelize','html-to-text','iconv','exports'];(function(_0x3cb152,_0x57eb54){var _0x4f54c3=function(_0x273a45){while(--_0x273a45){_0x3cb152['push'](_0x3cb152['shift']());}};_0x4f54c3(++_0x57eb54);}(_0x90a8,0x1cd));var _0x890a=function(_0x387542,_0x5a7332){_0x387542=_0x387542-0x0;var _0x4222a9=_0x90a8[_0x387542];return _0x4222a9;};'use strict';var Sequelize=require(_0x890a('0x0'));var htmlToText=require(_0x890a('0x1'));var iconv=require(_0x890a('0x2'));module[_0x890a('0x3')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x890a('0x4')]},'note':{'type':Sequelize[_0x890a('0x4')]},'inReplyTo':{'type':Sequelize[_0x890a('0x4')](0xbe)},'to':{'type':Sequelize[_0x890a('0x4')]},'cc':{'type':Sequelize[_0x890a('0x5')]('long')},'subject':{'type':Sequelize['TEXT']('')+_0x890a('0x6')},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x890a('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x890a('0x7')]},'firstMsgDirection':{'type':Sequelize[_0x890a('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x890a('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x890a('0x8')]('in',_0x890a('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x890a('0x5')](_0x890a('0xa'))+_0x890a('0x6'),'get':function(){try{return this[_0x890a('0xb')]('lastMsgBody')?htmlToText['fromString'](this[_0x890a('0xb')](_0x890a('0xc')),{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'ignoreImage':!![]})[_0x890a('0xd')]('\x0a')[_0x890a('0xe')](0x0,0x6)['join']('\x0a'):null;}catch(_0x1516f0){return null;}}}};
\ No newline at end of file
index 9da4c68..77d680a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd20d=['merge','filter','options','tag','include','Tags','distinct','read','push','Messages','createdAt','includeAll','User','fullname','Owner','internal','MailAccount','email','MailMessage','direction','color','Tag','ThroughTags','rows','catch','params','find','create','body','addMessage','ids','omit','getMessages','findOne','intersection','hasOwnProperty','MailInteractionId','$gte','split','format','findAll','addTags','setTags','emit','removeTags','download','unix','toString','join','root','files','attachments','server','tmp','interaction-%s.zip','from','subject','Attachment','Attachments','basename','existsSync','type','readFileSync','writeFileSync','message%d.eml','log','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','ejs','lodash','squel','crypto','to-csv','querystring','../../components/parsers/qs','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./mailInteraction.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','error','stack','name','index','MailInteraction','rawAttributes','model','keys','query','dateStart','dateEnd','fields','attributes','length','nolimit','order','sort','where','filters','pick','add','day'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xd20d,0x1ad));var _0xdd20=function(_0x8bd7ed,_0x124d09){_0x8bd7ed=_0x8bd7ed-0x0;var _0x247fa2=_0xd20d[_0x8bd7ed];return _0x247fa2;};'use strict';var pdf=require(_0xdd20('0x0'));var emlformat=require(_0xdd20('0x1'));var rimraf=require(_0xdd20('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdd20('0x3'));var moment=require(_0xdd20('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdd20('0x5'));var util=require(_0xdd20('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdd20('0x7'));var fs=require('fs');var _=require(_0xdd20('0x8'));var squel=require(_0xdd20('0x9'));var crypto=require(_0xdd20('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdd20('0xb'));var querystring=require(_0xdd20('0xc'));var Papa=require('papaparse');var qs=require(_0xdd20('0xd'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xdd20('0xe'));var db=require(_0xdd20('0xf'))['db'];var socket=require(_0xdd20('0x10'))({'host':_0xdd20('0x11'),'port':0x18eb});require(_0xdd20('0x12'))['register'](socket);function respondWithStatusCode(_0x34e97f,_0x4e2ee5){_0x4e2ee5=_0x4e2ee5||0xcc;return function(_0x130f86){if(_0x130f86){return _0x34e97f[_0xdd20('0x13')](_0x4e2ee5);}return _0x34e97f[_0xdd20('0x14')](_0x4e2ee5)[_0xdd20('0x15')]();};}function respondWithResult(_0x57fe81,_0x1f4f21){_0x1f4f21=_0x1f4f21||0xc8;return function(_0x2ac080){if(_0x2ac080){return _0x57fe81[_0xdd20('0x14')](_0x1f4f21)[_0xdd20('0x16')](_0x2ac080);}};}function respondWithFilteredResult(_0x324138,_0x509ece){return function(_0x5a0432){if(_0x5a0432){var _0x4a0f72=_0x5a0432[_0xdd20('0x17')],_0x3ce8f6=_0x509ece[_0xdd20('0x18')],_0x19d94b=_0x509ece[_0xdd20('0x18')]+_0x509ece[_0xdd20('0x19')],_0xbeff87;if(_0x19d94b>=_0x4a0f72){_0x19d94b=_0x4a0f72;_0xbeff87=0xc8;}else{_0xbeff87=0xce;}_0x324138['status'](_0xbeff87);return _0x324138[_0xdd20('0x1a')](_0xdd20('0x1b'),_0x3ce8f6+'-'+_0x19d94b+'/'+_0x4a0f72)[_0xdd20('0x16')](_0x5a0432);}return null;};}function patchUpdates(_0x18e314){return function(_0x5cea62){try{jsonpatch['apply'](_0x5cea62,_0x18e314,!![]);}catch(_0x573669){return BPromise[_0xdd20('0x1c')](_0x573669);}return _0x5cea62[_0xdd20('0x1d')]();};}function saveUpdates(_0x2cb5eb,_0x5c7b2d){return function(_0xde4127){if(_0xde4127){return _0xde4127[_0xdd20('0x1e')](_0x2cb5eb)['then'](function(_0x1a77c5){return _0x1a77c5;});}return null;};}function removeEntity(_0x2c59d1,_0x5a6ded){return function(_0x52f562){if(_0x52f562){return _0x52f562[_0xdd20('0x1f')]()[_0xdd20('0x20')](function(){_0x2c59d1[_0xdd20('0x14')](0xcc)[_0xdd20('0x15')]();});}};}function handleEntityNotFound(_0x33aefc,_0x3ea229){return function(_0x224642){if(!_0x224642){_0x33aefc['sendStatus'](0x194);}return _0x224642;};}function handleError(_0x40b46b,_0x3debea){_0x3debea=_0x3debea||0x1f4;return function(_0x448c42){logger[_0xdd20('0x21')](_0x448c42[_0xdd20('0x22')]);if(_0x448c42[_0xdd20('0x23')]){delete _0x448c42[_0xdd20('0x23')];}_0x40b46b[_0xdd20('0x14')](_0x3debea)['send'](_0x448c42);};}exports[_0xdd20('0x24')]=function(_0x25e1a1,_0x576ffb){var _0xc97da8={},_0x578ab1={},_0xe7ecf={'count':0x0,'rows':[]};var _0x39a7ab=db[_0xdd20('0x25')][_0xdd20('0x26')];_0x578ab1[_0xdd20('0x27')]=_[_0xdd20('0x28')](_0x39a7ab);var _0x2c5a89={'dateStart':_0x25e1a1[_0xdd20('0x29')][_0xdd20('0x2a')],'dateEnd':_0x25e1a1[_0xdd20('0x29')][_0xdd20('0x2b')]};delete _0x25e1a1[_0xdd20('0x29')]['dateStart'];delete _0x25e1a1[_0xdd20('0x29')][_0xdd20('0x2b')];_0x578ab1[_0xdd20('0x29')]=_[_0xdd20('0x28')](_0x25e1a1[_0xdd20('0x29')]);_0x578ab1['filters']=_['intersection'](_0x578ab1['model'],_0x578ab1['query']);_0xc97da8['attributes']=_['intersection'](_0x578ab1[_0xdd20('0x27')],qs[_0xdd20('0x2c')](_0x25e1a1[_0xdd20('0x29')]['fields']));_0xc97da8[_0xdd20('0x2d')]=_0xc97da8[_0xdd20('0x2d')][_0xdd20('0x2e')]?_0xc97da8['attributes']:_0x578ab1['model'];if(!_0x25e1a1[_0xdd20('0x29')]['hasOwnProperty'](_0xdd20('0x2f'))){_0xc97da8[_0xdd20('0x19')]=qs[_0xdd20('0x19')](_0x25e1a1[_0xdd20('0x29')][_0xdd20('0x19')]);_0xc97da8['offset']=qs[_0xdd20('0x18')](_0x25e1a1[_0xdd20('0x29')][_0xdd20('0x18')]);}_0xc97da8[_0xdd20('0x30')]=qs[_0xdd20('0x31')](_0x25e1a1['query'][_0xdd20('0x31')]);_0xc97da8[_0xdd20('0x32')]=qs[_0xdd20('0x33')](_[_0xdd20('0x34')](_0x25e1a1[_0xdd20('0x29')],_0x578ab1[_0xdd20('0x33')]));if(_0x2c5a89[_0xdd20('0x2a')]){if(_0x2c5a89['dateEnd']){_0x2c5a89['dateEnd']=moment(_0x2c5a89[_0xdd20('0x2b')])[_0xdd20('0x35')](0x1,_0xdd20('0x36'));}else{_0x2c5a89[_0xdd20('0x2b')]=moment(_0x2c5a89[_0xdd20('0x2a')])[_0xdd20('0x35')](0x1,_0xdd20('0x36'));}_[_0xdd20('0x37')](_0xc97da8['where'],{'createdAt':{'$gte':_0x2c5a89[_0xdd20('0x2a')],'$lte':_0x2c5a89[_0xdd20('0x2b')]}});}if(_0x25e1a1[_0xdd20('0x29')][_0xdd20('0x38')]){_0xc97da8[_0xdd20('0x32')]=_[_0xdd20('0x37')](_0xc97da8[_0xdd20('0x32')],{'$or':_['map'](_0xc97da8[_0xdd20('0x2d')],function(_0x2b543a){var _0x25e617={};_0x25e617[_0x2b543a]={'$like':'%'+_0x25e1a1[_0xdd20('0x29')][_0xdd20('0x38')]+'%'};return _0x25e617;})});}_0xc97da8=_[_0xdd20('0x37')]({},_0xc97da8,_0x25e1a1[_0xdd20('0x39')]);var _0x4a7283={'where':_0xc97da8[_0xdd20('0x32')]};_0x4a7283['include']=[];if(_0x25e1a1[_0xdd20('0x29')][_0xdd20('0x3a')]){_0x4a7283[_0xdd20('0x3b')]['push']({'model':db['Tag'],'as':_0xdd20('0x3c'),'attributes':['id'],'where':{'id':_0x25e1a1[_0xdd20('0x29')][_0xdd20('0x3a')]},'required':!![]});_0x4a7283[_0xdd20('0x3d')]=!![];}if(_0x25e1a1[_0xdd20('0x29')][_0xdd20('0x3e')]){_0x4a7283['include'][_0xdd20('0x3f')]({'model':db['MailMessage'],'as':_0xdd20('0x40'),'attributes':['id','direction',_0xdd20('0x41'),_0xdd20('0x3e')],'where':{'direction':'in','read':_0x25e1a1[_0xdd20('0x29')][_0xdd20('0x3e')]||![]},'required':!![]});_0x4a7283['distinct']=!![];}return db['MailInteraction']['count'](_0x4a7283)['then'](function(_0x12be35){_0xe7ecf[_0xdd20('0x17')]=_0x12be35;if(_0x25e1a1[_0xdd20('0x29')][_0xdd20('0x42')]){_0xc97da8[_0xdd20('0x3b')]=[{'model':db[_0xdd20('0x43')],'as':'Users','required':![],'attributes':['id',_0xdd20('0x23'),_0xdd20('0x44')]},{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xdd20('0x43')],'as':_0xdd20('0x45'),'attributes':[_0xdd20('0x23'),'fullname',_0xdd20('0x46')],'required':![]},{'model':db[_0xdd20('0x47')],'as':'Account','attributes':[_0xdd20('0x23'),'key',_0xdd20('0x48')],'required':![]},{'model':db[_0xdd20('0x49')],'as':_0xdd20('0x40'),'attributes':['id',_0xdd20('0x4a'),_0xdd20('0x41'),_0xdd20('0x3e')],'where':{'direction':'in','read':_0x25e1a1[_0xdd20('0x29')][_0xdd20('0x3e')]||![]},'required':_0x25e1a1[_0xdd20('0x29')][_0xdd20('0x3e')]||![]},{'model':db['Tag'],'as':_0xdd20('0x3c'),'attributes':['id',_0xdd20('0x23'),_0xdd20('0x4b')],'required':_0x25e1a1[_0xdd20('0x29')][_0xdd20('0x3a')]?!![]:![]},{'model':db[_0xdd20('0x4c')],'as':_0xdd20('0x4d'),'attributes':['id',_0xdd20('0x23'),_0xdd20('0x4b')],'through':_0x25e1a1['query'][_0xdd20('0x3a')]?{'attributes':[],'where':{'TagId':_0x25e1a1[_0xdd20('0x29')][_0xdd20('0x3a')]||undefined}}:{},'required':_0x25e1a1[_0xdd20('0x29')][_0xdd20('0x3a')]?!![]:![]}];}return db[_0xdd20('0x25')]['findAll'](_0xc97da8);})[_0xdd20('0x20')](function(_0x1aac41){_0xe7ecf[_0xdd20('0x4e')]=_0x1aac41;return _0xe7ecf;})[_0xdd20('0x20')](respondWithFilteredResult(_0x576ffb,_0xc97da8))[_0xdd20('0x4f')](handleError(_0x576ffb,null));};exports['show']=function(_0x162378,_0x11a762){var _0x32b2c2={'raw':![],'where':{'id':_0x162378[_0xdd20('0x50')]['id']}},_0x203f77={};_0x203f77[_0xdd20('0x27')]=_[_0xdd20('0x28')](db[_0xdd20('0x25')][_0xdd20('0x26')]);_0x203f77[_0xdd20('0x29')]=_['keys'](_0x162378[_0xdd20('0x29')]);_0x203f77[_0xdd20('0x33')]=_['intersection'](_0x203f77['model'],_0x203f77[_0xdd20('0x29')]);_0x32b2c2['attributes']=_['intersection'](_0x203f77[_0xdd20('0x27')],qs['fields'](_0x162378[_0xdd20('0x29')][_0xdd20('0x2c')]));_0x32b2c2[_0xdd20('0x2d')]=_0x32b2c2[_0xdd20('0x2d')][_0xdd20('0x2e')]?_0x32b2c2[_0xdd20('0x2d')]:_0x203f77[_0xdd20('0x27')];if(_0x162378['query'][_0xdd20('0x42')]){_0x32b2c2['include']=[{'all':!![]}];}_0x32b2c2=_['merge']({},_0x32b2c2,_0x162378[_0xdd20('0x39')]);return db[_0xdd20('0x25')][_0xdd20('0x51')](_0x32b2c2)['then'](handleEntityNotFound(_0x11a762,null))['then'](respondWithResult(_0x11a762,null))[_0xdd20('0x4f')](handleError(_0x11a762,null));};exports['create']=function(_0x5c0365,_0x240600){return db[_0xdd20('0x25')][_0xdd20('0x52')](_0x5c0365[_0xdd20('0x53')],{})[_0xdd20('0x20')](respondWithResult(_0x240600,0xc9))['catch'](handleError(_0x240600,null));};exports[_0xdd20('0x1e')]=function(_0x20fd98,_0x16c9e6){if(_0x20fd98['body']['id']){delete _0x20fd98['body']['id'];}return db['MailInteraction'][_0xdd20('0x51')]({'where':{'id':_0x20fd98[_0xdd20('0x50')]['id']}})[_0xdd20('0x20')](handleEntityNotFound(_0x16c9e6,null))[_0xdd20('0x20')](saveUpdates(_0x20fd98[_0xdd20('0x53')],null))[_0xdd20('0x20')](respondWithResult(_0x16c9e6,null))[_0xdd20('0x4f')](handleError(_0x16c9e6,null));};exports['destroy']=function(_0x3e41d1,_0x3289b3){return db[_0xdd20('0x25')][_0xdd20('0x51')]({'where':{'id':_0x3e41d1[_0xdd20('0x50')]['id']}})[_0xdd20('0x20')](handleEntityNotFound(_0x3289b3,null))[_0xdd20('0x20')](removeEntity(_0x3289b3,null))[_0xdd20('0x4f')](handleError(_0x3289b3,null));};exports['describe']=function(_0x35565b,_0x334772){return db[_0xdd20('0x25')]['describe']()[_0xdd20('0x20')](respondWithResult(_0x334772,null))['catch'](handleError(_0x334772,null));};exports[_0xdd20('0x54')]=function(_0x53a568,_0x1ccaef,_0x57548d){return db[_0xdd20('0x49')][_0xdd20('0x51')]({'where':{'id':_0x53a568[_0xdd20('0x50')]['id']}})[_0xdd20('0x20')](handleEntityNotFound(_0x1ccaef,null))[_0xdd20('0x20')](function(_0x30d0af){if(_0x30d0af){return _0x30d0af[_0xdd20('0x54')](_0x53a568['body'][_0xdd20('0x55')],_[_0xdd20('0x56')](_0x53a568[_0xdd20('0x53')],[_0xdd20('0x55'),'id'])||{});}})['then'](respondWithResult(_0x1ccaef,null))[_0xdd20('0x4f')](handleError(_0x1ccaef,null));};exports[_0xdd20('0x57')]=function(_0x746b5a,_0x5af472,_0x5ef3b0){var _0x374cb5={'raw':![],'where':{}};var _0x479e12={};var _0x1c67c8={'count':0x0,'rows':[]};return db[_0xdd20('0x25')][_0xdd20('0x58')]({'where':{'id':_0x746b5a[_0xdd20('0x50')]['id']}})[_0xdd20('0x20')](handleEntityNotFound(_0x5af472,null))[_0xdd20('0x20')](function(_0x59ad26){if(_0x59ad26){_0x479e12[_0xdd20('0x27')]=_[_0xdd20('0x28')](db[_0xdd20('0x49')]['rawAttributes']);_0x479e12[_0xdd20('0x29')]=_[_0xdd20('0x28')](_0x746b5a[_0xdd20('0x29')]);_0x479e12[_0xdd20('0x33')]=_[_0xdd20('0x59')](_0x479e12[_0xdd20('0x27')],_0x479e12[_0xdd20('0x29')]);_0x374cb5[_0xdd20('0x2d')]=_[_0xdd20('0x59')](_0x479e12[_0xdd20('0x27')],qs['fields'](_0x746b5a[_0xdd20('0x29')][_0xdd20('0x2c')]));_0x374cb5[_0xdd20('0x2d')]=_0x374cb5[_0xdd20('0x2d')][_0xdd20('0x2e')]?_0x374cb5[_0xdd20('0x2d')]:_0x479e12[_0xdd20('0x27')];if(!_0x746b5a[_0xdd20('0x29')][_0xdd20('0x5a')](_0xdd20('0x2f'))){_0x374cb5[_0xdd20('0x19')]=qs[_0xdd20('0x19')](_0x746b5a[_0xdd20('0x29')][_0xdd20('0x19')]);_0x374cb5['offset']=qs['offset'](_0x746b5a[_0xdd20('0x29')][_0xdd20('0x18')]);}_0x374cb5[_0xdd20('0x30')]=qs[_0xdd20('0x31')](_0x746b5a[_0xdd20('0x29')][_0xdd20('0x31')]);_0x374cb5['where']=qs['filters'](_['pick'](_0x746b5a['query'],_0x479e12[_0xdd20('0x33')]));_0x374cb5[_0xdd20('0x32')][_0xdd20('0x5b')]=_0x59ad26['id'];if(_0x746b5a[_0xdd20('0x29')][_0xdd20('0x38')]){_0x374cb5['where']=_['merge'](_0x374cb5[_0xdd20('0x32')],{'$or':_['map'](_0x374cb5['attributes'],function(_0x4e1c9c){var _0x26e71f={};_0x26e71f[_0x4e1c9c]={'$like':'%'+_0x746b5a[_0xdd20('0x29')][_0xdd20('0x38')]+'%'};return _0x26e71f;})});}if(_0x746b5a['query'][_0xdd20('0x5c')]){var _0x5722ae=_0x746b5a['query']['$gte'][_0xdd20('0x5d')](',');var _0x1d0553={};_0x1d0553[_0x5722ae[0x0]]={'$gte':moment(_0x5722ae[0x1])[_0xdd20('0x5e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x374cb5['where']=_[_0xdd20('0x37')](_0x374cb5[_0xdd20('0x32')],_0x1d0553);}_0x374cb5=_[_0xdd20('0x37')]({},_0x374cb5,_0x746b5a[_0xdd20('0x39')]);return db[_0xdd20('0x49')][_0xdd20('0x17')]({'where':_0x374cb5[_0xdd20('0x32')]})[_0xdd20('0x20')](function(_0x5c13f5){_0x1c67c8['count']=_0x5c13f5;if(_0x746b5a[_0xdd20('0x29')][_0xdd20('0x42')]){_0x374cb5[_0xdd20('0x3b')]=[{'all':!![]}];}return db[_0xdd20('0x49')][_0xdd20('0x5f')](_0x374cb5);})[_0xdd20('0x20')](function(_0x10adb2){_0x1c67c8[_0xdd20('0x4e')]=_0x10adb2;return _0x1c67c8;});}})[_0xdd20('0x20')](respondWithFilteredResult(_0x5af472,_0x374cb5))[_0xdd20('0x4f')](handleError(_0x5af472,null));};exports[_0xdd20('0x60')]=function(_0x33fb34,_0x26789d,_0x45917c){return db['MailInteraction'][_0xdd20('0x51')]({'where':{'id':_0x33fb34[_0xdd20('0x50')]['id']}})[_0xdd20('0x20')](handleEntityNotFound(_0x26789d,null))['then'](function(_0x1fb68a){if(_0x1fb68a){return _0x1fb68a[_0xdd20('0x61')](_0x33fb34['body']['ids'],_[_0xdd20('0x56')](_0x33fb34[_0xdd20('0x53')],['ids','id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0xdd20('0x23'),_0xdd20('0x4b')],'where':{'id':_0x33fb34[_0xdd20('0x53')][_0xdd20('0x55')]}});})[_0xdd20('0x20')](function(_0x57d079){socket[_0xdd20('0x62')]('mailInteractionTags:save',{'id':Number(_0x33fb34[_0xdd20('0x50')]['id']),'tags':_0x57d079||[]});return{'id':Number(_0x33fb34[_0xdd20('0x50')]['id']),'tags':_0x57d079||[]};});}})[_0xdd20('0x20')](respondWithResult(_0x26789d,null))[_0xdd20('0x4f')](handleError(_0x26789d,null));};exports[_0xdd20('0x63')]=function(_0x5e8dc7,_0x33328a,_0x4424a3){var _0x50b72c;return db[_0xdd20('0x25')]['find']({'where':{'id':_0x5e8dc7[_0xdd20('0x50')]['id']}})['then'](handleEntityNotFound(_0x33328a,null))['then'](function(_0x22410d){if(_0x22410d){return _0x22410d[_0xdd20('0x63')](_0x5e8dc7[_0xdd20('0x29')]['ids']);}})[_0xdd20('0x20')](respondWithStatusCode(_0x33328a,null))[_0xdd20('0x4f')](handleError(_0x33328a,null));};exports[_0xdd20('0x64')]=function(_0x3946a7,_0x15846c){var _0x11e681=moment()[_0xdd20('0x65')]()[_0xdd20('0x66')]();var _0x404167=path[_0xdd20('0x67')](config[_0xdd20('0x68')],'server',_0xdd20('0x69'),_0xdd20('0x6a'));var _0x4e3ffd=path[_0xdd20('0x67')](config[_0xdd20('0x68')],_0xdd20('0x6b'),'files',_0xdd20('0x6c'));var _0x26fc89=path['join'](_0x4e3ffd,_0x11e681);var _0x537734=util['format'](_0xdd20('0x6d'),_0x11e681);var _0x1c85d2=path['join'](_0x4e3ffd,_0x537734);var _0x5dac00=![];return db[_0xdd20('0x25')][_0xdd20('0x51')]({'where':{'id':_0x3946a7[_0xdd20('0x50')]['id']}})[_0xdd20('0x20')](handleEntityNotFound(_0x15846c,null))[_0xdd20('0x20')](function(_0x1f70f8){if(_0x1f70f8){return _0x1f70f8[_0xdd20('0x57')]({'attributes':['id',_0xdd20('0x53'),_0xdd20('0x6e'),'to','cc',_0xdd20('0x6f'),_0xdd20('0x41')],'include':[{'model':db[_0xdd20('0x70')],'as':_0xdd20('0x71')}]});}return[];})['then'](function(_0xfd9a4e){_0x5dac00=_0xfd9a4e[_0xdd20('0x2e')];if(_0xfd9a4e['length']){fs['mkdirSync'](_0x26fc89);return BPromise['each'](_0xfd9a4e,function(_0x1ee071,_0x33ad30){var _0xa2eac9=_0x1ee071;var _0x299b85={'from':_0xa2eac9[_0xdd20('0x6e')],'to':_0xa2eac9['to'],'subject':_0xa2eac9[_0xdd20('0x6f')],'html':_0xa2eac9[_0xdd20('0x53')],'attachments':[]};return new BPromise(function(_0x2ac13d,_0x39a0bf){for(var _0x14c09f=0x0;_0x14c09f<_0x1ee071['Attachments'][_0xdd20('0x2e')];_0x14c09f++){var _0x12ba85=_0x1ee071['Attachments'][_0x14c09f];var _0x4c7916=path[_0xdd20('0x67')](_0x404167,_0x12ba85[_0xdd20('0x72')]);if(fs[_0xdd20('0x73')](_0x4c7916)){_0x299b85[_0xdd20('0x6a')][_0xdd20('0x3f')]({'name':_0x12ba85[_0xdd20('0x23')],'contentType':_0x12ba85[_0xdd20('0x74')],'data':fs[_0xdd20('0x75')](_0x4c7916)});}}emlformat['build'](_0x299b85,function(_0x4dc691,_0x5a0e20){if(_0x4dc691)return _0x39a0bf(_0x4dc691);fs[_0xdd20('0x76')](path[_0xdd20('0x67')](_0x26fc89,util[_0xdd20('0x5e')](_0xdd20('0x77'),_0x33ad30)),_0x5a0e20);return _0x2ac13d(_0x5a0e20);});});});}})['then'](function(){if(_0x5dac00){return new BPromise(function(_0x2651d3,_0x12602f){zipdir(_0x26fc89,{'saveTo':_0x1c85d2},function(_0x2f5e5e,_0x460ba3){if(_0x2f5e5e)return _0x12602f(_0x2f5e5e);return _0x2651d3(_0x460ba3);});});}})[_0xdd20('0x20')](function(){if(_0x5dac00){return new BPromise(function(_0x400e17,_0x5cb91e){rimraf(_0x26fc89,function(_0x467ec3){if(_0x467ec3)_0x5cb91e(_0x467ec3);return _0x400e17();});});}})[_0xdd20('0x20')](function(){if(_0x5dac00){return _0x15846c['download'](_0x1c85d2,_0x537734,function(_0x56ef6f){if(_0x56ef6f){console[_0xdd20('0x78')]('err',_0x56ef6f);}else{fs['unlinkSync'](_0x1c85d2);}});}else{return _0x15846c[_0xdd20('0x13')](0xc8);}})['catch'](handleError(_0x15846c,null));};
\ No newline at end of file
+var _0x0022=['User','Users','fullname','Contact','internal','MailAccount','email','Messages','Tag','color','ThroughTags','findAll','catch','params','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','sort','MailInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','files','root','tmp','interaction-%s.zip','Attachment','Attachments','mkdirSync','each','from','existsSync','attachments','type','readFileSync','writeFileSync','log','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','lodash','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','./mailInteraction.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','update','destroy','then','stack','name','send','index','rawAttributes','keys','query','dateStart','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','dateEnd','add','day','merge','filter','map','options','include','tag','push','Tags','distinct','read','MailMessage','direction','createdAt','MailInteraction'];(function(_0x4ed788,_0x27f718){var _0x1fc7dc=function(_0x1989ca){while(--_0x1989ca){_0x4ed788['push'](_0x4ed788['shift']());}};_0x1fc7dc(++_0x27f718);}(_0x0022,0xb4));var _0x2002=function(_0x129216,_0x5c208d){_0x129216=_0x129216-0x0;var _0x2a0306=_0x0022[_0x129216];return _0x2a0306;};'use strict';var pdf=require(_0x2002('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2002('0x1'));var zipdir=require(_0x2002('0x2'));var jsonpatch=require(_0x2002('0x3'));var rp=require(_0x2002('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2002('0x5'));var csv=require(_0x2002('0x6'));var ejs=require(_0x2002('0x7'));var fs=require('fs');var _=require(_0x2002('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2002('0x9'));var qs=require(_0x2002('0xa'));var logger=require('../../config/logger')(_0x2002('0xb'));var utils=require(_0x2002('0xc'));var config=require(_0x2002('0xd'));var db=require(_0x2002('0xe'))['db'];var socket=require('socket.io-emitter')({'host':'localhost','port':0x18eb});require(_0x2002('0xf'))[_0x2002('0x10')](socket);function respondWithStatusCode(_0x508f77,_0x4edc7e){_0x4edc7e=_0x4edc7e||0xcc;return function(_0x3861ef){if(_0x3861ef){return _0x508f77[_0x2002('0x11')](_0x4edc7e);}return _0x508f77['status'](_0x4edc7e)[_0x2002('0x12')]();};}function respondWithResult(_0x1c4a83,_0x214086){_0x214086=_0x214086||0xc8;return function(_0x3caf50){if(_0x3caf50){return _0x1c4a83[_0x2002('0x13')](_0x214086)[_0x2002('0x14')](_0x3caf50);}};}function respondWithFilteredResult(_0x4a69e3,_0x2ce237){return function(_0x4a9a51){if(_0x4a9a51){var _0x3a80ba=_0x4a9a51[_0x2002('0x15')],_0x2689f7=_0x2ce237[_0x2002('0x16')],_0x1243de=_0x2ce237[_0x2002('0x16')]+_0x2ce237[_0x2002('0x17')],_0x13a536;if(_0x1243de>=_0x3a80ba){_0x1243de=_0x3a80ba;_0x13a536=0xc8;}else{_0x13a536=0xce;}_0x4a69e3[_0x2002('0x13')](_0x13a536);return _0x4a69e3[_0x2002('0x18')](_0x2002('0x19'),_0x2689f7+'-'+_0x1243de+'/'+_0x3a80ba)[_0x2002('0x14')](_0x4a9a51);}return null;};}function patchUpdates(_0x1a4e22){return function(_0x362c28){try{jsonpatch[_0x2002('0x1a')](_0x362c28,_0x1a4e22,!![]);}catch(_0x3a5dc9){return BPromise['reject'](_0x3a5dc9);}return _0x362c28['save']();};}function saveUpdates(_0x302281,_0x528d3e){return function(_0x10981f){if(_0x10981f){return _0x10981f[_0x2002('0x1b')](_0x302281)['then'](function(_0x2f65a6){return _0x2f65a6;});}return null;};}function removeEntity(_0x5da47a,_0x2f9481){return function(_0x3f25e2){if(_0x3f25e2){return _0x3f25e2[_0x2002('0x1c')]()[_0x2002('0x1d')](function(){_0x5da47a[_0x2002('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3694d1,_0x12eb9e){return function(_0x17fe2a){if(!_0x17fe2a){_0x3694d1[_0x2002('0x11')](0x194);}return _0x17fe2a;};}function handleError(_0x5a3158,_0x5dd804){_0x5dd804=_0x5dd804||0x1f4;return function(_0x42cf9f){logger['error'](_0x42cf9f[_0x2002('0x1e')]);if(_0x42cf9f[_0x2002('0x1f')]){delete _0x42cf9f[_0x2002('0x1f')];}_0x5a3158[_0x2002('0x13')](_0x5dd804)[_0x2002('0x20')](_0x42cf9f);};}exports[_0x2002('0x21')]=function(_0x6c189c,_0x11ae29){var _0x5c1248={},_0x564cfe={},_0x2fdd07={'count':0x0,'rows':[]};var _0x2a5f4a=db['MailInteraction'][_0x2002('0x22')];_0x564cfe['model']=_[_0x2002('0x23')](_0x2a5f4a);var _0x323e32={'dateStart':_0x6c189c[_0x2002('0x24')][_0x2002('0x25')],'dateEnd':_0x6c189c[_0x2002('0x24')]['dateEnd']};delete _0x6c189c[_0x2002('0x24')]['dateStart'];delete _0x6c189c['query']['dateEnd'];_0x564cfe[_0x2002('0x24')]=_[_0x2002('0x23')](_0x6c189c[_0x2002('0x24')]);_0x564cfe[_0x2002('0x26')]=_[_0x2002('0x27')](_0x564cfe[_0x2002('0x28')],_0x564cfe[_0x2002('0x24')]);_0x5c1248[_0x2002('0x29')]=_['intersection'](_0x564cfe['model'],qs[_0x2002('0x2a')](_0x6c189c['query']['fields']));_0x5c1248[_0x2002('0x29')]=_0x5c1248['attributes'][_0x2002('0x2b')]?_0x5c1248[_0x2002('0x29')]:_0x564cfe[_0x2002('0x28')];if(!_0x6c189c[_0x2002('0x24')][_0x2002('0x2c')](_0x2002('0x2d'))){_0x5c1248['limit']=qs['limit'](_0x6c189c[_0x2002('0x24')][_0x2002('0x17')]);_0x5c1248[_0x2002('0x16')]=qs['offset'](_0x6c189c[_0x2002('0x24')]['offset']);}_0x5c1248[_0x2002('0x2e')]=qs['sort'](_0x6c189c[_0x2002('0x24')]['sort']);_0x5c1248[_0x2002('0x2f')]=qs[_0x2002('0x26')](_[_0x2002('0x30')](_0x6c189c[_0x2002('0x24')],_0x564cfe[_0x2002('0x26')]));if(_0x323e32[_0x2002('0x25')]){if(_0x323e32[_0x2002('0x31')]){_0x323e32[_0x2002('0x31')]=moment(_0x323e32[_0x2002('0x31')])[_0x2002('0x32')](0x1,_0x2002('0x33'));}else{_0x323e32[_0x2002('0x31')]=moment(_0x323e32[_0x2002('0x25')])[_0x2002('0x32')](0x1,_0x2002('0x33'));}_[_0x2002('0x34')](_0x5c1248['where'],{'createdAt':{'$gte':_0x323e32[_0x2002('0x25')],'$lte':_0x323e32[_0x2002('0x31')]}});}if(_0x6c189c[_0x2002('0x24')][_0x2002('0x35')]){_0x5c1248[_0x2002('0x2f')]=_[_0x2002('0x34')](_0x5c1248[_0x2002('0x2f')],{'$or':_[_0x2002('0x36')](_0x5c1248[_0x2002('0x29')],function(_0x5b7bc7){var _0x1cfe61={};_0x1cfe61[_0x5b7bc7]={'$like':'%'+_0x6c189c[_0x2002('0x24')][_0x2002('0x35')]+'%'};return _0x1cfe61;})});}_0x5c1248=_[_0x2002('0x34')]({},_0x5c1248,_0x6c189c[_0x2002('0x37')]);var _0x586983={'where':_0x5c1248[_0x2002('0x2f')]};_0x586983[_0x2002('0x38')]=[];if(_0x6c189c[_0x2002('0x24')][_0x2002('0x39')]){_0x586983['include'][_0x2002('0x3a')]({'model':db['Tag'],'as':_0x2002('0x3b'),'attributes':['id'],'where':{'id':_0x6c189c[_0x2002('0x24')][_0x2002('0x39')]},'required':!![]});_0x586983[_0x2002('0x3c')]=!![];}if(_0x6c189c['query'][_0x2002('0x3d')]){_0x586983[_0x2002('0x38')][_0x2002('0x3a')]({'model':db[_0x2002('0x3e')],'as':'Messages','attributes':['id',_0x2002('0x3f'),_0x2002('0x40'),'read'],'where':{'direction':'in','read':_0x6c189c['query']['read']||![]},'required':!![]});_0x586983[_0x2002('0x3c')]=!![];}return db[_0x2002('0x41')][_0x2002('0x15')](_0x586983)['then'](function(_0x514c63){_0x2fdd07[_0x2002('0x15')]=_0x514c63;if(_0x6c189c['query']['includeAll']){_0x5c1248[_0x2002('0x38')]=[{'model':db[_0x2002('0x42')],'as':_0x2002('0x43'),'required':![],'attributes':['id',_0x2002('0x1f'),_0x2002('0x44')]},{'model':db['CmContact'],'as':_0x2002('0x45'),'required':![]},{'model':db[_0x2002('0x42')],'as':'Owner','attributes':[_0x2002('0x1f'),_0x2002('0x44'),_0x2002('0x46')],'required':![]},{'model':db[_0x2002('0x47')],'as':'Account','attributes':[_0x2002('0x1f'),'key',_0x2002('0x48')],'required':![]},{'model':db[_0x2002('0x3e')],'as':_0x2002('0x49'),'attributes':['id',_0x2002('0x3f'),_0x2002('0x40'),_0x2002('0x3d')],'where':{'direction':'in','read':_0x6c189c['query'][_0x2002('0x3d')]||![]},'required':_0x6c189c[_0x2002('0x24')]['read']||![]},{'model':db[_0x2002('0x4a')],'as':_0x2002('0x3b'),'attributes':['id',_0x2002('0x1f'),_0x2002('0x4b')],'required':_0x6c189c['query'][_0x2002('0x39')]?!![]:![]},{'model':db[_0x2002('0x4a')],'as':_0x2002('0x4c'),'attributes':['id',_0x2002('0x1f'),_0x2002('0x4b')],'through':_0x6c189c['query'][_0x2002('0x39')]?{'attributes':[],'where':{'TagId':_0x6c189c[_0x2002('0x24')][_0x2002('0x39')]||undefined}}:{},'required':_0x6c189c['query']['tag']?!![]:![]}];}return db[_0x2002('0x41')][_0x2002('0x4d')](_0x5c1248);})[_0x2002('0x1d')](function(_0x3cf453){_0x2fdd07['rows']=_0x3cf453;return _0x2fdd07;})[_0x2002('0x1d')](respondWithFilteredResult(_0x11ae29,_0x5c1248))[_0x2002('0x4e')](handleError(_0x11ae29,null));};exports['show']=function(_0x49c372,_0x46cfe2){var _0xdd6664={'raw':![],'where':{'id':_0x49c372[_0x2002('0x4f')]['id']}},_0x5257aa={};_0x5257aa[_0x2002('0x28')]=_[_0x2002('0x23')](db[_0x2002('0x41')][_0x2002('0x22')]);_0x5257aa[_0x2002('0x24')]=_[_0x2002('0x23')](_0x49c372['query']);_0x5257aa[_0x2002('0x26')]=_['intersection'](_0x5257aa['model'],_0x5257aa[_0x2002('0x24')]);_0xdd6664[_0x2002('0x29')]=_[_0x2002('0x27')](_0x5257aa[_0x2002('0x28')],qs[_0x2002('0x2a')](_0x49c372[_0x2002('0x24')]['fields']));_0xdd6664['attributes']=_0xdd6664[_0x2002('0x29')][_0x2002('0x2b')]?_0xdd6664[_0x2002('0x29')]:_0x5257aa[_0x2002('0x28')];if(_0x49c372[_0x2002('0x24')]['includeAll']){_0xdd6664[_0x2002('0x38')]=[{'all':!![]}];}_0xdd6664=_[_0x2002('0x34')]({},_0xdd6664,_0x49c372[_0x2002('0x37')]);return db[_0x2002('0x41')][_0x2002('0x50')](_0xdd6664)['then'](handleEntityNotFound(_0x46cfe2,null))[_0x2002('0x1d')](respondWithResult(_0x46cfe2,null))[_0x2002('0x4e')](handleError(_0x46cfe2,null));};exports[_0x2002('0x51')]=function(_0x4309d4,_0x222f2c){return db[_0x2002('0x41')][_0x2002('0x51')](_0x4309d4[_0x2002('0x52')],{})[_0x2002('0x1d')](respondWithResult(_0x222f2c,0xc9))[_0x2002('0x4e')](handleError(_0x222f2c,null));};exports[_0x2002('0x1b')]=function(_0x2556e7,_0x183423){if(_0x2556e7[_0x2002('0x52')]['id']){delete _0x2556e7[_0x2002('0x52')]['id'];}return db['MailInteraction'][_0x2002('0x50')]({'where':{'id':_0x2556e7[_0x2002('0x4f')]['id']}})[_0x2002('0x1d')](handleEntityNotFound(_0x183423,null))[_0x2002('0x1d')](saveUpdates(_0x2556e7[_0x2002('0x52')],null))['then'](respondWithResult(_0x183423,null))[_0x2002('0x4e')](handleError(_0x183423,null));};exports['destroy']=function(_0x3ad227,_0x2d8bfc){return db[_0x2002('0x41')][_0x2002('0x50')]({'where':{'id':_0x3ad227[_0x2002('0x4f')]['id']}})[_0x2002('0x1d')](handleEntityNotFound(_0x2d8bfc,null))[_0x2002('0x1d')](removeEntity(_0x2d8bfc,null))[_0x2002('0x4e')](handleError(_0x2d8bfc,null));};exports['describe']=function(_0x1d0f90,_0x30e280){return db[_0x2002('0x41')][_0x2002('0x53')]()[_0x2002('0x1d')](respondWithResult(_0x30e280,null))[_0x2002('0x4e')](handleError(_0x30e280,null));};exports[_0x2002('0x54')]=function(_0x660240,_0x5c3cd6,_0x19cab4){return db[_0x2002('0x3e')][_0x2002('0x50')]({'where':{'id':_0x660240[_0x2002('0x4f')]['id']}})[_0x2002('0x1d')](handleEntityNotFound(_0x5c3cd6,null))[_0x2002('0x1d')](function(_0x263666){if(_0x263666){return _0x263666[_0x2002('0x54')](_0x660240[_0x2002('0x52')][_0x2002('0x55')],_[_0x2002('0x56')](_0x660240[_0x2002('0x52')],[_0x2002('0x55'),'id'])||{});}})[_0x2002('0x1d')](respondWithResult(_0x5c3cd6,null))['catch'](handleError(_0x5c3cd6,null));};exports[_0x2002('0x57')]=function(_0xf05517,_0xa63448,_0x37cd7b){var _0x5edc11={'raw':![],'where':{}};var _0x13247d={};var _0x2d858d={'count':0x0,'rows':[]};return db[_0x2002('0x41')][_0x2002('0x58')]({'where':{'id':_0xf05517[_0x2002('0x4f')]['id']}})[_0x2002('0x1d')](handleEntityNotFound(_0xa63448,null))['then'](function(_0x52b542){if(_0x52b542){_0x13247d[_0x2002('0x28')]=_['keys'](db[_0x2002('0x3e')]['rawAttributes']);_0x13247d[_0x2002('0x24')]=_[_0x2002('0x23')](_0xf05517[_0x2002('0x24')]);_0x13247d[_0x2002('0x26')]=_[_0x2002('0x27')](_0x13247d[_0x2002('0x28')],_0x13247d[_0x2002('0x24')]);_0x5edc11[_0x2002('0x29')]=_[_0x2002('0x27')](_0x13247d[_0x2002('0x28')],qs[_0x2002('0x2a')](_0xf05517[_0x2002('0x24')][_0x2002('0x2a')]));_0x5edc11['attributes']=_0x5edc11[_0x2002('0x29')][_0x2002('0x2b')]?_0x5edc11[_0x2002('0x29')]:_0x13247d['model'];if(!_0xf05517['query']['hasOwnProperty']('nolimit')){_0x5edc11[_0x2002('0x17')]=qs['limit'](_0xf05517[_0x2002('0x24')]['limit']);_0x5edc11[_0x2002('0x16')]=qs[_0x2002('0x16')](_0xf05517[_0x2002('0x24')][_0x2002('0x16')]);}_0x5edc11['order']=qs[_0x2002('0x59')](_0xf05517[_0x2002('0x24')][_0x2002('0x59')]);_0x5edc11[_0x2002('0x2f')]=qs['filters'](_['pick'](_0xf05517['query'],_0x13247d['filters']));_0x5edc11[_0x2002('0x2f')][_0x2002('0x5a')]=_0x52b542['id'];if(_0xf05517[_0x2002('0x24')]['filter']){_0x5edc11[_0x2002('0x2f')]=_[_0x2002('0x34')](_0x5edc11[_0x2002('0x2f')],{'$or':_[_0x2002('0x36')](_0x5edc11[_0x2002('0x29')],function(_0x463842){var _0x7660e4={};_0x7660e4[_0x463842]={'$like':'%'+_0xf05517[_0x2002('0x24')][_0x2002('0x35')]+'%'};return _0x7660e4;})});}if(_0xf05517[_0x2002('0x24')][_0x2002('0x5b')]){var _0x3ce4a9=_0xf05517[_0x2002('0x24')][_0x2002('0x5b')]['split'](',');var _0x3677bd={};_0x3677bd[_0x3ce4a9[0x0]]={'$gte':moment(_0x3ce4a9[0x1])[_0x2002('0x5c')](_0x2002('0x5d'))};_0x5edc11[_0x2002('0x2f')]=_['merge'](_0x5edc11[_0x2002('0x2f')],_0x3677bd);}_0x5edc11=_['merge']({},_0x5edc11,_0xf05517[_0x2002('0x37')]);return db[_0x2002('0x3e')][_0x2002('0x15')]({'where':_0x5edc11[_0x2002('0x2f')]})['then'](function(_0x3ba8e1){_0x2d858d['count']=_0x3ba8e1;if(_0xf05517['query'][_0x2002('0x5e')]){_0x5edc11[_0x2002('0x38')]=[{'all':!![]}];}return db[_0x2002('0x3e')][_0x2002('0x4d')](_0x5edc11);})[_0x2002('0x1d')](function(_0x9813e5){_0x2d858d[_0x2002('0x5f')]=_0x9813e5;return _0x2d858d;});}})[_0x2002('0x1d')](respondWithFilteredResult(_0xa63448,_0x5edc11))[_0x2002('0x4e')](handleError(_0xa63448,null));};exports[_0x2002('0x60')]=function(_0x241b4a,_0x50640d,_0x594e17){return db[_0x2002('0x41')][_0x2002('0x50')]({'where':{'id':_0x241b4a['params']['id']}})[_0x2002('0x1d')](handleEntityNotFound(_0x50640d,null))['then'](function(_0x2e6acf){if(_0x2e6acf){return _0x2e6acf[_0x2002('0x61')](_0x241b4a[_0x2002('0x52')]['ids'],_[_0x2002('0x56')](_0x241b4a[_0x2002('0x52')],['ids','id'])||{})[_0x2002('0x62')](function(){return db['Tag'][_0x2002('0x4d')]({'attributes':['id',_0x2002('0x1f'),_0x2002('0x4b')],'where':{'id':_0x241b4a['body']['ids']}});})[_0x2002('0x1d')](function(_0x2358b0){socket[_0x2002('0x63')](_0x2002('0x64'),{'id':Number(_0x241b4a[_0x2002('0x4f')]['id']),'tags':_0x2358b0||[]});return{'id':Number(_0x241b4a[_0x2002('0x4f')]['id']),'tags':_0x2358b0||[]};});}})[_0x2002('0x1d')](respondWithResult(_0x50640d,null))['catch'](handleError(_0x50640d,null));};exports[_0x2002('0x65')]=function(_0x558025,_0x44813d,_0x3313cf){var _0x597441;return db[_0x2002('0x41')][_0x2002('0x50')]({'where':{'id':_0x558025['params']['id']}})[_0x2002('0x1d')](handleEntityNotFound(_0x44813d,null))['then'](function(_0x4ba5e4){if(_0x4ba5e4){return _0x4ba5e4['removeTags'](_0x558025[_0x2002('0x24')][_0x2002('0x55')]);}})[_0x2002('0x1d')](respondWithStatusCode(_0x44813d,null))['catch'](handleError(_0x44813d,null));};exports[_0x2002('0x66')]=function(_0x556a40,_0x55e2ca){var _0x1fe6f1=moment()[_0x2002('0x67')]()['toString']();var _0x2e2fbb=path[_0x2002('0x68')](config['root'],_0x2002('0x69'),_0x2002('0x6a'),'attachments');var _0x25e966=path[_0x2002('0x68')](config[_0x2002('0x6b')],_0x2002('0x69'),_0x2002('0x6a'),_0x2002('0x6c'));var _0x1bd5b2=path[_0x2002('0x68')](_0x25e966,_0x1fe6f1);var _0x29f541=util['format'](_0x2002('0x6d'),_0x1fe6f1);var _0x20ab08=path[_0x2002('0x68')](_0x25e966,_0x29f541);var _0x239bb3=![];return db[_0x2002('0x41')][_0x2002('0x50')]({'where':{'id':_0x556a40[_0x2002('0x4f')]['id']}})[_0x2002('0x1d')](handleEntityNotFound(_0x55e2ca,null))[_0x2002('0x1d')](function(_0x165cfa){if(_0x165cfa){return _0x165cfa[_0x2002('0x57')]({'attributes':['id',_0x2002('0x52'),'from','to','cc','subject',_0x2002('0x40')],'include':[{'model':db[_0x2002('0x6e')],'as':_0x2002('0x6f')}]});}return[];})[_0x2002('0x1d')](function(_0x4b374e){_0x239bb3=_0x4b374e[_0x2002('0x2b')];if(_0x4b374e[_0x2002('0x2b')]){fs[_0x2002('0x70')](_0x1bd5b2);return BPromise[_0x2002('0x71')](_0x4b374e,function(_0x27cd88,_0x2f2105){var _0x1f79a3=_0x27cd88;var _0x1ba953={'from':_0x1f79a3[_0x2002('0x72')],'to':_0x1f79a3['to'],'subject':_0x1f79a3['subject'],'html':_0x1f79a3[_0x2002('0x52')],'attachments':[]};return new BPromise(function(_0x1a5ee9,_0x53c94e){for(var _0x54714e=0x0;_0x54714e<_0x27cd88[_0x2002('0x6f')][_0x2002('0x2b')];_0x54714e++){var _0x12b5b4=_0x27cd88[_0x2002('0x6f')][_0x54714e];var _0x31c5b4=path[_0x2002('0x68')](_0x2e2fbb,_0x12b5b4['basename']);if(fs[_0x2002('0x73')](_0x31c5b4)){_0x1ba953[_0x2002('0x74')][_0x2002('0x3a')]({'name':_0x12b5b4[_0x2002('0x1f')],'contentType':_0x12b5b4[_0x2002('0x75')],'data':fs[_0x2002('0x76')](_0x31c5b4)});}}emlformat['build'](_0x1ba953,function(_0x29bdc5,_0x5e59e9){if(_0x29bdc5)return _0x53c94e(_0x29bdc5);fs[_0x2002('0x77')](path[_0x2002('0x68')](_0x1bd5b2,util[_0x2002('0x5c')]('message%d.eml',_0x2f2105)),_0x5e59e9);return _0x1a5ee9(_0x5e59e9);});});});}})[_0x2002('0x1d')](function(){if(_0x239bb3){return new BPromise(function(_0x53f4ed,_0x5cabd5){zipdir(_0x1bd5b2,{'saveTo':_0x20ab08},function(_0x31f55d,_0x48d5bc){if(_0x31f55d)return _0x5cabd5(_0x31f55d);return _0x53f4ed(_0x48d5bc);});});}})[_0x2002('0x1d')](function(){if(_0x239bb3){return new BPromise(function(_0x31622f,_0x1441d7){rimraf(_0x1bd5b2,function(_0x52f5a0){if(_0x52f5a0)_0x1441d7(_0x52f5a0);return _0x31622f();});});}})[_0x2002('0x1d')](function(){if(_0x239bb3){return _0x55e2ca[_0x2002('0x66')](_0x20ab08,_0x29f541,function(_0x52619d){if(_0x52619d){console[_0x2002('0x78')](_0x2002('0x79'),_0x52619d);}else{fs[_0x2002('0x7a')](_0x20ab08);}});}else{return _0x55e2ca[_0x2002('0x11')](0xc8);}})['catch'](handleError(_0x55e2ca,null));};
\ No newline at end of file
index e5c888f..3585f4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c91=['exports','events','MailInteraction','save','update','remove'];(function(_0x13df52,_0x250fac){var _0x27f72c=function(_0x3f49d5){while(--_0x3f49d5){_0x13df52['push'](_0x13df52['shift']());}};_0x27f72c(++_0x250fac);}(_0x6c91,0x175));var _0x16c9=function(_0x4945fc,_0x1f67a8){_0x4945fc=_0x4945fc-0x0;var _0x516e0c=_0x6c91[_0x4945fc];return _0x516e0c;};'use strict';var EventEmitter=require(_0x16c9('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x16c9('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x16c9('0x2'),'afterUpdate':_0x16c9('0x3'),'afterDestroy':_0x16c9('0x4')};function emitEvent(_0x5333e3){return function(_0x4fe7e4,_0x140a85,_0xfe8d33){MailInteractionEvents['emit'](_0x5333e3+':'+_0x4fe7e4['id'],_0x4fe7e4);MailInteractionEvents['emit'](_0x5333e3,_0x4fe7e4);_0xfe8d33(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x16c9('0x5')]=MailInteractionEvents;
\ No newline at end of file
+var _0x718e=['hook','events','../../mysqldb','save','remove','emit','hasOwnProperty'];(function(_0x12556c,_0x29157c){var _0x30a2d7=function(_0x4fa242){while(--_0x4fa242){_0x12556c['push'](_0x12556c['shift']());}};_0x30a2d7(++_0x29157c);}(_0x718e,0x158));var _0xe718=function(_0xc9b988,_0x429150){_0xc9b988=_0xc9b988-0x0;var _0x5f14fe=_0x718e[_0xc9b988];return _0x5f14fe;};'use strict';var EventEmitter=require(_0xe718('0x0'));var MailInteraction=require(_0xe718('0x1'))['db']['MailInteraction'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe718('0x2'),'afterUpdate':'update','afterDestroy':_0xe718('0x3')};function emitEvent(_0x211755){return function(_0x3aba4b,_0x1d169b,_0x454822){MailInteractionEvents['emit'](_0x211755+':'+_0x3aba4b['id'],_0x3aba4b);MailInteractionEvents[_0xe718('0x4')](_0x211755,_0x3aba4b);_0x454822(null);};}for(var e in events){if(events[_0xe718('0x5')](e)){var event=events[e];MailInteraction[_0xe718('0x6')](e,emitEvent(event));}}module['exports']=MailInteractionEvents;
\ No newline at end of file
index bdd07d0..8889beb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x170a=['define','MailInteraction','mail_interactions','lodash','util','../../config/logger','moment','request-promise','exports'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x170a,0xed));var _0xa170=function(_0x27ef58,_0x537eb1){_0x27ef58=_0x27ef58-0x0;var _0x481244=_0x170a[_0x27ef58];return _0x481244;};'use strict';var _=require(_0xa170('0x0'));var util=require(_0xa170('0x1'));var logger=require(_0xa170('0x2'))('api');var moment=require(_0xa170('0x3'));var BPromise=require('bluebird');var rp=require(_0xa170('0x4'));var attributes=require('./mailInteraction.attributes');module[_0xa170('0x5')]=function(_0x18866d,_0x1cf4b5){return _0x18866d[_0xa170('0x6')](_0xa170('0x7'),attributes,{'tableName':_0xa170('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x312f=['util','api','bluebird','request-promise','exports','MailInteraction','mail_interactions','lodash'];(function(_0x4e029f,_0x177074){var _0x135b7e=function(_0x37caff){while(--_0x37caff){_0x4e029f['push'](_0x4e029f['shift']());}};_0x135b7e(++_0x177074);}(_0x312f,0xbf));var _0xf312=function(_0x22ab1a,_0x10066e){_0x22ab1a=_0x22ab1a-0x0;var _0x49ce15=_0x312f[_0x22ab1a];return _0x49ce15;};'use strict';var _=require(_0xf312('0x0'));var util=require(_0xf312('0x1'));var logger=require('../../config/logger')(_0xf312('0x2'));var moment=require('moment');var BPromise=require(_0xf312('0x3'));var rp=require(_0xf312('0x4'));var attributes=require('./mailInteraction.attributes');module[_0xf312('0x5')]=function(_0x5bf262,_0x41f7d8){return _0x5bf262['define'](_0xf312('0x6'),attributes,{'tableName':_0xf312('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fd50341..1fe135e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb175=['jayson/promise','client','http','localhost','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','UpdateMailInteraction','MailInteraction','update','body','raw','options','where','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0xb175,0x10a));var _0x5b17=function(_0x2e6014,_0x17b856){_0x2e6014=_0x2e6014-0x0;var _0x161a7c=_0xb175[_0x2e6014];return _0x161a7c;};'use strict';var _=require(_0x5b17('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5b17('0x1'));var rs=require(_0x5b17('0x2'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x5b17('0x3'));var logger=require(_0x5b17('0x4'))('rpc');var config=require(_0x5b17('0x5'));var jayson=require(_0x5b17('0x6'));var client=jayson[_0x5b17('0x7')][_0x5b17('0x8')]({'port':0x232a});var socket=require('socket.io-emitter')({'host':_0x5b17('0x9'),'port':0x18eb});require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x1152c3,_0x1b9864,_0x88ad3c){return new BPromise(function(_0x335812,_0x3f6853){return client[_0x5b17('0xa')](_0x1152c3,_0x88ad3c)[_0x5b17('0xb')](function(_0x4044c0){logger[_0x5b17('0xc')](_0x5b17('0xd'),_0x1b9864,_0x5b17('0xe'));logger[_0x5b17('0xf')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x1b9864,_0x5b17('0xe'),JSON[_0x5b17('0x10')](_0x4044c0));if(_0x4044c0[_0x5b17('0x11')]){if(_0x4044c0[_0x5b17('0x11')]['code']===0x1f4){logger[_0x5b17('0x11')]('MailInteraction,\x20%s,\x20%s',_0x1b9864,_0x4044c0[_0x5b17('0x11')][_0x5b17('0x12')]);return _0x3f6853(_0x4044c0[_0x5b17('0x11')][_0x5b17('0x12')]);}logger[_0x5b17('0x11')](_0x5b17('0xd'),_0x1b9864,_0x4044c0[_0x5b17('0x11')][_0x5b17('0x12')]);return _0x335812(_0x4044c0[_0x5b17('0x11')]['message']);}else{logger[_0x5b17('0xc')](_0x5b17('0xd'),_0x1b9864,'request\x20sent');_0x335812(_0x4044c0['result'][_0x5b17('0x12')]);}})[_0x5b17('0x13')](function(_0x3d619e){logger[_0x5b17('0x11')](_0x5b17('0xd'),_0x1b9864,_0x3d619e);_0x3f6853(_0x3d619e);});});}exports[_0x5b17('0x14')]=function(_0x5940bf){var _0x215ed3=this;return new Promise(function(_0xbc4c09,_0x285562){return db[_0x5b17('0x15')][_0x5b17('0x16')](_0x5940bf[_0x5b17('0x17')],{'raw':_0x5940bf['options']?_0x5940bf['options'][_0x5b17('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5940bf[_0x5b17('0x19')]?_0x5940bf[_0x5b17('0x19')][_0x5b17('0x1a')]||null:null,'attributes':_0x5940bf[_0x5b17('0x19')]?_0x5940bf[_0x5b17('0x19')]['attributes']||null:null,'limit':_0x5940bf[_0x5b17('0x19')]?_0x5940bf[_0x5b17('0x19')]['limit']||null:null})[_0x5b17('0xb')](function(_0x2656db){logger[_0x5b17('0xc')](_0x5b17('0x14'),_0x5940bf);logger[_0x5b17('0xf')]('UpdateMailInteraction',_0x5940bf,JSON['stringify'](_0x2656db));_0xbc4c09(_0x2656db);})[_0x5b17('0x13')](function(_0x5f1bb4){logger[_0x5b17('0x11')](_0x5b17('0x14'),_0x5f1bb4[_0x5b17('0x12')],_0x5940bf);_0x285562(_0x215ed3[_0x5b17('0x11')](0x1f4,_0x5f1bb4['message']));});});};exports[_0x5b17('0x1b')]=function(_0x4b7eda){return new Promise(function(_0x6ec6d2,_0x53c228){return db[_0x5b17('0x15')][_0x5b17('0x1c')]({'where':_0x4b7eda['options']?_0x4b7eda['options'][_0x5b17('0x1a')]||null:null})[_0x5b17('0xb')](function(_0x1b5a05){if(_0x1b5a05){return _0x1b5a05[_0x5b17('0x1d')](_0x4b7eda[_0x5b17('0x17')][_0x5b17('0x1e')],_[_0x5b17('0x1f')](_0x4b7eda[_0x5b17('0x17')],['ids','id'])||{});}})[_0x5b17('0x20')](function(_0x48b39b){logger['info'](_0x5b17('0x21'),_0x4b7eda);logger[_0x5b17('0xf')]('AddTags',_0x4b7eda,JSON[_0x5b17('0x10')](_0x48b39b));_0x6ec6d2(_0x48b39b);})[_0x5b17('0x13')](function(_0x165827){logger[_0x5b17('0x11')](_0x5b17('0x21'),_0x165827[_0x5b17('0x12')],_0x4b7eda);_0x53c228(_this[_0x5b17('0x11')](0x1f4,_0x165827[_0x5b17('0x12')]));});});};
\ No newline at end of file
+var _0x769e=['limit','debug','AddTagsToMailInteraction','MailInteraction','addTags','ids','spread','AddTags','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateMailInteraction','body','options','where','attributes'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x769e,0x168));var _0xe769=function(_0x5614e4,_0xac19fe){_0x5614e4=_0x5614e4-0x0;var _0x156355=_0x769e[_0x5614e4];return _0x156355;};'use strict';var _=require(_0xe769('0x0'));var util=require(_0xe769('0x1'));var moment=require(_0xe769('0x2'));var BPromise=require(_0xe769('0x3'));var rs=require(_0xe769('0x4'));var fs=require('fs');var db=require(_0xe769('0x5'))['db'];var utils=require(_0xe769('0x6'));var logger=require(_0xe769('0x7'))(_0xe769('0x8'));var config=require('../../config/environment');var jayson=require(_0xe769('0x9'));var client=jayson[_0xe769('0xa')][_0xe769('0xb')]({'port':0x232a});var socket=require(_0xe769('0xc'))({'host':'localhost','port':0x18eb});require(_0xe769('0xd'))[_0xe769('0xe')](socket);function respondWithRpcPromise(_0x2eb180,_0x5bc4c2,_0x4284b5){return new BPromise(function(_0x35322a,_0x85d0c5){return client[_0xe769('0xf')](_0x2eb180,_0x4284b5)[_0xe769('0x10')](function(_0x51fafc){logger[_0xe769('0x11')](_0xe769('0x12'),_0x5bc4c2,_0xe769('0x13'));logger['debug'](_0xe769('0x14'),_0x5bc4c2,_0xe769('0x13'),JSON[_0xe769('0x15')](_0x51fafc));if(_0x51fafc[_0xe769('0x16')]){if(_0x51fafc['error']['code']===0x1f4){logger[_0xe769('0x16')]('MailInteraction,\x20%s,\x20%s',_0x5bc4c2,_0x51fafc[_0xe769('0x16')][_0xe769('0x17')]);return _0x85d0c5(_0x51fafc['error']['message']);}logger[_0xe769('0x16')](_0xe769('0x12'),_0x5bc4c2,_0x51fafc[_0xe769('0x16')][_0xe769('0x17')]);return _0x35322a(_0x51fafc['error'][_0xe769('0x17')]);}else{logger[_0xe769('0x11')](_0xe769('0x12'),_0x5bc4c2,_0xe769('0x13'));_0x35322a(_0x51fafc[_0xe769('0x18')]['message']);}})['catch'](function(_0xdb7067){logger['error'](_0xe769('0x12'),_0x5bc4c2,_0xdb7067);_0x85d0c5(_0xdb7067);});});}exports[_0xe769('0x19')]=function(_0x3679eb){var _0x56c35b=this;return new Promise(function(_0x1304c4,_0x2a35e3){return db['MailInteraction']['update'](_0x3679eb[_0xe769('0x1a')],{'raw':_0x3679eb[_0xe769('0x1b')]?_0x3679eb[_0xe769('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3679eb['options']?_0x3679eb[_0xe769('0x1b')][_0xe769('0x1c')]||null:null,'attributes':_0x3679eb[_0xe769('0x1b')]?_0x3679eb[_0xe769('0x1b')][_0xe769('0x1d')]||null:null,'limit':_0x3679eb[_0xe769('0x1b')]?_0x3679eb[_0xe769('0x1b')][_0xe769('0x1e')]||null:null})[_0xe769('0x10')](function(_0x1184f4){logger[_0xe769('0x11')](_0xe769('0x19'),_0x3679eb);logger[_0xe769('0x1f')]('UpdateMailInteraction',_0x3679eb,JSON[_0xe769('0x15')](_0x1184f4));_0x1304c4(_0x1184f4);})['catch'](function(_0x1961fd){logger[_0xe769('0x16')]('UpdateMailInteraction',_0x1961fd[_0xe769('0x17')],_0x3679eb);_0x2a35e3(_0x56c35b[_0xe769('0x16')](0x1f4,_0x1961fd[_0xe769('0x17')]));});});};exports[_0xe769('0x20')]=function(_0x1c3e16){return new Promise(function(_0x3d10cd,_0x4757c5){return db[_0xe769('0x21')]['find']({'where':_0x1c3e16['options']?_0x1c3e16['options'][_0xe769('0x1c')]||null:null})[_0xe769('0x10')](function(_0x11f4da){if(_0x11f4da){return _0x11f4da[_0xe769('0x22')](_0x1c3e16[_0xe769('0x1a')][_0xe769('0x23')],_['omit'](_0x1c3e16[_0xe769('0x1a')],[_0xe769('0x23'),'id'])||{});}})[_0xe769('0x24')](function(_0x2681bb){logger['info']('AddTags',_0x1c3e16);logger[_0xe769('0x1f')](_0xe769('0x25'),_0x1c3e16,JSON['stringify'](_0x2681bb));_0x3d10cd(_0x2681bb);})[_0xe769('0x26')](function(_0x526cf6){logger[_0xe769('0x16')]('AddTags',_0x526cf6[_0xe769('0x17')],_0x1c3e16);_0x4757c5(_this[_0xe769('0x16')](0x1f4,_0x526cf6['message']));});});};
\ No newline at end of file
index 987ade9..b6ad2cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b2a=['register','length','mailInteraction:','save','remove','update','emit','removeListener'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x9b2a,0xbb));var _0xa9b2=function(_0x556243,_0x159e97){_0x556243=_0x556243-0x0;var _0x37c1b1=_0x9b2a[_0x556243];return _0x37c1b1;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xa9b2('0x0'),_0xa9b2('0x1'),_0xa9b2('0x2')];function createListener(_0x5582fa,_0x343637){return function(_0x13b860){_0x343637[_0xa9b2('0x3')](_0x5582fa,_0x13b860);};}function removeListener(_0x401089,_0x19affe){return function(){MailInteractionEvents[_0xa9b2('0x4')](_0x401089,_0x19affe);};}exports[_0xa9b2('0x5')]=function(_0x558842){for(var _0x183d2a=0x0,_0x1950c2=events[_0xa9b2('0x6')];_0x183d2a<_0x1950c2;_0x183d2a++){var _0x786dc9=events[_0x183d2a];var _0x40c8d1=createListener(_0xa9b2('0x7')+_0x786dc9,_0x558842);MailInteractionEvents['on'](_0x786dc9,_0x40c8d1);}};
\ No newline at end of file
+var _0x07ea=['mailInteraction:','./mailInteraction.events','save','remove','update','removeListener','register'];(function(_0x32ace4,_0x3801a8){var _0x57981b=function(_0x552690){while(--_0x552690){_0x32ace4['push'](_0x32ace4['shift']());}};_0x57981b(++_0x3801a8);}(_0x07ea,0xef));var _0xa07e=function(_0x16759a,_0x2c1f70){_0x16759a=_0x16759a-0x0;var _0x49d27a=_0x07ea[_0x16759a];return _0x49d27a;};'use strict';var MailInteractionEvents=require(_0xa07e('0x0'));var events=[_0xa07e('0x1'),_0xa07e('0x2'),_0xa07e('0x3')];function createListener(_0x51abdd,_0x243ba6){return function(_0x4a977e){_0x243ba6['emit'](_0x51abdd,_0x4a977e);};}function removeListener(_0x354692,_0x1d0611){return function(){MailInteractionEvents[_0xa07e('0x4')](_0x354692,_0x1d0611);};}exports[_0xa07e('0x5')]=function(_0x893aaa){for(var _0x24dd2a=0x0,_0x4c6bea=events['length'];_0x24dd2a<_0x4c6bea;_0x24dd2a++){var _0x4151a0=events[_0x24dd2a];var _0x366159=createListener(_0xa07e('0x6')+_0x4151a0,_0x893aaa);MailInteractionEvents['on'](_0x4151a0,_0x366159);}};
\ No newline at end of file
index fe06584..ea75a8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x880c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','/:id/download','post','tracked','mailmessage:create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','express'];(function(_0x4d2263,_0x3fbf0d){var _0x24aba0=function(_0x389a59){while(--_0x389a59){_0x4d2263['push'](_0x4d2263['shift']());}};_0x24aba0(++_0x3fbf0d);}(_0x880c,0x92));var _0xc880=function(_0x54c632,_0x24e6ad){_0x54c632=_0x54c632-0x0;var _0x272c9f=_0x880c[_0x54c632];return _0x272c9f;};'use strict';var multer=require(_0xc880('0x0'));var util=require(_0xc880('0x1'));var path=require(_0xc880('0x2'));var express=require(_0xc880('0x3'));var router=express['Router']();var auth=require(_0xc880('0x4'));var interaction=require(_0xc880('0x5'));var config=require(_0xc880('0x6'));var controller=require(_0xc880('0x7'));router[_0xc880('0x8')]('/',auth[_0xc880('0x9')](),controller[_0xc880('0xa')]);router[_0xc880('0x8')](_0xc880('0xb'),auth[_0xc880('0x9')](),controller['describe']);router['get']('/:id',auth[_0xc880('0x9')](),controller['show']);router[_0xc880('0x8')](_0xc880('0xc'),auth['isAuthenticated'](),controller['download']);router[_0xc880('0xd')]('/',auth[_0xc880('0x9')](),interaction[_0xc880('0xe')]('mail',_0xc880('0xf')),controller['create']);router[_0xc880('0x10')](_0xc880('0x11'),auth[_0xc880('0x9')](),controller[_0xc880('0x12')]);router[_0xc880('0x10')](_0xc880('0x13'),auth[_0xc880('0x9')](),controller[_0xc880('0x14')]);router['put'](_0xc880('0x15'),auth[_0xc880('0x9')](),controller[_0xc880('0x16')]);router[_0xc880('0x17')](_0xc880('0x11'),auth['isAuthenticated'](),controller[_0xc880('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0xa898=['put','update','accept','reject','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create'];(function(_0x470ae0,_0x28c323){var _0x141038=function(_0x2bbca9){while(--_0x2bbca9){_0x470ae0['push'](_0x470ae0['shift']());}};_0x141038(++_0x28c323);}(_0xa898,0x13a));var _0x8a89=function(_0x14775d,_0x1f7657){_0x14775d=_0x14775d-0x0;var _0x2ac090=_0xa898[_0x14775d];return _0x2ac090;};'use strict';var multer=require(_0x8a89('0x0'));var util=require(_0x8a89('0x1'));var path=require(_0x8a89('0x2'));var express=require(_0x8a89('0x3'));var router=express[_0x8a89('0x4')]();var auth=require(_0x8a89('0x5'));var interaction=require(_0x8a89('0x6'));var config=require(_0x8a89('0x7'));var controller=require(_0x8a89('0x8'));router[_0x8a89('0x9')]('/',auth[_0x8a89('0xa')](),controller[_0x8a89('0xb')]);router['get'](_0x8a89('0xc'),auth['isAuthenticated'](),controller[_0x8a89('0xd')]);router[_0x8a89('0x9')](_0x8a89('0xe'),auth['isAuthenticated'](),controller[_0x8a89('0xf')]);router[_0x8a89('0x9')](_0x8a89('0x10'),auth['isAuthenticated'](),controller[_0x8a89('0x11')]);router[_0x8a89('0x12')]('/',auth[_0x8a89('0xa')](),interaction[_0x8a89('0x13')](_0x8a89('0x14'),_0x8a89('0x15')),controller['create']);router[_0x8a89('0x16')](_0x8a89('0xe'),auth[_0x8a89('0xa')](),controller[_0x8a89('0x17')]);router[_0x8a89('0x16')]('/:id/accept',auth[_0x8a89('0xa')](),controller[_0x8a89('0x18')]);router[_0x8a89('0x16')]('/:id/reject',auth[_0x8a89('0xa')](),controller[_0x8a89('0x19')]);router[_0x8a89('0x1a')](_0x8a89('0xe'),auth[_0x8a89('0xa')](),controller[_0x8a89('0x1b')]);module['exports']=router;
\ No newline at end of file
index 0e5ac4e..66d3cac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf50b=['sequelize','lodash','TEXT','long','BOOLEAN','ENUM','out','STRING','DATE','INTEGER'];(function(_0x552fce,_0x3f24bc){var _0x3e27a2=function(_0xc91154){while(--_0xc91154){_0x552fce['push'](_0x552fce['shift']());}};_0x3e27a2(++_0x3f24bc);}(_0xf50b,0xc8));var _0xbf50=function(_0x3d83c8,_0x2c9f99){_0x3d83c8=_0x3d83c8-0x0;var _0x4b6ddb=_0xf50b[_0x3d83c8];return _0x4b6ddb;};'use strict';var Sequelize=require(_0xbf50('0x0'));var _=require(_0xbf50('0x1'));module['exports']={'body':{'type':Sequelize[_0xbf50('0x2')](_0xbf50('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbf50('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbf50('0x5')]('in','out'),'defaultValue':_0xbf50('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'from':{'type':Sequelize[_0xbf50('0x7')]},'to':{'type':Sequelize[_0xbf50('0x2')](_0xbf50('0x3'))},'cc':{'type':Sequelize[_0xbf50('0x2')](_0xbf50('0x3'))},'bcc':{'type':Sequelize[_0xbf50('0x2')](_0xbf50('0x3'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xbf50('0x8')]},'attach':{'type':Sequelize[_0xbf50('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xbf50('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT'](_0xbf50('0x3'))},'originCc':{'type':Sequelize[_0xbf50('0x2')](_0xbf50('0x3'))}};
\ No newline at end of file
+var _0x744c=['exports','TEXT','BOOLEAN','ENUM','out','long','DATE','sequelize','lodash'];(function(_0x58aff7,_0x5d940b){var _0x38d525=function(_0x133fd1){while(--_0x133fd1){_0x58aff7['push'](_0x58aff7['shift']());}};_0x38d525(++_0x5d940b);}(_0x744c,0xa0));var _0xc744=function(_0x45911d,_0x25b782){_0x45911d=_0x45911d-0x0;var _0x387de2=_0x744c[_0x45911d];return _0x387de2;};'use strict';var Sequelize=require(_0xc744('0x0'));var _=require(_0xc744('0x1'));module[_0xc744('0x2')]={'body':{'type':Sequelize[_0xc744('0x3')]('long'),'allowNull':![]},'read':{'type':Sequelize[_0xc744('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc744('0x5')]('in',_0xc744('0x6')),'defaultValue':_0xc744('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xc744('0x3')](_0xc744('0x7'))},'cc':{'type':Sequelize[_0xc744('0x3')](_0xc744('0x7'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0xc744('0x3')]},'sentAt':{'type':Sequelize[_0xc744('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xc744('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xc744('0x8')]},'originTo':{'type':Sequelize[_0xc744('0x3')](_0xc744('0x7'))},'originCc':{'type':Sequelize[_0xc744('0x3')](_0xc744('0x7'))}};
\ No newline at end of file
index 2c6792e..936a39b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98d9=['util','path','ejs','crypto','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','end','stack','name','index','MailMessage','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','add','day','merge','filter','where','options','includeAll','include','rows','show','find','body','destroy','params','describe','create','direction','secret','MailAccount','findOne','MailAccountId','MailServerOut','Smtp','isNil','service','host','port','secure','auth','pass','user','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','messageId','format','mail-interactions','accept','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','get','MailInteraction','MailInteractionId','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','manual','interface','channel','event','EventManager','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','download','unix','server','tmp','files','message-%s.eml','Attachment','from','Attachments','existsSync','push','type','readFileSync','build','writeFileSync','log','err','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x227ba1,_0x186193){var _0x15009d=function(_0x115b80){while(--_0x115b80){_0x227ba1['push'](_0x227ba1['shift']());}};_0x15009d(++_0x186193);}(_0x98d9,0x1b5));var _0x998d=function(_0x1d2440,_0x11b750){_0x1d2440=_0x1d2440-0x0;var _0x37b049=_0x98d9[_0x1d2440];return _0x37b049;};'use strict';var pdf=require(_0x998d('0x0'));var emlformat=require(_0x998d('0x1'));var rimraf=require(_0x998d('0x2'));var zipdir=require(_0x998d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x998d('0x4'));var moment=require(_0x998d('0x5'));var BPromise=require(_0x998d('0x6'));var Mustache=require('mustache');var util=require(_0x998d('0x7'));var path=require(_0x998d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x998d('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x998d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x998d('0xb'));var toCsv=require('to-csv');var querystring=require(_0x998d('0xc'));var Papa=require(_0x998d('0xd'));var qs=require('../../components/parsers/qs');var logger=require(_0x998d('0xe'))(_0x998d('0xf'));var utils=require(_0x998d('0x10'));var config=require(_0x998d('0x11'));var db=require('../../mysqldb')['db'];var socket=require(_0x998d('0x12'))({'host':'localhost','port':0x18eb});require(_0x998d('0x13'))[_0x998d('0x14')](socket);var jayson=require(_0x998d('0x15'));var client=jayson[_0x998d('0x16')][_0x998d('0x17')]({'port':0x232c});var client9003=jayson['client'][_0x998d('0x17')]({'port':0x232b});var client9002=jayson[_0x998d('0x16')][_0x998d('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x43ac68,_0x239e6f,_0x5f5cbf,_0x32910d){return new BPromise(function(_0x5cf9f8,_0x1cb324){var _0x134ed0=_0x32910d||client;return _0x134ed0['request'](_0x43ac68,_0x5f5cbf)[_0x998d('0x18')](function(_0x199e43){logger[_0x998d('0x19')](_0x998d('0x1a'),_0x239e6f,_0x998d('0x1b'));logger[_0x998d('0x1c')](_0x998d('0x1d'),_0x239e6f,_0x998d('0x1b'),JSON[_0x998d('0x1e')](_0x199e43));if(_0x199e43[_0x998d('0x1f')]){if(_0x199e43[_0x998d('0x1f')]['code']===0x1f4){logger[_0x998d('0x1f')](_0x998d('0x1a'),_0x239e6f,_0x199e43[_0x998d('0x1f')]['message']);return _0x1cb324(_0x199e43[_0x998d('0x1f')][_0x998d('0x20')]);}logger[_0x998d('0x1f')](_0x998d('0x1a'),_0x239e6f,_0x199e43[_0x998d('0x1f')]['message']);return _0x5cf9f8(_0x199e43[_0x998d('0x1f')]['message']);}else{logger[_0x998d('0x19')](_0x998d('0x1a'),_0x239e6f,_0x998d('0x1b'));_0x5cf9f8(_0x199e43[_0x998d('0x21')][_0x998d('0x20')]);}})[_0x998d('0x22')](function(_0x457369){logger[_0x998d('0x1f')](_0x998d('0x1a'),_0x239e6f,_0x457369);_0x1cb324(_0x457369);});});}function respondWithStatusCode(_0x5d10fd,_0x5c5f77){_0x5c5f77=_0x5c5f77||0xcc;return function(_0x59d51d){if(_0x59d51d){return _0x5d10fd[_0x998d('0x23')](_0x5c5f77);}return _0x5d10fd[_0x998d('0x24')](_0x5c5f77)['end']();};}function respondWithResult(_0x17f6a1,_0x19205b){_0x19205b=_0x19205b||0xc8;return function(_0x727e01){if(_0x727e01){return _0x17f6a1['status'](_0x19205b)[_0x998d('0x25')](_0x727e01);}};}function respondWithFilteredResult(_0x1242e9,_0x1c6274){return function(_0x5d345c){if(_0x5d345c){var _0x27fe34=_0x5d345c[_0x998d('0x26')],_0x33f96e=_0x1c6274[_0x998d('0x27')],_0x38cded=_0x1c6274['offset']+_0x1c6274[_0x998d('0x28')],_0xb3a96e;if(_0x38cded>=_0x27fe34){_0x38cded=_0x27fe34;_0xb3a96e=0xc8;}else{_0xb3a96e=0xce;}_0x1242e9[_0x998d('0x24')](_0xb3a96e);return _0x1242e9[_0x998d('0x29')](_0x998d('0x2a'),_0x33f96e+'-'+_0x38cded+'/'+_0x27fe34)[_0x998d('0x25')](_0x5d345c);}return null;};}function patchUpdates(_0x2e90cd){return function(_0xb31a12){try{jsonpatch[_0x998d('0x2b')](_0xb31a12,_0x2e90cd,!![]);}catch(_0x413532){return BPromise[_0x998d('0x2c')](_0x413532);}return _0xb31a12[_0x998d('0x2d')]();};}function saveUpdates(_0x4c4408,_0x5c13d2){return function(_0x4fa4bb){if(_0x4fa4bb){return _0x4fa4bb[_0x998d('0x2e')](_0x4c4408)[_0x998d('0x18')](function(_0x139c6c){return _0x139c6c;});}return null;};}function removeEntity(_0x18b0c4,_0x319851){return function(_0x143f9d){if(_0x143f9d){return _0x143f9d['destroy']()[_0x998d('0x18')](function(){_0x18b0c4[_0x998d('0x24')](0xcc)[_0x998d('0x2f')]();});}};}function handleEntityNotFound(_0x4dff73,_0x8ce6fe){return function(_0x2cd658){if(!_0x2cd658){_0x4dff73[_0x998d('0x23')](0x194);}return _0x2cd658;};}function handleError(_0x404730,_0x202fb2){_0x202fb2=_0x202fb2||0x1f4;return function(_0x4b865a){logger['error'](_0x4b865a[_0x998d('0x30')]);if(_0x4b865a['name']){delete _0x4b865a[_0x998d('0x31')];}_0x404730[_0x998d('0x24')](_0x202fb2)['send'](_0x4b865a);};}exports[_0x998d('0x32')]=function(_0x2cb38e,_0x12abe8){var _0x14490c={},_0x418cf1={},_0x206d64={'count':0x0,'rows':[]};var _0x2d01fb=db[_0x998d('0x33')][_0x998d('0x34')];_0x418cf1[_0x998d('0x35')]=_[_0x998d('0x36')](_0x2d01fb);var _0x4c546b={'dateStart':_0x2cb38e[_0x998d('0x37')][_0x998d('0x38')],'dateEnd':_0x2cb38e[_0x998d('0x37')][_0x998d('0x39')]};delete _0x2cb38e['query']['dateStart'];delete _0x2cb38e['query'][_0x998d('0x39')];_0x418cf1[_0x998d('0x37')]=_[_0x998d('0x36')](_0x2cb38e[_0x998d('0x37')]);_0x418cf1[_0x998d('0x3a')]=_[_0x998d('0x3b')](_0x418cf1['model'],_0x418cf1[_0x998d('0x37')]);_0x14490c['attributes']=_[_0x998d('0x3b')](_0x418cf1['model'],qs[_0x998d('0x3c')](_0x2cb38e[_0x998d('0x37')]['fields']));_0x14490c['attributes']=_0x14490c[_0x998d('0x3d')][_0x998d('0x3e')]?_0x14490c['attributes']:_0x418cf1[_0x998d('0x35')];if(!_0x2cb38e['query'][_0x998d('0x3f')](_0x998d('0x40'))){_0x14490c[_0x998d('0x28')]=qs[_0x998d('0x28')](_0x2cb38e['query'][_0x998d('0x28')]);_0x14490c['offset']=qs[_0x998d('0x27')](_0x2cb38e[_0x998d('0x37')][_0x998d('0x27')]);}_0x14490c[_0x998d('0x41')]=qs['sort'](_0x2cb38e['query'][_0x998d('0x42')]);_0x14490c['where']=qs['filters'](_['pick'](_0x2cb38e[_0x998d('0x37')],_0x418cf1[_0x998d('0x3a')]));if(_0x4c546b['dateStart']){if(_0x4c546b['dateEnd']){_0x4c546b[_0x998d('0x39')]=moment(_0x4c546b[_0x998d('0x39')])[_0x998d('0x43')](0x1,_0x998d('0x44'));}else{_0x4c546b[_0x998d('0x39')]=moment(_0x4c546b[_0x998d('0x38')])['add'](0x1,_0x998d('0x44'));}_[_0x998d('0x45')](_0x14490c['where'],{'createdAt':{'$gte':_0x4c546b[_0x998d('0x38')],'$lte':_0x4c546b[_0x998d('0x39')]}});}if(_0x2cb38e['query'][_0x998d('0x46')]){_0x14490c[_0x998d('0x47')]=_[_0x998d('0x45')](_0x14490c[_0x998d('0x47')],{'$or':_['map'](_0x14490c['attributes'],function(_0x404eaa){var _0x5a5d27={};_0x5a5d27[_0x404eaa]={'$like':'%'+_0x2cb38e[_0x998d('0x37')][_0x998d('0x46')]+'%'};return _0x5a5d27;})});}_0x14490c=_[_0x998d('0x45')]({},_0x14490c,_0x2cb38e[_0x998d('0x48')]);var _0x5bea05={'where':_0x14490c[_0x998d('0x47')]};return db[_0x998d('0x33')][_0x998d('0x26')](_0x5bea05)['then'](function(_0x2f4eb2){_0x206d64['count']=_0x2f4eb2;if(_0x2cb38e['query'][_0x998d('0x49')]){_0x14490c[_0x998d('0x4a')]=[{'all':!![]}];}return db[_0x998d('0x33')]['findAll'](_0x14490c);})[_0x998d('0x18')](function(_0xe869){_0x206d64[_0x998d('0x4b')]=_0xe869;return _0x206d64;})[_0x998d('0x18')](respondWithFilteredResult(_0x12abe8,_0x14490c))[_0x998d('0x22')](handleError(_0x12abe8,null));};exports[_0x998d('0x4c')]=function(_0x511434,_0x409e51){var _0x237758={'raw':!![],'where':{'id':_0x511434['params']['id']}},_0x5bfba7={};_0x5bfba7[_0x998d('0x35')]=_[_0x998d('0x36')](db[_0x998d('0x33')][_0x998d('0x34')]);_0x5bfba7['query']=_[_0x998d('0x36')](_0x511434['query']);_0x5bfba7['filters']=_[_0x998d('0x3b')](_0x5bfba7[_0x998d('0x35')],_0x5bfba7[_0x998d('0x37')]);_0x237758[_0x998d('0x3d')]=_['intersection'](_0x5bfba7[_0x998d('0x35')],qs[_0x998d('0x3c')](_0x511434[_0x998d('0x37')][_0x998d('0x3c')]));_0x237758[_0x998d('0x3d')]=_0x237758['attributes'][_0x998d('0x3e')]?_0x237758[_0x998d('0x3d')]:_0x5bfba7[_0x998d('0x35')];if(_0x511434['query'][_0x998d('0x49')]){_0x237758[_0x998d('0x4a')]=[{'all':!![]}];}_0x237758=_['merge']({},_0x237758,_0x511434[_0x998d('0x48')]);return db[_0x998d('0x33')][_0x998d('0x4d')](_0x237758)['then'](handleEntityNotFound(_0x409e51,null))[_0x998d('0x18')](respondWithResult(_0x409e51,null))[_0x998d('0x22')](handleError(_0x409e51,null));};exports[_0x998d('0x2e')]=function(_0x2a9527,_0xfc95cd){if(_0x2a9527[_0x998d('0x4e')]['id']){delete _0x2a9527[_0x998d('0x4e')]['id'];}return db[_0x998d('0x33')][_0x998d('0x4d')]({'where':{'id':_0x2a9527['params']['id']}})[_0x998d('0x18')](handleEntityNotFound(_0xfc95cd,null))[_0x998d('0x18')](saveUpdates(_0x2a9527['body'],null))[_0x998d('0x18')](respondWithResult(_0xfc95cd,null))[_0x998d('0x22')](handleError(_0xfc95cd,null));};exports[_0x998d('0x4f')]=function(_0x65a2b7,_0x216ec8){return db['MailMessage'][_0x998d('0x4d')]({'where':{'id':_0x65a2b7[_0x998d('0x50')]['id']}})[_0x998d('0x18')](handleEntityNotFound(_0x216ec8,null))[_0x998d('0x18')](removeEntity(_0x216ec8,null))[_0x998d('0x22')](handleError(_0x216ec8,null));};exports[_0x998d('0x51')]=function(_0x3953b8,_0x30a430){return db[_0x998d('0x33')][_0x998d('0x51')]()[_0x998d('0x18')](respondWithResult(_0x30a430,null))['catch'](handleError(_0x30a430,null));};exports[_0x998d('0x52')]=function(_0x1c54d8,_0x2f8b59){return db['MailMessage'][_0x998d('0x52')](_0x1c54d8[_0x998d('0x4e')])[_0x998d('0x18')](function(_0x4fc8d8){if(_0x4fc8d8){if(_0x4fc8d8[_0x998d('0x53')]==='out'&&!_0x4fc8d8[_0x998d('0x54')]){return db[_0x998d('0x55')][_0x998d('0x56')]({'where':{'id':_0x4fc8d8[_0x998d('0x57')]},'include':[{'model':db[_0x998d('0x58')],'as':_0x998d('0x59'),'raw':!![]}]})[_0x998d('0x18')](function(_0xbf05b2){if(_0xbf05b2&&_0xbf05b2[_0x998d('0x59')]){var _0x4c22b6={'tls':{'rejectUnauthorized':![]}};if(_[_0x998d('0x5a')](_0xbf05b2[_0x998d('0x59')][_0x998d('0x5b')])){_0x4c22b6[_0x998d('0x5c')]=_0xbf05b2[_0x998d('0x59')]['host'];_0x4c22b6[_0x998d('0x5d')]=_0xbf05b2[_0x998d('0x59')][_0x998d('0x5d')];_0x4c22b6['secure']=_0xbf05b2[_0x998d('0x59')][_0x998d('0x5e')];if(_0xbf05b2[_0x998d('0x59')]['authentication']){_0x4c22b6[_0x998d('0x5f')]={'user':_0xbf05b2[_0x998d('0x59')]['user'],'pass':_0xbf05b2[_0x998d('0x59')][_0x998d('0x60')]};}}else{_0x4c22b6[_0x998d('0x5b')]=_0xbf05b2['Smtp'][_0x998d('0x5b')];_0x4c22b6['auth']={'user':_0xbf05b2[_0x998d('0x59')][_0x998d('0x61')],'pass':_0xbf05b2['Smtp'][_0x998d('0x60')]};_0x4c22b6[_0x998d('0x5e')]=_0xbf05b2[_0x998d('0x59')]['secure'];}if(_0x1c54d8[_0x998d('0x4e')][_0x998d('0x62')]&&_0x1c54d8['body']['attachments'][_0x998d('0x3e')]){for(var _0x26437d=0x0;_0x26437d<_0x1c54d8[_0x998d('0x4e')][_0x998d('0x62')][_0x998d('0x3e')];_0x26437d+=0x1){_0x1c54d8[_0x998d('0x4e')][_0x998d('0x62')][_0x26437d]={'filename':_0x1c54d8[_0x998d('0x4e')]['attachments'][_0x26437d][_0x998d('0x31')],'path':path[_0x998d('0x63')](config[_0x998d('0x64')],_0x998d('0x65'),_0x1c54d8[_0x998d('0x4e')][_0x998d('0x62')][_0x26437d][_0x998d('0x66')])};}}return{'account':_0x4c22b6,'message':_0x1c54d8[_0x998d('0x4e')]};}})[_0x998d('0x18')](function(_0x24add3){if(_0x24add3){return respondWithRpcPromise(_0x998d('0x67'),_0x998d('0x68'),_0x24add3,client9003)[_0x998d('0x18')](function(_0x15053a){return _0x4fc8d8[_0x998d('0x2e')]({'read':!![],'messageId':_0x15053a[_0x998d('0x69')],'sentAt':moment()[_0x998d('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x998d('0x22')](function(_0x41c651){logger[_0x998d('0x1f')]('%s',JSON[_0x998d('0x1e')](_0x41c651));return _0x4fc8d8;});}return _0x4fc8d8;});}return _0x4fc8d8;}})['then'](respondWithResult(_0x2f8b59,0xc9))['catch'](handleError(_0x2f8b59,null));};var interaction_log=require(_0x998d('0xe'))(_0x998d('0x6b'));exports[_0x998d('0x6c')]=function(_0x3287eb,_0x35cdf3,_0x32f872){var _0xb973ff={'channel':_0x998d('0x6d')};if(_0x3287eb[_0x998d('0x4e')]['id']){delete _0x3287eb[_0x998d('0x4e')]['id'];}_0x3287eb[_0x998d('0x4e')][_0x998d('0x6e')]=!![];_0x3287eb['body'][_0x998d('0x6f')]=moment()[_0x998d('0x6a')](_0x998d('0x70'));_0x3287eb[_0x998d('0x4e')]['UserId']=_0x3287eb[_0x998d('0x4e')][_0x998d('0x71')]||_0x3287eb[_0x998d('0x61')]['id'];return db[_0x998d('0x33')][_0x998d('0x4d')]({'where':{'id':_0x3287eb[_0x998d('0x50')]['id'],'UserId':null},'include':[{'model':db[_0x998d('0x72')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x35cdf3,null))['then'](saveUpdates(_0x3287eb[_0x998d('0x4e')],null))[_0x998d('0x18')](function(_0x10f110){if(_0x10f110){_0xb973ff[_0x998d('0x20')]=_0x10f110[_0x998d('0x73')]({'plain':!![]});return db[_0x998d('0x74')][_0x998d('0x4d')]({'where':{'id':_0x10f110[_0x998d('0x75')]}});}return null;})[_0x998d('0x18')](handleEntityNotFound(_0x35cdf3,null))[_0x998d('0x18')](function(_0x3d0ceb){if(_0x3d0ceb){return _0x3d0ceb['update']({'UserId':_0x3287eb[_0x998d('0x4e')][_0x998d('0x71')],'read1stAt':_[_0x998d('0x5a')](_0x3d0ceb['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x32e756){if(_0x32e756){_0xb973ff[_0x998d('0x76')]=_0x32e756['get']({'plain':!![]});interaction_log['info'](_0x998d('0x77'),_0x3287eb['user']['id'],_0x3287eb['user']['name'],_0x3287eb[_0x998d('0x61')][_0x998d('0x78')],_0xb973ff[_0x998d('0x76')]['id'],_0x3287eb[_0x998d('0x4e')]?JSON[_0x998d('0x1e')](_0x3287eb['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x998d('0x79'),_0xb973ff);}return null;})['then'](function(_0x5b54e1){if(_0x5b54e1){if(_0x3287eb[_0x998d('0x4e')][_0x998d('0x7a')]){_0xb973ff[_0x998d('0x20')][_0x998d('0x7b')]=util[_0x998d('0x6a')]('SIP/%s',_0x3287eb[_0x998d('0x61')][_0x998d('0x31')]);_0xb973ff[_0x998d('0x20')][_0x998d('0x7c')]=_0xb973ff[_0x998d('0x7c')];_0xb973ff[_0x998d('0x20')][_0x998d('0x7d')]=_0x998d('0x6c');return respondWithRpcPromise(_0x998d('0x7e'),'EventManager',{'event':'acceptmessage','message':_0xb973ff[_0x998d('0x20')]},client9002)[_0x998d('0x18')](function(){return _0xb973ff;});}return _0xb973ff;}return null;})['then'](respondWithResult(_0x35cdf3,null))['catch'](handleError(_0x35cdf3,null));};var interaction_log=require(_0x998d('0xe'))(_0x998d('0x6b'));exports[_0x998d('0x2c')]=function(_0x41f36b,_0x2d9587,_0x35775e){var _0x30e3d3={'agent':{},'channel':_0x998d('0x6d')};if(_0x41f36b[_0x998d('0x4e')]['id']){delete _0x41f36b['body']['id'];}_0x41f36b[_0x998d('0x4e')][_0x998d('0x71')]=_0x41f36b['body'][_0x998d('0x71')]||_0x41f36b[_0x998d('0x61')]['id'];_0x30e3d3['agent']['id']=_0x41f36b[_0x998d('0x4e')][_0x998d('0x71')];return db['MailMessage'][_0x998d('0x4d')]({'where':{'id':_0x41f36b[_0x998d('0x50')]['id'],'UserId':null}})[_0x998d('0x18')](handleEntityNotFound(_0x2d9587,null))['then'](function(_0x1f22f6){if(_0x1f22f6){_0x30e3d3['message']=_0x1f22f6[_0x998d('0x73')]({'plain':!![]});return db[_0x998d('0x74')]['find']({'where':{'id':_0x1f22f6[_0x998d('0x75')]}});}return null;})[_0x998d('0x18')](handleEntityNotFound(_0x2d9587,null))[_0x998d('0x18')](function(_0xf2746d){if(_0xf2746d){_0x30e3d3[_0x998d('0x76')]=_0xf2746d[_0x998d('0x73')]({'plain':!![]});interaction_log[_0x998d('0x19')](_0x998d('0x7f'),_0x41f36b['user']['id'],_0x41f36b[_0x998d('0x61')]['name'],_0x41f36b[_0x998d('0x61')][_0x998d('0x78')],_0x30e3d3[_0x998d('0x76')]['id'],_0x41f36b[_0x998d('0x4e')]?JSON[_0x998d('0x1e')](_0x41f36b[_0x998d('0x4e')]):'null');return respondWithRpcPromise(_0x998d('0x80'),_0x998d('0x81'),_0x30e3d3);}return null;})[_0x998d('0x18')](function(_0x323593){if(_0x323593){_0x323593[_0x998d('0x20')][_0x998d('0x7b')]=util[_0x998d('0x6a')](_0x998d('0x82'),_0x41f36b[_0x998d('0x61')][_0x998d('0x31')]);_0x323593['message'][_0x998d('0x7c')]=_0x30e3d3[_0x998d('0x7c')];_0x323593[_0x998d('0x20')]['event']=_0x998d('0x2c');respondWithRpcPromise(_0x998d('0x7e'),_0x998d('0x7e'),{'event':'rejectmessage','message':_0x323593[_0x998d('0x20')]},client9002);return _0x30e3d3;}return null;})[_0x998d('0x18')](respondWithResult(_0x2d9587,null))['catch'](handleError(_0x2d9587,null));};exports[_0x998d('0x83')]=function(_0x434cff,_0x23ad42){var _0x4bbbff=moment()[_0x998d('0x84')]()['toString']();var _0x3e11b3=path[_0x998d('0x63')](config[_0x998d('0x64')],_0x998d('0x85'),'files',_0x998d('0x86'));var _0x3dc313=path[_0x998d('0x63')](config[_0x998d('0x64')],'server',_0x998d('0x87'),_0x998d('0x62'));var _0x161707=util[_0x998d('0x6a')](_0x998d('0x88'),_0x4bbbff);return db[_0x998d('0x33')]['find']({'where':{'id':_0x434cff['params']['id']},'attributes':['id','body','from','to','cc','subject','createdAt'],'include':[{'model':db[_0x998d('0x89')],'as':'Attachments'}]})[_0x998d('0x18')](handleEntityNotFound(_0x23ad42,null))[_0x998d('0x18')](function(_0x58e635){if(_0x58e635){var _0x373bb3=_0x58e635;var _0xf84c51={'from':_0x373bb3[_0x998d('0x8a')],'to':_0x373bb3['to'],'subject':_0x373bb3['subject'],'html':_0x373bb3['body'],'attachments':[]};return new BPromise(function(_0x3cf316,_0x17cc5e){for(var _0x54bebd=0x0;_0x54bebd<_0x58e635[_0x998d('0x8b')]['length'];_0x54bebd++){var _0x32ab24=_0x58e635['Attachments'][_0x54bebd];var _0x23570d=path[_0x998d('0x63')](_0x3dc313,_0x32ab24['basename']);if(fs[_0x998d('0x8c')](_0x23570d)){_0xf84c51[_0x998d('0x62')][_0x998d('0x8d')]({'name':_0x32ab24['name'],'contentType':_0x32ab24[_0x998d('0x8e')],'data':fs[_0x998d('0x8f')](_0x23570d)});}}emlformat[_0x998d('0x90')](_0xf84c51,function(_0x1b7934,_0xe416d2){if(_0x1b7934)return _0x17cc5e(_0x1b7934);fs[_0x998d('0x91')](path[_0x998d('0x63')](_0x3e11b3,_0x161707),_0xe416d2);return _0x3cf316(_0xe416d2);});});}})[_0x998d('0x18')](function(_0x3aee7c){if(_0x3aee7c){return _0x23ad42[_0x998d('0x83')](path[_0x998d('0x63')](_0x3e11b3,_0x161707),_0x161707,function(_0x335720){if(_0x335720){console[_0x998d('0x92')](_0x998d('0x93'),_0x335720);}else{fs['unlinkSync'](path[_0x998d('0x63')](_0x3e11b3,_0x161707));}});}})[_0x998d('0x22')](handleError(_0x23ad42,null));};
\ No newline at end of file
+var _0x4b8b=['messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','mail','readAt','UserId','Contact','MailInteraction','MailInteractionId','read1stAt','interaction','get','role','null','AcceptMessage','acceptMessage','SIP/%s','channel','event','EventManager','RejectMessage','rejectMessage','interface','rejectmessage','download','unix','server','files','tmp','from','subject','createdAt','Attachment','Attachments','existsSync','push','build','writeFileSync','log','err','unlinkSync','html-pdf','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','./mailMessage.socket','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','limit','set','reject','save','update','stack','name','MailMessage','rawAttributes','model','query','dateEnd','dateStart','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick','add','day','merge','filter','map','show','include','options','body','find','params','describe','create','direction','out','MailAccount','findOne','MailAccountId','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','user','pass','auth','attachments','join','root','server/files/attachments','basename','sendMail'];(function(_0x32b2d3,_0x40c0f6){var _0x5339e2=function(_0x36268f){while(--_0x36268f){_0x32b2d3['push'](_0x32b2d3['shift']());}};_0x5339e2(++_0x40c0f6);}(_0x4b8b,0x1de));var _0xb4b8=function(_0x523212,_0x437cc3){_0x523212=_0x523212-0x0;var _0x38c3b2=_0x4b8b[_0x523212];return _0x38c3b2;};'use strict';var pdf=require(_0xb4b8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb4b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb4b8('0x2'));var moment=require('moment');var BPromise=require(_0xb4b8('0x3'));var Mustache=require(_0xb4b8('0x4'));var util=require(_0xb4b8('0x5'));var path=require(_0xb4b8('0x6'));var sox=require(_0xb4b8('0x7'));var csv=require('to-csv');var ejs=require(_0xb4b8('0x8'));var fs=require('fs');var _=require(_0xb4b8('0x9'));var squel=require(_0xb4b8('0xa'));var crypto=require(_0xb4b8('0xb'));var jsforce=require(_0xb4b8('0xc'));var deskjs=require(_0xb4b8('0xd'));var toCsv=require(_0xb4b8('0xe'));var querystring=require(_0xb4b8('0xf'));var Papa=require('papaparse');var qs=require(_0xb4b8('0x10'));var logger=require(_0xb4b8('0x11'))(_0xb4b8('0x12'));var utils=require(_0xb4b8('0x13'));var config=require(_0xb4b8('0x14'));var db=require(_0xb4b8('0x15'))['db'];var socket=require('socket.io-emitter')({'host':'localhost','port':0x18eb});require(_0xb4b8('0x16'))['register'](socket);var jayson=require(_0xb4b8('0x17'));var client=jayson[_0xb4b8('0x18')][_0xb4b8('0x19')]({'port':0x232c});var client9003=jayson['client'][_0xb4b8('0x19')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x9247e8,_0x516c0d,_0x1b64af,_0x109166){return new BPromise(function(_0x567add,_0x1adcbe){var _0x5d7231=_0x109166||client;return _0x5d7231[_0xb4b8('0x1a')](_0x9247e8,_0x1b64af)[_0xb4b8('0x1b')](function(_0x3ad224){logger[_0xb4b8('0x1c')](_0xb4b8('0x1d'),_0x516c0d,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x516c0d,_0xb4b8('0x1e'),JSON[_0xb4b8('0x1f')](_0x3ad224));if(_0x3ad224['error']){if(_0x3ad224[_0xb4b8('0x20')][_0xb4b8('0x21')]===0x1f4){logger[_0xb4b8('0x20')](_0xb4b8('0x1d'),_0x516c0d,_0x3ad224[_0xb4b8('0x20')]['message']);return _0x1adcbe(_0x3ad224[_0xb4b8('0x20')][_0xb4b8('0x22')]);}logger[_0xb4b8('0x20')](_0xb4b8('0x1d'),_0x516c0d,_0x3ad224[_0xb4b8('0x20')][_0xb4b8('0x22')]);return _0x567add(_0x3ad224[_0xb4b8('0x20')]['message']);}else{logger[_0xb4b8('0x1c')]('MailMessage,\x20%s,\x20%s',_0x516c0d,_0xb4b8('0x1e'));_0x567add(_0x3ad224[_0xb4b8('0x23')][_0xb4b8('0x22')]);}})[_0xb4b8('0x24')](function(_0x38d7f2){logger[_0xb4b8('0x20')](_0xb4b8('0x1d'),_0x516c0d,_0x38d7f2);_0x1adcbe(_0x38d7f2);});});}function respondWithStatusCode(_0x14f7d8,_0x2b2947){_0x2b2947=_0x2b2947||0xcc;return function(_0x2f6672){if(_0x2f6672){return _0x14f7d8[_0xb4b8('0x25')](_0x2b2947);}return _0x14f7d8[_0xb4b8('0x26')](_0x2b2947)[_0xb4b8('0x27')]();};}function respondWithResult(_0x569005,_0x29d247){_0x29d247=_0x29d247||0xc8;return function(_0x59a6d3){if(_0x59a6d3){return _0x569005[_0xb4b8('0x26')](_0x29d247)[_0xb4b8('0x28')](_0x59a6d3);}};}function respondWithFilteredResult(_0x3cfb1e,_0x2144bb){return function(_0x139824){if(_0x139824){var _0x3ddda6=_0x139824[_0xb4b8('0x29')],_0x2a7ddf=_0x2144bb['offset'],_0x19ef8b=_0x2144bb['offset']+_0x2144bb[_0xb4b8('0x2a')],_0x191311;if(_0x19ef8b>=_0x3ddda6){_0x19ef8b=_0x3ddda6;_0x191311=0xc8;}else{_0x191311=0xce;}_0x3cfb1e[_0xb4b8('0x26')](_0x191311);return _0x3cfb1e[_0xb4b8('0x2b')]('Content-Range',_0x2a7ddf+'-'+_0x19ef8b+'/'+_0x3ddda6)[_0xb4b8('0x28')](_0x139824);}return null;};}function patchUpdates(_0x5cfcc5){return function(_0x3b46d0){try{jsonpatch['apply'](_0x3b46d0,_0x5cfcc5,!![]);}catch(_0x4ce9a0){return BPromise[_0xb4b8('0x2c')](_0x4ce9a0);}return _0x3b46d0[_0xb4b8('0x2d')]();};}function saveUpdates(_0xef8852,_0x158277){return function(_0xc1cf89){if(_0xc1cf89){return _0xc1cf89[_0xb4b8('0x2e')](_0xef8852)[_0xb4b8('0x1b')](function(_0x21ca54){return _0x21ca54;});}return null;};}function removeEntity(_0xb2a291,_0x3cca00){return function(_0x297c88){if(_0x297c88){return _0x297c88['destroy']()[_0xb4b8('0x1b')](function(){_0xb2a291['status'](0xcc)[_0xb4b8('0x27')]();});}};}function handleEntityNotFound(_0xa75367,_0x254685){return function(_0x4b0df6){if(!_0x4b0df6){_0xa75367[_0xb4b8('0x25')](0x194);}return _0x4b0df6;};}function handleError(_0x1bee98,_0x249156){_0x249156=_0x249156||0x1f4;return function(_0x4105c2){logger[_0xb4b8('0x20')](_0x4105c2[_0xb4b8('0x2f')]);if(_0x4105c2[_0xb4b8('0x30')]){delete _0x4105c2[_0xb4b8('0x30')];}_0x1bee98['status'](_0x249156)['send'](_0x4105c2);};}exports['index']=function(_0x19843a,_0x3ff9ee){var _0x58c0d5={},_0x216827={},_0xb7a82c={'count':0x0,'rows':[]};var _0x43f5b0=db[_0xb4b8('0x31')][_0xb4b8('0x32')];_0x216827[_0xb4b8('0x33')]=_['keys'](_0x43f5b0);var _0x15beb8={'dateStart':_0x19843a[_0xb4b8('0x34')]['dateStart'],'dateEnd':_0x19843a[_0xb4b8('0x34')][_0xb4b8('0x35')]};delete _0x19843a[_0xb4b8('0x34')][_0xb4b8('0x36')];delete _0x19843a[_0xb4b8('0x34')][_0xb4b8('0x35')];_0x216827[_0xb4b8('0x34')]=_[_0xb4b8('0x37')](_0x19843a[_0xb4b8('0x34')]);_0x216827[_0xb4b8('0x38')]=_[_0xb4b8('0x39')](_0x216827[_0xb4b8('0x33')],_0x216827[_0xb4b8('0x34')]);_0x58c0d5[_0xb4b8('0x3a')]=_['intersection'](_0x216827['model'],qs[_0xb4b8('0x3b')](_0x19843a[_0xb4b8('0x34')][_0xb4b8('0x3b')]));_0x58c0d5[_0xb4b8('0x3a')]=_0x58c0d5[_0xb4b8('0x3a')][_0xb4b8('0x3c')]?_0x58c0d5[_0xb4b8('0x3a')]:_0x216827[_0xb4b8('0x33')];if(!_0x19843a[_0xb4b8('0x34')]['hasOwnProperty'](_0xb4b8('0x3d'))){_0x58c0d5['limit']=qs['limit'](_0x19843a[_0xb4b8('0x34')][_0xb4b8('0x2a')]);_0x58c0d5[_0xb4b8('0x3e')]=qs[_0xb4b8('0x3e')](_0x19843a['query'][_0xb4b8('0x3e')]);}_0x58c0d5[_0xb4b8('0x3f')]=qs[_0xb4b8('0x40')](_0x19843a[_0xb4b8('0x34')]['sort']);_0x58c0d5[_0xb4b8('0x41')]=qs[_0xb4b8('0x38')](_[_0xb4b8('0x42')](_0x19843a[_0xb4b8('0x34')],_0x216827[_0xb4b8('0x38')]));if(_0x15beb8[_0xb4b8('0x36')]){if(_0x15beb8[_0xb4b8('0x35')]){_0x15beb8[_0xb4b8('0x35')]=moment(_0x15beb8['dateEnd'])[_0xb4b8('0x43')](0x1,_0xb4b8('0x44'));}else{_0x15beb8['dateEnd']=moment(_0x15beb8[_0xb4b8('0x36')])[_0xb4b8('0x43')](0x1,_0xb4b8('0x44'));}_[_0xb4b8('0x45')](_0x58c0d5[_0xb4b8('0x41')],{'createdAt':{'$gte':_0x15beb8['dateStart'],'$lte':_0x15beb8['dateEnd']}});}if(_0x19843a[_0xb4b8('0x34')][_0xb4b8('0x46')]){_0x58c0d5['where']=_[_0xb4b8('0x45')](_0x58c0d5['where'],{'$or':_[_0xb4b8('0x47')](_0x58c0d5[_0xb4b8('0x3a')],function(_0x3755e4){var _0x11fcb2={};_0x11fcb2[_0x3755e4]={'$like':'%'+_0x19843a[_0xb4b8('0x34')][_0xb4b8('0x46')]+'%'};return _0x11fcb2;})});}_0x58c0d5=_[_0xb4b8('0x45')]({},_0x58c0d5,_0x19843a['options']);var _0xa3ad3={'where':_0x58c0d5[_0xb4b8('0x41')]};return db[_0xb4b8('0x31')][_0xb4b8('0x29')](_0xa3ad3)[_0xb4b8('0x1b')](function(_0x3696ca){_0xb7a82c['count']=_0x3696ca;if(_0x19843a['query']['includeAll']){_0x58c0d5['include']=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x58c0d5);})[_0xb4b8('0x1b')](function(_0x28719a){_0xb7a82c['rows']=_0x28719a;return _0xb7a82c;})[_0xb4b8('0x1b')](respondWithFilteredResult(_0x3ff9ee,_0x58c0d5))[_0xb4b8('0x24')](handleError(_0x3ff9ee,null));};exports[_0xb4b8('0x48')]=function(_0x50a638,_0x5a0916){var _0x4ec66b={'raw':!![],'where':{'id':_0x50a638['params']['id']}},_0x1ca3b9={};_0x1ca3b9[_0xb4b8('0x33')]=_[_0xb4b8('0x37')](db[_0xb4b8('0x31')]['rawAttributes']);_0x1ca3b9[_0xb4b8('0x34')]=_[_0xb4b8('0x37')](_0x50a638['query']);_0x1ca3b9['filters']=_[_0xb4b8('0x39')](_0x1ca3b9[_0xb4b8('0x33')],_0x1ca3b9[_0xb4b8('0x34')]);_0x4ec66b[_0xb4b8('0x3a')]=_[_0xb4b8('0x39')](_0x1ca3b9[_0xb4b8('0x33')],qs['fields'](_0x50a638[_0xb4b8('0x34')]['fields']));_0x4ec66b[_0xb4b8('0x3a')]=_0x4ec66b[_0xb4b8('0x3a')][_0xb4b8('0x3c')]?_0x4ec66b['attributes']:_0x1ca3b9[_0xb4b8('0x33')];if(_0x50a638[_0xb4b8('0x34')]['includeAll']){_0x4ec66b[_0xb4b8('0x49')]=[{'all':!![]}];}_0x4ec66b=_[_0xb4b8('0x45')]({},_0x4ec66b,_0x50a638[_0xb4b8('0x4a')]);return db[_0xb4b8('0x31')]['find'](_0x4ec66b)['then'](handleEntityNotFound(_0x5a0916,null))['then'](respondWithResult(_0x5a0916,null))['catch'](handleError(_0x5a0916,null));};exports[_0xb4b8('0x2e')]=function(_0x323f2d,_0xb812ab){if(_0x323f2d[_0xb4b8('0x4b')]['id']){delete _0x323f2d[_0xb4b8('0x4b')]['id'];}return db[_0xb4b8('0x31')]['find']({'where':{'id':_0x323f2d['params']['id']}})[_0xb4b8('0x1b')](handleEntityNotFound(_0xb812ab,null))[_0xb4b8('0x1b')](saveUpdates(_0x323f2d[_0xb4b8('0x4b')],null))[_0xb4b8('0x1b')](respondWithResult(_0xb812ab,null))[_0xb4b8('0x24')](handleError(_0xb812ab,null));};exports['destroy']=function(_0x18a900,_0x12c6b0){return db[_0xb4b8('0x31')][_0xb4b8('0x4c')]({'where':{'id':_0x18a900[_0xb4b8('0x4d')]['id']}})[_0xb4b8('0x1b')](handleEntityNotFound(_0x12c6b0,null))[_0xb4b8('0x1b')](removeEntity(_0x12c6b0,null))['catch'](handleError(_0x12c6b0,null));};exports[_0xb4b8('0x4e')]=function(_0x1066b5,_0x5b62cd){return db[_0xb4b8('0x31')][_0xb4b8('0x4e')]()['then'](respondWithResult(_0x5b62cd,null))[_0xb4b8('0x24')](handleError(_0x5b62cd,null));};exports[_0xb4b8('0x4f')]=function(_0x214803,_0x29ad07){return db['MailMessage'][_0xb4b8('0x4f')](_0x214803[_0xb4b8('0x4b')])['then'](function(_0x6cd6e0){if(_0x6cd6e0){if(_0x6cd6e0[_0xb4b8('0x50')]===_0xb4b8('0x51')&&!_0x6cd6e0['secret']){return db[_0xb4b8('0x52')][_0xb4b8('0x53')]({'where':{'id':_0x6cd6e0[_0xb4b8('0x54')]},'include':[{'model':db[_0xb4b8('0x55')],'as':_0xb4b8('0x56'),'raw':!![]}]})[_0xb4b8('0x1b')](function(_0x127d72){if(_0x127d72&&_0x127d72['Smtp']){var _0x8c05f={'tls':{'rejectUnauthorized':![]}};if(_[_0xb4b8('0x57')](_0x127d72[_0xb4b8('0x56')][_0xb4b8('0x58')])){_0x8c05f[_0xb4b8('0x59')]=_0x127d72[_0xb4b8('0x56')]['host'];_0x8c05f[_0xb4b8('0x5a')]=_0x127d72[_0xb4b8('0x56')]['port'];_0x8c05f['secure']=_0x127d72[_0xb4b8('0x56')][_0xb4b8('0x5b')];if(_0x127d72[_0xb4b8('0x56')][_0xb4b8('0x5c')]){_0x8c05f['auth']={'user':_0x127d72[_0xb4b8('0x56')][_0xb4b8('0x5d')],'pass':_0x127d72[_0xb4b8('0x56')][_0xb4b8('0x5e')]};}}else{_0x8c05f[_0xb4b8('0x58')]=_0x127d72[_0xb4b8('0x56')][_0xb4b8('0x58')];_0x8c05f[_0xb4b8('0x5f')]={'user':_0x127d72[_0xb4b8('0x56')][_0xb4b8('0x5d')],'pass':_0x127d72[_0xb4b8('0x56')][_0xb4b8('0x5e')]};_0x8c05f[_0xb4b8('0x5b')]=_0x127d72['Smtp']['secure'];}if(_0x214803[_0xb4b8('0x4b')][_0xb4b8('0x60')]&&_0x214803[_0xb4b8('0x4b')][_0xb4b8('0x60')][_0xb4b8('0x3c')]){for(var _0x3c42c4=0x0;_0x3c42c4<_0x214803[_0xb4b8('0x4b')][_0xb4b8('0x60')]['length'];_0x3c42c4+=0x1){_0x214803[_0xb4b8('0x4b')][_0xb4b8('0x60')][_0x3c42c4]={'filename':_0x214803[_0xb4b8('0x4b')]['attachments'][_0x3c42c4][_0xb4b8('0x30')],'path':path[_0xb4b8('0x61')](config[_0xb4b8('0x62')],_0xb4b8('0x63'),_0x214803['body'][_0xb4b8('0x60')][_0x3c42c4][_0xb4b8('0x64')])};}}return{'account':_0x8c05f,'message':_0x214803[_0xb4b8('0x4b')]};}})[_0xb4b8('0x1b')](function(_0x45be87){if(_0x45be87){return respondWithRpcPromise('SendMail',_0xb4b8('0x65'),_0x45be87,client9003)[_0xb4b8('0x1b')](function(_0x2c7833){return _0x6cd6e0[_0xb4b8('0x2e')]({'read':!![],'messageId':_0x2c7833[_0xb4b8('0x66')],'sentAt':moment()[_0xb4b8('0x67')](_0xb4b8('0x68'))});})[_0xb4b8('0x24')](function(_0x3f1a5c){logger[_0xb4b8('0x20')]('%s',JSON['stringify'](_0x3f1a5c));return _0x6cd6e0;});}return _0x6cd6e0;});}return _0x6cd6e0;}})['then'](respondWithResult(_0x29ad07,0xc9))['catch'](handleError(_0x29ad07,null));};var interaction_log=require(_0xb4b8('0x11'))(_0xb4b8('0x69'));exports[_0xb4b8('0x6a')]=function(_0x51be71,_0x47a07b,_0x5e878c){var _0x5dd330={'channel':_0xb4b8('0x6b')};if(_0x51be71['body']['id']){delete _0x51be71[_0xb4b8('0x4b')]['id'];}_0x51be71[_0xb4b8('0x4b')]['read']=!![];_0x51be71[_0xb4b8('0x4b')][_0xb4b8('0x6c')]=moment()[_0xb4b8('0x67')](_0xb4b8('0x68'));_0x51be71[_0xb4b8('0x4b')][_0xb4b8('0x6d')]=_0x51be71[_0xb4b8('0x4b')]['UserId']||_0x51be71[_0xb4b8('0x5d')]['id'];return db[_0xb4b8('0x31')][_0xb4b8('0x4c')]({'where':{'id':_0x51be71['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xb4b8('0x6e')}]})[_0xb4b8('0x1b')](handleEntityNotFound(_0x47a07b,null))['then'](saveUpdates(_0x51be71[_0xb4b8('0x4b')],null))[_0xb4b8('0x1b')](function(_0x18491d){if(_0x18491d){_0x5dd330[_0xb4b8('0x22')]=_0x18491d['get']({'plain':!![]});return db[_0xb4b8('0x6f')][_0xb4b8('0x4c')]({'where':{'id':_0x18491d[_0xb4b8('0x70')]}});}return null;})['then'](handleEntityNotFound(_0x47a07b,null))[_0xb4b8('0x1b')](function(_0x571689){if(_0x571689){return _0x571689[_0xb4b8('0x2e')]({'UserId':_0x51be71[_0xb4b8('0x4b')][_0xb4b8('0x6d')],'read1stAt':_['isNil'](_0x571689[_0xb4b8('0x71')])?moment()[_0xb4b8('0x67')](_0xb4b8('0x68')):undefined});}return null;})[_0xb4b8('0x1b')](function(_0x53e72f){if(_0x53e72f){_0x5dd330[_0xb4b8('0x72')]=_0x53e72f[_0xb4b8('0x73')]({'plain':!![]});interaction_log[_0xb4b8('0x1c')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x51be71[_0xb4b8('0x5d')]['id'],_0x51be71[_0xb4b8('0x5d')][_0xb4b8('0x30')],_0x51be71[_0xb4b8('0x5d')][_0xb4b8('0x74')],_0x5dd330[_0xb4b8('0x72')]['id'],_0x51be71['body']?JSON['stringify'](_0x51be71[_0xb4b8('0x4b')]):_0xb4b8('0x75'));return respondWithRpcPromise(_0xb4b8('0x76'),_0xb4b8('0x77'),_0x5dd330);}return null;})[_0xb4b8('0x1b')](function(_0x19ebd4){if(_0x19ebd4){if(_0x51be71[_0xb4b8('0x4b')]['manual']){_0x5dd330[_0xb4b8('0x22')]['interface']=util[_0xb4b8('0x67')](_0xb4b8('0x78'),_0x51be71[_0xb4b8('0x5d')]['name']);_0x5dd330[_0xb4b8('0x22')][_0xb4b8('0x79')]=_0x5dd330[_0xb4b8('0x79')];_0x5dd330[_0xb4b8('0x22')][_0xb4b8('0x7a')]=_0xb4b8('0x6a');return respondWithRpcPromise(_0xb4b8('0x7b'),_0xb4b8('0x7b'),{'event':'acceptmessage','message':_0x5dd330[_0xb4b8('0x22')]},client9002)[_0xb4b8('0x1b')](function(){return _0x5dd330;});}return _0x5dd330;}return null;})[_0xb4b8('0x1b')](respondWithResult(_0x47a07b,null))[_0xb4b8('0x24')](handleError(_0x47a07b,null));};var interaction_log=require(_0xb4b8('0x11'))(_0xb4b8('0x69'));exports[_0xb4b8('0x2c')]=function(_0x573391,_0x4ced10,_0x1bc535){var _0x43b17e={'agent':{},'channel':_0xb4b8('0x6b')};if(_0x573391[_0xb4b8('0x4b')]['id']){delete _0x573391[_0xb4b8('0x4b')]['id'];}_0x573391[_0xb4b8('0x4b')]['UserId']=_0x573391[_0xb4b8('0x4b')][_0xb4b8('0x6d')]||_0x573391[_0xb4b8('0x5d')]['id'];_0x43b17e['agent']['id']=_0x573391[_0xb4b8('0x4b')][_0xb4b8('0x6d')];return db[_0xb4b8('0x31')][_0xb4b8('0x4c')]({'where':{'id':_0x573391[_0xb4b8('0x4d')]['id'],'UserId':null}})[_0xb4b8('0x1b')](handleEntityNotFound(_0x4ced10,null))['then'](function(_0x545fb1){if(_0x545fb1){_0x43b17e['message']=_0x545fb1['get']({'plain':!![]});return db[_0xb4b8('0x6f')][_0xb4b8('0x4c')]({'where':{'id':_0x545fb1[_0xb4b8('0x70')]}});}return null;})['then'](handleEntityNotFound(_0x4ced10,null))[_0xb4b8('0x1b')](function(_0x581c72){if(_0x581c72){_0x43b17e['interaction']=_0x581c72[_0xb4b8('0x73')]({'plain':!![]});interaction_log[_0xb4b8('0x1c')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x573391[_0xb4b8('0x5d')]['id'],_0x573391[_0xb4b8('0x5d')][_0xb4b8('0x30')],_0x573391[_0xb4b8('0x5d')][_0xb4b8('0x74')],_0x43b17e['interaction']['id'],_0x573391[_0xb4b8('0x4b')]?JSON['stringify'](_0x573391[_0xb4b8('0x4b')]):_0xb4b8('0x75'));return respondWithRpcPromise(_0xb4b8('0x7c'),_0xb4b8('0x7d'),_0x43b17e);}return null;})[_0xb4b8('0x1b')](function(_0x209225){if(_0x209225){_0x209225['message'][_0xb4b8('0x7e')]=util['format']('SIP/%s',_0x573391[_0xb4b8('0x5d')][_0xb4b8('0x30')]);_0x209225[_0xb4b8('0x22')][_0xb4b8('0x79')]=_0x43b17e[_0xb4b8('0x79')];_0x209225['message'][_0xb4b8('0x7a')]=_0xb4b8('0x2c');respondWithRpcPromise(_0xb4b8('0x7b'),_0xb4b8('0x7b'),{'event':_0xb4b8('0x7f'),'message':_0x209225[_0xb4b8('0x22')]},client9002);return _0x43b17e;}return null;})[_0xb4b8('0x1b')](respondWithResult(_0x4ced10,null))[_0xb4b8('0x24')](handleError(_0x4ced10,null));};exports[_0xb4b8('0x80')]=function(_0x41f91e,_0x16aab2){var _0x4ffec4=moment()[_0xb4b8('0x81')]()['toString']();var _0x449316=path['join'](config[_0xb4b8('0x62')],_0xb4b8('0x82'),_0xb4b8('0x83'),_0xb4b8('0x84'));var _0x588ae2=path[_0xb4b8('0x61')](config['root'],_0xb4b8('0x82'),_0xb4b8('0x83'),_0xb4b8('0x60'));var _0x4a6574=util[_0xb4b8('0x67')]('message-%s.eml',_0x4ffec4);return db[_0xb4b8('0x31')][_0xb4b8('0x4c')]({'where':{'id':_0x41f91e[_0xb4b8('0x4d')]['id']},'attributes':['id',_0xb4b8('0x4b'),_0xb4b8('0x85'),'to','cc',_0xb4b8('0x86'),_0xb4b8('0x87')],'include':[{'model':db[_0xb4b8('0x88')],'as':_0xb4b8('0x89')}]})[_0xb4b8('0x1b')](handleEntityNotFound(_0x16aab2,null))[_0xb4b8('0x1b')](function(_0x4e57d7){if(_0x4e57d7){var _0x4c4093=_0x4e57d7;var _0x1b026c={'from':_0x4c4093[_0xb4b8('0x85')],'to':_0x4c4093['to'],'subject':_0x4c4093[_0xb4b8('0x86')],'html':_0x4c4093[_0xb4b8('0x4b')],'attachments':[]};return new BPromise(function(_0x3c8129,_0x3e3ec7){for(var _0x1bf0d3=0x0;_0x1bf0d3<_0x4e57d7['Attachments'][_0xb4b8('0x3c')];_0x1bf0d3++){var _0x44f741=_0x4e57d7[_0xb4b8('0x89')][_0x1bf0d3];var _0x385be0=path['join'](_0x588ae2,_0x44f741['basename']);if(fs[_0xb4b8('0x8a')](_0x385be0)){_0x1b026c[_0xb4b8('0x60')][_0xb4b8('0x8b')]({'name':_0x44f741[_0xb4b8('0x30')],'contentType':_0x44f741['type'],'data':fs['readFileSync'](_0x385be0)});}}emlformat[_0xb4b8('0x8c')](_0x1b026c,function(_0xd3436d,_0x271134){if(_0xd3436d)return _0x3e3ec7(_0xd3436d);fs[_0xb4b8('0x8d')](path[_0xb4b8('0x61')](_0x449316,_0x4a6574),_0x271134);return _0x3c8129(_0x271134);});});}})[_0xb4b8('0x1b')](function(_0x2deca0){if(_0x2deca0){return _0x16aab2[_0xb4b8('0x80')](path['join'](_0x449316,_0x4a6574),_0x4a6574,function(_0x3942bc){if(_0x3942bc){console[_0xb4b8('0x8e')](_0xb4b8('0x8f'),_0x3942bc);}else{fs[_0xb4b8('0x90')](path[_0xb4b8('0x61')](_0x449316,_0x4a6574));}});}})['catch'](handleError(_0x16aab2,null));};
\ No newline at end of file
index d9ed40b..2e9811d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20d7=['exports','MailMessage','setMaxListeners','save','hasOwnProperty'];(function(_0x33deff,_0x3fbd9e){var _0x3c744b=function(_0x3ac94b){while(--_0x3ac94b){_0x33deff['push'](_0x33deff['shift']());}};_0x3c744b(++_0x3fbd9e);}(_0x20d7,0x146));var _0x720d=function(_0x1bfe45,_0x1cdc64){_0x1bfe45=_0x1bfe45-0x0;var _0x395eca=_0x20d7[_0x1bfe45];return _0x395eca;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0x720d('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x720d('0x1')](0x0);var events={'afterCreate':_0x720d('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5b4c54){return function(_0x3a9884,_0x241e8d,_0x4cb8df){MailMessageEvents['emit'](_0x5b4c54+':'+_0x3a9884['id'],_0x3a9884);MailMessageEvents['emit'](_0x5b4c54,_0x3a9884);_0x4cb8df(null);};}for(var e in events){if(events[_0x720d('0x3')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x720d('0x4')]=MailMessageEvents;
\ No newline at end of file
+var _0xe292=['MailMessage','setMaxListeners','remove','hasOwnProperty','hook','exports'];(function(_0x460ed5,_0x2e85b1){var _0x73c7eb=function(_0x8d9f9){while(--_0x8d9f9){_0x460ed5['push'](_0x460ed5['shift']());}};_0x73c7eb(++_0x2e85b1);}(_0xe292,0x19e));var _0x2e29=function(_0x38cffe,_0x6bff6f){_0x38cffe=_0x38cffe-0x0;var _0x349b63=_0xe292[_0x38cffe];return _0x349b63;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0x2e29('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x2e29('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2e29('0x2')};function emitEvent(_0xb8e92f){return function(_0x4fec69,_0x59d723,_0x80a47){MailMessageEvents['emit'](_0xb8e92f+':'+_0x4fec69['id'],_0x4fec69);MailMessageEvents['emit'](_0xb8e92f,_0x4fec69);_0x80a47(null);};}for(var e in events){if(events[_0x2e29('0x3')](e)){var event=events[e];MailMessage[_0x2e29('0x4')](e,emitEvent(event));}}module[_0x2e29('0x5')]=MailMessageEvents;
\ No newline at end of file
index 4d1d9e6..e9f5f54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66d8=['exports','MailMessage','messageId','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x12b47c,_0x5722b5){var _0x35a639=function(_0x565e79){while(--_0x565e79){_0x12b47c['push'](_0x12b47c['shift']());}};_0x35a639(++_0x5722b5);}(_0x66d8,0x1c1));var _0x866d=function(_0x356127,_0x4873ac){_0x356127=_0x356127-0x0;var _0x5d4c75=_0x66d8[_0x356127];return _0x5d4c75;};'use strict';var _=require(_0x866d('0x0'));var util=require(_0x866d('0x1'));var logger=require(_0x866d('0x2'))(_0x866d('0x3'));var moment=require(_0x866d('0x4'));var BPromise=require(_0x866d('0x5'));var rp=require(_0x866d('0x6'));var attributes=require('./mailMessage.attributes');module[_0x866d('0x7')]=function(_0xfd481,_0x3f2f7f){return _0xfd481['define'](_0x866d('0x8'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x866d('0x9'),'fields':[_0x866d('0x9')]}],'timestamps':!![],'charset':_0x866d('0xa'),'collate':_0x866d('0xb')});};
\ No newline at end of file
+var _0xf269=['define','MailMessage','mail_messages','messageId','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','exports'];(function(_0x3834a1,_0xac0318){var _0x4cce99=function(_0x2fd05c){while(--_0x2fd05c){_0x3834a1['push'](_0x3834a1['shift']());}};_0x4cce99(++_0xac0318);}(_0xf269,0xd2));var _0x9f26=function(_0x925e9b,_0x25310c){_0x925e9b=_0x925e9b-0x0;var _0x31c9ed=_0xf269[_0x925e9b];return _0x31c9ed;};'use strict';var _=require('lodash');var util=require(_0x9f26('0x0'));var logger=require(_0x9f26('0x1'))('api');var moment=require(_0x9f26('0x2'));var BPromise=require(_0x9f26('0x3'));var rp=require(_0x9f26('0x4'));var attributes=require('./mailMessage.attributes');module[_0x9f26('0x5')]=function(_0x5527cc,_0x294851){return _0x5527cc[_0x9f26('0x6')](_0x9f26('0x7'),attributes,{'tableName':_0x9f26('0x8'),'paranoid':![],'indexes':[{'name':_0x9f26('0x9'),'fields':[_0x9f26('0x9')]}],'timestamps':!![],'charset':_0x9f26('0xa'),'collate':_0x9f26('0xb')});};
\ No newline at end of file
index 80cafc4..9a1911d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1888=['CreateMailMessage','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','socket.io-emitter','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','MailMessage','options','raw'];(function(_0x583a0b,_0x3c4d27){var _0x234c4a=function(_0x6d4bc1){while(--_0x6d4bc1){_0x583a0b['push'](_0x583a0b['shift']());}};_0x234c4a(++_0x3c4d27);}(_0x1888,0x81));var _0x8188=function(_0x5e804b,_0x242732){_0x5e804b=_0x5e804b-0x0;var _0x116e07=_0x1888[_0x5e804b];return _0x116e07;};'use strict';var _=require(_0x8188('0x0'));var util=require(_0x8188('0x1'));var moment=require(_0x8188('0x2'));var BPromise=require(_0x8188('0x3'));var rs=require(_0x8188('0x4'));var fs=require('fs');var db=require(_0x8188('0x5'))['db'];var utils=require(_0x8188('0x6'));var logger=require(_0x8188('0x7'))(_0x8188('0x8'));var config=require(_0x8188('0x9'));var jayson=require(_0x8188('0xa'));var client=jayson[_0x8188('0xb')]['http']({'port':0x232a});var socket=require(_0x8188('0xc'))({'host':_0x8188('0xd'),'port':0x18eb});require(_0x8188('0xe'))[_0x8188('0xf')](socket);function respondWithRpcPromise(_0x247562,_0x22caa0,_0x7e9d40){return new BPromise(function(_0xa87b3e,_0x2c8126){return client[_0x8188('0x10')](_0x247562,_0x7e9d40)[_0x8188('0x11')](function(_0x17c294){logger[_0x8188('0x12')](_0x8188('0x13'),_0x22caa0,_0x8188('0x14'));logger[_0x8188('0x15')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x22caa0,_0x8188('0x14'),JSON[_0x8188('0x16')](_0x17c294));if(_0x17c294[_0x8188('0x17')]){if(_0x17c294['error'][_0x8188('0x18')]===0x1f4){logger[_0x8188('0x17')](_0x8188('0x13'),_0x22caa0,_0x17c294['error']['message']);return _0x2c8126(_0x17c294[_0x8188('0x17')][_0x8188('0x19')]);}logger[_0x8188('0x17')]('MailMessage,\x20%s,\x20%s',_0x22caa0,_0x17c294['error']['message']);return _0xa87b3e(_0x17c294[_0x8188('0x17')][_0x8188('0x19')]);}else{logger[_0x8188('0x12')](_0x8188('0x13'),_0x22caa0,'request\x20sent');_0xa87b3e(_0x17c294[_0x8188('0x1a')][_0x8188('0x19')]);}})[_0x8188('0x1b')](function(_0x5d3565){logger['error']('MailMessage,\x20%s,\x20%s',_0x22caa0,_0x5d3565);_0x2c8126(_0x5d3565);});});}exports['CreateMailMessage']=function(_0x4ac87a){var _0x5427de=this;return new Promise(function(_0x42e38c,_0x49f95a){return db[_0x8188('0x1c')]['create'](_0x4ac87a['body'],{'raw':_0x4ac87a[_0x8188('0x1d')]?_0x4ac87a[_0x8188('0x1d')][_0x8188('0x1e')]===undefined?!![]:![]:!![]})[_0x8188('0x11')](function(_0x85bb54){logger[_0x8188('0x12')](_0x8188('0x1f'),_0x4ac87a);logger[_0x8188('0x15')]('CreateMailMessage',_0x4ac87a,JSON[_0x8188('0x16')](_0x85bb54));_0x42e38c(_0x85bb54);})[_0x8188('0x1b')](function(_0x1aef1e){logger[_0x8188('0x17')](_0x8188('0x1f'),_0x1aef1e[_0x8188('0x19')],_0x4ac87a);_0x49f95a(_0x5427de['error'](0x1f4,_0x1aef1e[_0x8188('0x19')]));});});};
\ No newline at end of file
+var _0xbb96=['catch','CreateMailMessage','body','options','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','socket.io-emitter','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2aaed6,_0x33b3e0){var _0x270fb0=function(_0x2bfcd8){while(--_0x2bfcd8){_0x2aaed6['push'](_0x2aaed6['shift']());}};_0x270fb0(++_0x33b3e0);}(_0xbb96,0xde));var _0x6bb9=function(_0x2393c0,_0x5d5d61){_0x2393c0=_0x2393c0-0x0;var _0x188aa9=_0xbb96[_0x2393c0];return _0x188aa9;};'use strict';var _=require(_0x6bb9('0x0'));var util=require(_0x6bb9('0x1'));var moment=require(_0x6bb9('0x2'));var BPromise=require('bluebird');var rs=require(_0x6bb9('0x3'));var fs=require('fs');var db=require(_0x6bb9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6bb9('0x5'))(_0x6bb9('0x6'));var config=require(_0x6bb9('0x7'));var jayson=require(_0x6bb9('0x8'));var client=jayson[_0x6bb9('0x9')]['http']({'port':0x232a});var socket=require(_0x6bb9('0xa'))({'host':_0x6bb9('0xb'),'port':0x18eb});require(_0x6bb9('0xc'))[_0x6bb9('0xd')](socket);function respondWithRpcPromise(_0x4a4100,_0x4aa770,_0x36c4ea){return new BPromise(function(_0x442d1e,_0x1c4cad){return client[_0x6bb9('0xe')](_0x4a4100,_0x36c4ea)[_0x6bb9('0xf')](function(_0x165c69){logger[_0x6bb9('0x10')](_0x6bb9('0x11'),_0x4aa770,_0x6bb9('0x12'));logger[_0x6bb9('0x13')](_0x6bb9('0x14'),_0x4aa770,_0x6bb9('0x12'),JSON[_0x6bb9('0x15')](_0x165c69));if(_0x165c69[_0x6bb9('0x16')]){if(_0x165c69['error'][_0x6bb9('0x17')]===0x1f4){logger[_0x6bb9('0x16')](_0x6bb9('0x11'),_0x4aa770,_0x165c69['error']['message']);return _0x1c4cad(_0x165c69[_0x6bb9('0x16')][_0x6bb9('0x18')]);}logger[_0x6bb9('0x16')](_0x6bb9('0x11'),_0x4aa770,_0x165c69[_0x6bb9('0x16')][_0x6bb9('0x18')]);return _0x442d1e(_0x165c69[_0x6bb9('0x16')]['message']);}else{logger[_0x6bb9('0x10')](_0x6bb9('0x11'),_0x4aa770,'request\x20sent');_0x442d1e(_0x165c69[_0x6bb9('0x19')][_0x6bb9('0x18')]);}})[_0x6bb9('0x1a')](function(_0x2f1670){logger[_0x6bb9('0x16')](_0x6bb9('0x11'),_0x4aa770,_0x2f1670);_0x1c4cad(_0x2f1670);});});}exports[_0x6bb9('0x1b')]=function(_0x5135e0){var _0x3a806d=this;return new Promise(function(_0x1768ca,_0x1819e4){return db['MailMessage']['create'](_0x5135e0[_0x6bb9('0x1c')],{'raw':_0x5135e0[_0x6bb9('0x1d')]?_0x5135e0[_0x6bb9('0x1d')][_0x6bb9('0x1e')]===undefined?!![]:![]:!![]})[_0x6bb9('0xf')](function(_0x1e8890){logger['info'](_0x6bb9('0x1b'),_0x5135e0);logger[_0x6bb9('0x13')](_0x6bb9('0x1b'),_0x5135e0,JSON[_0x6bb9('0x15')](_0x1e8890));_0x1768ca(_0x1e8890);})['catch'](function(_0x373a79){logger[_0x6bb9('0x16')]('CreateMailMessage',_0x373a79[_0x6bb9('0x18')],_0x5135e0);_0x1819e4(_0x3a806d[_0x6bb9('0x16')](0x1f4,_0x373a79['message']));});});};
\ No newline at end of file
index 5c5a832..1d1639d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc674=['mailMessage:','./mailMessage.events','remove','update','emit','removeListener','length'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc674,0x9b));var _0x4c67=function(_0x6dfbaa,_0x31eede){_0x6dfbaa=_0x6dfbaa-0x0;var _0xfbe02=_0xc674[_0x6dfbaa];return _0xfbe02;};'use strict';var MailMessageEvents=require(_0x4c67('0x0'));var events=['save',_0x4c67('0x1'),_0x4c67('0x2')];function createListener(_0x215648,_0x58ddd0){return function(_0x2e3b1f){_0x58ddd0[_0x4c67('0x3')](_0x215648,_0x2e3b1f);};}function removeListener(_0x4b4c60,_0x32a88a){return function(){MailMessageEvents[_0x4c67('0x4')](_0x4b4c60,_0x32a88a);};}exports['register']=function(_0x36260a){for(var _0x3f4b2d=0x0,_0x4a8c78=events[_0x4c67('0x5')];_0x3f4b2d<_0x4a8c78;_0x3f4b2d++){var _0x20d6f4=events[_0x3f4b2d];var _0x118224=createListener(_0x4c67('0x6')+_0x20d6f4,_0x36260a);MailMessageEvents['on'](_0x20d6f4,_0x118224);}};
\ No newline at end of file
+var _0xf468=['mailMessage:','./mailMessage.events','save','remove','update','emit','register','length'];(function(_0x1109fc,_0x5c2bf3){var _0x2b655b=function(_0xbd2747){while(--_0xbd2747){_0x1109fc['push'](_0x1109fc['shift']());}};_0x2b655b(++_0x5c2bf3);}(_0xf468,0x111));var _0x8f46=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xf468[_0x3ce3c];return _0x55a2c9;};'use strict';var MailMessageEvents=require(_0x8f46('0x0'));var events=[_0x8f46('0x1'),_0x8f46('0x2'),_0x8f46('0x3')];function createListener(_0x2a06ad,_0x4eafe5){return function(_0x81558f){_0x4eafe5[_0x8f46('0x4')](_0x2a06ad,_0x81558f);};}function removeListener(_0x4231e0,_0x267319){return function(){MailMessageEvents['removeListener'](_0x4231e0,_0x267319);};}exports[_0x8f46('0x5')]=function(_0xa00071){for(var _0x1a1cdb=0x0,_0x2470d9=events[_0x8f46('0x6')];_0x1a1cdb<_0x2470d9;_0x1a1cdb++){var _0x53f493=events[_0x1a1cdb];var _0x202946=createListener(_0x8f46('0x7')+_0x53f493,_0xa00071);MailMessageEvents['on'](_0x53f493,_0x202946);}};
\ No newline at end of file
index f0b2abf..96a6600 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x762c=['index','/describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getAgents','create','post','addTeams','/:id/users','addAgents','put','delete','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get'];(function(_0x276986,_0x58a02e){var _0x1b9e9e=function(_0x29d5af){while(--_0x29d5af){_0x276986['push'](_0x276986['shift']());}};_0x1b9e9e(++_0x58a02e);}(_0x762c,0x1d2));var _0xc762=function(_0x4533dc,_0x4748a7){_0x4533dc=_0x4533dc-0x0;var _0x30e2cf=_0x762c[_0x4533dc];return _0x30e2cf;};'use strict';var multer=require(_0xc762('0x0'));var util=require(_0xc762('0x1'));var path=require(_0xc762('0x2'));var express=require(_0xc762('0x3'));var router=express['Router']();var auth=require(_0xc762('0x4'));var interaction=require(_0xc762('0x5'));var config=require(_0xc762('0x6'));var controller=require(_0xc762('0x7'));router[_0xc762('0x8')]('/',auth['isAuthenticated'](),controller[_0xc762('0x9')]);router['get'](_0xc762('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xc762('0x8')](_0xc762('0xb'),auth[_0xc762('0xc')](),controller[_0xc762('0xd')]);router['get'](_0xc762('0xe'),auth['isAuthenticated'](),controller[_0xc762('0xf')]);router['get'](_0xc762('0x10'),auth['isAuthenticated'](),controller['getTeams']);router['get']('/:id/users',auth[_0xc762('0xc')](),controller[_0xc762('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc762('0x12')]);router[_0xc762('0x13')](_0xc762('0x10'),auth[_0xc762('0xc')](),controller[_0xc762('0x14')]);router[_0xc762('0x13')](_0xc762('0x15'),auth['isAuthenticated'](),controller[_0xc762('0x16')]);router[_0xc762('0x17')](_0xc762('0xb'),auth[_0xc762('0xc')](),controller['update']);router['delete'](_0xc762('0xb'),auth[_0xc762('0xc')](),controller['destroy']);router[_0xc762('0x18')](_0xc762('0x10'),auth[_0xc762('0xc')](),controller['removeTeams']);router[_0xc762('0x18')]('/:id/users',auth[_0xc762('0xc')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0xac9d=['get','isAuthenticated','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller'];(function(_0x140681,_0x5ec03d){var _0x2ad2a9=function(_0x40fbf1){while(--_0x40fbf1){_0x140681['push'](_0x140681['shift']());}};_0x2ad2a9(++_0x5ec03d);}(_0xac9d,0x19c));var _0xdac9=function(_0x53ed59,_0x4beb34){_0x53ed59=_0x53ed59-0x0;var _0x5834ca=_0xac9d[_0x53ed59];return _0x5834ca;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require('path');var express=require(_0xdac9('0x2'));var router=express[_0xdac9('0x3')]();var auth=require(_0xdac9('0x4'));var interaction=require(_0xdac9('0x5'));var config=require(_0xdac9('0x6'));var controller=require(_0xdac9('0x7'));router[_0xdac9('0x8')]('/',auth[_0xdac9('0x9')](),controller['index']);router[_0xdac9('0x8')](_0xdac9('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xdac9('0x8')](_0xdac9('0xb'),auth[_0xdac9('0x9')](),controller[_0xdac9('0xc')]);router[_0xdac9('0x8')](_0xdac9('0xd'),auth[_0xdac9('0x9')](),controller[_0xdac9('0xe')]);router[_0xdac9('0x8')](_0xdac9('0xf'),auth['isAuthenticated'](),controller[_0xdac9('0x10')]);router[_0xdac9('0x8')](_0xdac9('0x11'),auth[_0xdac9('0x9')](),controller[_0xdac9('0x12')]);router[_0xdac9('0x13')]('/',auth[_0xdac9('0x9')](),controller[_0xdac9('0x14')]);router['post'](_0xdac9('0xf'),auth[_0xdac9('0x9')](),controller[_0xdac9('0x15')]);router[_0xdac9('0x13')]('/:id/users',auth[_0xdac9('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0xdac9('0x9')](),controller[_0xdac9('0x16')]);router['delete'](_0xdac9('0xb'),auth[_0xdac9('0x9')](),controller[_0xdac9('0x17')]);router[_0xdac9('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0xdac9('0x19')]);router['delete'](_0xdac9('0x11'),auth[_0xdac9('0x9')](),controller[_0xdac9('0x1a')]);module[_0xdac9('0x1b')]=router;
\ No newline at end of file
index 12d34b7..8a0e00c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c42=['exports','name','STRING','ENUM','rrmemory','roundrobin'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x4c42,0x150));var _0x24c4=function(_0x128183,_0x5e8016){_0x128183=_0x128183-0x0;var _0x3d7083=_0x4c42[_0x128183];return _0x3d7083;};'use strict';var Sequelize=require('sequelize');module[_0x24c4('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x24c4('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x24c4('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x24c4('0x3')](_0x24c4('0x4'),'beepall',_0x24c4('0x5'))}};
\ No newline at end of file
+var _0xb8b6=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x3064a3,_0x20e71a){var _0x4319b6=function(_0x2e5240){while(--_0x2e5240){_0x3064a3['push'](_0x3064a3['shift']());}};_0x4319b6(++_0x20e71a);}(_0xb8b6,0xa8));var _0x6b8b=function(_0x6fea28,_0x4dbe07){_0x6fea28=_0x6fea28-0x0;var _0x12e219=_0xb8b6[_0x6fea28];return _0x12e219;};'use strict';var Sequelize=require(_0x6b8b('0x0'));module[_0x6b8b('0x1')]={'name':{'type':Sequelize[_0x6b8b('0x2')],'unique':_0x6b8b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6b8b('0x2')]},'timeout':{'type':Sequelize[_0x6b8b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6b8b('0x5')](_0x6b8b('0x6'),_0x6b8b('0x7'),'roundrobin')}};
\ No newline at end of file
index 61a6816..87cf66f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52f7=['moment','bluebird','util','path','sox','to-csv','crypto','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','error','name','send','MailQueue','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','pick','add','day','merge','where','filter','map','options','includeAll','include','findAll','rows','catch','params','rawAttributes','fields','find','create','body','describe','getMembers','findOne','UserMailQueue','sort','MailQueueId','User','UserId','mailPause','updatedAt','createdAt','SIP','getTeams','Team','addTeams','Agents','penalty','ids','removeTeams','union','removeAgents','omit','spread','emit','userMailQueue:save','isArray','userMailQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x52f7,0xbf));var _0x752f=function(_0x434496,_0x2c46fd){_0x434496=_0x434496-0x0;var _0x10788f=_0x52f7[_0x434496];return _0x10788f;};'use strict';var pdf=require(_0x752f('0x0'));var emlformat=require(_0x752f('0x1'));var rimraf=require(_0x752f('0x2'));var zipdir=require(_0x752f('0x3'));var jsonpatch=require(_0x752f('0x4'));var rp=require('request-promise');var moment=require(_0x752f('0x5'));var BPromise=require(_0x752f('0x6'));var Mustache=require('mustache');var util=require(_0x752f('0x7'));var path=require(_0x752f('0x8'));var sox=require(_0x752f('0x9'));var csv=require(_0x752f('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x752f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x752f('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x752f('0xd'));var qs=require(_0x752f('0xe'));var logger=require(_0x752f('0xf'))(_0x752f('0x10'));var utils=require('../../config/utils');var config=require(_0x752f('0x11'));var db=require('../../mysqldb')['db'];var socket=require(_0x752f('0x12'))({'host':'localhost','port':0x18eb});require(_0x752f('0x13'))[_0x752f('0x14')](socket);function respondWithStatusCode(_0x2825a0,_0x2f81d9){_0x2f81d9=_0x2f81d9||0xcc;return function(_0x25460e){if(_0x25460e){return _0x2825a0[_0x752f('0x15')](_0x2f81d9);}return _0x2825a0[_0x752f('0x16')](_0x2f81d9)[_0x752f('0x17')]();};}function respondWithResult(_0x2924fc,_0x59a911){_0x59a911=_0x59a911||0xc8;return function(_0x32ae6f){if(_0x32ae6f){return _0x2924fc[_0x752f('0x16')](_0x59a911)[_0x752f('0x18')](_0x32ae6f);}};}function respondWithFilteredResult(_0x4d38f4,_0x2b50e0){return function(_0x990024){if(_0x990024){var _0x69a7bb=_0x990024[_0x752f('0x19')],_0x4597b1=_0x2b50e0[_0x752f('0x1a')],_0xd81b4d=_0x2b50e0[_0x752f('0x1a')]+_0x2b50e0[_0x752f('0x1b')],_0x5d7670;if(_0xd81b4d>=_0x69a7bb){_0xd81b4d=_0x69a7bb;_0x5d7670=0xc8;}else{_0x5d7670=0xce;}_0x4d38f4[_0x752f('0x16')](_0x5d7670);return _0x4d38f4[_0x752f('0x1c')](_0x752f('0x1d'),_0x4597b1+'-'+_0xd81b4d+'/'+_0x69a7bb)[_0x752f('0x18')](_0x990024);}return null;};}function patchUpdates(_0x15d08d){return function(_0x13e6a0){try{jsonpatch[_0x752f('0x1e')](_0x13e6a0,_0x15d08d,!![]);}catch(_0x3f1544){return BPromise[_0x752f('0x1f')](_0x3f1544);}return _0x13e6a0['save']();};}function saveUpdates(_0x2d2ebc,_0x2281a9){return function(_0xc11d64){if(_0xc11d64){return _0xc11d64[_0x752f('0x20')](_0x2d2ebc)['then'](function(_0x268e8e){return _0x268e8e;});}return null;};}function removeEntity(_0x198c88,_0x478ece){return function(_0x34e3d4){if(_0x34e3d4){return _0x34e3d4[_0x752f('0x21')]()[_0x752f('0x22')](function(){_0x198c88[_0x752f('0x16')](0xcc)[_0x752f('0x17')]();});}};}function handleEntityNotFound(_0x1657ce,_0x4986a7){return function(_0x1c5a1b){if(!_0x1c5a1b){_0x1657ce['sendStatus'](0x194);}return _0x1c5a1b;};}function handleError(_0x324b72,_0x3fa060){_0x3fa060=_0x3fa060||0x1f4;return function(_0x16022a){logger[_0x752f('0x23')](_0x16022a['stack']);if(_0x16022a[_0x752f('0x24')]){delete _0x16022a[_0x752f('0x24')];}_0x324b72['status'](_0x3fa060)[_0x752f('0x25')](_0x16022a);};}exports['index']=function(_0x1ec1c3,_0x33c1ff){var _0x280334={},_0xb5e203={},_0x2fdced={'count':0x0,'rows':[]};var _0x452ca1=db[_0x752f('0x26')]['rawAttributes'];_0xb5e203[_0x752f('0x27')]=_[_0x752f('0x28')](_0x452ca1);var _0x212c50={'dateStart':_0x1ec1c3[_0x752f('0x29')][_0x752f('0x2a')],'dateEnd':_0x1ec1c3[_0x752f('0x29')]['dateEnd']};delete _0x1ec1c3[_0x752f('0x29')][_0x752f('0x2a')];delete _0x1ec1c3[_0x752f('0x29')][_0x752f('0x2b')];_0xb5e203[_0x752f('0x29')]=_[_0x752f('0x28')](_0x1ec1c3[_0x752f('0x29')]);_0xb5e203[_0x752f('0x2c')]=_[_0x752f('0x2d')](_0xb5e203[_0x752f('0x27')],_0xb5e203[_0x752f('0x29')]);_0x280334[_0x752f('0x2e')]=_['intersection'](_0xb5e203['model'],qs['fields'](_0x1ec1c3[_0x752f('0x29')]['fields']));_0x280334['attributes']=_0x280334[_0x752f('0x2e')][_0x752f('0x2f')]?_0x280334['attributes']:_0xb5e203[_0x752f('0x27')];if(!_0x1ec1c3[_0x752f('0x29')][_0x752f('0x30')](_0x752f('0x31'))){_0x280334[_0x752f('0x1b')]=qs[_0x752f('0x1b')](_0x1ec1c3[_0x752f('0x29')][_0x752f('0x1b')]);_0x280334[_0x752f('0x1a')]=qs[_0x752f('0x1a')](_0x1ec1c3[_0x752f('0x29')]['offset']);}_0x280334[_0x752f('0x32')]=qs['sort'](_0x1ec1c3[_0x752f('0x29')]['sort']);_0x280334['where']=qs[_0x752f('0x2c')](_[_0x752f('0x33')](_0x1ec1c3[_0x752f('0x29')],_0xb5e203[_0x752f('0x2c')]));if(_0x212c50[_0x752f('0x2a')]){if(_0x212c50['dateEnd']){_0x212c50['dateEnd']=moment(_0x212c50[_0x752f('0x2b')])[_0x752f('0x34')](0x1,_0x752f('0x35'));}else{_0x212c50[_0x752f('0x2b')]=moment(_0x212c50[_0x752f('0x2a')])[_0x752f('0x34')](0x1,'day');}_[_0x752f('0x36')](_0x280334[_0x752f('0x37')],{'createdAt':{'$gte':_0x212c50[_0x752f('0x2a')],'$lte':_0x212c50['dateEnd']}});}if(_0x1ec1c3['query'][_0x752f('0x38')]){_0x280334['where']=_[_0x752f('0x36')](_0x280334[_0x752f('0x37')],{'$or':_[_0x752f('0x39')](_0x280334[_0x752f('0x2e')],function(_0x5d1dee){var _0x2f3402={};_0x2f3402[_0x5d1dee]={'$like':'%'+_0x1ec1c3[_0x752f('0x29')]['filter']+'%'};return _0x2f3402;})});}_0x280334=_[_0x752f('0x36')]({},_0x280334,_0x1ec1c3[_0x752f('0x3a')]);var _0x42fc81={'where':_0x280334[_0x752f('0x37')]};return db[_0x752f('0x26')][_0x752f('0x19')](_0x42fc81)['then'](function(_0x3e9fda){_0x2fdced[_0x752f('0x19')]=_0x3e9fda;if(_0x1ec1c3[_0x752f('0x29')][_0x752f('0x3b')]){_0x280334[_0x752f('0x3c')]=[{'all':!![]}];}return db[_0x752f('0x26')][_0x752f('0x3d')](_0x280334);})['then'](function(_0x200502){_0x2fdced[_0x752f('0x3e')]=_0x200502;return _0x2fdced;})[_0x752f('0x22')](respondWithFilteredResult(_0x33c1ff,_0x280334))[_0x752f('0x3f')](handleError(_0x33c1ff,null));};exports['show']=function(_0x1e0c0f,_0x2ee79e){var _0x125a29={'raw':!![],'where':{'id':_0x1e0c0f[_0x752f('0x40')]['id']}},_0x7df711={};_0x7df711[_0x752f('0x27')]=_[_0x752f('0x28')](db[_0x752f('0x26')][_0x752f('0x41')]);_0x7df711[_0x752f('0x29')]=_[_0x752f('0x28')](_0x1e0c0f['query']);_0x7df711['filters']=_[_0x752f('0x2d')](_0x7df711[_0x752f('0x27')],_0x7df711[_0x752f('0x29')]);_0x125a29[_0x752f('0x2e')]=_[_0x752f('0x2d')](_0x7df711['model'],qs[_0x752f('0x42')](_0x1e0c0f[_0x752f('0x29')][_0x752f('0x42')]));_0x125a29[_0x752f('0x2e')]=_0x125a29[_0x752f('0x2e')][_0x752f('0x2f')]?_0x125a29[_0x752f('0x2e')]:_0x7df711[_0x752f('0x27')];if(_0x1e0c0f['query'][_0x752f('0x3b')]){_0x125a29['include']=[{'all':!![]}];}_0x125a29=_[_0x752f('0x36')]({},_0x125a29,_0x1e0c0f[_0x752f('0x3a')]);return db[_0x752f('0x26')][_0x752f('0x43')](_0x125a29)[_0x752f('0x22')](handleEntityNotFound(_0x2ee79e,null))[_0x752f('0x22')](respondWithResult(_0x2ee79e,null))['catch'](handleError(_0x2ee79e,null));};exports[_0x752f('0x44')]=function(_0x1dd32c,_0x300050){return db[_0x752f('0x26')][_0x752f('0x44')](_0x1dd32c[_0x752f('0x45')],{})[_0x752f('0x22')](respondWithResult(_0x300050,0xc9))[_0x752f('0x3f')](handleError(_0x300050,null));};exports['update']=function(_0x2b8d35,_0x160240){if(_0x2b8d35[_0x752f('0x45')]['id']){delete _0x2b8d35[_0x752f('0x45')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x2b8d35[_0x752f('0x40')]['id']}})[_0x752f('0x22')](handleEntityNotFound(_0x160240,null))[_0x752f('0x22')](saveUpdates(_0x2b8d35[_0x752f('0x45')],null))[_0x752f('0x22')](respondWithResult(_0x160240,null))['catch'](handleError(_0x160240,null));};exports[_0x752f('0x21')]=function(_0x2ca337,_0x21946e){return db['MailQueue'][_0x752f('0x43')]({'where':{'id':_0x2ca337['params']['id']}})[_0x752f('0x22')](handleEntityNotFound(_0x21946e,null))[_0x752f('0x22')](removeEntity(_0x21946e,null))[_0x752f('0x3f')](handleError(_0x21946e,null));};exports['describe']=function(_0x46d76d,_0x300e3c){return db[_0x752f('0x26')][_0x752f('0x46')]()['then'](respondWithResult(_0x300e3c,null))[_0x752f('0x3f')](handleError(_0x300e3c,null));};exports[_0x752f('0x47')]=function(_0xd087ea,_0x429c82,_0x11a116){var _0x3455c3={'raw':!![],'where':{}},_0x403715={},_0xf6e15c;return db[_0x752f('0x26')][_0x752f('0x48')]({'where':{'id':_0xd087ea['params']['id']}})[_0x752f('0x22')](handleEntityNotFound(_0x429c82,null))[_0x752f('0x22')](function(_0x152313){if(_0x152313){_0xf6e15c=_0x152313['get']({'plain':!![]});_0x403715[_0x752f('0x27')]=_[_0x752f('0x28')](db[_0x752f('0x49')][_0x752f('0x41')]);_0x403715[_0x752f('0x29')]=_[_0x752f('0x28')](_0xd087ea[_0x752f('0x29')]);_0x403715['filters']=_[_0x752f('0x2d')](_0x403715['model'],_0x403715[_0x752f('0x29')]);_0x3455c3[_0x752f('0x2e')]=_['intersection'](_0x403715[_0x752f('0x27')],qs[_0x752f('0x42')](_0xd087ea[_0x752f('0x29')][_0x752f('0x42')]));_0x3455c3['attributes']=_0x3455c3[_0x752f('0x2e')][_0x752f('0x2f')]?_0x3455c3[_0x752f('0x2e')]:_0x403715[_0x752f('0x27')];if(!_0xd087ea[_0x752f('0x29')][_0x752f('0x30')](_0x752f('0x31'))){_0x3455c3['limit']=qs[_0x752f('0x1b')](_0xd087ea['query'][_0x752f('0x1b')]);_0x3455c3['offset']=qs[_0x752f('0x1a')](_0xd087ea[_0x752f('0x29')][_0x752f('0x1a')]);}_0x3455c3[_0x752f('0x32')]=qs[_0x752f('0x4a')](_0xd087ea[_0x752f('0x29')][_0x752f('0x4a')]);_0x3455c3[_0x752f('0x37')]=qs[_0x752f('0x2c')](_[_0x752f('0x33')](_0xd087ea[_0x752f('0x29')],_0x403715['filters']));_0x3455c3[_0x752f('0x37')][_0x752f('0x4b')]=_0x152313['id'];if(_0xd087ea['query'][_0x752f('0x38')]){_0x3455c3[_0x752f('0x37')]=_[_0x752f('0x36')](_0x3455c3[_0x752f('0x37')],{'$or':_['map'](_0x3455c3[_0x752f('0x2e')],function(_0x5b4921){var _0x175c13={};_0x175c13[_0x5b4921]={'$like':'%'+_0xd087ea[_0x752f('0x29')][_0x752f('0x38')]+'%'};return _0x175c13;})});}_0x3455c3=_[_0x752f('0x36')]({},_0x3455c3,_0xd087ea[_0x752f('0x3a')]);return db['UserMailQueue'][_0x752f('0x3d')](_0x3455c3);}})[_0x752f('0x22')](function(_0x29d936){if(_0x29d936){return db[_0x752f('0x4c')]['findAndCountAll']({'where':{'id':_['map'](_0x29d936,_0x752f('0x4d')),'role':'agent'},'attributes':['id','name',_0x752f('0x4e'),_0x752f('0x4f'),_0x752f('0x50')]});}})[_0x752f('0x22')](function(_0xad811d){if(_0xad811d){return{'count':_0xad811d[_0x752f('0x19')],'rows':_[_0x752f('0x39')](_0xad811d['rows'],function(_0x4307bd){return{'membername':_0x4307bd[_0x752f('0x24')],'UserId':_0x4307bd['id'],'queue_name':_0xf6e15c['name'],'MailQueueId':_0xf6e15c['id'],'interface':util['format']('%s/%s',_0x752f('0x51'),_0x4307bd[_0x752f('0x24')]),'penalty':0x0,'paused':_0x4307bd[_0x752f('0x4e')],'createdAt':_0x4307bd[_0x752f('0x50')],'updatedAt':_0x4307bd[_0x752f('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x752f('0x22')](respondWithFilteredResult(_0x429c82,_0x3455c3))[_0x752f('0x3f')](handleError(_0x429c82,null));};exports[_0x752f('0x52')]=function(_0x4ffbbb,_0x48181f,_0x5a41b2){var _0x5a4f2d={};var _0x4739eb={};var _0x134d7e;var _0x41143b;return db['MailQueue'][_0x752f('0x48')]({'where':{'id':_0x4ffbbb['params']['id']}})[_0x752f('0x22')](handleEntityNotFound(_0x48181f,null))[_0x752f('0x22')](function(_0x499a85){if(_0x499a85){_0x134d7e=_0x499a85;_0x4739eb[_0x752f('0x27')]=_[_0x752f('0x28')](db[_0x752f('0x53')]['rawAttributes']);_0x4739eb[_0x752f('0x29')]=_[_0x752f('0x28')](_0x4ffbbb[_0x752f('0x29')]);_0x4739eb['filters']=_[_0x752f('0x2d')](_0x4739eb['model'],_0x4739eb[_0x752f('0x29')]);_0x5a4f2d['attributes']=_[_0x752f('0x2d')](_0x4739eb[_0x752f('0x27')],qs[_0x752f('0x42')](_0x4ffbbb[_0x752f('0x29')]['fields']));_0x5a4f2d['attributes']=_0x5a4f2d[_0x752f('0x2e')][_0x752f('0x2f')]?_0x5a4f2d['attributes']:_0x4739eb[_0x752f('0x27')];_0x5a4f2d[_0x752f('0x32')]=qs['sort'](_0x4ffbbb[_0x752f('0x29')][_0x752f('0x4a')]);_0x5a4f2d[_0x752f('0x37')]=qs[_0x752f('0x2c')](_[_0x752f('0x33')](_0x4ffbbb[_0x752f('0x29')],_0x4739eb[_0x752f('0x2c')]));if(_0x4ffbbb[_0x752f('0x29')]['filter']){_0x5a4f2d['where']=_[_0x752f('0x36')](_0x5a4f2d[_0x752f('0x37')],{'$or':_[_0x752f('0x39')](_0x5a4f2d[_0x752f('0x2e')],function(_0x3feecb){var _0x352ff8={};_0x352ff8[_0x3feecb]={'$like':'%'+_0x4ffbbb[_0x752f('0x29')]['filter']+'%'};return _0x352ff8;})});}_0x5a4f2d=_[_0x752f('0x36')]({},_0x5a4f2d,_0x4ffbbb[_0x752f('0x3a')]);return _0x134d7e['getTeams'](_0x5a4f2d);}})[_0x752f('0x22')](function(_0x5e2f00){if(_0x5e2f00){_0x41143b=_0x5e2f00[_0x752f('0x2f')];if(!_0x4ffbbb[_0x752f('0x29')][_0x752f('0x30')](_0x752f('0x31'))){_0x5a4f2d['limit']=qs[_0x752f('0x1b')](_0x4ffbbb['query'][_0x752f('0x1b')]);_0x5a4f2d[_0x752f('0x1a')]=qs['offset'](_0x4ffbbb['query'][_0x752f('0x1a')]);}return _0x134d7e[_0x752f('0x52')](_0x5a4f2d);}})[_0x752f('0x22')](function(_0x2b8e12){if(_0x2b8e12){return _0x2b8e12?{'count':_0x41143b,'rows':_0x2b8e12}:null;}})['then'](respondWithResult(_0x48181f,null))[_0x752f('0x3f')](handleError(_0x48181f,null));};exports[_0x752f('0x54')]=function(_0x209613,_0x352905,_0x13a71b){var _0x23d50a=[];var _0x4645aa;return db[_0x752f('0x53')][_0x752f('0x3d')]({'where':{'id':_0x209613[_0x752f('0x45')]['ids']},'attributes':['id'],'include':[{'model':db[_0x752f('0x4c')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](function(_0x1405c9){if(_0x1405c9){for(var _0x25d23b=0x0;_0x25d23b<_0x1405c9['length'];_0x25d23b+=0x1){for(var _0xc1248d=0x0;_0xc1248d<_0x1405c9[_0x25d23b][_0x752f('0x55')][_0x752f('0x2f')];_0xc1248d+=0x1){_0x23d50a=_['union'](_0x23d50a,[_0x1405c9[_0x25d23b][_0x752f('0x55')][_0xc1248d]['id']]);}}return _0x23d50a;}})[_0x752f('0x22')](function(_0x48eec3){if(_0x48eec3){return db['MailQueue']['find']({'where':{'id':_0x209613[_0x752f('0x40')]['id']}});}})[_0x752f('0x22')](function(_0x2583ea){if(_0x2583ea){_0x4645aa=_0x2583ea;return _0x4645aa['addAgents'](_0x23d50a,{'penalty':_0x209613[_0x752f('0x45')][_0x752f('0x56')]});}})['then'](function(_0x2885ba){if(_0x2885ba){return _0x4645aa[_0x752f('0x54')](_0x209613['body'][_0x752f('0x57')]);}})['then'](handleEntityNotFound(_0x352905,null))['then'](respondWithStatusCode(_0x352905,null))[_0x752f('0x3f')](handleError(_0x352905,null));};exports[_0x752f('0x58')]=function(_0xb24ee3,_0x1b2894,_0x44f06e){var _0x3b37f1=[];var _0x3b300a;return db[_0x752f('0x53')][_0x752f('0x3d')]({'where':{'id':_0xb24ee3[_0x752f('0x29')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x752f('0x55'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x5d57a6){if(_0x5d57a6){for(var _0x409dd4=0x0;_0x409dd4<_0x5d57a6['length'];_0x409dd4+=0x1){for(var _0x7b763d=0x0;_0x7b763d<_0x5d57a6[_0x409dd4]['Agents'][_0x752f('0x2f')];_0x7b763d+=0x1){_0x3b37f1=_[_0x752f('0x59')](_0x3b37f1,[_0x5d57a6[_0x409dd4]['Agents'][_0x7b763d]['id']]);}}return _0x3b37f1;}})[_0x752f('0x22')](function(_0x37414f){if(_0x37414f){return db[_0x752f('0x26')][_0x752f('0x43')]({'where':{'id':_0xb24ee3[_0x752f('0x40')]['id']}});}})[_0x752f('0x22')](function(_0x6e2fd8){if(_0x6e2fd8){_0x3b300a=_0x6e2fd8;return _0x3b300a[_0x752f('0x5a')](_0x3b37f1);}})[_0x752f('0x22')](function(_0xcb93d1){if(_0x3b300a){return _0x3b300a[_0x752f('0x58')](_0xb24ee3['query'][_0x752f('0x57')]);}})[_0x752f('0x22')](handleEntityNotFound(_0x1b2894,null))['then'](respondWithStatusCode(_0x1b2894,null))['catch'](handleError(_0x1b2894,null));};exports['addAgents']=function(_0x1c27df,_0x2d9d1e,_0xc355dd){return db[_0x752f('0x26')][_0x752f('0x43')]({'where':{'id':_0x1c27df[_0x752f('0x40')]['id']}})[_0x752f('0x22')](handleEntityNotFound(_0x2d9d1e,null))['then'](function(_0x50dd1e){if(_0x50dd1e){return _0x50dd1e['addAgents'](_0x1c27df[_0x752f('0x45')][_0x752f('0x57')],_[_0x752f('0x5b')](_0x1c27df[_0x752f('0x45')],[_0x752f('0x57'),'id'])||{})[_0x752f('0x5c')](function(_0x27cc74){for(var _0x4a42ea=0x0;_0x4a42ea<_0x1c27df[_0x752f('0x45')][_0x752f('0x57')][_0x752f('0x2f')];_0x4a42ea+=0x1){socket[_0x752f('0x5d')](_0x752f('0x5e'),{'UserId':_0x1c27df[_0x752f('0x45')][_0x752f('0x57')][_0x4a42ea],'MailQueueId':_0x1c27df[_0x752f('0x40')]['id']});}return _0x27cc74;});}})[_0x752f('0x22')](respondWithResult(_0x2d9d1e,null))[_0x752f('0x3f')](handleError(_0x2d9d1e,null));};exports[_0x752f('0x5a')]=function(_0x250524,_0x5522d1,_0x707d50){var _0x5ca52a;return db[_0x752f('0x26')][_0x752f('0x43')]({'where':{'id':_0x250524[_0x752f('0x40')]['id']}})[_0x752f('0x22')](handleEntityNotFound(_0x5522d1,null))[_0x752f('0x22')](function(_0x2edb5b){if(_0x2edb5b){return _0x2edb5b[_0x752f('0x5a')](_0x250524['query']['ids'])[_0x752f('0x22')](function(_0x1b37f5){if(_[_0x752f('0x5f')](_0x250524[_0x752f('0x29')][_0x752f('0x57')])){for(var _0x1e2e24=0x0;_0x1e2e24<_0x250524[_0x752f('0x29')]['ids'][_0x752f('0x2f')];_0x1e2e24+=0x1){socket[_0x752f('0x5d')]('userMailQueue:remove',{'UserId':_0x250524[_0x752f('0x29')][_0x752f('0x57')][_0x1e2e24],'MailQueueId':_0x250524['params']['id']});}}else{socket[_0x752f('0x5d')](_0x752f('0x60'),{'UserId':_0x250524[_0x752f('0x29')][_0x752f('0x57')],'MailQueueId':_0x250524[_0x752f('0x40')]['id']});}});}})[_0x752f('0x22')](respondWithStatusCode(_0x5522d1,null))['catch'](handleError(_0x5522d1,null));};exports[_0x752f('0x61')]=function(_0x21f177,_0x38adf6,_0x5e3513){var _0x57bf86={};var _0x3a9cb9={};var _0x5166a5;var _0x509af6;return db[_0x752f('0x26')][_0x752f('0x48')]({'where':{'id':_0x21f177['params']['id']}})[_0x752f('0x22')](handleEntityNotFound(_0x38adf6,null))[_0x752f('0x22')](function(_0x3373c3){if(_0x3373c3){_0x5166a5=_0x3373c3;_0x3a9cb9[_0x752f('0x27')]=_[_0x752f('0x28')](db['User'][_0x752f('0x41')]);_0x3a9cb9[_0x752f('0x29')]=_[_0x752f('0x28')](_0x21f177[_0x752f('0x29')]);_0x3a9cb9['filters']=_['intersection'](_0x3a9cb9[_0x752f('0x27')],_0x3a9cb9[_0x752f('0x29')]);_0x57bf86[_0x752f('0x2e')]=_[_0x752f('0x2d')](_0x3a9cb9['model'],qs[_0x752f('0x42')](_0x21f177[_0x752f('0x29')][_0x752f('0x42')]));_0x57bf86['attributes']=_0x57bf86[_0x752f('0x2e')][_0x752f('0x2f')]?_0x57bf86[_0x752f('0x2e')]:_0x3a9cb9[_0x752f('0x27')];_0x57bf86['order']=qs[_0x752f('0x4a')](_0x21f177['query'][_0x752f('0x4a')]);_0x57bf86[_0x752f('0x37')]=qs[_0x752f('0x2c')](_[_0x752f('0x33')](_0x21f177[_0x752f('0x29')],_0x3a9cb9[_0x752f('0x2c')]));if(_0x21f177['query'][_0x752f('0x38')]){_0x57bf86[_0x752f('0x37')]=_['merge'](_0x57bf86[_0x752f('0x37')],{'$or':_[_0x752f('0x39')](_0x57bf86[_0x752f('0x2e')],function(_0x3e6a09){var _0x410143={};_0x410143[_0x3e6a09]={'$like':'%'+_0x21f177[_0x752f('0x29')][_0x752f('0x38')]+'%'};return _0x410143;})});}_0x57bf86=_['merge']({},_0x57bf86,_0x21f177['options']);return _0x5166a5[_0x752f('0x61')](_0x57bf86);}})[_0x752f('0x22')](function(_0x3ab5ae){if(_0x3ab5ae){_0x509af6=_0x3ab5ae[_0x752f('0x2f')];if(!_0x21f177[_0x752f('0x29')]['hasOwnProperty'](_0x752f('0x31'))){_0x57bf86[_0x752f('0x1b')]=qs[_0x752f('0x1b')](_0x21f177[_0x752f('0x29')][_0x752f('0x1b')]);_0x57bf86[_0x752f('0x1a')]=qs[_0x752f('0x1a')](_0x21f177['query']['offset']);}return _0x5166a5['getAgents'](_0x57bf86);}})[_0x752f('0x22')](function(_0x2f8b08){if(_0x2f8b08){return _0x2f8b08?{'count':_0x509af6,'rows':_0x2f8b08}:null;}})['then'](respondWithResult(_0x38adf6,null))[_0x752f('0x3f')](handleError(_0x38adf6,null));};
\ No newline at end of file
+var _0x79ae=['includeAll','include','rows','show','find','catch','create','body','params','destroy','describe','getMembers','findOne','get','UserMailQueue','order','MailQueueId','findAll','User','findAndCountAll','UserId','agent','updatedAt','createdAt','%s/%s','SIP','mailPause','getTeams','Team','addTeams','ids','Agents','addAgents','penalty','removeTeams','union','omit','spread','emit','userMailQueue:save','removeAgents','isArray','userMailQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','index','MailQueue','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','day','add','filter','map','merge','options'];(function(_0x4fcf67,_0x177232){var _0x59e754=function(_0x1a911c){while(--_0x1a911c){_0x4fcf67['push'](_0x4fcf67['shift']());}};_0x59e754(++_0x177232);}(_0x79ae,0x1dc));var _0xe79a=function(_0xc8febc,_0x3ea80a){_0xc8febc=_0xc8febc-0x0;var _0x1b0415=_0x79ae[_0xc8febc];return _0x1b0415;};'use strict';var pdf=require(_0xe79a('0x0'));var emlformat=require(_0xe79a('0x1'));var rimraf=require(_0xe79a('0x2'));var zipdir=require(_0xe79a('0x3'));var jsonpatch=require(_0xe79a('0x4'));var rp=require(_0xe79a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe79a('0x6'));var util=require(_0xe79a('0x7'));var path=require(_0xe79a('0x8'));var sox=require(_0xe79a('0x9'));var csv=require(_0xe79a('0xa'));var ejs=require(_0xe79a('0xb'));var fs=require('fs');var _=require(_0xe79a('0xc'));var squel=require(_0xe79a('0xd'));var crypto=require(_0xe79a('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe79a('0xa'));var querystring=require(_0xe79a('0xf'));var Papa=require(_0xe79a('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xe79a('0x11'))(_0xe79a('0x12'));var utils=require('../../config/utils');var config=require(_0xe79a('0x13'));var db=require(_0xe79a('0x14'))['db'];var socket=require(_0xe79a('0x15'))({'host':'localhost','port':0x18eb});require('./mailQueue.socket')[_0xe79a('0x16')](socket);function respondWithStatusCode(_0x16bf94,_0x10ac04){_0x10ac04=_0x10ac04||0xcc;return function(_0x5e09a9){if(_0x5e09a9){return _0x16bf94[_0xe79a('0x17')](_0x10ac04);}return _0x16bf94['status'](_0x10ac04)[_0xe79a('0x18')]();};}function respondWithResult(_0x330ebe,_0x2f1222){_0x2f1222=_0x2f1222||0xc8;return function(_0x4117e4){if(_0x4117e4){return _0x330ebe[_0xe79a('0x19')](_0x2f1222)[_0xe79a('0x1a')](_0x4117e4);}};}function respondWithFilteredResult(_0xa697,_0x285d84){return function(_0x4e08e7){if(_0x4e08e7){var _0x27254c=_0x4e08e7[_0xe79a('0x1b')],_0x2c2301=_0x285d84[_0xe79a('0x1c')],_0x5d6629=_0x285d84[_0xe79a('0x1c')]+_0x285d84[_0xe79a('0x1d')],_0x521d81;if(_0x5d6629>=_0x27254c){_0x5d6629=_0x27254c;_0x521d81=0xc8;}else{_0x521d81=0xce;}_0xa697[_0xe79a('0x19')](_0x521d81);return _0xa697[_0xe79a('0x1e')](_0xe79a('0x1f'),_0x2c2301+'-'+_0x5d6629+'/'+_0x27254c)[_0xe79a('0x1a')](_0x4e08e7);}return null;};}function patchUpdates(_0x462be5){return function(_0x19401b){try{jsonpatch[_0xe79a('0x20')](_0x19401b,_0x462be5,!![]);}catch(_0x44ba36){return BPromise['reject'](_0x44ba36);}return _0x19401b[_0xe79a('0x21')]();};}function saveUpdates(_0x4f8bcc,_0x139272){return function(_0x49b9aa){if(_0x49b9aa){return _0x49b9aa[_0xe79a('0x22')](_0x4f8bcc)[_0xe79a('0x23')](function(_0x44bc2b){return _0x44bc2b;});}return null;};}function removeEntity(_0x4c87ae,_0x1d4376){return function(_0x56d56e){if(_0x56d56e){return _0x56d56e['destroy']()[_0xe79a('0x23')](function(){_0x4c87ae[_0xe79a('0x19')](0xcc)[_0xe79a('0x18')]();});}};}function handleEntityNotFound(_0x21cea3,_0xa2571d){return function(_0x52d092){if(!_0x52d092){_0x21cea3[_0xe79a('0x17')](0x194);}return _0x52d092;};}function handleError(_0x4a9ed0,_0x5980df){_0x5980df=_0x5980df||0x1f4;return function(_0x57aa7c){logger[_0xe79a('0x24')](_0x57aa7c[_0xe79a('0x25')]);if(_0x57aa7c[_0xe79a('0x26')]){delete _0x57aa7c[_0xe79a('0x26')];}_0x4a9ed0[_0xe79a('0x19')](_0x5980df)[_0xe79a('0x27')](_0x57aa7c);};}exports[_0xe79a('0x28')]=function(_0x2fef73,_0x4c48d0){var _0x9fda40={},_0xe1ea0c={},_0x4677b9={'count':0x0,'rows':[]};var _0x47ee58=db[_0xe79a('0x29')][_0xe79a('0x2a')];_0xe1ea0c[_0xe79a('0x2b')]=_[_0xe79a('0x2c')](_0x47ee58);var _0x24929b={'dateStart':_0x2fef73[_0xe79a('0x2d')][_0xe79a('0x2e')],'dateEnd':_0x2fef73[_0xe79a('0x2d')][_0xe79a('0x2f')]};delete _0x2fef73[_0xe79a('0x2d')][_0xe79a('0x2e')];delete _0x2fef73[_0xe79a('0x2d')][_0xe79a('0x2f')];_0xe1ea0c[_0xe79a('0x2d')]=_['keys'](_0x2fef73[_0xe79a('0x2d')]);_0xe1ea0c[_0xe79a('0x30')]=_[_0xe79a('0x31')](_0xe1ea0c['model'],_0xe1ea0c[_0xe79a('0x2d')]);_0x9fda40[_0xe79a('0x32')]=_[_0xe79a('0x31')](_0xe1ea0c[_0xe79a('0x2b')],qs['fields'](_0x2fef73[_0xe79a('0x2d')][_0xe79a('0x33')]));_0x9fda40[_0xe79a('0x32')]=_0x9fda40['attributes'][_0xe79a('0x34')]?_0x9fda40[_0xe79a('0x32')]:_0xe1ea0c['model'];if(!_0x2fef73[_0xe79a('0x2d')][_0xe79a('0x35')](_0xe79a('0x36'))){_0x9fda40[_0xe79a('0x1d')]=qs[_0xe79a('0x1d')](_0x2fef73[_0xe79a('0x2d')][_0xe79a('0x1d')]);_0x9fda40['offset']=qs['offset'](_0x2fef73[_0xe79a('0x2d')][_0xe79a('0x1c')]);}_0x9fda40['order']=qs['sort'](_0x2fef73[_0xe79a('0x2d')][_0xe79a('0x37')]);_0x9fda40[_0xe79a('0x38')]=qs[_0xe79a('0x30')](_[_0xe79a('0x39')](_0x2fef73[_0xe79a('0x2d')],_0xe1ea0c[_0xe79a('0x30')]));if(_0x24929b[_0xe79a('0x2e')]){if(_0x24929b[_0xe79a('0x2f')]){_0x24929b[_0xe79a('0x2f')]=moment(_0x24929b['dateEnd'])['add'](0x1,_0xe79a('0x3a'));}else{_0x24929b['dateEnd']=moment(_0x24929b[_0xe79a('0x2e')])[_0xe79a('0x3b')](0x1,_0xe79a('0x3a'));}_['merge'](_0x9fda40['where'],{'createdAt':{'$gte':_0x24929b['dateStart'],'$lte':_0x24929b['dateEnd']}});}if(_0x2fef73[_0xe79a('0x2d')][_0xe79a('0x3c')]){_0x9fda40[_0xe79a('0x38')]=_['merge'](_0x9fda40[_0xe79a('0x38')],{'$or':_[_0xe79a('0x3d')](_0x9fda40[_0xe79a('0x32')],function(_0x36bc0e){var _0x59ef10={};_0x59ef10[_0x36bc0e]={'$like':'%'+_0x2fef73[_0xe79a('0x2d')][_0xe79a('0x3c')]+'%'};return _0x59ef10;})});}_0x9fda40=_[_0xe79a('0x3e')]({},_0x9fda40,_0x2fef73[_0xe79a('0x3f')]);var _0x55ee36={'where':_0x9fda40[_0xe79a('0x38')]};return db[_0xe79a('0x29')][_0xe79a('0x1b')](_0x55ee36)[_0xe79a('0x23')](function(_0x4c0bc6){_0x4677b9[_0xe79a('0x1b')]=_0x4c0bc6;if(_0x2fef73[_0xe79a('0x2d')][_0xe79a('0x40')]){_0x9fda40[_0xe79a('0x41')]=[{'all':!![]}];}return db[_0xe79a('0x29')]['findAll'](_0x9fda40);})[_0xe79a('0x23')](function(_0x33e74c){_0x4677b9[_0xe79a('0x42')]=_0x33e74c;return _0x4677b9;})['then'](respondWithFilteredResult(_0x4c48d0,_0x9fda40))['catch'](handleError(_0x4c48d0,null));};exports[_0xe79a('0x43')]=function(_0x5f71b0,_0x1b91bc){var _0xd9ffce={'raw':!![],'where':{'id':_0x5f71b0['params']['id']}},_0x335b8d={};_0x335b8d['model']=_['keys'](db[_0xe79a('0x29')][_0xe79a('0x2a')]);_0x335b8d['query']=_[_0xe79a('0x2c')](_0x5f71b0[_0xe79a('0x2d')]);_0x335b8d['filters']=_[_0xe79a('0x31')](_0x335b8d[_0xe79a('0x2b')],_0x335b8d[_0xe79a('0x2d')]);_0xd9ffce[_0xe79a('0x32')]=_[_0xe79a('0x31')](_0x335b8d[_0xe79a('0x2b')],qs[_0xe79a('0x33')](_0x5f71b0[_0xe79a('0x2d')]['fields']));_0xd9ffce[_0xe79a('0x32')]=_0xd9ffce[_0xe79a('0x32')][_0xe79a('0x34')]?_0xd9ffce['attributes']:_0x335b8d[_0xe79a('0x2b')];if(_0x5f71b0[_0xe79a('0x2d')][_0xe79a('0x40')]){_0xd9ffce[_0xe79a('0x41')]=[{'all':!![]}];}_0xd9ffce=_['merge']({},_0xd9ffce,_0x5f71b0[_0xe79a('0x3f')]);return db[_0xe79a('0x29')][_0xe79a('0x44')](_0xd9ffce)[_0xe79a('0x23')](handleEntityNotFound(_0x1b91bc,null))[_0xe79a('0x23')](respondWithResult(_0x1b91bc,null))[_0xe79a('0x45')](handleError(_0x1b91bc,null));};exports[_0xe79a('0x46')]=function(_0x329311,_0x165a77){return db[_0xe79a('0x29')][_0xe79a('0x46')](_0x329311[_0xe79a('0x47')],{})['then'](respondWithResult(_0x165a77,0xc9))['catch'](handleError(_0x165a77,null));};exports[_0xe79a('0x22')]=function(_0x1af475,_0xa5637){if(_0x1af475[_0xe79a('0x47')]['id']){delete _0x1af475[_0xe79a('0x47')]['id'];}return db[_0xe79a('0x29')]['find']({'where':{'id':_0x1af475[_0xe79a('0x48')]['id']}})[_0xe79a('0x23')](handleEntityNotFound(_0xa5637,null))[_0xe79a('0x23')](saveUpdates(_0x1af475[_0xe79a('0x47')],null))[_0xe79a('0x23')](respondWithResult(_0xa5637,null))[_0xe79a('0x45')](handleError(_0xa5637,null));};exports[_0xe79a('0x49')]=function(_0x37dfc4,_0x286820){return db[_0xe79a('0x29')][_0xe79a('0x44')]({'where':{'id':_0x37dfc4['params']['id']}})['then'](handleEntityNotFound(_0x286820,null))[_0xe79a('0x23')](removeEntity(_0x286820,null))['catch'](handleError(_0x286820,null));};exports[_0xe79a('0x4a')]=function(_0x2a4b5b,_0x30836f){return db[_0xe79a('0x29')][_0xe79a('0x4a')]()['then'](respondWithResult(_0x30836f,null))[_0xe79a('0x45')](handleError(_0x30836f,null));};exports[_0xe79a('0x4b')]=function(_0x3893b3,_0x55487b,_0x38939e){var _0x124830={'raw':!![],'where':{}},_0x4cc204={},_0x4fa605;return db[_0xe79a('0x29')][_0xe79a('0x4c')]({'where':{'id':_0x3893b3['params']['id']}})[_0xe79a('0x23')](handleEntityNotFound(_0x55487b,null))['then'](function(_0x1cb9e2){if(_0x1cb9e2){_0x4fa605=_0x1cb9e2[_0xe79a('0x4d')]({'plain':!![]});_0x4cc204[_0xe79a('0x2b')]=_[_0xe79a('0x2c')](db[_0xe79a('0x4e')]['rawAttributes']);_0x4cc204[_0xe79a('0x2d')]=_['keys'](_0x3893b3[_0xe79a('0x2d')]);_0x4cc204[_0xe79a('0x30')]=_[_0xe79a('0x31')](_0x4cc204[_0xe79a('0x2b')],_0x4cc204[_0xe79a('0x2d')]);_0x124830[_0xe79a('0x32')]=_[_0xe79a('0x31')](_0x4cc204[_0xe79a('0x2b')],qs[_0xe79a('0x33')](_0x3893b3['query'][_0xe79a('0x33')]));_0x124830[_0xe79a('0x32')]=_0x124830[_0xe79a('0x32')]['length']?_0x124830['attributes']:_0x4cc204[_0xe79a('0x2b')];if(!_0x3893b3[_0xe79a('0x2d')][_0xe79a('0x35')](_0xe79a('0x36'))){_0x124830[_0xe79a('0x1d')]=qs[_0xe79a('0x1d')](_0x3893b3['query'][_0xe79a('0x1d')]);_0x124830[_0xe79a('0x1c')]=qs['offset'](_0x3893b3[_0xe79a('0x2d')][_0xe79a('0x1c')]);}_0x124830[_0xe79a('0x4f')]=qs[_0xe79a('0x37')](_0x3893b3['query'][_0xe79a('0x37')]);_0x124830['where']=qs['filters'](_[_0xe79a('0x39')](_0x3893b3[_0xe79a('0x2d')],_0x4cc204[_0xe79a('0x30')]));_0x124830['where'][_0xe79a('0x50')]=_0x1cb9e2['id'];if(_0x3893b3['query'][_0xe79a('0x3c')]){_0x124830[_0xe79a('0x38')]=_[_0xe79a('0x3e')](_0x124830[_0xe79a('0x38')],{'$or':_[_0xe79a('0x3d')](_0x124830[_0xe79a('0x32')],function(_0x5543ca){var _0x54614a={};_0x54614a[_0x5543ca]={'$like':'%'+_0x3893b3['query']['filter']+'%'};return _0x54614a;})});}_0x124830=_[_0xe79a('0x3e')]({},_0x124830,_0x3893b3['options']);return db[_0xe79a('0x4e')][_0xe79a('0x51')](_0x124830);}})['then'](function(_0x47f37a){if(_0x47f37a){return db[_0xe79a('0x52')][_0xe79a('0x53')]({'where':{'id':_[_0xe79a('0x3d')](_0x47f37a,_0xe79a('0x54')),'role':_0xe79a('0x55')},'attributes':['id',_0xe79a('0x26'),'mailPause',_0xe79a('0x56'),_0xe79a('0x57')]});}})[_0xe79a('0x23')](function(_0x3535b1){if(_0x3535b1){return{'count':_0x3535b1[_0xe79a('0x1b')],'rows':_['map'](_0x3535b1['rows'],function(_0xd1d2fa){return{'membername':_0xd1d2fa[_0xe79a('0x26')],'UserId':_0xd1d2fa['id'],'queue_name':_0x4fa605['name'],'MailQueueId':_0x4fa605['id'],'interface':util['format'](_0xe79a('0x58'),_0xe79a('0x59'),_0xd1d2fa[_0xe79a('0x26')]),'penalty':0x0,'paused':_0xd1d2fa[_0xe79a('0x5a')],'createdAt':_0xd1d2fa[_0xe79a('0x57')],'updatedAt':_0xd1d2fa[_0xe79a('0x56')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe79a('0x23')](respondWithFilteredResult(_0x55487b,_0x124830))['catch'](handleError(_0x55487b,null));};exports[_0xe79a('0x5b')]=function(_0x3965c2,_0x2c4187,_0x2a56db){var _0x396ab2={};var _0x1a7dab={};var _0x4d100d;var _0x9bf5c9;return db[_0xe79a('0x29')]['findOne']({'where':{'id':_0x3965c2[_0xe79a('0x48')]['id']}})['then'](handleEntityNotFound(_0x2c4187,null))[_0xe79a('0x23')](function(_0x2dfed1){if(_0x2dfed1){_0x4d100d=_0x2dfed1;_0x1a7dab[_0xe79a('0x2b')]=_[_0xe79a('0x2c')](db[_0xe79a('0x5c')][_0xe79a('0x2a')]);_0x1a7dab['query']=_['keys'](_0x3965c2[_0xe79a('0x2d')]);_0x1a7dab[_0xe79a('0x30')]=_['intersection'](_0x1a7dab[_0xe79a('0x2b')],_0x1a7dab[_0xe79a('0x2d')]);_0x396ab2[_0xe79a('0x32')]=_[_0xe79a('0x31')](_0x1a7dab[_0xe79a('0x2b')],qs['fields'](_0x3965c2[_0xe79a('0x2d')][_0xe79a('0x33')]));_0x396ab2[_0xe79a('0x32')]=_0x396ab2[_0xe79a('0x32')][_0xe79a('0x34')]?_0x396ab2['attributes']:_0x1a7dab['model'];_0x396ab2[_0xe79a('0x4f')]=qs[_0xe79a('0x37')](_0x3965c2[_0xe79a('0x2d')][_0xe79a('0x37')]);_0x396ab2[_0xe79a('0x38')]=qs[_0xe79a('0x30')](_['pick'](_0x3965c2[_0xe79a('0x2d')],_0x1a7dab['filters']));if(_0x3965c2[_0xe79a('0x2d')][_0xe79a('0x3c')]){_0x396ab2[_0xe79a('0x38')]=_[_0xe79a('0x3e')](_0x396ab2['where'],{'$or':_[_0xe79a('0x3d')](_0x396ab2[_0xe79a('0x32')],function(_0x735c7){var _0x46d5d7={};_0x46d5d7[_0x735c7]={'$like':'%'+_0x3965c2[_0xe79a('0x2d')]['filter']+'%'};return _0x46d5d7;})});}_0x396ab2=_[_0xe79a('0x3e')]({},_0x396ab2,_0x3965c2[_0xe79a('0x3f')]);return _0x4d100d[_0xe79a('0x5b')](_0x396ab2);}})[_0xe79a('0x23')](function(_0x2db9b7){if(_0x2db9b7){_0x9bf5c9=_0x2db9b7['length'];if(!_0x3965c2[_0xe79a('0x2d')][_0xe79a('0x35')](_0xe79a('0x36'))){_0x396ab2[_0xe79a('0x1d')]=qs[_0xe79a('0x1d')](_0x3965c2['query'][_0xe79a('0x1d')]);_0x396ab2[_0xe79a('0x1c')]=qs[_0xe79a('0x1c')](_0x3965c2[_0xe79a('0x2d')][_0xe79a('0x1c')]);}return _0x4d100d[_0xe79a('0x5b')](_0x396ab2);}})[_0xe79a('0x23')](function(_0x517ee7){if(_0x517ee7){return _0x517ee7?{'count':_0x9bf5c9,'rows':_0x517ee7}:null;}})[_0xe79a('0x23')](respondWithResult(_0x2c4187,null))[_0xe79a('0x45')](handleError(_0x2c4187,null));};exports[_0xe79a('0x5d')]=function(_0x19ebb4,_0x2772f0,_0x50713e){var _0x1cb630=[];var _0x4cdf81;return db[_0xe79a('0x5c')][_0xe79a('0x51')]({'where':{'id':_0x19ebb4[_0xe79a('0x47')][_0xe79a('0x5e')]},'attributes':['id'],'include':[{'model':db[_0xe79a('0x52')],'as':_0xe79a('0x5f'),'attributes':['id'],'raw':!![]}]})[_0xe79a('0x23')](function(_0x3b7082){if(_0x3b7082){for(var _0x23be18=0x0;_0x23be18<_0x3b7082[_0xe79a('0x34')];_0x23be18+=0x1){for(var _0x1f1a9f=0x0;_0x1f1a9f<_0x3b7082[_0x23be18][_0xe79a('0x5f')]['length'];_0x1f1a9f+=0x1){_0x1cb630=_['union'](_0x1cb630,[_0x3b7082[_0x23be18][_0xe79a('0x5f')][_0x1f1a9f]['id']]);}}return _0x1cb630;}})[_0xe79a('0x23')](function(_0xf98673){if(_0xf98673){return db[_0xe79a('0x29')][_0xe79a('0x44')]({'where':{'id':_0x19ebb4[_0xe79a('0x48')]['id']}});}})[_0xe79a('0x23')](function(_0x37c409){if(_0x37c409){_0x4cdf81=_0x37c409;return _0x4cdf81[_0xe79a('0x60')](_0x1cb630,{'penalty':_0x19ebb4[_0xe79a('0x47')][_0xe79a('0x61')]});}})[_0xe79a('0x23')](function(_0x19f9b3){if(_0x19f9b3){return _0x4cdf81[_0xe79a('0x5d')](_0x19ebb4[_0xe79a('0x47')][_0xe79a('0x5e')]);}})[_0xe79a('0x23')](handleEntityNotFound(_0x2772f0,null))[_0xe79a('0x23')](respondWithStatusCode(_0x2772f0,null))[_0xe79a('0x45')](handleError(_0x2772f0,null));};exports[_0xe79a('0x62')]=function(_0x460ceb,_0x205f5a,_0x4e6f4f){var _0x4fda3d=[];var _0x2603d6;return db[_0xe79a('0x5c')][_0xe79a('0x51')]({'where':{'id':_0x460ceb[_0xe79a('0x2d')][_0xe79a('0x5e')]},'attributes':['id'],'include':[{'model':db[_0xe79a('0x52')],'as':_0xe79a('0x5f'),'attributes':['id'],'raw':!![]}]})[_0xe79a('0x23')](function(_0x3001ce){if(_0x3001ce){for(var _0xa2ac14=0x0;_0xa2ac14<_0x3001ce[_0xe79a('0x34')];_0xa2ac14+=0x1){for(var _0x3965b4=0x0;_0x3965b4<_0x3001ce[_0xa2ac14][_0xe79a('0x5f')][_0xe79a('0x34')];_0x3965b4+=0x1){_0x4fda3d=_[_0xe79a('0x63')](_0x4fda3d,[_0x3001ce[_0xa2ac14][_0xe79a('0x5f')][_0x3965b4]['id']]);}}return _0x4fda3d;}})['then'](function(_0x656cd8){if(_0x656cd8){return db[_0xe79a('0x29')][_0xe79a('0x44')]({'where':{'id':_0x460ceb[_0xe79a('0x48')]['id']}});}})[_0xe79a('0x23')](function(_0x20208f){if(_0x20208f){_0x2603d6=_0x20208f;return _0x2603d6['removeAgents'](_0x4fda3d);}})[_0xe79a('0x23')](function(_0x4e9fcd){if(_0x2603d6){return _0x2603d6[_0xe79a('0x62')](_0x460ceb[_0xe79a('0x2d')][_0xe79a('0x5e')]);}})[_0xe79a('0x23')](handleEntityNotFound(_0x205f5a,null))['then'](respondWithStatusCode(_0x205f5a,null))[_0xe79a('0x45')](handleError(_0x205f5a,null));};exports['addAgents']=function(_0x53477e,_0x56cca6,_0x2a2667){return db[_0xe79a('0x29')][_0xe79a('0x44')]({'where':{'id':_0x53477e[_0xe79a('0x48')]['id']}})[_0xe79a('0x23')](handleEntityNotFound(_0x56cca6,null))[_0xe79a('0x23')](function(_0x11b84a){if(_0x11b84a){return _0x11b84a[_0xe79a('0x60')](_0x53477e[_0xe79a('0x47')]['ids'],_[_0xe79a('0x64')](_0x53477e[_0xe79a('0x47')],[_0xe79a('0x5e'),'id'])||{})[_0xe79a('0x65')](function(_0x49f689){for(var _0x1bd782=0x0;_0x1bd782<_0x53477e[_0xe79a('0x47')][_0xe79a('0x5e')][_0xe79a('0x34')];_0x1bd782+=0x1){socket[_0xe79a('0x66')](_0xe79a('0x67'),{'UserId':_0x53477e[_0xe79a('0x47')][_0xe79a('0x5e')][_0x1bd782],'MailQueueId':_0x53477e[_0xe79a('0x48')]['id']});}return _0x49f689;});}})['then'](respondWithResult(_0x56cca6,null))['catch'](handleError(_0x56cca6,null));};exports['removeAgents']=function(_0xc5ca38,_0x545a1b,_0x56c532){var _0x54584e;return db['MailQueue']['find']({'where':{'id':_0xc5ca38['params']['id']}})['then'](handleEntityNotFound(_0x545a1b,null))[_0xe79a('0x23')](function(_0x14e370){if(_0x14e370){return _0x14e370[_0xe79a('0x68')](_0xc5ca38[_0xe79a('0x2d')][_0xe79a('0x5e')])[_0xe79a('0x23')](function(_0x35a936){if(_[_0xe79a('0x69')](_0xc5ca38['query'][_0xe79a('0x5e')])){for(var _0x2001d7=0x0;_0x2001d7<_0xc5ca38['query'][_0xe79a('0x5e')][_0xe79a('0x34')];_0x2001d7+=0x1){socket['emit']('userMailQueue:remove',{'UserId':_0xc5ca38[_0xe79a('0x2d')]['ids'][_0x2001d7],'MailQueueId':_0xc5ca38[_0xe79a('0x48')]['id']});}}else{socket['emit'](_0xe79a('0x6a'),{'UserId':_0xc5ca38[_0xe79a('0x2d')][_0xe79a('0x5e')],'MailQueueId':_0xc5ca38[_0xe79a('0x48')]['id']});}});}})[_0xe79a('0x23')](respondWithStatusCode(_0x545a1b,null))[_0xe79a('0x45')](handleError(_0x545a1b,null));};exports['getAgents']=function(_0x4e8d10,_0x30e716,_0x1d421e){var _0x5028c5={};var _0x38ea1={};var _0x47ff29;var _0x1e4323;return db['MailQueue'][_0xe79a('0x4c')]({'where':{'id':_0x4e8d10[_0xe79a('0x48')]['id']}})[_0xe79a('0x23')](handleEntityNotFound(_0x30e716,null))[_0xe79a('0x23')](function(_0x3b44c7){if(_0x3b44c7){_0x47ff29=_0x3b44c7;_0x38ea1[_0xe79a('0x2b')]=_[_0xe79a('0x2c')](db[_0xe79a('0x52')][_0xe79a('0x2a')]);_0x38ea1['query']=_['keys'](_0x4e8d10['query']);_0x38ea1[_0xe79a('0x30')]=_[_0xe79a('0x31')](_0x38ea1[_0xe79a('0x2b')],_0x38ea1['query']);_0x5028c5[_0xe79a('0x32')]=_[_0xe79a('0x31')](_0x38ea1[_0xe79a('0x2b')],qs['fields'](_0x4e8d10[_0xe79a('0x2d')]['fields']));_0x5028c5['attributes']=_0x5028c5[_0xe79a('0x32')][_0xe79a('0x34')]?_0x5028c5['attributes']:_0x38ea1[_0xe79a('0x2b')];_0x5028c5[_0xe79a('0x4f')]=qs[_0xe79a('0x37')](_0x4e8d10[_0xe79a('0x2d')]['sort']);_0x5028c5[_0xe79a('0x38')]=qs[_0xe79a('0x30')](_['pick'](_0x4e8d10['query'],_0x38ea1[_0xe79a('0x30')]));if(_0x4e8d10[_0xe79a('0x2d')][_0xe79a('0x3c')]){_0x5028c5[_0xe79a('0x38')]=_['merge'](_0x5028c5['where'],{'$or':_[_0xe79a('0x3d')](_0x5028c5['attributes'],function(_0x84cc9){var _0x23a475={};_0x23a475[_0x84cc9]={'$like':'%'+_0x4e8d10[_0xe79a('0x2d')]['filter']+'%'};return _0x23a475;})});}_0x5028c5=_[_0xe79a('0x3e')]({},_0x5028c5,_0x4e8d10[_0xe79a('0x3f')]);return _0x47ff29['getAgents'](_0x5028c5);}})[_0xe79a('0x23')](function(_0x134cc6){if(_0x134cc6){_0x1e4323=_0x134cc6[_0xe79a('0x34')];if(!_0x4e8d10[_0xe79a('0x2d')]['hasOwnProperty'](_0xe79a('0x36'))){_0x5028c5[_0xe79a('0x1d')]=qs[_0xe79a('0x1d')](_0x4e8d10['query'][_0xe79a('0x1d')]);_0x5028c5[_0xe79a('0x1c')]=qs[_0xe79a('0x1c')](_0x4e8d10[_0xe79a('0x2d')]['offset']);}return _0x47ff29[_0xe79a('0x6b')](_0x5028c5);}})['then'](function(_0x23590b){if(_0x23590b){return _0x23590b?{'count':_0x1e4323,'rows':_0x23590b}:null;}})[_0xe79a('0x23')](respondWithResult(_0x30e716,null))[_0xe79a('0x45')](handleError(_0x30e716,null));};
\ No newline at end of file
index d2d9d74..22f2bc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadac=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners'];(function(_0xd924d5,_0x37ade8){var _0x1b3c69=function(_0x2bab18){while(--_0x2bab18){_0xd924d5['push'](_0xd924d5['shift']());}};_0x1b3c69(++_0x37ade8);}(_0xadac,0x16e));var _0xcada=function(_0x4283c0,_0xc694d5){_0x4283c0=_0x4283c0-0x0;var _0x6b47ab=_0xadac[_0x4283c0];return _0x6b47ab;};'use strict';var EventEmitter=require(_0xcada('0x0'));var MailQueue=require(_0xcada('0x1'))['db'][_0xcada('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xcada('0x3')](0x0);var events={'afterCreate':_0xcada('0x4'),'afterUpdate':_0xcada('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4c738e){return function(_0x588719,_0x10e50c,_0xa966a8){MailQueueEvents['emit'](_0x4c738e+':'+_0x588719['id'],_0x588719);MailQueueEvents[_0xcada('0x6')](_0x4c738e,_0x588719);_0xa966a8(null);};}for(var e in events){if(events[_0xcada('0x7')](e)){var event=events[e];MailQueue[_0xcada('0x8')](e,emitEvent(event));}}module[_0xcada('0x9')]=MailQueueEvents;
\ No newline at end of file
+var _0x344c=['events','../../mysqldb','update','remove','emit','hasOwnProperty','exports'];(function(_0x622035,_0x1a4b91){var _0x326cf2=function(_0x5c3002){while(--_0x5c3002){_0x622035['push'](_0x622035['shift']());}};_0x326cf2(++_0x1a4b91);}(_0x344c,0x188));var _0xc344=function(_0x1dda92,_0x2e9b4f){_0x1dda92=_0x1dda92-0x0;var _0x309a0e=_0x344c[_0x1dda92];return _0x309a0e;};'use strict';var EventEmitter=require(_0xc344('0x0'));var MailQueue=require(_0xc344('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc344('0x2'),'afterDestroy':_0xc344('0x3')};function emitEvent(_0x55698d){return function(_0x514022,_0x27694a,_0x3a9076){MailQueueEvents[_0xc344('0x4')](_0x55698d+':'+_0x514022['id'],_0x514022);MailQueueEvents['emit'](_0x55698d,_0x514022);_0x3a9076(null);};}for(var e in events){if(events[_0xc344('0x5')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xc344('0x6')]=MailQueueEvents;
\ No newline at end of file
index e1e4579..3ef7fe7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4f9=['MailQueue','mail_queues','lodash','util','../../config/logger','moment','bluebird','exports','define'];(function(_0x28e71a,_0x4405bd){var _0x268fed=function(_0x404197){while(--_0x404197){_0x28e71a['push'](_0x28e71a['shift']());}};_0x268fed(++_0x4405bd);}(_0xa4f9,0x173));var _0x9a4f=function(_0x4cd4c7,_0x5cd92b){_0x4cd4c7=_0x4cd4c7-0x0;var _0x48ccde=_0xa4f9[_0x4cd4c7];return _0x48ccde;};'use strict';var _=require(_0x9a4f('0x0'));var util=require(_0x9a4f('0x1'));var logger=require(_0x9a4f('0x2'))('api');var moment=require(_0x9a4f('0x3'));var BPromise=require(_0x9a4f('0x4'));var rp=require('request-promise');var attributes=require('./mailQueue.attributes');module[_0x9a4f('0x5')]=function(_0x8e8d7b,_0x13c1dd){return _0x8e8d7b[_0x9a4f('0x6')](_0x9a4f('0x7'),attributes,{'tableName':_0x9a4f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xefd0=['exports','mail_queues','lodash','util','../../config/logger','api','request-promise','./mailQueue.attributes'];(function(_0x1e499e,_0x61d09c){var _0xbaf8c4=function(_0xb721bb){while(--_0xb721bb){_0x1e499e['push'](_0x1e499e['shift']());}};_0xbaf8c4(++_0x61d09c);}(_0xefd0,0x172));var _0x0efd=function(_0x1c5b66,_0x89c079){_0x1c5b66=_0x1c5b66-0x0;var _0x373f8c=_0xefd0[_0x1c5b66];return _0x373f8c;};'use strict';var _=require(_0x0efd('0x0'));var util=require(_0x0efd('0x1'));var logger=require(_0x0efd('0x2'))(_0x0efd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0efd('0x4'));var attributes=require(_0x0efd('0x5'));module[_0x0efd('0x6')]=function(_0x149a5d,_0x59e614){return _0x149a5d['define']('MailQueue',attributes,{'tableName':_0x0efd('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dfcd695..8ccbf49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0dc=['debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowMailQueue','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','socket.io-emitter','localhost','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x3482db,_0x104108){var _0x2c02e1=function(_0x1e9901){while(--_0x1e9901){_0x3482db['push'](_0x3482db['shift']());}};_0x2c02e1(++_0x104108);}(_0xe0dc,0x190));var _0xce0d=function(_0x5880d8,_0x30b0a5){_0x5880d8=_0x5880d8-0x0;var _0x88264a=_0xe0dc[_0x5880d8];return _0x88264a;};'use strict';var _=require(_0xce0d('0x0'));var util=require('util');var moment=require(_0xce0d('0x1'));var BPromise=require(_0xce0d('0x2'));var rs=require('randomstring');var fs=require('fs');var db=require(_0xce0d('0x3'))['db'];var utils=require(_0xce0d('0x4'));var logger=require(_0xce0d('0x5'))(_0xce0d('0x6'));var config=require('../../config/environment');var jayson=require(_0xce0d('0x7'));var client=jayson['client'][_0xce0d('0x8')]({'port':0x232a});var socket=require(_0xce0d('0x9'))({'host':_0xce0d('0xa'),'port':0x18eb});require(_0xce0d('0xb'))[_0xce0d('0xc')](socket);function respondWithRpcPromise(_0x2f82c0,_0x15d5c0,_0x1ed4a3){return new BPromise(function(_0x71f0fa,_0x3e63c7){return client[_0xce0d('0xd')](_0x2f82c0,_0x1ed4a3)[_0xce0d('0xe')](function(_0xc0e7c5){logger[_0xce0d('0xf')](_0xce0d('0x10'),_0x15d5c0,_0xce0d('0x11'));logger[_0xce0d('0x12')](_0xce0d('0x13'),_0x15d5c0,_0xce0d('0x11'),JSON['stringify'](_0xc0e7c5));if(_0xc0e7c5[_0xce0d('0x14')]){if(_0xc0e7c5[_0xce0d('0x14')][_0xce0d('0x15')]===0x1f4){logger[_0xce0d('0x14')](_0xce0d('0x10'),_0x15d5c0,_0xc0e7c5[_0xce0d('0x14')][_0xce0d('0x16')]);return _0x3e63c7(_0xc0e7c5[_0xce0d('0x14')][_0xce0d('0x16')]);}logger[_0xce0d('0x14')](_0xce0d('0x10'),_0x15d5c0,_0xc0e7c5[_0xce0d('0x14')][_0xce0d('0x16')]);return _0x71f0fa(_0xc0e7c5[_0xce0d('0x14')][_0xce0d('0x16')]);}else{logger[_0xce0d('0xf')](_0xce0d('0x10'),_0x15d5c0,_0xce0d('0x11'));_0x71f0fa(_0xc0e7c5[_0xce0d('0x17')][_0xce0d('0x16')]);}})[_0xce0d('0x18')](function(_0x35dfa1){logger[_0xce0d('0x14')](_0xce0d('0x10'),_0x15d5c0,_0x35dfa1);_0x3e63c7(_0x35dfa1);});});}exports[_0xce0d('0x19')]=function(_0x93b3a4){var _0x1f4049=this;return new Promise(function(_0x415838,_0x37aae8){return db[_0xce0d('0x1a')][_0xce0d('0x1b')]({'raw':_0x93b3a4[_0xce0d('0x1c')]?_0x93b3a4[_0xce0d('0x1c')][_0xce0d('0x1d')]===undefined?!![]:![]:!![],'where':_0x93b3a4[_0xce0d('0x1c')]?_0x93b3a4[_0xce0d('0x1c')][_0xce0d('0x1e')]||null:null,'attributes':_0x93b3a4['options']?_0x93b3a4['options'][_0xce0d('0x1f')]||null:null,'limit':_0x93b3a4['options']?_0x93b3a4[_0xce0d('0x1c')][_0xce0d('0x20')]||null:null,'include':_0x93b3a4[_0xce0d('0x1c')]?_0x93b3a4['options'][_0xce0d('0x21')]?_['map'](_0x93b3a4[_0xce0d('0x1c')]['include'],function(_0x5b759){return{'model':db[_0x5b759[_0xce0d('0x22')]],'as':_0x5b759['as'],'attributes':_0x5b759['attributes'],'include':_0x5b759['include']?_[_0xce0d('0x23')](_0x5b759[_0xce0d('0x21')],function(_0x2a3815){return{'model':db[_0x2a3815[_0xce0d('0x22')]],'as':_0x2a3815['as'],'attributes':_0x2a3815[_0xce0d('0x1f')],'include':_0x2a3815['include']?_[_0xce0d('0x23')](_0x2a3815[_0xce0d('0x21')],function(_0x31ace8){return{'model':db[_0x31ace8['model']],'as':_0x31ace8['as'],'attributes':_0x31ace8[_0xce0d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x228a1c){logger[_0xce0d('0xf')](_0xce0d('0x19'),_0x93b3a4);logger[_0xce0d('0x12')](_0xce0d('0x19'),_0x93b3a4,JSON[_0xce0d('0x24')](_0x228a1c));_0x415838(_0x228a1c);})[_0xce0d('0x18')](function(_0x2f6cab){logger[_0xce0d('0x14')](_0xce0d('0x19'),_0x2f6cab[_0xce0d('0x16')],_0x93b3a4);_0x37aae8(_0x1f4049[_0xce0d('0x14')](0x1f4,_0x2f6cab['message']));});});};exports['ShowMailQueue']=function(_0x2c3de1){var _0x905986=this;return new Promise(function(_0x4585ac,_0x2e41ea){return db[_0xce0d('0x1a')]['find']({'raw':_0x2c3de1['options']?_0x2c3de1[_0xce0d('0x1c')][_0xce0d('0x1d')]===undefined?!![]:![]:!![],'where':_0x2c3de1['options']?_0x2c3de1['options']['where']||null:null,'attributes':_0x2c3de1[_0xce0d('0x1c')]?_0x2c3de1['options']['attributes']||null:null,'include':_0x2c3de1['options']?_0x2c3de1[_0xce0d('0x1c')]['include']?_['map'](_0x2c3de1['options']['include'],function(_0x4b7645){return{'model':db[_0x4b7645['model']],'as':_0x4b7645['as'],'attributes':_0x4b7645[_0xce0d('0x1f')],'include':_0x4b7645[_0xce0d('0x21')]?_[_0xce0d('0x23')](_0x4b7645[_0xce0d('0x21')],function(_0x2dbd8e){return{'model':db[_0x2dbd8e[_0xce0d('0x22')]],'as':_0x2dbd8e['as'],'attributes':_0x2dbd8e[_0xce0d('0x1f')],'include':_0x2dbd8e[_0xce0d('0x21')]?_[_0xce0d('0x23')](_0x2dbd8e['include'],function(_0x3dc50e){return{'model':db[_0x3dc50e[_0xce0d('0x22')]],'as':_0x3dc50e['as'],'attributes':_0x3dc50e['attributes']};}):[]};}):[]};}):[]:[]})[_0xce0d('0xe')](function(_0x412ae0){logger['info']('ShowMailQueue',_0x2c3de1);logger[_0xce0d('0x12')](_0xce0d('0x25'),_0x2c3de1,JSON[_0xce0d('0x24')](_0x412ae0));_0x4585ac(_0x412ae0);})[_0xce0d('0x18')](function(_0x21fa1e){logger['error']('ShowMailQueue',_0x21fa1e[_0xce0d('0x16')],_0x2c3de1);_0x2e41ea(_0x905986[_0xce0d('0x14')](0x1f4,_0x21fa1e['message']));});});};
\ No newline at end of file
+var _0xd946=['code','message','info','result','catch','GetMailQueue','findAll','options','raw','where','attributes','include','map','model','MailQueue','ShowMailQueue','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1a6d6b,_0x1c5439){var _0x170bcd=function(_0x5df420){while(--_0x5df420){_0x1a6d6b['push'](_0x1a6d6b['shift']());}};_0x170bcd(++_0x1c5439);}(_0xd946,0x98));var _0x6d94=function(_0x27c620,_0x3b6af8){_0x27c620=_0x27c620-0x0;var _0x511cfb=_0xd946[_0x27c620];return _0x511cfb;};'use strict';var _=require(_0x6d94('0x0'));var util=require('util');var moment=require(_0x6d94('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0x6d94('0x2'))['db'];var utils=require(_0x6d94('0x3'));var logger=require(_0x6d94('0x4'))(_0x6d94('0x5'));var config=require(_0x6d94('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6d94('0x7')][_0x6d94('0x8')]({'port':0x232a});var socket=require('socket.io-emitter')({'host':'localhost','port':0x18eb});require('./mailQueue.socket')[_0x6d94('0x9')](socket);function respondWithRpcPromise(_0xaa68d,_0x1226f4,_0x20a958){return new BPromise(function(_0x58ecfe,_0x1108e6){return client[_0x6d94('0xa')](_0xaa68d,_0x20a958)[_0x6d94('0xb')](function(_0xa07149){logger['info'](_0x6d94('0xc'),_0x1226f4,_0x6d94('0xd'));logger[_0x6d94('0xe')](_0x6d94('0xf'),_0x1226f4,_0x6d94('0xd'),JSON[_0x6d94('0x10')](_0xa07149));if(_0xa07149[_0x6d94('0x11')]){if(_0xa07149[_0x6d94('0x11')][_0x6d94('0x12')]===0x1f4){logger[_0x6d94('0x11')]('MailQueue,\x20%s,\x20%s',_0x1226f4,_0xa07149[_0x6d94('0x11')][_0x6d94('0x13')]);return _0x1108e6(_0xa07149['error'][_0x6d94('0x13')]);}logger[_0x6d94('0x11')](_0x6d94('0xc'),_0x1226f4,_0xa07149[_0x6d94('0x11')][_0x6d94('0x13')]);return _0x58ecfe(_0xa07149[_0x6d94('0x11')][_0x6d94('0x13')]);}else{logger[_0x6d94('0x14')](_0x6d94('0xc'),_0x1226f4,_0x6d94('0xd'));_0x58ecfe(_0xa07149[_0x6d94('0x15')][_0x6d94('0x13')]);}})[_0x6d94('0x16')](function(_0xd57f23){logger['error'](_0x6d94('0xc'),_0x1226f4,_0xd57f23);_0x1108e6(_0xd57f23);});});}exports[_0x6d94('0x17')]=function(_0x26c2f2){var _0x4b8483=this;return new Promise(function(_0x4c2c47,_0x2f8c08){return db['MailQueue'][_0x6d94('0x18')]({'raw':_0x26c2f2[_0x6d94('0x19')]?_0x26c2f2[_0x6d94('0x19')][_0x6d94('0x1a')]===undefined?!![]:![]:!![],'where':_0x26c2f2['options']?_0x26c2f2['options'][_0x6d94('0x1b')]||null:null,'attributes':_0x26c2f2[_0x6d94('0x19')]?_0x26c2f2[_0x6d94('0x19')][_0x6d94('0x1c')]||null:null,'limit':_0x26c2f2[_0x6d94('0x19')]?_0x26c2f2[_0x6d94('0x19')]['limit']||null:null,'include':_0x26c2f2[_0x6d94('0x19')]?_0x26c2f2[_0x6d94('0x19')][_0x6d94('0x1d')]?_[_0x6d94('0x1e')](_0x26c2f2[_0x6d94('0x19')][_0x6d94('0x1d')],function(_0x495a58){return{'model':db[_0x495a58['model']],'as':_0x495a58['as'],'attributes':_0x495a58[_0x6d94('0x1c')],'include':_0x495a58[_0x6d94('0x1d')]?_[_0x6d94('0x1e')](_0x495a58[_0x6d94('0x1d')],function(_0x1c849a){return{'model':db[_0x1c849a['model']],'as':_0x1c849a['as'],'attributes':_0x1c849a[_0x6d94('0x1c')],'include':_0x1c849a[_0x6d94('0x1d')]?_[_0x6d94('0x1e')](_0x1c849a['include'],function(_0x442758){return{'model':db[_0x442758[_0x6d94('0x1f')]],'as':_0x442758['as'],'attributes':_0x442758[_0x6d94('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6d94('0xb')](function(_0x1c9c38){logger[_0x6d94('0x14')](_0x6d94('0x17'),_0x26c2f2);logger['debug'](_0x6d94('0x17'),_0x26c2f2,JSON[_0x6d94('0x10')](_0x1c9c38));_0x4c2c47(_0x1c9c38);})[_0x6d94('0x16')](function(_0x3a8077){logger[_0x6d94('0x11')](_0x6d94('0x17'),_0x3a8077[_0x6d94('0x13')],_0x26c2f2);_0x2f8c08(_0x4b8483[_0x6d94('0x11')](0x1f4,_0x3a8077[_0x6d94('0x13')]));});});};exports['ShowMailQueue']=function(_0x45f414){var _0x1ada0b=this;return new Promise(function(_0x4ef478,_0x493aef){return db[_0x6d94('0x20')]['find']({'raw':_0x45f414[_0x6d94('0x19')]?_0x45f414['options']['raw']===undefined?!![]:![]:!![],'where':_0x45f414[_0x6d94('0x19')]?_0x45f414[_0x6d94('0x19')][_0x6d94('0x1b')]||null:null,'attributes':_0x45f414[_0x6d94('0x19')]?_0x45f414[_0x6d94('0x19')][_0x6d94('0x1c')]||null:null,'include':_0x45f414['options']?_0x45f414['options']['include']?_[_0x6d94('0x1e')](_0x45f414['options'][_0x6d94('0x1d')],function(_0x234112){return{'model':db[_0x234112[_0x6d94('0x1f')]],'as':_0x234112['as'],'attributes':_0x234112[_0x6d94('0x1c')],'include':_0x234112[_0x6d94('0x1d')]?_[_0x6d94('0x1e')](_0x234112[_0x6d94('0x1d')],function(_0x8f3394){return{'model':db[_0x8f3394[_0x6d94('0x1f')]],'as':_0x8f3394['as'],'attributes':_0x8f3394[_0x6d94('0x1c')],'include':_0x8f3394['include']?_[_0x6d94('0x1e')](_0x8f3394[_0x6d94('0x1d')],function(_0x31c12e){return{'model':db[_0x31c12e[_0x6d94('0x1f')]],'as':_0x31c12e['as'],'attributes':_0x31c12e[_0x6d94('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6d94('0xb')](function(_0x1c7839){logger[_0x6d94('0x14')](_0x6d94('0x21'),_0x45f414);logger['debug'](_0x6d94('0x21'),_0x45f414,JSON[_0x6d94('0x10')](_0x1c7839));_0x4ef478(_0x1c7839);})['catch'](function(_0x35e622){logger[_0x6d94('0x11')](_0x6d94('0x21'),_0x35e622[_0x6d94('0x13')],_0x45f414);_0x493aef(_0x1ada0b[_0x6d94('0x11')](0x1f4,_0x35e622['message']));});});};
\ No newline at end of file
index ae27b18..32b4e1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79b5=['register','length','mailQueue:','save','remove','update','emit'];(function(_0x47de7b,_0x4257a8){var _0x483330=function(_0x4a7208){while(--_0x4a7208){_0x47de7b['push'](_0x47de7b['shift']());}};_0x483330(++_0x4257a8);}(_0x79b5,0xc7));var _0x579b=function(_0x4bdbf5,_0xba3c79){_0x4bdbf5=_0x4bdbf5-0x0;var _0x1ca6a5=_0x79b5[_0x4bdbf5];return _0x1ca6a5;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x579b('0x0'),_0x579b('0x1'),_0x579b('0x2')];function createListener(_0x3805b5,_0x33f11b){return function(_0x295b2a){_0x33f11b[_0x579b('0x3')](_0x3805b5,_0x295b2a);};}function removeListener(_0x317223,_0x53f1d5){return function(){MailQueueEvents['removeListener'](_0x317223,_0x53f1d5);};}exports[_0x579b('0x4')]=function(_0x4a9934){for(var _0x40f7f6=0x0,_0x5b284a=events[_0x579b('0x5')];_0x40f7f6<_0x5b284a;_0x40f7f6++){var _0x1135fe=events[_0x40f7f6];var _0x11e329=createListener(_0x579b('0x6')+_0x1135fe,_0x4a9934);MailQueueEvents['on'](_0x1135fe,_0x11e329);}};
\ No newline at end of file
+var _0xa96b=['save','remove','emit','register'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa96b,0x144));var _0xba96=function(_0x34407a,_0xbb88b5){_0x34407a=_0x34407a-0x0;var _0x3a40ee=_0xa96b[_0x34407a];return _0x3a40ee;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xba96('0x0'),_0xba96('0x1'),'update'];function createListener(_0xef49a6,_0x15b8ef){return function(_0x13c72){_0x15b8ef[_0xba96('0x2')](_0xef49a6,_0x13c72);};}function removeListener(_0x104387,_0xbf9a2a){return function(){MailQueueEvents['removeListener'](_0x104387,_0xbf9a2a);};}exports[_0xba96('0x3')]=function(_0x28f418){for(var _0x2a253c=0x0,_0x4aca5a=events['length'];_0x2a253c<_0x4aca5a;_0x2a253c++){var _0x14600a=events[_0x2a253c];var _0x2fb1f6=createListener('mailQueue:'+_0x14600a,_0x28f418);MailQueueEvents['on'](_0x14600a,_0x2fb1f6);}};
\ No newline at end of file
index 2a8fb53..da4b612 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2978=['index','/describe','/:id','post','create','update','delete','exports','multer','util','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated'];(function(_0x38db12,_0x1ae184){var _0x471ebe=function(_0x131a32){while(--_0x131a32){_0x38db12['push'](_0x38db12['shift']());}};_0x471ebe(++_0x1ae184);}(_0x2978,0xd8));var _0x8297=function(_0x18cc62,_0x581fb6){_0x18cc62=_0x18cc62-0x0;var _0x142a7c=_0x2978[_0x18cc62];return _0x142a7c;};'use strict';var multer=require(_0x8297('0x0'));var util=require(_0x8297('0x1'));var path=require('path');var express=require('express');var router=express['Router']();var auth=require(_0x8297('0x2'));var interaction=require(_0x8297('0x3'));var config=require(_0x8297('0x4'));var controller=require(_0x8297('0x5'));router[_0x8297('0x6')]('/',auth[_0x8297('0x7')](),controller[_0x8297('0x8')]);router['get'](_0x8297('0x9'),auth[_0x8297('0x7')](),controller['describe']);router['get'](_0x8297('0xa'),auth[_0x8297('0x7')](),controller['show']);router[_0x8297('0xb')]('/',auth['isAuthenticated'](),controller[_0x8297('0xc')]);router['put'](_0x8297('0xa'),auth['isAuthenticated'](),controller[_0x8297('0xd')]);router[_0x8297('0xe')](_0x8297('0xa'),auth[_0x8297('0x7')](),controller['destroy']);module[_0x8297('0xf')]=router;
\ No newline at end of file
+var _0xcd79=['../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x199aaa,_0x59957e){var _0x387db2=function(_0x54fd1b){while(--_0x54fd1b){_0x199aaa['push'](_0x199aaa['shift']());}};_0x387db2(++_0x59957e);}(_0xcd79,0x1f3));var _0x9cd7=function(_0x5b3c82,_0x289954){_0x5b3c82=_0x5b3c82-0x0;var _0x161c8d=_0xcd79[_0x5b3c82];return _0x161c8d;};'use strict';var multer=require(_0x9cd7('0x0'));var util=require(_0x9cd7('0x1'));var path=require(_0x9cd7('0x2'));var express=require(_0x9cd7('0x3'));var router=express[_0x9cd7('0x4')]();var auth=require(_0x9cd7('0x5'));var interaction=require(_0x9cd7('0x6'));var config=require('../../config/environment');var controller=require(_0x9cd7('0x7'));router[_0x9cd7('0x8')]('/',auth[_0x9cd7('0x9')](),controller[_0x9cd7('0xa')]);router[_0x9cd7('0x8')]('/describe',auth[_0x9cd7('0x9')](),controller['describe']);router[_0x9cd7('0x8')](_0x9cd7('0xb'),auth['isAuthenticated'](),controller[_0x9cd7('0xc')]);router[_0x9cd7('0xd')]('/',auth[_0x9cd7('0x9')](),controller['create']);router[_0x9cd7('0xe')]('/:id',auth[_0x9cd7('0x9')](),controller['update']);router[_0x9cd7('0xf')]('/:id',auth[_0x9cd7('0x9')](),controller[_0x9cd7('0x10')]);module[_0x9cd7('0x11')]=router;
\ No newline at end of file
index 422a52c..2712ff3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f80=['moment','sequelize','DATE','STRING'];(function(_0x2272b5,_0x362458){var _0x110156=function(_0x5c2e32){while(--_0x5c2e32){_0x2272b5['push'](_0x2272b5['shift']());}};_0x110156(++_0x362458);}(_0x5f80,0x1d0));var _0x05f8=function(_0xee9c37,_0x539904){_0xee9c37=_0xee9c37-0x0;var _0x2b8bbc=_0x5f80[_0xee9c37];return _0x2b8bbc;};'use strict';var moment=require(_0x05f8('0x0'));var Sequelize=require(_0x05f8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x05f8('0x2')]},'leaveAt':{'type':Sequelize[_0x05f8('0x2')]},'acceptAt':{'type':Sequelize[_0x05f8('0x2')]},'exitAt':{'type':Sequelize[_0x05f8('0x2')]},'reason':{'type':Sequelize[_0x05f8('0x3')]}};
\ No newline at end of file
+var _0x525c=['DATE','sequelize','exports','STRING'];(function(_0xd5126e,_0x120745){var _0x2894f6=function(_0x2c2316){while(--_0x2c2316){_0xd5126e['push'](_0xd5126e['shift']());}};_0x2894f6(++_0x120745);}(_0x525c,0x1e1));var _0xc525=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x525c[_0x468b0f];return _0x3e74d9;};'use strict';var moment=require('moment');var Sequelize=require(_0xc525('0x0'));module[_0xc525('0x1')]={'uniqueid':{'type':Sequelize[_0xc525('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc525('0x2')]},'joinAt':{'type':Sequelize[_0xc525('0x3')]},'leaveAt':{'type':Sequelize[_0xc525('0x3')]},'acceptAt':{'type':Sequelize[_0xc525('0x3')]},'exitAt':{'type':Sequelize[_0xc525('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index d72bed1..3e326f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x375a=['filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','day','merge','filter','map','options','includeAll','include','MailQueueReport','findAll','show','params','intersection','catch','create','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','update','destroy','then','stack','name','send','index','rawAttributes','model','query','dateStart','dateEnd','keys'];(function(_0x4130e3,_0x1b0cdf){var _0xfe83a9=function(_0xbc59dd){while(--_0xbc59dd){_0x4130e3['push'](_0x4130e3['shift']());}};_0xfe83a9(++_0x1b0cdf);}(_0x375a,0x1c5));var _0xa375=function(_0x4f5352,_0x59ebc1){_0x4f5352=_0x4f5352-0x0;var _0x23e0ad=_0x375a[_0x4f5352];return _0x23e0ad;};'use strict';var pdf=require(_0xa375('0x0'));var emlformat=require(_0xa375('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa375('0x2'));var jsonpatch=require(_0xa375('0x3'));var rp=require(_0xa375('0x4'));var moment=require('moment');var BPromise=require(_0xa375('0x5'));var Mustache=require('mustache');var util=require(_0xa375('0x6'));var path=require('path');var sox=require(_0xa375('0x7'));var csv=require(_0xa375('0x8'));var ejs=require(_0xa375('0x9'));var fs=require('fs');var _=require(_0xa375('0xa'));var squel=require(_0xa375('0xb'));var crypto=require(_0xa375('0xc'));var jsforce=require(_0xa375('0xd'));var deskjs=require(_0xa375('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa375('0xf'));var Papa=require(_0xa375('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xa375('0x11'))(_0xa375('0x12'));var utils=require(_0xa375('0x13'));var config=require(_0xa375('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50610d,_0x4c85cc){_0x4c85cc=_0x4c85cc||0xcc;return function(_0x3644e8){if(_0x3644e8){return _0x50610d[_0xa375('0x15')](_0x4c85cc);}return _0x50610d[_0xa375('0x16')](_0x4c85cc)[_0xa375('0x17')]();};}function respondWithResult(_0x555919,_0x56d7ce){_0x56d7ce=_0x56d7ce||0xc8;return function(_0x141952){if(_0x141952){return _0x555919[_0xa375('0x16')](_0x56d7ce)['json'](_0x141952);}};}function respondWithFilteredResult(_0x4ba261,_0x14d82d){return function(_0x58086f){if(_0x58086f){var _0x4b93fb=_0x58086f[_0xa375('0x18')],_0x10e645=_0x14d82d[_0xa375('0x19')],_0x38b8b1=_0x14d82d[_0xa375('0x19')]+_0x14d82d['limit'],_0x32b8eb;if(_0x38b8b1>=_0x4b93fb){_0x38b8b1=_0x4b93fb;_0x32b8eb=0xc8;}else{_0x32b8eb=0xce;}_0x4ba261[_0xa375('0x16')](_0x32b8eb);return _0x4ba261[_0xa375('0x1a')](_0xa375('0x1b'),_0x10e645+'-'+_0x38b8b1+'/'+_0x4b93fb)[_0xa375('0x1c')](_0x58086f);}return null;};}function patchUpdates(_0x499d83){return function(_0x1964ad){try{jsonpatch[_0xa375('0x1d')](_0x1964ad,_0x499d83,!![]);}catch(_0x2802fe){return BPromise[_0xa375('0x1e')](_0x2802fe);}return _0x1964ad['save']();};}function saveUpdates(_0x349f59,_0x997054){return function(_0x4b9a45){if(_0x4b9a45){return _0x4b9a45[_0xa375('0x1f')](_0x349f59)['then'](function(_0xd2f575){return _0xd2f575;});}return null;};}function removeEntity(_0x5abeaa,_0x267182){return function(_0x6ac9a9){if(_0x6ac9a9){return _0x6ac9a9[_0xa375('0x20')]()[_0xa375('0x21')](function(){_0x5abeaa['status'](0xcc)[_0xa375('0x17')]();});}};}function handleEntityNotFound(_0x5167f8,_0x271388){return function(_0x3d0091){if(!_0x3d0091){_0x5167f8['sendStatus'](0x194);}return _0x3d0091;};}function handleError(_0x2c95c6,_0x21ab46){_0x21ab46=_0x21ab46||0x1f4;return function(_0x1a9f12){logger['error'](_0x1a9f12[_0xa375('0x22')]);if(_0x1a9f12[_0xa375('0x23')]){delete _0x1a9f12[_0xa375('0x23')];}_0x2c95c6[_0xa375('0x16')](_0x21ab46)[_0xa375('0x24')](_0x1a9f12);};}exports[_0xa375('0x25')]=function(_0x37aa98,_0x5d4ba2){var _0x2474e4={},_0x2af4e8={},_0x135921={'count':0x0,'rows':[]};var _0x385113=db['MailQueueReport'][_0xa375('0x26')];_0x2af4e8[_0xa375('0x27')]=_['keys'](_0x385113);var _0x3f6fb4={'dateStart':_0x37aa98[_0xa375('0x28')][_0xa375('0x29')],'dateEnd':_0x37aa98[_0xa375('0x28')][_0xa375('0x2a')]};delete _0x37aa98[_0xa375('0x28')][_0xa375('0x29')];delete _0x37aa98[_0xa375('0x28')][_0xa375('0x2a')];_0x2af4e8[_0xa375('0x28')]=_[_0xa375('0x2b')](_0x37aa98[_0xa375('0x28')]);_0x2af4e8[_0xa375('0x2c')]=_['intersection'](_0x2af4e8[_0xa375('0x27')],_0x2af4e8[_0xa375('0x28')]);_0x2474e4[_0xa375('0x2d')]=_['intersection'](_0x2af4e8[_0xa375('0x27')],qs[_0xa375('0x2e')](_0x37aa98[_0xa375('0x28')][_0xa375('0x2e')]));_0x2474e4[_0xa375('0x2d')]=_0x2474e4[_0xa375('0x2d')][_0xa375('0x2f')]?_0x2474e4[_0xa375('0x2d')]:_0x2af4e8[_0xa375('0x27')];if(!_0x37aa98[_0xa375('0x28')][_0xa375('0x30')](_0xa375('0x31'))){_0x2474e4[_0xa375('0x32')]=qs[_0xa375('0x32')](_0x37aa98[_0xa375('0x28')][_0xa375('0x32')]);_0x2474e4[_0xa375('0x19')]=qs[_0xa375('0x19')](_0x37aa98[_0xa375('0x28')][_0xa375('0x19')]);}_0x2474e4[_0xa375('0x33')]=qs[_0xa375('0x34')](_0x37aa98[_0xa375('0x28')][_0xa375('0x34')]);_0x2474e4[_0xa375('0x35')]=qs[_0xa375('0x2c')](_['pick'](_0x37aa98[_0xa375('0x28')],_0x2af4e8[_0xa375('0x2c')]));if(_0x3f6fb4['dateStart']){if(_0x3f6fb4[_0xa375('0x2a')]){_0x3f6fb4[_0xa375('0x2a')]=moment(_0x3f6fb4[_0xa375('0x2a')])['add'](0x1,_0xa375('0x36'));}else{_0x3f6fb4[_0xa375('0x2a')]=moment(_0x3f6fb4[_0xa375('0x29')])['add'](0x1,'day');}_[_0xa375('0x37')](_0x2474e4[_0xa375('0x35')],{'createdAt':{'$gte':_0x3f6fb4[_0xa375('0x29')],'$lte':_0x3f6fb4['dateEnd']}});}if(_0x37aa98[_0xa375('0x28')][_0xa375('0x38')]){_0x2474e4['where']=_[_0xa375('0x37')](_0x2474e4[_0xa375('0x35')],{'$or':_[_0xa375('0x39')](_0x2474e4[_0xa375('0x2d')],function(_0x5b4f3a){var _0x9e2e9b={};_0x9e2e9b[_0x5b4f3a]={'$like':'%'+_0x37aa98[_0xa375('0x28')]['filter']+'%'};return _0x9e2e9b;})});}_0x2474e4=_[_0xa375('0x37')]({},_0x2474e4,_0x37aa98[_0xa375('0x3a')]);var _0x4c5a54={'where':_0x2474e4[_0xa375('0x35')]};return db['MailQueueReport'][_0xa375('0x18')](_0x4c5a54)[_0xa375('0x21')](function(_0x5bb033){_0x135921[_0xa375('0x18')]=_0x5bb033;if(_0x37aa98[_0xa375('0x28')][_0xa375('0x3b')]){_0x2474e4[_0xa375('0x3c')]=[{'all':!![]}];}return db[_0xa375('0x3d')][_0xa375('0x3e')](_0x2474e4);})[_0xa375('0x21')](function(_0x21bc3a){_0x135921['rows']=_0x21bc3a;return _0x135921;})[_0xa375('0x21')](respondWithFilteredResult(_0x5d4ba2,_0x2474e4))['catch'](handleError(_0x5d4ba2,null));};exports[_0xa375('0x3f')]=function(_0x299c1d,_0x17771a){var _0x3fab60={'raw':!![],'where':{'id':_0x299c1d[_0xa375('0x40')]['id']}},_0x22fb50={};_0x22fb50[_0xa375('0x27')]=_[_0xa375('0x2b')](db[_0xa375('0x3d')][_0xa375('0x26')]);_0x22fb50[_0xa375('0x28')]=_[_0xa375('0x2b')](_0x299c1d['query']);_0x22fb50['filters']=_[_0xa375('0x41')](_0x22fb50[_0xa375('0x27')],_0x22fb50[_0xa375('0x28')]);_0x3fab60[_0xa375('0x2d')]=_['intersection'](_0x22fb50[_0xa375('0x27')],qs[_0xa375('0x2e')](_0x299c1d[_0xa375('0x28')]['fields']));_0x3fab60[_0xa375('0x2d')]=_0x3fab60[_0xa375('0x2d')][_0xa375('0x2f')]?_0x3fab60[_0xa375('0x2d')]:_0x22fb50['model'];if(_0x299c1d[_0xa375('0x28')][_0xa375('0x3b')]){_0x3fab60['include']=[{'all':!![]}];}_0x3fab60=_[_0xa375('0x37')]({},_0x3fab60,_0x299c1d[_0xa375('0x3a')]);return db[_0xa375('0x3d')]['find'](_0x3fab60)['then'](handleEntityNotFound(_0x17771a,null))['then'](respondWithResult(_0x17771a,null))[_0xa375('0x42')](handleError(_0x17771a,null));};exports[_0xa375('0x43')]=function(_0x1d053e,_0x559f9f){return db['MailQueueReport']['create'](_0x1d053e['body'],{})['then'](respondWithResult(_0x559f9f,0xc9))[_0xa375('0x42')](handleError(_0x559f9f,null));};exports[_0xa375('0x1f')]=function(_0x3fc573,_0x5bf96e){if(_0x3fc573[_0xa375('0x44')]['id']){delete _0x3fc573['body']['id'];}return db[_0xa375('0x3d')]['find']({'where':{'id':_0x3fc573[_0xa375('0x40')]['id']}})['then'](handleEntityNotFound(_0x5bf96e,null))[_0xa375('0x21')](saveUpdates(_0x3fc573[_0xa375('0x44')],null))[_0xa375('0x21')](respondWithResult(_0x5bf96e,null))['catch'](handleError(_0x5bf96e,null));};exports[_0xa375('0x20')]=function(_0x225489,_0x4e442b){return db[_0xa375('0x3d')][_0xa375('0x45')]({'where':{'id':_0x225489[_0xa375('0x40')]['id']}})[_0xa375('0x21')](handleEntityNotFound(_0x4e442b,null))['then'](removeEntity(_0x4e442b,null))[_0xa375('0x42')](handleError(_0x4e442b,null));};exports[_0xa375('0x46')]=function(_0x201c0f,_0x5687e7){return db['MailQueueReport'][_0xa375('0x46')]()['then'](respondWithResult(_0x5687e7,null))[_0xa375('0x42')](handleError(_0x5687e7,null));};
\ No newline at end of file
+var _0xa0bd=['sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','MailQueueReport','model','keys','query','dateEnd','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','add','day','dateStart','merge','map','filter','options','findAll','rows','params','rawAttributes','intersection','include','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x45de78,_0x55d118){var _0x4e223c=function(_0x1b71da){while(--_0x1b71da){_0x45de78['push'](_0x45de78['shift']());}};_0x4e223c(++_0x55d118);}(_0xa0bd,0x7b));var _0xda0b=function(_0x53c49e,_0x16a153){_0x53c49e=_0x53c49e-0x0;var _0x245241=_0xa0bd[_0x53c49e];return _0x245241;};'use strict';var pdf=require(_0xda0b('0x0'));var emlformat=require(_0xda0b('0x1'));var rimraf=require(_0xda0b('0x2'));var zipdir=require(_0xda0b('0x3'));var jsonpatch=require(_0xda0b('0x4'));var rp=require(_0xda0b('0x5'));var moment=require(_0xda0b('0x6'));var BPromise=require(_0xda0b('0x7'));var Mustache=require(_0xda0b('0x8'));var util=require(_0xda0b('0x9'));var path=require(_0xda0b('0xa'));var sox=require(_0xda0b('0xb'));var csv=require(_0xda0b('0xc'));var ejs=require(_0xda0b('0xd'));var fs=require('fs');var _=require(_0xda0b('0xe'));var squel=require(_0xda0b('0xf'));var crypto=require(_0xda0b('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xda0b('0x11'));var toCsv=require(_0xda0b('0xc'));var querystring=require(_0xda0b('0x12'));var Papa=require(_0xda0b('0x13'));var qs=require(_0xda0b('0x14'));var logger=require(_0xda0b('0x15'))(_0xda0b('0x16'));var utils=require(_0xda0b('0x17'));var config=require('../../config/environment');var db=require(_0xda0b('0x18'))['db'];function respondWithStatusCode(_0x1e38ea,_0x1d8273){_0x1d8273=_0x1d8273||0xcc;return function(_0x2499d2){if(_0x2499d2){return _0x1e38ea[_0xda0b('0x19')](_0x1d8273);}return _0x1e38ea[_0xda0b('0x1a')](_0x1d8273)[_0xda0b('0x1b')]();};}function respondWithResult(_0x5bd746,_0x16acfd){_0x16acfd=_0x16acfd||0xc8;return function(_0x178711){if(_0x178711){return _0x5bd746[_0xda0b('0x1a')](_0x16acfd)[_0xda0b('0x1c')](_0x178711);}};}function respondWithFilteredResult(_0x12dcd0,_0x5ae254){return function(_0x176022){if(_0x176022){var _0x40a0f0=_0x176022[_0xda0b('0x1d')],_0xad1de4=_0x5ae254[_0xda0b('0x1e')],_0x474842=_0x5ae254[_0xda0b('0x1e')]+_0x5ae254[_0xda0b('0x1f')],_0x247d79;if(_0x474842>=_0x40a0f0){_0x474842=_0x40a0f0;_0x247d79=0xc8;}else{_0x247d79=0xce;}_0x12dcd0[_0xda0b('0x1a')](_0x247d79);return _0x12dcd0[_0xda0b('0x20')](_0xda0b('0x21'),_0xad1de4+'-'+_0x474842+'/'+_0x40a0f0)[_0xda0b('0x1c')](_0x176022);}return null;};}function patchUpdates(_0x1686c6){return function(_0xc27a6a){try{jsonpatch[_0xda0b('0x22')](_0xc27a6a,_0x1686c6,!![]);}catch(_0x1fd0b2){return BPromise[_0xda0b('0x23')](_0x1fd0b2);}return _0xc27a6a[_0xda0b('0x24')]();};}function saveUpdates(_0x380161,_0x10b645){return function(_0x36b408){if(_0x36b408){return _0x36b408[_0xda0b('0x25')](_0x380161)[_0xda0b('0x26')](function(_0x12949c){return _0x12949c;});}return null;};}function removeEntity(_0x5a0c1a,_0x4ae364){return function(_0x493cf9){if(_0x493cf9){return _0x493cf9[_0xda0b('0x27')]()['then'](function(){_0x5a0c1a[_0xda0b('0x1a')](0xcc)[_0xda0b('0x1b')]();});}};}function handleEntityNotFound(_0x331075,_0x5357dc){return function(_0x17f0a5){if(!_0x17f0a5){_0x331075[_0xda0b('0x19')](0x194);}return _0x17f0a5;};}function handleError(_0xe19e7a,_0x239daa){_0x239daa=_0x239daa||0x1f4;return function(_0x3275b7){logger['error'](_0x3275b7[_0xda0b('0x28')]);if(_0x3275b7[_0xda0b('0x29')]){delete _0x3275b7[_0xda0b('0x29')];}_0xe19e7a[_0xda0b('0x1a')](_0x239daa)[_0xda0b('0x2a')](_0x3275b7);};}exports[_0xda0b('0x2b')]=function(_0x19df8e,_0x1c860f){var _0x53e3c0={},_0x36e236={},_0x4e3dd2={'count':0x0,'rows':[]};var _0x40ba86=db[_0xda0b('0x2c')]['rawAttributes'];_0x36e236[_0xda0b('0x2d')]=_[_0xda0b('0x2e')](_0x40ba86);var _0x4a8c30={'dateStart':_0x19df8e[_0xda0b('0x2f')]['dateStart'],'dateEnd':_0x19df8e[_0xda0b('0x2f')][_0xda0b('0x30')]};delete _0x19df8e[_0xda0b('0x2f')]['dateStart'];delete _0x19df8e[_0xda0b('0x2f')]['dateEnd'];_0x36e236[_0xda0b('0x2f')]=_['keys'](_0x19df8e['query']);_0x36e236[_0xda0b('0x31')]=_['intersection'](_0x36e236[_0xda0b('0x2d')],_0x36e236['query']);_0x53e3c0[_0xda0b('0x32')]=_['intersection'](_0x36e236['model'],qs[_0xda0b('0x33')](_0x19df8e[_0xda0b('0x2f')][_0xda0b('0x33')]));_0x53e3c0[_0xda0b('0x32')]=_0x53e3c0[_0xda0b('0x32')][_0xda0b('0x34')]?_0x53e3c0['attributes']:_0x36e236[_0xda0b('0x2d')];if(!_0x19df8e['query'][_0xda0b('0x35')]('nolimit')){_0x53e3c0[_0xda0b('0x1f')]=qs[_0xda0b('0x1f')](_0x19df8e[_0xda0b('0x2f')][_0xda0b('0x1f')]);_0x53e3c0[_0xda0b('0x1e')]=qs[_0xda0b('0x1e')](_0x19df8e['query']['offset']);}_0x53e3c0['order']=qs['sort'](_0x19df8e[_0xda0b('0x2f')][_0xda0b('0x36')]);_0x53e3c0[_0xda0b('0x37')]=qs['filters'](_[_0xda0b('0x38')](_0x19df8e['query'],_0x36e236['filters']));if(_0x4a8c30['dateStart']){if(_0x4a8c30[_0xda0b('0x30')]){_0x4a8c30['dateEnd']=moment(_0x4a8c30['dateEnd'])[_0xda0b('0x39')](0x1,_0xda0b('0x3a'));}else{_0x4a8c30[_0xda0b('0x30')]=moment(_0x4a8c30[_0xda0b('0x3b')])[_0xda0b('0x39')](0x1,'day');}_['merge'](_0x53e3c0[_0xda0b('0x37')],{'createdAt':{'$gte':_0x4a8c30['dateStart'],'$lte':_0x4a8c30[_0xda0b('0x30')]}});}if(_0x19df8e[_0xda0b('0x2f')]['filter']){_0x53e3c0[_0xda0b('0x37')]=_[_0xda0b('0x3c')](_0x53e3c0[_0xda0b('0x37')],{'$or':_[_0xda0b('0x3d')](_0x53e3c0[_0xda0b('0x32')],function(_0x30fd72){var _0x412b36={};_0x412b36[_0x30fd72]={'$like':'%'+_0x19df8e[_0xda0b('0x2f')][_0xda0b('0x3e')]+'%'};return _0x412b36;})});}_0x53e3c0=_[_0xda0b('0x3c')]({},_0x53e3c0,_0x19df8e[_0xda0b('0x3f')]);var _0x3c02e4={'where':_0x53e3c0['where']};return db[_0xda0b('0x2c')][_0xda0b('0x1d')](_0x3c02e4)[_0xda0b('0x26')](function(_0x28edf0){_0x4e3dd2[_0xda0b('0x1d')]=_0x28edf0;if(_0x19df8e[_0xda0b('0x2f')]['includeAll']){_0x53e3c0['include']=[{'all':!![]}];}return db[_0xda0b('0x2c')][_0xda0b('0x40')](_0x53e3c0);})['then'](function(_0x1be7c8){_0x4e3dd2[_0xda0b('0x41')]=_0x1be7c8;return _0x4e3dd2;})['then'](respondWithFilteredResult(_0x1c860f,_0x53e3c0))['catch'](handleError(_0x1c860f,null));};exports['show']=function(_0x33b183,_0x488cdb){var _0x4fec8e={'raw':!![],'where':{'id':_0x33b183[_0xda0b('0x42')]['id']}},_0x3951a3={};_0x3951a3[_0xda0b('0x2d')]=_[_0xda0b('0x2e')](db[_0xda0b('0x2c')][_0xda0b('0x43')]);_0x3951a3[_0xda0b('0x2f')]=_['keys'](_0x33b183['query']);_0x3951a3[_0xda0b('0x31')]=_[_0xda0b('0x44')](_0x3951a3['model'],_0x3951a3['query']);_0x4fec8e[_0xda0b('0x32')]=_['intersection'](_0x3951a3['model'],qs[_0xda0b('0x33')](_0x33b183[_0xda0b('0x2f')]['fields']));_0x4fec8e[_0xda0b('0x32')]=_0x4fec8e['attributes']['length']?_0x4fec8e[_0xda0b('0x32')]:_0x3951a3['model'];if(_0x33b183[_0xda0b('0x2f')]['includeAll']){_0x4fec8e[_0xda0b('0x45')]=[{'all':!![]}];}_0x4fec8e=_['merge']({},_0x4fec8e,_0x33b183[_0xda0b('0x3f')]);return db[_0xda0b('0x2c')][_0xda0b('0x46')](_0x4fec8e)[_0xda0b('0x26')](handleEntityNotFound(_0x488cdb,null))[_0xda0b('0x26')](respondWithResult(_0x488cdb,null))[_0xda0b('0x47')](handleError(_0x488cdb,null));};exports[_0xda0b('0x48')]=function(_0xccdfa5,_0xa47bd3){return db['MailQueueReport']['create'](_0xccdfa5[_0xda0b('0x49')],{})[_0xda0b('0x26')](respondWithResult(_0xa47bd3,0xc9))['catch'](handleError(_0xa47bd3,null));};exports[_0xda0b('0x25')]=function(_0x5a2192,_0x2094bd){if(_0x5a2192[_0xda0b('0x49')]['id']){delete _0x5a2192[_0xda0b('0x49')]['id'];}return db['MailQueueReport'][_0xda0b('0x46')]({'where':{'id':_0x5a2192['params']['id']}})['then'](handleEntityNotFound(_0x2094bd,null))[_0xda0b('0x26')](saveUpdates(_0x5a2192[_0xda0b('0x49')],null))[_0xda0b('0x26')](respondWithResult(_0x2094bd,null))[_0xda0b('0x47')](handleError(_0x2094bd,null));};exports[_0xda0b('0x27')]=function(_0x396796,_0x160694){return db[_0xda0b('0x2c')][_0xda0b('0x46')]({'where':{'id':_0x396796[_0xda0b('0x42')]['id']}})['then'](handleEntityNotFound(_0x160694,null))[_0xda0b('0x26')](removeEntity(_0x160694,null))['catch'](handleError(_0x160694,null));};exports['describe']=function(_0x529319,_0x56962b){return db[_0xda0b('0x2c')]['describe']()[_0xda0b('0x26')](respondWithResult(_0x56962b,null))['catch'](handleError(_0x56962b,null));};
\ No newline at end of file
index d9b08fa..bb38de3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9986=['util','../../config/logger','api','bluebird','request-promise','./mailQueueReport.attributes','define','report_mail_queue','uniqueid','lodash'];(function(_0x2bfbc7,_0x505829){var _0x20fa3e=function(_0x3cf72a){while(--_0x3cf72a){_0x2bfbc7['push'](_0x2bfbc7['shift']());}};_0x20fa3e(++_0x505829);}(_0x9986,0x153));var _0x6998=function(_0x3bad79,_0x3f547e){_0x3bad79=_0x3bad79-0x0;var _0x5bac97=_0x9986[_0x3bad79];return _0x5bac97;};'use strict';var _=require(_0x6998('0x0'));var util=require(_0x6998('0x1'));var logger=require(_0x6998('0x2'))(_0x6998('0x3'));var moment=require('moment');var BPromise=require(_0x6998('0x4'));var rp=require(_0x6998('0x5'));var attributes=require(_0x6998('0x6'));module['exports']=function(_0x505b1c,_0x9ca01e){return _0x505b1c[_0x6998('0x7')]('MailQueueReport',attributes,{'tableName':_0x6998('0x8'),'paranoid':![],'indexes':[{'name':_0x6998('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7035=['define','report_mail_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','./mailQueueReport.attributes','exports'];(function(_0x2571af,_0x487b70){var _0x115a0c=function(_0x138839){while(--_0x138839){_0x2571af['push'](_0x2571af['shift']());}};_0x115a0c(++_0x487b70);}(_0x7035,0x1bb));var _0x5703=function(_0x51a5f3,_0x2df425){_0x51a5f3=_0x51a5f3-0x0;var _0x4224e9=_0x7035[_0x51a5f3];return _0x4224e9;};'use strict';var _=require(_0x5703('0x0'));var util=require(_0x5703('0x1'));var logger=require(_0x5703('0x2'))('api');var moment=require(_0x5703('0x3'));var BPromise=require(_0x5703('0x4'));var rp=require(_0x5703('0x5'));var attributes=require(_0x5703('0x6'));module[_0x5703('0x7')]=function(_0x27541e,_0x373d20){return _0x27541e[_0x5703('0x8')]('MailQueueReport',attributes,{'tableName':_0x5703('0x9'),'paranoid':![],'indexes':[{'name':_0x5703('0xa'),'fields':[_0x5703('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 0ee3540..7897b0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a01=['MailQueueReport,\x20%s,\x20%s','request\x20sent','code','message','error','result','catch','CreateMailQueueReport','MailQueueReport','body','raw','stringify','update','options','where','attributes','limit','UpdateMailQueueReport','debug','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x1da1e1,_0x153851){var _0x1ee591=function(_0x3bdfb4){while(--_0x3bdfb4){_0x1da1e1['push'](_0x1da1e1['shift']());}};_0x1ee591(++_0x153851);}(_0x7a01,0xd3));var _0x17a0=function(_0x1a7538,_0x123089){_0x1a7538=_0x1a7538-0x0;var _0x45fb6f=_0x7a01[_0x1a7538];return _0x45fb6f;};'use strict';var _=require(_0x17a0('0x0'));var util=require(_0x17a0('0x1'));var moment=require('moment');var BPromise=require(_0x17a0('0x2'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x17a0('0x3'))['db'];var utils=require(_0x17a0('0x4'));var logger=require(_0x17a0('0x5'))(_0x17a0('0x6'));var config=require(_0x17a0('0x7'));var jayson=require(_0x17a0('0x8'));var client=jayson[_0x17a0('0x9')][_0x17a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a8b5f,_0x31288b,_0x22d5e1){return new BPromise(function(_0x522f76,_0x5309ed){return client['request'](_0x2a8b5f,_0x22d5e1)[_0x17a0('0xb')](function(_0x5ac5e5){logger[_0x17a0('0xc')](_0x17a0('0xd'),_0x31288b,_0x17a0('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x31288b,_0x17a0('0xe'),JSON['stringify'](_0x5ac5e5));if(_0x5ac5e5['error']){if(_0x5ac5e5['error'][_0x17a0('0xf')]===0x1f4){logger['error'](_0x17a0('0xd'),_0x31288b,_0x5ac5e5['error'][_0x17a0('0x10')]);return _0x5309ed(_0x5ac5e5[_0x17a0('0x11')][_0x17a0('0x10')]);}logger['error'](_0x17a0('0xd'),_0x31288b,_0x5ac5e5[_0x17a0('0x11')]['message']);return _0x522f76(_0x5ac5e5[_0x17a0('0x11')][_0x17a0('0x10')]);}else{logger[_0x17a0('0xc')](_0x17a0('0xd'),_0x31288b,_0x17a0('0xe'));_0x522f76(_0x5ac5e5[_0x17a0('0x12')][_0x17a0('0x10')]);}})[_0x17a0('0x13')](function(_0x4052d3){logger['error'](_0x17a0('0xd'),_0x31288b,_0x4052d3);_0x5309ed(_0x4052d3);});});}exports[_0x17a0('0x14')]=function(_0x181d3f){var _0x12b733=this;return new Promise(function(_0x188d70,_0x28a5af){return db[_0x17a0('0x15')]['create'](_0x181d3f[_0x17a0('0x16')],{'raw':_0x181d3f['options']?_0x181d3f['options'][_0x17a0('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x5163de){logger['info'](_0x17a0('0x14'),_0x181d3f);logger['debug']('CreateMailQueueReport',_0x181d3f,JSON[_0x17a0('0x18')](_0x5163de));_0x188d70(_0x5163de);})['catch'](function(_0x4a3c4e){logger[_0x17a0('0x11')](_0x17a0('0x14'),_0x4a3c4e['message'],_0x181d3f);_0x28a5af(_0x12b733[_0x17a0('0x11')](0x1f4,_0x4a3c4e[_0x17a0('0x10')]));});});};exports['UpdateMailQueueReport']=function(_0x232650){var _0x50a458=this;return new Promise(function(_0x3b926b,_0x36fdb5){return db[_0x17a0('0x15')][_0x17a0('0x19')](_0x232650[_0x17a0('0x16')],{'raw':_0x232650[_0x17a0('0x1a')]?_0x232650[_0x17a0('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x232650[_0x17a0('0x1a')]?_0x232650[_0x17a0('0x1a')][_0x17a0('0x1b')]||null:null,'attributes':_0x232650[_0x17a0('0x1a')]?_0x232650['options'][_0x17a0('0x1c')]||null:null,'limit':_0x232650['options']?_0x232650[_0x17a0('0x1a')][_0x17a0('0x1d')]||null:null})['then'](function(_0x2312d2){logger['info'](_0x17a0('0x1e'),_0x232650);logger[_0x17a0('0x1f')](_0x17a0('0x1e'),_0x232650,JSON[_0x17a0('0x18')](_0x2312d2));_0x3b926b(_0x2312d2);})[_0x17a0('0x13')](function(_0x9f9952){logger[_0x17a0('0x11')](_0x17a0('0x1e'),_0x9f9952['message'],_0x232650);_0x36fdb5(_0x50a458[_0x17a0('0x11')](0x1f4,_0x9f9952[_0x17a0('0x10')]));});});};
\ No newline at end of file
+var _0x58ad=['stringify','error','code','message','result','CreateMailQueueReport','MailQueueReport','create','options','raw','update','where','attributes','limit','UpdateMailQueueReport','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x58ad,0x139));var _0xd58a=function(_0x14cbbe,_0x1dc460){_0x14cbbe=_0x14cbbe-0x0;var _0x5a7e35=_0x58ad[_0x14cbbe];return _0x5a7e35;};'use strict';var _=require('lodash');var util=require(_0xd58a('0x0'));var moment=require(_0xd58a('0x1'));var BPromise=require('bluebird');var rs=require(_0xd58a('0x2'));var fs=require('fs');var db=require(_0xd58a('0x3'))['db'];var utils=require(_0xd58a('0x4'));var logger=require(_0xd58a('0x5'))(_0xd58a('0x6'));var config=require(_0xd58a('0x7'));var jayson=require(_0xd58a('0x8'));var client=jayson[_0xd58a('0x9')][_0xd58a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b4063,_0x3501f7,_0x2ec99a){return new BPromise(function(_0x361ea7,_0x5f4908){return client[_0xd58a('0xb')](_0x2b4063,_0x2ec99a)[_0xd58a('0xc')](function(_0x4b09a7){logger[_0xd58a('0xd')](_0xd58a('0xe'),_0x3501f7,_0xd58a('0xf'));logger[_0xd58a('0x10')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3501f7,_0xd58a('0xf'),JSON[_0xd58a('0x11')](_0x4b09a7));if(_0x4b09a7[_0xd58a('0x12')]){if(_0x4b09a7[_0xd58a('0x12')][_0xd58a('0x13')]===0x1f4){logger[_0xd58a('0x12')](_0xd58a('0xe'),_0x3501f7,_0x4b09a7[_0xd58a('0x12')][_0xd58a('0x14')]);return _0x5f4908(_0x4b09a7[_0xd58a('0x12')][_0xd58a('0x14')]);}logger[_0xd58a('0x12')](_0xd58a('0xe'),_0x3501f7,_0x4b09a7['error'][_0xd58a('0x14')]);return _0x361ea7(_0x4b09a7[_0xd58a('0x12')]['message']);}else{logger[_0xd58a('0xd')](_0xd58a('0xe'),_0x3501f7,_0xd58a('0xf'));_0x361ea7(_0x4b09a7[_0xd58a('0x15')][_0xd58a('0x14')]);}})['catch'](function(_0x413c0e){logger[_0xd58a('0x12')](_0xd58a('0xe'),_0x3501f7,_0x413c0e);_0x5f4908(_0x413c0e);});});}exports[_0xd58a('0x16')]=function(_0x5e3bcf){var _0x5373d2=this;return new Promise(function(_0x40e624,_0xf4bc89){return db[_0xd58a('0x17')][_0xd58a('0x18')](_0x5e3bcf['body'],{'raw':_0x5e3bcf[_0xd58a('0x19')]?_0x5e3bcf['options'][_0xd58a('0x1a')]===undefined?!![]:![]:!![]})[_0xd58a('0xc')](function(_0x5c594b){logger[_0xd58a('0xd')](_0xd58a('0x16'),_0x5e3bcf);logger['debug'](_0xd58a('0x16'),_0x5e3bcf,JSON[_0xd58a('0x11')](_0x5c594b));_0x40e624(_0x5c594b);})['catch'](function(_0x2cdcd9){logger[_0xd58a('0x12')]('CreateMailQueueReport',_0x2cdcd9[_0xd58a('0x14')],_0x5e3bcf);_0xf4bc89(_0x5373d2[_0xd58a('0x12')](0x1f4,_0x2cdcd9['message']));});});};exports['UpdateMailQueueReport']=function(_0x2a48eb){var _0x94c309=this;return new Promise(function(_0x4205c1,_0x15c135){return db[_0xd58a('0x17')][_0xd58a('0x1b')](_0x2a48eb['body'],{'raw':_0x2a48eb[_0xd58a('0x19')]?_0x2a48eb['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a48eb[_0xd58a('0x19')]?_0x2a48eb[_0xd58a('0x19')][_0xd58a('0x1c')]||null:null,'attributes':_0x2a48eb[_0xd58a('0x19')]?_0x2a48eb[_0xd58a('0x19')][_0xd58a('0x1d')]||null:null,'limit':_0x2a48eb[_0xd58a('0x19')]?_0x2a48eb[_0xd58a('0x19')][_0xd58a('0x1e')]||null:null})[_0xd58a('0xc')](function(_0x18c69c){logger[_0xd58a('0xd')](_0xd58a('0x1f'),_0x2a48eb);logger[_0xd58a('0x10')](_0xd58a('0x1f'),_0x2a48eb,JSON[_0xd58a('0x11')](_0x18c69c));_0x4205c1(_0x18c69c);})[_0xd58a('0x20')](function(_0xf0f386){logger[_0xd58a('0x12')](_0xd58a('0x1f'),_0xf0f386[_0xd58a('0x14')],_0x2a48eb);_0x15c135(_0x94c309['error'](0x1f4,_0xf0f386[_0xd58a('0x14')]));});});};
\ No newline at end of file
index b427f65..3cfa85e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d36=['express','Router','../../components/auth/service','../../components/interaction/service','exports','multer','util'];(function(_0x35e4c3,_0x20af14){var _0xf530b3=function(_0x421c80){while(--_0x421c80){_0x35e4c3['push'](_0x35e4c3['shift']());}};_0xf530b3(++_0x20af14);}(_0x3d36,0x139));var _0x63d3=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0x3d36[_0xf2628e];return _0x13863a;};'use strict';var multer=require(_0x63d3('0x0'));var util=require(_0x63d3('0x1'));var path=require('path');var express=require(_0x63d3('0x2'));var router=express[_0x63d3('0x3')]();var auth=require(_0x63d3('0x4'));var interaction=require(_0x63d3('0x5'));var config=require('../../config/environment');module[_0x63d3('0x6')]=router;
\ No newline at end of file
+var _0xc6ac=['../../config/environment','exports','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1f2a26,_0x48eb71){var _0x3eb9d7=function(_0x399bce){while(--_0x399bce){_0x1f2a26['push'](_0x1f2a26['shift']());}};_0x3eb9d7(++_0x48eb71);}(_0xc6ac,0xd4));var _0xcc6a=function(_0x1e4d51,_0xa6010a){_0x1e4d51=_0x1e4d51-0x0;var _0x3ee53c=_0xc6ac[_0x1e4d51];return _0x3ee53c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var express=require(_0xcc6a('0x0'));var router=express[_0xcc6a('0x1')]();var auth=require(_0xcc6a('0x2'));var interaction=require(_0xcc6a('0x3'));var config=require(_0xcc6a('0x4'));module[_0xcc6a('0x5')]=router;
\ No newline at end of file
index e817d86..f4696de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5423=['username','INTEGER','INBOX','sequelize','exports','STRING','BOOLEAN'];(function(_0x345055,_0x223f93){var _0x3fd78a=function(_0x35f55f){while(--_0x35f55f){_0x345055['push'](_0x345055['shift']());}};_0x3fd78a(++_0x223f93);}(_0x5423,0xe3));var _0x3542=function(_0x4f46af,_0x23b7cb){_0x4f46af=_0x4f46af-0x0;var _0x52d897=_0x5423[_0x4f46af];return _0x52d897;};'use strict';var Sequelize=require(_0x3542('0x0'));module[_0x3542('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x3542('0x2')]},'authentication':{'type':Sequelize[_0x3542('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING'],'unique':_0x3542('0x4')},'password':{'type':Sequelize[_0x3542('0x2')]},'port':{'type':Sequelize[_0x3542('0x5')]},'tls':{'type':Sequelize[_0x3542('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x3542('0x6')},'connTimeout':{'type':Sequelize[_0x3542('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x3542('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x3542('0x2')]}};
\ No newline at end of file
+var _0x1339=['username','INTEGER','INBOX','STRING','BOOLEAN'];(function(_0x5452c8,_0x14565c){var _0x219dc7=function(_0x14ba59){while(--_0x14ba59){_0x5452c8['push'](_0x5452c8['shift']());}};_0x219dc7(++_0x14565c);}(_0x1339,0x1ed));var _0x9133=function(_0x344ef8,_0x2ff807){_0x344ef8=_0x344ef8-0x0;var _0x164bce=_0x1339[_0x344ef8];return _0x164bce;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x9133('0x0')]},'host':{'type':Sequelize[_0x9133('0x0')]},'authentication':{'type':Sequelize[_0x9133('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x9133('0x0')],'unique':_0x9133('0x2')},'password':{'type':Sequelize[_0x9133('0x0')]},'port':{'type':Sequelize[_0x9133('0x3')]},'tls':{'type':Sequelize[_0x9133('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x9133('0x4')},'connTimeout':{'type':Sequelize[_0x9133('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x9133('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}};
\ No newline at end of file
index d145d3a..b18487e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85b5=['MailServerIn','lodash','util','api','bluebird','exports','define'];(function(_0x3240f3,_0x46f2a5){var _0x3054cf=function(_0x47ce51){while(--_0x47ce51){_0x3240f3['push'](_0x3240f3['shift']());}};_0x3054cf(++_0x46f2a5);}(_0x85b5,0x7f));var _0x585b=function(_0x219752,_0x29478d){_0x219752=_0x219752-0x0;var _0x2285ff=_0x85b5[_0x219752];return _0x2285ff;};'use strict';var _=require(_0x585b('0x0'));var util=require(_0x585b('0x1'));var logger=require('../../config/logger')(_0x585b('0x2'));var moment=require('moment');var BPromise=require(_0x585b('0x3'));var rp=require('request-promise');var attributes=require('./mailServerIn.attributes');module[_0x585b('0x4')]=function(_0x4f37a9,_0x3c7651){return _0x4f37a9[_0x585b('0x5')](_0x585b('0x6'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x48bc=['moment','bluebird','request-promise','./mailServerIn.attributes','exports','MailServerIn','lodash','util','../../config/logger'];(function(_0x267d8d,_0xe90f65){var _0x11a98f=function(_0x5703c9){while(--_0x5703c9){_0x267d8d['push'](_0x267d8d['shift']());}};_0x11a98f(++_0xe90f65);}(_0x48bc,0x1b6));var _0xc48b=function(_0x463604,_0x2f5454){_0x463604=_0x463604-0x0;var _0x4372e4=_0x48bc[_0x463604];return _0x4372e4;};'use strict';var _=require(_0xc48b('0x0'));var util=require(_0xc48b('0x1'));var logger=require(_0xc48b('0x2'))('api');var moment=require(_0xc48b('0x3'));var BPromise=require(_0xc48b('0x4'));var rp=require(_0xc48b('0x5'));var attributes=require(_0xc48b('0x6'));module[_0xc48b('0x7')]=function(_0x191443,_0x115c38){return _0x191443['define'](_0xc48b('0x8'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 59d7e1b..8cf30e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24b3=['../../config/environment','client','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','include','map','model','then','lodash','util','moment','randomstring','rpc'];(function(_0x1a326e,_0x285b4d){var _0x3e9d96=function(_0xba123d){while(--_0xba123d){_0x1a326e['push'](_0x1a326e['shift']());}};_0x3e9d96(++_0x285b4d);}(_0x24b3,0xd3));var _0x324b=function(_0x706f13,_0x5d9d4d){_0x706f13=_0x706f13-0x0;var _0x45e36c=_0x24b3[_0x706f13];return _0x45e36c;};'use strict';var _=require(_0x324b('0x0'));var util=require(_0x324b('0x1'));var moment=require(_0x324b('0x2'));var BPromise=require('bluebird');var rs=require(_0x324b('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x324b('0x4'));var config=require(_0x324b('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x324b('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a244c,_0x563222,_0x4021fc){return new BPromise(function(_0x39d42c,_0x7da7d0){return client['request'](_0x5a244c,_0x4021fc)['then'](function(_0x4e1045){logger[_0x324b('0x7')]('MailServerIn,\x20%s,\x20%s',_0x563222,_0x324b('0x8'));logger[_0x324b('0x9')](_0x324b('0xa'),_0x563222,_0x324b('0x8'),JSON[_0x324b('0xb')](_0x4e1045));if(_0x4e1045[_0x324b('0xc')]){if(_0x4e1045[_0x324b('0xc')][_0x324b('0xd')]===0x1f4){logger[_0x324b('0xc')](_0x324b('0xe'),_0x563222,_0x4e1045['error'][_0x324b('0xf')]);return _0x7da7d0(_0x4e1045[_0x324b('0xc')][_0x324b('0xf')]);}logger[_0x324b('0xc')](_0x324b('0xe'),_0x563222,_0x4e1045[_0x324b('0xc')][_0x324b('0xf')]);return _0x39d42c(_0x4e1045[_0x324b('0xc')][_0x324b('0xf')]);}else{logger[_0x324b('0x7')]('MailServerIn,\x20%s,\x20%s',_0x563222,_0x324b('0x8'));_0x39d42c(_0x4e1045['result'][_0x324b('0xf')]);}})[_0x324b('0x10')](function(_0x5ebed0){logger[_0x324b('0xc')](_0x324b('0xe'),_0x563222,_0x5ebed0);_0x7da7d0(_0x5ebed0);});});}exports[_0x324b('0x11')]=function(_0x1f797c){var _0x209104=this;return new Promise(function(_0x2def86,_0x38a03f){return db[_0x324b('0x12')][_0x324b('0x13')]({'raw':_0x1f797c[_0x324b('0x14')]?_0x1f797c[_0x324b('0x14')][_0x324b('0x15')]===undefined?!![]:![]:!![],'where':_0x1f797c[_0x324b('0x14')]?_0x1f797c['options']['where']||null:null,'attributes':_0x1f797c[_0x324b('0x14')]?_0x1f797c['options'][_0x324b('0x16')]||null:null,'limit':_0x1f797c['options']?_0x1f797c[_0x324b('0x14')]['limit']||null:null,'include':_0x1f797c[_0x324b('0x14')]?_0x1f797c[_0x324b('0x14')][_0x324b('0x17')]?_['map'](_0x1f797c[_0x324b('0x14')][_0x324b('0x17')],function(_0x2eca97){return{'model':db[_0x2eca97['model']],'as':_0x2eca97['as'],'attributes':_0x2eca97['attributes'],'include':_0x2eca97[_0x324b('0x17')]?_['map'](_0x2eca97[_0x324b('0x17')],function(_0x4390da){return{'model':db[_0x4390da['model']],'as':_0x4390da['as'],'attributes':_0x4390da[_0x324b('0x16')],'include':_0x4390da['include']?_[_0x324b('0x18')](_0x4390da[_0x324b('0x17')],function(_0x2617a8){return{'model':db[_0x2617a8[_0x324b('0x19')]],'as':_0x2617a8['as'],'attributes':_0x2617a8[_0x324b('0x16')]};}):[]};}):[]};}):[]:[]})[_0x324b('0x1a')](function(_0x46f79a){logger['info'](_0x324b('0x11'),_0x1f797c);logger[_0x324b('0x9')](_0x324b('0x11'),_0x1f797c,JSON[_0x324b('0xb')](_0x46f79a));_0x2def86(_0x46f79a);})['catch'](function(_0x3da0bc){logger[_0x324b('0xc')]('GetMailServerIn',_0x3da0bc[_0x324b('0xf')],_0x1f797c);_0x38a03f(_0x209104['error'](0x1f4,_0x3da0bc['message']));});});};
\ No newline at end of file
+var _0x8f1f=['debug','stringify','error','code','message','catch','GetMailServerIn','MailServerIn','findAll','options','attributes','limit','map','include','model','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent'];(function(_0x245bce,_0x28a015){var _0x5e625e=function(_0x6c73b0){while(--_0x6c73b0){_0x245bce['push'](_0x245bce['shift']());}};_0x5e625e(++_0x28a015);}(_0x8f1f,0xe1));var _0xf8f1=function(_0x25bbd6,_0x18f6d3){_0x25bbd6=_0x25bbd6-0x0;var _0x3a4c78=_0x8f1f[_0x25bbd6];return _0x3a4c78;};'use strict';var _=require(_0xf8f1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf8f1('0x1'));var rs=require(_0xf8f1('0x2'));var fs=require('fs');var db=require(_0xf8f1('0x3'))['db'];var utils=require(_0xf8f1('0x4'));var logger=require(_0xf8f1('0x5'))(_0xf8f1('0x6'));var config=require(_0xf8f1('0x7'));var jayson=require(_0xf8f1('0x8'));var client=jayson['client'][_0xf8f1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1fee13,_0x122134,_0x19ccf6){return new BPromise(function(_0x9609e9,_0x4bd078){return client[_0xf8f1('0xa')](_0x1fee13,_0x19ccf6)[_0xf8f1('0xb')](function(_0x2252f4){logger[_0xf8f1('0xc')](_0xf8f1('0xd'),_0x122134,_0xf8f1('0xe'));logger[_0xf8f1('0xf')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x122134,_0xf8f1('0xe'),JSON[_0xf8f1('0x10')](_0x2252f4));if(_0x2252f4[_0xf8f1('0x11')]){if(_0x2252f4[_0xf8f1('0x11')][_0xf8f1('0x12')]===0x1f4){logger[_0xf8f1('0x11')]('MailServerIn,\x20%s,\x20%s',_0x122134,_0x2252f4[_0xf8f1('0x11')][_0xf8f1('0x13')]);return _0x4bd078(_0x2252f4[_0xf8f1('0x11')][_0xf8f1('0x13')]);}logger[_0xf8f1('0x11')]('MailServerIn,\x20%s,\x20%s',_0x122134,_0x2252f4[_0xf8f1('0x11')][_0xf8f1('0x13')]);return _0x9609e9(_0x2252f4[_0xf8f1('0x11')][_0xf8f1('0x13')]);}else{logger[_0xf8f1('0xc')](_0xf8f1('0xd'),_0x122134,_0xf8f1('0xe'));_0x9609e9(_0x2252f4['result'][_0xf8f1('0x13')]);}})[_0xf8f1('0x14')](function(_0x5bbe74){logger[_0xf8f1('0x11')](_0xf8f1('0xd'),_0x122134,_0x5bbe74);_0x4bd078(_0x5bbe74);});});}exports[_0xf8f1('0x15')]=function(_0x5f51e6){var _0x3bd8ba=this;return new Promise(function(_0x3bcb06,_0x410299){return db[_0xf8f1('0x16')][_0xf8f1('0x17')]({'raw':_0x5f51e6['options']?_0x5f51e6[_0xf8f1('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5f51e6[_0xf8f1('0x18')]?_0x5f51e6[_0xf8f1('0x18')]['where']||null:null,'attributes':_0x5f51e6[_0xf8f1('0x18')]?_0x5f51e6[_0xf8f1('0x18')][_0xf8f1('0x19')]||null:null,'limit':_0x5f51e6[_0xf8f1('0x18')]?_0x5f51e6[_0xf8f1('0x18')][_0xf8f1('0x1a')]||null:null,'include':_0x5f51e6['options']?_0x5f51e6[_0xf8f1('0x18')]['include']?_[_0xf8f1('0x1b')](_0x5f51e6[_0xf8f1('0x18')][_0xf8f1('0x1c')],function(_0x3e97e4){return{'model':db[_0x3e97e4[_0xf8f1('0x1d')]],'as':_0x3e97e4['as'],'attributes':_0x3e97e4[_0xf8f1('0x19')],'include':_0x3e97e4[_0xf8f1('0x1c')]?_['map'](_0x3e97e4['include'],function(_0x28b37c){return{'model':db[_0x28b37c[_0xf8f1('0x1d')]],'as':_0x28b37c['as'],'attributes':_0x28b37c['attributes'],'include':_0x28b37c[_0xf8f1('0x1c')]?_[_0xf8f1('0x1b')](_0x28b37c[_0xf8f1('0x1c')],function(_0x1a96f5){return{'model':db[_0x1a96f5[_0xf8f1('0x1d')]],'as':_0x1a96f5['as'],'attributes':_0x1a96f5[_0xf8f1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf8f1('0xb')](function(_0x48312f){logger[_0xf8f1('0xc')]('GetMailServerIn',_0x5f51e6);logger[_0xf8f1('0xf')](_0xf8f1('0x15'),_0x5f51e6,JSON[_0xf8f1('0x10')](_0x48312f));_0x3bcb06(_0x48312f);})['catch'](function(_0x20c4a7){logger[_0xf8f1('0x11')](_0xf8f1('0x15'),_0x20c4a7['message'],_0x5f51e6);_0x410299(_0x3bd8ba['error'](0x1f4,_0x20c4a7['message']));});});};
\ No newline at end of file
index 55aaebe..0a3e0d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['multer','util','path','express','Router','../../components/auth/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports'];(function(_0x20fcea,_0x523fb1){var _0x5b0928=function(_0x72e0bc){while(--_0x72e0bc){_0x20fcea['push'](_0x20fcea['shift']());}};_0x5b0928(++_0x523fb1);}(_0x814b,0x1a2));var _0xb814=function(_0xdf5fc5,_0x37255b){_0xdf5fc5=_0xdf5fc5-0x0;var _0x52f5a5=_0x814b[_0xdf5fc5];return _0x52f5a5;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var express=require(_0xb814('0x3'));var router=express[_0xb814('0x4')]();var auth=require(_0xb814('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb814('0x6'));var controller=require(_0xb814('0x7'));router[_0xb814('0x8')]('/',auth[_0xb814('0x9')](),controller[_0xb814('0xa')]);router[_0xb814('0x8')]('/:id',auth[_0xb814('0x9')](),controller[_0xb814('0xb')]);router['post']('/',auth[_0xb814('0x9')](),controller[_0xb814('0xc')]);router[_0xb814('0xd')](_0xb814('0xe'),auth[_0xb814('0x9')](),controller[_0xb814('0xf')]);router[_0xb814('0x10')](_0xb814('0xe'),auth[_0xb814('0x9')](),controller[_0xb814('0x11')]);module[_0xb814('0x12')]=router;
\ No newline at end of file
+var _0x814b=['multer','util','path','express','Router','../../components/auth/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports'];(function(_0x14b3fa,_0x2112ab){var _0x21319d=function(_0x5df354){while(--_0x5df354){_0x14b3fa['push'](_0x14b3fa['shift']());}};_0x21319d(++_0x2112ab);}(_0x814b,0x1a2));var _0xb814=function(_0x466e57,_0x21b819){_0x466e57=_0x466e57-0x0;var _0x34df42=_0x814b[_0x466e57];return _0x34df42;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var express=require(_0xb814('0x3'));var router=express[_0xb814('0x4')]();var auth=require(_0xb814('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb814('0x6'));var controller=require(_0xb814('0x7'));router[_0xb814('0x8')]('/',auth[_0xb814('0x9')](),controller[_0xb814('0xa')]);router[_0xb814('0x8')]('/:id',auth[_0xb814('0x9')](),controller[_0xb814('0xb')]);router['post']('/',auth[_0xb814('0x9')](),controller[_0xb814('0xc')]);router[_0xb814('0xd')](_0xb814('0xe'),auth[_0xb814('0x9')](),controller[_0xb814('0xf')]);router[_0xb814('0x10')](_0xb814('0xe'),auth[_0xb814('0x9')](),controller[_0xb814('0x11')]);module[_0xb814('0x12')]=router;
\ No newline at end of file
index ce324d5..df2544c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8917=['STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x15e03b,_0x4cac37){var _0x255af4=function(_0x35aecc){while(--_0x35aecc){_0x15e03b['push'](_0x15e03b['shift']());}};_0x255af4(++_0x4cac37);}(_0x8917,0xdf));var _0x7891=function(_0x3865e5,_0xfb2b25){_0x3865e5=_0x3865e5-0x0;var _0x37573f=_0x8917[_0x3865e5];return _0x37573f;};'use strict';var Sequelize=require(_0x7891('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x7891('0x1')]},'user':{'type':Sequelize[_0x7891('0x1')]},'pass':{'type':Sequelize[_0x7891('0x1')]},'port':{'type':Sequelize[_0x7891('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x7891('0x1')]},'authentication':{'type':Sequelize[_0x7891('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xb71f=['STRING','BOOLEAN','sequelize'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xb71f,0x18b));var _0xfb71=function(_0x48ec91,_0x212edc){_0x48ec91=_0x48ec91-0x0;var _0x22766c=_0xb71f[_0x48ec91];return _0x22766c;};'use strict';var Sequelize=require(_0xfb71('0x0'));module['exports']={'description':{'type':Sequelize[_0xfb71('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xfb71('0x1')]},'pass':{'type':Sequelize[_0xfb71('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xfb71('0x2')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xfb71('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index 3d0f125..370ffde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc17f=['set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','model','query','dateEnd','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','add','day','dateStart','merge','filter','map','options','includeAll','MailServerOut','findAll','show','params','include','catch','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit'];(function(_0x19bb0b,_0x257218){var _0x27f38c=function(_0x1eb9ef){while(--_0x1eb9ef){_0x19bb0b['push'](_0x19bb0b['shift']());}};_0x27f38c(++_0x257218);}(_0xc17f,0xb8));var _0xfc17=function(_0x280fdd,_0x258d03){_0x280fdd=_0x280fdd-0x0;var _0x1af49a=_0xc17f[_0x280fdd];return _0x1af49a;};'use strict';var pdf=require(_0xfc17('0x0'));var emlformat=require(_0xfc17('0x1'));var rimraf=require(_0xfc17('0x2'));var zipdir=require(_0xfc17('0x3'));var jsonpatch=require(_0xfc17('0x4'));var rp=require(_0xfc17('0x5'));var moment=require('moment');var BPromise=require(_0xfc17('0x6'));var Mustache=require(_0xfc17('0x7'));var util=require(_0xfc17('0x8'));var path=require(_0xfc17('0x9'));var sox=require('sox');var csv=require(_0xfc17('0xa'));var ejs=require(_0xfc17('0xb'));var fs=require('fs');var _=require(_0xfc17('0xc'));var squel=require(_0xfc17('0xd'));var crypto=require(_0xfc17('0xe'));var jsforce=require(_0xfc17('0xf'));var deskjs=require(_0xfc17('0x10'));var toCsv=require(_0xfc17('0xa'));var querystring=require('querystring');var Papa=require(_0xfc17('0x11'));var qs=require(_0xfc17('0x12'));var logger=require(_0xfc17('0x13'))(_0xfc17('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xfc17('0x15'))['db'];function respondWithStatusCode(_0x22cbef,_0x2924e9){_0x2924e9=_0x2924e9||0xcc;return function(_0x431f67){if(_0x431f67){return _0x22cbef[_0xfc17('0x16')](_0x2924e9);}return _0x22cbef[_0xfc17('0x17')](_0x2924e9)[_0xfc17('0x18')]();};}function respondWithResult(_0x133c4c,_0x115411){_0x115411=_0x115411||0xc8;return function(_0x1f0c64){if(_0x1f0c64){return _0x133c4c['status'](_0x115411)[_0xfc17('0x19')](_0x1f0c64);}};}function respondWithFilteredResult(_0x137d6d,_0x29c8e9){return function(_0x47e84a){if(_0x47e84a){var _0x16e49b=_0x47e84a[_0xfc17('0x1a')],_0x349779=_0x29c8e9[_0xfc17('0x1b')],_0x3a81f7=_0x29c8e9[_0xfc17('0x1b')]+_0x29c8e9[_0xfc17('0x1c')],_0x25d5fe;if(_0x3a81f7>=_0x16e49b){_0x3a81f7=_0x16e49b;_0x25d5fe=0xc8;}else{_0x25d5fe=0xce;}_0x137d6d[_0xfc17('0x17')](_0x25d5fe);return _0x137d6d[_0xfc17('0x1d')](_0xfc17('0x1e'),_0x349779+'-'+_0x3a81f7+'/'+_0x16e49b)[_0xfc17('0x19')](_0x47e84a);}return null;};}function patchUpdates(_0x2bbb0e){return function(_0x5b2c7c){try{jsonpatch['apply'](_0x5b2c7c,_0x2bbb0e,!![]);}catch(_0x2aa3a2){return BPromise[_0xfc17('0x1f')](_0x2aa3a2);}return _0x5b2c7c[_0xfc17('0x20')]();};}function saveUpdates(_0x109c84,_0x5b23e8){return function(_0x12ec9b){if(_0x12ec9b){return _0x12ec9b[_0xfc17('0x21')](_0x109c84)[_0xfc17('0x22')](function(_0x48edb4){return _0x48edb4;});}return null;};}function removeEntity(_0x2614de,_0x1010af){return function(_0xd4031d){if(_0xd4031d){return _0xd4031d[_0xfc17('0x23')]()[_0xfc17('0x22')](function(){_0x2614de[_0xfc17('0x17')](0xcc)[_0xfc17('0x18')]();});}};}function handleEntityNotFound(_0x4593d0,_0x3f91a5){return function(_0x410d77){if(!_0x410d77){_0x4593d0['sendStatus'](0x194);}return _0x410d77;};}function handleError(_0x37c847,_0x2285df){_0x2285df=_0x2285df||0x1f4;return function(_0x10a81f){logger[_0xfc17('0x24')](_0x10a81f[_0xfc17('0x25')]);if(_0x10a81f[_0xfc17('0x26')]){delete _0x10a81f['name'];}_0x37c847[_0xfc17('0x17')](_0x2285df)[_0xfc17('0x27')](_0x10a81f);};}exports['index']=function(_0x358f48,_0x2f1ebc){var _0x4b1038={},_0x4e4cf5={},_0xd0144c={'count':0x0,'rows':[]};var _0x24338b=db['MailServerOut'][_0xfc17('0x28')];_0x4e4cf5[_0xfc17('0x29')]=_['keys'](_0x24338b);var _0x38fdea={'dateStart':_0x358f48[_0xfc17('0x2a')]['dateStart'],'dateEnd':_0x358f48[_0xfc17('0x2a')][_0xfc17('0x2b')]};delete _0x358f48['query']['dateStart'];delete _0x358f48[_0xfc17('0x2a')][_0xfc17('0x2b')];_0x4e4cf5[_0xfc17('0x2a')]=_[_0xfc17('0x2c')](_0x358f48[_0xfc17('0x2a')]);_0x4e4cf5[_0xfc17('0x2d')]=_[_0xfc17('0x2e')](_0x4e4cf5[_0xfc17('0x29')],_0x4e4cf5[_0xfc17('0x2a')]);_0x4b1038['attributes']=_[_0xfc17('0x2e')](_0x4e4cf5[_0xfc17('0x29')],qs[_0xfc17('0x2f')](_0x358f48['query'][_0xfc17('0x2f')]));_0x4b1038['attributes']=_0x4b1038[_0xfc17('0x30')][_0xfc17('0x31')]?_0x4b1038[_0xfc17('0x30')]:_0x4e4cf5[_0xfc17('0x29')];if(!_0x358f48['query'][_0xfc17('0x32')](_0xfc17('0x33'))){_0x4b1038['limit']=qs['limit'](_0x358f48['query'][_0xfc17('0x1c')]);_0x4b1038[_0xfc17('0x1b')]=qs[_0xfc17('0x1b')](_0x358f48[_0xfc17('0x2a')][_0xfc17('0x1b')]);}_0x4b1038['order']=qs[_0xfc17('0x34')](_0x358f48[_0xfc17('0x2a')]['sort']);_0x4b1038[_0xfc17('0x35')]=qs[_0xfc17('0x2d')](_['pick'](_0x358f48['query'],_0x4e4cf5[_0xfc17('0x2d')]));if(_0x38fdea['dateStart']){if(_0x38fdea[_0xfc17('0x2b')]){_0x38fdea['dateEnd']=moment(_0x38fdea['dateEnd'])[_0xfc17('0x36')](0x1,_0xfc17('0x37'));}else{_0x38fdea[_0xfc17('0x2b')]=moment(_0x38fdea[_0xfc17('0x38')])[_0xfc17('0x36')](0x1,_0xfc17('0x37'));}_[_0xfc17('0x39')](_0x4b1038['where'],{'createdAt':{'$gte':_0x38fdea[_0xfc17('0x38')],'$lte':_0x38fdea[_0xfc17('0x2b')]}});}if(_0x358f48[_0xfc17('0x2a')][_0xfc17('0x3a')]){_0x4b1038['where']=_['merge'](_0x4b1038[_0xfc17('0x35')],{'$or':_[_0xfc17('0x3b')](_0x4b1038[_0xfc17('0x30')],function(_0x1c2da4){var _0x4fc531={};_0x4fc531[_0x1c2da4]={'$like':'%'+_0x358f48['query'][_0xfc17('0x3a')]+'%'};return _0x4fc531;})});}_0x4b1038=_['merge']({},_0x4b1038,_0x358f48[_0xfc17('0x3c')]);var _0x5aee83={'where':_0x4b1038[_0xfc17('0x35')]};return db['MailServerOut'][_0xfc17('0x1a')](_0x5aee83)[_0xfc17('0x22')](function(_0x29a557){_0xd0144c[_0xfc17('0x1a')]=_0x29a557;if(_0x358f48[_0xfc17('0x2a')][_0xfc17('0x3d')]){_0x4b1038['include']=[{'all':!![]}];}return db[_0xfc17('0x3e')][_0xfc17('0x3f')](_0x4b1038);})[_0xfc17('0x22')](function(_0x131f8d){_0xd0144c['rows']=_0x131f8d;return _0xd0144c;})[_0xfc17('0x22')](respondWithFilteredResult(_0x2f1ebc,_0x4b1038))['catch'](handleError(_0x2f1ebc,null));};exports[_0xfc17('0x40')]=function(_0x5c0671,_0x384c78){var _0x3760e9={'raw':!![],'where':{'id':_0x5c0671[_0xfc17('0x41')]['id']}},_0x47d217={};_0x47d217[_0xfc17('0x29')]=_[_0xfc17('0x2c')](db['MailServerOut'][_0xfc17('0x28')]);_0x47d217['query']=_[_0xfc17('0x2c')](_0x5c0671[_0xfc17('0x2a')]);_0x47d217[_0xfc17('0x2d')]=_[_0xfc17('0x2e')](_0x47d217['model'],_0x47d217[_0xfc17('0x2a')]);_0x3760e9[_0xfc17('0x30')]=_['intersection'](_0x47d217[_0xfc17('0x29')],qs['fields'](_0x5c0671[_0xfc17('0x2a')][_0xfc17('0x2f')]));_0x3760e9['attributes']=_0x3760e9[_0xfc17('0x30')]['length']?_0x3760e9[_0xfc17('0x30')]:_0x47d217[_0xfc17('0x29')];if(_0x5c0671[_0xfc17('0x2a')][_0xfc17('0x3d')]){_0x3760e9[_0xfc17('0x42')]=[{'all':!![]}];}_0x3760e9=_[_0xfc17('0x39')]({},_0x3760e9,_0x5c0671['options']);return db[_0xfc17('0x3e')]['find'](_0x3760e9)[_0xfc17('0x22')](handleEntityNotFound(_0x384c78,null))[_0xfc17('0x22')](respondWithResult(_0x384c78,null))[_0xfc17('0x43')](handleError(_0x384c78,null));};exports[_0xfc17('0x44')]=function(_0xba87b6,_0x381064){return db[_0xfc17('0x3e')][_0xfc17('0x44')](_0xba87b6[_0xfc17('0x45')],{})['then'](respondWithResult(_0x381064,0xc9))[_0xfc17('0x43')](handleError(_0x381064,null));};exports['update']=function(_0x53011f,_0x38b2ed){if(_0x53011f[_0xfc17('0x45')]['id']){delete _0x53011f[_0xfc17('0x45')]['id'];}return db[_0xfc17('0x3e')]['find']({'where':{'id':_0x53011f['params']['id']}})['then'](handleEntityNotFound(_0x38b2ed,null))['then'](saveUpdates(_0x53011f[_0xfc17('0x45')],null))[_0xfc17('0x22')](respondWithResult(_0x38b2ed,null))[_0xfc17('0x43')](handleError(_0x38b2ed,null));};exports['destroy']=function(_0x31261a,_0x33333e){return db[_0xfc17('0x3e')][_0xfc17('0x46')]({'where':{'id':_0x31261a[_0xfc17('0x41')]['id']}})['then'](handleEntityNotFound(_0x33333e,null))['then'](removeEntity(_0x33333e,null))['catch'](handleError(_0x33333e,null));};
\ No newline at end of file
+var _0x7f8b=['../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','index','MailServerOut','rawAttributes','model','dateStart','query','dateEnd','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','add','day','merge','filter','options','count','includeAll','include','findAll','rows','catch','show','params','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../config/logger','../../config/utils'];(function(_0x13f3e7,_0x3ed1a3){var _0x1bfbb3=function(_0xd0831a){while(--_0xd0831a){_0x13f3e7['push'](_0x13f3e7['shift']());}};_0x1bfbb3(++_0x3ed1a3);}(_0x7f8b,0x1ca));var _0xb7f8=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x7f8b[_0x5f3f88];return _0xd08119;};'use strict';var pdf=require(_0xb7f8('0x0'));var emlformat=require(_0xb7f8('0x1'));var rimraf=require(_0xb7f8('0x2'));var zipdir=require(_0xb7f8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb7f8('0x4'));var moment=require(_0xb7f8('0x5'));var BPromise=require(_0xb7f8('0x6'));var Mustache=require(_0xb7f8('0x7'));var util=require(_0xb7f8('0x8'));var path=require(_0xb7f8('0x9'));var sox=require('sox');var csv=require(_0xb7f8('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb7f8('0xb'));var crypto=require(_0xb7f8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb7f8('0xd'));var toCsv=require(_0xb7f8('0xa'));var querystring=require(_0xb7f8('0xe'));var Papa=require('papaparse');var qs=require(_0xb7f8('0xf'));var logger=require(_0xb7f8('0x10'))('api');var utils=require(_0xb7f8('0x11'));var config=require(_0xb7f8('0x12'));var db=require(_0xb7f8('0x13'))['db'];function respondWithStatusCode(_0x3a32c4,_0x212d19){_0x212d19=_0x212d19||0xcc;return function(_0x47825a){if(_0x47825a){return _0x3a32c4[_0xb7f8('0x14')](_0x212d19);}return _0x3a32c4[_0xb7f8('0x15')](_0x212d19)[_0xb7f8('0x16')]();};}function respondWithResult(_0x54c4de,_0x1527eb){_0x1527eb=_0x1527eb||0xc8;return function(_0x327339){if(_0x327339){return _0x54c4de[_0xb7f8('0x15')](_0x1527eb)[_0xb7f8('0x17')](_0x327339);}};}function respondWithFilteredResult(_0x37d31c,_0x567ba5){return function(_0x28608f){if(_0x28608f){var _0x123a17=_0x28608f['count'],_0xe59c07=_0x567ba5['offset'],_0x5b9706=_0x567ba5[_0xb7f8('0x18')]+_0x567ba5[_0xb7f8('0x19')],_0x1a6a96;if(_0x5b9706>=_0x123a17){_0x5b9706=_0x123a17;_0x1a6a96=0xc8;}else{_0x1a6a96=0xce;}_0x37d31c[_0xb7f8('0x15')](_0x1a6a96);return _0x37d31c[_0xb7f8('0x1a')](_0xb7f8('0x1b'),_0xe59c07+'-'+_0x5b9706+'/'+_0x123a17)['json'](_0x28608f);}return null;};}function patchUpdates(_0xfc7fba){return function(_0x359d3d){try{jsonpatch[_0xb7f8('0x1c')](_0x359d3d,_0xfc7fba,!![]);}catch(_0x2dd045){return BPromise['reject'](_0x2dd045);}return _0x359d3d[_0xb7f8('0x1d')]();};}function saveUpdates(_0x2a347b,_0x49a7bb){return function(_0x28d523){if(_0x28d523){return _0x28d523[_0xb7f8('0x1e')](_0x2a347b)[_0xb7f8('0x1f')](function(_0x430e88){return _0x430e88;});}return null;};}function removeEntity(_0x4e223b,_0x37714d){return function(_0x4d0ef2){if(_0x4d0ef2){return _0x4d0ef2['destroy']()[_0xb7f8('0x1f')](function(){_0x4e223b[_0xb7f8('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21891e,_0x3779f3){return function(_0x59ac36){if(!_0x59ac36){_0x21891e['sendStatus'](0x194);}return _0x59ac36;};}function handleError(_0x52f5ab,_0xe551f0){_0xe551f0=_0xe551f0||0x1f4;return function(_0x5f06cc){logger[_0xb7f8('0x20')](_0x5f06cc[_0xb7f8('0x21')]);if(_0x5f06cc[_0xb7f8('0x22')]){delete _0x5f06cc[_0xb7f8('0x22')];}_0x52f5ab['status'](_0xe551f0)[_0xb7f8('0x23')](_0x5f06cc);};}exports[_0xb7f8('0x24')]=function(_0x555039,_0x23ec8c){var _0x39ff72={},_0x3feac4={},_0x5a2208={'count':0x0,'rows':[]};var _0x2a80e8=db[_0xb7f8('0x25')][_0xb7f8('0x26')];_0x3feac4[_0xb7f8('0x27')]=_['keys'](_0x2a80e8);var _0x22406f={'dateStart':_0x555039['query'][_0xb7f8('0x28')],'dateEnd':_0x555039[_0xb7f8('0x29')][_0xb7f8('0x2a')]};delete _0x555039[_0xb7f8('0x29')]['dateStart'];delete _0x555039[_0xb7f8('0x29')][_0xb7f8('0x2a')];_0x3feac4['query']=_[_0xb7f8('0x2b')](_0x555039[_0xb7f8('0x29')]);_0x3feac4[_0xb7f8('0x2c')]=_[_0xb7f8('0x2d')](_0x3feac4['model'],_0x3feac4[_0xb7f8('0x29')]);_0x39ff72[_0xb7f8('0x2e')]=_[_0xb7f8('0x2d')](_0x3feac4[_0xb7f8('0x27')],qs['fields'](_0x555039[_0xb7f8('0x29')][_0xb7f8('0x2f')]));_0x39ff72['attributes']=_0x39ff72[_0xb7f8('0x2e')]['length']?_0x39ff72[_0xb7f8('0x2e')]:_0x3feac4[_0xb7f8('0x27')];if(!_0x555039[_0xb7f8('0x29')][_0xb7f8('0x30')](_0xb7f8('0x31'))){_0x39ff72[_0xb7f8('0x19')]=qs[_0xb7f8('0x19')](_0x555039[_0xb7f8('0x29')]['limit']);_0x39ff72['offset']=qs['offset'](_0x555039[_0xb7f8('0x29')][_0xb7f8('0x18')]);}_0x39ff72[_0xb7f8('0x32')]=qs[_0xb7f8('0x33')](_0x555039[_0xb7f8('0x29')][_0xb7f8('0x33')]);_0x39ff72[_0xb7f8('0x34')]=qs['filters'](_[_0xb7f8('0x35')](_0x555039[_0xb7f8('0x29')],_0x3feac4[_0xb7f8('0x2c')]));if(_0x22406f[_0xb7f8('0x28')]){if(_0x22406f[_0xb7f8('0x2a')]){_0x22406f[_0xb7f8('0x2a')]=moment(_0x22406f['dateEnd'])[_0xb7f8('0x36')](0x1,_0xb7f8('0x37'));}else{_0x22406f[_0xb7f8('0x2a')]=moment(_0x22406f[_0xb7f8('0x28')])[_0xb7f8('0x36')](0x1,'day');}_[_0xb7f8('0x38')](_0x39ff72[_0xb7f8('0x34')],{'createdAt':{'$gte':_0x22406f[_0xb7f8('0x28')],'$lte':_0x22406f[_0xb7f8('0x2a')]}});}if(_0x555039[_0xb7f8('0x29')][_0xb7f8('0x39')]){_0x39ff72[_0xb7f8('0x34')]=_[_0xb7f8('0x38')](_0x39ff72[_0xb7f8('0x34')],{'$or':_['map'](_0x39ff72[_0xb7f8('0x2e')],function(_0x2e09a0){var _0x416fac={};_0x416fac[_0x2e09a0]={'$like':'%'+_0x555039[_0xb7f8('0x29')]['filter']+'%'};return _0x416fac;})});}_0x39ff72=_[_0xb7f8('0x38')]({},_0x39ff72,_0x555039[_0xb7f8('0x3a')]);var _0x578f31={'where':_0x39ff72[_0xb7f8('0x34')]};return db[_0xb7f8('0x25')][_0xb7f8('0x3b')](_0x578f31)['then'](function(_0x41d31d){_0x5a2208[_0xb7f8('0x3b')]=_0x41d31d;if(_0x555039[_0xb7f8('0x29')][_0xb7f8('0x3c')]){_0x39ff72[_0xb7f8('0x3d')]=[{'all':!![]}];}return db[_0xb7f8('0x25')][_0xb7f8('0x3e')](_0x39ff72);})['then'](function(_0x508cc0){_0x5a2208[_0xb7f8('0x3f')]=_0x508cc0;return _0x5a2208;})[_0xb7f8('0x1f')](respondWithFilteredResult(_0x23ec8c,_0x39ff72))[_0xb7f8('0x40')](handleError(_0x23ec8c,null));};exports[_0xb7f8('0x41')]=function(_0x4c0fb6,_0x2bf0d6){var _0x5736fe={'raw':!![],'where':{'id':_0x4c0fb6[_0xb7f8('0x42')]['id']}},_0x5d572a={};_0x5d572a[_0xb7f8('0x27')]=_[_0xb7f8('0x2b')](db[_0xb7f8('0x25')][_0xb7f8('0x26')]);_0x5d572a['query']=_[_0xb7f8('0x2b')](_0x4c0fb6[_0xb7f8('0x29')]);_0x5d572a[_0xb7f8('0x2c')]=_[_0xb7f8('0x2d')](_0x5d572a['model'],_0x5d572a['query']);_0x5736fe['attributes']=_[_0xb7f8('0x2d')](_0x5d572a[_0xb7f8('0x27')],qs[_0xb7f8('0x2f')](_0x4c0fb6[_0xb7f8('0x29')]['fields']));_0x5736fe['attributes']=_0x5736fe['attributes']['length']?_0x5736fe[_0xb7f8('0x2e')]:_0x5d572a[_0xb7f8('0x27')];if(_0x4c0fb6[_0xb7f8('0x29')][_0xb7f8('0x3c')]){_0x5736fe[_0xb7f8('0x3d')]=[{'all':!![]}];}_0x5736fe=_[_0xb7f8('0x38')]({},_0x5736fe,_0x4c0fb6[_0xb7f8('0x3a')]);return db['MailServerOut']['find'](_0x5736fe)[_0xb7f8('0x1f')](handleEntityNotFound(_0x2bf0d6,null))['then'](respondWithResult(_0x2bf0d6,null))[_0xb7f8('0x40')](handleError(_0x2bf0d6,null));};exports['create']=function(_0x254505,_0x2916e2){return db[_0xb7f8('0x25')]['create'](_0x254505[_0xb7f8('0x43')],{})[_0xb7f8('0x1f')](respondWithResult(_0x2916e2,0xc9))[_0xb7f8('0x40')](handleError(_0x2916e2,null));};exports['update']=function(_0x3670fd,_0x1e7de2){if(_0x3670fd['body']['id']){delete _0x3670fd[_0xb7f8('0x43')]['id'];}return db[_0xb7f8('0x25')]['find']({'where':{'id':_0x3670fd[_0xb7f8('0x42')]['id']}})[_0xb7f8('0x1f')](handleEntityNotFound(_0x1e7de2,null))['then'](saveUpdates(_0x3670fd[_0xb7f8('0x43')],null))[_0xb7f8('0x1f')](respondWithResult(_0x1e7de2,null))[_0xb7f8('0x40')](handleError(_0x1e7de2,null));};exports['destroy']=function(_0x31b4df,_0x205817){return db[_0xb7f8('0x25')]['find']({'where':{'id':_0x31b4df[_0xb7f8('0x42')]['id']}})['then'](handleEntityNotFound(_0x205817,null))[_0xb7f8('0x1f')](removeEntity(_0x205817,null))[_0xb7f8('0x40')](handleError(_0x205817,null));};
\ No newline at end of file
index 2c3c297..fde8558 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82c4=['util','../../config/logger','api','moment','bluebird','request-promise','exports','MailServerOut','lodash'];(function(_0x12eb67,_0x4d1dfe){var _0x5b99ac=function(_0x54fc07){while(--_0x54fc07){_0x12eb67['push'](_0x12eb67['shift']());}};_0x5b99ac(++_0x4d1dfe);}(_0x82c4,0x1ca));var _0x482c=function(_0x5d340a,_0x2441da){_0x5d340a=_0x5d340a-0x0;var _0x435564=_0x82c4[_0x5d340a];return _0x435564;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var logger=require(_0x482c('0x2'))(_0x482c('0x3'));var moment=require(_0x482c('0x4'));var BPromise=require(_0x482c('0x5'));var rp=require(_0x482c('0x6'));var attributes=require('./mailServerOut.attributes');module[_0x482c('0x7')]=function(_0x5f4dee,_0x4556c8){return _0x5f4dee['define'](_0x482c('0x8'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7046=['./mailServerOut.attributes','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x7046,0x144));var _0x6704=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x7046[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var logger=require(_0x6704('0x2'))(_0x6704('0x3'));var moment=require('moment');var BPromise=require(_0x6704('0x4'));var rp=require(_0x6704('0x5'));var attributes=require(_0x6704('0x6'));module['exports']=function(_0x1e9b2a,_0x35bcc6){return _0x1e9b2a[_0x6704('0x7')](_0x6704('0x8'),attributes,{'tableName':_0x6704('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9fb3b6e..c018662 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e44=['info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x5d7734,_0x5e6e1c){var _0x509c10=function(_0xc7efb3){while(--_0xc7efb3){_0x5d7734['push'](_0x5d7734['shift']());}};_0x509c10(++_0x5e6e1c);}(_0x8e44,0x1ac));var _0x48e4=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x8e44[_0xfa634c];return _0x73e478;};'use strict';var _=require(_0x48e4('0x0'));var util=require(_0x48e4('0x1'));var moment=require(_0x48e4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0x48e4('0x3'))['db'];var utils=require(_0x48e4('0x4'));var logger=require(_0x48e4('0x5'))(_0x48e4('0x6'));var config=require('../../config/environment');var jayson=require(_0x48e4('0x7'));var client=jayson[_0x48e4('0x8')][_0x48e4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4dffab,_0x4e2c12,_0x26c5de){return new BPromise(function(_0xfd30df,_0x552cb1){return client[_0x48e4('0xa')](_0x4dffab,_0x26c5de)[_0x48e4('0xb')](function(_0x8849db){logger[_0x48e4('0xc')](_0x48e4('0xd'),_0x4e2c12,_0x48e4('0xe'));logger['debug'](_0x48e4('0xf'),_0x4e2c12,_0x48e4('0xe'),JSON[_0x48e4('0x10')](_0x8849db));if(_0x8849db['error']){if(_0x8849db['error'][_0x48e4('0x11')]===0x1f4){logger[_0x48e4('0x12')](_0x48e4('0xd'),_0x4e2c12,_0x8849db[_0x48e4('0x12')]['message']);return _0x552cb1(_0x8849db[_0x48e4('0x12')]['message']);}logger[_0x48e4('0x12')](_0x48e4('0xd'),_0x4e2c12,_0x8849db[_0x48e4('0x12')][_0x48e4('0x13')]);return _0xfd30df(_0x8849db[_0x48e4('0x12')][_0x48e4('0x13')]);}else{logger[_0x48e4('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4e2c12,_0x48e4('0xe'));_0xfd30df(_0x8849db[_0x48e4('0x14')]['message']);}})[_0x48e4('0x15')](function(_0x35a599){logger['error'](_0x48e4('0xd'),_0x4e2c12,_0x35a599);_0x552cb1(_0x35a599);});});}
\ No newline at end of file
+var _0x1edd=['randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird'];(function(_0x460fd7,_0x2012db){var _0x44d1c2=function(_0x545e11){while(--_0x545e11){_0x460fd7['push'](_0x460fd7['shift']());}};_0x44d1c2(++_0x2012db);}(_0x1edd,0xcd));var _0xd1ed=function(_0x3b19ea,_0x518b6b){_0x3b19ea=_0x3b19ea-0x0;var _0x40ece9=_0x1edd[_0x3b19ea];return _0x40ece9;};'use strict';var _=require(_0xd1ed('0x0'));var util=require(_0xd1ed('0x1'));var moment=require(_0xd1ed('0x2'));var BPromise=require(_0xd1ed('0x3'));var rs=require(_0xd1ed('0x4'));var fs=require('fs');var db=require(_0xd1ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd1ed('0x6'))(_0xd1ed('0x7'));var config=require('../../config/environment');var jayson=require(_0xd1ed('0x8'));var client=jayson[_0xd1ed('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58283f,_0x2db36e,_0x2f287b){return new BPromise(function(_0xa1402,_0x43a437){return client[_0xd1ed('0xa')](_0x58283f,_0x2f287b)['then'](function(_0xc549da){logger[_0xd1ed('0xb')](_0xd1ed('0xc'),_0x2db36e,_0xd1ed('0xd'));logger[_0xd1ed('0xe')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x2db36e,'request\x20sent',JSON[_0xd1ed('0xf')](_0xc549da));if(_0xc549da['error']){if(_0xc549da[_0xd1ed('0x10')]['code']===0x1f4){logger[_0xd1ed('0x10')](_0xd1ed('0xc'),_0x2db36e,_0xc549da['error'][_0xd1ed('0x11')]);return _0x43a437(_0xc549da[_0xd1ed('0x10')][_0xd1ed('0x11')]);}logger[_0xd1ed('0x10')](_0xd1ed('0xc'),_0x2db36e,_0xc549da[_0xd1ed('0x10')]['message']);return _0xa1402(_0xc549da[_0xd1ed('0x10')]['message']);}else{logger[_0xd1ed('0xb')](_0xd1ed('0xc'),_0x2db36e,_0xd1ed('0xd'));_0xa1402(_0xc549da['result'][_0xd1ed('0x11')]);}})[_0xd1ed('0x12')](function(_0x5e3114){logger[_0xd1ed('0x10')](_0xd1ed('0xc'),_0x2db36e,_0x5e3114);_0x43a437(_0x5e3114);});});}
\ No newline at end of file
index 43c3cd3..606b702 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8130=['update','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','/describe','describe','get','/:id','show','create','put'];(function(_0x45cd1e,_0x5eb283){var _0x2dccf6=function(_0x5e44ea){while(--_0x5e44ea){_0x45cd1e['push'](_0x45cd1e['shift']());}};_0x2dccf6(++_0x5eb283);}(_0x8130,0x146));var _0x0813=function(_0x37b339,_0x5af8d4){_0x37b339=_0x37b339-0x0;var _0x5f60be=_0x8130[_0x37b339];return _0x5f60be;};'use strict';var multer=require(_0x0813('0x0'));var util=require(_0x0813('0x1'));var path=require('path');var express=require(_0x0813('0x2'));var router=express[_0x0813('0x3')]();var auth=require(_0x0813('0x4'));var interaction=require(_0x0813('0x5'));var config=require(_0x0813('0x6'));var controller=require(_0x0813('0x7'));router['get']('/',auth[_0x0813('0x8')](),controller['index']);router['get'](_0x0813('0x9'),auth[_0x0813('0x8')](),controller[_0x0813('0xa')]);router[_0x0813('0xb')](_0x0813('0xc'),auth[_0x0813('0x8')](),controller[_0x0813('0xd')]);router['post']('/',auth[_0x0813('0x8')](),controller[_0x0813('0xe')]);router[_0x0813('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x0813('0x10')]);router['delete'](_0x0813('0xc'),auth['isAuthenticated'](),controller[_0x0813('0x11')]);module[_0x0813('0x12')]=router;
\ No newline at end of file
+var _0xb688=['Router','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','express'];(function(_0x54d2e5,_0x464158){var _0x163110=function(_0x2ff9c8){while(--_0x2ff9c8){_0x54d2e5['push'](_0x54d2e5['shift']());}};_0x163110(++_0x464158);}(_0xb688,0xcf));var _0x8b68=function(_0x3b5d1c,_0x4ec47b){_0x3b5d1c=_0x3b5d1c-0x0;var _0x25822c=_0xb688[_0x3b5d1c];return _0x25822c;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var express=require(_0x8b68('0x2'));var router=express[_0x8b68('0x3')]();var auth=require(_0x8b68('0x4'));var interaction=require(_0x8b68('0x5'));var config=require('../../config/environment');var controller=require(_0x8b68('0x6'));router[_0x8b68('0x7')]('/',auth[_0x8b68('0x8')](),controller[_0x8b68('0x9')]);router['get'](_0x8b68('0xa'),auth['isAuthenticated'](),controller[_0x8b68('0xb')]);router[_0x8b68('0x7')](_0x8b68('0xc'),auth[_0x8b68('0x8')](),controller[_0x8b68('0xd')]);router[_0x8b68('0xe')]('/',auth[_0x8b68('0x8')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x10')](_0x8b68('0xc'),auth[_0x8b68('0x8')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x12')]('/:id',auth[_0x8b68('0x8')](),controller[_0x8b68('0x13')]);module[_0x8b68('0x14')]=router;
\ No newline at end of file
index 0bea57e..8946198 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd732=['sequelize','STRING'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xd732,0x18e));var _0x2d73=function(_0x378a93,_0x88755f){_0x378a93=_0x378a93-0x0;var _0x2dc501=_0xd732[_0x378a93];return _0x2dc501;};'use strict';var Sequelize=require(_0x2d73('0x0'));module['exports']={'name':{'type':Sequelize[_0x2d73('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xbc87=['sequelize','name','STRING'];(function(_0x1d4914,_0x51b04e){var _0x171028=function(_0x21262a){while(--_0x21262a){_0x1d4914['push'](_0x1d4914['shift']());}};_0x171028(++_0x51b04e);}(_0xbc87,0x144));var _0x7bc8=function(_0x325746,_0x2a0d8a){_0x325746=_0x325746-0x0;var _0x41ca9b=_0xbc87[_0x325746];return _0x41ca9b;};'use strict';var Sequelize=require(_0x7bc8('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x7bc8('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7bc8('0x2')]}};
\ No newline at end of file
index 18ac836..b92c320 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc97=['then','end','stack','name','MailSubstatus','rawAttributes','model','keys','query','dateStart','dateEnd','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','add','day','merge','where','filter','map','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','find','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','save','update'];(function(_0x57bc73,_0x5e7c1c){var _0x238d55=function(_0x2011d0){while(--_0x2011d0){_0x57bc73['push'](_0x57bc73['shift']());}};_0x238d55(++_0x5e7c1c);}(_0xdc97,0x13b));var _0x7dc9=function(_0x3e1cfa,_0x4b34dc){_0x3e1cfa=_0x3e1cfa-0x0;var _0x5c6f5a=_0xdc97[_0x3e1cfa];return _0x5c6f5a;};'use strict';var pdf=require(_0x7dc9('0x0'));var emlformat=require(_0x7dc9('0x1'));var rimraf=require(_0x7dc9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7dc9('0x3'));var rp=require('request-promise');var moment=require(_0x7dc9('0x4'));var BPromise=require(_0x7dc9('0x5'));var Mustache=require('mustache');var util=require(_0x7dc9('0x6'));var path=require(_0x7dc9('0x7'));var sox=require(_0x7dc9('0x8'));var csv=require(_0x7dc9('0x9'));var ejs=require('ejs');var fs=require('fs');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('0x9'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0x7dc9('0xf'))(_0x7dc9('0x10'));var utils=require(_0x7dc9('0x11'));var config=require(_0x7dc9('0x12'));var db=require(_0x7dc9('0x13'))['db'];function respondWithStatusCode(_0x3c2af5,_0x1e336a){_0x1e336a=_0x1e336a||0xcc;return function(_0x4e8e65){if(_0x4e8e65){return _0x3c2af5['sendStatus'](_0x1e336a);}return _0x3c2af5['status'](_0x1e336a)['end']();};}function respondWithResult(_0x94c75a,_0x14e5db){_0x14e5db=_0x14e5db||0xc8;return function(_0x5c6ca5){if(_0x5c6ca5){return _0x94c75a[_0x7dc9('0x14')](_0x14e5db)[_0x7dc9('0x15')](_0x5c6ca5);}};}function respondWithFilteredResult(_0xaadf2,_0xf37bc7){return function(_0x31d43d){if(_0x31d43d){var _0x11af93=_0x31d43d[_0x7dc9('0x16')],_0x524d09=_0xf37bc7[_0x7dc9('0x17')],_0x3a54f2=_0xf37bc7[_0x7dc9('0x17')]+_0xf37bc7[_0x7dc9('0x18')],_0x278191;if(_0x3a54f2>=_0x11af93){_0x3a54f2=_0x11af93;_0x278191=0xc8;}else{_0x278191=0xce;}_0xaadf2[_0x7dc9('0x14')](_0x278191);return _0xaadf2[_0x7dc9('0x19')](_0x7dc9('0x1a'),_0x524d09+'-'+_0x3a54f2+'/'+_0x11af93)['json'](_0x31d43d);}return null;};}function patchUpdates(_0x22577e){return function(_0x4afb47){try{jsonpatch[_0x7dc9('0x1b')](_0x4afb47,_0x22577e,!![]);}catch(_0x1cc237){return BPromise['reject'](_0x1cc237);}return _0x4afb47[_0x7dc9('0x1c')]();};}function saveUpdates(_0x3b738a,_0x12f08d){return function(_0x4b2703){if(_0x4b2703){return _0x4b2703[_0x7dc9('0x1d')](_0x3b738a)[_0x7dc9('0x1e')](function(_0x2dad65){return _0x2dad65;});}return null;};}function removeEntity(_0x2895f5,_0x155cc4){return function(_0x2b38d6){if(_0x2b38d6){return _0x2b38d6['destroy']()['then'](function(){_0x2895f5[_0x7dc9('0x14')](0xcc)[_0x7dc9('0x1f')]();});}};}function handleEntityNotFound(_0x596e0f,_0x349001){return function(_0x27f7fa){if(!_0x27f7fa){_0x596e0f['sendStatus'](0x194);}return _0x27f7fa;};}function handleError(_0xffc080,_0x43d31f){_0x43d31f=_0x43d31f||0x1f4;return function(_0x41110a){logger['error'](_0x41110a[_0x7dc9('0x20')]);if(_0x41110a[_0x7dc9('0x21')]){delete _0x41110a[_0x7dc9('0x21')];}_0xffc080['status'](_0x43d31f)['send'](_0x41110a);};}exports['index']=function(_0x25b383,_0x32d032){var _0x5843bf={},_0x585eef={},_0x47771b={'count':0x0,'rows':[]};var _0x5afb7d=db[_0x7dc9('0x22')][_0x7dc9('0x23')];_0x585eef[_0x7dc9('0x24')]=_[_0x7dc9('0x25')](_0x5afb7d);var _0xa2aaa9={'dateStart':_0x25b383[_0x7dc9('0x26')][_0x7dc9('0x27')],'dateEnd':_0x25b383[_0x7dc9('0x26')][_0x7dc9('0x28')]};delete _0x25b383[_0x7dc9('0x26')][_0x7dc9('0x27')];delete _0x25b383[_0x7dc9('0x26')]['dateEnd'];_0x585eef['query']=_['keys'](_0x25b383['query']);_0x585eef['filters']=_['intersection'](_0x585eef['model'],_0x585eef['query']);_0x5843bf[_0x7dc9('0x29')]=_[_0x7dc9('0x2a')](_0x585eef[_0x7dc9('0x24')],qs[_0x7dc9('0x2b')](_0x25b383[_0x7dc9('0x26')][_0x7dc9('0x2b')]));_0x5843bf['attributes']=_0x5843bf['attributes']['length']?_0x5843bf[_0x7dc9('0x29')]:_0x585eef['model'];if(!_0x25b383[_0x7dc9('0x26')][_0x7dc9('0x2c')](_0x7dc9('0x2d'))){_0x5843bf[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x25b383[_0x7dc9('0x26')][_0x7dc9('0x18')]);_0x5843bf[_0x7dc9('0x17')]=qs['offset'](_0x25b383[_0x7dc9('0x26')]['offset']);}_0x5843bf[_0x7dc9('0x2e')]=qs[_0x7dc9('0x2f')](_0x25b383[_0x7dc9('0x26')][_0x7dc9('0x2f')]);_0x5843bf['where']=qs[_0x7dc9('0x30')](_['pick'](_0x25b383[_0x7dc9('0x26')],_0x585eef['filters']));if(_0xa2aaa9['dateStart']){if(_0xa2aaa9[_0x7dc9('0x28')]){_0xa2aaa9[_0x7dc9('0x28')]=moment(_0xa2aaa9[_0x7dc9('0x28')])[_0x7dc9('0x31')](0x1,'day');}else{_0xa2aaa9[_0x7dc9('0x28')]=moment(_0xa2aaa9[_0x7dc9('0x27')])[_0x7dc9('0x31')](0x1,_0x7dc9('0x32'));}_[_0x7dc9('0x33')](_0x5843bf[_0x7dc9('0x34')],{'createdAt':{'$gte':_0xa2aaa9[_0x7dc9('0x27')],'$lte':_0xa2aaa9[_0x7dc9('0x28')]}});}if(_0x25b383[_0x7dc9('0x26')][_0x7dc9('0x35')]){_0x5843bf[_0x7dc9('0x34')]=_[_0x7dc9('0x33')](_0x5843bf['where'],{'$or':_[_0x7dc9('0x36')](_0x5843bf[_0x7dc9('0x29')],function(_0x466b02){var _0xfd2612={};_0xfd2612[_0x466b02]={'$like':'%'+_0x25b383['query'][_0x7dc9('0x35')]+'%'};return _0xfd2612;})});}_0x5843bf=_[_0x7dc9('0x33')]({},_0x5843bf,_0x25b383[_0x7dc9('0x37')]);var _0x3876b6={'where':_0x5843bf[_0x7dc9('0x34')]};return db[_0x7dc9('0x22')]['count'](_0x3876b6)['then'](function(_0x3ef9fd){_0x47771b[_0x7dc9('0x16')]=_0x3ef9fd;if(_0x25b383['query'][_0x7dc9('0x38')]){_0x5843bf['include']=[{'all':!![]}];}return db[_0x7dc9('0x22')][_0x7dc9('0x39')](_0x5843bf);})[_0x7dc9('0x1e')](function(_0x5e056e){_0x47771b[_0x7dc9('0x3a')]=_0x5e056e;return _0x47771b;})[_0x7dc9('0x1e')](respondWithFilteredResult(_0x32d032,_0x5843bf))[_0x7dc9('0x3b')](handleError(_0x32d032,null));};exports[_0x7dc9('0x3c')]=function(_0x28ffc0,_0x23499a){var _0xc75f21={'raw':!![],'where':{'id':_0x28ffc0[_0x7dc9('0x3d')]['id']}},_0x50651c={};_0x50651c['model']=_['keys'](db[_0x7dc9('0x22')][_0x7dc9('0x23')]);_0x50651c[_0x7dc9('0x26')]=_[_0x7dc9('0x25')](_0x28ffc0[_0x7dc9('0x26')]);_0x50651c[_0x7dc9('0x30')]=_[_0x7dc9('0x2a')](_0x50651c[_0x7dc9('0x24')],_0x50651c[_0x7dc9('0x26')]);_0xc75f21['attributes']=_[_0x7dc9('0x2a')](_0x50651c[_0x7dc9('0x24')],qs[_0x7dc9('0x2b')](_0x28ffc0[_0x7dc9('0x26')][_0x7dc9('0x2b')]));_0xc75f21[_0x7dc9('0x29')]=_0xc75f21['attributes'][_0x7dc9('0x3e')]?_0xc75f21[_0x7dc9('0x29')]:_0x50651c['model'];if(_0x28ffc0[_0x7dc9('0x26')][_0x7dc9('0x38')]){_0xc75f21[_0x7dc9('0x3f')]=[{'all':!![]}];}_0xc75f21=_['merge']({},_0xc75f21,_0x28ffc0[_0x7dc9('0x37')]);return db['MailSubstatus']['find'](_0xc75f21)[_0x7dc9('0x1e')](handleEntityNotFound(_0x23499a,null))[_0x7dc9('0x1e')](respondWithResult(_0x23499a,null))[_0x7dc9('0x3b')](handleError(_0x23499a,null));};exports['create']=function(_0x4aea89,_0x415ebd){return db['MailSubstatus'][_0x7dc9('0x40')](_0x4aea89[_0x7dc9('0x41')],{})['then'](respondWithResult(_0x415ebd,0xc9))[_0x7dc9('0x3b')](handleError(_0x415ebd,null));};exports[_0x7dc9('0x1d')]=function(_0x1f2a6e,_0x154e2d){if(_0x1f2a6e[_0x7dc9('0x41')]['id']){delete _0x1f2a6e[_0x7dc9('0x41')]['id'];}return db[_0x7dc9('0x22')][_0x7dc9('0x42')]({'where':{'id':_0x1f2a6e[_0x7dc9('0x3d')]['id']}})[_0x7dc9('0x1e')](handleEntityNotFound(_0x154e2d,null))[_0x7dc9('0x1e')](saveUpdates(_0x1f2a6e[_0x7dc9('0x41')],null))[_0x7dc9('0x1e')](respondWithResult(_0x154e2d,null))['catch'](handleError(_0x154e2d,null));};exports[_0x7dc9('0x43')]=function(_0x4fcfd5,_0x57993f){return db[_0x7dc9('0x22')][_0x7dc9('0x42')]({'where':{'id':_0x4fcfd5[_0x7dc9('0x3d')]['id']}})[_0x7dc9('0x1e')](handleEntityNotFound(_0x57993f,null))[_0x7dc9('0x1e')](removeEntity(_0x57993f,null))['catch'](handleError(_0x57993f,null));};exports[_0x7dc9('0x44')]=function(_0x2b2142,_0x34f7b1){return db['MailSubstatus'][_0x7dc9('0x44')]()[_0x7dc9('0x1e')](respondWithResult(_0x34f7b1,null))[_0x7dc9('0x3b')](handleError(_0x34f7b1,null));};
\ No newline at end of file
+var _0x9c5a=['name','send','index','MailSubstatus','model','keys','query','dateStart','dateEnd','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','add','day','merge','where','filter','map','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','stack'];(function(_0x2ac0c5,_0x3cb824){var _0x376f8=function(_0x2bcaf3){while(--_0x2bcaf3){_0x2ac0c5['push'](_0x2ac0c5['shift']());}};_0x376f8(++_0x3cb824);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x138f82,_0x452da2){_0x138f82=_0x138f82-0x0;var _0x2d0dcf=_0x9c5a[_0x138f82];return _0x2d0dcf;};'use strict';var pdf=require(_0xa9c5('0x0'));var emlformat=require(_0xa9c5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa9c5('0x2'));var jsonpatch=require(_0xa9c5('0x3'));var rp=require(_0xa9c5('0x4'));var moment=require(_0xa9c5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa9c5('0x6'));var util=require(_0xa9c5('0x7'));var path=require('path');var sox=require(_0xa9c5('0x8'));var csv=require('to-csv');var ejs=require(_0xa9c5('0x9'));var fs=require('fs');var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0xa9c5('0xf'))(_0xa9c5('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xa9c5('0x11'))['db'];function respondWithStatusCode(_0x11421c,_0x45f8d8){_0x45f8d8=_0x45f8d8||0xcc;return function(_0x4b72b0){if(_0x4b72b0){return _0x11421c[_0xa9c5('0x12')](_0x45f8d8);}return _0x11421c[_0xa9c5('0x13')](_0x45f8d8)[_0xa9c5('0x14')]();};}function respondWithResult(_0x42d5cf,_0x3c5ac7){_0x3c5ac7=_0x3c5ac7||0xc8;return function(_0x1ea48){if(_0x1ea48){return _0x42d5cf['status'](_0x3c5ac7)[_0xa9c5('0x15')](_0x1ea48);}};}function respondWithFilteredResult(_0x1276d2,_0x7df76d){return function(_0x3806c4){if(_0x3806c4){var _0x418ca5=_0x3806c4[_0xa9c5('0x16')],_0x1dad66=_0x7df76d[_0xa9c5('0x17')],_0x251099=_0x7df76d['offset']+_0x7df76d[_0xa9c5('0x18')],_0x40b001;if(_0x251099>=_0x418ca5){_0x251099=_0x418ca5;_0x40b001=0xc8;}else{_0x40b001=0xce;}_0x1276d2[_0xa9c5('0x13')](_0x40b001);return _0x1276d2[_0xa9c5('0x19')]('Content-Range',_0x1dad66+'-'+_0x251099+'/'+_0x418ca5)[_0xa9c5('0x15')](_0x3806c4);}return null;};}function patchUpdates(_0x1142d9){return function(_0x2b9ac5){try{jsonpatch[_0xa9c5('0x1a')](_0x2b9ac5,_0x1142d9,!![]);}catch(_0x452a9b){return BPromise[_0xa9c5('0x1b')](_0x452a9b);}return _0x2b9ac5[_0xa9c5('0x1c')]();};}function saveUpdates(_0x1e5ce6,_0x2c7cd5){return function(_0x36c486){if(_0x36c486){return _0x36c486[_0xa9c5('0x1d')](_0x1e5ce6)[_0xa9c5('0x1e')](function(_0x54f8b9){return _0x54f8b9;});}return null;};}function removeEntity(_0x1115ad,_0x21ab50){return function(_0x541c77){if(_0x541c77){return _0x541c77['destroy']()[_0xa9c5('0x1e')](function(){_0x1115ad[_0xa9c5('0x13')](0xcc)[_0xa9c5('0x14')]();});}};}function handleEntityNotFound(_0x3b497a,_0xc0bca3){return function(_0xd4b8a1){if(!_0xd4b8a1){_0x3b497a['sendStatus'](0x194);}return _0xd4b8a1;};}function handleError(_0x4fa280,_0x3d4e1b){_0x3d4e1b=_0x3d4e1b||0x1f4;return function(_0x11d395){logger['error'](_0x11d395[_0xa9c5('0x1f')]);if(_0x11d395[_0xa9c5('0x20')]){delete _0x11d395[_0xa9c5('0x20')];}_0x4fa280[_0xa9c5('0x13')](_0x3d4e1b)[_0xa9c5('0x21')](_0x11d395);};}exports[_0xa9c5('0x22')]=function(_0xe44e6d,_0x51b64a){var _0x4e8a7f={},_0x242771={},_0x4cd5e6={'count':0x0,'rows':[]};var _0x1762ac=db[_0xa9c5('0x23')]['rawAttributes'];_0x242771[_0xa9c5('0x24')]=_[_0xa9c5('0x25')](_0x1762ac);var _0x5f468b={'dateStart':_0xe44e6d[_0xa9c5('0x26')][_0xa9c5('0x27')],'dateEnd':_0xe44e6d[_0xa9c5('0x26')][_0xa9c5('0x28')]};delete _0xe44e6d[_0xa9c5('0x26')]['dateStart'];delete _0xe44e6d[_0xa9c5('0x26')]['dateEnd'];_0x242771[_0xa9c5('0x26')]=_[_0xa9c5('0x25')](_0xe44e6d[_0xa9c5('0x26')]);_0x242771['filters']=_[_0xa9c5('0x29')](_0x242771[_0xa9c5('0x24')],_0x242771['query']);_0x4e8a7f[_0xa9c5('0x2a')]=_[_0xa9c5('0x29')](_0x242771[_0xa9c5('0x24')],qs[_0xa9c5('0x2b')](_0xe44e6d[_0xa9c5('0x26')][_0xa9c5('0x2b')]));_0x4e8a7f[_0xa9c5('0x2a')]=_0x4e8a7f['attributes'][_0xa9c5('0x2c')]?_0x4e8a7f[_0xa9c5('0x2a')]:_0x242771[_0xa9c5('0x24')];if(!_0xe44e6d[_0xa9c5('0x26')][_0xa9c5('0x2d')](_0xa9c5('0x2e'))){_0x4e8a7f[_0xa9c5('0x18')]=qs[_0xa9c5('0x18')](_0xe44e6d['query']['limit']);_0x4e8a7f[_0xa9c5('0x17')]=qs[_0xa9c5('0x17')](_0xe44e6d[_0xa9c5('0x26')][_0xa9c5('0x17')]);}_0x4e8a7f[_0xa9c5('0x2f')]=qs[_0xa9c5('0x30')](_0xe44e6d['query']['sort']);_0x4e8a7f['where']=qs[_0xa9c5('0x31')](_[_0xa9c5('0x32')](_0xe44e6d['query'],_0x242771[_0xa9c5('0x31')]));if(_0x5f468b['dateStart']){if(_0x5f468b[_0xa9c5('0x28')]){_0x5f468b[_0xa9c5('0x28')]=moment(_0x5f468b[_0xa9c5('0x28')])[_0xa9c5('0x33')](0x1,'day');}else{_0x5f468b[_0xa9c5('0x28')]=moment(_0x5f468b[_0xa9c5('0x27')])[_0xa9c5('0x33')](0x1,_0xa9c5('0x34'));}_[_0xa9c5('0x35')](_0x4e8a7f[_0xa9c5('0x36')],{'createdAt':{'$gte':_0x5f468b[_0xa9c5('0x27')],'$lte':_0x5f468b[_0xa9c5('0x28')]}});}if(_0xe44e6d['query'][_0xa9c5('0x37')]){_0x4e8a7f[_0xa9c5('0x36')]=_[_0xa9c5('0x35')](_0x4e8a7f[_0xa9c5('0x36')],{'$or':_[_0xa9c5('0x38')](_0x4e8a7f[_0xa9c5('0x2a')],function(_0x493b20){var _0x307736={};_0x307736[_0x493b20]={'$like':'%'+_0xe44e6d['query'][_0xa9c5('0x37')]+'%'};return _0x307736;})});}_0x4e8a7f=_['merge']({},_0x4e8a7f,_0xe44e6d[_0xa9c5('0x39')]);var _0xd4305d={'where':_0x4e8a7f[_0xa9c5('0x36')]};return db['MailSubstatus'][_0xa9c5('0x16')](_0xd4305d)[_0xa9c5('0x1e')](function(_0x3a2b67){_0x4cd5e6[_0xa9c5('0x16')]=_0x3a2b67;if(_0xe44e6d['query'][_0xa9c5('0x3a')]){_0x4e8a7f[_0xa9c5('0x3b')]=[{'all':!![]}];}return db[_0xa9c5('0x23')][_0xa9c5('0x3c')](_0x4e8a7f);})[_0xa9c5('0x1e')](function(_0x5dc092){_0x4cd5e6[_0xa9c5('0x3d')]=_0x5dc092;return _0x4cd5e6;})['then'](respondWithFilteredResult(_0x51b64a,_0x4e8a7f))[_0xa9c5('0x3e')](handleError(_0x51b64a,null));};exports[_0xa9c5('0x3f')]=function(_0x2998ad,_0xc8fca4){var _0xb50a5b={'raw':!![],'where':{'id':_0x2998ad[_0xa9c5('0x40')]['id']}},_0x6dc061={};_0x6dc061[_0xa9c5('0x24')]=_[_0xa9c5('0x25')](db[_0xa9c5('0x23')]['rawAttributes']);_0x6dc061[_0xa9c5('0x26')]=_[_0xa9c5('0x25')](_0x2998ad[_0xa9c5('0x26')]);_0x6dc061[_0xa9c5('0x31')]=_[_0xa9c5('0x29')](_0x6dc061[_0xa9c5('0x24')],_0x6dc061['query']);_0xb50a5b[_0xa9c5('0x2a')]=_[_0xa9c5('0x29')](_0x6dc061['model'],qs['fields'](_0x2998ad['query']['fields']));_0xb50a5b['attributes']=_0xb50a5b[_0xa9c5('0x2a')][_0xa9c5('0x2c')]?_0xb50a5b[_0xa9c5('0x2a')]:_0x6dc061[_0xa9c5('0x24')];if(_0x2998ad[_0xa9c5('0x26')][_0xa9c5('0x3a')]){_0xb50a5b[_0xa9c5('0x3b')]=[{'all':!![]}];}_0xb50a5b=_[_0xa9c5('0x35')]({},_0xb50a5b,_0x2998ad[_0xa9c5('0x39')]);return db[_0xa9c5('0x23')][_0xa9c5('0x41')](_0xb50a5b)[_0xa9c5('0x1e')](handleEntityNotFound(_0xc8fca4,null))[_0xa9c5('0x1e')](respondWithResult(_0xc8fca4,null))['catch'](handleError(_0xc8fca4,null));};exports[_0xa9c5('0x42')]=function(_0x5e17f4,_0x447335){return db[_0xa9c5('0x23')]['create'](_0x5e17f4['body'],{})[_0xa9c5('0x1e')](respondWithResult(_0x447335,0xc9))[_0xa9c5('0x3e')](handleError(_0x447335,null));};exports[_0xa9c5('0x1d')]=function(_0x4e41c7,_0x584504){if(_0x4e41c7[_0xa9c5('0x43')]['id']){delete _0x4e41c7[_0xa9c5('0x43')]['id'];}return db['MailSubstatus'][_0xa9c5('0x41')]({'where':{'id':_0x4e41c7[_0xa9c5('0x40')]['id']}})[_0xa9c5('0x1e')](handleEntityNotFound(_0x584504,null))[_0xa9c5('0x1e')](saveUpdates(_0x4e41c7[_0xa9c5('0x43')],null))[_0xa9c5('0x1e')](respondWithResult(_0x584504,null))['catch'](handleError(_0x584504,null));};exports['destroy']=function(_0x54c60c,_0x4317d8){return db[_0xa9c5('0x23')][_0xa9c5('0x41')]({'where':{'id':_0x54c60c[_0xa9c5('0x40')]['id']}})[_0xa9c5('0x1e')](handleEntityNotFound(_0x4317d8,null))[_0xa9c5('0x1e')](removeEntity(_0x4317d8,null))['catch'](handleError(_0x4317d8,null));};exports[_0xa9c5('0x44')]=function(_0xdc3fdc,_0x433a58){return db[_0xa9c5('0x23')][_0xa9c5('0x44')]()[_0xa9c5('0x1e')](respondWithResult(_0x433a58,null))['catch'](handleError(_0x433a58,null));};
\ No newline at end of file
index 1be053e..9fc725e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24e4=['moment','./mailSubstatus.attributes','exports','MailSubstatus','lodash','util','../../config/logger','api'];(function(_0x323076,_0x11fb77){var _0x4874a1=function(_0x2efa1c){while(--_0x2efa1c){_0x323076['push'](_0x323076['shift']());}};_0x4874a1(++_0x11fb77);}(_0x24e4,0x164));var _0x424e=function(_0x17b0d4,_0x377add){_0x17b0d4=_0x17b0d4-0x0;var _0x2d02c7=_0x24e4[_0x17b0d4];return _0x2d02c7;};'use strict';var _=require(_0x424e('0x0'));var util=require(_0x424e('0x1'));var logger=require(_0x424e('0x2'))(_0x424e('0x3'));var moment=require(_0x424e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x424e('0x5'));module[_0x424e('0x6')]=function(_0x50ad3a,_0x1a6650){return _0x50ad3a['define'](_0x424e('0x7'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd35c=['bluebird','request-promise','./mailSubstatus.attributes','exports','MailSubstatus','lodash','util','../../config/logger'];(function(_0x31be88,_0x5b8f93){var _0x48b2f7=function(_0x2ca030){while(--_0x2ca030){_0x31be88['push'](_0x31be88['shift']());}};_0x48b2f7(++_0x5b8f93);}(_0xd35c,0x85));var _0xcd35=function(_0x410cf3,_0x4b34b4){_0x410cf3=_0x410cf3-0x0;var _0x4ba6ef=_0xd35c[_0x410cf3];return _0x4ba6ef;};'use strict';var _=require(_0xcd35('0x0'));var util=require(_0xcd35('0x1'));var logger=require(_0xcd35('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcd35('0x3'));var rp=require(_0xcd35('0x4'));var attributes=require(_0xcd35('0x5'));module[_0xcd35('0x6')]=function(_0x27ae93,_0xe64460){return _0x27ae93['define'](_0xcd35('0x7'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d437462..82f2e77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c9d=['MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','info'];(function(_0x4defd6,_0x37bbd3){var _0x4c9276=function(_0x1d7a3d){while(--_0x1d7a3d){_0x4defd6['push'](_0x4defd6['shift']());}};_0x4c9276(++_0x37bbd3);}(_0x7c9d,0xab));var _0xd7c9=function(_0xbc8c14,_0x36e9a7){_0xbc8c14=_0xbc8c14-0x0;var _0x3c9955=_0x7c9d[_0xbc8c14];return _0x3c9955;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd7c9('0x0'));var BPromise=require(_0xd7c9('0x1'));var rs=require(_0xd7c9('0x2'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0xd7c9('0x3'));var logger=require(_0xd7c9('0x4'))('rpc');var config=require(_0xd7c9('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd7c9('0x6')][_0xd7c9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xea613,_0x236538,_0x666a71){return new BPromise(function(_0x76832d,_0x42038c){return client['request'](_0xea613,_0x666a71)['then'](function(_0x16d51c){logger[_0xd7c9('0x8')](_0xd7c9('0x9'),_0x236538,_0xd7c9('0xa'));logger[_0xd7c9('0xb')](_0xd7c9('0xc'),_0x236538,_0xd7c9('0xa'),JSON['stringify'](_0x16d51c));if(_0x16d51c['error']){if(_0x16d51c[_0xd7c9('0xd')][_0xd7c9('0xe')]===0x1f4){logger[_0xd7c9('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x236538,_0x16d51c[_0xd7c9('0xd')][_0xd7c9('0xf')]);return _0x42038c(_0x16d51c[_0xd7c9('0xd')][_0xd7c9('0xf')]);}logger[_0xd7c9('0xd')](_0xd7c9('0x9'),_0x236538,_0x16d51c[_0xd7c9('0xd')][_0xd7c9('0xf')]);return _0x76832d(_0x16d51c[_0xd7c9('0xd')]['message']);}else{logger[_0xd7c9('0x8')]('MailSubstatus,\x20%s,\x20%s',_0x236538,_0xd7c9('0xa'));_0x76832d(_0x16d51c[_0xd7c9('0x10')][_0xd7c9('0xf')]);}})[_0xd7c9('0x11')](function(_0x2c81f0){logger['error'](_0xd7c9('0x9'),_0x236538,_0x2c81f0);_0x42038c(_0x2c81f0);});});}
\ No newline at end of file
+var _0x8ea4=['message','result','lodash','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x8ea4,0x1b2));var _0x48ea=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0x8ea4[_0x296897];return _0x2b44ab;};'use strict';var _=require(_0x48ea('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x48ea('0x1'));var rs=require(_0x48ea('0x2'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x48ea('0x3'));var config=require(_0x48ea('0x4'));var jayson=require(_0x48ea('0x5'));var client=jayson[_0x48ea('0x6')][_0x48ea('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2c4d02,_0x2e53db,_0xa69a16){return new BPromise(function(_0x23261b,_0x7793be){return client[_0x48ea('0x8')](_0x2c4d02,_0xa69a16)['then'](function(_0x573d24){logger[_0x48ea('0x9')](_0x48ea('0xa'),_0x2e53db,_0x48ea('0xb'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x2e53db,_0x48ea('0xb'),JSON['stringify'](_0x573d24));if(_0x573d24[_0x48ea('0xc')]){if(_0x573d24['error'][_0x48ea('0xd')]===0x1f4){logger[_0x48ea('0xc')](_0x48ea('0xa'),_0x2e53db,_0x573d24[_0x48ea('0xc')]['message']);return _0x7793be(_0x573d24[_0x48ea('0xc')]['message']);}logger['error'](_0x48ea('0xa'),_0x2e53db,_0x573d24[_0x48ea('0xc')][_0x48ea('0xe')]);return _0x23261b(_0x573d24['error']['message']);}else{logger[_0x48ea('0x9')](_0x48ea('0xa'),_0x2e53db,_0x48ea('0xb'));_0x23261b(_0x573d24[_0x48ea('0xf')]['message']);}})['catch'](function(_0x4960f0){logger[_0x48ea('0xc')](_0x48ea('0xa'),_0x2e53db,_0x4960f0);_0x7793be(_0x4960f0);});});}
\ No newline at end of file
index 05e2efb..8b7d03d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27a9=['/describe','/:id','show','post','create','put','delete','destroy','util','express','Router','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index'];(function(_0x5e04cd,_0x8af945){var _0x40ace=function(_0x5d8d9b){while(--_0x5d8d9b){_0x5e04cd['push'](_0x5e04cd['shift']());}};_0x40ace(++_0x8af945);}(_0x27a9,0xd4));var _0x927a=function(_0x1a3feb,_0x26f810){_0x1a3feb=_0x1a3feb-0x0;var _0x4f6ce0=_0x27a9[_0x1a3feb];return _0x4f6ce0;};'use strict';var multer=require('multer');var util=require(_0x927a('0x0'));var path=require('path');var express=require(_0x927a('0x1'));var router=express[_0x927a('0x2')]();var auth=require(_0x927a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x927a('0x4'));var controller=require(_0x927a('0x5'));router[_0x927a('0x6')]('/',auth[_0x927a('0x7')](),controller[_0x927a('0x8')]);router[_0x927a('0x6')](_0x927a('0x9'),auth[_0x927a('0x7')](),controller['describe']);router[_0x927a('0x6')](_0x927a('0xa'),auth[_0x927a('0x7')](),controller[_0x927a('0xb')]);router[_0x927a('0xc')]('/',auth['isAuthenticated'](),controller[_0x927a('0xd')]);router[_0x927a('0xe')](_0x927a('0xa'),auth[_0x927a('0x7')](),controller['update']);router[_0x927a('0xf')](_0x927a('0xa'),auth[_0x927a('0x7')](),controller[_0x927a('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x5c6b=['destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c6b,0x158));var _0xb5c6=function(_0x1cb44f,_0x38fd40){_0x1cb44f=_0x1cb44f-0x0;var _0x92126d=_0x5c6b[_0x1cb44f];return _0x92126d;};'use strict';var multer=require(_0xb5c6('0x0'));var util=require(_0xb5c6('0x1'));var path=require(_0xb5c6('0x2'));var express=require(_0xb5c6('0x3'));var router=express['Router']();var auth=require(_0xb5c6('0x4'));var interaction=require(_0xb5c6('0x5'));var config=require('../../config/environment');var controller=require(_0xb5c6('0x6'));router[_0xb5c6('0x7')]('/',auth[_0xb5c6('0x8')](),controller[_0xb5c6('0x9')]);router['get']('/describe',auth[_0xb5c6('0x8')](),controller[_0xb5c6('0xa')]);router[_0xb5c6('0x7')](_0xb5c6('0xb'),auth[_0xb5c6('0x8')](),controller[_0xb5c6('0xc')]);router['post']('/',auth[_0xb5c6('0x8')](),controller[_0xb5c6('0xd')]);router[_0xb5c6('0xe')](_0xb5c6('0xb'),auth[_0xb5c6('0x8')](),controller[_0xb5c6('0xf')]);router[_0xb5c6('0x10')](_0xb5c6('0xb'),auth[_0xb5c6('0x8')](),controller[_0xb5c6('0x11')]);module[_0xb5c6('0x12')]=router;
\ No newline at end of file
index beb7f05..63e0037 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf523=['sequelize','STRING','agent','queue','DATE','moment'];(function(_0x6d070a,_0x47e825){var _0x2c065d=function(_0xd0565c){while(--_0xd0565c){_0x6d070a['push'](_0x6d070a['shift']());}};_0x2c065d(++_0x47e825);}(_0xf523,0x9b));var _0x3f52=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf523[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x3f52('0x0'));var Sequelize=require(_0x3f52('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x3f52('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x3f52('0x3'),_0x3f52('0x4')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x3f52('0x5')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x516b=['moment','exports','STRING','ENUM','agent','queue'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x516b,0xcc));var _0xb516=function(_0x8dfe5a,_0x427507){_0x8dfe5a=_0x8dfe5a-0x0;var _0x1624bc=_0x516b[_0x8dfe5a];return _0x1624bc;};'use strict';var moment=require(_0xb516('0x0'));var Sequelize=require('sequelize');module[_0xb516('0x1')]={'uniqueid':{'type':Sequelize[_0xb516('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb516('0x3')]('account',_0xb516('0x4'),_0xb516('0x5')),'allowNull':![],'defaultValue':_0xb516('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
index 337ed41..5222d59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89bf=['params','includeAll','find','body','destroy','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','json','apply','save','then','error','stack','name','index','MailTransferReport','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','day','add','merge','where','filter','options','count','include','findAll','catch'];(function(_0x147bf4,_0x2c2eca){var _0x2910ef=function(_0x50dc2d){while(--_0x50dc2d){_0x147bf4['push'](_0x147bf4['shift']());}};_0x2910ef(++_0x2c2eca);}(_0x89bf,0x112));var _0xf89b=function(_0x1a2c2a,_0x2e1368){_0x1a2c2a=_0x1a2c2a-0x0;var _0x5f3358=_0x89bf[_0x1a2c2a];return _0x5f3358;};'use strict';var pdf=require(_0xf89b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf89b('0x1'));var zipdir=require(_0xf89b('0x2'));var jsonpatch=require(_0xf89b('0x3'));var rp=require('request-promise');var moment=require(_0xf89b('0x4'));var BPromise=require(_0xf89b('0x5'));var Mustache=require(_0xf89b('0x6'));var util=require(_0xf89b('0x7'));var path=require(_0xf89b('0x8'));var sox=require('sox');var csv=require(_0xf89b('0x9'));var ejs=require(_0xf89b('0xa'));var fs=require('fs');var _=require(_0xf89b('0xb'));var squel=require('squel');var crypto=require(_0xf89b('0xc'));var jsforce=require(_0xf89b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf89b('0x9'));var querystring=require(_0xf89b('0xe'));var Papa=require('papaparse');var qs=require(_0xf89b('0xf'));var logger=require(_0xf89b('0x10'))('api');var utils=require(_0xf89b('0x11'));var config=require(_0xf89b('0x12'));var db=require(_0xf89b('0x13'))['db'];function respondWithStatusCode(_0xb67058,_0x38eec4){_0x38eec4=_0x38eec4||0xcc;return function(_0x81b09b){if(_0x81b09b){return _0xb67058[_0xf89b('0x14')](_0x38eec4);}return _0xb67058[_0xf89b('0x15')](_0x38eec4)[_0xf89b('0x16')]();};}function respondWithResult(_0x9b8fa2,_0x44fac3){_0x44fac3=_0x44fac3||0xc8;return function(_0x9a5f0b){if(_0x9a5f0b){return _0x9b8fa2[_0xf89b('0x15')](_0x44fac3)['json'](_0x9a5f0b);}};}function respondWithFilteredResult(_0x25ae8c,_0x80b132){return function(_0x2ca779){if(_0x2ca779){var _0x5a4bde=_0x2ca779['count'],_0x47b837=_0x80b132[_0xf89b('0x17')],_0x4e61c5=_0x80b132[_0xf89b('0x17')]+_0x80b132['limit'],_0x4283ee;if(_0x4e61c5>=_0x5a4bde){_0x4e61c5=_0x5a4bde;_0x4283ee=0xc8;}else{_0x4283ee=0xce;}_0x25ae8c[_0xf89b('0x15')](_0x4283ee);return _0x25ae8c[_0xf89b('0x18')](_0xf89b('0x19'),_0x47b837+'-'+_0x4e61c5+'/'+_0x5a4bde)[_0xf89b('0x1a')](_0x2ca779);}return null;};}function patchUpdates(_0x161d7a){return function(_0x293cb1){try{jsonpatch[_0xf89b('0x1b')](_0x293cb1,_0x161d7a,!![]);}catch(_0x251e48){return BPromise['reject'](_0x251e48);}return _0x293cb1[_0xf89b('0x1c')]();};}function saveUpdates(_0x11886c,_0x1583ab){return function(_0x43c862){if(_0x43c862){return _0x43c862['update'](_0x11886c)['then'](function(_0x379f71){return _0x379f71;});}return null;};}function removeEntity(_0x239c6e,_0x369e9d){return function(_0x1cabb5){if(_0x1cabb5){return _0x1cabb5['destroy']()[_0xf89b('0x1d')](function(){_0x239c6e[_0xf89b('0x15')](0xcc)[_0xf89b('0x16')]();});}};}function handleEntityNotFound(_0x3af008,_0x527d77){return function(_0x50f3d0){if(!_0x50f3d0){_0x3af008['sendStatus'](0x194);}return _0x50f3d0;};}function handleError(_0x36ea24,_0x340f01){_0x340f01=_0x340f01||0x1f4;return function(_0x887111){logger[_0xf89b('0x1e')](_0x887111[_0xf89b('0x1f')]);if(_0x887111[_0xf89b('0x20')]){delete _0x887111[_0xf89b('0x20')];}_0x36ea24[_0xf89b('0x15')](_0x340f01)['send'](_0x887111);};}exports[_0xf89b('0x21')]=function(_0x577ca7,_0x1126d3){var _0x1fab8f={},_0x47fe59={},_0x2d3c62={'count':0x0,'rows':[]};var _0x378eba=db[_0xf89b('0x22')][_0xf89b('0x23')];_0x47fe59[_0xf89b('0x24')]=_[_0xf89b('0x25')](_0x378eba);var _0x48ef2a={'dateStart':_0x577ca7[_0xf89b('0x26')][_0xf89b('0x27')],'dateEnd':_0x577ca7[_0xf89b('0x26')][_0xf89b('0x28')]};delete _0x577ca7[_0xf89b('0x26')]['dateStart'];delete _0x577ca7[_0xf89b('0x26')]['dateEnd'];_0x47fe59[_0xf89b('0x26')]=_[_0xf89b('0x25')](_0x577ca7['query']);_0x47fe59[_0xf89b('0x29')]=_[_0xf89b('0x2a')](_0x47fe59['model'],_0x47fe59[_0xf89b('0x26')]);_0x1fab8f[_0xf89b('0x2b')]=_[_0xf89b('0x2a')](_0x47fe59['model'],qs[_0xf89b('0x2c')](_0x577ca7['query']['fields']));_0x1fab8f[_0xf89b('0x2b')]=_0x1fab8f[_0xf89b('0x2b')][_0xf89b('0x2d')]?_0x1fab8f['attributes']:_0x47fe59[_0xf89b('0x24')];if(!_0x577ca7['query'][_0xf89b('0x2e')]('nolimit')){_0x1fab8f[_0xf89b('0x2f')]=qs[_0xf89b('0x2f')](_0x577ca7[_0xf89b('0x26')][_0xf89b('0x2f')]);_0x1fab8f[_0xf89b('0x17')]=qs[_0xf89b('0x17')](_0x577ca7['query'][_0xf89b('0x17')]);}_0x1fab8f[_0xf89b('0x30')]=qs[_0xf89b('0x31')](_0x577ca7[_0xf89b('0x26')][_0xf89b('0x31')]);_0x1fab8f['where']=qs[_0xf89b('0x29')](_[_0xf89b('0x32')](_0x577ca7[_0xf89b('0x26')],_0x47fe59[_0xf89b('0x29')]));if(_0x48ef2a[_0xf89b('0x27')]){if(_0x48ef2a[_0xf89b('0x28')]){_0x48ef2a['dateEnd']=moment(_0x48ef2a[_0xf89b('0x28')])['add'](0x1,_0xf89b('0x33'));}else{_0x48ef2a[_0xf89b('0x28')]=moment(_0x48ef2a[_0xf89b('0x27')])[_0xf89b('0x34')](0x1,_0xf89b('0x33'));}_[_0xf89b('0x35')](_0x1fab8f[_0xf89b('0x36')],{'createdAt':{'$gte':_0x48ef2a[_0xf89b('0x27')],'$lte':_0x48ef2a['dateEnd']}});}if(_0x577ca7[_0xf89b('0x26')][_0xf89b('0x37')]){_0x1fab8f[_0xf89b('0x36')]=_[_0xf89b('0x35')](_0x1fab8f[_0xf89b('0x36')],{'$or':_['map'](_0x1fab8f[_0xf89b('0x2b')],function(_0x430610){var _0x5d7684={};_0x5d7684[_0x430610]={'$like':'%'+_0x577ca7['query']['filter']+'%'};return _0x5d7684;})});}_0x1fab8f=_[_0xf89b('0x35')]({},_0x1fab8f,_0x577ca7[_0xf89b('0x38')]);var _0x45dc6d={'where':_0x1fab8f['where']};return db[_0xf89b('0x22')][_0xf89b('0x39')](_0x45dc6d)[_0xf89b('0x1d')](function(_0x4680f4){_0x2d3c62[_0xf89b('0x39')]=_0x4680f4;if(_0x577ca7[_0xf89b('0x26')]['includeAll']){_0x1fab8f[_0xf89b('0x3a')]=[{'all':!![]}];}return db['MailTransferReport'][_0xf89b('0x3b')](_0x1fab8f);})[_0xf89b('0x1d')](function(_0x1652f2){_0x2d3c62['rows']=_0x1652f2;return _0x2d3c62;})[_0xf89b('0x1d')](respondWithFilteredResult(_0x1126d3,_0x1fab8f))[_0xf89b('0x3c')](handleError(_0x1126d3,null));};exports['show']=function(_0x59ccb7,_0x30db56){var _0x55fb0a={'raw':!![],'where':{'id':_0x59ccb7[_0xf89b('0x3d')]['id']}},_0x26ed6e={};_0x26ed6e[_0xf89b('0x24')]=_[_0xf89b('0x25')](db['MailTransferReport'][_0xf89b('0x23')]);_0x26ed6e[_0xf89b('0x26')]=_[_0xf89b('0x25')](_0x59ccb7[_0xf89b('0x26')]);_0x26ed6e[_0xf89b('0x29')]=_[_0xf89b('0x2a')](_0x26ed6e['model'],_0x26ed6e[_0xf89b('0x26')]);_0x55fb0a[_0xf89b('0x2b')]=_[_0xf89b('0x2a')](_0x26ed6e[_0xf89b('0x24')],qs[_0xf89b('0x2c')](_0x59ccb7['query'][_0xf89b('0x2c')]));_0x55fb0a[_0xf89b('0x2b')]=_0x55fb0a[_0xf89b('0x2b')][_0xf89b('0x2d')]?_0x55fb0a['attributes']:_0x26ed6e[_0xf89b('0x24')];if(_0x59ccb7[_0xf89b('0x26')][_0xf89b('0x3e')]){_0x55fb0a[_0xf89b('0x3a')]=[{'all':!![]}];}_0x55fb0a=_[_0xf89b('0x35')]({},_0x55fb0a,_0x59ccb7['options']);return db['MailTransferReport'][_0xf89b('0x3f')](_0x55fb0a)[_0xf89b('0x1d')](handleEntityNotFound(_0x30db56,null))[_0xf89b('0x1d')](respondWithResult(_0x30db56,null))[_0xf89b('0x3c')](handleError(_0x30db56,null));};exports['create']=function(_0x46b875,_0x4459d9){return db['MailTransferReport']['create'](_0x46b875[_0xf89b('0x40')],{})[_0xf89b('0x1d')](respondWithResult(_0x4459d9,0xc9))['catch'](handleError(_0x4459d9,null));};exports['update']=function(_0x161b49,_0x11b951){if(_0x161b49[_0xf89b('0x40')]['id']){delete _0x161b49['body']['id'];}return db[_0xf89b('0x22')][_0xf89b('0x3f')]({'where':{'id':_0x161b49[_0xf89b('0x3d')]['id']}})[_0xf89b('0x1d')](handleEntityNotFound(_0x11b951,null))[_0xf89b('0x1d')](saveUpdates(_0x161b49[_0xf89b('0x40')],null))[_0xf89b('0x1d')](respondWithResult(_0x11b951,null))[_0xf89b('0x3c')](handleError(_0x11b951,null));};exports[_0xf89b('0x41')]=function(_0x35de2b,_0x278c8d){return db[_0xf89b('0x22')][_0xf89b('0x3f')]({'where':{'id':_0x35de2b['params']['id']}})[_0xf89b('0x1d')](handleEntityNotFound(_0x278c8d,null))[_0xf89b('0x1d')](removeEntity(_0x278c8d,null))['catch'](handleError(_0x278c8d,null));};exports[_0xf89b('0x42')]=function(_0x325169,_0x50d59a){return db['MailTransferReport']['describe']()[_0xf89b('0x1d')](respondWithResult(_0x50d59a,null))[_0xf89b('0x3c')](handleError(_0x50d59a,null));};
\ No newline at end of file
+var _0x114d=['error','stack','name','send','MailTransferReport','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','add','day','merge','where','filter','options','count','then','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','set','apply','reject','save','update','destroy'];(function(_0x318821,_0xf6bbe8){var _0x3bc279=function(_0x111f2e){while(--_0x111f2e){_0x318821['push'](_0x318821['shift']());}};_0x3bc279(++_0xf6bbe8);}(_0x114d,0x144));var _0xd114=function(_0x192a27,_0x220085){_0x192a27=_0x192a27-0x0;var _0x24f7e2=_0x114d[_0x192a27];return _0x24f7e2;};'use strict';var pdf=require(_0xd114('0x0'));var emlformat=require(_0xd114('0x1'));var rimraf=require(_0xd114('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd114('0x3'));var rp=require(_0xd114('0x4'));var moment=require(_0xd114('0x5'));var BPromise=require(_0xd114('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd114('0x7'));var sox=require(_0xd114('0x8'));var csv=require(_0xd114('0x9'));var ejs=require(_0xd114('0xa'));var fs=require('fs');var _=require(_0xd114('0xb'));var squel=require(_0xd114('0xc'));var crypto=require(_0xd114('0xd'));var jsforce=require(_0xd114('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd114('0x9'));var querystring=require(_0xd114('0xf'));var Papa=require(_0xd114('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xd114('0x11'))('api');var utils=require(_0xd114('0x12'));var config=require(_0xd114('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4af44b,_0xa43589){_0xa43589=_0xa43589||0xcc;return function(_0x58e974){if(_0x58e974){return _0x4af44b[_0xd114('0x14')](_0xa43589);}return _0x4af44b['status'](_0xa43589)[_0xd114('0x15')]();};}function respondWithResult(_0x8efade,_0x42ddb1){_0x42ddb1=_0x42ddb1||0xc8;return function(_0x38ade0){if(_0x38ade0){return _0x8efade[_0xd114('0x16')](_0x42ddb1)[_0xd114('0x17')](_0x38ade0);}};}function respondWithFilteredResult(_0x450a15,_0x4bc0fc){return function(_0x453c1f){if(_0x453c1f){var _0x41d32e=_0x453c1f['count'],_0x4b701f=_0x4bc0fc[_0xd114('0x18')],_0x43f342=_0x4bc0fc[_0xd114('0x18')]+_0x4bc0fc['limit'],_0x5e4260;if(_0x43f342>=_0x41d32e){_0x43f342=_0x41d32e;_0x5e4260=0xc8;}else{_0x5e4260=0xce;}_0x450a15[_0xd114('0x16')](_0x5e4260);return _0x450a15[_0xd114('0x19')]('Content-Range',_0x4b701f+'-'+_0x43f342+'/'+_0x41d32e)[_0xd114('0x17')](_0x453c1f);}return null;};}function patchUpdates(_0x2d4e8a){return function(_0x3a8501){try{jsonpatch[_0xd114('0x1a')](_0x3a8501,_0x2d4e8a,!![]);}catch(_0x4aff61){return BPromise[_0xd114('0x1b')](_0x4aff61);}return _0x3a8501[_0xd114('0x1c')]();};}function saveUpdates(_0x482c31,_0xb86b83){return function(_0x22341c){if(_0x22341c){return _0x22341c[_0xd114('0x1d')](_0x482c31)['then'](function(_0x1ca546){return _0x1ca546;});}return null;};}function removeEntity(_0x19160e,_0x55f558){return function(_0x29cd0a){if(_0x29cd0a){return _0x29cd0a[_0xd114('0x1e')]()['then'](function(){_0x19160e['status'](0xcc)[_0xd114('0x15')]();});}};}function handleEntityNotFound(_0x3dea75,_0x4dd2da){return function(_0x4adf1e){if(!_0x4adf1e){_0x3dea75[_0xd114('0x14')](0x194);}return _0x4adf1e;};}function handleError(_0x284743,_0x1f596d){_0x1f596d=_0x1f596d||0x1f4;return function(_0x45faae){logger[_0xd114('0x1f')](_0x45faae[_0xd114('0x20')]);if(_0x45faae[_0xd114('0x21')]){delete _0x45faae[_0xd114('0x21')];}_0x284743[_0xd114('0x16')](_0x1f596d)[_0xd114('0x22')](_0x45faae);};}exports['index']=function(_0x16e4ae,_0x5ac87a){var _0xa60a00={},_0x2534c8={},_0x431762={'count':0x0,'rows':[]};var _0x3dde46=db[_0xd114('0x23')][_0xd114('0x24')];_0x2534c8[_0xd114('0x25')]=_[_0xd114('0x26')](_0x3dde46);var _0x335d73={'dateStart':_0x16e4ae[_0xd114('0x27')][_0xd114('0x28')],'dateEnd':_0x16e4ae['query']['dateEnd']};delete _0x16e4ae['query'][_0xd114('0x28')];delete _0x16e4ae['query'][_0xd114('0x29')];_0x2534c8[_0xd114('0x27')]=_[_0xd114('0x26')](_0x16e4ae[_0xd114('0x27')]);_0x2534c8[_0xd114('0x2a')]=_[_0xd114('0x2b')](_0x2534c8['model'],_0x2534c8[_0xd114('0x27')]);_0xa60a00[_0xd114('0x2c')]=_[_0xd114('0x2b')](_0x2534c8['model'],qs['fields'](_0x16e4ae[_0xd114('0x27')][_0xd114('0x2d')]));_0xa60a00[_0xd114('0x2c')]=_0xa60a00[_0xd114('0x2c')][_0xd114('0x2e')]?_0xa60a00[_0xd114('0x2c')]:_0x2534c8[_0xd114('0x25')];if(!_0x16e4ae[_0xd114('0x27')][_0xd114('0x2f')](_0xd114('0x30'))){_0xa60a00[_0xd114('0x31')]=qs[_0xd114('0x31')](_0x16e4ae[_0xd114('0x27')][_0xd114('0x31')]);_0xa60a00[_0xd114('0x18')]=qs['offset'](_0x16e4ae[_0xd114('0x27')][_0xd114('0x18')]);}_0xa60a00['order']=qs[_0xd114('0x32')](_0x16e4ae[_0xd114('0x27')][_0xd114('0x32')]);_0xa60a00['where']=qs[_0xd114('0x2a')](_[_0xd114('0x33')](_0x16e4ae['query'],_0x2534c8[_0xd114('0x2a')]));if(_0x335d73[_0xd114('0x28')]){if(_0x335d73[_0xd114('0x29')]){_0x335d73[_0xd114('0x29')]=moment(_0x335d73[_0xd114('0x29')])[_0xd114('0x34')](0x1,_0xd114('0x35'));}else{_0x335d73[_0xd114('0x29')]=moment(_0x335d73['dateStart'])[_0xd114('0x34')](0x1,_0xd114('0x35'));}_[_0xd114('0x36')](_0xa60a00[_0xd114('0x37')],{'createdAt':{'$gte':_0x335d73[_0xd114('0x28')],'$lte':_0x335d73[_0xd114('0x29')]}});}if(_0x16e4ae[_0xd114('0x27')][_0xd114('0x38')]){_0xa60a00['where']=_[_0xd114('0x36')](_0xa60a00[_0xd114('0x37')],{'$or':_['map'](_0xa60a00[_0xd114('0x2c')],function(_0x1603bc){var _0x3682dd={};_0x3682dd[_0x1603bc]={'$like':'%'+_0x16e4ae[_0xd114('0x27')][_0xd114('0x38')]+'%'};return _0x3682dd;})});}_0xa60a00=_[_0xd114('0x36')]({},_0xa60a00,_0x16e4ae[_0xd114('0x39')]);var _0x5c2cbb={'where':_0xa60a00['where']};return db[_0xd114('0x23')][_0xd114('0x3a')](_0x5c2cbb)[_0xd114('0x3b')](function(_0x1e6952){_0x431762[_0xd114('0x3a')]=_0x1e6952;if(_0x16e4ae[_0xd114('0x27')][_0xd114('0x3c')]){_0xa60a00['include']=[{'all':!![]}];}return db[_0xd114('0x23')][_0xd114('0x3d')](_0xa60a00);})[_0xd114('0x3b')](function(_0x38ae70){_0x431762[_0xd114('0x3e')]=_0x38ae70;return _0x431762;})['then'](respondWithFilteredResult(_0x5ac87a,_0xa60a00))[_0xd114('0x3f')](handleError(_0x5ac87a,null));};exports[_0xd114('0x40')]=function(_0x4a1bb7,_0x883dc1){var _0x532170={'raw':!![],'where':{'id':_0x4a1bb7[_0xd114('0x41')]['id']}},_0x15a111={};_0x15a111['model']=_[_0xd114('0x26')](db[_0xd114('0x23')][_0xd114('0x24')]);_0x15a111[_0xd114('0x27')]=_[_0xd114('0x26')](_0x4a1bb7[_0xd114('0x27')]);_0x15a111['filters']=_[_0xd114('0x2b')](_0x15a111[_0xd114('0x25')],_0x15a111[_0xd114('0x27')]);_0x532170[_0xd114('0x2c')]=_[_0xd114('0x2b')](_0x15a111[_0xd114('0x25')],qs[_0xd114('0x2d')](_0x4a1bb7[_0xd114('0x27')]['fields']));_0x532170[_0xd114('0x2c')]=_0x532170[_0xd114('0x2c')][_0xd114('0x2e')]?_0x532170['attributes']:_0x15a111[_0xd114('0x25')];if(_0x4a1bb7[_0xd114('0x27')][_0xd114('0x3c')]){_0x532170[_0xd114('0x42')]=[{'all':!![]}];}_0x532170=_['merge']({},_0x532170,_0x4a1bb7['options']);return db[_0xd114('0x23')][_0xd114('0x43')](_0x532170)[_0xd114('0x3b')](handleEntityNotFound(_0x883dc1,null))['then'](respondWithResult(_0x883dc1,null))[_0xd114('0x3f')](handleError(_0x883dc1,null));};exports[_0xd114('0x44')]=function(_0x582b62,_0x26b501){return db[_0xd114('0x23')][_0xd114('0x44')](_0x582b62['body'],{})['then'](respondWithResult(_0x26b501,0xc9))['catch'](handleError(_0x26b501,null));};exports[_0xd114('0x1d')]=function(_0x13cb99,_0x5c2db5){if(_0x13cb99[_0xd114('0x45')]['id']){delete _0x13cb99[_0xd114('0x45')]['id'];}return db[_0xd114('0x23')][_0xd114('0x43')]({'where':{'id':_0x13cb99['params']['id']}})[_0xd114('0x3b')](handleEntityNotFound(_0x5c2db5,null))[_0xd114('0x3b')](saveUpdates(_0x13cb99[_0xd114('0x45')],null))[_0xd114('0x3b')](respondWithResult(_0x5c2db5,null))[_0xd114('0x3f')](handleError(_0x5c2db5,null));};exports['destroy']=function(_0xa96df7,_0x407c24){return db[_0xd114('0x23')][_0xd114('0x43')]({'where':{'id':_0xa96df7['params']['id']}})[_0xd114('0x3b')](handleEntityNotFound(_0x407c24,null))[_0xd114('0x3b')](removeEntity(_0x407c24,null))[_0xd114('0x3f')](handleError(_0x407c24,null));};exports[_0xd114('0x46')]=function(_0x56024f,_0xad04d0){return db[_0xd114('0x23')][_0xd114('0x46')]()[_0xd114('0x3b')](respondWithResult(_0xad04d0,null))[_0xd114('0x3f')](handleError(_0xad04d0,null));};
\ No newline at end of file
index e9c8ddc..42b2950 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2567=['exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./mailTransferReport.attributes'];(function(_0x36a8dd,_0x18263b){var _0x306e43=function(_0xe899c0){while(--_0xe899c0){_0x36a8dd['push'](_0x36a8dd['shift']());}};_0x306e43(++_0x18263b);}(_0x2567,0x14a));var _0x7256=function(_0x15e17c,_0x39f6c8){_0x15e17c=_0x15e17c-0x0;var _0x55d8c7=_0x2567[_0x15e17c];return _0x55d8c7;};'use strict';var _=require(_0x7256('0x0'));var util=require(_0x7256('0x1'));var logger=require(_0x7256('0x2'))(_0x7256('0x3'));var moment=require(_0x7256('0x4'));var BPromise=require(_0x7256('0x5'));var rp=require(_0x7256('0x6'));var attributes=require(_0x7256('0x7'));module[_0x7256('0x8')]=function(_0x35afdb,_0x3e55d6){return _0x35afdb[_0x7256('0x9')](_0x7256('0xa'),attributes,{'tableName':_0x7256('0xb'),'paranoid':![],'indexes':[{'name':_0x7256('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc9b=['exports','define','MailTransferReport','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x19921b,_0x5c0c2d){var _0x273545=function(_0x387462){while(--_0x387462){_0x19921b['push'](_0x19921b['shift']());}};_0x273545(++_0x5c0c2d);}(_0xdc9b,0x70));var _0xbdc9=function(_0x5d8ab4,_0x4eff0a){_0x5d8ab4=_0x5d8ab4-0x0;var _0x490857=_0xdc9b[_0x5d8ab4];return _0x490857;};'use strict';var _=require(_0xbdc9('0x0'));var util=require(_0xbdc9('0x1'));var logger=require(_0xbdc9('0x2'))('api');var moment=require(_0xbdc9('0x3'));var BPromise=require(_0xbdc9('0x4'));var rp=require('request-promise');var attributes=require('./mailTransferReport.attributes');module[_0xbdc9('0x5')]=function(_0x28fa82,_0x599fd5){return _0x28fa82[_0xbdc9('0x6')](_0xbdc9('0x7'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xbdc9('0x8'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 0b7d75e..4fe60fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x365e=['info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','http','then'];(function(_0xa646c5,_0x5167d5){var _0xd9f07e=function(_0x148a02){while(--_0x148a02){_0xa646c5['push'](_0xa646c5['shift']());}};_0xd9f07e(++_0x5167d5);}(_0x365e,0x74));var _0xe365=function(_0x2d057b,_0x81d764){_0x2d057b=_0x2d057b-0x0;var _0x521095=_0x365e[_0x2d057b];return _0x521095;};'use strict';var _=require(_0xe365('0x0'));var util=require(_0xe365('0x1'));var moment=require(_0xe365('0x2'));var BPromise=require(_0xe365('0x3'));var rs=require('randomstring');var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0xe365('0x4'));var logger=require('../../config/logger')(_0xe365('0x5'));var config=require(_0xe365('0x6'));var jayson=require(_0xe365('0x7'));var client=jayson['client'][_0xe365('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39ba5c,_0x4d4884,_0x3a9e29){return new BPromise(function(_0x173190,_0x2fc8b4){return client['request'](_0x39ba5c,_0x3a9e29)[_0xe365('0x9')](function(_0x51d95d){logger[_0xe365('0xa')](_0xe365('0xb'),_0x4d4884,_0xe365('0xc'));logger[_0xe365('0xd')](_0xe365('0xe'),_0x4d4884,_0xe365('0xc'),JSON[_0xe365('0xf')](_0x51d95d));if(_0x51d95d['error']){if(_0x51d95d['error'][_0xe365('0x10')]===0x1f4){logger[_0xe365('0x11')](_0xe365('0xb'),_0x4d4884,_0x51d95d[_0xe365('0x11')]['message']);return _0x2fc8b4(_0x51d95d[_0xe365('0x11')]['message']);}logger[_0xe365('0x11')](_0xe365('0xb'),_0x4d4884,_0x51d95d[_0xe365('0x11')]['message']);return _0x173190(_0x51d95d['error'][_0xe365('0x12')]);}else{logger[_0xe365('0xa')](_0xe365('0xb'),_0x4d4884,_0xe365('0xc'));_0x173190(_0x51d95d[_0xe365('0x13')]['message']);}})[_0xe365('0x14')](function(_0x573396){logger[_0xe365('0x11')](_0xe365('0xb'),_0x4d4884,_0x573396);_0x2fc8b4(_0x573396);});});}
\ No newline at end of file
+var _0x6519=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','MailTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3ba92e,_0x2fdc87){var _0x47c1ee=function(_0x580b45){while(--_0x580b45){_0x3ba92e['push'](_0x3ba92e['shift']());}};_0x47c1ee(++_0x2fdc87);}(_0x6519,0xcd));var _0x9651=function(_0x1113d9,_0x52cd99){_0x1113d9=_0x1113d9-0x0;var _0x4a5aa2=_0x6519[_0x1113d9];return _0x4a5aa2;};'use strict';var _=require(_0x9651('0x0'));var util=require(_0x9651('0x1'));var moment=require(_0x9651('0x2'));var BPromise=require(_0x9651('0x3'));var rs=require(_0x9651('0x4'));var fs=require('fs');var db=require(_0x9651('0x5'))['db'];var utils=require(_0x9651('0x6'));var logger=require('../../config/logger')(_0x9651('0x7'));var config=require(_0x9651('0x8'));var jayson=require(_0x9651('0x9'));var client=jayson[_0x9651('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e3cf8,_0xdb75fb,_0xb8b514){return new BPromise(function(_0x152592,_0x45ace4){return client[_0x9651('0xb')](_0x4e3cf8,_0xb8b514)['then'](function(_0x57c4b0){logger[_0x9651('0xc')]('MailTransferReport,\x20%s,\x20%s',_0xdb75fb,_0x9651('0xd'));logger['debug'](_0x9651('0xe'),_0xdb75fb,_0x9651('0xd'),JSON[_0x9651('0xf')](_0x57c4b0));if(_0x57c4b0[_0x9651('0x10')]){if(_0x57c4b0[_0x9651('0x10')]['code']===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0xdb75fb,_0x57c4b0[_0x9651('0x10')][_0x9651('0x11')]);return _0x45ace4(_0x57c4b0['error'][_0x9651('0x11')]);}logger[_0x9651('0x10')](_0x9651('0x12'),_0xdb75fb,_0x57c4b0[_0x9651('0x10')]['message']);return _0x152592(_0x57c4b0[_0x9651('0x10')][_0x9651('0x11')]);}else{logger['info'](_0x9651('0x12'),_0xdb75fb,_0x9651('0xd'));_0x152592(_0x57c4b0[_0x9651('0x13')][_0x9651('0x11')]);}})[_0x9651('0x14')](function(_0x15493c){logger[_0x9651('0x10')](_0x9651('0x12'),_0xdb75fb,_0x15493c);_0x45ace4(_0x15493c);});});}
\ No newline at end of file
index aabaf7d..46d4479 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f35=['/:id','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','get','show','post','put'];(function(_0x50d5a3,_0x9972d9){var _0x5f90a5=function(_0x44a5c6){while(--_0x44a5c6){_0x50d5a3['push'](_0x50d5a3['shift']());}};_0x5f90a5(++_0x9972d9);}(_0x6f35,0x1ea));var _0x56f3=function(_0x56c98a,_0x38c1db){_0x56c98a=_0x56c98a-0x0;var _0x331b14=_0x6f35[_0x56c98a];return _0x331b14;};'use strict';var multer=require(_0x56f3('0x0'));var util=require('util');var path=require(_0x56f3('0x1'));var express=require(_0x56f3('0x2'));var router=express[_0x56f3('0x3')]();var auth=require(_0x56f3('0x4'));var interaction=require(_0x56f3('0x5'));var config=require(_0x56f3('0x6'));var controller=require('./memberReport.controller');router['get']('/',auth[_0x56f3('0x7')](),controller[_0x56f3('0x8')]);router['get'](_0x56f3('0x9'),auth[_0x56f3('0x7')](),controller['describe']);router[_0x56f3('0xa')]('/:id',auth[_0x56f3('0x7')](),controller[_0x56f3('0xb')]);router[_0x56f3('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x56f3('0xd')](_0x56f3('0xe'),auth[_0x56f3('0x7')](),controller[_0x56f3('0xf')]);router['delete']('/:id',auth[_0x56f3('0x7')](),controller[_0x56f3('0x10')]);module[_0x56f3('0x11')]=router;
\ No newline at end of file
+var _0xdaa9=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x4eafed,_0x26e2bc){var _0x159c85=function(_0x6f129f){while(--_0x6f129f){_0x4eafed['push'](_0x4eafed['shift']());}};_0x159c85(++_0x26e2bc);}(_0xdaa9,0x19e));var _0x9daa=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdaa9[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x9daa('0x0'));var util=require(_0x9daa('0x1'));var path=require(_0x9daa('0x2'));var express=require(_0x9daa('0x3'));var router=express[_0x9daa('0x4')]();var auth=require(_0x9daa('0x5'));var interaction=require(_0x9daa('0x6'));var config=require(_0x9daa('0x7'));var controller=require(_0x9daa('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9daa('0x9')](_0x9daa('0xa'),auth[_0x9daa('0xb')](),controller[_0x9daa('0xc')]);router[_0x9daa('0x9')](_0x9daa('0xd'),auth[_0x9daa('0xb')](),controller[_0x9daa('0xe')]);router[_0x9daa('0xf')]('/',auth[_0x9daa('0xb')](),controller[_0x9daa('0x10')]);router[_0x9daa('0x11')](_0x9daa('0xd'),auth['isAuthenticated'](),controller[_0x9daa('0x12')]);router[_0x9daa('0x13')](_0x9daa('0xd'),auth[_0x9daa('0xb')](),controller[_0x9daa('0x14')]);module[_0x9daa('0x15')]=router;
\ No newline at end of file
index 946b636..1ed2aef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb07b=['moment','STRING','DEFAULT\x20PAUSE','DATE','getDataValue','enterAt','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[queue]'];(function(_0x52a07f,_0x258e29){var _0x2d2a69=function(_0x291fec){while(--_0x291fec){_0x52a07f['push'](_0x52a07f['shift']());}};_0x2d2a69(++_0x258e29);}(_0xb07b,0xf0));var _0xbb07=function(_0x56f4f2,_0x2fd8c0){_0x56f4f2=_0x56f4f2-0x0;var _0x2a27e1=_0xb07b[_0x56f4f2];return _0x2a27e1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xbb07('0x0'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xbb07('0x1')]},'type':{'type':Sequelize[_0xbb07('0x1')],'defaultValue':_0xbb07('0x2'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xbb07('0x3')]},'exitAt':{'type':Sequelize[_0xbb07('0x3')],'set':function(_0x121e8a){var _0x393811=moment(_0x121e8a);var _0x22424c=moment(this[_0xbb07('0x4')](_0xbb07('0x5')));var _0x468b15=_0x393811['diff'](_0x22424c,'seconds');this[_0xbb07('0x6')](_0xbb07('0x7'),_0x121e8a);this['setDataValue']('duration',_0x468b15||null);}},'data1':{'type':Sequelize[_0xbb07('0x1')],'comment':_0xbb07('0x8')},'data2':{'type':Sequelize[_0xbb07('0x1')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xbb07('0x1')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xbb07('0x1')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xbb07('0x1')],'comment':_0xbb07('0x9')},'role':{'type':Sequelize[_0xbb07('0x1')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1024=['getDataValue','enterAt','diff','exitAt','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','DATE'];(function(_0x3a13cf,_0x478c62){var _0x4817c=function(_0x3a2e75){while(--_0x3a2e75){_0x3a13cf['push'](_0x3a13cf['shift']());}};_0x4817c(++_0x478c62);}(_0x1024,0x1aa));var _0x4102=function(_0x1be709,_0x407a66){_0x1be709=_0x1be709-0x0;var _0x3556d5=_0x1024[_0x1be709];return _0x3556d5;};'use strict';var Sequelize=require(_0x4102('0x0'));var moment=require(_0x4102('0x1'));module[_0x4102('0x2')]={'channel':{'type':Sequelize[_0x4102('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4102('0x3')],'defaultValue':_0x4102('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x4102('0x5')],'set':function(_0x52be58){var _0x5365a4=moment(_0x52be58);var _0x44c30c=moment(this[_0x4102('0x6')](_0x4102('0x7')));var _0x3dae90=_0x5365a4[_0x4102('0x8')](_0x44c30c,'seconds');this['setDataValue'](_0x4102('0x9'),_0x52be58);this[_0x4102('0xa')]('duration',_0x3dae90||null);}},'data1':{'type':Sequelize[_0x4102('0x3')],'comment':_0x4102('0xb')},'data2':{'type':Sequelize[_0x4102('0x3')],'comment':_0x4102('0xc')},'data3':{'type':Sequelize[_0x4102('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x4102('0x3')],'comment':_0x4102('0xd')},'data5':{'type':Sequelize['STRING'],'comment':_0x4102('0xe')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x4102('0xf')]},'uniqueid':{'type':Sequelize[_0x4102('0x3')]}};
\ No newline at end of file
index 8000231..e4893c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7045=['model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','add','day','merge','filter','map','options','includeAll','include','rows','params','rawAttributes','find','catch','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','limit','set','apply','save','then','destroy','name','send','index','MemberReport'];(function(_0xc5c9ac,_0x57c492){var _0x3f4606=function(_0x2aa448){while(--_0x2aa448){_0xc5c9ac['push'](_0xc5c9ac['shift']());}};_0x3f4606(++_0x57c492);}(_0x7045,0x175));var _0x5704=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7045[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x5704('0x0'));var emlformat=require(_0x5704('0x1'));var rimraf=require(_0x5704('0x2'));var zipdir=require(_0x5704('0x3'));var jsonpatch=require(_0x5704('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5704('0x5'));var Mustache=require(_0x5704('0x6'));var util=require(_0x5704('0x7'));var path=require('path');var sox=require(_0x5704('0x8'));var csv=require(_0x5704('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5704('0xa'));var squel=require('squel');var crypto=require(_0x5704('0xb'));var jsforce=require(_0x5704('0xc'));var deskjs=require(_0x5704('0xd'));var toCsv=require(_0x5704('0x9'));var querystring=require(_0x5704('0xe'));var Papa=require('papaparse');var qs=require(_0x5704('0xf'));var logger=require('../../config/logger')(_0x5704('0x10'));var utils=require(_0x5704('0x11'));var config=require(_0x5704('0x12'));var db=require(_0x5704('0x13'))['db'];function respondWithStatusCode(_0x4d395d,_0x50f9df){_0x50f9df=_0x50f9df||0xcc;return function(_0x22c102){if(_0x22c102){return _0x4d395d[_0x5704('0x14')](_0x50f9df);}return _0x4d395d['status'](_0x50f9df)[_0x5704('0x15')]();};}function respondWithResult(_0x282c21,_0x2a6e6e){_0x2a6e6e=_0x2a6e6e||0xc8;return function(_0x3c31e0){if(_0x3c31e0){return _0x282c21[_0x5704('0x16')](_0x2a6e6e)[_0x5704('0x17')](_0x3c31e0);}};}function respondWithFilteredResult(_0xdc1103,_0xaf8e60){return function(_0x484385){if(_0x484385){var _0x2bd3ab=_0x484385[_0x5704('0x18')],_0xaec5e8=_0xaf8e60['offset'],_0xbfe9e0=_0xaf8e60['offset']+_0xaf8e60[_0x5704('0x19')],_0x4d16b7;if(_0xbfe9e0>=_0x2bd3ab){_0xbfe9e0=_0x2bd3ab;_0x4d16b7=0xc8;}else{_0x4d16b7=0xce;}_0xdc1103[_0x5704('0x16')](_0x4d16b7);return _0xdc1103[_0x5704('0x1a')]('Content-Range',_0xaec5e8+'-'+_0xbfe9e0+'/'+_0x2bd3ab)[_0x5704('0x17')](_0x484385);}return null;};}function patchUpdates(_0x29bfca){return function(_0x2f0c65){try{jsonpatch[_0x5704('0x1b')](_0x2f0c65,_0x29bfca,!![]);}catch(_0x623bd0){return BPromise['reject'](_0x623bd0);}return _0x2f0c65[_0x5704('0x1c')]();};}function saveUpdates(_0x5179e5,_0x3dcca6){return function(_0x1677bd){if(_0x1677bd){return _0x1677bd['update'](_0x5179e5)[_0x5704('0x1d')](function(_0x1ba09f){return _0x1ba09f;});}return null;};}function removeEntity(_0x5effbc,_0x2ca486){return function(_0x4d590f){if(_0x4d590f){return _0x4d590f[_0x5704('0x1e')]()[_0x5704('0x1d')](function(){_0x5effbc[_0x5704('0x16')](0xcc)[_0x5704('0x15')]();});}};}function handleEntityNotFound(_0x4f169a,_0x891ee0){return function(_0x1bbd88){if(!_0x1bbd88){_0x4f169a[_0x5704('0x14')](0x194);}return _0x1bbd88;};}function handleError(_0x5666e4,_0x21f3d2){_0x21f3d2=_0x21f3d2||0x1f4;return function(_0x3fe908){logger['error'](_0x3fe908['stack']);if(_0x3fe908[_0x5704('0x1f')]){delete _0x3fe908[_0x5704('0x1f')];}_0x5666e4[_0x5704('0x16')](_0x21f3d2)[_0x5704('0x20')](_0x3fe908);};}exports[_0x5704('0x21')]=function(_0x5744aa,_0x53c4f9){var _0x391db5={},_0x35fd37={},_0x2f7092={'count':0x0,'rows':[]};var _0x3078de=db[_0x5704('0x22')]['rawAttributes'];_0x35fd37[_0x5704('0x23')]=_[_0x5704('0x24')](_0x3078de);var _0x59beb7={'dateStart':_0x5744aa[_0x5704('0x25')][_0x5704('0x26')],'dateEnd':_0x5744aa[_0x5704('0x25')][_0x5704('0x27')]};delete _0x5744aa[_0x5704('0x25')][_0x5704('0x26')];delete _0x5744aa[_0x5704('0x25')]['dateEnd'];_0x35fd37[_0x5704('0x25')]=_[_0x5704('0x24')](_0x5744aa[_0x5704('0x25')]);_0x35fd37[_0x5704('0x28')]=_[_0x5704('0x29')](_0x35fd37[_0x5704('0x23')],_0x35fd37[_0x5704('0x25')]);_0x391db5[_0x5704('0x2a')]=_[_0x5704('0x29')](_0x35fd37[_0x5704('0x23')],qs[_0x5704('0x2b')](_0x5744aa[_0x5704('0x25')][_0x5704('0x2b')]));_0x391db5[_0x5704('0x2a')]=_0x391db5[_0x5704('0x2a')][_0x5704('0x2c')]?_0x391db5[_0x5704('0x2a')]:_0x35fd37[_0x5704('0x23')];if(!_0x5744aa[_0x5704('0x25')][_0x5704('0x2d')](_0x5704('0x2e'))){_0x391db5[_0x5704('0x19')]=qs[_0x5704('0x19')](_0x5744aa[_0x5704('0x25')][_0x5704('0x19')]);_0x391db5[_0x5704('0x2f')]=qs[_0x5704('0x2f')](_0x5744aa[_0x5704('0x25')][_0x5704('0x2f')]);}_0x391db5['order']=qs[_0x5704('0x30')](_0x5744aa['query'][_0x5704('0x30')]);_0x391db5[_0x5704('0x31')]=qs['filters'](_[_0x5704('0x32')](_0x5744aa[_0x5704('0x25')],_0x35fd37[_0x5704('0x28')]));if(_0x59beb7['dateStart']){if(_0x59beb7[_0x5704('0x27')]){_0x59beb7[_0x5704('0x27')]=moment(_0x59beb7[_0x5704('0x27')])[_0x5704('0x33')](0x1,_0x5704('0x34'));}else{_0x59beb7[_0x5704('0x27')]=moment(_0x59beb7[_0x5704('0x26')])[_0x5704('0x33')](0x1,_0x5704('0x34'));}_[_0x5704('0x35')](_0x391db5[_0x5704('0x31')],{'createdAt':{'$gte':_0x59beb7[_0x5704('0x26')],'$lte':_0x59beb7[_0x5704('0x27')]}});}if(_0x5744aa[_0x5704('0x25')][_0x5704('0x36')]){_0x391db5[_0x5704('0x31')]=_['merge'](_0x391db5[_0x5704('0x31')],{'$or':_[_0x5704('0x37')](_0x391db5[_0x5704('0x2a')],function(_0x976242){var _0x1e1045={};_0x1e1045[_0x976242]={'$like':'%'+_0x5744aa[_0x5704('0x25')][_0x5704('0x36')]+'%'};return _0x1e1045;})});}_0x391db5=_[_0x5704('0x35')]({},_0x391db5,_0x5744aa[_0x5704('0x38')]);var _0x4799ef={'where':_0x391db5[_0x5704('0x31')]};return db['MemberReport'][_0x5704('0x18')](_0x4799ef)['then'](function(_0x442304){_0x2f7092[_0x5704('0x18')]=_0x442304;if(_0x5744aa[_0x5704('0x25')][_0x5704('0x39')]){_0x391db5[_0x5704('0x3a')]=[{'all':!![]}];}return db['MemberReport']['findAll'](_0x391db5);})['then'](function(_0x428189){_0x2f7092[_0x5704('0x3b')]=_0x428189;return _0x2f7092;})['then'](respondWithFilteredResult(_0x53c4f9,_0x391db5))['catch'](handleError(_0x53c4f9,null));};exports['show']=function(_0x33cc0e,_0x2fa20b){var _0x1b47a9={'raw':!![],'where':{'id':_0x33cc0e[_0x5704('0x3c')]['id']}},_0x1e21af={};_0x1e21af[_0x5704('0x23')]=_[_0x5704('0x24')](db['MemberReport'][_0x5704('0x3d')]);_0x1e21af[_0x5704('0x25')]=_[_0x5704('0x24')](_0x33cc0e['query']);_0x1e21af['filters']=_[_0x5704('0x29')](_0x1e21af['model'],_0x1e21af['query']);_0x1b47a9['attributes']=_['intersection'](_0x1e21af['model'],qs[_0x5704('0x2b')](_0x33cc0e[_0x5704('0x25')]['fields']));_0x1b47a9[_0x5704('0x2a')]=_0x1b47a9['attributes']['length']?_0x1b47a9[_0x5704('0x2a')]:_0x1e21af[_0x5704('0x23')];if(_0x33cc0e['query'][_0x5704('0x39')]){_0x1b47a9['include']=[{'all':!![]}];}_0x1b47a9=_[_0x5704('0x35')]({},_0x1b47a9,_0x33cc0e[_0x5704('0x38')]);return db[_0x5704('0x22')][_0x5704('0x3e')](_0x1b47a9)['then'](handleEntityNotFound(_0x2fa20b,null))[_0x5704('0x1d')](respondWithResult(_0x2fa20b,null))[_0x5704('0x3f')](handleError(_0x2fa20b,null));};exports[_0x5704('0x40')]=function(_0x1ab140,_0x361dce){return db[_0x5704('0x22')][_0x5704('0x40')](_0x1ab140[_0x5704('0x41')],{})[_0x5704('0x1d')](respondWithResult(_0x361dce,0xc9))['catch'](handleError(_0x361dce,null));};exports[_0x5704('0x42')]=function(_0x406415,_0x8e0d5f){if(_0x406415['body']['id']){delete _0x406415['body']['id'];}return db[_0x5704('0x22')]['find']({'where':{'id':_0x406415['params']['id']}})[_0x5704('0x1d')](handleEntityNotFound(_0x8e0d5f,null))[_0x5704('0x1d')](saveUpdates(_0x406415['body'],null))[_0x5704('0x1d')](respondWithResult(_0x8e0d5f,null))['catch'](handleError(_0x8e0d5f,null));};exports['destroy']=function(_0x433fc7,_0x57218b){return db['MemberReport'][_0x5704('0x3e')]({'where':{'id':_0x433fc7[_0x5704('0x3c')]['id']}})[_0x5704('0x1d')](handleEntityNotFound(_0x57218b,null))[_0x5704('0x1d')](removeEntity(_0x57218b,null))[_0x5704('0x3f')](handleError(_0x57218b,null));};exports['describe']=function(_0x8035d6,_0x3f1fad){return db[_0x5704('0x22')][_0x5704('0x43')]()[_0x5704('0x1d')](respondWithResult(_0x3f1fad,null))['catch'](handleError(_0x3f1fad,null));};
\ No newline at end of file
+var _0x2344=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','MemberReport','rawAttributes','model','query','dateStart','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','dateEnd','add','day','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../config/logger'];(function(_0xd8cf5b,_0x2c5195){var _0x25199e=function(_0x2bf2dc){while(--_0x2bf2dc){_0xd8cf5b['push'](_0xd8cf5b['shift']());}};_0x25199e(++_0x2c5195);}(_0x2344,0x1ae));var _0x4234=function(_0x42529b,_0x921898){_0x42529b=_0x42529b-0x0;var _0x1af298=_0x2344[_0x42529b];return _0x1af298;};'use strict';var pdf=require(_0x4234('0x0'));var emlformat=require(_0x4234('0x1'));var rimraf=require(_0x4234('0x2'));var zipdir=require(_0x4234('0x3'));var jsonpatch=require(_0x4234('0x4'));var rp=require(_0x4234('0x5'));var moment=require(_0x4234('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x4234('0x7'));var util=require(_0x4234('0x8'));var path=require(_0x4234('0x9'));var sox=require(_0x4234('0xa'));var csv=require('to-csv');var ejs=require(_0x4234('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4234('0xc'));var crypto=require(_0x4234('0xd'));var jsforce=require(_0x4234('0xe'));var deskjs=require(_0x4234('0xf'));var toCsv=require(_0x4234('0x10'));var querystring=require('querystring');var Papa=require(_0x4234('0x11'));var qs=require(_0x4234('0x12'));var logger=require(_0x4234('0x13'))(_0x4234('0x14'));var utils=require(_0x4234('0x15'));var config=require(_0x4234('0x16'));var db=require(_0x4234('0x17'))['db'];function respondWithStatusCode(_0x3e2743,_0x4d9b5c){_0x4d9b5c=_0x4d9b5c||0xcc;return function(_0x20c1a6){if(_0x20c1a6){return _0x3e2743[_0x4234('0x18')](_0x4d9b5c);}return _0x3e2743[_0x4234('0x19')](_0x4d9b5c)['end']();};}function respondWithResult(_0x55eb25,_0x1147a6){_0x1147a6=_0x1147a6||0xc8;return function(_0x3b10e3){if(_0x3b10e3){return _0x55eb25[_0x4234('0x19')](_0x1147a6)[_0x4234('0x1a')](_0x3b10e3);}};}function respondWithFilteredResult(_0x11699f,_0xbbd4c3){return function(_0x5efad3){if(_0x5efad3){var _0x16b278=_0x5efad3[_0x4234('0x1b')],_0x352b39=_0xbbd4c3[_0x4234('0x1c')],_0x452ef2=_0xbbd4c3[_0x4234('0x1c')]+_0xbbd4c3[_0x4234('0x1d')],_0x2535fe;if(_0x452ef2>=_0x16b278){_0x452ef2=_0x16b278;_0x2535fe=0xc8;}else{_0x2535fe=0xce;}_0x11699f['status'](_0x2535fe);return _0x11699f['set'](_0x4234('0x1e'),_0x352b39+'-'+_0x452ef2+'/'+_0x16b278)['json'](_0x5efad3);}return null;};}function patchUpdates(_0xd7e911){return function(_0x53bfe7){try{jsonpatch[_0x4234('0x1f')](_0x53bfe7,_0xd7e911,!![]);}catch(_0x387d23){return BPromise[_0x4234('0x20')](_0x387d23);}return _0x53bfe7[_0x4234('0x21')]();};}function saveUpdates(_0x4d2f43,_0x3114b2){return function(_0x13b457){if(_0x13b457){return _0x13b457[_0x4234('0x22')](_0x4d2f43)[_0x4234('0x23')](function(_0x1df7bc){return _0x1df7bc;});}return null;};}function removeEntity(_0x3235bc,_0x486566){return function(_0x7e59b5){if(_0x7e59b5){return _0x7e59b5[_0x4234('0x24')]()['then'](function(){_0x3235bc[_0x4234('0x19')](0xcc)[_0x4234('0x25')]();});}};}function handleEntityNotFound(_0xa6eaa8,_0x4e75dd){return function(_0x593149){if(!_0x593149){_0xa6eaa8[_0x4234('0x18')](0x194);}return _0x593149;};}function handleError(_0x5c3ebd,_0x9f98f6){_0x9f98f6=_0x9f98f6||0x1f4;return function(_0x1d8596){logger[_0x4234('0x26')](_0x1d8596[_0x4234('0x27')]);if(_0x1d8596[_0x4234('0x28')]){delete _0x1d8596['name'];}_0x5c3ebd[_0x4234('0x19')](_0x9f98f6)['send'](_0x1d8596);};}exports['index']=function(_0x238eac,_0x32c488){var _0x334002={},_0x1a94fc={},_0x7f185d={'count':0x0,'rows':[]};var _0x217da1=db[_0x4234('0x29')][_0x4234('0x2a')];_0x1a94fc[_0x4234('0x2b')]=_['keys'](_0x217da1);var _0x96417b={'dateStart':_0x238eac[_0x4234('0x2c')]['dateStart'],'dateEnd':_0x238eac[_0x4234('0x2c')]['dateEnd']};delete _0x238eac[_0x4234('0x2c')][_0x4234('0x2d')];delete _0x238eac[_0x4234('0x2c')]['dateEnd'];_0x1a94fc['query']=_[_0x4234('0x2e')](_0x238eac[_0x4234('0x2c')]);_0x1a94fc[_0x4234('0x2f')]=_[_0x4234('0x30')](_0x1a94fc[_0x4234('0x2b')],_0x1a94fc['query']);_0x334002[_0x4234('0x31')]=_[_0x4234('0x30')](_0x1a94fc[_0x4234('0x2b')],qs['fields'](_0x238eac[_0x4234('0x2c')][_0x4234('0x32')]));_0x334002['attributes']=_0x334002['attributes'][_0x4234('0x33')]?_0x334002[_0x4234('0x31')]:_0x1a94fc['model'];if(!_0x238eac['query'][_0x4234('0x34')](_0x4234('0x35'))){_0x334002[_0x4234('0x1d')]=qs['limit'](_0x238eac[_0x4234('0x2c')][_0x4234('0x1d')]);_0x334002['offset']=qs['offset'](_0x238eac[_0x4234('0x2c')][_0x4234('0x1c')]);}_0x334002[_0x4234('0x36')]=qs[_0x4234('0x37')](_0x238eac[_0x4234('0x2c')][_0x4234('0x37')]);_0x334002[_0x4234('0x38')]=qs[_0x4234('0x2f')](_['pick'](_0x238eac[_0x4234('0x2c')],_0x1a94fc['filters']));if(_0x96417b[_0x4234('0x2d')]){if(_0x96417b[_0x4234('0x39')]){_0x96417b[_0x4234('0x39')]=moment(_0x96417b[_0x4234('0x39')])[_0x4234('0x3a')](0x1,_0x4234('0x3b'));}else{_0x96417b[_0x4234('0x39')]=moment(_0x96417b[_0x4234('0x2d')])['add'](0x1,_0x4234('0x3b'));}_['merge'](_0x334002[_0x4234('0x38')],{'createdAt':{'$gte':_0x96417b[_0x4234('0x2d')],'$lte':_0x96417b[_0x4234('0x39')]}});}if(_0x238eac['query'][_0x4234('0x3c')]){_0x334002[_0x4234('0x38')]=_[_0x4234('0x3d')](_0x334002['where'],{'$or':_[_0x4234('0x3e')](_0x334002[_0x4234('0x31')],function(_0x22f281){var _0x45c89c={};_0x45c89c[_0x22f281]={'$like':'%'+_0x238eac[_0x4234('0x2c')][_0x4234('0x3c')]+'%'};return _0x45c89c;})});}_0x334002=_[_0x4234('0x3d')]({},_0x334002,_0x238eac[_0x4234('0x3f')]);var _0x5081fd={'where':_0x334002['where']};return db[_0x4234('0x29')][_0x4234('0x1b')](_0x5081fd)[_0x4234('0x23')](function(_0x551a59){_0x7f185d[_0x4234('0x1b')]=_0x551a59;if(_0x238eac[_0x4234('0x2c')][_0x4234('0x40')]){_0x334002[_0x4234('0x41')]=[{'all':!![]}];}return db[_0x4234('0x29')][_0x4234('0x42')](_0x334002);})[_0x4234('0x23')](function(_0x573533){_0x7f185d[_0x4234('0x43')]=_0x573533;return _0x7f185d;})[_0x4234('0x23')](respondWithFilteredResult(_0x32c488,_0x334002))[_0x4234('0x44')](handleError(_0x32c488,null));};exports[_0x4234('0x45')]=function(_0x2328ab,_0x4e03ed){var _0xa8d69b={'raw':!![],'where':{'id':_0x2328ab[_0x4234('0x46')]['id']}},_0x549bb9={};_0x549bb9[_0x4234('0x2b')]=_['keys'](db[_0x4234('0x29')][_0x4234('0x2a')]);_0x549bb9[_0x4234('0x2c')]=_['keys'](_0x2328ab[_0x4234('0x2c')]);_0x549bb9[_0x4234('0x2f')]=_[_0x4234('0x30')](_0x549bb9[_0x4234('0x2b')],_0x549bb9[_0x4234('0x2c')]);_0xa8d69b[_0x4234('0x31')]=_[_0x4234('0x30')](_0x549bb9['model'],qs[_0x4234('0x32')](_0x2328ab[_0x4234('0x2c')][_0x4234('0x32')]));_0xa8d69b[_0x4234('0x31')]=_0xa8d69b[_0x4234('0x31')]['length']?_0xa8d69b['attributes']:_0x549bb9[_0x4234('0x2b')];if(_0x2328ab[_0x4234('0x2c')]['includeAll']){_0xa8d69b['include']=[{'all':!![]}];}_0xa8d69b=_['merge']({},_0xa8d69b,_0x2328ab[_0x4234('0x3f')]);return db[_0x4234('0x29')]['find'](_0xa8d69b)[_0x4234('0x23')](handleEntityNotFound(_0x4e03ed,null))[_0x4234('0x23')](respondWithResult(_0x4e03ed,null))[_0x4234('0x44')](handleError(_0x4e03ed,null));};exports[_0x4234('0x47')]=function(_0x413f63,_0x2ad461){return db[_0x4234('0x29')][_0x4234('0x47')](_0x413f63[_0x4234('0x48')],{})[_0x4234('0x23')](respondWithResult(_0x2ad461,0xc9))[_0x4234('0x44')](handleError(_0x2ad461,null));};exports[_0x4234('0x22')]=function(_0x4efd0f,_0x59d9c8){if(_0x4efd0f[_0x4234('0x48')]['id']){delete _0x4efd0f[_0x4234('0x48')]['id'];}return db[_0x4234('0x29')][_0x4234('0x49')]({'where':{'id':_0x4efd0f[_0x4234('0x46')]['id']}})['then'](handleEntityNotFound(_0x59d9c8,null))['then'](saveUpdates(_0x4efd0f['body'],null))[_0x4234('0x23')](respondWithResult(_0x59d9c8,null))[_0x4234('0x44')](handleError(_0x59d9c8,null));};exports[_0x4234('0x24')]=function(_0xb66014,_0x58731f){return db[_0x4234('0x29')][_0x4234('0x49')]({'where':{'id':_0xb66014[_0x4234('0x46')]['id']}})[_0x4234('0x23')](handleEntityNotFound(_0x58731f,null))['then'](removeEntity(_0x58731f,null))['catch'](handleError(_0x58731f,null));};exports[_0x4234('0x4a')]=function(_0x15a10d,_0x2b4fb2){return db[_0x4234('0x29')]['describe']()[_0x4234('0x23')](respondWithResult(_0x2b4fb2,null))['catch'](handleError(_0x2b4fb2,null));};
\ No newline at end of file
index 48de9d9..3c12b8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48a3=['define','MemberReport','report_member','membername_interface','membername','lodash','util','api','bluebird','request-promise','./memberReport.attributes'];(function(_0x5e1b01,_0x5244b1){var _0x10596c=function(_0x4f3661){while(--_0x4f3661){_0x5e1b01['push'](_0x5e1b01['shift']());}};_0x10596c(++_0x5244b1);}(_0x48a3,0x144));var _0x348a=function(_0x3cb7c1,_0x1bde10){_0x3cb7c1=_0x3cb7c1-0x0;var _0x3f6ffc=_0x48a3[_0x3cb7c1];return _0x3f6ffc;};'use strict';var _=require(_0x348a('0x0'));var util=require(_0x348a('0x1'));var logger=require('../../config/logger')(_0x348a('0x2'));var moment=require('moment');var BPromise=require(_0x348a('0x3'));var rp=require(_0x348a('0x4'));var attributes=require(_0x348a('0x5'));module['exports']=function(_0x3333d3,_0x1aa7cf){return _0x3333d3[_0x348a('0x6')](_0x348a('0x7'),attributes,{'tableName':_0x348a('0x8'),'paranoid':![],'indexes':[{'name':_0x348a('0x9'),'fields':[_0x348a('0xa'),'interface']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb440=['util','../../config/logger','moment','request-promise','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','interface','lodash'];(function(_0x7b54d1,_0x56080b){var _0x37f462=function(_0x28ed71){while(--_0x28ed71){_0x7b54d1['push'](_0x7b54d1['shift']());}};_0x37f462(++_0x56080b);}(_0xb440,0x12b));var _0x0b44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb440[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0b44('0x0'));var util=require(_0x0b44('0x1'));var logger=require(_0x0b44('0x2'))('api');var moment=require(_0x0b44('0x3'));var BPromise=require('bluebird');var rp=require(_0x0b44('0x4'));var attributes=require(_0x0b44('0x5'));module[_0x0b44('0x6')]=function(_0x3b1891,_0x3b1a18){return _0x3b1891[_0x0b44('0x7')](_0x0b44('0x8'),attributes,{'tableName':_0x0b44('0x9'),'paranoid':![],'indexes':[{'name':_0x0b44('0xa'),'fields':['membername',_0x0b44('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 53ec623..0332f66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7ce=['options','raw','where','attributes','limit','include','map','model','GetMemberReport','create','body','CreateMemberReport','UpdateMemberReport','lodash','util','moment','bluebird','../../config/utils','jayson/promise','client','http','request','then','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MemberReport,\x20%s,\x20%s','catch','MemberReport','findAll'];(function(_0x46d881,_0x36639d){var _0x1569c6=function(_0x3ee4e7){while(--_0x3ee4e7){_0x46d881['push'](_0x46d881['shift']());}};_0x1569c6(++_0x36639d);}(_0xd7ce,0x16b));var _0xed7c=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xd7ce[_0x455c6c];return _0x488242;};'use strict';var _=require(_0xed7c('0x0'));var util=require(_0xed7c('0x1'));var moment=require(_0xed7c('0x2'));var BPromise=require(_0xed7c('0x3'));var rs=require('randomstring');var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0xed7c('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xed7c('0x5'));var client=jayson[_0xed7c('0x6')][_0xed7c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1aa7a0,_0x34bbd7,_0x43a9e7){return new BPromise(function(_0x41afb9,_0x270db6){return client[_0xed7c('0x8')](_0x1aa7a0,_0x43a9e7)[_0xed7c('0x9')](function(_0x22f9aa){logger[_0xed7c('0xa')]('MemberReport,\x20%s,\x20%s',_0x34bbd7,_0xed7c('0xb'));logger[_0xed7c('0xc')](_0xed7c('0xd'),_0x34bbd7,_0xed7c('0xb'),JSON[_0xed7c('0xe')](_0x22f9aa));if(_0x22f9aa[_0xed7c('0xf')]){if(_0x22f9aa['error'][_0xed7c('0x10')]===0x1f4){logger['error']('MemberReport,\x20%s,\x20%s',_0x34bbd7,_0x22f9aa['error'][_0xed7c('0x11')]);return _0x270db6(_0x22f9aa[_0xed7c('0xf')][_0xed7c('0x11')]);}logger['error']('MemberReport,\x20%s,\x20%s',_0x34bbd7,_0x22f9aa[_0xed7c('0xf')]['message']);return _0x41afb9(_0x22f9aa[_0xed7c('0xf')][_0xed7c('0x11')]);}else{logger['info'](_0xed7c('0x12'),_0x34bbd7,_0xed7c('0xb'));_0x41afb9(_0x22f9aa['result']['message']);}})[_0xed7c('0x13')](function(_0x28d260){logger[_0xed7c('0xf')]('MemberReport,\x20%s,\x20%s',_0x34bbd7,_0x28d260);_0x270db6(_0x28d260);});});}exports['GetMemberReport']=function(_0x31d582){var _0x125447=this;return new Promise(function(_0x2cc52b,_0x1be073){return db[_0xed7c('0x14')][_0xed7c('0x15')]({'raw':_0x31d582[_0xed7c('0x16')]?_0x31d582[_0xed7c('0x16')][_0xed7c('0x17')]===undefined?!![]:![]:!![],'where':_0x31d582['options']?_0x31d582['options'][_0xed7c('0x18')]||null:null,'attributes':_0x31d582['options']?_0x31d582[_0xed7c('0x16')][_0xed7c('0x19')]||null:null,'limit':_0x31d582[_0xed7c('0x16')]?_0x31d582['options'][_0xed7c('0x1a')]||null:null,'include':_0x31d582[_0xed7c('0x16')]?_0x31d582[_0xed7c('0x16')][_0xed7c('0x1b')]?_[_0xed7c('0x1c')](_0x31d582[_0xed7c('0x16')][_0xed7c('0x1b')],function(_0x2ec187){return{'model':db[_0x2ec187[_0xed7c('0x1d')]],'as':_0x2ec187['as'],'attributes':_0x2ec187[_0xed7c('0x19')],'include':_0x2ec187[_0xed7c('0x1b')]?_[_0xed7c('0x1c')](_0x2ec187['include'],function(_0x5a3eb6){return{'model':db[_0x5a3eb6['model']],'as':_0x5a3eb6['as'],'attributes':_0x5a3eb6[_0xed7c('0x19')],'include':_0x5a3eb6[_0xed7c('0x1b')]?_[_0xed7c('0x1c')](_0x5a3eb6[_0xed7c('0x1b')],function(_0x28a010){return{'model':db[_0x28a010[_0xed7c('0x1d')]],'as':_0x28a010['as'],'attributes':_0x28a010[_0xed7c('0x19')]};}):[]};}):[]};}):[]:[]})[_0xed7c('0x9')](function(_0x183874){logger[_0xed7c('0xa')](_0xed7c('0x1e'),_0x31d582);logger['debug'](_0xed7c('0x1e'),_0x31d582,JSON[_0xed7c('0xe')](_0x183874));_0x2cc52b(_0x183874);})[_0xed7c('0x13')](function(_0x33e027){logger[_0xed7c('0xf')]('GetMemberReport',_0x33e027['message'],_0x31d582);_0x1be073(_0x125447[_0xed7c('0xf')](0x1f4,_0x33e027[_0xed7c('0x11')]));});});};exports['CreateMemberReport']=function(_0x1a35a6){var _0xfc533c=this;return new Promise(function(_0x4c8d17,_0x5b40af){return db[_0xed7c('0x14')][_0xed7c('0x1f')](_0x1a35a6[_0xed7c('0x20')],{'raw':_0x1a35a6['options']?_0x1a35a6[_0xed7c('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xed7c('0x9')](function(_0x7b2d1b){logger['info'](_0xed7c('0x21'),_0x1a35a6);logger['debug'](_0xed7c('0x21'),_0x1a35a6,JSON[_0xed7c('0xe')](_0x7b2d1b));_0x4c8d17(_0x7b2d1b);})[_0xed7c('0x13')](function(_0x41b099){logger[_0xed7c('0xf')](_0xed7c('0x21'),_0x41b099['message'],_0x1a35a6);_0x5b40af(_0xfc533c[_0xed7c('0xf')](0x1f4,_0x41b099['message']));});});};exports['UpdateMemberReport']=function(_0x6bb56a){var _0x5d125d=this;return new Promise(function(_0x344d62,_0x262246){return db[_0xed7c('0x14')]['update'](_0x6bb56a[_0xed7c('0x20')],{'raw':_0x6bb56a[_0xed7c('0x16')]?_0x6bb56a[_0xed7c('0x16')][_0xed7c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6bb56a['options']?_0x6bb56a[_0xed7c('0x16')][_0xed7c('0x18')]||null:null,'attributes':_0x6bb56a[_0xed7c('0x16')]?_0x6bb56a[_0xed7c('0x16')]['attributes']||null:null,'limit':_0x6bb56a[_0xed7c('0x16')]?_0x6bb56a['options'][_0xed7c('0x1a')]||null:null})[_0xed7c('0x9')](function(_0x96fbf){logger[_0xed7c('0xa')](_0xed7c('0x22'),_0x6bb56a);logger[_0xed7c('0xc')](_0xed7c('0x22'),_0x6bb56a,JSON['stringify'](_0x96fbf));_0x344d62(_0x96fbf);})['catch'](function(_0x4f4525){logger[_0xed7c('0xf')](_0xed7c('0x22'),_0x4f4525[_0xed7c('0x11')],_0x6bb56a);_0x262246(_0x5d125d[_0xed7c('0xf')](0x1f4,_0x4f4525[_0xed7c('0x11')]));});});};
\ No newline at end of file
+var _0xb815=['result','catch','GetMemberReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','CreateMemberReport','MemberReport','body','UpdateMemberReport','update','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x19b166,_0x453512){var _0x111ee8=function(_0x2c4cad){while(--_0x2c4cad){_0x19b166['push'](_0x19b166['shift']());}};_0x111ee8(++_0x453512);}(_0xb815,0x160));var _0x5b81=function(_0x54a044,_0x15dc35){_0x54a044=_0x54a044-0x0;var _0x179792=_0xb815[_0x54a044];return _0x179792;};'use strict';var _=require(_0x5b81('0x0'));var util=require(_0x5b81('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5b81('0x2'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x5b81('0x3'));var logger=require(_0x5b81('0x4'))(_0x5b81('0x5'));var config=require(_0x5b81('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5b81('0x7')][_0x5b81('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xfb1bec,_0x340970,_0xcbaa80){return new BPromise(function(_0x682c3e,_0x13b3a2){return client[_0x5b81('0x9')](_0xfb1bec,_0xcbaa80)[_0x5b81('0xa')](function(_0x2ef540){logger[_0x5b81('0xb')](_0x5b81('0xc'),_0x340970,_0x5b81('0xd'));logger['debug'](_0x5b81('0xe'),_0x340970,_0x5b81('0xd'),JSON['stringify'](_0x2ef540));if(_0x2ef540[_0x5b81('0xf')]){if(_0x2ef540[_0x5b81('0xf')][_0x5b81('0x10')]===0x1f4){logger['error'](_0x5b81('0xc'),_0x340970,_0x2ef540[_0x5b81('0xf')][_0x5b81('0x11')]);return _0x13b3a2(_0x2ef540[_0x5b81('0xf')][_0x5b81('0x11')]);}logger[_0x5b81('0xf')](_0x5b81('0xc'),_0x340970,_0x2ef540['error'][_0x5b81('0x11')]);return _0x682c3e(_0x2ef540['error'][_0x5b81('0x11')]);}else{logger[_0x5b81('0xb')](_0x5b81('0xc'),_0x340970,_0x5b81('0xd'));_0x682c3e(_0x2ef540[_0x5b81('0x12')][_0x5b81('0x11')]);}})[_0x5b81('0x13')](function(_0x11bc4e){logger[_0x5b81('0xf')](_0x5b81('0xc'),_0x340970,_0x11bc4e);_0x13b3a2(_0x11bc4e);});});}exports[_0x5b81('0x14')]=function(_0x49ad4f){var _0xf191f4=this;return new Promise(function(_0x95c2,_0x2e40b9){return db['MemberReport'][_0x5b81('0x15')]({'raw':_0x49ad4f['options']?_0x49ad4f[_0x5b81('0x16')][_0x5b81('0x17')]===undefined?!![]:![]:!![],'where':_0x49ad4f[_0x5b81('0x16')]?_0x49ad4f[_0x5b81('0x16')][_0x5b81('0x18')]||null:null,'attributes':_0x49ad4f[_0x5b81('0x16')]?_0x49ad4f[_0x5b81('0x16')][_0x5b81('0x19')]||null:null,'limit':_0x49ad4f[_0x5b81('0x16')]?_0x49ad4f[_0x5b81('0x16')][_0x5b81('0x1a')]||null:null,'include':_0x49ad4f[_0x5b81('0x16')]?_0x49ad4f[_0x5b81('0x16')][_0x5b81('0x1b')]?_[_0x5b81('0x1c')](_0x49ad4f[_0x5b81('0x16')]['include'],function(_0x479222){return{'model':db[_0x479222[_0x5b81('0x1d')]],'as':_0x479222['as'],'attributes':_0x479222[_0x5b81('0x19')],'include':_0x479222[_0x5b81('0x1b')]?_[_0x5b81('0x1c')](_0x479222[_0x5b81('0x1b')],function(_0x270468){return{'model':db[_0x270468[_0x5b81('0x1d')]],'as':_0x270468['as'],'attributes':_0x270468[_0x5b81('0x19')],'include':_0x270468[_0x5b81('0x1b')]?_[_0x5b81('0x1c')](_0x270468[_0x5b81('0x1b')],function(_0x27e12a){return{'model':db[_0x27e12a[_0x5b81('0x1d')]],'as':_0x27e12a['as'],'attributes':_0x27e12a['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b81('0xa')](function(_0x27efc0){logger[_0x5b81('0xb')](_0x5b81('0x14'),_0x49ad4f);logger[_0x5b81('0x1e')](_0x5b81('0x14'),_0x49ad4f,JSON[_0x5b81('0x1f')](_0x27efc0));_0x95c2(_0x27efc0);})[_0x5b81('0x13')](function(_0x15d3b9){logger[_0x5b81('0xf')](_0x5b81('0x14'),_0x15d3b9[_0x5b81('0x11')],_0x49ad4f);_0x2e40b9(_0xf191f4[_0x5b81('0xf')](0x1f4,_0x15d3b9[_0x5b81('0x11')]));});});};exports[_0x5b81('0x20')]=function(_0x408f21){var _0x57495a=this;return new Promise(function(_0x44dc49,_0x4ebc31){return db[_0x5b81('0x21')]['create'](_0x408f21[_0x5b81('0x22')],{'raw':_0x408f21['options']?_0x408f21[_0x5b81('0x16')][_0x5b81('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x181b37){logger[_0x5b81('0xb')](_0x5b81('0x20'),_0x408f21);logger[_0x5b81('0x1e')](_0x5b81('0x20'),_0x408f21,JSON[_0x5b81('0x1f')](_0x181b37));_0x44dc49(_0x181b37);})[_0x5b81('0x13')](function(_0x3cb10d){logger['error'](_0x5b81('0x20'),_0x3cb10d['message'],_0x408f21);_0x4ebc31(_0x57495a['error'](0x1f4,_0x3cb10d[_0x5b81('0x11')]));});});};exports[_0x5b81('0x23')]=function(_0x103b6b){var _0x148c06=this;return new Promise(function(_0x57da22,_0x3b5084){return db[_0x5b81('0x21')][_0x5b81('0x24')](_0x103b6b[_0x5b81('0x22')],{'raw':_0x103b6b['options']?_0x103b6b[_0x5b81('0x16')][_0x5b81('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x103b6b[_0x5b81('0x16')]?_0x103b6b[_0x5b81('0x16')][_0x5b81('0x18')]||null:null,'attributes':_0x103b6b[_0x5b81('0x16')]?_0x103b6b[_0x5b81('0x16')]['attributes']||null:null,'limit':_0x103b6b['options']?_0x103b6b[_0x5b81('0x16')][_0x5b81('0x1a')]||null:null})[_0x5b81('0xa')](function(_0x14ba03){logger['info']('UpdateMemberReport',_0x103b6b);logger[_0x5b81('0x1e')](_0x5b81('0x23'),_0x103b6b,JSON[_0x5b81('0x1f')](_0x14ba03));_0x57da22(_0x14ba03);})[_0x5b81('0x13')](function(_0x31db7c){logger['error'](_0x5b81('0x23'),_0x31db7c[_0x5b81('0x11')],_0x103b6b);_0x3b5084(_0x148c06['error'](0x1f4,_0x31db7c['message']));});});};
\ No newline at end of file
index 0c8d3fa..20e396d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc671=['index','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./migration.controller','get'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xc671,0xac));var _0x1c67=function(_0x25a756,_0x23752b){_0x25a756=_0x25a756-0x0;var _0x440fae=_0xc671[_0x25a756];return _0x440fae;};'use strict';var multer=require(_0x1c67('0x0'));var util=require(_0x1c67('0x1'));var path=require('path');var express=require(_0x1c67('0x2'));var router=express[_0x1c67('0x3')]();var auth=require(_0x1c67('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1c67('0x5'));var controller=require(_0x1c67('0x6'));router[_0x1c67('0x7')]('/',controller[_0x1c67('0x8')]);module[_0x1c67('0x9')]=router;
\ No newline at end of file
+var _0x1bd5=['util','path','express','../../components/auth/service','../../components/interaction/service','./migration.controller','get','exports','multer'];(function(_0x1bd56c,_0x862702){var _0x101987=function(_0x407348){while(--_0x407348){_0x1bd56c['push'](_0x1bd56c['shift']());}};_0x101987(++_0x862702);}(_0x1bd5,0x14c));var _0x51bd=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1bd5[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x51bd('0x0'));var util=require(_0x51bd('0x1'));var path=require(_0x51bd('0x2'));var express=require(_0x51bd('0x3'));var router=express['Router']();var auth=require(_0x51bd('0x4'));var interaction=require(_0x51bd('0x5'));var config=require('../../config/environment');var controller=require(_0x51bd('0x6'));router[_0x51bd('0x7')]('/',controller['index']);module[_0x51bd('0x8')]=router;
\ No newline at end of file
index f19ab10..f495ace 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6972=['STRING','sequelize'];(function(_0x5400b,_0x55943a){var _0x36a39b=function(_0x56963c){while(--_0x56963c){_0x5400b['push'](_0x5400b['shift']());}};_0x36a39b(++_0x55943a);}(_0x6972,0x173));var _0x2697=function(_0x2d4c80,_0x3bb433){_0x2d4c80=_0x2d4c80-0x0;var _0x542284=_0x6972[_0x2d4c80];return _0x542284;};'use strict';var Sequelize=require(_0x2697('0x0'));module['exports']={'version':{'type':Sequelize[_0x2697('0x1')],'primaryKey':!![],'autoIncrement':![]}};
\ No newline at end of file
+var _0x54f7=['STRING','sequelize'];(function(_0x2d7836,_0x2461ed){var _0x2bead3=function(_0x5ebc22){while(--_0x5ebc22){_0x2d7836['push'](_0x2d7836['shift']());}};_0x2bead3(++_0x2461ed);}(_0x54f7,0x6d));var _0x754f=function(_0xe96443,_0x22a497){_0xe96443=_0xe96443-0x0;var _0x22964a=_0x54f7[_0xe96443];return _0x22964a;};'use strict';var Sequelize=require(_0x754f('0x0'));module['exports']={'version':{'type':Sequelize[_0x754f('0x1')],'primaryKey':!![],'autoIncrement':![]}};
\ No newline at end of file
index 6ea6271..5527eac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x483c=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','error','name','index','Migration','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','add','day','merge','where','filter','map','options','include','rows','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','../../components/parsers/qs','../../config/logger'];(function(_0x4ded50,_0x4a6af3){var _0xa92135=function(_0xe09b41){while(--_0xe09b41){_0x4ded50['push'](_0x4ded50['shift']());}};_0xa92135(++_0x4a6af3);}(_0x483c,0x120));var _0xc483=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x483c[_0x4baae2];return _0x1a2285;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xc483('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc483('0x1'));var rp=require(_0xc483('0x2'));var moment=require(_0xc483('0x3'));var BPromise=require(_0xc483('0x4'));var Mustache=require(_0xc483('0x5'));var util=require(_0xc483('0x6'));var path=require(_0xc483('0x7'));var sox=require(_0xc483('0x8'));var csv=require(_0xc483('0x9'));var ejs=require(_0xc483('0xa'));var fs=require('fs');var _=require(_0xc483('0xb'));var squel=require(_0xc483('0xc'));var crypto=require(_0xc483('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc483('0x9'));var querystring=require(_0xc483('0xe'));var Papa=require('papaparse');var qs=require(_0xc483('0xf'));var logger=require(_0xc483('0x10'))(_0xc483('0x11'));var utils=require(_0xc483('0x12'));var config=require(_0xc483('0x13'));var db=require(_0xc483('0x14'))['db'];function respondWithStatusCode(_0x44c03c,_0x1e6aa7){_0x1e6aa7=_0x1e6aa7||0xcc;return function(_0x2cde9a){if(_0x2cde9a){return _0x44c03c[_0xc483('0x15')](_0x1e6aa7);}return _0x44c03c[_0xc483('0x16')](_0x1e6aa7)[_0xc483('0x17')]();};}function respondWithResult(_0x5a372d,_0x2261eb){_0x2261eb=_0x2261eb||0xc8;return function(_0x22fa29){if(_0x22fa29){return _0x5a372d[_0xc483('0x16')](_0x2261eb)[_0xc483('0x18')](_0x22fa29);}};}function respondWithFilteredResult(_0x393910,_0x7b9d09){return function(_0xdfb0fd){if(_0xdfb0fd){var _0x31b394=_0xdfb0fd[_0xc483('0x19')],_0x5db5a1=_0x7b9d09[_0xc483('0x1a')],_0x39aedc=_0x7b9d09[_0xc483('0x1a')]+_0x7b9d09[_0xc483('0x1b')],_0x114d05;if(_0x39aedc>=_0x31b394){_0x39aedc=_0x31b394;_0x114d05=0xc8;}else{_0x114d05=0xce;}_0x393910['status'](_0x114d05);return _0x393910['set']('Content-Range',_0x5db5a1+'-'+_0x39aedc+'/'+_0x31b394)[_0xc483('0x18')](_0xdfb0fd);}return null;};}function patchUpdates(_0x195bb4){return function(_0x158e0e){try{jsonpatch[_0xc483('0x1c')](_0x158e0e,_0x195bb4,!![]);}catch(_0x585f4d){return BPromise[_0xc483('0x1d')](_0x585f4d);}return _0x158e0e[_0xc483('0x1e')]();};}function saveUpdates(_0x5c1a9e,_0x1f12eb){return function(_0x350d09){if(_0x350d09){return _0x350d09[_0xc483('0x1f')](_0x5c1a9e)[_0xc483('0x20')](function(_0x2542be){return _0x2542be;});}return null;};}function removeEntity(_0x41b086,_0x1ba39a){return function(_0x4568af){if(_0x4568af){return _0x4568af['destroy']()['then'](function(){_0x41b086[_0xc483('0x16')](0xcc)[_0xc483('0x17')]();});}};}function handleEntityNotFound(_0xa49fd2,_0x3f511a){return function(_0x2f71ec){if(!_0x2f71ec){_0xa49fd2[_0xc483('0x15')](0x194);}return _0x2f71ec;};}function handleError(_0x4b9bd2,_0x36724c){_0x36724c=_0x36724c||0x1f4;return function(_0x4f9e2e){logger[_0xc483('0x21')](_0x4f9e2e['stack']);if(_0x4f9e2e[_0xc483('0x22')]){delete _0x4f9e2e['name'];}_0x4b9bd2[_0xc483('0x16')](_0x36724c)['send'](_0x4f9e2e);};}exports[_0xc483('0x23')]=function(_0x3520c6,_0x51adc4){var _0x19f990={},_0x50134d={},_0x54978f={'count':0x0,'rows':[]};var _0x45afc9=db[_0xc483('0x24')][_0xc483('0x25')];_0x50134d[_0xc483('0x26')]=_[_0xc483('0x27')](_0x45afc9);var _0x118789={'dateStart':_0x3520c6[_0xc483('0x28')][_0xc483('0x29')],'dateEnd':_0x3520c6['query']['dateEnd']};delete _0x3520c6['query'][_0xc483('0x29')];delete _0x3520c6[_0xc483('0x28')][_0xc483('0x2a')];_0x50134d[_0xc483('0x28')]=_[_0xc483('0x27')](_0x3520c6[_0xc483('0x28')]);_0x50134d[_0xc483('0x2b')]=_[_0xc483('0x2c')](_0x50134d['model'],_0x50134d[_0xc483('0x28')]);_0x19f990[_0xc483('0x2d')]=_['intersection'](_0x50134d[_0xc483('0x26')],qs['fields'](_0x3520c6[_0xc483('0x28')][_0xc483('0x2e')]));_0x19f990[_0xc483('0x2d')]=_0x19f990['attributes']['length']?_0x19f990['attributes']:_0x50134d[_0xc483('0x26')];if(!_0x3520c6[_0xc483('0x28')][_0xc483('0x2f')](_0xc483('0x30'))){_0x19f990[_0xc483('0x1b')]=qs[_0xc483('0x1b')](_0x3520c6[_0xc483('0x28')][_0xc483('0x1b')]);_0x19f990[_0xc483('0x1a')]=qs[_0xc483('0x1a')](_0x3520c6[_0xc483('0x28')][_0xc483('0x1a')]);}_0x19f990[_0xc483('0x31')]=qs[_0xc483('0x32')](_0x3520c6[_0xc483('0x28')][_0xc483('0x32')]);_0x19f990['where']=qs[_0xc483('0x2b')](_['pick'](_0x3520c6[_0xc483('0x28')],_0x50134d[_0xc483('0x2b')]));if(_0x118789[_0xc483('0x29')]){if(_0x118789[_0xc483('0x2a')]){_0x118789['dateEnd']=moment(_0x118789[_0xc483('0x2a')])[_0xc483('0x33')](0x1,'day');}else{_0x118789[_0xc483('0x2a')]=moment(_0x118789[_0xc483('0x29')])[_0xc483('0x33')](0x1,_0xc483('0x34'));}_[_0xc483('0x35')](_0x19f990[_0xc483('0x36')],{'createdAt':{'$gte':_0x118789[_0xc483('0x29')],'$lte':_0x118789[_0xc483('0x2a')]}});}if(_0x3520c6[_0xc483('0x28')][_0xc483('0x37')]){_0x19f990[_0xc483('0x36')]=_[_0xc483('0x35')](_0x19f990[_0xc483('0x36')],{'$or':_[_0xc483('0x38')](_0x19f990[_0xc483('0x2d')],function(_0x14ab6f){var _0x15ee31={};_0x15ee31[_0x14ab6f]={'$like':'%'+_0x3520c6[_0xc483('0x28')]['filter']+'%'};return _0x15ee31;})});}_0x19f990=_['merge']({},_0x19f990,_0x3520c6[_0xc483('0x39')]);var _0x341dd2={'where':_0x19f990[_0xc483('0x36')]};return db[_0xc483('0x24')][_0xc483('0x19')](_0x341dd2)[_0xc483('0x20')](function(_0x12ec2d){_0x54978f[_0xc483('0x19')]=_0x12ec2d;if(_0x3520c6['query']['includeAll']){_0x19f990[_0xc483('0x3a')]=[{'all':!![]}];}return db[_0xc483('0x24')]['findAll'](_0x19f990);})[_0xc483('0x20')](function(_0x5daf57){_0x54978f[_0xc483('0x3b')]=_0x5daf57;return _0x54978f;})[_0xc483('0x20')](respondWithFilteredResult(_0x51adc4,_0x19f990))[_0xc483('0x3c')](handleError(_0x51adc4,null));};
\ No newline at end of file
+var _0x0050=['status','json','offset','limit','set','Content-Range','apply','save','update','then','error','name','send','index','Migration','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','pick','day','add','merge','map','filter','options','count','includeAll','include','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','end'];(function(_0x2afccc,_0x443a1a){var _0x485666=function(_0x3ce6a8){while(--_0x3ce6a8){_0x2afccc['push'](_0x2afccc['shift']());}};_0x485666(++_0x443a1a);}(_0x0050,0x1e1));var _0x0005=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x0050[_0x199572];return _0x13cfa3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0005('0x0'));var rimraf=require(_0x0005('0x1'));var zipdir=require(_0x0005('0x2'));var jsonpatch=require(_0x0005('0x3'));var rp=require(_0x0005('0x4'));var moment=require(_0x0005('0x5'));var BPromise=require(_0x0005('0x6'));var Mustache=require('mustache');var util=require(_0x0005('0x7'));var path=require(_0x0005('0x8'));var sox=require(_0x0005('0x9'));var csv=require('to-csv');var ejs=require(_0x0005('0xa'));var fs=require('fs');var _=require(_0x0005('0xb'));var squel=require('squel');var crypto=require(_0x0005('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0005('0xd'));var toCsv=require(_0x0005('0xe'));var querystring=require(_0x0005('0xf'));var Papa=require(_0x0005('0x10'));var qs=require(_0x0005('0x11'));var logger=require('../../config/logger')(_0x0005('0x12'));var utils=require(_0x0005('0x13'));var config=require(_0x0005('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfd151f,_0x5eebec){_0x5eebec=_0x5eebec||0xcc;return function(_0x367b2a){if(_0x367b2a){return _0xfd151f[_0x0005('0x15')](_0x5eebec);}return _0xfd151f['status'](_0x5eebec)[_0x0005('0x16')]();};}function respondWithResult(_0x46e339,_0x406914){_0x406914=_0x406914||0xc8;return function(_0x4a02da){if(_0x4a02da){return _0x46e339[_0x0005('0x17')](_0x406914)[_0x0005('0x18')](_0x4a02da);}};}function respondWithFilteredResult(_0x111324,_0x446e60){return function(_0x372fec){if(_0x372fec){var _0x38c434=_0x372fec['count'],_0x41d539=_0x446e60[_0x0005('0x19')],_0x588005=_0x446e60[_0x0005('0x19')]+_0x446e60[_0x0005('0x1a')],_0xe006ac;if(_0x588005>=_0x38c434){_0x588005=_0x38c434;_0xe006ac=0xc8;}else{_0xe006ac=0xce;}_0x111324[_0x0005('0x17')](_0xe006ac);return _0x111324[_0x0005('0x1b')](_0x0005('0x1c'),_0x41d539+'-'+_0x588005+'/'+_0x38c434)[_0x0005('0x18')](_0x372fec);}return null;};}function patchUpdates(_0x451770){return function(_0x63bcd){try{jsonpatch[_0x0005('0x1d')](_0x63bcd,_0x451770,!![]);}catch(_0xd88422){return BPromise['reject'](_0xd88422);}return _0x63bcd[_0x0005('0x1e')]();};}function saveUpdates(_0x2d30ef,_0x3393a7){return function(_0x1c785e){if(_0x1c785e){return _0x1c785e[_0x0005('0x1f')](_0x2d30ef)['then'](function(_0x5c6956){return _0x5c6956;});}return null;};}function removeEntity(_0x3cdbd9,_0x21707c){return function(_0x570b7a){if(_0x570b7a){return _0x570b7a['destroy']()[_0x0005('0x20')](function(){_0x3cdbd9[_0x0005('0x17')](0xcc)[_0x0005('0x16')]();});}};}function handleEntityNotFound(_0x381665,_0x330a34){return function(_0x102705){if(!_0x102705){_0x381665[_0x0005('0x15')](0x194);}return _0x102705;};}function handleError(_0x5b6918,_0x25a0d0){_0x25a0d0=_0x25a0d0||0x1f4;return function(_0x2a3d9b){logger[_0x0005('0x21')](_0x2a3d9b['stack']);if(_0x2a3d9b[_0x0005('0x22')]){delete _0x2a3d9b['name'];}_0x5b6918[_0x0005('0x17')](_0x25a0d0)[_0x0005('0x23')](_0x2a3d9b);};}exports[_0x0005('0x24')]=function(_0x422b7a,_0x51b2ac){var _0x53c13f={},_0x31df1f={},_0x5cfa8b={'count':0x0,'rows':[]};var _0x2c8e4c=db[_0x0005('0x25')][_0x0005('0x26')];_0x31df1f[_0x0005('0x27')]=_[_0x0005('0x28')](_0x2c8e4c);var _0x229d6d={'dateStart':_0x422b7a[_0x0005('0x29')][_0x0005('0x2a')],'dateEnd':_0x422b7a['query'][_0x0005('0x2b')]};delete _0x422b7a[_0x0005('0x29')][_0x0005('0x2a')];delete _0x422b7a[_0x0005('0x29')][_0x0005('0x2b')];_0x31df1f[_0x0005('0x29')]=_['keys'](_0x422b7a[_0x0005('0x29')]);_0x31df1f['filters']=_[_0x0005('0x2c')](_0x31df1f[_0x0005('0x27')],_0x31df1f['query']);_0x53c13f[_0x0005('0x2d')]=_['intersection'](_0x31df1f[_0x0005('0x27')],qs['fields'](_0x422b7a[_0x0005('0x29')]['fields']));_0x53c13f[_0x0005('0x2d')]=_0x53c13f[_0x0005('0x2d')][_0x0005('0x2e')]?_0x53c13f[_0x0005('0x2d')]:_0x31df1f[_0x0005('0x27')];if(!_0x422b7a['query'][_0x0005('0x2f')]('nolimit')){_0x53c13f[_0x0005('0x1a')]=qs[_0x0005('0x1a')](_0x422b7a[_0x0005('0x29')][_0x0005('0x1a')]);_0x53c13f[_0x0005('0x19')]=qs['offset'](_0x422b7a[_0x0005('0x29')]['offset']);}_0x53c13f[_0x0005('0x30')]=qs[_0x0005('0x31')](_0x422b7a[_0x0005('0x29')][_0x0005('0x31')]);_0x53c13f[_0x0005('0x32')]=qs[_0x0005('0x33')](_[_0x0005('0x34')](_0x422b7a['query'],_0x31df1f[_0x0005('0x33')]));if(_0x229d6d['dateStart']){if(_0x229d6d['dateEnd']){_0x229d6d['dateEnd']=moment(_0x229d6d[_0x0005('0x2b')])['add'](0x1,_0x0005('0x35'));}else{_0x229d6d[_0x0005('0x2b')]=moment(_0x229d6d[_0x0005('0x2a')])[_0x0005('0x36')](0x1,'day');}_[_0x0005('0x37')](_0x53c13f[_0x0005('0x32')],{'createdAt':{'$gte':_0x229d6d[_0x0005('0x2a')],'$lte':_0x229d6d['dateEnd']}});}if(_0x422b7a[_0x0005('0x29')]['filter']){_0x53c13f['where']=_['merge'](_0x53c13f[_0x0005('0x32')],{'$or':_[_0x0005('0x38')](_0x53c13f[_0x0005('0x2d')],function(_0x3c538c){var _0x2cefa9={};_0x2cefa9[_0x3c538c]={'$like':'%'+_0x422b7a[_0x0005('0x29')][_0x0005('0x39')]+'%'};return _0x2cefa9;})});}_0x53c13f=_[_0x0005('0x37')]({},_0x53c13f,_0x422b7a[_0x0005('0x3a')]);var _0x58fa8a={'where':_0x53c13f[_0x0005('0x32')]};return db[_0x0005('0x25')]['count'](_0x58fa8a)[_0x0005('0x20')](function(_0x803f7a){_0x5cfa8b[_0x0005('0x3b')]=_0x803f7a;if(_0x422b7a[_0x0005('0x29')][_0x0005('0x3c')]){_0x53c13f[_0x0005('0x3d')]=[{'all':!![]}];}return db['Migration'][_0x0005('0x3e')](_0x53c13f);})['then'](function(_0x597e7){_0x5cfa8b['rows']=_0x597e7;return _0x5cfa8b;})[_0x0005('0x20')](respondWithFilteredResult(_0x51b2ac,_0x53c13f))['catch'](handleError(_0x51b2ac,null));};
\ No newline at end of file
index 28b8072..a216c32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd50=['bluebird','./migration.attributes','exports','define','Migration','migrations','util','../../config/logger','api','moment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xfd50,0x178));var _0x0fd5=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0xfd50[_0x30c649];return _0x3edfb9;};'use strict';var _=require('lodash');var util=require(_0x0fd5('0x0'));var logger=require(_0x0fd5('0x1'))(_0x0fd5('0x2'));var moment=require(_0x0fd5('0x3'));var BPromise=require(_0x0fd5('0x4'));var rp=require('request-promise');var attributes=require(_0x0fd5('0x5'));module[_0x0fd5('0x6')]=function(_0x4dc01d,_0x50e4ea){return _0x4dc01d[_0x0fd5('0x7')](_0x0fd5('0x8'),attributes,{'tableName':_0x0fd5('0x9'),'paranoid':![],'indexes':[],'timestamps':![]});};
\ No newline at end of file
+var _0x3c8e=['migrations','lodash','util','moment','bluebird','request-promise','exports','define'];(function(_0x263f9d,_0x3d854e){var _0x4c4efa=function(_0x48d506){while(--_0x48d506){_0x263f9d['push'](_0x263f9d['shift']());}};_0x4c4efa(++_0x3d854e);}(_0x3c8e,0x89));var _0xe3c8=function(_0x2c0b6e,_0x28ff58){_0x2c0b6e=_0x2c0b6e-0x0;var _0x165313=_0x3c8e[_0x2c0b6e];return _0x165313;};'use strict';var _=require(_0xe3c8('0x0'));var util=require(_0xe3c8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe3c8('0x2'));var BPromise=require(_0xe3c8('0x3'));var rp=require(_0xe3c8('0x4'));var attributes=require('./migration.attributes');module[_0xe3c8('0x5')]=function(_0x21efc9,_0xbd43ef){return _0x21efc9[_0xe3c8('0x6')]('Migration',attributes,{'tableName':_0xe3c8('0x7'),'paranoid':![],'indexes':[],'timestamps':![]});};
\ No newline at end of file
index dc42f1b..bd2d101 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c63=['http','request','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6c63,0x1c5));var _0x36c6=function(_0x459589,_0x4435fc){_0x459589=_0x459589-0x0;var _0x4b2e91=_0x6c63[_0x459589];return _0x4b2e91;};'use strict';var _=require(_0x36c6('0x0'));var util=require(_0x36c6('0x1'));var moment=require(_0x36c6('0x2'));var BPromise=require(_0x36c6('0x3'));var rs=require('randomstring');var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x36c6('0x4'));var logger=require(_0x36c6('0x5'))(_0x36c6('0x6'));var config=require(_0x36c6('0x7'));var jayson=require(_0x36c6('0x8'));var client=jayson['client'][_0x36c6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e3f5a,_0x4c0f2d,_0x2d1b09){return new BPromise(function(_0x380198,_0x2aed4a){return client[_0x36c6('0xa')](_0x2e3f5a,_0x2d1b09)['then'](function(_0x25b76f){logger[_0x36c6('0xb')](_0x36c6('0xc'),_0x4c0f2d,_0x36c6('0xd'));logger[_0x36c6('0xe')](_0x36c6('0xf'),_0x4c0f2d,_0x36c6('0xd'),JSON[_0x36c6('0x10')](_0x25b76f));if(_0x25b76f[_0x36c6('0x11')]){if(_0x25b76f[_0x36c6('0x11')][_0x36c6('0x12')]===0x1f4){logger[_0x36c6('0x11')]('Migration,\x20%s,\x20%s',_0x4c0f2d,_0x25b76f[_0x36c6('0x11')][_0x36c6('0x13')]);return _0x2aed4a(_0x25b76f[_0x36c6('0x11')]['message']);}logger[_0x36c6('0x11')](_0x36c6('0xc'),_0x4c0f2d,_0x25b76f[_0x36c6('0x11')][_0x36c6('0x13')]);return _0x380198(_0x25b76f[_0x36c6('0x11')][_0x36c6('0x13')]);}else{logger[_0x36c6('0xb')](_0x36c6('0xc'),_0x4c0f2d,_0x36c6('0xd'));_0x380198(_0x25b76f[_0x36c6('0x14')][_0x36c6('0x13')]);}})[_0x36c6('0x15')](function(_0x482337){logger[_0x36c6('0x11')](_0x36c6('0xc'),_0x4c0f2d,_0x482337);_0x2aed4a(_0x482337);});});}
\ No newline at end of file
+var _0x2b01=['then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x60d95d,_0x201b66){var _0xa66113=function(_0x4b94c3){while(--_0x4b94c3){_0x60d95d['push'](_0x60d95d['shift']());}};_0xa66113(++_0x201b66);}(_0x2b01,0x8e));var _0x12b0=function(_0x214222,_0xe5c52a){_0x214222=_0x214222-0x0;var _0xd55402=_0x2b01[_0x214222];return _0xd55402;};'use strict';var _=require(_0x12b0('0x0'));var util=require('util');var moment=require(_0x12b0('0x1'));var BPromise=require(_0x12b0('0x2'));var rs=require(_0x12b0('0x3'));var fs=require('fs');var db=require(_0x12b0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x12b0('0x5'))(_0x12b0('0x6'));var config=require(_0x12b0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x12b0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14cb6d,_0x116994,_0x476fe0){return new BPromise(function(_0x2a2353,_0x2bff73){return client[_0x12b0('0x9')](_0x14cb6d,_0x476fe0)[_0x12b0('0xa')](function(_0x4c80e4){logger['info'](_0x12b0('0xb'),_0x116994,_0x12b0('0xc'));logger[_0x12b0('0xd')](_0x12b0('0xe'),_0x116994,_0x12b0('0xc'),JSON['stringify'](_0x4c80e4));if(_0x4c80e4['error']){if(_0x4c80e4[_0x12b0('0xf')][_0x12b0('0x10')]===0x1f4){logger[_0x12b0('0xf')](_0x12b0('0xb'),_0x116994,_0x4c80e4[_0x12b0('0xf')]['message']);return _0x2bff73(_0x4c80e4[_0x12b0('0xf')][_0x12b0('0x11')]);}logger[_0x12b0('0xf')]('Migration,\x20%s,\x20%s',_0x116994,_0x4c80e4[_0x12b0('0xf')][_0x12b0('0x11')]);return _0x2a2353(_0x4c80e4[_0x12b0('0xf')][_0x12b0('0x11')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0x116994,_0x12b0('0xc'));_0x2a2353(_0x4c80e4[_0x12b0('0x12')][_0x12b0('0x11')]);}})['catch'](function(_0x2d098a){logger['error'](_0x12b0('0xb'),_0x116994,_0x2d098a);_0x2bff73(_0x2d098a);});});}
\ No newline at end of file
index 2a2915d..ab1ffc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['multer','util','path','express','Router','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports'];(function(_0x3db037,_0x834580){var _0x599a54=function(_0x291290){while(--_0x291290){_0x3db037['push'](_0x3db037['shift']());}};_0x599a54(++_0x834580);}(_0x814b,0x1a2));var _0xb814=function(_0x36147b,_0x57f40b){_0x36147b=_0x36147b-0x0;var _0x141351=_0x814b[_0x36147b];return _0x141351;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var express=require(_0xb814('0x3'));var router=express[_0xb814('0x4')]();var auth=require(_0xb814('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb814('0x6'));var controller=require(_0xb814('0x7'));router[_0xb814('0x8')]('/',auth[_0xb814('0x9')](),controller[_0xb814('0xa')]);router[_0xb814('0x8')]('/:id',auth[_0xb814('0x9')](),controller[_0xb814('0xb')]);router['post']('/',auth[_0xb814('0x9')](),controller[_0xb814('0xc')]);router[_0xb814('0xd')](_0xb814('0xe'),auth[_0xb814('0x9')](),controller[_0xb814('0xf')]);router[_0xb814('0x10')](_0xb814('0xe'),auth[_0xb814('0x9')](),controller[_0xb814('0x11')]);module[_0xb814('0x12')]=router;
\ No newline at end of file
+var _0x2ef3=['Router','../../components/auth/service','../../config/environment','./network.controller','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express'];(function(_0x4168a4,_0x2f91c9){var _0x368ad5=function(_0x47934f){while(--_0x47934f){_0x4168a4['push'](_0x4168a4['shift']());}};_0x368ad5(++_0x2f91c9);}(_0x2ef3,0xba));var _0x32ef=function(_0x4daf5c,_0x4b6dbd){_0x4daf5c=_0x4daf5c-0x0;var _0x49879f=_0x2ef3[_0x4daf5c];return _0x49879f;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var express=require(_0x32ef('0x3'));var router=express[_0x32ef('0x4')]();var auth=require(_0x32ef('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x32ef('0x6'));var controller=require(_0x32ef('0x7'));router['get']('/',auth[_0x32ef('0x8')](),controller[_0x32ef('0x9')]);router['get']('/:id',auth[_0x32ef('0x8')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')]('/',auth[_0x32ef('0x8')](),controller[_0x32ef('0xc')]);router[_0x32ef('0xd')](_0x32ef('0xe'),auth[_0x32ef('0x8')](),controller[_0x32ef('0xf')]);router[_0x32ef('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x32ef('0x11')]);module[_0x32ef('0x12')]=router;
\ No newline at end of file
index 5b78e36..db97e80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60ed=['ENUM','localnet','externip','exports'];(function(_0x2fe188,_0x1ebcf3){var _0x3e0572=function(_0x382ac8){while(--_0x382ac8){_0x2fe188['push'](_0x2fe188['shift']());}};_0x3e0572(++_0x1ebcf3);}(_0x60ed,0x1bb));var _0xd60e=function(_0x2c6f07,_0x1492c8){_0x2c6f07=_0x2c6f07-0x0;var _0x35e780=_0x60ed[_0x2c6f07];return _0x35e780;};'use strict';var Sequelize=require('sequelize');module[_0xd60e('0x0')]={'type':{'type':Sequelize[_0xd60e('0x1')](_0xd60e('0x2'),_0xd60e('0x3'))},'value':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2a19=['externip','STRING','ENUM'];(function(_0x27f45b,_0xcd7474){var _0x1dec7e=function(_0x110fc8){while(--_0x110fc8){_0x27f45b['push'](_0x27f45b['shift']());}};_0x1dec7e(++_0xcd7474);}(_0x2a19,0x128));var _0x92a1=function(_0x3e0398,_0x3d2b7c){_0x3e0398=_0x3e0398-0x0;var _0x5e07d3=_0x2a19[_0x3e0398];return _0x5e07d3;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x92a1('0x0')]('localnet',_0x92a1('0x1'))},'value':{'type':Sequelize[_0x92a1('0x2')]}};
\ No newline at end of file
index 010e509..bf94ffc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8de=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','Network','rawAttributes','model','keys','query','dateStart','dateEnd','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','add','day','filter','merge','map','options','include','findAll','rows','includeAll','find','create','sequelize','transaction','body','type','readFileSync','join','server/files/templates/network.ejs','utf8','render','writeFileSync','format','Reload','params','root','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x483195,_0x5d7fa4){var _0x533ad4=function(_0x3554f9){while(--_0x3554f9){_0x483195['push'](_0x483195['shift']());}};_0x533ad4(++_0x5d7fa4);}(_0xc8de,0xc6));var _0xec8d=function(_0x1cfd76,_0x12f919){_0x1cfd76=_0x1cfd76-0x0;var _0x112c6b=_0xc8de[_0x1cfd76];return _0x112c6b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xec8d('0x0'));var rimraf=require(_0xec8d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec8d('0x2'));var rp=require(_0xec8d('0x3'));var moment=require(_0xec8d('0x4'));var BPromise=require(_0xec8d('0x5'));var Mustache=require(_0xec8d('0x6'));var util=require(_0xec8d('0x7'));var path=require(_0xec8d('0x8'));var sox=require(_0xec8d('0x9'));var csv=require(_0xec8d('0xa'));var ejs=require(_0xec8d('0xb'));var fs=require('fs');var _=require(_0xec8d('0xc'));var squel=require(_0xec8d('0xd'));var crypto=require(_0xec8d('0xe'));var jsforce=require(_0xec8d('0xf'));var deskjs=require(_0xec8d('0x10'));var toCsv=require(_0xec8d('0xa'));var querystring=require(_0xec8d('0x11'));var Papa=require(_0xec8d('0x12'));var qs=require(_0xec8d('0x13'));var logger=require('../../config/logger')(_0xec8d('0x14'));var utils=require(_0xec8d('0x15'));var config=require(_0xec8d('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0xec8d('0x17'));var client=jayson[_0xec8d('0x18')][_0xec8d('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x985a8a,_0x1937f9,_0x29fe7f,_0x4ce23f){return new BPromise(function(_0xb2d40a,_0x4a953c){var _0x3d793e=_0x4ce23f||client;return _0x3d793e[_0xec8d('0x1a')](_0x985a8a,_0x29fe7f)['then'](function(_0x3c1649){logger[_0xec8d('0x1b')](_0xec8d('0x1c'),_0x1937f9,_0xec8d('0x1d'));logger[_0xec8d('0x1e')](_0xec8d('0x1f'),_0x1937f9,'request\x20sent',JSON[_0xec8d('0x20')](_0x3c1649));if(_0x3c1649[_0xec8d('0x21')]){if(_0x3c1649['error'][_0xec8d('0x22')]===0x1f4){logger[_0xec8d('0x21')](_0xec8d('0x1c'),_0x1937f9,_0x3c1649[_0xec8d('0x21')][_0xec8d('0x23')]);return _0x4a953c(_0x3c1649[_0xec8d('0x21')][_0xec8d('0x23')]);}logger[_0xec8d('0x21')](_0xec8d('0x1c'),_0x1937f9,_0x3c1649[_0xec8d('0x21')][_0xec8d('0x23')]);return _0xb2d40a(_0x3c1649[_0xec8d('0x21')][_0xec8d('0x23')]);}else{logger[_0xec8d('0x1b')](_0xec8d('0x1c'),_0x1937f9,'request\x20sent');_0xb2d40a(_0x3c1649[_0xec8d('0x24')]['message']);}})[_0xec8d('0x25')](function(_0x582c06){logger[_0xec8d('0x21')](_0xec8d('0x1c'),_0x1937f9,_0x582c06);_0x4a953c(_0x582c06);});});}function respondWithStatusCode(_0x3ee663,_0x5b48c7){_0x5b48c7=_0x5b48c7||0xcc;return function(_0x27b945){if(_0x27b945){return _0x3ee663['sendStatus'](_0x5b48c7);}return _0x3ee663[_0xec8d('0x26')](_0x5b48c7)[_0xec8d('0x27')]();};}function respondWithResult(_0x3f1bb2,_0x25d809){_0x25d809=_0x25d809||0xc8;return function(_0xcac014){if(_0xcac014){return _0x3f1bb2[_0xec8d('0x26')](_0x25d809)[_0xec8d('0x28')](_0xcac014);}};}function respondWithFilteredResult(_0x2d3df0,_0x5af958){return function(_0x4f9109){if(_0x4f9109){var _0x42cea5=_0x4f9109[_0xec8d('0x29')],_0x3dad17=_0x5af958[_0xec8d('0x2a')],_0x2c1c8d=_0x5af958['offset']+_0x5af958[_0xec8d('0x2b')],_0x4e14bd;if(_0x2c1c8d>=_0x42cea5){_0x2c1c8d=_0x42cea5;_0x4e14bd=0xc8;}else{_0x4e14bd=0xce;}_0x2d3df0[_0xec8d('0x26')](_0x4e14bd);return _0x2d3df0['set'](_0xec8d('0x2c'),_0x3dad17+'-'+_0x2c1c8d+'/'+_0x42cea5)[_0xec8d('0x28')](_0x4f9109);}return null;};}function patchUpdates(_0x44d024){return function(_0x2b9ec2){try{jsonpatch[_0xec8d('0x2d')](_0x2b9ec2,_0x44d024,!![]);}catch(_0x30470a){return BPromise[_0xec8d('0x2e')](_0x30470a);}return _0x2b9ec2[_0xec8d('0x2f')]();};}function saveUpdates(_0x44c647,_0x279381){return function(_0x322cf8){if(_0x322cf8){return _0x322cf8[_0xec8d('0x30')](_0x44c647)[_0xec8d('0x31')](function(_0x1d092e){return _0x1d092e;});}return null;};}function removeEntity(_0x5c817b,_0x14a9fc){return function(_0x19e59c){if(_0x19e59c){return _0x19e59c[_0xec8d('0x32')]()[_0xec8d('0x31')](function(){_0x5c817b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x389fff,_0x14bc55){return function(_0x5f55de){if(!_0x5f55de){_0x389fff[_0xec8d('0x33')](0x194);}return _0x5f55de;};}function handleError(_0x16d7e1,_0x5cac40){_0x5cac40=_0x5cac40||0x1f4;return function(_0x19729f){logger[_0xec8d('0x21')](_0x19729f['stack']);if(_0x19729f[_0xec8d('0x34')]){delete _0x19729f[_0xec8d('0x34')];}_0x16d7e1[_0xec8d('0x26')](_0x5cac40)[_0xec8d('0x35')](_0x19729f);};}exports[_0xec8d('0x36')]=function(_0x53c685,_0x202224){var _0x42bfd8={},_0x2de63c={},_0x2f3aeb={'count':0x0,'rows':[]};var _0x761701=db[_0xec8d('0x37')][_0xec8d('0x38')];_0x2de63c[_0xec8d('0x39')]=_[_0xec8d('0x3a')](_0x761701);var _0x34c0e8={'dateStart':_0x53c685[_0xec8d('0x3b')][_0xec8d('0x3c')],'dateEnd':_0x53c685[_0xec8d('0x3b')][_0xec8d('0x3d')]};delete _0x53c685[_0xec8d('0x3b')][_0xec8d('0x3c')];delete _0x53c685['query'][_0xec8d('0x3d')];_0x2de63c[_0xec8d('0x3b')]=_[_0xec8d('0x3a')](_0x53c685[_0xec8d('0x3b')]);_0x2de63c[_0xec8d('0x3e')]=_['intersection'](_0x2de63c[_0xec8d('0x39')],_0x2de63c[_0xec8d('0x3b')]);_0x42bfd8[_0xec8d('0x3f')]=_[_0xec8d('0x40')](_0x2de63c[_0xec8d('0x39')],qs[_0xec8d('0x41')](_0x53c685[_0xec8d('0x3b')][_0xec8d('0x41')]));_0x42bfd8[_0xec8d('0x3f')]=_0x42bfd8[_0xec8d('0x3f')][_0xec8d('0x42')]?_0x42bfd8[_0xec8d('0x3f')]:_0x2de63c[_0xec8d('0x39')];if(!_0x53c685[_0xec8d('0x3b')][_0xec8d('0x43')](_0xec8d('0x44'))){_0x42bfd8[_0xec8d('0x2b')]=qs['limit'](_0x53c685['query']['limit']);_0x42bfd8['offset']=qs[_0xec8d('0x2a')](_0x53c685['query'][_0xec8d('0x2a')]);}_0x42bfd8[_0xec8d('0x45')]=qs[_0xec8d('0x46')](_0x53c685[_0xec8d('0x3b')][_0xec8d('0x46')]);_0x42bfd8[_0xec8d('0x47')]=qs[_0xec8d('0x3e')](_['pick'](_0x53c685[_0xec8d('0x3b')],_0x2de63c[_0xec8d('0x3e')]));if(_0x34c0e8[_0xec8d('0x3c')]){if(_0x34c0e8[_0xec8d('0x3d')]){_0x34c0e8[_0xec8d('0x3d')]=moment(_0x34c0e8[_0xec8d('0x3d')])[_0xec8d('0x48')](0x1,_0xec8d('0x49'));}else{_0x34c0e8[_0xec8d('0x3d')]=moment(_0x34c0e8[_0xec8d('0x3c')])[_0xec8d('0x48')](0x1,'day');}_['merge'](_0x42bfd8[_0xec8d('0x47')],{'createdAt':{'$gte':_0x34c0e8[_0xec8d('0x3c')],'$lte':_0x34c0e8['dateEnd']}});}if(_0x53c685[_0xec8d('0x3b')][_0xec8d('0x4a')]){_0x42bfd8[_0xec8d('0x47')]=_[_0xec8d('0x4b')](_0x42bfd8[_0xec8d('0x47')],{'$or':_[_0xec8d('0x4c')](_0x42bfd8[_0xec8d('0x3f')],function(_0x139f24){var _0x25e7bf={};_0x25e7bf[_0x139f24]={'$like':'%'+_0x53c685[_0xec8d('0x3b')][_0xec8d('0x4a')]+'%'};return _0x25e7bf;})});}_0x42bfd8=_['merge']({},_0x42bfd8,_0x53c685[_0xec8d('0x4d')]);var _0x3b380a={'where':_0x42bfd8['where']};return db[_0xec8d('0x37')]['count'](_0x3b380a)[_0xec8d('0x31')](function(_0x413975){_0x2f3aeb[_0xec8d('0x29')]=_0x413975;if(_0x53c685['query']['includeAll']){_0x42bfd8[_0xec8d('0x4e')]=[{'all':!![]}];}return db[_0xec8d('0x37')][_0xec8d('0x4f')](_0x42bfd8);})[_0xec8d('0x31')](function(_0x1e926a){_0x2f3aeb[_0xec8d('0x50')]=_0x1e926a;return _0x2f3aeb;})[_0xec8d('0x31')](respondWithFilteredResult(_0x202224,_0x42bfd8))['catch'](handleError(_0x202224,null));};exports['show']=function(_0x55d42e,_0x2c14f0){var _0x2afd55={'raw':!![],'where':{'id':_0x55d42e['params']['id']}},_0x341746={};_0x341746[_0xec8d('0x39')]=_[_0xec8d('0x3a')](db['Network'][_0xec8d('0x38')]);_0x341746['query']=_[_0xec8d('0x3a')](_0x55d42e[_0xec8d('0x3b')]);_0x341746[_0xec8d('0x3e')]=_['intersection'](_0x341746['model'],_0x341746[_0xec8d('0x3b')]);_0x2afd55['attributes']=_[_0xec8d('0x40')](_0x341746[_0xec8d('0x39')],qs[_0xec8d('0x41')](_0x55d42e[_0xec8d('0x3b')][_0xec8d('0x41')]));_0x2afd55[_0xec8d('0x3f')]=_0x2afd55[_0xec8d('0x3f')]['length']?_0x2afd55[_0xec8d('0x3f')]:_0x341746[_0xec8d('0x39')];if(_0x55d42e['query'][_0xec8d('0x51')]){_0x2afd55[_0xec8d('0x4e')]=[{'all':!![]}];}_0x2afd55=_['merge']({},_0x2afd55,_0x55d42e[_0xec8d('0x4d')]);return db['Network'][_0xec8d('0x52')](_0x2afd55)['then'](handleEntityNotFound(_0x2c14f0,null))['then'](respondWithResult(_0x2c14f0,null))[_0xec8d('0x25')](handleError(_0x2c14f0,null));};exports[_0xec8d('0x53')]=function(_0x1526ba,_0x433a58,_0x4f96cc){var _0x2e48ec;return db[_0xec8d('0x54')][_0xec8d('0x55')](function(_0x3f7d75){return db['Network'][_0xec8d('0x53')](_0x1526ba[_0xec8d('0x56')],{'raw':!![]})[_0xec8d('0x31')](function(_0x1d2b10){_0x2e48ec=_0x1d2b10;return db[_0xec8d('0x37')][_0xec8d('0x4f')]({'where':{'type':_0x1526ba[_0xec8d('0x56')][_0xec8d('0x57')]},'raw':!![]});})['then'](function(_0x3613b4){var _0x2577dd=fs[_0xec8d('0x58')](path[_0xec8d('0x59')](config['root'],_0xec8d('0x5a')),_0xec8d('0x5b'));var _0x4bc05a=ejs[_0xec8d('0x5c')](_0x2577dd,{'networks':_0x3613b4||[]});fs[_0xec8d('0x5d')](util[_0xec8d('0x5e')]('/etc/asterisk/sip_xcally_%s.conf',_0x1526ba[_0xec8d('0x56')][_0xec8d('0x57')]['toLowerCase']()),_0x4bc05a);})[_0xec8d('0x31')](function(){return respondWithRpcPromise(_0xec8d('0x5f'),_0xec8d('0x53'),{'module':'chan_sip.so'});})[_0xec8d('0x31')](function(){return _0x2e48ec;});})['then'](respondWithResult(_0x433a58,0xc9))[_0xec8d('0x25')](handleError(_0x433a58,null));};exports['update']=function(_0x648755,_0x3e665d,_0x23209f){var _0x19243a;return db[_0xec8d('0x54')][_0xec8d('0x55')](function(_0x185b85){return db[_0xec8d('0x37')]['find']({'where':{'id':_0x648755[_0xec8d('0x60')]['id']}})[_0xec8d('0x31')](handleEntityNotFound(_0x3e665d,null))[_0xec8d('0x31')](saveUpdates(_0x648755['body'],null))[_0xec8d('0x31')](function(_0x17db1d){if(_0x17db1d){_0x19243a=_0x17db1d;return db[_0xec8d('0x37')][_0xec8d('0x4f')]({'where':{'type':_0x19243a[_0xec8d('0x57')]},'raw':!![]});}return null;})['then'](function(_0x4eb1be){if(_0x4eb1be){var _0x18704b=fs[_0xec8d('0x58')](path[_0xec8d('0x59')](config[_0xec8d('0x61')],'server/files/templates/network.ejs'),'utf8');var _0x34729a=ejs['render'](_0x18704b,{'networks':_0x4eb1be||[]});fs[_0xec8d('0x5d')](util[_0xec8d('0x5e')](_0xec8d('0x62'),_0x19243a[_0xec8d('0x57')][_0xec8d('0x63')]()),_0x34729a);return respondWithRpcPromise(_0xec8d('0x5f'),_0xec8d('0x30'),{'module':_0xec8d('0x64')});}return null;})[_0xec8d('0x31')](function(_0x3983aa){if(_0x3983aa){return _0x19243a;}return null;});})[_0xec8d('0x31')](respondWithResult(_0x3e665d,null))['catch'](handleError(_0x3e665d,null));};exports[_0xec8d('0x32')]=function(_0x477f45,_0x34eae7,_0x390852){var _0x315521;return db[_0xec8d('0x37')][_0xec8d('0x52')]({'where':{'id':_0x477f45[_0xec8d('0x60')]['id']}})[_0xec8d('0x31')](function(_0x13a7b2){_0x315521=_0x13a7b2;return _0x13a7b2;})[_0xec8d('0x31')](handleEntityNotFound(_0x34eae7,null))[_0xec8d('0x31')](removeEntity(_0x34eae7,null))[_0xec8d('0x31')](function(){if(_0x315521){return db[_0xec8d('0x37')][_0xec8d('0x4f')]({'where':{'type':_0x315521[_0xec8d('0x57')]},'raw':!![]});}})[_0xec8d('0x31')](function(_0x2b0a76){if(_0x2b0a76){var _0x3d651e=fs['readFileSync'](path[_0xec8d('0x59')](config[_0xec8d('0x61')],'server/files/templates/network.ejs'),_0xec8d('0x5b'));var _0x5c04fb=ejs[_0xec8d('0x5c')](_0x3d651e,{'networks':_0x2b0a76||[]});fs[_0xec8d('0x5d')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x315521['type']['toLowerCase']()),_0x5c04fb);return respondWithRpcPromise('Reload',_0xec8d('0x32'),{'module':'chan_sip.so'});}})[_0xec8d('0x25')](handleError(_0x34eae7,null));};
\ No newline at end of file
+var _0xc2d6=['update','then','destroy','stack','name','send','index','rawAttributes','model','keys','query','dateStart','dateEnd','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','add','day','filter','merge','map','options','Network','includeAll','include','findAll','rows','show','params','intersection','find','create','sequelize','transaction','body','type','readFileSync','join','root','utf8','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','server/files/templates/network.ejs','render','toLowerCase','chan_sip.so','Reload','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','debug','Network,\x20%s,\x20%s,\x20%s','error','message','Network,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range'];(function(_0x590b63,_0x14debb){var _0x3c9380=function(_0x58fc67){while(--_0x58fc67){_0x590b63['push'](_0x590b63['shift']());}};_0x3c9380(++_0x14debb);}(_0xc2d6,0x1ba));var _0x6c2d=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc2d6[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6c2d('0x0'));var zipdir=require(_0x6c2d('0x1'));var jsonpatch=require(_0x6c2d('0x2'));var rp=require(_0x6c2d('0x3'));var moment=require(_0x6c2d('0x4'));var BPromise=require(_0x6c2d('0x5'));var Mustache=require('mustache');var util=require(_0x6c2d('0x6'));var path=require(_0x6c2d('0x7'));var sox=require(_0x6c2d('0x8'));var csv=require(_0x6c2d('0x9'));var ejs=require(_0x6c2d('0xa'));var fs=require('fs');var _=require(_0x6c2d('0xb'));var squel=require(_0x6c2d('0xc'));var crypto=require(_0x6c2d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6c2d('0xe'));var toCsv=require(_0x6c2d('0x9'));var querystring=require('querystring');var Papa=require(_0x6c2d('0xf'));var qs=require(_0x6c2d('0x10'));var logger=require(_0x6c2d('0x11'))(_0x6c2d('0x12'));var utils=require(_0x6c2d('0x13'));var config=require(_0x6c2d('0x14'));var db=require(_0x6c2d('0x15'))['db'];var jayson=require(_0x6c2d('0x16'));var client=jayson[_0x6c2d('0x17')][_0x6c2d('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x5b6b5c,_0x12c23a,_0xa78412,_0x40603d){return new BPromise(function(_0x3ebaa2,_0x49c475){var _0x252d23=_0x40603d||client;return _0x252d23[_0x6c2d('0x19')](_0x5b6b5c,_0xa78412)['then'](function(_0x6c9695){logger[_0x6c2d('0x1a')]('Network,\x20%s,\x20%s',_0x12c23a,'request\x20sent');logger[_0x6c2d('0x1b')](_0x6c2d('0x1c'),_0x12c23a,'request\x20sent',JSON['stringify'](_0x6c9695));if(_0x6c9695[_0x6c2d('0x1d')]){if(_0x6c9695[_0x6c2d('0x1d')]['code']===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x12c23a,_0x6c9695[_0x6c2d('0x1d')][_0x6c2d('0x1e')]);return _0x49c475(_0x6c9695[_0x6c2d('0x1d')][_0x6c2d('0x1e')]);}logger['error'](_0x6c2d('0x1f'),_0x12c23a,_0x6c9695[_0x6c2d('0x1d')]['message']);return _0x3ebaa2(_0x6c9695['error'][_0x6c2d('0x1e')]);}else{logger[_0x6c2d('0x1a')](_0x6c2d('0x1f'),_0x12c23a,'request\x20sent');_0x3ebaa2(_0x6c9695[_0x6c2d('0x20')][_0x6c2d('0x1e')]);}})[_0x6c2d('0x21')](function(_0x2bf0a0){logger[_0x6c2d('0x1d')]('Network,\x20%s,\x20%s',_0x12c23a,_0x2bf0a0);_0x49c475(_0x2bf0a0);});});}function respondWithStatusCode(_0x58a53a,_0x419f24){_0x419f24=_0x419f24||0xcc;return function(_0x4eac16){if(_0x4eac16){return _0x58a53a[_0x6c2d('0x22')](_0x419f24);}return _0x58a53a[_0x6c2d('0x23')](_0x419f24)[_0x6c2d('0x24')]();};}function respondWithResult(_0xb905,_0x309d03){_0x309d03=_0x309d03||0xc8;return function(_0x2d81a6){if(_0x2d81a6){return _0xb905[_0x6c2d('0x23')](_0x309d03)[_0x6c2d('0x25')](_0x2d81a6);}};}function respondWithFilteredResult(_0x4a563c,_0x2eba95){return function(_0x4aea97){if(_0x4aea97){var _0x3f7a1b=_0x4aea97[_0x6c2d('0x26')],_0x35787e=_0x2eba95[_0x6c2d('0x27')],_0x4c8651=_0x2eba95[_0x6c2d('0x27')]+_0x2eba95[_0x6c2d('0x28')],_0xbe04d0;if(_0x4c8651>=_0x3f7a1b){_0x4c8651=_0x3f7a1b;_0xbe04d0=0xc8;}else{_0xbe04d0=0xce;}_0x4a563c[_0x6c2d('0x23')](_0xbe04d0);return _0x4a563c[_0x6c2d('0x29')](_0x6c2d('0x2a'),_0x35787e+'-'+_0x4c8651+'/'+_0x3f7a1b)[_0x6c2d('0x25')](_0x4aea97);}return null;};}function patchUpdates(_0x1633f5){return function(_0x214491){try{jsonpatch['apply'](_0x214491,_0x1633f5,!![]);}catch(_0x4f9521){return BPromise['reject'](_0x4f9521);}return _0x214491['save']();};}function saveUpdates(_0x1c01a9,_0x1b12b7){return function(_0x2fb7b6){if(_0x2fb7b6){return _0x2fb7b6[_0x6c2d('0x2b')](_0x1c01a9)[_0x6c2d('0x2c')](function(_0x15f972){return _0x15f972;});}return null;};}function removeEntity(_0x535dd5,_0x40e4ce){return function(_0x26ce50){if(_0x26ce50){return _0x26ce50[_0x6c2d('0x2d')]()[_0x6c2d('0x2c')](function(){_0x535dd5[_0x6c2d('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x118d14,_0xc80132){return function(_0x23f1c5){if(!_0x23f1c5){_0x118d14[_0x6c2d('0x22')](0x194);}return _0x23f1c5;};}function handleError(_0x2218b8,_0x418843){_0x418843=_0x418843||0x1f4;return function(_0x3dea7a){logger[_0x6c2d('0x1d')](_0x3dea7a[_0x6c2d('0x2e')]);if(_0x3dea7a[_0x6c2d('0x2f')]){delete _0x3dea7a[_0x6c2d('0x2f')];}_0x2218b8[_0x6c2d('0x23')](_0x418843)[_0x6c2d('0x30')](_0x3dea7a);};}exports[_0x6c2d('0x31')]=function(_0x3e85f0,_0x2c4456){var _0x2876d2={},_0x3ee110={},_0x2cb639={'count':0x0,'rows':[]};var _0x55c702=db['Network'][_0x6c2d('0x32')];_0x3ee110[_0x6c2d('0x33')]=_[_0x6c2d('0x34')](_0x55c702);var _0x38121e={'dateStart':_0x3e85f0[_0x6c2d('0x35')][_0x6c2d('0x36')],'dateEnd':_0x3e85f0[_0x6c2d('0x35')][_0x6c2d('0x37')]};delete _0x3e85f0[_0x6c2d('0x35')][_0x6c2d('0x36')];delete _0x3e85f0[_0x6c2d('0x35')][_0x6c2d('0x37')];_0x3ee110[_0x6c2d('0x35')]=_[_0x6c2d('0x34')](_0x3e85f0[_0x6c2d('0x35')]);_0x3ee110['filters']=_['intersection'](_0x3ee110[_0x6c2d('0x33')],_0x3ee110['query']);_0x2876d2[_0x6c2d('0x38')]=_['intersection'](_0x3ee110[_0x6c2d('0x33')],qs[_0x6c2d('0x39')](_0x3e85f0['query'][_0x6c2d('0x39')]));_0x2876d2['attributes']=_0x2876d2['attributes'][_0x6c2d('0x3a')]?_0x2876d2[_0x6c2d('0x38')]:_0x3ee110[_0x6c2d('0x33')];if(!_0x3e85f0[_0x6c2d('0x35')][_0x6c2d('0x3b')](_0x6c2d('0x3c'))){_0x2876d2['limit']=qs[_0x6c2d('0x28')](_0x3e85f0[_0x6c2d('0x35')]['limit']);_0x2876d2['offset']=qs[_0x6c2d('0x27')](_0x3e85f0[_0x6c2d('0x35')][_0x6c2d('0x27')]);}_0x2876d2[_0x6c2d('0x3d')]=qs[_0x6c2d('0x3e')](_0x3e85f0[_0x6c2d('0x35')][_0x6c2d('0x3e')]);_0x2876d2[_0x6c2d('0x3f')]=qs[_0x6c2d('0x40')](_['pick'](_0x3e85f0['query'],_0x3ee110[_0x6c2d('0x40')]));if(_0x38121e[_0x6c2d('0x36')]){if(_0x38121e[_0x6c2d('0x37')]){_0x38121e[_0x6c2d('0x37')]=moment(_0x38121e['dateEnd'])[_0x6c2d('0x41')](0x1,_0x6c2d('0x42'));}else{_0x38121e[_0x6c2d('0x37')]=moment(_0x38121e[_0x6c2d('0x36')])[_0x6c2d('0x41')](0x1,_0x6c2d('0x42'));}_['merge'](_0x2876d2[_0x6c2d('0x3f')],{'createdAt':{'$gte':_0x38121e['dateStart'],'$lte':_0x38121e['dateEnd']}});}if(_0x3e85f0[_0x6c2d('0x35')][_0x6c2d('0x43')]){_0x2876d2[_0x6c2d('0x3f')]=_[_0x6c2d('0x44')](_0x2876d2[_0x6c2d('0x3f')],{'$or':_[_0x6c2d('0x45')](_0x2876d2[_0x6c2d('0x38')],function(_0x4550da){var _0x414999={};_0x414999[_0x4550da]={'$like':'%'+_0x3e85f0['query']['filter']+'%'};return _0x414999;})});}_0x2876d2=_['merge']({},_0x2876d2,_0x3e85f0[_0x6c2d('0x46')]);var _0x14f94e={'where':_0x2876d2[_0x6c2d('0x3f')]};return db[_0x6c2d('0x47')][_0x6c2d('0x26')](_0x14f94e)[_0x6c2d('0x2c')](function(_0xf128ec){_0x2cb639['count']=_0xf128ec;if(_0x3e85f0[_0x6c2d('0x35')][_0x6c2d('0x48')]){_0x2876d2[_0x6c2d('0x49')]=[{'all':!![]}];}return db[_0x6c2d('0x47')][_0x6c2d('0x4a')](_0x2876d2);})[_0x6c2d('0x2c')](function(_0x2bcdbb){_0x2cb639[_0x6c2d('0x4b')]=_0x2bcdbb;return _0x2cb639;})['then'](respondWithFilteredResult(_0x2c4456,_0x2876d2))[_0x6c2d('0x21')](handleError(_0x2c4456,null));};exports[_0x6c2d('0x4c')]=function(_0x429617,_0x1729af){var _0x3d5ad3={'raw':!![],'where':{'id':_0x429617[_0x6c2d('0x4d')]['id']}},_0x536610={};_0x536610[_0x6c2d('0x33')]=_[_0x6c2d('0x34')](db['Network'][_0x6c2d('0x32')]);_0x536610[_0x6c2d('0x35')]=_['keys'](_0x429617['query']);_0x536610[_0x6c2d('0x40')]=_[_0x6c2d('0x4e')](_0x536610[_0x6c2d('0x33')],_0x536610[_0x6c2d('0x35')]);_0x3d5ad3['attributes']=_['intersection'](_0x536610[_0x6c2d('0x33')],qs['fields'](_0x429617[_0x6c2d('0x35')]['fields']));_0x3d5ad3[_0x6c2d('0x38')]=_0x3d5ad3[_0x6c2d('0x38')][_0x6c2d('0x3a')]?_0x3d5ad3[_0x6c2d('0x38')]:_0x536610[_0x6c2d('0x33')];if(_0x429617[_0x6c2d('0x35')]['includeAll']){_0x3d5ad3[_0x6c2d('0x49')]=[{'all':!![]}];}_0x3d5ad3=_[_0x6c2d('0x44')]({},_0x3d5ad3,_0x429617[_0x6c2d('0x46')]);return db[_0x6c2d('0x47')][_0x6c2d('0x4f')](_0x3d5ad3)[_0x6c2d('0x2c')](handleEntityNotFound(_0x1729af,null))[_0x6c2d('0x2c')](respondWithResult(_0x1729af,null))[_0x6c2d('0x21')](handleError(_0x1729af,null));};exports[_0x6c2d('0x50')]=function(_0x5addea,_0x3a325d,_0x349602){var _0xf48e45;return db[_0x6c2d('0x51')][_0x6c2d('0x52')](function(_0x1179b5){return db[_0x6c2d('0x47')]['create'](_0x5addea['body'],{'raw':!![]})[_0x6c2d('0x2c')](function(_0x5ef59c){_0xf48e45=_0x5ef59c;return db[_0x6c2d('0x47')][_0x6c2d('0x4a')]({'where':{'type':_0x5addea[_0x6c2d('0x53')][_0x6c2d('0x54')]},'raw':!![]});})['then'](function(_0x29068d){var _0x18f5ba=fs[_0x6c2d('0x55')](path[_0x6c2d('0x56')](config[_0x6c2d('0x57')],'server/files/templates/network.ejs'),_0x6c2d('0x58'));var _0x319aef=ejs['render'](_0x18f5ba,{'networks':_0x29068d||[]});fs[_0x6c2d('0x59')](util[_0x6c2d('0x5a')](_0x6c2d('0x5b'),_0x5addea[_0x6c2d('0x53')][_0x6c2d('0x54')]['toLowerCase']()),_0x319aef);})[_0x6c2d('0x2c')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})['then'](function(){return _0xf48e45;});})[_0x6c2d('0x2c')](respondWithResult(_0x3a325d,0xc9))[_0x6c2d('0x21')](handleError(_0x3a325d,null));};exports['update']=function(_0x16bc83,_0x2e897b,_0x771bee){var _0x58a081;return db[_0x6c2d('0x51')][_0x6c2d('0x52')](function(_0x329c35){return db[_0x6c2d('0x47')][_0x6c2d('0x4f')]({'where':{'id':_0x16bc83[_0x6c2d('0x4d')]['id']}})[_0x6c2d('0x2c')](handleEntityNotFound(_0x2e897b,null))[_0x6c2d('0x2c')](saveUpdates(_0x16bc83['body'],null))[_0x6c2d('0x2c')](function(_0x4d631c){if(_0x4d631c){_0x58a081=_0x4d631c;return db[_0x6c2d('0x47')][_0x6c2d('0x4a')]({'where':{'type':_0x58a081[_0x6c2d('0x54')]},'raw':!![]});}return null;})['then'](function(_0xc34746){if(_0xc34746){var _0x474826=fs[_0x6c2d('0x55')](path[_0x6c2d('0x56')](config['root'],_0x6c2d('0x5c')),_0x6c2d('0x58'));var _0x5856a0=ejs[_0x6c2d('0x5d')](_0x474826,{'networks':_0xc34746||[]});fs[_0x6c2d('0x59')](util[_0x6c2d('0x5a')]('/etc/asterisk/sip_xcally_%s.conf',_0x58a081[_0x6c2d('0x54')][_0x6c2d('0x5e')]()),_0x5856a0);return respondWithRpcPromise('Reload',_0x6c2d('0x2b'),{'module':_0x6c2d('0x5f')});}return null;})[_0x6c2d('0x2c')](function(_0xd1ed57){if(_0xd1ed57){return _0x58a081;}return null;});})[_0x6c2d('0x2c')](respondWithResult(_0x2e897b,null))[_0x6c2d('0x21')](handleError(_0x2e897b,null));};exports[_0x6c2d('0x2d')]=function(_0x13a15e,_0x2d414a,_0x376ede){var _0x49746f;return db[_0x6c2d('0x47')][_0x6c2d('0x4f')]({'where':{'id':_0x13a15e[_0x6c2d('0x4d')]['id']}})[_0x6c2d('0x2c')](function(_0x4e3f16){_0x49746f=_0x4e3f16;return _0x4e3f16;})[_0x6c2d('0x2c')](handleEntityNotFound(_0x2d414a,null))[_0x6c2d('0x2c')](removeEntity(_0x2d414a,null))[_0x6c2d('0x2c')](function(){if(_0x49746f){return db[_0x6c2d('0x47')]['findAll']({'where':{'type':_0x49746f[_0x6c2d('0x54')]},'raw':!![]});}})['then'](function(_0x5b4dd){if(_0x5b4dd){var _0x36111a=fs[_0x6c2d('0x55')](path[_0x6c2d('0x56')](config['root'],'server/files/templates/network.ejs'),'utf8');var _0x5730d6=ejs[_0x6c2d('0x5d')](_0x36111a,{'networks':_0x5b4dd||[]});fs[_0x6c2d('0x59')](util[_0x6c2d('0x5a')](_0x6c2d('0x5b'),_0x49746f['type'][_0x6c2d('0x5e')]()),_0x5730d6);return respondWithRpcPromise(_0x6c2d('0x60'),_0x6c2d('0x2d'),{'module':_0x6c2d('0x5f')});}})[_0x6c2d('0x21')](handleError(_0x2d414a,null));};
\ No newline at end of file
index bf78009..de876dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7a3=['util','../../config/logger','api','moment','bluebird','request-promise','./network.attributes','exports','define','Network','network','lodash'];(function(_0x46b761,_0x485916){var _0x12a38a=function(_0x42d541){while(--_0x42d541){_0x46b761['push'](_0x46b761['shift']());}};_0x12a38a(++_0x485916);}(_0xc7a3,0xbf));var _0x3c7a=function(_0xa788d6,_0x5b1ad8){_0xa788d6=_0xa788d6-0x0;var _0x336074=_0xc7a3[_0xa788d6];return _0x336074;};'use strict';var _=require(_0x3c7a('0x0'));var util=require(_0x3c7a('0x1'));var logger=require(_0x3c7a('0x2'))(_0x3c7a('0x3'));var moment=require(_0x3c7a('0x4'));var BPromise=require(_0x3c7a('0x5'));var rp=require(_0x3c7a('0x6'));var attributes=require(_0x3c7a('0x7'));module[_0x3c7a('0x8')]=function(_0x46ccca,_0x502978){return _0x46ccca[_0x3c7a('0x9')](_0x3c7a('0xa'),attributes,{'tableName':_0x3c7a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x94b8=['./network.attributes','define','network','lodash','../../config/logger','api','moment','request-promise'];(function(_0x512973,_0x564e8b){var _0x32f2e1=function(_0x5d5d3b){while(--_0x5d5d3b){_0x512973['push'](_0x512973['shift']());}};_0x32f2e1(++_0x564e8b);}(_0x94b8,0x1cb));var _0x894b=function(_0x60c3ac,_0x5e8568){_0x60c3ac=_0x60c3ac-0x0;var _0x4462c4=_0x94b8[_0x60c3ac];return _0x4462c4;};'use strict';var _=require(_0x894b('0x0'));var util=require('util');var logger=require(_0x894b('0x1'))(_0x894b('0x2'));var moment=require(_0x894b('0x3'));var BPromise=require('bluebird');var rp=require(_0x894b('0x4'));var attributes=require(_0x894b('0x5'));module['exports']=function(_0x5e0341,_0x6f249e){return _0x5e0341[_0x894b('0x6')]('Network',attributes,{'tableName':_0x894b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d8fb227..79426f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd11=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3dd54c,_0x266b92){var _0x515ff2=function(_0x245d61){while(--_0x245d61){_0x3dd54c['push'](_0x3dd54c['shift']());}};_0x515ff2(++_0x266b92);}(_0xbd11,0xe1));var _0x1bd1=function(_0x2e5727,_0x1a1910){_0x2e5727=_0x2e5727-0x0;var _0x41faad=_0xbd11[_0x2e5727];return _0x41faad;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1bd1('0x0'));var BPromise=require(_0x1bd1('0x1'));var rs=require(_0x1bd1('0x2'));var fs=require('fs');var db=require(_0x1bd1('0x3'))['db'];var utils=require(_0x1bd1('0x4'));var logger=require(_0x1bd1('0x5'))(_0x1bd1('0x6'));var config=require(_0x1bd1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1bd1('0x8')][_0x1bd1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3664dd,_0x2cbdf6,_0x4c737c){return new BPromise(function(_0x93b2c8,_0x3cb4c7){return client[_0x1bd1('0xa')](_0x3664dd,_0x4c737c)[_0x1bd1('0xb')](function(_0x51341f){logger[_0x1bd1('0xc')](_0x1bd1('0xd'),_0x2cbdf6,_0x1bd1('0xe'));logger[_0x1bd1('0xf')](_0x1bd1('0x10'),_0x2cbdf6,'request\x20sent',JSON[_0x1bd1('0x11')](_0x51341f));if(_0x51341f[_0x1bd1('0x12')]){if(_0x51341f['error'][_0x1bd1('0x13')]===0x1f4){logger[_0x1bd1('0x12')]('Network,\x20%s,\x20%s',_0x2cbdf6,_0x51341f['error'][_0x1bd1('0x14')]);return _0x3cb4c7(_0x51341f[_0x1bd1('0x12')][_0x1bd1('0x14')]);}logger[_0x1bd1('0x12')](_0x1bd1('0xd'),_0x2cbdf6,_0x51341f[_0x1bd1('0x12')][_0x1bd1('0x14')]);return _0x93b2c8(_0x51341f[_0x1bd1('0x12')][_0x1bd1('0x14')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x2cbdf6,_0x1bd1('0xe'));_0x93b2c8(_0x51341f[_0x1bd1('0x15')][_0x1bd1('0x14')]);}})[_0x1bd1('0x16')](function(_0x235b3e){logger[_0x1bd1('0x12')](_0x1bd1('0xd'),_0x2cbdf6,_0x235b3e);_0x3cb4c7(_0x235b3e);});});}
\ No newline at end of file
+var _0x476d=['catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','stringify','error','code','Network,\x20%s,\x20%s','message'];(function(_0x128607,_0x242e5f){var _0x4ba37b=function(_0x42aa1d){while(--_0x42aa1d){_0x128607['push'](_0x128607['shift']());}};_0x4ba37b(++_0x242e5f);}(_0x476d,0x17d));var _0xd476=function(_0x58697b,_0x255f18){_0x58697b=_0x58697b-0x0;var _0x5bab49=_0x476d[_0x58697b];return _0x5bab49;};'use strict';var _=require('lodash');var util=require(_0xd476('0x0'));var moment=require(_0xd476('0x1'));var BPromise=require(_0xd476('0x2'));var rs=require('randomstring');var fs=require('fs');var db=require(_0xd476('0x3'))['db'];var utils=require(_0xd476('0x4'));var logger=require(_0xd476('0x5'))(_0xd476('0x6'));var config=require(_0xd476('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd476('0x8')][_0xd476('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bd6b2,_0x53ffce,_0x2bb01a){return new BPromise(function(_0x22f68f,_0x37e7e7){return client[_0xd476('0xa')](_0x2bd6b2,_0x2bb01a)['then'](function(_0x2ad558){logger[_0xd476('0xb')]('Network,\x20%s,\x20%s',_0x53ffce,_0xd476('0xc'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x53ffce,_0xd476('0xc'),JSON[_0xd476('0xd')](_0x2ad558));if(_0x2ad558['error']){if(_0x2ad558[_0xd476('0xe')][_0xd476('0xf')]===0x1f4){logger[_0xd476('0xe')](_0xd476('0x10'),_0x53ffce,_0x2ad558[_0xd476('0xe')][_0xd476('0x11')]);return _0x37e7e7(_0x2ad558[_0xd476('0xe')][_0xd476('0x11')]);}logger[_0xd476('0xe')](_0xd476('0x10'),_0x53ffce,_0x2ad558['error'][_0xd476('0x11')]);return _0x22f68f(_0x2ad558['error'][_0xd476('0x11')]);}else{logger[_0xd476('0xb')](_0xd476('0x10'),_0x53ffce,_0xd476('0xc'));_0x22f68f(_0x2ad558['result']['message']);}})[_0xd476('0x12')](function(_0x1f5f97){logger[_0xd476('0xe')](_0xd476('0x10'),_0x53ffce,_0x1f5f97);_0x37e7e7(_0x1f5f97);});});}
\ No newline at end of file
index 4538ad5..26c41e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc590=['isAuthenticated','get','describe','show','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','notify','addApplications','addAgents','/:id/send','send','/:id','update','delete','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller'];(function(_0x3988a1,_0x2eaac1){var _0x37be64=function(_0x1bfbbd){while(--_0x1bfbbd){_0x3988a1['push'](_0x3988a1['shift']());}};_0x37be64(++_0x2eaac1);}(_0xc590,0x160));var _0x0c59=function(_0x3b8111,_0x4263fb){_0x3b8111=_0x3b8111-0x0;var _0x1bb16b=_0xc590[_0x3b8111];return _0x1bb16b;};'use strict';var multer=require(_0x0c59('0x0'));var util=require(_0x0c59('0x1'));var path=require(_0x0c59('0x2'));var express=require(_0x0c59('0x3'));var router=express[_0x0c59('0x4')]();var auth=require(_0x0c59('0x5'));var interaction=require(_0x0c59('0x6'));var config=require('../../config/environment');var controller=require(_0x0c59('0x7'));router['get']('/',auth[_0x0c59('0x8')](),controller['index']);router[_0x0c59('0x9')]('/describe',auth[_0x0c59('0x8')](),controller[_0x0c59('0xa')]);router['get']('/:id',auth[_0x0c59('0x8')](),controller[_0x0c59('0xb')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x0c59('0xc')]);router[_0x0c59('0x9')]('/:id/canned_answers',auth[_0x0c59('0x8')](),controller[_0x0c59('0xd')]);router['get'](_0x0c59('0xe'),auth['isAuthenticated'](),controller[_0x0c59('0xf')]);router['get'](_0x0c59('0x10'),auth[_0x0c59('0x8')](),controller['getInteractions']);router[_0x0c59('0x9')](_0x0c59('0x11'),auth['isAuthenticated'](),controller[_0x0c59('0x12')]);router[_0x0c59('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0c59('0x13')]('/:id/dispositions',auth[_0x0c59('0x8')](),controller[_0x0c59('0x14')]);router[_0x0c59('0x13')](_0x0c59('0x15'),auth[_0x0c59('0x8')](),controller[_0x0c59('0x16')]);router[_0x0c59('0x13')]('/:id/notify',controller[_0x0c59('0x17')]);router[_0x0c59('0x13')]('/:id/applications',auth['isAuthenticated'](),controller[_0x0c59('0x18')]);router[_0x0c59('0x13')](_0x0c59('0x11'),auth[_0x0c59('0x8')](),controller[_0x0c59('0x19')]);router['post'](_0x0c59('0x1a'),auth[_0x0c59('0x8')](),controller[_0x0c59('0x1b')]);router['put'](_0x0c59('0x1c'),auth[_0x0c59('0x8')](),controller[_0x0c59('0x1d')]);router[_0x0c59('0x1e')](_0x0c59('0x1c'),auth[_0x0c59('0x8')](),controller['destroy']);router[_0x0c59('0x1e')](_0x0c59('0x1f'),auth[_0x0c59('0x8')](),controller[_0x0c59('0x20')]);router[_0x0c59('0x1e')](_0x0c59('0x15'),auth[_0x0c59('0x8')](),controller[_0x0c59('0x21')]);router[_0x0c59('0x1e')](_0x0c59('0x11'),auth[_0x0c59('0x8')](),controller[_0x0c59('0x22')]);module[_0x0c59('0x23')]=router;
\ No newline at end of file
+var _0xc7e7=['/:id/users','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getAgents','post','create','addDisposition','/:id/notify','notify','/:id/applications','addApplications','addAgents','/:id/send','send','put','update','/:id','delete','removeDispositions'];(function(_0x41f41a,_0x593be7){var _0x4d67b4=function(_0x8a709d){while(--_0x8a709d){_0x41f41a['push'](_0x41f41a['shift']());}};_0x4d67b4(++_0x593be7);}(_0xc7e7,0x14b));var _0x7c7e=function(_0x1f73f1,_0x58a4d8){_0x1f73f1=_0x1f73f1-0x0;var _0x2ec016=_0xc7e7[_0x1f73f1];return _0x2ec016;};'use strict';var multer=require(_0x7c7e('0x0'));var util=require('util');var path=require(_0x7c7e('0x1'));var express=require(_0x7c7e('0x2'));var router=express[_0x7c7e('0x3')]();var auth=require(_0x7c7e('0x4'));var interaction=require(_0x7c7e('0x5'));var config=require('../../config/environment');var controller=require(_0x7c7e('0x6'));router[_0x7c7e('0x7')]('/',auth[_0x7c7e('0x8')](),controller[_0x7c7e('0x9')]);router[_0x7c7e('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x7c7e('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7c7e('0xb')]);router[_0x7c7e('0x7')](_0x7c7e('0xc'),auth[_0x7c7e('0x8')](),controller[_0x7c7e('0xd')]);router['get'](_0x7c7e('0xe'),auth[_0x7c7e('0x8')](),controller[_0x7c7e('0xf')]);router[_0x7c7e('0x7')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router['get']('/:id/interactions',auth[_0x7c7e('0x8')](),controller['getInteractions']);router[_0x7c7e('0x7')]('/:id/users',auth[_0x7c7e('0x8')](),controller[_0x7c7e('0x10')]);router[_0x7c7e('0x11')]('/',auth[_0x7c7e('0x8')](),controller[_0x7c7e('0x12')]);router['post'](_0x7c7e('0xc'),auth['isAuthenticated'](),controller[_0x7c7e('0x13')]);router[_0x7c7e('0x11')](_0x7c7e('0xe'),auth['isAuthenticated'](),controller['addAnswer']);router['post'](_0x7c7e('0x14'),controller[_0x7c7e('0x15')]);router[_0x7c7e('0x11')](_0x7c7e('0x16'),auth[_0x7c7e('0x8')](),controller[_0x7c7e('0x17')]);router['post']('/:id/users',auth[_0x7c7e('0x8')](),controller[_0x7c7e('0x18')]);router[_0x7c7e('0x11')](_0x7c7e('0x19'),auth[_0x7c7e('0x8')](),controller[_0x7c7e('0x1a')]);router[_0x7c7e('0x1b')]('/:id',auth[_0x7c7e('0x8')](),controller[_0x7c7e('0x1c')]);router['delete'](_0x7c7e('0x1d'),auth[_0x7c7e('0x8')](),controller['destroy']);router[_0x7c7e('0x1e')]('/:id/dispositions',auth[_0x7c7e('0x8')](),controller[_0x7c7e('0x1f')]);router[_0x7c7e('0x1e')](_0x7c7e('0xe'),auth[_0x7c7e('0x8')](),controller['removeAnswers']);router['delete'](_0x7c7e('0x20'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index fe13f15..39015e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','sequelize','randomstring','exports','STRING','generate','TEXT'];(function(_0x4bd710,_0x237f88){var _0x30f143=function(_0x5ac459){while(--_0x5ac459){_0x4bd710['push'](_0x4bd710['shift']());}};_0x30f143(++_0x237f88);}(_0x34e8,0x12c));var _0x834e=function(_0x5bc2ce,_0x4207e0){_0x5bc2ce=_0x5bc2ce-0x0;var _0x1f507d=_0x34e8[_0x5bc2ce];return _0x1f507d;};'use strict';var Sequelize=require(_0x834e('0x0'));var rs=require(_0x834e('0x1'));module[_0x834e('0x2')]={'name':{'type':Sequelize[_0x834e('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x834e('0x3')]},'token':{'type':Sequelize[_0x834e('0x3')],'defaultValue':function(){return rs[_0x834e('0x4')]();}},'replyUri':{'type':Sequelize[_0x834e('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x834e('0x5')],'defaultValue':function(){return _0x834e('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x834e('0x3')]},'queueTransfer':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x834e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x834e('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x834e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c}};
\ No newline at end of file
+var _0x00bb=['generate','TEXT','INTEGER','BOOLEAN','sequelize','randomstring','exports','name','STRING'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x00bb[_0x4e9628];return _0x27bc8c;};'use strict';var Sequelize=require(_0xb00b('0x0'));var rs=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xb00b('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xb00b('0x4')],'defaultValue':function(){return rs[_0xb00b('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xb00b('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb00b('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb00b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xb00b('0x4')]},'queueTransfer':{'type':Sequelize[_0xb00b('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb00b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb00b('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb00b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c}};
\ No newline at end of file
index 0bdf243..e17717f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1a9=['createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','Applications','account','applications','list','List','priority','asc','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','spread','get','created','unmanaged','*,*,*,*','AttachmentId','interaction','User','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','isArray','userOpenchannelAccount:remove','getAgents','DESC','defaults','user','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/utils','../../config/environment','localhost','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','update','destroy','end','name','send','index','rawAttributes','model','keys','query','dateStart','dateEnd','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','add','day','merge','map','filter','options','OpenchannelAccount','count','includeAll','include','rows','show','params','find','body','describe','addDisposition','OpnechannelAccountId','Disposition','create','getDispositions','findOne','OpenchannelAccountId','findAll','removeDispositions','addAnswer','getAnswers','CannedAnswer','sort','pick','removeAnswers','ids','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference'];(function(_0x13da62,_0x2d0c19){var _0x264fcc=function(_0x11988f){while(--_0x11988f){_0x13da62['push'](_0x13da62['shift']());}};_0x264fcc(++_0x2d0c19);}(_0xe1a9,0x1a4));var _0x9e1a=function(_0x4bfdb6,_0x2e1742){_0x4bfdb6=_0x4bfdb6-0x0;var _0x1d51bc=_0xe1a9[_0x4bfdb6];return _0x1d51bc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9e1a('0x0'));var rimraf=require(_0x9e1a('0x1'));var zipdir=require(_0x9e1a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e1a('0x3'));var moment=require(_0x9e1a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9e1a('0x5'));var util=require(_0x9e1a('0x6'));var path=require(_0x9e1a('0x7'));var sox=require(_0x9e1a('0x8'));var csv=require(_0x9e1a('0x9'));var ejs=require(_0x9e1a('0xa'));var fs=require('fs');var _=require(_0x9e1a('0xb'));var squel=require(_0x9e1a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9e1a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9e1a('0xe'));var Papa=require(_0x9e1a('0xf'));var qs=require(_0x9e1a('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x9e1a('0x11'));var config=require(_0x9e1a('0x12'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')({'host':_0x9e1a('0x13'),'port':0x18eb});require(_0x9e1a('0x14'))[_0x9e1a('0x15')](socket);var jayson=require(_0x9e1a('0x16'));var client=jayson[_0x9e1a('0x17')]['http']({'port':0x232c});var client9002=jayson[_0x9e1a('0x17')][_0x9e1a('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x130e85,_0x320de1,_0x50c2cf,_0x284762){return new BPromise(function(_0x4ac7f3,_0x14e4ef){var _0x183f5a=_0x284762||client;return _0x183f5a[_0x9e1a('0x19')](_0x130e85,_0x50c2cf)[_0x9e1a('0x1a')](function(_0x3e8c5e){logger[_0x9e1a('0x1b')](_0x9e1a('0x1c'),_0x320de1,'request\x20sent');logger['debug'](_0x9e1a('0x1d'),_0x320de1,_0x9e1a('0x1e'),JSON[_0x9e1a('0x1f')](_0x3e8c5e));if(_0x3e8c5e[_0x9e1a('0x20')]){if(_0x3e8c5e[_0x9e1a('0x20')][_0x9e1a('0x21')]===0x1f4){logger[_0x9e1a('0x20')](_0x9e1a('0x1c'),_0x320de1,_0x3e8c5e[_0x9e1a('0x20')][_0x9e1a('0x22')]);return _0x14e4ef(_0x3e8c5e['error'][_0x9e1a('0x22')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x320de1,_0x3e8c5e[_0x9e1a('0x20')][_0x9e1a('0x22')]);return _0x4ac7f3(_0x3e8c5e[_0x9e1a('0x20')]['message']);}else{logger[_0x9e1a('0x1b')](_0x9e1a('0x1c'),_0x320de1,_0x9e1a('0x1e'));_0x4ac7f3(_0x3e8c5e[_0x9e1a('0x23')][_0x9e1a('0x22')]);}})[_0x9e1a('0x24')](function(_0x13f1d5){logger[_0x9e1a('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x320de1,_0x13f1d5);_0x14e4ef(_0x13f1d5);});});}function respondWithStatusCode(_0x1062c8,_0x4fa7b7){_0x4fa7b7=_0x4fa7b7||0xcc;return function(_0x5d5523){if(_0x5d5523){return _0x1062c8[_0x9e1a('0x25')](_0x4fa7b7);}return _0x1062c8[_0x9e1a('0x26')](_0x4fa7b7)['end']();};}function respondWithResult(_0x6d0058,_0x11dde2){_0x11dde2=_0x11dde2||0xc8;return function(_0x59a47f){if(_0x59a47f){return _0x6d0058[_0x9e1a('0x26')](_0x11dde2)[_0x9e1a('0x27')](_0x59a47f);}};}function respondWithFilteredResult(_0xed0db9,_0x2e2ca4){return function(_0x4667cb){if(_0x4667cb){var _0x351f41=_0x4667cb['count'],_0x53fb34=_0x2e2ca4[_0x9e1a('0x28')],_0x516143=_0x2e2ca4[_0x9e1a('0x28')]+_0x2e2ca4[_0x9e1a('0x29')],_0x1a104b;if(_0x516143>=_0x351f41){_0x516143=_0x351f41;_0x1a104b=0xc8;}else{_0x1a104b=0xce;}_0xed0db9['status'](_0x1a104b);return _0xed0db9[_0x9e1a('0x2a')](_0x9e1a('0x2b'),_0x53fb34+'-'+_0x516143+'/'+_0x351f41)[_0x9e1a('0x27')](_0x4667cb);}return null;};}function patchUpdates(_0x4ed876){return function(_0x54274c){try{jsonpatch[_0x9e1a('0x2c')](_0x54274c,_0x4ed876,!![]);}catch(_0x330397){return BPromise['reject'](_0x330397);}return _0x54274c[_0x9e1a('0x2d')]();};}function saveUpdates(_0x27c042,_0x13b383){return function(_0x3e46e9){if(_0x3e46e9){return _0x3e46e9[_0x9e1a('0x2e')](_0x27c042)[_0x9e1a('0x1a')](function(_0xfedb04){return _0xfedb04;});}return null;};}function removeEntity(_0x25c498,_0x50b05a){return function(_0xa8ce3e){if(_0xa8ce3e){return _0xa8ce3e[_0x9e1a('0x2f')]()[_0x9e1a('0x1a')](function(){_0x25c498[_0x9e1a('0x26')](0xcc)[_0x9e1a('0x30')]();});}};}function handleEntityNotFound(_0x1a3151,_0x243ffb){return function(_0x43a45f){if(!_0x43a45f){_0x1a3151['sendStatus'](0x194);}return _0x43a45f;};}function handleError(_0x32d905,_0x1eaaab){_0x1eaaab=_0x1eaaab||0x1f4;return function(_0x2fc03b){logger['error'](_0x2fc03b['stack']);if(_0x2fc03b['name']){delete _0x2fc03b[_0x9e1a('0x31')];}_0x32d905[_0x9e1a('0x26')](_0x1eaaab)[_0x9e1a('0x32')](_0x2fc03b);};}exports[_0x9e1a('0x33')]=function(_0x314624,_0x52e03f){var _0x31c0f2={},_0x2e48b7={},_0x219d69={'count':0x0,'rows':[]};var _0x18815e=db['OpenchannelAccount'][_0x9e1a('0x34')];_0x2e48b7[_0x9e1a('0x35')]=_[_0x9e1a('0x36')](_0x18815e);var _0x1de6da={'dateStart':_0x314624[_0x9e1a('0x37')][_0x9e1a('0x38')],'dateEnd':_0x314624[_0x9e1a('0x37')][_0x9e1a('0x39')]};delete _0x314624['query']['dateStart'];delete _0x314624['query']['dateEnd'];_0x2e48b7['query']=_['keys'](_0x314624['query']);_0x2e48b7[_0x9e1a('0x3a')]=_['intersection'](_0x2e48b7[_0x9e1a('0x35')],_0x2e48b7['query']);_0x31c0f2[_0x9e1a('0x3b')]=_[_0x9e1a('0x3c')](_0x2e48b7[_0x9e1a('0x35')],qs['fields'](_0x314624[_0x9e1a('0x37')][_0x9e1a('0x3d')]));_0x31c0f2[_0x9e1a('0x3b')]=_0x31c0f2['attributes'][_0x9e1a('0x3e')]?_0x31c0f2[_0x9e1a('0x3b')]:_0x2e48b7[_0x9e1a('0x35')];if(!_0x314624['query'][_0x9e1a('0x3f')](_0x9e1a('0x40'))){_0x31c0f2[_0x9e1a('0x29')]=qs['limit'](_0x314624[_0x9e1a('0x37')][_0x9e1a('0x29')]);_0x31c0f2[_0x9e1a('0x28')]=qs['offset'](_0x314624[_0x9e1a('0x37')]['offset']);}_0x31c0f2[_0x9e1a('0x41')]=qs['sort'](_0x314624[_0x9e1a('0x37')]['sort']);_0x31c0f2[_0x9e1a('0x42')]=qs[_0x9e1a('0x3a')](_['pick'](_0x314624[_0x9e1a('0x37')],_0x2e48b7[_0x9e1a('0x3a')]));if(_0x1de6da[_0x9e1a('0x38')]){if(_0x1de6da[_0x9e1a('0x39')]){_0x1de6da[_0x9e1a('0x39')]=moment(_0x1de6da['dateEnd'])[_0x9e1a('0x43')](0x1,'day');}else{_0x1de6da['dateEnd']=moment(_0x1de6da['dateStart'])[_0x9e1a('0x43')](0x1,_0x9e1a('0x44'));}_[_0x9e1a('0x45')](_0x31c0f2[_0x9e1a('0x42')],{'createdAt':{'$gte':_0x1de6da['dateStart'],'$lte':_0x1de6da[_0x9e1a('0x39')]}});}if(_0x314624['query']['filter']){_0x31c0f2['where']=_['merge'](_0x31c0f2[_0x9e1a('0x42')],{'$or':_[_0x9e1a('0x46')](_0x31c0f2[_0x9e1a('0x3b')],function(_0x3d5d80){var _0x3023cc={};_0x3023cc[_0x3d5d80]={'$like':'%'+_0x314624[_0x9e1a('0x37')][_0x9e1a('0x47')]+'%'};return _0x3023cc;})});}_0x31c0f2=_[_0x9e1a('0x45')]({},_0x31c0f2,_0x314624[_0x9e1a('0x48')]);var _0x2590b4={'where':_0x31c0f2[_0x9e1a('0x42')]};return db[_0x9e1a('0x49')]['count'](_0x2590b4)[_0x9e1a('0x1a')](function(_0x543b25){_0x219d69[_0x9e1a('0x4a')]=_0x543b25;if(_0x314624['query'][_0x9e1a('0x4b')]){_0x31c0f2[_0x9e1a('0x4c')]=[{'all':!![]}];}return db[_0x9e1a('0x49')]['findAll'](_0x31c0f2);})['then'](function(_0x4baa0f){_0x219d69[_0x9e1a('0x4d')]=_0x4baa0f;return _0x219d69;})[_0x9e1a('0x1a')](respondWithFilteredResult(_0x52e03f,_0x31c0f2))[_0x9e1a('0x24')](handleError(_0x52e03f,null));};exports[_0x9e1a('0x4e')]=function(_0x5eabce,_0x4b8869){var _0x298b1a={'raw':![],'where':{'id':_0x5eabce[_0x9e1a('0x4f')]['id']}},_0x825744={};_0x825744[_0x9e1a('0x35')]=_[_0x9e1a('0x36')](db[_0x9e1a('0x49')][_0x9e1a('0x34')]);_0x825744[_0x9e1a('0x37')]=_[_0x9e1a('0x36')](_0x5eabce[_0x9e1a('0x37')]);_0x825744[_0x9e1a('0x3a')]=_['intersection'](_0x825744[_0x9e1a('0x35')],_0x825744[_0x9e1a('0x37')]);_0x298b1a['attributes']=_[_0x9e1a('0x3c')](_0x825744['model'],qs[_0x9e1a('0x3d')](_0x5eabce['query'][_0x9e1a('0x3d')]));_0x298b1a['attributes']=_0x298b1a[_0x9e1a('0x3b')][_0x9e1a('0x3e')]?_0x298b1a['attributes']:_0x825744[_0x9e1a('0x35')];if(_0x5eabce[_0x9e1a('0x37')][_0x9e1a('0x4b')]){_0x298b1a[_0x9e1a('0x4c')]=[{'all':!![]}];}_0x298b1a=_['merge']({},_0x298b1a,_0x5eabce[_0x9e1a('0x48')]);return db[_0x9e1a('0x49')][_0x9e1a('0x50')](_0x298b1a)[_0x9e1a('0x1a')](handleEntityNotFound(_0x4b8869,null))['then'](respondWithResult(_0x4b8869,null))['catch'](handleError(_0x4b8869,null));};exports['create']=function(_0x3cb671,_0x1e4933){return db[_0x9e1a('0x49')]['create'](_0x3cb671[_0x9e1a('0x51')],{})[_0x9e1a('0x1a')](respondWithResult(_0x1e4933,0xc9))[_0x9e1a('0x24')](handleError(_0x1e4933,null));};exports[_0x9e1a('0x2e')]=function(_0x5929f5,_0x21dabe){if(_0x5929f5['body']['id']){delete _0x5929f5['body']['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x5929f5['params']['id']}})[_0x9e1a('0x1a')](handleEntityNotFound(_0x21dabe,null))['then'](saveUpdates(_0x5929f5[_0x9e1a('0x51')],null))['then'](respondWithResult(_0x21dabe,null))[_0x9e1a('0x24')](handleError(_0x21dabe,null));};exports[_0x9e1a('0x2f')]=function(_0x4f0d9c,_0x4b634e){return db[_0x9e1a('0x49')][_0x9e1a('0x50')]({'where':{'id':_0x4f0d9c[_0x9e1a('0x4f')]['id']}})[_0x9e1a('0x1a')](handleEntityNotFound(_0x4b634e,null))[_0x9e1a('0x1a')](removeEntity(_0x4b634e,null))[_0x9e1a('0x24')](handleError(_0x4b634e,null));};exports[_0x9e1a('0x52')]=function(_0x5ba10e,_0x10b413){return db['OpenchannelAccount'][_0x9e1a('0x52')]()['then'](respondWithResult(_0x10b413,null))[_0x9e1a('0x24')](handleError(_0x10b413,null));};exports[_0x9e1a('0x53')]=function(_0x8c13d2,_0x3144b5,_0x6ee9aa){if(_0x8c13d2[_0x9e1a('0x51')]['id']){delete _0x8c13d2[_0x9e1a('0x51')]['id'];}return db[_0x9e1a('0x49')][_0x9e1a('0x50')]({'where':{'id':_0x8c13d2[_0x9e1a('0x4f')]['id']}})[_0x9e1a('0x1a')](handleEntityNotFound(_0x3144b5,null))[_0x9e1a('0x1a')](function(_0x4dbee8){if(_0x4dbee8){_0x8c13d2[_0x9e1a('0x51')][_0x9e1a('0x54')]=_0x4dbee8['id'];return db[_0x9e1a('0x55')][_0x9e1a('0x56')](_0x8c13d2['body']);}})[_0x9e1a('0x1a')](respondWithResult(_0x3144b5,null))['catch'](handleError(_0x3144b5,null));};exports[_0x9e1a('0x57')]=function(_0xe62013,_0x5b4871,_0x4affa8){var _0x1c9c09={'raw':![],'where':{}};var _0xa6c334={};var _0x466b7b={'count':0x0,'rows':[]};return db[_0x9e1a('0x49')][_0x9e1a('0x58')]({'where':{'id':_0xe62013[_0x9e1a('0x4f')]['id']}})[_0x9e1a('0x1a')](handleEntityNotFound(_0x5b4871,null))[_0x9e1a('0x1a')](function(_0x5411b8){if(_0x5411b8){_0xa6c334['model']=_[_0x9e1a('0x36')](db['Disposition'][_0x9e1a('0x34')]);_0xa6c334[_0x9e1a('0x37')]=_[_0x9e1a('0x36')](_0xe62013['query']);_0xa6c334['filters']=_['intersection'](_0xa6c334[_0x9e1a('0x35')],_0xa6c334['query']);_0x1c9c09[_0x9e1a('0x3b')]=_[_0x9e1a('0x3c')](_0xa6c334['model'],qs[_0x9e1a('0x3d')](_0xe62013[_0x9e1a('0x37')][_0x9e1a('0x3d')]));_0x1c9c09[_0x9e1a('0x3b')]=_0x1c9c09['attributes']['length']?_0x1c9c09[_0x9e1a('0x3b')]:_0xa6c334[_0x9e1a('0x35')];if(!_0xe62013[_0x9e1a('0x37')][_0x9e1a('0x3f')]('nolimit')){_0x1c9c09['limit']=qs[_0x9e1a('0x29')](_0xe62013[_0x9e1a('0x37')][_0x9e1a('0x29')]);_0x1c9c09[_0x9e1a('0x28')]=qs[_0x9e1a('0x28')](_0xe62013['query'][_0x9e1a('0x28')]);}_0x1c9c09[_0x9e1a('0x41')]=qs['sort'](_0xe62013['query']['sort']);_0x1c9c09[_0x9e1a('0x42')]=qs[_0x9e1a('0x3a')](_['pick'](_0xe62013[_0x9e1a('0x37')],_0xa6c334['filters']));_0x1c9c09[_0x9e1a('0x42')][_0x9e1a('0x59')]=_0x5411b8['id'];if(_0xe62013[_0x9e1a('0x37')][_0x9e1a('0x47')]){_0x1c9c09[_0x9e1a('0x42')]=_[_0x9e1a('0x45')](_0x1c9c09[_0x9e1a('0x42')],{'$or':_[_0x9e1a('0x46')](_0x1c9c09[_0x9e1a('0x3b')],function(_0x5a3907){var _0x23bc33={};_0x23bc33[_0x5a3907]={'$like':'%'+_0xe62013[_0x9e1a('0x37')][_0x9e1a('0x47')]+'%'};return _0x23bc33;})});}_0x1c9c09=_[_0x9e1a('0x45')]({},_0x1c9c09,_0xe62013['options']);return db['Disposition'][_0x9e1a('0x4a')]({'where':_0x1c9c09[_0x9e1a('0x42')]})['then'](function(_0x29edb2){_0x466b7b['count']=_0x29edb2;if(_0xe62013[_0x9e1a('0x37')][_0x9e1a('0x4b')]){_0x1c9c09[_0x9e1a('0x4c')]=[{'all':!![]}];}return db[_0x9e1a('0x55')][_0x9e1a('0x5a')](_0x1c9c09);})[_0x9e1a('0x1a')](function(_0x25d3d8){_0x466b7b[_0x9e1a('0x4d')]=_0x25d3d8;return _0x466b7b;});}})[_0x9e1a('0x1a')](respondWithFilteredResult(_0x5b4871,_0x1c9c09))[_0x9e1a('0x24')](handleError(_0x5b4871,null));};exports['removeDispositions']=function(_0x5c718e,_0x23b0b7,_0x5627c6){var _0x19c60b;return db[_0x9e1a('0x49')]['find']({'where':{'id':_0x5c718e[_0x9e1a('0x4f')]['id']}})[_0x9e1a('0x1a')](handleEntityNotFound(_0x23b0b7,null))[_0x9e1a('0x1a')](function(_0x4f6fee){if(_0x4f6fee){return _0x4f6fee[_0x9e1a('0x5b')](_0x5c718e[_0x9e1a('0x37')]['ids']);}})[_0x9e1a('0x1a')](respondWithStatusCode(_0x23b0b7,null))['catch'](handleError(_0x23b0b7,null));};exports[_0x9e1a('0x5c')]=function(_0x166571,_0x78a147,_0x295951){if(_0x166571['body']['id']){delete _0x166571[_0x9e1a('0x51')]['id'];}return db['OpenchannelAccount'][_0x9e1a('0x50')]({'where':{'id':_0x166571[_0x9e1a('0x4f')]['id']}})[_0x9e1a('0x1a')](handleEntityNotFound(_0x78a147,null))[_0x9e1a('0x1a')](function(_0x2ef218){if(_0x2ef218){_0x166571[_0x9e1a('0x51')][_0x9e1a('0x59')]=_0x2ef218['id'];return db['CannedAnswer'][_0x9e1a('0x56')](_0x166571[_0x9e1a('0x51')]);}})[_0x9e1a('0x1a')](respondWithResult(_0x78a147,null))[_0x9e1a('0x24')](handleError(_0x78a147,null));};exports[_0x9e1a('0x5d')]=function(_0x26f8d6,_0x4d669b,_0x4a063e){var _0x4a14bd={'raw':![],'where':{}};var _0x134c12={};var _0x448516={'count':0x0,'rows':[]};return db[_0x9e1a('0x49')][_0x9e1a('0x58')]({'where':{'id':_0x26f8d6[_0x9e1a('0x4f')]['id']}})[_0x9e1a('0x1a')](handleEntityNotFound(_0x4d669b,null))[_0x9e1a('0x1a')](function(_0x1fa860){if(_0x1fa860){_0x134c12['model']=_[_0x9e1a('0x36')](db[_0x9e1a('0x5e')]['rawAttributes']);_0x134c12[_0x9e1a('0x37')]=_[_0x9e1a('0x36')](_0x26f8d6[_0x9e1a('0x37')]);_0x134c12[_0x9e1a('0x3a')]=_[_0x9e1a('0x3c')](_0x134c12[_0x9e1a('0x35')],_0x134c12[_0x9e1a('0x37')]);_0x4a14bd[_0x9e1a('0x3b')]=_[_0x9e1a('0x3c')](_0x134c12['model'],qs[_0x9e1a('0x3d')](_0x26f8d6[_0x9e1a('0x37')]['fields']));_0x4a14bd[_0x9e1a('0x3b')]=_0x4a14bd[_0x9e1a('0x3b')][_0x9e1a('0x3e')]?_0x4a14bd[_0x9e1a('0x3b')]:_0x134c12[_0x9e1a('0x35')];if(!_0x26f8d6['query'][_0x9e1a('0x3f')](_0x9e1a('0x40'))){_0x4a14bd[_0x9e1a('0x29')]=qs['limit'](_0x26f8d6[_0x9e1a('0x37')][_0x9e1a('0x29')]);_0x4a14bd['offset']=qs[_0x9e1a('0x28')](_0x26f8d6[_0x9e1a('0x37')]['offset']);}_0x4a14bd['order']=qs['sort'](_0x26f8d6[_0x9e1a('0x37')][_0x9e1a('0x5f')]);_0x4a14bd[_0x9e1a('0x42')]=qs['filters'](_[_0x9e1a('0x60')](_0x26f8d6[_0x9e1a('0x37')],_0x134c12['filters']));_0x4a14bd[_0x9e1a('0x42')]['OpenchannelAccountId']=_0x1fa860['id'];if(_0x26f8d6[_0x9e1a('0x37')][_0x9e1a('0x47')]){_0x4a14bd['where']=_['merge'](_0x4a14bd[_0x9e1a('0x42')],{'$or':_[_0x9e1a('0x46')](_0x4a14bd[_0x9e1a('0x3b')],function(_0x35f044){var _0x48931a={};_0x48931a[_0x35f044]={'$like':'%'+_0x26f8d6[_0x9e1a('0x37')][_0x9e1a('0x47')]+'%'};return _0x48931a;})});}_0x4a14bd=_['merge']({},_0x4a14bd,_0x26f8d6['options']);return db[_0x9e1a('0x5e')][_0x9e1a('0x4a')]({'where':_0x4a14bd[_0x9e1a('0x42')]})['then'](function(_0x31acba){_0x448516[_0x9e1a('0x4a')]=_0x31acba;if(_0x26f8d6[_0x9e1a('0x37')][_0x9e1a('0x4b')]){_0x4a14bd[_0x9e1a('0x4c')]=[{'all':!![]}];}return db[_0x9e1a('0x5e')]['findAll'](_0x4a14bd);})[_0x9e1a('0x1a')](function(_0x4fa79f){_0x448516[_0x9e1a('0x4d')]=_0x4fa79f;return _0x448516;});}})['then'](respondWithFilteredResult(_0x4d669b,_0x4a14bd))[_0x9e1a('0x24')](handleError(_0x4d669b,null));};exports[_0x9e1a('0x61')]=function(_0x3ab5ff,_0x105cb8,_0x312113){var _0x5d927b;return db[_0x9e1a('0x49')][_0x9e1a('0x50')]({'where':{'id':_0x3ab5ff[_0x9e1a('0x4f')]['id']}})[_0x9e1a('0x1a')](handleEntityNotFound(_0x105cb8,null))[_0x9e1a('0x1a')](function(_0x29506e){if(_0x29506e){return _0x29506e[_0x9e1a('0x61')](_0x3ab5ff[_0x9e1a('0x37')][_0x9e1a('0x62')]);}})[_0x9e1a('0x1a')](respondWithStatusCode(_0x105cb8,null))[_0x9e1a('0x24')](handleError(_0x105cb8,null));};exports[_0x9e1a('0x63')]=function(_0x407ca8,_0x33ec61,_0x2f1d41){var _0x39e697={'body':_0x407ca8[_0x9e1a('0x51')],'channel':_0x9e1a('0x64')};var _0x5ec918=[];var _0x2bdc17=[];var _0x1c885a={};var _0x58ff05=![];return db[_0x9e1a('0x65')][_0x9e1a('0x52')]()[_0x9e1a('0x1a')](function(_0xcb17dd){if(!_0xcb17dd){throw new db['Sequelize'][(_0x9e1a('0x66'))](_0x9e1a('0x67'));}_0x5ec918=_[_0x9e1a('0x68')](_[_0x9e1a('0x36')](_0xcb17dd),[_0x9e1a('0x69'),_0x9e1a('0x6a')]);_0x2bdc17=_[_0x9e1a('0x68')](_[_0x9e1a('0x36')](_0xcb17dd),[_0x9e1a('0x69'),'updatedAt',_0x9e1a('0x6b'),_0x9e1a('0x6c')]);if(_0x407ca8[_0x9e1a('0x51')]['id']){delete _0x407ca8[_0x9e1a('0x51')]['id'];}if(_[_0x9e1a('0x6d')](_0x407ca8['body'][_0x9e1a('0x6e')])){throw new db['Sequelize']['ValidationError'](_0x9e1a('0x6f'));}if(_[_0x9e1a('0x6d')](_0x407ca8[_0x9e1a('0x51')][_0x9e1a('0x51')])||_0x407ca8['body'][_0x9e1a('0x51')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9e1a('0x6d')](_0x407ca8[_0x9e1a('0x51')]['mapKey'])){throw new db[(_0x9e1a('0x70'))][(_0x9e1a('0x66'))](_0x9e1a('0x71')+_0x2bdc17);}if(!_[_0x9e1a('0x72')](_0x2bdc17,_0x407ca8[_0x9e1a('0x51')][_0x9e1a('0x73')])){throw new db[(_0x9e1a('0x70'))][(_0x9e1a('0x66'))](_0x9e1a('0x74')+_0x2bdc17);}_0x1c885a[_0x407ca8[_0x9e1a('0x51')][_0x9e1a('0x73')]]=_0x407ca8['body'][_0x9e1a('0x6e')];})['then'](function(){return db['OpenchannelAccount'][_0x9e1a('0x50')]({'where':{'id':_0x407ca8['params']['id']},'include':[{'model':db[_0x9e1a('0x75')],'as':'List','include':[{'model':db[_0x9e1a('0x65')],'as':_0x9e1a('0x76'),'where':_0x1c885a,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0x9e1a('0x77')}]});})['then'](handleEntityNotFound(_0x33ec61,null))[_0x9e1a('0x1a')](function(_0x456cc9){if(_0x456cc9&&_0x456cc9['List']){_0x39e697[_0x9e1a('0x78')]=_0x456cc9;_0x39e697[_0x9e1a('0x79')]=_0x456cc9[_0x9e1a('0x77')];_0x39e697[_0x9e1a('0x7a')]=_0x456cc9[_0x9e1a('0x7b')];_0x39e697[_0x9e1a('0x79')]=_['orderBy'](_0x39e697[_0x9e1a('0x79')],[_0x9e1a('0x7c')],[_0x9e1a('0x7d')]);if(_0x39e697[_0x9e1a('0x78')][_0x9e1a('0x77')]){delete _0x39e697['account'][_0x9e1a('0x77')];}if(_0x39e697[_0x9e1a('0x78')][_0x9e1a('0x7b')]&&_0x39e697[_0x9e1a('0x78')][_0x9e1a('0x7b')]['Contacts'][_0x9e1a('0x3e')]){return _0x39e697[_0x9e1a('0x78')][_0x9e1a('0x7b')][_0x9e1a('0x76')][0x0];}var _0x4185dc=_['defaults'](_0x407ca8[_0x9e1a('0x51')],{'firstName':_0x407ca8[_0x9e1a('0x51')][_0x9e1a('0x6e')],'ListId':_0x456cc9[_0x9e1a('0x6c')]});_0x4185dc[_0x407ca8[_0x9e1a('0x51')][_0x9e1a('0x73')]]=_0x407ca8[_0x9e1a('0x51')][_0x9e1a('0x6e')];return db[_0x9e1a('0x65')][_0x9e1a('0x56')](_0x4185dc,{'fields':_0x5ec918,'raw':!![]});}})[_0x9e1a('0x1a')](handleEntityNotFound(_0x33ec61,null))[_0x9e1a('0x1a')](function(_0x5992c3){_0x39e697[_0x9e1a('0x7e')]=_0x5992c3;if(_0x5992c3){var _0x36f413={'ContactId':_0x5992c3['id'],'OpenchannelAccountId':_0x407ca8['params']['id'],'from':(_0x5992c3[_0x9e1a('0x7f')]||'')+'\x20'+(_0x5992c3[_0x9e1a('0x80')]||'')};var _0x3b531e={'OpenchannelAccountId':_0x407ca8[_0x9e1a('0x4f')]['id'],'closed':![]};if(_0x407ca8[_0x9e1a('0x51')][_0x9e1a('0x81')]){_0x3b531e[_0x9e1a('0x81')]=_0x407ca8[_0x9e1a('0x51')]['threadId'];return db['OpenchannelInteraction'][_0x9e1a('0x50')]({'where':_0x3b531e})[_0x9e1a('0x1a')](function(_0x5016ee){if(_0x5016ee){return[_0x5016ee,![]];}_0x36f413['threadId']=_0x407ca8[_0x9e1a('0x51')][_0x9e1a('0x81')];_0x36f413[_0x9e1a('0x82')]=_0x407ca8[_0x9e1a('0x51')]['externalUrl'];return db[_0x9e1a('0x83')][_0x9e1a('0x56')](_0x36f413)['then'](function(_0xdeffc0){return[_0xdeffc0,!![]];});});}else{_0x3b531e[_0x9e1a('0x81')]=null;}_0x3b531e['ContactId']=_0x5992c3['id'];return db[_0x9e1a('0x83')][_0x9e1a('0x50')]({'where':_0x3b531e})[_0x9e1a('0x1a')](function(_0x337a61){if(_0x337a61){return[_0x337a61,![]];}return db[_0x9e1a('0x83')][_0x9e1a('0x56')](_0x36f413)[_0x9e1a('0x1a')](function(_0x58d6e0){return[_0x58d6e0,!![]];});});}})[_0x9e1a('0x84')](function(_0x1315ad,_0x426ec5){if(_0x1315ad){_0x58ff05=_0x426ec5;if(!_0x426ec5){return _0x1315ad['update']({'from':(_0x39e697['contact'][_0x9e1a('0x7f')]||'')+'\x20'+(_0x39e697[_0x9e1a('0x7e')]['lastName']||'')});}else{return _0x1315ad;}}})['then'](function(_0x5a5950){_0x39e697['interaction']=_0x5a5950[_0x9e1a('0x85')]({'plain':!![]});_0x39e697['interaction']['created']=_0x58ff05;if(_0x39e697['interaction'][_0x9e1a('0x86')]){if(_0x39e697[_0x9e1a('0x78')]['autoclose']){_0x39e697[_0x9e1a('0x79')]['push']({'id':0x0,'priority':_0x39e697['applications'][_0x9e1a('0x3e')]+0x1,'app':'close','appdata':_0x9e1a('0x87'),'interval':_0x9e1a('0x88')});}}return db['OpenchannelMessage']['create']({'body':_0x407ca8['body'][_0x9e1a('0x51')],'OpenchannelAccountId':_0x407ca8['params']['id'],'OpenchannelInteractionId':_0x5a5950['id'],'direction':'in','ContactId':_0x39e697['contact']['id'],'AttachmentId':_0x407ca8[_0x9e1a('0x51')][_0x9e1a('0x89')]});})['then'](function(_0xe5546e){_0x39e697[_0x9e1a('0x22')]=_0xe5546e;if(_0x39e697[_0x9e1a('0x8a')]['UserId']){return db[_0x9e1a('0x8b')][_0x9e1a('0x50')]({'attributes':['id',_0x9e1a('0x31')],'where':{'id':_0x39e697[_0x9e1a('0x8a')][_0x9e1a('0x8c')]}})[_0x9e1a('0x1a')](function(_0x357e40){if(_0x357e40){_0x39e697[_0x9e1a('0x79')][_0x9e1a('0x8d')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x357e40[_0x9e1a('0x31')]+','+(_0x39e697[_0x9e1a('0x78')][_0x9e1a('0x8e')]||0xa),'interval':_0x9e1a('0x88')});_0x39e697[_0x9e1a('0x8f')]=![];}return respondWithRpcPromise(_0x9e1a('0x90'),_0x9e1a('0x91'),_0x39e697);});}return respondWithRpcPromise(_0x9e1a('0x90'),'startRouting',_0x39e697);})[_0x9e1a('0x1a')](function(_0x5376f9){respondWithRpcPromise(_0x9e1a('0x92'),_0x9e1a('0x92'),{'event':'notify','message':_0x5376f9},client9002);return _0x5376f9;})[_0x9e1a('0x1a')](respondWithResult(_0x33ec61,null))[_0x9e1a('0x24')](handleError(_0x33ec61,null));};exports[_0x9e1a('0x93')]=function(_0x1f909b,_0x9491bd,_0x13b23a){return db[_0x9e1a('0x49')][_0x9e1a('0x58')]({'where':{'id':_0x1f909b[_0x9e1a('0x4f')]['id']}})[_0x9e1a('0x1a')](handleEntityNotFound(_0x9491bd,null))[_0x9e1a('0x1a')](function(_0x5ae8ed){if(_0x5ae8ed){return db[_0x9e1a('0x94')][_0x9e1a('0x95')](function(_0x5a5b36){return db['OpenchannelApplication'][_0x9e1a('0x2f')]({'where':{'OpenchannelAccountId':_0x1f909b[_0x9e1a('0x4f')]['id']},'transaction':_0x5a5b36})[_0x9e1a('0x1a')](function(_0x4b605e){var _0x27a2fa=_[_0x9e1a('0x46')](_0x1f909b['body'],function(_0x290150){_0x290150[_0x9e1a('0x59')]=_0x1f909b['params']['id'];return _0x290150;});return db[_0x9e1a('0x96')][_0x9e1a('0x97')](_0x27a2fa,{'transaction':_0x5a5b36});});})[_0x9e1a('0x1a')](function(){return db['OpenchannelApplication'][_0x9e1a('0x98')]({'where':{'OpenchannelAccountId':_0x1f909b[_0x9e1a('0x4f')]['id']},'order':_0x9e1a('0x7c')});});}})[_0x9e1a('0x1a')](respondWithResult(_0x9491bd,null))['catch'](handleError(_0x9491bd,null));};exports[_0x9e1a('0x99')]=function(_0x34a1a7,_0x4c416f,_0x1371cc){var _0x282ce8={};var _0x1ab243={};var _0x53765e;var _0x9c165a;return db[_0x9e1a('0x49')][_0x9e1a('0x58')]({'where':{'id':_0x34a1a7[_0x9e1a('0x4f')]['id']}})[_0x9e1a('0x1a')](handleEntityNotFound(_0x4c416f,null))[_0x9e1a('0x1a')](function(_0xd3d16){if(_0xd3d16){_0x53765e=_0xd3d16;_0x1ab243[_0x9e1a('0x35')]=_[_0x9e1a('0x36')](db[_0x9e1a('0x96')][_0x9e1a('0x34')]);_0x1ab243[_0x9e1a('0x37')]=_['keys'](_0x34a1a7[_0x9e1a('0x37')]);_0x1ab243[_0x9e1a('0x3a')]=_[_0x9e1a('0x3c')](_0x1ab243['model'],_0x1ab243[_0x9e1a('0x37')]);_0x282ce8['attributes']=_['intersection'](_0x1ab243[_0x9e1a('0x35')],qs[_0x9e1a('0x3d')](_0x34a1a7[_0x9e1a('0x37')]['fields']));_0x282ce8['attributes']=_0x282ce8[_0x9e1a('0x3b')][_0x9e1a('0x3e')]?_0x282ce8[_0x9e1a('0x3b')]:_0x1ab243[_0x9e1a('0x35')];_0x282ce8[_0x9e1a('0x41')]=qs[_0x9e1a('0x5f')](_0x34a1a7['query']['sort']);_0x282ce8[_0x9e1a('0x42')]=qs[_0x9e1a('0x3a')](_[_0x9e1a('0x60')](_0x34a1a7['query'],_0x1ab243['filters']));if(_0x34a1a7[_0x9e1a('0x37')][_0x9e1a('0x47')]){_0x282ce8[_0x9e1a('0x42')]=_[_0x9e1a('0x45')](_0x282ce8['where'],{'$or':_[_0x9e1a('0x46')](_0x282ce8['attributes'],function(_0x412404){var _0x48db05={};_0x48db05[_0x412404]={'$like':'%'+_0x34a1a7['query'][_0x9e1a('0x47')]+'%'};return _0x48db05;})});}_0x282ce8=_[_0x9e1a('0x45')]({},_0x282ce8,_0x34a1a7[_0x9e1a('0x48')]);return _0x53765e[_0x9e1a('0x99')](_0x282ce8);}})[_0x9e1a('0x1a')](function(_0x1d0a3b){if(_0x1d0a3b){_0x9c165a=_0x1d0a3b['length'];if(!_0x34a1a7[_0x9e1a('0x37')]['hasOwnProperty'](_0x9e1a('0x40'))){_0x282ce8[_0x9e1a('0x29')]=qs[_0x9e1a('0x29')](_0x34a1a7['query']['limit']);_0x282ce8[_0x9e1a('0x28')]=qs[_0x9e1a('0x28')](_0x34a1a7[_0x9e1a('0x37')][_0x9e1a('0x28')]);}return _0x53765e['getApplications'](_0x282ce8);}})[_0x9e1a('0x1a')](function(_0x300e99){if(_0x300e99){return _0x300e99?{'count':_0x9c165a,'rows':_0x300e99}:null;}})[_0x9e1a('0x1a')](respondWithResult(_0x4c416f,null))[_0x9e1a('0x24')](handleError(_0x4c416f,null));};exports[_0x9e1a('0x9a')]=function(_0x523aac,_0x5b1e3a,_0x3241fb){var _0x7735a2={'raw':![],'where':{}};var _0xd46dff={};var _0x251a25={'count':0x0,'rows':[]};return db[_0x9e1a('0x49')][_0x9e1a('0x58')]({'where':{'id':_0x523aac[_0x9e1a('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5b1e3a,null))[_0x9e1a('0x1a')](function(_0x3b692f){if(_0x3b692f){_0xd46dff['model']=_[_0x9e1a('0x36')](db[_0x9e1a('0x83')][_0x9e1a('0x34')]);_0xd46dff[_0x9e1a('0x37')]=_[_0x9e1a('0x36')](_0x523aac[_0x9e1a('0x37')]);_0xd46dff[_0x9e1a('0x3a')]=_[_0x9e1a('0x3c')](_0xd46dff[_0x9e1a('0x35')],_0xd46dff[_0x9e1a('0x37')]);_0x7735a2[_0x9e1a('0x3b')]=_[_0x9e1a('0x3c')](_0xd46dff['model'],qs[_0x9e1a('0x3d')](_0x523aac[_0x9e1a('0x37')][_0x9e1a('0x3d')]));_0x7735a2[_0x9e1a('0x3b')]=_0x7735a2[_0x9e1a('0x3b')][_0x9e1a('0x3e')]?_0x7735a2[_0x9e1a('0x3b')]:_0xd46dff[_0x9e1a('0x35')];if(!_0x523aac['query']['hasOwnProperty']('nolimit')){_0x7735a2[_0x9e1a('0x29')]=qs[_0x9e1a('0x29')](_0x523aac[_0x9e1a('0x37')][_0x9e1a('0x29')]);_0x7735a2[_0x9e1a('0x28')]=qs[_0x9e1a('0x28')](_0x523aac[_0x9e1a('0x37')][_0x9e1a('0x28')]);}_0x7735a2[_0x9e1a('0x41')]=qs[_0x9e1a('0x5f')](_0x523aac['query'][_0x9e1a('0x5f')]);_0x7735a2[_0x9e1a('0x42')]=qs[_0x9e1a('0x3a')](_['pick'](_0x523aac['query'],_0xd46dff['filters']));_0x7735a2['where'][_0x9e1a('0x59')]=_0x3b692f['id'];if(_0x523aac[_0x9e1a('0x37')][_0x9e1a('0x47')]){_0x7735a2[_0x9e1a('0x42')]=_[_0x9e1a('0x45')](_0x7735a2[_0x9e1a('0x42')],{'$or':_[_0x9e1a('0x46')](_0x7735a2[_0x9e1a('0x3b')],function(_0x21d34c){var _0x1680a6={};_0x1680a6[_0x21d34c]={'$like':'%'+_0x523aac['query'][_0x9e1a('0x47')]+'%'};return _0x1680a6;})});}_0x7735a2=_[_0x9e1a('0x45')]({},_0x7735a2,_0x523aac['options']);return db[_0x9e1a('0x83')][_0x9e1a('0x4a')]({'where':_0x7735a2['where']})[_0x9e1a('0x1a')](function(_0x2352e4){_0x251a25[_0x9e1a('0x4a')]=_0x2352e4;if(_0x523aac[_0x9e1a('0x37')][_0x9e1a('0x4b')]){_0x7735a2[_0x9e1a('0x4c')]=[{'model':db[_0x9e1a('0x65')],'as':_0x9e1a('0x9b'),'required':![]},{'model':db[_0x9e1a('0x8b')],'as':'Owner','attributes':['name',_0x9e1a('0x9c'),_0x9e1a('0x9d')],'required':![]},{'model':db[_0x9e1a('0x9e')],'as':_0x9e1a('0x9f'),'attributes':['id',_0x9e1a('0x31'),_0x9e1a('0xa0')],'where':_0x523aac[_0x9e1a('0x37')][_0x9e1a('0xa1')]?{'id':_0x523aac[_0x9e1a('0x37')][_0x9e1a('0xa1')]}:undefined,'required':_0x523aac['query'][_0x9e1a('0xa1')]?!![]:![]}];}return db[_0x9e1a('0x83')][_0x9e1a('0x5a')](_0x7735a2);})[_0x9e1a('0x1a')](function(_0x23729f){_0x251a25[_0x9e1a('0x4d')]=_0x23729f;return _0x251a25;});}})[_0x9e1a('0x1a')](respondWithFilteredResult(_0x5b1e3a,_0x7735a2))['catch'](handleError(_0x5b1e3a,null));};exports[_0x9e1a('0xa2')]=function(_0x495559,_0x5079dc,_0x167a4a){return db[_0x9e1a('0x49')][_0x9e1a('0x50')]({'where':{'id':_0x495559[_0x9e1a('0x4f')]['id']}})[_0x9e1a('0x1a')](handleEntityNotFound(_0x5079dc,null))[_0x9e1a('0x1a')](function(_0x219d14){if(_0x219d14){return _0x219d14['addAgents'](_0x495559[_0x9e1a('0x51')][_0x9e1a('0x62')],_[_0x9e1a('0xa3')](_0x495559[_0x9e1a('0x51')],[_0x9e1a('0x62'),'id'])||{})[_0x9e1a('0x84')](function(_0x29329a){for(var _0x387654=0x0;_0x387654<_0x495559[_0x9e1a('0x51')]['ids']['length'];_0x387654+=0x1){socket[_0x9e1a('0xa4')](_0x9e1a('0xa5'),{'UserId':_0x495559[_0x9e1a('0x51')][_0x9e1a('0x62')][_0x387654],'OpenchannelAccountId':_0x495559[_0x9e1a('0x4f')]['id']});}return _0x29329a;});}})['then'](respondWithResult(_0x5079dc,null))[_0x9e1a('0x24')](handleError(_0x5079dc,null));};exports['removeAgents']=function(_0x24157b,_0x2dd27b,_0x5164f4){var _0x364565;return db[_0x9e1a('0x49')][_0x9e1a('0x50')]({'where':{'id':_0x24157b[_0x9e1a('0x4f')]['id']}})[_0x9e1a('0x1a')](handleEntityNotFound(_0x2dd27b,null))['then'](function(_0x52f117){if(_0x52f117){return _0x52f117['removeAgents'](_0x24157b[_0x9e1a('0x37')][_0x9e1a('0x62')])[_0x9e1a('0x1a')](function(_0x1020d4){if(_[_0x9e1a('0xa6')](_0x24157b[_0x9e1a('0x37')][_0x9e1a('0x62')])){for(var _0x1328b7=0x0;_0x1328b7<_0x24157b[_0x9e1a('0x37')]['ids'][_0x9e1a('0x3e')];_0x1328b7+=0x1){socket['emit'](_0x9e1a('0xa7'),{'UserId':_0x24157b['query'][_0x9e1a('0x62')][_0x1328b7],'OpenchannelAccountId':_0x24157b[_0x9e1a('0x4f')]['id']});}}else{socket[_0x9e1a('0xa4')](_0x9e1a('0xa7'),{'UserId':_0x24157b[_0x9e1a('0x37')]['ids'],'OpenchannelAccountId':_0x24157b[_0x9e1a('0x4f')]['id']});}});}})['then'](respondWithStatusCode(_0x2dd27b,null))[_0x9e1a('0x24')](handleError(_0x2dd27b,null));};exports['getAgents']=function(_0x9a7c55,_0x517f79,_0x55504d){var _0x41144a={};var _0x2ac315={};var _0x54204b;var _0x54e41c;return db['OpenchannelAccount'][_0x9e1a('0x58')]({'where':{'id':_0x9a7c55['params']['id']}})['then'](handleEntityNotFound(_0x517f79,null))[_0x9e1a('0x1a')](function(_0x18e16a){if(_0x18e16a){_0x54204b=_0x18e16a;_0x2ac315[_0x9e1a('0x35')]=_['keys'](db['User'][_0x9e1a('0x34')]);_0x2ac315[_0x9e1a('0x37')]=_[_0x9e1a('0x36')](_0x9a7c55[_0x9e1a('0x37')]);_0x2ac315[_0x9e1a('0x3a')]=_[_0x9e1a('0x3c')](_0x2ac315['model'],_0x2ac315[_0x9e1a('0x37')]);_0x41144a[_0x9e1a('0x3b')]=_[_0x9e1a('0x3c')](_0x2ac315[_0x9e1a('0x35')],qs[_0x9e1a('0x3d')](_0x9a7c55[_0x9e1a('0x37')][_0x9e1a('0x3d')]));_0x41144a[_0x9e1a('0x3b')]=_0x41144a[_0x9e1a('0x3b')][_0x9e1a('0x3e')]?_0x41144a['attributes']:_0x2ac315[_0x9e1a('0x35')];_0x41144a[_0x9e1a('0x41')]=qs['sort'](_0x9a7c55[_0x9e1a('0x37')][_0x9e1a('0x5f')]);_0x41144a[_0x9e1a('0x42')]=qs[_0x9e1a('0x3a')](_['pick'](_0x9a7c55[_0x9e1a('0x37')],_0x2ac315[_0x9e1a('0x3a')]));if(_0x9a7c55[_0x9e1a('0x37')]['filter']){_0x41144a[_0x9e1a('0x42')]=_[_0x9e1a('0x45')](_0x41144a[_0x9e1a('0x42')],{'$or':_[_0x9e1a('0x46')](_0x41144a['attributes'],function(_0x1c63b6){var _0x52bcd6={};_0x52bcd6[_0x1c63b6]={'$like':'%'+_0x9a7c55['query'][_0x9e1a('0x47')]+'%'};return _0x52bcd6;})});}_0x41144a=_['merge']({},_0x41144a,_0x9a7c55['options']);return _0x54204b[_0x9e1a('0xa8')](_0x41144a);}})['then'](function(_0x1a2dfc){if(_0x1a2dfc){_0x54e41c=_0x1a2dfc[_0x9e1a('0x3e')];if(!_0x9a7c55[_0x9e1a('0x37')][_0x9e1a('0x3f')](_0x9e1a('0x40'))){_0x41144a['limit']=qs['limit'](_0x9a7c55[_0x9e1a('0x37')]['limit']);_0x41144a[_0x9e1a('0x28')]=qs['offset'](_0x9a7c55[_0x9e1a('0x37')][_0x9e1a('0x28')]);}return _0x54204b[_0x9e1a('0xa8')](_0x41144a);}})[_0x9e1a('0x1a')](function(_0x327a99){if(_0x327a99){return _0x327a99?{'count':_0x54e41c,'rows':_0x327a99}:null;}})[_0x9e1a('0x1a')](respondWithResult(_0x517f79,null))[_0x9e1a('0x24')](handleError(_0x517f79,null));};exports[_0x9e1a('0x32')]=function(_0x571c5f,_0x88693d,_0x6261df){var _0x546cc8,_0x348f68,_0x130932;if(_['isNil'](_0x571c5f[_0x9e1a('0x51')][_0x9e1a('0x51')])||_0x571c5f[_0x9e1a('0x51')][_0x9e1a('0x51')]===''){throw new db[(_0x9e1a('0x70'))][(_0x9e1a('0x66'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9e1a('0x6d')](_0x571c5f[_0x9e1a('0x51')]['to'])){}_0x546cc8=_0x571c5f[_0x9e1a('0x51')]['to'];return db[_0x9e1a('0x49')][_0x9e1a('0x58')]({'where':{'id':_0x571c5f['params']['id']}})[_0x9e1a('0x1a')](handleEntityNotFound(_0x88693d,null))[_0x9e1a('0x1a')](function(_0x410a48){if(_0x410a48){return db[_0x9e1a('0x49')]['find']({'where':{'id':_0x410a48['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x9e1a('0x76'),'where':{[_0x410a48[_0x9e1a('0x73')]]:_0x546cc8},'limit':0x1,'order':[[_0x9e1a('0x6a'),_0x9e1a('0xa9')]]}]}]})[_0x9e1a('0x1a')](handleEntityNotFound(_0x88693d,null))['then'](function(_0x3ec619){if(_0x3ec619&&_0x3ec619[_0x9e1a('0x7b')]){_0x348f68=_0x3ec619[_0x9e1a('0x85')]({'plain':!![]});if(_0x348f68['List']&&_0x348f68['List'][_0x9e1a('0x76')]['length']){return _0x348f68[_0x9e1a('0x7b')][_0x9e1a('0x76')][0x0];}return db[_0x9e1a('0x65')][_0x9e1a('0x56')](_[_0x9e1a('0xaa')](_0x571c5f[_0x9e1a('0x51')],{'firstName':_0x546cc8,[_0x3ec619[_0x9e1a('0x73')]]:_0x546cc8,'phone':_0x546cc8,'ListId':_0x348f68['ListId']}));}})['then'](handleEntityNotFound(_0x88693d,null))[_0x9e1a('0x1a')](function(_0x36f8bc){if(_0x36f8bc){_0x130932=_0x36f8bc;return db[_0x9e1a('0x83')][_0x9e1a('0x50')]({'where':{'ContactId':_0x130932['id'],'closed':![],'OpenchannelAccountId':_0x348f68['id']}})[_0x9e1a('0x1a')](function(_0x529329){if(_0x529329){return[_0x529329,![]];}return db[_0x9e1a('0x83')][_0x9e1a('0x56')]({'UserId':_0x571c5f[_0x9e1a('0xab')]['id'],'ContactId':_0x130932['id'],'OpenchannelAccountId':_0x348f68['id'],'lastMsgDirection':'out','Messages':[_[_0x9e1a('0x45')](_0x571c5f[_0x9e1a('0x51')],{'read':![],'body':_0x571c5f[_0x9e1a('0x51')]['body'],'OpenchannelAccountId':_0x348f68['id'],'UserId':_0x571c5f[_0x9e1a('0xab')]['id'],'ContactId':_0x130932['id']})]},{'include':[{'model':db[_0x9e1a('0xac')],'as':_0x9e1a('0xad')}]})[_0x9e1a('0x1a')](function(_0x35a55d){return[_0x35a55d,!![]];});});}})[_0x9e1a('0x84')](function(_0x24c9ae,_0x40a3d9){if(_0x40a3d9){return _0x24c9ae;}return db[_0x9e1a('0xac')][_0x9e1a('0x56')](_[_0x9e1a('0x45')](_0x571c5f[_0x9e1a('0x51')],{'read':![],'body':_0x571c5f[_0x9e1a('0x51')][_0x9e1a('0x51')],'OpenchannelAccountId':_0x348f68['id'],'OpenchannelInteractionId':_0x24c9ae['id'],'UserId':_0x571c5f[_0x9e1a('0xab')]['id'],'ContactId':_0x130932['id']}))['then'](function(_0xaef542){_0x24c9ae[_0x9e1a('0xae')][_0x9e1a('0xad')]=[];_0x24c9ae[_0x9e1a('0xae')][_0x9e1a('0xad')]['push'](_0xaef542['dataValues']);return _0x24c9ae;});});}})['then'](respondWithResult(_0x88693d,null))[_0x9e1a('0x24')](handleError(_0x88693d,null));};
\ No newline at end of file
+var _0x367d=['options','includeAll','include','findAll','rows','params','find','create','body','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','findOne','rawAttributes','removeDispositions','ids','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','sort','removeAnswers','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','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','Contacts','DESC','OpenchannelApplication','Applications','account','applications','orderBy','asc','List','defaults','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','interaction','get','created','autoclose','push','*,*,*,*','OpenchannelMessage','AttachmentId','User','name','UserId','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','bulkCreate','priority','getApplications','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','user','Messages','dataValues','eml-format','rimraf','moment','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../config/logger','../../config/utils','../../config/environment','socket.io-emitter','localhost','./openchannelAccount.socket','register','jayson/promise','http','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','json','apply','reject','update','destroy','send','index','OpenchannelAccount','keys','query','dateStart','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','where','pick','dateEnd','day','add','merge','filter','map'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0x367d,0x10c));var _0xd367=function(_0x350525,_0x21387c){_0x350525=_0x350525-0x0;var _0x551837=_0x367d[_0x350525];return _0x551837;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd367('0x0'));var rimraf=require(_0xd367('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd367('0x2'));var BPromise=require(_0xd367('0x3'));var Mustache=require('mustache');var util=require(_0xd367('0x4'));var path=require('path');var sox=require(_0xd367('0x5'));var csv=require('to-csv');var ejs=require(_0xd367('0x6'));var fs=require('fs');var _=require(_0xd367('0x7'));var squel=require(_0xd367('0x8'));var crypto=require(_0xd367('0x9'));var jsforce=require(_0xd367('0xa'));var deskjs=require(_0xd367('0xb'));var toCsv=require(_0xd367('0xc'));var querystring=require(_0xd367('0xd'));var Papa=require('papaparse');var qs=require('../../components/parsers/qs');var logger=require(_0xd367('0xe'))('api');var utils=require(_0xd367('0xf'));var config=require(_0xd367('0x10'));var db=require('../../mysqldb')['db'];var socket=require(_0xd367('0x11'))({'host':_0xd367('0x12'),'port':0x18eb});require(_0xd367('0x13'))[_0xd367('0x14')](socket);var jayson=require(_0xd367('0x15'));var client=jayson['client'][_0xd367('0x16')]({'port':0x232c});var client9002=jayson[_0xd367('0x17')][_0xd367('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x4601d2,_0x1bdb7d,_0x222db9,_0xa76937){return new BPromise(function(_0x206c9c,_0x5680b4){var _0x36e3dd=_0xa76937||client;return _0x36e3dd[_0xd367('0x18')](_0x4601d2,_0x222db9)[_0xd367('0x19')](function(_0x10026d){logger[_0xd367('0x1a')](_0xd367('0x1b'),_0x1bdb7d,'request\x20sent');logger['debug'](_0xd367('0x1c'),_0x1bdb7d,_0xd367('0x1d'),JSON[_0xd367('0x1e')](_0x10026d));if(_0x10026d[_0xd367('0x1f')]){if(_0x10026d[_0xd367('0x1f')][_0xd367('0x20')]===0x1f4){logger[_0xd367('0x1f')](_0xd367('0x1b'),_0x1bdb7d,_0x10026d[_0xd367('0x1f')][_0xd367('0x21')]);return _0x5680b4(_0x10026d[_0xd367('0x1f')][_0xd367('0x21')]);}logger['error'](_0xd367('0x1b'),_0x1bdb7d,_0x10026d[_0xd367('0x1f')][_0xd367('0x21')]);return _0x206c9c(_0x10026d[_0xd367('0x1f')][_0xd367('0x21')]);}else{logger[_0xd367('0x1a')]('OpenchannelAccount,\x20%s,\x20%s',_0x1bdb7d,_0xd367('0x1d'));_0x206c9c(_0x10026d[_0xd367('0x22')]['message']);}})[_0xd367('0x23')](function(_0x215107){logger[_0xd367('0x1f')](_0xd367('0x1b'),_0x1bdb7d,_0x215107);_0x5680b4(_0x215107);});});}function respondWithStatusCode(_0x6cea0f,_0x22ec5b){_0x22ec5b=_0x22ec5b||0xcc;return function(_0x5809d6){if(_0x5809d6){return _0x6cea0f[_0xd367('0x24')](_0x22ec5b);}return _0x6cea0f[_0xd367('0x25')](_0x22ec5b)[_0xd367('0x26')]();};}function respondWithResult(_0x151ab5,_0x183ddb){_0x183ddb=_0x183ddb||0xc8;return function(_0x347a6b){if(_0x347a6b){return _0x151ab5[_0xd367('0x25')](_0x183ddb)['json'](_0x347a6b);}};}function respondWithFilteredResult(_0x44493d,_0x26599a){return function(_0x5edd93){if(_0x5edd93){var _0x53c8de=_0x5edd93[_0xd367('0x27')],_0x2b1fb8=_0x26599a[_0xd367('0x28')],_0x82c4ab=_0x26599a[_0xd367('0x28')]+_0x26599a[_0xd367('0x29')],_0x5378b8;if(_0x82c4ab>=_0x53c8de){_0x82c4ab=_0x53c8de;_0x5378b8=0xc8;}else{_0x5378b8=0xce;}_0x44493d[_0xd367('0x25')](_0x5378b8);return _0x44493d['set']('Content-Range',_0x2b1fb8+'-'+_0x82c4ab+'/'+_0x53c8de)[_0xd367('0x2a')](_0x5edd93);}return null;};}function patchUpdates(_0x2918c4){return function(_0xa22d1){try{jsonpatch[_0xd367('0x2b')](_0xa22d1,_0x2918c4,!![]);}catch(_0x2f6ac1){return BPromise[_0xd367('0x2c')](_0x2f6ac1);}return _0xa22d1['save']();};}function saveUpdates(_0x2a8937,_0x3c27d3){return function(_0x2d857c){if(_0x2d857c){return _0x2d857c[_0xd367('0x2d')](_0x2a8937)['then'](function(_0x3bb72c){return _0x3bb72c;});}return null;};}function removeEntity(_0x8e241,_0x205ff5){return function(_0x1cc142){if(_0x1cc142){return _0x1cc142[_0xd367('0x2e')]()[_0xd367('0x19')](function(){_0x8e241[_0xd367('0x25')](0xcc)[_0xd367('0x26')]();});}};}function handleEntityNotFound(_0x4df490,_0x3b14de){return function(_0x58aaa1){if(!_0x58aaa1){_0x4df490[_0xd367('0x24')](0x194);}return _0x58aaa1;};}function handleError(_0x810451,_0x123625){_0x123625=_0x123625||0x1f4;return function(_0x42d26b){logger['error'](_0x42d26b['stack']);if(_0x42d26b['name']){delete _0x42d26b['name'];}_0x810451[_0xd367('0x25')](_0x123625)[_0xd367('0x2f')](_0x42d26b);};}exports[_0xd367('0x30')]=function(_0x25d991,_0x591722){var _0x5a433a={},_0x438900={},_0x38ab6c={'count':0x0,'rows':[]};var _0x44bdbd=db[_0xd367('0x31')]['rawAttributes'];_0x438900['model']=_[_0xd367('0x32')](_0x44bdbd);var _0x27ed01={'dateStart':_0x25d991[_0xd367('0x33')][_0xd367('0x34')],'dateEnd':_0x25d991['query']['dateEnd']};delete _0x25d991[_0xd367('0x33')][_0xd367('0x34')];delete _0x25d991[_0xd367('0x33')]['dateEnd'];_0x438900[_0xd367('0x33')]=_[_0xd367('0x32')](_0x25d991[_0xd367('0x33')]);_0x438900[_0xd367('0x35')]=_[_0xd367('0x36')](_0x438900['model'],_0x438900[_0xd367('0x33')]);_0x5a433a['attributes']=_[_0xd367('0x36')](_0x438900['model'],qs[_0xd367('0x37')](_0x25d991[_0xd367('0x33')][_0xd367('0x37')]));_0x5a433a['attributes']=_0x5a433a[_0xd367('0x38')][_0xd367('0x39')]?_0x5a433a[_0xd367('0x38')]:_0x438900[_0xd367('0x3a')];if(!_0x25d991[_0xd367('0x33')][_0xd367('0x3b')](_0xd367('0x3c'))){_0x5a433a[_0xd367('0x29')]=qs[_0xd367('0x29')](_0x25d991[_0xd367('0x33')]['limit']);_0x5a433a['offset']=qs['offset'](_0x25d991[_0xd367('0x33')][_0xd367('0x28')]);}_0x5a433a[_0xd367('0x3d')]=qs['sort'](_0x25d991[_0xd367('0x33')]['sort']);_0x5a433a[_0xd367('0x3e')]=qs['filters'](_[_0xd367('0x3f')](_0x25d991['query'],_0x438900[_0xd367('0x35')]));if(_0x27ed01['dateStart']){if(_0x27ed01[_0xd367('0x40')]){_0x27ed01[_0xd367('0x40')]=moment(_0x27ed01[_0xd367('0x40')])['add'](0x1,_0xd367('0x41'));}else{_0x27ed01[_0xd367('0x40')]=moment(_0x27ed01[_0xd367('0x34')])[_0xd367('0x42')](0x1,'day');}_[_0xd367('0x43')](_0x5a433a[_0xd367('0x3e')],{'createdAt':{'$gte':_0x27ed01[_0xd367('0x34')],'$lte':_0x27ed01[_0xd367('0x40')]}});}if(_0x25d991['query'][_0xd367('0x44')]){_0x5a433a[_0xd367('0x3e')]=_[_0xd367('0x43')](_0x5a433a['where'],{'$or':_[_0xd367('0x45')](_0x5a433a[_0xd367('0x38')],function(_0x12137a){var _0x16a8bf={};_0x16a8bf[_0x12137a]={'$like':'%'+_0x25d991['query'][_0xd367('0x44')]+'%'};return _0x16a8bf;})});}_0x5a433a=_['merge']({},_0x5a433a,_0x25d991[_0xd367('0x46')]);var _0x2ee11d={'where':_0x5a433a['where']};return db['OpenchannelAccount']['count'](_0x2ee11d)[_0xd367('0x19')](function(_0x3e3588){_0x38ab6c[_0xd367('0x27')]=_0x3e3588;if(_0x25d991['query'][_0xd367('0x47')]){_0x5a433a[_0xd367('0x48')]=[{'all':!![]}];}return db[_0xd367('0x31')][_0xd367('0x49')](_0x5a433a);})[_0xd367('0x19')](function(_0x4ac095){_0x38ab6c[_0xd367('0x4a')]=_0x4ac095;return _0x38ab6c;})[_0xd367('0x19')](respondWithFilteredResult(_0x591722,_0x5a433a))[_0xd367('0x23')](handleError(_0x591722,null));};exports['show']=function(_0x15f8c8,_0x27265a){var _0x43f569={'raw':![],'where':{'id':_0x15f8c8[_0xd367('0x4b')]['id']}},_0xc394ad={};_0xc394ad[_0xd367('0x3a')]=_[_0xd367('0x32')](db[_0xd367('0x31')]['rawAttributes']);_0xc394ad[_0xd367('0x33')]=_[_0xd367('0x32')](_0x15f8c8[_0xd367('0x33')]);_0xc394ad[_0xd367('0x35')]=_[_0xd367('0x36')](_0xc394ad[_0xd367('0x3a')],_0xc394ad[_0xd367('0x33')]);_0x43f569['attributes']=_[_0xd367('0x36')](_0xc394ad[_0xd367('0x3a')],qs[_0xd367('0x37')](_0x15f8c8[_0xd367('0x33')][_0xd367('0x37')]));_0x43f569['attributes']=_0x43f569[_0xd367('0x38')][_0xd367('0x39')]?_0x43f569['attributes']:_0xc394ad['model'];if(_0x15f8c8['query'][_0xd367('0x47')]){_0x43f569[_0xd367('0x48')]=[{'all':!![]}];}_0x43f569=_[_0xd367('0x43')]({},_0x43f569,_0x15f8c8[_0xd367('0x46')]);return db[_0xd367('0x31')][_0xd367('0x4c')](_0x43f569)[_0xd367('0x19')](handleEntityNotFound(_0x27265a,null))[_0xd367('0x19')](respondWithResult(_0x27265a,null))[_0xd367('0x23')](handleError(_0x27265a,null));};exports[_0xd367('0x4d')]=function(_0x134e83,_0x379f11){return db[_0xd367('0x31')][_0xd367('0x4d')](_0x134e83[_0xd367('0x4e')],{})['then'](respondWithResult(_0x379f11,0xc9))[_0xd367('0x23')](handleError(_0x379f11,null));};exports[_0xd367('0x2d')]=function(_0x5eb044,_0x75458d){if(_0x5eb044[_0xd367('0x4e')]['id']){delete _0x5eb044[_0xd367('0x4e')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x5eb044[_0xd367('0x4b')]['id']}})[_0xd367('0x19')](handleEntityNotFound(_0x75458d,null))[_0xd367('0x19')](saveUpdates(_0x5eb044['body'],null))[_0xd367('0x19')](respondWithResult(_0x75458d,null))['catch'](handleError(_0x75458d,null));};exports['destroy']=function(_0x1199c4,_0x3717fa){return db[_0xd367('0x31')][_0xd367('0x4c')]({'where':{'id':_0x1199c4[_0xd367('0x4b')]['id']}})[_0xd367('0x19')](handleEntityNotFound(_0x3717fa,null))['then'](removeEntity(_0x3717fa,null))['catch'](handleError(_0x3717fa,null));};exports[_0xd367('0x4f')]=function(_0x300b5d,_0x21e5db){return db[_0xd367('0x31')]['describe']()[_0xd367('0x19')](respondWithResult(_0x21e5db,null))[_0xd367('0x23')](handleError(_0x21e5db,null));};exports[_0xd367('0x50')]=function(_0x406d6d,_0x4ff9ad,_0x55d8bf){if(_0x406d6d[_0xd367('0x4e')]['id']){delete _0x406d6d[_0xd367('0x4e')]['id'];}return db[_0xd367('0x31')][_0xd367('0x4c')]({'where':{'id':_0x406d6d['params']['id']}})[_0xd367('0x19')](handleEntityNotFound(_0x4ff9ad,null))[_0xd367('0x19')](function(_0x45edee){if(_0x45edee){_0x406d6d[_0xd367('0x4e')][_0xd367('0x51')]=_0x45edee['id'];return db[_0xd367('0x52')][_0xd367('0x4d')](_0x406d6d[_0xd367('0x4e')]);}})[_0xd367('0x19')](respondWithResult(_0x4ff9ad,null))[_0xd367('0x23')](handleError(_0x4ff9ad,null));};exports[_0xd367('0x53')]=function(_0x2c75fd,_0x2cac66,_0x531c57){var _0xfa9270={'raw':![],'where':{}};var _0x130bb3={};var _0x5647fd={'count':0x0,'rows':[]};return db[_0xd367('0x31')][_0xd367('0x54')]({'where':{'id':_0x2c75fd['params']['id']}})[_0xd367('0x19')](handleEntityNotFound(_0x2cac66,null))['then'](function(_0xe6908){if(_0xe6908){_0x130bb3['model']=_[_0xd367('0x32')](db['Disposition'][_0xd367('0x55')]);_0x130bb3[_0xd367('0x33')]=_[_0xd367('0x32')](_0x2c75fd[_0xd367('0x33')]);_0x130bb3[_0xd367('0x35')]=_[_0xd367('0x36')](_0x130bb3[_0xd367('0x3a')],_0x130bb3[_0xd367('0x33')]);_0xfa9270[_0xd367('0x38')]=_[_0xd367('0x36')](_0x130bb3[_0xd367('0x3a')],qs[_0xd367('0x37')](_0x2c75fd[_0xd367('0x33')][_0xd367('0x37')]));_0xfa9270[_0xd367('0x38')]=_0xfa9270[_0xd367('0x38')][_0xd367('0x39')]?_0xfa9270[_0xd367('0x38')]:_0x130bb3[_0xd367('0x3a')];if(!_0x2c75fd[_0xd367('0x33')][_0xd367('0x3b')]('nolimit')){_0xfa9270['limit']=qs[_0xd367('0x29')](_0x2c75fd[_0xd367('0x33')]['limit']);_0xfa9270[_0xd367('0x28')]=qs[_0xd367('0x28')](_0x2c75fd['query'][_0xd367('0x28')]);}_0xfa9270[_0xd367('0x3d')]=qs['sort'](_0x2c75fd[_0xd367('0x33')]['sort']);_0xfa9270[_0xd367('0x3e')]=qs[_0xd367('0x35')](_[_0xd367('0x3f')](_0x2c75fd['query'],_0x130bb3['filters']));_0xfa9270[_0xd367('0x3e')]['OpenchannelAccountId']=_0xe6908['id'];if(_0x2c75fd[_0xd367('0x33')]['filter']){_0xfa9270[_0xd367('0x3e')]=_['merge'](_0xfa9270[_0xd367('0x3e')],{'$or':_[_0xd367('0x45')](_0xfa9270[_0xd367('0x38')],function(_0x4726b7){var _0x133d40={};_0x133d40[_0x4726b7]={'$like':'%'+_0x2c75fd[_0xd367('0x33')][_0xd367('0x44')]+'%'};return _0x133d40;})});}_0xfa9270=_[_0xd367('0x43')]({},_0xfa9270,_0x2c75fd[_0xd367('0x46')]);return db['Disposition'][_0xd367('0x27')]({'where':_0xfa9270[_0xd367('0x3e')]})[_0xd367('0x19')](function(_0xae0010){_0x5647fd[_0xd367('0x27')]=_0xae0010;if(_0x2c75fd[_0xd367('0x33')][_0xd367('0x47')]){_0xfa9270[_0xd367('0x48')]=[{'all':!![]}];}return db[_0xd367('0x52')][_0xd367('0x49')](_0xfa9270);})['then'](function(_0x14d1ea){_0x5647fd[_0xd367('0x4a')]=_0x14d1ea;return _0x5647fd;});}})[_0xd367('0x19')](respondWithFilteredResult(_0x2cac66,_0xfa9270))[_0xd367('0x23')](handleError(_0x2cac66,null));};exports['removeDispositions']=function(_0x1b3cd0,_0x20a360,_0x558dda){var _0x3b5917;return db[_0xd367('0x31')][_0xd367('0x4c')]({'where':{'id':_0x1b3cd0[_0xd367('0x4b')]['id']}})['then'](handleEntityNotFound(_0x20a360,null))[_0xd367('0x19')](function(_0x58eb2d){if(_0x58eb2d){return _0x58eb2d[_0xd367('0x56')](_0x1b3cd0[_0xd367('0x33')][_0xd367('0x57')]);}})[_0xd367('0x19')](respondWithStatusCode(_0x20a360,null))[_0xd367('0x23')](handleError(_0x20a360,null));};exports[_0xd367('0x58')]=function(_0x3ae55c,_0x5539d8,_0x195279){if(_0x3ae55c['body']['id']){delete _0x3ae55c[_0xd367('0x4e')]['id'];}return db[_0xd367('0x31')][_0xd367('0x4c')]({'where':{'id':_0x3ae55c[_0xd367('0x4b')]['id']}})[_0xd367('0x19')](handleEntityNotFound(_0x5539d8,null))[_0xd367('0x19')](function(_0x5206bb){if(_0x5206bb){_0x3ae55c[_0xd367('0x4e')][_0xd367('0x59')]=_0x5206bb['id'];return db[_0xd367('0x5a')]['create'](_0x3ae55c[_0xd367('0x4e')]);}})[_0xd367('0x19')](respondWithResult(_0x5539d8,null))[_0xd367('0x23')](handleError(_0x5539d8,null));};exports[_0xd367('0x5b')]=function(_0x3eb435,_0x1a9885,_0x4a32bf){var _0x5909a3={'raw':![],'where':{}};var _0x1b6464={};var _0x263249={'count':0x0,'rows':[]};return db[_0xd367('0x31')][_0xd367('0x54')]({'where':{'id':_0x3eb435[_0xd367('0x4b')]['id']}})[_0xd367('0x19')](handleEntityNotFound(_0x1a9885,null))['then'](function(_0xd9e941){if(_0xd9e941){_0x1b6464[_0xd367('0x3a')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x1b6464[_0xd367('0x33')]=_[_0xd367('0x32')](_0x3eb435[_0xd367('0x33')]);_0x1b6464[_0xd367('0x35')]=_[_0xd367('0x36')](_0x1b6464[_0xd367('0x3a')],_0x1b6464[_0xd367('0x33')]);_0x5909a3[_0xd367('0x38')]=_[_0xd367('0x36')](_0x1b6464[_0xd367('0x3a')],qs[_0xd367('0x37')](_0x3eb435[_0xd367('0x33')]['fields']));_0x5909a3['attributes']=_0x5909a3[_0xd367('0x38')][_0xd367('0x39')]?_0x5909a3[_0xd367('0x38')]:_0x1b6464['model'];if(!_0x3eb435[_0xd367('0x33')][_0xd367('0x3b')](_0xd367('0x3c'))){_0x5909a3[_0xd367('0x29')]=qs[_0xd367('0x29')](_0x3eb435[_0xd367('0x33')][_0xd367('0x29')]);_0x5909a3['offset']=qs[_0xd367('0x28')](_0x3eb435[_0xd367('0x33')][_0xd367('0x28')]);}_0x5909a3[_0xd367('0x3d')]=qs['sort'](_0x3eb435[_0xd367('0x33')][_0xd367('0x5c')]);_0x5909a3[_0xd367('0x3e')]=qs['filters'](_['pick'](_0x3eb435[_0xd367('0x33')],_0x1b6464[_0xd367('0x35')]));_0x5909a3[_0xd367('0x3e')][_0xd367('0x59')]=_0xd9e941['id'];if(_0x3eb435[_0xd367('0x33')]['filter']){_0x5909a3[_0xd367('0x3e')]=_[_0xd367('0x43')](_0x5909a3[_0xd367('0x3e')],{'$or':_[_0xd367('0x45')](_0x5909a3[_0xd367('0x38')],function(_0x559832){var _0x2a48fa={};_0x2a48fa[_0x559832]={'$like':'%'+_0x3eb435['query'][_0xd367('0x44')]+'%'};return _0x2a48fa;})});}_0x5909a3=_['merge']({},_0x5909a3,_0x3eb435[_0xd367('0x46')]);return db['CannedAnswer']['count']({'where':_0x5909a3[_0xd367('0x3e')]})[_0xd367('0x19')](function(_0x4909ec){_0x263249['count']=_0x4909ec;if(_0x3eb435[_0xd367('0x33')][_0xd367('0x47')]){_0x5909a3[_0xd367('0x48')]=[{'all':!![]}];}return db[_0xd367('0x5a')][_0xd367('0x49')](_0x5909a3);})[_0xd367('0x19')](function(_0x46f092){_0x263249['rows']=_0x46f092;return _0x263249;});}})[_0xd367('0x19')](respondWithFilteredResult(_0x1a9885,_0x5909a3))[_0xd367('0x23')](handleError(_0x1a9885,null));};exports[_0xd367('0x5d')]=function(_0x49af5d,_0x350dd7,_0x181ea5){var _0x49e7fa;return db[_0xd367('0x31')][_0xd367('0x4c')]({'where':{'id':_0x49af5d[_0xd367('0x4b')]['id']}})['then'](handleEntityNotFound(_0x350dd7,null))[_0xd367('0x19')](function(_0x31bff2){if(_0x31bff2){return _0x31bff2[_0xd367('0x5d')](_0x49af5d[_0xd367('0x33')]['ids']);}})['then'](respondWithStatusCode(_0x350dd7,null))[_0xd367('0x23')](handleError(_0x350dd7,null));};exports[_0xd367('0x5e')]=function(_0x332af9,_0x494073,_0x2f7db3){var _0x26b84f={'body':_0x332af9[_0xd367('0x4e')],'channel':_0xd367('0x5f')};var _0x1223f2=[];var _0x3f5d82=[];var _0xe329dc={};var _0x5b4367=![];return db[_0xd367('0x60')][_0xd367('0x4f')]()['then'](function(_0x37a0ec){if(!_0x37a0ec){throw new db['Sequelize'][(_0xd367('0x61'))](_0xd367('0x62'));}_0x1223f2=_[_0xd367('0x63')](_['keys'](_0x37a0ec),[_0xd367('0x64'),_0xd367('0x65')]);_0x3f5d82=_[_0xd367('0x63')](_['keys'](_0x37a0ec),[_0xd367('0x64'),'updatedAt',_0xd367('0x66'),_0xd367('0x67')]);if(_0x332af9[_0xd367('0x4e')]['id']){delete _0x332af9[_0xd367('0x4e')]['id'];}if(_[_0xd367('0x68')](_0x332af9[_0xd367('0x4e')][_0xd367('0x69')])){throw new db[(_0xd367('0x6a'))][(_0xd367('0x61'))]('from\x20is\x20mandatory');}if(_[_0xd367('0x68')](_0x332af9['body'][_0xd367('0x4e')])||_0x332af9[_0xd367('0x4e')][_0xd367('0x4e')]===''){throw new db[(_0xd367('0x6a'))]['ValidationError'](_0xd367('0x6b'));}if(_[_0xd367('0x68')](_0x332af9['body'][_0xd367('0x6c')])){throw new db[(_0xd367('0x6a'))][(_0xd367('0x61'))](_0xd367('0x6d')+_0x3f5d82);}if(!_[_0xd367('0x6e')](_0x3f5d82,_0x332af9[_0xd367('0x4e')][_0xd367('0x6c')])){throw new db[(_0xd367('0x6a'))][(_0xd367('0x61'))](_0xd367('0x6f')+_0x3f5d82);}_0xe329dc[_0x332af9[_0xd367('0x4e')][_0xd367('0x6c')]]=_0x332af9['body']['from'];})[_0xd367('0x19')](function(){return db[_0xd367('0x31')][_0xd367('0x4c')]({'where':{'id':_0x332af9['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xd367('0x70'),'where':_0xe329dc,'limit':0x1,'order':[[_0xd367('0x65'),_0xd367('0x71')]]}]},{'model':db[_0xd367('0x72')],'as':_0xd367('0x73')}]});})[_0xd367('0x19')](handleEntityNotFound(_0x494073,null))[_0xd367('0x19')](function(_0x325221){if(_0x325221&&_0x325221['List']){_0x26b84f[_0xd367('0x74')]=_0x325221;_0x26b84f[_0xd367('0x75')]=_0x325221[_0xd367('0x73')];_0x26b84f['list']=_0x325221['List'];_0x26b84f[_0xd367('0x75')]=_[_0xd367('0x76')](_0x26b84f[_0xd367('0x75')],['priority'],[_0xd367('0x77')]);if(_0x26b84f['account'][_0xd367('0x73')]){delete _0x26b84f['account'][_0xd367('0x73')];}if(_0x26b84f[_0xd367('0x74')][_0xd367('0x78')]&&_0x26b84f[_0xd367('0x74')][_0xd367('0x78')][_0xd367('0x70')][_0xd367('0x39')]){return _0x26b84f['account'][_0xd367('0x78')][_0xd367('0x70')][0x0];}var _0x5beb5a=_[_0xd367('0x79')](_0x332af9['body'],{'firstName':_0x332af9[_0xd367('0x4e')][_0xd367('0x69')],'ListId':_0x325221['ListId']});_0x5beb5a[_0x332af9['body']['mapKey']]=_0x332af9[_0xd367('0x4e')]['from'];return db[_0xd367('0x60')]['create'](_0x5beb5a,{'fields':_0x1223f2,'raw':!![]});}})['then'](handleEntityNotFound(_0x494073,null))[_0xd367('0x19')](function(_0x3fd67e){_0x26b84f[_0xd367('0x7a')]=_0x3fd67e;if(_0x3fd67e){var _0x428fe3={'ContactId':_0x3fd67e['id'],'OpenchannelAccountId':_0x332af9[_0xd367('0x4b')]['id'],'from':(_0x3fd67e[_0xd367('0x7b')]||'')+'\x20'+(_0x3fd67e[_0xd367('0x7c')]||'')};var _0x4ea439={'OpenchannelAccountId':_0x332af9['params']['id'],'closed':![]};if(_0x332af9[_0xd367('0x4e')]['threadId']){_0x4ea439[_0xd367('0x7d')]=_0x332af9[_0xd367('0x4e')][_0xd367('0x7d')];return db[_0xd367('0x7e')][_0xd367('0x4c')]({'where':_0x4ea439})[_0xd367('0x19')](function(_0x432c87){if(_0x432c87){return[_0x432c87,![]];}_0x428fe3[_0xd367('0x7d')]=_0x332af9[_0xd367('0x4e')][_0xd367('0x7d')];_0x428fe3[_0xd367('0x7f')]=_0x332af9[_0xd367('0x4e')][_0xd367('0x7f')];return db[_0xd367('0x7e')][_0xd367('0x4d')](_0x428fe3)[_0xd367('0x19')](function(_0xc6e47f){return[_0xc6e47f,!![]];});});}else{_0x4ea439[_0xd367('0x7d')]=null;}_0x4ea439['ContactId']=_0x3fd67e['id'];return db[_0xd367('0x7e')]['find']({'where':_0x4ea439})['then'](function(_0x155043){if(_0x155043){return[_0x155043,![]];}return db[_0xd367('0x7e')][_0xd367('0x4d')](_0x428fe3)[_0xd367('0x19')](function(_0x1d6ea4){return[_0x1d6ea4,!![]];});});}})[_0xd367('0x80')](function(_0xfd408a,_0x50dbd3){if(_0xfd408a){_0x5b4367=_0x50dbd3;if(!_0x50dbd3){return _0xfd408a[_0xd367('0x2d')]({'from':(_0x26b84f['contact'][_0xd367('0x7b')]||'')+'\x20'+(_0x26b84f['contact'][_0xd367('0x7c')]||'')});}else{return _0xfd408a;}}})['then'](function(_0x2b9aba){_0x26b84f[_0xd367('0x81')]=_0x2b9aba[_0xd367('0x82')]({'plain':!![]});_0x26b84f[_0xd367('0x81')][_0xd367('0x83')]=_0x5b4367;if(_0x26b84f[_0xd367('0x81')]['created']){if(_0x26b84f[_0xd367('0x74')][_0xd367('0x84')]){_0x26b84f[_0xd367('0x75')][_0xd367('0x85')]({'id':0x0,'priority':_0x26b84f['applications'][_0xd367('0x39')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xd367('0x86')});}}return db[_0xd367('0x87')][_0xd367('0x4d')]({'body':_0x332af9[_0xd367('0x4e')][_0xd367('0x4e')],'OpenchannelAccountId':_0x332af9[_0xd367('0x4b')]['id'],'OpenchannelInteractionId':_0x2b9aba['id'],'direction':'in','ContactId':_0x26b84f[_0xd367('0x7a')]['id'],'AttachmentId':_0x332af9[_0xd367('0x4e')][_0xd367('0x88')]});})[_0xd367('0x19')](function(_0x4fd4af){_0x26b84f[_0xd367('0x21')]=_0x4fd4af;if(_0x26b84f[_0xd367('0x81')]['UserId']){return db[_0xd367('0x89')]['find']({'attributes':['id',_0xd367('0x8a')],'where':{'id':_0x26b84f[_0xd367('0x81')][_0xd367('0x8b')]}})[_0xd367('0x19')](function(_0x3a9325){if(_0x3a9325){_0x26b84f[_0xd367('0x75')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3a9325[_0xd367('0x8a')]+','+(_0x26b84f['account'][_0xd367('0x8c')]||0xa),'interval':_0xd367('0x86')});_0x26b84f[_0xd367('0x8d')]=![];}return respondWithRpcPromise(_0xd367('0x8e'),_0xd367('0x8f'),_0x26b84f);});}return respondWithRpcPromise('Start','startRouting',_0x26b84f);})[_0xd367('0x19')](function(_0x2bd50c){respondWithRpcPromise('EventManager',_0xd367('0x90'),{'event':_0xd367('0x5e'),'message':_0x2bd50c},client9002);return _0x2bd50c;})['then'](respondWithResult(_0x494073,null))[_0xd367('0x23')](handleError(_0x494073,null));};exports['addApplications']=function(_0x43ad8d,_0x414bc2,_0x38ce5b){return db['OpenchannelAccount'][_0xd367('0x54')]({'where':{'id':_0x43ad8d['params']['id']}})[_0xd367('0x19')](handleEntityNotFound(_0x414bc2,null))[_0xd367('0x19')](function(_0x9e24b8){if(_0x9e24b8){return db[_0xd367('0x91')]['transaction'](function(_0x222bc0){return db[_0xd367('0x72')][_0xd367('0x2e')]({'where':{'OpenchannelAccountId':_0x43ad8d[_0xd367('0x4b')]['id']},'transaction':_0x222bc0})[_0xd367('0x19')](function(_0x15921c){var _0x1afebb=_[_0xd367('0x45')](_0x43ad8d[_0xd367('0x4e')],function(_0x2b8b09){_0x2b8b09['OpenchannelAccountId']=_0x43ad8d[_0xd367('0x4b')]['id'];return _0x2b8b09;});return db['OpenchannelApplication'][_0xd367('0x92')](_0x1afebb,{'transaction':_0x222bc0});});})['then'](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x43ad8d[_0xd367('0x4b')]['id']},'order':_0xd367('0x93')});});}})[_0xd367('0x19')](respondWithResult(_0x414bc2,null))[_0xd367('0x23')](handleError(_0x414bc2,null));};exports[_0xd367('0x94')]=function(_0x1d9761,_0x17bae8,_0x4075b7){var _0x6e6395={};var _0x50525a={};var _0x5716a6;var _0x2cac62;return db[_0xd367('0x31')][_0xd367('0x54')]({'where':{'id':_0x1d9761['params']['id']}})[_0xd367('0x19')](handleEntityNotFound(_0x17bae8,null))[_0xd367('0x19')](function(_0x56f2b8){if(_0x56f2b8){_0x5716a6=_0x56f2b8;_0x50525a[_0xd367('0x3a')]=_['keys'](db[_0xd367('0x72')][_0xd367('0x55')]);_0x50525a[_0xd367('0x33')]=_[_0xd367('0x32')](_0x1d9761[_0xd367('0x33')]);_0x50525a[_0xd367('0x35')]=_[_0xd367('0x36')](_0x50525a[_0xd367('0x3a')],_0x50525a[_0xd367('0x33')]);_0x6e6395[_0xd367('0x38')]=_[_0xd367('0x36')](_0x50525a[_0xd367('0x3a')],qs[_0xd367('0x37')](_0x1d9761[_0xd367('0x33')][_0xd367('0x37')]));_0x6e6395[_0xd367('0x38')]=_0x6e6395[_0xd367('0x38')][_0xd367('0x39')]?_0x6e6395['attributes']:_0x50525a[_0xd367('0x3a')];_0x6e6395['order']=qs['sort'](_0x1d9761[_0xd367('0x33')]['sort']);_0x6e6395[_0xd367('0x3e')]=qs['filters'](_[_0xd367('0x3f')](_0x1d9761[_0xd367('0x33')],_0x50525a['filters']));if(_0x1d9761[_0xd367('0x33')][_0xd367('0x44')]){_0x6e6395['where']=_[_0xd367('0x43')](_0x6e6395[_0xd367('0x3e')],{'$or':_[_0xd367('0x45')](_0x6e6395[_0xd367('0x38')],function(_0x2f1d55){var _0x20cc0d={};_0x20cc0d[_0x2f1d55]={'$like':'%'+_0x1d9761['query']['filter']+'%'};return _0x20cc0d;})});}_0x6e6395=_[_0xd367('0x43')]({},_0x6e6395,_0x1d9761[_0xd367('0x46')]);return _0x5716a6[_0xd367('0x94')](_0x6e6395);}})[_0xd367('0x19')](function(_0x1d35ef){if(_0x1d35ef){_0x2cac62=_0x1d35ef['length'];if(!_0x1d9761[_0xd367('0x33')][_0xd367('0x3b')](_0xd367('0x3c'))){_0x6e6395[_0xd367('0x29')]=qs[_0xd367('0x29')](_0x1d9761['query'][_0xd367('0x29')]);_0x6e6395[_0xd367('0x28')]=qs[_0xd367('0x28')](_0x1d9761[_0xd367('0x33')][_0xd367('0x28')]);}return _0x5716a6[_0xd367('0x94')](_0x6e6395);}})[_0xd367('0x19')](function(_0x159c93){if(_0x159c93){return _0x159c93?{'count':_0x2cac62,'rows':_0x159c93}:null;}})[_0xd367('0x19')](respondWithResult(_0x17bae8,null))['catch'](handleError(_0x17bae8,null));};exports['getInteractions']=function(_0x45f8f2,_0x11b640,_0x4c1519){var _0x317feb={'raw':![],'where':{}};var _0x5532fb={};var _0x176a19={'count':0x0,'rows':[]};return db[_0xd367('0x31')][_0xd367('0x54')]({'where':{'id':_0x45f8f2[_0xd367('0x4b')]['id']}})['then'](handleEntityNotFound(_0x11b640,null))[_0xd367('0x19')](function(_0x302a9d){if(_0x302a9d){_0x5532fb[_0xd367('0x3a')]=_[_0xd367('0x32')](db[_0xd367('0x7e')]['rawAttributes']);_0x5532fb[_0xd367('0x33')]=_[_0xd367('0x32')](_0x45f8f2['query']);_0x5532fb[_0xd367('0x35')]=_[_0xd367('0x36')](_0x5532fb[_0xd367('0x3a')],_0x5532fb[_0xd367('0x33')]);_0x317feb[_0xd367('0x38')]=_[_0xd367('0x36')](_0x5532fb[_0xd367('0x3a')],qs['fields'](_0x45f8f2[_0xd367('0x33')]['fields']));_0x317feb[_0xd367('0x38')]=_0x317feb[_0xd367('0x38')][_0xd367('0x39')]?_0x317feb[_0xd367('0x38')]:_0x5532fb['model'];if(!_0x45f8f2['query']['hasOwnProperty'](_0xd367('0x3c'))){_0x317feb[_0xd367('0x29')]=qs['limit'](_0x45f8f2[_0xd367('0x33')][_0xd367('0x29')]);_0x317feb[_0xd367('0x28')]=qs[_0xd367('0x28')](_0x45f8f2[_0xd367('0x33')][_0xd367('0x28')]);}_0x317feb[_0xd367('0x3d')]=qs[_0xd367('0x5c')](_0x45f8f2[_0xd367('0x33')][_0xd367('0x5c')]);_0x317feb[_0xd367('0x3e')]=qs[_0xd367('0x35')](_['pick'](_0x45f8f2[_0xd367('0x33')],_0x5532fb['filters']));_0x317feb['where']['OpenchannelAccountId']=_0x302a9d['id'];if(_0x45f8f2[_0xd367('0x33')][_0xd367('0x44')]){_0x317feb['where']=_[_0xd367('0x43')](_0x317feb['where'],{'$or':_[_0xd367('0x45')](_0x317feb[_0xd367('0x38')],function(_0x2e40bb){var _0x2f54b5={};_0x2f54b5[_0x2e40bb]={'$like':'%'+_0x45f8f2[_0xd367('0x33')][_0xd367('0x44')]+'%'};return _0x2f54b5;})});}_0x317feb=_[_0xd367('0x43')]({},_0x317feb,_0x45f8f2['options']);return db[_0xd367('0x7e')]['count']({'where':_0x317feb[_0xd367('0x3e')]})[_0xd367('0x19')](function(_0x3e8d86){_0x176a19[_0xd367('0x27')]=_0x3e8d86;if(_0x45f8f2[_0xd367('0x33')][_0xd367('0x47')]){_0x317feb[_0xd367('0x48')]=[{'model':db[_0xd367('0x60')],'as':_0xd367('0x95'),'required':![]},{'model':db[_0xd367('0x89')],'as':'Owner','attributes':[_0xd367('0x8a'),_0xd367('0x96'),_0xd367('0x97')],'required':![]},{'model':db[_0xd367('0x98')],'as':_0xd367('0x99'),'attributes':['id',_0xd367('0x8a'),_0xd367('0x9a')],'where':_0x45f8f2[_0xd367('0x33')][_0xd367('0x9b')]?{'id':_0x45f8f2[_0xd367('0x33')]['tag']}:undefined,'required':_0x45f8f2[_0xd367('0x33')][_0xd367('0x9b')]?!![]:![]}];}return db[_0xd367('0x7e')][_0xd367('0x49')](_0x317feb);})[_0xd367('0x19')](function(_0x4fd485){_0x176a19[_0xd367('0x4a')]=_0x4fd485;return _0x176a19;});}})[_0xd367('0x19')](respondWithFilteredResult(_0x11b640,_0x317feb))['catch'](handleError(_0x11b640,null));};exports[_0xd367('0x9c')]=function(_0x22470f,_0x500d57,_0x26f248){return db['OpenchannelAccount'][_0xd367('0x4c')]({'where':{'id':_0x22470f[_0xd367('0x4b')]['id']}})[_0xd367('0x19')](handleEntityNotFound(_0x500d57,null))['then'](function(_0x2e25c2){if(_0x2e25c2){return _0x2e25c2[_0xd367('0x9c')](_0x22470f[_0xd367('0x4e')][_0xd367('0x57')],_[_0xd367('0x9d')](_0x22470f[_0xd367('0x4e')],[_0xd367('0x57'),'id'])||{})['spread'](function(_0x84493a){for(var _0x1777fe=0x0;_0x1777fe<_0x22470f[_0xd367('0x4e')][_0xd367('0x57')][_0xd367('0x39')];_0x1777fe+=0x1){socket[_0xd367('0x9e')](_0xd367('0x9f'),{'UserId':_0x22470f[_0xd367('0x4e')][_0xd367('0x57')][_0x1777fe],'OpenchannelAccountId':_0x22470f['params']['id']});}return _0x84493a;});}})['then'](respondWithResult(_0x500d57,null))['catch'](handleError(_0x500d57,null));};exports[_0xd367('0xa0')]=function(_0x1e6e39,_0x49d8c8,_0x5ca178){var _0x5d7286;return db[_0xd367('0x31')][_0xd367('0x4c')]({'where':{'id':_0x1e6e39[_0xd367('0x4b')]['id']}})['then'](handleEntityNotFound(_0x49d8c8,null))['then'](function(_0x3a2e63){if(_0x3a2e63){return _0x3a2e63[_0xd367('0xa0')](_0x1e6e39[_0xd367('0x33')][_0xd367('0x57')])[_0xd367('0x19')](function(_0x8242ea){if(_[_0xd367('0xa1')](_0x1e6e39[_0xd367('0x33')]['ids'])){for(var _0x4414be=0x0;_0x4414be<_0x1e6e39[_0xd367('0x33')]['ids'][_0xd367('0x39')];_0x4414be+=0x1){socket[_0xd367('0x9e')]('userOpenchannelAccount:remove',{'UserId':_0x1e6e39['query']['ids'][_0x4414be],'OpenchannelAccountId':_0x1e6e39[_0xd367('0x4b')]['id']});}}else{socket[_0xd367('0x9e')](_0xd367('0xa2'),{'UserId':_0x1e6e39[_0xd367('0x33')]['ids'],'OpenchannelAccountId':_0x1e6e39[_0xd367('0x4b')]['id']});}});}})[_0xd367('0x19')](respondWithStatusCode(_0x49d8c8,null))[_0xd367('0x23')](handleError(_0x49d8c8,null));};exports['getAgents']=function(_0xe283f4,_0x247a34,_0x4b4d5a){var _0x1ecbf2={};var _0x389cb1={};var _0x1672c6;var _0x410406;return db[_0xd367('0x31')][_0xd367('0x54')]({'where':{'id':_0xe283f4['params']['id']}})['then'](handleEntityNotFound(_0x247a34,null))[_0xd367('0x19')](function(_0x4cc644){if(_0x4cc644){_0x1672c6=_0x4cc644;_0x389cb1['model']=_[_0xd367('0x32')](db['User'][_0xd367('0x55')]);_0x389cb1[_0xd367('0x33')]=_['keys'](_0xe283f4[_0xd367('0x33')]);_0x389cb1['filters']=_[_0xd367('0x36')](_0x389cb1[_0xd367('0x3a')],_0x389cb1[_0xd367('0x33')]);_0x1ecbf2[_0xd367('0x38')]=_['intersection'](_0x389cb1[_0xd367('0x3a')],qs[_0xd367('0x37')](_0xe283f4[_0xd367('0x33')][_0xd367('0x37')]));_0x1ecbf2[_0xd367('0x38')]=_0x1ecbf2[_0xd367('0x38')][_0xd367('0x39')]?_0x1ecbf2[_0xd367('0x38')]:_0x389cb1[_0xd367('0x3a')];_0x1ecbf2[_0xd367('0x3d')]=qs[_0xd367('0x5c')](_0xe283f4['query'][_0xd367('0x5c')]);_0x1ecbf2['where']=qs[_0xd367('0x35')](_[_0xd367('0x3f')](_0xe283f4[_0xd367('0x33')],_0x389cb1[_0xd367('0x35')]));if(_0xe283f4['query'][_0xd367('0x44')]){_0x1ecbf2[_0xd367('0x3e')]=_[_0xd367('0x43')](_0x1ecbf2[_0xd367('0x3e')],{'$or':_['map'](_0x1ecbf2[_0xd367('0x38')],function(_0x4fbfb5){var _0x72a76e={};_0x72a76e[_0x4fbfb5]={'$like':'%'+_0xe283f4[_0xd367('0x33')][_0xd367('0x44')]+'%'};return _0x72a76e;})});}_0x1ecbf2=_[_0xd367('0x43')]({},_0x1ecbf2,_0xe283f4[_0xd367('0x46')]);return _0x1672c6[_0xd367('0xa3')](_0x1ecbf2);}})[_0xd367('0x19')](function(_0x5d5a9d){if(_0x5d5a9d){_0x410406=_0x5d5a9d['length'];if(!_0xe283f4[_0xd367('0x33')][_0xd367('0x3b')](_0xd367('0x3c'))){_0x1ecbf2[_0xd367('0x29')]=qs[_0xd367('0x29')](_0xe283f4[_0xd367('0x33')][_0xd367('0x29')]);_0x1ecbf2['offset']=qs[_0xd367('0x28')](_0xe283f4[_0xd367('0x33')][_0xd367('0x28')]);}return _0x1672c6[_0xd367('0xa3')](_0x1ecbf2);}})['then'](function(_0x97ab80){if(_0x97ab80){return _0x97ab80?{'count':_0x410406,'rows':_0x97ab80}:null;}})['then'](respondWithResult(_0x247a34,null))[_0xd367('0x23')](handleError(_0x247a34,null));};exports[_0xd367('0x2f')]=function(_0x52b13a,_0x2b862c,_0x3815d7){var _0x4aa010,_0x420884,_0x51d33b;if(_[_0xd367('0x68')](_0x52b13a[_0xd367('0x4e')][_0xd367('0x4e')])||_0x52b13a[_0xd367('0x4e')][_0xd367('0x4e')]===''){throw new db['Sequelize'][(_0xd367('0x61'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd367('0x68')](_0x52b13a[_0xd367('0x4e')]['to'])){}_0x4aa010=_0x52b13a[_0xd367('0x4e')]['to'];return db[_0xd367('0x31')][_0xd367('0x54')]({'where':{'id':_0x52b13a[_0xd367('0x4b')]['id']}})[_0xd367('0x19')](handleEntityNotFound(_0x2b862c,null))[_0xd367('0x19')](function(_0x460e26){if(_0x460e26){return db[_0xd367('0x31')][_0xd367('0x4c')]({'where':{'id':_0x460e26['id']},'include':[{'model':db[_0xd367('0xa4')],'as':'List','include':[{'model':db[_0xd367('0x60')],'as':_0xd367('0x70'),'where':{[_0x460e26[_0xd367('0x6c')]]:_0x4aa010},'limit':0x1,'order':[[_0xd367('0x65'),'DESC']]}]}]})[_0xd367('0x19')](handleEntityNotFound(_0x2b862c,null))[_0xd367('0x19')](function(_0x1d6583){if(_0x1d6583&&_0x1d6583[_0xd367('0x78')]){_0x420884=_0x1d6583['get']({'plain':!![]});if(_0x420884[_0xd367('0x78')]&&_0x420884[_0xd367('0x78')]['Contacts'][_0xd367('0x39')]){return _0x420884[_0xd367('0x78')]['Contacts'][0x0];}return db[_0xd367('0x60')][_0xd367('0x4d')](_[_0xd367('0x79')](_0x52b13a[_0xd367('0x4e')],{'firstName':_0x4aa010,[_0x1d6583['mapKey']]:_0x4aa010,'phone':_0x4aa010,'ListId':_0x420884['ListId']}));}})[_0xd367('0x19')](handleEntityNotFound(_0x2b862c,null))[_0xd367('0x19')](function(_0x2979ed){if(_0x2979ed){_0x51d33b=_0x2979ed;return db[_0xd367('0x7e')][_0xd367('0x4c')]({'where':{'ContactId':_0x51d33b['id'],'closed':![],'OpenchannelAccountId':_0x420884['id']}})['then'](function(_0x588963){if(_0x588963){return[_0x588963,![]];}return db['OpenchannelInteraction'][_0xd367('0x4d')]({'UserId':_0x52b13a['user']['id'],'ContactId':_0x51d33b['id'],'OpenchannelAccountId':_0x420884['id'],'lastMsgDirection':_0xd367('0xa5'),'Messages':[_[_0xd367('0x43')](_0x52b13a[_0xd367('0x4e')],{'read':![],'body':_0x52b13a['body'][_0xd367('0x4e')],'OpenchannelAccountId':_0x420884['id'],'UserId':_0x52b13a[_0xd367('0xa6')]['id'],'ContactId':_0x51d33b['id']})]},{'include':[{'model':db[_0xd367('0x87')],'as':_0xd367('0xa7')}]})[_0xd367('0x19')](function(_0x2a7e61){return[_0x2a7e61,!![]];});});}})[_0xd367('0x80')](function(_0x56b169,_0x20b720){if(_0x20b720){return _0x56b169;}return db[_0xd367('0x87')][_0xd367('0x4d')](_['merge'](_0x52b13a[_0xd367('0x4e')],{'read':![],'body':_0x52b13a[_0xd367('0x4e')][_0xd367('0x4e')],'OpenchannelAccountId':_0x420884['id'],'OpenchannelInteractionId':_0x56b169['id'],'UserId':_0x52b13a['user']['id'],'ContactId':_0x51d33b['id']}))['then'](function(_0x3c162c){_0x56b169[_0xd367('0xa8')][_0xd367('0xa7')]=[];_0x56b169[_0xd367('0xa8')][_0xd367('0xa7')][_0xd367('0x85')](_0x3c162c['dataValues']);return _0x56b169;});});}})['then'](respondWithResult(_0x2b862c,null))['catch'](handleError(_0x2b862c,null));};
\ No newline at end of file
index 399754c..558e1af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4fe=['setMaxListeners','update','emit','hook','exports','events','../../mysqldb','OpenchannelAccount'];(function(_0x582917,_0x26b8c9){var _0x4e7713=function(_0x408e45){while(--_0x408e45){_0x582917['push'](_0x582917['shift']());}};_0x4e7713(++_0x26b8c9);}(_0xc4fe,0x1bd));var _0xec4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4fe[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xec4f('0x0'));var OpenchannelAccount=require(_0xec4f('0x1'))['db'][_0xec4f('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xec4f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xec4f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x121e5d){return function(_0x2af7be,_0x3312e7,_0x2751ae){OpenchannelAccountEvents[_0xec4f('0x5')](_0x121e5d+':'+_0x2af7be['id'],_0x2af7be);OpenchannelAccountEvents[_0xec4f('0x5')](_0x121e5d,_0x2af7be);_0x2751ae(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xec4f('0x6')](e,emitEvent(event));}}module[_0xec4f('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0xb26e=['update','emit','hasOwnProperty','hook','exports','events','save'];(function(_0x4c00a3,_0x2d23e2){var _0x893854=function(_0x6f552c){while(--_0x6f552c){_0x4c00a3['push'](_0x4c00a3['shift']());}};_0x893854(++_0x2d23e2);}(_0xb26e,0x11d));var _0xeb26=function(_0x42c797,_0x16382b){_0x42c797=_0x42c797-0x0;var _0x320035=_0xb26e[_0x42c797];return _0x320035;};'use strict';var EventEmitter=require(_0xeb26('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb26('0x1'),'afterUpdate':_0xeb26('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3bdbef){return function(_0x3b8a6f,_0x2817de,_0x3ec03a){OpenchannelAccountEvents[_0xeb26('0x3')](_0x3bdbef+':'+_0x3b8a6f['id'],_0x3b8a6f);OpenchannelAccountEvents[_0xeb26('0x3')](_0x3bdbef,_0x3b8a6f);_0x3ec03a(null);};}for(var e in events){if(events[_0xeb26('0x4')](e)){var event=events[e];OpenchannelAccount[_0xeb26('0x5')](e,emitEvent(event));}}module[_0xeb26('0x6')]=OpenchannelAccountEvents;
\ No newline at end of file
index 6c6b5e6..d1f80f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['openchannel_accounts','lodash','../../config/logger','api','moment','request-promise','./openchannelAccount.attributes','exports','define'];(function(_0xc0386d,_0xa1cfde){var _0x47bb8e=function(_0x275d91){while(--_0x275d91){_0xc0386d['push'](_0xc0386d['shift']());}};_0x47bb8e(++_0xa1cfde);}(_0xb10b,0x12a));var _0xbb10=function(_0x15cae3,_0x458cb9){_0x15cae3=_0x15cae3-0x0;var _0x20596f=_0xb10b[_0x15cae3];return _0x20596f;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var attributes=require(_0xbb10('0x5'));module[_0xbb10('0x6')]=function(_0x22320e,_0x49baf4){return _0x22320e[_0xbb10('0x7')]('OpenchannelAccount',attributes,{'tableName':_0xbb10('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbdb7=['exports','openchannel_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./openchannelAccount.attributes'];(function(_0x5c8f3e,_0x33ba70){var _0xb55f35=function(_0x48f8ef){while(--_0x48f8ef){_0x5c8f3e['push'](_0x5c8f3e['shift']());}};_0xb55f35(++_0x33ba70);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x44334a,_0x181bce){_0x44334a=_0x44334a-0x0;var _0x20a140=_0xbdb7[_0x44334a];return _0x20a140;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var moment=require(_0x7bdb('0x4'));var BPromise=require(_0x7bdb('0x5'));var rp=require(_0x7bdb('0x6'));var attributes=require(_0x7bdb('0x7'));module[_0x7bdb('0x8')]=function(_0x47aec5,_0x28542c){return _0x47aec5['define']('OpenchannelAccount',attributes,{'tableName':_0x7bdb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d2c567a..fc22acd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd0f=['code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','socket.io-emitter','localhost','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5ac6ab,_0x31e863){var _0x3a39f=function(_0x5a7b8a){while(--_0x5a7b8a){_0x5ac6ab['push'](_0x5ac6ab['shift']());}};_0x3a39f(++_0x31e863);}(_0xfd0f,0x1b8));var _0xffd0=function(_0xb022db,_0x30bc34){_0xb022db=_0xb022db-0x0;var _0x2a03c7=_0xfd0f[_0xb022db];return _0x2a03c7;};'use strict';var _=require(_0xffd0('0x0'));var util=require(_0xffd0('0x1'));var moment=require('moment');var BPromise=require(_0xffd0('0x2'));var rs=require(_0xffd0('0x3'));var fs=require('fs');var db=require(_0xffd0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xffd0('0x5'))('rpc');var config=require(_0xffd0('0x6'));var jayson=require(_0xffd0('0x7'));var client=jayson[_0xffd0('0x8')][_0xffd0('0x9')]({'port':0x232a});var socket=require(_0xffd0('0xa'))({'host':_0xffd0('0xb'),'port':0x18eb});require(_0xffd0('0xc'))[_0xffd0('0xd')](socket);function respondWithRpcPromise(_0x55488d,_0x4e2d54,_0x46129b){return new BPromise(function(_0x2d4cd8,_0x1b3842){return client[_0xffd0('0xe')](_0x55488d,_0x46129b)['then'](function(_0x5947d2){logger[_0xffd0('0xf')](_0xffd0('0x10'),_0x4e2d54,_0xffd0('0x11'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x4e2d54,_0xffd0('0x11'),JSON[_0xffd0('0x12')](_0x5947d2));if(_0x5947d2['error']){if(_0x5947d2[_0xffd0('0x13')][_0xffd0('0x14')]===0x1f4){logger[_0xffd0('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x4e2d54,_0x5947d2[_0xffd0('0x13')][_0xffd0('0x15')]);return _0x1b3842(_0x5947d2['error'][_0xffd0('0x15')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x4e2d54,_0x5947d2[_0xffd0('0x13')]['message']);return _0x2d4cd8(_0x5947d2[_0xffd0('0x13')][_0xffd0('0x15')]);}else{logger[_0xffd0('0xf')](_0xffd0('0x10'),_0x4e2d54,_0xffd0('0x11'));_0x2d4cd8(_0x5947d2['result']['message']);}})[_0xffd0('0x16')](function(_0x3a3bf4){logger[_0xffd0('0x13')](_0xffd0('0x10'),_0x4e2d54,_0x3a3bf4);_0x1b3842(_0x3a3bf4);});});}
\ No newline at end of file
+var _0x425d=['request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','socket.io-emitter','localhost','./openchannelAccount.socket'];(function(_0x29c4ec,_0x27541e){var _0x4e6d83=function(_0x30d4d1){while(--_0x30d4d1){_0x29c4ec['push'](_0x29c4ec['shift']());}};_0x4e6d83(++_0x27541e);}(_0x425d,0x1e0));var _0xd425=function(_0x5bf4fa,_0xc0399f){_0x5bf4fa=_0x5bf4fa-0x0;var _0x519465=_0x425d[_0x5bf4fa];return _0x519465;};'use strict';var _=require(_0xd425('0x0'));var util=require('util');var moment=require(_0xd425('0x1'));var BPromise=require(_0xd425('0x2'));var rs=require(_0xd425('0x3'));var fs=require('fs');var db=require(_0xd425('0x4'))['db'];var utils=require(_0xd425('0x5'));var logger=require(_0xd425('0x6'))(_0xd425('0x7'));var config=require('../../config/environment');var jayson=require(_0xd425('0x8'));var client=jayson[_0xd425('0x9')][_0xd425('0xa')]({'port':0x232a});var socket=require(_0xd425('0xb'))({'host':_0xd425('0xc'),'port':0x18eb});require(_0xd425('0xd'))['register'](socket);function respondWithRpcPromise(_0xb6ba8e,_0x374c3d,_0x262b02){return new BPromise(function(_0x3c4db2,_0x2db9da){return client[_0xd425('0xe')](_0xb6ba8e,_0x262b02)[_0xd425('0xf')](function(_0x1969ba){logger[_0xd425('0x10')](_0xd425('0x11'),_0x374c3d,_0xd425('0x12'));logger[_0xd425('0x13')](_0xd425('0x14'),_0x374c3d,_0xd425('0x12'),JSON[_0xd425('0x15')](_0x1969ba));if(_0x1969ba[_0xd425('0x16')]){if(_0x1969ba[_0xd425('0x16')][_0xd425('0x17')]===0x1f4){logger[_0xd425('0x16')](_0xd425('0x11'),_0x374c3d,_0x1969ba['error'][_0xd425('0x18')]);return _0x2db9da(_0x1969ba[_0xd425('0x16')][_0xd425('0x18')]);}logger['error'](_0xd425('0x11'),_0x374c3d,_0x1969ba[_0xd425('0x16')][_0xd425('0x18')]);return _0x3c4db2(_0x1969ba[_0xd425('0x16')][_0xd425('0x18')]);}else{logger['info'](_0xd425('0x11'),_0x374c3d,_0xd425('0x12'));_0x3c4db2(_0x1969ba[_0xd425('0x19')][_0xd425('0x18')]);}})['catch'](function(_0x19d7d4){logger[_0xd425('0x16')](_0xd425('0x11'),_0x374c3d,_0x19d7d4);_0x2db9da(_0x19d7d4);});});}
\ No newline at end of file
index 394cb6b..4408faa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa957=['length','openchannelAccount:','./openchannelAccount.events','save','update','emit','removeListener','register'];(function(_0x170f85,_0x234754){var _0x229661=function(_0x31e4e2){while(--_0x31e4e2){_0x170f85['push'](_0x170f85['shift']());}};_0x229661(++_0x234754);}(_0xa957,0x11a));var _0x7a95=function(_0x13b109,_0x2c9371){_0x13b109=_0x13b109-0x0;var _0x54aa84=_0xa957[_0x13b109];return _0x54aa84;};'use strict';var OpenchannelAccountEvents=require(_0x7a95('0x0'));var events=[_0x7a95('0x1'),'remove',_0x7a95('0x2')];function createListener(_0x5047cb,_0x3276f8){return function(_0x519bb5){_0x3276f8[_0x7a95('0x3')](_0x5047cb,_0x519bb5);};}function removeListener(_0x3a70a8,_0x59dea8){return function(){OpenchannelAccountEvents[_0x7a95('0x4')](_0x3a70a8,_0x59dea8);};}exports[_0x7a95('0x5')]=function(_0x29df13){for(var _0x4634b5=0x0,_0x3db244=events[_0x7a95('0x6')];_0x4634b5<_0x3db244;_0x4634b5++){var _0x261fc2=events[_0x4634b5];var _0x22ab4e=createListener(_0x7a95('0x7')+_0x261fc2,_0x29df13);OpenchannelAccountEvents['on'](_0x261fc2,_0x22ab4e);}};
\ No newline at end of file
+var _0x6ee1=['update','removeListener','register','length','openchannelAccount:','save','remove'];(function(_0x5b3f61,_0x5bdade){var _0x246e19=function(_0x44b484){while(--_0x44b484){_0x5b3f61['push'](_0x5b3f61['shift']());}};_0x246e19(++_0x5bdade);}(_0x6ee1,0x186));var _0x16ee=function(_0x4e8286,_0x4eaeb4){_0x4e8286=_0x4e8286-0x0;var _0x44a440=_0x6ee1[_0x4e8286];return _0x44a440;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x16ee('0x0'),_0x16ee('0x1'),_0x16ee('0x2')];function createListener(_0x5c0d3e,_0x4f5d02){return function(_0x1b0b45){_0x4f5d02['emit'](_0x5c0d3e,_0x1b0b45);};}function removeListener(_0x3a4c80,_0x193fd3){return function(){OpenchannelAccountEvents[_0x16ee('0x3')](_0x3a4c80,_0x193fd3);};}exports[_0x16ee('0x4')]=function(_0x112471){for(var _0x494f62=0x0,_0x5d4422=events[_0x16ee('0x5')];_0x494f62<_0x5d4422;_0x494f62++){var _0x831209=events[_0x494f62];var _0x4cfa97=createListener(_0x16ee('0x6')+_0x831209,_0x112471);OpenchannelAccountEvents['on'](_0x831209,_0x4cfa97);}};
\ No newline at end of file
index dc8f5c1..a0c6d22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0xe706,0xa3));var _0x6e70=function(_0x50cc54,_0x54c15f){_0x50cc54=_0x50cc54-0x0;var _0x28ecca=_0xe706[_0x50cc54];return _0x28ecca;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var express=require('express');var router=express[_0x6e70('0x3')]();var auth=require(_0x6e70('0x4'));var interaction=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var controller=require(_0x6e70('0x7'));router[_0x6e70('0x8')]('/',auth[_0x6e70('0x9')](),controller[_0x6e70('0xa')]);router[_0x6e70('0x8')](_0x6e70('0xb'),auth[_0x6e70('0x9')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xd')]('/',auth[_0x6e70('0x9')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xf')](_0x6e70('0xb'),auth[_0x6e70('0x9')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')](_0x6e70('0xb'),auth[_0x6e70('0x9')](),controller[_0x6e70('0x12')]);module[_0x6e70('0x13')]=router;
\ No newline at end of file
+var _0xe706=['delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x65ca71,_0x126845){var _0x5cb16e=function(_0xe1143b){while(--_0xe1143b){_0x65ca71['push'](_0x65ca71['shift']());}};_0x5cb16e(++_0x126845);}(_0xe706,0xa3));var _0x6e70=function(_0x2aa733,_0xcde568){_0x2aa733=_0x2aa733-0x0;var _0x2bcf85=_0xe706[_0x2aa733];return _0x2bcf85;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var express=require('express');var router=express[_0x6e70('0x3')]();var auth=require(_0x6e70('0x4'));var interaction=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var controller=require(_0x6e70('0x7'));router[_0x6e70('0x8')]('/',auth[_0x6e70('0x9')](),controller[_0x6e70('0xa')]);router[_0x6e70('0x8')](_0x6e70('0xb'),auth[_0x6e70('0x9')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xd')]('/',auth[_0x6e70('0x9')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xf')](_0x6e70('0xb'),auth[_0x6e70('0x9')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')](_0x6e70('0xb'),auth[_0x6e70('0x9')](),controller[_0x6e70('0x12')]);module[_0x6e70('0x13')]=router;
\ No newline at end of file
index 82f726d..d5ea89d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f82=['*,*,*,*','sequelize','INTEGER','noop','STRING'];(function(_0x137e93,_0x43d3c0){var _0x1f8ba3=function(_0x41f676){while(--_0x41f676){_0x137e93['push'](_0x137e93['shift']());}};_0x1f8ba3(++_0x43d3c0);}(_0x1f82,0xd8));var _0x21f8=function(_0x37be36,_0x18fe03){_0x37be36=_0x37be36-0x0;var _0x47108e=_0x1f82[_0x37be36];return _0x47108e;};'use strict';var Sequelize=require(_0x21f8('0x0'));module['exports']={'priority':{'type':Sequelize[_0x21f8('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x21f8('0x2')},'appdata':{'type':Sequelize[_0x21f8('0x3')](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0x21f8('0x3')]},'interval':{'type':Sequelize[_0x21f8('0x3')],'defaultValue':_0x21f8('0x4')}};
\ No newline at end of file
+var _0xe58f=['STRING','*,*,*,*','sequelize','exports','noop'];(function(_0x10c8c3,_0x4d373e){var _0x22b329=function(_0x5f1b76){while(--_0x5f1b76){_0x10c8c3['push'](_0x10c8c3['shift']());}};_0x22b329(++_0x4d373e);}(_0xe58f,0x1ec));var _0xfe58=function(_0x3c744f,_0x4264b3){_0x3c744f=_0x3c744f-0x0;var _0x39edee=_0xe58f[_0x3c744f];return _0x39edee;};'use strict';var Sequelize=require(_0xfe58('0x0'));module[_0xfe58('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfe58('0x2')},'appdata':{'type':Sequelize[_0xfe58('0x3')](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0xfe58('0x3')]},'interval':{'type':Sequelize[_0xfe58('0x3')],'defaultValue':_0xfe58('0x4')}};
\ No newline at end of file
index dfba545..94d8013 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cc4=['params','keys','rawAttributes','find','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','stack','name','send','OpenchannelApplication','model','query','dateStart','dateEnd','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','add','day','merge','where','filter','map','options','includeAll','include','findAll','rows','catch','show'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x2cc4,0x1f0));var _0x42cc=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0x2cc4[_0x4bcf38];return _0x4a89be;};'use strict';var pdf=require(_0x42cc('0x0'));var emlformat=require(_0x42cc('0x1'));var rimraf=require(_0x42cc('0x2'));var zipdir=require(_0x42cc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x42cc('0x4'));var moment=require(_0x42cc('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x42cc('0x6'));var sox=require(_0x42cc('0x7'));var csv=require(_0x42cc('0x8'));var ejs=require(_0x42cc('0x9'));var fs=require('fs');var _=require(_0x42cc('0xa'));var squel=require('squel');var crypto=require(_0x42cc('0xb'));var jsforce=require(_0x42cc('0xc'));var deskjs=require(_0x42cc('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x42cc('0xe'));var qs=require(_0x42cc('0xf'));var logger=require(_0x42cc('0x10'))(_0x42cc('0x11'));var utils=require(_0x42cc('0x12'));var config=require(_0x42cc('0x13'));var db=require(_0x42cc('0x14'))['db'];function respondWithStatusCode(_0xc2dfa5,_0xa95655){_0xa95655=_0xa95655||0xcc;return function(_0xe8830e){if(_0xe8830e){return _0xc2dfa5[_0x42cc('0x15')](_0xa95655);}return _0xc2dfa5[_0x42cc('0x16')](_0xa95655)['end']();};}function respondWithResult(_0x5d4911,_0x52ed54){_0x52ed54=_0x52ed54||0xc8;return function(_0x2fe0e0){if(_0x2fe0e0){return _0x5d4911[_0x42cc('0x16')](_0x52ed54)[_0x42cc('0x17')](_0x2fe0e0);}};}function respondWithFilteredResult(_0x561a8d,_0x45ebd6){return function(_0x4feb57){if(_0x4feb57){var _0x239fb1=_0x4feb57[_0x42cc('0x18')],_0x5e703f=_0x45ebd6[_0x42cc('0x19')],_0x3287a2=_0x45ebd6[_0x42cc('0x19')]+_0x45ebd6[_0x42cc('0x1a')],_0x21a34e;if(_0x3287a2>=_0x239fb1){_0x3287a2=_0x239fb1;_0x21a34e=0xc8;}else{_0x21a34e=0xce;}_0x561a8d[_0x42cc('0x16')](_0x21a34e);return _0x561a8d[_0x42cc('0x1b')](_0x42cc('0x1c'),_0x5e703f+'-'+_0x3287a2+'/'+_0x239fb1)[_0x42cc('0x17')](_0x4feb57);}return null;};}function patchUpdates(_0x50ccdb){return function(_0xcfc2ae){try{jsonpatch[_0x42cc('0x1d')](_0xcfc2ae,_0x50ccdb,!![]);}catch(_0x51062a){return BPromise['reject'](_0x51062a);}return _0xcfc2ae[_0x42cc('0x1e')]();};}function saveUpdates(_0x4e0cc9,_0x2cc7ba){return function(_0xb50f9b){if(_0xb50f9b){return _0xb50f9b[_0x42cc('0x1f')](_0x4e0cc9)[_0x42cc('0x20')](function(_0x197c32){return _0x197c32;});}return null;};}function removeEntity(_0x31e781,_0x17a44b){return function(_0x4dc736){if(_0x4dc736){return _0x4dc736[_0x42cc('0x21')]()['then'](function(){_0x31e781[_0x42cc('0x16')](0xcc)[_0x42cc('0x22')]();});}};}function handleEntityNotFound(_0x58c348,_0x118e3f){return function(_0x1d51d9){if(!_0x1d51d9){_0x58c348['sendStatus'](0x194);}return _0x1d51d9;};}function handleError(_0x293aad,_0x4c9bcb){_0x4c9bcb=_0x4c9bcb||0x1f4;return function(_0x136e2b){logger['error'](_0x136e2b[_0x42cc('0x23')]);if(_0x136e2b[_0x42cc('0x24')]){delete _0x136e2b[_0x42cc('0x24')];}_0x293aad['status'](_0x4c9bcb)[_0x42cc('0x25')](_0x136e2b);};}exports['index']=function(_0x4135bb,_0x39a076){var _0x3d1d2f={},_0x326d40={},_0x46e01c={'count':0x0,'rows':[]};var _0x3d4939=db[_0x42cc('0x26')]['rawAttributes'];_0x326d40[_0x42cc('0x27')]=_['keys'](_0x3d4939);var _0x854028={'dateStart':_0x4135bb[_0x42cc('0x28')][_0x42cc('0x29')],'dateEnd':_0x4135bb['query'][_0x42cc('0x2a')]};delete _0x4135bb[_0x42cc('0x28')][_0x42cc('0x29')];delete _0x4135bb['query']['dateEnd'];_0x326d40[_0x42cc('0x28')]=_['keys'](_0x4135bb[_0x42cc('0x28')]);_0x326d40[_0x42cc('0x2b')]=_[_0x42cc('0x2c')](_0x326d40[_0x42cc('0x27')],_0x326d40[_0x42cc('0x28')]);_0x3d1d2f['attributes']=_[_0x42cc('0x2c')](_0x326d40['model'],qs[_0x42cc('0x2d')](_0x4135bb['query'][_0x42cc('0x2d')]));_0x3d1d2f[_0x42cc('0x2e')]=_0x3d1d2f[_0x42cc('0x2e')][_0x42cc('0x2f')]?_0x3d1d2f[_0x42cc('0x2e')]:_0x326d40[_0x42cc('0x27')];if(!_0x4135bb['query'][_0x42cc('0x30')](_0x42cc('0x31'))){_0x3d1d2f[_0x42cc('0x1a')]=qs['limit'](_0x4135bb['query']['limit']);_0x3d1d2f[_0x42cc('0x19')]=qs[_0x42cc('0x19')](_0x4135bb['query'][_0x42cc('0x19')]);}_0x3d1d2f['order']=qs[_0x42cc('0x32')](_0x4135bb[_0x42cc('0x28')][_0x42cc('0x32')]);_0x3d1d2f['where']=qs[_0x42cc('0x2b')](_['pick'](_0x4135bb[_0x42cc('0x28')],_0x326d40[_0x42cc('0x2b')]));if(_0x854028[_0x42cc('0x29')]){if(_0x854028[_0x42cc('0x2a')]){_0x854028[_0x42cc('0x2a')]=moment(_0x854028['dateEnd'])[_0x42cc('0x33')](0x1,_0x42cc('0x34'));}else{_0x854028[_0x42cc('0x2a')]=moment(_0x854028['dateStart'])[_0x42cc('0x33')](0x1,_0x42cc('0x34'));}_[_0x42cc('0x35')](_0x3d1d2f[_0x42cc('0x36')],{'createdAt':{'$gte':_0x854028['dateStart'],'$lte':_0x854028['dateEnd']}});}if(_0x4135bb[_0x42cc('0x28')][_0x42cc('0x37')]){_0x3d1d2f['where']=_['merge'](_0x3d1d2f[_0x42cc('0x36')],{'$or':_[_0x42cc('0x38')](_0x3d1d2f[_0x42cc('0x2e')],function(_0x28e17b){var _0x27b90a={};_0x27b90a[_0x28e17b]={'$like':'%'+_0x4135bb['query']['filter']+'%'};return _0x27b90a;})});}_0x3d1d2f=_[_0x42cc('0x35')]({},_0x3d1d2f,_0x4135bb[_0x42cc('0x39')]);var _0x2474ad={'where':_0x3d1d2f[_0x42cc('0x36')]};return db[_0x42cc('0x26')]['count'](_0x2474ad)[_0x42cc('0x20')](function(_0x3ff6ae){_0x46e01c[_0x42cc('0x18')]=_0x3ff6ae;if(_0x4135bb[_0x42cc('0x28')][_0x42cc('0x3a')]){_0x3d1d2f[_0x42cc('0x3b')]=[{'all':!![]}];}return db[_0x42cc('0x26')][_0x42cc('0x3c')](_0x3d1d2f);})[_0x42cc('0x20')](function(_0x45f18e){_0x46e01c[_0x42cc('0x3d')]=_0x45f18e;return _0x46e01c;})[_0x42cc('0x20')](respondWithFilteredResult(_0x39a076,_0x3d1d2f))[_0x42cc('0x3e')](handleError(_0x39a076,null));};exports[_0x42cc('0x3f')]=function(_0x28ac46,_0x49b6b0){var _0x4b25cb={'raw':!![],'where':{'id':_0x28ac46[_0x42cc('0x40')]['id']}},_0x62b9c={};_0x62b9c[_0x42cc('0x27')]=_[_0x42cc('0x41')](db[_0x42cc('0x26')][_0x42cc('0x42')]);_0x62b9c['query']=_[_0x42cc('0x41')](_0x28ac46[_0x42cc('0x28')]);_0x62b9c[_0x42cc('0x2b')]=_[_0x42cc('0x2c')](_0x62b9c[_0x42cc('0x27')],_0x62b9c[_0x42cc('0x28')]);_0x4b25cb[_0x42cc('0x2e')]=_[_0x42cc('0x2c')](_0x62b9c[_0x42cc('0x27')],qs[_0x42cc('0x2d')](_0x28ac46[_0x42cc('0x28')]['fields']));_0x4b25cb['attributes']=_0x4b25cb[_0x42cc('0x2e')][_0x42cc('0x2f')]?_0x4b25cb[_0x42cc('0x2e')]:_0x62b9c[_0x42cc('0x27')];if(_0x28ac46['query'][_0x42cc('0x3a')]){_0x4b25cb['include']=[{'all':!![]}];}_0x4b25cb=_[_0x42cc('0x35')]({},_0x4b25cb,_0x28ac46['options']);return db['OpenchannelApplication'][_0x42cc('0x43')](_0x4b25cb)['then'](handleEntityNotFound(_0x49b6b0,null))[_0x42cc('0x20')](respondWithResult(_0x49b6b0,null))[_0x42cc('0x3e')](handleError(_0x49b6b0,null));};exports[_0x42cc('0x44')]=function(_0x19c953,_0x196d3e){return db['OpenchannelApplication'][_0x42cc('0x44')](_0x19c953[_0x42cc('0x45')],{})[_0x42cc('0x20')](respondWithResult(_0x196d3e,0xc9))[_0x42cc('0x3e')](handleError(_0x196d3e,null));};exports[_0x42cc('0x1f')]=function(_0x584e5a,_0x54bf85){if(_0x584e5a[_0x42cc('0x45')]['id']){delete _0x584e5a[_0x42cc('0x45')]['id'];}return db[_0x42cc('0x26')][_0x42cc('0x43')]({'where':{'id':_0x584e5a[_0x42cc('0x40')]['id']}})[_0x42cc('0x20')](handleEntityNotFound(_0x54bf85,null))[_0x42cc('0x20')](saveUpdates(_0x584e5a[_0x42cc('0x45')],null))[_0x42cc('0x20')](respondWithResult(_0x54bf85,null))['catch'](handleError(_0x54bf85,null));};exports[_0x42cc('0x21')]=function(_0x3eda63,_0x4bdd58){return db['OpenchannelApplication'][_0x42cc('0x43')]({'where':{'id':_0x3eda63[_0x42cc('0x40')]['id']}})[_0x42cc('0x20')](handleEntityNotFound(_0x4bdd58,null))['then'](removeEntity(_0x4bdd58,null))[_0x42cc('0x3e')](handleError(_0x4bdd58,null));};
\ No newline at end of file
+var _0x559f=['crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','limit','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','OpenchannelApplication','rawAttributes','keys','dateStart','query','dateEnd','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','day','merge','where','map','includeAll','include','findAll','rows','catch','options','find','create','body','update','params','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x2335db,_0x334374){var _0x4ab4bc=function(_0xfdf745){while(--_0xfdf745){_0x2335db['push'](_0x2335db['shift']());}};_0x4ab4bc(++_0x334374);}(_0x559f,0x102));var _0xf559=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x559f[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xf559('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf559('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf559('0x2'));var rp=require('request-promise');var moment=require(_0xf559('0x3'));var BPromise=require(_0xf559('0x4'));var Mustache=require(_0xf559('0x5'));var util=require(_0xf559('0x6'));var path=require(_0xf559('0x7'));var sox=require('sox');var csv=require(_0xf559('0x8'));var ejs=require(_0xf559('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf559('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf559('0xb'));var toCsv=require(_0xf559('0x8'));var querystring=require(_0xf559('0xc'));var Papa=require(_0xf559('0xd'));var qs=require(_0xf559('0xe'));var logger=require(_0xf559('0xf'))(_0xf559('0x10'));var utils=require(_0xf559('0x11'));var config=require('../../config/environment');var db=require(_0xf559('0x12'))['db'];function respondWithStatusCode(_0x1d71d6,_0x581514){_0x581514=_0x581514||0xcc;return function(_0x3c97dd){if(_0x3c97dd){return _0x1d71d6[_0xf559('0x13')](_0x581514);}return _0x1d71d6['status'](_0x581514)[_0xf559('0x14')]();};}function respondWithResult(_0x2f1265,_0x27b03a){_0x27b03a=_0x27b03a||0xc8;return function(_0x58d19b){if(_0x58d19b){return _0x2f1265[_0xf559('0x15')](_0x27b03a)[_0xf559('0x16')](_0x58d19b);}};}function respondWithFilteredResult(_0x3899cc,_0x32c8ec){return function(_0x1e0952){if(_0x1e0952){var _0x84e574=_0x1e0952[_0xf559('0x17')],_0x56efed=_0x32c8ec['offset'],_0x12929d=_0x32c8ec['offset']+_0x32c8ec[_0xf559('0x18')],_0x2ffe09;if(_0x12929d>=_0x84e574){_0x12929d=_0x84e574;_0x2ffe09=0xc8;}else{_0x2ffe09=0xce;}_0x3899cc[_0xf559('0x15')](_0x2ffe09);return _0x3899cc[_0xf559('0x19')](_0xf559('0x1a'),_0x56efed+'-'+_0x12929d+'/'+_0x84e574)['json'](_0x1e0952);}return null;};}function patchUpdates(_0x3ccc1b){return function(_0x3198dd){try{jsonpatch[_0xf559('0x1b')](_0x3198dd,_0x3ccc1b,!![]);}catch(_0x2ad438){return BPromise[_0xf559('0x1c')](_0x2ad438);}return _0x3198dd['save']();};}function saveUpdates(_0x131218,_0x5d9d6d){return function(_0x12eb15){if(_0x12eb15){return _0x12eb15['update'](_0x131218)[_0xf559('0x1d')](function(_0xbbd6ee){return _0xbbd6ee;});}return null;};}function removeEntity(_0x3da70a,_0x1b1f88){return function(_0x3f6416){if(_0x3f6416){return _0x3f6416[_0xf559('0x1e')]()[_0xf559('0x1d')](function(){_0x3da70a[_0xf559('0x15')](0xcc)[_0xf559('0x14')]();});}};}function handleEntityNotFound(_0x579665,_0x205f5a){return function(_0x55bf92){if(!_0x55bf92){_0x579665[_0xf559('0x13')](0x194);}return _0x55bf92;};}function handleError(_0x27d6f8,_0x5deff8){_0x5deff8=_0x5deff8||0x1f4;return function(_0x4ff332){logger['error'](_0x4ff332[_0xf559('0x1f')]);if(_0x4ff332[_0xf559('0x20')]){delete _0x4ff332[_0xf559('0x20')];}_0x27d6f8['status'](_0x5deff8)[_0xf559('0x21')](_0x4ff332);};}exports[_0xf559('0x22')]=function(_0xfe9c19,_0x503c40){var _0x15c499={},_0x239018={},_0x11aa28={'count':0x0,'rows':[]};var _0x5690d5=db[_0xf559('0x23')][_0xf559('0x24')];_0x239018['model']=_[_0xf559('0x25')](_0x5690d5);var _0x60bda3={'dateStart':_0xfe9c19['query'][_0xf559('0x26')],'dateEnd':_0xfe9c19[_0xf559('0x27')]['dateEnd']};delete _0xfe9c19['query']['dateStart'];delete _0xfe9c19[_0xf559('0x27')][_0xf559('0x28')];_0x239018['query']=_[_0xf559('0x25')](_0xfe9c19[_0xf559('0x27')]);_0x239018[_0xf559('0x29')]=_[_0xf559('0x2a')](_0x239018[_0xf559('0x2b')],_0x239018[_0xf559('0x27')]);_0x15c499[_0xf559('0x2c')]=_['intersection'](_0x239018[_0xf559('0x2b')],qs[_0xf559('0x2d')](_0xfe9c19[_0xf559('0x27')][_0xf559('0x2d')]));_0x15c499[_0xf559('0x2c')]=_0x15c499['attributes'][_0xf559('0x2e')]?_0x15c499['attributes']:_0x239018[_0xf559('0x2b')];if(!_0xfe9c19[_0xf559('0x27')][_0xf559('0x2f')](_0xf559('0x30'))){_0x15c499[_0xf559('0x18')]=qs[_0xf559('0x18')](_0xfe9c19[_0xf559('0x27')][_0xf559('0x18')]);_0x15c499[_0xf559('0x31')]=qs[_0xf559('0x31')](_0xfe9c19[_0xf559('0x27')]['offset']);}_0x15c499[_0xf559('0x32')]=qs['sort'](_0xfe9c19[_0xf559('0x27')][_0xf559('0x33')]);_0x15c499['where']=qs['filters'](_['pick'](_0xfe9c19[_0xf559('0x27')],_0x239018[_0xf559('0x29')]));if(_0x60bda3[_0xf559('0x26')]){if(_0x60bda3[_0xf559('0x28')]){_0x60bda3[_0xf559('0x28')]=moment(_0x60bda3[_0xf559('0x28')])['add'](0x1,_0xf559('0x34'));}else{_0x60bda3['dateEnd']=moment(_0x60bda3[_0xf559('0x26')])['add'](0x1,'day');}_[_0xf559('0x35')](_0x15c499[_0xf559('0x36')],{'createdAt':{'$gte':_0x60bda3[_0xf559('0x26')],'$lte':_0x60bda3[_0xf559('0x28')]}});}if(_0xfe9c19[_0xf559('0x27')]['filter']){_0x15c499[_0xf559('0x36')]=_[_0xf559('0x35')](_0x15c499[_0xf559('0x36')],{'$or':_[_0xf559('0x37')](_0x15c499[_0xf559('0x2c')],function(_0x1a2b46){var _0x5c2bde={};_0x5c2bde[_0x1a2b46]={'$like':'%'+_0xfe9c19[_0xf559('0x27')]['filter']+'%'};return _0x5c2bde;})});}_0x15c499=_['merge']({},_0x15c499,_0xfe9c19['options']);var _0x1743a7={'where':_0x15c499[_0xf559('0x36')]};return db[_0xf559('0x23')][_0xf559('0x17')](_0x1743a7)[_0xf559('0x1d')](function(_0xecc3b9){_0x11aa28[_0xf559('0x17')]=_0xecc3b9;if(_0xfe9c19[_0xf559('0x27')][_0xf559('0x38')]){_0x15c499[_0xf559('0x39')]=[{'all':!![]}];}return db[_0xf559('0x23')][_0xf559('0x3a')](_0x15c499);})[_0xf559('0x1d')](function(_0x233bca){_0x11aa28[_0xf559('0x3b')]=_0x233bca;return _0x11aa28;})[_0xf559('0x1d')](respondWithFilteredResult(_0x503c40,_0x15c499))[_0xf559('0x3c')](handleError(_0x503c40,null));};exports['show']=function(_0x134ba7,_0x4eef1f){var _0x47d5a9={'raw':!![],'where':{'id':_0x134ba7['params']['id']}},_0x1b4d8e={};_0x1b4d8e[_0xf559('0x2b')]=_[_0xf559('0x25')](db[_0xf559('0x23')][_0xf559('0x24')]);_0x1b4d8e[_0xf559('0x27')]=_['keys'](_0x134ba7[_0xf559('0x27')]);_0x1b4d8e[_0xf559('0x29')]=_[_0xf559('0x2a')](_0x1b4d8e[_0xf559('0x2b')],_0x1b4d8e[_0xf559('0x27')]);_0x47d5a9[_0xf559('0x2c')]=_['intersection'](_0x1b4d8e[_0xf559('0x2b')],qs['fields'](_0x134ba7[_0xf559('0x27')][_0xf559('0x2d')]));_0x47d5a9[_0xf559('0x2c')]=_0x47d5a9['attributes'][_0xf559('0x2e')]?_0x47d5a9[_0xf559('0x2c')]:_0x1b4d8e['model'];if(_0x134ba7[_0xf559('0x27')]['includeAll']){_0x47d5a9[_0xf559('0x39')]=[{'all':!![]}];}_0x47d5a9=_[_0xf559('0x35')]({},_0x47d5a9,_0x134ba7[_0xf559('0x3d')]);return db[_0xf559('0x23')][_0xf559('0x3e')](_0x47d5a9)[_0xf559('0x1d')](handleEntityNotFound(_0x4eef1f,null))[_0xf559('0x1d')](respondWithResult(_0x4eef1f,null))[_0xf559('0x3c')](handleError(_0x4eef1f,null));};exports[_0xf559('0x3f')]=function(_0x481055,_0x152ec5){return db[_0xf559('0x23')][_0xf559('0x3f')](_0x481055[_0xf559('0x40')],{})[_0xf559('0x1d')](respondWithResult(_0x152ec5,0xc9))[_0xf559('0x3c')](handleError(_0x152ec5,null));};exports[_0xf559('0x41')]=function(_0x32856c,_0x534210){if(_0x32856c[_0xf559('0x40')]['id']){delete _0x32856c[_0xf559('0x40')]['id'];}return db[_0xf559('0x23')][_0xf559('0x3e')]({'where':{'id':_0x32856c[_0xf559('0x42')]['id']}})[_0xf559('0x1d')](handleEntityNotFound(_0x534210,null))[_0xf559('0x1d')](saveUpdates(_0x32856c[_0xf559('0x40')],null))[_0xf559('0x1d')](respondWithResult(_0x534210,null))[_0xf559('0x3c')](handleError(_0x534210,null));};exports[_0xf559('0x1e')]=function(_0x13f989,_0x19c68b){return db[_0xf559('0x23')][_0xf559('0x3e')]({'where':{'id':_0x13f989[_0xf559('0x42')]['id']}})[_0xf559('0x1d')](handleEntityNotFound(_0x19c68b,null))[_0xf559('0x1d')](removeEntity(_0x19c68b,null))['catch'](handleError(_0x19c68b,null));};
\ No newline at end of file
index 3b0bf75..1031774 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6e2=['OpenchannelApplication','openchannel_applications','lodash','util','../../config/logger','api','moment','request-promise','exports','define'];(function(_0x57cd7d,_0x1b375d){var _0x4b8578=function(_0x476c6c){while(--_0x476c6c){_0x57cd7d['push'](_0x57cd7d['shift']());}};_0x4b8578(++_0x1b375d);}(_0xe6e2,0xe8));var _0x2e6e=function(_0x34104e,_0x5dc166){_0x34104e=_0x34104e-0x0;var _0x1266f0=_0xe6e2[_0x34104e];return _0x1266f0;};'use strict';var _=require(_0x2e6e('0x0'));var util=require(_0x2e6e('0x1'));var logger=require(_0x2e6e('0x2'))(_0x2e6e('0x3'));var moment=require(_0x2e6e('0x4'));var BPromise=require('bluebird');var rp=require(_0x2e6e('0x5'));var attributes=require('./openchannelApplication.attributes');module[_0x2e6e('0x6')]=function(_0x2fea1c,_0x3aab1b){return _0x2fea1c[_0x2e6e('0x7')](_0x2e6e('0x8'),attributes,{'tableName':_0x2e6e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc016=['bluebird','request-promise','exports','OpenchannelApplication','openchannel_applications','lodash','util','../../config/logger'];(function(_0x274122,_0x1d97a5){var _0x48ca76=function(_0x583a93){while(--_0x583a93){_0x274122['push'](_0x274122['shift']());}};_0x48ca76(++_0x1d97a5);}(_0xc016,0x13d));var _0x6c01=function(_0x240909,_0x51d06d){_0x240909=_0x240909-0x0;var _0x4dce40=_0xc016[_0x240909];return _0x4dce40;};'use strict';var _=require(_0x6c01('0x0'));var util=require(_0x6c01('0x1'));var logger=require(_0x6c01('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6c01('0x3'));var rp=require(_0x6c01('0x4'));var attributes=require('./openchannelApplication.attributes');module[_0x6c01('0x5')]=function(_0x2c290b,_0x3b7ed1){return _0x2c290b['define'](_0x6c01('0x6'),attributes,{'tableName':_0x6c01('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b9fbb38..f21fd10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef6=['error','message','result','catch','update','body','options','raw','limit','UpdateOpenchannelApplication','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x47e4e1,_0x366748){var _0x1d23b3=function(_0x535b16){while(--_0x535b16){_0x47e4e1['push'](_0x47e4e1['shift']());}};_0x1d23b3(++_0x366748);}(_0x8ef6,0xf2));var _0x68ef=function(_0x4c1b4e,_0x1645b2){_0x4c1b4e=_0x4c1b4e-0x0;var _0x12878e=_0x8ef6[_0x4c1b4e];return _0x12878e;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var db=require(_0x68ef('0x5'))['db'];var utils=require(_0x68ef('0x6'));var logger=require('../../config/logger')(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var jayson=require(_0x68ef('0x9'));var client=jayson[_0x68ef('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f77f3,_0x3c2ff3,_0x4740e8){return new BPromise(function(_0x2de776,_0x4eb5eb){return client[_0x68ef('0xb')](_0x4f77f3,_0x4740e8)[_0x68ef('0xc')](function(_0x1bee73){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x3c2ff3,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x3c2ff3,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x1bee73));if(_0x1bee73[_0x68ef('0x13')]){if(_0x1bee73[_0x68ef('0x13')]['code']===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x3c2ff3,_0x1bee73[_0x68ef('0x13')][_0x68ef('0x14')]);return _0x4eb5eb(_0x1bee73[_0x68ef('0x13')][_0x68ef('0x14')]);}logger['error'](_0x68ef('0xe'),_0x3c2ff3,_0x1bee73[_0x68ef('0x13')][_0x68ef('0x14')]);return _0x2de776(_0x1bee73['error'][_0x68ef('0x14')]);}else{logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x3c2ff3,'request\x20sent');_0x2de776(_0x1bee73[_0x68ef('0x15')][_0x68ef('0x14')]);}})[_0x68ef('0x16')](function(_0x3780a4){logger['error'](_0x68ef('0xe'),_0x3c2ff3,_0x3780a4);_0x4eb5eb(_0x3780a4);});});}exports['UpdateOpenchannelApplication']=function(_0x5cbb78){var _0x2633c1=this;return new Promise(function(_0x404870,_0x4ade0d){return db['OpenchannelApplication'][_0x68ef('0x17')](_0x5cbb78[_0x68ef('0x18')],{'raw':_0x5cbb78[_0x68ef('0x19')]?_0x5cbb78['options'][_0x68ef('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cbb78[_0x68ef('0x19')]?_0x5cbb78[_0x68ef('0x19')]['where']||null:null,'attributes':_0x5cbb78[_0x68ef('0x19')]?_0x5cbb78[_0x68ef('0x19')]['attributes']||null:null,'limit':_0x5cbb78[_0x68ef('0x19')]?_0x5cbb78[_0x68ef('0x19')][_0x68ef('0x1b')]||null:null})['then'](function(_0x59723c){logger['info'](_0x68ef('0x1c'),_0x5cbb78);logger[_0x68ef('0x10')](_0x68ef('0x1c'),_0x5cbb78,JSON[_0x68ef('0x12')](_0x59723c));_0x404870(_0x59723c);})[_0x68ef('0x16')](function(_0xfe2595){logger[_0x68ef('0x13')](_0x68ef('0x1c'),_0xfe2595[_0x68ef('0x14')],_0x5cbb78);_0x4ade0d(_0x2633c1[_0x68ef('0x13')](0x1f4,_0xfe2595['message']));});});};
\ No newline at end of file
+var _0x0689=['attributes','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where'];(function(_0x3e844c,_0x114926){var _0x349373=function(_0x2387e0){while(--_0x2387e0){_0x3e844c['push'](_0x3e844c['shift']());}};_0x349373(++_0x114926);}(_0x0689,0x161));var _0x9068=function(_0x51b861,_0xb480d3){_0x51b861=_0x51b861-0x0;var _0x52401b=_0x0689[_0x51b861];return _0x52401b;};'use strict';var _=require('lodash');var util=require(_0x9068('0x0'));var moment=require('moment');var BPromise=require(_0x9068('0x1'));var rs=require(_0x9068('0x2'));var fs=require('fs');var db=require(_0x9068('0x3'))['db'];var utils=require(_0x9068('0x4'));var logger=require(_0x9068('0x5'))(_0x9068('0x6'));var config=require(_0x9068('0x7'));var jayson=require(_0x9068('0x8'));var client=jayson[_0x9068('0x9')][_0x9068('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ce5a7,_0x34cb67,_0x5c833f){return new BPromise(function(_0x4bdd1b,_0x17bc63){return client[_0x9068('0xb')](_0x5ce5a7,_0x5c833f)[_0x9068('0xc')](function(_0x77a2db){logger[_0x9068('0xd')](_0x9068('0xe'),_0x34cb67,_0x9068('0xf'));logger[_0x9068('0x10')](_0x9068('0x11'),_0x34cb67,'request\x20sent',JSON[_0x9068('0x12')](_0x77a2db));if(_0x77a2db[_0x9068('0x13')]){if(_0x77a2db[_0x9068('0x13')][_0x9068('0x14')]===0x1f4){logger['error'](_0x9068('0xe'),_0x34cb67,_0x77a2db[_0x9068('0x13')][_0x9068('0x15')]);return _0x17bc63(_0x77a2db['error'][_0x9068('0x15')]);}logger[_0x9068('0x13')](_0x9068('0xe'),_0x34cb67,_0x77a2db['error'][_0x9068('0x15')]);return _0x4bdd1b(_0x77a2db[_0x9068('0x13')]['message']);}else{logger[_0x9068('0xd')](_0x9068('0xe'),_0x34cb67,'request\x20sent');_0x4bdd1b(_0x77a2db[_0x9068('0x16')][_0x9068('0x15')]);}})[_0x9068('0x17')](function(_0x430000){logger['error'](_0x9068('0xe'),_0x34cb67,_0x430000);_0x17bc63(_0x430000);});});}exports[_0x9068('0x18')]=function(_0x3ab698){var _0x36d591=this;return new Promise(function(_0x3e3a1c,_0x1d09bf){return db[_0x9068('0x19')][_0x9068('0x1a')](_0x3ab698[_0x9068('0x1b')],{'raw':_0x3ab698['options']?_0x3ab698[_0x9068('0x1c')][_0x9068('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ab698[_0x9068('0x1c')]?_0x3ab698[_0x9068('0x1c')][_0x9068('0x1e')]||null:null,'attributes':_0x3ab698[_0x9068('0x1c')]?_0x3ab698[_0x9068('0x1c')][_0x9068('0x1f')]||null:null,'limit':_0x3ab698['options']?_0x3ab698['options']['limit']||null:null})[_0x9068('0xc')](function(_0x5cab20){logger['info'](_0x9068('0x18'),_0x3ab698);logger[_0x9068('0x10')](_0x9068('0x18'),_0x3ab698,JSON[_0x9068('0x12')](_0x5cab20));_0x3e3a1c(_0x5cab20);})['catch'](function(_0x3a64a8){logger[_0x9068('0x13')](_0x9068('0x18'),_0x3a64a8[_0x9068('0x15')],_0x3ab698);_0x1d09bf(_0x36d591[_0x9068('0x13')](0x1f4,_0x3a64a8[_0x9068('0x15')]));});});};
\ No newline at end of file
index 22c9095..45de205 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['util','path','express','Router','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','openchannel','put','openchannelinteraction:update','openchannelinteraction:destroy','destroy','delete','/:id/tags','removeTags','multer'];(function(_0x1911ed,_0x4e8c73){var _0x11edaa=function(_0x216008){while(--_0x216008){_0x1911ed['push'](_0x1911ed['shift']());}};_0x11edaa(++_0x4e8c73);}(_0xabce,0x103));var _0xeabc=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xabce[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var express=require(_0xeabc('0x3'));var router=express[_0xeabc('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xeabc('0x5'));var controller=require(_0xeabc('0x6'));router[_0xeabc('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xeabc('0x7')]('/describe',auth[_0xeabc('0x8')](),controller['describe']);router[_0xeabc('0x7')](_0xeabc('0x9'),auth[_0xeabc('0x8')](),controller['show']);router[_0xeabc('0x7')](_0xeabc('0xa'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0x7')](_0xeabc('0xc'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0xf')]);router[_0xeabc('0xe')](_0xeabc('0xa'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);router[_0xeabc('0xe')]('/:id/tags',auth[_0xeabc('0x8')](),interaction[_0xeabc('0x11')](_0xeabc('0x12'),'openchannelinteraction:addtags'),controller['addTags']);router[_0xeabc('0x13')](_0xeabc('0x9'),auth[_0xeabc('0x8')](),interaction['tracked'](_0xeabc('0x12'),_0xeabc('0x14')),controller['update']);router['delete'](_0xeabc('0x9'),auth['isAuthenticated'](),interaction[_0xeabc('0x11')](_0xeabc('0x12'),_0xeabc('0x15')),controller[_0xeabc('0x16')]);router[_0xeabc('0x17')](_0xeabc('0x18'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0xc4aa=['show','/:id/messages','getMessages','/:id/download','download','post','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','/:id','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','../../components/auth/service','get','isAuthenticated','index','/describe','describe'];(function(_0x4f4cf2,_0x897cd4){var _0x561a48=function(_0x1ea34b){while(--_0x1ea34b){_0x4f4cf2['push'](_0x4f4cf2['shift']());}};_0x561a48(++_0x897cd4);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc4aa[_0x5c2e3e];return _0x53f64a;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var express=require(_0xac4a('0x3'));var router=express[_0xac4a('0x4')]();var auth=require(_0xac4a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelInteraction.controller');router[_0xac4a('0x6')]('/',auth[_0xac4a('0x7')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x6')](_0xac4a('0x9'),auth[_0xac4a('0x7')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xac4a('0xb')]);router[_0xac4a('0x6')](_0xac4a('0xc'),auth['isAuthenticated'](),controller[_0xac4a('0xd')]);router[_0xac4a('0x6')](_0xac4a('0xe'),auth['isAuthenticated'](),controller[_0xac4a('0xf')]);router['post']('/',auth[_0xac4a('0x7')](),controller['create']);router[_0xac4a('0x10')](_0xac4a('0xc'),auth[_0xac4a('0x7')](),controller['addMessage']);router[_0xac4a('0x10')](_0xac4a('0x11'),auth[_0xac4a('0x7')](),interaction[_0xac4a('0x12')](_0xac4a('0x13'),_0xac4a('0x14')),controller[_0xac4a('0x15')]);router[_0xac4a('0x16')](_0xac4a('0x17'),auth[_0xac4a('0x7')](),interaction[_0xac4a('0x12')](_0xac4a('0x13'),'openchannelinteraction:update'),controller[_0xac4a('0x18')]);router[_0xac4a('0x19')](_0xac4a('0x17'),auth[_0xac4a('0x7')](),interaction[_0xac4a('0x12')](_0xac4a('0x13'),_0xac4a('0x1a')),controller[_0xac4a('0x1b')]);router['delete']('/:id/tags',auth[_0xac4a('0x7')](),controller[_0xac4a('0x1c')]);module[_0xac4a('0x1d')]=router;
\ No newline at end of file
index 4171c61..564b9cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x572b=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x4f75b5,_0x4db76d){var _0x5c263b=function(_0x31e622){while(--_0x31e622){_0x4f75b5['push'](_0x4f75b5['shift']());}};_0x5c263b(++_0x4db76d);}(_0x572b,0x1b2));var _0xb572=function(_0x2ac4af,_0x288c53){_0x2ac4af=_0x2ac4af-0x0;var _0x3a36df=_0x572b[_0x2ac4af];return _0x3a36df;};'use strict';var Sequelize=require(_0xb572('0x0'));module[_0xb572('0x1')]={'closed':{'type':Sequelize[_0xb572('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb572('0x3')]},'disposition':{'type':Sequelize[_0xb572('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb572('0x3')]},'threadId':{'type':Sequelize[_0xb572('0x4')]},'externalUrl':{'type':Sequelize[_0xb572('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb572('0x5')]('in',_0xb572('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xb572('0x4')]}};
\ No newline at end of file
+var _0xe107=['BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x4d278d,_0x37ff00){var _0x5e7efd=function(_0x58d770){while(--_0x58d770){_0x4d278d['push'](_0x4d278d['shift']());}};_0x5e7efd(++_0x37ff00);}(_0xe107,0xb3));var _0x7e10=function(_0x2dd2f3,_0x8cd3c8){_0x2dd2f3=_0x2dd2f3-0x0;var _0x286170=_0xe107[_0x2dd2f3];return _0x286170;};'use strict';var Sequelize=require(_0x7e10('0x0'));module['exports']={'closed':{'type':Sequelize[_0x7e10('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7e10('0x2')]},'disposition':{'type':Sequelize[_0x7e10('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x7e10('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x7e10('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x7e10('0x4')]('in',_0x7e10('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 2ab2dfd..237fbf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde32=['distinct','OpenchannelMessage','Messages','direction','createdAt','read','includeAll','User','Users','Contact','Owner','fullname','internal','OpenchannelAccount','key','color','params','fields','length','catch','create','body','update','find','describe','omit','ids','getMessages','findOne','filters','hasOwnProperty','order','OpenchannelInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','emit','removeTags','download','unix','join','root','tmp','server','files','attachments','format','CmContact','firstName','Attachment','Letter','1cm','<h1>Openchannel\x20Interaction:\x20#%d</h1>','<h2>Date:\x20%s</h2>','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','toString','<hr>','<div\x20style=\x22border-style:\x20solid;\x20border-width:\x201px;\x20margin:\x203px;\x22>','<p\x20style=\x22margin:\x203px;\x22>%s:\x20%s</p>','</div>','basename','existsSync','createReadStream','pipe','createWriteStream','interaction-','.pdf','log','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../mysqldb','socket.io-emitter','localhost','./openchannelInteraction.socket','register','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','index','OpenchannelInteraction','rawAttributes','model','keys','query','dateEnd','dateStart','intersection','attributes','nolimit','limit','sort','where','pick','add','day','filter','merge','map','options','include','tag','push','Tag','Tags'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xde32,0xd5));var _0x2de3=function(_0x1d5a50,_0x4f6528){_0x1d5a50=_0x1d5a50-0x0;var _0x4e3414=_0xde32[_0x1d5a50];return _0x4e3414;};'use strict';var pdf=require(_0x2de3('0x0'));var emlformat=require(_0x2de3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2de3('0x2'));var jsonpatch=require(_0x2de3('0x3'));var rp=require('request-promise');var moment=require(_0x2de3('0x4'));var BPromise=require(_0x2de3('0x5'));var Mustache=require(_0x2de3('0x6'));var util=require(_0x2de3('0x7'));var path=require('path');var sox=require(_0x2de3('0x8'));var csv=require(_0x2de3('0x9'));var ejs=require(_0x2de3('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2de3('0xb'));var crypto=require('crypto');var jsforce=require(_0x2de3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2de3('0x9'));var querystring=require(_0x2de3('0xd'));var Papa=require(_0x2de3('0xe'));var qs=require(_0x2de3('0xf'));var logger=require('../../config/logger')(_0x2de3('0x10'));var utils=require(_0x2de3('0x11'));var config=require('../../config/environment');var db=require(_0x2de3('0x12'))['db'];var socket=require(_0x2de3('0x13'))({'host':_0x2de3('0x14'),'port':0x18eb});require(_0x2de3('0x15'))[_0x2de3('0x16')](socket);function respondWithStatusCode(_0xdbddee,_0x7874b1){_0x7874b1=_0x7874b1||0xcc;return function(_0x3daa4d){if(_0x3daa4d){return _0xdbddee[_0x2de3('0x17')](_0x7874b1);}return _0xdbddee[_0x2de3('0x18')](_0x7874b1)['end']();};}function respondWithResult(_0x24735d,_0x581407){_0x581407=_0x581407||0xc8;return function(_0x5b1826){if(_0x5b1826){return _0x24735d['status'](_0x581407)[_0x2de3('0x19')](_0x5b1826);}};}function respondWithFilteredResult(_0x21b60f,_0x1895a5){return function(_0x3587b5){if(_0x3587b5){var _0x4ba450=_0x3587b5[_0x2de3('0x1a')],_0x7e7c2d=_0x1895a5[_0x2de3('0x1b')],_0x33e6b7=_0x1895a5['offset']+_0x1895a5['limit'],_0x563cff;if(_0x33e6b7>=_0x4ba450){_0x33e6b7=_0x4ba450;_0x563cff=0xc8;}else{_0x563cff=0xce;}_0x21b60f[_0x2de3('0x18')](_0x563cff);return _0x21b60f[_0x2de3('0x1c')](_0x2de3('0x1d'),_0x7e7c2d+'-'+_0x33e6b7+'/'+_0x4ba450)[_0x2de3('0x19')](_0x3587b5);}return null;};}function patchUpdates(_0x226f8d){return function(_0x230e27){try{jsonpatch[_0x2de3('0x1e')](_0x230e27,_0x226f8d,!![]);}catch(_0x5cc3d2){return BPromise[_0x2de3('0x1f')](_0x5cc3d2);}return _0x230e27['save']();};}function saveUpdates(_0x2c4f0c,_0x3c229){return function(_0x68ec95){if(_0x68ec95){return _0x68ec95['update'](_0x2c4f0c)[_0x2de3('0x20')](function(_0x23c9cc){return _0x23c9cc;});}return null;};}function removeEntity(_0x163886,_0x22b7cd){return function(_0x33bdad){if(_0x33bdad){return _0x33bdad[_0x2de3('0x21')]()[_0x2de3('0x20')](function(){_0x163886[_0x2de3('0x18')](0xcc)[_0x2de3('0x22')]();});}};}function handleEntityNotFound(_0x2ac6d5,_0x5c0057){return function(_0x359f3b){if(!_0x359f3b){_0x2ac6d5[_0x2de3('0x17')](0x194);}return _0x359f3b;};}function handleError(_0x486217,_0x5ac1e3){_0x5ac1e3=_0x5ac1e3||0x1f4;return function(_0x5d3f6c){logger[_0x2de3('0x23')](_0x5d3f6c[_0x2de3('0x24')]);if(_0x5d3f6c['name']){delete _0x5d3f6c[_0x2de3('0x25')];}_0x486217[_0x2de3('0x18')](_0x5ac1e3)[_0x2de3('0x26')](_0x5d3f6c);};}exports[_0x2de3('0x27')]=function(_0x31cb5f,_0x4fca00){var _0x2c6b92={},_0xd4fd19={},_0x697bc2={'count':0x0,'rows':[]};var _0x2b3deb=db[_0x2de3('0x28')][_0x2de3('0x29')];_0xd4fd19[_0x2de3('0x2a')]=_[_0x2de3('0x2b')](_0x2b3deb);var _0x32f2c2={'dateStart':_0x31cb5f[_0x2de3('0x2c')]['dateStart'],'dateEnd':_0x31cb5f['query'][_0x2de3('0x2d')]};delete _0x31cb5f[_0x2de3('0x2c')][_0x2de3('0x2e')];delete _0x31cb5f['query'][_0x2de3('0x2d')];_0xd4fd19[_0x2de3('0x2c')]=_[_0x2de3('0x2b')](_0x31cb5f[_0x2de3('0x2c')]);_0xd4fd19['filters']=_[_0x2de3('0x2f')](_0xd4fd19['model'],_0xd4fd19[_0x2de3('0x2c')]);_0x2c6b92[_0x2de3('0x30')]=_['intersection'](_0xd4fd19[_0x2de3('0x2a')],qs['fields'](_0x31cb5f['query']['fields']));_0x2c6b92[_0x2de3('0x30')]=_0x2c6b92[_0x2de3('0x30')]['length']?_0x2c6b92[_0x2de3('0x30')]:_0xd4fd19[_0x2de3('0x2a')];if(!_0x31cb5f[_0x2de3('0x2c')]['hasOwnProperty'](_0x2de3('0x31'))){_0x2c6b92[_0x2de3('0x32')]=qs[_0x2de3('0x32')](_0x31cb5f[_0x2de3('0x2c')]['limit']);_0x2c6b92[_0x2de3('0x1b')]=qs[_0x2de3('0x1b')](_0x31cb5f['query'][_0x2de3('0x1b')]);}_0x2c6b92['order']=qs[_0x2de3('0x33')](_0x31cb5f['query'][_0x2de3('0x33')]);_0x2c6b92[_0x2de3('0x34')]=qs['filters'](_[_0x2de3('0x35')](_0x31cb5f[_0x2de3('0x2c')],_0xd4fd19['filters']));if(_0x32f2c2[_0x2de3('0x2e')]){if(_0x32f2c2['dateEnd']){_0x32f2c2[_0x2de3('0x2d')]=moment(_0x32f2c2[_0x2de3('0x2d')])[_0x2de3('0x36')](0x1,_0x2de3('0x37'));}else{_0x32f2c2['dateEnd']=moment(_0x32f2c2['dateStart'])[_0x2de3('0x36')](0x1,_0x2de3('0x37'));}_['merge'](_0x2c6b92['where'],{'createdAt':{'$gte':_0x32f2c2[_0x2de3('0x2e')],'$lte':_0x32f2c2['dateEnd']}});}if(_0x31cb5f[_0x2de3('0x2c')][_0x2de3('0x38')]){_0x2c6b92['where']=_[_0x2de3('0x39')](_0x2c6b92[_0x2de3('0x34')],{'$or':_[_0x2de3('0x3a')](_0x2c6b92[_0x2de3('0x30')],function(_0x517a63){var _0x260f9a={};_0x260f9a[_0x517a63]={'$like':'%'+_0x31cb5f['query'][_0x2de3('0x38')]+'%'};return _0x260f9a;})});}_0x2c6b92=_['merge']({},_0x2c6b92,_0x31cb5f[_0x2de3('0x3b')]);var _0x3db5d4={'where':_0x2c6b92['where']};_0x3db5d4[_0x2de3('0x3c')]=[];if(_0x31cb5f['query'][_0x2de3('0x3d')]){_0x3db5d4[_0x2de3('0x3c')][_0x2de3('0x3e')]({'model':db[_0x2de3('0x3f')],'as':_0x2de3('0x40'),'attributes':['id'],'where':{'id':_0x31cb5f['query'][_0x2de3('0x3d')]},'required':!![]});_0x3db5d4[_0x2de3('0x41')]=!![];}if(_0x31cb5f[_0x2de3('0x2c')]['read']){_0x3db5d4[_0x2de3('0x3c')][_0x2de3('0x3e')]({'model':db[_0x2de3('0x42')],'as':_0x2de3('0x43'),'attributes':['id',_0x2de3('0x44'),_0x2de3('0x45'),_0x2de3('0x46')],'where':{'direction':'in','read':_0x31cb5f[_0x2de3('0x2c')]['read']||![]},'required':!![]});_0x3db5d4[_0x2de3('0x41')]=!![];}return db['OpenchannelInteraction'][_0x2de3('0x1a')](_0x3db5d4)[_0x2de3('0x20')](function(_0x96653a){_0x697bc2[_0x2de3('0x1a')]=_0x96653a;if(_0x31cb5f[_0x2de3('0x2c')][_0x2de3('0x47')]){_0x2c6b92[_0x2de3('0x3c')]=[{'model':db[_0x2de3('0x48')],'as':_0x2de3('0x49'),'required':![],'attributes':['id',_0x2de3('0x25'),'fullname']},{'model':db['CmContact'],'as':_0x2de3('0x4a'),'required':![]},{'model':db['User'],'as':_0x2de3('0x4b'),'attributes':[_0x2de3('0x25'),_0x2de3('0x4c'),_0x2de3('0x4d')],'required':![]},{'model':db[_0x2de3('0x4e')],'as':'Account','attributes':[_0x2de3('0x25'),_0x2de3('0x4f')],'required':![]},{'model':db[_0x2de3('0x42')],'as':'Messages','attributes':['id',_0x2de3('0x44'),_0x2de3('0x45'),_0x2de3('0x46')],'where':{'direction':'in','read':_0x31cb5f[_0x2de3('0x2c')][_0x2de3('0x46')]||![]},'required':_0x31cb5f[_0x2de3('0x2c')]['read']||![]},{'model':db['Tag'],'as':_0x2de3('0x40'),'attributes':['id',_0x2de3('0x25'),_0x2de3('0x50')],'required':_0x31cb5f[_0x2de3('0x2c')][_0x2de3('0x3d')]?!![]:![]},{'model':db[_0x2de3('0x3f')],'as':'ThroughTags','attributes':['id',_0x2de3('0x25'),_0x2de3('0x50')],'through':_0x31cb5f[_0x2de3('0x2c')]['tag']?{'attributes':[],'where':{'TagId':_0x31cb5f[_0x2de3('0x2c')][_0x2de3('0x3d')]||undefined}}:{},'required':_0x31cb5f['query'][_0x2de3('0x3d')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x2c6b92);})[_0x2de3('0x20')](function(_0x205fcf){_0x697bc2['rows']=_0x205fcf;return _0x697bc2;})[_0x2de3('0x20')](respondWithFilteredResult(_0x4fca00,_0x2c6b92))['catch'](handleError(_0x4fca00,null));};exports['show']=function(_0x315d1d,_0x1dbeb7){var _0x2cd52d={'raw':![],'where':{'id':_0x315d1d[_0x2de3('0x51')]['id']}},_0x43681b={};_0x43681b[_0x2de3('0x2a')]=_[_0x2de3('0x2b')](db[_0x2de3('0x28')][_0x2de3('0x29')]);_0x43681b[_0x2de3('0x2c')]=_['keys'](_0x315d1d[_0x2de3('0x2c')]);_0x43681b['filters']=_['intersection'](_0x43681b['model'],_0x43681b['query']);_0x2cd52d['attributes']=_['intersection'](_0x43681b[_0x2de3('0x2a')],qs[_0x2de3('0x52')](_0x315d1d['query']['fields']));_0x2cd52d[_0x2de3('0x30')]=_0x2cd52d[_0x2de3('0x30')][_0x2de3('0x53')]?_0x2cd52d['attributes']:_0x43681b[_0x2de3('0x2a')];if(_0x315d1d[_0x2de3('0x2c')][_0x2de3('0x47')]){_0x2cd52d[_0x2de3('0x3c')]=[{'all':!![]}];}_0x2cd52d=_['merge']({},_0x2cd52d,_0x315d1d['options']);return db['OpenchannelInteraction']['find'](_0x2cd52d)[_0x2de3('0x20')](handleEntityNotFound(_0x1dbeb7,null))[_0x2de3('0x20')](respondWithResult(_0x1dbeb7,null))[_0x2de3('0x54')](handleError(_0x1dbeb7,null));};exports['create']=function(_0x1856c2,_0x321fea){return db['OpenchannelInteraction'][_0x2de3('0x55')](_0x1856c2[_0x2de3('0x56')],{})[_0x2de3('0x20')](respondWithResult(_0x321fea,0xc9))[_0x2de3('0x54')](handleError(_0x321fea,null));};exports[_0x2de3('0x57')]=function(_0x74962c,_0x5f1d98){if(_0x74962c[_0x2de3('0x56')]['id']){delete _0x74962c[_0x2de3('0x56')]['id'];}return db['OpenchannelInteraction'][_0x2de3('0x58')]({'where':{'id':_0x74962c[_0x2de3('0x51')]['id']}})[_0x2de3('0x20')](handleEntityNotFound(_0x5f1d98,null))['then'](saveUpdates(_0x74962c[_0x2de3('0x56')],null))['then'](respondWithResult(_0x5f1d98,null))[_0x2de3('0x54')](handleError(_0x5f1d98,null));};exports[_0x2de3('0x21')]=function(_0x201506,_0x4d665e){return db[_0x2de3('0x28')]['find']({'where':{'id':_0x201506[_0x2de3('0x51')]['id']}})[_0x2de3('0x20')](handleEntityNotFound(_0x4d665e,null))['then'](removeEntity(_0x4d665e,null))['catch'](handleError(_0x4d665e,null));};exports[_0x2de3('0x59')]=function(_0x242e6c,_0x2a9a98){return db['OpenchannelInteraction'][_0x2de3('0x59')]()[_0x2de3('0x20')](respondWithResult(_0x2a9a98,null))[_0x2de3('0x54')](handleError(_0x2a9a98,null));};exports['addMessage']=function(_0x2006c5,_0x41f0b6,_0x51f36d){return db[_0x2de3('0x42')]['find']({'where':{'id':_0x2006c5[_0x2de3('0x51')]['id']}})[_0x2de3('0x20')](handleEntityNotFound(_0x41f0b6,null))['then'](function(_0x1521e5){if(_0x1521e5){return _0x1521e5['addMessage'](_0x2006c5['body']['ids'],_[_0x2de3('0x5a')](_0x2006c5[_0x2de3('0x56')],[_0x2de3('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x41f0b6,null))[_0x2de3('0x54')](handleError(_0x41f0b6,null));};exports[_0x2de3('0x5c')]=function(_0x12b42f,_0x5f579e,_0x3b9969){var _0x97cee8={'raw':![],'where':{}};var _0x4c1dd7={};var _0x4f51d7={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x2de3('0x5d')]({'where':{'id':_0x12b42f[_0x2de3('0x51')]['id']}})[_0x2de3('0x20')](handleEntityNotFound(_0x5f579e,null))['then'](function(_0x3d96cb){if(_0x3d96cb){_0x4c1dd7[_0x2de3('0x2a')]=_[_0x2de3('0x2b')](db['OpenchannelMessage']['rawAttributes']);_0x4c1dd7['query']=_[_0x2de3('0x2b')](_0x12b42f[_0x2de3('0x2c')]);_0x4c1dd7[_0x2de3('0x5e')]=_['intersection'](_0x4c1dd7[_0x2de3('0x2a')],_0x4c1dd7[_0x2de3('0x2c')]);_0x97cee8[_0x2de3('0x30')]=_[_0x2de3('0x2f')](_0x4c1dd7[_0x2de3('0x2a')],qs[_0x2de3('0x52')](_0x12b42f['query'][_0x2de3('0x52')]));_0x97cee8[_0x2de3('0x30')]=_0x97cee8[_0x2de3('0x30')][_0x2de3('0x53')]?_0x97cee8[_0x2de3('0x30')]:_0x4c1dd7[_0x2de3('0x2a')];if(!_0x12b42f[_0x2de3('0x2c')][_0x2de3('0x5f')](_0x2de3('0x31'))){_0x97cee8[_0x2de3('0x32')]=qs[_0x2de3('0x32')](_0x12b42f[_0x2de3('0x2c')][_0x2de3('0x32')]);_0x97cee8[_0x2de3('0x1b')]=qs[_0x2de3('0x1b')](_0x12b42f[_0x2de3('0x2c')][_0x2de3('0x1b')]);}_0x97cee8[_0x2de3('0x60')]=qs['sort'](_0x12b42f[_0x2de3('0x2c')]['sort']);_0x97cee8[_0x2de3('0x34')]=qs[_0x2de3('0x5e')](_[_0x2de3('0x35')](_0x12b42f[_0x2de3('0x2c')],_0x4c1dd7[_0x2de3('0x5e')]));_0x97cee8['where'][_0x2de3('0x61')]=_0x3d96cb['id'];if(_0x12b42f[_0x2de3('0x2c')][_0x2de3('0x38')]){_0x97cee8[_0x2de3('0x34')]=_[_0x2de3('0x39')](_0x97cee8[_0x2de3('0x34')],{'$or':_[_0x2de3('0x3a')](_0x97cee8[_0x2de3('0x30')],function(_0x1e48f1){var _0x5302d2={};_0x5302d2[_0x1e48f1]={'$like':'%'+_0x12b42f[_0x2de3('0x2c')][_0x2de3('0x38')]+'%'};return _0x5302d2;})});}if(_0x12b42f[_0x2de3('0x2c')][_0x2de3('0x62')]){var _0x3e1c4e=_0x12b42f[_0x2de3('0x2c')][_0x2de3('0x62')][_0x2de3('0x63')](',');var _0x31ddb9={};_0x31ddb9[_0x3e1c4e[0x0]]={'$gte':moment(_0x3e1c4e[0x1])['format'](_0x2de3('0x64'))};_0x97cee8[_0x2de3('0x34')]=_['merge'](_0x97cee8[_0x2de3('0x34')],_0x31ddb9);}_0x97cee8=_['merge']({},_0x97cee8,_0x12b42f[_0x2de3('0x3b')]);return db[_0x2de3('0x42')][_0x2de3('0x1a')]({'where':_0x97cee8['where']})['then'](function(_0x5003f1){_0x4f51d7[_0x2de3('0x1a')]=_0x5003f1;if(_0x12b42f[_0x2de3('0x2c')][_0x2de3('0x47')]){_0x97cee8[_0x2de3('0x3c')]=[{'all':!![]}];}return db[_0x2de3('0x42')][_0x2de3('0x65')](_0x97cee8);})['then'](function(_0x2a7ae1){_0x4f51d7[_0x2de3('0x66')]=_0x2a7ae1;return _0x4f51d7;});}})['then'](respondWithFilteredResult(_0x5f579e,_0x97cee8))['catch'](handleError(_0x5f579e,null));};exports[_0x2de3('0x67')]=function(_0x3f0030,_0x2c86d8,_0x540ec8){return db[_0x2de3('0x28')][_0x2de3('0x58')]({'where':{'id':_0x3f0030[_0x2de3('0x51')]['id']}})[_0x2de3('0x20')](handleEntityNotFound(_0x2c86d8,null))[_0x2de3('0x20')](function(_0x12df03){if(_0x12df03){return _0x12df03[_0x2de3('0x68')](_0x3f0030[_0x2de3('0x56')]['ids'],_[_0x2de3('0x5a')](_0x3f0030[_0x2de3('0x56')],[_0x2de3('0x5b'),'id'])||{})[_0x2de3('0x69')](function(){return db['Tag'][_0x2de3('0x65')]({'attributes':['id',_0x2de3('0x25'),_0x2de3('0x50')],'where':{'id':_0x3f0030['body'][_0x2de3('0x5b')]}});})['then'](function(_0xf4b79e){socket[_0x2de3('0x6a')]('openchannelInteractionTags:save',{'id':Number(_0x3f0030[_0x2de3('0x51')]['id']),'tags':_0xf4b79e||[]});return{'id':Number(_0x3f0030[_0x2de3('0x51')]['id']),'tags':_0xf4b79e||[]};});}})[_0x2de3('0x20')](respondWithResult(_0x2c86d8,null))['catch'](handleError(_0x2c86d8,null));};exports['removeTags']=function(_0x2f2fff,_0x11c60b,_0x50cbcd){var _0x2469ca;return db[_0x2de3('0x28')][_0x2de3('0x58')]({'where':{'id':_0x2f2fff[_0x2de3('0x51')]['id']}})[_0x2de3('0x20')](handleEntityNotFound(_0x11c60b,null))['then'](function(_0x4821d8){if(_0x4821d8){return _0x4821d8[_0x2de3('0x6b')](_0x2f2fff[_0x2de3('0x2c')][_0x2de3('0x5b')]);}})[_0x2de3('0x20')](respondWithStatusCode(_0x11c60b,null))[_0x2de3('0x54')](handleError(_0x11c60b,null));};exports[_0x2de3('0x6c')]=function(_0x298c0a,_0x9befbe){var _0x191577=moment()[_0x2de3('0x6d')]()['toString']();var _0x1258bf=path[_0x2de3('0x6e')](config[_0x2de3('0x6f')],'server','files',_0x2de3('0x70'));var _0x176eec=path['join'](config[_0x2de3('0x6f')],_0x2de3('0x71'),_0x2de3('0x72'),_0x2de3('0x73'));var _0xab7ba2=path[_0x2de3('0x6e')](_0x1258bf,_0x191577);var _0x3b1cfe=util[_0x2de3('0x74')]('interaction-%s.zip',_0x191577);var _0x576e68=path['join'](_0x1258bf,_0x3b1cfe);var _0x3999dd=![];return db['OpenchannelInteraction'][_0x2de3('0x58')]({'where':{'id':_0x298c0a[_0x2de3('0x51')]['id']},'include':[{'model':db[_0x2de3('0x42')],'as':'Messages','attributes':['id',_0x2de3('0x56')],'include':[{'model':db['User'],'as':_0x2de3('0x48'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x2de3('0x75')],'as':_0x2de3('0x4a'),'attributes':['id',_0x2de3('0x76')],'raw':!![]},{'model':db[_0x2de3('0x77')],'as':_0x2de3('0x77'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x9befbe,null))['then'](function(_0x3e7bf6){if(_0x3e7bf6){_0x3999dd=!![];var _0xd1928c='';var _0x490322={'format':_0x2de3('0x78'),'border':_0x2de3('0x79')};fs['mkdirSync'](_0xab7ba2);_0xd1928c+=util[_0x2de3('0x74')](_0x2de3('0x7a'),_0x3e7bf6['id']);_0xd1928c+=util['format'](_0x2de3('0x7b'),moment()[_0x2de3('0x74')](_0x2de3('0x7c'))[_0x2de3('0x7d')]());_0xd1928c+=_0x2de3('0x7e');for(var _0x1e639f=0x0;_0x1e639f<_0x3e7bf6[_0x2de3('0x43')]['length'];_0x1e639f++){var _0x1e0213=_0x3e7bf6[_0x2de3('0x43')][_0x1e639f];_0xd1928c+=_0x2de3('0x7f');_0xd1928c+=util[_0x2de3('0x74')](_0x2de3('0x80'),_0x1e0213[_0x2de3('0x48')]?_0x1e0213[_0x2de3('0x48')][_0x2de3('0x4c')]:_0x1e0213['Contact'][_0x2de3('0x76')],_0x1e0213[_0x2de3('0x56')]);_0xd1928c+=_0x2de3('0x81');if(_0x1e0213['Attachment']){var _0x4254e7=_0x1e0213['Attachment'];var _0x1987d5=path['join'](_0x176eec,_0x4254e7[_0x2de3('0x82')]);if(fs[_0x2de3('0x83')](_0x1987d5)){fs[_0x2de3('0x84')](_0x1987d5)[_0x2de3('0x85')](fs[_0x2de3('0x86')](path['join'](_0xab7ba2,_0x4254e7[_0x2de3('0x82')])));}}}return new BPromise(function(_0x41b10b,_0x4bc60e){pdf[_0x2de3('0x55')](_0xd1928c,_0x490322)['toFile'](path[_0x2de3('0x6e')](_0xab7ba2,_0x2de3('0x87')+_0x191577+_0x2de3('0x88')),function(_0x80f91e,_0x1de508){if(_0x80f91e)return _0x4bc60e(_0x80f91e);_0x41b10b(_0x1de508);});});}})[_0x2de3('0x20')](function(){if(_0x3999dd){return new BPromise(function(_0x44fe10,_0x4a06e0){zipdir(_0xab7ba2,{'saveTo':_0x576e68},function(_0x57c9c7,_0x4f11d7){if(_0x57c9c7)return _0x4a06e0(_0x57c9c7);return _0x44fe10(_0x4f11d7);});});}})[_0x2de3('0x20')](function(){if(_0x3999dd){return new BPromise(function(_0x3d1280,_0x2cc008){rimraf(_0xab7ba2,function(_0x53ce13){if(_0x53ce13)_0x2cc008(_0x53ce13);return _0x3d1280();});});}})[_0x2de3('0x20')](function(){if(_0x3999dd){return _0x9befbe[_0x2de3('0x6c')](_0x576e68,_0x3b1cfe,function(_0x4ddeab){if(_0x4ddeab){console[_0x2de3('0x89')]('err',_0x4ddeab);}else{fs[_0x2de3('0x8a')](_0x576e68);}});}else{return _0x9befbe[_0x2de3('0x17')](0xc8);}})[_0x2de3('0x54')](handleError(_0x9befbe,null));};
\ No newline at end of file
+var _0x4645=['update','then','error','stack','name','send','index','rawAttributes','model','dateStart','dateEnd','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','where','pick','add','day','merge','filter','map','options','include','tag','push','Tag','Tags','read','Messages','direction','createdAt','distinct','includeAll','User','Users','fullname','CmContact','Contact','Owner','internal','OpenchannelAccount','Account','key','OpenchannelMessage','color','ThroughTags','OpenchannelInteraction','rows','show','params','length','find','catch','create','body','describe','addMessage','ids','getMessages','findOne','order','sort','OpenchannelInteractionId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','emit','openchannelInteractionTags:save','removeTags','download','toString','root','tmp','join','server','files','attachments','firstName','Attachment','Letter','1cm','mkdirSync','<h1>Openchannel\x20Interaction:\x20#%d</h1>','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','<hr>','<div\x20style=\x22border-style:\x20solid;\x20border-width:\x201px;\x20margin:\x203px;\x22>','<p\x20style=\x22margin:\x203px;\x22>%s:\x20%s</p>','</div>','basename','createReadStream','toFile','interaction-','.pdf','log','err','unlinkSync','sendStatus','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./openchannelInteraction.socket','register','status','end','json','count','offset','limit','set','apply','save'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4645,0x184));var _0x5464=function(_0x3eba49,_0x1c9aee){_0x3eba49=_0x3eba49-0x0;var _0x5845ad=_0x4645[_0x3eba49];return _0x5845ad;};'use strict';var pdf=require(_0x5464('0x0'));var emlformat=require(_0x5464('0x1'));var rimraf=require(_0x5464('0x2'));var zipdir=require(_0x5464('0x3'));var jsonpatch=require(_0x5464('0x4'));var rp=require(_0x5464('0x5'));var moment=require(_0x5464('0x6'));var BPromise=require(_0x5464('0x7'));var Mustache=require(_0x5464('0x8'));var util=require(_0x5464('0x9'));var path=require(_0x5464('0xa'));var sox=require(_0x5464('0xb'));var csv=require(_0x5464('0xc'));var ejs=require(_0x5464('0xd'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5464('0xe'));var jsforce=require(_0x5464('0xf'));var deskjs=require(_0x5464('0x10'));var toCsv=require(_0x5464('0xc'));var querystring=require(_0x5464('0x11'));var Papa=require('papaparse');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x5464('0x12'));var utils=require(_0x5464('0x13'));var config=require(_0x5464('0x14'));var db=require(_0x5464('0x15'))['db'];var socket=require(_0x5464('0x16'))({'host':_0x5464('0x17'),'port':0x18eb});require(_0x5464('0x18'))[_0x5464('0x19')](socket);function respondWithStatusCode(_0x10c06b,_0x23e810){_0x23e810=_0x23e810||0xcc;return function(_0xac24df){if(_0xac24df){return _0x10c06b['sendStatus'](_0x23e810);}return _0x10c06b[_0x5464('0x1a')](_0x23e810)[_0x5464('0x1b')]();};}function respondWithResult(_0x424e5e,_0x1a5602){_0x1a5602=_0x1a5602||0xc8;return function(_0x196086){if(_0x196086){return _0x424e5e[_0x5464('0x1a')](_0x1a5602)[_0x5464('0x1c')](_0x196086);}};}function respondWithFilteredResult(_0x5c0190,_0x7e7e19){return function(_0x49d31e){if(_0x49d31e){var _0x4fe3f6=_0x49d31e[_0x5464('0x1d')],_0x2e648a=_0x7e7e19['offset'],_0x5ed028=_0x7e7e19[_0x5464('0x1e')]+_0x7e7e19[_0x5464('0x1f')],_0x51b3cc;if(_0x5ed028>=_0x4fe3f6){_0x5ed028=_0x4fe3f6;_0x51b3cc=0xc8;}else{_0x51b3cc=0xce;}_0x5c0190[_0x5464('0x1a')](_0x51b3cc);return _0x5c0190[_0x5464('0x20')]('Content-Range',_0x2e648a+'-'+_0x5ed028+'/'+_0x4fe3f6)[_0x5464('0x1c')](_0x49d31e);}return null;};}function patchUpdates(_0x11686){return function(_0x20b18e){try{jsonpatch[_0x5464('0x21')](_0x20b18e,_0x11686,!![]);}catch(_0x5e139b){return BPromise['reject'](_0x5e139b);}return _0x20b18e[_0x5464('0x22')]();};}function saveUpdates(_0x47e14f,_0x416510){return function(_0x25402f){if(_0x25402f){return _0x25402f[_0x5464('0x23')](_0x47e14f)[_0x5464('0x24')](function(_0x461060){return _0x461060;});}return null;};}function removeEntity(_0x16fa52,_0xafcc69){return function(_0x5d30a2){if(_0x5d30a2){return _0x5d30a2['destroy']()[_0x5464('0x24')](function(){_0x16fa52[_0x5464('0x1a')](0xcc)[_0x5464('0x1b')]();});}};}function handleEntityNotFound(_0xb9c88,_0x1b3e6b){return function(_0x5b38c2){if(!_0x5b38c2){_0xb9c88['sendStatus'](0x194);}return _0x5b38c2;};}function handleError(_0x4f65d0,_0x38630d){_0x38630d=_0x38630d||0x1f4;return function(_0x1364af){logger[_0x5464('0x25')](_0x1364af[_0x5464('0x26')]);if(_0x1364af[_0x5464('0x27')]){delete _0x1364af['name'];}_0x4f65d0['status'](_0x38630d)[_0x5464('0x28')](_0x1364af);};}exports[_0x5464('0x29')]=function(_0x31db79,_0x1f5b2b){var _0x503b7a={},_0x2e325d={},_0x57cf19={'count':0x0,'rows':[]};var _0x223172=db['OpenchannelInteraction'][_0x5464('0x2a')];_0x2e325d[_0x5464('0x2b')]=_['keys'](_0x223172);var _0x16b8d5={'dateStart':_0x31db79['query'][_0x5464('0x2c')],'dateEnd':_0x31db79['query'][_0x5464('0x2d')]};delete _0x31db79[_0x5464('0x2e')][_0x5464('0x2c')];delete _0x31db79[_0x5464('0x2e')][_0x5464('0x2d')];_0x2e325d[_0x5464('0x2e')]=_[_0x5464('0x2f')](_0x31db79[_0x5464('0x2e')]);_0x2e325d[_0x5464('0x30')]=_['intersection'](_0x2e325d[_0x5464('0x2b')],_0x2e325d['query']);_0x503b7a[_0x5464('0x31')]=_[_0x5464('0x32')](_0x2e325d['model'],qs[_0x5464('0x33')](_0x31db79[_0x5464('0x2e')]['fields']));_0x503b7a['attributes']=_0x503b7a[_0x5464('0x31')]['length']?_0x503b7a[_0x5464('0x31')]:_0x2e325d[_0x5464('0x2b')];if(!_0x31db79['query'][_0x5464('0x34')](_0x5464('0x35'))){_0x503b7a['limit']=qs[_0x5464('0x1f')](_0x31db79[_0x5464('0x2e')][_0x5464('0x1f')]);_0x503b7a[_0x5464('0x1e')]=qs['offset'](_0x31db79[_0x5464('0x2e')][_0x5464('0x1e')]);}_0x503b7a['order']=qs['sort'](_0x31db79['query']['sort']);_0x503b7a[_0x5464('0x36')]=qs[_0x5464('0x30')](_[_0x5464('0x37')](_0x31db79[_0x5464('0x2e')],_0x2e325d[_0x5464('0x30')]));if(_0x16b8d5['dateStart']){if(_0x16b8d5[_0x5464('0x2d')]){_0x16b8d5[_0x5464('0x2d')]=moment(_0x16b8d5[_0x5464('0x2d')])[_0x5464('0x38')](0x1,'day');}else{_0x16b8d5[_0x5464('0x2d')]=moment(_0x16b8d5[_0x5464('0x2c')])[_0x5464('0x38')](0x1,_0x5464('0x39'));}_[_0x5464('0x3a')](_0x503b7a[_0x5464('0x36')],{'createdAt':{'$gte':_0x16b8d5[_0x5464('0x2c')],'$lte':_0x16b8d5[_0x5464('0x2d')]}});}if(_0x31db79['query'][_0x5464('0x3b')]){_0x503b7a[_0x5464('0x36')]=_[_0x5464('0x3a')](_0x503b7a[_0x5464('0x36')],{'$or':_[_0x5464('0x3c')](_0x503b7a[_0x5464('0x31')],function(_0x31aad7){var _0x4bb8e2={};_0x4bb8e2[_0x31aad7]={'$like':'%'+_0x31db79[_0x5464('0x2e')]['filter']+'%'};return _0x4bb8e2;})});}_0x503b7a=_[_0x5464('0x3a')]({},_0x503b7a,_0x31db79[_0x5464('0x3d')]);var _0x3a2363={'where':_0x503b7a['where']};_0x3a2363[_0x5464('0x3e')]=[];if(_0x31db79['query'][_0x5464('0x3f')]){_0x3a2363[_0x5464('0x3e')][_0x5464('0x40')]({'model':db[_0x5464('0x41')],'as':_0x5464('0x42'),'attributes':['id'],'where':{'id':_0x31db79[_0x5464('0x2e')][_0x5464('0x3f')]},'required':!![]});_0x3a2363['distinct']=!![];}if(_0x31db79[_0x5464('0x2e')][_0x5464('0x43')]){_0x3a2363[_0x5464('0x3e')][_0x5464('0x40')]({'model':db['OpenchannelMessage'],'as':_0x5464('0x44'),'attributes':['id',_0x5464('0x45'),_0x5464('0x46'),_0x5464('0x43')],'where':{'direction':'in','read':_0x31db79[_0x5464('0x2e')][_0x5464('0x43')]||![]},'required':!![]});_0x3a2363[_0x5464('0x47')]=!![];}return db['OpenchannelInteraction'][_0x5464('0x1d')](_0x3a2363)[_0x5464('0x24')](function(_0x58507c){_0x57cf19[_0x5464('0x1d')]=_0x58507c;if(_0x31db79[_0x5464('0x2e')][_0x5464('0x48')]){_0x503b7a[_0x5464('0x3e')]=[{'model':db[_0x5464('0x49')],'as':_0x5464('0x4a'),'required':![],'attributes':['id','name',_0x5464('0x4b')]},{'model':db[_0x5464('0x4c')],'as':_0x5464('0x4d'),'required':![]},{'model':db[_0x5464('0x49')],'as':_0x5464('0x4e'),'attributes':[_0x5464('0x27'),_0x5464('0x4b'),_0x5464('0x4f')],'required':![]},{'model':db[_0x5464('0x50')],'as':_0x5464('0x51'),'attributes':[_0x5464('0x27'),_0x5464('0x52')],'required':![]},{'model':db[_0x5464('0x53')],'as':'Messages','attributes':['id',_0x5464('0x45'),'createdAt',_0x5464('0x43')],'where':{'direction':'in','read':_0x31db79['query'][_0x5464('0x43')]||![]},'required':_0x31db79['query'][_0x5464('0x43')]||![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x5464('0x54')],'required':_0x31db79[_0x5464('0x2e')][_0x5464('0x3f')]?!![]:![]},{'model':db[_0x5464('0x41')],'as':_0x5464('0x55'),'attributes':['id',_0x5464('0x27'),'color'],'through':_0x31db79[_0x5464('0x2e')][_0x5464('0x3f')]?{'attributes':[],'where':{'TagId':_0x31db79[_0x5464('0x2e')]['tag']||undefined}}:{},'required':_0x31db79[_0x5464('0x2e')][_0x5464('0x3f')]?!![]:![]}];}return db[_0x5464('0x56')]['findAll'](_0x503b7a);})['then'](function(_0x6624ae){_0x57cf19[_0x5464('0x57')]=_0x6624ae;return _0x57cf19;})[_0x5464('0x24')](respondWithFilteredResult(_0x1f5b2b,_0x503b7a))['catch'](handleError(_0x1f5b2b,null));};exports[_0x5464('0x58')]=function(_0x3d7d26,_0xef2318){var _0x2fa9fc={'raw':![],'where':{'id':_0x3d7d26[_0x5464('0x59')]['id']}},_0x4e2cda={};_0x4e2cda[_0x5464('0x2b')]=_[_0x5464('0x2f')](db[_0x5464('0x56')][_0x5464('0x2a')]);_0x4e2cda[_0x5464('0x2e')]=_[_0x5464('0x2f')](_0x3d7d26[_0x5464('0x2e')]);_0x4e2cda[_0x5464('0x30')]=_[_0x5464('0x32')](_0x4e2cda['model'],_0x4e2cda[_0x5464('0x2e')]);_0x2fa9fc[_0x5464('0x31')]=_[_0x5464('0x32')](_0x4e2cda[_0x5464('0x2b')],qs[_0x5464('0x33')](_0x3d7d26[_0x5464('0x2e')][_0x5464('0x33')]));_0x2fa9fc[_0x5464('0x31')]=_0x2fa9fc[_0x5464('0x31')][_0x5464('0x5a')]?_0x2fa9fc[_0x5464('0x31')]:_0x4e2cda[_0x5464('0x2b')];if(_0x3d7d26[_0x5464('0x2e')][_0x5464('0x48')]){_0x2fa9fc[_0x5464('0x3e')]=[{'all':!![]}];}_0x2fa9fc=_[_0x5464('0x3a')]({},_0x2fa9fc,_0x3d7d26[_0x5464('0x3d')]);return db['OpenchannelInteraction'][_0x5464('0x5b')](_0x2fa9fc)['then'](handleEntityNotFound(_0xef2318,null))[_0x5464('0x24')](respondWithResult(_0xef2318,null))[_0x5464('0x5c')](handleError(_0xef2318,null));};exports[_0x5464('0x5d')]=function(_0x572893,_0x319cc0){return db[_0x5464('0x56')][_0x5464('0x5d')](_0x572893[_0x5464('0x5e')],{})[_0x5464('0x24')](respondWithResult(_0x319cc0,0xc9))['catch'](handleError(_0x319cc0,null));};exports[_0x5464('0x23')]=function(_0x231c97,_0x2316b6){if(_0x231c97[_0x5464('0x5e')]['id']){delete _0x231c97[_0x5464('0x5e')]['id'];}return db[_0x5464('0x56')]['find']({'where':{'id':_0x231c97[_0x5464('0x59')]['id']}})[_0x5464('0x24')](handleEntityNotFound(_0x2316b6,null))[_0x5464('0x24')](saveUpdates(_0x231c97[_0x5464('0x5e')],null))[_0x5464('0x24')](respondWithResult(_0x2316b6,null))[_0x5464('0x5c')](handleError(_0x2316b6,null));};exports['destroy']=function(_0x271715,_0x4fdc18){return db[_0x5464('0x56')][_0x5464('0x5b')]({'where':{'id':_0x271715[_0x5464('0x59')]['id']}})[_0x5464('0x24')](handleEntityNotFound(_0x4fdc18,null))['then'](removeEntity(_0x4fdc18,null))[_0x5464('0x5c')](handleError(_0x4fdc18,null));};exports[_0x5464('0x5f')]=function(_0x494056,_0x90044a){return db[_0x5464('0x56')]['describe']()[_0x5464('0x24')](respondWithResult(_0x90044a,null))['catch'](handleError(_0x90044a,null));};exports[_0x5464('0x60')]=function(_0x158784,_0x130c11,_0x2f7368){return db[_0x5464('0x53')][_0x5464('0x5b')]({'where':{'id':_0x158784[_0x5464('0x59')]['id']}})[_0x5464('0x24')](handleEntityNotFound(_0x130c11,null))[_0x5464('0x24')](function(_0x36f033){if(_0x36f033){return _0x36f033[_0x5464('0x60')](_0x158784[_0x5464('0x5e')][_0x5464('0x61')],_['omit'](_0x158784[_0x5464('0x5e')],[_0x5464('0x61'),'id'])||{});}})[_0x5464('0x24')](respondWithResult(_0x130c11,null))[_0x5464('0x5c')](handleError(_0x130c11,null));};exports[_0x5464('0x62')]=function(_0xb5dc29,_0x54ddf2,_0x5a2722){var _0x42a69d={'raw':![],'where':{}};var _0x131947={};var _0x4b05f8={'count':0x0,'rows':[]};return db[_0x5464('0x56')][_0x5464('0x63')]({'where':{'id':_0xb5dc29[_0x5464('0x59')]['id']}})['then'](handleEntityNotFound(_0x54ddf2,null))['then'](function(_0x33ac28){if(_0x33ac28){_0x131947[_0x5464('0x2b')]=_[_0x5464('0x2f')](db[_0x5464('0x53')][_0x5464('0x2a')]);_0x131947[_0x5464('0x2e')]=_['keys'](_0xb5dc29[_0x5464('0x2e')]);_0x131947[_0x5464('0x30')]=_[_0x5464('0x32')](_0x131947[_0x5464('0x2b')],_0x131947[_0x5464('0x2e')]);_0x42a69d[_0x5464('0x31')]=_[_0x5464('0x32')](_0x131947[_0x5464('0x2b')],qs[_0x5464('0x33')](_0xb5dc29[_0x5464('0x2e')][_0x5464('0x33')]));_0x42a69d['attributes']=_0x42a69d[_0x5464('0x31')]['length']?_0x42a69d[_0x5464('0x31')]:_0x131947[_0x5464('0x2b')];if(!_0xb5dc29['query'][_0x5464('0x34')](_0x5464('0x35'))){_0x42a69d[_0x5464('0x1f')]=qs['limit'](_0xb5dc29[_0x5464('0x2e')]['limit']);_0x42a69d[_0x5464('0x1e')]=qs['offset'](_0xb5dc29[_0x5464('0x2e')][_0x5464('0x1e')]);}_0x42a69d[_0x5464('0x64')]=qs[_0x5464('0x65')](_0xb5dc29['query'][_0x5464('0x65')]);_0x42a69d[_0x5464('0x36')]=qs[_0x5464('0x30')](_[_0x5464('0x37')](_0xb5dc29[_0x5464('0x2e')],_0x131947['filters']));_0x42a69d['where'][_0x5464('0x66')]=_0x33ac28['id'];if(_0xb5dc29[_0x5464('0x2e')][_0x5464('0x3b')]){_0x42a69d['where']=_['merge'](_0x42a69d['where'],{'$or':_[_0x5464('0x3c')](_0x42a69d[_0x5464('0x31')],function(_0x4da80a){var _0x3fb3a={};_0x3fb3a[_0x4da80a]={'$like':'%'+_0xb5dc29['query']['filter']+'%'};return _0x3fb3a;})});}if(_0xb5dc29['query']['$gte']){var _0x18371e=_0xb5dc29[_0x5464('0x2e')][_0x5464('0x67')][_0x5464('0x68')](',');var _0x4f66de={};_0x4f66de[_0x18371e[0x0]]={'$gte':moment(_0x18371e[0x1])[_0x5464('0x69')](_0x5464('0x6a'))};_0x42a69d[_0x5464('0x36')]=_['merge'](_0x42a69d[_0x5464('0x36')],_0x4f66de);}_0x42a69d=_['merge']({},_0x42a69d,_0xb5dc29[_0x5464('0x3d')]);return db[_0x5464('0x53')][_0x5464('0x1d')]({'where':_0x42a69d[_0x5464('0x36')]})['then'](function(_0x23a069){_0x4b05f8[_0x5464('0x1d')]=_0x23a069;if(_0xb5dc29[_0x5464('0x2e')]['includeAll']){_0x42a69d[_0x5464('0x3e')]=[{'all':!![]}];}return db[_0x5464('0x53')][_0x5464('0x6b')](_0x42a69d);})[_0x5464('0x24')](function(_0xb6b465){_0x4b05f8[_0x5464('0x57')]=_0xb6b465;return _0x4b05f8;});}})[_0x5464('0x24')](respondWithFilteredResult(_0x54ddf2,_0x42a69d))[_0x5464('0x5c')](handleError(_0x54ddf2,null));};exports['addTags']=function(_0xb545a,_0x27332c,_0x557c58){return db[_0x5464('0x56')][_0x5464('0x5b')]({'where':{'id':_0xb545a[_0x5464('0x59')]['id']}})['then'](handleEntityNotFound(_0x27332c,null))[_0x5464('0x24')](function(_0x109243){if(_0x109243){return _0x109243[_0x5464('0x6c')](_0xb545a[_0x5464('0x5e')][_0x5464('0x61')],_['omit'](_0xb545a[_0x5464('0x5e')],[_0x5464('0x61'),'id'])||{})[_0x5464('0x6d')](function(){return db[_0x5464('0x41')][_0x5464('0x6b')]({'attributes':['id','name',_0x5464('0x54')],'where':{'id':_0xb545a[_0x5464('0x5e')]['ids']}});})['then'](function(_0x5e3fea){socket[_0x5464('0x6e')](_0x5464('0x6f'),{'id':Number(_0xb545a[_0x5464('0x59')]['id']),'tags':_0x5e3fea||[]});return{'id':Number(_0xb545a[_0x5464('0x59')]['id']),'tags':_0x5e3fea||[]};});}})[_0x5464('0x24')](respondWithResult(_0x27332c,null))[_0x5464('0x5c')](handleError(_0x27332c,null));};exports[_0x5464('0x70')]=function(_0x135cdd,_0x4ebba1,_0x17b7cf){var _0xaae4d0;return db[_0x5464('0x56')][_0x5464('0x5b')]({'where':{'id':_0x135cdd[_0x5464('0x59')]['id']}})['then'](handleEntityNotFound(_0x4ebba1,null))[_0x5464('0x24')](function(_0x1b8a6a){if(_0x1b8a6a){return _0x1b8a6a[_0x5464('0x70')](_0x135cdd[_0x5464('0x2e')][_0x5464('0x61')]);}})['then'](respondWithStatusCode(_0x4ebba1,null))[_0x5464('0x5c')](handleError(_0x4ebba1,null));};exports[_0x5464('0x71')]=function(_0x4c81fd,_0x42d5ad){var _0x2e3d8f=moment()['unix']()[_0x5464('0x72')]();var _0x5f4853=path['join'](config[_0x5464('0x73')],'server','files',_0x5464('0x74'));var _0x29ad22=path[_0x5464('0x75')](config[_0x5464('0x73')],_0x5464('0x76'),_0x5464('0x77'),_0x5464('0x78'));var _0x37cdc5=path[_0x5464('0x75')](_0x5f4853,_0x2e3d8f);var _0x21d201=util[_0x5464('0x69')]('interaction-%s.zip',_0x2e3d8f);var _0x375323=path[_0x5464('0x75')](_0x5f4853,_0x21d201);var _0x357e56=![];return db[_0x5464('0x56')][_0x5464('0x5b')]({'where':{'id':_0x4c81fd[_0x5464('0x59')]['id']},'include':[{'model':db[_0x5464('0x53')],'as':_0x5464('0x44'),'attributes':['id','body'],'include':[{'model':db[_0x5464('0x49')],'as':_0x5464('0x49'),'attributes':['id',_0x5464('0x4b')],'raw':!![]},{'model':db['CmContact'],'as':'Contact','attributes':['id',_0x5464('0x79')],'raw':!![]},{'model':db[_0x5464('0x7a')],'as':'Attachment','raw':!![]}]}]})[_0x5464('0x24')](handleEntityNotFound(_0x42d5ad,null))[_0x5464('0x24')](function(_0x347463){if(_0x347463){_0x357e56=!![];var _0x4b4bcd='';var _0x2f9e46={'format':_0x5464('0x7b'),'border':_0x5464('0x7c')};fs[_0x5464('0x7d')](_0x37cdc5);_0x4b4bcd+=util['format'](_0x5464('0x7e'),_0x347463['id']);_0x4b4bcd+=util['format']('<h2>Date:\x20%s</h2>',moment()[_0x5464('0x69')](_0x5464('0x7f'))['toString']());_0x4b4bcd+=_0x5464('0x80');for(var _0x25fe3e=0x0;_0x25fe3e<_0x347463['Messages'][_0x5464('0x5a')];_0x25fe3e++){var _0x480b9f=_0x347463[_0x5464('0x44')][_0x25fe3e];_0x4b4bcd+=_0x5464('0x81');_0x4b4bcd+=util[_0x5464('0x69')](_0x5464('0x82'),_0x480b9f[_0x5464('0x49')]?_0x480b9f[_0x5464('0x49')][_0x5464('0x4b')]:_0x480b9f[_0x5464('0x4d')][_0x5464('0x79')],_0x480b9f[_0x5464('0x5e')]);_0x4b4bcd+=_0x5464('0x83');if(_0x480b9f[_0x5464('0x7a')]){var _0x5c375f=_0x480b9f[_0x5464('0x7a')];var _0x2fd274=path[_0x5464('0x75')](_0x29ad22,_0x5c375f[_0x5464('0x84')]);if(fs['existsSync'](_0x2fd274)){fs[_0x5464('0x85')](_0x2fd274)['pipe'](fs['createWriteStream'](path[_0x5464('0x75')](_0x37cdc5,_0x5c375f[_0x5464('0x84')])));}}}return new BPromise(function(_0x584c1e,_0x477aa4){pdf[_0x5464('0x5d')](_0x4b4bcd,_0x2f9e46)[_0x5464('0x86')](path['join'](_0x37cdc5,_0x5464('0x87')+_0x2e3d8f+_0x5464('0x88')),function(_0x444b9f,_0x3ad048){if(_0x444b9f)return _0x477aa4(_0x444b9f);_0x584c1e(_0x3ad048);});});}})[_0x5464('0x24')](function(){if(_0x357e56){return new BPromise(function(_0x53d405,_0x574f2f){zipdir(_0x37cdc5,{'saveTo':_0x375323},function(_0x593c63,_0x373929){if(_0x593c63)return _0x574f2f(_0x593c63);return _0x53d405(_0x373929);});});}})[_0x5464('0x24')](function(){if(_0x357e56){return new BPromise(function(_0xf9bcc5,_0x276d76){rimraf(_0x37cdc5,function(_0x4d6205){if(_0x4d6205)_0x276d76(_0x4d6205);return _0xf9bcc5();});});}})[_0x5464('0x24')](function(){if(_0x357e56){return _0x42d5ad['download'](_0x375323,_0x21d201,function(_0x288f54){if(_0x288f54){console[_0x5464('0x89')](_0x5464('0x8a'),_0x288f54);}else{fs[_0x5464('0x8b')](_0x375323);}});}else{return _0x42d5ad[_0x5464('0x8c')](0xc8);}})['catch'](handleError(_0x42d5ad,null));};
\ No newline at end of file
index a3de8d0..65d3e8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0fe=['save','remove','emit','hook','events','../../mysqldb','setMaxListeners'];(function(_0x56805e,_0x54f5f5){var _0x3c7710=function(_0x27a66f){while(--_0x27a66f){_0x56805e['push'](_0x56805e['shift']());}};_0x3c7710(++_0x54f5f5);}(_0xd0fe,0x17e));var _0xed0f=function(_0x2e2621,_0x2108f3){_0x2e2621=_0x2e2621-0x0;var _0x341f58=_0xd0fe[_0x2e2621];return _0x341f58;};'use strict';var EventEmitter=require(_0xed0f('0x0'));var OpenchannelInteraction=require(_0xed0f('0x1'))['db']['OpenchannelInteraction'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xed0f('0x2')](0x0);var events={'afterCreate':_0xed0f('0x3'),'afterUpdate':'update','afterDestroy':_0xed0f('0x4')};function emitEvent(_0x303086){return function(_0x26606c,_0x3d381d,_0x96a4f7){OpenchannelInteractionEvents[_0xed0f('0x5')](_0x303086+':'+_0x26606c['id'],_0x26606c);OpenchannelInteractionEvents['emit'](_0x303086,_0x26606c);_0x96a4f7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xed0f('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0x68f0=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','OpenchannelInteraction'];(function(_0x3fc97b,_0x20ca29){var _0x3a0c82=function(_0x1c15ec){while(--_0x1c15ec){_0x3fc97b['push'](_0x3fc97b['shift']());}};_0x3a0c82(++_0x20ca29);}(_0x68f0,0x89));var _0x068f=function(_0x34f270,_0x26851b){_0x34f270=_0x34f270-0x0;var _0x172825=_0x68f0[_0x34f270];return _0x172825;};'use strict';var EventEmitter=require(_0x068f('0x0'));var OpenchannelInteraction=require(_0x068f('0x1'))['db'][_0x068f('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x068f('0x3')](0x0);var events={'afterCreate':_0x068f('0x4'),'afterUpdate':_0x068f('0x5'),'afterDestroy':_0x068f('0x6')};function emitEvent(_0x43dc62){return function(_0x3431dc,_0x36e002,_0x4f0ff9){OpenchannelInteractionEvents[_0x068f('0x7')](_0x43dc62+':'+_0x3431dc['id'],_0x3431dc);OpenchannelInteractionEvents[_0x068f('0x7')](_0x43dc62,_0x3431dc);_0x4f0ff9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x068f('0x8')](e,emitEvent(event));}}module[_0x068f('0x9')]=OpenchannelInteractionEvents;
\ No newline at end of file
index 07b8da8..58f4d5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21b8=['moment','bluebird','request-promise','./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','lodash','util','../../config/logger'];(function(_0x23a95e,_0x1035d1){var _0xbe2167=function(_0x50fd49){while(--_0x50fd49){_0x23a95e['push'](_0x23a95e['shift']());}};_0xbe2167(++_0x1035d1);}(_0x21b8,0x1f1));var _0x821b=function(_0x51473d,_0x2d5aa5){_0x51473d=_0x51473d-0x0;var _0x5530f7=_0x21b8[_0x51473d];return _0x5530f7;};'use strict';var _=require(_0x821b('0x0'));var util=require(_0x821b('0x1'));var logger=require(_0x821b('0x2'))('api');var moment=require(_0x821b('0x3'));var BPromise=require(_0x821b('0x4'));var rp=require(_0x821b('0x5'));var attributes=require(_0x821b('0x6'));module['exports']=function(_0x2a2ea3,_0x5ce3fa){return _0x2a2ea3[_0x821b('0x7')](_0x821b('0x8'),attributes,{'tableName':_0x821b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xef18=['exports','define','lodash','moment','request-promise','./openchannelInteraction.attributes'];(function(_0x2858ce,_0x1a92a4){var _0x2de507=function(_0x4e793a){while(--_0x4e793a){_0x2858ce['push'](_0x2858ce['shift']());}};_0x2de507(++_0x1a92a4);}(_0xef18,0xd4));var _0x8ef1=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xef18[_0x344a3f];return _0x264712;};'use strict';var _=require(_0x8ef1('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8ef1('0x1'));var BPromise=require('bluebird');var rp=require(_0x8ef1('0x2'));var attributes=require(_0x8ef1('0x3'));module[_0x8ef1('0x4')]=function(_0x3c7ddb,_0x4db67e){return _0x3c7ddb[_0x8ef1('0x5')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index daee9e5..df8df9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a9e=['omit','AddTags','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','socket.io-emitter','localhost','./openchannelInteraction.socket','request','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelInteraction,\x20%s,\x20%s','info','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where','catch','AddTagsToOpenchannelInteraction','then','ids'];(function(_0x5455bc,_0x3d1ef3){var _0x2d0303=function(_0x4dede4){while(--_0x4dede4){_0x5455bc['push'](_0x5455bc['shift']());}};_0x2d0303(++_0x3d1ef3);}(_0x1a9e,0x122));var _0xe1a9=function(_0x5f3e59,_0x3d3fcc){_0x5f3e59=_0x5f3e59-0x0;var _0x10a05d=_0x1a9e[_0x5f3e59];return _0x10a05d;};'use strict';var _=require(_0xe1a9('0x0'));var util=require('util');var moment=require(_0xe1a9('0x1'));var BPromise=require('bluebird');var rs=require(_0xe1a9('0x2'));var fs=require('fs');var db=require(_0xe1a9('0x3'))['db'];var utils=require(_0xe1a9('0x4'));var logger=require(_0xe1a9('0x5'))(_0xe1a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xe1a9('0x7'));var client=jayson[_0xe1a9('0x8')][_0xe1a9('0x9')]({'port':0x232a});var socket=require(_0xe1a9('0xa'))({'host':_0xe1a9('0xb'),'port':0x18eb});require(_0xe1a9('0xc'))['register'](socket);function respondWithRpcPromise(_0x1337f8,_0x1e38ca,_0x2f6b61){return new BPromise(function(_0x1d451c,_0x22f41c){return client[_0xe1a9('0xd')](_0x1337f8,_0x2f6b61)['then'](function(_0x502785){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x1e38ca,_0xe1a9('0xe'));logger[_0xe1a9('0xf')](_0xe1a9('0x10'),_0x1e38ca,_0xe1a9('0xe'),JSON[_0xe1a9('0x11')](_0x502785));if(_0x502785[_0xe1a9('0x12')]){if(_0x502785[_0xe1a9('0x12')][_0xe1a9('0x13')]===0x1f4){logger[_0xe1a9('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1e38ca,_0x502785[_0xe1a9('0x12')][_0xe1a9('0x14')]);return _0x22f41c(_0x502785[_0xe1a9('0x12')]['message']);}logger['error'](_0xe1a9('0x15'),_0x1e38ca,_0x502785['error']['message']);return _0x1d451c(_0x502785['error'][_0xe1a9('0x14')]);}else{logger[_0xe1a9('0x16')](_0xe1a9('0x15'),_0x1e38ca,_0xe1a9('0xe'));_0x1d451c(_0x502785[_0xe1a9('0x17')][_0xe1a9('0x14')]);}})['catch'](function(_0x3071d9){logger[_0xe1a9('0x12')](_0xe1a9('0x15'),_0x1e38ca,_0x3071d9);_0x22f41c(_0x3071d9);});});}exports[_0xe1a9('0x18')]=function(_0x1b07fc){var _0x49444e=this;return new Promise(function(_0x4c6b76,_0x3cdb61){return db[_0xe1a9('0x19')][_0xe1a9('0x1a')](_0x1b07fc[_0xe1a9('0x1b')],{'raw':_0x1b07fc[_0xe1a9('0x1c')]?_0x1b07fc[_0xe1a9('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b07fc['options']?_0x1b07fc[_0xe1a9('0x1c')][_0xe1a9('0x1d')]||null:null,'attributes':_0x1b07fc[_0xe1a9('0x1c')]?_0x1b07fc['options']['attributes']||null:null,'limit':_0x1b07fc[_0xe1a9('0x1c')]?_0x1b07fc[_0xe1a9('0x1c')]['limit']||null:null})['then'](function(_0x110264){logger[_0xe1a9('0x16')](_0xe1a9('0x18'),_0x1b07fc);logger[_0xe1a9('0xf')](_0xe1a9('0x18'),_0x1b07fc,JSON[_0xe1a9('0x11')](_0x110264));_0x4c6b76(_0x110264);})[_0xe1a9('0x1e')](function(_0x1e0da3){logger['error'](_0xe1a9('0x18'),_0x1e0da3[_0xe1a9('0x14')],_0x1b07fc);_0x3cdb61(_0x49444e[_0xe1a9('0x12')](0x1f4,_0x1e0da3['message']));});});};exports[_0xe1a9('0x1f')]=function(_0x26f53e){return new Promise(function(_0x3b72a3,_0x2916b4){return db[_0xe1a9('0x19')]['find']({'where':_0x26f53e['options']?_0x26f53e[_0xe1a9('0x1c')][_0xe1a9('0x1d')]||null:null})[_0xe1a9('0x20')](function(_0x2e1616){if(_0x2e1616){return _0x2e1616['addTags'](_0x26f53e[_0xe1a9('0x1b')][_0xe1a9('0x21')],_[_0xe1a9('0x22')](_0x26f53e[_0xe1a9('0x1b')],[_0xe1a9('0x21'),'id'])||{});}})['spread'](function(_0x5b0914){logger[_0xe1a9('0x16')](_0xe1a9('0x23'),_0x26f53e);logger[_0xe1a9('0xf')]('AddTags',_0x26f53e,JSON[_0xe1a9('0x11')](_0x5b0914));_0x3b72a3(_0x5b0914);})[_0xe1a9('0x1e')](function(_0x4e7390){logger[_0xe1a9('0x12')](_0xe1a9('0x23'),_0x4e7390[_0xe1a9('0x14')],_0x26f53e);_0x2916b4(_this[_0xe1a9('0x12')](0x1f4,_0x4e7390['message']));});});};
\ No newline at end of file
+var _0x2c91=['AddTagsToOpenchannelInteraction','find','addTags','body','ids','omit','spread','AddTags','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','socket.io-emitter','localhost','./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','options','raw','where','limit'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2c91,0xe0));var _0x12c9=function(_0x14ebb0,_0x238169){_0x14ebb0=_0x14ebb0-0x0;var _0x3d01c3=_0x2c91[_0x14ebb0];return _0x3d01c3;};'use strict';var _=require('lodash');var util=require(_0x12c9('0x0'));var moment=require('moment');var BPromise=require(_0x12c9('0x1'));var rs=require(_0x12c9('0x2'));var fs=require('fs');var db=require(_0x12c9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x12c9('0x4'))('rpc');var config=require(_0x12c9('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});var socket=require(_0x12c9('0x6'))({'host':_0x12c9('0x7'),'port':0x18eb});require(_0x12c9('0x8'))['register'](socket);function respondWithRpcPromise(_0x33b83e,_0x49e4eb,_0x1cbf4b){return new BPromise(function(_0x4440ed,_0x58dbb1){return client[_0x12c9('0x9')](_0x33b83e,_0x1cbf4b)[_0x12c9('0xa')](function(_0x3c2399){logger[_0x12c9('0xb')](_0x12c9('0xc'),_0x49e4eb,_0x12c9('0xd'));logger[_0x12c9('0xe')](_0x12c9('0xf'),_0x49e4eb,_0x12c9('0xd'),JSON[_0x12c9('0x10')](_0x3c2399));if(_0x3c2399[_0x12c9('0x11')]){if(_0x3c2399[_0x12c9('0x11')][_0x12c9('0x12')]===0x1f4){logger[_0x12c9('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x49e4eb,_0x3c2399[_0x12c9('0x11')][_0x12c9('0x13')]);return _0x58dbb1(_0x3c2399[_0x12c9('0x11')]['message']);}logger[_0x12c9('0x11')](_0x12c9('0xc'),_0x49e4eb,_0x3c2399[_0x12c9('0x11')]['message']);return _0x4440ed(_0x3c2399[_0x12c9('0x11')][_0x12c9('0x13')]);}else{logger[_0x12c9('0xb')]('OpenchannelInteraction,\x20%s,\x20%s',_0x49e4eb,_0x12c9('0xd'));_0x4440ed(_0x3c2399[_0x12c9('0x14')][_0x12c9('0x13')]);}})[_0x12c9('0x15')](function(_0x320d02){logger[_0x12c9('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x49e4eb,_0x320d02);_0x58dbb1(_0x320d02);});});}exports[_0x12c9('0x16')]=function(_0x1a702e){var _0x3ae12f=this;return new Promise(function(_0x4361a4,_0xe948b2){return db[_0x12c9('0x17')]['update'](_0x1a702e['body'],{'raw':_0x1a702e['options']?_0x1a702e[_0x12c9('0x18')][_0x12c9('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a702e[_0x12c9('0x18')]?_0x1a702e['options'][_0x12c9('0x1a')]||null:null,'attributes':_0x1a702e[_0x12c9('0x18')]?_0x1a702e[_0x12c9('0x18')]['attributes']||null:null,'limit':_0x1a702e[_0x12c9('0x18')]?_0x1a702e[_0x12c9('0x18')][_0x12c9('0x1b')]||null:null})[_0x12c9('0xa')](function(_0x4ac038){logger[_0x12c9('0xb')]('UpdateOpenchannelInteraction',_0x1a702e);logger[_0x12c9('0xe')](_0x12c9('0x16'),_0x1a702e,JSON[_0x12c9('0x10')](_0x4ac038));_0x4361a4(_0x4ac038);})[_0x12c9('0x15')](function(_0x4cb069){logger[_0x12c9('0x11')](_0x12c9('0x16'),_0x4cb069[_0x12c9('0x13')],_0x1a702e);_0xe948b2(_0x3ae12f['error'](0x1f4,_0x4cb069[_0x12c9('0x13')]));});});};exports[_0x12c9('0x1c')]=function(_0x2c6620){return new Promise(function(_0x9c142e,_0x15ce86){return db[_0x12c9('0x17')][_0x12c9('0x1d')]({'where':_0x2c6620[_0x12c9('0x18')]?_0x2c6620[_0x12c9('0x18')][_0x12c9('0x1a')]||null:null})[_0x12c9('0xa')](function(_0x55deb9){if(_0x55deb9){return _0x55deb9[_0x12c9('0x1e')](_0x2c6620[_0x12c9('0x1f')][_0x12c9('0x20')],_[_0x12c9('0x21')](_0x2c6620[_0x12c9('0x1f')],['ids','id'])||{});}})[_0x12c9('0x22')](function(_0x52e5a4){logger[_0x12c9('0xb')](_0x12c9('0x23'),_0x2c6620);logger['debug'](_0x12c9('0x23'),_0x2c6620,JSON[_0x12c9('0x10')](_0x52e5a4));_0x9c142e(_0x52e5a4);})[_0x12c9('0x15')](function(_0x59a5d3){logger[_0x12c9('0x11')](_0x12c9('0x23'),_0x59a5d3[_0x12c9('0x13')],_0x2c6620);_0x15ce86(_this[_0x12c9('0x11')](0x1f4,_0x59a5d3[_0x12c9('0x13')]));});});};
\ No newline at end of file
index e67bdd2..e02ab10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d09=['register','length','openchannelInteraction:','./openchannelInteraction.events','remove','update','emit'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x8d09,0x130));var _0x98d0=function(_0x13891e,_0x4977fc){_0x13891e=_0x13891e-0x0;var _0x3d679a=_0x8d09[_0x13891e];return _0x3d679a;};'use strict';var OpenchannelInteractionEvents=require(_0x98d0('0x0'));var events=['save',_0x98d0('0x1'),_0x98d0('0x2')];function createListener(_0x24b28a,_0x39c05d){return function(_0x14fcdf){_0x39c05d[_0x98d0('0x3')](_0x24b28a,_0x14fcdf);};}function removeListener(_0x3f5bb2,_0x15af9e){return function(){OpenchannelInteractionEvents['removeListener'](_0x3f5bb2,_0x15af9e);};}exports[_0x98d0('0x4')]=function(_0x433987){for(var _0xeae857=0x0,_0x3033d9=events[_0x98d0('0x5')];_0xeae857<_0x3033d9;_0xeae857++){var _0x53d632=events[_0xeae857];var _0x3a5c8d=createListener(_0x98d0('0x6')+_0x53d632,_0x433987);OpenchannelInteractionEvents['on'](_0x53d632,_0x3a5c8d);}};
\ No newline at end of file
+var _0x6404=['length','openchannelInteraction:','save','emit','removeListener','register'];(function(_0x42f383,_0xde74ff){var _0x39f7e6=function(_0x288c17){while(--_0x288c17){_0x42f383['push'](_0x42f383['shift']());}};_0x39f7e6(++_0xde74ff);}(_0x6404,0xb6));var _0x4640=function(_0x509859,_0x477b9b){_0x509859=_0x509859-0x0;var _0x54ea6b=_0x6404[_0x509859];return _0x54ea6b;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x4640('0x0'),'remove','update'];function createListener(_0x4ab877,_0x2d9aa8){return function(_0x7e9720){_0x2d9aa8[_0x4640('0x1')](_0x4ab877,_0x7e9720);};}function removeListener(_0x349dd8,_0x521ca1){return function(){OpenchannelInteractionEvents[_0x4640('0x2')](_0x349dd8,_0x521ca1);};}exports[_0x4640('0x3')]=function(_0x3186de){for(var _0x299a79=0x0,_0x1f52e4=events[_0x4640('0x4')];_0x299a79<_0x1f52e4;_0x299a79++){var _0x4faa59=events[_0x299a79];var _0x7bebe7=createListener(_0x4640('0x5')+_0x4faa59,_0x3186de);OpenchannelInteractionEvents['on'](_0x4faa59,_0x7bebe7);}};
\ No newline at end of file
index f7d48a8..9d29aba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcee=['update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','/:id','show','post','openchannelmessage:create','put'];(function(_0x2766b4,_0xb9c42c){var _0x3c72ba=function(_0x3c4117){while(--_0x3c4117){_0x2766b4['push'](_0x2766b4['shift']());}};_0x3c72ba(++_0xb9c42c);}(_0xdcee,0x18f));var _0xedce=function(_0x4aea3a,_0x3839f9){_0x4aea3a=_0x4aea3a-0x0;var _0x5a349e=_0xdcee[_0x4aea3a];return _0x5a349e;};'use strict';var multer=require(_0xedce('0x0'));var util=require(_0xedce('0x1'));var path=require(_0xedce('0x2'));var express=require('express');var router=express[_0xedce('0x3')]();var auth=require(_0xedce('0x4'));var interaction=require(_0xedce('0x5'));var config=require(_0xedce('0x6'));var controller=require(_0xedce('0x7'));router[_0xedce('0x8')]('/',auth[_0xedce('0x9')](),controller['index']);router[_0xedce('0x8')]('/describe',auth[_0xedce('0x9')](),controller['describe']);router[_0xedce('0x8')](_0xedce('0xa'),auth[_0xedce('0x9')](),controller[_0xedce('0xb')]);router[_0xedce('0xc')]('/',auth[_0xedce('0x9')](),interaction['tracked']('openchannel',_0xedce('0xd')),controller['create']);router[_0xedce('0xe')](_0xedce('0xa'),auth['isAuthenticated'](),controller[_0xedce('0xf')]);router[_0xedce('0xe')](_0xedce('0x10'),auth[_0xedce('0x9')](),controller[_0xedce('0x11')]);router[_0xedce('0xe')](_0xedce('0x12'),auth[_0xedce('0x9')](),controller[_0xedce('0x13')]);router[_0xedce('0x14')](_0xedce('0xa'),auth['isAuthenticated'](),controller[_0xedce('0x15')]);module[_0xedce('0x16')]=router;
\ No newline at end of file
+var _0xc9dd=['isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc9dd,0x16f));var _0xdc9d=function(_0x29b35f,_0x2fc672){_0x29b35f=_0x29b35f-0x0;var _0x4277e4=_0xc9dd[_0x29b35f];return _0x4277e4;};'use strict';var multer=require('multer');var util=require(_0xdc9d('0x0'));var path=require(_0xdc9d('0x1'));var express=require(_0xdc9d('0x2'));var router=express['Router']();var auth=require(_0xdc9d('0x3'));var interaction=require(_0xdc9d('0x4'));var config=require(_0xdc9d('0x5'));var controller=require(_0xdc9d('0x6'));router[_0xdc9d('0x7')]('/',auth[_0xdc9d('0x8')](),controller[_0xdc9d('0x9')]);router[_0xdc9d('0x7')](_0xdc9d('0xa'),auth['isAuthenticated'](),controller[_0xdc9d('0xb')]);router[_0xdc9d('0x7')](_0xdc9d('0xc'),auth[_0xdc9d('0x8')](),controller[_0xdc9d('0xd')]);router[_0xdc9d('0xe')]('/',auth[_0xdc9d('0x8')](),interaction[_0xdc9d('0xf')](_0xdc9d('0x10'),'openchannelmessage:create'),controller[_0xdc9d('0x11')]);router[_0xdc9d('0x12')]('/:id',auth[_0xdc9d('0x8')](),controller[_0xdc9d('0x13')]);router[_0xdc9d('0x12')](_0xdc9d('0x14'),auth[_0xdc9d('0x8')](),controller[_0xdc9d('0x15')]);router[_0xdc9d('0x12')](_0xdc9d('0x16'),auth[_0xdc9d('0x8')](),controller[_0xdc9d('0x17')]);router[_0xdc9d('0x18')](_0xdc9d('0xc'),auth[_0xdc9d('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 67d0f77..a6b8833 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x265b=['ENUM','out','sequelize','exports','medium','BOOLEAN'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x265b,0x80));var _0xb265=function(_0x5ec7f7,_0x5b2b3a){_0x5ec7f7=_0x5ec7f7-0x0;var _0x3e8d06=_0x265b[_0x5ec7f7];return _0x3e8d06;};'use strict';var Sequelize=require(_0xb265('0x0'));module[_0xb265('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb265('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb265('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb265('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb265('0x4')]('in',_0xb265('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0x5b10=['TEXT','medium','BOOLEAN','out','DATE','sequelize','exports'];(function(_0x576e35,_0x36fbe4){var _0x2c870c=function(_0x792cdb){while(--_0x792cdb){_0x576e35['push'](_0x576e35['shift']());}};_0x2c870c(++_0x36fbe4);}(_0x5b10,0x83));var _0x05b1=function(_0x3faf17,_0x3e74c0){_0x3faf17=_0x3faf17-0x0;var _0x1af88b=_0x5b10[_0x3faf17];return _0x1af88b;};'use strict';var Sequelize=require(_0x05b1('0x0'));module[_0x05b1('0x1')]={'body':{'type':Sequelize[_0x05b1('0x2')](_0x05b1('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x05b1('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x05b1('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x05b1('0x6')]}};
\ No newline at end of file
index a5b2f2f..6ee9a1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55e2=['desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','socket.io-emitter','localhost','./openchannelMessage.socket','register','http','client','then','info','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','apply','reject','save','destroy','stack','name','send','index','OpenchannelMessage','rawAttributes','query','dateEnd','keys','intersection','model','attributes','fields','length','nolimit','limit','sort','filters','pick','day','dateStart','add','merge','where','filter','map','options','findAll','rows','params','includeAll','include','find','create','body','describe','accept','openchannel','read','readAt','format','UserId','CmContact','Contact','OpenchannelInteraction','OpenchannelInteractionId','update','isNil','read1stAt','interaction','user','acceptMessage','SIP/%s','channel','event','EventManager','acceptmessage','openchannel-interactions','agent','get','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','RejectMessage','rejectMessage','interface','rejectmessage','html-pdf','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x2b1e9a,_0x44d00e){var _0x814578=function(_0x4acdb2){while(--_0x4acdb2){_0x2b1e9a['push'](_0x2b1e9a['shift']());}};_0x814578(++_0x44d00e);}(_0x55e2,0xd8));var _0x255e=function(_0x317a15,_0x5b1482){_0x317a15=_0x317a15-0x0;var _0xe0ded8=_0x55e2[_0x317a15];return _0xe0ded8;};'use strict';var pdf=require(_0x255e('0x0'));var emlformat=require(_0x255e('0x1'));var rimraf=require(_0x255e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x255e('0x3'));var moment=require(_0x255e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x255e('0x5'));var util=require('util');var path=require('path');var sox=require(_0x255e('0x6'));var csv=require(_0x255e('0x7'));var ejs=require(_0x255e('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x255e('0x9'));var crypto=require(_0x255e('0xa'));var jsforce=require(_0x255e('0xb'));var deskjs=require(_0x255e('0xc'));var toCsv=require(_0x255e('0x7'));var querystring=require(_0x255e('0xd'));var Papa=require(_0x255e('0xe'));var qs=require(_0x255e('0xf'));var logger=require(_0x255e('0x10'))(_0x255e('0x11'));var utils=require(_0x255e('0x12'));var config=require('../../config/environment');var db=require(_0x255e('0x13'))['db'];var socket=require(_0x255e('0x14'))({'host':_0x255e('0x15'),'port':0x18eb});require(_0x255e('0x16'))[_0x255e('0x17')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x255e('0x18')]({'port':0x232c});var client9002=jayson[_0x255e('0x19')][_0x255e('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x377025,_0x2d4811,_0x4acafd,_0x2f91d6){return new BPromise(function(_0x1ef9c9,_0x46606a){var _0x1a5005=_0x2f91d6||client;return _0x1a5005['request'](_0x377025,_0x4acafd)[_0x255e('0x1a')](function(_0x30828f){logger[_0x255e('0x1b')]('OpenchannelMessage,\x20%s,\x20%s',_0x2d4811,'request\x20sent');logger[_0x255e('0x1c')](_0x255e('0x1d'),_0x2d4811,'request\x20sent',JSON['stringify'](_0x30828f));if(_0x30828f[_0x255e('0x1e')]){if(_0x30828f['error'][_0x255e('0x1f')]===0x1f4){logger['error'](_0x255e('0x20'),_0x2d4811,_0x30828f[_0x255e('0x1e')][_0x255e('0x21')]);return _0x46606a(_0x30828f[_0x255e('0x1e')][_0x255e('0x21')]);}logger[_0x255e('0x1e')](_0x255e('0x20'),_0x2d4811,_0x30828f[_0x255e('0x1e')][_0x255e('0x21')]);return _0x1ef9c9(_0x30828f[_0x255e('0x1e')]['message']);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x2d4811,'request\x20sent');_0x1ef9c9(_0x30828f[_0x255e('0x22')][_0x255e('0x21')]);}})[_0x255e('0x23')](function(_0x492671){logger['error'](_0x255e('0x20'),_0x2d4811,_0x492671);_0x46606a(_0x492671);});});}function respondWithStatusCode(_0x189514,_0x662022){_0x662022=_0x662022||0xcc;return function(_0x12277e){if(_0x12277e){return _0x189514[_0x255e('0x24')](_0x662022);}return _0x189514[_0x255e('0x25')](_0x662022)[_0x255e('0x26')]();};}function respondWithResult(_0x588987,_0x4fafaa){_0x4fafaa=_0x4fafaa||0xc8;return function(_0x547d45){if(_0x547d45){return _0x588987[_0x255e('0x25')](_0x4fafaa)[_0x255e('0x27')](_0x547d45);}};}function respondWithFilteredResult(_0x576e95,_0x4962e0){return function(_0x4ee2d5){if(_0x4ee2d5){var _0x2acb12=_0x4ee2d5[_0x255e('0x28')],_0x4a526f=_0x4962e0[_0x255e('0x29')],_0x10a14b=_0x4962e0['offset']+_0x4962e0['limit'],_0x29bd01;if(_0x10a14b>=_0x2acb12){_0x10a14b=_0x2acb12;_0x29bd01=0xc8;}else{_0x29bd01=0xce;}_0x576e95[_0x255e('0x25')](_0x29bd01);return _0x576e95['set']('Content-Range',_0x4a526f+'-'+_0x10a14b+'/'+_0x2acb12)['json'](_0x4ee2d5);}return null;};}function patchUpdates(_0x4aa048){return function(_0x17a28d){try{jsonpatch[_0x255e('0x2a')](_0x17a28d,_0x4aa048,!![]);}catch(_0x57d3e2){return BPromise[_0x255e('0x2b')](_0x57d3e2);}return _0x17a28d[_0x255e('0x2c')]();};}function saveUpdates(_0x3d8687,_0x255ff6){return function(_0x1b4eb9){if(_0x1b4eb9){return _0x1b4eb9['update'](_0x3d8687)[_0x255e('0x1a')](function(_0x89a75){return _0x89a75;});}return null;};}function removeEntity(_0x3e07f4,_0x110535){return function(_0x442719){if(_0x442719){return _0x442719[_0x255e('0x2d')]()[_0x255e('0x1a')](function(){_0x3e07f4[_0x255e('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5616a0,_0x379154){return function(_0x957105){if(!_0x957105){_0x5616a0[_0x255e('0x24')](0x194);}return _0x957105;};}function handleError(_0x5aa409,_0x296112){_0x296112=_0x296112||0x1f4;return function(_0x176ea3){logger[_0x255e('0x1e')](_0x176ea3[_0x255e('0x2e')]);if(_0x176ea3[_0x255e('0x2f')]){delete _0x176ea3['name'];}_0x5aa409[_0x255e('0x25')](_0x296112)[_0x255e('0x30')](_0x176ea3);};}exports[_0x255e('0x31')]=function(_0x2a68d9,_0x5168dc){var _0x3721d8={},_0x478376={},_0x2d9f56={'count':0x0,'rows':[]};var _0x38feaf=db[_0x255e('0x32')][_0x255e('0x33')];_0x478376['model']=_['keys'](_0x38feaf);var _0x410b81={'dateStart':_0x2a68d9[_0x255e('0x34')]['dateStart'],'dateEnd':_0x2a68d9[_0x255e('0x34')][_0x255e('0x35')]};delete _0x2a68d9[_0x255e('0x34')]['dateStart'];delete _0x2a68d9[_0x255e('0x34')][_0x255e('0x35')];_0x478376[_0x255e('0x34')]=_[_0x255e('0x36')](_0x2a68d9['query']);_0x478376['filters']=_[_0x255e('0x37')](_0x478376[_0x255e('0x38')],_0x478376['query']);_0x3721d8[_0x255e('0x39')]=_[_0x255e('0x37')](_0x478376['model'],qs[_0x255e('0x3a')](_0x2a68d9[_0x255e('0x34')]['fields']));_0x3721d8['attributes']=_0x3721d8[_0x255e('0x39')][_0x255e('0x3b')]?_0x3721d8['attributes']:_0x478376['model'];if(!_0x2a68d9['query']['hasOwnProperty'](_0x255e('0x3c'))){_0x3721d8[_0x255e('0x3d')]=qs[_0x255e('0x3d')](_0x2a68d9['query']['limit']);_0x3721d8['offset']=qs['offset'](_0x2a68d9['query'][_0x255e('0x29')]);}_0x3721d8['order']=qs[_0x255e('0x3e')](_0x2a68d9[_0x255e('0x34')][_0x255e('0x3e')]);_0x3721d8['where']=qs[_0x255e('0x3f')](_[_0x255e('0x40')](_0x2a68d9[_0x255e('0x34')],_0x478376[_0x255e('0x3f')]));if(_0x410b81['dateStart']){if(_0x410b81['dateEnd']){_0x410b81[_0x255e('0x35')]=moment(_0x410b81[_0x255e('0x35')])['add'](0x1,_0x255e('0x41'));}else{_0x410b81[_0x255e('0x35')]=moment(_0x410b81[_0x255e('0x42')])[_0x255e('0x43')](0x1,_0x255e('0x41'));}_[_0x255e('0x44')](_0x3721d8[_0x255e('0x45')],{'createdAt':{'$gte':_0x410b81[_0x255e('0x42')],'$lte':_0x410b81[_0x255e('0x35')]}});}if(_0x2a68d9[_0x255e('0x34')][_0x255e('0x46')]){_0x3721d8[_0x255e('0x45')]=_[_0x255e('0x44')](_0x3721d8[_0x255e('0x45')],{'$or':_[_0x255e('0x47')](_0x3721d8['attributes'],function(_0x22feeb){var _0x45576d={};_0x45576d[_0x22feeb]={'$like':'%'+_0x2a68d9[_0x255e('0x34')][_0x255e('0x46')]+'%'};return _0x45576d;})});}_0x3721d8=_['merge']({},_0x3721d8,_0x2a68d9[_0x255e('0x48')]);var _0x57acbe={'where':_0x3721d8[_0x255e('0x45')]};return db['OpenchannelMessage'][_0x255e('0x28')](_0x57acbe)[_0x255e('0x1a')](function(_0x34caf4){_0x2d9f56[_0x255e('0x28')]=_0x34caf4;if(_0x2a68d9[_0x255e('0x34')]['includeAll']){_0x3721d8['include']=[{'all':!![]}];}return db[_0x255e('0x32')][_0x255e('0x49')](_0x3721d8);})[_0x255e('0x1a')](function(_0x3b8d29){_0x2d9f56[_0x255e('0x4a')]=_0x3b8d29;return _0x2d9f56;})[_0x255e('0x1a')](respondWithFilteredResult(_0x5168dc,_0x3721d8))['catch'](handleError(_0x5168dc,null));};exports['show']=function(_0xdd1dea,_0x11b0e3){var _0x333437={'raw':!![],'where':{'id':_0xdd1dea[_0x255e('0x4b')]['id']}},_0x3b3a20={};_0x3b3a20[_0x255e('0x38')]=_[_0x255e('0x36')](db[_0x255e('0x32')][_0x255e('0x33')]);_0x3b3a20['query']=_['keys'](_0xdd1dea['query']);_0x3b3a20[_0x255e('0x3f')]=_['intersection'](_0x3b3a20[_0x255e('0x38')],_0x3b3a20['query']);_0x333437['attributes']=_[_0x255e('0x37')](_0x3b3a20[_0x255e('0x38')],qs[_0x255e('0x3a')](_0xdd1dea[_0x255e('0x34')][_0x255e('0x3a')]));_0x333437[_0x255e('0x39')]=_0x333437[_0x255e('0x39')][_0x255e('0x3b')]?_0x333437['attributes']:_0x3b3a20[_0x255e('0x38')];if(_0xdd1dea['query'][_0x255e('0x4c')]){_0x333437[_0x255e('0x4d')]=[{'all':!![]}];}_0x333437=_['merge']({},_0x333437,_0xdd1dea[_0x255e('0x48')]);return db[_0x255e('0x32')][_0x255e('0x4e')](_0x333437)[_0x255e('0x1a')](handleEntityNotFound(_0x11b0e3,null))[_0x255e('0x1a')](respondWithResult(_0x11b0e3,null))[_0x255e('0x23')](handleError(_0x11b0e3,null));};exports[_0x255e('0x4f')]=function(_0x1047a0,_0x5d8cc3){return db[_0x255e('0x32')]['create'](_0x1047a0[_0x255e('0x50')],{})['then'](respondWithResult(_0x5d8cc3,0xc9))[_0x255e('0x23')](handleError(_0x5d8cc3,null));};exports['update']=function(_0x960cc5,_0x5e1475){if(_0x960cc5[_0x255e('0x50')]['id']){delete _0x960cc5[_0x255e('0x50')]['id'];}return db[_0x255e('0x32')][_0x255e('0x4e')]({'where':{'id':_0x960cc5[_0x255e('0x4b')]['id']}})[_0x255e('0x1a')](handleEntityNotFound(_0x5e1475,null))['then'](saveUpdates(_0x960cc5[_0x255e('0x50')],null))[_0x255e('0x1a')](respondWithResult(_0x5e1475,null))[_0x255e('0x23')](handleError(_0x5e1475,null));};exports['destroy']=function(_0x251a54,_0x1601c0){return db[_0x255e('0x32')][_0x255e('0x4e')]({'where':{'id':_0x251a54[_0x255e('0x4b')]['id']}})[_0x255e('0x1a')](handleEntityNotFound(_0x1601c0,null))[_0x255e('0x1a')](removeEntity(_0x1601c0,null))['catch'](handleError(_0x1601c0,null));};exports[_0x255e('0x51')]=function(_0x1641fc,_0x5e1828){return db[_0x255e('0x32')][_0x255e('0x51')]()[_0x255e('0x1a')](respondWithResult(_0x5e1828,null))['catch'](handleError(_0x5e1828,null));};var interaction_log=require(_0x255e('0x10'))('openchannel-interactions');exports[_0x255e('0x52')]=function(_0x1d8384,_0x2258d9,_0x56a5f0){var _0x340117={'channel':_0x255e('0x53')};if(_0x1d8384['body']['id']){delete _0x1d8384['body']['id'];}_0x1d8384[_0x255e('0x50')][_0x255e('0x54')]=!![];_0x1d8384[_0x255e('0x50')][_0x255e('0x55')]=moment()[_0x255e('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x1d8384[_0x255e('0x50')][_0x255e('0x57')]=_0x1d8384[_0x255e('0x50')][_0x255e('0x57')]||_0x1d8384['user']['id'];return db['OpenchannelMessage'][_0x255e('0x4e')]({'where':{'id':_0x1d8384[_0x255e('0x4b')]['id'],'UserId':null},'include':[{'model':db[_0x255e('0x58')],'as':_0x255e('0x59')}]})[_0x255e('0x1a')](handleEntityNotFound(_0x2258d9,null))[_0x255e('0x1a')](saveUpdates(_0x1d8384['body'],null))[_0x255e('0x1a')](function(_0x3c3b4f){if(_0x3c3b4f){_0x340117['message']=_0x3c3b4f['get']({'plain':!![]});return db[_0x255e('0x5a')][_0x255e('0x4e')]({'where':{'id':_0x3c3b4f[_0x255e('0x5b')]}});}return null;})['then'](handleEntityNotFound(_0x2258d9,null))[_0x255e('0x1a')](function(_0x1b995b){if(_0x1b995b){return _0x1b995b[_0x255e('0x5c')]({'UserId':_0x1d8384[_0x255e('0x50')][_0x255e('0x57')],'read1stAt':_[_0x255e('0x5d')](_0x1b995b[_0x255e('0x5e')])?moment()[_0x255e('0x56')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x255e('0x1a')](function(_0x2e6dd6){if(_0x2e6dd6){_0x340117[_0x255e('0x5f')]=_0x2e6dd6['get']({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1d8384['user']['id'],_0x1d8384[_0x255e('0x60')][_0x255e('0x2f')],_0x1d8384[_0x255e('0x60')]['role'],_0x340117[_0x255e('0x5f')]['id'],_0x1d8384[_0x255e('0x50')]?JSON['stringify'](_0x1d8384['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x255e('0x61'),_0x340117);}return null;})[_0x255e('0x1a')](function(_0x9cc85b){if(_0x9cc85b){if(_0x1d8384['body']['manual']){_0x340117[_0x255e('0x21')]['interface']=util[_0x255e('0x56')](_0x255e('0x62'),_0x1d8384['user'][_0x255e('0x2f')]);_0x340117['message'][_0x255e('0x63')]=_0x340117[_0x255e('0x63')];_0x340117['message'][_0x255e('0x64')]='accept';return respondWithRpcPromise(_0x255e('0x65'),_0x255e('0x65'),{'event':_0x255e('0x66'),'message':_0x340117[_0x255e('0x21')]},client9002)[_0x255e('0x1a')](function(){return _0x340117;});}return _0x340117;}return null;})[_0x255e('0x1a')](respondWithResult(_0x2258d9,null))[_0x255e('0x23')](handleError(_0x2258d9,null));};var interaction_log=require(_0x255e('0x10'))(_0x255e('0x67'));exports['reject']=function(_0x3499de,_0x4cb395,_0x381c24){var _0x2e6d37={'agent':{},'channel':_0x255e('0x53')};if(_0x3499de['body']['id']){delete _0x3499de[_0x255e('0x50')]['id'];}_0x3499de[_0x255e('0x50')][_0x255e('0x57')]=_0x3499de[_0x255e('0x50')][_0x255e('0x57')]||_0x3499de[_0x255e('0x60')]['id'];_0x2e6d37[_0x255e('0x68')]['id']=_0x3499de[_0x255e('0x50')][_0x255e('0x57')];return db[_0x255e('0x32')]['find']({'where':{'id':_0x3499de[_0x255e('0x4b')]['id'],'UserId':null}})[_0x255e('0x1a')](handleEntityNotFound(_0x4cb395,null))[_0x255e('0x1a')](function(_0x26583e){if(_0x26583e){_0x2e6d37[_0x255e('0x21')]=_0x26583e[_0x255e('0x69')]({'plain':!![]});return db[_0x255e('0x5a')][_0x255e('0x4e')]({'where':{'id':_0x26583e[_0x255e('0x5b')]}});}return null;})['then'](handleEntityNotFound(_0x4cb395,null))[_0x255e('0x1a')](function(_0x28a9a8){if(_0x28a9a8){_0x2e6d37['interaction']=_0x28a9a8[_0x255e('0x69')]({'plain':!![]});interaction_log[_0x255e('0x1b')](_0x255e('0x6a'),_0x3499de[_0x255e('0x60')]['id'],_0x3499de[_0x255e('0x60')][_0x255e('0x2f')],_0x3499de[_0x255e('0x60')][_0x255e('0x6b')],_0x2e6d37[_0x255e('0x5f')]['id'],_0x3499de[_0x255e('0x50')]?JSON[_0x255e('0x6c')](_0x3499de[_0x255e('0x50')]):_0x255e('0x6d'));return respondWithRpcPromise(_0x255e('0x6e'),_0x255e('0x6f'),_0x2e6d37);}return null;})['then'](function(_0x15657f){if(_0x15657f){_0x15657f[_0x255e('0x21')][_0x255e('0x70')]=util[_0x255e('0x56')]('SIP/%s',_0x3499de[_0x255e('0x60')][_0x255e('0x2f')]);_0x15657f[_0x255e('0x21')][_0x255e('0x63')]=_0x2e6d37[_0x255e('0x63')];_0x15657f[_0x255e('0x21')][_0x255e('0x64')]=_0x255e('0x2b');respondWithRpcPromise('EventManager',_0x255e('0x65'),{'event':_0x255e('0x71'),'message':_0x15657f[_0x255e('0x21')]},client9002);return _0x2e6d37;}return null;})[_0x255e('0x1a')](respondWithResult(_0x4cb395,null))['catch'](handleError(_0x4cb395,null));};
\ No newline at end of file
+var _0x2383=['Content-Range','apply','reject','update','then','destroy','end','stack','name','send','rawAttributes','model','keys','query','dateStart','dateEnd','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','add','day','merge','filter','map','options','includeAll','OpenchannelMessage','findAll','rows','show','params','include','find','body','describe','accept','openchannel','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','OpenchannelInteractionId','read1stAt','format','interaction','acceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','openchannel-interactions','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectmessage','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','socket.io-emitter','register','http','request','info','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','offset','limit','set'];(function(_0x5daad9,_0x5391bb){var _0x5ca00d=function(_0x50ae75){while(--_0x50ae75){_0x5daad9['push'](_0x5daad9['shift']());}};_0x5ca00d(++_0x5391bb);}(_0x2383,0xb2));var _0x3238=function(_0x2353ff,_0x162a11){_0x2353ff=_0x2353ff-0x0;var _0x28a02e=_0x2383[_0x2353ff];return _0x28a02e;};'use strict';var pdf=require(_0x3238('0x0'));var emlformat=require(_0x3238('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3238('0x2'));var jsonpatch=require(_0x3238('0x3'));var rp=require(_0x3238('0x4'));var moment=require(_0x3238('0x5'));var BPromise=require(_0x3238('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3238('0x7'));var csv=require(_0x3238('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3238('0x9'));var squel=require(_0x3238('0xa'));var crypto=require(_0x3238('0xb'));var jsforce=require(_0x3238('0xc'));var deskjs=require(_0x3238('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3238('0xe'));var Papa=require(_0x3238('0xf'));var qs=require(_0x3238('0x10'));var logger=require(_0x3238('0x11'))(_0x3238('0x12'));var utils=require(_0x3238('0x13'));var config=require('../../config/environment');var db=require(_0x3238('0x14'))['db'];var socket=require(_0x3238('0x15'))({'host':'localhost','port':0x18eb});require('./openchannelMessage.socket')[_0x3238('0x16')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x3238('0x17')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2a6c99,_0x2d84cd,_0x15d1ef,_0x5d9975){return new BPromise(function(_0x4facd1,_0x54be93){var _0xbb629a=_0x5d9975||client;return _0xbb629a[_0x3238('0x18')](_0x2a6c99,_0x15d1ef)['then'](function(_0x2d7739){logger[_0x3238('0x19')]('OpenchannelMessage,\x20%s,\x20%s',_0x2d84cd,'request\x20sent');logger[_0x3238('0x1a')](_0x3238('0x1b'),_0x2d84cd,_0x3238('0x1c'),JSON[_0x3238('0x1d')](_0x2d7739));if(_0x2d7739[_0x3238('0x1e')]){if(_0x2d7739[_0x3238('0x1e')]['code']===0x1f4){logger[_0x3238('0x1e')](_0x3238('0x1f'),_0x2d84cd,_0x2d7739[_0x3238('0x1e')][_0x3238('0x20')]);return _0x54be93(_0x2d7739['error'][_0x3238('0x20')]);}logger[_0x3238('0x1e')](_0x3238('0x1f'),_0x2d84cd,_0x2d7739['error'][_0x3238('0x20')]);return _0x4facd1(_0x2d7739[_0x3238('0x1e')][_0x3238('0x20')]);}else{logger[_0x3238('0x19')]('OpenchannelMessage,\x20%s,\x20%s',_0x2d84cd,'request\x20sent');_0x4facd1(_0x2d7739[_0x3238('0x21')][_0x3238('0x20')]);}})[_0x3238('0x22')](function(_0x3cd5c){logger[_0x3238('0x1e')](_0x3238('0x1f'),_0x2d84cd,_0x3cd5c);_0x54be93(_0x3cd5c);});});}function respondWithStatusCode(_0x1785f9,_0x16aa44){_0x16aa44=_0x16aa44||0xcc;return function(_0x5386be){if(_0x5386be){return _0x1785f9[_0x3238('0x23')](_0x16aa44);}return _0x1785f9[_0x3238('0x24')](_0x16aa44)['end']();};}function respondWithResult(_0x2e7dfc,_0x499f6e){_0x499f6e=_0x499f6e||0xc8;return function(_0x43d8f6){if(_0x43d8f6){return _0x2e7dfc[_0x3238('0x24')](_0x499f6e)[_0x3238('0x25')](_0x43d8f6);}};}function respondWithFilteredResult(_0x425058,_0x49a6db){return function(_0x3a8b1e){if(_0x3a8b1e){var _0x17ec9f=_0x3a8b1e[_0x3238('0x26')],_0x4f8b4c=_0x49a6db['offset'],_0x328a5b=_0x49a6db[_0x3238('0x27')]+_0x49a6db[_0x3238('0x28')],_0x3a20c1;if(_0x328a5b>=_0x17ec9f){_0x328a5b=_0x17ec9f;_0x3a20c1=0xc8;}else{_0x3a20c1=0xce;}_0x425058[_0x3238('0x24')](_0x3a20c1);return _0x425058[_0x3238('0x29')](_0x3238('0x2a'),_0x4f8b4c+'-'+_0x328a5b+'/'+_0x17ec9f)[_0x3238('0x25')](_0x3a8b1e);}return null;};}function patchUpdates(_0x33a674){return function(_0xf770a9){try{jsonpatch[_0x3238('0x2b')](_0xf770a9,_0x33a674,!![]);}catch(_0xb41fe1){return BPromise[_0x3238('0x2c')](_0xb41fe1);}return _0xf770a9['save']();};}function saveUpdates(_0x1f3f05,_0x4c0072){return function(_0x37a7a7){if(_0x37a7a7){return _0x37a7a7[_0x3238('0x2d')](_0x1f3f05)[_0x3238('0x2e')](function(_0x3484f9){return _0x3484f9;});}return null;};}function removeEntity(_0x500e87,_0x4fb9d4){return function(_0x103fff){if(_0x103fff){return _0x103fff[_0x3238('0x2f')]()[_0x3238('0x2e')](function(){_0x500e87['status'](0xcc)[_0x3238('0x30')]();});}};}function handleEntityNotFound(_0x210a7b,_0x1ee253){return function(_0x3bc6d3){if(!_0x3bc6d3){_0x210a7b[_0x3238('0x23')](0x194);}return _0x3bc6d3;};}function handleError(_0x1375b0,_0x189ef5){_0x189ef5=_0x189ef5||0x1f4;return function(_0x14650c){logger[_0x3238('0x1e')](_0x14650c[_0x3238('0x31')]);if(_0x14650c[_0x3238('0x32')]){delete _0x14650c[_0x3238('0x32')];}_0x1375b0['status'](_0x189ef5)[_0x3238('0x33')](_0x14650c);};}exports['index']=function(_0x153168,_0x345e53){var _0x23ff06={},_0x51ce66={},_0x2b53a4={'count':0x0,'rows':[]};var _0x858049=db['OpenchannelMessage'][_0x3238('0x34')];_0x51ce66[_0x3238('0x35')]=_[_0x3238('0x36')](_0x858049);var _0x48b88f={'dateStart':_0x153168[_0x3238('0x37')][_0x3238('0x38')],'dateEnd':_0x153168['query'][_0x3238('0x39')]};delete _0x153168[_0x3238('0x37')]['dateStart'];delete _0x153168[_0x3238('0x37')][_0x3238('0x39')];_0x51ce66[_0x3238('0x37')]=_[_0x3238('0x36')](_0x153168[_0x3238('0x37')]);_0x51ce66['filters']=_['intersection'](_0x51ce66[_0x3238('0x35')],_0x51ce66[_0x3238('0x37')]);_0x23ff06[_0x3238('0x3a')]=_[_0x3238('0x3b')](_0x51ce66['model'],qs['fields'](_0x153168[_0x3238('0x37')][_0x3238('0x3c')]));_0x23ff06[_0x3238('0x3a')]=_0x23ff06[_0x3238('0x3a')][_0x3238('0x3d')]?_0x23ff06['attributes']:_0x51ce66['model'];if(!_0x153168[_0x3238('0x37')][_0x3238('0x3e')](_0x3238('0x3f'))){_0x23ff06['limit']=qs[_0x3238('0x28')](_0x153168['query'][_0x3238('0x28')]);_0x23ff06[_0x3238('0x27')]=qs['offset'](_0x153168['query'][_0x3238('0x27')]);}_0x23ff06[_0x3238('0x40')]=qs[_0x3238('0x41')](_0x153168[_0x3238('0x37')][_0x3238('0x41')]);_0x23ff06[_0x3238('0x42')]=qs[_0x3238('0x43')](_[_0x3238('0x44')](_0x153168[_0x3238('0x37')],_0x51ce66['filters']));if(_0x48b88f[_0x3238('0x38')]){if(_0x48b88f[_0x3238('0x39')]){_0x48b88f[_0x3238('0x39')]=moment(_0x48b88f[_0x3238('0x39')])[_0x3238('0x45')](0x1,'day');}else{_0x48b88f['dateEnd']=moment(_0x48b88f[_0x3238('0x38')])['add'](0x1,_0x3238('0x46'));}_[_0x3238('0x47')](_0x23ff06[_0x3238('0x42')],{'createdAt':{'$gte':_0x48b88f['dateStart'],'$lte':_0x48b88f[_0x3238('0x39')]}});}if(_0x153168[_0x3238('0x37')][_0x3238('0x48')]){_0x23ff06[_0x3238('0x42')]=_[_0x3238('0x47')](_0x23ff06[_0x3238('0x42')],{'$or':_[_0x3238('0x49')](_0x23ff06[_0x3238('0x3a')],function(_0x274107){var _0x594fad={};_0x594fad[_0x274107]={'$like':'%'+_0x153168[_0x3238('0x37')][_0x3238('0x48')]+'%'};return _0x594fad;})});}_0x23ff06=_[_0x3238('0x47')]({},_0x23ff06,_0x153168[_0x3238('0x4a')]);var _0x3e6ed2={'where':_0x23ff06[_0x3238('0x42')]};return db['OpenchannelMessage']['count'](_0x3e6ed2)['then'](function(_0x3f1061){_0x2b53a4[_0x3238('0x26')]=_0x3f1061;if(_0x153168['query'][_0x3238('0x4b')]){_0x23ff06['include']=[{'all':!![]}];}return db[_0x3238('0x4c')][_0x3238('0x4d')](_0x23ff06);})['then'](function(_0xd505f7){_0x2b53a4[_0x3238('0x4e')]=_0xd505f7;return _0x2b53a4;})['then'](respondWithFilteredResult(_0x345e53,_0x23ff06))['catch'](handleError(_0x345e53,null));};exports[_0x3238('0x4f')]=function(_0x1bd446,_0x1a9957){var _0x2b723d={'raw':!![],'where':{'id':_0x1bd446[_0x3238('0x50')]['id']}},_0x4e6388={};_0x4e6388[_0x3238('0x35')]=_['keys'](db[_0x3238('0x4c')][_0x3238('0x34')]);_0x4e6388['query']=_['keys'](_0x1bd446['query']);_0x4e6388[_0x3238('0x43')]=_[_0x3238('0x3b')](_0x4e6388[_0x3238('0x35')],_0x4e6388[_0x3238('0x37')]);_0x2b723d[_0x3238('0x3a')]=_[_0x3238('0x3b')](_0x4e6388[_0x3238('0x35')],qs[_0x3238('0x3c')](_0x1bd446[_0x3238('0x37')][_0x3238('0x3c')]));_0x2b723d[_0x3238('0x3a')]=_0x2b723d['attributes'][_0x3238('0x3d')]?_0x2b723d[_0x3238('0x3a')]:_0x4e6388['model'];if(_0x1bd446['query']['includeAll']){_0x2b723d[_0x3238('0x51')]=[{'all':!![]}];}_0x2b723d=_[_0x3238('0x47')]({},_0x2b723d,_0x1bd446[_0x3238('0x4a')]);return db[_0x3238('0x4c')][_0x3238('0x52')](_0x2b723d)[_0x3238('0x2e')](handleEntityNotFound(_0x1a9957,null))[_0x3238('0x2e')](respondWithResult(_0x1a9957,null))[_0x3238('0x22')](handleError(_0x1a9957,null));};exports['create']=function(_0x4e3c0d,_0x36c98c){return db['OpenchannelMessage']['create'](_0x4e3c0d[_0x3238('0x53')],{})[_0x3238('0x2e')](respondWithResult(_0x36c98c,0xc9))['catch'](handleError(_0x36c98c,null));};exports[_0x3238('0x2d')]=function(_0x1daa29,_0x1f894e){if(_0x1daa29[_0x3238('0x53')]['id']){delete _0x1daa29[_0x3238('0x53')]['id'];}return db[_0x3238('0x4c')]['find']({'where':{'id':_0x1daa29[_0x3238('0x50')]['id']}})[_0x3238('0x2e')](handleEntityNotFound(_0x1f894e,null))[_0x3238('0x2e')](saveUpdates(_0x1daa29['body'],null))['then'](respondWithResult(_0x1f894e,null))[_0x3238('0x22')](handleError(_0x1f894e,null));};exports[_0x3238('0x2f')]=function(_0xc8b146,_0x34e666){return db[_0x3238('0x4c')][_0x3238('0x52')]({'where':{'id':_0xc8b146['params']['id']}})[_0x3238('0x2e')](handleEntityNotFound(_0x34e666,null))[_0x3238('0x2e')](removeEntity(_0x34e666,null))[_0x3238('0x22')](handleError(_0x34e666,null));};exports[_0x3238('0x54')]=function(_0x39bea1,_0x504704){return db[_0x3238('0x4c')]['describe']()[_0x3238('0x2e')](respondWithResult(_0x504704,null))[_0x3238('0x22')](handleError(_0x504704,null));};var interaction_log=require(_0x3238('0x11'))('openchannel-interactions');exports[_0x3238('0x55')]=function(_0x4892a5,_0x33d802,_0x334932){var _0x54b4cf={'channel':_0x3238('0x56')};if(_0x4892a5[_0x3238('0x53')]['id']){delete _0x4892a5['body']['id'];}_0x4892a5[_0x3238('0x53')]['read']=!![];_0x4892a5[_0x3238('0x53')]['readAt']=moment()['format'](_0x3238('0x57'));_0x4892a5[_0x3238('0x53')][_0x3238('0x58')]=_0x4892a5[_0x3238('0x53')][_0x3238('0x58')]||_0x4892a5[_0x3238('0x59')]['id'];return db[_0x3238('0x4c')]['find']({'where':{'id':_0x4892a5['params']['id'],'UserId':null},'include':[{'model':db[_0x3238('0x5a')],'as':'Contact'}]})[_0x3238('0x2e')](handleEntityNotFound(_0x33d802,null))[_0x3238('0x2e')](saveUpdates(_0x4892a5['body'],null))[_0x3238('0x2e')](function(_0x123205){if(_0x123205){_0x54b4cf[_0x3238('0x20')]=_0x123205[_0x3238('0x5b')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x123205[_0x3238('0x5c')]}});}return null;})[_0x3238('0x2e')](handleEntityNotFound(_0x33d802,null))[_0x3238('0x2e')](function(_0x1d719f){if(_0x1d719f){return _0x1d719f[_0x3238('0x2d')]({'UserId':_0x4892a5[_0x3238('0x53')][_0x3238('0x58')],'read1stAt':_['isNil'](_0x1d719f[_0x3238('0x5d')])?moment()[_0x3238('0x5e')](_0x3238('0x57')):undefined});}return null;})[_0x3238('0x2e')](function(_0x1861c2){if(_0x1861c2){_0x54b4cf[_0x3238('0x5f')]=_0x1861c2[_0x3238('0x5b')]({'plain':!![]});interaction_log[_0x3238('0x19')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4892a5['user']['id'],_0x4892a5[_0x3238('0x59')][_0x3238('0x32')],_0x4892a5[_0x3238('0x59')]['role'],_0x54b4cf[_0x3238('0x5f')]['id'],_0x4892a5[_0x3238('0x53')]?JSON['stringify'](_0x4892a5[_0x3238('0x53')]):'null');return respondWithRpcPromise('AcceptMessage',_0x3238('0x60'),_0x54b4cf);}return null;})[_0x3238('0x2e')](function(_0x166b2e){if(_0x166b2e){if(_0x4892a5[_0x3238('0x53')]['manual']){_0x54b4cf['message'][_0x3238('0x61')]=util[_0x3238('0x5e')](_0x3238('0x62'),_0x4892a5[_0x3238('0x59')][_0x3238('0x32')]);_0x54b4cf[_0x3238('0x20')][_0x3238('0x63')]=_0x54b4cf['channel'];_0x54b4cf[_0x3238('0x20')][_0x3238('0x64')]=_0x3238('0x55');return respondWithRpcPromise(_0x3238('0x65'),'EventManager',{'event':_0x3238('0x66'),'message':_0x54b4cf['message']},client9002)[_0x3238('0x2e')](function(){return _0x54b4cf;});}return _0x54b4cf;}return null;})['then'](respondWithResult(_0x33d802,null))[_0x3238('0x22')](handleError(_0x33d802,null));};var interaction_log=require(_0x3238('0x11'))(_0x3238('0x67'));exports[_0x3238('0x2c')]=function(_0x4114e7,_0x54abc2,_0x546548){var _0x199e0b={'agent':{},'channel':_0x3238('0x56')};if(_0x4114e7['body']['id']){delete _0x4114e7['body']['id'];}_0x4114e7[_0x3238('0x53')][_0x3238('0x58')]=_0x4114e7[_0x3238('0x53')][_0x3238('0x58')]||_0x4114e7[_0x3238('0x59')]['id'];_0x199e0b['agent']['id']=_0x4114e7[_0x3238('0x53')][_0x3238('0x58')];return db[_0x3238('0x4c')][_0x3238('0x52')]({'where':{'id':_0x4114e7[_0x3238('0x50')]['id'],'UserId':null}})[_0x3238('0x2e')](handleEntityNotFound(_0x54abc2,null))[_0x3238('0x2e')](function(_0x4cf0e0){if(_0x4cf0e0){_0x199e0b[_0x3238('0x20')]=_0x4cf0e0['get']({'plain':!![]});return db[_0x3238('0x68')][_0x3238('0x52')]({'where':{'id':_0x4cf0e0['OpenchannelInteractionId']}});}return null;})[_0x3238('0x2e')](handleEntityNotFound(_0x54abc2,null))[_0x3238('0x2e')](function(_0x44ee36){if(_0x44ee36){_0x199e0b[_0x3238('0x5f')]=_0x44ee36[_0x3238('0x5b')]({'plain':!![]});interaction_log['info'](_0x3238('0x69'),_0x4114e7[_0x3238('0x59')]['id'],_0x4114e7[_0x3238('0x59')][_0x3238('0x32')],_0x4114e7[_0x3238('0x59')][_0x3238('0x6a')],_0x199e0b['interaction']['id'],_0x4114e7[_0x3238('0x53')]?JSON[_0x3238('0x1d')](_0x4114e7['body']):_0x3238('0x6b'));return respondWithRpcPromise(_0x3238('0x6c'),'rejectMessage',_0x199e0b);}return null;})['then'](function(_0x185272){if(_0x185272){_0x185272[_0x3238('0x20')][_0x3238('0x61')]=util[_0x3238('0x5e')](_0x3238('0x62'),_0x4114e7[_0x3238('0x59')]['name']);_0x185272[_0x3238('0x20')][_0x3238('0x63')]=_0x199e0b['channel'];_0x185272[_0x3238('0x20')][_0x3238('0x64')]=_0x3238('0x2c');respondWithRpcPromise('EventManager','EventManager',{'event':_0x3238('0x6d'),'message':_0x185272[_0x3238('0x20')]},client9002);return _0x199e0b;}return null;})[_0x3238('0x2e')](respondWithResult(_0x54abc2,null))[_0x3238('0x22')](handleError(_0x54abc2,null));};
\ No newline at end of file
index 3155485..1f50d3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x644a=['exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove','emit','hook'];(function(_0xbb0041,_0x3b4589){var _0x5b40d8=function(_0xd241a9){while(--_0xd241a9){_0xbb0041['push'](_0xbb0041['shift']());}};_0x5b40d8(++_0x3b4589);}(_0x644a,0xfd));var _0xa644=function(_0x295e3e,_0x30b417){_0x295e3e=_0x295e3e-0x0;var _0x4c8a9c=_0x644a[_0x295e3e];return _0x4c8a9c;};'use strict';var EventEmitter=require(_0xa644('0x0'));var OpenchannelMessage=require(_0xa644('0x1'))['db'][_0xa644('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xa644('0x3')](0x0);var events={'afterCreate':_0xa644('0x4'),'afterUpdate':'update','afterDestroy':_0xa644('0x5')};function emitEvent(_0x704008){return function(_0x526de6,_0x4f6ed9,_0x1ae8c0){OpenchannelMessageEvents[_0xa644('0x6')](_0x704008+':'+_0x526de6['id'],_0x526de6);OpenchannelMessageEvents[_0xa644('0x6')](_0x704008,_0x526de6);_0x1ae8c0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xa644('0x7')](e,emitEvent(event));}}module[_0xa644('0x8')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0x96ee=['../../mysqldb','OpenchannelMessage','emit','hasOwnProperty','hook','exports'];(function(_0x3f6010,_0x5d4d1d){var _0x57bc5d=function(_0x31d756){while(--_0x31d756){_0x3f6010['push'](_0x3f6010['shift']());}};_0x57bc5d(++_0x5d4d1d);}(_0x96ee,0x72));var _0xe96e=function(_0x2170e4,_0x5b969e){_0x2170e4=_0x2170e4-0x0;var _0xec86f5=_0x96ee[_0x2170e4];return _0xec86f5;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xe96e('0x0'))['db'][_0xe96e('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2eed08){return function(_0x52c1d7,_0x47b130,_0x26bad9){OpenchannelMessageEvents[_0xe96e('0x2')](_0x2eed08+':'+_0x52c1d7['id'],_0x52c1d7);OpenchannelMessageEvents['emit'](_0x2eed08,_0x52c1d7);_0x26bad9(null);};}for(var e in events){if(events[_0xe96e('0x3')](e)){var event=events[e];OpenchannelMessage[_0xe96e('0x4')](e,emitEvent(event));}}module[_0xe96e('0x5')]=OpenchannelMessageEvents;
\ No newline at end of file
index 0006ca2..92bb638 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3b0=['OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','./openchannelMessage.attributes','define','openchannel_messages','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','then','update','body','catch','error','CmContact','describe','OpenchannelAccount','Interactions','OpenchannelInteractionId','Contact','keys','replyUri','info','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','GET'];(function(_0x20cc29,_0x30a46d){var _0x28d513=function(_0x179b06){while(--_0x179b06){_0x20cc29['push'](_0x20cc29['shift']());}};_0x28d513(++_0x30a46d);}(_0xc3b0,0x166));var _0x0c3b=function(_0xf0844d,_0x187ece){_0xf0844d=_0xf0844d-0x0;var _0x196612=_0xc3b0[_0xf0844d];return _0x196612;};'use strict';var _=require(_0x0c3b('0x0'));var util=require(_0x0c3b('0x1'));var logger=require(_0x0c3b('0x2'))(_0x0c3b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0c3b('0x4'));var attributes=require(_0x0c3b('0x5'));module['exports']=function(_0x2b13c6,_0x10f089){return _0x2b13c6[_0x0c3b('0x6')]('OpenchannelMessage',attributes,{'tableName':_0x0c3b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e2305,_0x8e628a,_0x4e7c4f){var _0x5c4e3a=_0x2b13c6['models'];var _0x12a1e0=_0x3e2305[_0x0c3b('0x8')]({'plain':!![]});if(_0x12a1e0[_0x0c3b('0x9')][_0x0c3b('0xa')]()==='in'||_0x12a1e0[_0x0c3b('0x9')][_0x0c3b('0xa')]()===_0x0c3b('0xb')&&!_0x12a1e0[_0x0c3b('0xc')]&&!_[_0x0c3b('0xd')](_0x12a1e0[_0x0c3b('0xe')])){_0x5c4e3a[_0x0c3b('0xf')][_0x0c3b('0x10')]({'where':{'id':_0x12a1e0['OpenchannelInteractionId']}})[_0x0c3b('0x11')](function(_0x5ba38d){if(_0x5ba38d){_0x5ba38d[_0x0c3b('0x12')]({'lastMsgAt':_0x12a1e0['createdAt'],'lastMsgDirection':_0x12a1e0[_0x0c3b('0x9')][_0x0c3b('0xa')](),'lastMsgBody':_0x12a1e0[_0x0c3b('0x13')]});}})[_0x0c3b('0x14')](function(_0x8bf2fd){console[_0x0c3b('0x15')](_0x8bf2fd);});}if(_0x12a1e0['direction']===_0x0c3b('0xb')&&!_0x12a1e0['secret']){var _0x57d16c;_0x5c4e3a[_0x0c3b('0x16')][_0x0c3b('0x17')]()[_0x0c3b('0x11')](function(_0x769740){return _0x5c4e3a[_0x0c3b('0x18')]['find']({'where':{'id':_0x12a1e0['OpenchannelAccountId']},'include':[{'model':_0x5c4e3a[_0x0c3b('0xf')],'as':_0x0c3b('0x19'),'where':{'id':_0x12a1e0[_0x0c3b('0x1a')]},'limit':0x1,'include':[{'model':_0x5c4e3a['CmContact'],'as':_0x0c3b('0x1b'),'attributes':_[_0x0c3b('0x1c')](_0x769740)}]}]});})[_0x0c3b('0x11')](function(_0x1e8ae4){_0x57d16c=_0x1e8ae4[_0x0c3b('0x8')]({'plain':!![]});if(_0x57d16c&&_0x57d16c[_0x0c3b('0x1d')]){logger[_0x0c3b('0x1e')]('OpenchannelMessage,\x20%s,\x20%s',_0x0c3b('0x1f'),util['format'](_0x0c3b('0x20'),_0x12a1e0['id'],_0x57d16c[_0x0c3b('0x1d')]));if(_0x57d16c[_0x0c3b('0x19')]&&_0x57d16c[_0x0c3b('0x19')][_0x0c3b('0x21')]){_0x12a1e0[_0x0c3b('0x22')]=_[_0x0c3b('0x23')](_0x57d16c[_0x0c3b('0x19')][0x0],_0x0c3b('0x1b'));_0x12a1e0['Contact']=_0x57d16c[_0x0c3b('0x19')][0x0][_0x0c3b('0x1b')];}var _0x8e628a={'method':_0x0c3b('0x24'),'uri':encodeURI(_0x57d16c[_0x0c3b('0x1d')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x8e628a['method']){case _0x0c3b('0x25'):_0x8e628a['qs']=_0x12a1e0;break;case'POST':_0x8e628a[_0x0c3b('0x13')]=_0x12a1e0;break;}return rp(_0x8e628a)[_0x0c3b('0x11')](function(_0x3ec840){logger['info'](_0x0c3b('0x26'),_0x0c3b('0x1f'),util[_0x0c3b('0x27')](_0x0c3b('0x28'),_0x12a1e0['id'],_0x57d16c[_0x0c3b('0x1d')]));return _0x3e2305[_0x0c3b('0x12')]({'read':!![]});})['catch'](function(_0x4ff915){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x0c3b('0x1f'),util[_0x0c3b('0x29')](_0x4ff915,{'showHidden':![],'depth':null}));_0x4e7c4f();});}else{_0x4e7c4f();}})['finally'](function(){_0x4e7c4f();});}else{_0x4e7c4f();}}},'charset':_0x0c3b('0x2a'),'collate':_0x0c3b('0x2b')});};
\ No newline at end of file
+var _0x7b6b=['openchannel_messages','models','get','direction','toLowerCase','out','secret','isNil','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','body','catch','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','replyUri','GET','Message\x20%d\x20forwarded\x20to\x20%s','error','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','exports','define','OpenchannelMessage'];(function(_0x1018d1,_0x57eb28){var _0x2f985f=function(_0x406b10){while(--_0x406b10){_0x1018d1['push'](_0x1018d1['shift']());}};_0x2f985f(++_0x57eb28);}(_0x7b6b,0xac));var _0xb7b6=function(_0x519e59,_0x2b0c34){_0x519e59=_0x519e59-0x0;var _0x1293e0=_0x7b6b[_0x519e59];return _0x1293e0;};'use strict';var _=require(_0xb7b6('0x0'));var util=require('util');var logger=require(_0xb7b6('0x1'))(_0xb7b6('0x2'));var moment=require(_0xb7b6('0x3'));var BPromise=require('bluebird');var rp=require(_0xb7b6('0x4'));var attributes=require('./openchannelMessage.attributes');module[_0xb7b6('0x5')]=function(_0x7193f5,_0xfd10d6){return _0x7193f5[_0xb7b6('0x6')](_0xb7b6('0x7'),attributes,{'tableName':_0xb7b6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x19e81f,_0x318dfb,_0x36cd51){var _0x31809b=_0x7193f5[_0xb7b6('0x9')];var _0x4074d1=_0x19e81f[_0xb7b6('0xa')]({'plain':!![]});if(_0x4074d1[_0xb7b6('0xb')][_0xb7b6('0xc')]()==='in'||_0x4074d1[_0xb7b6('0xb')][_0xb7b6('0xc')]()===_0xb7b6('0xd')&&!_0x4074d1[_0xb7b6('0xe')]&&!_[_0xb7b6('0xf')](_0x4074d1['UserId'])){_0x31809b[_0xb7b6('0x10')][_0xb7b6('0x11')]({'where':{'id':_0x4074d1[_0xb7b6('0x12')]}})[_0xb7b6('0x13')](function(_0xc2df62){if(_0xc2df62){_0xc2df62[_0xb7b6('0x14')]({'lastMsgAt':_0x4074d1[_0xb7b6('0x15')],'lastMsgDirection':_0x4074d1[_0xb7b6('0xb')][_0xb7b6('0xc')](),'lastMsgBody':_0x4074d1[_0xb7b6('0x16')]});}})[_0xb7b6('0x17')](function(_0x37985a){console['error'](_0x37985a);});}if(_0x4074d1['direction']===_0xb7b6('0xd')&&!_0x4074d1['secret']){var _0x51c79a;_0x31809b[_0xb7b6('0x18')]['describe']()[_0xb7b6('0x13')](function(_0x1c2160){return _0x31809b[_0xb7b6('0x19')][_0xb7b6('0x1a')]({'where':{'id':_0x4074d1[_0xb7b6('0x1b')]},'include':[{'model':_0x31809b[_0xb7b6('0x10')],'as':_0xb7b6('0x1c'),'where':{'id':_0x4074d1[_0xb7b6('0x12')]},'limit':0x1,'include':[{'model':_0x31809b['CmContact'],'as':_0xb7b6('0x1d'),'attributes':_[_0xb7b6('0x1e')](_0x1c2160)}]}]});})['then'](function(_0xddaed6){_0x51c79a=_0xddaed6[_0xb7b6('0xa')]({'plain':!![]});if(_0x51c79a&&_0x51c79a['replyUri']){logger[_0xb7b6('0x1f')](_0xb7b6('0x20'),'afterCreate',util['format'](_0xb7b6('0x21'),_0x4074d1['id'],_0x51c79a['replyUri']));if(_0x51c79a[_0xb7b6('0x1c')]&&_0x51c79a[_0xb7b6('0x1c')][_0xb7b6('0x22')]){_0x4074d1[_0xb7b6('0x23')]=_[_0xb7b6('0x24')](_0x51c79a[_0xb7b6('0x1c')][0x0],_0xb7b6('0x1d'));_0x4074d1[_0xb7b6('0x1d')]=_0x51c79a[_0xb7b6('0x1c')][0x0][_0xb7b6('0x1d')];}var _0x318dfb={'method':_0xb7b6('0x25'),'uri':encodeURI(_0x51c79a[_0xb7b6('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x318dfb['method']){case _0xb7b6('0x27'):_0x318dfb['qs']=_0x4074d1;break;case'POST':_0x318dfb[_0xb7b6('0x16')]=_0x4074d1;break;}return rp(_0x318dfb)['then'](function(_0x5b4801){logger['info'](_0xb7b6('0x20'),'afterCreate',util['format'](_0xb7b6('0x28'),_0x4074d1['id'],_0x51c79a[_0xb7b6('0x26')]));return _0x19e81f[_0xb7b6('0x14')]({'read':!![]});})[_0xb7b6('0x17')](function(_0x329226){logger[_0xb7b6('0x29')](_0xb7b6('0x20'),'afterCreate',util['inspect'](_0x329226,{'showHidden':![],'depth':null}));_0x36cd51();});}else{_0x36cd51();}})[_0xb7b6('0x2a')](function(){_0x36cd51();});}else{_0x36cd51();}}},'charset':_0xb7b6('0x2b'),'collate':_0xb7b6('0x2c')});};
\ No newline at end of file
index 9ab5c42..dd9e183 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter','localhost','register','request','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateOpenchannelMessage','options','debug','catch'];(function(_0x1139ea,_0x1e9cc7){var _0x2b3ab5=function(_0x15151f){while(--_0x15151f){_0x1139ea['push'](_0x1139ea['shift']());}};_0x2b3ab5(++_0x1e9cc7);}(_0x008c,0x188));var _0xc008=function(_0x2f4069,_0x74eb6c){_0x2f4069=_0x2f4069-0x0;var _0x4e5d90=_0x008c[_0x2f4069];return _0x4e5d90;};'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 db=require('../../mysqldb')['db'];var utils=require(_0xc008('0x5'));var logger=require(_0xc008('0x6'))(_0xc008('0x7'));var config=require(_0xc008('0x8'));var jayson=require(_0xc008('0x9'));var client=jayson[_0xc008('0xa')][_0xc008('0xb')]({'port':0x232a});var socket=require(_0xc008('0xc'))({'host':_0xc008('0xd'),'port':0x18eb});require('./openchannelMessage.socket')[_0xc008('0xe')](socket);function respondWithRpcPromise(_0x5aa09b,_0x30be38,_0x5b64f8){return new BPromise(function(_0x52041f,_0x27830d){return client[_0xc008('0xf')](_0x5aa09b,_0x5b64f8)['then'](function(_0x51ba7d){logger['info'](_0xc008('0x10'),_0x30be38,_0xc008('0x11'));logger['debug'](_0xc008('0x12'),_0x30be38,_0xc008('0x11'),JSON[_0xc008('0x13')](_0x51ba7d));if(_0x51ba7d[_0xc008('0x14')]){if(_0x51ba7d[_0xc008('0x14')][_0xc008('0x15')]===0x1f4){logger[_0xc008('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x30be38,_0x51ba7d['error'][_0xc008('0x16')]);return _0x27830d(_0x51ba7d['error'][_0xc008('0x16')]);}logger[_0xc008('0x14')](_0xc008('0x10'),_0x30be38,_0x51ba7d[_0xc008('0x14')][_0xc008('0x16')]);return _0x52041f(_0x51ba7d['error']['message']);}else{logger['info'](_0xc008('0x10'),_0x30be38,_0xc008('0x11'));_0x52041f(_0x51ba7d[_0xc008('0x17')][_0xc008('0x16')]);}})['catch'](function(_0x53b06e){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x30be38,_0x53b06e);_0x27830d(_0x53b06e);});});}exports[_0xc008('0x18')]=function(_0x462af5){var _0x501137=this;return new Promise(function(_0x813397,_0x5906e6){return db['OpenchannelMessage']['create'](_0x462af5['body'],{'raw':_0x462af5[_0xc008('0x19')]?_0x462af5['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4a582d){logger['info'](_0xc008('0x18'),_0x462af5);logger[_0xc008('0x1a')](_0xc008('0x18'),_0x462af5,JSON[_0xc008('0x13')](_0x4a582d));_0x813397(_0x4a582d);})[_0xc008('0x1b')](function(_0x110128){logger['error'](_0xc008('0x18'),_0x110128['message'],_0x462af5);_0x5906e6(_0x501137['error'](0x1f4,_0x110128[_0xc008('0x16')]));});});};
\ No newline at end of file
+var _0x7217=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','socket.io-emitter','localhost','./openchannelMessage.socket','register','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','lodash','moment'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0x7217,0x19e));var _0x7721=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7217[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var db=require(_0x7721('0x4'))['db'];var utils=require(_0x7721('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7721('0x6'));var jayson=require(_0x7721('0x7'));var client=jayson[_0x7721('0x8')][_0x7721('0x9')]({'port':0x232a});var socket=require(_0x7721('0xa'))({'host':_0x7721('0xb'),'port':0x18eb});require(_0x7721('0xc'))[_0x7721('0xd')](socket);function respondWithRpcPromise(_0x225610,_0x2f99ed,_0x3e6368){return new BPromise(function(_0x2a66cb,_0xfa8835){return client[_0x7721('0xe')](_0x225610,_0x3e6368)[_0x7721('0xf')](function(_0x578d59){logger[_0x7721('0x10')](_0x7721('0x11'),_0x2f99ed,_0x7721('0x12'));logger[_0x7721('0x13')](_0x7721('0x14'),_0x2f99ed,_0x7721('0x12'),JSON[_0x7721('0x15')](_0x578d59));if(_0x578d59[_0x7721('0x16')]){if(_0x578d59['error'][_0x7721('0x17')]===0x1f4){logger[_0x7721('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x2f99ed,_0x578d59[_0x7721('0x16')][_0x7721('0x18')]);return _0xfa8835(_0x578d59[_0x7721('0x16')][_0x7721('0x18')]);}logger['error'](_0x7721('0x11'),_0x2f99ed,_0x578d59[_0x7721('0x16')]['message']);return _0x2a66cb(_0x578d59['error']['message']);}else{logger[_0x7721('0x10')](_0x7721('0x11'),_0x2f99ed,_0x7721('0x12'));_0x2a66cb(_0x578d59[_0x7721('0x19')]['message']);}})[_0x7721('0x1a')](function(_0x54a838){logger[_0x7721('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x2f99ed,_0x54a838);_0xfa8835(_0x54a838);});});}exports[_0x7721('0x1b')]=function(_0x4e96fb){var _0x3ab5a5=this;return new Promise(function(_0x3e140d,_0x2286e5){return db[_0x7721('0x1c')][_0x7721('0x1d')](_0x4e96fb[_0x7721('0x1e')],{'raw':_0x4e96fb[_0x7721('0x1f')]?_0x4e96fb[_0x7721('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x7721('0xf')](function(_0x2c1583){logger[_0x7721('0x10')](_0x7721('0x1b'),_0x4e96fb);logger['debug'](_0x7721('0x1b'),_0x4e96fb,JSON['stringify'](_0x2c1583));_0x3e140d(_0x2c1583);})[_0x7721('0x1a')](function(_0x288e3a){logger[_0x7721('0x16')](_0x7721('0x1b'),_0x288e3a[_0x7721('0x18')],_0x4e96fb);_0x2286e5(_0x3ab5a5[_0x7721('0x16')](0x1f4,_0x288e3a[_0x7721('0x18')]));});});};
\ No newline at end of file
index a7d0092..5bf2286 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae24=['length','openchannelMessage:','./openchannelMessage.events','remove','removeListener','register'];(function(_0x5783ce,_0x3d330c){var _0x4b5d89=function(_0x49eb68){while(--_0x49eb68){_0x5783ce['push'](_0x5783ce['shift']());}};_0x4b5d89(++_0x3d330c);}(_0xae24,0x182));var _0x4ae2=function(_0x18e089,_0x5c3c47){_0x18e089=_0x18e089-0x0;var _0x5a7872=_0xae24[_0x18e089];return _0x5a7872;};'use strict';var OpenchannelMessageEvents=require(_0x4ae2('0x0'));var events=['save',_0x4ae2('0x1'),'update'];function createListener(_0xf4c45d,_0x1bf293){return function(_0x564d54){_0x1bf293['emit'](_0xf4c45d,_0x564d54);};}function removeListener(_0x1afc7a,_0x5b25b5){return function(){OpenchannelMessageEvents[_0x4ae2('0x2')](_0x1afc7a,_0x5b25b5);};}exports[_0x4ae2('0x3')]=function(_0x20c85c){for(var _0x3e6055=0x0,_0x428054=events[_0x4ae2('0x4')];_0x3e6055<_0x428054;_0x3e6055++){var _0x4f2e84=events[_0x3e6055];var _0x5f589a=createListener(_0x4ae2('0x5')+_0x4f2e84,_0x20c85c);OpenchannelMessageEvents['on'](_0x4f2e84,_0x5f589a);}};
\ No newline at end of file
+var _0x25fa=['remove','update','emit','removeListener','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x5b8342,_0x1816b3){var _0x58d071=function(_0x52e808){while(--_0x52e808){_0x5b8342['push'](_0x5b8342['shift']());}};_0x58d071(++_0x1816b3);}(_0x25fa,0x109));var _0xa25f=function(_0xd00b97,_0x591b1d){_0xd00b97=_0xd00b97-0x0;var _0xf4afcc=_0x25fa[_0xd00b97];return _0xf4afcc;};'use strict';var OpenchannelMessageEvents=require(_0xa25f('0x0'));var events=['save',_0xa25f('0x1'),_0xa25f('0x2')];function createListener(_0x57e272,_0x408155){return function(_0xb88bd8){_0x408155[_0xa25f('0x3')](_0x57e272,_0xb88bd8);};}function removeListener(_0x4d0b34,_0x4e444d){return function(){OpenchannelMessageEvents[_0xa25f('0x4')](_0x4d0b34,_0x4e444d);};}exports['register']=function(_0x2ea9ea){for(var _0x3ab530=0x0,_0x29666d=events[_0xa25f('0x5')];_0x3ab530<_0x29666d;_0x3ab530++){var _0x22982b=events[_0x3ab530];var _0x168907=createListener(_0xa25f('0x6')+_0x22982b,_0x2ea9ea);OpenchannelMessageEvents['on'](_0x22982b,_0x168907);}};
\ No newline at end of file
index d5b57e2..5d00b65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd8f=['../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','getAgents','create','/:id/teams','post','addAgents','destroy','removeTeams','delete','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfd8f,0x159));var _0xffd8=function(_0x415583,_0x530e91){_0x415583=_0x415583-0x0;var _0x214b5d=_0xfd8f[_0x415583];return _0x214b5d;};'use strict';var multer=require(_0xffd8('0x0'));var util=require(_0xffd8('0x1'));var path=require(_0xffd8('0x2'));var express=require(_0xffd8('0x3'));var router=express[_0xffd8('0x4')]();var auth=require(_0xffd8('0x5'));var interaction=require(_0xffd8('0x6'));var config=require(_0xffd8('0x7'));var controller=require(_0xffd8('0x8'));router[_0xffd8('0x9')]('/',auth[_0xffd8('0xa')](),controller[_0xffd8('0xb')]);router[_0xffd8('0x9')](_0xffd8('0xc'),auth[_0xffd8('0xa')](),controller[_0xffd8('0xd')]);router[_0xffd8('0x9')](_0xffd8('0xe'),auth[_0xffd8('0xa')](),controller[_0xffd8('0xf')]);router[_0xffd8('0x9')]('/:id/members',auth[_0xffd8('0xa')](),controller[_0xffd8('0x10')]);router['get']('/:id/teams',auth[_0xffd8('0xa')](),controller['getTeams']);router[_0xffd8('0x9')]('/:id/users',auth[_0xffd8('0xa')](),controller[_0xffd8('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xffd8('0x12')]);router['post'](_0xffd8('0x13'),auth['isAuthenticated'](),controller['addTeams']);router[_0xffd8('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0xffd8('0x15')]);router['put']('/:id',auth[_0xffd8('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xffd8('0x16')]);router['delete'](_0xffd8('0x13'),auth[_0xffd8('0xa')](),controller[_0xffd8('0x17')]);router[_0xffd8('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0xffd8('0x19')]);module[_0xffd8('0x1a')]=router;
\ No newline at end of file
+var _0x06de=['util','path','express','Router','../../config/environment','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','destroy','delete','removeTeams','removeAgents','exports'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x06de,0x16c));var _0xe06d=function(_0x4d2552,_0x560684){_0x4d2552=_0x4d2552-0x0;var _0x56761b=_0x06de[_0x4d2552];return _0x56761b;};'use strict';var multer=require('multer');var util=require(_0xe06d('0x0'));var path=require(_0xe06d('0x1'));var express=require(_0xe06d('0x2'));var router=express[_0xe06d('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe06d('0x4'));var controller=require(_0xe06d('0x5'));router[_0xe06d('0x6')]('/',auth['isAuthenticated'](),controller[_0xe06d('0x7')]);router[_0xe06d('0x6')](_0xe06d('0x8'),auth[_0xe06d('0x9')](),controller[_0xe06d('0xa')]);router[_0xe06d('0x6')](_0xe06d('0xb'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xe06d('0x6')](_0xe06d('0xc'),auth['isAuthenticated'](),controller[_0xe06d('0xd')]);router[_0xe06d('0x6')](_0xe06d('0xe'),auth[_0xe06d('0x9')](),controller[_0xe06d('0xf')]);router[_0xe06d('0x10')]('/',auth[_0xe06d('0x9')](),controller[_0xe06d('0x11')]);router[_0xe06d('0x10')](_0xe06d('0xc'),auth['isAuthenticated'](),controller[_0xe06d('0x12')]);router[_0xe06d('0x10')](_0xe06d('0xe'),auth[_0xe06d('0x9')](),controller['addAgents']);router[_0xe06d('0x13')]('/:id',auth[_0xe06d('0x9')](),controller[_0xe06d('0x14')]);router['delete'](_0xe06d('0xb'),auth[_0xe06d('0x9')](),controller[_0xe06d('0x15')]);router[_0xe06d('0x16')](_0xe06d('0xc'),auth[_0xe06d('0x9')](),controller[_0xe06d('0x17')]);router['delete'](_0xe06d('0xe'),auth[_0xe06d('0x9')](),controller[_0xe06d('0x18')]);module[_0xe06d('0x19')]=router;
\ No newline at end of file
index 4c858a9..cf68a5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b46=['rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x6b46,0x147));var _0x66b4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x6b46[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x66b4('0x0'));module[_0x66b4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x66b4('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x66b4('0x3'),_0x66b4('0x4'),_0x66b4('0x5'))}};
\ No newline at end of file
+var _0x678d=['rrmemory','beepall','STRING','name','INTEGER'];(function(_0x3a376a,_0x203d2d){var _0x466c88=function(_0x15866b){while(--_0x15866b){_0x3a376a['push'](_0x3a376a['shift']());}};_0x466c88(++_0x203d2d);}(_0x678d,0xb1));var _0xd678=function(_0x1a7f7d,_0x3cedf0){_0x1a7f7d=_0x1a7f7d-0x0;var _0x2a1453=_0x678d[_0x1a7f7d];return _0x2a1453;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd678('0x0')],'unique':_0xd678('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd678('0x0')]},'timeout':{'type':Sequelize[_0xd678('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd678('0x3'),_0xd678('0x4'),'roundrobin')}};
\ No newline at end of file
index d351c5f..302ec5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb949=['format','SIP','getTeams','findOne','Team','order','ids','Agents','union','addAgents','penalty','addTeams','removeTeams','omit','spread','emit','userOpenchannelQueue:save','removeAgents','isArray','userOpenchannelQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','OpenchannelQueue','rawAttributes','model','dateStart','query','dateEnd','filters','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','add','day','merge','map','attributes','filter','options','include','rows','catch','show','params','keys','includeAll','create','body','find','describe','getMembers','UserOpenchannelQueue','OpenchannelQueueId','findAll','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt'];(function(_0x6ca7f4,_0x51a5df){var _0x494fa6=function(_0x359532){while(--_0x359532){_0x6ca7f4['push'](_0x6ca7f4['shift']());}};_0x494fa6(++_0x51a5df);}(_0xb949,0x82));var _0x9b94=function(_0x598879,_0x3a42f7){_0x598879=_0x598879-0x0;var _0x40bc9c=_0xb949[_0x598879];return _0x40bc9c;};'use strict';var pdf=require(_0x9b94('0x0'));var emlformat=require(_0x9b94('0x1'));var rimraf=require(_0x9b94('0x2'));var zipdir=require(_0x9b94('0x3'));var jsonpatch=require(_0x9b94('0x4'));var rp=require(_0x9b94('0x5'));var moment=require(_0x9b94('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x9b94('0x7'));var util=require(_0x9b94('0x8'));var path=require(_0x9b94('0x9'));var sox=require(_0x9b94('0xa'));var csv=require(_0x9b94('0xb'));var ejs=require(_0x9b94('0xc'));var fs=require('fs');var _=require(_0x9b94('0xd'));var squel=require(_0x9b94('0xe'));var crypto=require(_0x9b94('0xf'));var jsforce=require(_0x9b94('0x10'));var deskjs=require(_0x9b94('0x11'));var toCsv=require(_0x9b94('0xb'));var querystring=require(_0x9b94('0x12'));var Papa=require(_0x9b94('0x13'));var qs=require(_0x9b94('0x14'));var logger=require('../../config/logger')(_0x9b94('0x15'));var utils=require(_0x9b94('0x16'));var config=require(_0x9b94('0x17'));var db=require(_0x9b94('0x18'))['db'];var socket=require(_0x9b94('0x19'))({'host':'localhost','port':0x18eb});require('./openchannelQueue.socket')[_0x9b94('0x1a')](socket);function respondWithStatusCode(_0x24d870,_0x278e0d){_0x278e0d=_0x278e0d||0xcc;return function(_0x2b3655){if(_0x2b3655){return _0x24d870[_0x9b94('0x1b')](_0x278e0d);}return _0x24d870[_0x9b94('0x1c')](_0x278e0d)['end']();};}function respondWithResult(_0x254b89,_0x389429){_0x389429=_0x389429||0xc8;return function(_0x112db1){if(_0x112db1){return _0x254b89[_0x9b94('0x1c')](_0x389429)[_0x9b94('0x1d')](_0x112db1);}};}function respondWithFilteredResult(_0x99f43,_0x1b3f99){return function(_0x4de290){if(_0x4de290){var _0x380353=_0x4de290[_0x9b94('0x1e')],_0x18d11b=_0x1b3f99[_0x9b94('0x1f')],_0x27045c=_0x1b3f99[_0x9b94('0x1f')]+_0x1b3f99[_0x9b94('0x20')],_0x3e0818;if(_0x27045c>=_0x380353){_0x27045c=_0x380353;_0x3e0818=0xc8;}else{_0x3e0818=0xce;}_0x99f43[_0x9b94('0x1c')](_0x3e0818);return _0x99f43[_0x9b94('0x21')](_0x9b94('0x22'),_0x18d11b+'-'+_0x27045c+'/'+_0x380353)[_0x9b94('0x1d')](_0x4de290);}return null;};}function patchUpdates(_0x25316b){return function(_0x377bad){try{jsonpatch[_0x9b94('0x23')](_0x377bad,_0x25316b,!![]);}catch(_0x337e5b){return BPromise['reject'](_0x337e5b);}return _0x377bad['save']();};}function saveUpdates(_0x8d5816,_0x45cfda){return function(_0x4d1d8b){if(_0x4d1d8b){return _0x4d1d8b[_0x9b94('0x24')](_0x8d5816)['then'](function(_0x1f036e){return _0x1f036e;});}return null;};}function removeEntity(_0x33b0c1,_0x5145cb){return function(_0x57e6d0){if(_0x57e6d0){return _0x57e6d0[_0x9b94('0x25')]()[_0x9b94('0x26')](function(){_0x33b0c1[_0x9b94('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27617c,_0x434d8e){return function(_0x47fe45){if(!_0x47fe45){_0x27617c['sendStatus'](0x194);}return _0x47fe45;};}function handleError(_0x54aeb7,_0x49dc54){_0x49dc54=_0x49dc54||0x1f4;return function(_0x4d21fe){logger[_0x9b94('0x27')](_0x4d21fe[_0x9b94('0x28')]);if(_0x4d21fe[_0x9b94('0x29')]){delete _0x4d21fe[_0x9b94('0x29')];}_0x54aeb7[_0x9b94('0x1c')](_0x49dc54)[_0x9b94('0x2a')](_0x4d21fe);};}exports[_0x9b94('0x2b')]=function(_0x55c689,_0x48961c){var _0x48e9b5={},_0x5011bd={},_0x405db6={'count':0x0,'rows':[]};var _0x5d708a=db[_0x9b94('0x2c')][_0x9b94('0x2d')];_0x5011bd[_0x9b94('0x2e')]=_['keys'](_0x5d708a);var _0x3f1261={'dateStart':_0x55c689['query'][_0x9b94('0x2f')],'dateEnd':_0x55c689[_0x9b94('0x30')]['dateEnd']};delete _0x55c689[_0x9b94('0x30')]['dateStart'];delete _0x55c689['query'][_0x9b94('0x31')];_0x5011bd[_0x9b94('0x30')]=_['keys'](_0x55c689[_0x9b94('0x30')]);_0x5011bd[_0x9b94('0x32')]=_[_0x9b94('0x33')](_0x5011bd[_0x9b94('0x2e')],_0x5011bd['query']);_0x48e9b5['attributes']=_[_0x9b94('0x33')](_0x5011bd[_0x9b94('0x2e')],qs[_0x9b94('0x34')](_0x55c689[_0x9b94('0x30')][_0x9b94('0x34')]));_0x48e9b5['attributes']=_0x48e9b5['attributes'][_0x9b94('0x35')]?_0x48e9b5['attributes']:_0x5011bd['model'];if(!_0x55c689[_0x9b94('0x30')][_0x9b94('0x36')](_0x9b94('0x37'))){_0x48e9b5['limit']=qs[_0x9b94('0x20')](_0x55c689[_0x9b94('0x30')][_0x9b94('0x20')]);_0x48e9b5[_0x9b94('0x1f')]=qs['offset'](_0x55c689[_0x9b94('0x30')][_0x9b94('0x1f')]);}_0x48e9b5['order']=qs[_0x9b94('0x38')](_0x55c689[_0x9b94('0x30')][_0x9b94('0x38')]);_0x48e9b5[_0x9b94('0x39')]=qs[_0x9b94('0x32')](_[_0x9b94('0x3a')](_0x55c689['query'],_0x5011bd[_0x9b94('0x32')]));if(_0x3f1261['dateStart']){if(_0x3f1261[_0x9b94('0x31')]){_0x3f1261[_0x9b94('0x31')]=moment(_0x3f1261[_0x9b94('0x31')])[_0x9b94('0x3b')](0x1,_0x9b94('0x3c'));}else{_0x3f1261[_0x9b94('0x31')]=moment(_0x3f1261[_0x9b94('0x2f')])['add'](0x1,_0x9b94('0x3c'));}_['merge'](_0x48e9b5[_0x9b94('0x39')],{'createdAt':{'$gte':_0x3f1261[_0x9b94('0x2f')],'$lte':_0x3f1261[_0x9b94('0x31')]}});}if(_0x55c689[_0x9b94('0x30')]['filter']){_0x48e9b5[_0x9b94('0x39')]=_[_0x9b94('0x3d')](_0x48e9b5['where'],{'$or':_[_0x9b94('0x3e')](_0x48e9b5[_0x9b94('0x3f')],function(_0x30f08b){var _0x417fbf={};_0x417fbf[_0x30f08b]={'$like':'%'+_0x55c689[_0x9b94('0x30')][_0x9b94('0x40')]+'%'};return _0x417fbf;})});}_0x48e9b5=_['merge']({},_0x48e9b5,_0x55c689[_0x9b94('0x41')]);var _0x3a45d5={'where':_0x48e9b5[_0x9b94('0x39')]};return db[_0x9b94('0x2c')][_0x9b94('0x1e')](_0x3a45d5)[_0x9b94('0x26')](function(_0x3fde31){_0x405db6[_0x9b94('0x1e')]=_0x3fde31;if(_0x55c689['query']['includeAll']){_0x48e9b5[_0x9b94('0x42')]=[{'all':!![]}];}return db[_0x9b94('0x2c')]['findAll'](_0x48e9b5);})[_0x9b94('0x26')](function(_0x34736c){_0x405db6[_0x9b94('0x43')]=_0x34736c;return _0x405db6;})[_0x9b94('0x26')](respondWithFilteredResult(_0x48961c,_0x48e9b5))[_0x9b94('0x44')](handleError(_0x48961c,null));};exports[_0x9b94('0x45')]=function(_0x14cdaf,_0x420433){var _0x212c4a={'raw':!![],'where':{'id':_0x14cdaf[_0x9b94('0x46')]['id']}},_0x3f326a={};_0x3f326a[_0x9b94('0x2e')]=_['keys'](db[_0x9b94('0x2c')][_0x9b94('0x2d')]);_0x3f326a[_0x9b94('0x30')]=_[_0x9b94('0x47')](_0x14cdaf[_0x9b94('0x30')]);_0x3f326a['filters']=_[_0x9b94('0x33')](_0x3f326a[_0x9b94('0x2e')],_0x3f326a['query']);_0x212c4a[_0x9b94('0x3f')]=_[_0x9b94('0x33')](_0x3f326a[_0x9b94('0x2e')],qs[_0x9b94('0x34')](_0x14cdaf[_0x9b94('0x30')][_0x9b94('0x34')]));_0x212c4a[_0x9b94('0x3f')]=_0x212c4a['attributes'][_0x9b94('0x35')]?_0x212c4a[_0x9b94('0x3f')]:_0x3f326a['model'];if(_0x14cdaf[_0x9b94('0x30')][_0x9b94('0x48')]){_0x212c4a[_0x9b94('0x42')]=[{'all':!![]}];}_0x212c4a=_['merge']({},_0x212c4a,_0x14cdaf[_0x9b94('0x41')]);return db[_0x9b94('0x2c')]['find'](_0x212c4a)['then'](handleEntityNotFound(_0x420433,null))[_0x9b94('0x26')](respondWithResult(_0x420433,null))['catch'](handleError(_0x420433,null));};exports['create']=function(_0x549692,_0x512a99){return db[_0x9b94('0x2c')][_0x9b94('0x49')](_0x549692[_0x9b94('0x4a')],{})[_0x9b94('0x26')](respondWithResult(_0x512a99,0xc9))[_0x9b94('0x44')](handleError(_0x512a99,null));};exports[_0x9b94('0x24')]=function(_0x13360c,_0x45ee2f){if(_0x13360c['body']['id']){delete _0x13360c[_0x9b94('0x4a')]['id'];}return db['OpenchannelQueue'][_0x9b94('0x4b')]({'where':{'id':_0x13360c[_0x9b94('0x46')]['id']}})[_0x9b94('0x26')](handleEntityNotFound(_0x45ee2f,null))[_0x9b94('0x26')](saveUpdates(_0x13360c[_0x9b94('0x4a')],null))[_0x9b94('0x26')](respondWithResult(_0x45ee2f,null))['catch'](handleError(_0x45ee2f,null));};exports['destroy']=function(_0x45f333,_0x2f88cd){return db[_0x9b94('0x2c')][_0x9b94('0x4b')]({'where':{'id':_0x45f333['params']['id']}})[_0x9b94('0x26')](handleEntityNotFound(_0x2f88cd,null))[_0x9b94('0x26')](removeEntity(_0x2f88cd,null))[_0x9b94('0x44')](handleError(_0x2f88cd,null));};exports[_0x9b94('0x4c')]=function(_0x46415a,_0x23cb6c){return db[_0x9b94('0x2c')][_0x9b94('0x4c')]()[_0x9b94('0x26')](respondWithResult(_0x23cb6c,null))[_0x9b94('0x44')](handleError(_0x23cb6c,null));};exports[_0x9b94('0x4d')]=function(_0x4705d5,_0x9e4d29,_0x4c9e40){var _0x93c00d={'raw':!![],'where':{}},_0x40cb93={},_0x16051f;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x4705d5['params']['id']}})[_0x9b94('0x26')](handleEntityNotFound(_0x9e4d29,null))[_0x9b94('0x26')](function(_0x243178){if(_0x243178){_0x16051f=_0x243178['get']({'plain':!![]});_0x40cb93['model']=_[_0x9b94('0x47')](db[_0x9b94('0x4e')][_0x9b94('0x2d')]);_0x40cb93[_0x9b94('0x30')]=_[_0x9b94('0x47')](_0x4705d5['query']);_0x40cb93[_0x9b94('0x32')]=_['intersection'](_0x40cb93['model'],_0x40cb93[_0x9b94('0x30')]);_0x93c00d['attributes']=_['intersection'](_0x40cb93[_0x9b94('0x2e')],qs[_0x9b94('0x34')](_0x4705d5[_0x9b94('0x30')][_0x9b94('0x34')]));_0x93c00d[_0x9b94('0x3f')]=_0x93c00d[_0x9b94('0x3f')][_0x9b94('0x35')]?_0x93c00d[_0x9b94('0x3f')]:_0x40cb93[_0x9b94('0x2e')];if(!_0x4705d5['query'][_0x9b94('0x36')](_0x9b94('0x37'))){_0x93c00d['limit']=qs[_0x9b94('0x20')](_0x4705d5[_0x9b94('0x30')][_0x9b94('0x20')]);_0x93c00d[_0x9b94('0x1f')]=qs[_0x9b94('0x1f')](_0x4705d5[_0x9b94('0x30')][_0x9b94('0x1f')]);}_0x93c00d['order']=qs[_0x9b94('0x38')](_0x4705d5['query']['sort']);_0x93c00d[_0x9b94('0x39')]=qs[_0x9b94('0x32')](_[_0x9b94('0x3a')](_0x4705d5['query'],_0x40cb93[_0x9b94('0x32')]));_0x93c00d[_0x9b94('0x39')][_0x9b94('0x4f')]=_0x243178['id'];if(_0x4705d5[_0x9b94('0x30')][_0x9b94('0x40')]){_0x93c00d['where']=_[_0x9b94('0x3d')](_0x93c00d['where'],{'$or':_['map'](_0x93c00d['attributes'],function(_0x801b47){var _0x339471={};_0x339471[_0x801b47]={'$like':'%'+_0x4705d5[_0x9b94('0x30')][_0x9b94('0x40')]+'%'};return _0x339471;})});}_0x93c00d=_[_0x9b94('0x3d')]({},_0x93c00d,_0x4705d5[_0x9b94('0x41')]);return db[_0x9b94('0x4e')][_0x9b94('0x50')](_0x93c00d);}})[_0x9b94('0x26')](function(_0x1c3b1f){if(_0x1c3b1f){return db[_0x9b94('0x51')][_0x9b94('0x52')]({'where':{'id':_[_0x9b94('0x3e')](_0x1c3b1f,_0x9b94('0x53')),'role':_0x9b94('0x54')},'attributes':['id',_0x9b94('0x29'),_0x9b94('0x55'),_0x9b94('0x56'),_0x9b94('0x57')]});}})[_0x9b94('0x26')](function(_0x1aeb6d){if(_0x1aeb6d){return{'count':_0x1aeb6d[_0x9b94('0x1e')],'rows':_[_0x9b94('0x3e')](_0x1aeb6d[_0x9b94('0x43')],function(_0x474df3){return{'membername':_0x474df3['name'],'UserId':_0x474df3['id'],'queue_name':_0x16051f[_0x9b94('0x29')],'OpenchannelQueueId':_0x16051f['id'],'interface':util[_0x9b94('0x58')]('%s/%s',_0x9b94('0x59'),_0x474df3[_0x9b94('0x29')]),'penalty':0x0,'paused':_0x474df3[_0x9b94('0x55')],'createdAt':_0x474df3[_0x9b94('0x57')],'updatedAt':_0x474df3[_0x9b94('0x56')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9b94('0x26')](respondWithFilteredResult(_0x9e4d29,_0x93c00d))[_0x9b94('0x44')](handleError(_0x9e4d29,null));};exports[_0x9b94('0x5a')]=function(_0x4b4c18,_0x2f584f,_0x3b2dcf){var _0x2a4390={};var _0x2c0055={};var _0x255b98;var _0x3705b6;return db[_0x9b94('0x2c')][_0x9b94('0x5b')]({'where':{'id':_0x4b4c18[_0x9b94('0x46')]['id']}})[_0x9b94('0x26')](handleEntityNotFound(_0x2f584f,null))[_0x9b94('0x26')](function(_0x39b0cb){if(_0x39b0cb){_0x255b98=_0x39b0cb;_0x2c0055[_0x9b94('0x2e')]=_[_0x9b94('0x47')](db[_0x9b94('0x5c')][_0x9b94('0x2d')]);_0x2c0055[_0x9b94('0x30')]=_[_0x9b94('0x47')](_0x4b4c18[_0x9b94('0x30')]);_0x2c0055[_0x9b94('0x32')]=_[_0x9b94('0x33')](_0x2c0055[_0x9b94('0x2e')],_0x2c0055[_0x9b94('0x30')]);_0x2a4390['attributes']=_[_0x9b94('0x33')](_0x2c0055['model'],qs[_0x9b94('0x34')](_0x4b4c18['query']['fields']));_0x2a4390[_0x9b94('0x3f')]=_0x2a4390[_0x9b94('0x3f')]['length']?_0x2a4390[_0x9b94('0x3f')]:_0x2c0055['model'];_0x2a4390[_0x9b94('0x5d')]=qs[_0x9b94('0x38')](_0x4b4c18[_0x9b94('0x30')]['sort']);_0x2a4390[_0x9b94('0x39')]=qs[_0x9b94('0x32')](_['pick'](_0x4b4c18['query'],_0x2c0055['filters']));if(_0x4b4c18[_0x9b94('0x30')][_0x9b94('0x40')]){_0x2a4390[_0x9b94('0x39')]=_['merge'](_0x2a4390[_0x9b94('0x39')],{'$or':_[_0x9b94('0x3e')](_0x2a4390[_0x9b94('0x3f')],function(_0x3ad8ed){var _0xb9bca5={};_0xb9bca5[_0x3ad8ed]={'$like':'%'+_0x4b4c18['query'][_0x9b94('0x40')]+'%'};return _0xb9bca5;})});}_0x2a4390=_[_0x9b94('0x3d')]({},_0x2a4390,_0x4b4c18[_0x9b94('0x41')]);return _0x255b98[_0x9b94('0x5a')](_0x2a4390);}})[_0x9b94('0x26')](function(_0x5095fd){if(_0x5095fd){_0x3705b6=_0x5095fd[_0x9b94('0x35')];if(!_0x4b4c18[_0x9b94('0x30')]['hasOwnProperty']('nolimit')){_0x2a4390[_0x9b94('0x20')]=qs[_0x9b94('0x20')](_0x4b4c18[_0x9b94('0x30')][_0x9b94('0x20')]);_0x2a4390['offset']=qs[_0x9b94('0x1f')](_0x4b4c18[_0x9b94('0x30')][_0x9b94('0x1f')]);}return _0x255b98[_0x9b94('0x5a')](_0x2a4390);}})[_0x9b94('0x26')](function(_0x5625c3){if(_0x5625c3){return _0x5625c3?{'count':_0x3705b6,'rows':_0x5625c3}:null;}})[_0x9b94('0x26')](respondWithResult(_0x2f584f,null))[_0x9b94('0x44')](handleError(_0x2f584f,null));};exports['addTeams']=function(_0x174504,_0x16f324,_0x10bf92){var _0xe29f6b=[];var _0x48f2d0;return db[_0x9b94('0x5c')][_0x9b94('0x50')]({'where':{'id':_0x174504[_0x9b94('0x4a')][_0x9b94('0x5e')]},'attributes':['id'],'include':[{'model':db[_0x9b94('0x51')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9b94('0x26')](function(_0x1f7eb8){if(_0x1f7eb8){for(var _0x19f234=0x0;_0x19f234<_0x1f7eb8[_0x9b94('0x35')];_0x19f234+=0x1){for(var _0xdc2956=0x0;_0xdc2956<_0x1f7eb8[_0x19f234][_0x9b94('0x5f')]['length'];_0xdc2956+=0x1){_0xe29f6b=_[_0x9b94('0x60')](_0xe29f6b,[_0x1f7eb8[_0x19f234][_0x9b94('0x5f')][_0xdc2956]['id']]);}}return _0xe29f6b;}})[_0x9b94('0x26')](function(_0x295618){if(_0x295618){return db[_0x9b94('0x2c')][_0x9b94('0x4b')]({'where':{'id':_0x174504[_0x9b94('0x46')]['id']}});}})[_0x9b94('0x26')](function(_0x13fd2a){if(_0x13fd2a){_0x48f2d0=_0x13fd2a;return _0x48f2d0[_0x9b94('0x61')](_0xe29f6b,{'penalty':_0x174504[_0x9b94('0x4a')][_0x9b94('0x62')]});}})[_0x9b94('0x26')](function(_0x5417ab){if(_0x5417ab){return _0x48f2d0[_0x9b94('0x63')](_0x174504['body'][_0x9b94('0x5e')]);}})['then'](handleEntityNotFound(_0x16f324,null))[_0x9b94('0x26')](respondWithStatusCode(_0x16f324,null))[_0x9b94('0x44')](handleError(_0x16f324,null));};exports[_0x9b94('0x64')]=function(_0x30f4e6,_0x258d6c,_0x4c90ea){var _0x148b49=[];var _0x581688;return db[_0x9b94('0x5c')][_0x9b94('0x50')]({'where':{'id':_0x30f4e6[_0x9b94('0x30')][_0x9b94('0x5e')]},'attributes':['id'],'include':[{'model':db[_0x9b94('0x51')],'as':_0x9b94('0x5f'),'attributes':['id'],'raw':!![]}]})[_0x9b94('0x26')](function(_0x2cb648){if(_0x2cb648){for(var _0x263152=0x0;_0x263152<_0x2cb648['length'];_0x263152+=0x1){for(var _0x5044db=0x0;_0x5044db<_0x2cb648[_0x263152][_0x9b94('0x5f')][_0x9b94('0x35')];_0x5044db+=0x1){_0x148b49=_['union'](_0x148b49,[_0x2cb648[_0x263152][_0x9b94('0x5f')][_0x5044db]['id']]);}}return _0x148b49;}})[_0x9b94('0x26')](function(_0x231964){if(_0x231964){return db[_0x9b94('0x2c')][_0x9b94('0x4b')]({'where':{'id':_0x30f4e6['params']['id']}});}})[_0x9b94('0x26')](function(_0x306b35){if(_0x306b35){_0x581688=_0x306b35;return _0x581688['removeAgents'](_0x148b49);}})[_0x9b94('0x26')](function(_0x13a208){if(_0x581688){return _0x581688[_0x9b94('0x64')](_0x30f4e6[_0x9b94('0x30')][_0x9b94('0x5e')]);}})[_0x9b94('0x26')](handleEntityNotFound(_0x258d6c,null))[_0x9b94('0x26')](respondWithStatusCode(_0x258d6c,null))[_0x9b94('0x44')](handleError(_0x258d6c,null));};exports[_0x9b94('0x61')]=function(_0x90c58d,_0x207c3d,_0xad89c9){return db['OpenchannelQueue']['find']({'where':{'id':_0x90c58d[_0x9b94('0x46')]['id']}})[_0x9b94('0x26')](handleEntityNotFound(_0x207c3d,null))[_0x9b94('0x26')](function(_0xfc8c05){if(_0xfc8c05){return _0xfc8c05['addAgents'](_0x90c58d['body'][_0x9b94('0x5e')],_[_0x9b94('0x65')](_0x90c58d[_0x9b94('0x4a')],[_0x9b94('0x5e'),'id'])||{})[_0x9b94('0x66')](function(_0x5d4128){for(var _0x410503=0x0;_0x410503<_0x90c58d[_0x9b94('0x4a')][_0x9b94('0x5e')][_0x9b94('0x35')];_0x410503+=0x1){socket[_0x9b94('0x67')](_0x9b94('0x68'),{'UserId':_0x90c58d[_0x9b94('0x4a')][_0x9b94('0x5e')][_0x410503],'OpenchannelQueueId':_0x90c58d['params']['id']});}return _0x5d4128;});}})[_0x9b94('0x26')](respondWithResult(_0x207c3d,null))[_0x9b94('0x44')](handleError(_0x207c3d,null));};exports[_0x9b94('0x69')]=function(_0x32962a,_0x22efa6,_0x4191f7){var _0xd32706;return db[_0x9b94('0x2c')][_0x9b94('0x4b')]({'where':{'id':_0x32962a[_0x9b94('0x46')]['id']}})[_0x9b94('0x26')](handleEntityNotFound(_0x22efa6,null))[_0x9b94('0x26')](function(_0x2bac93){if(_0x2bac93){return _0x2bac93[_0x9b94('0x69')](_0x32962a[_0x9b94('0x30')][_0x9b94('0x5e')])[_0x9b94('0x26')](function(_0x2dac9d){if(_[_0x9b94('0x6a')](_0x32962a['query'][_0x9b94('0x5e')])){for(var _0x4b6b53=0x0;_0x4b6b53<_0x32962a['query']['ids'][_0x9b94('0x35')];_0x4b6b53+=0x1){socket['emit'](_0x9b94('0x6b'),{'UserId':_0x32962a[_0x9b94('0x30')]['ids'][_0x4b6b53],'OpenchannelQueueId':_0x32962a['params']['id']});}}else{socket['emit'](_0x9b94('0x6b'),{'UserId':_0x32962a[_0x9b94('0x30')]['ids'],'OpenchannelQueueId':_0x32962a['params']['id']});}});}})['then'](respondWithStatusCode(_0x22efa6,null))['catch'](handleError(_0x22efa6,null));};exports[_0x9b94('0x6c')]=function(_0x44ad48,_0x1d0b81,_0x5d48c4){var _0x220d96={};var _0x3da781={};var _0x30f31f;var _0x4e8e7a;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x44ad48[_0x9b94('0x46')]['id']}})[_0x9b94('0x26')](handleEntityNotFound(_0x1d0b81,null))['then'](function(_0x56e2a8){if(_0x56e2a8){_0x30f31f=_0x56e2a8;_0x3da781['model']=_[_0x9b94('0x47')](db[_0x9b94('0x51')]['rawAttributes']);_0x3da781[_0x9b94('0x30')]=_[_0x9b94('0x47')](_0x44ad48['query']);_0x3da781[_0x9b94('0x32')]=_[_0x9b94('0x33')](_0x3da781['model'],_0x3da781[_0x9b94('0x30')]);_0x220d96[_0x9b94('0x3f')]=_['intersection'](_0x3da781['model'],qs[_0x9b94('0x34')](_0x44ad48[_0x9b94('0x30')]['fields']));_0x220d96['attributes']=_0x220d96[_0x9b94('0x3f')][_0x9b94('0x35')]?_0x220d96[_0x9b94('0x3f')]:_0x3da781['model'];_0x220d96[_0x9b94('0x5d')]=qs['sort'](_0x44ad48['query'][_0x9b94('0x38')]);_0x220d96['where']=qs[_0x9b94('0x32')](_[_0x9b94('0x3a')](_0x44ad48[_0x9b94('0x30')],_0x3da781[_0x9b94('0x32')]));if(_0x44ad48[_0x9b94('0x30')][_0x9b94('0x40')]){_0x220d96[_0x9b94('0x39')]=_[_0x9b94('0x3d')](_0x220d96[_0x9b94('0x39')],{'$or':_[_0x9b94('0x3e')](_0x220d96['attributes'],function(_0x52478d){var _0x50d52a={};_0x50d52a[_0x52478d]={'$like':'%'+_0x44ad48[_0x9b94('0x30')]['filter']+'%'};return _0x50d52a;})});}_0x220d96=_['merge']({},_0x220d96,_0x44ad48[_0x9b94('0x41')]);return _0x30f31f[_0x9b94('0x6c')](_0x220d96);}})[_0x9b94('0x26')](function(_0x225f58){if(_0x225f58){_0x4e8e7a=_0x225f58[_0x9b94('0x35')];if(!_0x44ad48[_0x9b94('0x30')][_0x9b94('0x36')](_0x9b94('0x37'))){_0x220d96[_0x9b94('0x20')]=qs['limit'](_0x44ad48['query'][_0x9b94('0x20')]);_0x220d96[_0x9b94('0x1f')]=qs[_0x9b94('0x1f')](_0x44ad48[_0x9b94('0x30')][_0x9b94('0x1f')]);}return _0x30f31f[_0x9b94('0x6c')](_0x220d96);}})['then'](function(_0x396711){if(_0x396711){return _0x396711?{'count':_0x4e8e7a,'rows':_0x396711}:null;}})[_0x9b94('0x26')](respondWithResult(_0x1d0b81,null))['catch'](handleError(_0x1d0b81,null));};
\ No newline at end of file
+var _0x0036=['findAll','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','format','getTeams','Team','hasOwnProperty','ids','User','Agents','addAgents','penalty','addTeams','union','removeTeams','omit','spread','emit','userOpenchannelQueue:save','removeAgents','isArray','userOpenchannelQueue:remove','getAgents','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../mysqldb','socket.io-emitter','localhost','./openchannelQueue.socket','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','end','error','stack','name','send','OpenchannelQueue','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','length','nolimit','sort','where','add','day','merge','filter','options','then','includeAll','include','rows','catch','params','fields','find','create','update','body','describe','getMembers','get','UserOpenchannelQueue','order','pick','OpenchannelQueueId','map'];(function(_0x45c14a,_0x3c8cc3){var _0x3979c7=function(_0x12028e){while(--_0x12028e){_0x45c14a['push'](_0x45c14a['shift']());}};_0x3979c7(++_0x3c8cc3);}(_0x0036,0x15c));var _0x6003=function(_0x1cba09,_0x3699d7){_0x1cba09=_0x1cba09-0x0;var _0x559e0e=_0x0036[_0x1cba09];return _0x559e0e;};'use strict';var pdf=require(_0x6003('0x0'));var emlformat=require(_0x6003('0x1'));var rimraf=require(_0x6003('0x2'));var zipdir=require(_0x6003('0x3'));var jsonpatch=require(_0x6003('0x4'));var rp=require(_0x6003('0x5'));var moment=require(_0x6003('0x6'));var BPromise=require(_0x6003('0x7'));var Mustache=require(_0x6003('0x8'));var util=require(_0x6003('0x9'));var path=require(_0x6003('0xa'));var sox=require(_0x6003('0xb'));var csv=require(_0x6003('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x6003('0xd'));var crypto=require(_0x6003('0xe'));var jsforce=require(_0x6003('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6003('0xc'));var querystring=require(_0x6003('0x10'));var Papa=require(_0x6003('0x11'));var qs=require(_0x6003('0x12'));var logger=require('../../config/logger')(_0x6003('0x13'));var utils=require(_0x6003('0x14'));var config=require('../../config/environment');var db=require(_0x6003('0x15'))['db'];var socket=require(_0x6003('0x16'))({'host':_0x6003('0x17'),'port':0x18eb});require(_0x6003('0x18'))['register'](socket);function respondWithStatusCode(_0x427b20,_0x1acfe5){_0x1acfe5=_0x1acfe5||0xcc;return function(_0x54059f){if(_0x54059f){return _0x427b20[_0x6003('0x19')](_0x1acfe5);}return _0x427b20[_0x6003('0x1a')](_0x1acfe5)['end']();};}function respondWithResult(_0x5882c1,_0x4e4c97){_0x4e4c97=_0x4e4c97||0xc8;return function(_0x37b777){if(_0x37b777){return _0x5882c1[_0x6003('0x1a')](_0x4e4c97)[_0x6003('0x1b')](_0x37b777);}};}function respondWithFilteredResult(_0x53b72d,_0x2d1e72){return function(_0x3446f6){if(_0x3446f6){var _0x4b30d9=_0x3446f6[_0x6003('0x1c')],_0x2bbcea=_0x2d1e72[_0x6003('0x1d')],_0x3181a8=_0x2d1e72[_0x6003('0x1d')]+_0x2d1e72[_0x6003('0x1e')],_0x4fd141;if(_0x3181a8>=_0x4b30d9){_0x3181a8=_0x4b30d9;_0x4fd141=0xc8;}else{_0x4fd141=0xce;}_0x53b72d[_0x6003('0x1a')](_0x4fd141);return _0x53b72d[_0x6003('0x1f')](_0x6003('0x20'),_0x2bbcea+'-'+_0x3181a8+'/'+_0x4b30d9)[_0x6003('0x1b')](_0x3446f6);}return null;};}function patchUpdates(_0x1b50a4){return function(_0x39a28a){try{jsonpatch[_0x6003('0x21')](_0x39a28a,_0x1b50a4,!![]);}catch(_0x237b41){return BPromise[_0x6003('0x22')](_0x237b41);}return _0x39a28a[_0x6003('0x23')]();};}function saveUpdates(_0x36fb3f,_0x1a342a){return function(_0x7d5355){if(_0x7d5355){return _0x7d5355['update'](_0x36fb3f)['then'](function(_0x530d7a){return _0x530d7a;});}return null;};}function removeEntity(_0x32d83b,_0x199c88){return function(_0x42a65a){if(_0x42a65a){return _0x42a65a[_0x6003('0x24')]()['then'](function(){_0x32d83b['status'](0xcc)[_0x6003('0x25')]();});}};}function handleEntityNotFound(_0x2e3479,_0x1bfd23){return function(_0x5ecaa4){if(!_0x5ecaa4){_0x2e3479[_0x6003('0x19')](0x194);}return _0x5ecaa4;};}function handleError(_0x280848,_0x329879){_0x329879=_0x329879||0x1f4;return function(_0x32f523){logger[_0x6003('0x26')](_0x32f523[_0x6003('0x27')]);if(_0x32f523[_0x6003('0x28')]){delete _0x32f523['name'];}_0x280848[_0x6003('0x1a')](_0x329879)[_0x6003('0x29')](_0x32f523);};}exports['index']=function(_0x5d1a20,_0x2cf681){var _0x16af67={},_0x56a918={},_0xac2f05={'count':0x0,'rows':[]};var _0x3cc22b=db[_0x6003('0x2a')][_0x6003('0x2b')];_0x56a918[_0x6003('0x2c')]=_[_0x6003('0x2d')](_0x3cc22b);var _0x6ad4ff={'dateStart':_0x5d1a20[_0x6003('0x2e')][_0x6003('0x2f')],'dateEnd':_0x5d1a20['query'][_0x6003('0x30')]};delete _0x5d1a20['query'][_0x6003('0x2f')];delete _0x5d1a20[_0x6003('0x2e')]['dateEnd'];_0x56a918[_0x6003('0x2e')]=_[_0x6003('0x2d')](_0x5d1a20[_0x6003('0x2e')]);_0x56a918[_0x6003('0x31')]=_[_0x6003('0x32')](_0x56a918[_0x6003('0x2c')],_0x56a918[_0x6003('0x2e')]);_0x16af67[_0x6003('0x33')]=_[_0x6003('0x32')](_0x56a918[_0x6003('0x2c')],qs['fields'](_0x5d1a20[_0x6003('0x2e')]['fields']));_0x16af67[_0x6003('0x33')]=_0x16af67[_0x6003('0x33')][_0x6003('0x34')]?_0x16af67[_0x6003('0x33')]:_0x56a918['model'];if(!_0x5d1a20['query']['hasOwnProperty'](_0x6003('0x35'))){_0x16af67[_0x6003('0x1e')]=qs['limit'](_0x5d1a20['query'][_0x6003('0x1e')]);_0x16af67['offset']=qs['offset'](_0x5d1a20[_0x6003('0x2e')]['offset']);}_0x16af67['order']=qs[_0x6003('0x36')](_0x5d1a20[_0x6003('0x2e')][_0x6003('0x36')]);_0x16af67[_0x6003('0x37')]=qs[_0x6003('0x31')](_['pick'](_0x5d1a20[_0x6003('0x2e')],_0x56a918[_0x6003('0x31')]));if(_0x6ad4ff['dateStart']){if(_0x6ad4ff[_0x6003('0x30')]){_0x6ad4ff[_0x6003('0x30')]=moment(_0x6ad4ff[_0x6003('0x30')])[_0x6003('0x38')](0x1,_0x6003('0x39'));}else{_0x6ad4ff[_0x6003('0x30')]=moment(_0x6ad4ff[_0x6003('0x2f')])[_0x6003('0x38')](0x1,_0x6003('0x39'));}_[_0x6003('0x3a')](_0x16af67[_0x6003('0x37')],{'createdAt':{'$gte':_0x6ad4ff[_0x6003('0x2f')],'$lte':_0x6ad4ff[_0x6003('0x30')]}});}if(_0x5d1a20[_0x6003('0x2e')]['filter']){_0x16af67[_0x6003('0x37')]=_[_0x6003('0x3a')](_0x16af67[_0x6003('0x37')],{'$or':_['map'](_0x16af67[_0x6003('0x33')],function(_0x31a3d5){var _0x4a9d35={};_0x4a9d35[_0x31a3d5]={'$like':'%'+_0x5d1a20[_0x6003('0x2e')][_0x6003('0x3b')]+'%'};return _0x4a9d35;})});}_0x16af67=_[_0x6003('0x3a')]({},_0x16af67,_0x5d1a20[_0x6003('0x3c')]);var _0x7115e7={'where':_0x16af67[_0x6003('0x37')]};return db[_0x6003('0x2a')][_0x6003('0x1c')](_0x7115e7)[_0x6003('0x3d')](function(_0x1db364){_0xac2f05['count']=_0x1db364;if(_0x5d1a20[_0x6003('0x2e')][_0x6003('0x3e')]){_0x16af67[_0x6003('0x3f')]=[{'all':!![]}];}return db[_0x6003('0x2a')]['findAll'](_0x16af67);})[_0x6003('0x3d')](function(_0x57f5cc){_0xac2f05[_0x6003('0x40')]=_0x57f5cc;return _0xac2f05;})['then'](respondWithFilteredResult(_0x2cf681,_0x16af67))[_0x6003('0x41')](handleError(_0x2cf681,null));};exports['show']=function(_0x5ad1de,_0x2b8c18){var _0x49776e={'raw':!![],'where':{'id':_0x5ad1de[_0x6003('0x42')]['id']}},_0x233a38={};_0x233a38[_0x6003('0x2c')]=_[_0x6003('0x2d')](db[_0x6003('0x2a')][_0x6003('0x2b')]);_0x233a38['query']=_[_0x6003('0x2d')](_0x5ad1de[_0x6003('0x2e')]);_0x233a38['filters']=_[_0x6003('0x32')](_0x233a38[_0x6003('0x2c')],_0x233a38['query']);_0x49776e[_0x6003('0x33')]=_['intersection'](_0x233a38[_0x6003('0x2c')],qs[_0x6003('0x43')](_0x5ad1de['query'][_0x6003('0x43')]));_0x49776e[_0x6003('0x33')]=_0x49776e[_0x6003('0x33')][_0x6003('0x34')]?_0x49776e[_0x6003('0x33')]:_0x233a38[_0x6003('0x2c')];if(_0x5ad1de[_0x6003('0x2e')]['includeAll']){_0x49776e['include']=[{'all':!![]}];}_0x49776e=_[_0x6003('0x3a')]({},_0x49776e,_0x5ad1de[_0x6003('0x3c')]);return db[_0x6003('0x2a')][_0x6003('0x44')](_0x49776e)[_0x6003('0x3d')](handleEntityNotFound(_0x2b8c18,null))[_0x6003('0x3d')](respondWithResult(_0x2b8c18,null))[_0x6003('0x41')](handleError(_0x2b8c18,null));};exports[_0x6003('0x45')]=function(_0x47b712,_0x5d7047){return db[_0x6003('0x2a')]['create'](_0x47b712['body'],{})[_0x6003('0x3d')](respondWithResult(_0x5d7047,0xc9))[_0x6003('0x41')](handleError(_0x5d7047,null));};exports[_0x6003('0x46')]=function(_0x1412e9,_0x3bdd03){if(_0x1412e9[_0x6003('0x47')]['id']){delete _0x1412e9[_0x6003('0x47')]['id'];}return db['OpenchannelQueue'][_0x6003('0x44')]({'where':{'id':_0x1412e9['params']['id']}})[_0x6003('0x3d')](handleEntityNotFound(_0x3bdd03,null))['then'](saveUpdates(_0x1412e9[_0x6003('0x47')],null))[_0x6003('0x3d')](respondWithResult(_0x3bdd03,null))[_0x6003('0x41')](handleError(_0x3bdd03,null));};exports[_0x6003('0x24')]=function(_0x333452,_0x872d67){return db[_0x6003('0x2a')][_0x6003('0x44')]({'where':{'id':_0x333452[_0x6003('0x42')]['id']}})[_0x6003('0x3d')](handleEntityNotFound(_0x872d67,null))[_0x6003('0x3d')](removeEntity(_0x872d67,null))[_0x6003('0x41')](handleError(_0x872d67,null));};exports['describe']=function(_0x4fd569,_0x1a0f23){return db[_0x6003('0x2a')][_0x6003('0x48')]()[_0x6003('0x3d')](respondWithResult(_0x1a0f23,null))[_0x6003('0x41')](handleError(_0x1a0f23,null));};exports[_0x6003('0x49')]=function(_0x828376,_0x307b88,_0x1810a6){var _0x45e3cb={'raw':!![],'where':{}},_0x5e0140={},_0x4d49b9;return db[_0x6003('0x2a')]['findOne']({'where':{'id':_0x828376[_0x6003('0x42')]['id']}})['then'](handleEntityNotFound(_0x307b88,null))[_0x6003('0x3d')](function(_0x1446ad){if(_0x1446ad){_0x4d49b9=_0x1446ad[_0x6003('0x4a')]({'plain':!![]});_0x5e0140[_0x6003('0x2c')]=_[_0x6003('0x2d')](db[_0x6003('0x4b')][_0x6003('0x2b')]);_0x5e0140[_0x6003('0x2e')]=_[_0x6003('0x2d')](_0x828376[_0x6003('0x2e')]);_0x5e0140[_0x6003('0x31')]=_['intersection'](_0x5e0140[_0x6003('0x2c')],_0x5e0140[_0x6003('0x2e')]);_0x45e3cb['attributes']=_[_0x6003('0x32')](_0x5e0140[_0x6003('0x2c')],qs[_0x6003('0x43')](_0x828376['query'][_0x6003('0x43')]));_0x45e3cb[_0x6003('0x33')]=_0x45e3cb[_0x6003('0x33')][_0x6003('0x34')]?_0x45e3cb[_0x6003('0x33')]:_0x5e0140['model'];if(!_0x828376[_0x6003('0x2e')]['hasOwnProperty']('nolimit')){_0x45e3cb[_0x6003('0x1e')]=qs[_0x6003('0x1e')](_0x828376['query'][_0x6003('0x1e')]);_0x45e3cb[_0x6003('0x1d')]=qs[_0x6003('0x1d')](_0x828376[_0x6003('0x2e')][_0x6003('0x1d')]);}_0x45e3cb[_0x6003('0x4c')]=qs[_0x6003('0x36')](_0x828376['query'][_0x6003('0x36')]);_0x45e3cb[_0x6003('0x37')]=qs['filters'](_[_0x6003('0x4d')](_0x828376[_0x6003('0x2e')],_0x5e0140[_0x6003('0x31')]));_0x45e3cb[_0x6003('0x37')][_0x6003('0x4e')]=_0x1446ad['id'];if(_0x828376[_0x6003('0x2e')][_0x6003('0x3b')]){_0x45e3cb['where']=_['merge'](_0x45e3cb[_0x6003('0x37')],{'$or':_[_0x6003('0x4f')](_0x45e3cb[_0x6003('0x33')],function(_0x46b27b){var _0x2300d3={};_0x2300d3[_0x46b27b]={'$like':'%'+_0x828376[_0x6003('0x2e')]['filter']+'%'};return _0x2300d3;})});}_0x45e3cb=_['merge']({},_0x45e3cb,_0x828376[_0x6003('0x3c')]);return db[_0x6003('0x4b')][_0x6003('0x50')](_0x45e3cb);}})[_0x6003('0x3d')](function(_0xcd2a47){if(_0xcd2a47){return db['User'][_0x6003('0x51')]({'where':{'id':_[_0x6003('0x4f')](_0xcd2a47,'UserId'),'role':_0x6003('0x52')},'attributes':['id',_0x6003('0x28'),_0x6003('0x53'),_0x6003('0x54'),_0x6003('0x55')]});}})['then'](function(_0xc54043){if(_0xc54043){return{'count':_0xc54043[_0x6003('0x1c')],'rows':_[_0x6003('0x4f')](_0xc54043[_0x6003('0x40')],function(_0x5b2d6b){return{'membername':_0x5b2d6b[_0x6003('0x28')],'UserId':_0x5b2d6b['id'],'queue_name':_0x4d49b9[_0x6003('0x28')],'OpenchannelQueueId':_0x4d49b9['id'],'interface':util[_0x6003('0x56')]('%s/%s','SIP',_0x5b2d6b[_0x6003('0x28')]),'penalty':0x0,'paused':_0x5b2d6b[_0x6003('0x53')],'createdAt':_0x5b2d6b[_0x6003('0x55')],'updatedAt':_0x5b2d6b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x307b88,_0x45e3cb))[_0x6003('0x41')](handleError(_0x307b88,null));};exports[_0x6003('0x57')]=function(_0x5076ee,_0x460b62,_0x382540){var _0xb83782={};var _0x582945={};var _0x34d454;var _0x126b35;return db[_0x6003('0x2a')]['findOne']({'where':{'id':_0x5076ee[_0x6003('0x42')]['id']}})[_0x6003('0x3d')](handleEntityNotFound(_0x460b62,null))[_0x6003('0x3d')](function(_0x36cd2f){if(_0x36cd2f){_0x34d454=_0x36cd2f;_0x582945[_0x6003('0x2c')]=_['keys'](db[_0x6003('0x58')][_0x6003('0x2b')]);_0x582945[_0x6003('0x2e')]=_[_0x6003('0x2d')](_0x5076ee[_0x6003('0x2e')]);_0x582945[_0x6003('0x31')]=_[_0x6003('0x32')](_0x582945[_0x6003('0x2c')],_0x582945[_0x6003('0x2e')]);_0xb83782[_0x6003('0x33')]=_[_0x6003('0x32')](_0x582945[_0x6003('0x2c')],qs[_0x6003('0x43')](_0x5076ee['query'][_0x6003('0x43')]));_0xb83782[_0x6003('0x33')]=_0xb83782[_0x6003('0x33')][_0x6003('0x34')]?_0xb83782[_0x6003('0x33')]:_0x582945['model'];_0xb83782[_0x6003('0x4c')]=qs[_0x6003('0x36')](_0x5076ee[_0x6003('0x2e')][_0x6003('0x36')]);_0xb83782[_0x6003('0x37')]=qs['filters'](_[_0x6003('0x4d')](_0x5076ee[_0x6003('0x2e')],_0x582945['filters']));if(_0x5076ee[_0x6003('0x2e')][_0x6003('0x3b')]){_0xb83782[_0x6003('0x37')]=_[_0x6003('0x3a')](_0xb83782[_0x6003('0x37')],{'$or':_[_0x6003('0x4f')](_0xb83782[_0x6003('0x33')],function(_0x47b0e4){var _0x38dc7c={};_0x38dc7c[_0x47b0e4]={'$like':'%'+_0x5076ee['query']['filter']+'%'};return _0x38dc7c;})});}_0xb83782=_['merge']({},_0xb83782,_0x5076ee[_0x6003('0x3c')]);return _0x34d454[_0x6003('0x57')](_0xb83782);}})['then'](function(_0x260297){if(_0x260297){_0x126b35=_0x260297[_0x6003('0x34')];if(!_0x5076ee['query'][_0x6003('0x59')](_0x6003('0x35'))){_0xb83782[_0x6003('0x1e')]=qs[_0x6003('0x1e')](_0x5076ee[_0x6003('0x2e')][_0x6003('0x1e')]);_0xb83782['offset']=qs[_0x6003('0x1d')](_0x5076ee['query']['offset']);}return _0x34d454[_0x6003('0x57')](_0xb83782);}})['then'](function(_0x197c26){if(_0x197c26){return _0x197c26?{'count':_0x126b35,'rows':_0x197c26}:null;}})[_0x6003('0x3d')](respondWithResult(_0x460b62,null))[_0x6003('0x41')](handleError(_0x460b62,null));};exports['addTeams']=function(_0x37c983,_0x3aacfc,_0x1aa154){var _0x968e4c=[];var _0x130324;return db['Team'][_0x6003('0x50')]({'where':{'id':_0x37c983[_0x6003('0x47')][_0x6003('0x5a')]},'attributes':['id'],'include':[{'model':db[_0x6003('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](function(_0xd67db8){if(_0xd67db8){for(var _0x4eba1e=0x0;_0x4eba1e<_0xd67db8[_0x6003('0x34')];_0x4eba1e+=0x1){for(var _0x27aea7=0x0;_0x27aea7<_0xd67db8[_0x4eba1e][_0x6003('0x5c')]['length'];_0x27aea7+=0x1){_0x968e4c=_['union'](_0x968e4c,[_0xd67db8[_0x4eba1e]['Agents'][_0x27aea7]['id']]);}}return _0x968e4c;}})[_0x6003('0x3d')](function(_0x212af3){if(_0x212af3){return db[_0x6003('0x2a')]['find']({'where':{'id':_0x37c983[_0x6003('0x42')]['id']}});}})[_0x6003('0x3d')](function(_0x2b6058){if(_0x2b6058){_0x130324=_0x2b6058;return _0x130324[_0x6003('0x5d')](_0x968e4c,{'penalty':_0x37c983[_0x6003('0x47')][_0x6003('0x5e')]});}})['then'](function(_0x4fb850){if(_0x4fb850){return _0x130324[_0x6003('0x5f')](_0x37c983['body'][_0x6003('0x5a')]);}})['then'](handleEntityNotFound(_0x3aacfc,null))['then'](respondWithStatusCode(_0x3aacfc,null))[_0x6003('0x41')](handleError(_0x3aacfc,null));};exports['removeTeams']=function(_0x358079,_0x3b2fb4,_0x22f223){var _0x3d4ac1=[];var _0x46582f;return db['Team'][_0x6003('0x50')]({'where':{'id':_0x358079[_0x6003('0x2e')][_0x6003('0x5a')]},'attributes':['id'],'include':[{'model':db[_0x6003('0x5b')],'as':_0x6003('0x5c'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x117ac0){if(_0x117ac0){for(var _0x5ad752=0x0;_0x5ad752<_0x117ac0[_0x6003('0x34')];_0x5ad752+=0x1){for(var _0x521b32=0x0;_0x521b32<_0x117ac0[_0x5ad752][_0x6003('0x5c')][_0x6003('0x34')];_0x521b32+=0x1){_0x3d4ac1=_[_0x6003('0x60')](_0x3d4ac1,[_0x117ac0[_0x5ad752][_0x6003('0x5c')][_0x521b32]['id']]);}}return _0x3d4ac1;}})[_0x6003('0x3d')](function(_0xa609ec){if(_0xa609ec){return db[_0x6003('0x2a')][_0x6003('0x44')]({'where':{'id':_0x358079[_0x6003('0x42')]['id']}});}})[_0x6003('0x3d')](function(_0x2456a4){if(_0x2456a4){_0x46582f=_0x2456a4;return _0x46582f['removeAgents'](_0x3d4ac1);}})[_0x6003('0x3d')](function(_0x4a8094){if(_0x46582f){return _0x46582f[_0x6003('0x61')](_0x358079[_0x6003('0x2e')][_0x6003('0x5a')]);}})[_0x6003('0x3d')](handleEntityNotFound(_0x3b2fb4,null))[_0x6003('0x3d')](respondWithStatusCode(_0x3b2fb4,null))['catch'](handleError(_0x3b2fb4,null));};exports[_0x6003('0x5d')]=function(_0x943efc,_0x54a501,_0x2bf52f){return db[_0x6003('0x2a')]['find']({'where':{'id':_0x943efc[_0x6003('0x42')]['id']}})[_0x6003('0x3d')](handleEntityNotFound(_0x54a501,null))[_0x6003('0x3d')](function(_0x228613){if(_0x228613){return _0x228613[_0x6003('0x5d')](_0x943efc[_0x6003('0x47')]['ids'],_[_0x6003('0x62')](_0x943efc[_0x6003('0x47')],[_0x6003('0x5a'),'id'])||{})[_0x6003('0x63')](function(_0x2cb483){for(var _0x3ad4d0=0x0;_0x3ad4d0<_0x943efc['body'][_0x6003('0x5a')]['length'];_0x3ad4d0+=0x1){socket[_0x6003('0x64')](_0x6003('0x65'),{'UserId':_0x943efc['body'][_0x6003('0x5a')][_0x3ad4d0],'OpenchannelQueueId':_0x943efc[_0x6003('0x42')]['id']});}return _0x2cb483;});}})[_0x6003('0x3d')](respondWithResult(_0x54a501,null))[_0x6003('0x41')](handleError(_0x54a501,null));};exports[_0x6003('0x66')]=function(_0x2c199b,_0x22ae6f,_0x151523){var _0x1c01b3;return db['OpenchannelQueue'][_0x6003('0x44')]({'where':{'id':_0x2c199b[_0x6003('0x42')]['id']}})[_0x6003('0x3d')](handleEntityNotFound(_0x22ae6f,null))['then'](function(_0x3f32ea){if(_0x3f32ea){return _0x3f32ea[_0x6003('0x66')](_0x2c199b['query'][_0x6003('0x5a')])[_0x6003('0x3d')](function(_0x182350){if(_[_0x6003('0x67')](_0x2c199b[_0x6003('0x2e')][_0x6003('0x5a')])){for(var _0x365350=0x0;_0x365350<_0x2c199b[_0x6003('0x2e')][_0x6003('0x5a')]['length'];_0x365350+=0x1){socket[_0x6003('0x64')](_0x6003('0x68'),{'UserId':_0x2c199b[_0x6003('0x2e')][_0x6003('0x5a')][_0x365350],'OpenchannelQueueId':_0x2c199b['params']['id']});}}else{socket[_0x6003('0x64')](_0x6003('0x68'),{'UserId':_0x2c199b[_0x6003('0x2e')]['ids'],'OpenchannelQueueId':_0x2c199b[_0x6003('0x42')]['id']});}});}})[_0x6003('0x3d')](respondWithStatusCode(_0x22ae6f,null))[_0x6003('0x41')](handleError(_0x22ae6f,null));};exports[_0x6003('0x69')]=function(_0x1b6bb4,_0xe0e85a,_0x35195d){var _0x3bec86={};var _0x4e3e21={};var _0x208c00;var _0x48b6dc;return db[_0x6003('0x2a')][_0x6003('0x6a')]({'where':{'id':_0x1b6bb4[_0x6003('0x42')]['id']}})[_0x6003('0x3d')](handleEntityNotFound(_0xe0e85a,null))['then'](function(_0x56b0d9){if(_0x56b0d9){_0x208c00=_0x56b0d9;_0x4e3e21[_0x6003('0x2c')]=_[_0x6003('0x2d')](db[_0x6003('0x5b')][_0x6003('0x2b')]);_0x4e3e21['query']=_['keys'](_0x1b6bb4[_0x6003('0x2e')]);_0x4e3e21[_0x6003('0x31')]=_['intersection'](_0x4e3e21[_0x6003('0x2c')],_0x4e3e21[_0x6003('0x2e')]);_0x3bec86['attributes']=_[_0x6003('0x32')](_0x4e3e21[_0x6003('0x2c')],qs[_0x6003('0x43')](_0x1b6bb4[_0x6003('0x2e')][_0x6003('0x43')]));_0x3bec86[_0x6003('0x33')]=_0x3bec86[_0x6003('0x33')][_0x6003('0x34')]?_0x3bec86[_0x6003('0x33')]:_0x4e3e21[_0x6003('0x2c')];_0x3bec86[_0x6003('0x4c')]=qs[_0x6003('0x36')](_0x1b6bb4[_0x6003('0x2e')][_0x6003('0x36')]);_0x3bec86[_0x6003('0x37')]=qs[_0x6003('0x31')](_[_0x6003('0x4d')](_0x1b6bb4[_0x6003('0x2e')],_0x4e3e21[_0x6003('0x31')]));if(_0x1b6bb4[_0x6003('0x2e')][_0x6003('0x3b')]){_0x3bec86[_0x6003('0x37')]=_[_0x6003('0x3a')](_0x3bec86[_0x6003('0x37')],{'$or':_['map'](_0x3bec86['attributes'],function(_0x4a044d){var _0x2903de={};_0x2903de[_0x4a044d]={'$like':'%'+_0x1b6bb4['query']['filter']+'%'};return _0x2903de;})});}_0x3bec86=_[_0x6003('0x3a')]({},_0x3bec86,_0x1b6bb4[_0x6003('0x3c')]);return _0x208c00['getAgents'](_0x3bec86);}})[_0x6003('0x3d')](function(_0x50e1df){if(_0x50e1df){_0x48b6dc=_0x50e1df[_0x6003('0x34')];if(!_0x1b6bb4[_0x6003('0x2e')][_0x6003('0x59')](_0x6003('0x35'))){_0x3bec86['limit']=qs['limit'](_0x1b6bb4[_0x6003('0x2e')][_0x6003('0x1e')]);_0x3bec86[_0x6003('0x1d')]=qs['offset'](_0x1b6bb4[_0x6003('0x2e')]['offset']);}return _0x208c00[_0x6003('0x69')](_0x3bec86);}})['then'](function(_0x5e1bd0){if(_0x5e1bd0){return _0x5e1bd0?{'count':_0x48b6dc,'rows':_0x5e1bd0}:null;}})[_0x6003('0x3d')](respondWithResult(_0xe0e85a,null))['catch'](handleError(_0xe0e85a,null));};
\ No newline at end of file
index a068b8d..34a03c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f4d=['save','update','remove','emit','hook','exports','../../mysqldb'];(function(_0x239131,_0x2aa120){var _0x247bec=function(_0x2c4000){while(--_0x2c4000){_0x239131['push'](_0x239131['shift']());}};_0x247bec(++_0x2aa120);}(_0x7f4d,0x164));var _0xd7f4=function(_0x1684c6,_0x1fd6d6){_0x1684c6=_0x1684c6-0x0;var _0x2ab9e0=_0x7f4d[_0x1684c6];return _0x2ab9e0;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xd7f4('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd7f4('0x1'),'afterUpdate':_0xd7f4('0x2'),'afterDestroy':_0xd7f4('0x3')};function emitEvent(_0x24e089){return function(_0x4822c0,_0x41c1fb,_0x5b01d2){OpenchannelQueueEvents['emit'](_0x24e089+':'+_0x4822c0['id'],_0x4822c0);OpenchannelQueueEvents[_0xd7f4('0x4')](_0x24e089,_0x4822c0);_0x5b01d2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xd7f4('0x5')](e,emitEvent(event));}}module[_0xd7f4('0x6')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x88bb=['../../mysqldb','OpenchannelQueue','setMaxListeners','remove','emit','hasOwnProperty','hook','events'];(function(_0x21f89c,_0x11132d){var _0x1980f8=function(_0x518d9e){while(--_0x518d9e){_0x21f89c['push'](_0x21f89c['shift']());}};_0x1980f8(++_0x11132d);}(_0x88bb,0xd7));var _0xb88b=function(_0x419ca9,_0x3b8ae2){_0x419ca9=_0x419ca9-0x0;var _0x17235a=_0x88bb[_0x419ca9];return _0x17235a;};'use strict';var EventEmitter=require(_0xb88b('0x0'));var OpenchannelQueue=require(_0xb88b('0x1'))['db'][_0xb88b('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xb88b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb88b('0x4')};function emitEvent(_0x3d5ac4){return function(_0x26dfed,_0x2df944,_0xd694e3){OpenchannelQueueEvents[_0xb88b('0x5')](_0x3d5ac4+':'+_0x26dfed['id'],_0x26dfed);OpenchannelQueueEvents[_0xb88b('0x5')](_0x3d5ac4,_0x26dfed);_0xd694e3(null);};}for(var e in events){if(events[_0xb88b('0x6')](e)){var event=events[e];OpenchannelQueue[_0xb88b('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents;
\ No newline at end of file
index 4a8b0eb..0d651fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68fc=['bluebird','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x68fc,0xa5));var _0xc68f=function(_0x430aa3,_0x541230){_0x430aa3=_0x430aa3-0x0;var _0x467033=_0x68fc[_0x430aa3];return _0x467033;};'use strict';var _=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var logger=require(_0xc68f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc68f('0x3'));var rp=require('request-promise');var attributes=require(_0xc68f('0x4'));module['exports']=function(_0x5899ea,_0x3b2744){return _0x5899ea[_0xc68f('0x5')](_0xc68f('0x6'),attributes,{'tableName':_0xc68f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x39cb=['bluebird','./openchannelQueue.attributes','exports','define','openchannel_queues','util','../../config/logger','moment'];(function(_0x1da479,_0x155c44){var _0x174ccd=function(_0x2667ab){while(--_0x2667ab){_0x1da479['push'](_0x1da479['shift']());}};_0x174ccd(++_0x155c44);}(_0x39cb,0x1bd));var _0xb39c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x39cb[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0xb39c('0x0'));var logger=require(_0xb39c('0x1'))('api');var moment=require(_0xb39c('0x2'));var BPromise=require(_0xb39c('0x3'));var rp=require('request-promise');var attributes=require(_0xb39c('0x4'));module[_0xb39c('0x5')]=function(_0x398d07,_0x2bca14){return _0x398d07[_0xb39c('0x6')]('OpenchannelQueue',attributes,{'tableName':_0xb39c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 961b3ab..4818347 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3ef=['ShowOpenchannelQueue','find','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','socket.io-emitter','localhost','./openchannelQueue.socket','register','request','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0xb24b6d,_0x49f15e){var _0xc88ebd=function(_0x310bd5){while(--_0x310bd5){_0xb24b6d['push'](_0xb24b6d['shift']());}};_0xc88ebd(++_0x49f15e);}(_0xb3ef,0xc0));var _0xfb3e=function(_0x1be8f9,_0x8aa8a8){_0x1be8f9=_0x1be8f9-0x0;var _0x596ec5=_0xb3ef[_0x1be8f9];return _0x596ec5;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xfb3e('0x0'));var rs=require(_0xfb3e('0x1'));var fs=require('fs');var db=require(_0xfb3e('0x2'))['db'];var utils=require(_0xfb3e('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xfb3e('0x4'));var jayson=require(_0xfb3e('0x5'));var client=jayson[_0xfb3e('0x6')][_0xfb3e('0x7')]({'port':0x232a});var socket=require(_0xfb3e('0x8'))({'host':_0xfb3e('0x9'),'port':0x18eb});require(_0xfb3e('0xa'))[_0xfb3e('0xb')](socket);function respondWithRpcPromise(_0x11b812,_0x3c18dc,_0x513d77){return new BPromise(function(_0x41692c,_0x2464f1){return client[_0xfb3e('0xc')](_0x11b812,_0x513d77)[_0xfb3e('0xd')](function(_0x50a215){logger[_0xfb3e('0xe')]('OpenchannelQueue,\x20%s,\x20%s',_0x3c18dc,_0xfb3e('0xf'));logger[_0xfb3e('0x10')](_0xfb3e('0x11'),_0x3c18dc,_0xfb3e('0xf'),JSON[_0xfb3e('0x12')](_0x50a215));if(_0x50a215['error']){if(_0x50a215[_0xfb3e('0x13')][_0xfb3e('0x14')]===0x1f4){logger[_0xfb3e('0x13')](_0xfb3e('0x15'),_0x3c18dc,_0x50a215[_0xfb3e('0x13')][_0xfb3e('0x16')]);return _0x2464f1(_0x50a215['error'][_0xfb3e('0x16')]);}logger[_0xfb3e('0x13')](_0xfb3e('0x15'),_0x3c18dc,_0x50a215[_0xfb3e('0x13')][_0xfb3e('0x16')]);return _0x41692c(_0x50a215[_0xfb3e('0x13')][_0xfb3e('0x16')]);}else{logger[_0xfb3e('0xe')](_0xfb3e('0x15'),_0x3c18dc,_0xfb3e('0xf'));_0x41692c(_0x50a215[_0xfb3e('0x17')][_0xfb3e('0x16')]);}})[_0xfb3e('0x18')](function(_0x4cd304){logger['error'](_0xfb3e('0x15'),_0x3c18dc,_0x4cd304);_0x2464f1(_0x4cd304);});});}exports[_0xfb3e('0x19')]=function(_0x593280){var _0x3cb337=this;return new Promise(function(_0x3b37de,_0x3aa6db){return db[_0xfb3e('0x1a')][_0xfb3e('0x1b')]({'raw':_0x593280['options']?_0x593280[_0xfb3e('0x1c')][_0xfb3e('0x1d')]===undefined?!![]:![]:!![],'where':_0x593280['options']?_0x593280[_0xfb3e('0x1c')][_0xfb3e('0x1e')]||null:null,'attributes':_0x593280['options']?_0x593280['options'][_0xfb3e('0x1f')]||null:null,'limit':_0x593280[_0xfb3e('0x1c')]?_0x593280[_0xfb3e('0x1c')][_0xfb3e('0x20')]||null:null,'include':_0x593280[_0xfb3e('0x1c')]?_0x593280['options'][_0xfb3e('0x21')]?_[_0xfb3e('0x22')](_0x593280['options'][_0xfb3e('0x21')],function(_0x36972a){return{'model':db[_0x36972a[_0xfb3e('0x23')]],'as':_0x36972a['as'],'attributes':_0x36972a['attributes'],'include':_0x36972a[_0xfb3e('0x21')]?_[_0xfb3e('0x22')](_0x36972a['include'],function(_0x4aa5b9){return{'model':db[_0x4aa5b9['model']],'as':_0x4aa5b9['as'],'attributes':_0x4aa5b9[_0xfb3e('0x1f')],'include':_0x4aa5b9[_0xfb3e('0x21')]?_['map'](_0x4aa5b9[_0xfb3e('0x21')],function(_0x5ca301){return{'model':db[_0x5ca301[_0xfb3e('0x23')]],'as':_0x5ca301['as'],'attributes':_0x5ca301[_0xfb3e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfb3e('0xd')](function(_0x4a730f){logger[_0xfb3e('0xe')](_0xfb3e('0x19'),_0x593280);logger['debug']('GetOpenchannelQueue',_0x593280,JSON[_0xfb3e('0x12')](_0x4a730f));_0x3b37de(_0x4a730f);})['catch'](function(_0x51307b){logger['error']('GetOpenchannelQueue',_0x51307b[_0xfb3e('0x16')],_0x593280);_0x3aa6db(_0x3cb337[_0xfb3e('0x13')](0x1f4,_0x51307b['message']));});});};exports[_0xfb3e('0x24')]=function(_0x443a94){var _0x1d7a4f=this;return new Promise(function(_0x12592f,_0x23fce2){return db[_0xfb3e('0x1a')][_0xfb3e('0x25')]({'raw':_0x443a94[_0xfb3e('0x1c')]?_0x443a94['options'][_0xfb3e('0x1d')]===undefined?!![]:![]:!![],'where':_0x443a94[_0xfb3e('0x1c')]?_0x443a94[_0xfb3e('0x1c')][_0xfb3e('0x1e')]||null:null,'attributes':_0x443a94[_0xfb3e('0x1c')]?_0x443a94[_0xfb3e('0x1c')][_0xfb3e('0x1f')]||null:null,'include':_0x443a94['options']?_0x443a94[_0xfb3e('0x1c')]['include']?_['map'](_0x443a94[_0xfb3e('0x1c')][_0xfb3e('0x21')],function(_0x407b08){return{'model':db[_0x407b08['model']],'as':_0x407b08['as'],'attributes':_0x407b08[_0xfb3e('0x1f')],'include':_0x407b08[_0xfb3e('0x21')]?_[_0xfb3e('0x22')](_0x407b08[_0xfb3e('0x21')],function(_0x452125){return{'model':db[_0x452125[_0xfb3e('0x23')]],'as':_0x452125['as'],'attributes':_0x452125['attributes'],'include':_0x452125[_0xfb3e('0x21')]?_[_0xfb3e('0x22')](_0x452125['include'],function(_0x39ee32){return{'model':db[_0x39ee32[_0xfb3e('0x23')]],'as':_0x39ee32['as'],'attributes':_0x39ee32[_0xfb3e('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5590e6){logger[_0xfb3e('0xe')](_0xfb3e('0x24'),_0x443a94);logger[_0xfb3e('0x10')](_0xfb3e('0x24'),_0x443a94,JSON['stringify'](_0x5590e6));_0x12592f(_0x5590e6);})[_0xfb3e('0x18')](function(_0x364a2e){logger[_0xfb3e('0x13')](_0xfb3e('0x24'),_0x364a2e[_0xfb3e('0x16')],_0x443a94);_0x23fce2(_0x1d7a4f['error'](0x1f4,_0x364a2e[_0xfb3e('0x16')]));});});};
\ No newline at end of file
+var _0xcf23=['map','model','catch','find','attributes','then','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','socket.io-emitter','localhost','./openchannelQueue.socket','register','request','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','limit','include'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0xcf23,0x75));var _0x3cf2=function(_0x5a1111,_0x15f321){_0x5a1111=_0x5a1111-0x0;var _0x1238b4=_0xcf23[_0x5a1111];return _0x1238b4;};'use strict';var _=require('lodash');var util=require(_0x3cf2('0x0'));var moment=require(_0x3cf2('0x1'));var BPromise=require(_0x3cf2('0x2'));var rs=require(_0x3cf2('0x3'));var fs=require('fs');var db=require(_0x3cf2('0x4'))['db'];var utils=require(_0x3cf2('0x5'));var logger=require('../../config/logger')(_0x3cf2('0x6'));var config=require(_0x3cf2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3cf2('0x8')][_0x3cf2('0x9')]({'port':0x232a});var socket=require(_0x3cf2('0xa'))({'host':_0x3cf2('0xb'),'port':0x18eb});require(_0x3cf2('0xc'))[_0x3cf2('0xd')](socket);function respondWithRpcPromise(_0x4e53cb,_0xab94e2,_0x35c7b5){return new BPromise(function(_0x3317e2,_0x32d2c9){return client[_0x3cf2('0xe')](_0x4e53cb,_0x35c7b5)['then'](function(_0x49368b){logger[_0x3cf2('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0xab94e2,_0x3cf2('0x10'));logger[_0x3cf2('0x11')](_0x3cf2('0x12'),_0xab94e2,_0x3cf2('0x10'),JSON[_0x3cf2('0x13')](_0x49368b));if(_0x49368b['error']){if(_0x49368b[_0x3cf2('0x14')][_0x3cf2('0x15')]===0x1f4){logger[_0x3cf2('0x14')](_0x3cf2('0x16'),_0xab94e2,_0x49368b[_0x3cf2('0x14')][_0x3cf2('0x17')]);return _0x32d2c9(_0x49368b[_0x3cf2('0x14')]['message']);}logger[_0x3cf2('0x14')](_0x3cf2('0x16'),_0xab94e2,_0x49368b[_0x3cf2('0x14')][_0x3cf2('0x17')]);return _0x3317e2(_0x49368b[_0x3cf2('0x14')][_0x3cf2('0x17')]);}else{logger[_0x3cf2('0xf')](_0x3cf2('0x16'),_0xab94e2,_0x3cf2('0x10'));_0x3317e2(_0x49368b['result']['message']);}})['catch'](function(_0x296627){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0xab94e2,_0x296627);_0x32d2c9(_0x296627);});});}exports[_0x3cf2('0x18')]=function(_0x50df44){var _0x4be1f4=this;return new Promise(function(_0x106ebf,_0x3dbddf){return db[_0x3cf2('0x19')][_0x3cf2('0x1a')]({'raw':_0x50df44[_0x3cf2('0x1b')]?_0x50df44['options'][_0x3cf2('0x1c')]===undefined?!![]:![]:!![],'where':_0x50df44[_0x3cf2('0x1b')]?_0x50df44[_0x3cf2('0x1b')]['where']||null:null,'attributes':_0x50df44['options']?_0x50df44[_0x3cf2('0x1b')]['attributes']||null:null,'limit':_0x50df44[_0x3cf2('0x1b')]?_0x50df44[_0x3cf2('0x1b')][_0x3cf2('0x1d')]||null:null,'include':_0x50df44['options']?_0x50df44[_0x3cf2('0x1b')][_0x3cf2('0x1e')]?_[_0x3cf2('0x1f')](_0x50df44['options'][_0x3cf2('0x1e')],function(_0x2252bd){return{'model':db[_0x2252bd['model']],'as':_0x2252bd['as'],'attributes':_0x2252bd['attributes'],'include':_0x2252bd[_0x3cf2('0x1e')]?_[_0x3cf2('0x1f')](_0x2252bd[_0x3cf2('0x1e')],function(_0xce0be8){return{'model':db[_0xce0be8[_0x3cf2('0x20')]],'as':_0xce0be8['as'],'attributes':_0xce0be8['attributes'],'include':_0xce0be8[_0x3cf2('0x1e')]?_['map'](_0xce0be8[_0x3cf2('0x1e')],function(_0x37e608){return{'model':db[_0x37e608['model']],'as':_0x37e608['as'],'attributes':_0x37e608['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x33b7fa){logger[_0x3cf2('0xf')]('GetOpenchannelQueue',_0x50df44);logger[_0x3cf2('0x11')](_0x3cf2('0x18'),_0x50df44,JSON[_0x3cf2('0x13')](_0x33b7fa));_0x106ebf(_0x33b7fa);})[_0x3cf2('0x21')](function(_0x5325a9){logger[_0x3cf2('0x14')]('GetOpenchannelQueue',_0x5325a9[_0x3cf2('0x17')],_0x50df44);_0x3dbddf(_0x4be1f4['error'](0x1f4,_0x5325a9[_0x3cf2('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0x3fbc7c){var _0x50bb22=this;return new Promise(function(_0x22596d,_0x1ed2ae){return db['OpenchannelQueue'][_0x3cf2('0x22')]({'raw':_0x3fbc7c[_0x3cf2('0x1b')]?_0x3fbc7c[_0x3cf2('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3fbc7c[_0x3cf2('0x1b')]?_0x3fbc7c[_0x3cf2('0x1b')]['where']||null:null,'attributes':_0x3fbc7c[_0x3cf2('0x1b')]?_0x3fbc7c[_0x3cf2('0x1b')]['attributes']||null:null,'include':_0x3fbc7c[_0x3cf2('0x1b')]?_0x3fbc7c[_0x3cf2('0x1b')][_0x3cf2('0x1e')]?_[_0x3cf2('0x1f')](_0x3fbc7c['options']['include'],function(_0x45e5fa){return{'model':db[_0x45e5fa[_0x3cf2('0x20')]],'as':_0x45e5fa['as'],'attributes':_0x45e5fa[_0x3cf2('0x23')],'include':_0x45e5fa[_0x3cf2('0x1e')]?_[_0x3cf2('0x1f')](_0x45e5fa[_0x3cf2('0x1e')],function(_0x278299){return{'model':db[_0x278299[_0x3cf2('0x20')]],'as':_0x278299['as'],'attributes':_0x278299[_0x3cf2('0x23')],'include':_0x278299['include']?_[_0x3cf2('0x1f')](_0x278299['include'],function(_0x418705){return{'model':db[_0x418705[_0x3cf2('0x20')]],'as':_0x418705['as'],'attributes':_0x418705[_0x3cf2('0x23')]};}):[]};}):[]};}):[]:[]})[_0x3cf2('0x24')](function(_0x4265ad){logger[_0x3cf2('0xf')]('ShowOpenchannelQueue',_0x3fbc7c);logger[_0x3cf2('0x11')]('ShowOpenchannelQueue',_0x3fbc7c,JSON[_0x3cf2('0x13')](_0x4265ad));_0x22596d(_0x4265ad);})[_0x3cf2('0x21')](function(_0x49e46b){logger[_0x3cf2('0x14')]('ShowOpenchannelQueue',_0x49e46b[_0x3cf2('0x17')],_0x3fbc7c);_0x1ed2ae(_0x50bb22[_0x3cf2('0x14')](0x1f4,_0x49e46b['message']));});});};
\ No newline at end of file
index 6c5d2af..faa4cf1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.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(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var OpenchannelQueueEvents=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(){OpenchannelQueueEvents[_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);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var OpenchannelQueueEvents=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(){OpenchannelQueueEvents[_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);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index dcb0d8c..e8cf7d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2914=['Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','/:id','create','update','exports','multer','util','express'];(function(_0xfab3bd,_0x4c0d0f){var _0x37d00b=function(_0x4b6cf7){while(--_0x4b6cf7){_0xfab3bd['push'](_0xfab3bd['shift']());}};_0x37d00b(++_0x4c0d0f);}(_0x2914,0x115));var _0x4291=function(_0x5dde9b,_0x3d2a11){_0x5dde9b=_0x5dde9b-0x0;var _0x27eb7f=_0x2914[_0x5dde9b];return _0x27eb7f;};'use strict';var multer=require(_0x4291('0x0'));var util=require(_0x4291('0x1'));var path=require('path');var express=require(_0x4291('0x2'));var router=express[_0x4291('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4291('0x4'));var config=require(_0x4291('0x5'));var controller=require(_0x4291('0x6'));router['get']('/',auth[_0x4291('0x7')](),controller[_0x4291('0x8')]);router[_0x4291('0x9')]('/describe',auth[_0x4291('0x7')](),controller['describe']);router[_0x4291('0x9')](_0x4291('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x4291('0x7')](),controller[_0x4291('0xb')]);router['put'](_0x4291('0xa'),auth['isAuthenticated'](),controller[_0x4291('0xc')]);router['delete'](_0x4291('0xa'),auth[_0x4291('0x7')](),controller['destroy']);module[_0x4291('0xd')]=router;
\ No newline at end of file
+var _0x8f01=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','exports'];(function(_0x2a21bc,_0x29f0db){var _0x4f93a3=function(_0x3dd7e9){while(--_0x3dd7e9){_0x2a21bc['push'](_0x2a21bc['shift']());}};_0x4f93a3(++_0x29f0db);}(_0x8f01,0x140));var _0x18f0=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x8f01[_0x5c2e3e];return _0x53f64a;};'use strict';var multer=require(_0x18f0('0x0'));var util=require('util');var path=require(_0x18f0('0x1'));var express=require(_0x18f0('0x2'));var router=express[_0x18f0('0x3')]();var auth=require(_0x18f0('0x4'));var interaction=require(_0x18f0('0x5'));var config=require(_0x18f0('0x6'));var controller=require(_0x18f0('0x7'));router[_0x18f0('0x8')]('/',auth[_0x18f0('0x9')](),controller[_0x18f0('0xa')]);router[_0x18f0('0x8')](_0x18f0('0xb'),auth['isAuthenticated'](),controller[_0x18f0('0xc')]);router['get'](_0x18f0('0xd'),auth[_0x18f0('0x9')](),controller[_0x18f0('0xe')]);router[_0x18f0('0xf')]('/',auth[_0x18f0('0x9')](),controller['create']);router['put'](_0x18f0('0xd'),auth['isAuthenticated'](),controller[_0x18f0('0x10')]);router[_0x18f0('0x11')]('/:id',auth[_0x18f0('0x9')](),controller[_0x18f0('0x12')]);module[_0x18f0('0x13')]=router;
\ No newline at end of file
index 72dceb4..29489f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5616=['sequelize','STRING','DATE'];(function(_0x35316,_0x33f319){var _0x3ca86d=function(_0x2f0aef){while(--_0x2f0aef){_0x35316['push'](_0x35316['shift']());}};_0x3ca86d(++_0x33f319);}(_0x5616,0x1ef));var _0x6561=function(_0x4e46de,_0x265e19){_0x4e46de=_0x4e46de-0x0;var _0xfe88e8=_0x5616[_0x4e46de];return _0xfe88e8;};'use strict';var moment=require('moment');var Sequelize=require(_0x6561('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x6561('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x6561('0x1')]},'joinAt':{'type':Sequelize[_0x6561('0x2')]},'leaveAt':{'type':Sequelize[_0x6561('0x2')]},'acceptAt':{'type':Sequelize[_0x6561('0x2')]},'exitAt':{'type':Sequelize[_0x6561('0x2')]},'reason':{'type':Sequelize[_0x6561('0x1')]}};
\ No newline at end of file
+var _0x849d=['STRING','DATE','sequelize','exports'];(function(_0x21bb54,_0x263125){var _0x1fa2fb=function(_0x172874){while(--_0x172874){_0x21bb54['push'](_0x21bb54['shift']());}};_0x1fa2fb(++_0x263125);}(_0x849d,0x1e6));var _0xd849=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x849d[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0xd849('0x0'));module[_0xd849('0x1')]={'uniqueid':{'type':Sequelize[_0xd849('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd849('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd849('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd849('0x3')]},'reason':{'type':Sequelize[_0xd849('0x2')]}};
\ No newline at end of file
index b78ec8a..4a1d46c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5162=['json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','OpenchannelQueueReport','rawAttributes','model','keys','query','dateEnd','dateStart','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','add','day','merge','where','map','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','html-pdf','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/logger','api','../../config/utils','sendStatus','status','end'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5162,0x103));var _0x2516=function(_0x2d892a,_0x59e61a){_0x2d892a=_0x2d892a-0x0;var _0x367765=_0x5162[_0x2d892a];return _0x367765;};'use strict';var pdf=require(_0x2516('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2516('0x1'));var moment=require(_0x2516('0x2'));var BPromise=require(_0x2516('0x3'));var Mustache=require(_0x2516('0x4'));var util=require(_0x2516('0x5'));var path=require(_0x2516('0x6'));var sox=require(_0x2516('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2516('0x8'));var crypto=require(_0x2516('0x9'));var jsforce=require(_0x2516('0xa'));var deskjs=require(_0x2516('0xb'));var toCsv=require(_0x2516('0xc'));var querystring=require(_0x2516('0xd'));var Papa=require(_0x2516('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0x2516('0xf'))(_0x2516('0x10'));var utils=require(_0x2516('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ba807,_0x4ceaa1){_0x4ceaa1=_0x4ceaa1||0xcc;return function(_0xf83a79){if(_0xf83a79){return _0x4ba807[_0x2516('0x12')](_0x4ceaa1);}return _0x4ba807[_0x2516('0x13')](_0x4ceaa1)[_0x2516('0x14')]();};}function respondWithResult(_0x56c69c,_0x33496b){_0x33496b=_0x33496b||0xc8;return function(_0x458aca){if(_0x458aca){return _0x56c69c[_0x2516('0x13')](_0x33496b)[_0x2516('0x15')](_0x458aca);}};}function respondWithFilteredResult(_0x42c771,_0x558d20){return function(_0x3e5e0f){if(_0x3e5e0f){var _0x2edb47=_0x3e5e0f[_0x2516('0x16')],_0x1b3c7e=_0x558d20[_0x2516('0x17')],_0x181a28=_0x558d20[_0x2516('0x17')]+_0x558d20[_0x2516('0x18')],_0x2637e8;if(_0x181a28>=_0x2edb47){_0x181a28=_0x2edb47;_0x2637e8=0xc8;}else{_0x2637e8=0xce;}_0x42c771['status'](_0x2637e8);return _0x42c771[_0x2516('0x19')](_0x2516('0x1a'),_0x1b3c7e+'-'+_0x181a28+'/'+_0x2edb47)[_0x2516('0x15')](_0x3e5e0f);}return null;};}function patchUpdates(_0x564d05){return function(_0x1979d7){try{jsonpatch['apply'](_0x1979d7,_0x564d05,!![]);}catch(_0x532d46){return BPromise[_0x2516('0x1b')](_0x532d46);}return _0x1979d7[_0x2516('0x1c')]();};}function saveUpdates(_0x151168,_0x618aed){return function(_0x198b93){if(_0x198b93){return _0x198b93[_0x2516('0x1d')](_0x151168)[_0x2516('0x1e')](function(_0x113616){return _0x113616;});}return null;};}function removeEntity(_0x248c5a,_0x37485b){return function(_0x39ba5b){if(_0x39ba5b){return _0x39ba5b[_0x2516('0x1f')]()[_0x2516('0x1e')](function(){_0x248c5a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12db4d,_0x1c8993){return function(_0x24abe0){if(!_0x24abe0){_0x12db4d[_0x2516('0x12')](0x194);}return _0x24abe0;};}function handleError(_0x3ffb6d,_0x32de7a){_0x32de7a=_0x32de7a||0x1f4;return function(_0x3d906d){logger[_0x2516('0x20')](_0x3d906d['stack']);if(_0x3d906d[_0x2516('0x21')]){delete _0x3d906d[_0x2516('0x21')];}_0x3ffb6d[_0x2516('0x13')](_0x32de7a)[_0x2516('0x22')](_0x3d906d);};}exports['index']=function(_0x399c16,_0x30eeb9){var _0x1f722c={},_0x3d728a={},_0xd84b29={'count':0x0,'rows':[]};var _0x4a3dc8=db[_0x2516('0x23')][_0x2516('0x24')];_0x3d728a[_0x2516('0x25')]=_[_0x2516('0x26')](_0x4a3dc8);var _0x38ec50={'dateStart':_0x399c16[_0x2516('0x27')]['dateStart'],'dateEnd':_0x399c16[_0x2516('0x27')][_0x2516('0x28')]};delete _0x399c16['query'][_0x2516('0x29')];delete _0x399c16[_0x2516('0x27')][_0x2516('0x28')];_0x3d728a[_0x2516('0x27')]=_[_0x2516('0x26')](_0x399c16[_0x2516('0x27')]);_0x3d728a[_0x2516('0x2a')]=_[_0x2516('0x2b')](_0x3d728a[_0x2516('0x25')],_0x3d728a[_0x2516('0x27')]);_0x1f722c[_0x2516('0x2c')]=_[_0x2516('0x2b')](_0x3d728a[_0x2516('0x25')],qs[_0x2516('0x2d')](_0x399c16[_0x2516('0x27')]['fields']));_0x1f722c[_0x2516('0x2c')]=_0x1f722c['attributes'][_0x2516('0x2e')]?_0x1f722c['attributes']:_0x3d728a[_0x2516('0x25')];if(!_0x399c16['query'][_0x2516('0x2f')](_0x2516('0x30'))){_0x1f722c[_0x2516('0x18')]=qs[_0x2516('0x18')](_0x399c16[_0x2516('0x27')][_0x2516('0x18')]);_0x1f722c[_0x2516('0x17')]=qs[_0x2516('0x17')](_0x399c16[_0x2516('0x27')]['offset']);}_0x1f722c[_0x2516('0x31')]=qs[_0x2516('0x32')](_0x399c16[_0x2516('0x27')][_0x2516('0x32')]);_0x1f722c['where']=qs['filters'](_[_0x2516('0x33')](_0x399c16[_0x2516('0x27')],_0x3d728a[_0x2516('0x2a')]));if(_0x38ec50[_0x2516('0x29')]){if(_0x38ec50[_0x2516('0x28')]){_0x38ec50[_0x2516('0x28')]=moment(_0x38ec50[_0x2516('0x28')])[_0x2516('0x34')](0x1,_0x2516('0x35'));}else{_0x38ec50[_0x2516('0x28')]=moment(_0x38ec50['dateStart'])['add'](0x1,_0x2516('0x35'));}_[_0x2516('0x36')](_0x1f722c['where'],{'createdAt':{'$gte':_0x38ec50['dateStart'],'$lte':_0x38ec50[_0x2516('0x28')]}});}if(_0x399c16[_0x2516('0x27')]['filter']){_0x1f722c[_0x2516('0x37')]=_['merge'](_0x1f722c[_0x2516('0x37')],{'$or':_[_0x2516('0x38')](_0x1f722c['attributes'],function(_0x978490){var _0x23629d={};_0x23629d[_0x978490]={'$like':'%'+_0x399c16[_0x2516('0x27')][_0x2516('0x39')]+'%'};return _0x23629d;})});}_0x1f722c=_[_0x2516('0x36')]({},_0x1f722c,_0x399c16[_0x2516('0x3a')]);var _0x2137a4={'where':_0x1f722c[_0x2516('0x37')]};return db[_0x2516('0x23')][_0x2516('0x16')](_0x2137a4)[_0x2516('0x1e')](function(_0x431512){_0xd84b29[_0x2516('0x16')]=_0x431512;if(_0x399c16['query'][_0x2516('0x3b')]){_0x1f722c[_0x2516('0x3c')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x2516('0x3d')](_0x1f722c);})[_0x2516('0x1e')](function(_0x2eadc7){_0xd84b29[_0x2516('0x3e')]=_0x2eadc7;return _0xd84b29;})[_0x2516('0x1e')](respondWithFilteredResult(_0x30eeb9,_0x1f722c))['catch'](handleError(_0x30eeb9,null));};exports[_0x2516('0x3f')]=function(_0xe5bc76,_0x160801){var _0x1447de={'raw':!![],'where':{'id':_0xe5bc76[_0x2516('0x40')]['id']}},_0x2f980d={};_0x2f980d['model']=_[_0x2516('0x26')](db[_0x2516('0x23')][_0x2516('0x24')]);_0x2f980d[_0x2516('0x27')]=_[_0x2516('0x26')](_0xe5bc76[_0x2516('0x27')]);_0x2f980d[_0x2516('0x2a')]=_['intersection'](_0x2f980d[_0x2516('0x25')],_0x2f980d['query']);_0x1447de[_0x2516('0x2c')]=_['intersection'](_0x2f980d[_0x2516('0x25')],qs[_0x2516('0x2d')](_0xe5bc76[_0x2516('0x27')]['fields']));_0x1447de['attributes']=_0x1447de[_0x2516('0x2c')][_0x2516('0x2e')]?_0x1447de['attributes']:_0x2f980d['model'];if(_0xe5bc76[_0x2516('0x27')][_0x2516('0x3b')]){_0x1447de[_0x2516('0x3c')]=[{'all':!![]}];}_0x1447de=_['merge']({},_0x1447de,_0xe5bc76[_0x2516('0x3a')]);return db['OpenchannelQueueReport'][_0x2516('0x41')](_0x1447de)[_0x2516('0x1e')](handleEntityNotFound(_0x160801,null))[_0x2516('0x1e')](respondWithResult(_0x160801,null))[_0x2516('0x42')](handleError(_0x160801,null));};exports['create']=function(_0x56d3e5,_0xa08af4){return db[_0x2516('0x23')][_0x2516('0x43')](_0x56d3e5[_0x2516('0x44')],{})['then'](respondWithResult(_0xa08af4,0xc9))[_0x2516('0x42')](handleError(_0xa08af4,null));};exports[_0x2516('0x1d')]=function(_0x3127eb,_0x2e359e){if(_0x3127eb['body']['id']){delete _0x3127eb[_0x2516('0x44')]['id'];}return db[_0x2516('0x23')][_0x2516('0x41')]({'where':{'id':_0x3127eb[_0x2516('0x40')]['id']}})[_0x2516('0x1e')](handleEntityNotFound(_0x2e359e,null))['then'](saveUpdates(_0x3127eb[_0x2516('0x44')],null))[_0x2516('0x1e')](respondWithResult(_0x2e359e,null))[_0x2516('0x42')](handleError(_0x2e359e,null));};exports[_0x2516('0x1f')]=function(_0x1ebe64,_0x23875b){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x1ebe64['params']['id']}})[_0x2516('0x1e')](handleEntityNotFound(_0x23875b,null))['then'](removeEntity(_0x23875b,null))['catch'](handleError(_0x23875b,null));};exports['describe']=function(_0x5e7cb,_0x144e44){return db[_0x2516('0x23')][_0x2516('0x45')]()[_0x2516('0x1e')](respondWithResult(_0x144e44,null))['catch'](handleError(_0x144e44,null));};
\ No newline at end of file
+var _0xa630=['../../mysqldb','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','index','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','limit','sort','where','pick','add','merge','filter','map','options','OpenchannelQueueReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','fast-json-patch','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x156827,_0x3d3418){var _0x15e33a=function(_0x3d050e){while(--_0x3d050e){_0x156827['push'](_0x156827['shift']());}};_0x15e33a(++_0x3d3418);}(_0xa630,0xbe));var _0x0a63=function(_0x353bb8,_0x22beca){_0x353bb8=_0x353bb8-0x0;var _0x4215fe=_0xa630[_0x353bb8];return _0x4215fe;};'use strict';var pdf=require(_0x0a63('0x0'));var emlformat=require(_0x0a63('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0a63('0x2'));var rp=require('request-promise');var moment=require(_0x0a63('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a63('0x4'));var util=require(_0x0a63('0x5'));var path=require(_0x0a63('0x6'));var sox=require(_0x0a63('0x7'));var csv=require(_0x0a63('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0a63('0x9'));var squel=require(_0x0a63('0xa'));var crypto=require(_0x0a63('0xb'));var jsforce=require(_0x0a63('0xc'));var deskjs=require(_0x0a63('0xd'));var toCsv=require(_0x0a63('0x8'));var querystring=require('querystring');var Papa=require(_0x0a63('0xe'));var qs=require(_0x0a63('0xf'));var logger=require(_0x0a63('0x10'))(_0x0a63('0x11'));var utils=require(_0x0a63('0x12'));var config=require(_0x0a63('0x13'));var db=require(_0x0a63('0x14'))['db'];function respondWithStatusCode(_0x22f340,_0x258511){_0x258511=_0x258511||0xcc;return function(_0x1bbf75){if(_0x1bbf75){return _0x22f340['sendStatus'](_0x258511);}return _0x22f340[_0x0a63('0x15')](_0x258511)[_0x0a63('0x16')]();};}function respondWithResult(_0x2fce86,_0x3d6323){_0x3d6323=_0x3d6323||0xc8;return function(_0x55cb2f){if(_0x55cb2f){return _0x2fce86[_0x0a63('0x15')](_0x3d6323)['json'](_0x55cb2f);}};}function respondWithFilteredResult(_0x331e99,_0x19e922){return function(_0x26b2bc){if(_0x26b2bc){var _0x23f8b5=_0x26b2bc[_0x0a63('0x17')],_0x3ea3bb=_0x19e922['offset'],_0x23b49d=_0x19e922[_0x0a63('0x18')]+_0x19e922['limit'],_0x552b1f;if(_0x23b49d>=_0x23f8b5){_0x23b49d=_0x23f8b5;_0x552b1f=0xc8;}else{_0x552b1f=0xce;}_0x331e99[_0x0a63('0x15')](_0x552b1f);return _0x331e99[_0x0a63('0x19')](_0x0a63('0x1a'),_0x3ea3bb+'-'+_0x23b49d+'/'+_0x23f8b5)[_0x0a63('0x1b')](_0x26b2bc);}return null;};}function patchUpdates(_0x1f7481){return function(_0x181507){try{jsonpatch[_0x0a63('0x1c')](_0x181507,_0x1f7481,!![]);}catch(_0x374c52){return BPromise[_0x0a63('0x1d')](_0x374c52);}return _0x181507[_0x0a63('0x1e')]();};}function saveUpdates(_0x2ad167,_0x4ea56f){return function(_0x550568){if(_0x550568){return _0x550568[_0x0a63('0x1f')](_0x2ad167)['then'](function(_0x2fc87c){return _0x2fc87c;});}return null;};}function removeEntity(_0x5937df,_0x58513d){return function(_0x41d6b8){if(_0x41d6b8){return _0x41d6b8[_0x0a63('0x20')]()[_0x0a63('0x21')](function(){_0x5937df['status'](0xcc)[_0x0a63('0x16')]();});}};}function handleEntityNotFound(_0x4c225a,_0x3a7f9d){return function(_0x11fe64){if(!_0x11fe64){_0x4c225a[_0x0a63('0x22')](0x194);}return _0x11fe64;};}function handleError(_0x20c114,_0x343273){_0x343273=_0x343273||0x1f4;return function(_0x1f929f){logger[_0x0a63('0x23')](_0x1f929f[_0x0a63('0x24')]);if(_0x1f929f['name']){delete _0x1f929f['name'];}_0x20c114['status'](_0x343273)['send'](_0x1f929f);};}exports[_0x0a63('0x25')]=function(_0x4916b1,_0x496c93){var _0x2133cf={},_0x1d5448={},_0x362d6a={'count':0x0,'rows':[]};var _0x2e2526=db['OpenchannelQueueReport'][_0x0a63('0x26')];_0x1d5448[_0x0a63('0x27')]=_[_0x0a63('0x28')](_0x2e2526);var _0x5772f8={'dateStart':_0x4916b1[_0x0a63('0x29')][_0x0a63('0x2a')],'dateEnd':_0x4916b1[_0x0a63('0x29')][_0x0a63('0x2b')]};delete _0x4916b1[_0x0a63('0x29')][_0x0a63('0x2a')];delete _0x4916b1[_0x0a63('0x29')][_0x0a63('0x2b')];_0x1d5448['query']=_[_0x0a63('0x28')](_0x4916b1['query']);_0x1d5448[_0x0a63('0x2c')]=_[_0x0a63('0x2d')](_0x1d5448[_0x0a63('0x27')],_0x1d5448[_0x0a63('0x29')]);_0x2133cf[_0x0a63('0x2e')]=_['intersection'](_0x1d5448[_0x0a63('0x27')],qs[_0x0a63('0x2f')](_0x4916b1[_0x0a63('0x29')][_0x0a63('0x2f')]));_0x2133cf['attributes']=_0x2133cf[_0x0a63('0x2e')][_0x0a63('0x30')]?_0x2133cf['attributes']:_0x1d5448['model'];if(!_0x4916b1[_0x0a63('0x29')]['hasOwnProperty']('nolimit')){_0x2133cf[_0x0a63('0x31')]=qs[_0x0a63('0x31')](_0x4916b1['query'][_0x0a63('0x31')]);_0x2133cf[_0x0a63('0x18')]=qs[_0x0a63('0x18')](_0x4916b1[_0x0a63('0x29')][_0x0a63('0x18')]);}_0x2133cf['order']=qs['sort'](_0x4916b1[_0x0a63('0x29')][_0x0a63('0x32')]);_0x2133cf[_0x0a63('0x33')]=qs[_0x0a63('0x2c')](_[_0x0a63('0x34')](_0x4916b1[_0x0a63('0x29')],_0x1d5448['filters']));if(_0x5772f8[_0x0a63('0x2a')]){if(_0x5772f8[_0x0a63('0x2b')]){_0x5772f8['dateEnd']=moment(_0x5772f8[_0x0a63('0x2b')])['add'](0x1,'day');}else{_0x5772f8[_0x0a63('0x2b')]=moment(_0x5772f8[_0x0a63('0x2a')])[_0x0a63('0x35')](0x1,'day');}_[_0x0a63('0x36')](_0x2133cf[_0x0a63('0x33')],{'createdAt':{'$gte':_0x5772f8[_0x0a63('0x2a')],'$lte':_0x5772f8[_0x0a63('0x2b')]}});}if(_0x4916b1[_0x0a63('0x29')][_0x0a63('0x37')]){_0x2133cf[_0x0a63('0x33')]=_['merge'](_0x2133cf[_0x0a63('0x33')],{'$or':_[_0x0a63('0x38')](_0x2133cf[_0x0a63('0x2e')],function(_0x53d034){var _0x5d9952={};_0x5d9952[_0x53d034]={'$like':'%'+_0x4916b1[_0x0a63('0x29')]['filter']+'%'};return _0x5d9952;})});}_0x2133cf=_[_0x0a63('0x36')]({},_0x2133cf,_0x4916b1[_0x0a63('0x39')]);var _0x128e9e={'where':_0x2133cf['where']};return db[_0x0a63('0x3a')][_0x0a63('0x17')](_0x128e9e)[_0x0a63('0x21')](function(_0x108202){_0x362d6a['count']=_0x108202;if(_0x4916b1[_0x0a63('0x29')][_0x0a63('0x3b')]){_0x2133cf[_0x0a63('0x3c')]=[{'all':!![]}];}return db[_0x0a63('0x3a')][_0x0a63('0x3d')](_0x2133cf);})[_0x0a63('0x21')](function(_0x5d22b5){_0x362d6a[_0x0a63('0x3e')]=_0x5d22b5;return _0x362d6a;})[_0x0a63('0x21')](respondWithFilteredResult(_0x496c93,_0x2133cf))[_0x0a63('0x3f')](handleError(_0x496c93,null));};exports[_0x0a63('0x40')]=function(_0x20fa0d,_0x2482ca){var _0x24da6a={'raw':!![],'where':{'id':_0x20fa0d[_0x0a63('0x41')]['id']}},_0x2e84ef={};_0x2e84ef[_0x0a63('0x27')]=_[_0x0a63('0x28')](db[_0x0a63('0x3a')][_0x0a63('0x26')]);_0x2e84ef[_0x0a63('0x29')]=_[_0x0a63('0x28')](_0x20fa0d[_0x0a63('0x29')]);_0x2e84ef[_0x0a63('0x2c')]=_[_0x0a63('0x2d')](_0x2e84ef['model'],_0x2e84ef[_0x0a63('0x29')]);_0x24da6a['attributes']=_['intersection'](_0x2e84ef[_0x0a63('0x27')],qs[_0x0a63('0x2f')](_0x20fa0d[_0x0a63('0x29')][_0x0a63('0x2f')]));_0x24da6a[_0x0a63('0x2e')]=_0x24da6a[_0x0a63('0x2e')][_0x0a63('0x30')]?_0x24da6a[_0x0a63('0x2e')]:_0x2e84ef[_0x0a63('0x27')];if(_0x20fa0d[_0x0a63('0x29')][_0x0a63('0x3b')]){_0x24da6a[_0x0a63('0x3c')]=[{'all':!![]}];}_0x24da6a=_[_0x0a63('0x36')]({},_0x24da6a,_0x20fa0d[_0x0a63('0x39')]);return db[_0x0a63('0x3a')][_0x0a63('0x42')](_0x24da6a)[_0x0a63('0x21')](handleEntityNotFound(_0x2482ca,null))[_0x0a63('0x21')](respondWithResult(_0x2482ca,null))[_0x0a63('0x3f')](handleError(_0x2482ca,null));};exports[_0x0a63('0x43')]=function(_0x4ac74d,_0x26bb2d){return db[_0x0a63('0x3a')]['create'](_0x4ac74d['body'],{})['then'](respondWithResult(_0x26bb2d,0xc9))['catch'](handleError(_0x26bb2d,null));};exports[_0x0a63('0x1f')]=function(_0x85fcf,_0x5d9ffc){if(_0x85fcf[_0x0a63('0x44')]['id']){delete _0x85fcf['body']['id'];}return db[_0x0a63('0x3a')][_0x0a63('0x42')]({'where':{'id':_0x85fcf['params']['id']}})['then'](handleEntityNotFound(_0x5d9ffc,null))['then'](saveUpdates(_0x85fcf[_0x0a63('0x44')],null))[_0x0a63('0x21')](respondWithResult(_0x5d9ffc,null))[_0x0a63('0x3f')](handleError(_0x5d9ffc,null));};exports[_0x0a63('0x20')]=function(_0x10f8ba,_0x4be904){return db[_0x0a63('0x3a')][_0x0a63('0x42')]({'where':{'id':_0x10f8ba[_0x0a63('0x41')]['id']}})[_0x0a63('0x21')](handleEntityNotFound(_0x4be904,null))[_0x0a63('0x21')](removeEntity(_0x4be904,null))['catch'](handleError(_0x4be904,null));};exports[_0x0a63('0x45')]=function(_0x3c9326,_0x393996){return db[_0x0a63('0x3a')]['describe']()[_0x0a63('0x21')](respondWithResult(_0x393996,null))[_0x0a63('0x3f')](handleError(_0x393996,null));};
\ No newline at end of file
index e51f968..2f4bc02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x289c=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','exports','OpenchannelQueueReport'];(function(_0x4080c2,_0x48b84c){var _0x557c45=function(_0x410d0b){while(--_0x410d0b){_0x4080c2['push'](_0x4080c2['shift']());}};_0x557c45(++_0x48b84c);}(_0x289c,0x110));var _0xc289=function(_0x27211e,_0x11bd53){_0x27211e=_0x27211e-0x0;var _0x38d215=_0x289c[_0x27211e];return _0x38d215;};'use strict';var _=require(_0xc289('0x0'));var util=require(_0xc289('0x1'));var logger=require(_0xc289('0x2'))(_0xc289('0x3'));var moment=require('moment');var BPromise=require(_0xc289('0x4'));var rp=require(_0xc289('0x5'));var attributes=require('./openchannelQueueReport.attributes');module[_0xc289('0x6')]=function(_0xf802f0,_0x1f72e7){return _0xf802f0['define'](_0xc289('0x7'),attributes,{'tableName':_0xc289('0x8'),'paranoid':![],'indexes':[{'name':_0xc289('0x9'),'fields':[_0xc289('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb016=['api','moment','bluebird','request-promise','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x411226,_0x498af1){var _0x138ee5=function(_0x4fdef3){while(--_0x4fdef3){_0x411226['push'](_0x411226['shift']());}};_0x138ee5(++_0x498af1);}(_0xb016,0x129));var _0x6b01=function(_0x573d14,_0x1103ff){_0x573d14=_0x573d14-0x0;var _0x37fe33=_0xb016[_0x573d14];return _0x37fe33;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var logger=require(_0x6b01('0x2'))(_0x6b01('0x3'));var moment=require(_0x6b01('0x4'));var BPromise=require(_0x6b01('0x5'));var rp=require(_0x6b01('0x6'));var attributes=require('./openchannelQueueReport.attributes');module[_0x6b01('0x7')]=function(_0x31db10,_0x664bf3){return _0x31db10[_0x6b01('0x8')](_0x6b01('0x9'),attributes,{'tableName':_0x6b01('0xa'),'paranoid':![],'indexes':[{'name':_0x6b01('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 84619be..b19185c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7b5=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','attributes','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x523083,_0x563beb){var _0x5e5cb6=function(_0x42f867){while(--_0x42f867){_0x523083['push'](_0x523083['shift']());}};_0x5e5cb6(++_0x563beb);}(_0xa7b5,0x15a));var _0x5a7b=function(_0xff33ee,_0x377649){_0xff33ee=_0xff33ee-0x0;var _0x2ce48a=_0xa7b5[_0xff33ee];return _0x2ce48a;};'use strict';var _=require(_0x5a7b('0x0'));var util=require('util');var moment=require(_0x5a7b('0x1'));var BPromise=require('bluebird');var rs=require(_0x5a7b('0x2'));var fs=require('fs');var db=require(_0x5a7b('0x3'))['db'];var utils=require(_0x5a7b('0x4'));var logger=require(_0x5a7b('0x5'))(_0x5a7b('0x6'));var config=require(_0x5a7b('0x7'));var jayson=require(_0x5a7b('0x8'));var client=jayson[_0x5a7b('0x9')][_0x5a7b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3636c1,_0x1f8f95,_0x493ae6){return new BPromise(function(_0x2cd623,_0x24b80c){return client[_0x5a7b('0xb')](_0x3636c1,_0x493ae6)[_0x5a7b('0xc')](function(_0x2446d0){logger[_0x5a7b('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1f8f95,'request\x20sent');logger[_0x5a7b('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x1f8f95,_0x5a7b('0xf'),JSON[_0x5a7b('0x10')](_0x2446d0));if(_0x2446d0[_0x5a7b('0x11')]){if(_0x2446d0[_0x5a7b('0x11')][_0x5a7b('0x12')]===0x1f4){logger[_0x5a7b('0x11')](_0x5a7b('0x13'),_0x1f8f95,_0x2446d0[_0x5a7b('0x11')][_0x5a7b('0x14')]);return _0x24b80c(_0x2446d0[_0x5a7b('0x11')][_0x5a7b('0x14')]);}logger['error'](_0x5a7b('0x13'),_0x1f8f95,_0x2446d0[_0x5a7b('0x11')][_0x5a7b('0x14')]);return _0x2cd623(_0x2446d0[_0x5a7b('0x11')]['message']);}else{logger[_0x5a7b('0xd')](_0x5a7b('0x13'),_0x1f8f95,'request\x20sent');_0x2cd623(_0x2446d0[_0x5a7b('0x15')]['message']);}})[_0x5a7b('0x16')](function(_0x4b85e0){logger[_0x5a7b('0x11')](_0x5a7b('0x13'),_0x1f8f95,_0x4b85e0);_0x24b80c(_0x4b85e0);});});}exports[_0x5a7b('0x17')]=function(_0x5a3a89){var _0x33b996=this;return new Promise(function(_0x490d82,_0x192009){return db[_0x5a7b('0x18')][_0x5a7b('0x19')](_0x5a3a89[_0x5a7b('0x1a')],{'raw':_0x5a3a89[_0x5a7b('0x1b')]?_0x5a3a89[_0x5a7b('0x1b')][_0x5a7b('0x1c')]===undefined?!![]:![]:!![]})[_0x5a7b('0xc')](function(_0x4dd310){logger[_0x5a7b('0xd')](_0x5a7b('0x17'),_0x5a3a89);logger['debug']('CreateOpenchannelQueueReport',_0x5a3a89,JSON[_0x5a7b('0x10')](_0x4dd310));_0x490d82(_0x4dd310);})[_0x5a7b('0x16')](function(_0x2ebf51){logger[_0x5a7b('0x11')](_0x5a7b('0x17'),_0x2ebf51['message'],_0x5a3a89);_0x192009(_0x33b996['error'](0x1f4,_0x2ebf51[_0x5a7b('0x14')]));});});};exports[_0x5a7b('0x1d')]=function(_0x26442f){var _0x2a0550=this;return new Promise(function(_0x4b1c7f,_0x4f4a3d){return db['OpenchannelQueueReport'][_0x5a7b('0x1e')](_0x26442f[_0x5a7b('0x1a')],{'raw':_0x26442f[_0x5a7b('0x1b')]?_0x26442f[_0x5a7b('0x1b')][_0x5a7b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26442f['options']?_0x26442f[_0x5a7b('0x1b')]['where']||null:null,'attributes':_0x26442f[_0x5a7b('0x1b')]?_0x26442f['options'][_0x5a7b('0x1f')]||null:null,'limit':_0x26442f[_0x5a7b('0x1b')]?_0x26442f[_0x5a7b('0x1b')]['limit']||null:null})[_0x5a7b('0xc')](function(_0x449cc7){logger[_0x5a7b('0xd')]('UpdateOpenchannelQueueReport',_0x26442f);logger[_0x5a7b('0xe')](_0x5a7b('0x1d'),_0x26442f,JSON[_0x5a7b('0x10')](_0x449cc7));_0x4b1c7f(_0x449cc7);})[_0x5a7b('0x16')](function(_0x426aa6){logger['error'](_0x5a7b('0x1d'),_0x426aa6[_0x5a7b('0x14')],_0x26442f);_0x4f4a3d(_0x2a0550[_0x5a7b('0x11')](0x1f4,_0x426aa6[_0x5a7b('0x14')]));});});};
\ No newline at end of file
+var _0xfce5=['code','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','then','info','where','attributes','limit','UpdateOpenchannelQueueReport','stringify','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x12ace5,_0x164026){var _0x46cd3e=function(_0x39f2b1){while(--_0x39f2b1){_0x12ace5['push'](_0x12ace5['shift']());}};_0x46cd3e(++_0x164026);}(_0xfce5,0x70));var _0x5fce=function(_0x2d05fa,_0x372364){_0x2d05fa=_0x2d05fa-0x0;var _0x10ae61=_0xfce5[_0x2d05fa];return _0x10ae61;};'use strict';var _=require('lodash');var util=require(_0x5fce('0x0'));var moment=require(_0x5fce('0x1'));var BPromise=require(_0x5fce('0x2'));var rs=require('randomstring');var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x5fce('0x3'));var logger=require(_0x5fce('0x4'))(_0x5fce('0x5'));var config=require(_0x5fce('0x6'));var jayson=require(_0x5fce('0x7'));var client=jayson[_0x5fce('0x8')][_0x5fce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4abcb0,_0x203d26,_0x5bc7d2){return new BPromise(function(_0x37c31d,_0x2a6ed1){return client[_0x5fce('0xa')](_0x4abcb0,_0x5bc7d2)['then'](function(_0x254ce0){logger['info'](_0x5fce('0xb'),_0x203d26,_0x5fce('0xc'));logger[_0x5fce('0xd')](_0x5fce('0xe'),_0x203d26,'request\x20sent',JSON['stringify'](_0x254ce0));if(_0x254ce0[_0x5fce('0xf')]){if(_0x254ce0['error'][_0x5fce('0x10')]===0x1f4){logger[_0x5fce('0xf')](_0x5fce('0xb'),_0x203d26,_0x254ce0[_0x5fce('0xf')][_0x5fce('0x11')]);return _0x2a6ed1(_0x254ce0[_0x5fce('0xf')]['message']);}logger['error'](_0x5fce('0xb'),_0x203d26,_0x254ce0[_0x5fce('0xf')]['message']);return _0x37c31d(_0x254ce0['error'][_0x5fce('0x11')]);}else{logger['info'](_0x5fce('0xb'),_0x203d26,'request\x20sent');_0x37c31d(_0x254ce0['result'][_0x5fce('0x11')]);}})[_0x5fce('0x12')](function(_0x1136cd){logger['error'](_0x5fce('0xb'),_0x203d26,_0x1136cd);_0x2a6ed1(_0x1136cd);});});}exports[_0x5fce('0x13')]=function(_0x1e7ded){var _0x4eeb0a=this;return new Promise(function(_0x4716b3,_0x4e58c1){return db[_0x5fce('0x14')][_0x5fce('0x15')](_0x1e7ded[_0x5fce('0x16')],{'raw':_0x1e7ded[_0x5fce('0x17')]?_0x1e7ded['options'][_0x5fce('0x18')]===undefined?!![]:![]:!![]})[_0x5fce('0x19')](function(_0x1714d4){logger[_0x5fce('0x1a')](_0x5fce('0x13'),_0x1e7ded);logger[_0x5fce('0xd')](_0x5fce('0x13'),_0x1e7ded,JSON['stringify'](_0x1714d4));_0x4716b3(_0x1714d4);})[_0x5fce('0x12')](function(_0x200f8c){logger[_0x5fce('0xf')](_0x5fce('0x13'),_0x200f8c[_0x5fce('0x11')],_0x1e7ded);_0x4e58c1(_0x4eeb0a['error'](0x1f4,_0x200f8c['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x543434){var _0x7d56d2=this;return new Promise(function(_0x206fae,_0x40a21d){return db[_0x5fce('0x14')]['update'](_0x543434[_0x5fce('0x16')],{'raw':_0x543434[_0x5fce('0x17')]?_0x543434[_0x5fce('0x17')][_0x5fce('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x543434[_0x5fce('0x17')]?_0x543434[_0x5fce('0x17')][_0x5fce('0x1b')]||null:null,'attributes':_0x543434[_0x5fce('0x17')]?_0x543434['options'][_0x5fce('0x1c')]||null:null,'limit':_0x543434[_0x5fce('0x17')]?_0x543434[_0x5fce('0x17')][_0x5fce('0x1d')]||null:null})[_0x5fce('0x19')](function(_0x199d6e){logger[_0x5fce('0x1a')](_0x5fce('0x1e'),_0x543434);logger['debug']('UpdateOpenchannelQueueReport',_0x543434,JSON[_0x5fce('0x1f')](_0x199d6e));_0x206fae(_0x199d6e);})[_0x5fce('0x12')](function(_0x1ea933){logger[_0x5fce('0xf')](_0x5fce('0x1e'),_0x1ea933['message'],_0x543434);_0x40a21d(_0x7d56d2[_0x5fce('0xf')](0x1f4,_0x1ea933['message']));});});};
\ No newline at end of file
index 042bc23..fd0ee76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc419=['./openchannelTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','path','express','Router','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc419,0x1cf));var _0x9c41=function(_0x23143c,_0x3b7933){_0x23143c=_0x23143c-0x0;var _0x406d51=_0xc419[_0x23143c];return _0x406d51;};'use strict';var multer=require(_0x9c41('0x0'));var util=require('util');var path=require(_0x9c41('0x1'));var express=require(_0x9c41('0x2'));var router=express[_0x9c41('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x9c41('0x4'));var config=require('../../config/environment');var controller=require(_0x9c41('0x5'));router[_0x9c41('0x6')]('/',auth[_0x9c41('0x7')](),controller['index']);router['get'](_0x9c41('0x8'),auth[_0x9c41('0x7')](),controller[_0x9c41('0x9')]);router['get'](_0x9c41('0xa'),auth['isAuthenticated'](),controller[_0x9c41('0xb')]);router[_0x9c41('0xc')]('/',auth[_0x9c41('0x7')](),controller[_0x9c41('0xd')]);router[_0x9c41('0xe')]('/:id',auth[_0x9c41('0x7')](),controller['update']);router[_0x9c41('0xf')](_0x9c41('0xa'),auth['isAuthenticated'](),controller[_0x9c41('0x10')]);module[_0x9c41('0x11')]=router;
\ No newline at end of file
+var _0xe3c5=['delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','index','/describe','isAuthenticated','describe','/:id','show','post','update'];(function(_0x2fd0f0,_0x4b634e){var _0x57f71a=function(_0x400d6f){while(--_0x400d6f){_0x2fd0f0['push'](_0x2fd0f0['shift']());}};_0x57f71a(++_0x4b634e);}(_0xe3c5,0x1a1));var _0x5e3c=function(_0x3a93b7,_0x658183){_0x3a93b7=_0x3a93b7-0x0;var _0x2ed891=_0xe3c5[_0x3a93b7];return _0x2ed891;};'use strict';var multer=require(_0x5e3c('0x0'));var util=require(_0x5e3c('0x1'));var path=require(_0x5e3c('0x2'));var express=require(_0x5e3c('0x3'));var router=express[_0x5e3c('0x4')]();var auth=require(_0x5e3c('0x5'));var interaction=require(_0x5e3c('0x6'));var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x5e3c('0x7')]);router['get'](_0x5e3c('0x8'),auth[_0x5e3c('0x9')](),controller[_0x5e3c('0xa')]);router['get'](_0x5e3c('0xb'),auth['isAuthenticated'](),controller[_0x5e3c('0xc')]);router[_0x5e3c('0xd')]('/',auth[_0x5e3c('0x9')](),controller['create']);router['put'](_0x5e3c('0xb'),auth[_0x5e3c('0x9')](),controller[_0x5e3c('0xe')]);router[_0x5e3c('0xf')](_0x5e3c('0xb'),auth[_0x5e3c('0x9')](),controller[_0x5e3c('0x10')]);module[_0x5e3c('0x11')]=router;
\ No newline at end of file
index f0a8653..90d5c99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c4b=['queue','DATE','NOW','moment','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x3e1adc,_0x85bb78){var _0x8b96e4=function(_0x5121fc){while(--_0x5121fc){_0x3e1adc['push'](_0x3e1adc['shift']());}};_0x8b96e4(++_0x85bb78);}(_0x2c4b,0x11b));var _0xb2c4=function(_0x5d43b5,_0x3d1c74){_0x5d43b5=_0x5d43b5-0x0;var _0x2c5fba=_0x2c4b[_0x5d43b5];return _0x2c5fba;};'use strict';var moment=require(_0xb2c4('0x0'));var Sequelize=require(_0xb2c4('0x1'));module[_0xb2c4('0x2')]={'uniqueid':{'type':Sequelize[_0xb2c4('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xb2c4('0x4')](_0xb2c4('0x5'),_0xb2c4('0x6'),_0xb2c4('0x7')),'allowNull':![],'defaultValue':_0xb2c4('0x7')},'transferredAt':{'type':Sequelize[_0xb2c4('0x8')],'allowNull':![],'defaultValue':Sequelize[_0xb2c4('0x9')]}};
\ No newline at end of file
+var _0xd09e=['agent','queue','NOW','moment','sequelize','exports','STRING','ENUM'];(function(_0x5e96d2,_0x94d7ac){var _0xaecb8e=function(_0x1bac1a){while(--_0x1bac1a){_0x5e96d2['push'](_0x5e96d2['shift']());}};_0xaecb8e(++_0x94d7ac);}(_0xd09e,0x133));var _0xed09=function(_0x4dd5fa,_0x3c7973){_0x4dd5fa=_0x4dd5fa-0x0;var _0x440804=_0xd09e[_0x4dd5fa];return _0x440804;};'use strict';var moment=require(_0xed09('0x0'));var Sequelize=require(_0xed09('0x1'));module[_0xed09('0x2')]={'uniqueid':{'type':Sequelize[_0xed09('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xed09('0x4')]('account',_0xed09('0x5'),_0xed09('0x6')),'allowNull':![],'defaultValue':_0xed09('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xed09('0x7')]}};
\ No newline at end of file
index 8af3571..e330afc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c94=['json','offset','limit','set','apply','reject','save','update','destroy','then','error','name','send','index','OpenchannelTransferReport','rawAttributes','model','keys','dateStart','query','dateEnd','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day','merge','map','filter','options','count','include','findAll','rows','show','params','fields','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x3c94,0xcd));var _0x43c9=function(_0x30f781,_0x1ce35d){_0x30f781=_0x30f781-0x0;var _0x461df7=_0x3c94[_0x30f781];return _0x461df7;};'use strict';var pdf=require(_0x43c9('0x0'));var emlformat=require(_0x43c9('0x1'));var rimraf=require(_0x43c9('0x2'));var zipdir=require(_0x43c9('0x3'));var jsonpatch=require(_0x43c9('0x4'));var rp=require(_0x43c9('0x5'));var moment=require(_0x43c9('0x6'));var BPromise=require(_0x43c9('0x7'));var Mustache=require(_0x43c9('0x8'));var util=require(_0x43c9('0x9'));var path=require(_0x43c9('0xa'));var sox=require(_0x43c9('0xb'));var csv=require('to-csv');var ejs=require(_0x43c9('0xc'));var fs=require('fs');var _=require(_0x43c9('0xd'));var squel=require(_0x43c9('0xe'));var crypto=require(_0x43c9('0xf'));var jsforce=require(_0x43c9('0x10'));var deskjs=require(_0x43c9('0x11'));var toCsv=require(_0x43c9('0x12'));var querystring=require(_0x43c9('0x13'));var Papa=require(_0x43c9('0x14'));var qs=require('../../components/parsers/qs');var logger=require(_0x43c9('0x15'))(_0x43c9('0x16'));var utils=require(_0x43c9('0x17'));var config=require(_0x43c9('0x18'));var db=require(_0x43c9('0x19'))['db'];function respondWithStatusCode(_0x6ff1f9,_0x690bde){_0x690bde=_0x690bde||0xcc;return function(_0x305fcb){if(_0x305fcb){return _0x6ff1f9[_0x43c9('0x1a')](_0x690bde);}return _0x6ff1f9[_0x43c9('0x1b')](_0x690bde)[_0x43c9('0x1c')]();};}function respondWithResult(_0x31faa1,_0x11fe24){_0x11fe24=_0x11fe24||0xc8;return function(_0x40f5f5){if(_0x40f5f5){return _0x31faa1[_0x43c9('0x1b')](_0x11fe24)[_0x43c9('0x1d')](_0x40f5f5);}};}function respondWithFilteredResult(_0x275b2b,_0x569fa9){return function(_0x37932f){if(_0x37932f){var _0x1c7fd9=_0x37932f['count'],_0x398b37=_0x569fa9['offset'],_0xe02707=_0x569fa9[_0x43c9('0x1e')]+_0x569fa9[_0x43c9('0x1f')],_0x3f908d;if(_0xe02707>=_0x1c7fd9){_0xe02707=_0x1c7fd9;_0x3f908d=0xc8;}else{_0x3f908d=0xce;}_0x275b2b[_0x43c9('0x1b')](_0x3f908d);return _0x275b2b[_0x43c9('0x20')]('Content-Range',_0x398b37+'-'+_0xe02707+'/'+_0x1c7fd9)[_0x43c9('0x1d')](_0x37932f);}return null;};}function patchUpdates(_0x1da149){return function(_0x38fe46){try{jsonpatch[_0x43c9('0x21')](_0x38fe46,_0x1da149,!![]);}catch(_0xc14827){return BPromise[_0x43c9('0x22')](_0xc14827);}return _0x38fe46[_0x43c9('0x23')]();};}function saveUpdates(_0x1e3996,_0x2411ca){return function(_0x2a7b78){if(_0x2a7b78){return _0x2a7b78[_0x43c9('0x24')](_0x1e3996)['then'](function(_0x39c6f1){return _0x39c6f1;});}return null;};}function removeEntity(_0x772b71,_0x31248d){return function(_0x4c2d7c){if(_0x4c2d7c){return _0x4c2d7c[_0x43c9('0x25')]()[_0x43c9('0x26')](function(){_0x772b71[_0x43c9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28290a,_0x1d4b98){return function(_0x460f53){if(!_0x460f53){_0x28290a['sendStatus'](0x194);}return _0x460f53;};}function handleError(_0x4963d2,_0x2a40f4){_0x2a40f4=_0x2a40f4||0x1f4;return function(_0x3fd641){logger[_0x43c9('0x27')](_0x3fd641['stack']);if(_0x3fd641[_0x43c9('0x28')]){delete _0x3fd641[_0x43c9('0x28')];}_0x4963d2[_0x43c9('0x1b')](_0x2a40f4)[_0x43c9('0x29')](_0x3fd641);};}exports[_0x43c9('0x2a')]=function(_0x53b670,_0x386078){var _0x3b5c47={},_0x3910af={},_0x3e8c43={'count':0x0,'rows':[]};var _0x4633cc=db[_0x43c9('0x2b')][_0x43c9('0x2c')];_0x3910af[_0x43c9('0x2d')]=_[_0x43c9('0x2e')](_0x4633cc);var _0x175042={'dateStart':_0x53b670['query'][_0x43c9('0x2f')],'dateEnd':_0x53b670[_0x43c9('0x30')][_0x43c9('0x31')]};delete _0x53b670['query'][_0x43c9('0x2f')];delete _0x53b670[_0x43c9('0x30')]['dateEnd'];_0x3910af[_0x43c9('0x30')]=_['keys'](_0x53b670[_0x43c9('0x30')]);_0x3910af[_0x43c9('0x32')]=_[_0x43c9('0x33')](_0x3910af[_0x43c9('0x2d')],_0x3910af['query']);_0x3b5c47[_0x43c9('0x34')]=_[_0x43c9('0x33')](_0x3910af[_0x43c9('0x2d')],qs['fields'](_0x53b670[_0x43c9('0x30')]['fields']));_0x3b5c47[_0x43c9('0x34')]=_0x3b5c47[_0x43c9('0x34')][_0x43c9('0x35')]?_0x3b5c47[_0x43c9('0x34')]:_0x3910af['model'];if(!_0x53b670[_0x43c9('0x30')][_0x43c9('0x36')](_0x43c9('0x37'))){_0x3b5c47[_0x43c9('0x1f')]=qs['limit'](_0x53b670[_0x43c9('0x30')][_0x43c9('0x1f')]);_0x3b5c47[_0x43c9('0x1e')]=qs[_0x43c9('0x1e')](_0x53b670[_0x43c9('0x30')][_0x43c9('0x1e')]);}_0x3b5c47[_0x43c9('0x38')]=qs[_0x43c9('0x39')](_0x53b670['query'][_0x43c9('0x39')]);_0x3b5c47[_0x43c9('0x3a')]=qs[_0x43c9('0x32')](_[_0x43c9('0x3b')](_0x53b670[_0x43c9('0x30')],_0x3910af[_0x43c9('0x32')]));if(_0x175042[_0x43c9('0x2f')]){if(_0x175042[_0x43c9('0x31')]){_0x175042[_0x43c9('0x31')]=moment(_0x175042['dateEnd'])[_0x43c9('0x3c')](0x1,'day');}else{_0x175042[_0x43c9('0x31')]=moment(_0x175042[_0x43c9('0x2f')])[_0x43c9('0x3c')](0x1,_0x43c9('0x3d'));}_[_0x43c9('0x3e')](_0x3b5c47[_0x43c9('0x3a')],{'createdAt':{'$gte':_0x175042[_0x43c9('0x2f')],'$lte':_0x175042[_0x43c9('0x31')]}});}if(_0x53b670[_0x43c9('0x30')]['filter']){_0x3b5c47[_0x43c9('0x3a')]=_[_0x43c9('0x3e')](_0x3b5c47['where'],{'$or':_[_0x43c9('0x3f')](_0x3b5c47[_0x43c9('0x34')],function(_0x309fea){var _0x52c316={};_0x52c316[_0x309fea]={'$like':'%'+_0x53b670[_0x43c9('0x30')][_0x43c9('0x40')]+'%'};return _0x52c316;})});}_0x3b5c47=_[_0x43c9('0x3e')]({},_0x3b5c47,_0x53b670[_0x43c9('0x41')]);var _0x1be0ce={'where':_0x3b5c47[_0x43c9('0x3a')]};return db[_0x43c9('0x2b')][_0x43c9('0x42')](_0x1be0ce)[_0x43c9('0x26')](function(_0x2431bb){_0x3e8c43[_0x43c9('0x42')]=_0x2431bb;if(_0x53b670[_0x43c9('0x30')]['includeAll']){_0x3b5c47[_0x43c9('0x43')]=[{'all':!![]}];}return db[_0x43c9('0x2b')][_0x43c9('0x44')](_0x3b5c47);})[_0x43c9('0x26')](function(_0x4d6eee){_0x3e8c43[_0x43c9('0x45')]=_0x4d6eee;return _0x3e8c43;})[_0x43c9('0x26')](respondWithFilteredResult(_0x386078,_0x3b5c47))['catch'](handleError(_0x386078,null));};exports[_0x43c9('0x46')]=function(_0x395b1f,_0x1879a6){var _0x14f6a8={'raw':!![],'where':{'id':_0x395b1f[_0x43c9('0x47')]['id']}},_0x1d6f5b={};_0x1d6f5b[_0x43c9('0x2d')]=_[_0x43c9('0x2e')](db[_0x43c9('0x2b')]['rawAttributes']);_0x1d6f5b[_0x43c9('0x30')]=_['keys'](_0x395b1f[_0x43c9('0x30')]);_0x1d6f5b[_0x43c9('0x32')]=_[_0x43c9('0x33')](_0x1d6f5b[_0x43c9('0x2d')],_0x1d6f5b['query']);_0x14f6a8[_0x43c9('0x34')]=_[_0x43c9('0x33')](_0x1d6f5b['model'],qs[_0x43c9('0x48')](_0x395b1f[_0x43c9('0x30')]['fields']));_0x14f6a8[_0x43c9('0x34')]=_0x14f6a8[_0x43c9('0x34')][_0x43c9('0x35')]?_0x14f6a8['attributes']:_0x1d6f5b[_0x43c9('0x2d')];if(_0x395b1f['query']['includeAll']){_0x14f6a8[_0x43c9('0x43')]=[{'all':!![]}];}_0x14f6a8=_[_0x43c9('0x3e')]({},_0x14f6a8,_0x395b1f[_0x43c9('0x41')]);return db[_0x43c9('0x2b')][_0x43c9('0x49')](_0x14f6a8)[_0x43c9('0x26')](handleEntityNotFound(_0x1879a6,null))[_0x43c9('0x26')](respondWithResult(_0x1879a6,null))[_0x43c9('0x4a')](handleError(_0x1879a6,null));};exports[_0x43c9('0x4b')]=function(_0xd2d572,_0x1d4eaa){return db[_0x43c9('0x2b')][_0x43c9('0x4b')](_0xd2d572['body'],{})[_0x43c9('0x26')](respondWithResult(_0x1d4eaa,0xc9))[_0x43c9('0x4a')](handleError(_0x1d4eaa,null));};exports['update']=function(_0x13f875,_0x238bf6){if(_0x13f875[_0x43c9('0x4c')]['id']){delete _0x13f875[_0x43c9('0x4c')]['id'];}return db[_0x43c9('0x2b')][_0x43c9('0x49')]({'where':{'id':_0x13f875[_0x43c9('0x47')]['id']}})[_0x43c9('0x26')](handleEntityNotFound(_0x238bf6,null))[_0x43c9('0x26')](saveUpdates(_0x13f875['body'],null))[_0x43c9('0x26')](respondWithResult(_0x238bf6,null))[_0x43c9('0x4a')](handleError(_0x238bf6,null));};exports[_0x43c9('0x25')]=function(_0x57f402,_0x22e48d){return db[_0x43c9('0x2b')]['find']({'where':{'id':_0x57f402[_0x43c9('0x47')]['id']}})[_0x43c9('0x26')](handleEntityNotFound(_0x22e48d,null))[_0x43c9('0x26')](removeEntity(_0x22e48d,null))[_0x43c9('0x4a')](handleError(_0x22e48d,null));};exports[_0x43c9('0x4d')]=function(_0x325dbf,_0x2439b3){return db[_0x43c9('0x2b')]['describe']()[_0x43c9('0x26')](respondWithResult(_0x2439b3,null))['catch'](handleError(_0x2439b3,null));};
\ No newline at end of file
+var _0x15ce=['eml-format','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','destroy','then','error','name','send','index','OpenchannelTransferReport','rawAttributes','model','keys','query','dateStart','dateEnd','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','add','day','merge','filter','map','count','includeAll','include','findAll','show','params','find','catch','create','body','update','describe'];(function(_0x9e72c8,_0x5ac1a9){var _0x1468b2=function(_0x2cac69){while(--_0x2cac69){_0x9e72c8['push'](_0x9e72c8['shift']());}};_0x1468b2(++_0x5ac1a9);}(_0x15ce,0x186));var _0xe15c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x15ce[_0x432682];return _0x463d05;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe15c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe15c('0x1'));var rp=require('request-promise');var moment=require(_0xe15c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe15c('0x3'));var util=require(_0xe15c('0x4'));var path=require('path');var sox=require(_0xe15c('0x5'));var csv=require(_0xe15c('0x6'));var ejs=require(_0xe15c('0x7'));var fs=require('fs');var _=require(_0xe15c('0x8'));var squel=require('squel');var crypto=require(_0xe15c('0x9'));var jsforce=require(_0xe15c('0xa'));var deskjs=require(_0xe15c('0xb'));var toCsv=require(_0xe15c('0x6'));var querystring=require(_0xe15c('0xc'));var Papa=require('papaparse');var qs=require(_0xe15c('0xd'));var logger=require('../../config/logger')('api');var utils=require(_0xe15c('0xe'));var config=require('../../config/environment');var db=require(_0xe15c('0xf'))['db'];function respondWithStatusCode(_0x4fea8f,_0x1bc870){_0x1bc870=_0x1bc870||0xcc;return function(_0x50cd75){if(_0x50cd75){return _0x4fea8f[_0xe15c('0x10')](_0x1bc870);}return _0x4fea8f['status'](_0x1bc870)[_0xe15c('0x11')]();};}function respondWithResult(_0xef718c,_0x212e02){_0x212e02=_0x212e02||0xc8;return function(_0x2fb302){if(_0x2fb302){return _0xef718c[_0xe15c('0x12')](_0x212e02)[_0xe15c('0x13')](_0x2fb302);}};}function respondWithFilteredResult(_0x337fc8,_0x155be7){return function(_0x152fdb){if(_0x152fdb){var _0x523828=_0x152fdb['count'],_0x476f31=_0x155be7[_0xe15c('0x14')],_0x112602=_0x155be7[_0xe15c('0x14')]+_0x155be7[_0xe15c('0x15')],_0x59e2c1;if(_0x112602>=_0x523828){_0x112602=_0x523828;_0x59e2c1=0xc8;}else{_0x59e2c1=0xce;}_0x337fc8[_0xe15c('0x12')](_0x59e2c1);return _0x337fc8[_0xe15c('0x16')](_0xe15c('0x17'),_0x476f31+'-'+_0x112602+'/'+_0x523828)[_0xe15c('0x13')](_0x152fdb);}return null;};}function patchUpdates(_0xbdeca1){return function(_0x44cd80){try{jsonpatch['apply'](_0x44cd80,_0xbdeca1,!![]);}catch(_0x4d3513){return BPromise[_0xe15c('0x18')](_0x4d3513);}return _0x44cd80['save']();};}function saveUpdates(_0x458917,_0xefd7b7){return function(_0x15c2e2){if(_0x15c2e2){return _0x15c2e2['update'](_0x458917)['then'](function(_0x139761){return _0x139761;});}return null;};}function removeEntity(_0x200b7f,_0x4c7c73){return function(_0x50bfb0){if(_0x50bfb0){return _0x50bfb0[_0xe15c('0x19')]()[_0xe15c('0x1a')](function(){_0x200b7f[_0xe15c('0x12')](0xcc)[_0xe15c('0x11')]();});}};}function handleEntityNotFound(_0x309226,_0x166723){return function(_0x2af72a){if(!_0x2af72a){_0x309226[_0xe15c('0x10')](0x194);}return _0x2af72a;};}function handleError(_0x2969af,_0x26fcda){_0x26fcda=_0x26fcda||0x1f4;return function(_0x306115){logger[_0xe15c('0x1b')](_0x306115['stack']);if(_0x306115['name']){delete _0x306115[_0xe15c('0x1c')];}_0x2969af[_0xe15c('0x12')](_0x26fcda)[_0xe15c('0x1d')](_0x306115);};}exports[_0xe15c('0x1e')]=function(_0x42f0ac,_0x214273){var _0xf15d7={},_0x57130d={},_0x418d8c={'count':0x0,'rows':[]};var _0x5dbbe6=db[_0xe15c('0x1f')][_0xe15c('0x20')];_0x57130d[_0xe15c('0x21')]=_[_0xe15c('0x22')](_0x5dbbe6);var _0x1cad28={'dateStart':_0x42f0ac[_0xe15c('0x23')][_0xe15c('0x24')],'dateEnd':_0x42f0ac[_0xe15c('0x23')][_0xe15c('0x25')]};delete _0x42f0ac['query'][_0xe15c('0x24')];delete _0x42f0ac[_0xe15c('0x23')][_0xe15c('0x25')];_0x57130d[_0xe15c('0x23')]=_['keys'](_0x42f0ac['query']);_0x57130d[_0xe15c('0x26')]=_['intersection'](_0x57130d[_0xe15c('0x21')],_0x57130d[_0xe15c('0x23')]);_0xf15d7[_0xe15c('0x27')]=_[_0xe15c('0x28')](_0x57130d[_0xe15c('0x21')],qs[_0xe15c('0x29')](_0x42f0ac['query'][_0xe15c('0x29')]));_0xf15d7[_0xe15c('0x27')]=_0xf15d7[_0xe15c('0x27')][_0xe15c('0x2a')]?_0xf15d7['attributes']:_0x57130d['model'];if(!_0x42f0ac['query'][_0xe15c('0x2b')](_0xe15c('0x2c'))){_0xf15d7[_0xe15c('0x15')]=qs['limit'](_0x42f0ac[_0xe15c('0x23')]['limit']);_0xf15d7['offset']=qs[_0xe15c('0x14')](_0x42f0ac[_0xe15c('0x23')][_0xe15c('0x14')]);}_0xf15d7['order']=qs[_0xe15c('0x2d')](_0x42f0ac['query'][_0xe15c('0x2d')]);_0xf15d7[_0xe15c('0x2e')]=qs[_0xe15c('0x26')](_[_0xe15c('0x2f')](_0x42f0ac[_0xe15c('0x23')],_0x57130d[_0xe15c('0x26')]));if(_0x1cad28[_0xe15c('0x24')]){if(_0x1cad28[_0xe15c('0x25')]){_0x1cad28[_0xe15c('0x25')]=moment(_0x1cad28[_0xe15c('0x25')])[_0xe15c('0x30')](0x1,_0xe15c('0x31'));}else{_0x1cad28['dateEnd']=moment(_0x1cad28[_0xe15c('0x24')])[_0xe15c('0x30')](0x1,'day');}_[_0xe15c('0x32')](_0xf15d7[_0xe15c('0x2e')],{'createdAt':{'$gte':_0x1cad28[_0xe15c('0x24')],'$lte':_0x1cad28[_0xe15c('0x25')]}});}if(_0x42f0ac['query'][_0xe15c('0x33')]){_0xf15d7[_0xe15c('0x2e')]=_[_0xe15c('0x32')](_0xf15d7[_0xe15c('0x2e')],{'$or':_[_0xe15c('0x34')](_0xf15d7[_0xe15c('0x27')],function(_0x15a31d){var _0x28cd64={};_0x28cd64[_0x15a31d]={'$like':'%'+_0x42f0ac['query'][_0xe15c('0x33')]+'%'};return _0x28cd64;})});}_0xf15d7=_[_0xe15c('0x32')]({},_0xf15d7,_0x42f0ac['options']);var _0x36a0de={'where':_0xf15d7[_0xe15c('0x2e')]};return db['OpenchannelTransferReport'][_0xe15c('0x35')](_0x36a0de)[_0xe15c('0x1a')](function(_0x3f9485){_0x418d8c[_0xe15c('0x35')]=_0x3f9485;if(_0x42f0ac['query'][_0xe15c('0x36')]){_0xf15d7[_0xe15c('0x37')]=[{'all':!![]}];}return db[_0xe15c('0x1f')][_0xe15c('0x38')](_0xf15d7);})['then'](function(_0x51f67a){_0x418d8c['rows']=_0x51f67a;return _0x418d8c;})[_0xe15c('0x1a')](respondWithFilteredResult(_0x214273,_0xf15d7))['catch'](handleError(_0x214273,null));};exports[_0xe15c('0x39')]=function(_0xb7c5e9,_0x2347c0){var _0x1c0199={'raw':!![],'where':{'id':_0xb7c5e9[_0xe15c('0x3a')]['id']}},_0x1063fd={};_0x1063fd[_0xe15c('0x21')]=_[_0xe15c('0x22')](db[_0xe15c('0x1f')][_0xe15c('0x20')]);_0x1063fd[_0xe15c('0x23')]=_[_0xe15c('0x22')](_0xb7c5e9[_0xe15c('0x23')]);_0x1063fd[_0xe15c('0x26')]=_['intersection'](_0x1063fd['model'],_0x1063fd['query']);_0x1c0199[_0xe15c('0x27')]=_[_0xe15c('0x28')](_0x1063fd[_0xe15c('0x21')],qs[_0xe15c('0x29')](_0xb7c5e9[_0xe15c('0x23')][_0xe15c('0x29')]));_0x1c0199[_0xe15c('0x27')]=_0x1c0199[_0xe15c('0x27')][_0xe15c('0x2a')]?_0x1c0199[_0xe15c('0x27')]:_0x1063fd[_0xe15c('0x21')];if(_0xb7c5e9[_0xe15c('0x23')][_0xe15c('0x36')]){_0x1c0199[_0xe15c('0x37')]=[{'all':!![]}];}_0x1c0199=_[_0xe15c('0x32')]({},_0x1c0199,_0xb7c5e9['options']);return db[_0xe15c('0x1f')][_0xe15c('0x3b')](_0x1c0199)[_0xe15c('0x1a')](handleEntityNotFound(_0x2347c0,null))['then'](respondWithResult(_0x2347c0,null))[_0xe15c('0x3c')](handleError(_0x2347c0,null));};exports[_0xe15c('0x3d')]=function(_0x4e7df8,_0x2a08f9){return db[_0xe15c('0x1f')][_0xe15c('0x3d')](_0x4e7df8[_0xe15c('0x3e')],{})[_0xe15c('0x1a')](respondWithResult(_0x2a08f9,0xc9))[_0xe15c('0x3c')](handleError(_0x2a08f9,null));};exports[_0xe15c('0x3f')]=function(_0x324eb4,_0x32ee0d){if(_0x324eb4[_0xe15c('0x3e')]['id']){delete _0x324eb4['body']['id'];}return db[_0xe15c('0x1f')][_0xe15c('0x3b')]({'where':{'id':_0x324eb4[_0xe15c('0x3a')]['id']}})['then'](handleEntityNotFound(_0x32ee0d,null))['then'](saveUpdates(_0x324eb4[_0xe15c('0x3e')],null))['then'](respondWithResult(_0x32ee0d,null))['catch'](handleError(_0x32ee0d,null));};exports[_0xe15c('0x19')]=function(_0x57c4da,_0x94a967){return db[_0xe15c('0x1f')][_0xe15c('0x3b')]({'where':{'id':_0x57c4da[_0xe15c('0x3a')]['id']}})[_0xe15c('0x1a')](handleEntityNotFound(_0x94a967,null))['then'](removeEntity(_0x94a967,null))['catch'](handleError(_0x94a967,null));};exports[_0xe15c('0x40')]=function(_0x3889d5,_0x14a154){return db[_0xe15c('0x1f')][_0xe15c('0x40')]()[_0xe15c('0x1a')](respondWithResult(_0x14a154,null))[_0xe15c('0x3c')](handleError(_0x14a154,null));};
\ No newline at end of file
index 15092df..029edac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','./openchannelTransferReport.attributes','exports','define'];(function(_0x2fea08,_0x1528e6){var _0x5f00fe=function(_0x414bbe){while(--_0x414bbe){_0x2fea08['push'](_0x2fea08['shift']());}};_0x5f00fe(++_0x1528e6);}(_0x7a54,0x106));var _0x47a5=function(_0x4a8231,_0x53cc51){_0x4a8231=_0x4a8231-0x0;var _0x3784eb=_0x7a54[_0x4a8231];return _0x3784eb;};'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 attributes=require(_0x47a5('0x5'));module[_0x47a5('0x6')]=function(_0x2a1a7e,_0x3717e1){return _0x2a1a7e[_0x47a5('0x7')]('OpenchannelTransferReport',attributes,{'tableName':_0x47a5('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x814b=['lodash','util','../../config/logger','api','moment','bluebird','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid'];(function(_0x1d3a4d,_0x7a4edb){var _0x122e3d=function(_0x80daaa){while(--_0x80daaa){_0x1d3a4d['push'](_0x1d3a4d['shift']());}};_0x122e3d(++_0x7a4edb);}(_0x814b,0x1a2));var _0xb814=function(_0x39cad6,_0x1edf41){_0x39cad6=_0x39cad6-0x0;var _0x5a82f2=_0x814b[_0x39cad6];return _0x5a82f2;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var attributes=require(_0xb814('0x6'));module[_0xb814('0x7')]=function(_0x258866,_0x4237bc){return _0x258866[_0xb814('0x8')](_0xb814('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xb814('0xa'),'fields':[_0xb814('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index e7e5305..a4c70a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x837c=['rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x58f8f6,_0x207b30){var _0x1569dc=function(_0x494d51){while(--_0x494d51){_0x58f8f6['push'](_0x58f8f6['shift']());}};_0x1569dc(++_0x207b30);}(_0x837c,0x6c));var _0xc837=function(_0x37cf70,_0x3a4c38){_0x37cf70=_0x37cf70-0x0;var _0xc24675=_0x837c[_0x37cf70];return _0xc24675;};'use strict';var _=require(_0xc837('0x0'));var util=require('util');var moment=require(_0xc837('0x1'));var BPromise=require(_0xc837('0x2'));var rs=require(_0xc837('0x3'));var fs=require('fs');var db=require(_0xc837('0x4'))['db'];var utils=require(_0xc837('0x5'));var logger=require(_0xc837('0x6'))(_0xc837('0x7'));var config=require(_0xc837('0x8'));var jayson=require(_0xc837('0x9'));var client=jayson[_0xc837('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ddcbe,_0x5f42f0,_0xc76b64){return new BPromise(function(_0x4d78b6,_0x272baf){return client[_0xc837('0xb')](_0x5ddcbe,_0xc76b64)[_0xc837('0xc')](function(_0x13a0ad){logger[_0xc837('0xd')](_0xc837('0xe'),_0x5f42f0,_0xc837('0xf'));logger[_0xc837('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x5f42f0,_0xc837('0xf'),JSON[_0xc837('0x11')](_0x13a0ad));if(_0x13a0ad[_0xc837('0x12')]){if(_0x13a0ad[_0xc837('0x12')][_0xc837('0x13')]===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x5f42f0,_0x13a0ad[_0xc837('0x12')][_0xc837('0x14')]);return _0x272baf(_0x13a0ad[_0xc837('0x12')]['message']);}logger['error'](_0xc837('0xe'),_0x5f42f0,_0x13a0ad[_0xc837('0x12')]['message']);return _0x4d78b6(_0x13a0ad[_0xc837('0x12')]['message']);}else{logger[_0xc837('0xd')](_0xc837('0xe'),_0x5f42f0,_0xc837('0xf'));_0x4d78b6(_0x13a0ad[_0xc837('0x15')][_0xc837('0x14')]);}})[_0xc837('0x16')](function(_0x2b7b7c){logger['error'](_0xc837('0xe'),_0x5f42f0,_0x2b7b7c);_0x272baf(_0x2b7b7c);});});}
\ No newline at end of file
+var _0xff7a=['message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4cedbe,_0x17c16d){var _0x47aee5=function(_0x24150d){while(--_0x24150d){_0x4cedbe['push'](_0x4cedbe['shift']());}};_0x47aee5(++_0x17c16d);}(_0xff7a,0x66));var _0xaff7=function(_0x2d759f,_0x481542){_0x2d759f=_0x2d759f-0x0;var _0x587bc0=_0xff7a[_0x2d759f];return _0x587bc0;};'use strict';var _=require(_0xaff7('0x0'));var util=require(_0xaff7('0x1'));var moment=require(_0xaff7('0x2'));var BPromise=require(_0xaff7('0x3'));var rs=require(_0xaff7('0x4'));var fs=require('fs');var db=require(_0xaff7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaff7('0x6'))('rpc');var config=require(_0xaff7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xaff7('0x8')][_0xaff7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc8a8f4,_0xe19d6b,_0x505689){return new BPromise(function(_0x28b147,_0x172e9a){return client['request'](_0xc8a8f4,_0x505689)['then'](function(_0x58971b){logger[_0xaff7('0xa')](_0xaff7('0xb'),_0xe19d6b,_0xaff7('0xc'));logger[_0xaff7('0xd')](_0xaff7('0xe'),_0xe19d6b,_0xaff7('0xc'),JSON[_0xaff7('0xf')](_0x58971b));if(_0x58971b[_0xaff7('0x10')]){if(_0x58971b[_0xaff7('0x10')][_0xaff7('0x11')]===0x1f4){logger[_0xaff7('0x10')](_0xaff7('0xb'),_0xe19d6b,_0x58971b[_0xaff7('0x10')][_0xaff7('0x12')]);return _0x172e9a(_0x58971b[_0xaff7('0x10')][_0xaff7('0x12')]);}logger[_0xaff7('0x10')](_0xaff7('0xb'),_0xe19d6b,_0x58971b['error']['message']);return _0x28b147(_0x58971b[_0xaff7('0x10')][_0xaff7('0x12')]);}else{logger[_0xaff7('0xa')](_0xaff7('0xb'),_0xe19d6b,_0xaff7('0xc'));_0x28b147(_0x58971b[_0xaff7('0x13')][_0xaff7('0x12')]);}})['catch'](function(_0x2c557b){logger[_0xaff7('0x10')](_0xaff7('0xb'),_0xe19d6b,_0x2c557b);_0x172e9a(_0x2c557b);});});}
\ No newline at end of file
index 405d905..850b63d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0f4=['put','delete','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','/:id','post','create'];(function(_0x2f2b9c,_0x2e425b){var _0x2e764e=function(_0x103645){while(--_0x103645){_0x2f2b9c['push'](_0x2f2b9c['shift']());}};_0x2e764e(++_0x2e425b);}(_0xe0f4,0x8a));var _0x4e0f=function(_0x4b51fb,_0x2ff39a){_0x4b51fb=_0x4b51fb-0x0;var _0x33a8fb=_0xe0f4[_0x4b51fb];return _0x33a8fb;};'use strict';var multer=require('multer');var util=require(_0x4e0f('0x0'));var path=require(_0x4e0f('0x1'));var express=require(_0x4e0f('0x2'));var router=express['Router']();var auth=require(_0x4e0f('0x3'));var interaction=require(_0x4e0f('0x4'));var config=require(_0x4e0f('0x5'));var controller=require(_0x4e0f('0x6'));router['get']('/',auth[_0x4e0f('0x7')](),controller[_0x4e0f('0x8')]);router['get'](_0x4e0f('0x9'),auth[_0x4e0f('0x7')](),controller['show']);router[_0x4e0f('0xa')]('/',auth[_0x4e0f('0x7')](),controller[_0x4e0f('0xb')]);router[_0x4e0f('0xc')](_0x4e0f('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x4e0f('0xd')](_0x4e0f('0x9'),auth[_0x4e0f('0x7')](),controller['destroy']);module[_0x4e0f('0xe')]=router;
\ No newline at end of file
+var _0x9004=['/:id','show','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./pause.controller','get','isAuthenticated','index'];(function(_0x1d3282,_0x3b62de){var _0x46532c=function(_0x1cb355){while(--_0x1cb355){_0x1d3282['push'](_0x1d3282['shift']());}};_0x46532c(++_0x3b62de);}(_0x9004,0xec));var _0x4900=function(_0x57a992,_0x7a362e){_0x57a992=_0x57a992-0x0;var _0x19af0b=_0x9004[_0x57a992];return _0x19af0b;};'use strict';var multer=require(_0x4900('0x0'));var util=require(_0x4900('0x1'));var path=require(_0x4900('0x2'));var express=require(_0x4900('0x3'));var router=express[_0x4900('0x4')]();var auth=require(_0x4900('0x5'));var interaction=require(_0x4900('0x6'));var config=require('../../config/environment');var controller=require(_0x4900('0x7'));router[_0x4900('0x8')]('/',auth[_0x4900('0x9')](),controller[_0x4900('0xa')]);router['get'](_0x4900('0xb'),auth['isAuthenticated'](),controller[_0x4900('0xc')]);router[_0x4900('0xd')]('/',auth[_0x4900('0x9')](),controller[_0x4900('0xe')]);router[_0x4900('0xf')](_0x4900('0xb'),auth[_0x4900('0x9')](),controller[_0x4900('0x10')]);router[_0x4900('0x11')](_0x4900('0xb'),auth[_0x4900('0x9')](),controller[_0x4900('0x12')]);module['exports']=router;
\ No newline at end of file
index fb0d824..c13d877 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaba5=['sequelize','STRING','name'];(function(_0x27f75c,_0x96f4b0){var _0xfae3ba=function(_0x314c9c){while(--_0x314c9c){_0x27f75c['push'](_0x27f75c['shift']());}};_0xfae3ba(++_0x96f4b0);}(_0xaba5,0x1e9));var _0x5aba=function(_0xa8f29b,_0x6e0b0d){_0xa8f29b=_0xa8f29b-0x0;var _0x8ba79f=_0xaba5[_0xa8f29b];return _0x8ba79f;};'use strict';var Sequelize=require(_0x5aba('0x0'));module['exports']={'name':{'type':Sequelize[_0x5aba('0x1')],'unique':_0x5aba('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x5aba('0x1')]}};
\ No newline at end of file
+var _0xd1ee=['sequelize','exports','STRING'];(function(_0x2c9db2,_0x65ff16){var _0x18eb9c=function(_0x3144e9){while(--_0x3144e9){_0x2c9db2['push'](_0x2c9db2['shift']());}};_0x18eb9c(++_0x65ff16);}(_0xd1ee,0xc9));var _0xed1e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd1ee[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xed1e('0x0'));module[_0xed1e('0x1')]={'name':{'type':Sequelize[_0xed1e('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xed1e('0x2')]}};
\ No newline at end of file
index a2d1640..e985e8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9744=['mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','destroy','error','name','send','index','Pause','rawAttributes','model','keys','dateStart','query','dateEnd','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','add','day','merge','where','filter','options','includeAll','include','rows','catch','params','length','create','body','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9744,0x1ea));var _0x4974=function(_0x4fe49b,_0x4a058e){_0x4fe49b=_0x4fe49b-0x0;var _0x262657=_0x9744[_0x4fe49b];return _0x262657;};'use strict';var pdf=require(_0x4974('0x0'));var emlformat=require(_0x4974('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4974('0x2'));var jsonpatch=require(_0x4974('0x3'));var rp=require(_0x4974('0x4'));var moment=require(_0x4974('0x5'));var BPromise=require(_0x4974('0x6'));var Mustache=require(_0x4974('0x7'));var util=require(_0x4974('0x8'));var path=require(_0x4974('0x9'));var sox=require(_0x4974('0xa'));var csv=require(_0x4974('0xb'));var ejs=require(_0x4974('0xc'));var fs=require('fs');var _=require(_0x4974('0xd'));var squel=require(_0x4974('0xe'));var crypto=require(_0x4974('0xf'));var jsforce=require(_0x4974('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x4974('0xb'));var querystring=require(_0x4974('0x11'));var Papa=require(_0x4974('0x12'));var qs=require(_0x4974('0x13'));var logger=require('../../config/logger')(_0x4974('0x14'));var utils=require(_0x4974('0x15'));var config=require(_0x4974('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5acc74,_0x12f80d){_0x12f80d=_0x12f80d||0xcc;return function(_0x24382d){if(_0x24382d){return _0x5acc74[_0x4974('0x17')](_0x12f80d);}return _0x5acc74[_0x4974('0x18')](_0x12f80d)[_0x4974('0x19')]();};}function respondWithResult(_0x168bdb,_0x5d3891){_0x5d3891=_0x5d3891||0xc8;return function(_0x61ccfa){if(_0x61ccfa){return _0x168bdb[_0x4974('0x18')](_0x5d3891)[_0x4974('0x1a')](_0x61ccfa);}};}function respondWithFilteredResult(_0x45be75,_0x310c99){return function(_0x30f063){if(_0x30f063){var _0x4d8f9a=_0x30f063[_0x4974('0x1b')],_0x374e7c=_0x310c99[_0x4974('0x1c')],_0x4305ab=_0x310c99[_0x4974('0x1c')]+_0x310c99[_0x4974('0x1d')],_0x31a947;if(_0x4305ab>=_0x4d8f9a){_0x4305ab=_0x4d8f9a;_0x31a947=0xc8;}else{_0x31a947=0xce;}_0x45be75[_0x4974('0x18')](_0x31a947);return _0x45be75['set']('Content-Range',_0x374e7c+'-'+_0x4305ab+'/'+_0x4d8f9a)['json'](_0x30f063);}return null;};}function patchUpdates(_0x216a23){return function(_0x91020d){try{jsonpatch[_0x4974('0x1e')](_0x91020d,_0x216a23,!![]);}catch(_0x1e5ce7){return BPromise[_0x4974('0x1f')](_0x1e5ce7);}return _0x91020d[_0x4974('0x20')]();};}function saveUpdates(_0x25c458,_0x44190d){return function(_0x394cd8){if(_0x394cd8){return _0x394cd8[_0x4974('0x21')](_0x25c458)[_0x4974('0x22')](function(_0x3f7dee){return _0x3f7dee;});}return null;};}function removeEntity(_0x3ff61d,_0x3e1808){return function(_0x191f62){if(_0x191f62){return _0x191f62[_0x4974('0x23')]()[_0x4974('0x22')](function(){_0x3ff61d[_0x4974('0x18')](0xcc)[_0x4974('0x19')]();});}};}function handleEntityNotFound(_0x2aea22,_0x40ca12){return function(_0x36011f){if(!_0x36011f){_0x2aea22[_0x4974('0x17')](0x194);}return _0x36011f;};}function handleError(_0x4e3625,_0x1cad93){_0x1cad93=_0x1cad93||0x1f4;return function(_0x238701){logger[_0x4974('0x24')](_0x238701['stack']);if(_0x238701['name']){delete _0x238701[_0x4974('0x25')];}_0x4e3625[_0x4974('0x18')](_0x1cad93)[_0x4974('0x26')](_0x238701);};}exports[_0x4974('0x27')]=function(_0x2527f3,_0x5a0818){var _0x1a6090={},_0x47aa58={},_0x3c1c87={'count':0x0,'rows':[]};var _0x37189d=db[_0x4974('0x28')][_0x4974('0x29')];_0x47aa58[_0x4974('0x2a')]=_[_0x4974('0x2b')](_0x37189d);var _0x5b2a6a={'dateStart':_0x2527f3['query'][_0x4974('0x2c')],'dateEnd':_0x2527f3[_0x4974('0x2d')][_0x4974('0x2e')]};delete _0x2527f3['query'][_0x4974('0x2c')];delete _0x2527f3[_0x4974('0x2d')][_0x4974('0x2e')];_0x47aa58[_0x4974('0x2d')]=_[_0x4974('0x2b')](_0x2527f3[_0x4974('0x2d')]);_0x47aa58[_0x4974('0x2f')]=_[_0x4974('0x30')](_0x47aa58['model'],_0x47aa58[_0x4974('0x2d')]);_0x1a6090[_0x4974('0x31')]=_[_0x4974('0x30')](_0x47aa58['model'],qs[_0x4974('0x32')](_0x2527f3['query'][_0x4974('0x32')]));_0x1a6090[_0x4974('0x31')]=_0x1a6090[_0x4974('0x31')]['length']?_0x1a6090[_0x4974('0x31')]:_0x47aa58[_0x4974('0x2a')];if(!_0x2527f3[_0x4974('0x2d')][_0x4974('0x33')](_0x4974('0x34'))){_0x1a6090['limit']=qs[_0x4974('0x1d')](_0x2527f3['query'][_0x4974('0x1d')]);_0x1a6090['offset']=qs[_0x4974('0x1c')](_0x2527f3[_0x4974('0x2d')][_0x4974('0x1c')]);}_0x1a6090[_0x4974('0x35')]=qs[_0x4974('0x36')](_0x2527f3[_0x4974('0x2d')]['sort']);_0x1a6090['where']=qs['filters'](_[_0x4974('0x37')](_0x2527f3[_0x4974('0x2d')],_0x47aa58[_0x4974('0x2f')]));if(_0x5b2a6a[_0x4974('0x2c')]){if(_0x5b2a6a[_0x4974('0x2e')]){_0x5b2a6a['dateEnd']=moment(_0x5b2a6a[_0x4974('0x2e')])[_0x4974('0x38')](0x1,_0x4974('0x39'));}else{_0x5b2a6a[_0x4974('0x2e')]=moment(_0x5b2a6a['dateStart'])[_0x4974('0x38')](0x1,_0x4974('0x39'));}_[_0x4974('0x3a')](_0x1a6090[_0x4974('0x3b')],{'createdAt':{'$gte':_0x5b2a6a[_0x4974('0x2c')],'$lte':_0x5b2a6a[_0x4974('0x2e')]}});}if(_0x2527f3[_0x4974('0x2d')][_0x4974('0x3c')]){_0x1a6090['where']=_[_0x4974('0x3a')](_0x1a6090[_0x4974('0x3b')],{'$or':_['map'](_0x1a6090[_0x4974('0x31')],function(_0x6f26a0){var _0x338690={};_0x338690[_0x6f26a0]={'$like':'%'+_0x2527f3[_0x4974('0x2d')][_0x4974('0x3c')]+'%'};return _0x338690;})});}_0x1a6090=_[_0x4974('0x3a')]({},_0x1a6090,_0x2527f3[_0x4974('0x3d')]);var _0x4199f9={'where':_0x1a6090[_0x4974('0x3b')]};return db[_0x4974('0x28')][_0x4974('0x1b')](_0x4199f9)[_0x4974('0x22')](function(_0x5ed694){_0x3c1c87[_0x4974('0x1b')]=_0x5ed694;if(_0x2527f3[_0x4974('0x2d')][_0x4974('0x3e')]){_0x1a6090[_0x4974('0x3f')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x1a6090);})[_0x4974('0x22')](function(_0x1d2eee){_0x3c1c87[_0x4974('0x40')]=_0x1d2eee;return _0x3c1c87;})[_0x4974('0x22')](respondWithFilteredResult(_0x5a0818,_0x1a6090))[_0x4974('0x41')](handleError(_0x5a0818,null));};exports['show']=function(_0x428804,_0x3f74a1){var _0x410fc3={'raw':!![],'where':{'id':_0x428804[_0x4974('0x42')]['id']}},_0x4ad15e={};_0x4ad15e['model']=_[_0x4974('0x2b')](db[_0x4974('0x28')]['rawAttributes']);_0x4ad15e[_0x4974('0x2d')]=_[_0x4974('0x2b')](_0x428804[_0x4974('0x2d')]);_0x4ad15e[_0x4974('0x2f')]=_[_0x4974('0x30')](_0x4ad15e[_0x4974('0x2a')],_0x4ad15e['query']);_0x410fc3[_0x4974('0x31')]=_['intersection'](_0x4ad15e[_0x4974('0x2a')],qs[_0x4974('0x32')](_0x428804[_0x4974('0x2d')][_0x4974('0x32')]));_0x410fc3[_0x4974('0x31')]=_0x410fc3[_0x4974('0x31')][_0x4974('0x43')]?_0x410fc3[_0x4974('0x31')]:_0x4ad15e['model'];if(_0x428804[_0x4974('0x2d')][_0x4974('0x3e')]){_0x410fc3[_0x4974('0x3f')]=[{'all':!![]}];}_0x410fc3=_[_0x4974('0x3a')]({},_0x410fc3,_0x428804[_0x4974('0x3d')]);return db[_0x4974('0x28')]['find'](_0x410fc3)[_0x4974('0x22')](handleEntityNotFound(_0x3f74a1,null))[_0x4974('0x22')](respondWithResult(_0x3f74a1,null))[_0x4974('0x41')](handleError(_0x3f74a1,null));};exports[_0x4974('0x44')]=function(_0x3298de,_0x1a0ae3){return db[_0x4974('0x28')][_0x4974('0x44')](_0x3298de['body'],{})[_0x4974('0x22')](respondWithResult(_0x1a0ae3,0xc9))[_0x4974('0x41')](handleError(_0x1a0ae3,null));};exports['update']=function(_0x976302,_0x32065e){if(_0x976302[_0x4974('0x45')]['id']){delete _0x976302[_0x4974('0x45')]['id'];}return db[_0x4974('0x28')][_0x4974('0x46')]({'where':{'id':_0x976302['params']['id']}})[_0x4974('0x22')](handleEntityNotFound(_0x32065e,null))[_0x4974('0x22')](saveUpdates(_0x976302['body'],null))[_0x4974('0x22')](respondWithResult(_0x32065e,null))[_0x4974('0x41')](handleError(_0x32065e,null));};exports[_0x4974('0x23')]=function(_0x224bb9,_0x1ac749){return db[_0x4974('0x28')][_0x4974('0x46')]({'where':{'id':_0x224bb9[_0x4974('0x42')]['id']}})['then'](handleEntityNotFound(_0x1ac749,null))[_0x4974('0x22')](removeEntity(_0x1ac749,null))[_0x4974('0x41')](handleError(_0x1ac749,null));};
\ No newline at end of file
+var _0x60c7=['sort','where','day','filter','merge','map','options','count','includeAll','findAll','rows','catch','show','params','keys','find','create','body','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','set','Content-Range','save','update','then','destroy','error','stack','send','index','Pause','rawAttributes','dateStart','query','dateEnd','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order'];(function(_0x577b0,_0x5721ff){var _0x2c2060=function(_0x58c5cc){while(--_0x58c5cc){_0x577b0['push'](_0x577b0['shift']());}};_0x2c2060(++_0x5721ff);}(_0x60c7,0x19e));var _0x760c=function(_0x4ba7a0,_0x2e3493){_0x4ba7a0=_0x4ba7a0-0x0;var _0x327fce=_0x60c7[_0x4ba7a0];return _0x327fce;};'use strict';var pdf=require(_0x760c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x760c('0x1'));var zipdir=require(_0x760c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x760c('0x3'));var moment=require(_0x760c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x760c('0x5'));var util=require(_0x760c('0x6'));var path=require(_0x760c('0x7'));var sox=require(_0x760c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x760c('0x9'));var deskjs=require(_0x760c('0xa'));var toCsv=require(_0x760c('0xb'));var querystring=require(_0x760c('0xc'));var Papa=require(_0x760c('0xd'));var qs=require(_0x760c('0xe'));var logger=require(_0x760c('0xf'))('api');var utils=require(_0x760c('0x10'));var config=require(_0x760c('0x11'));var db=require(_0x760c('0x12'))['db'];function respondWithStatusCode(_0x71649,_0x4253c4){_0x4253c4=_0x4253c4||0xcc;return function(_0x16e11a){if(_0x16e11a){return _0x71649[_0x760c('0x13')](_0x4253c4);}return _0x71649[_0x760c('0x14')](_0x4253c4)[_0x760c('0x15')]();};}function respondWithResult(_0x1e5a1f,_0x3d77ef){_0x3d77ef=_0x3d77ef||0xc8;return function(_0x5b14c7){if(_0x5b14c7){return _0x1e5a1f[_0x760c('0x14')](_0x3d77ef)['json'](_0x5b14c7);}};}function respondWithFilteredResult(_0x28167d,_0x3de71b){return function(_0x128f6d){if(_0x128f6d){var _0x1bde00=_0x128f6d['count'],_0x46c9b9=_0x3de71b['offset'],_0x3f83a5=_0x3de71b['offset']+_0x3de71b[_0x760c('0x16')],_0x516731;if(_0x3f83a5>=_0x1bde00){_0x3f83a5=_0x1bde00;_0x516731=0xc8;}else{_0x516731=0xce;}_0x28167d[_0x760c('0x14')](_0x516731);return _0x28167d[_0x760c('0x17')](_0x760c('0x18'),_0x46c9b9+'-'+_0x3f83a5+'/'+_0x1bde00)['json'](_0x128f6d);}return null;};}function patchUpdates(_0x45dd69){return function(_0xedc0ea){try{jsonpatch['apply'](_0xedc0ea,_0x45dd69,!![]);}catch(_0x50a6cf){return BPromise['reject'](_0x50a6cf);}return _0xedc0ea[_0x760c('0x19')]();};}function saveUpdates(_0x569636,_0x2d6756){return function(_0x4b5628){if(_0x4b5628){return _0x4b5628[_0x760c('0x1a')](_0x569636)[_0x760c('0x1b')](function(_0x10d087){return _0x10d087;});}return null;};}function removeEntity(_0x52d47f,_0x38a6e6){return function(_0x27fe05){if(_0x27fe05){return _0x27fe05[_0x760c('0x1c')]()[_0x760c('0x1b')](function(){_0x52d47f['status'](0xcc)[_0x760c('0x15')]();});}};}function handleEntityNotFound(_0x59b226,_0x4fa1d1){return function(_0x1544da){if(!_0x1544da){_0x59b226[_0x760c('0x13')](0x194);}return _0x1544da;};}function handleError(_0x52aa80,_0x232824){_0x232824=_0x232824||0x1f4;return function(_0x3058ca){logger[_0x760c('0x1d')](_0x3058ca[_0x760c('0x1e')]);if(_0x3058ca['name']){delete _0x3058ca['name'];}_0x52aa80['status'](_0x232824)[_0x760c('0x1f')](_0x3058ca);};}exports[_0x760c('0x20')]=function(_0x496043,_0x26064f){var _0x1bc147={},_0x3d9a6b={},_0xb823b2={'count':0x0,'rows':[]};var _0xd232f2=db[_0x760c('0x21')][_0x760c('0x22')];_0x3d9a6b['model']=_['keys'](_0xd232f2);var _0xb2c9cb={'dateStart':_0x496043['query'][_0x760c('0x23')],'dateEnd':_0x496043[_0x760c('0x24')][_0x760c('0x25')]};delete _0x496043['query']['dateStart'];delete _0x496043[_0x760c('0x24')][_0x760c('0x25')];_0x3d9a6b[_0x760c('0x24')]=_['keys'](_0x496043[_0x760c('0x24')]);_0x3d9a6b[_0x760c('0x26')]=_[_0x760c('0x27')](_0x3d9a6b['model'],_0x3d9a6b['query']);_0x1bc147['attributes']=_[_0x760c('0x27')](_0x3d9a6b[_0x760c('0x28')],qs[_0x760c('0x29')](_0x496043[_0x760c('0x24')][_0x760c('0x29')]));_0x1bc147[_0x760c('0x2a')]=_0x1bc147[_0x760c('0x2a')][_0x760c('0x2b')]?_0x1bc147[_0x760c('0x2a')]:_0x3d9a6b['model'];if(!_0x496043['query'][_0x760c('0x2c')](_0x760c('0x2d'))){_0x1bc147['limit']=qs[_0x760c('0x16')](_0x496043['query'][_0x760c('0x16')]);_0x1bc147['offset']=qs[_0x760c('0x2e')](_0x496043[_0x760c('0x24')]['offset']);}_0x1bc147[_0x760c('0x2f')]=qs[_0x760c('0x30')](_0x496043[_0x760c('0x24')][_0x760c('0x30')]);_0x1bc147[_0x760c('0x31')]=qs[_0x760c('0x26')](_['pick'](_0x496043['query'],_0x3d9a6b[_0x760c('0x26')]));if(_0xb2c9cb[_0x760c('0x23')]){if(_0xb2c9cb[_0x760c('0x25')]){_0xb2c9cb[_0x760c('0x25')]=moment(_0xb2c9cb['dateEnd'])['add'](0x1,'day');}else{_0xb2c9cb['dateEnd']=moment(_0xb2c9cb[_0x760c('0x23')])['add'](0x1,_0x760c('0x32'));}_['merge'](_0x1bc147[_0x760c('0x31')],{'createdAt':{'$gte':_0xb2c9cb[_0x760c('0x23')],'$lte':_0xb2c9cb['dateEnd']}});}if(_0x496043['query'][_0x760c('0x33')]){_0x1bc147[_0x760c('0x31')]=_[_0x760c('0x34')](_0x1bc147['where'],{'$or':_[_0x760c('0x35')](_0x1bc147[_0x760c('0x2a')],function(_0x2be05d){var _0x3fdc10={};_0x3fdc10[_0x2be05d]={'$like':'%'+_0x496043['query'][_0x760c('0x33')]+'%'};return _0x3fdc10;})});}_0x1bc147=_[_0x760c('0x34')]({},_0x1bc147,_0x496043[_0x760c('0x36')]);var _0x3384e6={'where':_0x1bc147[_0x760c('0x31')]};return db['Pause'][_0x760c('0x37')](_0x3384e6)['then'](function(_0x4ab3f0){_0xb823b2[_0x760c('0x37')]=_0x4ab3f0;if(_0x496043['query'][_0x760c('0x38')]){_0x1bc147['include']=[{'all':!![]}];}return db['Pause'][_0x760c('0x39')](_0x1bc147);})[_0x760c('0x1b')](function(_0x425a8e){_0xb823b2[_0x760c('0x3a')]=_0x425a8e;return _0xb823b2;})['then'](respondWithFilteredResult(_0x26064f,_0x1bc147))[_0x760c('0x3b')](handleError(_0x26064f,null));};exports[_0x760c('0x3c')]=function(_0x3e88bf,_0x276b6e){var _0x5239b2={'raw':!![],'where':{'id':_0x3e88bf[_0x760c('0x3d')]['id']}},_0x52b686={};_0x52b686['model']=_[_0x760c('0x3e')](db[_0x760c('0x21')]['rawAttributes']);_0x52b686[_0x760c('0x24')]=_[_0x760c('0x3e')](_0x3e88bf[_0x760c('0x24')]);_0x52b686['filters']=_[_0x760c('0x27')](_0x52b686[_0x760c('0x28')],_0x52b686[_0x760c('0x24')]);_0x5239b2[_0x760c('0x2a')]=_[_0x760c('0x27')](_0x52b686[_0x760c('0x28')],qs[_0x760c('0x29')](_0x3e88bf[_0x760c('0x24')]['fields']));_0x5239b2['attributes']=_0x5239b2[_0x760c('0x2a')]['length']?_0x5239b2[_0x760c('0x2a')]:_0x52b686[_0x760c('0x28')];if(_0x3e88bf[_0x760c('0x24')][_0x760c('0x38')]){_0x5239b2['include']=[{'all':!![]}];}_0x5239b2=_[_0x760c('0x34')]({},_0x5239b2,_0x3e88bf[_0x760c('0x36')]);return db[_0x760c('0x21')][_0x760c('0x3f')](_0x5239b2)[_0x760c('0x1b')](handleEntityNotFound(_0x276b6e,null))[_0x760c('0x1b')](respondWithResult(_0x276b6e,null))[_0x760c('0x3b')](handleError(_0x276b6e,null));};exports['create']=function(_0x4e2625,_0x4ab27a){return db[_0x760c('0x21')][_0x760c('0x40')](_0x4e2625[_0x760c('0x41')],{})[_0x760c('0x1b')](respondWithResult(_0x4ab27a,0xc9))[_0x760c('0x3b')](handleError(_0x4ab27a,null));};exports[_0x760c('0x1a')]=function(_0x3ffe7a,_0x2a849c){if(_0x3ffe7a[_0x760c('0x41')]['id']){delete _0x3ffe7a[_0x760c('0x41')]['id'];}return db['Pause']['find']({'where':{'id':_0x3ffe7a['params']['id']}})[_0x760c('0x1b')](handleEntityNotFound(_0x2a849c,null))[_0x760c('0x1b')](saveUpdates(_0x3ffe7a['body'],null))[_0x760c('0x1b')](respondWithResult(_0x2a849c,null))['catch'](handleError(_0x2a849c,null));};exports['destroy']=function(_0x533474,_0x27cdf7){return db['Pause'][_0x760c('0x3f')]({'where':{'id':_0x533474['params']['id']}})['then'](handleEntityNotFound(_0x27cdf7,null))[_0x760c('0x1b')](removeEntity(_0x27cdf7,null))['catch'](handleError(_0x27cdf7,null));};
\ No newline at end of file
index 48dcdfa..63ce437 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e23=['exports','define','lodash','util','../../config/logger','moment','request-promise','./pause.attributes'];(function(_0x3dea94,_0x252e1d){var _0x58c77a=function(_0x59ddbc){while(--_0x59ddbc){_0x3dea94['push'](_0x3dea94['shift']());}};_0x58c77a(++_0x252e1d);}(_0x6e23,0x17a));var _0x36e2=function(_0xd5e52e,_0x2c73ec){_0xd5e52e=_0xd5e52e-0x0;var _0xc02a03=_0x6e23[_0xd5e52e];return _0xc02a03;};'use strict';var _=require(_0x36e2('0x0'));var util=require(_0x36e2('0x1'));var logger=require(_0x36e2('0x2'))('api');var moment=require(_0x36e2('0x3'));var BPromise=require('bluebird');var rp=require(_0x36e2('0x4'));var attributes=require(_0x36e2('0x5'));module[_0x36e2('0x6')]=function(_0x228377,_0xf9268d){return _0x228377[_0x36e2('0x7')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe2f4=['tools_pauses','lodash','../../config/logger','api','moment','./pause.attributes','exports','define','Pause'];(function(_0x32866a,_0x3bdcbb){var _0x110d4d=function(_0x3c5948){while(--_0x3c5948){_0x32866a['push'](_0x32866a['shift']());}};_0x110d4d(++_0x3bdcbb);}(_0xe2f4,0x157));var _0x4e2f=function(_0x5afb00,_0x36574f){_0x5afb00=_0x5afb00-0x0;var _0x1c6d3c=_0xe2f4[_0x5afb00];return _0x1c6d3c;};'use strict';var _=require(_0x4e2f('0x0'));var util=require('util');var logger=require(_0x4e2f('0x1'))(_0x4e2f('0x2'));var moment=require(_0x4e2f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x4e2f('0x4'));module[_0x4e2f('0x5')]=function(_0x4f4948,_0x54f198){return _0x4f4948[_0x4e2f('0x6')](_0x4e2f('0x7'),attributes,{'tableName':_0x4e2f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 72807bf..699fb6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad0e=['error','code','message','catch','ShowPause','options','raw','attributes','include','model','map','debug','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Pause,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x6185d7,_0x42aef4){var _0xa0417c=function(_0x5aadcd){while(--_0x5aadcd){_0x6185d7['push'](_0x6185d7['shift']());}};_0xa0417c(++_0x42aef4);}(_0xad0e,0x1a1));var _0xead0=function(_0x2760a3,_0x421a60){_0x2760a3=_0x2760a3-0x0;var _0x31b391=_0xad0e[_0x2760a3];return _0x31b391;};'use strict';var _=require(_0xead0('0x0'));var util=require('util');var moment=require(_0xead0('0x1'));var BPromise=require(_0xead0('0x2'));var rs=require(_0xead0('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xead0('0x4'))(_0xead0('0x5'));var config=require(_0xead0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xead0('0x7')][_0xead0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1353d4,_0x52557a,_0x463a11){return new BPromise(function(_0x475d98,_0x4f7356){return client[_0xead0('0x9')](_0x1353d4,_0x463a11)[_0xead0('0xa')](function(_0xcdd80e){logger[_0xead0('0xb')](_0xead0('0xc'),_0x52557a,_0xead0('0xd'));logger['debug']('Pause,\x20%s,\x20%s,\x20%s',_0x52557a,_0xead0('0xd'),JSON[_0xead0('0xe')](_0xcdd80e));if(_0xcdd80e[_0xead0('0xf')]){if(_0xcdd80e[_0xead0('0xf')][_0xead0('0x10')]===0x1f4){logger[_0xead0('0xf')]('Pause,\x20%s,\x20%s',_0x52557a,_0xcdd80e[_0xead0('0xf')][_0xead0('0x11')]);return _0x4f7356(_0xcdd80e['error'][_0xead0('0x11')]);}logger['error']('Pause,\x20%s,\x20%s',_0x52557a,_0xcdd80e[_0xead0('0xf')]['message']);return _0x475d98(_0xcdd80e[_0xead0('0xf')][_0xead0('0x11')]);}else{logger[_0xead0('0xb')](_0xead0('0xc'),_0x52557a,'request\x20sent');_0x475d98(_0xcdd80e['result']['message']);}})[_0xead0('0x12')](function(_0x388e08){logger[_0xead0('0xf')]('Pause,\x20%s,\x20%s',_0x52557a,_0x388e08);_0x4f7356(_0x388e08);});});}exports[_0xead0('0x13')]=function(_0x27b10b){var _0x4bcbd2=this;return new Promise(function(_0x21a10c,_0x42f207){return db['Pause']['find']({'raw':_0x27b10b[_0xead0('0x14')]?_0x27b10b[_0xead0('0x14')][_0xead0('0x15')]===undefined?!![]:![]:!![],'where':_0x27b10b[_0xead0('0x14')]?_0x27b10b[_0xead0('0x14')]['where']||null:null,'attributes':_0x27b10b[_0xead0('0x14')]?_0x27b10b[_0xead0('0x14')][_0xead0('0x16')]||null:null,'include':_0x27b10b[_0xead0('0x14')]?_0x27b10b[_0xead0('0x14')][_0xead0('0x17')]?_['map'](_0x27b10b[_0xead0('0x14')][_0xead0('0x17')],function(_0x201e6b){return{'model':db[_0x201e6b[_0xead0('0x18')]],'as':_0x201e6b['as'],'attributes':_0x201e6b[_0xead0('0x16')],'include':_0x201e6b[_0xead0('0x17')]?_[_0xead0('0x19')](_0x201e6b['include'],function(_0x44d33d){return{'model':db[_0x44d33d[_0xead0('0x18')]],'as':_0x44d33d['as'],'attributes':_0x44d33d['attributes'],'include':_0x44d33d[_0xead0('0x17')]?_[_0xead0('0x19')](_0x44d33d[_0xead0('0x17')],function(_0x40585f){return{'model':db[_0x40585f[_0xead0('0x18')]],'as':_0x40585f['as'],'attributes':_0x40585f[_0xead0('0x16')]};}):[]};}):[]};}):[]:[]})[_0xead0('0xa')](function(_0x427557){logger[_0xead0('0xb')]('ShowPause',_0x27b10b);logger[_0xead0('0x1a')]('ShowPause',_0x27b10b,JSON[_0xead0('0xe')](_0x427557));_0x21a10c(_0x427557);})['catch'](function(_0xb2b6bb){logger['error'](_0xead0('0x13'),_0xb2b6bb[_0xead0('0x11')],_0x27b10b);_0x42f207(_0x4bcbd2[_0xead0('0xf')](0x1f4,_0xb2b6bb['message']));});});};
\ No newline at end of file
+var _0xefc2=['stringify','error','code','Pause,\x20%s,\x20%s','message','result','catch','ShowPause','Pause','options','raw','where','attributes','map','include','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s'];(function(_0x699200,_0x39c101){var _0x266fd1=function(_0x1a9368){while(--_0x1a9368){_0x699200['push'](_0x699200['shift']());}};_0x266fd1(++_0x39c101);}(_0xefc2,0xf6));var _0x2efc=function(_0x1da7d4,_0x6f8517){_0x1da7d4=_0x1da7d4-0x0;var _0x2f031e=_0xefc2[_0x1da7d4];return _0x2f031e;};'use strict';var _=require(_0x2efc('0x0'));var util=require(_0x2efc('0x1'));var moment=require(_0x2efc('0x2'));var BPromise=require(_0x2efc('0x3'));var rs=require(_0x2efc('0x4'));var fs=require('fs');var db=require(_0x2efc('0x5'))['db'];var utils=require(_0x2efc('0x6'));var logger=require('../../config/logger')(_0x2efc('0x7'));var config=require(_0x2efc('0x8'));var jayson=require(_0x2efc('0x9'));var client=jayson[_0x2efc('0xa')][_0x2efc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x741526,_0x5ab414,_0x50ba33){return new BPromise(function(_0x3fe1c7,_0x16c479){return client[_0x2efc('0xc')](_0x741526,_0x50ba33)[_0x2efc('0xd')](function(_0x5100ea){logger[_0x2efc('0xe')]('Pause,\x20%s,\x20%s',_0x5ab414,_0x2efc('0xf'));logger[_0x2efc('0x10')](_0x2efc('0x11'),_0x5ab414,_0x2efc('0xf'),JSON[_0x2efc('0x12')](_0x5100ea));if(_0x5100ea[_0x2efc('0x13')]){if(_0x5100ea[_0x2efc('0x13')][_0x2efc('0x14')]===0x1f4){logger[_0x2efc('0x13')](_0x2efc('0x15'),_0x5ab414,_0x5100ea['error'][_0x2efc('0x16')]);return _0x16c479(_0x5100ea[_0x2efc('0x13')]['message']);}logger[_0x2efc('0x13')](_0x2efc('0x15'),_0x5ab414,_0x5100ea[_0x2efc('0x13')]['message']);return _0x3fe1c7(_0x5100ea[_0x2efc('0x13')]['message']);}else{logger[_0x2efc('0xe')]('Pause,\x20%s,\x20%s',_0x5ab414,_0x2efc('0xf'));_0x3fe1c7(_0x5100ea[_0x2efc('0x17')][_0x2efc('0x16')]);}})[_0x2efc('0x18')](function(_0xc5e6ea){logger['error'](_0x2efc('0x15'),_0x5ab414,_0xc5e6ea);_0x16c479(_0xc5e6ea);});});}exports[_0x2efc('0x19')]=function(_0x4e6085){var _0x50f414=this;return new Promise(function(_0x2b2605,_0x5c035c){return db[_0x2efc('0x1a')]['find']({'raw':_0x4e6085[_0x2efc('0x1b')]?_0x4e6085[_0x2efc('0x1b')][_0x2efc('0x1c')]===undefined?!![]:![]:!![],'where':_0x4e6085[_0x2efc('0x1b')]?_0x4e6085[_0x2efc('0x1b')][_0x2efc('0x1d')]||null:null,'attributes':_0x4e6085[_0x2efc('0x1b')]?_0x4e6085['options'][_0x2efc('0x1e')]||null:null,'include':_0x4e6085[_0x2efc('0x1b')]?_0x4e6085[_0x2efc('0x1b')]['include']?_[_0x2efc('0x1f')](_0x4e6085[_0x2efc('0x1b')]['include'],function(_0x5c11a5){return{'model':db[_0x5c11a5['model']],'as':_0x5c11a5['as'],'attributes':_0x5c11a5[_0x2efc('0x1e')],'include':_0x5c11a5[_0x2efc('0x20')]?_[_0x2efc('0x1f')](_0x5c11a5['include'],function(_0x33bfa5){return{'model':db[_0x33bfa5['model']],'as':_0x33bfa5['as'],'attributes':_0x33bfa5[_0x2efc('0x1e')],'include':_0x33bfa5[_0x2efc('0x20')]?_[_0x2efc('0x1f')](_0x33bfa5['include'],function(_0x1d171a){return{'model':db[_0x1d171a['model']],'as':_0x1d171a['as'],'attributes':_0x1d171a[_0x2efc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2efc('0xd')](function(_0x1c156e){logger[_0x2efc('0xe')](_0x2efc('0x19'),_0x4e6085);logger[_0x2efc('0x10')](_0x2efc('0x19'),_0x4e6085,JSON[_0x2efc('0x12')](_0x1c156e));_0x2b2605(_0x1c156e);})['catch'](function(_0x59d6ca){logger[_0x2efc('0x13')]('ShowPause',_0x59d6ca['message'],_0x4e6085);_0x5c035c(_0x50f414[_0x2efc('0x13')](0x1f4,_0x59d6ca['message']));});});};
\ No newline at end of file
index 82d2777..15f92cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4f5=['single','upload','webhookPost','put','update','delete','exports','util','path','../../config/environment','./plugin.controller','get','isAuthenticated','/webhook','webhookGet','/:id','diskStorage','root','originalname','replace','format','%s-%s%s','basename','extname','now','post'];(function(_0xb79925,_0x5b7779){var _0x3d8c81=function(_0x1e01a6){while(--_0x1e01a6){_0xb79925['push'](_0xb79925['shift']());}};_0x3d8c81(++_0x5b7779);}(_0xb4f5,0x13f));var _0x5b4f=function(_0xa89c3e,_0x144268){_0xa89c3e=_0xa89c3e-0x0;var _0x48072f=_0xb4f5[_0xa89c3e];return _0x48072f;};'use strict';var multer=require('multer');var util=require(_0x5b4f('0x0'));var path=require(_0x5b4f('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5b4f('0x2'));var controller=require(_0x5b4f('0x3'));router[_0x5b4f('0x4')]('/',auth[_0x5b4f('0x5')](),controller['index']);router[_0x5b4f('0x4')](_0x5b4f('0x6'),controller[_0x5b4f('0x7')]);router[_0x5b4f('0x4')](_0x5b4f('0x8'),auth[_0x5b4f('0x5')](),controller['show']);router[_0x5b4f('0x4')]('/:id/download',auth[_0x5b4f('0x5')](),controller['download']);var upload=multer({'storage':multer[_0x5b4f('0x9')]({'destination':function(_0x2cb83c,_0x1116c4,_0x325f37){_0x325f37(null,path['join'](config[_0x5b4f('0xa')],'server/files/plugins'));},'filename':function(_0x4271e3,_0x35dcd1,_0x3d450d){_0x35dcd1[_0x5b4f('0xb')]=_0x35dcd1[_0x5b4f('0xb')][_0x5b4f('0xc')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3d450d(null,util[_0x5b4f('0xd')](_0x5b4f('0xe'),path[_0x5b4f('0xf')](_0x35dcd1['originalname'],path[_0x5b4f('0x10')](_0x35dcd1['originalname'])),Date[_0x5b4f('0x11')](),path[_0x5b4f('0x10')](_0x35dcd1[_0x5b4f('0xb')])));}})});router[_0x5b4f('0x12')]('/',upload[_0x5b4f('0x13')]('file'),controller[_0x5b4f('0x14')]);router['post'](_0x5b4f('0x6'),controller[_0x5b4f('0x15')]);router[_0x5b4f('0x16')](_0x5b4f('0x8'),auth[_0x5b4f('0x5')](),controller[_0x5b4f('0x17')]);router[_0x5b4f('0x18')]('/:id',auth['isAuthenticated'](),controller['delete']);module[_0x5b4f('0x19')]=router;
\ No newline at end of file
+var _0xa3b9=['express','Router','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','show','download','diskStorage','join','root','server/files/plugins','originalname','replace','basename','now','extname','post','single','upload','put','/:id','update','delete','exports','multer','util'];(function(_0x2c5348,_0x31e703){var _0x4da429=function(_0x645bfa){while(--_0x645bfa){_0x2c5348['push'](_0x2c5348['shift']());}};_0x4da429(++_0x31e703);}(_0xa3b9,0x134));var _0x9a3b=function(_0x11a84d,_0x113114){_0x11a84d=_0x11a84d-0x0;var _0x35ab98=_0xa3b9[_0x11a84d];return _0x35ab98;};'use strict';var multer=require(_0x9a3b('0x0'));var util=require(_0x9a3b('0x1'));var path=require('path');var express=require(_0x9a3b('0x2'));var router=express[_0x9a3b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x9a3b('0x4'));var config=require(_0x9a3b('0x5'));var controller=require(_0x9a3b('0x6'));router[_0x9a3b('0x7')]('/',auth[_0x9a3b('0x8')](),controller[_0x9a3b('0x9')]);router[_0x9a3b('0x7')](_0x9a3b('0xa'),controller[_0x9a3b('0xb')]);router[_0x9a3b('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x9a3b('0xc')]);router[_0x9a3b('0x7')]('/:id/download',auth[_0x9a3b('0x8')](),controller[_0x9a3b('0xd')]);var upload=multer({'storage':multer[_0x9a3b('0xe')]({'destination':function(_0x42b24c,_0x1984f8,_0x5475fc){_0x5475fc(null,path[_0x9a3b('0xf')](config[_0x9a3b('0x10')],_0x9a3b('0x11')));},'filename':function(_0x5b2d3e,_0xf3a626,_0x125f2c){_0xf3a626[_0x9a3b('0x12')]=_0xf3a626['originalname'][_0x9a3b('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x125f2c(null,util['format']('%s-%s%s',path[_0x9a3b('0x14')](_0xf3a626['originalname'],path['extname'](_0xf3a626['originalname'])),Date[_0x9a3b('0x15')](),path[_0x9a3b('0x16')](_0xf3a626[_0x9a3b('0x12')])));}})});router[_0x9a3b('0x17')]('/',upload[_0x9a3b('0x18')]('file'),controller[_0x9a3b('0x19')]);router[_0x9a3b('0x17')](_0x9a3b('0xa'),controller['webhookPost']);router[_0x9a3b('0x1a')](_0x9a3b('0x1b'),auth[_0x9a3b('0x8')](),controller[_0x9a3b('0x1c')]);router[_0x9a3b('0x1d')](_0x9a3b('0x1b'),auth['isAuthenticated'](),controller[_0x9a3b('0x1d')]);module[_0x9a3b('0x1e')]=router;
\ No newline at end of file
index 9957331..857a752 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf84=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','always','never'];(function(_0x20d8a3,_0x17d44b){var _0x4b0fb6=function(_0x43904d){while(--_0x43904d){_0x20d8a3['push'](_0x20d8a3['shift']());}};_0x4b0fb6(++_0x17d44b);}(_0xcf84,0x175));var _0x4cf8=function(_0x7755f6,_0x34731a){_0x7755f6=_0x7755f6-0x0;var _0x208253=_0xcf84[_0x7755f6];return _0x208253;};'use strict';var Sequelize=require(_0x4cf8('0x0'));module[_0x4cf8('0x1')]={'name':{'type':Sequelize[_0x4cf8('0x2')]},'type':{'type':Sequelize[_0x4cf8('0x3')](_0x4cf8('0x4'),_0x4cf8('0x5'))},'description':{'type':Sequelize[_0x4cf8('0x6')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x4cf8('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x4cf8('0x7')],'defaultValue':0x0,'comment':_0x4cf8('0x8')},'sidebar':{'type':Sequelize[_0x4cf8('0x3')]('adminOnly','agentOnly',_0x4cf8('0x9'),_0x4cf8('0xa')),'defaultValue':'always','comment':_0x4cf8('0xb')},'icon':{'type':Sequelize[_0x4cf8('0x2')]},'adminUrl':{'type':Sequelize[_0x4cf8('0x2')]},'agentUrl':{'type':Sequelize[_0x4cf8('0x2')]},'scriptName':{'type':Sequelize[_0x4cf8('0x2')]},'scriptPath':{'type':Sequelize[_0x4cf8('0x2')]}};
\ No newline at end of file
+var _0xcad9=['adminOnly','always','never','sequelize','exports','STRING','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x56b50e,_0x130848){var _0x37858e=function(_0x5f5dbc){while(--_0x5f5dbc){_0x56b50e['push'](_0x56b50e['shift']());}};_0x37858e(++_0x130848);}(_0xcad9,0x7b));var _0x9cad=function(_0x9b1eeb,_0x3641ed){_0x9b1eeb=_0x9b1eeb-0x0;var _0xfae4bd=_0xcad9[_0x9b1eeb];return _0xfae4bd;};'use strict';var Sequelize=require(_0x9cad('0x0'));module[_0x9cad('0x1')]={'name':{'type':Sequelize[_0x9cad('0x2')]},'type':{'type':Sequelize[_0x9cad('0x3')](_0x9cad('0x4'),'script')},'description':{'type':Sequelize[_0x9cad('0x5')]},'version':{'type':Sequelize[_0x9cad('0x5')]},'path':{'type':Sequelize[_0x9cad('0x2')],'comment':_0x9cad('0x6')},'active':{'type':Sequelize[_0x9cad('0x7')],'defaultValue':0x0,'comment':_0x9cad('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0x9cad('0x9'),'agentOnly',_0x9cad('0xa'),_0x9cad('0xb')),'defaultValue':_0x9cad('0xa'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x9cad('0x2')]},'agentUrl':{'type':Sequelize[_0x9cad('0x2')]},'scriptName':{'type':Sequelize[_0x9cad('0x2')]},'scriptPath':{'type':Sequelize[_0x9cad('0x2')]}};
\ No newline at end of file
index a835a9a..ff267be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c27=['count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','send','index','Plugin','rawAttributes','model','keys','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','add','day','filter','where','merge','options','includeAll','findAll','rows','catch','params','find','download','root','server/files/plugins','format','basename','createWriteStream','zip','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','join','node_modules/**/*','finalize','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','type','Invalid\x20manifest:\x20type\x20missing','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','icon','icon-apps','version','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','create','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','body','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','port','encoding','method','%s%s','headers','endsWith','statusCode','webhookPost','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','archiver','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','./plugin.socket','register','sendStatus','end','status'];(function(_0x4492af,_0x47e25d){var _0x216729=function(_0x4964c8){while(--_0x4964c8){_0x4492af['push'](_0x4492af['shift']());}};_0x216729(++_0x47e25d);}(_0x1c27,0x11b));var _0x71c2=function(_0x138293,_0x197e7f){_0x138293=_0x138293-0x0;var _0x34c4a2=_0x1c27[_0x138293];return _0x34c4a2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x71c2('0x0'));var rimraf=require(_0x71c2('0x1'));var zipdir=require(_0x71c2('0x2'));var jsonpatch=require(_0x71c2('0x3'));var rp=require(_0x71c2('0x4'));var moment=require(_0x71c2('0x5'));var BPromise=require(_0x71c2('0x6'));var Mustache=require(_0x71c2('0x7'));var util=require('util');var path=require(_0x71c2('0x8'));var sox=require('sox');var csv=require(_0x71c2('0x9'));var ejs=require(_0x71c2('0xa'));var fs=require('fs');var _=require(_0x71c2('0xb'));var squel=require(_0x71c2('0xc'));var crypto=require('crypto');var jsforce=require(_0x71c2('0xd'));var deskjs=require(_0x71c2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x71c2('0xf'));var Papa=require('papaparse');var extract=require('extract-zip');var rimraf=require(_0x71c2('0x1'));var archiver=require(_0x71c2('0x10'));var qs=require(_0x71c2('0x11'));var logger=require(_0x71c2('0x12'))(_0x71c2('0x13'));var utils=require(_0x71c2('0x14'));var config=require(_0x71c2('0x15'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')({'host':'localhost','port':0x18eb});require(_0x71c2('0x16'))[_0x71c2('0x17')](socket);function respondWithStatusCode(_0x5aaab9,_0x539381){_0x539381=_0x539381||0xcc;return function(_0x51d406){if(_0x51d406){return _0x5aaab9[_0x71c2('0x18')](_0x539381);}return _0x5aaab9['status'](_0x539381)[_0x71c2('0x19')]();};}function respondWithResult(_0x2ee698,_0x5e1c4c){_0x5e1c4c=_0x5e1c4c||0xc8;return function(_0x26281e){if(_0x26281e){return _0x2ee698[_0x71c2('0x1a')](_0x5e1c4c)['json'](_0x26281e);}};}function respondWithFilteredResult(_0x148502,_0x11adbd){return function(_0x5ef92f){if(_0x5ef92f){var _0x27ade0=_0x5ef92f[_0x71c2('0x1b')],_0x38dd35=_0x11adbd[_0x71c2('0x1c')],_0x1b0e44=_0x11adbd['offset']+_0x11adbd[_0x71c2('0x1d')],_0xb6cb0c;if(_0x1b0e44>=_0x27ade0){_0x1b0e44=_0x27ade0;_0xb6cb0c=0xc8;}else{_0xb6cb0c=0xce;}_0x148502[_0x71c2('0x1a')](_0xb6cb0c);return _0x148502[_0x71c2('0x1e')](_0x71c2('0x1f'),_0x38dd35+'-'+_0x1b0e44+'/'+_0x27ade0)[_0x71c2('0x20')](_0x5ef92f);}return null;};}function patchUpdates(_0x451de9){return function(_0x24b753){try{jsonpatch[_0x71c2('0x21')](_0x24b753,_0x451de9,!![]);}catch(_0x40c351){return BPromise[_0x71c2('0x22')](_0x40c351);}return _0x24b753['save']();};}function saveUpdates(_0x2f5e61,_0x155baa){return function(_0x65caba){if(_0x65caba){return _0x65caba['update'](_0x2f5e61)[_0x71c2('0x23')](function(_0x5c365a){return _0x5c365a;});}return null;};}function removeEntity(_0x434d99,_0xedb11b){return function(_0x42a4b8){if(_0x42a4b8){return _0x42a4b8[_0x71c2('0x24')]()[_0x71c2('0x23')](function(){_0x434d99['status'](0xcc)[_0x71c2('0x19')]();});}};}function handleEntityNotFound(_0x2489bc,_0x3cefac){return function(_0x32a242){if(!_0x32a242){_0x2489bc[_0x71c2('0x18')](0x194);}return _0x32a242;};}function handleError(_0x11beea,_0x2e3b51){_0x2e3b51=_0x2e3b51||0x1f4;return function(_0x15b007){logger[_0x71c2('0x25')](_0x15b007[_0x71c2('0x26')]);if(_0x15b007[_0x71c2('0x27')]){delete _0x15b007['name'];}_0x11beea[_0x71c2('0x1a')](_0x2e3b51)[_0x71c2('0x28')](_0x15b007);};}exports[_0x71c2('0x29')]=function(_0x4839db,_0x4efedc){var _0x1f1b14={},_0x238116={},_0x13f146={'count':0x0,'rows':[]};var _0x3ea15e=db[_0x71c2('0x2a')][_0x71c2('0x2b')];_0x238116[_0x71c2('0x2c')]=_[_0x71c2('0x2d')](_0x3ea15e);var _0x12d3f4={'dateStart':_0x4839db['query'][_0x71c2('0x2e')],'dateEnd':_0x4839db[_0x71c2('0x2f')][_0x71c2('0x30')]};delete _0x4839db['query'][_0x71c2('0x2e')];delete _0x4839db[_0x71c2('0x2f')][_0x71c2('0x30')];_0x238116[_0x71c2('0x2f')]=_[_0x71c2('0x2d')](_0x4839db[_0x71c2('0x2f')]);_0x238116[_0x71c2('0x31')]=_[_0x71c2('0x32')](_0x238116[_0x71c2('0x2c')],_0x238116[_0x71c2('0x2f')]);_0x1f1b14[_0x71c2('0x33')]=_['intersection'](_0x238116['model'],qs['fields'](_0x4839db['query'][_0x71c2('0x34')]));_0x1f1b14[_0x71c2('0x33')]=_0x1f1b14[_0x71c2('0x33')][_0x71c2('0x35')]?_0x1f1b14[_0x71c2('0x33')]:_0x238116[_0x71c2('0x2c')];if(!_0x4839db[_0x71c2('0x2f')][_0x71c2('0x36')](_0x71c2('0x37'))){_0x1f1b14[_0x71c2('0x1d')]=qs['limit'](_0x4839db['query'][_0x71c2('0x1d')]);_0x1f1b14[_0x71c2('0x1c')]=qs[_0x71c2('0x1c')](_0x4839db['query'][_0x71c2('0x1c')]);}_0x1f1b14[_0x71c2('0x38')]=qs[_0x71c2('0x39')](_0x4839db[_0x71c2('0x2f')][_0x71c2('0x39')]);_0x1f1b14['where']=qs['filters'](_['pick'](_0x4839db[_0x71c2('0x2f')],_0x238116['filters']));if(_0x12d3f4[_0x71c2('0x2e')]){if(_0x12d3f4[_0x71c2('0x30')]){_0x12d3f4['dateEnd']=moment(_0x12d3f4[_0x71c2('0x30')])[_0x71c2('0x3a')](0x1,_0x71c2('0x3b'));}else{_0x12d3f4[_0x71c2('0x30')]=moment(_0x12d3f4[_0x71c2('0x2e')])[_0x71c2('0x3a')](0x1,_0x71c2('0x3b'));}_['merge'](_0x1f1b14['where'],{'createdAt':{'$gte':_0x12d3f4[_0x71c2('0x2e')],'$lte':_0x12d3f4[_0x71c2('0x30')]}});}if(_0x4839db[_0x71c2('0x2f')][_0x71c2('0x3c')]){_0x1f1b14[_0x71c2('0x3d')]=_[_0x71c2('0x3e')](_0x1f1b14['where'],{'$or':_['map'](_0x1f1b14['attributes'],function(_0x5b857b){var _0x17c3ab={};_0x17c3ab[_0x5b857b]={'$like':'%'+_0x4839db[_0x71c2('0x2f')]['filter']+'%'};return _0x17c3ab;})});}_0x1f1b14=_[_0x71c2('0x3e')]({},_0x1f1b14,_0x4839db[_0x71c2('0x3f')]);var _0x5982ff={'where':_0x1f1b14[_0x71c2('0x3d')]};return db['Plugin'][_0x71c2('0x1b')](_0x5982ff)['then'](function(_0x27496d){_0x13f146[_0x71c2('0x1b')]=_0x27496d;if(_0x4839db[_0x71c2('0x2f')][_0x71c2('0x40')]){_0x1f1b14['include']=[{'all':!![]}];}return db['Plugin'][_0x71c2('0x41')](_0x1f1b14);})[_0x71c2('0x23')](function(_0x4d9269){_0x13f146[_0x71c2('0x42')]=_0x4d9269;return _0x13f146;})[_0x71c2('0x23')](respondWithFilteredResult(_0x4efedc,_0x1f1b14))[_0x71c2('0x43')](handleError(_0x4efedc,null));};exports['show']=function(_0x1e4f5c,_0xfe3b9b){var _0x2bcb2e={'raw':!![],'where':{'id':_0x1e4f5c[_0x71c2('0x44')]['id']}},_0x166f00={};_0x166f00[_0x71c2('0x2c')]=_['keys'](db[_0x71c2('0x2a')][_0x71c2('0x2b')]);_0x166f00[_0x71c2('0x2f')]=_[_0x71c2('0x2d')](_0x1e4f5c[_0x71c2('0x2f')]);_0x166f00[_0x71c2('0x31')]=_['intersection'](_0x166f00['model'],_0x166f00[_0x71c2('0x2f')]);_0x2bcb2e['attributes']=_[_0x71c2('0x32')](_0x166f00['model'],qs['fields'](_0x1e4f5c[_0x71c2('0x2f')]['fields']));_0x2bcb2e['attributes']=_0x2bcb2e[_0x71c2('0x33')][_0x71c2('0x35')]?_0x2bcb2e['attributes']:_0x166f00[_0x71c2('0x2c')];if(_0x1e4f5c['query'][_0x71c2('0x40')]){_0x2bcb2e['include']=[{'all':!![]}];}_0x2bcb2e=_[_0x71c2('0x3e')]({},_0x2bcb2e,_0x1e4f5c[_0x71c2('0x3f')]);return db[_0x71c2('0x2a')][_0x71c2('0x45')](_0x2bcb2e)[_0x71c2('0x23')](handleEntityNotFound(_0xfe3b9b,null))['then'](respondWithResult(_0xfe3b9b,null))[_0x71c2('0x43')](handleError(_0xfe3b9b,null));};exports[_0x71c2('0x46')]=function(_0x3ca4e4,_0x5261a8,_0x312628){return db[_0x71c2('0x2a')]['find']({'where':{'id':_0x3ca4e4[_0x71c2('0x44')]['id']},'attributes':['name',_0x71c2('0x8')],'raw':!![]})[_0x71c2('0x23')](handleEntityNotFound(_0x5261a8,null))['then'](function(_0x4461ee){if(_0x4461ee){var _0xce61b=path['join'](config[_0x71c2('0x47')],_0x71c2('0x48'),util[_0x71c2('0x49')]('%s.zip',path[_0x71c2('0x4a')](_0x4461ee[_0x71c2('0x8')])));var _0x52c0a3=fs[_0x71c2('0x4b')](_0xce61b);var _0x1daf34=archiver(_0x71c2('0x4c'),{'zlib':{'level':0x9}});_0x1daf34['on'](_0x71c2('0x4d'),function(_0x9d86f2){if(_0x9d86f2[_0x71c2('0x4e')]==='ENOENT'){logger['error'](_0x9d86f2);}else{throw new db[(_0x71c2('0x4f'))][(_0x71c2('0x50'))](_0x71c2('0x51'));}});_0x1daf34['on']('error',function(_0x30fb50){throw new db[(_0x71c2('0x4f'))]['Error'](_0x71c2('0x51'));});_0x1daf34[_0x71c2('0x52')](_0x52c0a3);_0x1daf34[_0x71c2('0x53')]('**/*',{'cwd':path[_0x71c2('0x54')](config['root'],'server/files/plugins',path['dirname'](_0x4461ee[_0x71c2('0x8')])),'ignore':[path[_0x71c2('0x54')](path[_0x71c2('0x4a')](_0x4461ee['path']),_0x71c2('0x55')),path['join'](path[_0x71c2('0x4a')](_0x4461ee['path']),'attachments/**/*')],'nodir':!![]})[_0x71c2('0x56')]();_0x52c0a3['on']('close',function(){if(!fs['existsSync'](_0xce61b)){throw new db[(_0x71c2('0x4f'))][(_0x71c2('0x50'))]('Plugin\x20not\x20found');}return _0x5261a8[_0x71c2('0x46')](_0xce61b,util['format'](_0x71c2('0x57'),path[_0x71c2('0x4a')](_0x4461ee[_0x71c2('0x8')])),function(_0x2c6322){if(_0x2c6322){throw new db['Sequelize'][(_0x71c2('0x50'))](_0x71c2('0x58'));}fs[_0x71c2('0x59')](_0xce61b);logger[_0x71c2('0x5a')](_0x71c2('0x5b'));logger[_0x71c2('0x5a')](_0x71c2('0x5c'));});});}return null;})['catch'](handleError(_0x5261a8,null));};exports[_0x71c2('0x5d')]=function(_0x51be36,_0x2ce21b,_0x32fcd8){var _0x48bbfb=path[_0x71c2('0x4a')](_0x51be36[_0x71c2('0x5e')]['filename'],path[_0x71c2('0x5f')](_0x51be36[_0x71c2('0x5e')][_0x71c2('0x60')]));var _0xb5ead4=path[_0x71c2('0x54')](config[_0x71c2('0x47')],_0x71c2('0x48'),_0x51be36[_0x71c2('0x5e')][_0x71c2('0x60')]);var _0x5e465e=path['join'](config[_0x71c2('0x47')],_0x71c2('0x48'),_0x48bbfb);logger[_0x71c2('0x5a')](_0x71c2('0x61'),_0xb5ead4);logger['info']('Plugin\x20upload\x20destination:\x20%s',_0x5e465e);try{fs[_0x71c2('0x62')](_0xb5ead4,parseInt(_0x71c2('0x63'),0x8));extract(_0xb5ead4,{'dir':_0x5e465e},function(_0x1b112d){if(_0x1b112d){logger[_0x71c2('0x25')](_0x1b112d);handleError(_0x1b112d,!![]);};var _0x2c7023=fs[_0x71c2('0x64')](_0x5e465e);if(_0x2c7023[_0x71c2('0x35')]>0x1){removeReferences(_0xb5ead4,_0x5e465e);logger[_0x71c2('0x25')](_0x71c2('0x65'));return _0x32fcd8(new Error('Invalid\x20plugin\x20structure'));}var _0x1cd600=fs[_0x71c2('0x66')](path[_0x71c2('0x54')](_0x5e465e,_0x2c7023[0x0]));if(_0x1cd600[_0x71c2('0x67')]()){removeReferences(_0xb5ead4,_0x5e465e);logger['error'](_0x71c2('0x65'));return _0x32fcd8(new Error(_0x71c2('0x65')));}if(_0x1cd600[_0x71c2('0x68')]()){var _0xbacc86=fs['readdirSync'](path[_0x71c2('0x54')](_0x5e465e,_0x2c7023[0x0]));if(_0xbacc86[_0x71c2('0x35')]===0x0){removeReferences(_0xb5ead4,_0x5e465e);logger['error'](_0x71c2('0x65'));return _0x32fcd8(new Error(_0x71c2('0x65')));}var _0x45c479=_0xbacc86[_0x71c2('0x69')](function(_0x4ddae1){return _0x4ddae1===_0x71c2('0x6a');});if(!_0x45c479){return _0x32fcd8(new Error(_0x71c2('0x6b')));}var _0x1402eb=fs[_0x71c2('0x6c')](path[_0x71c2('0x54')](_0x5e465e,_0x2c7023[0x0],_0x71c2('0x6a')));var _0x29c97b=JSON[_0x71c2('0x6d')](_0x1402eb);if(_0x71c2('0x6e')==typeof _0x29c97b[_0x71c2('0x27')]){return _0x32fcd8(new Error(_0x71c2('0x6f')));}if(_0x71c2('0x6e')==typeof _0x29c97b[_0x71c2('0x70')]){return _0x32fcd8(new Error(_0x71c2('0x71')));}if(_0x71c2('0x6e')==typeof _0x29c97b['version']){return _0x32fcd8(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x71c2('0x6e')==typeof _0x29c97b[_0x71c2('0x72')]){return _0x32fcd8(new Error(_0x71c2('0x73')));}if(_0x29c97b[_0x71c2('0x70')]===_0x71c2('0x74')){if(_0x71c2('0x6e')==typeof _0x29c97b[_0x71c2('0x72')][_0x71c2('0x75')]){return _0x32fcd8(new Error(_0x71c2('0x76')));}if('undefined'==typeof _0x29c97b[_0x71c2('0x72')][_0x71c2('0x75')][_0x71c2('0x77')]&&_0x71c2('0x6e')==typeof _0x29c97b[_0x71c2('0x72')][_0x71c2('0x75')][_0x71c2('0x78')]){return _0x32fcd8(new Error(_0x71c2('0x79')));}}else if(_0x29c97b[_0x71c2('0x70')]===_0x71c2('0x7a')){if(_0x71c2('0x6e')==typeof _0x29c97b['parameters'][_0x71c2('0x7b')]){return _0x32fcd8(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x71c2('0x6e')==typeof _0x29c97b[_0x71c2('0x72')][_0x71c2('0x7c')]){return _0x32fcd8(new Error(_0x71c2('0x7d')));}}else{return _0x32fcd8(new Error(_0x71c2('0x7e')));}var _0x5228f0=_0x29c97b[_0x71c2('0x27')];var _0x2b4420=_0x29c97b['description'];var _0x593c96=_0x29c97b[_0x71c2('0x70')];var _0x44c9ac=_0x29c97b['sidebar']?_0x29c97b['sidebar']:'always';var _0x14fe9d=_0x29c97b[_0x71c2('0x7f')]?_0x29c97b[_0x71c2('0x7f')]:_0x71c2('0x80');var _0xa81ce4='';var _0x547991='';var _0x5102a6='';var _0x14a20d='';var _0x388f97=_0x29c97b[_0x71c2('0x81')];if(_0x593c96===_0x71c2('0x74')){if(_0x71c2('0x6e')!=typeof _0x29c97b[_0x71c2('0x72')][_0x71c2('0x75')][_0x71c2('0x77')]){var _0x545ebf=_0x29c97b[_0x71c2('0x72')]['views'][_0x71c2('0x77')];if(!/^(f|ht)tps?:\/\//i['test'](_0x545ebf)){_0xa81ce4=path['join'](_0x71c2('0x82'),_0x48bbfb,_0x2c7023[0x0],_0x545ebf);}else{_0xa81ce4=_0x545ebf;}}else{logger[_0x71c2('0x5a')](_0x71c2('0x83'));}if('undefined'!=typeof _0x29c97b[_0x71c2('0x72')][_0x71c2('0x75')][_0x71c2('0x78')]){var _0xf815a8=_0x29c97b['parameters'][_0x71c2('0x75')][_0x71c2('0x78')];if(!/^(f|ht)tps?:\/\//i[_0x71c2('0x84')](_0xf815a8)){_0x547991=path['join'](_0x71c2('0x82'),_0x48bbfb,_0x2c7023[0x0],_0xf815a8);}else{_0x547991=_0xf815a8;}}else{logger[_0x71c2('0x5a')](_0x71c2('0x85'));}}else if(_0x593c96===_0x71c2('0x7a')){_0x5102a6=_0x29c97b[_0x71c2('0x72')][_0x71c2('0x7b')];_0x14a20d=_0x29c97b[_0x71c2('0x72')][_0x71c2('0x7c')];if(_0x71c2('0x6e')!=typeof _0x29c97b[_0x71c2('0x72')]['views']){if(_0x71c2('0x6e')!=typeof _0x29c97b[_0x71c2('0x72')][_0x71c2('0x75')][_0x71c2('0x77')]){var _0x545ebf=_0x29c97b[_0x71c2('0x72')][_0x71c2('0x75')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x545ebf)){_0xa81ce4=path[_0x71c2('0x54')](_0x71c2('0x82'),_0x48bbfb,_0x2c7023[0x0],_0x545ebf);}else{_0xa81ce4=_0x545ebf;}}if(_0x71c2('0x6e')!=typeof _0x29c97b['parameters'][_0x71c2('0x75')]['agent']){var _0xf815a8=_0x29c97b['parameters'][_0x71c2('0x75')][_0x71c2('0x78')];if(!/^(f|ht)tps?:\/\//i['test'](_0xf815a8)){_0x547991=path[_0x71c2('0x54')](_0x71c2('0x82'),_0x48bbfb,_0x2c7023[0x0],_0xf815a8);}else{_0x547991=_0xf815a8;}}}}var _0x292d57={'name':_0x5228f0,'description':_0x2b4420,'path':path['join'](_0x48bbfb,_0x2c7023[0x0]),'type':_0x593c96,'sidebar':_0x44c9ac,'icon':_0x14fe9d,'adminUrl':_0xa81ce4,'agentUrl':_0x547991,'scriptName':_0x5102a6,'scriptPath':_0x14a20d,'version':_0x388f97};removeReferences(_0xb5ead4,null);return db[_0x71c2('0x2a')][_0x71c2('0x86')](_0x292d57)[_0x71c2('0x23')](respondWithResult(_0x2ce21b,null))[_0x71c2('0x43')](handleError(_0x2ce21b,null));}});}catch(_0x499536){_0x2ce21b[_0x71c2('0x1a')](0x1f4)[_0x71c2('0x28')](_0x499536);}};function removeReferences(_0x493e3d,_0x432def){try{if(_0x493e3d){fs[_0x71c2('0x59')](_0x493e3d);logger[_0x71c2('0x5a')](_0x71c2('0x87'));}if(_0x432def){rimraf(_0x432def,function(){});logger[_0x71c2('0x5a')](_0x71c2('0x88'));}}catch(_0x32060b){logger[_0x71c2('0x25')](_0x32060b);}}exports[_0x71c2('0x89')]=function(_0x59d22f,_0x26835d,_0x150098){return db[_0x71c2('0x2a')][_0x71c2('0x45')]({'where':{'id':_0x59d22f[_0x71c2('0x44')]['id']}})[_0x71c2('0x23')](handleEntityNotFound(_0x26835d,null))['then'](saveUpdates(_0x59d22f[_0x71c2('0x8a')],null))[_0x71c2('0x23')](respondWithResult(_0x26835d,null))[_0x71c2('0x43')](handleError(_0x26835d,null));};exports[_0x71c2('0x8b')]=function(_0x4e76e2,_0x32b28f,_0x50f4bd){return db[_0x71c2('0x2a')][_0x71c2('0x45')]({'where':{'id':_0x4e76e2['params']['id']}})[_0x71c2('0x23')](function(_0x5d507c){if(_0x5d507c){return _0x5d507c[_0x71c2('0x24')]();}})[_0x71c2('0x23')](function(_0x363d04){rimraf(path[_0x71c2('0x54')](config[_0x71c2('0x47')],_0x71c2('0x48'),path[_0x71c2('0x8c')](_0x363d04[_0x71c2('0x8')])),function(){});return _0x363d04;})[_0x71c2('0x23')](handleEntityNotFound(_0x32b28f,null))[_0x71c2('0x23')](respondWithStatusCode(_0x32b28f,null))[_0x71c2('0x43')](handleError(_0x32b28f,null));};exports[_0x71c2('0x8d')]=function(_0x14006c,_0x37a7e8,_0x12f75f){return BPromise[_0x71c2('0x8e')]()[_0x71c2('0x23')](function(){if(!_0x14006c[_0x71c2('0x2f')][_0x71c2('0x8')]){throw new Error(_0x71c2('0x8f'));}if(!_0x14006c[_0x71c2('0x2f')]['port']){throw new Error(_0x71c2('0x90'));}var _0x292a43=_0x14006c[_0x71c2('0x2f')][_0x71c2('0x91')]?_0x14006c[_0x71c2('0x2f')]['hostname']+':'+_0x14006c[_0x71c2('0x2f')]['port']:_0x71c2('0x92')+_0x14006c[_0x71c2('0x2f')][_0x71c2('0x93')];var _0x4bb9e5=_0x14006c['query']['json']?_0x14006c[_0x71c2('0x2f')][_0x71c2('0x20')]:!![];var _0x2524b2=_0x14006c[_0x71c2('0x2f')][_0x71c2('0x94')]?_0x14006c['query'][_0x71c2('0x94')]:null;var _0x29cc26={'method':_0x14006c[_0x71c2('0x95')],'uri':util[_0x71c2('0x49')](_0x71c2('0x96'),_0x292a43,_0x14006c['query'][_0x71c2('0x8')]),'json':_0x4bb9e5,'resolveWithFullResponse':!![],'encoding':_0x2524b2,'qs':_0x14006c[_0x71c2('0x2f')]};if(_0x14006c[_0x71c2('0x2f')][_0x71c2('0x97')]){_0x29cc26[_0x71c2('0x97')]=_0x14006c[_0x71c2('0x97')];}return rp(_0x29cc26);})['then'](function(_0x4ebbd6){if(_0x4ebbd6){_0x37a7e8[_0x71c2('0x1e')](_0x4ebbd6[_0x71c2('0x97')]);logger[_0x71c2('0x5a')](_0x4ebbd6[_0x71c2('0x8a')]);if(_[_0x71c2('0x98')](_0x14006c['query'][_0x71c2('0x8')],_0x71c2('0x46'))&&_0x4ebbd6['statusCode']==0x1f4){return _0x37a7e8[_0x71c2('0x18')](_0x4ebbd6[_0x71c2('0x99')]);}else{return _0x37a7e8[_0x71c2('0x1a')](_0x4ebbd6[_0x71c2('0x99')])['send'](_0x4ebbd6[_0x71c2('0x8a')]);}}else{return _0x37a7e8[_0x71c2('0x18')](0xc8);}})[_0x71c2('0x43')](handleError(_0x37a7e8,null));};exports[_0x71c2('0x9a')]=function(_0x4964ee,_0x30a7e9,_0x4bf3ec){return BPromise['resolve']()[_0x71c2('0x23')](function(){if(!_0x4964ee['query'][_0x71c2('0x8')]){throw new Error(_0x71c2('0x8f'));}if(!_0x4964ee[_0x71c2('0x2f')][_0x71c2('0x93')]){throw new Error(_0x71c2('0x90'));}var _0x21ebb9=_0x4964ee[_0x71c2('0x2f')][_0x71c2('0x91')]?_0x4964ee[_0x71c2('0x2f')][_0x71c2('0x91')]+':'+_0x4964ee[_0x71c2('0x2f')][_0x71c2('0x93')]:_0x71c2('0x92')+_0x4964ee[_0x71c2('0x2f')][_0x71c2('0x93')];var _0x171029=_0x4964ee[_0x71c2('0x2f')][_0x71c2('0x20')]?_0x4964ee['query'][_0x71c2('0x20')]:!![];var _0x1b43fa=_0x4964ee[_0x71c2('0x2f')][_0x71c2('0x94')]?_0x4964ee['query'][_0x71c2('0x94')]:null;var _0x169545={'method':_0x4964ee[_0x71c2('0x95')],'uri':util[_0x71c2('0x49')](_0x71c2('0x96'),_0x21ebb9,_0x4964ee[_0x71c2('0x2f')][_0x71c2('0x8')]),'json':_0x171029,'resolveWithFullResponse':!![],'encoding':_0x1b43fa,'body':_0x4964ee[_0x71c2('0x8a')]};if(_0x4964ee[_0x71c2('0x2f')][_0x71c2('0x97')]){_0x169545['headers']=_0x4964ee[_0x71c2('0x97')];}return rp(_0x169545);})[_0x71c2('0x23')](function(_0x1548d7){if(_0x1548d7){_0x30a7e9[_0x71c2('0x1e')](_0x1548d7['headers']);logger[_0x71c2('0x5a')](_0x1548d7[_0x71c2('0x8a')]);return _0x30a7e9['status'](_0x1548d7[_0x71c2('0x99')])[_0x71c2('0x28')](_0x1548d7[_0x71c2('0x8a')]);}else{return _0x30a7e9[_0x71c2('0x18')](0xc8);}})[_0x71c2('0x43')](handleError(_0x30a7e9,null));};
\ No newline at end of file
+var _0xc9b0=['Warning:\x20agent\x20view\x20not\x20specified','script','scriptName','create','status','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','body','destroy','dirname','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','headers','endsWith','statusCode','webhookPost','resolve','%s%s','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','lodash','jsforce','desk.js','to-csv','querystring','papaparse','rimraf','archiver','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','localhost','register','sendStatus','end','json','count','offset','limit','Content-Range','reject','save','update','then','stack','name','send','index','Plugin','rawAttributes','model','query','dateStart','dateEnd','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','add','day','merge','where','filter','options','include','findAll','catch','show','length','includeAll','find','download','params','path','join','format','basename','createWriteStream','warning','code','ENOENT','Error','error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','root','server/files/plugins','node_modules/**/*','finalize','close','existsSync','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','manifest.json','Plugin\x20manifest\x20missing','parse','undefined','type','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','test','plugins','Warning:\x20admin\x20view\x20not\x20specified'];(function(_0x1cac27,_0x267cf8){var _0x1fb0dc=function(_0x483d0d){while(--_0x483d0d){_0x1cac27['push'](_0x1cac27['shift']());}};_0x1fb0dc(++_0x267cf8);}(_0xc9b0,0x152));var _0x0c9b=function(_0x20b29a,_0x23a3ee){_0x20b29a=_0x20b29a-0x0;var _0x48a795=_0xc9b0[_0x20b29a];return _0x48a795;};'use strict';var pdf=require(_0x0c9b('0x0'));var emlformat=require(_0x0c9b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0c9b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0c9b('0x3'));var moment=require(_0x0c9b('0x4'));var BPromise=require(_0x0c9b('0x5'));var Mustache=require(_0x0c9b('0x6'));var util=require(_0x0c9b('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0c9b('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0c9b('0x9'));var deskjs=require(_0x0c9b('0xa'));var toCsv=require(_0x0c9b('0xb'));var querystring=require(_0x0c9b('0xc'));var Papa=require(_0x0c9b('0xd'));var extract=require('extract-zip');var rimraf=require(_0x0c9b('0xe'));var archiver=require(_0x0c9b('0xf'));var qs=require(_0x0c9b('0x10'));var logger=require(_0x0c9b('0x11'))(_0x0c9b('0x12'));var utils=require(_0x0c9b('0x13'));var config=require(_0x0c9b('0x14'));var db=require(_0x0c9b('0x15'))['db'];var socket=require(_0x0c9b('0x16'))({'host':_0x0c9b('0x17'),'port':0x18eb});require('./plugin.socket')[_0x0c9b('0x18')](socket);function respondWithStatusCode(_0x2010a9,_0x45871a){_0x45871a=_0x45871a||0xcc;return function(_0x3163dc){if(_0x3163dc){return _0x2010a9[_0x0c9b('0x19')](_0x45871a);}return _0x2010a9['status'](_0x45871a)[_0x0c9b('0x1a')]();};}function respondWithResult(_0xb251a7,_0x233d20){_0x233d20=_0x233d20||0xc8;return function(_0x1fb55a){if(_0x1fb55a){return _0xb251a7['status'](_0x233d20)[_0x0c9b('0x1b')](_0x1fb55a);}};}function respondWithFilteredResult(_0x48014b,_0x4d6482){return function(_0x2a44d9){if(_0x2a44d9){var _0x45d708=_0x2a44d9[_0x0c9b('0x1c')],_0x295a4b=_0x4d6482['offset'],_0x463fae=_0x4d6482[_0x0c9b('0x1d')]+_0x4d6482[_0x0c9b('0x1e')],_0x5b0453;if(_0x463fae>=_0x45d708){_0x463fae=_0x45d708;_0x5b0453=0xc8;}else{_0x5b0453=0xce;}_0x48014b['status'](_0x5b0453);return _0x48014b['set'](_0x0c9b('0x1f'),_0x295a4b+'-'+_0x463fae+'/'+_0x45d708)[_0x0c9b('0x1b')](_0x2a44d9);}return null;};}function patchUpdates(_0x5e949d){return function(_0xc5dcc9){try{jsonpatch['apply'](_0xc5dcc9,_0x5e949d,!![]);}catch(_0x8681d5){return BPromise[_0x0c9b('0x20')](_0x8681d5);}return _0xc5dcc9[_0x0c9b('0x21')]();};}function saveUpdates(_0x4ff724,_0x14ecec){return function(_0x1483e6){if(_0x1483e6){return _0x1483e6[_0x0c9b('0x22')](_0x4ff724)['then'](function(_0x470178){return _0x470178;});}return null;};}function removeEntity(_0x20f3d4,_0x1eaf6a){return function(_0x573854){if(_0x573854){return _0x573854['destroy']()[_0x0c9b('0x23')](function(){_0x20f3d4['status'](0xcc)[_0x0c9b('0x1a')]();});}};}function handleEntityNotFound(_0x29a78f,_0x26416d){return function(_0x5f356b){if(!_0x5f356b){_0x29a78f[_0x0c9b('0x19')](0x194);}return _0x5f356b;};}function handleError(_0x4fabfe,_0x4df21e){_0x4df21e=_0x4df21e||0x1f4;return function(_0x3d8a2e){logger['error'](_0x3d8a2e[_0x0c9b('0x24')]);if(_0x3d8a2e[_0x0c9b('0x25')]){delete _0x3d8a2e[_0x0c9b('0x25')];}_0x4fabfe['status'](_0x4df21e)[_0x0c9b('0x26')](_0x3d8a2e);};}exports[_0x0c9b('0x27')]=function(_0xce99c1,_0x490cb8){var _0x29f8b8={},_0x519259={},_0x4bd745={'count':0x0,'rows':[]};var _0x237f98=db[_0x0c9b('0x28')][_0x0c9b('0x29')];_0x519259[_0x0c9b('0x2a')]=_['keys'](_0x237f98);var _0x40b054={'dateStart':_0xce99c1[_0x0c9b('0x2b')][_0x0c9b('0x2c')],'dateEnd':_0xce99c1[_0x0c9b('0x2b')][_0x0c9b('0x2d')]};delete _0xce99c1[_0x0c9b('0x2b')]['dateStart'];delete _0xce99c1[_0x0c9b('0x2b')][_0x0c9b('0x2d')];_0x519259['query']=_[_0x0c9b('0x2e')](_0xce99c1[_0x0c9b('0x2b')]);_0x519259[_0x0c9b('0x2f')]=_[_0x0c9b('0x30')](_0x519259[_0x0c9b('0x2a')],_0x519259['query']);_0x29f8b8['attributes']=_['intersection'](_0x519259[_0x0c9b('0x2a')],qs[_0x0c9b('0x31')](_0xce99c1[_0x0c9b('0x2b')][_0x0c9b('0x31')]));_0x29f8b8['attributes']=_0x29f8b8[_0x0c9b('0x32')]['length']?_0x29f8b8['attributes']:_0x519259['model'];if(!_0xce99c1[_0x0c9b('0x2b')][_0x0c9b('0x33')]('nolimit')){_0x29f8b8[_0x0c9b('0x1e')]=qs[_0x0c9b('0x1e')](_0xce99c1[_0x0c9b('0x2b')][_0x0c9b('0x1e')]);_0x29f8b8['offset']=qs[_0x0c9b('0x1d')](_0xce99c1[_0x0c9b('0x2b')][_0x0c9b('0x1d')]);}_0x29f8b8[_0x0c9b('0x34')]=qs[_0x0c9b('0x35')](_0xce99c1[_0x0c9b('0x2b')][_0x0c9b('0x35')]);_0x29f8b8['where']=qs['filters'](_[_0x0c9b('0x36')](_0xce99c1[_0x0c9b('0x2b')],_0x519259[_0x0c9b('0x2f')]));if(_0x40b054[_0x0c9b('0x2c')]){if(_0x40b054['dateEnd']){_0x40b054[_0x0c9b('0x2d')]=moment(_0x40b054[_0x0c9b('0x2d')])[_0x0c9b('0x37')](0x1,_0x0c9b('0x38'));}else{_0x40b054[_0x0c9b('0x2d')]=moment(_0x40b054[_0x0c9b('0x2c')])['add'](0x1,_0x0c9b('0x38'));}_[_0x0c9b('0x39')](_0x29f8b8[_0x0c9b('0x3a')],{'createdAt':{'$gte':_0x40b054['dateStart'],'$lte':_0x40b054[_0x0c9b('0x2d')]}});}if(_0xce99c1[_0x0c9b('0x2b')]['filter']){_0x29f8b8[_0x0c9b('0x3a')]=_[_0x0c9b('0x39')](_0x29f8b8['where'],{'$or':_['map'](_0x29f8b8[_0x0c9b('0x32')],function(_0x407218){var _0x4039ef={};_0x4039ef[_0x407218]={'$like':'%'+_0xce99c1[_0x0c9b('0x2b')][_0x0c9b('0x3b')]+'%'};return _0x4039ef;})});}_0x29f8b8=_[_0x0c9b('0x39')]({},_0x29f8b8,_0xce99c1[_0x0c9b('0x3c')]);var _0x1df9f8={'where':_0x29f8b8['where']};return db[_0x0c9b('0x28')][_0x0c9b('0x1c')](_0x1df9f8)[_0x0c9b('0x23')](function(_0x30a12e){_0x4bd745['count']=_0x30a12e;if(_0xce99c1[_0x0c9b('0x2b')]['includeAll']){_0x29f8b8[_0x0c9b('0x3d')]=[{'all':!![]}];}return db[_0x0c9b('0x28')][_0x0c9b('0x3e')](_0x29f8b8);})['then'](function(_0xb15f36){_0x4bd745['rows']=_0xb15f36;return _0x4bd745;})[_0x0c9b('0x23')](respondWithFilteredResult(_0x490cb8,_0x29f8b8))[_0x0c9b('0x3f')](handleError(_0x490cb8,null));};exports[_0x0c9b('0x40')]=function(_0x2ce414,_0x3238cc){var _0x3f3d47={'raw':!![],'where':{'id':_0x2ce414['params']['id']}},_0x46b4b4={};_0x46b4b4[_0x0c9b('0x2a')]=_['keys'](db[_0x0c9b('0x28')]['rawAttributes']);_0x46b4b4[_0x0c9b('0x2b')]=_['keys'](_0x2ce414['query']);_0x46b4b4['filters']=_[_0x0c9b('0x30')](_0x46b4b4['model'],_0x46b4b4[_0x0c9b('0x2b')]);_0x3f3d47[_0x0c9b('0x32')]=_[_0x0c9b('0x30')](_0x46b4b4[_0x0c9b('0x2a')],qs[_0x0c9b('0x31')](_0x2ce414[_0x0c9b('0x2b')][_0x0c9b('0x31')]));_0x3f3d47[_0x0c9b('0x32')]=_0x3f3d47[_0x0c9b('0x32')][_0x0c9b('0x41')]?_0x3f3d47[_0x0c9b('0x32')]:_0x46b4b4[_0x0c9b('0x2a')];if(_0x2ce414['query'][_0x0c9b('0x42')]){_0x3f3d47['include']=[{'all':!![]}];}_0x3f3d47=_[_0x0c9b('0x39')]({},_0x3f3d47,_0x2ce414[_0x0c9b('0x3c')]);return db[_0x0c9b('0x28')][_0x0c9b('0x43')](_0x3f3d47)[_0x0c9b('0x23')](handleEntityNotFound(_0x3238cc,null))[_0x0c9b('0x23')](respondWithResult(_0x3238cc,null))[_0x0c9b('0x3f')](handleError(_0x3238cc,null));};exports[_0x0c9b('0x44')]=function(_0x40054a,_0x24d4cc,_0xb8a4cd){return db[_0x0c9b('0x28')][_0x0c9b('0x43')]({'where':{'id':_0x40054a[_0x0c9b('0x45')]['id']},'attributes':[_0x0c9b('0x25'),_0x0c9b('0x46')],'raw':!![]})[_0x0c9b('0x23')](handleEntityNotFound(_0x24d4cc,null))['then'](function(_0x454732){if(_0x454732){var _0x24d931=path[_0x0c9b('0x47')](config['root'],'server/files/plugins',util[_0x0c9b('0x48')]('%s.zip',path[_0x0c9b('0x49')](_0x454732[_0x0c9b('0x46')])));var _0x2424a5=fs[_0x0c9b('0x4a')](_0x24d931);var _0x5e055c=archiver('zip',{'zlib':{'level':0x9}});_0x5e055c['on'](_0x0c9b('0x4b'),function(_0x45b2d1){if(_0x45b2d1[_0x0c9b('0x4c')]===_0x0c9b('0x4d')){logger['error'](_0x45b2d1);}else{throw new db['Sequelize'][(_0x0c9b('0x4e'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x5e055c['on'](_0x0c9b('0x4f'),function(_0x4ab97a){throw new db[(_0x0c9b('0x50'))]['Error'](_0x0c9b('0x51'));});_0x5e055c[_0x0c9b('0x52')](_0x2424a5);_0x5e055c[_0x0c9b('0x53')](_0x0c9b('0x54'),{'cwd':path[_0x0c9b('0x47')](config[_0x0c9b('0x55')],_0x0c9b('0x56'),path['dirname'](_0x454732[_0x0c9b('0x46')])),'ignore':[path[_0x0c9b('0x47')](path[_0x0c9b('0x49')](_0x454732['path']),_0x0c9b('0x57')),path[_0x0c9b('0x47')](path['basename'](_0x454732[_0x0c9b('0x46')]),'attachments/**/*')],'nodir':!![]})[_0x0c9b('0x58')]();_0x2424a5['on'](_0x0c9b('0x59'),function(){if(!fs[_0x0c9b('0x5a')](_0x24d931)){throw new db[(_0x0c9b('0x50'))][(_0x0c9b('0x4e'))](_0x0c9b('0x5b'));}return _0x24d4cc['download'](_0x24d931,util[_0x0c9b('0x48')](_0x0c9b('0x5c'),path[_0x0c9b('0x49')](_0x454732[_0x0c9b('0x46')])),function(_0x20d4de){if(_0x20d4de){throw new db['Sequelize'][(_0x0c9b('0x4e'))](_0x0c9b('0x5d'));}fs['unlinkSync'](_0x24d931);logger[_0x0c9b('0x5e')](_0x0c9b('0x5f'));logger[_0x0c9b('0x5e')](_0x0c9b('0x60'));});});}return null;})[_0x0c9b('0x3f')](handleError(_0x24d4cc,null));};exports[_0x0c9b('0x61')]=function(_0x18d224,_0x57a1c8,_0x3a0a56){var _0x4c8bdd=path[_0x0c9b('0x49')](_0x18d224[_0x0c9b('0x62')][_0x0c9b('0x63')],path['extname'](_0x18d224[_0x0c9b('0x62')]['filename']));var _0x22ad2b=path[_0x0c9b('0x47')](config[_0x0c9b('0x55')],_0x0c9b('0x56'),_0x18d224[_0x0c9b('0x62')][_0x0c9b('0x63')]);var _0x5a591f=path[_0x0c9b('0x47')](config['root'],_0x0c9b('0x56'),_0x4c8bdd);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x22ad2b);logger[_0x0c9b('0x5e')](_0x0c9b('0x64'),_0x5a591f);try{fs[_0x0c9b('0x65')](_0x22ad2b,parseInt(_0x0c9b('0x66'),0x8));extract(_0x22ad2b,{'dir':_0x5a591f},function(_0x29fa44){if(_0x29fa44){logger[_0x0c9b('0x4f')](_0x29fa44);handleError(_0x29fa44,!![]);};var _0x4bb68d=fs[_0x0c9b('0x67')](_0x5a591f);if(_0x4bb68d[_0x0c9b('0x41')]>0x1){removeReferences(_0x22ad2b,_0x5a591f);logger[_0x0c9b('0x4f')](_0x0c9b('0x68'));return _0x3a0a56(new Error('Invalid\x20plugin\x20structure'));}var _0x5f76ed=fs[_0x0c9b('0x69')](path[_0x0c9b('0x47')](_0x5a591f,_0x4bb68d[0x0]));if(_0x5f76ed[_0x0c9b('0x6a')]()){removeReferences(_0x22ad2b,_0x5a591f);logger[_0x0c9b('0x4f')](_0x0c9b('0x68'));return _0x3a0a56(new Error(_0x0c9b('0x68')));}if(_0x5f76ed['isDirectory']()){var _0x3cc974=fs[_0x0c9b('0x67')](path['join'](_0x5a591f,_0x4bb68d[0x0]));if(_0x3cc974[_0x0c9b('0x41')]===0x0){removeReferences(_0x22ad2b,_0x5a591f);logger[_0x0c9b('0x4f')]('Invalid\x20plugin\x20structure');return _0x3a0a56(new Error(_0x0c9b('0x68')));}var _0x3b0185=_0x3cc974['some'](function(_0x4d2f31){return _0x4d2f31===_0x0c9b('0x6b');});if(!_0x3b0185){return _0x3a0a56(new Error(_0x0c9b('0x6c')));}var _0x3a40ba=fs['readFileSync'](path[_0x0c9b('0x47')](_0x5a591f,_0x4bb68d[0x0],_0x0c9b('0x6b')));var _0x190499=JSON[_0x0c9b('0x6d')](_0x3a40ba);if(_0x0c9b('0x6e')==typeof _0x190499['name']){return _0x3a0a56(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x0c9b('0x6e')==typeof _0x190499[_0x0c9b('0x6f')]){return _0x3a0a56(new Error(_0x0c9b('0x70')));}if('undefined'==typeof _0x190499[_0x0c9b('0x71')]){return _0x3a0a56(new Error(_0x0c9b('0x72')));}if('undefined'==typeof _0x190499[_0x0c9b('0x73')]){return _0x3a0a56(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x190499[_0x0c9b('0x6f')]===_0x0c9b('0x74')){if('undefined'==typeof _0x190499[_0x0c9b('0x73')][_0x0c9b('0x75')]){return _0x3a0a56(new Error(_0x0c9b('0x76')));}if(_0x0c9b('0x6e')==typeof _0x190499[_0x0c9b('0x73')]['views'][_0x0c9b('0x77')]&&'undefined'==typeof _0x190499['parameters'][_0x0c9b('0x75')][_0x0c9b('0x78')]){return _0x3a0a56(new Error(_0x0c9b('0x79')));}}else if(_0x190499['type']==='script'){if(_0x0c9b('0x6e')==typeof _0x190499[_0x0c9b('0x73')]['scriptName']){return _0x3a0a56(new Error(_0x0c9b('0x7a')));}if(_0x0c9b('0x6e')==typeof _0x190499[_0x0c9b('0x73')][_0x0c9b('0x7b')]){return _0x3a0a56(new Error(_0x0c9b('0x7c')));}}else{return _0x3a0a56(new Error(_0x0c9b('0x7d')));}var _0x362e17=_0x190499['name'];var _0x3b59f2=_0x190499[_0x0c9b('0x7e')];var _0x26174f=_0x190499[_0x0c9b('0x6f')];var _0x33f31e=_0x190499[_0x0c9b('0x7f')]?_0x190499['sidebar']:_0x0c9b('0x80');var _0x453772=_0x190499['icon']?_0x190499[_0x0c9b('0x81')]:'icon-apps';var _0x42c04c='';var _0x3a2b0d='';var _0x53e37d='';var _0x31cfaa='';var _0xaa9e45=_0x190499['version'];if(_0x26174f===_0x0c9b('0x74')){if(_0x0c9b('0x6e')!=typeof _0x190499[_0x0c9b('0x73')]['views'][_0x0c9b('0x77')]){var _0x41c14d=_0x190499['parameters'][_0x0c9b('0x75')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x0c9b('0x82')](_0x41c14d)){_0x42c04c=path[_0x0c9b('0x47')](_0x0c9b('0x83'),_0x4c8bdd,_0x4bb68d[0x0],_0x41c14d);}else{_0x42c04c=_0x41c14d;}}else{logger['info'](_0x0c9b('0x84'));}if(_0x0c9b('0x6e')!=typeof _0x190499[_0x0c9b('0x73')]['views'][_0x0c9b('0x78')]){var _0x2cef6f=_0x190499[_0x0c9b('0x73')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x0c9b('0x82')](_0x2cef6f)){_0x3a2b0d=path['join'](_0x0c9b('0x83'),_0x4c8bdd,_0x4bb68d[0x0],_0x2cef6f);}else{_0x3a2b0d=_0x2cef6f;}}else{logger[_0x0c9b('0x5e')](_0x0c9b('0x85'));}}else if(_0x26174f===_0x0c9b('0x86')){_0x53e37d=_0x190499[_0x0c9b('0x73')][_0x0c9b('0x87')];_0x31cfaa=_0x190499[_0x0c9b('0x73')]['scriptPath'];if(_0x0c9b('0x6e')!=typeof _0x190499[_0x0c9b('0x73')][_0x0c9b('0x75')]){if('undefined'!=typeof _0x190499[_0x0c9b('0x73')][_0x0c9b('0x75')][_0x0c9b('0x77')]){var _0x41c14d=_0x190499['parameters'][_0x0c9b('0x75')][_0x0c9b('0x77')];if(!/^(f|ht)tps?:\/\//i[_0x0c9b('0x82')](_0x41c14d)){_0x42c04c=path[_0x0c9b('0x47')]('plugins',_0x4c8bdd,_0x4bb68d[0x0],_0x41c14d);}else{_0x42c04c=_0x41c14d;}}if('undefined'!=typeof _0x190499['parameters'][_0x0c9b('0x75')][_0x0c9b('0x78')]){var _0x2cef6f=_0x190499['parameters'][_0x0c9b('0x75')][_0x0c9b('0x78')];if(!/^(f|ht)tps?:\/\//i[_0x0c9b('0x82')](_0x2cef6f)){_0x3a2b0d=path['join'](_0x0c9b('0x83'),_0x4c8bdd,_0x4bb68d[0x0],_0x2cef6f);}else{_0x3a2b0d=_0x2cef6f;}}}}var _0x317ac4={'name':_0x362e17,'description':_0x3b59f2,'path':path[_0x0c9b('0x47')](_0x4c8bdd,_0x4bb68d[0x0]),'type':_0x26174f,'sidebar':_0x33f31e,'icon':_0x453772,'adminUrl':_0x42c04c,'agentUrl':_0x3a2b0d,'scriptName':_0x53e37d,'scriptPath':_0x31cfaa,'version':_0xaa9e45};removeReferences(_0x22ad2b,null);return db[_0x0c9b('0x28')][_0x0c9b('0x88')](_0x317ac4)[_0x0c9b('0x23')](respondWithResult(_0x57a1c8,null))[_0x0c9b('0x3f')](handleError(_0x57a1c8,null));}});}catch(_0x4c570d){_0x57a1c8[_0x0c9b('0x89')](0x1f4)['send'](_0x4c570d);}};function removeReferences(_0x469e01,_0x2faead){try{if(_0x469e01){fs[_0x0c9b('0x8a')](_0x469e01);logger[_0x0c9b('0x5e')](_0x0c9b('0x8b'));}if(_0x2faead){rimraf(_0x2faead,function(){});logger[_0x0c9b('0x5e')](_0x0c9b('0x8c'));}}catch(_0x95e5dd){logger[_0x0c9b('0x4f')](_0x95e5dd);}}exports['update']=function(_0x71ab20,_0x117834,_0x3c6d1f){return db[_0x0c9b('0x28')][_0x0c9b('0x43')]({'where':{'id':_0x71ab20['params']['id']}})[_0x0c9b('0x23')](handleEntityNotFound(_0x117834,null))[_0x0c9b('0x23')](saveUpdates(_0x71ab20[_0x0c9b('0x8d')],null))[_0x0c9b('0x23')](respondWithResult(_0x117834,null))[_0x0c9b('0x3f')](handleError(_0x117834,null));};exports['delete']=function(_0x595bf3,_0x454428,_0x5e3ac6){return db['Plugin']['find']({'where':{'id':_0x595bf3[_0x0c9b('0x45')]['id']}})['then'](function(_0x315bda){if(_0x315bda){return _0x315bda[_0x0c9b('0x8e')]();}})[_0x0c9b('0x23')](function(_0x460baa){rimraf(path[_0x0c9b('0x47')](config[_0x0c9b('0x55')],_0x0c9b('0x56'),path[_0x0c9b('0x8f')](_0x460baa[_0x0c9b('0x46')])),function(){});return _0x460baa;})[_0x0c9b('0x23')](handleEntityNotFound(_0x454428,null))[_0x0c9b('0x23')](respondWithStatusCode(_0x454428,null))[_0x0c9b('0x3f')](handleError(_0x454428,null));};exports[_0x0c9b('0x90')]=function(_0x514597,_0x57e667,_0x4d050b){return BPromise['resolve']()['then'](function(){if(!_0x514597[_0x0c9b('0x2b')][_0x0c9b('0x46')]){throw new Error(_0x0c9b('0x91'));}if(!_0x514597[_0x0c9b('0x2b')][_0x0c9b('0x92')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x30eddf=_0x514597[_0x0c9b('0x2b')][_0x0c9b('0x93')]?_0x514597[_0x0c9b('0x2b')][_0x0c9b('0x93')]+':'+_0x514597[_0x0c9b('0x2b')][_0x0c9b('0x92')]:_0x0c9b('0x94')+_0x514597[_0x0c9b('0x2b')]['port'];var _0x5668f3=_0x514597[_0x0c9b('0x2b')][_0x0c9b('0x1b')]?_0x514597[_0x0c9b('0x2b')][_0x0c9b('0x1b')]:!![];var _0xa57fc4=_0x514597[_0x0c9b('0x2b')][_0x0c9b('0x95')]?_0x514597['query'][_0x0c9b('0x95')]:null;var _0x4d6d48={'method':_0x514597[_0x0c9b('0x96')],'uri':util[_0x0c9b('0x48')]('%s%s',_0x30eddf,_0x514597[_0x0c9b('0x2b')][_0x0c9b('0x46')]),'json':_0x5668f3,'resolveWithFullResponse':!![],'encoding':_0xa57fc4,'qs':_0x514597[_0x0c9b('0x2b')]};if(_0x514597[_0x0c9b('0x2b')]['headers']){_0x4d6d48['headers']=_0x514597[_0x0c9b('0x97')];}return rp(_0x4d6d48);})['then'](function(_0x3c9149){if(_0x3c9149){_0x57e667['set'](_0x3c9149['headers']);logger[_0x0c9b('0x5e')](_0x3c9149[_0x0c9b('0x8d')]);if(_[_0x0c9b('0x98')](_0x514597[_0x0c9b('0x2b')][_0x0c9b('0x46')],'download')&&_0x3c9149[_0x0c9b('0x99')]==0x1f4){return _0x57e667[_0x0c9b('0x19')](_0x3c9149[_0x0c9b('0x99')]);}else{return _0x57e667[_0x0c9b('0x89')](_0x3c9149[_0x0c9b('0x99')])[_0x0c9b('0x26')](_0x3c9149[_0x0c9b('0x8d')]);}}else{return _0x57e667[_0x0c9b('0x19')](0xc8);}})[_0x0c9b('0x3f')](handleError(_0x57e667,null));};exports[_0x0c9b('0x9a')]=function(_0x33b0d6,_0x1fbe2b,_0x2bb7da){return BPromise[_0x0c9b('0x9b')]()[_0x0c9b('0x23')](function(){if(!_0x33b0d6[_0x0c9b('0x2b')][_0x0c9b('0x46')]){throw new Error(_0x0c9b('0x91'));}if(!_0x33b0d6[_0x0c9b('0x2b')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x10ffcf=_0x33b0d6['query']['hostname']?_0x33b0d6['query'][_0x0c9b('0x93')]+':'+_0x33b0d6['query']['port']:_0x0c9b('0x94')+_0x33b0d6[_0x0c9b('0x2b')][_0x0c9b('0x92')];var _0x7a9fa7=_0x33b0d6['query'][_0x0c9b('0x1b')]?_0x33b0d6['query']['json']:!![];var _0x3cfe56=_0x33b0d6[_0x0c9b('0x2b')][_0x0c9b('0x95')]?_0x33b0d6[_0x0c9b('0x2b')][_0x0c9b('0x95')]:null;var _0x35b448={'method':_0x33b0d6[_0x0c9b('0x96')],'uri':util[_0x0c9b('0x48')](_0x0c9b('0x9c'),_0x10ffcf,_0x33b0d6['query'][_0x0c9b('0x46')]),'json':_0x7a9fa7,'resolveWithFullResponse':!![],'encoding':_0x3cfe56,'body':_0x33b0d6[_0x0c9b('0x8d')]};if(_0x33b0d6[_0x0c9b('0x2b')][_0x0c9b('0x97')]){_0x35b448[_0x0c9b('0x97')]=_0x33b0d6[_0x0c9b('0x97')];}return rp(_0x35b448);})[_0x0c9b('0x23')](function(_0x593ad2){if(_0x593ad2){_0x1fbe2b['set'](_0x593ad2[_0x0c9b('0x97')]);logger['info'](_0x593ad2[_0x0c9b('0x8d')]);return _0x1fbe2b[_0x0c9b('0x89')](_0x593ad2[_0x0c9b('0x99')])[_0x0c9b('0x26')](_0x593ad2[_0x0c9b('0x8d')]);}else{return _0x1fbe2b[_0x0c9b('0x19')](0xc8);}})[_0x0c9b('0x3f')](handleError(_0x1fbe2b,null));};
\ No newline at end of file
index 0b147a5..13c9136 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['hasOwnProperty','hook','events','Plugin','setMaxListeners','save','remove','emit'];(function(_0x3f4aeb,_0x2dd367){var _0x25cf38=function(_0x4f593b){while(--_0x4f593b){_0x3f4aeb['push'](_0x3f4aeb['shift']());}};_0x25cf38(++_0x2dd367);}(_0xb10b,0x12a));var _0xbb10=function(_0x499c7f,_0x2d8184){_0x499c7f=_0x499c7f-0x0;var _0x433bee=_0xb10b[_0x499c7f];return _0x433bee;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var Plugin=require('../../mysqldb')['db'][_0xbb10('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){PluginEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);PluginEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];Plugin[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
+var _0xb10b=['hasOwnProperty','hook','events','Plugin','setMaxListeners','save','remove','emit'];(function(_0x33d0d0,_0x3c7df3){var _0x42a146=function(_0x133626){while(--_0x133626){_0x33d0d0['push'](_0x33d0d0['shift']());}};_0x42a146(++_0x3c7df3);}(_0xb10b,0x12a));var _0xbb10=function(_0x3e1a10,_0x6aeaf2){_0x3e1a10=_0x3e1a10-0x0;var _0x2fb8ee=_0xb10b[_0x3e1a10];return _0x2fb8ee;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var Plugin=require('../../mysqldb')['db'][_0xbb10('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){PluginEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);PluginEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];Plugin[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
index dff035c..e0ad5e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83bd=['moment','bluebird','request-promise','./plugin.attributes','exports','Plugin','plugins','lodash','util','../../config/logger','api'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x83bd,0x1b4));var _0xd83b=function(_0x239dba,_0x309e95){_0x239dba=_0x239dba-0x0;var _0x1ceb11=_0x83bd[_0x239dba];return _0x1ceb11;};'use strict';var _=require(_0xd83b('0x0'));var util=require(_0xd83b('0x1'));var logger=require(_0xd83b('0x2'))(_0xd83b('0x3'));var moment=require(_0xd83b('0x4'));var BPromise=require(_0xd83b('0x5'));var rp=require(_0xd83b('0x6'));var attributes=require(_0xd83b('0x7'));module[_0xd83b('0x8')]=function(_0x52d715,_0x47ece2){return _0x52d715['define'](_0xd83b('0x9'),attributes,{'tableName':_0xd83b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5df0=['util','../../config/logger','request-promise','./plugin.attributes','exports','define','Plugin','plugins','lodash'];(function(_0x6b0c73,_0x65453f){var _0x4ac1b9=function(_0x4494e1){while(--_0x4494e1){_0x6b0c73['push'](_0x6b0c73['shift']());}};_0x4ac1b9(++_0x65453f);}(_0x5df0,0x1ee));var _0x05df=function(_0x4c0a16,_0x5d1034){_0x4c0a16=_0x4c0a16-0x0;var _0x32d6ba=_0x5df0[_0x4c0a16];return _0x32d6ba;};'use strict';var _=require(_0x05df('0x0'));var util=require(_0x05df('0x1'));var logger=require(_0x05df('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x05df('0x3'));var attributes=require(_0x05df('0x4'));module[_0x05df('0x5')]=function(_0x4145e7,_0xdaf3b4){return _0x4145e7[_0x05df('0x6')](_0x05df('0x7'),attributes,{'tableName':_0x05df('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cb70319..c9de955 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb38b=['socket.io-emitter','localhost','./plugin.socket','register','request','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','Plugin,\x20%s,\x20%s','info','result','catch','CreatePlugin','create','body','then','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2c34c6,_0x10348c){var _0xd27a1d=function(_0x37d86e){while(--_0x37d86e){_0x2c34c6['push'](_0x2c34c6['shift']());}};_0xd27a1d(++_0x10348c);}(_0xb38b,0x135));var _0xbb38=function(_0x36e0a4,_0x1b5f6d){_0x36e0a4=_0x36e0a4-0x0;var _0x5cefcf=_0xb38b[_0x36e0a4];return _0x5cefcf;};'use strict';var _=require(_0xbb38('0x0'));var util=require(_0xbb38('0x1'));var moment=require(_0xbb38('0x2'));var BPromise=require('bluebird');var rs=require(_0xbb38('0x3'));var fs=require('fs');var db=require(_0xbb38('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb38('0x5'))(_0xbb38('0x6'));var config=require(_0xbb38('0x7'));var jayson=require(_0xbb38('0x8'));var client=jayson['client'][_0xbb38('0x9')]({'port':0x232a});var socket=require(_0xbb38('0xa'))({'host':_0xbb38('0xb'),'port':0x18eb});require(_0xbb38('0xc'))[_0xbb38('0xd')](socket);function respondWithRpcPromise(_0x302441,_0x4340bf,_0xfbf14f){return new BPromise(function(_0x5976a5,_0x799379){return client[_0xbb38('0xe')](_0x302441,_0xfbf14f)['then'](function(_0xa9464){logger['info']('Plugin,\x20%s,\x20%s',_0x4340bf,_0xbb38('0xf'));logger[_0xbb38('0x10')](_0xbb38('0x11'),_0x4340bf,_0xbb38('0xf'),JSON['stringify'](_0xa9464));if(_0xa9464['error']){if(_0xa9464[_0xbb38('0x12')][_0xbb38('0x13')]===0x1f4){logger[_0xbb38('0x12')]('Plugin,\x20%s,\x20%s',_0x4340bf,_0xa9464[_0xbb38('0x12')][_0xbb38('0x14')]);return _0x799379(_0xa9464['error'][_0xbb38('0x14')]);}logger[_0xbb38('0x12')](_0xbb38('0x15'),_0x4340bf,_0xa9464[_0xbb38('0x12')]['message']);return _0x5976a5(_0xa9464['error'][_0xbb38('0x14')]);}else{logger[_0xbb38('0x16')](_0xbb38('0x15'),_0x4340bf,_0xbb38('0xf'));_0x5976a5(_0xa9464[_0xbb38('0x17')][_0xbb38('0x14')]);}})[_0xbb38('0x18')](function(_0x1b3b92){logger[_0xbb38('0x12')]('Plugin,\x20%s,\x20%s',_0x4340bf,_0x1b3b92);_0x799379(_0x1b3b92);});});}exports[_0xbb38('0x19')]=function(_0x348fc0){var _0x542ab6=this;return new Promise(function(_0x5ce8b6,_0x2fd89a){return db['Plugin'][_0xbb38('0x1a')](_0x348fc0[_0xbb38('0x1b')],{'raw':_0x348fc0['options']?_0x348fc0['options']['raw']===undefined?!![]:![]:!![]})[_0xbb38('0x1c')](function(_0x257053){logger[_0xbb38('0x16')](_0xbb38('0x19'),_0x348fc0);logger[_0xbb38('0x10')](_0xbb38('0x19'),_0x348fc0,JSON['stringify'](_0x257053));_0x5ce8b6(_0x257053);})[_0xbb38('0x18')](function(_0x5ac159){logger[_0xbb38('0x12')]('CreatePlugin',_0x5ac159[_0xbb38('0x14')],_0x348fc0);_0x2fd89a(_0x542ab6[_0xbb38('0x12')](0x1f4,_0x5ac159[_0xbb38('0x14')]));});});};
\ No newline at end of file
+var _0x4af7=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','socket.io-emitter','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','options','raw','CreatePlugin'];(function(_0x4af139,_0x4b0759){var _0x23701e=function(_0x3959a1){while(--_0x3959a1){_0x4af139['push'](_0x4af139['shift']());}};_0x23701e(++_0x4b0759);}(_0x4af7,0xc4));var _0x74af=function(_0x5235dd,_0x3f91cf){_0x5235dd=_0x5235dd-0x0;var _0x13059d=_0x4af7[_0x5235dd];return _0x13059d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x74af('0x0'));var BPromise=require(_0x74af('0x1'));var rs=require(_0x74af('0x2'));var fs=require('fs');var db=require(_0x74af('0x3'))['db'];var utils=require(_0x74af('0x4'));var logger=require(_0x74af('0x5'))(_0x74af('0x6'));var config=require(_0x74af('0x7'));var jayson=require(_0x74af('0x8'));var client=jayson[_0x74af('0x9')]['http']({'port':0x232a});var socket=require(_0x74af('0xa'))({'host':'localhost','port':0x18eb});require('./plugin.socket')[_0x74af('0xb')](socket);function respondWithRpcPromise(_0xd9c13f,_0x774409,_0x28e745){return new BPromise(function(_0x404f05,_0x2dd368){return client['request'](_0xd9c13f,_0x28e745)[_0x74af('0xc')](function(_0x14219a){logger[_0x74af('0xd')](_0x74af('0xe'),_0x774409,_0x74af('0xf'));logger[_0x74af('0x10')](_0x74af('0x11'),_0x774409,_0x74af('0xf'),JSON[_0x74af('0x12')](_0x14219a));if(_0x14219a[_0x74af('0x13')]){if(_0x14219a[_0x74af('0x13')][_0x74af('0x14')]===0x1f4){logger['error'](_0x74af('0xe'),_0x774409,_0x14219a[_0x74af('0x13')]['message']);return _0x2dd368(_0x14219a[_0x74af('0x13')][_0x74af('0x15')]);}logger[_0x74af('0x13')](_0x74af('0xe'),_0x774409,_0x14219a['error'][_0x74af('0x15')]);return _0x404f05(_0x14219a[_0x74af('0x13')][_0x74af('0x15')]);}else{logger[_0x74af('0xd')](_0x74af('0xe'),_0x774409,_0x74af('0xf'));_0x404f05(_0x14219a[_0x74af('0x16')][_0x74af('0x15')]);}})[_0x74af('0x17')](function(_0x3463e9){logger[_0x74af('0x13')](_0x74af('0xe'),_0x774409,_0x3463e9);_0x2dd368(_0x3463e9);});});}exports['CreatePlugin']=function(_0x48d46f){var _0x2cb592=this;return new Promise(function(_0x1d76de,_0x3a8f2a){return db['Plugin'][_0x74af('0x18')](_0x48d46f['body'],{'raw':_0x48d46f[_0x74af('0x19')]?_0x48d46f[_0x74af('0x19')][_0x74af('0x1a')]===undefined?!![]:![]:!![]})[_0x74af('0xc')](function(_0x3c5f29){logger[_0x74af('0xd')](_0x74af('0x1b'),_0x48d46f);logger[_0x74af('0x10')]('CreatePlugin',_0x48d46f,JSON[_0x74af('0x12')](_0x3c5f29));_0x1d76de(_0x3c5f29);})[_0x74af('0x17')](function(_0x5e094b){logger[_0x74af('0x13')](_0x74af('0x1b'),_0x5e094b[_0x74af('0x15')],_0x48d46f);_0x3a8f2a(_0x2cb592[_0x74af('0x13')](0x1f4,_0x5e094b[_0x74af('0x15')]));});});};
\ No newline at end of file
index 9d7188f..98edaf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd002=['./plugin.events','save','update','emit','removeListener','length','plugin:'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xd002,0x1dc));var _0x2d00=function(_0x338e5e,_0xa7c395){_0x338e5e=_0x338e5e-0x0;var _0x5ee2a7=_0xd002[_0x338e5e];return _0x5ee2a7;};'use strict';var PluginEvents=require(_0x2d00('0x0'));var events=[_0x2d00('0x1'),'remove',_0x2d00('0x2')];function createListener(_0xc4fc36,_0x3818e6){return function(_0x4d816c){_0x3818e6[_0x2d00('0x3')](_0xc4fc36,_0x4d816c);};}function removeListener(_0x124b31,_0x3154ca){return function(){PluginEvents[_0x2d00('0x4')](_0x124b31,_0x3154ca);};}exports['register']=function(_0x4d1214){for(var _0x7aaaf8=0x0,_0x40dc16=events[_0x2d00('0x5')];_0x7aaaf8<_0x40dc16;_0x7aaaf8++){var _0x242c4a=events[_0x7aaaf8];var _0x4899be=createListener(_0x2d00('0x6')+_0x242c4a,_0x4d1214);PluginEvents['on'](_0x242c4a,_0x4899be);}};
\ No newline at end of file
+var _0x6696=['update','emit','removeListener','register','length','./plugin.events','remove'];(function(_0x304002,_0x288c24){var _0x2b6712=function(_0x2afd9b){while(--_0x2afd9b){_0x304002['push'](_0x304002['shift']());}};_0x2b6712(++_0x288c24);}(_0x6696,0x75));var _0x6669=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x6696[_0x31e29a];return _0x32d892;};'use strict';var PluginEvents=require(_0x6669('0x0'));var events=['save',_0x6669('0x1'),_0x6669('0x2')];function createListener(_0x3960d2,_0x21f5c2){return function(_0x4363a4){_0x21f5c2[_0x6669('0x3')](_0x3960d2,_0x4363a4);};}function removeListener(_0x34cb38,_0x5d421c){return function(){PluginEvents[_0x6669('0x4')](_0x34cb38,_0x5d421c);};}exports[_0x6669('0x5')]=function(_0x174fc7){for(var _0x22ec5d=0x0,_0x3707f9=events[_0x6669('0x6')];_0x22ec5d<_0x3707f9;_0x22ec5d++){var _0x2fddf0=events[_0x22ec5d];var _0x4a9654=createListener('plugin:'+_0x2fddf0,_0x174fc7);PluginEvents['on'](_0x2fddf0,_0x4a9654);}};
\ No newline at end of file
index 3f6dd5f..e6b926b 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(_0x1d2af1,_0x30aa3f){var _0x5872cf=function(_0x4b708c){while(--_0x4b708c){_0x1d2af1['push'](_0x1d2af1['shift']());}};_0x5872cf(++_0x30aa3f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x10e2e6,_0x17f93d){var _0x4931c6=function(_0x1ec8f2){while(--_0x1ec8f2){_0x10e2e6['push'](_0x10e2e6['shift']());}};_0x4931c6(++_0x17f93d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 1974cda..a293b86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe396=['destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','error','stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','catch','show','params','create','body','join','../../files/plugins','script','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','restart','Unknown\x20status'];(function(_0x4cf4a3,_0x1ba0c4){var _0x53a885=function(_0x357f47){while(--_0x357f47){_0x4cf4a3['push'](_0x4cf4a3['shift']());}};_0x53a885(++_0x1ba0c4);}(_0xe396,0xa3));var _0x6e39=function(_0x3f37b6,_0xa537d0){_0x3f37b6=_0x3f37b6-0x0;var _0x3ed70b=_0xe396[_0x3f37b6];return _0x3ed70b;};'use strict';var _=require(_0x6e39('0x0'));var pm2=require(_0x6e39('0x1'));var logger=require(_0x6e39('0x2'))(_0x6e39('0x3'));var path=require(_0x6e39('0x4'));var exec=require(_0x6e39('0x5'))[_0x6e39('0x6')];var BPromise=require(_0x6e39('0x7'));function handleEntityNotFound(_0x34bb99,_0x59bce9){return function(_0x3e8e20){if(!_0x3e8e20){_0x34bb99[_0x6e39('0x8')](0x194);;}return _0x3e8e20;};}function respondWithResult(_0x470d84,_0xe72a84){_0xe72a84=_0xe72a84||0xc8;return function(_0x2f4e95){if(_0x2f4e95){return _0x470d84[_0x6e39('0x9')](_0xe72a84)['json'](_0x2f4e95);}return null;};}function handleError(_0x4e3ab0,_0x1d8fd9){_0x1d8fd9=_0x1d8fd9||0x1f4;return function(_0x1f89f9){logger[_0x6e39('0xa')](_0x1f89f9[_0x6e39('0xb')]);if(_0x1f89f9[_0x6e39('0xc')]){delete _0x1f89f9[_0x6e39('0xc')];}_0x4e3ab0[_0x6e39('0x9')](_0x1d8fd9)[_0x6e39('0xd')](_0x1f89f9);};}function execChildProcess(){return new BPromise(function(_0x13b2fb,_0x17678d){exec(_0x6e39('0xe'),function(_0x3fb47d,_0x5e2413,_0x3f3bee){logger['info'](_0x5e2413);logger[_0x6e39('0xf')](_0x3f3bee);if(_0x3fb47d){logger[_0x6e39('0xa')](_0x3fb47d);return _0x17678d(_0x3fb47d);}return _0x13b2fb(_0x5e2413);});});}exports[_0x6e39('0x10')]=function(_0x9fc517,_0x3b6649){return pm2[_0x6e39('0x11')]()[_0x6e39('0x12')](function(_0x537c92){if(_0x537c92){var _0x4de16d=_[_0x6e39('0x13')](_0x537c92,function(_0x22c712){return _0x22c712[_0x6e39('0xc')]===_0x6e39('0x14')||_0x22c712[_0x6e39('0xc')]===_0x6e39('0x15');});return{'rows':_0x4de16d,'count':_0x4de16d['length']};}return null;})[_0x6e39('0x12')](respondWithResult(_0x3b6649,null))[_0x6e39('0x16')](handleError(_0x3b6649,null));};exports[_0x6e39('0x17')]=function(_0x5bd0ca,_0x3289ae){return pm2['describe'](_0x5bd0ca[_0x6e39('0x18')]['id'])['then'](respondWithResult(_0x3289ae,null))[_0x6e39('0x12')](handleEntityNotFound(_0x3289ae,null))[_0x6e39('0x16')](handleError(_0x3289ae,null));};exports[_0x6e39('0x19')]=function(_0x292177,_0x510cf1){if(_0x292177[_0x6e39('0x1a')][_0x6e39('0xc')]&&_0x292177[_0x6e39('0x1a')]['script']){var _0x6a7aa0=path[_0x6e39('0x1b')](__dirname,_0x6e39('0x1c'),_0x292177[_0x6e39('0x1a')][_0x6e39('0x1d')]);var _0x272348=process['cwd']();process[_0x6e39('0x1e')](path[_0x6e39('0x1f')](_0x6a7aa0));return execChildProcess()[_0x6e39('0x12')](function(_0x4d8a23){process[_0x6e39('0x1e')](_0x272348);return pm2[_0x6e39('0x20')]({'name':_0x292177[_0x6e39('0x1a')][_0x6e39('0xc')],'script':_0x6a7aa0});})['then'](function(_0x34d82a){pm2[_0x6e39('0x21')]();return _0x34d82a[0x0];})[_0x6e39('0x12')](respondWithResult(_0x510cf1,0xc9))['catch'](handleError(_0x510cf1,null));}else{return _0x510cf1['status'](0x1f4)[_0x6e39('0xd')]({'message':_0x6e39('0x22')});}};exports['update']=function(_0x4ac178,_0x23a387){if(_0x4ac178[_0x6e39('0x1a')]['id']){delete _0x4ac178[_0x6e39('0x1a')]['id'];}var _0x511570={'online':_0x6e39('0x23'),'stopped':'stop'};if(_0x511570['hasOwnProperty'](_0x4ac178['body']['status'])){return pm2[_0x511570[_0x4ac178['body'][_0x6e39('0x9')]]](_0x4ac178[_0x6e39('0x18')]['id'])[_0x6e39('0x12')](respondWithResult(_0x23a387,0xc8))[_0x6e39('0x16')](handleError(_0x23a387,null));}else{return _0x23a387[_0x6e39('0x9')](0x1f4)['send']({'message':_0x6e39('0x24')});}};exports[_0x6e39('0x25')]=function(_0x151bad,_0x40a33f){if(_0x151bad[_0x6e39('0x1a')]['id']){delete _0x151bad['body']['id'];}if(_0x151bad['params']['id']){return pm2[_0x6e39('0x26')](_0x151bad['params']['id'])[_0x6e39('0x12')](function(_0x212d26){pm2[_0x6e39('0x21')]();return _0x212d26[0x0];})['then'](respondWithResult(_0x40a33f,null))[_0x6e39('0x16')](handleError(_0x40a33f,null));}else{return _0x40a33f['status'](0x1f4)['send']({'message':_0x6e39('0x27')});}};
\ No newline at end of file
+var _0x8f5c=['info','index','list','then','motion2','length','catch','show','describe','params','create','body','script','join','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','path','child_process','bluebird','status','json','error','name','send','npm\x20install'];(function(_0x1eefb0,_0x6e6e6b){var _0x8c4df4=function(_0x4ea1cd){while(--_0x4ea1cd){_0x1eefb0['push'](_0x1eefb0['shift']());}};_0x8c4df4(++_0x6e6e6b);}(_0x8f5c,0x177));var _0xc8f5=function(_0x5d8631,_0x44944b){_0x5d8631=_0x5d8631-0x0;var _0x34c15e=_0x8f5c[_0x5d8631];return _0x34c15e;};'use strict';var _=require(_0xc8f5('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')('api');var path=require(_0xc8f5('0x1'));var exec=require(_0xc8f5('0x2'))['exec'];var BPromise=require(_0xc8f5('0x3'));function handleEntityNotFound(_0x469b43,_0x6cef2e){return function(_0x3e0044){if(!_0x3e0044){_0x469b43['sendStatus'](0x194);;}return _0x3e0044;};}function respondWithResult(_0xe77359,_0x32a504){_0x32a504=_0x32a504||0xc8;return function(_0x38289d){if(_0x38289d){return _0xe77359[_0xc8f5('0x4')](_0x32a504)[_0xc8f5('0x5')](_0x38289d);}return null;};}function handleError(_0x456807,_0x401ee3){_0x401ee3=_0x401ee3||0x1f4;return function(_0x2a57de){logger[_0xc8f5('0x6')](_0x2a57de['stack']);if(_0x2a57de[_0xc8f5('0x7')]){delete _0x2a57de[_0xc8f5('0x7')];}_0x456807['status'](_0x401ee3)[_0xc8f5('0x8')](_0x2a57de);};}function execChildProcess(){return new BPromise(function(_0x1d8965,_0x4b0f4b){exec(_0xc8f5('0x9'),function(_0x5117dd,_0x3dec72,_0x31cf28){logger[_0xc8f5('0xa')](_0x3dec72);logger[_0xc8f5('0xa')](_0x31cf28);if(_0x5117dd){logger[_0xc8f5('0x6')](_0x5117dd);return _0x4b0f4b(_0x5117dd);}return _0x1d8965(_0x3dec72);});});}exports[_0xc8f5('0xb')]=function(_0x41ea68,_0x1dd565){return pm2[_0xc8f5('0xc')]()[_0xc8f5('0xd')](function(_0x459095){if(_0x459095){var _0x57f84b=_['reject'](_0x459095,function(_0x42f369){return _0x42f369['name']==='express'||_0x42f369[_0xc8f5('0x7')]===_0xc8f5('0xe');});return{'rows':_0x57f84b,'count':_0x57f84b[_0xc8f5('0xf')]};}return null;})['then'](respondWithResult(_0x1dd565,null))[_0xc8f5('0x10')](handleError(_0x1dd565,null));};exports[_0xc8f5('0x11')]=function(_0x49a88d,_0x7e3643){return pm2[_0xc8f5('0x12')](_0x49a88d[_0xc8f5('0x13')]['id'])[_0xc8f5('0xd')](respondWithResult(_0x7e3643,null))[_0xc8f5('0xd')](handleEntityNotFound(_0x7e3643,null))[_0xc8f5('0x10')](handleError(_0x7e3643,null));};exports[_0xc8f5('0x14')]=function(_0x25ff6b,_0x3dc3a8){if(_0x25ff6b[_0xc8f5('0x15')][_0xc8f5('0x7')]&&_0x25ff6b[_0xc8f5('0x15')][_0xc8f5('0x16')]){var _0x3ceed7=path[_0xc8f5('0x17')](__dirname,'../../files/plugins',_0x25ff6b['body'][_0xc8f5('0x16')]);var _0x451ac7=process[_0xc8f5('0x18')]();process[_0xc8f5('0x19')](path[_0xc8f5('0x1a')](_0x3ceed7));return execChildProcess()[_0xc8f5('0xd')](function(_0x253ec3){process[_0xc8f5('0x19')](_0x451ac7);return pm2['start']({'name':_0x25ff6b[_0xc8f5('0x15')][_0xc8f5('0x7')],'script':_0x3ceed7});})[_0xc8f5('0xd')](function(_0x26b5a3){pm2[_0xc8f5('0x1b')]();return _0x26b5a3[0x0];})[_0xc8f5('0xd')](respondWithResult(_0x3dc3a8,0xc9))[_0xc8f5('0x10')](handleError(_0x3dc3a8,null));}else{return _0x3dc3a8['status'](0x1f4)[_0xc8f5('0x8')]({'message':_0xc8f5('0x1c')});}};exports['update']=function(_0x472498,_0x24d573){if(_0x472498[_0xc8f5('0x15')]['id']){delete _0x472498[_0xc8f5('0x15')]['id'];}var _0x22fa0e={'online':_0xc8f5('0x1d'),'stopped':_0xc8f5('0x1e')};if(_0x22fa0e[_0xc8f5('0x1f')](_0x472498[_0xc8f5('0x15')][_0xc8f5('0x4')])){return pm2[_0x22fa0e[_0x472498['body'][_0xc8f5('0x4')]]](_0x472498[_0xc8f5('0x13')]['id'])['then'](respondWithResult(_0x24d573,0xc8))[_0xc8f5('0x10')](handleError(_0x24d573,null));}else{return _0x24d573['status'](0x1f4)[_0xc8f5('0x8')]({'message':_0xc8f5('0x20')});}};exports[_0xc8f5('0x21')]=function(_0x1f074b,_0x19a1c6){if(_0x1f074b[_0xc8f5('0x15')]['id']){delete _0x1f074b[_0xc8f5('0x15')]['id'];}if(_0x1f074b[_0xc8f5('0x13')]['id']){return pm2[_0xc8f5('0x22')](_0x1f074b[_0xc8f5('0x13')]['id'])[_0xc8f5('0xd')](function(_0x56206e){pm2['dump']();return _0x56206e[0x0];})[_0xc8f5('0xd')](respondWithResult(_0x19a1c6,null))['catch'](handleError(_0x19a1c6,null));}else{return _0x19a1c6['status'](0x1f4)[_0xc8f5('0x8')]({'message':'Unknown\x20id'});}};
\ No newline at end of file
index f18f123..42bff9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc12b=['path','express','../../config/environment','exports'];(function(_0xb5da76,_0x272ceb){var _0x443e26=function(_0x29d935){while(--_0x29d935){_0xb5da76['push'](_0xb5da76['shift']());}};_0x443e26(++_0x272ceb);}(_0xc12b,0x144));var _0xbc12=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc12b[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbc12('0x0'));var express=require(_0xbc12('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbc12('0x2'));module[_0xbc12('0x3')]=router;
\ No newline at end of file
+var _0x6c1d=['path','express','Router','../../components/auth/service','../../components/interaction/service','multer','util'];(function(_0x5c18a6,_0x2932f7){var _0x4c1d6c=function(_0x712b3f){while(--_0x712b3f){_0x5c18a6['push'](_0x5c18a6['shift']());}};_0x4c1d6c(++_0x2932f7);}(_0x6c1d,0x1cc));var _0xd6c1=function(_0xb0ec62,_0x4b3078){_0xb0ec62=_0xb0ec62-0x0;var _0x308035=_0x6c1d[_0xb0ec62];return _0x308035;};'use strict';var multer=require(_0xd6c1('0x0'));var util=require(_0xd6c1('0x1'));var path=require(_0xd6c1('0x2'));var express=require(_0xd6c1('0x3'));var router=express[_0xd6c1('0x4')]();var auth=require(_0xd6c1('0x5'));var interaction=require(_0xd6c1('0x6'));var config=require('../../config/environment');module['exports']=router;
\ No newline at end of file
index 8ce7693..31884a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x176a=['INTEGER','sequelize','STRING','DATE'];(function(_0x1a7415,_0x8b215e){var _0x22f558=function(_0x50048f){while(--_0x50048f){_0x1a7415['push'](_0x1a7415['shift']());}};_0x22f558(++_0x8b215e);}(_0x176a,0xc1));var _0xa176=function(_0x25fe5f,_0x553196){_0x25fe5f=_0x25fe5f-0x0;var _0x50a435=_0x176a[_0x25fe5f];return _0x50a435;};'use strict';var Sequelize=require(_0xa176('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xa176('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xa176('0x1')]},'starttime':{'type':Sequelize[_0xa176('0x2')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xa176('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xa176('0x1')]},'campaigntype':{'type':Sequelize[_0xa176('0x1')]},'membername':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa12f=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x502308,_0x5be836){var _0x18a77f=function(_0x106906){while(--_0x106906){_0x502308['push'](_0x502308['shift']());}};_0x18a77f(++_0x5be836);}(_0xa12f,0x1bc));var _0xfa12=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa12f[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0xfa12('0x0'));module[_0xfa12('0x1')]={'state':{'type':Sequelize[_0xfa12('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xfa12('0x3')]},'scheduledat':{'type':Sequelize[_0xfa12('0x4')]},'uniqueid':{'type':Sequelize[_0xfa12('0x3')]},'starttime':{'type':Sequelize[_0xfa12('0x4')]},'responsetime':{'type':Sequelize[_0xfa12('0x4')]},'ringtime':{'type':Sequelize[_0xfa12('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xfa12('0x3')]},'campaigntype':{'type':Sequelize[_0xfa12('0x3')]},'membername':{'type':Sequelize[_0xfa12('0x3')]}};
\ No newline at end of file
index 9ea5341..153cfae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9692=['lodash','util','../../config/logger','moment','bluebird','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview'];(function(_0x3bce39,_0x3edeff){var _0x424c8f=function(_0x2d31ea){while(--_0x2d31ea){_0x3bce39['push'](_0x3bce39['shift']());}};_0x424c8f(++_0x3edeff);}(_0x9692,0x19a));var _0x2969=function(_0x55c701,_0x30a483){_0x55c701=_0x55c701-0x0;var _0x1c8b8e=_0x9692[_0x55c701];return _0x1c8b8e;};'use strict';var _=require(_0x2969('0x0'));var util=require(_0x2969('0x1'));var logger=require(_0x2969('0x2'))('api');var moment=require(_0x2969('0x3'));var BPromise=require(_0x2969('0x4'));var rp=require('request-promise');var attributes=require(_0x2969('0x5'));module[_0x2969('0x6')]=function(_0x454022,_0x5984eb){return _0x454022[_0x2969('0x7')](_0x2969('0x8'),attributes,{'tableName':_0x2969('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a99=['report_agent_preview','lodash','../../config/logger','api','moment','request-promise','exports','define'];(function(_0x3f5a4a,_0x524583){var _0xb575ac=function(_0x3c19a1){while(--_0x3c19a1){_0x3f5a4a['push'](_0x3f5a4a['shift']());}};_0xb575ac(++_0x524583);}(_0x7a99,0x189));var _0x97a9=function(_0x59f2b5,_0x483570){_0x59f2b5=_0x59f2b5-0x0;var _0x3f8c5b=_0x7a99[_0x59f2b5];return _0x3f8c5b;};'use strict';var _=require(_0x97a9('0x0'));var util=require('util');var logger=require(_0x97a9('0x1'))(_0x97a9('0x2'));var moment=require(_0x97a9('0x3'));var BPromise=require('bluebird');var rp=require(_0x97a9('0x4'));var attributes=require('./reportAgentPreview.attributes');module[_0x97a9('0x5')]=function(_0x541465,_0x92a8d5){return _0x541465[_0x97a9('0x6')]('ReportAgentPreview',attributes,{'tableName':_0x97a9('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 16c3028..c4cb5e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf006=['debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview','moment','bluebird','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent'];(function(_0x552959,_0x550fd4){var _0x7175ee=function(_0x5a4769){while(--_0x5a4769){_0x552959['push'](_0x552959['shift']());}};_0x7175ee(++_0x550fd4);}(_0xf006,0x146));var _0x6f00=function(_0x43011e,_0x237ac1){_0x43011e=_0x43011e-0x0;var _0x56154f=_0xf006[_0x43011e];return _0x56154f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6f00('0x0'));var BPromise=require(_0x6f00('0x1'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x6f00('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x6f00('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6f00('0x4'));var client=jayson[_0x6f00('0x5')][_0x6f00('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x52c9a2,_0x3c29ff,_0x4f918f){return new BPromise(function(_0x3875fb,_0x3001b1){return client[_0x6f00('0x7')](_0x52c9a2,_0x4f918f)[_0x6f00('0x8')](function(_0x286d32){logger[_0x6f00('0x9')](_0x6f00('0xa'),_0x3c29ff,_0x6f00('0xb'));logger[_0x6f00('0xc')](_0x6f00('0xd'),_0x3c29ff,_0x6f00('0xb'),JSON[_0x6f00('0xe')](_0x286d32));if(_0x286d32[_0x6f00('0xf')]){if(_0x286d32['error'][_0x6f00('0x10')]===0x1f4){logger[_0x6f00('0xf')](_0x6f00('0xa'),_0x3c29ff,_0x286d32[_0x6f00('0xf')][_0x6f00('0x11')]);return _0x3001b1(_0x286d32['error'][_0x6f00('0x11')]);}logger['error'](_0x6f00('0xa'),_0x3c29ff,_0x286d32['error'][_0x6f00('0x11')]);return _0x3875fb(_0x286d32[_0x6f00('0xf')][_0x6f00('0x11')]);}else{logger[_0x6f00('0x9')](_0x6f00('0xa'),_0x3c29ff,_0x6f00('0xb'));_0x3875fb(_0x286d32[_0x6f00('0x12')][_0x6f00('0x11')]);}})[_0x6f00('0x13')](function(_0x4bfac3){logger[_0x6f00('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x3c29ff,_0x4bfac3);_0x3001b1(_0x4bfac3);});});}exports['CreateReportAgentPreview']=function(_0x7c047e){var _0x6cf83f=this;return new Promise(function(_0x466c7c,_0x340f78){return db[_0x6f00('0x14')][_0x6f00('0x15')](_0x7c047e[_0x6f00('0x16')],{'raw':_0x7c047e[_0x6f00('0x17')]?_0x7c047e[_0x6f00('0x17')][_0x6f00('0x18')]===undefined?!![]:![]:!![]})[_0x6f00('0x8')](function(_0x23f27a){logger['info']('CreateReportAgentPreview',_0x7c047e);logger['debug'](_0x6f00('0x19'),_0x7c047e,JSON[_0x6f00('0xe')](_0x23f27a));_0x466c7c(_0x23f27a);})[_0x6f00('0x13')](function(_0x57340f){logger[_0x6f00('0xf')](_0x6f00('0x19'),_0x57340f[_0x6f00('0x11')],_0x7c047e);_0x340f78(_0x6cf83f[_0x6f00('0xf')](0x1f4,_0x57340f[_0x6f00('0x11')]));});});};
\ No newline at end of file
+var _0x8ef6=['client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','create','body','options','raw','CreateReportAgentPreview','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3a3146,_0x380ebf){var _0x207034=function(_0x47ed8d){while(--_0x47ed8d){_0x3a3146['push'](_0x3a3146['shift']());}};_0x207034(++_0x380ebf);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3b6c28,_0x387e68){_0x3b6c28=_0x3b6c28-0x0;var _0x2cbf63=_0x8ef6[_0x3b6c28];return _0x2cbf63;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var db=require(_0x68ef('0x5'))['db'];var utils=require(_0x68ef('0x6'));var logger=require('../../config/logger')(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var jayson=require(_0x68ef('0x9'));var client=jayson[_0x68ef('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f77f3,_0x3c2ff3,_0x4740e8){return new BPromise(function(_0x2de776,_0x4eb5eb){return client[_0x68ef('0xb')](_0x4f77f3,_0x4740e8)[_0x68ef('0xc')](function(_0x1bee73){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x3c2ff3,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x3c2ff3,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x1bee73));if(_0x1bee73[_0x68ef('0x13')]){if(_0x1bee73[_0x68ef('0x13')]['code']===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x3c2ff3,_0x1bee73[_0x68ef('0x13')][_0x68ef('0x14')]);return _0x4eb5eb(_0x1bee73[_0x68ef('0x13')][_0x68ef('0x14')]);}logger['error'](_0x68ef('0xe'),_0x3c2ff3,_0x1bee73[_0x68ef('0x13')][_0x68ef('0x14')]);return _0x2de776(_0x1bee73['error'][_0x68ef('0x14')]);}else{logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x3c2ff3,'request\x20sent');_0x2de776(_0x1bee73[_0x68ef('0x15')][_0x68ef('0x14')]);}})[_0x68ef('0x16')](function(_0x3780a4){logger['error'](_0x68ef('0xe'),_0x3c2ff3,_0x3780a4);_0x4eb5eb(_0x3780a4);});});}exports['CreateReportAgentPreview']=function(_0x5cbb78){var _0x2633c1=this;return new Promise(function(_0x404870,_0x4ade0d){return db['ReportAgentPreview'][_0x68ef('0x17')](_0x5cbb78[_0x68ef('0x18')],{'raw':_0x5cbb78[_0x68ef('0x19')]?_0x5cbb78['options'][_0x68ef('0x1a')]===undefined?!![]:![]:!![]})[_0x68ef('0xc')](function(_0x183f5f){logger['info'](_0x68ef('0x1b'),_0x5cbb78);logger[_0x68ef('0x10')]('CreateReportAgentPreview',_0x5cbb78,JSON[_0x68ef('0x12')](_0x183f5f));_0x404870(_0x183f5f);})[_0x68ef('0x16')](function(_0x19aa3d){logger['error']('CreateReportAgentPreview',_0x19aa3d['message'],_0x5cbb78);_0x4ade0d(_0x2633c1[_0x68ef('0x13')](0x1f4,_0x19aa3d[_0x68ef('0x14')]));});});};
\ No newline at end of file
index 3a500ce..8d103a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98d4=['/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/sms/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','/sms/queues','smsQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','outbound','/outbound/channels','outboundChannels','/agents','agents','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/sms/queues/waitinginteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail'];(function(_0x36869a,_0x240aff){var _0x242ccc=function(_0xcb9b91){while(--_0xcb9b91){_0x36869a['push'](_0x36869a['shift']());}};_0x242ccc(++_0x240aff);}(_0x98d4,0xa3));var _0x498d=function(_0x2bc3ed,_0x5c7aba){_0x2bc3ed=_0x2bc3ed-0x0;var _0x39c788=_0x98d4[_0x2bc3ed];return _0x39c788;};'use strict';var multer=require(_0x498d('0x0'));var util=require(_0x498d('0x1'));var path=require(_0x498d('0x2'));var express=require(_0x498d('0x3'));var router=express[_0x498d('0x4')]();var auth=require(_0x498d('0x5'));var controller=require(_0x498d('0x6'));router['get'](_0x498d('0x7'),auth[_0x498d('0x8')](),controller['voiceChannels']);router[_0x498d('0x9')](_0x498d('0xa'),auth[_0x498d('0x8')](),controller[_0x498d('0xb')]);router[_0x498d('0x9')](_0x498d('0xc'),auth[_0x498d('0x8')](),controller[_0x498d('0xd')]);router[_0x498d('0x9')](_0x498d('0xe'),auth[_0x498d('0x8')](),controller[_0x498d('0xf')]);router[_0x498d('0x9')]('/chat/queues',auth[_0x498d('0x8')](),controller[_0x498d('0x10')]);router[_0x498d('0x9')](_0x498d('0x11'),auth['isAuthenticated'](),controller[_0x498d('0x12')]);router[_0x498d('0x9')]('/mail/accounts',auth[_0x498d('0x8')](),controller['mailAccounts']);router[_0x498d('0x9')]('/openchannel/queues',auth[_0x498d('0x8')](),controller['openchannelQueues']);router['get'](_0x498d('0x13'),auth[_0x498d('0x8')](),controller[_0x498d('0x14')]);router[_0x498d('0x9')]('/fax/queues',auth[_0x498d('0x8')](),controller[_0x498d('0x15')]);router[_0x498d('0x9')](_0x498d('0x16'),auth[_0x498d('0x8')](),controller[_0x498d('0x17')]);router[_0x498d('0x9')](_0x498d('0x18'),auth[_0x498d('0x8')](),controller[_0x498d('0x19')]);router['get'](_0x498d('0x1a'),auth[_0x498d('0x8')](),controller[_0x498d('0x1b')]);router[_0x498d('0x9')](_0x498d('0x1c'),auth['isAuthenticated'](),controller[_0x498d('0x1d')]);router[_0x498d('0x9')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x498d('0x8')](),controller[_0x498d('0x1e')]);router[_0x498d('0x9')](_0x498d('0x1f'),auth[_0x498d('0x8')](),controller['showVoiceQueues']);router[_0x498d('0x9')]('/outbound',auth[_0x498d('0x8')](),controller[_0x498d('0x20')]);router[_0x498d('0x9')](_0x498d('0x21'),auth[_0x498d('0x8')](),controller[_0x498d('0x22')]);router[_0x498d('0x9')](_0x498d('0x23'),auth[_0x498d('0x8')](),controller[_0x498d('0x24')]);router['put']('/agents/:id/capacity',auth[_0x498d('0x8')](),controller[_0x498d('0x25')]);router[_0x498d('0x9')](_0x498d('0x26'),auth[_0x498d('0x8')](),controller[_0x498d('0x27')]);router['get'](_0x498d('0x28'),auth[_0x498d('0x8')](),controller[_0x498d('0x29')]);router['get'](_0x498d('0x2a'),auth[_0x498d('0x8')](),controller[_0x498d('0x2b')]);router[_0x498d('0x9')](_0x498d('0x2c'),auth['isAuthenticated'](),controller[_0x498d('0x2d')]);router[_0x498d('0x9')](_0x498d('0x2e'),auth[_0x498d('0x8')](),controller['chatQueuesWaitingInteractions']);router[_0x498d('0x9')](_0x498d('0x2f'),auth[_0x498d('0x8')](),controller[_0x498d('0x30')]);router['get'](_0x498d('0x31'),auth[_0x498d('0x8')](),controller['openchannelQueuesWaitingInteractions']);router[_0x498d('0x9')](_0x498d('0x32'),auth[_0x498d('0x8')](),controller['smsQueuesWaitingInteractions']);router[_0x498d('0x9')](_0x498d('0x33'),auth[_0x498d('0x8')](),controller['faxQueuesWaitingInteractions']);router[_0x498d('0x34')](_0x498d('0x35'),auth[_0x498d('0x8')](),controller[_0x498d('0x36')](_0x498d('0x37')));router[_0x498d('0x9')](_0x498d('0x38'),auth[_0x498d('0x8')](),controller['showMailQueues']);router[_0x498d('0x34')](_0x498d('0x39'),auth[_0x498d('0x8')](),controller['queueNotify'](_0x498d('0x3a')));router['get'](_0x498d('0x3b'),auth[_0x498d('0x8')](),controller[_0x498d('0x3c')]);router['post'](_0x498d('0x3d'),auth['isAuthenticated'](),controller[_0x498d('0x36')](_0x498d('0x3e')));router[_0x498d('0x9')](_0x498d('0x3f'),auth['isAuthenticated'](),controller[_0x498d('0x40')]);router[_0x498d('0x34')]('/openchannel/queues/:id/notify',auth[_0x498d('0x8')](),controller[_0x498d('0x36')](_0x498d('0x41')));router[_0x498d('0x9')](_0x498d('0x42'),auth['isAuthenticated'](),controller[_0x498d('0x43')]);router['post'](_0x498d('0x44'),auth[_0x498d('0x8')](),controller[_0x498d('0x36')]('sms'));router[_0x498d('0x9')](_0x498d('0x45'),auth[_0x498d('0x8')](),controller['showSmsQueues']);router['post'](_0x498d('0x46'),auth[_0x498d('0x8')](),controller[_0x498d('0x47')]);module[_0x498d('0x48')]=router;
\ No newline at end of file
+var _0x9fab=['/sms/queues/:id','/agents/:id/notify','exports','util','express','../../components/auth/service','/voice/channels','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/mail/queues','mailQueues','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','put','agentCapacity','telephones','trunks','campaigns','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','/sms/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','chat','post','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify'];(function(_0x14eac4,_0x530740){var _0xb234e5=function(_0x5dd086){while(--_0x5dd086){_0x14eac4['push'](_0x14eac4['shift']());}};_0xb234e5(++_0x530740);}(_0x9fab,0x1c3));var _0xb9fa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9fab[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xb9fa('0x0'));var path=require('path');var express=require(_0xb9fa('0x1'));var router=express['Router']();var auth=require(_0xb9fa('0x2'));var controller=require('./rpc.controller');router['get'](_0xb9fa('0x3'),auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x5')]);router[_0xb9fa('0x6')](_0xb9fa('0x7'),auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x8')]);router[_0xb9fa('0x6')](_0xb9fa('0x9'),auth[_0xb9fa('0x4')](),controller[_0xb9fa('0xa')]);router['get'](_0xb9fa('0xb'),auth[_0xb9fa('0x4')](),controller['voiceQueues']);router[_0xb9fa('0x6')]('/chat/queues',auth[_0xb9fa('0x4')](),controller['chatQueues']);router['get'](_0xb9fa('0xc'),auth['isAuthenticated'](),controller[_0xb9fa('0xd')]);router['get']('/mail/accounts',auth[_0xb9fa('0x4')](),controller['mailAccounts']);router[_0xb9fa('0x6')](_0xb9fa('0xe'),auth[_0xb9fa('0x4')](),controller[_0xb9fa('0xf')]);router[_0xb9fa('0x6')](_0xb9fa('0x10'),auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x11')]);router[_0xb9fa('0x6')](_0xb9fa('0x12'),auth['isAuthenticated'](),controller[_0xb9fa('0x13')]);router[_0xb9fa('0x6')](_0xb9fa('0x14'),auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x15')]);router['get'](_0xb9fa('0x16'),auth[_0xb9fa('0x4')](),controller['voiceQueuesChannels']);router[_0xb9fa('0x6')](_0xb9fa('0x17'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0xb9fa('0x6')](_0xb9fa('0x18'),auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x19')]);router[_0xb9fa('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x1a')]);router[_0xb9fa('0x6')](_0xb9fa('0x1b'),auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x1c')]);router[_0xb9fa('0x6')](_0xb9fa('0x1d'),auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x1e')]);router[_0xb9fa('0x6')](_0xb9fa('0x1f'),auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x20')]);router[_0xb9fa('0x6')](_0xb9fa('0x21'),auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x22')]);router[_0xb9fa('0x23')]('/agents/:id/capacity',auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x24')]);router[_0xb9fa('0x6')]('/telephones',auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x25')]);router['get']('/trunks',auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x26')]);router['get']('/campaigns',auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x27')]);router[_0xb9fa('0x6')]('/fax/accounts',auth['isAuthenticated'](),controller[_0xb9fa('0x28')]);router[_0xb9fa('0x6')](_0xb9fa('0x29'),auth[_0xb9fa('0x4')](),controller['chatQueuesWaitingInteractions']);router[_0xb9fa('0x6')](_0xb9fa('0x2a'),auth[_0xb9fa('0x4')](),controller['mailQueuesWaitingInteractions']);router['get'](_0xb9fa('0x2b'),auth[_0xb9fa('0x4')](),controller['openchannelQueuesWaitingInteractions']);router[_0xb9fa('0x6')](_0xb9fa('0x2c'),auth[_0xb9fa('0x4')](),controller['smsQueuesWaitingInteractions']);router[_0xb9fa('0x6')](_0xb9fa('0x2d'),auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x2e')]);router['post'](_0xb9fa('0x2f'),auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x30')](_0xb9fa('0x31')));router['get'](_0xb9fa('0x32'),auth[_0xb9fa('0x4')](),controller['showMailQueues']);router['post'](_0xb9fa('0x33'),auth['isAuthenticated'](),controller[_0xb9fa('0x30')](_0xb9fa('0x34')));router['get']('/chat/queues/:id',auth['isAuthenticated'](),controller['showChatQueues']);router[_0xb9fa('0x35')]('/fax/queues/:id/notify',auth[_0xb9fa('0x4')](),controller['queueNotify'](_0xb9fa('0x36')));router['get']('/fax/queues/:id',auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x37')]);router[_0xb9fa('0x35')](_0xb9fa('0x38'),auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x30')](_0xb9fa('0x39')));router[_0xb9fa('0x6')](_0xb9fa('0x3a'),auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x3b')]);router[_0xb9fa('0x35')](_0xb9fa('0x3c'),auth['isAuthenticated'](),controller[_0xb9fa('0x30')]('sms'));router[_0xb9fa('0x6')](_0xb9fa('0x3d'),auth['isAuthenticated'](),controller['showSmsQueues']);router[_0xb9fa('0x35')](_0xb9fa('0x3e'),auth[_0xb9fa('0x4')](),controller['agentNotify']);module[_0xb9fa('0x3f')]=router;
\ No newline at end of file
index 133e9b5..6ac11c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22c9=['INTERACTION','SIP/','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks','campaigns','chatQueues','showChatQueues','mailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','smsQueues','showSmsQueues','SmsQueues','faxQueues','FaxQueues','showFaxQueues','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','Account','findOne','\x20Queue\x20not\x20found','Message','Interaction','update','queue','MessageId','From','QueueId','create','Start','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','User','Agent\x20not\x20found','messageId','InteractionId','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','http','client','request','error','code','message','catch','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','query','params','voiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','OutboundChannels','Agents','agentCapacity','body','interaction','user','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate'];(function(_0x5f046f,_0x4e1683){var _0x14df04=function(_0x549554){while(--_0x549554){_0x5f046f['push'](_0x5f046f['shift']());}};_0x14df04(++_0x4e1683);}(_0x22c9,0x1e6));var _0x922c=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x22c9[_0x3635ce];return _0x97ecd0;};'use strict';var BPromise=require(_0x922c('0x0'));var moment=require(_0x922c('0x1'));var _=require(_0x922c('0x2'));var db=require(_0x922c('0x3'))['db'];var logger=require(_0x922c('0x4'))(_0x922c('0x5'));var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x922c('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x922c('0x6')]({'port':0x232b});var routingClient=jayson[_0x922c('0x7')][_0x922c('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x503650,_0x4f7468,_0x3b1d9d){return new BPromise(function(_0x42bea4,_0x1be699){var _0x151341=_0x3b1d9d?_0x3b1d9d:amiClient;return _0x151341[_0x922c('0x8')](_0x503650,_0x4f7468)['then'](function(_0x221675){if(_0x221675[_0x922c('0x9')]){if(_0x221675[_0x922c('0x9')][_0x922c('0xa')]===0x1f4){return _0x1be699(_0x221675[_0x922c('0x9')][_0x922c('0xb')]);}return _0x42bea4(_0x221675[_0x922c('0x9')][_0x922c('0xb')]);}else{_0x42bea4(_0x221675['result']);}})[_0x922c('0xc')](function(_0x161540){_0x1be699(_0x161540);});});}function respondWithResult(_0x426695,_0xe90513){_0xe90513=_0xe90513||0xc8;return function(_0x5c2d1d){if(_0x5c2d1d){return _0x426695[_0x922c('0xd')](_0xe90513)[_0x922c('0xe')](_0x5c2d1d);}return _0x426695[_0x922c('0xf')](0x194);};}function handleError(_0x9b26a5,_0x6fe9b1){_0x6fe9b1=_0x6fe9b1||0x1f4;return function(_0x3e31f2){logger['error'](_0x3e31f2['stack']);if(_0x3e31f2[_0x922c('0x10')]){delete _0x3e31f2[_0x922c('0x10')];}_0x9b26a5[_0x922c('0xd')](_0x6fe9b1)[_0x922c('0x11')](_0x3e31f2);};}function findById(_0x957bb4){return function(_0x5347f4){if(!_[_0x922c('0x12')](_0x957bb4)&&!_[_0x922c('0x12')](_0x5347f4)&&!_[_0x922c('0x12')](_0x5347f4[_0x922c('0x13')])){return _[_0x922c('0x14')](_0x5347f4['rows'],function(_0x2eb036){return _0x2eb036['id']==_0x957bb4;});}return null;};}exports[_0x922c('0x15')]=function(_0x5ba5cd,_0xcad783){return respondWithRpcPromise('VoiceChannels',_0x5ba5cd['query'])[_0x922c('0x16')](respondWithResult(_0xcad783,null))['catch'](handleError(_0xcad783,null));};exports[_0x922c('0x17')]=function(_0x4c51f3,_0x2fa36e){return respondWithRpcPromise(_0x922c('0x18'),_['merge'](_0x4c51f3[_0x922c('0x19')],_0x4c51f3[_0x922c('0x1a')]))[_0x922c('0x16')](respondWithResult(_0x2fa36e,null))['catch'](handleError(_0x2fa36e,null));};exports[_0x922c('0x1b')]=function(_0x1e1dd6,_0x57f214){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x922c('0x1c')](_0x1e1dd6[_0x922c('0x19')],_0x1e1dd6[_0x922c('0x1a')]))[_0x922c('0x16')](respondWithResult(_0x57f214,null))[_0x922c('0xc')](handleError(_0x57f214,null));};exports[_0x922c('0x1d')]=function(_0xfbe168,_0x29a03e){return respondWithRpcPromise(_0x922c('0x1e'),_0xfbe168['query'])['then'](respondWithResult(_0x29a03e,null))['catch'](handleError(_0x29a03e,null));};exports[_0x922c('0x1f')]=function(_0x3c9fea,_0x35d9f3){return respondWithRpcPromise(_0x922c('0x1e'),_0x3c9fea['query'])['then'](findById(_0x3c9fea[_0x922c('0x1a')]['id']))['then'](respondWithResult(_0x35d9f3,null))[_0x922c('0xc')](handleError(_0x35d9f3,null));};exports[_0x922c('0x20')]=function(_0x5ff786,_0x3922ed){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x922c('0x1c')](_0x5ff786[_0x922c('0x19')],_0x5ff786[_0x922c('0x1a')]))[_0x922c('0x16')](respondWithResult(_0x3922ed,null))['catch'](handleError(_0x3922ed,null));};exports[_0x922c('0x21')]=function(_0x4c2008,_0x339900){return respondWithRpcPromise(_0x922c('0x22'),_0x4c2008[_0x922c('0x19')])[_0x922c('0x16')](respondWithResult(_0x339900,null))[_0x922c('0xc')](handleError(_0x339900,null));};exports[_0x922c('0x23')]=function(_0x129064,_0x1c57c8){return respondWithRpcPromise(_0x922c('0x24'),_['merge'](_0x129064[_0x922c('0x19')],_0x129064[_0x922c('0x1a')]))['then'](respondWithResult(_0x1c57c8,null))[_0x922c('0xc')](handleError(_0x1c57c8,null));};exports[_0x922c('0x25')]=function(_0x4061b9,_0x1ca603){return respondWithRpcPromise(_0x922c('0x26'),_[_0x922c('0x1c')](_0x4061b9[_0x922c('0x19')],_0x4061b9[_0x922c('0x1a')]))[_0x922c('0x16')](respondWithResult(_0x1ca603,null))[_0x922c('0xc')](handleError(_0x1ca603,null));};exports[_0x922c('0x27')]=function(_0xa0630f,_0xe0ff5f){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x922c('0x1c')](_0xa0630f[_0x922c('0x19')],_0xa0630f[_0x922c('0x1a')]))[_0x922c('0x16')](respondWithResult(_0xe0ff5f,null))[_0x922c('0xc')](handleError(_0xe0ff5f,null));};exports[_0x922c('0x28')]=function(_0x241633,_0x1e0ed8){return respondWithRpcPromise('Outbound',_0x241633[_0x922c('0x19')])[_0x922c('0x16')](respondWithResult(_0x1e0ed8,null))['catch'](handleError(_0x1e0ed8,null));};exports['outboundChannels']=function(_0x274e5e,_0x39a623){return respondWithRpcPromise(_0x922c('0x29'),_0x274e5e[_0x922c('0x19')])[_0x922c('0x16')](respondWithResult(_0x39a623,null))[_0x922c('0xc')](handleError(_0x39a623,null));};exports['agents']=function(_0x187e9a,_0xfeec37){var _0x3f2065;return respondWithRpcPromise('Agents',_0x187e9a['query'])[_0x922c('0x16')](function(_0x58852b){_0x3f2065=_0x58852b;return respondWithRpcPromise(_0x922c('0x2a'),_0x187e9a[_0x922c('0x19')],routingClient);})[_0x922c('0x16')](function(_0x4c5cc3){return _[_0x922c('0x1c')]({},_0x4c5cc3,_0x3f2065);})[_0x922c('0x16')](respondWithResult(_0xfeec37,null))[_0x922c('0xc')](handleError(_0xfeec37,null));};exports[_0x922c('0x2b')]=function(_0x261b7a,_0x2f0410){if(_0x261b7a[_0x922c('0x2c')]&&_0x261b7a['body'][_0x922c('0x2d')]&&_0x261b7a[_0x922c('0x2e')]&&_0x261b7a['user'][_0x922c('0x10')]){for(var _0x36c6fc in _0x261b7a['body'][_0x922c('0x2d')]){if(_0x261b7a['body'][_0x922c('0x2d')]['hasOwnProperty'](_0x36c6fc)){db[_0x922c('0x2f')][_0x922c('0x30')]({'where':{'channel':_0x36c6fc,'membername':_0x261b7a[_0x922c('0x2e')][_0x922c('0x10')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x261b7a[_0x922c('0x2c')][_0x922c('0x2d')][_0x36c6fc]&&_0x261b7a[_0x922c('0x2c')][_0x922c('0x2d')][_0x36c6fc][_0x922c('0x31')]?{'$notIn':_0x261b7a[_0x922c('0x2c')]['interaction'][_0x36c6fc]}:{'$ne':null}}})[_0x922c('0x16')](function(_0x3162fd){var _0x52a076=moment()[_0x922c('0x32')](_0x922c('0x33'));for(var _0xc7f74b=0x0,_0x1ef140=_0x3162fd['length'];_0xc7f74b<_0x1ef140;_0xc7f74b+=0x1){_0x3162fd[_0xc7f74b][_0x922c('0x34')]({'exitAt':_0x52a076});}});for(var _0x1042c5=0x0;_0x1042c5<_0x261b7a[_0x922c('0x2c')][_0x922c('0x2d')][_0x36c6fc][_0x922c('0x31')];_0x1042c5+=0x1){db[_0x922c('0x2f')][_0x922c('0x35')]({'where':{'channel':_0x36c6fc,'membername':_0x261b7a[_0x922c('0x2e')][_0x922c('0x10')],'type':_0x922c('0x36'),'uniqueid':_0x261b7a[_0x922c('0x2c')][_0x922c('0x2d')][_0x36c6fc][_0x1042c5],'exitAt':null},'defaults':{'channel':_0x36c6fc,'membername':_0x261b7a['user'][_0x922c('0x10')],'interface':_0x922c('0x37')+_0x261b7a['user'][_0x922c('0x10')],'type':_0x922c('0x36'),'enterAt':moment()[_0x922c('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x922c('0x38'),'internal':_0x261b7a['user'][_0x922c('0x39')],'uniqueid':_0x261b7a['body']['interaction'][_0x36c6fc][_0x1042c5]}});}}}}return respondWithRpcPromise(_0x922c('0x3a'),{'id':_0x261b7a[_0x922c('0x1a')]['id'],'capacity':_0x261b7a[_0x922c('0x2c')]['capacity']},routingClient)[_0x922c('0x16')](respondWithResult(_0x2f0410,null))[_0x922c('0xc')](handleError(_0x2f0410,null));};exports[_0x922c('0x3b')]=function(_0x5ad13d,_0x1bbab6){return respondWithRpcPromise(_0x922c('0x3c'),_0x5ad13d[_0x922c('0x19')])['then'](respondWithResult(_0x1bbab6,null))[_0x922c('0xc')](handleError(_0x1bbab6,null));};exports[_0x922c('0x3d')]=function(_0x3376c1,_0x57a055){return respondWithRpcPromise(_0x922c('0x3e'),_0x3376c1[_0x922c('0x19')])[_0x922c('0x16')](respondWithResult(_0x57a055,null))[_0x922c('0xc')](handleError(_0x57a055,null));};exports[_0x922c('0x3f')]=function(_0x560d4e,_0x1dad15){return respondWithRpcPromise('Campaigns',_0x560d4e[_0x922c('0x19')])[_0x922c('0x16')](respondWithResult(_0x1dad15,null))[_0x922c('0xc')](handleError(_0x1dad15,null));};exports[_0x922c('0x40')]=function(_0x15c608,_0x1af388){return respondWithRpcPromise('ChatQueues',_0x15c608[_0x922c('0x19')],routingClient)[_0x922c('0x16')](respondWithResult(_0x1af388,null))[_0x922c('0xc')](handleError(_0x1af388,null));};exports[_0x922c('0x41')]=function(_0x3521cf,_0x483aeb){return respondWithRpcPromise('ChatQueues',_0x3521cf[_0x922c('0x19')],routingClient)[_0x922c('0x16')](findById(_0x3521cf[_0x922c('0x1a')]['id']))['then'](respondWithResult(_0x483aeb,null))[_0x922c('0xc')](handleError(_0x483aeb,null));};exports[_0x922c('0x42')]=function(_0x472526,_0x316489){return respondWithRpcPromise('MailQueues',_0x472526[_0x922c('0x19')],routingClient)['then'](respondWithResult(_0x316489,null))[_0x922c('0xc')](handleError(_0x316489,null));};exports[_0x922c('0x43')]=function(_0x33a770,_0x524ed2){return respondWithRpcPromise('MailQueues',_0x33a770[_0x922c('0x19')],routingClient)[_0x922c('0x16')](findById(_0x33a770[_0x922c('0x1a')]['id']))[_0x922c('0x16')](respondWithResult(_0x524ed2,null))['catch'](handleError(_0x524ed2,null));};exports[_0x922c('0x44')]=function(_0x2d2344,_0x15fe3e){return respondWithRpcPromise(_0x922c('0x45'),_0x2d2344['query'],mailClient)[_0x922c('0x16')](respondWithResult(_0x15fe3e,null))[_0x922c('0xc')](handleError(_0x15fe3e,null));};exports[_0x922c('0x46')]=function(_0x56def5,_0x97b3ea){return respondWithRpcPromise('OpenchannelQueues',_0x56def5[_0x922c('0x19')],routingClient)[_0x922c('0x16')](respondWithResult(_0x97b3ea,null))[_0x922c('0xc')](handleError(_0x97b3ea,null));};exports['showOpenchannelQueues']=function(_0x40f98b,_0x3e94d4){return respondWithRpcPromise('OpenchannelQueues',_0x40f98b['query'],routingClient)[_0x922c('0x16')](findById(_0x40f98b[_0x922c('0x1a')]['id']))[_0x922c('0x16')](respondWithResult(_0x3e94d4,null))[_0x922c('0xc')](handleError(_0x3e94d4,null));};exports[_0x922c('0x47')]=function(_0x2c9f45,_0x3d3674){return respondWithRpcPromise('SmsQueues',_0x2c9f45[_0x922c('0x19')],routingClient)[_0x922c('0x16')](respondWithResult(_0x3d3674,null))['catch'](handleError(_0x3d3674,null));};exports[_0x922c('0x48')]=function(_0x4c1afe,_0x58bd0e){return respondWithRpcPromise(_0x922c('0x49'),_0x4c1afe[_0x922c('0x19')],routingClient)['then'](findById(_0x4c1afe[_0x922c('0x1a')]['id']))[_0x922c('0x16')](respondWithResult(_0x58bd0e,null))[_0x922c('0xc')](handleError(_0x58bd0e,null));};exports[_0x922c('0x4a')]=function(_0x4f5898,_0x34f67f){return respondWithRpcPromise(_0x922c('0x4b'),_0x4f5898[_0x922c('0x19')],routingClient)[_0x922c('0x16')](respondWithResult(_0x34f67f,null))[_0x922c('0xc')](handleError(_0x34f67f,null));};exports[_0x922c('0x4c')]=function(_0x4386d1,_0x20b906){return respondWithRpcPromise(_0x922c('0x4b'),_0x4386d1[_0x922c('0x19')],routingClient)[_0x922c('0x16')](findById(_0x4386d1[_0x922c('0x1a')]['id']))['then'](respondWithResult(_0x20b906,null))[_0x922c('0xc')](handleError(_0x20b906,null));};exports['faxAccounts']=function(_0xf0ed39,_0x263a29){return respondWithRpcPromise('FaxAccounts',_0xf0ed39[_0x922c('0x19')])[_0x922c('0x16')](respondWithResult(_0x263a29,null))['catch'](handleError(_0x263a29,null));};exports['chatQueuesWaitingInteractions']=function(_0x50e87e,_0x128414){return respondWithRpcPromise(_0x922c('0x4d'),_0x50e87e['query'],routingClient)['then'](respondWithResult(_0x128414,null))[_0x922c('0xc')](handleError(_0x128414,null));};exports[_0x922c('0x4e')]=function(_0x5294c2,_0x27c7d8){return respondWithRpcPromise(_0x922c('0x4f'),_0x5294c2[_0x922c('0x19')],routingClient)['then'](respondWithResult(_0x27c7d8,null))[_0x922c('0xc')](handleError(_0x27c7d8,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x433f6d,_0x22ac00){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x433f6d[_0x922c('0x19')],routingClient)[_0x922c('0x16')](respondWithResult(_0x22ac00,null))[_0x922c('0xc')](handleError(_0x22ac00,null));};exports[_0x922c('0x50')]=function(_0x58172e,_0x42facf){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x58172e[_0x922c('0x19')],routingClient)[_0x922c('0x16')](respondWithResult(_0x42facf,null))[_0x922c('0xc')](handleError(_0x42facf,null));};exports[_0x922c('0x51')]=function(_0x235bd8,_0x10b850){return respondWithRpcPromise(_0x922c('0x52'),_0x235bd8[_0x922c('0x19')],routingClient)[_0x922c('0x16')](respondWithResult(_0x10b850,null))[_0x922c('0xc')](handleError(_0x10b850,null));};exports[_0x922c('0x53')]=function(_0x3ea9db){return function(_0x206bb9,_0x2419e4){var _0x15b953,_0x16c218;var _0x17e947=_['capitalize'](_0x3ea9db);var _0x4982d8=_0x3ea9db===_0x922c('0x54')?_0x922c('0x55'):_0x922c('0x56');return db[_0x17e947+'Queue'][_0x922c('0x57')]({'raw':!![],'where':{'id':_0x206bb9[_0x922c('0x1a')]['id']}})[_0x922c('0x16')](function(_0x468263){if(_[_0x922c('0x12')](_0x468263)){throw new Error(_0x17e947+_0x922c('0x58'));}_0x15b953=_0x468263;return db[_0x17e947+_0x922c('0x59')][_0x922c('0x57')]({'where':{'id':_0x206bb9[_0x922c('0x2c')]['messageId']},'include':[{'model':db[_0x17e947+'Interaction'],'as':_0x922c('0x5a')},{'model':db[_0x17e947+_0x4982d8],'as':_0x922c('0x56')}]});})[_0x922c('0x16')](function(_0x24b502){if(_[_0x922c('0x12')](_0x24b502)){throw new Error(_0x17e947+'\x20Message\x20not\x20found');}_0x16c218=_0x24b502;return _0x24b502[_0x922c('0x5b')]({'read':0x0,'readAt':null,'UserId':null});})[_0x922c('0x16')](function(){var _0x284cf1={'uniqueid':_0x3ea9db+'.'+_0x16c218['id']+'.'+_0x16c218[_0x922c('0x5a')]['id'],'FromUserId':_0x206bb9[_0x922c('0x2e')]['id'],'type':_0x922c('0x5c')};_0x284cf1[_0x17e947+_0x922c('0x5d')]=_0x16c218['id'];_0x284cf1[_0x17e947+'InteractionId']=_0x16c218[_0x922c('0x5a')]['id'];_0x284cf1[_0x922c('0x5e')+_0x17e947+_0x4982d8+'Id']=_0x16c218[_0x922c('0x56')]['id'];_0x284cf1['To'+_0x17e947+_0x922c('0x5f')]=_0x15b953['id'];return db[_0x17e947+'TransferReport'][_0x922c('0x60')](_0x284cf1);})['then'](function(){return respondWithRpcPromise(_0x922c('0x61'),{'channel':_0x3ea9db,'interaction':_0x16c218[_0x922c('0x5a')],'message':_0x16c218,'account':_0x16c218[_0x922c('0x56')],'applications':[{'id':0x0,'priority':0x1,'app':_0x922c('0x5c'),'appdata':_0x15b953['name']+','+(_0x16c218[_0x922c('0x56')]['queueTransferTimeout']||0x12c),'interval':_0x922c('0x62')}]},routingClient);})[_0x922c('0x16')](respondWithResult(_0x2419e4,null))['catch'](handleError(_0x2419e4,null));};};exports[_0x922c('0x63')]=function(_0x5b5312,_0x535b87){var _0x18b8e5,_0x1c05f1;if(_[_0x922c('0x12')](_0x5b5312[_0x922c('0x2c')][_0x922c('0x64')])){throw new Error(_0x922c('0x65'));}var _0x50100f=_0x5b5312['body'][_0x922c('0x64')];var _0x1702e7=_[_0x922c('0x66')](_0x50100f);var _0x54579f=_0x50100f===_0x922c('0x54')?_0x922c('0x55'):_0x922c('0x56');return db[_0x922c('0x67')]['findOne']({'raw':!![],'where':{'id':_0x5b5312[_0x922c('0x1a')]['id'],'role':_0x922c('0x38')}})[_0x922c('0x16')](function(_0x222239){if(_[_0x922c('0x12')](_0x222239)){throw new Error(_0x922c('0x68'));}_0x18b8e5=_0x222239;return db[_0x1702e7+'Message'][_0x922c('0x57')]({'where':{'id':_0x5b5312[_0x922c('0x2c')][_0x922c('0x69')]},'include':[{'model':db[_0x1702e7+_0x922c('0x5a')],'as':_0x922c('0x5a')},{'model':db[_0x1702e7+_0x54579f],'as':'Account'}]});})[_0x922c('0x16')](function(_0x537dea){if(_[_0x922c('0x12')](_0x537dea)){throw new Error(_0x1702e7+'\x20Message\x20not\x20found');}_0x1c05f1=_0x537dea;return _0x537dea['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3fc99d={'uniqueid':_0x50100f+'.'+_0x1c05f1['id']+'.'+_0x1c05f1[_0x922c('0x5a')]['id'],'FromUserId':_0x5b5312[_0x922c('0x2e')]['id'],'type':_0x922c('0x5c'),'ToUserId':_0x18b8e5['id']};_0x3fc99d[_0x1702e7+_0x922c('0x5d')]=_0x1c05f1['id'];_0x3fc99d[_0x1702e7+_0x922c('0x6a')]=_0x1c05f1['Interaction']['id'];_0x3fc99d['From'+_0x1702e7+_0x54579f+'Id']=_0x1c05f1['Account']['id'];return db[_0x1702e7+'TransferReport'][_0x922c('0x60')](_0x3fc99d);})[_0x922c('0x16')](function(){return respondWithRpcPromise(_0x922c('0x61'),{'channel':_0x50100f,'interaction':_0x1c05f1[_0x922c('0x5a')],'message':_0x1c05f1,'account':_0x1c05f1[_0x922c('0x56')],'applications':[{'id':0x0,'priority':0x1,'app':_0x922c('0x38'),'appdata':_0x18b8e5[_0x922c('0x10')]+','+(_0x1c05f1[_0x922c('0x56')][_0x922c('0x6b')]||0x12c),'interval':_0x922c('0x62')}]},routingClient);})[_0x922c('0x16')](respondWithResult(_0x535b87,null))[_0x922c('0xc')](handleError(_0x535b87,null));};
\ No newline at end of file
+var _0x203d=['faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','Account','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','create','queueTransferTimeout','*,*,*,*','Channel\x20field\x20is\x20mandatory','channel','capitalize','User','Agent\x20not\x20found','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','api','client','http','request','then','error','message','result','catch','status','sendStatus','name','isNil','rows','find','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','VoiceQueuesPreview','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','body','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport','format','agent','internal','AgentCapacity','capacity','telephones','Telephones','campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','showFaxQueues','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions'];(function(_0x8560d3,_0x26a504){var _0x33b1b5=function(_0x3a2cad){while(--_0x3a2cad){_0x8560d3['push'](_0x8560d3['shift']());}};_0x33b1b5(++_0x26a504);}(_0x203d,0x1c7));var _0xd203=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x203d[_0x22f8ab];return _0x2a70e5;};'use strict';var BPromise=require(_0xd203('0x0'));var moment=require(_0xd203('0x1'));var _=require(_0xd203('0x2'));var db=require(_0xd203('0x3'))['db'];var logger=require('../../config/logger')(_0xd203('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0xd203('0x5')][_0xd203('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0xd203('0x6')]({'port':0x232b});var routingClient=jayson[_0xd203('0x5')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4e57be,_0x586c6e,_0x19060e){return new BPromise(function(_0x4bd8ba,_0x38bc3b){var _0x380c89=_0x19060e?_0x19060e:amiClient;return _0x380c89[_0xd203('0x7')](_0x4e57be,_0x586c6e)[_0xd203('0x8')](function(_0x55710d){if(_0x55710d[_0xd203('0x9')]){if(_0x55710d[_0xd203('0x9')]['code']===0x1f4){return _0x38bc3b(_0x55710d[_0xd203('0x9')][_0xd203('0xa')]);}return _0x4bd8ba(_0x55710d[_0xd203('0x9')]['message']);}else{_0x4bd8ba(_0x55710d[_0xd203('0xb')]);}})[_0xd203('0xc')](function(_0x1fe76b){_0x38bc3b(_0x1fe76b);});});}function respondWithResult(_0x2b19b6,_0x93eaf5){_0x93eaf5=_0x93eaf5||0xc8;return function(_0x4b40e5){if(_0x4b40e5){return _0x2b19b6[_0xd203('0xd')](_0x93eaf5)['json'](_0x4b40e5);}return _0x2b19b6[_0xd203('0xe')](0x194);};}function handleError(_0xab013e,_0x3d5d8a){_0x3d5d8a=_0x3d5d8a||0x1f4;return function(_0x270eda){logger[_0xd203('0x9')](_0x270eda['stack']);if(_0x270eda['name']){delete _0x270eda[_0xd203('0xf')];}_0xab013e[_0xd203('0xd')](_0x3d5d8a)['send'](_0x270eda);};}function findById(_0x47e576){return function(_0x28fbde){if(!_[_0xd203('0x10')](_0x47e576)&&!_[_0xd203('0x10')](_0x28fbde)&&!_['isNil'](_0x28fbde[_0xd203('0x11')])){return _[_0xd203('0x12')](_0x28fbde['rows'],function(_0x42ce75){return _0x42ce75['id']==_0x47e576;});}return null;};}exports['voiceChannels']=function(_0x687e85,_0x24d857){return respondWithRpcPromise(_0xd203('0x13'),_0x687e85[_0xd203('0x14')])[_0xd203('0x8')](respondWithResult(_0x24d857,null))[_0xd203('0xc')](handleError(_0x24d857,null));};exports[_0xd203('0x15')]=function(_0x4840e4,_0x56cbd5){return respondWithRpcPromise(_0xd203('0x16'),_['merge'](_0x4840e4['query'],_0x4840e4[_0xd203('0x17')]))[_0xd203('0x8')](respondWithResult(_0x56cbd5,null))[_0xd203('0xc')](handleError(_0x56cbd5,null));};exports[_0xd203('0x18')]=function(_0x4c175d,_0x30e7b9){return respondWithRpcPromise(_0xd203('0x19'),_[_0xd203('0x1a')](_0x4c175d[_0xd203('0x14')],_0x4c175d[_0xd203('0x17')]))[_0xd203('0x8')](respondWithResult(_0x30e7b9,null))[_0xd203('0xc')](handleError(_0x30e7b9,null));};exports[_0xd203('0x1b')]=function(_0x5ec49f,_0x140343){return respondWithRpcPromise(_0xd203('0x1c'),_0x5ec49f[_0xd203('0x14')])['then'](respondWithResult(_0x140343,null))[_0xd203('0xc')](handleError(_0x140343,null));};exports[_0xd203('0x1d')]=function(_0x2edb7d,_0x4c9a14){return respondWithRpcPromise('VoiceQueues',_0x2edb7d[_0xd203('0x14')])[_0xd203('0x8')](findById(_0x2edb7d[_0xd203('0x17')]['id']))[_0xd203('0x8')](respondWithResult(_0x4c9a14,null))[_0xd203('0xc')](handleError(_0x4c9a14,null));};exports['voiceQueuesPreview']=function(_0x3498c2,_0x20e0ce){return respondWithRpcPromise(_0xd203('0x1e'),_['merge'](_0x3498c2[_0xd203('0x14')],_0x3498c2[_0xd203('0x17')]))[_0xd203('0x8')](respondWithResult(_0x20e0ce,null))['catch'](handleError(_0x20e0ce,null));};exports['voiceQueuesChannels']=function(_0x3d00ec,_0x3eb10b){return respondWithRpcPromise('VoiceQueuesChannels',_0x3d00ec[_0xd203('0x14')])['then'](respondWithResult(_0x3eb10b,null))[_0xd203('0xc')](handleError(_0x3eb10b,null));};exports[_0xd203('0x1f')]=function(_0x25d0f0,_0x444157){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xd203('0x1a')](_0x25d0f0[_0xd203('0x14')],_0x25d0f0[_0xd203('0x17')]))[_0xd203('0x8')](respondWithResult(_0x444157,null))[_0xd203('0xc')](handleError(_0x444157,null));};exports[_0xd203('0x20')]=function(_0x49b41a,_0x181507){return respondWithRpcPromise(_0xd203('0x21'),_[_0xd203('0x1a')](_0x49b41a['query'],_0x49b41a[_0xd203('0x17')]))['then'](respondWithResult(_0x181507,null))[_0xd203('0xc')](handleError(_0x181507,null));};exports[_0xd203('0x22')]=function(_0x3155df,_0x43557d){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_['merge'](_0x3155df[_0xd203('0x14')],_0x3155df[_0xd203('0x17')]))[_0xd203('0x8')](respondWithResult(_0x43557d,null))[_0xd203('0xc')](handleError(_0x43557d,null));};exports['outbound']=function(_0x3b4a09,_0xfd2c81){return respondWithRpcPromise(_0xd203('0x23'),_0x3b4a09[_0xd203('0x14')])[_0xd203('0x8')](respondWithResult(_0xfd2c81,null))[_0xd203('0xc')](handleError(_0xfd2c81,null));};exports[_0xd203('0x24')]=function(_0xa0d7a6,_0x5121eb){return respondWithRpcPromise(_0xd203('0x25'),_0xa0d7a6[_0xd203('0x14')])[_0xd203('0x8')](respondWithResult(_0x5121eb,null))['catch'](handleError(_0x5121eb,null));};exports['agents']=function(_0xdf6fa,_0x1eda81){var _0x59204d;return respondWithRpcPromise(_0xd203('0x26'),_0xdf6fa['query'])[_0xd203('0x8')](function(_0x1d3f5f){_0x59204d=_0x1d3f5f;return respondWithRpcPromise(_0xd203('0x26'),_0xdf6fa[_0xd203('0x14')],routingClient);})[_0xd203('0x8')](function(_0x125aca){return _[_0xd203('0x1a')]({},_0x125aca,_0x59204d);})['then'](respondWithResult(_0x1eda81,null))['catch'](handleError(_0x1eda81,null));};exports[_0xd203('0x27')]=function(_0x2be898,_0x53a410){if(_0x2be898['body']&&_0x2be898['body'][_0xd203('0x28')]&&_0x2be898['user']&&_0x2be898[_0xd203('0x29')][_0xd203('0xf')]){for(var _0x56eead in _0x2be898[_0xd203('0x2a')][_0xd203('0x28')]){if(_0x2be898['body'][_0xd203('0x28')]['hasOwnProperty'](_0x56eead)){db['MemberReport'][_0xd203('0x2b')]({'where':{'channel':_0x56eead,'membername':_0x2be898[_0xd203('0x29')][_0xd203('0xf')],'type':_0xd203('0x2c'),'exitAt':null,'uniqueid':_0x2be898[_0xd203('0x2a')][_0xd203('0x28')][_0x56eead]&&_0x2be898[_0xd203('0x2a')][_0xd203('0x28')][_0x56eead][_0xd203('0x2d')]?{'$notIn':_0x2be898['body'][_0xd203('0x28')][_0x56eead]}:{'$ne':null}}})['then'](function(_0xd29d80){var _0x5aceb8=moment()['format'](_0xd203('0x2e'));for(var _0x65abab=0x0,_0x4d354c=_0xd29d80[_0xd203('0x2d')];_0x65abab<_0x4d354c;_0x65abab+=0x1){_0xd29d80[_0x65abab][_0xd203('0x2f')]({'exitAt':_0x5aceb8});}});for(var _0x3693aa=0x0;_0x3693aa<_0x2be898[_0xd203('0x2a')][_0xd203('0x28')][_0x56eead][_0xd203('0x2d')];_0x3693aa+=0x1){db[_0xd203('0x30')]['findOrCreate']({'where':{'channel':_0x56eead,'membername':_0x2be898[_0xd203('0x29')]['name'],'type':_0xd203('0x2c'),'uniqueid':_0x2be898[_0xd203('0x2a')][_0xd203('0x28')][_0x56eead][_0x3693aa],'exitAt':null},'defaults':{'channel':_0x56eead,'membername':_0x2be898[_0xd203('0x29')][_0xd203('0xf')],'interface':'SIP/'+_0x2be898[_0xd203('0x29')]['name'],'type':'INTERACTION','enterAt':moment()[_0xd203('0x31')](_0xd203('0x2e')),'role':_0xd203('0x32'),'internal':_0x2be898[_0xd203('0x29')][_0xd203('0x33')],'uniqueid':_0x2be898[_0xd203('0x2a')][_0xd203('0x28')][_0x56eead][_0x3693aa]}});}}}}return respondWithRpcPromise(_0xd203('0x34'),{'id':_0x2be898[_0xd203('0x17')]['id'],'capacity':_0x2be898[_0xd203('0x2a')][_0xd203('0x35')]},routingClient)[_0xd203('0x8')](respondWithResult(_0x53a410,null))[_0xd203('0xc')](handleError(_0x53a410,null));};exports[_0xd203('0x36')]=function(_0x2aed70,_0x33e965){return respondWithRpcPromise(_0xd203('0x37'),_0x2aed70[_0xd203('0x14')])[_0xd203('0x8')](respondWithResult(_0x33e965,null))[_0xd203('0xc')](handleError(_0x33e965,null));};exports['trunks']=function(_0x4adee8,_0x12d364){return respondWithRpcPromise('Trunks',_0x4adee8[_0xd203('0x14')])[_0xd203('0x8')](respondWithResult(_0x12d364,null))['catch'](handleError(_0x12d364,null));};exports[_0xd203('0x38')]=function(_0x558faa,_0x3c9e82){return respondWithRpcPromise('Campaigns',_0x558faa['query'])['then'](respondWithResult(_0x3c9e82,null))[_0xd203('0xc')](handleError(_0x3c9e82,null));};exports[_0xd203('0x39')]=function(_0x1a7dea,_0x25c494){return respondWithRpcPromise(_0xd203('0x3a'),_0x1a7dea[_0xd203('0x14')],routingClient)['then'](respondWithResult(_0x25c494,null))['catch'](handleError(_0x25c494,null));};exports[_0xd203('0x3b')]=function(_0x4627c0,_0x443e84){return respondWithRpcPromise(_0xd203('0x3a'),_0x4627c0[_0xd203('0x14')],routingClient)[_0xd203('0x8')](findById(_0x4627c0[_0xd203('0x17')]['id']))['then'](respondWithResult(_0x443e84,null))[_0xd203('0xc')](handleError(_0x443e84,null));};exports[_0xd203('0x3c')]=function(_0x41bb3b,_0x142b08){return respondWithRpcPromise(_0xd203('0x3d'),_0x41bb3b[_0xd203('0x14')],routingClient)['then'](respondWithResult(_0x142b08,null))['catch'](handleError(_0x142b08,null));};exports[_0xd203('0x3e')]=function(_0x4d7a8f,_0x14fe78){return respondWithRpcPromise(_0xd203('0x3d'),_0x4d7a8f[_0xd203('0x14')],routingClient)[_0xd203('0x8')](findById(_0x4d7a8f[_0xd203('0x17')]['id']))['then'](respondWithResult(_0x14fe78,null))[_0xd203('0xc')](handleError(_0x14fe78,null));};exports[_0xd203('0x3f')]=function(_0x1032fb,_0x734c49){return respondWithRpcPromise('MailAccounts',_0x1032fb['query'],mailClient)['then'](respondWithResult(_0x734c49,null))['catch'](handleError(_0x734c49,null));};exports[_0xd203('0x40')]=function(_0x319e04,_0x4828f9){return respondWithRpcPromise(_0xd203('0x41'),_0x319e04[_0xd203('0x14')],routingClient)['then'](respondWithResult(_0x4828f9,null))[_0xd203('0xc')](handleError(_0x4828f9,null));};exports['showOpenchannelQueues']=function(_0x32d3e9,_0xe3ff55){return respondWithRpcPromise(_0xd203('0x41'),_0x32d3e9[_0xd203('0x14')],routingClient)['then'](findById(_0x32d3e9[_0xd203('0x17')]['id']))['then'](respondWithResult(_0xe3ff55,null))[_0xd203('0xc')](handleError(_0xe3ff55,null));};exports[_0xd203('0x42')]=function(_0x4dd47d,_0x22aa0a){return respondWithRpcPromise(_0xd203('0x43'),_0x4dd47d[_0xd203('0x14')],routingClient)[_0xd203('0x8')](respondWithResult(_0x22aa0a,null))[_0xd203('0xc')](handleError(_0x22aa0a,null));};exports[_0xd203('0x44')]=function(_0x3c14e3,_0x238d83){return respondWithRpcPromise(_0xd203('0x43'),_0x3c14e3[_0xd203('0x14')],routingClient)['then'](findById(_0x3c14e3[_0xd203('0x17')]['id']))['then'](respondWithResult(_0x238d83,null))[_0xd203('0xc')](handleError(_0x238d83,null));};exports[_0xd203('0x45')]=function(_0x186355,_0x5df225){return respondWithRpcPromise(_0xd203('0x46'),_0x186355[_0xd203('0x14')],routingClient)['then'](respondWithResult(_0x5df225,null))[_0xd203('0xc')](handleError(_0x5df225,null));};exports[_0xd203('0x47')]=function(_0x414123,_0x2e8baf){return respondWithRpcPromise('FaxQueues',_0x414123['query'],routingClient)[_0xd203('0x8')](findById(_0x414123[_0xd203('0x17')]['id']))[_0xd203('0x8')](respondWithResult(_0x2e8baf,null))[_0xd203('0xc')](handleError(_0x2e8baf,null));};exports['faxAccounts']=function(_0x59319b,_0x58d60c){return respondWithRpcPromise('FaxAccounts',_0x59319b['query'])[_0xd203('0x8')](respondWithResult(_0x58d60c,null))[_0xd203('0xc')](handleError(_0x58d60c,null));};exports[_0xd203('0x48')]=function(_0x418950,_0x155e8b){return respondWithRpcPromise(_0xd203('0x49'),_0x418950[_0xd203('0x14')],routingClient)[_0xd203('0x8')](respondWithResult(_0x155e8b,null))[_0xd203('0xc')](handleError(_0x155e8b,null));};exports[_0xd203('0x4a')]=function(_0x2a7a49,_0xc2466e){return respondWithRpcPromise(_0xd203('0x4b'),_0x2a7a49[_0xd203('0x14')],routingClient)[_0xd203('0x8')](respondWithResult(_0xc2466e,null))['catch'](handleError(_0xc2466e,null));};exports[_0xd203('0x4c')]=function(_0x5a6508,_0x143863){return respondWithRpcPromise(_0xd203('0x4d'),_0x5a6508[_0xd203('0x14')],routingClient)[_0xd203('0x8')](respondWithResult(_0x143863,null))[_0xd203('0xc')](handleError(_0x143863,null));};exports[_0xd203('0x4e')]=function(_0xdd2c7b,_0x3c85b1){return respondWithRpcPromise(_0xd203('0x4f'),_0xdd2c7b[_0xd203('0x14')],routingClient)[_0xd203('0x8')](respondWithResult(_0x3c85b1,null))[_0xd203('0xc')](handleError(_0x3c85b1,null));};exports[_0xd203('0x50')]=function(_0xe4bdd1,_0x354768){return respondWithRpcPromise(_0xd203('0x51'),_0xe4bdd1[_0xd203('0x14')],routingClient)[_0xd203('0x8')](respondWithResult(_0x354768,null))[_0xd203('0xc')](handleError(_0x354768,null));};exports[_0xd203('0x52')]=function(_0x2f80a4){return function(_0x141009,_0x546723){var _0x49d4dd,_0x177180;var _0xc75c66=_['capitalize'](_0x2f80a4);var _0x2bf055=_0x2f80a4===_0xd203('0x53')?_0xd203('0x54'):_0xd203('0x55');return db[_0xc75c66+'Queue'][_0xd203('0x56')]({'raw':!![],'where':{'id':_0x141009[_0xd203('0x17')]['id']}})[_0xd203('0x8')](function(_0x48648e){if(_['isNil'](_0x48648e)){throw new Error(_0xc75c66+_0xd203('0x57'));}_0x49d4dd=_0x48648e;return db[_0xc75c66+'Message'][_0xd203('0x56')]({'where':{'id':_0x141009[_0xd203('0x2a')][_0xd203('0x58')]},'include':[{'model':db[_0xc75c66+_0xd203('0x59')],'as':_0xd203('0x59')},{'model':db[_0xc75c66+_0x2bf055],'as':_0xd203('0x55')}]});})[_0xd203('0x8')](function(_0x2e8b3c){if(_[_0xd203('0x10')](_0x2e8b3c)){throw new Error(_0xc75c66+_0xd203('0x5a'));}_0x177180=_0x2e8b3c;return _0x2e8b3c[_0xd203('0x5b')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd203('0x8')](function(){var _0x1d6d68={'uniqueid':_0x2f80a4+'.'+_0x177180['id']+'.'+_0x177180[_0xd203('0x59')]['id'],'FromUserId':_0x141009['user']['id'],'type':_0xd203('0x5c')};_0x1d6d68[_0xc75c66+_0xd203('0x5d')]=_0x177180['id'];_0x1d6d68[_0xc75c66+_0xd203('0x5e')]=_0x177180['Interaction']['id'];_0x1d6d68[_0xd203('0x5f')+_0xc75c66+_0x2bf055+'Id']=_0x177180['Account']['id'];_0x1d6d68['To'+_0xc75c66+_0xd203('0x60')]=_0x49d4dd['id'];return db[_0xc75c66+'TransferReport'][_0xd203('0x61')](_0x1d6d68);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x2f80a4,'interaction':_0x177180['Interaction'],'message':_0x177180,'account':_0x177180[_0xd203('0x55')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x49d4dd[_0xd203('0xf')]+','+(_0x177180[_0xd203('0x55')][_0xd203('0x62')]||0x12c),'interval':_0xd203('0x63')}]},routingClient);})[_0xd203('0x8')](respondWithResult(_0x546723,null))[_0xd203('0xc')](handleError(_0x546723,null));};};exports['agentNotify']=function(_0x37d34e,_0x1420a6){var _0x34f15a,_0x2fad16;if(_['isNil'](_0x37d34e[_0xd203('0x2a')]['channel'])){throw new Error(_0xd203('0x64'));}var _0x3e2bba=_0x37d34e[_0xd203('0x2a')][_0xd203('0x65')];var _0xebb61e=_[_0xd203('0x66')](_0x3e2bba);var _0x1e59e0=_0x3e2bba===_0xd203('0x53')?_0xd203('0x54'):_0xd203('0x55');return db[_0xd203('0x67')][_0xd203('0x56')]({'raw':!![],'where':{'id':_0x37d34e['params']['id'],'role':'agent'}})[_0xd203('0x8')](function(_0x43dd2d){if(_['isNil'](_0x43dd2d)){throw new Error(_0xd203('0x68'));}_0x34f15a=_0x43dd2d;return db[_0xebb61e+'Message'][_0xd203('0x56')]({'where':{'id':_0x37d34e[_0xd203('0x2a')][_0xd203('0x58')]},'include':[{'model':db[_0xebb61e+_0xd203('0x59')],'as':'Interaction'},{'model':db[_0xebb61e+_0x1e59e0],'as':_0xd203('0x55')}]});})[_0xd203('0x8')](function(_0x1d8143){if(_[_0xd203('0x10')](_0x1d8143)){throw new Error(_0xebb61e+_0xd203('0x5a'));}_0x2fad16=_0x1d8143;return _0x1d8143[_0xd203('0x5b')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd203('0x8')](function(){var _0x491115={'uniqueid':_0x3e2bba+'.'+_0x2fad16['id']+'.'+_0x2fad16[_0xd203('0x59')]['id'],'FromUserId':_0x37d34e['user']['id'],'type':_0xd203('0x5c'),'ToUserId':_0x34f15a['id']};_0x491115[_0xebb61e+_0xd203('0x5d')]=_0x2fad16['id'];_0x491115[_0xebb61e+_0xd203('0x5e')]=_0x2fad16[_0xd203('0x59')]['id'];_0x491115[_0xd203('0x5f')+_0xebb61e+_0x1e59e0+'Id']=_0x2fad16[_0xd203('0x55')]['id'];return db[_0xebb61e+'TransferReport'][_0xd203('0x61')](_0x491115);})[_0xd203('0x8')](function(){return respondWithRpcPromise(_0xd203('0x69'),{'channel':_0x3e2bba,'interaction':_0x2fad16['Interaction'],'message':_0x2fad16,'account':_0x2fad16['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xd203('0x32'),'appdata':_0x34f15a[_0xd203('0xf')]+','+(_0x2fad16[_0xd203('0x55')][_0xd203('0x6a')]||0x12c),'interval':_0xd203('0x63')}]},routingClient);})['then'](respondWithResult(_0x1420a6,null))[_0xd203('0xc')](handleError(_0x1420a6,null));};
\ No newline at end of file
index 91ae28a..6e8e10e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d74=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id/run','post','create','/:id','destroy','exports','multer','util','path','express'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7d74,0x1e2));var _0x47d7=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x7d74[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x47d7('0x0'));var util=require(_0x47d7('0x1'));var path=require(_0x47d7('0x2'));var express=require(_0x47d7('0x3'));var router=express[_0x47d7('0x4')]();var auth=require(_0x47d7('0x5'));var interaction=require(_0x47d7('0x6'));var config=require(_0x47d7('0x7'));var controller=require(_0x47d7('0x8'));router['get']('/',auth[_0x47d7('0x9')](),controller[_0x47d7('0xa')]);router[_0x47d7('0xb')]('/:id',auth[_0x47d7('0x9')](),controller['show']);router[_0x47d7('0xb')](_0x47d7('0xc'),auth[_0x47d7('0x9')](),controller['run']);router[_0x47d7('0xd')]('/',auth['isAuthenticated'](),controller[_0x47d7('0xe')]);router['put'](_0x47d7('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x47d7('0xf'),auth[_0x47d7('0x9')](),controller[_0x47d7('0x10')]);module[_0x47d7('0x11')]=router;
\ No newline at end of file
+var _0x05d0=['isAuthenticated','index','show','/:id/run','post','put','/:id','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x05d0,0x101));var _0x005d=function(_0x17a750,_0x8b9552){_0x17a750=_0x17a750-0x0;var _0x307b72=_0x05d0[_0x17a750];return _0x307b72;};'use strict';var multer=require(_0x005d('0x0'));var util=require(_0x005d('0x1'));var path=require(_0x005d('0x2'));var express=require(_0x005d('0x3'));var router=express[_0x005d('0x4')]();var auth=require(_0x005d('0x5'));var interaction=require(_0x005d('0x6'));var config=require(_0x005d('0x7'));var controller=require(_0x005d('0x8'));router['get']('/',auth[_0x005d('0x9')](),controller[_0x005d('0xa')]);router['get']('/:id',auth[_0x005d('0x9')](),controller[_0x005d('0xb')]);router['get'](_0x005d('0xc'),auth['isAuthenticated'](),controller['run']);router[_0x005d('0xd')]('/',auth[_0x005d('0x9')](),controller['create']);router[_0x005d('0xe')](_0x005d('0xf'),auth[_0x005d('0x9')](),controller[_0x005d('0x10')]);router[_0x005d('0x11')](_0x005d('0xf'),auth[_0x005d('0x9')](),controller['destroy']);module[_0x005d('0x12')]=router;
\ No newline at end of file
index 1b73a70..e0eaaa6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8919=['ENUM','years','quarters','months','weeks','days','hours','minutes','pdf','xlsx','custom','BOOLEAN','TEXT','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER'];(function(_0x356e8d,_0x24c719){var _0x39e65a=function(_0x27ecc2){while(--_0x27ecc2){_0x356e8d['push'](_0x356e8d['shift']());}};_0x39e65a(++_0x24c719);}(_0x8919,0x13f));var _0x9891=function(_0xf46a96,_0xc6539){_0xf46a96=_0xf46a96-0x0;var _0x464aad=_0x8919[_0xf46a96];return _0x464aad;};'use strict';var Sequelize=require('sequelize');module[_0x9891('0x0')]={'name':{'type':Sequelize[_0x9891('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9891('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x9891('0x1')],'allowNull':![],'defaultValue':_0x9891('0x2')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x9891('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x9891('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x9891('0x5')](_0x9891('0x6'),_0x9891('0x7'),_0x9891('0x8'),_0x9891('0x9'),_0x9891('0xa'),_0x9891('0xb'),_0x9891('0xc')),'allowNull':![],'defaultValue':_0x9891('0xa')},'output':{'type':Sequelize[_0x9891('0x5')]('csv',_0x9891('0xd'),_0x9891('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x9891('0x5')](_0x9891('0xf'),'default'),'allowNull':![],'defaultValue':_0x9891('0xf')},'sendMail':{'type':Sequelize[_0x9891('0x10')],'defaultValue':![]},'email':{'type':Sequelize[_0x9891('0x1')]},'cc':{'type':Sequelize[_0x9891('0x11')]},'bcc':{'type':Sequelize[_0x9891('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x9891('0x10')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xae26=['csv','pdf','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters','weeks','minutes'];(function(_0x3e567e,_0x1a1ebe){var _0x26d746=function(_0x457304){while(--_0x457304){_0x3e567e['push'](_0x3e567e['shift']());}};_0x26d746(++_0x1a1ebe);}(_0xae26,0xe5));var _0x6ae2=function(_0x4da7f8,_0x5d836d){_0x4da7f8=_0x4da7f8-0x0;var _0x4968d0=_0xae26[_0x4da7f8];return _0x4968d0;};'use strict';var Sequelize=require(_0x6ae2('0x0'));module[_0x6ae2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6ae2('0x2')]},'active':{'type':Sequelize[_0x6ae2('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x6ae2('0x2')],'allowNull':![],'defaultValue':_0x6ae2('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x6ae2('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x6ae2('0x6')](_0x6ae2('0x7'),_0x6ae2('0x8'),'months',_0x6ae2('0x9'),'days','hours',_0x6ae2('0xa')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0x6ae2('0xb'),_0x6ae2('0xc'),'xlsx'),'allowNull':![],'defaultValue':_0x6ae2('0xb')},'type':{'type':Sequelize['ENUM'](_0x6ae2('0xd'),_0x6ae2('0xe')),'allowNull':![],'defaultValue':_0x6ae2('0xd')},'sendMail':{'type':Sequelize[_0x6ae2('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x6ae2('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x6ae2('0xf')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 275ce64..00cfca0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x380e=['intersection','attributes','fields','nolimit','limit','order','sort','where','pick','add','day','merge','filter','options','includeAll','findAll','show','rawAttributes','body','catch','update','find','params','run','../../config/schedule','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','set','Content-Range','json','apply','reject','save','destroy','then','name','send','index','Schedule','model','keys','query','dateEnd','dateStart','filters'];(function(_0x4ef834,_0x518a4a){var _0x2024eb=function(_0xb36561){while(--_0xb36561){_0x4ef834['push'](_0x4ef834['shift']());}};_0x2024eb(++_0x518a4a);}(_0x380e,0x1bd));var _0xe380=function(_0x4a79a4,_0x70add8){_0x4a79a4=_0x4a79a4-0x0;var _0x4f70f5=_0x380e[_0x4a79a4];return _0x4f70f5;};'use strict';var pdf=require(_0xe380('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe380('0x1'));var zipdir=require(_0xe380('0x2'));var jsonpatch=require(_0xe380('0x3'));var rp=require(_0xe380('0x4'));var moment=require(_0xe380('0x5'));var BPromise=require(_0xe380('0x6'));var Mustache=require(_0xe380('0x7'));var util=require(_0xe380('0x8'));var path=require(_0xe380('0x9'));var sox=require(_0xe380('0xa'));var csv=require(_0xe380('0xb'));var ejs=require(_0xe380('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe380('0xd'));var crypto=require('crypto');var jsforce=require(_0xe380('0xe'));var deskjs=require(_0xe380('0xf'));var toCsv=require(_0xe380('0xb'));var querystring=require(_0xe380('0x10'));var Papa=require('papaparse');var qs=require(_0xe380('0x11'));var logger=require(_0xe380('0x12'))('api');var utils=require(_0xe380('0x13'));var config=require(_0xe380('0x14'));var db=require(_0xe380('0x15'))['db'];function respondWithStatusCode(_0x6cfc9f,_0x282491){_0x282491=_0x282491||0xcc;return function(_0x52a9c1){if(_0x52a9c1){return _0x6cfc9f[_0xe380('0x16')](_0x282491);}return _0x6cfc9f['status'](_0x282491)[_0xe380('0x17')]();};}function respondWithResult(_0x3f265f,_0x2249bb){_0x2249bb=_0x2249bb||0xc8;return function(_0x2d66e4){if(_0x2d66e4){return _0x3f265f[_0xe380('0x18')](_0x2249bb)['json'](_0x2d66e4);}};}function respondWithFilteredResult(_0x4c7f15,_0x931df9){return function(_0x11bdbe){if(_0x11bdbe){var _0x23e61a=_0x11bdbe[_0xe380('0x19')],_0x1ae505=_0x931df9[_0xe380('0x1a')],_0x34a4d8=_0x931df9[_0xe380('0x1a')]+_0x931df9['limit'],_0x573772;if(_0x34a4d8>=_0x23e61a){_0x34a4d8=_0x23e61a;_0x573772=0xc8;}else{_0x573772=0xce;}_0x4c7f15[_0xe380('0x18')](_0x573772);return _0x4c7f15[_0xe380('0x1b')](_0xe380('0x1c'),_0x1ae505+'-'+_0x34a4d8+'/'+_0x23e61a)[_0xe380('0x1d')](_0x11bdbe);}return null;};}function patchUpdates(_0x55df98){return function(_0x4dffb6){try{jsonpatch[_0xe380('0x1e')](_0x4dffb6,_0x55df98,!![]);}catch(_0x24a8d2){return BPromise[_0xe380('0x1f')](_0x24a8d2);}return _0x4dffb6[_0xe380('0x20')]();};}function saveUpdates(_0x4d0989,_0x555f1e){return function(_0x326fc1){if(_0x326fc1){return _0x326fc1['update'](_0x4d0989)['then'](function(_0x1e593d){return _0x1e593d;});}return null;};}function removeEntity(_0x13138b,_0x35f374){return function(_0xac81a2){if(_0xac81a2){return _0xac81a2[_0xe380('0x21')]()[_0xe380('0x22')](function(){_0x13138b[_0xe380('0x18')](0xcc)[_0xe380('0x17')]();});}};}function handleEntityNotFound(_0xd4e991,_0x3086e5){return function(_0x2d4890){if(!_0x2d4890){_0xd4e991[_0xe380('0x16')](0x194);}return _0x2d4890;};}function handleError(_0x8967f9,_0x3a5922){_0x3a5922=_0x3a5922||0x1f4;return function(_0x22a1d2){logger['error'](_0x22a1d2['stack']);if(_0x22a1d2[_0xe380('0x23')]){delete _0x22a1d2['name'];}_0x8967f9['status'](_0x3a5922)[_0xe380('0x24')](_0x22a1d2);};}exports[_0xe380('0x25')]=function(_0x5420e5,_0x5bd114){var _0x367d7a={},_0x4c7841={},_0x26d21c={'count':0x0,'rows':[]};var _0x19988f=db[_0xe380('0x26')]['rawAttributes'];_0x4c7841[_0xe380('0x27')]=_[_0xe380('0x28')](_0x19988f);var _0x1685d0={'dateStart':_0x5420e5[_0xe380('0x29')]['dateStart'],'dateEnd':_0x5420e5[_0xe380('0x29')][_0xe380('0x2a')]};delete _0x5420e5[_0xe380('0x29')][_0xe380('0x2b')];delete _0x5420e5[_0xe380('0x29')][_0xe380('0x2a')];_0x4c7841[_0xe380('0x29')]=_[_0xe380('0x28')](_0x5420e5[_0xe380('0x29')]);_0x4c7841[_0xe380('0x2c')]=_[_0xe380('0x2d')](_0x4c7841[_0xe380('0x27')],_0x4c7841['query']);_0x367d7a[_0xe380('0x2e')]=_[_0xe380('0x2d')](_0x4c7841[_0xe380('0x27')],qs[_0xe380('0x2f')](_0x5420e5[_0xe380('0x29')][_0xe380('0x2f')]));_0x367d7a['attributes']=_0x367d7a[_0xe380('0x2e')]['length']?_0x367d7a[_0xe380('0x2e')]:_0x4c7841[_0xe380('0x27')];if(!_0x5420e5[_0xe380('0x29')]['hasOwnProperty'](_0xe380('0x30'))){_0x367d7a[_0xe380('0x31')]=qs['limit'](_0x5420e5['query']['limit']);_0x367d7a['offset']=qs['offset'](_0x5420e5[_0xe380('0x29')][_0xe380('0x1a')]);}_0x367d7a[_0xe380('0x32')]=qs[_0xe380('0x33')](_0x5420e5['query'][_0xe380('0x33')]);_0x367d7a[_0xe380('0x34')]=qs[_0xe380('0x2c')](_[_0xe380('0x35')](_0x5420e5[_0xe380('0x29')],_0x4c7841[_0xe380('0x2c')]));if(_0x1685d0['dateStart']){if(_0x1685d0['dateEnd']){_0x1685d0[_0xe380('0x2a')]=moment(_0x1685d0[_0xe380('0x2a')])[_0xe380('0x36')](0x1,_0xe380('0x37'));}else{_0x1685d0[_0xe380('0x2a')]=moment(_0x1685d0[_0xe380('0x2b')])[_0xe380('0x36')](0x1,_0xe380('0x37'));}_[_0xe380('0x38')](_0x367d7a[_0xe380('0x34')],{'createdAt':{'$gte':_0x1685d0[_0xe380('0x2b')],'$lte':_0x1685d0[_0xe380('0x2a')]}});}if(_0x5420e5[_0xe380('0x29')][_0xe380('0x39')]){_0x367d7a[_0xe380('0x34')]=_[_0xe380('0x38')](_0x367d7a['where'],{'$or':_['map'](_0x367d7a[_0xe380('0x2e')],function(_0x2c267f){var _0x274666={};_0x274666[_0x2c267f]={'$like':'%'+_0x5420e5[_0xe380('0x29')][_0xe380('0x39')]+'%'};return _0x274666;})});}_0x367d7a=_[_0xe380('0x38')]({},_0x367d7a,_0x5420e5[_0xe380('0x3a')]);var _0x327f4d={'where':_0x367d7a[_0xe380('0x34')]};return db[_0xe380('0x26')][_0xe380('0x19')](_0x327f4d)['then'](function(_0x4435d4){_0x26d21c[_0xe380('0x19')]=_0x4435d4;if(_0x5420e5['query'][_0xe380('0x3b')]){_0x367d7a['include']=[{'all':!![]}];}return db['Schedule'][_0xe380('0x3c')](_0x367d7a);})[_0xe380('0x22')](function(_0x4a2479){_0x26d21c['rows']=_0x4a2479;return _0x26d21c;})[_0xe380('0x22')](respondWithFilteredResult(_0x5bd114,_0x367d7a))['catch'](handleError(_0x5bd114,null));};exports[_0xe380('0x3d')]=function(_0x3c7f1d,_0x46f447){var _0x3ec830={'raw':![],'where':{'id':_0x3c7f1d['params']['id']}},_0x29665a={};_0x29665a['model']=_[_0xe380('0x28')](db[_0xe380('0x26')][_0xe380('0x3e')]);_0x29665a['query']=_[_0xe380('0x28')](_0x3c7f1d[_0xe380('0x29')]);_0x29665a[_0xe380('0x2c')]=_[_0xe380('0x2d')](_0x29665a[_0xe380('0x27')],_0x29665a[_0xe380('0x29')]);_0x3ec830['attributes']=_['intersection'](_0x29665a[_0xe380('0x27')],qs['fields'](_0x3c7f1d[_0xe380('0x29')]['fields']));_0x3ec830[_0xe380('0x2e')]=_0x3ec830['attributes']['length']?_0x3ec830['attributes']:_0x29665a['model'];if(_0x3c7f1d[_0xe380('0x29')][_0xe380('0x3b')]){_0x3ec830['include']=[{'all':!![]}];}_0x3ec830=_[_0xe380('0x38')]({},_0x3ec830,_0x3c7f1d[_0xe380('0x3a')]);return db[_0xe380('0x26')]['find'](_0x3ec830)[_0xe380('0x22')](handleEntityNotFound(_0x46f447,null))[_0xe380('0x22')](respondWithResult(_0x46f447,null))['catch'](handleError(_0x46f447,null));};exports['create']=function(_0x4d19ca,_0x50015f){return db['Schedule']['create'](_0x4d19ca[_0xe380('0x3f')],{})[_0xe380('0x22')](respondWithResult(_0x50015f,0xc9))[_0xe380('0x40')](handleError(_0x50015f,null));};exports[_0xe380('0x41')]=function(_0x44641f,_0xd2943c){if(_0x44641f['body']['id']){delete _0x44641f['body']['id'];}return db[_0xe380('0x26')][_0xe380('0x42')]({'where':{'id':_0x44641f[_0xe380('0x43')]['id']}})['then'](handleEntityNotFound(_0xd2943c,null))[_0xe380('0x22')](saveUpdates(_0x44641f[_0xe380('0x3f')],null))[_0xe380('0x22')](respondWithResult(_0xd2943c,null))[_0xe380('0x40')](handleError(_0xd2943c,null));};exports['destroy']=function(_0x5690ca,_0x262d16){return db[_0xe380('0x26')][_0xe380('0x42')]({'where':{'id':_0x5690ca['params']['id']}})[_0xe380('0x22')](handleEntityNotFound(_0x262d16,null))[_0xe380('0x22')](removeEntity(_0x262d16,null))[_0xe380('0x40')](handleError(_0x262d16,null));};exports[_0xe380('0x44')]=function(_0x54c7fc,_0x18b776,_0x1b1008){var _0x5c1130=require(_0xe380('0x45'));return db[_0xe380('0x26')][_0xe380('0x42')]({'where':{'id':_0x54c7fc['params']['id']},'raw':!![]})[_0xe380('0x22')](handleEntityNotFound(_0x18b776,null))['then'](function(){_0x5c1130[_0xe380('0x44')](_0x54c7fc[_0xe380('0x43')]['id']);})[_0xe380('0x22')](respondWithStatusCode(_0x18b776,null))['catch'](handleError(_0x18b776,null));};
\ No newline at end of file
+var _0x4668=['merge','options','includeAll','include','rows','catch','show','params','find','create','body','run','../../config/schedule','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','util','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','set','Content-Range','destroy','then','sendStatus','error','stack','name','Schedule','rawAttributes','model','query','dateEnd','dateStart','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','day','filter'];(function(_0x3018de,_0x521eec){var _0x2d2ac4=function(_0x554332){while(--_0x554332){_0x3018de['push'](_0x3018de['shift']());}};_0x2d2ac4(++_0x521eec);}(_0x4668,0x111));var _0x8466=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4668[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x8466('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8466('0x1'));var zipdir=require(_0x8466('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8466('0x3'));var moment=require(_0x8466('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8466('0x5'));var util=require(_0x8466('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8466('0x7'));var fs=require('fs');var _=require(_0x8466('0x8'));var squel=require(_0x8466('0x9'));var crypto=require('crypto');var jsforce=require(_0x8466('0xa'));var deskjs=require(_0x8466('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8466('0xc'));var Papa=require(_0x8466('0xd'));var qs=require('../../components/parsers/qs');var logger=require(_0x8466('0xe'))(_0x8466('0xf'));var utils=require(_0x8466('0x10'));var config=require(_0x8466('0x11'));var db=require(_0x8466('0x12'))['db'];function respondWithStatusCode(_0x728e3f,_0x1e623e){_0x1e623e=_0x1e623e||0xcc;return function(_0x3c3629){if(_0x3c3629){return _0x728e3f['sendStatus'](_0x1e623e);}return _0x728e3f[_0x8466('0x13')](_0x1e623e)[_0x8466('0x14')]();};}function respondWithResult(_0xc4c757,_0x5acf7d){_0x5acf7d=_0x5acf7d||0xc8;return function(_0x21340f){if(_0x21340f){return _0xc4c757[_0x8466('0x13')](_0x5acf7d)['json'](_0x21340f);}};}function respondWithFilteredResult(_0x589374,_0x1dbec1){return function(_0x8de743){if(_0x8de743){var _0x5eb4d9=_0x8de743[_0x8466('0x15')],_0x31aa07=_0x1dbec1['offset'],_0x9c38f=_0x1dbec1[_0x8466('0x16')]+_0x1dbec1['limit'],_0x45f78e;if(_0x9c38f>=_0x5eb4d9){_0x9c38f=_0x5eb4d9;_0x45f78e=0xc8;}else{_0x45f78e=0xce;}_0x589374[_0x8466('0x13')](_0x45f78e);return _0x589374[_0x8466('0x17')](_0x8466('0x18'),_0x31aa07+'-'+_0x9c38f+'/'+_0x5eb4d9)['json'](_0x8de743);}return null;};}function patchUpdates(_0x90dc2e){return function(_0x5c7810){try{jsonpatch['apply'](_0x5c7810,_0x90dc2e,!![]);}catch(_0xb383db){return BPromise['reject'](_0xb383db);}return _0x5c7810['save']();};}function saveUpdates(_0x3ce6e4,_0x13decc){return function(_0x1ba327){if(_0x1ba327){return _0x1ba327['update'](_0x3ce6e4)['then'](function(_0x521208){return _0x521208;});}return null;};}function removeEntity(_0x54b72b,_0x1d6057){return function(_0x540456){if(_0x540456){return _0x540456[_0x8466('0x19')]()[_0x8466('0x1a')](function(){_0x54b72b[_0x8466('0x13')](0xcc)[_0x8466('0x14')]();});}};}function handleEntityNotFound(_0x441eac,_0x16ec64){return function(_0x2bba95){if(!_0x2bba95){_0x441eac[_0x8466('0x1b')](0x194);}return _0x2bba95;};}function handleError(_0xf2df8c,_0x1b6738){_0x1b6738=_0x1b6738||0x1f4;return function(_0x22da3d){logger[_0x8466('0x1c')](_0x22da3d[_0x8466('0x1d')]);if(_0x22da3d[_0x8466('0x1e')]){delete _0x22da3d[_0x8466('0x1e')];}_0xf2df8c[_0x8466('0x13')](_0x1b6738)['send'](_0x22da3d);};}exports['index']=function(_0x263f8a,_0x33bdc6){var _0x3b62c3={},_0x24f050={},_0x2a086f={'count':0x0,'rows':[]};var _0x4c713b=db[_0x8466('0x1f')][_0x8466('0x20')];_0x24f050[_0x8466('0x21')]=_['keys'](_0x4c713b);var _0x156bbc={'dateStart':_0x263f8a[_0x8466('0x22')]['dateStart'],'dateEnd':_0x263f8a[_0x8466('0x22')][_0x8466('0x23')]};delete _0x263f8a[_0x8466('0x22')][_0x8466('0x24')];delete _0x263f8a[_0x8466('0x22')][_0x8466('0x23')];_0x24f050[_0x8466('0x22')]=_[_0x8466('0x25')](_0x263f8a[_0x8466('0x22')]);_0x24f050[_0x8466('0x26')]=_[_0x8466('0x27')](_0x24f050[_0x8466('0x21')],_0x24f050[_0x8466('0x22')]);_0x3b62c3[_0x8466('0x28')]=_[_0x8466('0x27')](_0x24f050[_0x8466('0x21')],qs['fields'](_0x263f8a[_0x8466('0x22')][_0x8466('0x29')]));_0x3b62c3[_0x8466('0x28')]=_0x3b62c3[_0x8466('0x28')][_0x8466('0x2a')]?_0x3b62c3[_0x8466('0x28')]:_0x24f050[_0x8466('0x21')];if(!_0x263f8a[_0x8466('0x22')][_0x8466('0x2b')](_0x8466('0x2c'))){_0x3b62c3['limit']=qs[_0x8466('0x2d')](_0x263f8a[_0x8466('0x22')][_0x8466('0x2d')]);_0x3b62c3[_0x8466('0x16')]=qs[_0x8466('0x16')](_0x263f8a[_0x8466('0x22')][_0x8466('0x16')]);}_0x3b62c3[_0x8466('0x2e')]=qs[_0x8466('0x2f')](_0x263f8a[_0x8466('0x22')]['sort']);_0x3b62c3[_0x8466('0x30')]=qs['filters'](_[_0x8466('0x31')](_0x263f8a[_0x8466('0x22')],_0x24f050[_0x8466('0x26')]));if(_0x156bbc[_0x8466('0x24')]){if(_0x156bbc[_0x8466('0x23')]){_0x156bbc[_0x8466('0x23')]=moment(_0x156bbc[_0x8466('0x23')])['add'](0x1,_0x8466('0x32'));}else{_0x156bbc[_0x8466('0x23')]=moment(_0x156bbc[_0x8466('0x24')])['add'](0x1,_0x8466('0x32'));}_['merge'](_0x3b62c3[_0x8466('0x30')],{'createdAt':{'$gte':_0x156bbc[_0x8466('0x24')],'$lte':_0x156bbc[_0x8466('0x23')]}});}if(_0x263f8a[_0x8466('0x22')][_0x8466('0x33')]){_0x3b62c3[_0x8466('0x30')]=_[_0x8466('0x34')](_0x3b62c3[_0x8466('0x30')],{'$or':_['map'](_0x3b62c3['attributes'],function(_0x2f518a){var _0x1eb7d4={};_0x1eb7d4[_0x2f518a]={'$like':'%'+_0x263f8a[_0x8466('0x22')][_0x8466('0x33')]+'%'};return _0x1eb7d4;})});}_0x3b62c3=_[_0x8466('0x34')]({},_0x3b62c3,_0x263f8a[_0x8466('0x35')]);var _0x4c20eb={'where':_0x3b62c3[_0x8466('0x30')]};return db['Schedule'][_0x8466('0x15')](_0x4c20eb)[_0x8466('0x1a')](function(_0x11caa6){_0x2a086f[_0x8466('0x15')]=_0x11caa6;if(_0x263f8a[_0x8466('0x22')][_0x8466('0x36')]){_0x3b62c3[_0x8466('0x37')]=[{'all':!![]}];}return db[_0x8466('0x1f')]['findAll'](_0x3b62c3);})[_0x8466('0x1a')](function(_0x42ebbd){_0x2a086f[_0x8466('0x38')]=_0x42ebbd;return _0x2a086f;})[_0x8466('0x1a')](respondWithFilteredResult(_0x33bdc6,_0x3b62c3))[_0x8466('0x39')](handleError(_0x33bdc6,null));};exports[_0x8466('0x3a')]=function(_0x535a4e,_0x518fbc){var _0x48fd51={'raw':![],'where':{'id':_0x535a4e[_0x8466('0x3b')]['id']}},_0xae66ad={};_0xae66ad[_0x8466('0x21')]=_['keys'](db[_0x8466('0x1f')]['rawAttributes']);_0xae66ad[_0x8466('0x22')]=_[_0x8466('0x25')](_0x535a4e[_0x8466('0x22')]);_0xae66ad[_0x8466('0x26')]=_[_0x8466('0x27')](_0xae66ad[_0x8466('0x21')],_0xae66ad[_0x8466('0x22')]);_0x48fd51['attributes']=_[_0x8466('0x27')](_0xae66ad[_0x8466('0x21')],qs['fields'](_0x535a4e[_0x8466('0x22')][_0x8466('0x29')]));_0x48fd51[_0x8466('0x28')]=_0x48fd51[_0x8466('0x28')][_0x8466('0x2a')]?_0x48fd51[_0x8466('0x28')]:_0xae66ad[_0x8466('0x21')];if(_0x535a4e[_0x8466('0x22')][_0x8466('0x36')]){_0x48fd51[_0x8466('0x37')]=[{'all':!![]}];}_0x48fd51=_['merge']({},_0x48fd51,_0x535a4e[_0x8466('0x35')]);return db[_0x8466('0x1f')][_0x8466('0x3c')](_0x48fd51)[_0x8466('0x1a')](handleEntityNotFound(_0x518fbc,null))[_0x8466('0x1a')](respondWithResult(_0x518fbc,null))[_0x8466('0x39')](handleError(_0x518fbc,null));};exports[_0x8466('0x3d')]=function(_0x264185,_0x598473){return db['Schedule'][_0x8466('0x3d')](_0x264185[_0x8466('0x3e')],{})['then'](respondWithResult(_0x598473,0xc9))['catch'](handleError(_0x598473,null));};exports['update']=function(_0x444a86,_0x4dcdc6){if(_0x444a86[_0x8466('0x3e')]['id']){delete _0x444a86[_0x8466('0x3e')]['id'];}return db['Schedule'][_0x8466('0x3c')]({'where':{'id':_0x444a86['params']['id']}})[_0x8466('0x1a')](handleEntityNotFound(_0x4dcdc6,null))['then'](saveUpdates(_0x444a86[_0x8466('0x3e')],null))['then'](respondWithResult(_0x4dcdc6,null))[_0x8466('0x39')](handleError(_0x4dcdc6,null));};exports['destroy']=function(_0x19616d,_0x4f9fd3){return db['Schedule'][_0x8466('0x3c')]({'where':{'id':_0x19616d[_0x8466('0x3b')]['id']}})['then'](handleEntityNotFound(_0x4f9fd3,null))[_0x8466('0x1a')](removeEntity(_0x4f9fd3,null))[_0x8466('0x39')](handleError(_0x4f9fd3,null));};exports[_0x8466('0x3f')]=function(_0x4480b4,_0x14af56,_0x56d012){var _0x5c8f18=require(_0x8466('0x40'));return db[_0x8466('0x1f')]['find']({'where':{'id':_0x4480b4[_0x8466('0x3b')]['id']},'raw':!![]})[_0x8466('0x1a')](handleEntityNotFound(_0x14af56,null))[_0x8466('0x1a')](function(){_0x5c8f18[_0x8466('0x3f')](_0x4480b4['params']['id']);})[_0x8466('0x1a')](respondWithStatusCode(_0x14af56,null))[_0x8466('0x39')](handleError(_0x14af56,null));};
\ No newline at end of file
index 63e2a27..c414076 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['tools_schedules','util','../../config/logger','api','moment','request-promise','./schedule.attributes','Schedule'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x5f2f,0x1b1));var _0xf5f2=function(_0x1e06c4,_0x53ae54){_0x1e06c4=_0x1e06c4-0x0;var _0x1f313c=_0x5f2f[_0x1e06c4];return _0x1f313c;};'use strict';var _=require('lodash');var util=require(_0xf5f2('0x0'));var logger=require(_0xf5f2('0x1'))(_0xf5f2('0x2'));var moment=require(_0xf5f2('0x3'));var BPromise=require('bluebird');var rp=require(_0xf5f2('0x4'));var attributes=require(_0xf5f2('0x5'));module['exports']=function(_0x52f905,_0x44e5f2){return _0x52f905['define'](_0xf5f2('0x6'),attributes,{'tableName':_0xf5f2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x143a=['util','../../config/logger','bluebird','request-promise','./schedule.attributes','define','Schedule','tools_schedules','lodash'];(function(_0x246956,_0x3374f3){var _0x1145e4=function(_0x37013c){while(--_0x37013c){_0x246956['push'](_0x246956['shift']());}};_0x1145e4(++_0x3374f3);}(_0x143a,0x128));var _0xa143=function(_0x23724f,_0x19e182){_0x23724f=_0x23724f-0x0;var _0x17c793=_0x143a[_0x23724f];return _0x17c793;};'use strict';var _=require(_0xa143('0x0'));var util=require(_0xa143('0x1'));var logger=require(_0xa143('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa143('0x3'));var rp=require(_0xa143('0x4'));var attributes=require(_0xa143('0x5'));module['exports']=function(_0x3022fd,_0x6e8837){return _0x3022fd[_0xa143('0x6')](_0xa143('0x7'),attributes,{'tableName':_0xa143('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e0fe37f..a1cdee2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ec=['jayson/promise','client','http','then','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/logger','../../config/environment'];(function(_0x36e9fc,_0x5b8f92){var _0x5bb728=function(_0x285e76){while(--_0x285e76){_0x36e9fc['push'](_0x36e9fc['shift']());}};_0x5bb728(++_0x5b8f92);}(_0x55ec,0x8d));var _0xc55e=function(_0xfc406a,_0x4479e1){_0xfc406a=_0xfc406a-0x0;var _0x395473=_0x55ec[_0xfc406a];return _0x395473;};'use strict';var _=require('lodash');var util=require(_0xc55e('0x0'));var moment=require(_0xc55e('0x1'));var BPromise=require(_0xc55e('0x2'));var rs=require(_0xc55e('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc55e('0x4'))('rpc');var config=require(_0xc55e('0x5'));var jayson=require(_0xc55e('0x6'));var client=jayson[_0xc55e('0x7')][_0xc55e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59e939,_0x2d9dff,_0x4e302b){return new BPromise(function(_0x3854dd,_0x3e3ddd){return client['request'](_0x59e939,_0x4e302b)[_0xc55e('0x9')](function(_0x345c74){logger[_0xc55e('0xa')](_0xc55e('0xb'),_0x2d9dff,'request\x20sent');logger[_0xc55e('0xc')](_0xc55e('0xd'),_0x2d9dff,_0xc55e('0xe'),JSON[_0xc55e('0xf')](_0x345c74));if(_0x345c74['error']){if(_0x345c74[_0xc55e('0x10')][_0xc55e('0x11')]===0x1f4){logger[_0xc55e('0x10')](_0xc55e('0xb'),_0x2d9dff,_0x345c74[_0xc55e('0x10')][_0xc55e('0x12')]);return _0x3e3ddd(_0x345c74[_0xc55e('0x10')][_0xc55e('0x12')]);}logger['error'](_0xc55e('0xb'),_0x2d9dff,_0x345c74[_0xc55e('0x10')][_0xc55e('0x12')]);return _0x3854dd(_0x345c74[_0xc55e('0x10')][_0xc55e('0x12')]);}else{logger[_0xc55e('0xa')](_0xc55e('0xb'),_0x2d9dff,_0xc55e('0xe'));_0x3854dd(_0x345c74[_0xc55e('0x13')][_0xc55e('0x12')]);}})[_0xc55e('0x14')](function(_0x3edce0){logger[_0xc55e('0x10')](_0xc55e('0xb'),_0x2d9dff,_0x3edce0);_0x3e3ddd(_0x3edce0);});});}
\ No newline at end of file
+var _0xbaa8=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash'];(function(_0x2543d6,_0x3a5e78){var _0x55213c=function(_0x292768){while(--_0x292768){_0x2543d6['push'](_0x2543d6['shift']());}};_0x55213c(++_0x3a5e78);}(_0xbaa8,0xb3));var _0x8baa=function(_0x646abc,_0x58ef27){_0x646abc=_0x646abc-0x0;var _0x169a36=_0xbaa8[_0x646abc];return _0x169a36;};'use strict';var _=require(_0x8baa('0x0'));var util=require('util');var moment=require(_0x8baa('0x1'));var BPromise=require(_0x8baa('0x2'));var rs=require(_0x8baa('0x3'));var fs=require('fs');var db=require(_0x8baa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8baa('0x5'))(_0x8baa('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x18d87f,_0xb423f5,_0x4ba058){return new BPromise(function(_0x1085ea,_0x433ff2){return client[_0x8baa('0x7')](_0x18d87f,_0x4ba058)[_0x8baa('0x8')](function(_0x4d593d){logger['info'](_0x8baa('0x9'),_0xb423f5,_0x8baa('0xa'));logger[_0x8baa('0xb')](_0x8baa('0xc'),_0xb423f5,_0x8baa('0xa'),JSON[_0x8baa('0xd')](_0x4d593d));if(_0x4d593d[_0x8baa('0xe')]){if(_0x4d593d[_0x8baa('0xe')][_0x8baa('0xf')]===0x1f4){logger[_0x8baa('0xe')](_0x8baa('0x9'),_0xb423f5,_0x4d593d[_0x8baa('0xe')][_0x8baa('0x10')]);return _0x433ff2(_0x4d593d[_0x8baa('0xe')][_0x8baa('0x10')]);}logger['error'](_0x8baa('0x9'),_0xb423f5,_0x4d593d['error']['message']);return _0x1085ea(_0x4d593d['error'][_0x8baa('0x10')]);}else{logger[_0x8baa('0x11')]('Schedule,\x20%s,\x20%s',_0xb423f5,_0x8baa('0xa'));_0x1085ea(_0x4d593d['result'][_0x8baa('0x10')]);}})['catch'](function(_0x3601d0){logger[_0x8baa('0xe')](_0x8baa('0x9'),_0xb423f5,_0x3601d0);_0x433ff2(_0x3601d0);});});}
\ No newline at end of file
index 01e9776..bc0548b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d6b=['post','/:id/logo','single','file','addLogo','join','addLogoLogin','put','update','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','diskStorage','root','format','%s%s','logo','originalname'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x2d6b,0xf1));var _0xb2d6=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x2d6b[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0xb2d6('0x0'));var util=require(_0xb2d6('0x1'));var path=require(_0xb2d6('0x2'));var express=require(_0xb2d6('0x3'));var router=express[_0xb2d6('0x4')]();var auth=require(_0xb2d6('0x5'));var interaction=require(_0xb2d6('0x6'));var config=require(_0xb2d6('0x7'));var controller=require('./setting.controller');router[_0xb2d6('0x8')]('/',auth[_0xb2d6('0x9')](),controller[_0xb2d6('0xa')]);router['get'](_0xb2d6('0xb'),controller[_0xb2d6('0xc')]);router[_0xb2d6('0x8')]('/:id/logo',controller['getLogo']);router['get'](_0xb2d6('0xd'),controller[_0xb2d6('0xe')]);router[_0xb2d6('0x8')](_0xb2d6('0xf'),controller[_0xb2d6('0x10')]);var upload=multer({'storage':multer[_0xb2d6('0x11')]({'destination':function(_0x267913,_0x404028,_0x37dead){_0x37dead(null,path['join'](config[_0xb2d6('0x12')],'server/files/images/logos/'));},'filename':function(_0x2444bb,_0x4607d5,_0x10bdc7){_0x10bdc7(null,util[_0xb2d6('0x13')](_0xb2d6('0x14'),_0xb2d6('0x15'),path['extname'](_0x4607d5[_0xb2d6('0x16')])));}})});router[_0xb2d6('0x17')](_0xb2d6('0x18'),upload[_0xb2d6('0x19')](_0xb2d6('0x1a')),controller[_0xb2d6('0x1b')]);var upload=multer({'storage':multer[_0xb2d6('0x11')]({'destination':function(_0x3d449f,_0x33d13c,_0x5ed1ef){_0x5ed1ef(null,path[_0xb2d6('0x1c')](config[_0xb2d6('0x12')],'server/files/images/logos/'));},'filename':function(_0x19fa73,_0x20d267,_0x1007a0){_0x1007a0(null,util[_0xb2d6('0x13')](_0xb2d6('0x14'),'logologin',path['extname'](_0x20d267[_0xb2d6('0x16')])));}})});router[_0xb2d6('0x17')](_0xb2d6('0xd'),upload['single'](_0xb2d6('0x1a')),controller[_0xb2d6('0x1d')]);router[_0xb2d6('0x1e')](_0xb2d6('0xb'),auth[_0xb2d6('0x9')](),controller[_0xb2d6('0x1f')]);module[_0xb2d6('0x20')]=router;
\ No newline at end of file
+var _0xeb24=['index','get','/:id','show','/:id/logo','/:id/logo_login','/:id/gdpr','gdpr','server/files/images/logos/','format','extname','post','single','file','addLogo','join','root','%s%s','logologin','originalname','addLogoLogin','put','update','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x227496,_0x4b0c8a){var _0x48065b=function(_0x2afa93){while(--_0x2afa93){_0x227496['push'](_0x227496['shift']());}};_0x48065b(++_0x4b0c8a);}(_0xeb24,0xd8));var _0x4eb2=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xeb24[_0x2070da];return _0x4f9fe1;};'use strict';var multer=require(_0x4eb2('0x0'));var util=require(_0x4eb2('0x1'));var path=require(_0x4eb2('0x2'));var express=require(_0x4eb2('0x3'));var router=express[_0x4eb2('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4eb2('0x5'));var config=require(_0x4eb2('0x6'));var controller=require('./setting.controller');router['get']('/',auth[_0x4eb2('0x7')](),controller[_0x4eb2('0x8')]);router[_0x4eb2('0x9')](_0x4eb2('0xa'),controller[_0x4eb2('0xb')]);router['get'](_0x4eb2('0xc'),controller['getLogo']);router['get'](_0x4eb2('0xd'),controller['getLogoLogin']);router[_0x4eb2('0x9')](_0x4eb2('0xe'),controller[_0x4eb2('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4b9263,_0x342dc6,_0x28b424){_0x28b424(null,path['join'](config['root'],_0x4eb2('0x10')));},'filename':function(_0x141f67,_0x3042ed,_0x287a36){_0x287a36(null,util[_0x4eb2('0x11')]('%s%s','logo',path[_0x4eb2('0x12')](_0x3042ed['originalname'])));}})});router[_0x4eb2('0x13')]('/:id/logo',upload[_0x4eb2('0x14')](_0x4eb2('0x15')),controller[_0x4eb2('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x51dde7,_0x2275b7,_0x1186bb){_0x1186bb(null,path[_0x4eb2('0x17')](config[_0x4eb2('0x18')],'server/files/images/logos/'));},'filename':function(_0x159115,_0x580a9f,_0x2bd4c8){_0x2bd4c8(null,util[_0x4eb2('0x11')](_0x4eb2('0x19'),_0x4eb2('0x1a'),path[_0x4eb2('0x12')](_0x580a9f[_0x4eb2('0x1b')])));}})});router[_0x4eb2('0x13')]('/:id/logo_login',upload[_0x4eb2('0x14')](_0x4eb2('0x15')),controller[_0x4eb2('0x1c')]);router[_0x4eb2('0x1d')]('/:id',auth[_0x4eb2('0x7')](),controller[_0x4eb2('0x1e')]);module[_0x4eb2('0x1f')]=router;
\ No newline at end of file
index 2aefdc3..3d5c865 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0a2=['alternate','exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml'];(function(_0x345d12,_0x19e0e2){var _0x11d218=function(_0x5ce437){while(--_0x5ce437){_0x345d12['push'](_0x345d12['shift']());}};_0x11d218(++_0x19e0e2);}(_0xb0a2,0xd9));var _0x2b0a=function(_0x443121,_0x44e9f9){_0x443121=_0x443121-0x0;var _0x2a7303=_0xb0a2[_0x443121];return _0x2a7303;};'use strict';var Sequelize=require('sequelize');module[_0x2b0a('0x0')]={'min_internal':{'type':Sequelize[_0x2b0a('0x1')](0xb),'unique':_0x2b0a('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x2b0a('0x1')](0xb),'unique':_0x2b0a('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x2b0a('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x2b0a('0x4')],'defaultValue':_0x2b0a('0x5')},'logo':{'type':Sequelize[_0x2b0a('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x2b0a('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x2b0a('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x2b0a('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x2b0a('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x2b0a('0x4')]},'turnaddr':{'type':Sequelize[_0x2b0a('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x2b0a('0x4')]},'pageTitle':{'type':Sequelize[_0x2b0a('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x2b0a('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x2b0a('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x2b0a('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x2b0a('0x4')],'defaultValue':_0x2b0a('0x7')},'enableEmailPreview':{'type':Sequelize[_0x2b0a('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x2b0a('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x2b0a('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x2b0a('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x2b0a('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x2b0a('0x4')],'defaultValue':_0x2b0a('0x8')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x2b0a('0x6')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xafd0=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','INTEGER','min_internal','min_mailbox','STRING','BOOLEAN'];(function(_0x56e98b,_0x5852ea){var _0x54d675=function(_0x363b3e){while(--_0x363b3e){_0x56e98b['push'](_0x56e98b['shift']());}};_0x54d675(++_0x5852ea);}(_0xafd0,0x144));var _0x0afd=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xafd0[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require('sequelize');module['exports']={'min_internal':{'type':Sequelize[_0x0afd('0x0')](0xb),'unique':_0x0afd('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0afd('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0afd('0x3')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x0afd('0x3')]},'defaultLogo':{'type':Sequelize[_0x0afd('0x4')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0afd('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0x0afd('0x4')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0afd('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0afd('0x4')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0afd('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x0afd('0x4')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0afd('0x3')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x0afd('0x3')]},'pageTitle':{'type':Sequelize[_0x0afd('0x3')]},'defaultPageTitle':{'type':Sequelize[_0x0afd('0x4')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0afd('0x0')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0afd('0x4')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0afd('0x3')],'defaultValue':_0x0afd('0x5')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x0afd('0x4')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x0afd('0x0')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0afd('0x0')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0afd('0x0')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0afd('0x3')],'defaultValue':_0x0afd('0x6')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0afd('0x4')],'defaultValue':!![]}};
\ No newline at end of file
index 901f0eb..cbac991 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c32=['stack','name','send','Setting','rawAttributes','query','dateStart','dateEnd','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','add','merge','map','filter','options','includeAll','include','findAll','rows','show','find','params','body','get','readFileSync','join','root','server/files/templates/stun.ejs','render','server/files/templates/turn.ejs','utf8','/etc/asterisk/turn_xcally.conf','Reload','res_rtp_asterisk.so','addLogo','file','logo','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','existsSync','toLower','default_logo.png','upperFirst','custom','Sequelize','ValidationError','Logo\x20not\x20found','getLogoLogin','defaultLogo','default_loginLogo.png','default','download','gdpr','html-pdf','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','destroy','end'];(function(_0x59137b,_0x20880e){var _0x267490=function(_0xcec6de){while(--_0xcec6de){_0x59137b['push'](_0x59137b['shift']());}};_0x267490(++_0x20880e);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x26c3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x26c3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x26c3('0x2'));var rp=require('request-promise');var moment=require(_0x26c3('0x3'));var BPromise=require(_0x26c3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x26c3('0x5'));var sox=require(_0x26c3('0x6'));var csv=require(_0x26c3('0x7'));var ejs=require(_0x26c3('0x8'));var fs=require('fs');var _=require(_0x26c3('0x9'));var squel=require(_0x26c3('0xa'));var crypto=require(_0x26c3('0xb'));var jsforce=require(_0x26c3('0xc'));var deskjs=require(_0x26c3('0xd'));var toCsv=require(_0x26c3('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var qs=require(_0x26c3('0xe'));var logger=require('../../config/logger')(_0x26c3('0xf'));var utils=require(_0x26c3('0x10'));var config=require('../../config/environment');var db=require(_0x26c3('0x11'))['db'];var jayson=require(_0x26c3('0x12'));var client=jayson[_0x26c3('0x13')][_0x26c3('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x69fcee,_0x4aa6f7,_0x41a6c2,_0x3be1d4){return new BPromise(function(_0x3e00f4,_0x1c2383){var _0x1ef1a9=_0x3be1d4||client;return _0x1ef1a9[_0x26c3('0x15')](_0x69fcee,_0x41a6c2)[_0x26c3('0x16')](function(_0x278214){logger['info']('Setting,\x20%s,\x20%s',_0x4aa6f7,_0x26c3('0x17'));logger[_0x26c3('0x18')](_0x26c3('0x19'),_0x4aa6f7,_0x26c3('0x17'),JSON[_0x26c3('0x1a')](_0x278214));if(_0x278214[_0x26c3('0x1b')]){if(_0x278214['error'][_0x26c3('0x1c')]===0x1f4){logger[_0x26c3('0x1b')]('Setting,\x20%s,\x20%s',_0x4aa6f7,_0x278214[_0x26c3('0x1b')]['message']);return _0x1c2383(_0x278214[_0x26c3('0x1b')]['message']);}logger[_0x26c3('0x1b')](_0x26c3('0x1d'),_0x4aa6f7,_0x278214[_0x26c3('0x1b')][_0x26c3('0x1e')]);return _0x3e00f4(_0x278214['error'][_0x26c3('0x1e')]);}else{logger['info'](_0x26c3('0x1d'),_0x4aa6f7,'request\x20sent');_0x3e00f4(_0x278214[_0x26c3('0x1f')][_0x26c3('0x1e')]);}})[_0x26c3('0x20')](function(_0x5a9e96){logger['error']('Setting,\x20%s,\x20%s',_0x4aa6f7,_0x5a9e96);_0x1c2383(_0x5a9e96);});});}function respondWithStatusCode(_0x25f771,_0xba4076){_0xba4076=_0xba4076||0xcc;return function(_0x3c1cf5){if(_0x3c1cf5){return _0x25f771[_0x26c3('0x21')](_0xba4076);}return _0x25f771[_0x26c3('0x22')](_0xba4076)['end']();};}function respondWithResult(_0x39c6fb,_0x4a5220){_0x4a5220=_0x4a5220||0xc8;return function(_0x3316a7){if(_0x3316a7){return _0x39c6fb[_0x26c3('0x22')](_0x4a5220)[_0x26c3('0x23')](_0x3316a7);}};}function respondWithFilteredResult(_0x248ecb,_0x3aa515){return function(_0x37373c){if(_0x37373c){var _0xf8aee0=_0x37373c[_0x26c3('0x24')],_0x30bf80=_0x3aa515[_0x26c3('0x25')],_0xd14177=_0x3aa515['offset']+_0x3aa515['limit'],_0x3ab3d6;if(_0xd14177>=_0xf8aee0){_0xd14177=_0xf8aee0;_0x3ab3d6=0xc8;}else{_0x3ab3d6=0xce;}_0x248ecb['status'](_0x3ab3d6);return _0x248ecb[_0x26c3('0x26')](_0x26c3('0x27'),_0x30bf80+'-'+_0xd14177+'/'+_0xf8aee0)[_0x26c3('0x23')](_0x37373c);}return null;};}function patchUpdates(_0xa1cf3d){return function(_0x31d3f4){try{jsonpatch['apply'](_0x31d3f4,_0xa1cf3d,!![]);}catch(_0x3aa957){return BPromise[_0x26c3('0x28')](_0x3aa957);}return _0x31d3f4[_0x26c3('0x29')]();};}function saveUpdates(_0xdab92e,_0x5201d4){return function(_0x51b596){if(_0x51b596){return _0x51b596[_0x26c3('0x2a')](_0xdab92e)[_0x26c3('0x16')](function(_0x1ff7ca){return _0x1ff7ca;});}return null;};}function removeEntity(_0x4ca05e,_0x4c2b20){return function(_0xebf568){if(_0xebf568){return _0xebf568[_0x26c3('0x2b')]()[_0x26c3('0x16')](function(){_0x4ca05e['status'](0xcc)[_0x26c3('0x2c')]();});}};}function handleEntityNotFound(_0x5a6f2d,_0x323bf5){return function(_0x4d8fbb){if(!_0x4d8fbb){_0x5a6f2d[_0x26c3('0x21')](0x194);}return _0x4d8fbb;};}function handleError(_0x526d78,_0x5baee6){_0x5baee6=_0x5baee6||0x1f4;return function(_0x1762ec){logger[_0x26c3('0x1b')](_0x1762ec[_0x26c3('0x2d')]);if(_0x1762ec[_0x26c3('0x2e')]){delete _0x1762ec[_0x26c3('0x2e')];}_0x526d78[_0x26c3('0x22')](_0x5baee6)[_0x26c3('0x2f')](_0x1762ec);};}exports['index']=function(_0x4c38d7,_0x31abd5){var _0x36cc1d={},_0x5e99ea={},_0x2fe2fd={'count':0x0,'rows':[]};var _0x2151ef=db[_0x26c3('0x30')][_0x26c3('0x31')];_0x5e99ea['model']=_['keys'](_0x2151ef);var _0x52e718={'dateStart':_0x4c38d7[_0x26c3('0x32')][_0x26c3('0x33')],'dateEnd':_0x4c38d7[_0x26c3('0x32')][_0x26c3('0x34')]};delete _0x4c38d7[_0x26c3('0x32')][_0x26c3('0x33')];delete _0x4c38d7[_0x26c3('0x32')][_0x26c3('0x34')];_0x5e99ea[_0x26c3('0x32')]=_[_0x26c3('0x35')](_0x4c38d7[_0x26c3('0x32')]);_0x5e99ea[_0x26c3('0x36')]=_[_0x26c3('0x37')](_0x5e99ea[_0x26c3('0x38')],_0x5e99ea[_0x26c3('0x32')]);_0x36cc1d[_0x26c3('0x39')]=_[_0x26c3('0x37')](_0x5e99ea['model'],qs[_0x26c3('0x3a')](_0x4c38d7[_0x26c3('0x32')][_0x26c3('0x3a')]));_0x36cc1d[_0x26c3('0x39')]=_0x36cc1d['attributes'][_0x26c3('0x3b')]?_0x36cc1d[_0x26c3('0x39')]:_0x5e99ea[_0x26c3('0x38')];if(!_0x4c38d7[_0x26c3('0x32')][_0x26c3('0x3c')](_0x26c3('0x3d'))){_0x36cc1d[_0x26c3('0x3e')]=qs[_0x26c3('0x3e')](_0x4c38d7[_0x26c3('0x32')]['limit']);_0x36cc1d[_0x26c3('0x25')]=qs[_0x26c3('0x25')](_0x4c38d7[_0x26c3('0x32')][_0x26c3('0x25')]);}_0x36cc1d[_0x26c3('0x3f')]=qs['sort'](_0x4c38d7[_0x26c3('0x32')]['sort']);_0x36cc1d[_0x26c3('0x40')]=qs['filters'](_[_0x26c3('0x41')](_0x4c38d7[_0x26c3('0x32')],_0x5e99ea[_0x26c3('0x36')]));if(_0x52e718[_0x26c3('0x33')]){if(_0x52e718[_0x26c3('0x34')]){_0x52e718[_0x26c3('0x34')]=moment(_0x52e718['dateEnd'])['add'](0x1,'day');}else{_0x52e718[_0x26c3('0x34')]=moment(_0x52e718['dateStart'])[_0x26c3('0x42')](0x1,'day');}_[_0x26c3('0x43')](_0x36cc1d[_0x26c3('0x40')],{'createdAt':{'$gte':_0x52e718[_0x26c3('0x33')],'$lte':_0x52e718['dateEnd']}});}if(_0x4c38d7[_0x26c3('0x32')]['filter']){_0x36cc1d[_0x26c3('0x40')]=_[_0x26c3('0x43')](_0x36cc1d[_0x26c3('0x40')],{'$or':_[_0x26c3('0x44')](_0x36cc1d[_0x26c3('0x39')],function(_0x3ae4a4){var _0x201c97={};_0x201c97[_0x3ae4a4]={'$like':'%'+_0x4c38d7[_0x26c3('0x32')][_0x26c3('0x45')]+'%'};return _0x201c97;})});}_0x36cc1d=_[_0x26c3('0x43')]({},_0x36cc1d,_0x4c38d7[_0x26c3('0x46')]);var _0x114b59={'where':_0x36cc1d[_0x26c3('0x40')]};return db[_0x26c3('0x30')][_0x26c3('0x24')](_0x114b59)[_0x26c3('0x16')](function(_0x26e9a9){_0x2fe2fd[_0x26c3('0x24')]=_0x26e9a9;if(_0x4c38d7[_0x26c3('0x32')][_0x26c3('0x47')]){_0x36cc1d[_0x26c3('0x48')]=[{'all':!![]}];}return db[_0x26c3('0x30')][_0x26c3('0x49')](_0x36cc1d);})[_0x26c3('0x16')](function(_0x10b69c){_0x2fe2fd[_0x26c3('0x4a')]=_0x10b69c;return _0x2fe2fd;})[_0x26c3('0x16')](respondWithFilteredResult(_0x31abd5,_0x36cc1d))[_0x26c3('0x20')](handleError(_0x31abd5,null));};exports[_0x26c3('0x4b')]=function(_0x1e3795,_0x276ad1){var _0xd8539={'raw':![],'where':{'id':_0x1e3795['params']['id']}},_0x23f956={};_0x23f956[_0x26c3('0x38')]=_[_0x26c3('0x35')](db[_0x26c3('0x30')]['rawAttributes']);_0x23f956[_0x26c3('0x32')]=_[_0x26c3('0x35')](_0x1e3795[_0x26c3('0x32')]);_0x23f956[_0x26c3('0x36')]=_['intersection'](_0x23f956[_0x26c3('0x38')],_0x23f956[_0x26c3('0x32')]);_0xd8539[_0x26c3('0x39')]=_[_0x26c3('0x37')](_0x23f956[_0x26c3('0x38')],qs[_0x26c3('0x3a')](_0x1e3795[_0x26c3('0x32')]['fields']));_0xd8539['attributes']=_0xd8539[_0x26c3('0x39')][_0x26c3('0x3b')]?_0xd8539['attributes']:_0x23f956[_0x26c3('0x38')];if(_0x1e3795[_0x26c3('0x32')][_0x26c3('0x47')]){_0xd8539['include']=[{'all':!![]}];}_0xd8539=_[_0x26c3('0x43')]({},_0xd8539,_0x1e3795[_0x26c3('0x46')]);return db[_0x26c3('0x30')][_0x26c3('0x4c')](_0xd8539)['then'](handleEntityNotFound(_0x276ad1,null))[_0x26c3('0x16')](respondWithResult(_0x276ad1,null))[_0x26c3('0x20')](handleError(_0x276ad1,null));};exports[_0x26c3('0x2a')]=function(_0x4b9dd6,_0x4efea2,_0x424d9a){var _0x4ce190;return db['Setting'][_0x26c3('0x4c')]({'where':{'id':_0x4b9dd6[_0x26c3('0x4d')]['id']}})[_0x26c3('0x16')](handleEntityNotFound(_0x4efea2,null))[_0x26c3('0x16')](saveUpdates(_0x4b9dd6[_0x26c3('0x4e')],null))[_0x26c3('0x16')](function(_0x349b15){if(_0x349b15){_0x4ce190=_0x349b15[_0x26c3('0x4f')]({'plain':!![]});var _0x2cfad5=fs[_0x26c3('0x50')](path[_0x26c3('0x51')](config[_0x26c3('0x52')],_0x26c3('0x53')),'utf8');var _0xc8e300=ejs[_0x26c3('0x54')](_0x2cfad5,_0x4ce190);var _0x8c2ea=fs[_0x26c3('0x50')](path[_0x26c3('0x51')](config[_0x26c3('0x52')],_0x26c3('0x55')),_0x26c3('0x56'));var _0x7a26aa=ejs[_0x26c3('0x54')](_0x8c2ea,_0x4ce190);fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0xc8e300);fs['writeFileSync'](_0x26c3('0x57'),_0x7a26aa);return respondWithRpcPromise(_0x26c3('0x58'),_0x26c3('0x2a'),{'module':'res_stun_monitor.so'});}})[_0x26c3('0x16')](function(){return respondWithRpcPromise(_0x26c3('0x58'),_0x26c3('0x2a'),{'module':_0x26c3('0x59')});})[_0x26c3('0x16')](function(){return _0x4ce190||null;})[_0x26c3('0x16')](respondWithResult(_0x4efea2,null))[_0x26c3('0x20')](handleError(_0x4efea2,null));};exports[_0x26c3('0x5a')]=function(_0x3f8e1e,_0x41f93b,_0x4fefa5){if(_0x3f8e1e[_0x26c3('0x5b')]&&_0x3f8e1e['file']['filename']){_0x3f8e1e[_0x26c3('0x4e')][_0x26c3('0x5c')]=_0x3f8e1e[_0x26c3('0x5b')][_0x26c3('0x5d')];}return db[_0x26c3('0x30')][_0x26c3('0x4c')]({'where':{'id':_0x3f8e1e[_0x26c3('0x4d')]['id']}})[_0x26c3('0x16')](handleEntityNotFound(_0x41f93b,null))[_0x26c3('0x16')](saveUpdates(_0x3f8e1e[_0x26c3('0x4e')],null))[_0x26c3('0x16')](respondWithResult(_0x41f93b,null))[_0x26c3('0x20')](handleError(_0x41f93b,null));};exports[_0x26c3('0x5e')]=function(_0x475292,_0x574dac,_0x36397f){if(_0x475292[_0x26c3('0x5b')]&&_0x475292['file'][_0x26c3('0x5d')]){_0x475292[_0x26c3('0x4e')][_0x26c3('0x5f')]=_0x475292[_0x26c3('0x5b')]['filename'];}return db[_0x26c3('0x30')][_0x26c3('0x4c')]({'where':{'id':_0x475292['params']['id']}})[_0x26c3('0x16')](handleEntityNotFound(_0x574dac,null))['then'](saveUpdates(_0x475292[_0x26c3('0x4e')],null))['then'](respondWithResult(_0x574dac,null))[_0x26c3('0x20')](handleError(_0x574dac,null));};var utilLicense=require(_0x26c3('0x60'));exports[_0x26c3('0x61')]=function(_0x186ddd,_0x3c21cb,_0x1a28a9){var _0x442fa3=_0x26c3('0x62');var _0x59de95={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x26c1ca){if(_0x26c1ca){_0x59de95=_0x26c1ca;}return db['Setting']['find']({'where':{'id':_0x186ddd[_0x26c3('0x4d')]['id']},'attributes':[_0x26c3('0x5c'),'loginLogo','defaultLogo','defaultLoginLogo'],'raw':!![]});})['then'](handleEntityNotFound(_0x3c21cb,null))[_0x26c3('0x16')](function(_0x3c0b00){if(_0x3c0b00){var _0x454aa3=_0x3c0b00[_0x26c3('0x5c')]&&fs[_0x26c3('0x63')](path[_0x26c3('0x51')](config['root'],_0x442fa3,_[_0x26c3('0x64')](_0x3c0b00[_0x26c3('0x5c')])))?path[_0x26c3('0x51')](config[_0x26c3('0x52')],_0x442fa3,_['toLower'](_0x3c0b00[_0x26c3('0x5c')])):path[_0x26c3('0x51')](config['root'],_0x442fa3,_[_0x26c3('0x64')](_0x26c3('0x65')));var _0x371526='default'+_[_0x26c3('0x66')](_0x26c3('0x5c'));if(_0x3c0b00[_0x371526]||!_0x59de95[_0x26c3('0x67')]){_0x454aa3=path[_0x26c3('0x51')](config[_0x26c3('0x52')],_0x442fa3,_['toLower']('default_logo.png'));}if(!fs[_0x26c3('0x63')](_0x454aa3)){throw new db[(_0x26c3('0x68'))][(_0x26c3('0x69'))](_0x26c3('0x6a'));}return _0x3c21cb['download'](_0x454aa3);}})[_0x26c3('0x20')](handleError(_0x3c21cb,null));};var utilLicense=require(_0x26c3('0x60'));exports[_0x26c3('0x6b')]=function(_0x8cbc58,_0x2140df,_0x5b9285){var _0x51ac96=_0x26c3('0x62');var _0x4fcaf2={'custom':![]};return utilLicense['getLicense']()[_0x26c3('0x16')](function(_0x21703){if(_0x21703){_0x4fcaf2=_0x21703;}return db[_0x26c3('0x30')][_0x26c3('0x4c')]({'where':{'id':_0x8cbc58['params']['id']},'attributes':[_0x26c3('0x5c'),_0x26c3('0x5f'),_0x26c3('0x6c'),'defaultLoginLogo'],'raw':!![]});})[_0x26c3('0x16')](handleEntityNotFound(_0x2140df,null))[_0x26c3('0x16')](function(_0x2e0c3c){if(_0x2e0c3c){var _0x47e109=_0x2e0c3c[_0x26c3('0x5f')]&&fs[_0x26c3('0x63')](path[_0x26c3('0x51')](config['root'],_0x51ac96,_['toLower'](_0x2e0c3c[_0x26c3('0x5f')])))?path[_0x26c3('0x51')](config['root'],_0x51ac96,_[_0x26c3('0x64')](_0x2e0c3c[_0x26c3('0x5f')])):path[_0x26c3('0x51')](config[_0x26c3('0x52')],_0x51ac96,_[_0x26c3('0x64')](_0x26c3('0x6d')));var _0x216aae=_0x26c3('0x6e')+_[_0x26c3('0x66')](_0x26c3('0x5f'));if(_0x2e0c3c[_0x216aae]||!_0x4fcaf2[_0x26c3('0x67')]){_0x47e109=path[_0x26c3('0x51')](config[_0x26c3('0x52')],_0x51ac96,_['toLower'](_0x26c3('0x6d')));}if(!fs[_0x26c3('0x63')](_0x47e109)){throw new db['Sequelize']['ValidationError'](_0x26c3('0x6a'));}return _0x2140df[_0x26c3('0x6f')](_0x47e109);}})[_0x26c3('0x20')](handleError(_0x2140df,null));};exports[_0x26c3('0x70')]=function(_0x9f668d,_0x3cf1f7){return db['Setting'][_0x26c3('0x4c')]({'where':{'id':_0x9f668d['params']['id']},'attributes':['securePassword']})[_0x26c3('0x16')](respondWithResult(_0x3cf1f7,null))['catch'](handleError(_0x3cf1f7,null));};
\ No newline at end of file
+var _0x49c4=['root','server/files/templates/stun.ejs','utf8','render','readFileSync','server/files/templates/turn.ejs','/etc/asterisk/stun_xcally.conf','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','file','body','logo','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','defaultLoginLogo','existsSync','toLower','default_logo.png','default','upperFirst','custom','Sequelize','Logo\x20not\x20found','download','getLogoLogin','default_loginLogo.png','ValidationError','gdpr','securePassword','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','jayson/promise','client','request','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','status','end','count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','name','Setting','rawAttributes','query','dateEnd','dateStart','keys','model','attributes','intersection','fields','length','order','sort','where','filters','pick','add','day','merge','filter','map','options','includeAll','include','findAll','rows','catch','show','params','find','get','join'];(function(_0x59f395,_0x1e04b5){var _0x4e0c32=function(_0x572407){while(--_0x572407){_0x59f395['push'](_0x59f395['shift']());}};_0x4e0c32(++_0x1e04b5);}(_0x49c4,0x9b));var _0x449c=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x49c4[_0x550d12];return _0x12103d;};'use strict';var pdf=require(_0x449c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x449c('0x1'));var zipdir=require(_0x449c('0x2'));var jsonpatch=require(_0x449c('0x3'));var rp=require(_0x449c('0x4'));var moment=require(_0x449c('0x5'));var BPromise=require(_0x449c('0x6'));var Mustache=require(_0x449c('0x7'));var util=require('util');var path=require('path');var sox=require(_0x449c('0x8'));var csv=require(_0x449c('0x9'));var ejs=require(_0x449c('0xa'));var fs=require('fs');var _=require(_0x449c('0xb'));var squel=require(_0x449c('0xc'));var crypto=require(_0x449c('0xd'));var jsforce=require(_0x449c('0xe'));var deskjs=require(_0x449c('0xf'));var toCsv=require(_0x449c('0x9'));var querystring=require(_0x449c('0x10'));var Papa=require(_0x449c('0x11'));var qs=require(_0x449c('0x12'));var logger=require(_0x449c('0x13'))(_0x449c('0x14'));var utils=require(_0x449c('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x449c('0x16'));var client=jayson[_0x449c('0x17')]['http']({'port':0x232a});function respondWithRpcPromise(_0x590bc7,_0x538cd1,_0x3e6303,_0x2d5610){return new BPromise(function(_0x181570,_0x2071e2){var _0x486d32=_0x2d5610||client;return _0x486d32[_0x449c('0x18')](_0x590bc7,_0x3e6303)['then'](function(_0x1818a9){logger['info'](_0x449c('0x19'),_0x538cd1,_0x449c('0x1a'));logger[_0x449c('0x1b')](_0x449c('0x1c'),_0x538cd1,_0x449c('0x1a'),JSON[_0x449c('0x1d')](_0x1818a9));if(_0x1818a9[_0x449c('0x1e')]){if(_0x1818a9[_0x449c('0x1e')][_0x449c('0x1f')]===0x1f4){logger[_0x449c('0x1e')]('Setting,\x20%s,\x20%s',_0x538cd1,_0x1818a9[_0x449c('0x1e')][_0x449c('0x20')]);return _0x2071e2(_0x1818a9[_0x449c('0x1e')][_0x449c('0x20')]);}logger[_0x449c('0x1e')]('Setting,\x20%s,\x20%s',_0x538cd1,_0x1818a9[_0x449c('0x1e')][_0x449c('0x20')]);return _0x181570(_0x1818a9[_0x449c('0x1e')][_0x449c('0x20')]);}else{logger[_0x449c('0x21')](_0x449c('0x19'),_0x538cd1,'request\x20sent');_0x181570(_0x1818a9[_0x449c('0x22')][_0x449c('0x20')]);}})['catch'](function(_0x31ff7b){logger[_0x449c('0x1e')](_0x449c('0x19'),_0x538cd1,_0x31ff7b);_0x2071e2(_0x31ff7b);});});}function respondWithStatusCode(_0x42c25f,_0x243d68){_0x243d68=_0x243d68||0xcc;return function(_0x2541fb){if(_0x2541fb){return _0x42c25f['sendStatus'](_0x243d68);}return _0x42c25f[_0x449c('0x23')](_0x243d68)[_0x449c('0x24')]();};}function respondWithResult(_0x4f06b3,_0x4dff4c){_0x4dff4c=_0x4dff4c||0xc8;return function(_0x4e983c){if(_0x4e983c){return _0x4f06b3[_0x449c('0x23')](_0x4dff4c)['json'](_0x4e983c);}};}function respondWithFilteredResult(_0x325305,_0x43fea6){return function(_0x2deffd){if(_0x2deffd){var _0x30512f=_0x2deffd[_0x449c('0x25')],_0x426f3a=_0x43fea6[_0x449c('0x26')],_0x3d8c69=_0x43fea6[_0x449c('0x26')]+_0x43fea6[_0x449c('0x27')],_0x30581e;if(_0x3d8c69>=_0x30512f){_0x3d8c69=_0x30512f;_0x30581e=0xc8;}else{_0x30581e=0xce;}_0x325305[_0x449c('0x23')](_0x30581e);return _0x325305[_0x449c('0x28')]('Content-Range',_0x426f3a+'-'+_0x3d8c69+'/'+_0x30512f)['json'](_0x2deffd);}return null;};}function patchUpdates(_0x390ada){return function(_0xa23b51){try{jsonpatch[_0x449c('0x29')](_0xa23b51,_0x390ada,!![]);}catch(_0x35757b){return BPromise[_0x449c('0x2a')](_0x35757b);}return _0xa23b51[_0x449c('0x2b')]();};}function saveUpdates(_0x2c59ec,_0x343e09){return function(_0x7e2ff3){if(_0x7e2ff3){return _0x7e2ff3[_0x449c('0x2c')](_0x2c59ec)[_0x449c('0x2d')](function(_0x35d405){return _0x35d405;});}return null;};}function removeEntity(_0x40f0f1,_0x1d0c30){return function(_0x18ce6e){if(_0x18ce6e){return _0x18ce6e[_0x449c('0x2e')]()[_0x449c('0x2d')](function(){_0x40f0f1[_0x449c('0x23')](0xcc)[_0x449c('0x24')]();});}};}function handleEntityNotFound(_0x373032,_0x5c49a1){return function(_0x384d4a){if(!_0x384d4a){_0x373032[_0x449c('0x2f')](0x194);}return _0x384d4a;};}function handleError(_0x22a243,_0x104a9a){_0x104a9a=_0x104a9a||0x1f4;return function(_0x1b94c0){logger[_0x449c('0x1e')](_0x1b94c0['stack']);if(_0x1b94c0[_0x449c('0x30')]){delete _0x1b94c0['name'];}_0x22a243[_0x449c('0x23')](_0x104a9a)['send'](_0x1b94c0);};}exports['index']=function(_0x537b98,_0x26a9f4){var _0x3f52ce={},_0x1a2ec5={},_0x4d079a={'count':0x0,'rows':[]};var _0x2c1b92=db[_0x449c('0x31')][_0x449c('0x32')];_0x1a2ec5['model']=_['keys'](_0x2c1b92);var _0x2bc2ca={'dateStart':_0x537b98['query']['dateStart'],'dateEnd':_0x537b98[_0x449c('0x33')][_0x449c('0x34')]};delete _0x537b98[_0x449c('0x33')][_0x449c('0x35')];delete _0x537b98[_0x449c('0x33')][_0x449c('0x34')];_0x1a2ec5[_0x449c('0x33')]=_[_0x449c('0x36')](_0x537b98[_0x449c('0x33')]);_0x1a2ec5['filters']=_['intersection'](_0x1a2ec5[_0x449c('0x37')],_0x1a2ec5[_0x449c('0x33')]);_0x3f52ce[_0x449c('0x38')]=_[_0x449c('0x39')](_0x1a2ec5[_0x449c('0x37')],qs[_0x449c('0x3a')](_0x537b98[_0x449c('0x33')]['fields']));_0x3f52ce[_0x449c('0x38')]=_0x3f52ce[_0x449c('0x38')][_0x449c('0x3b')]?_0x3f52ce[_0x449c('0x38')]:_0x1a2ec5[_0x449c('0x37')];if(!_0x537b98[_0x449c('0x33')]['hasOwnProperty']('nolimit')){_0x3f52ce['limit']=qs[_0x449c('0x27')](_0x537b98[_0x449c('0x33')][_0x449c('0x27')]);_0x3f52ce[_0x449c('0x26')]=qs[_0x449c('0x26')](_0x537b98['query']['offset']);}_0x3f52ce[_0x449c('0x3c')]=qs[_0x449c('0x3d')](_0x537b98[_0x449c('0x33')][_0x449c('0x3d')]);_0x3f52ce[_0x449c('0x3e')]=qs[_0x449c('0x3f')](_[_0x449c('0x40')](_0x537b98[_0x449c('0x33')],_0x1a2ec5['filters']));if(_0x2bc2ca[_0x449c('0x35')]){if(_0x2bc2ca['dateEnd']){_0x2bc2ca[_0x449c('0x34')]=moment(_0x2bc2ca[_0x449c('0x34')])[_0x449c('0x41')](0x1,_0x449c('0x42'));}else{_0x2bc2ca['dateEnd']=moment(_0x2bc2ca[_0x449c('0x35')])['add'](0x1,_0x449c('0x42'));}_[_0x449c('0x43')](_0x3f52ce['where'],{'createdAt':{'$gte':_0x2bc2ca[_0x449c('0x35')],'$lte':_0x2bc2ca['dateEnd']}});}if(_0x537b98[_0x449c('0x33')][_0x449c('0x44')]){_0x3f52ce[_0x449c('0x3e')]=_[_0x449c('0x43')](_0x3f52ce[_0x449c('0x3e')],{'$or':_[_0x449c('0x45')](_0x3f52ce['attributes'],function(_0x4a1c0d){var _0x4f8f43={};_0x4f8f43[_0x4a1c0d]={'$like':'%'+_0x537b98[_0x449c('0x33')][_0x449c('0x44')]+'%'};return _0x4f8f43;})});}_0x3f52ce=_[_0x449c('0x43')]({},_0x3f52ce,_0x537b98[_0x449c('0x46')]);var _0x4e3412={'where':_0x3f52ce[_0x449c('0x3e')]};return db[_0x449c('0x31')][_0x449c('0x25')](_0x4e3412)['then'](function(_0x5820e5){_0x4d079a[_0x449c('0x25')]=_0x5820e5;if(_0x537b98[_0x449c('0x33')][_0x449c('0x47')]){_0x3f52ce[_0x449c('0x48')]=[{'all':!![]}];}return db[_0x449c('0x31')][_0x449c('0x49')](_0x3f52ce);})[_0x449c('0x2d')](function(_0x4ab5f7){_0x4d079a[_0x449c('0x4a')]=_0x4ab5f7;return _0x4d079a;})[_0x449c('0x2d')](respondWithFilteredResult(_0x26a9f4,_0x3f52ce))[_0x449c('0x4b')](handleError(_0x26a9f4,null));};exports[_0x449c('0x4c')]=function(_0x39ab34,_0x41f799){var _0x201605={'raw':![],'where':{'id':_0x39ab34[_0x449c('0x4d')]['id']}},_0x1addd2={};_0x1addd2[_0x449c('0x37')]=_[_0x449c('0x36')](db[_0x449c('0x31')][_0x449c('0x32')]);_0x1addd2[_0x449c('0x33')]=_[_0x449c('0x36')](_0x39ab34[_0x449c('0x33')]);_0x1addd2[_0x449c('0x3f')]=_[_0x449c('0x39')](_0x1addd2[_0x449c('0x37')],_0x1addd2['query']);_0x201605[_0x449c('0x38')]=_['intersection'](_0x1addd2[_0x449c('0x37')],qs['fields'](_0x39ab34[_0x449c('0x33')][_0x449c('0x3a')]));_0x201605[_0x449c('0x38')]=_0x201605[_0x449c('0x38')][_0x449c('0x3b')]?_0x201605[_0x449c('0x38')]:_0x1addd2['model'];if(_0x39ab34[_0x449c('0x33')][_0x449c('0x47')]){_0x201605[_0x449c('0x48')]=[{'all':!![]}];}_0x201605=_[_0x449c('0x43')]({},_0x201605,_0x39ab34[_0x449c('0x46')]);return db[_0x449c('0x31')][_0x449c('0x4e')](_0x201605)[_0x449c('0x2d')](handleEntityNotFound(_0x41f799,null))[_0x449c('0x2d')](respondWithResult(_0x41f799,null))[_0x449c('0x4b')](handleError(_0x41f799,null));};exports[_0x449c('0x2c')]=function(_0x5bedec,_0x8acaef,_0x3c3e9d){var _0x2c86e1;return db[_0x449c('0x31')][_0x449c('0x4e')]({'where':{'id':_0x5bedec[_0x449c('0x4d')]['id']}})[_0x449c('0x2d')](handleEntityNotFound(_0x8acaef,null))[_0x449c('0x2d')](saveUpdates(_0x5bedec['body'],null))[_0x449c('0x2d')](function(_0x27dbf7){if(_0x27dbf7){_0x2c86e1=_0x27dbf7[_0x449c('0x4f')]({'plain':!![]});var _0x3fa6d5=fs['readFileSync'](path[_0x449c('0x50')](config[_0x449c('0x51')],_0x449c('0x52')),_0x449c('0x53'));var _0x354ec7=ejs[_0x449c('0x54')](_0x3fa6d5,_0x2c86e1);var _0x49f112=fs[_0x449c('0x55')](path[_0x449c('0x50')](config[_0x449c('0x51')],_0x449c('0x56')),_0x449c('0x53'));var _0x2e35c5=ejs[_0x449c('0x54')](_0x49f112,_0x2c86e1);fs['writeFileSync'](_0x449c('0x57'),_0x354ec7);fs[_0x449c('0x58')](_0x449c('0x59'),_0x2e35c5);return respondWithRpcPromise(_0x449c('0x5a'),_0x449c('0x2c'),{'module':_0x449c('0x5b')});}})['then'](function(){return respondWithRpcPromise(_0x449c('0x5a'),'update',{'module':_0x449c('0x5c')});})[_0x449c('0x2d')](function(){return _0x2c86e1||null;})[_0x449c('0x2d')](respondWithResult(_0x8acaef,null))[_0x449c('0x4b')](handleError(_0x8acaef,null));};exports['addLogo']=function(_0x1585cb,_0x55d333,_0x5554c8){if(_0x1585cb[_0x449c('0x5d')]&&_0x1585cb[_0x449c('0x5d')]['filename']){_0x1585cb[_0x449c('0x5e')][_0x449c('0x5f')]=_0x1585cb[_0x449c('0x5d')][_0x449c('0x60')];}return db[_0x449c('0x31')][_0x449c('0x4e')]({'where':{'id':_0x1585cb[_0x449c('0x4d')]['id']}})[_0x449c('0x2d')](handleEntityNotFound(_0x55d333,null))[_0x449c('0x2d')](saveUpdates(_0x1585cb[_0x449c('0x5e')],null))['then'](respondWithResult(_0x55d333,null))[_0x449c('0x4b')](handleError(_0x55d333,null));};exports[_0x449c('0x61')]=function(_0x1e363f,_0x356960,_0x382808){if(_0x1e363f[_0x449c('0x5d')]&&_0x1e363f['file']['filename']){_0x1e363f[_0x449c('0x5e')][_0x449c('0x62')]=_0x1e363f[_0x449c('0x5d')]['filename'];}return db[_0x449c('0x31')][_0x449c('0x4e')]({'where':{'id':_0x1e363f['params']['id']}})[_0x449c('0x2d')](handleEntityNotFound(_0x356960,null))[_0x449c('0x2d')](saveUpdates(_0x1e363f[_0x449c('0x5e')],null))['then'](respondWithResult(_0x356960,null))[_0x449c('0x4b')](handleError(_0x356960,null));};var utilLicense=require(_0x449c('0x63'));exports[_0x449c('0x64')]=function(_0x1e85c1,_0x2d91a2,_0x3cbf7e){var _0x553963=_0x449c('0x65');var _0x429c0d={'custom':![]};return utilLicense[_0x449c('0x66')]()['then'](function(_0x241f6d){if(_0x241f6d){_0x429c0d=_0x241f6d;}return db[_0x449c('0x31')][_0x449c('0x4e')]({'where':{'id':_0x1e85c1[_0x449c('0x4d')]['id']},'attributes':[_0x449c('0x5f'),_0x449c('0x62'),'defaultLogo',_0x449c('0x67')],'raw':!![]});})[_0x449c('0x2d')](handleEntityNotFound(_0x2d91a2,null))[_0x449c('0x2d')](function(_0xdc415f){if(_0xdc415f){var _0x703894=_0xdc415f[_0x449c('0x5f')]&&fs[_0x449c('0x68')](path[_0x449c('0x50')](config[_0x449c('0x51')],_0x553963,_[_0x449c('0x69')](_0xdc415f[_0x449c('0x5f')])))?path[_0x449c('0x50')](config[_0x449c('0x51')],_0x553963,_['toLower'](_0xdc415f[_0x449c('0x5f')])):path['join'](config[_0x449c('0x51')],_0x553963,_[_0x449c('0x69')](_0x449c('0x6a')));var _0x5896af=_0x449c('0x6b')+_[_0x449c('0x6c')](_0x449c('0x5f'));if(_0xdc415f[_0x5896af]||!_0x429c0d[_0x449c('0x6d')]){_0x703894=path[_0x449c('0x50')](config['root'],_0x553963,_[_0x449c('0x69')]('default_logo.png'));}if(!fs['existsSync'](_0x703894)){throw new db[(_0x449c('0x6e'))]['ValidationError'](_0x449c('0x6f'));}return _0x2d91a2[_0x449c('0x70')](_0x703894);}})[_0x449c('0x4b')](handleError(_0x2d91a2,null));};var utilLicense=require(_0x449c('0x63'));exports[_0x449c('0x71')]=function(_0x1366ee,_0x134570,_0x2a8127){var _0xeeab9b=_0x449c('0x65');var _0x5ab528={'custom':![]};return utilLicense[_0x449c('0x66')]()[_0x449c('0x2d')](function(_0x23d61d){if(_0x23d61d){_0x5ab528=_0x23d61d;}return db['Setting'][_0x449c('0x4e')]({'where':{'id':_0x1366ee[_0x449c('0x4d')]['id']},'attributes':[_0x449c('0x5f'),'loginLogo','defaultLogo',_0x449c('0x67')],'raw':!![]});})[_0x449c('0x2d')](handleEntityNotFound(_0x134570,null))[_0x449c('0x2d')](function(_0x299949){if(_0x299949){var _0x51c263=_0x299949[_0x449c('0x62')]&&fs[_0x449c('0x68')](path[_0x449c('0x50')](config[_0x449c('0x51')],_0xeeab9b,_[_0x449c('0x69')](_0x299949[_0x449c('0x62')])))?path[_0x449c('0x50')](config['root'],_0xeeab9b,_[_0x449c('0x69')](_0x299949[_0x449c('0x62')])):path[_0x449c('0x50')](config['root'],_0xeeab9b,_[_0x449c('0x69')](_0x449c('0x72')));var _0x5bbf19='default'+_[_0x449c('0x6c')](_0x449c('0x62'));if(_0x299949[_0x5bbf19]||!_0x5ab528[_0x449c('0x6d')]){_0x51c263=path['join'](config[_0x449c('0x51')],_0xeeab9b,_[_0x449c('0x69')](_0x449c('0x72')));}if(!fs['existsSync'](_0x51c263)){throw new db[(_0x449c('0x6e'))][(_0x449c('0x73'))](_0x449c('0x6f'));}return _0x134570[_0x449c('0x70')](_0x51c263);}})[_0x449c('0x4b')](handleError(_0x134570,null));};exports[_0x449c('0x74')]=function(_0x272a1c,_0x2ab80d){return db[_0x449c('0x31')][_0x449c('0x4e')]({'where':{'id':_0x272a1c[_0x449c('0x4d')]['id']},'attributes':[_0x449c('0x75')]})[_0x449c('0x2d')](respondWithResult(_0x2ab80d,null))[_0x449c('0x4b')](handleError(_0x2ab80d,null));};
\ No newline at end of file
index f23a351..5058f16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79f7=['../../config/logger','api','moment','bluebird','request-promise','exports','settings','lodash','util'];(function(_0x1a6bc2,_0x126f66){var _0x147952=function(_0x41f6fc){while(--_0x41f6fc){_0x1a6bc2['push'](_0x1a6bc2['shift']());}};_0x147952(++_0x126f66);}(_0x79f7,0x166));var _0x779f=function(_0x307a8f,_0x4c3010){_0x307a8f=_0x307a8f-0x0;var _0x5cfc86=_0x79f7[_0x307a8f];return _0x5cfc86;};'use strict';var _=require(_0x779f('0x0'));var util=require(_0x779f('0x1'));var logger=require(_0x779f('0x2'))(_0x779f('0x3'));var moment=require(_0x779f('0x4'));var BPromise=require(_0x779f('0x5'));var rp=require(_0x779f('0x6'));var attributes=require('./setting.attributes');module[_0x779f('0x7')]=function(_0x74a076,_0x158348){return _0x74a076['define']('Setting',attributes,{'tableName':_0x779f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e59=['exports','define','Setting','lodash','util','../../config/logger','moment','request-promise','./setting.attributes'];(function(_0x30ea95,_0x6bbe84){var _0x5e1a0b=function(_0x29d453){while(--_0x29d453){_0x30ea95['push'](_0x30ea95['shift']());}};_0x5e1a0b(++_0x6bbe84);}(_0x3e59,0x6f));var _0x93e5=function(_0x1a2ac5,_0x431ac7){_0x1a2ac5=_0x1a2ac5-0x0;var _0x2cedd0=_0x3e59[_0x1a2ac5];return _0x2cedd0;};'use strict';var _=require(_0x93e5('0x0'));var util=require(_0x93e5('0x1'));var logger=require(_0x93e5('0x2'))('api');var moment=require(_0x93e5('0x3'));var BPromise=require('bluebird');var rp=require(_0x93e5('0x4'));var attributes=require(_0x93e5('0x5'));module[_0x93e5('0x6')]=function(_0x45095d,_0x5a0feb){return _0x45095d[_0x93e5('0x7')](_0x93e5('0x8'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e062210..0a00362 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7a8=['info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','Setting,\x20%s,\x20%s','message'];(function(_0x333798,_0x9f6561){var _0x389f4e=function(_0x193b28){while(--_0x193b28){_0x333798['push'](_0x333798['shift']());}};_0x389f4e(++_0x9f6561);}(_0xe7a8,0x1a7));var _0x8e7a=function(_0x46c30c,_0x1ac896){_0x46c30c=_0x46c30c-0x0;var _0x45c5c1=_0xe7a8[_0x46c30c];return _0x45c5c1;};'use strict';var _=require('lodash');var util=require(_0x8e7a('0x0'));var moment=require(_0x8e7a('0x1'));var BPromise=require(_0x8e7a('0x2'));var rs=require(_0x8e7a('0x3'));var fs=require('fs');var db=require(_0x8e7a('0x4'))['db'];var utils=require(_0x8e7a('0x5'));var logger=require('../../config/logger')(_0x8e7a('0x6'));var config=require(_0x8e7a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8e7a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x367e7f,_0x4cde4d,_0x81c710){return new BPromise(function(_0x1e591b,_0x2fa7bf){return client[_0x8e7a('0x9')](_0x367e7f,_0x81c710)[_0x8e7a('0xa')](function(_0x2de557){logger['info']('Setting,\x20%s,\x20%s',_0x4cde4d,_0x8e7a('0xb'));logger[_0x8e7a('0xc')](_0x8e7a('0xd'),_0x4cde4d,_0x8e7a('0xb'),JSON['stringify'](_0x2de557));if(_0x2de557[_0x8e7a('0xe')]){if(_0x2de557[_0x8e7a('0xe')]['code']===0x1f4){logger[_0x8e7a('0xe')](_0x8e7a('0xf'),_0x4cde4d,_0x2de557[_0x8e7a('0xe')][_0x8e7a('0x10')]);return _0x2fa7bf(_0x2de557[_0x8e7a('0xe')][_0x8e7a('0x10')]);}logger['error'](_0x8e7a('0xf'),_0x4cde4d,_0x2de557[_0x8e7a('0xe')]['message']);return _0x1e591b(_0x2de557[_0x8e7a('0xe')][_0x8e7a('0x10')]);}else{logger[_0x8e7a('0x11')](_0x8e7a('0xf'),_0x4cde4d,_0x8e7a('0xb'));_0x1e591b(_0x2de557[_0x8e7a('0x12')][_0x8e7a('0x10')]);}})[_0x8e7a('0x13')](function(_0x3440cd){logger[_0x8e7a('0xe')](_0x8e7a('0xf'),_0x4cde4d,_0x3440cd);_0x2fa7bf(_0x3440cd);});});}
\ No newline at end of file
+var _0x7010=['result','catch','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x433a8d,_0x2cdc46){var _0x2f821b=function(_0xea0b93){while(--_0xea0b93){_0x433a8d['push'](_0x433a8d['shift']());}};_0x2f821b(++_0x2cdc46);}(_0x7010,0xb6));var _0x0701=function(_0x223a1a,_0x5e4926){_0x223a1a=_0x223a1a-0x0;var _0x17b523=_0x7010[_0x223a1a];return _0x17b523;};'use strict';var _=require(_0x0701('0x0'));var util=require(_0x0701('0x1'));var moment=require(_0x0701('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0x0701('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0701('0x4'))(_0x0701('0x5'));var config=require(_0x0701('0x6'));var jayson=require(_0x0701('0x7'));var client=jayson[_0x0701('0x8')][_0x0701('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b0a44,_0x1c7186,_0x1d32c1){return new BPromise(function(_0x120e71,_0x577328){return client['request'](_0x4b0a44,_0x1d32c1)[_0x0701('0xa')](function(_0x2fb177){logger[_0x0701('0xb')](_0x0701('0xc'),_0x1c7186,_0x0701('0xd'));logger[_0x0701('0xe')](_0x0701('0xf'),_0x1c7186,'request\x20sent',JSON['stringify'](_0x2fb177));if(_0x2fb177['error']){if(_0x2fb177[_0x0701('0x10')]['code']===0x1f4){logger[_0x0701('0x10')]('Setting,\x20%s,\x20%s',_0x1c7186,_0x2fb177[_0x0701('0x10')][_0x0701('0x11')]);return _0x577328(_0x2fb177[_0x0701('0x10')][_0x0701('0x11')]);}logger[_0x0701('0x10')](_0x0701('0xc'),_0x1c7186,_0x2fb177['error'][_0x0701('0x11')]);return _0x120e71(_0x2fb177[_0x0701('0x10')][_0x0701('0x11')]);}else{logger[_0x0701('0xb')](_0x0701('0xc'),_0x1c7186,_0x0701('0xd'));_0x120e71(_0x2fb177[_0x0701('0x12')][_0x0701('0x11')]);}})[_0x0701('0x13')](function(_0x164a74){logger[_0x0701('0x10')]('Setting,\x20%s,\x20%s',_0x1c7186,_0x164a74);_0x577328(_0x164a74);});});}
\ No newline at end of file
index 45439ca..70465c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dae=['addApplications','send','/:id/status','status','addAgents','update','delete','destroy','removeAnswers','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/notify'];(function(_0x13e453,_0x4ab30c){var _0x26aad2=function(_0x3387a1){while(--_0x3387a1){_0x13e453['push'](_0x13e453['shift']());}};_0x26aad2(++_0x4ab30c);}(_0x2dae,0xc3));var _0xe2da=function(_0x401ccd,_0x140815){_0x401ccd=_0x401ccd-0x0;var _0x5a57ad=_0x2dae[_0x401ccd];return _0x5a57ad;};'use strict';var multer=require(_0xe2da('0x0'));var util=require('util');var path=require(_0xe2da('0x1'));var express=require(_0xe2da('0x2'));var router=express[_0xe2da('0x3')]();var auth=require(_0xe2da('0x4'));var interaction=require(_0xe2da('0x5'));var config=require('../../config/environment');var controller=require(_0xe2da('0x6'));router[_0xe2da('0x7')]('/',auth[_0xe2da('0x8')](),controller[_0xe2da('0x9')]);router['get'](_0xe2da('0xa'),auth[_0xe2da('0x8')](),controller[_0xe2da('0xb')]);router[_0xe2da('0x7')](_0xe2da('0xc'),auth[_0xe2da('0x8')](),controller[_0xe2da('0xd')]);router[_0xe2da('0x7')](_0xe2da('0xe'),auth['isAuthenticated'](),controller[_0xe2da('0xf')]);router[_0xe2da('0x7')](_0xe2da('0x10'),auth[_0xe2da('0x8')](),controller[_0xe2da('0x11')]);router[_0xe2da('0x7')](_0xe2da('0x12'),auth[_0xe2da('0x8')](),controller['getApplications']);router[_0xe2da('0x7')]('/:id/interactions',auth[_0xe2da('0x8')](),controller[_0xe2da('0x13')]);router[_0xe2da('0x7')](_0xe2da('0x14'),auth[_0xe2da('0x8')](),controller[_0xe2da('0x15')]);router[_0xe2da('0x16')]('/',auth['isAuthenticated'](),controller[_0xe2da('0x17')]);router['post']('/:id/dispositions',auth[_0xe2da('0x8')](),controller[_0xe2da('0x18')]);router[_0xe2da('0x16')]('/:id/canned_answers',auth[_0xe2da('0x8')](),controller[_0xe2da('0x19')]);router[_0xe2da('0x16')](_0xe2da('0x1a'),controller['notify']);router[_0xe2da('0x16')](_0xe2da('0x12'),auth[_0xe2da('0x8')](),controller[_0xe2da('0x1b')]);router[_0xe2da('0x16')]('/:id/send',auth[_0xe2da('0x8')](),controller[_0xe2da('0x1c')]);router['post'](_0xe2da('0x1d'),controller[_0xe2da('0x1e')]);router[_0xe2da('0x16')](_0xe2da('0x14'),auth[_0xe2da('0x8')](),controller[_0xe2da('0x1f')]);router['put'](_0xe2da('0xc'),auth['isAuthenticated'](),controller[_0xe2da('0x20')]);router[_0xe2da('0x21')](_0xe2da('0xc'),auth[_0xe2da('0x8')](),controller[_0xe2da('0x22')]);router[_0xe2da('0x21')](_0xe2da('0xe'),auth[_0xe2da('0x8')](),controller['removeDispositions']);router[_0xe2da('0x21')](_0xe2da('0x10'),auth[_0xe2da('0x8')](),controller[_0xe2da('0x23')]);router[_0xe2da('0x21')](_0xe2da('0x14'),auth[_0xe2da('0x8')](),controller['removeAgents']);module[_0xe2da('0x24')]=router;
\ No newline at end of file
+var _0x8d08=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/users','create','addDisposition','post','addAnswer','/:id/notify','addApplications','/:id/status','addAgents','/:id','update','destroy','delete','removeDispositions','removeAgents','exports'];(function(_0x586967,_0x2ff049){var _0x3621eb=function(_0x245a53){while(--_0x245a53){_0x586967['push'](_0x586967['shift']());}};_0x3621eb(++_0x2ff049);}(_0x8d08,0x118));var _0x88d0=function(_0xeadc11,_0x27e378){_0xeadc11=_0xeadc11-0x0;var _0x4257b6=_0x8d08[_0xeadc11];return _0x4257b6;};'use strict';var multer=require(_0x88d0('0x0'));var util=require(_0x88d0('0x1'));var path=require(_0x88d0('0x2'));var express=require(_0x88d0('0x3'));var router=express[_0x88d0('0x4')]();var auth=require(_0x88d0('0x5'));var interaction=require(_0x88d0('0x6'));var config=require(_0x88d0('0x7'));var controller=require(_0x88d0('0x8'));router[_0x88d0('0x9')]('/',auth[_0x88d0('0xa')](),controller[_0x88d0('0xb')]);router['get'](_0x88d0('0xc'),auth[_0x88d0('0xa')](),controller['describe']);router[_0x88d0('0x9')]('/:id',auth[_0x88d0('0xa')](),controller['show']);router[_0x88d0('0x9')](_0x88d0('0xd'),auth[_0x88d0('0xa')](),controller['getDispositions']);router[_0x88d0('0x9')](_0x88d0('0xe'),auth['isAuthenticated'](),controller[_0x88d0('0xf')]);router['get'](_0x88d0('0x10'),auth[_0x88d0('0xa')](),controller[_0x88d0('0x11')]);router['get']('/:id/interactions',auth['isAuthenticated'](),controller[_0x88d0('0x12')]);router[_0x88d0('0x9')](_0x88d0('0x13'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x88d0('0xa')](),controller[_0x88d0('0x14')]);router['post'](_0x88d0('0xd'),auth[_0x88d0('0xa')](),controller[_0x88d0('0x15')]);router[_0x88d0('0x16')]('/:id/canned_answers',auth[_0x88d0('0xa')](),controller[_0x88d0('0x17')]);router[_0x88d0('0x16')](_0x88d0('0x18'),controller['notify']);router[_0x88d0('0x16')](_0x88d0('0x10'),auth['isAuthenticated'](),controller[_0x88d0('0x19')]);router[_0x88d0('0x16')]('/:id/send',auth[_0x88d0('0xa')](),controller['send']);router[_0x88d0('0x16')](_0x88d0('0x1a'),controller['status']);router[_0x88d0('0x16')](_0x88d0('0x13'),auth[_0x88d0('0xa')](),controller[_0x88d0('0x1b')]);router['put'](_0x88d0('0x1c'),auth[_0x88d0('0xa')](),controller[_0x88d0('0x1d')]);router['delete']('/:id',auth[_0x88d0('0xa')](),controller[_0x88d0('0x1e')]);router[_0x88d0('0x1f')](_0x88d0('0xd'),auth[_0x88d0('0xa')](),controller[_0x88d0('0x20')]);router[_0x88d0('0x1f')](_0x88d0('0xe'),auth[_0x88d0('0xa')](),controller['removeAnswers']);router[_0x88d0('0x1f')](_0x88d0('0x13'),auth[_0x88d0('0xa')](),controller[_0x88d0('0x21')]);module[_0x88d0('0x22')]=router;
\ No newline at end of file
index c2946fa..623f447 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16ab=['connectel','clicksend','plivo','basic','classic','classic+','BOOLEAN','TEXT','INTEGER','sequelize','exports','STRING','name','generate','ENUM','twilio','skebby'];(function(_0x3a1ab7,_0x144386){var _0x11c5ee=function(_0x57a599){while(--_0x57a599){_0x3a1ab7['push'](_0x3a1ab7['shift']());}};_0x11c5ee(++_0x144386);}(_0x16ab,0x6f));var _0xb16a=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x16ab[_0x4c445a];return _0x2f611c;};'use strict';var Sequelize=require(_0xb16a('0x0'));var rs=require('randomstring');module[_0xb16a('0x1')]={'name':{'type':Sequelize[_0xb16a('0x2')],'unique':_0xb16a('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xb16a('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xb16a('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xb16a('0x2')],'defaultValue':function(){return rs[_0xb16a('0x4')]();}},'phone':{'type':Sequelize[_0xb16a('0x2')]},'type':{'type':Sequelize[_0xb16a('0x5')](_0xb16a('0x6'),_0xb16a('0x7'),_0xb16a('0x8'),_0xb16a('0x9'),_0xb16a('0xa'))},'accountSid':{'type':Sequelize[_0xb16a('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xb16a('0x2')]},'smsMethod':{'type':Sequelize[_0xb16a('0x5')](_0xb16a('0xb'),_0xb16a('0xc'),_0xb16a('0xd'))},'username':{'type':Sequelize[_0xb16a('0x2')]},'password':{'type':Sequelize[_0xb16a('0x2')]},'senderString':{'type':Sequelize[_0xb16a('0x2')]},'deliveryReport':{'type':Sequelize[_0xb16a('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0xb16a('0x2')]},'notificationTemplate':{'type':Sequelize[_0xb16a('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xb16a('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb16a('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb16a('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb16a('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb16a('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb16a('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c}};
\ No newline at end of file
+var _0x6572=['BOOLEAN','INTEGER','sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','connectel','clicksend','plivo','basic','classic','classic+','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}'];(function(_0x2e18b6,_0x3beab7){var _0x1df8d9=function(_0x43b7d9){while(--_0x43b7d9){_0x2e18b6['push'](_0x2e18b6['shift']());}};_0x1df8d9(++_0x3beab7);}(_0x6572,0x18e));var _0x2657=function(_0x236fcc,_0x8bb5cb){_0x236fcc=_0x236fcc-0x0;var _0x1b2ffd=_0x6572[_0x236fcc];return _0x1b2ffd;};'use strict';var Sequelize=require(_0x2657('0x0'));var rs=require(_0x2657('0x1'));module[_0x2657('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x2657('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x2657('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x2657('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0x2657('0x4')],'defaultValue':function(){return rs[_0x2657('0x5')]();}},'phone':{'type':Sequelize[_0x2657('0x4')]},'type':{'type':Sequelize[_0x2657('0x6')](_0x2657('0x7'),'skebby',_0x2657('0x8'),_0x2657('0x9'),_0x2657('0xa'))},'accountSid':{'type':Sequelize[_0x2657('0x4')]},'authId':{'type':Sequelize[_0x2657('0x4')]},'authToken':{'type':Sequelize[_0x2657('0x4')]},'smsMethod':{'type':Sequelize[_0x2657('0x6')](_0x2657('0xb'),_0x2657('0xc'),_0x2657('0xd'))},'username':{'type':Sequelize[_0x2657('0x4')]},'password':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x2657('0x4')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x2657('0x4')]},'notificationTemplate':{'type':Sequelize[_0x2657('0xe')],'defaultValue':function(){return _0x2657('0xf');}},'notificationSound':{'type':Sequelize[_0x2657('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2657('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2657('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2657('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2657('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2657('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c}};
\ No newline at end of file
index b96c03a..0d74cbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e77=['entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','get','out','user','Messages','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','SmsMessage','requestid','statusInt','clicksend','status_code','DELIVERED','error_code','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','socket.io-emitter','localhost','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','send','index','SmsAccount','model','keys','query','dateEnd','dateStart','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','add','day','merge','filter','options','include','findAll','rows','show','params','rawAttributes','includeAll','create','body','find','describe','addDisposition','Disposition','getDispositions','nolimit','SmsAccountId','map','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','type','twilio','from','From','Body','messageId','MessageSid','sender','connectel','message_id','Text','MessageUUID','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','defaults','SmsInteraction','spread','interaction','created','autoclose','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage'];(function(_0x52d6f4,_0x174ab4){var _0x210d77=function(_0x210549){while(--_0x210549){_0x52d6f4['push'](_0x52d6f4['shift']());}};_0x210d77(++_0x174ab4);}(_0x6e77,0xef));var _0x76e7=function(_0x2c6bad,_0x29ffed){_0x2c6bad=_0x2c6bad-0x0;var _0x5f5435=_0x6e77[_0x2c6bad];return _0x5f5435;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x76e7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x76e7('0x1'));var rp=require(_0x76e7('0x2'));var moment=require('moment');var BPromise=require(_0x76e7('0x3'));var Mustache=require(_0x76e7('0x4'));var util=require(_0x76e7('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x76e7('0x6'));var ejs=require(_0x76e7('0x7'));var fs=require('fs');var _=require(_0x76e7('0x8'));var squel=require('squel');var crypto=require(_0x76e7('0x9'));var jsforce=require(_0x76e7('0xa'));var deskjs=require(_0x76e7('0xb'));var toCsv=require('to-csv');var querystring=require(_0x76e7('0xc'));var Papa=require(_0x76e7('0xd'));var qs=require('../../components/parsers/qs');var logger=require(_0x76e7('0xe'))(_0x76e7('0xf'));var utils=require(_0x76e7('0x10'));var config=require(_0x76e7('0x11'));var db=require('../../mysqldb')['db'];var socket=require(_0x76e7('0x12'))({'host':_0x76e7('0x13'),'port':0x18eb});require(_0x76e7('0x14'))[_0x76e7('0x15')](socket);var jayson=require(_0x76e7('0x16'));var client=jayson[_0x76e7('0x17')][_0x76e7('0x18')]({'port':0x232c});function respondWithRpcPromise(_0x3d9466,_0xbe7174,_0x2670f6,_0x44c0b7){return new BPromise(function(_0x5b4fc5,_0x2661d2){var _0x4cc38c=_0x44c0b7||client;return _0x4cc38c[_0x76e7('0x19')](_0x3d9466,_0x2670f6)[_0x76e7('0x1a')](function(_0x52e19a){logger[_0x76e7('0x1b')](_0x76e7('0x1c'),_0xbe7174,_0x76e7('0x1d'));logger[_0x76e7('0x1e')](_0x76e7('0x1f'),_0xbe7174,_0x76e7('0x1d'),JSON[_0x76e7('0x20')](_0x52e19a));if(_0x52e19a['error']){if(_0x52e19a[_0x76e7('0x21')]['code']===0x1f4){logger[_0x76e7('0x21')](_0x76e7('0x1c'),_0xbe7174,_0x52e19a[_0x76e7('0x21')][_0x76e7('0x22')]);return _0x2661d2(_0x52e19a[_0x76e7('0x21')]['message']);}logger[_0x76e7('0x21')]('SmsAccount,\x20%s,\x20%s',_0xbe7174,_0x52e19a[_0x76e7('0x21')][_0x76e7('0x22')]);return _0x5b4fc5(_0x52e19a[_0x76e7('0x21')][_0x76e7('0x22')]);}else{logger[_0x76e7('0x1b')](_0x76e7('0x1c'),_0xbe7174,_0x76e7('0x1d'));_0x5b4fc5(_0x52e19a[_0x76e7('0x23')][_0x76e7('0x22')]);}})[_0x76e7('0x24')](function(_0x86f6f9){logger[_0x76e7('0x21')](_0x76e7('0x1c'),_0xbe7174,_0x86f6f9);_0x2661d2(_0x86f6f9);});});}function respondWithStatusCode(_0x92d883,_0x58061d){_0x58061d=_0x58061d||0xcc;return function(_0x11afe6){if(_0x11afe6){return _0x92d883['sendStatus'](_0x58061d);}return _0x92d883[_0x76e7('0x25')](_0x58061d)[_0x76e7('0x26')]();};}function respondWithResult(_0x39b3f8,_0x40b2b4){_0x40b2b4=_0x40b2b4||0xc8;return function(_0x4c1bf7){if(_0x4c1bf7){return _0x39b3f8[_0x76e7('0x25')](_0x40b2b4)[_0x76e7('0x27')](_0x4c1bf7);}};}function respondWithFilteredResult(_0x4efde8,_0x8ce9e3){return function(_0x353c24){if(_0x353c24){var _0x38238c=_0x353c24[_0x76e7('0x28')],_0x471830=_0x8ce9e3[_0x76e7('0x29')],_0x4a1f67=_0x8ce9e3[_0x76e7('0x29')]+_0x8ce9e3[_0x76e7('0x2a')],_0x3d2b3c;if(_0x4a1f67>=_0x38238c){_0x4a1f67=_0x38238c;_0x3d2b3c=0xc8;}else{_0x3d2b3c=0xce;}_0x4efde8[_0x76e7('0x25')](_0x3d2b3c);return _0x4efde8[_0x76e7('0x2b')](_0x76e7('0x2c'),_0x471830+'-'+_0x4a1f67+'/'+_0x38238c)[_0x76e7('0x27')](_0x353c24);}return null;};}function patchUpdates(_0x38ea19){return function(_0x5f2039){try{jsonpatch[_0x76e7('0x2d')](_0x5f2039,_0x38ea19,!![]);}catch(_0x501b19){return BPromise[_0x76e7('0x2e')](_0x501b19);}return _0x5f2039[_0x76e7('0x2f')]();};}function saveUpdates(_0x1f598b,_0x4dc336){return function(_0x33e06b){if(_0x33e06b){return _0x33e06b[_0x76e7('0x30')](_0x1f598b)['then'](function(_0x2e1df3){return _0x2e1df3;});}return null;};}function removeEntity(_0x330874,_0x51d6c1){return function(_0x203bc1){if(_0x203bc1){return _0x203bc1[_0x76e7('0x31')]()['then'](function(){_0x330874[_0x76e7('0x25')](0xcc)[_0x76e7('0x26')]();});}};}function handleEntityNotFound(_0x227050,_0x5942b3){return function(_0x14bc10){if(!_0x14bc10){_0x227050[_0x76e7('0x32')](0x194);}return _0x14bc10;};}function handleError(_0x496c76,_0x3c1797){_0x3c1797=_0x3c1797||0x1f4;return function(_0x5759a0){logger[_0x76e7('0x21')](_0x5759a0[_0x76e7('0x33')]);if(_0x5759a0['name']){delete _0x5759a0['name'];}_0x496c76[_0x76e7('0x25')](_0x3c1797)[_0x76e7('0x34')](_0x5759a0);};}exports[_0x76e7('0x35')]=function(_0x260beb,_0x15c6bf){var _0x377d56={},_0x34a98f={},_0x419ae9={'count':0x0,'rows':[]};var _0x45a8c7=db[_0x76e7('0x36')]['rawAttributes'];_0x34a98f[_0x76e7('0x37')]=_[_0x76e7('0x38')](_0x45a8c7);var _0x3df720={'dateStart':_0x260beb[_0x76e7('0x39')]['dateStart'],'dateEnd':_0x260beb['query'][_0x76e7('0x3a')]};delete _0x260beb[_0x76e7('0x39')][_0x76e7('0x3b')];delete _0x260beb[_0x76e7('0x39')][_0x76e7('0x3a')];_0x34a98f['query']=_[_0x76e7('0x38')](_0x260beb['query']);_0x34a98f[_0x76e7('0x3c')]=_[_0x76e7('0x3d')](_0x34a98f[_0x76e7('0x37')],_0x34a98f[_0x76e7('0x39')]);_0x377d56[_0x76e7('0x3e')]=_[_0x76e7('0x3d')](_0x34a98f[_0x76e7('0x37')],qs['fields'](_0x260beb[_0x76e7('0x39')][_0x76e7('0x3f')]));_0x377d56[_0x76e7('0x3e')]=_0x377d56['attributes'][_0x76e7('0x40')]?_0x377d56['attributes']:_0x34a98f['model'];if(!_0x260beb[_0x76e7('0x39')][_0x76e7('0x41')]('nolimit')){_0x377d56[_0x76e7('0x2a')]=qs[_0x76e7('0x2a')](_0x260beb[_0x76e7('0x39')][_0x76e7('0x2a')]);_0x377d56['offset']=qs[_0x76e7('0x29')](_0x260beb[_0x76e7('0x39')][_0x76e7('0x29')]);}_0x377d56[_0x76e7('0x42')]=qs[_0x76e7('0x43')](_0x260beb['query']['sort']);_0x377d56[_0x76e7('0x44')]=qs[_0x76e7('0x3c')](_[_0x76e7('0x45')](_0x260beb[_0x76e7('0x39')],_0x34a98f[_0x76e7('0x3c')]));if(_0x3df720[_0x76e7('0x3b')]){if(_0x3df720[_0x76e7('0x3a')]){_0x3df720['dateEnd']=moment(_0x3df720[_0x76e7('0x3a')])[_0x76e7('0x46')](0x1,_0x76e7('0x47'));}else{_0x3df720[_0x76e7('0x3a')]=moment(_0x3df720[_0x76e7('0x3b')])[_0x76e7('0x46')](0x1,_0x76e7('0x47'));}_[_0x76e7('0x48')](_0x377d56['where'],{'createdAt':{'$gte':_0x3df720[_0x76e7('0x3b')],'$lte':_0x3df720['dateEnd']}});}if(_0x260beb[_0x76e7('0x39')]['filter']){_0x377d56[_0x76e7('0x44')]=_[_0x76e7('0x48')](_0x377d56['where'],{'$or':_['map'](_0x377d56[_0x76e7('0x3e')],function(_0x23cdd8){var _0x4b11b3={};_0x4b11b3[_0x23cdd8]={'$like':'%'+_0x260beb[_0x76e7('0x39')][_0x76e7('0x49')]+'%'};return _0x4b11b3;})});}_0x377d56=_[_0x76e7('0x48')]({},_0x377d56,_0x260beb[_0x76e7('0x4a')]);var _0x5d2bc5={'where':_0x377d56[_0x76e7('0x44')]};return db[_0x76e7('0x36')][_0x76e7('0x28')](_0x5d2bc5)[_0x76e7('0x1a')](function(_0x4701cc){_0x419ae9[_0x76e7('0x28')]=_0x4701cc;if(_0x260beb[_0x76e7('0x39')]['includeAll']){_0x377d56[_0x76e7('0x4b')]=[{'all':!![]}];}return db[_0x76e7('0x36')][_0x76e7('0x4c')](_0x377d56);})[_0x76e7('0x1a')](function(_0x522104){_0x419ae9[_0x76e7('0x4d')]=_0x522104;return _0x419ae9;})[_0x76e7('0x1a')](respondWithFilteredResult(_0x15c6bf,_0x377d56))[_0x76e7('0x24')](handleError(_0x15c6bf,null));};exports[_0x76e7('0x4e')]=function(_0x27bfd5,_0x70ef1a){var _0x37c61e={'raw':![],'where':{'id':_0x27bfd5[_0x76e7('0x4f')]['id']}},_0xdf8216={};_0xdf8216['model']=_[_0x76e7('0x38')](db[_0x76e7('0x36')][_0x76e7('0x50')]);_0xdf8216[_0x76e7('0x39')]=_['keys'](_0x27bfd5['query']);_0xdf8216[_0x76e7('0x3c')]=_[_0x76e7('0x3d')](_0xdf8216[_0x76e7('0x37')],_0xdf8216['query']);_0x37c61e[_0x76e7('0x3e')]=_[_0x76e7('0x3d')](_0xdf8216[_0x76e7('0x37')],qs['fields'](_0x27bfd5[_0x76e7('0x39')][_0x76e7('0x3f')]));_0x37c61e[_0x76e7('0x3e')]=_0x37c61e[_0x76e7('0x3e')][_0x76e7('0x40')]?_0x37c61e[_0x76e7('0x3e')]:_0xdf8216[_0x76e7('0x37')];if(_0x27bfd5[_0x76e7('0x39')][_0x76e7('0x51')]){_0x37c61e['include']=[{'all':!![]}];}_0x37c61e=_[_0x76e7('0x48')]({},_0x37c61e,_0x27bfd5[_0x76e7('0x4a')]);return db[_0x76e7('0x36')]['find'](_0x37c61e)[_0x76e7('0x1a')](handleEntityNotFound(_0x70ef1a,null))[_0x76e7('0x1a')](respondWithResult(_0x70ef1a,null))[_0x76e7('0x24')](handleError(_0x70ef1a,null));};exports['create']=function(_0x7cac35,_0x45f0ad){return db[_0x76e7('0x36')][_0x76e7('0x52')](_0x7cac35['body'],{})[_0x76e7('0x1a')](respondWithResult(_0x45f0ad,0xc9))[_0x76e7('0x24')](handleError(_0x45f0ad,null));};exports[_0x76e7('0x30')]=function(_0x13eae2,_0x567bab){if(_0x13eae2[_0x76e7('0x53')]['id']){delete _0x13eae2[_0x76e7('0x53')]['id'];}return db[_0x76e7('0x36')][_0x76e7('0x54')]({'where':{'id':_0x13eae2[_0x76e7('0x4f')]['id']}})[_0x76e7('0x1a')](handleEntityNotFound(_0x567bab,null))[_0x76e7('0x1a')](saveUpdates(_0x13eae2[_0x76e7('0x53')],null))[_0x76e7('0x1a')](respondWithResult(_0x567bab,null))[_0x76e7('0x24')](handleError(_0x567bab,null));};exports[_0x76e7('0x31')]=function(_0x4e7d8b,_0xd2731){return db[_0x76e7('0x36')][_0x76e7('0x54')]({'where':{'id':_0x4e7d8b[_0x76e7('0x4f')]['id']}})[_0x76e7('0x1a')](handleEntityNotFound(_0xd2731,null))['then'](removeEntity(_0xd2731,null))[_0x76e7('0x24')](handleError(_0xd2731,null));};exports['describe']=function(_0x55df34,_0x3a5db0){return db['SmsAccount'][_0x76e7('0x55')]()[_0x76e7('0x1a')](respondWithResult(_0x3a5db0,null))[_0x76e7('0x24')](handleError(_0x3a5db0,null));};exports[_0x76e7('0x56')]=function(_0x643ddf,_0x4ed6ed,_0x253d07){if(_0x643ddf[_0x76e7('0x53')]['id']){delete _0x643ddf['body']['id'];}return db['SmsAccount']['find']({'where':{'id':_0x643ddf[_0x76e7('0x4f')]['id']}})[_0x76e7('0x1a')](handleEntityNotFound(_0x4ed6ed,null))[_0x76e7('0x1a')](function(_0x3bb4be){if(_0x3bb4be){_0x643ddf[_0x76e7('0x53')]['SmsAccountId']=_0x3bb4be['id'];return db[_0x76e7('0x57')][_0x76e7('0x52')](_0x643ddf['body']);}})['then'](respondWithResult(_0x4ed6ed,null))[_0x76e7('0x24')](handleError(_0x4ed6ed,null));};exports[_0x76e7('0x58')]=function(_0x2e46f5,_0x29e380,_0x3743c9){var _0x56eff7={'raw':![],'where':{}};var _0x53ed5b={};var _0x5c2f7e={'count':0x0,'rows':[]};return db[_0x76e7('0x36')]['findOne']({'where':{'id':_0x2e46f5[_0x76e7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x29e380,null))[_0x76e7('0x1a')](function(_0x321084){if(_0x321084){_0x53ed5b['model']=_[_0x76e7('0x38')](db[_0x76e7('0x57')][_0x76e7('0x50')]);_0x53ed5b[_0x76e7('0x39')]=_['keys'](_0x2e46f5[_0x76e7('0x39')]);_0x53ed5b[_0x76e7('0x3c')]=_[_0x76e7('0x3d')](_0x53ed5b['model'],_0x53ed5b[_0x76e7('0x39')]);_0x56eff7[_0x76e7('0x3e')]=_[_0x76e7('0x3d')](_0x53ed5b['model'],qs[_0x76e7('0x3f')](_0x2e46f5[_0x76e7('0x39')]['fields']));_0x56eff7[_0x76e7('0x3e')]=_0x56eff7[_0x76e7('0x3e')]['length']?_0x56eff7[_0x76e7('0x3e')]:_0x53ed5b['model'];if(!_0x2e46f5[_0x76e7('0x39')]['hasOwnProperty'](_0x76e7('0x59'))){_0x56eff7[_0x76e7('0x2a')]=qs['limit'](_0x2e46f5['query'][_0x76e7('0x2a')]);_0x56eff7[_0x76e7('0x29')]=qs[_0x76e7('0x29')](_0x2e46f5[_0x76e7('0x39')][_0x76e7('0x29')]);}_0x56eff7[_0x76e7('0x42')]=qs[_0x76e7('0x43')](_0x2e46f5[_0x76e7('0x39')][_0x76e7('0x43')]);_0x56eff7[_0x76e7('0x44')]=qs[_0x76e7('0x3c')](_['pick'](_0x2e46f5[_0x76e7('0x39')],_0x53ed5b[_0x76e7('0x3c')]));_0x56eff7[_0x76e7('0x44')][_0x76e7('0x5a')]=_0x321084['id'];if(_0x2e46f5['query'][_0x76e7('0x49')]){_0x56eff7[_0x76e7('0x44')]=_['merge'](_0x56eff7[_0x76e7('0x44')],{'$or':_[_0x76e7('0x5b')](_0x56eff7[_0x76e7('0x3e')],function(_0x22ac59){var _0x58feb4={};_0x58feb4[_0x22ac59]={'$like':'%'+_0x2e46f5[_0x76e7('0x39')][_0x76e7('0x49')]+'%'};return _0x58feb4;})});}_0x56eff7=_['merge']({},_0x56eff7,_0x2e46f5[_0x76e7('0x4a')]);return db[_0x76e7('0x57')][_0x76e7('0x28')]({'where':_0x56eff7[_0x76e7('0x44')]})[_0x76e7('0x1a')](function(_0xd3a773){_0x5c2f7e[_0x76e7('0x28')]=_0xd3a773;if(_0x2e46f5['query'][_0x76e7('0x51')]){_0x56eff7[_0x76e7('0x4b')]=[{'all':!![]}];}return db[_0x76e7('0x57')][_0x76e7('0x4c')](_0x56eff7);})[_0x76e7('0x1a')](function(_0x3a4920){_0x5c2f7e[_0x76e7('0x4d')]=_0x3a4920;return _0x5c2f7e;});}})[_0x76e7('0x1a')](respondWithFilteredResult(_0x29e380,_0x56eff7))[_0x76e7('0x24')](handleError(_0x29e380,null));};exports[_0x76e7('0x5c')]=function(_0x133ea5,_0x633f71,_0xdd7d46){var _0x353a68;return db[_0x76e7('0x36')][_0x76e7('0x54')]({'where':{'id':_0x133ea5['params']['id']}})[_0x76e7('0x1a')](handleEntityNotFound(_0x633f71,null))[_0x76e7('0x1a')](function(_0x47db55){if(_0x47db55){return _0x47db55['removeDispositions'](_0x133ea5[_0x76e7('0x39')][_0x76e7('0x5d')]);}})[_0x76e7('0x1a')](respondWithStatusCode(_0x633f71,null))[_0x76e7('0x24')](handleError(_0x633f71,null));};exports['addAnswer']=function(_0x41ffc7,_0x2563e8,_0x4c0459){if(_0x41ffc7[_0x76e7('0x53')]['id']){delete _0x41ffc7[_0x76e7('0x53')]['id'];}return db[_0x76e7('0x36')][_0x76e7('0x54')]({'where':{'id':_0x41ffc7[_0x76e7('0x4f')]['id']}})[_0x76e7('0x1a')](handleEntityNotFound(_0x2563e8,null))[_0x76e7('0x1a')](function(_0x5140e2){if(_0x5140e2){_0x41ffc7['body']['SmsAccountId']=_0x5140e2['id'];return db[_0x76e7('0x5e')]['create'](_0x41ffc7[_0x76e7('0x53')]);}})[_0x76e7('0x1a')](respondWithResult(_0x2563e8,null))[_0x76e7('0x24')](handleError(_0x2563e8,null));};exports[_0x76e7('0x5f')]=function(_0xa1c5da,_0x40c685,_0x324568){var _0x328219={'raw':![],'where':{}};var _0x15c053={};var _0x2345be={'count':0x0,'rows':[]};return db['SmsAccount'][_0x76e7('0x60')]({'where':{'id':_0xa1c5da[_0x76e7('0x4f')]['id']}})[_0x76e7('0x1a')](handleEntityNotFound(_0x40c685,null))[_0x76e7('0x1a')](function(_0x4d56da){if(_0x4d56da){_0x15c053[_0x76e7('0x37')]=_['keys'](db[_0x76e7('0x5e')][_0x76e7('0x50')]);_0x15c053[_0x76e7('0x39')]=_[_0x76e7('0x38')](_0xa1c5da[_0x76e7('0x39')]);_0x15c053[_0x76e7('0x3c')]=_[_0x76e7('0x3d')](_0x15c053[_0x76e7('0x37')],_0x15c053[_0x76e7('0x39')]);_0x328219[_0x76e7('0x3e')]=_[_0x76e7('0x3d')](_0x15c053[_0x76e7('0x37')],qs[_0x76e7('0x3f')](_0xa1c5da['query'][_0x76e7('0x3f')]));_0x328219[_0x76e7('0x3e')]=_0x328219[_0x76e7('0x3e')][_0x76e7('0x40')]?_0x328219['attributes']:_0x15c053[_0x76e7('0x37')];if(!_0xa1c5da[_0x76e7('0x39')][_0x76e7('0x41')]('nolimit')){_0x328219[_0x76e7('0x2a')]=qs['limit'](_0xa1c5da[_0x76e7('0x39')][_0x76e7('0x2a')]);_0x328219[_0x76e7('0x29')]=qs[_0x76e7('0x29')](_0xa1c5da['query'][_0x76e7('0x29')]);}_0x328219['order']=qs[_0x76e7('0x43')](_0xa1c5da['query'][_0x76e7('0x43')]);_0x328219['where']=qs['filters'](_[_0x76e7('0x45')](_0xa1c5da[_0x76e7('0x39')],_0x15c053[_0x76e7('0x3c')]));_0x328219[_0x76e7('0x44')][_0x76e7('0x5a')]=_0x4d56da['id'];if(_0xa1c5da[_0x76e7('0x39')][_0x76e7('0x49')]){_0x328219[_0x76e7('0x44')]=_[_0x76e7('0x48')](_0x328219['where'],{'$or':_['map'](_0x328219['attributes'],function(_0x1dee9e){var _0x4c1f75={};_0x4c1f75[_0x1dee9e]={'$like':'%'+_0xa1c5da[_0x76e7('0x39')][_0x76e7('0x49')]+'%'};return _0x4c1f75;})});}_0x328219=_[_0x76e7('0x48')]({},_0x328219,_0xa1c5da[_0x76e7('0x4a')]);return db[_0x76e7('0x5e')][_0x76e7('0x28')]({'where':_0x328219[_0x76e7('0x44')]})[_0x76e7('0x1a')](function(_0x4ad1bf){_0x2345be[_0x76e7('0x28')]=_0x4ad1bf;if(_0xa1c5da[_0x76e7('0x39')][_0x76e7('0x51')]){_0x328219[_0x76e7('0x4b')]=[{'all':!![]}];}return db[_0x76e7('0x5e')][_0x76e7('0x4c')](_0x328219);})[_0x76e7('0x1a')](function(_0x341dae){_0x2345be[_0x76e7('0x4d')]=_0x341dae;return _0x2345be;});}})['then'](respondWithFilteredResult(_0x40c685,_0x328219))[_0x76e7('0x24')](handleError(_0x40c685,null));};exports[_0x76e7('0x61')]=function(_0x38dbb4,_0x29094d,_0xeedf47){var _0x37962b;return db[_0x76e7('0x36')][_0x76e7('0x54')]({'where':{'id':_0x38dbb4[_0x76e7('0x4f')]['id']}})[_0x76e7('0x1a')](handleEntityNotFound(_0x29094d,null))['then'](function(_0x35c3b0){if(_0x35c3b0){return _0x35c3b0[_0x76e7('0x61')](_0x38dbb4['query'][_0x76e7('0x5d')]);}})[_0x76e7('0x1a')](respondWithStatusCode(_0x29094d,null))['catch'](handleError(_0x29094d,null));};exports['notify']=function(_0x475f3e,_0x14c3aa,_0x3335a4){var _0x34db22={'channel':_0x76e7('0x62')};var _0x103d51=[];var _0x5c3f98=[];var _0x2cfeff={};return db[_0x76e7('0x36')][_0x76e7('0x54')]({'where':{'id':_0x475f3e[_0x76e7('0x4f')]['id']},'include':[{'model':db[_0x76e7('0x63')],'as':_0x76e7('0x64')}]})[_0x76e7('0x1a')](handleEntityNotFound(_0x14c3aa,null))['then'](function(_0xe6b7f){_0x34db22[_0x76e7('0x65')]=_0xe6b7f;_0x34db22[_0x76e7('0x66')]=_[_0x76e7('0x67')](_0xe6b7f[_0x76e7('0x64')],[_0x76e7('0x68')],[_0x76e7('0x69')]);if(_0x34db22[_0x76e7('0x65')][_0x76e7('0x64')]){delete _0x34db22['account'][_0x76e7('0x64')];}return db[_0x76e7('0x6a')]['describe']();})[_0x76e7('0x1a')](function(_0x5641fc){if(!_0x5641fc){throw new db['Sequelize'][(_0x76e7('0x6b'))](_0x76e7('0x6c'));}_0x103d51=_[_0x76e7('0x6d')](_[_0x76e7('0x38')](_0x5641fc),[_0x76e7('0x6e'),_0x76e7('0x6f')]);_0x5c3f98=_[_0x76e7('0x6d')](_[_0x76e7('0x38')](_0x5641fc),['createdAt','updatedAt','CompanyId',_0x76e7('0x70')]);_0x34db22[_0x76e7('0x53')]={'mapKey':_0x76e7('0x71')};if(_0x34db22[_0x76e7('0x65')]['type']){switch(_0x34db22[_0x76e7('0x65')][_0x76e7('0x72')]){case _0x76e7('0x73'):_0x34db22[_0x76e7('0x53')][_0x76e7('0x74')]=_0x475f3e[_0x76e7('0x53')][_0x76e7('0x75')];_0x34db22[_0x76e7('0x53')]['body']=_0x475f3e[_0x76e7('0x53')][_0x76e7('0x76')];_0x34db22['body'][_0x76e7('0x77')]=_0x475f3e['body'][_0x76e7('0x78')];break;case'skebby':_0x34db22[_0x76e7('0x53')][_0x76e7('0x74')]=_0x475f3e[_0x76e7('0x53')][_0x76e7('0x79')];_0x34db22['body'][_0x76e7('0x53')]=_0x475f3e['body']['text'];break;case _0x76e7('0x7a'):_0x34db22[_0x76e7('0x53')][_0x76e7('0x74')]=_0x475f3e[_0x76e7('0x53')][_0x76e7('0x74')];_0x34db22['body'][_0x76e7('0x53')]=_0x475f3e[_0x76e7('0x53')]['message'];break;case'clicksend':_0x34db22[_0x76e7('0x53')][_0x76e7('0x74')]=_0x475f3e[_0x76e7('0x53')]['from'];_0x34db22[_0x76e7('0x53')][_0x76e7('0x53')]=_0x475f3e['body'][_0x76e7('0x53')];_0x34db22[_0x76e7('0x53')][_0x76e7('0x77')]=_0x475f3e[_0x76e7('0x53')][_0x76e7('0x7b')];break;case'plivo':_0x34db22['body'][_0x76e7('0x74')]=_0x475f3e[_0x76e7('0x53')][_0x76e7('0x75')];_0x34db22[_0x76e7('0x53')][_0x76e7('0x53')]=_0x475f3e['body'][_0x76e7('0x7c')];_0x34db22[_0x76e7('0x53')][_0x76e7('0x77')]=_0x475f3e[_0x76e7('0x53')][_0x76e7('0x7d')];break;}}if(_0x34db22['body']['id']){delete _0x34db22['body']['id'];}if(_[_0x76e7('0x7e')](_0x34db22[_0x76e7('0x53')]['from'])){throw new db[(_0x76e7('0x7f'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x34db22[_0x76e7('0x53')][_0x76e7('0x53')])||_0x34db22[_0x76e7('0x53')][_0x76e7('0x53')]===''){throw new db[(_0x76e7('0x7f'))][(_0x76e7('0x6b'))](_0x76e7('0x80'));}if(_[_0x76e7('0x7e')](_0x34db22[_0x76e7('0x53')][_0x76e7('0x81')])){throw new db['Sequelize']['ValidationError'](_0x76e7('0x82')+_0x5c3f98);}if(!_[_0x76e7('0x83')](_0x5c3f98,_0x34db22[_0x76e7('0x53')][_0x76e7('0x81')])){throw new db[(_0x76e7('0x7f'))][(_0x76e7('0x6b'))](_0x76e7('0x84')+_0x5c3f98);}_0x2cfeff[_0x34db22[_0x76e7('0x53')][_0x76e7('0x81')]]=_0x34db22[_0x76e7('0x53')][_0x76e7('0x74')];return db[_0x76e7('0x85')][_0x76e7('0x54')]({'where':{'id':_0x34db22[_0x76e7('0x65')][_0x76e7('0x70')]},'include':[{'model':db[_0x76e7('0x6a')],'as':_0x76e7('0x86'),'where':_0x2cfeff,'limit':0x1,'order':[['updatedAt',_0x76e7('0x87')]]}]});})[_0x76e7('0x1a')](handleEntityNotFound(_0x14c3aa,null))[_0x76e7('0x1a')](function(_0x464d5b){if(_0x464d5b){_0x34db22[_0x76e7('0x88')]=_[_0x76e7('0x89')](_0x464d5b,['Contacts']);if(_0x464d5b['Contacts'][_0x76e7('0x40')]){return _0x464d5b['Contacts'][0x0];}var _0xea971a=_[_0x76e7('0x8a')](_0x34db22['body'],{'firstName':_0x34db22[_0x76e7('0x53')][_0x76e7('0x74')],'ListId':_0x464d5b['id']});_0xea971a[_0x34db22[_0x76e7('0x53')][_0x76e7('0x81')]]=_0x34db22[_0x76e7('0x53')][_0x76e7('0x74')];return db[_0x76e7('0x6a')][_0x76e7('0x52')](_0xea971a,{'fields':_0x103d51,'raw':!![]});}})['then'](handleEntityNotFound(_0x14c3aa,null))[_0x76e7('0x1a')](function(_0x94273){if(_0x94273){_0x34db22['contact']=_0x94273;var _0x443962={'ContactId':_0x94273['id'],'phone':_0x34db22['body'][_0x76e7('0x74')],'SmsAccountId':_0x475f3e['params']['id']};var _0x2d08ea={'ContactId':_0x94273['id'],'SmsAccountId':_0x475f3e[_0x76e7('0x4f')]['id'],'closed':![]};return db[_0x76e7('0x8b')][_0x76e7('0x54')]({'where':_0x2d08ea})[_0x76e7('0x1a')](function(_0x4be6bc){if(_0x4be6bc){return[_0x4be6bc,![]];}return db[_0x76e7('0x8b')]['create'](_0x443962)[_0x76e7('0x1a')](function(_0x1e12d5){return[_0x1e12d5,!![]];});});}})[_0x76e7('0x8c')](function(_0x55aa31,_0x2faa57){_0x34db22[_0x76e7('0x8d')]=_0x55aa31['get']({'plain':!![]});_0x34db22[_0x76e7('0x8d')][_0x76e7('0x8e')]=![];if(_0x2faa57){if(_0x34db22['account'][_0x76e7('0x8f')]){_0x34db22[_0x76e7('0x66')]['push']({'id':0x0,'priority':_0x34db22[_0x76e7('0x66')][_0x76e7('0x40')]+0x1,'app':_0x76e7('0x90'),'appdata':_0x76e7('0x91'),'interval':_0x76e7('0x92')});}_0x34db22['interaction']['created']=!![];}return db['SmsMessage'][_0x76e7('0x52')]({'phone':_0x34db22[_0x76e7('0x53')][_0x76e7('0x74')],'messageId':_0x34db22[_0x76e7('0x53')][_0x76e7('0x77')],'body':_0x34db22[_0x76e7('0x53')]['body'],'SmsAccountId':_0x475f3e['params']['id'],'SmsInteractionId':_0x55aa31['id'],'direction':'in','ContactId':_0x55aa31['ContactId'],'AttachmentId':_0x34db22[_0x76e7('0x53')][_0x76e7('0x93')]});})[_0x76e7('0x1a')](function(_0x1a24bf){_0x34db22['message']=_0x1a24bf;if(_0x34db22[_0x76e7('0x8d')][_0x76e7('0x94')]){return db[_0x76e7('0x95')][_0x76e7('0x54')]({'attributes':['id',_0x76e7('0x96')],'where':{'id':_0x34db22[_0x76e7('0x8d')]['UserId']}})[_0x76e7('0x1a')](function(_0x53e3c4){if(_0x53e3c4){_0x34db22[_0x76e7('0x66')][_0x76e7('0x97')]({'id':0x0,'priority':0x0,'app':_0x76e7('0x98'),'appdata':_0x53e3c4[_0x76e7('0x96')]+','+(_0x34db22[_0x76e7('0x65')][_0x76e7('0x99')]||0xa),'interval':_0x76e7('0x92')});}return respondWithRpcPromise('Start',_0x76e7('0x9a'),_0x34db22);});}return respondWithRpcPromise(_0x76e7('0x9b'),_0x76e7('0x9a'),_0x34db22);})[_0x76e7('0x1a')](function(_0x518859){if(_0x518859){var _0x4ec982=0xc8;var _0x1a62b6=_0x76e7('0x9c');logger[_0x76e7('0x1b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1a62b6,_0x4ec982,_0x76e7('0x9d'));logger[_0x76e7('0x1e')](_0x76e7('0x9e'),_0x1a62b6,_0x4ec982,_0x76e7('0x9d'),JSON[_0x76e7('0x20')](_0x518859));if(_0x34db22[_0x76e7('0x65')]['type']==='twilio'){return _0x14c3aa[_0x76e7('0x25')](_0x4ec982)['set'](_0x76e7('0x9f'),_0x76e7('0xa0'))[_0x76e7('0x34')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x14c3aa[_0x76e7('0x25')](_0x4ec982)[_0x76e7('0x27')](_0x518859);}}})['catch'](handleError(_0x14c3aa,null));};exports[_0x76e7('0xa1')]=function(_0x191fc5,_0x315088,_0x3d2b64){return db['SmsAccount'][_0x76e7('0x60')]({'where':{'id':_0x191fc5[_0x76e7('0x4f')]['id']}})[_0x76e7('0x1a')](handleEntityNotFound(_0x315088,null))['then'](function(_0x467be9){if(_0x467be9){return db[_0x76e7('0xa2')][_0x76e7('0xa3')](function(_0x315eb6){return db[_0x76e7('0x63')]['destroy']({'where':{'SmsAccountId':_0x191fc5[_0x76e7('0x4f')]['id']},'transaction':_0x315eb6})['then'](function(_0x224d0a){var _0x58f360=_[_0x76e7('0x5b')](_0x191fc5['body'],function(_0x3b4760){_0x3b4760[_0x76e7('0x5a')]=_0x191fc5['params']['id'];return _0x3b4760;});return db[_0x76e7('0x63')][_0x76e7('0xa4')](_0x58f360,{'transaction':_0x315eb6});});})[_0x76e7('0x1a')](function(){return db[_0x76e7('0x63')][_0x76e7('0xa5')]({'where':{'SmsAccountId':_0x191fc5[_0x76e7('0x4f')]['id']},'order':_0x76e7('0x68')});});}})[_0x76e7('0x1a')](respondWithResult(_0x315088,null))[_0x76e7('0x24')](handleError(_0x315088,null));};exports['getApplications']=function(_0xe3c0cf,_0x564c53,_0x43473d){var _0x503634={};var _0x51b31f={};var _0x2027c4;var _0x7f1e2b;return db[_0x76e7('0x36')][_0x76e7('0x60')]({'where':{'id':_0xe3c0cf['params']['id']}})[_0x76e7('0x1a')](handleEntityNotFound(_0x564c53,null))[_0x76e7('0x1a')](function(_0x3f29c1){if(_0x3f29c1){_0x2027c4=_0x3f29c1;_0x51b31f[_0x76e7('0x37')]=_[_0x76e7('0x38')](db['SmsApplication'][_0x76e7('0x50')]);_0x51b31f[_0x76e7('0x39')]=_[_0x76e7('0x38')](_0xe3c0cf[_0x76e7('0x39')]);_0x51b31f['filters']=_[_0x76e7('0x3d')](_0x51b31f['model'],_0x51b31f[_0x76e7('0x39')]);_0x503634['attributes']=_[_0x76e7('0x3d')](_0x51b31f['model'],qs[_0x76e7('0x3f')](_0xe3c0cf[_0x76e7('0x39')][_0x76e7('0x3f')]));_0x503634[_0x76e7('0x3e')]=_0x503634[_0x76e7('0x3e')]['length']?_0x503634['attributes']:_0x51b31f[_0x76e7('0x37')];_0x503634[_0x76e7('0x42')]=qs[_0x76e7('0x43')](_0xe3c0cf['query']['sort']);_0x503634[_0x76e7('0x44')]=qs['filters'](_[_0x76e7('0x45')](_0xe3c0cf[_0x76e7('0x39')],_0x51b31f['filters']));if(_0xe3c0cf['query'][_0x76e7('0x49')]){_0x503634['where']=_[_0x76e7('0x48')](_0x503634['where'],{'$or':_[_0x76e7('0x5b')](_0x503634[_0x76e7('0x3e')],function(_0x3ecea8){var _0x5d3b02={};_0x5d3b02[_0x3ecea8]={'$like':'%'+_0xe3c0cf['query'][_0x76e7('0x49')]+'%'};return _0x5d3b02;})});}_0x503634=_[_0x76e7('0x48')]({},_0x503634,_0xe3c0cf['options']);return _0x2027c4[_0x76e7('0xa6')](_0x503634);}})[_0x76e7('0x1a')](function(_0x4bf705){if(_0x4bf705){_0x7f1e2b=_0x4bf705[_0x76e7('0x40')];if(!_0xe3c0cf[_0x76e7('0x39')]['hasOwnProperty'](_0x76e7('0x59'))){_0x503634[_0x76e7('0x2a')]=qs[_0x76e7('0x2a')](_0xe3c0cf[_0x76e7('0x39')][_0x76e7('0x2a')]);_0x503634['offset']=qs[_0x76e7('0x29')](_0xe3c0cf[_0x76e7('0x39')][_0x76e7('0x29')]);}return _0x2027c4[_0x76e7('0xa6')](_0x503634);}})['then'](function(_0x40c1ef){if(_0x40c1ef){return _0x40c1ef?{'count':_0x7f1e2b,'rows':_0x40c1ef}:null;}})['then'](respondWithResult(_0x564c53,null))[_0x76e7('0x24')](handleError(_0x564c53,null));};exports[_0x76e7('0xa7')]=function(_0x4de722,_0x155002,_0x5648f8){var _0x53037a={'raw':![],'where':{}};var _0x595b94={};var _0x56bcbe={'count':0x0,'rows':[]};return db[_0x76e7('0x36')][_0x76e7('0x60')]({'where':{'id':_0x4de722[_0x76e7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x155002,null))[_0x76e7('0x1a')](function(_0x1c06c8){if(_0x1c06c8){_0x595b94[_0x76e7('0x37')]=_[_0x76e7('0x38')](db['SmsInteraction'][_0x76e7('0x50')]);_0x595b94['query']=_['keys'](_0x4de722[_0x76e7('0x39')]);_0x595b94[_0x76e7('0x3c')]=_[_0x76e7('0x3d')](_0x595b94[_0x76e7('0x37')],_0x595b94['query']);_0x53037a[_0x76e7('0x3e')]=_[_0x76e7('0x3d')](_0x595b94[_0x76e7('0x37')],qs[_0x76e7('0x3f')](_0x4de722[_0x76e7('0x39')][_0x76e7('0x3f')]));_0x53037a[_0x76e7('0x3e')]=_0x53037a[_0x76e7('0x3e')]['length']?_0x53037a[_0x76e7('0x3e')]:_0x595b94['model'];if(!_0x4de722[_0x76e7('0x39')][_0x76e7('0x41')](_0x76e7('0x59'))){_0x53037a[_0x76e7('0x2a')]=qs['limit'](_0x4de722[_0x76e7('0x39')][_0x76e7('0x2a')]);_0x53037a['offset']=qs[_0x76e7('0x29')](_0x4de722[_0x76e7('0x39')][_0x76e7('0x29')]);}_0x53037a[_0x76e7('0x42')]=qs['sort'](_0x4de722[_0x76e7('0x39')][_0x76e7('0x43')]);_0x53037a[_0x76e7('0x44')]=qs[_0x76e7('0x3c')](_[_0x76e7('0x45')](_0x4de722[_0x76e7('0x39')],_0x595b94[_0x76e7('0x3c')]));_0x53037a['where'][_0x76e7('0x5a')]=_0x1c06c8['id'];if(_0x4de722[_0x76e7('0x39')][_0x76e7('0x49')]){_0x53037a['where']=_[_0x76e7('0x48')](_0x53037a[_0x76e7('0x44')],{'$or':_[_0x76e7('0x5b')](_0x53037a['attributes'],function(_0x26858d){var _0x5c1303={};_0x5c1303[_0x26858d]={'$like':'%'+_0x4de722[_0x76e7('0x39')][_0x76e7('0x49')]+'%'};return _0x5c1303;})});}_0x53037a=_[_0x76e7('0x48')]({},_0x53037a,_0x4de722[_0x76e7('0x4a')]);return db['SmsInteraction'][_0x76e7('0x28')]({'where':_0x53037a[_0x76e7('0x44')]})[_0x76e7('0x1a')](function(_0x447722){_0x56bcbe['count']=_0x447722;if(_0x4de722['query']['includeAll']){_0x53037a['include']=[{'model':db[_0x76e7('0x6a')],'as':_0x76e7('0xa8'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x76e7('0x96'),'fullname',_0x76e7('0xa9')],'required':![]},{'model':db[_0x76e7('0xaa')],'as':_0x76e7('0xab'),'attributes':['id',_0x76e7('0x96'),'color'],'where':_0x4de722[_0x76e7('0x39')][_0x76e7('0xac')]?{'id':_0x4de722[_0x76e7('0x39')]['tag']}:undefined,'required':_0x4de722['query'][_0x76e7('0xac')]?!![]:![]}];}return db[_0x76e7('0x8b')][_0x76e7('0x4c')](_0x53037a);})[_0x76e7('0x1a')](function(_0xe4ec56){_0x56bcbe[_0x76e7('0x4d')]=_0xe4ec56;return _0x56bcbe;});}})[_0x76e7('0x1a')](respondWithFilteredResult(_0x155002,_0x53037a))[_0x76e7('0x24')](handleError(_0x155002,null));};exports[_0x76e7('0x34')]=function(_0xb0601b,_0x27475e,_0xeb1eed){var _0x4d9e4d,_0x409175,_0x4288d2;if(_[_0x76e7('0x7e')](_0xb0601b[_0x76e7('0x53')]['body'])||_0xb0601b['body']['body']===''){throw new db[(_0x76e7('0x7f'))][(_0x76e7('0x6b'))](_0x76e7('0x80'));}if(_['isNil'](_0xb0601b['body']['to'])){throw new db['Sequelize'][(_0x76e7('0x6b'))](_0x76e7('0xad'));}_0x4d9e4d=_0xb0601b[_0x76e7('0x53')]['to'];return db['SmsAccount'][_0x76e7('0x54')]({'where':{'id':_0xb0601b[_0x76e7('0x4f')]['id']},'include':[{'model':db[_0x76e7('0x85')],'as':_0x76e7('0xae'),'include':[{'model':db[_0x76e7('0x6a')],'as':_0x76e7('0x86'),'where':{'mobile':_0x4d9e4d},'limit':0x1,'order':[[_0x76e7('0x6f'),_0x76e7('0x87')]]}]}]})[_0x76e7('0x1a')](handleEntityNotFound(_0x27475e,null))[_0x76e7('0x1a')](function(_0x235485){if(_0x235485&&_0x235485['List']){_0x409175=_0x235485[_0x76e7('0xaf')]({'plain':!![]});if(_0x409175[_0x76e7('0xae')]&&_0x409175[_0x76e7('0xae')]['Contacts'][_0x76e7('0x40')]){return _0x409175[_0x76e7('0xae')]['Contacts'][0x0];}return db[_0x76e7('0x6a')][_0x76e7('0x52')](_[_0x76e7('0x8a')](_0xb0601b[_0x76e7('0x53')],{'firstName':_0x4d9e4d,'mobile':_0x4d9e4d,'phone':_0x4d9e4d,'ListId':_0x409175[_0x76e7('0x70')]}));}})[_0x76e7('0x1a')](handleEntityNotFound(_0x27475e,null))[_0x76e7('0x1a')](function(_0x52b7d9){if(_0x52b7d9){_0x4288d2=_0x52b7d9;return db[_0x76e7('0x8b')]['find']({'where':{'ContactId':_0x4288d2['id'],'closed':![],'SmsAccountId':_0x409175['id']}})['then'](function(_0x5776aa){if(_0x5776aa){return[_0x5776aa,![]];}return db['SmsInteraction']['create']({'UserId':_0xb0601b['user']['id'],'ContactId':_0x4288d2['id'],'SmsAccountId':_0x409175['id'],'phone':_0x4d9e4d,'firstMsgDirection':_0x76e7('0xb0'),'Messages':[_[_0x76e7('0x48')](_0xb0601b[_0x76e7('0x53')],{'read':![],'body':_0xb0601b[_0x76e7('0x53')][_0x76e7('0x53')],'phone':_0x4d9e4d,'SmsAccountId':_0x409175['id'],'UserId':_0xb0601b[_0x76e7('0xb1')]['id'],'ContactId':_0x4288d2['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x76e7('0xb2')}]})[_0x76e7('0x1a')](function(_0x38b3c0){return[_0x38b3c0,!![]];});});}})[_0x76e7('0x8c')](function(_0x23fcb8,_0xed0cde){if(_0xed0cde){return _0x23fcb8;}return db['SmsMessage'][_0x76e7('0x52')](_[_0x76e7('0x48')](_0xb0601b[_0x76e7('0x53')],{'read':![],'body':_0xb0601b[_0x76e7('0x53')][_0x76e7('0x53')],'phone':_0x4d9e4d,'SmsAccountId':_0x409175['id'],'SmsInteractionId':_0x23fcb8['id'],'UserId':_0xb0601b[_0x76e7('0xb1')]['id'],'ContactId':_0x4288d2['id']}))['then'](function(_0x5d6d71){_0x23fcb8[_0x76e7('0xb3')][_0x76e7('0xb2')]=[];_0x23fcb8[_0x76e7('0xb3')][_0x76e7('0xb2')][_0x76e7('0xb4')](_0x5d6d71[_0x76e7('0xb3')]);return _0x23fcb8;});})[_0x76e7('0x1a')](respondWithResult(_0x27475e,null))['catch'](handleError(_0x27475e,null));};exports['status']=function(_0x83d048,_0x38810c,_0x2b38e6){if(_0x83d048[_0x76e7('0x53')]['id']){delete _0x83d048['body']['id'];}var _0x1029c3,_0xd86c36,_0x9d7216;return db[_0x76e7('0x36')][_0x76e7('0x54')]({'where':{'id':_0x83d048[_0x76e7('0x4f')]['id']}})[_0x76e7('0x1a')](handleEntityNotFound(_0x38810c,null))[_0x76e7('0x1a')](function(_0x3e8901){if(_0x3e8901){_0x9d7216=_0x3e8901;logger[_0x76e7('0x1e')](_0x76e7('0x1f'),'status',_0x76e7('0xb5'),_0x3e8901[_0x76e7('0x72')],util[_0x76e7('0xb6')](_0x83d048[_0x76e7('0x53')],{'showHidden':![],'depth':null}));switch(_0x3e8901[_0x76e7('0x72')]){case _0x76e7('0xb7'):if(_0x83d048['body'][_0x76e7('0xb8')]&&_0x83d048[_0x76e7('0x53')][_0x76e7('0x25')]){_0xd86c36=_0x83d048[_0x76e7('0x53')]['status'];return db[_0x76e7('0xb9')][_0x76e7('0x54')]({'where':{'messageId':_0x83d048[_0x76e7('0x53')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x83d048[_0x76e7('0x53')][_0x76e7('0xba')]&&_0x83d048[_0x76e7('0x53')][_0x76e7('0xbb')]){_0xd86c36=_0x83d048['body']['statusInt'];return db[_0x76e7('0xb9')][_0x76e7('0x54')]({'where':{'messageId':_0x83d048['body'][_0x76e7('0xba')]}});}break;case _0x76e7('0xbc'):if(_0x83d048['body']['message_id']&&_0x83d048[_0x76e7('0x53')][_0x76e7('0xbd')]){_0xd86c36=_0x83d048[_0x76e7('0x53')][_0x76e7('0xbd')];return db['SmsMessage'][_0x76e7('0x54')]({'where':{'messageId':_0x83d048['body'][_0x76e7('0x7b')]}});}break;}}})[_0x76e7('0x1a')](handleEntityNotFound(_0x38810c,null))[_0x76e7('0x1a')](function(_0x179a90){if(_0x179a90){_0x1029c3=_0x179a90;switch(_0x9d7216[_0x76e7('0x72')]){case _0x76e7('0xb7'):if(_0xd86c36===_0x76e7('0xbe')){return _0x1029c3[_0x76e7('0x30')]({'read':!![]});}else{logger['error'](_0x76e7('0x1f'),_0x76e7('0x25'),_0x76e7('0xb7'),util[_0x76e7('0xb6')](_0x83d048[_0x76e7('0x53')],{'showHidden':![],'depth':null}));}break;case _0x76e7('0x7a'):if(_0xd86c36==='1'){return _0x1029c3['update']({'read':!![]});}else{logger[_0x76e7('0x21')](_0x76e7('0x1f'),_0x76e7('0x25'),_0x76e7('0xb7'),util['inspect'](_0x83d048['body'],{'showHidden':![],'depth':null}));}break;case _0x76e7('0xbc'):if(!_0x83d048[_0x76e7('0x53')][_0x76e7('0xbf')]&&_0xd86c36>=0xc8&&_0xd86c36<=0xce){return _0x1029c3[_0x76e7('0x30')]({'read':!![]});}else{logger[_0x76e7('0x21')](_0x76e7('0x1f'),_0x76e7('0x25'),_0x76e7('0xbc'),util[_0x76e7('0xb6')](_0x83d048[_0x76e7('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x1029c3;}})[_0x76e7('0x1a')](respondWithResult(_0x38810c,null))[_0x76e7('0x24')](handleError(_0x38810c,null));};exports['addAgents']=function(_0xcea114,_0x401e96,_0x371847){return db['SmsAccount'][_0x76e7('0x54')]({'where':{'id':_0xcea114[_0x76e7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x401e96,null))[_0x76e7('0x1a')](function(_0x3d16ec){if(_0x3d16ec){return _0x3d16ec['addAgents'](_0xcea114['body'][_0x76e7('0x5d')],_[_0x76e7('0x89')](_0xcea114['body'],[_0x76e7('0x5d'),'id'])||{})[_0x76e7('0x8c')](function(_0x2255e){for(var _0x2a704e=0x0;_0x2a704e<_0xcea114[_0x76e7('0x53')][_0x76e7('0x5d')][_0x76e7('0x40')];_0x2a704e+=0x1){socket[_0x76e7('0xc0')](_0x76e7('0xc1'),{'UserId':_0xcea114[_0x76e7('0x53')]['ids'][_0x2a704e],'SmsAccountId':_0xcea114[_0x76e7('0x4f')]['id']});}return _0x2255e;});}})[_0x76e7('0x1a')](respondWithResult(_0x401e96,null))[_0x76e7('0x24')](handleError(_0x401e96,null));};exports[_0x76e7('0xc2')]=function(_0x304cab,_0x2f3472,_0x11a8d9){var _0x5b2bea;return db[_0x76e7('0x36')][_0x76e7('0x54')]({'where':{'id':_0x304cab[_0x76e7('0x4f')]['id']}})[_0x76e7('0x1a')](handleEntityNotFound(_0x2f3472,null))[_0x76e7('0x1a')](function(_0x49678d){if(_0x49678d){return _0x49678d[_0x76e7('0xc2')](_0x304cab[_0x76e7('0x39')][_0x76e7('0x5d')])[_0x76e7('0x1a')](function(_0x5d8ecb){if(_[_0x76e7('0xc3')](_0x304cab[_0x76e7('0x39')][_0x76e7('0x5d')])){for(var _0xb71acb=0x0;_0xb71acb<_0x304cab[_0x76e7('0x39')]['ids'][_0x76e7('0x40')];_0xb71acb+=0x1){socket[_0x76e7('0xc0')](_0x76e7('0xc4'),{'UserId':_0x304cab['query']['ids'][_0xb71acb],'SmsAccountId':_0x304cab[_0x76e7('0x4f')]['id']});}}else{socket[_0x76e7('0xc0')](_0x76e7('0xc4'),{'UserId':_0x304cab['query'][_0x76e7('0x5d')],'SmsAccountId':_0x304cab[_0x76e7('0x4f')]['id']});}});}})[_0x76e7('0x1a')](respondWithStatusCode(_0x2f3472,null))[_0x76e7('0x24')](handleError(_0x2f3472,null));};exports[_0x76e7('0xc5')]=function(_0x5a6955,_0x25f579,_0x4af6e4){var _0x1afd7e={};var _0x1cbcbf={};var _0x2bec5;var _0x4eeefe;return db[_0x76e7('0x36')][_0x76e7('0x60')]({'where':{'id':_0x5a6955[_0x76e7('0x4f')]['id']}})[_0x76e7('0x1a')](handleEntityNotFound(_0x25f579,null))[_0x76e7('0x1a')](function(_0xc88862){if(_0xc88862){_0x2bec5=_0xc88862;_0x1cbcbf[_0x76e7('0x37')]=_['keys'](db[_0x76e7('0x95')][_0x76e7('0x50')]);_0x1cbcbf[_0x76e7('0x39')]=_[_0x76e7('0x38')](_0x5a6955[_0x76e7('0x39')]);_0x1cbcbf[_0x76e7('0x3c')]=_[_0x76e7('0x3d')](_0x1cbcbf[_0x76e7('0x37')],_0x1cbcbf[_0x76e7('0x39')]);_0x1afd7e[_0x76e7('0x3e')]=_[_0x76e7('0x3d')](_0x1cbcbf[_0x76e7('0x37')],qs[_0x76e7('0x3f')](_0x5a6955['query'][_0x76e7('0x3f')]));_0x1afd7e[_0x76e7('0x3e')]=_0x1afd7e[_0x76e7('0x3e')][_0x76e7('0x40')]?_0x1afd7e['attributes']:_0x1cbcbf[_0x76e7('0x37')];_0x1afd7e[_0x76e7('0x42')]=qs[_0x76e7('0x43')](_0x5a6955['query'][_0x76e7('0x43')]);_0x1afd7e[_0x76e7('0x44')]=qs[_0x76e7('0x3c')](_[_0x76e7('0x45')](_0x5a6955[_0x76e7('0x39')],_0x1cbcbf[_0x76e7('0x3c')]));if(_0x5a6955[_0x76e7('0x39')][_0x76e7('0x49')]){_0x1afd7e[_0x76e7('0x44')]=_[_0x76e7('0x48')](_0x1afd7e[_0x76e7('0x44')],{'$or':_['map'](_0x1afd7e['attributes'],function(_0x478a31){var _0x2febfa={};_0x2febfa[_0x478a31]={'$like':'%'+_0x5a6955['query']['filter']+'%'};return _0x2febfa;})});}_0x1afd7e=_[_0x76e7('0x48')]({},_0x1afd7e,_0x5a6955[_0x76e7('0x4a')]);return _0x2bec5[_0x76e7('0xc5')](_0x1afd7e);}})[_0x76e7('0x1a')](function(_0x3b6567){if(_0x3b6567){_0x4eeefe=_0x3b6567[_0x76e7('0x40')];if(!_0x5a6955[_0x76e7('0x39')]['hasOwnProperty'](_0x76e7('0x59'))){_0x1afd7e[_0x76e7('0x2a')]=qs[_0x76e7('0x2a')](_0x5a6955[_0x76e7('0x39')]['limit']);_0x1afd7e[_0x76e7('0x29')]=qs[_0x76e7('0x29')](_0x5a6955[_0x76e7('0x39')]['offset']);}return _0x2bec5[_0x76e7('0xc5')](_0x1afd7e);}})[_0x76e7('0x1a')](function(_0x4ffae9){if(_0x4ffae9){return _0x4ffae9?{'count':_0x4eeefe,'rows':_0x4ffae9}:null;}})[_0x76e7('0x1a')](respondWithResult(_0x25f579,null))['catch'](handleError(_0x25f579,null));};
\ No newline at end of file
+var _0x097c=['twilio','from','From','Body','messageId','MessageSid','skebby','text','connectel','message_id','plivo','Text','MessageUUID','isNil','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','DESC','list','omit','Contacts','defaults','contact','SmsInteraction','spread','created','autoclose','push','close','unmanaged','interaction','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','startRouting','receiveMessage','info','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','get','user','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','error_code','addAgents','emit','removeAgents','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','localhost','./smsAccount.socket','jayson/promise','client','http','request','then','SmsAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','end','status','json','count','offset','limit','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','send','index','SmsAccount','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','attributes','fields','order','where','filters','add','merge','map','filter','options','includeAll','include','findAll','rows','show','length','find','create','body','params','describe','SmsAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','sort','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','pick','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','mobile','type'];(function(_0x30215f,_0x53f311){var _0x494537=function(_0x32e159){while(--_0x32e159){_0x30215f['push'](_0x30215f['shift']());}};_0x494537(++_0x53f311);}(_0x097c,0x1d5));var _0xc097=function(_0x48f7bb,_0x15a37f){_0x48f7bb=_0x48f7bb-0x0;var _0x236c34=_0x097c[_0x48f7bb];return _0x236c34;};'use strict';var pdf=require(_0xc097('0x0'));var emlformat=require(_0xc097('0x1'));var rimraf=require(_0xc097('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc097('0x3'));var rp=require(_0xc097('0x4'));var moment=require(_0xc097('0x5'));var BPromise=require(_0xc097('0x6'));var Mustache=require('mustache');var util=require(_0xc097('0x7'));var path=require('path');var sox=require(_0xc097('0x8'));var csv=require(_0xc097('0x9'));var ejs=require(_0xc097('0xa'));var fs=require('fs');var _=require(_0xc097('0xb'));var squel=require('squel');var crypto=require(_0xc097('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc097('0x9'));var querystring=require(_0xc097('0xd'));var Papa=require(_0xc097('0xe'));var qs=require(_0xc097('0xf'));var logger=require(_0xc097('0x10'))(_0xc097('0x11'));var utils=require(_0xc097('0x12'));var config=require(_0xc097('0x13'));var db=require(_0xc097('0x14'))['db'];var socket=require('socket.io-emitter')({'host':_0xc097('0x15'),'port':0x18eb});require(_0xc097('0x16'))['register'](socket);var jayson=require(_0xc097('0x17'));var client=jayson[_0xc097('0x18')][_0xc097('0x19')]({'port':0x232c});function respondWithRpcPromise(_0x276ad2,_0x32013c,_0x237037,_0x5ef347){return new BPromise(function(_0x511b68,_0x42fd3a){var _0xa31949=_0x5ef347||client;return _0xa31949[_0xc097('0x1a')](_0x276ad2,_0x237037)[_0xc097('0x1b')](function(_0x409add){logger['info'](_0xc097('0x1c'),_0x32013c,'request\x20sent');logger[_0xc097('0x1d')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x32013c,_0xc097('0x1e'),JSON[_0xc097('0x1f')](_0x409add));if(_0x409add[_0xc097('0x20')]){if(_0x409add[_0xc097('0x20')][_0xc097('0x21')]===0x1f4){logger['error'](_0xc097('0x1c'),_0x32013c,_0x409add[_0xc097('0x20')][_0xc097('0x22')]);return _0x42fd3a(_0x409add[_0xc097('0x20')]['message']);}logger[_0xc097('0x20')]('SmsAccount,\x20%s,\x20%s',_0x32013c,_0x409add['error']['message']);return _0x511b68(_0x409add[_0xc097('0x20')]['message']);}else{logger['info'](_0xc097('0x1c'),_0x32013c,_0xc097('0x1e'));_0x511b68(_0x409add[_0xc097('0x23')][_0xc097('0x22')]);}})[_0xc097('0x24')](function(_0x4072b4){logger[_0xc097('0x20')](_0xc097('0x1c'),_0x32013c,_0x4072b4);_0x42fd3a(_0x4072b4);});});}function respondWithStatusCode(_0x2ec38d,_0x5e5130){_0x5e5130=_0x5e5130||0xcc;return function(_0x50b88e){if(_0x50b88e){return _0x2ec38d['sendStatus'](_0x5e5130);}return _0x2ec38d['status'](_0x5e5130)[_0xc097('0x25')]();};}function respondWithResult(_0xca7a19,_0xe2b2e5){_0xe2b2e5=_0xe2b2e5||0xc8;return function(_0x38de3d){if(_0x38de3d){return _0xca7a19[_0xc097('0x26')](_0xe2b2e5)[_0xc097('0x27')](_0x38de3d);}};}function respondWithFilteredResult(_0x43a798,_0x133bf2){return function(_0x1c0aba){if(_0x1c0aba){var _0x1312d6=_0x1c0aba[_0xc097('0x28')],_0x16726d=_0x133bf2['offset'],_0x8985bc=_0x133bf2[_0xc097('0x29')]+_0x133bf2[_0xc097('0x2a')],_0x37f43c;if(_0x8985bc>=_0x1312d6){_0x8985bc=_0x1312d6;_0x37f43c=0xc8;}else{_0x37f43c=0xce;}_0x43a798['status'](_0x37f43c);return _0x43a798['set'](_0xc097('0x2b'),_0x16726d+'-'+_0x8985bc+'/'+_0x1312d6)[_0xc097('0x27')](_0x1c0aba);}return null;};}function patchUpdates(_0x455cff){return function(_0x5c95bd){try{jsonpatch[_0xc097('0x2c')](_0x5c95bd,_0x455cff,!![]);}catch(_0xfe23e){return BPromise[_0xc097('0x2d')](_0xfe23e);}return _0x5c95bd['save']();};}function saveUpdates(_0x571e2e,_0xb587d8){return function(_0x47b1c9){if(_0x47b1c9){return _0x47b1c9[_0xc097('0x2e')](_0x571e2e)['then'](function(_0x54e480){return _0x54e480;});}return null;};}function removeEntity(_0x286e00,_0x598881){return function(_0x110e6e){if(_0x110e6e){return _0x110e6e[_0xc097('0x2f')]()[_0xc097('0x1b')](function(){_0x286e00[_0xc097('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d7228,_0x42adcc){return function(_0x8acef){if(!_0x8acef){_0x5d7228[_0xc097('0x30')](0x194);}return _0x8acef;};}function handleError(_0x42b32a,_0x38676b){_0x38676b=_0x38676b||0x1f4;return function(_0xc6b152){logger['error'](_0xc6b152[_0xc097('0x31')]);if(_0xc6b152[_0xc097('0x32')]){delete _0xc6b152[_0xc097('0x32')];}_0x42b32a[_0xc097('0x26')](_0x38676b)[_0xc097('0x33')](_0xc6b152);};}exports[_0xc097('0x34')]=function(_0x165cca,_0x2ab647){var _0xd4fcd0={},_0x4e9330={},_0x4c6e25={'count':0x0,'rows':[]};var _0x1bf482=db[_0xc097('0x35')][_0xc097('0x36')];_0x4e9330[_0xc097('0x37')]=_[_0xc097('0x38')](_0x1bf482);var _0x574986={'dateStart':_0x165cca[_0xc097('0x39')][_0xc097('0x3a')],'dateEnd':_0x165cca[_0xc097('0x39')][_0xc097('0x3b')]};delete _0x165cca[_0xc097('0x39')][_0xc097('0x3a')];delete _0x165cca[_0xc097('0x39')][_0xc097('0x3b')];_0x4e9330[_0xc097('0x39')]=_[_0xc097('0x38')](_0x165cca['query']);_0x4e9330['filters']=_[_0xc097('0x3c')](_0x4e9330[_0xc097('0x37')],_0x4e9330[_0xc097('0x39')]);_0xd4fcd0[_0xc097('0x3d')]=_[_0xc097('0x3c')](_0x4e9330[_0xc097('0x37')],qs[_0xc097('0x3e')](_0x165cca[_0xc097('0x39')]['fields']));_0xd4fcd0['attributes']=_0xd4fcd0[_0xc097('0x3d')]['length']?_0xd4fcd0[_0xc097('0x3d')]:_0x4e9330['model'];if(!_0x165cca[_0xc097('0x39')]['hasOwnProperty']('nolimit')){_0xd4fcd0[_0xc097('0x2a')]=qs['limit'](_0x165cca[_0xc097('0x39')][_0xc097('0x2a')]);_0xd4fcd0[_0xc097('0x29')]=qs[_0xc097('0x29')](_0x165cca['query'][_0xc097('0x29')]);}_0xd4fcd0[_0xc097('0x3f')]=qs['sort'](_0x165cca['query']['sort']);_0xd4fcd0[_0xc097('0x40')]=qs[_0xc097('0x41')](_['pick'](_0x165cca[_0xc097('0x39')],_0x4e9330[_0xc097('0x41')]));if(_0x574986[_0xc097('0x3a')]){if(_0x574986[_0xc097('0x3b')]){_0x574986[_0xc097('0x3b')]=moment(_0x574986[_0xc097('0x3b')])[_0xc097('0x42')](0x1,'day');}else{_0x574986['dateEnd']=moment(_0x574986[_0xc097('0x3a')])[_0xc097('0x42')](0x1,'day');}_[_0xc097('0x43')](_0xd4fcd0[_0xc097('0x40')],{'createdAt':{'$gte':_0x574986[_0xc097('0x3a')],'$lte':_0x574986['dateEnd']}});}if(_0x165cca[_0xc097('0x39')]['filter']){_0xd4fcd0[_0xc097('0x40')]=_['merge'](_0xd4fcd0[_0xc097('0x40')],{'$or':_[_0xc097('0x44')](_0xd4fcd0['attributes'],function(_0x5bf5b2){var _0x3b6939={};_0x3b6939[_0x5bf5b2]={'$like':'%'+_0x165cca[_0xc097('0x39')][_0xc097('0x45')]+'%'};return _0x3b6939;})});}_0xd4fcd0=_[_0xc097('0x43')]({},_0xd4fcd0,_0x165cca[_0xc097('0x46')]);var _0x3ad115={'where':_0xd4fcd0[_0xc097('0x40')]};return db['SmsAccount'][_0xc097('0x28')](_0x3ad115)[_0xc097('0x1b')](function(_0x14ec7a){_0x4c6e25[_0xc097('0x28')]=_0x14ec7a;if(_0x165cca[_0xc097('0x39')][_0xc097('0x47')]){_0xd4fcd0[_0xc097('0x48')]=[{'all':!![]}];}return db[_0xc097('0x35')][_0xc097('0x49')](_0xd4fcd0);})[_0xc097('0x1b')](function(_0x5a24d1){_0x4c6e25[_0xc097('0x4a')]=_0x5a24d1;return _0x4c6e25;})['then'](respondWithFilteredResult(_0x2ab647,_0xd4fcd0))['catch'](handleError(_0x2ab647,null));};exports[_0xc097('0x4b')]=function(_0x447cba,_0x3508d4){var _0x341648={'raw':![],'where':{'id':_0x447cba['params']['id']}},_0x43cb6={};_0x43cb6[_0xc097('0x37')]=_[_0xc097('0x38')](db['SmsAccount'][_0xc097('0x36')]);_0x43cb6[_0xc097('0x39')]=_[_0xc097('0x38')](_0x447cba[_0xc097('0x39')]);_0x43cb6[_0xc097('0x41')]=_['intersection'](_0x43cb6['model'],_0x43cb6['query']);_0x341648[_0xc097('0x3d')]=_[_0xc097('0x3c')](_0x43cb6[_0xc097('0x37')],qs[_0xc097('0x3e')](_0x447cba['query'][_0xc097('0x3e')]));_0x341648[_0xc097('0x3d')]=_0x341648[_0xc097('0x3d')][_0xc097('0x4c')]?_0x341648[_0xc097('0x3d')]:_0x43cb6['model'];if(_0x447cba['query'][_0xc097('0x47')]){_0x341648[_0xc097('0x48')]=[{'all':!![]}];}_0x341648=_[_0xc097('0x43')]({},_0x341648,_0x447cba[_0xc097('0x46')]);return db['SmsAccount'][_0xc097('0x4d')](_0x341648)[_0xc097('0x1b')](handleEntityNotFound(_0x3508d4,null))[_0xc097('0x1b')](respondWithResult(_0x3508d4,null))[_0xc097('0x24')](handleError(_0x3508d4,null));};exports['create']=function(_0x89a0fe,_0x1b391e){return db['SmsAccount'][_0xc097('0x4e')](_0x89a0fe['body'],{})['then'](respondWithResult(_0x1b391e,0xc9))[_0xc097('0x24')](handleError(_0x1b391e,null));};exports[_0xc097('0x2e')]=function(_0x5d8612,_0x29724b){if(_0x5d8612[_0xc097('0x4f')]['id']){delete _0x5d8612[_0xc097('0x4f')]['id'];}return db['SmsAccount'][_0xc097('0x4d')]({'where':{'id':_0x5d8612[_0xc097('0x50')]['id']}})[_0xc097('0x1b')](handleEntityNotFound(_0x29724b,null))[_0xc097('0x1b')](saveUpdates(_0x5d8612[_0xc097('0x4f')],null))[_0xc097('0x1b')](respondWithResult(_0x29724b,null))[_0xc097('0x24')](handleError(_0x29724b,null));};exports[_0xc097('0x2f')]=function(_0x2a42fd,_0x2b5a84){return db[_0xc097('0x35')]['find']({'where':{'id':_0x2a42fd[_0xc097('0x50')]['id']}})[_0xc097('0x1b')](handleEntityNotFound(_0x2b5a84,null))[_0xc097('0x1b')](removeEntity(_0x2b5a84,null))[_0xc097('0x24')](handleError(_0x2b5a84,null));};exports[_0xc097('0x51')]=function(_0x4b8723,_0x1c3b1a){return db['SmsAccount'][_0xc097('0x51')]()[_0xc097('0x1b')](respondWithResult(_0x1c3b1a,null))[_0xc097('0x24')](handleError(_0x1c3b1a,null));};exports['addDisposition']=function(_0x2b0d79,_0x24184f,_0x1976c5){if(_0x2b0d79[_0xc097('0x4f')]['id']){delete _0x2b0d79[_0xc097('0x4f')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x2b0d79[_0xc097('0x50')]['id']}})[_0xc097('0x1b')](handleEntityNotFound(_0x24184f,null))[_0xc097('0x1b')](function(_0xf6f754){if(_0xf6f754){_0x2b0d79[_0xc097('0x4f')][_0xc097('0x52')]=_0xf6f754['id'];return db[_0xc097('0x53')][_0xc097('0x4e')](_0x2b0d79['body']);}})[_0xc097('0x1b')](respondWithResult(_0x24184f,null))['catch'](handleError(_0x24184f,null));};exports[_0xc097('0x54')]=function(_0x151639,_0xe81c7a,_0xb30b66){var _0x1777f4={'raw':![],'where':{}};var _0x54b1b3={};var _0x1e1c48={'count':0x0,'rows':[]};return db['SmsAccount'][_0xc097('0x55')]({'where':{'id':_0x151639[_0xc097('0x50')]['id']}})[_0xc097('0x1b')](handleEntityNotFound(_0xe81c7a,null))['then'](function(_0x507129){if(_0x507129){_0x54b1b3[_0xc097('0x37')]=_[_0xc097('0x38')](db[_0xc097('0x53')][_0xc097('0x36')]);_0x54b1b3[_0xc097('0x39')]=_[_0xc097('0x38')](_0x151639[_0xc097('0x39')]);_0x54b1b3[_0xc097('0x41')]=_['intersection'](_0x54b1b3[_0xc097('0x37')],_0x54b1b3[_0xc097('0x39')]);_0x1777f4[_0xc097('0x3d')]=_['intersection'](_0x54b1b3[_0xc097('0x37')],qs['fields'](_0x151639['query'][_0xc097('0x3e')]));_0x1777f4[_0xc097('0x3d')]=_0x1777f4[_0xc097('0x3d')]['length']?_0x1777f4['attributes']:_0x54b1b3[_0xc097('0x37')];if(!_0x151639['query'][_0xc097('0x56')](_0xc097('0x57'))){_0x1777f4['limit']=qs[_0xc097('0x2a')](_0x151639[_0xc097('0x39')]['limit']);_0x1777f4['offset']=qs['offset'](_0x151639[_0xc097('0x39')][_0xc097('0x29')]);}_0x1777f4[_0xc097('0x3f')]=qs['sort'](_0x151639[_0xc097('0x39')][_0xc097('0x58')]);_0x1777f4[_0xc097('0x40')]=qs['filters'](_['pick'](_0x151639[_0xc097('0x39')],_0x54b1b3[_0xc097('0x41')]));_0x1777f4[_0xc097('0x40')]['SmsAccountId']=_0x507129['id'];if(_0x151639[_0xc097('0x39')][_0xc097('0x45')]){_0x1777f4[_0xc097('0x40')]=_[_0xc097('0x43')](_0x1777f4[_0xc097('0x40')],{'$or':_[_0xc097('0x44')](_0x1777f4[_0xc097('0x3d')],function(_0x49bd41){var _0x5828c8={};_0x5828c8[_0x49bd41]={'$like':'%'+_0x151639[_0xc097('0x39')][_0xc097('0x45')]+'%'};return _0x5828c8;})});}_0x1777f4=_['merge']({},_0x1777f4,_0x151639[_0xc097('0x46')]);return db[_0xc097('0x53')][_0xc097('0x28')]({'where':_0x1777f4[_0xc097('0x40')]})[_0xc097('0x1b')](function(_0x3ce76e){_0x1e1c48['count']=_0x3ce76e;if(_0x151639[_0xc097('0x39')][_0xc097('0x47')]){_0x1777f4['include']=[{'all':!![]}];}return db[_0xc097('0x53')]['findAll'](_0x1777f4);})[_0xc097('0x1b')](function(_0x27c007){_0x1e1c48[_0xc097('0x4a')]=_0x27c007;return _0x1e1c48;});}})[_0xc097('0x1b')](respondWithFilteredResult(_0xe81c7a,_0x1777f4))['catch'](handleError(_0xe81c7a,null));};exports['removeDispositions']=function(_0x130d03,_0x1705c4,_0xd21b8e){var _0x19f482;return db[_0xc097('0x35')]['find']({'where':{'id':_0x130d03[_0xc097('0x50')]['id']}})[_0xc097('0x1b')](handleEntityNotFound(_0x1705c4,null))[_0xc097('0x1b')](function(_0x2a41ba){if(_0x2a41ba){return _0x2a41ba[_0xc097('0x59')](_0x130d03['query'][_0xc097('0x5a')]);}})[_0xc097('0x1b')](respondWithStatusCode(_0x1705c4,null))[_0xc097('0x24')](handleError(_0x1705c4,null));};exports[_0xc097('0x5b')]=function(_0x30f99e,_0x5f16c5,_0x194eaa){if(_0x30f99e['body']['id']){delete _0x30f99e[_0xc097('0x4f')]['id'];}return db[_0xc097('0x35')]['find']({'where':{'id':_0x30f99e[_0xc097('0x50')]['id']}})['then'](handleEntityNotFound(_0x5f16c5,null))[_0xc097('0x1b')](function(_0x534479){if(_0x534479){_0x30f99e[_0xc097('0x4f')][_0xc097('0x52')]=_0x534479['id'];return db[_0xc097('0x5c')][_0xc097('0x4e')](_0x30f99e[_0xc097('0x4f')]);}})[_0xc097('0x1b')](respondWithResult(_0x5f16c5,null))[_0xc097('0x24')](handleError(_0x5f16c5,null));};exports[_0xc097('0x5d')]=function(_0x364361,_0x5872f1,_0x4ce149){var _0x11389e={'raw':![],'where':{}};var _0x4abfb0={};var _0x4132e0={'count':0x0,'rows':[]};return db[_0xc097('0x35')][_0xc097('0x55')]({'where':{'id':_0x364361[_0xc097('0x50')]['id']}})[_0xc097('0x1b')](handleEntityNotFound(_0x5872f1,null))[_0xc097('0x1b')](function(_0x5c9816){if(_0x5c9816){_0x4abfb0[_0xc097('0x37')]=_[_0xc097('0x38')](db[_0xc097('0x5c')][_0xc097('0x36')]);_0x4abfb0[_0xc097('0x39')]=_[_0xc097('0x38')](_0x364361['query']);_0x4abfb0[_0xc097('0x41')]=_[_0xc097('0x3c')](_0x4abfb0[_0xc097('0x37')],_0x4abfb0[_0xc097('0x39')]);_0x11389e[_0xc097('0x3d')]=_[_0xc097('0x3c')](_0x4abfb0['model'],qs[_0xc097('0x3e')](_0x364361[_0xc097('0x39')][_0xc097('0x3e')]));_0x11389e[_0xc097('0x3d')]=_0x11389e[_0xc097('0x3d')][_0xc097('0x4c')]?_0x11389e[_0xc097('0x3d')]:_0x4abfb0[_0xc097('0x37')];if(!_0x364361[_0xc097('0x39')][_0xc097('0x56')](_0xc097('0x57'))){_0x11389e[_0xc097('0x2a')]=qs[_0xc097('0x2a')](_0x364361['query'][_0xc097('0x2a')]);_0x11389e['offset']=qs[_0xc097('0x29')](_0x364361[_0xc097('0x39')][_0xc097('0x29')]);}_0x11389e[_0xc097('0x3f')]=qs['sort'](_0x364361[_0xc097('0x39')][_0xc097('0x58')]);_0x11389e['where']=qs[_0xc097('0x41')](_[_0xc097('0x5e')](_0x364361['query'],_0x4abfb0[_0xc097('0x41')]));_0x11389e[_0xc097('0x40')][_0xc097('0x52')]=_0x5c9816['id'];if(_0x364361['query'][_0xc097('0x45')]){_0x11389e[_0xc097('0x40')]=_[_0xc097('0x43')](_0x11389e[_0xc097('0x40')],{'$or':_[_0xc097('0x44')](_0x11389e['attributes'],function(_0x1ecc3b){var _0x39bfa5={};_0x39bfa5[_0x1ecc3b]={'$like':'%'+_0x364361[_0xc097('0x39')][_0xc097('0x45')]+'%'};return _0x39bfa5;})});}_0x11389e=_[_0xc097('0x43')]({},_0x11389e,_0x364361['options']);return db[_0xc097('0x5c')][_0xc097('0x28')]({'where':_0x11389e['where']})['then'](function(_0x4a0947){_0x4132e0[_0xc097('0x28')]=_0x4a0947;if(_0x364361[_0xc097('0x39')][_0xc097('0x47')]){_0x11389e[_0xc097('0x48')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc097('0x49')](_0x11389e);})['then'](function(_0x498c15){_0x4132e0[_0xc097('0x4a')]=_0x498c15;return _0x4132e0;});}})[_0xc097('0x1b')](respondWithFilteredResult(_0x5872f1,_0x11389e))['catch'](handleError(_0x5872f1,null));};exports[_0xc097('0x5f')]=function(_0x714e2d,_0x457aee,_0x55da3e){var _0x25874f;return db[_0xc097('0x35')]['find']({'where':{'id':_0x714e2d['params']['id']}})['then'](handleEntityNotFound(_0x457aee,null))[_0xc097('0x1b')](function(_0x16fa0e){if(_0x16fa0e){return _0x16fa0e[_0xc097('0x5f')](_0x714e2d['query'][_0xc097('0x5a')]);}})['then'](respondWithStatusCode(_0x457aee,null))[_0xc097('0x24')](handleError(_0x457aee,null));};exports[_0xc097('0x60')]=function(_0x336935,_0x3f7a93,_0x1ccf1d){var _0x21a41f={'channel':_0xc097('0x61')};var _0x409c9c=[];var _0x1da739=[];var _0x285845={};return db[_0xc097('0x35')][_0xc097('0x4d')]({'where':{'id':_0x336935[_0xc097('0x50')]['id']},'include':[{'model':db[_0xc097('0x62')],'as':_0xc097('0x63')}]})[_0xc097('0x1b')](handleEntityNotFound(_0x3f7a93,null))[_0xc097('0x1b')](function(_0x1ccaa0){_0x21a41f[_0xc097('0x64')]=_0x1ccaa0;_0x21a41f[_0xc097('0x65')]=_[_0xc097('0x66')](_0x1ccaa0[_0xc097('0x63')],['priority'],[_0xc097('0x67')]);if(_0x21a41f['account'][_0xc097('0x63')]){delete _0x21a41f['account'][_0xc097('0x63')];}return db[_0xc097('0x68')]['describe']();})['then'](function(_0x594d75){if(!_0x594d75){throw new db['Sequelize'][(_0xc097('0x69'))](_0xc097('0x6a'));}_0x409c9c=_['difference'](_[_0xc097('0x38')](_0x594d75),[_0xc097('0x6b'),_0xc097('0x6c')]);_0x1da739=_['difference'](_['keys'](_0x594d75),['createdAt',_0xc097('0x6c'),_0xc097('0x6d'),_0xc097('0x6e')]);_0x21a41f[_0xc097('0x4f')]={'mapKey':_0xc097('0x6f')};if(_0x21a41f[_0xc097('0x64')][_0xc097('0x70')]){switch(_0x21a41f['account'][_0xc097('0x70')]){case _0xc097('0x71'):_0x21a41f['body'][_0xc097('0x72')]=_0x336935['body'][_0xc097('0x73')];_0x21a41f[_0xc097('0x4f')][_0xc097('0x4f')]=_0x336935['body'][_0xc097('0x74')];_0x21a41f[_0xc097('0x4f')][_0xc097('0x75')]=_0x336935[_0xc097('0x4f')][_0xc097('0x76')];break;case _0xc097('0x77'):_0x21a41f[_0xc097('0x4f')][_0xc097('0x72')]=_0x336935[_0xc097('0x4f')]['sender'];_0x21a41f[_0xc097('0x4f')][_0xc097('0x4f')]=_0x336935['body'][_0xc097('0x78')];break;case _0xc097('0x79'):_0x21a41f[_0xc097('0x4f')]['from']=_0x336935[_0xc097('0x4f')][_0xc097('0x72')];_0x21a41f[_0xc097('0x4f')][_0xc097('0x4f')]=_0x336935[_0xc097('0x4f')][_0xc097('0x22')];break;case'clicksend':_0x21a41f['body'][_0xc097('0x72')]=_0x336935[_0xc097('0x4f')][_0xc097('0x72')];_0x21a41f[_0xc097('0x4f')][_0xc097('0x4f')]=_0x336935[_0xc097('0x4f')]['body'];_0x21a41f[_0xc097('0x4f')][_0xc097('0x75')]=_0x336935[_0xc097('0x4f')][_0xc097('0x7a')];break;case _0xc097('0x7b'):_0x21a41f[_0xc097('0x4f')][_0xc097('0x72')]=_0x336935[_0xc097('0x4f')][_0xc097('0x73')];_0x21a41f[_0xc097('0x4f')][_0xc097('0x4f')]=_0x336935[_0xc097('0x4f')][_0xc097('0x7c')];_0x21a41f[_0xc097('0x4f')][_0xc097('0x75')]=_0x336935['body'][_0xc097('0x7d')];break;}}if(_0x21a41f[_0xc097('0x4f')]['id']){delete _0x21a41f[_0xc097('0x4f')]['id'];}if(_[_0xc097('0x7e')](_0x21a41f[_0xc097('0x4f')][_0xc097('0x72')])){throw new db['Sequelize'][(_0xc097('0x69'))](_0xc097('0x7f'));}if(_[_0xc097('0x7e')](_0x21a41f[_0xc097('0x4f')][_0xc097('0x4f')])||_0x21a41f[_0xc097('0x4f')][_0xc097('0x4f')]===''){throw new db[(_0xc097('0x80'))][(_0xc097('0x69'))](_0xc097('0x81'));}if(_[_0xc097('0x7e')](_0x21a41f[_0xc097('0x4f')][_0xc097('0x82')])){throw new db[(_0xc097('0x80'))][(_0xc097('0x69'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1da739);}if(!_[_0xc097('0x83')](_0x1da739,_0x21a41f[_0xc097('0x4f')][_0xc097('0x82')])){throw new db[(_0xc097('0x80'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1da739);}_0x285845[_0x21a41f[_0xc097('0x4f')][_0xc097('0x82')]]=_0x21a41f[_0xc097('0x4f')][_0xc097('0x72')];return db[_0xc097('0x84')][_0xc097('0x4d')]({'where':{'id':_0x21a41f[_0xc097('0x64')][_0xc097('0x6e')]},'include':[{'model':db[_0xc097('0x68')],'as':'Contacts','where':_0x285845,'limit':0x1,'order':[[_0xc097('0x6c'),_0xc097('0x85')]]}]});})[_0xc097('0x1b')](handleEntityNotFound(_0x3f7a93,null))[_0xc097('0x1b')](function(_0x5ecf2f){if(_0x5ecf2f){_0x21a41f[_0xc097('0x86')]=_[_0xc097('0x87')](_0x5ecf2f,[_0xc097('0x88')]);if(_0x5ecf2f[_0xc097('0x88')][_0xc097('0x4c')]){return _0x5ecf2f['Contacts'][0x0];}var _0x2a25c0=_[_0xc097('0x89')](_0x21a41f['body'],{'firstName':_0x21a41f[_0xc097('0x4f')][_0xc097('0x72')],'ListId':_0x5ecf2f['id']});_0x2a25c0[_0x21a41f['body'][_0xc097('0x82')]]=_0x21a41f['body']['from'];return db['CmContact'][_0xc097('0x4e')](_0x2a25c0,{'fields':_0x409c9c,'raw':!![]});}})[_0xc097('0x1b')](handleEntityNotFound(_0x3f7a93,null))[_0xc097('0x1b')](function(_0x1ac32e){if(_0x1ac32e){_0x21a41f[_0xc097('0x8a')]=_0x1ac32e;var _0x300cf9={'ContactId':_0x1ac32e['id'],'phone':_0x21a41f[_0xc097('0x4f')]['from'],'SmsAccountId':_0x336935[_0xc097('0x50')]['id']};var _0x694a81={'ContactId':_0x1ac32e['id'],'SmsAccountId':_0x336935['params']['id'],'closed':![]};return db['SmsInteraction'][_0xc097('0x4d')]({'where':_0x694a81})[_0xc097('0x1b')](function(_0x3b2694){if(_0x3b2694){return[_0x3b2694,![]];}return db[_0xc097('0x8b')][_0xc097('0x4e')](_0x300cf9)['then'](function(_0xa7fbe7){return[_0xa7fbe7,!![]];});});}})[_0xc097('0x8c')](function(_0x3a9b74,_0x3af78d){_0x21a41f['interaction']=_0x3a9b74['get']({'plain':!![]});_0x21a41f['interaction'][_0xc097('0x8d')]=![];if(_0x3af78d){if(_0x21a41f['account'][_0xc097('0x8e')]){_0x21a41f[_0xc097('0x65')][_0xc097('0x8f')]({'id':0x0,'priority':_0x21a41f[_0xc097('0x65')][_0xc097('0x4c')]+0x1,'app':_0xc097('0x90'),'appdata':_0xc097('0x91'),'interval':'*,*,*,*'});}_0x21a41f[_0xc097('0x92')][_0xc097('0x8d')]=!![];}return db[_0xc097('0x93')][_0xc097('0x4e')]({'phone':_0x21a41f[_0xc097('0x4f')][_0xc097('0x72')],'messageId':_0x21a41f[_0xc097('0x4f')][_0xc097('0x75')],'body':_0x21a41f[_0xc097('0x4f')][_0xc097('0x4f')],'SmsAccountId':_0x336935[_0xc097('0x50')]['id'],'SmsInteractionId':_0x3a9b74['id'],'direction':'in','ContactId':_0x3a9b74[_0xc097('0x94')],'AttachmentId':_0x21a41f[_0xc097('0x4f')][_0xc097('0x95')]});})[_0xc097('0x1b')](function(_0x15367c){_0x21a41f[_0xc097('0x22')]=_0x15367c;if(_0x21a41f[_0xc097('0x92')][_0xc097('0x96')]){return db[_0xc097('0x97')][_0xc097('0x4d')]({'attributes':['id',_0xc097('0x32')],'where':{'id':_0x21a41f[_0xc097('0x92')][_0xc097('0x96')]}})[_0xc097('0x1b')](function(_0x15dd08){if(_0x15dd08){_0x21a41f[_0xc097('0x65')][_0xc097('0x98')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x15dd08[_0xc097('0x32')]+','+(_0x21a41f[_0xc097('0x64')][_0xc097('0x99')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x21a41f);});}return respondWithRpcPromise('Start',_0xc097('0x9a'),_0x21a41f);})[_0xc097('0x1b')](function(_0x4990a9){if(_0x4990a9){var _0x4c5ece=0xc8;var _0x233aa8=_0xc097('0x9b');logger[_0xc097('0x9c')](_0xc097('0x9d'),_0x233aa8,_0x4c5ece,_0xc097('0x9e'));logger[_0xc097('0x1d')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x233aa8,_0x4c5ece,'entity\x20found',JSON[_0xc097('0x1f')](_0x4990a9));if(_0x21a41f[_0xc097('0x64')][_0xc097('0x70')]===_0xc097('0x71')){return _0x3f7a93[_0xc097('0x26')](_0x4c5ece)['set'](_0xc097('0x9f'),_0xc097('0xa0'))[_0xc097('0x33')](_0xc097('0xa1'));}else{return _0x3f7a93[_0xc097('0x26')](_0x4c5ece)[_0xc097('0x27')](_0x4990a9);}}})[_0xc097('0x24')](handleError(_0x3f7a93,null));};exports['addApplications']=function(_0x1fe566,_0x2f7b70,_0x4b50b4){return db[_0xc097('0x35')]['findOne']({'where':{'id':_0x1fe566[_0xc097('0x50')]['id']}})['then'](handleEntityNotFound(_0x2f7b70,null))[_0xc097('0x1b')](function(_0x31159b){if(_0x31159b){return db[_0xc097('0xa2')][_0xc097('0xa3')](function(_0x2ac14b){return db[_0xc097('0x62')]['destroy']({'where':{'SmsAccountId':_0x1fe566[_0xc097('0x50')]['id']},'transaction':_0x2ac14b})[_0xc097('0x1b')](function(_0x49e22e){var _0x557bfb=_['map'](_0x1fe566[_0xc097('0x4f')],function(_0x2aba0d){_0x2aba0d[_0xc097('0x52')]=_0x1fe566[_0xc097('0x50')]['id'];return _0x2aba0d;});return db[_0xc097('0x62')][_0xc097('0xa4')](_0x557bfb,{'transaction':_0x2ac14b});});})[_0xc097('0x1b')](function(){return db[_0xc097('0x62')][_0xc097('0xa5')]({'where':{'SmsAccountId':_0x1fe566[_0xc097('0x50')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x2f7b70,null))['catch'](handleError(_0x2f7b70,null));};exports[_0xc097('0xa6')]=function(_0x88523e,_0x569dec,_0x36b32c){var _0x4dad3b={};var _0x27b572={};var _0x1b7300;var _0x322551;return db[_0xc097('0x35')][_0xc097('0x55')]({'where':{'id':_0x88523e['params']['id']}})[_0xc097('0x1b')](handleEntityNotFound(_0x569dec,null))[_0xc097('0x1b')](function(_0x28ae0e){if(_0x28ae0e){_0x1b7300=_0x28ae0e;_0x27b572[_0xc097('0x37')]=_[_0xc097('0x38')](db['SmsApplication'][_0xc097('0x36')]);_0x27b572['query']=_['keys'](_0x88523e['query']);_0x27b572[_0xc097('0x41')]=_[_0xc097('0x3c')](_0x27b572['model'],_0x27b572[_0xc097('0x39')]);_0x4dad3b['attributes']=_[_0xc097('0x3c')](_0x27b572[_0xc097('0x37')],qs['fields'](_0x88523e[_0xc097('0x39')][_0xc097('0x3e')]));_0x4dad3b[_0xc097('0x3d')]=_0x4dad3b[_0xc097('0x3d')][_0xc097('0x4c')]?_0x4dad3b[_0xc097('0x3d')]:_0x27b572[_0xc097('0x37')];_0x4dad3b[_0xc097('0x3f')]=qs[_0xc097('0x58')](_0x88523e[_0xc097('0x39')]['sort']);_0x4dad3b[_0xc097('0x40')]=qs[_0xc097('0x41')](_['pick'](_0x88523e[_0xc097('0x39')],_0x27b572[_0xc097('0x41')]));if(_0x88523e[_0xc097('0x39')][_0xc097('0x45')]){_0x4dad3b[_0xc097('0x40')]=_['merge'](_0x4dad3b['where'],{'$or':_[_0xc097('0x44')](_0x4dad3b[_0xc097('0x3d')],function(_0x2f5d96){var _0x32b1e5={};_0x32b1e5[_0x2f5d96]={'$like':'%'+_0x88523e[_0xc097('0x39')][_0xc097('0x45')]+'%'};return _0x32b1e5;})});}_0x4dad3b=_[_0xc097('0x43')]({},_0x4dad3b,_0x88523e[_0xc097('0x46')]);return _0x1b7300[_0xc097('0xa6')](_0x4dad3b);}})[_0xc097('0x1b')](function(_0x1f6e47){if(_0x1f6e47){_0x322551=_0x1f6e47[_0xc097('0x4c')];if(!_0x88523e[_0xc097('0x39')][_0xc097('0x56')]('nolimit')){_0x4dad3b[_0xc097('0x2a')]=qs['limit'](_0x88523e[_0xc097('0x39')][_0xc097('0x2a')]);_0x4dad3b[_0xc097('0x29')]=qs['offset'](_0x88523e['query']['offset']);}return _0x1b7300[_0xc097('0xa6')](_0x4dad3b);}})['then'](function(_0x569d4d){if(_0x569d4d){return _0x569d4d?{'count':_0x322551,'rows':_0x569d4d}:null;}})[_0xc097('0x1b')](respondWithResult(_0x569dec,null))[_0xc097('0x24')](handleError(_0x569dec,null));};exports[_0xc097('0xa7')]=function(_0x118721,_0x50009c,_0x4bb698){var _0x47c148={'raw':![],'where':{}};var _0x32e11a={};var _0x2a43cb={'count':0x0,'rows':[]};return db[_0xc097('0x35')][_0xc097('0x55')]({'where':{'id':_0x118721[_0xc097('0x50')]['id']}})[_0xc097('0x1b')](handleEntityNotFound(_0x50009c,null))[_0xc097('0x1b')](function(_0x2e4f5d){if(_0x2e4f5d){_0x32e11a[_0xc097('0x37')]=_['keys'](db[_0xc097('0x8b')][_0xc097('0x36')]);_0x32e11a['query']=_['keys'](_0x118721[_0xc097('0x39')]);_0x32e11a[_0xc097('0x41')]=_['intersection'](_0x32e11a[_0xc097('0x37')],_0x32e11a[_0xc097('0x39')]);_0x47c148[_0xc097('0x3d')]=_[_0xc097('0x3c')](_0x32e11a[_0xc097('0x37')],qs['fields'](_0x118721['query']['fields']));_0x47c148['attributes']=_0x47c148[_0xc097('0x3d')][_0xc097('0x4c')]?_0x47c148[_0xc097('0x3d')]:_0x32e11a[_0xc097('0x37')];if(!_0x118721[_0xc097('0x39')][_0xc097('0x56')](_0xc097('0x57'))){_0x47c148[_0xc097('0x2a')]=qs[_0xc097('0x2a')](_0x118721[_0xc097('0x39')][_0xc097('0x2a')]);_0x47c148[_0xc097('0x29')]=qs['offset'](_0x118721[_0xc097('0x39')][_0xc097('0x29')]);}_0x47c148[_0xc097('0x3f')]=qs[_0xc097('0x58')](_0x118721['query'][_0xc097('0x58')]);_0x47c148[_0xc097('0x40')]=qs[_0xc097('0x41')](_['pick'](_0x118721[_0xc097('0x39')],_0x32e11a['filters']));_0x47c148[_0xc097('0x40')]['SmsAccountId']=_0x2e4f5d['id'];if(_0x118721[_0xc097('0x39')][_0xc097('0x45')]){_0x47c148[_0xc097('0x40')]=_['merge'](_0x47c148[_0xc097('0x40')],{'$or':_[_0xc097('0x44')](_0x47c148['attributes'],function(_0x5b7fc4){var _0x2fc75c={};_0x2fc75c[_0x5b7fc4]={'$like':'%'+_0x118721[_0xc097('0x39')]['filter']+'%'};return _0x2fc75c;})});}_0x47c148=_['merge']({},_0x47c148,_0x118721[_0xc097('0x46')]);return db[_0xc097('0x8b')][_0xc097('0x28')]({'where':_0x47c148[_0xc097('0x40')]})[_0xc097('0x1b')](function(_0x5bc5c4){_0x2a43cb[_0xc097('0x28')]=_0x5bc5c4;if(_0x118721[_0xc097('0x39')]['includeAll']){_0x47c148[_0xc097('0x48')]=[{'model':db[_0xc097('0x68')],'as':_0xc097('0xa8'),'required':![]},{'model':db[_0xc097('0x97')],'as':'Owner','attributes':[_0xc097('0x32'),_0xc097('0xa9'),_0xc097('0xaa')],'required':![]},{'model':db[_0xc097('0xab')],'as':_0xc097('0xac'),'attributes':['id','name','color'],'where':_0x118721[_0xc097('0x39')][_0xc097('0xad')]?{'id':_0x118721['query'][_0xc097('0xad')]}:undefined,'required':_0x118721[_0xc097('0x39')][_0xc097('0xad')]?!![]:![]}];}return db[_0xc097('0x8b')]['findAll'](_0x47c148);})[_0xc097('0x1b')](function(_0x53f3d5){_0x2a43cb[_0xc097('0x4a')]=_0x53f3d5;return _0x2a43cb;});}})['then'](respondWithFilteredResult(_0x50009c,_0x47c148))['catch'](handleError(_0x50009c,null));};exports[_0xc097('0x33')]=function(_0x58616c,_0x4d8fd9,_0x3804ff){var _0x2e52d7,_0x52221a,_0x48c823;if(_[_0xc097('0x7e')](_0x58616c[_0xc097('0x4f')]['body'])||_0x58616c[_0xc097('0x4f')][_0xc097('0x4f')]===''){throw new db[(_0xc097('0x80'))][(_0xc097('0x69'))](_0xc097('0x81'));}if(_['isNil'](_0x58616c[_0xc097('0x4f')]['to'])){throw new db[(_0xc097('0x80'))][(_0xc097('0x69'))](_0xc097('0xae'));}_0x2e52d7=_0x58616c[_0xc097('0x4f')]['to'];return db[_0xc097('0x35')][_0xc097('0x4d')]({'where':{'id':_0x58616c[_0xc097('0x50')]['id']},'include':[{'model':db[_0xc097('0x84')],'as':_0xc097('0xaf'),'include':[{'model':db['CmContact'],'as':_0xc097('0x88'),'where':{'mobile':_0x2e52d7},'limit':0x1,'order':[[_0xc097('0x6c'),_0xc097('0x85')]]}]}]})[_0xc097('0x1b')](handleEntityNotFound(_0x4d8fd9,null))[_0xc097('0x1b')](function(_0x3f2c47){if(_0x3f2c47&&_0x3f2c47['List']){_0x52221a=_0x3f2c47[_0xc097('0xb0')]({'plain':!![]});if(_0x52221a['List']&&_0x52221a[_0xc097('0xaf')]['Contacts'][_0xc097('0x4c')]){return _0x52221a[_0xc097('0xaf')][_0xc097('0x88')][0x0];}return db[_0xc097('0x68')][_0xc097('0x4e')](_[_0xc097('0x89')](_0x58616c['body'],{'firstName':_0x2e52d7,'mobile':_0x2e52d7,'phone':_0x2e52d7,'ListId':_0x52221a[_0xc097('0x6e')]}));}})[_0xc097('0x1b')](handleEntityNotFound(_0x4d8fd9,null))[_0xc097('0x1b')](function(_0x14f7b2){if(_0x14f7b2){_0x48c823=_0x14f7b2;return db[_0xc097('0x8b')][_0xc097('0x4d')]({'where':{'ContactId':_0x48c823['id'],'closed':![],'SmsAccountId':_0x52221a['id']}})[_0xc097('0x1b')](function(_0x4c0215){if(_0x4c0215){return[_0x4c0215,![]];}return db[_0xc097('0x8b')][_0xc097('0x4e')]({'UserId':_0x58616c[_0xc097('0xb1')]['id'],'ContactId':_0x48c823['id'],'SmsAccountId':_0x52221a['id'],'phone':_0x2e52d7,'firstMsgDirection':_0xc097('0xb2'),'Messages':[_['merge'](_0x58616c[_0xc097('0x4f')],{'read':![],'body':_0x58616c[_0xc097('0x4f')][_0xc097('0x4f')],'phone':_0x2e52d7,'SmsAccountId':_0x52221a['id'],'UserId':_0x58616c[_0xc097('0xb1')]['id'],'ContactId':_0x48c823['id']})]},{'include':[{'model':db[_0xc097('0x93')],'as':_0xc097('0xb3')}]})[_0xc097('0x1b')](function(_0x1cc8db){return[_0x1cc8db,!![]];});});}})[_0xc097('0x8c')](function(_0x5d79fd,_0x3bef4b){if(_0x3bef4b){return _0x5d79fd;}return db[_0xc097('0x93')][_0xc097('0x4e')](_['merge'](_0x58616c[_0xc097('0x4f')],{'read':![],'body':_0x58616c[_0xc097('0x4f')][_0xc097('0x4f')],'phone':_0x2e52d7,'SmsAccountId':_0x52221a['id'],'SmsInteractionId':_0x5d79fd['id'],'UserId':_0x58616c[_0xc097('0xb1')]['id'],'ContactId':_0x48c823['id']}))[_0xc097('0x1b')](function(_0x1d5b20){_0x5d79fd[_0xc097('0xb4')][_0xc097('0xb3')]=[];_0x5d79fd[_0xc097('0xb4')][_0xc097('0xb3')][_0xc097('0x8f')](_0x1d5b20[_0xc097('0xb4')]);return _0x5d79fd;});})[_0xc097('0x1b')](respondWithResult(_0x4d8fd9,null))['catch'](handleError(_0x4d8fd9,null));};exports['status']=function(_0x5d1136,_0x417fc5,_0x54a3d7){if(_0x5d1136[_0xc097('0x4f')]['id']){delete _0x5d1136[_0xc097('0x4f')]['id'];}var _0x50968e,_0x675899,_0x4e2190;return db['SmsAccount'][_0xc097('0x4d')]({'where':{'id':_0x5d1136['params']['id']}})[_0xc097('0x1b')](handleEntityNotFound(_0x417fc5,null))[_0xc097('0x1b')](function(_0x2ca579){if(_0x2ca579){_0x4e2190=_0x2ca579;logger[_0xc097('0x1d')](_0xc097('0x9d'),_0xc097('0x26'),_0xc097('0xb5'),_0x2ca579[_0xc097('0x70')],util[_0xc097('0xb6')](_0x5d1136[_0xc097('0x4f')],{'showHidden':![],'depth':null}));switch(_0x2ca579['type']){case _0xc097('0x77'):if(_0x5d1136[_0xc097('0x4f')][_0xc097('0xb7')]&&_0x5d1136[_0xc097('0x4f')][_0xc097('0x26')]){_0x675899=_0x5d1136[_0xc097('0x4f')]['status'];return db[_0xc097('0x93')][_0xc097('0x4d')]({'where':{'messageId':_0x5d1136[_0xc097('0x4f')][_0xc097('0xb7')]}});}break;case _0xc097('0x79'):if(_0x5d1136[_0xc097('0x4f')][_0xc097('0xb8')]&&_0x5d1136['body'][_0xc097('0xb9')]){_0x675899=_0x5d1136[_0xc097('0x4f')]['statusInt'];return db['SmsMessage']['find']({'where':{'messageId':_0x5d1136[_0xc097('0x4f')]['requestid']}});}break;case _0xc097('0xba'):if(_0x5d1136['body'][_0xc097('0x7a')]&&_0x5d1136[_0xc097('0x4f')][_0xc097('0xbb')]){_0x675899=_0x5d1136[_0xc097('0x4f')][_0xc097('0xbb')];return db[_0xc097('0x93')][_0xc097('0x4d')]({'where':{'messageId':_0x5d1136[_0xc097('0x4f')][_0xc097('0x7a')]}});}break;}}})[_0xc097('0x1b')](handleEntityNotFound(_0x417fc5,null))[_0xc097('0x1b')](function(_0x56a101){if(_0x56a101){_0x50968e=_0x56a101;switch(_0x4e2190[_0xc097('0x70')]){case _0xc097('0x77'):if(_0x675899==='DELIVERED'){return _0x50968e[_0xc097('0x2e')]({'read':!![]});}else{logger[_0xc097('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc097('0x26'),_0xc097('0x77'),util[_0xc097('0xb6')](_0x5d1136[_0xc097('0x4f')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x675899==='1'){return _0x50968e[_0xc097('0x2e')]({'read':!![]});}else{logger[_0xc097('0x20')](_0xc097('0x9d'),_0xc097('0x26'),_0xc097('0x77'),util[_0xc097('0xb6')](_0x5d1136[_0xc097('0x4f')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x5d1136[_0xc097('0x4f')][_0xc097('0xbc')]&&_0x675899>=0xc8&&_0x675899<=0xce){return _0x50968e[_0xc097('0x2e')]({'read':!![]});}else{logger[_0xc097('0x20')](_0xc097('0x9d'),_0xc097('0x26'),_0xc097('0xba'),util[_0xc097('0xb6')](_0x5d1136[_0xc097('0x4f')],{'showHidden':![],'depth':null}));}break;}return _0x50968e;}})[_0xc097('0x1b')](respondWithResult(_0x417fc5,null))[_0xc097('0x24')](handleError(_0x417fc5,null));};exports[_0xc097('0xbd')]=function(_0x450a6c,_0x402f41,_0x2a6be0){return db[_0xc097('0x35')][_0xc097('0x4d')]({'where':{'id':_0x450a6c[_0xc097('0x50')]['id']}})[_0xc097('0x1b')](handleEntityNotFound(_0x402f41,null))['then'](function(_0x3b200a){if(_0x3b200a){return _0x3b200a[_0xc097('0xbd')](_0x450a6c[_0xc097('0x4f')][_0xc097('0x5a')],_[_0xc097('0x87')](_0x450a6c[_0xc097('0x4f')],[_0xc097('0x5a'),'id'])||{})[_0xc097('0x8c')](function(_0x616231){for(var _0x12947c=0x0;_0x12947c<_0x450a6c[_0xc097('0x4f')][_0xc097('0x5a')][_0xc097('0x4c')];_0x12947c+=0x1){socket[_0xc097('0xbe')]('userSmsAccount:save',{'UserId':_0x450a6c[_0xc097('0x4f')][_0xc097('0x5a')][_0x12947c],'SmsAccountId':_0x450a6c[_0xc097('0x50')]['id']});}return _0x616231;});}})[_0xc097('0x1b')](respondWithResult(_0x402f41,null))[_0xc097('0x24')](handleError(_0x402f41,null));};exports['removeAgents']=function(_0x49929e,_0x385d03,_0x8099d3){var _0x3d47df;return db[_0xc097('0x35')][_0xc097('0x4d')]({'where':{'id':_0x49929e[_0xc097('0x50')]['id']}})['then'](handleEntityNotFound(_0x385d03,null))[_0xc097('0x1b')](function(_0x13d7ad){if(_0x13d7ad){return _0x13d7ad[_0xc097('0xbf')](_0x49929e[_0xc097('0x39')]['ids'])['then'](function(_0x2909a1){if(_['isArray'](_0x49929e[_0xc097('0x39')][_0xc097('0x5a')])){for(var _0x3e5513=0x0;_0x3e5513<_0x49929e[_0xc097('0x39')][_0xc097('0x5a')][_0xc097('0x4c')];_0x3e5513+=0x1){socket[_0xc097('0xbe')](_0xc097('0xc0'),{'UserId':_0x49929e[_0xc097('0x39')]['ids'][_0x3e5513],'SmsAccountId':_0x49929e['params']['id']});}}else{socket[_0xc097('0xbe')]('userSmsAccount:remove',{'UserId':_0x49929e[_0xc097('0x39')][_0xc097('0x5a')],'SmsAccountId':_0x49929e[_0xc097('0x50')]['id']});}});}})[_0xc097('0x1b')](respondWithStatusCode(_0x385d03,null))[_0xc097('0x24')](handleError(_0x385d03,null));};exports[_0xc097('0xc1')]=function(_0x3e57b1,_0x1d5533,_0x2ca447){var _0x29b804={};var _0x6dc97e={};var _0x2b6d32;var _0x37206a;return db[_0xc097('0x35')][_0xc097('0x55')]({'where':{'id':_0x3e57b1[_0xc097('0x50')]['id']}})[_0xc097('0x1b')](handleEntityNotFound(_0x1d5533,null))['then'](function(_0x284b69){if(_0x284b69){_0x2b6d32=_0x284b69;_0x6dc97e[_0xc097('0x37')]=_[_0xc097('0x38')](db[_0xc097('0x97')]['rawAttributes']);_0x6dc97e[_0xc097('0x39')]=_[_0xc097('0x38')](_0x3e57b1[_0xc097('0x39')]);_0x6dc97e[_0xc097('0x41')]=_[_0xc097('0x3c')](_0x6dc97e[_0xc097('0x37')],_0x6dc97e['query']);_0x29b804[_0xc097('0x3d')]=_[_0xc097('0x3c')](_0x6dc97e['model'],qs[_0xc097('0x3e')](_0x3e57b1['query']['fields']));_0x29b804[_0xc097('0x3d')]=_0x29b804['attributes'][_0xc097('0x4c')]?_0x29b804[_0xc097('0x3d')]:_0x6dc97e[_0xc097('0x37')];_0x29b804[_0xc097('0x3f')]=qs['sort'](_0x3e57b1[_0xc097('0x39')][_0xc097('0x58')]);_0x29b804[_0xc097('0x40')]=qs[_0xc097('0x41')](_[_0xc097('0x5e')](_0x3e57b1[_0xc097('0x39')],_0x6dc97e[_0xc097('0x41')]));if(_0x3e57b1[_0xc097('0x39')]['filter']){_0x29b804[_0xc097('0x40')]=_[_0xc097('0x43')](_0x29b804[_0xc097('0x40')],{'$or':_[_0xc097('0x44')](_0x29b804['attributes'],function(_0x16fad9){var _0x4ec636={};_0x4ec636[_0x16fad9]={'$like':'%'+_0x3e57b1['query']['filter']+'%'};return _0x4ec636;})});}_0x29b804=_[_0xc097('0x43')]({},_0x29b804,_0x3e57b1[_0xc097('0x46')]);return _0x2b6d32['getAgents'](_0x29b804);}})[_0xc097('0x1b')](function(_0x2a38b7){if(_0x2a38b7){_0x37206a=_0x2a38b7[_0xc097('0x4c')];if(!_0x3e57b1[_0xc097('0x39')][_0xc097('0x56')](_0xc097('0x57'))){_0x29b804[_0xc097('0x2a')]=qs['limit'](_0x3e57b1['query'][_0xc097('0x2a')]);_0x29b804[_0xc097('0x29')]=qs[_0xc097('0x29')](_0x3e57b1[_0xc097('0x39')][_0xc097('0x29')]);}return _0x2b6d32[_0xc097('0xc1')](_0x29b804);}})[_0xc097('0x1b')](function(_0x4f950c){if(_0x4f950c){return _0x4f950c?{'count':_0x37206a,'rows':_0x4f950c}:null;}})[_0xc097('0x1b')](respondWithResult(_0x1d5533,null))['catch'](handleError(_0x1d5533,null));};
\ No newline at end of file
index a0ef428..ec4413c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fdf=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsAccount','setMaxListeners','save','update'];(function(_0x2a9873,_0x52b787){var _0x4a1106=function(_0x107892){while(--_0x107892){_0x2a9873['push'](_0x2a9873['shift']());}};_0x4a1106(++_0x52b787);}(_0x6fdf,0xea));var _0xf6fd=function(_0xbd3500,_0x1054b9){_0xbd3500=_0xbd3500-0x0;var _0xbfbbdb=_0x6fdf[_0xbd3500];return _0xbfbbdb;};'use strict';var EventEmitter=require(_0xf6fd('0x0'));var SmsAccount=require(_0xf6fd('0x1'))['db'][_0xf6fd('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xf6fd('0x3')](0x0);var events={'afterCreate':_0xf6fd('0x4'),'afterUpdate':_0xf6fd('0x5'),'afterDestroy':_0xf6fd('0x6')};function emitEvent(_0x4ce1fa){return function(_0x5007fd,_0x13f370,_0x48df02){SmsAccountEvents['emit'](_0x4ce1fa+':'+_0x5007fd['id'],_0x5007fd);SmsAccountEvents[_0xf6fd('0x7')](_0x4ce1fa,_0x5007fd);_0x48df02(null);};}for(var e in events){if(events[_0xf6fd('0x8')](e)){var event=events[e];SmsAccount[_0xf6fd('0x9')](e,emitEvent(event));}}module['exports']=SmsAccountEvents;
\ No newline at end of file
+var _0xc118=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','save'];(function(_0xa18766,_0x5319ac){var _0x4b8968=function(_0x5d69f0){while(--_0x5d69f0){_0xa18766['push'](_0xa18766['shift']());}};_0x4b8968(++_0x5319ac);}(_0xc118,0x114));var _0x8c11=function(_0x5c1d0d,_0x3fc558){_0x5c1d0d=_0x5c1d0d-0x0;var _0x3853d1=_0xc118[_0x5c1d0d];return _0x3853d1;};'use strict';var EventEmitter=require(_0x8c11('0x0'));var SmsAccount=require(_0x8c11('0x1'))['db'][_0x8c11('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8c11('0x3'),'afterUpdate':_0x8c11('0x4'),'afterDestroy':_0x8c11('0x5')};function emitEvent(_0x15a7a3){return function(_0x15b50d,_0x5d5303,_0x57e7ad){SmsAccountEvents[_0x8c11('0x6')](_0x15a7a3+':'+_0x15b50d['id'],_0x15b50d);SmsAccountEvents['emit'](_0x15a7a3,_0x15b50d);_0x57e7ad(null);};}for(var e in events){if(events[_0x8c11('0x7')](e)){var event=events[e];SmsAccount[_0x8c11('0x8')](e,emitEvent(event));}}module[_0x8c11('0x9')]=SmsAccountEvents;
\ No newline at end of file
index 84a0124..7981b79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4849=['api','moment','bluebird','request-promise','./smsAccount.attributes','exports','define','util','../../config/logger'];(function(_0x53e44f,_0x2d5c44){var _0x12a42d=function(_0x68d037){while(--_0x68d037){_0x53e44f['push'](_0x53e44f['shift']());}};_0x12a42d(++_0x2d5c44);}(_0x4849,0x181));var _0x9484=function(_0x5059fd,_0x5ed7ff){_0x5059fd=_0x5059fd-0x0;var _0x252411=_0x4849[_0x5059fd];return _0x252411;};'use strict';var _=require('lodash');var util=require(_0x9484('0x0'));var logger=require(_0x9484('0x1'))(_0x9484('0x2'));var moment=require(_0x9484('0x3'));var BPromise=require(_0x9484('0x4'));var rp=require(_0x9484('0x5'));var attributes=require(_0x9484('0x6'));module[_0x9484('0x7')]=function(_0x95b89e,_0x527e08){return _0x95b89e[_0x9484('0x8')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x70f9=['moment','request-promise','exports','define','SmsAccount','../../config/logger','api'];(function(_0x1ff3cb,_0x161f22){var _0x52fac7=function(_0x544913){while(--_0x544913){_0x1ff3cb['push'](_0x1ff3cb['shift']());}};_0x52fac7(++_0x161f22);}(_0x70f9,0x14e));var _0x970f=function(_0x5a25f6,_0x3db5cb){_0x5a25f6=_0x5a25f6-0x0;var _0x5a524d=_0x70f9[_0x5a25f6];return _0x5a524d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x970f('0x0'))(_0x970f('0x1'));var moment=require(_0x970f('0x2'));var BPromise=require('bluebird');var rp=require(_0x970f('0x3'));var attributes=require('./smsAccount.attributes');module[_0x970f('0x4')]=function(_0x5a3196,_0x21529f){return _0x5a3196[_0x970f('0x5')](_0x970f('0x6'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 960be91..3a8bb16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x523d=['then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','debug','util','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','socket.io-emitter','localhost','./smsAccount.socket','register'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x523d,0x1a2));var _0xd523=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x523d[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xd523('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd523('0x1'));var fs=require('fs');var db=require(_0xd523('0x2'))['db'];var utils=require(_0xd523('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd523('0x4'));var client=jayson[_0xd523('0x5')][_0xd523('0x6')]({'port':0x232a});var socket=require(_0xd523('0x7'))({'host':_0xd523('0x8'),'port':0x18eb});require(_0xd523('0x9'))[_0xd523('0xa')](socket);function respondWithRpcPromise(_0x4a75c7,_0x4a9baa,_0xe69bf4){return new BPromise(function(_0x452613,_0x186ee7){return client['request'](_0x4a75c7,_0xe69bf4)[_0xd523('0xb')](function(_0x3d371f){logger[_0xd523('0xc')](_0xd523('0xd'),_0x4a9baa,_0xd523('0xe'));logger['debug'](_0xd523('0xf'),_0x4a9baa,'request\x20sent',JSON[_0xd523('0x10')](_0x3d371f));if(_0x3d371f[_0xd523('0x11')]){if(_0x3d371f['error'][_0xd523('0x12')]===0x1f4){logger['error'](_0xd523('0xd'),_0x4a9baa,_0x3d371f[_0xd523('0x11')][_0xd523('0x13')]);return _0x186ee7(_0x3d371f[_0xd523('0x11')][_0xd523('0x13')]);}logger['error'](_0xd523('0xd'),_0x4a9baa,_0x3d371f[_0xd523('0x11')][_0xd523('0x13')]);return _0x452613(_0x3d371f[_0xd523('0x11')]['message']);}else{logger[_0xd523('0xc')]('SmsAccount,\x20%s,\x20%s',_0x4a9baa,_0xd523('0xe'));_0x452613(_0x3d371f[_0xd523('0x14')][_0xd523('0x13')]);}})[_0xd523('0x15')](function(_0x51fc05){logger['error'](_0xd523('0xd'),_0x4a9baa,_0x51fc05);_0x186ee7(_0x51fc05);});});}exports[_0xd523('0x16')]=function(_0x178230){var _0x565cc5=this;return new Promise(function(_0x384bba,_0x31aa12){return db[_0xd523('0x17')][_0xd523('0x18')]({'raw':_0x178230[_0xd523('0x19')]?_0x178230[_0xd523('0x19')][_0xd523('0x1a')]===undefined?!![]:![]:!![],'where':_0x178230[_0xd523('0x19')]?_0x178230[_0xd523('0x19')][_0xd523('0x1b')]||null:null,'attributes':_0x178230['options']?_0x178230[_0xd523('0x19')][_0xd523('0x1c')]||null:null,'include':_0x178230[_0xd523('0x19')]?_0x178230[_0xd523('0x19')][_0xd523('0x1d')]?_[_0xd523('0x1e')](_0x178230[_0xd523('0x19')][_0xd523('0x1d')],function(_0x182ac0){return{'model':db[_0x182ac0[_0xd523('0x1f')]],'as':_0x182ac0['as'],'attributes':_0x182ac0[_0xd523('0x1c')],'include':_0x182ac0['include']?_[_0xd523('0x1e')](_0x182ac0['include'],function(_0x126702){return{'model':db[_0x126702[_0xd523('0x1f')]],'as':_0x126702['as'],'attributes':_0x126702[_0xd523('0x1c')],'include':_0x126702[_0xd523('0x1d')]?_['map'](_0x126702[_0xd523('0x1d')],function(_0x3d3594){return{'model':db[_0x3d3594[_0xd523('0x1f')]],'as':_0x3d3594['as'],'attributes':_0x3d3594[_0xd523('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd2c6cc){logger['info'](_0xd523('0x16'),_0x178230);logger[_0xd523('0x20')](_0xd523('0x16'),_0x178230,JSON[_0xd523('0x10')](_0xd2c6cc));_0x384bba(_0xd2c6cc);})[_0xd523('0x15')](function(_0x1d98cb){logger['error'](_0xd523('0x16'),_0x1d98cb[_0xd523('0x13')],_0x178230);_0x31aa12(_0x565cc5[_0xd523('0x11')](0x1f4,_0x1d98cb['message']));});});};
\ No newline at end of file
+var _0xf06e=['request\x20sent','result','catch','SmsAccount','find','options','raw','where','include','map','model','attributes','ShowSmsAccount','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter','./smsAccount.socket','then','info','SmsAccount,\x20%s,\x20%s','debug','error','code','message'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xf06e,0x18f));var _0xef06=function(_0x23a4ed,_0x52b34e){_0x23a4ed=_0x23a4ed-0x0;var _0x1f9a9b=_0xf06e[_0x23a4ed];return _0x1f9a9b;};'use strict';var _=require(_0xef06('0x0'));var util=require(_0xef06('0x1'));var moment=require(_0xef06('0x2'));var BPromise=require(_0xef06('0x3'));var rs=require('randomstring');var fs=require('fs');var db=require(_0xef06('0x4'))['db'];var utils=require(_0xef06('0x5'));var logger=require(_0xef06('0x6'))(_0xef06('0x7'));var config=require(_0xef06('0x8'));var jayson=require(_0xef06('0x9'));var client=jayson[_0xef06('0xa')][_0xef06('0xb')]({'port':0x232a});var socket=require(_0xef06('0xc'))({'host':'localhost','port':0x18eb});require(_0xef06('0xd'))['register'](socket);function respondWithRpcPromise(_0x513adc,_0x3a950d,_0x4cfc81){return new BPromise(function(_0x575fc2,_0x8ebd21){return client['request'](_0x513adc,_0x4cfc81)[_0xef06('0xe')](function(_0x2c2f1c){logger[_0xef06('0xf')](_0xef06('0x10'),_0x3a950d,'request\x20sent');logger[_0xef06('0x11')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3a950d,'request\x20sent',JSON['stringify'](_0x2c2f1c));if(_0x2c2f1c['error']){if(_0x2c2f1c[_0xef06('0x12')][_0xef06('0x13')]===0x1f4){logger['error'](_0xef06('0x10'),_0x3a950d,_0x2c2f1c['error'][_0xef06('0x14')]);return _0x8ebd21(_0x2c2f1c[_0xef06('0x12')][_0xef06('0x14')]);}logger[_0xef06('0x12')](_0xef06('0x10'),_0x3a950d,_0x2c2f1c['error'][_0xef06('0x14')]);return _0x575fc2(_0x2c2f1c[_0xef06('0x12')]['message']);}else{logger[_0xef06('0xf')](_0xef06('0x10'),_0x3a950d,_0xef06('0x15'));_0x575fc2(_0x2c2f1c[_0xef06('0x16')]['message']);}})[_0xef06('0x17')](function(_0x68ef79){logger[_0xef06('0x12')](_0xef06('0x10'),_0x3a950d,_0x68ef79);_0x8ebd21(_0x68ef79);});});}exports['ShowSmsAccount']=function(_0x57bcbe){var _0x39b647=this;return new Promise(function(_0x2bf01b,_0x4448a6){return db[_0xef06('0x18')][_0xef06('0x19')]({'raw':_0x57bcbe['options']?_0x57bcbe[_0xef06('0x1a')][_0xef06('0x1b')]===undefined?!![]:![]:!![],'where':_0x57bcbe[_0xef06('0x1a')]?_0x57bcbe[_0xef06('0x1a')][_0xef06('0x1c')]||null:null,'attributes':_0x57bcbe['options']?_0x57bcbe[_0xef06('0x1a')]['attributes']||null:null,'include':_0x57bcbe[_0xef06('0x1a')]?_0x57bcbe['options'][_0xef06('0x1d')]?_[_0xef06('0x1e')](_0x57bcbe[_0xef06('0x1a')][_0xef06('0x1d')],function(_0x1e0b15){return{'model':db[_0x1e0b15[_0xef06('0x1f')]],'as':_0x1e0b15['as'],'attributes':_0x1e0b15[_0xef06('0x20')],'include':_0x1e0b15[_0xef06('0x1d')]?_[_0xef06('0x1e')](_0x1e0b15[_0xef06('0x1d')],function(_0x360b04){return{'model':db[_0x360b04[_0xef06('0x1f')]],'as':_0x360b04['as'],'attributes':_0x360b04[_0xef06('0x20')],'include':_0x360b04[_0xef06('0x1d')]?_[_0xef06('0x1e')](_0x360b04[_0xef06('0x1d')],function(_0x5a7fbc){return{'model':db[_0x5a7fbc['model']],'as':_0x5a7fbc['as'],'attributes':_0x5a7fbc[_0xef06('0x20')]};}):[]};}):[]};}):[]:[]})[_0xef06('0xe')](function(_0x3aecc5){logger[_0xef06('0xf')](_0xef06('0x21'),_0x57bcbe);logger[_0xef06('0x11')](_0xef06('0x21'),_0x57bcbe,JSON[_0xef06('0x22')](_0x3aecc5));_0x2bf01b(_0x3aecc5);})[_0xef06('0x17')](function(_0x302577){logger[_0xef06('0x12')](_0xef06('0x21'),_0x302577[_0xef06('0x14')],_0x57bcbe);_0x4448a6(_0x39b647[_0xef06('0x12')](0x1f4,_0x302577['message']));});});};
\ No newline at end of file
index 91292e2..5d083cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae9c=['register','length','./smsAccount.events','save','remove','update','emit','removeListener'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xae9c,0xda));var _0xcae9=function(_0x2cd512,_0x583699){_0x2cd512=_0x2cd512-0x0;var _0x2a4364=_0xae9c[_0x2cd512];return _0x2a4364;};'use strict';var SmsAccountEvents=require(_0xcae9('0x0'));var events=[_0xcae9('0x1'),_0xcae9('0x2'),_0xcae9('0x3')];function createListener(_0x3c9987,_0x528259){return function(_0x1ac4dd){_0x528259[_0xcae9('0x4')](_0x3c9987,_0x1ac4dd);};}function removeListener(_0x2c6da7,_0x38b0fc){return function(){SmsAccountEvents[_0xcae9('0x5')](_0x2c6da7,_0x38b0fc);};}exports[_0xcae9('0x6')]=function(_0x50e532){for(var _0x30d1c2=0x0,_0x49cb39=events[_0xcae9('0x7')];_0x30d1c2<_0x49cb39;_0x30d1c2++){var _0xb9ba58=events[_0x30d1c2];var _0x2bcdb5=createListener('smsAccount:'+_0xb9ba58,_0x50e532);SmsAccountEvents['on'](_0xb9ba58,_0x2bcdb5);}};
\ No newline at end of file
+var _0x2e66=['update','emit','removeListener','register','length','smsAccount:','./smsAccount.events','save','remove'];(function(_0x1635fe,_0x5f1d9f){var _0x3c512a=function(_0x26b53d){while(--_0x26b53d){_0x1635fe['push'](_0x1635fe['shift']());}};_0x3c512a(++_0x5f1d9f);}(_0x2e66,0x9f));var _0x62e6=function(_0x3aacea,_0x4dec2d){_0x3aacea=_0x3aacea-0x0;var _0xabe687=_0x2e66[_0x3aacea];return _0xabe687;};'use strict';var SmsAccountEvents=require(_0x62e6('0x0'));var events=[_0x62e6('0x1'),_0x62e6('0x2'),_0x62e6('0x3')];function createListener(_0x29ef42,_0x228c2e){return function(_0x5128c7){_0x228c2e[_0x62e6('0x4')](_0x29ef42,_0x5128c7);};}function removeListener(_0xfdbbfa,_0x29f66e){return function(){SmsAccountEvents[_0x62e6('0x5')](_0xfdbbfa,_0x29f66e);};}exports[_0x62e6('0x6')]=function(_0x363e68){for(var _0x983984=0x0,_0x4b4e05=events[_0x62e6('0x7')];_0x983984<_0x4b4e05;_0x983984++){var _0x34ab21=events[_0x983984];var _0x322b41=createListener(_0x62e6('0x8')+_0x34ab21,_0x363e68);SmsAccountEvents['on'](_0x34ab21,_0x322b41);}};
\ No newline at end of file
index ad8166a..d56c676 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb85=['show','create','put','update','destroy','exports','multer','util','express','Router','../../config/environment','isAuthenticated','get','/:id'];(function(_0x58572c,_0x386076){var _0x1ce1e2=function(_0x5c9aff){while(--_0x5c9aff){_0x58572c['push'](_0x58572c['shift']());}};_0x1ce1e2(++_0x386076);}(_0xeb85,0x11e));var _0x5eb8=function(_0x2b28a2,_0x5af969){_0x2b28a2=_0x2b28a2-0x0;var _0x761107=_0xeb85[_0x2b28a2];return _0x761107;};'use strict';var multer=require(_0x5eb8('0x0'));var util=require(_0x5eb8('0x1'));var path=require('path');var express=require(_0x5eb8('0x2'));var router=express[_0x5eb8('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5eb8('0x4'));var controller=require('./smsApplication.controller');router['get']('/',auth[_0x5eb8('0x5')](),controller['index']);router[_0x5eb8('0x6')](_0x5eb8('0x7'),auth[_0x5eb8('0x5')](),controller[_0x5eb8('0x8')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5eb8('0x9')]);router[_0x5eb8('0xa')](_0x5eb8('0x7'),auth['isAuthenticated'](),controller[_0x5eb8('0xb')]);router['delete'](_0x5eb8('0x7'),auth['isAuthenticated'](),controller[_0x5eb8('0xc')]);module[_0x5eb8('0xd')]=router;
\ No newline at end of file
+var _0x027f=['post','create','update','delete','exports','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','/:id','show'];(function(_0x558fe9,_0x1ca3f7){var _0x554d2a=function(_0x16895a){while(--_0x16895a){_0x558fe9['push'](_0x558fe9['shift']());}};_0x554d2a(++_0x1ca3f7);}(_0x027f,0xd7));var _0xf027=function(_0x571b0f,_0x10ddf9){_0x571b0f=_0x571b0f-0x0;var _0xf0f1c9=_0x027f[_0x571b0f];return _0xf0f1c9;};'use strict';var multer=require(_0xf027('0x0'));var util=require(_0xf027('0x1'));var path=require('path');var express=require(_0xf027('0x2'));var router=express[_0xf027('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf027('0x4'));var config=require('../../config/environment');var controller=require('./smsApplication.controller');router[_0xf027('0x5')]('/',auth[_0xf027('0x6')](),controller['index']);router[_0xf027('0x5')](_0xf027('0x7'),auth['isAuthenticated'](),controller[_0xf027('0x8')]);router[_0xf027('0x9')]('/',auth[_0xf027('0x6')](),controller[_0xf027('0xa')]);router['put'](_0xf027('0x7'),auth[_0xf027('0x6')](),controller[_0xf027('0xb')]);router[_0xf027('0xc')](_0xf027('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0xf027('0xd')]=router;
\ No newline at end of file
index dbf4f31..810850d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18aa=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x2b1d09,_0x2b50a3){var _0x381490=function(_0x78b2bd){while(--_0x78b2bd){_0x2b1d09['push'](_0x2b1d09['shift']());}};_0x381490(++_0x2b50a3);}(_0x18aa,0x187));var _0xa18a=function(_0xfc774e,_0x494000){_0xfc774e=_0xfc774e-0x0;var _0x1d1324=_0x18aa[_0xfc774e];return _0x1d1324;};'use strict';var Sequelize=require(_0xa18a('0x0'));module[_0xa18a('0x1')]={'priority':{'type':Sequelize[_0xa18a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa18a('0x3')],'allowNull':![],'defaultValue':_0xa18a('0x4')},'appdata':{'type':Sequelize[_0xa18a('0x3')](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0xa18a('0x3')]},'interval':{'type':Sequelize[_0xa18a('0x3')],'defaultValue':_0xa18a('0x5')}};
\ No newline at end of file
+var _0x6f01=['noop','STRING','sequelize','INTEGER'];(function(_0x2eb3bb,_0x2866d7){var _0x4afc77=function(_0x5a8eb4){while(--_0x5a8eb4){_0x2eb3bb['push'](_0x2eb3bb['shift']());}};_0x4afc77(++_0x2866d7);}(_0x6f01,0x122));var _0x16f0=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6f01[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x16f0('0x0'));module['exports']={'priority':{'type':Sequelize[_0x16f0('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x16f0('0x2')},'appdata':{'type':Sequelize[_0x16f0('0x3')](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0x16f0('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 7784af5..0b5290a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['nolimit','order','where','filters','pick','add','day','merge','filter','map','options','includeAll','include','findAll','rows','catch','show','params','SmsApplication','length','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','error','stack','name','rawAttributes','keys','query','dateStart','dateEnd','intersection','model','attributes','fields','hasOwnProperty'];(function(_0x5cea3f,_0x413dc2){var _0x4b2ddb=function(_0x290016){while(--_0x290016){_0x5cea3f['push'](_0x5cea3f['shift']());}};_0x4b2ddb(++_0x413dc2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var qs=require(_0x0a9e('0xe'));var logger=require(_0x0a9e('0xf'))(_0x0a9e('0x10'));var utils=require(_0x0a9e('0x11'));var config=require(_0x0a9e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50dfb2,_0x527cdd){_0x527cdd=_0x527cdd||0xcc;return function(_0x4cfe67){if(_0x4cfe67){return _0x50dfb2[_0x0a9e('0x13')](_0x527cdd);}return _0x50dfb2[_0x0a9e('0x14')](_0x527cdd)[_0x0a9e('0x15')]();};}function respondWithResult(_0x26d672,_0x32d742){_0x32d742=_0x32d742||0xc8;return function(_0x69aeb7){if(_0x69aeb7){return _0x26d672['status'](_0x32d742)[_0x0a9e('0x16')](_0x69aeb7);}};}function respondWithFilteredResult(_0x239b12,_0x2b4227){return function(_0x281129){if(_0x281129){var _0x44dcfd=_0x281129['count'],_0x4d5611=_0x2b4227[_0x0a9e('0x17')],_0x52a03d=_0x2b4227['offset']+_0x2b4227[_0x0a9e('0x18')],_0x22dccb;if(_0x52a03d>=_0x44dcfd){_0x52a03d=_0x44dcfd;_0x22dccb=0xc8;}else{_0x22dccb=0xce;}_0x239b12[_0x0a9e('0x14')](_0x22dccb);return _0x239b12['set'](_0x0a9e('0x19'),_0x4d5611+'-'+_0x52a03d+'/'+_0x44dcfd)['json'](_0x281129);}return null;};}function patchUpdates(_0x459eb1){return function(_0x478723){try{jsonpatch[_0x0a9e('0x1a')](_0x478723,_0x459eb1,!![]);}catch(_0x205fd6){return BPromise[_0x0a9e('0x1b')](_0x205fd6);}return _0x478723[_0x0a9e('0x1c')]();};}function saveUpdates(_0x530eb7,_0x20559e){return function(_0x1314ae){if(_0x1314ae){return _0x1314ae[_0x0a9e('0x1d')](_0x530eb7)[_0x0a9e('0x1e')](function(_0x105080){return _0x105080;});}return null;};}function removeEntity(_0x4bb1e3,_0x2c3407){return function(_0x155cce){if(_0x155cce){return _0x155cce['destroy']()[_0x0a9e('0x1e')](function(){_0x4bb1e3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a02e1,_0x432e56){return function(_0x38e7c4){if(!_0x38e7c4){_0x3a02e1[_0x0a9e('0x13')](0x194);}return _0x38e7c4;};}function handleError(_0x4abc77,_0xfb6e48){_0xfb6e48=_0xfb6e48||0x1f4;return function(_0x2fb0e4){logger[_0x0a9e('0x1f')](_0x2fb0e4[_0x0a9e('0x20')]);if(_0x2fb0e4[_0x0a9e('0x21')]){delete _0x2fb0e4[_0x0a9e('0x21')];}_0x4abc77[_0x0a9e('0x14')](_0xfb6e48)['send'](_0x2fb0e4);};}exports['index']=function(_0x197ec0,_0x3a8e58){var _0x40c424={},_0x33161b={},_0x526cf3={'count':0x0,'rows':[]};var _0x384319=db['SmsApplication'][_0x0a9e('0x22')];_0x33161b['model']=_[_0x0a9e('0x23')](_0x384319);var _0x34dc65={'dateStart':_0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x25')],'dateEnd':_0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x26')]};delete _0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x25')];delete _0x197ec0['query'][_0x0a9e('0x26')];_0x33161b[_0x0a9e('0x24')]=_[_0x0a9e('0x23')](_0x197ec0[_0x0a9e('0x24')]);_0x33161b['filters']=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')],_0x33161b[_0x0a9e('0x24')]);_0x40c424[_0x0a9e('0x29')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')],qs[_0x0a9e('0x2a')](_0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x2a')]));_0x40c424['attributes']=_0x40c424[_0x0a9e('0x29')]['length']?_0x40c424[_0x0a9e('0x29')]:_0x33161b[_0x0a9e('0x28')];if(!_0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x2b')](_0x0a9e('0x2c'))){_0x40c424['limit']=qs[_0x0a9e('0x18')](_0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x18')]);_0x40c424[_0x0a9e('0x17')]=qs[_0x0a9e('0x17')](_0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x17')]);}_0x40c424[_0x0a9e('0x2d')]=qs['sort'](_0x197ec0[_0x0a9e('0x24')]['sort']);_0x40c424[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2f')](_[_0x0a9e('0x30')](_0x197ec0[_0x0a9e('0x24')],_0x33161b['filters']));if(_0x34dc65[_0x0a9e('0x25')]){if(_0x34dc65[_0x0a9e('0x26')]){_0x34dc65[_0x0a9e('0x26')]=moment(_0x34dc65[_0x0a9e('0x26')])['add'](0x1,'day');}else{_0x34dc65[_0x0a9e('0x26')]=moment(_0x34dc65['dateStart'])[_0x0a9e('0x31')](0x1,_0x0a9e('0x32'));}_[_0x0a9e('0x33')](_0x40c424[_0x0a9e('0x2e')],{'createdAt':{'$gte':_0x34dc65['dateStart'],'$lte':_0x34dc65[_0x0a9e('0x26')]}});}if(_0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x34')]){_0x40c424['where']=_[_0x0a9e('0x33')](_0x40c424[_0x0a9e('0x2e')],{'$or':_[_0x0a9e('0x35')](_0x40c424['attributes'],function(_0x546ef8){var _0x11b61d={};_0x11b61d[_0x546ef8]={'$like':'%'+_0x197ec0[_0x0a9e('0x24')]['filter']+'%'};return _0x11b61d;})});}_0x40c424=_[_0x0a9e('0x33')]({},_0x40c424,_0x197ec0[_0x0a9e('0x36')]);var _0x2e1b3a={'where':_0x40c424[_0x0a9e('0x2e')]};return db['SmsApplication']['count'](_0x2e1b3a)[_0x0a9e('0x1e')](function(_0x45b3d0){_0x526cf3['count']=_0x45b3d0;if(_0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x37')]){_0x40c424[_0x0a9e('0x38')]=[{'all':!![]}];}return db['SmsApplication'][_0x0a9e('0x39')](_0x40c424);})[_0x0a9e('0x1e')](function(_0x274e8e){_0x526cf3[_0x0a9e('0x3a')]=_0x274e8e;return _0x526cf3;})[_0x0a9e('0x1e')](respondWithFilteredResult(_0x3a8e58,_0x40c424))[_0x0a9e('0x3b')](handleError(_0x3a8e58,null));};exports[_0x0a9e('0x3c')]=function(_0x45a9b8,_0x23b089){var _0x3da2cd={'raw':!![],'where':{'id':_0x45a9b8[_0x0a9e('0x3d')]['id']}},_0x2c3711={};_0x2c3711[_0x0a9e('0x28')]=_[_0x0a9e('0x23')](db[_0x0a9e('0x3e')]['rawAttributes']);_0x2c3711['query']=_[_0x0a9e('0x23')](_0x45a9b8[_0x0a9e('0x24')]);_0x2c3711[_0x0a9e('0x2f')]=_[_0x0a9e('0x27')](_0x2c3711[_0x0a9e('0x28')],_0x2c3711[_0x0a9e('0x24')]);_0x3da2cd[_0x0a9e('0x29')]=_[_0x0a9e('0x27')](_0x2c3711[_0x0a9e('0x28')],qs[_0x0a9e('0x2a')](_0x45a9b8[_0x0a9e('0x24')][_0x0a9e('0x2a')]));_0x3da2cd['attributes']=_0x3da2cd[_0x0a9e('0x29')][_0x0a9e('0x3f')]?_0x3da2cd[_0x0a9e('0x29')]:_0x2c3711[_0x0a9e('0x28')];if(_0x45a9b8[_0x0a9e('0x24')][_0x0a9e('0x37')]){_0x3da2cd[_0x0a9e('0x38')]=[{'all':!![]}];}_0x3da2cd=_[_0x0a9e('0x33')]({},_0x3da2cd,_0x45a9b8['options']);return db[_0x0a9e('0x3e')]['find'](_0x3da2cd)[_0x0a9e('0x1e')](handleEntityNotFound(_0x23b089,null))[_0x0a9e('0x1e')](respondWithResult(_0x23b089,null))[_0x0a9e('0x3b')](handleError(_0x23b089,null));};exports['create']=function(_0x14bec2,_0x7f6eb1){return db[_0x0a9e('0x3e')][_0x0a9e('0x40')](_0x14bec2[_0x0a9e('0x41')],{})[_0x0a9e('0x1e')](respondWithResult(_0x7f6eb1,0xc9))[_0x0a9e('0x3b')](handleError(_0x7f6eb1,null));};exports['update']=function(_0x13f44d,_0x1bde3c){if(_0x13f44d[_0x0a9e('0x41')]['id']){delete _0x13f44d[_0x0a9e('0x41')]['id'];}return db[_0x0a9e('0x3e')][_0x0a9e('0x42')]({'where':{'id':_0x13f44d[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1e')](handleEntityNotFound(_0x1bde3c,null))[_0x0a9e('0x1e')](saveUpdates(_0x13f44d['body'],null))[_0x0a9e('0x1e')](respondWithResult(_0x1bde3c,null))[_0x0a9e('0x3b')](handleError(_0x1bde3c,null));};exports['destroy']=function(_0x4ae14b,_0x5ddf84){return db[_0x0a9e('0x3e')][_0x0a9e('0x42')]({'where':{'id':_0x4ae14b[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1e')](handleEntityNotFound(_0x5ddf84,null))[_0x0a9e('0x1e')](removeEntity(_0x5ddf84,null))[_0x0a9e('0x3b')](handleError(_0x5ddf84,null));};
\ No newline at end of file
+var _0xa9e0=['nolimit','order','where','filters','pick','add','day','merge','filter','map','options','includeAll','include','findAll','rows','catch','show','params','SmsApplication','length','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','error','stack','name','rawAttributes','keys','query','dateStart','dateEnd','intersection','model','attributes','fields','hasOwnProperty'];(function(_0x286774,_0x57a7e3){var _0x3487fd=function(_0x391b5b){while(--_0x391b5b){_0x286774['push'](_0x286774['shift']());}};_0x3487fd(++_0x57a7e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var qs=require(_0x0a9e('0xe'));var logger=require(_0x0a9e('0xf'))(_0x0a9e('0x10'));var utils=require(_0x0a9e('0x11'));var config=require(_0x0a9e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50dfb2,_0x527cdd){_0x527cdd=_0x527cdd||0xcc;return function(_0x4cfe67){if(_0x4cfe67){return _0x50dfb2[_0x0a9e('0x13')](_0x527cdd);}return _0x50dfb2[_0x0a9e('0x14')](_0x527cdd)[_0x0a9e('0x15')]();};}function respondWithResult(_0x26d672,_0x32d742){_0x32d742=_0x32d742||0xc8;return function(_0x69aeb7){if(_0x69aeb7){return _0x26d672['status'](_0x32d742)[_0x0a9e('0x16')](_0x69aeb7);}};}function respondWithFilteredResult(_0x239b12,_0x2b4227){return function(_0x281129){if(_0x281129){var _0x44dcfd=_0x281129['count'],_0x4d5611=_0x2b4227[_0x0a9e('0x17')],_0x52a03d=_0x2b4227['offset']+_0x2b4227[_0x0a9e('0x18')],_0x22dccb;if(_0x52a03d>=_0x44dcfd){_0x52a03d=_0x44dcfd;_0x22dccb=0xc8;}else{_0x22dccb=0xce;}_0x239b12[_0x0a9e('0x14')](_0x22dccb);return _0x239b12['set'](_0x0a9e('0x19'),_0x4d5611+'-'+_0x52a03d+'/'+_0x44dcfd)['json'](_0x281129);}return null;};}function patchUpdates(_0x459eb1){return function(_0x478723){try{jsonpatch[_0x0a9e('0x1a')](_0x478723,_0x459eb1,!![]);}catch(_0x205fd6){return BPromise[_0x0a9e('0x1b')](_0x205fd6);}return _0x478723[_0x0a9e('0x1c')]();};}function saveUpdates(_0x530eb7,_0x20559e){return function(_0x1314ae){if(_0x1314ae){return _0x1314ae[_0x0a9e('0x1d')](_0x530eb7)[_0x0a9e('0x1e')](function(_0x105080){return _0x105080;});}return null;};}function removeEntity(_0x4bb1e3,_0x2c3407){return function(_0x155cce){if(_0x155cce){return _0x155cce['destroy']()[_0x0a9e('0x1e')](function(){_0x4bb1e3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a02e1,_0x432e56){return function(_0x38e7c4){if(!_0x38e7c4){_0x3a02e1[_0x0a9e('0x13')](0x194);}return _0x38e7c4;};}function handleError(_0x4abc77,_0xfb6e48){_0xfb6e48=_0xfb6e48||0x1f4;return function(_0x2fb0e4){logger[_0x0a9e('0x1f')](_0x2fb0e4[_0x0a9e('0x20')]);if(_0x2fb0e4[_0x0a9e('0x21')]){delete _0x2fb0e4[_0x0a9e('0x21')];}_0x4abc77[_0x0a9e('0x14')](_0xfb6e48)['send'](_0x2fb0e4);};}exports['index']=function(_0x197ec0,_0x3a8e58){var _0x40c424={},_0x33161b={},_0x526cf3={'count':0x0,'rows':[]};var _0x384319=db['SmsApplication'][_0x0a9e('0x22')];_0x33161b['model']=_[_0x0a9e('0x23')](_0x384319);var _0x34dc65={'dateStart':_0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x25')],'dateEnd':_0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x26')]};delete _0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x25')];delete _0x197ec0['query'][_0x0a9e('0x26')];_0x33161b[_0x0a9e('0x24')]=_[_0x0a9e('0x23')](_0x197ec0[_0x0a9e('0x24')]);_0x33161b['filters']=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')],_0x33161b[_0x0a9e('0x24')]);_0x40c424[_0x0a9e('0x29')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')],qs[_0x0a9e('0x2a')](_0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x2a')]));_0x40c424['attributes']=_0x40c424[_0x0a9e('0x29')]['length']?_0x40c424[_0x0a9e('0x29')]:_0x33161b[_0x0a9e('0x28')];if(!_0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x2b')](_0x0a9e('0x2c'))){_0x40c424['limit']=qs[_0x0a9e('0x18')](_0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x18')]);_0x40c424[_0x0a9e('0x17')]=qs[_0x0a9e('0x17')](_0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x17')]);}_0x40c424[_0x0a9e('0x2d')]=qs['sort'](_0x197ec0[_0x0a9e('0x24')]['sort']);_0x40c424[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2f')](_[_0x0a9e('0x30')](_0x197ec0[_0x0a9e('0x24')],_0x33161b['filters']));if(_0x34dc65[_0x0a9e('0x25')]){if(_0x34dc65[_0x0a9e('0x26')]){_0x34dc65[_0x0a9e('0x26')]=moment(_0x34dc65[_0x0a9e('0x26')])['add'](0x1,'day');}else{_0x34dc65[_0x0a9e('0x26')]=moment(_0x34dc65['dateStart'])[_0x0a9e('0x31')](0x1,_0x0a9e('0x32'));}_[_0x0a9e('0x33')](_0x40c424[_0x0a9e('0x2e')],{'createdAt':{'$gte':_0x34dc65['dateStart'],'$lte':_0x34dc65[_0x0a9e('0x26')]}});}if(_0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x34')]){_0x40c424['where']=_[_0x0a9e('0x33')](_0x40c424[_0x0a9e('0x2e')],{'$or':_[_0x0a9e('0x35')](_0x40c424['attributes'],function(_0x546ef8){var _0x11b61d={};_0x11b61d[_0x546ef8]={'$like':'%'+_0x197ec0[_0x0a9e('0x24')]['filter']+'%'};return _0x11b61d;})});}_0x40c424=_[_0x0a9e('0x33')]({},_0x40c424,_0x197ec0[_0x0a9e('0x36')]);var _0x2e1b3a={'where':_0x40c424[_0x0a9e('0x2e')]};return db['SmsApplication']['count'](_0x2e1b3a)[_0x0a9e('0x1e')](function(_0x45b3d0){_0x526cf3['count']=_0x45b3d0;if(_0x197ec0[_0x0a9e('0x24')][_0x0a9e('0x37')]){_0x40c424[_0x0a9e('0x38')]=[{'all':!![]}];}return db['SmsApplication'][_0x0a9e('0x39')](_0x40c424);})[_0x0a9e('0x1e')](function(_0x274e8e){_0x526cf3[_0x0a9e('0x3a')]=_0x274e8e;return _0x526cf3;})[_0x0a9e('0x1e')](respondWithFilteredResult(_0x3a8e58,_0x40c424))[_0x0a9e('0x3b')](handleError(_0x3a8e58,null));};exports[_0x0a9e('0x3c')]=function(_0x45a9b8,_0x23b089){var _0x3da2cd={'raw':!![],'where':{'id':_0x45a9b8[_0x0a9e('0x3d')]['id']}},_0x2c3711={};_0x2c3711[_0x0a9e('0x28')]=_[_0x0a9e('0x23')](db[_0x0a9e('0x3e')]['rawAttributes']);_0x2c3711['query']=_[_0x0a9e('0x23')](_0x45a9b8[_0x0a9e('0x24')]);_0x2c3711[_0x0a9e('0x2f')]=_[_0x0a9e('0x27')](_0x2c3711[_0x0a9e('0x28')],_0x2c3711[_0x0a9e('0x24')]);_0x3da2cd[_0x0a9e('0x29')]=_[_0x0a9e('0x27')](_0x2c3711[_0x0a9e('0x28')],qs[_0x0a9e('0x2a')](_0x45a9b8[_0x0a9e('0x24')][_0x0a9e('0x2a')]));_0x3da2cd['attributes']=_0x3da2cd[_0x0a9e('0x29')][_0x0a9e('0x3f')]?_0x3da2cd[_0x0a9e('0x29')]:_0x2c3711[_0x0a9e('0x28')];if(_0x45a9b8[_0x0a9e('0x24')][_0x0a9e('0x37')]){_0x3da2cd[_0x0a9e('0x38')]=[{'all':!![]}];}_0x3da2cd=_[_0x0a9e('0x33')]({},_0x3da2cd,_0x45a9b8['options']);return db[_0x0a9e('0x3e')]['find'](_0x3da2cd)[_0x0a9e('0x1e')](handleEntityNotFound(_0x23b089,null))[_0x0a9e('0x1e')](respondWithResult(_0x23b089,null))[_0x0a9e('0x3b')](handleError(_0x23b089,null));};exports['create']=function(_0x14bec2,_0x7f6eb1){return db[_0x0a9e('0x3e')][_0x0a9e('0x40')](_0x14bec2[_0x0a9e('0x41')],{})[_0x0a9e('0x1e')](respondWithResult(_0x7f6eb1,0xc9))[_0x0a9e('0x3b')](handleError(_0x7f6eb1,null));};exports['update']=function(_0x13f44d,_0x1bde3c){if(_0x13f44d[_0x0a9e('0x41')]['id']){delete _0x13f44d[_0x0a9e('0x41')]['id'];}return db[_0x0a9e('0x3e')][_0x0a9e('0x42')]({'where':{'id':_0x13f44d[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1e')](handleEntityNotFound(_0x1bde3c,null))[_0x0a9e('0x1e')](saveUpdates(_0x13f44d['body'],null))[_0x0a9e('0x1e')](respondWithResult(_0x1bde3c,null))[_0x0a9e('0x3b')](handleError(_0x1bde3c,null));};exports['destroy']=function(_0x4ae14b,_0x5ddf84){return db[_0x0a9e('0x3e')][_0x0a9e('0x42')]({'where':{'id':_0x4ae14b[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1e')](handleEntityNotFound(_0x5ddf84,null))[_0x0a9e('0x1e')](removeEntity(_0x5ddf84,null))[_0x0a9e('0x3b')](handleError(_0x5ddf84,null));};
\ No newline at end of file
index 3a12e70..9e1bef8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa33a=['moment','bluebird','request-promise','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','lodash','util'];(function(_0x468a77,_0x1382be){var _0x2d1c33=function(_0x2f2e83){while(--_0x2f2e83){_0x468a77['push'](_0x468a77['shift']());}};_0x2d1c33(++_0x1382be);}(_0xa33a,0xd0));var _0xaa33=function(_0x116f5a,_0x31a8eb){_0x116f5a=_0x116f5a-0x0;var _0xa229df=_0xa33a[_0x116f5a];return _0xa229df;};'use strict';var _=require(_0xaa33('0x0'));var util=require(_0xaa33('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaa33('0x2'));var BPromise=require(_0xaa33('0x3'));var rp=require(_0xaa33('0x4'));var attributes=require(_0xaa33('0x5'));module[_0xaa33('0x6')]=function(_0x1b48d3,_0x514f13){return _0x1b48d3[_0xaa33('0x7')](_0xaa33('0x8'),attributes,{'tableName':_0xaa33('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe7bc=['request-promise','./smsApplication.attributes','exports','define','sms_applications','lodash','util','../../config/logger','moment','bluebird'];(function(_0x333c45,_0xc9c6e3){var _0xf162d5=function(_0x524c87){while(--_0x524c87){_0x333c45['push'](_0x333c45['shift']());}};_0xf162d5(++_0xc9c6e3);}(_0xe7bc,0x19f));var _0xce7b=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xe7bc[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xce7b('0x0'));var util=require(_0xce7b('0x1'));var logger=require(_0xce7b('0x2'))('api');var moment=require(_0xce7b('0x3'));var BPromise=require(_0xce7b('0x4'));var rp=require(_0xce7b('0x5'));var attributes=require(_0xce7b('0x6'));module[_0xce7b('0x7')]=function(_0x12765c,_0xbf942){return _0x12765c[_0xce7b('0x8')]('SmsApplication',attributes,{'tableName':_0xce7b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 04e4171..7f85aa8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d8c=['bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x443316,_0x286c90){var _0x187fed=function(_0x235740){while(--_0x235740){_0x443316['push'](_0x443316['shift']());}};_0x187fed(++_0x286c90);}(_0x1d8c,0x1ae));var _0xc1d8=function(_0x4add0a,_0x41ef1d){_0x4add0a=_0x4add0a-0x0;var _0x54c70b=_0x1d8c[_0x4add0a];return _0x54c70b;};'use strict';var _=require(_0xc1d8('0x0'));var util=require(_0xc1d8('0x1'));var moment=require('moment');var BPromise=require(_0xc1d8('0x2'));var rs=require('randomstring');var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc1d8('0x3'))(_0xc1d8('0x4'));var config=require(_0xc1d8('0x5'));var jayson=require(_0xc1d8('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3b84b3,_0x10aa09,_0x597a11){return new BPromise(function(_0x33c2a7,_0x2ce1cf){return client['request'](_0x3b84b3,_0x597a11)[_0xc1d8('0x7')](function(_0x4043e){logger[_0xc1d8('0x8')]('SmsApplication,\x20%s,\x20%s',_0x10aa09,'request\x20sent');logger[_0xc1d8('0x9')](_0xc1d8('0xa'),_0x10aa09,'request\x20sent',JSON[_0xc1d8('0xb')](_0x4043e));if(_0x4043e[_0xc1d8('0xc')]){if(_0x4043e[_0xc1d8('0xc')][_0xc1d8('0xd')]===0x1f4){logger[_0xc1d8('0xc')](_0xc1d8('0xe'),_0x10aa09,_0x4043e[_0xc1d8('0xc')][_0xc1d8('0xf')]);return _0x2ce1cf(_0x4043e[_0xc1d8('0xc')][_0xc1d8('0xf')]);}logger[_0xc1d8('0xc')](_0xc1d8('0xe'),_0x10aa09,_0x4043e[_0xc1d8('0xc')][_0xc1d8('0xf')]);return _0x33c2a7(_0x4043e['error'][_0xc1d8('0xf')]);}else{logger[_0xc1d8('0x8')](_0xc1d8('0xe'),_0x10aa09,'request\x20sent');_0x33c2a7(_0x4043e[_0xc1d8('0x10')][_0xc1d8('0xf')]);}})[_0xc1d8('0x11')](function(_0x1322b3){logger[_0xc1d8('0xc')]('SmsApplication,\x20%s,\x20%s',_0x10aa09,_0x1322b3);_0x2ce1cf(_0x1322b3);});});}
\ No newline at end of file
+var _0x68f5=['http','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x53a1fe,_0x35c931){var _0x525b3d=function(_0x4c2764){while(--_0x4c2764){_0x53a1fe['push'](_0x53a1fe['shift']());}};_0x525b3d(++_0x35c931);}(_0x68f5,0x107));var _0x568f=function(_0x59df01,_0x2aaaf9){_0x59df01=_0x59df01-0x0;var _0x3191c0=_0x68f5[_0x59df01];return _0x3191c0;};'use strict';var _=require(_0x568f('0x0'));var util=require(_0x568f('0x1'));var moment=require(_0x568f('0x2'));var BPromise=require(_0x568f('0x3'));var rs=require(_0x568f('0x4'));var fs=require('fs');var db=require(_0x568f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x568f('0x6'))(_0x568f('0x7'));var config=require('../../config/environment');var jayson=require(_0x568f('0x8'));var client=jayson[_0x568f('0x9')][_0x568f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e7488,_0x2c79ba,_0x5d9c17){return new BPromise(function(_0x4ad2b3,_0x4d5830){return client['request'](_0x3e7488,_0x5d9c17)['then'](function(_0x5cc463){logger[_0x568f('0xb')](_0x568f('0xc'),_0x2c79ba,'request\x20sent');logger[_0x568f('0xd')](_0x568f('0xe'),_0x2c79ba,_0x568f('0xf'),JSON[_0x568f('0x10')](_0x5cc463));if(_0x5cc463[_0x568f('0x11')]){if(_0x5cc463[_0x568f('0x11')][_0x568f('0x12')]===0x1f4){logger[_0x568f('0x11')](_0x568f('0xc'),_0x2c79ba,_0x5cc463[_0x568f('0x11')][_0x568f('0x13')]);return _0x4d5830(_0x5cc463[_0x568f('0x11')][_0x568f('0x13')]);}logger[_0x568f('0x11')](_0x568f('0xc'),_0x2c79ba,_0x5cc463[_0x568f('0x11')][_0x568f('0x13')]);return _0x4ad2b3(_0x5cc463[_0x568f('0x11')][_0x568f('0x13')]);}else{logger[_0x568f('0xb')]('SmsApplication,\x20%s,\x20%s',_0x2c79ba,_0x568f('0xf'));_0x4ad2b3(_0x5cc463['result'][_0x568f('0x13')]);}})[_0x568f('0x14')](function(_0x320ccf){logger['error'](_0x568f('0xc'),_0x2c79ba,_0x320ccf);_0x4d5830(_0x320ccf);});});}
\ No newline at end of file
index 67ca3ce..2c6dd56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','getMessages','/:id/download','post','create','/:id/messages'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x2ae89f,_0x3e82c4){_0x2ae89f=_0x2ae89f-0x0;var _0x59d9f3=_0x7a54[_0x2ae89f];return _0x59d9f3;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var express=require('express');var router=express[_0x47a5('0x3')]();var auth=require(_0x47a5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x47a5('0x5'));var controller=require(_0x47a5('0x6'));router[_0x47a5('0x7')]('/',auth[_0x47a5('0x8')](),controller[_0x47a5('0x9')]);router['get'](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router[_0x47a5('0x7')]('/:id',auth[_0x47a5('0x8')](),controller['show']);router['get']('/:id/messages',auth[_0x47a5('0x8')](),controller[_0x47a5('0xc')]);router['get'](_0x47a5('0xd'),auth['isAuthenticated'](),controller['download']);router[_0x47a5('0xe')]('/',auth[_0x47a5('0x8')](),controller[_0x47a5('0xf')]);router[_0x47a5('0xe')](_0x47a5('0x10'),auth[_0x47a5('0x8')](),controller[_0x47a5('0x11')]);router['post'](_0x47a5('0x12'),auth[_0x47a5('0x8')](),interaction[_0x47a5('0x13')](_0x47a5('0x14'),_0x47a5('0x15')),controller[_0x47a5('0x16')]);router[_0x47a5('0x17')](_0x47a5('0x18'),auth['isAuthenticated'](),interaction[_0x47a5('0x13')](_0x47a5('0x14'),_0x47a5('0x19')),controller[_0x47a5('0x1a')]);router[_0x47a5('0x1b')]('/:id',auth['isAuthenticated'](),interaction[_0x47a5('0x13')]('sms','smsinteraction:destroy'),controller[_0x47a5('0x1c')]);router[_0x47a5('0x1b')](_0x47a5('0x12'),auth[_0x47a5('0x8')](),controller[_0x47a5('0x1d')]);module[_0x47a5('0x1e')]=router;
\ No newline at end of file
+var _0x7a54=['addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','getMessages','/:id/download','post','create','/:id/messages'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x3855f5,_0x2f2623){_0x3855f5=_0x3855f5-0x0;var _0x5b0103=_0x7a54[_0x3855f5];return _0x5b0103;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var express=require('express');var router=express[_0x47a5('0x3')]();var auth=require(_0x47a5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x47a5('0x5'));var controller=require(_0x47a5('0x6'));router[_0x47a5('0x7')]('/',auth[_0x47a5('0x8')](),controller[_0x47a5('0x9')]);router['get'](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router[_0x47a5('0x7')]('/:id',auth[_0x47a5('0x8')](),controller['show']);router['get']('/:id/messages',auth[_0x47a5('0x8')](),controller[_0x47a5('0xc')]);router['get'](_0x47a5('0xd'),auth['isAuthenticated'](),controller['download']);router[_0x47a5('0xe')]('/',auth[_0x47a5('0x8')](),controller[_0x47a5('0xf')]);router[_0x47a5('0xe')](_0x47a5('0x10'),auth[_0x47a5('0x8')](),controller[_0x47a5('0x11')]);router['post'](_0x47a5('0x12'),auth[_0x47a5('0x8')](),interaction[_0x47a5('0x13')](_0x47a5('0x14'),_0x47a5('0x15')),controller[_0x47a5('0x16')]);router[_0x47a5('0x17')](_0x47a5('0x18'),auth['isAuthenticated'](),interaction[_0x47a5('0x13')](_0x47a5('0x14'),_0x47a5('0x19')),controller[_0x47a5('0x1a')]);router[_0x47a5('0x1b')]('/:id',auth['isAuthenticated'](),interaction[_0x47a5('0x13')]('sms','smsinteraction:destroy'),controller[_0x47a5('0x1c')]);router[_0x47a5('0x1b')](_0x47a5('0x12'),auth[_0x47a5('0x8')](),controller[_0x47a5('0x1d')]);module[_0x47a5('0x1e')]=router;
\ No newline at end of file
index beef3d4..1285016 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55c3=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x4eaa34,_0x37fb5b){var _0x20ec3c=function(_0x5b132c){while(--_0x5b132c){_0x4eaa34['push'](_0x4eaa34['shift']());}};_0x20ec3c(++_0x37fb5b);}(_0x55c3,0x1d6));var _0x355c=function(_0x1ff103,_0xfbd1b8){_0x1ff103=_0x1ff103-0x0;var _0x573258=_0x55c3[_0x1ff103];return _0x573258;};'use strict';var Sequelize=require(_0x355c('0x0'));var moment=require(_0x355c('0x1'));module[_0x355c('0x2')]={'closed':{'type':Sequelize[_0x355c('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x355c('0x4')]},'disposition':{'type':Sequelize[_0x355c('0x5')]},'note':{'type':Sequelize[_0x355c('0x5')]},'phone':{'type':Sequelize[_0x355c('0x5')]},'read1stAt':{'type':Sequelize[_0x355c('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x355c('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x355c('0x7')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0x83a8=['ENUM','out','sequelize','BOOLEAN','DATE','STRING'];(function(_0xd93cbe,_0x11202e){var _0xe0bb40=function(_0x50f4cc){while(--_0x50f4cc){_0xd93cbe['push'](_0xd93cbe['shift']());}};_0xe0bb40(++_0x11202e);}(_0x83a8,0xb6));var _0x883a=function(_0x3a1c6c,_0x2966e1){_0x3a1c6c=_0x3a1c6c-0x0;var _0x382f9f=_0x83a8[_0x3a1c6c];return _0x382f9f;};'use strict';var Sequelize=require(_0x883a('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x883a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x883a('0x2')]},'disposition':{'type':Sequelize[_0x883a('0x3')]},'note':{'type':Sequelize[_0x883a('0x3')]},'phone':{'type':Sequelize[_0x883a('0x3')]},'read1stAt':{'type':Sequelize[_0x883a('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x883a('0x4')]('in',_0x883a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x883a('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x883a('0x4')]('in','out'),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index e8afae4..528e1f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4e9=['getMessages','findOne','hasOwnProperty','order','SmsInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','emit','unix','toString','root','server','files','tmp','join','interaction-%s.zip','firstName','Letter','1cm','mkdirSync','<h1>Sms\x20Interaction:\x20#%d</h1>','<h2>Date:\x20%s</h2>','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','<hr>','<div\x20style=\x22border-style:\x20solid;\x20border-width:\x201px;\x20margin:\x203px;\x22>','</div>','toFile','interaction-','.pdf','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','error','stack','name','SmsInteraction','model','keys','query','dateEnd','intersection','attributes','fields','length','nolimit','sort','where','filters','dateStart','day','add','merge','map','filter','options','include','tag','Tags','distinct','push','SmsMessage','createdAt','read','count','includeAll','User','Users','CmContact','Contact','fullname','internal','SmsAccount','Account','key','Messages','Tag','color','ThroughTags','catch','params','rawAttributes','find','create','body','destroy','describe','ids','omit'];(function(_0x174e6b,_0x124a26){var _0x10ab0e=function(_0x704225){while(--_0x704225){_0x174e6b['push'](_0x174e6b['shift']());}};_0x10ab0e(++_0x124a26);}(_0xc4e9,0x131));var _0x9c4e=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0xc4e9[_0x2fee96];return _0x2e6ad1;};'use strict';var pdf=require(_0x9c4e('0x0'));var emlformat=require(_0x9c4e('0x1'));var rimraf=require(_0x9c4e('0x2'));var zipdir=require(_0x9c4e('0x3'));var jsonpatch=require(_0x9c4e('0x4'));var rp=require('request-promise');var moment=require(_0x9c4e('0x5'));var BPromise=require(_0x9c4e('0x6'));var Mustache=require(_0x9c4e('0x7'));var util=require('util');var path=require(_0x9c4e('0x8'));var sox=require(_0x9c4e('0x9'));var csv=require(_0x9c4e('0xa'));var ejs=require(_0x9c4e('0xb'));var fs=require('fs');var _=require(_0x9c4e('0xc'));var squel=require(_0x9c4e('0xd'));var crypto=require(_0x9c4e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9c4e('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9c4e('0x10'));var Papa=require(_0x9c4e('0x11'));var qs=require(_0x9c4e('0x12'));var logger=require(_0x9c4e('0x13'))(_0x9c4e('0x14'));var utils=require(_0x9c4e('0x15'));var config=require(_0x9c4e('0x16'));var db=require('../../mysqldb')['db'];var socket=require(_0x9c4e('0x17'))({'host':'localhost','port':0x18eb});require(_0x9c4e('0x18'))[_0x9c4e('0x19')](socket);function respondWithStatusCode(_0x568581,_0xf583b5){_0xf583b5=_0xf583b5||0xcc;return function(_0x372c1c){if(_0x372c1c){return _0x568581[_0x9c4e('0x1a')](_0xf583b5);}return _0x568581[_0x9c4e('0x1b')](_0xf583b5)[_0x9c4e('0x1c')]();};}function respondWithResult(_0x19159a,_0x3ce0ed){_0x3ce0ed=_0x3ce0ed||0xc8;return function(_0x212848){if(_0x212848){return _0x19159a[_0x9c4e('0x1b')](_0x3ce0ed)[_0x9c4e('0x1d')](_0x212848);}};}function respondWithFilteredResult(_0x35c617,_0x4b584b){return function(_0x3cf808){if(_0x3cf808){var _0x4afd78=_0x3cf808['count'],_0x34f3f2=_0x4b584b['offset'],_0xf0c5db=_0x4b584b[_0x9c4e('0x1e')]+_0x4b584b[_0x9c4e('0x1f')],_0x32714a;if(_0xf0c5db>=_0x4afd78){_0xf0c5db=_0x4afd78;_0x32714a=0xc8;}else{_0x32714a=0xce;}_0x35c617[_0x9c4e('0x1b')](_0x32714a);return _0x35c617[_0x9c4e('0x20')]('Content-Range',_0x34f3f2+'-'+_0xf0c5db+'/'+_0x4afd78)[_0x9c4e('0x1d')](_0x3cf808);}return null;};}function patchUpdates(_0x28f9c5){return function(_0x1cc945){try{jsonpatch[_0x9c4e('0x21')](_0x1cc945,_0x28f9c5,!![]);}catch(_0x285899){return BPromise[_0x9c4e('0x22')](_0x285899);}return _0x1cc945[_0x9c4e('0x23')]();};}function saveUpdates(_0x1df2e2,_0x29dfb4){return function(_0x7abcd2){if(_0x7abcd2){return _0x7abcd2[_0x9c4e('0x24')](_0x1df2e2)[_0x9c4e('0x25')](function(_0x20535f){return _0x20535f;});}return null;};}function removeEntity(_0x597855,_0x3c25ec){return function(_0x4fab75){if(_0x4fab75){return _0x4fab75['destroy']()[_0x9c4e('0x25')](function(){_0x597855['status'](0xcc)[_0x9c4e('0x1c')]();});}};}function handleEntityNotFound(_0x1ab699,_0x42809e){return function(_0x42ad1e){if(!_0x42ad1e){_0x1ab699[_0x9c4e('0x1a')](0x194);}return _0x42ad1e;};}function handleError(_0x5c1f8c,_0x42b046){_0x42b046=_0x42b046||0x1f4;return function(_0x26c459){logger[_0x9c4e('0x26')](_0x26c459[_0x9c4e('0x27')]);if(_0x26c459[_0x9c4e('0x28')]){delete _0x26c459[_0x9c4e('0x28')];}_0x5c1f8c[_0x9c4e('0x1b')](_0x42b046)['send'](_0x26c459);};}exports['index']=function(_0x50def1,_0x24ccf6){var _0x4516e5={},_0x29201b={},_0x2cc7dd={'count':0x0,'rows':[]};var _0x3d7902=db[_0x9c4e('0x29')]['rawAttributes'];_0x29201b[_0x9c4e('0x2a')]=_[_0x9c4e('0x2b')](_0x3d7902);var _0x2f5f5e={'dateStart':_0x50def1[_0x9c4e('0x2c')]['dateStart'],'dateEnd':_0x50def1[_0x9c4e('0x2c')][_0x9c4e('0x2d')]};delete _0x50def1[_0x9c4e('0x2c')]['dateStart'];delete _0x50def1[_0x9c4e('0x2c')][_0x9c4e('0x2d')];_0x29201b[_0x9c4e('0x2c')]=_[_0x9c4e('0x2b')](_0x50def1['query']);_0x29201b['filters']=_[_0x9c4e('0x2e')](_0x29201b[_0x9c4e('0x2a')],_0x29201b['query']);_0x4516e5[_0x9c4e('0x2f')]=_[_0x9c4e('0x2e')](_0x29201b[_0x9c4e('0x2a')],qs[_0x9c4e('0x30')](_0x50def1[_0x9c4e('0x2c')]['fields']));_0x4516e5[_0x9c4e('0x2f')]=_0x4516e5['attributes'][_0x9c4e('0x31')]?_0x4516e5['attributes']:_0x29201b[_0x9c4e('0x2a')];if(!_0x50def1['query']['hasOwnProperty'](_0x9c4e('0x32'))){_0x4516e5['limit']=qs['limit'](_0x50def1[_0x9c4e('0x2c')][_0x9c4e('0x1f')]);_0x4516e5[_0x9c4e('0x1e')]=qs[_0x9c4e('0x1e')](_0x50def1['query'][_0x9c4e('0x1e')]);}_0x4516e5['order']=qs[_0x9c4e('0x33')](_0x50def1[_0x9c4e('0x2c')][_0x9c4e('0x33')]);_0x4516e5[_0x9c4e('0x34')]=qs[_0x9c4e('0x35')](_['pick'](_0x50def1[_0x9c4e('0x2c')],_0x29201b[_0x9c4e('0x35')]));if(_0x2f5f5e[_0x9c4e('0x36')]){if(_0x2f5f5e[_0x9c4e('0x2d')]){_0x2f5f5e['dateEnd']=moment(_0x2f5f5e[_0x9c4e('0x2d')])['add'](0x1,_0x9c4e('0x37'));}else{_0x2f5f5e[_0x9c4e('0x2d')]=moment(_0x2f5f5e['dateStart'])[_0x9c4e('0x38')](0x1,_0x9c4e('0x37'));}_['merge'](_0x4516e5['where'],{'createdAt':{'$gte':_0x2f5f5e[_0x9c4e('0x36')],'$lte':_0x2f5f5e[_0x9c4e('0x2d')]}});}if(_0x50def1[_0x9c4e('0x2c')]['filter']){_0x4516e5[_0x9c4e('0x34')]=_[_0x9c4e('0x39')](_0x4516e5[_0x9c4e('0x34')],{'$or':_[_0x9c4e('0x3a')](_0x4516e5[_0x9c4e('0x2f')],function(_0x548579){var _0x4a20ab={};_0x4a20ab[_0x548579]={'$like':'%'+_0x50def1[_0x9c4e('0x2c')][_0x9c4e('0x3b')]+'%'};return _0x4a20ab;})});}_0x4516e5=_[_0x9c4e('0x39')]({},_0x4516e5,_0x50def1[_0x9c4e('0x3c')]);var _0x120d67={'where':_0x4516e5[_0x9c4e('0x34')]};_0x120d67[_0x9c4e('0x3d')]=[];if(_0x50def1[_0x9c4e('0x2c')][_0x9c4e('0x3e')]){_0x120d67[_0x9c4e('0x3d')]['push']({'model':db['Tag'],'as':_0x9c4e('0x3f'),'attributes':['id'],'where':{'id':_0x50def1[_0x9c4e('0x2c')][_0x9c4e('0x3e')]},'required':!![]});_0x120d67[_0x9c4e('0x40')]=!![];}if(_0x50def1[_0x9c4e('0x2c')]['read']){_0x120d67[_0x9c4e('0x3d')][_0x9c4e('0x41')]({'model':db[_0x9c4e('0x42')],'as':'Messages','attributes':['id','direction',_0x9c4e('0x43'),_0x9c4e('0x44')],'where':{'direction':'in','read':_0x50def1['query'][_0x9c4e('0x44')]||![]},'required':!![]});_0x120d67[_0x9c4e('0x40')]=!![];}return db['SmsInteraction'][_0x9c4e('0x45')](_0x120d67)[_0x9c4e('0x25')](function(_0x27933e){_0x2cc7dd[_0x9c4e('0x45')]=_0x27933e;if(_0x50def1[_0x9c4e('0x2c')][_0x9c4e('0x46')]){_0x4516e5['include']=[{'model':db[_0x9c4e('0x47')],'as':_0x9c4e('0x48'),'required':![],'attributes':['id',_0x9c4e('0x28'),'fullname']},{'model':db[_0x9c4e('0x49')],'as':_0x9c4e('0x4a'),'required':![]},{'model':db[_0x9c4e('0x47')],'as':'Owner','attributes':['name',_0x9c4e('0x4b'),_0x9c4e('0x4c')],'required':![]},{'model':db[_0x9c4e('0x4d')],'as':_0x9c4e('0x4e'),'attributes':[_0x9c4e('0x28'),_0x9c4e('0x4f')],'required':![]},{'model':db['SmsMessage'],'as':_0x9c4e('0x50'),'attributes':['id','direction','createdAt',_0x9c4e('0x44')],'where':{'direction':'in','read':_0x50def1[_0x9c4e('0x2c')][_0x9c4e('0x44')]||![]},'required':_0x50def1[_0x9c4e('0x2c')][_0x9c4e('0x44')]||![]},{'model':db[_0x9c4e('0x51')],'as':_0x9c4e('0x3f'),'attributes':['id',_0x9c4e('0x28'),_0x9c4e('0x52')],'required':_0x50def1[_0x9c4e('0x2c')][_0x9c4e('0x3e')]?!![]:![]},{'model':db['Tag'],'as':_0x9c4e('0x53'),'attributes':['id',_0x9c4e('0x28'),_0x9c4e('0x52')],'through':_0x50def1[_0x9c4e('0x2c')][_0x9c4e('0x3e')]?{'attributes':[],'where':{'TagId':_0x50def1[_0x9c4e('0x2c')][_0x9c4e('0x3e')]||undefined}}:{},'required':_0x50def1['query'][_0x9c4e('0x3e')]?!![]:![]}];}return db[_0x9c4e('0x29')]['findAll'](_0x4516e5);})[_0x9c4e('0x25')](function(_0x72c425){_0x2cc7dd['rows']=_0x72c425;return _0x2cc7dd;})[_0x9c4e('0x25')](respondWithFilteredResult(_0x24ccf6,_0x4516e5))[_0x9c4e('0x54')](handleError(_0x24ccf6,null));};exports['show']=function(_0x225e62,_0x548ac6){var _0x548375={'raw':![],'where':{'id':_0x225e62[_0x9c4e('0x55')]['id']}},_0x5cadc5={};_0x5cadc5[_0x9c4e('0x2a')]=_[_0x9c4e('0x2b')](db[_0x9c4e('0x29')][_0x9c4e('0x56')]);_0x5cadc5['query']=_[_0x9c4e('0x2b')](_0x225e62[_0x9c4e('0x2c')]);_0x5cadc5['filters']=_['intersection'](_0x5cadc5[_0x9c4e('0x2a')],_0x5cadc5[_0x9c4e('0x2c')]);_0x548375[_0x9c4e('0x2f')]=_['intersection'](_0x5cadc5['model'],qs['fields'](_0x225e62[_0x9c4e('0x2c')][_0x9c4e('0x30')]));_0x548375['attributes']=_0x548375['attributes'][_0x9c4e('0x31')]?_0x548375[_0x9c4e('0x2f')]:_0x5cadc5['model'];if(_0x225e62[_0x9c4e('0x2c')][_0x9c4e('0x46')]){_0x548375['include']=[{'all':!![]}];}_0x548375=_['merge']({},_0x548375,_0x225e62[_0x9c4e('0x3c')]);return db['SmsInteraction'][_0x9c4e('0x57')](_0x548375)['then'](handleEntityNotFound(_0x548ac6,null))['then'](respondWithResult(_0x548ac6,null))[_0x9c4e('0x54')](handleError(_0x548ac6,null));};exports[_0x9c4e('0x58')]=function(_0x423a85,_0x14a5a0){return db[_0x9c4e('0x29')][_0x9c4e('0x58')](_0x423a85[_0x9c4e('0x59')],{})[_0x9c4e('0x25')](respondWithResult(_0x14a5a0,0xc9))[_0x9c4e('0x54')](handleError(_0x14a5a0,null));};exports[_0x9c4e('0x24')]=function(_0xc646d0,_0x547243){if(_0xc646d0[_0x9c4e('0x59')]['id']){delete _0xc646d0[_0x9c4e('0x59')]['id'];}return db[_0x9c4e('0x29')][_0x9c4e('0x57')]({'where':{'id':_0xc646d0[_0x9c4e('0x55')]['id']}})[_0x9c4e('0x25')](handleEntityNotFound(_0x547243,null))[_0x9c4e('0x25')](saveUpdates(_0xc646d0[_0x9c4e('0x59')],null))[_0x9c4e('0x25')](respondWithResult(_0x547243,null))[_0x9c4e('0x54')](handleError(_0x547243,null));};exports[_0x9c4e('0x5a')]=function(_0x339e76,_0x4ed2c3){return db[_0x9c4e('0x29')][_0x9c4e('0x57')]({'where':{'id':_0x339e76[_0x9c4e('0x55')]['id']}})['then'](handleEntityNotFound(_0x4ed2c3,null))[_0x9c4e('0x25')](removeEntity(_0x4ed2c3,null))[_0x9c4e('0x54')](handleError(_0x4ed2c3,null));};exports[_0x9c4e('0x5b')]=function(_0x440791,_0x3b390d){return db[_0x9c4e('0x29')][_0x9c4e('0x5b')]()[_0x9c4e('0x25')](respondWithResult(_0x3b390d,null))[_0x9c4e('0x54')](handleError(_0x3b390d,null));};exports['addMessage']=function(_0x451b74,_0x5655d4,_0x1b1dde){return db[_0x9c4e('0x42')][_0x9c4e('0x57')]({'where':{'id':_0x451b74[_0x9c4e('0x55')]['id']}})[_0x9c4e('0x25')](handleEntityNotFound(_0x5655d4,null))[_0x9c4e('0x25')](function(_0xd9a388){if(_0xd9a388){return _0xd9a388['addMessage'](_0x451b74['body'][_0x9c4e('0x5c')],_[_0x9c4e('0x5d')](_0x451b74['body'],[_0x9c4e('0x5c'),'id'])||{});}})[_0x9c4e('0x25')](respondWithResult(_0x5655d4,null))[_0x9c4e('0x54')](handleError(_0x5655d4,null));};exports[_0x9c4e('0x5e')]=function(_0x31d172,_0x174ef8,_0x1dddbe){var _0x30da8f={'raw':![],'where':{}};var _0x5b4391={};var _0x52ba6e={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x9c4e('0x5f')]({'where':{'id':_0x31d172['params']['id']}})['then'](handleEntityNotFound(_0x174ef8,null))[_0x9c4e('0x25')](function(_0xbfdc65){if(_0xbfdc65){_0x5b4391[_0x9c4e('0x2a')]=_[_0x9c4e('0x2b')](db[_0x9c4e('0x42')]['rawAttributes']);_0x5b4391['query']=_[_0x9c4e('0x2b')](_0x31d172['query']);_0x5b4391['filters']=_[_0x9c4e('0x2e')](_0x5b4391[_0x9c4e('0x2a')],_0x5b4391['query']);_0x30da8f[_0x9c4e('0x2f')]=_[_0x9c4e('0x2e')](_0x5b4391[_0x9c4e('0x2a')],qs[_0x9c4e('0x30')](_0x31d172[_0x9c4e('0x2c')][_0x9c4e('0x30')]));_0x30da8f['attributes']=_0x30da8f[_0x9c4e('0x2f')][_0x9c4e('0x31')]?_0x30da8f[_0x9c4e('0x2f')]:_0x5b4391[_0x9c4e('0x2a')];if(!_0x31d172[_0x9c4e('0x2c')][_0x9c4e('0x60')](_0x9c4e('0x32'))){_0x30da8f['limit']=qs[_0x9c4e('0x1f')](_0x31d172['query'][_0x9c4e('0x1f')]);_0x30da8f['offset']=qs[_0x9c4e('0x1e')](_0x31d172[_0x9c4e('0x2c')][_0x9c4e('0x1e')]);}_0x30da8f[_0x9c4e('0x61')]=qs[_0x9c4e('0x33')](_0x31d172[_0x9c4e('0x2c')][_0x9c4e('0x33')]);_0x30da8f[_0x9c4e('0x34')]=qs[_0x9c4e('0x35')](_['pick'](_0x31d172[_0x9c4e('0x2c')],_0x5b4391[_0x9c4e('0x35')]));_0x30da8f[_0x9c4e('0x34')][_0x9c4e('0x62')]=_0xbfdc65['id'];if(_0x31d172[_0x9c4e('0x2c')][_0x9c4e('0x3b')]){_0x30da8f[_0x9c4e('0x34')]=_[_0x9c4e('0x39')](_0x30da8f['where'],{'$or':_[_0x9c4e('0x3a')](_0x30da8f[_0x9c4e('0x2f')],function(_0x51a759){var _0xfee83e={};_0xfee83e[_0x51a759]={'$like':'%'+_0x31d172[_0x9c4e('0x2c')][_0x9c4e('0x3b')]+'%'};return _0xfee83e;})});}if(_0x31d172['query'][_0x9c4e('0x63')]){var _0x49ed7e=_0x31d172[_0x9c4e('0x2c')][_0x9c4e('0x63')]['split'](',');var _0x5e2bb6={};_0x5e2bb6[_0x49ed7e[0x0]]={'$gte':moment(_0x49ed7e[0x1])[_0x9c4e('0x64')](_0x9c4e('0x65'))};_0x30da8f['where']=_[_0x9c4e('0x39')](_0x30da8f['where'],_0x5e2bb6);}_0x30da8f=_[_0x9c4e('0x39')]({},_0x30da8f,_0x31d172[_0x9c4e('0x3c')]);return db[_0x9c4e('0x42')][_0x9c4e('0x45')]({'where':_0x30da8f[_0x9c4e('0x34')]})[_0x9c4e('0x25')](function(_0x15d669){_0x52ba6e[_0x9c4e('0x45')]=_0x15d669;if(_0x31d172['query'][_0x9c4e('0x46')]){_0x30da8f['include']=[{'all':!![]}];}return db[_0x9c4e('0x42')][_0x9c4e('0x66')](_0x30da8f);})[_0x9c4e('0x25')](function(_0x375f0d){_0x52ba6e[_0x9c4e('0x67')]=_0x375f0d;return _0x52ba6e;});}})[_0x9c4e('0x25')](respondWithFilteredResult(_0x174ef8,_0x30da8f))[_0x9c4e('0x54')](handleError(_0x174ef8,null));};exports[_0x9c4e('0x68')]=function(_0x447094,_0x38ccd9,_0x7c9b35){return db[_0x9c4e('0x29')][_0x9c4e('0x57')]({'where':{'id':_0x447094['params']['id']}})[_0x9c4e('0x25')](handleEntityNotFound(_0x38ccd9,null))[_0x9c4e('0x25')](function(_0x3c3564){if(_0x3c3564){return _0x3c3564[_0x9c4e('0x69')](_0x447094[_0x9c4e('0x59')][_0x9c4e('0x5c')],_['omit'](_0x447094[_0x9c4e('0x59')],[_0x9c4e('0x5c'),'id'])||{})[_0x9c4e('0x6a')](function(){return db[_0x9c4e('0x51')][_0x9c4e('0x66')]({'attributes':['id','name',_0x9c4e('0x52')],'where':{'id':_0x447094[_0x9c4e('0x59')]['ids']}});})['then'](function(_0xe5061a){socket[_0x9c4e('0x6b')]('smsInteractionTags:save',{'id':Number(_0x447094[_0x9c4e('0x55')]['id']),'tags':_0xe5061a||[]});return{'id':Number(_0x447094[_0x9c4e('0x55')]['id']),'tags':_0xe5061a||[]};});}})[_0x9c4e('0x25')](respondWithResult(_0x38ccd9,null))[_0x9c4e('0x54')](handleError(_0x38ccd9,null));};exports['removeTags']=function(_0x404027,_0x1821bd,_0x43d114){var _0x472b25;return db['SmsInteraction'][_0x9c4e('0x57')]({'where':{'id':_0x404027[_0x9c4e('0x55')]['id']}})['then'](handleEntityNotFound(_0x1821bd,null))[_0x9c4e('0x25')](function(_0x4937b3){if(_0x4937b3){return _0x4937b3['removeTags'](_0x404027['query']['ids']);}})[_0x9c4e('0x25')](respondWithStatusCode(_0x1821bd,null))[_0x9c4e('0x54')](handleError(_0x1821bd,null));};exports['download']=function(_0x40ce5d,_0x5388ad){var _0x504257=moment()[_0x9c4e('0x6c')]()[_0x9c4e('0x6d')]();var _0x24341b=path['join'](config[_0x9c4e('0x6e')],_0x9c4e('0x6f'),_0x9c4e('0x70'),_0x9c4e('0x71'));var _0x4b0ee6=path[_0x9c4e('0x72')](config[_0x9c4e('0x6e')],_0x9c4e('0x6f'),_0x9c4e('0x70'),'attachments');var _0x228ab2=path[_0x9c4e('0x72')](_0x24341b,_0x504257);var _0x1a6236=util[_0x9c4e('0x64')](_0x9c4e('0x73'),_0x504257);var _0x2557d7=path[_0x9c4e('0x72')](_0x24341b,_0x1a6236);var _0x3a1f71=![];return db['SmsInteraction'][_0x9c4e('0x57')]({'where':{'id':_0x40ce5d[_0x9c4e('0x55')]['id']},'include':[{'model':db[_0x9c4e('0x42')],'as':_0x9c4e('0x50'),'attributes':['id',_0x9c4e('0x59')],'include':[{'model':db[_0x9c4e('0x47')],'as':_0x9c4e('0x47'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x9c4e('0x49')],'as':'Contact','attributes':['id',_0x9c4e('0x74')],'raw':!![]}]}]})[_0x9c4e('0x25')](handleEntityNotFound(_0x5388ad,null))['then'](function(_0x14627f){if(_0x14627f){_0x3a1f71=!![];var _0x156897='';var _0x5b88fd={'format':_0x9c4e('0x75'),'border':_0x9c4e('0x76')};fs[_0x9c4e('0x77')](_0x228ab2);_0x156897+=util[_0x9c4e('0x64')](_0x9c4e('0x78'),_0x14627f['id']);_0x156897+=util[_0x9c4e('0x64')](_0x9c4e('0x79'),moment()[_0x9c4e('0x64')](_0x9c4e('0x7a'))[_0x9c4e('0x6d')]());_0x156897+=_0x9c4e('0x7b');for(var _0x3c821b=0x0;_0x3c821b<_0x14627f[_0x9c4e('0x50')][_0x9c4e('0x31')];_0x3c821b++){var _0x2748d2=_0x14627f[_0x9c4e('0x50')][_0x3c821b];_0x156897+=_0x9c4e('0x7c');_0x156897+=util[_0x9c4e('0x64')]('<p\x20style=\x22margin:\x203px;\x22>%s:\x20%s</p>',_0x2748d2[_0x9c4e('0x47')]?_0x2748d2[_0x9c4e('0x47')][_0x9c4e('0x4b')]:_0x2748d2[_0x9c4e('0x4a')][_0x9c4e('0x74')],_0x2748d2['body']);_0x156897+=_0x9c4e('0x7d');}return new BPromise(function(_0x3140ce,_0x11e99){pdf[_0x9c4e('0x58')](_0x156897,_0x5b88fd)[_0x9c4e('0x7e')](path[_0x9c4e('0x72')](_0x228ab2,_0x9c4e('0x7f')+_0x504257+_0x9c4e('0x80')),function(_0x158b3a,_0x17dd5a){if(_0x158b3a)return _0x11e99(_0x158b3a);_0x3140ce(_0x17dd5a);});});}})['then'](function(){if(_0x3a1f71){return new BPromise(function(_0x5e9b80,_0x46f0ec){zipdir(_0x228ab2,{'saveTo':_0x2557d7},function(_0x563f29,_0x3c3ac5){if(_0x563f29)return _0x46f0ec(_0x563f29);return _0x5e9b80(_0x3c3ac5);});});}})[_0x9c4e('0x25')](function(){if(_0x3a1f71){return new BPromise(function(_0x3a69d1,_0x29e17e){rimraf(_0x228ab2,function(_0x2a53b3){if(_0x2a53b3)_0x29e17e(_0x2a53b3);return _0x3a69d1();});});}})[_0x9c4e('0x25')](function(){if(_0x3a1f71){return _0x5388ad[_0x9c4e('0x81')](_0x2557d7,_0x1a6236,function(_0x207d6e){if(_0x207d6e){console[_0x9c4e('0x82')](_0x9c4e('0x83'),_0x207d6e);}else{fs[_0x9c4e('0x84')](_0x2557d7);}});}else{return _0x5388ad['sendStatus'](0xc8);}})['catch'](handleError(_0x5388ad,null));};
\ No newline at end of file
+var _0xc9f8=['firstName','Letter','1cm','<h1>Sms\x20Interaction:\x20#%d</h1>','<h2>Date:\x20%s</h2>','<hr>','<p\x20style=\x22margin:\x203px;\x22>%s:\x20%s</p>','</div>','toFile','.pdf','log','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./smsInteraction.socket','register','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','stack','send','index','SmsInteraction','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','add','day','filter','merge','map','options','tag','include','push','Tag','Tags','read','SmsMessage','Messages','direction','createdAt','distinct','User','Users','name','fullname','CmContact','Contact','Owner','internal','SmsAccount','Account','key','ThroughTags','color','findAll','rows','catch','show','params','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','sort','SmsInteractionId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','interaction-%s.zip'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0xc9f8,0x1a4));var _0x8c9f=function(_0x470798,_0x2c8dc9){_0x470798=_0x470798-0x0;var _0x31625a=_0xc9f8[_0x470798];return _0x31625a;};'use strict';var pdf=require(_0x8c9f('0x0'));var emlformat=require(_0x8c9f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8c9f('0x2'));var jsonpatch=require(_0x8c9f('0x3'));var rp=require(_0x8c9f('0x4'));var moment=require(_0x8c9f('0x5'));var BPromise=require(_0x8c9f('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8c9f('0x7'));var ejs=require(_0x8c9f('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8c9f('0x9'));var crypto=require('crypto');var jsforce=require(_0x8c9f('0xa'));var deskjs=require(_0x8c9f('0xb'));var toCsv=require(_0x8c9f('0x7'));var querystring=require(_0x8c9f('0xc'));var Papa=require(_0x8c9f('0xd'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x8c9f('0xe'));var utils=require(_0x8c9f('0xf'));var config=require(_0x8c9f('0x10'));var db=require(_0x8c9f('0x11'))['db'];var socket=require(_0x8c9f('0x12'))({'host':_0x8c9f('0x13'),'port':0x18eb});require(_0x8c9f('0x14'))[_0x8c9f('0x15')](socket);function respondWithStatusCode(_0x1313ed,_0x174c93){_0x174c93=_0x174c93||0xcc;return function(_0x694eed){if(_0x694eed){return _0x1313ed['sendStatus'](_0x174c93);}return _0x1313ed[_0x8c9f('0x16')](_0x174c93)[_0x8c9f('0x17')]();};}function respondWithResult(_0x2583d8,_0x24003f){_0x24003f=_0x24003f||0xc8;return function(_0x575d56){if(_0x575d56){return _0x2583d8['status'](_0x24003f)['json'](_0x575d56);}};}function respondWithFilteredResult(_0x3e43a6,_0x5678a0){return function(_0x3f63c4){if(_0x3f63c4){var _0x4782ed=_0x3f63c4[_0x8c9f('0x18')],_0x1ec903=_0x5678a0[_0x8c9f('0x19')],_0x1f88d5=_0x5678a0[_0x8c9f('0x19')]+_0x5678a0[_0x8c9f('0x1a')],_0x1f1088;if(_0x1f88d5>=_0x4782ed){_0x1f88d5=_0x4782ed;_0x1f1088=0xc8;}else{_0x1f1088=0xce;}_0x3e43a6[_0x8c9f('0x16')](_0x1f1088);return _0x3e43a6[_0x8c9f('0x1b')](_0x8c9f('0x1c'),_0x1ec903+'-'+_0x1f88d5+'/'+_0x4782ed)[_0x8c9f('0x1d')](_0x3f63c4);}return null;};}function patchUpdates(_0x127079){return function(_0x27c8cd){try{jsonpatch['apply'](_0x27c8cd,_0x127079,!![]);}catch(_0x13a2f9){return BPromise[_0x8c9f('0x1e')](_0x13a2f9);}return _0x27c8cd[_0x8c9f('0x1f')]();};}function saveUpdates(_0x516ad6,_0x1d6f8c){return function(_0x40ce1d){if(_0x40ce1d){return _0x40ce1d[_0x8c9f('0x20')](_0x516ad6)[_0x8c9f('0x21')](function(_0xdfab30){return _0xdfab30;});}return null;};}function removeEntity(_0x2af825,_0x54ed19){return function(_0x472a0c){if(_0x472a0c){return _0x472a0c[_0x8c9f('0x22')]()[_0x8c9f('0x21')](function(){_0x2af825[_0x8c9f('0x16')](0xcc)[_0x8c9f('0x17')]();});}};}function handleEntityNotFound(_0x5cf2c2,_0x2be6be){return function(_0x2e3e2f){if(!_0x2e3e2f){_0x5cf2c2[_0x8c9f('0x23')](0x194);}return _0x2e3e2f;};}function handleError(_0x3f7846,_0x1135f6){_0x1135f6=_0x1135f6||0x1f4;return function(_0x549fb7){logger[_0x8c9f('0x24')](_0x549fb7[_0x8c9f('0x25')]);if(_0x549fb7['name']){delete _0x549fb7['name'];}_0x3f7846[_0x8c9f('0x16')](_0x1135f6)[_0x8c9f('0x26')](_0x549fb7);};}exports[_0x8c9f('0x27')]=function(_0x18c54a,_0x5ccdaa){var _0x2a1258={},_0x3a49c8={},_0x116efd={'count':0x0,'rows':[]};var _0x44e751=db[_0x8c9f('0x28')][_0x8c9f('0x29')];_0x3a49c8[_0x8c9f('0x2a')]=_[_0x8c9f('0x2b')](_0x44e751);var _0x2f3597={'dateStart':_0x18c54a[_0x8c9f('0x2c')][_0x8c9f('0x2d')],'dateEnd':_0x18c54a[_0x8c9f('0x2c')][_0x8c9f('0x2e')]};delete _0x18c54a[_0x8c9f('0x2c')][_0x8c9f('0x2d')];delete _0x18c54a['query'][_0x8c9f('0x2e')];_0x3a49c8[_0x8c9f('0x2c')]=_[_0x8c9f('0x2b')](_0x18c54a['query']);_0x3a49c8[_0x8c9f('0x2f')]=_[_0x8c9f('0x30')](_0x3a49c8['model'],_0x3a49c8[_0x8c9f('0x2c')]);_0x2a1258[_0x8c9f('0x31')]=_[_0x8c9f('0x30')](_0x3a49c8[_0x8c9f('0x2a')],qs[_0x8c9f('0x32')](_0x18c54a['query'][_0x8c9f('0x32')]));_0x2a1258[_0x8c9f('0x31')]=_0x2a1258['attributes'][_0x8c9f('0x33')]?_0x2a1258['attributes']:_0x3a49c8[_0x8c9f('0x2a')];if(!_0x18c54a['query'][_0x8c9f('0x34')](_0x8c9f('0x35'))){_0x2a1258[_0x8c9f('0x1a')]=qs[_0x8c9f('0x1a')](_0x18c54a[_0x8c9f('0x2c')][_0x8c9f('0x1a')]);_0x2a1258[_0x8c9f('0x19')]=qs[_0x8c9f('0x19')](_0x18c54a['query'][_0x8c9f('0x19')]);}_0x2a1258[_0x8c9f('0x36')]=qs['sort'](_0x18c54a[_0x8c9f('0x2c')]['sort']);_0x2a1258[_0x8c9f('0x37')]=qs[_0x8c9f('0x2f')](_[_0x8c9f('0x38')](_0x18c54a['query'],_0x3a49c8[_0x8c9f('0x2f')]));if(_0x2f3597[_0x8c9f('0x2d')]){if(_0x2f3597[_0x8c9f('0x2e')]){_0x2f3597['dateEnd']=moment(_0x2f3597[_0x8c9f('0x2e')])['add'](0x1,'day');}else{_0x2f3597['dateEnd']=moment(_0x2f3597[_0x8c9f('0x2d')])[_0x8c9f('0x39')](0x1,_0x8c9f('0x3a'));}_['merge'](_0x2a1258[_0x8c9f('0x37')],{'createdAt':{'$gte':_0x2f3597[_0x8c9f('0x2d')],'$lte':_0x2f3597[_0x8c9f('0x2e')]}});}if(_0x18c54a[_0x8c9f('0x2c')][_0x8c9f('0x3b')]){_0x2a1258[_0x8c9f('0x37')]=_[_0x8c9f('0x3c')](_0x2a1258[_0x8c9f('0x37')],{'$or':_[_0x8c9f('0x3d')](_0x2a1258['attributes'],function(_0x1c60db){var _0x4378b8={};_0x4378b8[_0x1c60db]={'$like':'%'+_0x18c54a[_0x8c9f('0x2c')][_0x8c9f('0x3b')]+'%'};return _0x4378b8;})});}_0x2a1258=_[_0x8c9f('0x3c')]({},_0x2a1258,_0x18c54a[_0x8c9f('0x3e')]);var _0x24a819={'where':_0x2a1258[_0x8c9f('0x37')]};_0x24a819['include']=[];if(_0x18c54a[_0x8c9f('0x2c')][_0x8c9f('0x3f')]){_0x24a819[_0x8c9f('0x40')][_0x8c9f('0x41')]({'model':db[_0x8c9f('0x42')],'as':_0x8c9f('0x43'),'attributes':['id'],'where':{'id':_0x18c54a[_0x8c9f('0x2c')][_0x8c9f('0x3f')]},'required':!![]});_0x24a819['distinct']=!![];}if(_0x18c54a[_0x8c9f('0x2c')][_0x8c9f('0x44')]){_0x24a819[_0x8c9f('0x40')][_0x8c9f('0x41')]({'model':db[_0x8c9f('0x45')],'as':_0x8c9f('0x46'),'attributes':['id',_0x8c9f('0x47'),_0x8c9f('0x48'),_0x8c9f('0x44')],'where':{'direction':'in','read':_0x18c54a[_0x8c9f('0x2c')][_0x8c9f('0x44')]||![]},'required':!![]});_0x24a819[_0x8c9f('0x49')]=!![];}return db[_0x8c9f('0x28')][_0x8c9f('0x18')](_0x24a819)[_0x8c9f('0x21')](function(_0xdda4cb){_0x116efd[_0x8c9f('0x18')]=_0xdda4cb;if(_0x18c54a[_0x8c9f('0x2c')]['includeAll']){_0x2a1258[_0x8c9f('0x40')]=[{'model':db[_0x8c9f('0x4a')],'as':_0x8c9f('0x4b'),'required':![],'attributes':['id',_0x8c9f('0x4c'),_0x8c9f('0x4d')]},{'model':db[_0x8c9f('0x4e')],'as':_0x8c9f('0x4f'),'required':![]},{'model':db['User'],'as':_0x8c9f('0x50'),'attributes':['name',_0x8c9f('0x4d'),_0x8c9f('0x51')],'required':![]},{'model':db[_0x8c9f('0x52')],'as':_0x8c9f('0x53'),'attributes':[_0x8c9f('0x4c'),_0x8c9f('0x54')],'required':![]},{'model':db[_0x8c9f('0x45')],'as':_0x8c9f('0x46'),'attributes':['id',_0x8c9f('0x47'),_0x8c9f('0x48'),_0x8c9f('0x44')],'where':{'direction':'in','read':_0x18c54a[_0x8c9f('0x2c')]['read']||![]},'required':_0x18c54a[_0x8c9f('0x2c')][_0x8c9f('0x44')]||![]},{'model':db[_0x8c9f('0x42')],'as':_0x8c9f('0x43'),'attributes':['id','name','color'],'required':_0x18c54a[_0x8c9f('0x2c')]['tag']?!![]:![]},{'model':db[_0x8c9f('0x42')],'as':_0x8c9f('0x55'),'attributes':['id','name',_0x8c9f('0x56')],'through':_0x18c54a[_0x8c9f('0x2c')]['tag']?{'attributes':[],'where':{'TagId':_0x18c54a[_0x8c9f('0x2c')][_0x8c9f('0x3f')]||undefined}}:{},'required':_0x18c54a[_0x8c9f('0x2c')][_0x8c9f('0x3f')]?!![]:![]}];}return db[_0x8c9f('0x28')][_0x8c9f('0x57')](_0x2a1258);})[_0x8c9f('0x21')](function(_0x409ccc){_0x116efd[_0x8c9f('0x58')]=_0x409ccc;return _0x116efd;})['then'](respondWithFilteredResult(_0x5ccdaa,_0x2a1258))[_0x8c9f('0x59')](handleError(_0x5ccdaa,null));};exports[_0x8c9f('0x5a')]=function(_0x51721a,_0x41ac7c){var _0x434fc4={'raw':![],'where':{'id':_0x51721a[_0x8c9f('0x5b')]['id']}},_0x5127f1={};_0x5127f1[_0x8c9f('0x2a')]=_[_0x8c9f('0x2b')](db['SmsInteraction'][_0x8c9f('0x29')]);_0x5127f1['query']=_[_0x8c9f('0x2b')](_0x51721a[_0x8c9f('0x2c')]);_0x5127f1[_0x8c9f('0x2f')]=_[_0x8c9f('0x30')](_0x5127f1[_0x8c9f('0x2a')],_0x5127f1[_0x8c9f('0x2c')]);_0x434fc4['attributes']=_[_0x8c9f('0x30')](_0x5127f1[_0x8c9f('0x2a')],qs[_0x8c9f('0x32')](_0x51721a['query'][_0x8c9f('0x32')]));_0x434fc4[_0x8c9f('0x31')]=_0x434fc4[_0x8c9f('0x31')][_0x8c9f('0x33')]?_0x434fc4[_0x8c9f('0x31')]:_0x5127f1[_0x8c9f('0x2a')];if(_0x51721a[_0x8c9f('0x2c')]['includeAll']){_0x434fc4[_0x8c9f('0x40')]=[{'all':!![]}];}_0x434fc4=_[_0x8c9f('0x3c')]({},_0x434fc4,_0x51721a['options']);return db[_0x8c9f('0x28')][_0x8c9f('0x5c')](_0x434fc4)[_0x8c9f('0x21')](handleEntityNotFound(_0x41ac7c,null))['then'](respondWithResult(_0x41ac7c,null))['catch'](handleError(_0x41ac7c,null));};exports[_0x8c9f('0x5d')]=function(_0x14bafc,_0x14e1ec){return db[_0x8c9f('0x28')][_0x8c9f('0x5d')](_0x14bafc['body'],{})[_0x8c9f('0x21')](respondWithResult(_0x14e1ec,0xc9))[_0x8c9f('0x59')](handleError(_0x14e1ec,null));};exports[_0x8c9f('0x20')]=function(_0x36075f,_0x93562){if(_0x36075f[_0x8c9f('0x5e')]['id']){delete _0x36075f[_0x8c9f('0x5e')]['id'];}return db['SmsInteraction'][_0x8c9f('0x5c')]({'where':{'id':_0x36075f[_0x8c9f('0x5b')]['id']}})[_0x8c9f('0x21')](handleEntityNotFound(_0x93562,null))[_0x8c9f('0x21')](saveUpdates(_0x36075f[_0x8c9f('0x5e')],null))['then'](respondWithResult(_0x93562,null))[_0x8c9f('0x59')](handleError(_0x93562,null));};exports['destroy']=function(_0x4091d3,_0x55dc3d){return db['SmsInteraction']['find']({'where':{'id':_0x4091d3[_0x8c9f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x55dc3d,null))[_0x8c9f('0x21')](removeEntity(_0x55dc3d,null))[_0x8c9f('0x59')](handleError(_0x55dc3d,null));};exports[_0x8c9f('0x5f')]=function(_0x355e45,_0x38bb08){return db[_0x8c9f('0x28')]['describe']()['then'](respondWithResult(_0x38bb08,null))[_0x8c9f('0x59')](handleError(_0x38bb08,null));};exports[_0x8c9f('0x60')]=function(_0x33fc8f,_0x274085,_0x1cd1ca){return db[_0x8c9f('0x45')]['find']({'where':{'id':_0x33fc8f[_0x8c9f('0x5b')]['id']}})[_0x8c9f('0x21')](handleEntityNotFound(_0x274085,null))[_0x8c9f('0x21')](function(_0x374f63){if(_0x374f63){return _0x374f63['addMessage'](_0x33fc8f[_0x8c9f('0x5e')][_0x8c9f('0x61')],_[_0x8c9f('0x62')](_0x33fc8f[_0x8c9f('0x5e')],[_0x8c9f('0x61'),'id'])||{});}})[_0x8c9f('0x21')](respondWithResult(_0x274085,null))[_0x8c9f('0x59')](handleError(_0x274085,null));};exports[_0x8c9f('0x63')]=function(_0x27de15,_0x48eb96,_0x39b737){var _0x4f1f72={'raw':![],'where':{}};var _0x3903ed={};var _0x206f60={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x8c9f('0x64')]({'where':{'id':_0x27de15[_0x8c9f('0x5b')]['id']}})[_0x8c9f('0x21')](handleEntityNotFound(_0x48eb96,null))[_0x8c9f('0x21')](function(_0x47cb1c){if(_0x47cb1c){_0x3903ed['model']=_['keys'](db[_0x8c9f('0x45')][_0x8c9f('0x29')]);_0x3903ed[_0x8c9f('0x2c')]=_['keys'](_0x27de15[_0x8c9f('0x2c')]);_0x3903ed[_0x8c9f('0x2f')]=_['intersection'](_0x3903ed[_0x8c9f('0x2a')],_0x3903ed[_0x8c9f('0x2c')]);_0x4f1f72['attributes']=_[_0x8c9f('0x30')](_0x3903ed[_0x8c9f('0x2a')],qs[_0x8c9f('0x32')](_0x27de15[_0x8c9f('0x2c')]['fields']));_0x4f1f72['attributes']=_0x4f1f72[_0x8c9f('0x31')][_0x8c9f('0x33')]?_0x4f1f72[_0x8c9f('0x31')]:_0x3903ed['model'];if(!_0x27de15['query'][_0x8c9f('0x34')](_0x8c9f('0x35'))){_0x4f1f72[_0x8c9f('0x1a')]=qs[_0x8c9f('0x1a')](_0x27de15[_0x8c9f('0x2c')][_0x8c9f('0x1a')]);_0x4f1f72['offset']=qs[_0x8c9f('0x19')](_0x27de15[_0x8c9f('0x2c')][_0x8c9f('0x19')]);}_0x4f1f72[_0x8c9f('0x36')]=qs[_0x8c9f('0x65')](_0x27de15[_0x8c9f('0x2c')]['sort']);_0x4f1f72[_0x8c9f('0x37')]=qs[_0x8c9f('0x2f')](_['pick'](_0x27de15[_0x8c9f('0x2c')],_0x3903ed[_0x8c9f('0x2f')]));_0x4f1f72[_0x8c9f('0x37')][_0x8c9f('0x66')]=_0x47cb1c['id'];if(_0x27de15[_0x8c9f('0x2c')][_0x8c9f('0x3b')]){_0x4f1f72[_0x8c9f('0x37')]=_['merge'](_0x4f1f72[_0x8c9f('0x37')],{'$or':_[_0x8c9f('0x3d')](_0x4f1f72[_0x8c9f('0x31')],function(_0x4bd9a7){var _0x24fabb={};_0x24fabb[_0x4bd9a7]={'$like':'%'+_0x27de15[_0x8c9f('0x2c')][_0x8c9f('0x3b')]+'%'};return _0x24fabb;})});}if(_0x27de15['query'][_0x8c9f('0x67')]){var _0x2253b1=_0x27de15['query'][_0x8c9f('0x67')][_0x8c9f('0x68')](',');var _0x22d302={};_0x22d302[_0x2253b1[0x0]]={'$gte':moment(_0x2253b1[0x1])[_0x8c9f('0x69')](_0x8c9f('0x6a'))};_0x4f1f72[_0x8c9f('0x37')]=_[_0x8c9f('0x3c')](_0x4f1f72['where'],_0x22d302);}_0x4f1f72=_[_0x8c9f('0x3c')]({},_0x4f1f72,_0x27de15[_0x8c9f('0x3e')]);return db[_0x8c9f('0x45')][_0x8c9f('0x18')]({'where':_0x4f1f72[_0x8c9f('0x37')]})['then'](function(_0x226828){_0x206f60[_0x8c9f('0x18')]=_0x226828;if(_0x27de15[_0x8c9f('0x2c')][_0x8c9f('0x6b')]){_0x4f1f72[_0x8c9f('0x40')]=[{'all':!![]}];}return db['SmsMessage'][_0x8c9f('0x57')](_0x4f1f72);})['then'](function(_0x496a6d){_0x206f60['rows']=_0x496a6d;return _0x206f60;});}})[_0x8c9f('0x21')](respondWithFilteredResult(_0x48eb96,_0x4f1f72))[_0x8c9f('0x59')](handleError(_0x48eb96,null));};exports[_0x8c9f('0x6c')]=function(_0x293288,_0x781d,_0xb227e7){return db['SmsInteraction'][_0x8c9f('0x5c')]({'where':{'id':_0x293288[_0x8c9f('0x5b')]['id']}})[_0x8c9f('0x21')](handleEntityNotFound(_0x781d,null))['then'](function(_0x3d2034){if(_0x3d2034){return _0x3d2034[_0x8c9f('0x6d')](_0x293288[_0x8c9f('0x5e')]['ids'],_[_0x8c9f('0x62')](_0x293288[_0x8c9f('0x5e')],['ids','id'])||{})[_0x8c9f('0x6e')](function(){return db[_0x8c9f('0x42')][_0x8c9f('0x57')]({'attributes':['id',_0x8c9f('0x4c'),'color'],'where':{'id':_0x293288[_0x8c9f('0x5e')][_0x8c9f('0x61')]}});})[_0x8c9f('0x21')](function(_0x13f2b4){socket[_0x8c9f('0x6f')](_0x8c9f('0x70'),{'id':Number(_0x293288['params']['id']),'tags':_0x13f2b4||[]});return{'id':Number(_0x293288[_0x8c9f('0x5b')]['id']),'tags':_0x13f2b4||[]};});}})['then'](respondWithResult(_0x781d,null))['catch'](handleError(_0x781d,null));};exports[_0x8c9f('0x71')]=function(_0x3d94c8,_0x36bc2f,_0x19fb37){var _0x3a5b5a;return db['SmsInteraction'][_0x8c9f('0x5c')]({'where':{'id':_0x3d94c8['params']['id']}})[_0x8c9f('0x21')](handleEntityNotFound(_0x36bc2f,null))['then'](function(_0x2db1ea){if(_0x2db1ea){return _0x2db1ea[_0x8c9f('0x71')](_0x3d94c8[_0x8c9f('0x2c')][_0x8c9f('0x61')]);}})['then'](respondWithStatusCode(_0x36bc2f,null))[_0x8c9f('0x59')](handleError(_0x36bc2f,null));};exports[_0x8c9f('0x72')]=function(_0x538762,_0x1e7851){var _0x123058=moment()[_0x8c9f('0x73')]()[_0x8c9f('0x74')]();var _0x1c306a=path[_0x8c9f('0x75')](config[_0x8c9f('0x76')],_0x8c9f('0x77'),_0x8c9f('0x78'),_0x8c9f('0x79'));var _0x293791=path[_0x8c9f('0x75')](config[_0x8c9f('0x76')],_0x8c9f('0x77'),_0x8c9f('0x78'),_0x8c9f('0x7a'));var _0x52da1e=path[_0x8c9f('0x75')](_0x1c306a,_0x123058);var _0x2d14d3=util[_0x8c9f('0x69')](_0x8c9f('0x7b'),_0x123058);var _0xe3b106=path[_0x8c9f('0x75')](_0x1c306a,_0x2d14d3);var _0xbc2985=![];return db[_0x8c9f('0x28')][_0x8c9f('0x5c')]({'where':{'id':_0x538762['params']['id']},'include':[{'model':db[_0x8c9f('0x45')],'as':_0x8c9f('0x46'),'attributes':['id','body'],'include':[{'model':db[_0x8c9f('0x4a')],'as':_0x8c9f('0x4a'),'attributes':['id',_0x8c9f('0x4d')],'raw':!![]},{'model':db['CmContact'],'as':_0x8c9f('0x4f'),'attributes':['id',_0x8c9f('0x7c')],'raw':!![]}]}]})[_0x8c9f('0x21')](handleEntityNotFound(_0x1e7851,null))['then'](function(_0x26de8f){if(_0x26de8f){_0xbc2985=!![];var _0x570fde='';var _0x16a208={'format':_0x8c9f('0x7d'),'border':_0x8c9f('0x7e')};fs['mkdirSync'](_0x52da1e);_0x570fde+=util[_0x8c9f('0x69')](_0x8c9f('0x7f'),_0x26de8f['id']);_0x570fde+=util[_0x8c9f('0x69')](_0x8c9f('0x80'),moment()[_0x8c9f('0x69')]('MMMM\x20Do\x20YYYY,\x20HH:mm:ss')['toString']());_0x570fde+=_0x8c9f('0x81');for(var _0x3b9411=0x0;_0x3b9411<_0x26de8f[_0x8c9f('0x46')][_0x8c9f('0x33')];_0x3b9411++){var _0xf5602=_0x26de8f['Messages'][_0x3b9411];_0x570fde+='<div\x20style=\x22border-style:\x20solid;\x20border-width:\x201px;\x20margin:\x203px;\x22>';_0x570fde+=util[_0x8c9f('0x69')](_0x8c9f('0x82'),_0xf5602[_0x8c9f('0x4a')]?_0xf5602[_0x8c9f('0x4a')][_0x8c9f('0x4d')]:_0xf5602[_0x8c9f('0x4f')][_0x8c9f('0x7c')],_0xf5602[_0x8c9f('0x5e')]);_0x570fde+=_0x8c9f('0x83');}return new BPromise(function(_0x4dbd50,_0x2c14c2){pdf[_0x8c9f('0x5d')](_0x570fde,_0x16a208)[_0x8c9f('0x84')](path['join'](_0x52da1e,'interaction-'+_0x123058+_0x8c9f('0x85')),function(_0x9b492,_0x321ef4){if(_0x9b492)return _0x2c14c2(_0x9b492);_0x4dbd50(_0x321ef4);});});}})[_0x8c9f('0x21')](function(){if(_0xbc2985){return new BPromise(function(_0x38fe70,_0x4a6ba7){zipdir(_0x52da1e,{'saveTo':_0xe3b106},function(_0x116f38,_0x3087be){if(_0x116f38)return _0x4a6ba7(_0x116f38);return _0x38fe70(_0x3087be);});});}})['then'](function(){if(_0xbc2985){return new BPromise(function(_0x1600fa,_0x5e90f7){rimraf(_0x52da1e,function(_0x4edd3d){if(_0x4edd3d)_0x5e90f7(_0x4edd3d);return _0x1600fa();});});}})[_0x8c9f('0x21')](function(){if(_0xbc2985){return _0x1e7851[_0x8c9f('0x72')](_0xe3b106,_0x2d14d3,function(_0x4153b8){if(_0x4153b8){console[_0x8c9f('0x86')]('err',_0x4153b8);}else{fs[_0x8c9f('0x87')](_0xe3b106);}});}else{return _0x1e7851[_0x8c9f('0x23')](0xc8);}})[_0x8c9f('0x59')](handleError(_0x1e7851,null));};
\ No newline at end of file
index 7e85562..4e45367 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4033=['setMaxListeners','remove','emit','hasOwnProperty','hook','events'];(function(_0x4e25fe,_0x24b0c2){var _0x17fc4d=function(_0x57a3c2){while(--_0x57a3c2){_0x4e25fe['push'](_0x4e25fe['shift']());}};_0x17fc4d(++_0x24b0c2);}(_0x4033,0x1c1));var _0x3403=function(_0x4d1d2c,_0x44f4d8){_0x4d1d2c=_0x4d1d2c-0x0;var _0x2c4cb9=_0x4033[_0x4d1d2c];return _0x2c4cb9;};'use strict';var EventEmitter=require(_0x3403('0x0'));var SmsInteraction=require('../../mysqldb')['db']['SmsInteraction'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x3403('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3403('0x2')};function emitEvent(_0x8dc699){return function(_0x401846,_0x22642e,_0x1abf27){SmsInteractionEvents[_0x3403('0x3')](_0x8dc699+':'+_0x401846['id'],_0x401846);SmsInteractionEvents[_0x3403('0x3')](_0x8dc699,_0x401846);_0x1abf27(null);};}for(var e in events){if(events[_0x3403('0x4')](e)){var event=events[e];SmsInteraction[_0x3403('0x5')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents;
\ No newline at end of file
+var _0x172f=['events','../../mysqldb','SmsInteraction','save','remove','emit','hook','exports'];(function(_0x2af7e1,_0x21c22d){var _0x208016=function(_0x71374f){while(--_0x71374f){_0x2af7e1['push'](_0x2af7e1['shift']());}};_0x208016(++_0x21c22d);}(_0x172f,0x138));var _0xf172=function(_0x19f5fc,_0x4c658a){_0x19f5fc=_0x19f5fc-0x0;var _0x315fa3=_0x172f[_0x19f5fc];return _0x315fa3;};'use strict';var EventEmitter=require(_0xf172('0x0'));var SmsInteraction=require(_0xf172('0x1'))['db'][_0xf172('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf172('0x3'),'afterUpdate':'update','afterDestroy':_0xf172('0x4')};function emitEvent(_0x2f80ba){return function(_0x1da90d,_0x3c7ed5,_0x4aa97a){SmsInteractionEvents[_0xf172('0x5')](_0x2f80ba+':'+_0x1da90d['id'],_0x1da90d);SmsInteractionEvents[_0xf172('0x5')](_0x2f80ba,_0x1da90d);_0x4aa97a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0xf172('0x6')](e,emitEvent(event));}}module[_0xf172('0x7')]=SmsInteractionEvents;
\ No newline at end of file
index 35f11c4..a2075b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72d7=['api','moment','bluebird','./smsInteraction.attributes','define','SmsInteraction','lodash','util','../../config/logger'];(function(_0x2775d9,_0x45b711){var _0xedd733=function(_0x2353b3){while(--_0x2353b3){_0x2775d9['push'](_0x2775d9['shift']());}};_0xedd733(++_0x45b711);}(_0x72d7,0x19b));var _0x772d=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x72d7[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x772d('0x0'));var util=require(_0x772d('0x1'));var logger=require(_0x772d('0x2'))(_0x772d('0x3'));var moment=require(_0x772d('0x4'));var BPromise=require(_0x772d('0x5'));var rp=require('request-promise');var attributes=require(_0x772d('0x6'));module['exports']=function(_0x5aba41,_0x3f5d31){return _0x5aba41[_0x772d('0x7')](_0x772d('0x8'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3996=['exports','define','SmsInteraction','sms_interactions','util','../../config/logger','api','moment','bluebird','./smsInteraction.attributes'];(function(_0x4cf8d4,_0x5aee73){var _0x2c1beb=function(_0x39b0a4){while(--_0x39b0a4){_0x4cf8d4['push'](_0x4cf8d4['shift']());}};_0x2c1beb(++_0x5aee73);}(_0x3996,0x1da));var _0x6399=function(_0x1d8c89,_0x19b721){_0x1d8c89=_0x1d8c89-0x0;var _0x1ddf8e=_0x3996[_0x1d8c89];return _0x1ddf8e;};'use strict';var _=require('lodash');var util=require(_0x6399('0x0'));var logger=require(_0x6399('0x1'))(_0x6399('0x2'));var moment=require(_0x6399('0x3'));var BPromise=require(_0x6399('0x4'));var rp=require('request-promise');var attributes=require(_0x6399('0x5'));module[_0x6399('0x6')]=function(_0x23355a,_0xc47c07){return _0x23355a[_0x6399('0x7')](_0x6399('0x8'),attributes,{'tableName':_0x6399('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 901befc..2136d1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd001=['code','message','result','catch','UpdateSmsInteraction','body','options','raw','where','attributes','SmsInteraction','find','addTags','omit','ids','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','socket.io-emitter','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1e633e,_0x6f47e1){var _0x4c6d74=function(_0x3a6a2d){while(--_0x3a6a2d){_0x1e633e['push'](_0x1e633e['shift']());}};_0x4c6d74(++_0x6f47e1);}(_0xd001,0x19c));var _0x1d00=function(_0xb3daba,_0x12be72){_0xb3daba=_0xb3daba-0x0;var _0x4122d6=_0xd001[_0xb3daba];return _0x4122d6;};'use strict';var _=require('lodash');var util=require(_0x1d00('0x0'));var moment=require(_0x1d00('0x1'));var BPromise=require(_0x1d00('0x2'));var rs=require(_0x1d00('0x3'));var fs=require('fs');var db=require(_0x1d00('0x4'))['db'];var utils=require(_0x1d00('0x5'));var logger=require('../../config/logger')(_0x1d00('0x6'));var config=require(_0x1d00('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1d00('0x8')]({'port':0x232a});var socket=require(_0x1d00('0x9'))({'host':'localhost','port':0x18eb});require(_0x1d00('0xa'))['register'](socket);function respondWithRpcPromise(_0x4a3c6c,_0x31ac8c,_0x1493b1){return new BPromise(function(_0x40ecf2,_0x3b303a){return client[_0x1d00('0xb')](_0x4a3c6c,_0x1493b1)[_0x1d00('0xc')](function(_0x3e357d){logger[_0x1d00('0xd')](_0x1d00('0xe'),_0x31ac8c,_0x1d00('0xf'));logger[_0x1d00('0x10')](_0x1d00('0x11'),_0x31ac8c,_0x1d00('0xf'),JSON[_0x1d00('0x12')](_0x3e357d));if(_0x3e357d[_0x1d00('0x13')]){if(_0x3e357d[_0x1d00('0x13')][_0x1d00('0x14')]===0x1f4){logger[_0x1d00('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x31ac8c,_0x3e357d[_0x1d00('0x13')][_0x1d00('0x15')]);return _0x3b303a(_0x3e357d[_0x1d00('0x13')][_0x1d00('0x15')]);}logger['error'](_0x1d00('0xe'),_0x31ac8c,_0x3e357d['error']['message']);return _0x40ecf2(_0x3e357d['error'][_0x1d00('0x15')]);}else{logger['info'](_0x1d00('0xe'),_0x31ac8c,_0x1d00('0xf'));_0x40ecf2(_0x3e357d[_0x1d00('0x16')][_0x1d00('0x15')]);}})[_0x1d00('0x17')](function(_0x1503fd){logger[_0x1d00('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x31ac8c,_0x1503fd);_0x3b303a(_0x1503fd);});});}exports[_0x1d00('0x18')]=function(_0x4c4f62){var _0x523c55=this;return new Promise(function(_0x4e67f2,_0x25d05c){return db['SmsInteraction']['update'](_0x4c4f62[_0x1d00('0x19')],{'raw':_0x4c4f62[_0x1d00('0x1a')]?_0x4c4f62[_0x1d00('0x1a')][_0x1d00('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c4f62[_0x1d00('0x1a')]?_0x4c4f62[_0x1d00('0x1a')][_0x1d00('0x1c')]||null:null,'attributes':_0x4c4f62[_0x1d00('0x1a')]?_0x4c4f62[_0x1d00('0x1a')][_0x1d00('0x1d')]||null:null,'limit':_0x4c4f62[_0x1d00('0x1a')]?_0x4c4f62[_0x1d00('0x1a')]['limit']||null:null})[_0x1d00('0xc')](function(_0x176ec5){logger[_0x1d00('0xd')](_0x1d00('0x18'),_0x4c4f62);logger['debug'](_0x1d00('0x18'),_0x4c4f62,JSON['stringify'](_0x176ec5));_0x4e67f2(_0x176ec5);})[_0x1d00('0x17')](function(_0x233055){logger[_0x1d00('0x13')](_0x1d00('0x18'),_0x233055['message'],_0x4c4f62);_0x25d05c(_0x523c55[_0x1d00('0x13')](0x1f4,_0x233055[_0x1d00('0x15')]));});});};exports['AddTagsToSmsInteraction']=function(_0xfa42e){return new Promise(function(_0xff4087,_0x2615bf){return db[_0x1d00('0x1e')][_0x1d00('0x1f')]({'where':_0xfa42e['options']?_0xfa42e[_0x1d00('0x1a')]['where']||null:null})[_0x1d00('0xc')](function(_0x4db48d){if(_0x4db48d){return _0x4db48d[_0x1d00('0x20')](_0xfa42e['body']['ids'],_[_0x1d00('0x21')](_0xfa42e[_0x1d00('0x19')],[_0x1d00('0x22'),'id'])||{});}})['spread'](function(_0xbb9b13){logger[_0x1d00('0xd')](_0x1d00('0x23'),_0xfa42e);logger[_0x1d00('0x10')](_0x1d00('0x23'),_0xfa42e,JSON[_0x1d00('0x12')](_0xbb9b13));_0xff4087(_0xbb9b13);})['catch'](function(_0xe67b6){logger[_0x1d00('0x13')](_0x1d00('0x23'),_0xe67b6['message'],_0xfa42e);_0x2615bf(_this[_0x1d00('0x13')](0x1f4,_0xe67b6['message']));});});};
\ No newline at end of file
+var _0x7790=['spread','AddTags','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','localhost','./smsInteraction.socket','register','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','limit','then','find','addTags','ids'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7790,0x14c));var _0x0779=function(_0x3ebe67,_0x157ade){_0x3ebe67=_0x3ebe67-0x0;var _0xc5d753=_0x7790[_0x3ebe67];return _0xc5d753;};'use strict';var _=require('lodash');var util=require(_0x0779('0x0'));var moment=require('moment');var BPromise=require(_0x0779('0x1'));var rs=require(_0x0779('0x2'));var fs=require('fs');var db=require(_0x0779('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0779('0x4'));var config=require(_0x0779('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});var socket=require('socket.io-emitter')({'host':_0x0779('0x6'),'port':0x18eb});require(_0x0779('0x7'))[_0x0779('0x8')](socket);function respondWithRpcPromise(_0x59a839,_0x323405,_0x5be8ee){return new BPromise(function(_0x479119,_0x1094b1){return client['request'](_0x59a839,_0x5be8ee)['then'](function(_0xd1323a){logger[_0x0779('0x9')](_0x0779('0xa'),_0x323405,_0x0779('0xb'));logger[_0x0779('0xc')](_0x0779('0xd'),_0x323405,_0x0779('0xb'),JSON[_0x0779('0xe')](_0xd1323a));if(_0xd1323a[_0x0779('0xf')]){if(_0xd1323a[_0x0779('0xf')][_0x0779('0x10')]===0x1f4){logger[_0x0779('0xf')](_0x0779('0xa'),_0x323405,_0xd1323a['error']['message']);return _0x1094b1(_0xd1323a['error'][_0x0779('0x11')]);}logger[_0x0779('0xf')](_0x0779('0xa'),_0x323405,_0xd1323a[_0x0779('0xf')][_0x0779('0x11')]);return _0x479119(_0xd1323a[_0x0779('0xf')]['message']);}else{logger[_0x0779('0x9')](_0x0779('0xa'),_0x323405,'request\x20sent');_0x479119(_0xd1323a['result'][_0x0779('0x11')]);}})[_0x0779('0x12')](function(_0x231a5d){logger['error'](_0x0779('0xa'),_0x323405,_0x231a5d);_0x1094b1(_0x231a5d);});});}exports[_0x0779('0x13')]=function(_0x57a551){var _0x27b8bc=this;return new Promise(function(_0x33b882,_0x5967c6){return db[_0x0779('0x14')]['update'](_0x57a551[_0x0779('0x15')],{'raw':_0x57a551['options']?_0x57a551[_0x0779('0x16')][_0x0779('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57a551[_0x0779('0x16')]?_0x57a551[_0x0779('0x16')][_0x0779('0x18')]||null:null,'attributes':_0x57a551[_0x0779('0x16')]?_0x57a551['options'][_0x0779('0x19')]||null:null,'limit':_0x57a551[_0x0779('0x16')]?_0x57a551[_0x0779('0x16')][_0x0779('0x1a')]||null:null})[_0x0779('0x1b')](function(_0x4cd319){logger[_0x0779('0x9')](_0x0779('0x13'),_0x57a551);logger[_0x0779('0xc')]('UpdateSmsInteraction',_0x57a551,JSON['stringify'](_0x4cd319));_0x33b882(_0x4cd319);})[_0x0779('0x12')](function(_0x14ca3c){logger[_0x0779('0xf')]('UpdateSmsInteraction',_0x14ca3c[_0x0779('0x11')],_0x57a551);_0x5967c6(_0x27b8bc[_0x0779('0xf')](0x1f4,_0x14ca3c[_0x0779('0x11')]));});});};exports['AddTagsToSmsInteraction']=function(_0xe848aa){return new Promise(function(_0x1597a6,_0x4701d3){return db[_0x0779('0x14')][_0x0779('0x1c')]({'where':_0xe848aa['options']?_0xe848aa[_0x0779('0x16')]['where']||null:null})['then'](function(_0x5891db){if(_0x5891db){return _0x5891db[_0x0779('0x1d')](_0xe848aa['body'][_0x0779('0x1e')],_['omit'](_0xe848aa[_0x0779('0x15')],[_0x0779('0x1e'),'id'])||{});}})[_0x0779('0x1f')](function(_0x56148c){logger[_0x0779('0x9')](_0x0779('0x20'),_0xe848aa);logger['debug'](_0x0779('0x20'),_0xe848aa,JSON[_0x0779('0xe')](_0x56148c));_0x1597a6(_0x56148c);})[_0x0779('0x12')](function(_0x304074){logger[_0x0779('0xf')](_0x0779('0x20'),_0x304074['message'],_0xe848aa);_0x4701d3(_this[_0x0779('0xf')](0x1f4,_0x304074[_0x0779('0x11')]));});});};
\ No newline at end of file
index f484c0e..bbbe2e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59c3=['length','./smsInteraction.events','remove','update','emit','removeListener','register'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x59c3,0xbe));var _0x359c=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x59c3[_0xbca1b1];return _0x4e1686;};'use strict';var SmsInteractionEvents=require(_0x359c('0x0'));var events=['save',_0x359c('0x1'),_0x359c('0x2')];function createListener(_0x385535,_0xedac67){return function(_0x54bfbe){_0xedac67[_0x359c('0x3')](_0x385535,_0x54bfbe);};}function removeListener(_0xf6292e,_0x4fd9de){return function(){SmsInteractionEvents[_0x359c('0x4')](_0xf6292e,_0x4fd9de);};}exports[_0x359c('0x5')]=function(_0x161d8e){for(var _0xbeb562=0x0,_0x344108=events[_0x359c('0x6')];_0xbeb562<_0x344108;_0xbeb562++){var _0x5b4192=events[_0xbeb562];var _0x596475=createListener('smsInteraction:'+_0x5b4192,_0x161d8e);SmsInteractionEvents['on'](_0x5b4192,_0x596475);}};
\ No newline at end of file
+var _0x4e3d=['removeListener','register','length','./smsInteraction.events','save'];(function(_0x3eee78,_0x5acc63){var _0x53a5e5=function(_0x472fb6){while(--_0x472fb6){_0x3eee78['push'](_0x3eee78['shift']());}};_0x53a5e5(++_0x5acc63);}(_0x4e3d,0x85));var _0xd4e3=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4e3d[_0x2c91e9];return _0x13f0ff;};'use strict';var SmsInteractionEvents=require(_0xd4e3('0x0'));var events=[_0xd4e3('0x1'),'remove','update'];function createListener(_0x3519e4,_0x2ecd56){return function(_0x5d0f5b){_0x2ecd56['emit'](_0x3519e4,_0x5d0f5b);};}function removeListener(_0x54353d,_0xdd8a61){return function(){SmsInteractionEvents[_0xd4e3('0x2')](_0x54353d,_0xdd8a61);};}exports[_0xd4e3('0x3')]=function(_0x1b2a8f){for(var _0x2b7fb4=0x0,_0x26c2dc=events[_0xd4e3('0x4')];_0x2b7fb4<_0x26c2dc;_0x2b7fb4++){var _0xb8a15e=events[_0x2b7fb4];var _0x5b776b=createListener('smsInteraction:'+_0xb8a15e,_0x1b2a8f);SmsInteractionEvents['on'](_0xb8a15e,_0x5b776b);}};
\ No newline at end of file
index 49a9c98..82ff00c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x784c=['update','/:id/accept','accept','destroy','exports','multer','util','path','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','/describe','describe','show','post','tracked','sms','smsmessage:create','create','put','/:id'];(function(_0x4354d8,_0x5b0cf0){var _0x320fdd=function(_0x4c4252){while(--_0x4c4252){_0x4354d8['push'](_0x4354d8['shift']());}};_0x320fdd(++_0x5b0cf0);}(_0x784c,0x65));var _0xc784=function(_0x11f98e,_0x209fd7){_0x11f98e=_0x11f98e-0x0;var _0x28e130=_0x784c[_0x11f98e];return _0x28e130;};'use strict';var multer=require(_0xc784('0x0'));var util=require(_0xc784('0x1'));var path=require(_0xc784('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xc784('0x3'));var config=require(_0xc784('0x4'));var controller=require(_0xc784('0x5'));router['get']('/',auth[_0xc784('0x6')](),controller[_0xc784('0x7')]);router[_0xc784('0x8')](_0xc784('0x9'),auth['isAuthenticated'](),controller[_0xc784('0xa')]);router[_0xc784('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xc784('0xb')]);router[_0xc784('0xc')]('/',auth[_0xc784('0x6')](),interaction[_0xc784('0xd')](_0xc784('0xe'),_0xc784('0xf')),controller[_0xc784('0x10')]);router[_0xc784('0xc')]('/:id/status',controller['status']);router[_0xc784('0x11')](_0xc784('0x12'),auth[_0xc784('0x6')](),controller[_0xc784('0x13')]);router[_0xc784('0x11')](_0xc784('0x14'),auth[_0xc784('0x6')](),controller[_0xc784('0x15')]);router['put']('/:id/reject',auth[_0xc784('0x6')](),controller['reject']);router['delete'](_0xc784('0x12'),auth[_0xc784('0x6')](),controller[_0xc784('0x16')]);module[_0xc784('0x17')]=router;
\ No newline at end of file
+var _0x826b=['/:id/status','status','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','express','../../components/auth/service','./smsMessage.controller','get','isAuthenticated','/describe','/:id','show','post','tracked','sms','create'];(function(_0x2ceba7,_0x451ce4){var _0x5348eb=function(_0x3596fc){while(--_0x3596fc){_0x2ceba7['push'](_0x2ceba7['shift']());}};_0x5348eb(++_0x451ce4);}(_0x826b,0x11e));var _0xb826=function(_0x4f9e88,_0x331d7b){_0x4f9e88=_0x4f9e88-0x0;var _0x54102e=_0x826b[_0x4f9e88];return _0x54102e;};'use strict';var multer=require('multer');var util=require(_0xb826('0x0'));var path=require(_0xb826('0x1'));var express=require(_0xb826('0x2'));var router=express['Router']();var auth=require(_0xb826('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb826('0x4'));router[_0xb826('0x5')]('/',auth[_0xb826('0x6')](),controller['index']);router[_0xb826('0x5')](_0xb826('0x7'),auth[_0xb826('0x6')](),controller['describe']);router['get'](_0xb826('0x8'),auth[_0xb826('0x6')](),controller[_0xb826('0x9')]);router[_0xb826('0xa')]('/',auth['isAuthenticated'](),interaction[_0xb826('0xb')](_0xb826('0xc'),'smsmessage:create'),controller[_0xb826('0xd')]);router[_0xb826('0xa')](_0xb826('0xe'),controller[_0xb826('0xf')]);router['put'](_0xb826('0x8'),auth[_0xb826('0x6')](),controller[_0xb826('0x10')]);router[_0xb826('0x11')](_0xb826('0x12'),auth[_0xb826('0x6')](),controller[_0xb826('0x13')]);router['put'](_0xb826('0x14'),auth[_0xb826('0x6')](),controller[_0xb826('0x15')]);router[_0xb826('0x16')](_0xb826('0x8'),auth[_0xb826('0x6')](),controller[_0xb826('0x17')]);module[_0xb826('0x18')]=router;
\ No newline at end of file
index 793da7e..1ce4a94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96e0=['STRING','sequelize','TEXT','ENUM','out'];(function(_0x1278b6,_0x24252e){var _0x2cff42=function(_0x46b845){while(--_0x46b845){_0x1278b6['push'](_0x1278b6['shift']());}};_0x2cff42(++_0x24252e);}(_0x96e0,0x7e));var _0x096e=function(_0x4a51dc,_0x11e40c){_0x4a51dc=_0x4a51dc-0x0;var _0x5867c9=_0x96e0[_0x4a51dc];return _0x5867c9;};'use strict';var Sequelize=require(_0x096e('0x0'));module['exports']={'body':{'type':Sequelize[_0x096e('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x096e('0x2')]('in',_0x096e('0x3')),'defaultValue':_0x096e('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x096e('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x9829=['BOOLEAN','out','STRING','DATE','sequelize','exports','TEXT','medium'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x9829,0xc4));var _0x9982=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0x9829[_0x2ca2d0];return _0x521c23;};'use strict';var Sequelize=require(_0x9982('0x0'));module[_0x9982('0x1')]={'body':{'type':Sequelize[_0x9982('0x2')](_0x9982('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9982('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x9982('0x5')),'defaultValue':_0x9982('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9982('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x9982('0x7')]},'secret':{'type':Sequelize[_0x9982('0x4')],'defaultValue':![]}};
\ No newline at end of file
index b24044e..9fa363f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x277c=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','localhost','register','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','name','send','SmsMessage','rawAttributes','model','keys','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day','merge','filter','map','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','update','describe','sms-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','SIP/%s','channel','event','accept','EventManager','agent','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SmsAccountId','debug','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageUUID','messageId','indexOf','sent','Status','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','crypto','to-csv','querystring'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x277c,0x6e));var _0xc277=function(_0x17035d,_0x829dc6){_0x17035d=_0x17035d-0x0;var _0xa2081c=_0x277c[_0x17035d];return _0xa2081c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc277('0x0'));var rimraf=require(_0xc277('0x1'));var zipdir=require(_0xc277('0x2'));var jsonpatch=require(_0xc277('0x3'));var rp=require(_0xc277('0x4'));var moment=require(_0xc277('0x5'));var BPromise=require(_0xc277('0x6'));var Mustache=require(_0xc277('0x7'));var util=require(_0xc277('0x8'));var path=require('path');var sox=require(_0xc277('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xc277('0xa'));var squel=require('squel');var crypto=require(_0xc277('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc277('0xc'));var querystring=require(_0xc277('0xd'));var Papa=require('papaparse');var qs=require(_0xc277('0xe'));var logger=require(_0xc277('0xf'))(_0xc277('0x10'));var utils=require(_0xc277('0x11'));var config=require(_0xc277('0x12'));var db=require(_0xc277('0x13'))['db'];var socket=require(_0xc277('0x14'))({'host':_0xc277('0x15'),'port':0x18eb});require('./smsMessage.socket')[_0xc277('0x16')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc277('0x17')][_0xc277('0x18')]({'port':0x232c});var client9002=jayson[_0xc277('0x17')][_0xc277('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x21f88e,_0x2b0da3,_0x3a03b5,_0x2e6581){return new BPromise(function(_0x2ed575,_0x434702){var _0x1f6f31=_0x2e6581||client;return _0x1f6f31[_0xc277('0x19')](_0x21f88e,_0x3a03b5)['then'](function(_0xef5f05){logger[_0xc277('0x1a')](_0xc277('0x1b'),_0x2b0da3,_0xc277('0x1c'));logger['debug'](_0xc277('0x1d'),_0x2b0da3,_0xc277('0x1c'),JSON[_0xc277('0x1e')](_0xef5f05));if(_0xef5f05['error']){if(_0xef5f05[_0xc277('0x1f')][_0xc277('0x20')]===0x1f4){logger[_0xc277('0x1f')](_0xc277('0x1b'),_0x2b0da3,_0xef5f05[_0xc277('0x1f')][_0xc277('0x21')]);return _0x434702(_0xef5f05['error']['message']);}logger[_0xc277('0x1f')](_0xc277('0x1b'),_0x2b0da3,_0xef5f05[_0xc277('0x1f')]['message']);return _0x2ed575(_0xef5f05[_0xc277('0x1f')][_0xc277('0x21')]);}else{logger['info'](_0xc277('0x1b'),_0x2b0da3,'request\x20sent');_0x2ed575(_0xef5f05['result'][_0xc277('0x21')]);}})['catch'](function(_0x2b7743){logger['error']('SmsMessage,\x20%s,\x20%s',_0x2b0da3,_0x2b7743);_0x434702(_0x2b7743);});});}function respondWithStatusCode(_0x3185ee,_0x2406a1){_0x2406a1=_0x2406a1||0xcc;return function(_0x220e92){if(_0x220e92){return _0x3185ee[_0xc277('0x22')](_0x2406a1);}return _0x3185ee[_0xc277('0x23')](_0x2406a1)[_0xc277('0x24')]();};}function respondWithResult(_0x3cc21a,_0x3f7c97){_0x3f7c97=_0x3f7c97||0xc8;return function(_0x497341){if(_0x497341){return _0x3cc21a[_0xc277('0x23')](_0x3f7c97)[_0xc277('0x25')](_0x497341);}};}function respondWithFilteredResult(_0x54476c,_0x5706a2){return function(_0x366824){if(_0x366824){var _0x4b1071=_0x366824[_0xc277('0x26')],_0x1666eb=_0x5706a2[_0xc277('0x27')],_0x31ab5d=_0x5706a2['offset']+_0x5706a2[_0xc277('0x28')],_0x10fe2c;if(_0x31ab5d>=_0x4b1071){_0x31ab5d=_0x4b1071;_0x10fe2c=0xc8;}else{_0x10fe2c=0xce;}_0x54476c[_0xc277('0x23')](_0x10fe2c);return _0x54476c[_0xc277('0x29')](_0xc277('0x2a'),_0x1666eb+'-'+_0x31ab5d+'/'+_0x4b1071)[_0xc277('0x25')](_0x366824);}return null;};}function patchUpdates(_0x2da79f){return function(_0x4f689f){try{jsonpatch[_0xc277('0x2b')](_0x4f689f,_0x2da79f,!![]);}catch(_0x36b5a2){return BPromise[_0xc277('0x2c')](_0x36b5a2);}return _0x4f689f[_0xc277('0x2d')]();};}function saveUpdates(_0x586d16,_0x5efe1d){return function(_0x8b8b4a){if(_0x8b8b4a){return _0x8b8b4a['update'](_0x586d16)[_0xc277('0x2e')](function(_0x154af7){return _0x154af7;});}return null;};}function removeEntity(_0x4fdb8a,_0x5649bb){return function(_0x3125b8){if(_0x3125b8){return _0x3125b8[_0xc277('0x2f')]()[_0xc277('0x2e')](function(){_0x4fdb8a['status'](0xcc)[_0xc277('0x24')]();});}};}function handleEntityNotFound(_0x417283,_0x81dc43){return function(_0x2043a8){if(!_0x2043a8){_0x417283['sendStatus'](0x194);}return _0x2043a8;};}function handleError(_0x187269,_0x44de29){_0x44de29=_0x44de29||0x1f4;return function(_0x18ed1b){logger['error'](_0x18ed1b['stack']);if(_0x18ed1b[_0xc277('0x30')]){delete _0x18ed1b['name'];}_0x187269[_0xc277('0x23')](_0x44de29)[_0xc277('0x31')](_0x18ed1b);};}exports['index']=function(_0xdf7151,_0x1d9aa7){var _0x1fc287={},_0x4e5852={},_0x5535a4={'count':0x0,'rows':[]};var _0x370026=db[_0xc277('0x32')][_0xc277('0x33')];_0x4e5852[_0xc277('0x34')]=_[_0xc277('0x35')](_0x370026);var _0x180409={'dateStart':_0xdf7151['query'][_0xc277('0x36')],'dateEnd':_0xdf7151[_0xc277('0x37')][_0xc277('0x38')]};delete _0xdf7151[_0xc277('0x37')][_0xc277('0x36')];delete _0xdf7151['query'][_0xc277('0x38')];_0x4e5852[_0xc277('0x37')]=_[_0xc277('0x35')](_0xdf7151[_0xc277('0x37')]);_0x4e5852[_0xc277('0x39')]=_[_0xc277('0x3a')](_0x4e5852[_0xc277('0x34')],_0x4e5852[_0xc277('0x37')]);_0x1fc287[_0xc277('0x3b')]=_[_0xc277('0x3a')](_0x4e5852[_0xc277('0x34')],qs[_0xc277('0x3c')](_0xdf7151['query'][_0xc277('0x3c')]));_0x1fc287[_0xc277('0x3b')]=_0x1fc287[_0xc277('0x3b')][_0xc277('0x3d')]?_0x1fc287['attributes']:_0x4e5852['model'];if(!_0xdf7151[_0xc277('0x37')][_0xc277('0x3e')](_0xc277('0x3f'))){_0x1fc287[_0xc277('0x28')]=qs['limit'](_0xdf7151[_0xc277('0x37')][_0xc277('0x28')]);_0x1fc287[_0xc277('0x27')]=qs[_0xc277('0x27')](_0xdf7151['query'][_0xc277('0x27')]);}_0x1fc287[_0xc277('0x40')]=qs[_0xc277('0x41')](_0xdf7151[_0xc277('0x37')][_0xc277('0x41')]);_0x1fc287[_0xc277('0x42')]=qs[_0xc277('0x39')](_[_0xc277('0x43')](_0xdf7151['query'],_0x4e5852[_0xc277('0x39')]));if(_0x180409['dateStart']){if(_0x180409[_0xc277('0x38')]){_0x180409[_0xc277('0x38')]=moment(_0x180409[_0xc277('0x38')])[_0xc277('0x44')](0x1,'day');}else{_0x180409[_0xc277('0x38')]=moment(_0x180409[_0xc277('0x36')])[_0xc277('0x44')](0x1,_0xc277('0x45'));}_[_0xc277('0x46')](_0x1fc287['where'],{'createdAt':{'$gte':_0x180409[_0xc277('0x36')],'$lte':_0x180409['dateEnd']}});}if(_0xdf7151[_0xc277('0x37')][_0xc277('0x47')]){_0x1fc287['where']=_[_0xc277('0x46')](_0x1fc287['where'],{'$or':_[_0xc277('0x48')](_0x1fc287[_0xc277('0x3b')],function(_0x112a52){var _0x2e0fbf={};_0x2e0fbf[_0x112a52]={'$like':'%'+_0xdf7151['query'][_0xc277('0x47')]+'%'};return _0x2e0fbf;})});}_0x1fc287=_['merge']({},_0x1fc287,_0xdf7151[_0xc277('0x49')]);var _0xd48d20={'where':_0x1fc287[_0xc277('0x42')]};return db[_0xc277('0x32')][_0xc277('0x26')](_0xd48d20)[_0xc277('0x2e')](function(_0x384035){_0x5535a4[_0xc277('0x26')]=_0x384035;if(_0xdf7151[_0xc277('0x37')][_0xc277('0x4a')]){_0x1fc287[_0xc277('0x4b')]=[{'all':!![]}];}return db[_0xc277('0x32')][_0xc277('0x4c')](_0x1fc287);})[_0xc277('0x2e')](function(_0x43eaf6){_0x5535a4[_0xc277('0x4d')]=_0x43eaf6;return _0x5535a4;})[_0xc277('0x2e')](respondWithFilteredResult(_0x1d9aa7,_0x1fc287))['catch'](handleError(_0x1d9aa7,null));};exports[_0xc277('0x4e')]=function(_0x30bfd9,_0x43ffe9){var _0x20f463={'raw':!![],'where':{'id':_0x30bfd9[_0xc277('0x4f')]['id']}},_0x5af71e={};_0x5af71e[_0xc277('0x34')]=_['keys'](db[_0xc277('0x32')][_0xc277('0x33')]);_0x5af71e[_0xc277('0x37')]=_[_0xc277('0x35')](_0x30bfd9[_0xc277('0x37')]);_0x5af71e[_0xc277('0x39')]=_[_0xc277('0x3a')](_0x5af71e['model'],_0x5af71e[_0xc277('0x37')]);_0x20f463[_0xc277('0x3b')]=_[_0xc277('0x3a')](_0x5af71e['model'],qs[_0xc277('0x3c')](_0x30bfd9['query'][_0xc277('0x3c')]));_0x20f463['attributes']=_0x20f463[_0xc277('0x3b')][_0xc277('0x3d')]?_0x20f463['attributes']:_0x5af71e['model'];if(_0x30bfd9[_0xc277('0x37')][_0xc277('0x4a')]){_0x20f463['include']=[{'all':!![]}];}_0x20f463=_[_0xc277('0x46')]({},_0x20f463,_0x30bfd9[_0xc277('0x49')]);return db[_0xc277('0x32')][_0xc277('0x50')](_0x20f463)[_0xc277('0x2e')](handleEntityNotFound(_0x43ffe9,null))[_0xc277('0x2e')](respondWithResult(_0x43ffe9,null))['catch'](handleError(_0x43ffe9,null));};exports[_0xc277('0x51')]=function(_0x3450df,_0x2928da){return db[_0xc277('0x32')]['create'](_0x3450df[_0xc277('0x52')],{})['then'](respondWithResult(_0x2928da,0xc9))[_0xc277('0x53')](handleError(_0x2928da,null));};exports[_0xc277('0x54')]=function(_0x41b911,_0x4fa616){if(_0x41b911['body']['id']){delete _0x41b911[_0xc277('0x52')]['id'];}return db[_0xc277('0x32')]['find']({'where':{'id':_0x41b911[_0xc277('0x4f')]['id']}})[_0xc277('0x2e')](handleEntityNotFound(_0x4fa616,null))[_0xc277('0x2e')](saveUpdates(_0x41b911['body'],null))[_0xc277('0x2e')](respondWithResult(_0x4fa616,null))[_0xc277('0x53')](handleError(_0x4fa616,null));};exports[_0xc277('0x2f')]=function(_0x357779,_0x1acf47){return db[_0xc277('0x32')][_0xc277('0x50')]({'where':{'id':_0x357779['params']['id']}})[_0xc277('0x2e')](handleEntityNotFound(_0x1acf47,null))[_0xc277('0x2e')](removeEntity(_0x1acf47,null))[_0xc277('0x53')](handleError(_0x1acf47,null));};exports[_0xc277('0x55')]=function(_0x1cf7c9,_0x335ba8){return db[_0xc277('0x32')][_0xc277('0x55')]()[_0xc277('0x2e')](respondWithResult(_0x335ba8,null))[_0xc277('0x53')](handleError(_0x335ba8,null));};var interaction_log=require(_0xc277('0xf'))(_0xc277('0x56'));exports['accept']=function(_0x11d169,_0x52f8ca,_0xbb5f59){var _0x34b4cc={'channel':'sms'};if(_0x11d169[_0xc277('0x52')]['id']){delete _0x11d169[_0xc277('0x52')]['id'];}_0x11d169[_0xc277('0x52')][_0xc277('0x57')]=!![];_0x11d169[_0xc277('0x52')][_0xc277('0x58')]=moment()[_0xc277('0x59')](_0xc277('0x5a'));_0x11d169[_0xc277('0x52')][_0xc277('0x5b')]=_0x11d169[_0xc277('0x52')][_0xc277('0x5b')]||_0x11d169[_0xc277('0x5c')]['id'];return db[_0xc277('0x32')][_0xc277('0x50')]({'where':{'id':_0x11d169[_0xc277('0x4f')]['id'],'UserId':null},'include':[{'model':db[_0xc277('0x5d')],'as':_0xc277('0x5e')}]})[_0xc277('0x2e')](handleEntityNotFound(_0x52f8ca,null))['then'](saveUpdates(_0x11d169[_0xc277('0x52')],null))[_0xc277('0x2e')](function(_0x556701){if(_0x556701){_0x34b4cc['message']=_0x556701[_0xc277('0x5f')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x556701[_0xc277('0x60')]}});}return null;})[_0xc277('0x2e')](handleEntityNotFound(_0x52f8ca,null))[_0xc277('0x2e')](function(_0x25a8f5){if(_0x25a8f5){return _0x25a8f5[_0xc277('0x54')]({'UserId':_0x11d169['body']['UserId'],'read1stAt':_[_0xc277('0x61')](_0x25a8f5[_0xc277('0x62')])?moment()[_0xc277('0x59')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc277('0x2e')](function(_0xd55af3){if(_0xd55af3){_0x34b4cc[_0xc277('0x63')]=_0xd55af3[_0xc277('0x5f')]({'plain':!![]});interaction_log[_0xc277('0x1a')](_0xc277('0x64'),_0x11d169['user']['id'],_0x11d169[_0xc277('0x5c')]['name'],_0x11d169[_0xc277('0x5c')]['role'],_0x34b4cc[_0xc277('0x63')]['id'],_0x11d169[_0xc277('0x52')]?JSON[_0xc277('0x1e')](_0x11d169[_0xc277('0x52')]):'null');return respondWithRpcPromise(_0xc277('0x65'),'acceptMessage',_0x34b4cc);}return null;})[_0xc277('0x2e')](function(_0x4448a0){if(_0x4448a0){if(_0x11d169['body']['manual']){_0x34b4cc[_0xc277('0x21')]['interface']=util['format'](_0xc277('0x66'),_0x11d169[_0xc277('0x5c')]['name']);_0x34b4cc['message']['channel']=_0x34b4cc[_0xc277('0x67')];_0x34b4cc[_0xc277('0x21')][_0xc277('0x68')]=_0xc277('0x69');return respondWithRpcPromise(_0xc277('0x6a'),_0xc277('0x6a'),{'event':'acceptmessage','message':_0x34b4cc['message']},client9002)[_0xc277('0x2e')](function(){return _0x34b4cc;});}return _0x34b4cc;}return null;})['then'](respondWithResult(_0x52f8ca,null))[_0xc277('0x53')](handleError(_0x52f8ca,null));};var interaction_log=require(_0xc277('0xf'))(_0xc277('0x56'));exports[_0xc277('0x2c')]=function(_0x2982cd,_0x58e4c6,_0x3210ba){var _0x4c2ee0={'agent':{},'channel':'sms'};if(_0x2982cd[_0xc277('0x52')]['id']){delete _0x2982cd['body']['id'];}_0x2982cd['body']['UserId']=_0x2982cd[_0xc277('0x52')][_0xc277('0x5b')]||_0x2982cd[_0xc277('0x5c')]['id'];_0x4c2ee0[_0xc277('0x6b')]['id']=_0x2982cd[_0xc277('0x52')][_0xc277('0x5b')];return db[_0xc277('0x32')][_0xc277('0x50')]({'where':{'id':_0x2982cd['params']['id'],'UserId':null}})[_0xc277('0x2e')](handleEntityNotFound(_0x58e4c6,null))['then'](function(_0x279608){if(_0x279608){_0x4c2ee0['message']=_0x279608['get']({'plain':!![]});return db[_0xc277('0x6c')][_0xc277('0x50')]({'where':{'id':_0x279608[_0xc277('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x58e4c6,null))['then'](function(_0x26556c){if(_0x26556c){_0x4c2ee0[_0xc277('0x63')]=_0x26556c[_0xc277('0x5f')]({'plain':!![]});interaction_log[_0xc277('0x1a')](_0xc277('0x6d'),_0x2982cd[_0xc277('0x5c')]['id'],_0x2982cd[_0xc277('0x5c')]['name'],_0x2982cd[_0xc277('0x5c')]['role'],_0x4c2ee0[_0xc277('0x63')]['id'],_0x2982cd[_0xc277('0x52')]?JSON['stringify'](_0x2982cd[_0xc277('0x52')]):_0xc277('0x6e'));return respondWithRpcPromise(_0xc277('0x6f'),_0xc277('0x70'),_0x4c2ee0);}return null;})[_0xc277('0x2e')](function(_0x2596a3){if(_0x2596a3){_0x2596a3[_0xc277('0x21')]['interface']=util['format'](_0xc277('0x66'),_0x2982cd[_0xc277('0x5c')][_0xc277('0x30')]);_0x2596a3['message'][_0xc277('0x67')]=_0x4c2ee0[_0xc277('0x67')];_0x2596a3[_0xc277('0x21')][_0xc277('0x68')]=_0xc277('0x2c');respondWithRpcPromise(_0xc277('0x6a'),_0xc277('0x6a'),{'event':'rejectmessage','message':_0x2596a3[_0xc277('0x21')]},client9002);return _0x4c2ee0;}return null;})[_0xc277('0x2e')](respondWithResult(_0x58e4c6,null))[_0xc277('0x53')](handleError(_0x58e4c6,null));};exports[_0xc277('0x23')]=function(_0x4960be,_0x4ecdf7,_0x54ac4d){if(_0x4960be[_0xc277('0x52')]['id']){delete _0x4960be[_0xc277('0x52')]['id'];}var _0x395aa3;return db[_0xc277('0x32')]['find']({'where':{'id':_0x4960be[_0xc277('0x4f')]['id']}})[_0xc277('0x2e')](handleEntityNotFound(_0x4ecdf7,null))['then'](function(_0x1a5c59){if(_0x1a5c59){_0x395aa3=_0x1a5c59;return db['SmsAccount'][_0xc277('0x50')]({'where':{'id':_0x1a5c59[_0xc277('0x71')]}});}})['then'](handleEntityNotFound(_0x4ecdf7,null))[_0xc277('0x2e')](function(_0x42ce41){if(_0x42ce41){logger[_0xc277('0x72')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc277('0x23'),_0xc277('0x73'),_0x42ce41['type'],util[_0xc277('0x74')](_0x4960be['body'],{'showHidden':![],'depth':null}));switch(_0x42ce41['type']){case _0xc277('0x75'):if(_0x4960be[_0xc277('0x52')][_0xc277('0x76')]&&_0x4960be['body'][_0xc277('0x76')]===_0x395aa3['messageId']){return _0x395aa3[_0xc277('0x54')]({'read':!![]});}break;case'plivo':if(_0x4960be['body'][_0xc277('0x77')]&&_0x4960be[_0xc277('0x52')][_0xc277('0x77')]===_0x395aa3[_0xc277('0x78')]&&_[_0xc277('0x79')]([_0xc277('0x7a'),'delivered'],_0x4960be[_0xc277('0x52')][_0xc277('0x7b')])>=0x0){return _0x395aa3[_0xc277('0x54')]({'read':!![]});}break;}return _0x395aa3;}})[_0xc277('0x2e')](respondWithResult(_0x4ecdf7,null))[_0xc277('0x53')](handleError(_0x4ecdf7,null));};
\ No newline at end of file
+var _0xad5d=['squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','./smsMessage.socket','register','client','http','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','end','count','offset','Content-Range','apply','reject','then','destroy','stack','index','SmsMessage','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','add','day','merge','filter','map','options','includeAll','rows','catch','show','params','include','find','create','body','describe','sms-interactions','accept','sms','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','SmsInteractionId','update','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SIP/%s','name','channel','event','EventManager','acceptmessage','agent','SmsInteraction','RejectMessage','rejectMessage','rejectmessage','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','type','twilio','MessageSid','plivo','MessageUUID','indexOf','sent','delivered','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x4f6610,_0x11d9ae){var _0x44e7d3=function(_0x1c9b2f){while(--_0x1c9b2f){_0x4f6610['push'](_0x4f6610['shift']());}};_0x44e7d3(++_0x11d9ae);}(_0xad5d,0x15d));var _0xdad5=function(_0x6dd824,_0x5b595e){_0x6dd824=_0x6dd824-0x0;var _0x1ea20e=_0xad5d[_0x6dd824];return _0x1ea20e;};'use strict';var pdf=require(_0xdad5('0x0'));var emlformat=require(_0xdad5('0x1'));var rimraf=require(_0xdad5('0x2'));var zipdir=require(_0xdad5('0x3'));var jsonpatch=require(_0xdad5('0x4'));var rp=require(_0xdad5('0x5'));var moment=require(_0xdad5('0x6'));var BPromise=require(_0xdad5('0x7'));var Mustache=require(_0xdad5('0x8'));var util=require(_0xdad5('0x9'));var path=require(_0xdad5('0xa'));var sox=require(_0xdad5('0xb'));var csv=require(_0xdad5('0xc'));var ejs=require(_0xdad5('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdad5('0xe'));var crypto=require('crypto');var jsforce=require(_0xdad5('0xf'));var deskjs=require(_0xdad5('0x10'));var toCsv=require(_0xdad5('0xc'));var querystring=require('querystring');var Papa=require(_0xdad5('0x11'));var qs=require(_0xdad5('0x12'));var logger=require(_0xdad5('0x13'))('api');var utils=require(_0xdad5('0x14'));var config=require(_0xdad5('0x15'));var db=require(_0xdad5('0x16'))['db'];var socket=require('socket.io-emitter')({'host':'localhost','port':0x18eb});require(_0xdad5('0x17'))[_0xdad5('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdad5('0x19')][_0xdad5('0x1a')]({'port':0x232c});var client9002=jayson[_0xdad5('0x19')][_0xdad5('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2ac66b,_0x25446c,_0x142ae6,_0x4355b9){return new BPromise(function(_0x47fe59,_0x424e28){var _0xcb395e=_0x4355b9||client;return _0xcb395e['request'](_0x2ac66b,_0x142ae6)['then'](function(_0x2bad77){logger[_0xdad5('0x1b')](_0xdad5('0x1c'),_0x25446c,_0xdad5('0x1d'));logger[_0xdad5('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x25446c,_0xdad5('0x1d'),JSON['stringify'](_0x2bad77));if(_0x2bad77[_0xdad5('0x1f')]){if(_0x2bad77[_0xdad5('0x1f')][_0xdad5('0x20')]===0x1f4){logger[_0xdad5('0x1f')](_0xdad5('0x1c'),_0x25446c,_0x2bad77[_0xdad5('0x1f')][_0xdad5('0x21')]);return _0x424e28(_0x2bad77[_0xdad5('0x1f')][_0xdad5('0x21')]);}logger['error'](_0xdad5('0x1c'),_0x25446c,_0x2bad77['error']['message']);return _0x47fe59(_0x2bad77['error'][_0xdad5('0x21')]);}else{logger[_0xdad5('0x1b')](_0xdad5('0x1c'),_0x25446c,'request\x20sent');_0x47fe59(_0x2bad77[_0xdad5('0x22')][_0xdad5('0x21')]);}})['catch'](function(_0x1e17d9){logger['error'](_0xdad5('0x1c'),_0x25446c,_0x1e17d9);_0x424e28(_0x1e17d9);});});}function respondWithStatusCode(_0x43494f,_0x85ad2b){_0x85ad2b=_0x85ad2b||0xcc;return function(_0x208229){if(_0x208229){return _0x43494f[_0xdad5('0x23')](_0x85ad2b);}return _0x43494f[_0xdad5('0x24')](_0x85ad2b)[_0xdad5('0x25')]();};}function respondWithResult(_0xb4b772,_0x39e1fb){_0x39e1fb=_0x39e1fb||0xc8;return function(_0x3ba084){if(_0x3ba084){return _0xb4b772['status'](_0x39e1fb)['json'](_0x3ba084);}};}function respondWithFilteredResult(_0x8a5945,_0x10b134){return function(_0x363165){if(_0x363165){var _0x5e3c58=_0x363165[_0xdad5('0x26')],_0x110649=_0x10b134[_0xdad5('0x27')],_0x9100ef=_0x10b134[_0xdad5('0x27')]+_0x10b134['limit'],_0x3ab4af;if(_0x9100ef>=_0x5e3c58){_0x9100ef=_0x5e3c58;_0x3ab4af=0xc8;}else{_0x3ab4af=0xce;}_0x8a5945[_0xdad5('0x24')](_0x3ab4af);return _0x8a5945['set'](_0xdad5('0x28'),_0x110649+'-'+_0x9100ef+'/'+_0x5e3c58)['json'](_0x363165);}return null;};}function patchUpdates(_0x44f197){return function(_0x1f41fd){try{jsonpatch[_0xdad5('0x29')](_0x1f41fd,_0x44f197,!![]);}catch(_0x573202){return BPromise[_0xdad5('0x2a')](_0x573202);}return _0x1f41fd['save']();};}function saveUpdates(_0x3a6af5,_0x2df9ef){return function(_0x3e1f2c){if(_0x3e1f2c){return _0x3e1f2c['update'](_0x3a6af5)[_0xdad5('0x2b')](function(_0x3fe809){return _0x3fe809;});}return null;};}function removeEntity(_0x4d3e2f,_0x1adee1){return function(_0x201dd8){if(_0x201dd8){return _0x201dd8[_0xdad5('0x2c')]()['then'](function(){_0x4d3e2f[_0xdad5('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x135f72,_0x3bd831){return function(_0x327421){if(!_0x327421){_0x135f72[_0xdad5('0x23')](0x194);}return _0x327421;};}function handleError(_0x8f2ec,_0xc55be0){_0xc55be0=_0xc55be0||0x1f4;return function(_0x175b89){logger[_0xdad5('0x1f')](_0x175b89[_0xdad5('0x2d')]);if(_0x175b89['name']){delete _0x175b89['name'];}_0x8f2ec['status'](_0xc55be0)['send'](_0x175b89);};}exports[_0xdad5('0x2e')]=function(_0x27ced5,_0x36184a){var _0x1bd387={},_0x147efe={},_0x59fba6={'count':0x0,'rows':[]};var _0x5d03a9=db[_0xdad5('0x2f')][_0xdad5('0x30')];_0x147efe[_0xdad5('0x31')]=_[_0xdad5('0x32')](_0x5d03a9);var _0x35edb8={'dateStart':_0x27ced5[_0xdad5('0x33')][_0xdad5('0x34')],'dateEnd':_0x27ced5['query'][_0xdad5('0x35')]};delete _0x27ced5[_0xdad5('0x33')][_0xdad5('0x34')];delete _0x27ced5[_0xdad5('0x33')][_0xdad5('0x35')];_0x147efe['query']=_['keys'](_0x27ced5[_0xdad5('0x33')]);_0x147efe[_0xdad5('0x36')]=_[_0xdad5('0x37')](_0x147efe['model'],_0x147efe['query']);_0x1bd387['attributes']=_['intersection'](_0x147efe[_0xdad5('0x31')],qs[_0xdad5('0x38')](_0x27ced5['query']['fields']));_0x1bd387[_0xdad5('0x39')]=_0x1bd387[_0xdad5('0x39')][_0xdad5('0x3a')]?_0x1bd387[_0xdad5('0x39')]:_0x147efe[_0xdad5('0x31')];if(!_0x27ced5[_0xdad5('0x33')][_0xdad5('0x3b')](_0xdad5('0x3c'))){_0x1bd387[_0xdad5('0x3d')]=qs[_0xdad5('0x3d')](_0x27ced5[_0xdad5('0x33')][_0xdad5('0x3d')]);_0x1bd387[_0xdad5('0x27')]=qs[_0xdad5('0x27')](_0x27ced5[_0xdad5('0x33')][_0xdad5('0x27')]);}_0x1bd387['order']=qs[_0xdad5('0x3e')](_0x27ced5['query'][_0xdad5('0x3e')]);_0x1bd387[_0xdad5('0x3f')]=qs[_0xdad5('0x36')](_['pick'](_0x27ced5[_0xdad5('0x33')],_0x147efe[_0xdad5('0x36')]));if(_0x35edb8['dateStart']){if(_0x35edb8[_0xdad5('0x35')]){_0x35edb8['dateEnd']=moment(_0x35edb8[_0xdad5('0x35')])[_0xdad5('0x40')](0x1,_0xdad5('0x41'));}else{_0x35edb8['dateEnd']=moment(_0x35edb8['dateStart'])[_0xdad5('0x40')](0x1,_0xdad5('0x41'));}_[_0xdad5('0x42')](_0x1bd387[_0xdad5('0x3f')],{'createdAt':{'$gte':_0x35edb8[_0xdad5('0x34')],'$lte':_0x35edb8[_0xdad5('0x35')]}});}if(_0x27ced5['query'][_0xdad5('0x43')]){_0x1bd387['where']=_[_0xdad5('0x42')](_0x1bd387[_0xdad5('0x3f')],{'$or':_[_0xdad5('0x44')](_0x1bd387[_0xdad5('0x39')],function(_0x130e72){var _0x598529={};_0x598529[_0x130e72]={'$like':'%'+_0x27ced5[_0xdad5('0x33')]['filter']+'%'};return _0x598529;})});}_0x1bd387=_[_0xdad5('0x42')]({},_0x1bd387,_0x27ced5[_0xdad5('0x45')]);var _0x41c8e4={'where':_0x1bd387[_0xdad5('0x3f')]};return db[_0xdad5('0x2f')]['count'](_0x41c8e4)[_0xdad5('0x2b')](function(_0x54b06d){_0x59fba6[_0xdad5('0x26')]=_0x54b06d;if(_0x27ced5[_0xdad5('0x33')][_0xdad5('0x46')]){_0x1bd387['include']=[{'all':!![]}];}return db[_0xdad5('0x2f')]['findAll'](_0x1bd387);})[_0xdad5('0x2b')](function(_0x3f8a90){_0x59fba6[_0xdad5('0x47')]=_0x3f8a90;return _0x59fba6;})[_0xdad5('0x2b')](respondWithFilteredResult(_0x36184a,_0x1bd387))[_0xdad5('0x48')](handleError(_0x36184a,null));};exports[_0xdad5('0x49')]=function(_0x5dde37,_0x4bdddb){var _0x2f2acb={'raw':!![],'where':{'id':_0x5dde37[_0xdad5('0x4a')]['id']}},_0x34d9fa={};_0x34d9fa[_0xdad5('0x31')]=_['keys'](db['SmsMessage']['rawAttributes']);_0x34d9fa[_0xdad5('0x33')]=_[_0xdad5('0x32')](_0x5dde37[_0xdad5('0x33')]);_0x34d9fa[_0xdad5('0x36')]=_['intersection'](_0x34d9fa['model'],_0x34d9fa[_0xdad5('0x33')]);_0x2f2acb[_0xdad5('0x39')]=_[_0xdad5('0x37')](_0x34d9fa[_0xdad5('0x31')],qs[_0xdad5('0x38')](_0x5dde37[_0xdad5('0x33')][_0xdad5('0x38')]));_0x2f2acb[_0xdad5('0x39')]=_0x2f2acb[_0xdad5('0x39')][_0xdad5('0x3a')]?_0x2f2acb[_0xdad5('0x39')]:_0x34d9fa[_0xdad5('0x31')];if(_0x5dde37[_0xdad5('0x33')][_0xdad5('0x46')]){_0x2f2acb[_0xdad5('0x4b')]=[{'all':!![]}];}_0x2f2acb=_['merge']({},_0x2f2acb,_0x5dde37[_0xdad5('0x45')]);return db['SmsMessage'][_0xdad5('0x4c')](_0x2f2acb)['then'](handleEntityNotFound(_0x4bdddb,null))[_0xdad5('0x2b')](respondWithResult(_0x4bdddb,null))[_0xdad5('0x48')](handleError(_0x4bdddb,null));};exports[_0xdad5('0x4d')]=function(_0x538867,_0x2157ac){return db[_0xdad5('0x2f')]['create'](_0x538867['body'],{})[_0xdad5('0x2b')](respondWithResult(_0x2157ac,0xc9))['catch'](handleError(_0x2157ac,null));};exports['update']=function(_0x57dd62,_0x3f1961){if(_0x57dd62[_0xdad5('0x4e')]['id']){delete _0x57dd62['body']['id'];}return db[_0xdad5('0x2f')][_0xdad5('0x4c')]({'where':{'id':_0x57dd62[_0xdad5('0x4a')]['id']}})[_0xdad5('0x2b')](handleEntityNotFound(_0x3f1961,null))['then'](saveUpdates(_0x57dd62[_0xdad5('0x4e')],null))[_0xdad5('0x2b')](respondWithResult(_0x3f1961,null))[_0xdad5('0x48')](handleError(_0x3f1961,null));};exports[_0xdad5('0x2c')]=function(_0x8a63e8,_0x164b83){return db[_0xdad5('0x2f')]['find']({'where':{'id':_0x8a63e8[_0xdad5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x164b83,null))['then'](removeEntity(_0x164b83,null))[_0xdad5('0x48')](handleError(_0x164b83,null));};exports[_0xdad5('0x4f')]=function(_0x2833e8,_0x54f10b){return db['SmsMessage'][_0xdad5('0x4f')]()[_0xdad5('0x2b')](respondWithResult(_0x54f10b,null))[_0xdad5('0x48')](handleError(_0x54f10b,null));};var interaction_log=require(_0xdad5('0x13'))(_0xdad5('0x50'));exports[_0xdad5('0x51')]=function(_0x49b170,_0x40c19b,_0x46ee01){var _0x54d502={'channel':_0xdad5('0x52')};if(_0x49b170[_0xdad5('0x4e')]['id']){delete _0x49b170[_0xdad5('0x4e')]['id'];}_0x49b170[_0xdad5('0x4e')]['read']=!![];_0x49b170[_0xdad5('0x4e')][_0xdad5('0x53')]=moment()[_0xdad5('0x54')](_0xdad5('0x55'));_0x49b170[_0xdad5('0x4e')][_0xdad5('0x56')]=_0x49b170[_0xdad5('0x4e')]['UserId']||_0x49b170[_0xdad5('0x57')]['id'];return db['SmsMessage'][_0xdad5('0x4c')]({'where':{'id':_0x49b170['params']['id'],'UserId':null},'include':[{'model':db[_0xdad5('0x58')],'as':'Contact'}]})[_0xdad5('0x2b')](handleEntityNotFound(_0x40c19b,null))[_0xdad5('0x2b')](saveUpdates(_0x49b170['body'],null))[_0xdad5('0x2b')](function(_0x5c0bac){if(_0x5c0bac){_0x54d502[_0xdad5('0x21')]=_0x5c0bac['get']({'plain':!![]});return db['SmsInteraction'][_0xdad5('0x4c')]({'where':{'id':_0x5c0bac[_0xdad5('0x59')]}});}return null;})[_0xdad5('0x2b')](handleEntityNotFound(_0x40c19b,null))[_0xdad5('0x2b')](function(_0x46d65d){if(_0x46d65d){return _0x46d65d[_0xdad5('0x5a')]({'UserId':_0x49b170['body']['UserId'],'read1stAt':_['isNil'](_0x46d65d['read1stAt'])?moment()[_0xdad5('0x54')](_0xdad5('0x55')):undefined});}return null;})['then'](function(_0x4c18e6){if(_0x4c18e6){_0x54d502[_0xdad5('0x5b')]=_0x4c18e6[_0xdad5('0x5c')]({'plain':!![]});interaction_log['info'](_0xdad5('0x5d'),_0x49b170[_0xdad5('0x57')]['id'],_0x49b170[_0xdad5('0x57')]['name'],_0x49b170[_0xdad5('0x57')][_0xdad5('0x5e')],_0x54d502[_0xdad5('0x5b')]['id'],_0x49b170[_0xdad5('0x4e')]?JSON[_0xdad5('0x5f')](_0x49b170[_0xdad5('0x4e')]):_0xdad5('0x60'));return respondWithRpcPromise(_0xdad5('0x61'),_0xdad5('0x62'),_0x54d502);}return null;})[_0xdad5('0x2b')](function(_0x153f18){if(_0x153f18){if(_0x49b170[_0xdad5('0x4e')]['manual']){_0x54d502[_0xdad5('0x21')]['interface']=util[_0xdad5('0x54')](_0xdad5('0x63'),_0x49b170['user'][_0xdad5('0x64')]);_0x54d502[_0xdad5('0x21')]['channel']=_0x54d502[_0xdad5('0x65')];_0x54d502[_0xdad5('0x21')][_0xdad5('0x66')]=_0xdad5('0x51');return respondWithRpcPromise(_0xdad5('0x67'),_0xdad5('0x67'),{'event':_0xdad5('0x68'),'message':_0x54d502[_0xdad5('0x21')]},client9002)['then'](function(){return _0x54d502;});}return _0x54d502;}return null;})[_0xdad5('0x2b')](respondWithResult(_0x40c19b,null))[_0xdad5('0x48')](handleError(_0x40c19b,null));};var interaction_log=require(_0xdad5('0x13'))(_0xdad5('0x50'));exports[_0xdad5('0x2a')]=function(_0x1c651d,_0x379146,_0x53de1f){var _0x53cc6a={'agent':{},'channel':_0xdad5('0x52')};if(_0x1c651d[_0xdad5('0x4e')]['id']){delete _0x1c651d[_0xdad5('0x4e')]['id'];}_0x1c651d[_0xdad5('0x4e')][_0xdad5('0x56')]=_0x1c651d[_0xdad5('0x4e')][_0xdad5('0x56')]||_0x1c651d[_0xdad5('0x57')]['id'];_0x53cc6a[_0xdad5('0x69')]['id']=_0x1c651d[_0xdad5('0x4e')][_0xdad5('0x56')];return db[_0xdad5('0x2f')][_0xdad5('0x4c')]({'where':{'id':_0x1c651d[_0xdad5('0x4a')]['id'],'UserId':null}})[_0xdad5('0x2b')](handleEntityNotFound(_0x379146,null))[_0xdad5('0x2b')](function(_0x516cf3){if(_0x516cf3){_0x53cc6a[_0xdad5('0x21')]=_0x516cf3[_0xdad5('0x5c')]({'plain':!![]});return db[_0xdad5('0x6a')]['find']({'where':{'id':_0x516cf3[_0xdad5('0x59')]}});}return null;})[_0xdad5('0x2b')](handleEntityNotFound(_0x379146,null))[_0xdad5('0x2b')](function(_0x1a2840){if(_0x1a2840){_0x53cc6a[_0xdad5('0x5b')]=_0x1a2840[_0xdad5('0x5c')]({'plain':!![]});interaction_log[_0xdad5('0x1b')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1c651d['user']['id'],_0x1c651d[_0xdad5('0x57')]['name'],_0x1c651d['user'][_0xdad5('0x5e')],_0x53cc6a[_0xdad5('0x5b')]['id'],_0x1c651d['body']?JSON[_0xdad5('0x5f')](_0x1c651d[_0xdad5('0x4e')]):_0xdad5('0x60'));return respondWithRpcPromise(_0xdad5('0x6b'),_0xdad5('0x6c'),_0x53cc6a);}return null;})[_0xdad5('0x2b')](function(_0x594cf3){if(_0x594cf3){_0x594cf3[_0xdad5('0x21')]['interface']=util[_0xdad5('0x54')](_0xdad5('0x63'),_0x1c651d[_0xdad5('0x57')][_0xdad5('0x64')]);_0x594cf3[_0xdad5('0x21')]['channel']=_0x53cc6a[_0xdad5('0x65')];_0x594cf3[_0xdad5('0x21')]['event']='reject';respondWithRpcPromise(_0xdad5('0x67'),_0xdad5('0x67'),{'event':_0xdad5('0x6d'),'message':_0x594cf3[_0xdad5('0x21')]},client9002);return _0x53cc6a;}return null;})[_0xdad5('0x2b')](respondWithResult(_0x379146,null))[_0xdad5('0x48')](handleError(_0x379146,null));};exports[_0xdad5('0x24')]=function(_0x51e922,_0x33479b,_0x4ea844){if(_0x51e922[_0xdad5('0x4e')]['id']){delete _0x51e922[_0xdad5('0x4e')]['id'];}var _0x1c9cda;return db[_0xdad5('0x2f')][_0xdad5('0x4c')]({'where':{'id':_0x51e922[_0xdad5('0x4a')]['id']}})[_0xdad5('0x2b')](handleEntityNotFound(_0x33479b,null))[_0xdad5('0x2b')](function(_0x457b67){if(_0x457b67){_0x1c9cda=_0x457b67;return db['SmsAccount'][_0xdad5('0x4c')]({'where':{'id':_0x457b67[_0xdad5('0x6e')]}});}})[_0xdad5('0x2b')](handleEntityNotFound(_0x33479b,null))['then'](function(_0x1ad02c){if(_0x1ad02c){logger[_0xdad5('0x1e')](_0xdad5('0x6f'),_0xdad5('0x24'),_0xdad5('0x70'),_0x1ad02c['type'],util['inspect'](_0x51e922['body'],{'showHidden':![],'depth':null}));switch(_0x1ad02c[_0xdad5('0x71')]){case _0xdad5('0x72'):if(_0x51e922[_0xdad5('0x4e')]['MessageSid']&&_0x51e922[_0xdad5('0x4e')][_0xdad5('0x73')]===_0x1c9cda['messageId']){return _0x1c9cda[_0xdad5('0x5a')]({'read':!![]});}break;case _0xdad5('0x74'):if(_0x51e922[_0xdad5('0x4e')][_0xdad5('0x75')]&&_0x51e922[_0xdad5('0x4e')][_0xdad5('0x75')]===_0x1c9cda['messageId']&&_[_0xdad5('0x76')]([_0xdad5('0x77'),_0xdad5('0x78')],_0x51e922[_0xdad5('0x4e')]['Status'])>=0x0){return _0x1c9cda['update']({'read':!![]});}break;}return _0x1c9cda;}})[_0xdad5('0x2b')](respondWithResult(_0x33479b,null))['catch'](handleError(_0x33479b,null));};
\ No newline at end of file
index 1a972a5..788b4a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa571=['exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hook'];(function(_0x178f52,_0x5d9675){var _0x556f99=function(_0x4a7b17){while(--_0x4a7b17){_0x178f52['push'](_0x178f52['shift']());}};_0x556f99(++_0x5d9675);}(_0xa571,0x83));var _0x1a57=function(_0x8c40d8,_0x2533bc){_0x8c40d8=_0x8c40d8-0x0;var _0x54286d=_0xa571[_0x8c40d8];return _0x54286d;};'use strict';var EventEmitter=require(_0x1a57('0x0'));var SmsMessage=require(_0x1a57('0x1'))['db'][_0x1a57('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x1a57('0x3')](0x0);var events={'afterCreate':_0x1a57('0x4'),'afterUpdate':_0x1a57('0x5'),'afterDestroy':_0x1a57('0x6')};function emitEvent(_0xef1cb9){return function(_0x261369,_0x27b3c2,_0x5f481c){SmsMessageEvents['emit'](_0xef1cb9+':'+_0x261369['id'],_0x261369);SmsMessageEvents[_0x1a57('0x7')](_0xef1cb9,_0x261369);_0x5f481c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x1a57('0x8')](e,emitEvent(event));}}module[_0x1a57('0x9')]=SmsMessageEvents;
\ No newline at end of file
+var _0x58a0=['../../mysqldb','SmsMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3a924a,_0x5b8ed3){var _0x144b03=function(_0x4b7375){while(--_0x4b7375){_0x3a924a['push'](_0x3a924a['shift']());}};_0x144b03(++_0x5b8ed3);}(_0x58a0,0x1af));var _0x058a=function(_0x1577d5,_0x459e81){_0x1577d5=_0x1577d5-0x0;var _0x45c557=_0x58a0[_0x1577d5];return _0x45c557;};'use strict';var EventEmitter=require(_0x058a('0x0'));var SmsMessage=require(_0x058a('0x1'))['db'][_0x058a('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x058a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x058a('0x4'),'afterDestroy':_0x058a('0x5')};function emitEvent(_0x421eeb){return function(_0x4e78e3,_0x1235b8,_0x4f0d3d){SmsMessageEvents[_0x058a('0x6')](_0x421eeb+':'+_0x4e78e3['id'],_0x4e78e3);SmsMessageEvents[_0x058a('0x6')](_0x421eeb,_0x4e78e3);_0x4f0d3d(null);};}for(var e in events){if(events[_0x058a('0x7')](e)){var event=events[e];SmsMessage[_0x058a('0x8')](e,emitEvent(event));}}module['exports']=SmsMessageEvents;
\ No newline at end of file
index af2466c..cd6951b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62c0=['api','moment','request-promise','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','models','get','direction','toLowerCase','out','secret','isNil','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','catch','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','create','body','phone','remote','/api/sms/messages/','/status?token=','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','querystring','username','password','smsMethod','basic','method','send_sms_basic','send_sms_classic','sender_number','senderString','sender_string','stringify','https://gateway.skebby.it/api/send/smseasy/advanced/http.php','application/x-www-form-urlencoded','length','utf8','parse','status','success','classic+','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','POST','requestid','read','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','base64','data','queued_count','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1a5486,_0x26eb12){var _0x432d61=function(_0x2338a1){while(--_0x2338a1){_0x1a5486['push'](_0x1a5486['shift']());}};_0x432d61(++_0x26eb12);}(_0x62c0,0x167));var _0x062c=function(_0x1c7889,_0x24cd26){_0x1c7889=_0x1c7889-0x0;var _0x2f14e5=_0x62c0[_0x1c7889];return _0x2f14e5;};'use strict';var _=require(_0x062c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x062c('0x1'));var moment=require(_0x062c('0x2'));var BPromise=require('bluebird');var rp=require(_0x062c('0x3'));var attributes=require(_0x062c('0x4'));module[_0x062c('0x5')]=function(_0x3bf778,_0x592e88){return _0x3bf778[_0x062c('0x6')](_0x062c('0x7'),attributes,{'tableName':_0x062c('0x8'),'paranoid':![],'indexes':[{'name':_0x062c('0x9'),'fields':[_0x062c('0x9')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ef200,_0x91187f,_0x1268dd){var _0x1ec312=_0x3bf778[_0x062c('0xa')];var _0x345fd5=_0x4ef200[_0x062c('0xb')]({'plain':!![]});if(_0x345fd5['direction']['toLowerCase']()==='in'||_0x345fd5[_0x062c('0xc')][_0x062c('0xd')]()===_0x062c('0xe')&&!_0x345fd5[_0x062c('0xf')]&&!_[_0x062c('0x10')](_0x345fd5['UserId'])){_0x1ec312[_0x062c('0x11')][_0x062c('0x12')]({'where':{'id':_0x345fd5[_0x062c('0x13')]}})[_0x062c('0x14')](function(_0x149008){if(_0x149008){_0x149008[_0x062c('0x15')]({'lastMsgAt':_0x345fd5[_0x062c('0x16')],'lastMsgDirection':_0x345fd5['direction'][_0x062c('0xd')](),'lastMsgBody':_0x345fd5['body']});}})[_0x062c('0x17')](function(_0x212033){console['error'](_0x212033);});}if(_0x345fd5[_0x062c('0xc')]===_0x062c('0xe')&&!_0x345fd5[_0x062c('0xf')]){var _0x39b68b;_0x1ec312[_0x062c('0x18')][_0x062c('0x19')]({'where':{'id':_0x345fd5[_0x062c('0x1a')]},'raw':!![]})[_0x062c('0x14')](function(_0x3f0926){_0x39b68b=_0x3f0926;if(_0x39b68b&&_0x39b68b['type']){switch(_0x39b68b[_0x062c('0x1b')]){case _0x062c('0x1c'):var _0x47a4f3=require('twilio');if(_0x39b68b[_0x062c('0x1d')]&&_0x39b68b[_0x062c('0x1e')]&&_0x39b68b['phone']){var _0x85b943=new _0x47a4f3(_0x39b68b[_0x062c('0x1d')],_0x39b68b['authToken']);_0x85b943[_0x062c('0x1f')][_0x062c('0x20')]({'body':_0x345fd5[_0x062c('0x21')],'to':_0x345fd5[_0x062c('0x22')],'from':_0x39b68b[_0x062c('0x22')],'statusCallback':_0x39b68b[_0x062c('0x23')]+_0x062c('0x24')+_0x345fd5['id']+_0x062c('0x25')+_0x39b68b[_0x062c('0x26')]})[_0x062c('0x14')](function(_0x49a631){if(_0x49a631['sid']){return _0x4ef200[_0x062c('0x15')]({'messageId':_0x49a631[_0x062c('0x27')]});}})['catch'](function(_0x2ad13d){logger[_0x062c('0x28')](_0x062c('0x29'),_0x062c('0x2a'),_0x062c('0x1c'),util[_0x062c('0x2b')](_0x2ad13d,{'showHidden':![],'depth':null}));});}else{logger[_0x062c('0x28')](_0x062c('0x29'),_0x062c('0x2a'),_0x062c('0x1c'),_0x062c('0x2c'));}break;case _0x062c('0x2d'):var _0x42fb51=require(_0x062c('0x2e'));if(_0x39b68b[_0x062c('0x2f')]&&_0x39b68b[_0x062c('0x30')]){var _0x7c523e={'username':_0x39b68b[_0x062c('0x2f')],'password':_0x39b68b[_0x062c('0x30')],'recipients[]':[_0x345fd5[_0x062c('0x22')]],'text':_0x345fd5['body'],'charset':'UTF-8'};switch(_0x39b68b[_0x062c('0x31')]){case _0x062c('0x32'):_0x7c523e[_0x062c('0x33')]=_0x062c('0x34');break;case'classic':_0x7c523e[_0x062c('0x33')]=_0x062c('0x35');_0x7c523e[_0x062c('0x36')]=_0x39b68b[_0x062c('0x22')];if(_0x39b68b[_0x062c('0x37')]){_0x7c523e['sender_string']=_0x39b68b['senderString'];}else if(_0x39b68b[_0x062c('0x22')]){_0x7c523e[_0x062c('0x36')]=_0x39b68b['phone'];}break;case'classic+':_0x7c523e[_0x062c('0x33')]='send_sms_classic_report';_0x7c523e[_0x062c('0x36')]=_0x39b68b[_0x062c('0x22')];if(_0x39b68b['senderString']){_0x7c523e[_0x062c('0x38')]=_0x39b68b[_0x062c('0x37')];}else if(_0x39b68b[_0x062c('0x22')]){_0x7c523e['sender_number']=_0x39b68b[_0x062c('0x22')];}break;}var _0x5f3c95=_0x42fb51[_0x062c('0x39')](_0x7c523e);var _0x91187f={'method':'POST','uri':_0x062c('0x3a'),'body':_0x5f3c95,'headers':{'Content-Type':_0x062c('0x3b'),'Content-Length':_0x5f3c95[_0x062c('0x3c')],'Content-Encoding':_0x062c('0x3d')}};rp(_0x91187f)[_0x062c('0x14')](function(_0x162223){var _0x12ee70=_0x42fb51[_0x062c('0x3e')](_0x162223);if(_0x12ee70[_0x062c('0x3f')]==_0x062c('0x40')){var _0x8ff7b={'messageId':_0x12ee70['id']};if(_0x39b68b[_0x062c('0x31')]!==_0x062c('0x41')||!_0x39b68b[_0x062c('0x42')]){_0x8ff7b['read']=!![];}return _0x4ef200[_0x062c('0x15')](_0x8ff7b);}else{logger[_0x062c('0x28')](_0x062c('0x29'),_0x062c('0x2a'),'skebby',util['inspect'](_0x12ee70,{'showHidden':![],'depth':null}));}})[_0x062c('0x17')](function(_0x3cf4e5){logger['error'](_0x062c('0x29'),'afterCreate',_0x062c('0x2d'),util[_0x062c('0x2b')](_0x3cf4e5,{'showHidden':![],'depth':null}));});}else{logger[_0x062c('0x28')](_0x062c('0x29'),_0x062c('0x2a'),'skebby',_0x062c('0x43'));}break;case _0x062c('0x44'):if(_0x39b68b[_0x062c('0x1e')]){var _0x7c523e={'recipient':_0x345fd5[_0x062c('0x22')],'message':_0x345fd5[_0x062c('0x21')],'sender':_0x39b68b[_0x062c('0x37')]||_0x39b68b[_0x062c('0x22')],'authorization':_0x39b68b[_0x062c('0x1e')]};var _0x91187f={'method':_0x062c('0x45'),'uri':'https://smsapi.connectel.se/api/send/','body':_0x7c523e,'json':!![]};rp(_0x91187f)[_0x062c('0x14')](function(_0x5d59ea){var _0x48de0e={'messageId':_0x5d59ea[_0x062c('0x46')]};if(!_0x39b68b[_0x062c('0x42')]){_0x48de0e[_0x062c('0x47')]=!![];}return _0x4ef200[_0x062c('0x15')](_0x48de0e);})[_0x062c('0x17')](function(_0x4cf70c){logger['error'](_0x062c('0x29'),_0x062c('0x2a'),_0x062c('0x44'),util[_0x062c('0x2b')](_0x4cf70c,{'showHidden':![],'depth':null}));});}else{logger[_0x062c('0x28')](_0x062c('0x29'),_0x062c('0x2a'),_0x062c('0x44'),_0x062c('0x48'));}break;case'clicksend':if(_0x39b68b['username']&&_0x39b68b[_0x062c('0x30')]){var _0x7c523e={'messages':[{'source':_0x062c('0x49'),'to':_0x345fd5[_0x062c('0x22')],'body':_0x345fd5[_0x062c('0x21')],'from':_0x39b68b['senderString']||_0x39b68b['phone']}]};var _0x1d85b0=util['format'](_0x062c('0x4a'),_0x39b68b[_0x062c('0x2f')],_0x39b68b['password']);var _0x91187f={'method':_0x062c('0x45'),'uri':_0x062c('0x4b'),'body':_0x7c523e,'headers':{'Authorization':util[_0x062c('0x4c')](_0x062c('0x4d'),new Buffer(_0x1d85b0)['toString'](_0x062c('0x4e')))},'json':!![]};rp(_0x91187f)[_0x062c('0x14')](function(_0x2f5652){if(_0x2f5652['http_code']>=0xc8&&_0x2f5652['http_code']<=0xce){if(_0x2f5652[_0x062c('0x4f')]&&_0x2f5652[_0x062c('0x4f')][_0x062c('0x50')]>0x0){var _0x3cf693=_['head'](_0x2f5652['data'][_0x062c('0x1f')]);var _0x4304b1={'messageId':_0x3cf693['message_id']};if(!_0x39b68b[_0x062c('0x42')]){_0x4304b1[_0x062c('0x47')]=!![];}return _0x4ef200[_0x062c('0x15')](_0x4304b1);}else{logger[_0x062c('0x28')](_0x062c('0x29'),_0x062c('0x2a'),'clickSend',util[_0x062c('0x2b')](_0x2f5652,{'showHidden':![],'depth':null}));}}else{logger[_0x062c('0x28')](_0x062c('0x29'),_0x062c('0x2a'),'clickSend',util['inspect'](_0x2f5652,{'showHidden':![],'depth':null}));}})[_0x062c('0x17')](function(_0x3e190d){logger[_0x062c('0x28')](_0x062c('0x29'),_0x062c('0x2a'),_0x062c('0x51'),util['inspect'](_0x3e190d,{'showHidden':![],'depth':null}));});}else{logger[_0x062c('0x28')](_0x062c('0x29'),_0x062c('0x2a'),_0x062c('0x51'),_0x062c('0x43'));}break;case _0x062c('0x52'):if(_0x39b68b[_0x062c('0x53')]&&_0x39b68b[_0x062c('0x1e')]){var _0x7c523e={'dst':_0x345fd5[_0x062c('0x22')],'text':_0x345fd5[_0x062c('0x21')],'src':_0x39b68b[_0x062c('0x37')]||_0x39b68b[_0x062c('0x22')],'url':_0x39b68b[_0x062c('0x23')]+_0x062c('0x24')+_0x345fd5['id']+_0x062c('0x25')+_0x39b68b[_0x062c('0x26')]};var _0x1d85b0=util[_0x062c('0x4c')](_0x062c('0x4a'),_0x39b68b[_0x062c('0x53')],_0x39b68b[_0x062c('0x1e')]);var _0x91187f={'method':'POST','uri':util[_0x062c('0x4c')](_0x062c('0x54'),_0x39b68b[_0x062c('0x53')]),'body':_0x7c523e,'headers':{'Authorization':util[_0x062c('0x4c')](_0x062c('0x4d'),new Buffer(_0x1d85b0)[_0x062c('0x55')](_0x062c('0x4e')))},'json':!![]};rp(_0x91187f)[_0x062c('0x14')](function(_0x145182){var _0x49acf8={'messageId':_0x145182[_0x062c('0x56')][0x0]};return _0x4ef200[_0x062c('0x15')](_0x49acf8);})[_0x062c('0x17')](function(_0x4c8c51){logger[_0x062c('0x28')](_0x062c('0x29'),_0x062c('0x2a'),_0x062c('0x52'),util[_0x062c('0x2b')](_0x4c8c51,{'showHidden':![],'depth':null}));});}else{logger[_0x062c('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x062c('0x2a'),_0x062c('0x52'),_0x062c('0x57'));}break;}}})['finally'](function(){_0x1268dd();});}else{_0x1268dd();}}},'charset':_0x062c('0x58'),'collate':_0x062c('0x59')});};
\ No newline at end of file
+var _0x2ec2=['clickSend','authId','Basic\x20%s','base64','plivo','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','body','error','SmsAccount','find','SmsAccountId','type','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','twilio','inspect','afterCreate','skebby','querystring','username','password','smsMethod','basic','method','classic','send_sms_classic','sender_number','senderString','sender_string','classic+','send_sms_classic_report','stringify','https://gateway.skebby.it/api/send/smseasy/advanced/http.php','application/x-www-form-urlencoded','length','utf8','parse','status','deliveryReport','Missing\x20parameters:\x20username,\x20password','https://smsapi.connectel.se/api/send/','requestid','read','connectel','clicksend','format','%s:%s','POST','toString','http_code','data','queued_count','message_id'];(function(_0x5287cb,_0x228b38){var _0x4713e2=function(_0x96ff88){while(--_0x96ff88){_0x5287cb['push'](_0x5287cb['shift']());}};_0x4713e2(++_0x228b38);}(_0x2ec2,0x1ba));var _0x22ec=function(_0x5d4f12,_0x11e67c){_0x5d4f12=_0x5d4f12-0x0;var _0x4eb577=_0x2ec2[_0x5d4f12];return _0x4eb577;};'use strict';var _=require(_0x22ec('0x0'));var util=require('util');var logger=require(_0x22ec('0x1'))(_0x22ec('0x2'));var moment=require(_0x22ec('0x3'));var BPromise=require(_0x22ec('0x4'));var rp=require('request-promise');var attributes=require(_0x22ec('0x5'));module[_0x22ec('0x6')]=function(_0x37555f,_0x3f9328){return _0x37555f[_0x22ec('0x7')](_0x22ec('0x8'),attributes,{'tableName':_0x22ec('0x9'),'paranoid':![],'indexes':[{'name':_0x22ec('0xa'),'fields':[_0x22ec('0xa')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2fcf01,_0x1be92f,_0x28ccb1){var _0x1e9a34=_0x37555f['models'];var _0x3f1bb6=_0x2fcf01[_0x22ec('0xb')]({'plain':!![]});if(_0x3f1bb6[_0x22ec('0xc')][_0x22ec('0xd')]()==='in'||_0x3f1bb6[_0x22ec('0xc')][_0x22ec('0xd')]()===_0x22ec('0xe')&&!_0x3f1bb6[_0x22ec('0xf')]&&!_[_0x22ec('0x10')](_0x3f1bb6[_0x22ec('0x11')])){_0x1e9a34[_0x22ec('0x12')][_0x22ec('0x13')]({'where':{'id':_0x3f1bb6[_0x22ec('0x14')]}})[_0x22ec('0x15')](function(_0xa45415){if(_0xa45415){_0xa45415[_0x22ec('0x16')]({'lastMsgAt':_0x3f1bb6['createdAt'],'lastMsgDirection':_0x3f1bb6[_0x22ec('0xc')][_0x22ec('0xd')](),'lastMsgBody':_0x3f1bb6[_0x22ec('0x17')]});}})['catch'](function(_0x34d196){console[_0x22ec('0x18')](_0x34d196);});}if(_0x3f1bb6[_0x22ec('0xc')]===_0x22ec('0xe')&&!_0x3f1bb6[_0x22ec('0xf')]){var _0x469b7d;_0x1e9a34[_0x22ec('0x19')][_0x22ec('0x1a')]({'where':{'id':_0x3f1bb6[_0x22ec('0x1b')]},'raw':!![]})[_0x22ec('0x15')](function(_0x38f857){_0x469b7d=_0x38f857;if(_0x469b7d&&_0x469b7d[_0x22ec('0x1c')]){switch(_0x469b7d[_0x22ec('0x1c')]){case'twilio':var _0x1076ea=require('twilio');if(_0x469b7d[_0x22ec('0x1d')]&&_0x469b7d[_0x22ec('0x1e')]&&_0x469b7d[_0x22ec('0x1f')]){var _0x37986f=new _0x1076ea(_0x469b7d[_0x22ec('0x1d')],_0x469b7d[_0x22ec('0x1e')]);_0x37986f[_0x22ec('0x20')][_0x22ec('0x21')]({'body':_0x3f1bb6['body'],'to':_0x3f1bb6[_0x22ec('0x1f')],'from':_0x469b7d['phone'],'statusCallback':_0x469b7d[_0x22ec('0x22')]+_0x22ec('0x23')+_0x3f1bb6['id']+_0x22ec('0x24')+_0x469b7d[_0x22ec('0x25')]})[_0x22ec('0x15')](function(_0xe65618){if(_0xe65618[_0x22ec('0x26')]){return _0x2fcf01[_0x22ec('0x16')]({'messageId':_0xe65618[_0x22ec('0x26')]});}})[_0x22ec('0x27')](function(_0x3f355f){logger[_0x22ec('0x18')](_0x22ec('0x28'),'afterCreate',_0x22ec('0x29'),util[_0x22ec('0x2a')](_0x3f355f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x22ec('0x28'),_0x22ec('0x2b'),_0x22ec('0x29'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x22ec('0x2c'):var _0x362ce3=require(_0x22ec('0x2d'));if(_0x469b7d[_0x22ec('0x2e')]&&_0x469b7d[_0x22ec('0x2f')]){var _0x13b87b={'username':_0x469b7d[_0x22ec('0x2e')],'password':_0x469b7d['password'],'recipients[]':[_0x3f1bb6[_0x22ec('0x1f')]],'text':_0x3f1bb6['body'],'charset':'UTF-8'};switch(_0x469b7d[_0x22ec('0x30')]){case _0x22ec('0x31'):_0x13b87b[_0x22ec('0x32')]='send_sms_basic';break;case _0x22ec('0x33'):_0x13b87b[_0x22ec('0x32')]=_0x22ec('0x34');_0x13b87b[_0x22ec('0x35')]=_0x469b7d['phone'];if(_0x469b7d[_0x22ec('0x36')]){_0x13b87b[_0x22ec('0x37')]=_0x469b7d['senderString'];}else if(_0x469b7d['phone']){_0x13b87b[_0x22ec('0x35')]=_0x469b7d[_0x22ec('0x1f')];}break;case _0x22ec('0x38'):_0x13b87b[_0x22ec('0x32')]=_0x22ec('0x39');_0x13b87b['sender_number']=_0x469b7d['phone'];if(_0x469b7d[_0x22ec('0x36')]){_0x13b87b[_0x22ec('0x37')]=_0x469b7d[_0x22ec('0x36')];}else if(_0x469b7d['phone']){_0x13b87b[_0x22ec('0x35')]=_0x469b7d[_0x22ec('0x1f')];}break;}var _0x25e572=_0x362ce3[_0x22ec('0x3a')](_0x13b87b);var _0x1be92f={'method':'POST','uri':_0x22ec('0x3b'),'body':_0x25e572,'headers':{'Content-Type':_0x22ec('0x3c'),'Content-Length':_0x25e572[_0x22ec('0x3d')],'Content-Encoding':_0x22ec('0x3e')}};rp(_0x1be92f)[_0x22ec('0x15')](function(_0x454c72){var _0x4079f6=_0x362ce3[_0x22ec('0x3f')](_0x454c72);if(_0x4079f6[_0x22ec('0x40')]=='success'){var _0x454d54={'messageId':_0x4079f6['id']};if(_0x469b7d[_0x22ec('0x30')]!==_0x22ec('0x38')||!_0x469b7d[_0x22ec('0x41')]){_0x454d54['read']=!![];}return _0x2fcf01[_0x22ec('0x16')](_0x454d54);}else{logger[_0x22ec('0x18')](_0x22ec('0x28'),'afterCreate',_0x22ec('0x2c'),util['inspect'](_0x4079f6,{'showHidden':![],'depth':null}));}})[_0x22ec('0x27')](function(_0x2a36ce){logger[_0x22ec('0x18')](_0x22ec('0x28'),_0x22ec('0x2b'),_0x22ec('0x2c'),util['inspect'](_0x2a36ce,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x22ec('0x28'),_0x22ec('0x2b'),'skebby',_0x22ec('0x42'));}break;case'connectel':if(_0x469b7d[_0x22ec('0x1e')]){var _0x13b87b={'recipient':_0x3f1bb6[_0x22ec('0x1f')],'message':_0x3f1bb6[_0x22ec('0x17')],'sender':_0x469b7d[_0x22ec('0x36')]||_0x469b7d[_0x22ec('0x1f')],'authorization':_0x469b7d[_0x22ec('0x1e')]};var _0x1be92f={'method':'POST','uri':_0x22ec('0x43'),'body':_0x13b87b,'json':!![]};rp(_0x1be92f)['then'](function(_0x564c3c){var _0x363a43={'messageId':_0x564c3c[_0x22ec('0x44')]};if(!_0x469b7d['deliveryReport']){_0x363a43[_0x22ec('0x45')]=!![];}return _0x2fcf01[_0x22ec('0x16')](_0x363a43);})[_0x22ec('0x27')](function(_0x54a87f){logger['error'](_0x22ec('0x28'),_0x22ec('0x2b'),_0x22ec('0x46'),util[_0x22ec('0x2a')](_0x54a87f,{'showHidden':![],'depth':null}));});}else{logger[_0x22ec('0x18')](_0x22ec('0x28'),'afterCreate',_0x22ec('0x46'),'Missing\x20parameters:\x20authToken');}break;case _0x22ec('0x47'):if(_0x469b7d['username']&&_0x469b7d[_0x22ec('0x2f')]){var _0x13b87b={'messages':[{'source':'xCALLY\x20Motion','to':_0x3f1bb6['phone'],'body':_0x3f1bb6[_0x22ec('0x17')],'from':_0x469b7d[_0x22ec('0x36')]||_0x469b7d[_0x22ec('0x1f')]}]};var _0x494646=util[_0x22ec('0x48')](_0x22ec('0x49'),_0x469b7d[_0x22ec('0x2e')],_0x469b7d[_0x22ec('0x2f')]);var _0x1be92f={'method':_0x22ec('0x4a'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x13b87b,'headers':{'Authorization':util[_0x22ec('0x48')]('Basic\x20%s',new Buffer(_0x494646)[_0x22ec('0x4b')]('base64'))},'json':!![]};rp(_0x1be92f)[_0x22ec('0x15')](function(_0xe9a5e7){if(_0xe9a5e7['http_code']>=0xc8&&_0xe9a5e7[_0x22ec('0x4c')]<=0xce){if(_0xe9a5e7[_0x22ec('0x4d')]&&_0xe9a5e7[_0x22ec('0x4d')][_0x22ec('0x4e')]>0x0){var _0x49d7f2=_['head'](_0xe9a5e7[_0x22ec('0x4d')]['messages']);var _0x281570={'messageId':_0x49d7f2[_0x22ec('0x4f')]};if(!_0x469b7d['deliveryReport']){_0x281570[_0x22ec('0x45')]=!![];}return _0x2fcf01[_0x22ec('0x16')](_0x281570);}else{logger[_0x22ec('0x18')](_0x22ec('0x28'),'afterCreate',_0x22ec('0x50'),util[_0x22ec('0x2a')](_0xe9a5e7,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x22ec('0x28'),_0x22ec('0x2b'),_0x22ec('0x50'),util[_0x22ec('0x2a')](_0xe9a5e7,{'showHidden':![],'depth':null}));}})[_0x22ec('0x27')](function(_0x1fabb0){logger[_0x22ec('0x18')](_0x22ec('0x28'),_0x22ec('0x2b'),_0x22ec('0x50'),util[_0x22ec('0x2a')](_0x1fabb0,{'showHidden':![],'depth':null}));});}else{logger[_0x22ec('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x22ec('0x2b'),_0x22ec('0x50'),_0x22ec('0x42'));}break;case'plivo':if(_0x469b7d[_0x22ec('0x51')]&&_0x469b7d[_0x22ec('0x1e')]){var _0x13b87b={'dst':_0x3f1bb6[_0x22ec('0x1f')],'text':_0x3f1bb6[_0x22ec('0x17')],'src':_0x469b7d[_0x22ec('0x36')]||_0x469b7d['phone'],'url':_0x469b7d[_0x22ec('0x22')]+_0x22ec('0x23')+_0x3f1bb6['id']+'/status?token='+_0x469b7d[_0x22ec('0x25')]};var _0x494646=util[_0x22ec('0x48')](_0x22ec('0x49'),_0x469b7d[_0x22ec('0x51')],_0x469b7d['authToken']);var _0x1be92f={'method':_0x22ec('0x4a'),'uri':util['format']('https://api.plivo.com/v1/Account/%s/Message/',_0x469b7d[_0x22ec('0x51')]),'body':_0x13b87b,'headers':{'Authorization':util['format'](_0x22ec('0x52'),new Buffer(_0x494646)[_0x22ec('0x4b')](_0x22ec('0x53')))},'json':!![]};rp(_0x1be92f)[_0x22ec('0x15')](function(_0x50cd83){var _0x5c21fa={'messageId':_0x50cd83['message_uuid'][0x0]};return _0x2fcf01[_0x22ec('0x16')](_0x5c21fa);})['catch'](function(_0x38f648){logger[_0x22ec('0x18')](_0x22ec('0x28'),_0x22ec('0x2b'),_0x22ec('0x54'),util[_0x22ec('0x2a')](_0x38f648,{'showHidden':![],'depth':null}));});}else{logger[_0x22ec('0x18')](_0x22ec('0x28'),_0x22ec('0x2b'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;}}})['finally'](function(){_0x28ccb1();});}else{_0x28ccb1();}}},'charset':_0x22ec('0x55'),'collate':_0x22ec('0x56')});};
\ No newline at end of file
index 728ef10..25f90c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a25=['options','raw','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter','localhost','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body'];(function(_0x27e2c8,_0x5f40a0){var _0x5454d4=function(_0x2cbef9){while(--_0x2cbef9){_0x27e2c8['push'](_0x27e2c8['shift']());}};_0x5454d4(++_0x5f40a0);}(_0x3a25,0x7e));var _0x53a2=function(_0x173e6d,_0x47aa3e){_0x173e6d=_0x173e6d-0x0;var _0xbad0c4=_0x3a25[_0x173e6d];return _0xbad0c4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x53a2('0x0'));var BPromise=require('bluebird');var rs=require(_0x53a2('0x1'));var fs=require('fs');var db=require(_0x53a2('0x2'))['db'];var utils=require(_0x53a2('0x3'));var logger=require('../../config/logger')(_0x53a2('0x4'));var config=require(_0x53a2('0x5'));var jayson=require(_0x53a2('0x6'));var client=jayson[_0x53a2('0x7')][_0x53a2('0x8')]({'port':0x232a});var socket=require(_0x53a2('0x9'))({'host':_0x53a2('0xa'),'port':0x18eb});require(_0x53a2('0xb'))[_0x53a2('0xc')](socket);function respondWithRpcPromise(_0xcfd411,_0x28a01a,_0x448764){return new BPromise(function(_0x1a2a6e,_0x58520a){return client[_0x53a2('0xd')](_0xcfd411,_0x448764)['then'](function(_0x3e6237){logger[_0x53a2('0xe')](_0x53a2('0xf'),_0x28a01a,_0x53a2('0x10'));logger[_0x53a2('0x11')](_0x53a2('0x12'),_0x28a01a,'request\x20sent',JSON[_0x53a2('0x13')](_0x3e6237));if(_0x3e6237[_0x53a2('0x14')]){if(_0x3e6237[_0x53a2('0x14')][_0x53a2('0x15')]===0x1f4){logger['error'](_0x53a2('0xf'),_0x28a01a,_0x3e6237['error']['message']);return _0x58520a(_0x3e6237[_0x53a2('0x14')][_0x53a2('0x16')]);}logger[_0x53a2('0x14')](_0x53a2('0xf'),_0x28a01a,_0x3e6237['error'][_0x53a2('0x16')]);return _0x1a2a6e(_0x3e6237['error'][_0x53a2('0x16')]);}else{logger[_0x53a2('0xe')](_0x53a2('0xf'),_0x28a01a,_0x53a2('0x10'));_0x1a2a6e(_0x3e6237[_0x53a2('0x17')][_0x53a2('0x16')]);}})[_0x53a2('0x18')](function(_0xe685f7){logger[_0x53a2('0x14')](_0x53a2('0xf'),_0x28a01a,_0xe685f7);_0x58520a(_0xe685f7);});});}exports[_0x53a2('0x19')]=function(_0x4305b9){var _0x20a7e5=this;return new Promise(function(_0x1286cd,_0x56750b){return db[_0x53a2('0x1a')][_0x53a2('0x1b')](_0x4305b9[_0x53a2('0x1c')],{'raw':_0x4305b9['options']?_0x4305b9[_0x53a2('0x1d')][_0x53a2('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x10c731){logger['info'](_0x53a2('0x19'),_0x4305b9);logger[_0x53a2('0x11')](_0x53a2('0x19'),_0x4305b9,JSON[_0x53a2('0x13')](_0x10c731));_0x1286cd(_0x10c731);})[_0x53a2('0x18')](function(_0x81d7af){logger[_0x53a2('0x14')](_0x53a2('0x19'),_0x81d7af['message'],_0x4305b9);_0x56750b(_0x20a7e5['error'](0x1f4,_0x81d7af[_0x53a2('0x16')]));});});};
\ No newline at end of file
+var _0x8dc6=['stringify','error','message','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','debug','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','socket.io-emitter','localhost','./smsMessage.socket','register','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s'];(function(_0x155542,_0x21c0f0){var _0x143ff7=function(_0x3f85e7){while(--_0x3f85e7){_0x155542['push'](_0x155542['shift']());}};_0x143ff7(++_0x21c0f0);}(_0x8dc6,0x119));var _0x68dc=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x8dc6[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x68dc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x68dc('0x1'));var rs=require(_0x68dc('0x2'));var fs=require('fs');var db=require(_0x68dc('0x3'))['db'];var utils=require(_0x68dc('0x4'));var logger=require(_0x68dc('0x5'))('rpc');var config=require(_0x68dc('0x6'));var jayson=require(_0x68dc('0x7'));var client=jayson[_0x68dc('0x8')][_0x68dc('0x9')]({'port':0x232a});var socket=require(_0x68dc('0xa'))({'host':_0x68dc('0xb'),'port':0x18eb});require(_0x68dc('0xc'))[_0x68dc('0xd')](socket);function respondWithRpcPromise(_0x1c6206,_0x5cba15,_0x440e90){return new BPromise(function(_0x3c33e7,_0x3d2bea){return client['request'](_0x1c6206,_0x440e90)[_0x68dc('0xe')](function(_0x36da50){logger[_0x68dc('0xf')](_0x68dc('0x10'),_0x5cba15,_0x68dc('0x11'));logger['debug'](_0x68dc('0x12'),_0x5cba15,_0x68dc('0x11'),JSON[_0x68dc('0x13')](_0x36da50));if(_0x36da50[_0x68dc('0x14')]){if(_0x36da50[_0x68dc('0x14')]['code']===0x1f4){logger[_0x68dc('0x14')]('SmsMessage,\x20%s,\x20%s',_0x5cba15,_0x36da50[_0x68dc('0x14')][_0x68dc('0x15')]);return _0x3d2bea(_0x36da50[_0x68dc('0x14')][_0x68dc('0x15')]);}logger[_0x68dc('0x14')](_0x68dc('0x10'),_0x5cba15,_0x36da50[_0x68dc('0x14')]['message']);return _0x3c33e7(_0x36da50[_0x68dc('0x14')]['message']);}else{logger[_0x68dc('0xf')]('SmsMessage,\x20%s,\x20%s',_0x5cba15,_0x68dc('0x11'));_0x3c33e7(_0x36da50['result'][_0x68dc('0x15')]);}})[_0x68dc('0x16')](function(_0x3f7288){logger[_0x68dc('0x14')](_0x68dc('0x10'),_0x5cba15,_0x3f7288);_0x3d2bea(_0x3f7288);});});}exports[_0x68dc('0x17')]=function(_0xe177f8){var _0x5db8df=this;return new Promise(function(_0x4cbce4,_0x352851){return db[_0x68dc('0x18')][_0x68dc('0x19')](_0xe177f8[_0x68dc('0x1a')],{'raw':_0xe177f8[_0x68dc('0x1b')]?_0xe177f8[_0x68dc('0x1b')][_0x68dc('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x2b3f7f){logger['info'](_0x68dc('0x17'),_0xe177f8);logger[_0x68dc('0x1d')]('CreateSmsMessage',_0xe177f8,JSON[_0x68dc('0x13')](_0x2b3f7f));_0x4cbce4(_0x2b3f7f);})['catch'](function(_0x346c1a){logger[_0x68dc('0x14')]('CreateSmsMessage',_0x346c1a[_0x68dc('0x15')],_0xe177f8);_0x352851(_0x5db8df[_0x68dc('0x14')](0x1f4,_0x346c1a[_0x68dc('0x15')]));});});};
\ No newline at end of file
index f14e17f..4f23bee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac03=['update','emit','removeListener','register','length','smsMessage:','./smsMessage.events','remove'];(function(_0x16fa8d,_0x3a1ca5){var _0x1948d8=function(_0x48957b){while(--_0x48957b){_0x16fa8d['push'](_0x16fa8d['shift']());}};_0x1948d8(++_0x3a1ca5);}(_0xac03,0xbe));var _0x3ac0=function(_0x6fae04,_0x33078d){_0x6fae04=_0x6fae04-0x0;var _0x546f87=_0xac03[_0x6fae04];return _0x546f87;};'use strict';var SmsMessageEvents=require(_0x3ac0('0x0'));var events=['save',_0x3ac0('0x1'),_0x3ac0('0x2')];function createListener(_0x2fd431,_0x4dfb8b){return function(_0xd01f13){_0x4dfb8b[_0x3ac0('0x3')](_0x2fd431,_0xd01f13);};}function removeListener(_0x3306ef,_0x3a4d6b){return function(){SmsMessageEvents[_0x3ac0('0x4')](_0x3306ef,_0x3a4d6b);};}exports[_0x3ac0('0x5')]=function(_0x33c0d0){for(var _0x5ea497=0x0,_0x43817b=events[_0x3ac0('0x6')];_0x5ea497<_0x43817b;_0x5ea497++){var _0x54a8e2=events[_0x5ea497];var _0xb98c8e=createListener(_0x3ac0('0x7')+_0x54a8e2,_0x33c0d0);SmsMessageEvents['on'](_0x54a8e2,_0xb98c8e);}};
\ No newline at end of file
+var _0x9af6=['register','save','remove','update','emit','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9af6,0xd9));var _0x69af=function(_0x590c95,_0x201025){_0x590c95=_0x590c95-0x0;var _0xce7cae=_0x9af6[_0x590c95];return _0xce7cae;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x69af('0x0'),_0x69af('0x1'),_0x69af('0x2')];function createListener(_0x474bd8,_0x2e35ae){return function(_0x409274){_0x2e35ae[_0x69af('0x3')](_0x474bd8,_0x409274);};}function removeListener(_0x283b32,_0x580448){return function(){SmsMessageEvents[_0x69af('0x4')](_0x283b32,_0x580448);};}exports[_0x69af('0x5')]=function(_0x108882){for(var _0x17c431=0x0,_0x426d7a=events['length'];_0x17c431<_0x426d7a;_0x17c431++){var _0x2ad352=events[_0x17c431];var _0x36905e=createListener('smsMessage:'+_0x2ad352,_0x108882);SmsMessageEvents['on'](_0x2ad352,_0x36905e);}};
\ No newline at end of file
index ee05e23..3959c37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7069=['addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','create','post'];(function(_0x5b1c50,_0x56e694){var _0x2d379b=function(_0x981b9c){while(--_0x981b9c){_0x5b1c50['push'](_0x5b1c50['shift']());}};_0x2d379b(++_0x56e694);}(_0x7069,0xf1));var _0x9706=function(_0x57cbc2,_0xe17f62){_0x57cbc2=_0x57cbc2-0x0;var _0x58141d=_0x7069[_0x57cbc2];return _0x58141d;};'use strict';var multer=require(_0x9706('0x0'));var util=require(_0x9706('0x1'));var path=require('path');var express=require(_0x9706('0x2'));var router=express[_0x9706('0x3')]();var auth=require(_0x9706('0x4'));var interaction=require(_0x9706('0x5'));var config=require(_0x9706('0x6'));var controller=require(_0x9706('0x7'));router[_0x9706('0x8')]('/',auth[_0x9706('0x9')](),controller[_0x9706('0xa')]);router[_0x9706('0x8')](_0x9706('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x9706('0x8')](_0x9706('0xc'),auth[_0x9706('0x9')](),controller[_0x9706('0xd')]);router['get']('/:id/members',auth[_0x9706('0x9')](),controller[_0x9706('0xe')]);router[_0x9706('0x8')](_0x9706('0xf'),auth['isAuthenticated'](),controller[_0x9706('0x10')]);router['get'](_0x9706('0x11'),auth[_0x9706('0x9')](),controller['getAgents']);router['post']('/',auth[_0x9706('0x9')](),controller[_0x9706('0x12')]);router[_0x9706('0x13')](_0x9706('0xf'),auth[_0x9706('0x9')](),controller[_0x9706('0x14')]);router['post']('/:id/users',auth[_0x9706('0x9')](),controller[_0x9706('0x15')]);router[_0x9706('0x16')]('/:id',auth[_0x9706('0x9')](),controller[_0x9706('0x17')]);router['delete'](_0x9706('0xc'),auth[_0x9706('0x9')](),controller[_0x9706('0x18')]);router[_0x9706('0x19')]('/:id/teams',auth[_0x9706('0x9')](),controller[_0x9706('0x1a')]);router[_0x9706('0x19')](_0x9706('0x11'),auth[_0x9706('0x9')](),controller[_0x9706('0x1b')]);module[_0x9706('0x1c')]=router;
\ No newline at end of file
+var _0xd969=['./smsQueue.controller','get','isAuthenticated','/describe','show','/:id/members','getMembers','/:id/teams','/:id/users','post','create','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','multer','util','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0xb283bf,_0x1ae47c){var _0x54ce6b=function(_0x3656e1){while(--_0x3656e1){_0xb283bf['push'](_0xb283bf['shift']());}};_0x54ce6b(++_0x1ae47c);}(_0xd969,0x95));var _0x9d96=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xd969[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0x9d96('0x0'));var util=require(_0x9d96('0x1'));var path=require(_0x9d96('0x2'));var express=require(_0x9d96('0x3'));var router=express[_0x9d96('0x4')]();var auth=require(_0x9d96('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9d96('0x6'));var controller=require(_0x9d96('0x7'));router[_0x9d96('0x8')]('/',auth[_0x9d96('0x9')](),controller['index']);router[_0x9d96('0x8')](_0x9d96('0xa'),auth[_0x9d96('0x9')](),controller['describe']);router[_0x9d96('0x8')]('/:id',auth[_0x9d96('0x9')](),controller[_0x9d96('0xb')]);router[_0x9d96('0x8')](_0x9d96('0xc'),auth['isAuthenticated'](),controller[_0x9d96('0xd')]);router[_0x9d96('0x8')](_0x9d96('0xe'),auth[_0x9d96('0x9')](),controller['getTeams']);router[_0x9d96('0x8')](_0x9d96('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0x9d96('0x10')]('/',auth['isAuthenticated'](),controller[_0x9d96('0x11')]);router['post'](_0x9d96('0xe'),auth[_0x9d96('0x9')](),controller['addTeams']);router[_0x9d96('0x10')]('/:id/users',auth[_0x9d96('0x9')](),controller[_0x9d96('0x12')]);router[_0x9d96('0x13')]('/:id',auth[_0x9d96('0x9')](),controller[_0x9d96('0x14')]);router[_0x9d96('0x15')](_0x9d96('0x16'),auth[_0x9d96('0x9')](),controller[_0x9d96('0x17')]);router[_0x9d96('0x15')]('/:id/teams',auth[_0x9d96('0x9')](),controller[_0x9d96('0x18')]);router[_0x9d96('0x15')](_0x9d96('0xf'),auth['isAuthenticated'](),controller[_0x9d96('0x19')]);module['exports']=router;
\ No newline at end of file
index aaf5d70..c6c35f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fdf=['beepall','roundrobin','exports','STRING','name','INTEGER','rrmemory'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x2fdf,0xfe));var _0xf2fd=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x2fdf[_0x2ec461];return _0x28603d;};'use strict';var Sequelize=require('sequelize');module[_0xf2fd('0x0')]={'name':{'type':Sequelize[_0xf2fd('0x1')],'unique':_0xf2fd('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf2fd('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xf2fd('0x4'),_0xf2fd('0x5'),_0xf2fd('0x6'))}};
\ No newline at end of file
+var _0x0223=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x0223,0x143));var _0x3022=function(_0x197853,_0x24487b){_0x197853=_0x197853-0x0;var _0x1cbb30=_0x0223[_0x197853];return _0x1cbb30;};'use strict';var Sequelize=require(_0x3022('0x0'));module[_0x3022('0x1')]={'name':{'type':Sequelize[_0x3022('0x2')],'unique':_0x3022('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3022('0x2')]},'timeout':{'type':Sequelize[_0x3022('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x3022('0x5'),_0x3022('0x6'),_0x3022('0x7'))}};
\ No newline at end of file
index 89c5778..efad269 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x677c=['limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','model','keys','query','dateEnd','dateStart','intersection','attributes','fields','length','order','sort','where','filters','add','day','filter','merge','map','options','SmsQueue','include','findAll','rows','catch','params','includeAll','create','body','find','describe','getMembers','UserSmsQueue','hasOwnProperty','nolimit','pick','SmsQueueId','UserId','agent','updatedAt','createdAt','format','%s/%s','smsPause','getTeams','Team','addTeams','ids','User','Agents','union','addAgents','penalty','removeTeams','omit','spread','emit','userSmsQueue:save','removeAgents','userSmsQueue:remove','getAgents','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./smsQueue.socket','sendStatus','status','end','json','count','offset'];(function(_0x3e8a36,_0x4ce673){var _0x30b097=function(_0x1f97f2){while(--_0x1f97f2){_0x3e8a36['push'](_0x3e8a36['shift']());}};_0x30b097(++_0x4ce673);}(_0x677c,0x17c));var _0xc677=function(_0x19e48b,_0x3428c7){_0x19e48b=_0x19e48b-0x0;var _0x56189b=_0x677c[_0x19e48b];return _0x56189b;};'use strict';var pdf=require(_0xc677('0x0'));var emlformat=require(_0xc677('0x1'));var rimraf=require(_0xc677('0x2'));var zipdir=require(_0xc677('0x3'));var jsonpatch=require(_0xc677('0x4'));var rp=require(_0xc677('0x5'));var moment=require(_0xc677('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xc677('0x7'));var util=require('util');var path=require(_0xc677('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xc677('0x9'));var crypto=require('crypto');var jsforce=require(_0xc677('0xa'));var deskjs=require(_0xc677('0xb'));var toCsv=require(_0xc677('0xc'));var querystring=require(_0xc677('0xd'));var Papa=require(_0xc677('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0xc677('0xf'))('api');var utils=require(_0xc677('0x10'));var config=require(_0xc677('0x11'));var db=require(_0xc677('0x12'))['db'];var socket=require(_0xc677('0x13'))({'host':_0xc677('0x14'),'port':0x18eb});require(_0xc677('0x15'))['register'](socket);function respondWithStatusCode(_0x5d5300,_0x5c7383){_0x5c7383=_0x5c7383||0xcc;return function(_0x396850){if(_0x396850){return _0x5d5300[_0xc677('0x16')](_0x5c7383);}return _0x5d5300[_0xc677('0x17')](_0x5c7383)[_0xc677('0x18')]();};}function respondWithResult(_0x500890,_0x59bc69){_0x59bc69=_0x59bc69||0xc8;return function(_0x3edb9d){if(_0x3edb9d){return _0x500890[_0xc677('0x17')](_0x59bc69)[_0xc677('0x19')](_0x3edb9d);}};}function respondWithFilteredResult(_0x5a5bac,_0x3545e1){return function(_0x3195e3){if(_0x3195e3){var _0x3d0ef7=_0x3195e3[_0xc677('0x1a')],_0x548001=_0x3545e1[_0xc677('0x1b')],_0x6b0f64=_0x3545e1['offset']+_0x3545e1[_0xc677('0x1c')],_0x1fdda1;if(_0x6b0f64>=_0x3d0ef7){_0x6b0f64=_0x3d0ef7;_0x1fdda1=0xc8;}else{_0x1fdda1=0xce;}_0x5a5bac[_0xc677('0x17')](_0x1fdda1);return _0x5a5bac[_0xc677('0x1d')](_0xc677('0x1e'),_0x548001+'-'+_0x6b0f64+'/'+_0x3d0ef7)[_0xc677('0x19')](_0x3195e3);}return null;};}function patchUpdates(_0x530ce3){return function(_0x2c7f1c){try{jsonpatch[_0xc677('0x1f')](_0x2c7f1c,_0x530ce3,!![]);}catch(_0x5d6430){return BPromise[_0xc677('0x20')](_0x5d6430);}return _0x2c7f1c[_0xc677('0x21')]();};}function saveUpdates(_0x12155b,_0x2b1b01){return function(_0xa083f7){if(_0xa083f7){return _0xa083f7[_0xc677('0x22')](_0x12155b)[_0xc677('0x23')](function(_0x17de29){return _0x17de29;});}return null;};}function removeEntity(_0x211eb4,_0x5e91a8){return function(_0x2ff598){if(_0x2ff598){return _0x2ff598[_0xc677('0x24')]()['then'](function(){_0x211eb4[_0xc677('0x17')](0xcc)[_0xc677('0x18')]();});}};}function handleEntityNotFound(_0x34fff3,_0x56bfa3){return function(_0x54a507){if(!_0x54a507){_0x34fff3[_0xc677('0x16')](0x194);}return _0x54a507;};}function handleError(_0xc3970a,_0x917954){_0x917954=_0x917954||0x1f4;return function(_0x56a7bb){logger[_0xc677('0x25')](_0x56a7bb['stack']);if(_0x56a7bb['name']){delete _0x56a7bb[_0xc677('0x26')];}_0xc3970a['status'](_0x917954)['send'](_0x56a7bb);};}exports[_0xc677('0x27')]=function(_0x13e6b3,_0x1229e9){var _0x3582db={},_0x542c9b={},_0x1139ed={'count':0x0,'rows':[]};var _0x32be0e=db['SmsQueue'][_0xc677('0x28')];_0x542c9b[_0xc677('0x29')]=_[_0xc677('0x2a')](_0x32be0e);var _0x2c859b={'dateStart':_0x13e6b3[_0xc677('0x2b')]['dateStart'],'dateEnd':_0x13e6b3['query'][_0xc677('0x2c')]};delete _0x13e6b3['query'][_0xc677('0x2d')];delete _0x13e6b3[_0xc677('0x2b')]['dateEnd'];_0x542c9b['query']=_['keys'](_0x13e6b3[_0xc677('0x2b')]);_0x542c9b['filters']=_[_0xc677('0x2e')](_0x542c9b[_0xc677('0x29')],_0x542c9b[_0xc677('0x2b')]);_0x3582db[_0xc677('0x2f')]=_['intersection'](_0x542c9b[_0xc677('0x29')],qs[_0xc677('0x30')](_0x13e6b3[_0xc677('0x2b')][_0xc677('0x30')]));_0x3582db[_0xc677('0x2f')]=_0x3582db[_0xc677('0x2f')][_0xc677('0x31')]?_0x3582db['attributes']:_0x542c9b['model'];if(!_0x13e6b3[_0xc677('0x2b')]['hasOwnProperty']('nolimit')){_0x3582db[_0xc677('0x1c')]=qs[_0xc677('0x1c')](_0x13e6b3['query']['limit']);_0x3582db[_0xc677('0x1b')]=qs[_0xc677('0x1b')](_0x13e6b3['query'][_0xc677('0x1b')]);}_0x3582db[_0xc677('0x32')]=qs['sort'](_0x13e6b3[_0xc677('0x2b')][_0xc677('0x33')]);_0x3582db[_0xc677('0x34')]=qs[_0xc677('0x35')](_['pick'](_0x13e6b3[_0xc677('0x2b')],_0x542c9b[_0xc677('0x35')]));if(_0x2c859b['dateStart']){if(_0x2c859b[_0xc677('0x2c')]){_0x2c859b['dateEnd']=moment(_0x2c859b[_0xc677('0x2c')])[_0xc677('0x36')](0x1,'day');}else{_0x2c859b[_0xc677('0x2c')]=moment(_0x2c859b[_0xc677('0x2d')])['add'](0x1,_0xc677('0x37'));}_['merge'](_0x3582db['where'],{'createdAt':{'$gte':_0x2c859b[_0xc677('0x2d')],'$lte':_0x2c859b['dateEnd']}});}if(_0x13e6b3[_0xc677('0x2b')][_0xc677('0x38')]){_0x3582db[_0xc677('0x34')]=_[_0xc677('0x39')](_0x3582db[_0xc677('0x34')],{'$or':_[_0xc677('0x3a')](_0x3582db[_0xc677('0x2f')],function(_0x3b397d){var _0x116bfc={};_0x116bfc[_0x3b397d]={'$like':'%'+_0x13e6b3[_0xc677('0x2b')][_0xc677('0x38')]+'%'};return _0x116bfc;})});}_0x3582db=_[_0xc677('0x39')]({},_0x3582db,_0x13e6b3[_0xc677('0x3b')]);var _0x334925={'where':_0x3582db[_0xc677('0x34')]};return db[_0xc677('0x3c')][_0xc677('0x1a')](_0x334925)['then'](function(_0x2db75b){_0x1139ed[_0xc677('0x1a')]=_0x2db75b;if(_0x13e6b3[_0xc677('0x2b')]['includeAll']){_0x3582db[_0xc677('0x3d')]=[{'all':!![]}];}return db['SmsQueue'][_0xc677('0x3e')](_0x3582db);})['then'](function(_0xa171a8){_0x1139ed[_0xc677('0x3f')]=_0xa171a8;return _0x1139ed;})[_0xc677('0x23')](respondWithFilteredResult(_0x1229e9,_0x3582db))[_0xc677('0x40')](handleError(_0x1229e9,null));};exports['show']=function(_0x287a4b,_0xf2bc2f){var _0x36f7f0={'raw':!![],'where':{'id':_0x287a4b[_0xc677('0x41')]['id']}},_0x3af8cb={};_0x3af8cb['model']=_[_0xc677('0x2a')](db[_0xc677('0x3c')][_0xc677('0x28')]);_0x3af8cb[_0xc677('0x2b')]=_[_0xc677('0x2a')](_0x287a4b[_0xc677('0x2b')]);_0x3af8cb[_0xc677('0x35')]=_[_0xc677('0x2e')](_0x3af8cb['model'],_0x3af8cb[_0xc677('0x2b')]);_0x36f7f0[_0xc677('0x2f')]=_[_0xc677('0x2e')](_0x3af8cb[_0xc677('0x29')],qs[_0xc677('0x30')](_0x287a4b[_0xc677('0x2b')]['fields']));_0x36f7f0[_0xc677('0x2f')]=_0x36f7f0[_0xc677('0x2f')][_0xc677('0x31')]?_0x36f7f0[_0xc677('0x2f')]:_0x3af8cb[_0xc677('0x29')];if(_0x287a4b[_0xc677('0x2b')][_0xc677('0x42')]){_0x36f7f0[_0xc677('0x3d')]=[{'all':!![]}];}_0x36f7f0=_['merge']({},_0x36f7f0,_0x287a4b[_0xc677('0x3b')]);return db[_0xc677('0x3c')]['find'](_0x36f7f0)[_0xc677('0x23')](handleEntityNotFound(_0xf2bc2f,null))[_0xc677('0x23')](respondWithResult(_0xf2bc2f,null))[_0xc677('0x40')](handleError(_0xf2bc2f,null));};exports[_0xc677('0x43')]=function(_0x544cb3,_0x363fbf){return db[_0xc677('0x3c')][_0xc677('0x43')](_0x544cb3[_0xc677('0x44')],{})['then'](respondWithResult(_0x363fbf,0xc9))[_0xc677('0x40')](handleError(_0x363fbf,null));};exports['update']=function(_0x914a93,_0x449401){if(_0x914a93[_0xc677('0x44')]['id']){delete _0x914a93[_0xc677('0x44')]['id'];}return db[_0xc677('0x3c')]['find']({'where':{'id':_0x914a93['params']['id']}})[_0xc677('0x23')](handleEntityNotFound(_0x449401,null))[_0xc677('0x23')](saveUpdates(_0x914a93[_0xc677('0x44')],null))[_0xc677('0x23')](respondWithResult(_0x449401,null))[_0xc677('0x40')](handleError(_0x449401,null));};exports['destroy']=function(_0x4737f5,_0xa85228){return db[_0xc677('0x3c')][_0xc677('0x45')]({'where':{'id':_0x4737f5[_0xc677('0x41')]['id']}})['then'](handleEntityNotFound(_0xa85228,null))[_0xc677('0x23')](removeEntity(_0xa85228,null))[_0xc677('0x40')](handleError(_0xa85228,null));};exports[_0xc677('0x46')]=function(_0x4ce1bb,_0x4a06ad){return db[_0xc677('0x3c')][_0xc677('0x46')]()[_0xc677('0x23')](respondWithResult(_0x4a06ad,null))[_0xc677('0x40')](handleError(_0x4a06ad,null));};exports[_0xc677('0x47')]=function(_0x32ee11,_0x46d864,_0x5d2f6f){var _0x2af9a7={'raw':!![],'where':{}},_0x532a1d={},_0x58fcfe;return db['SmsQueue']['findOne']({'where':{'id':_0x32ee11[_0xc677('0x41')]['id']}})[_0xc677('0x23')](handleEntityNotFound(_0x46d864,null))[_0xc677('0x23')](function(_0x2d4a2c){if(_0x2d4a2c){_0x58fcfe=_0x2d4a2c['get']({'plain':!![]});_0x532a1d['model']=_[_0xc677('0x2a')](db[_0xc677('0x48')][_0xc677('0x28')]);_0x532a1d[_0xc677('0x2b')]=_[_0xc677('0x2a')](_0x32ee11[_0xc677('0x2b')]);_0x532a1d[_0xc677('0x35')]=_[_0xc677('0x2e')](_0x532a1d[_0xc677('0x29')],_0x532a1d['query']);_0x2af9a7[_0xc677('0x2f')]=_[_0xc677('0x2e')](_0x532a1d[_0xc677('0x29')],qs[_0xc677('0x30')](_0x32ee11[_0xc677('0x2b')][_0xc677('0x30')]));_0x2af9a7[_0xc677('0x2f')]=_0x2af9a7[_0xc677('0x2f')][_0xc677('0x31')]?_0x2af9a7[_0xc677('0x2f')]:_0x532a1d[_0xc677('0x29')];if(!_0x32ee11[_0xc677('0x2b')][_0xc677('0x49')](_0xc677('0x4a'))){_0x2af9a7[_0xc677('0x1c')]=qs[_0xc677('0x1c')](_0x32ee11[_0xc677('0x2b')][_0xc677('0x1c')]);_0x2af9a7[_0xc677('0x1b')]=qs[_0xc677('0x1b')](_0x32ee11[_0xc677('0x2b')][_0xc677('0x1b')]);}_0x2af9a7[_0xc677('0x32')]=qs[_0xc677('0x33')](_0x32ee11[_0xc677('0x2b')][_0xc677('0x33')]);_0x2af9a7[_0xc677('0x34')]=qs[_0xc677('0x35')](_[_0xc677('0x4b')](_0x32ee11[_0xc677('0x2b')],_0x532a1d[_0xc677('0x35')]));_0x2af9a7['where'][_0xc677('0x4c')]=_0x2d4a2c['id'];if(_0x32ee11[_0xc677('0x2b')][_0xc677('0x38')]){_0x2af9a7['where']=_[_0xc677('0x39')](_0x2af9a7[_0xc677('0x34')],{'$or':_[_0xc677('0x3a')](_0x2af9a7[_0xc677('0x2f')],function(_0x350127){var _0x41ba62={};_0x41ba62[_0x350127]={'$like':'%'+_0x32ee11['query'][_0xc677('0x38')]+'%'};return _0x41ba62;})});}_0x2af9a7=_[_0xc677('0x39')]({},_0x2af9a7,_0x32ee11[_0xc677('0x3b')]);return db[_0xc677('0x48')][_0xc677('0x3e')](_0x2af9a7);}})[_0xc677('0x23')](function(_0x50624f){if(_0x50624f){return db['User']['findAndCountAll']({'where':{'id':_[_0xc677('0x3a')](_0x50624f,_0xc677('0x4d')),'role':_0xc677('0x4e')},'attributes':['id','name','smsPause',_0xc677('0x4f'),_0xc677('0x50')]});}})['then'](function(_0x51cab4){if(_0x51cab4){return{'count':_0x51cab4[_0xc677('0x1a')],'rows':_[_0xc677('0x3a')](_0x51cab4[_0xc677('0x3f')],function(_0x12d821){return{'membername':_0x12d821[_0xc677('0x26')],'UserId':_0x12d821['id'],'queue_name':_0x58fcfe['name'],'SmsQueueId':_0x58fcfe['id'],'interface':util[_0xc677('0x51')](_0xc677('0x52'),'SIP',_0x12d821[_0xc677('0x26')]),'penalty':0x0,'paused':_0x12d821[_0xc677('0x53')],'createdAt':_0x12d821[_0xc677('0x50')],'updatedAt':_0x12d821[_0xc677('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc677('0x23')](respondWithFilteredResult(_0x46d864,_0x2af9a7))[_0xc677('0x40')](handleError(_0x46d864,null));};exports[_0xc677('0x54')]=function(_0x4556d3,_0x5235db,_0x592e58){var _0x13ae32={};var _0x5d2c40={};var _0x19792c;var _0x180566;return db[_0xc677('0x3c')]['findOne']({'where':{'id':_0x4556d3['params']['id']}})[_0xc677('0x23')](handleEntityNotFound(_0x5235db,null))[_0xc677('0x23')](function(_0x1c2b9b){if(_0x1c2b9b){_0x19792c=_0x1c2b9b;_0x5d2c40['model']=_[_0xc677('0x2a')](db[_0xc677('0x55')][_0xc677('0x28')]);_0x5d2c40['query']=_[_0xc677('0x2a')](_0x4556d3[_0xc677('0x2b')]);_0x5d2c40[_0xc677('0x35')]=_[_0xc677('0x2e')](_0x5d2c40[_0xc677('0x29')],_0x5d2c40[_0xc677('0x2b')]);_0x13ae32[_0xc677('0x2f')]=_[_0xc677('0x2e')](_0x5d2c40[_0xc677('0x29')],qs['fields'](_0x4556d3['query']['fields']));_0x13ae32[_0xc677('0x2f')]=_0x13ae32[_0xc677('0x2f')]['length']?_0x13ae32[_0xc677('0x2f')]:_0x5d2c40[_0xc677('0x29')];_0x13ae32[_0xc677('0x32')]=qs[_0xc677('0x33')](_0x4556d3[_0xc677('0x2b')][_0xc677('0x33')]);_0x13ae32[_0xc677('0x34')]=qs['filters'](_[_0xc677('0x4b')](_0x4556d3[_0xc677('0x2b')],_0x5d2c40[_0xc677('0x35')]));if(_0x4556d3['query'][_0xc677('0x38')]){_0x13ae32[_0xc677('0x34')]=_['merge'](_0x13ae32['where'],{'$or':_['map'](_0x13ae32[_0xc677('0x2f')],function(_0x1a9349){var _0x17469f={};_0x17469f[_0x1a9349]={'$like':'%'+_0x4556d3[_0xc677('0x2b')][_0xc677('0x38')]+'%'};return _0x17469f;})});}_0x13ae32=_[_0xc677('0x39')]({},_0x13ae32,_0x4556d3[_0xc677('0x3b')]);return _0x19792c['getTeams'](_0x13ae32);}})[_0xc677('0x23')](function(_0x70cb01){if(_0x70cb01){_0x180566=_0x70cb01[_0xc677('0x31')];if(!_0x4556d3['query']['hasOwnProperty'](_0xc677('0x4a'))){_0x13ae32[_0xc677('0x1c')]=qs[_0xc677('0x1c')](_0x4556d3['query'][_0xc677('0x1c')]);_0x13ae32['offset']=qs[_0xc677('0x1b')](_0x4556d3[_0xc677('0x2b')][_0xc677('0x1b')]);}return _0x19792c[_0xc677('0x54')](_0x13ae32);}})[_0xc677('0x23')](function(_0x48d406){if(_0x48d406){return _0x48d406?{'count':_0x180566,'rows':_0x48d406}:null;}})[_0xc677('0x23')](respondWithResult(_0x5235db,null))[_0xc677('0x40')](handleError(_0x5235db,null));};exports[_0xc677('0x56')]=function(_0x492015,_0x3c508b,_0x1c1b15){var _0x245513=[];var _0x27970f;return db[_0xc677('0x55')][_0xc677('0x3e')]({'where':{'id':_0x492015['body'][_0xc677('0x57')]},'attributes':['id'],'include':[{'model':db[_0xc677('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc677('0x23')](function(_0x479c6e){if(_0x479c6e){for(var _0x27d90b=0x0;_0x27d90b<_0x479c6e['length'];_0x27d90b+=0x1){for(var _0x5bf56c=0x0;_0x5bf56c<_0x479c6e[_0x27d90b][_0xc677('0x59')][_0xc677('0x31')];_0x5bf56c+=0x1){_0x245513=_[_0xc677('0x5a')](_0x245513,[_0x479c6e[_0x27d90b]['Agents'][_0x5bf56c]['id']]);}}return _0x245513;}})[_0xc677('0x23')](function(_0x118039){if(_0x118039){return db[_0xc677('0x3c')][_0xc677('0x45')]({'where':{'id':_0x492015[_0xc677('0x41')]['id']}});}})['then'](function(_0x3c83f1){if(_0x3c83f1){_0x27970f=_0x3c83f1;return _0x27970f[_0xc677('0x5b')](_0x245513,{'penalty':_0x492015[_0xc677('0x44')][_0xc677('0x5c')]});}})[_0xc677('0x23')](function(_0x353bdd){if(_0x353bdd){return _0x27970f['addTeams'](_0x492015[_0xc677('0x44')][_0xc677('0x57')]);}})['then'](handleEntityNotFound(_0x3c508b,null))[_0xc677('0x23')](respondWithStatusCode(_0x3c508b,null))[_0xc677('0x40')](handleError(_0x3c508b,null));};exports[_0xc677('0x5d')]=function(_0xc58e62,_0x213add,_0x3cf039){var _0xc44476=[];var _0x5060a7;return db[_0xc677('0x55')]['findAll']({'where':{'id':_0xc58e62[_0xc677('0x2b')]['ids']},'attributes':['id'],'include':[{'model':db[_0xc677('0x58')],'as':_0xc677('0x59'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x25c4ca){if(_0x25c4ca){for(var _0x284159=0x0;_0x284159<_0x25c4ca[_0xc677('0x31')];_0x284159+=0x1){for(var _0x412ff7=0x0;_0x412ff7<_0x25c4ca[_0x284159][_0xc677('0x59')][_0xc677('0x31')];_0x412ff7+=0x1){_0xc44476=_['union'](_0xc44476,[_0x25c4ca[_0x284159][_0xc677('0x59')][_0x412ff7]['id']]);}}return _0xc44476;}})[_0xc677('0x23')](function(_0x44d821){if(_0x44d821){return db['SmsQueue']['find']({'where':{'id':_0xc58e62[_0xc677('0x41')]['id']}});}})['then'](function(_0x1177b5){if(_0x1177b5){_0x5060a7=_0x1177b5;return _0x5060a7['removeAgents'](_0xc44476);}})[_0xc677('0x23')](function(_0x2db155){if(_0x5060a7){return _0x5060a7[_0xc677('0x5d')](_0xc58e62[_0xc677('0x2b')]['ids']);}})[_0xc677('0x23')](handleEntityNotFound(_0x213add,null))[_0xc677('0x23')](respondWithStatusCode(_0x213add,null))[_0xc677('0x40')](handleError(_0x213add,null));};exports['addAgents']=function(_0x2e6e48,_0x3f1250,_0x13f0c0){return db[_0xc677('0x3c')]['find']({'where':{'id':_0x2e6e48['params']['id']}})[_0xc677('0x23')](handleEntityNotFound(_0x3f1250,null))[_0xc677('0x23')](function(_0x1a12c9){if(_0x1a12c9){return _0x1a12c9[_0xc677('0x5b')](_0x2e6e48[_0xc677('0x44')][_0xc677('0x57')],_[_0xc677('0x5e')](_0x2e6e48[_0xc677('0x44')],['ids','id'])||{})[_0xc677('0x5f')](function(_0x57f05f){for(var _0x365e2c=0x0;_0x365e2c<_0x2e6e48[_0xc677('0x44')][_0xc677('0x57')][_0xc677('0x31')];_0x365e2c+=0x1){socket[_0xc677('0x60')](_0xc677('0x61'),{'UserId':_0x2e6e48[_0xc677('0x44')][_0xc677('0x57')][_0x365e2c],'SmsQueueId':_0x2e6e48[_0xc677('0x41')]['id']});}return _0x57f05f;});}})[_0xc677('0x23')](respondWithResult(_0x3f1250,null))[_0xc677('0x40')](handleError(_0x3f1250,null));};exports[_0xc677('0x62')]=function(_0x2ed7ec,_0x5c10f4,_0x37a3a7){var _0x2e10f5;return db[_0xc677('0x3c')][_0xc677('0x45')]({'where':{'id':_0x2ed7ec[_0xc677('0x41')]['id']}})[_0xc677('0x23')](handleEntityNotFound(_0x5c10f4,null))['then'](function(_0x3bcb9e){if(_0x3bcb9e){return _0x3bcb9e[_0xc677('0x62')](_0x2ed7ec[_0xc677('0x2b')][_0xc677('0x57')])[_0xc677('0x23')](function(_0x1bcaeb){if(_['isArray'](_0x2ed7ec['query'][_0xc677('0x57')])){for(var _0x40a8f4=0x0;_0x40a8f4<_0x2ed7ec[_0xc677('0x2b')][_0xc677('0x57')][_0xc677('0x31')];_0x40a8f4+=0x1){socket['emit'](_0xc677('0x63'),{'UserId':_0x2ed7ec[_0xc677('0x2b')]['ids'][_0x40a8f4],'SmsQueueId':_0x2ed7ec['params']['id']});}}else{socket['emit'](_0xc677('0x63'),{'UserId':_0x2ed7ec[_0xc677('0x2b')]['ids'],'SmsQueueId':_0x2ed7ec[_0xc677('0x41')]['id']});}});}})[_0xc677('0x23')](respondWithStatusCode(_0x5c10f4,null))[_0xc677('0x40')](handleError(_0x5c10f4,null));};exports[_0xc677('0x64')]=function(_0x55aba9,_0x7e6430,_0x314210){var _0x4e388={};var _0xccf3d9={};var _0x4ff15b;var _0x5c6218;return db[_0xc677('0x3c')][_0xc677('0x65')]({'where':{'id':_0x55aba9['params']['id']}})[_0xc677('0x23')](handleEntityNotFound(_0x7e6430,null))[_0xc677('0x23')](function(_0x1b7361){if(_0x1b7361){_0x4ff15b=_0x1b7361;_0xccf3d9[_0xc677('0x29')]=_[_0xc677('0x2a')](db[_0xc677('0x58')]['rawAttributes']);_0xccf3d9['query']=_[_0xc677('0x2a')](_0x55aba9[_0xc677('0x2b')]);_0xccf3d9[_0xc677('0x35')]=_['intersection'](_0xccf3d9[_0xc677('0x29')],_0xccf3d9['query']);_0x4e388[_0xc677('0x2f')]=_[_0xc677('0x2e')](_0xccf3d9[_0xc677('0x29')],qs[_0xc677('0x30')](_0x55aba9[_0xc677('0x2b')][_0xc677('0x30')]));_0x4e388[_0xc677('0x2f')]=_0x4e388[_0xc677('0x2f')][_0xc677('0x31')]?_0x4e388[_0xc677('0x2f')]:_0xccf3d9[_0xc677('0x29')];_0x4e388[_0xc677('0x32')]=qs[_0xc677('0x33')](_0x55aba9[_0xc677('0x2b')][_0xc677('0x33')]);_0x4e388['where']=qs[_0xc677('0x35')](_['pick'](_0x55aba9[_0xc677('0x2b')],_0xccf3d9[_0xc677('0x35')]));if(_0x55aba9[_0xc677('0x2b')][_0xc677('0x38')]){_0x4e388[_0xc677('0x34')]=_[_0xc677('0x39')](_0x4e388[_0xc677('0x34')],{'$or':_[_0xc677('0x3a')](_0x4e388['attributes'],function(_0x3770c8){var _0x2777d6={};_0x2777d6[_0x3770c8]={'$like':'%'+_0x55aba9[_0xc677('0x2b')][_0xc677('0x38')]+'%'};return _0x2777d6;})});}_0x4e388=_[_0xc677('0x39')]({},_0x4e388,_0x55aba9['options']);return _0x4ff15b['getAgents'](_0x4e388);}})[_0xc677('0x23')](function(_0x20d458){if(_0x20d458){_0x5c6218=_0x20d458['length'];if(!_0x55aba9[_0xc677('0x2b')]['hasOwnProperty'](_0xc677('0x4a'))){_0x4e388[_0xc677('0x1c')]=qs[_0xc677('0x1c')](_0x55aba9['query'][_0xc677('0x1c')]);_0x4e388['offset']=qs[_0xc677('0x1b')](_0x55aba9[_0xc677('0x2b')][_0xc677('0x1b')]);}return _0x4ff15b[_0xc677('0x64')](_0x4e388);}})[_0xc677('0x23')](function(_0x49bc20){if(_0x49bc20){return _0x49bc20?{'count':_0x5c6218,'rows':_0x49bc20}:null;}})[_0xc677('0x23')](respondWithResult(_0x7e6430,null))[_0xc677('0x40')](handleError(_0x7e6430,null));};
\ No newline at end of file
+var _0xcd40=['util','sox','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','socket.io-emitter','localhost','./smsQueue.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','rawAttributes','query','dateStart','dateEnd','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','add','day','merge','map','filter','options','includeAll','include','findAll','catch','show','params','keys','SmsQueue','model','find','create','body','describe','getMembers','get','pick','SmsQueueId','User','UserId','agent','smsPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','addTeams','ids','Agents','union','penalty','removeTeams','removeAgents','addAgents','omit','spread','emit','userSmsQueue:save','userSmsQueue:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcd40,0x198));var _0x0cd4=function(_0x554f90,_0x1636be){_0x554f90=_0x554f90-0x0;var _0xea51a2=_0xcd40[_0x554f90];return _0xea51a2;};'use strict';var pdf=require(_0x0cd4('0x0'));var emlformat=require(_0x0cd4('0x1'));var rimraf=require(_0x0cd4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0cd4('0x3'));var rp=require(_0x0cd4('0x4'));var moment=require(_0x0cd4('0x5'));var BPromise=require(_0x0cd4('0x6'));var Mustache=require(_0x0cd4('0x7'));var util=require(_0x0cd4('0x8'));var path=require('path');var sox=require(_0x0cd4('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0cd4('0xa'));var squel=require(_0x0cd4('0xb'));var crypto=require('crypto');var jsforce=require(_0x0cd4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0cd4('0xd'));var querystring=require(_0x0cd4('0xe'));var Papa=require(_0x0cd4('0xf'));var qs=require(_0x0cd4('0x10'));var logger=require('../../config/logger')(_0x0cd4('0x11'));var utils=require(_0x0cd4('0x12'));var config=require(_0x0cd4('0x13'));var db=require('../../mysqldb')['db'];var socket=require(_0x0cd4('0x14'))({'host':_0x0cd4('0x15'),'port':0x18eb});require(_0x0cd4('0x16'))[_0x0cd4('0x17')](socket);function respondWithStatusCode(_0x341dad,_0x13b3ba){_0x13b3ba=_0x13b3ba||0xcc;return function(_0x519256){if(_0x519256){return _0x341dad[_0x0cd4('0x18')](_0x13b3ba);}return _0x341dad[_0x0cd4('0x19')](_0x13b3ba)['end']();};}function respondWithResult(_0x3e5928,_0x492a00){_0x492a00=_0x492a00||0xc8;return function(_0x10a164){if(_0x10a164){return _0x3e5928[_0x0cd4('0x19')](_0x492a00)[_0x0cd4('0x1a')](_0x10a164);}};}function respondWithFilteredResult(_0x4b88b2,_0x154807){return function(_0x5c0079){if(_0x5c0079){var _0x509261=_0x5c0079[_0x0cd4('0x1b')],_0x49142a=_0x154807[_0x0cd4('0x1c')],_0x3606be=_0x154807[_0x0cd4('0x1c')]+_0x154807[_0x0cd4('0x1d')],_0x41dd79;if(_0x3606be>=_0x509261){_0x3606be=_0x509261;_0x41dd79=0xc8;}else{_0x41dd79=0xce;}_0x4b88b2[_0x0cd4('0x19')](_0x41dd79);return _0x4b88b2[_0x0cd4('0x1e')](_0x0cd4('0x1f'),_0x49142a+'-'+_0x3606be+'/'+_0x509261)[_0x0cd4('0x1a')](_0x5c0079);}return null;};}function patchUpdates(_0x375c62){return function(_0x3edc0f){try{jsonpatch[_0x0cd4('0x20')](_0x3edc0f,_0x375c62,!![]);}catch(_0x1ac7b2){return BPromise[_0x0cd4('0x21')](_0x1ac7b2);}return _0x3edc0f['save']();};}function saveUpdates(_0x31df49,_0x257a37){return function(_0x491003){if(_0x491003){return _0x491003[_0x0cd4('0x22')](_0x31df49)[_0x0cd4('0x23')](function(_0x506e30){return _0x506e30;});}return null;};}function removeEntity(_0x4b07f0,_0x3fe6be){return function(_0x13ad45){if(_0x13ad45){return _0x13ad45[_0x0cd4('0x24')]()['then'](function(){_0x4b07f0[_0x0cd4('0x19')](0xcc)[_0x0cd4('0x25')]();});}};}function handleEntityNotFound(_0x50dd41,_0x3e23fd){return function(_0xcfc5b7){if(!_0xcfc5b7){_0x50dd41[_0x0cd4('0x18')](0x194);}return _0xcfc5b7;};}function handleError(_0x1601dc,_0x1b5513){_0x1b5513=_0x1b5513||0x1f4;return function(_0x288d2c){logger['error'](_0x288d2c[_0x0cd4('0x26')]);if(_0x288d2c['name']){delete _0x288d2c[_0x0cd4('0x27')];}_0x1601dc[_0x0cd4('0x19')](_0x1b5513)[_0x0cd4('0x28')](_0x288d2c);};}exports[_0x0cd4('0x29')]=function(_0x3174ba,_0x2283b6){var _0x29065c={},_0x5c2aab={},_0x211456={'count':0x0,'rows':[]};var _0x13b8cd=db['SmsQueue'][_0x0cd4('0x2a')];_0x5c2aab['model']=_['keys'](_0x13b8cd);var _0x2ed4ca={'dateStart':_0x3174ba[_0x0cd4('0x2b')][_0x0cd4('0x2c')],'dateEnd':_0x3174ba[_0x0cd4('0x2b')][_0x0cd4('0x2d')]};delete _0x3174ba[_0x0cd4('0x2b')]['dateStart'];delete _0x3174ba[_0x0cd4('0x2b')]['dateEnd'];_0x5c2aab[_0x0cd4('0x2b')]=_['keys'](_0x3174ba['query']);_0x5c2aab[_0x0cd4('0x2e')]=_['intersection'](_0x5c2aab['model'],_0x5c2aab[_0x0cd4('0x2b')]);_0x29065c[_0x0cd4('0x2f')]=_[_0x0cd4('0x30')](_0x5c2aab['model'],qs['fields'](_0x3174ba['query'][_0x0cd4('0x31')]));_0x29065c['attributes']=_0x29065c[_0x0cd4('0x2f')][_0x0cd4('0x32')]?_0x29065c[_0x0cd4('0x2f')]:_0x5c2aab['model'];if(!_0x3174ba[_0x0cd4('0x2b')][_0x0cd4('0x33')](_0x0cd4('0x34'))){_0x29065c['limit']=qs[_0x0cd4('0x1d')](_0x3174ba['query'][_0x0cd4('0x1d')]);_0x29065c['offset']=qs[_0x0cd4('0x1c')](_0x3174ba['query'][_0x0cd4('0x1c')]);}_0x29065c[_0x0cd4('0x35')]=qs[_0x0cd4('0x36')](_0x3174ba[_0x0cd4('0x2b')]['sort']);_0x29065c[_0x0cd4('0x37')]=qs['filters'](_['pick'](_0x3174ba['query'],_0x5c2aab[_0x0cd4('0x2e')]));if(_0x2ed4ca[_0x0cd4('0x2c')]){if(_0x2ed4ca['dateEnd']){_0x2ed4ca['dateEnd']=moment(_0x2ed4ca['dateEnd'])[_0x0cd4('0x38')](0x1,_0x0cd4('0x39'));}else{_0x2ed4ca[_0x0cd4('0x2d')]=moment(_0x2ed4ca[_0x0cd4('0x2c')])['add'](0x1,'day');}_[_0x0cd4('0x3a')](_0x29065c[_0x0cd4('0x37')],{'createdAt':{'$gte':_0x2ed4ca[_0x0cd4('0x2c')],'$lte':_0x2ed4ca['dateEnd']}});}if(_0x3174ba[_0x0cd4('0x2b')]['filter']){_0x29065c[_0x0cd4('0x37')]=_[_0x0cd4('0x3a')](_0x29065c['where'],{'$or':_[_0x0cd4('0x3b')](_0x29065c[_0x0cd4('0x2f')],function(_0x3b0a1e){var _0x5977e3={};_0x5977e3[_0x3b0a1e]={'$like':'%'+_0x3174ba['query'][_0x0cd4('0x3c')]+'%'};return _0x5977e3;})});}_0x29065c=_[_0x0cd4('0x3a')]({},_0x29065c,_0x3174ba[_0x0cd4('0x3d')]);var _0x46dc63={'where':_0x29065c[_0x0cd4('0x37')]};return db['SmsQueue']['count'](_0x46dc63)[_0x0cd4('0x23')](function(_0x3689ec){_0x211456['count']=_0x3689ec;if(_0x3174ba['query'][_0x0cd4('0x3e')]){_0x29065c[_0x0cd4('0x3f')]=[{'all':!![]}];}return db['SmsQueue'][_0x0cd4('0x40')](_0x29065c);})['then'](function(_0x36b0ad){_0x211456['rows']=_0x36b0ad;return _0x211456;})[_0x0cd4('0x23')](respondWithFilteredResult(_0x2283b6,_0x29065c))[_0x0cd4('0x41')](handleError(_0x2283b6,null));};exports[_0x0cd4('0x42')]=function(_0x38f79e,_0x24974f){var _0x4b7b15={'raw':!![],'where':{'id':_0x38f79e[_0x0cd4('0x43')]['id']}},_0x23e581={};_0x23e581['model']=_[_0x0cd4('0x44')](db[_0x0cd4('0x45')]['rawAttributes']);_0x23e581['query']=_[_0x0cd4('0x44')](_0x38f79e['query']);_0x23e581[_0x0cd4('0x2e')]=_[_0x0cd4('0x30')](_0x23e581['model'],_0x23e581[_0x0cd4('0x2b')]);_0x4b7b15['attributes']=_[_0x0cd4('0x30')](_0x23e581[_0x0cd4('0x46')],qs[_0x0cd4('0x31')](_0x38f79e[_0x0cd4('0x2b')][_0x0cd4('0x31')]));_0x4b7b15[_0x0cd4('0x2f')]=_0x4b7b15['attributes'][_0x0cd4('0x32')]?_0x4b7b15[_0x0cd4('0x2f')]:_0x23e581[_0x0cd4('0x46')];if(_0x38f79e['query'][_0x0cd4('0x3e')]){_0x4b7b15[_0x0cd4('0x3f')]=[{'all':!![]}];}_0x4b7b15=_[_0x0cd4('0x3a')]({},_0x4b7b15,_0x38f79e['options']);return db['SmsQueue'][_0x0cd4('0x47')](_0x4b7b15)['then'](handleEntityNotFound(_0x24974f,null))[_0x0cd4('0x23')](respondWithResult(_0x24974f,null))['catch'](handleError(_0x24974f,null));};exports[_0x0cd4('0x48')]=function(_0xf7af0,_0x234653){return db[_0x0cd4('0x45')][_0x0cd4('0x48')](_0xf7af0[_0x0cd4('0x49')],{})[_0x0cd4('0x23')](respondWithResult(_0x234653,0xc9))[_0x0cd4('0x41')](handleError(_0x234653,null));};exports[_0x0cd4('0x22')]=function(_0xa11d8e,_0x226fde){if(_0xa11d8e['body']['id']){delete _0xa11d8e[_0x0cd4('0x49')]['id'];}return db[_0x0cd4('0x45')][_0x0cd4('0x47')]({'where':{'id':_0xa11d8e['params']['id']}})[_0x0cd4('0x23')](handleEntityNotFound(_0x226fde,null))[_0x0cd4('0x23')](saveUpdates(_0xa11d8e['body'],null))['then'](respondWithResult(_0x226fde,null))['catch'](handleError(_0x226fde,null));};exports[_0x0cd4('0x24')]=function(_0x46357d,_0xeccd0f){return db['SmsQueue']['find']({'where':{'id':_0x46357d['params']['id']}})[_0x0cd4('0x23')](handleEntityNotFound(_0xeccd0f,null))[_0x0cd4('0x23')](removeEntity(_0xeccd0f,null))['catch'](handleError(_0xeccd0f,null));};exports['describe']=function(_0x28ec2c,_0x19e973){return db[_0x0cd4('0x45')][_0x0cd4('0x4a')]()[_0x0cd4('0x23')](respondWithResult(_0x19e973,null))['catch'](handleError(_0x19e973,null));};exports[_0x0cd4('0x4b')]=function(_0x1acd6b,_0x3316f0,_0x42d86c){var _0x2ed834={'raw':!![],'where':{}},_0x4e80dc={},_0x2eae8e;return db['SmsQueue']['findOne']({'where':{'id':_0x1acd6b[_0x0cd4('0x43')]['id']}})[_0x0cd4('0x23')](handleEntityNotFound(_0x3316f0,null))[_0x0cd4('0x23')](function(_0x43144c){if(_0x43144c){_0x2eae8e=_0x43144c[_0x0cd4('0x4c')]({'plain':!![]});_0x4e80dc[_0x0cd4('0x46')]=_[_0x0cd4('0x44')](db['UserSmsQueue']['rawAttributes']);_0x4e80dc[_0x0cd4('0x2b')]=_[_0x0cd4('0x44')](_0x1acd6b['query']);_0x4e80dc[_0x0cd4('0x2e')]=_[_0x0cd4('0x30')](_0x4e80dc[_0x0cd4('0x46')],_0x4e80dc[_0x0cd4('0x2b')]);_0x2ed834['attributes']=_[_0x0cd4('0x30')](_0x4e80dc['model'],qs[_0x0cd4('0x31')](_0x1acd6b[_0x0cd4('0x2b')]['fields']));_0x2ed834[_0x0cd4('0x2f')]=_0x2ed834['attributes']['length']?_0x2ed834[_0x0cd4('0x2f')]:_0x4e80dc[_0x0cd4('0x46')];if(!_0x1acd6b['query'][_0x0cd4('0x33')](_0x0cd4('0x34'))){_0x2ed834[_0x0cd4('0x1d')]=qs[_0x0cd4('0x1d')](_0x1acd6b['query'][_0x0cd4('0x1d')]);_0x2ed834[_0x0cd4('0x1c')]=qs[_0x0cd4('0x1c')](_0x1acd6b['query'][_0x0cd4('0x1c')]);}_0x2ed834[_0x0cd4('0x35')]=qs[_0x0cd4('0x36')](_0x1acd6b[_0x0cd4('0x2b')][_0x0cd4('0x36')]);_0x2ed834[_0x0cd4('0x37')]=qs[_0x0cd4('0x2e')](_[_0x0cd4('0x4d')](_0x1acd6b['query'],_0x4e80dc[_0x0cd4('0x2e')]));_0x2ed834[_0x0cd4('0x37')][_0x0cd4('0x4e')]=_0x43144c['id'];if(_0x1acd6b['query'][_0x0cd4('0x3c')]){_0x2ed834['where']=_[_0x0cd4('0x3a')](_0x2ed834[_0x0cd4('0x37')],{'$or':_[_0x0cd4('0x3b')](_0x2ed834[_0x0cd4('0x2f')],function(_0x572b83){var _0x184f71={};_0x184f71[_0x572b83]={'$like':'%'+_0x1acd6b[_0x0cd4('0x2b')][_0x0cd4('0x3c')]+'%'};return _0x184f71;})});}_0x2ed834=_['merge']({},_0x2ed834,_0x1acd6b['options']);return db['UserSmsQueue'][_0x0cd4('0x40')](_0x2ed834);}})['then'](function(_0x1d6e96){if(_0x1d6e96){return db[_0x0cd4('0x4f')]['findAndCountAll']({'where':{'id':_[_0x0cd4('0x3b')](_0x1d6e96,_0x0cd4('0x50')),'role':_0x0cd4('0x51')},'attributes':['id','name',_0x0cd4('0x52'),_0x0cd4('0x53'),_0x0cd4('0x54')]});}})[_0x0cd4('0x23')](function(_0x4983e1){if(_0x4983e1){return{'count':_0x4983e1['count'],'rows':_[_0x0cd4('0x3b')](_0x4983e1['rows'],function(_0x1d6e2e){return{'membername':_0x1d6e2e[_0x0cd4('0x27')],'UserId':_0x1d6e2e['id'],'queue_name':_0x2eae8e['name'],'SmsQueueId':_0x2eae8e['id'],'interface':util[_0x0cd4('0x55')]('%s/%s',_0x0cd4('0x56'),_0x1d6e2e[_0x0cd4('0x27')]),'penalty':0x0,'paused':_0x1d6e2e[_0x0cd4('0x52')],'createdAt':_0x1d6e2e['createdAt'],'updatedAt':_0x1d6e2e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0cd4('0x23')](respondWithFilteredResult(_0x3316f0,_0x2ed834))['catch'](handleError(_0x3316f0,null));};exports[_0x0cd4('0x57')]=function(_0x4493cf,_0x528884,_0x290173){var _0x299b8c={};var _0x5c857a={};var _0x1c7a54;var _0x5d450d;return db['SmsQueue'][_0x0cd4('0x58')]({'where':{'id':_0x4493cf[_0x0cd4('0x43')]['id']}})[_0x0cd4('0x23')](handleEntityNotFound(_0x528884,null))[_0x0cd4('0x23')](function(_0x386b9e){if(_0x386b9e){_0x1c7a54=_0x386b9e;_0x5c857a['model']=_[_0x0cd4('0x44')](db[_0x0cd4('0x59')][_0x0cd4('0x2a')]);_0x5c857a[_0x0cd4('0x2b')]=_['keys'](_0x4493cf[_0x0cd4('0x2b')]);_0x5c857a['filters']=_[_0x0cd4('0x30')](_0x5c857a[_0x0cd4('0x46')],_0x5c857a[_0x0cd4('0x2b')]);_0x299b8c[_0x0cd4('0x2f')]=_[_0x0cd4('0x30')](_0x5c857a[_0x0cd4('0x46')],qs['fields'](_0x4493cf['query'][_0x0cd4('0x31')]));_0x299b8c[_0x0cd4('0x2f')]=_0x299b8c['attributes'][_0x0cd4('0x32')]?_0x299b8c['attributes']:_0x5c857a[_0x0cd4('0x46')];_0x299b8c[_0x0cd4('0x35')]=qs[_0x0cd4('0x36')](_0x4493cf[_0x0cd4('0x2b')][_0x0cd4('0x36')]);_0x299b8c['where']=qs['filters'](_[_0x0cd4('0x4d')](_0x4493cf[_0x0cd4('0x2b')],_0x5c857a['filters']));if(_0x4493cf[_0x0cd4('0x2b')][_0x0cd4('0x3c')]){_0x299b8c[_0x0cd4('0x37')]=_['merge'](_0x299b8c['where'],{'$or':_[_0x0cd4('0x3b')](_0x299b8c[_0x0cd4('0x2f')],function(_0x223959){var _0x3f3cc6={};_0x3f3cc6[_0x223959]={'$like':'%'+_0x4493cf[_0x0cd4('0x2b')]['filter']+'%'};return _0x3f3cc6;})});}_0x299b8c=_[_0x0cd4('0x3a')]({},_0x299b8c,_0x4493cf[_0x0cd4('0x3d')]);return _0x1c7a54[_0x0cd4('0x57')](_0x299b8c);}})['then'](function(_0x4b4fb7){if(_0x4b4fb7){_0x5d450d=_0x4b4fb7[_0x0cd4('0x32')];if(!_0x4493cf[_0x0cd4('0x2b')][_0x0cd4('0x33')](_0x0cd4('0x34'))){_0x299b8c[_0x0cd4('0x1d')]=qs[_0x0cd4('0x1d')](_0x4493cf[_0x0cd4('0x2b')][_0x0cd4('0x1d')]);_0x299b8c[_0x0cd4('0x1c')]=qs['offset'](_0x4493cf[_0x0cd4('0x2b')][_0x0cd4('0x1c')]);}return _0x1c7a54['getTeams'](_0x299b8c);}})[_0x0cd4('0x23')](function(_0x6a52d9){if(_0x6a52d9){return _0x6a52d9?{'count':_0x5d450d,'rows':_0x6a52d9}:null;}})[_0x0cd4('0x23')](respondWithResult(_0x528884,null))[_0x0cd4('0x41')](handleError(_0x528884,null));};exports[_0x0cd4('0x5a')]=function(_0x4f9d6f,_0x2d3756,_0x288962){var _0x1348b4=[];var _0xa39755;return db[_0x0cd4('0x59')][_0x0cd4('0x40')]({'where':{'id':_0x4f9d6f[_0x0cd4('0x49')][_0x0cd4('0x5b')]},'attributes':['id'],'include':[{'model':db[_0x0cd4('0x4f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0cd4('0x23')](function(_0x407618){if(_0x407618){for(var _0x35aacd=0x0;_0x35aacd<_0x407618[_0x0cd4('0x32')];_0x35aacd+=0x1){for(var _0x42da81=0x0;_0x42da81<_0x407618[_0x35aacd][_0x0cd4('0x5c')][_0x0cd4('0x32')];_0x42da81+=0x1){_0x1348b4=_[_0x0cd4('0x5d')](_0x1348b4,[_0x407618[_0x35aacd][_0x0cd4('0x5c')][_0x42da81]['id']]);}}return _0x1348b4;}})[_0x0cd4('0x23')](function(_0x39727e){if(_0x39727e){return db['SmsQueue'][_0x0cd4('0x47')]({'where':{'id':_0x4f9d6f[_0x0cd4('0x43')]['id']}});}})['then'](function(_0x57a25e){if(_0x57a25e){_0xa39755=_0x57a25e;return _0xa39755['addAgents'](_0x1348b4,{'penalty':_0x4f9d6f[_0x0cd4('0x49')][_0x0cd4('0x5e')]});}})['then'](function(_0x504294){if(_0x504294){return _0xa39755[_0x0cd4('0x5a')](_0x4f9d6f[_0x0cd4('0x49')]['ids']);}})[_0x0cd4('0x23')](handleEntityNotFound(_0x2d3756,null))['then'](respondWithStatusCode(_0x2d3756,null))[_0x0cd4('0x41')](handleError(_0x2d3756,null));};exports[_0x0cd4('0x5f')]=function(_0x4a0acc,_0x1298fa,_0x55e706){var _0x55ccdb=[];var _0x4dfc92;return db[_0x0cd4('0x59')][_0x0cd4('0x40')]({'where':{'id':_0x4a0acc[_0x0cd4('0x2b')][_0x0cd4('0x5b')]},'attributes':['id'],'include':[{'model':db[_0x0cd4('0x4f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0cd4('0x23')](function(_0x4313ac){if(_0x4313ac){for(var _0x401494=0x0;_0x401494<_0x4313ac[_0x0cd4('0x32')];_0x401494+=0x1){for(var _0x30ab41=0x0;_0x30ab41<_0x4313ac[_0x401494][_0x0cd4('0x5c')][_0x0cd4('0x32')];_0x30ab41+=0x1){_0x55ccdb=_[_0x0cd4('0x5d')](_0x55ccdb,[_0x4313ac[_0x401494][_0x0cd4('0x5c')][_0x30ab41]['id']]);}}return _0x55ccdb;}})[_0x0cd4('0x23')](function(_0x13838c){if(_0x13838c){return db['SmsQueue']['find']({'where':{'id':_0x4a0acc[_0x0cd4('0x43')]['id']}});}})[_0x0cd4('0x23')](function(_0x5a9c){if(_0x5a9c){_0x4dfc92=_0x5a9c;return _0x4dfc92[_0x0cd4('0x60')](_0x55ccdb);}})[_0x0cd4('0x23')](function(_0x3225ec){if(_0x4dfc92){return _0x4dfc92[_0x0cd4('0x5f')](_0x4a0acc['query']['ids']);}})[_0x0cd4('0x23')](handleEntityNotFound(_0x1298fa,null))[_0x0cd4('0x23')](respondWithStatusCode(_0x1298fa,null))[_0x0cd4('0x41')](handleError(_0x1298fa,null));};exports[_0x0cd4('0x61')]=function(_0x34686f,_0x55e030,_0x4e0642){return db[_0x0cd4('0x45')][_0x0cd4('0x47')]({'where':{'id':_0x34686f['params']['id']}})[_0x0cd4('0x23')](handleEntityNotFound(_0x55e030,null))['then'](function(_0xc74d7c){if(_0xc74d7c){return _0xc74d7c['addAgents'](_0x34686f[_0x0cd4('0x49')]['ids'],_[_0x0cd4('0x62')](_0x34686f['body'],[_0x0cd4('0x5b'),'id'])||{})[_0x0cd4('0x63')](function(_0x2b5b66){for(var _0x16b49e=0x0;_0x16b49e<_0x34686f['body']['ids'][_0x0cd4('0x32')];_0x16b49e+=0x1){socket[_0x0cd4('0x64')](_0x0cd4('0x65'),{'UserId':_0x34686f[_0x0cd4('0x49')][_0x0cd4('0x5b')][_0x16b49e],'SmsQueueId':_0x34686f['params']['id']});}return _0x2b5b66;});}})[_0x0cd4('0x23')](respondWithResult(_0x55e030,null))['catch'](handleError(_0x55e030,null));};exports['removeAgents']=function(_0x5ab64f,_0x5184ee,_0x2bb0a6){var _0x4688f3;return db['SmsQueue'][_0x0cd4('0x47')]({'where':{'id':_0x5ab64f[_0x0cd4('0x43')]['id']}})[_0x0cd4('0x23')](handleEntityNotFound(_0x5184ee,null))[_0x0cd4('0x23')](function(_0x5e7a1d){if(_0x5e7a1d){return _0x5e7a1d[_0x0cd4('0x60')](_0x5ab64f[_0x0cd4('0x2b')][_0x0cd4('0x5b')])[_0x0cd4('0x23')](function(_0x51fb0e){if(_['isArray'](_0x5ab64f[_0x0cd4('0x2b')][_0x0cd4('0x5b')])){for(var _0x52ceaf=0x0;_0x52ceaf<_0x5ab64f[_0x0cd4('0x2b')][_0x0cd4('0x5b')][_0x0cd4('0x32')];_0x52ceaf+=0x1){socket[_0x0cd4('0x64')](_0x0cd4('0x66'),{'UserId':_0x5ab64f['query']['ids'][_0x52ceaf],'SmsQueueId':_0x5ab64f['params']['id']});}}else{socket['emit']('userSmsQueue:remove',{'UserId':_0x5ab64f[_0x0cd4('0x2b')][_0x0cd4('0x5b')],'SmsQueueId':_0x5ab64f[_0x0cd4('0x43')]['id']});}});}})[_0x0cd4('0x23')](respondWithStatusCode(_0x5184ee,null))[_0x0cd4('0x41')](handleError(_0x5184ee,null));};exports[_0x0cd4('0x67')]=function(_0x51dd5a,_0x12d788,_0x5a7922){var _0x36667a={};var _0x30d1db={};var _0x1a647d;var _0x2cf567;return db[_0x0cd4('0x45')][_0x0cd4('0x58')]({'where':{'id':_0x51dd5a[_0x0cd4('0x43')]['id']}})[_0x0cd4('0x23')](handleEntityNotFound(_0x12d788,null))[_0x0cd4('0x23')](function(_0x1d388b){if(_0x1d388b){_0x1a647d=_0x1d388b;_0x30d1db[_0x0cd4('0x46')]=_[_0x0cd4('0x44')](db[_0x0cd4('0x4f')]['rawAttributes']);_0x30d1db[_0x0cd4('0x2b')]=_[_0x0cd4('0x44')](_0x51dd5a[_0x0cd4('0x2b')]);_0x30d1db[_0x0cd4('0x2e')]=_['intersection'](_0x30d1db[_0x0cd4('0x46')],_0x30d1db['query']);_0x36667a[_0x0cd4('0x2f')]=_['intersection'](_0x30d1db[_0x0cd4('0x46')],qs[_0x0cd4('0x31')](_0x51dd5a[_0x0cd4('0x2b')][_0x0cd4('0x31')]));_0x36667a[_0x0cd4('0x2f')]=_0x36667a['attributes'][_0x0cd4('0x32')]?_0x36667a['attributes']:_0x30d1db['model'];_0x36667a[_0x0cd4('0x35')]=qs[_0x0cd4('0x36')](_0x51dd5a[_0x0cd4('0x2b')][_0x0cd4('0x36')]);_0x36667a['where']=qs[_0x0cd4('0x2e')](_[_0x0cd4('0x4d')](_0x51dd5a[_0x0cd4('0x2b')],_0x30d1db[_0x0cd4('0x2e')]));if(_0x51dd5a[_0x0cd4('0x2b')][_0x0cd4('0x3c')]){_0x36667a['where']=_[_0x0cd4('0x3a')](_0x36667a[_0x0cd4('0x37')],{'$or':_[_0x0cd4('0x3b')](_0x36667a[_0x0cd4('0x2f')],function(_0x1904d8){var _0x531484={};_0x531484[_0x1904d8]={'$like':'%'+_0x51dd5a[_0x0cd4('0x2b')][_0x0cd4('0x3c')]+'%'};return _0x531484;})});}_0x36667a=_[_0x0cd4('0x3a')]({},_0x36667a,_0x51dd5a[_0x0cd4('0x3d')]);return _0x1a647d[_0x0cd4('0x67')](_0x36667a);}})['then'](function(_0x59c15a){if(_0x59c15a){_0x2cf567=_0x59c15a[_0x0cd4('0x32')];if(!_0x51dd5a[_0x0cd4('0x2b')][_0x0cd4('0x33')]('nolimit')){_0x36667a[_0x0cd4('0x1d')]=qs[_0x0cd4('0x1d')](_0x51dd5a[_0x0cd4('0x2b')][_0x0cd4('0x1d')]);_0x36667a[_0x0cd4('0x1c')]=qs['offset'](_0x51dd5a[_0x0cd4('0x2b')][_0x0cd4('0x1c')]);}return _0x1a647d[_0x0cd4('0x67')](_0x36667a);}})[_0x0cd4('0x23')](function(_0x5110ae){if(_0x5110ae){return _0x5110ae?{'count':_0x2cf567,'rows':_0x5110ae}:null;}})['then'](respondWithResult(_0x12d788,null))[_0x0cd4('0x41')](handleError(_0x12d788,null));};
\ No newline at end of file
index 3254a9c..1eb7406 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe76e=['hook','exports','../../mysqldb','SmsQueue','update','emit','hasOwnProperty'];(function(_0x24c18f,_0x5caa54){var _0x56952f=function(_0x47d713){while(--_0x47d713){_0x24c18f['push'](_0x24c18f['shift']());}};_0x56952f(++_0x5caa54);}(_0xe76e,0xcd));var _0xee76=function(_0xfcc55f,_0x8739c6){_0xfcc55f=_0xfcc55f-0x0;var _0x4a13fb=_0xe76e[_0xfcc55f];return _0x4a13fb;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xee76('0x0'))['db'][_0xee76('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xee76('0x2'),'afterDestroy':'remove'};function emitEvent(_0x376146){return function(_0x120520,_0x22e87b,_0x120282){SmsQueueEvents['emit'](_0x376146+':'+_0x120520['id'],_0x120520);SmsQueueEvents[_0xee76('0x3')](_0x376146,_0x120520);_0x120282(null);};}for(var e in events){if(events[_0xee76('0x4')](e)){var event=events[e];SmsQueue[_0xee76('0x5')](e,emitEvent(event));}}module[_0xee76('0x6')]=SmsQueueEvents;
\ No newline at end of file
+var _0x0fa2=['remove','emit','hasOwnProperty','events','../../mysqldb','SmsQueue','setMaxListeners','save','update'];(function(_0x5cb3f1,_0x57a114){var _0xe38632=function(_0x416bb9){while(--_0x416bb9){_0x5cb3f1['push'](_0x5cb3f1['shift']());}};_0xe38632(++_0x57a114);}(_0x0fa2,0x108));var _0x20fa=function(_0xa84bdc,_0x456ad5){_0xa84bdc=_0xa84bdc-0x0;var _0x55bc3f=_0x0fa2[_0xa84bdc];return _0x55bc3f;};'use strict';var EventEmitter=require(_0x20fa('0x0'));var SmsQueue=require(_0x20fa('0x1'))['db'][_0x20fa('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x20fa('0x3')](0x0);var events={'afterCreate':_0x20fa('0x4'),'afterUpdate':_0x20fa('0x5'),'afterDestroy':_0x20fa('0x6')};function emitEvent(_0x16a368){return function(_0x2935b9,_0x382a5d,_0x480706){SmsQueueEvents[_0x20fa('0x7')](_0x16a368+':'+_0x2935b9['id'],_0x2935b9);SmsQueueEvents[_0x20fa('0x7')](_0x16a368,_0x2935b9);_0x480706(null);};}for(var e in events){if(events[_0x20fa('0x8')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
index 4248112..c30835b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea13=['util','../../config/logger','api','bluebird','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash'];(function(_0x1ea4be,_0x1ad77e){var _0x581054=function(_0x1f4b7e){while(--_0x1f4b7e){_0x1ea4be['push'](_0x1ea4be['shift']());}};_0x581054(++_0x1ad77e);}(_0xea13,0xd1));var _0x3ea1=function(_0x4c83c7,_0x3b7121){_0x4c83c7=_0x4c83c7-0x0;var _0x23d0ea=_0xea13[_0x4c83c7];return _0x23d0ea;};'use strict';var _=require(_0x3ea1('0x0'));var util=require(_0x3ea1('0x1'));var logger=require(_0x3ea1('0x2'))(_0x3ea1('0x3'));var moment=require('moment');var BPromise=require(_0x3ea1('0x4'));var rp=require('request-promise');var attributes=require(_0x3ea1('0x5'));module[_0x3ea1('0x6')]=function(_0x370bae,_0x35e860){return _0x370bae[_0x3ea1('0x7')](_0x3ea1('0x8'),attributes,{'tableName':_0x3ea1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e86=['../../config/logger','bluebird','request-promise','exports','define','SmsQueue','lodash','util'];(function(_0x51c52b,_0x147712){var _0x581ce3=function(_0x2e61a0){while(--_0x2e61a0){_0x51c52b['push'](_0x51c52b['shift']());}};_0x581ce3(++_0x147712);}(_0x0e86,0x10e));var _0x60e8=function(_0x556a99,_0x3d0574){_0x556a99=_0x556a99-0x0;var _0x45a65a=_0x0e86[_0x556a99];return _0x45a65a;};'use strict';var _=require(_0x60e8('0x0'));var util=require(_0x60e8('0x1'));var logger=require(_0x60e8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x60e8('0x3'));var rp=require(_0x60e8('0x4'));var attributes=require('./smsQueue.attributes');module[_0x60e8('0x5')]=function(_0x9a30dd,_0x57c23e){return _0x9a30dd[_0x60e8('0x6')](_0x60e8('0x7'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 19e293b..2aff082 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7317=['./smsQueue.socket','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','SmsQueue','findAll','options','raw','limit','include','map','model','attributes','info','GetSmsQueue','catch','ShowSmsQueue','find','lodash','util','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter','localhost'];(function(_0x316bfc,_0x39ab4c){var _0x54ffc0=function(_0x39d6d3){while(--_0x39d6d3){_0x316bfc['push'](_0x316bfc['shift']());}};_0x54ffc0(++_0x39ab4c);}(_0x7317,0x142));var _0x7731=function(_0x321051,_0x5d75b8){_0x321051=_0x321051-0x0;var _0x1f346c=_0x7317[_0x321051];return _0x1f346c;};'use strict';var _=require(_0x7731('0x0'));var util=require(_0x7731('0x1'));var moment=require('moment');var BPromise=require(_0x7731('0x2'));var rs=require(_0x7731('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7731('0x4'));var config=require(_0x7731('0x5'));var jayson=require(_0x7731('0x6'));var client=jayson[_0x7731('0x7')][_0x7731('0x8')]({'port':0x232a});var socket=require(_0x7731('0x9'))({'host':_0x7731('0xa'),'port':0x18eb});require(_0x7731('0xb'))['register'](socket);function respondWithRpcPromise(_0xad8923,_0x83fd4,_0x4b70a5){return new BPromise(function(_0xdf6859,_0x4197ed){return client[_0x7731('0xc')](_0xad8923,_0x4b70a5)[_0x7731('0xd')](function(_0x29e703){logger['info'](_0x7731('0xe'),_0x83fd4,_0x7731('0xf'));logger[_0x7731('0x10')](_0x7731('0x11'),_0x83fd4,_0x7731('0xf'),JSON[_0x7731('0x12')](_0x29e703));if(_0x29e703[_0x7731('0x13')]){if(_0x29e703[_0x7731('0x13')][_0x7731('0x14')]===0x1f4){logger[_0x7731('0x13')](_0x7731('0xe'),_0x83fd4,_0x29e703[_0x7731('0x13')][_0x7731('0x15')]);return _0x4197ed(_0x29e703['error'][_0x7731('0x15')]);}logger[_0x7731('0x13')]('SmsQueue,\x20%s,\x20%s',_0x83fd4,_0x29e703[_0x7731('0x13')][_0x7731('0x15')]);return _0xdf6859(_0x29e703[_0x7731('0x13')][_0x7731('0x15')]);}else{logger['info'](_0x7731('0xe'),_0x83fd4,_0x7731('0xf'));_0xdf6859(_0x29e703[_0x7731('0x16')]['message']);}})['catch'](function(_0x92b875){logger[_0x7731('0x13')](_0x7731('0xe'),_0x83fd4,_0x92b875);_0x4197ed(_0x92b875);});});}exports['GetSmsQueue']=function(_0x21eaaa){var _0x28969c=this;return new Promise(function(_0x1df257,_0x3e9b75){return db[_0x7731('0x17')][_0x7731('0x18')]({'raw':_0x21eaaa[_0x7731('0x19')]?_0x21eaaa['options'][_0x7731('0x1a')]===undefined?!![]:![]:!![],'where':_0x21eaaa[_0x7731('0x19')]?_0x21eaaa['options']['where']||null:null,'attributes':_0x21eaaa[_0x7731('0x19')]?_0x21eaaa[_0x7731('0x19')]['attributes']||null:null,'limit':_0x21eaaa[_0x7731('0x19')]?_0x21eaaa[_0x7731('0x19')][_0x7731('0x1b')]||null:null,'include':_0x21eaaa['options']?_0x21eaaa['options'][_0x7731('0x1c')]?_[_0x7731('0x1d')](_0x21eaaa[_0x7731('0x19')][_0x7731('0x1c')],function(_0x496303){return{'model':db[_0x496303[_0x7731('0x1e')]],'as':_0x496303['as'],'attributes':_0x496303['attributes'],'include':_0x496303[_0x7731('0x1c')]?_[_0x7731('0x1d')](_0x496303[_0x7731('0x1c')],function(_0x4530cc){return{'model':db[_0x4530cc[_0x7731('0x1e')]],'as':_0x4530cc['as'],'attributes':_0x4530cc[_0x7731('0x1f')],'include':_0x4530cc[_0x7731('0x1c')]?_[_0x7731('0x1d')](_0x4530cc[_0x7731('0x1c')],function(_0x46e150){return{'model':db[_0x46e150[_0x7731('0x1e')]],'as':_0x46e150['as'],'attributes':_0x46e150[_0x7731('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b7395){logger[_0x7731('0x20')](_0x7731('0x21'),_0x21eaaa);logger[_0x7731('0x10')]('GetSmsQueue',_0x21eaaa,JSON['stringify'](_0x5b7395));_0x1df257(_0x5b7395);})[_0x7731('0x22')](function(_0x234ee4){logger[_0x7731('0x13')]('GetSmsQueue',_0x234ee4[_0x7731('0x15')],_0x21eaaa);_0x3e9b75(_0x28969c['error'](0x1f4,_0x234ee4[_0x7731('0x15')]));});});};exports[_0x7731('0x23')]=function(_0x3b303a){var _0xb1d553=this;return new Promise(function(_0x86473a,_0x6a7d50){return db[_0x7731('0x17')][_0x7731('0x24')]({'raw':_0x3b303a[_0x7731('0x19')]?_0x3b303a[_0x7731('0x19')][_0x7731('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b303a['options']?_0x3b303a[_0x7731('0x19')]['where']||null:null,'attributes':_0x3b303a[_0x7731('0x19')]?_0x3b303a[_0x7731('0x19')][_0x7731('0x1f')]||null:null,'include':_0x3b303a['options']?_0x3b303a['options'][_0x7731('0x1c')]?_[_0x7731('0x1d')](_0x3b303a['options'][_0x7731('0x1c')],function(_0x5ae3aa){return{'model':db[_0x5ae3aa['model']],'as':_0x5ae3aa['as'],'attributes':_0x5ae3aa[_0x7731('0x1f')],'include':_0x5ae3aa['include']?_[_0x7731('0x1d')](_0x5ae3aa[_0x7731('0x1c')],function(_0x58450c){return{'model':db[_0x58450c[_0x7731('0x1e')]],'as':_0x58450c['as'],'attributes':_0x58450c[_0x7731('0x1f')],'include':_0x58450c[_0x7731('0x1c')]?_[_0x7731('0x1d')](_0x58450c[_0x7731('0x1c')],function(_0x4500cb){return{'model':db[_0x4500cb[_0x7731('0x1e')]],'as':_0x4500cb['as'],'attributes':_0x4500cb[_0x7731('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7731('0xd')](function(_0x15924d){logger[_0x7731('0x20')]('ShowSmsQueue',_0x3b303a);logger[_0x7731('0x10')](_0x7731('0x23'),_0x3b303a,JSON[_0x7731('0x12')](_0x15924d));_0x86473a(_0x15924d);})[_0x7731('0x22')](function(_0x51f4f5){logger[_0x7731('0x13')]('ShowSmsQueue',_0x51f4f5['message'],_0x3b303a);_0x6a7d50(_0xb1d553[_0x7731('0x13')](0x1f4,_0x51f4f5[_0x7731('0x15')]));});});};
\ No newline at end of file
+var _0x06f7=['message','info','catch','GetSmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowSmsQueue','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','./smsQueue.socket','register','request','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x40448f,_0x496924){var _0x119af1=function(_0x222f72){while(--_0x222f72){_0x40448f['push'](_0x40448f['shift']());}};_0x119af1(++_0x496924);}(_0x06f7,0x176));var _0x706f=function(_0x21b359,_0x4dc80e){_0x21b359=_0x21b359-0x0;var _0x57b8e7=_0x06f7[_0x21b359];return _0x57b8e7;};'use strict';var _=require(_0x706f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x706f('0x1'));var rs=require(_0x706f('0x2'));var fs=require('fs');var db=require(_0x706f('0x3'))['db'];var utils=require(_0x706f('0x4'));var logger=require(_0x706f('0x5'))(_0x706f('0x6'));var config=require(_0x706f('0x7'));var jayson=require(_0x706f('0x8'));var client=jayson[_0x706f('0x9')][_0x706f('0xa')]({'port':0x232a});var socket=require('socket.io-emitter')({'host':_0x706f('0xb'),'port':0x18eb});require(_0x706f('0xc'))[_0x706f('0xd')](socket);function respondWithRpcPromise(_0x4932bb,_0x1ae051,_0xc10304){return new BPromise(function(_0x45e99f,_0xdfa744){return client[_0x706f('0xe')](_0x4932bb,_0xc10304)['then'](function(_0x41d671){logger['info'](_0x706f('0xf'),_0x1ae051,_0x706f('0x10'));logger[_0x706f('0x11')](_0x706f('0x12'),_0x1ae051,_0x706f('0x10'),JSON[_0x706f('0x13')](_0x41d671));if(_0x41d671[_0x706f('0x14')]){if(_0x41d671[_0x706f('0x14')][_0x706f('0x15')]===0x1f4){logger['error'](_0x706f('0xf'),_0x1ae051,_0x41d671[_0x706f('0x14')]['message']);return _0xdfa744(_0x41d671[_0x706f('0x14')][_0x706f('0x16')]);}logger[_0x706f('0x14')]('SmsQueue,\x20%s,\x20%s',_0x1ae051,_0x41d671[_0x706f('0x14')][_0x706f('0x16')]);return _0x45e99f(_0x41d671['error']['message']);}else{logger[_0x706f('0x17')](_0x706f('0xf'),_0x1ae051,_0x706f('0x10'));_0x45e99f(_0x41d671['result'][_0x706f('0x16')]);}})[_0x706f('0x18')](function(_0x5343d2){logger[_0x706f('0x14')](_0x706f('0xf'),_0x1ae051,_0x5343d2);_0xdfa744(_0x5343d2);});});}exports[_0x706f('0x19')]=function(_0x390f9f){var _0x2a9ab7=this;return new Promise(function(_0x89292f,_0x53ce19){return db['SmsQueue'][_0x706f('0x1a')]({'raw':_0x390f9f[_0x706f('0x1b')]?_0x390f9f[_0x706f('0x1b')][_0x706f('0x1c')]===undefined?!![]:![]:!![],'where':_0x390f9f[_0x706f('0x1b')]?_0x390f9f[_0x706f('0x1b')][_0x706f('0x1d')]||null:null,'attributes':_0x390f9f[_0x706f('0x1b')]?_0x390f9f[_0x706f('0x1b')][_0x706f('0x1e')]||null:null,'limit':_0x390f9f[_0x706f('0x1b')]?_0x390f9f[_0x706f('0x1b')][_0x706f('0x1f')]||null:null,'include':_0x390f9f[_0x706f('0x1b')]?_0x390f9f['options'][_0x706f('0x20')]?_[_0x706f('0x21')](_0x390f9f[_0x706f('0x1b')]['include'],function(_0x4341ac){return{'model':db[_0x4341ac[_0x706f('0x22')]],'as':_0x4341ac['as'],'attributes':_0x4341ac['attributes'],'include':_0x4341ac[_0x706f('0x20')]?_[_0x706f('0x21')](_0x4341ac['include'],function(_0x5088fd){return{'model':db[_0x5088fd[_0x706f('0x22')]],'as':_0x5088fd['as'],'attributes':_0x5088fd[_0x706f('0x1e')],'include':_0x5088fd[_0x706f('0x20')]?_[_0x706f('0x21')](_0x5088fd[_0x706f('0x20')],function(_0x304d86){return{'model':db[_0x304d86['model']],'as':_0x304d86['as'],'attributes':_0x304d86['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x16986c){logger[_0x706f('0x17')](_0x706f('0x19'),_0x390f9f);logger['debug'](_0x706f('0x19'),_0x390f9f,JSON[_0x706f('0x13')](_0x16986c));_0x89292f(_0x16986c);})[_0x706f('0x18')](function(_0x4a9b48){logger[_0x706f('0x14')](_0x706f('0x19'),_0x4a9b48[_0x706f('0x16')],_0x390f9f);_0x53ce19(_0x2a9ab7['error'](0x1f4,_0x4a9b48[_0x706f('0x16')]));});});};exports['ShowSmsQueue']=function(_0x2618ee){var _0x3c5d1f=this;return new Promise(function(_0xbc952d,_0x5c911b){return db['SmsQueue']['find']({'raw':_0x2618ee[_0x706f('0x1b')]?_0x2618ee[_0x706f('0x1b')][_0x706f('0x1c')]===undefined?!![]:![]:!![],'where':_0x2618ee[_0x706f('0x1b')]?_0x2618ee[_0x706f('0x1b')][_0x706f('0x1d')]||null:null,'attributes':_0x2618ee[_0x706f('0x1b')]?_0x2618ee[_0x706f('0x1b')]['attributes']||null:null,'include':_0x2618ee['options']?_0x2618ee[_0x706f('0x1b')][_0x706f('0x20')]?_[_0x706f('0x21')](_0x2618ee[_0x706f('0x1b')][_0x706f('0x20')],function(_0xce3a91){return{'model':db[_0xce3a91[_0x706f('0x22')]],'as':_0xce3a91['as'],'attributes':_0xce3a91['attributes'],'include':_0xce3a91[_0x706f('0x20')]?_[_0x706f('0x21')](_0xce3a91[_0x706f('0x20')],function(_0x40d8fc){return{'model':db[_0x40d8fc[_0x706f('0x22')]],'as':_0x40d8fc['as'],'attributes':_0x40d8fc[_0x706f('0x1e')],'include':_0x40d8fc['include']?_[_0x706f('0x21')](_0x40d8fc[_0x706f('0x20')],function(_0x197f72){return{'model':db[_0x197f72[_0x706f('0x22')]],'as':_0x197f72['as'],'attributes':_0x197f72[_0x706f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39a657){logger[_0x706f('0x17')](_0x706f('0x23'),_0x2618ee);logger[_0x706f('0x11')]('ShowSmsQueue',_0x2618ee,JSON[_0x706f('0x13')](_0x39a657));_0xbc952d(_0x39a657);})[_0x706f('0x18')](function(_0x369889){logger['error'](_0x706f('0x23'),_0x369889[_0x706f('0x16')],_0x2618ee);_0x5c911b(_0x3c5d1f['error'](0x1f4,_0x369889['message']));});});};
\ No newline at end of file
index 400633e..cf28eb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8a1=['update','emit','removeListener','length','smsQueue:','./smsQueue.events','save','remove'];(function(_0x282d36,_0x9b63de){var _0x2be4ea=function(_0x4c7ab7){while(--_0x4c7ab7){_0x282d36['push'](_0x282d36['shift']());}};_0x2be4ea(++_0x9b63de);}(_0xb8a1,0x1bd));var _0x1b8a=function(_0x3cdc1f,_0x5810d8){_0x3cdc1f=_0x3cdc1f-0x0;var _0x5ed7f3=_0xb8a1[_0x3cdc1f];return _0x5ed7f3;};'use strict';var SmsQueueEvents=require(_0x1b8a('0x0'));var events=[_0x1b8a('0x1'),_0x1b8a('0x2'),_0x1b8a('0x3')];function createListener(_0x50b43f,_0x3c5fcb){return function(_0x4e7d2a){_0x3c5fcb[_0x1b8a('0x4')](_0x50b43f,_0x4e7d2a);};}function removeListener(_0x531610,_0xd532e2){return function(){SmsQueueEvents[_0x1b8a('0x5')](_0x531610,_0xd532e2);};}exports['register']=function(_0x3bc4f2){for(var _0x5c3092=0x0,_0x4ddd71=events[_0x1b8a('0x6')];_0x5c3092<_0x4ddd71;_0x5c3092++){var _0x13f884=events[_0x5c3092];var _0x220bdd=createListener(_0x1b8a('0x7')+_0x13f884,_0x3bc4f2);SmsQueueEvents['on'](_0x13f884,_0x220bdd);}};
\ No newline at end of file
+var _0x0272=['register','./smsQueue.events','save','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0272,0x15a));var _0x2027=function(_0x240f42,_0xa99675){_0x240f42=_0x240f42-0x0;var _0x59cab4=_0x0272[_0x240f42];return _0x59cab4;};'use strict';var SmsQueueEvents=require(_0x2027('0x0'));var events=[_0x2027('0x1'),'remove',_0x2027('0x2')];function createListener(_0x2cf50c,_0x3ead68){return function(_0xcc1624){_0x3ead68[_0x2027('0x3')](_0x2cf50c,_0xcc1624);};}function removeListener(_0x2ec914,_0x5844b7){return function(){SmsQueueEvents['removeListener'](_0x2ec914,_0x5844b7);};}exports[_0x2027('0x4')]=function(_0x1ea303){for(var _0x2deefc=0x0,_0x54a8f1=events['length'];_0x2deefc<_0x54a8f1;_0x2deefc++){var _0x56c261=events[_0x2deefc];var _0x2ac3bd=createListener('smsQueue:'+_0x56c261,_0x1ea303);SmsQueueEvents['on'](_0x56c261,_0x2ac3bd);}};
\ No newline at end of file
index 841e8ea..599baac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c5d=['post','put','update','delete','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/:id'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x0c5d,0x6c));var _0xd0c5=function(_0x29737d,_0x133fd6){_0x29737d=_0x29737d-0x0;var _0x3c2119=_0x0c5d[_0x29737d];return _0x3c2119;};'use strict';var multer=require(_0xd0c5('0x0'));var util=require(_0xd0c5('0x1'));var path=require('path');var express=require(_0xd0c5('0x2'));var router=express['Router']();var auth=require(_0xd0c5('0x3'));var interaction=require(_0xd0c5('0x4'));var config=require(_0xd0c5('0x5'));var controller=require(_0xd0c5('0x6'));router[_0xd0c5('0x7')]('/',auth[_0xd0c5('0x8')](),controller[_0xd0c5('0x9')]);router[_0xd0c5('0x7')]('/describe',auth[_0xd0c5('0x8')](),controller['describe']);router['get'](_0xd0c5('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd0c5('0xb')]('/',auth[_0xd0c5('0x8')](),controller['create']);router[_0xd0c5('0xc')](_0xd0c5('0xa'),auth['isAuthenticated'](),controller[_0xd0c5('0xd')]);router[_0xd0c5('0xe')](_0xd0c5('0xa'),auth[_0xd0c5('0x8')](),controller[_0xd0c5('0xf')]);module[_0xd0c5('0x10')]=router;
\ No newline at end of file
+var _0x0506=['multer','util','path','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','put','update','delete','destroy','exports'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0506,0x1d1));var _0x6050=function(_0x3aa3a3,_0x5588a3){_0x3aa3a3=_0x3aa3a3-0x0;var _0x5a0de2=_0x0506[_0x3aa3a3];return _0x5a0de2;};'use strict';var multer=require(_0x6050('0x0'));var util=require(_0x6050('0x1'));var path=require(_0x6050('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6050('0x3'));var controller=require('./smsQueueReport.controller');router[_0x6050('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6050('0x4')](_0x6050('0x5'),auth[_0x6050('0x6')](),controller[_0x6050('0x7')]);router[_0x6050('0x4')](_0x6050('0x8'),auth[_0x6050('0x6')](),controller[_0x6050('0x9')]);router['post']('/',auth[_0x6050('0x6')](),controller['create']);router[_0x6050('0xa')](_0x6050('0x8'),auth[_0x6050('0x6')](),controller[_0x6050('0xb')]);router[_0x6050('0xc')](_0x6050('0x8'),auth[_0x6050('0x6')](),controller[_0x6050('0xd')]);module[_0x6050('0xe')]=router;
\ No newline at end of file
index a92ae6b..0ff35b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc39b=['DATE','moment','STRING'];(function(_0x5b4d0b,_0x2aaf38){var _0x46b5bd=function(_0x894063){while(--_0x894063){_0x5b4d0b['push'](_0x5b4d0b['shift']());}};_0x46b5bd(++_0x2aaf38);}(_0xc39b,0x1f0));var _0xbc39=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xc39b[_0x36884e];return _0x1cc367;};'use strict';var moment=require(_0xbc39('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xbc39('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xbc39('0x1')]},'joinAt':{'type':Sequelize[_0xbc39('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xbc39('0x2')]},'reason':{'type':Sequelize[_0xbc39('0x1')]}};
\ No newline at end of file
+var _0x2279=['moment','sequelize','exports','STRING','DATE'];(function(_0x4c7e3f,_0x13a8cb){var _0x3ea783=function(_0x3b4cef){while(--_0x3b4cef){_0x4c7e3f['push'](_0x4c7e3f['shift']());}};_0x3ea783(++_0x13a8cb);}(_0x2279,0x1d1));var _0x9227=function(_0x75557a,_0x52169d){_0x75557a=_0x75557a-0x0;var _0x54fe68=_0x2279[_0x75557a];return _0x54fe68;};'use strict';var moment=require(_0x9227('0x0'));var Sequelize=require(_0x9227('0x1'));module[_0x9227('0x2')]={'uniqueid':{'type':Sequelize[_0x9227('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9227('0x3')]},'joinAt':{'type':Sequelize[_0x9227('0x4')]},'leaveAt':{'type':Sequelize[_0x9227('0x4')]},'acceptAt':{'type':Sequelize[_0x9227('0x4')]},'exitAt':{'type':Sequelize[_0x9227('0x4')]},'reason':{'type':Sequelize[_0x9227('0x3')]}};
\ No newline at end of file
index 8d6dd2b..35b5bb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2e3=['show','find','create','body','update','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','sendStatus','name','index','SmsQueueReport','rawAttributes','keys','query','dateEnd','dateStart','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day','merge','filter','options','includeAll','include','rows','catch'];(function(_0x43c695,_0x1169d1){var _0x5e402e=function(_0x267b12){while(--_0x267b12){_0x43c695['push'](_0x43c695['shift']());}};_0x5e402e(++_0x1169d1);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xf2e3[_0x599f41];return _0x2e4d58;};'use strict';var pdf=require(_0x3f2e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3f2e('0x1'));var zipdir=require(_0x3f2e('0x2'));var jsonpatch=require(_0x3f2e('0x3'));var rp=require(_0x3f2e('0x4'));var moment=require(_0x3f2e('0x5'));var BPromise=require(_0x3f2e('0x6'));var Mustache=require(_0x3f2e('0x7'));var util=require(_0x3f2e('0x8'));var path=require(_0x3f2e('0x9'));var sox=require('sox');var csv=require(_0x3f2e('0xa'));var ejs=require(_0x3f2e('0xb'));var fs=require('fs');var _=require(_0x3f2e('0xc'));var squel=require(_0x3f2e('0xd'));var crypto=require(_0x3f2e('0xe'));var jsforce=require(_0x3f2e('0xf'));var deskjs=require(_0x3f2e('0x10'));var toCsv=require(_0x3f2e('0xa'));var querystring=require(_0x3f2e('0x11'));var Papa=require(_0x3f2e('0x12'));var qs=require(_0x3f2e('0x13'));var logger=require(_0x3f2e('0x14'))(_0x3f2e('0x15'));var utils=require(_0x3f2e('0x16'));var config=require(_0x3f2e('0x17'));var db=require(_0x3f2e('0x18'))['db'];function respondWithStatusCode(_0x824ee8,_0x475cd2){_0x475cd2=_0x475cd2||0xcc;return function(_0x39b819){if(_0x39b819){return _0x824ee8['sendStatus'](_0x475cd2);}return _0x824ee8[_0x3f2e('0x19')](_0x475cd2)[_0x3f2e('0x1a')]();};}function respondWithResult(_0x5471f9,_0xe83663){_0xe83663=_0xe83663||0xc8;return function(_0x65a39){if(_0x65a39){return _0x5471f9[_0x3f2e('0x19')](_0xe83663)[_0x3f2e('0x1b')](_0x65a39);}};}function respondWithFilteredResult(_0x3d20d1,_0x57cba7){return function(_0x298080){if(_0x298080){var _0xfee068=_0x298080[_0x3f2e('0x1c')],_0x2d2fac=_0x57cba7[_0x3f2e('0x1d')],_0x4f2e38=_0x57cba7[_0x3f2e('0x1d')]+_0x57cba7[_0x3f2e('0x1e')],_0x43f69e;if(_0x4f2e38>=_0xfee068){_0x4f2e38=_0xfee068;_0x43f69e=0xc8;}else{_0x43f69e=0xce;}_0x3d20d1[_0x3f2e('0x19')](_0x43f69e);return _0x3d20d1[_0x3f2e('0x1f')](_0x3f2e('0x20'),_0x2d2fac+'-'+_0x4f2e38+'/'+_0xfee068)[_0x3f2e('0x1b')](_0x298080);}return null;};}function patchUpdates(_0xc00add){return function(_0x107876){try{jsonpatch['apply'](_0x107876,_0xc00add,!![]);}catch(_0x40e28f){return BPromise[_0x3f2e('0x21')](_0x40e28f);}return _0x107876[_0x3f2e('0x22')]();};}function saveUpdates(_0xbe899c,_0x167b60){return function(_0x4eb1e7){if(_0x4eb1e7){return _0x4eb1e7['update'](_0xbe899c)[_0x3f2e('0x23')](function(_0x11f84c){return _0x11f84c;});}return null;};}function removeEntity(_0x38bbae,_0x2ac500){return function(_0x4381e5){if(_0x4381e5){return _0x4381e5[_0x3f2e('0x24')]()['then'](function(){_0x38bbae['status'](0xcc)[_0x3f2e('0x1a')]();});}};}function handleEntityNotFound(_0x37dab2,_0x5a66d6){return function(_0x541292){if(!_0x541292){_0x37dab2[_0x3f2e('0x25')](0x194);}return _0x541292;};}function handleError(_0x5646f5,_0x1b8c67){_0x1b8c67=_0x1b8c67||0x1f4;return function(_0x401ed9){logger['error'](_0x401ed9['stack']);if(_0x401ed9['name']){delete _0x401ed9[_0x3f2e('0x26')];}_0x5646f5[_0x3f2e('0x19')](_0x1b8c67)['send'](_0x401ed9);};}exports[_0x3f2e('0x27')]=function(_0x47eca6,_0x1ad875){var _0x598541={},_0x2806d0={},_0x8247fa={'count':0x0,'rows':[]};var _0x12926e=db[_0x3f2e('0x28')][_0x3f2e('0x29')];_0x2806d0['model']=_[_0x3f2e('0x2a')](_0x12926e);var _0x28ef64={'dateStart':_0x47eca6['query']['dateStart'],'dateEnd':_0x47eca6[_0x3f2e('0x2b')][_0x3f2e('0x2c')]};delete _0x47eca6[_0x3f2e('0x2b')][_0x3f2e('0x2d')];delete _0x47eca6['query'][_0x3f2e('0x2c')];_0x2806d0[_0x3f2e('0x2b')]=_[_0x3f2e('0x2a')](_0x47eca6['query']);_0x2806d0[_0x3f2e('0x2e')]=_[_0x3f2e('0x2f')](_0x2806d0[_0x3f2e('0x30')],_0x2806d0['query']);_0x598541[_0x3f2e('0x31')]=_[_0x3f2e('0x2f')](_0x2806d0[_0x3f2e('0x30')],qs[_0x3f2e('0x32')](_0x47eca6[_0x3f2e('0x2b')][_0x3f2e('0x32')]));_0x598541['attributes']=_0x598541[_0x3f2e('0x31')][_0x3f2e('0x33')]?_0x598541[_0x3f2e('0x31')]:_0x2806d0[_0x3f2e('0x30')];if(!_0x47eca6[_0x3f2e('0x2b')][_0x3f2e('0x34')](_0x3f2e('0x35'))){_0x598541['limit']=qs[_0x3f2e('0x1e')](_0x47eca6[_0x3f2e('0x2b')][_0x3f2e('0x1e')]);_0x598541[_0x3f2e('0x1d')]=qs['offset'](_0x47eca6['query'][_0x3f2e('0x1d')]);}_0x598541[_0x3f2e('0x36')]=qs[_0x3f2e('0x37')](_0x47eca6[_0x3f2e('0x2b')][_0x3f2e('0x37')]);_0x598541[_0x3f2e('0x38')]=qs[_0x3f2e('0x2e')](_[_0x3f2e('0x39')](_0x47eca6[_0x3f2e('0x2b')],_0x2806d0[_0x3f2e('0x2e')]));if(_0x28ef64['dateStart']){if(_0x28ef64[_0x3f2e('0x2c')]){_0x28ef64[_0x3f2e('0x2c')]=moment(_0x28ef64[_0x3f2e('0x2c')])[_0x3f2e('0x3a')](0x1,'day');}else{_0x28ef64[_0x3f2e('0x2c')]=moment(_0x28ef64[_0x3f2e('0x2d')])[_0x3f2e('0x3a')](0x1,_0x3f2e('0x3b'));}_[_0x3f2e('0x3c')](_0x598541[_0x3f2e('0x38')],{'createdAt':{'$gte':_0x28ef64[_0x3f2e('0x2d')],'$lte':_0x28ef64[_0x3f2e('0x2c')]}});}if(_0x47eca6['query'][_0x3f2e('0x3d')]){_0x598541[_0x3f2e('0x38')]=_[_0x3f2e('0x3c')](_0x598541[_0x3f2e('0x38')],{'$or':_['map'](_0x598541[_0x3f2e('0x31')],function(_0x160d63){var _0x4cb56b={};_0x4cb56b[_0x160d63]={'$like':'%'+_0x47eca6[_0x3f2e('0x2b')][_0x3f2e('0x3d')]+'%'};return _0x4cb56b;})});}_0x598541=_['merge']({},_0x598541,_0x47eca6[_0x3f2e('0x3e')]);var _0x7f189f={'where':_0x598541[_0x3f2e('0x38')]};return db[_0x3f2e('0x28')]['count'](_0x7f189f)[_0x3f2e('0x23')](function(_0x31283b){_0x8247fa['count']=_0x31283b;if(_0x47eca6['query'][_0x3f2e('0x3f')]){_0x598541[_0x3f2e('0x40')]=[{'all':!![]}];}return db[_0x3f2e('0x28')]['findAll'](_0x598541);})[_0x3f2e('0x23')](function(_0x2c122d){_0x8247fa[_0x3f2e('0x41')]=_0x2c122d;return _0x8247fa;})[_0x3f2e('0x23')](respondWithFilteredResult(_0x1ad875,_0x598541))[_0x3f2e('0x42')](handleError(_0x1ad875,null));};exports[_0x3f2e('0x43')]=function(_0x19e2ae,_0x913778){var _0x375484={'raw':!![],'where':{'id':_0x19e2ae['params']['id']}},_0x1f7d6e={};_0x1f7d6e['model']=_[_0x3f2e('0x2a')](db[_0x3f2e('0x28')]['rawAttributes']);_0x1f7d6e['query']=_[_0x3f2e('0x2a')](_0x19e2ae[_0x3f2e('0x2b')]);_0x1f7d6e[_0x3f2e('0x2e')]=_['intersection'](_0x1f7d6e[_0x3f2e('0x30')],_0x1f7d6e[_0x3f2e('0x2b')]);_0x375484[_0x3f2e('0x31')]=_['intersection'](_0x1f7d6e[_0x3f2e('0x30')],qs[_0x3f2e('0x32')](_0x19e2ae[_0x3f2e('0x2b')]['fields']));_0x375484[_0x3f2e('0x31')]=_0x375484[_0x3f2e('0x31')][_0x3f2e('0x33')]?_0x375484['attributes']:_0x1f7d6e[_0x3f2e('0x30')];if(_0x19e2ae['query'][_0x3f2e('0x3f')]){_0x375484['include']=[{'all':!![]}];}_0x375484=_['merge']({},_0x375484,_0x19e2ae[_0x3f2e('0x3e')]);return db[_0x3f2e('0x28')][_0x3f2e('0x44')](_0x375484)[_0x3f2e('0x23')](handleEntityNotFound(_0x913778,null))[_0x3f2e('0x23')](respondWithResult(_0x913778,null))['catch'](handleError(_0x913778,null));};exports['create']=function(_0x231491,_0x2d81c4){return db[_0x3f2e('0x28')][_0x3f2e('0x45')](_0x231491[_0x3f2e('0x46')],{})[_0x3f2e('0x23')](respondWithResult(_0x2d81c4,0xc9))[_0x3f2e('0x42')](handleError(_0x2d81c4,null));};exports[_0x3f2e('0x47')]=function(_0x302559,_0x4b952c){if(_0x302559['body']['id']){delete _0x302559[_0x3f2e('0x46')]['id'];}return db['SmsQueueReport'][_0x3f2e('0x44')]({'where':{'id':_0x302559[_0x3f2e('0x48')]['id']}})[_0x3f2e('0x23')](handleEntityNotFound(_0x4b952c,null))[_0x3f2e('0x23')](saveUpdates(_0x302559['body'],null))[_0x3f2e('0x23')](respondWithResult(_0x4b952c,null))['catch'](handleError(_0x4b952c,null));};exports[_0x3f2e('0x24')]=function(_0x7ed57d,_0x57a2f7){return db[_0x3f2e('0x28')]['find']({'where':{'id':_0x7ed57d[_0x3f2e('0x48')]['id']}})[_0x3f2e('0x23')](handleEntityNotFound(_0x57a2f7,null))[_0x3f2e('0x23')](removeEntity(_0x57a2f7,null))['catch'](handleError(_0x57a2f7,null));};exports[_0x3f2e('0x49')]=function(_0x3e72ae,_0x2f4b5c){return db[_0x3f2e('0x28')][_0x3f2e('0x49')]()[_0x3f2e('0x23')](respondWithResult(_0x2f4b5c,null))[_0x3f2e('0x42')](handleError(_0x2f4b5c,null));};
\ No newline at end of file
+var _0xdb28=['status','end','json','count','offset','limit','set','Content-Range','apply','save','then','name','send','index','SmsQueueReport','model','keys','query','dateStart','dateEnd','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','add','day','filter','where','merge','map','options','rows','catch','show','params','rawAttributes','length','includeAll','include','create','body','find','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus'];(function(_0x5dbdd8,_0x22d6b1){var _0xc07dfa=function(_0x25330b){while(--_0x25330b){_0x5dbdd8['push'](_0x5dbdd8['shift']());}};_0xc07dfa(++_0x22d6b1);}(_0xdb28,0x106));var _0x8db2=function(_0xc0b121,_0x54bd61){_0xc0b121=_0xc0b121-0x0;var _0x155744=_0xdb28[_0xc0b121];return _0x155744;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0xa'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x8db2('0x11'))(_0x8db2('0x12'));var utils=require(_0x8db2('0x13'));var config=require('../../config/environment');var db=require(_0x8db2('0x14'))['db'];function respondWithStatusCode(_0x150942,_0x576475){_0x576475=_0x576475||0xcc;return function(_0x41beda){if(_0x41beda){return _0x150942[_0x8db2('0x15')](_0x576475);}return _0x150942[_0x8db2('0x16')](_0x576475)[_0x8db2('0x17')]();};}function respondWithResult(_0x37d017,_0x559fb1){_0x559fb1=_0x559fb1||0xc8;return function(_0x49fadc){if(_0x49fadc){return _0x37d017[_0x8db2('0x16')](_0x559fb1)[_0x8db2('0x18')](_0x49fadc);}};}function respondWithFilteredResult(_0x350d61,_0x1d6a15){return function(_0x227355){if(_0x227355){var _0xfa285b=_0x227355[_0x8db2('0x19')],_0x2f177a=_0x1d6a15['offset'],_0x3c96a7=_0x1d6a15[_0x8db2('0x1a')]+_0x1d6a15[_0x8db2('0x1b')],_0x131252;if(_0x3c96a7>=_0xfa285b){_0x3c96a7=_0xfa285b;_0x131252=0xc8;}else{_0x131252=0xce;}_0x350d61['status'](_0x131252);return _0x350d61[_0x8db2('0x1c')](_0x8db2('0x1d'),_0x2f177a+'-'+_0x3c96a7+'/'+_0xfa285b)[_0x8db2('0x18')](_0x227355);}return null;};}function patchUpdates(_0x3fddc2){return function(_0x2efd06){try{jsonpatch[_0x8db2('0x1e')](_0x2efd06,_0x3fddc2,!![]);}catch(_0x51d60d){return BPromise['reject'](_0x51d60d);}return _0x2efd06[_0x8db2('0x1f')]();};}function saveUpdates(_0x104e33,_0x1310d3){return function(_0x1b64e4){if(_0x1b64e4){return _0x1b64e4['update'](_0x104e33)[_0x8db2('0x20')](function(_0x36a9ff){return _0x36a9ff;});}return null;};}function removeEntity(_0x260940,_0x297ba3){return function(_0x3dbe8e){if(_0x3dbe8e){return _0x3dbe8e['destroy']()[_0x8db2('0x20')](function(){_0x260940[_0x8db2('0x16')](0xcc)[_0x8db2('0x17')]();});}};}function handleEntityNotFound(_0x125be2,_0x2260d8){return function(_0x21704c){if(!_0x21704c){_0x125be2[_0x8db2('0x15')](0x194);}return _0x21704c;};}function handleError(_0x5c6614,_0x256202){_0x256202=_0x256202||0x1f4;return function(_0x4f6516){logger['error'](_0x4f6516['stack']);if(_0x4f6516['name']){delete _0x4f6516[_0x8db2('0x21')];}_0x5c6614[_0x8db2('0x16')](_0x256202)[_0x8db2('0x22')](_0x4f6516);};}exports[_0x8db2('0x23')]=function(_0x145328,_0x8d4f54){var _0x58cd9d={},_0x3544ba={},_0x372311={'count':0x0,'rows':[]};var _0x430dd5=db[_0x8db2('0x24')]['rawAttributes'];_0x3544ba[_0x8db2('0x25')]=_[_0x8db2('0x26')](_0x430dd5);var _0x241baf={'dateStart':_0x145328[_0x8db2('0x27')][_0x8db2('0x28')],'dateEnd':_0x145328[_0x8db2('0x27')][_0x8db2('0x29')]};delete _0x145328[_0x8db2('0x27')][_0x8db2('0x28')];delete _0x145328['query'][_0x8db2('0x29')];_0x3544ba['query']=_['keys'](_0x145328[_0x8db2('0x27')]);_0x3544ba[_0x8db2('0x2a')]=_[_0x8db2('0x2b')](_0x3544ba['model'],_0x3544ba[_0x8db2('0x27')]);_0x58cd9d['attributes']=_[_0x8db2('0x2b')](_0x3544ba[_0x8db2('0x25')],qs[_0x8db2('0x2c')](_0x145328['query']['fields']));_0x58cd9d[_0x8db2('0x2d')]=_0x58cd9d[_0x8db2('0x2d')]['length']?_0x58cd9d['attributes']:_0x3544ba[_0x8db2('0x25')];if(!_0x145328[_0x8db2('0x27')][_0x8db2('0x2e')](_0x8db2('0x2f'))){_0x58cd9d[_0x8db2('0x1b')]=qs[_0x8db2('0x1b')](_0x145328[_0x8db2('0x27')][_0x8db2('0x1b')]);_0x58cd9d[_0x8db2('0x1a')]=qs[_0x8db2('0x1a')](_0x145328['query'][_0x8db2('0x1a')]);}_0x58cd9d[_0x8db2('0x30')]=qs['sort'](_0x145328[_0x8db2('0x27')][_0x8db2('0x31')]);_0x58cd9d['where']=qs['filters'](_[_0x8db2('0x32')](_0x145328['query'],_0x3544ba[_0x8db2('0x2a')]));if(_0x241baf[_0x8db2('0x28')]){if(_0x241baf[_0x8db2('0x29')]){_0x241baf[_0x8db2('0x29')]=moment(_0x241baf['dateEnd'])[_0x8db2('0x33')](0x1,'day');}else{_0x241baf[_0x8db2('0x29')]=moment(_0x241baf[_0x8db2('0x28')])[_0x8db2('0x33')](0x1,_0x8db2('0x34'));}_['merge'](_0x58cd9d['where'],{'createdAt':{'$gte':_0x241baf[_0x8db2('0x28')],'$lte':_0x241baf[_0x8db2('0x29')]}});}if(_0x145328['query'][_0x8db2('0x35')]){_0x58cd9d[_0x8db2('0x36')]=_[_0x8db2('0x37')](_0x58cd9d['where'],{'$or':_[_0x8db2('0x38')](_0x58cd9d[_0x8db2('0x2d')],function(_0x953349){var _0x279e74={};_0x279e74[_0x953349]={'$like':'%'+_0x145328[_0x8db2('0x27')][_0x8db2('0x35')]+'%'};return _0x279e74;})});}_0x58cd9d=_[_0x8db2('0x37')]({},_0x58cd9d,_0x145328[_0x8db2('0x39')]);var _0x3793a4={'where':_0x58cd9d[_0x8db2('0x36')]};return db[_0x8db2('0x24')][_0x8db2('0x19')](_0x3793a4)[_0x8db2('0x20')](function(_0x4a1c60){_0x372311[_0x8db2('0x19')]=_0x4a1c60;if(_0x145328[_0x8db2('0x27')]['includeAll']){_0x58cd9d['include']=[{'all':!![]}];}return db[_0x8db2('0x24')]['findAll'](_0x58cd9d);})[_0x8db2('0x20')](function(_0x654b8c){_0x372311[_0x8db2('0x3a')]=_0x654b8c;return _0x372311;})[_0x8db2('0x20')](respondWithFilteredResult(_0x8d4f54,_0x58cd9d))[_0x8db2('0x3b')](handleError(_0x8d4f54,null));};exports[_0x8db2('0x3c')]=function(_0xa53fba,_0x5c97ef){var _0x2f86b1={'raw':!![],'where':{'id':_0xa53fba[_0x8db2('0x3d')]['id']}},_0x3d44de={};_0x3d44de[_0x8db2('0x25')]=_['keys'](db[_0x8db2('0x24')][_0x8db2('0x3e')]);_0x3d44de[_0x8db2('0x27')]=_[_0x8db2('0x26')](_0xa53fba['query']);_0x3d44de[_0x8db2('0x2a')]=_['intersection'](_0x3d44de[_0x8db2('0x25')],_0x3d44de[_0x8db2('0x27')]);_0x2f86b1[_0x8db2('0x2d')]=_['intersection'](_0x3d44de['model'],qs[_0x8db2('0x2c')](_0xa53fba['query'][_0x8db2('0x2c')]));_0x2f86b1[_0x8db2('0x2d')]=_0x2f86b1[_0x8db2('0x2d')][_0x8db2('0x3f')]?_0x2f86b1[_0x8db2('0x2d')]:_0x3d44de[_0x8db2('0x25')];if(_0xa53fba[_0x8db2('0x27')][_0x8db2('0x40')]){_0x2f86b1[_0x8db2('0x41')]=[{'all':!![]}];}_0x2f86b1=_[_0x8db2('0x37')]({},_0x2f86b1,_0xa53fba[_0x8db2('0x39')]);return db[_0x8db2('0x24')]['find'](_0x2f86b1)[_0x8db2('0x20')](handleEntityNotFound(_0x5c97ef,null))[_0x8db2('0x20')](respondWithResult(_0x5c97ef,null))[_0x8db2('0x3b')](handleError(_0x5c97ef,null));};exports[_0x8db2('0x42')]=function(_0x4f5018,_0x4ffd9d){return db[_0x8db2('0x24')][_0x8db2('0x42')](_0x4f5018[_0x8db2('0x43')],{})['then'](respondWithResult(_0x4ffd9d,0xc9))['catch'](handleError(_0x4ffd9d,null));};exports['update']=function(_0x44ac56,_0x368c37){if(_0x44ac56[_0x8db2('0x43')]['id']){delete _0x44ac56[_0x8db2('0x43')]['id'];}return db[_0x8db2('0x24')][_0x8db2('0x44')]({'where':{'id':_0x44ac56[_0x8db2('0x3d')]['id']}})['then'](handleEntityNotFound(_0x368c37,null))['then'](saveUpdates(_0x44ac56[_0x8db2('0x43')],null))[_0x8db2('0x20')](respondWithResult(_0x368c37,null))[_0x8db2('0x3b')](handleError(_0x368c37,null));};exports[_0x8db2('0x45')]=function(_0x3daed6,_0x2bf408){return db[_0x8db2('0x24')][_0x8db2('0x44')]({'where':{'id':_0x3daed6[_0x8db2('0x3d')]['id']}})[_0x8db2('0x20')](handleEntityNotFound(_0x2bf408,null))[_0x8db2('0x20')](removeEntity(_0x2bf408,null))[_0x8db2('0x3b')](handleError(_0x2bf408,null));};exports[_0x8db2('0x46')]=function(_0x2d518a,_0x47696e){return db['SmsQueueReport'][_0x8db2('0x46')]()[_0x8db2('0x20')](respondWithResult(_0x47696e,null))['catch'](handleError(_0x47696e,null));};
\ No newline at end of file
index 002760a..ba09021 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf44d=['../../config/logger','api','moment','bluebird','request-promise','./smsQueueReport.attributes','exports','define','SmsQueueReport','uniqueid','lodash','util'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xf44d,0x1ea));var _0xdf44=function(_0x46bc7d,_0x2daa33){_0x46bc7d=_0x46bc7d-0x0;var _0x52c61f=_0xf44d[_0x46bc7d];return _0x52c61f;};'use strict';var _=require(_0xdf44('0x0'));var util=require(_0xdf44('0x1'));var logger=require(_0xdf44('0x2'))(_0xdf44('0x3'));var moment=require(_0xdf44('0x4'));var BPromise=require(_0xdf44('0x5'));var rp=require(_0xdf44('0x6'));var attributes=require(_0xdf44('0x7'));module[_0xdf44('0x8')]=function(_0x2b21ec,_0x2b10d1){return _0x2b21ec[_0xdf44('0x9')](_0xdf44('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xdf44('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xeb0f=['SmsQueueReport','report_sms_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','./smsQueueReport.attributes','exports','define'];(function(_0x1ca4cc,_0x402c23){var _0x108010=function(_0x4c5082){while(--_0x4c5082){_0x1ca4cc['push'](_0x1ca4cc['shift']());}};_0x108010(++_0x402c23);}(_0xeb0f,0x10b));var _0xfeb0=function(_0x49fbcd,_0x56b2d4){_0x49fbcd=_0x49fbcd-0x0;var _0x16590e=_0xeb0f[_0x49fbcd];return _0x16590e;};'use strict';var _=require(_0xfeb0('0x0'));var util=require(_0xfeb0('0x1'));var logger=require(_0xfeb0('0x2'))(_0xfeb0('0x3'));var moment=require(_0xfeb0('0x4'));var BPromise=require(_0xfeb0('0x5'));var rp=require('request-promise');var attributes=require(_0xfeb0('0x6'));module[_0xfeb0('0x7')]=function(_0x35e116,_0x83bc54){return _0x35e116[_0xfeb0('0x8')](_0xfeb0('0x9'),attributes,{'tableName':_0xfeb0('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xfeb0('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index d362029..e59f7c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0102=['util','moment','bluebird','randomstring','jayson/promise','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','body','options','raw','UpdateSmsQueueReport','SmsQueueReport','update','where','attributes','limit','then'];(function(_0x2b06c0,_0x5cb332){var _0x12d302=function(_0x12fa89){while(--_0x12fa89){_0x2b06c0['push'](_0x2b06c0['shift']());}};_0x12d302(++_0x5cb332);}(_0x0102,0x186));var _0x2010=function(_0x3d9648,_0x2b424f){_0x3d9648=_0x3d9648-0x0;var _0x2eadbc=_0x0102[_0x3d9648];return _0x2eadbc;};'use strict';var _=require('lodash');var util=require(_0x2010('0x0'));var moment=require(_0x2010('0x1'));var BPromise=require(_0x2010('0x2'));var rs=require(_0x2010('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x2010('0x4'));var client=jayson[_0x2010('0x5')][_0x2010('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x304264,_0x4eeb67,_0x453fc0){return new BPromise(function(_0x495d98,_0x4728c0){return client[_0x2010('0x7')](_0x304264,_0x453fc0)['then'](function(_0x1f94ca){logger[_0x2010('0x8')](_0x2010('0x9'),_0x4eeb67,_0x2010('0xa'));logger[_0x2010('0xb')](_0x2010('0xc'),_0x4eeb67,_0x2010('0xa'),JSON[_0x2010('0xd')](_0x1f94ca));if(_0x1f94ca[_0x2010('0xe')]){if(_0x1f94ca[_0x2010('0xe')][_0x2010('0xf')]===0x1f4){logger[_0x2010('0xe')](_0x2010('0x9'),_0x4eeb67,_0x1f94ca[_0x2010('0xe')][_0x2010('0x10')]);return _0x4728c0(_0x1f94ca[_0x2010('0xe')]['message']);}logger['error'](_0x2010('0x9'),_0x4eeb67,_0x1f94ca[_0x2010('0xe')][_0x2010('0x10')]);return _0x495d98(_0x1f94ca[_0x2010('0xe')][_0x2010('0x10')]);}else{logger[_0x2010('0x8')]('SmsQueueReport,\x20%s,\x20%s',_0x4eeb67,_0x2010('0xa'));_0x495d98(_0x1f94ca[_0x2010('0x11')]['message']);}})[_0x2010('0x12')](function(_0x11c94b){logger[_0x2010('0xe')](_0x2010('0x9'),_0x4eeb67,_0x11c94b);_0x4728c0(_0x11c94b);});});}exports[_0x2010('0x13')]=function(_0x11bd28){var _0x83cd35=this;return new Promise(function(_0x1476c0,_0x309477){return db['SmsQueueReport']['create'](_0x11bd28[_0x2010('0x14')],{'raw':_0x11bd28[_0x2010('0x15')]?_0x11bd28[_0x2010('0x15')][_0x2010('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x51075e){logger[_0x2010('0x8')](_0x2010('0x13'),_0x11bd28);logger[_0x2010('0xb')](_0x2010('0x13'),_0x11bd28,JSON[_0x2010('0xd')](_0x51075e));_0x1476c0(_0x51075e);})[_0x2010('0x12')](function(_0x4f621c){logger[_0x2010('0xe')](_0x2010('0x13'),_0x4f621c['message'],_0x11bd28);_0x309477(_0x83cd35['error'](0x1f4,_0x4f621c['message']));});});};exports[_0x2010('0x17')]=function(_0x574719){var _0x277dcc=this;return new Promise(function(_0x5f4233,_0x5cd8a9){return db[_0x2010('0x18')][_0x2010('0x19')](_0x574719['body'],{'raw':_0x574719[_0x2010('0x15')]?_0x574719['options'][_0x2010('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x574719[_0x2010('0x15')]?_0x574719[_0x2010('0x15')][_0x2010('0x1a')]||null:null,'attributes':_0x574719[_0x2010('0x15')]?_0x574719[_0x2010('0x15')][_0x2010('0x1b')]||null:null,'limit':_0x574719[_0x2010('0x15')]?_0x574719[_0x2010('0x15')][_0x2010('0x1c')]||null:null})[_0x2010('0x1d')](function(_0x2ebdbb){logger['info'](_0x2010('0x17'),_0x574719);logger['debug'](_0x2010('0x17'),_0x574719,JSON[_0x2010('0xd')](_0x2ebdbb));_0x5f4233(_0x2ebdbb);})[_0x2010('0x12')](function(_0x188e35){logger['error']('UpdateSmsQueueReport',_0x188e35[_0x2010('0x10')],_0x574719);_0x5cd8a9(_0x277dcc['error'](0x1f4,_0x188e35[_0x2010('0x10')]));});});};
\ No newline at end of file
+var _0xb01a=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','SmsQueueReport,\x20%s,\x20%s','message','result','catch','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport','update','where','attributes','limit','lodash','util','moment'];(function(_0xbdb11,_0x33fa5d){var _0x1e95ab=function(_0xc63160){while(--_0xc63160){_0xbdb11['push'](_0xbdb11['shift']());}};_0x1e95ab(++_0x33fa5d);}(_0xb01a,0x1a1));var _0xab01=function(_0x25057a,_0x43a0fd){_0x25057a=_0x25057a-0x0;var _0x408369=_0xb01a[_0x25057a];return _0x408369;};'use strict';var _=require(_0xab01('0x0'));var util=require(_0xab01('0x1'));var moment=require(_0xab01('0x2'));var BPromise=require(_0xab01('0x3'));var rs=require(_0xab01('0x4'));var fs=require('fs');var db=require(_0xab01('0x5'))['db'];var utils=require(_0xab01('0x6'));var logger=require(_0xab01('0x7'))(_0xab01('0x8'));var config=require(_0xab01('0x9'));var jayson=require(_0xab01('0xa'));var client=jayson[_0xab01('0xb')][_0xab01('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5d8dd9,_0x13957f,_0x21be3d){return new BPromise(function(_0x4b413e,_0x52146e){return client[_0xab01('0xd')](_0x5d8dd9,_0x21be3d)[_0xab01('0xe')](function(_0x5bc6e9){logger[_0xab01('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x13957f,'request\x20sent');logger[_0xab01('0x10')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x13957f,_0xab01('0x11'),JSON[_0xab01('0x12')](_0x5bc6e9));if(_0x5bc6e9['error']){if(_0x5bc6e9[_0xab01('0x13')]['code']===0x1f4){logger['error'](_0xab01('0x14'),_0x13957f,_0x5bc6e9[_0xab01('0x13')][_0xab01('0x15')]);return _0x52146e(_0x5bc6e9[_0xab01('0x13')][_0xab01('0x15')]);}logger[_0xab01('0x13')](_0xab01('0x14'),_0x13957f,_0x5bc6e9[_0xab01('0x13')]['message']);return _0x4b413e(_0x5bc6e9['error']['message']);}else{logger['info'](_0xab01('0x14'),_0x13957f,'request\x20sent');_0x4b413e(_0x5bc6e9[_0xab01('0x16')][_0xab01('0x15')]);}})[_0xab01('0x17')](function(_0x17dddb){logger['error'](_0xab01('0x14'),_0x13957f,_0x17dddb);_0x52146e(_0x17dddb);});});}exports['CreateSmsQueueReport']=function(_0x2adbe5){var _0xb59105=this;return new Promise(function(_0x47e994,_0x5a9940){return db[_0xab01('0x18')][_0xab01('0x19')](_0x2adbe5[_0xab01('0x1a')],{'raw':_0x2adbe5[_0xab01('0x1b')]?_0x2adbe5[_0xab01('0x1b')][_0xab01('0x1c')]===undefined?!![]:![]:!![]})[_0xab01('0xe')](function(_0x2fabee){logger[_0xab01('0xf')](_0xab01('0x1d'),_0x2adbe5);logger['debug'](_0xab01('0x1d'),_0x2adbe5,JSON[_0xab01('0x12')](_0x2fabee));_0x47e994(_0x2fabee);})[_0xab01('0x17')](function(_0xac3a88){logger[_0xab01('0x13')](_0xab01('0x1d'),_0xac3a88[_0xab01('0x15')],_0x2adbe5);_0x5a9940(_0xb59105[_0xab01('0x13')](0x1f4,_0xac3a88['message']));});});};exports[_0xab01('0x1e')]=function(_0x152d5e){var _0x27b430=this;return new Promise(function(_0x343ae6,_0x134c46){return db[_0xab01('0x18')][_0xab01('0x1f')](_0x152d5e['body'],{'raw':_0x152d5e[_0xab01('0x1b')]?_0x152d5e[_0xab01('0x1b')][_0xab01('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x152d5e[_0xab01('0x1b')]?_0x152d5e[_0xab01('0x1b')][_0xab01('0x20')]||null:null,'attributes':_0x152d5e[_0xab01('0x1b')]?_0x152d5e['options'][_0xab01('0x21')]||null:null,'limit':_0x152d5e[_0xab01('0x1b')]?_0x152d5e[_0xab01('0x1b')][_0xab01('0x22')]||null:null})[_0xab01('0xe')](function(_0x409fa1){logger['info'](_0xab01('0x1e'),_0x152d5e);logger[_0xab01('0x10')]('UpdateSmsQueueReport',_0x152d5e,JSON[_0xab01('0x12')](_0x409fa1));_0x343ae6(_0x409fa1);})[_0xab01('0x17')](function(_0x2c9c6c){logger[_0xab01('0x13')](_0xab01('0x1e'),_0x2c9c6c[_0xab01('0x15')],_0x152d5e);_0x134c46(_0x27b430[_0xab01('0x13')](0x1f4,_0x2c9c6c[_0xab01('0x15')]));});});};
\ No newline at end of file
index 01d860c..832a4e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd71d=['exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd71d,0x1a5));var _0xdd71=function(_0x3f578f,_0x51f172){_0x3f578f=_0x3f578f-0x0;var _0x32c754=_0xd71d[_0x3f578f];return _0x32c754;};'use strict';var multer=require(_0xdd71('0x0'));var util=require(_0xdd71('0x1'));var path=require(_0xdd71('0x2'));var express=require(_0xdd71('0x3'));var router=express[_0xdd71('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xdd71('0x5'));var config=require(_0xdd71('0x6'));var controller=require(_0xdd71('0x7'));router['get']('/',auth[_0xdd71('0x8')](),controller[_0xdd71('0x9')]);router[_0xdd71('0xa')]('/describe',auth[_0xdd71('0x8')](),controller[_0xdd71('0xb')]);router[_0xdd71('0xa')](_0xdd71('0xc'),auth['isAuthenticated'](),controller[_0xdd71('0xd')]);router[_0xdd71('0xe')]('/',auth[_0xdd71('0x8')](),controller[_0xdd71('0xf')]);router[_0xdd71('0x10')]('/:id',auth[_0xdd71('0x8')](),controller[_0xdd71('0x11')]);router[_0xdd71('0x12')](_0xdd71('0xc'),auth['isAuthenticated'](),controller[_0xdd71('0x13')]);module[_0xdd71('0x14')]=router;
\ No newline at end of file
+var _0x422f=['../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','delete','exports','util','express','Router','../../components/interaction/service'];(function(_0x84034c,_0x5ac467){var _0x4a68eb=function(_0x3e90f6){while(--_0x3e90f6){_0x84034c['push'](_0x84034c['shift']());}};_0x4a68eb(++_0x5ac467);}(_0x422f,0x1c7));var _0xf422=function(_0x12b7cb,_0x3d428e){_0x12b7cb=_0x12b7cb-0x0;var _0x7acbd4=_0x422f[_0x12b7cb];return _0x7acbd4;};'use strict';var multer=require('multer');var util=require(_0xf422('0x0'));var path=require('path');var express=require(_0xf422('0x1'));var router=express[_0xf422('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xf422('0x3'));var config=require(_0xf422('0x4'));var controller=require(_0xf422('0x5'));router[_0xf422('0x6')]('/',auth[_0xf422('0x7')](),controller[_0xf422('0x8')]);router[_0xf422('0x6')](_0xf422('0x9'),auth[_0xf422('0x7')](),controller['describe']);router[_0xf422('0x6')](_0xf422('0xa'),auth[_0xf422('0x7')](),controller[_0xf422('0xb')]);router[_0xf422('0xc')]('/',auth['isAuthenticated'](),controller[_0xf422('0xd')]);router['put']('/:id',auth[_0xf422('0x7')](),controller[_0xf422('0xe')]);router[_0xf422('0xf')](_0xf422('0xa'),auth[_0xf422('0x7')](),controller['destroy']);module[_0xf422('0x10')]=router;
\ No newline at end of file
index 843310b..ccd3c7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6f3=['queue','NOW','moment','sequelize','exports','STRING','account'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xa6f3,0x79));var _0x3a6f=function(_0x183b97,_0x2d297c){_0x183b97=_0x183b97-0x0;var _0x629cf7=_0xa6f3[_0x183b97];return _0x629cf7;};'use strict';var moment=require(_0x3a6f('0x0'));var Sequelize=require(_0x3a6f('0x1'));module[_0x3a6f('0x2')]={'uniqueid':{'type':Sequelize[_0x3a6f('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x3a6f('0x4'),'agent',_0x3a6f('0x5')),'allowNull':![],'defaultValue':_0x3a6f('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x3a6f('0x6')]}};
\ No newline at end of file
+var _0xd232=['sequelize','exports','STRING','account','agent','queue','DATE','moment'];(function(_0x31aac8,_0x1ac0e3){var _0x55448d=function(_0x396c5f){while(--_0x396c5f){_0x31aac8['push'](_0x31aac8['shift']());}};_0x55448d(++_0x1ac0e3);}(_0xd232,0xf7));var _0x2d23=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd232[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0x2d23('0x0'));var Sequelize=require(_0x2d23('0x1'));module[_0x2d23('0x2')]={'uniqueid':{'type':Sequelize[_0x2d23('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x2d23('0x4'),_0x2d23('0x5'),_0x2d23('0x6')),'allowNull':![],'defaultValue':_0x2d23('0x6')},'transferredAt':{'type':Sequelize[_0x2d23('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
index 1fd1db4..a4d7ba1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e8a=['model','attributes','fields','length','hasOwnProperty','limit','order','where','pick','add','day','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../config/logger','api','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','SmsTransferReport','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x1e8a,0x1b0));var _0xa1e8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e8a[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xa1e8('0x0'));var emlformat=require(_0xa1e8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa1e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1e8('0x3'));var moment=require(_0xa1e8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa1e8('0x5'));var util=require(_0xa1e8('0x6'));var path=require(_0xa1e8('0x7'));var sox=require(_0xa1e8('0x8'));var csv=require(_0xa1e8('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa1e8('0xa'));var squel=require(_0xa1e8('0xb'));var crypto=require(_0xa1e8('0xc'));var jsforce=require(_0xa1e8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa1e8('0x9'));var querystring=require(_0xa1e8('0xe'));var Papa=require(_0xa1e8('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0xa1e8('0x10'))(_0xa1e8('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xa1e8('0x12'))['db'];function respondWithStatusCode(_0x42eef8,_0x3442f5){_0x3442f5=_0x3442f5||0xcc;return function(_0x2569e1){if(_0x2569e1){return _0x42eef8[_0xa1e8('0x13')](_0x3442f5);}return _0x42eef8[_0xa1e8('0x14')](_0x3442f5)[_0xa1e8('0x15')]();};}function respondWithResult(_0x252edd,_0x4cdcad){_0x4cdcad=_0x4cdcad||0xc8;return function(_0x20d29c){if(_0x20d29c){return _0x252edd['status'](_0x4cdcad)['json'](_0x20d29c);}};}function respondWithFilteredResult(_0x29b3b6,_0x4dfdce){return function(_0x3625e0){if(_0x3625e0){var _0x3cd73d=_0x3625e0[_0xa1e8('0x16')],_0x2e8924=_0x4dfdce[_0xa1e8('0x17')],_0x66604c=_0x4dfdce['offset']+_0x4dfdce['limit'],_0x42ffdb;if(_0x66604c>=_0x3cd73d){_0x66604c=_0x3cd73d;_0x42ffdb=0xc8;}else{_0x42ffdb=0xce;}_0x29b3b6['status'](_0x42ffdb);return _0x29b3b6[_0xa1e8('0x18')](_0xa1e8('0x19'),_0x2e8924+'-'+_0x66604c+'/'+_0x3cd73d)[_0xa1e8('0x1a')](_0x3625e0);}return null;};}function patchUpdates(_0x4833f6){return function(_0x277c0a){try{jsonpatch[_0xa1e8('0x1b')](_0x277c0a,_0x4833f6,!![]);}catch(_0x78f346){return BPromise[_0xa1e8('0x1c')](_0x78f346);}return _0x277c0a['save']();};}function saveUpdates(_0xc7c510,_0xd8c578){return function(_0x3e4847){if(_0x3e4847){return _0x3e4847[_0xa1e8('0x1d')](_0xc7c510)[_0xa1e8('0x1e')](function(_0x548b87){return _0x548b87;});}return null;};}function removeEntity(_0x1dcb14,_0x48991c){return function(_0x16ffe9){if(_0x16ffe9){return _0x16ffe9[_0xa1e8('0x1f')]()[_0xa1e8('0x1e')](function(){_0x1dcb14['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f0f18,_0x3dd1a6){return function(_0x2e287a){if(!_0x2e287a){_0x3f0f18[_0xa1e8('0x13')](0x194);}return _0x2e287a;};}function handleError(_0x3a8c7a,_0x25c904){_0x25c904=_0x25c904||0x1f4;return function(_0x108bd4){logger['error'](_0x108bd4[_0xa1e8('0x20')]);if(_0x108bd4[_0xa1e8('0x21')]){delete _0x108bd4[_0xa1e8('0x21')];}_0x3a8c7a[_0xa1e8('0x14')](_0x25c904)[_0xa1e8('0x22')](_0x108bd4);};}exports[_0xa1e8('0x23')]=function(_0x352d87,_0x63bd8){var _0x23590c={},_0x3444b3={},_0xf296c9={'count':0x0,'rows':[]};var _0x29e0c5=db[_0xa1e8('0x24')][_0xa1e8('0x25')];_0x3444b3['model']=_[_0xa1e8('0x26')](_0x29e0c5);var _0x3926bb={'dateStart':_0x352d87[_0xa1e8('0x27')][_0xa1e8('0x28')],'dateEnd':_0x352d87[_0xa1e8('0x27')][_0xa1e8('0x29')]};delete _0x352d87[_0xa1e8('0x27')][_0xa1e8('0x28')];delete _0x352d87[_0xa1e8('0x27')]['dateEnd'];_0x3444b3[_0xa1e8('0x27')]=_[_0xa1e8('0x26')](_0x352d87['query']);_0x3444b3[_0xa1e8('0x2a')]=_[_0xa1e8('0x2b')](_0x3444b3[_0xa1e8('0x2c')],_0x3444b3[_0xa1e8('0x27')]);_0x23590c[_0xa1e8('0x2d')]=_[_0xa1e8('0x2b')](_0x3444b3[_0xa1e8('0x2c')],qs[_0xa1e8('0x2e')](_0x352d87[_0xa1e8('0x27')][_0xa1e8('0x2e')]));_0x23590c[_0xa1e8('0x2d')]=_0x23590c['attributes'][_0xa1e8('0x2f')]?_0x23590c[_0xa1e8('0x2d')]:_0x3444b3[_0xa1e8('0x2c')];if(!_0x352d87[_0xa1e8('0x27')][_0xa1e8('0x30')]('nolimit')){_0x23590c[_0xa1e8('0x31')]=qs['limit'](_0x352d87['query'][_0xa1e8('0x31')]);_0x23590c['offset']=qs[_0xa1e8('0x17')](_0x352d87['query'][_0xa1e8('0x17')]);}_0x23590c[_0xa1e8('0x32')]=qs['sort'](_0x352d87[_0xa1e8('0x27')]['sort']);_0x23590c[_0xa1e8('0x33')]=qs[_0xa1e8('0x2a')](_[_0xa1e8('0x34')](_0x352d87['query'],_0x3444b3[_0xa1e8('0x2a')]));if(_0x3926bb[_0xa1e8('0x28')]){if(_0x3926bb[_0xa1e8('0x29')]){_0x3926bb[_0xa1e8('0x29')]=moment(_0x3926bb['dateEnd'])[_0xa1e8('0x35')](0x1,_0xa1e8('0x36'));}else{_0x3926bb['dateEnd']=moment(_0x3926bb[_0xa1e8('0x28')])[_0xa1e8('0x35')](0x1,_0xa1e8('0x36'));}_[_0xa1e8('0x37')](_0x23590c[_0xa1e8('0x33')],{'createdAt':{'$gte':_0x3926bb[_0xa1e8('0x28')],'$lte':_0x3926bb[_0xa1e8('0x29')]}});}if(_0x352d87[_0xa1e8('0x27')]['filter']){_0x23590c['where']=_[_0xa1e8('0x37')](_0x23590c[_0xa1e8('0x33')],{'$or':_['map'](_0x23590c[_0xa1e8('0x2d')],function(_0x31c93a){var _0x4390f1={};_0x4390f1[_0x31c93a]={'$like':'%'+_0x352d87['query']['filter']+'%'};return _0x4390f1;})});}_0x23590c=_[_0xa1e8('0x37')]({},_0x23590c,_0x352d87[_0xa1e8('0x38')]);var _0x257042={'where':_0x23590c['where']};return db[_0xa1e8('0x24')][_0xa1e8('0x16')](_0x257042)[_0xa1e8('0x1e')](function(_0x893efc){_0xf296c9['count']=_0x893efc;if(_0x352d87[_0xa1e8('0x27')]['includeAll']){_0x23590c[_0xa1e8('0x39')]=[{'all':!![]}];}return db[_0xa1e8('0x24')][_0xa1e8('0x3a')](_0x23590c);})['then'](function(_0x47e3ad){_0xf296c9[_0xa1e8('0x3b')]=_0x47e3ad;return _0xf296c9;})[_0xa1e8('0x1e')](respondWithFilteredResult(_0x63bd8,_0x23590c))[_0xa1e8('0x3c')](handleError(_0x63bd8,null));};exports[_0xa1e8('0x3d')]=function(_0x28ac3a,_0x56cb9d){var _0x52d4a7={'raw':!![],'where':{'id':_0x28ac3a[_0xa1e8('0x3e')]['id']}},_0x16a463={};_0x16a463[_0xa1e8('0x2c')]=_[_0xa1e8('0x26')](db['SmsTransferReport'][_0xa1e8('0x25')]);_0x16a463[_0xa1e8('0x27')]=_[_0xa1e8('0x26')](_0x28ac3a['query']);_0x16a463[_0xa1e8('0x2a')]=_[_0xa1e8('0x2b')](_0x16a463[_0xa1e8('0x2c')],_0x16a463[_0xa1e8('0x27')]);_0x52d4a7[_0xa1e8('0x2d')]=_['intersection'](_0x16a463['model'],qs[_0xa1e8('0x2e')](_0x28ac3a['query'][_0xa1e8('0x2e')]));_0x52d4a7[_0xa1e8('0x2d')]=_0x52d4a7[_0xa1e8('0x2d')][_0xa1e8('0x2f')]?_0x52d4a7[_0xa1e8('0x2d')]:_0x16a463[_0xa1e8('0x2c')];if(_0x28ac3a['query'][_0xa1e8('0x3f')]){_0x52d4a7['include']=[{'all':!![]}];}_0x52d4a7=_[_0xa1e8('0x37')]({},_0x52d4a7,_0x28ac3a['options']);return db[_0xa1e8('0x24')][_0xa1e8('0x40')](_0x52d4a7)[_0xa1e8('0x1e')](handleEntityNotFound(_0x56cb9d,null))[_0xa1e8('0x1e')](respondWithResult(_0x56cb9d,null))[_0xa1e8('0x3c')](handleError(_0x56cb9d,null));};exports['create']=function(_0x468775,_0x16d28f){return db[_0xa1e8('0x24')][_0xa1e8('0x41')](_0x468775[_0xa1e8('0x42')],{})['then'](respondWithResult(_0x16d28f,0xc9))[_0xa1e8('0x3c')](handleError(_0x16d28f,null));};exports[_0xa1e8('0x1d')]=function(_0x3e32da,_0x73e7bb){if(_0x3e32da[_0xa1e8('0x42')]['id']){delete _0x3e32da[_0xa1e8('0x42')]['id'];}return db[_0xa1e8('0x24')][_0xa1e8('0x40')]({'where':{'id':_0x3e32da[_0xa1e8('0x3e')]['id']}})[_0xa1e8('0x1e')](handleEntityNotFound(_0x73e7bb,null))['then'](saveUpdates(_0x3e32da[_0xa1e8('0x42')],null))[_0xa1e8('0x1e')](respondWithResult(_0x73e7bb,null))['catch'](handleError(_0x73e7bb,null));};exports['destroy']=function(_0x2704a9,_0x1546ca){return db[_0xa1e8('0x24')][_0xa1e8('0x40')]({'where':{'id':_0x2704a9[_0xa1e8('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1546ca,null))[_0xa1e8('0x1e')](removeEntity(_0x1546ca,null))[_0xa1e8('0x3c')](handleError(_0x1546ca,null));};exports[_0xa1e8('0x43')]=function(_0x4853e6,_0x23df7e){return db[_0xa1e8('0x24')][_0xa1e8('0x43')]()[_0xa1e8('0x1e')](respondWithResult(_0x23df7e,null))[_0xa1e8('0x3c')](handleError(_0x23df7e,null));};
\ No newline at end of file
+var _0xa208=['query','dateStart','dateEnd','keys','filters','intersection','attributes','fields','length','order','sort','add','day','merge','where','filter','options','includeAll','include','rows','show','params','catch','create','body','find','describe','html-pdf','rimraf','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','desk.js','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','SmsTransferReport','rawAttributes','model'];(function(_0x40ddc0,_0x41c082){var _0x1aebf1=function(_0x3ba1f6){while(--_0x3ba1f6){_0x40ddc0['push'](_0x40ddc0['shift']());}};_0x1aebf1(++_0x41c082);}(_0xa208,0xd5));var _0x8a20=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa208[_0x54d4fe];return _0x1ab5bb;};'use strict';var pdf=require(_0x8a20('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8a20('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8a20('0x2'));var moment=require(_0x8a20('0x3'));var BPromise=require(_0x8a20('0x4'));var Mustache=require(_0x8a20('0x5'));var util=require(_0x8a20('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8a20('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8a20('0x8'));var squel=require(_0x8a20('0x9'));var crypto=require(_0x8a20('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8a20('0xb'));var toCsv=require(_0x8a20('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var qs=require(_0x8a20('0xc'));var logger=require(_0x8a20('0xd'))(_0x8a20('0xe'));var utils=require('../../config/utils');var config=require(_0x8a20('0xf'));var db=require(_0x8a20('0x10'))['db'];function respondWithStatusCode(_0x1b66da,_0x41f8d2){_0x41f8d2=_0x41f8d2||0xcc;return function(_0x3e704d){if(_0x3e704d){return _0x1b66da[_0x8a20('0x11')](_0x41f8d2);}return _0x1b66da['status'](_0x41f8d2)['end']();};}function respondWithResult(_0x36c0e8,_0x11bbb0){_0x11bbb0=_0x11bbb0||0xc8;return function(_0x115830){if(_0x115830){return _0x36c0e8[_0x8a20('0x12')](_0x11bbb0)['json'](_0x115830);}};}function respondWithFilteredResult(_0x27d939,_0x822337){return function(_0x2e584e){if(_0x2e584e){var _0x954b63=_0x2e584e[_0x8a20('0x13')],_0x18f70b=_0x822337[_0x8a20('0x14')],_0x4223a5=_0x822337['offset']+_0x822337[_0x8a20('0x15')],_0x5b88ec;if(_0x4223a5>=_0x954b63){_0x4223a5=_0x954b63;_0x5b88ec=0xc8;}else{_0x5b88ec=0xce;}_0x27d939[_0x8a20('0x12')](_0x5b88ec);return _0x27d939[_0x8a20('0x16')](_0x8a20('0x17'),_0x18f70b+'-'+_0x4223a5+'/'+_0x954b63)['json'](_0x2e584e);}return null;};}function patchUpdates(_0x107de8){return function(_0x2bc102){try{jsonpatch[_0x8a20('0x18')](_0x2bc102,_0x107de8,!![]);}catch(_0x519aa3){return BPromise[_0x8a20('0x19')](_0x519aa3);}return _0x2bc102[_0x8a20('0x1a')]();};}function saveUpdates(_0x270913,_0x1eb850){return function(_0x34f409){if(_0x34f409){return _0x34f409['update'](_0x270913)[_0x8a20('0x1b')](function(_0x42450e){return _0x42450e;});}return null;};}function removeEntity(_0x411875,_0x11295b){return function(_0x151114){if(_0x151114){return _0x151114[_0x8a20('0x1c')]()[_0x8a20('0x1b')](function(){_0x411875[_0x8a20('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x430dd9,_0xd855d6){return function(_0x1a93d6){if(!_0x1a93d6){_0x430dd9[_0x8a20('0x11')](0x194);}return _0x1a93d6;};}function handleError(_0x216fb9,_0x5c351c){_0x5c351c=_0x5c351c||0x1f4;return function(_0xd874df){logger[_0x8a20('0x1d')](_0xd874df['stack']);if(_0xd874df[_0x8a20('0x1e')]){delete _0xd874df['name'];}_0x216fb9[_0x8a20('0x12')](_0x5c351c)[_0x8a20('0x1f')](_0xd874df);};}exports['index']=function(_0x22e20a,_0x2c06b7){var _0x274aad={},_0x75777a={},_0x30675b={'count':0x0,'rows':[]};var _0x5c62b6=db[_0x8a20('0x20')][_0x8a20('0x21')];_0x75777a[_0x8a20('0x22')]=_['keys'](_0x5c62b6);var _0x2fcfb9={'dateStart':_0x22e20a[_0x8a20('0x23')]['dateStart'],'dateEnd':_0x22e20a[_0x8a20('0x23')]['dateEnd']};delete _0x22e20a[_0x8a20('0x23')][_0x8a20('0x24')];delete _0x22e20a[_0x8a20('0x23')][_0x8a20('0x25')];_0x75777a[_0x8a20('0x23')]=_[_0x8a20('0x26')](_0x22e20a[_0x8a20('0x23')]);_0x75777a[_0x8a20('0x27')]=_[_0x8a20('0x28')](_0x75777a[_0x8a20('0x22')],_0x75777a[_0x8a20('0x23')]);_0x274aad[_0x8a20('0x29')]=_[_0x8a20('0x28')](_0x75777a['model'],qs[_0x8a20('0x2a')](_0x22e20a['query'][_0x8a20('0x2a')]));_0x274aad[_0x8a20('0x29')]=_0x274aad['attributes'][_0x8a20('0x2b')]?_0x274aad[_0x8a20('0x29')]:_0x75777a[_0x8a20('0x22')];if(!_0x22e20a['query']['hasOwnProperty']('nolimit')){_0x274aad['limit']=qs[_0x8a20('0x15')](_0x22e20a['query'][_0x8a20('0x15')]);_0x274aad[_0x8a20('0x14')]=qs[_0x8a20('0x14')](_0x22e20a[_0x8a20('0x23')][_0x8a20('0x14')]);}_0x274aad[_0x8a20('0x2c')]=qs[_0x8a20('0x2d')](_0x22e20a['query']['sort']);_0x274aad['where']=qs[_0x8a20('0x27')](_['pick'](_0x22e20a[_0x8a20('0x23')],_0x75777a[_0x8a20('0x27')]));if(_0x2fcfb9[_0x8a20('0x24')]){if(_0x2fcfb9[_0x8a20('0x25')]){_0x2fcfb9[_0x8a20('0x25')]=moment(_0x2fcfb9[_0x8a20('0x25')])[_0x8a20('0x2e')](0x1,_0x8a20('0x2f'));}else{_0x2fcfb9[_0x8a20('0x25')]=moment(_0x2fcfb9['dateStart'])[_0x8a20('0x2e')](0x1,_0x8a20('0x2f'));}_[_0x8a20('0x30')](_0x274aad[_0x8a20('0x31')],{'createdAt':{'$gte':_0x2fcfb9[_0x8a20('0x24')],'$lte':_0x2fcfb9[_0x8a20('0x25')]}});}if(_0x22e20a[_0x8a20('0x23')][_0x8a20('0x32')]){_0x274aad[_0x8a20('0x31')]=_['merge'](_0x274aad[_0x8a20('0x31')],{'$or':_['map'](_0x274aad['attributes'],function(_0x1c462d){var _0x394299={};_0x394299[_0x1c462d]={'$like':'%'+_0x22e20a['query']['filter']+'%'};return _0x394299;})});}_0x274aad=_[_0x8a20('0x30')]({},_0x274aad,_0x22e20a[_0x8a20('0x33')]);var _0xcbac26={'where':_0x274aad[_0x8a20('0x31')]};return db[_0x8a20('0x20')]['count'](_0xcbac26)[_0x8a20('0x1b')](function(_0x2a933a){_0x30675b[_0x8a20('0x13')]=_0x2a933a;if(_0x22e20a['query'][_0x8a20('0x34')]){_0x274aad[_0x8a20('0x35')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x274aad);})[_0x8a20('0x1b')](function(_0x1bbbf0){_0x30675b[_0x8a20('0x36')]=_0x1bbbf0;return _0x30675b;})['then'](respondWithFilteredResult(_0x2c06b7,_0x274aad))['catch'](handleError(_0x2c06b7,null));};exports[_0x8a20('0x37')]=function(_0x4c70ac,_0x463a71){var _0x3e5081={'raw':!![],'where':{'id':_0x4c70ac[_0x8a20('0x38')]['id']}},_0x45c4db={};_0x45c4db[_0x8a20('0x22')]=_[_0x8a20('0x26')](db[_0x8a20('0x20')]['rawAttributes']);_0x45c4db['query']=_['keys'](_0x4c70ac[_0x8a20('0x23')]);_0x45c4db[_0x8a20('0x27')]=_[_0x8a20('0x28')](_0x45c4db['model'],_0x45c4db['query']);_0x3e5081[_0x8a20('0x29')]=_[_0x8a20('0x28')](_0x45c4db[_0x8a20('0x22')],qs[_0x8a20('0x2a')](_0x4c70ac[_0x8a20('0x23')]['fields']));_0x3e5081['attributes']=_0x3e5081[_0x8a20('0x29')][_0x8a20('0x2b')]?_0x3e5081[_0x8a20('0x29')]:_0x45c4db['model'];if(_0x4c70ac[_0x8a20('0x23')][_0x8a20('0x34')]){_0x3e5081[_0x8a20('0x35')]=[{'all':!![]}];}_0x3e5081=_['merge']({},_0x3e5081,_0x4c70ac[_0x8a20('0x33')]);return db[_0x8a20('0x20')]['find'](_0x3e5081)[_0x8a20('0x1b')](handleEntityNotFound(_0x463a71,null))[_0x8a20('0x1b')](respondWithResult(_0x463a71,null))[_0x8a20('0x39')](handleError(_0x463a71,null));};exports[_0x8a20('0x3a')]=function(_0x454c17,_0x8d253c){return db['SmsTransferReport'][_0x8a20('0x3a')](_0x454c17[_0x8a20('0x3b')],{})[_0x8a20('0x1b')](respondWithResult(_0x8d253c,0xc9))[_0x8a20('0x39')](handleError(_0x8d253c,null));};exports['update']=function(_0x138202,_0x42febb){if(_0x138202[_0x8a20('0x3b')]['id']){delete _0x138202['body']['id'];}return db['SmsTransferReport'][_0x8a20('0x3c')]({'where':{'id':_0x138202[_0x8a20('0x38')]['id']}})['then'](handleEntityNotFound(_0x42febb,null))['then'](saveUpdates(_0x138202[_0x8a20('0x3b')],null))[_0x8a20('0x1b')](respondWithResult(_0x42febb,null))[_0x8a20('0x39')](handleError(_0x42febb,null));};exports[_0x8a20('0x1c')]=function(_0x4a614c,_0x357603){return db[_0x8a20('0x20')]['find']({'where':{'id':_0x4a614c[_0x8a20('0x38')]['id']}})['then'](handleEntityNotFound(_0x357603,null))[_0x8a20('0x1b')](removeEntity(_0x357603,null))[_0x8a20('0x39')](handleError(_0x357603,null));};exports[_0x8a20('0x3d')]=function(_0x1980ed,_0x3436de){return db[_0x8a20('0x20')][_0x8a20('0x3d')]()[_0x8a20('0x1b')](respondWithResult(_0x3436de,null))['catch'](handleError(_0x3436de,null));};
\ No newline at end of file
index 5707360..a41ebf6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f62=['exports','define','report_sms_transfer','uniqueid','util','api','moment','bluebird'];(function(_0x4ad51a,_0x3bf1cd){var _0x3d714f=function(_0x362ef0){while(--_0x362ef0){_0x4ad51a['push'](_0x4ad51a['shift']());}};_0x3d714f(++_0x3bf1cd);}(_0x9f62,0x154));var _0x29f6=function(_0x2169cc,_0xd55ee8){_0x2169cc=_0x2169cc-0x0;var _0xaea725=_0x9f62[_0x2169cc];return _0xaea725;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var attributes=require('./smsTransferReport.attributes');module[_0x29f6('0x4')]=function(_0x2f0420,_0xefa26c){return _0x2f0420[_0x29f6('0x5')]('SmsTransferReport',attributes,{'tableName':_0x29f6('0x6'),'paranoid':![],'indexes':[{'name':_0x29f6('0x7'),'fields':[_0x29f6('0x7')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x84ab=['api','moment','request-promise','./smsTransferReport.attributes','define','uniqueid','lodash','util','../../config/logger'];(function(_0x34bc09,_0x10be5d){var _0x2cec34=function(_0x497c57){while(--_0x497c57){_0x34bc09['push'](_0x34bc09['shift']());}};_0x2cec34(++_0x10be5d);}(_0x84ab,0x12f));var _0xb84a=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x84ab[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var logger=require(_0xb84a('0x2'))(_0xb84a('0x3'));var moment=require(_0xb84a('0x4'));var BPromise=require('bluebird');var rp=require(_0xb84a('0x5'));var attributes=require(_0xb84a('0x6'));module['exports']=function(_0x9d3a00,_0xe72ccd){return _0x9d3a00[_0xb84a('0x7')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb84a('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
index d043390..24ef708 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f03=['lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0x303a3c,_0x2be276){var _0x449d70=function(_0x2dc5cb){while(--_0x2dc5cb){_0x303a3c['push'](_0x303a3c['shift']());}};_0x449d70(++_0x2be276);}(_0x6f03,0x1cc));var _0x36f0=function(_0x26aaa,_0x51ffbb){_0x26aaa=_0x26aaa-0x0;var _0x3f785b=_0x6f03[_0x26aaa];return _0x3f785b;};'use strict';var _=require(_0x36f0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x36f0('0x1'));var rs=require(_0x36f0('0x2'));var fs=require('fs');var db=require(_0x36f0('0x3'))['db'];var utils=require(_0x36f0('0x4'));var logger=require('../../config/logger')(_0x36f0('0x5'));var config=require(_0x36f0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x36f0('0x7')][_0x36f0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3cd89,_0x328baa,_0x5f54e4){return new BPromise(function(_0x4ffa04,_0x59a86d){return client[_0x36f0('0x9')](_0x3cd89,_0x5f54e4)[_0x36f0('0xa')](function(_0x2e59b8){logger[_0x36f0('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x328baa,_0x36f0('0xc'));logger[_0x36f0('0xd')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x328baa,'request\x20sent',JSON['stringify'](_0x2e59b8));if(_0x2e59b8[_0x36f0('0xe')]){if(_0x2e59b8[_0x36f0('0xe')][_0x36f0('0xf')]===0x1f4){logger['error'](_0x36f0('0x10'),_0x328baa,_0x2e59b8['error']['message']);return _0x59a86d(_0x2e59b8[_0x36f0('0xe')][_0x36f0('0x11')]);}logger[_0x36f0('0xe')](_0x36f0('0x10'),_0x328baa,_0x2e59b8['error'][_0x36f0('0x11')]);return _0x4ffa04(_0x2e59b8[_0x36f0('0xe')][_0x36f0('0x11')]);}else{logger[_0x36f0('0xb')](_0x36f0('0x10'),_0x328baa,_0x36f0('0xc'));_0x4ffa04(_0x2e59b8[_0x36f0('0x12')][_0x36f0('0x11')]);}})[_0x36f0('0x13')](function(_0x103063){logger['error'](_0x36f0('0x10'),_0x328baa,_0x103063);_0x59a86d(_0x103063);});});}
\ No newline at end of file
+var _0x8701=['code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x1c4e65,_0x18217d){var _0x41b500=function(_0x4c7847){while(--_0x4c7847){_0x1c4e65['push'](_0x1c4e65['shift']());}};_0x41b500(++_0x18217d);}(_0x8701,0x17b));var _0x1870=function(_0x493c48,_0x4a41a8){_0x493c48=_0x493c48-0x0;var _0x598d76=_0x8701[_0x493c48];return _0x598d76;};'use strict';var _=require(_0x1870('0x0'));var util=require(_0x1870('0x1'));var moment=require(_0x1870('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0x1870('0x3'))['db'];var utils=require(_0x1870('0x4'));var logger=require(_0x1870('0x5'))(_0x1870('0x6'));var config=require(_0x1870('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1870('0x8')][_0x1870('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f3047,_0x993ee4,_0x48f157){return new BPromise(function(_0x492140,_0x5dcc54){return client[_0x1870('0xa')](_0x4f3047,_0x48f157)[_0x1870('0xb')](function(_0x32096e){logger[_0x1870('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x993ee4,_0x1870('0xd'));logger[_0x1870('0xe')](_0x1870('0xf'),_0x993ee4,'request\x20sent',JSON['stringify'](_0x32096e));if(_0x32096e[_0x1870('0x10')]){if(_0x32096e[_0x1870('0x10')][_0x1870('0x11')]===0x1f4){logger[_0x1870('0x10')](_0x1870('0x12'),_0x993ee4,_0x32096e['error'][_0x1870('0x13')]);return _0x5dcc54(_0x32096e[_0x1870('0x10')][_0x1870('0x13')]);}logger['error'](_0x1870('0x12'),_0x993ee4,_0x32096e['error'][_0x1870('0x13')]);return _0x492140(_0x32096e['error'][_0x1870('0x13')]);}else{logger[_0x1870('0xc')](_0x1870('0x12'),_0x993ee4,_0x1870('0xd'));_0x492140(_0x32096e[_0x1870('0x14')][_0x1870('0x13')]);}})[_0x1870('0x15')](function(_0x11f582){logger[_0x1870('0x10')](_0x1870('0x12'),_0x993ee4,_0x11f582);_0x5dcc54(_0x11f582);});});}
\ No newline at end of file
index a8a2b40..c8b2c0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e8a=['/:id','delete','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','now','extname','post','single'];(function(_0x401b35,_0x28147a){var _0x3528bf=function(_0xa31fc7){while(--_0xa31fc7){_0x401b35['push'](_0x401b35['shift']());}};_0x3528bf(++_0x28147a);}(_0x5e8a,0x1cd));var _0xa5e8=function(_0x5dcad2,_0x22108f){_0x5dcad2=_0x5dcad2-0x0;var _0x20768f=_0x5e8a[_0x5dcad2];return _0x20768f;};'use strict';var multer=require(_0xa5e8('0x0'));var util=require(_0xa5e8('0x1'));var path=require(_0xa5e8('0x2'));var express=require(_0xa5e8('0x3'));var router=express[_0xa5e8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa5e8('0x5'));var config=require(_0xa5e8('0x6'));var controller=require(_0xa5e8('0x7'));router[_0xa5e8('0x8')]('/',auth[_0xa5e8('0x9')](),controller[_0xa5e8('0xa')]);router[_0xa5e8('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa5e8('0x8')](_0xa5e8('0xb'),auth[_0xa5e8('0x9')](),controller[_0xa5e8('0xc')]);var upload=multer({'storage':multer[_0xa5e8('0xd')]({'destination':function(_0x2e76e1,_0x3c2cb8,_0x136e18){_0x136e18(null,path[_0xa5e8('0xe')](config[_0xa5e8('0xf')],'server/files/sounds/original/'));},'filename':function(_0x4e300a,_0x3a7103,_0x47b6d0){_0x3a7103[_0xa5e8('0x10')]=_0x3a7103[_0xa5e8('0x10')][_0xa5e8('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x47b6d0(null,util[_0xa5e8('0x12')](_0xa5e8('0x13'),path[_0xa5e8('0x14')](_0x3a7103[_0xa5e8('0x10')],path['extname'](_0x3a7103[_0xa5e8('0x10')])),Date[_0xa5e8('0x15')](),path[_0xa5e8('0x16')](_0x3a7103[_0xa5e8('0x10')])));}})});router[_0xa5e8('0x17')]('/',upload[_0xa5e8('0x18')]('file'),controller['create']);router['put'](_0xa5e8('0x19'),auth['isAuthenticated'](),controller['update']);router[_0xa5e8('0x1a')]('/:id',auth[_0xa5e8('0x9')](),controller[_0xa5e8('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x6601=['join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','post','single','file','create','put','delete','exports','multer','util','path','express','Router','../../components/auth/service','./sound.controller','get','isAuthenticated','/:id','show','/:id/download','download','diskStorage'];(function(_0xa22fb7,_0x4ec931){var _0x1693c8=function(_0x4847c8){while(--_0x4847c8){_0xa22fb7['push'](_0xa22fb7['shift']());}};_0x1693c8(++_0x4ec931);}(_0x6601,0x1b4));var _0x1660=function(_0x1ac1bf,_0x2981c4){_0x1ac1bf=_0x1ac1bf-0x0;var _0x5c51e6=_0x6601[_0x1ac1bf];return _0x5c51e6;};'use strict';var multer=require(_0x1660('0x0'));var util=require(_0x1660('0x1'));var path=require(_0x1660('0x2'));var express=require(_0x1660('0x3'));var router=express[_0x1660('0x4')]();var auth=require(_0x1660('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1660('0x6'));router[_0x1660('0x7')]('/',auth[_0x1660('0x8')](),controller['index']);router[_0x1660('0x7')](_0x1660('0x9'),auth['isAuthenticated'](),controller[_0x1660('0xa')]);router['get'](_0x1660('0xb'),auth[_0x1660('0x8')](),controller[_0x1660('0xc')]);var upload=multer({'storage':multer[_0x1660('0xd')]({'destination':function(_0x49ee8b,_0x3d9446,_0x43030f){_0x43030f(null,path[_0x1660('0xe')](config[_0x1660('0xf')],_0x1660('0x10')));},'filename':function(_0x4f9e2b,_0xcef680,_0xc9e25c){_0xcef680[_0x1660('0x11')]=_0xcef680[_0x1660('0x11')][_0x1660('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xc9e25c(null,util[_0x1660('0x13')](_0x1660('0x14'),path['basename'](_0xcef680[_0x1660('0x11')],path[_0x1660('0x15')](_0xcef680[_0x1660('0x11')])),Date[_0x1660('0x16')](),path[_0x1660('0x15')](_0xcef680['originalname'])));}})});router[_0x1660('0x17')]('/',upload[_0x1660('0x18')](_0x1660('0x19')),controller[_0x1660('0x1a')]);router[_0x1660('0x1b')](_0x1660('0x9'),auth[_0x1660('0x8')](),controller['update']);router[_0x1660('0x1c')](_0x1660('0x9'),auth[_0x1660('0x8')](),controller['delete']);module[_0x1660('0x1d')]=router;
\ No newline at end of file
index cc028eb..7fb87c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x581d=['FLOAT','INTEGER','BIGINT','sequelize','exports','name','STRING'];(function(_0x356518,_0xe1bbf5){var _0x3fdd79=function(_0x3bc8ea){while(--_0x3bc8ea){_0x356518['push'](_0x356518['shift']());}};_0x3fdd79(++_0xe1bbf5);}(_0x581d,0x1df));var _0xd581=function(_0xc639c,_0xe205b6){_0xc639c=_0xc639c-0x0;var _0x3bc057=_0x581d[_0xc639c];return _0x3bc057;};'use strict';var Sequelize=require(_0xd581('0x0'));module[_0xd581('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd581('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xd581('0x3')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xd581('0x3')]},'original_format':{'type':Sequelize[_0xd581('0x3')]},'original_duration':{'type':Sequelize[_0xd581('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xd581('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xd581('0x3')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xd581('0x5')]},'converted_bitRate':{'type':Sequelize[_0xd581('0x6')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x5f09=['FLOAT','BIGINT','INTEGER','sequelize','STRING'];(function(_0x5dbb6f,_0x51e8f2){var _0x333a12=function(_0x180dbc){while(--_0x180dbc){_0x5dbb6f['push'](_0x5dbb6f['shift']());}};_0x333a12(++_0x51e8f2);}(_0x5f09,0x19d));var _0x95f0=function(_0x1d464c,_0x1b86f5){_0x1d464c=_0x1d464c-0x0;var _0x43a603=_0x5f09[_0x1d464c];return _0x43a603;};'use strict';var Sequelize=require(_0x95f0('0x0'));module['exports']={'name':{'type':Sequelize[_0x95f0('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x95f0('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x95f0('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x95f0('0x2')]},'original_sampleCount':{'type':Sequelize[_0x95f0('0x3')]},'original_channelCount':{'type':Sequelize[_0x95f0('0x4')]},'original_bitRate':{'type':Sequelize[_0x95f0('0x3')]},'original_sampleRate':{'type':Sequelize[_0x95f0('0x4')]},'converted_format':{'type':Sequelize[_0x95f0('0x1')]},'converted_duration':{'type':Sequelize[_0x95f0('0x2')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x95f0('0x4')]},'converted_bitRate':{'type':Sequelize[_0x95f0('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x95f0('0x4')]}};
\ No newline at end of file
index 53e3a18..7b40d92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb091=['filename','extname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','update','params','body','description','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','then','destroy','error','name','send','index','Sound','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day','merge','map','options','include','findAll','rows','show','find','catch','download','save_name','converted_format','existsSync','join','server/files/sounds/converted','Sound\x20not\x20found','root','format','%s.%s','create','basename','file','originalname'];(function(_0x44c442,_0x2b08ef){var _0x4a20c3=function(_0x3b7d16){while(--_0x3b7d16){_0x44c442['push'](_0x44c442['shift']());}};_0x4a20c3(++_0x2b08ef);}(_0xb091,0x16e));var _0x1b09=function(_0x4cf142,_0x2bd5a0){_0x4cf142=_0x4cf142-0x0;var _0x1aa422=_0xb091[_0x4cf142];return _0x1aa422;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1b09('0x0'));var rimraf=require(_0x1b09('0x1'));var zipdir=require(_0x1b09('0x2'));var jsonpatch=require(_0x1b09('0x3'));var rp=require('request-promise');var moment=require(_0x1b09('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b09('0x5'));var path=require(_0x1b09('0x6'));var sox=require('sox');var csv=require(_0x1b09('0x7'));var ejs=require(_0x1b09('0x8'));var fs=require('fs');var _=require(_0x1b09('0x9'));var squel=require('squel');var crypto=require(_0x1b09('0xa'));var jsforce=require(_0x1b09('0xb'));var deskjs=require(_0x1b09('0xc'));var toCsv=require(_0x1b09('0x7'));var querystring=require(_0x1b09('0xd'));var Papa=require(_0x1b09('0xe'));var qs=require(_0x1b09('0xf'));var logger=require(_0x1b09('0x10'))(_0x1b09('0x11'));var utils=require(_0x1b09('0x12'));var config=require(_0x1b09('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40082a,_0x894b73){_0x894b73=_0x894b73||0xcc;return function(_0x5690cb){if(_0x5690cb){return _0x40082a['sendStatus'](_0x894b73);}return _0x40082a[_0x1b09('0x14')](_0x894b73)[_0x1b09('0x15')]();};}function respondWithResult(_0x3ae4a0,_0x1046f8){_0x1046f8=_0x1046f8||0xc8;return function(_0x428cc5){if(_0x428cc5){return _0x3ae4a0[_0x1b09('0x14')](_0x1046f8)[_0x1b09('0x16')](_0x428cc5);}};}function respondWithFilteredResult(_0x58392d,_0x37fdb2){return function(_0x515ade){if(_0x515ade){var _0x455a8e=_0x515ade[_0x1b09('0x17')],_0x27a731=_0x37fdb2[_0x1b09('0x18')],_0x11ab46=_0x37fdb2[_0x1b09('0x18')]+_0x37fdb2[_0x1b09('0x19')],_0x37673e;if(_0x11ab46>=_0x455a8e){_0x11ab46=_0x455a8e;_0x37673e=0xc8;}else{_0x37673e=0xce;}_0x58392d[_0x1b09('0x14')](_0x37673e);return _0x58392d[_0x1b09('0x1a')](_0x1b09('0x1b'),_0x27a731+'-'+_0x11ab46+'/'+_0x455a8e)[_0x1b09('0x16')](_0x515ade);}return null;};}function patchUpdates(_0x646575){return function(_0x4c64e1){try{jsonpatch[_0x1b09('0x1c')](_0x4c64e1,_0x646575,!![]);}catch(_0x1c1ef9){return BPromise['reject'](_0x1c1ef9);}return _0x4c64e1['save']();};}function saveUpdates(_0xe93ac4,_0x5debd9){return function(_0x267b5e){if(_0x267b5e){return _0x267b5e['update'](_0xe93ac4)[_0x1b09('0x1d')](function(_0x4b2eab){return _0x4b2eab;});}return null;};}function removeEntity(_0x2d6dba,_0x1e8f97){return function(_0x29dd70){if(_0x29dd70){return _0x29dd70[_0x1b09('0x1e')]()[_0x1b09('0x1d')](function(){_0x2d6dba[_0x1b09('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2806,_0x27f4f5){return function(_0x41c786){if(!_0x41c786){_0x5e2806['sendStatus'](0x194);}return _0x41c786;};}function handleError(_0x3c0496,_0x11d0d5){_0x11d0d5=_0x11d0d5||0x1f4;return function(_0x6e132c){logger[_0x1b09('0x1f')](_0x6e132c['stack']);if(_0x6e132c[_0x1b09('0x20')]){delete _0x6e132c[_0x1b09('0x20')];}_0x3c0496['status'](_0x11d0d5)[_0x1b09('0x21')](_0x6e132c);};}exports[_0x1b09('0x22')]=function(_0x4dd3e5,_0x13c89c){var _0x108d80={},_0xa71272={},_0x1b8aaa={'count':0x0,'rows':[]};var _0x547fbb=db[_0x1b09('0x23')][_0x1b09('0x24')];_0xa71272['model']=_[_0x1b09('0x25')](_0x547fbb);var _0x406748={'dateStart':_0x4dd3e5[_0x1b09('0x26')][_0x1b09('0x27')],'dateEnd':_0x4dd3e5[_0x1b09('0x26')][_0x1b09('0x28')]};delete _0x4dd3e5[_0x1b09('0x26')]['dateStart'];delete _0x4dd3e5[_0x1b09('0x26')][_0x1b09('0x28')];_0xa71272['query']=_[_0x1b09('0x25')](_0x4dd3e5[_0x1b09('0x26')]);_0xa71272[_0x1b09('0x29')]=_[_0x1b09('0x2a')](_0xa71272[_0x1b09('0x2b')],_0xa71272['query']);_0x108d80[_0x1b09('0x2c')]=_['intersection'](_0xa71272[_0x1b09('0x2b')],qs['fields'](_0x4dd3e5[_0x1b09('0x26')][_0x1b09('0x2d')]));_0x108d80[_0x1b09('0x2c')]=_0x108d80[_0x1b09('0x2c')][_0x1b09('0x2e')]?_0x108d80[_0x1b09('0x2c')]:_0xa71272[_0x1b09('0x2b')];if(!_0x4dd3e5[_0x1b09('0x26')][_0x1b09('0x2f')](_0x1b09('0x30'))){_0x108d80['limit']=qs[_0x1b09('0x19')](_0x4dd3e5[_0x1b09('0x26')][_0x1b09('0x19')]);_0x108d80['offset']=qs[_0x1b09('0x18')](_0x4dd3e5[_0x1b09('0x26')][_0x1b09('0x18')]);}_0x108d80[_0x1b09('0x31')]=qs[_0x1b09('0x32')](_0x4dd3e5[_0x1b09('0x26')][_0x1b09('0x32')]);_0x108d80[_0x1b09('0x33')]=qs['filters'](_[_0x1b09('0x34')](_0x4dd3e5['query'],_0xa71272[_0x1b09('0x29')]));if(_0x406748['dateStart']){if(_0x406748[_0x1b09('0x28')]){_0x406748[_0x1b09('0x28')]=moment(_0x406748[_0x1b09('0x28')])[_0x1b09('0x35')](0x1,_0x1b09('0x36'));}else{_0x406748[_0x1b09('0x28')]=moment(_0x406748[_0x1b09('0x27')])[_0x1b09('0x35')](0x1,_0x1b09('0x36'));}_[_0x1b09('0x37')](_0x108d80[_0x1b09('0x33')],{'createdAt':{'$gte':_0x406748[_0x1b09('0x27')],'$lte':_0x406748[_0x1b09('0x28')]}});}if(_0x4dd3e5['query']['filter']){_0x108d80[_0x1b09('0x33')]=_[_0x1b09('0x37')](_0x108d80[_0x1b09('0x33')],{'$or':_[_0x1b09('0x38')](_0x108d80[_0x1b09('0x2c')],function(_0x219258){var _0x529a21={};_0x529a21[_0x219258]={'$like':'%'+_0x4dd3e5[_0x1b09('0x26')]['filter']+'%'};return _0x529a21;})});}_0x108d80=_['merge']({},_0x108d80,_0x4dd3e5[_0x1b09('0x39')]);var _0x51d5eb={'where':_0x108d80[_0x1b09('0x33')]};return db[_0x1b09('0x23')][_0x1b09('0x17')](_0x51d5eb)['then'](function(_0x4401ad){_0x1b8aaa[_0x1b09('0x17')]=_0x4401ad;if(_0x4dd3e5[_0x1b09('0x26')]['includeAll']){_0x108d80[_0x1b09('0x3a')]=[{'all':!![]}];}return db[_0x1b09('0x23')][_0x1b09('0x3b')](_0x108d80);})[_0x1b09('0x1d')](function(_0x54eca0){_0x1b8aaa[_0x1b09('0x3c')]=_0x54eca0;return _0x1b8aaa;})[_0x1b09('0x1d')](respondWithFilteredResult(_0x13c89c,_0x108d80))['catch'](handleError(_0x13c89c,null));};exports[_0x1b09('0x3d')]=function(_0xe7f4fb,_0x4d8597){var _0x5a6722={'raw':!![],'where':{'id':_0xe7f4fb['params']['id']}},_0x4b388d={};_0x4b388d[_0x1b09('0x2b')]=_[_0x1b09('0x25')](db[_0x1b09('0x23')]['rawAttributes']);_0x4b388d[_0x1b09('0x26')]=_[_0x1b09('0x25')](_0xe7f4fb['query']);_0x4b388d[_0x1b09('0x29')]=_[_0x1b09('0x2a')](_0x4b388d[_0x1b09('0x2b')],_0x4b388d[_0x1b09('0x26')]);_0x5a6722[_0x1b09('0x2c')]=_[_0x1b09('0x2a')](_0x4b388d[_0x1b09('0x2b')],qs[_0x1b09('0x2d')](_0xe7f4fb[_0x1b09('0x26')][_0x1b09('0x2d')]));_0x5a6722['attributes']=_0x5a6722[_0x1b09('0x2c')][_0x1b09('0x2e')]?_0x5a6722[_0x1b09('0x2c')]:_0x4b388d['model'];if(_0xe7f4fb[_0x1b09('0x26')]['includeAll']){_0x5a6722[_0x1b09('0x3a')]=[{'all':!![]}];}_0x5a6722=_[_0x1b09('0x37')]({},_0x5a6722,_0xe7f4fb['options']);return db[_0x1b09('0x23')][_0x1b09('0x3e')](_0x5a6722)[_0x1b09('0x1d')](handleEntityNotFound(_0x4d8597,null))[_0x1b09('0x1d')](respondWithResult(_0x4d8597,null))[_0x1b09('0x3f')](handleError(_0x4d8597,null));};exports[_0x1b09('0x40')]=function(_0x51402f,_0x479dfc,_0x5df547){return db[_0x1b09('0x23')]['find']({'where':{'id':_0x51402f['params']['id']},'attributes':[_0x1b09('0x20'),_0x1b09('0x41'),_0x1b09('0x42')],'raw':!![]})[_0x1b09('0x1d')](handleEntityNotFound(_0x479dfc,null))[_0x1b09('0x1d')](function(_0x3e7046){if(_0x3e7046){if(!fs[_0x1b09('0x43')](path[_0x1b09('0x44')](config['root'],_0x1b09('0x45'),_0x3e7046[_0x1b09('0x41')]+'.'+_0x3e7046[_0x1b09('0x42')]))){throw new db['Sequelize']['ValidationError'](_0x1b09('0x46'));}return _0x479dfc['download'](path[_0x1b09('0x44')](config[_0x1b09('0x47')],'server/files/sounds/converted',util[_0x1b09('0x48')](_0x1b09('0x49'),_0x3e7046['save_name'],_0x3e7046[_0x1b09('0x42')])),util[_0x1b09('0x48')](_0x1b09('0x49'),_0x3e7046[_0x1b09('0x20')],_0x3e7046[_0x1b09('0x42')]));}return null;})['catch'](handleError(_0x479dfc,null));};exports[_0x1b09('0x4a')]=function(_0x9039b,_0x408d50,_0x337777){var _0x34e660={'name':path[_0x1b09('0x4b')](_0x9039b[_0x1b09('0x4c')]['originalname'],path['extname'](_0x9039b[_0x1b09('0x4c')][_0x1b09('0x4d')])),'save_name':path[_0x1b09('0x4b')](_0x9039b['file'][_0x1b09('0x4e')],path[_0x1b09('0x4f')](_0x9039b[_0x1b09('0x4c')]['filename'])),'original_format':path[_0x1b09('0x4f')](_0x9039b[_0x1b09('0x4c')][_0x1b09('0x4d')])[_0x1b09('0x50')](0x1),'converted_format':_0x1b09('0x51')};var _0xea8b8a=path[_0x1b09('0x44')](config[_0x1b09('0x47')],_0x1b09('0x52'),_0x9039b[_0x1b09('0x4c')][_0x1b09('0x4e')]);var _0x114ac3=path[_0x1b09('0x44')](config[_0x1b09('0x47')],_0x1b09('0x45'),util['format']('%s.%s',path[_0x1b09('0x4b')](_0x9039b['file'][_0x1b09('0x4e')],path[_0x1b09('0x4f')](_0x9039b[_0x1b09('0x4c')]['filename'])),_0x34e660['converted_format']));logger[_0x1b09('0x53')](_0x1b09('0x54'),_0xea8b8a);logger['info'](_0x1b09('0x55'),_0x114ac3);try{fs[_0x1b09('0x56')](_0xea8b8a,parseInt(_0x1b09('0x57'),0x8));var _0x410b16=sox[_0x1b09('0x58')](_0xea8b8a,_0x114ac3,{'sampleRate':0x1f40,'format':_0x1b09('0x51'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x410b16['on'](_0x1b09('0x1f'),function(_0x4f137e){fs[_0x1b09('0x59')](_0xea8b8a);_0x408d50['status'](0x1f4)[_0x1b09('0x21')](_0x4f137e);});_0x410b16['on'](_0x1b09('0x5a'),function(_0x2e98e2){_0x34e660[_0x1b09('0x5b')]=isNaN(_0x2e98e2[_0x1b09('0x5c')])?null:_0x2e98e2[_0x1b09('0x5c')]*0x3e8;_0x34e660[_0x1b09('0x5d')]=isNaN(_0x2e98e2[_0x1b09('0x5e')])?null:_0x2e98e2[_0x1b09('0x5e')];_0x34e660[_0x1b09('0x5f')]=isNaN(_0x2e98e2[_0x1b09('0x60')])?null:_0x2e98e2[_0x1b09('0x60')];_0x34e660['original_bitRate']=isNaN(_0x2e98e2['bitRate'])?null:_0x2e98e2[_0x1b09('0x61')];_0x34e660[_0x1b09('0x62')]=isNaN(_0x2e98e2[_0x1b09('0x63')])?null:_0x2e98e2['sampleRate'];});_0x410b16['on'](_0x1b09('0x64'),function(_0x7b6db1){_0x34e660[_0x1b09('0x65')]=isNaN(_0x7b6db1['duration'])?null:_0x7b6db1[_0x1b09('0x5c')]*0x3e8;_0x34e660[_0x1b09('0x66')]=isNaN(_0x7b6db1[_0x1b09('0x5e')])?null:_0x7b6db1['sampleCount'];_0x34e660[_0x1b09('0x67')]=isNaN(_0x7b6db1['channelCount'])?null:_0x7b6db1['channelCount'];_0x34e660[_0x1b09('0x68')]=isNaN(_0x7b6db1[_0x1b09('0x61')])?null:_0x7b6db1[_0x1b09('0x61')];_0x34e660['converted_sampleRate']=isNaN(_0x7b6db1[_0x1b09('0x63')])?null:_0x7b6db1['sampleRate'];});_0x410b16['on'](_0x1b09('0x15'),function(){fs[_0x1b09('0x56')](_0x114ac3,parseInt('0777',0x8));return db[_0x1b09('0x23')]['create'](_0x34e660)[_0x1b09('0x1d')](respondWithResult(_0x408d50,null))[_0x1b09('0x3f')](handleError(_0x408d50,null));});_0x410b16['start']();}catch(_0x1acf31){_0x408d50[_0x1b09('0x14')](0x1f4)[_0x1b09('0x21')](_0x1acf31);}};exports[_0x1b09('0x69')]=function(_0x242a7f,_0x1a357d,_0x2570e9){return db['Sound'][_0x1b09('0x3e')]({'where':{'id':_0x242a7f[_0x1b09('0x6a')]['id']}})[_0x1b09('0x1d')](handleEntityNotFound(_0x1a357d,null))['then'](saveUpdates(_[_0x1b09('0x34')](_0x242a7f[_0x1b09('0x6b')],[_0x1b09('0x20'),_0x1b09('0x6c')]),null))[_0x1b09('0x1d')](respondWithResult(_0x1a357d,null))['catch'](handleError(_0x1a357d,null));};exports[_0x1b09('0x6d')]=function(_0x598302,_0x3261bc,_0x417875){return db[_0x1b09('0x23')][_0x1b09('0x3e')]({'where':{'id':_0x598302[_0x1b09('0x6a')]['id']}})[_0x1b09('0x1d')](function(_0x773d57){if(_0x773d57){return _0x773d57[_0x1b09('0x1e')]();}})['then'](function(_0xdcd93e){var _0x3be129=path['join'](config[_0x1b09('0x47')],_0x1b09('0x52'),util[_0x1b09('0x48')](_0x1b09('0x49'),_0xdcd93e[_0x1b09('0x41')],_0xdcd93e[_0x1b09('0x6e')]));var _0x234c4a=path[_0x1b09('0x44')](config[_0x1b09('0x47')],'server/files/sounds/converted',util[_0x1b09('0x48')](_0x1b09('0x49'),_0xdcd93e[_0x1b09('0x41')],_0xdcd93e[_0x1b09('0x42')]));fs[_0x1b09('0x59')](_0x3be129);fs['unlinkSync'](_0x234c4a);return _0xdcd93e;})[_0x1b09('0x1d')](function(_0x1bb0fe){if(_0x1bb0fe){return _0x3261bc['status'](0xcc)[_0x1b09('0x15')]();}})['then'](handleEntityNotFound(_0x3261bc,null))[_0x1b09('0x3f')](handleError(_0x3261bc,null));};
\ No newline at end of file
+var _0xafc4=['moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','Sound','rawAttributes','query','dateStart','dateEnd','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','day','merge','filter','map','options','includeAll','include','findAll','rows','catch','show','length','find','params','save_name','converted_format','existsSync','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','join','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','root','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','sampleRate','converted_duration','converted_bitRate','converted_sampleRate','body','delete','original_format','html-pdf','rimraf','fast-json-patch','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xafc4,0x69));var _0x4afc=function(_0x3181cc,_0x28447f){_0x3181cc=_0x3181cc-0x0;var _0x547a4a=_0xafc4[_0x3181cc];return _0x547a4a;};'use strict';var pdf=require(_0x4afc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4afc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4afc('0x2'));var rp=require(_0x4afc('0x3'));var moment=require(_0x4afc('0x4'));var BPromise=require(_0x4afc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x4afc('0x6'));var csv=require(_0x4afc('0x7'));var ejs=require(_0x4afc('0x8'));var fs=require('fs');var _=require(_0x4afc('0x9'));var squel=require(_0x4afc('0xa'));var crypto=require(_0x4afc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4afc('0xc'));var toCsv=require(_0x4afc('0x7'));var querystring=require(_0x4afc('0xd'));var Papa=require(_0x4afc('0xe'));var qs=require(_0x4afc('0xf'));var logger=require(_0x4afc('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x4afc('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x281230,_0x225793){_0x225793=_0x225793||0xcc;return function(_0x49b56f){if(_0x49b56f){return _0x281230[_0x4afc('0x12')](_0x225793);}return _0x281230[_0x4afc('0x13')](_0x225793)[_0x4afc('0x14')]();};}function respondWithResult(_0x2768bf,_0x1d8f98){_0x1d8f98=_0x1d8f98||0xc8;return function(_0x2f1c59){if(_0x2f1c59){return _0x2768bf[_0x4afc('0x13')](_0x1d8f98)[_0x4afc('0x15')](_0x2f1c59);}};}function respondWithFilteredResult(_0x5effb4,_0x26f3f1){return function(_0x429fd8){if(_0x429fd8){var _0x2c636b=_0x429fd8[_0x4afc('0x16')],_0x1e2c31=_0x26f3f1['offset'],_0x5f2dc9=_0x26f3f1[_0x4afc('0x17')]+_0x26f3f1[_0x4afc('0x18')],_0x4e32e8;if(_0x5f2dc9>=_0x2c636b){_0x5f2dc9=_0x2c636b;_0x4e32e8=0xc8;}else{_0x4e32e8=0xce;}_0x5effb4[_0x4afc('0x13')](_0x4e32e8);return _0x5effb4[_0x4afc('0x19')](_0x4afc('0x1a'),_0x1e2c31+'-'+_0x5f2dc9+'/'+_0x2c636b)[_0x4afc('0x15')](_0x429fd8);}return null;};}function patchUpdates(_0x22f809){return function(_0x3ad418){try{jsonpatch[_0x4afc('0x1b')](_0x3ad418,_0x22f809,!![]);}catch(_0x135349){return BPromise[_0x4afc('0x1c')](_0x135349);}return _0x3ad418['save']();};}function saveUpdates(_0x1a8f49,_0x25603b){return function(_0x32865e){if(_0x32865e){return _0x32865e[_0x4afc('0x1d')](_0x1a8f49)['then'](function(_0x3bddc0){return _0x3bddc0;});}return null;};}function removeEntity(_0x30eda3,_0x2de6e9){return function(_0x280587){if(_0x280587){return _0x280587[_0x4afc('0x1e')]()[_0x4afc('0x1f')](function(){_0x30eda3[_0x4afc('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5403e4,_0x3ecf2d){return function(_0x57f37c){if(!_0x57f37c){_0x5403e4[_0x4afc('0x12')](0x194);}return _0x57f37c;};}function handleError(_0x4e9a48,_0x1aa676){_0x1aa676=_0x1aa676||0x1f4;return function(_0x2a0314){logger[_0x4afc('0x20')](_0x2a0314[_0x4afc('0x21')]);if(_0x2a0314[_0x4afc('0x22')]){delete _0x2a0314[_0x4afc('0x22')];}_0x4e9a48[_0x4afc('0x13')](_0x1aa676)[_0x4afc('0x23')](_0x2a0314);};}exports[_0x4afc('0x24')]=function(_0x100220,_0x4e8273){var _0x359c07={},_0x35f5b3={},_0x55842c={'count':0x0,'rows':[]};var _0xc3952e=db[_0x4afc('0x25')][_0x4afc('0x26')];_0x35f5b3['model']=_['keys'](_0xc3952e);var _0x54433f={'dateStart':_0x100220[_0x4afc('0x27')][_0x4afc('0x28')],'dateEnd':_0x100220['query'][_0x4afc('0x29')]};delete _0x100220[_0x4afc('0x27')]['dateStart'];delete _0x100220['query']['dateEnd'];_0x35f5b3[_0x4afc('0x27')]=_[_0x4afc('0x2a')](_0x100220[_0x4afc('0x27')]);_0x35f5b3[_0x4afc('0x2b')]=_[_0x4afc('0x2c')](_0x35f5b3[_0x4afc('0x2d')],_0x35f5b3['query']);_0x359c07[_0x4afc('0x2e')]=_[_0x4afc('0x2c')](_0x35f5b3[_0x4afc('0x2d')],qs[_0x4afc('0x2f')](_0x100220[_0x4afc('0x27')][_0x4afc('0x2f')]));_0x359c07[_0x4afc('0x2e')]=_0x359c07[_0x4afc('0x2e')]['length']?_0x359c07[_0x4afc('0x2e')]:_0x35f5b3['model'];if(!_0x100220['query'][_0x4afc('0x30')](_0x4afc('0x31'))){_0x359c07[_0x4afc('0x18')]=qs[_0x4afc('0x18')](_0x100220[_0x4afc('0x27')][_0x4afc('0x18')]);_0x359c07['offset']=qs[_0x4afc('0x17')](_0x100220[_0x4afc('0x27')][_0x4afc('0x17')]);}_0x359c07[_0x4afc('0x32')]=qs[_0x4afc('0x33')](_0x100220[_0x4afc('0x27')]['sort']);_0x359c07[_0x4afc('0x34')]=qs[_0x4afc('0x2b')](_[_0x4afc('0x35')](_0x100220[_0x4afc('0x27')],_0x35f5b3['filters']));if(_0x54433f['dateStart']){if(_0x54433f[_0x4afc('0x29')]){_0x54433f[_0x4afc('0x29')]=moment(_0x54433f[_0x4afc('0x29')])['add'](0x1,'day');}else{_0x54433f[_0x4afc('0x29')]=moment(_0x54433f['dateStart'])['add'](0x1,_0x4afc('0x36'));}_[_0x4afc('0x37')](_0x359c07[_0x4afc('0x34')],{'createdAt':{'$gte':_0x54433f[_0x4afc('0x28')],'$lte':_0x54433f[_0x4afc('0x29')]}});}if(_0x100220[_0x4afc('0x27')][_0x4afc('0x38')]){_0x359c07[_0x4afc('0x34')]=_[_0x4afc('0x37')](_0x359c07[_0x4afc('0x34')],{'$or':_[_0x4afc('0x39')](_0x359c07[_0x4afc('0x2e')],function(_0x15c6cb){var _0x40dca5={};_0x40dca5[_0x15c6cb]={'$like':'%'+_0x100220[_0x4afc('0x27')]['filter']+'%'};return _0x40dca5;})});}_0x359c07=_[_0x4afc('0x37')]({},_0x359c07,_0x100220[_0x4afc('0x3a')]);var _0x4357a6={'where':_0x359c07[_0x4afc('0x34')]};return db[_0x4afc('0x25')][_0x4afc('0x16')](_0x4357a6)[_0x4afc('0x1f')](function(_0x50d53f){_0x55842c['count']=_0x50d53f;if(_0x100220['query'][_0x4afc('0x3b')]){_0x359c07[_0x4afc('0x3c')]=[{'all':!![]}];}return db['Sound'][_0x4afc('0x3d')](_0x359c07);})[_0x4afc('0x1f')](function(_0x8ba5e6){_0x55842c[_0x4afc('0x3e')]=_0x8ba5e6;return _0x55842c;})['then'](respondWithFilteredResult(_0x4e8273,_0x359c07))[_0x4afc('0x3f')](handleError(_0x4e8273,null));};exports[_0x4afc('0x40')]=function(_0x348bc1,_0x2414d5){var _0x461abc={'raw':!![],'where':{'id':_0x348bc1['params']['id']}},_0x2404fc={};_0x2404fc[_0x4afc('0x2d')]=_['keys'](db[_0x4afc('0x25')][_0x4afc('0x26')]);_0x2404fc[_0x4afc('0x27')]=_['keys'](_0x348bc1['query']);_0x2404fc[_0x4afc('0x2b')]=_[_0x4afc('0x2c')](_0x2404fc[_0x4afc('0x2d')],_0x2404fc[_0x4afc('0x27')]);_0x461abc[_0x4afc('0x2e')]=_[_0x4afc('0x2c')](_0x2404fc[_0x4afc('0x2d')],qs[_0x4afc('0x2f')](_0x348bc1['query'][_0x4afc('0x2f')]));_0x461abc[_0x4afc('0x2e')]=_0x461abc['attributes'][_0x4afc('0x41')]?_0x461abc['attributes']:_0x2404fc[_0x4afc('0x2d')];if(_0x348bc1[_0x4afc('0x27')][_0x4afc('0x3b')]){_0x461abc['include']=[{'all':!![]}];}_0x461abc=_[_0x4afc('0x37')]({},_0x461abc,_0x348bc1[_0x4afc('0x3a')]);return db[_0x4afc('0x25')][_0x4afc('0x42')](_0x461abc)[_0x4afc('0x1f')](handleEntityNotFound(_0x2414d5,null))[_0x4afc('0x1f')](respondWithResult(_0x2414d5,null))['catch'](handleError(_0x2414d5,null));};exports['download']=function(_0x4f4e46,_0x32f3b9,_0x1c5661){return db[_0x4afc('0x25')][_0x4afc('0x42')]({'where':{'id':_0x4f4e46[_0x4afc('0x43')]['id']},'attributes':[_0x4afc('0x22'),_0x4afc('0x44'),_0x4afc('0x45')],'raw':!![]})[_0x4afc('0x1f')](handleEntityNotFound(_0x32f3b9,null))[_0x4afc('0x1f')](function(_0x48dbe3){if(_0x48dbe3){if(!fs[_0x4afc('0x46')](path['join'](config['root'],_0x4afc('0x47'),_0x48dbe3['save_name']+'.'+_0x48dbe3[_0x4afc('0x45')]))){throw new db[(_0x4afc('0x48'))][(_0x4afc('0x49'))](_0x4afc('0x4a'));}return _0x32f3b9['download'](path[_0x4afc('0x4b')](config['root'],_0x4afc('0x47'),util[_0x4afc('0x4c')](_0x4afc('0x4d'),_0x48dbe3[_0x4afc('0x44')],_0x48dbe3[_0x4afc('0x45')])),util[_0x4afc('0x4c')](_0x4afc('0x4d'),_0x48dbe3[_0x4afc('0x22')],_0x48dbe3[_0x4afc('0x45')]));}return null;})[_0x4afc('0x3f')](handleError(_0x32f3b9,null));};exports[_0x4afc('0x4e')]=function(_0x3915d5,_0x507bfc,_0x154fcb){var _0xa17ab2={'name':path[_0x4afc('0x4f')](_0x3915d5[_0x4afc('0x50')][_0x4afc('0x51')],path[_0x4afc('0x52')](_0x3915d5[_0x4afc('0x50')][_0x4afc('0x51')])),'save_name':path[_0x4afc('0x4f')](_0x3915d5[_0x4afc('0x50')][_0x4afc('0x53')],path[_0x4afc('0x52')](_0x3915d5[_0x4afc('0x50')]['filename'])),'original_format':path[_0x4afc('0x52')](_0x3915d5['file'][_0x4afc('0x51')])[_0x4afc('0x54')](0x1),'converted_format':_0x4afc('0x55')};var _0x2d9f3d=path['join'](config['root'],_0x4afc('0x56'),_0x3915d5[_0x4afc('0x50')]['filename']);var _0x40021e=path[_0x4afc('0x4b')](config[_0x4afc('0x57')],_0x4afc('0x47'),util[_0x4afc('0x4c')](_0x4afc('0x4d'),path[_0x4afc('0x4f')](_0x3915d5[_0x4afc('0x50')][_0x4afc('0x53')],path[_0x4afc('0x52')](_0x3915d5[_0x4afc('0x50')][_0x4afc('0x53')])),_0xa17ab2[_0x4afc('0x45')]));logger[_0x4afc('0x58')]('Sound\x20upload\x20filepath:\x20%s',_0x2d9f3d);logger[_0x4afc('0x58')](_0x4afc('0x59'),_0x40021e);try{fs[_0x4afc('0x5a')](_0x2d9f3d,parseInt(_0x4afc('0x5b'),0x8));var _0x16cff0=sox[_0x4afc('0x5c')](_0x2d9f3d,_0x40021e,{'sampleRate':0x1f40,'format':_0x4afc('0x55'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x16cff0['on']('error',function(_0x1771e8){fs[_0x4afc('0x5d')](_0x2d9f3d);_0x507bfc['status'](0x1f4)['send'](_0x1771e8);});_0x16cff0['on'](_0x4afc('0x5e'),function(_0x1f40d3){_0xa17ab2[_0x4afc('0x5f')]=isNaN(_0x1f40d3[_0x4afc('0x60')])?null:_0x1f40d3[_0x4afc('0x60')]*0x3e8;_0xa17ab2[_0x4afc('0x61')]=isNaN(_0x1f40d3[_0x4afc('0x62')])?null:_0x1f40d3[_0x4afc('0x62')];_0xa17ab2[_0x4afc('0x63')]=isNaN(_0x1f40d3[_0x4afc('0x64')])?null:_0x1f40d3['channelCount'];_0xa17ab2['original_bitRate']=isNaN(_0x1f40d3[_0x4afc('0x65')])?null:_0x1f40d3[_0x4afc('0x65')];_0xa17ab2['original_sampleRate']=isNaN(_0x1f40d3[_0x4afc('0x66')])?null:_0x1f40d3[_0x4afc('0x66')];});_0x16cff0['on']('dest',function(_0x56573a){_0xa17ab2[_0x4afc('0x67')]=isNaN(_0x56573a[_0x4afc('0x60')])?null:_0x56573a[_0x4afc('0x60')]*0x3e8;_0xa17ab2['converted_sampleCount']=isNaN(_0x56573a[_0x4afc('0x62')])?null:_0x56573a['sampleCount'];_0xa17ab2['converted_channelCount']=isNaN(_0x56573a[_0x4afc('0x64')])?null:_0x56573a[_0x4afc('0x64')];_0xa17ab2[_0x4afc('0x68')]=isNaN(_0x56573a[_0x4afc('0x65')])?null:_0x56573a[_0x4afc('0x65')];_0xa17ab2[_0x4afc('0x69')]=isNaN(_0x56573a[_0x4afc('0x66')])?null:_0x56573a[_0x4afc('0x66')];});_0x16cff0['on'](_0x4afc('0x14'),function(){fs['chmodSync'](_0x40021e,parseInt(_0x4afc('0x5b'),0x8));return db[_0x4afc('0x25')][_0x4afc('0x4e')](_0xa17ab2)['then'](respondWithResult(_0x507bfc,null))['catch'](handleError(_0x507bfc,null));});_0x16cff0['start']();}catch(_0x3be61e){_0x507bfc[_0x4afc('0x13')](0x1f4)[_0x4afc('0x23')](_0x3be61e);}};exports['update']=function(_0x242163,_0x548d02,_0x55b178){return db['Sound'][_0x4afc('0x42')]({'where':{'id':_0x242163[_0x4afc('0x43')]['id']}})[_0x4afc('0x1f')](handleEntityNotFound(_0x548d02,null))['then'](saveUpdates(_[_0x4afc('0x35')](_0x242163[_0x4afc('0x6a')],[_0x4afc('0x22'),'description']),null))[_0x4afc('0x1f')](respondWithResult(_0x548d02,null))[_0x4afc('0x3f')](handleError(_0x548d02,null));};exports[_0x4afc('0x6b')]=function(_0x392252,_0x1f652a,_0x481263){return db['Sound'][_0x4afc('0x42')]({'where':{'id':_0x392252[_0x4afc('0x43')]['id']}})[_0x4afc('0x1f')](function(_0x5dd264){if(_0x5dd264){return _0x5dd264[_0x4afc('0x1e')]();}})[_0x4afc('0x1f')](function(_0x4031c8){var _0x306a45=path[_0x4afc('0x4b')](config['root'],_0x4afc('0x56'),util[_0x4afc('0x4c')]('%s.%s',_0x4031c8[_0x4afc('0x44')],_0x4031c8[_0x4afc('0x6c')]));var _0x1dc895=path['join'](config[_0x4afc('0x57')],_0x4afc('0x47'),util[_0x4afc('0x4c')](_0x4afc('0x4d'),_0x4031c8[_0x4afc('0x44')],_0x4031c8[_0x4afc('0x45')]));fs[_0x4afc('0x5d')](_0x306a45);fs[_0x4afc('0x5d')](_0x1dc895);return _0x4031c8;})['then'](function(_0x457b2c){if(_0x457b2c){return _0x1f652a['status'](0xcc)['end']();}})[_0x4afc('0x1f')](handleEntityNotFound(_0x1f652a,null))[_0x4afc('0x3f')](handleError(_0x1f652a,null));};
\ No newline at end of file
index ad687ab..2036d5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71da=['../../config/logger','api','moment','bluebird','request-promise','./sound.attributes','define','Sound','tools_sounds','lodash','util'];(function(_0x2ab77f,_0x537991){var _0x214cf9=function(_0x1934b2){while(--_0x1934b2){_0x2ab77f['push'](_0x2ab77f['shift']());}};_0x214cf9(++_0x537991);}(_0x71da,0x127));var _0xa71d=function(_0x2a99ea,_0x1bfb13){_0x2a99ea=_0x2a99ea-0x0;var _0x5887ae=_0x71da[_0x2a99ea];return _0x5887ae;};'use strict';var _=require(_0xa71d('0x0'));var util=require(_0xa71d('0x1'));var logger=require(_0xa71d('0x2'))(_0xa71d('0x3'));var moment=require(_0xa71d('0x4'));var BPromise=require(_0xa71d('0x5'));var rp=require(_0xa71d('0x6'));var attributes=require(_0xa71d('0x7'));module['exports']=function(_0x5c62d7,_0x32cc35){return _0x5c62d7[_0xa71d('0x8')](_0xa71d('0x9'),attributes,{'tableName':_0xa71d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4af4=['moment','bluebird','request-promise','./sound.attributes','exports','tools_sounds','lodash','api'];(function(_0x206915,_0x5d88cf){var _0x446548=function(_0xc83cf0){while(--_0xc83cf0){_0x206915['push'](_0x206915['shift']());}};_0x446548(++_0x5d88cf);}(_0x4af4,0x126));var _0x44af=function(_0x12059a,_0x2717b1){_0x12059a=_0x12059a-0x0;var _0x226e42=_0x4af4[_0x12059a];return _0x226e42;};'use strict';var _=require(_0x44af('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x44af('0x1'));var moment=require(_0x44af('0x2'));var BPromise=require(_0x44af('0x3'));var rp=require(_0x44af('0x4'));var attributes=require(_0x44af('0x5'));module[_0x44af('0x6')]=function(_0x4de86e,_0x96f5bf){return _0x4de86e['define']('Sound',attributes,{'tableName':_0x44af('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 10ec245..8263b26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28b3=['then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowSound','Sound','find','options','where','attributes','include','map','model','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x553656,_0x52f771){var _0xba8c6a=function(_0xbcdc90){while(--_0xbcdc90){_0x553656['push'](_0x553656['shift']());}};_0xba8c6a(++_0x52f771);}(_0x28b3,0x19a));var _0x328b=function(_0x2fbfa0,_0x1fba71){_0x2fbfa0=_0x2fbfa0-0x0;var _0x13952f=_0x28b3[_0x2fbfa0];return _0x13952f;};'use strict';var _=require(_0x328b('0x0'));var util=require(_0x328b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x328b('0x2'));var fs=require('fs');var db=require(_0x328b('0x3'))['db'];var utils=require(_0x328b('0x4'));var logger=require(_0x328b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x328b('0x6'));var client=jayson[_0x328b('0x7')][_0x328b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b42e6,_0x5aba73,_0x1cf666){return new BPromise(function(_0x42bf2c,_0x41af9b){return client[_0x328b('0x9')](_0x2b42e6,_0x1cf666)[_0x328b('0xa')](function(_0x521ccd){logger[_0x328b('0xb')](_0x328b('0xc'),_0x5aba73,_0x328b('0xd'));logger[_0x328b('0xe')]('Sound,\x20%s,\x20%s,\x20%s',_0x5aba73,'request\x20sent',JSON[_0x328b('0xf')](_0x521ccd));if(_0x521ccd[_0x328b('0x10')]){if(_0x521ccd[_0x328b('0x10')][_0x328b('0x11')]===0x1f4){logger[_0x328b('0x10')](_0x328b('0xc'),_0x5aba73,_0x521ccd['error'][_0x328b('0x12')]);return _0x41af9b(_0x521ccd[_0x328b('0x10')]['message']);}logger['error'](_0x328b('0xc'),_0x5aba73,_0x521ccd['error'][_0x328b('0x12')]);return _0x42bf2c(_0x521ccd['error']['message']);}else{logger[_0x328b('0xb')](_0x328b('0xc'),_0x5aba73,_0x328b('0xd'));_0x42bf2c(_0x521ccd[_0x328b('0x13')][_0x328b('0x12')]);}})[_0x328b('0x14')](function(_0x37f5cd){logger[_0x328b('0x10')](_0x328b('0xc'),_0x5aba73,_0x37f5cd);_0x41af9b(_0x37f5cd);});});}exports[_0x328b('0x15')]=function(_0x29969d){var _0x133be7=this;return new Promise(function(_0xb07543,_0x383674){return db[_0x328b('0x16')][_0x328b('0x17')]({'raw':_0x29969d[_0x328b('0x18')]?_0x29969d[_0x328b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x29969d[_0x328b('0x18')]?_0x29969d[_0x328b('0x18')][_0x328b('0x19')]||null:null,'attributes':_0x29969d[_0x328b('0x18')]?_0x29969d[_0x328b('0x18')][_0x328b('0x1a')]||null:null,'include':_0x29969d[_0x328b('0x18')]?_0x29969d['options'][_0x328b('0x1b')]?_[_0x328b('0x1c')](_0x29969d[_0x328b('0x18')][_0x328b('0x1b')],function(_0x4e0878){return{'model':db[_0x4e0878['model']],'as':_0x4e0878['as'],'attributes':_0x4e0878['attributes'],'include':_0x4e0878[_0x328b('0x1b')]?_[_0x328b('0x1c')](_0x4e0878[_0x328b('0x1b')],function(_0x4b127d){return{'model':db[_0x4b127d[_0x328b('0x1d')]],'as':_0x4b127d['as'],'attributes':_0x4b127d[_0x328b('0x1a')],'include':_0x4b127d[_0x328b('0x1b')]?_[_0x328b('0x1c')](_0x4b127d[_0x328b('0x1b')],function(_0x21a860){return{'model':db[_0x21a860['model']],'as':_0x21a860['as'],'attributes':_0x21a860['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5608bb){logger[_0x328b('0xb')]('ShowSound',_0x29969d);logger[_0x328b('0xe')](_0x328b('0x15'),_0x29969d,JSON[_0x328b('0xf')](_0x5608bb));_0xb07543(_0x5608bb);})[_0x328b('0x14')](function(_0x14acc1){logger[_0x328b('0x10')](_0x328b('0x15'),_0x14acc1[_0x328b('0x12')],_0x29969d);_0x383674(_0x133be7[_0x328b('0x10')](0x1f4,_0x14acc1[_0x328b('0x12')]));});});};
\ No newline at end of file
+var _0xb1f2=['bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','ShowSound','Sound','options','raw','where','attributes','map','include','model','then','util','moment'];(function(_0x51e398,_0x2bcb69){var _0x584f33=function(_0x95241b){while(--_0x95241b){_0x51e398['push'](_0x51e398['shift']());}};_0x584f33(++_0x2bcb69);}(_0xb1f2,0xf6));var _0x2b1f=function(_0x1fe5c1,_0x56fe7a){_0x1fe5c1=_0x1fe5c1-0x0;var _0x420004=_0xb1f2[_0x1fe5c1];return _0x420004;};'use strict';var _=require('lodash');var util=require(_0x2b1f('0x0'));var moment=require(_0x2b1f('0x1'));var BPromise=require(_0x2b1f('0x2'));var rs=require(_0x2b1f('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x2b1f('0x4'));var logger=require('../../config/logger')(_0x2b1f('0x5'));var config=require(_0x2b1f('0x6'));var jayson=require(_0x2b1f('0x7'));var client=jayson['client'][_0x2b1f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40c4bd,_0xbd9a99,_0x25d5d7){return new BPromise(function(_0x39cb34,_0x260a68){return client[_0x2b1f('0x9')](_0x40c4bd,_0x25d5d7)['then'](function(_0x13911d){logger['info'](_0x2b1f('0xa'),_0xbd9a99,'request\x20sent');logger[_0x2b1f('0xb')](_0x2b1f('0xc'),_0xbd9a99,_0x2b1f('0xd'),JSON[_0x2b1f('0xe')](_0x13911d));if(_0x13911d[_0x2b1f('0xf')]){if(_0x13911d[_0x2b1f('0xf')][_0x2b1f('0x10')]===0x1f4){logger[_0x2b1f('0xf')](_0x2b1f('0xa'),_0xbd9a99,_0x13911d[_0x2b1f('0xf')][_0x2b1f('0x11')]);return _0x260a68(_0x13911d[_0x2b1f('0xf')][_0x2b1f('0x11')]);}logger[_0x2b1f('0xf')](_0x2b1f('0xa'),_0xbd9a99,_0x13911d['error']['message']);return _0x39cb34(_0x13911d[_0x2b1f('0xf')]['message']);}else{logger[_0x2b1f('0x12')](_0x2b1f('0xa'),_0xbd9a99,_0x2b1f('0xd'));_0x39cb34(_0x13911d[_0x2b1f('0x13')][_0x2b1f('0x11')]);}})[_0x2b1f('0x14')](function(_0x1905c7){logger[_0x2b1f('0xf')](_0x2b1f('0xa'),_0xbd9a99,_0x1905c7);_0x260a68(_0x1905c7);});});}exports[_0x2b1f('0x15')]=function(_0x2057e8){var _0x19e347=this;return new Promise(function(_0x4a3f79,_0xbb51b1){return db[_0x2b1f('0x16')]['find']({'raw':_0x2057e8[_0x2b1f('0x17')]?_0x2057e8[_0x2b1f('0x17')][_0x2b1f('0x18')]===undefined?!![]:![]:!![],'where':_0x2057e8['options']?_0x2057e8[_0x2b1f('0x17')][_0x2b1f('0x19')]||null:null,'attributes':_0x2057e8[_0x2b1f('0x17')]?_0x2057e8['options'][_0x2b1f('0x1a')]||null:null,'include':_0x2057e8[_0x2b1f('0x17')]?_0x2057e8[_0x2b1f('0x17')]['include']?_[_0x2b1f('0x1b')](_0x2057e8[_0x2b1f('0x17')][_0x2b1f('0x1c')],function(_0x318a2e){return{'model':db[_0x318a2e[_0x2b1f('0x1d')]],'as':_0x318a2e['as'],'attributes':_0x318a2e['attributes'],'include':_0x318a2e[_0x2b1f('0x1c')]?_['map'](_0x318a2e['include'],function(_0x3aaad0){return{'model':db[_0x3aaad0[_0x2b1f('0x1d')]],'as':_0x3aaad0['as'],'attributes':_0x3aaad0[_0x2b1f('0x1a')],'include':_0x3aaad0[_0x2b1f('0x1c')]?_[_0x2b1f('0x1b')](_0x3aaad0[_0x2b1f('0x1c')],function(_0x5aab0e){return{'model':db[_0x5aab0e[_0x2b1f('0x1d')]],'as':_0x5aab0e['as'],'attributes':_0x5aab0e[_0x2b1f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2b1f('0x1e')](function(_0x36e36b){logger['info']('ShowSound',_0x2057e8);logger[_0x2b1f('0xb')](_0x2b1f('0x15'),_0x2057e8,JSON[_0x2b1f('0xe')](_0x36e36b));_0x4a3f79(_0x36e36b);})[_0x2b1f('0x14')](function(_0x224e97){logger['error'](_0x2b1f('0x15'),_0x224e97[_0x2b1f('0x11')],_0x2057e8);_0xbb51b1(_0x19e347[_0x2b1f('0xf')](0x1f4,_0x224e97['message']));});});};
\ No newline at end of file
index d944582..db37b4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d0e=['get','/:id/test','test','post','create','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','/:id','show'];(function(_0x4c1742,_0x52ec14){var _0x7713da=function(_0x25a15b){while(--_0x25a15b){_0x4c1742['push'](_0x4c1742['shift']());}};_0x7713da(++_0x52ec14);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x38eb14,_0x55369d){_0x38eb14=_0x38eb14-0x0;var _0xf09fb6=_0x8d0e[_0x38eb14];return _0xf09fb6;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var express=require(_0xe8d0('0x3'));var router=express[_0xe8d0('0x4')]();var auth=require(_0xe8d0('0x5'));var interaction=require(_0xe8d0('0x6'));var config=require(_0xe8d0('0x7'));var controller=require(_0xe8d0('0x8'));router['get']('/',auth[_0xe8d0('0x9')](),controller['index']);router['get'](_0xe8d0('0xa'),auth[_0xe8d0('0x9')](),controller[_0xe8d0('0xb')]);router[_0xe8d0('0xc')](_0xe8d0('0xd'),auth[_0xe8d0('0x9')](),controller[_0xe8d0('0xe')]);router[_0xe8d0('0xf')]('/',auth['isAuthenticated'](),controller[_0xe8d0('0x10')]);router[_0xe8d0('0x11')](_0xe8d0('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xe8d0('0x12')](_0xe8d0('0xa'),auth[_0xe8d0('0x9')](),controller[_0xe8d0('0x13')]);module[_0xe8d0('0x14')]=router;
\ No newline at end of file
+var _0xee14=['/:id/test','test','create','/:id','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee14,0x13a));var _0x4ee1=function(_0xb7b78,_0x14a03e){_0xb7b78=_0xb7b78-0x0;var _0x298dc4=_0xee14[_0xb7b78];return _0x298dc4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ee1('0x0'));var express=require(_0x4ee1('0x1'));var router=express[_0x4ee1('0x2')]();var auth=require(_0x4ee1('0x3'));var interaction=require(_0x4ee1('0x4'));var config=require(_0x4ee1('0x5'));var controller=require(_0x4ee1('0x6'));router[_0x4ee1('0x7')]('/',auth[_0x4ee1('0x8')](),controller['index']);router[_0x4ee1('0x7')]('/:id',auth[_0x4ee1('0x8')](),controller[_0x4ee1('0x9')]);router[_0x4ee1('0x7')](_0x4ee1('0xa'),auth[_0x4ee1('0x8')](),controller[_0x4ee1('0xb')]);router['post']('/',auth[_0x4ee1('0x8')](),controller[_0x4ee1('0xc')]);router['put'](_0x4ee1('0xd'),auth[_0x4ee1('0x8')](),controller[_0x4ee1('0xe')]);router[_0x4ee1('0xf')]('/:id',auth[_0x4ee1('0x8')](),controller[_0x4ee1('0x10')]);module[_0x4ee1('0x11')]=router;
\ No newline at end of file
index 18bcdcd..52a35c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa43=['STRING','name'];(function(_0x7f677f,_0x5f2c1c){var _0x5acea1=function(_0x21e95e){while(--_0x21e95e){_0x7f677f['push'](_0x7f677f['shift']());}};_0x5acea1(++_0x5f2c1c);}(_0xaa43,0x132));var _0x3aa4=function(_0x1f2124,_0x58d4b7){_0x1f2124=_0x1f2124-0x0;var _0x25d5c6=_0xaa43[_0x1f2124];return _0x25d5c6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3aa4('0x0')],'unique':_0x3aa4('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x3aa4('0x0')]},'description':{'type':Sequelize[_0x3aa4('0x0')]}};
\ No newline at end of file
+var _0x255e=['name','STRING'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x255e,0x79));var _0xe255=function(_0x55528c,_0xbc1cc8){_0x55528c=_0x55528c-0x0;var _0x1a5f88=_0x255e[_0x55528c];return _0x1a5f88;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe255('0x0')],'unique':_0xe255('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0xe255('0x0')]},'description':{'type':Sequelize[_0xe255('0x0')]}};
\ No newline at end of file
index f52c799..f758642 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6829=['query','dateStart','dateEnd','intersection','fields','attributes','length','limit','order','sort','where','pick','filters','add','day','filter','merge','map','options','then','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','update','params','test','dsn','openSync','closeSync','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../config/logger','../../config/utils','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','destroy','sendStatus','error','name','send','index','SquareOdbc','model','keys'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x6829,0x14c));var _0x9682=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x6829[_0x4c12ec];return _0x3ae42c;};'use strict';var pdf=require(_0x9682('0x0'));var emlformat=require(_0x9682('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9682('0x2'));var moment=require(_0x9682('0x3'));var BPromise=require(_0x9682('0x4'));var Mustache=require(_0x9682('0x5'));var util=require(_0x9682('0x6'));var path=require(_0x9682('0x7'));var sox=require(_0x9682('0x8'));var csv=require(_0x9682('0x9'));var ejs=require(_0x9682('0xa'));var fs=require('fs');var _=require(_0x9682('0xb'));var squel=require(_0x9682('0xc'));var crypto=require(_0x9682('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9682('0xe'));var Papa=require(_0x9682('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x9682('0x10'))('api');var utils=require(_0x9682('0x11'));var config=require('../../config/environment');var db=require(_0x9682('0x12'))['db'];function respondWithStatusCode(_0x42f4a6,_0x42b057){_0x42b057=_0x42b057||0xcc;return function(_0x4d220d){if(_0x4d220d){return _0x42f4a6['sendStatus'](_0x42b057);}return _0x42f4a6[_0x9682('0x13')](_0x42b057)[_0x9682('0x14')]();};}function respondWithResult(_0x57e123,_0x15663f){_0x15663f=_0x15663f||0xc8;return function(_0x5b0854){if(_0x5b0854){return _0x57e123[_0x9682('0x13')](_0x15663f)[_0x9682('0x15')](_0x5b0854);}};}function respondWithFilteredResult(_0x289d8b,_0x21451a){return function(_0x30bfd7){if(_0x30bfd7){var _0x161717=_0x30bfd7[_0x9682('0x16')],_0x73f6c6=_0x21451a['offset'],_0xa26517=_0x21451a[_0x9682('0x17')]+_0x21451a['limit'],_0x1adcf8;if(_0xa26517>=_0x161717){_0xa26517=_0x161717;_0x1adcf8=0xc8;}else{_0x1adcf8=0xce;}_0x289d8b[_0x9682('0x13')](_0x1adcf8);return _0x289d8b[_0x9682('0x18')](_0x9682('0x19'),_0x73f6c6+'-'+_0xa26517+'/'+_0x161717)['json'](_0x30bfd7);}return null;};}function patchUpdates(_0x1c73ee){return function(_0x4e0dfb){try{jsonpatch[_0x9682('0x1a')](_0x4e0dfb,_0x1c73ee,!![]);}catch(_0x51c1a8){return BPromise[_0x9682('0x1b')](_0x51c1a8);}return _0x4e0dfb[_0x9682('0x1c')]();};}function saveUpdates(_0x57d4cf,_0xf48c4d){return function(_0x2202d9){if(_0x2202d9){return _0x2202d9['update'](_0x57d4cf)['then'](function(_0x497ff7){return _0x497ff7;});}return null;};}function removeEntity(_0x3fca2b,_0x4efb3f){return function(_0x36230c){if(_0x36230c){return _0x36230c[_0x9682('0x1d')]()['then'](function(){_0x3fca2b[_0x9682('0x13')](0xcc)[_0x9682('0x14')]();});}};}function handleEntityNotFound(_0x1aacb6,_0xe3e8eb){return function(_0x1e018e){if(!_0x1e018e){_0x1aacb6[_0x9682('0x1e')](0x194);}return _0x1e018e;};}function handleError(_0x738838,_0x40e927){_0x40e927=_0x40e927||0x1f4;return function(_0x107352){logger[_0x9682('0x1f')](_0x107352['stack']);if(_0x107352[_0x9682('0x20')]){delete _0x107352[_0x9682('0x20')];}_0x738838[_0x9682('0x13')](_0x40e927)[_0x9682('0x21')](_0x107352);};}exports[_0x9682('0x22')]=function(_0x5319f2,_0x756fea){var _0x1dbf57={},_0x44808c={},_0x368d14={'count':0x0,'rows':[]};var _0x27bf94=db[_0x9682('0x23')]['rawAttributes'];_0x44808c[_0x9682('0x24')]=_[_0x9682('0x25')](_0x27bf94);var _0x27dc9e={'dateStart':_0x5319f2[_0x9682('0x26')][_0x9682('0x27')],'dateEnd':_0x5319f2[_0x9682('0x26')][_0x9682('0x28')]};delete _0x5319f2[_0x9682('0x26')]['dateStart'];delete _0x5319f2[_0x9682('0x26')]['dateEnd'];_0x44808c[_0x9682('0x26')]=_[_0x9682('0x25')](_0x5319f2['query']);_0x44808c['filters']=_['intersection'](_0x44808c['model'],_0x44808c[_0x9682('0x26')]);_0x1dbf57['attributes']=_[_0x9682('0x29')](_0x44808c[_0x9682('0x24')],qs[_0x9682('0x2a')](_0x5319f2[_0x9682('0x26')]['fields']));_0x1dbf57['attributes']=_0x1dbf57[_0x9682('0x2b')][_0x9682('0x2c')]?_0x1dbf57[_0x9682('0x2b')]:_0x44808c[_0x9682('0x24')];if(!_0x5319f2[_0x9682('0x26')]['hasOwnProperty']('nolimit')){_0x1dbf57[_0x9682('0x2d')]=qs[_0x9682('0x2d')](_0x5319f2[_0x9682('0x26')][_0x9682('0x2d')]);_0x1dbf57[_0x9682('0x17')]=qs[_0x9682('0x17')](_0x5319f2[_0x9682('0x26')]['offset']);}_0x1dbf57[_0x9682('0x2e')]=qs[_0x9682('0x2f')](_0x5319f2[_0x9682('0x26')][_0x9682('0x2f')]);_0x1dbf57[_0x9682('0x30')]=qs['filters'](_[_0x9682('0x31')](_0x5319f2['query'],_0x44808c[_0x9682('0x32')]));if(_0x27dc9e[_0x9682('0x27')]){if(_0x27dc9e[_0x9682('0x28')]){_0x27dc9e[_0x9682('0x28')]=moment(_0x27dc9e[_0x9682('0x28')])[_0x9682('0x33')](0x1,_0x9682('0x34'));}else{_0x27dc9e['dateEnd']=moment(_0x27dc9e[_0x9682('0x27')])['add'](0x1,_0x9682('0x34'));}_['merge'](_0x1dbf57[_0x9682('0x30')],{'createdAt':{'$gte':_0x27dc9e[_0x9682('0x27')],'$lte':_0x27dc9e[_0x9682('0x28')]}});}if(_0x5319f2[_0x9682('0x26')][_0x9682('0x35')]){_0x1dbf57[_0x9682('0x30')]=_[_0x9682('0x36')](_0x1dbf57[_0x9682('0x30')],{'$or':_[_0x9682('0x37')](_0x1dbf57[_0x9682('0x2b')],function(_0x26349d){var _0x51e054={};_0x51e054[_0x26349d]={'$like':'%'+_0x5319f2[_0x9682('0x26')][_0x9682('0x35')]+'%'};return _0x51e054;})});}_0x1dbf57=_[_0x9682('0x36')]({},_0x1dbf57,_0x5319f2[_0x9682('0x38')]);var _0x3b0a99={'where':_0x1dbf57['where']};return db[_0x9682('0x23')][_0x9682('0x16')](_0x3b0a99)[_0x9682('0x39')](function(_0x5bae81){_0x368d14[_0x9682('0x16')]=_0x5bae81;if(_0x5319f2[_0x9682('0x26')][_0x9682('0x3a')]){_0x1dbf57[_0x9682('0x3b')]=[{'all':!![]}];}return db[_0x9682('0x23')][_0x9682('0x3c')](_0x1dbf57);})[_0x9682('0x39')](function(_0x20c8cc){_0x368d14[_0x9682('0x3d')]=_0x20c8cc;return _0x368d14;})[_0x9682('0x39')](respondWithFilteredResult(_0x756fea,_0x1dbf57))[_0x9682('0x3e')](handleError(_0x756fea,null));};exports[_0x9682('0x3f')]=function(_0x277abc,_0x120614){var _0x1a973c={'raw':!![],'where':{'id':_0x277abc['params']['id']}},_0x2a3cf3={};_0x2a3cf3[_0x9682('0x24')]=_['keys'](db[_0x9682('0x23')][_0x9682('0x40')]);_0x2a3cf3[_0x9682('0x26')]=_['keys'](_0x277abc['query']);_0x2a3cf3[_0x9682('0x32')]=_[_0x9682('0x29')](_0x2a3cf3[_0x9682('0x24')],_0x2a3cf3[_0x9682('0x26')]);_0x1a973c[_0x9682('0x2b')]=_[_0x9682('0x29')](_0x2a3cf3[_0x9682('0x24')],qs['fields'](_0x277abc[_0x9682('0x26')]['fields']));_0x1a973c[_0x9682('0x2b')]=_0x1a973c[_0x9682('0x2b')][_0x9682('0x2c')]?_0x1a973c[_0x9682('0x2b')]:_0x2a3cf3[_0x9682('0x24')];if(_0x277abc[_0x9682('0x26')][_0x9682('0x3a')]){_0x1a973c[_0x9682('0x3b')]=[{'all':!![]}];}_0x1a973c=_['merge']({},_0x1a973c,_0x277abc[_0x9682('0x38')]);return db[_0x9682('0x23')][_0x9682('0x41')](_0x1a973c)[_0x9682('0x39')](handleEntityNotFound(_0x120614,null))[_0x9682('0x39')](respondWithResult(_0x120614,null))[_0x9682('0x3e')](handleError(_0x120614,null));};exports['create']=function(_0x137b81,_0x206f5c){return db[_0x9682('0x23')][_0x9682('0x42')](_0x137b81[_0x9682('0x43')],{})[_0x9682('0x39')](respondWithResult(_0x206f5c,0xc9))[_0x9682('0x3e')](handleError(_0x206f5c,null));};exports[_0x9682('0x44')]=function(_0xe4bf52,_0x2ef57f){if(_0xe4bf52['body']['id']){delete _0xe4bf52['body']['id'];}return db['SquareOdbc']['find']({'where':{'id':_0xe4bf52['params']['id']}})[_0x9682('0x39')](handleEntityNotFound(_0x2ef57f,null))[_0x9682('0x39')](saveUpdates(_0xe4bf52[_0x9682('0x43')],null))['then'](respondWithResult(_0x2ef57f,null))[_0x9682('0x3e')](handleError(_0x2ef57f,null));};exports[_0x9682('0x1d')]=function(_0x14e7e2,_0x582380){return db[_0x9682('0x23')][_0x9682('0x41')]({'where':{'id':_0x14e7e2[_0x9682('0x45')]['id']}})[_0x9682('0x39')](handleEntityNotFound(_0x582380,null))[_0x9682('0x39')](removeEntity(_0x582380,null))[_0x9682('0x3e')](handleError(_0x582380,null));};exports[_0x9682('0x46')]=function(_0x5ceab7,_0x22f944,_0x14a5dd){var _0x423132;return db[_0x9682('0x23')][_0x9682('0x41')]({'where':{'id':_0x5ceab7[_0x9682('0x45')]['id']},'attributes':['id',_0x9682('0x47')]})['then'](handleEntityNotFound(_0x22f944,null))['then'](function(_0xaee5ed){if(_0xaee5ed){var _0x10adbb=require('odbc')();_0x10adbb[_0x9682('0x48')](_0xaee5ed[_0x9682('0x47')]);_0x10adbb[_0x9682('0x49')]();return _0xaee5ed;}})[_0x9682('0x39')](respondWithResult(_0x22f944,null))[_0x9682('0x3e')](handleError(_0x22f944,null));};
\ No newline at end of file
+var _0xf108=['catch','show','params','length','find','create','body','test','dsn','openSync','closeSync','html-pdf','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','SquareOdbc','rawAttributes','query','dateStart','dateEnd','keys','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','filters','pick','add','filter','merge','map','options','count','includeAll','include','findAll','rows'];(function(_0x18d0b5,_0x522ecd){var _0x469308=function(_0x14f00b){while(--_0x14f00b){_0x18d0b5['push'](_0x18d0b5['shift']());}};_0x469308(++_0x522ecd);}(_0xf108,0x1d9));var _0x8f10=function(_0x53975d,_0x1407ee){_0x53975d=_0x53975d-0x0;var _0x1329ec=_0xf108[_0x53975d];return _0x1329ec;};'use strict';var pdf=require(_0x8f10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8f10('0x1'));var zipdir=require(_0x8f10('0x2'));var jsonpatch=require(_0x8f10('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8f10('0x4'));var util=require(_0x8f10('0x5'));var path=require(_0x8f10('0x6'));var sox=require(_0x8f10('0x7'));var csv=require(_0x8f10('0x8'));var ejs=require(_0x8f10('0x9'));var fs=require('fs');var _=require(_0x8f10('0xa'));var squel=require(_0x8f10('0xb'));var crypto=require(_0x8f10('0xc'));var jsforce=require(_0x8f10('0xd'));var deskjs=require(_0x8f10('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8f10('0xf'));var Papa=require(_0x8f10('0x10'));var qs=require(_0x8f10('0x11'));var logger=require(_0x8f10('0x12'))(_0x8f10('0x13'));var utils=require(_0x8f10('0x14'));var config=require(_0x8f10('0x15'));var db=require(_0x8f10('0x16'))['db'];function respondWithStatusCode(_0x440f86,_0x23c485){_0x23c485=_0x23c485||0xcc;return function(_0x2968c2){if(_0x2968c2){return _0x440f86[_0x8f10('0x17')](_0x23c485);}return _0x440f86[_0x8f10('0x18')](_0x23c485)[_0x8f10('0x19')]();};}function respondWithResult(_0x15f79d,_0x4ae80e){_0x4ae80e=_0x4ae80e||0xc8;return function(_0x5016fd){if(_0x5016fd){return _0x15f79d[_0x8f10('0x18')](_0x4ae80e)[_0x8f10('0x1a')](_0x5016fd);}};}function respondWithFilteredResult(_0x472b6f,_0x9b9e1f){return function(_0x1eaced){if(_0x1eaced){var _0x1126c5=_0x1eaced['count'],_0x34952c=_0x9b9e1f[_0x8f10('0x1b')],_0x15bae4=_0x9b9e1f[_0x8f10('0x1b')]+_0x9b9e1f[_0x8f10('0x1c')],_0x295dfc;if(_0x15bae4>=_0x1126c5){_0x15bae4=_0x1126c5;_0x295dfc=0xc8;}else{_0x295dfc=0xce;}_0x472b6f['status'](_0x295dfc);return _0x472b6f[_0x8f10('0x1d')](_0x8f10('0x1e'),_0x34952c+'-'+_0x15bae4+'/'+_0x1126c5)['json'](_0x1eaced);}return null;};}function patchUpdates(_0xdfd335){return function(_0x468bf3){try{jsonpatch[_0x8f10('0x1f')](_0x468bf3,_0xdfd335,!![]);}catch(_0x3003ea){return BPromise['reject'](_0x3003ea);}return _0x468bf3['save']();};}function saveUpdates(_0x266a86,_0x322bba){return function(_0x3a6165){if(_0x3a6165){return _0x3a6165[_0x8f10('0x20')](_0x266a86)[_0x8f10('0x21')](function(_0xfdb66e){return _0xfdb66e;});}return null;};}function removeEntity(_0x468fa9,_0x3fc95d){return function(_0x7bde34){if(_0x7bde34){return _0x7bde34[_0x8f10('0x22')]()[_0x8f10('0x21')](function(){_0x468fa9['status'](0xcc)[_0x8f10('0x19')]();});}};}function handleEntityNotFound(_0x485e83,_0x5d2ab2){return function(_0x5689e7){if(!_0x5689e7){_0x485e83[_0x8f10('0x17')](0x194);}return _0x5689e7;};}function handleError(_0x4cc92f,_0x185f2){_0x185f2=_0x185f2||0x1f4;return function(_0xdaa7dd){logger[_0x8f10('0x23')](_0xdaa7dd[_0x8f10('0x24')]);if(_0xdaa7dd[_0x8f10('0x25')]){delete _0xdaa7dd[_0x8f10('0x25')];}_0x4cc92f[_0x8f10('0x18')](_0x185f2)[_0x8f10('0x26')](_0xdaa7dd);};}exports[_0x8f10('0x27')]=function(_0x44dd23,_0x3458a8){var _0x4631ac={},_0x27e2dd={},_0x3b085d={'count':0x0,'rows':[]};var _0x563edc=db[_0x8f10('0x28')][_0x8f10('0x29')];_0x27e2dd['model']=_['keys'](_0x563edc);var _0x52a708={'dateStart':_0x44dd23[_0x8f10('0x2a')][_0x8f10('0x2b')],'dateEnd':_0x44dd23[_0x8f10('0x2a')][_0x8f10('0x2c')]};delete _0x44dd23[_0x8f10('0x2a')]['dateStart'];delete _0x44dd23[_0x8f10('0x2a')]['dateEnd'];_0x27e2dd[_0x8f10('0x2a')]=_[_0x8f10('0x2d')](_0x44dd23[_0x8f10('0x2a')]);_0x27e2dd['filters']=_[_0x8f10('0x2e')](_0x27e2dd['model'],_0x27e2dd['query']);_0x4631ac[_0x8f10('0x2f')]=_[_0x8f10('0x2e')](_0x27e2dd[_0x8f10('0x30')],qs[_0x8f10('0x31')](_0x44dd23[_0x8f10('0x2a')][_0x8f10('0x31')]));_0x4631ac[_0x8f10('0x2f')]=_0x4631ac['attributes']['length']?_0x4631ac[_0x8f10('0x2f')]:_0x27e2dd['model'];if(!_0x44dd23[_0x8f10('0x2a')][_0x8f10('0x32')]('nolimit')){_0x4631ac['limit']=qs[_0x8f10('0x1c')](_0x44dd23['query'][_0x8f10('0x1c')]);_0x4631ac['offset']=qs[_0x8f10('0x1b')](_0x44dd23['query']['offset']);}_0x4631ac[_0x8f10('0x33')]=qs['sort'](_0x44dd23[_0x8f10('0x2a')][_0x8f10('0x34')]);_0x4631ac[_0x8f10('0x35')]=qs[_0x8f10('0x36')](_[_0x8f10('0x37')](_0x44dd23['query'],_0x27e2dd[_0x8f10('0x36')]));if(_0x52a708[_0x8f10('0x2b')]){if(_0x52a708['dateEnd']){_0x52a708[_0x8f10('0x2c')]=moment(_0x52a708['dateEnd'])[_0x8f10('0x38')](0x1,'day');}else{_0x52a708[_0x8f10('0x2c')]=moment(_0x52a708['dateStart'])[_0x8f10('0x38')](0x1,'day');}_['merge'](_0x4631ac[_0x8f10('0x35')],{'createdAt':{'$gte':_0x52a708['dateStart'],'$lte':_0x52a708[_0x8f10('0x2c')]}});}if(_0x44dd23[_0x8f10('0x2a')][_0x8f10('0x39')]){_0x4631ac['where']=_[_0x8f10('0x3a')](_0x4631ac[_0x8f10('0x35')],{'$or':_[_0x8f10('0x3b')](_0x4631ac[_0x8f10('0x2f')],function(_0x444d3a){var _0x21d166={};_0x21d166[_0x444d3a]={'$like':'%'+_0x44dd23[_0x8f10('0x2a')][_0x8f10('0x39')]+'%'};return _0x21d166;})});}_0x4631ac=_['merge']({},_0x4631ac,_0x44dd23[_0x8f10('0x3c')]);var _0x7a85f7={'where':_0x4631ac['where']};return db[_0x8f10('0x28')]['count'](_0x7a85f7)[_0x8f10('0x21')](function(_0x441973){_0x3b085d[_0x8f10('0x3d')]=_0x441973;if(_0x44dd23[_0x8f10('0x2a')][_0x8f10('0x3e')]){_0x4631ac[_0x8f10('0x3f')]=[{'all':!![]}];}return db[_0x8f10('0x28')][_0x8f10('0x40')](_0x4631ac);})[_0x8f10('0x21')](function(_0x3ad64d){_0x3b085d[_0x8f10('0x41')]=_0x3ad64d;return _0x3b085d;})[_0x8f10('0x21')](respondWithFilteredResult(_0x3458a8,_0x4631ac))[_0x8f10('0x42')](handleError(_0x3458a8,null));};exports[_0x8f10('0x43')]=function(_0x5b1fcf,_0x286689){var _0x4597ab={'raw':!![],'where':{'id':_0x5b1fcf[_0x8f10('0x44')]['id']}},_0x5b4276={};_0x5b4276[_0x8f10('0x30')]=_[_0x8f10('0x2d')](db[_0x8f10('0x28')][_0x8f10('0x29')]);_0x5b4276[_0x8f10('0x2a')]=_[_0x8f10('0x2d')](_0x5b1fcf['query']);_0x5b4276[_0x8f10('0x36')]=_[_0x8f10('0x2e')](_0x5b4276[_0x8f10('0x30')],_0x5b4276['query']);_0x4597ab['attributes']=_[_0x8f10('0x2e')](_0x5b4276[_0x8f10('0x30')],qs['fields'](_0x5b1fcf[_0x8f10('0x2a')][_0x8f10('0x31')]));_0x4597ab[_0x8f10('0x2f')]=_0x4597ab[_0x8f10('0x2f')][_0x8f10('0x45')]?_0x4597ab[_0x8f10('0x2f')]:_0x5b4276['model'];if(_0x5b1fcf[_0x8f10('0x2a')][_0x8f10('0x3e')]){_0x4597ab[_0x8f10('0x3f')]=[{'all':!![]}];}_0x4597ab=_['merge']({},_0x4597ab,_0x5b1fcf[_0x8f10('0x3c')]);return db[_0x8f10('0x28')][_0x8f10('0x46')](_0x4597ab)[_0x8f10('0x21')](handleEntityNotFound(_0x286689,null))['then'](respondWithResult(_0x286689,null))[_0x8f10('0x42')](handleError(_0x286689,null));};exports[_0x8f10('0x47')]=function(_0x49f722,_0x2d07f8){return db['SquareOdbc']['create'](_0x49f722[_0x8f10('0x48')],{})[_0x8f10('0x21')](respondWithResult(_0x2d07f8,0xc9))[_0x8f10('0x42')](handleError(_0x2d07f8,null));};exports[_0x8f10('0x20')]=function(_0x21c929,_0x495bb2){if(_0x21c929[_0x8f10('0x48')]['id']){delete _0x21c929[_0x8f10('0x48')]['id'];}return db[_0x8f10('0x28')][_0x8f10('0x46')]({'where':{'id':_0x21c929[_0x8f10('0x44')]['id']}})[_0x8f10('0x21')](handleEntityNotFound(_0x495bb2,null))[_0x8f10('0x21')](saveUpdates(_0x21c929[_0x8f10('0x48')],null))[_0x8f10('0x21')](respondWithResult(_0x495bb2,null))[_0x8f10('0x42')](handleError(_0x495bb2,null));};exports[_0x8f10('0x22')]=function(_0x452276,_0x16ada8){return db['SquareOdbc'][_0x8f10('0x46')]({'where':{'id':_0x452276[_0x8f10('0x44')]['id']}})[_0x8f10('0x21')](handleEntityNotFound(_0x16ada8,null))[_0x8f10('0x21')](removeEntity(_0x16ada8,null))[_0x8f10('0x42')](handleError(_0x16ada8,null));};exports[_0x8f10('0x49')]=function(_0x15f031,_0x34eb2c,_0x2780f4){var _0x205140;return db[_0x8f10('0x28')]['find']({'where':{'id':_0x15f031[_0x8f10('0x44')]['id']},'attributes':['id',_0x8f10('0x4a')]})[_0x8f10('0x21')](handleEntityNotFound(_0x34eb2c,null))[_0x8f10('0x21')](function(_0x2f9545){if(_0x2f9545){var _0x560aa4=require('odbc')();_0x560aa4[_0x8f10('0x4b')](_0x2f9545[_0x8f10('0x4a')]);_0x560aa4[_0x8f10('0x4c')]();return _0x2f9545;}})[_0x8f10('0x21')](respondWithResult(_0x34eb2c,null))[_0x8f10('0x42')](handleError(_0x34eb2c,null));};
\ No newline at end of file
index 4462a50..90aec88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb903=['util','../../config/logger','api','bluebird','request-promise','./squareOdbc.attributes','exports','define','square_odbc','lodash'];(function(_0x25dad,_0x5d839e){var _0x45633d=function(_0x32e777){while(--_0x32e777){_0x25dad['push'](_0x25dad['shift']());}};_0x45633d(++_0x5d839e);}(_0xb903,0x185));var _0x3b90=function(_0x376892,_0x1b2cbf){_0x376892=_0x376892-0x0;var _0x251780=_0xb903[_0x376892];return _0x251780;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var logger=require(_0x3b90('0x2'))(_0x3b90('0x3'));var moment=require('moment');var BPromise=require(_0x3b90('0x4'));var rp=require(_0x3b90('0x5'));var attributes=require(_0x3b90('0x6'));module[_0x3b90('0x7')]=function(_0x30d8db,_0x40f726){return _0x30d8db[_0x3b90('0x8')]('SquareOdbc',attributes,{'tableName':_0x3b90('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbdb7=['exports','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./squareOdbc.attributes'];(function(_0x2a92a4,_0x5ca2ec){var _0x383acc=function(_0x5a040d){while(--_0x5a040d){_0x2a92a4['push'](_0x2a92a4['shift']());}};_0x383acc(++_0x5ca2ec);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x39cdb8,_0x15ee98){_0x39cdb8=_0x39cdb8-0x0;var _0x44bbc9=_0xbdb7[_0x39cdb8];return _0x44bbc9;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var moment=require(_0x7bdb('0x4'));var BPromise=require(_0x7bdb('0x5'));var rp=require(_0x7bdb('0x6'));var attributes=require(_0x7bdb('0x7'));module[_0x7bdb('0x8')]=function(_0x47aec5,_0x28542c){return _0x47aec5['define']('SquareOdbc',attributes,{'tableName':_0x7bdb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b342915..3c926e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x428e=['client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','find','options','attributes','include','map','model','ShowSquareOdbc','debug','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2442b9,_0x3d87e9){var _0x31b571=function(_0x1e10ee){while(--_0x1e10ee){_0x2442b9['push'](_0x2442b9['shift']());}};_0x31b571(++_0x3d87e9);}(_0x428e,0xda));var _0xe428=function(_0x41382c,_0xc3ffd1){_0x41382c=_0x41382c-0x0;var _0x4da35b=_0x428e[_0x41382c];return _0x4da35b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe428('0x0'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0xe428('0x1'));var logger=require(_0xe428('0x2'))(_0xe428('0x3'));var config=require(_0xe428('0x4'));var jayson=require(_0xe428('0x5'));var client=jayson[_0xe428('0x6')][_0xe428('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1d11da,_0x374634,_0xfa8b44){return new BPromise(function(_0x20f018,_0x1dd5f5){return client[_0xe428('0x8')](_0x1d11da,_0xfa8b44)[_0xe428('0x9')](function(_0x2c7c0d){logger[_0xe428('0xa')](_0xe428('0xb'),_0x374634,_0xe428('0xc'));logger['debug'](_0xe428('0xd'),_0x374634,_0xe428('0xc'),JSON[_0xe428('0xe')](_0x2c7c0d));if(_0x2c7c0d[_0xe428('0xf')]){if(_0x2c7c0d[_0xe428('0xf')][_0xe428('0x10')]===0x1f4){logger[_0xe428('0xf')](_0xe428('0xb'),_0x374634,_0x2c7c0d[_0xe428('0xf')][_0xe428('0x11')]);return _0x1dd5f5(_0x2c7c0d['error'][_0xe428('0x11')]);}logger['error'](_0xe428('0xb'),_0x374634,_0x2c7c0d[_0xe428('0xf')]['message']);return _0x20f018(_0x2c7c0d[_0xe428('0xf')][_0xe428('0x11')]);}else{logger['info'](_0xe428('0xb'),_0x374634,_0xe428('0xc'));_0x20f018(_0x2c7c0d[_0xe428('0x12')][_0xe428('0x11')]);}})[_0xe428('0x13')](function(_0x29bb41){logger[_0xe428('0xf')](_0xe428('0xb'),_0x374634,_0x29bb41);_0x1dd5f5(_0x29bb41);});});}exports['ShowSquareOdbc']=function(_0x541090){var _0x4876c9=this;return new Promise(function(_0x56ae71,_0x252a76){return db['SquareOdbc'][_0xe428('0x14')]({'raw':_0x541090[_0xe428('0x15')]?_0x541090[_0xe428('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x541090['options']?_0x541090['options']['where']||null:null,'attributes':_0x541090[_0xe428('0x15')]?_0x541090[_0xe428('0x15')][_0xe428('0x16')]||null:null,'include':_0x541090['options']?_0x541090['options'][_0xe428('0x17')]?_[_0xe428('0x18')](_0x541090[_0xe428('0x15')][_0xe428('0x17')],function(_0x376709){return{'model':db[_0x376709['model']],'as':_0x376709['as'],'attributes':_0x376709[_0xe428('0x16')],'include':_0x376709[_0xe428('0x17')]?_[_0xe428('0x18')](_0x376709[_0xe428('0x17')],function(_0x528833){return{'model':db[_0x528833[_0xe428('0x19')]],'as':_0x528833['as'],'attributes':_0x528833[_0xe428('0x16')],'include':_0x528833[_0xe428('0x17')]?_['map'](_0x528833[_0xe428('0x17')],function(_0x4ab4ca){return{'model':db[_0x4ab4ca['model']],'as':_0x4ab4ca['as'],'attributes':_0x4ab4ca[_0xe428('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49f8a0){logger[_0xe428('0xa')](_0xe428('0x1a'),_0x541090);logger[_0xe428('0x1b')](_0xe428('0x1a'),_0x541090,JSON[_0xe428('0xe')](_0x49f8a0));_0x56ae71(_0x49f8a0);})[_0xe428('0x13')](function(_0x5bad9e){logger['error'](_0xe428('0x1a'),_0x5bad9e[_0xe428('0x11')],_0x541090);_0x252a76(_0x4876c9[_0xe428('0xf')](0x1f4,_0x5bad9e['message']));});});};
\ No newline at end of file
+var _0x68c8=['client','request','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','ShowSquareOdbc','SquareOdbc','options','raw','where','attributes','include','map','model','then','stringify','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x18fe54,_0xff789){var _0xccb1ee=function(_0x513cf3){while(--_0x513cf3){_0x18fe54['push'](_0x18fe54['shift']());}};_0xccb1ee(++_0xff789);}(_0x68c8,0xe9));var _0x868c=function(_0x1e3f3b,_0x23eac9){_0x1e3f3b=_0x1e3f3b-0x0;var _0x1c0ea6=_0x68c8[_0x1e3f3b];return _0x1c0ea6;};'use strict';var _=require('lodash');var util=require(_0x868c('0x0'));var moment=require('moment');var BPromise=require(_0x868c('0x1'));var rs=require(_0x868c('0x2'));var fs=require('fs');var db=require(_0x868c('0x3'))['db'];var utils=require(_0x868c('0x4'));var logger=require(_0x868c('0x5'))(_0x868c('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x868c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c3bab,_0x4cb065,_0x112b0e){return new BPromise(function(_0x35fa23,_0x261a5a){return client[_0x868c('0x8')](_0x3c3bab,_0x112b0e)['then'](function(_0x28223e){logger['info'](_0x868c('0x9'),_0x4cb065,_0x868c('0xa'));logger[_0x868c('0xb')](_0x868c('0xc'),_0x4cb065,_0x868c('0xa'),JSON['stringify'](_0x28223e));if(_0x28223e[_0x868c('0xd')]){if(_0x28223e['error'][_0x868c('0xe')]===0x1f4){logger['error'](_0x868c('0x9'),_0x4cb065,_0x28223e['error'][_0x868c('0xf')]);return _0x261a5a(_0x28223e[_0x868c('0xd')][_0x868c('0xf')]);}logger[_0x868c('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x4cb065,_0x28223e[_0x868c('0xd')]['message']);return _0x35fa23(_0x28223e[_0x868c('0xd')][_0x868c('0xf')]);}else{logger[_0x868c('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x4cb065,_0x868c('0xa'));_0x35fa23(_0x28223e[_0x868c('0x11')]['message']);}})[_0x868c('0x12')](function(_0x577084){logger[_0x868c('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x4cb065,_0x577084);_0x261a5a(_0x577084);});});}exports[_0x868c('0x13')]=function(_0x384642){var _0x1027d6=this;return new Promise(function(_0x2d89dc,_0x9f5cfb){return db[_0x868c('0x14')]['find']({'raw':_0x384642[_0x868c('0x15')]?_0x384642[_0x868c('0x15')][_0x868c('0x16')]===undefined?!![]:![]:!![],'where':_0x384642['options']?_0x384642['options'][_0x868c('0x17')]||null:null,'attributes':_0x384642[_0x868c('0x15')]?_0x384642[_0x868c('0x15')][_0x868c('0x18')]||null:null,'include':_0x384642[_0x868c('0x15')]?_0x384642['options'][_0x868c('0x19')]?_[_0x868c('0x1a')](_0x384642[_0x868c('0x15')][_0x868c('0x19')],function(_0x2f03be){return{'model':db[_0x2f03be[_0x868c('0x1b')]],'as':_0x2f03be['as'],'attributes':_0x2f03be['attributes'],'include':_0x2f03be[_0x868c('0x19')]?_[_0x868c('0x1a')](_0x2f03be[_0x868c('0x19')],function(_0x3a232d){return{'model':db[_0x3a232d[_0x868c('0x1b')]],'as':_0x3a232d['as'],'attributes':_0x3a232d[_0x868c('0x18')],'include':_0x3a232d['include']?_[_0x868c('0x1a')](_0x3a232d[_0x868c('0x19')],function(_0x4a3c78){return{'model':db[_0x4a3c78[_0x868c('0x1b')]],'as':_0x4a3c78['as'],'attributes':_0x4a3c78[_0x868c('0x18')]};}):[]};}):[]};}):[]:[]})[_0x868c('0x1c')](function(_0x1ad68e){logger[_0x868c('0x10')](_0x868c('0x13'),_0x384642);logger['debug']('ShowSquareOdbc',_0x384642,JSON[_0x868c('0x1d')](_0x1ad68e));_0x2d89dc(_0x1ad68e);})['catch'](function(_0x325027){logger['error'](_0x868c('0x13'),_0x325027[_0x868c('0xf')],_0x384642);_0x9f5cfb(_0x1027d6[_0x868c('0xd')](0x1f4,_0x325027[_0x868c('0xf')]));});});};
\ No newline at end of file
index 07ecb48..d23a7ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd442=['../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','getUsers','create','post','/:id/users','addUsers','put','update','delete','/:id','destroy','removeUsers','exports','multer','util','path','Router'];(function(_0x2eb9fd,_0x345456){var _0x509666=function(_0xc37465){while(--_0xc37465){_0x2eb9fd['push'](_0x2eb9fd['shift']());}};_0x509666(++_0x345456);}(_0xd442,0x11a));var _0x2d44=function(_0x14f75a,_0x4f17ef){_0x14f75a=_0x14f75a-0x0;var _0x528669=_0xd442[_0x14f75a];return _0x528669;};'use strict';var multer=require(_0x2d44('0x0'));var util=require(_0x2d44('0x1'));var path=require(_0x2d44('0x2'));var express=require('express');var router=express[_0x2d44('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x2d44('0x4'));var config=require(_0x2d44('0x5'));var controller=require(_0x2d44('0x6'));router[_0x2d44('0x7')]('/',auth[_0x2d44('0x8')](),controller[_0x2d44('0x9')]);router[_0x2d44('0x7')]('/:id',auth[_0x2d44('0x8')](),controller['show']);router[_0x2d44('0x7')]('/:id/users',auth[_0x2d44('0x8')](),controller[_0x2d44('0xa')]);router['post']('/',auth[_0x2d44('0x8')](),controller[_0x2d44('0xb')]);router[_0x2d44('0xc')](_0x2d44('0xd'),auth[_0x2d44('0x8')](),controller[_0x2d44('0xe')]);router[_0x2d44('0xf')]('/:id',auth[_0x2d44('0x8')](),controller[_0x2d44('0x10')]);router[_0x2d44('0x11')](_0x2d44('0x12'),auth[_0x2d44('0x8')](),controller[_0x2d44('0x13')]);router[_0x2d44('0x11')]('/:id/users',auth[_0x2d44('0x8')](),controller[_0x2d44('0x14')]);module[_0x2d44('0x15')]=router;
\ No newline at end of file
+var _0xf725=['post','/:id/users','addUsers','put','update','destroy','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','getUsers'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0xf725,0x1c0));var _0x5f72=function(_0x447398,_0x34b46f){_0x447398=_0x447398-0x0;var _0x4de5ef=_0xf725[_0x447398];return _0x4de5ef;};'use strict';var multer=require(_0x5f72('0x0'));var util=require(_0x5f72('0x1'));var path=require(_0x5f72('0x2'));var express=require(_0x5f72('0x3'));var router=express[_0x5f72('0x4')]();var auth=require(_0x5f72('0x5'));var interaction=require(_0x5f72('0x6'));var config=require(_0x5f72('0x7'));var controller=require('./squareProject.controller');router['get']('/',auth[_0x5f72('0x8')](),controller[_0x5f72('0x9')]);router[_0x5f72('0xa')](_0x5f72('0xb'),auth[_0x5f72('0x8')](),controller[_0x5f72('0xc')]);router[_0x5f72('0xa')]('/:id/users',auth[_0x5f72('0x8')](),controller[_0x5f72('0xd')]);router[_0x5f72('0xe')]('/',auth[_0x5f72('0x8')](),controller['create']);router[_0x5f72('0xe')](_0x5f72('0xf'),auth['isAuthenticated'](),controller[_0x5f72('0x10')]);router[_0x5f72('0x11')](_0x5f72('0xb'),auth[_0x5f72('0x8')](),controller[_0x5f72('0x12')]);router['delete'](_0x5f72('0xb'),auth[_0x5f72('0x8')](),controller[_0x5f72('0x13')]);router[_0x5f72('0x14')](_0x5f72('0xf'),auth[_0x5f72('0x8')](),controller['removeUsers']);module[_0x5f72('0x15')]=router;
\ No newline at end of file
index 300e024..af7f08a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c48=['BLOB','preproduction','getDataValue','toString','utf8','long','production','sequelize','exports','STRING','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c48,0xa1));var _0x89c4=function(_0x3a1131,_0x1f4c0e){_0x3a1131=_0x3a1131-0x0;var _0x1bf96e=_0x9c48[_0x3a1131];return _0x1bf96e;};'use strict';var Sequelize=require(_0x89c4('0x0'));module[_0x89c4('0x1')]={'name':{'type':Sequelize[_0x89c4('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x89c4('0x2')]},'notes':{'type':Sequelize[_0x89c4('0x3')]},'preproduction':{'type':Sequelize[_0x89c4('0x4')]('long'),'get':function(){if(this['getDataValue'](_0x89c4('0x5'))){return this[_0x89c4('0x6')]('preproduction')[_0x89c4('0x7')](_0x89c4('0x8'));}}},'production':{'type':Sequelize[_0x89c4('0x4')](_0x89c4('0x9')),'get':function(){if(this[_0x89c4('0x6')](_0x89c4('0xa'))){return this[_0x89c4('0x6')](_0x89c4('0xa'))[_0x89c4('0x7')](_0x89c4('0x8'));}}}};
\ No newline at end of file
+var _0x1561=['preproduction','utf8','long','production','STRING','name','TEXT','BLOB','getDataValue'];(function(_0x24dbc8,_0x28dc64){var _0x580133=function(_0x1f315e){while(--_0x1f315e){_0x24dbc8['push'](_0x24dbc8['shift']());}};_0x580133(++_0x28dc64);}(_0x1561,0x1bd));var _0x1156=function(_0x59f8fb,_0x5d77b4){_0x59f8fb=_0x59f8fb-0x0;var _0x497ff4=_0x1561[_0x59f8fb];return _0x497ff4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1156('0x0')],'unique':_0x1156('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x1156('0x0')]},'notes':{'type':Sequelize[_0x1156('0x2')]},'preproduction':{'type':Sequelize[_0x1156('0x3')]('long'),'get':function(){if(this[_0x1156('0x4')](_0x1156('0x5'))){return this[_0x1156('0x4')](_0x1156('0x5'))['toString'](_0x1156('0x6'));}}},'production':{'type':Sequelize['BLOB'](_0x1156('0x7')),'get':function(){if(this[_0x1156('0x4')](_0x1156('0x8'))){return this[_0x1156('0x4')](_0x1156('0x8'))['toString'](_0x1156('0x6'));}}}};
\ No newline at end of file
index d19a15e..3d7f9fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x398a=['query','intersection','attributes','fields','length','hasOwnProperty','order','filters','add','day','merge','filter','where','includeAll','findAll','rows','catch','params','include','find','create','body','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','sort','map','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','socket.io-emitter','localhost','./squareProject.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','name','send','index','SquareProject','rawAttributes','model','keys','dateStart','dateEnd'];(function(_0x214a03,_0x2e4061){var _0xda476a=function(_0x1c46b2){while(--_0x1c46b2){_0x214a03['push'](_0x214a03['shift']());}};_0xda476a(++_0x2e4061);}(_0x398a,0x11a));var _0xa398=function(_0x424831,_0x521247){_0x424831=_0x424831-0x0;var _0x356faa=_0x398a[_0x424831];return _0x356faa;};'use strict';var pdf=require(_0xa398('0x0'));var emlformat=require(_0xa398('0x1'));var rimraf=require(_0xa398('0x2'));var zipdir=require(_0xa398('0x3'));var jsonpatch=require(_0xa398('0x4'));var rp=require(_0xa398('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa398('0x6'));var path=require(_0xa398('0x7'));var sox=require(_0xa398('0x8'));var csv=require(_0xa398('0x9'));var ejs=require(_0xa398('0xa'));var fs=require('fs');var _=require(_0xa398('0xb'));var squel=require(_0xa398('0xc'));var crypto=require(_0xa398('0xd'));var jsforce=require(_0xa398('0xe'));var deskjs=require(_0xa398('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa398('0x10'));var Papa=require(_0xa398('0x11'));var qs=require(_0xa398('0x12'));var logger=require(_0xa398('0x13'))(_0xa398('0x14'));var utils=require(_0xa398('0x15'));var config=require(_0xa398('0x16'));var db=require('../../mysqldb')['db'];var socket=require(_0xa398('0x17'))({'host':_0xa398('0x18'),'port':0x18eb});require(_0xa398('0x19'))[_0xa398('0x1a')](socket);function respondWithStatusCode(_0xfb8694,_0x109865){_0x109865=_0x109865||0xcc;return function(_0x362ef4){if(_0x362ef4){return _0xfb8694[_0xa398('0x1b')](_0x109865);}return _0xfb8694['status'](_0x109865)[_0xa398('0x1c')]();};}function respondWithResult(_0x415065,_0x316587){_0x316587=_0x316587||0xc8;return function(_0x20b340){if(_0x20b340){return _0x415065[_0xa398('0x1d')](_0x316587)[_0xa398('0x1e')](_0x20b340);}};}function respondWithFilteredResult(_0x1e40db,_0x10bc43){return function(_0x483dbf){if(_0x483dbf){var _0x264419=_0x483dbf[_0xa398('0x1f')],_0x1788e5=_0x10bc43[_0xa398('0x20')],_0x4a66d3=_0x10bc43[_0xa398('0x20')]+_0x10bc43[_0xa398('0x21')],_0x568781;if(_0x4a66d3>=_0x264419){_0x4a66d3=_0x264419;_0x568781=0xc8;}else{_0x568781=0xce;}_0x1e40db[_0xa398('0x1d')](_0x568781);return _0x1e40db[_0xa398('0x22')](_0xa398('0x23'),_0x1788e5+'-'+_0x4a66d3+'/'+_0x264419)[_0xa398('0x1e')](_0x483dbf);}return null;};}function patchUpdates(_0xddf9e4){return function(_0x5b280c){try{jsonpatch[_0xa398('0x24')](_0x5b280c,_0xddf9e4,!![]);}catch(_0x47b12f){return BPromise['reject'](_0x47b12f);}return _0x5b280c['save']();};}function saveUpdates(_0x62bee8,_0x4e21bc){return function(_0x1a3f34){if(_0x1a3f34){return _0x1a3f34[_0xa398('0x25')](_0x62bee8)[_0xa398('0x26')](function(_0x13b3f8){return _0x13b3f8;});}return null;};}function removeEntity(_0x37203c,_0x54e08c){return function(_0x46ab19){if(_0x46ab19){return _0x46ab19[_0xa398('0x27')]()['then'](function(){_0x37203c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f6601,_0x11ebc7){return function(_0x1a2b9e){if(!_0x1a2b9e){_0x3f6601['sendStatus'](0x194);}return _0x1a2b9e;};}function handleError(_0x3e5d27,_0x104bfe){_0x104bfe=_0x104bfe||0x1f4;return function(_0x2da10f){logger[_0xa398('0x28')](_0x2da10f['stack']);if(_0x2da10f[_0xa398('0x29')]){delete _0x2da10f[_0xa398('0x29')];}_0x3e5d27[_0xa398('0x1d')](_0x104bfe)[_0xa398('0x2a')](_0x2da10f);};}exports[_0xa398('0x2b')]=function(_0x61ee2c,_0x3005fd){var _0x22f27a={},_0x498fb4={},_0x5b719e={'count':0x0,'rows':[]};var _0x361d7f=db[_0xa398('0x2c')][_0xa398('0x2d')];_0x498fb4[_0xa398('0x2e')]=_[_0xa398('0x2f')](_0x361d7f);var _0x4641e8={'dateStart':_0x61ee2c['query'][_0xa398('0x30')],'dateEnd':_0x61ee2c['query'][_0xa398('0x31')]};delete _0x61ee2c['query'][_0xa398('0x30')];delete _0x61ee2c[_0xa398('0x32')][_0xa398('0x31')];_0x498fb4[_0xa398('0x32')]=_[_0xa398('0x2f')](_0x61ee2c[_0xa398('0x32')]);_0x498fb4['filters']=_[_0xa398('0x33')](_0x498fb4[_0xa398('0x2e')],_0x498fb4[_0xa398('0x32')]);_0x22f27a[_0xa398('0x34')]=_[_0xa398('0x33')](_0x498fb4[_0xa398('0x2e')],qs[_0xa398('0x35')](_0x61ee2c['query'][_0xa398('0x35')]));_0x22f27a[_0xa398('0x34')]=_0x22f27a[_0xa398('0x34')][_0xa398('0x36')]?_0x22f27a['attributes']:_0x498fb4[_0xa398('0x2e')];if(!_0x61ee2c[_0xa398('0x32')][_0xa398('0x37')]('nolimit')){_0x22f27a[_0xa398('0x21')]=qs[_0xa398('0x21')](_0x61ee2c[_0xa398('0x32')][_0xa398('0x21')]);_0x22f27a[_0xa398('0x20')]=qs[_0xa398('0x20')](_0x61ee2c[_0xa398('0x32')]['offset']);}_0x22f27a[_0xa398('0x38')]=qs['sort'](_0x61ee2c[_0xa398('0x32')]['sort']);_0x22f27a['where']=qs['filters'](_['pick'](_0x61ee2c[_0xa398('0x32')],_0x498fb4[_0xa398('0x39')]));if(_0x4641e8[_0xa398('0x30')]){if(_0x4641e8[_0xa398('0x31')]){_0x4641e8[_0xa398('0x31')]=moment(_0x4641e8[_0xa398('0x31')])[_0xa398('0x3a')](0x1,_0xa398('0x3b'));}else{_0x4641e8['dateEnd']=moment(_0x4641e8[_0xa398('0x30')])[_0xa398('0x3a')](0x1,_0xa398('0x3b'));}_[_0xa398('0x3c')](_0x22f27a['where'],{'createdAt':{'$gte':_0x4641e8[_0xa398('0x30')],'$lte':_0x4641e8[_0xa398('0x31')]}});}if(_0x61ee2c['query'][_0xa398('0x3d')]){_0x22f27a[_0xa398('0x3e')]=_[_0xa398('0x3c')](_0x22f27a[_0xa398('0x3e')],{'$or':_['map'](_0x22f27a[_0xa398('0x34')],function(_0x65e4b7){var _0x306d51={};_0x306d51[_0x65e4b7]={'$like':'%'+_0x61ee2c['query'][_0xa398('0x3d')]+'%'};return _0x306d51;})});}_0x22f27a=_[_0xa398('0x3c')]({},_0x22f27a,_0x61ee2c['options']);var _0x11ab37={'where':_0x22f27a[_0xa398('0x3e')]};return db['SquareProject'][_0xa398('0x1f')](_0x11ab37)[_0xa398('0x26')](function(_0x31e4bb){_0x5b719e[_0xa398('0x1f')]=_0x31e4bb;if(_0x61ee2c[_0xa398('0x32')][_0xa398('0x3f')]){_0x22f27a['include']=[{'all':!![]}];}return db[_0xa398('0x2c')][_0xa398('0x40')](_0x22f27a);})[_0xa398('0x26')](function(_0x3f9e95){_0x5b719e[_0xa398('0x41')]=_0x3f9e95;return _0x5b719e;})[_0xa398('0x26')](respondWithFilteredResult(_0x3005fd,_0x22f27a))[_0xa398('0x42')](handleError(_0x3005fd,null));};exports['show']=function(_0x59cdfd,_0x3ff21b){var _0x241518={'raw':![],'where':{'id':_0x59cdfd[_0xa398('0x43')]['id']}},_0x29065a={};_0x29065a[_0xa398('0x2e')]=_[_0xa398('0x2f')](db['SquareProject']['rawAttributes']);_0x29065a[_0xa398('0x32')]=_['keys'](_0x59cdfd[_0xa398('0x32')]);_0x29065a['filters']=_[_0xa398('0x33')](_0x29065a[_0xa398('0x2e')],_0x29065a['query']);_0x241518[_0xa398('0x34')]=_[_0xa398('0x33')](_0x29065a[_0xa398('0x2e')],qs[_0xa398('0x35')](_0x59cdfd[_0xa398('0x32')][_0xa398('0x35')]));_0x241518['attributes']=_0x241518['attributes']['length']?_0x241518[_0xa398('0x34')]:_0x29065a[_0xa398('0x2e')];if(_0x59cdfd['query'][_0xa398('0x3f')]){_0x241518[_0xa398('0x44')]=[{'all':!![]}];}_0x241518=_[_0xa398('0x3c')]({},_0x241518,_0x59cdfd['options']);return db[_0xa398('0x2c')][_0xa398('0x45')](_0x241518)[_0xa398('0x26')](handleEntityNotFound(_0x3ff21b,null))['then'](respondWithResult(_0x3ff21b,null))['catch'](handleError(_0x3ff21b,null));};exports['create']=function(_0x3e7109,_0x530e9e){return db[_0xa398('0x2c')][_0xa398('0x46')](_0x3e7109[_0xa398('0x47')],{})[_0xa398('0x26')](respondWithResult(_0x530e9e,0xc9))['catch'](handleError(_0x530e9e,null));};exports[_0xa398('0x25')]=function(_0x443a14,_0x15b4a3){if(_0x443a14['body']['id']){delete _0x443a14['body']['id'];}return db['SquareProject'][_0xa398('0x45')]({'where':{'id':_0x443a14[_0xa398('0x43')]['id']}})['then'](handleEntityNotFound(_0x15b4a3,null))[_0xa398('0x26')](saveUpdates(_0x443a14['body'],null))[_0xa398('0x26')](respondWithResult(_0x15b4a3,null))[_0xa398('0x42')](handleError(_0x15b4a3,null));};exports[_0xa398('0x27')]=function(_0x4f47cc,_0x1bc740){return db['SquareProject'][_0xa398('0x45')]({'where':{'id':_0x4f47cc[_0xa398('0x43')]['id']}})[_0xa398('0x26')](handleEntityNotFound(_0x1bc740,null))[_0xa398('0x26')](removeEntity(_0x1bc740,null))['catch'](handleError(_0x1bc740,null));};exports['addUsers']=function(_0x5b4d46,_0x1df025,_0x4a1208){return db[_0xa398('0x2c')]['find']({'where':{'id':_0x5b4d46[_0xa398('0x43')]['id']}})[_0xa398('0x26')](handleEntityNotFound(_0x1df025,null))[_0xa398('0x26')](function(_0x381751){if(_0x381751){return _0x381751[_0xa398('0x48')](_0x5b4d46[_0xa398('0x47')][_0xa398('0x49')],_['omit'](_0x5b4d46[_0xa398('0x47')],['ids','id'])||{});}})[_0xa398('0x26')](respondWithResult(_0x1df025,null))[_0xa398('0x42')](handleError(_0x1df025,null));};exports[_0xa398('0x4a')]=function(_0x582a76,_0x11c242,_0x2dc5b8){var _0x2f6503;return db['SquareProject']['find']({'where':{'id':_0x582a76[_0xa398('0x43')]['id']}})[_0xa398('0x26')](handleEntityNotFound(_0x11c242,null))[_0xa398('0x26')](function(_0x4dc55b){if(_0x4dc55b){return _0x4dc55b[_0xa398('0x4a')](_0x582a76['query'][_0xa398('0x49')])[_0xa398('0x26')](function(_0x2df9d3){if(_[_0xa398('0x4b')](_0x582a76[_0xa398('0x32')]['ids'])){for(var _0x1ceb42=0x0;_0x1ceb42<_0x582a76[_0xa398('0x32')][_0xa398('0x49')][_0xa398('0x36')];_0x1ceb42+=0x1){socket[_0xa398('0x4c')](_0xa398('0x4d'),{'UserId':_0x582a76[_0xa398('0x32')][_0xa398('0x49')][_0x1ceb42],'SquareProjectId':_0x582a76['params']['id']});}}else{socket['emit'](_0xa398('0x4d'),{'UserId':_0x582a76[_0xa398('0x32')][_0xa398('0x49')],'SquareProjectId':_0x582a76['params']['id']});}});}})[_0xa398('0x26')](respondWithStatusCode(_0x11c242,null))[_0xa398('0x42')](handleError(_0x11c242,null));};exports[_0xa398('0x4e')]=function(_0x1e0b40,_0x2aac08,_0x39f87c){var _0x4f348b={};var _0x151386={};var _0x216309;var _0x5ee10f;return db[_0xa398('0x2c')]['findOne']({'where':{'id':_0x1e0b40[_0xa398('0x43')]['id']}})['then'](handleEntityNotFound(_0x2aac08,null))['then'](function(_0x4cb9a9){if(_0x4cb9a9){_0x216309=_0x4cb9a9;_0x151386[_0xa398('0x2e')]=_['keys'](db[_0xa398('0x4f')][_0xa398('0x2d')]);_0x151386[_0xa398('0x32')]=_[_0xa398('0x2f')](_0x1e0b40['query']);_0x151386[_0xa398('0x39')]=_[_0xa398('0x33')](_0x151386[_0xa398('0x2e')],_0x151386[_0xa398('0x32')]);_0x4f348b[_0xa398('0x34')]=_[_0xa398('0x33')](_0x151386[_0xa398('0x2e')],qs[_0xa398('0x35')](_0x1e0b40[_0xa398('0x32')]['fields']));_0x4f348b[_0xa398('0x34')]=_0x4f348b[_0xa398('0x34')][_0xa398('0x36')]?_0x4f348b[_0xa398('0x34')]:_0x151386[_0xa398('0x2e')];_0x4f348b[_0xa398('0x38')]=qs[_0xa398('0x50')](_0x1e0b40[_0xa398('0x32')]['sort']);_0x4f348b[_0xa398('0x3e')]=qs[_0xa398('0x39')](_['pick'](_0x1e0b40[_0xa398('0x32')],_0x151386[_0xa398('0x39')]));if(_0x1e0b40['query'][_0xa398('0x3d')]){_0x4f348b[_0xa398('0x3e')]=_[_0xa398('0x3c')](_0x4f348b['where'],{'$or':_[_0xa398('0x51')](_0x4f348b[_0xa398('0x34')],function(_0x5b2a40){var _0xb3195f={};_0xb3195f[_0x5b2a40]={'$like':'%'+_0x1e0b40[_0xa398('0x32')][_0xa398('0x3d')]+'%'};return _0xb3195f;})});}_0x4f348b=_[_0xa398('0x3c')]({},_0x4f348b,_0x1e0b40['options']);return _0x216309[_0xa398('0x4e')](_0x4f348b);}})[_0xa398('0x26')](function(_0x3baf8a){if(_0x3baf8a){_0x5ee10f=_0x3baf8a['length'];if(!_0x1e0b40[_0xa398('0x32')]['hasOwnProperty'](_0xa398('0x52'))){_0x4f348b['limit']=qs[_0xa398('0x21')](_0x1e0b40[_0xa398('0x32')]['limit']);_0x4f348b[_0xa398('0x20')]=qs['offset'](_0x1e0b40[_0xa398('0x32')][_0xa398('0x20')]);}return _0x216309['getUsers'](_0x4f348b);}})[_0xa398('0x26')](function(_0x101742){if(_0x101742){return _0x101742?{'count':_0x5ee10f,'rows':_0x101742}:null;}})[_0xa398('0x26')](respondWithResult(_0x2aac08,null))[_0xa398('0x42')](handleError(_0x2aac08,null));};
\ No newline at end of file
+var _0xbb3b=['catch','show','params','length','includeAll','find','create','body','addUsers','ids','omit','removeUsers','isArray','userSquareProject:remove','emit','User','pick','getUsers','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./squareProject.socket','register','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','then','end','error','name','index','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','add','day','merge','filter','where','options','SquareProject','include','rows'];(function(_0x2d31fc,_0x349d25){var _0x3daf2a=function(_0x5e75f6){while(--_0x5e75f6){_0x2d31fc['push'](_0x2d31fc['shift']());}};_0x3daf2a(++_0x349d25);}(_0xbb3b,0x1b6));var _0xbbb3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb3b[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbbb3('0x0'));var rimraf=require(_0xbbb3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbbb3('0x2'));var rp=require('request-promise');var moment=require(_0xbbb3('0x3'));var BPromise=require(_0xbbb3('0x4'));var Mustache=require(_0xbbb3('0x5'));var util=require('util');var path=require(_0xbbb3('0x6'));var sox=require(_0xbbb3('0x7'));var csv=require(_0xbbb3('0x8'));var ejs=require(_0xbbb3('0x9'));var fs=require('fs');var _=require(_0xbbb3('0xa'));var squel=require(_0xbbb3('0xb'));var crypto=require(_0xbbb3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbbb3('0xd'));var toCsv=require(_0xbbb3('0x8'));var querystring=require(_0xbbb3('0xe'));var Papa=require(_0xbbb3('0xf'));var qs=require(_0xbbb3('0x10'));var logger=require(_0xbbb3('0x11'))(_0xbbb3('0x12'));var utils=require(_0xbbb3('0x13'));var config=require(_0xbbb3('0x14'));var db=require(_0xbbb3('0x15'))['db'];var socket=require(_0xbbb3('0x16'))({'host':_0xbbb3('0x17'),'port':0x18eb});require(_0xbbb3('0x18'))[_0xbbb3('0x19')](socket);function respondWithStatusCode(_0x42397e,_0x2686d9){_0x2686d9=_0x2686d9||0xcc;return function(_0x320e6c){if(_0x320e6c){return _0x42397e[_0xbbb3('0x1a')](_0x2686d9);}return _0x42397e['status'](_0x2686d9)['end']();};}function respondWithResult(_0x56b566,_0x2a43aa){_0x2a43aa=_0x2a43aa||0xc8;return function(_0x43f42f){if(_0x43f42f){return _0x56b566[_0xbbb3('0x1b')](_0x2a43aa)['json'](_0x43f42f);}};}function respondWithFilteredResult(_0x32f36a,_0x59a6e6){return function(_0x186051){if(_0x186051){var _0x496ada=_0x186051[_0xbbb3('0x1c')],_0x525b94=_0x59a6e6[_0xbbb3('0x1d')],_0xe0e853=_0x59a6e6[_0xbbb3('0x1d')]+_0x59a6e6[_0xbbb3('0x1e')],_0x15eec1;if(_0xe0e853>=_0x496ada){_0xe0e853=_0x496ada;_0x15eec1=0xc8;}else{_0x15eec1=0xce;}_0x32f36a['status'](_0x15eec1);return _0x32f36a[_0xbbb3('0x1f')](_0xbbb3('0x20'),_0x525b94+'-'+_0xe0e853+'/'+_0x496ada)[_0xbbb3('0x21')](_0x186051);}return null;};}function patchUpdates(_0xed9e96){return function(_0x2adfad){try{jsonpatch[_0xbbb3('0x22')](_0x2adfad,_0xed9e96,!![]);}catch(_0x5c6561){return BPromise[_0xbbb3('0x23')](_0x5c6561);}return _0x2adfad['save']();};}function saveUpdates(_0x1c7ead,_0x5216f4){return function(_0x32477e){if(_0x32477e){return _0x32477e[_0xbbb3('0x24')](_0x1c7ead)['then'](function(_0x5597b5){return _0x5597b5;});}return null;};}function removeEntity(_0x40adb9,_0x327558){return function(_0x17a6c2){if(_0x17a6c2){return _0x17a6c2[_0xbbb3('0x25')]()[_0xbbb3('0x26')](function(){_0x40adb9['status'](0xcc)[_0xbbb3('0x27')]();});}};}function handleEntityNotFound(_0x2f64ee,_0x18d803){return function(_0x2569ef){if(!_0x2569ef){_0x2f64ee['sendStatus'](0x194);}return _0x2569ef;};}function handleError(_0x315982,_0x914d5){_0x914d5=_0x914d5||0x1f4;return function(_0xd04874){logger[_0xbbb3('0x28')](_0xd04874['stack']);if(_0xd04874['name']){delete _0xd04874[_0xbbb3('0x29')];}_0x315982[_0xbbb3('0x1b')](_0x914d5)['send'](_0xd04874);};}exports[_0xbbb3('0x2a')]=function(_0x1d2e3a,_0x3fdc27){var _0x6c967d={},_0x377d47={},_0x16cc34={'count':0x0,'rows':[]};var _0x117bdf=db['SquareProject'][_0xbbb3('0x2b')];_0x377d47[_0xbbb3('0x2c')]=_[_0xbbb3('0x2d')](_0x117bdf);var _0x446153={'dateStart':_0x1d2e3a[_0xbbb3('0x2e')][_0xbbb3('0x2f')],'dateEnd':_0x1d2e3a['query']['dateEnd']};delete _0x1d2e3a['query'][_0xbbb3('0x2f')];delete _0x1d2e3a[_0xbbb3('0x2e')][_0xbbb3('0x30')];_0x377d47[_0xbbb3('0x2e')]=_['keys'](_0x1d2e3a[_0xbbb3('0x2e')]);_0x377d47[_0xbbb3('0x31')]=_[_0xbbb3('0x32')](_0x377d47[_0xbbb3('0x2c')],_0x377d47['query']);_0x6c967d[_0xbbb3('0x33')]=_[_0xbbb3('0x32')](_0x377d47[_0xbbb3('0x2c')],qs[_0xbbb3('0x34')](_0x1d2e3a[_0xbbb3('0x2e')]['fields']));_0x6c967d[_0xbbb3('0x33')]=_0x6c967d[_0xbbb3('0x33')]['length']?_0x6c967d['attributes']:_0x377d47[_0xbbb3('0x2c')];if(!_0x1d2e3a[_0xbbb3('0x2e')][_0xbbb3('0x35')](_0xbbb3('0x36'))){_0x6c967d['limit']=qs[_0xbbb3('0x1e')](_0x1d2e3a[_0xbbb3('0x2e')]['limit']);_0x6c967d[_0xbbb3('0x1d')]=qs[_0xbbb3('0x1d')](_0x1d2e3a['query']['offset']);}_0x6c967d[_0xbbb3('0x37')]=qs[_0xbbb3('0x38')](_0x1d2e3a['query']['sort']);_0x6c967d['where']=qs['filters'](_['pick'](_0x1d2e3a['query'],_0x377d47[_0xbbb3('0x31')]));if(_0x446153[_0xbbb3('0x2f')]){if(_0x446153[_0xbbb3('0x30')]){_0x446153[_0xbbb3('0x30')]=moment(_0x446153[_0xbbb3('0x30')])[_0xbbb3('0x39')](0x1,_0xbbb3('0x3a'));}else{_0x446153[_0xbbb3('0x30')]=moment(_0x446153[_0xbbb3('0x2f')])[_0xbbb3('0x39')](0x1,_0xbbb3('0x3a'));}_[_0xbbb3('0x3b')](_0x6c967d['where'],{'createdAt':{'$gte':_0x446153[_0xbbb3('0x2f')],'$lte':_0x446153['dateEnd']}});}if(_0x1d2e3a[_0xbbb3('0x2e')][_0xbbb3('0x3c')]){_0x6c967d[_0xbbb3('0x3d')]=_[_0xbbb3('0x3b')](_0x6c967d['where'],{'$or':_['map'](_0x6c967d[_0xbbb3('0x33')],function(_0x589457){var _0x465d1b={};_0x465d1b[_0x589457]={'$like':'%'+_0x1d2e3a['query'][_0xbbb3('0x3c')]+'%'};return _0x465d1b;})});}_0x6c967d=_[_0xbbb3('0x3b')]({},_0x6c967d,_0x1d2e3a[_0xbbb3('0x3e')]);var _0x576722={'where':_0x6c967d['where']};return db[_0xbbb3('0x3f')][_0xbbb3('0x1c')](_0x576722)['then'](function(_0x2d12b0){_0x16cc34[_0xbbb3('0x1c')]=_0x2d12b0;if(_0x1d2e3a[_0xbbb3('0x2e')]['includeAll']){_0x6c967d[_0xbbb3('0x40')]=[{'all':!![]}];}return db[_0xbbb3('0x3f')]['findAll'](_0x6c967d);})[_0xbbb3('0x26')](function(_0x15176e){_0x16cc34[_0xbbb3('0x41')]=_0x15176e;return _0x16cc34;})['then'](respondWithFilteredResult(_0x3fdc27,_0x6c967d))[_0xbbb3('0x42')](handleError(_0x3fdc27,null));};exports[_0xbbb3('0x43')]=function(_0x3ce69b,_0x24180){var _0x5c36d3={'raw':![],'where':{'id':_0x3ce69b[_0xbbb3('0x44')]['id']}},_0x1b4351={};_0x1b4351[_0xbbb3('0x2c')]=_[_0xbbb3('0x2d')](db[_0xbbb3('0x3f')]['rawAttributes']);_0x1b4351[_0xbbb3('0x2e')]=_[_0xbbb3('0x2d')](_0x3ce69b[_0xbbb3('0x2e')]);_0x1b4351[_0xbbb3('0x31')]=_[_0xbbb3('0x32')](_0x1b4351[_0xbbb3('0x2c')],_0x1b4351[_0xbbb3('0x2e')]);_0x5c36d3[_0xbbb3('0x33')]=_[_0xbbb3('0x32')](_0x1b4351['model'],qs[_0xbbb3('0x34')](_0x3ce69b['query'][_0xbbb3('0x34')]));_0x5c36d3['attributes']=_0x5c36d3['attributes'][_0xbbb3('0x45')]?_0x5c36d3[_0xbbb3('0x33')]:_0x1b4351[_0xbbb3('0x2c')];if(_0x3ce69b[_0xbbb3('0x2e')][_0xbbb3('0x46')]){_0x5c36d3[_0xbbb3('0x40')]=[{'all':!![]}];}_0x5c36d3=_[_0xbbb3('0x3b')]({},_0x5c36d3,_0x3ce69b[_0xbbb3('0x3e')]);return db['SquareProject'][_0xbbb3('0x47')](_0x5c36d3)[_0xbbb3('0x26')](handleEntityNotFound(_0x24180,null))[_0xbbb3('0x26')](respondWithResult(_0x24180,null))[_0xbbb3('0x42')](handleError(_0x24180,null));};exports[_0xbbb3('0x48')]=function(_0x5221dc,_0x17c7b4){return db[_0xbbb3('0x3f')][_0xbbb3('0x48')](_0x5221dc[_0xbbb3('0x49')],{})[_0xbbb3('0x26')](respondWithResult(_0x17c7b4,0xc9))[_0xbbb3('0x42')](handleError(_0x17c7b4,null));};exports[_0xbbb3('0x24')]=function(_0x48119c,_0x461f46){if(_0x48119c['body']['id']){delete _0x48119c[_0xbbb3('0x49')]['id'];}return db[_0xbbb3('0x3f')]['find']({'where':{'id':_0x48119c[_0xbbb3('0x44')]['id']}})[_0xbbb3('0x26')](handleEntityNotFound(_0x461f46,null))[_0xbbb3('0x26')](saveUpdates(_0x48119c[_0xbbb3('0x49')],null))[_0xbbb3('0x26')](respondWithResult(_0x461f46,null))[_0xbbb3('0x42')](handleError(_0x461f46,null));};exports['destroy']=function(_0x571947,_0x45a393){return db[_0xbbb3('0x3f')][_0xbbb3('0x47')]({'where':{'id':_0x571947['params']['id']}})['then'](handleEntityNotFound(_0x45a393,null))[_0xbbb3('0x26')](removeEntity(_0x45a393,null))['catch'](handleError(_0x45a393,null));};exports[_0xbbb3('0x4a')]=function(_0x8d3b80,_0x4d6007,_0x23cd87){return db[_0xbbb3('0x3f')][_0xbbb3('0x47')]({'where':{'id':_0x8d3b80[_0xbbb3('0x44')]['id']}})[_0xbbb3('0x26')](handleEntityNotFound(_0x4d6007,null))[_0xbbb3('0x26')](function(_0x438c73){if(_0x438c73){return _0x438c73[_0xbbb3('0x4a')](_0x8d3b80['body'][_0xbbb3('0x4b')],_[_0xbbb3('0x4c')](_0x8d3b80[_0xbbb3('0x49')],[_0xbbb3('0x4b'),'id'])||{});}})[_0xbbb3('0x26')](respondWithResult(_0x4d6007,null))['catch'](handleError(_0x4d6007,null));};exports[_0xbbb3('0x4d')]=function(_0x389c83,_0x49509a,_0x12051b){var _0x424c45;return db[_0xbbb3('0x3f')][_0xbbb3('0x47')]({'where':{'id':_0x389c83[_0xbbb3('0x44')]['id']}})[_0xbbb3('0x26')](handleEntityNotFound(_0x49509a,null))[_0xbbb3('0x26')](function(_0xdb20ed){if(_0xdb20ed){return _0xdb20ed[_0xbbb3('0x4d')](_0x389c83[_0xbbb3('0x2e')][_0xbbb3('0x4b')])[_0xbbb3('0x26')](function(_0x1dad5f){if(_[_0xbbb3('0x4e')](_0x389c83[_0xbbb3('0x2e')]['ids'])){for(var _0x1643db=0x0;_0x1643db<_0x389c83[_0xbbb3('0x2e')]['ids'][_0xbbb3('0x45')];_0x1643db+=0x1){socket['emit'](_0xbbb3('0x4f'),{'UserId':_0x389c83['query'][_0xbbb3('0x4b')][_0x1643db],'SquareProjectId':_0x389c83[_0xbbb3('0x44')]['id']});}}else{socket[_0xbbb3('0x50')]('userSquareProject:remove',{'UserId':_0x389c83['query'][_0xbbb3('0x4b')],'SquareProjectId':_0x389c83[_0xbbb3('0x44')]['id']});}});}})[_0xbbb3('0x26')](respondWithStatusCode(_0x49509a,null))[_0xbbb3('0x42')](handleError(_0x49509a,null));};exports['getUsers']=function(_0x4b31d7,_0xd8f9c5,_0x220730){var _0x43cd4f={};var _0x5ea5e2={};var _0x591313;var _0xd26021;return db[_0xbbb3('0x3f')]['findOne']({'where':{'id':_0x4b31d7[_0xbbb3('0x44')]['id']}})['then'](handleEntityNotFound(_0xd8f9c5,null))[_0xbbb3('0x26')](function(_0x3cac6a){if(_0x3cac6a){_0x591313=_0x3cac6a;_0x5ea5e2['model']=_['keys'](db[_0xbbb3('0x51')][_0xbbb3('0x2b')]);_0x5ea5e2[_0xbbb3('0x2e')]=_[_0xbbb3('0x2d')](_0x4b31d7[_0xbbb3('0x2e')]);_0x5ea5e2['filters']=_[_0xbbb3('0x32')](_0x5ea5e2[_0xbbb3('0x2c')],_0x5ea5e2[_0xbbb3('0x2e')]);_0x43cd4f[_0xbbb3('0x33')]=_['intersection'](_0x5ea5e2[_0xbbb3('0x2c')],qs[_0xbbb3('0x34')](_0x4b31d7[_0xbbb3('0x2e')][_0xbbb3('0x34')]));_0x43cd4f['attributes']=_0x43cd4f[_0xbbb3('0x33')][_0xbbb3('0x45')]?_0x43cd4f[_0xbbb3('0x33')]:_0x5ea5e2['model'];_0x43cd4f[_0xbbb3('0x37')]=qs[_0xbbb3('0x38')](_0x4b31d7[_0xbbb3('0x2e')][_0xbbb3('0x38')]);_0x43cd4f[_0xbbb3('0x3d')]=qs[_0xbbb3('0x31')](_[_0xbbb3('0x52')](_0x4b31d7[_0xbbb3('0x2e')],_0x5ea5e2[_0xbbb3('0x31')]));if(_0x4b31d7[_0xbbb3('0x2e')][_0xbbb3('0x3c')]){_0x43cd4f[_0xbbb3('0x3d')]=_[_0xbbb3('0x3b')](_0x43cd4f[_0xbbb3('0x3d')],{'$or':_['map'](_0x43cd4f[_0xbbb3('0x33')],function(_0x41b327){var _0x1610ac={};_0x1610ac[_0x41b327]={'$like':'%'+_0x4b31d7['query'][_0xbbb3('0x3c')]+'%'};return _0x1610ac;})});}_0x43cd4f=_[_0xbbb3('0x3b')]({},_0x43cd4f,_0x4b31d7['options']);return _0x591313['getUsers'](_0x43cd4f);}})['then'](function(_0x46810e){if(_0x46810e){_0xd26021=_0x46810e[_0xbbb3('0x45')];if(!_0x4b31d7[_0xbbb3('0x2e')][_0xbbb3('0x35')](_0xbbb3('0x36'))){_0x43cd4f[_0xbbb3('0x1e')]=qs[_0xbbb3('0x1e')](_0x4b31d7['query'][_0xbbb3('0x1e')]);_0x43cd4f[_0xbbb3('0x1d')]=qs[_0xbbb3('0x1d')](_0x4b31d7[_0xbbb3('0x2e')]['offset']);}return _0x591313[_0xbbb3('0x53')](_0x43cd4f);}})['then'](function(_0x5b1431){if(_0x5b1431){return _0x5b1431?{'count':_0xd26021,'rows':_0x5b1431}:null;}})[_0xbbb3('0x26')](respondWithResult(_0xd8f9c5,null))['catch'](handleError(_0xd8f9c5,null));};
\ No newline at end of file
index f00b9fb..0a6905d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbee0=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x3080a9,_0x6f5f7){var _0x5af8b9=function(_0x35b4bd){while(--_0x35b4bd){_0x3080a9['push'](_0x3080a9['shift']());}};_0x5af8b9(++_0x6f5f7);}(_0xbee0,0x147));var _0x0bee=function(_0x16c23e,_0xe9d78d){_0x16c23e=_0x16c23e-0x0;var _0x4e0b52=_0xbee0[_0x16c23e];return _0x4e0b52;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x0bee('0x0'))['db'][_0x0bee('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x0bee('0x2')](0x0);var events={'afterCreate':_0x0bee('0x3'),'afterUpdate':_0x0bee('0x4'),'afterDestroy':_0x0bee('0x5')};function emitEvent(_0x35f8f6){return function(_0xaed51f,_0x4ac5c8,_0x57973b){SquareProjectEvents['emit'](_0x35f8f6+':'+_0xaed51f['id'],_0xaed51f);SquareProjectEvents[_0x0bee('0x6')](_0x35f8f6,_0xaed51f);_0x57973b(null);};}for(var e in events){if(events[_0x0bee('0x7')](e)){var event=events[e];SquareProject[_0x0bee('0x8')](e,emitEvent(event));}}module[_0x0bee('0x9')]=SquareProjectEvents;
\ No newline at end of file
+var _0xba44=['save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','SquareProject','setMaxListeners'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0xba44,0x189));var _0x4ba4=function(_0x2e7938,_0x5a956f){_0x2e7938=_0x2e7938-0x0;var _0x55bdbc=_0xba44[_0x2e7938];return _0x55bdbc;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x4ba4('0x0'))['db'][_0x4ba4('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x4ba4('0x2')](0x0);var events={'afterCreate':_0x4ba4('0x3'),'afterUpdate':_0x4ba4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4c9d67){return function(_0x1aceeb,_0x436658,_0x1c5ee8){SquareProjectEvents['emit'](_0x4c9d67+':'+_0x1aceeb['id'],_0x1aceeb);SquareProjectEvents[_0x4ba4('0x5')](_0x4c9d67,_0x1aceeb);_0x1c5ee8(null);};}for(var e in events){if(events[_0x4ba4('0x6')](e)){var event=events[e];SquareProject[_0x4ba4('0x7')](e,emitEvent(event));}}module[_0x4ba4('0x8')]=SquareProjectEvents;
\ No newline at end of file
index 49f9841..e05fcc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf87c=['SquareProject','square_projects','lodash','util','../../config/logger','bluebird','request-promise','./squareProject.attributes','exports'];(function(_0x17b1be,_0x64d1ea){var _0x103153=function(_0x128882){while(--_0x128882){_0x17b1be['push'](_0x17b1be['shift']());}};_0x103153(++_0x64d1ea);}(_0xf87c,0xd1));var _0xcf87=function(_0x1aba25,_0x1faed1){_0x1aba25=_0x1aba25-0x0;var _0x47d997=_0xf87c[_0x1aba25];return _0x47d997;};'use strict';var _=require(_0xcf87('0x0'));var util=require(_0xcf87('0x1'));var logger=require(_0xcf87('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcf87('0x3'));var rp=require(_0xcf87('0x4'));var attributes=require(_0xcf87('0x5'));module[_0xcf87('0x6')]=function(_0x68c690,_0x11161a){return _0x68c690['define'](_0xcf87('0x7'),attributes,{'tableName':_0xcf87('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeb53=['../../config/logger','moment','bluebird','request-promise','./squareProject.attributes','exports','define','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xeb53,0x1a7));var _0x3eb5=function(_0x4bfebe,_0x255709){_0x4bfebe=_0x4bfebe-0x0;var _0x41ec37=_0xeb53[_0x4bfebe];return _0x41ec37;};'use strict';var _=require('lodash');var util=require(_0x3eb5('0x0'));var logger=require(_0x3eb5('0x1'))('api');var moment=require(_0x3eb5('0x2'));var BPromise=require(_0x3eb5('0x3'));var rp=require(_0x3eb5('0x4'));var attributes=require(_0x3eb5('0x5'));module[_0x3eb5('0x6')]=function(_0x427ee8,_0x2213fc){return _0x427ee8[_0x3eb5('0x7')]('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 684478d..18d5dcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb01=['register','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','ShowSquareProject','options','raw','attributes','include','map','model','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter','localhost','./squareProject.socket'];(function(_0x5094fa,_0x4b01fc){var _0x489801=function(_0x98ca90){while(--_0x98ca90){_0x5094fa['push'](_0x5094fa['shift']());}};_0x489801(++_0x4b01fc);}(_0xcb01,0x72));var _0x1cb0=function(_0x3a71c7,_0x48599b){_0x3a71c7=_0x3a71c7-0x0;var _0xc8ff43=_0xcb01[_0x3a71c7];return _0xc8ff43;};'use strict';var _=require(_0x1cb0('0x0'));var util=require(_0x1cb0('0x1'));var moment=require(_0x1cb0('0x2'));var BPromise=require(_0x1cb0('0x3'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x1cb0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1cb0('0x5'))(_0x1cb0('0x6'));var config=require(_0x1cb0('0x7'));var jayson=require(_0x1cb0('0x8'));var client=jayson[_0x1cb0('0x9')][_0x1cb0('0xa')]({'port':0x232a});var socket=require(_0x1cb0('0xb'))({'host':_0x1cb0('0xc'),'port':0x18eb});require(_0x1cb0('0xd'))[_0x1cb0('0xe')](socket);function respondWithRpcPromise(_0x55d4c1,_0xb43886,_0x103c61){return new BPromise(function(_0x51ef78,_0x21b0ff){return client['request'](_0x55d4c1,_0x103c61)[_0x1cb0('0xf')](function(_0x3a6ece){logger[_0x1cb0('0x10')](_0x1cb0('0x11'),_0xb43886,_0x1cb0('0x12'));logger[_0x1cb0('0x13')]('SquareProject,\x20%s,\x20%s,\x20%s',_0xb43886,_0x1cb0('0x12'),JSON[_0x1cb0('0x14')](_0x3a6ece));if(_0x3a6ece['error']){if(_0x3a6ece['error'][_0x1cb0('0x15')]===0x1f4){logger[_0x1cb0('0x16')](_0x1cb0('0x11'),_0xb43886,_0x3a6ece[_0x1cb0('0x16')][_0x1cb0('0x17')]);return _0x21b0ff(_0x3a6ece[_0x1cb0('0x16')][_0x1cb0('0x17')]);}logger['error'](_0x1cb0('0x11'),_0xb43886,_0x3a6ece[_0x1cb0('0x16')]['message']);return _0x51ef78(_0x3a6ece['error']['message']);}else{logger[_0x1cb0('0x10')](_0x1cb0('0x11'),_0xb43886,_0x1cb0('0x12'));_0x51ef78(_0x3a6ece['result']['message']);}})['catch'](function(_0x5f08c3){logger[_0x1cb0('0x16')]('SquareProject,\x20%s,\x20%s',_0xb43886,_0x5f08c3);_0x21b0ff(_0x5f08c3);});});}exports[_0x1cb0('0x18')]=function(_0x5b9641){var _0x878f74=this;return new Promise(function(_0x6bea5d,_0x17d6de){return db['SquareProject']['find']({'raw':_0x5b9641[_0x1cb0('0x19')]?_0x5b9641[_0x1cb0('0x19')][_0x1cb0('0x1a')]===undefined?!![]:![]:!![],'where':_0x5b9641['options']?_0x5b9641[_0x1cb0('0x19')]['where']||null:null,'attributes':_0x5b9641[_0x1cb0('0x19')]?_0x5b9641[_0x1cb0('0x19')][_0x1cb0('0x1b')]||null:null,'include':_0x5b9641['options']?_0x5b9641[_0x1cb0('0x19')][_0x1cb0('0x1c')]?_[_0x1cb0('0x1d')](_0x5b9641[_0x1cb0('0x19')][_0x1cb0('0x1c')],function(_0x12ce27){return{'model':db[_0x12ce27['model']],'as':_0x12ce27['as'],'attributes':_0x12ce27[_0x1cb0('0x1b')],'include':_0x12ce27[_0x1cb0('0x1c')]?_[_0x1cb0('0x1d')](_0x12ce27[_0x1cb0('0x1c')],function(_0x3ea99f){return{'model':db[_0x3ea99f[_0x1cb0('0x1e')]],'as':_0x3ea99f['as'],'attributes':_0x3ea99f[_0x1cb0('0x1b')],'include':_0x3ea99f[_0x1cb0('0x1c')]?_['map'](_0x3ea99f['include'],function(_0x575596){return{'model':db[_0x575596['model']],'as':_0x575596['as'],'attributes':_0x575596[_0x1cb0('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25cc18){logger[_0x1cb0('0x10')]('ShowSquareProject',_0x5b9641);logger[_0x1cb0('0x13')]('ShowSquareProject',_0x5b9641,JSON['stringify'](_0x25cc18));_0x6bea5d(_0x25cc18);})[_0x1cb0('0x1f')](function(_0x57ca96){logger[_0x1cb0('0x16')](_0x1cb0('0x18'),_0x57ca96[_0x1cb0('0x17')],_0x5b9641);_0x17d6de(_0x878f74[_0x1cb0('0x16')](0x1f4,_0x57ca96[_0x1cb0('0x17')]));});});};
\ No newline at end of file
+var _0x09c5=['request\x20sent','stringify','error','code','SquareProject,\x20%s,\x20%s','message','result','SquareProject','find','options','raw','attributes','include','map','model','ShowSquareProject','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','localhost','./squareProject.socket','request','then','info','debug','SquareProject,\x20%s,\x20%s,\x20%s'];(function(_0x255091,_0x109e99){var _0x3f6e10=function(_0x4c9d37){while(--_0x4c9d37){_0x255091['push'](_0x255091['shift']());}};_0x3f6e10(++_0x109e99);}(_0x09c5,0xca));var _0x509c=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x09c5[_0x5a9c0c];return _0x53c77d;};'use strict';var _=require(_0x509c('0x0'));var util=require(_0x509c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x509c('0x2'));var fs=require('fs');var db=require(_0x509c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x509c('0x4'))(_0x509c('0x5'));var config=require(_0x509c('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x509c('0x7')]({'port':0x232a});var socket=require('socket.io-emitter')({'host':_0x509c('0x8'),'port':0x18eb});require(_0x509c('0x9'))['register'](socket);function respondWithRpcPromise(_0x5332a2,_0x3eaaa2,_0x2ec509){return new BPromise(function(_0x51fcb6,_0x1c4891){return client[_0x509c('0xa')](_0x5332a2,_0x2ec509)[_0x509c('0xb')](function(_0xeb9f15){logger[_0x509c('0xc')]('SquareProject,\x20%s,\x20%s',_0x3eaaa2,'request\x20sent');logger[_0x509c('0xd')](_0x509c('0xe'),_0x3eaaa2,_0x509c('0xf'),JSON[_0x509c('0x10')](_0xeb9f15));if(_0xeb9f15[_0x509c('0x11')]){if(_0xeb9f15['error'][_0x509c('0x12')]===0x1f4){logger[_0x509c('0x11')](_0x509c('0x13'),_0x3eaaa2,_0xeb9f15[_0x509c('0x11')]['message']);return _0x1c4891(_0xeb9f15['error']['message']);}logger[_0x509c('0x11')]('SquareProject,\x20%s,\x20%s',_0x3eaaa2,_0xeb9f15[_0x509c('0x11')][_0x509c('0x14')]);return _0x51fcb6(_0xeb9f15[_0x509c('0x11')]['message']);}else{logger[_0x509c('0xc')](_0x509c('0x13'),_0x3eaaa2,_0x509c('0xf'));_0x51fcb6(_0xeb9f15[_0x509c('0x15')]['message']);}})['catch'](function(_0x43da7e){logger[_0x509c('0x11')](_0x509c('0x13'),_0x3eaaa2,_0x43da7e);_0x1c4891(_0x43da7e);});});}exports['ShowSquareProject']=function(_0xc35569){var _0x5cd05f=this;return new Promise(function(_0x1b0502,_0x418b9d){return db[_0x509c('0x16')][_0x509c('0x17')]({'raw':_0xc35569[_0x509c('0x18')]?_0xc35569[_0x509c('0x18')][_0x509c('0x19')]===undefined?!![]:![]:!![],'where':_0xc35569[_0x509c('0x18')]?_0xc35569[_0x509c('0x18')]['where']||null:null,'attributes':_0xc35569[_0x509c('0x18')]?_0xc35569[_0x509c('0x18')][_0x509c('0x1a')]||null:null,'include':_0xc35569[_0x509c('0x18')]?_0xc35569[_0x509c('0x18')][_0x509c('0x1b')]?_[_0x509c('0x1c')](_0xc35569[_0x509c('0x18')][_0x509c('0x1b')],function(_0x179a22){return{'model':db[_0x179a22[_0x509c('0x1d')]],'as':_0x179a22['as'],'attributes':_0x179a22[_0x509c('0x1a')],'include':_0x179a22[_0x509c('0x1b')]?_[_0x509c('0x1c')](_0x179a22['include'],function(_0x1ef1a2){return{'model':db[_0x1ef1a2['model']],'as':_0x1ef1a2['as'],'attributes':_0x1ef1a2[_0x509c('0x1a')],'include':_0x1ef1a2[_0x509c('0x1b')]?_[_0x509c('0x1c')](_0x1ef1a2[_0x509c('0x1b')],function(_0x18aa49){return{'model':db[_0x18aa49[_0x509c('0x1d')]],'as':_0x18aa49['as'],'attributes':_0x18aa49[_0x509c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x509c('0xb')](function(_0x3aae04){logger[_0x509c('0xc')](_0x509c('0x1e'),_0xc35569);logger[_0x509c('0xd')](_0x509c('0x1e'),_0xc35569,JSON[_0x509c('0x10')](_0x3aae04));_0x1b0502(_0x3aae04);})['catch'](function(_0x1aae01){logger[_0x509c('0x11')](_0x509c('0x1e'),_0x1aae01[_0x509c('0x14')],_0xc35569);_0x418b9d(_0x5cd05f['error'](0x1f4,_0x1aae01[_0x509c('0x14')]));});});};
\ No newline at end of file
index 045ace9..d6389c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe829=['removeListener','length','squareProject:','./squareProject.events','save','remove','emit'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xe829,0x1d8));var _0x9e82=function(_0x732d54,_0x5708f4){_0x732d54=_0x732d54-0x0;var _0x55e766=_0xe829[_0x732d54];return _0x55e766;};'use strict';var SquareProjectEvents=require(_0x9e82('0x0'));var events=[_0x9e82('0x1'),_0x9e82('0x2'),'update'];function createListener(_0x559076,_0xf56525){return function(_0x337730){_0xf56525[_0x9e82('0x3')](_0x559076,_0x337730);};}function removeListener(_0x168d3e,_0x31591a){return function(){SquareProjectEvents[_0x9e82('0x4')](_0x168d3e,_0x31591a);};}exports['register']=function(_0x392df9){for(var _0x2338e7=0x0,_0x1a63b3=events[_0x9e82('0x5')];_0x2338e7<_0x1a63b3;_0x2338e7++){var _0x2d91ba=events[_0x2338e7];var _0x5c4c57=createListener(_0x9e82('0x6')+_0x2d91ba,_0x392df9);SquareProjectEvents['on'](_0x2d91ba,_0x5c4c57);}};
\ No newline at end of file
+var _0x7aaf=['squareProject:','./squareProject.events','remove','update','removeListener','register','length'];(function(_0x1bb9d7,_0x52db55){var _0x316cc9=function(_0x4a6b24){while(--_0x4a6b24){_0x1bb9d7['push'](_0x1bb9d7['shift']());}};_0x316cc9(++_0x52db55);}(_0x7aaf,0x1eb));var _0xf7aa=function(_0x4ef954,_0x4a6fc4){_0x4ef954=_0x4ef954-0x0;var _0x3ba5cf=_0x7aaf[_0x4ef954];return _0x3ba5cf;};'use strict';var SquareProjectEvents=require(_0xf7aa('0x0'));var events=['save',_0xf7aa('0x1'),_0xf7aa('0x2')];function createListener(_0x551bfb,_0x4b942e){return function(_0x35575f){_0x4b942e['emit'](_0x551bfb,_0x35575f);};}function removeListener(_0x198d5c,_0x5ee53a){return function(){SquareProjectEvents[_0xf7aa('0x3')](_0x198d5c,_0x5ee53a);};}exports[_0xf7aa('0x4')]=function(_0x1babcd){for(var _0xf02ed5=0x0,_0x47f259=events[_0xf7aa('0x5')];_0xf02ed5<_0x47f259;_0xf02ed5++){var _0x5d0495=events[_0xf02ed5];var _0x598c54=createListener(_0xf7aa('0x6')+_0x5d0495,_0x1babcd);SquareProjectEvents['on'](_0x5d0495,_0x598c54);}};
\ No newline at end of file
index 55a277a..6ec83a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabc1=['create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0xabc1,0x194));var _0x1abc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xabc1[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x1abc('0x0'));var util=require(_0x1abc('0x1'));var path=require(_0x1abc('0x2'));var express=require(_0x1abc('0x3'));var router=express[_0x1abc('0x4')]();var auth=require(_0x1abc('0x5'));var interaction=require(_0x1abc('0x6'));var config=require(_0x1abc('0x7'));var controller=require('./squareRecording.controller');router[_0x1abc('0x8')]('/',auth[_0x1abc('0x9')](),controller[_0x1abc('0xa')]);router[_0x1abc('0x8')](_0x1abc('0xb'),auth[_0x1abc('0x9')](),controller['show']);router[_0x1abc('0x8')](_0x1abc('0xc'),auth['isAuthenticated'](),controller[_0x1abc('0xd')]);router['post']('/',auth[_0x1abc('0x9')](),controller[_0x1abc('0xe')]);router[_0x1abc('0xf')](_0x1abc('0xb'),auth[_0x1abc('0x9')](),controller[_0x1abc('0x10')]);router[_0x1abc('0x11')](_0x1abc('0xb'),auth[_0x1abc('0x9')](),controller[_0x1abc('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xd3bf=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0xd3bf,0x13d));var _0xfd3b=function(_0x18cabd,_0x4c086d){_0x18cabd=_0x18cabd-0x0;var _0x737f87=_0xd3bf[_0x18cabd];return _0x737f87;};'use strict';var multer=require(_0xfd3b('0x0'));var util=require(_0xfd3b('0x1'));var path=require(_0xfd3b('0x2'));var express=require(_0xfd3b('0x3'));var router=express[_0xfd3b('0x4')]();var auth=require(_0xfd3b('0x5'));var interaction=require(_0xfd3b('0x6'));var config=require(_0xfd3b('0x7'));var controller=require('./squareRecording.controller');router['get']('/',auth[_0xfd3b('0x8')](),controller['index']);router[_0xfd3b('0x9')](_0xfd3b('0xa'),auth[_0xfd3b('0x8')](),controller[_0xfd3b('0xb')]);router[_0xfd3b('0x9')](_0xfd3b('0xc'),auth[_0xfd3b('0x8')](),controller[_0xfd3b('0xd')]);router[_0xfd3b('0xe')]('/',auth[_0xfd3b('0x8')](),controller[_0xfd3b('0xf')]);router[_0xfd3b('0x10')](_0xfd3b('0xa'),auth[_0xfd3b('0x8')](),controller['update']);router[_0xfd3b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xfd3b('0x12')]);module[_0xfd3b('0x13')]=router;
\ No newline at end of file
index 0f75f22..48fe4e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x592b=['exports','STRING','sequelize'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x592b,0x68));var _0xb592=function(_0x5b9571,_0x10187d){_0x5b9571=_0x5b9571-0x0;var _0x7600b2=_0x592b[_0x5b9571];return _0x7600b2;};'use strict';var Sequelize=require(_0xb592('0x0'));module[_0xb592('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xb592('0x2')]},'calleridname':{'type':Sequelize[_0xb592('0x2')]},'context':{'type':Sequelize[_0xb592('0x2')]},'extension':{'type':Sequelize[_0xb592('0x2')]},'priority':{'type':Sequelize[_0xb592('0x2')]},'accountcode':{'type':Sequelize[_0xb592('0x2')]},'dnid':{'type':Sequelize[_0xb592('0x2')]},'projectName':{'type':Sequelize[_0xb592('0x2')]},'saveName':{'type':Sequelize[_0xb592('0x2')]},'filename':{'type':Sequelize[_0xb592('0x2')]},'savePath':{'type':Sequelize[_0xb592('0x2')]}};
\ No newline at end of file
+var _0xab88=['sequelize','exports','STRING'];(function(_0x5a2e13,_0x23611e){var _0x319656=function(_0x4e5cb0){while(--_0x4e5cb0){_0x5a2e13['push'](_0x5a2e13['shift']());}};_0x319656(++_0x23611e);}(_0xab88,0x18f));var _0x8ab8=function(_0x262ff6,_0x158799){_0x262ff6=_0x262ff6-0x0;var _0x4c9b82=_0xab88[_0x262ff6];return _0x4c9b82;};'use strict';var Sequelize=require(_0x8ab8('0x0'));module[_0x8ab8('0x1')]={'uniqueid':{'type':Sequelize[_0x8ab8('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8ab8('0x2')]},'context':{'type':Sequelize[_0x8ab8('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x8ab8('0x2')]},'accountcode':{'type':Sequelize[_0x8ab8('0x2')]},'dnid':{'type':Sequelize[_0x8ab8('0x2')]},'projectName':{'type':Sequelize[_0x8ab8('0x2')]},'saveName':{'type':Sequelize[_0x8ab8('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x8ab8('0x2')]}};
\ No newline at end of file
index 4d28546..57cbd5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53eb=['order','sort','pick','add','day','merge','where','map','filter','options','includeAll','include','findAll','show','params','rawAttributes','catch','create','body','find','download','type','uniqueid','savePath','filename','format','%s.cypher','value','existsSync','decryptFile','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','html-pdf','eml-format','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','stack','send','SquareRecording','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length'];(function(_0x593fdc,_0x4539e3){var _0x5cbca0=function(_0xfd9dc){while(--_0xfd9dc){_0x593fdc['push'](_0x593fdc['shift']());}};_0x5cbca0(++_0x4539e3);}(_0x53eb,0x115));var _0xb53e=function(_0x2dbcce,_0x340ff5){_0x2dbcce=_0x2dbcce-0x0;var _0x5217a0=_0x53eb[_0x2dbcce];return _0x5217a0;};'use strict';var pdf=require(_0xb53e('0x0'));var emlformat=require(_0xb53e('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb53e('0x2'));var rp=require('request-promise');var moment=require(_0xb53e('0x3'));var BPromise=require(_0xb53e('0x4'));var Mustache=require('mustache');var util=require(_0xb53e('0x5'));var path=require(_0xb53e('0x6'));var sox=require(_0xb53e('0x7'));var csv=require('to-csv');var ejs=require(_0xb53e('0x8'));var fs=require('fs');var _=require(_0xb53e('0x9'));var squel=require(_0xb53e('0xa'));var crypto=require(_0xb53e('0xb'));var jsforce=require(_0xb53e('0xc'));var deskjs=require(_0xb53e('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb53e('0xe'));var Papa=require('papaparse');var qs=require('../../components/parsers/qs');var logger=require(_0xb53e('0xf'))(_0xb53e('0x10'));var utils=require(_0xb53e('0x11'));var config=require(_0xb53e('0x12'));var db=require(_0xb53e('0x13'))['db'];function respondWithStatusCode(_0x110394,_0x69c5c3){_0x69c5c3=_0x69c5c3||0xcc;return function(_0x85abe0){if(_0x85abe0){return _0x110394[_0xb53e('0x14')](_0x69c5c3);}return _0x110394[_0xb53e('0x15')](_0x69c5c3)[_0xb53e('0x16')]();};}function respondWithResult(_0x5ae551,_0x32bc54){_0x32bc54=_0x32bc54||0xc8;return function(_0x2b0de7){if(_0x2b0de7){return _0x5ae551[_0xb53e('0x15')](_0x32bc54)['json'](_0x2b0de7);}};}function respondWithFilteredResult(_0x1833a1,_0x5782ae){return function(_0x10b4a6){if(_0x10b4a6){var _0x381bf0=_0x10b4a6[_0xb53e('0x17')],_0x5aebaa=_0x5782ae[_0xb53e('0x18')],_0x31eba8=_0x5782ae[_0xb53e('0x18')]+_0x5782ae[_0xb53e('0x19')],_0x1c801b;if(_0x31eba8>=_0x381bf0){_0x31eba8=_0x381bf0;_0x1c801b=0xc8;}else{_0x1c801b=0xce;}_0x1833a1[_0xb53e('0x15')](_0x1c801b);return _0x1833a1[_0xb53e('0x1a')](_0xb53e('0x1b'),_0x5aebaa+'-'+_0x31eba8+'/'+_0x381bf0)[_0xb53e('0x1c')](_0x10b4a6);}return null;};}function patchUpdates(_0x512735){return function(_0x49aa3b){try{jsonpatch[_0xb53e('0x1d')](_0x49aa3b,_0x512735,!![]);}catch(_0x398257){return BPromise[_0xb53e('0x1e')](_0x398257);}return _0x49aa3b[_0xb53e('0x1f')]();};}function saveUpdates(_0x1c57fa,_0x72a05c){return function(_0x5c63cf){if(_0x5c63cf){return _0x5c63cf['update'](_0x1c57fa)[_0xb53e('0x20')](function(_0xac25ec){return _0xac25ec;});}return null;};}function removeEntity(_0x16d80b,_0x2aff9c){return function(_0x296c37){if(_0x296c37){return _0x296c37[_0xb53e('0x21')]()[_0xb53e('0x20')](function(){_0x16d80b[_0xb53e('0x15')](0xcc)[_0xb53e('0x16')]();});}};}function handleEntityNotFound(_0x2ea515,_0x274f00){return function(_0x183095){if(!_0x183095){_0x2ea515[_0xb53e('0x14')](0x194);}return _0x183095;};}function handleError(_0x393408,_0x1f112d){_0x1f112d=_0x1f112d||0x1f4;return function(_0x28f1c6){logger['error'](_0x28f1c6[_0xb53e('0x22')]);if(_0x28f1c6['name']){delete _0x28f1c6['name'];}_0x393408[_0xb53e('0x15')](_0x1f112d)[_0xb53e('0x23')](_0x28f1c6);};}exports['index']=function(_0x25ed47,_0x18c564){var _0x5c4755={},_0x269bc6={},_0x5c7251={'count':0x0,'rows':[]};var _0xb1f42a=db[_0xb53e('0x24')]['rawAttributes'];_0x269bc6[_0xb53e('0x25')]=_[_0xb53e('0x26')](_0xb1f42a);var _0x281d23={'dateStart':_0x25ed47[_0xb53e('0x27')][_0xb53e('0x28')],'dateEnd':_0x25ed47[_0xb53e('0x27')][_0xb53e('0x29')]};delete _0x25ed47['query']['dateStart'];delete _0x25ed47[_0xb53e('0x27')][_0xb53e('0x29')];_0x269bc6['query']=_[_0xb53e('0x26')](_0x25ed47['query']);_0x269bc6[_0xb53e('0x2a')]=_[_0xb53e('0x2b')](_0x269bc6[_0xb53e('0x25')],_0x269bc6[_0xb53e('0x27')]);_0x5c4755[_0xb53e('0x2c')]=_[_0xb53e('0x2b')](_0x269bc6[_0xb53e('0x25')],qs['fields'](_0x25ed47['query'][_0xb53e('0x2d')]));_0x5c4755[_0xb53e('0x2c')]=_0x5c4755[_0xb53e('0x2c')][_0xb53e('0x2e')]?_0x5c4755[_0xb53e('0x2c')]:_0x269bc6[_0xb53e('0x25')];if(!_0x25ed47[_0xb53e('0x27')]['hasOwnProperty']('nolimit')){_0x5c4755[_0xb53e('0x19')]=qs[_0xb53e('0x19')](_0x25ed47['query'][_0xb53e('0x19')]);_0x5c4755[_0xb53e('0x18')]=qs[_0xb53e('0x18')](_0x25ed47['query'][_0xb53e('0x18')]);}_0x5c4755[_0xb53e('0x2f')]=qs['sort'](_0x25ed47[_0xb53e('0x27')][_0xb53e('0x30')]);_0x5c4755['where']=qs['filters'](_[_0xb53e('0x31')](_0x25ed47[_0xb53e('0x27')],_0x269bc6[_0xb53e('0x2a')]));if(_0x281d23[_0xb53e('0x28')]){if(_0x281d23[_0xb53e('0x29')]){_0x281d23[_0xb53e('0x29')]=moment(_0x281d23['dateEnd'])[_0xb53e('0x32')](0x1,_0xb53e('0x33'));}else{_0x281d23[_0xb53e('0x29')]=moment(_0x281d23['dateStart'])['add'](0x1,_0xb53e('0x33'));}_[_0xb53e('0x34')](_0x5c4755['where'],{'createdAt':{'$gte':_0x281d23['dateStart'],'$lte':_0x281d23[_0xb53e('0x29')]}});}if(_0x25ed47[_0xb53e('0x27')]['filter']){_0x5c4755['where']=_['merge'](_0x5c4755[_0xb53e('0x35')],{'$or':_[_0xb53e('0x36')](_0x5c4755[_0xb53e('0x2c')],function(_0x723ea5){var _0x459b76={};_0x459b76[_0x723ea5]={'$like':'%'+_0x25ed47[_0xb53e('0x27')][_0xb53e('0x37')]+'%'};return _0x459b76;})});}_0x5c4755=_[_0xb53e('0x34')]({},_0x5c4755,_0x25ed47[_0xb53e('0x38')]);var _0x31ff03={'where':_0x5c4755['where']};return db[_0xb53e('0x24')][_0xb53e('0x17')](_0x31ff03)[_0xb53e('0x20')](function(_0x31aae5){_0x5c7251[_0xb53e('0x17')]=_0x31aae5;if(_0x25ed47[_0xb53e('0x27')][_0xb53e('0x39')]){_0x5c4755[_0xb53e('0x3a')]=[{'all':!![]}];}return db[_0xb53e('0x24')][_0xb53e('0x3b')](_0x5c4755);})[_0xb53e('0x20')](function(_0x4e98d0){_0x5c7251['rows']=_0x4e98d0;return _0x5c7251;})[_0xb53e('0x20')](respondWithFilteredResult(_0x18c564,_0x5c4755))['catch'](handleError(_0x18c564,null));};exports[_0xb53e('0x3c')]=function(_0x54ad9f,_0x337898){var _0x2847e1={'raw':!![],'where':{'id':_0x54ad9f[_0xb53e('0x3d')]['id']}},_0x598426={};_0x598426['model']=_[_0xb53e('0x26')](db[_0xb53e('0x24')][_0xb53e('0x3e')]);_0x598426[_0xb53e('0x27')]=_['keys'](_0x54ad9f['query']);_0x598426[_0xb53e('0x2a')]=_['intersection'](_0x598426[_0xb53e('0x25')],_0x598426[_0xb53e('0x27')]);_0x2847e1['attributes']=_[_0xb53e('0x2b')](_0x598426[_0xb53e('0x25')],qs['fields'](_0x54ad9f['query'][_0xb53e('0x2d')]));_0x2847e1[_0xb53e('0x2c')]=_0x2847e1[_0xb53e('0x2c')][_0xb53e('0x2e')]?_0x2847e1[_0xb53e('0x2c')]:_0x598426[_0xb53e('0x25')];if(_0x54ad9f[_0xb53e('0x27')]['includeAll']){_0x2847e1[_0xb53e('0x3a')]=[{'all':!![]}];}_0x2847e1=_[_0xb53e('0x34')]({},_0x2847e1,_0x54ad9f[_0xb53e('0x38')]);return db[_0xb53e('0x24')]['find'](_0x2847e1)[_0xb53e('0x20')](handleEntityNotFound(_0x337898,null))['then'](respondWithResult(_0x337898,null))[_0xb53e('0x3f')](handleError(_0x337898,null));};exports['create']=function(_0x2668f0,_0x15a555){return db['SquareRecording'][_0xb53e('0x40')](_0x2668f0[_0xb53e('0x41')],{})[_0xb53e('0x20')](respondWithResult(_0x15a555,0xc9))['catch'](handleError(_0x15a555,null));};exports['update']=function(_0x3af772,_0x177e09){if(_0x3af772[_0xb53e('0x41')]['id']){delete _0x3af772['body']['id'];}return db[_0xb53e('0x24')][_0xb53e('0x42')]({'where':{'id':_0x3af772[_0xb53e('0x3d')]['id']}})[_0xb53e('0x20')](handleEntityNotFound(_0x177e09,null))[_0xb53e('0x20')](saveUpdates(_0x3af772[_0xb53e('0x41')],null))[_0xb53e('0x20')](respondWithResult(_0x177e09,null))[_0xb53e('0x3f')](handleError(_0x177e09,null));};exports[_0xb53e('0x21')]=function(_0x340b7d,_0x2990fc){return db[_0xb53e('0x24')][_0xb53e('0x42')]({'where':{'id':_0x340b7d[_0xb53e('0x3d')]['id']}})[_0xb53e('0x20')](handleEntityNotFound(_0x2990fc,null))[_0xb53e('0x20')](removeEntity(_0x2990fc,null))[_0xb53e('0x3f')](handleError(_0x2990fc,null));};exports[_0xb53e('0x43')]=function(_0x511cf2,_0x2b8091,_0xb404e0){var _0x5f3079=require('../../components/encryptor');var _0x8541bc=![];var _0x5d8b5e={};if(_0x511cf2[_0xb53e('0x27')][_0xb53e('0x44')]&&_0x511cf2[_0xb53e('0x27')][_0xb53e('0x44')]===_0xb53e('0x45')){_0x5d8b5e['uniqueid']=_0x511cf2[_0xb53e('0x3d')]['id'];}else{_0x5d8b5e['id']=_0x511cf2['params']['id'];}return db[_0xb53e('0x24')]['find']({'where':_0x5d8b5e,'attributes':['id',_0xb53e('0x46'),_0xb53e('0x47')],'raw':!![]})['then'](handleEntityNotFound(_0x2b8091,null))[_0xb53e('0x20')](function(_0x5aa065){if(_0x5aa065){var _0x475787=util[_0xb53e('0x48')](_0xb53e('0x49'),_0x5aa065[_0xb53e('0x4a')]);if(fs[_0xb53e('0x4b')](_0x475787)){_0x8541bc=!![];return _0x5f3079[_0xb53e('0x4c')](_0x475787,_0x5aa065[_0xb53e('0x46')],config['secrets']['recording'])['then'](function(){return _0x5aa065;});}return _0x5aa065;}})[_0xb53e('0x20')](function(_0x1ef824){if(_0x1ef824){if(!fs[_0xb53e('0x4b')](_0x1ef824[_0xb53e('0x46')])){throw new db[(_0xb53e('0x4d'))][(_0xb53e('0x4e'))](_0xb53e('0x4f'));}if(_0x1ef824[_0xb53e('0x47')]){return _0x2b8091[_0xb53e('0x43')](_0x1ef824['savePath'],_0x1ef824[_0xb53e('0x47')]+path['extname'](_0x1ef824[_0xb53e('0x46')]),function(){if(_0x8541bc){fs[_0xb53e('0x50')](_0x1ef824[_0xb53e('0x46')]);}});}else{return _0x2b8091[_0xb53e('0x43')](_0x1ef824[_0xb53e('0x46')],function(_0x5d817a){if(_0x8541bc){fs[_0xb53e('0x50')](_0x1ef824[_0xb53e('0x46')]);}});}}})[_0xb53e('0x3f')](handleError(_0x2b8091,null));};
\ No newline at end of file
+var _0xcc9b=['day','merge','filter','map','SquareRecording','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','../../components/encryptor','type','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','add'];(function(_0x4ebb0f,_0x13bb8b){var _0x9b7ada=function(_0x2f7563){while(--_0x2f7563){_0x4ebb0f['push'](_0x4ebb0f['shift']());}};_0x9b7ada(++_0x13bb8b);}(_0xcc9b,0x12e));var _0xbcc9=function(_0x3c685d,_0xe807c3){_0x3c685d=_0x3c685d-0x0;var _0x49779a=_0xcc9b[_0x3c685d];return _0x49779a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbcc9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbcc9('0x1'));var jsonpatch=require(_0xbcc9('0x2'));var rp=require(_0xbcc9('0x3'));var moment=require(_0xbcc9('0x4'));var BPromise=require(_0xbcc9('0x5'));var Mustache=require(_0xbcc9('0x6'));var util=require(_0xbcc9('0x7'));var path=require(_0xbcc9('0x8'));var sox=require(_0xbcc9('0x9'));var csv=require(_0xbcc9('0xa'));var ejs=require(_0xbcc9('0xb'));var fs=require('fs');var _=require(_0xbcc9('0xc'));var squel=require(_0xbcc9('0xd'));var crypto=require(_0xbcc9('0xe'));var jsforce=require(_0xbcc9('0xf'));var deskjs=require(_0xbcc9('0x10'));var toCsv=require(_0xbcc9('0xa'));var querystring=require(_0xbcc9('0x11'));var Papa=require(_0xbcc9('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0xbcc9('0x13'))(_0xbcc9('0x14'));var utils=require(_0xbcc9('0x15'));var config=require('../../config/environment');var db=require(_0xbcc9('0x16'))['db'];function respondWithStatusCode(_0x1efeee,_0x363caf){_0x363caf=_0x363caf||0xcc;return function(_0xb42689){if(_0xb42689){return _0x1efeee['sendStatus'](_0x363caf);}return _0x1efeee[_0xbcc9('0x17')](_0x363caf)[_0xbcc9('0x18')]();};}function respondWithResult(_0xf0adce,_0x2cd154){_0x2cd154=_0x2cd154||0xc8;return function(_0x2585c5){if(_0x2585c5){return _0xf0adce[_0xbcc9('0x17')](_0x2cd154)[_0xbcc9('0x19')](_0x2585c5);}};}function respondWithFilteredResult(_0x35480d,_0x609de4){return function(_0x5a8807){if(_0x5a8807){var _0x40b390=_0x5a8807[_0xbcc9('0x1a')],_0x33b0df=_0x609de4[_0xbcc9('0x1b')],_0x1e52bf=_0x609de4[_0xbcc9('0x1b')]+_0x609de4[_0xbcc9('0x1c')],_0x15bb9d;if(_0x1e52bf>=_0x40b390){_0x1e52bf=_0x40b390;_0x15bb9d=0xc8;}else{_0x15bb9d=0xce;}_0x35480d[_0xbcc9('0x17')](_0x15bb9d);return _0x35480d[_0xbcc9('0x1d')](_0xbcc9('0x1e'),_0x33b0df+'-'+_0x1e52bf+'/'+_0x40b390)[_0xbcc9('0x19')](_0x5a8807);}return null;};}function patchUpdates(_0x1e5326){return function(_0x4117ea){try{jsonpatch[_0xbcc9('0x1f')](_0x4117ea,_0x1e5326,!![]);}catch(_0x69e844){return BPromise['reject'](_0x69e844);}return _0x4117ea['save']();};}function saveUpdates(_0x4c9029,_0x3544a5){return function(_0x3116b4){if(_0x3116b4){return _0x3116b4[_0xbcc9('0x20')](_0x4c9029)[_0xbcc9('0x21')](function(_0x2f4bc7){return _0x2f4bc7;});}return null;};}function removeEntity(_0xd3aeeb,_0x5b16b5){return function(_0x29a6bf){if(_0x29a6bf){return _0x29a6bf[_0xbcc9('0x22')]()[_0xbcc9('0x21')](function(){_0xd3aeeb[_0xbcc9('0x17')](0xcc)[_0xbcc9('0x18')]();});}};}function handleEntityNotFound(_0x3b94ef,_0x46e3b0){return function(_0x82c245){if(!_0x82c245){_0x3b94ef[_0xbcc9('0x23')](0x194);}return _0x82c245;};}function handleError(_0x537e1f,_0x33290f){_0x33290f=_0x33290f||0x1f4;return function(_0x205870){logger[_0xbcc9('0x24')](_0x205870[_0xbcc9('0x25')]);if(_0x205870['name']){delete _0x205870[_0xbcc9('0x26')];}_0x537e1f[_0xbcc9('0x17')](_0x33290f)[_0xbcc9('0x27')](_0x205870);};}exports[_0xbcc9('0x28')]=function(_0x48361d,_0x2ed765){var _0x2b6647={},_0xfdaef3={},_0x4c65d1={'count':0x0,'rows':[]};var _0x205d5e=db['SquareRecording'][_0xbcc9('0x29')];_0xfdaef3[_0xbcc9('0x2a')]=_[_0xbcc9('0x2b')](_0x205d5e);var _0x4172b4={'dateStart':_0x48361d[_0xbcc9('0x2c')][_0xbcc9('0x2d')],'dateEnd':_0x48361d[_0xbcc9('0x2c')][_0xbcc9('0x2e')]};delete _0x48361d[_0xbcc9('0x2c')][_0xbcc9('0x2d')];delete _0x48361d[_0xbcc9('0x2c')][_0xbcc9('0x2e')];_0xfdaef3[_0xbcc9('0x2c')]=_[_0xbcc9('0x2b')](_0x48361d[_0xbcc9('0x2c')]);_0xfdaef3[_0xbcc9('0x2f')]=_[_0xbcc9('0x30')](_0xfdaef3[_0xbcc9('0x2a')],_0xfdaef3['query']);_0x2b6647[_0xbcc9('0x31')]=_[_0xbcc9('0x30')](_0xfdaef3['model'],qs[_0xbcc9('0x32')](_0x48361d[_0xbcc9('0x2c')][_0xbcc9('0x32')]));_0x2b6647[_0xbcc9('0x31')]=_0x2b6647[_0xbcc9('0x31')][_0xbcc9('0x33')]?_0x2b6647[_0xbcc9('0x31')]:_0xfdaef3[_0xbcc9('0x2a')];if(!_0x48361d[_0xbcc9('0x2c')][_0xbcc9('0x34')](_0xbcc9('0x35'))){_0x2b6647['limit']=qs[_0xbcc9('0x1c')](_0x48361d['query']['limit']);_0x2b6647[_0xbcc9('0x1b')]=qs[_0xbcc9('0x1b')](_0x48361d[_0xbcc9('0x2c')][_0xbcc9('0x1b')]);}_0x2b6647['order']=qs['sort'](_0x48361d[_0xbcc9('0x2c')][_0xbcc9('0x36')]);_0x2b6647[_0xbcc9('0x37')]=qs[_0xbcc9('0x2f')](_[_0xbcc9('0x38')](_0x48361d[_0xbcc9('0x2c')],_0xfdaef3['filters']));if(_0x4172b4[_0xbcc9('0x2d')]){if(_0x4172b4[_0xbcc9('0x2e')]){_0x4172b4[_0xbcc9('0x2e')]=moment(_0x4172b4[_0xbcc9('0x2e')])[_0xbcc9('0x39')](0x1,_0xbcc9('0x3a'));}else{_0x4172b4['dateEnd']=moment(_0x4172b4[_0xbcc9('0x2d')])['add'](0x1,'day');}_[_0xbcc9('0x3b')](_0x2b6647[_0xbcc9('0x37')],{'createdAt':{'$gte':_0x4172b4[_0xbcc9('0x2d')],'$lte':_0x4172b4[_0xbcc9('0x2e')]}});}if(_0x48361d[_0xbcc9('0x2c')][_0xbcc9('0x3c')]){_0x2b6647[_0xbcc9('0x37')]=_['merge'](_0x2b6647[_0xbcc9('0x37')],{'$or':_[_0xbcc9('0x3d')](_0x2b6647['attributes'],function(_0xe730f2){var _0x1e5a91={};_0x1e5a91[_0xe730f2]={'$like':'%'+_0x48361d[_0xbcc9('0x2c')][_0xbcc9('0x3c')]+'%'};return _0x1e5a91;})});}_0x2b6647=_[_0xbcc9('0x3b')]({},_0x2b6647,_0x48361d['options']);var _0x2fc974={'where':_0x2b6647[_0xbcc9('0x37')]};return db[_0xbcc9('0x3e')][_0xbcc9('0x1a')](_0x2fc974)[_0xbcc9('0x21')](function(_0x321826){_0x4c65d1[_0xbcc9('0x1a')]=_0x321826;if(_0x48361d[_0xbcc9('0x2c')][_0xbcc9('0x3f')]){_0x2b6647[_0xbcc9('0x40')]=[{'all':!![]}];}return db[_0xbcc9('0x3e')][_0xbcc9('0x41')](_0x2b6647);})[_0xbcc9('0x21')](function(_0x295f14){_0x4c65d1[_0xbcc9('0x42')]=_0x295f14;return _0x4c65d1;})['then'](respondWithFilteredResult(_0x2ed765,_0x2b6647))[_0xbcc9('0x43')](handleError(_0x2ed765,null));};exports[_0xbcc9('0x44')]=function(_0x44941e,_0x4ac6a1){var _0x34a5cd={'raw':!![],'where':{'id':_0x44941e[_0xbcc9('0x45')]['id']}},_0x273c61={};_0x273c61[_0xbcc9('0x2a')]=_[_0xbcc9('0x2b')](db[_0xbcc9('0x3e')][_0xbcc9('0x29')]);_0x273c61[_0xbcc9('0x2c')]=_[_0xbcc9('0x2b')](_0x44941e['query']);_0x273c61['filters']=_['intersection'](_0x273c61[_0xbcc9('0x2a')],_0x273c61[_0xbcc9('0x2c')]);_0x34a5cd['attributes']=_[_0xbcc9('0x30')](_0x273c61[_0xbcc9('0x2a')],qs['fields'](_0x44941e[_0xbcc9('0x2c')][_0xbcc9('0x32')]));_0x34a5cd[_0xbcc9('0x31')]=_0x34a5cd[_0xbcc9('0x31')]['length']?_0x34a5cd['attributes']:_0x273c61[_0xbcc9('0x2a')];if(_0x44941e[_0xbcc9('0x2c')][_0xbcc9('0x3f')]){_0x34a5cd[_0xbcc9('0x40')]=[{'all':!![]}];}_0x34a5cd=_[_0xbcc9('0x3b')]({},_0x34a5cd,_0x44941e[_0xbcc9('0x46')]);return db[_0xbcc9('0x3e')][_0xbcc9('0x47')](_0x34a5cd)[_0xbcc9('0x21')](handleEntityNotFound(_0x4ac6a1,null))[_0xbcc9('0x21')](respondWithResult(_0x4ac6a1,null))[_0xbcc9('0x43')](handleError(_0x4ac6a1,null));};exports[_0xbcc9('0x48')]=function(_0x5d4857,_0x12bffe){return db[_0xbcc9('0x3e')][_0xbcc9('0x48')](_0x5d4857[_0xbcc9('0x49')],{})[_0xbcc9('0x21')](respondWithResult(_0x12bffe,0xc9))['catch'](handleError(_0x12bffe,null));};exports[_0xbcc9('0x20')]=function(_0x35a863,_0x55fabc){if(_0x35a863[_0xbcc9('0x49')]['id']){delete _0x35a863[_0xbcc9('0x49')]['id'];}return db[_0xbcc9('0x3e')]['find']({'where':{'id':_0x35a863[_0xbcc9('0x45')]['id']}})[_0xbcc9('0x21')](handleEntityNotFound(_0x55fabc,null))[_0xbcc9('0x21')](saveUpdates(_0x35a863[_0xbcc9('0x49')],null))[_0xbcc9('0x21')](respondWithResult(_0x55fabc,null))[_0xbcc9('0x43')](handleError(_0x55fabc,null));};exports[_0xbcc9('0x22')]=function(_0x114819,_0x9de336){return db[_0xbcc9('0x3e')][_0xbcc9('0x47')]({'where':{'id':_0x114819['params']['id']}})['then'](handleEntityNotFound(_0x9de336,null))[_0xbcc9('0x21')](removeEntity(_0x9de336,null))[_0xbcc9('0x43')](handleError(_0x9de336,null));};exports['download']=function(_0x149428,_0x56c48a,_0x1af5c1){var _0x48603d=require(_0xbcc9('0x4a'));var _0x1df45e=![];var _0x479726={};if(_0x149428[_0xbcc9('0x2c')][_0xbcc9('0x4b')]&&_0x149428[_0xbcc9('0x2c')][_0xbcc9('0x4b')]==='uniqueid'){_0x479726[_0xbcc9('0x4c')]=_0x149428[_0xbcc9('0x45')]['id'];}else{_0x479726['id']=_0x149428['params']['id'];}return db['SquareRecording']['find']({'where':_0x479726,'attributes':['id',_0xbcc9('0x4d'),_0xbcc9('0x4e')],'raw':!![]})[_0xbcc9('0x21')](handleEntityNotFound(_0x56c48a,null))['then'](function(_0x3c4f45){if(_0x3c4f45){var _0xf57cff=util[_0xbcc9('0x4f')](_0xbcc9('0x50'),_0x3c4f45['value']);if(fs[_0xbcc9('0x51')](_0xf57cff)){_0x1df45e=!![];return _0x48603d[_0xbcc9('0x52')](_0xf57cff,_0x3c4f45[_0xbcc9('0x4d')],config[_0xbcc9('0x53')]['recording'])[_0xbcc9('0x21')](function(){return _0x3c4f45;});}return _0x3c4f45;}})[_0xbcc9('0x21')](function(_0x4d6c4e){if(_0x4d6c4e){if(!fs[_0xbcc9('0x51')](_0x4d6c4e['savePath'])){throw new db[(_0xbcc9('0x54'))][(_0xbcc9('0x55'))](_0xbcc9('0x56'));}if(_0x4d6c4e[_0xbcc9('0x4e')]){return _0x56c48a['download'](_0x4d6c4e[_0xbcc9('0x4d')],_0x4d6c4e[_0xbcc9('0x4e')]+path[_0xbcc9('0x57')](_0x4d6c4e[_0xbcc9('0x4d')]),function(){if(_0x1df45e){fs[_0xbcc9('0x58')](_0x4d6c4e[_0xbcc9('0x4d')]);}});}else{return _0x56c48a[_0xbcc9('0x59')](_0x4d6c4e[_0xbcc9('0x4d')],function(_0x318ed5){if(_0x1df45e){fs[_0xbcc9('0x58')](_0x4d6c4e[_0xbcc9('0x4d')]);}});}}})[_0xbcc9('0x43')](handleError(_0x56c48a,null));};
\ No newline at end of file
index c65d15c..98e3e57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31f0=['bluebird','request-promise','./squareRecording.attributes','lodash','../../config/logger','moment'];(function(_0x285513,_0x297884){var _0x239142=function(_0x3daa79){while(--_0x3daa79){_0x285513['push'](_0x285513['shift']());}};_0x239142(++_0x297884);}(_0x31f0,0xb7));var _0x031f=function(_0x1a491f,_0x196771){_0x1a491f=_0x1a491f-0x0;var _0x27b104=_0x31f0[_0x1a491f];return _0x27b104;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var attributes=require(_0x031f('0x5'));module['exports']=function(_0x3c0612,_0x1a63ba){return _0x3c0612['define']('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x212b=['api','moment','bluebird','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','../../config/logger'];(function(_0x5e56cc,_0x4f1c39){var _0x575e73=function(_0x5f5c6f){while(--_0x5f5c6f){_0x5e56cc['push'](_0x5e56cc['shift']());}};_0x575e73(++_0x4f1c39);}(_0x212b,0x148));var _0xb212=function(_0x12fe94,_0x2b7c2b){_0x12fe94=_0x12fe94-0x0;var _0x3d5279=_0x212b[_0x12fe94];return _0x3d5279;};'use strict';var _=require(_0xb212('0x0'));var util=require('util');var logger=require(_0xb212('0x1'))(_0xb212('0x2'));var moment=require(_0xb212('0x3'));var BPromise=require(_0xb212('0x4'));var rp=require('request-promise');var attributes=require(_0xb212('0x5'));module[_0xb212('0x6')]=function(_0x1826d1,_0x4ee18c){return _0x1826d1[_0xb212('0x7')](_0xb212('0x8'),attributes,{'tableName':_0xb212('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 046b98e..577f4bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6d8=['create','body','options','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording'];(function(_0x1c337e,_0x393890){var _0x156330=function(_0x21543f){while(--_0x21543f){_0x1c337e['push'](_0x1c337e['shift']());}};_0x156330(++_0x393890);}(_0xf6d8,0x1f1));var _0x8f6d=function(_0x168996,_0x444f8d){_0x168996=_0x168996-0x0;var _0x55c071=_0xf6d8[_0x168996];return _0x55c071;};'use strict';var _=require(_0x8f6d('0x0'));var util=require('util');var moment=require(_0x8f6d('0x1'));var BPromise=require(_0x8f6d('0x2'));var rs=require(_0x8f6d('0x3'));var fs=require('fs');var db=require(_0x8f6d('0x4'))['db'];var utils=require(_0x8f6d('0x5'));var logger=require(_0x8f6d('0x6'))(_0x8f6d('0x7'));var config=require(_0x8f6d('0x8'));var jayson=require(_0x8f6d('0x9'));var client=jayson[_0x8f6d('0xa')][_0x8f6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1848be,_0x4172cf,_0x5c5e8d){return new BPromise(function(_0x23a9f7,_0x20a70c){return client[_0x8f6d('0xc')](_0x1848be,_0x5c5e8d)['then'](function(_0x44c010){logger['info'](_0x8f6d('0xd'),_0x4172cf,'request\x20sent');logger[_0x8f6d('0xe')](_0x8f6d('0xf'),_0x4172cf,_0x8f6d('0x10'),JSON[_0x8f6d('0x11')](_0x44c010));if(_0x44c010[_0x8f6d('0x12')]){if(_0x44c010[_0x8f6d('0x12')][_0x8f6d('0x13')]===0x1f4){logger[_0x8f6d('0x12')](_0x8f6d('0xd'),_0x4172cf,_0x44c010[_0x8f6d('0x12')]['message']);return _0x20a70c(_0x44c010[_0x8f6d('0x12')]['message']);}logger[_0x8f6d('0x12')]('SquareRecording,\x20%s,\x20%s',_0x4172cf,_0x44c010[_0x8f6d('0x12')][_0x8f6d('0x14')]);return _0x23a9f7(_0x44c010[_0x8f6d('0x12')][_0x8f6d('0x14')]);}else{logger['info'](_0x8f6d('0xd'),_0x4172cf,_0x8f6d('0x10'));_0x23a9f7(_0x44c010[_0x8f6d('0x15')]['message']);}})[_0x8f6d('0x16')](function(_0x12ed32){logger[_0x8f6d('0x12')](_0x8f6d('0xd'),_0x4172cf,_0x12ed32);_0x20a70c(_0x12ed32);});});}exports[_0x8f6d('0x17')]=function(_0x5cdb18){var _0x90a385=this;return new Promise(function(_0x1eb0cc,_0xacaeac){return db[_0x8f6d('0x18')][_0x8f6d('0x19')](_0x5cdb18[_0x8f6d('0x1a')],{'raw':_0x5cdb18[_0x8f6d('0x1b')]?_0x5cdb18[_0x8f6d('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x10c4f5){logger[_0x8f6d('0x1c')](_0x8f6d('0x17'),_0x5cdb18);logger[_0x8f6d('0xe')]('CreateSquareRecording',_0x5cdb18,JSON['stringify'](_0x10c4f5));_0x1eb0cc(_0x10c4f5);})[_0x8f6d('0x16')](function(_0x4192ed){logger[_0x8f6d('0x12')](_0x8f6d('0x17'),_0x4192ed[_0x8f6d('0x14')],_0x5cdb18);_0xacaeac(_0x90a385[_0x8f6d('0x12')](0x1f4,_0x4192ed[_0x8f6d('0x14')]));});});};
\ No newline at end of file
+var _0x1421=['http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','CreateSquareRecording','SquareRecording','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4bea3e,_0x34130a){var _0x120ea6=function(_0x101177){while(--_0x101177){_0x4bea3e['push'](_0x4bea3e['shift']());}};_0x120ea6(++_0x34130a);}(_0x1421,0x152));var _0x1142=function(_0x33efce,_0x3bd96b){_0x33efce=_0x33efce-0x0;var _0x34e3e0=_0x1421[_0x33efce];return _0x34e3e0;};'use strict';var _=require(_0x1142('0x0'));var util=require(_0x1142('0x1'));var moment=require(_0x1142('0x2'));var BPromise=require(_0x1142('0x3'));var rs=require(_0x1142('0x4'));var fs=require('fs');var db=require(_0x1142('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1142('0x6'))(_0x1142('0x7'));var config=require(_0x1142('0x8'));var jayson=require(_0x1142('0x9'));var client=jayson['client'][_0x1142('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x578684,_0x244383,_0x1d4947){return new BPromise(function(_0xf4c0c3,_0x443e7a){return client[_0x1142('0xb')](_0x578684,_0x1d4947)[_0x1142('0xc')](function(_0x39c705){logger[_0x1142('0xd')](_0x1142('0xe'),_0x244383,'request\x20sent');logger[_0x1142('0xf')](_0x1142('0x10'),_0x244383,_0x1142('0x11'),JSON[_0x1142('0x12')](_0x39c705));if(_0x39c705['error']){if(_0x39c705['error'][_0x1142('0x13')]===0x1f4){logger[_0x1142('0x14')](_0x1142('0xe'),_0x244383,_0x39c705[_0x1142('0x14')][_0x1142('0x15')]);return _0x443e7a(_0x39c705['error'][_0x1142('0x15')]);}logger[_0x1142('0x14')]('SquareRecording,\x20%s,\x20%s',_0x244383,_0x39c705[_0x1142('0x14')][_0x1142('0x15')]);return _0xf4c0c3(_0x39c705[_0x1142('0x14')][_0x1142('0x15')]);}else{logger[_0x1142('0xd')](_0x1142('0xe'),_0x244383,_0x1142('0x11'));_0xf4c0c3(_0x39c705[_0x1142('0x16')]['message']);}})['catch'](function(_0x57580f){logger['error'](_0x1142('0xe'),_0x244383,_0x57580f);_0x443e7a(_0x57580f);});});}exports[_0x1142('0x17')]=function(_0x6b65aa){var _0x54d2b5=this;return new Promise(function(_0x3ff083,_0x360b84){return db[_0x1142('0x18')]['create'](_0x6b65aa[_0x1142('0x19')],{'raw':_0x6b65aa[_0x1142('0x1a')]?_0x6b65aa[_0x1142('0x1a')][_0x1142('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x58bb3f){logger[_0x1142('0xd')]('CreateSquareRecording',_0x6b65aa);logger[_0x1142('0xf')](_0x1142('0x17'),_0x6b65aa,JSON['stringify'](_0x58bb3f));_0x3ff083(_0x58bb3f);})[_0x1142('0x1c')](function(_0x347254){logger[_0x1142('0x14')](_0x1142('0x17'),_0x347254[_0x1142('0x15')],_0x6b65aa);_0x360b84(_0x54d2b5['error'](0x1f4,_0x347254[_0x1142('0x15')]));});});};
\ No newline at end of file
index c42588d..75cdde1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1983=['post','create','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./squareReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x4b7391,_0x586f07){var _0x581212=function(_0x4e92c0){while(--_0x4e92c0){_0x4b7391['push'](_0x4b7391['shift']());}};_0x581212(++_0x586f07);}(_0x1983,0xe2));var _0x3198=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x1983[_0x42245d];return _0x4b211a;};'use strict';var multer=require('multer');var util=require(_0x3198('0x0'));var path=require(_0x3198('0x1'));var express=require(_0x3198('0x2'));var router=express[_0x3198('0x3')]();var auth=require(_0x3198('0x4'));var interaction=require(_0x3198('0x5'));var config=require('../../config/environment');var controller=require(_0x3198('0x6'));router[_0x3198('0x7')]('/',auth[_0x3198('0x8')](),controller[_0x3198('0x9')]);router[_0x3198('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x3198('0xa')]);router[_0x3198('0x7')](_0x3198('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x3198('0xc')]('/',auth[_0x3198('0x8')](),controller[_0x3198('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3198('0xe')](_0x3198('0xb'),auth[_0x3198('0x8')](),controller[_0x3198('0xf')]);module[_0x3198('0x10')]=router;
\ No newline at end of file
+var _0xc720=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','index','/describe','isAuthenticated','get','/:id','show','post','create','put','update','destroy','exports','multer','util','path','express','Router'];(function(_0x23de15,_0x41c632){var _0x5d88a5=function(_0x299205){while(--_0x299205){_0x23de15['push'](_0x23de15['shift']());}};_0x5d88a5(++_0x41c632);}(_0xc720,0x136));var _0x0c72=function(_0x5c35d7,_0x235be8){_0x5c35d7=_0x5c35d7-0x0;var _0x439085=_0xc720[_0x5c35d7];return _0x439085;};'use strict';var multer=require(_0x0c72('0x0'));var util=require(_0x0c72('0x1'));var path=require(_0x0c72('0x2'));var express=require(_0x0c72('0x3'));var router=express[_0x0c72('0x4')]();var auth=require(_0x0c72('0x5'));var interaction=require(_0x0c72('0x6'));var config=require(_0x0c72('0x7'));var controller=require(_0x0c72('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0c72('0x9')]);router['get'](_0x0c72('0xa'),auth[_0x0c72('0xb')](),controller['describe']);router[_0x0c72('0xc')](_0x0c72('0xd'),auth[_0x0c72('0xb')](),controller[_0x0c72('0xe')]);router[_0x0c72('0xf')]('/',auth[_0x0c72('0xb')](),controller[_0x0c72('0x10')]);router[_0x0c72('0x11')]('/:id',auth[_0x0c72('0xb')](),controller[_0x0c72('0x12')]);router['delete']('/:id',auth[_0x0c72('0xb')](),controller[_0x0c72('0x13')]);module[_0x0c72('0x14')]=router;
\ No newline at end of file
index 8640e25..04d3842 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfbe=['exports','STRING','DATE','sequelize'];(function(_0x5182f9,_0x4acf0c){var _0x4c9fad=function(_0x453b0e){while(--_0x453b0e){_0x5182f9['push'](_0x5182f9['shift']());}};_0x4c9fad(++_0x4acf0c);}(_0xdfbe,0x113));var _0xedfb=function(_0x6d92b,_0x46ce86){_0x6d92b=_0x6d92b-0x0;var _0x419eee=_0xdfbe[_0x6d92b];return _0x419eee;};'use strict';var Sequelize=require(_0xedfb('0x0'));module[_0xedfb('0x1')]={'network':{'type':Sequelize[_0xedfb('0x2')]},'network_script':{'type':Sequelize[_0xedfb('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xedfb('0x2')]},'language':{'type':Sequelize[_0xedfb('0x2')]},'type':{'type':Sequelize[_0xedfb('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xedfb('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xedfb('0x2')]},'callingpres':{'type':Sequelize[_0xedfb('0x2')]},'callingani2':{'type':Sequelize[_0xedfb('0x2')]},'callington':{'type':Sequelize[_0xedfb('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xedfb('0x2')]},'rdnis':{'type':Sequelize[_0xedfb('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xedfb('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xedfb('0x3')]},'leaveAt':{'type':Sequelize[_0xedfb('0x3')]}};
\ No newline at end of file
+var _0x9f9b=['STRING','DATE','exports'];(function(_0x1690d0,_0x54251f){var _0x3657c1=function(_0x5607ed){while(--_0x5607ed){_0x1690d0['push'](_0x1690d0['shift']());}};_0x3657c1(++_0x54251f);}(_0x9f9b,0x1e5));var _0xb9f9=function(_0x210f74,_0x450cc8){_0x210f74=_0x210f74-0x0;var _0x4f6836=_0x9f9b[_0x210f74];return _0x4f6836;};'use strict';var Sequelize=require('sequelize');module[_0xb9f9('0x0')]={'network':{'type':Sequelize[_0xb9f9('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xb9f9('0x1')]},'channel':{'type':Sequelize[_0xb9f9('0x1')]},'language':{'type':Sequelize[_0xb9f9('0x1')]},'type':{'type':Sequelize[_0xb9f9('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xb9f9('0x1')]},'callerid':{'type':Sequelize[_0xb9f9('0x1')]},'calleridname':{'type':Sequelize[_0xb9f9('0x1')]},'callingpres':{'type':Sequelize[_0xb9f9('0x1')]},'callingani2':{'type':Sequelize[_0xb9f9('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xb9f9('0x1')]},'dnid':{'type':Sequelize[_0xb9f9('0x1')]},'rdnis':{'type':Sequelize[_0xb9f9('0x1')]},'context':{'type':Sequelize[_0xb9f9('0x1')]},'extension':{'type':Sequelize[_0xb9f9('0x1')]},'priority':{'type':Sequelize[_0xb9f9('0x1')]},'enhanced':{'type':Sequelize[_0xb9f9('0x1')]},'accountcode':{'type':Sequelize[_0xb9f9('0x1')]},'threadid':{'type':Sequelize[_0xb9f9('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xb9f9('0x2')]},'leaveAt':{'type':Sequelize[_0xb9f9('0x2')]}};
\ No newline at end of file
index b7865cf..12f7449 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x499a=['create','body','update','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit','status','set','Content-Range','json','apply','reject','save','destroy','then','stack','name','SquareReport','model','keys','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','add','day','merge','filter','map','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find'];(function(_0x51493f,_0x16cdc4){var _0x249786=function(_0x37c078){while(--_0x37c078){_0x51493f['push'](_0x51493f['shift']());}};_0x249786(++_0x16cdc4);}(_0x499a,0x92));var _0xa499=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x499a[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xa499('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa499('0x1'));var zipdir=require(_0xa499('0x2'));var jsonpatch=require(_0xa499('0x3'));var rp=require(_0xa499('0x4'));var moment=require(_0xa499('0x5'));var BPromise=require(_0xa499('0x6'));var Mustache=require('mustache');var util=require(_0xa499('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa499('0x8'));var ejs=require(_0xa499('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa499('0xa'));var crypto=require(_0xa499('0xb'));var jsforce=require(_0xa499('0xc'));var deskjs=require(_0xa499('0xd'));var toCsv=require(_0xa499('0x8'));var querystring=require(_0xa499('0xe'));var Papa=require(_0xa499('0xf'));var qs=require(_0xa499('0x10'));var logger=require('../../config/logger')(_0xa499('0x11'));var utils=require(_0xa499('0x12'));var config=require(_0xa499('0x13'));var db=require(_0xa499('0x14'))['db'];function respondWithStatusCode(_0xc82e2c,_0x4f4ac6){_0x4f4ac6=_0x4f4ac6||0xcc;return function(_0x29b63f){if(_0x29b63f){return _0xc82e2c[_0xa499('0x15')](_0x4f4ac6);}return _0xc82e2c['status'](_0x4f4ac6)[_0xa499('0x16')]();};}function respondWithResult(_0x33ca42,_0x3976d5){_0x3976d5=_0x3976d5||0xc8;return function(_0x3c2723){if(_0x3c2723){return _0x33ca42['status'](_0x3976d5)['json'](_0x3c2723);}};}function respondWithFilteredResult(_0x2c17b6,_0x490347){return function(_0x14faa1){if(_0x14faa1){var _0x56f516=_0x14faa1[_0xa499('0x17')],_0x2b7917=_0x490347[_0xa499('0x18')],_0x2f87d1=_0x490347[_0xa499('0x18')]+_0x490347[_0xa499('0x19')],_0x2b02ef;if(_0x2f87d1>=_0x56f516){_0x2f87d1=_0x56f516;_0x2b02ef=0xc8;}else{_0x2b02ef=0xce;}_0x2c17b6[_0xa499('0x1a')](_0x2b02ef);return _0x2c17b6[_0xa499('0x1b')](_0xa499('0x1c'),_0x2b7917+'-'+_0x2f87d1+'/'+_0x56f516)[_0xa499('0x1d')](_0x14faa1);}return null;};}function patchUpdates(_0x232d37){return function(_0x468b86){try{jsonpatch[_0xa499('0x1e')](_0x468b86,_0x232d37,!![]);}catch(_0x34b82e){return BPromise[_0xa499('0x1f')](_0x34b82e);}return _0x468b86[_0xa499('0x20')]();};}function saveUpdates(_0x233cea,_0x315e9b){return function(_0x4d66c0){if(_0x4d66c0){return _0x4d66c0['update'](_0x233cea)['then'](function(_0x1e7247){return _0x1e7247;});}return null;};}function removeEntity(_0x4135c8,_0x895a2e){return function(_0x42ee16){if(_0x42ee16){return _0x42ee16[_0xa499('0x21')]()[_0xa499('0x22')](function(){_0x4135c8[_0xa499('0x1a')](0xcc)[_0xa499('0x16')]();});}};}function handleEntityNotFound(_0x468d8f,_0x11b49e){return function(_0x1e0df3){if(!_0x1e0df3){_0x468d8f[_0xa499('0x15')](0x194);}return _0x1e0df3;};}function handleError(_0x338534,_0x4fd262){_0x4fd262=_0x4fd262||0x1f4;return function(_0x47ddb3){logger['error'](_0x47ddb3[_0xa499('0x23')]);if(_0x47ddb3[_0xa499('0x24')]){delete _0x47ddb3[_0xa499('0x24')];}_0x338534[_0xa499('0x1a')](_0x4fd262)['send'](_0x47ddb3);};}exports['index']=function(_0x48df3a,_0xa0c9c9){var _0x44e8b3={},_0x5a5f85={},_0x439582={'count':0x0,'rows':[]};var _0x5e1da9=db[_0xa499('0x25')]['rawAttributes'];_0x5a5f85[_0xa499('0x26')]=_[_0xa499('0x27')](_0x5e1da9);var _0x4e4537={'dateStart':_0x48df3a['query'][_0xa499('0x28')],'dateEnd':_0x48df3a[_0xa499('0x29')][_0xa499('0x2a')]};delete _0x48df3a[_0xa499('0x29')][_0xa499('0x28')];delete _0x48df3a[_0xa499('0x29')][_0xa499('0x2a')];_0x5a5f85['query']=_[_0xa499('0x27')](_0x48df3a[_0xa499('0x29')]);_0x5a5f85[_0xa499('0x2b')]=_[_0xa499('0x2c')](_0x5a5f85[_0xa499('0x26')],_0x5a5f85['query']);_0x44e8b3[_0xa499('0x2d')]=_[_0xa499('0x2c')](_0x5a5f85['model'],qs[_0xa499('0x2e')](_0x48df3a[_0xa499('0x29')][_0xa499('0x2e')]));_0x44e8b3[_0xa499('0x2d')]=_0x44e8b3[_0xa499('0x2d')][_0xa499('0x2f')]?_0x44e8b3[_0xa499('0x2d')]:_0x5a5f85[_0xa499('0x26')];if(!_0x48df3a[_0xa499('0x29')][_0xa499('0x30')](_0xa499('0x31'))){_0x44e8b3[_0xa499('0x19')]=qs['limit'](_0x48df3a['query']['limit']);_0x44e8b3[_0xa499('0x18')]=qs[_0xa499('0x18')](_0x48df3a[_0xa499('0x29')][_0xa499('0x18')]);}_0x44e8b3[_0xa499('0x32')]=qs['sort'](_0x48df3a[_0xa499('0x29')][_0xa499('0x33')]);_0x44e8b3[_0xa499('0x34')]=qs[_0xa499('0x2b')](_['pick'](_0x48df3a['query'],_0x5a5f85[_0xa499('0x2b')]));if(_0x4e4537[_0xa499('0x28')]){if(_0x4e4537[_0xa499('0x2a')]){_0x4e4537[_0xa499('0x2a')]=moment(_0x4e4537['dateEnd'])[_0xa499('0x35')](0x1,'day');}else{_0x4e4537[_0xa499('0x2a')]=moment(_0x4e4537[_0xa499('0x28')])[_0xa499('0x35')](0x1,_0xa499('0x36'));}_[_0xa499('0x37')](_0x44e8b3[_0xa499('0x34')],{'createdAt':{'$gte':_0x4e4537[_0xa499('0x28')],'$lte':_0x4e4537[_0xa499('0x2a')]}});}if(_0x48df3a[_0xa499('0x29')][_0xa499('0x38')]){_0x44e8b3[_0xa499('0x34')]=_[_0xa499('0x37')](_0x44e8b3['where'],{'$or':_[_0xa499('0x39')](_0x44e8b3[_0xa499('0x2d')],function(_0x36faf3){var _0x3fa93d={};_0x3fa93d[_0x36faf3]={'$like':'%'+_0x48df3a[_0xa499('0x29')]['filter']+'%'};return _0x3fa93d;})});}_0x44e8b3=_['merge']({},_0x44e8b3,_0x48df3a['options']);var _0x1f6419={'where':_0x44e8b3[_0xa499('0x34')]};return db[_0xa499('0x25')][_0xa499('0x17')](_0x1f6419)[_0xa499('0x22')](function(_0x1d441a){_0x439582[_0xa499('0x17')]=_0x1d441a;if(_0x48df3a[_0xa499('0x29')][_0xa499('0x3a')]){_0x44e8b3[_0xa499('0x3b')]=[{'all':!![]}];}return db['SquareReport'][_0xa499('0x3c')](_0x44e8b3);})[_0xa499('0x22')](function(_0x221d0f){_0x439582[_0xa499('0x3d')]=_0x221d0f;return _0x439582;})[_0xa499('0x22')](respondWithFilteredResult(_0xa0c9c9,_0x44e8b3))[_0xa499('0x3e')](handleError(_0xa0c9c9,null));};exports['show']=function(_0x3a70e2,_0x236cde){var _0xeec408={'raw':!![],'where':{'id':_0x3a70e2[_0xa499('0x3f')]['id']}},_0x46de38={};_0x46de38['model']=_[_0xa499('0x27')](db[_0xa499('0x25')][_0xa499('0x40')]);_0x46de38[_0xa499('0x29')]=_['keys'](_0x3a70e2['query']);_0x46de38[_0xa499('0x2b')]=_[_0xa499('0x2c')](_0x46de38[_0xa499('0x26')],_0x46de38[_0xa499('0x29')]);_0xeec408['attributes']=_[_0xa499('0x2c')](_0x46de38[_0xa499('0x26')],qs[_0xa499('0x2e')](_0x3a70e2[_0xa499('0x29')][_0xa499('0x2e')]));_0xeec408[_0xa499('0x2d')]=_0xeec408['attributes'][_0xa499('0x2f')]?_0xeec408[_0xa499('0x2d')]:_0x46de38['model'];if(_0x3a70e2['query'][_0xa499('0x3a')]){_0xeec408['include']=[{'all':!![]}];}_0xeec408=_[_0xa499('0x37')]({},_0xeec408,_0x3a70e2[_0xa499('0x41')]);return db[_0xa499('0x25')][_0xa499('0x42')](_0xeec408)[_0xa499('0x22')](handleEntityNotFound(_0x236cde,null))[_0xa499('0x22')](respondWithResult(_0x236cde,null))[_0xa499('0x3e')](handleError(_0x236cde,null));};exports[_0xa499('0x43')]=function(_0x5134ed,_0x198a1c){return db[_0xa499('0x25')]['create'](_0x5134ed[_0xa499('0x44')],{})[_0xa499('0x22')](respondWithResult(_0x198a1c,0xc9))[_0xa499('0x3e')](handleError(_0x198a1c,null));};exports[_0xa499('0x45')]=function(_0x571274,_0x1996fa){if(_0x571274[_0xa499('0x44')]['id']){delete _0x571274['body']['id'];}return db['SquareReport'][_0xa499('0x42')]({'where':{'id':_0x571274[_0xa499('0x3f')]['id']}})[_0xa499('0x22')](handleEntityNotFound(_0x1996fa,null))[_0xa499('0x22')](saveUpdates(_0x571274[_0xa499('0x44')],null))[_0xa499('0x22')](respondWithResult(_0x1996fa,null))['catch'](handleError(_0x1996fa,null));};exports[_0xa499('0x21')]=function(_0x4ab212,_0x257711){return db[_0xa499('0x25')]['find']({'where':{'id':_0x4ab212['params']['id']}})[_0xa499('0x22')](handleEntityNotFound(_0x257711,null))[_0xa499('0x22')](removeEntity(_0x257711,null))[_0xa499('0x3e')](handleError(_0x257711,null));};exports[_0xa499('0x46')]=function(_0x50f578,_0x225262){return db['SquareReport'][_0xa499('0x46')]()[_0xa499('0x22')](respondWithResult(_0x225262,null))[_0xa499('0x3e')](handleError(_0x225262,null));};
\ No newline at end of file
+var _0xa69e=['../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','SquareReport','rawAttributes','model','query','dateStart','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','dateEnd','add','day','merge','where','filter','options','includeAll','include','findAll','rows','show','params','intersection','find','catch','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment'];(function(_0x434c83,_0x39fd7f){var _0x1a4893=function(_0x11241e){while(--_0x11241e){_0x434c83['push'](_0x434c83['shift']());}};_0x1a4893(++_0x39fd7f);}(_0xa69e,0x116));var _0xea69=function(_0x218655,_0x3dfeda){_0x218655=_0x218655-0x0;var _0xa674d2=_0xa69e[_0x218655];return _0xa674d2;};'use strict';var pdf=require(_0xea69('0x0'));var emlformat=require(_0xea69('0x1'));var rimraf=require(_0xea69('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea69('0x3'));var rp=require(_0xea69('0x4'));var moment=require(_0xea69('0x5'));var BPromise=require(_0xea69('0x6'));var Mustache=require(_0xea69('0x7'));var util=require(_0xea69('0x8'));var path=require(_0xea69('0x9'));var sox=require(_0xea69('0xa'));var csv=require(_0xea69('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xea69('0xc'));var crypto=require(_0xea69('0xd'));var jsforce=require(_0xea69('0xe'));var deskjs=require(_0xea69('0xf'));var toCsv=require('to-csv');var querystring=require(_0xea69('0x10'));var Papa=require(_0xea69('0x11'));var qs=require(_0xea69('0x12'));var logger=require(_0xea69('0x13'))('api');var utils=require(_0xea69('0x14'));var config=require(_0xea69('0x15'));var db=require(_0xea69('0x16'))['db'];function respondWithStatusCode(_0x2a1228,_0x5774a2){_0x5774a2=_0x5774a2||0xcc;return function(_0x1c7014){if(_0x1c7014){return _0x2a1228[_0xea69('0x17')](_0x5774a2);}return _0x2a1228[_0xea69('0x18')](_0x5774a2)['end']();};}function respondWithResult(_0x499273,_0x798f70){_0x798f70=_0x798f70||0xc8;return function(_0x4c535b){if(_0x4c535b){return _0x499273[_0xea69('0x18')](_0x798f70)[_0xea69('0x19')](_0x4c535b);}};}function respondWithFilteredResult(_0x1fa76c,_0x4785c2){return function(_0x25eb21){if(_0x25eb21){var _0x4edabf=_0x25eb21[_0xea69('0x1a')],_0xb8aad0=_0x4785c2[_0xea69('0x1b')],_0x40d4bf=_0x4785c2[_0xea69('0x1b')]+_0x4785c2[_0xea69('0x1c')],_0x1f7e85;if(_0x40d4bf>=_0x4edabf){_0x40d4bf=_0x4edabf;_0x1f7e85=0xc8;}else{_0x1f7e85=0xce;}_0x1fa76c[_0xea69('0x18')](_0x1f7e85);return _0x1fa76c['set'](_0xea69('0x1d'),_0xb8aad0+'-'+_0x40d4bf+'/'+_0x4edabf)[_0xea69('0x19')](_0x25eb21);}return null;};}function patchUpdates(_0x342be4){return function(_0x8a1371){try{jsonpatch[_0xea69('0x1e')](_0x8a1371,_0x342be4,!![]);}catch(_0x216a03){return BPromise[_0xea69('0x1f')](_0x216a03);}return _0x8a1371[_0xea69('0x20')]();};}function saveUpdates(_0xe67b43,_0x91762d){return function(_0x545c1a){if(_0x545c1a){return _0x545c1a[_0xea69('0x21')](_0xe67b43)[_0xea69('0x22')](function(_0x529091){return _0x529091;});}return null;};}function removeEntity(_0x42839b,_0x411f12){return function(_0x25d7e1){if(_0x25d7e1){return _0x25d7e1[_0xea69('0x23')]()[_0xea69('0x22')](function(){_0x42839b[_0xea69('0x18')](0xcc)[_0xea69('0x24')]();});}};}function handleEntityNotFound(_0x374c62,_0x26f181){return function(_0x59bf52){if(!_0x59bf52){_0x374c62[_0xea69('0x17')](0x194);}return _0x59bf52;};}function handleError(_0x29e6b8,_0x36e17e){_0x36e17e=_0x36e17e||0x1f4;return function(_0x3b0b56){logger[_0xea69('0x25')](_0x3b0b56[_0xea69('0x26')]);if(_0x3b0b56[_0xea69('0x27')]){delete _0x3b0b56[_0xea69('0x27')];}_0x29e6b8[_0xea69('0x18')](_0x36e17e)[_0xea69('0x28')](_0x3b0b56);};}exports[_0xea69('0x29')]=function(_0x16695b,_0x5cbb7c){var _0x510348={},_0x27eec6={},_0x8dbbfb={'count':0x0,'rows':[]};var _0x45a857=db[_0xea69('0x2a')][_0xea69('0x2b')];_0x27eec6[_0xea69('0x2c')]=_['keys'](_0x45a857);var _0x660070={'dateStart':_0x16695b[_0xea69('0x2d')]['dateStart'],'dateEnd':_0x16695b[_0xea69('0x2d')]['dateEnd']};delete _0x16695b['query'][_0xea69('0x2e')];delete _0x16695b[_0xea69('0x2d')]['dateEnd'];_0x27eec6[_0xea69('0x2d')]=_[_0xea69('0x2f')](_0x16695b[_0xea69('0x2d')]);_0x27eec6[_0xea69('0x30')]=_['intersection'](_0x27eec6[_0xea69('0x2c')],_0x27eec6[_0xea69('0x2d')]);_0x510348[_0xea69('0x31')]=_['intersection'](_0x27eec6['model'],qs[_0xea69('0x32')](_0x16695b['query']['fields']));_0x510348[_0xea69('0x31')]=_0x510348[_0xea69('0x31')][_0xea69('0x33')]?_0x510348['attributes']:_0x27eec6[_0xea69('0x2c')];if(!_0x16695b[_0xea69('0x2d')][_0xea69('0x34')](_0xea69('0x35'))){_0x510348[_0xea69('0x1c')]=qs['limit'](_0x16695b[_0xea69('0x2d')][_0xea69('0x1c')]);_0x510348[_0xea69('0x1b')]=qs['offset'](_0x16695b['query'][_0xea69('0x1b')]);}_0x510348[_0xea69('0x36')]=qs[_0xea69('0x37')](_0x16695b[_0xea69('0x2d')][_0xea69('0x37')]);_0x510348['where']=qs[_0xea69('0x30')](_['pick'](_0x16695b[_0xea69('0x2d')],_0x27eec6[_0xea69('0x30')]));if(_0x660070[_0xea69('0x2e')]){if(_0x660070[_0xea69('0x38')]){_0x660070[_0xea69('0x38')]=moment(_0x660070[_0xea69('0x38')])[_0xea69('0x39')](0x1,_0xea69('0x3a'));}else{_0x660070[_0xea69('0x38')]=moment(_0x660070['dateStart'])[_0xea69('0x39')](0x1,_0xea69('0x3a'));}_[_0xea69('0x3b')](_0x510348[_0xea69('0x3c')],{'createdAt':{'$gte':_0x660070[_0xea69('0x2e')],'$lte':_0x660070[_0xea69('0x38')]}});}if(_0x16695b[_0xea69('0x2d')][_0xea69('0x3d')]){_0x510348[_0xea69('0x3c')]=_[_0xea69('0x3b')](_0x510348[_0xea69('0x3c')],{'$or':_['map'](_0x510348['attributes'],function(_0x512d5e){var _0x4fb74e={};_0x4fb74e[_0x512d5e]={'$like':'%'+_0x16695b[_0xea69('0x2d')][_0xea69('0x3d')]+'%'};return _0x4fb74e;})});}_0x510348=_[_0xea69('0x3b')]({},_0x510348,_0x16695b[_0xea69('0x3e')]);var _0xfdbc69={'where':_0x510348[_0xea69('0x3c')]};return db[_0xea69('0x2a')][_0xea69('0x1a')](_0xfdbc69)[_0xea69('0x22')](function(_0x148716){_0x8dbbfb[_0xea69('0x1a')]=_0x148716;if(_0x16695b['query'][_0xea69('0x3f')]){_0x510348[_0xea69('0x40')]=[{'all':!![]}];}return db['SquareReport'][_0xea69('0x41')](_0x510348);})['then'](function(_0xa3cd8d){_0x8dbbfb[_0xea69('0x42')]=_0xa3cd8d;return _0x8dbbfb;})[_0xea69('0x22')](respondWithFilteredResult(_0x5cbb7c,_0x510348))['catch'](handleError(_0x5cbb7c,null));};exports[_0xea69('0x43')]=function(_0xecc8cc,_0x34e70f){var _0x4bed10={'raw':!![],'where':{'id':_0xecc8cc[_0xea69('0x44')]['id']}},_0xa45b26={};_0xa45b26['model']=_[_0xea69('0x2f')](db[_0xea69('0x2a')][_0xea69('0x2b')]);_0xa45b26[_0xea69('0x2d')]=_[_0xea69('0x2f')](_0xecc8cc[_0xea69('0x2d')]);_0xa45b26[_0xea69('0x30')]=_[_0xea69('0x45')](_0xa45b26[_0xea69('0x2c')],_0xa45b26[_0xea69('0x2d')]);_0x4bed10[_0xea69('0x31')]=_['intersection'](_0xa45b26[_0xea69('0x2c')],qs[_0xea69('0x32')](_0xecc8cc[_0xea69('0x2d')][_0xea69('0x32')]));_0x4bed10[_0xea69('0x31')]=_0x4bed10[_0xea69('0x31')][_0xea69('0x33')]?_0x4bed10[_0xea69('0x31')]:_0xa45b26[_0xea69('0x2c')];if(_0xecc8cc[_0xea69('0x2d')]['includeAll']){_0x4bed10[_0xea69('0x40')]=[{'all':!![]}];}_0x4bed10=_[_0xea69('0x3b')]({},_0x4bed10,_0xecc8cc['options']);return db[_0xea69('0x2a')][_0xea69('0x46')](_0x4bed10)[_0xea69('0x22')](handleEntityNotFound(_0x34e70f,null))[_0xea69('0x22')](respondWithResult(_0x34e70f,null))[_0xea69('0x47')](handleError(_0x34e70f,null));};exports[_0xea69('0x48')]=function(_0x13b662,_0x6ba7c6){return db[_0xea69('0x2a')][_0xea69('0x48')](_0x13b662[_0xea69('0x49')],{})[_0xea69('0x22')](respondWithResult(_0x6ba7c6,0xc9))[_0xea69('0x47')](handleError(_0x6ba7c6,null));};exports['update']=function(_0x7c54c0,_0x19d4b4){if(_0x7c54c0[_0xea69('0x49')]['id']){delete _0x7c54c0['body']['id'];}return db[_0xea69('0x2a')][_0xea69('0x46')]({'where':{'id':_0x7c54c0[_0xea69('0x44')]['id']}})[_0xea69('0x22')](handleEntityNotFound(_0x19d4b4,null))[_0xea69('0x22')](saveUpdates(_0x7c54c0[_0xea69('0x49')],null))[_0xea69('0x22')](respondWithResult(_0x19d4b4,null))[_0xea69('0x47')](handleError(_0x19d4b4,null));};exports[_0xea69('0x23')]=function(_0x4f84a4,_0x5ebc77){return db[_0xea69('0x2a')][_0xea69('0x46')]({'where':{'id':_0x4f84a4['params']['id']}})[_0xea69('0x22')](handleEntityNotFound(_0x5ebc77,null))['then'](removeEntity(_0x5ebc77,null))[_0xea69('0x47')](handleError(_0x5ebc77,null));};exports['describe']=function(_0x196a31,_0x2a3a5f){return db['SquareReport'][_0xea69('0x4a')]()[_0xea69('0x22')](respondWithResult(_0x2a3a5f,null))[_0xea69('0x47')](handleError(_0x2a3a5f,null));};
\ No newline at end of file
index ab02446..be1ecd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7927=['leaveAt','lodash','../../config/logger','api','moment','bluebird','./squareReport.attributes','SquareReport','uniqueid'];(function(_0x900397,_0x4dc033){var _0x4e1ceb=function(_0x45793b){while(--_0x45793b){_0x900397['push'](_0x900397['shift']());}};_0x4e1ceb(++_0x4dc033);}(_0x7927,0x14e));var _0x7792=function(_0x4142c5,_0x2f71ec){_0x4142c5=_0x4142c5-0x0;var _0x2a9880=_0x7927[_0x4142c5];return _0x2a9880;};'use strict';var _=require(_0x7792('0x0'));var util=require('util');var logger=require(_0x7792('0x1'))(_0x7792('0x2'));var moment=require(_0x7792('0x3'));var BPromise=require(_0x7792('0x4'));var rp=require('request-promise');var attributes=require(_0x7792('0x5'));module['exports']=function(_0x3a799f,_0x13ee00){return _0x3a799f['define'](_0x7792('0x6'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x7792('0x7'),'project_name']},{'name':_0x7792('0x8'),'fields':[_0x7792('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x52fe=['leaveAt','lodash','api','bluebird','request-promise','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x52fe,0x90));var _0xe52f=function(_0x1f831e,_0x24f4cb){_0x1f831e=_0x1f831e-0x0;var _0x481460=_0x52fe[_0x1f831e];return _0x481460;};'use strict';var _=require(_0xe52f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe52f('0x1'));var moment=require('moment');var BPromise=require(_0xe52f('0x2'));var rp=require(_0xe52f('0x3'));var attributes=require(_0xe52f('0x4'));module[_0xe52f('0x5')]=function(_0x27681b,_0x3b5c36){return _0x27681b[_0xe52f('0x6')](_0xe52f('0x7'),attributes,{'tableName':_0xe52f('0x8'),'paranoid':![],'indexes':[{'name':_0xe52f('0x9'),'fields':[_0xe52f('0xa'),_0xe52f('0xb')]},{'name':'leaveAt','fields':[_0xe52f('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index d985123..0d3f996 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bac=['message','info','result','catch','CreateSquareReport','SquareReport','body','options','raw','UpdateSquareReport','update','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareReport,\x20%s,\x20%s'];(function(_0x5dfc2a,_0x1a953f){var _0x3f1a71=function(_0x15916){while(--_0x15916){_0x5dfc2a['push'](_0x5dfc2a['shift']());}};_0x3f1a71(++_0x1a953f);}(_0x9bac,0xba));var _0xc9ba=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9bac[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xc9ba('0x0'));var util=require(_0xc9ba('0x1'));var moment=require(_0xc9ba('0x2'));var BPromise=require(_0xc9ba('0x3'));var rs=require('randomstring');var fs=require('fs');var db=require(_0xc9ba('0x4'))['db'];var utils=require(_0xc9ba('0x5'));var logger=require(_0xc9ba('0x6'))(_0xc9ba('0x7'));var config=require(_0xc9ba('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc9ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49fd93,_0xdf84d1,_0x517e76){return new BPromise(function(_0x4b28b7,_0x2075ed){return client['request'](_0x49fd93,_0x517e76)[_0xc9ba('0xa')](function(_0x9d2f92){logger['info']('SquareReport,\x20%s,\x20%s',_0xdf84d1,_0xc9ba('0xb'));logger[_0xc9ba('0xc')](_0xc9ba('0xd'),_0xdf84d1,_0xc9ba('0xb'),JSON[_0xc9ba('0xe')](_0x9d2f92));if(_0x9d2f92[_0xc9ba('0xf')]){if(_0x9d2f92['error']['code']===0x1f4){logger['error'](_0xc9ba('0x10'),_0xdf84d1,_0x9d2f92[_0xc9ba('0xf')][_0xc9ba('0x11')]);return _0x2075ed(_0x9d2f92[_0xc9ba('0xf')][_0xc9ba('0x11')]);}logger[_0xc9ba('0xf')]('SquareReport,\x20%s,\x20%s',_0xdf84d1,_0x9d2f92[_0xc9ba('0xf')][_0xc9ba('0x11')]);return _0x4b28b7(_0x9d2f92[_0xc9ba('0xf')][_0xc9ba('0x11')]);}else{logger[_0xc9ba('0x12')](_0xc9ba('0x10'),_0xdf84d1,_0xc9ba('0xb'));_0x4b28b7(_0x9d2f92[_0xc9ba('0x13')][_0xc9ba('0x11')]);}})[_0xc9ba('0x14')](function(_0x3196a0){logger[_0xc9ba('0xf')](_0xc9ba('0x10'),_0xdf84d1,_0x3196a0);_0x2075ed(_0x3196a0);});});}exports[_0xc9ba('0x15')]=function(_0x466dba){var _0x1ea626=this;return new Promise(function(_0x5a1bed,_0x4a531b){return db[_0xc9ba('0x16')]['create'](_0x466dba[_0xc9ba('0x17')],{'raw':_0x466dba[_0xc9ba('0x18')]?_0x466dba['options'][_0xc9ba('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0xeef2a4){logger['info'](_0xc9ba('0x15'),_0x466dba);logger[_0xc9ba('0xc')]('CreateSquareReport',_0x466dba,JSON[_0xc9ba('0xe')](_0xeef2a4));_0x5a1bed(_0xeef2a4);})[_0xc9ba('0x14')](function(_0x229ea8){logger[_0xc9ba('0xf')]('CreateSquareReport',_0x229ea8['message'],_0x466dba);_0x4a531b(_0x1ea626['error'](0x1f4,_0x229ea8['message']));});});};exports[_0xc9ba('0x1a')]=function(_0x2831c7){var _0x2e2246=this;return new Promise(function(_0x29bef7,_0xdc2495){return db[_0xc9ba('0x16')][_0xc9ba('0x1b')](_0x2831c7['body'],{'raw':_0x2831c7['options']?_0x2831c7['options'][_0xc9ba('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2831c7[_0xc9ba('0x18')]?_0x2831c7[_0xc9ba('0x18')]['where']||null:null,'attributes':_0x2831c7[_0xc9ba('0x18')]?_0x2831c7['options']['attributes']||null:null,'limit':_0x2831c7['options']?_0x2831c7[_0xc9ba('0x18')][_0xc9ba('0x1c')]||null:null})['then'](function(_0x48e208){logger[_0xc9ba('0x12')]('UpdateSquareReport',_0x2831c7);logger['debug'](_0xc9ba('0x1a'),_0x2831c7,JSON['stringify'](_0x48e208));_0x29bef7(_0x48e208);})[_0xc9ba('0x14')](function(_0x45071b){logger[_0xc9ba('0xf')](_0xc9ba('0x1a'),_0x45071b[_0xc9ba('0x11')],_0x2831c7);_0xdc2495(_0x2e2246[_0xc9ba('0xf')](0x1f4,_0x45071b['message']));});});};
\ No newline at end of file
+var _0x9c7c=['http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateSquareReport','create','options','info','SquareReport','update','body','raw','where','attributes','limit','debug','UpdateSquareReport','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client'];(function(_0x27f043,_0x349528){var _0x4f38d9=function(_0x28fb6b){while(--_0x28fb6b){_0x27f043['push'](_0x27f043['shift']());}};_0x4f38d9(++_0x349528);}(_0x9c7c,0x18b));var _0xc9c7=function(_0x52e2de,_0x123583){_0x52e2de=_0x52e2de-0x0;var _0x38c02d=_0x9c7c[_0x52e2de];return _0x38c02d;};'use strict';var _=require('lodash');var util=require(_0xc9c7('0x0'));var moment=require(_0xc9c7('0x1'));var BPromise=require(_0xc9c7('0x2'));var rs=require(_0xc9c7('0x3'));var fs=require('fs');var db=require(_0xc9c7('0x4'))['db'];var utils=require(_0xc9c7('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc9c7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc9c7('0x7')][_0xc9c7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x487ea6,_0x15e45f,_0x4f5a19){return new BPromise(function(_0x98ee16,_0x1197d7){return client[_0xc9c7('0x9')](_0x487ea6,_0x4f5a19)[_0xc9c7('0xa')](function(_0x4ea83a){logger['info'](_0xc9c7('0xb'),_0x15e45f,_0xc9c7('0xc'));logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x15e45f,'request\x20sent',JSON['stringify'](_0x4ea83a));if(_0x4ea83a[_0xc9c7('0xd')]){if(_0x4ea83a['error'][_0xc9c7('0xe')]===0x1f4){logger['error'](_0xc9c7('0xb'),_0x15e45f,_0x4ea83a[_0xc9c7('0xd')][_0xc9c7('0xf')]);return _0x1197d7(_0x4ea83a[_0xc9c7('0xd')][_0xc9c7('0xf')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0x15e45f,_0x4ea83a[_0xc9c7('0xd')][_0xc9c7('0xf')]);return _0x98ee16(_0x4ea83a[_0xc9c7('0xd')]['message']);}else{logger['info'](_0xc9c7('0xb'),_0x15e45f,_0xc9c7('0xc'));_0x98ee16(_0x4ea83a[_0xc9c7('0x10')]['message']);}})[_0xc9c7('0x11')](function(_0x1c86fe){logger['error'](_0xc9c7('0xb'),_0x15e45f,_0x1c86fe);_0x1197d7(_0x1c86fe);});});}exports[_0xc9c7('0x12')]=function(_0x262e42){var _0x4b4a03=this;return new Promise(function(_0x52bd84,_0x22fc35){return db['SquareReport'][_0xc9c7('0x13')](_0x262e42['body'],{'raw':_0x262e42[_0xc9c7('0x14')]?_0x262e42[_0xc9c7('0x14')]['raw']===undefined?!![]:![]:!![]})[_0xc9c7('0xa')](function(_0x6d01ab){logger[_0xc9c7('0x15')](_0xc9c7('0x12'),_0x262e42);logger['debug'](_0xc9c7('0x12'),_0x262e42,JSON['stringify'](_0x6d01ab));_0x52bd84(_0x6d01ab);})[_0xc9c7('0x11')](function(_0x1287c3){logger['error'](_0xc9c7('0x12'),_0x1287c3[_0xc9c7('0xf')],_0x262e42);_0x22fc35(_0x4b4a03['error'](0x1f4,_0x1287c3[_0xc9c7('0xf')]));});});};exports['UpdateSquareReport']=function(_0x7ef965){var _0x20c3e2=this;return new Promise(function(_0x5d2db2,_0xce1c13){return db[_0xc9c7('0x16')][_0xc9c7('0x17')](_0x7ef965[_0xc9c7('0x18')],{'raw':_0x7ef965['options']?_0x7ef965[_0xc9c7('0x14')][_0xc9c7('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7ef965['options']?_0x7ef965[_0xc9c7('0x14')][_0xc9c7('0x1a')]||null:null,'attributes':_0x7ef965[_0xc9c7('0x14')]?_0x7ef965[_0xc9c7('0x14')][_0xc9c7('0x1b')]||null:null,'limit':_0x7ef965[_0xc9c7('0x14')]?_0x7ef965[_0xc9c7('0x14')][_0xc9c7('0x1c')]||null:null})[_0xc9c7('0xa')](function(_0x4e9165){logger['info']('UpdateSquareReport',_0x7ef965);logger[_0xc9c7('0x1d')]('UpdateSquareReport',_0x7ef965,JSON['stringify'](_0x4e9165));_0x5d2db2(_0x4e9165);})[_0xc9c7('0x11')](function(_0x4d1ad6){logger[_0xc9c7('0xd')](_0xc9c7('0x1e'),_0x4d1ad6['message'],_0x7ef965);_0xce1c13(_0x20c3e2['error'](0x1f4,_0x4d1ad6[_0xc9c7('0xf')]));});});};
\ No newline at end of file
index 311c5fa..e0898cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf61a=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4048cb,_0x464c5f){var _0x5e1112=function(_0x3df805){while(--_0x3df805){_0x4048cb['push'](_0x4048cb['shift']());}};_0x5e1112(++_0x464c5f);}(_0xf61a,0x140));var _0xaf61=function(_0x29d82e,_0x4cc0d5){_0x29d82e=_0x29d82e-0x0;var _0x165f09=_0xf61a[_0x29d82e];return _0x165f09;};'use strict';var multer=require(_0xaf61('0x0'));var util=require('util');var path=require(_0xaf61('0x1'));var express=require(_0xaf61('0x2'));var router=express[_0xaf61('0x3')]();var auth=require(_0xaf61('0x4'));var interaction=require(_0xaf61('0x5'));var config=require('../../config/environment');var controller=require(_0xaf61('0x6'));router[_0xaf61('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xaf61('0x7')](_0xaf61('0x8'),auth[_0xaf61('0x9')](),controller[_0xaf61('0xa')]);router[_0xaf61('0x7')](_0xaf61('0xb'),auth['isAuthenticated'](),controller[_0xaf61('0xc')]);router[_0xaf61('0xd')]('/',auth['isAuthenticated'](),controller[_0xaf61('0xe')]);router[_0xaf61('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xaf61('0x10')]);router[_0xaf61('0x11')]('/:id',auth[_0xaf61('0x9')](),controller[_0xaf61('0x12')]);module[_0xaf61('0x13')]=router;
\ No newline at end of file
+var _0xd754=['get','isAuthenticated','index','/describe','describe','post','create','update','delete','/:id','destroy','exports','path','Router','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xd754,0x12d));var _0x4d75=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xd754[_0xefd519];return _0x4bb882;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4d75('0x0'));var express=require('express');var router=express[_0x4d75('0x1')]();var auth=require(_0x4d75('0x2'));var interaction=require(_0x4d75('0x3'));var config=require('../../config/environment');var controller=require(_0x4d75('0x4'));router[_0x4d75('0x5')]('/',auth[_0x4d75('0x6')](),controller[_0x4d75('0x7')]);router[_0x4d75('0x5')](_0x4d75('0x8'),auth['isAuthenticated'](),controller[_0x4d75('0x9')]);router[_0x4d75('0x5')]('/:id',auth[_0x4d75('0x6')](),controller['show']);router[_0x4d75('0xa')]('/',auth[_0x4d75('0x6')](),controller[_0x4d75('0xb')]);router['put']('/:id',auth[_0x4d75('0x6')](),controller[_0x4d75('0xc')]);router[_0x4d75('0xd')](_0x4d75('0xe'),auth['isAuthenticated'](),controller[_0x4d75('0xf')]);module[_0x4d75('0x10')]=router;
\ No newline at end of file
index 7ff9acc..c5373ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa7b=['TEXT','STRING'];(function(_0x5094ec,_0x1e08b5){var _0x1c8cf0=function(_0x5eff1a){while(--_0x5eff1a){_0x5094ec['push'](_0x5094ec['shift']());}};_0x1c8cf0(++_0x1e08b5);}(_0xfa7b,0x1a7));var _0xbfa7=function(_0x2226b7,_0x2a73fa){_0x2226b7=_0x2226b7-0x0;var _0x444615=_0xfa7b[_0x2226b7];return _0x444615;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xbfa7('0x0')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xbfa7('0x0')]},'data':{'type':Sequelize[_0xbfa7('0x1')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xbfa7('0x0')]}};
\ No newline at end of file
+var _0xb5d4=['sequelize','STRING'];(function(_0x2ca37e,_0x1a2794){var _0x4f48b5=function(_0xa9cf3a){while(--_0xa9cf3a){_0x2ca37e['push'](_0x2ca37e['shift']());}};_0x4f48b5(++_0x1a2794);}(_0xb5d4,0x146));var _0x4b5d=function(_0xb12c26,_0x26a2f5){_0xb12c26=_0xb12c26-0x0;var _0x2e8295=_0xb5d4[_0xb12c26];return _0x2e8295;};'use strict';var Sequelize=require(_0x4b5d('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x4b5d('0x1')]},'node':{'type':Sequelize[_0x4b5d('0x1')]},'application':{'type':Sequelize[_0x4b5d('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x4b5d('0x1')]},'callerid':{'type':Sequelize[_0x4b5d('0x1')]}};
\ No newline at end of file
index 45089a2..761a799 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ddd=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','update','then','error','name','SquareDetailsReport','rawAttributes','model','keys','query','dateEnd','dateStart','filters','attributes','intersection','fields','length','hasOwnProperty','order','where','add','day','merge','map','filter','options','include','findAll','show','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api'];(function(_0x7a7f05,_0xb2dbdf){var _0x4b8e98=function(_0x2c5d64){while(--_0x2c5d64){_0x7a7f05['push'](_0x7a7f05['shift']());}};_0x4b8e98(++_0xb2dbdf);}(_0x6ddd,0xae));var _0xd6dd=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6ddd[_0x432682];return _0x463d05;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd6dd('0x0'));var zipdir=require(_0xd6dd('0x1'));var jsonpatch=require(_0xd6dd('0x2'));var rp=require(_0xd6dd('0x3'));var moment=require('moment');var BPromise=require(_0xd6dd('0x4'));var Mustache=require('mustache');var util=require(_0xd6dd('0x5'));var path=require('path');var sox=require(_0xd6dd('0x6'));var csv=require(_0xd6dd('0x7'));var ejs=require(_0xd6dd('0x8'));var fs=require('fs');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 qs=require(_0xd6dd('0xf'));var logger=require(_0xd6dd('0x10'))(_0xd6dd('0x11'));var utils=require(_0xd6dd('0x12'));var config=require(_0xd6dd('0x13'));var db=require(_0xd6dd('0x14'))['db'];function respondWithStatusCode(_0x1c52dc,_0x1aaa1b){_0x1aaa1b=_0x1aaa1b||0xcc;return function(_0x381bdf){if(_0x381bdf){return _0x1c52dc[_0xd6dd('0x15')](_0x1aaa1b);}return _0x1c52dc['status'](_0x1aaa1b)[_0xd6dd('0x16')]();};}function respondWithResult(_0x1ddb38,_0x240b83){_0x240b83=_0x240b83||0xc8;return function(_0x19bdc1){if(_0x19bdc1){return _0x1ddb38[_0xd6dd('0x17')](_0x240b83)[_0xd6dd('0x18')](_0x19bdc1);}};}function respondWithFilteredResult(_0x302760,_0x550953){return function(_0x305928){if(_0x305928){var _0x40db91=_0x305928[_0xd6dd('0x19')],_0x32478d=_0x550953[_0xd6dd('0x1a')],_0x40febd=_0x550953[_0xd6dd('0x1a')]+_0x550953[_0xd6dd('0x1b')],_0x3381e9;if(_0x40febd>=_0x40db91){_0x40febd=_0x40db91;_0x3381e9=0xc8;}else{_0x3381e9=0xce;}_0x302760[_0xd6dd('0x17')](_0x3381e9);return _0x302760[_0xd6dd('0x1c')](_0xd6dd('0x1d'),_0x32478d+'-'+_0x40febd+'/'+_0x40db91)['json'](_0x305928);}return null;};}function patchUpdates(_0x254fb9){return function(_0x365abc){try{jsonpatch[_0xd6dd('0x1e')](_0x365abc,_0x254fb9,!![]);}catch(_0xc65e92){return BPromise['reject'](_0xc65e92);}return _0x365abc['save']();};}function saveUpdates(_0x84a5d4,_0x6945de){return function(_0x5c0fb5){if(_0x5c0fb5){return _0x5c0fb5[_0xd6dd('0x1f')](_0x84a5d4)[_0xd6dd('0x20')](function(_0x4f27dd){return _0x4f27dd;});}return null;};}function removeEntity(_0x4436c9,_0x155211){return function(_0x1786c8){if(_0x1786c8){return _0x1786c8['destroy']()[_0xd6dd('0x20')](function(){_0x4436c9[_0xd6dd('0x17')](0xcc)[_0xd6dd('0x16')]();});}};}function handleEntityNotFound(_0x4b2275,_0x436dd0){return function(_0x36b904){if(!_0x36b904){_0x4b2275[_0xd6dd('0x15')](0x194);}return _0x36b904;};}function handleError(_0x1b9275,_0x23d5bc){_0x23d5bc=_0x23d5bc||0x1f4;return function(_0x33f40b){logger[_0xd6dd('0x21')](_0x33f40b['stack']);if(_0x33f40b['name']){delete _0x33f40b[_0xd6dd('0x22')];}_0x1b9275['status'](_0x23d5bc)['send'](_0x33f40b);};}exports['index']=function(_0x3b5f94,_0x4a03a5){var _0x5274fe={},_0x5b6424={},_0x2a2253={'count':0x0,'rows':[]};var _0x17bed4=db[_0xd6dd('0x23')][_0xd6dd('0x24')];_0x5b6424[_0xd6dd('0x25')]=_[_0xd6dd('0x26')](_0x17bed4);var _0x5d9ca3={'dateStart':_0x3b5f94[_0xd6dd('0x27')]['dateStart'],'dateEnd':_0x3b5f94[_0xd6dd('0x27')][_0xd6dd('0x28')]};delete _0x3b5f94[_0xd6dd('0x27')][_0xd6dd('0x29')];delete _0x3b5f94[_0xd6dd('0x27')][_0xd6dd('0x28')];_0x5b6424[_0xd6dd('0x27')]=_[_0xd6dd('0x26')](_0x3b5f94[_0xd6dd('0x27')]);_0x5b6424[_0xd6dd('0x2a')]=_['intersection'](_0x5b6424[_0xd6dd('0x25')],_0x5b6424[_0xd6dd('0x27')]);_0x5274fe[_0xd6dd('0x2b')]=_[_0xd6dd('0x2c')](_0x5b6424[_0xd6dd('0x25')],qs['fields'](_0x3b5f94['query'][_0xd6dd('0x2d')]));_0x5274fe[_0xd6dd('0x2b')]=_0x5274fe[_0xd6dd('0x2b')][_0xd6dd('0x2e')]?_0x5274fe[_0xd6dd('0x2b')]:_0x5b6424[_0xd6dd('0x25')];if(!_0x3b5f94[_0xd6dd('0x27')][_0xd6dd('0x2f')]('nolimit')){_0x5274fe[_0xd6dd('0x1b')]=qs[_0xd6dd('0x1b')](_0x3b5f94[_0xd6dd('0x27')][_0xd6dd('0x1b')]);_0x5274fe[_0xd6dd('0x1a')]=qs[_0xd6dd('0x1a')](_0x3b5f94[_0xd6dd('0x27')]['offset']);}_0x5274fe[_0xd6dd('0x30')]=qs['sort'](_0x3b5f94[_0xd6dd('0x27')]['sort']);_0x5274fe[_0xd6dd('0x31')]=qs[_0xd6dd('0x2a')](_['pick'](_0x3b5f94[_0xd6dd('0x27')],_0x5b6424[_0xd6dd('0x2a')]));if(_0x5d9ca3['dateStart']){if(_0x5d9ca3['dateEnd']){_0x5d9ca3[_0xd6dd('0x28')]=moment(_0x5d9ca3[_0xd6dd('0x28')])[_0xd6dd('0x32')](0x1,_0xd6dd('0x33'));}else{_0x5d9ca3[_0xd6dd('0x28')]=moment(_0x5d9ca3['dateStart'])['add'](0x1,_0xd6dd('0x33'));}_[_0xd6dd('0x34')](_0x5274fe[_0xd6dd('0x31')],{'createdAt':{'$gte':_0x5d9ca3[_0xd6dd('0x29')],'$lte':_0x5d9ca3[_0xd6dd('0x28')]}});}if(_0x3b5f94[_0xd6dd('0x27')]['filter']){_0x5274fe[_0xd6dd('0x31')]=_['merge'](_0x5274fe['where'],{'$or':_[_0xd6dd('0x35')](_0x5274fe[_0xd6dd('0x2b')],function(_0x3d5372){var _0x2d037e={};_0x2d037e[_0x3d5372]={'$like':'%'+_0x3b5f94[_0xd6dd('0x27')][_0xd6dd('0x36')]+'%'};return _0x2d037e;})});}_0x5274fe=_[_0xd6dd('0x34')]({},_0x5274fe,_0x3b5f94[_0xd6dd('0x37')]);var _0x4df1bc={'where':_0x5274fe[_0xd6dd('0x31')]};return db[_0xd6dd('0x23')][_0xd6dd('0x19')](_0x4df1bc)[_0xd6dd('0x20')](function(_0x5f42fe){_0x2a2253[_0xd6dd('0x19')]=_0x5f42fe;if(_0x3b5f94[_0xd6dd('0x27')]['includeAll']){_0x5274fe[_0xd6dd('0x38')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0xd6dd('0x39')](_0x5274fe);})[_0xd6dd('0x20')](function(_0x58143a){_0x2a2253['rows']=_0x58143a;return _0x2a2253;})[_0xd6dd('0x20')](respondWithFilteredResult(_0x4a03a5,_0x5274fe))['catch'](handleError(_0x4a03a5,null));};exports[_0xd6dd('0x3a')]=function(_0xead05a,_0x13af02){var _0x55f551={'raw':!![],'where':{'id':_0xead05a[_0xd6dd('0x3b')]['id']}},_0x5a719a={};_0x5a719a[_0xd6dd('0x25')]=_[_0xd6dd('0x26')](db[_0xd6dd('0x23')][_0xd6dd('0x24')]);_0x5a719a[_0xd6dd('0x27')]=_[_0xd6dd('0x26')](_0xead05a['query']);_0x5a719a[_0xd6dd('0x2a')]=_[_0xd6dd('0x2c')](_0x5a719a[_0xd6dd('0x25')],_0x5a719a['query']);_0x55f551[_0xd6dd('0x2b')]=_[_0xd6dd('0x2c')](_0x5a719a[_0xd6dd('0x25')],qs[_0xd6dd('0x2d')](_0xead05a[_0xd6dd('0x27')][_0xd6dd('0x2d')]));_0x55f551[_0xd6dd('0x2b')]=_0x55f551[_0xd6dd('0x2b')]['length']?_0x55f551[_0xd6dd('0x2b')]:_0x5a719a[_0xd6dd('0x25')];if(_0xead05a[_0xd6dd('0x27')]['includeAll']){_0x55f551[_0xd6dd('0x38')]=[{'all':!![]}];}_0x55f551=_[_0xd6dd('0x34')]({},_0x55f551,_0xead05a[_0xd6dd('0x37')]);return db['SquareDetailsReport'][_0xd6dd('0x3c')](_0x55f551)[_0xd6dd('0x20')](handleEntityNotFound(_0x13af02,null))[_0xd6dd('0x20')](respondWithResult(_0x13af02,null))[_0xd6dd('0x3d')](handleError(_0x13af02,null));};exports[_0xd6dd('0x3e')]=function(_0x31dfc3,_0x51081c){return db[_0xd6dd('0x23')][_0xd6dd('0x3e')](_0x31dfc3[_0xd6dd('0x3f')],{})[_0xd6dd('0x20')](respondWithResult(_0x51081c,0xc9))[_0xd6dd('0x3d')](handleError(_0x51081c,null));};exports['update']=function(_0x36640e,_0x153c82){if(_0x36640e['body']['id']){delete _0x36640e[_0xd6dd('0x3f')]['id'];}return db[_0xd6dd('0x23')][_0xd6dd('0x3c')]({'where':{'id':_0x36640e['params']['id']}})[_0xd6dd('0x20')](handleEntityNotFound(_0x153c82,null))[_0xd6dd('0x20')](saveUpdates(_0x36640e[_0xd6dd('0x3f')],null))[_0xd6dd('0x20')](respondWithResult(_0x153c82,null))[_0xd6dd('0x3d')](handleError(_0x153c82,null));};exports['destroy']=function(_0x28fa73,_0x4feaab){return db['SquareDetailsReport'][_0xd6dd('0x3c')]({'where':{'id':_0x28fa73[_0xd6dd('0x3b')]['id']}})[_0xd6dd('0x20')](handleEntityNotFound(_0x4feaab,null))[_0xd6dd('0x20')](removeEntity(_0x4feaab,null))[_0xd6dd('0x3d')](handleError(_0x4feaab,null));};exports['describe']=function(_0x5ad5bd,_0x14633f){return db[_0xd6dd('0x23')]['describe']()[_0xd6dd('0x20')](respondWithResult(_0x14633f,null))[_0xd6dd('0x3d')](handleError(_0x14633f,null));};
\ No newline at end of file
+var _0x0bde=['findAll','show','params','length','create','body','catch','find','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','update','then','destroy','stack','name','index','rawAttributes','model','query','dateStart','dateEnd','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','day','add','merge','map','filter','SquareDetailsReport','includeAll'];(function(_0x228c80,_0x567133){var _0x380ec3=function(_0x4c04f5){while(--_0x4c04f5){_0x228c80['push'](_0x228c80['shift']());}};_0x380ec3(++_0x567133);}(_0x0bde,0x110));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0xe0bd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe0bd('0x1'));var zipdir=require(_0xe0bd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0bd('0x3'));var moment=require(_0xe0bd('0x4'));var BPromise=require(_0xe0bd('0x5'));var Mustache=require('mustache');var util=require(_0xe0bd('0x6'));var path=require(_0xe0bd('0x7'));var sox=require(_0xe0bd('0x8'));var csv=require(_0xe0bd('0x9'));var ejs=require(_0xe0bd('0xa'));var fs=require('fs');var _=require(_0xe0bd('0xb'));var squel=require(_0xe0bd('0xc'));var crypto=require(_0xe0bd('0xd'));var jsforce=require(_0xe0bd('0xe'));var deskjs=require(_0xe0bd('0xf'));var toCsv=require(_0xe0bd('0x9'));var querystring=require(_0xe0bd('0x10'));var Papa=require(_0xe0bd('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0xe0bd('0x12'))(_0xe0bd('0x13'));var utils=require('../../config/utils');var config=require(_0xe0bd('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x175f8a,_0x3b6752){_0x3b6752=_0x3b6752||0xcc;return function(_0x3cc36c){if(_0x3cc36c){return _0x175f8a[_0xe0bd('0x15')](_0x3b6752);}return _0x175f8a[_0xe0bd('0x16')](_0x3b6752)[_0xe0bd('0x17')]();};}function respondWithResult(_0x1905b2,_0x500a9e){_0x500a9e=_0x500a9e||0xc8;return function(_0xadea83){if(_0xadea83){return _0x1905b2[_0xe0bd('0x16')](_0x500a9e)[_0xe0bd('0x18')](_0xadea83);}};}function respondWithFilteredResult(_0x5c76f1,_0x479438){return function(_0x48afde){if(_0x48afde){var _0x1858b8=_0x48afde[_0xe0bd('0x19')],_0x234c34=_0x479438[_0xe0bd('0x1a')],_0x3f5ef7=_0x479438[_0xe0bd('0x1a')]+_0x479438[_0xe0bd('0x1b')],_0x3042e1;if(_0x3f5ef7>=_0x1858b8){_0x3f5ef7=_0x1858b8;_0x3042e1=0xc8;}else{_0x3042e1=0xce;}_0x5c76f1['status'](_0x3042e1);return _0x5c76f1['set'](_0xe0bd('0x1c'),_0x234c34+'-'+_0x3f5ef7+'/'+_0x1858b8)[_0xe0bd('0x18')](_0x48afde);}return null;};}function patchUpdates(_0x1c4533){return function(_0x100b8f){try{jsonpatch[_0xe0bd('0x1d')](_0x100b8f,_0x1c4533,!![]);}catch(_0x2a015c){return BPromise['reject'](_0x2a015c);}return _0x100b8f['save']();};}function saveUpdates(_0x29bd21,_0x1edb3d){return function(_0x1187cf){if(_0x1187cf){return _0x1187cf[_0xe0bd('0x1e')](_0x29bd21)[_0xe0bd('0x1f')](function(_0x154480){return _0x154480;});}return null;};}function removeEntity(_0x3dbd98,_0x572c25){return function(_0x5ad8bf){if(_0x5ad8bf){return _0x5ad8bf[_0xe0bd('0x20')]()[_0xe0bd('0x1f')](function(){_0x3dbd98[_0xe0bd('0x16')](0xcc)[_0xe0bd('0x17')]();});}};}function handleEntityNotFound(_0x290c1e,_0x4ac6b7){return function(_0x30442f){if(!_0x30442f){_0x290c1e['sendStatus'](0x194);}return _0x30442f;};}function handleError(_0x242cbe,_0x296f64){_0x296f64=_0x296f64||0x1f4;return function(_0x3f24b6){logger['error'](_0x3f24b6[_0xe0bd('0x21')]);if(_0x3f24b6[_0xe0bd('0x22')]){delete _0x3f24b6['name'];}_0x242cbe[_0xe0bd('0x16')](_0x296f64)['send'](_0x3f24b6);};}exports[_0xe0bd('0x23')]=function(_0x54d1d0,_0x198a1c){var _0x72e284={},_0x3c851d={},_0x53a727={'count':0x0,'rows':[]};var _0x3ee9bf=db['SquareDetailsReport'][_0xe0bd('0x24')];_0x3c851d[_0xe0bd('0x25')]=_['keys'](_0x3ee9bf);var _0x54bc12={'dateStart':_0x54d1d0[_0xe0bd('0x26')][_0xe0bd('0x27')],'dateEnd':_0x54d1d0[_0xe0bd('0x26')][_0xe0bd('0x28')]};delete _0x54d1d0[_0xe0bd('0x26')][_0xe0bd('0x27')];delete _0x54d1d0[_0xe0bd('0x26')]['dateEnd'];_0x3c851d[_0xe0bd('0x26')]=_[_0xe0bd('0x29')](_0x54d1d0[_0xe0bd('0x26')]);_0x3c851d[_0xe0bd('0x2a')]=_[_0xe0bd('0x2b')](_0x3c851d[_0xe0bd('0x25')],_0x3c851d['query']);_0x72e284[_0xe0bd('0x2c')]=_[_0xe0bd('0x2b')](_0x3c851d[_0xe0bd('0x25')],qs[_0xe0bd('0x2d')](_0x54d1d0[_0xe0bd('0x26')][_0xe0bd('0x2d')]));_0x72e284[_0xe0bd('0x2c')]=_0x72e284[_0xe0bd('0x2c')]['length']?_0x72e284['attributes']:_0x3c851d[_0xe0bd('0x25')];if(!_0x54d1d0[_0xe0bd('0x26')][_0xe0bd('0x2e')](_0xe0bd('0x2f'))){_0x72e284[_0xe0bd('0x1b')]=qs['limit'](_0x54d1d0['query']['limit']);_0x72e284[_0xe0bd('0x1a')]=qs[_0xe0bd('0x1a')](_0x54d1d0[_0xe0bd('0x26')][_0xe0bd('0x1a')]);}_0x72e284[_0xe0bd('0x30')]=qs[_0xe0bd('0x31')](_0x54d1d0['query'][_0xe0bd('0x31')]);_0x72e284[_0xe0bd('0x32')]=qs[_0xe0bd('0x2a')](_['pick'](_0x54d1d0[_0xe0bd('0x26')],_0x3c851d[_0xe0bd('0x2a')]));if(_0x54bc12['dateStart']){if(_0x54bc12[_0xe0bd('0x28')]){_0x54bc12[_0xe0bd('0x28')]=moment(_0x54bc12[_0xe0bd('0x28')])['add'](0x1,_0xe0bd('0x33'));}else{_0x54bc12['dateEnd']=moment(_0x54bc12[_0xe0bd('0x27')])[_0xe0bd('0x34')](0x1,_0xe0bd('0x33'));}_[_0xe0bd('0x35')](_0x72e284['where'],{'createdAt':{'$gte':_0x54bc12[_0xe0bd('0x27')],'$lte':_0x54bc12[_0xe0bd('0x28')]}});}if(_0x54d1d0[_0xe0bd('0x26')]['filter']){_0x72e284['where']=_[_0xe0bd('0x35')](_0x72e284[_0xe0bd('0x32')],{'$or':_[_0xe0bd('0x36')](_0x72e284['attributes'],function(_0x5cc98d){var _0x42a725={};_0x42a725[_0x5cc98d]={'$like':'%'+_0x54d1d0[_0xe0bd('0x26')][_0xe0bd('0x37')]+'%'};return _0x42a725;})});}_0x72e284=_[_0xe0bd('0x35')]({},_0x72e284,_0x54d1d0['options']);var _0x276ed3={'where':_0x72e284[_0xe0bd('0x32')]};return db[_0xe0bd('0x38')]['count'](_0x276ed3)['then'](function(_0x23f66a){_0x53a727[_0xe0bd('0x19')]=_0x23f66a;if(_0x54d1d0[_0xe0bd('0x26')][_0xe0bd('0x39')]){_0x72e284['include']=[{'all':!![]}];}return db[_0xe0bd('0x38')][_0xe0bd('0x3a')](_0x72e284);})[_0xe0bd('0x1f')](function(_0x568ff1){_0x53a727['rows']=_0x568ff1;return _0x53a727;})[_0xe0bd('0x1f')](respondWithFilteredResult(_0x198a1c,_0x72e284))['catch'](handleError(_0x198a1c,null));};exports[_0xe0bd('0x3b')]=function(_0x2f5a60,_0x4a5ecc){var _0x37240a={'raw':!![],'where':{'id':_0x2f5a60[_0xe0bd('0x3c')]['id']}},_0x25bc13={};_0x25bc13['model']=_[_0xe0bd('0x29')](db[_0xe0bd('0x38')][_0xe0bd('0x24')]);_0x25bc13[_0xe0bd('0x26')]=_[_0xe0bd('0x29')](_0x2f5a60[_0xe0bd('0x26')]);_0x25bc13[_0xe0bd('0x2a')]=_[_0xe0bd('0x2b')](_0x25bc13['model'],_0x25bc13[_0xe0bd('0x26')]);_0x37240a[_0xe0bd('0x2c')]=_[_0xe0bd('0x2b')](_0x25bc13[_0xe0bd('0x25')],qs[_0xe0bd('0x2d')](_0x2f5a60[_0xe0bd('0x26')][_0xe0bd('0x2d')]));_0x37240a[_0xe0bd('0x2c')]=_0x37240a['attributes'][_0xe0bd('0x3d')]?_0x37240a[_0xe0bd('0x2c')]:_0x25bc13[_0xe0bd('0x25')];if(_0x2f5a60[_0xe0bd('0x26')][_0xe0bd('0x39')]){_0x37240a['include']=[{'all':!![]}];}_0x37240a=_[_0xe0bd('0x35')]({},_0x37240a,_0x2f5a60['options']);return db['SquareDetailsReport']['find'](_0x37240a)[_0xe0bd('0x1f')](handleEntityNotFound(_0x4a5ecc,null))['then'](respondWithResult(_0x4a5ecc,null))['catch'](handleError(_0x4a5ecc,null));};exports[_0xe0bd('0x3e')]=function(_0x3628c4,_0x2341b6){return db[_0xe0bd('0x38')][_0xe0bd('0x3e')](_0x3628c4[_0xe0bd('0x3f')],{})[_0xe0bd('0x1f')](respondWithResult(_0x2341b6,0xc9))[_0xe0bd('0x40')](handleError(_0x2341b6,null));};exports[_0xe0bd('0x1e')]=function(_0x252013,_0x4feafa){if(_0x252013[_0xe0bd('0x3f')]['id']){delete _0x252013['body']['id'];}return db['SquareDetailsReport'][_0xe0bd('0x41')]({'where':{'id':_0x252013[_0xe0bd('0x3c')]['id']}})[_0xe0bd('0x1f')](handleEntityNotFound(_0x4feafa,null))['then'](saveUpdates(_0x252013[_0xe0bd('0x3f')],null))[_0xe0bd('0x1f')](respondWithResult(_0x4feafa,null))[_0xe0bd('0x40')](handleError(_0x4feafa,null));};exports[_0xe0bd('0x20')]=function(_0x1e4698,_0x3ae70c){return db[_0xe0bd('0x38')][_0xe0bd('0x41')]({'where':{'id':_0x1e4698[_0xe0bd('0x3c')]['id']}})[_0xe0bd('0x1f')](handleEntityNotFound(_0x3ae70c,null))[_0xe0bd('0x1f')](removeEntity(_0x3ae70c,null))[_0xe0bd('0x40')](handleError(_0x3ae70c,null));};exports['describe']=function(_0x1a62ce,_0xa761ae){return db['SquareDetailsReport']['describe']()['then'](respondWithResult(_0xa761ae,null))[_0xe0bd('0x40')](handleError(_0xa761ae,null));};
\ No newline at end of file
index 63bc8f2..6278582 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b43=['bluebird','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment'];(function(_0x4cc765,_0x136732){var _0x5e4a03=function(_0x4042e5){while(--_0x4042e5){_0x4cc765['push'](_0x4cc765['shift']());}};_0x5e4a03(++_0x136732);}(_0x3b43,0xab));var _0x33b4=function(_0x4f8ca4,_0x33674c){_0x4f8ca4=_0x4f8ca4-0x0;var _0x6ab5ff=_0x3b43[_0x4f8ca4];return _0x6ab5ff;};'use strict';var _=require(_0x33b4('0x0'));var util=require(_0x33b4('0x1'));var logger=require(_0x33b4('0x2'))(_0x33b4('0x3'));var moment=require(_0x33b4('0x4'));var BPromise=require(_0x33b4('0x5'));var rp=require('request-promise');var attributes=require(_0x33b4('0x6'));module[_0x33b4('0x7')]=function(_0x27250f,_0x34cf69){return _0x27250f[_0x33b4('0x8')](_0x33b4('0x9'),attributes,{'tableName':_0x33b4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb99e=['api','moment','bluebird','request-promise','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger'];(function(_0x1306c6,_0x428e48){var _0x3ab7bf=function(_0x3e1e4f){while(--_0x3e1e4f){_0x1306c6['push'](_0x1306c6['shift']());}};_0x3ab7bf(++_0x428e48);}(_0xb99e,0x1ad));var _0xeb99=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb99e[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xeb99('0x0'));var util=require(_0xeb99('0x1'));var logger=require(_0xeb99('0x2'))(_0xeb99('0x3'));var moment=require(_0xeb99('0x4'));var BPromise=require(_0xeb99('0x5'));var rp=require(_0xeb99('0x6'));var attributes=require(_0xeb99('0x7'));module[_0xeb99('0x8')]=function(_0x2cfcee,_0x235730){return _0x2cfcee[_0xeb99('0x9')](_0xeb99('0xa'),attributes,{'tableName':_0xeb99('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 515dcce..ea055ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','then','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x153a1a,_0x239606){var _0xb51f4f=function(_0x5b0468){while(--_0x5b0468){_0x153a1a['push'](_0x153a1a['shift']());}};_0xb51f4f(++_0x239606);}(_0x7a54,0x106));var _0x47a5=function(_0x18727e,_0x4caa9f){_0x18727e=_0x18727e-0x0;var _0x10398b=_0x7a54[_0x18727e];return _0x10398b;};'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 db=require(_0x47a5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var jayson=require(_0x47a5('0x8'));var client=jayson[_0x47a5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d5629,_0x59199c,_0x343372){return new BPromise(function(_0x30e405,_0x506eda){return client[_0x47a5('0xa')](_0x3d5629,_0x343372)['then'](function(_0x5d90b3){logger['info'](_0x47a5('0xb'),_0x59199c,_0x47a5('0xc'));logger['debug'](_0x47a5('0xd'),_0x59199c,'request\x20sent',JSON['stringify'](_0x5d90b3));if(_0x5d90b3[_0x47a5('0xe')]){if(_0x5d90b3[_0x47a5('0xe')][_0x47a5('0xf')]===0x1f4){logger[_0x47a5('0xe')](_0x47a5('0xb'),_0x59199c,_0x5d90b3[_0x47a5('0xe')][_0x47a5('0x10')]);return _0x506eda(_0x5d90b3['error'][_0x47a5('0x10')]);}logger[_0x47a5('0xe')](_0x47a5('0xb'),_0x59199c,_0x5d90b3[_0x47a5('0xe')][_0x47a5('0x10')]);return _0x30e405(_0x5d90b3[_0x47a5('0xe')][_0x47a5('0x10')]);}else{logger[_0x47a5('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x59199c,_0x47a5('0xc'));_0x30e405(_0x5d90b3[_0x47a5('0x12')][_0x47a5('0x10')]);}})[_0x47a5('0x13')](function(_0x1ef44c){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x59199c,_0x1ef44c);_0x506eda(_0x1ef44c);});});}exports[_0x47a5('0x14')]=function(_0x4b966e){var _0x5247fd=this;return new Promise(function(_0x423a81,_0xaf70a6){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x4b966e[_0x47a5('0x17')],{'raw':_0x4b966e[_0x47a5('0x18')]?_0x4b966e[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})[_0x47a5('0x1a')](function(_0x4a9fcb){logger[_0x47a5('0x11')](_0x47a5('0x14'),_0x4b966e);logger['debug'](_0x47a5('0x14'),_0x4b966e,JSON[_0x47a5('0x1b')](_0x4a9fcb));_0x423a81(_0x4a9fcb);})[_0x47a5('0x13')](function(_0x4c5910){logger[_0x47a5('0xe')](_0x47a5('0x14'),_0x4c5910[_0x47a5('0x10')],_0x4b966e);_0xaf70a6(_0x5247fd[_0x47a5('0xe')](0x1f4,_0x4c5910['message']));});});};
\ No newline at end of file
+var _0x7a54=['result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','then','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x50710e,_0x3e4e67){var _0x43ba1e=function(_0x129380){while(--_0x129380){_0x50710e['push'](_0x50710e['shift']());}};_0x43ba1e(++_0x3e4e67);}(_0x7a54,0x106));var _0x47a5=function(_0x78a0ca,_0x414596){_0x78a0ca=_0x78a0ca-0x0;var _0x39b91b=_0x7a54[_0x78a0ca];return _0x39b91b;};'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 db=require(_0x47a5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var jayson=require(_0x47a5('0x8'));var client=jayson[_0x47a5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d5629,_0x59199c,_0x343372){return new BPromise(function(_0x30e405,_0x506eda){return client[_0x47a5('0xa')](_0x3d5629,_0x343372)['then'](function(_0x5d90b3){logger['info'](_0x47a5('0xb'),_0x59199c,_0x47a5('0xc'));logger['debug'](_0x47a5('0xd'),_0x59199c,'request\x20sent',JSON['stringify'](_0x5d90b3));if(_0x5d90b3[_0x47a5('0xe')]){if(_0x5d90b3[_0x47a5('0xe')][_0x47a5('0xf')]===0x1f4){logger[_0x47a5('0xe')](_0x47a5('0xb'),_0x59199c,_0x5d90b3[_0x47a5('0xe')][_0x47a5('0x10')]);return _0x506eda(_0x5d90b3['error'][_0x47a5('0x10')]);}logger[_0x47a5('0xe')](_0x47a5('0xb'),_0x59199c,_0x5d90b3[_0x47a5('0xe')][_0x47a5('0x10')]);return _0x30e405(_0x5d90b3[_0x47a5('0xe')][_0x47a5('0x10')]);}else{logger[_0x47a5('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x59199c,_0x47a5('0xc'));_0x30e405(_0x5d90b3[_0x47a5('0x12')][_0x47a5('0x10')]);}})[_0x47a5('0x13')](function(_0x1ef44c){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x59199c,_0x1ef44c);_0x506eda(_0x1ef44c);});});}exports[_0x47a5('0x14')]=function(_0x4b966e){var _0x5247fd=this;return new Promise(function(_0x423a81,_0xaf70a6){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x4b966e[_0x47a5('0x17')],{'raw':_0x4b966e[_0x47a5('0x18')]?_0x4b966e[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})[_0x47a5('0x1a')](function(_0x4a9fcb){logger[_0x47a5('0x11')](_0x47a5('0x14'),_0x4b966e);logger['debug'](_0x47a5('0x14'),_0x4b966e,JSON[_0x47a5('0x1b')](_0x4a9fcb));_0x423a81(_0x4a9fcb);})[_0x47a5('0x13')](function(_0x4c5910){logger[_0x47a5('0xe')](_0x47a5('0x14'),_0x4c5910[_0x47a5('0x10')],_0x4b966e);_0xaf70a6(_0x5247fd[_0x47a5('0xe')](0x1f4,_0x4c5910['message']));});});};
\ No newline at end of file
index 569414e..d63b141 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c73=['/process/:pid/kill','killProcess','Router','./system.controller','get','isAuthenticated','index'];(function(_0x4f3c9b,_0x28e078){var _0x84e58a=function(_0x37bf49){while(--_0x37bf49){_0x4f3c9b['push'](_0x4f3c9b['shift']());}};_0x84e58a(++_0x28e078);}(_0x8c73,0x183));var _0x38c7=function(_0x3970a3,_0x5978fe){_0x3970a3=_0x3970a3-0x0;var _0x2b7af4=_0x8c73[_0x3970a3];return _0x2b7af4;};'use strict';var express=require('express');var router=express[_0x38c7('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x38c7('0x1'));router[_0x38c7('0x2')]('/',auth[_0x38c7('0x3')](),controller[_0x38c7('0x4')]);router[_0x38c7('0x2')](_0x38c7('0x5'),auth[_0x38c7('0x3')](),controller[_0x38c7('0x6')]);module['exports']=router;
\ No newline at end of file
+var _0x4f95=['get','index','/process/:pid/kill','isAuthenticated','killProcess','exports','express','Router','./system.controller'];(function(_0x3ef124,_0x1f34f9){var _0x8aa83b=function(_0x4329d1){while(--_0x4329d1){_0x3ef124['push'](_0x3ef124['shift']());}};_0x8aa83b(++_0x1f34f9);}(_0x4f95,0x9f));var _0x54f9=function(_0x54e8ac,_0x3a1d5f){_0x54e8ac=_0x54e8ac-0x0;var _0x5a16c3=_0x4f95[_0x54e8ac];return _0x5a16c3;};'use strict';var express=require(_0x54f9('0x0'));var router=express[_0x54f9('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x54f9('0x2'));router[_0x54f9('0x3')]('/',auth['isAuthenticated'](),controller[_0x54f9('0x4')]);router[_0x54f9('0x3')](_0x54f9('0x5'),auth[_0x54f9('0x6')](),controller[_0x54f9('0x7')]);module[_0x54f9('0x8')]=router;
\ No newline at end of file
index 37442cc..8529078 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98eb=['bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','json','catch','killProcess','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','then','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','format','Process\x20with\x20pid\x20%s\x20killed\x20correctly','pid','systeminformation','child_process','exec','../../config/logger','api','util'];(function(_0x17bffe,_0x586e60){var _0x2b2624=function(_0x4ef798){while(--_0x4ef798){_0x17bffe['push'](_0x17bffe['shift']());}};_0x2b2624(++_0x586e60);}(_0x98eb,0x14f));var _0xb98e=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x98eb[_0x2112d4];return _0x434972;};'use strict';var info=require(_0xb98e('0x0'));var exec=require(_0xb98e('0x1'))[_0xb98e('0x2')];var logger=require(_0xb98e('0x3'))(_0xb98e('0x4'));var util=require(_0xb98e('0x5'));var BPromise=require(_0xb98e('0x6'));var _=require(_0xb98e('0x7'));function handleError(_0x2b9cc2,_0x274689,_0x4c8ff5){_0x274689=_0x274689||0x1f4;return function(_0x54789a){logger[_0xb98e('0x8')](_0xb98e('0x9'),_0x4c8ff5,_0x274689,util[_0xb98e('0xa')](_0x54789a,{'showHidden':![],'depth':null}));delete _0x54789a[_0xb98e('0xb')];_0x2b9cc2[_0xb98e('0xc')](_0x274689)[_0xb98e('0xd')](_0x54789a);};}exports[_0xb98e('0xe')]=function(_0x17321f,_0x4b5e9f){return info[_0xb98e('0xf')]()['then'](function(_0x4fb76a){return _0x4b5e9f[_0xb98e('0xc')](0xc8)[_0xb98e('0x10')](_0x4fb76a);})[_0xb98e('0x11')](function(_0x63280e){return _0x4b5e9f['status'](0x1f4)['json'](_0x63280e);});};exports[_0xb98e('0x12')]=function(_0x2e9bb9,_0xb5f107){var _0x6fc55a=['components/import/cm'];return new BPromise(function(_0x2fb57f,_0x52d1b6){return exec(util['format'](_0xb98e('0x13'),_0x2e9bb9[_0xb98e('0x14')]['pid']),function(_0xa56d0e,_0x36cce0,_0x720b0a){if(_0xa56d0e){return _0x52d1b6(_0xa56d0e);}return _0x2fb57f(_0x36cce0);});})[_0xb98e('0x15')](function(_0x12708c){var _0x267e24=![];var _0x405673=_0x12708c[_0xb98e('0x16')](/\n/);for(var _0x11d14b=0x0,_0x3e86f0=_0x6fc55a[_0xb98e('0x17')];_0x11d14b<_0x3e86f0,_0x267e24===![];_0x11d14b+=0x1){if(_0x12708c[_0xb98e('0x18')](_0x6fc55a[_0x11d14b])>=0x0){_0x267e24=!![];}}if(!_0x267e24){throw new Error(util['format'](_0xb98e('0x19'),_0x2e9bb9[_0xb98e('0x14')]['pid']));}process[_0xb98e('0x1a')](_0x2e9bb9[_0xb98e('0x14')]['pid'],_0xb98e('0x1b'));return _0xb5f107[_0xb98e('0xc')](0xc8)[_0xb98e('0x10')]({'message':util[_0xb98e('0x1c')](_0xb98e('0x1d'),_0x2e9bb9[_0xb98e('0x14')][_0xb98e('0x1e')])});})[_0xb98e('0x11')](handleError(_0xb5f107,null,_0xb98e('0x12')));};
\ No newline at end of file
+var _0x7fb1=['error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','index','getAllData','then','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','kill','SIGINT','json','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash'];(function(_0x494315,_0x2d42bd){var _0x49cc18=function(_0x419de9){while(--_0x419de9){_0x494315['push'](_0x494315['shift']());}};_0x49cc18(++_0x2d42bd);}(_0x7fb1,0x1b2));var _0x17fb=function(_0x41af7c,_0x1ffcfa){_0x41af7c=_0x41af7c-0x0;var _0x3ee1a2=_0x7fb1[_0x41af7c];return _0x3ee1a2;};'use strict';var info=require(_0x17fb('0x0'));var exec=require(_0x17fb('0x1'))[_0x17fb('0x2')];var logger=require(_0x17fb('0x3'))(_0x17fb('0x4'));var util=require(_0x17fb('0x5'));var BPromise=require(_0x17fb('0x6'));var _=require(_0x17fb('0x7'));function handleError(_0x2e93ac,_0x1a62ce,_0x4163ea){_0x1a62ce=_0x1a62ce||0x1f4;return function(_0x229583){logger[_0x17fb('0x8')](_0x17fb('0x9'),_0x4163ea,_0x1a62ce,util['inspect'](_0x229583,{'showHidden':![],'depth':null}));delete _0x229583[_0x17fb('0xa')];_0x2e93ac[_0x17fb('0xb')](_0x1a62ce)[_0x17fb('0xc')](_0x229583);};}exports[_0x17fb('0xd')]=function(_0x4f27ff,_0x5f1667){return info[_0x17fb('0xe')]()[_0x17fb('0xf')](function(_0x2b3306){return _0x5f1667[_0x17fb('0xb')](0xc8)['json'](_0x2b3306);})['catch'](function(_0x4db04c){return _0x5f1667[_0x17fb('0xb')](0x1f4)['json'](_0x4db04c);});};exports['killProcess']=function(_0x15e464,_0x52bcb9){var _0x5ac9c1=['components/import/cm'];return new BPromise(function(_0x4eb2a5,_0x4a7080){return exec(util[_0x17fb('0x10')](_0x17fb('0x11'),_0x15e464[_0x17fb('0x12')][_0x17fb('0x13')]),function(_0xe6c0f1,_0x517248,_0x8f85dd){if(_0xe6c0f1){return _0x4a7080(_0xe6c0f1);}return _0x4eb2a5(_0x517248);});})[_0x17fb('0xf')](function(_0x1a090c){var _0x5c5802=![];var _0x3d7e7a=_0x1a090c['split'](/\n/);for(var _0x2f2b1d=0x0,_0x2fd910=_0x5ac9c1[_0x17fb('0x14')];_0x2f2b1d<_0x2fd910,_0x5c5802===![];_0x2f2b1d+=0x1){if(_0x1a090c['indexOf'](_0x5ac9c1[_0x2f2b1d])>=0x0){_0x5c5802=!![];}}if(!_0x5c5802){throw new Error(util[_0x17fb('0x10')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x15e464[_0x17fb('0x12')][_0x17fb('0x13')]));}process[_0x17fb('0x15')](_0x15e464[_0x17fb('0x12')][_0x17fb('0x13')],_0x17fb('0x16'));return _0x52bcb9[_0x17fb('0xb')](0xc8)[_0x17fb('0x17')]({'message':util[_0x17fb('0x10')](_0x17fb('0x18'),_0x15e464[_0x17fb('0x12')][_0x17fb('0x13')])});})[_0x17fb('0x19')](handleError(_0x52bcb9,null,'killProcess'));};
\ No newline at end of file
index 05ebc40..aac4dc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe39c=['update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./tag.controller','get','/:id','isAuthenticated','show','post','create'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe39c,0x135));var _0xce39=function(_0x24a784,_0xf67f1a){_0x24a784=_0x24a784-0x0;var _0x382849=_0xe39c[_0x24a784];return _0x382849;};'use strict';var multer=require(_0xce39('0x0'));var util=require(_0xce39('0x1'));var path=require(_0xce39('0x2'));var express=require(_0xce39('0x3'));var router=express[_0xce39('0x4')]();var auth=require(_0xce39('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xce39('0x6'));var controller=require(_0xce39('0x7'));router[_0xce39('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xce39('0x8')](_0xce39('0x9'),auth[_0xce39('0xa')](),controller[_0xce39('0xb')]);router[_0xce39('0xc')]('/',auth['isAuthenticated'](),controller[_0xce39('0xd')]);router['put'](_0xce39('0x9'),auth[_0xce39('0xa')](),controller[_0xce39('0xe')]);router[_0xce39('0xf')]('/:id',auth[_0xce39('0xa')](),controller[_0xce39('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x5c66=['./tag.controller','get','isAuthenticated','index','show','create','/:id','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3242ca,_0x4dac9b){var _0x58372f=function(_0x369498){while(--_0x369498){_0x3242ca['push'](_0x3242ca['shift']());}};_0x58372f(++_0x4dac9b);}(_0x5c66,0x76));var _0x65c6=function(_0x505a35,_0x4efb25){_0x505a35=_0x505a35-0x0;var _0x5c2406=_0x5c66[_0x505a35];return _0x5c2406;};'use strict';var multer=require(_0x65c6('0x0'));var util=require(_0x65c6('0x1'));var path=require(_0x65c6('0x2'));var express=require(_0x65c6('0x3'));var router=express[_0x65c6('0x4')]();var auth=require(_0x65c6('0x5'));var interaction=require(_0x65c6('0x6'));var config=require(_0x65c6('0x7'));var controller=require(_0x65c6('0x8'));router[_0x65c6('0x9')]('/',auth[_0x65c6('0xa')](),controller[_0x65c6('0xb')]);router[_0x65c6('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x65c6('0xc')]);router['post']('/',auth[_0x65c6('0xa')](),controller[_0x65c6('0xd')]);router['put'](_0x65c6('0xe'),auth[_0x65c6('0xa')](),controller[_0x65c6('0xf')]);router[_0x65c6('0x10')](_0x65c6('0xe'),auth[_0x65c6('0xa')](),controller['destroy']);module[_0x65c6('0x11')]=router;
\ No newline at end of file
index 704364e..7b6c065 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7928=['name','exports','STRING'];(function(_0x483730,_0x82b1da){var _0xfb6ce1=function(_0x2479db){while(--_0x2479db){_0x483730['push'](_0x483730['shift']());}};_0xfb6ce1(++_0x82b1da);}(_0x7928,0x91));var _0x8792=function(_0x1778e9,_0x2776bb){_0x1778e9=_0x1778e9-0x0;var _0x39d16a=_0x7928[_0x1778e9];return _0x39d16a;};'use strict';var Sequelize=require('sequelize');module[_0x8792('0x0')]={'name':{'type':Sequelize[_0x8792('0x1')],'unique':_0x8792('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x8792('0x1')],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8c87=['sequelize','exports','STRING','name','#0091EA'];(function(_0x1c3855,_0x5110f6){var _0x3d3a3b=function(_0x1c2842){while(--_0x1c2842){_0x1c3855['push'](_0x1c3855['shift']());}};_0x3d3a3b(++_0x5110f6);}(_0x8c87,0x1d6));var _0x78c8=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x8c87[_0x1d24eb];return _0x1dc576;};'use strict';var Sequelize=require(_0x78c8('0x0'));module[_0x78c8('0x1')]={'name':{'type':Sequelize[_0x78c8('0x2')],'unique':_0x78c8('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x78c8('0x2')],'defaultValue':_0x78c8('0x4')},'description':{'type':Sequelize[_0x78c8('0x2')]}};
\ No newline at end of file
index 0413974..d89ca21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7059=['merge','filter','map','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','desk.js','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','apply','reject','save','update','then','destroy','error','stack','name','send','Tag','rawAttributes','keys','query','dateStart','intersection','model','fields','attributes','nolimit','offset','order','sort','where','filters','pick','dateEnd','day'];(function(_0x477de3,_0x592fa3){var _0x12e397=function(_0x4d0d75){while(--_0x4d0d75){_0x477de3['push'](_0x477de3['shift']());}};_0x12e397(++_0x592fa3);}(_0x7059,0xde));var _0x9705=function(_0x506a08,_0x42b699){_0x506a08=_0x506a08-0x0;var _0x1bb7d7=_0x7059[_0x506a08];return _0x1bb7d7;};'use strict';var pdf=require(_0x9705('0x0'));var emlformat=require(_0x9705('0x1'));var rimraf=require(_0x9705('0x2'));var zipdir=require(_0x9705('0x3'));var jsonpatch=require(_0x9705('0x4'));var rp=require(_0x9705('0x5'));var moment=require(_0x9705('0x6'));var BPromise=require(_0x9705('0x7'));var Mustache=require('mustache');var util=require(_0x9705('0x8'));var path=require(_0x9705('0x9'));var sox=require('sox');var csv=require(_0x9705('0xa'));var ejs=require(_0x9705('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9705('0xc'));var crypto=require(_0x9705('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9705('0xe'));var toCsv=require(_0x9705('0xa'));var querystring=require('querystring');var Papa=require(_0x9705('0xf'));var qs=require(_0x9705('0x10'));var logger=require('../../config/logger')(_0x9705('0x11'));var utils=require(_0x9705('0x12'));var config=require(_0x9705('0x13'));var db=require(_0x9705('0x14'))['db'];function respondWithStatusCode(_0x47b3a0,_0x5d362f){_0x5d362f=_0x5d362f||0xcc;return function(_0x5309ed){if(_0x5309ed){return _0x47b3a0[_0x9705('0x15')](_0x5d362f);}return _0x47b3a0[_0x9705('0x16')](_0x5d362f)[_0x9705('0x17')]();};}function respondWithResult(_0x1e1488,_0x31e1e6){_0x31e1e6=_0x31e1e6||0xc8;return function(_0x4b492e){if(_0x4b492e){return _0x1e1488['status'](_0x31e1e6)['json'](_0x4b492e);}};}function respondWithFilteredResult(_0x52f8a0,_0xc98ab7){return function(_0x2ca32e){if(_0x2ca32e){var _0x7252c=_0x2ca32e[_0x9705('0x18')],_0x47cdfc=_0xc98ab7['offset'],_0x1510f7=_0xc98ab7['offset']+_0xc98ab7[_0x9705('0x19')],_0x450d11;if(_0x1510f7>=_0x7252c){_0x1510f7=_0x7252c;_0x450d11=0xc8;}else{_0x450d11=0xce;}_0x52f8a0['status'](_0x450d11);return _0x52f8a0['set']('Content-Range',_0x47cdfc+'-'+_0x1510f7+'/'+_0x7252c)['json'](_0x2ca32e);}return null;};}function patchUpdates(_0x1aeccd){return function(_0x551e28){try{jsonpatch[_0x9705('0x1a')](_0x551e28,_0x1aeccd,!![]);}catch(_0x3e0aa4){return BPromise[_0x9705('0x1b')](_0x3e0aa4);}return _0x551e28[_0x9705('0x1c')]();};}function saveUpdates(_0x3764e0,_0x5eb364){return function(_0x635be9){if(_0x635be9){return _0x635be9[_0x9705('0x1d')](_0x3764e0)[_0x9705('0x1e')](function(_0x39fc67){return _0x39fc67;});}return null;};}function removeEntity(_0x270dac,_0x120881){return function(_0x3a3140){if(_0x3a3140){return _0x3a3140[_0x9705('0x1f')]()[_0x9705('0x1e')](function(){_0x270dac['status'](0xcc)[_0x9705('0x17')]();});}};}function handleEntityNotFound(_0x3a516d,_0x21b766){return function(_0x439a04){if(!_0x439a04){_0x3a516d[_0x9705('0x15')](0x194);}return _0x439a04;};}function handleError(_0x222048,_0x34a7d0){_0x34a7d0=_0x34a7d0||0x1f4;return function(_0x1a2d8e){logger[_0x9705('0x20')](_0x1a2d8e[_0x9705('0x21')]);if(_0x1a2d8e[_0x9705('0x22')]){delete _0x1a2d8e[_0x9705('0x22')];}_0x222048[_0x9705('0x16')](_0x34a7d0)[_0x9705('0x23')](_0x1a2d8e);};}exports['index']=function(_0x3545aa,_0x3aab1d){var _0x1de27b={},_0xe5797d={},_0x4a167b={'count':0x0,'rows':[]};var _0x8aa47f=db[_0x9705('0x24')][_0x9705('0x25')];_0xe5797d['model']=_[_0x9705('0x26')](_0x8aa47f);var _0x532292={'dateStart':_0x3545aa[_0x9705('0x27')][_0x9705('0x28')],'dateEnd':_0x3545aa[_0x9705('0x27')]['dateEnd']};delete _0x3545aa[_0x9705('0x27')][_0x9705('0x28')];delete _0x3545aa['query']['dateEnd'];_0xe5797d[_0x9705('0x27')]=_['keys'](_0x3545aa[_0x9705('0x27')]);_0xe5797d['filters']=_[_0x9705('0x29')](_0xe5797d[_0x9705('0x2a')],_0xe5797d['query']);_0x1de27b['attributes']=_['intersection'](_0xe5797d[_0x9705('0x2a')],qs[_0x9705('0x2b')](_0x3545aa[_0x9705('0x27')][_0x9705('0x2b')]));_0x1de27b['attributes']=_0x1de27b[_0x9705('0x2c')]['length']?_0x1de27b[_0x9705('0x2c')]:_0xe5797d[_0x9705('0x2a')];if(!_0x3545aa['query']['hasOwnProperty'](_0x9705('0x2d'))){_0x1de27b[_0x9705('0x19')]=qs[_0x9705('0x19')](_0x3545aa['query'][_0x9705('0x19')]);_0x1de27b[_0x9705('0x2e')]=qs['offset'](_0x3545aa[_0x9705('0x27')][_0x9705('0x2e')]);}_0x1de27b[_0x9705('0x2f')]=qs[_0x9705('0x30')](_0x3545aa[_0x9705('0x27')][_0x9705('0x30')]);_0x1de27b[_0x9705('0x31')]=qs[_0x9705('0x32')](_[_0x9705('0x33')](_0x3545aa[_0x9705('0x27')],_0xe5797d[_0x9705('0x32')]));if(_0x532292[_0x9705('0x28')]){if(_0x532292[_0x9705('0x34')]){_0x532292[_0x9705('0x34')]=moment(_0x532292[_0x9705('0x34')])['add'](0x1,'day');}else{_0x532292[_0x9705('0x34')]=moment(_0x532292['dateStart'])['add'](0x1,_0x9705('0x35'));}_[_0x9705('0x36')](_0x1de27b['where'],{'createdAt':{'$gte':_0x532292['dateStart'],'$lte':_0x532292[_0x9705('0x34')]}});}if(_0x3545aa['query'][_0x9705('0x37')]){_0x1de27b['where']=_[_0x9705('0x36')](_0x1de27b[_0x9705('0x31')],{'$or':_[_0x9705('0x38')](_0x1de27b[_0x9705('0x2c')],function(_0x3efce2){var _0x294373={};_0x294373[_0x3efce2]={'$like':'%'+_0x3545aa['query'][_0x9705('0x37')]+'%'};return _0x294373;})});}_0x1de27b=_['merge']({},_0x1de27b,_0x3545aa['options']);var _0x1d73bc={'where':_0x1de27b[_0x9705('0x31')]};return db['Tag'][_0x9705('0x18')](_0x1d73bc)[_0x9705('0x1e')](function(_0x2c71ac){_0x4a167b['count']=_0x2c71ac;if(_0x3545aa[_0x9705('0x27')][_0x9705('0x39')]){_0x1de27b[_0x9705('0x3a')]=[{'all':!![]}];}return db[_0x9705('0x24')][_0x9705('0x3b')](_0x1de27b);})[_0x9705('0x1e')](function(_0xccd298){_0x4a167b[_0x9705('0x3c')]=_0xccd298;return _0x4a167b;})[_0x9705('0x1e')](respondWithFilteredResult(_0x3aab1d,_0x1de27b))[_0x9705('0x3d')](handleError(_0x3aab1d,null));};exports[_0x9705('0x3e')]=function(_0x1b92b9,_0x5bc107){var _0x71f259={'raw':!![],'where':{'id':_0x1b92b9[_0x9705('0x3f')]['id']}},_0x5bd942={};_0x5bd942[_0x9705('0x2a')]=_[_0x9705('0x26')](db[_0x9705('0x24')]['rawAttributes']);_0x5bd942[_0x9705('0x27')]=_[_0x9705('0x26')](_0x1b92b9[_0x9705('0x27')]);_0x5bd942[_0x9705('0x32')]=_[_0x9705('0x29')](_0x5bd942['model'],_0x5bd942[_0x9705('0x27')]);_0x71f259[_0x9705('0x2c')]=_[_0x9705('0x29')](_0x5bd942[_0x9705('0x2a')],qs[_0x9705('0x2b')](_0x1b92b9[_0x9705('0x27')][_0x9705('0x2b')]));_0x71f259['attributes']=_0x71f259[_0x9705('0x2c')][_0x9705('0x40')]?_0x71f259[_0x9705('0x2c')]:_0x5bd942[_0x9705('0x2a')];if(_0x1b92b9[_0x9705('0x27')][_0x9705('0x39')]){_0x71f259[_0x9705('0x3a')]=[{'all':!![]}];}_0x71f259=_[_0x9705('0x36')]({},_0x71f259,_0x1b92b9[_0x9705('0x41')]);return db[_0x9705('0x24')]['find'](_0x71f259)[_0x9705('0x1e')](handleEntityNotFound(_0x5bc107,null))['then'](respondWithResult(_0x5bc107,null))['catch'](handleError(_0x5bc107,null));};exports[_0x9705('0x42')]=function(_0x3909d5,_0x452a6b){return db[_0x9705('0x24')][_0x9705('0x42')](_0x3909d5[_0x9705('0x43')],{})[_0x9705('0x1e')](respondWithResult(_0x452a6b,0xc9))[_0x9705('0x3d')](handleError(_0x452a6b,null));};exports['update']=function(_0x13ec5f,_0x191d91){if(_0x13ec5f[_0x9705('0x43')]['id']){delete _0x13ec5f[_0x9705('0x43')]['id'];}return db[_0x9705('0x24')][_0x9705('0x44')]({'where':{'id':_0x13ec5f['params']['id']}})['then'](handleEntityNotFound(_0x191d91,null))[_0x9705('0x1e')](saveUpdates(_0x13ec5f[_0x9705('0x43')],null))['then'](respondWithResult(_0x191d91,null))['catch'](handleError(_0x191d91,null));};exports['destroy']=function(_0x12ed55,_0x5f3cfd){return db['Tag'][_0x9705('0x44')]({'where':{'id':_0x12ed55[_0x9705('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5f3cfd,null))[_0x9705('0x1e')](removeEntity(_0x5f3cfd,null))[_0x9705('0x3d')](handleError(_0x5f3cfd,null));};
\ No newline at end of file
+var _0x3544=['send','index','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','add','day','merge','map','options','Tag','includeAll','include','findAll','catch','show','length','find','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3544,0x68));var _0x4354=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x3544[_0x24f31b];return _0x488401;};'use strict';var pdf=require(_0x4354('0x0'));var emlformat=require(_0x4354('0x1'));var rimraf=require(_0x4354('0x2'));var zipdir=require(_0x4354('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4354('0x4'));var moment=require(_0x4354('0x5'));var BPromise=require(_0x4354('0x6'));var Mustache=require(_0x4354('0x7'));var util=require('util');var path=require('path');var sox=require(_0x4354('0x8'));var csv=require('to-csv');var ejs=require(_0x4354('0x9'));var fs=require('fs');var _=require(_0x4354('0xa'));var squel=require('squel');var crypto=require(_0x4354('0xb'));var jsforce=require(_0x4354('0xc'));var deskjs=require(_0x4354('0xd'));var toCsv=require(_0x4354('0xe'));var querystring=require(_0x4354('0xf'));var Papa=require(_0x4354('0x10'));var qs=require(_0x4354('0x11'));var logger=require(_0x4354('0x12'))(_0x4354('0x13'));var utils=require(_0x4354('0x14'));var config=require(_0x4354('0x15'));var db=require(_0x4354('0x16'))['db'];function respondWithStatusCode(_0x72c7c6,_0x2cf66c){_0x2cf66c=_0x2cf66c||0xcc;return function(_0x18941c){if(_0x18941c){return _0x72c7c6[_0x4354('0x17')](_0x2cf66c);}return _0x72c7c6[_0x4354('0x18')](_0x2cf66c)[_0x4354('0x19')]();};}function respondWithResult(_0x3b452d,_0x1e3136){_0x1e3136=_0x1e3136||0xc8;return function(_0x6ad571){if(_0x6ad571){return _0x3b452d['status'](_0x1e3136)[_0x4354('0x1a')](_0x6ad571);}};}function respondWithFilteredResult(_0x2673dd,_0x3a468f){return function(_0x51e8ea){if(_0x51e8ea){var _0x8548e7=_0x51e8ea[_0x4354('0x1b')],_0x16d883=_0x3a468f[_0x4354('0x1c')],_0x453de5=_0x3a468f['offset']+_0x3a468f[_0x4354('0x1d')],_0x1b4022;if(_0x453de5>=_0x8548e7){_0x453de5=_0x8548e7;_0x1b4022=0xc8;}else{_0x1b4022=0xce;}_0x2673dd[_0x4354('0x18')](_0x1b4022);return _0x2673dd[_0x4354('0x1e')](_0x4354('0x1f'),_0x16d883+'-'+_0x453de5+'/'+_0x8548e7)['json'](_0x51e8ea);}return null;};}function patchUpdates(_0x488eb6){return function(_0x1c78e7){try{jsonpatch['apply'](_0x1c78e7,_0x488eb6,!![]);}catch(_0x5c82bc){return BPromise[_0x4354('0x20')](_0x5c82bc);}return _0x1c78e7[_0x4354('0x21')]();};}function saveUpdates(_0x23704d,_0x1de049){return function(_0x2adcb3){if(_0x2adcb3){return _0x2adcb3[_0x4354('0x22')](_0x23704d)[_0x4354('0x23')](function(_0x2aef75){return _0x2aef75;});}return null;};}function removeEntity(_0x2dae05,_0x2c1dcb){return function(_0xe25d21){if(_0xe25d21){return _0xe25d21[_0x4354('0x24')]()[_0x4354('0x23')](function(){_0x2dae05[_0x4354('0x18')](0xcc)[_0x4354('0x19')]();});}};}function handleEntityNotFound(_0x545a67,_0x55f610){return function(_0xdc1b72){if(!_0xdc1b72){_0x545a67[_0x4354('0x17')](0x194);}return _0xdc1b72;};}function handleError(_0x41b79f,_0x2eabb6){_0x2eabb6=_0x2eabb6||0x1f4;return function(_0x2451d0){logger[_0x4354('0x25')](_0x2451d0[_0x4354('0x26')]);if(_0x2451d0[_0x4354('0x27')]){delete _0x2451d0['name'];}_0x41b79f[_0x4354('0x18')](_0x2eabb6)[_0x4354('0x28')](_0x2451d0);};}exports[_0x4354('0x29')]=function(_0x541eed,_0x5bf224){var _0x134eaa={},_0x32dd48={},_0x42abc6={'count':0x0,'rows':[]};var _0x43001b=db['Tag'][_0x4354('0x2a')];_0x32dd48[_0x4354('0x2b')]=_[_0x4354('0x2c')](_0x43001b);var _0x29e4f0={'dateStart':_0x541eed[_0x4354('0x2d')][_0x4354('0x2e')],'dateEnd':_0x541eed[_0x4354('0x2d')]['dateEnd']};delete _0x541eed[_0x4354('0x2d')]['dateStart'];delete _0x541eed[_0x4354('0x2d')][_0x4354('0x2f')];_0x32dd48[_0x4354('0x2d')]=_[_0x4354('0x2c')](_0x541eed['query']);_0x32dd48[_0x4354('0x30')]=_[_0x4354('0x31')](_0x32dd48[_0x4354('0x2b')],_0x32dd48[_0x4354('0x2d')]);_0x134eaa['attributes']=_[_0x4354('0x31')](_0x32dd48[_0x4354('0x2b')],qs['fields'](_0x541eed[_0x4354('0x2d')][_0x4354('0x32')]));_0x134eaa['attributes']=_0x134eaa[_0x4354('0x33')]['length']?_0x134eaa[_0x4354('0x33')]:_0x32dd48[_0x4354('0x2b')];if(!_0x541eed[_0x4354('0x2d')][_0x4354('0x34')](_0x4354('0x35'))){_0x134eaa[_0x4354('0x1d')]=qs[_0x4354('0x1d')](_0x541eed[_0x4354('0x2d')][_0x4354('0x1d')]);_0x134eaa[_0x4354('0x1c')]=qs[_0x4354('0x1c')](_0x541eed['query'][_0x4354('0x1c')]);}_0x134eaa[_0x4354('0x36')]=qs[_0x4354('0x37')](_0x541eed['query'][_0x4354('0x37')]);_0x134eaa[_0x4354('0x38')]=qs[_0x4354('0x30')](_[_0x4354('0x39')](_0x541eed[_0x4354('0x2d')],_0x32dd48[_0x4354('0x30')]));if(_0x29e4f0[_0x4354('0x2e')]){if(_0x29e4f0[_0x4354('0x2f')]){_0x29e4f0['dateEnd']=moment(_0x29e4f0[_0x4354('0x2f')])[_0x4354('0x3a')](0x1,_0x4354('0x3b'));}else{_0x29e4f0[_0x4354('0x2f')]=moment(_0x29e4f0[_0x4354('0x2e')])[_0x4354('0x3a')](0x1,_0x4354('0x3b'));}_[_0x4354('0x3c')](_0x134eaa[_0x4354('0x38')],{'createdAt':{'$gte':_0x29e4f0[_0x4354('0x2e')],'$lte':_0x29e4f0[_0x4354('0x2f')]}});}if(_0x541eed['query']['filter']){_0x134eaa[_0x4354('0x38')]=_[_0x4354('0x3c')](_0x134eaa[_0x4354('0x38')],{'$or':_[_0x4354('0x3d')](_0x134eaa[_0x4354('0x33')],function(_0x304876){var _0x3a4f77={};_0x3a4f77[_0x304876]={'$like':'%'+_0x541eed[_0x4354('0x2d')]['filter']+'%'};return _0x3a4f77;})});}_0x134eaa=_['merge']({},_0x134eaa,_0x541eed[_0x4354('0x3e')]);var _0x319f53={'where':_0x134eaa[_0x4354('0x38')]};return db[_0x4354('0x3f')][_0x4354('0x1b')](_0x319f53)[_0x4354('0x23')](function(_0x4fc1ce){_0x42abc6[_0x4354('0x1b')]=_0x4fc1ce;if(_0x541eed[_0x4354('0x2d')][_0x4354('0x40')]){_0x134eaa[_0x4354('0x41')]=[{'all':!![]}];}return db['Tag'][_0x4354('0x42')](_0x134eaa);})[_0x4354('0x23')](function(_0x11236f){_0x42abc6['rows']=_0x11236f;return _0x42abc6;})['then'](respondWithFilteredResult(_0x5bf224,_0x134eaa))[_0x4354('0x43')](handleError(_0x5bf224,null));};exports[_0x4354('0x44')]=function(_0x7ffe55,_0x40fb00){var _0xd29c38={'raw':!![],'where':{'id':_0x7ffe55['params']['id']}},_0x2de847={};_0x2de847['model']=_[_0x4354('0x2c')](db[_0x4354('0x3f')][_0x4354('0x2a')]);_0x2de847[_0x4354('0x2d')]=_[_0x4354('0x2c')](_0x7ffe55[_0x4354('0x2d')]);_0x2de847[_0x4354('0x30')]=_['intersection'](_0x2de847[_0x4354('0x2b')],_0x2de847[_0x4354('0x2d')]);_0xd29c38[_0x4354('0x33')]=_[_0x4354('0x31')](_0x2de847[_0x4354('0x2b')],qs[_0x4354('0x32')](_0x7ffe55[_0x4354('0x2d')]['fields']));_0xd29c38[_0x4354('0x33')]=_0xd29c38['attributes'][_0x4354('0x45')]?_0xd29c38['attributes']:_0x2de847[_0x4354('0x2b')];if(_0x7ffe55[_0x4354('0x2d')][_0x4354('0x40')]){_0xd29c38['include']=[{'all':!![]}];}_0xd29c38=_['merge']({},_0xd29c38,_0x7ffe55[_0x4354('0x3e')]);return db[_0x4354('0x3f')][_0x4354('0x46')](_0xd29c38)[_0x4354('0x23')](handleEntityNotFound(_0x40fb00,null))['then'](respondWithResult(_0x40fb00,null))[_0x4354('0x43')](handleError(_0x40fb00,null));};exports['create']=function(_0x1bdddb,_0x26dfeb){return db['Tag']['create'](_0x1bdddb[_0x4354('0x47')],{})['then'](respondWithResult(_0x26dfeb,0xc9))[_0x4354('0x43')](handleError(_0x26dfeb,null));};exports[_0x4354('0x22')]=function(_0x23fc24,_0x3ba9d9){if(_0x23fc24['body']['id']){delete _0x23fc24[_0x4354('0x47')]['id'];}return db[_0x4354('0x3f')][_0x4354('0x46')]({'where':{'id':_0x23fc24['params']['id']}})[_0x4354('0x23')](handleEntityNotFound(_0x3ba9d9,null))[_0x4354('0x23')](saveUpdates(_0x23fc24[_0x4354('0x47')],null))[_0x4354('0x23')](respondWithResult(_0x3ba9d9,null))[_0x4354('0x43')](handleError(_0x3ba9d9,null));};exports[_0x4354('0x24')]=function(_0x556cb6,_0x582408){return db[_0x4354('0x3f')][_0x4354('0x46')]({'where':{'id':_0x556cb6['params']['id']}})[_0x4354('0x23')](handleEntityNotFound(_0x582408,null))['then'](removeEntity(_0x582408,null))[_0x4354('0x43')](handleError(_0x582408,null));};
\ No newline at end of file
index c36b801..8311948 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55f0=['api','moment','bluebird','request-promise','./tag.attributes','exports','define','Tag','tools_tags'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x55f0,0x87));var _0x055f=function(_0x1acefc,_0x5da0bf){_0x1acefc=_0x1acefc-0x0;var _0x543527=_0x55f0[_0x1acefc];return _0x543527;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x055f('0x0'));var moment=require(_0x055f('0x1'));var BPromise=require(_0x055f('0x2'));var rp=require(_0x055f('0x3'));var attributes=require(_0x055f('0x4'));module[_0x055f('0x5')]=function(_0x3e072d,_0x213e7f){return _0x3e072d[_0x055f('0x6')](_0x055f('0x7'),attributes,{'tableName':_0x055f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x24ab=['./tag.attributes','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x286794,_0x5abcfd){var _0xb52307=function(_0x40d039){while(--_0x40d039){_0x286794['push'](_0x286794['shift']());}};_0xb52307(++_0x5abcfd);}(_0x24ab,0x6b));var _0xb24a=function(_0x4bd0ac,_0x20f2fe){_0x4bd0ac=_0x4bd0ac-0x0;var _0xac7c18=_0x24ab[_0x4bd0ac];return _0xac7c18;};'use strict';var _=require(_0xb24a('0x0'));var util=require(_0xb24a('0x1'));var logger=require(_0xb24a('0x2'))(_0xb24a('0x3'));var moment=require(_0xb24a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xb24a('0x5'));module[_0xb24a('0x6')]=function(_0x50aa93,_0x227b0b){return _0x50aa93[_0xb24a('0x7')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c1880f5..99b20eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd13b=['http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0xd13b,0x131));var _0xbd13=function(_0x5116db,_0x514356){_0x5116db=_0x5116db-0x0;var _0xaefb1e=_0xd13b[_0x5116db];return _0xaefb1e;};'use strict';var _=require(_0xbd13('0x0'));var util=require(_0xbd13('0x1'));var moment=require(_0xbd13('0x2'));var BPromise=require(_0xbd13('0x3'));var rs=require(_0xbd13('0x4'));var fs=require('fs');var db=require(_0xbd13('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd13('0x6'))(_0xbd13('0x7'));var config=require(_0xbd13('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbd13('0x9')][_0xbd13('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58f53c,_0x2427ac,_0x48d8e9){return new BPromise(function(_0x2f8183,_0x4ca64c){return client[_0xbd13('0xb')](_0x58f53c,_0x48d8e9)[_0xbd13('0xc')](function(_0x46cd59){logger[_0xbd13('0xd')](_0xbd13('0xe'),_0x2427ac,_0xbd13('0xf'));logger['debug']('Tag,\x20%s,\x20%s,\x20%s',_0x2427ac,_0xbd13('0xf'),JSON['stringify'](_0x46cd59));if(_0x46cd59['error']){if(_0x46cd59['error'][_0xbd13('0x10')]===0x1f4){logger[_0xbd13('0x11')]('Tag,\x20%s,\x20%s',_0x2427ac,_0x46cd59[_0xbd13('0x11')]['message']);return _0x4ca64c(_0x46cd59['error']['message']);}logger[_0xbd13('0x11')](_0xbd13('0xe'),_0x2427ac,_0x46cd59['error'][_0xbd13('0x12')]);return _0x2f8183(_0x46cd59[_0xbd13('0x11')][_0xbd13('0x12')]);}else{logger[_0xbd13('0xd')](_0xbd13('0xe'),_0x2427ac,_0xbd13('0xf'));_0x2f8183(_0x46cd59[_0xbd13('0x13')][_0xbd13('0x12')]);}})[_0xbd13('0x14')](function(_0x3998d5){logger['error'](_0xbd13('0xe'),_0x2427ac,_0x3998d5);_0x4ca64c(_0x3998d5);});});}
\ No newline at end of file
+var _0x8cdf=['jayson/promise','client','request','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x128d90,_0x5d79a9){var _0x314b0b=function(_0x38c128){while(--_0x38c128){_0x128d90['push'](_0x128d90['shift']());}};_0x314b0b(++_0x5d79a9);}(_0x8cdf,0x7c));var _0xf8cd=function(_0x1163ce,_0x33006c){_0x1163ce=_0x1163ce-0x0;var _0x4c8a79=_0x8cdf[_0x1163ce];return _0x4c8a79;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf8cd('0x0'));var BPromise=require(_0xf8cd('0x1'));var rs=require(_0xf8cd('0x2'));var fs=require('fs');var db=require(_0xf8cd('0x3'))['db'];var utils=require(_0xf8cd('0x4'));var logger=require(_0xf8cd('0x5'))(_0xf8cd('0x6'));var config=require(_0xf8cd('0x7'));var jayson=require(_0xf8cd('0x8'));var client=jayson[_0xf8cd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f2e61,_0x26bef9,_0x3f9094){return new BPromise(function(_0x5d5459,_0x1d828b){return client[_0xf8cd('0xa')](_0x2f2e61,_0x3f9094)['then'](function(_0x50bc9a){logger[_0xf8cd('0xb')]('Tag,\x20%s,\x20%s',_0x26bef9,_0xf8cd('0xc'));logger[_0xf8cd('0xd')](_0xf8cd('0xe'),_0x26bef9,'request\x20sent',JSON[_0xf8cd('0xf')](_0x50bc9a));if(_0x50bc9a[_0xf8cd('0x10')]){if(_0x50bc9a[_0xf8cd('0x10')][_0xf8cd('0x11')]===0x1f4){logger['error'](_0xf8cd('0x12'),_0x26bef9,_0x50bc9a[_0xf8cd('0x10')][_0xf8cd('0x13')]);return _0x1d828b(_0x50bc9a[_0xf8cd('0x10')][_0xf8cd('0x13')]);}logger[_0xf8cd('0x10')](_0xf8cd('0x12'),_0x26bef9,_0x50bc9a[_0xf8cd('0x10')][_0xf8cd('0x13')]);return _0x5d5459(_0x50bc9a[_0xf8cd('0x10')][_0xf8cd('0x13')]);}else{logger[_0xf8cd('0xb')](_0xf8cd('0x12'),_0x26bef9,_0xf8cd('0xc'));_0x5d5459(_0x50bc9a[_0xf8cd('0x14')]['message']);}})[_0xf8cd('0x15')](function(_0x233b6a){logger[_0xf8cd('0x10')]('Tag,\x20%s,\x20%s',_0x26bef9,_0x233b6a);_0x1d828b(_0x233b6a);});});}
\ No newline at end of file
index 6460264..279c8af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ee9=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','isAuthenticated','index','/:id','/:id/queues','getQueues','/:id/users','getAgents','post','addQueues','put','update','delete','destroy','removeQueues','removeAgents','exports','multer','path'];(function(_0x39050f,_0x2c6fd5){var _0x11ad67=function(_0x540779){while(--_0x540779){_0x39050f['push'](_0x39050f['shift']());}};_0x11ad67(++_0x2c6fd5);}(_0x6ee9,0x1de));var _0x96ee=function(_0x5d3659,_0x430dc2){_0x5d3659=_0x5d3659-0x0;var _0x25452b=_0x6ee9[_0x5d3659];return _0x25452b;};'use strict';var multer=require(_0x96ee('0x0'));var util=require('util');var path=require(_0x96ee('0x1'));var express=require('express');var router=express[_0x96ee('0x2')]();var auth=require(_0x96ee('0x3'));var interaction=require(_0x96ee('0x4'));var config=require(_0x96ee('0x5'));var controller=require(_0x96ee('0x6'));router[_0x96ee('0x7')]('/',auth[_0x96ee('0x8')](),controller[_0x96ee('0x9')]);router[_0x96ee('0x7')](_0x96ee('0xa'),auth[_0x96ee('0x8')](),controller['show']);router[_0x96ee('0x7')](_0x96ee('0xb'),auth[_0x96ee('0x8')](),controller[_0x96ee('0xc')]);router[_0x96ee('0x7')](_0x96ee('0xd'),auth['isAuthenticated'](),controller[_0x96ee('0xe')]);router[_0x96ee('0xf')]('/',auth[_0x96ee('0x8')](),controller['create']);router[_0x96ee('0xf')](_0x96ee('0xb'),auth[_0x96ee('0x8')](),controller[_0x96ee('0x10')]);router[_0x96ee('0xf')]('/:id/users',auth[_0x96ee('0x8')](),controller['addAgents']);router[_0x96ee('0x11')](_0x96ee('0xa'),auth[_0x96ee('0x8')](),controller[_0x96ee('0x12')]);router[_0x96ee('0x13')](_0x96ee('0xa'),auth[_0x96ee('0x8')](),controller[_0x96ee('0x14')]);router[_0x96ee('0x13')](_0x96ee('0xb'),auth[_0x96ee('0x8')](),controller[_0x96ee('0x15')]);router[_0x96ee('0x13')]('/:id/users',auth[_0x96ee('0x8')](),controller[_0x96ee('0x16')]);module[_0x96ee('0x17')]=router;
\ No newline at end of file
+var _0x725a=['get','isAuthenticated','index','/:id','show','/:id/users','getAgents','create','post','addAgents','put','delete','destroy','/:id/queues','removeAgents','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./team.controller'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x725a,0x1c5));var _0xa725=function(_0x447ef1,_0x374cd2){_0x447ef1=_0x447ef1-0x0;var _0x3d72ec=_0x725a[_0x447ef1];return _0x3d72ec;};'use strict';var multer=require(_0xa725('0x0'));var util=require(_0xa725('0x1'));var path=require(_0xa725('0x2'));var express=require(_0xa725('0x3'));var router=express['Router']();var auth=require(_0xa725('0x4'));var interaction=require(_0xa725('0x5'));var config=require('../../config/environment');var controller=require(_0xa725('0x6'));router[_0xa725('0x7')]('/',auth[_0xa725('0x8')](),controller[_0xa725('0x9')]);router[_0xa725('0x7')](_0xa725('0xa'),auth['isAuthenticated'](),controller[_0xa725('0xb')]);router[_0xa725('0x7')]('/:id/queues',auth[_0xa725('0x8')](),controller['getQueues']);router['get'](_0xa725('0xc'),auth['isAuthenticated'](),controller[_0xa725('0xd')]);router['post']('/',auth[_0xa725('0x8')](),controller[_0xa725('0xe')]);router[_0xa725('0xf')]('/:id/queues',auth[_0xa725('0x8')](),controller['addQueues']);router[_0xa725('0xf')]('/:id/users',auth[_0xa725('0x8')](),controller[_0xa725('0x10')]);router[_0xa725('0x11')]('/:id',auth[_0xa725('0x8')](),controller['update']);router[_0xa725('0x12')](_0xa725('0xa'),auth[_0xa725('0x8')](),controller[_0xa725('0x13')]);router[_0xa725('0x12')](_0xa725('0x14'),auth[_0xa725('0x8')](),controller['removeQueues']);router[_0xa725('0x12')](_0xa725('0xc'),auth[_0xa725('0x8')](),controller[_0xa725('0x15')]);module[_0xa725('0x16')]=router;
\ No newline at end of file
index 02afaa6..6dfce15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0ea=['STRING','sequelize','exports'];(function(_0x4dae23,_0x1f1772){var _0x5744f7=function(_0x21e103){while(--_0x21e103){_0x4dae23['push'](_0x4dae23['shift']());}};_0x5744f7(++_0x1f1772);}(_0xa0ea,0x91));var _0xaa0e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa0ea[_0x173d7e];return _0x2220d6;};'use strict';var Sequelize=require(_0xaa0e('0x0'));module[_0xaa0e('0x1')]={'name':{'type':Sequelize[_0xaa0e('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5c71=['exports','STRING','name','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c71,0x1bf));var _0x15c7=function(_0x38eaa2,_0x5759f5){_0x38eaa2=_0x38eaa2-0x0;var _0x1d42cc=_0x5c71[_0x38eaa2];return _0x1d42cc;};'use strict';var Sequelize=require(_0x15c7('0x0'));module[_0x15c7('0x1')]={'name':{'type':Sequelize[_0x15c7('0x2')],'allowNull':![],'unique':_0x15c7('0x3')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 74d406e..62a8baf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27a0=['limit','set','json','save','then','destroy','error','stack','send','index','Team','keys','dateStart','dateEnd','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','day','add','filter','merge','map','options','count','includeAll','include','findAll','rows','catch','params','fields','create','find','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','rawAttributes','get','Queues','addQueues','body','ids','removeQueues','chat','mail','sms','openchannel','each','addAgents','User','loginInPause','voicePause','UserVoiceQueueRt','upsert','name','format','SIP','spread','userTeam:save','removeAgents','voice','fax','isArray','emit','userTeam:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./team.socket','register','sendStatus','end','status','offset'];(function(_0x49617a,_0x7ed6aa){var _0x3e8736=function(_0xb77dba){while(--_0xb77dba){_0x49617a['push'](_0x49617a['shift']());}};_0x3e8736(++_0x7ed6aa);}(_0x27a0,0xbf));var _0x027a=function(_0x1c14f4,_0x40e0e3){_0x1c14f4=_0x1c14f4-0x0;var _0x2afaae=_0x27a0[_0x1c14f4];return _0x2afaae;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x027a('0x0'));var rimraf=require(_0x027a('0x1'));var zipdir=require(_0x027a('0x2'));var jsonpatch=require(_0x027a('0x3'));var rp=require(_0x027a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x027a('0x5'));var sox=require(_0x027a('0x6'));var csv=require(_0x027a('0x7'));var ejs=require(_0x027a('0x8'));var fs=require('fs');var _=require(_0x027a('0x9'));var squel=require(_0x027a('0xa'));var crypto=require('crypto');var jsforce=require(_0x027a('0xb'));var deskjs=require(_0x027a('0xc'));var toCsv=require(_0x027a('0x7'));var querystring=require('querystring');var Papa=require(_0x027a('0xd'));var qs=require(_0x027a('0xe'));var logger=require(_0x027a('0xf'))('api');var utils=require(_0x027a('0x10'));var config=require(_0x027a('0x11'));var db=require(_0x027a('0x12'))['db'];var socket=require(_0x027a('0x13'))({'host':_0x027a('0x14'),'port':0x18eb});require(_0x027a('0x15'))[_0x027a('0x16')](socket);function respondWithStatusCode(_0x874d2d,_0x351d7e){_0x351d7e=_0x351d7e||0xcc;return function(_0x3e0c1e){if(_0x3e0c1e){return _0x874d2d[_0x027a('0x17')](_0x351d7e);}return _0x874d2d['status'](_0x351d7e)[_0x027a('0x18')]();};}function respondWithResult(_0x30b9a4,_0x2d27f8){_0x2d27f8=_0x2d27f8||0xc8;return function(_0x21da53){if(_0x21da53){return _0x30b9a4[_0x027a('0x19')](_0x2d27f8)['json'](_0x21da53);}};}function respondWithFilteredResult(_0x5b6165,_0x1d680d){return function(_0x5cfc6d){if(_0x5cfc6d){var _0x2b3870=_0x5cfc6d['count'],_0x559d13=_0x1d680d['offset'],_0x432007=_0x1d680d[_0x027a('0x1a')]+_0x1d680d[_0x027a('0x1b')],_0x5a1224;if(_0x432007>=_0x2b3870){_0x432007=_0x2b3870;_0x5a1224=0xc8;}else{_0x5a1224=0xce;}_0x5b6165[_0x027a('0x19')](_0x5a1224);return _0x5b6165[_0x027a('0x1c')]('Content-Range',_0x559d13+'-'+_0x432007+'/'+_0x2b3870)[_0x027a('0x1d')](_0x5cfc6d);}return null;};}function patchUpdates(_0x2fccf6){return function(_0x4ad813){try{jsonpatch['apply'](_0x4ad813,_0x2fccf6,!![]);}catch(_0x3a6868){return BPromise['reject'](_0x3a6868);}return _0x4ad813[_0x027a('0x1e')]();};}function saveUpdates(_0x5b8fae,_0x59511c){return function(_0x58b129){if(_0x58b129){return _0x58b129['update'](_0x5b8fae)[_0x027a('0x1f')](function(_0x11e254){return _0x11e254;});}return null;};}function removeEntity(_0x266c9e,_0xdf8756){return function(_0x51b870){if(_0x51b870){return _0x51b870[_0x027a('0x20')]()[_0x027a('0x1f')](function(){_0x266c9e[_0x027a('0x19')](0xcc)[_0x027a('0x18')]();});}};}function handleEntityNotFound(_0x178ed8,_0x3bbd46){return function(_0x595f0e){if(!_0x595f0e){_0x178ed8[_0x027a('0x17')](0x194);}return _0x595f0e;};}function handleError(_0x5c281f,_0x3dd7ad){_0x3dd7ad=_0x3dd7ad||0x1f4;return function(_0x2e97c5){logger[_0x027a('0x21')](_0x2e97c5[_0x027a('0x22')]);if(_0x2e97c5['name']){delete _0x2e97c5['name'];}_0x5c281f[_0x027a('0x19')](_0x3dd7ad)[_0x027a('0x23')](_0x2e97c5);};}exports[_0x027a('0x24')]=function(_0x129d5f,_0x511c7a){var _0x1b5325={},_0x55a8cd={},_0x953887={'count':0x0,'rows':[]};var _0x488920=db[_0x027a('0x25')]['rawAttributes'];_0x55a8cd['model']=_[_0x027a('0x26')](_0x488920);var _0x5782ac={'dateStart':_0x129d5f['query'][_0x027a('0x27')],'dateEnd':_0x129d5f['query'][_0x027a('0x28')]};delete _0x129d5f['query'][_0x027a('0x27')];delete _0x129d5f[_0x027a('0x29')]['dateEnd'];_0x55a8cd[_0x027a('0x29')]=_['keys'](_0x129d5f[_0x027a('0x29')]);_0x55a8cd[_0x027a('0x2a')]=_[_0x027a('0x2b')](_0x55a8cd[_0x027a('0x2c')],_0x55a8cd[_0x027a('0x29')]);_0x1b5325[_0x027a('0x2d')]=_['intersection'](_0x55a8cd[_0x027a('0x2c')],qs['fields'](_0x129d5f[_0x027a('0x29')]['fields']));_0x1b5325[_0x027a('0x2d')]=_0x1b5325[_0x027a('0x2d')][_0x027a('0x2e')]?_0x1b5325[_0x027a('0x2d')]:_0x55a8cd[_0x027a('0x2c')];if(!_0x129d5f['query'][_0x027a('0x2f')](_0x027a('0x30'))){_0x1b5325[_0x027a('0x1b')]=qs[_0x027a('0x1b')](_0x129d5f[_0x027a('0x29')][_0x027a('0x1b')]);_0x1b5325[_0x027a('0x1a')]=qs[_0x027a('0x1a')](_0x129d5f[_0x027a('0x29')][_0x027a('0x1a')]);}_0x1b5325[_0x027a('0x31')]=qs['sort'](_0x129d5f[_0x027a('0x29')][_0x027a('0x32')]);_0x1b5325[_0x027a('0x33')]=qs[_0x027a('0x2a')](_[_0x027a('0x34')](_0x129d5f[_0x027a('0x29')],_0x55a8cd[_0x027a('0x2a')]));if(_0x5782ac['dateStart']){if(_0x5782ac[_0x027a('0x28')]){_0x5782ac[_0x027a('0x28')]=moment(_0x5782ac[_0x027a('0x28')])['add'](0x1,_0x027a('0x35'));}else{_0x5782ac['dateEnd']=moment(_0x5782ac[_0x027a('0x27')])[_0x027a('0x36')](0x1,_0x027a('0x35'));}_['merge'](_0x1b5325['where'],{'createdAt':{'$gte':_0x5782ac[_0x027a('0x27')],'$lte':_0x5782ac[_0x027a('0x28')]}});}if(_0x129d5f['query'][_0x027a('0x37')]){_0x1b5325[_0x027a('0x33')]=_[_0x027a('0x38')](_0x1b5325[_0x027a('0x33')],{'$or':_[_0x027a('0x39')](_0x1b5325[_0x027a('0x2d')],function(_0x42fa27){var _0x1866b9={};_0x1866b9[_0x42fa27]={'$like':'%'+_0x129d5f[_0x027a('0x29')][_0x027a('0x37')]+'%'};return _0x1866b9;})});}_0x1b5325=_[_0x027a('0x38')]({},_0x1b5325,_0x129d5f[_0x027a('0x3a')]);var _0x1e22d4={'where':_0x1b5325[_0x027a('0x33')]};return db[_0x027a('0x25')][_0x027a('0x3b')](_0x1e22d4)[_0x027a('0x1f')](function(_0x5a3dee){_0x953887[_0x027a('0x3b')]=_0x5a3dee;if(_0x129d5f[_0x027a('0x29')][_0x027a('0x3c')]){_0x1b5325[_0x027a('0x3d')]=[{'all':!![]}];}return db[_0x027a('0x25')][_0x027a('0x3e')](_0x1b5325);})['then'](function(_0x96d3aa){_0x953887[_0x027a('0x3f')]=_0x96d3aa;return _0x953887;})['then'](respondWithFilteredResult(_0x511c7a,_0x1b5325))[_0x027a('0x40')](handleError(_0x511c7a,null));};exports['show']=function(_0x49ede7,_0x3d4b01){var _0x535151={'raw':![],'where':{'id':_0x49ede7[_0x027a('0x41')]['id']}},_0x3d8df2={};_0x3d8df2[_0x027a('0x2c')]=_[_0x027a('0x26')](db[_0x027a('0x25')]['rawAttributes']);_0x3d8df2[_0x027a('0x29')]=_[_0x027a('0x26')](_0x49ede7[_0x027a('0x29')]);_0x3d8df2['filters']=_['intersection'](_0x3d8df2['model'],_0x3d8df2['query']);_0x535151[_0x027a('0x2d')]=_[_0x027a('0x2b')](_0x3d8df2[_0x027a('0x2c')],qs[_0x027a('0x42')](_0x49ede7[_0x027a('0x29')][_0x027a('0x42')]));_0x535151['attributes']=_0x535151['attributes'][_0x027a('0x2e')]?_0x535151[_0x027a('0x2d')]:_0x3d8df2[_0x027a('0x2c')];if(_0x49ede7[_0x027a('0x29')][_0x027a('0x3c')]){_0x535151[_0x027a('0x3d')]=[{'all':!![]}];}_0x535151=_[_0x027a('0x38')]({},_0x535151,_0x49ede7[_0x027a('0x3a')]);return db[_0x027a('0x25')]['find'](_0x535151)[_0x027a('0x1f')](handleEntityNotFound(_0x3d4b01,null))[_0x027a('0x1f')](respondWithResult(_0x3d4b01,null))[_0x027a('0x40')](handleError(_0x3d4b01,null));};exports[_0x027a('0x43')]=function(_0xa3a68d,_0x21c6f4){return db[_0x027a('0x25')][_0x027a('0x43')](_0xa3a68d['body'],{})[_0x027a('0x1f')](respondWithResult(_0x21c6f4,0xc9))[_0x027a('0x40')](handleError(_0x21c6f4,null));};exports['update']=function(_0x2a93c9,_0x2f9f31){if(_0x2a93c9['body']['id']){delete _0x2a93c9['body']['id'];}return db['Team'][_0x027a('0x44')]({'where':{'id':_0x2a93c9['params']['id']}})[_0x027a('0x1f')](handleEntityNotFound(_0x2f9f31,null))['then'](saveUpdates(_0x2a93c9['body'],null))['then'](respondWithResult(_0x2f9f31,null))['catch'](handleError(_0x2f9f31,null));};exports[_0x027a('0x20')]=function(_0x352479,_0x53e1d8){return db['Team'][_0x027a('0x44')]({'where':{'id':_0x352479[_0x027a('0x41')]['id']}})[_0x027a('0x1f')](handleEntityNotFound(_0x53e1d8,null))[_0x027a('0x1f')](removeEntity(_0x53e1d8,null))['catch'](handleError(_0x53e1d8,null));};exports[_0x027a('0x45')]=function(_0x5c8855,_0x1a34e4,_0x290661){return db[_0x027a('0x25')][_0x027a('0x46')]({'where':{'id':_0x5c8855[_0x027a('0x41')]['id']}})[_0x027a('0x1f')](handleEntityNotFound(_0x1a34e4,null))[_0x027a('0x1f')](function(_0x109c79){if(!_0x5c8855['query'][_0x027a('0x47')]||!utils[_0x027a('0x48')](_0x5c8855[_0x027a('0x29')][_0x027a('0x47')])){throw new db[(_0x027a('0x49'))][(_0x027a('0x4a'))](_0x027a('0x4b'));}var _0x4da559={};var _0xabd56e={};_0xabd56e[_0x027a('0x2c')]=_[_0x027a('0x26')](db[_[_0x027a('0x4c')](_0x5c8855[_0x027a('0x29')][_0x027a('0x47')][_0x027a('0x4d')]())+_0x027a('0x4e')][_0x027a('0x4f')]);_0xabd56e[_0x027a('0x29')]=_[_0x027a('0x26')](_0x5c8855[_0x027a('0x29')]);_0xabd56e[_0x027a('0x2a')]=_[_0x027a('0x2b')](_0xabd56e[_0x027a('0x2c')],_0xabd56e['query']);_0x4da559[_0x027a('0x2d')]=_[_0x027a('0x2b')](_0xabd56e[_0x027a('0x2c')],qs[_0x027a('0x42')](_0x5c8855[_0x027a('0x29')][_0x027a('0x42')]));_0x4da559[_0x027a('0x2d')]=_0x4da559[_0x027a('0x2d')][_0x027a('0x2e')]?_0x4da559['attributes']:_0xabd56e['model'];_0x4da559['limit']=qs['limit'](_0x5c8855[_0x027a('0x29')][_0x027a('0x1b')]);_0x4da559[_0x027a('0x1a')]=qs[_0x027a('0x1a')](_0x5c8855[_0x027a('0x29')]['offset']);_0x4da559['order']=qs[_0x027a('0x32')](_0x5c8855['query']['sort']);_0x4da559[_0x027a('0x33')]=qs[_0x027a('0x2a')](_[_0x027a('0x34')](_0x5c8855[_0x027a('0x29')],_0xabd56e[_0x027a('0x2a')]));_0x4da559=_[_0x027a('0x38')]({},_0x4da559,_0x5c8855[_0x027a('0x3a')]);return _0x109c79[_0x027a('0x50')+_[_0x027a('0x4c')](_0x5c8855['query'][_0x027a('0x47')][_0x027a('0x4d')]())+_0x027a('0x51')](_0x4da559);})[_0x027a('0x1f')](respondWithResult(_0x1a34e4,null))[_0x027a('0x40')](handleError(_0x1a34e4,null));};exports[_0x027a('0x52')]=function(_0x2d145f,_0x8c5980,_0x1292ec){return db[_0x027a('0x25')][_0x027a('0x46')]({'where':{'id':_0x2d145f[_0x027a('0x41')]['id']}})[_0x027a('0x1f')](function(_0x1f547f){if(_0x1f547f){if(!_0x2d145f['body'][_0x027a('0x47')]||!utils[_0x027a('0x48')](_0x2d145f[_0x027a('0x53')][_0x027a('0x47')])){throw new db['Sequelize']['ValidationError'](_0x027a('0x4b'));}return _0x1f547f[_0x027a('0x36')+_[_0x027a('0x4c')](_0x2d145f[_0x027a('0x53')][_0x027a('0x47')][_0x027a('0x4d')]())+_0x027a('0x51')](_0x2d145f[_0x027a('0x53')][_0x027a('0x54')]);}return null;})['then'](handleEntityNotFound(_0x8c5980,null))[_0x027a('0x1f')](respondWithStatusCode(_0x8c5980,null))[_0x027a('0x40')](handleError(_0x8c5980,null));};exports[_0x027a('0x55')]=function(_0x572849,_0x136332,_0x272c5e){return db['Team'][_0x027a('0x46')]({'where':{'id':_0x572849[_0x027a('0x41')]['id']}})['then'](function(_0x4ac740){if(_0x4ac740){if(!_0x572849[_0x027a('0x29')][_0x027a('0x47')]||!utils[_0x027a('0x48')](_0x572849[_0x027a('0x29')]['channel'])){throw new db[(_0x027a('0x49'))][(_0x027a('0x4a'))](_0x027a('0x4b'));}return _0x4ac740['remove'+_[_0x027a('0x4c')](_0x572849['query'][_0x027a('0x47')]['toLowerCase']())+_0x027a('0x51')](_0x572849[_0x027a('0x29')][_0x027a('0x54')]);}return null;})[_0x027a('0x1f')](handleEntityNotFound(_0x136332,null))['then'](respondWithStatusCode(_0x136332,null))['catch'](handleError(_0x136332,null));};exports['addAgents']=function(_0x48456a,_0x4c492a,_0x5d3666){return db['Team'][_0x027a('0x44')]({'where':{'id':_0x48456a['params']['id']}})[_0x027a('0x1f')](handleEntityNotFound(_0x4c492a,null))['then'](function(_0x33a0fa){if(_0x33a0fa){return BPromise['each'](['voice',_0x027a('0x56'),_0x027a('0x57'),_0x027a('0x58'),'fax',_0x027a('0x59')],function(_0x5925f6){return _0x33a0fa[_0x027a('0x50')+_[_0x027a('0x4c')](_0x5925f6)+_0x027a('0x51')]({'attributes':['id','name']})[_0x027a('0x1f')](function(_0x27df3c){return BPromise[_0x027a('0x5a')](_0x27df3c,function(_0x16b968){return _0x16b968[_0x027a('0x5b')](_0x48456a[_0x027a('0x53')]['ids'])[_0x027a('0x1f')](function(){if(_0x5925f6==='voice'){return db[_0x027a('0x5c')][_0x027a('0x3e')]({'where':{'id':_0x48456a[_0x027a('0x53')][_0x027a('0x54')]},'attributes':['id','name',_0x027a('0x5d'),_0x027a('0x5e')],'raw':!![]});}})[_0x027a('0x1f')](function(_0x8a122f){if(_0x5925f6==='voice'){return BPromise[_0x027a('0x5a')](_0x8a122f,function(_0x255269){return db[_0x027a('0x5f')][_0x027a('0x60')]({'membername':_0x255269['name'],'UserId':_0x255269['id'],'queue_name':_0x16b968[_0x027a('0x61')],'VoiceQueueId':_0x16b968['id'],'interface':util[_0x027a('0x62')]('%s/%s',_0x027a('0x63'),_0x255269[_0x027a('0x61')]),'paused':_0x255269['voicePause']||![],'penalty':0x0});});}});});})[_0x027a('0x1f')](function(){return _0x33a0fa;});})[_0x027a('0x1f')](function(){return _0x33a0fa;});}})[_0x027a('0x1f')](function(_0x36247f){if(_0x36247f){return _0x36247f[_0x027a('0x5b')](_0x48456a[_0x027a('0x53')][_0x027a('0x54')],_['omit'](_0x48456a['body'],['ids','id'])||{})[_0x027a('0x64')](function(_0x212e65){for(var _0x151bf4=0x0;_0x151bf4<_0x48456a[_0x027a('0x53')][_0x027a('0x54')][_0x027a('0x2e')];_0x151bf4+=0x1){socket['emit'](_0x027a('0x65'),{'UserId':_0x48456a[_0x027a('0x53')][_0x027a('0x54')][_0x151bf4],'TeamId':_0x48456a[_0x027a('0x41')]['id']});}return _0x212e65;});}})['then'](respondWithResult(_0x4c492a,null))['catch'](handleError(_0x4c492a,null));};exports[_0x027a('0x66')]=function(_0x5b8dd4,_0x448486,_0x106c83){var _0x5e67f0;return db[_0x027a('0x25')][_0x027a('0x44')]({'where':{'id':_0x5b8dd4[_0x027a('0x41')]['id']}})[_0x027a('0x1f')](handleEntityNotFound(_0x448486,null))[_0x027a('0x1f')](function(_0x3b60a6){if(_0x3b60a6){return BPromise[_0x027a('0x5a')]([_0x027a('0x67'),_0x027a('0x56'),_0x027a('0x57'),_0x027a('0x58'),_0x027a('0x68'),_0x027a('0x59')],function(_0x33053c){return _0x3b60a6[_0x027a('0x50')+_[_0x027a('0x4c')](_0x33053c)+_0x027a('0x51')]({'attributes':['id','name']})['then'](function(_0x2e1322){return BPromise[_0x027a('0x5a')](_0x2e1322,function(_0x4badcc){return _0x4badcc[_0x027a('0x66')](_0x5b8dd4[_0x027a('0x29')][_0x027a('0x54')])[_0x027a('0x1f')](function(){if(_0x33053c===_0x027a('0x67')){return db['UserVoiceQueueRt'][_0x027a('0x20')]({'where':{'VoiceQueueId':_0x4badcc['id'],'UserId':_0x5b8dd4[_0x027a('0x29')]['ids']}});}});});})[_0x027a('0x1f')](function(){return _0x3b60a6;});})[_0x027a('0x1f')](function(){return _0x3b60a6;});}})['then'](function(_0x5d6d7b){if(_0x5d6d7b){return _0x5d6d7b[_0x027a('0x66')](_0x5b8dd4[_0x027a('0x29')][_0x027a('0x54')])[_0x027a('0x1f')](function(_0x181b9b){if(_[_0x027a('0x69')](_0x5b8dd4['query'][_0x027a('0x54')])){for(var _0x4ee188=0x0;_0x4ee188<_0x5b8dd4[_0x027a('0x29')][_0x027a('0x54')][_0x027a('0x2e')];_0x4ee188+=0x1){socket[_0x027a('0x6a')](_0x027a('0x6b'),{'UserId':_0x5b8dd4[_0x027a('0x29')]['ids'][_0x4ee188],'TeamId':_0x5b8dd4[_0x027a('0x41')]['id']});}}else{socket[_0x027a('0x6a')](_0x027a('0x6b'),{'UserId':_0x5b8dd4['query'][_0x027a('0x54')],'TeamId':_0x5b8dd4[_0x027a('0x41')]['id']});}});}})[_0x027a('0x1f')](respondWithStatusCode(_0x448486,null))[_0x027a('0x40')](handleError(_0x448486,null));};exports['getAgents']=function(_0x45347a,_0x26df1b,_0x3c4c0a){var _0x2fcec3={};var _0x1c7972={};var _0x2ab23e;var _0x33d11d;return db['Team'][_0x027a('0x46')]({'where':{'id':_0x45347a[_0x027a('0x41')]['id']}})[_0x027a('0x1f')](handleEntityNotFound(_0x26df1b,null))[_0x027a('0x1f')](function(_0x138ee3){if(_0x138ee3){_0x2ab23e=_0x138ee3;_0x1c7972[_0x027a('0x2c')]=_['keys'](db['User'][_0x027a('0x4f')]);_0x1c7972[_0x027a('0x29')]=_[_0x027a('0x26')](_0x45347a['query']);_0x1c7972[_0x027a('0x2a')]=_[_0x027a('0x2b')](_0x1c7972[_0x027a('0x2c')],_0x1c7972[_0x027a('0x29')]);_0x2fcec3[_0x027a('0x2d')]=_[_0x027a('0x2b')](_0x1c7972[_0x027a('0x2c')],qs[_0x027a('0x42')](_0x45347a[_0x027a('0x29')]['fields']));_0x2fcec3['attributes']=_0x2fcec3[_0x027a('0x2d')][_0x027a('0x2e')]?_0x2fcec3[_0x027a('0x2d')]:_0x1c7972[_0x027a('0x2c')];_0x2fcec3[_0x027a('0x31')]=qs[_0x027a('0x32')](_0x45347a[_0x027a('0x29')][_0x027a('0x32')]);_0x2fcec3['where']=qs[_0x027a('0x2a')](_[_0x027a('0x34')](_0x45347a[_0x027a('0x29')],_0x1c7972[_0x027a('0x2a')]));if(_0x45347a[_0x027a('0x29')][_0x027a('0x37')]){_0x2fcec3[_0x027a('0x33')]=_[_0x027a('0x38')](_0x2fcec3['where'],{'$or':_[_0x027a('0x39')](_0x2fcec3[_0x027a('0x2d')],function(_0x44097c){var _0x252123={};_0x252123[_0x44097c]={'$like':'%'+_0x45347a[_0x027a('0x29')][_0x027a('0x37')]+'%'};return _0x252123;})});}_0x2fcec3=_[_0x027a('0x38')]({},_0x2fcec3,_0x45347a[_0x027a('0x3a')]);return _0x2ab23e[_0x027a('0x6c')](_0x2fcec3);}})[_0x027a('0x1f')](function(_0xee5a46){if(_0xee5a46){_0x33d11d=_0xee5a46['length'];if(!_0x45347a[_0x027a('0x29')][_0x027a('0x2f')](_0x027a('0x30'))){_0x2fcec3['limit']=qs[_0x027a('0x1b')](_0x45347a[_0x027a('0x29')][_0x027a('0x1b')]);_0x2fcec3[_0x027a('0x1a')]=qs[_0x027a('0x1a')](_0x45347a[_0x027a('0x29')][_0x027a('0x1a')]);}return _0x2ab23e['getAgents'](_0x2fcec3);}})['then'](function(_0x1cea2a){if(_0x1cea2a){return _0x1cea2a?{'count':_0x33d11d,'rows':_0x1cea2a}:null;}})[_0x027a('0x1f')](respondWithResult(_0x26df1b,null))['catch'](handleError(_0x26df1b,null));};
\ No newline at end of file
+var _0x6455=['findAll','catch','show','params','find','create','body','update','getQueues','findOne','isValidChannel','channel','Sequelize','ValidationError','toLowerCase','Queue','get','capitalize','Queues','addQueues','Unknown\x20channel','ids','each','voice','chat','mail','sms','fax','name','addAgents','User','loginInPause','UserVoiceQueueRt','format','SIP','voicePause','omit','spread','emit','removeAgents','openchannel','isArray','userTeam:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','localhost','register','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','then','destroy','Team','rawAttributes','model','keys','query','dateStart','dateEnd','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','day','add','filter','merge','map','options','includeAll','include'];(function(_0x51461b,_0x32ad42){var _0x1a66c4=function(_0x291777){while(--_0x291777){_0x51461b['push'](_0x51461b['shift']());}};_0x1a66c4(++_0x32ad42);}(_0x6455,0x97));var _0x5645=function(_0x2227da,_0x1641bf){_0x2227da=_0x2227da-0x0;var _0x259e11=_0x6455[_0x2227da];return _0x259e11;};'use strict';var pdf=require(_0x5645('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5645('0x1'));var zipdir=require(_0x5645('0x2'));var jsonpatch=require(_0x5645('0x3'));var rp=require(_0x5645('0x4'));var moment=require(_0x5645('0x5'));var BPromise=require(_0x5645('0x6'));var Mustache=require('mustache');var util=require(_0x5645('0x7'));var path=require(_0x5645('0x8'));var sox=require(_0x5645('0x9'));var csv=require(_0x5645('0xa'));var ejs=require(_0x5645('0xb'));var fs=require('fs');var _=require(_0x5645('0xc'));var squel=require(_0x5645('0xd'));var crypto=require(_0x5645('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5645('0xa'));var querystring=require(_0x5645('0xf'));var Papa=require(_0x5645('0x10'));var qs=require(_0x5645('0x11'));var logger=require(_0x5645('0x12'))(_0x5645('0x13'));var utils=require('../../config/utils');var config=require(_0x5645('0x14'));var db=require(_0x5645('0x15'))['db'];var socket=require(_0x5645('0x16'))({'host':_0x5645('0x17'),'port':0x18eb});require('./team.socket')[_0x5645('0x18')](socket);function respondWithStatusCode(_0x5ecb2a,_0x42f5cd){_0x42f5cd=_0x42f5cd||0xcc;return function(_0x4014c5){if(_0x4014c5){return _0x5ecb2a[_0x5645('0x19')](_0x42f5cd);}return _0x5ecb2a[_0x5645('0x1a')](_0x42f5cd)[_0x5645('0x1b')]();};}function respondWithResult(_0x199a88,_0x45cbe8){_0x45cbe8=_0x45cbe8||0xc8;return function(_0x2270a1){if(_0x2270a1){return _0x199a88['status'](_0x45cbe8)[_0x5645('0x1c')](_0x2270a1);}};}function respondWithFilteredResult(_0x3e0ec6,_0x25863f){return function(_0x4cbd46){if(_0x4cbd46){var _0x4b3be6=_0x4cbd46[_0x5645('0x1d')],_0x439b55=_0x25863f[_0x5645('0x1e')],_0x361cfd=_0x25863f[_0x5645('0x1e')]+_0x25863f['limit'],_0x511aed;if(_0x361cfd>=_0x4b3be6){_0x361cfd=_0x4b3be6;_0x511aed=0xc8;}else{_0x511aed=0xce;}_0x3e0ec6[_0x5645('0x1a')](_0x511aed);return _0x3e0ec6[_0x5645('0x1f')](_0x5645('0x20'),_0x439b55+'-'+_0x361cfd+'/'+_0x4b3be6)[_0x5645('0x1c')](_0x4cbd46);}return null;};}function patchUpdates(_0x5ac9ee){return function(_0x1853a7){try{jsonpatch['apply'](_0x1853a7,_0x5ac9ee,!![]);}catch(_0x557ad2){return BPromise[_0x5645('0x21')](_0x557ad2);}return _0x1853a7[_0x5645('0x22')]();};}function saveUpdates(_0x2e3350,_0x59a491){return function(_0x35a672){if(_0x35a672){return _0x35a672['update'](_0x2e3350)[_0x5645('0x23')](function(_0x5f186f){return _0x5f186f;});}return null;};}function removeEntity(_0x4f82d0,_0x1ee2fb){return function(_0x53d763){if(_0x53d763){return _0x53d763[_0x5645('0x24')]()[_0x5645('0x23')](function(){_0x4f82d0['status'](0xcc)[_0x5645('0x1b')]();});}};}function handleEntityNotFound(_0x116bfc,_0xe83ed7){return function(_0x50fa82){if(!_0x50fa82){_0x116bfc[_0x5645('0x19')](0x194);}return _0x50fa82;};}function handleError(_0xc38038,_0x3f6929){_0x3f6929=_0x3f6929||0x1f4;return function(_0x46b33a){logger['error'](_0x46b33a['stack']);if(_0x46b33a['name']){delete _0x46b33a['name'];}_0xc38038[_0x5645('0x1a')](_0x3f6929)['send'](_0x46b33a);};}exports['index']=function(_0xfbe837,_0x12f43a){var _0x357388={},_0x308991={},_0x3a5c61={'count':0x0,'rows':[]};var _0x351cbb=db[_0x5645('0x25')][_0x5645('0x26')];_0x308991[_0x5645('0x27')]=_[_0x5645('0x28')](_0x351cbb);var _0x1c0aa2={'dateStart':_0xfbe837[_0x5645('0x29')][_0x5645('0x2a')],'dateEnd':_0xfbe837[_0x5645('0x29')]['dateEnd']};delete _0xfbe837[_0x5645('0x29')]['dateStart'];delete _0xfbe837[_0x5645('0x29')][_0x5645('0x2b')];_0x308991[_0x5645('0x29')]=_[_0x5645('0x28')](_0xfbe837[_0x5645('0x29')]);_0x308991[_0x5645('0x2c')]=_['intersection'](_0x308991['model'],_0x308991[_0x5645('0x29')]);_0x357388[_0x5645('0x2d')]=_[_0x5645('0x2e')](_0x308991[_0x5645('0x27')],qs[_0x5645('0x2f')](_0xfbe837[_0x5645('0x29')][_0x5645('0x2f')]));_0x357388[_0x5645('0x2d')]=_0x357388[_0x5645('0x2d')][_0x5645('0x30')]?_0x357388[_0x5645('0x2d')]:_0x308991['model'];if(!_0xfbe837['query'][_0x5645('0x31')]('nolimit')){_0x357388[_0x5645('0x32')]=qs['limit'](_0xfbe837[_0x5645('0x29')]['limit']);_0x357388[_0x5645('0x1e')]=qs[_0x5645('0x1e')](_0xfbe837[_0x5645('0x29')][_0x5645('0x1e')]);}_0x357388[_0x5645('0x33')]=qs[_0x5645('0x34')](_0xfbe837['query'][_0x5645('0x34')]);_0x357388[_0x5645('0x35')]=qs[_0x5645('0x2c')](_[_0x5645('0x36')](_0xfbe837[_0x5645('0x29')],_0x308991[_0x5645('0x2c')]));if(_0x1c0aa2[_0x5645('0x2a')]){if(_0x1c0aa2[_0x5645('0x2b')]){_0x1c0aa2['dateEnd']=moment(_0x1c0aa2[_0x5645('0x2b')])['add'](0x1,_0x5645('0x37'));}else{_0x1c0aa2[_0x5645('0x2b')]=moment(_0x1c0aa2[_0x5645('0x2a')])[_0x5645('0x38')](0x1,_0x5645('0x37'));}_['merge'](_0x357388[_0x5645('0x35')],{'createdAt':{'$gte':_0x1c0aa2[_0x5645('0x2a')],'$lte':_0x1c0aa2[_0x5645('0x2b')]}});}if(_0xfbe837[_0x5645('0x29')][_0x5645('0x39')]){_0x357388[_0x5645('0x35')]=_[_0x5645('0x3a')](_0x357388[_0x5645('0x35')],{'$or':_[_0x5645('0x3b')](_0x357388[_0x5645('0x2d')],function(_0x439571){var _0x19bbdb={};_0x19bbdb[_0x439571]={'$like':'%'+_0xfbe837[_0x5645('0x29')][_0x5645('0x39')]+'%'};return _0x19bbdb;})});}_0x357388=_[_0x5645('0x3a')]({},_0x357388,_0xfbe837[_0x5645('0x3c')]);var _0x58e70e={'where':_0x357388[_0x5645('0x35')]};return db[_0x5645('0x25')]['count'](_0x58e70e)[_0x5645('0x23')](function(_0x3b835f){_0x3a5c61['count']=_0x3b835f;if(_0xfbe837[_0x5645('0x29')][_0x5645('0x3d')]){_0x357388[_0x5645('0x3e')]=[{'all':!![]}];}return db[_0x5645('0x25')][_0x5645('0x3f')](_0x357388);})[_0x5645('0x23')](function(_0x34c57b){_0x3a5c61['rows']=_0x34c57b;return _0x3a5c61;})['then'](respondWithFilteredResult(_0x12f43a,_0x357388))[_0x5645('0x40')](handleError(_0x12f43a,null));};exports[_0x5645('0x41')]=function(_0x4241d8,_0x126b2d){var _0x3b5897={'raw':![],'where':{'id':_0x4241d8[_0x5645('0x42')]['id']}},_0x4001e4={};_0x4001e4[_0x5645('0x27')]=_[_0x5645('0x28')](db[_0x5645('0x25')][_0x5645('0x26')]);_0x4001e4[_0x5645('0x29')]=_[_0x5645('0x28')](_0x4241d8[_0x5645('0x29')]);_0x4001e4[_0x5645('0x2c')]=_[_0x5645('0x2e')](_0x4001e4[_0x5645('0x27')],_0x4001e4['query']);_0x3b5897['attributes']=_['intersection'](_0x4001e4['model'],qs[_0x5645('0x2f')](_0x4241d8[_0x5645('0x29')][_0x5645('0x2f')]));_0x3b5897[_0x5645('0x2d')]=_0x3b5897[_0x5645('0x2d')]['length']?_0x3b5897[_0x5645('0x2d')]:_0x4001e4[_0x5645('0x27')];if(_0x4241d8[_0x5645('0x29')][_0x5645('0x3d')]){_0x3b5897[_0x5645('0x3e')]=[{'all':!![]}];}_0x3b5897=_['merge']({},_0x3b5897,_0x4241d8[_0x5645('0x3c')]);return db[_0x5645('0x25')][_0x5645('0x43')](_0x3b5897)[_0x5645('0x23')](handleEntityNotFound(_0x126b2d,null))[_0x5645('0x23')](respondWithResult(_0x126b2d,null))[_0x5645('0x40')](handleError(_0x126b2d,null));};exports[_0x5645('0x44')]=function(_0x33f841,_0x4d081a){return db['Team'][_0x5645('0x44')](_0x33f841[_0x5645('0x45')],{})['then'](respondWithResult(_0x4d081a,0xc9))['catch'](handleError(_0x4d081a,null));};exports[_0x5645('0x46')]=function(_0x567a08,_0x1822f5){if(_0x567a08[_0x5645('0x45')]['id']){delete _0x567a08[_0x5645('0x45')]['id'];}return db[_0x5645('0x25')][_0x5645('0x43')]({'where':{'id':_0x567a08['params']['id']}})[_0x5645('0x23')](handleEntityNotFound(_0x1822f5,null))['then'](saveUpdates(_0x567a08['body'],null))[_0x5645('0x23')](respondWithResult(_0x1822f5,null))[_0x5645('0x40')](handleError(_0x1822f5,null));};exports[_0x5645('0x24')]=function(_0x46637f,_0x2fd803){return db[_0x5645('0x25')][_0x5645('0x43')]({'where':{'id':_0x46637f[_0x5645('0x42')]['id']}})[_0x5645('0x23')](handleEntityNotFound(_0x2fd803,null))[_0x5645('0x23')](removeEntity(_0x2fd803,null))[_0x5645('0x40')](handleError(_0x2fd803,null));};exports[_0x5645('0x47')]=function(_0x4d56f5,_0x51b234,_0x30932d){return db[_0x5645('0x25')][_0x5645('0x48')]({'where':{'id':_0x4d56f5[_0x5645('0x42')]['id']}})[_0x5645('0x23')](handleEntityNotFound(_0x51b234,null))['then'](function(_0x162761){if(!_0x4d56f5[_0x5645('0x29')]['channel']||!utils[_0x5645('0x49')](_0x4d56f5[_0x5645('0x29')][_0x5645('0x4a')])){throw new db[(_0x5645('0x4b'))][(_0x5645('0x4c'))]('Unknown\x20channel');}var _0x22f3a0={};var _0xd1f0b={};_0xd1f0b[_0x5645('0x27')]=_[_0x5645('0x28')](db[_['capitalize'](_0x4d56f5[_0x5645('0x29')][_0x5645('0x4a')][_0x5645('0x4d')]())+_0x5645('0x4e')][_0x5645('0x26')]);_0xd1f0b[_0x5645('0x29')]=_[_0x5645('0x28')](_0x4d56f5[_0x5645('0x29')]);_0xd1f0b[_0x5645('0x2c')]=_['intersection'](_0xd1f0b[_0x5645('0x27')],_0xd1f0b[_0x5645('0x29')]);_0x22f3a0['attributes']=_['intersection'](_0xd1f0b[_0x5645('0x27')],qs['fields'](_0x4d56f5[_0x5645('0x29')][_0x5645('0x2f')]));_0x22f3a0[_0x5645('0x2d')]=_0x22f3a0[_0x5645('0x2d')][_0x5645('0x30')]?_0x22f3a0[_0x5645('0x2d')]:_0xd1f0b[_0x5645('0x27')];_0x22f3a0['limit']=qs[_0x5645('0x32')](_0x4d56f5[_0x5645('0x29')][_0x5645('0x32')]);_0x22f3a0[_0x5645('0x1e')]=qs[_0x5645('0x1e')](_0x4d56f5[_0x5645('0x29')][_0x5645('0x1e')]);_0x22f3a0[_0x5645('0x33')]=qs['sort'](_0x4d56f5[_0x5645('0x29')][_0x5645('0x34')]);_0x22f3a0[_0x5645('0x35')]=qs[_0x5645('0x2c')](_['pick'](_0x4d56f5[_0x5645('0x29')],_0xd1f0b[_0x5645('0x2c')]));_0x22f3a0=_[_0x5645('0x3a')]({},_0x22f3a0,_0x4d56f5[_0x5645('0x3c')]);return _0x162761[_0x5645('0x4f')+_[_0x5645('0x50')](_0x4d56f5[_0x5645('0x29')][_0x5645('0x4a')]['toLowerCase']())+_0x5645('0x51')](_0x22f3a0);})[_0x5645('0x23')](respondWithResult(_0x51b234,null))[_0x5645('0x40')](handleError(_0x51b234,null));};exports[_0x5645('0x52')]=function(_0x63876b,_0x29663b,_0x4e2f97){return db[_0x5645('0x25')][_0x5645('0x48')]({'where':{'id':_0x63876b[_0x5645('0x42')]['id']}})[_0x5645('0x23')](function(_0x584739){if(_0x584739){if(!_0x63876b['body'][_0x5645('0x4a')]||!utils[_0x5645('0x49')](_0x63876b[_0x5645('0x45')]['channel'])){throw new db[(_0x5645('0x4b'))][(_0x5645('0x4c'))](_0x5645('0x53'));}return _0x584739[_0x5645('0x38')+_[_0x5645('0x50')](_0x63876b[_0x5645('0x45')][_0x5645('0x4a')][_0x5645('0x4d')]())+'Queues'](_0x63876b[_0x5645('0x45')][_0x5645('0x54')]);}return null;})[_0x5645('0x23')](handleEntityNotFound(_0x29663b,null))[_0x5645('0x23')](respondWithStatusCode(_0x29663b,null))[_0x5645('0x40')](handleError(_0x29663b,null));};exports['removeQueues']=function(_0x595c78,_0xdacc11,_0x5d2934){return db['Team']['findOne']({'where':{'id':_0x595c78[_0x5645('0x42')]['id']}})[_0x5645('0x23')](function(_0x4abd15){if(_0x4abd15){if(!_0x595c78[_0x5645('0x29')][_0x5645('0x4a')]||!utils['isValidChannel'](_0x595c78[_0x5645('0x29')]['channel'])){throw new db[(_0x5645('0x4b'))]['ValidationError'](_0x5645('0x53'));}return _0x4abd15['remove'+_['capitalize'](_0x595c78[_0x5645('0x29')]['channel'][_0x5645('0x4d')]())+_0x5645('0x51')](_0x595c78[_0x5645('0x29')]['ids']);}return null;})[_0x5645('0x23')](handleEntityNotFound(_0xdacc11,null))[_0x5645('0x23')](respondWithStatusCode(_0xdacc11,null))['catch'](handleError(_0xdacc11,null));};exports['addAgents']=function(_0x592cf5,_0x573baa,_0xe60909){return db[_0x5645('0x25')]['find']({'where':{'id':_0x592cf5[_0x5645('0x42')]['id']}})[_0x5645('0x23')](handleEntityNotFound(_0x573baa,null))[_0x5645('0x23')](function(_0x3fa937){if(_0x3fa937){return BPromise[_0x5645('0x55')]([_0x5645('0x56'),_0x5645('0x57'),_0x5645('0x58'),_0x5645('0x59'),_0x5645('0x5a'),'openchannel'],function(_0x27d126){return _0x3fa937['get'+_[_0x5645('0x50')](_0x27d126)+'Queues']({'attributes':['id',_0x5645('0x5b')]})['then'](function(_0x20cf8b){return BPromise[_0x5645('0x55')](_0x20cf8b,function(_0x31f0e4){return _0x31f0e4[_0x5645('0x5c')](_0x592cf5[_0x5645('0x45')][_0x5645('0x54')])[_0x5645('0x23')](function(){if(_0x27d126===_0x5645('0x56')){return db[_0x5645('0x5d')][_0x5645('0x3f')]({'where':{'id':_0x592cf5[_0x5645('0x45')][_0x5645('0x54')]},'attributes':['id',_0x5645('0x5b'),_0x5645('0x5e'),'voicePause'],'raw':!![]});}})[_0x5645('0x23')](function(_0x19621a){if(_0x27d126===_0x5645('0x56')){return BPromise['each'](_0x19621a,function(_0x4f1fd2){return db[_0x5645('0x5f')]['upsert']({'membername':_0x4f1fd2['name'],'UserId':_0x4f1fd2['id'],'queue_name':_0x31f0e4[_0x5645('0x5b')],'VoiceQueueId':_0x31f0e4['id'],'interface':util[_0x5645('0x60')]('%s/%s',_0x5645('0x61'),_0x4f1fd2[_0x5645('0x5b')]),'paused':_0x4f1fd2[_0x5645('0x62')]||![],'penalty':0x0});});}});});})[_0x5645('0x23')](function(){return _0x3fa937;});})[_0x5645('0x23')](function(){return _0x3fa937;});}})[_0x5645('0x23')](function(_0xe8b245){if(_0xe8b245){return _0xe8b245[_0x5645('0x5c')](_0x592cf5[_0x5645('0x45')][_0x5645('0x54')],_[_0x5645('0x63')](_0x592cf5[_0x5645('0x45')],['ids','id'])||{})[_0x5645('0x64')](function(_0x3bc3c9){for(var _0x581d61=0x0;_0x581d61<_0x592cf5[_0x5645('0x45')][_0x5645('0x54')][_0x5645('0x30')];_0x581d61+=0x1){socket[_0x5645('0x65')]('userTeam:save',{'UserId':_0x592cf5['body']['ids'][_0x581d61],'TeamId':_0x592cf5[_0x5645('0x42')]['id']});}return _0x3bc3c9;});}})[_0x5645('0x23')](respondWithResult(_0x573baa,null))[_0x5645('0x40')](handleError(_0x573baa,null));};exports[_0x5645('0x66')]=function(_0x4ac972,_0x2c4c76,_0x5b2e75){var _0x29ed99;return db[_0x5645('0x25')][_0x5645('0x43')]({'where':{'id':_0x4ac972['params']['id']}})[_0x5645('0x23')](handleEntityNotFound(_0x2c4c76,null))[_0x5645('0x23')](function(_0x227f2b){if(_0x227f2b){return BPromise[_0x5645('0x55')]([_0x5645('0x56'),_0x5645('0x57'),_0x5645('0x58'),_0x5645('0x59'),'fax',_0x5645('0x67')],function(_0x246964){return _0x227f2b['get'+_[_0x5645('0x50')](_0x246964)+_0x5645('0x51')]({'attributes':['id',_0x5645('0x5b')]})[_0x5645('0x23')](function(_0x23cb4c){return BPromise[_0x5645('0x55')](_0x23cb4c,function(_0x52c19e){return _0x52c19e[_0x5645('0x66')](_0x4ac972['query'][_0x5645('0x54')])[_0x5645('0x23')](function(){if(_0x246964===_0x5645('0x56')){return db[_0x5645('0x5f')][_0x5645('0x24')]({'where':{'VoiceQueueId':_0x52c19e['id'],'UserId':_0x4ac972['query'][_0x5645('0x54')]}});}});});})[_0x5645('0x23')](function(){return _0x227f2b;});})[_0x5645('0x23')](function(){return _0x227f2b;});}})[_0x5645('0x23')](function(_0xfcc599){if(_0xfcc599){return _0xfcc599[_0x5645('0x66')](_0x4ac972[_0x5645('0x29')][_0x5645('0x54')])['then'](function(_0x144dac){if(_[_0x5645('0x68')](_0x4ac972[_0x5645('0x29')][_0x5645('0x54')])){for(var _0x389c07=0x0;_0x389c07<_0x4ac972[_0x5645('0x29')][_0x5645('0x54')][_0x5645('0x30')];_0x389c07+=0x1){socket[_0x5645('0x65')](_0x5645('0x69'),{'UserId':_0x4ac972[_0x5645('0x29')][_0x5645('0x54')][_0x389c07],'TeamId':_0x4ac972[_0x5645('0x42')]['id']});}}else{socket[_0x5645('0x65')](_0x5645('0x69'),{'UserId':_0x4ac972[_0x5645('0x29')][_0x5645('0x54')],'TeamId':_0x4ac972[_0x5645('0x42')]['id']});}});}})[_0x5645('0x23')](respondWithStatusCode(_0x2c4c76,null))[_0x5645('0x40')](handleError(_0x2c4c76,null));};exports[_0x5645('0x6a')]=function(_0x27a3fa,_0x441ab6,_0x29f7fe){var _0x59fc89={};var _0x1410fd={};var _0x1431ab;var _0x495d89;return db['Team'][_0x5645('0x48')]({'where':{'id':_0x27a3fa[_0x5645('0x42')]['id']}})[_0x5645('0x23')](handleEntityNotFound(_0x441ab6,null))[_0x5645('0x23')](function(_0x5c1c80){if(_0x5c1c80){_0x1431ab=_0x5c1c80;_0x1410fd[_0x5645('0x27')]=_[_0x5645('0x28')](db['User'][_0x5645('0x26')]);_0x1410fd[_0x5645('0x29')]=_[_0x5645('0x28')](_0x27a3fa['query']);_0x1410fd[_0x5645('0x2c')]=_[_0x5645('0x2e')](_0x1410fd[_0x5645('0x27')],_0x1410fd[_0x5645('0x29')]);_0x59fc89['attributes']=_[_0x5645('0x2e')](_0x1410fd[_0x5645('0x27')],qs[_0x5645('0x2f')](_0x27a3fa[_0x5645('0x29')]['fields']));_0x59fc89[_0x5645('0x2d')]=_0x59fc89['attributes'][_0x5645('0x30')]?_0x59fc89[_0x5645('0x2d')]:_0x1410fd[_0x5645('0x27')];_0x59fc89[_0x5645('0x33')]=qs[_0x5645('0x34')](_0x27a3fa[_0x5645('0x29')][_0x5645('0x34')]);_0x59fc89['where']=qs[_0x5645('0x2c')](_['pick'](_0x27a3fa[_0x5645('0x29')],_0x1410fd[_0x5645('0x2c')]));if(_0x27a3fa[_0x5645('0x29')][_0x5645('0x39')]){_0x59fc89['where']=_[_0x5645('0x3a')](_0x59fc89[_0x5645('0x35')],{'$or':_[_0x5645('0x3b')](_0x59fc89[_0x5645('0x2d')],function(_0x4068ee){var _0x783995={};_0x783995[_0x4068ee]={'$like':'%'+_0x27a3fa[_0x5645('0x29')]['filter']+'%'};return _0x783995;})});}_0x59fc89=_[_0x5645('0x3a')]({},_0x59fc89,_0x27a3fa[_0x5645('0x3c')]);return _0x1431ab['getAgents'](_0x59fc89);}})[_0x5645('0x23')](function(_0x190283){if(_0x190283){_0x495d89=_0x190283[_0x5645('0x30')];if(!_0x27a3fa[_0x5645('0x29')][_0x5645('0x31')]('nolimit')){_0x59fc89[_0x5645('0x32')]=qs[_0x5645('0x32')](_0x27a3fa['query'][_0x5645('0x32')]);_0x59fc89[_0x5645('0x1e')]=qs[_0x5645('0x1e')](_0x27a3fa['query'][_0x5645('0x1e')]);}return _0x1431ab[_0x5645('0x6a')](_0x59fc89);}})['then'](function(_0x29cd36){if(_0x29cd36){return _0x29cd36?{'count':_0x495d89,'rows':_0x29cd36}:null;}})[_0x5645('0x23')](respondWithResult(_0x441ab6,null))[_0x5645('0x40')](handleError(_0x441ab6,null));};
\ No newline at end of file
index 0029273..0f18244 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb13=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners','update'];(function(_0x509edc,_0x238e97){var _0x2fcdd3=function(_0x5e5801){while(--_0x5e5801){_0x509edc['push'](_0x509edc['shift']());}};_0x2fcdd3(++_0x238e97);}(_0xbb13,0x91));var _0x3bb1=function(_0xddf136,_0x1974ad){_0xddf136=_0xddf136-0x0;var _0x16e835=_0xbb13[_0xddf136];return _0x16e835;};'use strict';var EventEmitter=require(_0x3bb1('0x0'));var Team=require(_0x3bb1('0x1'))['db'][_0x3bb1('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x3bb1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3bb1('0x4'),'afterDestroy':_0x3bb1('0x5')};function emitEvent(_0x586b72){return function(_0x551d7b,_0x356091,_0x3614b5){TeamEvents['emit'](_0x586b72+':'+_0x551d7b['id'],_0x551d7b);TeamEvents[_0x3bb1('0x6')](_0x586b72,_0x551d7b);_0x3614b5(null);};}for(var e in events){if(events[_0x3bb1('0x7')](e)){var event=events[e];Team[_0x3bb1('0x8')](e,emitEvent(event));}}module[_0x3bb1('0x9')]=TeamEvents;
\ No newline at end of file
+var _0x15a4=['../../mysqldb','Team','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2d72c4,_0x575a80){var _0x377843=function(_0x89d475){while(--_0x89d475){_0x2d72c4['push'](_0x2d72c4['shift']());}};_0x377843(++_0x575a80);}(_0x15a4,0x1f3));var _0x415a=function(_0x400f7c,_0x2f7975){_0x400f7c=_0x400f7c-0x0;var _0x1917c1=_0x15a4[_0x400f7c];return _0x1917c1;};'use strict';var EventEmitter=require(_0x415a('0x0'));var Team=require(_0x415a('0x1'))['db'][_0x415a('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x415a('0x3')](0x0);var events={'afterCreate':_0x415a('0x4'),'afterUpdate':'update','afterDestroy':_0x415a('0x5')};function emitEvent(_0x4dfae6){return function(_0x1d7935,_0x2287ca,_0x289591){TeamEvents[_0x415a('0x6')](_0x4dfae6+':'+_0x1d7935['id'],_0x1d7935);TeamEvents['emit'](_0x4dfae6,_0x1d7935);_0x289591(null);};}for(var e in events){if(events[_0x415a('0x7')](e)){var event=events[e];Team[_0x415a('0x8')](e,emitEvent(event));}}module[_0x415a('0x9')]=TeamEvents;
\ No newline at end of file
index b67ec87..ee09436 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','./team.attributes','exports','define','Team','teams','util'];(function(_0x3f7eca,_0x185d42){var _0x1a47b5=function(_0x10e8e9){while(--_0x10e8e9){_0x3f7eca['push'](_0x3f7eca['shift']());}};_0x1a47b5(++_0x185d42);}(_0xedd9,0xfc));var _0x9edd=function(_0xb35738,_0x48d98c){_0xb35738=_0xb35738-0x0;var _0x6698f3=_0xedd9[_0xb35738];return _0x6698f3;};'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 attributes=require(_0x9edd('0x6'));module[_0x9edd('0x7')]=function(_0x5943b3,_0x33679f){return _0x5943b3[_0x9edd('0x8')](_0x9edd('0x9'),attributes,{'tableName':_0x9edd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['exports','define','teams','lodash','util','../../config/logger','bluebird','./team.attributes'];(function(_0xbbb4d8,_0x9f774e){var _0x5d68ea=function(_0x9488b8){while(--_0x9488b8){_0xbbb4d8['push'](_0xbbb4d8['shift']());}};_0x5d68ea(++_0x9f774e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 attributes=require(_0x0a9e('0x4'));module[_0x0a9e('0x5')]=function(_0x2ab90b,_0x991246){return _0x2ab90b[_0x0a9e('0x6')]('Team',attributes,{'tableName':_0x0a9e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2a525a4..c09a558 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05ae=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','socket.io-emitter','localhost','./team.socket','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','bluebird','randomstring'];(function(_0x2dc098,_0x48eb28){var _0x391d8d=function(_0x54bdb7){while(--_0x54bdb7){_0x2dc098['push'](_0x2dc098['shift']());}};_0x391d8d(++_0x48eb28);}(_0x05ae,0xef));var _0xe05a=function(_0x5dbc50,_0x13457){_0x5dbc50=_0x5dbc50-0x0;var _0x535186=_0x05ae[_0x5dbc50];return _0x535186;};'use strict';var _=require('lodash');var util=require(_0xe05a('0x0'));var moment=require('moment');var BPromise=require(_0xe05a('0x1'));var rs=require(_0xe05a('0x2'));var fs=require('fs');var db=require(_0xe05a('0x3'))['db'];var utils=require(_0xe05a('0x4'));var logger=require(_0xe05a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe05a('0x6'));var client=jayson[_0xe05a('0x7')][_0xe05a('0x8')]({'port':0x232a});var socket=require(_0xe05a('0x9'))({'host':_0xe05a('0xa'),'port':0x18eb});require(_0xe05a('0xb'))['register'](socket);function respondWithRpcPromise(_0x190637,_0x8b8a0b,_0xfd5110){return new BPromise(function(_0x2e0a22,_0x14fc41){return client[_0xe05a('0xc')](_0x190637,_0xfd5110)['then'](function(_0x326cc7){logger[_0xe05a('0xd')](_0xe05a('0xe'),_0x8b8a0b,_0xe05a('0xf'));logger[_0xe05a('0x10')](_0xe05a('0x11'),_0x8b8a0b,_0xe05a('0xf'),JSON['stringify'](_0x326cc7));if(_0x326cc7[_0xe05a('0x12')]){if(_0x326cc7['error']['code']===0x1f4){logger[_0xe05a('0x12')](_0xe05a('0xe'),_0x8b8a0b,_0x326cc7[_0xe05a('0x12')]['message']);return _0x14fc41(_0x326cc7[_0xe05a('0x12')][_0xe05a('0x13')]);}logger['error'](_0xe05a('0xe'),_0x8b8a0b,_0x326cc7[_0xe05a('0x12')][_0xe05a('0x13')]);return _0x2e0a22(_0x326cc7[_0xe05a('0x12')][_0xe05a('0x13')]);}else{logger[_0xe05a('0xd')](_0xe05a('0xe'),_0x8b8a0b,_0xe05a('0xf'));_0x2e0a22(_0x326cc7[_0xe05a('0x14')][_0xe05a('0x13')]);}})[_0xe05a('0x15')](function(_0x5d5688){logger[_0xe05a('0x12')](_0xe05a('0xe'),_0x8b8a0b,_0x5d5688);_0x14fc41(_0x5d5688);});});}
\ No newline at end of file
+var _0x91d3=['./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','socket.io-emitter','localhost'];(function(_0x3dae55,_0x42a87b){var _0x156a13=function(_0x1aa91f){while(--_0x1aa91f){_0x3dae55['push'](_0x3dae55['shift']());}};_0x156a13(++_0x42a87b);}(_0x91d3,0xbc));var _0x391d=function(_0x5a0420,_0x5c4e95){_0x5a0420=_0x5a0420-0x0;var _0x55db3b=_0x91d3[_0x5a0420];return _0x55db3b;};'use strict';var _=require(_0x391d('0x0'));var util=require(_0x391d('0x1'));var moment=require(_0x391d('0x2'));var BPromise=require(_0x391d('0x3'));var rs=require(_0x391d('0x4'));var fs=require('fs');var db=require(_0x391d('0x5'))['db'];var utils=require(_0x391d('0x6'));var logger=require(_0x391d('0x7'))('rpc');var config=require(_0x391d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x391d('0x9')]['http']({'port':0x232a});var socket=require(_0x391d('0xa'))({'host':_0x391d('0xb'),'port':0x18eb});require(_0x391d('0xc'))[_0x391d('0xd')](socket);function respondWithRpcPromise(_0x491094,_0x3cbd74,_0x1156b5){return new BPromise(function(_0x229cdd,_0x3af5f3){return client[_0x391d('0xe')](_0x491094,_0x1156b5)[_0x391d('0xf')](function(_0x49f71f){logger[_0x391d('0x10')](_0x391d('0x11'),_0x3cbd74,_0x391d('0x12'));logger['debug'](_0x391d('0x13'),_0x3cbd74,_0x391d('0x12'),JSON[_0x391d('0x14')](_0x49f71f));if(_0x49f71f['error']){if(_0x49f71f[_0x391d('0x15')][_0x391d('0x16')]===0x1f4){logger[_0x391d('0x15')]('Team,\x20%s,\x20%s',_0x3cbd74,_0x49f71f[_0x391d('0x15')][_0x391d('0x17')]);return _0x3af5f3(_0x49f71f[_0x391d('0x15')][_0x391d('0x17')]);}logger[_0x391d('0x15')](_0x391d('0x11'),_0x3cbd74,_0x49f71f[_0x391d('0x15')]['message']);return _0x229cdd(_0x49f71f[_0x391d('0x15')][_0x391d('0x17')]);}else{logger[_0x391d('0x10')]('Team,\x20%s,\x20%s',_0x3cbd74,_0x391d('0x12'));_0x229cdd(_0x49f71f['result'][_0x391d('0x17')]);}})[_0x391d('0x18')](function(_0x6f65a4){logger[_0x391d('0x15')](_0x391d('0x11'),_0x3cbd74,_0x6f65a4);_0x3af5f3(_0x6f65a4);});});}
\ No newline at end of file
index 034e72e..536a18f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a92=['./team.events','save','remove','emit','removeListener','register'];(function(_0x3b8b15,_0x20288d){var _0x2ff593=function(_0x272665){while(--_0x272665){_0x3b8b15['push'](_0x3b8b15['shift']());}};_0x2ff593(++_0x20288d);}(_0x1a92,0xcc));var _0x21a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a92[_0x3dd15e];return _0x231fd0;};'use strict';var TeamEvents=require(_0x21a9('0x0'));var events=[_0x21a9('0x1'),_0x21a9('0x2'),'update'];function createListener(_0x395316,_0x49f204){return function(_0x49b05f){_0x49f204[_0x21a9('0x3')](_0x395316,_0x49b05f);};}function removeListener(_0x52d880,_0x457ff5){return function(){TeamEvents[_0x21a9('0x4')](_0x52d880,_0x457ff5);};}exports[_0x21a9('0x5')]=function(_0x4bda81){for(var _0x5073fb=0x0,_0x33b2de=events['length'];_0x5073fb<_0x33b2de;_0x5073fb++){var _0x5e3b6f=events[_0x5073fb];var _0x3ddeb0=createListener('team:'+_0x5e3b6f,_0x4bda81);TeamEvents['on'](_0x5e3b6f,_0x3ddeb0);}};
\ No newline at end of file
+var _0x405f=['team:','./team.events','save','remove','update','emit','removeListener','length'];(function(_0xf0402,_0xbb7952){var _0x18a76c=function(_0x3479b2){while(--_0x3479b2){_0xf0402['push'](_0xf0402['shift']());}};_0x18a76c(++_0xbb7952);}(_0x405f,0x189));var _0xf405=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x405f[_0x3740fe];return _0x55492b;};'use strict';var TeamEvents=require(_0xf405('0x0'));var events=[_0xf405('0x1'),_0xf405('0x2'),_0xf405('0x3')];function createListener(_0x1f729d,_0x40b37b){return function(_0x332a8a){_0x40b37b[_0xf405('0x4')](_0x1f729d,_0x332a8a);};}function removeListener(_0x488885,_0x1763e3){return function(){TeamEvents[_0xf405('0x5')](_0x488885,_0x1763e3);};}exports['register']=function(_0x492685){for(var _0x58ba3e=0x0,_0x10bb07=events[_0xf405('0x6')];_0x58ba3e<_0x10bb07;_0x58ba3e++){var _0x4c6532=events[_0x58ba3e];var _0x3e48ae=createListener(_0xf405('0x7')+_0x4c6532,_0x492685);TeamEvents['on'](_0x4c6532,_0x3e48ae);}};
\ No newline at end of file
index 51dee6c..32b85b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70ca=['../../components/interaction/service','./template.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x35e75a,_0x5ed225){var _0xb23c7f=function(_0x2fa40c){while(--_0x2fa40c){_0x35e75a['push'](_0x35e75a['shift']());}};_0xb23c7f(++_0x5ed225);}(_0x70ca,0xc8));var _0xa70c=function(_0x3effb4,_0x4c874b){_0x3effb4=_0x3effb4-0x0;var _0x2c2cfd=_0x70ca[_0x3effb4];return _0x2c2cfd;};'use strict';var multer=require(_0xa70c('0x0'));var util=require('util');var path=require(_0xa70c('0x1'));var express=require(_0xa70c('0x2'));var router=express[_0xa70c('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xa70c('0x4'));var config=require('../../config/environment');var controller=require(_0xa70c('0x5'));router[_0xa70c('0x6')]('/',auth[_0xa70c('0x7')](),controller[_0xa70c('0x8')]);router[_0xa70c('0x6')](_0xa70c('0x9'),auth[_0xa70c('0x7')](),controller['show']);router[_0xa70c('0xa')]('/',auth[_0xa70c('0x7')](),controller[_0xa70c('0xb')]);router[_0xa70c('0xc')]('/:id',auth[_0xa70c('0x7')](),controller[_0xa70c('0xd')]);router[_0xa70c('0xe')](_0xa70c('0x9'),auth[_0xa70c('0x7')](),controller[_0xa70c('0xf')]);module[_0xa70c('0x10')]=router;
\ No newline at end of file
+var _0x8184=['multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x115555,_0x1e708c){var _0x3c5b8f=function(_0x23f8cf){while(--_0x23f8cf){_0x115555['push'](_0x115555['shift']());}};_0x3c5b8f(++_0x1e708c);}(_0x8184,0x1b0));var _0x4818=function(_0x50cbdf,_0x40d1c8){_0x50cbdf=_0x50cbdf-0x0;var _0x372b4e=_0x8184[_0x50cbdf];return _0x372b4e;};'use strict';var multer=require(_0x4818('0x0'));var util=require('util');var path=require(_0x4818('0x1'));var express=require('express');var router=express[_0x4818('0x2')]();var auth=require(_0x4818('0x3'));var interaction=require(_0x4818('0x4'));var config=require(_0x4818('0x5'));var controller=require(_0x4818('0x6'));router[_0x4818('0x7')]('/',auth[_0x4818('0x8')](),controller[_0x4818('0x9')]);router[_0x4818('0x7')](_0x4818('0xa'),auth['isAuthenticated'](),controller[_0x4818('0xb')]);router[_0x4818('0xc')]('/',auth[_0x4818('0x8')](),controller[_0x4818('0xd')]);router[_0x4818('0xe')](_0x4818('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x4818('0xf')](_0x4818('0xa'),auth[_0x4818('0x8')](),controller[_0x4818('0x10')]);module[_0x4818('0x11')]=router;
\ No newline at end of file
index 3d209be..bc0aae2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x726c=['sequelize','exports','STRING'];(function(_0x2bbad9,_0x1f3892){var _0x1683cb=function(_0x262672){while(--_0x262672){_0x2bbad9['push'](_0x2bbad9['shift']());}};_0x1683cb(++_0x1f3892);}(_0x726c,0x72));var _0xc726=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x726c[_0x5c2e3e];return _0x53f64a;};'use strict';var Sequelize=require(_0xc726('0x0'));module[_0xc726('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc726('0x2')]},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x7c52=['STRING','sequelize'];(function(_0x3f9362,_0x1d6767){var _0x4f0c30=function(_0x11312d){while(--_0x11312d){_0x3f9362['push'](_0x3f9362['shift']());}};_0x4f0c30(++_0x1d6767);}(_0x7c52,0x1cd));var _0x27c5=function(_0x40bb6c,_0x408f37){_0x40bb6c=_0x40bb6c-0x0;var _0x3bfd80=_0x7c52[_0x40bb6c];return _0x3bfd80;};'use strict';var Sequelize=require(_0x27c5('0x0'));module['exports']={'name':{'type':Sequelize[_0x27c5('0x1')]},'description':{'type':Sequelize[_0x27c5('0x1')]},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 9d642ec..3242aeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61ec=['count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','keys','query','dateStart','dateEnd','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','day','merge','where','map','filter','Template','includeAll','include','findAll','rows','catch','params','options','find','create','body','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json'];(function(_0x2477e7,_0x5e650b){var _0x3932ce=function(_0x4d30ed){while(--_0x4d30ed){_0x2477e7['push'](_0x2477e7['shift']());}};_0x3932ce(++_0x5e650b);}(_0x61ec,0x182));var _0xc61e=function(_0x1e9754,_0x2b0453){_0x1e9754=_0x1e9754-0x0;var _0x57a45e=_0x61ec[_0x1e9754];return _0x57a45e;};'use strict';var pdf=require(_0xc61e('0x0'));var emlformat=require(_0xc61e('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc61e('0x2'));var rp=require('request-promise');var moment=require(_0xc61e('0x3'));var BPromise=require(_0xc61e('0x4'));var Mustache=require(_0xc61e('0x5'));var util=require(_0xc61e('0x6'));var path=require(_0xc61e('0x7'));var sox=require('sox');var csv=require(_0xc61e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc61e('0x9'));var jsforce=require(_0xc61e('0xa'));var deskjs=require(_0xc61e('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc61e('0xc'));var Papa=require(_0xc61e('0xd'));var qs=require(_0xc61e('0xe'));var logger=require(_0xc61e('0xf'))(_0xc61e('0x10'));var utils=require(_0xc61e('0x11'));var config=require(_0xc61e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x479970,_0x4a51c1){_0x4a51c1=_0x4a51c1||0xcc;return function(_0x43fd44){if(_0x43fd44){return _0x479970[_0xc61e('0x13')](_0x4a51c1);}return _0x479970['status'](_0x4a51c1)['end']();};}function respondWithResult(_0x34bdd9,_0x1213f7){_0x1213f7=_0x1213f7||0xc8;return function(_0x2a3f68){if(_0x2a3f68){return _0x34bdd9[_0xc61e('0x14')](_0x1213f7)[_0xc61e('0x15')](_0x2a3f68);}};}function respondWithFilteredResult(_0x1afd15,_0x9aee62){return function(_0x1cd8b6){if(_0x1cd8b6){var _0x31bc27=_0x1cd8b6[_0xc61e('0x16')],_0x21010e=_0x9aee62[_0xc61e('0x17')],_0x14159f=_0x9aee62[_0xc61e('0x17')]+_0x9aee62[_0xc61e('0x18')],_0x149bee;if(_0x14159f>=_0x31bc27){_0x14159f=_0x31bc27;_0x149bee=0xc8;}else{_0x149bee=0xce;}_0x1afd15[_0xc61e('0x14')](_0x149bee);return _0x1afd15[_0xc61e('0x19')](_0xc61e('0x1a'),_0x21010e+'-'+_0x14159f+'/'+_0x31bc27)[_0xc61e('0x15')](_0x1cd8b6);}return null;};}function patchUpdates(_0x2ffc92){return function(_0xef4926){try{jsonpatch['apply'](_0xef4926,_0x2ffc92,!![]);}catch(_0x53ec7e){return BPromise[_0xc61e('0x1b')](_0x53ec7e);}return _0xef4926[_0xc61e('0x1c')]();};}function saveUpdates(_0x37d684,_0x749f7e){return function(_0x21877d){if(_0x21877d){return _0x21877d[_0xc61e('0x1d')](_0x37d684)[_0xc61e('0x1e')](function(_0x50793f){return _0x50793f;});}return null;};}function removeEntity(_0x37ab48,_0x11d50c){return function(_0xb5c54b){if(_0xb5c54b){return _0xb5c54b[_0xc61e('0x1f')]()['then'](function(){_0x37ab48[_0xc61e('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b915d,_0x1ad962){return function(_0x5eb1ed){if(!_0x5eb1ed){_0x4b915d[_0xc61e('0x13')](0x194);}return _0x5eb1ed;};}function handleError(_0x395668,_0x50607b){_0x50607b=_0x50607b||0x1f4;return function(_0x424336){logger[_0xc61e('0x20')](_0x424336[_0xc61e('0x21')]);if(_0x424336[_0xc61e('0x22')]){delete _0x424336[_0xc61e('0x22')];}_0x395668[_0xc61e('0x14')](_0x50607b)[_0xc61e('0x23')](_0x424336);};}exports[_0xc61e('0x24')]=function(_0x4cbea6,_0x555e24){var _0x1f463f={},_0x148b48={},_0x33d04f={'count':0x0,'rows':[]};var _0x45f673=db['Template']['rawAttributes'];_0x148b48['model']=_[_0xc61e('0x25')](_0x45f673);var _0x287f34={'dateStart':_0x4cbea6[_0xc61e('0x26')][_0xc61e('0x27')],'dateEnd':_0x4cbea6[_0xc61e('0x26')][_0xc61e('0x28')]};delete _0x4cbea6[_0xc61e('0x26')][_0xc61e('0x27')];delete _0x4cbea6[_0xc61e('0x26')][_0xc61e('0x28')];_0x148b48['query']=_['keys'](_0x4cbea6[_0xc61e('0x26')]);_0x148b48[_0xc61e('0x29')]=_[_0xc61e('0x2a')](_0x148b48[_0xc61e('0x2b')],_0x148b48[_0xc61e('0x26')]);_0x1f463f[_0xc61e('0x2c')]=_[_0xc61e('0x2a')](_0x148b48[_0xc61e('0x2b')],qs[_0xc61e('0x2d')](_0x4cbea6['query'][_0xc61e('0x2d')]));_0x1f463f['attributes']=_0x1f463f[_0xc61e('0x2c')][_0xc61e('0x2e')]?_0x1f463f[_0xc61e('0x2c')]:_0x148b48[_0xc61e('0x2b')];if(!_0x4cbea6[_0xc61e('0x26')][_0xc61e('0x2f')](_0xc61e('0x30'))){_0x1f463f[_0xc61e('0x18')]=qs[_0xc61e('0x18')](_0x4cbea6['query'][_0xc61e('0x18')]);_0x1f463f[_0xc61e('0x17')]=qs[_0xc61e('0x17')](_0x4cbea6[_0xc61e('0x26')]['offset']);}_0x1f463f[_0xc61e('0x31')]=qs[_0xc61e('0x32')](_0x4cbea6[_0xc61e('0x26')][_0xc61e('0x32')]);_0x1f463f['where']=qs[_0xc61e('0x29')](_[_0xc61e('0x33')](_0x4cbea6[_0xc61e('0x26')],_0x148b48[_0xc61e('0x29')]));if(_0x287f34['dateStart']){if(_0x287f34[_0xc61e('0x28')]){_0x287f34[_0xc61e('0x28')]=moment(_0x287f34[_0xc61e('0x28')])['add'](0x1,'day');}else{_0x287f34['dateEnd']=moment(_0x287f34['dateStart'])['add'](0x1,_0xc61e('0x34'));}_[_0xc61e('0x35')](_0x1f463f[_0xc61e('0x36')],{'createdAt':{'$gte':_0x287f34[_0xc61e('0x27')],'$lte':_0x287f34[_0xc61e('0x28')]}});}if(_0x4cbea6['query']['filter']){_0x1f463f[_0xc61e('0x36')]=_['merge'](_0x1f463f[_0xc61e('0x36')],{'$or':_[_0xc61e('0x37')](_0x1f463f[_0xc61e('0x2c')],function(_0x1903ac){var _0x2ab1af={};_0x2ab1af[_0x1903ac]={'$like':'%'+_0x4cbea6[_0xc61e('0x26')][_0xc61e('0x38')]+'%'};return _0x2ab1af;})});}_0x1f463f=_['merge']({},_0x1f463f,_0x4cbea6['options']);var _0x14310d={'where':_0x1f463f[_0xc61e('0x36')]};return db[_0xc61e('0x39')][_0xc61e('0x16')](_0x14310d)[_0xc61e('0x1e')](function(_0x89bdf6){_0x33d04f[_0xc61e('0x16')]=_0x89bdf6;if(_0x4cbea6[_0xc61e('0x26')][_0xc61e('0x3a')]){_0x1f463f[_0xc61e('0x3b')]=[{'all':!![]}];}return db[_0xc61e('0x39')][_0xc61e('0x3c')](_0x1f463f);})[_0xc61e('0x1e')](function(_0x5ed3c4){_0x33d04f[_0xc61e('0x3d')]=_0x5ed3c4;return _0x33d04f;})['then'](respondWithFilteredResult(_0x555e24,_0x1f463f))[_0xc61e('0x3e')](handleError(_0x555e24,null));};exports['show']=function(_0x146657,_0x1b6ca6){var _0x2c5a94={'raw':!![],'where':{'id':_0x146657[_0xc61e('0x3f')]['id']}},_0x19ed12={};_0x19ed12[_0xc61e('0x2b')]=_['keys'](db['Template']['rawAttributes']);_0x19ed12[_0xc61e('0x26')]=_['keys'](_0x146657['query']);_0x19ed12[_0xc61e('0x29')]=_['intersection'](_0x19ed12['model'],_0x19ed12['query']);_0x2c5a94[_0xc61e('0x2c')]=_[_0xc61e('0x2a')](_0x19ed12[_0xc61e('0x2b')],qs['fields'](_0x146657[_0xc61e('0x26')]['fields']));_0x2c5a94['attributes']=_0x2c5a94['attributes'][_0xc61e('0x2e')]?_0x2c5a94[_0xc61e('0x2c')]:_0x19ed12[_0xc61e('0x2b')];if(_0x146657[_0xc61e('0x26')][_0xc61e('0x3a')]){_0x2c5a94[_0xc61e('0x3b')]=[{'all':!![]}];}_0x2c5a94=_[_0xc61e('0x35')]({},_0x2c5a94,_0x146657[_0xc61e('0x40')]);return db['Template'][_0xc61e('0x41')](_0x2c5a94)[_0xc61e('0x1e')](handleEntityNotFound(_0x1b6ca6,null))['then'](respondWithResult(_0x1b6ca6,null))[_0xc61e('0x3e')](handleError(_0x1b6ca6,null));};exports['create']=function(_0xf6eb13,_0x59fa45){return db['Template'][_0xc61e('0x42')](_0xf6eb13[_0xc61e('0x43')],{})[_0xc61e('0x1e')](respondWithResult(_0x59fa45,0xc9))[_0xc61e('0x3e')](handleError(_0x59fa45,null));};exports[_0xc61e('0x1d')]=function(_0x2a978b,_0x3db2c9){if(_0x2a978b[_0xc61e('0x43')]['id']){delete _0x2a978b[_0xc61e('0x43')]['id'];}return db[_0xc61e('0x39')][_0xc61e('0x41')]({'where':{'id':_0x2a978b[_0xc61e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3db2c9,null))[_0xc61e('0x1e')](saveUpdates(_0x2a978b[_0xc61e('0x43')],null))['then'](respondWithResult(_0x3db2c9,null))[_0xc61e('0x3e')](handleError(_0x3db2c9,null));};exports[_0xc61e('0x1f')]=function(_0x4a1971,_0x54cad3){return db[_0xc61e('0x39')][_0xc61e('0x41')]({'where':{'id':_0x4a1971['params']['id']}})[_0xc61e('0x1e')](handleEntityNotFound(_0x54cad3,null))['then'](removeEntity(_0x54cad3,null))[_0xc61e('0x3e')](handleError(_0x54cad3,null));};
\ No newline at end of file
+var _0x46a7=['rawAttributes','intersection','length','find','catch','create','body','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','index','Template','keys','dateStart','query','dateEnd','filters','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','add','day','filter','merge','options','includeAll','include','findAll','rows','params'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x46a7,0x138));var _0x746a=function(_0x5a57c5,_0x1b240f){_0x5a57c5=_0x5a57c5-0x0;var _0x90e581=_0x46a7[_0x5a57c5];return _0x90e581;};'use strict';var pdf=require(_0x746a('0x0'));var emlformat=require(_0x746a('0x1'));var rimraf=require(_0x746a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x746a('0x3'));var rp=require(_0x746a('0x4'));var moment=require(_0x746a('0x5'));var BPromise=require(_0x746a('0x6'));var Mustache=require(_0x746a('0x7'));var util=require(_0x746a('0x8'));var path=require(_0x746a('0x9'));var sox=require(_0x746a('0xa'));var csv=require(_0x746a('0xb'));var ejs=require(_0x746a('0xc'));var fs=require('fs');var _=require(_0x746a('0xd'));var squel=require(_0x746a('0xe'));var crypto=require(_0x746a('0xf'));var jsforce=require(_0x746a('0x10'));var deskjs=require(_0x746a('0x11'));var toCsv=require('to-csv');var querystring=require(_0x746a('0x12'));var Papa=require(_0x746a('0x13'));var qs=require(_0x746a('0x14'));var logger=require(_0x746a('0x15'))(_0x746a('0x16'));var utils=require(_0x746a('0x17'));var config=require(_0x746a('0x18'));var db=require(_0x746a('0x19'))['db'];function respondWithStatusCode(_0x3270d8,_0x53e981){_0x53e981=_0x53e981||0xcc;return function(_0x102d48){if(_0x102d48){return _0x3270d8[_0x746a('0x1a')](_0x53e981);}return _0x3270d8[_0x746a('0x1b')](_0x53e981)[_0x746a('0x1c')]();};}function respondWithResult(_0x3514b6,_0x38d774){_0x38d774=_0x38d774||0xc8;return function(_0x16d0c5){if(_0x16d0c5){return _0x3514b6[_0x746a('0x1b')](_0x38d774)[_0x746a('0x1d')](_0x16d0c5);}};}function respondWithFilteredResult(_0x3b0a40,_0x172f5b){return function(_0x24e56e){if(_0x24e56e){var _0x58acd8=_0x24e56e[_0x746a('0x1e')],_0x554e50=_0x172f5b[_0x746a('0x1f')],_0xfce5fa=_0x172f5b[_0x746a('0x1f')]+_0x172f5b[_0x746a('0x20')],_0x3976d2;if(_0xfce5fa>=_0x58acd8){_0xfce5fa=_0x58acd8;_0x3976d2=0xc8;}else{_0x3976d2=0xce;}_0x3b0a40[_0x746a('0x1b')](_0x3976d2);return _0x3b0a40[_0x746a('0x21')](_0x746a('0x22'),_0x554e50+'-'+_0xfce5fa+'/'+_0x58acd8)['json'](_0x24e56e);}return null;};}function patchUpdates(_0x482295){return function(_0x5224fc){try{jsonpatch[_0x746a('0x23')](_0x5224fc,_0x482295,!![]);}catch(_0x24c499){return BPromise[_0x746a('0x24')](_0x24c499);}return _0x5224fc[_0x746a('0x25')]();};}function saveUpdates(_0x108333,_0x1f6fc1){return function(_0x5c5deb){if(_0x5c5deb){return _0x5c5deb[_0x746a('0x26')](_0x108333)['then'](function(_0x37845e){return _0x37845e;});}return null;};}function removeEntity(_0x37158b,_0x6b7268){return function(_0x257d1a){if(_0x257d1a){return _0x257d1a['destroy']()[_0x746a('0x27')](function(){_0x37158b[_0x746a('0x1b')](0xcc)[_0x746a('0x1c')]();});}};}function handleEntityNotFound(_0x3c930a,_0x4940b3){return function(_0x302805){if(!_0x302805){_0x3c930a[_0x746a('0x1a')](0x194);}return _0x302805;};}function handleError(_0x53a44e,_0x4f33cc){_0x4f33cc=_0x4f33cc||0x1f4;return function(_0x222edf){logger[_0x746a('0x28')](_0x222edf['stack']);if(_0x222edf[_0x746a('0x29')]){delete _0x222edf[_0x746a('0x29')];}_0x53a44e[_0x746a('0x1b')](_0x4f33cc)[_0x746a('0x2a')](_0x222edf);};}exports[_0x746a('0x2b')]=function(_0x41ebfe,_0x2b91a0){var _0x3016b5={},_0x46bfc0={},_0x3f1bfa={'count':0x0,'rows':[]};var _0x28a6b1=db[_0x746a('0x2c')]['rawAttributes'];_0x46bfc0['model']=_[_0x746a('0x2d')](_0x28a6b1);var _0x2aaf66={'dateStart':_0x41ebfe['query'][_0x746a('0x2e')],'dateEnd':_0x41ebfe[_0x746a('0x2f')][_0x746a('0x30')]};delete _0x41ebfe[_0x746a('0x2f')]['dateStart'];delete _0x41ebfe[_0x746a('0x2f')]['dateEnd'];_0x46bfc0[_0x746a('0x2f')]=_[_0x746a('0x2d')](_0x41ebfe[_0x746a('0x2f')]);_0x46bfc0[_0x746a('0x31')]=_['intersection'](_0x46bfc0[_0x746a('0x32')],_0x46bfc0['query']);_0x3016b5[_0x746a('0x33')]=_['intersection'](_0x46bfc0[_0x746a('0x32')],qs[_0x746a('0x34')](_0x41ebfe['query'][_0x746a('0x34')]));_0x3016b5[_0x746a('0x33')]=_0x3016b5[_0x746a('0x33')]['length']?_0x3016b5[_0x746a('0x33')]:_0x46bfc0[_0x746a('0x32')];if(!_0x41ebfe[_0x746a('0x2f')][_0x746a('0x35')](_0x746a('0x36'))){_0x3016b5[_0x746a('0x20')]=qs[_0x746a('0x20')](_0x41ebfe[_0x746a('0x2f')][_0x746a('0x20')]);_0x3016b5[_0x746a('0x1f')]=qs[_0x746a('0x1f')](_0x41ebfe[_0x746a('0x2f')]['offset']);}_0x3016b5['order']=qs[_0x746a('0x37')](_0x41ebfe[_0x746a('0x2f')]['sort']);_0x3016b5[_0x746a('0x38')]=qs[_0x746a('0x31')](_[_0x746a('0x39')](_0x41ebfe[_0x746a('0x2f')],_0x46bfc0['filters']));if(_0x2aaf66[_0x746a('0x2e')]){if(_0x2aaf66[_0x746a('0x30')]){_0x2aaf66['dateEnd']=moment(_0x2aaf66[_0x746a('0x30')])[_0x746a('0x3a')](0x1,_0x746a('0x3b'));}else{_0x2aaf66['dateEnd']=moment(_0x2aaf66[_0x746a('0x2e')])[_0x746a('0x3a')](0x1,_0x746a('0x3b'));}_['merge'](_0x3016b5['where'],{'createdAt':{'$gte':_0x2aaf66[_0x746a('0x2e')],'$lte':_0x2aaf66[_0x746a('0x30')]}});}if(_0x41ebfe[_0x746a('0x2f')][_0x746a('0x3c')]){_0x3016b5[_0x746a('0x38')]=_['merge'](_0x3016b5['where'],{'$or':_['map'](_0x3016b5[_0x746a('0x33')],function(_0x548894){var _0x1bd19d={};_0x1bd19d[_0x548894]={'$like':'%'+_0x41ebfe[_0x746a('0x2f')][_0x746a('0x3c')]+'%'};return _0x1bd19d;})});}_0x3016b5=_[_0x746a('0x3d')]({},_0x3016b5,_0x41ebfe[_0x746a('0x3e')]);var _0x185371={'where':_0x3016b5[_0x746a('0x38')]};return db['Template'][_0x746a('0x1e')](_0x185371)[_0x746a('0x27')](function(_0x22bd76){_0x3f1bfa[_0x746a('0x1e')]=_0x22bd76;if(_0x41ebfe[_0x746a('0x2f')][_0x746a('0x3f')]){_0x3016b5[_0x746a('0x40')]=[{'all':!![]}];}return db[_0x746a('0x2c')][_0x746a('0x41')](_0x3016b5);})[_0x746a('0x27')](function(_0x14c5f1){_0x3f1bfa[_0x746a('0x42')]=_0x14c5f1;return _0x3f1bfa;})[_0x746a('0x27')](respondWithFilteredResult(_0x2b91a0,_0x3016b5))['catch'](handleError(_0x2b91a0,null));};exports['show']=function(_0x4e00f3,_0xd23430){var _0x553639={'raw':!![],'where':{'id':_0x4e00f3[_0x746a('0x43')]['id']}},_0x181b93={};_0x181b93[_0x746a('0x32')]=_[_0x746a('0x2d')](db['Template'][_0x746a('0x44')]);_0x181b93[_0x746a('0x2f')]=_[_0x746a('0x2d')](_0x4e00f3[_0x746a('0x2f')]);_0x181b93[_0x746a('0x31')]=_['intersection'](_0x181b93[_0x746a('0x32')],_0x181b93[_0x746a('0x2f')]);_0x553639['attributes']=_[_0x746a('0x45')](_0x181b93[_0x746a('0x32')],qs['fields'](_0x4e00f3[_0x746a('0x2f')][_0x746a('0x34')]));_0x553639[_0x746a('0x33')]=_0x553639[_0x746a('0x33')][_0x746a('0x46')]?_0x553639[_0x746a('0x33')]:_0x181b93[_0x746a('0x32')];if(_0x4e00f3['query']['includeAll']){_0x553639[_0x746a('0x40')]=[{'all':!![]}];}_0x553639=_[_0x746a('0x3d')]({},_0x553639,_0x4e00f3[_0x746a('0x3e')]);return db[_0x746a('0x2c')][_0x746a('0x47')](_0x553639)[_0x746a('0x27')](handleEntityNotFound(_0xd23430,null))[_0x746a('0x27')](respondWithResult(_0xd23430,null))[_0x746a('0x48')](handleError(_0xd23430,null));};exports['create']=function(_0x508710,_0x5c9b9b){return db[_0x746a('0x2c')][_0x746a('0x49')](_0x508710[_0x746a('0x4a')],{})['then'](respondWithResult(_0x5c9b9b,0xc9))['catch'](handleError(_0x5c9b9b,null));};exports[_0x746a('0x26')]=function(_0x53f81e,_0x3e9c0a){if(_0x53f81e[_0x746a('0x4a')]['id']){delete _0x53f81e[_0x746a('0x4a')]['id'];}return db[_0x746a('0x2c')][_0x746a('0x47')]({'where':{'id':_0x53f81e['params']['id']}})[_0x746a('0x27')](handleEntityNotFound(_0x3e9c0a,null))[_0x746a('0x27')](saveUpdates(_0x53f81e['body'],null))[_0x746a('0x27')](respondWithResult(_0x3e9c0a,null))[_0x746a('0x48')](handleError(_0x3e9c0a,null));};exports[_0x746a('0x4b')]=function(_0x10d138,_0xa0fe82){return db[_0x746a('0x2c')][_0x746a('0x47')]({'where':{'id':_0x10d138[_0x746a('0x43')]['id']}})[_0x746a('0x27')](handleEntityNotFound(_0xa0fe82,null))[_0x746a('0x27')](removeEntity(_0xa0fe82,null))[_0x746a('0x48')](handleError(_0xa0fe82,null));};
\ No newline at end of file
index e5bb803..a7fc8bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2ee=['../../config/logger','api','moment','bluebird','exports','Template','tools_templates','lodash','util'];(function(_0x2e241b,_0x31e3c0){var _0x281d03=function(_0x4d8896){while(--_0x4d8896){_0x2e241b['push'](_0x2e241b['shift']());}};_0x281d03(++_0x31e3c0);}(_0xc2ee,0xf1));var _0xec2e=function(_0x569a45,_0x2da15b){_0x569a45=_0x569a45-0x0;var _0x1a5ef8=_0xc2ee[_0x569a45];return _0x1a5ef8;};'use strict';var _=require(_0xec2e('0x0'));var util=require(_0xec2e('0x1'));var logger=require(_0xec2e('0x2'))(_0xec2e('0x3'));var moment=require(_0xec2e('0x4'));var BPromise=require(_0xec2e('0x5'));var rp=require('request-promise');var attributes=require('./template.attributes');module[_0xec2e('0x6')]=function(_0x1ea868,_0x326733){return _0x1ea868['define'](_0xec2e('0x7'),attributes,{'tableName':_0xec2e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2787=['exports','define','lodash','util','api','bluebird'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x2787,0x1ee));var _0x7278=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x2787[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x7278('0x0'));var util=require(_0x7278('0x1'));var logger=require('../../config/logger')(_0x7278('0x2'));var moment=require('moment');var BPromise=require(_0x7278('0x3'));var rp=require('request-promise');var attributes=require('./template.attributes');module[_0x7278('0x4')]=function(_0x4685e6,_0x11b196){return _0x4685e6[_0x7278('0x5')]('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 93e1293..54caf19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4f2=['map','model','then','GetTemplate','debug','stringify','lodash','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','options','raw','where','attributes','limit','include'];(function(_0x506157,_0x5d7889){var _0x30f8a8=function(_0x15e1ed){while(--_0x15e1ed){_0x506157['push'](_0x506157['shift']());}};_0x30f8a8(++_0x5d7889);}(_0xd4f2,0x132));var _0x2d4f=function(_0xe499dd,_0x3661f0){_0xe499dd=_0xe499dd-0x0;var _0x43efa0=_0xd4f2[_0xe499dd];return _0x43efa0;};'use strict';var _=require(_0x2d4f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2d4f('0x1'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x2d4f('0x2'))['db'];var utils=require(_0x2d4f('0x3'));var logger=require('../../config/logger')(_0x2d4f('0x4'));var config=require(_0x2d4f('0x5'));var jayson=require(_0x2d4f('0x6'));var client=jayson[_0x2d4f('0x7')][_0x2d4f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x302e79,_0x583058,_0x3ea193){return new BPromise(function(_0x12313a,_0xa8739d){return client['request'](_0x302e79,_0x3ea193)['then'](function(_0x2cbadc){logger[_0x2d4f('0x9')](_0x2d4f('0xa'),_0x583058,_0x2d4f('0xb'));logger['debug'](_0x2d4f('0xc'),_0x583058,'request\x20sent',JSON['stringify'](_0x2cbadc));if(_0x2cbadc[_0x2d4f('0xd')]){if(_0x2cbadc[_0x2d4f('0xd')][_0x2d4f('0xe')]===0x1f4){logger[_0x2d4f('0xd')]('Template,\x20%s,\x20%s',_0x583058,_0x2cbadc[_0x2d4f('0xd')][_0x2d4f('0xf')]);return _0xa8739d(_0x2cbadc[_0x2d4f('0xd')][_0x2d4f('0xf')]);}logger['error'](_0x2d4f('0xa'),_0x583058,_0x2cbadc[_0x2d4f('0xd')][_0x2d4f('0xf')]);return _0x12313a(_0x2cbadc[_0x2d4f('0xd')][_0x2d4f('0xf')]);}else{logger[_0x2d4f('0x9')](_0x2d4f('0xa'),_0x583058,_0x2d4f('0xb'));_0x12313a(_0x2cbadc[_0x2d4f('0x10')][_0x2d4f('0xf')]);}})[_0x2d4f('0x11')](function(_0x214b5c){logger[_0x2d4f('0xd')](_0x2d4f('0xa'),_0x583058,_0x214b5c);_0xa8739d(_0x214b5c);});});}exports['GetTemplate']=function(_0xe0cb53){var _0x1aa86f=this;return new Promise(function(_0x4e89a0,_0xffca1){return db['Template']['findAll']({'raw':_0xe0cb53['options']?_0xe0cb53[_0x2d4f('0x12')][_0x2d4f('0x13')]===undefined?!![]:![]:!![],'where':_0xe0cb53[_0x2d4f('0x12')]?_0xe0cb53[_0x2d4f('0x12')][_0x2d4f('0x14')]||null:null,'attributes':_0xe0cb53['options']?_0xe0cb53[_0x2d4f('0x12')][_0x2d4f('0x15')]||null:null,'limit':_0xe0cb53['options']?_0xe0cb53[_0x2d4f('0x12')][_0x2d4f('0x16')]||null:null,'include':_0xe0cb53[_0x2d4f('0x12')]?_0xe0cb53[_0x2d4f('0x12')][_0x2d4f('0x17')]?_[_0x2d4f('0x18')](_0xe0cb53['options']['include'],function(_0x493068){return{'model':db[_0x493068[_0x2d4f('0x19')]],'as':_0x493068['as'],'attributes':_0x493068[_0x2d4f('0x15')],'include':_0x493068[_0x2d4f('0x17')]?_[_0x2d4f('0x18')](_0x493068[_0x2d4f('0x17')],function(_0x456e1e){return{'model':db[_0x456e1e[_0x2d4f('0x19')]],'as':_0x456e1e['as'],'attributes':_0x456e1e[_0x2d4f('0x15')],'include':_0x456e1e[_0x2d4f('0x17')]?_[_0x2d4f('0x18')](_0x456e1e[_0x2d4f('0x17')],function(_0x2decda){return{'model':db[_0x2decda[_0x2d4f('0x19')]],'as':_0x2decda['as'],'attributes':_0x2decda[_0x2d4f('0x15')]};}):[]};}):[]};}):[]:[]})[_0x2d4f('0x1a')](function(_0x1c3354){logger[_0x2d4f('0x9')](_0x2d4f('0x1b'),_0xe0cb53);logger[_0x2d4f('0x1c')](_0x2d4f('0x1b'),_0xe0cb53,JSON[_0x2d4f('0x1d')](_0x1c3354));_0x4e89a0(_0x1c3354);})[_0x2d4f('0x11')](function(_0x182aa6){logger[_0x2d4f('0xd')]('GetTemplate',_0x182aa6[_0x2d4f('0xf')],_0xe0cb53);_0xffca1(_0x1aa86f['error'](0x1f4,_0x182aa6['message']));});});};
\ No newline at end of file
+var _0x921a=['lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','Template,\x20%s,\x20%s,\x20%s','error','code','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','Template','findAll','options','raw','where','limit','include','map','model','attributes','debug','stringify'];(function(_0x4d64b8,_0x1660a4){var _0x3acd62=function(_0x38fe71){while(--_0x38fe71){_0x4d64b8['push'](_0x4d64b8['shift']());}};_0x3acd62(++_0x1660a4);}(_0x921a,0x1ce));var _0xa921=function(_0x330936,_0x7a35fc){_0x330936=_0x330936-0x0;var _0x51ffaa=_0x921a[_0x330936];return _0x51ffaa;};'use strict';var _=require(_0xa921('0x0'));var util=require('util');var moment=require(_0xa921('0x1'));var BPromise=require('bluebird');var rs=require(_0xa921('0x2'));var fs=require('fs');var db=require(_0xa921('0x3'))['db'];var utils=require(_0xa921('0x4'));var logger=require(_0xa921('0x5'))(_0xa921('0x6'));var config=require(_0xa921('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa921('0x8')][_0xa921('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19e2ea,_0x28b409,_0x3b01e3){return new BPromise(function(_0x405dca,_0x45c643){return client[_0xa921('0xa')](_0x19e2ea,_0x3b01e3)['then'](function(_0x4d41fa){logger[_0xa921('0xb')]('Template,\x20%s,\x20%s',_0x28b409,_0xa921('0xc'));logger['debug'](_0xa921('0xd'),_0x28b409,_0xa921('0xc'),JSON['stringify'](_0x4d41fa));if(_0x4d41fa[_0xa921('0xe')]){if(_0x4d41fa[_0xa921('0xe')][_0xa921('0xf')]===0x1f4){logger[_0xa921('0xe')](_0xa921('0x10'),_0x28b409,_0x4d41fa[_0xa921('0xe')][_0xa921('0x11')]);return _0x45c643(_0x4d41fa[_0xa921('0xe')][_0xa921('0x11')]);}logger[_0xa921('0xe')](_0xa921('0x10'),_0x28b409,_0x4d41fa[_0xa921('0xe')][_0xa921('0x11')]);return _0x405dca(_0x4d41fa['error']['message']);}else{logger[_0xa921('0xb')](_0xa921('0x10'),_0x28b409,_0xa921('0xc'));_0x405dca(_0x4d41fa[_0xa921('0x12')][_0xa921('0x11')]);}})[_0xa921('0x13')](function(_0x5e5604){logger[_0xa921('0xe')](_0xa921('0x10'),_0x28b409,_0x5e5604);_0x45c643(_0x5e5604);});});}exports[_0xa921('0x14')]=function(_0x4d9f7a){var _0x1bdc0f=this;return new Promise(function(_0x2e5ecf,_0x5f3be0){return db[_0xa921('0x15')][_0xa921('0x16')]({'raw':_0x4d9f7a[_0xa921('0x17')]?_0x4d9f7a[_0xa921('0x17')][_0xa921('0x18')]===undefined?!![]:![]:!![],'where':_0x4d9f7a['options']?_0x4d9f7a[_0xa921('0x17')][_0xa921('0x19')]||null:null,'attributes':_0x4d9f7a[_0xa921('0x17')]?_0x4d9f7a['options']['attributes']||null:null,'limit':_0x4d9f7a['options']?_0x4d9f7a['options'][_0xa921('0x1a')]||null:null,'include':_0x4d9f7a[_0xa921('0x17')]?_0x4d9f7a[_0xa921('0x17')][_0xa921('0x1b')]?_[_0xa921('0x1c')](_0x4d9f7a['options'][_0xa921('0x1b')],function(_0x30d2db){return{'model':db[_0x30d2db[_0xa921('0x1d')]],'as':_0x30d2db['as'],'attributes':_0x30d2db['attributes'],'include':_0x30d2db['include']?_['map'](_0x30d2db[_0xa921('0x1b')],function(_0x17e606){return{'model':db[_0x17e606[_0xa921('0x1d')]],'as':_0x17e606['as'],'attributes':_0x17e606[_0xa921('0x1e')],'include':_0x17e606['include']?_[_0xa921('0x1c')](_0x17e606[_0xa921('0x1b')],function(_0x57a8d9){return{'model':db[_0x57a8d9[_0xa921('0x1d')]],'as':_0x57a8d9['as'],'attributes':_0x57a8d9[_0xa921('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15333f){logger['info'](_0xa921('0x14'),_0x4d9f7a);logger[_0xa921('0x1f')](_0xa921('0x14'),_0x4d9f7a,JSON[_0xa921('0x20')](_0x15333f));_0x2e5ecf(_0x15333f);})['catch'](function(_0x35396d){logger[_0xa921('0xe')](_0xa921('0x14'),_0x35396d[_0xa921('0x11')],_0x4d9f7a);_0x5f3be0(_0x1bdc0f[_0xa921('0xe')](0x1f4,_0x35396d[_0xa921('0x11')]));});});};
\ No newline at end of file
index 71cc2c7..a1adbeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x730d=['addAllCondition','addAction','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post','/:id/all_conditions'];(function(_0x3e2936,_0x1d57a9){var _0x35d87a=function(_0x19dd6a){while(--_0x19dd6a){_0x3e2936['push'](_0x3e2936['shift']());}};_0x35d87a(++_0x1d57a9);}(_0x730d,0xab));var _0xd730=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x730d[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xd730('0x0'));var util=require(_0xd730('0x1'));var path=require(_0xd730('0x2'));var express=require(_0xd730('0x3'));var router=express['Router']();var auth=require(_0xd730('0x4'));var interaction=require(_0xd730('0x5'));var config=require(_0xd730('0x6'));var controller=require(_0xd730('0x7'));router[_0xd730('0x8')]('/',auth[_0xd730('0x9')](),controller[_0xd730('0xa')]);router[_0xd730('0x8')](_0xd730('0xb'),auth[_0xd730('0x9')](),controller[_0xd730('0xc')]);router[_0xd730('0x8')]('/:id/all_conditions',auth[_0xd730('0x9')](),controller[_0xd730('0xd')]);router['get'](_0xd730('0xe'),auth[_0xd730('0x9')](),controller[_0xd730('0xf')]);router[_0xd730('0x8')](_0xd730('0x10'),auth[_0xd730('0x9')](),controller[_0xd730('0x11')]);router['post']('/',auth[_0xd730('0x9')](),controller[_0xd730('0x12')]);router[_0xd730('0x13')](_0xd730('0x14'),auth[_0xd730('0x9')](),controller[_0xd730('0x15')]);router[_0xd730('0x13')]('/:id/any_conditions',auth['isAuthenticated'](),controller['addAnyCondition']);router[_0xd730('0x13')](_0xd730('0x10'),auth[_0xd730('0x9')](),controller[_0xd730('0x16')]);router['put']('/:id',auth[_0xd730('0x9')](),controller['update']);router['delete'](_0xd730('0xb'),auth[_0xd730('0x9')](),controller[_0xd730('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xef4d=['multer','util','path','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAction','put','update','delete','destroy'];(function(_0xa0fd7d,_0x97bbaf){var _0x2cd999=function(_0xd51c00){while(--_0xd51c00){_0xa0fd7d['push'](_0xa0fd7d['shift']());}};_0x2cd999(++_0x97bbaf);}(_0xef4d,0x198));var _0xdef4=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xef4d[_0x298ed3];return _0x5aad28;};'use strict';var multer=require(_0xdef4('0x0'));var util=require(_0xdef4('0x1'));var path=require(_0xdef4('0x2'));var express=require(_0xdef4('0x3'));var router=express['Router']();var auth=require(_0xdef4('0x4'));var interaction=require(_0xdef4('0x5'));var config=require('../../config/environment');var controller=require('./trigger.controller');router[_0xdef4('0x6')]('/',auth[_0xdef4('0x7')](),controller['index']);router[_0xdef4('0x6')](_0xdef4('0x8'),auth['isAuthenticated'](),controller[_0xdef4('0x9')]);router['get'](_0xdef4('0xa'),auth[_0xdef4('0x7')](),controller[_0xdef4('0xb')]);router[_0xdef4('0x6')](_0xdef4('0xc'),auth[_0xdef4('0x7')](),controller[_0xdef4('0xd')]);router[_0xdef4('0x6')](_0xdef4('0xe'),auth[_0xdef4('0x7')](),controller[_0xdef4('0xf')]);router[_0xdef4('0x10')]('/',auth[_0xdef4('0x7')](),controller[_0xdef4('0x11')]);router[_0xdef4('0x10')](_0xdef4('0xa'),auth[_0xdef4('0x7')](),controller[_0xdef4('0x12')]);router[_0xdef4('0x10')](_0xdef4('0xc'),auth[_0xdef4('0x7')](),controller['addAnyCondition']);router[_0xdef4('0x10')](_0xdef4('0xe'),auth[_0xdef4('0x7')](),controller[_0xdef4('0x13')]);router[_0xdef4('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xdef4('0x15')]);router[_0xdef4('0x16')](_0xdef4('0x8'),auth[_0xdef4('0x7')](),controller[_0xdef4('0x17')]);module['exports']=router;
\ No newline at end of file
index 8bfc430..a78b03e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70c1=['BOOLEAN','sequelize','STRING'];(function(_0x547f24,_0x32ab5c){var _0x35e9c5=function(_0x11d653){while(--_0x11d653){_0x547f24['push'](_0x547f24['shift']());}};_0x35e9c5(++_0x32ab5c);}(_0x70c1,0x1e7));var _0x170c=function(_0x390167,_0x4e9864){_0x390167=_0x390167-0x0;var _0x456beb=_0x70c1[_0x390167];return _0x456beb;};'use strict';var Sequelize=require(_0x170c('0x0'));module['exports']={'name':{'type':Sequelize[_0x170c('0x1')]},'channel':{'type':Sequelize[_0x170c('0x1')]},'description':{'type':Sequelize[_0x170c('0x1')]},'status':{'type':Sequelize[_0x170c('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x305b=['BOOLEAN','sequelize','STRING'];(function(_0x4d7988,_0x4c62e3){var _0x97e287=function(_0x223966){while(--_0x223966){_0x4d7988['push'](_0x4d7988['shift']());}};_0x97e287(++_0x4c62e3);}(_0x305b,0x14e));var _0xb305=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0x305b[_0x277af0];return _0x43bd7c;};'use strict';var Sequelize=require(_0xb305('0x0'));module['exports']={'name':{'type':Sequelize[_0xb305('0x1')]},'channel':{'type':Sequelize[_0xb305('0x1')]},'description':{'type':Sequelize[_0xb305('0x1')]},'status':{'type':Sequelize[_0xb305('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 08079db..58ebbf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['dateEnd','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','add','day','merge','filter','count','includeAll','include','findAll','rows','catch','options','find','create','body','params','destroy','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','map','nolimit','getAnyConditions','addAction','TriggerId','Action','getActions','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','Trigger','rawAttributes','query','dateStart'];(function(_0xf2662b,_0x4d8f41){var _0x257dc7=function(_0x46b1d1){while(--_0x46b1d1){_0xf2662b['push'](_0xf2662b['shift']());}};_0x257dc7(++_0x4d8f41);}(_0xb7e7,0x121));var _0x7b7e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xb7e7[_0x49ca18];return _0x145d54;};'use strict';var pdf=require(_0x7b7e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7b7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b7e('0x2'));var rp=require('request-promise');var moment=require(_0x7b7e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7b7e('0x4'));var util=require(_0x7b7e('0x5'));var path=require(_0x7b7e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b7e('0x7'));var fs=require('fs');var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var qs=require(_0x7b7e('0xf'));var logger=require(_0x7b7e('0x10'))('api');var utils=require(_0x7b7e('0x11'));var config=require(_0x7b7e('0x12'));var db=require(_0x7b7e('0x13'))['db'];function respondWithStatusCode(_0x29b622,_0xd581fb){_0xd581fb=_0xd581fb||0xcc;return function(_0x18a1de){if(_0x18a1de){return _0x29b622[_0x7b7e('0x14')](_0xd581fb);}return _0x29b622[_0x7b7e('0x15')](_0xd581fb)[_0x7b7e('0x16')]();};}function respondWithResult(_0x54d8ce,_0x267446){_0x267446=_0x267446||0xc8;return function(_0x430eab){if(_0x430eab){return _0x54d8ce['status'](_0x267446)[_0x7b7e('0x17')](_0x430eab);}};}function respondWithFilteredResult(_0x5976ac,_0x4c6011){return function(_0x2889ed){if(_0x2889ed){var _0xd304f5=_0x2889ed['count'],_0xf067da=_0x4c6011['offset'],_0x457ec5=_0x4c6011[_0x7b7e('0x18')]+_0x4c6011[_0x7b7e('0x19')],_0x3d2fb2;if(_0x457ec5>=_0xd304f5){_0x457ec5=_0xd304f5;_0x3d2fb2=0xc8;}else{_0x3d2fb2=0xce;}_0x5976ac[_0x7b7e('0x15')](_0x3d2fb2);return _0x5976ac[_0x7b7e('0x1a')](_0x7b7e('0x1b'),_0xf067da+'-'+_0x457ec5+'/'+_0xd304f5)[_0x7b7e('0x17')](_0x2889ed);}return null;};}function patchUpdates(_0x242368){return function(_0x200ef7){try{jsonpatch[_0x7b7e('0x1c')](_0x200ef7,_0x242368,!![]);}catch(_0x429a0e){return BPromise[_0x7b7e('0x1d')](_0x429a0e);}return _0x200ef7[_0x7b7e('0x1e')]();};}function saveUpdates(_0x448980,_0x3bec7d){return function(_0x9776c3){if(_0x9776c3){return _0x9776c3[_0x7b7e('0x1f')](_0x448980)[_0x7b7e('0x20')](function(_0x49eddb){return _0x49eddb;});}return null;};}function removeEntity(_0x69262b,_0x43db4f){return function(_0x24718c){if(_0x24718c){return _0x24718c['destroy']()[_0x7b7e('0x20')](function(){_0x69262b[_0x7b7e('0x15')](0xcc)[_0x7b7e('0x16')]();});}};}function handleEntityNotFound(_0x200156,_0x2b7211){return function(_0x303d8c){if(!_0x303d8c){_0x200156[_0x7b7e('0x14')](0x194);}return _0x303d8c;};}function handleError(_0x10a66a,_0x53bbb3){_0x53bbb3=_0x53bbb3||0x1f4;return function(_0x5d6215){logger['error'](_0x5d6215[_0x7b7e('0x21')]);if(_0x5d6215[_0x7b7e('0x22')]){delete _0x5d6215[_0x7b7e('0x22')];}_0x10a66a['status'](_0x53bbb3)['send'](_0x5d6215);};}exports['index']=function(_0x182245,_0x3c8192){var _0x16a3c7={},_0x7aa71={},_0x3ceaf5={'count':0x0,'rows':[]};var _0x48fad1=db[_0x7b7e('0x23')][_0x7b7e('0x24')];_0x7aa71['model']=_['keys'](_0x48fad1);var _0x4e5de7={'dateStart':_0x182245[_0x7b7e('0x25')][_0x7b7e('0x26')],'dateEnd':_0x182245['query'][_0x7b7e('0x27')]};delete _0x182245['query'][_0x7b7e('0x26')];delete _0x182245[_0x7b7e('0x25')][_0x7b7e('0x27')];_0x7aa71['query']=_[_0x7b7e('0x28')](_0x182245[_0x7b7e('0x25')]);_0x7aa71[_0x7b7e('0x29')]=_[_0x7b7e('0x2a')](_0x7aa71[_0x7b7e('0x2b')],_0x7aa71['query']);_0x16a3c7[_0x7b7e('0x2c')]=_['intersection'](_0x7aa71[_0x7b7e('0x2b')],qs[_0x7b7e('0x2d')](_0x182245[_0x7b7e('0x25')][_0x7b7e('0x2d')]));_0x16a3c7[_0x7b7e('0x2c')]=_0x16a3c7[_0x7b7e('0x2c')][_0x7b7e('0x2e')]?_0x16a3c7['attributes']:_0x7aa71['model'];if(!_0x182245[_0x7b7e('0x25')][_0x7b7e('0x2f')]('nolimit')){_0x16a3c7[_0x7b7e('0x19')]=qs[_0x7b7e('0x19')](_0x182245[_0x7b7e('0x25')]['limit']);_0x16a3c7[_0x7b7e('0x18')]=qs[_0x7b7e('0x18')](_0x182245[_0x7b7e('0x25')][_0x7b7e('0x18')]);}_0x16a3c7[_0x7b7e('0x30')]=qs[_0x7b7e('0x31')](_0x182245[_0x7b7e('0x25')][_0x7b7e('0x31')]);_0x16a3c7[_0x7b7e('0x32')]=qs[_0x7b7e('0x29')](_[_0x7b7e('0x33')](_0x182245[_0x7b7e('0x25')],_0x7aa71[_0x7b7e('0x29')]));if(_0x4e5de7[_0x7b7e('0x26')]){if(_0x4e5de7[_0x7b7e('0x27')]){_0x4e5de7[_0x7b7e('0x27')]=moment(_0x4e5de7['dateEnd'])[_0x7b7e('0x34')](0x1,_0x7b7e('0x35'));}else{_0x4e5de7[_0x7b7e('0x27')]=moment(_0x4e5de7[_0x7b7e('0x26')])[_0x7b7e('0x34')](0x1,_0x7b7e('0x35'));}_[_0x7b7e('0x36')](_0x16a3c7[_0x7b7e('0x32')],{'createdAt':{'$gte':_0x4e5de7[_0x7b7e('0x26')],'$lte':_0x4e5de7[_0x7b7e('0x27')]}});}if(_0x182245['query'][_0x7b7e('0x37')]){_0x16a3c7[_0x7b7e('0x32')]=_[_0x7b7e('0x36')](_0x16a3c7[_0x7b7e('0x32')],{'$or':_['map'](_0x16a3c7[_0x7b7e('0x2c')],function(_0x35b31a){var _0x3d5280={};_0x3d5280[_0x35b31a]={'$like':'%'+_0x182245['query']['filter']+'%'};return _0x3d5280;})});}_0x16a3c7=_[_0x7b7e('0x36')]({},_0x16a3c7,_0x182245['options']);var _0x35382c={'where':_0x16a3c7[_0x7b7e('0x32')]};return db['Trigger'][_0x7b7e('0x38')](_0x35382c)[_0x7b7e('0x20')](function(_0x2a6f4d){_0x3ceaf5[_0x7b7e('0x38')]=_0x2a6f4d;if(_0x182245[_0x7b7e('0x25')][_0x7b7e('0x39')]){_0x16a3c7[_0x7b7e('0x3a')]=[{'all':!![]}];}return db[_0x7b7e('0x23')][_0x7b7e('0x3b')](_0x16a3c7);})['then'](function(_0x5d61c1){_0x3ceaf5[_0x7b7e('0x3c')]=_0x5d61c1;return _0x3ceaf5;})['then'](respondWithFilteredResult(_0x3c8192,_0x16a3c7))[_0x7b7e('0x3d')](handleError(_0x3c8192,null));};exports['show']=function(_0x48dd74,_0x356db0){var _0x48252a={'raw':![],'where':{'id':_0x48dd74['params']['id']}},_0x2f9982={};_0x2f9982[_0x7b7e('0x2b')]=_[_0x7b7e('0x28')](db[_0x7b7e('0x23')][_0x7b7e('0x24')]);_0x2f9982['query']=_[_0x7b7e('0x28')](_0x48dd74[_0x7b7e('0x25')]);_0x2f9982[_0x7b7e('0x29')]=_[_0x7b7e('0x2a')](_0x2f9982[_0x7b7e('0x2b')],_0x2f9982[_0x7b7e('0x25')]);_0x48252a['attributes']=_['intersection'](_0x2f9982['model'],qs[_0x7b7e('0x2d')](_0x48dd74[_0x7b7e('0x25')][_0x7b7e('0x2d')]));_0x48252a[_0x7b7e('0x2c')]=_0x48252a[_0x7b7e('0x2c')][_0x7b7e('0x2e')]?_0x48252a['attributes']:_0x2f9982[_0x7b7e('0x2b')];if(_0x48dd74[_0x7b7e('0x25')]['includeAll']){_0x48252a['include']=[{'all':!![]}];}_0x48252a=_[_0x7b7e('0x36')]({},_0x48252a,_0x48dd74[_0x7b7e('0x3e')]);return db[_0x7b7e('0x23')][_0x7b7e('0x3f')](_0x48252a)[_0x7b7e('0x20')](handleEntityNotFound(_0x356db0,null))[_0x7b7e('0x20')](respondWithResult(_0x356db0,null))['catch'](handleError(_0x356db0,null));};exports[_0x7b7e('0x40')]=function(_0x4cc7db,_0x402793){return db[_0x7b7e('0x23')][_0x7b7e('0x40')](_0x4cc7db[_0x7b7e('0x41')],{})['then'](respondWithResult(_0x402793,0xc9))[_0x7b7e('0x3d')](handleError(_0x402793,null));};exports[_0x7b7e('0x1f')]=function(_0x45e0cf,_0x334b8e){if(_0x45e0cf[_0x7b7e('0x41')]['id']){delete _0x45e0cf['body']['id'];}return db[_0x7b7e('0x23')][_0x7b7e('0x3f')]({'where':{'id':_0x45e0cf[_0x7b7e('0x42')]['id']}})[_0x7b7e('0x20')](handleEntityNotFound(_0x334b8e,null))[_0x7b7e('0x20')](saveUpdates(_0x45e0cf['body'],null))[_0x7b7e('0x20')](respondWithResult(_0x334b8e,null))[_0x7b7e('0x3d')](handleError(_0x334b8e,null));};exports[_0x7b7e('0x43')]=function(_0x3280fa,_0x416abe){return db[_0x7b7e('0x23')][_0x7b7e('0x3f')]({'where':{'id':_0x3280fa['params']['id']}})[_0x7b7e('0x20')](handleEntityNotFound(_0x416abe,null))['then'](removeEntity(_0x416abe,null))[_0x7b7e('0x3d')](handleError(_0x416abe,null));};exports[_0x7b7e('0x44')]=function(_0x570303,_0x36f1be,_0x44e3a0){if(_0x570303[_0x7b7e('0x41')]['id']){delete _0x570303[_0x7b7e('0x41')]['id'];}return db[_0x7b7e('0x23')][_0x7b7e('0x3f')]({'where':{'id':_0x570303[_0x7b7e('0x42')]['id']}})['then'](handleEntityNotFound(_0x36f1be,null))[_0x7b7e('0x20')](function(_0x3ff731){if(_0x3ff731){_0x570303[_0x7b7e('0x41')][_0x7b7e('0x45')]=_0x3ff731['id'];return db['Condition']['create'](_0x570303['body']);}})[_0x7b7e('0x20')](respondWithResult(_0x36f1be,null))[_0x7b7e('0x3d')](handleError(_0x36f1be,null));};exports[_0x7b7e('0x46')]=function(_0x4aa92e,_0x5b1e10,_0x360cd0){if(_0x4aa92e[_0x7b7e('0x41')]['id']){delete _0x4aa92e['body']['id'];}return db[_0x7b7e('0x23')][_0x7b7e('0x3f')]({'where':{'id':_0x4aa92e[_0x7b7e('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b1e10,null))[_0x7b7e('0x20')](function(_0x1d9af5){if(_0x1d9af5){_0x4aa92e['body'][_0x7b7e('0x47')]=_0x1d9af5['id'];return db[_0x7b7e('0x48')][_0x7b7e('0x40')](_0x4aa92e[_0x7b7e('0x41')]);}})[_0x7b7e('0x20')](respondWithResult(_0x5b1e10,null))[_0x7b7e('0x3d')](handleError(_0x5b1e10,null));};exports[_0x7b7e('0x49')]=function(_0x2d1908,_0x45fff9,_0x5509ad){var _0x29d0af={};var _0x20108a={};var _0x516e75;var _0xc2b1b6;return db[_0x7b7e('0x23')][_0x7b7e('0x4a')]({'where':{'id':_0x2d1908['params']['id']}})[_0x7b7e('0x20')](handleEntityNotFound(_0x45fff9,null))['then'](function(_0x50c544){if(_0x50c544){_0x516e75=_0x50c544;_0x20108a[_0x7b7e('0x2b')]=_['keys'](db[_0x7b7e('0x48')][_0x7b7e('0x24')]);_0x20108a['query']=_[_0x7b7e('0x28')](_0x2d1908[_0x7b7e('0x25')]);_0x20108a[_0x7b7e('0x29')]=_[_0x7b7e('0x2a')](_0x20108a['model'],_0x20108a[_0x7b7e('0x25')]);_0x29d0af[_0x7b7e('0x2c')]=_[_0x7b7e('0x2a')](_0x20108a[_0x7b7e('0x2b')],qs[_0x7b7e('0x2d')](_0x2d1908[_0x7b7e('0x25')][_0x7b7e('0x2d')]));_0x29d0af[_0x7b7e('0x2c')]=_0x29d0af[_0x7b7e('0x2c')][_0x7b7e('0x2e')]?_0x29d0af['attributes']:_0x20108a[_0x7b7e('0x2b')];_0x29d0af['order']=qs['sort'](_0x2d1908[_0x7b7e('0x25')][_0x7b7e('0x31')]);_0x29d0af[_0x7b7e('0x32')]=qs[_0x7b7e('0x29')](_['pick'](_0x2d1908[_0x7b7e('0x25')],_0x20108a[_0x7b7e('0x29')]));if(_0x2d1908[_0x7b7e('0x25')][_0x7b7e('0x37')]){_0x29d0af[_0x7b7e('0x32')]=_[_0x7b7e('0x36')](_0x29d0af['where'],{'$or':_[_0x7b7e('0x4b')](_0x29d0af['attributes'],function(_0x4a3af8){var _0x43a61b={};_0x43a61b[_0x4a3af8]={'$like':'%'+_0x2d1908['query'][_0x7b7e('0x37')]+'%'};return _0x43a61b;})});}_0x29d0af=_['merge']({},_0x29d0af,_0x2d1908[_0x7b7e('0x3e')]);return _0x516e75[_0x7b7e('0x49')](_0x29d0af);}})['then'](function(_0x2c167d){if(_0x2c167d){_0xc2b1b6=_0x2c167d[_0x7b7e('0x2e')];if(!_0x2d1908['query'][_0x7b7e('0x2f')](_0x7b7e('0x4c'))){_0x29d0af[_0x7b7e('0x19')]=qs[_0x7b7e('0x19')](_0x2d1908[_0x7b7e('0x25')][_0x7b7e('0x19')]);_0x29d0af[_0x7b7e('0x18')]=qs[_0x7b7e('0x18')](_0x2d1908[_0x7b7e('0x25')][_0x7b7e('0x18')]);}return _0x516e75['getAllConditions'](_0x29d0af);}})['then'](function(_0x34e7df){if(_0x34e7df){return _0x34e7df?{'count':_0xc2b1b6,'rows':_0x34e7df}:null;}})[_0x7b7e('0x20')](respondWithResult(_0x45fff9,null))[_0x7b7e('0x3d')](handleError(_0x45fff9,null));};exports[_0x7b7e('0x4d')]=function(_0xea39fa,_0x4e2c2b,_0x385f0c){var _0x5d2526={};var _0x28e6ac={};var _0x2aca93;var _0x4ff2c8;return db[_0x7b7e('0x23')][_0x7b7e('0x4a')]({'where':{'id':_0xea39fa[_0x7b7e('0x42')]['id']}})[_0x7b7e('0x20')](handleEntityNotFound(_0x4e2c2b,null))[_0x7b7e('0x20')](function(_0x40f65e){if(_0x40f65e){_0x2aca93=_0x40f65e;_0x28e6ac[_0x7b7e('0x2b')]=_[_0x7b7e('0x28')](db[_0x7b7e('0x48')][_0x7b7e('0x24')]);_0x28e6ac[_0x7b7e('0x25')]=_['keys'](_0xea39fa[_0x7b7e('0x25')]);_0x28e6ac[_0x7b7e('0x29')]=_[_0x7b7e('0x2a')](_0x28e6ac[_0x7b7e('0x2b')],_0x28e6ac[_0x7b7e('0x25')]);_0x5d2526[_0x7b7e('0x2c')]=_[_0x7b7e('0x2a')](_0x28e6ac['model'],qs[_0x7b7e('0x2d')](_0xea39fa[_0x7b7e('0x25')][_0x7b7e('0x2d')]));_0x5d2526['attributes']=_0x5d2526[_0x7b7e('0x2c')][_0x7b7e('0x2e')]?_0x5d2526[_0x7b7e('0x2c')]:_0x28e6ac[_0x7b7e('0x2b')];_0x5d2526[_0x7b7e('0x30')]=qs['sort'](_0xea39fa['query']['sort']);_0x5d2526[_0x7b7e('0x32')]=qs[_0x7b7e('0x29')](_[_0x7b7e('0x33')](_0xea39fa['query'],_0x28e6ac[_0x7b7e('0x29')]));if(_0xea39fa[_0x7b7e('0x25')][_0x7b7e('0x37')]){_0x5d2526['where']=_[_0x7b7e('0x36')](_0x5d2526[_0x7b7e('0x32')],{'$or':_[_0x7b7e('0x4b')](_0x5d2526[_0x7b7e('0x2c')],function(_0x538c5f){var _0x315923={};_0x315923[_0x538c5f]={'$like':'%'+_0xea39fa[_0x7b7e('0x25')][_0x7b7e('0x37')]+'%'};return _0x315923;})});}_0x5d2526=_[_0x7b7e('0x36')]({},_0x5d2526,_0xea39fa['options']);return _0x2aca93['getAnyConditions'](_0x5d2526);}})[_0x7b7e('0x20')](function(_0x58a963){if(_0x58a963){_0x4ff2c8=_0x58a963[_0x7b7e('0x2e')];if(!_0xea39fa[_0x7b7e('0x25')][_0x7b7e('0x2f')](_0x7b7e('0x4c'))){_0x5d2526['limit']=qs[_0x7b7e('0x19')](_0xea39fa[_0x7b7e('0x25')][_0x7b7e('0x19')]);_0x5d2526[_0x7b7e('0x18')]=qs[_0x7b7e('0x18')](_0xea39fa[_0x7b7e('0x25')][_0x7b7e('0x18')]);}return _0x2aca93[_0x7b7e('0x4d')](_0x5d2526);}})[_0x7b7e('0x20')](function(_0x23f12e){if(_0x23f12e){return _0x23f12e?{'count':_0x4ff2c8,'rows':_0x23f12e}:null;}})[_0x7b7e('0x20')](respondWithResult(_0x4e2c2b,null))[_0x7b7e('0x3d')](handleError(_0x4e2c2b,null));};exports[_0x7b7e('0x4e')]=function(_0x24189a,_0x391343,_0x28e2e9){if(_0x24189a['body']['id']){delete _0x24189a[_0x7b7e('0x41')]['id'];}return db[_0x7b7e('0x23')][_0x7b7e('0x3f')]({'where':{'id':_0x24189a[_0x7b7e('0x42')]['id']}})[_0x7b7e('0x20')](handleEntityNotFound(_0x391343,null))[_0x7b7e('0x20')](function(_0x2bf2da){if(_0x2bf2da){_0x24189a['body'][_0x7b7e('0x4f')]=_0x2bf2da['id'];return db[_0x7b7e('0x50')][_0x7b7e('0x40')](_0x24189a[_0x7b7e('0x41')]);}})[_0x7b7e('0x20')](respondWithResult(_0x391343,null))['catch'](handleError(_0x391343,null));};exports['getActions']=function(_0xb294bd,_0x110f2b,_0x145564){var _0x87d33a={};var _0x1887c7={};var _0x332ded;var _0x2c65b8;return db[_0x7b7e('0x23')][_0x7b7e('0x4a')]({'where':{'id':_0xb294bd[_0x7b7e('0x42')]['id']}})['then'](handleEntityNotFound(_0x110f2b,null))[_0x7b7e('0x20')](function(_0xe50a65){if(_0xe50a65){_0x332ded=_0xe50a65;_0x1887c7[_0x7b7e('0x2b')]=_[_0x7b7e('0x28')](db[_0x7b7e('0x50')][_0x7b7e('0x24')]);_0x1887c7[_0x7b7e('0x25')]=_['keys'](_0xb294bd[_0x7b7e('0x25')]);_0x1887c7['filters']=_[_0x7b7e('0x2a')](_0x1887c7[_0x7b7e('0x2b')],_0x1887c7['query']);_0x87d33a[_0x7b7e('0x2c')]=_[_0x7b7e('0x2a')](_0x1887c7[_0x7b7e('0x2b')],qs[_0x7b7e('0x2d')](_0xb294bd[_0x7b7e('0x25')]['fields']));_0x87d33a[_0x7b7e('0x2c')]=_0x87d33a['attributes']['length']?_0x87d33a[_0x7b7e('0x2c')]:_0x1887c7[_0x7b7e('0x2b')];_0x87d33a[_0x7b7e('0x30')]=qs[_0x7b7e('0x31')](_0xb294bd['query'][_0x7b7e('0x31')]);_0x87d33a['where']=qs[_0x7b7e('0x29')](_[_0x7b7e('0x33')](_0xb294bd[_0x7b7e('0x25')],_0x1887c7[_0x7b7e('0x29')]));if(_0xb294bd[_0x7b7e('0x25')][_0x7b7e('0x37')]){_0x87d33a[_0x7b7e('0x32')]=_['merge'](_0x87d33a[_0x7b7e('0x32')],{'$or':_[_0x7b7e('0x4b')](_0x87d33a['attributes'],function(_0x87a287){var _0x43c42e={};_0x43c42e[_0x87a287]={'$like':'%'+_0xb294bd[_0x7b7e('0x25')][_0x7b7e('0x37')]+'%'};return _0x43c42e;})});}_0x87d33a=_[_0x7b7e('0x36')]({},_0x87d33a,_0xb294bd[_0x7b7e('0x3e')]);return _0x332ded[_0x7b7e('0x51')](_0x87d33a);}})[_0x7b7e('0x20')](function(_0x41e2b5){if(_0x41e2b5){_0x2c65b8=_0x41e2b5[_0x7b7e('0x2e')];if(!_0xb294bd[_0x7b7e('0x25')][_0x7b7e('0x2f')](_0x7b7e('0x4c'))){_0x87d33a[_0x7b7e('0x19')]=qs[_0x7b7e('0x19')](_0xb294bd[_0x7b7e('0x25')][_0x7b7e('0x19')]);_0x87d33a[_0x7b7e('0x18')]=qs[_0x7b7e('0x18')](_0xb294bd[_0x7b7e('0x25')][_0x7b7e('0x18')]);}return _0x332ded[_0x7b7e('0x51')](_0x87d33a);}})['then'](function(_0x2691c4){if(_0x2691c4){return _0x2691c4?{'count':_0x2c65b8,'rows':_0x2691c4}:null;}})[_0x7b7e('0x20')](respondWithResult(_0x110f2b,null))['catch'](handleError(_0x110f2b,null));};
\ No newline at end of file
+var _0xb10b=['name','Trigger','rawAttributes','model','keys','dateStart','query','dateEnd','intersection','fields','attributes','length','nolimit','limit','sort','where','pick','add','day','merge','options','includeAll','include','findAll','rows','catch','params','find','body','addAllCondition','TriggerAllId','Condition','create','addAnyCondition','TriggerAnyId','getAllConditions','findOne','filters','order','filter','map','hasOwnProperty','getAnyConditions','addAction','getActions','Action','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack'];(function(_0x1591c2,_0x4f67e0){var _0x27ff32=function(_0x33c062){while(--_0x33c062){_0x1591c2['push'](_0x1591c2['shift']());}};_0x27ff32(++_0x4f67e0);}(_0xb10b,0x12a));var _0xbb10=function(_0x284d8f,_0x1afc9e){_0x284d8f=_0x284d8f-0x0;var _0x6acf64=_0xb10b[_0x284d8f];return _0x6acf64;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var qs=require(_0xbb10('0x12'));var logger=require(_0xbb10('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xbb10('0x14'));var db=require(_0xbb10('0x15'))['db'];function respondWithStatusCode(_0xce64f3,_0x5e136d){_0x5e136d=_0x5e136d||0xcc;return function(_0x408248){if(_0x408248){return _0xce64f3['sendStatus'](_0x5e136d);}return _0xce64f3[_0xbb10('0x16')](_0x5e136d)[_0xbb10('0x17')]();};}function respondWithResult(_0x285009,_0x193a27){_0x193a27=_0x193a27||0xc8;return function(_0x442548){if(_0x442548){return _0x285009[_0xbb10('0x16')](_0x193a27)['json'](_0x442548);}};}function respondWithFilteredResult(_0x26e021,_0x42d7e4){return function(_0x45b9d6){if(_0x45b9d6){var _0x17fd46=_0x45b9d6[_0xbb10('0x18')],_0x3df17b=_0x42d7e4[_0xbb10('0x19')],_0x2f2ebf=_0x42d7e4[_0xbb10('0x19')]+_0x42d7e4['limit'],_0x24a57b;if(_0x2f2ebf>=_0x17fd46){_0x2f2ebf=_0x17fd46;_0x24a57b=0xc8;}else{_0x24a57b=0xce;}_0x26e021[_0xbb10('0x16')](_0x24a57b);return _0x26e021[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x3df17b+'-'+_0x2f2ebf+'/'+_0x17fd46)[_0xbb10('0x1c')](_0x45b9d6);}return null;};}function patchUpdates(_0x378da8){return function(_0x1682a4){try{jsonpatch[_0xbb10('0x1d')](_0x1682a4,_0x378da8,!![]);}catch(_0x30efc6){return BPromise[_0xbb10('0x1e')](_0x30efc6);}return _0x1682a4[_0xbb10('0x1f')]();};}function saveUpdates(_0x48b6e9,_0x5ff0cf){return function(_0x19f48d){if(_0x19f48d){return _0x19f48d[_0xbb10('0x20')](_0x48b6e9)[_0xbb10('0x21')](function(_0xdf237d){return _0xdf237d;});}return null;};}function removeEntity(_0x44e563,_0x4deb49){return function(_0x12f888){if(_0x12f888){return _0x12f888[_0xbb10('0x22')]()['then'](function(){_0x44e563['status'](0xcc)[_0xbb10('0x17')]();});}};}function handleEntityNotFound(_0x311abe,_0x2e911d){return function(_0x317da4){if(!_0x317da4){_0x311abe[_0xbb10('0x23')](0x194);}return _0x317da4;};}function handleError(_0x1824b7,_0x407cb4){_0x407cb4=_0x407cb4||0x1f4;return function(_0x436104){logger[_0xbb10('0x24')](_0x436104[_0xbb10('0x25')]);if(_0x436104[_0xbb10('0x26')]){delete _0x436104[_0xbb10('0x26')];}_0x1824b7['status'](_0x407cb4)['send'](_0x436104);};}exports['index']=function(_0xc93a04,_0x3c5ae7){var _0x2c89b9={},_0x4e25ff={},_0x2fdde9={'count':0x0,'rows':[]};var _0x24d586=db[_0xbb10('0x27')][_0xbb10('0x28')];_0x4e25ff[_0xbb10('0x29')]=_[_0xbb10('0x2a')](_0x24d586);var _0x2a0e8b={'dateStart':_0xc93a04['query'][_0xbb10('0x2b')],'dateEnd':_0xc93a04[_0xbb10('0x2c')][_0xbb10('0x2d')]};delete _0xc93a04[_0xbb10('0x2c')][_0xbb10('0x2b')];delete _0xc93a04[_0xbb10('0x2c')]['dateEnd'];_0x4e25ff[_0xbb10('0x2c')]=_['keys'](_0xc93a04[_0xbb10('0x2c')]);_0x4e25ff['filters']=_[_0xbb10('0x2e')](_0x4e25ff[_0xbb10('0x29')],_0x4e25ff[_0xbb10('0x2c')]);_0x2c89b9['attributes']=_['intersection'](_0x4e25ff[_0xbb10('0x29')],qs[_0xbb10('0x2f')](_0xc93a04['query'][_0xbb10('0x2f')]));_0x2c89b9[_0xbb10('0x30')]=_0x2c89b9[_0xbb10('0x30')][_0xbb10('0x31')]?_0x2c89b9[_0xbb10('0x30')]:_0x4e25ff[_0xbb10('0x29')];if(!_0xc93a04[_0xbb10('0x2c')]['hasOwnProperty'](_0xbb10('0x32'))){_0x2c89b9[_0xbb10('0x33')]=qs[_0xbb10('0x33')](_0xc93a04[_0xbb10('0x2c')][_0xbb10('0x33')]);_0x2c89b9[_0xbb10('0x19')]=qs[_0xbb10('0x19')](_0xc93a04[_0xbb10('0x2c')][_0xbb10('0x19')]);}_0x2c89b9['order']=qs[_0xbb10('0x34')](_0xc93a04[_0xbb10('0x2c')][_0xbb10('0x34')]);_0x2c89b9[_0xbb10('0x35')]=qs['filters'](_[_0xbb10('0x36')](_0xc93a04['query'],_0x4e25ff['filters']));if(_0x2a0e8b[_0xbb10('0x2b')]){if(_0x2a0e8b[_0xbb10('0x2d')]){_0x2a0e8b[_0xbb10('0x2d')]=moment(_0x2a0e8b[_0xbb10('0x2d')])[_0xbb10('0x37')](0x1,_0xbb10('0x38'));}else{_0x2a0e8b['dateEnd']=moment(_0x2a0e8b[_0xbb10('0x2b')])[_0xbb10('0x37')](0x1,'day');}_['merge'](_0x2c89b9['where'],{'createdAt':{'$gte':_0x2a0e8b[_0xbb10('0x2b')],'$lte':_0x2a0e8b[_0xbb10('0x2d')]}});}if(_0xc93a04[_0xbb10('0x2c')]['filter']){_0x2c89b9[_0xbb10('0x35')]=_[_0xbb10('0x39')](_0x2c89b9[_0xbb10('0x35')],{'$or':_['map'](_0x2c89b9[_0xbb10('0x30')],function(_0x12238a){var _0x1dcd38={};_0x1dcd38[_0x12238a]={'$like':'%'+_0xc93a04[_0xbb10('0x2c')]['filter']+'%'};return _0x1dcd38;})});}_0x2c89b9=_[_0xbb10('0x39')]({},_0x2c89b9,_0xc93a04[_0xbb10('0x3a')]);var _0x5835fd={'where':_0x2c89b9[_0xbb10('0x35')]};return db[_0xbb10('0x27')][_0xbb10('0x18')](_0x5835fd)[_0xbb10('0x21')](function(_0x2dd35a){_0x2fdde9[_0xbb10('0x18')]=_0x2dd35a;if(_0xc93a04['query'][_0xbb10('0x3b')]){_0x2c89b9[_0xbb10('0x3c')]=[{'all':!![]}];}return db[_0xbb10('0x27')][_0xbb10('0x3d')](_0x2c89b9);})['then'](function(_0x3fff6c){_0x2fdde9[_0xbb10('0x3e')]=_0x3fff6c;return _0x2fdde9;})[_0xbb10('0x21')](respondWithFilteredResult(_0x3c5ae7,_0x2c89b9))[_0xbb10('0x3f')](handleError(_0x3c5ae7,null));};exports['show']=function(_0x351484,_0x202c60){var _0x54ac18={'raw':![],'where':{'id':_0x351484[_0xbb10('0x40')]['id']}},_0x5d9a4f={};_0x5d9a4f['model']=_[_0xbb10('0x2a')](db[_0xbb10('0x27')]['rawAttributes']);_0x5d9a4f[_0xbb10('0x2c')]=_[_0xbb10('0x2a')](_0x351484[_0xbb10('0x2c')]);_0x5d9a4f['filters']=_[_0xbb10('0x2e')](_0x5d9a4f[_0xbb10('0x29')],_0x5d9a4f[_0xbb10('0x2c')]);_0x54ac18[_0xbb10('0x30')]=_[_0xbb10('0x2e')](_0x5d9a4f[_0xbb10('0x29')],qs[_0xbb10('0x2f')](_0x351484[_0xbb10('0x2c')][_0xbb10('0x2f')]));_0x54ac18[_0xbb10('0x30')]=_0x54ac18[_0xbb10('0x30')][_0xbb10('0x31')]?_0x54ac18['attributes']:_0x5d9a4f[_0xbb10('0x29')];if(_0x351484[_0xbb10('0x2c')]['includeAll']){_0x54ac18[_0xbb10('0x3c')]=[{'all':!![]}];}_0x54ac18=_[_0xbb10('0x39')]({},_0x54ac18,_0x351484[_0xbb10('0x3a')]);return db[_0xbb10('0x27')][_0xbb10('0x41')](_0x54ac18)[_0xbb10('0x21')](handleEntityNotFound(_0x202c60,null))[_0xbb10('0x21')](respondWithResult(_0x202c60,null))['catch'](handleError(_0x202c60,null));};exports['create']=function(_0xcb3354,_0x76a208){return db[_0xbb10('0x27')]['create'](_0xcb3354['body'],{})[_0xbb10('0x21')](respondWithResult(_0x76a208,0xc9))[_0xbb10('0x3f')](handleError(_0x76a208,null));};exports[_0xbb10('0x20')]=function(_0xf820fe,_0x10159b){if(_0xf820fe[_0xbb10('0x42')]['id']){delete _0xf820fe[_0xbb10('0x42')]['id'];}return db[_0xbb10('0x27')][_0xbb10('0x41')]({'where':{'id':_0xf820fe[_0xbb10('0x40')]['id']}})['then'](handleEntityNotFound(_0x10159b,null))['then'](saveUpdates(_0xf820fe[_0xbb10('0x42')],null))[_0xbb10('0x21')](respondWithResult(_0x10159b,null))[_0xbb10('0x3f')](handleError(_0x10159b,null));};exports[_0xbb10('0x22')]=function(_0x36aa7d,_0x440f9e){return db[_0xbb10('0x27')][_0xbb10('0x41')]({'where':{'id':_0x36aa7d[_0xbb10('0x40')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x440f9e,null))[_0xbb10('0x21')](removeEntity(_0x440f9e,null))[_0xbb10('0x3f')](handleError(_0x440f9e,null));};exports[_0xbb10('0x43')]=function(_0x2e6fd9,_0x1d15f4,_0x547a7a){if(_0x2e6fd9[_0xbb10('0x42')]['id']){delete _0x2e6fd9['body']['id'];}return db[_0xbb10('0x27')][_0xbb10('0x41')]({'where':{'id':_0x2e6fd9[_0xbb10('0x40')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x1d15f4,null))[_0xbb10('0x21')](function(_0x32d8e9){if(_0x32d8e9){_0x2e6fd9[_0xbb10('0x42')][_0xbb10('0x44')]=_0x32d8e9['id'];return db[_0xbb10('0x45')][_0xbb10('0x46')](_0x2e6fd9[_0xbb10('0x42')]);}})[_0xbb10('0x21')](respondWithResult(_0x1d15f4,null))[_0xbb10('0x3f')](handleError(_0x1d15f4,null));};exports[_0xbb10('0x47')]=function(_0x4475e1,_0x5de0cc,_0x4571b6){if(_0x4475e1[_0xbb10('0x42')]['id']){delete _0x4475e1[_0xbb10('0x42')]['id'];}return db[_0xbb10('0x27')][_0xbb10('0x41')]({'where':{'id':_0x4475e1[_0xbb10('0x40')]['id']}})['then'](handleEntityNotFound(_0x5de0cc,null))[_0xbb10('0x21')](function(_0x4731ce){if(_0x4731ce){_0x4475e1[_0xbb10('0x42')][_0xbb10('0x48')]=_0x4731ce['id'];return db[_0xbb10('0x45')][_0xbb10('0x46')](_0x4475e1[_0xbb10('0x42')]);}})[_0xbb10('0x21')](respondWithResult(_0x5de0cc,null))[_0xbb10('0x3f')](handleError(_0x5de0cc,null));};exports[_0xbb10('0x49')]=function(_0x2eb05a,_0x2a1ce1,_0x16932f){var _0x4e7fac={};var _0x4ea1a6={};var _0x16272d;var _0x3e6338;return db[_0xbb10('0x27')][_0xbb10('0x4a')]({'where':{'id':_0x2eb05a['params']['id']}})['then'](handleEntityNotFound(_0x2a1ce1,null))[_0xbb10('0x21')](function(_0xaf2cc3){if(_0xaf2cc3){_0x16272d=_0xaf2cc3;_0x4ea1a6[_0xbb10('0x29')]=_[_0xbb10('0x2a')](db[_0xbb10('0x45')][_0xbb10('0x28')]);_0x4ea1a6[_0xbb10('0x2c')]=_['keys'](_0x2eb05a[_0xbb10('0x2c')]);_0x4ea1a6[_0xbb10('0x4b')]=_['intersection'](_0x4ea1a6['model'],_0x4ea1a6['query']);_0x4e7fac[_0xbb10('0x30')]=_[_0xbb10('0x2e')](_0x4ea1a6[_0xbb10('0x29')],qs['fields'](_0x2eb05a['query']['fields']));_0x4e7fac[_0xbb10('0x30')]=_0x4e7fac[_0xbb10('0x30')][_0xbb10('0x31')]?_0x4e7fac['attributes']:_0x4ea1a6[_0xbb10('0x29')];_0x4e7fac[_0xbb10('0x4c')]=qs['sort'](_0x2eb05a['query'][_0xbb10('0x34')]);_0x4e7fac[_0xbb10('0x35')]=qs[_0xbb10('0x4b')](_[_0xbb10('0x36')](_0x2eb05a['query'],_0x4ea1a6[_0xbb10('0x4b')]));if(_0x2eb05a[_0xbb10('0x2c')][_0xbb10('0x4d')]){_0x4e7fac['where']=_[_0xbb10('0x39')](_0x4e7fac[_0xbb10('0x35')],{'$or':_[_0xbb10('0x4e')](_0x4e7fac['attributes'],function(_0x2ca491){var _0x31e85e={};_0x31e85e[_0x2ca491]={'$like':'%'+_0x2eb05a[_0xbb10('0x2c')][_0xbb10('0x4d')]+'%'};return _0x31e85e;})});}_0x4e7fac=_['merge']({},_0x4e7fac,_0x2eb05a[_0xbb10('0x3a')]);return _0x16272d[_0xbb10('0x49')](_0x4e7fac);}})[_0xbb10('0x21')](function(_0x2d0f4b){if(_0x2d0f4b){_0x3e6338=_0x2d0f4b['length'];if(!_0x2eb05a[_0xbb10('0x2c')][_0xbb10('0x4f')](_0xbb10('0x32'))){_0x4e7fac[_0xbb10('0x33')]=qs[_0xbb10('0x33')](_0x2eb05a[_0xbb10('0x2c')][_0xbb10('0x33')]);_0x4e7fac['offset']=qs['offset'](_0x2eb05a['query'][_0xbb10('0x19')]);}return _0x16272d[_0xbb10('0x49')](_0x4e7fac);}})[_0xbb10('0x21')](function(_0x5c9afc){if(_0x5c9afc){return _0x5c9afc?{'count':_0x3e6338,'rows':_0x5c9afc}:null;}})['then'](respondWithResult(_0x2a1ce1,null))[_0xbb10('0x3f')](handleError(_0x2a1ce1,null));};exports[_0xbb10('0x50')]=function(_0xd9e743,_0x3a9677,_0x260e06){var _0x1ad2ed={};var _0x4cf2f3={};var _0x1a5ca5;var _0x15fae2;return db[_0xbb10('0x27')][_0xbb10('0x4a')]({'where':{'id':_0xd9e743[_0xbb10('0x40')]['id']}})['then'](handleEntityNotFound(_0x3a9677,null))['then'](function(_0x5ad6ad){if(_0x5ad6ad){_0x1a5ca5=_0x5ad6ad;_0x4cf2f3[_0xbb10('0x29')]=_[_0xbb10('0x2a')](db[_0xbb10('0x45')][_0xbb10('0x28')]);_0x4cf2f3[_0xbb10('0x2c')]=_[_0xbb10('0x2a')](_0xd9e743['query']);_0x4cf2f3[_0xbb10('0x4b')]=_['intersection'](_0x4cf2f3['model'],_0x4cf2f3['query']);_0x1ad2ed[_0xbb10('0x30')]=_[_0xbb10('0x2e')](_0x4cf2f3[_0xbb10('0x29')],qs[_0xbb10('0x2f')](_0xd9e743['query'][_0xbb10('0x2f')]));_0x1ad2ed['attributes']=_0x1ad2ed['attributes'][_0xbb10('0x31')]?_0x1ad2ed[_0xbb10('0x30')]:_0x4cf2f3[_0xbb10('0x29')];_0x1ad2ed[_0xbb10('0x4c')]=qs[_0xbb10('0x34')](_0xd9e743['query'][_0xbb10('0x34')]);_0x1ad2ed[_0xbb10('0x35')]=qs[_0xbb10('0x4b')](_[_0xbb10('0x36')](_0xd9e743[_0xbb10('0x2c')],_0x4cf2f3[_0xbb10('0x4b')]));if(_0xd9e743[_0xbb10('0x2c')]['filter']){_0x1ad2ed[_0xbb10('0x35')]=_[_0xbb10('0x39')](_0x1ad2ed[_0xbb10('0x35')],{'$or':_[_0xbb10('0x4e')](_0x1ad2ed[_0xbb10('0x30')],function(_0x172be3){var _0xa3b23={};_0xa3b23[_0x172be3]={'$like':'%'+_0xd9e743[_0xbb10('0x2c')]['filter']+'%'};return _0xa3b23;})});}_0x1ad2ed=_[_0xbb10('0x39')]({},_0x1ad2ed,_0xd9e743[_0xbb10('0x3a')]);return _0x1a5ca5[_0xbb10('0x50')](_0x1ad2ed);}})['then'](function(_0x4ee101){if(_0x4ee101){_0x15fae2=_0x4ee101['length'];if(!_0xd9e743[_0xbb10('0x2c')]['hasOwnProperty']('nolimit')){_0x1ad2ed[_0xbb10('0x33')]=qs[_0xbb10('0x33')](_0xd9e743[_0xbb10('0x2c')][_0xbb10('0x33')]);_0x1ad2ed[_0xbb10('0x19')]=qs[_0xbb10('0x19')](_0xd9e743[_0xbb10('0x2c')][_0xbb10('0x19')]);}return _0x1a5ca5[_0xbb10('0x50')](_0x1ad2ed);}})['then'](function(_0x318a14){if(_0x318a14){return _0x318a14?{'count':_0x15fae2,'rows':_0x318a14}:null;}})[_0xbb10('0x21')](respondWithResult(_0x3a9677,null))[_0xbb10('0x3f')](handleError(_0x3a9677,null));};exports[_0xbb10('0x51')]=function(_0x5c8eb8,_0x4c0795,_0x3547a3){if(_0x5c8eb8[_0xbb10('0x42')]['id']){delete _0x5c8eb8[_0xbb10('0x42')]['id'];}return db[_0xbb10('0x27')]['find']({'where':{'id':_0x5c8eb8[_0xbb10('0x40')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x4c0795,null))[_0xbb10('0x21')](function(_0xf7b3e1){if(_0xf7b3e1){_0x5c8eb8[_0xbb10('0x42')]['TriggerId']=_0xf7b3e1['id'];return db['Action'][_0xbb10('0x46')](_0x5c8eb8[_0xbb10('0x42')]);}})[_0xbb10('0x21')](respondWithResult(_0x4c0795,null))['catch'](handleError(_0x4c0795,null));};exports[_0xbb10('0x52')]=function(_0x13e2ab,_0x50bcc9,_0x5caa06){var _0x2f667f={};var _0x26d0dd={};var _0x177f77;var _0x4d64ff;return db[_0xbb10('0x27')][_0xbb10('0x4a')]({'where':{'id':_0x13e2ab[_0xbb10('0x40')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x50bcc9,null))[_0xbb10('0x21')](function(_0x5de006){if(_0x5de006){_0x177f77=_0x5de006;_0x26d0dd[_0xbb10('0x29')]=_[_0xbb10('0x2a')](db[_0xbb10('0x53')]['rawAttributes']);_0x26d0dd[_0xbb10('0x2c')]=_[_0xbb10('0x2a')](_0x13e2ab[_0xbb10('0x2c')]);_0x26d0dd[_0xbb10('0x4b')]=_[_0xbb10('0x2e')](_0x26d0dd[_0xbb10('0x29')],_0x26d0dd[_0xbb10('0x2c')]);_0x2f667f[_0xbb10('0x30')]=_[_0xbb10('0x2e')](_0x26d0dd[_0xbb10('0x29')],qs[_0xbb10('0x2f')](_0x13e2ab[_0xbb10('0x2c')]['fields']));_0x2f667f['attributes']=_0x2f667f[_0xbb10('0x30')][_0xbb10('0x31')]?_0x2f667f[_0xbb10('0x30')]:_0x26d0dd[_0xbb10('0x29')];_0x2f667f[_0xbb10('0x4c')]=qs['sort'](_0x13e2ab[_0xbb10('0x2c')][_0xbb10('0x34')]);_0x2f667f[_0xbb10('0x35')]=qs[_0xbb10('0x4b')](_[_0xbb10('0x36')](_0x13e2ab[_0xbb10('0x2c')],_0x26d0dd['filters']));if(_0x13e2ab[_0xbb10('0x2c')][_0xbb10('0x4d')]){_0x2f667f['where']=_[_0xbb10('0x39')](_0x2f667f['where'],{'$or':_[_0xbb10('0x4e')](_0x2f667f[_0xbb10('0x30')],function(_0x2b473c){var _0xa99bf5={};_0xa99bf5[_0x2b473c]={'$like':'%'+_0x13e2ab[_0xbb10('0x2c')]['filter']+'%'};return _0xa99bf5;})});}_0x2f667f=_[_0xbb10('0x39')]({},_0x2f667f,_0x13e2ab['options']);return _0x177f77[_0xbb10('0x52')](_0x2f667f);}})[_0xbb10('0x21')](function(_0x5d767f){if(_0x5d767f){_0x4d64ff=_0x5d767f['length'];if(!_0x13e2ab[_0xbb10('0x2c')][_0xbb10('0x4f')](_0xbb10('0x32'))){_0x2f667f[_0xbb10('0x33')]=qs[_0xbb10('0x33')](_0x13e2ab[_0xbb10('0x2c')][_0xbb10('0x33')]);_0x2f667f[_0xbb10('0x19')]=qs[_0xbb10('0x19')](_0x13e2ab[_0xbb10('0x2c')][_0xbb10('0x19')]);}return _0x177f77['getActions'](_0x2f667f);}})[_0xbb10('0x21')](function(_0x3eeceb){if(_0x3eeceb){return _0x3eeceb?{'count':_0x4d64ff,'rows':_0x3eeceb}:null;}})[_0xbb10('0x21')](respondWithResult(_0x50bcc9,null))[_0xbb10('0x3f')](handleError(_0x50bcc9,null));};
\ No newline at end of file
index 1ba2cfc..afe4035 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x532a=['define','tools_triggers','util','../../config/logger','api','bluebird','request-promise','./trigger.attributes','exports'];(function(_0x609988,_0x507944){var _0x159984=function(_0x39d9ce){while(--_0x39d9ce){_0x609988['push'](_0x609988['shift']());}};_0x159984(++_0x507944);}(_0x532a,0x80));var _0xa532=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0x532a[_0x2e2681];return _0x368a64;};'use strict';var _=require('lodash');var util=require(_0xa532('0x0'));var logger=require(_0xa532('0x1'))(_0xa532('0x2'));var moment=require('moment');var BPromise=require(_0xa532('0x3'));var rp=require(_0xa532('0x4'));var attributes=require(_0xa532('0x5'));module[_0xa532('0x6')]=function(_0x299463,_0x14fc02){return _0x299463[_0xa532('0x7')]('Trigger',attributes,{'tableName':_0xa532('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x02a7=['tools_triggers','lodash','../../config/logger','api','bluebird','request-promise','./trigger.attributes','exports','define','Trigger'];(function(_0x540133,_0x41783f){var _0x26b6e9=function(_0x10ebe3){while(--_0x10ebe3){_0x540133['push'](_0x540133['shift']());}};_0x26b6e9(++_0x41783f);}(_0x02a7,0x12d));var _0x702a=function(_0x38af91,_0x5835fa){_0x38af91=_0x38af91-0x0;var _0xba4c6f=_0x02a7[_0x38af91];return _0xba4c6f;};'use strict';var _=require(_0x702a('0x0'));var util=require('util');var logger=require(_0x702a('0x1'))(_0x702a('0x2'));var moment=require('moment');var BPromise=require(_0x702a('0x3'));var rp=require(_0x702a('0x4'));var attributes=require(_0x702a('0x5'));module[_0x702a('0x6')]=function(_0x2ce275,_0xfddcdb){return _0x2ce275[_0x702a('0x7')](_0x702a('0x8'),attributes,{'tableName':_0x702a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 205aceb..41d630f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf0b=['limit','include','map','model','attributes','ShowTrigger','Trigger','find','lodash','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrigger','options','raw','where'];(function(_0x3e0d62,_0x347bdf){var _0x109aa4=function(_0x1032f0){while(--_0x1032f0){_0x3e0d62['push'](_0x3e0d62['shift']());}};_0x109aa4(++_0x347bdf);}(_0xcf0b,0x108));var _0xbcf0=function(_0x20f76a,_0x2605e2){_0x20f76a=_0x20f76a-0x0;var _0x30016d=_0xcf0b[_0x20f76a];return _0x30016d;};'use strict';var _=require(_0xbcf0('0x0'));var util=require('util');var moment=require(_0xbcf0('0x1'));var BPromise=require(_0xbcf0('0x2'));var rs=require('randomstring');var fs=require('fs');var db=require(_0xbcf0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbcf0('0x4'))('rpc');var config=require(_0xbcf0('0x5'));var jayson=require(_0xbcf0('0x6'));var client=jayson[_0xbcf0('0x7')][_0xbcf0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dfc74,_0x26cf6c,_0x363ecf){return new BPromise(function(_0x21290e,_0x5830cb){return client[_0xbcf0('0x9')](_0x2dfc74,_0x363ecf)[_0xbcf0('0xa')](function(_0x34eea9){logger['info'](_0xbcf0('0xb'),_0x26cf6c,_0xbcf0('0xc'));logger[_0xbcf0('0xd')](_0xbcf0('0xe'),_0x26cf6c,'request\x20sent',JSON[_0xbcf0('0xf')](_0x34eea9));if(_0x34eea9[_0xbcf0('0x10')]){if(_0x34eea9[_0xbcf0('0x10')][_0xbcf0('0x11')]===0x1f4){logger[_0xbcf0('0x10')](_0xbcf0('0xb'),_0x26cf6c,_0x34eea9[_0xbcf0('0x10')]['message']);return _0x5830cb(_0x34eea9[_0xbcf0('0x10')][_0xbcf0('0x12')]);}logger[_0xbcf0('0x10')]('Trigger,\x20%s,\x20%s',_0x26cf6c,_0x34eea9[_0xbcf0('0x10')][_0xbcf0('0x12')]);return _0x21290e(_0x34eea9[_0xbcf0('0x10')][_0xbcf0('0x12')]);}else{logger['info'](_0xbcf0('0xb'),_0x26cf6c,_0xbcf0('0xc'));_0x21290e(_0x34eea9['result'][_0xbcf0('0x12')]);}})[_0xbcf0('0x13')](function(_0xb8f3ab){logger['error'](_0xbcf0('0xb'),_0x26cf6c,_0xb8f3ab);_0x5830cb(_0xb8f3ab);});});}exports[_0xbcf0('0x14')]=function(_0x5ad990){var _0x5b59e8=this;return new Promise(function(_0x13b2a7,_0x52254a){return db['Trigger']['findAll']({'raw':_0x5ad990['options']?_0x5ad990[_0xbcf0('0x15')][_0xbcf0('0x16')]===undefined?!![]:![]:!![],'where':_0x5ad990[_0xbcf0('0x15')]?_0x5ad990['options'][_0xbcf0('0x17')]||null:null,'attributes':_0x5ad990[_0xbcf0('0x15')]?_0x5ad990[_0xbcf0('0x15')]['attributes']||null:null,'limit':_0x5ad990['options']?_0x5ad990[_0xbcf0('0x15')][_0xbcf0('0x18')]||null:null,'include':_0x5ad990[_0xbcf0('0x15')]?_0x5ad990[_0xbcf0('0x15')][_0xbcf0('0x19')]?_[_0xbcf0('0x1a')](_0x5ad990[_0xbcf0('0x15')][_0xbcf0('0x19')],function(_0x2f6ab1){return{'model':db[_0x2f6ab1[_0xbcf0('0x1b')]],'as':_0x2f6ab1['as'],'attributes':_0x2f6ab1['attributes'],'include':_0x2f6ab1[_0xbcf0('0x19')]?_[_0xbcf0('0x1a')](_0x2f6ab1[_0xbcf0('0x19')],function(_0x2e0ba8){return{'model':db[_0x2e0ba8[_0xbcf0('0x1b')]],'as':_0x2e0ba8['as'],'attributes':_0x2e0ba8[_0xbcf0('0x1c')],'include':_0x2e0ba8[_0xbcf0('0x19')]?_[_0xbcf0('0x1a')](_0x2e0ba8[_0xbcf0('0x19')],function(_0x49f639){return{'model':db[_0x49f639[_0xbcf0('0x1b')]],'as':_0x49f639['as'],'attributes':_0x49f639[_0xbcf0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbcf0('0xa')](function(_0x196344){logger['info']('GetTrigger',_0x5ad990);logger[_0xbcf0('0xd')]('GetTrigger',_0x5ad990,JSON[_0xbcf0('0xf')](_0x196344));_0x13b2a7(_0x196344);})[_0xbcf0('0x13')](function(_0x556687){logger[_0xbcf0('0x10')](_0xbcf0('0x14'),_0x556687[_0xbcf0('0x12')],_0x5ad990);_0x52254a(_0x5b59e8['error'](0x1f4,_0x556687['message']));});});};exports[_0xbcf0('0x1d')]=function(_0x198ee7){var _0x121959=this;return new Promise(function(_0x5ab285,_0x4e5774){return db[_0xbcf0('0x1e')][_0xbcf0('0x1f')]({'raw':_0x198ee7['options']?_0x198ee7['options']['raw']===undefined?!![]:![]:!![],'where':_0x198ee7[_0xbcf0('0x15')]?_0x198ee7[_0xbcf0('0x15')][_0xbcf0('0x17')]||null:null,'attributes':_0x198ee7[_0xbcf0('0x15')]?_0x198ee7['options']['attributes']||null:null,'include':_0x198ee7['options']?_0x198ee7['options'][_0xbcf0('0x19')]?_['map'](_0x198ee7[_0xbcf0('0x15')][_0xbcf0('0x19')],function(_0x407aa8){return{'model':db[_0x407aa8[_0xbcf0('0x1b')]],'as':_0x407aa8['as'],'attributes':_0x407aa8['attributes'],'include':_0x407aa8[_0xbcf0('0x19')]?_[_0xbcf0('0x1a')](_0x407aa8[_0xbcf0('0x19')],function(_0x5f59e8){return{'model':db[_0x5f59e8['model']],'as':_0x5f59e8['as'],'attributes':_0x5f59e8[_0xbcf0('0x1c')],'include':_0x5f59e8[_0xbcf0('0x19')]?_[_0xbcf0('0x1a')](_0x5f59e8[_0xbcf0('0x19')],function(_0x106900){return{'model':db[_0x106900[_0xbcf0('0x1b')]],'as':_0x106900['as'],'attributes':_0x106900[_0xbcf0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbcf0('0xa')](function(_0x53b14a){logger['info'](_0xbcf0('0x1d'),_0x198ee7);logger[_0xbcf0('0xd')](_0xbcf0('0x1d'),_0x198ee7,JSON[_0xbcf0('0xf')](_0x53b14a));_0x5ab285(_0x53b14a);})[_0xbcf0('0x13')](function(_0x231cc8){logger[_0xbcf0('0x10')](_0xbcf0('0x1d'),_0x231cc8[_0xbcf0('0x12')],_0x198ee7);_0x4e5774(_0x121959[_0xbcf0('0x10')](0x1f4,_0x231cc8[_0xbcf0('0x12')]));});});};
\ No newline at end of file
+var _0x76f0=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','findAll','options','raw','attributes','limit','include','map','model','ShowTrigger','where','util','moment','bluebird','../../mysqldb'];(function(_0x240d23,_0x2f9f93){var _0x314a84=function(_0x1cccee){while(--_0x1cccee){_0x240d23['push'](_0x240d23['shift']());}};_0x314a84(++_0x2f9f93);}(_0x76f0,0x10c));var _0x076f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x76f0[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0x076f('0x0'));var moment=require(_0x076f('0x1'));var BPromise=require(_0x076f('0x2'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x076f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x076f('0x4'))(_0x076f('0x5'));var config=require('../../config/environment');var jayson=require(_0x076f('0x6'));var client=jayson[_0x076f('0x7')][_0x076f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x28975b,_0x192129,_0x43f601){return new BPromise(function(_0x1fc500,_0xab8c77){return client[_0x076f('0x9')](_0x28975b,_0x43f601)[_0x076f('0xa')](function(_0x36c6be){logger[_0x076f('0xb')]('Trigger,\x20%s,\x20%s',_0x192129,'request\x20sent');logger[_0x076f('0xc')](_0x076f('0xd'),_0x192129,_0x076f('0xe'),JSON[_0x076f('0xf')](_0x36c6be));if(_0x36c6be[_0x076f('0x10')]){if(_0x36c6be[_0x076f('0x10')][_0x076f('0x11')]===0x1f4){logger[_0x076f('0x10')](_0x076f('0x12'),_0x192129,_0x36c6be['error'][_0x076f('0x13')]);return _0xab8c77(_0x36c6be[_0x076f('0x10')][_0x076f('0x13')]);}logger[_0x076f('0x10')](_0x076f('0x12'),_0x192129,_0x36c6be[_0x076f('0x10')]['message']);return _0x1fc500(_0x36c6be[_0x076f('0x10')]['message']);}else{logger[_0x076f('0xb')](_0x076f('0x12'),_0x192129,'request\x20sent');_0x1fc500(_0x36c6be[_0x076f('0x14')][_0x076f('0x13')]);}})[_0x076f('0x15')](function(_0x8250e1){logger[_0x076f('0x10')](_0x076f('0x12'),_0x192129,_0x8250e1);_0xab8c77(_0x8250e1);});});}exports[_0x076f('0x16')]=function(_0x3f1b53){var _0x5a3ac2=this;return new Promise(function(_0x100d9b,_0x1caa1c){return db[_0x076f('0x17')][_0x076f('0x18')]({'raw':_0x3f1b53['options']?_0x3f1b53[_0x076f('0x19')][_0x076f('0x1a')]===undefined?!![]:![]:!![],'where':_0x3f1b53['options']?_0x3f1b53['options']['where']||null:null,'attributes':_0x3f1b53[_0x076f('0x19')]?_0x3f1b53[_0x076f('0x19')][_0x076f('0x1b')]||null:null,'limit':_0x3f1b53[_0x076f('0x19')]?_0x3f1b53[_0x076f('0x19')][_0x076f('0x1c')]||null:null,'include':_0x3f1b53[_0x076f('0x19')]?_0x3f1b53['options'][_0x076f('0x1d')]?_[_0x076f('0x1e')](_0x3f1b53[_0x076f('0x19')][_0x076f('0x1d')],function(_0x4e3e3a){return{'model':db[_0x4e3e3a[_0x076f('0x1f')]],'as':_0x4e3e3a['as'],'attributes':_0x4e3e3a[_0x076f('0x1b')],'include':_0x4e3e3a[_0x076f('0x1d')]?_[_0x076f('0x1e')](_0x4e3e3a['include'],function(_0x41e65f){return{'model':db[_0x41e65f['model']],'as':_0x41e65f['as'],'attributes':_0x41e65f[_0x076f('0x1b')],'include':_0x41e65f[_0x076f('0x1d')]?_['map'](_0x41e65f[_0x076f('0x1d')],function(_0x187362){return{'model':db[_0x187362[_0x076f('0x1f')]],'as':_0x187362['as'],'attributes':_0x187362[_0x076f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x076f('0xa')](function(_0x38dee4){logger[_0x076f('0xb')]('GetTrigger',_0x3f1b53);logger[_0x076f('0xc')](_0x076f('0x16'),_0x3f1b53,JSON[_0x076f('0xf')](_0x38dee4));_0x100d9b(_0x38dee4);})[_0x076f('0x15')](function(_0x576e13){logger[_0x076f('0x10')](_0x076f('0x16'),_0x576e13[_0x076f('0x13')],_0x3f1b53);_0x1caa1c(_0x5a3ac2[_0x076f('0x10')](0x1f4,_0x576e13[_0x076f('0x13')]));});});};exports[_0x076f('0x20')]=function(_0x12f069){var _0x1c0549=this;return new Promise(function(_0x208a45,_0x21f9b1){return db[_0x076f('0x17')]['find']({'raw':_0x12f069['options']?_0x12f069[_0x076f('0x19')][_0x076f('0x1a')]===undefined?!![]:![]:!![],'where':_0x12f069['options']?_0x12f069[_0x076f('0x19')][_0x076f('0x21')]||null:null,'attributes':_0x12f069[_0x076f('0x19')]?_0x12f069['options'][_0x076f('0x1b')]||null:null,'include':_0x12f069[_0x076f('0x19')]?_0x12f069[_0x076f('0x19')][_0x076f('0x1d')]?_['map'](_0x12f069['options'][_0x076f('0x1d')],function(_0x5473d1){return{'model':db[_0x5473d1['model']],'as':_0x5473d1['as'],'attributes':_0x5473d1[_0x076f('0x1b')],'include':_0x5473d1[_0x076f('0x1d')]?_['map'](_0x5473d1[_0x076f('0x1d')],function(_0xa269b2){return{'model':db[_0xa269b2[_0x076f('0x1f')]],'as':_0xa269b2['as'],'attributes':_0xa269b2[_0x076f('0x1b')],'include':_0xa269b2[_0x076f('0x1d')]?_['map'](_0xa269b2[_0x076f('0x1d')],function(_0x377c2b){return{'model':db[_0x377c2b[_0x076f('0x1f')]],'as':_0x377c2b['as'],'attributes':_0x377c2b[_0x076f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x076f('0xa')](function(_0x1e2c1b){logger[_0x076f('0xb')](_0x076f('0x20'),_0x12f069);logger[_0x076f('0xc')](_0x076f('0x20'),_0x12f069,JSON[_0x076f('0xf')](_0x1e2c1b));_0x208a45(_0x1e2c1b);})[_0x076f('0x15')](function(_0x4fead4){logger[_0x076f('0x10')](_0x076f('0x20'),_0x4fead4[_0x076f('0x13')],_0x12f069);_0x21f9b1(_0x1c0549[_0x076f('0x10')](0x1f4,_0x4fead4['message']));});});};
\ No newline at end of file
index 8889a79..2d84fb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x073e=['update','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','show','/:id/clone','clone','create','put','/:id'];(function(_0x27d8c8,_0x5c988f){var _0x3b411c=function(_0x149096){while(--_0x149096){_0x27d8c8['push'](_0x27d8c8['shift']());}};_0x3b411c(++_0x5c988f);}(_0x073e,0x10d));var _0xe073=function(_0x44dab8,_0x47b961){_0x44dab8=_0x44dab8-0x0;var _0x2cac03=_0x073e[_0x44dab8];return _0x2cac03;};'use strict';var multer=require(_0xe073('0x0'));var util=require('util');var path=require(_0xe073('0x1'));var express=require('express');var router=express[_0xe073('0x2')]();var auth=require(_0xe073('0x3'));var interaction=require(_0xe073('0x4'));var config=require(_0xe073('0x5'));var controller=require(_0xe073('0x6'));router[_0xe073('0x7')]('/',auth[_0xe073('0x8')](),controller[_0xe073('0x9')]);router['get']('/:id',auth[_0xe073('0x8')](),controller[_0xe073('0xa')]);router['post'](_0xe073('0xb'),auth[_0xe073('0x8')](),controller[_0xe073('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe073('0xd')]);router[_0xe073('0xe')](_0xe073('0xf'),auth[_0xe073('0x8')](),controller[_0xe073('0x10')]);router['delete'](_0xe073('0xf'),auth[_0xe073('0x8')](),controller[_0xe073('0x11')]);module[_0xe073('0x12')]=router;
\ No newline at end of file
+var _0x0f7f=['isAuthenticated','/:id/clone','clone','post','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','/:id'];(function(_0x28c86a,_0x2de221){var _0x599a90=function(_0x4d58b2){while(--_0x4d58b2){_0x28c86a['push'](_0x28c86a['shift']());}};_0x599a90(++_0x2de221);}(_0x0f7f,0xb3));var _0xf0f7=function(_0x59b5d9,_0x10fbaa){_0x59b5d9=_0x59b5d9-0x0;var _0x29b7b1=_0x0f7f[_0x59b5d9];return _0x29b7b1;};'use strict';var multer=require(_0xf0f7('0x0'));var util=require(_0xf0f7('0x1'));var path=require(_0xf0f7('0x2'));var express=require('express');var router=express[_0xf0f7('0x3')]();var auth=require(_0xf0f7('0x4'));var interaction=require(_0xf0f7('0x5'));var config=require(_0xf0f7('0x6'));var controller=require(_0xf0f7('0x7'));router[_0xf0f7('0x8')]('/',auth['isAuthenticated'](),controller[_0xf0f7('0x9')]);router[_0xf0f7('0x8')](_0xf0f7('0xa'),auth[_0xf0f7('0xb')](),controller['show']);router['post'](_0xf0f7('0xc'),auth['isAuthenticated'](),controller[_0xf0f7('0xd')]);router[_0xf0f7('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf0f7('0xa'),auth['isAuthenticated'](),controller[_0xf0f7('0xf')]);router[_0xf0f7('0x10')](_0xf0f7('0xa'),auth[_0xf0f7('0xb')](),controller[_0xf0f7('0x11')]);module[_0xf0f7('0x12')]=router;
\ No newline at end of file
index 23e2f38..f962084 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['always','accept','refuse','originate','uac','uas','fingerprint','active','passive','dynamic','update','update,nonat','BOOLEAN','sequelize','STRING','ENUM','user','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','inband','auto','yes','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','port,invite','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER'];(function(_0x36436d,_0x20292c){var _0x34615d=function(_0x5447af){while(--_0x5447af){_0x36436d['push'](_0x36436d['shift']());}};_0x34615d(++_0x20292c);}(_0xb7e7,0x121));var _0x7b7e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xb7e7[_0xf71120];return _0xbe2fd3;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x7b7e('0x2')]('friend',_0x7b7e('0x3'),'peer'),'allowNull':![],'defaultValue':_0x7b7e('0x4')},'context':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'defaultValue':_0x7b7e('0x5')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x7b7e('0x6'),_0x7b7e('0x7'),_0x7b7e('0x8'),'PROHIB_NOT_SCREENED',_0x7b7e('0x9'),_0x7b7e('0xa'),_0x7b7e('0xb'))},'deny':{'type':Sequelize[_0x7b7e('0x1')]},'permit':{'type':Sequelize[_0x7b7e('0x1')]},'secret':{'type':Sequelize[_0x7b7e('0x1')]},'md5secret':{'type':Sequelize[_0x7b7e('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':_0x7b7e('0xc'),'set':function(_0x10a666){this[_0x7b7e('0xd')](_0x7b7e('0xe'),_0x10a666?_0x10a666[_0x7b7e('0xf')](','):null);},'get':function(){return this[_0x7b7e('0x10')](_0x7b7e('0xe'))?this[_0x7b7e('0x10')]('transport')[_0x7b7e('0x11')](','):null;},'comment':_0x7b7e('0x12')},'dtmfmode':{'type':Sequelize['ENUM'](_0x7b7e('0x13'),'info','shortinfo',_0x7b7e('0x14'),_0x7b7e('0x15')),'defaultValue':_0x7b7e('0x13')},'directmedia':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no','nonat','update',_0x7b7e('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7b7e('0x1')]},'directmediadeny':{'type':Sequelize[_0x7b7e('0x1')]},'nat':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':_0x7b7e('0x18'),'set':function(_0x200ef7){this[_0x7b7e('0xd')](_0x7b7e('0x19'),_0x200ef7?_0x200ef7[_0x7b7e('0xf')](','):null);},'get':function(){return this[_0x7b7e('0x10')](_0x7b7e('0x19'))?this[_0x7b7e('0x10')](_0x7b7e('0x19'))[_0x7b7e('0x11')](','):null;},'comment':_0x7b7e('0x1a')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x7b7e('0x1')]},'pickupgroup':{'type':Sequelize[_0x7b7e('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x7b7e('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':_0x7b7e('0x1b')},'allow':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'defaultValue':_0x7b7e('0x1c'),'set':function(_0x303d8c){this[_0x7b7e('0xd')](_0x7b7e('0x1d'),_0x303d8c?_0x303d8c['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x7b7e('0x1d'))?this[_0x7b7e('0x10')](_0x7b7e('0x1d'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x7b7e('0x16'),'no')},'insecure':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':_0x7b7e('0x1e'),'set':function(_0x7aa71){this[_0x7b7e('0xd')]('insecure',_0x7aa71?_0x7aa71[_0x7b7e('0xf')](','):null);},'get':function(){return this[_0x7b7e('0x10')]('insecure')?this['getDataValue']('insecure')[_0x7b7e('0x11')](','):null;},'comment':_0x7b7e('0x1f')},'trustrpid':{'type':Sequelize['ENUM'](_0x7b7e('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x7b7e('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no','never')},'promiscredir':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'accountcode':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x7b7e('0x1')]},'callcounter':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no'),'defaultValue':_0x7b7e('0x16')},'busylevel':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'allowoverlap':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x7b7e('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0x7b7e('0x1')]},'template':{'type':Sequelize[_0x7b7e('0x1')]},'videosupport':{'type':Sequelize['ENUM'](_0x7b7e('0x16'),'no',_0x7b7e('0x21')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'mailbox':{'type':Sequelize[_0x7b7e('0x1')]},'session_timers':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x22'),_0x7b7e('0x23'),_0x7b7e('0x24'))},'session_expires':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'session_minse':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'session_refresher':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x25'),_0x7b7e('0x26')),'defaultValue':_0x7b7e('0x26')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x7b7e('0x1')]},'fromdomain':{'type':Sequelize[_0x7b7e('0x1')]},'fromuser':{'type':Sequelize[_0x7b7e('0x1')]},'port':{'type':Sequelize[_0x7b7e('0x20')](0x5)},'qualify':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no'),'defaultValue':_0x7b7e('0x16')},'keepalive':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'defaultip':{'type':Sequelize[_0x7b7e('0x1')]},'defaultuser':{'type':Sequelize[_0x7b7e('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'sendrpid':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7b7e('0x1')]},'callbackextension':{'type':Sequelize[_0x7b7e('0x1')]},'timert1':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x7b7e('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x7b7e('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x7b7e('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'encryption':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'force_avp':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'icesupport':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0x7b7e('0x2')]('yes','no',_0x7b7e('0x27'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x7b7e('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x7b7e('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x7b7e('0x1')]},'dtlssetup':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x28'),_0x7b7e('0x29'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7b7e('0x1')]},'usereqphone':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x7b7e('0x1')]},'recordofffeature':{'type':Sequelize[_0x7b7e('0x1')]},'call_limit':{'type':Sequelize[_0x7b7e('0x20')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x7b7e('0x16'),'no')},'vmexten':{'type':Sequelize[_0x7b7e('0x1')]},'mohinterpret':{'type':Sequelize[_0x7b7e('0x1')]},'mohsuggest':{'type':Sequelize[_0x7b7e('0x1')]},'parkinglot':{'type':Sequelize[_0x7b7e('0x1')]},'description':{'type':Sequelize[_0x7b7e('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x7b7e('0x2a')},'canreinvite':{'type':Sequelize[_0x7b7e('0x2')]('yes','no','nonat',_0x7b7e('0x2b'),_0x7b7e('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x7b7e('0x1')]},'otherFields':{'type':Sequelize[_0x7b7e('0x1')]},'active':{'type':Sequelize[_0x7b7e('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':'no'}};
\ No newline at end of file
+var _0x2032=['all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','refuse','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','exports','STRING','name','friend','user','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','transport','getDataValue','rfc2833','inband','auto','yes','nonat','update','outgoing','setDataValue','join','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'];(function(_0x4ad2fa,_0x5e6b53){var _0x301452=function(_0x2a74e2){while(--_0x2a74e2){_0x4ad2fa['push'](_0x4ad2fa['shift']());}};_0x301452(++_0x5e6b53);}(_0x2032,0xd9));var _0x2203=function(_0xac628d,_0x1243cd){_0xac628d=_0xac628d-0x0;var _0x39481b=_0x2032[_0xac628d];return _0x39481b;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x2203('0x3'),_0x2203('0x4'),'peer'),'allowNull':![],'defaultValue':_0x2203('0x3')},'context':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'defaultValue':_0x2203('0x5')},'callingpres':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x7'),_0x2203('0x8'),_0x2203('0x9'),_0x2203('0xa'),_0x2203('0xb'),_0x2203('0xc'),_0x2203('0xd'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x2203('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x2203('0x1')]},'remotesecret':{'type':Sequelize[_0x2203('0x1')]},'transport':{'type':Sequelize[_0x2203('0x1')],'defaultValue':'udp','set':function(_0x849049){this['setDataValue'](_0x2203('0xe'),_0x849049?_0x849049['join'](','):null);},'get':function(){return this[_0x2203('0xf')](_0x2203('0xe'))?this['getDataValue']('transport')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x2203('0x10'),'info','shortinfo',_0x2203('0x11'),_0x2203('0x12')),'defaultValue':_0x2203('0x10')},'directmedia':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no',_0x2203('0x14'),_0x2203('0x15'),_0x2203('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x2203('0x1')]},'nat':{'type':Sequelize[_0x2203('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x3f9ef6){this[_0x2203('0x17')]('nat',_0x3f9ef6?_0x3f9ef6[_0x2203('0x18')](','):null);},'get':function(){return this['getDataValue'](_0x2203('0x19'))?this[_0x2203('0xf')](_0x2203('0x19'))[_0x2203('0x1a')](','):null;},'comment':_0x2203('0x1b')},'callgroup':{'type':Sequelize[_0x2203('0x1')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x2203('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2203('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x2203('0x1c')},'allow':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3ee25b){this['setDataValue']('allow',_0x3ee25b?_0x3ee25b[_0x2203('0x18')](';'):_0x2203('0x1d'));},'get':function(){return this[_0x2203('0xf')](_0x2203('0x1e'))?this[_0x2203('0xf')](_0x2203('0x1e'))[_0x2203('0x1a')](';'):null;},'comment':_0x2203('0x1f')},'autoframing':{'type':Sequelize['ENUM'](_0x2203('0x13'),'no')},'insecure':{'type':Sequelize[_0x2203('0x1')],'defaultValue':_0x2203('0x20'),'set':function(_0x5f11bf){this[_0x2203('0x17')](_0x2203('0x21'),_0x5f11bf?_0x5f11bf['join'](','):null);},'get':function(){return this[_0x2203('0xf')](_0x2203('0x21'))?this[_0x2203('0xf')](_0x2203('0x21'))[_0x2203('0x1a')](','):null;},'comment':_0x2203('0x22')},'trustrpid':{'type':Sequelize[_0x2203('0x6')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no','never')},'promiscredir':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no')},'useclientcode':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x2203('0x1')]},'callerid':{'type':Sequelize[_0x2203('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x2203('0x6')]('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x2203('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no')},'allowsubscribe':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x2203('0x13'),'no')},'ignoresdpversion':{'type':Sequelize[_0x2203('0x6')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x2203('0x1')]},'template':{'type':Sequelize[_0x2203('0x1')]},'videosupport':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no',_0x2203('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2203('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no')},'mailbox':{'type':Sequelize[_0x2203('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0x2203('0x25'),_0x2203('0x26'),'originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x2203('0x23')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x2203('0x27'),_0x2203('0x28')),'defaultValue':_0x2203('0x28')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x2203('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x2203('0x23')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x2203('0x13'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x2203('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x2203('0x1')]},'defaultuser':{'type':Sequelize[_0x2203('0x1')]},'rtptimeout':{'type':Sequelize[_0x2203('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x2203('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0x2203('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2203('0x1')]},'callbackextension':{'type':Sequelize[_0x2203('0x1')]},'timert1':{'type':Sequelize[_0x2203('0x23')](0xb)},'timerb':{'type':Sequelize[_0x2203('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0x2203('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0x2203('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x2203('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x2203('0x1')]},'use_q850_reason':{'type':Sequelize[_0x2203('0x1')]},'maxforwards':{'type':Sequelize[_0x2203('0x23')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2203('0x6')]('yes','no')},'force_avp':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no')},'icesupport':{'type':Sequelize[_0x2203('0x6')]('yes','no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x2203('0x13'),'no')},'dtlsverify':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no',_0x2203('0x2a'),_0x2203('0x2b'))},'dtlsrekey':{'type':Sequelize[_0x2203('0x23')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x2203('0x1')]},'dtlscipher':{'type':Sequelize[_0x2203('0x1')]},'dtlscafile':{'type':Sequelize[_0x2203('0x1')]},'dtlscapath':{'type':Sequelize[_0x2203('0x1')]},'dtlssetup':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x2c'),_0x2203('0x2d'),_0x2203('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2203('0x1')]},'usereqphone':{'type':Sequelize[_0x2203('0x6')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2203('0x1')]},'recordofffeature':{'type':Sequelize[_0x2203('0x1')]},'call_limit':{'type':Sequelize[_0x2203('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x2203('0x6')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x2203('0x13'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x2203('0x1')]},'mohsuggest':{'type':Sequelize[_0x2203('0x1')]},'parkinglot':{'type':Sequelize[_0x2203('0x1')]},'description':{'type':Sequelize[_0x2203('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x2203('0x2f')},'canreinvite':{'type':Sequelize[_0x2203('0x6')]('yes','no',_0x2203('0x14'),_0x2203('0x15'),_0x2203('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x2203('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x2203('0x1')],'defaultValue':'no'}};
\ No newline at end of file
index b1b8593..1c5650a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcea2=['limit','status','set','Content-Range','reject','save','update','destroy','name','index','Trunk','model','keys','query','dateStart','dateEnd','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','add','day','merge','map','filter','includeAll','findAll','rawAttributes','include','options','find','params','get','createdAt','updatedAt','omit','body','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Reload','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','request','then','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','Trunk,\x20%s,\x20%s','message','info','catch','sendStatus','end','json','count','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcea2,0x15a));var _0x2cea=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xcea2[_0x36eaaa];return _0x461349;};'use strict';var pdf=require(_0x2cea('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2cea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2cea('0x2'));var rp=require(_0x2cea('0x3'));var moment=require(_0x2cea('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2cea('0x5'));var util=require(_0x2cea('0x6'));var path=require(_0x2cea('0x7'));var sox=require('sox');var csv=require(_0x2cea('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2cea('0x9'));var squel=require(_0x2cea('0xa'));var crypto=require(_0x2cea('0xb'));var jsforce=require(_0x2cea('0xc'));var deskjs=require(_0x2cea('0xd'));var toCsv=require(_0x2cea('0x8'));var querystring=require('querystring');var Papa=require(_0x2cea('0xe'));var qs=require(_0x2cea('0xf'));var logger=require(_0x2cea('0x10'))(_0x2cea('0x11'));var utils=require(_0x2cea('0x12'));var config=require(_0x2cea('0x13'));var db=require(_0x2cea('0x14'))['db'];var jayson=require(_0x2cea('0x15'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2fe9cd,_0x2db0ff,_0x528c1d,_0x4bd265){return new BPromise(function(_0x160eaf,_0x4e0da7){var _0xa4ce3d=_0x4bd265||client;return _0xa4ce3d[_0x2cea('0x16')](_0x2fe9cd,_0x528c1d)[_0x2cea('0x17')](function(_0x5cf805){logger['info']('Trunk,\x20%s,\x20%s',_0x2db0ff,_0x2cea('0x18'));logger['debug'](_0x2cea('0x19'),_0x2db0ff,_0x2cea('0x18'),JSON[_0x2cea('0x1a')](_0x5cf805));if(_0x5cf805[_0x2cea('0x1b')]){if(_0x5cf805[_0x2cea('0x1b')][_0x2cea('0x1c')]===0x1f4){logger[_0x2cea('0x1b')](_0x2cea('0x1d'),_0x2db0ff,_0x5cf805['error'][_0x2cea('0x1e')]);return _0x4e0da7(_0x5cf805[_0x2cea('0x1b')][_0x2cea('0x1e')]);}logger[_0x2cea('0x1b')](_0x2cea('0x1d'),_0x2db0ff,_0x5cf805[_0x2cea('0x1b')]['message']);return _0x160eaf(_0x5cf805[_0x2cea('0x1b')]['message']);}else{logger[_0x2cea('0x1f')](_0x2cea('0x1d'),_0x2db0ff,_0x2cea('0x18'));_0x160eaf(_0x5cf805['result'][_0x2cea('0x1e')]);}})[_0x2cea('0x20')](function(_0x210d7e){logger[_0x2cea('0x1b')](_0x2cea('0x1d'),_0x2db0ff,_0x210d7e);_0x4e0da7(_0x210d7e);});});}function respondWithStatusCode(_0x3f6f0e,_0x10f13a){_0x10f13a=_0x10f13a||0xcc;return function(_0x566ce2){if(_0x566ce2){return _0x3f6f0e[_0x2cea('0x21')](_0x10f13a);}return _0x3f6f0e['status'](_0x10f13a)[_0x2cea('0x22')]();};}function respondWithResult(_0x4926ff,_0x3966d5){_0x3966d5=_0x3966d5||0xc8;return function(_0x18a394){if(_0x18a394){return _0x4926ff['status'](_0x3966d5)[_0x2cea('0x23')](_0x18a394);}};}function respondWithFilteredResult(_0xd4bd54,_0x101314){return function(_0xf0bfbe){if(_0xf0bfbe){var _0x3f3ee0=_0xf0bfbe[_0x2cea('0x24')],_0x79529b=_0x101314[_0x2cea('0x25')],_0x5d032f=_0x101314[_0x2cea('0x25')]+_0x101314[_0x2cea('0x26')],_0x4ec9b3;if(_0x5d032f>=_0x3f3ee0){_0x5d032f=_0x3f3ee0;_0x4ec9b3=0xc8;}else{_0x4ec9b3=0xce;}_0xd4bd54[_0x2cea('0x27')](_0x4ec9b3);return _0xd4bd54[_0x2cea('0x28')](_0x2cea('0x29'),_0x79529b+'-'+_0x5d032f+'/'+_0x3f3ee0)['json'](_0xf0bfbe);}return null;};}function patchUpdates(_0xff69ad){return function(_0x128863){try{jsonpatch['apply'](_0x128863,_0xff69ad,!![]);}catch(_0xfeb8bd){return BPromise[_0x2cea('0x2a')](_0xfeb8bd);}return _0x128863[_0x2cea('0x2b')]();};}function saveUpdates(_0x16cf9f,_0x5e0519){return function(_0x3c0066){if(_0x3c0066){return _0x3c0066[_0x2cea('0x2c')](_0x16cf9f)['then'](function(_0x2bf4e9){return _0x2bf4e9;});}return null;};}function removeEntity(_0x2e3d44,_0xa8f660){return function(_0x393d30){if(_0x393d30){return _0x393d30[_0x2cea('0x2d')]()[_0x2cea('0x17')](function(){_0x2e3d44[_0x2cea('0x27')](0xcc)[_0x2cea('0x22')]();});}};}function handleEntityNotFound(_0x2e1cd6,_0x1e721b){return function(_0x107472){if(!_0x107472){_0x2e1cd6['sendStatus'](0x194);}return _0x107472;};}function handleError(_0x260a0f,_0xca632f){_0xca632f=_0xca632f||0x1f4;return function(_0x18a287){logger[_0x2cea('0x1b')](_0x18a287['stack']);if(_0x18a287['name']){delete _0x18a287[_0x2cea('0x2e')];}_0x260a0f[_0x2cea('0x27')](_0xca632f)['send'](_0x18a287);};}exports[_0x2cea('0x2f')]=function(_0x49d851,_0x3332db){var _0x48a5d4={},_0x510d66={},_0x5bd36b={'count':0x0,'rows':[]};var _0x2c3e1b=db[_0x2cea('0x30')]['rawAttributes'];_0x510d66[_0x2cea('0x31')]=_[_0x2cea('0x32')](_0x2c3e1b);var _0x55b4d1={'dateStart':_0x49d851[_0x2cea('0x33')][_0x2cea('0x34')],'dateEnd':_0x49d851[_0x2cea('0x33')][_0x2cea('0x35')]};delete _0x49d851[_0x2cea('0x33')]['dateStart'];delete _0x49d851[_0x2cea('0x33')][_0x2cea('0x35')];_0x510d66['query']=_['keys'](_0x49d851[_0x2cea('0x33')]);_0x510d66['filters']=_['intersection'](_0x510d66['model'],_0x510d66['query']);_0x48a5d4[_0x2cea('0x36')]=_[_0x2cea('0x37')](_0x510d66['model'],qs[_0x2cea('0x38')](_0x49d851[_0x2cea('0x33')][_0x2cea('0x38')]));_0x48a5d4['attributes']=_0x48a5d4[_0x2cea('0x36')][_0x2cea('0x39')]?_0x48a5d4[_0x2cea('0x36')]:_0x510d66[_0x2cea('0x31')];if(!_0x49d851[_0x2cea('0x33')][_0x2cea('0x3a')](_0x2cea('0x3b'))){_0x48a5d4[_0x2cea('0x26')]=qs[_0x2cea('0x26')](_0x49d851[_0x2cea('0x33')][_0x2cea('0x26')]);_0x48a5d4[_0x2cea('0x25')]=qs[_0x2cea('0x25')](_0x49d851[_0x2cea('0x33')][_0x2cea('0x25')]);}_0x48a5d4[_0x2cea('0x3c')]=qs[_0x2cea('0x3d')](_0x49d851[_0x2cea('0x33')]['sort']);_0x48a5d4[_0x2cea('0x3e')]=qs['filters'](_[_0x2cea('0x3f')](_0x49d851[_0x2cea('0x33')],_0x510d66[_0x2cea('0x40')]));if(_0x55b4d1[_0x2cea('0x34')]){if(_0x55b4d1[_0x2cea('0x35')]){_0x55b4d1[_0x2cea('0x35')]=moment(_0x55b4d1[_0x2cea('0x35')])[_0x2cea('0x41')](0x1,_0x2cea('0x42'));}else{_0x55b4d1[_0x2cea('0x35')]=moment(_0x55b4d1['dateStart'])['add'](0x1,_0x2cea('0x42'));}_[_0x2cea('0x43')](_0x48a5d4['where'],{'createdAt':{'$gte':_0x55b4d1[_0x2cea('0x34')],'$lte':_0x55b4d1['dateEnd']}});}if(_0x49d851[_0x2cea('0x33')]['filter']){_0x48a5d4[_0x2cea('0x3e')]=_[_0x2cea('0x43')](_0x48a5d4[_0x2cea('0x3e')],{'$or':_[_0x2cea('0x44')](_0x48a5d4[_0x2cea('0x36')],function(_0x13bec9){var _0x34ffe0={};_0x34ffe0[_0x13bec9]={'$like':'%'+_0x49d851[_0x2cea('0x33')][_0x2cea('0x45')]+'%'};return _0x34ffe0;})});}_0x48a5d4=_[_0x2cea('0x43')]({},_0x48a5d4,_0x49d851['options']);var _0x37cfce={'where':_0x48a5d4[_0x2cea('0x3e')]};return db[_0x2cea('0x30')][_0x2cea('0x24')](_0x37cfce)['then'](function(_0x51eb76){_0x5bd36b[_0x2cea('0x24')]=_0x51eb76;if(_0x49d851[_0x2cea('0x33')][_0x2cea('0x46')]){_0x48a5d4['include']=[{'all':!![]}];}return db[_0x2cea('0x30')][_0x2cea('0x47')](_0x48a5d4);})[_0x2cea('0x17')](function(_0x463b3f){_0x5bd36b['rows']=_0x463b3f;return _0x5bd36b;})[_0x2cea('0x17')](respondWithFilteredResult(_0x3332db,_0x48a5d4))['catch'](handleError(_0x3332db,null));};exports['show']=function(_0x42379a,_0x8a8cae){var _0x320396={'raw':![],'where':{'id':_0x42379a['params']['id']}},_0x3af41f={};_0x3af41f['model']=_[_0x2cea('0x32')](db[_0x2cea('0x30')][_0x2cea('0x48')]);_0x3af41f[_0x2cea('0x33')]=_['keys'](_0x42379a['query']);_0x3af41f['filters']=_[_0x2cea('0x37')](_0x3af41f[_0x2cea('0x31')],_0x3af41f[_0x2cea('0x33')]);_0x320396[_0x2cea('0x36')]=_[_0x2cea('0x37')](_0x3af41f[_0x2cea('0x31')],qs[_0x2cea('0x38')](_0x42379a['query'][_0x2cea('0x38')]));_0x320396[_0x2cea('0x36')]=_0x320396[_0x2cea('0x36')]['length']?_0x320396[_0x2cea('0x36')]:_0x3af41f['model'];if(_0x42379a[_0x2cea('0x33')][_0x2cea('0x46')]){_0x320396[_0x2cea('0x49')]=[{'all':!![]}];}_0x320396=_[_0x2cea('0x43')]({},_0x320396,_0x42379a[_0x2cea('0x4a')]);return db[_0x2cea('0x30')][_0x2cea('0x4b')](_0x320396)[_0x2cea('0x17')](handleEntityNotFound(_0x8a8cae,null))['then'](respondWithResult(_0x8a8cae,null))[_0x2cea('0x20')](handleError(_0x8a8cae,null));};exports['clone']=function(_0x1dc871,_0x270f3c){var _0x400a80={'raw':![],'where':{'id':_0x1dc871[_0x2cea('0x4c')]['id']}},_0x51e81c={};_0x51e81c['model']=_['keys'](db[_0x2cea('0x30')][_0x2cea('0x48')]);_0x400a80[_0x2cea('0x36')]=_[_0x2cea('0x37')](_0x51e81c[_0x2cea('0x31')],qs['fields'](_0x1dc871['query'][_0x2cea('0x38')]));_0x400a80[_0x2cea('0x36')]=_0x400a80[_0x2cea('0x36')][_0x2cea('0x39')]?_0x400a80['attributes']:_0x51e81c[_0x2cea('0x31')];if(_0x1dc871['query'][_0x2cea('0x46')]){_0x400a80[_0x2cea('0x49')]=[{'all':!![]}];}_0x400a80=_[_0x2cea('0x43')]({},_0x400a80,_0x1dc871[_0x2cea('0x4a')]);return db[_0x2cea('0x30')]['find'](_0x400a80)[_0x2cea('0x17')](handleEntityNotFound(_0x270f3c,null))[_0x2cea('0x17')](function(_0x2c6dd4){if(_0x2c6dd4){var _0x16b6ee=_0x2c6dd4[_0x2cea('0x4d')]({'plain':!![]});_0x16b6ee=qs['omit'](_0x16b6ee,['id',_0x2cea('0x4e'),_0x2cea('0x4f')]);_0x1dc871['body']=_[_0x2cea('0x50')](_0x1dc871[_0x2cea('0x51')],['id',_0x2cea('0x4e'),_0x2cea('0x4f')]);return db['Trunk']['create'](_[_0x2cea('0x43')](_0x16b6ee,_0x1dc871[_0x2cea('0x51')]),{'include':_0x1dc871['query'][_0x2cea('0x46')]?[{'all':!![]}]:undefined});}})[_0x2cea('0x17')](respondWithResult(_0x270f3c,0xc9))['catch'](handleError(_0x270f3c,null));};exports[_0x2cea('0x52')]=function(_0x34a4e1,_0x82198,_0x42881c){var _0x14daae;return db['Trunk'][_0x2cea('0x52')](_0x34a4e1[_0x2cea('0x51')],{'raw':!![]})['then'](function(_0x28f6d8){_0x14daae=_0x28f6d8;return db[_0x2cea('0x30')][_0x2cea('0x47')]({'raw':!![]});})[_0x2cea('0x17')](function(_0x36cc18){var _0x2f37bc=fs[_0x2cea('0x53')](path[_0x2cea('0x54')](config[_0x2cea('0x55')],_0x2cea('0x56')),_0x2cea('0x57'));var _0x175d9a=fs[_0x2cea('0x53')](path['join'](config['root'],_0x2cea('0x58')),_0x2cea('0x57'));var _0x44b508=ejs[_0x2cea('0x59')](_0x2f37bc,{'trunks':_0x36cc18||[]});fs[_0x2cea('0x5a')](_0x2cea('0x5b'),_0x44b508);if(_0x14daae[_0x2cea('0x5c')]){var _0x56b5a3=ejs['render'](_0x175d9a,{'trunks':_0x36cc18||[]});fs[_0x2cea('0x5a')](_0x2cea('0x5d'),_0x56b5a3);}})[_0x2cea('0x17')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x2cea('0x17')](function(){return _0x14daae;})[_0x2cea('0x17')](respondWithResult(_0x82198,0xc9))['catch'](handleError(_0x82198,null));};exports['update']=function(_0x33d632,_0x43fcdd,_0x77f341){var _0x3ddb63;return db[_0x2cea('0x30')][_0x2cea('0x4b')]({'where':{'id':_0x33d632[_0x2cea('0x4c')]['id']}})[_0x2cea('0x17')](handleEntityNotFound(_0x43fcdd,null))['then'](saveUpdates(_0x33d632[_0x2cea('0x51')],null))[_0x2cea('0x17')](function(_0x236bf0){if(_0x236bf0){_0x3ddb63=_0x236bf0;return db[_0x2cea('0x30')][_0x2cea('0x47')]({'raw':!![]});}})['then'](function(_0x122bc9){if(_0x122bc9){var _0x242d94=fs['readFileSync'](path[_0x2cea('0x54')](config[_0x2cea('0x55')],_0x2cea('0x56')),_0x2cea('0x57'));var _0x5bcd33=fs[_0x2cea('0x53')](path[_0x2cea('0x54')](config[_0x2cea('0x55')],'server/files/templates/registry.ejs'),_0x2cea('0x57'));var _0x8021e=ejs[_0x2cea('0x59')](_0x242d94,{'trunks':_0x122bc9||[]});fs[_0x2cea('0x5a')](_0x2cea('0x5b'),_0x8021e);var _0x278060=ejs[_0x2cea('0x59')](_0x5bcd33,{'trunks':_0x122bc9||[]});fs[_0x2cea('0x5a')](_0x2cea('0x5d'),_0x278060);return respondWithRpcPromise('Reload',_0x2cea('0x2c'),{'module':_0x2cea('0x5e')});}return null;})[_0x2cea('0x17')](function(_0x20f5e8){if(_0x20f5e8){return _0x3ddb63;}})['then'](respondWithResult(_0x43fcdd,null))[_0x2cea('0x20')](handleError(_0x43fcdd,null));};exports[_0x2cea('0x2d')]=function(_0x3204a8,_0x1eb530,_0x47bda8){var _0x428149;return db[_0x2cea('0x30')][_0x2cea('0x4b')]({'where':{'id':_0x3204a8[_0x2cea('0x4c')]['id']}})[_0x2cea('0x17')](handleEntityNotFound(_0x1eb530,null))[_0x2cea('0x17')](removeEntity(_0x1eb530,null))[_0x2cea('0x17')](function(){return db[_0x2cea('0x30')][_0x2cea('0x47')]({'raw':!![]});})[_0x2cea('0x17')](function(_0x31b09c){var _0x40d08b=fs[_0x2cea('0x53')](path[_0x2cea('0x54')](config['root'],_0x2cea('0x56')),'utf8');var _0x1ff98e=fs[_0x2cea('0x53')](path[_0x2cea('0x54')](config[_0x2cea('0x55')],_0x2cea('0x58')),'utf8');var _0x8093c3=ejs['render'](_0x40d08b,{'trunks':_0x31b09c});var _0x5ddfba=ejs[_0x2cea('0x59')](_0x1ff98e,{'trunks':_0x31b09c});fs[_0x2cea('0x5a')](_0x2cea('0x5b'),_0x8093c3);fs['writeFileSync'](_0x2cea('0x5d'),_0x5ddfba);return respondWithRpcPromise(_0x2cea('0x5f'),_0x2cea('0x2d'),{'module':_0x2cea('0x5e')});})['catch'](handleError(_0x1eb530,null));};
\ No newline at end of file
+var _0xf4eb=['dateEnd','query','dateStart','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','add','day','filter','where','map','merge','options','count','includeAll','include','findAll','rows','show','params','get','omit','createdAt','body','create','readFileSync','join','root','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','chan_sip.so','find','utf8','/etc/asterisk/sip_xcally_registers.conf','update','html-pdf','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','jayson/promise','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','destroy','end','stack','name','send','index','Trunk','rawAttributes','model','keys'];(function(_0x10685c,_0x11f8e1){var _0x5bb96f=function(_0x1f0666){while(--_0x1f0666){_0x10685c['push'](_0x10685c['shift']());}};_0x5bb96f(++_0x11f8e1);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1d5c31,_0x1c9738){_0x1d5c31=_0x1d5c31-0x0;var _0x1cc83b=_0xf4eb[_0x1d5c31];return _0x1cc83b;};'use strict';var pdf=require(_0xbf4e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbf4e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf4e('0x2'));var util=require(_0xbf4e('0x3'));var path=require(_0xbf4e('0x4'));var sox=require(_0xbf4e('0x5'));var csv=require(_0xbf4e('0x6'));var ejs=require(_0xbf4e('0x7'));var fs=require('fs');var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x6'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var qs=require(_0xbf4e('0xc'));var logger=require(_0xbf4e('0xd'))(_0xbf4e('0xe'));var utils=require(_0xbf4e('0xf'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0xbf4e('0x10'));var client=jayson['client'][_0xbf4e('0x11')]({'port':0x232a});function respondWithRpcPromise(_0xcf6ba8,_0x54a96e,_0x17fd01,_0x5a3035){return new BPromise(function(_0x56d185,_0x209b25){var _0x46c79c=_0x5a3035||client;return _0x46c79c[_0xbf4e('0x12')](_0xcf6ba8,_0x17fd01)[_0xbf4e('0x13')](function(_0x3b74bd){logger[_0xbf4e('0x14')]('Trunk,\x20%s,\x20%s',_0x54a96e,'request\x20sent');logger[_0xbf4e('0x15')](_0xbf4e('0x16'),_0x54a96e,_0xbf4e('0x17'),JSON['stringify'](_0x3b74bd));if(_0x3b74bd[_0xbf4e('0x18')]){if(_0x3b74bd[_0xbf4e('0x18')][_0xbf4e('0x19')]===0x1f4){logger[_0xbf4e('0x18')]('Trunk,\x20%s,\x20%s',_0x54a96e,_0x3b74bd[_0xbf4e('0x18')]['message']);return _0x209b25(_0x3b74bd['error']['message']);}logger['error'](_0xbf4e('0x1a'),_0x54a96e,_0x3b74bd[_0xbf4e('0x18')][_0xbf4e('0x1b')]);return _0x56d185(_0x3b74bd['error']['message']);}else{logger[_0xbf4e('0x14')](_0xbf4e('0x1a'),_0x54a96e,_0xbf4e('0x17'));_0x56d185(_0x3b74bd[_0xbf4e('0x1c')][_0xbf4e('0x1b')]);}})[_0xbf4e('0x1d')](function(_0x415963){logger[_0xbf4e('0x18')](_0xbf4e('0x1a'),_0x54a96e,_0x415963);_0x209b25(_0x415963);});});}function respondWithStatusCode(_0x376832,_0x30539b){_0x30539b=_0x30539b||0xcc;return function(_0x59bd84){if(_0x59bd84){return _0x376832[_0xbf4e('0x1e')](_0x30539b);}return _0x376832[_0xbf4e('0x1f')](_0x30539b)['end']();};}function respondWithResult(_0x31e3f5,_0x30994d){_0x30994d=_0x30994d||0xc8;return function(_0x114412){if(_0x114412){return _0x31e3f5[_0xbf4e('0x1f')](_0x30994d)[_0xbf4e('0x20')](_0x114412);}};}function respondWithFilteredResult(_0x4a0243,_0x90635e){return function(_0x36688a){if(_0x36688a){var _0x3d6863=_0x36688a['count'],_0x5766d4=_0x90635e[_0xbf4e('0x21')],_0x2fb490=_0x90635e['offset']+_0x90635e[_0xbf4e('0x22')],_0x5e08b1;if(_0x2fb490>=_0x3d6863){_0x2fb490=_0x3d6863;_0x5e08b1=0xc8;}else{_0x5e08b1=0xce;}_0x4a0243[_0xbf4e('0x1f')](_0x5e08b1);return _0x4a0243[_0xbf4e('0x23')](_0xbf4e('0x24'),_0x5766d4+'-'+_0x2fb490+'/'+_0x3d6863)['json'](_0x36688a);}return null;};}function patchUpdates(_0x2d4686){return function(_0x8e0ab5){try{jsonpatch[_0xbf4e('0x25')](_0x8e0ab5,_0x2d4686,!![]);}catch(_0x4cd4a1){return BPromise[_0xbf4e('0x26')](_0x4cd4a1);}return _0x8e0ab5['save']();};}function saveUpdates(_0x1dfa81,_0x1421e1){return function(_0xb8b58e){if(_0xb8b58e){return _0xb8b58e['update'](_0x1dfa81)[_0xbf4e('0x13')](function(_0x362716){return _0x362716;});}return null;};}function removeEntity(_0x2f3cf8,_0xc7ca87){return function(_0x2343dd){if(_0x2343dd){return _0x2343dd[_0xbf4e('0x27')]()['then'](function(){_0x2f3cf8[_0xbf4e('0x1f')](0xcc)[_0xbf4e('0x28')]();});}};}function handleEntityNotFound(_0x5e32c0,_0x3d8959){return function(_0x26a375){if(!_0x26a375){_0x5e32c0['sendStatus'](0x194);}return _0x26a375;};}function handleError(_0x23d769,_0x5d8285){_0x5d8285=_0x5d8285||0x1f4;return function(_0x10722a){logger['error'](_0x10722a[_0xbf4e('0x29')]);if(_0x10722a[_0xbf4e('0x2a')]){delete _0x10722a[_0xbf4e('0x2a')];}_0x23d769['status'](_0x5d8285)[_0xbf4e('0x2b')](_0x10722a);};}exports[_0xbf4e('0x2c')]=function(_0x70c54f,_0x29d6aa){var _0xb93672={},_0x477873={},_0x5b8440={'count':0x0,'rows':[]};var _0x99b320=db[_0xbf4e('0x2d')][_0xbf4e('0x2e')];_0x477873[_0xbf4e('0x2f')]=_[_0xbf4e('0x30')](_0x99b320);var _0x5b7ea1={'dateStart':_0x70c54f['query']['dateStart'],'dateEnd':_0x70c54f['query'][_0xbf4e('0x31')]};delete _0x70c54f[_0xbf4e('0x32')][_0xbf4e('0x33')];delete _0x70c54f[_0xbf4e('0x32')][_0xbf4e('0x31')];_0x477873[_0xbf4e('0x32')]=_[_0xbf4e('0x30')](_0x70c54f[_0xbf4e('0x32')]);_0x477873[_0xbf4e('0x34')]=_['intersection'](_0x477873['model'],_0x477873[_0xbf4e('0x32')]);_0xb93672[_0xbf4e('0x35')]=_[_0xbf4e('0x36')](_0x477873['model'],qs[_0xbf4e('0x37')](_0x70c54f['query'][_0xbf4e('0x37')]));_0xb93672[_0xbf4e('0x35')]=_0xb93672[_0xbf4e('0x35')][_0xbf4e('0x38')]?_0xb93672['attributes']:_0x477873[_0xbf4e('0x2f')];if(!_0x70c54f[_0xbf4e('0x32')][_0xbf4e('0x39')](_0xbf4e('0x3a'))){_0xb93672['limit']=qs[_0xbf4e('0x22')](_0x70c54f[_0xbf4e('0x32')][_0xbf4e('0x22')]);_0xb93672[_0xbf4e('0x21')]=qs[_0xbf4e('0x21')](_0x70c54f[_0xbf4e('0x32')][_0xbf4e('0x21')]);}_0xb93672['order']=qs[_0xbf4e('0x3b')](_0x70c54f[_0xbf4e('0x32')]['sort']);_0xb93672['where']=qs[_0xbf4e('0x34')](_[_0xbf4e('0x3c')](_0x70c54f['query'],_0x477873['filters']));if(_0x5b7ea1[_0xbf4e('0x33')]){if(_0x5b7ea1[_0xbf4e('0x31')]){_0x5b7ea1[_0xbf4e('0x31')]=moment(_0x5b7ea1[_0xbf4e('0x31')])[_0xbf4e('0x3d')](0x1,_0xbf4e('0x3e'));}else{_0x5b7ea1['dateEnd']=moment(_0x5b7ea1[_0xbf4e('0x33')])[_0xbf4e('0x3d')](0x1,'day');}_['merge'](_0xb93672['where'],{'createdAt':{'$gte':_0x5b7ea1['dateStart'],'$lte':_0x5b7ea1[_0xbf4e('0x31')]}});}if(_0x70c54f['query'][_0xbf4e('0x3f')]){_0xb93672[_0xbf4e('0x40')]=_['merge'](_0xb93672['where'],{'$or':_[_0xbf4e('0x41')](_0xb93672[_0xbf4e('0x35')],function(_0x46967c){var _0x40c147={};_0x40c147[_0x46967c]={'$like':'%'+_0x70c54f[_0xbf4e('0x32')]['filter']+'%'};return _0x40c147;})});}_0xb93672=_[_0xbf4e('0x42')]({},_0xb93672,_0x70c54f[_0xbf4e('0x43')]);var _0xd3a88a={'where':_0xb93672[_0xbf4e('0x40')]};return db[_0xbf4e('0x2d')][_0xbf4e('0x44')](_0xd3a88a)[_0xbf4e('0x13')](function(_0x33f5ea){_0x5b8440['count']=_0x33f5ea;if(_0x70c54f[_0xbf4e('0x32')][_0xbf4e('0x45')]){_0xb93672[_0xbf4e('0x46')]=[{'all':!![]}];}return db[_0xbf4e('0x2d')][_0xbf4e('0x47')](_0xb93672);})[_0xbf4e('0x13')](function(_0x1fce91){_0x5b8440[_0xbf4e('0x48')]=_0x1fce91;return _0x5b8440;})[_0xbf4e('0x13')](respondWithFilteredResult(_0x29d6aa,_0xb93672))[_0xbf4e('0x1d')](handleError(_0x29d6aa,null));};exports[_0xbf4e('0x49')]=function(_0x6fd78d,_0x370d4c){var _0x2ea101={'raw':![],'where':{'id':_0x6fd78d[_0xbf4e('0x4a')]['id']}},_0x24fb7d={};_0x24fb7d[_0xbf4e('0x2f')]=_['keys'](db[_0xbf4e('0x2d')][_0xbf4e('0x2e')]);_0x24fb7d[_0xbf4e('0x32')]=_['keys'](_0x6fd78d[_0xbf4e('0x32')]);_0x24fb7d['filters']=_['intersection'](_0x24fb7d[_0xbf4e('0x2f')],_0x24fb7d[_0xbf4e('0x32')]);_0x2ea101['attributes']=_[_0xbf4e('0x36')](_0x24fb7d[_0xbf4e('0x2f')],qs[_0xbf4e('0x37')](_0x6fd78d[_0xbf4e('0x32')][_0xbf4e('0x37')]));_0x2ea101[_0xbf4e('0x35')]=_0x2ea101[_0xbf4e('0x35')][_0xbf4e('0x38')]?_0x2ea101[_0xbf4e('0x35')]:_0x24fb7d[_0xbf4e('0x2f')];if(_0x6fd78d[_0xbf4e('0x32')]['includeAll']){_0x2ea101['include']=[{'all':!![]}];}_0x2ea101=_[_0xbf4e('0x42')]({},_0x2ea101,_0x6fd78d[_0xbf4e('0x43')]);return db[_0xbf4e('0x2d')]['find'](_0x2ea101)[_0xbf4e('0x13')](handleEntityNotFound(_0x370d4c,null))[_0xbf4e('0x13')](respondWithResult(_0x370d4c,null))['catch'](handleError(_0x370d4c,null));};exports['clone']=function(_0x36a87d,_0x51f212){var _0x510548={'raw':![],'where':{'id':_0x36a87d[_0xbf4e('0x4a')]['id']}},_0x424f41={};_0x424f41[_0xbf4e('0x2f')]=_[_0xbf4e('0x30')](db[_0xbf4e('0x2d')]['rawAttributes']);_0x510548[_0xbf4e('0x35')]=_['intersection'](_0x424f41[_0xbf4e('0x2f')],qs['fields'](_0x36a87d[_0xbf4e('0x32')]['fields']));_0x510548[_0xbf4e('0x35')]=_0x510548[_0xbf4e('0x35')][_0xbf4e('0x38')]?_0x510548[_0xbf4e('0x35')]:_0x424f41[_0xbf4e('0x2f')];if(_0x36a87d['query']['includeAll']){_0x510548['include']=[{'all':!![]}];}_0x510548=_['merge']({},_0x510548,_0x36a87d[_0xbf4e('0x43')]);return db[_0xbf4e('0x2d')]['find'](_0x510548)[_0xbf4e('0x13')](handleEntityNotFound(_0x51f212,null))[_0xbf4e('0x13')](function(_0x458fea){if(_0x458fea){var _0x20e913=_0x458fea[_0xbf4e('0x4b')]({'plain':!![]});_0x20e913=qs[_0xbf4e('0x4c')](_0x20e913,['id',_0xbf4e('0x4d'),'updatedAt']);_0x36a87d[_0xbf4e('0x4e')]=_[_0xbf4e('0x4c')](_0x36a87d[_0xbf4e('0x4e')],['id','createdAt','updatedAt']);return db[_0xbf4e('0x2d')][_0xbf4e('0x4f')](_[_0xbf4e('0x42')](_0x20e913,_0x36a87d['body']),{'include':_0x36a87d[_0xbf4e('0x32')][_0xbf4e('0x45')]?[{'all':!![]}]:undefined});}})[_0xbf4e('0x13')](respondWithResult(_0x51f212,0xc9))[_0xbf4e('0x1d')](handleError(_0x51f212,null));};exports[_0xbf4e('0x4f')]=function(_0x5532df,_0x35ce41,_0x3ee848){var _0x238a99;return db[_0xbf4e('0x2d')][_0xbf4e('0x4f')](_0x5532df[_0xbf4e('0x4e')],{'raw':!![]})['then'](function(_0x21cbd2){_0x238a99=_0x21cbd2;return db['Trunk'][_0xbf4e('0x47')]({'raw':!![]});})[_0xbf4e('0x13')](function(_0x400fa5){var _0x180b13=fs[_0xbf4e('0x50')](path[_0xbf4e('0x51')](config[_0xbf4e('0x52')],_0xbf4e('0x53')),'utf8');var _0x1aeedd=fs[_0xbf4e('0x50')](path[_0xbf4e('0x51')](config[_0xbf4e('0x52')],_0xbf4e('0x54')),'utf8');var _0x9492a3=ejs[_0xbf4e('0x55')](_0x180b13,{'trunks':_0x400fa5||[]});fs[_0xbf4e('0x56')](_0xbf4e('0x57'),_0x9492a3);if(_0x238a99[_0xbf4e('0x58')]){var _0x2c606b=ejs['render'](_0x1aeedd,{'trunks':_0x400fa5||[]});fs[_0xbf4e('0x56')]('/etc/asterisk/sip_xcally_registers.conf',_0x2c606b);}})[_0xbf4e('0x13')](function(){return respondWithRpcPromise(_0xbf4e('0x59'),_0xbf4e('0x4f'),{'module':_0xbf4e('0x5a')});})['then'](function(){return _0x238a99;})[_0xbf4e('0x13')](respondWithResult(_0x35ce41,0xc9))['catch'](handleError(_0x35ce41,null));};exports['update']=function(_0x2c0dbd,_0x1213da,_0x3a00ca){var _0x56f3e0;return db[_0xbf4e('0x2d')][_0xbf4e('0x5b')]({'where':{'id':_0x2c0dbd['params']['id']}})[_0xbf4e('0x13')](handleEntityNotFound(_0x1213da,null))[_0xbf4e('0x13')](saveUpdates(_0x2c0dbd[_0xbf4e('0x4e')],null))[_0xbf4e('0x13')](function(_0x260e3a){if(_0x260e3a){_0x56f3e0=_0x260e3a;return db[_0xbf4e('0x2d')][_0xbf4e('0x47')]({'raw':!![]});}})[_0xbf4e('0x13')](function(_0x2bd74f){if(_0x2bd74f){var _0x52c527=fs[_0xbf4e('0x50')](path[_0xbf4e('0x51')](config[_0xbf4e('0x52')],_0xbf4e('0x53')),'utf8');var _0x29a55f=fs[_0xbf4e('0x50')](path[_0xbf4e('0x51')](config[_0xbf4e('0x52')],_0xbf4e('0x54')),_0xbf4e('0x5c'));var _0x31e1f7=ejs[_0xbf4e('0x55')](_0x52c527,{'trunks':_0x2bd74f||[]});fs[_0xbf4e('0x56')]('/etc/asterisk/sip_xcally_trunks.conf',_0x31e1f7);var _0x24c5a1=ejs['render'](_0x29a55f,{'trunks':_0x2bd74f||[]});fs[_0xbf4e('0x56')](_0xbf4e('0x5d'),_0x24c5a1);return respondWithRpcPromise(_0xbf4e('0x59'),_0xbf4e('0x5e'),{'module':_0xbf4e('0x5a')});}return null;})['then'](function(_0x276dd8){if(_0x276dd8){return _0x56f3e0;}})[_0xbf4e('0x13')](respondWithResult(_0x1213da,null))[_0xbf4e('0x1d')](handleError(_0x1213da,null));};exports['destroy']=function(_0x471028,_0xa677bd,_0x12b3d6){var _0x53e836;return db[_0xbf4e('0x2d')][_0xbf4e('0x5b')]({'where':{'id':_0x471028[_0xbf4e('0x4a')]['id']}})[_0xbf4e('0x13')](handleEntityNotFound(_0xa677bd,null))[_0xbf4e('0x13')](removeEntity(_0xa677bd,null))['then'](function(){return db[_0xbf4e('0x2d')]['findAll']({'raw':!![]});})[_0xbf4e('0x13')](function(_0x504723){var _0x19a7e9=fs['readFileSync'](path[_0xbf4e('0x51')](config['root'],_0xbf4e('0x53')),_0xbf4e('0x5c'));var _0xf3edea=fs[_0xbf4e('0x50')](path[_0xbf4e('0x51')](config[_0xbf4e('0x52')],_0xbf4e('0x54')),'utf8');var _0x3a066d=ejs[_0xbf4e('0x55')](_0x19a7e9,{'trunks':_0x504723});var _0x2a242b=ejs[_0xbf4e('0x55')](_0xf3edea,{'trunks':_0x504723});fs[_0xbf4e('0x56')](_0xbf4e('0x57'),_0x3a066d);fs['writeFileSync'](_0xbf4e('0x5d'),_0x2a242b);return respondWithRpcPromise(_0xbf4e('0x59'),'destroy',{'module':_0xbf4e('0x5a')});})[_0xbf4e('0x1d')](handleError(_0xa677bd,null));};
\ No newline at end of file
index 97e635c..40bb66c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf35e=['request-promise','./trunk.attributes','Trunk','lodash','util','../../config/logger','moment'];(function(_0x5343f5,_0x5a7060){var _0x388133=function(_0x37f8ec){while(--_0x37f8ec){_0x5343f5['push'](_0x5343f5['shift']());}};_0x388133(++_0x5a7060);}(_0xf35e,0x16f));var _0xef35=function(_0xc687d4,_0x31f958){_0xc687d4=_0xc687d4-0x0;var _0x281ae6=_0xf35e[_0xc687d4];return _0x281ae6;};'use strict';var _=require(_0xef35('0x0'));var util=require(_0xef35('0x1'));var logger=require(_0xef35('0x2'))('api');var moment=require(_0xef35('0x3'));var BPromise=require('bluebird');var rp=require(_0xef35('0x4'));var attributes=require(_0xef35('0x5'));module['exports']=function(_0x25e391,_0x2740a8){return _0x25e391['define'](_0xef35('0x6'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1475=['request-promise','./trunk.attributes','Trunk','util','../../config/logger','api','moment','bluebird'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x1475,0x93));var _0x5147=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x1475[_0x2aec52];return _0x3b8835;};'use strict';var _=require('lodash');var util=require(_0x5147('0x0'));var logger=require(_0x5147('0x1'))(_0x5147('0x2'));var moment=require(_0x5147('0x3'));var BPromise=require(_0x5147('0x4'));var rp=require(_0x5147('0x5'));var attributes=require(_0x5147('0x6'));module['exports']=function(_0x478ef8,_0x3b2929){return _0x478ef8['define'](_0x5147('0x7'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 98c7c55..c3de654 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x454e=['lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','include','map','model','debug','ShowTrunk','find'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x454e,0xf5));var _0xe454=function(_0x5c3c6c,_0x4c8d29){_0x5c3c6c=_0x5c3c6c-0x0;var _0x41e59b=_0x454e[_0x5c3c6c];return _0x41e59b;};'use strict';var _=require(_0xe454('0x0'));var util=require(_0xe454('0x1'));var moment=require(_0xe454('0x2'));var BPromise=require(_0xe454('0x3'));var rs=require('randomstring');var fs=require('fs');var db=require(_0xe454('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe454('0x5'))(_0xe454('0x6'));var config=require(_0xe454('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe454('0x8')][_0xe454('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24b7af,_0x1129f0,_0x5dc4ea){return new BPromise(function(_0x2aaef0,_0x2e1a23){return client[_0xe454('0xa')](_0x24b7af,_0x5dc4ea)[_0xe454('0xb')](function(_0x2b8d7a){logger[_0xe454('0xc')](_0xe454('0xd'),_0x1129f0,'request\x20sent');logger['debug'](_0xe454('0xe'),_0x1129f0,_0xe454('0xf'),JSON[_0xe454('0x10')](_0x2b8d7a));if(_0x2b8d7a[_0xe454('0x11')]){if(_0x2b8d7a[_0xe454('0x11')][_0xe454('0x12')]===0x1f4){logger[_0xe454('0x11')](_0xe454('0xd'),_0x1129f0,_0x2b8d7a[_0xe454('0x11')][_0xe454('0x13')]);return _0x2e1a23(_0x2b8d7a[_0xe454('0x11')][_0xe454('0x13')]);}logger[_0xe454('0x11')](_0xe454('0xd'),_0x1129f0,_0x2b8d7a[_0xe454('0x11')][_0xe454('0x13')]);return _0x2aaef0(_0x2b8d7a[_0xe454('0x11')]['message']);}else{logger[_0xe454('0xc')](_0xe454('0xd'),_0x1129f0,_0xe454('0xf'));_0x2aaef0(_0x2b8d7a[_0xe454('0x14')][_0xe454('0x13')]);}})[_0xe454('0x15')](function(_0x44ebb6){logger[_0xe454('0x11')](_0xe454('0xd'),_0x1129f0,_0x44ebb6);_0x2e1a23(_0x44ebb6);});});}exports[_0xe454('0x16')]=function(_0x4ea88a){var _0x13d7c9=this;return new Promise(function(_0x5c2d73,_0x3602dd){return db[_0xe454('0x17')][_0xe454('0x18')]({'raw':_0x4ea88a[_0xe454('0x19')]?_0x4ea88a[_0xe454('0x19')][_0xe454('0x1a')]===undefined?!![]:![]:!![],'where':_0x4ea88a['options']?_0x4ea88a[_0xe454('0x19')][_0xe454('0x1b')]||null:null,'attributes':_0x4ea88a[_0xe454('0x19')]?_0x4ea88a['options'][_0xe454('0x1c')]||null:null,'limit':_0x4ea88a[_0xe454('0x19')]?_0x4ea88a[_0xe454('0x19')]['limit']||null:null,'include':_0x4ea88a['options']?_0x4ea88a[_0xe454('0x19')][_0xe454('0x1d')]?_[_0xe454('0x1e')](_0x4ea88a[_0xe454('0x19')][_0xe454('0x1d')],function(_0x1afb28){return{'model':db[_0x1afb28['model']],'as':_0x1afb28['as'],'attributes':_0x1afb28[_0xe454('0x1c')],'include':_0x1afb28['include']?_[_0xe454('0x1e')](_0x1afb28['include'],function(_0x13cd64){return{'model':db[_0x13cd64[_0xe454('0x1f')]],'as':_0x13cd64['as'],'attributes':_0x13cd64['attributes'],'include':_0x13cd64[_0xe454('0x1d')]?_[_0xe454('0x1e')](_0x13cd64[_0xe454('0x1d')],function(_0x5cff74){return{'model':db[_0x5cff74['model']],'as':_0x5cff74['as'],'attributes':_0x5cff74[_0xe454('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe454('0xb')](function(_0x226963){logger['info'](_0xe454('0x16'),_0x4ea88a);logger[_0xe454('0x20')](_0xe454('0x16'),_0x4ea88a,JSON[_0xe454('0x10')](_0x226963));_0x5c2d73(_0x226963);})['catch'](function(_0xa06927){logger[_0xe454('0x11')]('GetTrunk',_0xa06927[_0xe454('0x13')],_0x4ea88a);_0x3602dd(_0x13d7c9[_0xe454('0x11')](0x1f4,_0xa06927[_0xe454('0x13')]));});});};exports[_0xe454('0x21')]=function(_0x129499){var _0x34eb77=this;return new Promise(function(_0x28590c,_0x4555da){return db['Trunk'][_0xe454('0x22')]({'raw':_0x129499[_0xe454('0x19')]?_0x129499[_0xe454('0x19')][_0xe454('0x1a')]===undefined?!![]:![]:!![],'where':_0x129499[_0xe454('0x19')]?_0x129499[_0xe454('0x19')][_0xe454('0x1b')]||null:null,'attributes':_0x129499[_0xe454('0x19')]?_0x129499[_0xe454('0x19')]['attributes']||null:null,'include':_0x129499[_0xe454('0x19')]?_0x129499[_0xe454('0x19')][_0xe454('0x1d')]?_[_0xe454('0x1e')](_0x129499['options'][_0xe454('0x1d')],function(_0xc5d338){return{'model':db[_0xc5d338[_0xe454('0x1f')]],'as':_0xc5d338['as'],'attributes':_0xc5d338[_0xe454('0x1c')],'include':_0xc5d338[_0xe454('0x1d')]?_[_0xe454('0x1e')](_0xc5d338[_0xe454('0x1d')],function(_0x15877a){return{'model':db[_0x15877a[_0xe454('0x1f')]],'as':_0x15877a['as'],'attributes':_0x15877a[_0xe454('0x1c')],'include':_0x15877a[_0xe454('0x1d')]?_[_0xe454('0x1e')](_0x15877a[_0xe454('0x1d')],function(_0x4b866e){return{'model':db[_0x4b866e[_0xe454('0x1f')]],'as':_0x4b866e['as'],'attributes':_0x4b866e[_0xe454('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe454('0xb')](function(_0x1f0f2a){logger[_0xe454('0xc')](_0xe454('0x21'),_0x129499);logger[_0xe454('0x20')](_0xe454('0x21'),_0x129499,JSON[_0xe454('0x10')](_0x1f0f2a));_0x28590c(_0x1f0f2a);})[_0xe454('0x15')](function(_0x16106c){logger[_0xe454('0x11')](_0xe454('0x21'),_0x16106c[_0xe454('0x13')],_0x129499);_0x4555da(_0x34eb77[_0xe454('0x11')](0x1f4,_0x16106c[_0xe454('0x13')]));});});};
\ No newline at end of file
+var _0x77c7=['ShowTrunk','find','raw','lodash','moment','bluebird','randomstring','rpc','../../config/environment','client','http','request','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','Trunk','findAll','options','where','include','map','model','attributes','then','GetTrunk'];(function(_0x3815ac,_0x4b3151){var _0x218cec=function(_0x216f53){while(--_0x216f53){_0x3815ac['push'](_0x3815ac['shift']());}};_0x218cec(++_0x4b3151);}(_0x77c7,0x1e3));var _0x777c=function(_0x51baef,_0x4a0066){_0x51baef=_0x51baef-0x0;var _0x13405a=_0x77c7[_0x51baef];return _0x13405a;};'use strict';var _=require(_0x777c('0x0'));var util=require('util');var moment=require(_0x777c('0x1'));var BPromise=require(_0x777c('0x2'));var rs=require(_0x777c('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x777c('0x4'));var config=require(_0x777c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x777c('0x6')][_0x777c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x203b22,_0x26c0cc,_0x4f0abe){return new BPromise(function(_0x574df6,_0x432580){return client[_0x777c('0x8')](_0x203b22,_0x4f0abe)['then'](function(_0x451433){logger['info'](_0x777c('0x9'),_0x26c0cc,_0x777c('0xa'));logger[_0x777c('0xb')](_0x777c('0xc'),_0x26c0cc,_0x777c('0xa'),JSON[_0x777c('0xd')](_0x451433));if(_0x451433['error']){if(_0x451433[_0x777c('0xe')]['code']===0x1f4){logger['error'](_0x777c('0x9'),_0x26c0cc,_0x451433['error'][_0x777c('0xf')]);return _0x432580(_0x451433[_0x777c('0xe')]['message']);}logger['error'](_0x777c('0x9'),_0x26c0cc,_0x451433[_0x777c('0xe')][_0x777c('0xf')]);return _0x574df6(_0x451433['error']['message']);}else{logger[_0x777c('0x10')](_0x777c('0x9'),_0x26c0cc,_0x777c('0xa'));_0x574df6(_0x451433[_0x777c('0x11')][_0x777c('0xf')]);}})[_0x777c('0x12')](function(_0x5eeb5e){logger[_0x777c('0xe')](_0x777c('0x9'),_0x26c0cc,_0x5eeb5e);_0x432580(_0x5eeb5e);});});}exports['GetTrunk']=function(_0x3f57e7){var _0x2b992e=this;return new Promise(function(_0x5ab1b3,_0x31e2d1){return db[_0x777c('0x13')][_0x777c('0x14')]({'raw':_0x3f57e7[_0x777c('0x15')]?_0x3f57e7[_0x777c('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3f57e7[_0x777c('0x15')]?_0x3f57e7['options'][_0x777c('0x16')]||null:null,'attributes':_0x3f57e7[_0x777c('0x15')]?_0x3f57e7['options']['attributes']||null:null,'limit':_0x3f57e7[_0x777c('0x15')]?_0x3f57e7[_0x777c('0x15')]['limit']||null:null,'include':_0x3f57e7[_0x777c('0x15')]?_0x3f57e7[_0x777c('0x15')][_0x777c('0x17')]?_[_0x777c('0x18')](_0x3f57e7[_0x777c('0x15')]['include'],function(_0x47afab){return{'model':db[_0x47afab[_0x777c('0x19')]],'as':_0x47afab['as'],'attributes':_0x47afab[_0x777c('0x1a')],'include':_0x47afab[_0x777c('0x17')]?_[_0x777c('0x18')](_0x47afab[_0x777c('0x17')],function(_0x11f3b1){return{'model':db[_0x11f3b1[_0x777c('0x19')]],'as':_0x11f3b1['as'],'attributes':_0x11f3b1[_0x777c('0x1a')],'include':_0x11f3b1[_0x777c('0x17')]?_[_0x777c('0x18')](_0x11f3b1[_0x777c('0x17')],function(_0xff71ea){return{'model':db[_0xff71ea[_0x777c('0x19')]],'as':_0xff71ea['as'],'attributes':_0xff71ea[_0x777c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x777c('0x1b')](function(_0x52b21b){logger[_0x777c('0x10')]('GetTrunk',_0x3f57e7);logger['debug']('GetTrunk',_0x3f57e7,JSON['stringify'](_0x52b21b));_0x5ab1b3(_0x52b21b);})[_0x777c('0x12')](function(_0x5e1c91){logger[_0x777c('0xe')](_0x777c('0x1c'),_0x5e1c91[_0x777c('0xf')],_0x3f57e7);_0x31e2d1(_0x2b992e[_0x777c('0xe')](0x1f4,_0x5e1c91[_0x777c('0xf')]));});});};exports[_0x777c('0x1d')]=function(_0xb0466e){var _0x45da45=this;return new Promise(function(_0x39463f,_0x27a9e1){return db[_0x777c('0x13')][_0x777c('0x1e')]({'raw':_0xb0466e[_0x777c('0x15')]?_0xb0466e['options'][_0x777c('0x1f')]===undefined?!![]:![]:!![],'where':_0xb0466e[_0x777c('0x15')]?_0xb0466e['options'][_0x777c('0x16')]||null:null,'attributes':_0xb0466e[_0x777c('0x15')]?_0xb0466e[_0x777c('0x15')][_0x777c('0x1a')]||null:null,'include':_0xb0466e[_0x777c('0x15')]?_0xb0466e['options'][_0x777c('0x17')]?_[_0x777c('0x18')](_0xb0466e[_0x777c('0x15')]['include'],function(_0x56bc37){return{'model':db[_0x56bc37['model']],'as':_0x56bc37['as'],'attributes':_0x56bc37[_0x777c('0x1a')],'include':_0x56bc37[_0x777c('0x17')]?_['map'](_0x56bc37['include'],function(_0x1be749){return{'model':db[_0x1be749[_0x777c('0x19')]],'as':_0x1be749['as'],'attributes':_0x1be749[_0x777c('0x1a')],'include':_0x1be749[_0x777c('0x17')]?_[_0x777c('0x18')](_0x1be749['include'],function(_0x1cde0a){return{'model':db[_0x1cde0a[_0x777c('0x19')]],'as':_0x1cde0a['as'],'attributes':_0x1cde0a[_0x777c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x777c('0x1b')](function(_0x30da9a){logger['info'](_0x777c('0x1d'),_0xb0466e);logger[_0x777c('0xb')]('ShowTrunk',_0xb0466e,JSON[_0x777c('0xd')](_0x30da9a));_0x39463f(_0x30da9a);})['catch'](function(_0x2f68a9){logger[_0x777c('0xe')](_0x777c('0x1d'),_0x2f68a9[_0x777c('0xf')],_0xb0466e);_0x27a9e1(_0x45da45['error'](0x1f4,_0x2f68a9[_0x777c('0xf')]));});});};
\ No newline at end of file
index 0dafbd3..06bb69e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e99=['removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','exports','multer','util','Router','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','/:id/avatar','getAvatar','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','post','/create_many','bulkCreate','addContacts','addQueues','diskStorage','server/files/images/','format','%s-%s','originalname','single','addAvatar','/:id/login','login','/:id/logout','logout','pause','/:id/unpause','unpause','addTeams','addChatInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addSquareProjects','put','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeFaxAccounts','removeMailAccounts'];(function(_0x3838f2,_0x4a7c1d){var _0x2a637d=function(_0x15beac){while(--_0x15beac){_0x3838f2['push'](_0x3838f2['shift']());}};_0x2a637d(++_0x4a7c1d);}(_0x9e99,0x184));var _0x99e9=function(_0x1758b6,_0x3cb963){_0x1758b6=_0x1758b6-0x0;var _0x7ce120=_0x9e99[_0x1758b6];return _0x7ce120;};'use strict';var multer=require(_0x99e9('0x0'));var util=require(_0x99e9('0x1'));var path=require('path');var express=require('express');var router=express[_0x99e9('0x2')]();var auth=require(_0x99e9('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x99e9('0x4'));var controller=require('./user.controller');router[_0x99e9('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x99e9('0x6'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x8')]);router[_0x99e9('0x5')](_0x99e9('0x9'),auth[_0x99e9('0x7')](),controller[_0x99e9('0xa')]);router[_0x99e9('0x5')](_0x99e9('0xb'),controller[_0x99e9('0xc')]);router[_0x99e9('0x5')]('/:id/contacts',auth[_0x99e9('0x7')](),controller['getContacts']);router['get'](_0x99e9('0xd'),auth[_0x99e9('0x7')](),controller[_0x99e9('0xe')]);router[_0x99e9('0x5')](_0x99e9('0xf'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x10')]);router[_0x99e9('0x5')](_0x99e9('0x11'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x12')]);router['get'](_0x99e9('0x13'),auth[_0x99e9('0x7')](),controller['getRecordings']);router[_0x99e9('0x5')](_0x99e9('0x14'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x15')]);router[_0x99e9('0x5')]('/:id/openchannel/interactions',auth[_0x99e9('0x7')](),controller[_0x99e9('0x16')]);router[_0x99e9('0x5')](_0x99e9('0x17'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x18')]);router['get'](_0x99e9('0x19'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x1a')]);router[_0x99e9('0x5')](_0x99e9('0x1b'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x1c')]);router[_0x99e9('0x5')](_0x99e9('0x1d'),auth['isAuthenticated'](),controller[_0x99e9('0x1e')]);router[_0x99e9('0x5')]('/:id/lists',auth[_0x99e9('0x7')](),controller[_0x99e9('0x1f')]);router[_0x99e9('0x5')](_0x99e9('0x20'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x21')]);router['get']('/:id/prefixes',auth['isAuthenticated'](),controller[_0x99e9('0x22')]);router[_0x99e9('0x5')](_0x99e9('0x23'),auth[_0x99e9('0x7')](),controller['getFaxAccounts']);router[_0x99e9('0x5')](_0x99e9('0x24'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x25')]);router['get'](_0x99e9('0x26'),auth['isAuthenticated'](),controller[_0x99e9('0x27')]);router[_0x99e9('0x5')](_0x99e9('0x28'),auth[_0x99e9('0x7')](),controller['getSmsAccounts']);router[_0x99e9('0x5')](_0x99e9('0x29'),auth['isAuthenticated'](),controller[_0x99e9('0x2a')]);router[_0x99e9('0x5')](_0x99e9('0x2b'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x2c')]);router[_0x99e9('0x2d')](_0x99e9('0x2e'),auth['isAuthenticated'](),controller[_0x99e9('0x2f')]);router[_0x99e9('0x2d')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x99e9('0x30')]);router['post']('/',auth[_0x99e9('0x7')](),controller['create']);router[_0x99e9('0x2d')](_0x99e9('0xd'),auth['isAuthenticated'](),controller[_0x99e9('0x31')]);var upload=multer({'storage':multer[_0x99e9('0x32')]({'destination':function(_0x28040f,_0x4cbf2b,_0x269898){_0x269898(null,path['join'](config['root'],_0x99e9('0x33')));},'filename':function(_0x52b1ec,_0x2a90e8,_0x5bce0a){_0x5bce0a(null,util[_0x99e9('0x34')](_0x99e9('0x35'),Date['now'](),_0x2a90e8[_0x99e9('0x36')]));}})});router[_0x99e9('0x2d')](_0x99e9('0xb'),upload[_0x99e9('0x37')]('file'),controller[_0x99e9('0x38')]);router[_0x99e9('0x2d')](_0x99e9('0x39'),auth['isAuthenticated'](),controller[_0x99e9('0x3a')]);router[_0x99e9('0x2d')](_0x99e9('0x3b'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x3c')]);router[_0x99e9('0x2d')]('/:id/pause',auth[_0x99e9('0x7')](),controller[_0x99e9('0x3d')]);router['post'](_0x99e9('0x3e'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x3f')]);router[_0x99e9('0x2d')](_0x99e9('0x1d'),auth['isAuthenticated'](),controller[_0x99e9('0x40')]);router[_0x99e9('0x2d')]('/:id/chat_interactions',auth[_0x99e9('0x7')](),controller[_0x99e9('0x41')]);router[_0x99e9('0x2d')]('/:id/mail_interactions',auth[_0x99e9('0x7')](),controller['addMailInteractions']);router['post'](_0x99e9('0x42'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x43')]);router[_0x99e9('0x2d')](_0x99e9('0x44'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x45')]);router[_0x99e9('0x2d')](_0x99e9('0x46'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x47')]);router[_0x99e9('0x2d')](_0x99e9('0x23'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x48')]);router[_0x99e9('0x2d')](_0x99e9('0x24'),auth[_0x99e9('0x7')](),controller['addMailAccounts']);router[_0x99e9('0x2d')](_0x99e9('0x26'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x49')]);router['post'](_0x99e9('0x28'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x4a')]);router['post']('/:id/chat_websites',auth[_0x99e9('0x7')](),controller[_0x99e9('0x4b')]);router[_0x99e9('0x2d')]('/:id/square_projects',auth[_0x99e9('0x7')](),controller[_0x99e9('0x4c')]);router[_0x99e9('0x4d')](_0x99e9('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x99e9('0x4d')](_0x99e9('0x4e'),auth['isAuthenticated'](),controller[_0x99e9('0x4f')]);router[_0x99e9('0x50')](_0x99e9('0xd'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x51')]);router[_0x99e9('0x50')](_0x99e9('0x1d'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x52')]);router[_0x99e9('0x50')](_0x99e9('0x9'),auth['isAuthenticated'](),controller[_0x99e9('0x53')]);router[_0x99e9('0x50')](_0x99e9('0x54'),auth['isAuthenticated'](),controller[_0x99e9('0x55')]);router[_0x99e9('0x50')](_0x99e9('0x56'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x57')]);router[_0x99e9('0x50')]('/:id/fax_interactions',auth[_0x99e9('0x7')](),controller[_0x99e9('0x58')]);router['delete'](_0x99e9('0x44'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x59')]);router[_0x99e9('0x50')](_0x99e9('0x46'),auth[_0x99e9('0x7')](),controller['removeOpenchannelInteractions']);router[_0x99e9('0x50')](_0x99e9('0x23'),auth['isAuthenticated'](),controller[_0x99e9('0x5a')]);router[_0x99e9('0x50')](_0x99e9('0x24'),auth['isAuthenticated'](),controller[_0x99e9('0x5b')]);router[_0x99e9('0x50')](_0x99e9('0x26'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x5c')]);router['delete'](_0x99e9('0x28'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x5d')]);router[_0x99e9('0x50')](_0x99e9('0x29'),auth[_0x99e9('0x7')](),controller[_0x99e9('0x5e')]);router[_0x99e9('0x50')]('/:id/square_projects',auth[_0x99e9('0x7')](),controller['removeSquareProjects']);module[_0x99e9('0x5f')]=router;
\ No newline at end of file
+var _0x765f=['post','bulkCreate','addContacts','create','addQueues','diskStorage','root','server/files/images/','format','now','originalname','single','file','addAvatar','/:id/login','logout','/:id/pause','pause','unpause','addTeams','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addChatWebsites','put','update','/:id/password','changePassword','delete','removeQueues','/:id/teams','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','/:id/chat_websites','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','index','isAuthenticated','describe','/:id','show','/:id/avatar','getAvatar','/:id/contacts','getContacts','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getFaxInteractions','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/square_projects','getSquareProjects'];(function(_0x489d8e,_0x4de718){var _0x4621bd=function(_0x5391b7){while(--_0x5391b7){_0x489d8e['push'](_0x489d8e['shift']());}};_0x4621bd(++_0x4de718);}(_0x765f,0xef));var _0xf765=function(_0x52e794,_0x3e6ec0){_0x52e794=_0x52e794-0x0;var _0x53eb3a=_0x765f[_0x52e794];return _0x53eb3a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf765('0x0'));var express=require(_0xf765('0x1'));var router=express[_0xf765('0x2')]();var auth=require(_0xf765('0x3'));var interaction=require(_0xf765('0x4'));var config=require(_0xf765('0x5'));var controller=require(_0xf765('0x6'));router[_0xf765('0x7')]('/',auth['isAuthenticated'](),controller[_0xf765('0x8')]);router[_0xf765('0x7')]('/describe',auth[_0xf765('0x9')](),controller[_0xf765('0xa')]);router['get'](_0xf765('0xb'),auth['isAuthenticated'](),controller[_0xf765('0xc')]);router['get'](_0xf765('0xd'),controller[_0xf765('0xe')]);router[_0xf765('0x7')](_0xf765('0xf'),auth['isAuthenticated'](),controller[_0xf765('0x10')]);router[_0xf765('0x7')]('/:id/queues',auth[_0xf765('0x9')](),controller[_0xf765('0x11')]);router['get'](_0xf765('0x12'),auth[_0xf765('0x9')](),controller['getVoiceQueuesRt']);router[_0xf765('0x7')](_0xf765('0x13'),auth['isAuthenticated'](),controller[_0xf765('0x14')]);router[_0xf765('0x7')](_0xf765('0x15'),auth[_0xf765('0x9')](),controller['getRecordings']);router[_0xf765('0x7')](_0xf765('0x16'),auth['isAuthenticated'](),controller[_0xf765('0x17')]);router[_0xf765('0x7')](_0xf765('0x18'),auth[_0xf765('0x9')](),controller[_0xf765('0x19')]);router[_0xf765('0x7')](_0xf765('0x1a'),auth[_0xf765('0x9')](),controller['getMailInteractions']);router[_0xf765('0x7')](_0xf765('0x1b'),auth[_0xf765('0x9')](),controller['getSmsInteractions']);router['get']('/:id/fax/interactions',auth[_0xf765('0x9')](),controller[_0xf765('0x1c')]);router[_0xf765('0x7')]('/:id/teams',auth[_0xf765('0x9')](),controller[_0xf765('0x1d')]);router['get'](_0xf765('0x1e'),auth[_0xf765('0x9')](),controller[_0xf765('0x1f')]);router[_0xf765('0x7')]('/:id/agents',auth[_0xf765('0x9')](),controller[_0xf765('0x20')]);router[_0xf765('0x7')](_0xf765('0x21'),auth[_0xf765('0x9')](),controller['getVoicePrefixes']);router[_0xf765('0x7')](_0xf765('0x22'),auth[_0xf765('0x9')](),controller[_0xf765('0x23')]);router[_0xf765('0x7')](_0xf765('0x24'),auth['isAuthenticated'](),controller[_0xf765('0x25')]);router[_0xf765('0x7')](_0xf765('0x26'),auth[_0xf765('0x9')](),controller[_0xf765('0x27')]);router[_0xf765('0x7')]('/:id/sms_accounts',auth[_0xf765('0x9')](),controller[_0xf765('0x28')]);router['get']('/:id/chat_websites',auth[_0xf765('0x9')](),controller['getChatWebsites']);router['get'](_0xf765('0x29'),auth['isAuthenticated'](),controller[_0xf765('0x2a')]);router[_0xf765('0x2b')]('/create_many',auth[_0xf765('0x9')](),controller[_0xf765('0x2c')]);router[_0xf765('0x2b')](_0xf765('0xf'),auth[_0xf765('0x9')](),controller[_0xf765('0x2d')]);router[_0xf765('0x2b')]('/',auth[_0xf765('0x9')](),controller[_0xf765('0x2e')]);router[_0xf765('0x2b')]('/:id/queues',auth[_0xf765('0x9')](),controller[_0xf765('0x2f')]);var upload=multer({'storage':multer[_0xf765('0x30')]({'destination':function(_0x156ac6,_0x550265,_0xbabfef){_0xbabfef(null,path['join'](config[_0xf765('0x31')],_0xf765('0x32')));},'filename':function(_0x5e40d5,_0x3606ff,_0x35aaff){_0x35aaff(null,util[_0xf765('0x33')]('%s-%s',Date[_0xf765('0x34')](),_0x3606ff[_0xf765('0x35')]));}})});router['post'](_0xf765('0xd'),upload[_0xf765('0x36')](_0xf765('0x37')),controller[_0xf765('0x38')]);router[_0xf765('0x2b')](_0xf765('0x39'),auth[_0xf765('0x9')](),controller['login']);router[_0xf765('0x2b')]('/:id/logout',auth['isAuthenticated'](),controller[_0xf765('0x3a')]);router['post'](_0xf765('0x3b'),auth['isAuthenticated'](),controller[_0xf765('0x3c')]);router[_0xf765('0x2b')]('/:id/unpause',auth[_0xf765('0x9')](),controller[_0xf765('0x3d')]);router[_0xf765('0x2b')]('/:id/teams',auth[_0xf765('0x9')](),controller[_0xf765('0x3e')]);router[_0xf765('0x2b')]('/:id/chat_interactions',auth[_0xf765('0x9')](),controller[_0xf765('0x3f')]);router['post']('/:id/mail_interactions',auth[_0xf765('0x9')](),controller[_0xf765('0x40')]);router[_0xf765('0x2b')](_0xf765('0x41'),auth['isAuthenticated'](),controller[_0xf765('0x42')]);router[_0xf765('0x2b')](_0xf765('0x43'),auth[_0xf765('0x9')](),controller[_0xf765('0x44')]);router[_0xf765('0x2b')](_0xf765('0x45'),auth[_0xf765('0x9')](),controller[_0xf765('0x46')]);router['post']('/:id/fax_accounts',auth[_0xf765('0x9')](),controller[_0xf765('0x47')]);router[_0xf765('0x2b')](_0xf765('0x24'),auth[_0xf765('0x9')](),controller[_0xf765('0x48')]);router[_0xf765('0x2b')](_0xf765('0x26'),auth[_0xf765('0x9')](),controller[_0xf765('0x49')]);router[_0xf765('0x2b')](_0xf765('0x4a'),auth['isAuthenticated'](),controller['addSmsAccounts']);router[_0xf765('0x2b')]('/:id/chat_websites',auth[_0xf765('0x9')](),controller[_0xf765('0x4b')]);router[_0xf765('0x2b')](_0xf765('0x29'),auth['isAuthenticated'](),controller['addSquareProjects']);router[_0xf765('0x4c')]('/:id',auth[_0xf765('0x9')](),controller[_0xf765('0x4d')]);router['put'](_0xf765('0x4e'),auth[_0xf765('0x9')](),controller[_0xf765('0x4f')]);router[_0xf765('0x50')]('/:id/queues',auth[_0xf765('0x9')](),controller[_0xf765('0x51')]);router[_0xf765('0x50')](_0xf765('0x52'),auth[_0xf765('0x9')](),controller[_0xf765('0x53')]);router[_0xf765('0x50')](_0xf765('0xb'),auth[_0xf765('0x9')](),controller[_0xf765('0x54')]);router[_0xf765('0x50')](_0xf765('0x55'),auth[_0xf765('0x9')](),controller[_0xf765('0x56')]);router[_0xf765('0x50')](_0xf765('0x57'),auth[_0xf765('0x9')](),controller[_0xf765('0x58')]);router[_0xf765('0x50')](_0xf765('0x41'),auth[_0xf765('0x9')](),controller['removeFaxInteractions']);router[_0xf765('0x50')]('/:id/sms_interactions',auth[_0xf765('0x9')](),controller[_0xf765('0x59')]);router[_0xf765('0x50')](_0xf765('0x45'),auth[_0xf765('0x9')](),controller[_0xf765('0x5a')]);router[_0xf765('0x50')](_0xf765('0x22'),auth[_0xf765('0x9')](),controller[_0xf765('0x5b')]);router['delete'](_0xf765('0x24'),auth[_0xf765('0x9')](),controller['removeMailAccounts']);router[_0xf765('0x50')](_0xf765('0x26'),auth[_0xf765('0x9')](),controller['removeOpenchannelAccounts']);router[_0xf765('0x50')](_0xf765('0x4a'),auth[_0xf765('0x9')](),controller['removeSmsAccounts']);router[_0xf765('0x50')](_0xf765('0x5c'),auth['isAuthenticated'](),controller['removeChatWebsites']);router[_0xf765('0x50')](_0xf765('0x29'),auth[_0xf765('0x9')](),controller['removeSquareProjects']);module[_0xf765('0x5d')]=router;
\ No newline at end of file
index 49402fe..b648d6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3e4=['local','INTEGER','accountcode','format','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','outgoing','yes','force_rport,comedia','nat','join','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','accept','originate','uac','uas','fingerprint','passive','actpass','get','encryption','avpf','icesupport','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','wss','force_avp','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','moment','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','telephone'];(function(_0x4d92dd,_0x4cfbd6){var _0x3a67c9=function(_0x3b84db){while(--_0x3b84db){_0x4d92dd['push'](_0x4d92dd['shift']());}};_0x3a67c9(++_0x4cfbd6);}(_0xc3e4,0x12d));var _0x4c3e=function(_0x2d0ad4,_0x2c5ffe){_0x2d0ad4=_0x2d0ad4-0x0;var _0xce13e=_0xc3e4[_0x2d0ad4];return _0xce13e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4c3e('0x0'));var util=require(_0x4c3e('0x1'));var _=require(_0x4c3e('0x2'));module[_0x4c3e('0x3')]={'name':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':![],'unique':_0x4c3e('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2a2f34){this[_0x4c3e('0x6')](_0x4c3e('0x5'),_0x2a2f34);this[_0x4c3e('0x6')]('defaultuser',_0x2a2f34);},'comment':_0x4c3e('0x7')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x538326){this[_0x4c3e('0x6')](_0x4c3e('0x8'),_0x538326);this['setDataValue'](_0x4c3e('0x9'),util['format'](_0x4c3e('0xa'),_0x538326,this[_0x4c3e('0xb')](_0x4c3e('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':![],'unique':_0x4c3e('0xd'),'validate':{'isEmail':!![]},'set':function(_0x59c1a3){if(_0x59c1a3){this[_0x4c3e('0x6')]('email',_0x59c1a3[_0x4c3e('0xe')]());}}},'role':{'type':Sequelize[_0x4c3e('0xf')](_0x4c3e('0x10'),_0x4c3e('0x11'),'agent',_0x4c3e('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x4c3e('0x13')},'internal':{'type':Sequelize[_0x4c3e('0x14')](0xb),'allowNull':![],'unique':_0x4c3e('0xc'),'set':function(_0x14ce94){this[_0x4c3e('0x6')]('internal',_0x14ce94);this[_0x4c3e('0x6')](_0x4c3e('0x15'),_0x14ce94);this[_0x4c3e('0x6')](_0x4c3e('0x9'),util[_0x4c3e('0x16')](_0x4c3e('0xa'),this['getDataValue'](_0x4c3e('0x8')),_0x14ce94));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x4c3e('0x4')]},'mobile':{'type':Sequelize[_0x4c3e('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x4c3e('0x4')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x4c3e('0x4')]},'country':{'type':Sequelize[_0x4c3e('0x4')]},'online':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x4c3e('0x18')]},'voicePause':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x4c3e('0x4')],'defaultValue':_0x4c3e('0x19')},'lastPauseAt':{'type':Sequelize[_0x4c3e('0x18')]},'chatCapacity':{'type':Sequelize[_0x4c3e('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x4c3e('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x4c3e('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x4c3e('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x4c3e('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x4c3e('0x14')](0x5),'defaultValue':0x13c4},'phoneBarExpires':{'type':Sequelize[_0x4c3e('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![],'defaultValue':_0x4c3e('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x4c3e('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x4c3e('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x4c3e('0xf')](_0x4c3e('0x1b'),_0x4c3e('0x11'),_0x4c3e('0x1c')),'allowNull':!![],'defaultValue':_0x4c3e('0x1b')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x4c3e('0x1d')},'callingpres':{'type':Sequelize[_0x4c3e('0xf')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x4c3e('0x1e'),_0x4c3e('0x1f'),'PROHIB_NOT_SCREENED',_0x4c3e('0x20'),_0x4c3e('0x21'),_0x4c3e('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![],'defaultValue':_0x4c3e('0x23'),'set':function(_0x1610b6){this[_0x4c3e('0x6')](_0x4c3e('0x24'),_0x1610b6?_0x1610b6['join'](','):null);},'get':function(){return this[_0x4c3e('0xb')]('transport')?this[_0x4c3e('0xb')](_0x4c3e('0x24'))[_0x4c3e('0x25')](','):null;},'comment':_0x4c3e('0x26')},'dtmfmode':{'type':Sequelize['ENUM'](_0x4c3e('0x27'),_0x4c3e('0x28'),_0x4c3e('0x29'),_0x4c3e('0x2a'),_0x4c3e('0x2b')),'allowNull':!![],'defaultValue':_0x4c3e('0x27')},'directmedia':{'type':Sequelize[_0x4c3e('0xf')]('yes','no',_0x4c3e('0x2c'),'update',_0x4c3e('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4c3e('0xf')](_0x4c3e('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x4c3e('0x2f'),'set':function(_0x5800aa){this[_0x4c3e('0x6')](_0x4c3e('0x30'),_0x5800aa?_0x5800aa[_0x4c3e('0x31')](','):null);},'get':function(){return this[_0x4c3e('0xb')](_0x4c3e('0x30'))?this[_0x4c3e('0xb')](_0x4c3e('0x30'))[_0x4c3e('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x4c3e('0x4')]},'namedcallgroup':{'type':Sequelize[_0x4c3e('0x4')]},'pickupgroup':{'type':Sequelize[_0x4c3e('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x4c3e('0x4')]},'language':{'type':Sequelize[_0x4c3e('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4c3e('0x4')]},'disallow':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4c3e('0x32'),'set':function(_0x57a140){this[_0x4c3e('0x6')]('allow',_0x57a140?_0x57a140[_0x4c3e('0x31')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x4c3e('0xb')](_0x4c3e('0x33'))?this[_0x4c3e('0xb')](_0x4c3e('0x33'))['split'](';'):null;},'comment':_0x4c3e('0x34')},'autoframing':{'type':Sequelize['ENUM'](_0x4c3e('0x2e'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![],'set':function(_0x485261){this['setDataValue'](_0x4c3e('0x35'),_0x485261?_0x485261['join'](','):null);},'get':function(){return this[_0x4c3e('0xb')](_0x4c3e('0x35'))?this[_0x4c3e('0xb')]('insecure')[_0x4c3e('0x25')](','):null;},'comment':_0x4c3e('0x36')},'trustrpid':{'type':Sequelize[_0x4c3e('0xf')](_0x4c3e('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4c3e('0xf')](_0x4c3e('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x4c3e('0xf')](_0x4c3e('0x2e'),'no',_0x4c3e('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x4c3e('0xf')](_0x4c3e('0x2e'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x4c3e('0xf')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x4c3e('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![],'defaultValue':_0x4c3e('0x38')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x4c3e('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x4c3e('0xf')](_0x4c3e('0x2e'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x4c3e('0xf')](_0x4c3e('0x2e'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x4c3e('0xf')](_0x4c3e('0x2e'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x4c3e('0xf')](_0x4c3e('0x2e'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x4c3e('0xf')](_0x4c3e('0x2e'),'no',_0x4c3e('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x4c3e('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x4c3e('0x2e'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x4c3e('0x3a'),'refuse',_0x4c3e('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x4c3e('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x4c3e('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x4c3e('0x3c'),_0x4c3e('0x3d')),'allowNull':!![],'defaultValue':_0x4c3e('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0x4c3e('0x2e')},'keepalive':{'type':Sequelize[_0x4c3e('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x4c3e('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x4c3e('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x4c3e('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x4c3e('0xf')](_0x4c3e('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x4c3e('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x4c3e('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x4c3e('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x4c3e('0xf')](_0x4c3e('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x4c3e('0xf')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x4c3e('0x2e'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x4c3e('0xf')](_0x4c3e('0x2e'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x4c3e('0xf')](_0x4c3e('0x2e'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x4c3e('0x2e'),'no',_0x4c3e('0x3e'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x4c3e('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x4c3e('0xf')]('active',_0x4c3e('0x3f'),_0x4c3e('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x4c3e('0xf')](_0x4c3e('0x2e'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x4c3e('0xf')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x4c3e('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x4c3e('0xf')](_0x4c3e('0x2e'),'no',_0x4c3e('0x2c'),'update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x4c3e('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x4c3e('0x18')]},'showWebBar':{'type':Sequelize[_0x4c3e('0x14')],'defaultValue':0x0,'set':function(_0x418d00){this[_0x4c3e('0x6')]('showWebBar',_0x418d00);var _0x5d9709=this[_0x4c3e('0x41')]({'plain':!![]});switch(_0x418d00){case 0x0:case 0x1:var _0x39eee1=_0x5d9709[_0x4c3e('0x24')]?_['isArray'](_0x5d9709[_0x4c3e('0x24')])?_0x5d9709[_0x4c3e('0x24')][_0x4c3e('0x31')]():_0x5d9709['transport']:_0x4c3e('0x23');if(_0x39eee1==='wss'){_0x39eee1=_0x4c3e('0x23');}this[_0x4c3e('0x6')]('transport',_0x39eee1);this[_0x4c3e('0x6')](_0x4c3e('0x42'),'no');this[_0x4c3e('0x6')](_0x4c3e('0x43'),null);this[_0x4c3e('0x6')]('force_avp',null);this[_0x4c3e('0x6')](_0x4c3e('0x44'),null);this[_0x4c3e('0x6')]('dtlsenable',null);this[_0x4c3e('0x6')](_0x4c3e('0x45'),null);this[_0x4c3e('0x6')](_0x4c3e('0x46'),null);this[_0x4c3e('0x6')](_0x4c3e('0x47'),null);this[_0x4c3e('0x6')](_0x4c3e('0x48'),null);this[_0x4c3e('0x6')]('rtcp_mux','no');break;case 0x2:this[_0x4c3e('0x6')](_0x4c3e('0x24'),_0x4c3e('0x49'));this['setDataValue']('encryption',_0x4c3e('0x2e'));this[_0x4c3e('0x6')]('avpf',_0x4c3e('0x2e'));this[_0x4c3e('0x6')](_0x4c3e('0x4a'),_0x4c3e('0x2e'));this['setDataValue'](_0x4c3e('0x44'),_0x4c3e('0x2e'));this['setDataValue']('dtlsenable','yes');this[_0x4c3e('0x6')](_0x4c3e('0x45'),'no');this[_0x4c3e('0x6')](_0x4c3e('0x46'),_0x4c3e('0x40'));this[_0x4c3e('0x6')]('dtlscertfile',_0x5d9709[_0x4c3e('0x47')]||'/etc/pki/tls/certs/motion.crt');this[_0x4c3e('0x6')](_0x4c3e('0x48'),_0x5d9709[_0x4c3e('0x48')]||_0x4c3e('0x4b'));this[_0x4c3e('0x6')](_0x4c3e('0x4c'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x4c3e('0x4d')],'set':function(_0x3202eb){this[_0x4c3e('0x6')](_0x4c3e('0x4e'),_0x3202eb?_0x3202eb[_0x4c3e('0x31')](','):[]);},'get':function(){return this[_0x4c3e('0xb')]('permissions')?_[_0x4c3e('0x4f')](this['getDataValue'](_0x4c3e('0x4e'))[_0x4c3e('0x25')](','),function(_0x155480){return parseInt(_0x155480,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x4c3e('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x4c3e('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x4c3e('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x4c3e('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x4c3e('0xf')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x4c3e('0x4')]},'passwordResetAt':{'type':Sequelize[_0x4c3e('0x18')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x4c3e('0x17')],'defaultValue':![]}};
\ No newline at end of file
+var _0xcd2c=['peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','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','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<>','refuse','originate','uas','fingerprint','active','actpass','update,nonat','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsverify','dtlscertfile','rtcp_mux','dtlsenable','dtlssetup','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','TEXT','permissions','map','sequelize','moment','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','getDataValue','internal','STRING','email','toLowerCase','user','agent','telephone','local','accountcode','callerid','format','\x22%s\x22\x20<%s>','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','ENUM','friend'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xcd2c,0xea));var _0xccd2=function(_0x31575f,_0xac0687){_0x31575f=_0x31575f-0x0;var _0x27353d=_0xcd2c[_0x31575f];return _0x27353d;};'use strict';var Sequelize=require(_0xccd2('0x0'));var moment=require(_0xccd2('0x1'));var util=require(_0xccd2('0x2'));var _=require(_0xccd2('0x3'));module[_0xccd2('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xccd2('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x43a0e6){this[_0xccd2('0x6')]('name',_0x43a0e6);this['setDataValue'](_0xccd2('0x7'),_0x43a0e6);},'comment':_0xccd2('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x31fa1f){this[_0xccd2('0x6')]('fullname',_0x31fa1f);this[_0xccd2('0x6')]('callerid',util['format']('\x22%s\x22\x20<%s>',_0x31fa1f,this[_0xccd2('0x9')](_0xccd2('0xa'))));}},'alias':{'type':Sequelize[_0xccd2('0xb')]},'email':{'type':Sequelize[_0xccd2('0xb')],'allowNull':![],'unique':_0xccd2('0xc'),'validate':{'isEmail':!![]},'set':function(_0x2a8379){if(_0x2a8379){this[_0xccd2('0x6')](_0xccd2('0xc'),_0x2a8379[_0xccd2('0xd')]());}}},'role':{'type':Sequelize['ENUM']('admin',_0xccd2('0xe'),_0xccd2('0xf'),_0xccd2('0x10')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xccd2('0xb')],'defaultValue':_0xccd2('0x11')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xccd2('0xa'),'set':function(_0x58bb7b){this[_0xccd2('0x6')](_0xccd2('0xa'),_0x58bb7b);this['setDataValue'](_0xccd2('0x12'),_0x58bb7b);this[_0xccd2('0x6')](_0xccd2('0x13'),util[_0xccd2('0x14')](_0xccd2('0x15'),this[_0xccd2('0x9')](_0xccd2('0x16')),_0x58bb7b));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xccd2('0xb')]},'mobile':{'type':Sequelize[_0xccd2('0xb')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0xccd2('0xb')]},'userpic':{'type':Sequelize[_0xccd2('0xb')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xccd2('0xb')]},'online':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xccd2('0x18')]},'voicePause':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xccd2('0xb')],'defaultValue':_0xccd2('0x19')},'lastPauseAt':{'type':Sequelize[_0xccd2('0x18')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xccd2('0x1a')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xccd2('0x1a')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xccd2('0x1a')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xccd2('0x1a')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xccd2('0x1a')](0x5),'defaultValue':0x13c4},'phoneBarExpires':{'type':Sequelize[_0xccd2('0x1a')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xccd2('0x1a')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'host':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![],'defaultValue':_0xccd2('0x1b')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xccd2('0x1a')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xccd2('0x1a')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xccd2('0x1a')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xccd2('0x1c')](_0xccd2('0x1d'),'user',_0xccd2('0x1e')),'allowNull':!![],'defaultValue':_0xccd2('0x1d')},'context':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![],'defaultValue':_0xccd2('0x1f')},'callingpres':{'type':Sequelize['ENUM'](_0xccd2('0x20'),'ALLOWED_PASSED_SCREEN',_0xccd2('0x21'),_0xccd2('0x22'),'PROHIB_NOT_SCREENED',_0xccd2('0x23'),_0xccd2('0x24'),_0xccd2('0x25')),'allowNull':!![]},'deny':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'permit':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'secret':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xccd2('0x26'),'set':function(_0x1d5920){this['setDataValue'](_0xccd2('0x27'),_0x1d5920?_0x1d5920[_0xccd2('0x28')](','):null);},'get':function(){return this[_0xccd2('0x9')](_0xccd2('0x27'))?this['getDataValue'](_0xccd2('0x27'))['split'](','):null;},'comment':_0xccd2('0x29')},'dtmfmode':{'type':Sequelize[_0xccd2('0x1c')](_0xccd2('0x2a'),_0xccd2('0x2b'),'shortinfo',_0xccd2('0x2c'),_0xccd2('0x2d')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0xccd2('0x2e'),'no',_0xccd2('0x2f'),_0xccd2('0x30'),_0xccd2('0x31')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xccd2('0x1c')](_0xccd2('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'nat':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![],'defaultValue':_0xccd2('0x32'),'set':function(_0x1c039e){this[_0xccd2('0x6')](_0xccd2('0x33'),_0x1c039e?_0x1c039e[_0xccd2('0x28')](','):null);},'get':function(){return this[_0xccd2('0x9')](_0xccd2('0x33'))?this['getDataValue'](_0xccd2('0x33'))[_0xccd2('0x34')](','):null;},'comment':_0xccd2('0x35')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xccd2('0xb')]},'namedpickupgroup':{'type':Sequelize[_0xccd2('0xb')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xccd2('0xb')]},'disallow':{'type':Sequelize[_0xccd2('0xb')],'allowNull':![],'defaultValue':_0xccd2('0x36')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xccd2('0x37'),'set':function(_0x14a28c){this[_0xccd2('0x6')](_0xccd2('0x38'),_0x14a28c?_0x14a28c[_0xccd2('0x28')](';'):_0xccd2('0x37'));},'get':function(){return this['getDataValue'](_0xccd2('0x38'))?this['getDataValue'](_0xccd2('0x38'))[_0xccd2('0x34')](';'):null;},'comment':_0xccd2('0x39')},'autoframing':{'type':Sequelize[_0xccd2('0x1c')](_0xccd2('0x2e'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![],'set':function(_0x199560){this['setDataValue']('insecure',_0x199560?_0x199560[_0xccd2('0x28')](','):null);},'get':function(){return this[_0xccd2('0x9')]('insecure')?this[_0xccd2('0x9')](_0xccd2('0x3a'))[_0xccd2('0x34')](','):null;},'comment':_0xccd2('0x3b')},'trustrpid':{'type':Sequelize[_0xccd2('0x1c')](_0xccd2('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xccd2('0x1c')](_0xccd2('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xccd2('0x1c')]('yes','no',_0xccd2('0x3c')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xccd2('0x1c')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xccd2('0x1c')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xccd2('0x1a')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![],'defaultValue':_0xccd2('0x3d')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0xccd2('0x2e'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xccd2('0x1a')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xccd2('0x1c')](_0xccd2('0x2e'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xccd2('0x1c')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xccd2('0x1c')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xccd2('0x1c')](_0xccd2('0x2e'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'template':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xccd2('0x1c')](_0xccd2('0x2e'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xccd2('0x1c')]('accept',_0xccd2('0x3e'),_0xccd2('0x3f')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xccd2('0x1a')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xccd2('0x1c')]('uac',_0xccd2('0x40')),'allowNull':!![],'defaultValue':_0xccd2('0x40')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xccd2('0x1c')](_0xccd2('0x2e'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xccd2('0x1a')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xccd2('0x1a')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xccd2('0x1a')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xccd2('0x1a')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xccd2('0x1c')](_0xccd2('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xccd2('0x1a')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xccd2('0x1a')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xccd2('0x1a')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xccd2('0x1a')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xccd2('0x1c')](_0xccd2('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xccd2('0x1c')](_0xccd2('0x2e'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xccd2('0x2e'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xccd2('0x1c')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xccd2('0x1c')](_0xccd2('0x2e'),'no',_0xccd2('0x41'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0xccd2('0x42'),'passive',_0xccd2('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xccd2('0x1c')](_0xccd2('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xccd2('0x1a')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xccd2('0x1c')](_0xccd2('0x2e'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xccd2('0x1c')](_0xccd2('0x2e'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xccd2('0xb')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xccd2('0x1c')](_0xccd2('0x2e'),'no','nonat',_0xccd2('0x30'),_0xccd2('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xccd2('0xb')]},'resetPasswordExpires':{'type':Sequelize[_0xccd2('0x18')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x1a7140){this['setDataValue'](_0xccd2('0x45'),_0x1a7140);var _0x5a0350=this[_0xccd2('0x46')]({'plain':!![]});switch(_0x1a7140){case 0x0:case 0x1:var _0x525187=_0x5a0350[_0xccd2('0x27')]?_[_0xccd2('0x47')](_0x5a0350[_0xccd2('0x27')])?_0x5a0350[_0xccd2('0x27')]['join']():_0x5a0350[_0xccd2('0x27')]:_0xccd2('0x26');if(_0x525187===_0xccd2('0x48')){_0x525187=_0xccd2('0x26');}this[_0xccd2('0x6')]('transport',_0x525187);this['setDataValue'](_0xccd2('0x49'),'no');this[_0xccd2('0x6')](_0xccd2('0x4a'),null);this[_0xccd2('0x6')](_0xccd2('0x4b'),null);this[_0xccd2('0x6')](_0xccd2('0x4c'),null);this[_0xccd2('0x6')]('dtlsenable',null);this[_0xccd2('0x6')](_0xccd2('0x4d'),null);this[_0xccd2('0x6')]('dtlssetup',null);this[_0xccd2('0x6')](_0xccd2('0x4e'),null);this[_0xccd2('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0xccd2('0x4f'),'no');break;case 0x2:this[_0xccd2('0x6')](_0xccd2('0x27'),_0xccd2('0x48'));this[_0xccd2('0x6')](_0xccd2('0x49'),_0xccd2('0x2e'));this[_0xccd2('0x6')](_0xccd2('0x4a'),'yes');this['setDataValue'](_0xccd2('0x4b'),_0xccd2('0x2e'));this['setDataValue']('icesupport',_0xccd2('0x2e'));this[_0xccd2('0x6')](_0xccd2('0x50'),'yes');this[_0xccd2('0x6')](_0xccd2('0x4d'),'no');this[_0xccd2('0x6')](_0xccd2('0x51'),_0xccd2('0x43'));this['setDataValue'](_0xccd2('0x4e'),_0x5a0350[_0xccd2('0x4e')]||_0xccd2('0x52'));this[_0xccd2('0x6')](_0xccd2('0x53'),_0x5a0350[_0xccd2('0x53')]||_0xccd2('0x54'));this[_0xccd2('0x6')](_0xccd2('0x4f'),_0xccd2('0x2e'));break;default:}}},'permissions':{'type':Sequelize[_0xccd2('0x55')],'set':function(_0x2bba85){this[_0xccd2('0x6')]('permissions',_0x2bba85?_0x2bba85[_0xccd2('0x28')](','):[]);},'get':function(){return this[_0xccd2('0x9')](_0xccd2('0x56'))?_[_0xccd2('0x57')](this[_0xccd2('0x9')]('permissions')[_0xccd2('0x34')](','),function(_0x55da27){return parseInt(_0x55da27,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xccd2('0xb')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xccd2('0xb')]},'phoneBarBusyNumber':{'type':Sequelize[_0xccd2('0xb')]},'phoneBarUnconditional':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xccd2('0x1a')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xccd2('0xb')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xccd2('0x1c')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xccd2('0xb')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xccd2('0x17')],'defaultValue':![]}};
\ No newline at end of file
index 4fb8e9e..e8495d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['getSmsAccounts','SmsAccount','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','register','jayson/promise','client','http','request','then','info','request\x20sent','User,\x20%s,\x20%s,\x20%s','error','code','User,\x20%s,\x20%s','message','result','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','stack','name','send','index','User','rawAttributes','differenceBy','keys','password','salt','dateStart','dateEnd','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','add','day','merge','filter','map','sequelize','lower','options','includeAll','include','findAll','rows','catch','show','params','body','find','describe','addContacts','omit','ids','agent','agent\x20role','role','telephone','user','getLicense','telephones','users','isNil','License\x20limit\x20reached','format','count\x20%s:\x20%s','create','Setting','findById','min_internal','max','internal','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','email','permissions','103','110','105','107','108','100','111','changePassword','newPassword','Sequelize','ValidationError','authenticate','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','admin','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','addQueues','loginInPause','voicePause','isValidChannel','channel','Unknown\x20channel','capitalize','toLowerCase','Queues','voice','VoiceQueue','push','%s/%s','SIP','each','UserVoiceQueueRt','upsert','removeQueues','remove','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getContacts','CmContact','getQueues','findOne','Queue','get','Unknown\x20role','nolimit','getVoiceQueuesRt','ChatGroup','getGroups','getRecordings','VoiceRecording','UserId','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','login','mobile','intrf','interface','LOCAL/%s@from-sip/n','SIP/%s','user:%s','emit','user:forcelogout','connection','remoteAddress','socket','UserVoiceQueue.penalty','MemberReport','forEach','all','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','bulkCreate','concat','logout','pause','QueuePause','updateAttributes','type','DEFAULT\x20PAUSE','mailPause','chatPause','openchannelPause','smsPause','pauseType','lastPauseAt','unpause','manual','mail','chat','fax','sms','openchannel','%s%s','Pause','Team','getTeams','addTeams','removeTeams','getLists','getVoiceQueues','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','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','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','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts'];(function(_0x51ec61,_0xf9d1e3){var _0x223200=function(_0x3bd510){while(--_0x3bd510){_0x51ec61['push'](_0x51ec61['shift']());}};_0x223200(++_0xf9d1e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var qs=require(_0x0a9e('0xe'));var logger=require(_0x0a9e('0xf'))(_0x0a9e('0x10'));var utils=require(_0x0a9e('0x11'));var config=require(_0x0a9e('0x12'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')({'host':'localhost','port':0x18eb});require('./user.socket')[_0x0a9e('0x13')](socket);var jayson=require(_0x0a9e('0x14'));var client=jayson[_0x0a9e('0x15')][_0x0a9e('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x32d742,_0x69aeb7,_0x5db4b0,_0x4283ce){return new BPromise(function(_0x239b12,_0x2b4227){var _0x281129=_0x4283ce||client;return _0x281129[_0x0a9e('0x17')](_0x32d742,_0x5db4b0)[_0x0a9e('0x18')](function(_0x52a03d){logger[_0x0a9e('0x19')]('User,\x20%s,\x20%s',_0x69aeb7,_0x0a9e('0x1a'));logger['debug'](_0x0a9e('0x1b'),_0x69aeb7,_0x0a9e('0x1a'),JSON['stringify'](_0x52a03d));if(_0x52a03d[_0x0a9e('0x1c')]){if(_0x52a03d['error'][_0x0a9e('0x1d')]===0x1f4){logger[_0x0a9e('0x1c')](_0x0a9e('0x1e'),_0x69aeb7,_0x52a03d[_0x0a9e('0x1c')][_0x0a9e('0x1f')]);return _0x2b4227(_0x52a03d[_0x0a9e('0x1c')][_0x0a9e('0x1f')]);}logger[_0x0a9e('0x1c')](_0x0a9e('0x1e'),_0x69aeb7,_0x52a03d[_0x0a9e('0x1c')][_0x0a9e('0x1f')]);return _0x239b12(_0x52a03d[_0x0a9e('0x1c')]['message']);}else{logger[_0x0a9e('0x19')](_0x0a9e('0x1e'),_0x69aeb7,'request\x20sent');_0x239b12(_0x52a03d[_0x0a9e('0x20')]['message']);}})['catch'](function(_0x3a02e1){logger[_0x0a9e('0x1c')](_0x0a9e('0x1e'),_0x69aeb7,_0x3a02e1);_0x2b4227(_0x3a02e1);});});}function respondWithStatusCode(_0x30bae6,_0x4abc77){_0x4abc77=_0x4abc77||0xcc;return function(_0xfb6e48){if(_0xfb6e48){return _0x30bae6[_0x0a9e('0x21')](_0x4abc77);}return _0x30bae6[_0x0a9e('0x22')](_0x4abc77)[_0x0a9e('0x23')]();};}function respondWithResult(_0x370d86,_0x42ac8f){_0x42ac8f=_0x42ac8f||0xc8;return function(_0x16b1ca){if(_0x16b1ca){return _0x370d86['status'](_0x42ac8f)['json'](_0x16b1ca);}};}function respondWithFilteredResult(_0x197ec0,_0x3a8e58){return function(_0x40c424){if(_0x40c424){var _0x33161b=_0x40c424[_0x0a9e('0x24')],_0x526cf3=_0x3a8e58['offset'],_0x384319=_0x3a8e58[_0x0a9e('0x25')]+_0x3a8e58[_0x0a9e('0x26')],_0x479bc4;if(_0x384319>=_0x33161b){_0x384319=_0x33161b;_0x479bc4=0xc8;}else{_0x479bc4=0xce;}_0x197ec0[_0x0a9e('0x22')](_0x479bc4);return _0x197ec0[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x526cf3+'-'+_0x384319+'/'+_0x33161b)[_0x0a9e('0x29')](_0x40c424);}return null;};}function patchUpdates(_0x11c3b6){return function(_0x14de77){try{jsonpatch['apply'](_0x14de77,_0x11c3b6,!![]);}catch(_0x3652a7){return BPromise[_0x0a9e('0x2a')](_0x3652a7);}return _0x14de77[_0x0a9e('0x2b')]();};}function saveUpdates(_0x2ec755,_0x5c877d){return function(_0x15b200){if(_0x15b200){return _0x15b200[_0x0a9e('0x2c')](_0x2ec755)[_0x0a9e('0x18')](function(_0x824a4f){return _0x824a4f;});}return null;};}function removeEntity(_0x58b06f,_0x563b45){return function(_0x296f41){if(_0x296f41){return _0x296f41[_0x0a9e('0x2d')]()[_0x0a9e('0x18')](function(){_0x58b06f['status'](0xcc)[_0x0a9e('0x23')]();});}};}function handleEntityNotFound(_0x5d1e0e,_0x2407f9){return function(_0x3ae878){if(!_0x3ae878){_0x5d1e0e[_0x0a9e('0x21')](0x194);}return _0x3ae878;};}function handleError(_0x33bdb7,_0x25ce3a){_0x25ce3a=_0x25ce3a||0x1f4;return function(_0x5180f1){logger[_0x0a9e('0x1c')](_0x5180f1[_0x0a9e('0x2e')]);if(_0x5180f1[_0x0a9e('0x2f')]){delete _0x5180f1[_0x0a9e('0x2f')];}_0x33bdb7[_0x0a9e('0x22')](_0x25ce3a)[_0x0a9e('0x30')](_0x5180f1);};}exports[_0x0a9e('0x31')]=function(_0x39e565,_0x5583a4){var _0x44295a={},_0x5e7238={},_0x2cc7a0={'count':0x0,'rows':[]};var _0x14b13f=db[_0x0a9e('0x32')][_0x0a9e('0x33')];_0x5e7238['model']=_[_0x0a9e('0x34')](_[_0x0a9e('0x35')](_0x14b13f),[_0x0a9e('0x36'),_0x0a9e('0x37')]);var _0x4853b1={'dateStart':_0x39e565['query'][_0x0a9e('0x38')],'dateEnd':_0x39e565['query'][_0x0a9e('0x39')]};delete _0x39e565[_0x0a9e('0x3a')][_0x0a9e('0x38')];delete _0x39e565[_0x0a9e('0x3a')]['dateEnd'];_0x5e7238[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x39e565[_0x0a9e('0x3a')]);_0x5e7238['filters']=_[_0x0a9e('0x3b')](_0x5e7238[_0x0a9e('0x3c')],_0x5e7238[_0x0a9e('0x3a')]);_0x44295a['attributes']=_['intersection'](_0x5e7238[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x39e565['query'][_0x0a9e('0x3d')]));_0x44295a[_0x0a9e('0x3e')]=_0x44295a[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x44295a['attributes']:_0x5e7238['model'];if(!_0x39e565[_0x0a9e('0x3a')][_0x0a9e('0x40')]('nolimit')){_0x44295a[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x39e565[_0x0a9e('0x3a')]['limit']);_0x44295a[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x39e565[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}_0x44295a[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0x39e565[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x44295a[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x39e565[_0x0a9e('0x3a')],_0x5e7238[_0x0a9e('0x44')]));if(_0x4853b1[_0x0a9e('0x38')]){if(_0x4853b1[_0x0a9e('0x39')]){_0x4853b1['dateEnd']=moment(_0x4853b1['dateEnd'])[_0x0a9e('0x46')](0x1,_0x0a9e('0x47'));}else{_0x4853b1[_0x0a9e('0x39')]=moment(_0x4853b1[_0x0a9e('0x38')])[_0x0a9e('0x46')](0x1,_0x0a9e('0x47'));}_[_0x0a9e('0x48')](_0x44295a[_0x0a9e('0x43')],{'createdAt':{'$gte':_0x4853b1[_0x0a9e('0x38')],'$lte':_0x4853b1[_0x0a9e('0x39')]}});}if(_0x39e565[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x44295a['where']=_[_0x0a9e('0x48')](_0x44295a[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x44295a[_0x0a9e('0x3e')],function(_0x2e8caf){return db[_0x0a9e('0x4b')][_0x0a9e('0x43')](db[_0x0a9e('0x4b')]['fn']('lower',db[_0x0a9e('0x4b')]['col'](_0x2e8caf)),{'$like':db[_0x0a9e('0x4b')]['fn'](_0x0a9e('0x4c'),'%'+_0x39e565[_0x0a9e('0x3a')]['filter']+'%')});})});}_0x44295a=_[_0x0a9e('0x48')]({},_0x44295a,_0x39e565[_0x0a9e('0x4d')]);var _0x4774f4={'where':_0x44295a[_0x0a9e('0x43')]};return db[_0x0a9e('0x32')][_0x0a9e('0x24')](_0x4774f4)[_0x0a9e('0x18')](function(_0x5bbcde){_0x2cc7a0[_0x0a9e('0x24')]=_0x5bbcde;if(_0x39e565[_0x0a9e('0x3a')][_0x0a9e('0x4e')]){_0x44295a[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x32')][_0x0a9e('0x50')](_0x44295a);})[_0x0a9e('0x18')](function(_0x19383e){_0x2cc7a0[_0x0a9e('0x51')]=_0x19383e;return _0x2cc7a0;})['then'](respondWithFilteredResult(_0x5583a4,_0x44295a))[_0x0a9e('0x52')](handleError(_0x5583a4,null));};exports[_0x0a9e('0x53')]=function(_0x4f7240,_0x4ae14b){var _0x5ddf84={'raw':![],'where':{'id':_0x4f7240[_0x0a9e('0x54')]['id']}},_0x1adfee={};_0x1adfee[_0x0a9e('0x3c')]=_[_0x0a9e('0x34')](_[_0x0a9e('0x35')](db[_0x0a9e('0x32')][_0x0a9e('0x33')]),[_0x0a9e('0x36'),'salt']);_0x1adfee['query']=_['keys'](_0x4f7240[_0x0a9e('0x3a')]);_0x1adfee[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0x1adfee['model'],_0x1adfee[_0x0a9e('0x3a')]);_0x5ddf84[_0x0a9e('0x3e')]=_['intersection'](_0x1adfee['model'],qs[_0x0a9e('0x3d')](_0x4f7240['query'][_0x0a9e('0x3d')]));_0x5ddf84['attributes']=_0x5ddf84[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x5ddf84[_0x0a9e('0x3e')]:_0x1adfee['model'];if(_0x4f7240[_0x0a9e('0x3a')][_0x0a9e('0x4e')]){_0x5ddf84['include']=[{'all':!![]}];}_0x5ddf84=_['merge']({},_0x5ddf84,_0x4f7240[_0x0a9e('0x4d')]);return db[_0x0a9e('0x32')]['find'](_0x5ddf84)[_0x0a9e('0x18')](handleEntityNotFound(_0x4ae14b,null))['then'](respondWithResult(_0x4ae14b,null))[_0x0a9e('0x52')](handleError(_0x4ae14b,null));};exports['bulkCreate']=function(_0xe22ccc,_0x4a6deb){return db['User']['bulkCreate'](_0xe22ccc[_0x0a9e('0x55')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4a6deb,0xc9))[_0x0a9e('0x52')](handleError(_0x4a6deb,null));};exports[_0x0a9e('0x2c')]=function(_0x3cfd00,_0x19b4df){if(_0x3cfd00[_0x0a9e('0x55')]['id']){delete _0x3cfd00[_0x0a9e('0x55')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x3cfd00['params']['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x19b4df,null))[_0x0a9e('0x18')](saveUpdates(_0x3cfd00[_0x0a9e('0x55')],null))[_0x0a9e('0x18')](respondWithResult(_0x19b4df,null))[_0x0a9e('0x52')](handleError(_0x19b4df,null));};exports[_0x0a9e('0x57')]=function(_0x5d86e9,_0x956fbe){return db[_0x0a9e('0x32')]['describe']()[_0x0a9e('0x18')](respondWithResult(_0x956fbe,null))['catch'](handleError(_0x956fbe,null));};exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x4b3c1a,null))[_0x0a9e('0x18')](function(_0x7be420){if(_0x7be420){return _0x7be420[_0x0a9e('0x58')](_0x5ba1f9[_0x0a9e('0x55')]['ids'],_[_0x0a9e('0x59')](_0x5ba1f9['body'],[_0x0a9e('0x5a'),'id'])||{});}})[_0x0a9e('0x18')](respondWithResult(_0x4b3c1a,null))[_0x0a9e('0x52')](handleError(_0x4b3c1a,null));};var getLicense=function(_0x5adf8f){return new BPromise(function(_0x453360,_0x156f1c){var _0x119677=0x0;_0x5adf8f[_0x0a9e('0x55')]['role']===_0x0a9e('0x5b')&&_0x453360(_0x0a9e('0x5c'));return db['User'][_0x0a9e('0x24')]({'where':{'$or':[{'role':_0x5adf8f[_0x0a9e('0x55')][_0x0a9e('0x5d')]===_0x0a9e('0x5e')?_0x0a9e('0x5e'):['admin',_0x0a9e('0x5f')]}]}})[_0x0a9e('0x18')](function(_0x281c7d){_0x119677=_0x281c7d;return require('../../config/license/util')[_0x0a9e('0x60')]();})['then'](function(_0x5211e3){var _0x242745=_0x5adf8f[_0x0a9e('0x55')][_0x0a9e('0x5d')]===_0x0a9e('0x5e')?_0x0a9e('0x61'):_0x0a9e('0x62');if(!_[_0x0a9e('0x63')](_0x5211e3[_0x242745])&&_0x119677>=_0x5211e3[_0x242745]){return _0x156f1c({'message':_0x0a9e('0x64')});}return _0x453360(util[_0x0a9e('0x65')](_0x0a9e('0x66'),_0x242745,_0x119677));})[_0x0a9e('0x52')](function(_0x19012b){return _0x156f1c(_0x19012b);});});};exports[_0x0a9e('0x67')]=function(_0x2b8192,_0x320898){return getLicense(_0x2b8192)[_0x0a9e('0x18')](function(_0x2a28c0){if(!_0x2b8192[_0x0a9e('0x55')]['internal']){var _0x1b0b98;return db[_0x0a9e('0x68')][_0x0a9e('0x69')](0x1)['then'](function(_0x1148a1){_0x1b0b98=_0x1148a1[_0x0a9e('0x6a')];return db['User'][_0x0a9e('0x6b')](_0x0a9e('0x6c'));})[_0x0a9e('0x18')](function(_0x427946){if(_[_0x0a9e('0x63')](_0x427946)){if(_0x1b0b98){_0x2b8192['body']['internal']=_0x1b0b98;}else{_0x2b8192['body'][_0x0a9e('0x6c')]=0x1;}}else{if(_[_0x0a9e('0x63')](_0x1b0b98)||_0x1b0b98==_0x427946){_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x6c')]=_0x427946+0x1;}else if(_0x1b0b98>_0x427946){_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x6c')]=_0x1b0b98;}else{return db[_0x0a9e('0x4b')][_0x0a9e('0x3a')]('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[_0x0a9e('0x4b')][_0x0a9e('0x6d')][_0x0a9e('0x6e')]})['then'](function(_0x2bdc44){if(_0x2bdc44&&_0x2bdc44['length']){for(var _0x4437ff=0x0,_0x44351d=_0x2bdc44['length'];_0x4437ff<_0x44351d&&_[_0x0a9e('0x63')](_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x6c')]);_0x4437ff++){if(_0x1b0b98<=_0x2bdc44[_0x4437ff][_0x0a9e('0x6f')]){_0x2b8192['body'][_0x0a9e('0x6c')]=_0x2bdc44[_0x4437ff][_0x0a9e('0x6f')];}else if(_0x1b0b98>_0x2bdc44[_0x4437ff][_0x0a9e('0x6f')]&&_0x1b0b98<=_0x2bdc44[_0x4437ff]['to']){_0x2b8192[_0x0a9e('0x55')]['internal']=_0x1b0b98;}}}if(_[_0x0a9e('0x63')](_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x6c')])){_0x2b8192[_0x0a9e('0x55')]['internal']=_0x427946+0x1;}});}}});}})[_0x0a9e('0x18')](function(){if(_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x70')]){_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x71')]=_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x6c')];_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x72')]={'mailbox':_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x6c')],'password':_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x36')],'fullname':_0x2b8192[_0x0a9e('0x55')]['fullname'],'email':_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x73')]};}if(_0x2b8192[_0x0a9e('0x55')]&&_0x2b8192['body'][_0x0a9e('0x5d')]===_0x0a9e('0x5b')){_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x74')]=['101','102',_0x0a9e('0x75'),_0x0a9e('0x76'),'104',_0x0a9e('0x77'),'106',_0x0a9e('0x78'),_0x0a9e('0x79'),'109',_0x0a9e('0x7a'),_0x0a9e('0x7b')];}return db[_0x0a9e('0x32')][_0x0a9e('0x67')](_0x2b8192[_0x0a9e('0x55')],{'include':[{'model':db[_0x0a9e('0x72')],'as':_0x0a9e('0x72')}]});})['then'](respondWithResult(_0x320898,0xc9))[_0x0a9e('0x52')](handleError(_0x320898,null));};exports[_0x0a9e('0x7c')]=function(_0x45c109,_0x16e5b9,_0x492543){if(_0x45c109[_0x0a9e('0x55')]['id']){delete _0x45c109[_0x0a9e('0x55')]['id'];}return db['User'][_0x0a9e('0x56')]({'where':{'id':_0x45c109['params']['id']}})[_0x0a9e('0x18')](function(_0x2bb25a){if(_0x2bb25a){if(_0x2bb25a['id']==_0x45c109[_0x0a9e('0x5f')]['id']){if(!_0x45c109[_0x0a9e('0x55')]['oldPassword']||!_0x45c109['body'][_0x0a9e('0x7d')]){throw new db[(_0x0a9e('0x7e'))][(_0x0a9e('0x7f'))]('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x2bb25a[_0x0a9e('0x80')](_0x45c109[_0x0a9e('0x55')]['oldPassword'])){throw new db['Sequelize'][(_0x0a9e('0x7f'))]('Wrong\x20credentials');}if(_0x45c109['body']['oldPassword']==_0x45c109[_0x0a9e('0x55')][_0x0a9e('0x7d')]){throw new db[(_0x0a9e('0x7e'))][(_0x0a9e('0x7f'))](_0x0a9e('0x81'));}return _0x2bb25a;}else if(_0x45c109[_0x0a9e('0x5f')]['role']==_0x0a9e('0x82')){if(!_0x45c109['body'][_0x0a9e('0x7d')]){throw new db[(_0x0a9e('0x7e'))][(_0x0a9e('0x7f'))](_0x0a9e('0x83'));}return _0x2bb25a;}else if(_0x45c109['user'][_0x0a9e('0x5d')]==_0x0a9e('0x5f')){if(!_0x45c109[_0x0a9e('0x55')]['newPassword']){throw new db[(_0x0a9e('0x7e'))][(_0x0a9e('0x7f'))](_0x0a9e('0x83'));}if(_0x2bb25a[_0x0a9e('0x5d')]!=_0x0a9e('0x5b')){throw new db[(_0x0a9e('0x7e'))][(_0x0a9e('0x7f'))](_0x0a9e('0x84'));}return _0x2bb25a;}else{throw new db['Sequelize'][(_0x0a9e('0x7f'))](_0x0a9e('0x84'));}}return null;})['then'](handleEntityNotFound(_0x16e5b9,null))[_0x0a9e('0x18')](saveUpdates({'password':_0x45c109[_0x0a9e('0x55')][_0x0a9e('0x7d')],'passwordResetAt':_0x45c109['user']['id']==_0x45c109[_0x0a9e('0x54')]['id']?moment():null},null))['then'](respondWithResult(_0x16e5b9,null))[_0x0a9e('0x52')](handleError(_0x16e5b9,null));};exports[_0x0a9e('0x85')]=function(_0x558a87,_0x1f29bd,_0x842d6f){var _0x16341a;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x558a87['params']['id']},'attributes':['id',_0x0a9e('0x2f'),_0x0a9e('0x5d'),_0x0a9e('0x86'),_0x0a9e('0x87')]})[_0x0a9e('0x18')](handleEntityNotFound(_0x1f29bd,null))[_0x0a9e('0x18')](function(_0x6803d6){if(_0x6803d6){_0x16341a=_0x6803d6;if(!utils[_0x0a9e('0x88')](_0x558a87[_0x0a9e('0x55')][_0x0a9e('0x89')])){throw new db[(_0x0a9e('0x7e'))][(_0x0a9e('0x7f'))](_0x0a9e('0x8a'));}return _0x6803d6['add'+_[_0x0a9e('0x8b')](_0x558a87[_0x0a9e('0x55')][_0x0a9e('0x89')][_0x0a9e('0x8c')]())+_0x0a9e('0x8d')](_0x558a87['body'][_0x0a9e('0x5a')],{'penalty':_0x558a87[_0x0a9e('0x55')]['penalty']||0x0});}})[_0x0a9e('0x18')](function(){if(_0x558a87['body'][_0x0a9e('0x89')]===_0x0a9e('0x8e')){return db[_0x0a9e('0x8f')][_0x0a9e('0x50')]({'where':{'id':_0x558a87['body'][_0x0a9e('0x5a')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x0a9e('0x18')](function(_0x3d0a77){var _0x5e5b89=[];if(_0x558a87[_0x0a9e('0x55')][_0x0a9e('0x89')]===_0x0a9e('0x8e')&&_0x16341a['role']==='agent'){for(var _0x1b82b7=0x0;_0x1b82b7<_0x3d0a77[_0x0a9e('0x3f')];_0x1b82b7+=0x1){_0x5e5b89[_0x0a9e('0x90')]({'membername':_0x16341a[_0x0a9e('0x2f')],'UserId':_0x16341a['id'],'queue_name':_0x3d0a77[_0x1b82b7][_0x0a9e('0x2f')],'VoiceQueueId':_0x3d0a77[_0x1b82b7]['id'],'interface':util[_0x0a9e('0x65')](_0x0a9e('0x91'),_0x0a9e('0x92'),_0x16341a[_0x0a9e('0x2f')]),'paused':_0x16341a['voicePause']||![],'penalty':_0x558a87[_0x0a9e('0x55')]['penalty']||0x0});}return BPromise[_0x0a9e('0x93')](_0x5e5b89,function(_0x2f7791){return db[_0x0a9e('0x94')][_0x0a9e('0x95')](_0x2f7791);});}return _0x16341a;})[_0x0a9e('0x18')](respondWithStatusCode(_0x1f29bd,null))['catch'](handleError(_0x1f29bd,null));};exports[_0x0a9e('0x96')]=function(_0x4667bf,_0x2791c5,_0x2aa5f2){var _0x2263f1;return db['User']['find']({'where':{'id':_0x4667bf[_0x0a9e('0x54')]['id']},'attributes':['id','name',_0x0a9e('0x5d')]})[_0x0a9e('0x18')](handleEntityNotFound(_0x2791c5,null))[_0x0a9e('0x18')](function(_0x16313e){if(_0x16313e){_0x2263f1=_0x16313e;if(!_0x4667bf[_0x0a9e('0x3a')][_0x0a9e('0x89')]||!utils['isValidChannel'](_0x4667bf['query'][_0x0a9e('0x89')])){throw new db['Sequelize'][(_0x0a9e('0x7f'))]('Unknown\x20channel');}return _0x16313e[_0x0a9e('0x97')+_['capitalize'](_0x4667bf['query'][_0x0a9e('0x89')][_0x0a9e('0x8c')]())+'Queues'](_0x4667bf[_0x0a9e('0x3a')][_0x0a9e('0x5a')]);}})[_0x0a9e('0x18')](function(_0xa1bc84){if(_0x4667bf[_0x0a9e('0x3a')]['channel']==='voice'){return db[_0x0a9e('0x94')][_0x0a9e('0x2d')]({'where':{'UserId':_0x4667bf[_0x0a9e('0x54')]['id'],'VoiceQueueId':_0x4667bf[_0x0a9e('0x3a')][_0x0a9e('0x5a')]},'individualHooks':!![]})['then'](function(){return _0x2263f1;});}return _0x2263f1;})[_0x0a9e('0x18')](respondWithStatusCode(_0x2791c5,null))[_0x0a9e('0x52')](handleError(_0x2791c5,null));};exports['addAvatar']=function(_0x3c313d,_0x19fd11,_0xcacabb){_0x3c313d[_0x0a9e('0x55')][_0x0a9e('0x98')]=_0x3c313d[_0x0a9e('0x99')][_0x0a9e('0x9a')];return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x3c313d[_0x0a9e('0x54')]['id']}})['then'](handleEntityNotFound(_0x19fd11,null))[_0x0a9e('0x18')](saveUpdates(_0x3c313d[_0x0a9e('0x55')],null))[_0x0a9e('0x18')](respondWithResult(_0x19fd11,null))[_0x0a9e('0x52')](handleError(_0x19fd11,null));};exports[_0x0a9e('0x9b')]=function(_0x547e37,_0x500868,_0x21902c){var _0x16ae1a=path[_0x0a9e('0x9c')](config[_0x0a9e('0x9d')],_0x0a9e('0x9e'));return db['User'][_0x0a9e('0x56')]({'where':{'id':_0x547e37[_0x0a9e('0x54')]['id']},'attributes':['id',_0x0a9e('0x98')],'raw':!![]})['then'](handleEntityNotFound(_0x500868,null))[_0x0a9e('0x18')](function(_0x59aa7b){if(_0x59aa7b){if(_[_0x0a9e('0x63')](_0x59aa7b['userpic'])){return _0x500868[_0x0a9e('0x9f')](_0x16ae1a);}else{if(!fs[_0x0a9e('0xa0')](path[_0x0a9e('0x9c')](config['root'],_0x0a9e('0xa1'),_0x59aa7b['userpic']))){return _0x500868[_0x0a9e('0x9f')](_0x16ae1a);}return _0x500868[_0x0a9e('0x9f')](path[_0x0a9e('0x9c')](config[_0x0a9e('0x9d')],_0x0a9e('0xa1'),_0x59aa7b[_0x0a9e('0x98')]));}}})[_0x0a9e('0x52')](handleError(_0x500868,null));};exports[_0x0a9e('0xa2')]=function(_0x2aaf07,_0x27d1f5,_0x4262d0){var _0xc876d4;var _0x2415fe={'where':{}},_0x399def={},_0x98c62c={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x2aaf07['params']['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x27d1f5,null))['then'](function(_0x1d999b){if(_0x1d999b){_0xc876d4=_0x1d999b;_0x2415fe[_0x0a9e('0x43')]['UserId']=_0x1d999b['id'];return db[_0x0a9e('0xa3')][_0x0a9e('0x57')]();}})[_0x0a9e('0x18')](function(_0x18adc8){if(_0x18adc8){_0x399def['model']=_[_0x0a9e('0x35')](_0x18adc8);_0x399def[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x2aaf07[_0x0a9e('0x3a')]);_0x399def['filters']=_[_0x0a9e('0x3b')](_0x399def[_0x0a9e('0x3c')],_0x399def[_0x0a9e('0x3a')]);_0x2415fe['attributes']=_[_0x0a9e('0x3b')](_0x399def[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x2aaf07['query'][_0x0a9e('0x3d')]));_0x2415fe[_0x0a9e('0x3e')]=_0x2415fe[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x2415fe[_0x0a9e('0x3e')]:_0x399def['model'];if(!_0x2aaf07[_0x0a9e('0x3a')][_0x0a9e('0x40')]('nolimit')){_0x2415fe[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x2aaf07[_0x0a9e('0x3a')]['limit']);_0x2415fe['offset']=qs['offset'](_0x2aaf07[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}_0x2415fe['order']=qs[_0x0a9e('0x42')](_0x2aaf07[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x2415fe['where']=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x2aaf07[_0x0a9e('0x3a')],_0x399def[_0x0a9e('0x44')]));if(_0x2aaf07[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x2415fe[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x2415fe[_0x0a9e('0x43')],{'$or':_['map'](_0x2415fe[_0x0a9e('0x3e')],function(_0x5526a7){var _0x138cf5={};_0x138cf5[_0x5526a7]={'$like':'%'+_0x2aaf07[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x138cf5;})});}_0x2415fe=_[_0x0a9e('0x48')]({},_0x2415fe,_0x2aaf07[_0x0a9e('0x4d')]);return _0xc876d4[_0x0a9e('0xa2')](_['pick'](_0x2415fe,[_0x0a9e('0x43')]))[_0x0a9e('0x18')](function(_0xe25eb5){_0x98c62c[_0x0a9e('0x24')]=_0xe25eb5['length']||0x0;if(_0x2aaf07[_0x0a9e('0x3a')][_0x0a9e('0x4e')]){_0x2415fe[_0x0a9e('0x4f')]=[{'all':!![]}];}return _0xc876d4[_0x0a9e('0xa2')](_0x2415fe);})[_0x0a9e('0x18')](function(_0x2be526){_0x98c62c[_0x0a9e('0x51')]=_0x2be526;return _0x98c62c;});}})[_0x0a9e('0x18')](respondWithFilteredResult(_0x27d1f5,_0x2415fe))[_0x0a9e('0x52')](handleError(_0x27d1f5,null));};exports[_0x0a9e('0xa4')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){var _0x2ff265;var _0x26b826;var _0xea8bd1={};var _0x253f74;return db[_0x0a9e('0x32')][_0x0a9e('0xa5')]({'where':{'id':_0x57f0ad['params']['id']},'attributes':['id',_0x0a9e('0x2f'),_0x0a9e('0x5d')]})[_0x0a9e('0x18')](handleEntityNotFound(_0x2272bc,null))['then'](function(_0x1402c7){if(!utils[_0x0a9e('0x88')](_0x57f0ad[_0x0a9e('0x3a')][_0x0a9e('0x89')])){throw new db[(_0x0a9e('0x7e'))][(_0x0a9e('0x7f'))](_0x0a9e('0x8a'));}_0x2ff265=_0x1402c7;var _0x336a19={};_0x336a19[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db[_['capitalize'](_0x57f0ad[_0x0a9e('0x3a')][_0x0a9e('0x89')])+_0x0a9e('0xa6')][_0x0a9e('0x33')]);_0x336a19[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x57f0ad['query']);_0x336a19[_0x0a9e('0x44')]=_['intersection'](_0x336a19['model'],_0x336a19['query']);_0xea8bd1[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x336a19[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x57f0ad['query'][_0x0a9e('0x3d')]));_0xea8bd1[_0x0a9e('0x3e')]=_0xea8bd1[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0xea8bd1[_0x0a9e('0x3e')]:_0x336a19['model'];_0xea8bd1['order']=qs[_0x0a9e('0x42')](_0x57f0ad[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0xea8bd1['where']=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x57f0ad[_0x0a9e('0x3a')],_0x336a19['filters']));if(_0x57f0ad[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0xea8bd1[_0x0a9e('0x43')]=_['merge'](_0xea8bd1[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0xea8bd1[_0x0a9e('0x3e')],function(_0x549e03){var _0x549697={};_0x549697[_0x549e03]={'$like':'%'+_0x57f0ad['query'][_0x0a9e('0x49')]+'%'};return _0x549697;})});}_0xea8bd1=_[_0x0a9e('0x48')]({},_0xea8bd1,_0x57f0ad[_0x0a9e('0x4d')]);switch(_0x2ff265[_0x0a9e('0x5d')]){case'admin':return db[_[_0x0a9e('0x8b')](_0x57f0ad['query'][_0x0a9e('0x89')])+_0x0a9e('0xa6')][_0x0a9e('0x50')](_0xea8bd1);case'user':case _0x0a9e('0x5b'):return _0x2ff265[_0x0a9e('0xa7')+_[_0x0a9e('0x8b')](_0x57f0ad['query'][_0x0a9e('0x89')])+'Queues'](_0xea8bd1);default:throw new db[(_0x0a9e('0x7e'))]['ValidationError'](_0x0a9e('0xa8'));}})['then'](function(_0xb14971){_0x253f74=_0xb14971[_0x0a9e('0x3f')];if(!_0x57f0ad[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0xea8bd1[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x57f0ad['query'][_0x0a9e('0x26')]);_0xea8bd1[_0x0a9e('0x25')]=qs['offset'](_0x57f0ad[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}switch(_0x2ff265['role']){case _0x0a9e('0x82'):return db[_[_0x0a9e('0x8b')](_0x57f0ad[_0x0a9e('0x3a')]['channel'])+_0x0a9e('0xa6')][_0x0a9e('0x50')](_0xea8bd1);case _0x0a9e('0x5f'):case _0x0a9e('0x5b'):return _0x2ff265[_0x0a9e('0xa7')+_[_0x0a9e('0x8b')](_0x57f0ad[_0x0a9e('0x3a')][_0x0a9e('0x89')])+_0x0a9e('0x8d')](_0xea8bd1);}})[_0x0a9e('0x18')](function(_0x56e148){return{'count':_0x253f74,'rows':_0x56e148};})[_0x0a9e('0x18')](respondWithResult(_0x2272bc,null))['catch'](handleError(_0x2272bc,null));};exports[_0x0a9e('0xaa')]=function(_0x2968e2,_0x5b9c76,_0x315e31){var _0x5d577b={};var _0x2d45db={};var _0x5691ac;var _0x119708;return db[_0x0a9e('0x32')][_0x0a9e('0xa5')]({'where':{'id':_0x2968e2['params']['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x5b9c76,null))[_0x0a9e('0x18')](function(_0x4435d2){if(_0x4435d2){_0x5691ac=_0x4435d2;_0x2d45db[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db[_0x0a9e('0x94')][_0x0a9e('0x33')]);_0x2d45db['query']=_[_0x0a9e('0x35')](_0x2968e2[_0x0a9e('0x3a')]);_0x2d45db[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0x2d45db[_0x0a9e('0x3c')],_0x2d45db[_0x0a9e('0x3a')]);_0x5d577b[_0x0a9e('0x3e')]=_['intersection'](_0x2d45db['model'],qs[_0x0a9e('0x3d')](_0x2968e2[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x5d577b[_0x0a9e('0x3e')]=_0x5d577b[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x5d577b[_0x0a9e('0x3e')]:_0x2d45db['model'];_0x5d577b[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0x2968e2[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x5d577b[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x2968e2['query'],_0x2d45db[_0x0a9e('0x44')]));if(_0x2968e2[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x5d577b['where']=_[_0x0a9e('0x48')](_0x5d577b[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x5d577b[_0x0a9e('0x3e')],function(_0x5c8dc4){var _0x38892b={};_0x38892b[_0x5c8dc4]={'$like':'%'+_0x2968e2[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x38892b;})});}_0x5d577b=_[_0x0a9e('0x48')]({},_0x5d577b,_0x2968e2[_0x0a9e('0x4d')]);return _0x5691ac[_0x0a9e('0xaa')](_0x5d577b);}})[_0x0a9e('0x18')](function(_0x385e5d){if(_0x385e5d){_0x119708=_0x385e5d['length'];if(!_0x2968e2[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x5d577b[_0x0a9e('0x26')]=qs['limit'](_0x2968e2['query'][_0x0a9e('0x26')]);_0x5d577b[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x2968e2['query'][_0x0a9e('0x25')]);}return _0x5691ac[_0x0a9e('0xaa')](_0x5d577b);}})['then'](function(_0x1970f1){if(_0x1970f1){return _0x1970f1?{'count':_0x119708,'rows':_0x1970f1}:null;}})['then'](respondWithResult(_0x5b9c76,null))[_0x0a9e('0x52')](handleError(_0x5b9c76,null));};exports['getGroups']=function(_0x5b42b9,_0x48eaa3,_0xad4d10){var _0x4297d1={};var _0x19f800={};var _0x20007e;var _0x7d59a9;return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x5b42b9[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x48eaa3,null))[_0x0a9e('0x18')](function(_0xd18f82){if(_0xd18f82){_0x20007e=_0xd18f82;_0x19f800[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db[_0x0a9e('0xab')]['rawAttributes']);_0x19f800['query']=_[_0x0a9e('0x35')](_0x5b42b9['query']);_0x19f800[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0x19f800[_0x0a9e('0x3c')],_0x19f800[_0x0a9e('0x3a')]);_0x4297d1[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x19f800['model'],qs[_0x0a9e('0x3d')](_0x5b42b9['query']['fields']));_0x4297d1[_0x0a9e('0x3e')]=_0x4297d1['attributes'][_0x0a9e('0x3f')]?_0x4297d1['attributes']:_0x19f800['model'];_0x4297d1[_0x0a9e('0x41')]=qs['sort'](_0x5b42b9[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x4297d1[_0x0a9e('0x43')]=qs['filters'](_[_0x0a9e('0x45')](_0x5b42b9[_0x0a9e('0x3a')],_0x19f800[_0x0a9e('0x44')]));if(_0x5b42b9['query']['filter']){_0x4297d1[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x4297d1[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x4297d1[_0x0a9e('0x3e')],function(_0x376b97){var _0x247a6c={};_0x247a6c[_0x376b97]={'$like':'%'+_0x5b42b9[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x247a6c;})});}_0x4297d1=_[_0x0a9e('0x48')]({},_0x4297d1,_0x5b42b9['options']);return _0x20007e['getGroups'](_0x4297d1);}})['then'](function(_0x5975fa){if(_0x5975fa){_0x7d59a9=_0x5975fa[_0x0a9e('0x3f')];if(!_0x5b42b9[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x4297d1[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x5b42b9[_0x0a9e('0x3a')]['limit']);_0x4297d1['offset']=qs[_0x0a9e('0x25')](_0x5b42b9[_0x0a9e('0x3a')]['offset']);}return _0x20007e[_0x0a9e('0xac')](_0x4297d1);}})[_0x0a9e('0x18')](function(_0x2e2280){if(_0x2e2280){return _0x2e2280?{'count':_0x7d59a9,'rows':_0x2e2280}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x48eaa3,null))[_0x0a9e('0x52')](handleError(_0x48eaa3,null));};exports[_0x0a9e('0xad')]=function(_0x167196,_0x262281,_0x59f8f7){var _0x400800={'raw':!![],'where':{}};var _0xbd1af3={};var _0x20e191={'count':0x0,'rows':[]};return db['User'][_0x0a9e('0xa5')]({'where':{'id':_0x167196[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x262281,null))[_0x0a9e('0x18')](function(_0x26129c){if(_0x26129c){_0xbd1af3[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db[_0x0a9e('0xae')][_0x0a9e('0x33')]);_0xbd1af3[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x167196[_0x0a9e('0x3a')]);_0xbd1af3['filters']=_['intersection'](_0xbd1af3[_0x0a9e('0x3c')],_0xbd1af3[_0x0a9e('0x3a')]);_0x400800[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0xbd1af3[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x167196[_0x0a9e('0x3a')]['fields']));_0x400800[_0x0a9e('0x3e')]=_0x400800['attributes'][_0x0a9e('0x3f')]?_0x400800[_0x0a9e('0x3e')]:_0xbd1af3[_0x0a9e('0x3c')];if(!_0x167196[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x400800[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x167196[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x400800[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x167196[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}_0x400800[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0x167196['query']['sort']);_0x400800[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_['pick'](_0x167196['query'],_0xbd1af3[_0x0a9e('0x44')]));_0x400800[_0x0a9e('0x43')][_0x0a9e('0xaf')]=_0x26129c['id'];if(_0x167196['query'][_0x0a9e('0x49')]){_0x400800['where']=_[_0x0a9e('0x48')](_0x400800['where'],{'$or':_[_0x0a9e('0x4a')](_0x400800['attributes'],function(_0x122e7d){var _0x21e210={};_0x21e210[_0x122e7d]={'$like':'%'+_0x167196[_0x0a9e('0x3a')]['filter']+'%'};return _0x21e210;})});}_0x400800=_[_0x0a9e('0x48')]({},_0x400800,_0x167196['options']);return db['VoiceRecording'][_0x0a9e('0x24')]({'where':_0x400800[_0x0a9e('0x43')]})[_0x0a9e('0x18')](function(_0x1542e8){_0x20e191[_0x0a9e('0x24')]=_0x1542e8;if(_0x167196[_0x0a9e('0x3a')][_0x0a9e('0x4e')]){_0x400800[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0xae')][_0x0a9e('0x50')](_0x400800);})[_0x0a9e('0x18')](function(_0x98bf26){_0x20e191[_0x0a9e('0x51')]=_0x98bf26;return _0x20e191;});}})[_0x0a9e('0x18')](respondWithFilteredResult(_0x262281,_0x400800))[_0x0a9e('0x52')](handleError(_0x262281,null));};exports[_0x0a9e('0xb0')]=function(_0x310026,_0x643f66,_0x153de1){var _0x51a987={};var _0x233e48={};var _0xf780f5;var _0x543b30;return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x310026['params']['id']}})['then'](handleEntityNotFound(_0x643f66,null))[_0x0a9e('0x18')](function(_0x55926d){if(_0x55926d){_0xf780f5=_0x55926d;_0x233e48[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db[_0x0a9e('0xb1')][_0x0a9e('0x33')]);_0x233e48[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x310026[_0x0a9e('0x3a')]);_0x233e48[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0x233e48[_0x0a9e('0x3c')],_0x233e48['query']);_0x51a987[_0x0a9e('0x3e')]=_['intersection'](_0x233e48[_0x0a9e('0x3c')],qs['fields'](_0x310026[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x51a987[_0x0a9e('0x3e')]=_0x51a987['attributes'][_0x0a9e('0x3f')]?_0x51a987[_0x0a9e('0x3e')]:_0x233e48['model'];_0x51a987['order']=qs[_0x0a9e('0x42')](_0x310026[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x51a987['where']=qs['filters'](_['pick'](_0x310026[_0x0a9e('0x3a')],_0x233e48[_0x0a9e('0x44')]));if(_0x310026[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x51a987[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x51a987[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x51a987[_0x0a9e('0x3e')],function(_0x18e38b){var _0xc9669d={};_0xc9669d[_0x18e38b]={'$like':'%'+_0x310026[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0xc9669d;})});}_0x51a987=_[_0x0a9e('0x48')]({},_0x51a987,_0x310026[_0x0a9e('0x4d')]);return _0xf780f5[_0x0a9e('0xb0')](_0x51a987);}})[_0x0a9e('0x18')](function(_0x320367){if(_0x320367){_0x543b30=_0x320367['length'];if(!_0x310026[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x51a987[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x310026[_0x0a9e('0x3a')]['limit']);_0x51a987[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x310026[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}return _0xf780f5[_0x0a9e('0xb0')](_0x51a987);}})[_0x0a9e('0x18')](function(_0x103ad9){if(_0x103ad9){return _0x103ad9?{'count':_0x543b30,'rows':_0x103ad9}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x643f66,null))[_0x0a9e('0x52')](handleError(_0x643f66,null));};exports['getOpenchannelInteractions']=function(_0x5d27c1,_0x44a189,_0x3a0b30){var _0x5c2996={};var _0x1f52b4={};var _0x306aa5;var _0x4c8d75;return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x5d27c1[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x44a189,null))['then'](function(_0x27a41c){if(_0x27a41c){_0x306aa5=_0x27a41c;_0x1f52b4[_0x0a9e('0x3c')]=_['keys'](db[_0x0a9e('0xb2')][_0x0a9e('0x33')]);_0x1f52b4['query']=_[_0x0a9e('0x35')](_0x5d27c1[_0x0a9e('0x3a')]);_0x1f52b4[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0x1f52b4[_0x0a9e('0x3c')],_0x1f52b4[_0x0a9e('0x3a')]);_0x5c2996['attributes']=_[_0x0a9e('0x3b')](_0x1f52b4[_0x0a9e('0x3c')],qs['fields'](_0x5d27c1[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x5c2996[_0x0a9e('0x3e')]=_0x5c2996[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x5c2996[_0x0a9e('0x3e')]:_0x1f52b4[_0x0a9e('0x3c')];_0x5c2996['order']=qs['sort'](_0x5d27c1['query']['sort']);_0x5c2996['where']=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x5d27c1['query'],_0x1f52b4['filters']));if(_0x5d27c1[_0x0a9e('0x3a')]['filter']){_0x5c2996[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x5c2996[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x5c2996[_0x0a9e('0x3e')],function(_0x14a683){var _0x49b97a={};_0x49b97a[_0x14a683]={'$like':'%'+_0x5d27c1[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x49b97a;})});}_0x5c2996=_['merge']({},_0x5c2996,_0x5d27c1[_0x0a9e('0x4d')]);return _0x306aa5[_0x0a9e('0xb3')](_0x5c2996);}})[_0x0a9e('0x18')](function(_0x2b3734){if(_0x2b3734){_0x4c8d75=_0x2b3734[_0x0a9e('0x3f')];if(!_0x5d27c1[_0x0a9e('0x3a')][_0x0a9e('0x40')]('nolimit')){_0x5c2996[_0x0a9e('0x26')]=qs['limit'](_0x5d27c1[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x5c2996['offset']=qs[_0x0a9e('0x25')](_0x5d27c1[_0x0a9e('0x3a')]['offset']);}return _0x306aa5[_0x0a9e('0xb3')](_0x5c2996);}})['then'](function(_0x4552b5){if(_0x4552b5){return _0x4552b5?{'count':_0x4c8d75,'rows':_0x4552b5}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x44a189,null))['catch'](handleError(_0x44a189,null));};exports[_0x0a9e('0xb4')]=function(_0x4a9682,_0x1d046c,_0x179137){var _0x732141={'raw':!![],'where':{}};var _0x37ef45={};var _0x288127={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')][_0x0a9e('0xa5')]({'where':{'id':_0x4a9682['params']['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x1d046c,null))[_0x0a9e('0x18')](function(_0x17854b){if(_0x17854b){_0x37ef45[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db['MailInteraction'][_0x0a9e('0x33')]);_0x37ef45['query']=_['keys'](_0x4a9682[_0x0a9e('0x3a')]);_0x37ef45['filters']=_[_0x0a9e('0x3b')](_0x37ef45[_0x0a9e('0x3c')],_0x37ef45['query']);_0x732141[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x37ef45[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x4a9682[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x732141[_0x0a9e('0x3e')]=_0x732141[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x732141['attributes']:_0x37ef45[_0x0a9e('0x3c')];if(!_0x4a9682[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x732141['limit']=qs[_0x0a9e('0x26')](_0x4a9682[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x732141['offset']=qs[_0x0a9e('0x25')](_0x4a9682[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}_0x732141['order']=qs[_0x0a9e('0x42')](_0x4a9682['query'][_0x0a9e('0x42')]);_0x732141[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x4a9682[_0x0a9e('0x3a')],_0x37ef45[_0x0a9e('0x44')]));_0x732141[_0x0a9e('0x43')]['UserId']=_0x17854b['id'];if(_0x4a9682[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x732141[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x732141[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x732141[_0x0a9e('0x3e')],function(_0x2670f5){var _0x2310ca={};_0x2310ca[_0x2670f5]={'$like':'%'+_0x4a9682[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x2310ca;})});}_0x732141=_[_0x0a9e('0x48')]({},_0x732141,_0x4a9682[_0x0a9e('0x4d')]);return db[_0x0a9e('0xb5')][_0x0a9e('0x24')]({'where':_0x732141[_0x0a9e('0x43')]})[_0x0a9e('0x18')](function(_0x28932f){_0x288127[_0x0a9e('0x24')]=_0x28932f;if(_0x4a9682[_0x0a9e('0x3a')][_0x0a9e('0x4e')]){_0x732141[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0xb5')]['findAll'](_0x732141);})[_0x0a9e('0x18')](function(_0x148ca9){_0x288127[_0x0a9e('0x51')]=_0x148ca9;return _0x288127;});}})['then'](respondWithFilteredResult(_0x1d046c,_0x732141))[_0x0a9e('0x52')](handleError(_0x1d046c,null));};exports['getSmsInteractions']=function(_0xf007cd,_0xf2f758,_0x20a292){var _0x39c4da={};var _0x455bca={};var _0xb09ef6;var _0x3f431b;return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0xf007cd[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0xf2f758,null))['then'](function(_0x27732c){if(_0x27732c){_0xb09ef6=_0x27732c;_0x455bca[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db['SmsInteraction'][_0x0a9e('0x33')]);_0x455bca[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0xf007cd[_0x0a9e('0x3a')]);_0x455bca['filters']=_[_0x0a9e('0x3b')](_0x455bca[_0x0a9e('0x3c')],_0x455bca[_0x0a9e('0x3a')]);_0x39c4da[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x455bca['model'],qs[_0x0a9e('0x3d')](_0xf007cd[_0x0a9e('0x3a')]['fields']));_0x39c4da[_0x0a9e('0x3e')]=_0x39c4da[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x39c4da['attributes']:_0x455bca['model'];_0x39c4da[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0xf007cd[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x39c4da[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0xf007cd[_0x0a9e('0x3a')],_0x455bca['filters']));if(_0xf007cd['query'][_0x0a9e('0x49')]){_0x39c4da['where']=_[_0x0a9e('0x48')](_0x39c4da[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x39c4da[_0x0a9e('0x3e')],function(_0x57b11b){var _0x34229f={};_0x34229f[_0x57b11b]={'$like':'%'+_0xf007cd[_0x0a9e('0x3a')]['filter']+'%'};return _0x34229f;})});}_0x39c4da=_[_0x0a9e('0x48')]({},_0x39c4da,_0xf007cd['options']);return _0xb09ef6[_0x0a9e('0xb6')](_0x39c4da);}})[_0x0a9e('0x18')](function(_0xd63c87){if(_0xd63c87){_0x3f431b=_0xd63c87[_0x0a9e('0x3f')];if(!_0xf007cd[_0x0a9e('0x3a')][_0x0a9e('0x40')]('nolimit')){_0x39c4da[_0x0a9e('0x26')]=qs['limit'](_0xf007cd[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x39c4da[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0xf007cd[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}return _0xb09ef6[_0x0a9e('0xb6')](_0x39c4da);}})['then'](function(_0x37d9b9){if(_0x37d9b9){return _0x37d9b9?{'count':_0x3f431b,'rows':_0x37d9b9}:null;}})[_0x0a9e('0x18')](respondWithResult(_0xf2f758,null))[_0x0a9e('0x52')](handleError(_0xf2f758,null));};exports[_0x0a9e('0xb7')]=function(_0x132d6d,_0x534f61,_0x3cd588){var _0x2eea54={};var _0x488d6c={};var _0x55bb89;var _0x2240ea;return db[_0x0a9e('0x32')][_0x0a9e('0xa5')]({'where':{'id':_0x132d6d[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x534f61,null))[_0x0a9e('0x18')](function(_0x4d35ed){if(_0x4d35ed){_0x55bb89=_0x4d35ed;_0x488d6c[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db[_0x0a9e('0xb8')]['rawAttributes']);_0x488d6c[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x132d6d[_0x0a9e('0x3a')]);_0x488d6c[_0x0a9e('0x44')]=_['intersection'](_0x488d6c['model'],_0x488d6c[_0x0a9e('0x3a')]);_0x2eea54[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x488d6c[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x132d6d[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x2eea54[_0x0a9e('0x3e')]=_0x2eea54['attributes'][_0x0a9e('0x3f')]?_0x2eea54['attributes']:_0x488d6c[_0x0a9e('0x3c')];_0x2eea54[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0x132d6d['query']['sort']);_0x2eea54[_0x0a9e('0x43')]=qs['filters'](_[_0x0a9e('0x45')](_0x132d6d['query'],_0x488d6c['filters']));if(_0x132d6d[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x2eea54[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x2eea54[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x2eea54[_0x0a9e('0x3e')],function(_0x36287b){var _0x106e04={};_0x106e04[_0x36287b]={'$like':'%'+_0x132d6d[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x106e04;})});}_0x2eea54=_[_0x0a9e('0x48')]({},_0x2eea54,_0x132d6d[_0x0a9e('0x4d')]);return _0x55bb89['getFaxInteractions'](_0x2eea54);}})['then'](function(_0x3bde76){if(_0x3bde76){_0x2240ea=_0x3bde76['length'];if(!_0x132d6d[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x2eea54['limit']=qs['limit'](_0x132d6d[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x2eea54[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x132d6d[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}return _0x55bb89[_0x0a9e('0xb7')](_0x2eea54);}})['then'](function(_0x12984a){if(_0x12984a){return _0x12984a?{'count':_0x2240ea,'rows':_0x12984a}:null;}})['then'](respondWithResult(_0x534f61,null))[_0x0a9e('0x52')](handleError(_0x534f61,null));};exports[_0x0a9e('0xb9')]=function(_0x595a5e,_0x1fe77c,_0x3ee03d){var _0x10bb8e;var _0x4524b8;var _0xb0fb60;return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x595a5e[_0x0a9e('0x54')]['id'],'role':_0x0a9e('0x5b')},'attributes':['id',_0x0a9e('0x2f'),'phone',_0x0a9e('0xba'),_0x0a9e('0x5d'),_0x0a9e('0x6c'),'loginInPause']})[_0x0a9e('0x18')](handleEntityNotFound(_0x1fe77c,null))[_0x0a9e('0x18')](function(_0x37257e){if(_0x37257e){_0x10bb8e=_0x37257e;_0xb0fb60=(_0x595a5e[_0x0a9e('0x55')][_0x0a9e('0xbb')]?util[_0x0a9e('0x65')]('%s/%s','SIP',_0x595a5e[_0x0a9e('0x55')][_0x0a9e('0xbb')]):null)||(_0x595a5e['body'][_0x0a9e('0xbc')]&&_0x10bb8e[_0x595a5e[_0x0a9e('0x55')][_0x0a9e('0xbc')]]?util[_0x0a9e('0x65')](_0x0a9e('0xbd'),_0x10bb8e[_0x595a5e[_0x0a9e('0x55')]['interface']]):util[_0x0a9e('0x65')](_0x0a9e('0xbe'),_0x10bb8e[_0x0a9e('0x2f')]));socket['to'](util['format'](_0x0a9e('0xbf'),_0x10bb8e[_0x0a9e('0x2f')]))[_0x0a9e('0xc0')](_0x0a9e('0xc1'),{'ip':_0x595a5e['headers']['x-forwarded-for']||_0x595a5e[_0x0a9e('0xc2')][_0x0a9e('0xc3')]||_0x595a5e[_0x0a9e('0xc4')]['remoteAddress']||_0x595a5e[_0x0a9e('0xc2')][_0x0a9e('0xc4')][_0x0a9e('0xc3')]});return db[_0x0a9e('0x94')][_0x0a9e('0x2d')]({'where':{'membername':_0x10bb8e[_0x0a9e('0x2f')]},'individualHooks':!![]});}})[_0x0a9e('0x18')](function(_0x2d5c57){if(_0x10bb8e){return _0x10bb8e['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x17fd14){var _0x1c71ad=[];if(_0x17fd14){_0x4524b8=_0x17fd14;if(_0x4524b8['length']){for(var _0xe6701c=0x0;_0xe6701c<_0x4524b8['length'];_0xe6701c++){_0x1c71ad[_0x0a9e('0x90')]({'membername':_0x10bb8e[_0x0a9e('0x2f')],'UserId':_0x10bb8e['id'],'queue_name':_0x4524b8[_0xe6701c]['name'],'VoiceQueueId':_0x4524b8[_0xe6701c]['id'],'interface':_0xb0fb60||util[_0x0a9e('0x65')](_0x0a9e('0x91'),'SIP',_0x10bb8e[_0x0a9e('0x2f')]),'paused':_0x10bb8e[_0x0a9e('0x86')]||![],'penalty':_0x4524b8[_0xe6701c][_0x0a9e('0xc5')]||0x0});}return BPromise[_0x0a9e('0x93')](_0x1c71ad,function(_0x434df7){return db[_0x0a9e('0x94')][_0x0a9e('0x95')](_0x434df7);});}}})['then'](function(){return db[_0x0a9e('0xc6')][_0x0a9e('0x50')]({'where':{'membername':_0x10bb8e[_0x0a9e('0x2f')],'interface':util[_0x0a9e('0x65')](_0x0a9e('0x91'),_0x0a9e('0x92'),_0x10bb8e[_0x0a9e('0x2f')]),'exitAt':null}});})['then'](function(_0x4dbec7){var _0x435688=[];_0x4dbec7[_0x0a9e('0xc7')](function(_0x1e6bba){_0x435688['push'](_0x1e6bba['update']({'exitAt':moment()[_0x0a9e('0x65')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x0a9e('0xc8')](_0x435688);})[_0x0a9e('0x18')](function(){var _0x112789=[];var _0x2a0a86=[];var _0x20f4cb=utils[_0x0a9e('0xc9')]();var _0x2dc981={'membername':_0x10bb8e[_0x0a9e('0x2f')],'interface':util[_0x0a9e('0x65')]('%s/%s','SIP',_0x10bb8e[_0x0a9e('0x2f')]),'enterAt':moment()['format'](_0x0a9e('0xca')),'role':_0x10bb8e[_0x0a9e('0x5d')],'internal':_0x10bb8e[_0x0a9e('0x6c')]};_0x20f4cb[_0x0a9e('0xc7')](function(_0x4ad6fc){_0x112789[_0x0a9e('0x90')](_[_0x0a9e('0x48')]({'channel':_0x4ad6fc,'type':_0x0a9e('0xcb'),'data1':_0x595a5e['body'][_0x0a9e('0xcc')],'data2':_0xb0fb60},_0x2dc981));if(_0x10bb8e[_0x0a9e('0x86')]){_0x2a0a86[_0x0a9e('0x90')](_['merge']({'channel':_0x4ad6fc,'type':_0x0a9e('0xcd'),'data1':_0x0a9e('0xce')},_0x2dc981));}});return db[_0x0a9e('0xc6')][_0x0a9e('0xcf')](_0x112789[_0x0a9e('0xd0')](_0x2a0a86),{'individualHooks':!![]});})[_0x0a9e('0x18')](function(){return _0x10bb8e['update']({'online':!![],'lastLoginAt':moment()['format'](_0x0a9e('0xca')),'voicePause':_0x10bb8e[_0x0a9e('0x86')]||![],'mailPause':_0x10bb8e[_0x0a9e('0x86')]||![],'chatPause':_0x10bb8e['loginInPause']||![],'faxPause':_0x10bb8e['loginInPause']||![],'smsPause':_0x10bb8e[_0x0a9e('0x86')]||![],'openchannelPause':_0x10bb8e[_0x0a9e('0x86')]||![],'pauseType':_0x10bb8e[_0x0a9e('0x86')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0x0a9e('0xca'))});})[_0x0a9e('0x18')](respondWithResult(_0x1fe77c,null))[_0x0a9e('0x52')](handleError(_0x1fe77c,null));};exports[_0x0a9e('0xd1')]=function(_0x1bafdd,_0x4f0bca,_0x1d03cf){var _0x4b62e8;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x1bafdd['params']['id'],'role':_0x0a9e('0x5b')},'attributes':['id','name',_0x0a9e('0x5d')]})[_0x0a9e('0x18')](handleEntityNotFound(_0x4f0bca,null))[_0x0a9e('0x18')](function(_0x3554c7){if(_0x3554c7){_0x4b62e8=_0x3554c7;return db[_0x0a9e('0x94')]['destroy']({'where':{'membername':_0x4b62e8[_0x0a9e('0x2f')]},'individualHooks':!![]});}})[_0x0a9e('0x18')](function(){return db[_0x0a9e('0xc6')]['findAll']({'where':{'membername':_0x4b62e8[_0x0a9e('0x2f')],'interface':util['format'](_0x0a9e('0x91'),_0x0a9e('0x92'),_0x4b62e8[_0x0a9e('0x2f')]),'exitAt':null}});})['then'](function(_0x27960f){var _0x12b8f2=[];_0x27960f[_0x0a9e('0xc7')](function(_0x1ecb3b){_0x12b8f2[_0x0a9e('0x90')](_0x1ecb3b[_0x0a9e('0x2c')]({'exitAt':moment()['format'](_0x0a9e('0xca'))}));});return BPromise[_0x0a9e('0xc8')](_0x12b8f2);})[_0x0a9e('0x18')](function(){return _0x4b62e8[_0x0a9e('0x2c')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});})[_0x0a9e('0x18')](respondWithResult(_0x4f0bca,null))[_0x0a9e('0x52')](handleError(_0x4f0bca,null));};exports[_0x0a9e('0xd2')]=function(_0x3e43ea,_0x597e99,_0x2dc0de){var _0x15d013;return db[_0x0a9e('0x94')][_0x0a9e('0x2c')]({'paused':0x1},{'where':{'UserId':_0x3e43ea['params']['id']},'individualHooks':!![]})[_0x0a9e('0x18')](function(){return db['User'][_0x0a9e('0x56')]({'where':{'id':_0x3e43ea[_0x0a9e('0x54')]['id'],'role':_0x0a9e('0x5b')},'attributes':['id','name',_0x0a9e('0x5d'),_0x0a9e('0x6c')]});})[_0x0a9e('0x18')](handleEntityNotFound(_0x597e99,null))[_0x0a9e('0x18')](function(_0x53e0fc){if(_0x53e0fc){_0x15d013=_0x53e0fc;return respondWithRpcPromise(_0x0a9e('0xd3'),_0x0a9e('0xd2'),{'id':_0x15d013['id'],'name':_0x15d013[_0x0a9e('0x2f')],'pause':!![]});}})[_0x0a9e('0x18')](function(){if(_0x15d013){return db[_0x0a9e('0xc6')][_0x0a9e('0x50')]({'where':{'membername':_0x15d013[_0x0a9e('0x2f')],'interface':util['format'](_0x0a9e('0x91'),_0x0a9e('0x92'),_0x15d013[_0x0a9e('0x2f')]),'type':_0x0a9e('0xcd'),'exitAt':null}});}})['then'](function(_0x1b6dde){if(_0x1b6dde['length']){var _0x2b8f51=moment()[_0x0a9e('0x65')](_0x0a9e('0xca'));for(var _0x429f5c=0x0,_0x2742a4=_0x1b6dde[_0x0a9e('0x3f')];_0x429f5c<_0x2742a4;_0x429f5c++){_0x1b6dde[_0x429f5c][_0x0a9e('0xd4')]({'exitAt':_0x2b8f51});}}})['then'](function(){var _0x173f03=[];var _0x4ac7f1=utils[_0x0a9e('0xc9')]();_0x4ac7f1[_0x0a9e('0xc7')](function(_0x47d640){_0x173f03[_0x0a9e('0x90')]({'channel':_0x47d640,'membername':_0x15d013[_0x0a9e('0x2f')],'interface':util[_0x0a9e('0x65')](_0x0a9e('0x91'),'SIP',_0x15d013[_0x0a9e('0x2f')]),'type':_0x0a9e('0xcd'),'enterAt':moment()['format'](_0x0a9e('0xca')),'data1':_0x3e43ea['body']['type']||'DEFAULT\x20PAUSE','role':_0x15d013[_0x0a9e('0x5d')],'internal':_0x15d013[_0x0a9e('0x6c')]});});return db['MemberReport'][_0x0a9e('0xcf')](_0x173f03,{'individualHooks':!![]});})[_0x0a9e('0x18')](function(){return _0x15d013['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x3e43ea[_0x0a9e('0x55')][_0x0a9e('0xd5')]||_0x0a9e('0xd6'),'lastPauseAt':moment()[_0x0a9e('0x65')](_0x0a9e('0xca'))});})[_0x0a9e('0x18')](respondWithResult(_0x597e99,null))[_0x0a9e('0x52')](handleError(_0x597e99,null));};exports['unpause']=function(_0x3d7738,_0x5c05d2,_0x17f6ee){var _0x449be4;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x3d7738[_0x0a9e('0x54')]['id']},'attributes':['id',_0x0a9e('0x2f'),'role',_0x0a9e('0x87'),_0x0a9e('0xd7'),_0x0a9e('0xd8'),'faxPause',_0x0a9e('0xd9'),_0x0a9e('0xda'),_0x0a9e('0xdb'),_0x0a9e('0xdc')]})[_0x0a9e('0x18')](handleEntityNotFound(_0x5c05d2,null))[_0x0a9e('0x18')](function(_0x3bc55c){if(_0x3bc55c){_0x449be4=_0x3bc55c;if(_0x3d7738[_0x0a9e('0x55')][_0x0a9e('0x89')]&&!utils[_0x0a9e('0x88')](_0x3d7738[_0x0a9e('0x55')][_0x0a9e('0x89')])){throw new db[(_0x0a9e('0x7e'))][(_0x0a9e('0x7f'))](_0x0a9e('0x8a'));}switch(_0x3d7738[_0x0a9e('0x55')]['channel']){case _0x0a9e('0x8e'):return respondWithRpcPromise(_0x0a9e('0xd3'),_0x0a9e('0xdd'),{'id':_0x449be4['id'],'name':_0x449be4['name'],'pause':![]})[_0x0a9e('0x18')](function(){return db[_0x0a9e('0x94')][_0x0a9e('0x2c')]({'paused':0x0},{'where':{'UserId':_0x449be4['id']},'individualHooks':!![]});})[_0x0a9e('0x18')](function(){return db['MemberReport'][_0x0a9e('0x56')]({'where':{'channel':_0x3d7738[_0x0a9e('0x55')][_0x0a9e('0x89')],'membername':_0x449be4[_0x0a9e('0x2f')],'interface':util['format'](_0x0a9e('0x91'),_0x0a9e('0x92'),_0x449be4[_0x0a9e('0x2f')]),'type':_0x0a9e('0xcd'),'exitAt':null}});})['then'](function(_0x4b7595){if(_0x4b7595){return _0x4b7595[_0x0a9e('0x2c')]({'exitAt':moment()[_0x0a9e('0x65')](_0x0a9e('0xca')),'data2':_0x0a9e('0xde')},{'individualHooks':!![]});}return null;})[_0x0a9e('0x18')](function(){return _0x449be4[_0x0a9e('0x2c')]({'voicePause':![]});});case _0x0a9e('0xdf'):case _0x0a9e('0xe0'):case _0x0a9e('0xe1'):case _0x0a9e('0xe2'):case _0x0a9e('0xe3'):return db[_0x0a9e('0xc6')][_0x0a9e('0x56')]({'where':{'channel':_0x3d7738[_0x0a9e('0x55')]['channel'],'membername':_0x449be4[_0x0a9e('0x2f')],'interface':util[_0x0a9e('0x65')](_0x0a9e('0x91'),'SIP',_0x449be4['name']),'type':_0x0a9e('0xcd'),'exitAt':null}})['then'](function(_0x3d2007){if(_0x3d2007){return _0x3d2007[_0x0a9e('0x2c')]({'exitAt':moment()[_0x0a9e('0x65')](_0x0a9e('0xca')),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){var _0x2ad86f={};_[_0x0a9e('0x27')](_0x2ad86f,util[_0x0a9e('0x65')](_0x0a9e('0xe4'),_0x3d7738['body'][_0x0a9e('0x89')],_0x0a9e('0xe5')),![]);return _0x449be4[_0x0a9e('0x2c')](_0x2ad86f);});default:return respondWithRpcPromise(_0x0a9e('0xd3'),_0x0a9e('0xdd'),{'id':_0x449be4['id'],'name':_0x449be4['name'],'pause':![]})['then'](function(){return db[_0x0a9e('0x94')][_0x0a9e('0x2c')]({'paused':0x0},{'where':{'UserId':_0x449be4['id']}});})[_0x0a9e('0x18')](function(){return db[_0x0a9e('0xc6')][_0x0a9e('0x50')]({'where':{'membername':_0x449be4[_0x0a9e('0x2f')],'interface':util[_0x0a9e('0x65')]('%s/%s',_0x0a9e('0x92'),_0x449be4[_0x0a9e('0x2f')]),'type':_0x0a9e('0xcd'),'exitAt':null}});})['then'](function(_0x5f2b39){var _0x521fd9=[];_0x5f2b39[_0x0a9e('0xc7')](function(_0x3ae873){_0x521fd9['push'](_0x3ae873[_0x0a9e('0x2c')]({'exitAt':moment()[_0x0a9e('0x65')](_0x0a9e('0xca')),'data2':'manual'}));});return BPromise['all'](_0x521fd9);})[_0x0a9e('0x18')](function(){return _0x449be4[_0x0a9e('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x0a9e('0x18')](respondWithResult(_0x5c05d2,null))[_0x0a9e('0x52')](handleError(_0x5c05d2,null));};exports['getTeams']=function(_0xb7a9b3,_0x5ccb5a,_0x47fecd){var _0x5ecd61={};var _0x546742={};var _0x98bab3;var _0x991bfc;return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0xb7a9b3[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x5ccb5a,null))[_0x0a9e('0x18')](function(_0x5c39d1){if(_0x5c39d1){_0x98bab3=_0x5c39d1;_0x546742['model']=_[_0x0a9e('0x35')](db[_0x0a9e('0xe6')][_0x0a9e('0x33')]);_0x546742[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0xb7a9b3[_0x0a9e('0x3a')]);_0x546742['filters']=_['intersection'](_0x546742[_0x0a9e('0x3c')],_0x546742[_0x0a9e('0x3a')]);_0x5ecd61['attributes']=_['intersection'](_0x546742['model'],qs['fields'](_0xb7a9b3['query']['fields']));_0x5ecd61[_0x0a9e('0x3e')]=_0x5ecd61['attributes'][_0x0a9e('0x3f')]?_0x5ecd61[_0x0a9e('0x3e')]:_0x546742[_0x0a9e('0x3c')];_0x5ecd61[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0xb7a9b3[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x5ecd61['where']=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0xb7a9b3[_0x0a9e('0x3a')],_0x546742[_0x0a9e('0x44')]));if(_0xb7a9b3[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x5ecd61[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x5ecd61[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x5ecd61[_0x0a9e('0x3e')],function(_0x5d48c2){var _0x35cc16={};_0x35cc16[_0x5d48c2]={'$like':'%'+_0xb7a9b3[_0x0a9e('0x3a')]['filter']+'%'};return _0x35cc16;})});}_0x5ecd61=_[_0x0a9e('0x48')]({},_0x5ecd61,_0xb7a9b3['options']);return _0x98bab3[_0x0a9e('0xe7')](_0x5ecd61);}})[_0x0a9e('0x18')](function(_0x5dea55){if(_0x5dea55){_0x991bfc=_0x5dea55['length'];if(!_0xb7a9b3[_0x0a9e('0x3a')]['hasOwnProperty'](_0x0a9e('0xa9'))){_0x5ecd61[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0xb7a9b3[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x5ecd61['offset']=qs[_0x0a9e('0x25')](_0xb7a9b3['query']['offset']);}return _0x98bab3[_0x0a9e('0xe7')](_0x5ecd61);}})[_0x0a9e('0x18')](function(_0xc37a37){if(_0xc37a37){return _0xc37a37?{'count':_0x991bfc,'rows':_0xc37a37}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x5ccb5a,null))[_0x0a9e('0x52')](handleError(_0x5ccb5a,null));};exports['addTeams']=function(_0x34d7a,_0x425fa1,_0x12fa30){return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x34d7a[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x425fa1,null))['then'](function(_0x3ce294){if(_0x3ce294){return _0x3ce294[_0x0a9e('0xe8')](_0x34d7a[_0x0a9e('0x55')][_0x0a9e('0x5a')],_['omit'](_0x34d7a[_0x0a9e('0x55')],[_0x0a9e('0x5a'),'id'])||{});}})[_0x0a9e('0x18')](respondWithResult(_0x425fa1,null))[_0x0a9e('0x52')](handleError(_0x425fa1,null));};exports[_0x0a9e('0xe9')]=function(_0x4b829f,_0x693ecd,_0xa52efe){var _0x59f213;return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x4b829f[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x693ecd,null))[_0x0a9e('0x18')](function(_0x1f2eaa){if(_0x1f2eaa){return _0x1f2eaa[_0x0a9e('0xe9')](_0x4b829f[_0x0a9e('0x3a')][_0x0a9e('0x5a')]);}})[_0x0a9e('0x18')](respondWithStatusCode(_0x693ecd,null))[_0x0a9e('0x52')](handleError(_0x693ecd,null));};exports[_0x0a9e('0xea')]=function(_0x304b17,_0x1509e5,_0x216002){var _0x43af61={};var _0x435f11={};var _0x496673;var _0x25a680;return db[_0x0a9e('0x32')][_0x0a9e('0xa5')]({'where':{'id':_0x304b17[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x1509e5,null))[_0x0a9e('0x18')](function(_0x19a210){if(_0x19a210){_0x496673=_0x19a210;_0x435f11[_0x0a9e('0x3c')]=_['keys'](db['CmList']['rawAttributes']);_0x435f11['query']=_[_0x0a9e('0x35')](_0x304b17['query']);_0x435f11['filters']=_['intersection'](_0x435f11[_0x0a9e('0x3c')],_0x435f11[_0x0a9e('0x3a')]);_0x43af61[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x435f11['model'],qs['fields'](_0x304b17[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x43af61[_0x0a9e('0x3e')]=_0x43af61[_0x0a9e('0x3e')]['length']?_0x43af61[_0x0a9e('0x3e')]:_0x435f11[_0x0a9e('0x3c')];_0x43af61[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0x304b17[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x43af61['where']=qs[_0x0a9e('0x44')](_['pick'](_0x304b17['query'],_0x435f11[_0x0a9e('0x44')]));if(_0x304b17['query'][_0x0a9e('0x49')]){_0x43af61[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x43af61[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x43af61[_0x0a9e('0x3e')],function(_0x3ad6f5){var _0x38182c={};_0x38182c[_0x3ad6f5]={'$like':'%'+_0x304b17[_0x0a9e('0x3a')]['filter']+'%'};return _0x38182c;})});}_0x43af61=_[_0x0a9e('0x48')]({},_0x43af61,_0x304b17[_0x0a9e('0x4d')]);return _0x496673['getLists'](_0x43af61);}})[_0x0a9e('0x18')](function(_0x39633e){if(_0x39633e){_0x25a680=_0x39633e[_0x0a9e('0x3f')];if(!_0x304b17[_0x0a9e('0x3a')]['hasOwnProperty'](_0x0a9e('0xa9'))){_0x43af61[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x304b17[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x43af61['offset']=qs['offset'](_0x304b17[_0x0a9e('0x3a')]['offset']);}return _0x496673[_0x0a9e('0xea')](_0x43af61);}})['then'](function(_0x12fc21){if(_0x12fc21){return _0x12fc21?{'count':_0x25a680,'rows':_0x12fc21}:null;}})['then'](respondWithResult(_0x1509e5,null))[_0x0a9e('0x52')](handleError(_0x1509e5,null));};exports['getAgents']=function(_0x436a54,_0x179f31,_0x3df29f){var _0x4ee019={};var _0x587fd8={};var _0x4491ef;var _0x52abeb;return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x436a54[_0x0a9e('0x54')]['id']}})['then'](handleEntityNotFound(_0x179f31,null))[_0x0a9e('0x18')](function(_0x1a5c47){if(_0x1a5c47){_0x4491ef=_0x1a5c47;_0x587fd8['model']=_[_0x0a9e('0x35')](db[_0x0a9e('0x32')][_0x0a9e('0x33')]);_0x587fd8[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x436a54[_0x0a9e('0x3a')]);_0x587fd8[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0x587fd8[_0x0a9e('0x3c')],_0x587fd8['query']);_0x4ee019[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x587fd8[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x436a54[_0x0a9e('0x3a')]['fields']));_0x4ee019['attributes']=_0x4ee019[_0x0a9e('0x3e')]['length']?_0x4ee019[_0x0a9e('0x3e')]:_0x587fd8['model'];_0x4ee019[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0x436a54[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x4ee019[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x436a54['query'],_0x587fd8['filters']));if(_0x436a54[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x4ee019['where']=_[_0x0a9e('0x48')](_0x4ee019[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x4ee019['attributes'],function(_0x55ed81){var _0x4d0462={};_0x4d0462[_0x55ed81]={'$like':'%'+_0x436a54[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x4d0462;})});}_0x4ee019[_0x0a9e('0x3c')]=db[_0x0a9e('0x32')];_0x4ee019['as']='Agents';_0x4ee019=_[_0x0a9e('0x48')]({},_0x4ee019,_0x436a54[_0x0a9e('0x4d')]);return _0x4491ef[_0x0a9e('0xeb')]({'include':[_0x4ee019]});}})['then'](function(_0xe289c9){if(_0xe289c9){var _0x55a6c9={},_0x49bef3=[],_0x5590a0=0x0;for(var _0x3624bd=0x0;_0x3624bd<_0xe289c9['length'];_0x3624bd+=0x1){for(var _0x5dbf0b=0x0,_0x31114d;_0x5dbf0b<_0xe289c9[_0x3624bd]['Agents'][_0x0a9e('0x3f')];_0x5dbf0b+=0x1){_0x31114d=_0xe289c9[_0x3624bd]['Agents'][_0x5dbf0b][_0x0a9e('0xa7')]({'plain':!![]});_0x55a6c9[_0x31114d['id']]=_0x31114d;}}_0x55a6c9=_[_0x0a9e('0xec')](_0x55a6c9);for(var _0x244d64=qs['offset'](_0x436a54['query'][_0x0a9e('0x25')]);_0x244d64<_0x55a6c9[_0x0a9e('0x3f')]&&_0x49bef3[_0x0a9e('0x3f')]<qs[_0x0a9e('0x26')](_0x436a54['query'][_0x0a9e('0x26')]);_0x244d64+=0x1){if(_0x55a6c9[_0x244d64]){_0x49bef3[_0x0a9e('0x90')](_0x55a6c9[_0x244d64]);}}return{'count':_0x55a6c9['length'],'rows':_0x49bef3};}})[_0x0a9e('0x18')](respondWithResult(_0x179f31,null))[_0x0a9e('0x52')](handleError(_0x179f31,null));};exports[_0x0a9e('0x2d')]=function(_0x498db0,_0x9ff383){if(_0x498db0[_0x0a9e('0x5f')]['id']==_0x498db0[_0x0a9e('0x54')]['id']){return _0x9ff383[_0x0a9e('0x22')](0x1f4)[_0x0a9e('0x30')]({'message':_0x0a9e('0xed')});}return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x498db0[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x9ff383,null))[_0x0a9e('0x18')](removeEntity(_0x9ff383,null))[_0x0a9e('0x52')](handleError(_0x9ff383,null));};exports[_0x0a9e('0xee')]=function(_0x34ff77,_0x830d3a,_0x21ffb7){return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x34ff77[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x830d3a,null))[_0x0a9e('0x18')](function(_0x3da462){if(_0x3da462){return _0x3da462['addChatInteractions'](_0x34ff77[_0x0a9e('0x55')][_0x0a9e('0x5a')],_[_0x0a9e('0x59')](_0x34ff77['body'],[_0x0a9e('0x5a'),'id'])||{})[_0x0a9e('0xef')](function(){for(var _0x1ced55=0x0;_0x1ced55<_0x34ff77[_0x0a9e('0x55')]['ids'][_0x0a9e('0x3f')];_0x1ced55+=0x1){socket[_0x0a9e('0xc0')]('user_has_chat_interactions:save',{'ChatInteractionId':Number(_0x34ff77[_0x0a9e('0x55')][_0x0a9e('0x5a')][_0x1ced55]),'UserId':Number(_0x34ff77[_0x0a9e('0x54')]['id'])});}return _0x34ff77['body']['ids'];});}})[_0x0a9e('0x18')](respondWithResult(_0x830d3a,null))[_0x0a9e('0x52')](handleError(_0x830d3a,null));};exports[_0x0a9e('0xf0')]=function(_0x5e5251,_0x5b1ee9,_0x477fde){var _0x39104d;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x5e5251['params']['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x5b1ee9,null))['then'](function(_0x4a8a1e){if(_0x4a8a1e){return _0x4a8a1e[_0x0a9e('0xf0')](_0x5e5251[_0x0a9e('0x3a')][_0x0a9e('0x5a')])['then'](function(_0xde0c2a){if(_[_0x0a9e('0xf1')](_0x5e5251[_0x0a9e('0x3a')]['ids'])){for(var _0x5eb06a=0x0;_0x5eb06a<_0x5e5251[_0x0a9e('0x3a')][_0x0a9e('0x5a')][_0x0a9e('0x3f')];_0x5eb06a+=0x1){socket['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x5e5251[_0x0a9e('0x3a')]['ids'][_0x5eb06a]),'UserId':Number(_0x5e5251['params']['id'])});}}else{socket['emit'](_0x0a9e('0xf2'),{'ChatInteractionId':Number(_0x5e5251[_0x0a9e('0x3a')][_0x0a9e('0x5a')]),'UserId':Number(_0x5e5251['params']['id'])});}});}})[_0x0a9e('0x18')](respondWithStatusCode(_0x5b1ee9,null))[_0x0a9e('0x52')](handleError(_0x5b1ee9,null));};exports['addMailInteractions']=function(_0x29035c,_0x57f03f,_0x36afa6){return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x29035c[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x57f03f,null))[_0x0a9e('0x18')](function(_0x4afa93){if(_0x4afa93){return _0x4afa93[_0x0a9e('0xf3')](_0x29035c[_0x0a9e('0x55')][_0x0a9e('0x5a')],_['omit'](_0x29035c[_0x0a9e('0x55')],[_0x0a9e('0x5a'),'id'])||{})[_0x0a9e('0xef')](function(){for(var _0x4c5f3b=0x0;_0x4c5f3b<_0x29035c[_0x0a9e('0x55')][_0x0a9e('0x5a')][_0x0a9e('0x3f')];_0x4c5f3b+=0x1){socket[_0x0a9e('0xc0')](_0x0a9e('0xf4'),{'MailInteractionId':Number(_0x29035c[_0x0a9e('0x55')][_0x0a9e('0x5a')][_0x4c5f3b]),'UserId':Number(_0x29035c[_0x0a9e('0x54')]['id'])});}return _0x29035c['body'][_0x0a9e('0x5a')];});}})[_0x0a9e('0x18')](respondWithResult(_0x57f03f,null))[_0x0a9e('0x52')](handleError(_0x57f03f,null));};exports[_0x0a9e('0xf5')]=function(_0x5dbed2,_0x138f1a,_0xd55dcb){var _0x595856;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x5dbed2[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x138f1a,null))[_0x0a9e('0x18')](function(_0x2cd3bf){if(_0x2cd3bf){return _0x2cd3bf[_0x0a9e('0xf5')](_0x5dbed2[_0x0a9e('0x3a')]['ids'])[_0x0a9e('0x18')](function(_0x509a05){if(_[_0x0a9e('0xf1')](_0x5dbed2[_0x0a9e('0x3a')]['ids'])){for(var _0x25f181=0x0;_0x25f181<_0x5dbed2[_0x0a9e('0x3a')]['ids'][_0x0a9e('0x3f')];_0x25f181+=0x1){socket[_0x0a9e('0xc0')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x5dbed2[_0x0a9e('0x3a')]['ids'][_0x25f181]),'UserId':Number(_0x5dbed2['params']['id'])});}}else{socket['emit'](_0x0a9e('0xf6'),{'MailInteractionId':Number(_0x5dbed2[_0x0a9e('0x3a')]['ids']),'UserId':Number(_0x5dbed2[_0x0a9e('0x54')]['id'])});}});}})[_0x0a9e('0x18')](respondWithStatusCode(_0x138f1a,null))['catch'](handleError(_0x138f1a,null));};exports[_0x0a9e('0xf7')]=function(_0xc20d7f,_0x4bdcd3,_0x47364f){return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0xc20d7f['params']['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x4bdcd3,null))[_0x0a9e('0x18')](function(_0x1815b8){if(_0x1815b8){return _0x1815b8[_0x0a9e('0xf7')](_0xc20d7f[_0x0a9e('0x55')]['ids'],_[_0x0a9e('0x59')](_0xc20d7f['body'],[_0x0a9e('0x5a'),'id'])||{})[_0x0a9e('0xef')](function(){for(var _0x346236=0x0;_0x346236<_0xc20d7f[_0x0a9e('0x55')][_0x0a9e('0x5a')][_0x0a9e('0x3f')];_0x346236+=0x1){socket[_0x0a9e('0xc0')](_0x0a9e('0xf8'),{'FaxInteractionId':Number(_0xc20d7f[_0x0a9e('0x55')]['ids'][_0x346236]),'UserId':Number(_0xc20d7f[_0x0a9e('0x54')]['id'])});}return _0xc20d7f[_0x0a9e('0x55')][_0x0a9e('0x5a')];});}})['then'](respondWithResult(_0x4bdcd3,null))['catch'](handleError(_0x4bdcd3,null));};exports['removeFaxInteractions']=function(_0x4b99fb,_0x49e349,_0x347d13){var _0x5ed148;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x4b99fb[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x49e349,null))[_0x0a9e('0x18')](function(_0x15e580){if(_0x15e580){return _0x15e580['removeFaxInteractions'](_0x4b99fb[_0x0a9e('0x3a')]['ids'])['then'](function(_0x139b02){if(_['isArray'](_0x4b99fb[_0x0a9e('0x3a')]['ids'])){for(var _0x3e3b5f=0x0;_0x3e3b5f<_0x4b99fb[_0x0a9e('0x3a')][_0x0a9e('0x5a')][_0x0a9e('0x3f')];_0x3e3b5f+=0x1){socket[_0x0a9e('0xc0')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x4b99fb[_0x0a9e('0x3a')][_0x0a9e('0x5a')][_0x3e3b5f]),'UserId':Number(_0x4b99fb['params']['id'])});}}else{socket[_0x0a9e('0xc0')](_0x0a9e('0xf9'),{'FaxInteractionId':Number(_0x4b99fb['query'][_0x0a9e('0x5a')]),'UserId':Number(_0x4b99fb[_0x0a9e('0x54')]['id'])});}});}})[_0x0a9e('0x18')](respondWithStatusCode(_0x49e349,null))[_0x0a9e('0x52')](handleError(_0x49e349,null));};exports[_0x0a9e('0xfa')]=function(_0x263c8f,_0x1629a9,_0x494351){return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x263c8f[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x1629a9,null))['then'](function(_0x19e176){if(_0x19e176){return _0x19e176[_0x0a9e('0xfa')](_0x263c8f[_0x0a9e('0x55')][_0x0a9e('0x5a')],_[_0x0a9e('0x59')](_0x263c8f[_0x0a9e('0x55')],[_0x0a9e('0x5a'),'id'])||{})[_0x0a9e('0xef')](function(){for(var _0x5a87e7=0x0;_0x5a87e7<_0x263c8f[_0x0a9e('0x55')][_0x0a9e('0x5a')][_0x0a9e('0x3f')];_0x5a87e7+=0x1){socket['emit'](_0x0a9e('0xfb'),{'SmsInteractionId':Number(_0x263c8f[_0x0a9e('0x55')][_0x0a9e('0x5a')][_0x5a87e7]),'UserId':Number(_0x263c8f[_0x0a9e('0x54')]['id'])});}return _0x263c8f[_0x0a9e('0x55')][_0x0a9e('0x5a')];});}})[_0x0a9e('0x18')](respondWithResult(_0x1629a9,null))[_0x0a9e('0x52')](handleError(_0x1629a9,null));};exports[_0x0a9e('0xfc')]=function(_0x1c39a4,_0x4c8e78,_0x1cee49){var _0x3a87e7;return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x1c39a4['params']['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x4c8e78,null))[_0x0a9e('0x18')](function(_0x395034){if(_0x395034){return _0x395034[_0x0a9e('0xfc')](_0x1c39a4[_0x0a9e('0x3a')][_0x0a9e('0x5a')])[_0x0a9e('0x18')](function(_0x236a28){if(_[_0x0a9e('0xf1')](_0x1c39a4['query'][_0x0a9e('0x5a')])){for(var _0x41ae51=0x0;_0x41ae51<_0x1c39a4['query'][_0x0a9e('0x5a')][_0x0a9e('0x3f')];_0x41ae51+=0x1){socket['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x1c39a4[_0x0a9e('0x3a')][_0x0a9e('0x5a')][_0x41ae51]),'UserId':Number(_0x1c39a4[_0x0a9e('0x54')]['id'])});}}else{socket[_0x0a9e('0xc0')](_0x0a9e('0xfd'),{'SmsInteractionId':Number(_0x1c39a4['query'][_0x0a9e('0x5a')]),'UserId':Number(_0x1c39a4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4c8e78,null))['catch'](handleError(_0x4c8e78,null));};exports[_0x0a9e('0xfe')]=function(_0x4c09a7,_0x4ba7bb,_0x4a87e4){return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x4c09a7[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x4ba7bb,null))['then'](function(_0x2b9a34){if(_0x2b9a34){return _0x2b9a34['addOpenchannelInteractions'](_0x4c09a7['body'][_0x0a9e('0x5a')],_[_0x0a9e('0x59')](_0x4c09a7[_0x0a9e('0x55')],['ids','id'])||{})['spread'](function(){for(var _0x5873f8=0x0;_0x5873f8<_0x4c09a7[_0x0a9e('0x55')][_0x0a9e('0x5a')][_0x0a9e('0x3f')];_0x5873f8+=0x1){socket[_0x0a9e('0xc0')](_0x0a9e('0xff'),{'OpenchannelInteractionId':Number(_0x4c09a7['body'][_0x0a9e('0x5a')][_0x5873f8]),'UserId':Number(_0x4c09a7[_0x0a9e('0x54')]['id'])});}return _0x4c09a7[_0x0a9e('0x55')][_0x0a9e('0x5a')];});}})[_0x0a9e('0x18')](respondWithResult(_0x4ba7bb,null))[_0x0a9e('0x52')](handleError(_0x4ba7bb,null));};exports['removeOpenchannelInteractions']=function(_0x292208,_0x2a64e4,_0x32a9c6){var _0x2feaad;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x292208[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x2a64e4,null))[_0x0a9e('0x18')](function(_0x20e4f3){if(_0x20e4f3){return _0x20e4f3[_0x0a9e('0x100')](_0x292208[_0x0a9e('0x3a')][_0x0a9e('0x5a')])[_0x0a9e('0x18')](function(_0x31d2d4){if(_[_0x0a9e('0xf1')](_0x292208[_0x0a9e('0x3a')][_0x0a9e('0x5a')])){for(var _0x4d5e96=0x0;_0x4d5e96<_0x292208[_0x0a9e('0x3a')][_0x0a9e('0x5a')]['length'];_0x4d5e96+=0x1){socket['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x292208[_0x0a9e('0x3a')][_0x0a9e('0x5a')][_0x4d5e96]),'UserId':Number(_0x292208['params']['id'])});}}else{socket[_0x0a9e('0xc0')](_0x0a9e('0x101'),{'OpenchannelInteractionId':Number(_0x292208['query'][_0x0a9e('0x5a')]),'UserId':Number(_0x292208['params']['id'])});}});}})[_0x0a9e('0x18')](respondWithStatusCode(_0x2a64e4,null))['catch'](handleError(_0x2a64e4,null));};exports[_0x0a9e('0x102')]=function(_0x1de9b2,_0x29092f,_0x22ddd7){var _0x51001e={};var _0x1333b0={};var _0x223975;var _0x2e7684;return db['User']['findOne']({'where':{'id':_0x1de9b2['params']['id']}})['then'](handleEntityNotFound(_0x29092f,null))[_0x0a9e('0x18')](function(_0xb4b8af){if(_0xb4b8af){_0x223975=_0xb4b8af;_0x1333b0[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db[_0x0a9e('0x103')]['rawAttributes']);_0x1333b0[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x1de9b2[_0x0a9e('0x3a')]);_0x1333b0[_0x0a9e('0x44')]=_['intersection'](_0x1333b0[_0x0a9e('0x3c')],_0x1333b0[_0x0a9e('0x3a')]);_0x51001e[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x1333b0[_0x0a9e('0x3c')],qs['fields'](_0x1de9b2[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x51001e[_0x0a9e('0x3e')]=_0x51001e['attributes'][_0x0a9e('0x3f')]?_0x51001e['attributes']:_0x1333b0[_0x0a9e('0x3c')];_0x51001e[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0x1de9b2[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x51001e['where']=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x1de9b2[_0x0a9e('0x3a')],_0x1333b0[_0x0a9e('0x44')]));if(_0x1de9b2[_0x0a9e('0x3a')]['filter']){_0x51001e[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x51001e[_0x0a9e('0x43')],{'$or':_['map'](_0x51001e[_0x0a9e('0x3e')],function(_0x488216){var _0x479441={};_0x479441[_0x488216]={'$like':'%'+_0x1de9b2[_0x0a9e('0x3a')]['filter']+'%'};return _0x479441;})});}_0x51001e=_[_0x0a9e('0x48')]({},_0x51001e,_0x1de9b2[_0x0a9e('0x4d')]);return _0x223975[_0x0a9e('0x102')](_0x51001e);}})['then'](function(_0x365904){if(_0x365904){_0x2e7684=_0x365904[_0x0a9e('0x3f')];if(!_0x1de9b2[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x51001e[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x1de9b2[_0x0a9e('0x3a')]['limit']);_0x51001e[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x1de9b2[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}return _0x223975[_0x0a9e('0x102')](_0x51001e);}})['then'](function(_0x592f39){if(_0x592f39){return _0x592f39?{'count':_0x2e7684,'rows':_0x592f39}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x29092f,null))['catch'](handleError(_0x29092f,null));};exports[_0x0a9e('0x104')]=function(_0x42f2da,_0x58b3f3,_0x2eb471){var _0x239eef={};var _0xc91243={};var _0x49973b;var _0x25de30;return db[_0x0a9e('0x32')][_0x0a9e('0xa5')]({'where':{'id':_0x42f2da[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x58b3f3,null))[_0x0a9e('0x18')](function(_0x9ecf57){if(_0x9ecf57){_0x49973b=_0x9ecf57;_0xc91243[_0x0a9e('0x3c')]=_['keys'](db[_0x0a9e('0x105')][_0x0a9e('0x33')]);_0xc91243[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x42f2da[_0x0a9e('0x3a')]);_0xc91243['filters']=_[_0x0a9e('0x3b')](_0xc91243['model'],_0xc91243[_0x0a9e('0x3a')]);_0x239eef[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0xc91243['model'],qs[_0x0a9e('0x3d')](_0x42f2da['query'][_0x0a9e('0x3d')]));_0x239eef[_0x0a9e('0x3e')]=_0x239eef[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x239eef['attributes']:_0xc91243[_0x0a9e('0x3c')];_0x239eef['order']=qs[_0x0a9e('0x42')](_0x42f2da[_0x0a9e('0x3a')]['sort']);_0x239eef[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x42f2da['query'],_0xc91243[_0x0a9e('0x44')]));if(_0x42f2da['query'][_0x0a9e('0x49')]){_0x239eef[_0x0a9e('0x43')]=_['merge'](_0x239eef['where'],{'$or':_['map'](_0x239eef['attributes'],function(_0x1ce430){var _0x40a6f4={};_0x40a6f4[_0x1ce430]={'$like':'%'+_0x42f2da[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x40a6f4;})});}_0x239eef=_['merge']({},_0x239eef,_0x42f2da[_0x0a9e('0x4d')]);return _0x49973b['getFaxAccounts'](_0x239eef);}})[_0x0a9e('0x18')](function(_0x476e16){if(_0x476e16){_0x25de30=_0x476e16['length'];if(!_0x42f2da[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x239eef[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x42f2da[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x239eef['offset']=qs[_0x0a9e('0x25')](_0x42f2da[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}return _0x49973b[_0x0a9e('0x104')](_0x239eef);}})[_0x0a9e('0x18')](function(_0x3118bd){if(_0x3118bd){return _0x3118bd?{'count':_0x25de30,'rows':_0x3118bd}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x58b3f3,null))[_0x0a9e('0x52')](handleError(_0x58b3f3,null));};exports[_0x0a9e('0x106')]=function(_0x43fd4c,_0x10e1b9,_0x4f33b7){return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x43fd4c[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x10e1b9,null))[_0x0a9e('0x18')](function(_0x3a32c7){if(_0x3a32c7){return _0x3a32c7[_0x0a9e('0x106')](_0x43fd4c['body'][_0x0a9e('0x5a')],_[_0x0a9e('0x59')](_0x43fd4c[_0x0a9e('0x55')],['ids','id'])||{});}})[_0x0a9e('0x18')](respondWithResult(_0x10e1b9,null))[_0x0a9e('0x52')](handleError(_0x10e1b9,null));};exports[_0x0a9e('0x107')]=function(_0x4c7e3b,_0x5d3ad3,_0x23b67e){var _0x17a2d7;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x4c7e3b[_0x0a9e('0x54')]['id']}})['then'](handleEntityNotFound(_0x5d3ad3,null))[_0x0a9e('0x18')](function(_0x584f70){if(_0x584f70){return _0x584f70[_0x0a9e('0x107')](_0x4c7e3b[_0x0a9e('0x3a')]['ids']);}})[_0x0a9e('0x18')](respondWithStatusCode(_0x5d3ad3,null))['catch'](handleError(_0x5d3ad3,null));};exports[_0x0a9e('0x108')]=function(_0x2e933b,_0x486ed3,_0x127919){var _0xbff290={};var _0xab6a54={};var _0x5ccd49;var _0x40c9dd;return db[_0x0a9e('0x32')][_0x0a9e('0xa5')]({'where':{'id':_0x2e933b[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x486ed3,null))[_0x0a9e('0x18')](function(_0x4fd2bb){if(_0x4fd2bb){_0x5ccd49=_0x4fd2bb;_0xab6a54[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db[_0x0a9e('0x109')][_0x0a9e('0x33')]);_0xab6a54['query']=_['keys'](_0x2e933b[_0x0a9e('0x3a')]);_0xab6a54[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0xab6a54['model'],_0xab6a54['query']);_0xbff290[_0x0a9e('0x3e')]=_['intersection'](_0xab6a54['model'],qs[_0x0a9e('0x3d')](_0x2e933b[_0x0a9e('0x3a')]['fields']));_0xbff290[_0x0a9e('0x3e')]=_0xbff290[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0xbff290[_0x0a9e('0x3e')]:_0xab6a54[_0x0a9e('0x3c')];_0xbff290['order']=qs[_0x0a9e('0x42')](_0x2e933b[_0x0a9e('0x3a')]['sort']);_0xbff290[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x2e933b[_0x0a9e('0x3a')],_0xab6a54[_0x0a9e('0x44')]));if(_0x2e933b['query'][_0x0a9e('0x49')]){_0xbff290[_0x0a9e('0x43')]=_['merge'](_0xbff290['where'],{'$or':_[_0x0a9e('0x4a')](_0xbff290[_0x0a9e('0x3e')],function(_0x4987b8){var _0x540508={};_0x540508[_0x4987b8]={'$like':'%'+_0x2e933b[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x540508;})});}_0xbff290=_[_0x0a9e('0x48')]({},_0xbff290,_0x2e933b[_0x0a9e('0x4d')]);return _0x5ccd49[_0x0a9e('0x108')](_0xbff290);}})['then'](function(_0x1a2437){if(_0x1a2437){_0x40c9dd=_0x1a2437['length'];if(!_0x2e933b['query'][_0x0a9e('0x40')]('nolimit')){_0xbff290[_0x0a9e('0x26')]=qs['limit'](_0x2e933b[_0x0a9e('0x3a')]['limit']);_0xbff290['offset']=qs[_0x0a9e('0x25')](_0x2e933b[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}return _0x5ccd49['getMailAccounts'](_0xbff290);}})['then'](function(_0x537da0){if(_0x537da0){return _0x537da0?{'count':_0x40c9dd,'rows':_0x537da0}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x486ed3,null))[_0x0a9e('0x52')](handleError(_0x486ed3,null));};exports['addMailAccounts']=function(_0x2ed3ba,_0x4b7f09,_0x446f3b){return db['User'][_0x0a9e('0x56')]({'where':{'id':_0x2ed3ba[_0x0a9e('0x54')]['id']}})['then'](handleEntityNotFound(_0x4b7f09,null))['then'](function(_0x4c4874){if(_0x4c4874){return _0x4c4874[_0x0a9e('0x10a')](_0x2ed3ba[_0x0a9e('0x55')][_0x0a9e('0x5a')],_[_0x0a9e('0x59')](_0x2ed3ba[_0x0a9e('0x55')],[_0x0a9e('0x5a'),'id'])||{});}})[_0x0a9e('0x18')](respondWithResult(_0x4b7f09,null))[_0x0a9e('0x52')](handleError(_0x4b7f09,null));};exports[_0x0a9e('0x10b')]=function(_0x128212,_0xa31c1e,_0x2de177){var _0x2b9341;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x128212['params']['id']}})['then'](handleEntityNotFound(_0xa31c1e,null))[_0x0a9e('0x18')](function(_0x6ea669){if(_0x6ea669){return _0x6ea669[_0x0a9e('0x10b')](_0x128212[_0x0a9e('0x3a')]['ids']);}})[_0x0a9e('0x18')](respondWithStatusCode(_0xa31c1e,null))['catch'](handleError(_0xa31c1e,null));};exports[_0x0a9e('0x10c')]=function(_0x5f35e7,_0x209ece,_0x50ce98){var _0x50985c={};var _0x2787ff={};var _0x2b8734;var _0xc2ae55;return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x5f35e7['params']['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x209ece,null))['then'](function(_0x216921){if(_0x216921){_0x2b8734=_0x216921;_0x2787ff[_0x0a9e('0x3c')]=_['keys'](db[_0x0a9e('0x10d')]['rawAttributes']);_0x2787ff[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x5f35e7[_0x0a9e('0x3a')]);_0x2787ff[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0x2787ff[_0x0a9e('0x3c')],_0x2787ff[_0x0a9e('0x3a')]);_0x50985c[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x2787ff[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x5f35e7[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x50985c[_0x0a9e('0x3e')]=_0x50985c[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x50985c['attributes']:_0x2787ff[_0x0a9e('0x3c')];_0x50985c[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0x5f35e7['query'][_0x0a9e('0x42')]);_0x50985c[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x5f35e7[_0x0a9e('0x3a')],_0x2787ff[_0x0a9e('0x44')]));if(_0x5f35e7[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x50985c[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x50985c[_0x0a9e('0x43')],{'$or':_['map'](_0x50985c[_0x0a9e('0x3e')],function(_0x3bf6ee){var _0x469905={};_0x469905[_0x3bf6ee]={'$like':'%'+_0x5f35e7['query'][_0x0a9e('0x49')]+'%'};return _0x469905;})});}_0x50985c=_['merge']({},_0x50985c,_0x5f35e7['options']);return _0x2b8734[_0x0a9e('0x10c')](_0x50985c);}})['then'](function(_0x46efaa){if(_0x46efaa){_0xc2ae55=_0x46efaa['length'];if(!_0x5f35e7[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x50985c['limit']=qs[_0x0a9e('0x26')](_0x5f35e7['query']['limit']);_0x50985c[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x5f35e7[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}return _0x2b8734[_0x0a9e('0x10c')](_0x50985c);}})[_0x0a9e('0x18')](function(_0x5f3a18){if(_0x5f3a18){return _0x5f3a18?{'count':_0xc2ae55,'rows':_0x5f3a18}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x209ece,null))[_0x0a9e('0x52')](handleError(_0x209ece,null));};exports[_0x0a9e('0x10e')]=function(_0x469b84,_0x3f3cd9,_0x4e4cc0){return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x469b84[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x3f3cd9,null))[_0x0a9e('0x18')](function(_0x96d549){if(_0x96d549){return _0x96d549[_0x0a9e('0x10e')](_0x469b84[_0x0a9e('0x55')][_0x0a9e('0x5a')],_[_0x0a9e('0x59')](_0x469b84[_0x0a9e('0x55')],[_0x0a9e('0x5a'),'id'])||{});}})[_0x0a9e('0x18')](respondWithResult(_0x3f3cd9,null))['catch'](handleError(_0x3f3cd9,null));};exports['removeOpenchannelAccounts']=function(_0xdfcc9c,_0x2aca7e,_0x57a8e5){var _0x22661e;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0xdfcc9c[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x2aca7e,null))['then'](function(_0x5d85ab){if(_0x5d85ab){return _0x5d85ab['removeOpenchannelAccounts'](_0xdfcc9c[_0x0a9e('0x3a')][_0x0a9e('0x5a')]);}})[_0x0a9e('0x18')](respondWithStatusCode(_0x2aca7e,null))[_0x0a9e('0x52')](handleError(_0x2aca7e,null));};exports[_0x0a9e('0x10f')]=function(_0xa2a2a2,_0x571e02,_0x3e144e){var _0x44c694={};var _0x4ee67f={};var _0x4a0c23;var _0x414829;return db[_0x0a9e('0x32')][_0x0a9e('0xa5')]({'where':{'id':_0xa2a2a2[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x571e02,null))[_0x0a9e('0x18')](function(_0x257f32){if(_0x257f32){_0x4a0c23=_0x257f32;_0x4ee67f[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db[_0x0a9e('0x110')]['rawAttributes']);_0x4ee67f[_0x0a9e('0x3a')]=_['keys'](_0xa2a2a2['query']);_0x4ee67f[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0x4ee67f[_0x0a9e('0x3c')],_0x4ee67f[_0x0a9e('0x3a')]);_0x44c694[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x4ee67f[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0xa2a2a2[_0x0a9e('0x3a')]['fields']));_0x44c694[_0x0a9e('0x3e')]=_0x44c694[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x44c694['attributes']:_0x4ee67f[_0x0a9e('0x3c')];_0x44c694[_0x0a9e('0x41')]=qs['sort'](_0xa2a2a2['query']['sort']);_0x44c694['where']=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0xa2a2a2['query'],_0x4ee67f[_0x0a9e('0x44')]));if(_0xa2a2a2['query'][_0x0a9e('0x49')]){_0x44c694[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x44c694['where'],{'$or':_['map'](_0x44c694[_0x0a9e('0x3e')],function(_0x14c011){var _0xb68b={};_0xb68b[_0x14c011]={'$like':'%'+_0xa2a2a2[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0xb68b;})});}_0x44c694=_[_0x0a9e('0x48')]({},_0x44c694,_0xa2a2a2[_0x0a9e('0x4d')]);return _0x4a0c23[_0x0a9e('0x10f')](_0x44c694);}})[_0x0a9e('0x18')](function(_0x26c59b){if(_0x26c59b){_0x414829=_0x26c59b[_0x0a9e('0x3f')];if(!_0xa2a2a2['query'][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x44c694['limit']=qs['limit'](_0xa2a2a2[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x44c694[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0xa2a2a2[_0x0a9e('0x3a')]['offset']);}return _0x4a0c23[_0x0a9e('0x10f')](_0x44c694);}})[_0x0a9e('0x18')](function(_0x4c4796){if(_0x4c4796){return _0x4c4796?{'count':_0x414829,'rows':_0x4c4796}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x571e02,null))['catch'](handleError(_0x571e02,null));};exports['addSmsAccounts']=function(_0x4c322e,_0x2b1277,_0x7725f5){return db['User']['find']({'where':{'id':_0x4c322e[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x2b1277,null))[_0x0a9e('0x18')](function(_0x1682dc){if(_0x1682dc){return _0x1682dc['addSmsAccounts'](_0x4c322e[_0x0a9e('0x55')][_0x0a9e('0x5a')],_[_0x0a9e('0x59')](_0x4c322e['body'],[_0x0a9e('0x5a'),'id'])||{});}})[_0x0a9e('0x18')](respondWithResult(_0x2b1277,null))[_0x0a9e('0x52')](handleError(_0x2b1277,null));};exports[_0x0a9e('0x111')]=function(_0x2cdbbf,_0x5a240f,_0x5b862a){var _0x171660;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x2cdbbf['params']['id']}})['then'](handleEntityNotFound(_0x5a240f,null))['then'](function(_0x5a273b){if(_0x5a273b){return _0x5a273b[_0x0a9e('0x111')](_0x2cdbbf[_0x0a9e('0x3a')][_0x0a9e('0x5a')]);}})[_0x0a9e('0x18')](respondWithStatusCode(_0x5a240f,null))[_0x0a9e('0x52')](handleError(_0x5a240f,null));};exports['getChatWebsites']=function(_0x28e662,_0x9148f0,_0x34f39f){var _0x2e40a9={};var _0x27c479={};var _0x4a76c1;var _0x26328e;return db[_0x0a9e('0x32')][_0x0a9e('0xa5')]({'where':{'id':_0x28e662[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x9148f0,null))['then'](function(_0xfe400d){if(_0xfe400d){_0x4a76c1=_0xfe400d;_0x27c479[_0x0a9e('0x3c')]=_['keys'](db['ChatWebsite']['rawAttributes']);_0x27c479[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x28e662['query']);_0x27c479[_0x0a9e('0x44')]=_['intersection'](_0x27c479['model'],_0x27c479['query']);_0x2e40a9['attributes']=_[_0x0a9e('0x3b')](_0x27c479[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x28e662[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x2e40a9[_0x0a9e('0x3e')]=_0x2e40a9[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x2e40a9[_0x0a9e('0x3e')]:_0x27c479[_0x0a9e('0x3c')];_0x2e40a9[_0x0a9e('0x41')]=qs['sort'](_0x28e662[_0x0a9e('0x3a')]['sort']);_0x2e40a9[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x28e662[_0x0a9e('0x3a')],_0x27c479[_0x0a9e('0x44')]));if(_0x28e662[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x2e40a9[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x2e40a9['where'],{'$or':_['map'](_0x2e40a9['attributes'],function(_0x3bba5f){var _0x314b2c={};_0x314b2c[_0x3bba5f]={'$like':'%'+_0x28e662[_0x0a9e('0x3a')]['filter']+'%'};return _0x314b2c;})});}_0x2e40a9=_[_0x0a9e('0x48')]({},_0x2e40a9,_0x28e662[_0x0a9e('0x4d')]);return _0x4a76c1[_0x0a9e('0x112')](_0x2e40a9);}})['then'](function(_0x3a5d9d){if(_0x3a5d9d){_0x26328e=_0x3a5d9d[_0x0a9e('0x3f')];if(!_0x28e662[_0x0a9e('0x3a')][_0x0a9e('0x40')]('nolimit')){_0x2e40a9[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x28e662[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x2e40a9[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x28e662[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}return _0x4a76c1[_0x0a9e('0x112')](_0x2e40a9);}})[_0x0a9e('0x18')](function(_0x55e562){if(_0x55e562){return _0x55e562?{'count':_0x26328e,'rows':_0x55e562}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x9148f0,null))['catch'](handleError(_0x9148f0,null));};exports[_0x0a9e('0x113')]=function(_0x5108bf,_0x447663,_0x326b17){return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x5108bf[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x447663,null))['then'](function(_0x27ac89){if(_0x27ac89){return _0x27ac89['addChatWebsites'](_0x5108bf[_0x0a9e('0x55')][_0x0a9e('0x5a')],_[_0x0a9e('0x59')](_0x5108bf['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x447663,null))[_0x0a9e('0x52')](handleError(_0x447663,null));};exports[_0x0a9e('0x114')]=function(_0x21c1d0,_0x390d4a,_0x5d00c){var _0x268bb4;return db['User'][_0x0a9e('0x56')]({'where':{'id':_0x21c1d0[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x390d4a,null))[_0x0a9e('0x18')](function(_0x507582){if(_0x507582){return _0x507582[_0x0a9e('0x114')](_0x21c1d0[_0x0a9e('0x3a')]['ids']);}})[_0x0a9e('0x18')](respondWithStatusCode(_0x390d4a,null))[_0x0a9e('0x52')](handleError(_0x390d4a,null));};exports[_0x0a9e('0x115')]=function(_0x4c0f5a,_0x10c613,_0x4d103c){var _0x365e04={};var _0x586884={};var _0x34a03b;var _0xb077af;return db['User'][_0x0a9e('0xa5')]({'where':{'id':_0x4c0f5a[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x10c613,null))['then'](function(_0x12b323){if(_0x12b323){_0x34a03b=_0x12b323;_0x586884['model']=_[_0x0a9e('0x35')](db[_0x0a9e('0x116')][_0x0a9e('0x33')]);_0x586884[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x4c0f5a['query']);_0x586884[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0x586884[_0x0a9e('0x3c')],_0x586884[_0x0a9e('0x3a')]);_0x365e04[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x586884[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x4c0f5a[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x365e04[_0x0a9e('0x3e')]=_0x365e04[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x365e04[_0x0a9e('0x3e')]:_0x586884[_0x0a9e('0x3c')];_0x365e04[_0x0a9e('0x41')]=qs['sort'](_0x4c0f5a[_0x0a9e('0x3a')]['sort']);_0x365e04[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_['pick'](_0x4c0f5a[_0x0a9e('0x3a')],_0x586884[_0x0a9e('0x44')]));if(_0x4c0f5a['query'][_0x0a9e('0x49')]){_0x365e04[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x365e04['where'],{'$or':_[_0x0a9e('0x4a')](_0x365e04['attributes'],function(_0x48db5d){var _0x4ce13d={};_0x4ce13d[_0x48db5d]={'$like':'%'+_0x4c0f5a[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x4ce13d;})});}_0x365e04=_[_0x0a9e('0x48')]({},_0x365e04,_0x4c0f5a[_0x0a9e('0x4d')]);return _0x34a03b[_0x0a9e('0x115')](_0x365e04);}})[_0x0a9e('0x18')](function(_0x29a2e7){if(_0x29a2e7){_0xb077af=_0x29a2e7[_0x0a9e('0x3f')];if(!_0x4c0f5a[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x365e04[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x4c0f5a[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x365e04[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x4c0f5a[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}return _0x34a03b[_0x0a9e('0x115')](_0x365e04);}})[_0x0a9e('0x18')](function(_0x54563a){if(_0x54563a){return _0x54563a?{'count':_0xb077af,'rows':_0x54563a}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x10c613,null))['catch'](handleError(_0x10c613,null));};exports[_0x0a9e('0x117')]=function(_0x13cc29,_0x4287c0,_0x4b323b){return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x13cc29[_0x0a9e('0x54')]['id']}})['then'](handleEntityNotFound(_0x4287c0,null))[_0x0a9e('0x18')](function(_0xfcbada){if(_0xfcbada){return _0xfcbada[_0x0a9e('0x117')](_0x13cc29[_0x0a9e('0x55')][_0x0a9e('0x5a')],_[_0x0a9e('0x59')](_0x13cc29[_0x0a9e('0x55')],['ids','id'])||{});}})[_0x0a9e('0x18')](respondWithResult(_0x4287c0,null))[_0x0a9e('0x52')](handleError(_0x4287c0,null));};exports[_0x0a9e('0x118')]=function(_0x504887,_0x596a8c,_0x360bc2){var _0x1879ab;return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x504887[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x596a8c,null))[_0x0a9e('0x18')](function(_0x261cf7){if(_0x261cf7){return _0x261cf7[_0x0a9e('0x118')](_0x504887[_0x0a9e('0x3a')]['ids']);}})[_0x0a9e('0x18')](respondWithStatusCode(_0x596a8c,null))[_0x0a9e('0x52')](handleError(_0x596a8c,null));};
\ No newline at end of file
+var _0xa9e0=['getSmsAccounts','SmsAccount','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','register','jayson/promise','client','http','request','then','info','request\x20sent','User,\x20%s,\x20%s,\x20%s','error','code','User,\x20%s,\x20%s','message','result','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','stack','name','send','index','User','rawAttributes','differenceBy','keys','password','salt','dateStart','dateEnd','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','add','day','merge','filter','map','sequelize','lower','options','includeAll','include','findAll','rows','catch','show','params','body','find','describe','addContacts','omit','ids','agent','agent\x20role','role','telephone','user','getLicense','telephones','users','isNil','License\x20limit\x20reached','format','count\x20%s:\x20%s','create','Setting','findById','min_internal','max','internal','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','email','permissions','103','110','105','107','108','100','111','changePassword','newPassword','Sequelize','ValidationError','authenticate','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','admin','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','addQueues','loginInPause','voicePause','isValidChannel','channel','Unknown\x20channel','capitalize','toLowerCase','Queues','voice','VoiceQueue','push','%s/%s','SIP','each','UserVoiceQueueRt','upsert','removeQueues','remove','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getContacts','CmContact','getQueues','findOne','Queue','get','Unknown\x20role','nolimit','getVoiceQueuesRt','ChatGroup','getGroups','getRecordings','VoiceRecording','UserId','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','login','mobile','intrf','interface','LOCAL/%s@from-sip/n','SIP/%s','user:%s','emit','user:forcelogout','connection','remoteAddress','socket','UserVoiceQueue.penalty','MemberReport','forEach','all','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','bulkCreate','concat','logout','pause','QueuePause','updateAttributes','type','DEFAULT\x20PAUSE','mailPause','chatPause','openchannelPause','smsPause','pauseType','lastPauseAt','unpause','manual','mail','chat','fax','sms','openchannel','%s%s','Pause','Team','getTeams','addTeams','removeTeams','getLists','getVoiceQueues','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','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','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','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts'];(function(_0x1c4409,_0x3b2e8f){var _0x356d8f=function(_0xae43bf){while(--_0xae43bf){_0x1c4409['push'](_0x1c4409['shift']());}};_0x356d8f(++_0x3b2e8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var qs=require(_0x0a9e('0xe'));var logger=require(_0x0a9e('0xf'))(_0x0a9e('0x10'));var utils=require(_0x0a9e('0x11'));var config=require(_0x0a9e('0x12'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')({'host':'localhost','port':0x18eb});require('./user.socket')[_0x0a9e('0x13')](socket);var jayson=require(_0x0a9e('0x14'));var client=jayson[_0x0a9e('0x15')][_0x0a9e('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x32d742,_0x69aeb7,_0x5db4b0,_0x4283ce){return new BPromise(function(_0x239b12,_0x2b4227){var _0x281129=_0x4283ce||client;return _0x281129[_0x0a9e('0x17')](_0x32d742,_0x5db4b0)[_0x0a9e('0x18')](function(_0x52a03d){logger[_0x0a9e('0x19')]('User,\x20%s,\x20%s',_0x69aeb7,_0x0a9e('0x1a'));logger['debug'](_0x0a9e('0x1b'),_0x69aeb7,_0x0a9e('0x1a'),JSON['stringify'](_0x52a03d));if(_0x52a03d[_0x0a9e('0x1c')]){if(_0x52a03d['error'][_0x0a9e('0x1d')]===0x1f4){logger[_0x0a9e('0x1c')](_0x0a9e('0x1e'),_0x69aeb7,_0x52a03d[_0x0a9e('0x1c')][_0x0a9e('0x1f')]);return _0x2b4227(_0x52a03d[_0x0a9e('0x1c')][_0x0a9e('0x1f')]);}logger[_0x0a9e('0x1c')](_0x0a9e('0x1e'),_0x69aeb7,_0x52a03d[_0x0a9e('0x1c')][_0x0a9e('0x1f')]);return _0x239b12(_0x52a03d[_0x0a9e('0x1c')]['message']);}else{logger[_0x0a9e('0x19')](_0x0a9e('0x1e'),_0x69aeb7,'request\x20sent');_0x239b12(_0x52a03d[_0x0a9e('0x20')]['message']);}})['catch'](function(_0x3a02e1){logger[_0x0a9e('0x1c')](_0x0a9e('0x1e'),_0x69aeb7,_0x3a02e1);_0x2b4227(_0x3a02e1);});});}function respondWithStatusCode(_0x30bae6,_0x4abc77){_0x4abc77=_0x4abc77||0xcc;return function(_0xfb6e48){if(_0xfb6e48){return _0x30bae6[_0x0a9e('0x21')](_0x4abc77);}return _0x30bae6[_0x0a9e('0x22')](_0x4abc77)[_0x0a9e('0x23')]();};}function respondWithResult(_0x370d86,_0x42ac8f){_0x42ac8f=_0x42ac8f||0xc8;return function(_0x16b1ca){if(_0x16b1ca){return _0x370d86['status'](_0x42ac8f)['json'](_0x16b1ca);}};}function respondWithFilteredResult(_0x197ec0,_0x3a8e58){return function(_0x40c424){if(_0x40c424){var _0x33161b=_0x40c424[_0x0a9e('0x24')],_0x526cf3=_0x3a8e58['offset'],_0x384319=_0x3a8e58[_0x0a9e('0x25')]+_0x3a8e58[_0x0a9e('0x26')],_0x479bc4;if(_0x384319>=_0x33161b){_0x384319=_0x33161b;_0x479bc4=0xc8;}else{_0x479bc4=0xce;}_0x197ec0[_0x0a9e('0x22')](_0x479bc4);return _0x197ec0[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x526cf3+'-'+_0x384319+'/'+_0x33161b)[_0x0a9e('0x29')](_0x40c424);}return null;};}function patchUpdates(_0x11c3b6){return function(_0x14de77){try{jsonpatch['apply'](_0x14de77,_0x11c3b6,!![]);}catch(_0x3652a7){return BPromise[_0x0a9e('0x2a')](_0x3652a7);}return _0x14de77[_0x0a9e('0x2b')]();};}function saveUpdates(_0x2ec755,_0x5c877d){return function(_0x15b200){if(_0x15b200){return _0x15b200[_0x0a9e('0x2c')](_0x2ec755)[_0x0a9e('0x18')](function(_0x824a4f){return _0x824a4f;});}return null;};}function removeEntity(_0x58b06f,_0x563b45){return function(_0x296f41){if(_0x296f41){return _0x296f41[_0x0a9e('0x2d')]()[_0x0a9e('0x18')](function(){_0x58b06f['status'](0xcc)[_0x0a9e('0x23')]();});}};}function handleEntityNotFound(_0x5d1e0e,_0x2407f9){return function(_0x3ae878){if(!_0x3ae878){_0x5d1e0e[_0x0a9e('0x21')](0x194);}return _0x3ae878;};}function handleError(_0x33bdb7,_0x25ce3a){_0x25ce3a=_0x25ce3a||0x1f4;return function(_0x5180f1){logger[_0x0a9e('0x1c')](_0x5180f1[_0x0a9e('0x2e')]);if(_0x5180f1[_0x0a9e('0x2f')]){delete _0x5180f1[_0x0a9e('0x2f')];}_0x33bdb7[_0x0a9e('0x22')](_0x25ce3a)[_0x0a9e('0x30')](_0x5180f1);};}exports[_0x0a9e('0x31')]=function(_0x39e565,_0x5583a4){var _0x44295a={},_0x5e7238={},_0x2cc7a0={'count':0x0,'rows':[]};var _0x14b13f=db[_0x0a9e('0x32')][_0x0a9e('0x33')];_0x5e7238['model']=_[_0x0a9e('0x34')](_[_0x0a9e('0x35')](_0x14b13f),[_0x0a9e('0x36'),_0x0a9e('0x37')]);var _0x4853b1={'dateStart':_0x39e565['query'][_0x0a9e('0x38')],'dateEnd':_0x39e565['query'][_0x0a9e('0x39')]};delete _0x39e565[_0x0a9e('0x3a')][_0x0a9e('0x38')];delete _0x39e565[_0x0a9e('0x3a')]['dateEnd'];_0x5e7238[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x39e565[_0x0a9e('0x3a')]);_0x5e7238['filters']=_[_0x0a9e('0x3b')](_0x5e7238[_0x0a9e('0x3c')],_0x5e7238[_0x0a9e('0x3a')]);_0x44295a['attributes']=_['intersection'](_0x5e7238[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x39e565['query'][_0x0a9e('0x3d')]));_0x44295a[_0x0a9e('0x3e')]=_0x44295a[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x44295a['attributes']:_0x5e7238['model'];if(!_0x39e565[_0x0a9e('0x3a')][_0x0a9e('0x40')]('nolimit')){_0x44295a[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x39e565[_0x0a9e('0x3a')]['limit']);_0x44295a[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x39e565[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}_0x44295a[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0x39e565[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x44295a[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x39e565[_0x0a9e('0x3a')],_0x5e7238[_0x0a9e('0x44')]));if(_0x4853b1[_0x0a9e('0x38')]){if(_0x4853b1[_0x0a9e('0x39')]){_0x4853b1['dateEnd']=moment(_0x4853b1['dateEnd'])[_0x0a9e('0x46')](0x1,_0x0a9e('0x47'));}else{_0x4853b1[_0x0a9e('0x39')]=moment(_0x4853b1[_0x0a9e('0x38')])[_0x0a9e('0x46')](0x1,_0x0a9e('0x47'));}_[_0x0a9e('0x48')](_0x44295a[_0x0a9e('0x43')],{'createdAt':{'$gte':_0x4853b1[_0x0a9e('0x38')],'$lte':_0x4853b1[_0x0a9e('0x39')]}});}if(_0x39e565[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x44295a['where']=_[_0x0a9e('0x48')](_0x44295a[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x44295a[_0x0a9e('0x3e')],function(_0x2e8caf){return db[_0x0a9e('0x4b')][_0x0a9e('0x43')](db[_0x0a9e('0x4b')]['fn']('lower',db[_0x0a9e('0x4b')]['col'](_0x2e8caf)),{'$like':db[_0x0a9e('0x4b')]['fn'](_0x0a9e('0x4c'),'%'+_0x39e565[_0x0a9e('0x3a')]['filter']+'%')});})});}_0x44295a=_[_0x0a9e('0x48')]({},_0x44295a,_0x39e565[_0x0a9e('0x4d')]);var _0x4774f4={'where':_0x44295a[_0x0a9e('0x43')]};return db[_0x0a9e('0x32')][_0x0a9e('0x24')](_0x4774f4)[_0x0a9e('0x18')](function(_0x5bbcde){_0x2cc7a0[_0x0a9e('0x24')]=_0x5bbcde;if(_0x39e565[_0x0a9e('0x3a')][_0x0a9e('0x4e')]){_0x44295a[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x32')][_0x0a9e('0x50')](_0x44295a);})[_0x0a9e('0x18')](function(_0x19383e){_0x2cc7a0[_0x0a9e('0x51')]=_0x19383e;return _0x2cc7a0;})['then'](respondWithFilteredResult(_0x5583a4,_0x44295a))[_0x0a9e('0x52')](handleError(_0x5583a4,null));};exports[_0x0a9e('0x53')]=function(_0x4f7240,_0x4ae14b){var _0x5ddf84={'raw':![],'where':{'id':_0x4f7240[_0x0a9e('0x54')]['id']}},_0x1adfee={};_0x1adfee[_0x0a9e('0x3c')]=_[_0x0a9e('0x34')](_[_0x0a9e('0x35')](db[_0x0a9e('0x32')][_0x0a9e('0x33')]),[_0x0a9e('0x36'),'salt']);_0x1adfee['query']=_['keys'](_0x4f7240[_0x0a9e('0x3a')]);_0x1adfee[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0x1adfee['model'],_0x1adfee[_0x0a9e('0x3a')]);_0x5ddf84[_0x0a9e('0x3e')]=_['intersection'](_0x1adfee['model'],qs[_0x0a9e('0x3d')](_0x4f7240['query'][_0x0a9e('0x3d')]));_0x5ddf84['attributes']=_0x5ddf84[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x5ddf84[_0x0a9e('0x3e')]:_0x1adfee['model'];if(_0x4f7240[_0x0a9e('0x3a')][_0x0a9e('0x4e')]){_0x5ddf84['include']=[{'all':!![]}];}_0x5ddf84=_['merge']({},_0x5ddf84,_0x4f7240[_0x0a9e('0x4d')]);return db[_0x0a9e('0x32')]['find'](_0x5ddf84)[_0x0a9e('0x18')](handleEntityNotFound(_0x4ae14b,null))['then'](respondWithResult(_0x4ae14b,null))[_0x0a9e('0x52')](handleError(_0x4ae14b,null));};exports['bulkCreate']=function(_0xe22ccc,_0x4a6deb){return db['User']['bulkCreate'](_0xe22ccc[_0x0a9e('0x55')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4a6deb,0xc9))[_0x0a9e('0x52')](handleError(_0x4a6deb,null));};exports[_0x0a9e('0x2c')]=function(_0x3cfd00,_0x19b4df){if(_0x3cfd00[_0x0a9e('0x55')]['id']){delete _0x3cfd00[_0x0a9e('0x55')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x3cfd00['params']['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x19b4df,null))[_0x0a9e('0x18')](saveUpdates(_0x3cfd00[_0x0a9e('0x55')],null))[_0x0a9e('0x18')](respondWithResult(_0x19b4df,null))[_0x0a9e('0x52')](handleError(_0x19b4df,null));};exports[_0x0a9e('0x57')]=function(_0x5d86e9,_0x956fbe){return db[_0x0a9e('0x32')]['describe']()[_0x0a9e('0x18')](respondWithResult(_0x956fbe,null))['catch'](handleError(_0x956fbe,null));};exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x4b3c1a,null))[_0x0a9e('0x18')](function(_0x7be420){if(_0x7be420){return _0x7be420[_0x0a9e('0x58')](_0x5ba1f9[_0x0a9e('0x55')]['ids'],_[_0x0a9e('0x59')](_0x5ba1f9['body'],[_0x0a9e('0x5a'),'id'])||{});}})[_0x0a9e('0x18')](respondWithResult(_0x4b3c1a,null))[_0x0a9e('0x52')](handleError(_0x4b3c1a,null));};var getLicense=function(_0x5adf8f){return new BPromise(function(_0x453360,_0x156f1c){var _0x119677=0x0;_0x5adf8f[_0x0a9e('0x55')]['role']===_0x0a9e('0x5b')&&_0x453360(_0x0a9e('0x5c'));return db['User'][_0x0a9e('0x24')]({'where':{'$or':[{'role':_0x5adf8f[_0x0a9e('0x55')][_0x0a9e('0x5d')]===_0x0a9e('0x5e')?_0x0a9e('0x5e'):['admin',_0x0a9e('0x5f')]}]}})[_0x0a9e('0x18')](function(_0x281c7d){_0x119677=_0x281c7d;return require('../../config/license/util')[_0x0a9e('0x60')]();})['then'](function(_0x5211e3){var _0x242745=_0x5adf8f[_0x0a9e('0x55')][_0x0a9e('0x5d')]===_0x0a9e('0x5e')?_0x0a9e('0x61'):_0x0a9e('0x62');if(!_[_0x0a9e('0x63')](_0x5211e3[_0x242745])&&_0x119677>=_0x5211e3[_0x242745]){return _0x156f1c({'message':_0x0a9e('0x64')});}return _0x453360(util[_0x0a9e('0x65')](_0x0a9e('0x66'),_0x242745,_0x119677));})[_0x0a9e('0x52')](function(_0x19012b){return _0x156f1c(_0x19012b);});});};exports[_0x0a9e('0x67')]=function(_0x2b8192,_0x320898){return getLicense(_0x2b8192)[_0x0a9e('0x18')](function(_0x2a28c0){if(!_0x2b8192[_0x0a9e('0x55')]['internal']){var _0x1b0b98;return db[_0x0a9e('0x68')][_0x0a9e('0x69')](0x1)['then'](function(_0x1148a1){_0x1b0b98=_0x1148a1[_0x0a9e('0x6a')];return db['User'][_0x0a9e('0x6b')](_0x0a9e('0x6c'));})[_0x0a9e('0x18')](function(_0x427946){if(_[_0x0a9e('0x63')](_0x427946)){if(_0x1b0b98){_0x2b8192['body']['internal']=_0x1b0b98;}else{_0x2b8192['body'][_0x0a9e('0x6c')]=0x1;}}else{if(_[_0x0a9e('0x63')](_0x1b0b98)||_0x1b0b98==_0x427946){_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x6c')]=_0x427946+0x1;}else if(_0x1b0b98>_0x427946){_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x6c')]=_0x1b0b98;}else{return db[_0x0a9e('0x4b')][_0x0a9e('0x3a')]('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[_0x0a9e('0x4b')][_0x0a9e('0x6d')][_0x0a9e('0x6e')]})['then'](function(_0x2bdc44){if(_0x2bdc44&&_0x2bdc44['length']){for(var _0x4437ff=0x0,_0x44351d=_0x2bdc44['length'];_0x4437ff<_0x44351d&&_[_0x0a9e('0x63')](_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x6c')]);_0x4437ff++){if(_0x1b0b98<=_0x2bdc44[_0x4437ff][_0x0a9e('0x6f')]){_0x2b8192['body'][_0x0a9e('0x6c')]=_0x2bdc44[_0x4437ff][_0x0a9e('0x6f')];}else if(_0x1b0b98>_0x2bdc44[_0x4437ff][_0x0a9e('0x6f')]&&_0x1b0b98<=_0x2bdc44[_0x4437ff]['to']){_0x2b8192[_0x0a9e('0x55')]['internal']=_0x1b0b98;}}}if(_[_0x0a9e('0x63')](_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x6c')])){_0x2b8192[_0x0a9e('0x55')]['internal']=_0x427946+0x1;}});}}});}})[_0x0a9e('0x18')](function(){if(_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x70')]){_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x71')]=_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x6c')];_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x72')]={'mailbox':_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x6c')],'password':_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x36')],'fullname':_0x2b8192[_0x0a9e('0x55')]['fullname'],'email':_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x73')]};}if(_0x2b8192[_0x0a9e('0x55')]&&_0x2b8192['body'][_0x0a9e('0x5d')]===_0x0a9e('0x5b')){_0x2b8192[_0x0a9e('0x55')][_0x0a9e('0x74')]=['101','102',_0x0a9e('0x75'),_0x0a9e('0x76'),'104',_0x0a9e('0x77'),'106',_0x0a9e('0x78'),_0x0a9e('0x79'),'109',_0x0a9e('0x7a'),_0x0a9e('0x7b')];}return db[_0x0a9e('0x32')][_0x0a9e('0x67')](_0x2b8192[_0x0a9e('0x55')],{'include':[{'model':db[_0x0a9e('0x72')],'as':_0x0a9e('0x72')}]});})['then'](respondWithResult(_0x320898,0xc9))[_0x0a9e('0x52')](handleError(_0x320898,null));};exports[_0x0a9e('0x7c')]=function(_0x45c109,_0x16e5b9,_0x492543){if(_0x45c109[_0x0a9e('0x55')]['id']){delete _0x45c109[_0x0a9e('0x55')]['id'];}return db['User'][_0x0a9e('0x56')]({'where':{'id':_0x45c109['params']['id']}})[_0x0a9e('0x18')](function(_0x2bb25a){if(_0x2bb25a){if(_0x2bb25a['id']==_0x45c109[_0x0a9e('0x5f')]['id']){if(!_0x45c109[_0x0a9e('0x55')]['oldPassword']||!_0x45c109['body'][_0x0a9e('0x7d')]){throw new db[(_0x0a9e('0x7e'))][(_0x0a9e('0x7f'))]('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x2bb25a[_0x0a9e('0x80')](_0x45c109[_0x0a9e('0x55')]['oldPassword'])){throw new db['Sequelize'][(_0x0a9e('0x7f'))]('Wrong\x20credentials');}if(_0x45c109['body']['oldPassword']==_0x45c109[_0x0a9e('0x55')][_0x0a9e('0x7d')]){throw new db[(_0x0a9e('0x7e'))][(_0x0a9e('0x7f'))](_0x0a9e('0x81'));}return _0x2bb25a;}else if(_0x45c109[_0x0a9e('0x5f')]['role']==_0x0a9e('0x82')){if(!_0x45c109['body'][_0x0a9e('0x7d')]){throw new db[(_0x0a9e('0x7e'))][(_0x0a9e('0x7f'))](_0x0a9e('0x83'));}return _0x2bb25a;}else if(_0x45c109['user'][_0x0a9e('0x5d')]==_0x0a9e('0x5f')){if(!_0x45c109[_0x0a9e('0x55')]['newPassword']){throw new db[(_0x0a9e('0x7e'))][(_0x0a9e('0x7f'))](_0x0a9e('0x83'));}if(_0x2bb25a[_0x0a9e('0x5d')]!=_0x0a9e('0x5b')){throw new db[(_0x0a9e('0x7e'))][(_0x0a9e('0x7f'))](_0x0a9e('0x84'));}return _0x2bb25a;}else{throw new db['Sequelize'][(_0x0a9e('0x7f'))](_0x0a9e('0x84'));}}return null;})['then'](handleEntityNotFound(_0x16e5b9,null))[_0x0a9e('0x18')](saveUpdates({'password':_0x45c109[_0x0a9e('0x55')][_0x0a9e('0x7d')],'passwordResetAt':_0x45c109['user']['id']==_0x45c109[_0x0a9e('0x54')]['id']?moment():null},null))['then'](respondWithResult(_0x16e5b9,null))[_0x0a9e('0x52')](handleError(_0x16e5b9,null));};exports[_0x0a9e('0x85')]=function(_0x558a87,_0x1f29bd,_0x842d6f){var _0x16341a;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x558a87['params']['id']},'attributes':['id',_0x0a9e('0x2f'),_0x0a9e('0x5d'),_0x0a9e('0x86'),_0x0a9e('0x87')]})[_0x0a9e('0x18')](handleEntityNotFound(_0x1f29bd,null))[_0x0a9e('0x18')](function(_0x6803d6){if(_0x6803d6){_0x16341a=_0x6803d6;if(!utils[_0x0a9e('0x88')](_0x558a87[_0x0a9e('0x55')][_0x0a9e('0x89')])){throw new db[(_0x0a9e('0x7e'))][(_0x0a9e('0x7f'))](_0x0a9e('0x8a'));}return _0x6803d6['add'+_[_0x0a9e('0x8b')](_0x558a87[_0x0a9e('0x55')][_0x0a9e('0x89')][_0x0a9e('0x8c')]())+_0x0a9e('0x8d')](_0x558a87['body'][_0x0a9e('0x5a')],{'penalty':_0x558a87[_0x0a9e('0x55')]['penalty']||0x0});}})[_0x0a9e('0x18')](function(){if(_0x558a87['body'][_0x0a9e('0x89')]===_0x0a9e('0x8e')){return db[_0x0a9e('0x8f')][_0x0a9e('0x50')]({'where':{'id':_0x558a87['body'][_0x0a9e('0x5a')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x0a9e('0x18')](function(_0x3d0a77){var _0x5e5b89=[];if(_0x558a87[_0x0a9e('0x55')][_0x0a9e('0x89')]===_0x0a9e('0x8e')&&_0x16341a['role']==='agent'){for(var _0x1b82b7=0x0;_0x1b82b7<_0x3d0a77[_0x0a9e('0x3f')];_0x1b82b7+=0x1){_0x5e5b89[_0x0a9e('0x90')]({'membername':_0x16341a[_0x0a9e('0x2f')],'UserId':_0x16341a['id'],'queue_name':_0x3d0a77[_0x1b82b7][_0x0a9e('0x2f')],'VoiceQueueId':_0x3d0a77[_0x1b82b7]['id'],'interface':util[_0x0a9e('0x65')](_0x0a9e('0x91'),_0x0a9e('0x92'),_0x16341a[_0x0a9e('0x2f')]),'paused':_0x16341a['voicePause']||![],'penalty':_0x558a87[_0x0a9e('0x55')]['penalty']||0x0});}return BPromise[_0x0a9e('0x93')](_0x5e5b89,function(_0x2f7791){return db[_0x0a9e('0x94')][_0x0a9e('0x95')](_0x2f7791);});}return _0x16341a;})[_0x0a9e('0x18')](respondWithStatusCode(_0x1f29bd,null))['catch'](handleError(_0x1f29bd,null));};exports[_0x0a9e('0x96')]=function(_0x4667bf,_0x2791c5,_0x2aa5f2){var _0x2263f1;return db['User']['find']({'where':{'id':_0x4667bf[_0x0a9e('0x54')]['id']},'attributes':['id','name',_0x0a9e('0x5d')]})[_0x0a9e('0x18')](handleEntityNotFound(_0x2791c5,null))[_0x0a9e('0x18')](function(_0x16313e){if(_0x16313e){_0x2263f1=_0x16313e;if(!_0x4667bf[_0x0a9e('0x3a')][_0x0a9e('0x89')]||!utils['isValidChannel'](_0x4667bf['query'][_0x0a9e('0x89')])){throw new db['Sequelize'][(_0x0a9e('0x7f'))]('Unknown\x20channel');}return _0x16313e[_0x0a9e('0x97')+_['capitalize'](_0x4667bf['query'][_0x0a9e('0x89')][_0x0a9e('0x8c')]())+'Queues'](_0x4667bf[_0x0a9e('0x3a')][_0x0a9e('0x5a')]);}})[_0x0a9e('0x18')](function(_0xa1bc84){if(_0x4667bf[_0x0a9e('0x3a')]['channel']==='voice'){return db[_0x0a9e('0x94')][_0x0a9e('0x2d')]({'where':{'UserId':_0x4667bf[_0x0a9e('0x54')]['id'],'VoiceQueueId':_0x4667bf[_0x0a9e('0x3a')][_0x0a9e('0x5a')]},'individualHooks':!![]})['then'](function(){return _0x2263f1;});}return _0x2263f1;})[_0x0a9e('0x18')](respondWithStatusCode(_0x2791c5,null))[_0x0a9e('0x52')](handleError(_0x2791c5,null));};exports['addAvatar']=function(_0x3c313d,_0x19fd11,_0xcacabb){_0x3c313d[_0x0a9e('0x55')][_0x0a9e('0x98')]=_0x3c313d[_0x0a9e('0x99')][_0x0a9e('0x9a')];return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x3c313d[_0x0a9e('0x54')]['id']}})['then'](handleEntityNotFound(_0x19fd11,null))[_0x0a9e('0x18')](saveUpdates(_0x3c313d[_0x0a9e('0x55')],null))[_0x0a9e('0x18')](respondWithResult(_0x19fd11,null))[_0x0a9e('0x52')](handleError(_0x19fd11,null));};exports[_0x0a9e('0x9b')]=function(_0x547e37,_0x500868,_0x21902c){var _0x16ae1a=path[_0x0a9e('0x9c')](config[_0x0a9e('0x9d')],_0x0a9e('0x9e'));return db['User'][_0x0a9e('0x56')]({'where':{'id':_0x547e37[_0x0a9e('0x54')]['id']},'attributes':['id',_0x0a9e('0x98')],'raw':!![]})['then'](handleEntityNotFound(_0x500868,null))[_0x0a9e('0x18')](function(_0x59aa7b){if(_0x59aa7b){if(_[_0x0a9e('0x63')](_0x59aa7b['userpic'])){return _0x500868[_0x0a9e('0x9f')](_0x16ae1a);}else{if(!fs[_0x0a9e('0xa0')](path[_0x0a9e('0x9c')](config['root'],_0x0a9e('0xa1'),_0x59aa7b['userpic']))){return _0x500868[_0x0a9e('0x9f')](_0x16ae1a);}return _0x500868[_0x0a9e('0x9f')](path[_0x0a9e('0x9c')](config[_0x0a9e('0x9d')],_0x0a9e('0xa1'),_0x59aa7b[_0x0a9e('0x98')]));}}})[_0x0a9e('0x52')](handleError(_0x500868,null));};exports[_0x0a9e('0xa2')]=function(_0x2aaf07,_0x27d1f5,_0x4262d0){var _0xc876d4;var _0x2415fe={'where':{}},_0x399def={},_0x98c62c={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x2aaf07['params']['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x27d1f5,null))['then'](function(_0x1d999b){if(_0x1d999b){_0xc876d4=_0x1d999b;_0x2415fe[_0x0a9e('0x43')]['UserId']=_0x1d999b['id'];return db[_0x0a9e('0xa3')][_0x0a9e('0x57')]();}})[_0x0a9e('0x18')](function(_0x18adc8){if(_0x18adc8){_0x399def['model']=_[_0x0a9e('0x35')](_0x18adc8);_0x399def[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x2aaf07[_0x0a9e('0x3a')]);_0x399def['filters']=_[_0x0a9e('0x3b')](_0x399def[_0x0a9e('0x3c')],_0x399def[_0x0a9e('0x3a')]);_0x2415fe['attributes']=_[_0x0a9e('0x3b')](_0x399def[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x2aaf07['query'][_0x0a9e('0x3d')]));_0x2415fe[_0x0a9e('0x3e')]=_0x2415fe[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x2415fe[_0x0a9e('0x3e')]:_0x399def['model'];if(!_0x2aaf07[_0x0a9e('0x3a')][_0x0a9e('0x40')]('nolimit')){_0x2415fe[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x2aaf07[_0x0a9e('0x3a')]['limit']);_0x2415fe['offset']=qs['offset'](_0x2aaf07[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}_0x2415fe['order']=qs[_0x0a9e('0x42')](_0x2aaf07[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x2415fe['where']=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x2aaf07[_0x0a9e('0x3a')],_0x399def[_0x0a9e('0x44')]));if(_0x2aaf07[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x2415fe[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x2415fe[_0x0a9e('0x43')],{'$or':_['map'](_0x2415fe[_0x0a9e('0x3e')],function(_0x5526a7){var _0x138cf5={};_0x138cf5[_0x5526a7]={'$like':'%'+_0x2aaf07[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x138cf5;})});}_0x2415fe=_[_0x0a9e('0x48')]({},_0x2415fe,_0x2aaf07[_0x0a9e('0x4d')]);return _0xc876d4[_0x0a9e('0xa2')](_['pick'](_0x2415fe,[_0x0a9e('0x43')]))[_0x0a9e('0x18')](function(_0xe25eb5){_0x98c62c[_0x0a9e('0x24')]=_0xe25eb5['length']||0x0;if(_0x2aaf07[_0x0a9e('0x3a')][_0x0a9e('0x4e')]){_0x2415fe[_0x0a9e('0x4f')]=[{'all':!![]}];}return _0xc876d4[_0x0a9e('0xa2')](_0x2415fe);})[_0x0a9e('0x18')](function(_0x2be526){_0x98c62c[_0x0a9e('0x51')]=_0x2be526;return _0x98c62c;});}})[_0x0a9e('0x18')](respondWithFilteredResult(_0x27d1f5,_0x2415fe))[_0x0a9e('0x52')](handleError(_0x27d1f5,null));};exports[_0x0a9e('0xa4')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){var _0x2ff265;var _0x26b826;var _0xea8bd1={};var _0x253f74;return db[_0x0a9e('0x32')][_0x0a9e('0xa5')]({'where':{'id':_0x57f0ad['params']['id']},'attributes':['id',_0x0a9e('0x2f'),_0x0a9e('0x5d')]})[_0x0a9e('0x18')](handleEntityNotFound(_0x2272bc,null))['then'](function(_0x1402c7){if(!utils[_0x0a9e('0x88')](_0x57f0ad[_0x0a9e('0x3a')][_0x0a9e('0x89')])){throw new db[(_0x0a9e('0x7e'))][(_0x0a9e('0x7f'))](_0x0a9e('0x8a'));}_0x2ff265=_0x1402c7;var _0x336a19={};_0x336a19[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db[_['capitalize'](_0x57f0ad[_0x0a9e('0x3a')][_0x0a9e('0x89')])+_0x0a9e('0xa6')][_0x0a9e('0x33')]);_0x336a19[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x57f0ad['query']);_0x336a19[_0x0a9e('0x44')]=_['intersection'](_0x336a19['model'],_0x336a19['query']);_0xea8bd1[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x336a19[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x57f0ad['query'][_0x0a9e('0x3d')]));_0xea8bd1[_0x0a9e('0x3e')]=_0xea8bd1[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0xea8bd1[_0x0a9e('0x3e')]:_0x336a19['model'];_0xea8bd1['order']=qs[_0x0a9e('0x42')](_0x57f0ad[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0xea8bd1['where']=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x57f0ad[_0x0a9e('0x3a')],_0x336a19['filters']));if(_0x57f0ad[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0xea8bd1[_0x0a9e('0x43')]=_['merge'](_0xea8bd1[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0xea8bd1[_0x0a9e('0x3e')],function(_0x549e03){var _0x549697={};_0x549697[_0x549e03]={'$like':'%'+_0x57f0ad['query'][_0x0a9e('0x49')]+'%'};return _0x549697;})});}_0xea8bd1=_[_0x0a9e('0x48')]({},_0xea8bd1,_0x57f0ad[_0x0a9e('0x4d')]);switch(_0x2ff265[_0x0a9e('0x5d')]){case'admin':return db[_[_0x0a9e('0x8b')](_0x57f0ad['query'][_0x0a9e('0x89')])+_0x0a9e('0xa6')][_0x0a9e('0x50')](_0xea8bd1);case'user':case _0x0a9e('0x5b'):return _0x2ff265[_0x0a9e('0xa7')+_[_0x0a9e('0x8b')](_0x57f0ad['query'][_0x0a9e('0x89')])+'Queues'](_0xea8bd1);default:throw new db[(_0x0a9e('0x7e'))]['ValidationError'](_0x0a9e('0xa8'));}})['then'](function(_0xb14971){_0x253f74=_0xb14971[_0x0a9e('0x3f')];if(!_0x57f0ad[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0xea8bd1[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x57f0ad['query'][_0x0a9e('0x26')]);_0xea8bd1[_0x0a9e('0x25')]=qs['offset'](_0x57f0ad[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}switch(_0x2ff265['role']){case _0x0a9e('0x82'):return db[_[_0x0a9e('0x8b')](_0x57f0ad[_0x0a9e('0x3a')]['channel'])+_0x0a9e('0xa6')][_0x0a9e('0x50')](_0xea8bd1);case _0x0a9e('0x5f'):case _0x0a9e('0x5b'):return _0x2ff265[_0x0a9e('0xa7')+_[_0x0a9e('0x8b')](_0x57f0ad[_0x0a9e('0x3a')][_0x0a9e('0x89')])+_0x0a9e('0x8d')](_0xea8bd1);}})[_0x0a9e('0x18')](function(_0x56e148){return{'count':_0x253f74,'rows':_0x56e148};})[_0x0a9e('0x18')](respondWithResult(_0x2272bc,null))['catch'](handleError(_0x2272bc,null));};exports[_0x0a9e('0xaa')]=function(_0x2968e2,_0x5b9c76,_0x315e31){var _0x5d577b={};var _0x2d45db={};var _0x5691ac;var _0x119708;return db[_0x0a9e('0x32')][_0x0a9e('0xa5')]({'where':{'id':_0x2968e2['params']['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x5b9c76,null))[_0x0a9e('0x18')](function(_0x4435d2){if(_0x4435d2){_0x5691ac=_0x4435d2;_0x2d45db[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db[_0x0a9e('0x94')][_0x0a9e('0x33')]);_0x2d45db['query']=_[_0x0a9e('0x35')](_0x2968e2[_0x0a9e('0x3a')]);_0x2d45db[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0x2d45db[_0x0a9e('0x3c')],_0x2d45db[_0x0a9e('0x3a')]);_0x5d577b[_0x0a9e('0x3e')]=_['intersection'](_0x2d45db['model'],qs[_0x0a9e('0x3d')](_0x2968e2[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x5d577b[_0x0a9e('0x3e')]=_0x5d577b[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x5d577b[_0x0a9e('0x3e')]:_0x2d45db['model'];_0x5d577b[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0x2968e2[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x5d577b[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x2968e2['query'],_0x2d45db[_0x0a9e('0x44')]));if(_0x2968e2[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x5d577b['where']=_[_0x0a9e('0x48')](_0x5d577b[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x5d577b[_0x0a9e('0x3e')],function(_0x5c8dc4){var _0x38892b={};_0x38892b[_0x5c8dc4]={'$like':'%'+_0x2968e2[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x38892b;})});}_0x5d577b=_[_0x0a9e('0x48')]({},_0x5d577b,_0x2968e2[_0x0a9e('0x4d')]);return _0x5691ac[_0x0a9e('0xaa')](_0x5d577b);}})[_0x0a9e('0x18')](function(_0x385e5d){if(_0x385e5d){_0x119708=_0x385e5d['length'];if(!_0x2968e2[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x5d577b[_0x0a9e('0x26')]=qs['limit'](_0x2968e2['query'][_0x0a9e('0x26')]);_0x5d577b[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x2968e2['query'][_0x0a9e('0x25')]);}return _0x5691ac[_0x0a9e('0xaa')](_0x5d577b);}})['then'](function(_0x1970f1){if(_0x1970f1){return _0x1970f1?{'count':_0x119708,'rows':_0x1970f1}:null;}})['then'](respondWithResult(_0x5b9c76,null))[_0x0a9e('0x52')](handleError(_0x5b9c76,null));};exports['getGroups']=function(_0x5b42b9,_0x48eaa3,_0xad4d10){var _0x4297d1={};var _0x19f800={};var _0x20007e;var _0x7d59a9;return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x5b42b9[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x48eaa3,null))[_0x0a9e('0x18')](function(_0xd18f82){if(_0xd18f82){_0x20007e=_0xd18f82;_0x19f800[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db[_0x0a9e('0xab')]['rawAttributes']);_0x19f800['query']=_[_0x0a9e('0x35')](_0x5b42b9['query']);_0x19f800[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0x19f800[_0x0a9e('0x3c')],_0x19f800[_0x0a9e('0x3a')]);_0x4297d1[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x19f800['model'],qs[_0x0a9e('0x3d')](_0x5b42b9['query']['fields']));_0x4297d1[_0x0a9e('0x3e')]=_0x4297d1['attributes'][_0x0a9e('0x3f')]?_0x4297d1['attributes']:_0x19f800['model'];_0x4297d1[_0x0a9e('0x41')]=qs['sort'](_0x5b42b9[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x4297d1[_0x0a9e('0x43')]=qs['filters'](_[_0x0a9e('0x45')](_0x5b42b9[_0x0a9e('0x3a')],_0x19f800[_0x0a9e('0x44')]));if(_0x5b42b9['query']['filter']){_0x4297d1[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x4297d1[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x4297d1[_0x0a9e('0x3e')],function(_0x376b97){var _0x247a6c={};_0x247a6c[_0x376b97]={'$like':'%'+_0x5b42b9[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x247a6c;})});}_0x4297d1=_[_0x0a9e('0x48')]({},_0x4297d1,_0x5b42b9['options']);return _0x20007e['getGroups'](_0x4297d1);}})['then'](function(_0x5975fa){if(_0x5975fa){_0x7d59a9=_0x5975fa[_0x0a9e('0x3f')];if(!_0x5b42b9[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x4297d1[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x5b42b9[_0x0a9e('0x3a')]['limit']);_0x4297d1['offset']=qs[_0x0a9e('0x25')](_0x5b42b9[_0x0a9e('0x3a')]['offset']);}return _0x20007e[_0x0a9e('0xac')](_0x4297d1);}})[_0x0a9e('0x18')](function(_0x2e2280){if(_0x2e2280){return _0x2e2280?{'count':_0x7d59a9,'rows':_0x2e2280}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x48eaa3,null))[_0x0a9e('0x52')](handleError(_0x48eaa3,null));};exports[_0x0a9e('0xad')]=function(_0x167196,_0x262281,_0x59f8f7){var _0x400800={'raw':!![],'where':{}};var _0xbd1af3={};var _0x20e191={'count':0x0,'rows':[]};return db['User'][_0x0a9e('0xa5')]({'where':{'id':_0x167196[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x262281,null))[_0x0a9e('0x18')](function(_0x26129c){if(_0x26129c){_0xbd1af3[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db[_0x0a9e('0xae')][_0x0a9e('0x33')]);_0xbd1af3[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x167196[_0x0a9e('0x3a')]);_0xbd1af3['filters']=_['intersection'](_0xbd1af3[_0x0a9e('0x3c')],_0xbd1af3[_0x0a9e('0x3a')]);_0x400800[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0xbd1af3[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x167196[_0x0a9e('0x3a')]['fields']));_0x400800[_0x0a9e('0x3e')]=_0x400800['attributes'][_0x0a9e('0x3f')]?_0x400800[_0x0a9e('0x3e')]:_0xbd1af3[_0x0a9e('0x3c')];if(!_0x167196[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x400800[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x167196[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x400800[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x167196[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}_0x400800[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0x167196['query']['sort']);_0x400800[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_['pick'](_0x167196['query'],_0xbd1af3[_0x0a9e('0x44')]));_0x400800[_0x0a9e('0x43')][_0x0a9e('0xaf')]=_0x26129c['id'];if(_0x167196['query'][_0x0a9e('0x49')]){_0x400800['where']=_[_0x0a9e('0x48')](_0x400800['where'],{'$or':_[_0x0a9e('0x4a')](_0x400800['attributes'],function(_0x122e7d){var _0x21e210={};_0x21e210[_0x122e7d]={'$like':'%'+_0x167196[_0x0a9e('0x3a')]['filter']+'%'};return _0x21e210;})});}_0x400800=_[_0x0a9e('0x48')]({},_0x400800,_0x167196['options']);return db['VoiceRecording'][_0x0a9e('0x24')]({'where':_0x400800[_0x0a9e('0x43')]})[_0x0a9e('0x18')](function(_0x1542e8){_0x20e191[_0x0a9e('0x24')]=_0x1542e8;if(_0x167196[_0x0a9e('0x3a')][_0x0a9e('0x4e')]){_0x400800[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0xae')][_0x0a9e('0x50')](_0x400800);})[_0x0a9e('0x18')](function(_0x98bf26){_0x20e191[_0x0a9e('0x51')]=_0x98bf26;return _0x20e191;});}})[_0x0a9e('0x18')](respondWithFilteredResult(_0x262281,_0x400800))[_0x0a9e('0x52')](handleError(_0x262281,null));};exports[_0x0a9e('0xb0')]=function(_0x310026,_0x643f66,_0x153de1){var _0x51a987={};var _0x233e48={};var _0xf780f5;var _0x543b30;return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x310026['params']['id']}})['then'](handleEntityNotFound(_0x643f66,null))[_0x0a9e('0x18')](function(_0x55926d){if(_0x55926d){_0xf780f5=_0x55926d;_0x233e48[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db[_0x0a9e('0xb1')][_0x0a9e('0x33')]);_0x233e48[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x310026[_0x0a9e('0x3a')]);_0x233e48[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0x233e48[_0x0a9e('0x3c')],_0x233e48['query']);_0x51a987[_0x0a9e('0x3e')]=_['intersection'](_0x233e48[_0x0a9e('0x3c')],qs['fields'](_0x310026[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x51a987[_0x0a9e('0x3e')]=_0x51a987['attributes'][_0x0a9e('0x3f')]?_0x51a987[_0x0a9e('0x3e')]:_0x233e48['model'];_0x51a987['order']=qs[_0x0a9e('0x42')](_0x310026[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x51a987['where']=qs['filters'](_['pick'](_0x310026[_0x0a9e('0x3a')],_0x233e48[_0x0a9e('0x44')]));if(_0x310026[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x51a987[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x51a987[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x51a987[_0x0a9e('0x3e')],function(_0x18e38b){var _0xc9669d={};_0xc9669d[_0x18e38b]={'$like':'%'+_0x310026[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0xc9669d;})});}_0x51a987=_[_0x0a9e('0x48')]({},_0x51a987,_0x310026[_0x0a9e('0x4d')]);return _0xf780f5[_0x0a9e('0xb0')](_0x51a987);}})[_0x0a9e('0x18')](function(_0x320367){if(_0x320367){_0x543b30=_0x320367['length'];if(!_0x310026[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x51a987[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x310026[_0x0a9e('0x3a')]['limit']);_0x51a987[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x310026[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}return _0xf780f5[_0x0a9e('0xb0')](_0x51a987);}})[_0x0a9e('0x18')](function(_0x103ad9){if(_0x103ad9){return _0x103ad9?{'count':_0x543b30,'rows':_0x103ad9}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x643f66,null))[_0x0a9e('0x52')](handleError(_0x643f66,null));};exports['getOpenchannelInteractions']=function(_0x5d27c1,_0x44a189,_0x3a0b30){var _0x5c2996={};var _0x1f52b4={};var _0x306aa5;var _0x4c8d75;return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x5d27c1[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x44a189,null))['then'](function(_0x27a41c){if(_0x27a41c){_0x306aa5=_0x27a41c;_0x1f52b4[_0x0a9e('0x3c')]=_['keys'](db[_0x0a9e('0xb2')][_0x0a9e('0x33')]);_0x1f52b4['query']=_[_0x0a9e('0x35')](_0x5d27c1[_0x0a9e('0x3a')]);_0x1f52b4[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0x1f52b4[_0x0a9e('0x3c')],_0x1f52b4[_0x0a9e('0x3a')]);_0x5c2996['attributes']=_[_0x0a9e('0x3b')](_0x1f52b4[_0x0a9e('0x3c')],qs['fields'](_0x5d27c1[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x5c2996[_0x0a9e('0x3e')]=_0x5c2996[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x5c2996[_0x0a9e('0x3e')]:_0x1f52b4[_0x0a9e('0x3c')];_0x5c2996['order']=qs['sort'](_0x5d27c1['query']['sort']);_0x5c2996['where']=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x5d27c1['query'],_0x1f52b4['filters']));if(_0x5d27c1[_0x0a9e('0x3a')]['filter']){_0x5c2996[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x5c2996[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x5c2996[_0x0a9e('0x3e')],function(_0x14a683){var _0x49b97a={};_0x49b97a[_0x14a683]={'$like':'%'+_0x5d27c1[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x49b97a;})});}_0x5c2996=_['merge']({},_0x5c2996,_0x5d27c1[_0x0a9e('0x4d')]);return _0x306aa5[_0x0a9e('0xb3')](_0x5c2996);}})[_0x0a9e('0x18')](function(_0x2b3734){if(_0x2b3734){_0x4c8d75=_0x2b3734[_0x0a9e('0x3f')];if(!_0x5d27c1[_0x0a9e('0x3a')][_0x0a9e('0x40')]('nolimit')){_0x5c2996[_0x0a9e('0x26')]=qs['limit'](_0x5d27c1[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x5c2996['offset']=qs[_0x0a9e('0x25')](_0x5d27c1[_0x0a9e('0x3a')]['offset']);}return _0x306aa5[_0x0a9e('0xb3')](_0x5c2996);}})['then'](function(_0x4552b5){if(_0x4552b5){return _0x4552b5?{'count':_0x4c8d75,'rows':_0x4552b5}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x44a189,null))['catch'](handleError(_0x44a189,null));};exports[_0x0a9e('0xb4')]=function(_0x4a9682,_0x1d046c,_0x179137){var _0x732141={'raw':!![],'where':{}};var _0x37ef45={};var _0x288127={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')][_0x0a9e('0xa5')]({'where':{'id':_0x4a9682['params']['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x1d046c,null))[_0x0a9e('0x18')](function(_0x17854b){if(_0x17854b){_0x37ef45[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db['MailInteraction'][_0x0a9e('0x33')]);_0x37ef45['query']=_['keys'](_0x4a9682[_0x0a9e('0x3a')]);_0x37ef45['filters']=_[_0x0a9e('0x3b')](_0x37ef45[_0x0a9e('0x3c')],_0x37ef45['query']);_0x732141[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x37ef45[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x4a9682[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x732141[_0x0a9e('0x3e')]=_0x732141[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x732141['attributes']:_0x37ef45[_0x0a9e('0x3c')];if(!_0x4a9682[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x732141['limit']=qs[_0x0a9e('0x26')](_0x4a9682[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x732141['offset']=qs[_0x0a9e('0x25')](_0x4a9682[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}_0x732141['order']=qs[_0x0a9e('0x42')](_0x4a9682['query'][_0x0a9e('0x42')]);_0x732141[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x4a9682[_0x0a9e('0x3a')],_0x37ef45[_0x0a9e('0x44')]));_0x732141[_0x0a9e('0x43')]['UserId']=_0x17854b['id'];if(_0x4a9682[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x732141[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x732141[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x732141[_0x0a9e('0x3e')],function(_0x2670f5){var _0x2310ca={};_0x2310ca[_0x2670f5]={'$like':'%'+_0x4a9682[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x2310ca;})});}_0x732141=_[_0x0a9e('0x48')]({},_0x732141,_0x4a9682[_0x0a9e('0x4d')]);return db[_0x0a9e('0xb5')][_0x0a9e('0x24')]({'where':_0x732141[_0x0a9e('0x43')]})[_0x0a9e('0x18')](function(_0x28932f){_0x288127[_0x0a9e('0x24')]=_0x28932f;if(_0x4a9682[_0x0a9e('0x3a')][_0x0a9e('0x4e')]){_0x732141[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0xb5')]['findAll'](_0x732141);})[_0x0a9e('0x18')](function(_0x148ca9){_0x288127[_0x0a9e('0x51')]=_0x148ca9;return _0x288127;});}})['then'](respondWithFilteredResult(_0x1d046c,_0x732141))[_0x0a9e('0x52')](handleError(_0x1d046c,null));};exports['getSmsInteractions']=function(_0xf007cd,_0xf2f758,_0x20a292){var _0x39c4da={};var _0x455bca={};var _0xb09ef6;var _0x3f431b;return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0xf007cd[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0xf2f758,null))['then'](function(_0x27732c){if(_0x27732c){_0xb09ef6=_0x27732c;_0x455bca[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db['SmsInteraction'][_0x0a9e('0x33')]);_0x455bca[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0xf007cd[_0x0a9e('0x3a')]);_0x455bca['filters']=_[_0x0a9e('0x3b')](_0x455bca[_0x0a9e('0x3c')],_0x455bca[_0x0a9e('0x3a')]);_0x39c4da[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x455bca['model'],qs[_0x0a9e('0x3d')](_0xf007cd[_0x0a9e('0x3a')]['fields']));_0x39c4da[_0x0a9e('0x3e')]=_0x39c4da[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x39c4da['attributes']:_0x455bca['model'];_0x39c4da[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0xf007cd[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x39c4da[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0xf007cd[_0x0a9e('0x3a')],_0x455bca['filters']));if(_0xf007cd['query'][_0x0a9e('0x49')]){_0x39c4da['where']=_[_0x0a9e('0x48')](_0x39c4da[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x39c4da[_0x0a9e('0x3e')],function(_0x57b11b){var _0x34229f={};_0x34229f[_0x57b11b]={'$like':'%'+_0xf007cd[_0x0a9e('0x3a')]['filter']+'%'};return _0x34229f;})});}_0x39c4da=_[_0x0a9e('0x48')]({},_0x39c4da,_0xf007cd['options']);return _0xb09ef6[_0x0a9e('0xb6')](_0x39c4da);}})[_0x0a9e('0x18')](function(_0xd63c87){if(_0xd63c87){_0x3f431b=_0xd63c87[_0x0a9e('0x3f')];if(!_0xf007cd[_0x0a9e('0x3a')][_0x0a9e('0x40')]('nolimit')){_0x39c4da[_0x0a9e('0x26')]=qs['limit'](_0xf007cd[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x39c4da[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0xf007cd[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}return _0xb09ef6[_0x0a9e('0xb6')](_0x39c4da);}})['then'](function(_0x37d9b9){if(_0x37d9b9){return _0x37d9b9?{'count':_0x3f431b,'rows':_0x37d9b9}:null;}})[_0x0a9e('0x18')](respondWithResult(_0xf2f758,null))[_0x0a9e('0x52')](handleError(_0xf2f758,null));};exports[_0x0a9e('0xb7')]=function(_0x132d6d,_0x534f61,_0x3cd588){var _0x2eea54={};var _0x488d6c={};var _0x55bb89;var _0x2240ea;return db[_0x0a9e('0x32')][_0x0a9e('0xa5')]({'where':{'id':_0x132d6d[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x534f61,null))[_0x0a9e('0x18')](function(_0x4d35ed){if(_0x4d35ed){_0x55bb89=_0x4d35ed;_0x488d6c[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db[_0x0a9e('0xb8')]['rawAttributes']);_0x488d6c[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x132d6d[_0x0a9e('0x3a')]);_0x488d6c[_0x0a9e('0x44')]=_['intersection'](_0x488d6c['model'],_0x488d6c[_0x0a9e('0x3a')]);_0x2eea54[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x488d6c[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x132d6d[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x2eea54[_0x0a9e('0x3e')]=_0x2eea54['attributes'][_0x0a9e('0x3f')]?_0x2eea54['attributes']:_0x488d6c[_0x0a9e('0x3c')];_0x2eea54[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0x132d6d['query']['sort']);_0x2eea54[_0x0a9e('0x43')]=qs['filters'](_[_0x0a9e('0x45')](_0x132d6d['query'],_0x488d6c['filters']));if(_0x132d6d[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x2eea54[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x2eea54[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x2eea54[_0x0a9e('0x3e')],function(_0x36287b){var _0x106e04={};_0x106e04[_0x36287b]={'$like':'%'+_0x132d6d[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x106e04;})});}_0x2eea54=_[_0x0a9e('0x48')]({},_0x2eea54,_0x132d6d[_0x0a9e('0x4d')]);return _0x55bb89['getFaxInteractions'](_0x2eea54);}})['then'](function(_0x3bde76){if(_0x3bde76){_0x2240ea=_0x3bde76['length'];if(!_0x132d6d[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x2eea54['limit']=qs['limit'](_0x132d6d[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x2eea54[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x132d6d[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}return _0x55bb89[_0x0a9e('0xb7')](_0x2eea54);}})['then'](function(_0x12984a){if(_0x12984a){return _0x12984a?{'count':_0x2240ea,'rows':_0x12984a}:null;}})['then'](respondWithResult(_0x534f61,null))[_0x0a9e('0x52')](handleError(_0x534f61,null));};exports[_0x0a9e('0xb9')]=function(_0x595a5e,_0x1fe77c,_0x3ee03d){var _0x10bb8e;var _0x4524b8;var _0xb0fb60;return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x595a5e[_0x0a9e('0x54')]['id'],'role':_0x0a9e('0x5b')},'attributes':['id',_0x0a9e('0x2f'),'phone',_0x0a9e('0xba'),_0x0a9e('0x5d'),_0x0a9e('0x6c'),'loginInPause']})[_0x0a9e('0x18')](handleEntityNotFound(_0x1fe77c,null))[_0x0a9e('0x18')](function(_0x37257e){if(_0x37257e){_0x10bb8e=_0x37257e;_0xb0fb60=(_0x595a5e[_0x0a9e('0x55')][_0x0a9e('0xbb')]?util[_0x0a9e('0x65')]('%s/%s','SIP',_0x595a5e[_0x0a9e('0x55')][_0x0a9e('0xbb')]):null)||(_0x595a5e['body'][_0x0a9e('0xbc')]&&_0x10bb8e[_0x595a5e[_0x0a9e('0x55')][_0x0a9e('0xbc')]]?util[_0x0a9e('0x65')](_0x0a9e('0xbd'),_0x10bb8e[_0x595a5e[_0x0a9e('0x55')]['interface']]):util[_0x0a9e('0x65')](_0x0a9e('0xbe'),_0x10bb8e[_0x0a9e('0x2f')]));socket['to'](util['format'](_0x0a9e('0xbf'),_0x10bb8e[_0x0a9e('0x2f')]))[_0x0a9e('0xc0')](_0x0a9e('0xc1'),{'ip':_0x595a5e['headers']['x-forwarded-for']||_0x595a5e[_0x0a9e('0xc2')][_0x0a9e('0xc3')]||_0x595a5e[_0x0a9e('0xc4')]['remoteAddress']||_0x595a5e[_0x0a9e('0xc2')][_0x0a9e('0xc4')][_0x0a9e('0xc3')]});return db[_0x0a9e('0x94')][_0x0a9e('0x2d')]({'where':{'membername':_0x10bb8e[_0x0a9e('0x2f')]},'individualHooks':!![]});}})[_0x0a9e('0x18')](function(_0x2d5c57){if(_0x10bb8e){return _0x10bb8e['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x17fd14){var _0x1c71ad=[];if(_0x17fd14){_0x4524b8=_0x17fd14;if(_0x4524b8['length']){for(var _0xe6701c=0x0;_0xe6701c<_0x4524b8['length'];_0xe6701c++){_0x1c71ad[_0x0a9e('0x90')]({'membername':_0x10bb8e[_0x0a9e('0x2f')],'UserId':_0x10bb8e['id'],'queue_name':_0x4524b8[_0xe6701c]['name'],'VoiceQueueId':_0x4524b8[_0xe6701c]['id'],'interface':_0xb0fb60||util[_0x0a9e('0x65')](_0x0a9e('0x91'),'SIP',_0x10bb8e[_0x0a9e('0x2f')]),'paused':_0x10bb8e[_0x0a9e('0x86')]||![],'penalty':_0x4524b8[_0xe6701c][_0x0a9e('0xc5')]||0x0});}return BPromise[_0x0a9e('0x93')](_0x1c71ad,function(_0x434df7){return db[_0x0a9e('0x94')][_0x0a9e('0x95')](_0x434df7);});}}})['then'](function(){return db[_0x0a9e('0xc6')][_0x0a9e('0x50')]({'where':{'membername':_0x10bb8e[_0x0a9e('0x2f')],'interface':util[_0x0a9e('0x65')](_0x0a9e('0x91'),_0x0a9e('0x92'),_0x10bb8e[_0x0a9e('0x2f')]),'exitAt':null}});})['then'](function(_0x4dbec7){var _0x435688=[];_0x4dbec7[_0x0a9e('0xc7')](function(_0x1e6bba){_0x435688['push'](_0x1e6bba['update']({'exitAt':moment()[_0x0a9e('0x65')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x0a9e('0xc8')](_0x435688);})[_0x0a9e('0x18')](function(){var _0x112789=[];var _0x2a0a86=[];var _0x20f4cb=utils[_0x0a9e('0xc9')]();var _0x2dc981={'membername':_0x10bb8e[_0x0a9e('0x2f')],'interface':util[_0x0a9e('0x65')]('%s/%s','SIP',_0x10bb8e[_0x0a9e('0x2f')]),'enterAt':moment()['format'](_0x0a9e('0xca')),'role':_0x10bb8e[_0x0a9e('0x5d')],'internal':_0x10bb8e[_0x0a9e('0x6c')]};_0x20f4cb[_0x0a9e('0xc7')](function(_0x4ad6fc){_0x112789[_0x0a9e('0x90')](_[_0x0a9e('0x48')]({'channel':_0x4ad6fc,'type':_0x0a9e('0xcb'),'data1':_0x595a5e['body'][_0x0a9e('0xcc')],'data2':_0xb0fb60},_0x2dc981));if(_0x10bb8e[_0x0a9e('0x86')]){_0x2a0a86[_0x0a9e('0x90')](_['merge']({'channel':_0x4ad6fc,'type':_0x0a9e('0xcd'),'data1':_0x0a9e('0xce')},_0x2dc981));}});return db[_0x0a9e('0xc6')][_0x0a9e('0xcf')](_0x112789[_0x0a9e('0xd0')](_0x2a0a86),{'individualHooks':!![]});})[_0x0a9e('0x18')](function(){return _0x10bb8e['update']({'online':!![],'lastLoginAt':moment()['format'](_0x0a9e('0xca')),'voicePause':_0x10bb8e[_0x0a9e('0x86')]||![],'mailPause':_0x10bb8e[_0x0a9e('0x86')]||![],'chatPause':_0x10bb8e['loginInPause']||![],'faxPause':_0x10bb8e['loginInPause']||![],'smsPause':_0x10bb8e[_0x0a9e('0x86')]||![],'openchannelPause':_0x10bb8e[_0x0a9e('0x86')]||![],'pauseType':_0x10bb8e[_0x0a9e('0x86')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0x0a9e('0xca'))});})[_0x0a9e('0x18')](respondWithResult(_0x1fe77c,null))[_0x0a9e('0x52')](handleError(_0x1fe77c,null));};exports[_0x0a9e('0xd1')]=function(_0x1bafdd,_0x4f0bca,_0x1d03cf){var _0x4b62e8;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x1bafdd['params']['id'],'role':_0x0a9e('0x5b')},'attributes':['id','name',_0x0a9e('0x5d')]})[_0x0a9e('0x18')](handleEntityNotFound(_0x4f0bca,null))[_0x0a9e('0x18')](function(_0x3554c7){if(_0x3554c7){_0x4b62e8=_0x3554c7;return db[_0x0a9e('0x94')]['destroy']({'where':{'membername':_0x4b62e8[_0x0a9e('0x2f')]},'individualHooks':!![]});}})[_0x0a9e('0x18')](function(){return db[_0x0a9e('0xc6')]['findAll']({'where':{'membername':_0x4b62e8[_0x0a9e('0x2f')],'interface':util['format'](_0x0a9e('0x91'),_0x0a9e('0x92'),_0x4b62e8[_0x0a9e('0x2f')]),'exitAt':null}});})['then'](function(_0x27960f){var _0x12b8f2=[];_0x27960f[_0x0a9e('0xc7')](function(_0x1ecb3b){_0x12b8f2[_0x0a9e('0x90')](_0x1ecb3b[_0x0a9e('0x2c')]({'exitAt':moment()['format'](_0x0a9e('0xca'))}));});return BPromise[_0x0a9e('0xc8')](_0x12b8f2);})[_0x0a9e('0x18')](function(){return _0x4b62e8[_0x0a9e('0x2c')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});})[_0x0a9e('0x18')](respondWithResult(_0x4f0bca,null))[_0x0a9e('0x52')](handleError(_0x4f0bca,null));};exports[_0x0a9e('0xd2')]=function(_0x3e43ea,_0x597e99,_0x2dc0de){var _0x15d013;return db[_0x0a9e('0x94')][_0x0a9e('0x2c')]({'paused':0x1},{'where':{'UserId':_0x3e43ea['params']['id']},'individualHooks':!![]})[_0x0a9e('0x18')](function(){return db['User'][_0x0a9e('0x56')]({'where':{'id':_0x3e43ea[_0x0a9e('0x54')]['id'],'role':_0x0a9e('0x5b')},'attributes':['id','name',_0x0a9e('0x5d'),_0x0a9e('0x6c')]});})[_0x0a9e('0x18')](handleEntityNotFound(_0x597e99,null))[_0x0a9e('0x18')](function(_0x53e0fc){if(_0x53e0fc){_0x15d013=_0x53e0fc;return respondWithRpcPromise(_0x0a9e('0xd3'),_0x0a9e('0xd2'),{'id':_0x15d013['id'],'name':_0x15d013[_0x0a9e('0x2f')],'pause':!![]});}})[_0x0a9e('0x18')](function(){if(_0x15d013){return db[_0x0a9e('0xc6')][_0x0a9e('0x50')]({'where':{'membername':_0x15d013[_0x0a9e('0x2f')],'interface':util['format'](_0x0a9e('0x91'),_0x0a9e('0x92'),_0x15d013[_0x0a9e('0x2f')]),'type':_0x0a9e('0xcd'),'exitAt':null}});}})['then'](function(_0x1b6dde){if(_0x1b6dde['length']){var _0x2b8f51=moment()[_0x0a9e('0x65')](_0x0a9e('0xca'));for(var _0x429f5c=0x0,_0x2742a4=_0x1b6dde[_0x0a9e('0x3f')];_0x429f5c<_0x2742a4;_0x429f5c++){_0x1b6dde[_0x429f5c][_0x0a9e('0xd4')]({'exitAt':_0x2b8f51});}}})['then'](function(){var _0x173f03=[];var _0x4ac7f1=utils[_0x0a9e('0xc9')]();_0x4ac7f1[_0x0a9e('0xc7')](function(_0x47d640){_0x173f03[_0x0a9e('0x90')]({'channel':_0x47d640,'membername':_0x15d013[_0x0a9e('0x2f')],'interface':util[_0x0a9e('0x65')](_0x0a9e('0x91'),'SIP',_0x15d013[_0x0a9e('0x2f')]),'type':_0x0a9e('0xcd'),'enterAt':moment()['format'](_0x0a9e('0xca')),'data1':_0x3e43ea['body']['type']||'DEFAULT\x20PAUSE','role':_0x15d013[_0x0a9e('0x5d')],'internal':_0x15d013[_0x0a9e('0x6c')]});});return db['MemberReport'][_0x0a9e('0xcf')](_0x173f03,{'individualHooks':!![]});})[_0x0a9e('0x18')](function(){return _0x15d013['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x3e43ea[_0x0a9e('0x55')][_0x0a9e('0xd5')]||_0x0a9e('0xd6'),'lastPauseAt':moment()[_0x0a9e('0x65')](_0x0a9e('0xca'))});})[_0x0a9e('0x18')](respondWithResult(_0x597e99,null))[_0x0a9e('0x52')](handleError(_0x597e99,null));};exports['unpause']=function(_0x3d7738,_0x5c05d2,_0x17f6ee){var _0x449be4;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x3d7738[_0x0a9e('0x54')]['id']},'attributes':['id',_0x0a9e('0x2f'),'role',_0x0a9e('0x87'),_0x0a9e('0xd7'),_0x0a9e('0xd8'),'faxPause',_0x0a9e('0xd9'),_0x0a9e('0xda'),_0x0a9e('0xdb'),_0x0a9e('0xdc')]})[_0x0a9e('0x18')](handleEntityNotFound(_0x5c05d2,null))[_0x0a9e('0x18')](function(_0x3bc55c){if(_0x3bc55c){_0x449be4=_0x3bc55c;if(_0x3d7738[_0x0a9e('0x55')][_0x0a9e('0x89')]&&!utils[_0x0a9e('0x88')](_0x3d7738[_0x0a9e('0x55')][_0x0a9e('0x89')])){throw new db[(_0x0a9e('0x7e'))][(_0x0a9e('0x7f'))](_0x0a9e('0x8a'));}switch(_0x3d7738[_0x0a9e('0x55')]['channel']){case _0x0a9e('0x8e'):return respondWithRpcPromise(_0x0a9e('0xd3'),_0x0a9e('0xdd'),{'id':_0x449be4['id'],'name':_0x449be4['name'],'pause':![]})[_0x0a9e('0x18')](function(){return db[_0x0a9e('0x94')][_0x0a9e('0x2c')]({'paused':0x0},{'where':{'UserId':_0x449be4['id']},'individualHooks':!![]});})[_0x0a9e('0x18')](function(){return db['MemberReport'][_0x0a9e('0x56')]({'where':{'channel':_0x3d7738[_0x0a9e('0x55')][_0x0a9e('0x89')],'membername':_0x449be4[_0x0a9e('0x2f')],'interface':util['format'](_0x0a9e('0x91'),_0x0a9e('0x92'),_0x449be4[_0x0a9e('0x2f')]),'type':_0x0a9e('0xcd'),'exitAt':null}});})['then'](function(_0x4b7595){if(_0x4b7595){return _0x4b7595[_0x0a9e('0x2c')]({'exitAt':moment()[_0x0a9e('0x65')](_0x0a9e('0xca')),'data2':_0x0a9e('0xde')},{'individualHooks':!![]});}return null;})[_0x0a9e('0x18')](function(){return _0x449be4[_0x0a9e('0x2c')]({'voicePause':![]});});case _0x0a9e('0xdf'):case _0x0a9e('0xe0'):case _0x0a9e('0xe1'):case _0x0a9e('0xe2'):case _0x0a9e('0xe3'):return db[_0x0a9e('0xc6')][_0x0a9e('0x56')]({'where':{'channel':_0x3d7738[_0x0a9e('0x55')]['channel'],'membername':_0x449be4[_0x0a9e('0x2f')],'interface':util[_0x0a9e('0x65')](_0x0a9e('0x91'),'SIP',_0x449be4['name']),'type':_0x0a9e('0xcd'),'exitAt':null}})['then'](function(_0x3d2007){if(_0x3d2007){return _0x3d2007[_0x0a9e('0x2c')]({'exitAt':moment()[_0x0a9e('0x65')](_0x0a9e('0xca')),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){var _0x2ad86f={};_[_0x0a9e('0x27')](_0x2ad86f,util[_0x0a9e('0x65')](_0x0a9e('0xe4'),_0x3d7738['body'][_0x0a9e('0x89')],_0x0a9e('0xe5')),![]);return _0x449be4[_0x0a9e('0x2c')](_0x2ad86f);});default:return respondWithRpcPromise(_0x0a9e('0xd3'),_0x0a9e('0xdd'),{'id':_0x449be4['id'],'name':_0x449be4['name'],'pause':![]})['then'](function(){return db[_0x0a9e('0x94')][_0x0a9e('0x2c')]({'paused':0x0},{'where':{'UserId':_0x449be4['id']}});})[_0x0a9e('0x18')](function(){return db[_0x0a9e('0xc6')][_0x0a9e('0x50')]({'where':{'membername':_0x449be4[_0x0a9e('0x2f')],'interface':util[_0x0a9e('0x65')]('%s/%s',_0x0a9e('0x92'),_0x449be4[_0x0a9e('0x2f')]),'type':_0x0a9e('0xcd'),'exitAt':null}});})['then'](function(_0x5f2b39){var _0x521fd9=[];_0x5f2b39[_0x0a9e('0xc7')](function(_0x3ae873){_0x521fd9['push'](_0x3ae873[_0x0a9e('0x2c')]({'exitAt':moment()[_0x0a9e('0x65')](_0x0a9e('0xca')),'data2':'manual'}));});return BPromise['all'](_0x521fd9);})[_0x0a9e('0x18')](function(){return _0x449be4[_0x0a9e('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x0a9e('0x18')](respondWithResult(_0x5c05d2,null))[_0x0a9e('0x52')](handleError(_0x5c05d2,null));};exports['getTeams']=function(_0xb7a9b3,_0x5ccb5a,_0x47fecd){var _0x5ecd61={};var _0x546742={};var _0x98bab3;var _0x991bfc;return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0xb7a9b3[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x5ccb5a,null))[_0x0a9e('0x18')](function(_0x5c39d1){if(_0x5c39d1){_0x98bab3=_0x5c39d1;_0x546742['model']=_[_0x0a9e('0x35')](db[_0x0a9e('0xe6')][_0x0a9e('0x33')]);_0x546742[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0xb7a9b3[_0x0a9e('0x3a')]);_0x546742['filters']=_['intersection'](_0x546742[_0x0a9e('0x3c')],_0x546742[_0x0a9e('0x3a')]);_0x5ecd61['attributes']=_['intersection'](_0x546742['model'],qs['fields'](_0xb7a9b3['query']['fields']));_0x5ecd61[_0x0a9e('0x3e')]=_0x5ecd61['attributes'][_0x0a9e('0x3f')]?_0x5ecd61[_0x0a9e('0x3e')]:_0x546742[_0x0a9e('0x3c')];_0x5ecd61[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0xb7a9b3[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x5ecd61['where']=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0xb7a9b3[_0x0a9e('0x3a')],_0x546742[_0x0a9e('0x44')]));if(_0xb7a9b3[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x5ecd61[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x5ecd61[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x5ecd61[_0x0a9e('0x3e')],function(_0x5d48c2){var _0x35cc16={};_0x35cc16[_0x5d48c2]={'$like':'%'+_0xb7a9b3[_0x0a9e('0x3a')]['filter']+'%'};return _0x35cc16;})});}_0x5ecd61=_[_0x0a9e('0x48')]({},_0x5ecd61,_0xb7a9b3['options']);return _0x98bab3[_0x0a9e('0xe7')](_0x5ecd61);}})[_0x0a9e('0x18')](function(_0x5dea55){if(_0x5dea55){_0x991bfc=_0x5dea55['length'];if(!_0xb7a9b3[_0x0a9e('0x3a')]['hasOwnProperty'](_0x0a9e('0xa9'))){_0x5ecd61[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0xb7a9b3[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x5ecd61['offset']=qs[_0x0a9e('0x25')](_0xb7a9b3['query']['offset']);}return _0x98bab3[_0x0a9e('0xe7')](_0x5ecd61);}})[_0x0a9e('0x18')](function(_0xc37a37){if(_0xc37a37){return _0xc37a37?{'count':_0x991bfc,'rows':_0xc37a37}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x5ccb5a,null))[_0x0a9e('0x52')](handleError(_0x5ccb5a,null));};exports['addTeams']=function(_0x34d7a,_0x425fa1,_0x12fa30){return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x34d7a[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x425fa1,null))['then'](function(_0x3ce294){if(_0x3ce294){return _0x3ce294[_0x0a9e('0xe8')](_0x34d7a[_0x0a9e('0x55')][_0x0a9e('0x5a')],_['omit'](_0x34d7a[_0x0a9e('0x55')],[_0x0a9e('0x5a'),'id'])||{});}})[_0x0a9e('0x18')](respondWithResult(_0x425fa1,null))[_0x0a9e('0x52')](handleError(_0x425fa1,null));};exports[_0x0a9e('0xe9')]=function(_0x4b829f,_0x693ecd,_0xa52efe){var _0x59f213;return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x4b829f[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x693ecd,null))[_0x0a9e('0x18')](function(_0x1f2eaa){if(_0x1f2eaa){return _0x1f2eaa[_0x0a9e('0xe9')](_0x4b829f[_0x0a9e('0x3a')][_0x0a9e('0x5a')]);}})[_0x0a9e('0x18')](respondWithStatusCode(_0x693ecd,null))[_0x0a9e('0x52')](handleError(_0x693ecd,null));};exports[_0x0a9e('0xea')]=function(_0x304b17,_0x1509e5,_0x216002){var _0x43af61={};var _0x435f11={};var _0x496673;var _0x25a680;return db[_0x0a9e('0x32')][_0x0a9e('0xa5')]({'where':{'id':_0x304b17[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x1509e5,null))[_0x0a9e('0x18')](function(_0x19a210){if(_0x19a210){_0x496673=_0x19a210;_0x435f11[_0x0a9e('0x3c')]=_['keys'](db['CmList']['rawAttributes']);_0x435f11['query']=_[_0x0a9e('0x35')](_0x304b17['query']);_0x435f11['filters']=_['intersection'](_0x435f11[_0x0a9e('0x3c')],_0x435f11[_0x0a9e('0x3a')]);_0x43af61[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x435f11['model'],qs['fields'](_0x304b17[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x43af61[_0x0a9e('0x3e')]=_0x43af61[_0x0a9e('0x3e')]['length']?_0x43af61[_0x0a9e('0x3e')]:_0x435f11[_0x0a9e('0x3c')];_0x43af61[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0x304b17[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x43af61['where']=qs[_0x0a9e('0x44')](_['pick'](_0x304b17['query'],_0x435f11[_0x0a9e('0x44')]));if(_0x304b17['query'][_0x0a9e('0x49')]){_0x43af61[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x43af61[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x43af61[_0x0a9e('0x3e')],function(_0x3ad6f5){var _0x38182c={};_0x38182c[_0x3ad6f5]={'$like':'%'+_0x304b17[_0x0a9e('0x3a')]['filter']+'%'};return _0x38182c;})});}_0x43af61=_[_0x0a9e('0x48')]({},_0x43af61,_0x304b17[_0x0a9e('0x4d')]);return _0x496673['getLists'](_0x43af61);}})[_0x0a9e('0x18')](function(_0x39633e){if(_0x39633e){_0x25a680=_0x39633e[_0x0a9e('0x3f')];if(!_0x304b17[_0x0a9e('0x3a')]['hasOwnProperty'](_0x0a9e('0xa9'))){_0x43af61[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x304b17[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x43af61['offset']=qs['offset'](_0x304b17[_0x0a9e('0x3a')]['offset']);}return _0x496673[_0x0a9e('0xea')](_0x43af61);}})['then'](function(_0x12fc21){if(_0x12fc21){return _0x12fc21?{'count':_0x25a680,'rows':_0x12fc21}:null;}})['then'](respondWithResult(_0x1509e5,null))[_0x0a9e('0x52')](handleError(_0x1509e5,null));};exports['getAgents']=function(_0x436a54,_0x179f31,_0x3df29f){var _0x4ee019={};var _0x587fd8={};var _0x4491ef;var _0x52abeb;return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x436a54[_0x0a9e('0x54')]['id']}})['then'](handleEntityNotFound(_0x179f31,null))[_0x0a9e('0x18')](function(_0x1a5c47){if(_0x1a5c47){_0x4491ef=_0x1a5c47;_0x587fd8['model']=_[_0x0a9e('0x35')](db[_0x0a9e('0x32')][_0x0a9e('0x33')]);_0x587fd8[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x436a54[_0x0a9e('0x3a')]);_0x587fd8[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0x587fd8[_0x0a9e('0x3c')],_0x587fd8['query']);_0x4ee019[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x587fd8[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x436a54[_0x0a9e('0x3a')]['fields']));_0x4ee019['attributes']=_0x4ee019[_0x0a9e('0x3e')]['length']?_0x4ee019[_0x0a9e('0x3e')]:_0x587fd8['model'];_0x4ee019[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0x436a54[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x4ee019[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x436a54['query'],_0x587fd8['filters']));if(_0x436a54[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x4ee019['where']=_[_0x0a9e('0x48')](_0x4ee019[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x4a')](_0x4ee019['attributes'],function(_0x55ed81){var _0x4d0462={};_0x4d0462[_0x55ed81]={'$like':'%'+_0x436a54[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x4d0462;})});}_0x4ee019[_0x0a9e('0x3c')]=db[_0x0a9e('0x32')];_0x4ee019['as']='Agents';_0x4ee019=_[_0x0a9e('0x48')]({},_0x4ee019,_0x436a54[_0x0a9e('0x4d')]);return _0x4491ef[_0x0a9e('0xeb')]({'include':[_0x4ee019]});}})['then'](function(_0xe289c9){if(_0xe289c9){var _0x55a6c9={},_0x49bef3=[],_0x5590a0=0x0;for(var _0x3624bd=0x0;_0x3624bd<_0xe289c9['length'];_0x3624bd+=0x1){for(var _0x5dbf0b=0x0,_0x31114d;_0x5dbf0b<_0xe289c9[_0x3624bd]['Agents'][_0x0a9e('0x3f')];_0x5dbf0b+=0x1){_0x31114d=_0xe289c9[_0x3624bd]['Agents'][_0x5dbf0b][_0x0a9e('0xa7')]({'plain':!![]});_0x55a6c9[_0x31114d['id']]=_0x31114d;}}_0x55a6c9=_[_0x0a9e('0xec')](_0x55a6c9);for(var _0x244d64=qs['offset'](_0x436a54['query'][_0x0a9e('0x25')]);_0x244d64<_0x55a6c9[_0x0a9e('0x3f')]&&_0x49bef3[_0x0a9e('0x3f')]<qs[_0x0a9e('0x26')](_0x436a54['query'][_0x0a9e('0x26')]);_0x244d64+=0x1){if(_0x55a6c9[_0x244d64]){_0x49bef3[_0x0a9e('0x90')](_0x55a6c9[_0x244d64]);}}return{'count':_0x55a6c9['length'],'rows':_0x49bef3};}})[_0x0a9e('0x18')](respondWithResult(_0x179f31,null))[_0x0a9e('0x52')](handleError(_0x179f31,null));};exports[_0x0a9e('0x2d')]=function(_0x498db0,_0x9ff383){if(_0x498db0[_0x0a9e('0x5f')]['id']==_0x498db0[_0x0a9e('0x54')]['id']){return _0x9ff383[_0x0a9e('0x22')](0x1f4)[_0x0a9e('0x30')]({'message':_0x0a9e('0xed')});}return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x498db0[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x9ff383,null))[_0x0a9e('0x18')](removeEntity(_0x9ff383,null))[_0x0a9e('0x52')](handleError(_0x9ff383,null));};exports[_0x0a9e('0xee')]=function(_0x34ff77,_0x830d3a,_0x21ffb7){return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x34ff77[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x830d3a,null))[_0x0a9e('0x18')](function(_0x3da462){if(_0x3da462){return _0x3da462['addChatInteractions'](_0x34ff77[_0x0a9e('0x55')][_0x0a9e('0x5a')],_[_0x0a9e('0x59')](_0x34ff77['body'],[_0x0a9e('0x5a'),'id'])||{})[_0x0a9e('0xef')](function(){for(var _0x1ced55=0x0;_0x1ced55<_0x34ff77[_0x0a9e('0x55')]['ids'][_0x0a9e('0x3f')];_0x1ced55+=0x1){socket[_0x0a9e('0xc0')]('user_has_chat_interactions:save',{'ChatInteractionId':Number(_0x34ff77[_0x0a9e('0x55')][_0x0a9e('0x5a')][_0x1ced55]),'UserId':Number(_0x34ff77[_0x0a9e('0x54')]['id'])});}return _0x34ff77['body']['ids'];});}})[_0x0a9e('0x18')](respondWithResult(_0x830d3a,null))[_0x0a9e('0x52')](handleError(_0x830d3a,null));};exports[_0x0a9e('0xf0')]=function(_0x5e5251,_0x5b1ee9,_0x477fde){var _0x39104d;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x5e5251['params']['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x5b1ee9,null))['then'](function(_0x4a8a1e){if(_0x4a8a1e){return _0x4a8a1e[_0x0a9e('0xf0')](_0x5e5251[_0x0a9e('0x3a')][_0x0a9e('0x5a')])['then'](function(_0xde0c2a){if(_[_0x0a9e('0xf1')](_0x5e5251[_0x0a9e('0x3a')]['ids'])){for(var _0x5eb06a=0x0;_0x5eb06a<_0x5e5251[_0x0a9e('0x3a')][_0x0a9e('0x5a')][_0x0a9e('0x3f')];_0x5eb06a+=0x1){socket['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x5e5251[_0x0a9e('0x3a')]['ids'][_0x5eb06a]),'UserId':Number(_0x5e5251['params']['id'])});}}else{socket['emit'](_0x0a9e('0xf2'),{'ChatInteractionId':Number(_0x5e5251[_0x0a9e('0x3a')][_0x0a9e('0x5a')]),'UserId':Number(_0x5e5251['params']['id'])});}});}})[_0x0a9e('0x18')](respondWithStatusCode(_0x5b1ee9,null))[_0x0a9e('0x52')](handleError(_0x5b1ee9,null));};exports['addMailInteractions']=function(_0x29035c,_0x57f03f,_0x36afa6){return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x29035c[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x57f03f,null))[_0x0a9e('0x18')](function(_0x4afa93){if(_0x4afa93){return _0x4afa93[_0x0a9e('0xf3')](_0x29035c[_0x0a9e('0x55')][_0x0a9e('0x5a')],_['omit'](_0x29035c[_0x0a9e('0x55')],[_0x0a9e('0x5a'),'id'])||{})[_0x0a9e('0xef')](function(){for(var _0x4c5f3b=0x0;_0x4c5f3b<_0x29035c[_0x0a9e('0x55')][_0x0a9e('0x5a')][_0x0a9e('0x3f')];_0x4c5f3b+=0x1){socket[_0x0a9e('0xc0')](_0x0a9e('0xf4'),{'MailInteractionId':Number(_0x29035c[_0x0a9e('0x55')][_0x0a9e('0x5a')][_0x4c5f3b]),'UserId':Number(_0x29035c[_0x0a9e('0x54')]['id'])});}return _0x29035c['body'][_0x0a9e('0x5a')];});}})[_0x0a9e('0x18')](respondWithResult(_0x57f03f,null))[_0x0a9e('0x52')](handleError(_0x57f03f,null));};exports[_0x0a9e('0xf5')]=function(_0x5dbed2,_0x138f1a,_0xd55dcb){var _0x595856;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x5dbed2[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x138f1a,null))[_0x0a9e('0x18')](function(_0x2cd3bf){if(_0x2cd3bf){return _0x2cd3bf[_0x0a9e('0xf5')](_0x5dbed2[_0x0a9e('0x3a')]['ids'])[_0x0a9e('0x18')](function(_0x509a05){if(_[_0x0a9e('0xf1')](_0x5dbed2[_0x0a9e('0x3a')]['ids'])){for(var _0x25f181=0x0;_0x25f181<_0x5dbed2[_0x0a9e('0x3a')]['ids'][_0x0a9e('0x3f')];_0x25f181+=0x1){socket[_0x0a9e('0xc0')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x5dbed2[_0x0a9e('0x3a')]['ids'][_0x25f181]),'UserId':Number(_0x5dbed2['params']['id'])});}}else{socket['emit'](_0x0a9e('0xf6'),{'MailInteractionId':Number(_0x5dbed2[_0x0a9e('0x3a')]['ids']),'UserId':Number(_0x5dbed2[_0x0a9e('0x54')]['id'])});}});}})[_0x0a9e('0x18')](respondWithStatusCode(_0x138f1a,null))['catch'](handleError(_0x138f1a,null));};exports[_0x0a9e('0xf7')]=function(_0xc20d7f,_0x4bdcd3,_0x47364f){return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0xc20d7f['params']['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x4bdcd3,null))[_0x0a9e('0x18')](function(_0x1815b8){if(_0x1815b8){return _0x1815b8[_0x0a9e('0xf7')](_0xc20d7f[_0x0a9e('0x55')]['ids'],_[_0x0a9e('0x59')](_0xc20d7f['body'],[_0x0a9e('0x5a'),'id'])||{})[_0x0a9e('0xef')](function(){for(var _0x346236=0x0;_0x346236<_0xc20d7f[_0x0a9e('0x55')][_0x0a9e('0x5a')][_0x0a9e('0x3f')];_0x346236+=0x1){socket[_0x0a9e('0xc0')](_0x0a9e('0xf8'),{'FaxInteractionId':Number(_0xc20d7f[_0x0a9e('0x55')]['ids'][_0x346236]),'UserId':Number(_0xc20d7f[_0x0a9e('0x54')]['id'])});}return _0xc20d7f[_0x0a9e('0x55')][_0x0a9e('0x5a')];});}})['then'](respondWithResult(_0x4bdcd3,null))['catch'](handleError(_0x4bdcd3,null));};exports['removeFaxInteractions']=function(_0x4b99fb,_0x49e349,_0x347d13){var _0x5ed148;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x4b99fb[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x49e349,null))[_0x0a9e('0x18')](function(_0x15e580){if(_0x15e580){return _0x15e580['removeFaxInteractions'](_0x4b99fb[_0x0a9e('0x3a')]['ids'])['then'](function(_0x139b02){if(_['isArray'](_0x4b99fb[_0x0a9e('0x3a')]['ids'])){for(var _0x3e3b5f=0x0;_0x3e3b5f<_0x4b99fb[_0x0a9e('0x3a')][_0x0a9e('0x5a')][_0x0a9e('0x3f')];_0x3e3b5f+=0x1){socket[_0x0a9e('0xc0')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x4b99fb[_0x0a9e('0x3a')][_0x0a9e('0x5a')][_0x3e3b5f]),'UserId':Number(_0x4b99fb['params']['id'])});}}else{socket[_0x0a9e('0xc0')](_0x0a9e('0xf9'),{'FaxInteractionId':Number(_0x4b99fb['query'][_0x0a9e('0x5a')]),'UserId':Number(_0x4b99fb[_0x0a9e('0x54')]['id'])});}});}})[_0x0a9e('0x18')](respondWithStatusCode(_0x49e349,null))[_0x0a9e('0x52')](handleError(_0x49e349,null));};exports[_0x0a9e('0xfa')]=function(_0x263c8f,_0x1629a9,_0x494351){return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x263c8f[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x1629a9,null))['then'](function(_0x19e176){if(_0x19e176){return _0x19e176[_0x0a9e('0xfa')](_0x263c8f[_0x0a9e('0x55')][_0x0a9e('0x5a')],_[_0x0a9e('0x59')](_0x263c8f[_0x0a9e('0x55')],[_0x0a9e('0x5a'),'id'])||{})[_0x0a9e('0xef')](function(){for(var _0x5a87e7=0x0;_0x5a87e7<_0x263c8f[_0x0a9e('0x55')][_0x0a9e('0x5a')][_0x0a9e('0x3f')];_0x5a87e7+=0x1){socket['emit'](_0x0a9e('0xfb'),{'SmsInteractionId':Number(_0x263c8f[_0x0a9e('0x55')][_0x0a9e('0x5a')][_0x5a87e7]),'UserId':Number(_0x263c8f[_0x0a9e('0x54')]['id'])});}return _0x263c8f[_0x0a9e('0x55')][_0x0a9e('0x5a')];});}})[_0x0a9e('0x18')](respondWithResult(_0x1629a9,null))[_0x0a9e('0x52')](handleError(_0x1629a9,null));};exports[_0x0a9e('0xfc')]=function(_0x1c39a4,_0x4c8e78,_0x1cee49){var _0x3a87e7;return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x1c39a4['params']['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x4c8e78,null))[_0x0a9e('0x18')](function(_0x395034){if(_0x395034){return _0x395034[_0x0a9e('0xfc')](_0x1c39a4[_0x0a9e('0x3a')][_0x0a9e('0x5a')])[_0x0a9e('0x18')](function(_0x236a28){if(_[_0x0a9e('0xf1')](_0x1c39a4['query'][_0x0a9e('0x5a')])){for(var _0x41ae51=0x0;_0x41ae51<_0x1c39a4['query'][_0x0a9e('0x5a')][_0x0a9e('0x3f')];_0x41ae51+=0x1){socket['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x1c39a4[_0x0a9e('0x3a')][_0x0a9e('0x5a')][_0x41ae51]),'UserId':Number(_0x1c39a4[_0x0a9e('0x54')]['id'])});}}else{socket[_0x0a9e('0xc0')](_0x0a9e('0xfd'),{'SmsInteractionId':Number(_0x1c39a4['query'][_0x0a9e('0x5a')]),'UserId':Number(_0x1c39a4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4c8e78,null))['catch'](handleError(_0x4c8e78,null));};exports[_0x0a9e('0xfe')]=function(_0x4c09a7,_0x4ba7bb,_0x4a87e4){return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x4c09a7[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x4ba7bb,null))['then'](function(_0x2b9a34){if(_0x2b9a34){return _0x2b9a34['addOpenchannelInteractions'](_0x4c09a7['body'][_0x0a9e('0x5a')],_[_0x0a9e('0x59')](_0x4c09a7[_0x0a9e('0x55')],['ids','id'])||{})['spread'](function(){for(var _0x5873f8=0x0;_0x5873f8<_0x4c09a7[_0x0a9e('0x55')][_0x0a9e('0x5a')][_0x0a9e('0x3f')];_0x5873f8+=0x1){socket[_0x0a9e('0xc0')](_0x0a9e('0xff'),{'OpenchannelInteractionId':Number(_0x4c09a7['body'][_0x0a9e('0x5a')][_0x5873f8]),'UserId':Number(_0x4c09a7[_0x0a9e('0x54')]['id'])});}return _0x4c09a7[_0x0a9e('0x55')][_0x0a9e('0x5a')];});}})[_0x0a9e('0x18')](respondWithResult(_0x4ba7bb,null))[_0x0a9e('0x52')](handleError(_0x4ba7bb,null));};exports['removeOpenchannelInteractions']=function(_0x292208,_0x2a64e4,_0x32a9c6){var _0x2feaad;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x292208[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x2a64e4,null))[_0x0a9e('0x18')](function(_0x20e4f3){if(_0x20e4f3){return _0x20e4f3[_0x0a9e('0x100')](_0x292208[_0x0a9e('0x3a')][_0x0a9e('0x5a')])[_0x0a9e('0x18')](function(_0x31d2d4){if(_[_0x0a9e('0xf1')](_0x292208[_0x0a9e('0x3a')][_0x0a9e('0x5a')])){for(var _0x4d5e96=0x0;_0x4d5e96<_0x292208[_0x0a9e('0x3a')][_0x0a9e('0x5a')]['length'];_0x4d5e96+=0x1){socket['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x292208[_0x0a9e('0x3a')][_0x0a9e('0x5a')][_0x4d5e96]),'UserId':Number(_0x292208['params']['id'])});}}else{socket[_0x0a9e('0xc0')](_0x0a9e('0x101'),{'OpenchannelInteractionId':Number(_0x292208['query'][_0x0a9e('0x5a')]),'UserId':Number(_0x292208['params']['id'])});}});}})[_0x0a9e('0x18')](respondWithStatusCode(_0x2a64e4,null))['catch'](handleError(_0x2a64e4,null));};exports[_0x0a9e('0x102')]=function(_0x1de9b2,_0x29092f,_0x22ddd7){var _0x51001e={};var _0x1333b0={};var _0x223975;var _0x2e7684;return db['User']['findOne']({'where':{'id':_0x1de9b2['params']['id']}})['then'](handleEntityNotFound(_0x29092f,null))[_0x0a9e('0x18')](function(_0xb4b8af){if(_0xb4b8af){_0x223975=_0xb4b8af;_0x1333b0[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db[_0x0a9e('0x103')]['rawAttributes']);_0x1333b0[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x1de9b2[_0x0a9e('0x3a')]);_0x1333b0[_0x0a9e('0x44')]=_['intersection'](_0x1333b0[_0x0a9e('0x3c')],_0x1333b0[_0x0a9e('0x3a')]);_0x51001e[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x1333b0[_0x0a9e('0x3c')],qs['fields'](_0x1de9b2[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x51001e[_0x0a9e('0x3e')]=_0x51001e['attributes'][_0x0a9e('0x3f')]?_0x51001e['attributes']:_0x1333b0[_0x0a9e('0x3c')];_0x51001e[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0x1de9b2[_0x0a9e('0x3a')][_0x0a9e('0x42')]);_0x51001e['where']=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x1de9b2[_0x0a9e('0x3a')],_0x1333b0[_0x0a9e('0x44')]));if(_0x1de9b2[_0x0a9e('0x3a')]['filter']){_0x51001e[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x51001e[_0x0a9e('0x43')],{'$or':_['map'](_0x51001e[_0x0a9e('0x3e')],function(_0x488216){var _0x479441={};_0x479441[_0x488216]={'$like':'%'+_0x1de9b2[_0x0a9e('0x3a')]['filter']+'%'};return _0x479441;})});}_0x51001e=_[_0x0a9e('0x48')]({},_0x51001e,_0x1de9b2[_0x0a9e('0x4d')]);return _0x223975[_0x0a9e('0x102')](_0x51001e);}})['then'](function(_0x365904){if(_0x365904){_0x2e7684=_0x365904[_0x0a9e('0x3f')];if(!_0x1de9b2[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x51001e[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x1de9b2[_0x0a9e('0x3a')]['limit']);_0x51001e[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x1de9b2[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}return _0x223975[_0x0a9e('0x102')](_0x51001e);}})['then'](function(_0x592f39){if(_0x592f39){return _0x592f39?{'count':_0x2e7684,'rows':_0x592f39}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x29092f,null))['catch'](handleError(_0x29092f,null));};exports[_0x0a9e('0x104')]=function(_0x42f2da,_0x58b3f3,_0x2eb471){var _0x239eef={};var _0xc91243={};var _0x49973b;var _0x25de30;return db[_0x0a9e('0x32')][_0x0a9e('0xa5')]({'where':{'id':_0x42f2da[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x58b3f3,null))[_0x0a9e('0x18')](function(_0x9ecf57){if(_0x9ecf57){_0x49973b=_0x9ecf57;_0xc91243[_0x0a9e('0x3c')]=_['keys'](db[_0x0a9e('0x105')][_0x0a9e('0x33')]);_0xc91243[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x42f2da[_0x0a9e('0x3a')]);_0xc91243['filters']=_[_0x0a9e('0x3b')](_0xc91243['model'],_0xc91243[_0x0a9e('0x3a')]);_0x239eef[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0xc91243['model'],qs[_0x0a9e('0x3d')](_0x42f2da['query'][_0x0a9e('0x3d')]));_0x239eef[_0x0a9e('0x3e')]=_0x239eef[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x239eef['attributes']:_0xc91243[_0x0a9e('0x3c')];_0x239eef['order']=qs[_0x0a9e('0x42')](_0x42f2da[_0x0a9e('0x3a')]['sort']);_0x239eef[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x42f2da['query'],_0xc91243[_0x0a9e('0x44')]));if(_0x42f2da['query'][_0x0a9e('0x49')]){_0x239eef[_0x0a9e('0x43')]=_['merge'](_0x239eef['where'],{'$or':_['map'](_0x239eef['attributes'],function(_0x1ce430){var _0x40a6f4={};_0x40a6f4[_0x1ce430]={'$like':'%'+_0x42f2da[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x40a6f4;})});}_0x239eef=_['merge']({},_0x239eef,_0x42f2da[_0x0a9e('0x4d')]);return _0x49973b['getFaxAccounts'](_0x239eef);}})[_0x0a9e('0x18')](function(_0x476e16){if(_0x476e16){_0x25de30=_0x476e16['length'];if(!_0x42f2da[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x239eef[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x42f2da[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x239eef['offset']=qs[_0x0a9e('0x25')](_0x42f2da[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}return _0x49973b[_0x0a9e('0x104')](_0x239eef);}})[_0x0a9e('0x18')](function(_0x3118bd){if(_0x3118bd){return _0x3118bd?{'count':_0x25de30,'rows':_0x3118bd}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x58b3f3,null))[_0x0a9e('0x52')](handleError(_0x58b3f3,null));};exports[_0x0a9e('0x106')]=function(_0x43fd4c,_0x10e1b9,_0x4f33b7){return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x43fd4c[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x10e1b9,null))[_0x0a9e('0x18')](function(_0x3a32c7){if(_0x3a32c7){return _0x3a32c7[_0x0a9e('0x106')](_0x43fd4c['body'][_0x0a9e('0x5a')],_[_0x0a9e('0x59')](_0x43fd4c[_0x0a9e('0x55')],['ids','id'])||{});}})[_0x0a9e('0x18')](respondWithResult(_0x10e1b9,null))[_0x0a9e('0x52')](handleError(_0x10e1b9,null));};exports[_0x0a9e('0x107')]=function(_0x4c7e3b,_0x5d3ad3,_0x23b67e){var _0x17a2d7;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x4c7e3b[_0x0a9e('0x54')]['id']}})['then'](handleEntityNotFound(_0x5d3ad3,null))[_0x0a9e('0x18')](function(_0x584f70){if(_0x584f70){return _0x584f70[_0x0a9e('0x107')](_0x4c7e3b[_0x0a9e('0x3a')]['ids']);}})[_0x0a9e('0x18')](respondWithStatusCode(_0x5d3ad3,null))['catch'](handleError(_0x5d3ad3,null));};exports[_0x0a9e('0x108')]=function(_0x2e933b,_0x486ed3,_0x127919){var _0xbff290={};var _0xab6a54={};var _0x5ccd49;var _0x40c9dd;return db[_0x0a9e('0x32')][_0x0a9e('0xa5')]({'where':{'id':_0x2e933b[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x486ed3,null))[_0x0a9e('0x18')](function(_0x4fd2bb){if(_0x4fd2bb){_0x5ccd49=_0x4fd2bb;_0xab6a54[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db[_0x0a9e('0x109')][_0x0a9e('0x33')]);_0xab6a54['query']=_['keys'](_0x2e933b[_0x0a9e('0x3a')]);_0xab6a54[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0xab6a54['model'],_0xab6a54['query']);_0xbff290[_0x0a9e('0x3e')]=_['intersection'](_0xab6a54['model'],qs[_0x0a9e('0x3d')](_0x2e933b[_0x0a9e('0x3a')]['fields']));_0xbff290[_0x0a9e('0x3e')]=_0xbff290[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0xbff290[_0x0a9e('0x3e')]:_0xab6a54[_0x0a9e('0x3c')];_0xbff290['order']=qs[_0x0a9e('0x42')](_0x2e933b[_0x0a9e('0x3a')]['sort']);_0xbff290[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x2e933b[_0x0a9e('0x3a')],_0xab6a54[_0x0a9e('0x44')]));if(_0x2e933b['query'][_0x0a9e('0x49')]){_0xbff290[_0x0a9e('0x43')]=_['merge'](_0xbff290['where'],{'$or':_[_0x0a9e('0x4a')](_0xbff290[_0x0a9e('0x3e')],function(_0x4987b8){var _0x540508={};_0x540508[_0x4987b8]={'$like':'%'+_0x2e933b[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x540508;})});}_0xbff290=_[_0x0a9e('0x48')]({},_0xbff290,_0x2e933b[_0x0a9e('0x4d')]);return _0x5ccd49[_0x0a9e('0x108')](_0xbff290);}})['then'](function(_0x1a2437){if(_0x1a2437){_0x40c9dd=_0x1a2437['length'];if(!_0x2e933b['query'][_0x0a9e('0x40')]('nolimit')){_0xbff290[_0x0a9e('0x26')]=qs['limit'](_0x2e933b[_0x0a9e('0x3a')]['limit']);_0xbff290['offset']=qs[_0x0a9e('0x25')](_0x2e933b[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}return _0x5ccd49['getMailAccounts'](_0xbff290);}})['then'](function(_0x537da0){if(_0x537da0){return _0x537da0?{'count':_0x40c9dd,'rows':_0x537da0}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x486ed3,null))[_0x0a9e('0x52')](handleError(_0x486ed3,null));};exports['addMailAccounts']=function(_0x2ed3ba,_0x4b7f09,_0x446f3b){return db['User'][_0x0a9e('0x56')]({'where':{'id':_0x2ed3ba[_0x0a9e('0x54')]['id']}})['then'](handleEntityNotFound(_0x4b7f09,null))['then'](function(_0x4c4874){if(_0x4c4874){return _0x4c4874[_0x0a9e('0x10a')](_0x2ed3ba[_0x0a9e('0x55')][_0x0a9e('0x5a')],_[_0x0a9e('0x59')](_0x2ed3ba[_0x0a9e('0x55')],[_0x0a9e('0x5a'),'id'])||{});}})[_0x0a9e('0x18')](respondWithResult(_0x4b7f09,null))[_0x0a9e('0x52')](handleError(_0x4b7f09,null));};exports[_0x0a9e('0x10b')]=function(_0x128212,_0xa31c1e,_0x2de177){var _0x2b9341;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x128212['params']['id']}})['then'](handleEntityNotFound(_0xa31c1e,null))[_0x0a9e('0x18')](function(_0x6ea669){if(_0x6ea669){return _0x6ea669[_0x0a9e('0x10b')](_0x128212[_0x0a9e('0x3a')]['ids']);}})[_0x0a9e('0x18')](respondWithStatusCode(_0xa31c1e,null))['catch'](handleError(_0xa31c1e,null));};exports[_0x0a9e('0x10c')]=function(_0x5f35e7,_0x209ece,_0x50ce98){var _0x50985c={};var _0x2787ff={};var _0x2b8734;var _0xc2ae55;return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x5f35e7['params']['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x209ece,null))['then'](function(_0x216921){if(_0x216921){_0x2b8734=_0x216921;_0x2787ff[_0x0a9e('0x3c')]=_['keys'](db[_0x0a9e('0x10d')]['rawAttributes']);_0x2787ff[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x5f35e7[_0x0a9e('0x3a')]);_0x2787ff[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0x2787ff[_0x0a9e('0x3c')],_0x2787ff[_0x0a9e('0x3a')]);_0x50985c[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x2787ff[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x5f35e7[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x50985c[_0x0a9e('0x3e')]=_0x50985c[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x50985c['attributes']:_0x2787ff[_0x0a9e('0x3c')];_0x50985c[_0x0a9e('0x41')]=qs[_0x0a9e('0x42')](_0x5f35e7['query'][_0x0a9e('0x42')]);_0x50985c[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x5f35e7[_0x0a9e('0x3a')],_0x2787ff[_0x0a9e('0x44')]));if(_0x5f35e7[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x50985c[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x50985c[_0x0a9e('0x43')],{'$or':_['map'](_0x50985c[_0x0a9e('0x3e')],function(_0x3bf6ee){var _0x469905={};_0x469905[_0x3bf6ee]={'$like':'%'+_0x5f35e7['query'][_0x0a9e('0x49')]+'%'};return _0x469905;})});}_0x50985c=_['merge']({},_0x50985c,_0x5f35e7['options']);return _0x2b8734[_0x0a9e('0x10c')](_0x50985c);}})['then'](function(_0x46efaa){if(_0x46efaa){_0xc2ae55=_0x46efaa['length'];if(!_0x5f35e7[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x50985c['limit']=qs[_0x0a9e('0x26')](_0x5f35e7['query']['limit']);_0x50985c[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x5f35e7[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}return _0x2b8734[_0x0a9e('0x10c')](_0x50985c);}})[_0x0a9e('0x18')](function(_0x5f3a18){if(_0x5f3a18){return _0x5f3a18?{'count':_0xc2ae55,'rows':_0x5f3a18}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x209ece,null))[_0x0a9e('0x52')](handleError(_0x209ece,null));};exports[_0x0a9e('0x10e')]=function(_0x469b84,_0x3f3cd9,_0x4e4cc0){return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x469b84[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x3f3cd9,null))[_0x0a9e('0x18')](function(_0x96d549){if(_0x96d549){return _0x96d549[_0x0a9e('0x10e')](_0x469b84[_0x0a9e('0x55')][_0x0a9e('0x5a')],_[_0x0a9e('0x59')](_0x469b84[_0x0a9e('0x55')],[_0x0a9e('0x5a'),'id'])||{});}})[_0x0a9e('0x18')](respondWithResult(_0x3f3cd9,null))['catch'](handleError(_0x3f3cd9,null));};exports['removeOpenchannelAccounts']=function(_0xdfcc9c,_0x2aca7e,_0x57a8e5){var _0x22661e;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0xdfcc9c[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x2aca7e,null))['then'](function(_0x5d85ab){if(_0x5d85ab){return _0x5d85ab['removeOpenchannelAccounts'](_0xdfcc9c[_0x0a9e('0x3a')][_0x0a9e('0x5a')]);}})[_0x0a9e('0x18')](respondWithStatusCode(_0x2aca7e,null))[_0x0a9e('0x52')](handleError(_0x2aca7e,null));};exports[_0x0a9e('0x10f')]=function(_0xa2a2a2,_0x571e02,_0x3e144e){var _0x44c694={};var _0x4ee67f={};var _0x4a0c23;var _0x414829;return db[_0x0a9e('0x32')][_0x0a9e('0xa5')]({'where':{'id':_0xa2a2a2[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x571e02,null))[_0x0a9e('0x18')](function(_0x257f32){if(_0x257f32){_0x4a0c23=_0x257f32;_0x4ee67f[_0x0a9e('0x3c')]=_[_0x0a9e('0x35')](db[_0x0a9e('0x110')]['rawAttributes']);_0x4ee67f[_0x0a9e('0x3a')]=_['keys'](_0xa2a2a2['query']);_0x4ee67f[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0x4ee67f[_0x0a9e('0x3c')],_0x4ee67f[_0x0a9e('0x3a')]);_0x44c694[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x4ee67f[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0xa2a2a2[_0x0a9e('0x3a')]['fields']));_0x44c694[_0x0a9e('0x3e')]=_0x44c694[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x44c694['attributes']:_0x4ee67f[_0x0a9e('0x3c')];_0x44c694[_0x0a9e('0x41')]=qs['sort'](_0xa2a2a2['query']['sort']);_0x44c694['where']=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0xa2a2a2['query'],_0x4ee67f[_0x0a9e('0x44')]));if(_0xa2a2a2['query'][_0x0a9e('0x49')]){_0x44c694[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x44c694['where'],{'$or':_['map'](_0x44c694[_0x0a9e('0x3e')],function(_0x14c011){var _0xb68b={};_0xb68b[_0x14c011]={'$like':'%'+_0xa2a2a2[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0xb68b;})});}_0x44c694=_[_0x0a9e('0x48')]({},_0x44c694,_0xa2a2a2[_0x0a9e('0x4d')]);return _0x4a0c23[_0x0a9e('0x10f')](_0x44c694);}})[_0x0a9e('0x18')](function(_0x26c59b){if(_0x26c59b){_0x414829=_0x26c59b[_0x0a9e('0x3f')];if(!_0xa2a2a2['query'][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x44c694['limit']=qs['limit'](_0xa2a2a2[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x44c694[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0xa2a2a2[_0x0a9e('0x3a')]['offset']);}return _0x4a0c23[_0x0a9e('0x10f')](_0x44c694);}})[_0x0a9e('0x18')](function(_0x4c4796){if(_0x4c4796){return _0x4c4796?{'count':_0x414829,'rows':_0x4c4796}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x571e02,null))['catch'](handleError(_0x571e02,null));};exports['addSmsAccounts']=function(_0x4c322e,_0x2b1277,_0x7725f5){return db['User']['find']({'where':{'id':_0x4c322e[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x2b1277,null))[_0x0a9e('0x18')](function(_0x1682dc){if(_0x1682dc){return _0x1682dc['addSmsAccounts'](_0x4c322e[_0x0a9e('0x55')][_0x0a9e('0x5a')],_[_0x0a9e('0x59')](_0x4c322e['body'],[_0x0a9e('0x5a'),'id'])||{});}})[_0x0a9e('0x18')](respondWithResult(_0x2b1277,null))[_0x0a9e('0x52')](handleError(_0x2b1277,null));};exports[_0x0a9e('0x111')]=function(_0x2cdbbf,_0x5a240f,_0x5b862a){var _0x171660;return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x2cdbbf['params']['id']}})['then'](handleEntityNotFound(_0x5a240f,null))['then'](function(_0x5a273b){if(_0x5a273b){return _0x5a273b[_0x0a9e('0x111')](_0x2cdbbf[_0x0a9e('0x3a')][_0x0a9e('0x5a')]);}})[_0x0a9e('0x18')](respondWithStatusCode(_0x5a240f,null))[_0x0a9e('0x52')](handleError(_0x5a240f,null));};exports['getChatWebsites']=function(_0x28e662,_0x9148f0,_0x34f39f){var _0x2e40a9={};var _0x27c479={};var _0x4a76c1;var _0x26328e;return db[_0x0a9e('0x32')][_0x0a9e('0xa5')]({'where':{'id':_0x28e662[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x9148f0,null))['then'](function(_0xfe400d){if(_0xfe400d){_0x4a76c1=_0xfe400d;_0x27c479[_0x0a9e('0x3c')]=_['keys'](db['ChatWebsite']['rawAttributes']);_0x27c479[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x28e662['query']);_0x27c479[_0x0a9e('0x44')]=_['intersection'](_0x27c479['model'],_0x27c479['query']);_0x2e40a9['attributes']=_[_0x0a9e('0x3b')](_0x27c479[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x28e662[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x2e40a9[_0x0a9e('0x3e')]=_0x2e40a9[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x2e40a9[_0x0a9e('0x3e')]:_0x27c479[_0x0a9e('0x3c')];_0x2e40a9[_0x0a9e('0x41')]=qs['sort'](_0x28e662[_0x0a9e('0x3a')]['sort']);_0x2e40a9[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_[_0x0a9e('0x45')](_0x28e662[_0x0a9e('0x3a')],_0x27c479[_0x0a9e('0x44')]));if(_0x28e662[_0x0a9e('0x3a')][_0x0a9e('0x49')]){_0x2e40a9[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x2e40a9['where'],{'$or':_['map'](_0x2e40a9['attributes'],function(_0x3bba5f){var _0x314b2c={};_0x314b2c[_0x3bba5f]={'$like':'%'+_0x28e662[_0x0a9e('0x3a')]['filter']+'%'};return _0x314b2c;})});}_0x2e40a9=_[_0x0a9e('0x48')]({},_0x2e40a9,_0x28e662[_0x0a9e('0x4d')]);return _0x4a76c1[_0x0a9e('0x112')](_0x2e40a9);}})['then'](function(_0x3a5d9d){if(_0x3a5d9d){_0x26328e=_0x3a5d9d[_0x0a9e('0x3f')];if(!_0x28e662[_0x0a9e('0x3a')][_0x0a9e('0x40')]('nolimit')){_0x2e40a9[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x28e662[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x2e40a9[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x28e662[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}return _0x4a76c1[_0x0a9e('0x112')](_0x2e40a9);}})[_0x0a9e('0x18')](function(_0x55e562){if(_0x55e562){return _0x55e562?{'count':_0x26328e,'rows':_0x55e562}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x9148f0,null))['catch'](handleError(_0x9148f0,null));};exports[_0x0a9e('0x113')]=function(_0x5108bf,_0x447663,_0x326b17){return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x5108bf[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x447663,null))['then'](function(_0x27ac89){if(_0x27ac89){return _0x27ac89['addChatWebsites'](_0x5108bf[_0x0a9e('0x55')][_0x0a9e('0x5a')],_[_0x0a9e('0x59')](_0x5108bf['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x447663,null))[_0x0a9e('0x52')](handleError(_0x447663,null));};exports[_0x0a9e('0x114')]=function(_0x21c1d0,_0x390d4a,_0x5d00c){var _0x268bb4;return db['User'][_0x0a9e('0x56')]({'where':{'id':_0x21c1d0[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x390d4a,null))[_0x0a9e('0x18')](function(_0x507582){if(_0x507582){return _0x507582[_0x0a9e('0x114')](_0x21c1d0[_0x0a9e('0x3a')]['ids']);}})[_0x0a9e('0x18')](respondWithStatusCode(_0x390d4a,null))[_0x0a9e('0x52')](handleError(_0x390d4a,null));};exports[_0x0a9e('0x115')]=function(_0x4c0f5a,_0x10c613,_0x4d103c){var _0x365e04={};var _0x586884={};var _0x34a03b;var _0xb077af;return db['User'][_0x0a9e('0xa5')]({'where':{'id':_0x4c0f5a[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x10c613,null))['then'](function(_0x12b323){if(_0x12b323){_0x34a03b=_0x12b323;_0x586884['model']=_[_0x0a9e('0x35')](db[_0x0a9e('0x116')][_0x0a9e('0x33')]);_0x586884[_0x0a9e('0x3a')]=_[_0x0a9e('0x35')](_0x4c0f5a['query']);_0x586884[_0x0a9e('0x44')]=_[_0x0a9e('0x3b')](_0x586884[_0x0a9e('0x3c')],_0x586884[_0x0a9e('0x3a')]);_0x365e04[_0x0a9e('0x3e')]=_[_0x0a9e('0x3b')](_0x586884[_0x0a9e('0x3c')],qs[_0x0a9e('0x3d')](_0x4c0f5a[_0x0a9e('0x3a')][_0x0a9e('0x3d')]));_0x365e04[_0x0a9e('0x3e')]=_0x365e04[_0x0a9e('0x3e')][_0x0a9e('0x3f')]?_0x365e04[_0x0a9e('0x3e')]:_0x586884[_0x0a9e('0x3c')];_0x365e04[_0x0a9e('0x41')]=qs['sort'](_0x4c0f5a[_0x0a9e('0x3a')]['sort']);_0x365e04[_0x0a9e('0x43')]=qs[_0x0a9e('0x44')](_['pick'](_0x4c0f5a[_0x0a9e('0x3a')],_0x586884[_0x0a9e('0x44')]));if(_0x4c0f5a['query'][_0x0a9e('0x49')]){_0x365e04[_0x0a9e('0x43')]=_[_0x0a9e('0x48')](_0x365e04['where'],{'$or':_[_0x0a9e('0x4a')](_0x365e04['attributes'],function(_0x48db5d){var _0x4ce13d={};_0x4ce13d[_0x48db5d]={'$like':'%'+_0x4c0f5a[_0x0a9e('0x3a')][_0x0a9e('0x49')]+'%'};return _0x4ce13d;})});}_0x365e04=_[_0x0a9e('0x48')]({},_0x365e04,_0x4c0f5a[_0x0a9e('0x4d')]);return _0x34a03b[_0x0a9e('0x115')](_0x365e04);}})[_0x0a9e('0x18')](function(_0x29a2e7){if(_0x29a2e7){_0xb077af=_0x29a2e7[_0x0a9e('0x3f')];if(!_0x4c0f5a[_0x0a9e('0x3a')][_0x0a9e('0x40')](_0x0a9e('0xa9'))){_0x365e04[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x4c0f5a[_0x0a9e('0x3a')][_0x0a9e('0x26')]);_0x365e04[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x4c0f5a[_0x0a9e('0x3a')][_0x0a9e('0x25')]);}return _0x34a03b[_0x0a9e('0x115')](_0x365e04);}})[_0x0a9e('0x18')](function(_0x54563a){if(_0x54563a){return _0x54563a?{'count':_0xb077af,'rows':_0x54563a}:null;}})[_0x0a9e('0x18')](respondWithResult(_0x10c613,null))['catch'](handleError(_0x10c613,null));};exports[_0x0a9e('0x117')]=function(_0x13cc29,_0x4287c0,_0x4b323b){return db[_0x0a9e('0x32')][_0x0a9e('0x56')]({'where':{'id':_0x13cc29[_0x0a9e('0x54')]['id']}})['then'](handleEntityNotFound(_0x4287c0,null))[_0x0a9e('0x18')](function(_0xfcbada){if(_0xfcbada){return _0xfcbada[_0x0a9e('0x117')](_0x13cc29[_0x0a9e('0x55')][_0x0a9e('0x5a')],_[_0x0a9e('0x59')](_0x13cc29[_0x0a9e('0x55')],['ids','id'])||{});}})[_0x0a9e('0x18')](respondWithResult(_0x4287c0,null))[_0x0a9e('0x52')](handleError(_0x4287c0,null));};exports[_0x0a9e('0x118')]=function(_0x504887,_0x596a8c,_0x360bc2){var _0x1879ab;return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x504887[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x18')](handleEntityNotFound(_0x596a8c,null))[_0x0a9e('0x18')](function(_0x261cf7){if(_0x261cf7){return _0x261cf7[_0x0a9e('0x118')](_0x504887[_0x0a9e('0x3a')]['ids']);}})[_0x0a9e('0x18')](respondWithStatusCode(_0x596a8c,null))[_0x0a9e('0x52')](handleError(_0x596a8c,null));};
\ No newline at end of file
index 33f758e..a6b824e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb','User'];(function(_0x2007e6,_0x43b204){var _0x31a410=function(_0x3a0186){while(--_0x3a0186){_0x2007e6['push'](_0x2007e6['shift']());}};_0x31a410(++_0x43b204);}(_0x2ef3,0xba));var _0x32ef=function(_0x1a70d3,_0x2d91bb){_0x1a70d3=_0x1a70d3-0x0;var _0x4a2b75=_0x2ef3[_0x1a70d3];return _0x4a2b75;};'use strict';var EventEmitter=require(_0x32ef('0x0'));var User=require(_0x32ef('0x1'))['db'][_0x32ef('0x2')];var UserEvents=new EventEmitter();UserEvents[_0x32ef('0x3')](0x0);var events={'afterCreate':_0x32ef('0x4'),'afterUpdate':_0x32ef('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38f865){return function(_0x38b7f3,_0x524ab6,_0x402857){UserEvents[_0x32ef('0x6')](_0x38f865+':'+_0x38b7f3['id'],_0x38b7f3);UserEvents['emit'](_0x38f865,_0x38b7f3);_0x402857(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];User[_0x32ef('0x7')](e,emitEvent(event));}}module[_0x32ef('0x8')]=UserEvents;
\ No newline at end of file
+var _0x1967=['exports','../../mysqldb','User','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xa6173c,_0xa8066b){var _0x3869fa=function(_0x33211b){while(--_0x33211b){_0xa6173c['push'](_0xa6173c['shift']());}};_0x3869fa(++_0xa8066b);}(_0x1967,0x173));var _0x7196=function(_0x328871,_0x282764){_0x328871=_0x328871-0x0;var _0x28ad99=_0x1967[_0x328871];return _0x28ad99;};'use strict';var EventEmitter=require('events');var User=require(_0x7196('0x0'))['db'][_0x7196('0x1')];var UserEvents=new EventEmitter();UserEvents[_0x7196('0x2')](0x0);var events={'afterCreate':_0x7196('0x3'),'afterUpdate':_0x7196('0x4'),'afterDestroy':_0x7196('0x5')};function emitEvent(_0x302f34){return function(_0x1aaddd,_0x458ae8,_0x3ae43f){UserEvents['emit'](_0x302f34+':'+_0x1aaddd['id'],_0x1aaddd);UserEvents[_0x7196('0x6')](_0x302f34,_0x1aaddd);_0x3ae43f(null);};}for(var e in events){if(events[_0x7196('0x7')](e)){var event=events[e];User[_0x7196('0x8')](e,emitEvent(event));}}module[_0x7196('0x9')]=UserEvents;
\ No newline at end of file
index 277d6b4..8bde0a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['findAll','internal','concat','catch','exports','define','User','users','utf8','utf8_bin','updateMd5Password','changed','updatePassword','bulkCreate','chanspy','then','VoiceExtension','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','salt','base64','sha1','pbkdf2','indexOf','Invalid\x20password','makeSalt','md5secret','bluebird','crypto','util','./user.attributes','length','context','from-sip','system','format','%s%s','prefix','record','push','merge','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','wav','gsm','Set','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','Hangup','priority','defaults'];(function(_0x396248,_0x5b7ff2){var _0x568f77=function(_0x4a5108){while(--_0x4a5108){_0x396248['push'](_0x396248['shift']());}};_0x568f77(++_0x5b7ff2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var BPromise=require(_0x0a9e('0x0'));var crypto=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var md5=require('md5');var _=require('lodash');var attributes=require(_0x0a9e('0x3'));var authTypes=['google'];var validatePresenceOf=function(_0x333808){return _0x333808&&_0x333808[_0x0a9e('0x4')];};var getChanSpyApplications=function(_0x2ab90b,_0x991246,_0x981158){var _0x57b080={'context':_0x2ab90b[_0x0a9e('0x5')]||_0x0a9e('0x6'),'type':_0x0a9e('0x7'),'isApp':![],'UserId':_0x2ab90b['id']};var _0x5f41ea=[];for(var _0x503809=0x0,_0xe42b77=0x1;_0x503809<_0x981158['length'];_0x503809++,_0xe42b77=0x1){var _0x52cace={'exten':util[_0x0a9e('0x8')](_0x0a9e('0x9'),_0x981158[_0x503809][_0x0a9e('0xa')],_0x991246),'ChanSpyId':_0x981158[_0x503809]['id']};if(_0x981158[_0x503809][_0x0a9e('0xb')]){_0x5f41ea[_0x0a9e('0xc')](_[_0x0a9e('0xd')]({'app':'MixMonitor','appdata':util['format']('${UNIQUEID}.%s,ab',_0x981158[_0x503809]['recordingFormat']),'priority':_0xe42b77++},_0x57b080,_0x52cace));}if(_0x981158[_0x503809][_0x0a9e('0xe')]){_0x5f41ea[_0x0a9e('0xc')](_[_0x0a9e('0xd')]({'app':_0x0a9e('0xf'),'appdata':_0x981158[_0x503809][_0x0a9e('0x10')],'priority':_0xe42b77++},_0x57b080,_0x52cace));}_0x5f41ea[_0x0a9e('0xc')](_['merge']({'app':_0x0a9e('0x11'),'appdata':util[_0x0a9e('0x8')](_0x0a9e('0x12'),_0x2ab90b[_0x0a9e('0x13')],_0x981158[_0x503809][_0x0a9e('0x14')]?_0x981158[_0x503809][_0x0a9e('0x14')]['join'](''):''),'priority':_0xe42b77++},_0x57b080,_0x52cace));if(_0x981158[_0x503809][_0x0a9e('0xb')]){_0x5f41ea['push'](_[_0x0a9e('0xd')]({'app':'StopMixMonitor','priority':_0xe42b77++},_0x57b080,_0x52cace));}}return _0x5f41ea;};var getUserApplications=function(_0x16033c,_0x12066b){var _0x48f32d=[_0x0a9e('0x15'),'WAV',_0x0a9e('0x16')];var _0x478723={'context':_0x16033c[_0x0a9e('0x5')]||_0x0a9e('0x6'),'exten':_0x12066b,'type':_0x0a9e('0x7'),'isApp':![],'UserId':_0x16033c['id']};var _0x2eb11f=[{'app':_0x0a9e('0x17'),'appdata':_0x0a9e('0x18')}];if(_0x16033c[_0x0a9e('0x19')]&&_[_0x0a9e('0x1a')](_0x48f32d,_0x16033c[_0x0a9e('0x19')])){_0x2eb11f[_0x0a9e('0xc')]({'app':'Set','appdata':_0x0a9e('0x1b')});_0x2eb11f[_0x0a9e('0xc')]({'app':'Set','appdata':util[_0x0a9e('0x8')]('_XCALLY_MIXMONITOR_FORMAT=%s',_0x16033c['extensionMonitor'])});_0x2eb11f[_0x0a9e('0xc')]({'app':_0x0a9e('0x1c'),'appdata':util[_0x0a9e('0x8')](_0x0a9e('0x1d'),_0x16033c['name'])});}else{_0x2eb11f[_0x0a9e('0xc')]({'app':_0x0a9e('0x1c'),'appdata':util[_0x0a9e('0x8')](_0x0a9e('0x1e'),_0x16033c[_0x0a9e('0x13')])});}_0x2eb11f[_0x0a9e('0xc')]({'app':_0x0a9e('0x1f')});for(var _0x5ea472=0x0;_0x5ea472<_0x2eb11f['length'];_0x5ea472++){_0x2eb11f[_0x5ea472][_0x0a9e('0x20')]=_0x5ea472+0x1;_0x2eb11f[_0x5ea472]=_[_0x0a9e('0x21')](_0x2eb11f[_0x5ea472],_0x478723);}return _0x2eb11f;};var getChanSpyPromise=function(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){return _0x40c424['VoiceChanSpy'][_0x0a9e('0x22')]()['then'](function(_0x1dc186){if(_0x1dc186){var _0x34dc65=getChanSpyApplications(_0x33161b,_0x33161b[_0x0a9e('0x23')],_0x1dc186);if(_0x33161b[_0x0a9e('0x23')]!=_0x33161b[_0x0a9e('0x13')]){_0x34dc65=_0x34dc65[_0x0a9e('0x24')](getChanSpyApplications(_0x33161b,_0x33161b[_0x0a9e('0x13')],_0x1dc186));}return _0x526cf3(_0x34dc65);}return _0x526cf3([]);})[_0x0a9e('0x25')](function(_0x5a101a){_0x384319(_0x5a101a);});});};module[_0x0a9e('0x26')]=function(_0x468813,_0x2b1f27){var _0x2ec755=_0x468813['models'];return _0x468813[_0x0a9e('0x27')](_0x0a9e('0x28'),attributes,{'tableName':_0x0a9e('0x29'),'charset':_0x0a9e('0x2a'),'collate':_0x0a9e('0x2b'),'hooks':{'beforeCreate':function(_0x563b45,_0x296f41,_0x2e8759){_0x563b45[_0x0a9e('0x2c')]();_0x563b45['updatePassword'](_0x2e8759);},'beforeUpdate':function(_0x426950,_0x5d1e0e,_0x2407f9){if(_0x426950[_0x0a9e('0x2d')](_0x0a9e('0x10'))){_0x426950[_0x0a9e('0x2c')]();return _0x426950[_0x0a9e('0x2e')](_0x2407f9);}_0x2407f9();},'afterCreate':function(_0x5180f1,_0x66c1d2,_0x46f0a5){var _0x40cb85=getUserApplications(_0x5180f1,_0x5180f1[_0x0a9e('0x23')]);if(_0x5180f1[_0x0a9e('0x23')]!=_0x5180f1[_0x0a9e('0x13')]){_0x40cb85=_0x40cb85[_0x0a9e('0x24')](getUserApplications(_0x5180f1,_0x5180f1[_0x0a9e('0x13')]));}return _0x2ec755['VoiceExtension'][_0x0a9e('0x2f')](_0x40cb85)['then'](function(){if(_0x5180f1[_0x0a9e('0x30')]){return getChanSpyPromise(_0x2ec755,_0x5180f1);}})[_0x0a9e('0x31')](function(_0x2b7e7f){if(_0x2b7e7f&&_0x2b7e7f[_0x0a9e('0x4')]){return _0x2ec755['VoiceExtension'][_0x0a9e('0x2f')](_0x2b7e7f);}})[_0x0a9e('0x31')](function(){_0x46f0a5();})[_0x0a9e('0x25')](function(_0x15de0e){_0x46f0a5(_0x15de0e);});},'afterUpdate':function(_0x4853b1,_0x54135e,_0x1e8694){return BPromise['resolve']()[_0x0a9e('0x31')](function(){if(_0x4853b1[_0x0a9e('0x2d')](_0x0a9e('0x30'))||_0x4853b1[_0x0a9e('0x2d')]('context')){return _0x2ec755[_0x0a9e('0x32')][_0x0a9e('0x33')]({'where':{'UserId':_0x4853b1['id'],'type':_0x0a9e('0x7'),'ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x4853b1[_0x0a9e('0x30')]){return getChanSpyPromise(_0x2ec755,_0x4853b1)[_0x0a9e('0x31')](function(_0x289467){if(_0x289467&&_0x289467['length']){return _0x2ec755['VoiceExtension'][_0x0a9e('0x2f')](_0x289467);}});}});}})[_0x0a9e('0x31')](function(){if(_0x4853b1['changed'](_0x0a9e('0x19'))||_0x4853b1[_0x0a9e('0x2d')](_0x0a9e('0x5'))){return _0x2ec755[_0x0a9e('0x32')]['destroy']({'where':{'UserId':_0x4853b1['id'],'type':'system','ChanSpyId':null}})[_0x0a9e('0x31')](function(){var _0x45b3d0=getUserApplications(_0x4853b1,_0x4853b1['internal']);if(_0x4853b1[_0x0a9e('0x23')]!=_0x4853b1[_0x0a9e('0x13')]){_0x45b3d0=_0x45b3d0[_0x0a9e('0x24')](getUserApplications(_0x4853b1,_0x4853b1['name']));}return _0x2ec755[_0x0a9e('0x32')][_0x0a9e('0x2f')](_0x45b3d0);});}})[_0x0a9e('0x31')](function(){_0x1e8694();})[_0x0a9e('0x25')](function(_0x13cb1f){_0x1e8694(_0x13cb1f);});},'afterDestroy':function(_0xeaa5e5,_0x2881b3){return _0x2ec755[_0x0a9e('0x32')][_0x0a9e('0x33')]({'where':{'UserId':_0xeaa5e5['id'],'type':_0x0a9e('0x7')}});}},'instanceMethods':{'authenticate':function(_0x2c3711,_0x148007){if(!_0x148007){return this[_0x0a9e('0x10')]===this[_0x0a9e('0x34')](_0x2c3711);}var _0x37f6cc=this;this['encryptPassword'](_0x2c3711,function(_0x52628e,_0x473fdc){if(_0x52628e){_0x148007(_0x52628e);}if(_0x37f6cc[_0x0a9e('0x10')]===_0x473fdc){_0x148007(null,!![]);}else{_0x148007(null,![]);}});},'makeSalt':function(_0x405c8f,_0x315881){var _0x1a69dd=0x10;if(typeof arguments[0x0]===_0x0a9e('0x35')){_0x315881=arguments[0x0];_0x405c8f=_0x1a69dd;}else if(typeof arguments[0x1]===_0x0a9e('0x35')){_0x315881=arguments[0x1];}else{throw new Error(_0x0a9e('0x36'));}if(!_0x405c8f){_0x405c8f=_0x1a69dd;}return crypto[_0x0a9e('0x37')](_0x405c8f,function(_0x25c6e6,_0x2c2cb0){if(_0x25c6e6){_0x315881(_0x25c6e6);}return _0x315881(null,_0x2c2cb0[_0x0a9e('0x38')]('base64'));});},'encryptPassword':function(_0x117c99,_0x138b8b){if(!_0x117c99||!this[_0x0a9e('0x39')]){return _0x138b8b?_0x138b8b(null):null;}var _0xfbd5ad=0x2710;var _0x2e8caf=0x40;var _0xbe9d19=new Buffer(this[_0x0a9e('0x39')],_0x0a9e('0x3a'));if(!_0x138b8b){return crypto['pbkdf2Sync'](_0x117c99,_0xbe9d19,_0xfbd5ad,_0x2e8caf,_0x0a9e('0x3b'))['toString'](_0x0a9e('0x3a'));}return crypto[_0x0a9e('0x3c')](_0x117c99,_0xbe9d19,_0xfbd5ad,_0x2e8caf,_0x0a9e('0x3b'),function(_0x562fb4,_0x14bec2){if(_0x562fb4){_0x138b8b(_0x562fb4);}return _0x138b8b(null,_0x14bec2[_0x0a9e('0x38')](_0x0a9e('0x3a')));});},'updatePassword':function(_0x34aa5a){if(!this[_0x0a9e('0x10')]){return _0x34aa5a(null);}if(!validatePresenceOf(this[_0x0a9e('0x10')])&&authTypes[_0x0a9e('0x3d')](this['provider'])===-0x1){_0x34aa5a(new Error(_0x0a9e('0x3e')));}var _0x1bde3c=this;this[_0x0a9e('0x3f')](function(_0x16f976,_0x409789){if(_0x16f976){return _0x34aa5a(_0x16f976);}_0x1bde3c[_0x0a9e('0x39')]=_0x409789;_0x1bde3c[_0x0a9e('0x34')](_0x1bde3c[_0x0a9e('0x10')],function(_0x34febd,_0x58a5c2){if(_0x34febd){_0x34aa5a(_0x34febd);}_0x1bde3c[_0x0a9e('0x10')]=_0x58a5c2;_0x34aa5a(null);});});},'updateMd5Password':function(){this[_0x0a9e('0x40')]=md5(this['name']+':asterisk:'+this['password']);return this[_0x0a9e('0x40')];}}});};
\ No newline at end of file
+var _0xa9e0=['findAll','internal','concat','catch','exports','define','User','users','utf8','utf8_bin','updateMd5Password','changed','updatePassword','bulkCreate','chanspy','then','VoiceExtension','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','salt','base64','sha1','pbkdf2','indexOf','Invalid\x20password','makeSalt','md5secret','bluebird','crypto','util','./user.attributes','length','context','from-sip','system','format','%s%s','prefix','record','push','merge','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','wav','gsm','Set','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','Hangup','priority','defaults'];(function(_0x40bcef,_0x319d5f){var _0x340971=function(_0x22a0e0){while(--_0x22a0e0){_0x40bcef['push'](_0x40bcef['shift']());}};_0x340971(++_0x319d5f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var BPromise=require(_0x0a9e('0x0'));var crypto=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var md5=require('md5');var _=require('lodash');var attributes=require(_0x0a9e('0x3'));var authTypes=['google'];var validatePresenceOf=function(_0x333808){return _0x333808&&_0x333808[_0x0a9e('0x4')];};var getChanSpyApplications=function(_0x2ab90b,_0x991246,_0x981158){var _0x57b080={'context':_0x2ab90b[_0x0a9e('0x5')]||_0x0a9e('0x6'),'type':_0x0a9e('0x7'),'isApp':![],'UserId':_0x2ab90b['id']};var _0x5f41ea=[];for(var _0x503809=0x0,_0xe42b77=0x1;_0x503809<_0x981158['length'];_0x503809++,_0xe42b77=0x1){var _0x52cace={'exten':util[_0x0a9e('0x8')](_0x0a9e('0x9'),_0x981158[_0x503809][_0x0a9e('0xa')],_0x991246),'ChanSpyId':_0x981158[_0x503809]['id']};if(_0x981158[_0x503809][_0x0a9e('0xb')]){_0x5f41ea[_0x0a9e('0xc')](_[_0x0a9e('0xd')]({'app':'MixMonitor','appdata':util['format']('${UNIQUEID}.%s,ab',_0x981158[_0x503809]['recordingFormat']),'priority':_0xe42b77++},_0x57b080,_0x52cace));}if(_0x981158[_0x503809][_0x0a9e('0xe')]){_0x5f41ea[_0x0a9e('0xc')](_[_0x0a9e('0xd')]({'app':_0x0a9e('0xf'),'appdata':_0x981158[_0x503809][_0x0a9e('0x10')],'priority':_0xe42b77++},_0x57b080,_0x52cace));}_0x5f41ea[_0x0a9e('0xc')](_['merge']({'app':_0x0a9e('0x11'),'appdata':util[_0x0a9e('0x8')](_0x0a9e('0x12'),_0x2ab90b[_0x0a9e('0x13')],_0x981158[_0x503809][_0x0a9e('0x14')]?_0x981158[_0x503809][_0x0a9e('0x14')]['join'](''):''),'priority':_0xe42b77++},_0x57b080,_0x52cace));if(_0x981158[_0x503809][_0x0a9e('0xb')]){_0x5f41ea['push'](_[_0x0a9e('0xd')]({'app':'StopMixMonitor','priority':_0xe42b77++},_0x57b080,_0x52cace));}}return _0x5f41ea;};var getUserApplications=function(_0x16033c,_0x12066b){var _0x48f32d=[_0x0a9e('0x15'),'WAV',_0x0a9e('0x16')];var _0x478723={'context':_0x16033c[_0x0a9e('0x5')]||_0x0a9e('0x6'),'exten':_0x12066b,'type':_0x0a9e('0x7'),'isApp':![],'UserId':_0x16033c['id']};var _0x2eb11f=[{'app':_0x0a9e('0x17'),'appdata':_0x0a9e('0x18')}];if(_0x16033c[_0x0a9e('0x19')]&&_[_0x0a9e('0x1a')](_0x48f32d,_0x16033c[_0x0a9e('0x19')])){_0x2eb11f[_0x0a9e('0xc')]({'app':'Set','appdata':_0x0a9e('0x1b')});_0x2eb11f[_0x0a9e('0xc')]({'app':'Set','appdata':util[_0x0a9e('0x8')]('_XCALLY_MIXMONITOR_FORMAT=%s',_0x16033c['extensionMonitor'])});_0x2eb11f[_0x0a9e('0xc')]({'app':_0x0a9e('0x1c'),'appdata':util[_0x0a9e('0x8')](_0x0a9e('0x1d'),_0x16033c['name'])});}else{_0x2eb11f[_0x0a9e('0xc')]({'app':_0x0a9e('0x1c'),'appdata':util[_0x0a9e('0x8')](_0x0a9e('0x1e'),_0x16033c[_0x0a9e('0x13')])});}_0x2eb11f[_0x0a9e('0xc')]({'app':_0x0a9e('0x1f')});for(var _0x5ea472=0x0;_0x5ea472<_0x2eb11f['length'];_0x5ea472++){_0x2eb11f[_0x5ea472][_0x0a9e('0x20')]=_0x5ea472+0x1;_0x2eb11f[_0x5ea472]=_[_0x0a9e('0x21')](_0x2eb11f[_0x5ea472],_0x478723);}return _0x2eb11f;};var getChanSpyPromise=function(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){return _0x40c424['VoiceChanSpy'][_0x0a9e('0x22')]()['then'](function(_0x1dc186){if(_0x1dc186){var _0x34dc65=getChanSpyApplications(_0x33161b,_0x33161b[_0x0a9e('0x23')],_0x1dc186);if(_0x33161b[_0x0a9e('0x23')]!=_0x33161b[_0x0a9e('0x13')]){_0x34dc65=_0x34dc65[_0x0a9e('0x24')](getChanSpyApplications(_0x33161b,_0x33161b[_0x0a9e('0x13')],_0x1dc186));}return _0x526cf3(_0x34dc65);}return _0x526cf3([]);})[_0x0a9e('0x25')](function(_0x5a101a){_0x384319(_0x5a101a);});});};module[_0x0a9e('0x26')]=function(_0x468813,_0x2b1f27){var _0x2ec755=_0x468813['models'];return _0x468813[_0x0a9e('0x27')](_0x0a9e('0x28'),attributes,{'tableName':_0x0a9e('0x29'),'charset':_0x0a9e('0x2a'),'collate':_0x0a9e('0x2b'),'hooks':{'beforeCreate':function(_0x563b45,_0x296f41,_0x2e8759){_0x563b45[_0x0a9e('0x2c')]();_0x563b45['updatePassword'](_0x2e8759);},'beforeUpdate':function(_0x426950,_0x5d1e0e,_0x2407f9){if(_0x426950[_0x0a9e('0x2d')](_0x0a9e('0x10'))){_0x426950[_0x0a9e('0x2c')]();return _0x426950[_0x0a9e('0x2e')](_0x2407f9);}_0x2407f9();},'afterCreate':function(_0x5180f1,_0x66c1d2,_0x46f0a5){var _0x40cb85=getUserApplications(_0x5180f1,_0x5180f1[_0x0a9e('0x23')]);if(_0x5180f1[_0x0a9e('0x23')]!=_0x5180f1[_0x0a9e('0x13')]){_0x40cb85=_0x40cb85[_0x0a9e('0x24')](getUserApplications(_0x5180f1,_0x5180f1[_0x0a9e('0x13')]));}return _0x2ec755['VoiceExtension'][_0x0a9e('0x2f')](_0x40cb85)['then'](function(){if(_0x5180f1[_0x0a9e('0x30')]){return getChanSpyPromise(_0x2ec755,_0x5180f1);}})[_0x0a9e('0x31')](function(_0x2b7e7f){if(_0x2b7e7f&&_0x2b7e7f[_0x0a9e('0x4')]){return _0x2ec755['VoiceExtension'][_0x0a9e('0x2f')](_0x2b7e7f);}})[_0x0a9e('0x31')](function(){_0x46f0a5();})[_0x0a9e('0x25')](function(_0x15de0e){_0x46f0a5(_0x15de0e);});},'afterUpdate':function(_0x4853b1,_0x54135e,_0x1e8694){return BPromise['resolve']()[_0x0a9e('0x31')](function(){if(_0x4853b1[_0x0a9e('0x2d')](_0x0a9e('0x30'))||_0x4853b1[_0x0a9e('0x2d')]('context')){return _0x2ec755[_0x0a9e('0x32')][_0x0a9e('0x33')]({'where':{'UserId':_0x4853b1['id'],'type':_0x0a9e('0x7'),'ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x4853b1[_0x0a9e('0x30')]){return getChanSpyPromise(_0x2ec755,_0x4853b1)[_0x0a9e('0x31')](function(_0x289467){if(_0x289467&&_0x289467['length']){return _0x2ec755['VoiceExtension'][_0x0a9e('0x2f')](_0x289467);}});}});}})[_0x0a9e('0x31')](function(){if(_0x4853b1['changed'](_0x0a9e('0x19'))||_0x4853b1[_0x0a9e('0x2d')](_0x0a9e('0x5'))){return _0x2ec755[_0x0a9e('0x32')]['destroy']({'where':{'UserId':_0x4853b1['id'],'type':'system','ChanSpyId':null}})[_0x0a9e('0x31')](function(){var _0x45b3d0=getUserApplications(_0x4853b1,_0x4853b1['internal']);if(_0x4853b1[_0x0a9e('0x23')]!=_0x4853b1[_0x0a9e('0x13')]){_0x45b3d0=_0x45b3d0[_0x0a9e('0x24')](getUserApplications(_0x4853b1,_0x4853b1['name']));}return _0x2ec755[_0x0a9e('0x32')][_0x0a9e('0x2f')](_0x45b3d0);});}})[_0x0a9e('0x31')](function(){_0x1e8694();})[_0x0a9e('0x25')](function(_0x13cb1f){_0x1e8694(_0x13cb1f);});},'afterDestroy':function(_0xeaa5e5,_0x2881b3){return _0x2ec755[_0x0a9e('0x32')][_0x0a9e('0x33')]({'where':{'UserId':_0xeaa5e5['id'],'type':_0x0a9e('0x7')}});}},'instanceMethods':{'authenticate':function(_0x2c3711,_0x148007){if(!_0x148007){return this[_0x0a9e('0x10')]===this[_0x0a9e('0x34')](_0x2c3711);}var _0x37f6cc=this;this['encryptPassword'](_0x2c3711,function(_0x52628e,_0x473fdc){if(_0x52628e){_0x148007(_0x52628e);}if(_0x37f6cc[_0x0a9e('0x10')]===_0x473fdc){_0x148007(null,!![]);}else{_0x148007(null,![]);}});},'makeSalt':function(_0x405c8f,_0x315881){var _0x1a69dd=0x10;if(typeof arguments[0x0]===_0x0a9e('0x35')){_0x315881=arguments[0x0];_0x405c8f=_0x1a69dd;}else if(typeof arguments[0x1]===_0x0a9e('0x35')){_0x315881=arguments[0x1];}else{throw new Error(_0x0a9e('0x36'));}if(!_0x405c8f){_0x405c8f=_0x1a69dd;}return crypto[_0x0a9e('0x37')](_0x405c8f,function(_0x25c6e6,_0x2c2cb0){if(_0x25c6e6){_0x315881(_0x25c6e6);}return _0x315881(null,_0x2c2cb0[_0x0a9e('0x38')]('base64'));});},'encryptPassword':function(_0x117c99,_0x138b8b){if(!_0x117c99||!this[_0x0a9e('0x39')]){return _0x138b8b?_0x138b8b(null):null;}var _0xfbd5ad=0x2710;var _0x2e8caf=0x40;var _0xbe9d19=new Buffer(this[_0x0a9e('0x39')],_0x0a9e('0x3a'));if(!_0x138b8b){return crypto['pbkdf2Sync'](_0x117c99,_0xbe9d19,_0xfbd5ad,_0x2e8caf,_0x0a9e('0x3b'))['toString'](_0x0a9e('0x3a'));}return crypto[_0x0a9e('0x3c')](_0x117c99,_0xbe9d19,_0xfbd5ad,_0x2e8caf,_0x0a9e('0x3b'),function(_0x562fb4,_0x14bec2){if(_0x562fb4){_0x138b8b(_0x562fb4);}return _0x138b8b(null,_0x14bec2[_0x0a9e('0x38')](_0x0a9e('0x3a')));});},'updatePassword':function(_0x34aa5a){if(!this[_0x0a9e('0x10')]){return _0x34aa5a(null);}if(!validatePresenceOf(this[_0x0a9e('0x10')])&&authTypes[_0x0a9e('0x3d')](this['provider'])===-0x1){_0x34aa5a(new Error(_0x0a9e('0x3e')));}var _0x1bde3c=this;this[_0x0a9e('0x3f')](function(_0x16f976,_0x409789){if(_0x16f976){return _0x34aa5a(_0x16f976);}_0x1bde3c[_0x0a9e('0x39')]=_0x409789;_0x1bde3c[_0x0a9e('0x34')](_0x1bde3c[_0x0a9e('0x10')],function(_0x34febd,_0x58a5c2){if(_0x34febd){_0x34aa5a(_0x34febd);}_0x1bde3c[_0x0a9e('0x10')]=_0x58a5c2;_0x34aa5a(null);});});},'updateMd5Password':function(){this[_0x0a9e('0x40')]=md5(this['name']+':asterisk:'+this['password']);return this[_0x0a9e('0x40')];}}});};
\ No newline at end of file
index 5210a00..f828c03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb67=['getChannels','forEach','push','YYYY-MM-DD\x20HH:mm:ss','type','DEFAULT\x20PAUSE','body','uniqueid','bulkCreate','update','UnpauseUser','findOne','channel','voice','find','system','mail','chat','sms','openchannel','set','all','LogoutUser','destroy','LoginUser','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','interface','UserVoiceQueue.penalty','merge','LOGIN','callysquare','loginInPause','LOGININPAUSE','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','localhost','./user.socket','register','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','code','User,\x20%s,\x20%s','message','result','catch','User','findAll','options','where','attributes','limit','include','map','model','GetUser','stringify','ShowUser','raw','PauseUser','name','role','internal','UserVoiceQueueRt','MemberReport','format','%s/%s','SIP','PAUSE','length','updateAttributes'];(function(_0x47d14f,_0x2d8cc1){var _0x2f1b0f=function(_0x5e74c8){while(--_0x5e74c8){_0x47d14f['push'](_0x47d14f['shift']());}};_0x2f1b0f(++_0x2d8cc1);}(_0xfb67,0xdd));var _0x7fb6=function(_0x2449e2,_0x23daab){_0x2449e2=_0x2449e2-0x0;var _0x1c07b2=_0xfb67[_0x2449e2];return _0x1c07b2;};'use strict';var _=require(_0x7fb6('0x0'));var util=require(_0x7fb6('0x1'));var moment=require(_0x7fb6('0x2'));var BPromise=require(_0x7fb6('0x3'));var rs=require(_0x7fb6('0x4'));var fs=require('fs');var db=require(_0x7fb6('0x5'))['db'];var utils=require(_0x7fb6('0x6'));var logger=require('../../config/logger')(_0x7fb6('0x7'));var config=require(_0x7fb6('0x8'));var jayson=require(_0x7fb6('0x9'));var client=jayson[_0x7fb6('0xa')][_0x7fb6('0xb')]({'port':0x232a});var socket=require('socket.io-emitter')({'host':_0x7fb6('0xc'),'port':0x18eb});require(_0x7fb6('0xd'))[_0x7fb6('0xe')](socket);function respondWithRpcPromise(_0x485f45,_0x168ebb,_0x696959){return new BPromise(function(_0x5103bc,_0x27f819){return client[_0x7fb6('0xf')](_0x485f45,_0x696959)[_0x7fb6('0x10')](function(_0x55e8a0){logger[_0x7fb6('0x11')]('User,\x20%s,\x20%s',_0x168ebb,_0x7fb6('0x12'));logger[_0x7fb6('0x13')](_0x7fb6('0x14'),_0x168ebb,_0x7fb6('0x12'),JSON['stringify'](_0x55e8a0));if(_0x55e8a0[_0x7fb6('0x15')]){if(_0x55e8a0[_0x7fb6('0x15')][_0x7fb6('0x16')]===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x168ebb,_0x55e8a0['error']['message']);return _0x27f819(_0x55e8a0['error']['message']);}logger[_0x7fb6('0x15')](_0x7fb6('0x17'),_0x168ebb,_0x55e8a0['error'][_0x7fb6('0x18')]);return _0x5103bc(_0x55e8a0[_0x7fb6('0x15')][_0x7fb6('0x18')]);}else{logger[_0x7fb6('0x11')](_0x7fb6('0x17'),_0x168ebb,_0x7fb6('0x12'));_0x5103bc(_0x55e8a0[_0x7fb6('0x19')][_0x7fb6('0x18')]);}})[_0x7fb6('0x1a')](function(_0x3b2493){logger[_0x7fb6('0x15')](_0x7fb6('0x17'),_0x168ebb,_0x3b2493);_0x27f819(_0x3b2493);});});}exports['GetUser']=function(_0x70c3a5){var _0x426508=this;return new Promise(function(_0x234226,_0x169389){return db[_0x7fb6('0x1b')][_0x7fb6('0x1c')]({'raw':_0x70c3a5[_0x7fb6('0x1d')]?_0x70c3a5['options']['raw']===undefined?!![]:![]:!![],'where':_0x70c3a5[_0x7fb6('0x1d')]?_0x70c3a5[_0x7fb6('0x1d')][_0x7fb6('0x1e')]||null:null,'attributes':_0x70c3a5[_0x7fb6('0x1d')]?_0x70c3a5['options'][_0x7fb6('0x1f')]||null:null,'limit':_0x70c3a5[_0x7fb6('0x1d')]?_0x70c3a5['options'][_0x7fb6('0x20')]||null:null,'include':_0x70c3a5['options']?_0x70c3a5['options'][_0x7fb6('0x21')]?_['map'](_0x70c3a5['options']['include'],function(_0x455916){return{'model':db[_0x455916['model']],'as':_0x455916['as'],'attributes':_0x455916[_0x7fb6('0x1f')],'include':_0x455916['include']?_[_0x7fb6('0x22')](_0x455916[_0x7fb6('0x21')],function(_0x37a754){return{'model':db[_0x37a754[_0x7fb6('0x23')]],'as':_0x37a754['as'],'attributes':_0x37a754[_0x7fb6('0x1f')],'include':_0x37a754['include']?_[_0x7fb6('0x22')](_0x37a754['include'],function(_0x21a045){return{'model':db[_0x21a045[_0x7fb6('0x23')]],'as':_0x21a045['as'],'attributes':_0x21a045['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x57beb1){logger[_0x7fb6('0x11')](_0x7fb6('0x24'),_0x70c3a5);logger[_0x7fb6('0x13')](_0x7fb6('0x24'),_0x70c3a5,JSON[_0x7fb6('0x25')](_0x57beb1));_0x234226(_0x57beb1);})[_0x7fb6('0x1a')](function(_0x4f43dc){logger[_0x7fb6('0x15')]('GetUser',_0x4f43dc[_0x7fb6('0x18')],_0x70c3a5);_0x169389(_0x426508[_0x7fb6('0x15')](0x1f4,_0x4f43dc[_0x7fb6('0x18')]));});});};exports[_0x7fb6('0x26')]=function(_0x4b1722){var _0x100314=this;return new Promise(function(_0x39e0c5,_0x4f101b){return db[_0x7fb6('0x1b')]['find']({'raw':_0x4b1722[_0x7fb6('0x1d')]?_0x4b1722[_0x7fb6('0x1d')][_0x7fb6('0x27')]===undefined?!![]:![]:!![],'where':_0x4b1722[_0x7fb6('0x1d')]?_0x4b1722[_0x7fb6('0x1d')][_0x7fb6('0x1e')]||null:null,'attributes':_0x4b1722[_0x7fb6('0x1d')]?_0x4b1722[_0x7fb6('0x1d')][_0x7fb6('0x1f')]||null:null,'include':_0x4b1722['options']?_0x4b1722[_0x7fb6('0x1d')][_0x7fb6('0x21')]?_[_0x7fb6('0x22')](_0x4b1722[_0x7fb6('0x1d')]['include'],function(_0x5a1035){return{'model':db[_0x5a1035[_0x7fb6('0x23')]],'as':_0x5a1035['as'],'attributes':_0x5a1035[_0x7fb6('0x1f')],'include':_0x5a1035[_0x7fb6('0x21')]?_[_0x7fb6('0x22')](_0x5a1035[_0x7fb6('0x21')],function(_0x492a9c){return{'model':db[_0x492a9c[_0x7fb6('0x23')]],'as':_0x492a9c['as'],'attributes':_0x492a9c[_0x7fb6('0x1f')],'include':_0x492a9c[_0x7fb6('0x21')]?_[_0x7fb6('0x22')](_0x492a9c['include'],function(_0x430bfc){return{'model':db[_0x430bfc[_0x7fb6('0x23')]],'as':_0x430bfc['as'],'attributes':_0x430bfc['attributes']};}):[]};}):[]};}):[]:[]})[_0x7fb6('0x10')](function(_0x49aa3e){logger[_0x7fb6('0x11')]('ShowUser',_0x4b1722);logger[_0x7fb6('0x13')]('ShowUser',_0x4b1722,JSON[_0x7fb6('0x25')](_0x49aa3e));_0x39e0c5(_0x49aa3e);})[_0x7fb6('0x1a')](function(_0xbf8c2d){logger[_0x7fb6('0x15')](_0x7fb6('0x26'),_0xbf8c2d[_0x7fb6('0x18')],_0x4b1722);_0x4f101b(_0x100314['error'](0x1f4,_0xbf8c2d['message']));});});};exports[_0x7fb6('0x28')]=function(_0x36b4cc){var _0x253652=this;return new Promise(function(_0xa14677,_0x566490){var _0x546008;return db[_0x7fb6('0x1b')]['find']({'where':_0x36b4cc[_0x7fb6('0x1d')][_0x7fb6('0x1e')]||{},'attributes':['id',_0x7fb6('0x29'),_0x7fb6('0x2a'),_0x7fb6('0x2b')]})[_0x7fb6('0x10')](function(_0xa90e5e){if(_0xa90e5e){_0x546008=_0xa90e5e;return db[_0x7fb6('0x2c')]['update']({'paused':0x1},{'where':{'UserId':_0x546008['id']},'individualHooks':!![]});}})['then'](function(){if(_0x546008){return db[_0x7fb6('0x2d')]['findAll']({'where':{'membername':_0x546008[_0x7fb6('0x29')],'interface':util[_0x7fb6('0x2e')](_0x7fb6('0x2f'),_0x7fb6('0x30'),_0x546008[_0x7fb6('0x29')]),'type':_0x7fb6('0x31'),'exitAt':null}});}})[_0x7fb6('0x10')](function(_0x661d04){if(_0x546008){if(_0x661d04&&_0x661d04['length']){var _0x580c0e=moment()[_0x7fb6('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x39480c=0x0,_0x5bf770=_0x661d04[_0x7fb6('0x32')];_0x39480c<_0x5bf770;_0x39480c++){_0x661d04[_0x39480c][_0x7fb6('0x33')]({'exitAt':_0x580c0e});}}}})['then'](function(){if(_0x546008){var _0x251a25=[];var _0x2e3bea=utils[_0x7fb6('0x34')]();_0x2e3bea[_0x7fb6('0x35')](function(_0x282678){_0x251a25[_0x7fb6('0x36')]({'channel':_0x282678,'membername':_0x546008[_0x7fb6('0x29')],'interface':util[_0x7fb6('0x2e')](_0x7fb6('0x2f'),'SIP',_0x546008[_0x7fb6('0x29')]),'type':'PAUSE','enterAt':moment()[_0x7fb6('0x2e')](_0x7fb6('0x37')),'data1':_0x36b4cc['body'][_0x7fb6('0x38')]||_0x7fb6('0x39'),'role':_0x546008[_0x7fb6('0x2a')],'internal':_0x546008['internal'],'uniqueid':_0x36b4cc[_0x7fb6('0x3a')][_0x7fb6('0x3b')]||null});});return db[_0x7fb6('0x2d')][_0x7fb6('0x3c')](_0x251a25,{'individualHooks':!![]});}})[_0x7fb6('0x10')](function(){if(_0x546008){return _0x546008[_0x7fb6('0x3d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x36b4cc[_0x7fb6('0x3a')][_0x7fb6('0x38')]||_0x7fb6('0x39'),'lastPauseAt':moment()[_0x7fb6('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x7fb6('0x10')](function(_0x54bedf){_0xa14677(_0x54bedf);})[_0x7fb6('0x1a')](function(_0x597eac){_0x566490(_0x253652[_0x7fb6('0x15')](0x1f4,_0x597eac['message']));});});};exports[_0x7fb6('0x3e')]=function(_0x15aef8){var _0x56023e=this;return new Promise(function(_0x1370df,_0x1105e0){var _0x42cd71;return db[_0x7fb6('0x1b')][_0x7fb6('0x3f')]({'where':_0x15aef8[_0x7fb6('0x1d')][_0x7fb6('0x1e')]||{},'attributes':['id',_0x7fb6('0x29')]})[_0x7fb6('0x10')](function(_0x3971a2){if(_0x3971a2){_0x42cd71=_0x3971a2;if(_0x15aef8[_0x7fb6('0x3a')][_0x7fb6('0x40')]&&!utils['isValidChannel'](_0x15aef8['body'][_0x7fb6('0x40')])){throw new Error('Unknown\x20channel');}switch(_0x15aef8[_0x7fb6('0x3a')][_0x7fb6('0x40')]){case _0x7fb6('0x41'):return db[_0x7fb6('0x2c')]['update']({'paused':0x0},{'where':{'UserId':_0x42cd71['id']}})[_0x7fb6('0x10')](function(){return db[_0x7fb6('0x2d')][_0x7fb6('0x42')]({'where':{'channel':_0x15aef8['body'][_0x7fb6('0x40')],'membername':_0x42cd71[_0x7fb6('0x29')],'interface':util[_0x7fb6('0x2e')]('%s/%s',_0x7fb6('0x30'),_0x42cd71['name']),'type':_0x7fb6('0x31'),'exitAt':null}});})[_0x7fb6('0x10')](function(_0x40821c){if(_0x40821c){return _0x40821c[_0x7fb6('0x3d')]({'exitAt':moment()[_0x7fb6('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x7fb6('0x43')},{'individualHooks':!![]});}return null;})[_0x7fb6('0x10')](function(){return _0x42cd71[_0x7fb6('0x3d')]({'voicePause':![]});});case _0x7fb6('0x44'):case _0x7fb6('0x45'):case'fax':case _0x7fb6('0x46'):case _0x7fb6('0x47'):return db[_0x7fb6('0x2d')]['find']({'where':{'channel':_0x15aef8[_0x7fb6('0x3a')][_0x7fb6('0x40')],'membername':_0x42cd71[_0x7fb6('0x29')],'interface':util[_0x7fb6('0x2e')]('%s/%s',_0x7fb6('0x30'),_0x42cd71['name']),'type':_0x7fb6('0x31'),'exitAt':null}})[_0x7fb6('0x10')](function(_0x46cd58){return _0x46cd58[_0x7fb6('0x3d')]({'exitAt':moment()[_0x7fb6('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x7fb6('0x43')},{'individualHooks':!![]});})[_0x7fb6('0x10')](function(){var _0x59587e={};_[_0x7fb6('0x48')](_0x59587e,util[_0x7fb6('0x2e')]('%s%s',_0x15aef8[_0x7fb6('0x3a')][_0x7fb6('0x40')],'Pause'),![]);return _0x42cd71[_0x7fb6('0x3d')](_0x59587e);});default:return db[_0x7fb6('0x2c')][_0x7fb6('0x3d')]({'paused':0x0},{'where':{'UserId':_0x42cd71['id']}})[_0x7fb6('0x10')](function(){return db['MemberReport'][_0x7fb6('0x1c')]({'where':{'membername':_0x42cd71[_0x7fb6('0x29')],'interface':util['format']('%s/%s',_0x7fb6('0x30'),_0x42cd71[_0x7fb6('0x29')]),'type':_0x7fb6('0x31'),'exitAt':null}});})['then'](function(_0x314a65){var _0x3d3aaf=[];_0x314a65[_0x7fb6('0x35')](function(_0x42a70a){_0x3d3aaf[_0x7fb6('0x36')](_0x42a70a[_0x7fb6('0x3d')]({'exitAt':moment()[_0x7fb6('0x2e')](_0x7fb6('0x37')),'data2':_0x7fb6('0x43')}));});return BPromise[_0x7fb6('0x49')](_0x3d3aaf);})[_0x7fb6('0x10')](function(){return _0x42cd71[_0x7fb6('0x3d')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x7fb6('0x10')](function(_0x47442a){_0x1370df(_0x47442a);})[_0x7fb6('0x1a')](function(_0x3914c0){_0x1105e0(_0x56023e['error'](0x1f4,_0x3914c0[_0x7fb6('0x18')]));});});};exports[_0x7fb6('0x4a')]=function(_0x2e8bcc){var _0x3d9ddb=this;return new Promise(function(_0x24931f,_0x75fdc){var _0x5f304f;return db[_0x7fb6('0x1b')][_0x7fb6('0x3f')]({'where':_0x2e8bcc[_0x7fb6('0x1d')][_0x7fb6('0x1e')]||{},'attributes':['id',_0x7fb6('0x29')]})['then'](function(_0x22fbed){if(_0x22fbed){_0x5f304f=_0x22fbed;return db[_0x7fb6('0x2c')][_0x7fb6('0x4b')]({'where':{'membername':_0x5f304f[_0x7fb6('0x29')]},'individualHooks':!![]});}})['then'](function(){if(_0x5f304f){return db[_0x7fb6('0x2d')][_0x7fb6('0x1c')]({'where':{'membername':_0x5f304f[_0x7fb6('0x29')],'interface':util[_0x7fb6('0x2e')](_0x7fb6('0x2f'),_0x7fb6('0x30'),_0x5f304f[_0x7fb6('0x29')]),'exitAt':null}});}})['then'](function(_0x1c8f8c){if(_0x5f304f){if(_0x1c8f8c&&_0x1c8f8c[_0x7fb6('0x32')]){var _0x1aa5c3=[];_0x1c8f8c[_0x7fb6('0x35')](function(_0x46cf28){_0x1aa5c3[_0x7fb6('0x36')](_0x46cf28[_0x7fb6('0x3d')]({'exitAt':moment()[_0x7fb6('0x2e')](_0x7fb6('0x37'))}));});return BPromise[_0x7fb6('0x49')](_0x1aa5c3);}}})['then'](function(){if(_0x5f304f){return _0x5f304f['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x7fb6('0x10')](function(_0x1ae860){_0x24931f(_0x1ae860);})[_0x7fb6('0x1a')](function(_0x1d6c5f){_0x75fdc(_0x3d9ddb[_0x7fb6('0x15')](0x1f4,_0x1d6c5f[_0x7fb6('0x18')]));});});};exports[_0x7fb6('0x4c')]=function(_0x1eba95){var _0x2999a2=this;return new Promise(function(_0x133b65,_0x1c7986){var _0x1544d1;var _0x1d6759;var _0x102ce7;return db[_0x7fb6('0x1b')]['findOne']({'where':_0x1eba95[_0x7fb6('0x1d')][_0x7fb6('0x1e')]||{},'attributes':['id',_0x7fb6('0x29'),_0x7fb6('0x2a'),'internal','loginInPause']})['then'](function(_0x2a8a9a){if(_0x2a8a9a){_0x1544d1=_0x2a8a9a;return db[_0x7fb6('0x1b')][_0x7fb6('0x4d')]({'where':{'role':_0x7fb6('0x4e'),'online':!![],'id':{'$ne':_0x1544d1['id']}}});}})[_0x7fb6('0x10')](function(_0x5adcbe){if(_0x5adcbe){_0x102ce7=_0x5adcbe;return require(_0x7fb6('0x4f'))['getLicense']();}})[_0x7fb6('0x10')](function(_0xfd043b){if(_0xfd043b&&_0xfd043b[_0x7fb6('0x50')]&&_0x102ce7>=_0xfd043b[_0x7fb6('0x50')]){throw new Error(_0x7fb6('0x51'));}})[_0x7fb6('0x10')](function(){if(_0x1544d1){return db['UserVoiceQueueRt'][_0x7fb6('0x4b')]({'where':{'membername':_0x1544d1['name']},'individualHooks':!![]});}})[_0x7fb6('0x10')](function(){if(_0x1544d1){return _0x1544d1[_0x7fb6('0x52')]({'raw':!![]});}})[_0x7fb6('0x10')](function(_0x3d2f09){if(_0x1544d1){if(_0x3d2f09){var _0x17741f=[];_0x1d6759=_0x3d2f09;if(_0x1d6759['length']){for(var _0x40fb9b=0x0;_0x40fb9b<_0x1d6759[_0x7fb6('0x32')];_0x40fb9b++){_0x17741f[_0x7fb6('0x36')](db['UserVoiceQueueRt'][_0x7fb6('0x53')]({'membername':_0x1544d1[_0x7fb6('0x29')],'UserId':_0x1544d1['id'],'queue_name':_0x1d6759[_0x40fb9b]['name'],'VoiceQueueId':_0x1d6759[_0x40fb9b]['id'],'interface':_0x1eba95[_0x7fb6('0x3a')][_0x7fb6('0x54')]||util['format']('%s/%s',_0x7fb6('0x30'),_0x1544d1[_0x7fb6('0x29')]),'paused':_0x1544d1['loginInPause']||![],'penalty':_0x1d6759[_0x40fb9b][_0x7fb6('0x55')]||0x0}));}return BPromise[_0x7fb6('0x49')](_0x17741f);}}}})[_0x7fb6('0x10')](function(){if(_0x1544d1){return db[_0x7fb6('0x2d')][_0x7fb6('0x1c')]({'where':{'membername':_0x1544d1[_0x7fb6('0x29')],'interface':util[_0x7fb6('0x2e')](_0x7fb6('0x2f'),_0x7fb6('0x30'),_0x1544d1['name']),'exitAt':null}});}})['then'](function(_0x4b419e){if(_0x1544d1){if(_0x4b419e&&_0x4b419e[_0x7fb6('0x32')]){var _0x340b48=[];_0x4b419e[_0x7fb6('0x35')](function(_0x3a89eb){_0x340b48[_0x7fb6('0x36')](_0x3a89eb[_0x7fb6('0x3d')]({'exitAt':moment()[_0x7fb6('0x2e')](_0x7fb6('0x37'))}));});return BPromise['all'](_0x340b48);}}})[_0x7fb6('0x10')](function(_0x33e1ff){if(_0x1544d1){var _0x3e493c=[];var _0x2969af=[];var _0x26c7b1=utils[_0x7fb6('0x34')]();var _0x16f83a={'membername':_0x1544d1[_0x7fb6('0x29')],'interface':util[_0x7fb6('0x2e')](_0x7fb6('0x2f'),_0x7fb6('0x30'),_0x1544d1['name']),'enterAt':moment()[_0x7fb6('0x2e')](_0x7fb6('0x37')),'role':_0x1544d1[_0x7fb6('0x2a')],'internal':_0x1544d1[_0x7fb6('0x2b')]};_0x26c7b1['forEach'](function(_0x510558){_0x3e493c[_0x7fb6('0x36')](_[_0x7fb6('0x56')]({'channel':_0x510558,'type':_0x7fb6('0x57'),'data1':_0x7fb6('0x58'),'data2':_0x1eba95[_0x7fb6('0x3a')][_0x7fb6('0x54')]||util['format'](_0x7fb6('0x2f'),'SIP',_0x1544d1[_0x7fb6('0x29')])},_0x16f83a));if(_0x1544d1[_0x7fb6('0x59')]){_0x2969af[_0x7fb6('0x36')](_['merge']({'channel':_0x510558,'type':_0x7fb6('0x31'),'data1':_0x7fb6('0x5a')},_0x16f83a));}});return db['MemberReport'][_0x7fb6('0x3c')](_0x3e493c['concat'](_0x2969af),{'individualHooks':!![]});}})[_0x7fb6('0x10')](function(){if(_0x1544d1){return _0x1544d1[_0x7fb6('0x3d')]({'online':!![],'lastLoginAt':moment()['format'](_0x7fb6('0x37')),'voicePause':_0x1544d1[_0x7fb6('0x59')]||![],'mailPause':_0x1544d1[_0x7fb6('0x59')]||![],'chatPause':_0x1544d1['loginInPause']||![],'faxPause':_0x1544d1[_0x7fb6('0x59')]||![],'smsPause':_0x1544d1['loginInPause']||![],'openchannelPause':_0x1544d1['loginInPause']||![],'pauseType':_0x1544d1[_0x7fb6('0x59')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0x7fb6('0x37'))});}})[_0x7fb6('0x10')](function(_0x42bb64){_0x133b65(_0x42bb64);})[_0x7fb6('0x1a')](function(_0x1df442){_0x1c7986(_0x2999a2[_0x7fb6('0x15')](0x1f4,_0x1df442[_0x7fb6('0x18')]));});});};
\ No newline at end of file
+var _0x7ea9=['info','result','catch','User','findAll','options','raw','where','attributes','limit','include','map','model','GetUser','ShowUser','find','PauseUser','name','internal','UserVoiceQueueRt','MemberReport','format','%s/%s','SIP','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','push','body','type','DEFAULT\x20PAUSE','role','uniqueid','bulkCreate','update','UnpauseUser','findOne','isValidChannel','channel','Unknown\x20channel','voice','fax','openchannel','system','%s%s','LogoutUser','destroy','all','LoginUser','loginInPause','count','agent','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','interface','UserVoiceQueue.penalty','merge','callysquare','LOGININPAUSE','concat','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','socket.io-emitter','localhost','register','then','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x7d2c59,_0x3774f0){var _0x46ac0f=function(_0x51632d){while(--_0x51632d){_0x7d2c59['push'](_0x7d2c59['shift']());}};_0x46ac0f(++_0x3774f0);}(_0x7ea9,0xec));var _0x97ea=function(_0x2d3837,_0x46d54e){_0x2d3837=_0x2d3837-0x0;var _0x14150a=_0x7ea9[_0x2d3837];return _0x14150a;};'use strict';var _=require('lodash');var util=require(_0x97ea('0x0'));var moment=require(_0x97ea('0x1'));var BPromise=require(_0x97ea('0x2'));var rs=require(_0x97ea('0x3'));var fs=require('fs');var db=require(_0x97ea('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x97ea('0x5'))(_0x97ea('0x6'));var config=require(_0x97ea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x97ea('0x8')][_0x97ea('0x9')]({'port':0x232a});var socket=require(_0x97ea('0xa'))({'host':_0x97ea('0xb'),'port':0x18eb});require('./user.socket')[_0x97ea('0xc')](socket);function respondWithRpcPromise(_0x424a73,_0x4af95f,_0xdf150d){return new BPromise(function(_0x5d0698,_0x179953){return client['request'](_0x424a73,_0xdf150d)[_0x97ea('0xd')](function(_0x340bbc){logger['info'](_0x97ea('0xe'),_0x4af95f,_0x97ea('0xf'));logger[_0x97ea('0x10')](_0x97ea('0x11'),_0x4af95f,_0x97ea('0xf'),JSON[_0x97ea('0x12')](_0x340bbc));if(_0x340bbc[_0x97ea('0x13')]){if(_0x340bbc[_0x97ea('0x13')][_0x97ea('0x14')]===0x1f4){logger[_0x97ea('0x13')]('User,\x20%s,\x20%s',_0x4af95f,_0x340bbc[_0x97ea('0x13')][_0x97ea('0x15')]);return _0x179953(_0x340bbc['error'][_0x97ea('0x15')]);}logger[_0x97ea('0x13')](_0x97ea('0xe'),_0x4af95f,_0x340bbc['error'][_0x97ea('0x15')]);return _0x5d0698(_0x340bbc[_0x97ea('0x13')]['message']);}else{logger[_0x97ea('0x16')]('User,\x20%s,\x20%s',_0x4af95f,_0x97ea('0xf'));_0x5d0698(_0x340bbc[_0x97ea('0x17')][_0x97ea('0x15')]);}})[_0x97ea('0x18')](function(_0x2388fb){logger[_0x97ea('0x13')](_0x97ea('0xe'),_0x4af95f,_0x2388fb);_0x179953(_0x2388fb);});});}exports['GetUser']=function(_0xda7b4){var _0x12499b=this;return new Promise(function(_0x2a3a1d,_0x28149a){return db[_0x97ea('0x19')][_0x97ea('0x1a')]({'raw':_0xda7b4[_0x97ea('0x1b')]?_0xda7b4[_0x97ea('0x1b')][_0x97ea('0x1c')]===undefined?!![]:![]:!![],'where':_0xda7b4[_0x97ea('0x1b')]?_0xda7b4[_0x97ea('0x1b')][_0x97ea('0x1d')]||null:null,'attributes':_0xda7b4['options']?_0xda7b4[_0x97ea('0x1b')][_0x97ea('0x1e')]||null:null,'limit':_0xda7b4['options']?_0xda7b4[_0x97ea('0x1b')][_0x97ea('0x1f')]||null:null,'include':_0xda7b4['options']?_0xda7b4['options'][_0x97ea('0x20')]?_[_0x97ea('0x21')](_0xda7b4[_0x97ea('0x1b')][_0x97ea('0x20')],function(_0x30ca93){return{'model':db[_0x30ca93['model']],'as':_0x30ca93['as'],'attributes':_0x30ca93[_0x97ea('0x1e')],'include':_0x30ca93[_0x97ea('0x20')]?_['map'](_0x30ca93['include'],function(_0xaf7d7){return{'model':db[_0xaf7d7[_0x97ea('0x22')]],'as':_0xaf7d7['as'],'attributes':_0xaf7d7[_0x97ea('0x1e')],'include':_0xaf7d7[_0x97ea('0x20')]?_[_0x97ea('0x21')](_0xaf7d7[_0x97ea('0x20')],function(_0x34158f){return{'model':db[_0x34158f[_0x97ea('0x22')]],'as':_0x34158f['as'],'attributes':_0x34158f[_0x97ea('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x97ea('0xd')](function(_0x2b947c){logger[_0x97ea('0x16')](_0x97ea('0x23'),_0xda7b4);logger['debug'](_0x97ea('0x23'),_0xda7b4,JSON[_0x97ea('0x12')](_0x2b947c));_0x2a3a1d(_0x2b947c);})['catch'](function(_0x5f428f){logger[_0x97ea('0x13')](_0x97ea('0x23'),_0x5f428f[_0x97ea('0x15')],_0xda7b4);_0x28149a(_0x12499b[_0x97ea('0x13')](0x1f4,_0x5f428f[_0x97ea('0x15')]));});});};exports[_0x97ea('0x24')]=function(_0x299ae9){var _0x2de4e4=this;return new Promise(function(_0x3f586a,_0x7becaa){return db[_0x97ea('0x19')][_0x97ea('0x25')]({'raw':_0x299ae9[_0x97ea('0x1b')]?_0x299ae9[_0x97ea('0x1b')][_0x97ea('0x1c')]===undefined?!![]:![]:!![],'where':_0x299ae9[_0x97ea('0x1b')]?_0x299ae9['options'][_0x97ea('0x1d')]||null:null,'attributes':_0x299ae9[_0x97ea('0x1b')]?_0x299ae9['options'][_0x97ea('0x1e')]||null:null,'include':_0x299ae9[_0x97ea('0x1b')]?_0x299ae9[_0x97ea('0x1b')][_0x97ea('0x20')]?_['map'](_0x299ae9['options'][_0x97ea('0x20')],function(_0x39fa90){return{'model':db[_0x39fa90[_0x97ea('0x22')]],'as':_0x39fa90['as'],'attributes':_0x39fa90[_0x97ea('0x1e')],'include':_0x39fa90[_0x97ea('0x20')]?_[_0x97ea('0x21')](_0x39fa90['include'],function(_0x4054e7){return{'model':db[_0x4054e7[_0x97ea('0x22')]],'as':_0x4054e7['as'],'attributes':_0x4054e7['attributes'],'include':_0x4054e7[_0x97ea('0x20')]?_[_0x97ea('0x21')](_0x4054e7[_0x97ea('0x20')],function(_0x54564f){return{'model':db[_0x54564f[_0x97ea('0x22')]],'as':_0x54564f['as'],'attributes':_0x54564f[_0x97ea('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x97ea('0xd')](function(_0x5c906e){logger['info'](_0x97ea('0x24'),_0x299ae9);logger[_0x97ea('0x10')](_0x97ea('0x24'),_0x299ae9,JSON[_0x97ea('0x12')](_0x5c906e));_0x3f586a(_0x5c906e);})['catch'](function(_0x245c00){logger[_0x97ea('0x13')](_0x97ea('0x24'),_0x245c00[_0x97ea('0x15')],_0x299ae9);_0x7becaa(_0x2de4e4[_0x97ea('0x13')](0x1f4,_0x245c00[_0x97ea('0x15')]));});});};exports[_0x97ea('0x26')]=function(_0x3648af){var _0x29fdab=this;return new Promise(function(_0x524864,_0x163969){var _0x656d01;return db[_0x97ea('0x19')][_0x97ea('0x25')]({'where':_0x3648af[_0x97ea('0x1b')][_0x97ea('0x1d')]||{},'attributes':['id',_0x97ea('0x27'),'role',_0x97ea('0x28')]})[_0x97ea('0xd')](function(_0x4b291e){if(_0x4b291e){_0x656d01=_0x4b291e;return db[_0x97ea('0x29')]['update']({'paused':0x1},{'where':{'UserId':_0x656d01['id']},'individualHooks':!![]});}})[_0x97ea('0xd')](function(){if(_0x656d01){return db[_0x97ea('0x2a')][_0x97ea('0x1a')]({'where':{'membername':_0x656d01[_0x97ea('0x27')],'interface':util[_0x97ea('0x2b')](_0x97ea('0x2c'),_0x97ea('0x2d'),_0x656d01[_0x97ea('0x27')]),'type':_0x97ea('0x2e'),'exitAt':null}});}})[_0x97ea('0xd')](function(_0x378e38){if(_0x656d01){if(_0x378e38&&_0x378e38[_0x97ea('0x2f')]){var _0xdf6bd=moment()[_0x97ea('0x2b')](_0x97ea('0x30'));for(var _0x20c3fd=0x0,_0x4cec70=_0x378e38[_0x97ea('0x2f')];_0x20c3fd<_0x4cec70;_0x20c3fd++){_0x378e38[_0x20c3fd]['updateAttributes']({'exitAt':_0xdf6bd});}}}})['then'](function(){if(_0x656d01){var _0x43ee30=[];var _0x40f93c=utils[_0x97ea('0x31')]();_0x40f93c[_0x97ea('0x32')](function(_0x1e9f54){_0x43ee30[_0x97ea('0x33')]({'channel':_0x1e9f54,'membername':_0x656d01[_0x97ea('0x27')],'interface':util[_0x97ea('0x2b')](_0x97ea('0x2c'),_0x97ea('0x2d'),_0x656d01['name']),'type':_0x97ea('0x2e'),'enterAt':moment()[_0x97ea('0x2b')](_0x97ea('0x30')),'data1':_0x3648af[_0x97ea('0x34')][_0x97ea('0x35')]||_0x97ea('0x36'),'role':_0x656d01[_0x97ea('0x37')],'internal':_0x656d01[_0x97ea('0x28')],'uniqueid':_0x3648af['body'][_0x97ea('0x38')]||null});});return db[_0x97ea('0x2a')][_0x97ea('0x39')](_0x43ee30,{'individualHooks':!![]});}})[_0x97ea('0xd')](function(){if(_0x656d01){return _0x656d01[_0x97ea('0x3a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x3648af[_0x97ea('0x34')]['type']||_0x97ea('0x36'),'lastPauseAt':moment()[_0x97ea('0x2b')](_0x97ea('0x30'))});}})[_0x97ea('0xd')](function(_0x107ff8){_0x524864(_0x107ff8);})[_0x97ea('0x18')](function(_0x57f7ec){_0x163969(_0x29fdab[_0x97ea('0x13')](0x1f4,_0x57f7ec[_0x97ea('0x15')]));});});};exports[_0x97ea('0x3b')]=function(_0xaf8b62){var _0x2ad321=this;return new Promise(function(_0x5dd908,_0x5de29e){var _0x353021;return db['User'][_0x97ea('0x3c')]({'where':_0xaf8b62[_0x97ea('0x1b')][_0x97ea('0x1d')]||{},'attributes':['id',_0x97ea('0x27')]})[_0x97ea('0xd')](function(_0x131ac9){if(_0x131ac9){_0x353021=_0x131ac9;if(_0xaf8b62[_0x97ea('0x34')]['channel']&&!utils[_0x97ea('0x3d')](_0xaf8b62[_0x97ea('0x34')][_0x97ea('0x3e')])){throw new Error(_0x97ea('0x3f'));}switch(_0xaf8b62[_0x97ea('0x34')][_0x97ea('0x3e')]){case _0x97ea('0x40'):return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x353021['id']}})['then'](function(){return db[_0x97ea('0x2a')][_0x97ea('0x25')]({'where':{'channel':_0xaf8b62[_0x97ea('0x34')][_0x97ea('0x3e')],'membername':_0x353021[_0x97ea('0x27')],'interface':util[_0x97ea('0x2b')](_0x97ea('0x2c'),_0x97ea('0x2d'),_0x353021[_0x97ea('0x27')]),'type':_0x97ea('0x2e'),'exitAt':null}});})[_0x97ea('0xd')](function(_0x64798d){if(_0x64798d){return _0x64798d[_0x97ea('0x3a')]({'exitAt':moment()['format'](_0x97ea('0x30')),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x97ea('0xd')](function(){return _0x353021[_0x97ea('0x3a')]({'voicePause':![]});});case'mail':case'chat':case _0x97ea('0x41'):case'sms':case _0x97ea('0x42'):return db['MemberReport'][_0x97ea('0x25')]({'where':{'channel':_0xaf8b62[_0x97ea('0x34')][_0x97ea('0x3e')],'membername':_0x353021[_0x97ea('0x27')],'interface':util[_0x97ea('0x2b')](_0x97ea('0x2c'),_0x97ea('0x2d'),_0x353021[_0x97ea('0x27')]),'type':_0x97ea('0x2e'),'exitAt':null}})['then'](function(_0x242e89){return _0x242e89[_0x97ea('0x3a')]({'exitAt':moment()['format'](_0x97ea('0x30')),'data2':_0x97ea('0x43')},{'individualHooks':!![]});})['then'](function(){var _0x4efae7={};_['set'](_0x4efae7,util[_0x97ea('0x2b')](_0x97ea('0x44'),_0xaf8b62[_0x97ea('0x34')][_0x97ea('0x3e')],'Pause'),![]);return _0x353021[_0x97ea('0x3a')](_0x4efae7);});default:return db[_0x97ea('0x29')]['update']({'paused':0x0},{'where':{'UserId':_0x353021['id']}})[_0x97ea('0xd')](function(){return db[_0x97ea('0x2a')][_0x97ea('0x1a')]({'where':{'membername':_0x353021[_0x97ea('0x27')],'interface':util[_0x97ea('0x2b')](_0x97ea('0x2c'),_0x97ea('0x2d'),_0x353021[_0x97ea('0x27')]),'type':_0x97ea('0x2e'),'exitAt':null}});})[_0x97ea('0xd')](function(_0x3b8184){var _0x37ab9c=[];_0x3b8184['forEach'](function(_0x9da14a){_0x37ab9c[_0x97ea('0x33')](_0x9da14a[_0x97ea('0x3a')]({'exitAt':moment()[_0x97ea('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x97ea('0x43')}));});return BPromise['all'](_0x37ab9c);})[_0x97ea('0xd')](function(){return _0x353021[_0x97ea('0x3a')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x97ea('0xd')](function(_0x6b72c){_0x5dd908(_0x6b72c);})['catch'](function(_0x2c6fab){_0x5de29e(_0x2ad321['error'](0x1f4,_0x2c6fab[_0x97ea('0x15')]));});});};exports[_0x97ea('0x45')]=function(_0x178d6d){var _0x2e8aea=this;return new Promise(function(_0x394458,_0x20a69c){var _0x41b68a;return db['User'][_0x97ea('0x3c')]({'where':_0x178d6d['options']['where']||{},'attributes':['id','name']})[_0x97ea('0xd')](function(_0x3e6aa9){if(_0x3e6aa9){_0x41b68a=_0x3e6aa9;return db['UserVoiceQueueRt'][_0x97ea('0x46')]({'where':{'membername':_0x41b68a['name']},'individualHooks':!![]});}})[_0x97ea('0xd')](function(){if(_0x41b68a){return db['MemberReport'][_0x97ea('0x1a')]({'where':{'membername':_0x41b68a[_0x97ea('0x27')],'interface':util[_0x97ea('0x2b')](_0x97ea('0x2c'),'SIP',_0x41b68a[_0x97ea('0x27')]),'exitAt':null}});}})[_0x97ea('0xd')](function(_0x2f0463){if(_0x41b68a){if(_0x2f0463&&_0x2f0463[_0x97ea('0x2f')]){var _0x5d9e88=[];_0x2f0463[_0x97ea('0x32')](function(_0x3c986f){_0x5d9e88['push'](_0x3c986f[_0x97ea('0x3a')]({'exitAt':moment()['format'](_0x97ea('0x30'))}));});return BPromise[_0x97ea('0x47')](_0x5d9e88);}}})[_0x97ea('0xd')](function(){if(_0x41b68a){return _0x41b68a[_0x97ea('0x3a')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x97ea('0xd')](function(_0x34a393){_0x394458(_0x34a393);})[_0x97ea('0x18')](function(_0xd5d0bd){_0x20a69c(_0x2e8aea[_0x97ea('0x13')](0x1f4,_0xd5d0bd[_0x97ea('0x15')]));});});};exports[_0x97ea('0x48')]=function(_0x1a8d2b){var _0x4ff4fc=this;return new Promise(function(_0x43d026,_0x4dec21){var _0x3a0568;var _0x29ad6d;var _0x2aa6b8;return db[_0x97ea('0x19')][_0x97ea('0x3c')]({'where':_0x1a8d2b[_0x97ea('0x1b')][_0x97ea('0x1d')]||{},'attributes':['id',_0x97ea('0x27'),_0x97ea('0x37'),_0x97ea('0x28'),_0x97ea('0x49')]})[_0x97ea('0xd')](function(_0x301d70){if(_0x301d70){_0x3a0568=_0x301d70;return db[_0x97ea('0x19')][_0x97ea('0x4a')]({'where':{'role':_0x97ea('0x4b'),'online':!![],'id':{'$ne':_0x3a0568['id']}}});}})[_0x97ea('0xd')](function(_0x2a7c4b){if(_0x2a7c4b){_0x2aa6b8=_0x2a7c4b;return require('../../config/license/util')['getLicense']();}})['then'](function(_0x307a42){if(_0x307a42&&_0x307a42[_0x97ea('0x4c')]&&_0x2aa6b8>=_0x307a42['agents']){throw new Error(_0x97ea('0x4d'));}})['then'](function(){if(_0x3a0568){return db[_0x97ea('0x29')][_0x97ea('0x46')]({'where':{'membername':_0x3a0568[_0x97ea('0x27')]},'individualHooks':!![]});}})[_0x97ea('0xd')](function(){if(_0x3a0568){return _0x3a0568[_0x97ea('0x4e')]({'raw':!![]});}})[_0x97ea('0xd')](function(_0x4f06cb){if(_0x3a0568){if(_0x4f06cb){var _0x4dca2f=[];_0x29ad6d=_0x4f06cb;if(_0x29ad6d['length']){for(var _0xe50c98=0x0;_0xe50c98<_0x29ad6d[_0x97ea('0x2f')];_0xe50c98++){_0x4dca2f['push'](db[_0x97ea('0x29')][_0x97ea('0x4f')]({'membername':_0x3a0568[_0x97ea('0x27')],'UserId':_0x3a0568['id'],'queue_name':_0x29ad6d[_0xe50c98]['name'],'VoiceQueueId':_0x29ad6d[_0xe50c98]['id'],'interface':_0x1a8d2b[_0x97ea('0x34')][_0x97ea('0x50')]||util[_0x97ea('0x2b')](_0x97ea('0x2c'),'SIP',_0x3a0568[_0x97ea('0x27')]),'paused':_0x3a0568[_0x97ea('0x49')]||![],'penalty':_0x29ad6d[_0xe50c98][_0x97ea('0x51')]||0x0}));}return BPromise[_0x97ea('0x47')](_0x4dca2f);}}}})[_0x97ea('0xd')](function(){if(_0x3a0568){return db[_0x97ea('0x2a')][_0x97ea('0x1a')]({'where':{'membername':_0x3a0568['name'],'interface':util['format'](_0x97ea('0x2c'),'SIP',_0x3a0568[_0x97ea('0x27')]),'exitAt':null}});}})['then'](function(_0x5c7f92){if(_0x3a0568){if(_0x5c7f92&&_0x5c7f92[_0x97ea('0x2f')]){var _0x226d7f=[];_0x5c7f92[_0x97ea('0x32')](function(_0x2ba761){_0x226d7f['push'](_0x2ba761[_0x97ea('0x3a')]({'exitAt':moment()[_0x97ea('0x2b')](_0x97ea('0x30'))}));});return BPromise[_0x97ea('0x47')](_0x226d7f);}}})[_0x97ea('0xd')](function(_0x6d8511){if(_0x3a0568){var _0x16d821=[];var _0x560bc3=[];var _0x5b57b8=utils['getChannels']();var _0x376cfd={'membername':_0x3a0568[_0x97ea('0x27')],'interface':util[_0x97ea('0x2b')](_0x97ea('0x2c'),_0x97ea('0x2d'),_0x3a0568[_0x97ea('0x27')]),'enterAt':moment()[_0x97ea('0x2b')](_0x97ea('0x30')),'role':_0x3a0568[_0x97ea('0x37')],'internal':_0x3a0568[_0x97ea('0x28')]};_0x5b57b8[_0x97ea('0x32')](function(_0x49652e){_0x16d821[_0x97ea('0x33')](_[_0x97ea('0x52')]({'channel':_0x49652e,'type':'LOGIN','data1':_0x97ea('0x53'),'data2':_0x1a8d2b[_0x97ea('0x34')][_0x97ea('0x50')]||util[_0x97ea('0x2b')](_0x97ea('0x2c'),_0x97ea('0x2d'),_0x3a0568['name'])},_0x376cfd));if(_0x3a0568['loginInPause']){_0x560bc3[_0x97ea('0x33')](_[_0x97ea('0x52')]({'channel':_0x49652e,'type':_0x97ea('0x2e'),'data1':_0x97ea('0x54')},_0x376cfd));}});return db[_0x97ea('0x2a')][_0x97ea('0x39')](_0x16d821[_0x97ea('0x55')](_0x560bc3),{'individualHooks':!![]});}})[_0x97ea('0xd')](function(){if(_0x3a0568){return _0x3a0568[_0x97ea('0x3a')]({'online':!![],'lastLoginAt':moment()[_0x97ea('0x2b')](_0x97ea('0x30')),'voicePause':_0x3a0568[_0x97ea('0x49')]||![],'mailPause':_0x3a0568['loginInPause']||![],'chatPause':_0x3a0568[_0x97ea('0x49')]||![],'faxPause':_0x3a0568[_0x97ea('0x49')]||![],'smsPause':_0x3a0568['loginInPause']||![],'openchannelPause':_0x3a0568[_0x97ea('0x49')]||![],'pauseType':_0x3a0568[_0x97ea('0x49')]?_0x97ea('0x54'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x97ea('0xd')](function(_0x511c84){_0x43d026(_0x511c84);})[_0x97ea('0x18')](function(_0x58ded4){_0x4dec21(_0x4ff4fc['error'](0x1f4,_0x58ded4['message']));});});};
\ No newline at end of file
index 8715a34..693f0a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1fc=['emit','removeListener','length','user:','./user.events','save','remove','update'];(function(_0x4e9426,_0x1cb728){var _0x1c229b=function(_0x2de4f1){while(--_0x2de4f1){_0x4e9426['push'](_0x4e9426['shift']());}};_0x1c229b(++_0x1cb728);}(_0xe1fc,0x124));var _0xce1f=function(_0x35d775,_0x25431e){_0x35d775=_0x35d775-0x0;var _0x59384d=_0xe1fc[_0x35d775];return _0x59384d;};'use strict';var UserEvents=require(_0xce1f('0x0'));var events=[_0xce1f('0x1'),_0xce1f('0x2'),_0xce1f('0x3')];function createListener(_0x233ac5,_0x436e52){return function(_0xe0552e){_0x436e52[_0xce1f('0x4')](_0x233ac5,_0xe0552e);};}function removeListener(_0xe018e9,_0xd9076f){return function(){UserEvents[_0xce1f('0x5')](_0xe018e9,_0xd9076f);};}exports['register']=function(_0x2284fe){for(var _0x4998c2=0x0,_0x1fdb02=events[_0xce1f('0x6')];_0x4998c2<_0x1fdb02;_0x4998c2++){var _0x39228a=events[_0x4998c2];var _0x380212=createListener(_0xce1f('0x7')+_0x39228a,_0x2284fe);UserEvents['on'](_0x39228a,_0x380212);}};
\ No newline at end of file
+var _0xd473=['./user.events','save','removeListener','register','length','user:'];(function(_0xf55e73,_0x3fecc5){var _0x116b99=function(_0x314e0c){while(--_0x314e0c){_0xf55e73['push'](_0xf55e73['shift']());}};_0x116b99(++_0x3fecc5);}(_0xd473,0x168));var _0x3d47=function(_0x48afc2,_0x3c1f44){_0x48afc2=_0x48afc2-0x0;var _0x5769e1=_0xd473[_0x48afc2];return _0x5769e1;};'use strict';var UserEvents=require(_0x3d47('0x0'));var events=[_0x3d47('0x1'),'remove','update'];function createListener(_0x2d2282,_0x4f3541){return function(_0x296df7){_0x4f3541['emit'](_0x2d2282,_0x296df7);};}function removeListener(_0x21dbe4,_0x15fe69){return function(){UserEvents[_0x3d47('0x2')](_0x21dbe4,_0x15fe69);};}exports[_0x3d47('0x3')]=function(_0x7a25d4){for(var _0x4acfe4=0x0,_0x5e517f=events[_0x3d47('0x4')];_0x4acfe4<_0x5e517f;_0x4acfe4++){var _0x141c5e=events[_0x4acfe4];var _0x1e06d1=createListener(_0x3d47('0x5')+_0x141c5e,_0x7a25d4);UserEvents['on'](_0x141c5e,_0x1e06d1);}};
\ No newline at end of file
index a9db21c..5d66f15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d76=['path','express','Router','../../components/interaction/service','../../config/environment','exports'];(function(_0x24d349,_0x3b9f1c){var _0x479e8e=function(_0x36dfa9){while(--_0x36dfa9){_0x24d349['push'](_0x24d349['shift']());}};_0x479e8e(++_0x3b9f1c);}(_0x1d76,0x66));var _0x61d7=function(_0x3c0001,_0x3f943e){_0x3c0001=_0x3c0001-0x0;var _0xecfb6a=_0x1d76[_0x3c0001];return _0xecfb6a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x61d7('0x0'));var express=require(_0x61d7('0x1'));var router=express[_0x61d7('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x61d7('0x3'));var config=require(_0x61d7('0x4'));module[_0x61d7('0x5')]=router;
\ No newline at end of file
+var _0xe49b=['express','../../components/auth/service','../../config/environment','multer','path'];(function(_0x276a8d,_0x410b3a){var _0xd1fbdc=function(_0x594af1){while(--_0x594af1){_0x276a8d['push'](_0x276a8d['shift']());}};_0xd1fbdc(++_0x410b3a);}(_0xe49b,0x1b6));var _0xbe49=function(_0x23a794,_0x3ce8cf){_0x23a794=_0x23a794-0x0;var _0x55948d=_0xe49b[_0x23a794];return _0x55948d;};'use strict';var multer=require(_0xbe49('0x0'));var util=require('util');var path=require(_0xbe49('0x1'));var express=require(_0xbe49('0x2'));var router=express['Router']();var auth=require(_0xbe49('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xbe49('0x4'));module['exports']=router;
\ No newline at end of file
index c05f8c9..b1a0535 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cce=['exports','INTEGER','sequelize'];(function(_0x3570ed,_0x359888){var _0x22499d=function(_0x569c3d){while(--_0x569c3d){_0x3570ed['push'](_0x3570ed['shift']());}};_0x22499d(++_0x359888);}(_0x4cce,0x8c));var _0xe4cc=function(_0xa144b5,_0x1fe6cf){_0xa144b5=_0xa144b5-0x0;var _0x368884=_0x4cce[_0xa144b5];return _0x368884;};'use strict';var Sequelize=require(_0xe4cc('0x0'));module[_0xe4cc('0x1')]={'penalty':{'type':Sequelize[_0xe4cc('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x7aa9=['sequelize','exports','INTEGER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7aa9,0xcf));var _0x97aa=function(_0x4b01b7,_0x183b04){_0x4b01b7=_0x4b01b7-0x0;var _0x2ed185=_0x7aa9[_0x4b01b7];return _0x2ed185;};'use strict';var Sequelize=require(_0x97aa('0x0'));module[_0x97aa('0x1')]={'penalty':{'type':Sequelize[_0x97aa('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 4fd32f8..044e332 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x282b=['UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','./userChatQueue.attributes','define'];(function(_0x6991aa,_0x3be8d3){var _0x52c540=function(_0x970852){while(--_0x970852){_0x6991aa['push'](_0x6991aa['shift']());}};_0x52c540(++_0x3be8d3);}(_0x282b,0xec));var _0xb282=function(_0x5a3871,_0x68547b){_0x5a3871=_0x5a3871-0x0;var _0x217987=_0x282b[_0x5a3871];return _0x217987;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var logger=require(_0xb282('0x2'))(_0xb282('0x3'));var moment=require(_0xb282('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xb282('0x5'));module['exports']=function(_0x3fbbaf,_0x175c83){return _0x3fbbaf[_0xb282('0x6')](_0xb282('0x7'),attributes,{'tableName':_0xb282('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0972=['exports','define','UserChatQueue','user_has_chat_queues','util','api','bluebird','request-promise'];(function(_0x3f468a,_0x32be1e){var _0x45e1ef=function(_0x4cec90){while(--_0x4cec90){_0x3f468a['push'](_0x3f468a['shift']());}};_0x45e1ef(++_0x32be1e);}(_0x0972,0x64));var _0x2097=function(_0x27ee13,_0x5bbd1b){_0x27ee13=_0x27ee13-0x0;var _0x1697aa=_0x0972[_0x27ee13];return _0x1697aa;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var logger=require('../../config/logger')(_0x2097('0x1'));var moment=require('moment');var BPromise=require(_0x2097('0x2'));var rp=require(_0x2097('0x3'));var attributes=require('./userChatQueue.attributes');module[_0x2097('0x4')]=function(_0x431d1c,_0xe6fbae){return _0x431d1c[_0x2097('0x5')](_0x2097('0x6'),attributes,{'tableName':_0x2097('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f159694..223c92a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2709=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2786f9,_0x45dfec){var _0x22c3ec=function(_0x542ceb){while(--_0x542ceb){_0x2786f9['push'](_0x2786f9['shift']());}};_0x22c3ec(++_0x45dfec);}(_0x2709,0x1b5));var _0x9270=function(_0x26aa5a,_0x359ba8){_0x26aa5a=_0x26aa5a-0x0;var _0x312a41=_0x2709[_0x26aa5a];return _0x312a41;};'use strict';var _=require(_0x9270('0x0'));var util=require(_0x9270('0x1'));var moment=require(_0x9270('0x2'));var BPromise=require(_0x9270('0x3'));var rs=require(_0x9270('0x4'));var fs=require('fs');var db=require(_0x9270('0x5'))['db'];var utils=require(_0x9270('0x6'));var logger=require(_0x9270('0x7'))(_0x9270('0x8'));var config=require(_0x9270('0x9'));var jayson=require(_0x9270('0xa'));var client=jayson['client'][_0x9270('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x79c780,_0x1e57bc,_0x277bd8){return new BPromise(function(_0x14539c,_0x18d1c5){return client[_0x9270('0xc')](_0x79c780,_0x277bd8)[_0x9270('0xd')](function(_0x208eef){logger[_0x9270('0xe')](_0x9270('0xf'),_0x1e57bc,'request\x20sent');logger[_0x9270('0x10')](_0x9270('0x11'),_0x1e57bc,_0x9270('0x12'),JSON[_0x9270('0x13')](_0x208eef));if(_0x208eef[_0x9270('0x14')]){if(_0x208eef[_0x9270('0x14')]['code']===0x1f4){logger[_0x9270('0x14')](_0x9270('0xf'),_0x1e57bc,_0x208eef['error'][_0x9270('0x15')]);return _0x18d1c5(_0x208eef[_0x9270('0x14')][_0x9270('0x15')]);}logger[_0x9270('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x1e57bc,_0x208eef['error'][_0x9270('0x15')]);return _0x14539c(_0x208eef['error']['message']);}else{logger[_0x9270('0xe')](_0x9270('0xf'),_0x1e57bc,'request\x20sent');_0x14539c(_0x208eef[_0x9270('0x16')]['message']);}})[_0x9270('0x17')](function(_0x38c02f){logger[_0x9270('0x14')](_0x9270('0xf'),_0x1e57bc,_0x38c02f);_0x18d1c5(_0x38c02f);});});}
\ No newline at end of file
+var _0xfe75=['request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s'];(function(_0x1db78e,_0x309d9c){var _0x19d676=function(_0x3079f7){while(--_0x3079f7){_0x1db78e['push'](_0x1db78e['shift']());}};_0x19d676(++_0x309d9c);}(_0xfe75,0xda));var _0x5fe7=function(_0x3454e5,_0x2a4bae){_0x3454e5=_0x3454e5-0x0;var _0x3e5ac4=_0xfe75[_0x3454e5];return _0x3e5ac4;};'use strict';var _=require(_0x5fe7('0x0'));var util=require('util');var moment=require(_0x5fe7('0x1'));var BPromise=require(_0x5fe7('0x2'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x5fe7('0x3'))['db'];var utils=require(_0x5fe7('0x4'));var logger=require('../../config/logger')(_0x5fe7('0x5'));var config=require(_0x5fe7('0x6'));var jayson=require(_0x5fe7('0x7'));var client=jayson['client'][_0x5fe7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x493bab,_0x624bb,_0x1ab5df){return new BPromise(function(_0x55b419,_0x50d6e0){return client[_0x5fe7('0x9')](_0x493bab,_0x1ab5df)[_0x5fe7('0xa')](function(_0x36e8f3){logger[_0x5fe7('0xb')](_0x5fe7('0xc'),_0x624bb,_0x5fe7('0xd'));logger[_0x5fe7('0xe')](_0x5fe7('0xf'),_0x624bb,_0x5fe7('0xd'),JSON[_0x5fe7('0x10')](_0x36e8f3));if(_0x36e8f3[_0x5fe7('0x11')]){if(_0x36e8f3[_0x5fe7('0x11')][_0x5fe7('0x12')]===0x1f4){logger[_0x5fe7('0x11')](_0x5fe7('0xc'),_0x624bb,_0x36e8f3[_0x5fe7('0x11')][_0x5fe7('0x13')]);return _0x50d6e0(_0x36e8f3['error'][_0x5fe7('0x13')]);}logger[_0x5fe7('0x11')](_0x5fe7('0xc'),_0x624bb,_0x36e8f3['error'][_0x5fe7('0x13')]);return _0x55b419(_0x36e8f3[_0x5fe7('0x11')]['message']);}else{logger[_0x5fe7('0xb')](_0x5fe7('0xc'),_0x624bb,_0x5fe7('0xd'));_0x55b419(_0x36e8f3[_0x5fe7('0x14')]['message']);}})['catch'](function(_0x404e1d){logger[_0x5fe7('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x624bb,_0x404e1d);_0x50d6e0(_0x404e1d);});});}
\ No newline at end of file
index 6a2c591..1652160 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2ba=['../../components/interaction/service','../../config/environment','exports','express','Router','../../components/auth/service'];(function(_0x395bc8,_0x7a961a){var _0x3ccd99=function(_0x357c96){while(--_0x357c96){_0x395bc8['push'](_0x395bc8['shift']());}};_0x3ccd99(++_0x7a961a);}(_0xc2ba,0xc9));var _0xac2b=function(_0x4a2974,_0x1356d1){_0x4a2974=_0x4a2974-0x0;var _0x2dd27f=_0xc2ba[_0x4a2974];return _0x2dd27f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var express=require(_0xac2b('0x0'));var router=express[_0xac2b('0x1')]();var auth=require(_0xac2b('0x2'));var interaction=require(_0xac2b('0x3'));var config=require(_0xac2b('0x4'));module[_0xac2b('0x5')]=router;
\ No newline at end of file
+var _0xbaad=['exports','multer','util','path','express','Router','../../config/environment'];(function(_0x332b5e,_0x441db6){var _0x36fd58=function(_0x1d5a22){while(--_0x1d5a22){_0x332b5e['push'](_0x332b5e['shift']());}};_0x36fd58(++_0x441db6);}(_0xbaad,0xb0));var _0xdbaa=function(_0x1dc923,_0x57fe95){_0x1dc923=_0x1dc923-0x0;var _0x3398e1=_0xbaad[_0x1dc923];return _0x3398e1;};'use strict';var multer=require(_0xdbaa('0x0'));var util=require(_0xdbaa('0x1'));var path=require(_0xdbaa('0x2'));var express=require(_0xdbaa('0x3'));var router=express[_0xdbaa('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdbaa('0x5'));module[_0xdbaa('0x6')]=router;
\ No newline at end of file
index ced2a9c..5d93b5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4e9=['INTEGER','STRING','exports'];(function(_0x139a7c,_0x532ebb){var _0x9000d1=function(_0x34d421){while(--_0x34d421){_0x139a7c['push'](_0x139a7c['shift']());}};_0x9000d1(++_0x532ebb);}(_0xf4e9,0xc8));var _0x9f4e=function(_0x51c11d,_0x3a8d14){_0x51c11d=_0x51c11d-0x0;var _0x28964c=_0xf4e9[_0x51c11d];return _0x28964c;};'use strict';var Sequelize=require('sequelize');module[_0x9f4e('0x0')]={'penalty':{'type':Sequelize[_0x9f4e('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x9f4e('0x2')]}};
\ No newline at end of file
+var _0xcf21=['sequelize','exports','INTEGER','STRING'];(function(_0x2125f0,_0x2f23b9){var _0x12d6eb=function(_0x7a43ea){while(--_0x7a43ea){_0x2125f0['push'](_0x2125f0['shift']());}};_0x12d6eb(++_0x2f23b9);}(_0xcf21,0x168));var _0x1cf2=function(_0x191c87,_0x44f871){_0x191c87=_0x191c87-0x0;var _0x5af6bc=_0xcf21[_0x191c87];return _0x5af6bc;};'use strict';var Sequelize=require(_0x1cf2('0x0'));module[_0x1cf2('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1cf2('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x1cf2('0x3')]}};
\ No newline at end of file
index 1c9d6b2..f97b27f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00bb=['../../config/logger','moment','request-promise','./userFaxQueue.attributes','lodash','util'];(function(_0x54567f,_0x34fb25){var _0x91cc4f=function(_0x380ebf){while(--_0x380ebf){_0x54567f['push'](_0x54567f['shift']());}};_0x91cc4f(++_0x34fb25);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x00bb[_0x4fc9e6];return _0x551d28;};'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 attributes=require(_0xb00b('0x5'));module['exports']=function(_0x14b5d0,_0x2dbd25){return _0x14b5d0['define']('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x84ab=['util','../../config/logger','api','moment','request-promise','./userFaxQueue.attributes','define','lodash'];(function(_0x19753e,_0x6f0265){var _0x1bc35e=function(_0x1fb706){while(--_0x1fb706){_0x19753e['push'](_0x19753e['shift']());}};_0x1bc35e(++_0x6f0265);}(_0x84ab,0x12f));var _0xb84a=function(_0x33fcbb,_0x291d0f){_0x33fcbb=_0x33fcbb-0x0;var _0x2efe40=_0x84ab[_0x33fcbb];return _0x2efe40;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var logger=require(_0xb84a('0x2'))(_0xb84a('0x3'));var moment=require(_0xb84a('0x4'));var BPromise=require('bluebird');var rp=require(_0xb84a('0x5'));var attributes=require(_0xb84a('0x6'));module['exports']=function(_0x9d3a00,_0xe72ccd){return _0x9d3a00[_0xb84a('0x7')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3920caa..60c7955 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8eba=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','lodash','util','../../mysqldb'];(function(_0xd78fca,_0x59f230){var _0x25db55=function(_0xc2e772){while(--_0xc2e772){_0xd78fca['push'](_0xd78fca['shift']());}};_0x25db55(++_0x59f230);}(_0x8eba,0xc3));var _0xa8eb=function(_0x16cb03,_0x43ea58){_0x16cb03=_0x16cb03-0x0;var _0x10944e=_0x8eba[_0x16cb03];return _0x10944e;};'use strict';var _=require(_0xa8eb('0x0'));var util=require(_0xa8eb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0xa8eb('0x2'))['db'];var utils=require(_0xa8eb('0x3'));var logger=require(_0xa8eb('0x4'))(_0xa8eb('0x5'));var config=require('../../config/environment');var jayson=require(_0xa8eb('0x6'));var client=jayson[_0xa8eb('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x321f2f,_0x5ece80,_0x2571ae){return new BPromise(function(_0x225307,_0x509b54){return client[_0xa8eb('0x8')](_0x321f2f,_0x2571ae)['then'](function(_0x21e416){logger[_0xa8eb('0x9')]('UserFaxQueue,\x20%s,\x20%s',_0x5ece80,_0xa8eb('0xa'));logger[_0xa8eb('0xb')](_0xa8eb('0xc'),_0x5ece80,_0xa8eb('0xa'),JSON['stringify'](_0x21e416));if(_0x21e416[_0xa8eb('0xd')]){if(_0x21e416['error'][_0xa8eb('0xe')]===0x1f4){logger['error'](_0xa8eb('0xf'),_0x5ece80,_0x21e416[_0xa8eb('0xd')]['message']);return _0x509b54(_0x21e416[_0xa8eb('0xd')]['message']);}logger[_0xa8eb('0xd')](_0xa8eb('0xf'),_0x5ece80,_0x21e416[_0xa8eb('0xd')][_0xa8eb('0x10')]);return _0x225307(_0x21e416['error'][_0xa8eb('0x10')]);}else{logger['info'](_0xa8eb('0xf'),_0x5ece80,_0xa8eb('0xa'));_0x225307(_0x21e416[_0xa8eb('0x11')][_0xa8eb('0x10')]);}})['catch'](function(_0x115017){logger[_0xa8eb('0xd')](_0xa8eb('0xf'),_0x5ece80,_0x115017);_0x509b54(_0x115017);});});}
\ No newline at end of file
+var _0x9ab8=['client','http','request','then','info','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','lodash','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x836465,_0x5442ae){var _0x2150ea=function(_0x4f4bc2){while(--_0x4f4bc2){_0x836465['push'](_0x836465['shift']());}};_0x2150ea(++_0x5442ae);}(_0x9ab8,0x81));var _0x89ab=function(_0x3a9fb7,_0x1d40fd){_0x3a9fb7=_0x3a9fb7-0x0;var _0x106e20=_0x9ab8[_0x3a9fb7];return _0x106e20;};'use strict';var _=require(_0x89ab('0x0'));var util=require(_0x89ab('0x1'));var moment=require(_0x89ab('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0x89ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x89ab('0x4'))(_0x89ab('0x5'));var config=require('../../config/environment');var jayson=require(_0x89ab('0x6'));var client=jayson[_0x89ab('0x7')][_0x89ab('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb9ec6e,_0x29a984,_0x3ecaa0){return new BPromise(function(_0x366c32,_0x5fd99f){return client[_0x89ab('0x9')](_0xb9ec6e,_0x3ecaa0)[_0x89ab('0xa')](function(_0x205d35){logger[_0x89ab('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x29a984,'request\x20sent');logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x29a984,'request\x20sent',JSON[_0x89ab('0xc')](_0x205d35));if(_0x205d35[_0x89ab('0xd')]){if(_0x205d35[_0x89ab('0xd')][_0x89ab('0xe')]===0x1f4){logger[_0x89ab('0xd')](_0x89ab('0xf'),_0x29a984,_0x205d35[_0x89ab('0xd')]['message']);return _0x5fd99f(_0x205d35[_0x89ab('0xd')][_0x89ab('0x10')]);}logger[_0x89ab('0xd')](_0x89ab('0xf'),_0x29a984,_0x205d35[_0x89ab('0xd')]['message']);return _0x366c32(_0x205d35[_0x89ab('0xd')][_0x89ab('0x10')]);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x29a984,'request\x20sent');_0x366c32(_0x205d35['result']['message']);}})['catch'](function(_0x24d866){logger[_0x89ab('0xd')](_0x89ab('0xf'),_0x29a984,_0x24d866);_0x5fd99f(_0x24d866);});});}
\ No newline at end of file
index f27f869..5d4bef0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a94=['../../components/interaction/service','../../config/environment','multer','util','path','../../components/auth/service'];(function(_0x5f45ed,_0x768517){var _0xbeda01=function(_0x3d25ef){while(--_0x3d25ef){_0x5f45ed['push'](_0x5f45ed['shift']());}};_0xbeda01(++_0x768517);}(_0x5a94,0x116));var _0x45a9=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x5a94[_0x4d613c];return _0x301fe3;};'use strict';var multer=require(_0x45a9('0x0'));var util=require(_0x45a9('0x1'));var path=require(_0x45a9('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x45a9('0x3'));var interaction=require(_0x45a9('0x4'));var config=require(_0x45a9('0x5'));module['exports']=router;
\ No newline at end of file
+var _0x97ba=['../../components/interaction/service','../../config/environment','path','express','Router','../../components/auth/service'];(function(_0x1be20e,_0x5dcb41){var _0x3d0e0c=function(_0x5a7f6a){while(--_0x5a7f6a){_0x1be20e['push'](_0x1be20e['shift']());}};_0x3d0e0c(++_0x5dcb41);}(_0x97ba,0x9e));var _0xa97b=function(_0x227b27,_0x439c75){_0x227b27=_0x227b27-0x0;var _0x41aae5=_0x97ba[_0x227b27];return _0x41aae5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa97b('0x0'));var express=require(_0xa97b('0x1'));var router=express[_0xa97b('0x2')]();var auth=require(_0xa97b('0x3'));var interaction=require(_0xa97b('0x4'));var config=require(_0xa97b('0x5'));module['exports']=router;
\ No newline at end of file
index 66907ac..a865907 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1b7=['exports','INTEGER'];(function(_0x17a32f,_0x5a51a){var _0x15a293=function(_0x55fbd3){while(--_0x55fbd3){_0x17a32f['push'](_0x17a32f['shift']());}};_0x15a293(++_0x5a51a);}(_0xa1b7,0x70));var _0x7a1b=function(_0x360771,_0x3ea8ad){_0x360771=_0x360771-0x0;var _0x2bf0fb=_0xa1b7[_0x360771];return _0x2bf0fb;};'use strict';var Sequelize=require('sequelize');module[_0x7a1b('0x0')]={'penalty':{'type':Sequelize[_0x7a1b('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xaa94=['sequelize','exports','INTEGER'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xaa94,0xba));var _0x4aa9=function(_0x214137,_0x5e4b66){_0x214137=_0x214137-0x0;var _0x44c2b2=_0xaa94[_0x214137];return _0x44c2b2;};'use strict';var Sequelize=require(_0x4aa9('0x0'));module[_0x4aa9('0x1')]={'penalty':{'type':Sequelize[_0x4aa9('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index eb6d14c..5c7990f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc113=['../../config/logger','api','moment','bluebird','request-promise','./userMailQueue.attributes','exports','define','user_has_mail_queues','lodash','util'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xc113,0x1ab));var _0x3c11=function(_0x5038c8,_0x5b9688){_0x5038c8=_0x5038c8-0x0;var _0x460794=_0xc113[_0x5038c8];return _0x460794;};'use strict';var _=require(_0x3c11('0x0'));var util=require(_0x3c11('0x1'));var logger=require(_0x3c11('0x2'))(_0x3c11('0x3'));var moment=require(_0x3c11('0x4'));var BPromise=require(_0x3c11('0x5'));var rp=require(_0x3c11('0x6'));var attributes=require(_0x3c11('0x7'));module[_0x3c11('0x8')]=function(_0x531ac1,_0x18d401){return _0x531ac1[_0x3c11('0x9')]('UserMailQueue',attributes,{'tableName':_0x3c11('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbd8e=['request-promise','./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash','util','moment'];(function(_0xffb021,_0x3e62ae){var _0x2c02d8=function(_0x3e89a4){while(--_0x3e89a4){_0xffb021['push'](_0xffb021['shift']());}};_0x2c02d8(++_0x3e62ae);}(_0xbd8e,0x1b5));var _0xebd8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbd8e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xebd8('0x0'));var util=require(_0xebd8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xebd8('0x2'));var BPromise=require('bluebird');var rp=require(_0xebd8('0x3'));var attributes=require(_0xebd8('0x4'));module[_0xebd8('0x5')]=function(_0x6c6cfd,_0x36a43d){return _0x6c6cfd['define'](_0xebd8('0x6'),attributes,{'tableName':_0xebd8('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 669b734..7c9b7d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2208=['http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0x2208,0x11e));var _0x8220=function(_0x506188,_0x586d93){_0x506188=_0x506188-0x0;var _0x51825d=_0x2208[_0x506188];return _0x51825d;};'use strict';var _=require('lodash');var util=require(_0x8220('0x0'));var moment=require('moment');var BPromise=require(_0x8220('0x1'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x8220('0x2'))['db'];var utils=require(_0x8220('0x3'));var logger=require(_0x8220('0x4'))(_0x8220('0x5'));var config=require(_0x8220('0x6'));var jayson=require(_0x8220('0x7'));var client=jayson['client'][_0x8220('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4dd1a0,_0xc5e293,_0x4161c3){return new BPromise(function(_0x113b44,_0xe507a8){return client[_0x8220('0x9')](_0x4dd1a0,_0x4161c3)[_0x8220('0xa')](function(_0x511e42){logger[_0x8220('0xb')](_0x8220('0xc'),_0xc5e293,'request\x20sent');logger[_0x8220('0xd')](_0x8220('0xe'),_0xc5e293,_0x8220('0xf'),JSON[_0x8220('0x10')](_0x511e42));if(_0x511e42[_0x8220('0x11')]){if(_0x511e42['error']['code']===0x1f4){logger[_0x8220('0x11')](_0x8220('0xc'),_0xc5e293,_0x511e42[_0x8220('0x11')][_0x8220('0x12')]);return _0xe507a8(_0x511e42[_0x8220('0x11')][_0x8220('0x12')]);}logger[_0x8220('0x11')](_0x8220('0xc'),_0xc5e293,_0x511e42[_0x8220('0x11')][_0x8220('0x12')]);return _0x113b44(_0x511e42[_0x8220('0x11')][_0x8220('0x12')]);}else{logger[_0x8220('0xb')]('UserMailQueue,\x20%s,\x20%s',_0xc5e293,'request\x20sent');_0x113b44(_0x511e42[_0x8220('0x13')][_0x8220('0x12')]);}})[_0x8220('0x14')](function(_0xc10f2){logger[_0x8220('0x11')](_0x8220('0xc'),_0xc5e293,_0xc10f2);_0xe507a8(_0xc10f2);});});}
\ No newline at end of file
+var _0xd240=['rpc','../../config/environment','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x652a22,_0x58421b){var _0x805522=function(_0x2f016d){while(--_0x2f016d){_0x652a22['push'](_0x652a22['shift']());}};_0x805522(++_0x58421b);}(_0xd240,0x1c7));var _0x0d24=function(_0x2c151e,_0x3f4b4d){_0x2c151e=_0x2c151e-0x0;var _0x10a2e8=_0xd240[_0x2c151e];return _0x10a2e8;};'use strict';var _=require('lodash');var util=require(_0x0d24('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0d24('0x1'));var fs=require('fs');var db=require(_0x0d24('0x2'))['db'];var utils=require(_0x0d24('0x3'));var logger=require(_0x0d24('0x4'))(_0x0d24('0x5'));var config=require(_0x0d24('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0d24('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2accfe,_0x1005ff,_0x250141){return new BPromise(function(_0x48fb91,_0xdb2d81){return client[_0x0d24('0x8')](_0x2accfe,_0x250141)[_0x0d24('0x9')](function(_0x43d5e0){logger[_0x0d24('0xa')](_0x0d24('0xb'),_0x1005ff,_0x0d24('0xc'));logger['debug'](_0x0d24('0xd'),_0x1005ff,'request\x20sent',JSON[_0x0d24('0xe')](_0x43d5e0));if(_0x43d5e0['error']){if(_0x43d5e0[_0x0d24('0xf')][_0x0d24('0x10')]===0x1f4){logger[_0x0d24('0xf')]('UserMailQueue,\x20%s,\x20%s',_0x1005ff,_0x43d5e0['error'][_0x0d24('0x11')]);return _0xdb2d81(_0x43d5e0[_0x0d24('0xf')][_0x0d24('0x11')]);}logger['error'](_0x0d24('0xb'),_0x1005ff,_0x43d5e0[_0x0d24('0xf')]['message']);return _0x48fb91(_0x43d5e0['error'][_0x0d24('0x11')]);}else{logger[_0x0d24('0xa')](_0x0d24('0xb'),_0x1005ff,_0x0d24('0xc'));_0x48fb91(_0x43d5e0[_0x0d24('0x12')][_0x0d24('0x11')]);}})[_0x0d24('0x13')](function(_0x240f86){logger['error'](_0x0d24('0xb'),_0x1005ff,_0x240f86);_0xdb2d81(_0x240f86);});});}
\ No newline at end of file
index 1333e75..073eb39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x417c=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x12e747,_0x33ab29){var _0x54adb6=function(_0x2ac204){while(--_0x2ac204){_0x12e747['push'](_0x12e747['shift']());}};_0x54adb6(++_0x33ab29);}(_0x417c,0xf0));var _0xc417=function(_0xe05673,_0x84c423){_0xe05673=_0xe05673-0x0;var _0x1bdee1=_0x417c[_0xe05673];return _0x1bdee1;};'use strict';var multer=require(_0xc417('0x0'));var util=require(_0xc417('0x1'));var path=require(_0xc417('0x2'));var express=require(_0xc417('0x3'));var router=express[_0xc417('0x4')]();var auth=require(_0xc417('0x5'));var interaction=require(_0xc417('0x6'));var config=require('../../config/environment');module[_0xc417('0x7')]=router;
\ No newline at end of file
+var _0xff33=['util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x493a89,_0x2f5fac){var _0x5be45c=function(_0x1147ed){while(--_0x1147ed){_0x493a89['push'](_0x493a89['shift']());}};_0x5be45c(++_0x2f5fac);}(_0xff33,0x18e));var _0x3ff3=function(_0x4f1da5,_0x4ced17){_0x4f1da5=_0x4f1da5-0x0;var _0xe972a8=_0xff33[_0x4f1da5];return _0xe972a8;};'use strict';var multer=require(_0x3ff3('0x0'));var util=require(_0x3ff3('0x1'));var path=require('path');var express=require(_0x3ff3('0x2'));var router=express['Router']();var auth=require(_0x3ff3('0x3'));var interaction=require(_0x3ff3('0x4'));var config=require(_0x3ff3('0x5'));module[_0x3ff3('0x6')]=router;
\ No newline at end of file
index 699f186..5e80cd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb45a=['sequelize','exports','INTEGER'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0xb45a,0x1b9));var _0xab45=function(_0x28ff9f,_0x2cc4b5){_0x28ff9f=_0x28ff9f-0x0;var _0x4967ae=_0xb45a[_0x28ff9f];return _0x4967ae;};'use strict';var Sequelize=require(_0xab45('0x0'));module[_0xab45('0x1')]={'penalty':{'type':Sequelize[_0xab45('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xab17=['exports','INTEGER','sequelize'];(function(_0x66bb47,_0x1b2fa2){var _0x26e13b=function(_0x72a5ed){while(--_0x72a5ed){_0x66bb47['push'](_0x66bb47['shift']());}};_0x26e13b(++_0x1b2fa2);}(_0xab17,0x1f4));var _0x7ab1=function(_0x3c7696,_0x223fc1){_0x3c7696=_0x3c7696-0x0;var _0x187017=_0xab17[_0x3c7696];return _0x187017;};'use strict';var Sequelize=require(_0x7ab1('0x0'));module[_0x7ab1('0x1')]={'penalty':{'type':Sequelize[_0x7ab1('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 0815364..f770611 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6ef=['request-promise','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x33975c,_0x50d085){var _0x1c15ab=function(_0x54e8bc){while(--_0x54e8bc){_0x33975c['push'](_0x33975c['shift']());}};_0x1c15ab(++_0x50d085);}(_0xa6ef,0xec));var _0xfa6e=function(_0x4cd091,_0x2e2281){_0x4cd091=_0x4cd091-0x0;var _0x511059=_0xa6ef[_0x4cd091];return _0x511059;};'use strict';var _=require(_0xfa6e('0x0'));var util=require(_0xfa6e('0x1'));var logger=require(_0xfa6e('0x2'))(_0xfa6e('0x3'));var moment=require(_0xfa6e('0x4'));var BPromise=require(_0xfa6e('0x5'));var rp=require(_0xfa6e('0x6'));var attributes=require(_0xfa6e('0x7'));module[_0xfa6e('0x8')]=function(_0x77fca9,_0x5f40a7){return _0x77fca9[_0xfa6e('0x9')]('UserOpenchannelQueue',attributes,{'tableName':_0xfa6e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x639b=['./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','bluebird','request-promise'];(function(_0x5366ca,_0x284c3f){var _0x5818f3=function(_0x456160){while(--_0x456160){_0x5366ca['push'](_0x5366ca['shift']());}};_0x5818f3(++_0x284c3f);}(_0x639b,0x1e2));var _0xb639=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x639b[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xb639('0x0'));var logger=require(_0xb639('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb639('0x2'));var rp=require(_0xb639('0x3'));var attributes=require(_0xb639('0x4'));module[_0xb639('0x5')]=function(_0x182ff0,_0x41508a){return _0x182ff0[_0xb639('0x6')](_0xb639('0x7'),attributes,{'tableName':_0xb639('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 15c7bee..f8891cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0846=['http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x26eb59,_0x1ac8cd){var _0x2bf8fc=function(_0x3e5b0b){while(--_0x3e5b0b){_0x26eb59['push'](_0x26eb59['shift']());}};_0x2bf8fc(++_0x1ac8cd);}(_0x0846,0x84));var _0x6084=function(_0x386a66,_0x28f100){_0x386a66=_0x386a66-0x0;var _0x105813=_0x0846[_0x386a66];return _0x105813;};'use strict';var _=require(_0x6084('0x0'));var util=require('util');var moment=require(_0x6084('0x1'));var BPromise=require('bluebird');var rs=require(_0x6084('0x2'));var fs=require('fs');var db=require(_0x6084('0x3'))['db'];var utils=require(_0x6084('0x4'));var logger=require(_0x6084('0x5'))(_0x6084('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6084('0x7')][_0x6084('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9503,_0x5ed1d0,_0x226cdb){return new BPromise(function(_0x33bdb7,_0x45f01c){return client[_0x6084('0x9')](_0x1d9503,_0x226cdb)[_0x6084('0xa')](function(_0x2617b7){logger[_0x6084('0xb')](_0x6084('0xc'),_0x5ed1d0,_0x6084('0xd'));logger[_0x6084('0xe')](_0x6084('0xf'),_0x5ed1d0,_0x6084('0xd'),JSON[_0x6084('0x10')](_0x2617b7));if(_0x2617b7[_0x6084('0x11')]){if(_0x2617b7['error'][_0x6084('0x12')]===0x1f4){logger[_0x6084('0x11')](_0x6084('0xc'),_0x5ed1d0,_0x2617b7[_0x6084('0x11')][_0x6084('0x13')]);return _0x45f01c(_0x2617b7[_0x6084('0x11')][_0x6084('0x13')]);}logger[_0x6084('0x11')](_0x6084('0xc'),_0x5ed1d0,_0x2617b7[_0x6084('0x11')]['message']);return _0x33bdb7(_0x2617b7[_0x6084('0x11')][_0x6084('0x13')]);}else{logger[_0x6084('0xb')](_0x6084('0xc'),_0x5ed1d0,_0x6084('0xd'));_0x33bdb7(_0x2617b7['result']['message']);}})['catch'](function(_0x3c2679){logger[_0x6084('0x11')](_0x6084('0xc'),_0x5ed1d0,_0x3c2679);_0x45f01c(_0x3c2679);});});}
\ No newline at end of file
+var _0xfe44=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x3e6401,_0x12ef0e){var _0x3b1f5a=function(_0x543cd7){while(--_0x543cd7){_0x3e6401['push'](_0x3e6401['shift']());}};_0x3b1f5a(++_0x12ef0e);}(_0xfe44,0x1f4));var _0x4fe4=function(_0x57fd94,_0x27d70a){_0x57fd94=_0x57fd94-0x0;var _0x571dbe=_0xfe44[_0x57fd94];return _0x571dbe;};'use strict';var _=require(_0x4fe4('0x0'));var util=require('util');var moment=require(_0x4fe4('0x1'));var BPromise=require(_0x4fe4('0x2'));var rs=require(_0x4fe4('0x3'));var fs=require('fs');var db=require(_0x4fe4('0x4'))['db'];var utils=require(_0x4fe4('0x5'));var logger=require(_0x4fe4('0x6'))(_0x4fe4('0x7'));var config=require(_0x4fe4('0x8'));var jayson=require(_0x4fe4('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2b1b59,_0x4a21e3,_0x2b6445){return new BPromise(function(_0x36289b,_0x18e085){return client['request'](_0x2b1b59,_0x2b6445)[_0x4fe4('0xa')](function(_0x3a6d60){logger[_0x4fe4('0xb')](_0x4fe4('0xc'),_0x4a21e3,_0x4fe4('0xd'));logger[_0x4fe4('0xe')](_0x4fe4('0xf'),_0x4a21e3,_0x4fe4('0xd'),JSON[_0x4fe4('0x10')](_0x3a6d60));if(_0x3a6d60[_0x4fe4('0x11')]){if(_0x3a6d60['error']['code']===0x1f4){logger[_0x4fe4('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4a21e3,_0x3a6d60[_0x4fe4('0x11')]['message']);return _0x18e085(_0x3a6d60[_0x4fe4('0x11')][_0x4fe4('0x12')]);}logger['error'](_0x4fe4('0xc'),_0x4a21e3,_0x3a6d60[_0x4fe4('0x11')]['message']);return _0x36289b(_0x3a6d60[_0x4fe4('0x11')]['message']);}else{logger[_0x4fe4('0xb')](_0x4fe4('0xc'),_0x4a21e3,_0x4fe4('0xd'));_0x36289b(_0x3a6d60[_0x4fe4('0x13')][_0x4fe4('0x12')]);}})[_0x4fe4('0x14')](function(_0x31a6d0){logger['error'](_0x4fe4('0xc'),_0x4a21e3,_0x31a6d0);_0x18e085(_0x31a6d0);});});}
\ No newline at end of file
index 0a008fa..260f44b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x062d=['multer','util','path','express','Router','../../config/environment','exports'];(function(_0x15395f,_0x3a6b32){var _0x9d1b14=function(_0xc5701d){while(--_0xc5701d){_0x15395f['push'](_0x15395f['shift']());}};_0x9d1b14(++_0x3a6b32);}(_0x062d,0xaf));var _0xd062=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x062d[_0x1ae5ab];return _0x1ce001;};'use strict';var multer=require(_0xd062('0x0'));var util=require(_0xd062('0x1'));var path=require(_0xd062('0x2'));var express=require(_0xd062('0x3'));var router=express[_0xd062('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd062('0x5'));module[_0xd062('0x6')]=router;
\ No newline at end of file
+var _0xaa50=['express','Router','../../components/auth/service','../../config/environment','util','path'];(function(_0x2a07c9,_0x185c10){var _0x4e5723=function(_0x43ae97){while(--_0x43ae97){_0x2a07c9['push'](_0x2a07c9['shift']());}};_0x4e5723(++_0x185c10);}(_0xaa50,0x70));var _0x0aa5=function(_0x56a061,_0x53fb1b){_0x56a061=_0x56a061-0x0;var _0x105fa0=_0xaa50[_0x56a061];return _0x105fa0;};'use strict';var multer=require('multer');var util=require(_0x0aa5('0x0'));var path=require(_0x0aa5('0x1'));var express=require(_0x0aa5('0x2'));var router=express[_0x0aa5('0x3')]();var auth=require(_0x0aa5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0aa5('0x5'));module['exports']=router;
\ No newline at end of file
index 98149b6..fd2352f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x370f=['exports','INTEGER','sequelize'];(function(_0x4f1448,_0x65eca3){var _0x41c774=function(_0x546091){while(--_0x546091){_0x4f1448['push'](_0x4f1448['shift']());}};_0x41c774(++_0x65eca3);}(_0x370f,0x11c));var _0xf370=function(_0x2f8409,_0x369a87){_0x2f8409=_0x2f8409-0x0;var _0x40ad89=_0x370f[_0x2f8409];return _0x40ad89;};'use strict';var Sequelize=require(_0xf370('0x0'));module[_0xf370('0x1')]={'penalty':{'type':Sequelize[_0xf370('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x2759=['exports','INTEGER','sequelize'];(function(_0x547409,_0xa4c0c3){var _0x17b5b9=function(_0x1604bb){while(--_0x1604bb){_0x547409['push'](_0x547409['shift']());}};_0x17b5b9(++_0xa4c0c3);}(_0x2759,0xce));var _0x9275=function(_0x1c190c,_0x48125d){_0x1c190c=_0x1c190c-0x0;var _0x4fda82=_0x2759[_0x1c190c];return _0x4fda82;};'use strict';var Sequelize=require(_0x9275('0x0'));module[_0x9275('0x1')]={'penalty':{'type':Sequelize[_0x9275('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 79c00b8..c8dad6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ada=['user_has_sms_queues','util','api','moment','bluebird','./userSmsQueue.attributes','exports','UserSmsQueue'];(function(_0x1b905c,_0x287883){var _0x1f0195=function(_0x2959b2){while(--_0x2959b2){_0x1b905c['push'](_0x1b905c['shift']());}};_0x1f0195(++_0x287883);}(_0x7ada,0xc1));var _0xa7ad=function(_0x3e6597,_0x534d3a){_0x3e6597=_0x3e6597-0x0;var _0x47dc58=_0x7ada[_0x3e6597];return _0x47dc58;};'use strict';var _=require('lodash');var util=require(_0xa7ad('0x0'));var logger=require('../../config/logger')(_0xa7ad('0x1'));var moment=require(_0xa7ad('0x2'));var BPromise=require(_0xa7ad('0x3'));var rp=require('request-promise');var attributes=require(_0xa7ad('0x4'));module[_0xa7ad('0x5')]=function(_0x373140,_0x19cff8){return _0x373140['define'](_0xa7ad('0x6'),attributes,{'tableName':_0xa7ad('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc78e=['api','moment','bluebird','request-promise','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','util','../../config/logger'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0xc78e,0x148));var _0xec78=function(_0x44bf50,_0x48eacd){_0x44bf50=_0x44bf50-0x0;var _0x39f989=_0xc78e[_0x44bf50];return _0x39f989;};'use strict';var _=require('lodash');var util=require(_0xec78('0x0'));var logger=require(_0xec78('0x1'))(_0xec78('0x2'));var moment=require(_0xec78('0x3'));var BPromise=require(_0xec78('0x4'));var rp=require(_0xec78('0x5'));var attributes=require(_0xec78('0x6'));module[_0xec78('0x7')]=function(_0x5d60ae,_0x5e9a26){return _0x5d60ae[_0xec78('0x8')](_0xec78('0x9'),attributes,{'tableName':_0xec78('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 380c352..45e3277 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4605=['info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','then'];(function(_0x3a556e,_0x32191b){var _0xfe3a36=function(_0x9b32a3){while(--_0x9b32a3){_0x3a556e['push'](_0x3a556e['shift']());}};_0xfe3a36(++_0x32191b);}(_0x4605,0xb5));var _0x5460=function(_0x85fcc7,_0x4960ee){_0x85fcc7=_0x85fcc7-0x0;var _0x6aeafb=_0x4605[_0x85fcc7];return _0x6aeafb;};'use strict';var _=require('lodash');var util=require(_0x5460('0x0'));var moment=require(_0x5460('0x1'));var BPromise=require('bluebird');var rs=require(_0x5460('0x2'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x5460('0x3'));var logger=require(_0x5460('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5460('0x5'));var client=jayson[_0x5460('0x6')][_0x5460('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x31ea6d,_0x2233e6,_0x459aeb){return new BPromise(function(_0x5b3a62,_0x2943d4){return client['request'](_0x31ea6d,_0x459aeb)[_0x5460('0x8')](function(_0x5044d5){logger[_0x5460('0x9')](_0x5460('0xa'),_0x2233e6,'request\x20sent');logger[_0x5460('0xb')](_0x5460('0xc'),_0x2233e6,_0x5460('0xd'),JSON[_0x5460('0xe')](_0x5044d5));if(_0x5044d5[_0x5460('0xf')]){if(_0x5044d5[_0x5460('0xf')][_0x5460('0x10')]===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x2233e6,_0x5044d5[_0x5460('0xf')][_0x5460('0x11')]);return _0x2943d4(_0x5044d5[_0x5460('0xf')][_0x5460('0x11')]);}logger[_0x5460('0xf')](_0x5460('0xa'),_0x2233e6,_0x5044d5['error']['message']);return _0x5b3a62(_0x5044d5[_0x5460('0xf')][_0x5460('0x11')]);}else{logger['info'](_0x5460('0xa'),_0x2233e6,_0x5460('0xd'));_0x5b3a62(_0x5044d5['result'][_0x5460('0x11')]);}})[_0x5460('0x12')](function(_0xb7cdfc){logger[_0x5460('0xf')](_0x5460('0xa'),_0x2233e6,_0xb7cdfc);_0x2943d4(_0xb7cdfc);});});}
\ No newline at end of file
+var _0x980f=['request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserSmsQueue,\x20%s,\x20%s'];(function(_0x47415b,_0x2edd0b){var _0x33f971=function(_0x613668){while(--_0x613668){_0x47415b['push'](_0x47415b['shift']());}};_0x33f971(++_0x2edd0b);}(_0x980f,0x194));var _0xf980=function(_0x1f7839,_0x2a26e6){_0x1f7839=_0x1f7839-0x0;var _0x36b42e=_0x980f[_0x1f7839];return _0x36b42e;};'use strict';var _=require(_0xf980('0x0'));var util=require(_0xf980('0x1'));var moment=require(_0xf980('0x2'));var BPromise=require(_0xf980('0x3'));var rs=require('randomstring');var fs=require('fs');var db=require(_0xf980('0x4'))['db'];var utils=require(_0xf980('0x5'));var logger=require(_0xf980('0x6'))(_0xf980('0x7'));var config=require(_0xf980('0x8'));var jayson=require(_0xf980('0x9'));var client=jayson[_0xf980('0xa')][_0xf980('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x785222,_0x5a943f,_0x552f4d){return new BPromise(function(_0x5345fe,_0x4e4111){return client['request'](_0x785222,_0x552f4d)['then'](function(_0xf52e95){logger[_0xf980('0xc')](_0xf980('0xd'),_0x5a943f,_0xf980('0xe'));logger[_0xf980('0xf')](_0xf980('0x10'),_0x5a943f,_0xf980('0xe'),JSON[_0xf980('0x11')](_0xf52e95));if(_0xf52e95['error']){if(_0xf52e95['error']['code']===0x1f4){logger[_0xf980('0x12')](_0xf980('0xd'),_0x5a943f,_0xf52e95[_0xf980('0x12')][_0xf980('0x13')]);return _0x4e4111(_0xf52e95[_0xf980('0x12')][_0xf980('0x13')]);}logger[_0xf980('0x12')](_0xf980('0xd'),_0x5a943f,_0xf52e95[_0xf980('0x12')][_0xf980('0x13')]);return _0x5345fe(_0xf52e95[_0xf980('0x12')][_0xf980('0x13')]);}else{logger[_0xf980('0xc')](_0xf980('0xd'),_0x5a943f,_0xf980('0xe'));_0x5345fe(_0xf52e95[_0xf980('0x14')][_0xf980('0x13')]);}})[_0xf980('0x15')](function(_0x31d073){logger['error'](_0xf980('0xd'),_0x5a943f,_0x31d073);_0x4e4111(_0x31d073);});});}
\ No newline at end of file
index 4048d02..a4bebb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54bc=['Router','util'];(function(_0x35bed1,_0x36fd19){var _0x400c71=function(_0x5095c6){while(--_0x5095c6){_0x35bed1['push'](_0x35bed1['shift']());}};_0x400c71(++_0x36fd19);}(_0x54bc,0x7f));var _0xc54b=function(_0x5485dc,_0x2e2cbf){_0x5485dc=_0x5485dc-0x0;var _0x2a8432=_0x54bc[_0x5485dc];return _0x2a8432;};'use strict';var multer=require('multer');var util=require(_0xc54b('0x0'));var path=require('path');var express=require('express');var router=express[_0xc54b('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module['exports']=router;
\ No newline at end of file
+var _0x6ebb=['../../components/auth/service','../../config/environment','exports','multer','util','path','Router'];(function(_0x46d0bc,_0x1e92d8){var _0xc7df67=function(_0xbeefd7){while(--_0xbeefd7){_0x46d0bc['push'](_0x46d0bc['shift']());}};_0xc7df67(++_0x1e92d8);}(_0x6ebb,0x1d1));var _0xb6eb=function(_0x2a3d1b,_0x2c65d6){_0x2a3d1b=_0x2a3d1b-0x0;var _0x2c20b1=_0x6ebb[_0x2a3d1b];return _0x2c20b1;};'use strict';var multer=require(_0xb6eb('0x0'));var util=require(_0xb6eb('0x1'));var path=require(_0xb6eb('0x2'));var express=require('express');var router=express[_0xb6eb('0x3')]();var auth=require(_0xb6eb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb6eb('0x5'));module[_0xb6eb('0x6')]=router;
\ No newline at end of file
index ae4ea60..4de79b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecb1=['INTEGER','exports'];(function(_0x4517fd,_0x3e9521){var _0x3200e1=function(_0xbd8fb7){while(--_0xbd8fb7){_0x4517fd['push'](_0x4517fd['shift']());}};_0x3200e1(++_0x3e9521);}(_0xecb1,0x97));var _0x1ecb=function(_0x133a58,_0x2881b5){_0x133a58=_0x133a58-0x0;var _0x3af81b=_0xecb1[_0x133a58];return _0x3af81b;};'use strict';var Sequelize=require('sequelize');module[_0x1ecb('0x0')]={'penalty':{'type':Sequelize[_0x1ecb('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x7a8c=['exports'];(function(_0x52dace,_0x530aa7){var _0x4e43b6=function(_0x40aa29){while(--_0x40aa29){_0x52dace['push'](_0x52dace['shift']());}};_0x4e43b6(++_0x530aa7);}(_0x7a8c,0x12e));var _0xc7a8=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x7a8c[_0x68c979];return _0x4f0001;};'use strict';var Sequelize=require('sequelize');module[_0xc7a8('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 6ac577b..bb1eca1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2326=['request-promise','./userVoiceQueue.attributes','exports','UserVoiceQueue','lodash','util','../../config/logger','api','moment'];(function(_0x10a774,_0x4d1ba2){var _0xd05e5b=function(_0x43fffc){while(--_0x43fffc){_0x10a774['push'](_0x10a774['shift']());}};_0xd05e5b(++_0x4d1ba2);}(_0x2326,0xc1));var _0x6232=function(_0x536aaa,_0x503ec1){_0x536aaa=_0x536aaa-0x0;var _0x46a961=_0x2326[_0x536aaa];return _0x46a961;};'use strict';var _=require(_0x6232('0x0'));var util=require(_0x6232('0x1'));var logger=require(_0x6232('0x2'))(_0x6232('0x3'));var moment=require(_0x6232('0x4'));var BPromise=require('bluebird');var rp=require(_0x6232('0x5'));var attributes=require(_0x6232('0x6'));module[_0x6232('0x7')]=function(_0x357be4,_0x1e1d99){return _0x357be4['define'](_0x6232('0x8'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1ac6=['define','user_has_voice_queues','util','../../config/logger','api','moment','bluebird','request-promise','./userVoiceQueue.attributes','exports'];(function(_0x5de703,_0x34d9c1){var _0x57e080=function(_0x36da61){while(--_0x36da61){_0x5de703['push'](_0x5de703['shift']());}};_0x57e080(++_0x34d9c1);}(_0x1ac6,0x138));var _0x61ac=function(_0x2467b8,_0x584199){_0x2467b8=_0x2467b8-0x0;var _0x5d3095=_0x1ac6[_0x2467b8];return _0x5d3095;};'use strict';var _=require('lodash');var util=require(_0x61ac('0x0'));var logger=require(_0x61ac('0x1'))(_0x61ac('0x2'));var moment=require(_0x61ac('0x3'));var BPromise=require(_0x61ac('0x4'));var rp=require(_0x61ac('0x5'));var attributes=require(_0x61ac('0x6'));module[_0x61ac('0x7')]=function(_0x23bf0c,_0x3d798d){return _0x23bf0c[_0x61ac('0x8')]('UserVoiceQueue',attributes,{'tableName':_0x61ac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a14aa4d..566fd7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3544=['message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x119ff2,_0x4f4e01){var _0x1ffb07=function(_0x58140d){while(--_0x58140d){_0x119ff2['push'](_0x119ff2['shift']());}};_0x1ffb07(++_0x4f4e01);}(_0x3544,0x70));var _0x4354=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0x3544[_0x38eb23];return _0x48506a;};'use strict';var _=require(_0x4354('0x0'));var util=require(_0x4354('0x1'));var moment=require(_0x4354('0x2'));var BPromise=require('bluebird');var rs=require(_0x4354('0x3'));var fs=require('fs');var db=require(_0x4354('0x4'))['db'];var utils=require(_0x4354('0x5'));var logger=require('../../config/logger')(_0x4354('0x6'));var config=require(_0x4354('0x7'));var jayson=require(_0x4354('0x8'));var client=jayson[_0x4354('0x9')][_0x4354('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a0e1e,_0x293d9e,_0x390196){return new BPromise(function(_0x1c6808,_0x574127){return client[_0x4354('0xb')](_0x4a0e1e,_0x390196)[_0x4354('0xc')](function(_0x537b64){logger[_0x4354('0xd')](_0x4354('0xe'),_0x293d9e,_0x4354('0xf'));logger[_0x4354('0x10')](_0x4354('0x11'),_0x293d9e,_0x4354('0xf'),JSON['stringify'](_0x537b64));if(_0x537b64[_0x4354('0x12')]){if(_0x537b64[_0x4354('0x12')][_0x4354('0x13')]===0x1f4){logger[_0x4354('0x12')](_0x4354('0xe'),_0x293d9e,_0x537b64['error'][_0x4354('0x14')]);return _0x574127(_0x537b64[_0x4354('0x12')]['message']);}logger[_0x4354('0x12')](_0x4354('0xe'),_0x293d9e,_0x537b64['error'][_0x4354('0x14')]);return _0x1c6808(_0x537b64['error'][_0x4354('0x14')]);}else{logger['info'](_0x4354('0xe'),_0x293d9e,_0x4354('0xf'));_0x1c6808(_0x537b64[_0x4354('0x15')]['message']);}})['catch'](function(_0x1864c4){logger[_0x4354('0x12')](_0x4354('0xe'),_0x293d9e,_0x1864c4);_0x574127(_0x1864c4);});});}
\ No newline at end of file
+var _0x7488=['request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x57fc68,_0x138dce){var _0x481d46=function(_0x5c3ff6){while(--_0x5c3ff6){_0x57fc68['push'](_0x57fc68['shift']());}};_0x481d46(++_0x138dce);}(_0x7488,0x19a));var _0x8748=function(_0x9c5525,_0x36a7d3){_0x9c5525=_0x9c5525-0x0;var _0x12e417=_0x7488[_0x9c5525];return _0x12e417;};'use strict';var _=require(_0x8748('0x0'));var util=require(_0x8748('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8748('0x2'));var fs=require('fs');var db=require(_0x8748('0x3'))['db'];var utils=require(_0x8748('0x4'));var logger=require(_0x8748('0x5'))('rpc');var config=require(_0x8748('0x6'));var jayson=require(_0x8748('0x7'));var client=jayson[_0x8748('0x8')][_0x8748('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23502a,_0x593fee,_0x23f375){return new BPromise(function(_0x105f77,_0x1a244b){return client[_0x8748('0xa')](_0x23502a,_0x23f375)[_0x8748('0xb')](function(_0x4af94d){logger['info'](_0x8748('0xc'),_0x593fee,_0x8748('0xd'));logger[_0x8748('0xe')](_0x8748('0xf'),_0x593fee,_0x8748('0xd'),JSON[_0x8748('0x10')](_0x4af94d));if(_0x4af94d['error']){if(_0x4af94d[_0x8748('0x11')]['code']===0x1f4){logger[_0x8748('0x11')](_0x8748('0xc'),_0x593fee,_0x4af94d[_0x8748('0x11')][_0x8748('0x12')]);return _0x1a244b(_0x4af94d[_0x8748('0x11')][_0x8748('0x12')]);}logger[_0x8748('0x11')](_0x8748('0xc'),_0x593fee,_0x4af94d[_0x8748('0x11')][_0x8748('0x12')]);return _0x105f77(_0x4af94d['error']['message']);}else{logger['info'](_0x8748('0xc'),_0x593fee,_0x8748('0xd'));_0x105f77(_0x4af94d[_0x8748('0x13')]['message']);}})[_0x8748('0x14')](function(_0x3af28d){logger[_0x8748('0x11')](_0x8748('0xc'),_0x593fee,_0x3af28d);_0x1a244b(_0x3af28d);});});}
\ No newline at end of file
index 6a078ff..693870e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe473=['exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3a27fd,_0x22be27){var _0x3d8212=function(_0x32749b){while(--_0x32749b){_0x3a27fd['push'](_0x3a27fd['shift']());}};_0x3d8212(++_0x22be27);}(_0xe473,0x189));var _0x3e47=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0xe473[_0x2ed8f3];return _0x525a55;};'use strict';var multer=require(_0x3e47('0x0'));var util=require(_0x3e47('0x1'));var path=require('path');var express=require('express');var router=express[_0x3e47('0x2')]();var auth=require(_0x3e47('0x3'));var interaction=require(_0x3e47('0x4'));var config=require(_0x3e47('0x5'));module[_0x3e47('0x6')]=router;
\ No newline at end of file
+var _0xe39d=['exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xe39d,0x1a1));var _0xde39=function(_0x483e9f,_0x34ea72){_0x483e9f=_0x483e9f-0x0;var _0x1dddda=_0xe39d[_0x483e9f];return _0x1dddda;};'use strict';var multer=require(_0xde39('0x0'));var util=require(_0xde39('0x1'));var path=require(_0xde39('0x2'));var express=require(_0xde39('0x3'));var router=express[_0xde39('0x4')]();var auth=require(_0xde39('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xde39('0x6'));module[_0xde39('0x7')]=router;
\ No newline at end of file
index c7e99db..c135fec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2f0=['queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x2df37c,_0x48830b){var _0x3c33ba=function(_0x2ddb18){while(--_0x2ddb18){_0x2df37c['push'](_0x2df37c['shift']());}};_0x3c33ba(++_0x48830b);}(_0xb2f0,0x6d));var _0x0b2f=function(_0xe9b37e,_0x3bd2a7){_0xe9b37e=_0xe9b37e-0x0;var _0xce95d8=_0xb2f0[_0xe9b37e];return _0xce95d8;};'use strict';var Sequelize=require(_0x0b2f('0x0'));module[_0x0b2f('0x1')]={'uniqueid':{'type':Sequelize[_0x0b2f('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x0b2f('0x3')},'membername':{'type':Sequelize[_0x0b2f('0x4')],'allowNull':![],'comment':_0x0b2f('0x3')},'UserId':{'type':Sequelize[_0x0b2f('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x0b2f('0x4')],'allowNull':![],'unique':_0x0b2f('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x0b2f('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0b2f('0x5'),'comment':_0x0b2f('0x3')},'penalty':{'type':Sequelize[_0x0b2f('0x2')](0xb),'defaultValue':0x0,'comment':_0x0b2f('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x0b2f('0x3')}};
\ No newline at end of file
+var _0xe3ec=['sequelize','Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface'];(function(_0x598a6f,_0x263c42){var _0x47c368=function(_0x432628){while(--_0x432628){_0x598a6f['push'](_0x598a6f['shift']());}};_0x47c368(++_0x263c42);}(_0xe3ec,0x154));var _0xce3e=function(_0x4780cb,_0x2e0861){_0x4780cb=_0x4780cb-0x0;var _0x162621=_0xe3ec[_0x4780cb];return _0x162621;};'use strict';var Sequelize=require(_0xce3e('0x0'));module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xce3e('0x1')},'membername':{'type':Sequelize[_0xce3e('0x2')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xce3e('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xce3e('0x2')],'allowNull':![],'unique':_0xce3e('0x4'),'comment':_0xce3e('0x1')},'VoiceQueueId':{'type':Sequelize[_0xce3e('0x3')],'allowNull':![]},'interface':{'type':Sequelize[_0xce3e('0x2')],'allowNull':![],'unique':_0xce3e('0x4'),'comment':_0xce3e('0x1')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xce3e('0x1')},'paused':{'type':Sequelize[_0xce3e('0x3')](0xb),'defaultValue':0x0,'comment':_0xce3e('0x1')}};
\ No newline at end of file
index 5bb867a..c76e9c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9be=['emit','hasOwnProperty','exports','events','UserVoiceQueueRt','setMaxListeners','save','update','remove'];(function(_0x158f5a,_0xaacc25){var _0xb3722e=function(_0x1659bd){while(--_0x1659bd){_0x158f5a['push'](_0x158f5a['shift']());}};_0xb3722e(++_0xaacc25);}(_0xf9be,0x1ce));var _0xef9b=function(_0x3c007e,_0x2e6adc){_0x3c007e=_0x3c007e-0x0;var _0x851f31=_0xf9be[_0x3c007e];return _0x851f31;};'use strict';var EventEmitter=require(_0xef9b('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xef9b('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xef9b('0x2')](0x0);var events={'afterCreate':_0xef9b('0x3'),'afterUpdate':_0xef9b('0x4'),'afterDestroy':_0xef9b('0x5')};function emitEvent(_0x299ba1){return function(_0x279115,_0x23dd18,_0x32cf4f){UserVoiceQueueRtEvents['emit'](_0x299ba1+':'+_0x279115['id'],_0x279115);UserVoiceQueueRtEvents[_0xef9b('0x6')](_0x299ba1,_0x279115);_0x32cf4f(null);};}for(var e in events){if(events[_0xef9b('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xef9b('0x8')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0x8310=['UserVoiceQueueRt','setMaxListeners','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3d6eb1,_0x1f99b1){var _0x4e5356=function(_0x203406){while(--_0x203406){_0x3d6eb1['push'](_0x3d6eb1['shift']());}};_0x4e5356(++_0x1f99b1);}(_0x8310,0xee));var _0x0831=function(_0x4ccf96,_0x34978e){_0x4ccf96=_0x4ccf96-0x0;var _0xd103b7=_0x8310[_0x4ccf96];return _0xd103b7;};'use strict';var EventEmitter=require(_0x0831('0x0'));var UserVoiceQueueRt=require(_0x0831('0x1'))['db'][_0x0831('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x0831('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3a55ed){return function(_0x5cce66,_0x550910,_0x4a243a){UserVoiceQueueRtEvents[_0x0831('0x4')](_0x3a55ed+':'+_0x5cce66['id'],_0x5cce66);UserVoiceQueueRtEvents['emit'](_0x3a55ed,_0x5cce66);_0x4a243a(null);};}for(var e in events){if(events[_0x0831('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x0831('0x6')](e,emitEvent(event));}}module[_0x0831('0x7')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index f70a0f3..5689e63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cc2=['api','moment','bluebird','request-promise','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger'];(function(_0x16bfc5,_0x4f9dc3){var _0x43b820=function(_0x363ced){while(--_0x363ced){_0x16bfc5['push'](_0x16bfc5['shift']());}};_0x43b820(++_0x4f9dc3);}(_0x5cc2,0x1a2));var _0x25cc=function(_0xd83353,_0x4f6d74){_0xd83353=_0xd83353-0x0;var _0x551adf=_0x5cc2[_0xd83353];return _0x551adf;};'use strict';var _=require('lodash');var util=require(_0x25cc('0x0'));var logger=require(_0x25cc('0x1'))(_0x25cc('0x2'));var moment=require(_0x25cc('0x3'));var BPromise=require(_0x25cc('0x4'));var rp=require(_0x25cc('0x5'));var attributes=require(_0x25cc('0x6'));module[_0x25cc('0x7')]=function(_0x282ea9,_0x212ad5){return _0x282ea9['define'](_0x25cc('0x8'),attributes,{'tableName':_0x25cc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x898b=['UserVoiceQueueRt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./userVoiceQueueRt.attributes','exports'];(function(_0x5af27b,_0x473a20){var _0x54c243=function(_0x32d3df){while(--_0x32d3df){_0x5af27b['push'](_0x5af27b['shift']());}};_0x54c243(++_0x473a20);}(_0x898b,0xb5));var _0xb898=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x898b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb898('0x0'));var util=require(_0xb898('0x1'));var logger=require(_0xb898('0x2'))(_0xb898('0x3'));var moment=require(_0xb898('0x4'));var BPromise=require(_0xb898('0x5'));var rp=require(_0xb898('0x6'));var attributes=require(_0xb898('0x7'));module[_0xb898('0x8')]=function(_0x3fbd83,_0x311dd2){return _0x3fbd83['define'](_0xb898('0x9'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8ad6db9..cfa4f5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd33b=['message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','literal','outboundQueuePauses','stringify','catch','lodash','util','bluebird','../../config/logger','rpc','jayson/promise','client','http','socket.io-emitter','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0xa1a5cb,_0x4d20a7){var _0x5c2376=function(_0x33600f){while(--_0x33600f){_0xa1a5cb['push'](_0xa1a5cb['shift']());}};_0x5c2376(++_0x4d20a7);}(_0xd33b,0x1af));var _0xbd33=function(_0x3700dc,_0x4561da){_0x3700dc=_0x3700dc-0x0;var _0x1f22fe=_0xd33b[_0x3700dc];return _0x1f22fe;};'use strict';var _=require(_0xbd33('0x0'));var util=require(_0xbd33('0x1'));var moment=require('moment');var BPromise=require(_0xbd33('0x2'));var rs=require('randomstring');var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbd33('0x3'))(_0xbd33('0x4'));var config=require('../../config/environment');var jayson=require(_0xbd33('0x5'));var client=jayson[_0xbd33('0x6')][_0xbd33('0x7')]({'port':0x232a});var socket=require(_0xbd33('0x8'))({'host':'localhost','port':0x18eb});require(_0xbd33('0x9'))['register'](socket);function respondWithRpcPromise(_0x579ad2,_0x349b8f,_0x281b82){return new BPromise(function(_0x123ec1,_0x2fdb46){return client[_0xbd33('0xa')](_0x579ad2,_0x281b82)[_0xbd33('0xb')](function(_0x525774){logger[_0xbd33('0xc')](_0xbd33('0xd'),_0x349b8f,'request\x20sent');logger[_0xbd33('0xe')](_0xbd33('0xf'),_0x349b8f,_0xbd33('0x10'),JSON['stringify'](_0x525774));if(_0x525774[_0xbd33('0x11')]){if(_0x525774[_0xbd33('0x11')][_0xbd33('0x12')]===0x1f4){logger[_0xbd33('0x11')](_0xbd33('0xd'),_0x349b8f,_0x525774[_0xbd33('0x11')][_0xbd33('0x13')]);return _0x2fdb46(_0x525774['error'][_0xbd33('0x13')]);}logger[_0xbd33('0x11')](_0xbd33('0xd'),_0x349b8f,_0x525774['error']['message']);return _0x123ec1(_0x525774['error']['message']);}else{logger[_0xbd33('0xc')](_0xbd33('0xd'),_0x349b8f,'request\x20sent');_0x123ec1(_0x525774[_0xbd33('0x14')][_0xbd33('0x13')]);}})['catch'](function(_0x13bcda){logger[_0xbd33('0x11')](_0xbd33('0xd'),_0x349b8f,_0x13bcda);_0x2fdb46(_0x13bcda);});});}exports[_0xbd33('0x15')]=function(_0x4c975e){var _0x29b346=this;return new Promise(function(_0x8b9650,_0x1586c2){return db[_0xbd33('0x16')][_0xbd33('0x17')]({'raw':_0x4c975e[_0xbd33('0x18')]?_0x4c975e['options']['raw']===undefined?!![]:![]:!![],'where':_0x4c975e['options']?_0x4c975e[_0xbd33('0x18')][_0xbd33('0x19')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xbd33('0x1a')]('`paused`\x20=\x201,\x201,\x20null'))),_0xbd33('0x1b')]]})[_0xbd33('0xb')](function(_0x11f6a1){logger[_0xbd33('0xc')](_0xbd33('0x15'),_0x4c975e);logger['debug']('GetVoiceQueueRtPauses',_0x4c975e,JSON[_0xbd33('0x1c')](_0x11f6a1));_0x8b9650(_0x11f6a1);})[_0xbd33('0x1d')](function(_0x349a44){logger[_0xbd33('0x11')](_0xbd33('0x15'),_0x349a44[_0xbd33('0x13')],_0x4c975e);_0x1586c2(_0x29b346[_0xbd33('0x11')](0x1f4,_0x349a44[_0xbd33('0x13')]));});});};
\ No newline at end of file
+var _0x4156=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','register','request','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','UserVoiceQueueRt,\x20%s,\x20%s','message','info','result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','lodash','util','moment','bluebird'];(function(_0x6e6d51,_0x5eac5b){var _0x48d5c0=function(_0x1b4d4c){while(--_0x1b4d4c){_0x6e6d51['push'](_0x6e6d51['shift']());}};_0x48d5c0(++_0x5eac5b);}(_0x4156,0xf1));var _0x6415=function(_0x33ffe6,_0x5212c7){_0x33ffe6=_0x33ffe6-0x0;var _0x421d4b=_0x4156[_0x33ffe6];return _0x421d4b;};'use strict';var _=require(_0x6415('0x0'));var util=require(_0x6415('0x1'));var moment=require(_0x6415('0x2'));var BPromise=require(_0x6415('0x3'));var rs=require(_0x6415('0x4'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x6415('0x5'));var logger=require(_0x6415('0x6'))(_0x6415('0x7'));var config=require(_0x6415('0x8'));var jayson=require(_0x6415('0x9'));var client=jayson[_0x6415('0xa')][_0x6415('0xb')]({'port':0x232a});var socket=require('socket.io-emitter')({'host':_0x6415('0xc'),'port':0x18eb});require('./userVoiceQueueRt.socket')[_0x6415('0xd')](socket);function respondWithRpcPromise(_0x266237,_0x5bc51b,_0x919b59){return new BPromise(function(_0x224e7b,_0x3383d2){return client[_0x6415('0xe')](_0x266237,_0x919b59)['then'](function(_0x10b49c){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x5bc51b,_0x6415('0xf'));logger[_0x6415('0x10')](_0x6415('0x11'),_0x5bc51b,_0x6415('0xf'),JSON[_0x6415('0x12')](_0x10b49c));if(_0x10b49c[_0x6415('0x13')]){if(_0x10b49c[_0x6415('0x13')]['code']===0x1f4){logger['error'](_0x6415('0x14'),_0x5bc51b,_0x10b49c[_0x6415('0x13')][_0x6415('0x15')]);return _0x3383d2(_0x10b49c[_0x6415('0x13')][_0x6415('0x15')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x5bc51b,_0x10b49c[_0x6415('0x13')][_0x6415('0x15')]);return _0x224e7b(_0x10b49c['error'][_0x6415('0x15')]);}else{logger[_0x6415('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5bc51b,'request\x20sent');_0x224e7b(_0x10b49c[_0x6415('0x17')][_0x6415('0x15')]);}})[_0x6415('0x18')](function(_0xe513fe){logger[_0x6415('0x13')](_0x6415('0x14'),_0x5bc51b,_0xe513fe);_0x3383d2(_0xe513fe);});});}exports[_0x6415('0x19')]=function(_0x468dc2){var _0x20dbd8=this;return new Promise(function(_0x4f644e,_0x551985){return db['UserVoiceQueueRt'][_0x6415('0x1a')]({'raw':_0x468dc2[_0x6415('0x1b')]?_0x468dc2[_0x6415('0x1b')][_0x6415('0x1c')]===undefined?!![]:![]:!![],'where':_0x468dc2['options']?_0x468dc2[_0x6415('0x1b')][_0x6415('0x1d')]||null:null,'attributes':[[db[_0x6415('0x1e')]['fn']('COUNT',db[_0x6415('0x1e')]['fn']('IF',db[_0x6415('0x1e')][_0x6415('0x1f')](_0x6415('0x20')))),_0x6415('0x21')]]})[_0x6415('0x22')](function(_0x339c50){logger[_0x6415('0x16')](_0x6415('0x19'),_0x468dc2);logger['debug'](_0x6415('0x19'),_0x468dc2,JSON[_0x6415('0x12')](_0x339c50));_0x4f644e(_0x339c50);})['catch'](function(_0x15be31){logger[_0x6415('0x13')](_0x6415('0x19'),_0x15be31[_0x6415('0x15')],_0x468dc2);_0x551985(_0x20dbd8[_0x6415('0x13')](0x1f4,_0x15be31['message']));});});};
\ No newline at end of file
index 6ac3e9d..ec232fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5162=['userVoiceQueueRt:','./userVoiceQueueRt.events','emit','removeListener','register','length'];(function(_0x550e29,_0x4047f){var _0x3515b6=function(_0x303fe2){while(--_0x303fe2){_0x550e29['push'](_0x550e29['shift']());}};_0x3515b6(++_0x4047f);}(_0x5162,0x103));var _0x2516=function(_0x4f103e,_0x284aaf){_0x4f103e=_0x4f103e-0x0;var _0x474b4d=_0x5162[_0x4f103e];return _0x474b4d;};'use strict';var UserVoiceQueueRtEvents=require(_0x2516('0x0'));var events=['save','remove','update'];function createListener(_0x4db25c,_0x41fd28){return function(_0x2aaef5){_0x41fd28[_0x2516('0x1')](_0x4db25c,_0x2aaef5);};}function removeListener(_0x2d0b53,_0x2e48b6){return function(){UserVoiceQueueRtEvents[_0x2516('0x2')](_0x2d0b53,_0x2e48b6);};}exports[_0x2516('0x3')]=function(_0x5b71b5){for(var _0x48f411=0x0,_0x5beeb3=events[_0x2516('0x4')];_0x48f411<_0x5beeb3;_0x48f411++){var _0xba4b36=events[_0x48f411];var _0xa1557=createListener(_0x2516('0x5')+_0xba4b36,_0x5b71b5);UserVoiceQueueRtEvents['on'](_0xba4b36,_0xa1557);}};
\ No newline at end of file
+var _0xb458=['length','./userVoiceQueueRt.events','save','remove','emit','removeListener'];(function(_0x359707,_0x17f475){var _0x14e0b2=function(_0x21309a){while(--_0x21309a){_0x359707['push'](_0x359707['shift']());}};_0x14e0b2(++_0x17f475);}(_0xb458,0x103));var _0x8b45=function(_0x3bee27,_0x211a75){_0x3bee27=_0x3bee27-0x0;var _0x500445=_0xb458[_0x3bee27];return _0x500445;};'use strict';var UserVoiceQueueRtEvents=require(_0x8b45('0x0'));var events=[_0x8b45('0x1'),_0x8b45('0x2'),'update'];function createListener(_0x58a508,_0xdf89d4){return function(_0x93d9cd){_0xdf89d4[_0x8b45('0x3')](_0x58a508,_0x93d9cd);};}function removeListener(_0x13a8c6,_0x5d51e4){return function(){UserVoiceQueueRtEvents[_0x8b45('0x4')](_0x13a8c6,_0x5d51e4);};}exports['register']=function(_0x5cc2d5){for(var _0xe8d774=0x0,_0x12bd05=events[_0x8b45('0x5')];_0xe8d774<_0x12bd05;_0xe8d774++){var _0x3a8ccb=events[_0xe8d774];var _0x32342f=createListener('userVoiceQueueRt:'+_0x3a8ccb,_0x5cc2d5);UserVoiceQueueRtEvents['on'](_0x3a8ccb,_0x32342f);}};
\ No newline at end of file
index 09d6676..f233d53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc038=['show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../config/environment','./variable.controller','get','/:id'];(function(_0x489700,_0x1ea4c8){var _0xd84800=function(_0x1ba723){while(--_0x1ba723){_0x489700['push'](_0x489700['shift']());}};_0xd84800(++_0x1ea4c8);}(_0xc038,0x1ef));var _0x8c03=function(_0x41a9eb,_0x10f8d9){_0x41a9eb=_0x41a9eb-0x0;var _0x551b30=_0xc038[_0x41a9eb];return _0x551b30;};'use strict';var multer=require(_0x8c03('0x0'));var util=require(_0x8c03('0x1'));var path=require(_0x8c03('0x2'));var express=require(_0x8c03('0x3'));var router=express[_0x8c03('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8c03('0x5'));var controller=require(_0x8c03('0x6'));router[_0x8c03('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8c03('0x7')](_0x8c03('0x8'),auth['isAuthenticated'](),controller[_0x8c03('0x9')]);router[_0x8c03('0xa')]('/',auth[_0x8c03('0xb')](),controller[_0x8c03('0xc')]);router[_0x8c03('0xd')](_0x8c03('0x8'),auth[_0x8c03('0xb')](),controller[_0x8c03('0xe')]);router[_0x8c03('0xf')](_0x8c03('0x8'),auth['isAuthenticated'](),controller[_0x8c03('0x10')]);module[_0x8c03('0x11')]=router;
\ No newline at end of file
+var _0x6652=['./variable.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','multer','express','Router','../../components/auth/service'];(function(_0xdc4996,_0x15bedc){var _0x20fbb9=function(_0x47c811){while(--_0x47c811){_0xdc4996['push'](_0xdc4996['shift']());}};_0x20fbb9(++_0x15bedc);}(_0x6652,0x10a));var _0x2665=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x6652[_0xefd519];return _0x4bb882;};'use strict';var multer=require(_0x2665('0x0'));var util=require('util');var path=require('path');var express=require(_0x2665('0x1'));var router=express[_0x2665('0x2')]();var auth=require(_0x2665('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2665('0x4'));router[_0x2665('0x5')]('/',auth[_0x2665('0x6')](),controller[_0x2665('0x7')]);router[_0x2665('0x5')](_0x2665('0x8'),auth[_0x2665('0x6')](),controller[_0x2665('0x9')]);router[_0x2665('0xa')]('/',auth[_0x2665('0x6')](),controller['create']);router[_0x2665('0xb')](_0x2665('0x8'),auth[_0x2665('0x6')](),controller['update']);router[_0x2665('0xc')]('/:id',auth[_0x2665('0x6')](),controller[_0x2665('0xd')]);module[_0x2665('0xe')]=router;
\ No newline at end of file
index e38bc74..567f57f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf788=['exports','name','STRING','sequelize'];(function(_0x1c9ede,_0x347659){var _0x4f1521=function(_0x257329){while(--_0x257329){_0x1c9ede['push'](_0x1c9ede['shift']());}};_0x4f1521(++_0x347659);}(_0xf788,0x197));var _0x8f78=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf788[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x8f78('0x0'));module[_0x8f78('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8f78('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8f78('0x3')]}};
\ No newline at end of file
+var _0x98ae=['STRING','name','sequelize','exports'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x98ae,0x142));var _0xe98a=function(_0x264c2f,_0x1f3542){_0x264c2f=_0x264c2f-0x0;var _0x298353=_0x98ae[_0x264c2f];return _0x298353;};'use strict';var Sequelize=require(_0xe98a('0x0'));module[_0xe98a('0x1')]={'name':{'type':Sequelize[_0xe98a('0x2')],'unique':_0xe98a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 3686c6e..965bada 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1251=['find','create','body','params','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','Content-Range','apply','reject','update','then','error','stack','name','index','Variable','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','day','add','merge','filter','map','count','includeAll','include','findAll','catch','length','options'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1251,0x91));var _0x1125=function(_0x4189ef,_0x5c9421){_0x4189ef=_0x4189ef-0x0;var _0xccf375=_0x1251[_0x4189ef];return _0xccf375;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1125('0x0'));var zipdir=require(_0x1125('0x1'));var jsonpatch=require(_0x1125('0x2'));var rp=require(_0x1125('0x3'));var moment=require('moment');var BPromise=require(_0x1125('0x4'));var Mustache=require(_0x1125('0x5'));var util=require(_0x1125('0x6'));var path=require(_0x1125('0x7'));var sox=require(_0x1125('0x8'));var csv=require('to-csv');var ejs=require(_0x1125('0x9'));var fs=require('fs');var _=require(_0x1125('0xa'));var squel=require(_0x1125('0xb'));var crypto=require(_0x1125('0xc'));var jsforce=require(_0x1125('0xd'));var deskjs=require(_0x1125('0xe'));var toCsv=require(_0x1125('0xf'));var querystring=require(_0x1125('0x10'));var Papa=require(_0x1125('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x1125('0x12'))(_0x1125('0x13'));var utils=require(_0x1125('0x14'));var config=require('../../config/environment');var db=require(_0x1125('0x15'))['db'];function respondWithStatusCode(_0x244dc8,_0x4a1b43){_0x4a1b43=_0x4a1b43||0xcc;return function(_0x4b22c1){if(_0x4b22c1){return _0x244dc8[_0x1125('0x16')](_0x4a1b43);}return _0x244dc8[_0x1125('0x17')](_0x4a1b43)[_0x1125('0x18')]();};}function respondWithResult(_0x136323,_0xa9e3c6){_0xa9e3c6=_0xa9e3c6||0xc8;return function(_0x3fff1a){if(_0x3fff1a){return _0x136323[_0x1125('0x17')](_0xa9e3c6)[_0x1125('0x19')](_0x3fff1a);}};}function respondWithFilteredResult(_0x1c9510,_0x2c71f1){return function(_0x5f0cc7){if(_0x5f0cc7){var _0x1331ec=_0x5f0cc7['count'],_0x16c5d0=_0x2c71f1[_0x1125('0x1a')],_0x2702c2=_0x2c71f1[_0x1125('0x1a')]+_0x2c71f1['limit'],_0x45910f;if(_0x2702c2>=_0x1331ec){_0x2702c2=_0x1331ec;_0x45910f=0xc8;}else{_0x45910f=0xce;}_0x1c9510[_0x1125('0x17')](_0x45910f);return _0x1c9510['set'](_0x1125('0x1b'),_0x16c5d0+'-'+_0x2702c2+'/'+_0x1331ec)[_0x1125('0x19')](_0x5f0cc7);}return null;};}function patchUpdates(_0x31c998){return function(_0x5ed06e){try{jsonpatch[_0x1125('0x1c')](_0x5ed06e,_0x31c998,!![]);}catch(_0x5b8abd){return BPromise[_0x1125('0x1d')](_0x5b8abd);}return _0x5ed06e['save']();};}function saveUpdates(_0x56abd4,_0x3ccd21){return function(_0x2c495e){if(_0x2c495e){return _0x2c495e[_0x1125('0x1e')](_0x56abd4)[_0x1125('0x1f')](function(_0x125465){return _0x125465;});}return null;};}function removeEntity(_0x26988d,_0xc60241){return function(_0x544af1){if(_0x544af1){return _0x544af1['destroy']()['then'](function(){_0x26988d[_0x1125('0x17')](0xcc)[_0x1125('0x18')]();});}};}function handleEntityNotFound(_0x4e9a21,_0x32177e){return function(_0x33a29e){if(!_0x33a29e){_0x4e9a21['sendStatus'](0x194);}return _0x33a29e;};}function handleError(_0x64d8e0,_0x42ade2){_0x42ade2=_0x42ade2||0x1f4;return function(_0x49de00){logger[_0x1125('0x20')](_0x49de00[_0x1125('0x21')]);if(_0x49de00[_0x1125('0x22')]){delete _0x49de00[_0x1125('0x22')];}_0x64d8e0[_0x1125('0x17')](_0x42ade2)['send'](_0x49de00);};}exports[_0x1125('0x23')]=function(_0x29c019,_0x2386fb){var _0x10e24={},_0x47a009={},_0x3f45b1={'count':0x0,'rows':[]};var _0x8e613=db[_0x1125('0x24')][_0x1125('0x25')];_0x47a009[_0x1125('0x26')]=_[_0x1125('0x27')](_0x8e613);var _0x5b1612={'dateStart':_0x29c019[_0x1125('0x28')][_0x1125('0x29')],'dateEnd':_0x29c019[_0x1125('0x28')][_0x1125('0x2a')]};delete _0x29c019[_0x1125('0x28')]['dateStart'];delete _0x29c019['query'][_0x1125('0x2a')];_0x47a009[_0x1125('0x28')]=_[_0x1125('0x27')](_0x29c019[_0x1125('0x28')]);_0x47a009[_0x1125('0x2b')]=_[_0x1125('0x2c')](_0x47a009[_0x1125('0x26')],_0x47a009[_0x1125('0x28')]);_0x10e24[_0x1125('0x2d')]=_[_0x1125('0x2c')](_0x47a009[_0x1125('0x26')],qs['fields'](_0x29c019[_0x1125('0x28')][_0x1125('0x2e')]));_0x10e24['attributes']=_0x10e24[_0x1125('0x2d')]['length']?_0x10e24[_0x1125('0x2d')]:_0x47a009[_0x1125('0x26')];if(!_0x29c019['query'][_0x1125('0x2f')]('nolimit')){_0x10e24[_0x1125('0x30')]=qs[_0x1125('0x30')](_0x29c019[_0x1125('0x28')][_0x1125('0x30')]);_0x10e24[_0x1125('0x1a')]=qs[_0x1125('0x1a')](_0x29c019[_0x1125('0x28')][_0x1125('0x1a')]);}_0x10e24[_0x1125('0x31')]=qs[_0x1125('0x32')](_0x29c019[_0x1125('0x28')][_0x1125('0x32')]);_0x10e24[_0x1125('0x33')]=qs[_0x1125('0x2b')](_[_0x1125('0x34')](_0x29c019[_0x1125('0x28')],_0x47a009[_0x1125('0x2b')]));if(_0x5b1612['dateStart']){if(_0x5b1612[_0x1125('0x2a')]){_0x5b1612[_0x1125('0x2a')]=moment(_0x5b1612[_0x1125('0x2a')])['add'](0x1,_0x1125('0x35'));}else{_0x5b1612[_0x1125('0x2a')]=moment(_0x5b1612[_0x1125('0x29')])[_0x1125('0x36')](0x1,_0x1125('0x35'));}_[_0x1125('0x37')](_0x10e24['where'],{'createdAt':{'$gte':_0x5b1612['dateStart'],'$lte':_0x5b1612[_0x1125('0x2a')]}});}if(_0x29c019['query'][_0x1125('0x38')]){_0x10e24[_0x1125('0x33')]=_[_0x1125('0x37')](_0x10e24[_0x1125('0x33')],{'$or':_[_0x1125('0x39')](_0x10e24[_0x1125('0x2d')],function(_0x555264){var _0x313834={};_0x313834[_0x555264]={'$like':'%'+_0x29c019[_0x1125('0x28')]['filter']+'%'};return _0x313834;})});}_0x10e24=_[_0x1125('0x37')]({},_0x10e24,_0x29c019['options']);var _0x41fb11={'where':_0x10e24[_0x1125('0x33')]};return db[_0x1125('0x24')][_0x1125('0x3a')](_0x41fb11)[_0x1125('0x1f')](function(_0x14cc9c){_0x3f45b1[_0x1125('0x3a')]=_0x14cc9c;if(_0x29c019[_0x1125('0x28')][_0x1125('0x3b')]){_0x10e24[_0x1125('0x3c')]=[{'all':!![]}];}return db['Variable'][_0x1125('0x3d')](_0x10e24);})['then'](function(_0x1536e6){_0x3f45b1['rows']=_0x1536e6;return _0x3f45b1;})[_0x1125('0x1f')](respondWithFilteredResult(_0x2386fb,_0x10e24))[_0x1125('0x3e')](handleError(_0x2386fb,null));};exports['show']=function(_0x4c24d2,_0x2b342e){var _0x294f33={'raw':!![],'where':{'id':_0x4c24d2['params']['id']}},_0x4469d5={};_0x4469d5['model']=_[_0x1125('0x27')](db['Variable'][_0x1125('0x25')]);_0x4469d5[_0x1125('0x28')]=_[_0x1125('0x27')](_0x4c24d2['query']);_0x4469d5[_0x1125('0x2b')]=_[_0x1125('0x2c')](_0x4469d5['model'],_0x4469d5[_0x1125('0x28')]);_0x294f33['attributes']=_[_0x1125('0x2c')](_0x4469d5[_0x1125('0x26')],qs[_0x1125('0x2e')](_0x4c24d2['query'][_0x1125('0x2e')]));_0x294f33[_0x1125('0x2d')]=_0x294f33[_0x1125('0x2d')][_0x1125('0x3f')]?_0x294f33[_0x1125('0x2d')]:_0x4469d5[_0x1125('0x26')];if(_0x4c24d2[_0x1125('0x28')][_0x1125('0x3b')]){_0x294f33[_0x1125('0x3c')]=[{'all':!![]}];}_0x294f33=_[_0x1125('0x37')]({},_0x294f33,_0x4c24d2[_0x1125('0x40')]);return db[_0x1125('0x24')][_0x1125('0x41')](_0x294f33)[_0x1125('0x1f')](handleEntityNotFound(_0x2b342e,null))[_0x1125('0x1f')](respondWithResult(_0x2b342e,null))[_0x1125('0x3e')](handleError(_0x2b342e,null));};exports['create']=function(_0x2044b1,_0x3055fa){return db['Variable'][_0x1125('0x42')](_0x2044b1['body'],{})['then'](respondWithResult(_0x3055fa,0xc9))[_0x1125('0x3e')](handleError(_0x3055fa,null));};exports['update']=function(_0x3e525a,_0x2940b6){if(_0x3e525a['body']['id']){delete _0x3e525a[_0x1125('0x43')]['id'];}return db[_0x1125('0x24')][_0x1125('0x41')]({'where':{'id':_0x3e525a[_0x1125('0x44')]['id']}})[_0x1125('0x1f')](handleEntityNotFound(_0x2940b6,null))['then'](saveUpdates(_0x3e525a[_0x1125('0x43')],null))['then'](respondWithResult(_0x2940b6,null))[_0x1125('0x3e')](handleError(_0x2940b6,null));};exports[_0x1125('0x45')]=function(_0x59bf33,_0x2a9307){return db[_0x1125('0x24')][_0x1125('0x41')]({'where':{'id':_0x59bf33[_0x1125('0x44')]['id']}})[_0x1125('0x1f')](handleEntityNotFound(_0x2a9307,null))['then'](removeEntity(_0x2a9307,null))[_0x1125('0x3e')](handleError(_0x2a9307,null));};
\ No newline at end of file
+var _0xf76f=['jsforce','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','Variable','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','add','day','merge','filter','map','options','include','findAll','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xf76f,0x168));var _0xff76=function(_0x21014b,_0xb932fe){_0x21014b=_0x21014b-0x0;var _0x4da430=_0xf76f[_0x21014b];return _0x4da430;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xff76('0x0'));var rimraf=require(_0xff76('0x1'));var zipdir=require(_0xff76('0x2'));var jsonpatch=require(_0xff76('0x3'));var rp=require(_0xff76('0x4'));var moment=require('moment');var BPromise=require(_0xff76('0x5'));var Mustache=require(_0xff76('0x6'));var util=require(_0xff76('0x7'));var path=require(_0xff76('0x8'));var sox=require(_0xff76('0x9'));var csv=require(_0xff76('0xa'));var ejs=require(_0xff76('0xb'));var fs=require('fs');var _=require(_0xff76('0xc'));var squel=require(_0xff76('0xd'));var crypto=require(_0xff76('0xe'));var jsforce=require(_0xff76('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xff76('0xa'));var querystring=require(_0xff76('0x10'));var Papa=require(_0xff76('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0xff76('0x12'))(_0xff76('0x13'));var utils=require(_0xff76('0x14'));var config=require(_0xff76('0x15'));var db=require(_0xff76('0x16'))['db'];function respondWithStatusCode(_0x302963,_0x2e9ae3){_0x2e9ae3=_0x2e9ae3||0xcc;return function(_0x5c69cb){if(_0x5c69cb){return _0x302963[_0xff76('0x17')](_0x2e9ae3);}return _0x302963[_0xff76('0x18')](_0x2e9ae3)['end']();};}function respondWithResult(_0x12d367,_0x33cc53){_0x33cc53=_0x33cc53||0xc8;return function(_0x215189){if(_0x215189){return _0x12d367[_0xff76('0x18')](_0x33cc53)['json'](_0x215189);}};}function respondWithFilteredResult(_0x14e7b8,_0x15afee){return function(_0x9ff87){if(_0x9ff87){var _0x3c7c0d=_0x9ff87[_0xff76('0x19')],_0x6b2fb0=_0x15afee['offset'],_0x1a126e=_0x15afee['offset']+_0x15afee[_0xff76('0x1a')],_0x2b4f8a;if(_0x1a126e>=_0x3c7c0d){_0x1a126e=_0x3c7c0d;_0x2b4f8a=0xc8;}else{_0x2b4f8a=0xce;}_0x14e7b8[_0xff76('0x18')](_0x2b4f8a);return _0x14e7b8[_0xff76('0x1b')](_0xff76('0x1c'),_0x6b2fb0+'-'+_0x1a126e+'/'+_0x3c7c0d)[_0xff76('0x1d')](_0x9ff87);}return null;};}function patchUpdates(_0x4dac22){return function(_0x213f85){try{jsonpatch[_0xff76('0x1e')](_0x213f85,_0x4dac22,!![]);}catch(_0x420ddf){return BPromise[_0xff76('0x1f')](_0x420ddf);}return _0x213f85[_0xff76('0x20')]();};}function saveUpdates(_0x2fd427,_0x138b90){return function(_0x4369e4){if(_0x4369e4){return _0x4369e4[_0xff76('0x21')](_0x2fd427)[_0xff76('0x22')](function(_0x142357){return _0x142357;});}return null;};}function removeEntity(_0x3ecfa5,_0x52cf50){return function(_0x393627){if(_0x393627){return _0x393627[_0xff76('0x23')]()[_0xff76('0x22')](function(){_0x3ecfa5[_0xff76('0x18')](0xcc)[_0xff76('0x24')]();});}};}function handleEntityNotFound(_0x39022a,_0x4dbd60){return function(_0x442143){if(!_0x442143){_0x39022a[_0xff76('0x17')](0x194);}return _0x442143;};}function handleError(_0x95177c,_0x2a8b7e){_0x2a8b7e=_0x2a8b7e||0x1f4;return function(_0x586ef6){logger[_0xff76('0x25')](_0x586ef6[_0xff76('0x26')]);if(_0x586ef6[_0xff76('0x27')]){delete _0x586ef6[_0xff76('0x27')];}_0x95177c[_0xff76('0x18')](_0x2a8b7e)[_0xff76('0x28')](_0x586ef6);};}exports[_0xff76('0x29')]=function(_0x190c1d,_0x5616a0){var _0x803a25={},_0x22e076={},_0x33dc4c={'count':0x0,'rows':[]};var _0x1101f3=db[_0xff76('0x2a')][_0xff76('0x2b')];_0x22e076[_0xff76('0x2c')]=_[_0xff76('0x2d')](_0x1101f3);var _0x3cd1bd={'dateStart':_0x190c1d['query']['dateStart'],'dateEnd':_0x190c1d[_0xff76('0x2e')]['dateEnd']};delete _0x190c1d[_0xff76('0x2e')][_0xff76('0x2f')];delete _0x190c1d[_0xff76('0x2e')][_0xff76('0x30')];_0x22e076[_0xff76('0x2e')]=_[_0xff76('0x2d')](_0x190c1d[_0xff76('0x2e')]);_0x22e076[_0xff76('0x31')]=_[_0xff76('0x32')](_0x22e076['model'],_0x22e076['query']);_0x803a25[_0xff76('0x33')]=_['intersection'](_0x22e076[_0xff76('0x2c')],qs[_0xff76('0x34')](_0x190c1d[_0xff76('0x2e')]['fields']));_0x803a25[_0xff76('0x33')]=_0x803a25[_0xff76('0x33')][_0xff76('0x35')]?_0x803a25['attributes']:_0x22e076[_0xff76('0x2c')];if(!_0x190c1d['query'][_0xff76('0x36')](_0xff76('0x37'))){_0x803a25[_0xff76('0x1a')]=qs[_0xff76('0x1a')](_0x190c1d[_0xff76('0x2e')]['limit']);_0x803a25[_0xff76('0x38')]=qs[_0xff76('0x38')](_0x190c1d[_0xff76('0x2e')][_0xff76('0x38')]);}_0x803a25[_0xff76('0x39')]=qs[_0xff76('0x3a')](_0x190c1d['query'][_0xff76('0x3a')]);_0x803a25[_0xff76('0x3b')]=qs[_0xff76('0x31')](_['pick'](_0x190c1d[_0xff76('0x2e')],_0x22e076[_0xff76('0x31')]));if(_0x3cd1bd[_0xff76('0x2f')]){if(_0x3cd1bd[_0xff76('0x30')]){_0x3cd1bd[_0xff76('0x30')]=moment(_0x3cd1bd[_0xff76('0x30')])[_0xff76('0x3c')](0x1,_0xff76('0x3d'));}else{_0x3cd1bd[_0xff76('0x30')]=moment(_0x3cd1bd['dateStart'])[_0xff76('0x3c')](0x1,_0xff76('0x3d'));}_[_0xff76('0x3e')](_0x803a25[_0xff76('0x3b')],{'createdAt':{'$gte':_0x3cd1bd[_0xff76('0x2f')],'$lte':_0x3cd1bd[_0xff76('0x30')]}});}if(_0x190c1d['query'][_0xff76('0x3f')]){_0x803a25[_0xff76('0x3b')]=_['merge'](_0x803a25['where'],{'$or':_[_0xff76('0x40')](_0x803a25[_0xff76('0x33')],function(_0xe4808){var _0xc05e2b={};_0xc05e2b[_0xe4808]={'$like':'%'+_0x190c1d['query']['filter']+'%'};return _0xc05e2b;})});}_0x803a25=_[_0xff76('0x3e')]({},_0x803a25,_0x190c1d[_0xff76('0x41')]);var _0xb6104={'where':_0x803a25['where']};return db['Variable'][_0xff76('0x19')](_0xb6104)['then'](function(_0x4d34e4){_0x33dc4c[_0xff76('0x19')]=_0x4d34e4;if(_0x190c1d['query']['includeAll']){_0x803a25[_0xff76('0x42')]=[{'all':!![]}];}return db[_0xff76('0x2a')][_0xff76('0x43')](_0x803a25);})[_0xff76('0x22')](function(_0x802909){_0x33dc4c['rows']=_0x802909;return _0x33dc4c;})[_0xff76('0x22')](respondWithFilteredResult(_0x5616a0,_0x803a25))[_0xff76('0x44')](handleError(_0x5616a0,null));};exports[_0xff76('0x45')]=function(_0x59d427,_0x2e1dd4){var _0x347346={'raw':!![],'where':{'id':_0x59d427[_0xff76('0x46')]['id']}},_0x1831e4={};_0x1831e4['model']=_[_0xff76('0x2d')](db[_0xff76('0x2a')][_0xff76('0x2b')]);_0x1831e4['query']=_[_0xff76('0x2d')](_0x59d427[_0xff76('0x2e')]);_0x1831e4[_0xff76('0x31')]=_['intersection'](_0x1831e4[_0xff76('0x2c')],_0x1831e4[_0xff76('0x2e')]);_0x347346[_0xff76('0x33')]=_['intersection'](_0x1831e4[_0xff76('0x2c')],qs[_0xff76('0x34')](_0x59d427[_0xff76('0x2e')]['fields']));_0x347346['attributes']=_0x347346[_0xff76('0x33')][_0xff76('0x35')]?_0x347346[_0xff76('0x33')]:_0x1831e4['model'];if(_0x59d427[_0xff76('0x2e')][_0xff76('0x47')]){_0x347346[_0xff76('0x42')]=[{'all':!![]}];}_0x347346=_[_0xff76('0x3e')]({},_0x347346,_0x59d427['options']);return db[_0xff76('0x2a')][_0xff76('0x48')](_0x347346)[_0xff76('0x22')](handleEntityNotFound(_0x2e1dd4,null))['then'](respondWithResult(_0x2e1dd4,null))[_0xff76('0x44')](handleError(_0x2e1dd4,null));};exports[_0xff76('0x49')]=function(_0x1bc85a,_0x561733){return db[_0xff76('0x2a')]['create'](_0x1bc85a['body'],{})[_0xff76('0x22')](respondWithResult(_0x561733,0xc9))[_0xff76('0x44')](handleError(_0x561733,null));};exports[_0xff76('0x21')]=function(_0x4b49e4,_0x48ce45){if(_0x4b49e4[_0xff76('0x4a')]['id']){delete _0x4b49e4[_0xff76('0x4a')]['id'];}return db[_0xff76('0x2a')][_0xff76('0x48')]({'where':{'id':_0x4b49e4[_0xff76('0x46')]['id']}})['then'](handleEntityNotFound(_0x48ce45,null))['then'](saveUpdates(_0x4b49e4[_0xff76('0x4a')],null))['then'](respondWithResult(_0x48ce45,null))['catch'](handleError(_0x48ce45,null));};exports[_0xff76('0x23')]=function(_0x2a991b,_0x2617e8){return db[_0xff76('0x2a')]['find']({'where':{'id':_0x2a991b[_0xff76('0x46')]['id']}})[_0xff76('0x22')](handleEntityNotFound(_0x2617e8,null))['then'](removeEntity(_0x2617e8,null))[_0xff76('0x44')](handleError(_0x2617e8,null));};
\ No newline at end of file
index 269ce06..db416ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['api','moment','bluebird','./variable.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x1f54f8,_0x1b19fe){var _0x3f9144=function(_0x1d4df5){while(--_0x1d4df5){_0x1f54f8['push'](_0x1f54f8['shift']());}};_0x3f9144(++_0x1b19fe);}(_0x2ef3,0xba));var _0x32ef=function(_0x4cb05d,_0x5e060b){_0x4cb05d=_0x4cb05d-0x0;var _0x46f153=_0x2ef3[_0x4cb05d];return _0x46f153;};'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 attributes=require(_0x32ef('0x6'));module[_0x32ef('0x7')]=function(_0x524ab6,_0x402857){return _0x524ab6[_0x32ef('0x8')]('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1cb9=['exports','define','Variable','tools_variables','lodash','../../config/logger','api','moment','bluebird','./variable.attributes'];(function(_0x1dbaf7,_0x3d05b3){var _0x593f05=function(_0x381936){while(--_0x381936){_0x1dbaf7['push'](_0x1dbaf7['shift']());}};_0x593f05(++_0x3d05b3);}(_0x1cb9,0x14e));var _0x91cb=function(_0x36597e,_0x4ed439){_0x36597e=_0x36597e-0x0;var _0x171158=_0x1cb9[_0x36597e];return _0x171158;};'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 attributes=require(_0x91cb('0x5'));module[_0x91cb('0x6')]=function(_0x5652cd,_0x17c21c){return _0x5652cd[_0x91cb('0x7')](_0x91cb('0x8'),attributes,{'tableName':_0x91cb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cc41c63..71c1724 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1e7=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','Variable','raw','options','where','attributes','include','map','model','then','stringify','lodash','moment'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xd1e7,0x134));var _0x7d1e=function(_0x1ccea7,_0xb16f64){_0x1ccea7=_0x1ccea7-0x0;var _0x1ff4de=_0xd1e7[_0x1ccea7];return _0x1ff4de;};'use strict';var _=require(_0x7d1e('0x0'));var util=require('util');var moment=require(_0x7d1e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7d1e('0x2'));var fs=require('fs');var db=require(_0x7d1e('0x3'))['db'];var utils=require(_0x7d1e('0x4'));var logger=require(_0x7d1e('0x5'))(_0x7d1e('0x6'));var config=require(_0x7d1e('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7d1e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x498bcc,_0x2680e4,_0x2295ec){return new BPromise(function(_0x5edb4f,_0x5d054d){return client[_0x7d1e('0x9')](_0x498bcc,_0x2295ec)['then'](function(_0x2603c8){logger[_0x7d1e('0xa')](_0x7d1e('0xb'),_0x2680e4,_0x7d1e('0xc'));logger[_0x7d1e('0xd')](_0x7d1e('0xe'),_0x2680e4,_0x7d1e('0xc'),JSON['stringify'](_0x2603c8));if(_0x2603c8[_0x7d1e('0xf')]){if(_0x2603c8['error'][_0x7d1e('0x10')]===0x1f4){logger[_0x7d1e('0xf')]('Variable,\x20%s,\x20%s',_0x2680e4,_0x2603c8[_0x7d1e('0xf')][_0x7d1e('0x11')]);return _0x5d054d(_0x2603c8[_0x7d1e('0xf')]['message']);}logger[_0x7d1e('0xf')]('Variable,\x20%s,\x20%s',_0x2680e4,_0x2603c8[_0x7d1e('0xf')]['message']);return _0x5edb4f(_0x2603c8['error'][_0x7d1e('0x11')]);}else{logger[_0x7d1e('0xa')](_0x7d1e('0xb'),_0x2680e4,_0x7d1e('0xc'));_0x5edb4f(_0x2603c8[_0x7d1e('0x12')][_0x7d1e('0x11')]);}})[_0x7d1e('0x13')](function(_0x1099cf){logger['error'](_0x7d1e('0xb'),_0x2680e4,_0x1099cf);_0x5d054d(_0x1099cf);});});}exports[_0x7d1e('0x14')]=function(_0xd775c6){var _0x36728d=this;return new Promise(function(_0x414ec8,_0x5eaf51){return db[_0x7d1e('0x15')]['find']({'raw':_0xd775c6['options']?_0xd775c6['options'][_0x7d1e('0x16')]===undefined?!![]:![]:!![],'where':_0xd775c6[_0x7d1e('0x17')]?_0xd775c6['options'][_0x7d1e('0x18')]||null:null,'attributes':_0xd775c6[_0x7d1e('0x17')]?_0xd775c6[_0x7d1e('0x17')][_0x7d1e('0x19')]||null:null,'include':_0xd775c6[_0x7d1e('0x17')]?_0xd775c6[_0x7d1e('0x17')][_0x7d1e('0x1a')]?_[_0x7d1e('0x1b')](_0xd775c6['options'][_0x7d1e('0x1a')],function(_0x584006){return{'model':db[_0x584006[_0x7d1e('0x1c')]],'as':_0x584006['as'],'attributes':_0x584006[_0x7d1e('0x19')],'include':_0x584006['include']?_[_0x7d1e('0x1b')](_0x584006[_0x7d1e('0x1a')],function(_0x41e571){return{'model':db[_0x41e571['model']],'as':_0x41e571['as'],'attributes':_0x41e571[_0x7d1e('0x19')],'include':_0x41e571['include']?_[_0x7d1e('0x1b')](_0x41e571[_0x7d1e('0x1a')],function(_0xb4436){return{'model':db[_0xb4436[_0x7d1e('0x1c')]],'as':_0xb4436['as'],'attributes':_0xb4436['attributes']};}):[]};}):[]};}):[]:[]})[_0x7d1e('0x1d')](function(_0x4249c8){logger['info'](_0x7d1e('0x14'),_0xd775c6);logger[_0x7d1e('0xd')]('ShowVariable',_0xd775c6,JSON[_0x7d1e('0x1e')](_0x4249c8));_0x414ec8(_0x4249c8);})[_0x7d1e('0x13')](function(_0x362503){logger[_0x7d1e('0xf')]('ShowVariable',_0x362503[_0x7d1e('0x11')],_0xd775c6);_0x5eaf51(_0x36728d[_0x7d1e('0xf')](0x1f4,_0x362503[_0x7d1e('0x11')]));});});};
\ No newline at end of file
+var _0x4a4d=['attributes','include','map','model','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ShowVariable','Variable','find','options','raw','where'];(function(_0x3174c9,_0x17df71){var _0x5be992=function(_0x11a9fd){while(--_0x11a9fd){_0x3174c9['push'](_0x3174c9['shift']());}};_0x5be992(++_0x17df71);}(_0x4a4d,0x104));var _0xd4a4=function(_0x27edba,_0x3b8b4f){_0x27edba=_0x27edba-0x0;var _0x4d2d31=_0x4a4d[_0x27edba];return _0x4d2d31;};'use strict';var _=require(_0xd4a4('0x0'));var util=require('util');var moment=require(_0xd4a4('0x1'));var BPromise=require('bluebird');var rs=require(_0xd4a4('0x2'));var fs=require('fs');var db=require(_0xd4a4('0x3'))['db'];var utils=require(_0xd4a4('0x4'));var logger=require(_0xd4a4('0x5'))(_0xd4a4('0x6'));var config=require(_0xd4a4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd4a4('0x8')][_0xd4a4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32f9e3,_0x1d5a39,_0x15f1a3){return new BPromise(function(_0x5a7efc,_0x30cde7){return client[_0xd4a4('0xa')](_0x32f9e3,_0x15f1a3)[_0xd4a4('0xb')](function(_0x5c0379){logger['info'](_0xd4a4('0xc'),_0x1d5a39,_0xd4a4('0xd'));logger[_0xd4a4('0xe')](_0xd4a4('0xf'),_0x1d5a39,_0xd4a4('0xd'),JSON[_0xd4a4('0x10')](_0x5c0379));if(_0x5c0379[_0xd4a4('0x11')]){if(_0x5c0379[_0xd4a4('0x11')][_0xd4a4('0x12')]===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x1d5a39,_0x5c0379[_0xd4a4('0x11')]['message']);return _0x30cde7(_0x5c0379['error'][_0xd4a4('0x13')]);}logger[_0xd4a4('0x11')]('Variable,\x20%s,\x20%s',_0x1d5a39,_0x5c0379[_0xd4a4('0x11')][_0xd4a4('0x13')]);return _0x5a7efc(_0x5c0379['error'][_0xd4a4('0x13')]);}else{logger[_0xd4a4('0x14')](_0xd4a4('0xc'),_0x1d5a39,_0xd4a4('0xd'));_0x5a7efc(_0x5c0379['result'][_0xd4a4('0x13')]);}})[_0xd4a4('0x15')](function(_0x32f800){logger[_0xd4a4('0x11')](_0xd4a4('0xc'),_0x1d5a39,_0x32f800);_0x30cde7(_0x32f800);});});}exports[_0xd4a4('0x16')]=function(_0x2d431d){var _0x4aeb05=this;return new Promise(function(_0x14767b,_0x5a7c1c){return db[_0xd4a4('0x17')][_0xd4a4('0x18')]({'raw':_0x2d431d[_0xd4a4('0x19')]?_0x2d431d[_0xd4a4('0x19')][_0xd4a4('0x1a')]===undefined?!![]:![]:!![],'where':_0x2d431d[_0xd4a4('0x19')]?_0x2d431d[_0xd4a4('0x19')][_0xd4a4('0x1b')]||null:null,'attributes':_0x2d431d[_0xd4a4('0x19')]?_0x2d431d[_0xd4a4('0x19')][_0xd4a4('0x1c')]||null:null,'include':_0x2d431d[_0xd4a4('0x19')]?_0x2d431d[_0xd4a4('0x19')][_0xd4a4('0x1d')]?_[_0xd4a4('0x1e')](_0x2d431d[_0xd4a4('0x19')][_0xd4a4('0x1d')],function(_0x25ad85){return{'model':db[_0x25ad85['model']],'as':_0x25ad85['as'],'attributes':_0x25ad85[_0xd4a4('0x1c')],'include':_0x25ad85[_0xd4a4('0x1d')]?_[_0xd4a4('0x1e')](_0x25ad85[_0xd4a4('0x1d')],function(_0x3e9b94){return{'model':db[_0x3e9b94[_0xd4a4('0x1f')]],'as':_0x3e9b94['as'],'attributes':_0x3e9b94[_0xd4a4('0x1c')],'include':_0x3e9b94[_0xd4a4('0x1d')]?_['map'](_0x3e9b94[_0xd4a4('0x1d')],function(_0x372302){return{'model':db[_0x372302['model']],'as':_0x372302['as'],'attributes':_0x372302[_0xd4a4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd4a4('0xb')](function(_0x530916){logger['info'](_0xd4a4('0x16'),_0x2d431d);logger['debug'](_0xd4a4('0x16'),_0x2d431d,JSON['stringify'](_0x530916));_0x14767b(_0x530916);})[_0xd4a4('0x15')](function(_0x6fe416){logger[_0xd4a4('0x11')](_0xd4a4('0x16'),_0x6fe416[_0xd4a4('0x13')],_0x2d431d);_0x5a7c1c(_0x4aeb05[_0xd4a4('0x11')](0x1f4,_0x6fe416['message']));});});};
\ No newline at end of file
index 6274e44..9c27927 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d1d=['/fetch','isAuthenticated','/reset','canUpdate','reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express','Router','./version.controller','get','index'];(function(_0x44843b,_0x3f5d91){var _0x462e06=function(_0x542890){while(--_0x542890){_0x44843b['push'](_0x44843b['shift']());}};_0x462e06(++_0x3f5d91);}(_0x1d1d,0x72));var _0xd1d1=function(_0x214ff6,_0x4490cb){_0x214ff6=_0x214ff6-0x0;var _0x346532=_0x1d1d[_0x214ff6];return _0x346532;};'use strict';var express=require(_0xd1d1('0x0'));var router=express[_0xd1d1('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xd1d1('0x2'));router[_0xd1d1('0x3')]('/',controller[_0xd1d1('0x4')]);router['get'](_0xd1d1('0x5'),auth[_0xd1d1('0x6')](),auth['canUpdate'](),controller['fetch']);router[_0xd1d1('0x3')](_0xd1d1('0x7'),auth[_0xd1d1('0x6')](),auth[_0xd1d1('0x8')](),controller[_0xd1d1('0x9')]);router['get'](_0xd1d1('0xa'),auth['isAuthenticated'](),auth[_0xd1d1('0x8')](),controller[_0xd1d1('0xb')]);router['get'](_0xd1d1('0xc'),auth[_0xd1d1('0x6')](),controller[_0xd1d1('0xd')]);router[_0xd1d1('0x3')](_0xd1d1('0xe'),controller[_0xd1d1('0xf')]);module[_0xd1d1('0x10')]=router;
\ No newline at end of file
+var _0x6e1b=['Router','../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','pull','/restart','restart','migrations','express'];(function(_0x93b16,_0x4aa4ff){var _0x18c957=function(_0x40fa80){while(--_0x40fa80){_0x93b16['push'](_0x93b16['shift']());}};_0x18c957(++_0x4aa4ff);}(_0x6e1b,0x1a3));var _0xb6e1=function(_0x2b5608,_0x315f77){_0x2b5608=_0x2b5608-0x0;var _0x32b488=_0x6e1b[_0x2b5608];return _0x32b488;};'use strict';var express=require(_0xb6e1('0x0'));var router=express[_0xb6e1('0x1')]();var auth=require(_0xb6e1('0x2'));var controller=require(_0xb6e1('0x3'));router[_0xb6e1('0x4')]('/',controller['index']);router[_0xb6e1('0x4')](_0xb6e1('0x5'),auth[_0xb6e1('0x6')](),auth[_0xb6e1('0x7')](),controller[_0xb6e1('0x8')]);router['get'](_0xb6e1('0x9'),auth[_0xb6e1('0x6')](),auth[_0xb6e1('0x7')](),controller[_0xb6e1('0xa')]);router[_0xb6e1('0x4')]('/pull',auth[_0xb6e1('0x6')](),auth['canUpdate'](),controller[_0xb6e1('0xb')]);router[_0xb6e1('0x4')](_0xb6e1('0xc'),auth[_0xb6e1('0x6')](),controller[_0xb6e1('0xd')]);router[_0xb6e1('0x4')]('/migrations',controller[_0xb6e1('0xe')]);module['exports']=router;
\ No newline at end of file
index c4fcda8..1418a02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','catch','migrations','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','server','.js','Database\x20Migration\x20Completed!','umzug','path','pkginfo','version','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','exports','query','latest','fetch','tags'];(function(_0x57b657,_0x4cad15){var _0x216770=function(_0x16d71c){while(--_0x16d71c){_0x57b657['push'](_0x57b657['shift']());}};_0x216770(++_0x4cad15);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Umzug=require(_0x7995('0x0'));var path=require(_0x7995('0x1'));var pkginfo=require(_0x7995('0x2'))(module,_0x7995('0x3'));var exec=require('child_process')[_0x7995('0x4')];var db=require(_0x7995('0x5'))['db'];var config=require(_0x7995('0x6'));var pm2=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var git=require(_0x7995('0x9'))(config[_0x7995('0xa')]);exports[_0x7995('0xb')]=function(_0xbda126,_0x326741){var _0x4996ca={'current':module[_0x7995('0xc')][_0x7995('0x3')],'phonebar':0x2};if(_0xbda126['query']&&_0xbda126[_0x7995('0xd')][_0x7995('0xe')]){return git[_0x7995('0xf')]()[_0x7995('0x10')](function(_0x3c1d19,_0x1e400a){_0x4996ca[_0x7995('0xe')]=(_0x3c1d19?module['exports'][_0x7995('0x3')]:_0x1e400a[_0x7995('0xe')])||'2.0.0';return _0x326741[_0x7995('0x11')](0xc8)[_0x7995('0x12')](_0x4996ca);});}else{return _0x326741[_0x7995('0x11')](0xc8)[_0x7995('0x12')](_0x4996ca);}};exports[_0x7995('0xf')]=function(_0x23999f,_0x2bbe7a){return git['fetch'](['origin',_0x7995('0x13')],function(_0x2233dd){if(_0x2233dd){logger[_0x7995('0x14')](_0x2233dd);return _0x2bbe7a[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x2233dd);}logger[_0x7995('0x15')](_0x7995('0x16'));return _0x2bbe7a[_0x7995('0x11')](0xc8)['json']({'output':_0x7995('0x17')});});};exports['reset']=function(_0x2f832e,_0x37f297){return git[_0x7995('0x18')]([_0x7995('0x19'),_0x7995('0x1a')],function(_0x37a7d4){if(_0x37a7d4){logger['error'](_0x37a7d4);return _0x37f297['status'](0x1f4)[_0x7995('0x12')](_0x37a7d4);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x37f297[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':'git\x20reset\x20--hard'});});};exports[_0x7995('0x1b')]=function(_0x51f276,_0x4b1a8e){exec(_0x7995('0x1c'),function(_0x327b1f,_0x350fd9,_0x1a8568){logger[_0x7995('0x15')](_0x350fd9);logger[_0x7995('0x15')](_0x1a8568);if(_0x327b1f){logger['error'](_0x327b1f);return _0x4b1a8e[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x327b1f);}return _0x4b1a8e[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':_0x350fd9});});};exports[_0x7995('0x1d')]=function(_0x13bc35,_0x475351){return pm2[_0x7995('0x1d')]('motion2')[_0x7995('0x1e')](function(_0x34e70c){logger[_0x7995('0x15')](_0x7995('0x1f'),_0x34e70c);return _0x475351[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x7995('0x20')](function(_0x5911c3){logger[_0x7995('0x14')](_0x5911c3);return _0x475351[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x5911c3);});};exports[_0x7995('0x21')]=function(_0x11c1eb,_0x4b6f99){var _0x9b2a15=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x7995('0x22')],'modelName':_0x7995('0x22'),'columnName':_0x7995('0x3')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db['sequelize'][_0x7995('0x23')],function(){throw new Error(_0x7995('0x24'));}],'path':path[_0x7995('0x25')](config[_0x7995('0xa')],_0x7995('0x26'),_0x7995('0x21')),'pattern':/\.js$/}});_0x9b2a15['up']({'from':module['exports']['version']+_0x7995('0x27')})['then'](function(){return _0x4b6f99[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':_0x7995('0x28')});})[_0x7995('0x20')](function(_0x1f7d27){return _0x4b6f99['status'](0x1f4)[_0x7995('0x12')](_0x1f7d27);});};
\ No newline at end of file
+var _0x9957=['status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','catch','migrations','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','server','.js','Database\x20Migration\x20Completed!','umzug','path','pkginfo','version','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','exports','query','latest','fetch','tags'];(function(_0x27900c,_0x2868fd){var _0x3ea8e0=function(_0x1578ce){while(--_0x1578ce){_0x27900c['push'](_0x27900c['shift']());}};_0x3ea8e0(++_0x2868fd);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Umzug=require(_0x7995('0x0'));var path=require(_0x7995('0x1'));var pkginfo=require(_0x7995('0x2'))(module,_0x7995('0x3'));var exec=require('child_process')[_0x7995('0x4')];var db=require(_0x7995('0x5'))['db'];var config=require(_0x7995('0x6'));var pm2=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var git=require(_0x7995('0x9'))(config[_0x7995('0xa')]);exports[_0x7995('0xb')]=function(_0xbda126,_0x326741){var _0x4996ca={'current':module[_0x7995('0xc')][_0x7995('0x3')],'phonebar':0x2};if(_0xbda126['query']&&_0xbda126[_0x7995('0xd')][_0x7995('0xe')]){return git[_0x7995('0xf')]()[_0x7995('0x10')](function(_0x3c1d19,_0x1e400a){_0x4996ca[_0x7995('0xe')]=(_0x3c1d19?module['exports'][_0x7995('0x3')]:_0x1e400a[_0x7995('0xe')])||'2.0.0';return _0x326741[_0x7995('0x11')](0xc8)[_0x7995('0x12')](_0x4996ca);});}else{return _0x326741[_0x7995('0x11')](0xc8)[_0x7995('0x12')](_0x4996ca);}};exports[_0x7995('0xf')]=function(_0x23999f,_0x2bbe7a){return git['fetch'](['origin',_0x7995('0x13')],function(_0x2233dd){if(_0x2233dd){logger[_0x7995('0x14')](_0x2233dd);return _0x2bbe7a[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x2233dd);}logger[_0x7995('0x15')](_0x7995('0x16'));return _0x2bbe7a[_0x7995('0x11')](0xc8)['json']({'output':_0x7995('0x17')});});};exports['reset']=function(_0x2f832e,_0x37f297){return git[_0x7995('0x18')]([_0x7995('0x19'),_0x7995('0x1a')],function(_0x37a7d4){if(_0x37a7d4){logger['error'](_0x37a7d4);return _0x37f297['status'](0x1f4)[_0x7995('0x12')](_0x37a7d4);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x37f297[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':'git\x20reset\x20--hard'});});};exports[_0x7995('0x1b')]=function(_0x51f276,_0x4b1a8e){exec(_0x7995('0x1c'),function(_0x327b1f,_0x350fd9,_0x1a8568){logger[_0x7995('0x15')](_0x350fd9);logger[_0x7995('0x15')](_0x1a8568);if(_0x327b1f){logger['error'](_0x327b1f);return _0x4b1a8e[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x327b1f);}return _0x4b1a8e[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':_0x350fd9});});};exports[_0x7995('0x1d')]=function(_0x13bc35,_0x475351){return pm2[_0x7995('0x1d')]('motion2')[_0x7995('0x1e')](function(_0x34e70c){logger[_0x7995('0x15')](_0x7995('0x1f'),_0x34e70c);return _0x475351[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x7995('0x20')](function(_0x5911c3){logger[_0x7995('0x14')](_0x5911c3);return _0x475351[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x5911c3);});};exports[_0x7995('0x21')]=function(_0x11c1eb,_0x4b6f99){var _0x9b2a15=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x7995('0x22')],'modelName':_0x7995('0x22'),'columnName':_0x7995('0x3')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db['sequelize'][_0x7995('0x23')],function(){throw new Error(_0x7995('0x24'));}],'path':path[_0x7995('0x25')](config[_0x7995('0xa')],_0x7995('0x26'),_0x7995('0x21')),'pattern':/\.js$/}});_0x9b2a15['up']({'from':module['exports']['version']+_0x7995('0x27')})['then'](function(){return _0x4b6f99[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':_0x7995('0x28')});})[_0x7995('0x20')](function(_0x1f7d27){return _0x4b6f99['status'](0x1f4)[_0x7995('0x12')](_0x1f7d27);});};
\ No newline at end of file
index 6ba2298..93628a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['/describe','describe','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index'];(function(_0x586c1b,_0x3529f8){var _0x4dc8b1=function(_0x59bba7){while(--_0x59bba7){_0x586c1b['push'](_0x586c1b['shift']());}};_0x4dc8b1(++_0x3529f8);}(_0x7a54,0x106));var _0x47a5=function(_0x5b0c97,_0x5a0439){_0x5b0c97=_0x5b0c97-0x0;var _0x3dbc82=_0x7a54[_0x5b0c97];return _0x3dbc82;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var express=require('express');var router=express[_0x47a5('0x3')]();var auth=require(_0x47a5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x47a5('0x5'));var controller=require(_0x47a5('0x6'));router[_0x47a5('0x7')]('/',auth[_0x47a5('0x8')](),controller[_0x47a5('0x9')]);router['get'](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router[_0x47a5('0x7')]('/:id',auth[_0x47a5('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x47a5('0xc')]);router[_0x47a5('0xd')]('/:id',auth[_0x47a5('0x8')](),controller['update']);router['delete'](_0x47a5('0xe'),auth[_0x47a5('0x8')](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router;
\ No newline at end of file
+var _0xb10b=['./voiceAgentReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','multer','path','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x269b16,_0x37754f){var _0x40e688=function(_0x2a99e9){while(--_0x2a99e9){_0x269b16['push'](_0x269b16['shift']());}};_0x40e688(++_0x37754f);}(_0xb10b,0x12a));var _0xbb10=function(_0xf1dbd8,_0x1cb2e1){_0xf1dbd8=_0xf1dbd8-0x0;var _0x5ee4be=_0xb10b[_0xf1dbd8];return _0x5ee4be;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var express=require(_0xbb10('0x2'));var router=express[_0xbb10('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbb10('0x4'));var config=require(_0xbb10('0x5'));var controller=require(_0xbb10('0x6'));router[_0xbb10('0x7')]('/',auth[_0xbb10('0x8')](),controller[_0xbb10('0x9')]);router['get'](_0xbb10('0xa'),auth[_0xbb10('0x8')](),controller['describe']);router[_0xbb10('0x7')](_0xbb10('0xb'),auth[_0xbb10('0x8')](),controller[_0xbb10('0xc')]);router[_0xbb10('0xd')]('/',auth[_0xbb10('0x8')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')](_0xbb10('0xb'),auth['isAuthenticated'](),controller[_0xbb10('0x12')]);module['exports']=router;
\ No newline at end of file
index af45de9..6b32e63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1312=['exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x1312,0xbe));var _0x2131=function(_0x479978,_0x46ab1e){_0x479978=_0x479978-0x0;var _0x567a9f=_0x1312[_0x479978];return _0x567a9f;};'use strict';var Sequelize=require('sequelize');module[_0x2131('0x0')]={'type':{'type':Sequelize[_0x2131('0x1')]},'uniqueid':{'type':Sequelize[_0x2131('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2131('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x2131('0x1')]},'membername':{'type':Sequelize[_0x2131('0x1')]},'agentcalledAt':{'type':Sequelize[_0x2131('0x2')]},'agentconnectAt':{'type':Sequelize[_0x2131('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x2131('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x2131('0x2')]},'agentdumpAt':{'type':Sequelize[_0x2131('0x2')]},'holdtime':{'type':Sequelize[_0x2131('0x3')]},'agentcomplete':{'type':Sequelize[_0x2131('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x2131('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x2131('0x3')]},'agentacw':{'type':Sequelize[_0x2131('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x2131('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x2131('0x1')]},'channel':{'type':Sequelize[_0x2131('0x1')]},'channelstate':{'type':Sequelize[_0x2131('0x3')]},'channelstatedesc':{'type':Sequelize[_0x2131('0x1')]},'connectedlinenum':{'type':Sequelize[_0x2131('0x1')]},'connectedlinename':{'type':Sequelize[_0x2131('0x1')]},'language':{'type':Sequelize[_0x2131('0x1')]},'accountcode':{'type':Sequelize[_0x2131('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x2131('0x1')]},'priority':{'type':Sequelize[_0x2131('0x1')]},'destchannel':{'type':Sequelize[_0x2131('0x1')]},'destchannelstate':{'type':Sequelize[_0x2131('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x2131('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x2131('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x2131('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x2131('0x1')]},'destlanguage':{'type':Sequelize[_0x2131('0x1')]},'destaccountcode':{'type':Sequelize[_0x2131('0x1')]},'destcontext':{'type':Sequelize[_0x2131('0x1')]},'destexten':{'type':Sequelize[_0x2131('0x1')]},'destpriority':{'type':Sequelize[_0x2131('0x1')]},'destuniqueid':{'type':Sequelize[_0x2131('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x2131('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x2131('0x1')]}};
\ No newline at end of file
+var _0x6371=['STRING','DATE','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x38e250,_0x9e6df1){var _0x3996df=function(_0x20a82a){while(--_0x20a82a){_0x38e250['push'](_0x38e250['shift']());}};_0x3996df(++_0x9e6df1);}(_0x6371,0x76));var _0x1637=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0x6371[_0x43f881];return _0x365c14;};'use strict';var Sequelize=require(_0x1637('0x0'));module[_0x1637('0x1')]={'type':{'type':Sequelize[_0x1637('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1637('0x2')]},'calleridname':{'type':Sequelize[_0x1637('0x2')]},'queue':{'type':Sequelize[_0x1637('0x2')]},'interface':{'type':Sequelize[_0x1637('0x2')]},'membername':{'type':Sequelize[_0x1637('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x1637('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x1637('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x1637('0x4')]},'agentcomplete':{'type':Sequelize[_0x1637('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x1637('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x1637('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x1637('0x4')]},'reason':{'type':Sequelize[_0x1637('0x2')]},'lastevent':{'type':Sequelize[_0x1637('0x2')]},'channel':{'type':Sequelize[_0x1637('0x2')]},'channelstate':{'type':Sequelize[_0x1637('0x4')]},'channelstatedesc':{'type':Sequelize[_0x1637('0x2')]},'connectedlinenum':{'type':Sequelize[_0x1637('0x2')]},'connectedlinename':{'type':Sequelize[_0x1637('0x2')]},'language':{'type':Sequelize[_0x1637('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x1637('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x1637('0x2')]},'destchannel':{'type':Sequelize[_0x1637('0x2')]},'destchannelstate':{'type':Sequelize[_0x1637('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x1637('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x1637('0x2')]},'destlanguage':{'type':Sequelize[_0x1637('0x2')]},'destaccountcode':{'type':Sequelize[_0x1637('0x2')]},'destcontext':{'type':Sequelize[_0x1637('0x2')]},'destexten':{'type':Sequelize[_0x1637('0x2')]},'destpriority':{'type':Sequelize[_0x1637('0x2')]},'destuniqueid':{'type':Sequelize[_0x1637('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x1637('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x1637('0x2')]}};
\ No newline at end of file
index be91f50..cf00018 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['keys','dateStart','query','dateEnd','intersection','fields','attributes','length','nolimit','limit','sort','where','pick','add','day','merge','options','includeAll','include','findAll','rows','catch','params','find','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','VoiceAgentReport','rawAttributes','model'];(function(_0x128642,_0x256d1){var _0x3c4c8b=function(_0xaaedca){while(--_0xaaedca){_0x128642['push'](_0x128642['shift']());}};_0x3c4c8b(++_0x256d1);}(_0xb10b,0x12a));var _0xbb10=function(_0x10aebb,_0x2fd10a){_0x10aebb=_0x10aebb-0x0;var _0x1b1b8f=_0xb10b[_0x10aebb];return _0x1b1b8f;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var qs=require(_0xbb10('0x12'));var logger=require(_0xbb10('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xbb10('0x14'));var db=require(_0xbb10('0x15'))['db'];function respondWithStatusCode(_0xce64f3,_0x5e136d){_0x5e136d=_0x5e136d||0xcc;return function(_0x408248){if(_0x408248){return _0xce64f3['sendStatus'](_0x5e136d);}return _0xce64f3[_0xbb10('0x16')](_0x5e136d)[_0xbb10('0x17')]();};}function respondWithResult(_0x285009,_0x193a27){_0x193a27=_0x193a27||0xc8;return function(_0x442548){if(_0x442548){return _0x285009[_0xbb10('0x16')](_0x193a27)['json'](_0x442548);}};}function respondWithFilteredResult(_0x26e021,_0x42d7e4){return function(_0x45b9d6){if(_0x45b9d6){var _0x17fd46=_0x45b9d6[_0xbb10('0x18')],_0x3df17b=_0x42d7e4[_0xbb10('0x19')],_0x2f2ebf=_0x42d7e4[_0xbb10('0x19')]+_0x42d7e4['limit'],_0x24a57b;if(_0x2f2ebf>=_0x17fd46){_0x2f2ebf=_0x17fd46;_0x24a57b=0xc8;}else{_0x24a57b=0xce;}_0x26e021[_0xbb10('0x16')](_0x24a57b);return _0x26e021[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x3df17b+'-'+_0x2f2ebf+'/'+_0x17fd46)[_0xbb10('0x1c')](_0x45b9d6);}return null;};}function patchUpdates(_0x378da8){return function(_0x1682a4){try{jsonpatch[_0xbb10('0x1d')](_0x1682a4,_0x378da8,!![]);}catch(_0x30efc6){return BPromise[_0xbb10('0x1e')](_0x30efc6);}return _0x1682a4[_0xbb10('0x1f')]();};}function saveUpdates(_0x48b6e9,_0x5ff0cf){return function(_0x19f48d){if(_0x19f48d){return _0x19f48d[_0xbb10('0x20')](_0x48b6e9)[_0xbb10('0x21')](function(_0xdf237d){return _0xdf237d;});}return null;};}function removeEntity(_0x44e563,_0x4deb49){return function(_0x12f888){if(_0x12f888){return _0x12f888[_0xbb10('0x22')]()['then'](function(){_0x44e563['status'](0xcc)[_0xbb10('0x17')]();});}};}function handleEntityNotFound(_0x311abe,_0x2e911d){return function(_0x317da4){if(!_0x317da4){_0x311abe[_0xbb10('0x23')](0x194);}return _0x317da4;};}function handleError(_0x1824b7,_0x407cb4){_0x407cb4=_0x407cb4||0x1f4;return function(_0x436104){logger[_0xbb10('0x24')](_0x436104[_0xbb10('0x25')]);if(_0x436104[_0xbb10('0x26')]){delete _0x436104[_0xbb10('0x26')];}_0x1824b7['status'](_0x407cb4)['send'](_0x436104);};}exports['index']=function(_0xc93a04,_0x3c5ae7){var _0x2c89b9={},_0x4e25ff={},_0x2fdde9={'count':0x0,'rows':[]};var _0x24d586=db[_0xbb10('0x27')][_0xbb10('0x28')];_0x4e25ff[_0xbb10('0x29')]=_[_0xbb10('0x2a')](_0x24d586);var _0x2a0e8b={'dateStart':_0xc93a04['query'][_0xbb10('0x2b')],'dateEnd':_0xc93a04[_0xbb10('0x2c')][_0xbb10('0x2d')]};delete _0xc93a04[_0xbb10('0x2c')][_0xbb10('0x2b')];delete _0xc93a04[_0xbb10('0x2c')]['dateEnd'];_0x4e25ff[_0xbb10('0x2c')]=_['keys'](_0xc93a04[_0xbb10('0x2c')]);_0x4e25ff['filters']=_[_0xbb10('0x2e')](_0x4e25ff[_0xbb10('0x29')],_0x4e25ff[_0xbb10('0x2c')]);_0x2c89b9['attributes']=_['intersection'](_0x4e25ff[_0xbb10('0x29')],qs[_0xbb10('0x2f')](_0xc93a04['query'][_0xbb10('0x2f')]));_0x2c89b9[_0xbb10('0x30')]=_0x2c89b9[_0xbb10('0x30')][_0xbb10('0x31')]?_0x2c89b9[_0xbb10('0x30')]:_0x4e25ff[_0xbb10('0x29')];if(!_0xc93a04[_0xbb10('0x2c')]['hasOwnProperty'](_0xbb10('0x32'))){_0x2c89b9[_0xbb10('0x33')]=qs[_0xbb10('0x33')](_0xc93a04[_0xbb10('0x2c')][_0xbb10('0x33')]);_0x2c89b9[_0xbb10('0x19')]=qs[_0xbb10('0x19')](_0xc93a04[_0xbb10('0x2c')][_0xbb10('0x19')]);}_0x2c89b9['order']=qs[_0xbb10('0x34')](_0xc93a04[_0xbb10('0x2c')][_0xbb10('0x34')]);_0x2c89b9[_0xbb10('0x35')]=qs['filters'](_[_0xbb10('0x36')](_0xc93a04['query'],_0x4e25ff['filters']));if(_0x2a0e8b[_0xbb10('0x2b')]){if(_0x2a0e8b[_0xbb10('0x2d')]){_0x2a0e8b[_0xbb10('0x2d')]=moment(_0x2a0e8b[_0xbb10('0x2d')])[_0xbb10('0x37')](0x1,_0xbb10('0x38'));}else{_0x2a0e8b['dateEnd']=moment(_0x2a0e8b[_0xbb10('0x2b')])[_0xbb10('0x37')](0x1,'day');}_['merge'](_0x2c89b9['where'],{'createdAt':{'$gte':_0x2a0e8b[_0xbb10('0x2b')],'$lte':_0x2a0e8b[_0xbb10('0x2d')]}});}if(_0xc93a04[_0xbb10('0x2c')]['filter']){_0x2c89b9[_0xbb10('0x35')]=_[_0xbb10('0x39')](_0x2c89b9[_0xbb10('0x35')],{'$or':_['map'](_0x2c89b9[_0xbb10('0x30')],function(_0x12238a){var _0x1dcd38={};_0x1dcd38[_0x12238a]={'$like':'%'+_0xc93a04[_0xbb10('0x2c')]['filter']+'%'};return _0x1dcd38;})});}_0x2c89b9=_[_0xbb10('0x39')]({},_0x2c89b9,_0xc93a04[_0xbb10('0x3a')]);var _0x5835fd={'where':_0x2c89b9[_0xbb10('0x35')]};return db[_0xbb10('0x27')][_0xbb10('0x18')](_0x5835fd)[_0xbb10('0x21')](function(_0x2dd35a){_0x2fdde9[_0xbb10('0x18')]=_0x2dd35a;if(_0xc93a04['query'][_0xbb10('0x3b')]){_0x2c89b9[_0xbb10('0x3c')]=[{'all':!![]}];}return db[_0xbb10('0x27')][_0xbb10('0x3d')](_0x2c89b9);})['then'](function(_0x3fff6c){_0x2fdde9[_0xbb10('0x3e')]=_0x3fff6c;return _0x2fdde9;})[_0xbb10('0x21')](respondWithFilteredResult(_0x3c5ae7,_0x2c89b9))[_0xbb10('0x3f')](handleError(_0x3c5ae7,null));};exports['show']=function(_0x351484,_0x202c60){var _0x54ac18={'raw':![],'where':{'id':_0x351484[_0xbb10('0x40')]['id']}},_0x5d9a4f={};_0x5d9a4f['model']=_[_0xbb10('0x2a')](db[_0xbb10('0x27')]['rawAttributes']);_0x5d9a4f[_0xbb10('0x2c')]=_[_0xbb10('0x2a')](_0x351484[_0xbb10('0x2c')]);_0x5d9a4f['filters']=_[_0xbb10('0x2e')](_0x5d9a4f[_0xbb10('0x29')],_0x5d9a4f[_0xbb10('0x2c')]);_0x54ac18[_0xbb10('0x30')]=_[_0xbb10('0x2e')](_0x5d9a4f[_0xbb10('0x29')],qs[_0xbb10('0x2f')](_0x351484[_0xbb10('0x2c')][_0xbb10('0x2f')]));_0x54ac18[_0xbb10('0x30')]=_0x54ac18[_0xbb10('0x30')][_0xbb10('0x31')]?_0x54ac18['attributes']:_0x5d9a4f[_0xbb10('0x29')];if(_0x351484[_0xbb10('0x2c')]['includeAll']){_0x54ac18[_0xbb10('0x3c')]=[{'all':!![]}];}_0x54ac18=_[_0xbb10('0x39')]({},_0x54ac18,_0x351484[_0xbb10('0x3a')]);return db[_0xbb10('0x27')][_0xbb10('0x41')](_0x54ac18)[_0xbb10('0x21')](handleEntityNotFound(_0x202c60,null))[_0xbb10('0x21')](respondWithResult(_0x202c60,null))['catch'](handleError(_0x202c60,null));};exports['create']=function(_0xcb3354,_0x76a208){return db[_0xbb10('0x27')]['create'](_0xcb3354['body'],{})[_0xbb10('0x21')](respondWithResult(_0x76a208,0xc9))[_0xbb10('0x3f')](handleError(_0x76a208,null));};exports[_0xbb10('0x20')]=function(_0xf820fe,_0x10159b){if(_0xf820fe[_0xbb10('0x42')]['id']){delete _0xf820fe[_0xbb10('0x42')]['id'];}return db[_0xbb10('0x27')][_0xbb10('0x41')]({'where':{'id':_0xf820fe[_0xbb10('0x40')]['id']}})['then'](handleEntityNotFound(_0x10159b,null))['then'](saveUpdates(_0xf820fe[_0xbb10('0x42')],null))[_0xbb10('0x21')](respondWithResult(_0x10159b,null))[_0xbb10('0x3f')](handleError(_0x10159b,null));};exports[_0xbb10('0x22')]=function(_0x36aa7d,_0x440f9e){return db[_0xbb10('0x27')][_0xbb10('0x41')]({'where':{'id':_0x36aa7d[_0xbb10('0x40')]['id']}})[_0xbb10('0x21')](handleEntityNotFound(_0x440f9e,null))[_0xbb10('0x21')](removeEntity(_0x440f9e,null))[_0xbb10('0x3f')](handleError(_0x440f9e,null));};exports[_0xbb10('0x43')]=function(_0x2e6fd9,_0x1d15f4){return db['VoiceAgentReport'][_0xbb10('0x43')]()['then'](respondWithResult(_0x1d15f4,null))[_0xbb10('0x3f')](handleError(_0x1d15f4,null));};
\ No newline at end of file
+var _0x0b0e=['../../config/logger','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','save','then','destroy','sendStatus','error','name','index','VoiceAgentReport','rawAttributes','model','query','dateEnd','dateStart','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','add','day','where','merge','map','filter','options','includeAll','include','findAll','catch','params','keys','find','body','update','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','../../components/parsers/qs'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x0b0e,0x187));var _0xe0b0=function(_0x443f79,_0x33e446){_0x443f79=_0x443f79-0x0;var _0x3847e4=_0x0b0e[_0x443f79];return _0x3847e4;};'use strict';var pdf=require(_0xe0b0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe0b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0b0('0x2'));var rp=require(_0xe0b0('0x3'));var moment=require(_0xe0b0('0x4'));var BPromise=require(_0xe0b0('0x5'));var Mustache=require(_0xe0b0('0x6'));var util=require(_0xe0b0('0x7'));var path=require(_0xe0b0('0x8'));var sox=require(_0xe0b0('0x9'));var csv=require(_0xe0b0('0xa'));var ejs=require(_0xe0b0('0xb'));var fs=require('fs');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('0xa'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var qs=require(_0xe0b0('0x10'));var logger=require(_0xe0b0('0x11'))('api');var utils=require(_0xe0b0('0x12'));var config=require(_0xe0b0('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x399320,_0x2cdad2){_0x2cdad2=_0x2cdad2||0xcc;return function(_0x39b1c2){if(_0x39b1c2){return _0x399320['sendStatus'](_0x2cdad2);}return _0x399320[_0xe0b0('0x14')](_0x2cdad2)[_0xe0b0('0x15')]();};}function respondWithResult(_0x3cc19a,_0x45f914){_0x45f914=_0x45f914||0xc8;return function(_0x34fed4){if(_0x34fed4){return _0x3cc19a['status'](_0x45f914)[_0xe0b0('0x16')](_0x34fed4);}};}function respondWithFilteredResult(_0x154de6,_0x743318){return function(_0x24babd){if(_0x24babd){var _0x177c24=_0x24babd[_0xe0b0('0x17')],_0x55d884=_0x743318[_0xe0b0('0x18')],_0x41a7e2=_0x743318['offset']+_0x743318[_0xe0b0('0x19')],_0x5adb01;if(_0x41a7e2>=_0x177c24){_0x41a7e2=_0x177c24;_0x5adb01=0xc8;}else{_0x5adb01=0xce;}_0x154de6['status'](_0x5adb01);return _0x154de6[_0xe0b0('0x1a')](_0xe0b0('0x1b'),_0x55d884+'-'+_0x41a7e2+'/'+_0x177c24)['json'](_0x24babd);}return null;};}function patchUpdates(_0x54a3eb){return function(_0x46bb44){try{jsonpatch['apply'](_0x46bb44,_0x54a3eb,!![]);}catch(_0x4df8da){return BPromise['reject'](_0x4df8da);}return _0x46bb44[_0xe0b0('0x1c')]();};}function saveUpdates(_0x50fa4a,_0x52598b){return function(_0x10cde1){if(_0x10cde1){return _0x10cde1['update'](_0x50fa4a)[_0xe0b0('0x1d')](function(_0x5dba2f){return _0x5dba2f;});}return null;};}function removeEntity(_0x2c84cc,_0x1cd7c4){return function(_0x3e10b3){if(_0x3e10b3){return _0x3e10b3[_0xe0b0('0x1e')]()[_0xe0b0('0x1d')](function(){_0x2c84cc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fa820,_0x5512bb){return function(_0x12b260){if(!_0x12b260){_0x2fa820[_0xe0b0('0x1f')](0x194);}return _0x12b260;};}function handleError(_0x513e63,_0x170ad8){_0x170ad8=_0x170ad8||0x1f4;return function(_0x503883){logger[_0xe0b0('0x20')](_0x503883['stack']);if(_0x503883[_0xe0b0('0x21')]){delete _0x503883['name'];}_0x513e63[_0xe0b0('0x14')](_0x170ad8)['send'](_0x503883);};}exports[_0xe0b0('0x22')]=function(_0x4aafbe,_0x3c221d){var _0x5c5317={},_0x362aba={},_0x3c3bc2={'count':0x0,'rows':[]};var _0x1f1ebd=db[_0xe0b0('0x23')][_0xe0b0('0x24')];_0x362aba[_0xe0b0('0x25')]=_['keys'](_0x1f1ebd);var _0x1444b9={'dateStart':_0x4aafbe[_0xe0b0('0x26')]['dateStart'],'dateEnd':_0x4aafbe[_0xe0b0('0x26')][_0xe0b0('0x27')]};delete _0x4aafbe[_0xe0b0('0x26')][_0xe0b0('0x28')];delete _0x4aafbe[_0xe0b0('0x26')][_0xe0b0('0x27')];_0x362aba[_0xe0b0('0x26')]=_['keys'](_0x4aafbe[_0xe0b0('0x26')]);_0x362aba[_0xe0b0('0x29')]=_['intersection'](_0x362aba['model'],_0x362aba[_0xe0b0('0x26')]);_0x5c5317[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x362aba[_0xe0b0('0x25')],qs[_0xe0b0('0x2c')](_0x4aafbe['query'][_0xe0b0('0x2c')]));_0x5c5317[_0xe0b0('0x2a')]=_0x5c5317[_0xe0b0('0x2a')][_0xe0b0('0x2d')]?_0x5c5317[_0xe0b0('0x2a')]:_0x362aba['model'];if(!_0x4aafbe[_0xe0b0('0x26')][_0xe0b0('0x2e')](_0xe0b0('0x2f'))){_0x5c5317[_0xe0b0('0x19')]=qs[_0xe0b0('0x19')](_0x4aafbe[_0xe0b0('0x26')][_0xe0b0('0x19')]);_0x5c5317[_0xe0b0('0x18')]=qs[_0xe0b0('0x18')](_0x4aafbe[_0xe0b0('0x26')][_0xe0b0('0x18')]);}_0x5c5317[_0xe0b0('0x30')]=qs[_0xe0b0('0x31')](_0x4aafbe[_0xe0b0('0x26')][_0xe0b0('0x31')]);_0x5c5317['where']=qs[_0xe0b0('0x29')](_[_0xe0b0('0x32')](_0x4aafbe[_0xe0b0('0x26')],_0x362aba[_0xe0b0('0x29')]));if(_0x1444b9[_0xe0b0('0x28')]){if(_0x1444b9[_0xe0b0('0x27')]){_0x1444b9[_0xe0b0('0x27')]=moment(_0x1444b9['dateEnd'])['add'](0x1,'day');}else{_0x1444b9['dateEnd']=moment(_0x1444b9[_0xe0b0('0x28')])[_0xe0b0('0x33')](0x1,_0xe0b0('0x34'));}_['merge'](_0x5c5317[_0xe0b0('0x35')],{'createdAt':{'$gte':_0x1444b9[_0xe0b0('0x28')],'$lte':_0x1444b9[_0xe0b0('0x27')]}});}if(_0x4aafbe[_0xe0b0('0x26')]['filter']){_0x5c5317[_0xe0b0('0x35')]=_[_0xe0b0('0x36')](_0x5c5317[_0xe0b0('0x35')],{'$or':_[_0xe0b0('0x37')](_0x5c5317[_0xe0b0('0x2a')],function(_0x1205db){var _0x8b745={};_0x8b745[_0x1205db]={'$like':'%'+_0x4aafbe[_0xe0b0('0x26')][_0xe0b0('0x38')]+'%'};return _0x8b745;})});}_0x5c5317=_['merge']({},_0x5c5317,_0x4aafbe[_0xe0b0('0x39')]);var _0x54f646={'where':_0x5c5317[_0xe0b0('0x35')]};return db[_0xe0b0('0x23')][_0xe0b0('0x17')](_0x54f646)[_0xe0b0('0x1d')](function(_0x4d0f98){_0x3c3bc2[_0xe0b0('0x17')]=_0x4d0f98;if(_0x4aafbe[_0xe0b0('0x26')][_0xe0b0('0x3a')]){_0x5c5317[_0xe0b0('0x3b')]=[{'all':!![]}];}return db[_0xe0b0('0x23')][_0xe0b0('0x3c')](_0x5c5317);})[_0xe0b0('0x1d')](function(_0x3bde8b){_0x3c3bc2['rows']=_0x3bde8b;return _0x3c3bc2;})[_0xe0b0('0x1d')](respondWithFilteredResult(_0x3c221d,_0x5c5317))[_0xe0b0('0x3d')](handleError(_0x3c221d,null));};exports['show']=function(_0x515bd2,_0x327fb4){var _0x247f8d={'raw':![],'where':{'id':_0x515bd2[_0xe0b0('0x3e')]['id']}},_0x56e7df={};_0x56e7df[_0xe0b0('0x25')]=_[_0xe0b0('0x3f')](db[_0xe0b0('0x23')][_0xe0b0('0x24')]);_0x56e7df['query']=_['keys'](_0x515bd2['query']);_0x56e7df[_0xe0b0('0x29')]=_[_0xe0b0('0x2b')](_0x56e7df['model'],_0x56e7df[_0xe0b0('0x26')]);_0x247f8d[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x56e7df[_0xe0b0('0x25')],qs[_0xe0b0('0x2c')](_0x515bd2['query']['fields']));_0x247f8d[_0xe0b0('0x2a')]=_0x247f8d[_0xe0b0('0x2a')][_0xe0b0('0x2d')]?_0x247f8d[_0xe0b0('0x2a')]:_0x56e7df[_0xe0b0('0x25')];if(_0x515bd2['query'][_0xe0b0('0x3a')]){_0x247f8d[_0xe0b0('0x3b')]=[{'all':!![]}];}_0x247f8d=_['merge']({},_0x247f8d,_0x515bd2['options']);return db['VoiceAgentReport'][_0xe0b0('0x40')](_0x247f8d)[_0xe0b0('0x1d')](handleEntityNotFound(_0x327fb4,null))[_0xe0b0('0x1d')](respondWithResult(_0x327fb4,null))[_0xe0b0('0x3d')](handleError(_0x327fb4,null));};exports['create']=function(_0x2e2b10,_0x87d8f3){return db['VoiceAgentReport']['create'](_0x2e2b10[_0xe0b0('0x41')],{})[_0xe0b0('0x1d')](respondWithResult(_0x87d8f3,0xc9))['catch'](handleError(_0x87d8f3,null));};exports[_0xe0b0('0x42')]=function(_0x27fd31,_0x504284){if(_0x27fd31['body']['id']){delete _0x27fd31[_0xe0b0('0x41')]['id'];}return db['VoiceAgentReport'][_0xe0b0('0x40')]({'where':{'id':_0x27fd31[_0xe0b0('0x3e')]['id']}})[_0xe0b0('0x1d')](handleEntityNotFound(_0x504284,null))[_0xe0b0('0x1d')](saveUpdates(_0x27fd31[_0xe0b0('0x41')],null))[_0xe0b0('0x1d')](respondWithResult(_0x504284,null))['catch'](handleError(_0x504284,null));};exports['destroy']=function(_0x2ef908,_0x5d380a){return db['VoiceAgentReport'][_0xe0b0('0x40')]({'where':{'id':_0x2ef908[_0xe0b0('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5d380a,null))['then'](removeEntity(_0x5d380a,null))[_0xe0b0('0x3d')](handleError(_0x5d380a,null));};exports[_0xe0b0('0x43')]=function(_0x17b09f,_0x4365d1){return db[_0xe0b0('0x23')][_0xe0b0('0x43')]()[_0xe0b0('0x1d')](respondWithResult(_0x4365d1,null))['catch'](handleError(_0x4365d1,null));};
\ No newline at end of file
index bdade6a..6b7352a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e6c=['util','../../config/logger','api','moment','request-promise','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','lodash'];(function(_0x2c5c6e,_0x1d110b){var _0x4cbd5a=function(_0x2008b6){while(--_0x2008b6){_0x2c5c6e['push'](_0x2c5c6e['shift']());}};_0x4cbd5a(++_0x1d110b);}(_0x0e6c,0x6b));var _0xc0e6=function(_0x429fa4,_0x5b943f){_0x429fa4=_0x429fa4-0x0;var _0x432337=_0x0e6c[_0x429fa4];return _0x432337;};'use strict';var _=require(_0xc0e6('0x0'));var util=require(_0xc0e6('0x1'));var logger=require(_0xc0e6('0x2'))(_0xc0e6('0x3'));var moment=require(_0xc0e6('0x4'));var BPromise=require('bluebird');var rp=require(_0xc0e6('0x5'));var attributes=require(_0xc0e6('0x6'));module[_0xc0e6('0x7')]=function(_0x22f069,_0x14611a){return _0x22f069[_0xc0e6('0x8')]('VoiceAgentReport',attributes,{'tableName':_0xc0e6('0x9'),'paranoid':![],'indexes':[{'fields':[_0xc0e6('0xa'),_0xc0e6('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2d3f=['exports','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','api','moment','request-promise','./voiceAgentReport.attributes'];(function(_0x5601a8,_0x158e51){var _0x5eb4bf=function(_0xb45dcb){while(--_0xb45dcb){_0x5601a8['push'](_0x5601a8['shift']());}};_0x5eb4bf(++_0x158e51);}(_0x2d3f,0x14f));var _0xf2d3=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x2d3f[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0xf2d3('0x0'));var util=require(_0xf2d3('0x1'));var logger=require('../../config/logger')(_0xf2d3('0x2'));var moment=require(_0xf2d3('0x3'));var BPromise=require('bluebird');var rp=require(_0xf2d3('0x4'));var attributes=require(_0xf2d3('0x5'));module[_0xf2d3('0x6')]=function(_0x221c68,_0xd1c035){return _0x221c68['define'](_0xf2d3('0x7'),attributes,{'tableName':_0xf2d3('0x8'),'paranoid':![],'indexes':[{'fields':[_0xf2d3('0x9'),_0xf2d3('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index fbddb29..f6f732d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['jayson/promise','client','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','message','result','CreateVoiceAgentReport','body','raw','then','stringify','catch','UpdateVoiceAgentReport','VoiceAgentReport','options','attributes','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x7995('0x4'))['db'];var utils=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var config=require('../../config/environment');var jayson=require(_0x7995('0x8'));var client=jayson[_0x7995('0x9')][_0x7995('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x219534,_0xbda126,_0x326741){return new BPromise(function(_0x4996ca,_0x465276){return client[_0x7995('0xb')](_0x219534,_0x326741)['then'](function(_0xa2e5f0){logger[_0x7995('0xc')](_0x7995('0xd'),_0xbda126,_0x7995('0xe'));logger[_0x7995('0xf')](_0x7995('0x10'),_0xbda126,_0x7995('0xe'),JSON['stringify'](_0xa2e5f0));if(_0xa2e5f0[_0x7995('0x11')]){if(_0xa2e5f0[_0x7995('0x11')]['code']===0x1f4){logger[_0x7995('0x11')](_0x7995('0xd'),_0xbda126,_0xa2e5f0[_0x7995('0x11')][_0x7995('0x12')]);return _0x465276(_0xa2e5f0[_0x7995('0x11')][_0x7995('0x12')]);}logger[_0x7995('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0xbda126,_0xa2e5f0['error'][_0x7995('0x12')]);return _0x4996ca(_0xa2e5f0[_0x7995('0x11')][_0x7995('0x12')]);}else{logger[_0x7995('0xc')](_0x7995('0xd'),_0xbda126,_0x7995('0xe'));_0x4996ca(_0xa2e5f0[_0x7995('0x13')][_0x7995('0x12')]);}})['catch'](function(_0x2eeacc){logger['error'](_0x7995('0xd'),_0xbda126,_0x2eeacc);_0x465276(_0x2eeacc);});});}exports[_0x7995('0x14')]=function(_0x43d4b8){var _0x291317=this;return new Promise(function(_0x1e1415,_0x37a7d4){return db['VoiceAgentReport']['create'](_0x43d4b8[_0x7995('0x15')],{'raw':_0x43d4b8['options']?_0x43d4b8['options'][_0x7995('0x16')]===undefined?!![]:![]:!![]})[_0x7995('0x17')](function(_0x4cbe10){logger[_0x7995('0xc')]('CreateVoiceAgentReport',_0x43d4b8);logger['debug'](_0x7995('0x14'),_0x43d4b8,JSON[_0x7995('0x18')](_0x4cbe10));_0x1e1415(_0x4cbe10);})[_0x7995('0x19')](function(_0x1a8568){logger[_0x7995('0x11')](_0x7995('0x14'),_0x1a8568['message'],_0x43d4b8);_0x37a7d4(_0x291317[_0x7995('0x11')](0x1f4,_0x1a8568[_0x7995('0x12')]));});});};exports[_0x7995('0x1a')]=function(_0x285437){var _0x563799=this;return new Promise(function(_0x13bc35,_0x475351){return db[_0x7995('0x1b')]['update'](_0x285437[_0x7995('0x15')],{'raw':_0x285437[_0x7995('0x1c')]?_0x285437[_0x7995('0x1c')][_0x7995('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x285437[_0x7995('0x1c')]?_0x285437[_0x7995('0x1c')]['where']||null:null,'attributes':_0x285437[_0x7995('0x1c')]?_0x285437['options'][_0x7995('0x1d')]||null:null,'limit':_0x285437[_0x7995('0x1c')]?_0x285437[_0x7995('0x1c')][_0x7995('0x1e')]||null:null})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0xc')]('UpdateVoiceAgentReport',_0x285437);logger[_0x7995('0xf')](_0x7995('0x1a'),_0x285437,JSON[_0x7995('0x18')](_0x4b6f99));_0x13bc35(_0x4b6f99);})['catch'](function(_0x530611){logger['error'](_0x7995('0x1a'),_0x530611[_0x7995('0x12')],_0x285437);_0x475351(_0x563799[_0x7995('0x11')](0x1f4,_0x530611[_0x7995('0x12')]));});});};
\ No newline at end of file
+var _0x7a54=['moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','then','stringify','UpdateVoiceAgentReport','update','attributes','limit','debug','lodash','util'];(function(_0x18b0b9,_0x4edde9){var _0x1d1de3=function(_0x2e1249){while(--_0x2e1249){_0x18b0b9['push'](_0x18b0b9['shift']());}};_0x1d1de3(++_0x4edde9);}(_0x7a54,0x106));var _0x47a5=function(_0x541d89,_0x5caada){_0x541d89=_0x541d89-0x0;var _0x264671=_0x7a54[_0x541d89];return _0x264671;};'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 db=require(_0x47a5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var jayson=require(_0x47a5('0x8'));var client=jayson[_0x47a5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d5629,_0x59199c,_0x343372){return new BPromise(function(_0x30e405,_0x506eda){return client[_0x47a5('0xa')](_0x3d5629,_0x343372)['then'](function(_0x5d90b3){logger['info'](_0x47a5('0xb'),_0x59199c,_0x47a5('0xc'));logger['debug'](_0x47a5('0xd'),_0x59199c,'request\x20sent',JSON['stringify'](_0x5d90b3));if(_0x5d90b3[_0x47a5('0xe')]){if(_0x5d90b3[_0x47a5('0xe')][_0x47a5('0xf')]===0x1f4){logger[_0x47a5('0xe')](_0x47a5('0xb'),_0x59199c,_0x5d90b3[_0x47a5('0xe')][_0x47a5('0x10')]);return _0x506eda(_0x5d90b3['error'][_0x47a5('0x10')]);}logger[_0x47a5('0xe')](_0x47a5('0xb'),_0x59199c,_0x5d90b3[_0x47a5('0xe')][_0x47a5('0x10')]);return _0x30e405(_0x5d90b3[_0x47a5('0xe')][_0x47a5('0x10')]);}else{logger[_0x47a5('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x59199c,_0x47a5('0xc'));_0x30e405(_0x5d90b3[_0x47a5('0x12')][_0x47a5('0x10')]);}})[_0x47a5('0x13')](function(_0x1ef44c){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x59199c,_0x1ef44c);_0x506eda(_0x1ef44c);});});}exports[_0x47a5('0x14')]=function(_0x4b966e){var _0x5247fd=this;return new Promise(function(_0x423a81,_0xaf70a6){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x4b966e[_0x47a5('0x17')],{'raw':_0x4b966e[_0x47a5('0x18')]?_0x4b966e[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})[_0x47a5('0x1a')](function(_0x4a9fcb){logger[_0x47a5('0x11')](_0x47a5('0x14'),_0x4b966e);logger['debug'](_0x47a5('0x14'),_0x4b966e,JSON[_0x47a5('0x1b')](_0x4a9fcb));_0x423a81(_0x4a9fcb);})[_0x47a5('0x13')](function(_0x4c5910){logger[_0x47a5('0xe')](_0x47a5('0x14'),_0x4c5910[_0x47a5('0x10')],_0x4b966e);_0xaf70a6(_0x5247fd[_0x47a5('0xe')](0x1f4,_0x4c5910['message']));});});};exports[_0x47a5('0x1c')]=function(_0x385687){var _0x513981=this;return new Promise(function(_0x28747d,_0xc4cd63){return db[_0x47a5('0x15')][_0x47a5('0x1d')](_0x385687[_0x47a5('0x17')],{'raw':_0x385687['options']?_0x385687['options'][_0x47a5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x385687['options']?_0x385687[_0x47a5('0x18')]['where']||null:null,'attributes':_0x385687[_0x47a5('0x18')]?_0x385687[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x385687[_0x47a5('0x18')]?_0x385687[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x1a')](function(_0x136b14){logger[_0x47a5('0x11')](_0x47a5('0x1c'),_0x385687);logger[_0x47a5('0x20')](_0x47a5('0x1c'),_0x385687,JSON[_0x47a5('0x1b')](_0x136b14));_0x28747d(_0x136b14);})['catch'](function(_0x243210){logger['error'](_0x47a5('0x1c'),_0x243210[_0x47a5('0x10')],_0x385687);_0xc4cd63(_0x513981[_0x47a5('0xe')](0x1f4,_0x243210['message']));});});};
\ No newline at end of file
index f3b0261..d69e916 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0a4=['get','isAuthenticated','/describe','describe','/:id','show','update','destroy','exports','multer','express','Router','../../components/auth/service','../../config/environment','./voiceCallReport.controller'];(function(_0x6d8f72,_0x10a198){var _0xb8d804=function(_0x28108c){while(--_0x28108c){_0x6d8f72['push'](_0x6d8f72['shift']());}};_0xb8d804(++_0x10a198);}(_0xf0a4,0x18f));var _0x4f0a=function(_0xd06da1,_0x3deec1){_0xd06da1=_0xd06da1-0x0;var _0x5c7c63=_0xf0a4[_0xd06da1];return _0x5c7c63;};'use strict';var multer=require(_0x4f0a('0x0'));var util=require('util');var path=require('path');var express=require(_0x4f0a('0x1'));var router=express[_0x4f0a('0x2')]();var auth=require(_0x4f0a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4f0a('0x4'));var controller=require(_0x4f0a('0x5'));router[_0x4f0a('0x6')]('/',auth[_0x4f0a('0x7')](),controller['index']);router[_0x4f0a('0x6')](_0x4f0a('0x8'),auth[_0x4f0a('0x7')](),controller[_0x4f0a('0x9')]);router['get'](_0x4f0a('0xa'),auth[_0x4f0a('0x7')](),controller[_0x4f0a('0xb')]);router['post']('/',auth[_0x4f0a('0x7')](),controller['create']);router['put'](_0x4f0a('0xa'),auth[_0x4f0a('0x7')](),controller[_0x4f0a('0xc')]);router['delete'](_0x4f0a('0xa'),auth[_0x4f0a('0x7')](),controller[_0x4f0a('0xd')]);module[_0x4f0a('0xe')]=router;
\ No newline at end of file
+var _0xfd97=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','path','express'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xfd97,0x12f));var _0x7fd9=function(_0x105608,_0x567eea){_0x105608=_0x105608-0x0;var _0x4938a2=_0xfd97[_0x105608];return _0x4938a2;};'use strict';var multer=require(_0x7fd9('0x0'));var util=require('util');var path=require(_0x7fd9('0x1'));var express=require(_0x7fd9('0x2'));var router=express[_0x7fd9('0x3')]();var auth=require(_0x7fd9('0x4'));var interaction=require(_0x7fd9('0x5'));var config=require(_0x7fd9('0x6'));var controller=require('./voiceCallReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7fd9('0x7')](_0x7fd9('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x7fd9('0x7')]('/:id',auth[_0x7fd9('0x9')](),controller[_0x7fd9('0xa')]);router[_0x7fd9('0xb')]('/',auth[_0x7fd9('0x9')](),controller[_0x7fd9('0xc')]);router['put']('/:id',auth[_0x7fd9('0x9')](),controller[_0x7fd9('0xd')]);router[_0x7fd9('0xe')]('/:id',auth[_0x7fd9('0x9')](),controller[_0x7fd9('0xf')]);module[_0x7fd9('0x10')]=router;
\ No newline at end of file
index ced63e3..6454ccc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2159=['outbound','inbound-fax','outbound-fax','dialer','STRING','TEXT','DATE','INTEGER','sequelize','exports','ENUM','inbound','internal'];(function(_0x47f532,_0x3c3b6f){var _0x467674=function(_0x4ff708){while(--_0x4ff708){_0x47f532['push'](_0x47f532['shift']());}};_0x467674(++_0x3c3b6f);}(_0x2159,0xff));var _0x9215=function(_0x53effc,_0x2a6268){_0x53effc=_0x53effc-0x0;var _0x3b0a06=_0x2159[_0x53effc];return _0x3b0a06;};'use strict';var Sequelize=require(_0x9215('0x0'));module[_0x9215('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9215('0x2')](_0x9215('0x3'),_0x9215('0x4'),_0x9215('0x5'),_0x9215('0x6'),_0x9215('0x7'),_0x9215('0x8'))},'tag':{'type':Sequelize[_0x9215('0x9')]},'accountcode':{'type':Sequelize[_0x9215('0x9')]},'source':{'type':Sequelize[_0x9215('0x9')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x9215('0x9')]},'channel':{'type':Sequelize[_0x9215('0x9')]},'destinationchannel':{'type':Sequelize[_0x9215('0x9')]},'lastapplication':{'type':Sequelize[_0x9215('0x9')]},'lastdata':{'type':Sequelize[_0x9215('0xa')]},'starttime':{'type':Sequelize[_0x9215('0xb')]},'answertime':{'type':Sequelize[_0x9215('0xb')]},'endtime':{'type':Sequelize[_0x9215('0xb')]},'duration':{'type':Sequelize[_0x9215('0xc')]},'billableseconds':{'type':Sequelize[_0x9215('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x9215('0x9')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x9215('0x9')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9215('0x9')]},'prefix':{'type':Sequelize[_0x9215('0x9')]},'routeid':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x73c1=['outbound-fax','TEXT','DATE','INTEGER','exports','STRING','inbound','internal','outbound','inbound-fax'];(function(_0x34aa1b,_0x477610){var _0x4cff5f=function(_0x5bdd0b){while(--_0x5bdd0b){_0x34aa1b['push'](_0x34aa1b['shift']());}};_0x4cff5f(++_0x477610);}(_0x73c1,0x13a));var _0x173c=function(_0x51c78a,_0x590bf2){_0x51c78a=_0x51c78a-0x0;var _0x9b3603=_0x73c1[_0x51c78a];return _0x9b3603;};'use strict';var Sequelize=require('sequelize');module[_0x173c('0x0')]={'uniqueid':{'type':Sequelize[_0x173c('0x1')]},'type':{'type':Sequelize['ENUM'](_0x173c('0x2'),_0x173c('0x3'),_0x173c('0x4'),_0x173c('0x5'),_0x173c('0x6'),'dialer')},'tag':{'type':Sequelize[_0x173c('0x1')]},'accountcode':{'type':Sequelize[_0x173c('0x1')]},'source':{'type':Sequelize[_0x173c('0x1')]},'destination':{'type':Sequelize[_0x173c('0x1')]},'destinationcontext':{'type':Sequelize[_0x173c('0x1')]},'callerid':{'type':Sequelize[_0x173c('0x1')]},'channel':{'type':Sequelize[_0x173c('0x1')]},'destinationchannel':{'type':Sequelize[_0x173c('0x1')]},'lastapplication':{'type':Sequelize[_0x173c('0x1')]},'lastdata':{'type':Sequelize[_0x173c('0x7')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x173c('0x8')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x173c('0x9')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x173c('0x1')]},'amaflags':{'type':Sequelize[_0x173c('0x1')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x173c('0x1')]},'note':{'type':Sequelize[_0x173c('0x1')]},'prefix':{'type':Sequelize[_0x173c('0x1')]},'routeid':{'type':Sequelize[_0x173c('0x9')]}};
\ No newline at end of file
index 0489d13..a6268f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf5c=['model','keys','query','dateStart','dateEnd','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','add','day','merge','map','count','User','findAll','rows','catch','show','length','includeAll','include','options','create','find','describe','body','uniqueid','params','user','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','VoiceCallReport','rawAttributes'];(function(_0x8cc46c,_0x26940f){var _0x48656c=function(_0x1484b3){while(--_0x1484b3){_0x8cc46c['push'](_0x8cc46c['shift']());}};_0x48656c(++_0x26940f);}(_0xbf5c,0xb8));var _0xcbf5=function(_0x43c631,_0x21cf39){_0x43c631=_0x43c631-0x0;var _0x558621=_0xbf5c[_0x43c631];return _0x558621;};'use strict';var pdf=require(_0xcbf5('0x0'));var emlformat=require(_0xcbf5('0x1'));var rimraf=require(_0xcbf5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcbf5('0x3'));var rp=require(_0xcbf5('0x4'));var moment=require(_0xcbf5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcbf5('0x6'));var util=require(_0xcbf5('0x7'));var path=require('path');var sox=require(_0xcbf5('0x8'));var csv=require(_0xcbf5('0x9'));var ejs=require(_0xcbf5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcbf5('0xb'));var crypto=require(_0xcbf5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcbf5('0x9'));var querystring=require(_0xcbf5('0xd'));var Papa=require(_0xcbf5('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0xcbf5('0xf'))(_0xcbf5('0x10'));var utils=require(_0xcbf5('0x11'));var config=require(_0xcbf5('0x12'));var db=require(_0xcbf5('0x13'))['db'];function respondWithStatusCode(_0x248575,_0x5db829){_0x5db829=_0x5db829||0xcc;return function(_0x22f7fa){if(_0x22f7fa){return _0x248575[_0xcbf5('0x14')](_0x5db829);}return _0x248575[_0xcbf5('0x15')](_0x5db829)['end']();};}function respondWithResult(_0x5e5307,_0x18c2fe){_0x18c2fe=_0x18c2fe||0xc8;return function(_0x528e7c){if(_0x528e7c){return _0x5e5307[_0xcbf5('0x15')](_0x18c2fe)[_0xcbf5('0x16')](_0x528e7c);}};}function respondWithFilteredResult(_0x5cbcf6,_0x2e7536){return function(_0x51b1d2){if(_0x51b1d2){var _0x48ad3c=_0x51b1d2['count'],_0x40cd24=_0x2e7536['offset'],_0x550e21=_0x2e7536[_0xcbf5('0x17')]+_0x2e7536[_0xcbf5('0x18')],_0x2c58ba;if(_0x550e21>=_0x48ad3c){_0x550e21=_0x48ad3c;_0x2c58ba=0xc8;}else{_0x2c58ba=0xce;}_0x5cbcf6[_0xcbf5('0x15')](_0x2c58ba);return _0x5cbcf6[_0xcbf5('0x19')](_0xcbf5('0x1a'),_0x40cd24+'-'+_0x550e21+'/'+_0x48ad3c)[_0xcbf5('0x16')](_0x51b1d2);}return null;};}function patchUpdates(_0x462d46){return function(_0x53939d){try{jsonpatch[_0xcbf5('0x1b')](_0x53939d,_0x462d46,!![]);}catch(_0x10d573){return BPromise[_0xcbf5('0x1c')](_0x10d573);}return _0x53939d[_0xcbf5('0x1d')]();};}function saveUpdates(_0x269b01,_0x3b3022){return function(_0x3b9f05){if(_0x3b9f05){return _0x3b9f05[_0xcbf5('0x1e')](_0x269b01)['then'](function(_0x155147){return _0x155147;});}return null;};}function removeEntity(_0x4e8874,_0x297b86){return function(_0x4c7b1e){if(_0x4c7b1e){return _0x4c7b1e[_0xcbf5('0x1f')]()[_0xcbf5('0x20')](function(){_0x4e8874[_0xcbf5('0x15')](0xcc)[_0xcbf5('0x21')]();});}};}function handleEntityNotFound(_0x3e9548,_0x278f30){return function(_0x583240){if(!_0x583240){_0x3e9548[_0xcbf5('0x14')](0x194);}return _0x583240;};}function handleError(_0x5602fd,_0x965482){_0x965482=_0x965482||0x1f4;return function(_0x1b59d4){logger[_0xcbf5('0x22')](_0x1b59d4[_0xcbf5('0x23')]);if(_0x1b59d4['name']){delete _0x1b59d4[_0xcbf5('0x24')];}_0x5602fd[_0xcbf5('0x15')](_0x965482)[_0xcbf5('0x25')](_0x1b59d4);};}exports[_0xcbf5('0x26')]=function(_0x1a2635,_0x27557f){var _0x149b61={},_0xe6742={},_0x5e2f8e={'count':0x0,'rows':[]};var _0x22d56a=db[_0xcbf5('0x27')][_0xcbf5('0x28')];_0xe6742[_0xcbf5('0x29')]=_[_0xcbf5('0x2a')](_0x22d56a);var _0x57e453={'dateStart':_0x1a2635[_0xcbf5('0x2b')][_0xcbf5('0x2c')],'dateEnd':_0x1a2635[_0xcbf5('0x2b')][_0xcbf5('0x2d')]};delete _0x1a2635[_0xcbf5('0x2b')][_0xcbf5('0x2c')];delete _0x1a2635['query'][_0xcbf5('0x2d')];_0xe6742[_0xcbf5('0x2b')]=_[_0xcbf5('0x2a')](_0x1a2635[_0xcbf5('0x2b')]);_0xe6742[_0xcbf5('0x2e')]=_[_0xcbf5('0x2f')](_0xe6742[_0xcbf5('0x29')],_0xe6742['query']);_0x149b61['attributes']=_[_0xcbf5('0x2f')](_0xe6742['model'],qs[_0xcbf5('0x30')](_0x1a2635[_0xcbf5('0x2b')][_0xcbf5('0x30')]));_0x149b61[_0xcbf5('0x31')]=_0x149b61[_0xcbf5('0x31')]['length']?_0x149b61['attributes']:_0xe6742[_0xcbf5('0x29')];if(!_0x1a2635[_0xcbf5('0x2b')][_0xcbf5('0x32')](_0xcbf5('0x33'))){_0x149b61[_0xcbf5('0x18')]=qs[_0xcbf5('0x18')](_0x1a2635[_0xcbf5('0x2b')]['limit']);_0x149b61[_0xcbf5('0x17')]=qs[_0xcbf5('0x17')](_0x1a2635[_0xcbf5('0x2b')][_0xcbf5('0x17')]);}_0x149b61['order']=qs[_0xcbf5('0x34')](_0x1a2635[_0xcbf5('0x2b')]['sort']);_0x149b61[_0xcbf5('0x35')]=qs[_0xcbf5('0x2e')](_['pick'](_0x1a2635['query'],_0xe6742[_0xcbf5('0x2e')]));if(_0x57e453[_0xcbf5('0x2c')]){if(_0x57e453[_0xcbf5('0x2d')]){_0x57e453[_0xcbf5('0x2d')]=moment(_0x57e453['dateEnd'])[_0xcbf5('0x36')](0x1,_0xcbf5('0x37'));}else{_0x57e453[_0xcbf5('0x2d')]=moment(_0x57e453[_0xcbf5('0x2c')])['add'](0x1,_0xcbf5('0x37'));}_[_0xcbf5('0x38')](_0x149b61['where'],{'createdAt':{'$gte':_0x57e453['dateStart'],'$lte':_0x57e453[_0xcbf5('0x2d')]}});}if(_0x1a2635[_0xcbf5('0x2b')]['filter']){_0x149b61[_0xcbf5('0x35')]=_[_0xcbf5('0x38')](_0x149b61[_0xcbf5('0x35')],{'$or':_[_0xcbf5('0x39')](_0x149b61[_0xcbf5('0x31')],function(_0x50c390){var _0x33959b={};_0x33959b[_0x50c390]={'$like':'%'+_0x1a2635[_0xcbf5('0x2b')]['filter']+'%'};return _0x33959b;})});}_0x149b61=_[_0xcbf5('0x38')]({},_0x149b61,_0x1a2635['options']);var _0x33b494={'where':_0x149b61['where']};return db[_0xcbf5('0x27')][_0xcbf5('0x3a')](_0x33b494)[_0xcbf5('0x20')](function(_0x50ac98){_0x5e2f8e[_0xcbf5('0x3a')]=_0x50ac98;if(_0x1a2635['query']['includeAll']){_0x149b61['include']=[{'attributes':['id',_0xcbf5('0x24'),'fullname','alias'],'model':db[_0xcbf5('0x3b')],'as':_0xcbf5('0x3b')}];}return db['VoiceCallReport'][_0xcbf5('0x3c')](_0x149b61);})['then'](function(_0x3c1fb9){_0x5e2f8e[_0xcbf5('0x3d')]=_0x3c1fb9;return _0x5e2f8e;})[_0xcbf5('0x20')](respondWithFilteredResult(_0x27557f,_0x149b61))[_0xcbf5('0x3e')](handleError(_0x27557f,null));};exports[_0xcbf5('0x3f')]=function(_0x3d71b9,_0x166202){var _0x54d555={'raw':!![],'where':{'id':_0x3d71b9['params']['id']}},_0x4c1950={};_0x4c1950[_0xcbf5('0x29')]=_['keys'](db[_0xcbf5('0x27')][_0xcbf5('0x28')]);_0x4c1950[_0xcbf5('0x2b')]=_[_0xcbf5('0x2a')](_0x3d71b9[_0xcbf5('0x2b')]);_0x4c1950[_0xcbf5('0x2e')]=_[_0xcbf5('0x2f')](_0x4c1950[_0xcbf5('0x29')],_0x4c1950[_0xcbf5('0x2b')]);_0x54d555[_0xcbf5('0x31')]=_[_0xcbf5('0x2f')](_0x4c1950[_0xcbf5('0x29')],qs[_0xcbf5('0x30')](_0x3d71b9[_0xcbf5('0x2b')]['fields']));_0x54d555[_0xcbf5('0x31')]=_0x54d555['attributes'][_0xcbf5('0x40')]?_0x54d555[_0xcbf5('0x31')]:_0x4c1950[_0xcbf5('0x29')];if(_0x3d71b9[_0xcbf5('0x2b')][_0xcbf5('0x41')]){_0x54d555[_0xcbf5('0x42')]=[{'all':!![]}];}_0x54d555=_[_0xcbf5('0x38')]({},_0x54d555,_0x3d71b9[_0xcbf5('0x43')]);return db['VoiceCallReport']['find'](_0x54d555)[_0xcbf5('0x20')](handleEntityNotFound(_0x166202,null))['then'](respondWithResult(_0x166202,null))['catch'](handleError(_0x166202,null));};exports[_0xcbf5('0x44')]=function(_0xddb159,_0x372c5d){return db['VoiceCallReport'][_0xcbf5('0x44')](_0xddb159['body'],{})[_0xcbf5('0x20')](respondWithResult(_0x372c5d,0xc9))['catch'](handleError(_0x372c5d,null));};exports[_0xcbf5('0x1f')]=function(_0x11fd0d,_0x3e1fea){return db[_0xcbf5('0x27')][_0xcbf5('0x45')]({'where':{'id':_0x11fd0d['params']['id']}})[_0xcbf5('0x20')](handleEntityNotFound(_0x3e1fea,null))[_0xcbf5('0x20')](removeEntity(_0x3e1fea,null))[_0xcbf5('0x3e')](handleError(_0x3e1fea,null));};exports[_0xcbf5('0x46')]=function(_0x547357,_0x417034){return db['VoiceCallReport']['describe']()['then'](respondWithResult(_0x417034,null))['catch'](handleError(_0x417034,null));};exports[_0xcbf5('0x1e')]=function(_0x5ee439,_0x1d07e2){if(_0x5ee439[_0xcbf5('0x47')]['uniqueid']){delete _0x5ee439[_0xcbf5('0x47')][_0xcbf5('0x48')];}return db['VoiceCallReport'][_0xcbf5('0x45')]({'where':{'uniqueid':_0x5ee439[_0xcbf5('0x49')]['id'],'UserId':{'$or':[null,_0x5ee439[_0xcbf5('0x4a')]['id']]}}})['then'](handleEntityNotFound(_0x1d07e2,null))[_0xcbf5('0x20')](saveUpdates(_0x5ee439[_0xcbf5('0x47')],null))[_0xcbf5('0x20')](respondWithResult(_0x1d07e2,null))['catch'](handleError(_0x1d07e2,null));};
\ No newline at end of file
+var _0x2697=['create','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','api','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','destroy','end','error','name','send','index','VoiceCallReport','model','keys','query','dateEnd','dateStart','filters','fields','attributes','nolimit','limit','sort','where','pick','add','day','merge','filter','map','options','then','includeAll','include','fullname','alias','User','rows','params','intersection','find','catch'];(function(_0x4949b8,_0x440388){var _0x3dc8e5=function(_0x1fdb8c){while(--_0x1fdb8c){_0x4949b8['push'](_0x4949b8['shift']());}};_0x3dc8e5(++_0x440388);}(_0x2697,0x120));var _0x7269=function(_0x5528c3,_0x35a416){_0x5528c3=_0x5528c3-0x0;var _0x47ec1b=_0x2697[_0x5528c3];return _0x47ec1b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7269('0x0'));var rimraf=require(_0x7269('0x1'));var zipdir=require(_0x7269('0x2'));var jsonpatch=require(_0x7269('0x3'));var rp=require(_0x7269('0x4'));var moment=require('moment');var BPromise=require(_0x7269('0x5'));var Mustache=require('mustache');var util=require(_0x7269('0x6'));var path=require(_0x7269('0x7'));var sox=require(_0x7269('0x8'));var csv=require(_0x7269('0x9'));var ejs=require(_0x7269('0xa'));var fs=require('fs');var _=require(_0x7269('0xb'));var squel=require(_0x7269('0xc'));var crypto=require(_0x7269('0xd'));var jsforce=require(_0x7269('0xe'));var deskjs=require(_0x7269('0xf'));var toCsv=require(_0x7269('0x9'));var querystring=require('querystring');var Papa=require(_0x7269('0x10'));var qs=require(_0x7269('0x11'));var logger=require('../../config/logger')(_0x7269('0x12'));var utils=require('../../config/utils');var config=require(_0x7269('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44b976,_0x4c18f7){_0x4c18f7=_0x4c18f7||0xcc;return function(_0x255fcb){if(_0x255fcb){return _0x44b976[_0x7269('0x14')](_0x4c18f7);}return _0x44b976[_0x7269('0x15')](_0x4c18f7)['end']();};}function respondWithResult(_0x29a0ca,_0x2c5957){_0x2c5957=_0x2c5957||0xc8;return function(_0x5dbe57){if(_0x5dbe57){return _0x29a0ca[_0x7269('0x15')](_0x2c5957)[_0x7269('0x16')](_0x5dbe57);}};}function respondWithFilteredResult(_0x43c239,_0x4a0355){return function(_0x2ba8ec){if(_0x2ba8ec){var _0x4eeb9b=_0x2ba8ec[_0x7269('0x17')],_0x2d78a0=_0x4a0355[_0x7269('0x18')],_0x2c28f8=_0x4a0355[_0x7269('0x18')]+_0x4a0355['limit'],_0x26547f;if(_0x2c28f8>=_0x4eeb9b){_0x2c28f8=_0x4eeb9b;_0x26547f=0xc8;}else{_0x26547f=0xce;}_0x43c239[_0x7269('0x15')](_0x26547f);return _0x43c239[_0x7269('0x19')](_0x7269('0x1a'),_0x2d78a0+'-'+_0x2c28f8+'/'+_0x4eeb9b)[_0x7269('0x16')](_0x2ba8ec);}return null;};}function patchUpdates(_0x5812c4){return function(_0x5589b7){try{jsonpatch['apply'](_0x5589b7,_0x5812c4,!![]);}catch(_0x244e6e){return BPromise[_0x7269('0x1b')](_0x244e6e);}return _0x5589b7[_0x7269('0x1c')]();};}function saveUpdates(_0x466750,_0x133ddc){return function(_0x20bda7){if(_0x20bda7){return _0x20bda7[_0x7269('0x1d')](_0x466750)['then'](function(_0x4f0d05){return _0x4f0d05;});}return null;};}function removeEntity(_0x534f81,_0x367ad1){return function(_0x5cca84){if(_0x5cca84){return _0x5cca84[_0x7269('0x1e')]()['then'](function(){_0x534f81[_0x7269('0x15')](0xcc)[_0x7269('0x1f')]();});}};}function handleEntityNotFound(_0x55e40d,_0x149c19){return function(_0xef0a5e){if(!_0xef0a5e){_0x55e40d['sendStatus'](0x194);}return _0xef0a5e;};}function handleError(_0x509e9,_0x293af6){_0x293af6=_0x293af6||0x1f4;return function(_0xbb82d0){logger[_0x7269('0x20')](_0xbb82d0['stack']);if(_0xbb82d0[_0x7269('0x21')]){delete _0xbb82d0[_0x7269('0x21')];}_0x509e9[_0x7269('0x15')](_0x293af6)[_0x7269('0x22')](_0xbb82d0);};}exports[_0x7269('0x23')]=function(_0x3d72c9,_0x4c6810){var _0x198b59={},_0x3afb72={},_0x339414={'count':0x0,'rows':[]};var _0x1321f3=db[_0x7269('0x24')]['rawAttributes'];_0x3afb72[_0x7269('0x25')]=_[_0x7269('0x26')](_0x1321f3);var _0x4d7e72={'dateStart':_0x3d72c9[_0x7269('0x27')]['dateStart'],'dateEnd':_0x3d72c9[_0x7269('0x27')][_0x7269('0x28')]};delete _0x3d72c9[_0x7269('0x27')][_0x7269('0x29')];delete _0x3d72c9[_0x7269('0x27')]['dateEnd'];_0x3afb72[_0x7269('0x27')]=_[_0x7269('0x26')](_0x3d72c9[_0x7269('0x27')]);_0x3afb72[_0x7269('0x2a')]=_['intersection'](_0x3afb72[_0x7269('0x25')],_0x3afb72[_0x7269('0x27')]);_0x198b59['attributes']=_['intersection'](_0x3afb72[_0x7269('0x25')],qs[_0x7269('0x2b')](_0x3d72c9[_0x7269('0x27')][_0x7269('0x2b')]));_0x198b59[_0x7269('0x2c')]=_0x198b59[_0x7269('0x2c')]['length']?_0x198b59['attributes']:_0x3afb72[_0x7269('0x25')];if(!_0x3d72c9[_0x7269('0x27')]['hasOwnProperty'](_0x7269('0x2d'))){_0x198b59['limit']=qs[_0x7269('0x2e')](_0x3d72c9[_0x7269('0x27')][_0x7269('0x2e')]);_0x198b59[_0x7269('0x18')]=qs[_0x7269('0x18')](_0x3d72c9[_0x7269('0x27')][_0x7269('0x18')]);}_0x198b59['order']=qs[_0x7269('0x2f')](_0x3d72c9[_0x7269('0x27')]['sort']);_0x198b59[_0x7269('0x30')]=qs[_0x7269('0x2a')](_[_0x7269('0x31')](_0x3d72c9['query'],_0x3afb72[_0x7269('0x2a')]));if(_0x4d7e72[_0x7269('0x29')]){if(_0x4d7e72[_0x7269('0x28')]){_0x4d7e72[_0x7269('0x28')]=moment(_0x4d7e72['dateEnd'])[_0x7269('0x32')](0x1,_0x7269('0x33'));}else{_0x4d7e72[_0x7269('0x28')]=moment(_0x4d7e72[_0x7269('0x29')])[_0x7269('0x32')](0x1,'day');}_[_0x7269('0x34')](_0x198b59[_0x7269('0x30')],{'createdAt':{'$gte':_0x4d7e72[_0x7269('0x29')],'$lte':_0x4d7e72['dateEnd']}});}if(_0x3d72c9['query'][_0x7269('0x35')]){_0x198b59['where']=_[_0x7269('0x34')](_0x198b59['where'],{'$or':_[_0x7269('0x36')](_0x198b59[_0x7269('0x2c')],function(_0x5dd619){var _0x5ad478={};_0x5ad478[_0x5dd619]={'$like':'%'+_0x3d72c9[_0x7269('0x27')][_0x7269('0x35')]+'%'};return _0x5ad478;})});}_0x198b59=_[_0x7269('0x34')]({},_0x198b59,_0x3d72c9[_0x7269('0x37')]);var _0x16e1c9={'where':_0x198b59[_0x7269('0x30')]};return db[_0x7269('0x24')][_0x7269('0x17')](_0x16e1c9)[_0x7269('0x38')](function(_0x3873f3){_0x339414[_0x7269('0x17')]=_0x3873f3;if(_0x3d72c9['query'][_0x7269('0x39')]){_0x198b59[_0x7269('0x3a')]=[{'attributes':['id',_0x7269('0x21'),_0x7269('0x3b'),_0x7269('0x3c')],'model':db[_0x7269('0x3d')],'as':_0x7269('0x3d')}];}return db[_0x7269('0x24')]['findAll'](_0x198b59);})['then'](function(_0x2543cb){_0x339414[_0x7269('0x3e')]=_0x2543cb;return _0x339414;})['then'](respondWithFilteredResult(_0x4c6810,_0x198b59))['catch'](handleError(_0x4c6810,null));};exports['show']=function(_0x451725,_0x31b085){var _0x53c236={'raw':!![],'where':{'id':_0x451725[_0x7269('0x3f')]['id']}},_0x3ae2af={};_0x3ae2af[_0x7269('0x25')]=_[_0x7269('0x26')](db[_0x7269('0x24')]['rawAttributes']);_0x3ae2af['query']=_[_0x7269('0x26')](_0x451725[_0x7269('0x27')]);_0x3ae2af[_0x7269('0x2a')]=_[_0x7269('0x40')](_0x3ae2af[_0x7269('0x25')],_0x3ae2af['query']);_0x53c236[_0x7269('0x2c')]=_[_0x7269('0x40')](_0x3ae2af['model'],qs['fields'](_0x451725['query'][_0x7269('0x2b')]));_0x53c236[_0x7269('0x2c')]=_0x53c236[_0x7269('0x2c')]['length']?_0x53c236[_0x7269('0x2c')]:_0x3ae2af[_0x7269('0x25')];if(_0x451725[_0x7269('0x27')][_0x7269('0x39')]){_0x53c236['include']=[{'all':!![]}];}_0x53c236=_[_0x7269('0x34')]({},_0x53c236,_0x451725[_0x7269('0x37')]);return db[_0x7269('0x24')][_0x7269('0x41')](_0x53c236)[_0x7269('0x38')](handleEntityNotFound(_0x31b085,null))[_0x7269('0x38')](respondWithResult(_0x31b085,null))[_0x7269('0x42')](handleError(_0x31b085,null));};exports[_0x7269('0x43')]=function(_0x5f34d3,_0x23d91b){return db['VoiceCallReport'][_0x7269('0x43')](_0x5f34d3[_0x7269('0x44')],{})[_0x7269('0x38')](respondWithResult(_0x23d91b,0xc9))[_0x7269('0x42')](handleError(_0x23d91b,null));};exports[_0x7269('0x1e')]=function(_0x5ba559,_0x52b0f0){return db[_0x7269('0x24')][_0x7269('0x41')]({'where':{'id':_0x5ba559['params']['id']}})[_0x7269('0x38')](handleEntityNotFound(_0x52b0f0,null))[_0x7269('0x38')](removeEntity(_0x52b0f0,null))[_0x7269('0x42')](handleError(_0x52b0f0,null));};exports['describe']=function(_0x13c173,_0x2815c9){return db[_0x7269('0x24')]['describe']()['then'](respondWithResult(_0x2815c9,null))[_0x7269('0x42')](handleError(_0x2815c9,null));};exports['update']=function(_0x42afa2,_0x5ecbec){if(_0x42afa2[_0x7269('0x44')][_0x7269('0x45')]){delete _0x42afa2[_0x7269('0x44')][_0x7269('0x45')];}return db['VoiceCallReport'][_0x7269('0x41')]({'where':{'uniqueid':_0x42afa2['params']['id'],'UserId':{'$or':[null,_0x42afa2[_0x7269('0x46')]['id']]}}})[_0x7269('0x38')](handleEntityNotFound(_0x5ecbec,null))[_0x7269('0x38')](saveUpdates(_0x42afa2[_0x7269('0x44')],null))[_0x7269('0x38')](respondWithResult(_0x5ecbec,null))[_0x7269('0x42')](handleError(_0x5ecbec,null));};
\ No newline at end of file
index 69bb79c..6000a05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb37=['VoiceCallReport','report_call','lodash','util','../../config/logger','moment','bluebird','request-promise','./voiceCallReport.attributes','exports','define'];(function(_0x508d4b,_0x4488c2){var _0x17dd2c=function(_0x55e4c2){while(--_0x55e4c2){_0x508d4b['push'](_0x508d4b['shift']());}};_0x17dd2c(++_0x4488c2);}(_0xcb37,0x115));var _0x7cb3=function(_0x6f468a,_0x4f7a8f){_0x6f468a=_0x6f468a-0x0;var _0x39265e=_0xcb37[_0x6f468a];return _0x39265e;};'use strict';var _=require(_0x7cb3('0x0'));var util=require(_0x7cb3('0x1'));var logger=require(_0x7cb3('0x2'))('api');var moment=require(_0x7cb3('0x3'));var BPromise=require(_0x7cb3('0x4'));var rp=require(_0x7cb3('0x5'));var attributes=require(_0x7cb3('0x6'));module[_0x7cb3('0x7')]=function(_0xf3412e,_0x52c9dc){return _0xf3412e[_0x7cb3('0x8')](_0x7cb3('0x9'),attributes,{'tableName':_0x7cb3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b60=['define','VoiceCallReport','report_call','util','api','moment','bluebird','request-promise','./voiceCallReport.attributes','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6b60,0xe9));var _0x06b6=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0x6b60[_0x489b87];return _0x1823b6;};'use strict';var _=require('lodash');var util=require(_0x06b6('0x0'));var logger=require('../../config/logger')(_0x06b6('0x1'));var moment=require(_0x06b6('0x2'));var BPromise=require(_0x06b6('0x3'));var rp=require(_0x06b6('0x4'));var attributes=require(_0x06b6('0x5'));module[_0x06b6('0x6')]=function(_0x66570d,_0x3531f6){return _0x66570d[_0x06b6('0x7')](_0x06b6('0x8'),attributes,{'tableName':_0x06b6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c536ef4..9ff2a32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5c5=['model','include','map','CreateVoiceCallReport','create','update','body','UpdateVoiceCallReport','lodash','moment','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetVoiceCallReport','VoiceCallReport','options','raw','where','attributes','limit'];(function(_0xb39e3b,_0x2be5df){var _0x40515c=function(_0x58e386){while(--_0x58e386){_0xb39e3b['push'](_0xb39e3b['shift']());}};_0x40515c(++_0x2be5df);}(_0xb5c5,0x1b5));var _0x5b5c=function(_0x549a60,_0xb4b9e1){_0x549a60=_0x549a60-0x0;var _0xa75c51=_0xb5c5[_0x549a60];return _0xa75c51;};'use strict';var _=require(_0x5b5c('0x0'));var util=require('util');var moment=require(_0x5b5c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0x5b5c('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b5c('0x3'))(_0x5b5c('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5b5c('0x5')][_0x5b5c('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x453cb7,_0x324424,_0x44b17b){return new BPromise(function(_0x5d80b1,_0xae99d1){return client[_0x5b5c('0x7')](_0x453cb7,_0x44b17b)[_0x5b5c('0x8')](function(_0x38dff7){logger[_0x5b5c('0x9')](_0x5b5c('0xa'),_0x324424,_0x5b5c('0xb'));logger[_0x5b5c('0xc')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x324424,_0x5b5c('0xb'),JSON[_0x5b5c('0xd')](_0x38dff7));if(_0x38dff7[_0x5b5c('0xe')]){if(_0x38dff7[_0x5b5c('0xe')][_0x5b5c('0xf')]===0x1f4){logger[_0x5b5c('0xe')](_0x5b5c('0xa'),_0x324424,_0x38dff7[_0x5b5c('0xe')]['message']);return _0xae99d1(_0x38dff7[_0x5b5c('0xe')][_0x5b5c('0x10')]);}logger[_0x5b5c('0xe')](_0x5b5c('0xa'),_0x324424,_0x38dff7[_0x5b5c('0xe')][_0x5b5c('0x10')]);return _0x5d80b1(_0x38dff7['error'][_0x5b5c('0x10')]);}else{logger[_0x5b5c('0x9')](_0x5b5c('0xa'),_0x324424,_0x5b5c('0xb'));_0x5d80b1(_0x38dff7['result'][_0x5b5c('0x10')]);}})[_0x5b5c('0x11')](function(_0xaf15e){logger['error'](_0x5b5c('0xa'),_0x324424,_0xaf15e);_0xae99d1(_0xaf15e);});});}exports[_0x5b5c('0x12')]=function(_0x24de9f){var _0x4232bd=this;return new Promise(function(_0x510f43,_0x1ba676){return db[_0x5b5c('0x13')]['findAll']({'raw':_0x24de9f[_0x5b5c('0x14')]?_0x24de9f['options'][_0x5b5c('0x15')]===undefined?!![]:![]:!![],'where':_0x24de9f[_0x5b5c('0x14')]?_0x24de9f[_0x5b5c('0x14')][_0x5b5c('0x16')]||null:null,'attributes':_0x24de9f['options']?_0x24de9f[_0x5b5c('0x14')][_0x5b5c('0x17')]||null:null,'limit':_0x24de9f['options']?_0x24de9f['options'][_0x5b5c('0x18')]||null:null,'include':_0x24de9f[_0x5b5c('0x14')]?_0x24de9f['options']['include']?_['map'](_0x24de9f['options']['include'],function(_0x538629){return{'model':db[_0x538629[_0x5b5c('0x19')]],'as':_0x538629['as'],'attributes':_0x538629['attributes'],'include':_0x538629[_0x5b5c('0x1a')]?_[_0x5b5c('0x1b')](_0x538629[_0x5b5c('0x1a')],function(_0x2c5346){return{'model':db[_0x2c5346[_0x5b5c('0x19')]],'as':_0x2c5346['as'],'attributes':_0x2c5346[_0x5b5c('0x17')],'include':_0x2c5346['include']?_[_0x5b5c('0x1b')](_0x2c5346[_0x5b5c('0x1a')],function(_0x149c89){return{'model':db[_0x149c89[_0x5b5c('0x19')]],'as':_0x149c89['as'],'attributes':_0x149c89[_0x5b5c('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5b5c('0x8')](function(_0x200d5a){logger[_0x5b5c('0x9')](_0x5b5c('0x12'),_0x24de9f);logger['debug']('GetVoiceCallReport',_0x24de9f,JSON[_0x5b5c('0xd')](_0x200d5a));_0x510f43(_0x200d5a);})[_0x5b5c('0x11')](function(_0x5ddedb){logger[_0x5b5c('0xe')](_0x5b5c('0x12'),_0x5ddedb[_0x5b5c('0x10')],_0x24de9f);_0x1ba676(_0x4232bd['error'](0x1f4,_0x5ddedb['message']));});});};exports[_0x5b5c('0x1c')]=function(_0x1bcc9e){var _0x4b3047=this;return new Promise(function(_0x1c3223,_0x198ed6){return db[_0x5b5c('0x13')][_0x5b5c('0x1d')](_0x1bcc9e['body'],{'raw':_0x1bcc9e[_0x5b5c('0x14')]?_0x1bcc9e[_0x5b5c('0x14')][_0x5b5c('0x15')]===undefined?!![]:![]:!![]})[_0x5b5c('0x8')](function(_0xf09635){logger[_0x5b5c('0x9')]('CreateVoiceCallReport',_0x1bcc9e);logger[_0x5b5c('0xc')](_0x5b5c('0x1c'),_0x1bcc9e,JSON[_0x5b5c('0xd')](_0xf09635));_0x1c3223(_0xf09635);})[_0x5b5c('0x11')](function(_0x5b02c2){logger[_0x5b5c('0xe')](_0x5b5c('0x1c'),_0x5b02c2[_0x5b5c('0x10')],_0x1bcc9e);_0x198ed6(_0x4b3047['error'](0x1f4,_0x5b02c2[_0x5b5c('0x10')]));});});};exports['UpdateVoiceCallReport']=function(_0x3dedd4){var _0x154c3e=this;return new Promise(function(_0x48c3b2,_0x17c7db){return db[_0x5b5c('0x13')][_0x5b5c('0x1e')](_0x3dedd4[_0x5b5c('0x1f')],{'raw':_0x3dedd4[_0x5b5c('0x14')]?_0x3dedd4[_0x5b5c('0x14')][_0x5b5c('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dedd4[_0x5b5c('0x14')]?_0x3dedd4['options'][_0x5b5c('0x16')]||null:null,'attributes':_0x3dedd4['options']?_0x3dedd4[_0x5b5c('0x14')][_0x5b5c('0x17')]||null:null,'limit':_0x3dedd4[_0x5b5c('0x14')]?_0x3dedd4[_0x5b5c('0x14')][_0x5b5c('0x18')]||null:null})[_0x5b5c('0x8')](function(_0x5932bc){logger[_0x5b5c('0x9')]('UpdateVoiceCallReport',_0x3dedd4);logger[_0x5b5c('0xc')](_0x5b5c('0x20'),_0x3dedd4,JSON[_0x5b5c('0xd')](_0x5932bc));_0x48c3b2(_0x5932bc);})['catch'](function(_0x5bc669){logger['error'](_0x5b5c('0x20'),_0x5bc669[_0x5b5c('0x10')],_0x3dedd4);_0x17c7db(_0x154c3e[_0x5b5c('0xe')](0x1f4,_0x5bc669[_0x5b5c('0x10')]));});});};
\ No newline at end of file
+var _0xa58c=['body','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','CreateVoiceCallReport','create'];(function(_0xb2e1ce,_0x1f7def){var _0x46e715=function(_0x3138b5){while(--_0x3138b5){_0xb2e1ce['push'](_0xb2e1ce['shift']());}};_0x46e715(++_0x1f7def);}(_0xa58c,0xb6));var _0xca58=function(_0x4dd156,_0x47908f){_0x4dd156=_0x4dd156-0x0;var _0x3ff321=_0xa58c[_0x4dd156];return _0x3ff321;};'use strict';var _=require(_0xca58('0x0'));var util=require(_0xca58('0x1'));var moment=require(_0xca58('0x2'));var BPromise=require(_0xca58('0x3'));var rs=require(_0xca58('0x4'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xca58('0x5'));var config=require(_0xca58('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xca58('0x7')][_0xca58('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13b426,_0x5582ae,_0x482dbe){return new BPromise(function(_0x562572,_0x19ac67){return client['request'](_0x13b426,_0x482dbe)[_0xca58('0x9')](function(_0x5c8dad){logger[_0xca58('0xa')](_0xca58('0xb'),_0x5582ae,_0xca58('0xc'));logger['debug'](_0xca58('0xd'),_0x5582ae,_0xca58('0xc'),JSON[_0xca58('0xe')](_0x5c8dad));if(_0x5c8dad['error']){if(_0x5c8dad[_0xca58('0xf')][_0xca58('0x10')]===0x1f4){logger[_0xca58('0xf')](_0xca58('0xb'),_0x5582ae,_0x5c8dad['error'][_0xca58('0x11')]);return _0x19ac67(_0x5c8dad[_0xca58('0xf')][_0xca58('0x11')]);}logger[_0xca58('0xf')](_0xca58('0xb'),_0x5582ae,_0x5c8dad['error'][_0xca58('0x11')]);return _0x562572(_0x5c8dad[_0xca58('0xf')]['message']);}else{logger[_0xca58('0xa')]('VoiceCallReport,\x20%s,\x20%s',_0x5582ae,_0xca58('0xc'));_0x562572(_0x5c8dad[_0xca58('0x12')][_0xca58('0x11')]);}})[_0xca58('0x13')](function(_0x5c9636){logger[_0xca58('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x5582ae,_0x5c9636);_0x19ac67(_0x5c9636);});});}exports[_0xca58('0x14')]=function(_0x24902a){var _0x2b85c4=this;return new Promise(function(_0x510d87,_0x11c932){return db[_0xca58('0x15')][_0xca58('0x16')]({'raw':_0x24902a['options']?_0x24902a[_0xca58('0x17')][_0xca58('0x18')]===undefined?!![]:![]:!![],'where':_0x24902a[_0xca58('0x17')]?_0x24902a[_0xca58('0x17')][_0xca58('0x19')]||null:null,'attributes':_0x24902a[_0xca58('0x17')]?_0x24902a['options'][_0xca58('0x1a')]||null:null,'limit':_0x24902a[_0xca58('0x17')]?_0x24902a[_0xca58('0x17')][_0xca58('0x1b')]||null:null,'include':_0x24902a['options']?_0x24902a[_0xca58('0x17')][_0xca58('0x1c')]?_[_0xca58('0x1d')](_0x24902a[_0xca58('0x17')][_0xca58('0x1c')],function(_0x131478){return{'model':db[_0x131478[_0xca58('0x1e')]],'as':_0x131478['as'],'attributes':_0x131478[_0xca58('0x1a')],'include':_0x131478[_0xca58('0x1c')]?_['map'](_0x131478[_0xca58('0x1c')],function(_0x2c12f3){return{'model':db[_0x2c12f3[_0xca58('0x1e')]],'as':_0x2c12f3['as'],'attributes':_0x2c12f3[_0xca58('0x1a')],'include':_0x2c12f3['include']?_[_0xca58('0x1d')](_0x2c12f3[_0xca58('0x1c')],function(_0x342757){return{'model':db[_0x342757[_0xca58('0x1e')]],'as':_0x342757['as'],'attributes':_0x342757[_0xca58('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xca58('0x9')](function(_0x3dbbc4){logger['info'](_0xca58('0x14'),_0x24902a);logger[_0xca58('0x1f')](_0xca58('0x14'),_0x24902a,JSON['stringify'](_0x3dbbc4));_0x510d87(_0x3dbbc4);})[_0xca58('0x13')](function(_0x55933d){logger[_0xca58('0xf')]('GetVoiceCallReport',_0x55933d[_0xca58('0x11')],_0x24902a);_0x11c932(_0x2b85c4[_0xca58('0xf')](0x1f4,_0x55933d[_0xca58('0x11')]));});});};exports[_0xca58('0x20')]=function(_0x38fd91){var _0x348287=this;return new Promise(function(_0x40d366,_0x3f367c){return db[_0xca58('0x15')][_0xca58('0x21')](_0x38fd91[_0xca58('0x22')],{'raw':_0x38fd91[_0xca58('0x17')]?_0x38fd91[_0xca58('0x17')][_0xca58('0x18')]===undefined?!![]:![]:!![]})[_0xca58('0x9')](function(_0x9bd2f5){logger[_0xca58('0xa')]('CreateVoiceCallReport',_0x38fd91);logger[_0xca58('0x1f')](_0xca58('0x20'),_0x38fd91,JSON[_0xca58('0xe')](_0x9bd2f5));_0x40d366(_0x9bd2f5);})[_0xca58('0x13')](function(_0x3cb715){logger[_0xca58('0xf')](_0xca58('0x20'),_0x3cb715[_0xca58('0x11')],_0x38fd91);_0x3f367c(_0x348287[_0xca58('0xf')](0x1f4,_0x3cb715['message']));});});};exports['UpdateVoiceCallReport']=function(_0x35f89a){var _0x36158f=this;return new Promise(function(_0x3d2621,_0x385560){return db[_0xca58('0x15')]['update'](_0x35f89a[_0xca58('0x22')],{'raw':_0x35f89a['options']?_0x35f89a['options'][_0xca58('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35f89a[_0xca58('0x17')]?_0x35f89a[_0xca58('0x17')][_0xca58('0x19')]||null:null,'attributes':_0x35f89a[_0xca58('0x17')]?_0x35f89a[_0xca58('0x17')]['attributes']||null:null,'limit':_0x35f89a[_0xca58('0x17')]?_0x35f89a[_0xca58('0x17')][_0xca58('0x1b')]||null:null})[_0xca58('0x9')](function(_0x40614a){logger[_0xca58('0xa')](_0xca58('0x23'),_0x35f89a);logger['debug']('UpdateVoiceCallReport',_0x35f89a,JSON[_0xca58('0xe')](_0x40614a));_0x3d2621(_0x40614a);})[_0xca58('0x13')](function(_0x49b8fd){logger[_0xca58('0xf')](_0xca58('0x23'),_0x49b8fd[_0xca58('0x11')],_0x35f89a);_0x385560(_0x36158f[_0xca58('0xf')](0x1f4,_0x49b8fd['message']));});});};
\ No newline at end of file
index 5af5f12..c2bd8e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b20=['isAuthenticated','/:id','show','post','create','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get'];(function(_0x3198a8,_0x49a00a){var _0x1e1400=function(_0x1a2755){while(--_0x1a2755){_0x3198a8['push'](_0x3198a8['shift']());}};_0x1e1400(++_0x49a00a);}(_0x4b20,0x116));var _0x04b2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b20[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x04b2('0x0'));var util=require(_0x04b2('0x1'));var path=require(_0x04b2('0x2'));var express=require(_0x04b2('0x3'));var router=express[_0x04b2('0x4')]();var auth=require(_0x04b2('0x5'));var interaction=require(_0x04b2('0x6'));var config=require(_0x04b2('0x7'));var controller=require(_0x04b2('0x8'));router[_0x04b2('0x9')]('/',auth[_0x04b2('0xa')](),controller['index']);router[_0x04b2('0x9')](_0x04b2('0xb'),auth['isAuthenticated'](),controller[_0x04b2('0xc')]);router[_0x04b2('0xd')]('/',auth['isAuthenticated'](),controller[_0x04b2('0xe')]);router['put'](_0x04b2('0xb'),auth['isAuthenticated'](),controller[_0x04b2('0xf')]);router['delete'](_0x04b2('0xb'),auth[_0x04b2('0xa')](),controller[_0x04b2('0x10')]);module[_0x04b2('0x11')]=router;
\ No newline at end of file
+var _0x86c7=['delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','post','put','update'];(function(_0x342527,_0x8f1212){var _0x3ffc4f=function(_0x615829){while(--_0x615829){_0x342527['push'](_0x342527['shift']());}};_0x3ffc4f(++_0x8f1212);}(_0x86c7,0xe0));var _0x786c=function(_0x2ef2c4,_0x5bec04){_0x2ef2c4=_0x2ef2c4-0x0;var _0x1624fb=_0x86c7[_0x2ef2c4];return _0x1624fb;};'use strict';var multer=require(_0x786c('0x0'));var util=require(_0x786c('0x1'));var path=require(_0x786c('0x2'));var express=require('express');var router=express[_0x786c('0x3')]();var auth=require(_0x786c('0x4'));var interaction=require(_0x786c('0x5'));var config=require('../../config/environment');var controller=require(_0x786c('0x6'));router[_0x786c('0x7')]('/',auth[_0x786c('0x8')](),controller[_0x786c('0x9')]);router[_0x786c('0x7')](_0x786c('0xa'),auth[_0x786c('0x8')](),controller['show']);router[_0x786c('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x786c('0xc')](_0x786c('0xa'),auth[_0x786c('0x8')](),controller[_0x786c('0xd')]);router[_0x786c('0xe')](_0x786c('0xa'),auth[_0x786c('0x8')](),controller[_0x786c('0xf')]);module[_0x786c('0x10')]=router;
\ No newline at end of file
index 7637416..60a4ccd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a33=['STRING','name','setDataValue','options','join','getDataValue','BOOLEAN','exports'];(function(_0x3cba1d,_0x2825ae){var _0x5f192b=function(_0x32ff5d){while(--_0x32ff5d){_0x3cba1d['push'](_0x3cba1d['shift']());}};_0x5f192b(++_0x2825ae);}(_0x3a33,0x10f));var _0x33a3=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x3a33[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require('sequelize');module[_0x33a3('0x0')]={'name':{'type':Sequelize[_0x33a3('0x1')]},'prefix':{'type':Sequelize[_0x33a3('0x1')],'unique':_0x33a3('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x33a3('0x1')],'set':function(_0x5bd97e){this[_0x33a3('0x3')](_0x33a3('0x4'),_0x5bd97e?_0x5bd97e[_0x33a3('0x5')](''):[]);},'get':function(){return this[_0x33a3('0x6')](_0x33a3('0x4'))?this[_0x33a3('0x6')](_0x33a3('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0x33a3('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x33a3('0x1')]},'record':{'type':Sequelize[_0x33a3('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x33a3('0x1')]},'description':{'type':Sequelize[_0x33a3('0x1')]}};
\ No newline at end of file
+var _0xc752=['BOOLEAN','sequelize','STRING','name','setDataValue','options','join','split'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xc752,0x91));var _0x2c75=function(_0x5622d6,_0x37e8ce){_0x5622d6=_0x5622d6-0x0;var _0x28b003=_0xc752[_0x5622d6];return _0x28b003;};'use strict';var Sequelize=require(_0x2c75('0x0'));module['exports']={'name':{'type':Sequelize[_0x2c75('0x1')]},'prefix':{'type':Sequelize[_0x2c75('0x1')],'unique':_0x2c75('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x14024b){this[_0x2c75('0x3')](_0x2c75('0x4'),_0x14024b?_0x14024b[_0x2c75('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x2c75('0x4'))?this['getDataValue'](_0x2c75('0x4'))[_0x2c75('0x6')](''):[];}},'auth':{'type':Sequelize[_0x2c75('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x2c75('0x1')]},'record':{'type':Sequelize[_0x2c75('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x2c75('0x1')]},'description':{'type':Sequelize[_0x2c75('0x1')]}};
\ No newline at end of file
index 40bdc9b..96c1620 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['find','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','../../components/parsers/qs','../../config/logger','../../config/utils','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','VoiceChanSpy','rawAttributes','model','keys','query','dateStart','dateEnd','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','add','day','merge','map','filter','options','includeAll','include','findAll','rows','catch','create','body'];(function(_0x2307fa,_0x266e5e){var _0x496486=function(_0x53466e){while(--_0x53466e){_0x2307fa['push'](_0x2307fa['shift']());}};_0x496486(++_0x266e5e);}(_0x7a54,0x106));var _0x47a5=function(_0x520f45,_0x1d55b0){_0x520f45=_0x520f45-0x0;var _0x92e426=_0x7a54[_0x520f45];return _0x92e426;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var qs=require(_0x47a5('0xe'));var logger=require(_0x47a5('0xf'))('api');var utils=require(_0x47a5('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f47f4,_0x69e4d4){_0x69e4d4=_0x69e4d4||0xcc;return function(_0x2f399b){if(_0x2f399b){return _0x1f47f4[_0x47a5('0x11')](_0x69e4d4);}return _0x1f47f4[_0x47a5('0x12')](_0x69e4d4)[_0x47a5('0x13')]();};}function respondWithResult(_0x1eae59,_0x5beb89){_0x5beb89=_0x5beb89||0xc8;return function(_0x44bd3e){if(_0x44bd3e){return _0x1eae59[_0x47a5('0x12')](_0x5beb89)[_0x47a5('0x14')](_0x44bd3e);}};}function respondWithFilteredResult(_0x711793,_0x139f25){return function(_0x620ee9){if(_0x620ee9){var _0x3c6c46=_0x620ee9[_0x47a5('0x15')],_0x190faa=_0x139f25[_0x47a5('0x16')],_0x4e99a8=_0x139f25[_0x47a5('0x16')]+_0x139f25[_0x47a5('0x17')],_0x362359;if(_0x4e99a8>=_0x3c6c46){_0x4e99a8=_0x3c6c46;_0x362359=0xc8;}else{_0x362359=0xce;}_0x711793['status'](_0x362359);return _0x711793['set'](_0x47a5('0x18'),_0x190faa+'-'+_0x4e99a8+'/'+_0x3c6c46)['json'](_0x620ee9);}return null;};}function patchUpdates(_0x5247fd){return function(_0x423a81){try{jsonpatch[_0x47a5('0x19')](_0x423a81,_0x5247fd,!![]);}catch(_0x2ce454){return BPromise[_0x47a5('0x1a')](_0x2ce454);}return _0x423a81[_0x47a5('0x1b')]();};}function saveUpdates(_0x12b98e,_0x2763d6){return function(_0xe3c618){if(_0xe3c618){return _0xe3c618[_0x47a5('0x1c')](_0x12b98e)['then'](function(_0x1570bc){return _0x1570bc;});}return null;};}function removeEntity(_0xf160ba,_0x47cf3c){return function(_0x2b0360){if(_0x2b0360){return _0x2b0360[_0x47a5('0x1d')]()[_0x47a5('0x1e')](function(){_0xf160ba['status'](0xcc)[_0x47a5('0x13')]();});}};}function handleEntityNotFound(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(!_0x7a9f9e){_0x2f142b['sendStatus'](0x194);}return _0x7a9f9e;};}function handleError(_0xe2dea9,_0x385687){_0x385687=_0x385687||0x1f4;return function(_0x513981){logger[_0x47a5('0x1f')](_0x513981[_0x47a5('0x20')]);if(_0x513981[_0x47a5('0x21')]){delete _0x513981[_0x47a5('0x21')];}_0xe2dea9[_0x47a5('0x12')](_0x385687)['send'](_0x513981);};}exports['index']=function(_0x136745,_0x5686db){var _0x1ea9c8={},_0x5b6c4e={},_0x23cb77={'count':0x0,'rows':[]};var _0x378208=db[_0x47a5('0x22')][_0x47a5('0x23')];_0x5b6c4e[_0x47a5('0x24')]=_[_0x47a5('0x25')](_0x378208);var _0x24b162={'dateStart':_0x136745[_0x47a5('0x26')][_0x47a5('0x27')],'dateEnd':_0x136745[_0x47a5('0x26')][_0x47a5('0x28')]};delete _0x136745[_0x47a5('0x26')][_0x47a5('0x27')];delete _0x136745['query'][_0x47a5('0x28')];_0x5b6c4e['query']=_[_0x47a5('0x25')](_0x136745[_0x47a5('0x26')]);_0x5b6c4e[_0x47a5('0x29')]=_['intersection'](_0x5b6c4e[_0x47a5('0x24')],_0x5b6c4e[_0x47a5('0x26')]);_0x1ea9c8[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x5b6c4e['model'],qs['fields'](_0x136745[_0x47a5('0x26')][_0x47a5('0x2c')]));_0x1ea9c8['attributes']=_0x1ea9c8['attributes'][_0x47a5('0x2d')]?_0x1ea9c8[_0x47a5('0x2a')]:_0x5b6c4e['model'];if(!_0x136745[_0x47a5('0x26')]['hasOwnProperty'](_0x47a5('0x2e'))){_0x1ea9c8[_0x47a5('0x17')]=qs['limit'](_0x136745['query'][_0x47a5('0x17')]);_0x1ea9c8['offset']=qs[_0x47a5('0x16')](_0x136745[_0x47a5('0x26')][_0x47a5('0x16')]);}_0x1ea9c8['order']=qs[_0x47a5('0x2f')](_0x136745['query']['sort']);_0x1ea9c8[_0x47a5('0x30')]=qs['filters'](_[_0x47a5('0x31')](_0x136745['query'],_0x5b6c4e[_0x47a5('0x29')]));if(_0x24b162[_0x47a5('0x27')]){if(_0x24b162[_0x47a5('0x28')]){_0x24b162[_0x47a5('0x28')]=moment(_0x24b162[_0x47a5('0x28')])[_0x47a5('0x32')](0x1,_0x47a5('0x33'));}else{_0x24b162[_0x47a5('0x28')]=moment(_0x24b162[_0x47a5('0x27')])['add'](0x1,_0x47a5('0x33'));}_[_0x47a5('0x34')](_0x1ea9c8['where'],{'createdAt':{'$gte':_0x24b162[_0x47a5('0x27')],'$lte':_0x24b162[_0x47a5('0x28')]}});}if(_0x136745[_0x47a5('0x26')]['filter']){_0x1ea9c8[_0x47a5('0x30')]=_[_0x47a5('0x34')](_0x1ea9c8['where'],{'$or':_[_0x47a5('0x35')](_0x1ea9c8[_0x47a5('0x2a')],function(_0x54ae35){var _0x55c5eb={};_0x55c5eb[_0x54ae35]={'$like':'%'+_0x136745['query'][_0x47a5('0x36')]+'%'};return _0x55c5eb;})});}_0x1ea9c8=_['merge']({},_0x1ea9c8,_0x136745[_0x47a5('0x37')]);var _0x1f9631={'where':_0x1ea9c8[_0x47a5('0x30')]};return db[_0x47a5('0x22')][_0x47a5('0x15')](_0x1f9631)[_0x47a5('0x1e')](function(_0x2003b0){_0x23cb77[_0x47a5('0x15')]=_0x2003b0;if(_0x136745[_0x47a5('0x26')][_0x47a5('0x38')]){_0x1ea9c8[_0x47a5('0x39')]=[{'all':!![]}];}return db[_0x47a5('0x22')][_0x47a5('0x3a')](_0x1ea9c8);})['then'](function(_0x1fbece){_0x23cb77[_0x47a5('0x3b')]=_0x1fbece;return _0x23cb77;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x5686db,_0x1ea9c8))[_0x47a5('0x3c')](handleError(_0x5686db,null));};exports['show']=function(_0x7de536,_0x528ef3){var _0x47c7a2={'raw':![],'where':{'id':_0x7de536['params']['id']}},_0x55c43d={};_0x55c43d[_0x47a5('0x24')]=_['keys'](db[_0x47a5('0x22')][_0x47a5('0x23')]);_0x55c43d[_0x47a5('0x26')]=_['keys'](_0x7de536[_0x47a5('0x26')]);_0x55c43d[_0x47a5('0x29')]=_['intersection'](_0x55c43d['model'],_0x55c43d[_0x47a5('0x26')]);_0x47c7a2['attributes']=_[_0x47a5('0x2b')](_0x55c43d[_0x47a5('0x24')],qs[_0x47a5('0x2c')](_0x7de536[_0x47a5('0x26')][_0x47a5('0x2c')]));_0x47c7a2[_0x47a5('0x2a')]=_0x47c7a2[_0x47a5('0x2a')][_0x47a5('0x2d')]?_0x47c7a2[_0x47a5('0x2a')]:_0x55c43d[_0x47a5('0x24')];if(_0x7de536[_0x47a5('0x26')][_0x47a5('0x38')]){_0x47c7a2[_0x47a5('0x39')]=[{'all':!![]}];}_0x47c7a2=_[_0x47a5('0x34')]({},_0x47c7a2,_0x7de536[_0x47a5('0x37')]);return db[_0x47a5('0x22')]['find'](_0x47c7a2)[_0x47a5('0x1e')](handleEntityNotFound(_0x528ef3,null))[_0x47a5('0x1e')](respondWithResult(_0x528ef3,null))['catch'](handleError(_0x528ef3,null));};exports['create']=function(_0x3d0a88,_0x560e4e){return db[_0x47a5('0x22')][_0x47a5('0x3d')](_0x3d0a88['body'],{})['then'](respondWithResult(_0x560e4e,0xc9))[_0x47a5('0x3c')](handleError(_0x560e4e,null));};exports['update']=function(_0x2d147c,_0x1d1039){if(_0x2d147c[_0x47a5('0x3e')]['id']){delete _0x2d147c[_0x47a5('0x3e')]['id'];}return db[_0x47a5('0x22')][_0x47a5('0x3f')]({'where':{'id':_0x2d147c[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x1d1039,null))['then'](saveUpdates(_0x2d147c[_0x47a5('0x3e')],null))[_0x47a5('0x1e')](respondWithResult(_0x1d1039,null))[_0x47a5('0x3c')](handleError(_0x1d1039,null));};exports[_0x47a5('0x1d')]=function(_0x2c7020,_0x2c0c86){return db[_0x47a5('0x22')]['find']({'where':{'id':_0x2c7020[_0x47a5('0x40')]['id']}})[_0x47a5('0x1e')](handleEntityNotFound(_0x2c0c86,null))[_0x47a5('0x1e')](removeEntity(_0x2c0c86,null))['catch'](handleError(_0x2c0c86,null));};
\ No newline at end of file
+var _0x7a54=['find','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','../../components/parsers/qs','../../config/logger','../../config/utils','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','VoiceChanSpy','rawAttributes','model','keys','query','dateStart','dateEnd','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','add','day','merge','map','filter','options','includeAll','include','findAll','rows','catch','create','body'];(function(_0x2cbb74,_0x241c10){var _0xa6d18=function(_0x5a2940){while(--_0x5a2940){_0x2cbb74['push'](_0x2cbb74['shift']());}};_0xa6d18(++_0x241c10);}(_0x7a54,0x106));var _0x47a5=function(_0xe18611,_0x2eafa7){_0xe18611=_0xe18611-0x0;var _0x58bce0=_0x7a54[_0xe18611];return _0x58bce0;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var qs=require(_0x47a5('0xe'));var logger=require(_0x47a5('0xf'))('api');var utils=require(_0x47a5('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f47f4,_0x69e4d4){_0x69e4d4=_0x69e4d4||0xcc;return function(_0x2f399b){if(_0x2f399b){return _0x1f47f4[_0x47a5('0x11')](_0x69e4d4);}return _0x1f47f4[_0x47a5('0x12')](_0x69e4d4)[_0x47a5('0x13')]();};}function respondWithResult(_0x1eae59,_0x5beb89){_0x5beb89=_0x5beb89||0xc8;return function(_0x44bd3e){if(_0x44bd3e){return _0x1eae59[_0x47a5('0x12')](_0x5beb89)[_0x47a5('0x14')](_0x44bd3e);}};}function respondWithFilteredResult(_0x711793,_0x139f25){return function(_0x620ee9){if(_0x620ee9){var _0x3c6c46=_0x620ee9[_0x47a5('0x15')],_0x190faa=_0x139f25[_0x47a5('0x16')],_0x4e99a8=_0x139f25[_0x47a5('0x16')]+_0x139f25[_0x47a5('0x17')],_0x362359;if(_0x4e99a8>=_0x3c6c46){_0x4e99a8=_0x3c6c46;_0x362359=0xc8;}else{_0x362359=0xce;}_0x711793['status'](_0x362359);return _0x711793['set'](_0x47a5('0x18'),_0x190faa+'-'+_0x4e99a8+'/'+_0x3c6c46)['json'](_0x620ee9);}return null;};}function patchUpdates(_0x5247fd){return function(_0x423a81){try{jsonpatch[_0x47a5('0x19')](_0x423a81,_0x5247fd,!![]);}catch(_0x2ce454){return BPromise[_0x47a5('0x1a')](_0x2ce454);}return _0x423a81[_0x47a5('0x1b')]();};}function saveUpdates(_0x12b98e,_0x2763d6){return function(_0xe3c618){if(_0xe3c618){return _0xe3c618[_0x47a5('0x1c')](_0x12b98e)['then'](function(_0x1570bc){return _0x1570bc;});}return null;};}function removeEntity(_0xf160ba,_0x47cf3c){return function(_0x2b0360){if(_0x2b0360){return _0x2b0360[_0x47a5('0x1d')]()[_0x47a5('0x1e')](function(){_0xf160ba['status'](0xcc)[_0x47a5('0x13')]();});}};}function handleEntityNotFound(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(!_0x7a9f9e){_0x2f142b['sendStatus'](0x194);}return _0x7a9f9e;};}function handleError(_0xe2dea9,_0x385687){_0x385687=_0x385687||0x1f4;return function(_0x513981){logger[_0x47a5('0x1f')](_0x513981[_0x47a5('0x20')]);if(_0x513981[_0x47a5('0x21')]){delete _0x513981[_0x47a5('0x21')];}_0xe2dea9[_0x47a5('0x12')](_0x385687)['send'](_0x513981);};}exports['index']=function(_0x136745,_0x5686db){var _0x1ea9c8={},_0x5b6c4e={},_0x23cb77={'count':0x0,'rows':[]};var _0x378208=db[_0x47a5('0x22')][_0x47a5('0x23')];_0x5b6c4e[_0x47a5('0x24')]=_[_0x47a5('0x25')](_0x378208);var _0x24b162={'dateStart':_0x136745[_0x47a5('0x26')][_0x47a5('0x27')],'dateEnd':_0x136745[_0x47a5('0x26')][_0x47a5('0x28')]};delete _0x136745[_0x47a5('0x26')][_0x47a5('0x27')];delete _0x136745['query'][_0x47a5('0x28')];_0x5b6c4e['query']=_[_0x47a5('0x25')](_0x136745[_0x47a5('0x26')]);_0x5b6c4e[_0x47a5('0x29')]=_['intersection'](_0x5b6c4e[_0x47a5('0x24')],_0x5b6c4e[_0x47a5('0x26')]);_0x1ea9c8[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x5b6c4e['model'],qs['fields'](_0x136745[_0x47a5('0x26')][_0x47a5('0x2c')]));_0x1ea9c8['attributes']=_0x1ea9c8['attributes'][_0x47a5('0x2d')]?_0x1ea9c8[_0x47a5('0x2a')]:_0x5b6c4e['model'];if(!_0x136745[_0x47a5('0x26')]['hasOwnProperty'](_0x47a5('0x2e'))){_0x1ea9c8[_0x47a5('0x17')]=qs['limit'](_0x136745['query'][_0x47a5('0x17')]);_0x1ea9c8['offset']=qs[_0x47a5('0x16')](_0x136745[_0x47a5('0x26')][_0x47a5('0x16')]);}_0x1ea9c8['order']=qs[_0x47a5('0x2f')](_0x136745['query']['sort']);_0x1ea9c8[_0x47a5('0x30')]=qs['filters'](_[_0x47a5('0x31')](_0x136745['query'],_0x5b6c4e[_0x47a5('0x29')]));if(_0x24b162[_0x47a5('0x27')]){if(_0x24b162[_0x47a5('0x28')]){_0x24b162[_0x47a5('0x28')]=moment(_0x24b162[_0x47a5('0x28')])[_0x47a5('0x32')](0x1,_0x47a5('0x33'));}else{_0x24b162[_0x47a5('0x28')]=moment(_0x24b162[_0x47a5('0x27')])['add'](0x1,_0x47a5('0x33'));}_[_0x47a5('0x34')](_0x1ea9c8['where'],{'createdAt':{'$gte':_0x24b162[_0x47a5('0x27')],'$lte':_0x24b162[_0x47a5('0x28')]}});}if(_0x136745[_0x47a5('0x26')]['filter']){_0x1ea9c8[_0x47a5('0x30')]=_[_0x47a5('0x34')](_0x1ea9c8['where'],{'$or':_[_0x47a5('0x35')](_0x1ea9c8[_0x47a5('0x2a')],function(_0x54ae35){var _0x55c5eb={};_0x55c5eb[_0x54ae35]={'$like':'%'+_0x136745['query'][_0x47a5('0x36')]+'%'};return _0x55c5eb;})});}_0x1ea9c8=_['merge']({},_0x1ea9c8,_0x136745[_0x47a5('0x37')]);var _0x1f9631={'where':_0x1ea9c8[_0x47a5('0x30')]};return db[_0x47a5('0x22')][_0x47a5('0x15')](_0x1f9631)[_0x47a5('0x1e')](function(_0x2003b0){_0x23cb77[_0x47a5('0x15')]=_0x2003b0;if(_0x136745[_0x47a5('0x26')][_0x47a5('0x38')]){_0x1ea9c8[_0x47a5('0x39')]=[{'all':!![]}];}return db[_0x47a5('0x22')][_0x47a5('0x3a')](_0x1ea9c8);})['then'](function(_0x1fbece){_0x23cb77[_0x47a5('0x3b')]=_0x1fbece;return _0x23cb77;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x5686db,_0x1ea9c8))[_0x47a5('0x3c')](handleError(_0x5686db,null));};exports['show']=function(_0x7de536,_0x528ef3){var _0x47c7a2={'raw':![],'where':{'id':_0x7de536['params']['id']}},_0x55c43d={};_0x55c43d[_0x47a5('0x24')]=_['keys'](db[_0x47a5('0x22')][_0x47a5('0x23')]);_0x55c43d[_0x47a5('0x26')]=_['keys'](_0x7de536[_0x47a5('0x26')]);_0x55c43d[_0x47a5('0x29')]=_['intersection'](_0x55c43d['model'],_0x55c43d[_0x47a5('0x26')]);_0x47c7a2['attributes']=_[_0x47a5('0x2b')](_0x55c43d[_0x47a5('0x24')],qs[_0x47a5('0x2c')](_0x7de536[_0x47a5('0x26')][_0x47a5('0x2c')]));_0x47c7a2[_0x47a5('0x2a')]=_0x47c7a2[_0x47a5('0x2a')][_0x47a5('0x2d')]?_0x47c7a2[_0x47a5('0x2a')]:_0x55c43d[_0x47a5('0x24')];if(_0x7de536[_0x47a5('0x26')][_0x47a5('0x38')]){_0x47c7a2[_0x47a5('0x39')]=[{'all':!![]}];}_0x47c7a2=_[_0x47a5('0x34')]({},_0x47c7a2,_0x7de536[_0x47a5('0x37')]);return db[_0x47a5('0x22')]['find'](_0x47c7a2)[_0x47a5('0x1e')](handleEntityNotFound(_0x528ef3,null))[_0x47a5('0x1e')](respondWithResult(_0x528ef3,null))['catch'](handleError(_0x528ef3,null));};exports['create']=function(_0x3d0a88,_0x560e4e){return db[_0x47a5('0x22')][_0x47a5('0x3d')](_0x3d0a88['body'],{})['then'](respondWithResult(_0x560e4e,0xc9))[_0x47a5('0x3c')](handleError(_0x560e4e,null));};exports['update']=function(_0x2d147c,_0x1d1039){if(_0x2d147c[_0x47a5('0x3e')]['id']){delete _0x2d147c[_0x47a5('0x3e')]['id'];}return db[_0x47a5('0x22')][_0x47a5('0x3f')]({'where':{'id':_0x2d147c[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x1d1039,null))['then'](saveUpdates(_0x2d147c[_0x47a5('0x3e')],null))[_0x47a5('0x1e')](respondWithResult(_0x1d1039,null))[_0x47a5('0x3c')](handleError(_0x1d1039,null));};exports[_0x47a5('0x1d')]=function(_0x2c7020,_0x2c0c86){return db[_0x47a5('0x22')]['find']({'where':{'id':_0x2c7020[_0x47a5('0x40')]['id']}})[_0x47a5('0x1e')](handleEntityNotFound(_0x2c0c86,null))[_0x47a5('0x1e')](removeEntity(_0x2c0c86,null))['catch'](handleError(_0x2c0c86,null));};
\ No newline at end of file
index 313e8b1..b0334ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0804=['findAll','name','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','VoiceExtension','util','bluebird','../../config/logger','./voiceChanSpy.attributes','system','format','%s%s','prefix','push','merge','CDR(type)=%s','${UNIQUEID}.%s,ab','recordingFormat','auth','ChanSpy','options','record','length','internal','User'];(function(_0x1e56aa,_0x33943a){var _0x1e364b=function(_0x3e8555){while(--_0x3e8555){_0x1e56aa['push'](_0x1e56aa['shift']());}};_0x1e364b(++_0x33943a);}(_0x0804,0x1ea));var _0x4080=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0x0804[_0x44a64f];return _0x52024b;};'use strict';var _=require('lodash');var util=require(_0x4080('0x0'));var BPromise=require(_0x4080('0x1'));var logger=require(_0x4080('0x2'))('api');var attributes=require(_0x4080('0x3'));var getUserApplications=function(_0x48f86b,_0x31dc75,_0x157024){var _0x592368=0x1;var _0x2ccd80=[];var _0x19c91b={'context':'from-sip','type':_0x4080('0x4'),'isApp':![]};var _0x1bba23={'exten':util[_0x4080('0x5')](_0x4080('0x6'),_0x48f86b[_0x4080('0x7')],_0x157024),'ChanSpyId':_0x48f86b['id'],'UserId':_0x31dc75['id']};_0x2ccd80[_0x4080('0x8')](_[_0x4080('0x9')]({'app':'Set','appdata':util[_0x4080('0x5')](_0x4080('0xa'),'chanspy'),'priority':_0x592368++},_0x19c91b,_0x1bba23));if(_0x48f86b['record']){_0x2ccd80[_0x4080('0x8')](_[_0x4080('0x9')]({'app':'MixMonitor','appdata':util['format'](_0x4080('0xb'),_0x48f86b[_0x4080('0xc')]),'priority':_0x592368++},_0x19c91b,_0x1bba23));}if(_0x48f86b[_0x4080('0xd')]){_0x2ccd80['push'](_['merge']({'app':'Authenticate','appdata':_0x48f86b['password'],'priority':_0x592368++},_0x19c91b,_0x1bba23));}_0x2ccd80[_0x4080('0x8')](_[_0x4080('0x9')]({'app':_0x4080('0xe'),'appdata':util[_0x4080('0x5')]('SIP/%s,%s',_0x31dc75['name'],_0x48f86b['options']?_0x48f86b[_0x4080('0xf')]['join'](''):''),'priority':_0x592368++},_0x19c91b,_0x1bba23));if(_0x48f86b[_0x4080('0x10')]){_0x2ccd80[_0x4080('0x8')](_[_0x4080('0x9')]({'app':'StopMixMonitor','priority':_0x592368++},_0x19c91b,_0x1bba23));}return _0x2ccd80;};var getChanSpyApplications=function(_0x37ce51,_0x202812){var _0xd3290d=[];for(var _0x2d203d=0x0,_0x38bd8d=0x1;_0x2d203d<_0x202812[_0x4080('0x11')];_0x2d203d++,_0x38bd8d=0x1){var _0x354703=getUserApplications(_0x37ce51,_0x202812[_0x2d203d],_0x202812[_0x2d203d][_0x4080('0x12')]);var _0x3b993d=getUserApplications(_0x37ce51,_0x202812[_0x2d203d],_0x202812[_0x2d203d]['name']);_0xd3290d=_0xd3290d['concat'](_0x354703,_0x3b993d);}return _0xd3290d;};var getChanSpyPromise=function(_0x4d84bf,_0x25ba6b){return new BPromise(function(_0x2a9668,_0x38e5b9){return _0x4d84bf[_0x4080('0x13')][_0x4080('0x14')]({'attributes':['id',_0x4080('0x15'),_0x4080('0x12')],'where':{'role':_0x4080('0x16'),'chanspy':!![]},'raw':!![]})[_0x4080('0x17')](function(_0x6c5cae){if(_0x6c5cae){return _0x2a9668(getChanSpyApplications(_0x25ba6b,_0x6c5cae));}return _0x2a9668([]);})[_0x4080('0x18')](function(_0x25fe4b){_0x38e5b9(_0x25fe4b);});});};module[_0x4080('0x19')]=function(_0x4d8160,_0x1a1ddc){var _0x23a223=_0x4d8160[_0x4080('0x1a')];return _0x4d8160['define'](_0x4080('0x1b'),attributes,{'tableName':_0x4080('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x70d63c,_0x355848,_0x492f3a){return getChanSpyPromise(_0x23a223,_0x70d63c)[_0x4080('0x17')](function(_0x5123be){if(_0x5123be&&_0x5123be[_0x4080('0x11')]){return _0x23a223[_0x4080('0x1d')]['bulkCreate'](_0x5123be);}})['then'](function(){_0x492f3a();})[_0x4080('0x18')](function(_0x34b5e1){_0x492f3a(_0x34b5e1);});},'afterUpdate':function(_0x5bdb62,_0x7c474f,_0x1657cd){return _0x23a223[_0x4080('0x1d')]['destroy']({'where':{'ChanSpyId':_0x5bdb62['id']}})['then'](function(){return getChanSpyPromise(_0x23a223,_0x5bdb62);})[_0x4080('0x17')](function(_0x344fa2){if(_0x344fa2&&_0x344fa2[_0x4080('0x11')]){return _0x23a223['VoiceExtension']['bulkCreate'](_0x344fa2);}})[_0x4080('0x17')](function(){_0x1657cd();})['catch'](function(_0x4e361c){_0x1657cd(_0x4e361c);});},'afterDestroy':function(_0x1c851b,_0x551c1b,_0x46bb31){return _0x23a223['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x1c851b['id']}})[_0x4080('0x17')](function(){_0x46bb31();})[_0x4080('0x18')](function(_0x2c348e){_0x46bb31(_0x2c348e);});}}});};
\ No newline at end of file
+var _0x8a93=['Set','format','record','push','merge','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','internal','User','findAll','agent','then','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','catch','destroy','bulkCreate','lodash','util','bluebird','../../config/logger','api','./voiceChanSpy.attributes','from-sip','system','%s%s','prefix'];(function(_0x3cf88f,_0x43fe5d){var _0x1bc1a8=function(_0x3ac45b){while(--_0x3ac45b){_0x3cf88f['push'](_0x3cf88f['shift']());}};_0x1bc1a8(++_0x43fe5d);}(_0x8a93,0x8a));var _0x38a9=function(_0x22dac7,_0x45d32a){_0x22dac7=_0x22dac7-0x0;var _0x3e6cfa=_0x8a93[_0x22dac7];return _0x3e6cfa;};'use strict';var _=require(_0x38a9('0x0'));var util=require(_0x38a9('0x1'));var BPromise=require(_0x38a9('0x2'));var logger=require(_0x38a9('0x3'))(_0x38a9('0x4'));var attributes=require(_0x38a9('0x5'));var getUserApplications=function(_0xb2ab71,_0x270693,_0x441f42){var _0x54ed76=0x1;var _0x1f50b5=[];var _0x15f809={'context':_0x38a9('0x6'),'type':_0x38a9('0x7'),'isApp':![]};var _0x12ef62={'exten':util['format'](_0x38a9('0x8'),_0xb2ab71[_0x38a9('0x9')],_0x441f42),'ChanSpyId':_0xb2ab71['id'],'UserId':_0x270693['id']};_0x1f50b5['push'](_['merge']({'app':_0x38a9('0xa'),'appdata':util[_0x38a9('0xb')]('CDR(type)=%s','chanspy'),'priority':_0x54ed76++},_0x15f809,_0x12ef62));if(_0xb2ab71[_0x38a9('0xc')]){_0x1f50b5[_0x38a9('0xd')](_[_0x38a9('0xe')]({'app':'MixMonitor','appdata':util['format']('${UNIQUEID}.%s,ab',_0xb2ab71['recordingFormat']),'priority':_0x54ed76++},_0x15f809,_0x12ef62));}if(_0xb2ab71['auth']){_0x1f50b5[_0x38a9('0xd')](_[_0x38a9('0xe')]({'app':_0x38a9('0xf'),'appdata':_0xb2ab71[_0x38a9('0x10')],'priority':_0x54ed76++},_0x15f809,_0x12ef62));}_0x1f50b5['push'](_['merge']({'app':_0x38a9('0x11'),'appdata':util['format'](_0x38a9('0x12'),_0x270693[_0x38a9('0x13')],_0xb2ab71[_0x38a9('0x14')]?_0xb2ab71['options']['join'](''):''),'priority':_0x54ed76++},_0x15f809,_0x12ef62));if(_0xb2ab71[_0x38a9('0xc')]){_0x1f50b5['push'](_[_0x38a9('0xe')]({'app':_0x38a9('0x15'),'priority':_0x54ed76++},_0x15f809,_0x12ef62));}return _0x1f50b5;};var getChanSpyApplications=function(_0x5ef384,_0x33c7a6){var _0x369368=[];for(var _0x14cc52=0x0,_0x1d3cf6=0x1;_0x14cc52<_0x33c7a6[_0x38a9('0x16')];_0x14cc52++,_0x1d3cf6=0x1){var _0x53e05c=getUserApplications(_0x5ef384,_0x33c7a6[_0x14cc52],_0x33c7a6[_0x14cc52][_0x38a9('0x17')]);var _0x22bbf6=getUserApplications(_0x5ef384,_0x33c7a6[_0x14cc52],_0x33c7a6[_0x14cc52][_0x38a9('0x13')]);_0x369368=_0x369368['concat'](_0x53e05c,_0x22bbf6);}return _0x369368;};var getChanSpyPromise=function(_0x4144ec,_0x5be966){return new BPromise(function(_0x4bc1bc,_0x36b470){return _0x4144ec[_0x38a9('0x18')][_0x38a9('0x19')]({'attributes':['id',_0x38a9('0x13'),_0x38a9('0x17')],'where':{'role':_0x38a9('0x1a'),'chanspy':!![]},'raw':!![]})[_0x38a9('0x1b')](function(_0x25ae55){if(_0x25ae55){return _0x4bc1bc(getChanSpyApplications(_0x5be966,_0x25ae55));}return _0x4bc1bc([]);})['catch'](function(_0x4399b9){_0x36b470(_0x4399b9);});});};module[_0x38a9('0x1c')]=function(_0x4a8fce,_0x5c7b4a){var _0x45647d=_0x4a8fce[_0x38a9('0x1d')];return _0x4a8fce[_0x38a9('0x1e')](_0x38a9('0x1f'),attributes,{'tableName':_0x38a9('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3448d1,_0x57e894,_0x295047){return getChanSpyPromise(_0x45647d,_0x3448d1)[_0x38a9('0x1b')](function(_0x207f30){if(_0x207f30&&_0x207f30['length']){return _0x45647d[_0x38a9('0x21')]['bulkCreate'](_0x207f30);}})['then'](function(){_0x295047();})[_0x38a9('0x22')](function(_0x30cb68){_0x295047(_0x30cb68);});},'afterUpdate':function(_0x545dbd,_0x34f2d4,_0x3dc5c8){return _0x45647d['VoiceExtension'][_0x38a9('0x23')]({'where':{'ChanSpyId':_0x545dbd['id']}})[_0x38a9('0x1b')](function(){return getChanSpyPromise(_0x45647d,_0x545dbd);})[_0x38a9('0x1b')](function(_0x2dfcc7){if(_0x2dfcc7&&_0x2dfcc7[_0x38a9('0x16')]){return _0x45647d[_0x38a9('0x21')][_0x38a9('0x24')](_0x2dfcc7);}})[_0x38a9('0x1b')](function(){_0x3dc5c8();})[_0x38a9('0x22')](function(_0xafd902){_0x3dc5c8(_0xafd902);});},'afterDestroy':function(_0x3106c3,_0x40854c,_0x244092){return _0x45647d[_0x38a9('0x21')][_0x38a9('0x23')]({'where':{'ChanSpyId':_0x3106c3['id']}})['then'](function(){_0x244092();})['catch'](function(_0x52019b){_0x244092(_0x52019b);});}}});};
\ No newline at end of file
index 2bb9507..8cf4a8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8caf=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','request','info','VoiceChanSpy,\x20%s,\x20%s','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0x4b87a3,_0x3a698c){var _0x334112=function(_0x3e8fb0){while(--_0x3e8fb0){_0x4b87a3['push'](_0x4b87a3['shift']());}};_0x334112(++_0x3a698c);}(_0x8caf,0x16f));var _0xf8ca=function(_0x3185ad,_0x5e5ca2){_0x3185ad=_0x3185ad-0x0;var _0x4f77fb=_0x8caf[_0x3185ad];return _0x4f77fb;};'use strict';var _=require(_0xf8ca('0x0'));var util=require(_0xf8ca('0x1'));var moment=require('moment');var BPromise=require(_0xf8ca('0x2'));var rs=require(_0xf8ca('0x3'));var fs=require('fs');var db=require(_0xf8ca('0x4'))['db'];var utils=require(_0xf8ca('0x5'));var logger=require(_0xf8ca('0x6'))(_0xf8ca('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ebd7e,_0x51d92f,_0xdaf0ac){return new BPromise(function(_0x3faec9,_0x28625e){return client[_0xf8ca('0x8')](_0x1ebd7e,_0xdaf0ac)['then'](function(_0x13c556){logger[_0xf8ca('0x9')](_0xf8ca('0xa'),_0x51d92f,'request\x20sent');logger['debug'](_0xf8ca('0xb'),_0x51d92f,'request\x20sent',JSON[_0xf8ca('0xc')](_0x13c556));if(_0x13c556[_0xf8ca('0xd')]){if(_0x13c556[_0xf8ca('0xd')][_0xf8ca('0xe')]===0x1f4){logger['error'](_0xf8ca('0xa'),_0x51d92f,_0x13c556[_0xf8ca('0xd')][_0xf8ca('0xf')]);return _0x28625e(_0x13c556[_0xf8ca('0xd')]['message']);}logger[_0xf8ca('0xd')](_0xf8ca('0xa'),_0x51d92f,_0x13c556[_0xf8ca('0xd')][_0xf8ca('0xf')]);return _0x3faec9(_0x13c556[_0xf8ca('0xd')]['message']);}else{logger[_0xf8ca('0x9')](_0xf8ca('0xa'),_0x51d92f,'request\x20sent');_0x3faec9(_0x13c556['result']['message']);}})['catch'](function(_0x277ccc){logger[_0xf8ca('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x51d92f,_0x277ccc);_0x28625e(_0x277ccc);});});}
\ No newline at end of file
+var _0x4489=['../../mysqldb','../../config/utils','http','request','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','randomstring'];(function(_0x3594e7,_0x1c4a9f){var _0xd7d9de=function(_0x3ad7de){while(--_0x3ad7de){_0x3594e7['push'](_0x3594e7['shift']());}};_0xd7d9de(++_0x1c4a9f);}(_0x4489,0x164));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9448('0x0'));var util=require(_0x9448('0x1'));var moment=require('moment');var BPromise=require(_0x9448('0x2'));var rs=require(_0x9448('0x3'));var fs=require('fs');var db=require(_0x9448('0x4'))['db'];var utils=require(_0x9448('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9448('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x59f0d7,_0x302cae,_0x4b4a23){return new BPromise(function(_0x46ea5c,_0x3996a1){return client[_0x9448('0x7')](_0x59f0d7,_0x4b4a23)['then'](function(_0x4ff5b9){logger['info'](_0x9448('0x8'),_0x302cae,_0x9448('0x9'));logger[_0x9448('0xa')](_0x9448('0xb'),_0x302cae,_0x9448('0x9'),JSON['stringify'](_0x4ff5b9));if(_0x4ff5b9[_0x9448('0xc')]){if(_0x4ff5b9[_0x9448('0xc')][_0x9448('0xd')]===0x1f4){logger[_0x9448('0xc')](_0x9448('0x8'),_0x302cae,_0x4ff5b9[_0x9448('0xc')][_0x9448('0xe')]);return _0x3996a1(_0x4ff5b9[_0x9448('0xc')]['message']);}logger[_0x9448('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x302cae,_0x4ff5b9[_0x9448('0xc')][_0x9448('0xe')]);return _0x46ea5c(_0x4ff5b9['error'][_0x9448('0xe')]);}else{logger[_0x9448('0xf')](_0x9448('0x8'),_0x302cae,_0x9448('0x9'));_0x46ea5c(_0x4ff5b9[_0x9448('0x10')][_0x9448('0xe')]);}})[_0x9448('0x11')](function(_0x9b9fd3){logger['error'](_0x9448('0x8'),_0x302cae,_0x9b9fd3);_0x3996a1(_0x9b9fd3);});});}
\ No newline at end of file
index 412ac35..e6ad595 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13cb=['create','put','update','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x4a1a33,_0x71a086){var _0x57301c=function(_0x567f12){while(--_0x567f12){_0x4a1a33['push'](_0x4a1a33['shift']());}};_0x57301c(++_0x71a086);}(_0x13cb,0x15b));var _0xb13c=function(_0x5c4139,_0x12479e){_0x5c4139=_0x5c4139-0x0;var _0x5df4b6=_0x13cb[_0x5c4139];return _0x5df4b6;};'use strict';var multer=require(_0xb13c('0x0'));var util=require(_0xb13c('0x1'));var path=require(_0xb13c('0x2'));var express=require(_0xb13c('0x3'));var router=express[_0xb13c('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb13c('0x5'));var config=require(_0xb13c('0x6'));var controller=require(_0xb13c('0x7'));router['get']('/',auth[_0xb13c('0x8')](),controller[_0xb13c('0x9')]);router[_0xb13c('0xa')](_0xb13c('0xb'),auth[_0xb13c('0x8')](),controller[_0xb13c('0xc')]);router[_0xb13c('0xd')]('/',auth[_0xb13c('0x8')](),controller[_0xb13c('0xe')]);router[_0xb13c('0xf')]('/:id',auth[_0xb13c('0x8')](),controller[_0xb13c('0x10')]);router['delete'](_0xb13c('0xb'),auth['isAuthenticated'](),controller[_0xb13c('0x11')]);module[_0xb13c('0x12')]=router;
\ No newline at end of file
+var _0xcced=['delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','/:id','show','create','put','update'];(function(_0x535ed2,_0x4470bc){var _0x1e6d25=function(_0x1fc30d){while(--_0x1fc30d){_0x535ed2['push'](_0x535ed2['shift']());}};_0x1e6d25(++_0x4470bc);}(_0xcced,0xad));var _0xdcce=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0xcced[_0x3a78a0];return _0x48e917;};'use strict';var multer=require(_0xdcce('0x0'));var util=require(_0xdcce('0x1'));var path=require(_0xdcce('0x2'));var express=require('express');var router=express[_0xdcce('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xdcce('0x4'));var config=require(_0xdcce('0x5'));var controller=require(_0xdcce('0x6'));router[_0xdcce('0x7')]('/',auth[_0xdcce('0x8')](),controller['index']);router[_0xdcce('0x7')](_0xdcce('0x9'),auth[_0xdcce('0x8')](),controller[_0xdcce('0xa')]);router['post']('/',auth[_0xdcce('0x8')](),controller[_0xdcce('0xb')]);router[_0xdcce('0xc')](_0xdcce('0x9'),auth[_0xdcce('0x8')](),controller[_0xdcce('0xd')]);router[_0xdcce('0xe')](_0xdcce('0x9'),auth[_0xdcce('0x8')](),controller[_0xdcce('0xf')]);module[_0xdcce('0x10')]=router;
\ No newline at end of file
index 7c3a0e3..8b18c21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc393=['exports','STRING','name','BOOLEAN'];(function(_0x3bcd57,_0x56f5cd){var _0xf13a0b=function(_0x3ed8f2){while(--_0x3ed8f2){_0x3bcd57['push'](_0x3bcd57['shift']());}};_0xf13a0b(++_0x56f5cd);}(_0xc393,0x9c));var _0x3c39=function(_0x38e247,_0x2cd7b5){_0x38e247=_0x38e247-0x0;var _0x1be41b=_0xc393[_0x38e247];return _0x1be41b;};'use strict';var Sequelize=require('sequelize');module[_0x3c39('0x0')]={'name':{'type':Sequelize[_0x3c39('0x1')],'unique':_0x3c39('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x3c39('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x80f5=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x80f5,0x1ce));var _0x580f=function(_0x3a0f77,_0x39f605){_0x3a0f77=_0x3a0f77-0x0;var _0x54fd0c=_0x80f5[_0x3a0f77];return _0x54fd0c;};'use strict';var Sequelize=require(_0x580f('0x0'));module[_0x580f('0x1')]={'name':{'type':Sequelize[_0x580f('0x2')],'unique':_0x580f('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x580f('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 80b6f65..89d48e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe952=['day','merge','filter','map','options','count','include','findAll','rows','show','params','intersection','find','create','body','readFileSync','join','utf8','render','server/files/templates/context.ejs','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','root','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','lodash','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../mysqldb','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','index','VoiceContext','rawAttributes','query','dateStart','dateEnd','keys','filters','model','attributes','fields','length','hasOwnProperty','sort','where','add'];(function(_0x5cf574,_0x23caf9){var _0x47bc58=function(_0x5c67db){while(--_0x5c67db){_0x5cf574['push'](_0x5cf574['shift']());}};_0x47bc58(++_0x23caf9);}(_0xe952,0x168));var _0x2e95=function(_0xda35a5,_0x1839b0){_0xda35a5=_0xda35a5-0x0;var _0x83b6f4=_0xe952[_0xda35a5];return _0x83b6f4;};'use strict';var pdf=require(_0x2e95('0x0'));var emlformat=require(_0x2e95('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2e95('0x2'));var jsonpatch=require(_0x2e95('0x3'));var rp=require(_0x2e95('0x4'));var moment=require('moment');var BPromise=require(_0x2e95('0x5'));var Mustache=require(_0x2e95('0x6'));var util=require(_0x2e95('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2e95('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2e95('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2e95('0xa'));var toCsv=require(_0x2e95('0x8'));var querystring=require(_0x2e95('0xb'));var Papa=require(_0x2e95('0xc'));var qs=require(_0x2e95('0xd'));var logger=require(_0x2e95('0xe'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x2e95('0xf'))['db'];var jayson=require(_0x2e95('0x10'));var client=jayson[_0x2e95('0x11')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17e427,_0x935029,_0x19110c,_0x5b2912){return new BPromise(function(_0x28b5b0,_0x40bf2f){var _0xd7c1fc=_0x5b2912||client;return _0xd7c1fc[_0x2e95('0x12')](_0x17e427,_0x19110c)[_0x2e95('0x13')](function(_0x640c96){logger[_0x2e95('0x14')](_0x2e95('0x15'),_0x935029,_0x2e95('0x16'));logger[_0x2e95('0x17')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x935029,'request\x20sent',JSON[_0x2e95('0x18')](_0x640c96));if(_0x640c96['error']){if(_0x640c96[_0x2e95('0x19')]['code']===0x1f4){logger[_0x2e95('0x19')]('VoiceContext,\x20%s,\x20%s',_0x935029,_0x640c96[_0x2e95('0x19')]['message']);return _0x40bf2f(_0x640c96['error'][_0x2e95('0x1a')]);}logger[_0x2e95('0x19')](_0x2e95('0x15'),_0x935029,_0x640c96['error'][_0x2e95('0x1a')]);return _0x28b5b0(_0x640c96['error'][_0x2e95('0x1a')]);}else{logger[_0x2e95('0x14')](_0x2e95('0x15'),_0x935029,_0x2e95('0x16'));_0x28b5b0(_0x640c96[_0x2e95('0x1b')][_0x2e95('0x1a')]);}})[_0x2e95('0x1c')](function(_0x2a5d7d){logger['error'](_0x2e95('0x15'),_0x935029,_0x2a5d7d);_0x40bf2f(_0x2a5d7d);});});}function respondWithStatusCode(_0x438dfd,_0x3bd49a){_0x3bd49a=_0x3bd49a||0xcc;return function(_0x4ead83){if(_0x4ead83){return _0x438dfd[_0x2e95('0x1d')](_0x3bd49a);}return _0x438dfd[_0x2e95('0x1e')](_0x3bd49a)[_0x2e95('0x1f')]();};}function respondWithResult(_0x66c93,_0x4cafc9){_0x4cafc9=_0x4cafc9||0xc8;return function(_0x5463cc){if(_0x5463cc){return _0x66c93[_0x2e95('0x1e')](_0x4cafc9)[_0x2e95('0x20')](_0x5463cc);}};}function respondWithFilteredResult(_0x387240,_0x355d93){return function(_0x63faeb){if(_0x63faeb){var _0x4c3c49=_0x63faeb['count'],_0x4204c0=_0x355d93['offset'],_0x3680c3=_0x355d93[_0x2e95('0x21')]+_0x355d93[_0x2e95('0x22')],_0x4da764;if(_0x3680c3>=_0x4c3c49){_0x3680c3=_0x4c3c49;_0x4da764=0xc8;}else{_0x4da764=0xce;}_0x387240[_0x2e95('0x1e')](_0x4da764);return _0x387240[_0x2e95('0x23')](_0x2e95('0x24'),_0x4204c0+'-'+_0x3680c3+'/'+_0x4c3c49)[_0x2e95('0x20')](_0x63faeb);}return null;};}function patchUpdates(_0x121e42){return function(_0x1b3e1a){try{jsonpatch[_0x2e95('0x25')](_0x1b3e1a,_0x121e42,!![]);}catch(_0x247b53){return BPromise['reject'](_0x247b53);}return _0x1b3e1a[_0x2e95('0x26')]();};}function saveUpdates(_0x2dc496,_0x7190f){return function(_0x182812){if(_0x182812){return _0x182812[_0x2e95('0x27')](_0x2dc496)['then'](function(_0x41ff39){return _0x41ff39;});}return null;};}function removeEntity(_0x2d4fcd,_0x1073ca){return function(_0x48db40){if(_0x48db40){return _0x48db40[_0x2e95('0x28')]()[_0x2e95('0x13')](function(){_0x2d4fcd['status'](0xcc)[_0x2e95('0x1f')]();});}};}function handleEntityNotFound(_0x3c3fa2,_0x52b699){return function(_0x4fcbe6){if(!_0x4fcbe6){_0x3c3fa2[_0x2e95('0x1d')](0x194);}return _0x4fcbe6;};}function handleError(_0x540134,_0xf5cb6f){_0xf5cb6f=_0xf5cb6f||0x1f4;return function(_0x162954){logger['error'](_0x162954[_0x2e95('0x29')]);if(_0x162954[_0x2e95('0x2a')]){delete _0x162954[_0x2e95('0x2a')];}_0x540134[_0x2e95('0x1e')](_0xf5cb6f)[_0x2e95('0x2b')](_0x162954);};}exports[_0x2e95('0x2c')]=function(_0x213183,_0x200b2c){var _0x444655={},_0x578c79={},_0x4e6e84={'count':0x0,'rows':[]};var _0xf8cfa3=db[_0x2e95('0x2d')][_0x2e95('0x2e')];_0x578c79['model']=_['keys'](_0xf8cfa3);var _0x2e18ce={'dateStart':_0x213183[_0x2e95('0x2f')][_0x2e95('0x30')],'dateEnd':_0x213183[_0x2e95('0x2f')][_0x2e95('0x31')]};delete _0x213183[_0x2e95('0x2f')]['dateStart'];delete _0x213183['query']['dateEnd'];_0x578c79[_0x2e95('0x2f')]=_[_0x2e95('0x32')](_0x213183['query']);_0x578c79[_0x2e95('0x33')]=_['intersection'](_0x578c79[_0x2e95('0x34')],_0x578c79[_0x2e95('0x2f')]);_0x444655[_0x2e95('0x35')]=_['intersection'](_0x578c79['model'],qs[_0x2e95('0x36')](_0x213183[_0x2e95('0x2f')][_0x2e95('0x36')]));_0x444655[_0x2e95('0x35')]=_0x444655[_0x2e95('0x35')][_0x2e95('0x37')]?_0x444655[_0x2e95('0x35')]:_0x578c79['model'];if(!_0x213183[_0x2e95('0x2f')][_0x2e95('0x38')]('nolimit')){_0x444655['limit']=qs['limit'](_0x213183[_0x2e95('0x2f')]['limit']);_0x444655[_0x2e95('0x21')]=qs[_0x2e95('0x21')](_0x213183['query'][_0x2e95('0x21')]);}_0x444655['order']=qs[_0x2e95('0x39')](_0x213183[_0x2e95('0x2f')]['sort']);_0x444655[_0x2e95('0x3a')]=qs['filters'](_['pick'](_0x213183[_0x2e95('0x2f')],_0x578c79[_0x2e95('0x33')]));if(_0x2e18ce['dateStart']){if(_0x2e18ce[_0x2e95('0x31')]){_0x2e18ce[_0x2e95('0x31')]=moment(_0x2e18ce['dateEnd'])[_0x2e95('0x3b')](0x1,_0x2e95('0x3c'));}else{_0x2e18ce['dateEnd']=moment(_0x2e18ce[_0x2e95('0x30')])[_0x2e95('0x3b')](0x1,_0x2e95('0x3c'));}_[_0x2e95('0x3d')](_0x444655[_0x2e95('0x3a')],{'createdAt':{'$gte':_0x2e18ce[_0x2e95('0x30')],'$lte':_0x2e18ce[_0x2e95('0x31')]}});}if(_0x213183[_0x2e95('0x2f')][_0x2e95('0x3e')]){_0x444655['where']=_['merge'](_0x444655[_0x2e95('0x3a')],{'$or':_[_0x2e95('0x3f')](_0x444655['attributes'],function(_0x5e0724){var _0x215cea={};_0x215cea[_0x5e0724]={'$like':'%'+_0x213183[_0x2e95('0x2f')][_0x2e95('0x3e')]+'%'};return _0x215cea;})});}_0x444655=_[_0x2e95('0x3d')]({},_0x444655,_0x213183[_0x2e95('0x40')]);var _0x36f3b2={'where':_0x444655[_0x2e95('0x3a')]};return db['VoiceContext']['count'](_0x36f3b2)[_0x2e95('0x13')](function(_0x4f2e7a){_0x4e6e84[_0x2e95('0x41')]=_0x4f2e7a;if(_0x213183[_0x2e95('0x2f')]['includeAll']){_0x444655[_0x2e95('0x42')]=[{'all':!![]}];}return db[_0x2e95('0x2d')][_0x2e95('0x43')](_0x444655);})['then'](function(_0x39ad68){_0x4e6e84[_0x2e95('0x44')]=_0x39ad68;return _0x4e6e84;})[_0x2e95('0x13')](respondWithFilteredResult(_0x200b2c,_0x444655))[_0x2e95('0x1c')](handleError(_0x200b2c,null));};exports[_0x2e95('0x45')]=function(_0x5ce75d,_0x1163d6){var _0x17df87={'raw':![],'where':{'id':_0x5ce75d[_0x2e95('0x46')]['id']}},_0x3ed934={};_0x3ed934['model']=_[_0x2e95('0x32')](db[_0x2e95('0x2d')][_0x2e95('0x2e')]);_0x3ed934[_0x2e95('0x2f')]=_[_0x2e95('0x32')](_0x5ce75d[_0x2e95('0x2f')]);_0x3ed934['filters']=_[_0x2e95('0x47')](_0x3ed934[_0x2e95('0x34')],_0x3ed934['query']);_0x17df87['attributes']=_['intersection'](_0x3ed934['model'],qs[_0x2e95('0x36')](_0x5ce75d['query'][_0x2e95('0x36')]));_0x17df87['attributes']=_0x17df87[_0x2e95('0x35')][_0x2e95('0x37')]?_0x17df87['attributes']:_0x3ed934['model'];if(_0x5ce75d[_0x2e95('0x2f')]['includeAll']){_0x17df87['include']=[{'all':!![]}];}_0x17df87=_['merge']({},_0x17df87,_0x5ce75d[_0x2e95('0x40')]);return db[_0x2e95('0x2d')][_0x2e95('0x48')](_0x17df87)[_0x2e95('0x13')](handleEntityNotFound(_0x1163d6,null))['then'](respondWithResult(_0x1163d6,null))['catch'](handleError(_0x1163d6,null));};exports[_0x2e95('0x49')]=function(_0x346d58,_0x3f77fc,_0x4d6575){var _0x5afd71;return db[_0x2e95('0x2d')][_0x2e95('0x49')](_0x346d58[_0x2e95('0x4a')],{'raw':!![]})[_0x2e95('0x13')](function(_0x541088){_0x5afd71=_0x541088;return db[_0x2e95('0x2d')][_0x2e95('0x43')]({'raw':!![]});})[_0x2e95('0x13')](function(_0x4cf597){var _0x4e543e=fs[_0x2e95('0x4b')](path[_0x2e95('0x4c')](config['root'],'server/files/templates/context.ejs'),_0x2e95('0x4d'));var _0x57c95e=ejs[_0x2e95('0x4e')](_0x4e543e,{'contexts':_0x4cf597||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x57c95e);})[_0x2e95('0x13')](function(){return respondWithRpcPromise('Reload',_0x2e95('0x49'),{'module':'chan_sip.so'});})['then'](function(){return _0x5afd71;})[_0x2e95('0x13')](respondWithResult(_0x3f77fc,0xc9))[_0x2e95('0x1c')](handleError(_0x3f77fc,null));};exports[_0x2e95('0x27')]=function(_0x1b75f6,_0x566e4d,_0x3eb5d7){var _0x1bda77;return db['VoiceContext'][_0x2e95('0x48')]({'where':{'id':_0x1b75f6[_0x2e95('0x46')]['id']}})[_0x2e95('0x13')](handleEntityNotFound(_0x566e4d,null))['then'](saveUpdates(_0x1b75f6['body'],null))[_0x2e95('0x13')](function(_0x4219b0){if(_0x4219b0){_0x1bda77=_0x4219b0;return db[_0x2e95('0x2d')][_0x2e95('0x43')]({'raw':!![]});}})[_0x2e95('0x13')](function(_0x3a5fc0){var _0x2d3942=fs['readFileSync'](path['join'](config['root'],_0x2e95('0x4f')),'utf8');var _0x5a9dac=ejs['render'](_0x2d3942,{'contexts':_0x3a5fc0||[]});fs[_0x2e95('0x50')](_0x2e95('0x51'),_0x5a9dac);})[_0x2e95('0x13')](function(){return respondWithRpcPromise('Reload',_0x2e95('0x27'),{'module':_0x2e95('0x52')});})[_0x2e95('0x13')](function(){return _0x1bda77;})[_0x2e95('0x13')](respondWithResult(_0x566e4d,null))[_0x2e95('0x1c')](handleError(_0x566e4d,null));};exports[_0x2e95('0x28')]=function(_0x655ef,_0xd768bd,_0x351859){var _0x30d7bd;return db[_0x2e95('0x2d')][_0x2e95('0x48')]({'where':{'id':_0x655ef[_0x2e95('0x46')]['id']}})[_0x2e95('0x13')](handleEntityNotFound(_0xd768bd,null))[_0x2e95('0x13')](removeEntity(_0xd768bd,null))['then'](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0x2e95('0x13')](function(_0x52201a){var _0x37d41b=fs[_0x2e95('0x4b')](path[_0x2e95('0x4c')](config[_0x2e95('0x53')],'server/files/templates/context.ejs'),_0x2e95('0x4d'));var _0x74a654=ejs[_0x2e95('0x4e')](_0x37d41b,{'contexts':_0x52201a});fs[_0x2e95('0x50')](_0x2e95('0x51'),_0x74a654);return respondWithRpcPromise('Reload',_0x2e95('0x28'),{'module':'chan_sip.so'});})[_0x2e95('0x1c')](handleError(_0xd768bd,null));};
\ No newline at end of file
+var _0xc9af=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','VoiceContext,\x20%s,\x20%s','result','catch','status','end','json','count','set','Content-Range','reject','save','update','destroy','sendStatus','stack','name','send','index','VoiceContext','rawAttributes','model','query','dateStart','dateEnd','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','add','day','merge','filter','map','includeAll','include','findAll','rows','show','params','keys','find','create','body','join','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','readFileSync','root','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path'];(function(_0x125dc0,_0x5c0450){var _0x462055=function(_0xe774e2){while(--_0xe774e2){_0x125dc0['push'](_0x125dc0['shift']());}};_0x462055(++_0x5c0450);}(_0xc9af,0x174));var _0xfc9a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc9af[_0x5d6456];return _0x4d66c1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfc9a('0x0'));var rimraf=require(_0xfc9a('0x1'));var zipdir=require(_0xfc9a('0x2'));var jsonpatch=require(_0xfc9a('0x3'));var rp=require('request-promise');var moment=require(_0xfc9a('0x4'));var BPromise=require(_0xfc9a('0x5'));var Mustache=require(_0xfc9a('0x6'));var util=require('util');var path=require(_0xfc9a('0x7'));var sox=require(_0xfc9a('0x8'));var csv=require(_0xfc9a('0x9'));var ejs=require(_0xfc9a('0xa'));var fs=require('fs');var _=require(_0xfc9a('0xb'));var squel=require(_0xfc9a('0xc'));var crypto=require(_0xfc9a('0xd'));var jsforce=require(_0xfc9a('0xe'));var deskjs=require(_0xfc9a('0xf'));var toCsv=require(_0xfc9a('0x9'));var querystring=require(_0xfc9a('0x10'));var Papa=require(_0xfc9a('0x11'));var qs=require(_0xfc9a('0x12'));var logger=require(_0xfc9a('0x13'))(_0xfc9a('0x14'));var utils=require(_0xfc9a('0x15'));var config=require('../../config/environment');var db=require(_0xfc9a('0x16'))['db'];var jayson=require(_0xfc9a('0x17'));var client=jayson[_0xfc9a('0x18')][_0xfc9a('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x4f0f29,_0x5c858b,_0x1f5cba,_0x3e96cb){return new BPromise(function(_0x48b58a,_0x43bcce){var _0x40c4e6=_0x3e96cb||client;return _0x40c4e6[_0xfc9a('0x1a')](_0x4f0f29,_0x1f5cba)[_0xfc9a('0x1b')](function(_0x582e64){logger['info']('VoiceContext,\x20%s,\x20%s',_0x5c858b,_0xfc9a('0x1c'));logger[_0xfc9a('0x1d')](_0xfc9a('0x1e'),_0x5c858b,_0xfc9a('0x1c'),JSON['stringify'](_0x582e64));if(_0x582e64['error']){if(_0x582e64[_0xfc9a('0x1f')][_0xfc9a('0x20')]===0x1f4){logger[_0xfc9a('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x5c858b,_0x582e64[_0xfc9a('0x1f')][_0xfc9a('0x21')]);return _0x43bcce(_0x582e64[_0xfc9a('0x1f')][_0xfc9a('0x21')]);}logger['error'](_0xfc9a('0x22'),_0x5c858b,_0x582e64[_0xfc9a('0x1f')][_0xfc9a('0x21')]);return _0x48b58a(_0x582e64['error']['message']);}else{logger['info'](_0xfc9a('0x22'),_0x5c858b,_0xfc9a('0x1c'));_0x48b58a(_0x582e64[_0xfc9a('0x23')][_0xfc9a('0x21')]);}})[_0xfc9a('0x24')](function(_0x247846){logger[_0xfc9a('0x1f')](_0xfc9a('0x22'),_0x5c858b,_0x247846);_0x43bcce(_0x247846);});});}function respondWithStatusCode(_0x38ed61,_0x3968f5){_0x3968f5=_0x3968f5||0xcc;return function(_0x4d3078){if(_0x4d3078){return _0x38ed61['sendStatus'](_0x3968f5);}return _0x38ed61[_0xfc9a('0x25')](_0x3968f5)[_0xfc9a('0x26')]();};}function respondWithResult(_0x3719cd,_0x2cb655){_0x2cb655=_0x2cb655||0xc8;return function(_0x2d617d){if(_0x2d617d){return _0x3719cd[_0xfc9a('0x25')](_0x2cb655)[_0xfc9a('0x27')](_0x2d617d);}};}function respondWithFilteredResult(_0x3d37ab,_0x13114f){return function(_0x2d12b3){if(_0x2d12b3){var _0x4516ff=_0x2d12b3[_0xfc9a('0x28')],_0x5af013=_0x13114f['offset'],_0x4586e7=_0x13114f['offset']+_0x13114f['limit'],_0x160e8c;if(_0x4586e7>=_0x4516ff){_0x4586e7=_0x4516ff;_0x160e8c=0xc8;}else{_0x160e8c=0xce;}_0x3d37ab[_0xfc9a('0x25')](_0x160e8c);return _0x3d37ab[_0xfc9a('0x29')](_0xfc9a('0x2a'),_0x5af013+'-'+_0x4586e7+'/'+_0x4516ff)[_0xfc9a('0x27')](_0x2d12b3);}return null;};}function patchUpdates(_0x301368){return function(_0x49aaf3){try{jsonpatch['apply'](_0x49aaf3,_0x301368,!![]);}catch(_0x503890){return BPromise[_0xfc9a('0x2b')](_0x503890);}return _0x49aaf3[_0xfc9a('0x2c')]();};}function saveUpdates(_0x3f3415,_0x27e902){return function(_0x5d29bb){if(_0x5d29bb){return _0x5d29bb[_0xfc9a('0x2d')](_0x3f3415)[_0xfc9a('0x1b')](function(_0x3dd6f3){return _0x3dd6f3;});}return null;};}function removeEntity(_0x599106,_0x1e46c2){return function(_0xa036dc){if(_0xa036dc){return _0xa036dc[_0xfc9a('0x2e')]()[_0xfc9a('0x1b')](function(){_0x599106[_0xfc9a('0x25')](0xcc)[_0xfc9a('0x26')]();});}};}function handleEntityNotFound(_0x518314,_0x40d4ba){return function(_0x1c246d){if(!_0x1c246d){_0x518314[_0xfc9a('0x2f')](0x194);}return _0x1c246d;};}function handleError(_0x799694,_0x588f2b){_0x588f2b=_0x588f2b||0x1f4;return function(_0x2fd1b4){logger['error'](_0x2fd1b4[_0xfc9a('0x30')]);if(_0x2fd1b4['name']){delete _0x2fd1b4[_0xfc9a('0x31')];}_0x799694['status'](_0x588f2b)[_0xfc9a('0x32')](_0x2fd1b4);};}exports[_0xfc9a('0x33')]=function(_0x4c5ad6,_0x2ef53a){var _0x12c827={},_0x4302b7={},_0x2889f9={'count':0x0,'rows':[]};var _0x44db1b=db[_0xfc9a('0x34')][_0xfc9a('0x35')];_0x4302b7[_0xfc9a('0x36')]=_['keys'](_0x44db1b);var _0x114543={'dateStart':_0x4c5ad6[_0xfc9a('0x37')][_0xfc9a('0x38')],'dateEnd':_0x4c5ad6[_0xfc9a('0x37')]['dateEnd']};delete _0x4c5ad6['query'][_0xfc9a('0x38')];delete _0x4c5ad6[_0xfc9a('0x37')][_0xfc9a('0x39')];_0x4302b7[_0xfc9a('0x37')]=_['keys'](_0x4c5ad6[_0xfc9a('0x37')]);_0x4302b7[_0xfc9a('0x3a')]=_[_0xfc9a('0x3b')](_0x4302b7[_0xfc9a('0x36')],_0x4302b7[_0xfc9a('0x37')]);_0x12c827['attributes']=_[_0xfc9a('0x3b')](_0x4302b7['model'],qs[_0xfc9a('0x3c')](_0x4c5ad6[_0xfc9a('0x37')]['fields']));_0x12c827[_0xfc9a('0x3d')]=_0x12c827['attributes'][_0xfc9a('0x3e')]?_0x12c827[_0xfc9a('0x3d')]:_0x4302b7[_0xfc9a('0x36')];if(!_0x4c5ad6[_0xfc9a('0x37')][_0xfc9a('0x3f')](_0xfc9a('0x40'))){_0x12c827[_0xfc9a('0x41')]=qs[_0xfc9a('0x41')](_0x4c5ad6[_0xfc9a('0x37')][_0xfc9a('0x41')]);_0x12c827['offset']=qs['offset'](_0x4c5ad6[_0xfc9a('0x37')][_0xfc9a('0x42')]);}_0x12c827[_0xfc9a('0x43')]=qs['sort'](_0x4c5ad6[_0xfc9a('0x37')][_0xfc9a('0x44')]);_0x12c827[_0xfc9a('0x45')]=qs[_0xfc9a('0x3a')](_['pick'](_0x4c5ad6[_0xfc9a('0x37')],_0x4302b7[_0xfc9a('0x3a')]));if(_0x114543[_0xfc9a('0x38')]){if(_0x114543['dateEnd']){_0x114543[_0xfc9a('0x39')]=moment(_0x114543[_0xfc9a('0x39')])[_0xfc9a('0x46')](0x1,_0xfc9a('0x47'));}else{_0x114543[_0xfc9a('0x39')]=moment(_0x114543['dateStart'])[_0xfc9a('0x46')](0x1,'day');}_[_0xfc9a('0x48')](_0x12c827[_0xfc9a('0x45')],{'createdAt':{'$gte':_0x114543[_0xfc9a('0x38')],'$lte':_0x114543[_0xfc9a('0x39')]}});}if(_0x4c5ad6['query'][_0xfc9a('0x49')]){_0x12c827[_0xfc9a('0x45')]=_[_0xfc9a('0x48')](_0x12c827['where'],{'$or':_[_0xfc9a('0x4a')](_0x12c827['attributes'],function(_0x5149fc){var _0x431ca8={};_0x431ca8[_0x5149fc]={'$like':'%'+_0x4c5ad6['query']['filter']+'%'};return _0x431ca8;})});}_0x12c827=_[_0xfc9a('0x48')]({},_0x12c827,_0x4c5ad6['options']);var _0x37a3cf={'where':_0x12c827[_0xfc9a('0x45')]};return db[_0xfc9a('0x34')][_0xfc9a('0x28')](_0x37a3cf)['then'](function(_0x345572){_0x2889f9['count']=_0x345572;if(_0x4c5ad6[_0xfc9a('0x37')][_0xfc9a('0x4b')]){_0x12c827[_0xfc9a('0x4c')]=[{'all':!![]}];}return db['VoiceContext'][_0xfc9a('0x4d')](_0x12c827);})['then'](function(_0x3c74ce){_0x2889f9[_0xfc9a('0x4e')]=_0x3c74ce;return _0x2889f9;})['then'](respondWithFilteredResult(_0x2ef53a,_0x12c827))['catch'](handleError(_0x2ef53a,null));};exports[_0xfc9a('0x4f')]=function(_0x39c6d7,_0x250d55){var _0x535a08={'raw':![],'where':{'id':_0x39c6d7[_0xfc9a('0x50')]['id']}},_0x18644a={};_0x18644a[_0xfc9a('0x36')]=_[_0xfc9a('0x51')](db[_0xfc9a('0x34')][_0xfc9a('0x35')]);_0x18644a['query']=_[_0xfc9a('0x51')](_0x39c6d7['query']);_0x18644a['filters']=_[_0xfc9a('0x3b')](_0x18644a['model'],_0x18644a[_0xfc9a('0x37')]);_0x535a08[_0xfc9a('0x3d')]=_[_0xfc9a('0x3b')](_0x18644a['model'],qs['fields'](_0x39c6d7['query']['fields']));_0x535a08[_0xfc9a('0x3d')]=_0x535a08[_0xfc9a('0x3d')][_0xfc9a('0x3e')]?_0x535a08[_0xfc9a('0x3d')]:_0x18644a[_0xfc9a('0x36')];if(_0x39c6d7[_0xfc9a('0x37')]['includeAll']){_0x535a08['include']=[{'all':!![]}];}_0x535a08=_[_0xfc9a('0x48')]({},_0x535a08,_0x39c6d7['options']);return db[_0xfc9a('0x34')][_0xfc9a('0x52')](_0x535a08)['then'](handleEntityNotFound(_0x250d55,null))[_0xfc9a('0x1b')](respondWithResult(_0x250d55,null))[_0xfc9a('0x24')](handleError(_0x250d55,null));};exports[_0xfc9a('0x53')]=function(_0x2e382e,_0x50ba0a,_0x542be3){var _0x28dce3;return db[_0xfc9a('0x34')]['create'](_0x2e382e[_0xfc9a('0x54')],{'raw':!![]})[_0xfc9a('0x1b')](function(_0x57e237){_0x28dce3=_0x57e237;return db[_0xfc9a('0x34')][_0xfc9a('0x4d')]({'raw':!![]});})[_0xfc9a('0x1b')](function(_0x578834){var _0x39f8a7=fs['readFileSync'](path[_0xfc9a('0x55')](config['root'],_0xfc9a('0x56')),_0xfc9a('0x57'));var _0x5e2f19=ejs[_0xfc9a('0x58')](_0x39f8a7,{'contexts':_0x578834||[]});fs[_0xfc9a('0x59')](_0xfc9a('0x5a'),_0x5e2f19);})['then'](function(){return respondWithRpcPromise(_0xfc9a('0x5b'),_0xfc9a('0x53'),{'module':'chan_sip.so'});})[_0xfc9a('0x1b')](function(){return _0x28dce3;})[_0xfc9a('0x1b')](respondWithResult(_0x50ba0a,0xc9))[_0xfc9a('0x24')](handleError(_0x50ba0a,null));};exports[_0xfc9a('0x2d')]=function(_0x5c0eb5,_0x2e7b61,_0x3787b9){var _0x34b2a5;return db[_0xfc9a('0x34')][_0xfc9a('0x52')]({'where':{'id':_0x5c0eb5[_0xfc9a('0x50')]['id']}})[_0xfc9a('0x1b')](handleEntityNotFound(_0x2e7b61,null))[_0xfc9a('0x1b')](saveUpdates(_0x5c0eb5[_0xfc9a('0x54')],null))[_0xfc9a('0x1b')](function(_0x24fd6b){if(_0x24fd6b){_0x34b2a5=_0x24fd6b;return db[_0xfc9a('0x34')][_0xfc9a('0x4d')]({'raw':!![]});}})[_0xfc9a('0x1b')](function(_0x19e7a7){var _0x31e605=fs[_0xfc9a('0x5c')](path[_0xfc9a('0x55')](config[_0xfc9a('0x5d')],'server/files/templates/context.ejs'),_0xfc9a('0x57'));var _0x33ab69=ejs[_0xfc9a('0x58')](_0x31e605,{'contexts':_0x19e7a7||[]});fs[_0xfc9a('0x59')](_0xfc9a('0x5a'),_0x33ab69);})[_0xfc9a('0x1b')](function(){return respondWithRpcPromise(_0xfc9a('0x5b'),_0xfc9a('0x2d'),{'module':_0xfc9a('0x5e')});})[_0xfc9a('0x1b')](function(){return _0x34b2a5;})[_0xfc9a('0x1b')](respondWithResult(_0x2e7b61,null))[_0xfc9a('0x24')](handleError(_0x2e7b61,null));};exports[_0xfc9a('0x2e')]=function(_0x29b8b0,_0x21efd8,_0x39fea0){var _0x488df0;return db[_0xfc9a('0x34')]['find']({'where':{'id':_0x29b8b0['params']['id']}})['then'](handleEntityNotFound(_0x21efd8,null))[_0xfc9a('0x1b')](removeEntity(_0x21efd8,null))[_0xfc9a('0x1b')](function(){return db['VoiceContext'][_0xfc9a('0x4d')]({'raw':!![]});})[_0xfc9a('0x1b')](function(_0x20eee1){var _0x5a0767=fs[_0xfc9a('0x5c')](path[_0xfc9a('0x55')](config['root'],_0xfc9a('0x56')),_0xfc9a('0x57'));var _0x452520=ejs[_0xfc9a('0x58')](_0x5a0767,{'contexts':_0x20eee1});fs[_0xfc9a('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x452520);return respondWithRpcPromise(_0xfc9a('0x5b'),_0xfc9a('0x2e'),{'module':_0xfc9a('0x5e')});})[_0xfc9a('0x24')](handleError(_0x21efd8,null));};
\ No newline at end of file
index aecef07..b08fd83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8add=['bluebird','request-promise','./voiceContext.attributes','exports','define','VoiceContext','lodash','util','../../config/logger','api','moment'];(function(_0x504f7b,_0x1ac4e0){var _0x2b0904=function(_0x28e51d){while(--_0x28e51d){_0x504f7b['push'](_0x504f7b['shift']());}};_0x2b0904(++_0x1ac4e0);}(_0x8add,0x13a));var _0xd8ad=function(_0x550053,_0x238d20){_0x550053=_0x550053-0x0;var _0x6620fe=_0x8add[_0x550053];return _0x6620fe;};'use strict';var _=require(_0xd8ad('0x0'));var util=require(_0xd8ad('0x1'));var logger=require(_0xd8ad('0x2'))(_0xd8ad('0x3'));var moment=require(_0xd8ad('0x4'));var BPromise=require(_0xd8ad('0x5'));var rp=require(_0xd8ad('0x6'));var attributes=require(_0xd8ad('0x7'));module[_0xd8ad('0x8')]=function(_0x288946,_0x52d122){return _0x288946[_0xd8ad('0x9')](_0xd8ad('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0396=['util','../../config/logger','api','request-promise','./voiceContext.attributes','define','VoiceContext'];(function(_0x3cd4e4,_0x24e1aa){var _0x1de0b0=function(_0x4d9b59){while(--_0x4d9b59){_0x3cd4e4['push'](_0x3cd4e4['shift']());}};_0x1de0b0(++_0x24e1aa);}(_0x0396,0x149));var _0x6039=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x0396[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0x6039('0x0'));var logger=require(_0x6039('0x1'))(_0x6039('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6039('0x3'));var attributes=require(_0x6039('0x4'));module['exports']=function(_0x2db7bb,_0x4ec0dd){return _0x2db7bb[_0x6039('0x5')](_0x6039('0x6'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9360b66..7d07303 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b6f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','randomstring'];(function(_0x3d2d6c,_0x4f26f7){var _0x1235ad=function(_0x39a182){while(--_0x39a182){_0x3d2d6c['push'](_0x3d2d6c['shift']());}};_0x1235ad(++_0x4f26f7);}(_0x4b6f,0x176));var _0xf4b6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4b6f[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xf4b6('0x0'));var util=require(_0xf4b6('0x1'));var moment=require(_0xf4b6('0x2'));var BPromise=require('bluebird');var rs=require(_0xf4b6('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf4b6('0x4'))(_0xf4b6('0x5'));var config=require(_0xf4b6('0x6'));var jayson=require(_0xf4b6('0x7'));var client=jayson[_0xf4b6('0x8')][_0xf4b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3945de,_0x5e9c7d,_0x16b310){return new BPromise(function(_0x44a4a1,_0x4b0dee){return client[_0xf4b6('0xa')](_0x3945de,_0x16b310)[_0xf4b6('0xb')](function(_0x72cc57){logger[_0xf4b6('0xc')](_0xf4b6('0xd'),_0x5e9c7d,'request\x20sent');logger[_0xf4b6('0xe')](_0xf4b6('0xf'),_0x5e9c7d,_0xf4b6('0x10'),JSON['stringify'](_0x72cc57));if(_0x72cc57[_0xf4b6('0x11')]){if(_0x72cc57[_0xf4b6('0x11')]['code']===0x1f4){logger['error'](_0xf4b6('0xd'),_0x5e9c7d,_0x72cc57[_0xf4b6('0x11')]['message']);return _0x4b0dee(_0x72cc57[_0xf4b6('0x11')][_0xf4b6('0x12')]);}logger[_0xf4b6('0x11')](_0xf4b6('0xd'),_0x5e9c7d,_0x72cc57[_0xf4b6('0x11')][_0xf4b6('0x12')]);return _0x44a4a1(_0x72cc57['error'][_0xf4b6('0x12')]);}else{logger['info'](_0xf4b6('0xd'),_0x5e9c7d,_0xf4b6('0x10'));_0x44a4a1(_0x72cc57[_0xf4b6('0x13')][_0xf4b6('0x12')]);}})[_0xf4b6('0x14')](function(_0x490f43){logger['error']('VoiceContext,\x20%s,\x20%s',_0x5e9c7d,_0x490f43);_0x4b0dee(_0x490f43);});});}
\ No newline at end of file
+var _0xb375=['debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent'];(function(_0x17614a,_0xe2f125){var _0xbe5e49=function(_0x5770dc){while(--_0x5770dc){_0x17614a['push'](_0x17614a['shift']());}};_0xbe5e49(++_0xe2f125);}(_0xb375,0x1be));var _0x5b37=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb375[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x5b37('0x0'));var util=require('util');var moment=require(_0x5b37('0x1'));var BPromise=require(_0x5b37('0x2'));var rs=require(_0x5b37('0x3'));var fs=require('fs');var db=require(_0x5b37('0x4'))['db'];var utils=require(_0x5b37('0x5'));var logger=require(_0x5b37('0x6'))(_0x5b37('0x7'));var config=require(_0x5b37('0x8'));var jayson=require(_0x5b37('0x9'));var client=jayson['client'][_0x5b37('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e9a85,_0x52eab0,_0x4e8240){return new BPromise(function(_0x49a296,_0x41f1fb){return client[_0x5b37('0xb')](_0x2e9a85,_0x4e8240)[_0x5b37('0xc')](function(_0xb7974a){logger[_0x5b37('0xd')](_0x5b37('0xe'),_0x52eab0,_0x5b37('0xf'));logger[_0x5b37('0x10')](_0x5b37('0x11'),_0x52eab0,_0x5b37('0xf'),JSON['stringify'](_0xb7974a));if(_0xb7974a[_0x5b37('0x12')]){if(_0xb7974a[_0x5b37('0x12')]['code']===0x1f4){logger[_0x5b37('0x12')](_0x5b37('0xe'),_0x52eab0,_0xb7974a[_0x5b37('0x12')]['message']);return _0x41f1fb(_0xb7974a[_0x5b37('0x12')][_0x5b37('0x13')]);}logger[_0x5b37('0x12')]('VoiceContext,\x20%s,\x20%s',_0x52eab0,_0xb7974a[_0x5b37('0x12')][_0x5b37('0x13')]);return _0x49a296(_0xb7974a[_0x5b37('0x12')][_0x5b37('0x13')]);}else{logger[_0x5b37('0xd')](_0x5b37('0xe'),_0x52eab0,_0x5b37('0xf'));_0x49a296(_0xb7974a[_0x5b37('0x14')][_0x5b37('0x13')]);}})[_0x5b37('0x15')](function(_0x591526){logger[_0x5b37('0x12')]('VoiceContext,\x20%s,\x20%s',_0x52eab0,_0x591526);_0x41f1fb(_0x591526);});});}
\ No newline at end of file
index 485a135..eb2921c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['/describe','describe','/:id','show','create','put','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x496bba,_0x4a7198){var _0x18bb87=function(_0x4c69ee){while(--_0x4c69ee){_0x496bba['push'](_0x496bba['shift']());}};_0x18bb87(++_0x4a7198);}(_0x5f2f,0x73));var _0xf5f2=function(_0x260088,_0x4cb751){_0x260088=_0x260088-0x0;var _0x1c25e8=_0x5f2f[_0x260088];return _0x1c25e8;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var express=require(_0xf5f2('0x3'));var router=express[_0xf5f2('0x4')]();var auth=require(_0xf5f2('0x5'));var interaction=require(_0xf5f2('0x6'));var config=require(_0xf5f2('0x7'));var controller=require('./voiceDialReport.controller');router['get']('/',auth[_0xf5f2('0x8')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth[_0xf5f2('0x8')](),controller[_0xf5f2('0xc')]);router['get'](_0xf5f2('0xd'),auth[_0xf5f2('0x8')](),controller[_0xf5f2('0xe')]);router['post']('/',auth[_0xf5f2('0x8')](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')]('/:id',auth[_0xf5f2('0x8')](),controller['update']);router['delete'](_0xf5f2('0xd'),auth[_0xf5f2('0x8')](),controller['destroy']);module[_0xf5f2('0x11')]=router;
\ No newline at end of file
+var _0x7a54=['/describe','describe','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index'];(function(_0x567fc9,_0xc44bc7){var _0x407a7f=function(_0x4daea3){while(--_0x4daea3){_0x567fc9['push'](_0x567fc9['shift']());}};_0x407a7f(++_0xc44bc7);}(_0x7a54,0x106));var _0x47a5=function(_0x46fb63,_0x237d22){_0x46fb63=_0x46fb63-0x0;var _0x3654ae=_0x7a54[_0x46fb63];return _0x3654ae;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var express=require('express');var router=express[_0x47a5('0x3')]();var auth=require(_0x47a5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x47a5('0x5'));var controller=require(_0x47a5('0x6'));router[_0x47a5('0x7')]('/',auth[_0x47a5('0x8')](),controller[_0x47a5('0x9')]);router['get'](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router[_0x47a5('0x7')]('/:id',auth[_0x47a5('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x47a5('0xc')]);router[_0x47a5('0xd')]('/:id',auth[_0x47a5('0x8')](),controller['update']);router['delete'](_0x47a5('0xe'),auth[_0x47a5('0x8')](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router;
\ No newline at end of file
index 6848d82..631da18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf59=['sequelize','exports','STRING','INTEGER','DATE'];(function(_0x3fe4f3,_0x53354f){var _0x214f39=function(_0x255c8c){while(--_0x255c8c){_0x3fe4f3['push'](_0x3fe4f3['shift']());}};_0x214f39(++_0x53354f);}(_0xaf59,0xdc));var _0x9af5=function(_0x40927b,_0xf9b0a0){_0x40927b=_0x40927b-0x0;var _0x2635e8=_0xaf59[_0x40927b];return _0x2635e8;};'use strict';var Sequelize=require(_0x9af5('0x0'));module[_0x9af5('0x1')]={'privilege':{'type':Sequelize[_0x9af5('0x2')]},'channel':{'type':Sequelize[_0x9af5('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x9af5('0x2')]},'calleridnum':{'type':Sequelize[_0x9af5('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x9af5('0x2')]},'connectedlinename':{'type':Sequelize[_0x9af5('0x2')]},'language':{'type':Sequelize[_0x9af5('0x2')]},'accountcode':{'type':Sequelize[_0x9af5('0x2')]},'context':{'type':Sequelize[_0x9af5('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9af5('0x3')]},'uniqueid':{'type':Sequelize[_0x9af5('0x2')]},'linkedid':{'type':Sequelize[_0x9af5('0x2')]},'destchannel':{'type':Sequelize[_0x9af5('0x2')]},'destchannelstate':{'type':Sequelize[_0x9af5('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x9af5('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x9af5('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x9af5('0x2')]},'destaccountcode':{'type':Sequelize[_0x9af5('0x2')]},'destcontext':{'type':Sequelize[_0x9af5('0x2')]},'destexten':{'type':Sequelize[_0x9af5('0x2')]},'destpriority':{'type':Sequelize[_0x9af5('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x9af5('0x2')]},'dialstring':{'type':Sequelize[_0x9af5('0x2')]},'dialstatus':{'type':Sequelize[_0x9af5('0x2')]},'starttime':{'type':Sequelize[_0x9af5('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x9af5('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x9af5('0x3')]},'duration':{'type':Sequelize[_0x9af5('0x3')]},'holdtime':{'type':Sequelize[_0x9af5('0x3')]},'billableseconds':{'type':Sequelize[_0x9af5('0x3')]}};
\ No newline at end of file
+var _0x6636=['sequelize','STRING','INTEGER','DATE'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6636,0x1d4));var _0x6663=function(_0x38d90e,_0x1859b4){_0x38d90e=_0x38d90e-0x0;var _0x225bf1=_0x6636[_0x38d90e];return _0x225bf1;};'use strict';var Sequelize=require(_0x6663('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x6663('0x1')]},'channel':{'type':Sequelize[_0x6663('0x1')]},'channelstate':{'type':Sequelize[_0x6663('0x2')]},'channelstatedesc':{'type':Sequelize[_0x6663('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x6663('0x1')]},'connectedlinename':{'type':Sequelize[_0x6663('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x6663('0x1')]},'context':{'type':Sequelize[_0x6663('0x1')]},'exten':{'type':Sequelize[_0x6663('0x1')]},'priority':{'type':Sequelize[_0x6663('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x6663('0x1')]},'destchannel':{'type':Sequelize[_0x6663('0x1')]},'destchannelstate':{'type':Sequelize[_0x6663('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x6663('0x1')]},'destcalleridnum':{'type':Sequelize[_0x6663('0x1')]},'destcalleridname':{'type':Sequelize[_0x6663('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x6663('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x6663('0x1')]},'destexten':{'type':Sequelize[_0x6663('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x6663('0x1')]},'dialstatus':{'type':Sequelize[_0x6663('0x1')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x6663('0x3')]},'endtime':{'type':Sequelize[_0x6663('0x3')]},'lastevent':{'type':Sequelize[_0x6663('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x6663('0x2')]},'duration':{'type':Sequelize[_0x6663('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x6663('0x2')]}};
\ No newline at end of file
index 87b246c..521dfea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7cc=['desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','VoiceDialReport','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','add','day','merge','filter','map','count','includeAll','include','findAll','rows','catch','show','params','length','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','crypto','jsforce'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb7cc,0x113));var _0xcb7c=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xb7cc[_0x46698a];return _0x356db0;};'use strict';var pdf=require(_0xcb7c('0x0'));var emlformat=require(_0xcb7c('0x1'));var rimraf=require(_0xcb7c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcb7c('0x3'));var rp=require(_0xcb7c('0x4'));var moment=require(_0xcb7c('0x5'));var BPromise=require(_0xcb7c('0x6'));var Mustache=require('mustache');var util=require(_0xcb7c('0x7'));var path=require(_0xcb7c('0x8'));var sox=require(_0xcb7c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xcb7c('0xa'));var squel=require('squel');var crypto=require(_0xcb7c('0xb'));var jsforce=require(_0xcb7c('0xc'));var deskjs=require(_0xcb7c('0xd'));var toCsv=require(_0xcb7c('0xe'));var querystring=require(_0xcb7c('0xf'));var Papa=require(_0xcb7c('0x10'));var qs=require(_0xcb7c('0x11'));var logger=require('../../config/logger')(_0xcb7c('0x12'));var utils=require(_0xcb7c('0x13'));var config=require(_0xcb7c('0x14'));var db=require(_0xcb7c('0x15'))['db'];function respondWithStatusCode(_0x4c3307,_0x1225eb){_0x1225eb=_0x1225eb||0xcc;return function(_0x56c500){if(_0x56c500){return _0x4c3307[_0xcb7c('0x16')](_0x1225eb);}return _0x4c3307[_0xcb7c('0x17')](_0x1225eb)[_0xcb7c('0x18')]();};}function respondWithResult(_0x3662df,_0x418513){_0x418513=_0x418513||0xc8;return function(_0x3eb6af){if(_0x3eb6af){return _0x3662df[_0xcb7c('0x17')](_0x418513)[_0xcb7c('0x19')](_0x3eb6af);}};}function respondWithFilteredResult(_0x50c008,_0x485d9){return function(_0x4dc0fa){if(_0x4dc0fa){var _0x53a21a=_0x4dc0fa['count'],_0x3587af=_0x485d9[_0xcb7c('0x1a')],_0x5ee297=_0x485d9[_0xcb7c('0x1a')]+_0x485d9[_0xcb7c('0x1b')],_0x5535fb;if(_0x5ee297>=_0x53a21a){_0x5ee297=_0x53a21a;_0x5535fb=0xc8;}else{_0x5535fb=0xce;}_0x50c008[_0xcb7c('0x17')](_0x5535fb);return _0x50c008['set'](_0xcb7c('0x1c'),_0x3587af+'-'+_0x5ee297+'/'+_0x53a21a)[_0xcb7c('0x19')](_0x4dc0fa);}return null;};}function patchUpdates(_0x8c5407){return function(_0x3afb5a){try{jsonpatch[_0xcb7c('0x1d')](_0x3afb5a,_0x8c5407,!![]);}catch(_0x4aa49d){return BPromise[_0xcb7c('0x1e')](_0x4aa49d);}return _0x3afb5a[_0xcb7c('0x1f')]();};}function saveUpdates(_0x28964b,_0x322742){return function(_0x352115){if(_0x352115){return _0x352115[_0xcb7c('0x20')](_0x28964b)[_0xcb7c('0x21')](function(_0xd42863){return _0xd42863;});}return null;};}function removeEntity(_0x3930b9,_0xec226a){return function(_0x3c7e18){if(_0x3c7e18){return _0x3c7e18[_0xcb7c('0x22')]()[_0xcb7c('0x21')](function(){_0x3930b9['status'](0xcc)[_0xcb7c('0x18')]();});}};}function handleEntityNotFound(_0x3c56b5,_0x329281){return function(_0x41c3ee){if(!_0x41c3ee){_0x3c56b5[_0xcb7c('0x16')](0x194);}return _0x41c3ee;};}function handleError(_0x55e01d,_0x2ae98e){_0x2ae98e=_0x2ae98e||0x1f4;return function(_0xe51042){logger[_0xcb7c('0x23')](_0xe51042[_0xcb7c('0x24')]);if(_0xe51042[_0xcb7c('0x25')]){delete _0xe51042[_0xcb7c('0x25')];}_0x55e01d[_0xcb7c('0x17')](_0x2ae98e)['send'](_0xe51042);};}exports[_0xcb7c('0x26')]=function(_0x389eba,_0x11e5b7){var _0x459c5b={},_0xf61e08={},_0x2428ef={'count':0x0,'rows':[]};var _0x5eabdc=db[_0xcb7c('0x27')][_0xcb7c('0x28')];_0xf61e08[_0xcb7c('0x29')]=_[_0xcb7c('0x2a')](_0x5eabdc);var _0x3eb437={'dateStart':_0x389eba['query']['dateStart'],'dateEnd':_0x389eba[_0xcb7c('0x2b')]['dateEnd']};delete _0x389eba[_0xcb7c('0x2b')][_0xcb7c('0x2c')];delete _0x389eba[_0xcb7c('0x2b')][_0xcb7c('0x2d')];_0xf61e08[_0xcb7c('0x2b')]=_['keys'](_0x389eba['query']);_0xf61e08['filters']=_[_0xcb7c('0x2e')](_0xf61e08['model'],_0xf61e08[_0xcb7c('0x2b')]);_0x459c5b['attributes']=_[_0xcb7c('0x2e')](_0xf61e08[_0xcb7c('0x29')],qs[_0xcb7c('0x2f')](_0x389eba[_0xcb7c('0x2b')][_0xcb7c('0x2f')]));_0x459c5b[_0xcb7c('0x30')]=_0x459c5b[_0xcb7c('0x30')]['length']?_0x459c5b[_0xcb7c('0x30')]:_0xf61e08[_0xcb7c('0x29')];if(!_0x389eba['query'][_0xcb7c('0x31')](_0xcb7c('0x32'))){_0x459c5b[_0xcb7c('0x1b')]=qs[_0xcb7c('0x1b')](_0x389eba['query'][_0xcb7c('0x1b')]);_0x459c5b[_0xcb7c('0x1a')]=qs['offset'](_0x389eba['query']['offset']);}_0x459c5b['order']=qs['sort'](_0x389eba[_0xcb7c('0x2b')][_0xcb7c('0x33')]);_0x459c5b[_0xcb7c('0x34')]=qs[_0xcb7c('0x35')](_[_0xcb7c('0x36')](_0x389eba[_0xcb7c('0x2b')],_0xf61e08[_0xcb7c('0x35')]));if(_0x3eb437[_0xcb7c('0x2c')]){if(_0x3eb437['dateEnd']){_0x3eb437[_0xcb7c('0x2d')]=moment(_0x3eb437[_0xcb7c('0x2d')])[_0xcb7c('0x37')](0x1,'day');}else{_0x3eb437['dateEnd']=moment(_0x3eb437[_0xcb7c('0x2c')])['add'](0x1,_0xcb7c('0x38'));}_[_0xcb7c('0x39')](_0x459c5b['where'],{'createdAt':{'$gte':_0x3eb437['dateStart'],'$lte':_0x3eb437['dateEnd']}});}if(_0x389eba[_0xcb7c('0x2b')][_0xcb7c('0x3a')]){_0x459c5b[_0xcb7c('0x34')]=_[_0xcb7c('0x39')](_0x459c5b[_0xcb7c('0x34')],{'$or':_[_0xcb7c('0x3b')](_0x459c5b[_0xcb7c('0x30')],function(_0x29ca22){var _0xf39e7d={};_0xf39e7d[_0x29ca22]={'$like':'%'+_0x389eba[_0xcb7c('0x2b')][_0xcb7c('0x3a')]+'%'};return _0xf39e7d;})});}_0x459c5b=_[_0xcb7c('0x39')]({},_0x459c5b,_0x389eba['options']);var _0x2bb278={'where':_0x459c5b['where']};return db[_0xcb7c('0x27')][_0xcb7c('0x3c')](_0x2bb278)[_0xcb7c('0x21')](function(_0x1e25c6){_0x2428ef[_0xcb7c('0x3c')]=_0x1e25c6;if(_0x389eba[_0xcb7c('0x2b')][_0xcb7c('0x3d')]){_0x459c5b[_0xcb7c('0x3e')]=[{'all':!![]}];}return db[_0xcb7c('0x27')][_0xcb7c('0x3f')](_0x459c5b);})[_0xcb7c('0x21')](function(_0x6f4a20){_0x2428ef[_0xcb7c('0x40')]=_0x6f4a20;return _0x2428ef;})['then'](respondWithFilteredResult(_0x11e5b7,_0x459c5b))[_0xcb7c('0x41')](handleError(_0x11e5b7,null));};exports[_0xcb7c('0x42')]=function(_0x160638,_0x5b2eea){var _0x2456eb={'raw':!![],'where':{'id':_0x160638[_0xcb7c('0x43')]['id']}},_0x3a2b53={};_0x3a2b53[_0xcb7c('0x29')]=_[_0xcb7c('0x2a')](db[_0xcb7c('0x27')][_0xcb7c('0x28')]);_0x3a2b53['query']=_[_0xcb7c('0x2a')](_0x160638[_0xcb7c('0x2b')]);_0x3a2b53[_0xcb7c('0x35')]=_['intersection'](_0x3a2b53['model'],_0x3a2b53['query']);_0x2456eb[_0xcb7c('0x30')]=_[_0xcb7c('0x2e')](_0x3a2b53[_0xcb7c('0x29')],qs['fields'](_0x160638[_0xcb7c('0x2b')][_0xcb7c('0x2f')]));_0x2456eb['attributes']=_0x2456eb[_0xcb7c('0x30')][_0xcb7c('0x44')]?_0x2456eb[_0xcb7c('0x30')]:_0x3a2b53[_0xcb7c('0x29')];if(_0x160638['query'][_0xcb7c('0x3d')]){_0x2456eb[_0xcb7c('0x3e')]=[{'all':!![]}];}_0x2456eb=_[_0xcb7c('0x39')]({},_0x2456eb,_0x160638['options']);return db[_0xcb7c('0x27')]['find'](_0x2456eb)['then'](handleEntityNotFound(_0x5b2eea,null))[_0xcb7c('0x21')](respondWithResult(_0x5b2eea,null))[_0xcb7c('0x41')](handleError(_0x5b2eea,null));};exports['create']=function(_0x477afd,_0x1a763d){return db[_0xcb7c('0x27')]['create'](_0x477afd[_0xcb7c('0x45')],{})[_0xcb7c('0x21')](respondWithResult(_0x1a763d,0xc9))[_0xcb7c('0x41')](handleError(_0x1a763d,null));};exports['update']=function(_0x20e406,_0x113cfb){if(_0x20e406[_0xcb7c('0x45')]['id']){delete _0x20e406[_0xcb7c('0x45')]['id'];}return db[_0xcb7c('0x27')][_0xcb7c('0x46')]({'where':{'id':_0x20e406['params']['id']}})[_0xcb7c('0x21')](handleEntityNotFound(_0x113cfb,null))[_0xcb7c('0x21')](saveUpdates(_0x20e406[_0xcb7c('0x45')],null))[_0xcb7c('0x21')](respondWithResult(_0x113cfb,null))[_0xcb7c('0x41')](handleError(_0x113cfb,null));};exports[_0xcb7c('0x22')]=function(_0x1b16ce,_0x3bddc6){return db['VoiceDialReport'][_0xcb7c('0x46')]({'where':{'id':_0x1b16ce[_0xcb7c('0x43')]['id']}})[_0xcb7c('0x21')](handleEntityNotFound(_0x3bddc6,null))['then'](removeEntity(_0x3bddc6,null))['catch'](handleError(_0x3bddc6,null));};exports[_0xcb7c('0x47')]=function(_0x438926,_0x3f61a6){return db[_0xcb7c('0x27')][_0xcb7c('0x47')]()[_0xcb7c('0x21')](respondWithResult(_0x3f61a6,null))[_0xcb7c('0x41')](handleError(_0x3f61a6,null));};
\ No newline at end of file
+var _0x0b18=['destroy','end','sendStatus','name','send','model','query','dateStart','dateEnd','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','add','day','merge','map','filter','options','VoiceDialReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','status','json','count','offset','limit','Content-Range','apply','update','then'];(function(_0x4f1ee6,_0x3a0ac1){var _0x331ef3=function(_0x2ca0dd){while(--_0x2ca0dd){_0x4f1ee6['push'](_0x4f1ee6['shift']());}};_0x331ef3(++_0x3a0ac1);}(_0x0b18,0xf2));var _0x80b1=function(_0x503699,_0x152145){_0x503699=_0x503699-0x0;var _0xd66c82=_0x0b18[_0x503699];return _0xd66c82;};'use strict';var pdf=require(_0x80b1('0x0'));var emlformat=require(_0x80b1('0x1'));var rimraf=require(_0x80b1('0x2'));var zipdir=require(_0x80b1('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x80b1('0x4'));var moment=require(_0x80b1('0x5'));var BPromise=require(_0x80b1('0x6'));var Mustache=require(_0x80b1('0x7'));var util=require(_0x80b1('0x8'));var path=require(_0x80b1('0x9'));var sox=require('sox');var csv=require(_0x80b1('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x80b1('0xb'));var squel=require(_0x80b1('0xc'));var crypto=require(_0x80b1('0xd'));var jsforce=require(_0x80b1('0xe'));var deskjs=require(_0x80b1('0xf'));var toCsv=require(_0x80b1('0xa'));var querystring=require(_0x80b1('0x10'));var Papa=require('papaparse');var qs=require(_0x80b1('0x11'));var logger=require(_0x80b1('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x80b1('0x13'));var db=require(_0x80b1('0x14'))['db'];function respondWithStatusCode(_0x5b17bb,_0x4b489c){_0x4b489c=_0x4b489c||0xcc;return function(_0x48e694){if(_0x48e694){return _0x5b17bb['sendStatus'](_0x4b489c);}return _0x5b17bb['status'](_0x4b489c)['end']();};}function respondWithResult(_0x4869fb,_0xb4380c){_0xb4380c=_0xb4380c||0xc8;return function(_0x6633c1){if(_0x6633c1){return _0x4869fb[_0x80b1('0x15')](_0xb4380c)[_0x80b1('0x16')](_0x6633c1);}};}function respondWithFilteredResult(_0x1b8d0a,_0xa9526b){return function(_0x39629f){if(_0x39629f){var _0x2a2f00=_0x39629f[_0x80b1('0x17')],_0x364b1b=_0xa9526b[_0x80b1('0x18')],_0x229f57=_0xa9526b[_0x80b1('0x18')]+_0xa9526b[_0x80b1('0x19')],_0x36bb0f;if(_0x229f57>=_0x2a2f00){_0x229f57=_0x2a2f00;_0x36bb0f=0xc8;}else{_0x36bb0f=0xce;}_0x1b8d0a['status'](_0x36bb0f);return _0x1b8d0a['set'](_0x80b1('0x1a'),_0x364b1b+'-'+_0x229f57+'/'+_0x2a2f00)[_0x80b1('0x16')](_0x39629f);}return null;};}function patchUpdates(_0x1f4883){return function(_0x3fc8f3){try{jsonpatch[_0x80b1('0x1b')](_0x3fc8f3,_0x1f4883,!![]);}catch(_0x343f02){return BPromise['reject'](_0x343f02);}return _0x3fc8f3['save']();};}function saveUpdates(_0x4a3eb4,_0x10d324){return function(_0x5bb474){if(_0x5bb474){return _0x5bb474[_0x80b1('0x1c')](_0x4a3eb4)[_0x80b1('0x1d')](function(_0x54c242){return _0x54c242;});}return null;};}function removeEntity(_0x59ab0c,_0x4c2d43){return function(_0x113e90){if(_0x113e90){return _0x113e90[_0x80b1('0x1e')]()['then'](function(){_0x59ab0c[_0x80b1('0x15')](0xcc)[_0x80b1('0x1f')]();});}};}function handleEntityNotFound(_0x440ba4,_0x2071ac){return function(_0x527b71){if(!_0x527b71){_0x440ba4[_0x80b1('0x20')](0x194);}return _0x527b71;};}function handleError(_0x183cc5,_0x121ccc){_0x121ccc=_0x121ccc||0x1f4;return function(_0x178e4d){logger['error'](_0x178e4d['stack']);if(_0x178e4d[_0x80b1('0x21')]){delete _0x178e4d[_0x80b1('0x21')];}_0x183cc5[_0x80b1('0x15')](_0x121ccc)[_0x80b1('0x22')](_0x178e4d);};}exports['index']=function(_0x51b7e9,_0x5aa623){var _0x2bc5b1={},_0x3585df={},_0x20056d={'count':0x0,'rows':[]};var _0x4de8ed=db['VoiceDialReport']['rawAttributes'];_0x3585df[_0x80b1('0x23')]=_['keys'](_0x4de8ed);var _0x5449da={'dateStart':_0x51b7e9[_0x80b1('0x24')][_0x80b1('0x25')],'dateEnd':_0x51b7e9[_0x80b1('0x24')][_0x80b1('0x26')]};delete _0x51b7e9['query']['dateStart'];delete _0x51b7e9[_0x80b1('0x24')][_0x80b1('0x26')];_0x3585df['query']=_['keys'](_0x51b7e9[_0x80b1('0x24')]);_0x3585df[_0x80b1('0x27')]=_['intersection'](_0x3585df[_0x80b1('0x23')],_0x3585df[_0x80b1('0x24')]);_0x2bc5b1[_0x80b1('0x28')]=_[_0x80b1('0x29')](_0x3585df[_0x80b1('0x23')],qs[_0x80b1('0x2a')](_0x51b7e9[_0x80b1('0x24')][_0x80b1('0x2a')]));_0x2bc5b1[_0x80b1('0x28')]=_0x2bc5b1[_0x80b1('0x28')][_0x80b1('0x2b')]?_0x2bc5b1['attributes']:_0x3585df['model'];if(!_0x51b7e9['query'][_0x80b1('0x2c')](_0x80b1('0x2d'))){_0x2bc5b1[_0x80b1('0x19')]=qs['limit'](_0x51b7e9[_0x80b1('0x24')][_0x80b1('0x19')]);_0x2bc5b1[_0x80b1('0x18')]=qs[_0x80b1('0x18')](_0x51b7e9[_0x80b1('0x24')]['offset']);}_0x2bc5b1[_0x80b1('0x2e')]=qs['sort'](_0x51b7e9[_0x80b1('0x24')][_0x80b1('0x2f')]);_0x2bc5b1[_0x80b1('0x30')]=qs[_0x80b1('0x27')](_['pick'](_0x51b7e9[_0x80b1('0x24')],_0x3585df[_0x80b1('0x27')]));if(_0x5449da[_0x80b1('0x25')]){if(_0x5449da[_0x80b1('0x26')]){_0x5449da[_0x80b1('0x26')]=moment(_0x5449da[_0x80b1('0x26')])[_0x80b1('0x31')](0x1,'day');}else{_0x5449da[_0x80b1('0x26')]=moment(_0x5449da[_0x80b1('0x25')])[_0x80b1('0x31')](0x1,_0x80b1('0x32'));}_['merge'](_0x2bc5b1[_0x80b1('0x30')],{'createdAt':{'$gte':_0x5449da['dateStart'],'$lte':_0x5449da[_0x80b1('0x26')]}});}if(_0x51b7e9[_0x80b1('0x24')]['filter']){_0x2bc5b1['where']=_[_0x80b1('0x33')](_0x2bc5b1['where'],{'$or':_[_0x80b1('0x34')](_0x2bc5b1['attributes'],function(_0x7ef1a){var _0x3f3533={};_0x3f3533[_0x7ef1a]={'$like':'%'+_0x51b7e9[_0x80b1('0x24')][_0x80b1('0x35')]+'%'};return _0x3f3533;})});}_0x2bc5b1=_[_0x80b1('0x33')]({},_0x2bc5b1,_0x51b7e9[_0x80b1('0x36')]);var _0x57a322={'where':_0x2bc5b1[_0x80b1('0x30')]};return db[_0x80b1('0x37')]['count'](_0x57a322)[_0x80b1('0x1d')](function(_0x1856c3){_0x20056d[_0x80b1('0x17')]=_0x1856c3;if(_0x51b7e9[_0x80b1('0x24')][_0x80b1('0x38')]){_0x2bc5b1[_0x80b1('0x39')]=[{'all':!![]}];}return db[_0x80b1('0x37')][_0x80b1('0x3a')](_0x2bc5b1);})[_0x80b1('0x1d')](function(_0x4ed383){_0x20056d[_0x80b1('0x3b')]=_0x4ed383;return _0x20056d;})[_0x80b1('0x1d')](respondWithFilteredResult(_0x5aa623,_0x2bc5b1))[_0x80b1('0x3c')](handleError(_0x5aa623,null));};exports[_0x80b1('0x3d')]=function(_0x1d9cce,_0x33cfe5){var _0x2fa277={'raw':!![],'where':{'id':_0x1d9cce[_0x80b1('0x3e')]['id']}},_0x352fd3={};_0x352fd3[_0x80b1('0x23')]=_[_0x80b1('0x3f')](db[_0x80b1('0x37')]['rawAttributes']);_0x352fd3[_0x80b1('0x24')]=_['keys'](_0x1d9cce[_0x80b1('0x24')]);_0x352fd3[_0x80b1('0x27')]=_[_0x80b1('0x29')](_0x352fd3[_0x80b1('0x23')],_0x352fd3[_0x80b1('0x24')]);_0x2fa277[_0x80b1('0x28')]=_['intersection'](_0x352fd3[_0x80b1('0x23')],qs[_0x80b1('0x2a')](_0x1d9cce['query'][_0x80b1('0x2a')]));_0x2fa277['attributes']=_0x2fa277['attributes'][_0x80b1('0x2b')]?_0x2fa277[_0x80b1('0x28')]:_0x352fd3['model'];if(_0x1d9cce['query'][_0x80b1('0x38')]){_0x2fa277[_0x80b1('0x39')]=[{'all':!![]}];}_0x2fa277=_[_0x80b1('0x33')]({},_0x2fa277,_0x1d9cce[_0x80b1('0x36')]);return db[_0x80b1('0x37')][_0x80b1('0x40')](_0x2fa277)[_0x80b1('0x1d')](handleEntityNotFound(_0x33cfe5,null))[_0x80b1('0x1d')](respondWithResult(_0x33cfe5,null))[_0x80b1('0x3c')](handleError(_0x33cfe5,null));};exports[_0x80b1('0x41')]=function(_0x5ef61e,_0x3d0f4a){return db[_0x80b1('0x37')][_0x80b1('0x41')](_0x5ef61e['body'],{})[_0x80b1('0x1d')](respondWithResult(_0x3d0f4a,0xc9))[_0x80b1('0x3c')](handleError(_0x3d0f4a,null));};exports[_0x80b1('0x1c')]=function(_0x16de5c,_0xab2ab3){if(_0x16de5c[_0x80b1('0x42')]['id']){delete _0x16de5c[_0x80b1('0x42')]['id'];}return db['VoiceDialReport'][_0x80b1('0x40')]({'where':{'id':_0x16de5c[_0x80b1('0x3e')]['id']}})[_0x80b1('0x1d')](handleEntityNotFound(_0xab2ab3,null))[_0x80b1('0x1d')](saveUpdates(_0x16de5c['body'],null))[_0x80b1('0x1d')](respondWithResult(_0xab2ab3,null))[_0x80b1('0x3c')](handleError(_0xab2ab3,null));};exports['destroy']=function(_0x2b47e9,_0x40cf45){return db[_0x80b1('0x37')][_0x80b1('0x40')]({'where':{'id':_0x2b47e9[_0x80b1('0x3e')]['id']}})[_0x80b1('0x1d')](handleEntityNotFound(_0x40cf45,null))[_0x80b1('0x1d')](removeEntity(_0x40cf45,null))['catch'](handleError(_0x40cf45,null));};exports[_0x80b1('0x43')]=function(_0x4545b8,_0x36d56c){return db[_0x80b1('0x37')][_0x80b1('0x43')]()[_0x80b1('0x1d')](respondWithResult(_0x36d56c,null))['catch'](handleError(_0x36d56c,null));};
\ No newline at end of file
index 3fcc835..90b8b0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4edc=['exports','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','./voiceDialReport.attributes'];(function(_0x25d7e7,_0x2e1bf9){var _0x1b8ee3=function(_0x520afd){while(--_0x520afd){_0x25d7e7['push'](_0x25d7e7['shift']());}};_0x1b8ee3(++_0x2e1bf9);}(_0x4edc,0xe0));var _0xc4ed=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4edc[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xc4ed('0x0'));var util=require(_0xc4ed('0x1'));var logger=require(_0xc4ed('0x2'))(_0xc4ed('0x3'));var moment=require(_0xc4ed('0x4'));var BPromise=require('bluebird');var rp=require(_0xc4ed('0x5'));var attributes=require(_0xc4ed('0x6'));module[_0xc4ed('0x7')]=function(_0x264455,_0x19cf02){return _0x264455['define'](_0xc4ed('0x8'),attributes,{'tableName':_0xc4ed('0x9'),'paranoid':![],'indexes':[{'fields':[_0xc4ed('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d83=['util','../../config/logger','api','moment','bluebird','request-promise','./voiceDialReport.attributes','exports','VoiceDialReport','lodash'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x7d83,0x18f));var _0x37d8=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x7d83[_0x288f5e];return _0x476cc9;};'use strict';var _=require(_0x37d8('0x0'));var util=require(_0x37d8('0x1'));var logger=require(_0x37d8('0x2'))(_0x37d8('0x3'));var moment=require(_0x37d8('0x4'));var BPromise=require(_0x37d8('0x5'));var rp=require(_0x37d8('0x6'));var attributes=require(_0x37d8('0x7'));module[_0x37d8('0x8')]=function(_0x4b0725,_0x339a72){return _0x4b0725['define'](_0x37d8('0x9'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 231796d..b26f7ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','catch','CreateVoiceDialReport','body','options','raw','update','where','attributes','limit','UpdateVoiceDialReport','lodash','util'];(function(_0x147d40,_0x8af156){var _0x5d3a8e=function(_0x4071f9){while(--_0x4071f9){_0x147d40['push'](_0x147d40['shift']());}};_0x5d3a8e(++_0x8af156);}(_0xdb28,0x106));var _0x8db2=function(_0x23d78a,_0x42044d){_0x23d78a=_0x23d78a-0x0;var _0x1bb73b=_0xdb28[_0x23d78a];return _0x1bb73b;};'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 db=require(_0x8db2('0x4'))['db'];var utils=require(_0x8db2('0x5'));var logger=require(_0x8db2('0x6'))(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8db2('0x9')][_0x8db2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f42ee,_0x494b40,_0x477f50){return new BPromise(function(_0x46932f,_0x131537){return client[_0x8db2('0xb')](_0x5f42ee,_0x477f50)[_0x8db2('0xc')](function(_0x1ff362){logger[_0x8db2('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x494b40,_0x8db2('0xe'));logger[_0x8db2('0xf')](_0x8db2('0x10'),_0x494b40,'request\x20sent',JSON[_0x8db2('0x11')](_0x1ff362));if(_0x1ff362[_0x8db2('0x12')]){if(_0x1ff362['error'][_0x8db2('0x13')]===0x1f4){logger[_0x8db2('0x12')](_0x8db2('0x14'),_0x494b40,_0x1ff362[_0x8db2('0x12')][_0x8db2('0x15')]);return _0x131537(_0x1ff362['error']['message']);}logger[_0x8db2('0x12')](_0x8db2('0x14'),_0x494b40,_0x1ff362[_0x8db2('0x12')][_0x8db2('0x15')]);return _0x46932f(_0x1ff362[_0x8db2('0x12')][_0x8db2('0x15')]);}else{logger[_0x8db2('0xd')](_0x8db2('0x14'),_0x494b40,_0x8db2('0xe'));_0x46932f(_0x1ff362[_0x8db2('0x16')]['message']);}})[_0x8db2('0x17')](function(_0x24da1b){logger['error'](_0x8db2('0x14'),_0x494b40,_0x24da1b);_0x131537(_0x24da1b);});});}exports[_0x8db2('0x18')]=function(_0x21db8c){var _0x3fddc2=this;return new Promise(function(_0x2efd06,_0x46ce14){return db['VoiceDialReport']['create'](_0x21db8c[_0x8db2('0x19')],{'raw':_0x21db8c[_0x8db2('0x1a')]?_0x21db8c[_0x8db2('0x1a')][_0x8db2('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x431d60){logger[_0x8db2('0xd')](_0x8db2('0x18'),_0x21db8c);logger[_0x8db2('0xf')](_0x8db2('0x18'),_0x21db8c,JSON['stringify'](_0x431d60));_0x2efd06(_0x431d60);})[_0x8db2('0x17')](function(_0x3e30e6){logger[_0x8db2('0x12')](_0x8db2('0x18'),_0x3e30e6[_0x8db2('0x15')],_0x21db8c);_0x46ce14(_0x3fddc2[_0x8db2('0x12')](0x1f4,_0x3e30e6[_0x8db2('0x15')]));});});};exports['UpdateVoiceDialReport']=function(_0x256202){var _0x4f6516=this;return new Promise(function(_0x5725f0,_0x52a9ca){return db['VoiceDialReport'][_0x8db2('0x1c')](_0x256202[_0x8db2('0x19')],{'raw':_0x256202[_0x8db2('0x1a')]?_0x256202[_0x8db2('0x1a')][_0x8db2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x256202[_0x8db2('0x1a')]?_0x256202['options'][_0x8db2('0x1d')]||null:null,'attributes':_0x256202[_0x8db2('0x1a')]?_0x256202[_0x8db2('0x1a')][_0x8db2('0x1e')]||null:null,'limit':_0x256202['options']?_0x256202[_0x8db2('0x1a')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0x1687ed){logger[_0x8db2('0xd')](_0x8db2('0x20'),_0x256202);logger[_0x8db2('0xf')](_0x8db2('0x20'),_0x256202,JSON[_0x8db2('0x11')](_0x1687ed));_0x5725f0(_0x1687ed);})['catch'](function(_0x4718ec){logger['error']('UpdateVoiceDialReport',_0x4718ec[_0x8db2('0x15')],_0x256202);_0x52a9ca(_0x4f6516[_0x8db2('0x12')](0x1f4,_0x4718ec[_0x8db2('0x15')]));});});};
\ No newline at end of file
+var _0x2542=['UpdateVoiceDialReport','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceDialReport','body','options','raw','debug','VoiceDialReport','update','attributes'];(function(_0x3c6b70,_0x1a6bc0){var _0x4734ac=function(_0x2025d6){while(--_0x2025d6){_0x3c6b70['push'](_0x3c6b70['shift']());}};_0x4734ac(++_0x1a6bc0);}(_0x2542,0x169));var _0x2254=function(_0xb5d890,_0x15871a){_0xb5d890=_0xb5d890-0x0;var _0x4771a7=_0x2542[_0xb5d890];return _0x4771a7;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x2254('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2254('0x5'))(_0x2254('0x6'));var config=require(_0x2254('0x7'));var jayson=require(_0x2254('0x8'));var client=jayson[_0x2254('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19ad3c,_0xe8ca50,_0x2ee7ee){return new BPromise(function(_0x3c45ec,_0x1637ad){return client[_0x2254('0xa')](_0x19ad3c,_0x2ee7ee)[_0x2254('0xb')](function(_0xbf1c18){logger[_0x2254('0xc')](_0x2254('0xd'),_0xe8ca50,_0x2254('0xe'));logger['debug'](_0x2254('0xf'),_0xe8ca50,_0x2254('0xe'),JSON[_0x2254('0x10')](_0xbf1c18));if(_0xbf1c18[_0x2254('0x11')]){if(_0xbf1c18['error']['code']===0x1f4){logger[_0x2254('0x11')](_0x2254('0xd'),_0xe8ca50,_0xbf1c18[_0x2254('0x11')][_0x2254('0x12')]);return _0x1637ad(_0xbf1c18[_0x2254('0x11')][_0x2254('0x12')]);}logger['error'](_0x2254('0xd'),_0xe8ca50,_0xbf1c18[_0x2254('0x11')]['message']);return _0x3c45ec(_0xbf1c18[_0x2254('0x11')][_0x2254('0x12')]);}else{logger[_0x2254('0xc')](_0x2254('0xd'),_0xe8ca50,_0x2254('0xe'));_0x3c45ec(_0xbf1c18[_0x2254('0x13')]['message']);}})[_0x2254('0x14')](function(_0x57247a){logger[_0x2254('0x11')](_0x2254('0xd'),_0xe8ca50,_0x57247a);_0x1637ad(_0x57247a);});});}exports[_0x2254('0x15')]=function(_0x25f8b2){var _0x1ae11e=this;return new Promise(function(_0x34f90e,_0x497724){return db['VoiceDialReport']['create'](_0x25f8b2[_0x2254('0x16')],{'raw':_0x25f8b2[_0x2254('0x17')]?_0x25f8b2[_0x2254('0x17')][_0x2254('0x18')]===undefined?!![]:![]:!![]})[_0x2254('0xb')](function(_0x2339bc){logger['info'](_0x2254('0x15'),_0x25f8b2);logger[_0x2254('0x19')](_0x2254('0x15'),_0x25f8b2,JSON['stringify'](_0x2339bc));_0x34f90e(_0x2339bc);})['catch'](function(_0x5bd982){logger[_0x2254('0x11')](_0x2254('0x15'),_0x5bd982[_0x2254('0x12')],_0x25f8b2);_0x497724(_0x1ae11e['error'](0x1f4,_0x5bd982['message']));});});};exports['UpdateVoiceDialReport']=function(_0x540020){var _0x5e5edb=this;return new Promise(function(_0x4f797d,_0x1aa71f){return db[_0x2254('0x1a')][_0x2254('0x1b')](_0x540020[_0x2254('0x16')],{'raw':_0x540020[_0x2254('0x17')]?_0x540020[_0x2254('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x540020['options']?_0x540020[_0x2254('0x17')]['where']||null:null,'attributes':_0x540020[_0x2254('0x17')]?_0x540020[_0x2254('0x17')][_0x2254('0x1c')]||null:null,'limit':_0x540020[_0x2254('0x17')]?_0x540020[_0x2254('0x17')]['limit']||null:null})[_0x2254('0xb')](function(_0x2a789b){logger[_0x2254('0xc')](_0x2254('0x1d'),_0x540020);logger[_0x2254('0x19')](_0x2254('0x1d'),_0x540020,JSON[_0x2254('0x10')](_0x2a789b));_0x4f797d(_0x2a789b);})[_0x2254('0x14')](function(_0x29975f){logger[_0x2254('0x11')](_0x2254('0x1d'),_0x29975f[_0x2254('0x12')],_0x540020);_0x1aa71f(_0x5e5edb[_0x2254('0x11')](0x1f4,_0x29975f[_0x2254('0x12')]));});});};
\ No newline at end of file
index dfe2008..3deca9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e90=['/:id','destroy','multer','util','path','Router','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','show','post','addApplications','update','delete'];(function(_0x59f670,_0x2a34aa){var _0x4ad264=function(_0x4a8709){while(--_0x4a8709){_0x59f670['push'](_0x59f670['shift']());}};_0x4ad264(++_0x2a34aa);}(_0x9e90,0x1a2));var _0x09e9=function(_0x5bb8a1,_0x2730cb){_0x5bb8a1=_0x5bb8a1-0x0;var _0x142d3b=_0x9e90[_0x5bb8a1];return _0x142d3b;};'use strict';var multer=require(_0x09e9('0x0'));var util=require(_0x09e9('0x1'));var path=require(_0x09e9('0x2'));var express=require('express');var router=express[_0x09e9('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x09e9('0x4'));var config=require(_0x09e9('0x5'));var controller=require(_0x09e9('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x09e9('0x7')]('/:id',auth[_0x09e9('0x8')](),controller[_0x09e9('0x9')]);router['post']('/',auth[_0x09e9('0x8')](),controller['create']);router[_0x09e9('0xa')]('/:id/applications',auth[_0x09e9('0x8')](),controller[_0x09e9('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x09e9('0xc')]);router[_0x09e9('0xd')](_0x09e9('0xe'),auth[_0x09e9('0x8')](),controller[_0x09e9('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x0ceb=['../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','/:id','show','create','post','/:id/applications','put','update','exports','express','Router','../../components/auth/service'];(function(_0xfa371,_0x1e055c){var _0x47be13=function(_0x49150e){while(--_0x49150e){_0xfa371['push'](_0xfa371['shift']());}};_0x47be13(++_0x1e055c);}(_0x0ceb,0xc0));var _0xb0ce=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x0ceb[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var express=require(_0xb0ce('0x0'));var router=express[_0xb0ce('0x1')]();var auth=require(_0xb0ce('0x2'));var interaction=require(_0xb0ce('0x3'));var config=require('../../config/environment');var controller=require(_0xb0ce('0x4'));router[_0xb0ce('0x5')]('/',auth[_0xb0ce('0x6')](),controller['index']);router[_0xb0ce('0x5')](_0xb0ce('0x7'),auth[_0xb0ce('0x6')](),controller[_0xb0ce('0x8')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb0ce('0x9')]);router[_0xb0ce('0xa')](_0xb0ce('0xb'),auth['isAuthenticated'](),controller['addApplications']);router[_0xb0ce('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xb0ce('0xd')]);router['delete']('/:id',auth[_0xb0ce('0x6')](),controller['destroy']);module[_0xb0ce('0xe')]=router;
\ No newline at end of file
index 3e70d70..f60b3da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9016=['sequelize','exports','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','INTEGER','BOOLEAN','wav'];(function(_0xc4f397,_0x143a64){var _0x43b531=function(_0x14684d){while(--_0x14684d){_0xc4f397['push'](_0xc4f397['shift']());}};_0x43b531(++_0x143a64);}(_0x9016,0xa5));var _0x6901=function(_0x3921e4,_0x20b324){_0x3921e4=_0x3921e4-0x0;var _0x5ef5a0=_0x9016[_0x3921e4];return _0x5ef5a0;};'use strict';var Sequelize=require(_0x6901('0x0'));module[_0x6901('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6901('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x6901('0x3')],'allowNull':![],'unique':_0x6901('0x2')},'priority':{'type':Sequelize[_0x6901('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x6901('0x2')},'tag':{'type':Sequelize[_0x6901('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x6901('0x3')],'allowNull':![],'defaultValue':_0x6901('0x4')},'appdata':{'type':Sequelize[_0x6901('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x6901('0x5')](_0x6901('0x6'),_0x6901('0x7'),_0x6901('0x8'),_0x6901('0x9'),_0x6901('0xa'),_0x6901('0xb'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x6901('0x3')]},'interval':{'type':Sequelize[_0x6901('0x3')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x6901('0xc')]},'isApp':{'type':Sequelize[_0x6901('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x6901('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x6901('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0x6901('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x6901('0x3')],'defaultValue':_0x6901('0xe')},'answer':{'type':Sequelize[_0x6901('0xd')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x084d=['any','*,*,*,*','BOOLEAN','wav','sequelize','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','outbound-fax','system'];(function(_0x517a95,_0x1579fe){var _0x17ad4b=function(_0xe7d3ba){while(--_0xe7d3ba){_0x517a95['push'](_0x517a95['shift']());}};_0x17ad4b(++_0x1579fe);}(_0x084d,0x17e));var _0xd084=function(_0x5ad124,_0x28e523){_0x5ad124=_0x5ad124-0x0;var _0x5e4386=_0x084d[_0x5ad124];return _0x5e4386;};'use strict';var Sequelize=require(_0xd084('0x0'));module['exports']={'context':{'type':Sequelize[_0xd084('0x1')],'allowNull':![],'unique':_0xd084('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xd084('0x1')],'allowNull':![],'unique':_0xd084('0x2')},'priority':{'type':Sequelize[_0xd084('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xd084('0x2')},'tag':{'type':Sequelize[_0xd084('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xd084('0x1')],'allowNull':![],'defaultValue':_0xd084('0x3')},'appdata':{'type':Sequelize[_0xd084('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xd084('0x4')](_0xd084('0x5'),_0xd084('0x6'),_0xd084('0x7'),'inbound-fax',_0xd084('0x8'),_0xd084('0x9'),_0xd084('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xd084('0x1')]},'interval':{'type':Sequelize[_0xd084('0x1')],'allowNull':![],'defaultValue':_0xd084('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xd084('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xd084('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xd084('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xd084('0x1')],'defaultValue':_0xd084('0xd')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 928bf7d..9a116ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ba8=['find','params','create','type','outbound','startsWith','body','exten','concat','pick','context','description','recordingFormat','cutdigits','addApplications','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','socket.io-emitter','localhost','./voiceExtension.socket','register','status','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','VoiceExtension','keys','query','dateStart','dateEnd','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','add','day','merge','filter','map','options','includeAll','findAll','rows','catch','show','rawAttributes','filters','include'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7ba8,0x17d));var _0x87ba=function(_0x5f8c01,_0x2788c2){_0x5f8c01=_0x5f8c01-0x0;var _0x15b549=_0x7ba8[_0x5f8c01];return _0x15b549;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x87ba('0x0'));var rimraf=require(_0x87ba('0x1'));var zipdir=require(_0x87ba('0x2'));var jsonpatch=require(_0x87ba('0x3'));var rp=require(_0x87ba('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x87ba('0x5'));var util=require(_0x87ba('0x6'));var path=require(_0x87ba('0x7'));var sox=require(_0x87ba('0x8'));var csv=require(_0x87ba('0x9'));var ejs=require(_0x87ba('0xa'));var fs=require('fs');var _=require(_0x87ba('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x87ba('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x87ba('0x9'));var querystring=require(_0x87ba('0xd'));var Papa=require(_0x87ba('0xe'));var qs=require(_0x87ba('0xf'));var logger=require(_0x87ba('0x10'))(_0x87ba('0x11'));var utils=require(_0x87ba('0x12'));var config=require(_0x87ba('0x13'));var db=require('../../mysqldb')['db'];var socket=require(_0x87ba('0x14'))({'host':_0x87ba('0x15'),'port':0x18eb});require(_0x87ba('0x16'))[_0x87ba('0x17')](socket);function respondWithStatusCode(_0xd046d0,_0x1a71fe){_0x1a71fe=_0x1a71fe||0xcc;return function(_0x145cae){if(_0x145cae){return _0xd046d0['sendStatus'](_0x1a71fe);}return _0xd046d0[_0x87ba('0x18')](_0x1a71fe)['end']();};}function respondWithResult(_0xcd4c87,_0x4743de){_0x4743de=_0x4743de||0xc8;return function(_0xda37fd){if(_0xda37fd){return _0xcd4c87['status'](_0x4743de)['json'](_0xda37fd);}};}function respondWithFilteredResult(_0x6cd7a6,_0x23536c){return function(_0x45ffc0){if(_0x45ffc0){var _0x5c0673=_0x45ffc0[_0x87ba('0x19')],_0x464218=_0x23536c[_0x87ba('0x1a')],_0x500042=_0x23536c[_0x87ba('0x1a')]+_0x23536c[_0x87ba('0x1b')],_0xd1b697;if(_0x500042>=_0x5c0673){_0x500042=_0x5c0673;_0xd1b697=0xc8;}else{_0xd1b697=0xce;}_0x6cd7a6[_0x87ba('0x18')](_0xd1b697);return _0x6cd7a6[_0x87ba('0x1c')](_0x87ba('0x1d'),_0x464218+'-'+_0x500042+'/'+_0x5c0673)['json'](_0x45ffc0);}return null;};}function patchUpdates(_0x3bc430){return function(_0x355e77){try{jsonpatch['apply'](_0x355e77,_0x3bc430,!![]);}catch(_0x52a7b5){return BPromise[_0x87ba('0x1e')](_0x52a7b5);}return _0x355e77[_0x87ba('0x1f')]();};}function saveUpdates(_0x1bf8be,_0x51796f){return function(_0x5dbd5b){if(_0x5dbd5b){return _0x5dbd5b[_0x87ba('0x20')](_0x1bf8be)[_0x87ba('0x21')](function(_0x2c1a3a){return _0x2c1a3a;});}return null;};}function removeEntity(_0x21b8b0,_0x310eed){return function(_0x13a912){if(_0x13a912){return _0x13a912[_0x87ba('0x22')]()['then'](function(){_0x21b8b0[_0x87ba('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dda9d,_0x189192){return function(_0xc1beb9){if(!_0xc1beb9){_0x4dda9d['sendStatus'](0x194);}return _0xc1beb9;};}function handleError(_0x2c7a6e,_0x313fb8){_0x313fb8=_0x313fb8||0x1f4;return function(_0x5ae4b0){logger[_0x87ba('0x23')](_0x5ae4b0[_0x87ba('0x24')]);if(_0x5ae4b0[_0x87ba('0x25')]){delete _0x5ae4b0[_0x87ba('0x25')];}_0x2c7a6e[_0x87ba('0x18')](_0x313fb8)[_0x87ba('0x26')](_0x5ae4b0);};}exports[_0x87ba('0x27')]=function(_0x344de4,_0x46f141){var _0xfb8774={},_0x5467f5={},_0x51399b={'count':0x0,'rows':[]};var _0x545677=db[_0x87ba('0x28')]['rawAttributes'];_0x5467f5['model']=_[_0x87ba('0x29')](_0x545677);var _0x3bd30e={'dateStart':_0x344de4[_0x87ba('0x2a')][_0x87ba('0x2b')],'dateEnd':_0x344de4[_0x87ba('0x2a')][_0x87ba('0x2c')]};delete _0x344de4[_0x87ba('0x2a')][_0x87ba('0x2b')];delete _0x344de4[_0x87ba('0x2a')][_0x87ba('0x2c')];_0x5467f5[_0x87ba('0x2a')]=_[_0x87ba('0x29')](_0x344de4['query']);_0x5467f5['filters']=_[_0x87ba('0x2d')](_0x5467f5['model'],_0x5467f5['query']);_0xfb8774['attributes']=_['intersection'](_0x5467f5['model'],qs['fields'](_0x344de4['query'][_0x87ba('0x2e')]));_0xfb8774[_0x87ba('0x2f')]=_0xfb8774[_0x87ba('0x2f')][_0x87ba('0x30')]?_0xfb8774['attributes']:_0x5467f5[_0x87ba('0x31')];if(!_0x344de4['query'][_0x87ba('0x32')](_0x87ba('0x33'))){_0xfb8774['limit']=qs[_0x87ba('0x1b')](_0x344de4[_0x87ba('0x2a')]['limit']);_0xfb8774[_0x87ba('0x1a')]=qs[_0x87ba('0x1a')](_0x344de4['query'][_0x87ba('0x1a')]);}_0xfb8774[_0x87ba('0x34')]=qs[_0x87ba('0x35')](_0x344de4['query']['sort']);_0xfb8774[_0x87ba('0x36')]=qs['filters'](_['pick'](_0x344de4[_0x87ba('0x2a')],_0x5467f5['filters']));if(_0x3bd30e[_0x87ba('0x2b')]){if(_0x3bd30e[_0x87ba('0x2c')]){_0x3bd30e[_0x87ba('0x2c')]=moment(_0x3bd30e['dateEnd'])['add'](0x1,'day');}else{_0x3bd30e[_0x87ba('0x2c')]=moment(_0x3bd30e[_0x87ba('0x2b')])[_0x87ba('0x37')](0x1,_0x87ba('0x38'));}_[_0x87ba('0x39')](_0xfb8774[_0x87ba('0x36')],{'createdAt':{'$gte':_0x3bd30e['dateStart'],'$lte':_0x3bd30e['dateEnd']}});}if(_0x344de4[_0x87ba('0x2a')][_0x87ba('0x3a')]){_0xfb8774['where']=_['merge'](_0xfb8774['where'],{'$or':_[_0x87ba('0x3b')](_0xfb8774[_0x87ba('0x2f')],function(_0xf1cb46){var _0x581f49={};_0x581f49[_0xf1cb46]={'$like':'%'+_0x344de4[_0x87ba('0x2a')][_0x87ba('0x3a')]+'%'};return _0x581f49;})});}_0xfb8774=_[_0x87ba('0x39')]({},_0xfb8774,_0x344de4[_0x87ba('0x3c')]);var _0x510146={'where':_0xfb8774[_0x87ba('0x36')]};return db['VoiceExtension']['count'](_0x510146)[_0x87ba('0x21')](function(_0x5893ad){_0x51399b[_0x87ba('0x19')]=_0x5893ad;if(_0x344de4['query'][_0x87ba('0x3d')]){_0xfb8774['include']=[{'all':!![]}];}return db[_0x87ba('0x28')][_0x87ba('0x3e')](_0xfb8774);})['then'](function(_0x158804){_0x51399b[_0x87ba('0x3f')]=_0x158804;return _0x51399b;})['then'](respondWithFilteredResult(_0x46f141,_0xfb8774))[_0x87ba('0x40')](handleError(_0x46f141,null));};exports[_0x87ba('0x41')]=function(_0x292f1d,_0x583fca){var _0x42b4ba={'raw':![],'where':{'id':_0x292f1d['params']['id']}},_0x60a5c4={};_0x60a5c4[_0x87ba('0x31')]=_['keys'](db['VoiceExtension'][_0x87ba('0x42')]);_0x60a5c4['query']=_[_0x87ba('0x29')](_0x292f1d['query']);_0x60a5c4[_0x87ba('0x43')]=_[_0x87ba('0x2d')](_0x60a5c4[_0x87ba('0x31')],_0x60a5c4[_0x87ba('0x2a')]);_0x42b4ba[_0x87ba('0x2f')]=_[_0x87ba('0x2d')](_0x60a5c4[_0x87ba('0x31')],qs['fields'](_0x292f1d[_0x87ba('0x2a')]['fields']));_0x42b4ba[_0x87ba('0x2f')]=_0x42b4ba[_0x87ba('0x2f')][_0x87ba('0x30')]?_0x42b4ba[_0x87ba('0x2f')]:_0x60a5c4['model'];if(_0x292f1d[_0x87ba('0x2a')]['includeAll']){_0x42b4ba[_0x87ba('0x44')]=[{'all':!![]}];}_0x42b4ba=_[_0x87ba('0x39')]({},_0x42b4ba,_0x292f1d[_0x87ba('0x3c')]);return db[_0x87ba('0x28')][_0x87ba('0x45')](_0x42b4ba)['then'](handleEntityNotFound(_0x583fca,null))[_0x87ba('0x21')](respondWithResult(_0x583fca,null))['catch'](handleError(_0x583fca,null));};exports[_0x87ba('0x22')]=function(_0x4662c2,_0x2c835b){return db[_0x87ba('0x28')][_0x87ba('0x45')]({'where':{'id':_0x4662c2[_0x87ba('0x46')]['id']}})[_0x87ba('0x21')](handleEntityNotFound(_0x2c835b,null))[_0x87ba('0x21')](removeEntity(_0x2c835b,null))['catch'](handleError(_0x2c835b,null));};exports[_0x87ba('0x47')]=function(_0x45bcdc,_0x167ada){if(_0x45bcdc['body'][_0x87ba('0x48')]===_0x87ba('0x49')&&!_[_0x87ba('0x4a')](_0x45bcdc[_0x87ba('0x4b')][_0x87ba('0x4c')],'_')){_0x45bcdc[_0x87ba('0x4b')][_0x87ba('0x4c')]='_'[_0x87ba('0x4d')](_0x45bcdc[_0x87ba('0x4b')]['exten']);}return db[_0x87ba('0x28')][_0x87ba('0x47')](_0x45bcdc[_0x87ba('0x4b')],{'raw':![]})[_0x87ba('0x21')](respondWithResult(_0x167ada,0xc9))[_0x87ba('0x40')](handleError(_0x167ada,null));};exports[_0x87ba('0x20')]=function(_0x4c07b7,_0x3ba370){if(_0x4c07b7[_0x87ba('0x4b')]['id']){delete _0x4c07b7[_0x87ba('0x4b')]['id'];}return db[_0x87ba('0x28')][_0x87ba('0x45')]({'where':{'id':_0x4c07b7[_0x87ba('0x46')]['id']}})[_0x87ba('0x21')](handleEntityNotFound(_0x3ba370,null))[_0x87ba('0x21')](function(_0x3a3b56){if(_0x3a3b56){return db['VoiceExtension'][_0x87ba('0x20')](_[_0x87ba('0x4e')](_0x4c07b7['body'],[_0x87ba('0x4c'),_0x87ba('0x4f'),_0x87ba('0x50'),_0x87ba('0x51'),_0x87ba('0x52')]),{'where':{'context':_0x3a3b56[_0x87ba('0x4f')],'exten':_0x3a3b56[_0x87ba('0x4c')]},'individualHooks':!![]})[_0x87ba('0x21')](function(_0x3231a1){return _0x3231a1;});}return null;})[_0x87ba('0x21')](respondWithStatusCode(_0x3ba370,null))['catch'](handleError(_0x3ba370,null));};exports[_0x87ba('0x53')]=function(_0x4ea975,_0x38ba5c,_0x458cb6){return db[_0x87ba('0x28')][_0x87ba('0x54')]({'where':{'id':_0x4ea975[_0x87ba('0x46')]['id']}})[_0x87ba('0x21')](handleEntityNotFound(_0x38ba5c,null))[_0x87ba('0x21')](function(_0x5b87fe){if(_0x5b87fe){return db[_0x87ba('0x55')][_0x87ba('0x56')](function(_0x31a2c7){return db[_0x87ba('0x28')]['destroy']({'where':{'VoiceExtensionId':_0x4ea975[_0x87ba('0x46')]['id']},'transaction':_0x31a2c7})[_0x87ba('0x21')](function(_0x3c56a4){var _0x30676f=_[_0x87ba('0x3b')](_0x4ea975[_0x87ba('0x4b')],function(_0xc3aa92){_0xc3aa92[_0x87ba('0x57')]=_0x4ea975[_0x87ba('0x46')]['id'];return _0xc3aa92;});return db[_0x87ba('0x28')][_0x87ba('0x58')](_0x30676f,{'transaction':_0x31a2c7});});})[_0x87ba('0x21')](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x4ea975[_0x87ba('0x46')]['id']},'order':_0x87ba('0x59')});});}})['then'](respondWithResult(_0x38ba5c,null))[_0x87ba('0x40')](handleError(_0x38ba5c,null));};
\ No newline at end of file
+var _0x889b=['Content-Range','apply','reject','save','update','then','destroy','stack','name','send','VoiceExtension','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','add','day','merge','filter','map','options','includeAll','include','findAll','rows','catch','params','rawAttributes','type','outbound','startsWith','body','exten','context','description','recordingFormat','cutdigits','addApplications','findOne','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','localhost','register','sendStatus','status','end','json','count','offset','limit','set'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x889b,0xe3));var _0xb889=function(_0x29bef7,_0x5127f0){_0x29bef7=_0x29bef7-0x0;var _0x1ba0c1=_0x889b[_0x29bef7];return _0x1ba0c1;};'use strict';var pdf=require(_0xb889('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb889('0x1'));var zipdir=require(_0xb889('0x2'));var jsonpatch=require(_0xb889('0x3'));var rp=require(_0xb889('0x4'));var moment=require(_0xb889('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb889('0x6'));var util=require('util');var path=require(_0xb889('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb889('0x8'));var fs=require('fs');var _=require(_0xb889('0x9'));var squel=require(_0xb889('0xa'));var crypto=require('crypto');var jsforce=require(_0xb889('0xb'));var deskjs=require(_0xb889('0xc'));var toCsv=require(_0xb889('0xd'));var querystring=require(_0xb889('0xe'));var Papa=require(_0xb889('0xf'));var qs=require(_0xb889('0x10'));var logger=require(_0xb889('0x11'))(_0xb889('0x12'));var utils=require(_0xb889('0x13'));var config=require('../../config/environment');var db=require(_0xb889('0x14'))['db'];var socket=require('socket.io-emitter')({'host':_0xb889('0x15'),'port':0x18eb});require('./voiceExtension.socket')[_0xb889('0x16')](socket);function respondWithStatusCode(_0xe39682,_0x4f9319){_0x4f9319=_0x4f9319||0xcc;return function(_0x19a115){if(_0x19a115){return _0xe39682[_0xb889('0x17')](_0x4f9319);}return _0xe39682[_0xb889('0x18')](_0x4f9319)[_0xb889('0x19')]();};}function respondWithResult(_0x3c707f,_0x28e7de){_0x28e7de=_0x28e7de||0xc8;return function(_0x399db8){if(_0x399db8){return _0x3c707f[_0xb889('0x18')](_0x28e7de)[_0xb889('0x1a')](_0x399db8);}};}function respondWithFilteredResult(_0x1223ac,_0x123f24){return function(_0x3bd374){if(_0x3bd374){var _0x23897f=_0x3bd374[_0xb889('0x1b')],_0x5dacbe=_0x123f24[_0xb889('0x1c')],_0x5a0ed6=_0x123f24[_0xb889('0x1c')]+_0x123f24[_0xb889('0x1d')],_0x4ddf76;if(_0x5a0ed6>=_0x23897f){_0x5a0ed6=_0x23897f;_0x4ddf76=0xc8;}else{_0x4ddf76=0xce;}_0x1223ac[_0xb889('0x18')](_0x4ddf76);return _0x1223ac[_0xb889('0x1e')](_0xb889('0x1f'),_0x5dacbe+'-'+_0x5a0ed6+'/'+_0x23897f)['json'](_0x3bd374);}return null;};}function patchUpdates(_0x390f9c){return function(_0x5094cf){try{jsonpatch[_0xb889('0x20')](_0x5094cf,_0x390f9c,!![]);}catch(_0x2a29fd){return BPromise[_0xb889('0x21')](_0x2a29fd);}return _0x5094cf[_0xb889('0x22')]();};}function saveUpdates(_0x1c86e5,_0x8a204){return function(_0x22f961){if(_0x22f961){return _0x22f961[_0xb889('0x23')](_0x1c86e5)[_0xb889('0x24')](function(_0x567592){return _0x567592;});}return null;};}function removeEntity(_0x3b19e4,_0x43cbc1){return function(_0x1b722f){if(_0x1b722f){return _0x1b722f[_0xb889('0x25')]()[_0xb889('0x24')](function(){_0x3b19e4['status'](0xcc)[_0xb889('0x19')]();});}};}function handleEntityNotFound(_0x3246a1,_0x1b7c45){return function(_0x3798cc){if(!_0x3798cc){_0x3246a1['sendStatus'](0x194);}return _0x3798cc;};}function handleError(_0x1c9a9f,_0x53a432){_0x53a432=_0x53a432||0x1f4;return function(_0x29295e){logger['error'](_0x29295e[_0xb889('0x26')]);if(_0x29295e['name']){delete _0x29295e[_0xb889('0x27')];}_0x1c9a9f[_0xb889('0x18')](_0x53a432)[_0xb889('0x28')](_0x29295e);};}exports['index']=function(_0x440acb,_0x1a5049){var _0xb3a161={},_0x1a288b={},_0x8397fc={'count':0x0,'rows':[]};var _0x3b589a=db[_0xb889('0x29')]['rawAttributes'];_0x1a288b[_0xb889('0x2a')]=_[_0xb889('0x2b')](_0x3b589a);var _0x1ad950={'dateStart':_0x440acb[_0xb889('0x2c')][_0xb889('0x2d')],'dateEnd':_0x440acb[_0xb889('0x2c')][_0xb889('0x2e')]};delete _0x440acb[_0xb889('0x2c')][_0xb889('0x2d')];delete _0x440acb[_0xb889('0x2c')][_0xb889('0x2e')];_0x1a288b[_0xb889('0x2c')]=_['keys'](_0x440acb[_0xb889('0x2c')]);_0x1a288b[_0xb889('0x2f')]=_[_0xb889('0x30')](_0x1a288b[_0xb889('0x2a')],_0x1a288b[_0xb889('0x2c')]);_0xb3a161[_0xb889('0x31')]=_[_0xb889('0x30')](_0x1a288b[_0xb889('0x2a')],qs[_0xb889('0x32')](_0x440acb['query'][_0xb889('0x32')]));_0xb3a161['attributes']=_0xb3a161[_0xb889('0x31')][_0xb889('0x33')]?_0xb3a161['attributes']:_0x1a288b[_0xb889('0x2a')];if(!_0x440acb['query'][_0xb889('0x34')](_0xb889('0x35'))){_0xb3a161['limit']=qs[_0xb889('0x1d')](_0x440acb[_0xb889('0x2c')][_0xb889('0x1d')]);_0xb3a161[_0xb889('0x1c')]=qs[_0xb889('0x1c')](_0x440acb['query'][_0xb889('0x1c')]);}_0xb3a161['order']=qs[_0xb889('0x36')](_0x440acb[_0xb889('0x2c')][_0xb889('0x36')]);_0xb3a161[_0xb889('0x37')]=qs[_0xb889('0x2f')](_[_0xb889('0x38')](_0x440acb[_0xb889('0x2c')],_0x1a288b[_0xb889('0x2f')]));if(_0x1ad950[_0xb889('0x2d')]){if(_0x1ad950[_0xb889('0x2e')]){_0x1ad950[_0xb889('0x2e')]=moment(_0x1ad950[_0xb889('0x2e')])[_0xb889('0x39')](0x1,_0xb889('0x3a'));}else{_0x1ad950['dateEnd']=moment(_0x1ad950[_0xb889('0x2d')])[_0xb889('0x39')](0x1,_0xb889('0x3a'));}_[_0xb889('0x3b')](_0xb3a161[_0xb889('0x37')],{'createdAt':{'$gte':_0x1ad950[_0xb889('0x2d')],'$lte':_0x1ad950['dateEnd']}});}if(_0x440acb[_0xb889('0x2c')][_0xb889('0x3c')]){_0xb3a161[_0xb889('0x37')]=_[_0xb889('0x3b')](_0xb3a161[_0xb889('0x37')],{'$or':_[_0xb889('0x3d')](_0xb3a161[_0xb889('0x31')],function(_0x15fd1e){var _0x30c2dc={};_0x30c2dc[_0x15fd1e]={'$like':'%'+_0x440acb[_0xb889('0x2c')][_0xb889('0x3c')]+'%'};return _0x30c2dc;})});}_0xb3a161=_[_0xb889('0x3b')]({},_0xb3a161,_0x440acb[_0xb889('0x3e')]);var _0x186ee9={'where':_0xb3a161[_0xb889('0x37')]};return db['VoiceExtension']['count'](_0x186ee9)['then'](function(_0x5556c0){_0x8397fc[_0xb889('0x1b')]=_0x5556c0;if(_0x440acb[_0xb889('0x2c')][_0xb889('0x3f')]){_0xb3a161[_0xb889('0x40')]=[{'all':!![]}];}return db[_0xb889('0x29')][_0xb889('0x41')](_0xb3a161);})[_0xb889('0x24')](function(_0x3322f4){_0x8397fc[_0xb889('0x42')]=_0x3322f4;return _0x8397fc;})[_0xb889('0x24')](respondWithFilteredResult(_0x1a5049,_0xb3a161))[_0xb889('0x43')](handleError(_0x1a5049,null));};exports['show']=function(_0x736f3f,_0x9cfc4){var _0x5788d8={'raw':![],'where':{'id':_0x736f3f[_0xb889('0x44')]['id']}},_0x43f9e0={};_0x43f9e0[_0xb889('0x2a')]=_[_0xb889('0x2b')](db[_0xb889('0x29')][_0xb889('0x45')]);_0x43f9e0[_0xb889('0x2c')]=_[_0xb889('0x2b')](_0x736f3f['query']);_0x43f9e0['filters']=_[_0xb889('0x30')](_0x43f9e0[_0xb889('0x2a')],_0x43f9e0[_0xb889('0x2c')]);_0x5788d8[_0xb889('0x31')]=_['intersection'](_0x43f9e0[_0xb889('0x2a')],qs[_0xb889('0x32')](_0x736f3f[_0xb889('0x2c')][_0xb889('0x32')]));_0x5788d8[_0xb889('0x31')]=_0x5788d8[_0xb889('0x31')][_0xb889('0x33')]?_0x5788d8[_0xb889('0x31')]:_0x43f9e0[_0xb889('0x2a')];if(_0x736f3f[_0xb889('0x2c')]['includeAll']){_0x5788d8[_0xb889('0x40')]=[{'all':!![]}];}_0x5788d8=_[_0xb889('0x3b')]({},_0x5788d8,_0x736f3f[_0xb889('0x3e')]);return db[_0xb889('0x29')]['find'](_0x5788d8)[_0xb889('0x24')](handleEntityNotFound(_0x9cfc4,null))[_0xb889('0x24')](respondWithResult(_0x9cfc4,null))[_0xb889('0x43')](handleError(_0x9cfc4,null));};exports[_0xb889('0x25')]=function(_0x4afe33,_0x10b15f){return db[_0xb889('0x29')]['find']({'where':{'id':_0x4afe33['params']['id']}})[_0xb889('0x24')](handleEntityNotFound(_0x10b15f,null))['then'](removeEntity(_0x10b15f,null))[_0xb889('0x43')](handleError(_0x10b15f,null));};exports['create']=function(_0x2c1eca,_0x546265){if(_0x2c1eca['body'][_0xb889('0x46')]===_0xb889('0x47')&&!_[_0xb889('0x48')](_0x2c1eca[_0xb889('0x49')][_0xb889('0x4a')],'_')){_0x2c1eca['body'][_0xb889('0x4a')]='_'['concat'](_0x2c1eca[_0xb889('0x49')][_0xb889('0x4a')]);}return db['VoiceExtension']['create'](_0x2c1eca[_0xb889('0x49')],{'raw':![]})[_0xb889('0x24')](respondWithResult(_0x546265,0xc9))[_0xb889('0x43')](handleError(_0x546265,null));};exports[_0xb889('0x23')]=function(_0x2f9af6,_0x443ada){if(_0x2f9af6[_0xb889('0x49')]['id']){delete _0x2f9af6[_0xb889('0x49')]['id'];}return db[_0xb889('0x29')]['find']({'where':{'id':_0x2f9af6[_0xb889('0x44')]['id']}})[_0xb889('0x24')](handleEntityNotFound(_0x443ada,null))[_0xb889('0x24')](function(_0x26a749){if(_0x26a749){return db[_0xb889('0x29')][_0xb889('0x23')](_[_0xb889('0x38')](_0x2f9af6[_0xb889('0x49')],['exten',_0xb889('0x4b'),_0xb889('0x4c'),_0xb889('0x4d'),_0xb889('0x4e')]),{'where':{'context':_0x26a749[_0xb889('0x4b')],'exten':_0x26a749[_0xb889('0x4a')]},'individualHooks':!![]})[_0xb889('0x24')](function(_0x4abb18){return _0x4abb18;});}return null;})[_0xb889('0x24')](respondWithStatusCode(_0x443ada,null))[_0xb889('0x43')](handleError(_0x443ada,null));};exports[_0xb889('0x4f')]=function(_0x3ed13f,_0x512f8c,_0x238f21){return db[_0xb889('0x29')][_0xb889('0x50')]({'where':{'id':_0x3ed13f[_0xb889('0x44')]['id']}})['then'](handleEntityNotFound(_0x512f8c,null))[_0xb889('0x24')](function(_0x33b4ce){if(_0x33b4ce){return db['sequelize'][_0xb889('0x51')](function(_0x5a4895){return db[_0xb889('0x29')]['destroy']({'where':{'VoiceExtensionId':_0x3ed13f[_0xb889('0x44')]['id']},'transaction':_0x5a4895})[_0xb889('0x24')](function(_0x45f540){var _0x2dd694=_[_0xb889('0x3d')](_0x3ed13f[_0xb889('0x49')],function(_0x2941c5){_0x2941c5[_0xb889('0x52')]=_0x3ed13f['params']['id'];return _0x2941c5;});return db[_0xb889('0x29')][_0xb889('0x53')](_0x2dd694,{'transaction':_0x5a4895});});})[_0xb889('0x24')](function(){return db[_0xb889('0x29')][_0xb889('0x54')]({'where':{'isApp':!![],'VoiceExtensionId':_0x3ed13f[_0xb889('0x44')]['id']},'order':_0xb889('0x55')});});}})['then'](respondWithResult(_0x512f8c,null))[_0xb889('0x43')](handleError(_0x512f8c,null));};
\ No newline at end of file
index dc48702..6cfb3e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3d4=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2faa31,_0x3e33c3){var _0x4ba971=function(_0x455912){while(--_0x455912){_0x2faa31['push'](_0x2faa31['shift']());}};_0x4ba971(++_0x3e33c3);}(_0xc3d4,0x1b7));var _0x4c3d=function(_0x5b45da,_0x52bb87){_0x5b45da=_0x5b45da-0x0;var _0x2327f7=_0xc3d4[_0x5b45da];return _0x2327f7;};'use strict';var EventEmitter=require(_0x4c3d('0x0'));var VoiceExtension=require(_0x4c3d('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x4c3d('0x2')](0x0);var events={'afterCreate':_0x4c3d('0x3'),'afterUpdate':_0x4c3d('0x4'),'afterDestroy':_0x4c3d('0x5')};function emitEvent(_0x359417){return function(_0x24d80a,_0x4f383b,_0x17e692){VoiceExtensionEvents[_0x4c3d('0x6')](_0x359417+':'+_0x24d80a['id'],_0x24d80a);VoiceExtensionEvents[_0x4c3d('0x6')](_0x359417,_0x24d80a);_0x17e692(null);};}for(var e in events){if(events[_0x4c3d('0x7')](e)){var event=events[e];VoiceExtension[_0x4c3d('0x8')](e,emitEvent(event));}}module[_0x4c3d('0x9')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0xae91=['remove','emit','hasOwnProperty','hook','events','VoiceExtension','update'];(function(_0x15af0f,_0x5454ce){var _0x2bd1cb=function(_0x593818){while(--_0x593818){_0x15af0f['push'](_0x15af0f['shift']());}};_0x2bd1cb(++_0x5454ce);}(_0xae91,0x13f));var _0x1ae9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xae91[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0x1ae9('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x1ae9('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1ae9('0x2'),'afterDestroy':_0x1ae9('0x3')};function emitEvent(_0x2338c5){return function(_0x4eecee,_0x318371,_0x3abc5c){VoiceExtensionEvents[_0x1ae9('0x4')](_0x2338c5+':'+_0x4eecee['id'],_0x4eecee);VoiceExtensionEvents[_0x1ae9('0x4')](_0x2338c5,_0x4eecee);_0x3abc5c(null);};}for(var e in events){if(events[_0x1ae9('0x5')](e)){var event=events[e];VoiceExtension[_0x1ae9('0x6')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
index ad24b97..0404fa8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec2c=['../../config/logger','api','moment','request-promise','./voiceExtension.attributes','exports','VoiceExtension','voice_extensions','lodash'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0xec2c,0x13a));var _0xcec2=function(_0x1abeb2,_0x79f462){_0x1abeb2=_0x1abeb2-0x0;var _0x48da20=_0xec2c[_0x1abeb2];return _0x48da20;};'use strict';var _=require(_0xcec2('0x0'));var util=require('util');var logger=require(_0xcec2('0x1'))(_0xcec2('0x2'));var moment=require(_0xcec2('0x3'));var BPromise=require('bluebird');var rp=require(_0xcec2('0x4'));var attributes=require(_0xcec2('0x5'));module[_0xcec2('0x6')]=function(_0x33b14b,_0x338ac3){return _0x33b14b['define'](_0xcec2('0x7'),attributes,{'tableName':_0xcec2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaf5e=['lodash','util','../../config/logger','api','bluebird','request-promise','./voiceExtension.attributes','define','voice_extensions'];(function(_0x432987,_0x5b96a2){var _0x47ce4a=function(_0x1af2f7){while(--_0x1af2f7){_0x432987['push'](_0x432987['shift']());}};_0x47ce4a(++_0x5b96a2);}(_0xaf5e,0xab));var _0xeaf5=function(_0x56606b,_0x22ce39){_0x56606b=_0x56606b-0x0;var _0x2c566e=_0xaf5e[_0x56606b];return _0x2c566e;};'use strict';var _=require(_0xeaf5('0x0'));var util=require(_0xeaf5('0x1'));var logger=require(_0xeaf5('0x2'))(_0xeaf5('0x3'));var moment=require('moment');var BPromise=require(_0xeaf5('0x4'));var rp=require(_0xeaf5('0x5'));var attributes=require(_0xeaf5('0x6'));module['exports']=function(_0x34a1b4,_0x26be63){return _0x34a1b4[_0xeaf5('0x7')]('VoiceExtension',attributes,{'tableName':_0xeaf5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 802eace..1888129 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9354=['attributes','limit','include','model','map','stringify','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','socket.io-emitter','localhost','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetVoiceExtension','VoiceExtension','options','raw','where'];(function(_0x4cc21a,_0x3677fe){var _0x426d76=function(_0x80c9c9){while(--_0x80c9c9){_0x4cc21a['push'](_0x4cc21a['shift']());}};_0x426d76(++_0x3677fe);}(_0x9354,0x96));var _0x4935=function(_0x26df48,_0x22aa50){_0x26df48=_0x26df48-0x0;var _0x209047=_0x9354[_0x26df48];return _0x209047;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var moment=require(_0x4935('0x1'));var BPromise=require('bluebird');var rs=require(_0x4935('0x2'));var fs=require('fs');var db=require(_0x4935('0x3'))['db'];var utils=require(_0x4935('0x4'));var logger=require(_0x4935('0x5'))('rpc');var config=require(_0x4935('0x6'));var jayson=require(_0x4935('0x7'));var client=jayson[_0x4935('0x8')][_0x4935('0x9')]({'port':0x232a});var socket=require(_0x4935('0xa'))({'host':_0x4935('0xb'),'port':0x18eb});require(_0x4935('0xc'))[_0x4935('0xd')](socket);function respondWithRpcPromise(_0x10793e,_0x4c9902,_0x30c8b9){return new BPromise(function(_0x47a44f,_0x2aac9a){return client[_0x4935('0xe')](_0x10793e,_0x30c8b9)[_0x4935('0xf')](function(_0x22a83f){logger[_0x4935('0x10')](_0x4935('0x11'),_0x4c9902,'request\x20sent');logger['debug'](_0x4935('0x12'),_0x4c9902,'request\x20sent',JSON['stringify'](_0x22a83f));if(_0x22a83f[_0x4935('0x13')]){if(_0x22a83f[_0x4935('0x13')][_0x4935('0x14')]===0x1f4){logger[_0x4935('0x13')](_0x4935('0x11'),_0x4c9902,_0x22a83f[_0x4935('0x13')][_0x4935('0x15')]);return _0x2aac9a(_0x22a83f[_0x4935('0x13')][_0x4935('0x15')]);}logger[_0x4935('0x13')](_0x4935('0x11'),_0x4c9902,_0x22a83f[_0x4935('0x13')][_0x4935('0x15')]);return _0x47a44f(_0x22a83f[_0x4935('0x13')][_0x4935('0x15')]);}else{logger[_0x4935('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x4c9902,_0x4935('0x16'));_0x47a44f(_0x22a83f[_0x4935('0x17')][_0x4935('0x15')]);}})[_0x4935('0x18')](function(_0x1f0e81){logger[_0x4935('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x4c9902,_0x1f0e81);_0x2aac9a(_0x1f0e81);});});}exports[_0x4935('0x19')]=function(_0x145277){var _0x4fe356=this;return new Promise(function(_0x288eff,_0x10407f){return db[_0x4935('0x1a')]['findAll']({'raw':_0x145277['options']?_0x145277[_0x4935('0x1b')][_0x4935('0x1c')]===undefined?!![]:![]:!![],'where':_0x145277[_0x4935('0x1b')]?_0x145277[_0x4935('0x1b')][_0x4935('0x1d')]||null:null,'attributes':_0x145277[_0x4935('0x1b')]?_0x145277[_0x4935('0x1b')][_0x4935('0x1e')]||null:null,'limit':_0x145277['options']?_0x145277[_0x4935('0x1b')][_0x4935('0x1f')]||null:null,'include':_0x145277[_0x4935('0x1b')]?_0x145277[_0x4935('0x1b')][_0x4935('0x20')]?_['map'](_0x145277['options'][_0x4935('0x20')],function(_0x142fdf){return{'model':db[_0x142fdf[_0x4935('0x21')]],'as':_0x142fdf['as'],'attributes':_0x142fdf[_0x4935('0x1e')],'include':_0x142fdf[_0x4935('0x20')]?_[_0x4935('0x22')](_0x142fdf[_0x4935('0x20')],function(_0x1d53a7){return{'model':db[_0x1d53a7[_0x4935('0x21')]],'as':_0x1d53a7['as'],'attributes':_0x1d53a7[_0x4935('0x1e')],'include':_0x1d53a7[_0x4935('0x20')]?_[_0x4935('0x22')](_0x1d53a7[_0x4935('0x20')],function(_0xbb00d6){return{'model':db[_0xbb00d6[_0x4935('0x21')]],'as':_0xbb00d6['as'],'attributes':_0xbb00d6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cec4d){logger[_0x4935('0x10')](_0x4935('0x19'),_0x145277);logger['debug'](_0x4935('0x19'),_0x145277,JSON[_0x4935('0x23')](_0x5cec4d));_0x288eff(_0x5cec4d);})[_0x4935('0x18')](function(_0x9fe9f6){logger[_0x4935('0x13')](_0x4935('0x19'),_0x9fe9f6[_0x4935('0x15')],_0x145277);_0x10407f(_0x4fe356[_0x4935('0x13')](0x1f4,_0x9fe9f6['message']));});});};
\ No newline at end of file
+var _0x0bb5=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','localhost','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','include','map','model','lodash','util'];(function(_0x214edb,_0x18316a){var _0x1c4874=function(_0x5d4855){while(--_0x5d4855){_0x214edb['push'](_0x214edb['shift']());}};_0x1c4874(++_0x18316a);}(_0x0bb5,0x148));var _0x50bb=function(_0x3a9ad5,_0x106192){_0x3a9ad5=_0x3a9ad5-0x0;var _0x1f71e8=_0x0bb5[_0x3a9ad5];return _0x1f71e8;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x50bb('0x2'));var fs=require('fs');var db=require(_0x50bb('0x3'))['db'];var utils=require(_0x50bb('0x4'));var logger=require(_0x50bb('0x5'))(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var jayson=require(_0x50bb('0x8'));var client=jayson[_0x50bb('0x9')]['http']({'port':0x232a});var socket=require('socket.io-emitter')({'host':_0x50bb('0xa'),'port':0x18eb});require(_0x50bb('0xb'))[_0x50bb('0xc')](socket);function respondWithRpcPromise(_0x33ff54,_0x4f9172,_0x4ab8d7){return new BPromise(function(_0x2bede8,_0x1c2174){return client[_0x50bb('0xd')](_0x33ff54,_0x4ab8d7)[_0x50bb('0xe')](function(_0x5512e1){logger[_0x50bb('0xf')](_0x50bb('0x10'),_0x4f9172,_0x50bb('0x11'));logger[_0x50bb('0x12')](_0x50bb('0x13'),_0x4f9172,_0x50bb('0x11'),JSON[_0x50bb('0x14')](_0x5512e1));if(_0x5512e1['error']){if(_0x5512e1[_0x50bb('0x15')]['code']===0x1f4){logger[_0x50bb('0x15')](_0x50bb('0x10'),_0x4f9172,_0x5512e1[_0x50bb('0x15')]['message']);return _0x1c2174(_0x5512e1[_0x50bb('0x15')][_0x50bb('0x16')]);}logger[_0x50bb('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x4f9172,_0x5512e1[_0x50bb('0x15')]['message']);return _0x2bede8(_0x5512e1[_0x50bb('0x15')][_0x50bb('0x16')]);}else{logger[_0x50bb('0xf')](_0x50bb('0x10'),_0x4f9172,_0x50bb('0x11'));_0x2bede8(_0x5512e1['result'][_0x50bb('0x16')]);}})[_0x50bb('0x17')](function(_0x4b1f5f){logger[_0x50bb('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x4f9172,_0x4b1f5f);_0x1c2174(_0x4b1f5f);});});}exports[_0x50bb('0x18')]=function(_0x431ed4){var _0x4b06f5=this;return new Promise(function(_0x4f1c0a,_0x43465b){return db[_0x50bb('0x19')][_0x50bb('0x1a')]({'raw':_0x431ed4[_0x50bb('0x1b')]?_0x431ed4['options'][_0x50bb('0x1c')]===undefined?!![]:![]:!![],'where':_0x431ed4[_0x50bb('0x1b')]?_0x431ed4[_0x50bb('0x1b')]['where']||null:null,'attributes':_0x431ed4[_0x50bb('0x1b')]?_0x431ed4[_0x50bb('0x1b')][_0x50bb('0x1d')]||null:null,'limit':_0x431ed4['options']?_0x431ed4[_0x50bb('0x1b')]['limit']||null:null,'include':_0x431ed4[_0x50bb('0x1b')]?_0x431ed4[_0x50bb('0x1b')][_0x50bb('0x1e')]?_[_0x50bb('0x1f')](_0x431ed4[_0x50bb('0x1b')][_0x50bb('0x1e')],function(_0x4f7f73){return{'model':db[_0x4f7f73[_0x50bb('0x20')]],'as':_0x4f7f73['as'],'attributes':_0x4f7f73[_0x50bb('0x1d')],'include':_0x4f7f73[_0x50bb('0x1e')]?_[_0x50bb('0x1f')](_0x4f7f73['include'],function(_0x75fea6){return{'model':db[_0x75fea6['model']],'as':_0x75fea6['as'],'attributes':_0x75fea6['attributes'],'include':_0x75fea6[_0x50bb('0x1e')]?_['map'](_0x75fea6['include'],function(_0x41fd89){return{'model':db[_0x41fd89[_0x50bb('0x20')]],'as':_0x41fd89['as'],'attributes':_0x41fd89[_0x50bb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x50bb('0xe')](function(_0x17c158){logger[_0x50bb('0xf')](_0x50bb('0x18'),_0x431ed4);logger[_0x50bb('0x12')]('GetVoiceExtension',_0x431ed4,JSON[_0x50bb('0x14')](_0x17c158));_0x4f1c0a(_0x17c158);})[_0x50bb('0x17')](function(_0x15ee2e){logger[_0x50bb('0x15')]('GetVoiceExtension',_0x15ee2e[_0x50bb('0x16')],_0x431ed4);_0x43465b(_0x4b06f5[_0x50bb('0x15')](0x1f4,_0x15ee2e[_0x50bb('0x16')]));});});};
\ No newline at end of file
index 1dd12c4..99074be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8384=['register','length','voiceExtension:','./voiceExtension.events','remove','update','emit'];(function(_0x33c603,_0x6d0ce4){var _0xae96f4=function(_0x2679f8){while(--_0x2679f8){_0x33c603['push'](_0x33c603['shift']());}};_0xae96f4(++_0x6d0ce4);}(_0x8384,0xb9));var _0x4838=function(_0x14c00f,_0x11b192){_0x14c00f=_0x14c00f-0x0;var _0x19fbda=_0x8384[_0x14c00f];return _0x19fbda;};'use strict';var VoiceExtensionEvents=require(_0x4838('0x0'));var events=['save',_0x4838('0x1'),_0x4838('0x2')];function createListener(_0x4454c0,_0xa84692){return function(_0x56c66d){_0xa84692[_0x4838('0x3')](_0x4454c0,_0x56c66d);};}function removeListener(_0x5b3e07,_0x5575d6){return function(){VoiceExtensionEvents['removeListener'](_0x5b3e07,_0x5575d6);};}exports[_0x4838('0x4')]=function(_0x136594){for(var _0x19f71c=0x0,_0x3c92f8=events[_0x4838('0x5')];_0x19f71c<_0x3c92f8;_0x19f71c++){var _0x11fe4c=events[_0x19f71c];var _0xa0e502=createListener(_0x4838('0x6')+_0x11fe4c,_0x136594);VoiceExtensionEvents['on'](_0x11fe4c,_0xa0e502);}};
\ No newline at end of file
+var _0xa180=['update','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove'];(function(_0x486eff,_0x5cb3b0){var _0x95293b=function(_0x25b947){while(--_0x25b947){_0x486eff['push'](_0x486eff['shift']());}};_0x95293b(++_0x5cb3b0);}(_0xa180,0x19b));var _0x0a18=function(_0x461ecd,_0x3f5232){_0x461ecd=_0x461ecd-0x0;var _0x5b324a=_0xa180[_0x461ecd];return _0x5b324a;};'use strict';var VoiceExtensionEvents=require(_0x0a18('0x0'));var events=[_0x0a18('0x1'),_0x0a18('0x2'),_0x0a18('0x3')];function createListener(_0x3f3467,_0x77c43c){return function(_0x53169b){_0x77c43c[_0x0a18('0x4')](_0x3f3467,_0x53169b);};}function removeListener(_0x322bb1,_0x25f704){return function(){VoiceExtensionEvents[_0x0a18('0x5')](_0x322bb1,_0x25f704);};}exports[_0x0a18('0x6')]=function(_0x2f3c51){for(var _0x5a1c76=0x0,_0x4e694d=events[_0x0a18('0x7')];_0x5a1c76<_0x4e694d;_0x5a1c76++){var _0x4b2789=events[_0x5a1c76];var _0x285481=createListener(_0x0a18('0x8')+_0x4b2789,_0x2f3c51);VoiceExtensionEvents['on'](_0x4b2789,_0x285481);}};
\ No newline at end of file
index 6cdaea7..18a525c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['/:id','show','create','put','update','exports','multer','util','path','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index'];(function(_0x151334,_0x1e11ac){var _0x3d03da=function(_0x2099cf){while(--_0x2099cf){_0x151334['push'](_0x151334['shift']());}};_0x3d03da(++_0x1e11ac);}(_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 express=require('express');var router=express['Router']();var auth=require(_0x0a9e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0a9e('0x4'));var controller=require(_0x0a9e('0x5'));router[_0x0a9e('0x6')]('/',auth[_0x0a9e('0x7')](),controller[_0x0a9e('0x8')]);router['get'](_0x0a9e('0x9'),auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xa')]);router['get']('/:id/messages',auth[_0x0a9e('0x7')](),controller['getMessages']);router['post']('/',auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')](_0x0a9e('0x9'),auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x0a9e('0xe')]=router;
\ No newline at end of file
+var _0xa9e0=['/:id','show','create','put','update','exports','multer','util','path','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index'];(function(_0x5068d5,_0x353c3d){var _0x22123e=function(_0x3cf8ee){while(--_0x3cf8ee){_0x5068d5['push'](_0x5068d5['shift']());}};_0x22123e(++_0x353c3d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x0a9e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0a9e('0x4'));var controller=require(_0x0a9e('0x5'));router[_0x0a9e('0x6')]('/',auth[_0x0a9e('0x7')](),controller[_0x0a9e('0x8')]);router['get'](_0x0a9e('0x9'),auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xa')]);router['get']('/:id/messages',auth[_0x0a9e('0x7')](),controller['getMessages']);router['post']('/',auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')](_0x0a9e('0x9'),auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x0a9e('0xe')]=router;
\ No newline at end of file
index 52a0363..db230e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad08=['from-voicemail','contest_mailbox','email','string','trim','central','yes','ENUM','TIMESTAMP','INTEGER','sequelize','STRING'];(function(_0x3a1cc0,_0x5de3f2){var _0x14a206=function(_0x3d9548){while(--_0x3d9548){_0x3a1cc0['push'](_0x3a1cc0['shift']());}};_0x14a206(++_0x5de3f2);}(_0xad08,0x15a));var _0x8ad0=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xad08[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x8ad0('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x8ad0('0x1')]},'context':{'type':Sequelize[_0x8ad0('0x1')],'defaultValue':_0x8ad0('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x8ad0('0x1')],'defaultValue':'','allowNull':![],'unique':_0x8ad0('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x8ad0('0x1')]},'email':{'type':Sequelize[_0x8ad0('0x1')],'validate':{'isEmail':!![]},'set':function(_0x16bf96){this['setDataValue'](_0x8ad0('0x4'),typeof _0x16bf96===_0x8ad0('0x5')&&_0x16bf96[_0x8ad0('0x6')]()?_0x16bf96[_0x8ad0('0x6')]():null);}},'pager':{'type':Sequelize[_0x8ad0('0x1')]},'tz':{'type':Sequelize[_0x8ad0('0x1')],'defaultValue':_0x8ad0('0x7')},'attach':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x8ad0('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x8ad0('0x9')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x8ad0('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x8ad0('0x9')](_0x8ad0('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x8ad0('0x9')](_0x8ad0('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x8ad0('0x9')](_0x8ad0('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x8ad0('0x9')](_0x8ad0('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x8ad0('0x9')](_0x8ad0('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x8ad0('0x9')](_0x8ad0('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x8ad0('0x9')]('yes','no'),'defaultValue':_0x8ad0('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x8ad0('0x9')](_0x8ad0('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x8ad0('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x8ad0('0x9')](_0x8ad0('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x8ad0('0xa')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x8ad0('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]}};
\ No newline at end of file
+var _0x9212=['TINYINT(4)','TIMESTAMP','INTEGER','sequelize','STRING','from-voicemail','contest_mailbox','email','string','trim','ENUM','yes'];(function(_0x3bd4ec,_0x4cb5ce){var _0x5062dc=function(_0x1e14a3){while(--_0x1e14a3){_0x3bd4ec['push'](_0x3bd4ec['shift']());}};_0x5062dc(++_0x4cb5ce);}(_0x9212,0x183));var _0x2921=function(_0x1a809b,_0x4c15e3){_0x1a809b=_0x1a809b-0x0;var _0x5d90e6=_0x9212[_0x1a809b];return _0x5d90e6;};'use strict';var Sequelize=require(_0x2921('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x2921('0x1')]},'context':{'type':Sequelize[_0x2921('0x1')],'defaultValue':_0x2921('0x2'),'unique':_0x2921('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x2921('0x3')},'password':{'type':Sequelize[_0x2921('0x1')]},'fullname':{'type':Sequelize[_0x2921('0x1')]},'email':{'type':Sequelize[_0x2921('0x1')],'validate':{'isEmail':!![]},'set':function(_0x2925cd){this['setDataValue'](_0x2921('0x4'),typeof _0x2925cd===_0x2921('0x5')&&_0x2925cd[_0x2921('0x6')]()?_0x2925cd[_0x2921('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize[_0x2921('0x7')](_0x2921('0x8'),'no'),'defaultValue':_0x2921('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x2921('0x7')](_0x2921('0x8'),'no'),'defaultValue':_0x2921('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x2921('0x1')]},'callback':{'type':Sequelize[_0x2921('0x1')]},'review':{'type':Sequelize[_0x2921('0x7')](_0x2921('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x2921('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x2921('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x2921('0x7')](_0x2921('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x2921('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x2921('0x7')](_0x2921('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x2921('0x7')](_0x2921('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x2921('0x7')](_0x2921('0x8'),'no'),'defaultValue':_0x2921('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x2921('0x7')](_0x2921('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x2921('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x2921('0x8'),'no'),'defaultValue':_0x2921('0x8'),'allowNull':![]},'stamp':{'type':_0x2921('0xa')},'emailsubject':{'type':Sequelize[_0x2921('0x1')]},'emailbody':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x2921('0x1')]},'maxsecs':{'type':Sequelize[_0x2921('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x2921('0xb')](0xff),'defaultValue':0x64,'allowNull':![]}};
\ No newline at end of file
index a5b159b..919e9b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb40e=['mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day','filter','merge','map','options','count','includeAll','include','VoiceMail','rows','catch','show','fields','find','create','body','params','VoiceMailMessage','mailbox','findAndCountAll','html-pdf','rimraf','request-promise','bluebird'];(function(_0x5d0904,_0x581ba6){var _0x3868f5=function(_0x5a0866){while(--_0x5a0866){_0x5d0904['push'](_0x5d0904['shift']());}};_0x3868f5(++_0x581ba6);}(_0xb40e,0x120));var _0xeb40=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0xb40e[_0x5b27da];return _0x3254f4;};'use strict';var pdf=require(_0xeb40('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xeb40('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xeb40('0x2'));var moment=require('moment');var BPromise=require(_0xeb40('0x3'));var Mustache=require(_0xeb40('0x4'));var util=require('util');var path=require(_0xeb40('0x5'));var sox=require(_0xeb40('0x6'));var csv=require(_0xeb40('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xeb40('0x8'));var squel=require(_0xeb40('0x9'));var crypto=require(_0xeb40('0xa'));var jsforce=require(_0xeb40('0xb'));var deskjs=require(_0xeb40('0xc'));var toCsv=require(_0xeb40('0x7'));var querystring=require(_0xeb40('0xd'));var Papa=require(_0xeb40('0xe'));var qs=require(_0xeb40('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xeb40('0x10'));var config=require(_0xeb40('0x11'));var db=require(_0xeb40('0x12'))['db'];function respondWithStatusCode(_0x8de652,_0x433bea){_0x433bea=_0x433bea||0xcc;return function(_0x311f97){if(_0x311f97){return _0x8de652[_0xeb40('0x13')](_0x433bea);}return _0x8de652['status'](_0x433bea)[_0xeb40('0x14')]();};}function respondWithResult(_0x21171c,_0x127b76){_0x127b76=_0x127b76||0xc8;return function(_0x1339ce){if(_0x1339ce){return _0x21171c[_0xeb40('0x15')](_0x127b76)[_0xeb40('0x16')](_0x1339ce);}};}function respondWithFilteredResult(_0xccbff3,_0x5139e2){return function(_0x1926fa){if(_0x1926fa){var _0x1dbaad=_0x1926fa['count'],_0x17a445=_0x5139e2[_0xeb40('0x17')],_0x17f2e6=_0x5139e2[_0xeb40('0x17')]+_0x5139e2[_0xeb40('0x18')],_0x4e3e0c;if(_0x17f2e6>=_0x1dbaad){_0x17f2e6=_0x1dbaad;_0x4e3e0c=0xc8;}else{_0x4e3e0c=0xce;}_0xccbff3['status'](_0x4e3e0c);return _0xccbff3[_0xeb40('0x19')](_0xeb40('0x1a'),_0x17a445+'-'+_0x17f2e6+'/'+_0x1dbaad)[_0xeb40('0x16')](_0x1926fa);}return null;};}function patchUpdates(_0x4a9e36){return function(_0x5ce323){try{jsonpatch['apply'](_0x5ce323,_0x4a9e36,!![]);}catch(_0x23fb38){return BPromise[_0xeb40('0x1b')](_0x23fb38);}return _0x5ce323[_0xeb40('0x1c')]();};}function saveUpdates(_0x5d2a28,_0x30736f){return function(_0xb60b8c){if(_0xb60b8c){return _0xb60b8c[_0xeb40('0x1d')](_0x5d2a28)[_0xeb40('0x1e')](function(_0x1f55fc){return _0x1f55fc;});}return null;};}function removeEntity(_0x261a2e,_0x354c78){return function(_0x32d77e){if(_0x32d77e){return _0x32d77e[_0xeb40('0x1f')]()[_0xeb40('0x1e')](function(){_0x261a2e['status'](0xcc)[_0xeb40('0x14')]();});}};}function handleEntityNotFound(_0x2c104b,_0xce3ed9){return function(_0x1a639c){if(!_0x1a639c){_0x2c104b[_0xeb40('0x13')](0x194);}return _0x1a639c;};}function handleError(_0x4ca6d6,_0x477bb6){_0x477bb6=_0x477bb6||0x1f4;return function(_0x187329){logger[_0xeb40('0x20')](_0x187329[_0xeb40('0x21')]);if(_0x187329[_0xeb40('0x22')]){delete _0x187329[_0xeb40('0x22')];}_0x4ca6d6[_0xeb40('0x15')](_0x477bb6)['send'](_0x187329);};}exports[_0xeb40('0x23')]=function(_0x11b3da,_0x2d6f78){var _0x122a27={},_0x52b688={},_0x304b5c={'count':0x0,'rows':[]};var _0x32d147=db['VoiceMail'][_0xeb40('0x24')];_0x52b688['model']=_[_0xeb40('0x25')](_0x32d147);var _0x1b8836={'dateStart':_0x11b3da[_0xeb40('0x26')][_0xeb40('0x27')],'dateEnd':_0x11b3da[_0xeb40('0x26')][_0xeb40('0x28')]};delete _0x11b3da[_0xeb40('0x26')][_0xeb40('0x27')];delete _0x11b3da['query'][_0xeb40('0x28')];_0x52b688[_0xeb40('0x26')]=_[_0xeb40('0x25')](_0x11b3da['query']);_0x52b688[_0xeb40('0x29')]=_[_0xeb40('0x2a')](_0x52b688[_0xeb40('0x2b')],_0x52b688[_0xeb40('0x26')]);_0x122a27[_0xeb40('0x2c')]=_[_0xeb40('0x2a')](_0x52b688[_0xeb40('0x2b')],qs['fields'](_0x11b3da[_0xeb40('0x26')]['fields']));_0x122a27[_0xeb40('0x2c')]=_0x122a27[_0xeb40('0x2c')][_0xeb40('0x2d')]?_0x122a27['attributes']:_0x52b688[_0xeb40('0x2b')];if(!_0x11b3da[_0xeb40('0x26')][_0xeb40('0x2e')](_0xeb40('0x2f'))){_0x122a27[_0xeb40('0x18')]=qs[_0xeb40('0x18')](_0x11b3da['query'][_0xeb40('0x18')]);_0x122a27['offset']=qs['offset'](_0x11b3da[_0xeb40('0x26')][_0xeb40('0x17')]);}_0x122a27[_0xeb40('0x30')]=qs[_0xeb40('0x31')](_0x11b3da[_0xeb40('0x26')]['sort']);_0x122a27[_0xeb40('0x32')]=qs[_0xeb40('0x29')](_[_0xeb40('0x33')](_0x11b3da['query'],_0x52b688[_0xeb40('0x29')]));if(_0x1b8836[_0xeb40('0x27')]){if(_0x1b8836['dateEnd']){_0x1b8836[_0xeb40('0x28')]=moment(_0x1b8836[_0xeb40('0x28')])[_0xeb40('0x34')](0x1,_0xeb40('0x35'));}else{_0x1b8836['dateEnd']=moment(_0x1b8836[_0xeb40('0x27')])[_0xeb40('0x34')](0x1,_0xeb40('0x35'));}_['merge'](_0x122a27['where'],{'createdAt':{'$gte':_0x1b8836['dateStart'],'$lte':_0x1b8836['dateEnd']}});}if(_0x11b3da[_0xeb40('0x26')][_0xeb40('0x36')]){_0x122a27['where']=_[_0xeb40('0x37')](_0x122a27[_0xeb40('0x32')],{'$or':_[_0xeb40('0x38')](_0x122a27[_0xeb40('0x2c')],function(_0x306ed7){var _0x172849={};_0x172849[_0x306ed7]={'$like':'%'+_0x11b3da['query']['filter']+'%'};return _0x172849;})});}_0x122a27=_[_0xeb40('0x37')]({},_0x122a27,_0x11b3da[_0xeb40('0x39')]);var _0x59b543={'where':_0x122a27[_0xeb40('0x32')]};return db['VoiceMail'][_0xeb40('0x3a')](_0x59b543)['then'](function(_0x522f83){_0x304b5c[_0xeb40('0x3a')]=_0x522f83;if(_0x11b3da[_0xeb40('0x26')][_0xeb40('0x3b')]){_0x122a27[_0xeb40('0x3c')]=[{'all':!![]}];}return db[_0xeb40('0x3d')]['findAll'](_0x122a27);})[_0xeb40('0x1e')](function(_0x44eebd){_0x304b5c[_0xeb40('0x3e')]=_0x44eebd;return _0x304b5c;})[_0xeb40('0x1e')](respondWithFilteredResult(_0x2d6f78,_0x122a27))[_0xeb40('0x3f')](handleError(_0x2d6f78,null));};exports[_0xeb40('0x40')]=function(_0xac5919,_0x3c3c27){var _0xc7598c={'raw':!![],'where':{'id':_0xac5919['params']['id']}},_0x4071a1={};_0x4071a1[_0xeb40('0x2b')]=_[_0xeb40('0x25')](db[_0xeb40('0x3d')][_0xeb40('0x24')]);_0x4071a1[_0xeb40('0x26')]=_['keys'](_0xac5919[_0xeb40('0x26')]);_0x4071a1[_0xeb40('0x29')]=_[_0xeb40('0x2a')](_0x4071a1[_0xeb40('0x2b')],_0x4071a1[_0xeb40('0x26')]);_0xc7598c[_0xeb40('0x2c')]=_['intersection'](_0x4071a1[_0xeb40('0x2b')],qs[_0xeb40('0x41')](_0xac5919[_0xeb40('0x26')][_0xeb40('0x41')]));_0xc7598c[_0xeb40('0x2c')]=_0xc7598c['attributes'][_0xeb40('0x2d')]?_0xc7598c[_0xeb40('0x2c')]:_0x4071a1['model'];if(_0xac5919[_0xeb40('0x26')][_0xeb40('0x3b')]){_0xc7598c['include']=[{'all':!![]}];}_0xc7598c=_[_0xeb40('0x37')]({},_0xc7598c,_0xac5919[_0xeb40('0x39')]);return db[_0xeb40('0x3d')][_0xeb40('0x42')](_0xc7598c)[_0xeb40('0x1e')](handleEntityNotFound(_0x3c3c27,null))[_0xeb40('0x1e')](respondWithResult(_0x3c3c27,null))['catch'](handleError(_0x3c3c27,null));};exports[_0xeb40('0x43')]=function(_0x179c96,_0x519809){return db[_0xeb40('0x3d')][_0xeb40('0x43')](_0x179c96['body'],{})['then'](respondWithResult(_0x519809,0xc9))['catch'](handleError(_0x519809,null));};exports[_0xeb40('0x1d')]=function(_0x2d5f74,_0x1e46b6){if(_0x2d5f74[_0xeb40('0x44')]['id']){delete _0x2d5f74[_0xeb40('0x44')]['id'];}return db[_0xeb40('0x3d')][_0xeb40('0x42')]({'where':{'id':_0x2d5f74[_0xeb40('0x45')]['id']}})[_0xeb40('0x1e')](handleEntityNotFound(_0x1e46b6,null))[_0xeb40('0x1e')](saveUpdates(_0x2d5f74['body'],null))['then'](respondWithResult(_0x1e46b6,null))['catch'](handleError(_0x1e46b6,null));};exports[_0xeb40('0x1f')]=function(_0x57ad4d,_0x165804){return db[_0xeb40('0x3d')]['find']({'where':{'id':_0x57ad4d[_0xeb40('0x45')]['id']}})[_0xeb40('0x1e')](handleEntityNotFound(_0x165804,null))[_0xeb40('0x1e')](removeEntity(_0x165804,null))[_0xeb40('0x3f')](handleError(_0x165804,null));};exports['getMessages']=function(_0x2c52f7,_0x303a41,_0x3f8818){return db[_0xeb40('0x3d')]['findOne']({'where':{'id':_0x2c52f7[_0xeb40('0x45')]['id']}})[_0xeb40('0x1e')](handleEntityNotFound(_0x303a41,null))[_0xeb40('0x1e')](function(_0x28ba1b){var _0x390031;var _0x2259a9={},_0x2c973d={};_0x2c973d['model']=_[_0xeb40('0x25')](db[_0xeb40('0x46')][_0xeb40('0x24')]);_0x2c973d[_0xeb40('0x26')]=_[_0xeb40('0x25')](_0x2c52f7['query']);_0x2c973d['filters']=_[_0xeb40('0x2a')](_0x2c973d[_0xeb40('0x2b')],_0x2c973d[_0xeb40('0x26')]);_0x2259a9[_0xeb40('0x2c')]=_[_0xeb40('0x2a')](_0x2c973d[_0xeb40('0x2b')],qs[_0xeb40('0x41')](_0x2c52f7['query'][_0xeb40('0x41')]));_0x2259a9[_0xeb40('0x2c')]=_0x2259a9['attributes'][_0xeb40('0x2d')]?_0x2259a9[_0xeb40('0x2c')]:_0x2c973d[_0xeb40('0x2b')];if(!_0x2c52f7['query'][_0xeb40('0x2e')](_0xeb40('0x2f'))){_0x2259a9[_0xeb40('0x18')]=qs[_0xeb40('0x18')](_0x2c52f7[_0xeb40('0x26')][_0xeb40('0x18')]);_0x2259a9[_0xeb40('0x17')]=qs['offset'](_0x2c52f7[_0xeb40('0x26')][_0xeb40('0x17')]);}_0x2259a9[_0xeb40('0x30')]=qs[_0xeb40('0x31')](_0x2c52f7[_0xeb40('0x26')][_0xeb40('0x31')]);_0x2259a9[_0xeb40('0x32')]=qs[_0xeb40('0x29')](_[_0xeb40('0x33')](_0x2c52f7[_0xeb40('0x26')],_0x2c973d['filters']));if(_0x2c52f7[_0xeb40('0x26')][_0xeb40('0x36')]){_0x2259a9[_0xeb40('0x32')]=_[_0xeb40('0x37')](_0x2259a9['where'],{'$or':_[_0xeb40('0x38')](_0x2259a9[_0xeb40('0x2c')],function(_0x484928){var _0x232f73={};_0x232f73[_0x484928]={'$like':'%'+_0x2c52f7['query'][_0xeb40('0x36')]+'%'};return _0x232f73;})});}_0x2259a9['where']=_[_0xeb40('0x37')](_0x2259a9[_0xeb40('0x32')],{'mailboxuser':_0x28ba1b[_0xeb40('0x47')]});_0x2259a9=_[_0xeb40('0x37')]({},_0x2259a9,_0x2c52f7['options']);return db['VoiceMailMessage'][_0xeb40('0x48')](_0x2259a9)[_0xeb40('0x1e')](respondWithFilteredResult(_0x303a41,_0x2259a9));})['catch'](handleError(_0x303a41,null));};
\ No newline at end of file
+var _0xb2c0=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/parsers/qs','../../config/utils','../../mysqldb','status','count','offset','set','apply','reject','save','update','then','destroy','end','stack','name','send','index','VoiceMail','rawAttributes','keys','query','dateEnd','dateStart','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','pick','day','merge','where','filter','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','findOne','hasOwnProperty','map','mailbox','findAndCountAll','html-pdf'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xb2c0,0x1a9));var _0x0b2c=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb2c0[_0x3bf83f];return _0x22c4a9;};'use strict';var pdf=require(_0x0b2c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0b2c('0x1'));var zipdir=require(_0x0b2c('0x2'));var jsonpatch=require(_0x0b2c('0x3'));var rp=require(_0x0b2c('0x4'));var moment=require(_0x0b2c('0x5'));var BPromise=require(_0x0b2c('0x6'));var Mustache=require(_0x0b2c('0x7'));var util=require(_0x0b2c('0x8'));var path=require('path');var sox=require(_0x0b2c('0x9'));var csv=require(_0x0b2c('0xa'));var ejs=require(_0x0b2c('0xb'));var fs=require('fs');var _=require(_0x0b2c('0xc'));var squel=require('squel');var crypto=require(_0x0b2c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0b2c('0xe'));var Papa=require(_0x0b2c('0xf'));var qs=require(_0x0b2c('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x0b2c('0x11'));var config=require('../../config/environment');var db=require(_0x0b2c('0x12'))['db'];function respondWithStatusCode(_0x3a29a2,_0x28c2f1){_0x28c2f1=_0x28c2f1||0xcc;return function(_0x15bae1){if(_0x15bae1){return _0x3a29a2['sendStatus'](_0x28c2f1);}return _0x3a29a2[_0x0b2c('0x13')](_0x28c2f1)['end']();};}function respondWithResult(_0x223445,_0x40dd04){_0x40dd04=_0x40dd04||0xc8;return function(_0x5cf8d7){if(_0x5cf8d7){return _0x223445[_0x0b2c('0x13')](_0x40dd04)['json'](_0x5cf8d7);}};}function respondWithFilteredResult(_0x59c610,_0x67f41b){return function(_0x1672da){if(_0x1672da){var _0x57cb12=_0x1672da[_0x0b2c('0x14')],_0x56b781=_0x67f41b[_0x0b2c('0x15')],_0x37fb19=_0x67f41b[_0x0b2c('0x15')]+_0x67f41b['limit'],_0x1422b4;if(_0x37fb19>=_0x57cb12){_0x37fb19=_0x57cb12;_0x1422b4=0xc8;}else{_0x1422b4=0xce;}_0x59c610[_0x0b2c('0x13')](_0x1422b4);return _0x59c610[_0x0b2c('0x16')]('Content-Range',_0x56b781+'-'+_0x37fb19+'/'+_0x57cb12)['json'](_0x1672da);}return null;};}function patchUpdates(_0x23ca47){return function(_0x43f915){try{jsonpatch[_0x0b2c('0x17')](_0x43f915,_0x23ca47,!![]);}catch(_0x296e97){return BPromise[_0x0b2c('0x18')](_0x296e97);}return _0x43f915[_0x0b2c('0x19')]();};}function saveUpdates(_0x22d7d5,_0x491d6e){return function(_0x19f5d9){if(_0x19f5d9){return _0x19f5d9[_0x0b2c('0x1a')](_0x22d7d5)[_0x0b2c('0x1b')](function(_0x2f3835){return _0x2f3835;});}return null;};}function removeEntity(_0x44fc36,_0x5f27cf){return function(_0x4a19a2){if(_0x4a19a2){return _0x4a19a2[_0x0b2c('0x1c')]()[_0x0b2c('0x1b')](function(){_0x44fc36[_0x0b2c('0x13')](0xcc)[_0x0b2c('0x1d')]();});}};}function handleEntityNotFound(_0x288f04,_0x454dbb){return function(_0x3b7005){if(!_0x3b7005){_0x288f04['sendStatus'](0x194);}return _0x3b7005;};}function handleError(_0x8a056c,_0x2174a5){_0x2174a5=_0x2174a5||0x1f4;return function(_0xc588e8){logger['error'](_0xc588e8[_0x0b2c('0x1e')]);if(_0xc588e8[_0x0b2c('0x1f')]){delete _0xc588e8[_0x0b2c('0x1f')];}_0x8a056c['status'](_0x2174a5)[_0x0b2c('0x20')](_0xc588e8);};}exports[_0x0b2c('0x21')]=function(_0x3ae21a,_0x4b0dc4){var _0xf7f512={},_0x140f98={},_0x3fd7b9={'count':0x0,'rows':[]};var _0xf5e683=db[_0x0b2c('0x22')][_0x0b2c('0x23')];_0x140f98['model']=_[_0x0b2c('0x24')](_0xf5e683);var _0x4e607a={'dateStart':_0x3ae21a[_0x0b2c('0x25')]['dateStart'],'dateEnd':_0x3ae21a[_0x0b2c('0x25')][_0x0b2c('0x26')]};delete _0x3ae21a['query'][_0x0b2c('0x27')];delete _0x3ae21a[_0x0b2c('0x25')][_0x0b2c('0x26')];_0x140f98[_0x0b2c('0x25')]=_[_0x0b2c('0x24')](_0x3ae21a[_0x0b2c('0x25')]);_0x140f98[_0x0b2c('0x28')]=_[_0x0b2c('0x29')](_0x140f98[_0x0b2c('0x2a')],_0x140f98['query']);_0xf7f512[_0x0b2c('0x2b')]=_[_0x0b2c('0x29')](_0x140f98[_0x0b2c('0x2a')],qs[_0x0b2c('0x2c')](_0x3ae21a[_0x0b2c('0x25')][_0x0b2c('0x2c')]));_0xf7f512[_0x0b2c('0x2b')]=_0xf7f512[_0x0b2c('0x2b')][_0x0b2c('0x2d')]?_0xf7f512['attributes']:_0x140f98['model'];if(!_0x3ae21a[_0x0b2c('0x25')]['hasOwnProperty'](_0x0b2c('0x2e'))){_0xf7f512[_0x0b2c('0x2f')]=qs[_0x0b2c('0x2f')](_0x3ae21a['query']['limit']);_0xf7f512['offset']=qs['offset'](_0x3ae21a[_0x0b2c('0x25')]['offset']);}_0xf7f512[_0x0b2c('0x30')]=qs[_0x0b2c('0x31')](_0x3ae21a[_0x0b2c('0x25')][_0x0b2c('0x31')]);_0xf7f512['where']=qs[_0x0b2c('0x28')](_[_0x0b2c('0x32')](_0x3ae21a[_0x0b2c('0x25')],_0x140f98[_0x0b2c('0x28')]));if(_0x4e607a[_0x0b2c('0x27')]){if(_0x4e607a['dateEnd']){_0x4e607a[_0x0b2c('0x26')]=moment(_0x4e607a[_0x0b2c('0x26')])['add'](0x1,_0x0b2c('0x33'));}else{_0x4e607a[_0x0b2c('0x26')]=moment(_0x4e607a[_0x0b2c('0x27')])['add'](0x1,_0x0b2c('0x33'));}_[_0x0b2c('0x34')](_0xf7f512[_0x0b2c('0x35')],{'createdAt':{'$gte':_0x4e607a[_0x0b2c('0x27')],'$lte':_0x4e607a[_0x0b2c('0x26')]}});}if(_0x3ae21a['query'][_0x0b2c('0x36')]){_0xf7f512[_0x0b2c('0x35')]=_[_0x0b2c('0x34')](_0xf7f512[_0x0b2c('0x35')],{'$or':_['map'](_0xf7f512['attributes'],function(_0x520588){var _0x2eef44={};_0x2eef44[_0x520588]={'$like':'%'+_0x3ae21a['query'][_0x0b2c('0x36')]+'%'};return _0x2eef44;})});}_0xf7f512=_['merge']({},_0xf7f512,_0x3ae21a[_0x0b2c('0x37')]);var _0x5278cc={'where':_0xf7f512[_0x0b2c('0x35')]};return db[_0x0b2c('0x22')][_0x0b2c('0x14')](_0x5278cc)[_0x0b2c('0x1b')](function(_0x1fbd38){_0x3fd7b9[_0x0b2c('0x14')]=_0x1fbd38;if(_0x3ae21a[_0x0b2c('0x25')][_0x0b2c('0x38')]){_0xf7f512['include']=[{'all':!![]}];}return db['VoiceMail'][_0x0b2c('0x39')](_0xf7f512);})[_0x0b2c('0x1b')](function(_0xfdde29){_0x3fd7b9[_0x0b2c('0x3a')]=_0xfdde29;return _0x3fd7b9;})[_0x0b2c('0x1b')](respondWithFilteredResult(_0x4b0dc4,_0xf7f512))[_0x0b2c('0x3b')](handleError(_0x4b0dc4,null));};exports[_0x0b2c('0x3c')]=function(_0x23ca89,_0x3c9807){var _0x244095={'raw':!![],'where':{'id':_0x23ca89[_0x0b2c('0x3d')]['id']}},_0x551f73={};_0x551f73[_0x0b2c('0x2a')]=_['keys'](db[_0x0b2c('0x22')]['rawAttributes']);_0x551f73[_0x0b2c('0x25')]=_[_0x0b2c('0x24')](_0x23ca89['query']);_0x551f73[_0x0b2c('0x28')]=_[_0x0b2c('0x29')](_0x551f73[_0x0b2c('0x2a')],_0x551f73[_0x0b2c('0x25')]);_0x244095[_0x0b2c('0x2b')]=_[_0x0b2c('0x29')](_0x551f73['model'],qs[_0x0b2c('0x2c')](_0x23ca89[_0x0b2c('0x25')][_0x0b2c('0x2c')]));_0x244095['attributes']=_0x244095[_0x0b2c('0x2b')][_0x0b2c('0x2d')]?_0x244095['attributes']:_0x551f73[_0x0b2c('0x2a')];if(_0x23ca89['query']['includeAll']){_0x244095[_0x0b2c('0x3e')]=[{'all':!![]}];}_0x244095=_[_0x0b2c('0x34')]({},_0x244095,_0x23ca89[_0x0b2c('0x37')]);return db['VoiceMail']['find'](_0x244095)[_0x0b2c('0x1b')](handleEntityNotFound(_0x3c9807,null))[_0x0b2c('0x1b')](respondWithResult(_0x3c9807,null))[_0x0b2c('0x3b')](handleError(_0x3c9807,null));};exports[_0x0b2c('0x3f')]=function(_0x5e5bcf,_0x26acc3){return db['VoiceMail'][_0x0b2c('0x3f')](_0x5e5bcf['body'],{})[_0x0b2c('0x1b')](respondWithResult(_0x26acc3,0xc9))[_0x0b2c('0x3b')](handleError(_0x26acc3,null));};exports['update']=function(_0x23d4ca,_0x5afb1c){if(_0x23d4ca[_0x0b2c('0x40')]['id']){delete _0x23d4ca[_0x0b2c('0x40')]['id'];}return db[_0x0b2c('0x22')][_0x0b2c('0x41')]({'where':{'id':_0x23d4ca[_0x0b2c('0x3d')]['id']}})[_0x0b2c('0x1b')](handleEntityNotFound(_0x5afb1c,null))[_0x0b2c('0x1b')](saveUpdates(_0x23d4ca[_0x0b2c('0x40')],null))[_0x0b2c('0x1b')](respondWithResult(_0x5afb1c,null))[_0x0b2c('0x3b')](handleError(_0x5afb1c,null));};exports[_0x0b2c('0x1c')]=function(_0x49ab2e,_0xd3749f){return db[_0x0b2c('0x22')]['find']({'where':{'id':_0x49ab2e[_0x0b2c('0x3d')]['id']}})['then'](handleEntityNotFound(_0xd3749f,null))[_0x0b2c('0x1b')](removeEntity(_0xd3749f,null))[_0x0b2c('0x3b')](handleError(_0xd3749f,null));};exports['getMessages']=function(_0x1411a3,_0x265eec,_0x11f3ef){return db['VoiceMail'][_0x0b2c('0x42')]({'where':{'id':_0x1411a3[_0x0b2c('0x3d')]['id']}})['then'](handleEntityNotFound(_0x265eec,null))['then'](function(_0x535474){var _0xcc0f63;var _0x128dc1={},_0x4baa72={};_0x4baa72[_0x0b2c('0x2a')]=_['keys'](db['VoiceMailMessage']['rawAttributes']);_0x4baa72[_0x0b2c('0x25')]=_['keys'](_0x1411a3[_0x0b2c('0x25')]);_0x4baa72[_0x0b2c('0x28')]=_[_0x0b2c('0x29')](_0x4baa72[_0x0b2c('0x2a')],_0x4baa72[_0x0b2c('0x25')]);_0x128dc1[_0x0b2c('0x2b')]=_[_0x0b2c('0x29')](_0x4baa72[_0x0b2c('0x2a')],qs[_0x0b2c('0x2c')](_0x1411a3[_0x0b2c('0x25')][_0x0b2c('0x2c')]));_0x128dc1[_0x0b2c('0x2b')]=_0x128dc1[_0x0b2c('0x2b')][_0x0b2c('0x2d')]?_0x128dc1[_0x0b2c('0x2b')]:_0x4baa72[_0x0b2c('0x2a')];if(!_0x1411a3[_0x0b2c('0x25')][_0x0b2c('0x43')](_0x0b2c('0x2e'))){_0x128dc1[_0x0b2c('0x2f')]=qs[_0x0b2c('0x2f')](_0x1411a3[_0x0b2c('0x25')][_0x0b2c('0x2f')]);_0x128dc1[_0x0b2c('0x15')]=qs['offset'](_0x1411a3['query'][_0x0b2c('0x15')]);}_0x128dc1[_0x0b2c('0x30')]=qs[_0x0b2c('0x31')](_0x1411a3[_0x0b2c('0x25')][_0x0b2c('0x31')]);_0x128dc1[_0x0b2c('0x35')]=qs['filters'](_[_0x0b2c('0x32')](_0x1411a3['query'],_0x4baa72[_0x0b2c('0x28')]));if(_0x1411a3[_0x0b2c('0x25')][_0x0b2c('0x36')]){_0x128dc1['where']=_[_0x0b2c('0x34')](_0x128dc1['where'],{'$or':_[_0x0b2c('0x44')](_0x128dc1[_0x0b2c('0x2b')],function(_0x19f1aa){var _0x2868ca={};_0x2868ca[_0x19f1aa]={'$like':'%'+_0x1411a3[_0x0b2c('0x25')][_0x0b2c('0x36')]+'%'};return _0x2868ca;})});}_0x128dc1[_0x0b2c('0x35')]=_[_0x0b2c('0x34')](_0x128dc1[_0x0b2c('0x35')],{'mailboxuser':_0x535474[_0x0b2c('0x45')]});_0x128dc1=_[_0x0b2c('0x34')]({},_0x128dc1,_0x1411a3['options']);return db['VoiceMailMessage'][_0x0b2c('0x46')](_0x128dc1)[_0x0b2c('0x1b')](respondWithFilteredResult(_0x265eec,_0x128dc1));})[_0x0b2c('0x3b')](handleError(_0x265eec,null));};
\ No newline at end of file
index 65af2ea..25a3de0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3b9=['moment','bluebird','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3b9,0x1aa));var _0x9a3b=function(_0x36b5a1,_0x469c77){_0x36b5a1=_0x36b5a1-0x0;var _0x46dd02=_0xa3b9[_0x36b5a1];return _0x46dd02;};'use strict';var _=require(_0x9a3b('0x0'));var util=require(_0x9a3b('0x1'));var logger=require(_0x9a3b('0x2'))('api');var moment=require(_0x9a3b('0x3'));var BPromise=require(_0x9a3b('0x4'));var rp=require('request-promise');var attributes=require(_0x9a3b('0x5'));module[_0x9a3b('0x6')]=function(_0x2f5643,_0x181020){return _0x2f5643[_0x9a3b('0x7')](_0x9a3b('0x8'),attributes,{'tableName':_0x9a3b('0x9'),'paranoid':![],'indexes':[{'name':_0x9a3b('0xa'),'fields':['mailbox','context']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9138=['voice_voicemail','mailbox','lodash','util','api','moment','bluebird','./voiceMail.attributes','exports','VoiceMail'];(function(_0x9d9f9e,_0x52a029){var _0x48cb13=function(_0x177d55){while(--_0x177d55){_0x9d9f9e['push'](_0x9d9f9e['shift']());}};_0x48cb13(++_0x52a029);}(_0x9138,0xde));var _0x8913=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x9138[_0x2f1762];return _0x8ab21;};'use strict';var _=require(_0x8913('0x0'));var util=require(_0x8913('0x1'));var logger=require('../../config/logger')(_0x8913('0x2'));var moment=require(_0x8913('0x3'));var BPromise=require(_0x8913('0x4'));var rp=require('request-promise');var attributes=require(_0x8913('0x5'));module[_0x8913('0x6')]=function(_0x3e069c,_0x302e0a){return _0x3e069c['define'](_0x8913('0x7'),attributes,{'tableName':_0x8913('0x8'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x8913('0x9'),'context']}],'timestamps':!![]});};
\ No newline at end of file
index fa38bef..219f850 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eb0=['jayson/promise','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','randomstring','../../config/utils','rpc','../../config/environment'];(function(_0x1bd3ab,_0x352c42){var _0x37e394=function(_0x2f581d){while(--_0x2f581d){_0x1bd3ab['push'](_0x1bd3ab['shift']());}};_0x37e394(++_0x352c42);}(_0x3eb0,0x66));var _0x03eb=function(_0x4b1f46,_0x538d4a){_0x4b1f46=_0x4b1f46-0x0;var _0x1e575=_0x3eb0[_0x4b1f46];return _0x1e575;};'use strict';var _=require(_0x03eb('0x0'));var util=require(_0x03eb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x03eb('0x2'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x03eb('0x3'));var logger=require('../../config/logger')(_0x03eb('0x4'));var config=require(_0x03eb('0x5'));var jayson=require(_0x03eb('0x6'));var client=jayson['client'][_0x03eb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x45f710,_0x46504a,_0x45503d){return new BPromise(function(_0x1dc062,_0x57c927){return client[_0x03eb('0x8')](_0x45f710,_0x45503d)[_0x03eb('0x9')](function(_0x3b6fb0){logger[_0x03eb('0xa')](_0x03eb('0xb'),_0x46504a,_0x03eb('0xc'));logger['debug'](_0x03eb('0xd'),_0x46504a,_0x03eb('0xc'),JSON[_0x03eb('0xe')](_0x3b6fb0));if(_0x3b6fb0['error']){if(_0x3b6fb0['error']['code']===0x1f4){logger[_0x03eb('0xf')](_0x03eb('0xb'),_0x46504a,_0x3b6fb0[_0x03eb('0xf')][_0x03eb('0x10')]);return _0x57c927(_0x3b6fb0[_0x03eb('0xf')][_0x03eb('0x10')]);}logger[_0x03eb('0xf')](_0x03eb('0xb'),_0x46504a,_0x3b6fb0['error'][_0x03eb('0x10')]);return _0x1dc062(_0x3b6fb0[_0x03eb('0xf')]['message']);}else{logger[_0x03eb('0xa')](_0x03eb('0xb'),_0x46504a,_0x03eb('0xc'));_0x1dc062(_0x3b6fb0[_0x03eb('0x11')][_0x03eb('0x10')]);}})['catch'](function(_0x193677){logger[_0x03eb('0xf')]('VoiceMail,\x20%s,\x20%s',_0x46504a,_0x193677);_0x57c927(_0x193677);});});}
\ No newline at end of file
+var _0x1d46=['error','message','info','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x1d46,0xe1));var _0x61d4=function(_0x81dcac,_0x8ff7db){_0x81dcac=_0x81dcac-0x0;var _0xc7803b=_0x1d46[_0x81dcac];return _0xc7803b;};'use strict';var _=require(_0x61d4('0x0'));var util=require(_0x61d4('0x1'));var moment=require(_0x61d4('0x2'));var BPromise=require('bluebird');var rs=require(_0x61d4('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x61d4('0x4'));var logger=require(_0x61d4('0x5'))(_0x61d4('0x6'));var config=require(_0x61d4('0x7'));var jayson=require(_0x61d4('0x8'));var client=jayson[_0x61d4('0x9')][_0x61d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44e04c,_0x339ac2,_0x207e38){return new BPromise(function(_0x5c373a,_0x2d2c64){return client[_0x61d4('0xb')](_0x44e04c,_0x207e38)[_0x61d4('0xc')](function(_0x38fa62){logger['info'](_0x61d4('0xd'),_0x339ac2,_0x61d4('0xe'));logger[_0x61d4('0xf')](_0x61d4('0x10'),_0x339ac2,_0x61d4('0xe'),JSON['stringify'](_0x38fa62));if(_0x38fa62['error']){if(_0x38fa62[_0x61d4('0x11')]['code']===0x1f4){logger[_0x61d4('0x11')](_0x61d4('0xd'),_0x339ac2,_0x38fa62[_0x61d4('0x11')]['message']);return _0x2d2c64(_0x38fa62['error'][_0x61d4('0x12')]);}logger[_0x61d4('0x11')](_0x61d4('0xd'),_0x339ac2,_0x38fa62[_0x61d4('0x11')][_0x61d4('0x12')]);return _0x5c373a(_0x38fa62[_0x61d4('0x11')][_0x61d4('0x12')]);}else{logger[_0x61d4('0x13')]('VoiceMail,\x20%s,\x20%s',_0x339ac2,_0x61d4('0xe'));_0x5c373a(_0x38fa62[_0x61d4('0x14')][_0x61d4('0x12')]);}})[_0x61d4('0x15')](function(_0x1b9ed7){logger[_0x61d4('0x11')](_0x61d4('0xd'),_0x339ac2,_0x1b9ed7);_0x2d2c64(_0x1b9ed7);});});}
\ No newline at end of file
index b2df8db..522f427 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb14d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','update','delete','/:id','destroy','exports','multer','express'];(function(_0x378172,_0x45a029){var _0x357dc5=function(_0x5d7e8c){while(--_0x5d7e8c){_0x378172['push'](_0x378172['shift']());}};_0x357dc5(++_0x45a029);}(_0xb14d,0x70));var _0xdb14=function(_0x246ae8,_0x3ca495){_0x246ae8=_0x246ae8-0x0;var _0x55260a=_0xb14d[_0x246ae8];return _0x55260a;};'use strict';var multer=require(_0xdb14('0x0'));var util=require('util');var path=require('path');var express=require(_0xdb14('0x1'));var router=express['Router']();var auth=require(_0xdb14('0x2'));var interaction=require(_0xdb14('0x3'));var config=require(_0xdb14('0x4'));var controller=require(_0xdb14('0x5'));router[_0xdb14('0x6')]('/',auth[_0xdb14('0x7')](),controller[_0xdb14('0x8')]);router[_0xdb14('0x6')]('/:id',auth[_0xdb14('0x7')](),controller[_0xdb14('0x9')]);router[_0xdb14('0x6')](_0xdb14('0xa'),auth['isAuthenticated'](),controller[_0xdb14('0xb')]);router[_0xdb14('0xc')]('/',auth[_0xdb14('0x7')](),controller[_0xdb14('0xd')]);router['put']('/:id',auth[_0xdb14('0x7')](),controller[_0xdb14('0xe')]);router[_0xdb14('0xf')](_0xdb14('0x10'),auth[_0xdb14('0x7')](),controller[_0xdb14('0x11')]);module[_0xdb14('0x12')]=router;
\ No newline at end of file
+var _0xb743=['multer','path','express','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xb743,0x18f));var _0x3b74=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xb743[_0xc4001c];return _0x49f7bc;};'use strict';var multer=require(_0x3b74('0x0'));var util=require('util');var path=require(_0x3b74('0x1'));var express=require(_0x3b74('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3b74('0x3'));var controller=require(_0x3b74('0x4'));router[_0x3b74('0x5')]('/',auth[_0x3b74('0x6')](),controller[_0x3b74('0x7')]);router[_0x3b74('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x3b74('0x8')]);router['get'](_0x3b74('0x9'),auth[_0x3b74('0x6')](),controller[_0x3b74('0xa')]);router[_0x3b74('0xb')]('/',auth[_0x3b74('0x6')](),controller[_0x3b74('0xc')]);router[_0x3b74('0xd')](_0x3b74('0xe'),auth[_0x3b74('0x6')](),controller[_0x3b74('0xf')]);router[_0x3b74('0x10')]('/:id',auth[_0x3b74('0x6')](),controller[_0x3b74('0x11')]);module[_0x3b74('0x12')]=router;
\ No newline at end of file
index 68ce8d0..91b508a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabcf=['long','TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB'];(function(_0x3af469,_0x13e385){var _0x3385d2=function(_0x193861){while(--_0x193861){_0x3af469['push'](_0x3af469['shift']());}};_0x3385d2(++_0x13e385);}(_0xabcf,0x14a));var _0xfabc=function(_0x11ba74,_0x4aade8){_0x11ba74=_0x11ba74-0x0;var _0x34aeb9=_0xabcf[_0x11ba74];return _0x34aeb9;};'use strict';var Sequelize=require('sequelize');module[_0xfabc('0x0')]={'name':{'type':Sequelize[_0xfabc('0x1')],'get':function(_0x5dd811){return this[_0xfabc('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xfabc('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xfabc('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xfabc('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xfabc('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xfabc('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xfabc('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xfabc('0x5')](_0xfabc('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xfabc('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xfabc('0x7'),'allowNull':![]}};
\ No newline at end of file
+var _0xffb5=['STRING','BLOB','sequelize','VIRTUAL','getDataValue','INTEGER'];(function(_0x49115e,_0x5f113b){var _0x55b25c=function(_0x4bc31c){while(--_0x4bc31c){_0x49115e['push'](_0x49115e['shift']());}};_0x55b25c(++_0x5f113b);}(_0xffb5,0x1ee));var _0x5ffb=function(_0x11f59e,_0x10d5e7){_0x11f59e=_0x11f59e-0x0;var _0x5c6771=_0xffb5[_0x11f59e];return _0x5c6771;};'use strict';var Sequelize=require(_0x5ffb('0x0'));module['exports']={'name':{'type':Sequelize[_0x5ffb('0x1')],'get':function(_0x4e5df6){return this[_0x5ffb('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x5ffb('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x5ffb('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x5ffb('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x5ffb('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x5ffb('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x5ffb('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x5ffb('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x5ffb('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5ffb('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','allowNull':![]}};
\ No newline at end of file
index 72d1ba2..44a4352 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1225=['ValidationError','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','send','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','apply','reject','update','then','destroy','error','stack','name','index','VoiceMailMessage','rawAttributes','keys','query','dateStart','dateEnd','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','filters','pick','add','day','merge','filter','map','options','count','includeAll','include','findAll','rows','show','length','find','create','body','catch','params','download','recording','msg_id','Sequelize'];(function(_0x166cdd,_0x58e074){var _0x1aa7df=function(_0xa7d459){while(--_0xa7d459){_0x166cdd['push'](_0x166cdd['shift']());}};_0x1aa7df(++_0x58e074);}(_0x1225,0xa6));var _0x5122=function(_0x5694e3,_0xecf164){_0x5694e3=_0x5694e3-0x0;var _0x37f1ea=_0x1225[_0x5694e3];return _0x37f1ea;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5122('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5122('0x1'));var jsonpatch=require(_0x5122('0x2'));var rp=require(_0x5122('0x3'));var moment=require(_0x5122('0x4'));var BPromise=require(_0x5122('0x5'));var Mustache=require(_0x5122('0x6'));var util=require(_0x5122('0x7'));var path=require('path');var sox=require(_0x5122('0x8'));var csv=require('to-csv');var ejs=require(_0x5122('0x9'));var fs=require('fs');var _=require(_0x5122('0xa'));var squel=require(_0x5122('0xb'));var crypto=require('crypto');var jsforce=require(_0x5122('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5122('0xd'));var querystring=require(_0x5122('0xe'));var Papa=require(_0x5122('0xf'));var qs=require(_0x5122('0x10'));var logger=require('../../config/logger')(_0x5122('0x11'));var utils=require(_0x5122('0x12'));var config=require(_0x5122('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17e7c5,_0xa3f9ee){_0xa3f9ee=_0xa3f9ee||0xcc;return function(_0x10c5f9){if(_0x10c5f9){return _0x17e7c5[_0x5122('0x14')](_0xa3f9ee);}return _0x17e7c5[_0x5122('0x15')](_0xa3f9ee)[_0x5122('0x16')]();};}function respondWithResult(_0x5bd96d,_0x373578){_0x373578=_0x373578||0xc8;return function(_0x1c075d){if(_0x1c075d){return _0x5bd96d[_0x5122('0x15')](_0x373578)[_0x5122('0x17')](_0x1c075d);}};}function respondWithFilteredResult(_0x243271,_0x4b4e32){return function(_0x331c04){if(_0x331c04){var _0x236af6=_0x331c04['count'],_0x296995=_0x4b4e32[_0x5122('0x18')],_0x44798b=_0x4b4e32[_0x5122('0x18')]+_0x4b4e32[_0x5122('0x19')],_0x42a917;if(_0x44798b>=_0x236af6){_0x44798b=_0x236af6;_0x42a917=0xc8;}else{_0x42a917=0xce;}_0x243271[_0x5122('0x15')](_0x42a917);return _0x243271[_0x5122('0x1a')]('Content-Range',_0x296995+'-'+_0x44798b+'/'+_0x236af6)[_0x5122('0x17')](_0x331c04);}return null;};}function patchUpdates(_0x366d60){return function(_0x53558f){try{jsonpatch[_0x5122('0x1b')](_0x53558f,_0x366d60,!![]);}catch(_0xd379c6){return BPromise[_0x5122('0x1c')](_0xd379c6);}return _0x53558f['save']();};}function saveUpdates(_0x876ae7,_0x6c904){return function(_0x58737b){if(_0x58737b){return _0x58737b[_0x5122('0x1d')](_0x876ae7)[_0x5122('0x1e')](function(_0x52b2cb){return _0x52b2cb;});}return null;};}function removeEntity(_0x239577,_0x14d586){return function(_0xdeda3f){if(_0xdeda3f){return _0xdeda3f[_0x5122('0x1f')]()[_0x5122('0x1e')](function(){_0x239577[_0x5122('0x15')](0xcc)[_0x5122('0x16')]();});}};}function handleEntityNotFound(_0xfcf262,_0x7f75e1){return function(_0x3594a9){if(!_0x3594a9){_0xfcf262[_0x5122('0x14')](0x194);}return _0x3594a9;};}function handleError(_0x582d0f,_0x353c0b){_0x353c0b=_0x353c0b||0x1f4;return function(_0x6cf7ae){logger[_0x5122('0x20')](_0x6cf7ae[_0x5122('0x21')]);if(_0x6cf7ae['name']){delete _0x6cf7ae[_0x5122('0x22')];}_0x582d0f['status'](_0x353c0b)['send'](_0x6cf7ae);};}exports[_0x5122('0x23')]=function(_0x3b3397,_0x5e9312){var _0x45408e={},_0x504662={},_0x5519ed={'count':0x0,'rows':[]};var _0x2f0350=db[_0x5122('0x24')][_0x5122('0x25')];_0x504662['model']=_['differenceBy'](_[_0x5122('0x26')](_0x2f0350),[_0x5122('0x22')]);var _0x2fcb1c={'dateStart':_0x3b3397[_0x5122('0x27')][_0x5122('0x28')],'dateEnd':_0x3b3397['query'][_0x5122('0x29')]};delete _0x3b3397[_0x5122('0x27')][_0x5122('0x28')];delete _0x3b3397[_0x5122('0x27')]['dateEnd'];_0x504662['query']=_['keys'](_0x3b3397['query']);_0x504662['filters']=_[_0x5122('0x2a')](_0x504662['model'],_0x504662[_0x5122('0x27')]);_0x45408e[_0x5122('0x2b')]=_[_0x5122('0x2a')](_0x504662[_0x5122('0x2c')],qs['fields'](_0x3b3397[_0x5122('0x27')][_0x5122('0x2d')]));_0x45408e['attributes']=_0x45408e[_0x5122('0x2b')]['length']?_0x45408e[_0x5122('0x2b')]:_0x504662['model'];if(!_0x3b3397[_0x5122('0x27')][_0x5122('0x2e')](_0x5122('0x2f'))){_0x45408e[_0x5122('0x19')]=qs['limit'](_0x3b3397[_0x5122('0x27')][_0x5122('0x19')]);_0x45408e[_0x5122('0x18')]=qs['offset'](_0x3b3397[_0x5122('0x27')][_0x5122('0x18')]);}_0x45408e['order']=qs[_0x5122('0x30')](_0x3b3397['query'][_0x5122('0x30')]);_0x45408e[_0x5122('0x31')]=qs[_0x5122('0x32')](_[_0x5122('0x33')](_0x3b3397[_0x5122('0x27')],_0x504662[_0x5122('0x32')]));if(_0x2fcb1c[_0x5122('0x28')]){if(_0x2fcb1c[_0x5122('0x29')]){_0x2fcb1c['dateEnd']=moment(_0x2fcb1c[_0x5122('0x29')])[_0x5122('0x34')](0x1,_0x5122('0x35'));}else{_0x2fcb1c['dateEnd']=moment(_0x2fcb1c[_0x5122('0x28')])[_0x5122('0x34')](0x1,_0x5122('0x35'));}_[_0x5122('0x36')](_0x45408e[_0x5122('0x31')],{'createdAt':{'$gte':_0x2fcb1c[_0x5122('0x28')],'$lte':_0x2fcb1c[_0x5122('0x29')]}});}if(_0x3b3397[_0x5122('0x27')][_0x5122('0x37')]){_0x45408e[_0x5122('0x31')]=_['merge'](_0x45408e[_0x5122('0x31')],{'$or':_[_0x5122('0x38')](_0x45408e['attributes'],function(_0x4db931){var _0x4fb454={};_0x4fb454[_0x4db931]={'$like':'%'+_0x3b3397[_0x5122('0x27')][_0x5122('0x37')]+'%'};return _0x4fb454;})});}_0x45408e=_[_0x5122('0x36')]({},_0x45408e,_0x3b3397[_0x5122('0x39')]);var _0x23d5f1={'where':_0x45408e[_0x5122('0x31')]};return db[_0x5122('0x24')][_0x5122('0x3a')](_0x23d5f1)[_0x5122('0x1e')](function(_0x5e3114){_0x5519ed[_0x5122('0x3a')]=_0x5e3114;if(_0x3b3397[_0x5122('0x27')][_0x5122('0x3b')]){_0x45408e[_0x5122('0x3c')]=[{'all':!![]}];}return db[_0x5122('0x24')][_0x5122('0x3d')](_0x45408e);})['then'](function(_0xf75d40){_0x5519ed[_0x5122('0x3e')]=_0xf75d40;return _0x5519ed;})[_0x5122('0x1e')](respondWithFilteredResult(_0x5e9312,_0x45408e))['catch'](handleError(_0x5e9312,null));};exports[_0x5122('0x3f')]=function(_0xd07688,_0x2466d8){var _0x437aab={'raw':!![],'where':{'id':_0xd07688['params']['id']}},_0x30c582={};_0x30c582[_0x5122('0x2c')]=_[_0x5122('0x26')](db[_0x5122('0x24')][_0x5122('0x25')]);_0x30c582[_0x5122('0x27')]=_['keys'](_0xd07688[_0x5122('0x27')]);_0x30c582[_0x5122('0x32')]=_[_0x5122('0x2a')](_0x30c582[_0x5122('0x2c')],_0x30c582['query']);_0x437aab[_0x5122('0x2b')]=_[_0x5122('0x2a')](_0x30c582[_0x5122('0x2c')],qs[_0x5122('0x2d')](_0xd07688['query'][_0x5122('0x2d')]));_0x437aab['attributes']=_0x437aab[_0x5122('0x2b')][_0x5122('0x40')]?_0x437aab[_0x5122('0x2b')]:_0x30c582[_0x5122('0x2c')];if(_0xd07688[_0x5122('0x27')]['includeAll']){_0x437aab[_0x5122('0x3c')]=[{'all':!![]}];}_0x437aab=_[_0x5122('0x36')]({},_0x437aab,_0xd07688['options']);return db[_0x5122('0x24')][_0x5122('0x41')](_0x437aab)[_0x5122('0x1e')](handleEntityNotFound(_0x2466d8,null))[_0x5122('0x1e')](respondWithResult(_0x2466d8,null))['catch'](handleError(_0x2466d8,null));};exports[_0x5122('0x42')]=function(_0x1684a2,_0x52252e){return db['VoiceMailMessage'][_0x5122('0x42')](_0x1684a2[_0x5122('0x43')],{})[_0x5122('0x1e')](respondWithResult(_0x52252e,0xc9))['catch'](handleError(_0x52252e,null));};exports[_0x5122('0x1d')]=function(_0x26bb85,_0x94f541){if(_0x26bb85[_0x5122('0x43')]['id']){delete _0x26bb85['body']['id'];}return db[_0x5122('0x24')][_0x5122('0x41')]({'where':{'id':_0x26bb85['params']['id']}})['then'](handleEntityNotFound(_0x94f541,null))[_0x5122('0x1e')](saveUpdates(_0x26bb85[_0x5122('0x43')],null))[_0x5122('0x1e')](respondWithResult(_0x94f541,null))[_0x5122('0x44')](handleError(_0x94f541,null));};exports[_0x5122('0x1f')]=function(_0x1839ef,_0x3ce5b6){return db[_0x5122('0x24')][_0x5122('0x41')]({'where':{'id':_0x1839ef[_0x5122('0x45')]['id']}})[_0x5122('0x1e')](handleEntityNotFound(_0x3ce5b6,null))[_0x5122('0x1e')](removeEntity(_0x3ce5b6,null))[_0x5122('0x44')](handleError(_0x3ce5b6,null));};exports[_0x5122('0x46')]=function(_0x3d51e6,_0x4823b5,_0x23db03){return db['VoiceMailMessage']['find']({'where':{'id':_0x3d51e6[_0x5122('0x45')]['id']},'attributes':['id',_0x5122('0x47'),_0x5122('0x48')]})[_0x5122('0x1e')](handleEntityNotFound(_0x4823b5,null))[_0x5122('0x1e')](function(_0xa6052d){if(_0xa6052d){if(!_0xa6052d[_0x5122('0x47')]){throw new db[(_0x5122('0x49'))][(_0x5122('0x4a'))]('VoiceMailMessage\x20not\x20found');}var _0xf29fc={'Content-Type':_0x5122('0x4b'),'Content-Disposition':_0x5122('0x4c')};if(_0xa6052d['msg_id']){_0xf29fc[_0x5122('0x4d')]=_0x5122('0x4e')+_0xa6052d[_0x5122('0x48')]+'.wav\x22';}_0x4823b5[_0x5122('0x1a')](_0xf29fc);return _0x4823b5[_0x5122('0x4f')](new Buffer(_0xa6052d[_0x5122('0x47')]));}})[_0x5122('0x44')](handleError(_0x4823b5,null));};
\ No newline at end of file
+var _0xf705=['index','VoiceMailMessage','model','differenceBy','keys','query','dateStart','dateEnd','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','add','day','where','filter','map','merge','includeAll','include','show','params','rawAttributes','find','catch','create','body','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','set','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0xf705,0x11d));var _0x5f70=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xf705[_0x19950b];return _0x3c6b41;};'use strict';var pdf=require(_0x5f70('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5f70('0x1'));var zipdir=require(_0x5f70('0x2'));var jsonpatch=require(_0x5f70('0x3'));var rp=require('request-promise');var moment=require(_0x5f70('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5f70('0x5'));var util=require(_0x5f70('0x6'));var path=require('path');var sox=require(_0x5f70('0x7'));var csv=require('to-csv');var ejs=require(_0x5f70('0x8'));var fs=require('fs');var _=require(_0x5f70('0x9'));var squel=require('squel');var crypto=require(_0x5f70('0xa'));var jsforce=require(_0x5f70('0xb'));var deskjs=require(_0x5f70('0xc'));var toCsv=require(_0x5f70('0xd'));var querystring=require(_0x5f70('0xe'));var Papa=require(_0x5f70('0xf'));var qs=require(_0x5f70('0x10'));var logger=require(_0x5f70('0x11'))(_0x5f70('0x12'));var utils=require(_0x5f70('0x13'));var config=require(_0x5f70('0x14'));var db=require(_0x5f70('0x15'))['db'];function respondWithStatusCode(_0x5a7834,_0x55db52){_0x55db52=_0x55db52||0xcc;return function(_0x2341ad){if(_0x2341ad){return _0x5a7834[_0x5f70('0x16')](_0x55db52);}return _0x5a7834['status'](_0x55db52)['end']();};}function respondWithResult(_0x4bca38,_0x589cf6){_0x589cf6=_0x589cf6||0xc8;return function(_0x5d044c){if(_0x5d044c){return _0x4bca38[_0x5f70('0x17')](_0x589cf6)[_0x5f70('0x18')](_0x5d044c);}};}function respondWithFilteredResult(_0x356f58,_0x1bc985){return function(_0x4c5f41){if(_0x4c5f41){var _0x63bc03=_0x4c5f41[_0x5f70('0x19')],_0x2e2bfe=_0x1bc985[_0x5f70('0x1a')],_0x19c491=_0x1bc985[_0x5f70('0x1a')]+_0x1bc985[_0x5f70('0x1b')],_0x3c7cee;if(_0x19c491>=_0x63bc03){_0x19c491=_0x63bc03;_0x3c7cee=0xc8;}else{_0x3c7cee=0xce;}_0x356f58[_0x5f70('0x17')](_0x3c7cee);return _0x356f58['set'](_0x5f70('0x1c'),_0x2e2bfe+'-'+_0x19c491+'/'+_0x63bc03)['json'](_0x4c5f41);}return null;};}function patchUpdates(_0x2ed1d8){return function(_0x4092e2){try{jsonpatch[_0x5f70('0x1d')](_0x4092e2,_0x2ed1d8,!![]);}catch(_0x35badf){return BPromise[_0x5f70('0x1e')](_0x35badf);}return _0x4092e2[_0x5f70('0x1f')]();};}function saveUpdates(_0x388658,_0x419426){return function(_0x20fe31){if(_0x20fe31){return _0x20fe31[_0x5f70('0x20')](_0x388658)[_0x5f70('0x21')](function(_0x86debe){return _0x86debe;});}return null;};}function removeEntity(_0x14f6ec,_0x2a78c1){return function(_0x388868){if(_0x388868){return _0x388868[_0x5f70('0x22')]()[_0x5f70('0x21')](function(){_0x14f6ec[_0x5f70('0x17')](0xcc)[_0x5f70('0x23')]();});}};}function handleEntityNotFound(_0x3d792b,_0x20a87d){return function(_0x16c990){if(!_0x16c990){_0x3d792b[_0x5f70('0x16')](0x194);}return _0x16c990;};}function handleError(_0x1502dd,_0x455c7c){_0x455c7c=_0x455c7c||0x1f4;return function(_0x423b5c){logger['error'](_0x423b5c[_0x5f70('0x24')]);if(_0x423b5c[_0x5f70('0x25')]){delete _0x423b5c[_0x5f70('0x25')];}_0x1502dd[_0x5f70('0x17')](_0x455c7c)[_0x5f70('0x26')](_0x423b5c);};}exports[_0x5f70('0x27')]=function(_0x3007e9,_0x44b83f){var _0x1717d0={},_0xebbfee={},_0x6b33be={'count':0x0,'rows':[]};var _0xd844bd=db[_0x5f70('0x28')]['rawAttributes'];_0xebbfee[_0x5f70('0x29')]=_[_0x5f70('0x2a')](_[_0x5f70('0x2b')](_0xd844bd),[_0x5f70('0x25')]);var _0x252e7c={'dateStart':_0x3007e9[_0x5f70('0x2c')][_0x5f70('0x2d')],'dateEnd':_0x3007e9[_0x5f70('0x2c')][_0x5f70('0x2e')]};delete _0x3007e9[_0x5f70('0x2c')][_0x5f70('0x2d')];delete _0x3007e9['query'][_0x5f70('0x2e')];_0xebbfee[_0x5f70('0x2c')]=_['keys'](_0x3007e9[_0x5f70('0x2c')]);_0xebbfee[_0x5f70('0x2f')]=_['intersection'](_0xebbfee['model'],_0xebbfee['query']);_0x1717d0['attributes']=_[_0x5f70('0x30')](_0xebbfee[_0x5f70('0x29')],qs[_0x5f70('0x31')](_0x3007e9['query'][_0x5f70('0x31')]));_0x1717d0[_0x5f70('0x32')]=_0x1717d0[_0x5f70('0x32')][_0x5f70('0x33')]?_0x1717d0[_0x5f70('0x32')]:_0xebbfee['model'];if(!_0x3007e9['query'][_0x5f70('0x34')]('nolimit')){_0x1717d0[_0x5f70('0x1b')]=qs[_0x5f70('0x1b')](_0x3007e9['query'][_0x5f70('0x1b')]);_0x1717d0[_0x5f70('0x1a')]=qs[_0x5f70('0x1a')](_0x3007e9[_0x5f70('0x2c')][_0x5f70('0x1a')]);}_0x1717d0[_0x5f70('0x35')]=qs['sort'](_0x3007e9['query'][_0x5f70('0x36')]);_0x1717d0['where']=qs['filters'](_[_0x5f70('0x37')](_0x3007e9['query'],_0xebbfee[_0x5f70('0x2f')]));if(_0x252e7c[_0x5f70('0x2d')]){if(_0x252e7c[_0x5f70('0x2e')]){_0x252e7c['dateEnd']=moment(_0x252e7c[_0x5f70('0x2e')])[_0x5f70('0x38')](0x1,_0x5f70('0x39'));}else{_0x252e7c[_0x5f70('0x2e')]=moment(_0x252e7c[_0x5f70('0x2d')])[_0x5f70('0x38')](0x1,_0x5f70('0x39'));}_['merge'](_0x1717d0[_0x5f70('0x3a')],{'createdAt':{'$gte':_0x252e7c[_0x5f70('0x2d')],'$lte':_0x252e7c['dateEnd']}});}if(_0x3007e9[_0x5f70('0x2c')][_0x5f70('0x3b')]){_0x1717d0['where']=_['merge'](_0x1717d0[_0x5f70('0x3a')],{'$or':_[_0x5f70('0x3c')](_0x1717d0[_0x5f70('0x32')],function(_0x677957){var _0x45455a={};_0x45455a[_0x677957]={'$like':'%'+_0x3007e9[_0x5f70('0x2c')][_0x5f70('0x3b')]+'%'};return _0x45455a;})});}_0x1717d0=_[_0x5f70('0x3d')]({},_0x1717d0,_0x3007e9['options']);var _0x488fa2={'where':_0x1717d0['where']};return db[_0x5f70('0x28')][_0x5f70('0x19')](_0x488fa2)['then'](function(_0x11c14c){_0x6b33be['count']=_0x11c14c;if(_0x3007e9[_0x5f70('0x2c')][_0x5f70('0x3e')]){_0x1717d0[_0x5f70('0x3f')]=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0x1717d0);})['then'](function(_0x537fda){_0x6b33be['rows']=_0x537fda;return _0x6b33be;})[_0x5f70('0x21')](respondWithFilteredResult(_0x44b83f,_0x1717d0))['catch'](handleError(_0x44b83f,null));};exports[_0x5f70('0x40')]=function(_0x272352,_0x3d2e6e){var _0x5dbf23={'raw':!![],'where':{'id':_0x272352[_0x5f70('0x41')]['id']}},_0x792130={};_0x792130[_0x5f70('0x29')]=_[_0x5f70('0x2b')](db[_0x5f70('0x28')][_0x5f70('0x42')]);_0x792130[_0x5f70('0x2c')]=_[_0x5f70('0x2b')](_0x272352[_0x5f70('0x2c')]);_0x792130[_0x5f70('0x2f')]=_['intersection'](_0x792130[_0x5f70('0x29')],_0x792130['query']);_0x5dbf23[_0x5f70('0x32')]=_['intersection'](_0x792130[_0x5f70('0x29')],qs[_0x5f70('0x31')](_0x272352[_0x5f70('0x2c')][_0x5f70('0x31')]));_0x5dbf23['attributes']=_0x5dbf23['attributes']['length']?_0x5dbf23[_0x5f70('0x32')]:_0x792130[_0x5f70('0x29')];if(_0x272352[_0x5f70('0x2c')][_0x5f70('0x3e')]){_0x5dbf23[_0x5f70('0x3f')]=[{'all':!![]}];}_0x5dbf23=_[_0x5f70('0x3d')]({},_0x5dbf23,_0x272352['options']);return db['VoiceMailMessage'][_0x5f70('0x43')](_0x5dbf23)[_0x5f70('0x21')](handleEntityNotFound(_0x3d2e6e,null))[_0x5f70('0x21')](respondWithResult(_0x3d2e6e,null))[_0x5f70('0x44')](handleError(_0x3d2e6e,null));};exports[_0x5f70('0x45')]=function(_0x364292,_0x4f25fd){return db[_0x5f70('0x28')][_0x5f70('0x45')](_0x364292[_0x5f70('0x46')],{})['then'](respondWithResult(_0x4f25fd,0xc9))['catch'](handleError(_0x4f25fd,null));};exports[_0x5f70('0x20')]=function(_0x1e84d4,_0xd722b){if(_0x1e84d4[_0x5f70('0x46')]['id']){delete _0x1e84d4[_0x5f70('0x46')]['id'];}return db[_0x5f70('0x28')]['find']({'where':{'id':_0x1e84d4['params']['id']}})[_0x5f70('0x21')](handleEntityNotFound(_0xd722b,null))['then'](saveUpdates(_0x1e84d4['body'],null))['then'](respondWithResult(_0xd722b,null))[_0x5f70('0x44')](handleError(_0xd722b,null));};exports[_0x5f70('0x22')]=function(_0x49b6c4,_0x553072){return db[_0x5f70('0x28')][_0x5f70('0x43')]({'where':{'id':_0x49b6c4[_0x5f70('0x41')]['id']}})['then'](handleEntityNotFound(_0x553072,null))[_0x5f70('0x21')](removeEntity(_0x553072,null))[_0x5f70('0x44')](handleError(_0x553072,null));};exports[_0x5f70('0x47')]=function(_0x51e5a6,_0xbef7f9,_0x379d78){return db[_0x5f70('0x28')][_0x5f70('0x43')]({'where':{'id':_0x51e5a6[_0x5f70('0x41')]['id']},'attributes':['id',_0x5f70('0x48'),_0x5f70('0x49')]})[_0x5f70('0x21')](handleEntityNotFound(_0xbef7f9,null))[_0x5f70('0x21')](function(_0xe23a39){if(_0xe23a39){if(!_0xe23a39['recording']){throw new db['Sequelize'][(_0x5f70('0x4a'))](_0x5f70('0x4b'));}var _0x59174f={'Content-Type':_0x5f70('0x4c'),'Content-Disposition':_0x5f70('0x4d')};if(_0xe23a39[_0x5f70('0x49')]){_0x59174f[_0x5f70('0x4e')]='attachment;\x20filename=\x22'+_0xe23a39[_0x5f70('0x49')]+_0x5f70('0x4f');}_0xbef7f9[_0x5f70('0x50')](_0x59174f);return _0xbef7f9['send'](new Buffer(_0xe23a39[_0x5f70('0x48')]));}})[_0x5f70('0x44')](handleError(_0xbef7f9,null));};
\ No newline at end of file
index e642443..1b9e540 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27de=['dir','lodash','../../config/logger','api','bluebird','request-promise','VoiceMailMessage'];(function(_0x3c2a4e,_0x5bac97){var _0x5475c2=function(_0x340700){while(--_0x340700){_0x3c2a4e['push'](_0x3c2a4e['shift']());}};_0x5475c2(++_0x5bac97);}(_0x27de,0x182));var _0xe27d=function(_0x3c9315,_0x57a953){_0x3c9315=_0x3c9315-0x0;var _0x16e5c7=_0x27de[_0x3c9315];return _0x16e5c7;};'use strict';var _=require(_0xe27d('0x0'));var util=require('util');var logger=require(_0xe27d('0x1'))(_0xe27d('0x2'));var moment=require('moment');var BPromise=require(_0xe27d('0x3'));var rp=require(_0xe27d('0x4'));var attributes=require('./voiceMailMessage.attributes');module['exports']=function(_0xa305fa,_0x28dbe6){return _0xa305fa['define'](_0xe27d('0x5'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xe27d('0x6'),'fields':[_0xe27d('0x6')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xc5f0=['../../config/logger','api','moment','bluebird','request-promise','exports','define','voice_voicemail_messages','dir'];(function(_0x381a12,_0x4432ef){var _0x1574c5=function(_0x985e86){while(--_0x985e86){_0x381a12['push'](_0x381a12['shift']());}};_0x1574c5(++_0x4432ef);}(_0xc5f0,0xa2));var _0x0c5f=function(_0x4b12ae,_0xf2b3b){_0x4b12ae=_0x4b12ae-0x0;var _0x16957b=_0xc5f0[_0x4b12ae];return _0x16957b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0c5f('0x0'))(_0x0c5f('0x1'));var moment=require(_0x0c5f('0x2'));var BPromise=require(_0x0c5f('0x3'));var rp=require(_0x0c5f('0x4'));var attributes=require('./voiceMailMessage.attributes');module[_0x0c5f('0x5')]=function(_0x384c52,_0x4f8cd6){return _0x384c52[_0x0c5f('0x6')]('VoiceMailMessage',attributes,{'tableName':_0x0c5f('0x7'),'paranoid':![],'indexes':[{'name':_0x0c5f('0x8'),'fields':['dir']}],'timestamps':![]});};
\ No newline at end of file
index 855c2ba..4d4cf86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49d5=['debug','stringify','error','code','message','info','result','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','client','request','VoiceMailMessage,\x20%s,\x20%s','request\x20sent'];(function(_0xabcb5f,_0x5388c9){var _0x3d2dfe=function(_0x2b9bb5){while(--_0x2b9bb5){_0xabcb5f['push'](_0xabcb5f['shift']());}};_0x3d2dfe(++_0x5388c9);}(_0x49d5,0x117));var _0x549d=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x49d5[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x549d('0x0'));var util=require(_0x549d('0x1'));var moment=require('moment');var BPromise=require(_0x549d('0x2'));var rs=require('randomstring');var fs=require('fs');var db=require(_0x549d('0x3'))['db'];var utils=require(_0x549d('0x4'));var logger=require(_0x549d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x549d('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2358c5,_0x3c9396,_0x504888){return new BPromise(function(_0x2e9380,_0xd64244){return client[_0x549d('0x7')](_0x2358c5,_0x504888)['then'](function(_0x3956ae){logger['info'](_0x549d('0x8'),_0x3c9396,_0x549d('0x9'));logger[_0x549d('0xa')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x3c9396,_0x549d('0x9'),JSON[_0x549d('0xb')](_0x3956ae));if(_0x3956ae[_0x549d('0xc')]){if(_0x3956ae[_0x549d('0xc')][_0x549d('0xd')]===0x1f4){logger[_0x549d('0xc')](_0x549d('0x8'),_0x3c9396,_0x3956ae[_0x549d('0xc')][_0x549d('0xe')]);return _0xd64244(_0x3956ae[_0x549d('0xc')][_0x549d('0xe')]);}logger[_0x549d('0xc')](_0x549d('0x8'),_0x3c9396,_0x3956ae[_0x549d('0xc')]['message']);return _0x2e9380(_0x3956ae[_0x549d('0xc')][_0x549d('0xe')]);}else{logger[_0x549d('0xf')](_0x549d('0x8'),_0x3c9396,_0x549d('0x9'));_0x2e9380(_0x3956ae[_0x549d('0x10')][_0x549d('0xe')]);}})['catch'](function(_0x25f0b0){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x3c9396,_0x25f0b0);_0xd64244(_0x25f0b0);});});}
\ No newline at end of file
+var _0xdd43=['request\x20sent','error','message','result','catch','lodash','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x4a3fd5,_0xececf9){var _0xf9aedc=function(_0x1d3df4){while(--_0x1d3df4){_0x4a3fd5['push'](_0x4a3fd5['shift']());}};_0xf9aedc(++_0xececf9);}(_0xdd43,0x1f2));var _0x3dd4=function(_0xba0412,_0x251635){_0xba0412=_0xba0412-0x0;var _0xd70d4=_0xdd43[_0xba0412];return _0xd70d4;};'use strict';var _=require(_0x3dd4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3dd4('0x1'));var rs=require(_0x3dd4('0x2'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x3dd4('0x3'));var logger=require('../../config/logger')(_0x3dd4('0x4'));var config=require(_0x3dd4('0x5'));var jayson=require(_0x3dd4('0x6'));var client=jayson[_0x3dd4('0x7')][_0x3dd4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xef95e9,_0x1492b2,_0x3894e1){return new BPromise(function(_0x1461e2,_0x1fb87b){return client[_0x3dd4('0x9')](_0xef95e9,_0x3894e1)['then'](function(_0x29f56c){logger[_0x3dd4('0xa')](_0x3dd4('0xb'),_0x1492b2,_0x3dd4('0xc'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x1492b2,_0x3dd4('0xc'),JSON['stringify'](_0x29f56c));if(_0x29f56c[_0x3dd4('0xd')]){if(_0x29f56c[_0x3dd4('0xd')]['code']===0x1f4){logger[_0x3dd4('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x1492b2,_0x29f56c[_0x3dd4('0xd')][_0x3dd4('0xe')]);return _0x1fb87b(_0x29f56c[_0x3dd4('0xd')]['message']);}logger[_0x3dd4('0xd')](_0x3dd4('0xb'),_0x1492b2,_0x29f56c['error'][_0x3dd4('0xe')]);return _0x1461e2(_0x29f56c[_0x3dd4('0xd')][_0x3dd4('0xe')]);}else{logger['info'](_0x3dd4('0xb'),_0x1492b2,'request\x20sent');_0x1461e2(_0x29f56c[_0x3dd4('0xf')][_0x3dd4('0xe')]);}})[_0x3dd4('0x10')](function(_0x5ce411){logger[_0x3dd4('0xd')](_0x3dd4('0xb'),_0x1492b2,_0x5ce411);_0x1fb87b(_0x5ce411);});});}
\ No newline at end of file
index bb5b58b..89dbefb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1ad=['removeSound','multer','util','path','express','Router','../../components/auth/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','/:id/sounds','getSounds','post','addSound','put','/:id','update','delete','destroy','/:id/sounds/:id2'];(function(_0x59b61f,_0x4cf19e){var _0x439ea8=function(_0x7fc200){while(--_0x7fc200){_0x59b61f['push'](_0x59b61f['shift']());}};_0x439ea8(++_0x4cf19e);}(_0xb1ad,0x85));var _0xdb1a=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xb1ad[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0xdb1a('0x0'));var util=require(_0xdb1a('0x1'));var path=require(_0xdb1a('0x2'));var express=require(_0xdb1a('0x3'));var router=express[_0xdb1a('0x4')]();var auth=require(_0xdb1a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdb1a('0x6'));router[_0xdb1a('0x7')]('/',auth[_0xdb1a('0x8')](),controller[_0xdb1a('0x9')]);router['get']('/:id',auth[_0xdb1a('0x8')](),controller[_0xdb1a('0xa')]);router['get'](_0xdb1a('0xb'),auth[_0xdb1a('0x8')](),controller[_0xdb1a('0xc')]);router['post']('/',auth[_0xdb1a('0x8')](),controller['create']);router[_0xdb1a('0xd')](_0xdb1a('0xb'),auth[_0xdb1a('0x8')](),controller[_0xdb1a('0xe')]);router[_0xdb1a('0xf')](_0xdb1a('0x10'),auth[_0xdb1a('0x8')](),controller[_0xdb1a('0x11')]);router[_0xdb1a('0x12')](_0xdb1a('0x10'),auth['isAuthenticated'](),controller[_0xdb1a('0x13')]);router[_0xdb1a('0x12')](_0xdb1a('0x14'),auth['isAuthenticated'](),controller[_0xdb1a('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x1622=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','update','destroy','delete','/:id/sounds/:id2','removeSound','exports','util','path','express','Router'];(function(_0x254e42,_0x1e1a34){var _0x9dc84d=function(_0x29d187){while(--_0x29d187){_0x254e42['push'](_0x254e42['shift']());}};_0x9dc84d(++_0x1e1a34);}(_0x1622,0xac));var _0x2162=function(_0x29ca3a,_0x118266){_0x29ca3a=_0x29ca3a-0x0;var _0x45371e=_0x1622[_0x29ca3a];return _0x45371e;};'use strict';var multer=require('multer');var util=require(_0x2162('0x0'));var path=require(_0x2162('0x1'));var express=require(_0x2162('0x2'));var router=express[_0x2162('0x3')]();var auth=require(_0x2162('0x4'));var interaction=require(_0x2162('0x5'));var config=require(_0x2162('0x6'));var controller=require(_0x2162('0x7'));router[_0x2162('0x8')]('/',auth[_0x2162('0x9')](),controller[_0x2162('0xa')]);router[_0x2162('0x8')](_0x2162('0xb'),auth[_0x2162('0x9')](),controller[_0x2162('0xc')]);router[_0x2162('0x8')](_0x2162('0xd'),auth[_0x2162('0x9')](),controller[_0x2162('0xe')]);router[_0x2162('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2162('0xf')]('/:id/sounds',auth[_0x2162('0x9')](),controller['addSound']);router['put']('/:id',auth[_0x2162('0x9')](),controller[_0x2162('0x10')]);router['delete'](_0x2162('0xb'),auth[_0x2162('0x9')](),controller[_0x2162('0x11')]);router[_0x2162('0x12')](_0x2162('0x13'),auth[_0x2162('0x9')](),controller[_0x2162('0x14')]);module[_0x2162('0x15')]=router;
\ No newline at end of file
index 7f7c9c9..eea65a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b16=['BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP'];(function(_0x35521a,_0x5f0225){var _0x2d48ef=function(_0x5268ac){while(--_0x5268ac){_0x35521a['push'](_0x35521a['shift']());}};_0x2d48ef(++_0x5f0225);}(_0x5b16,0x115));var _0x65b1=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x5b16[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require(_0x65b1('0x0'));module[_0x65b1('0x1')]={'name':{'type':Sequelize[_0x65b1('0x2')],'allowNull':![],'unique':_0x65b1('0x3')},'mode':{'type':Sequelize[_0x65b1('0x4')](_0x65b1('0x5'),'files','mp3nb',_0x65b1('0x6'),_0x65b1('0x7'),_0x65b1('0x8')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x65b1('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x65b1('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x65b1('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x65b1('0x2')],'allowNull':!![],'defaultValue':_0x65b1('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x65b1('0xa')},'defaultEntry':{'type':Sequelize[_0x65b1('0xb')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x7ba4=['sequelize','exports','name','ENUM','custom','files','mp3nb','quietmp3','STRING','alpha','TIMESTAMP','BOOLEAN'];(function(_0xca6018,_0x25e56f){var _0xab8e40=function(_0x5c99d3){while(--_0x5c99d3){_0xca6018['push'](_0xca6018['shift']());}};_0xab8e40(++_0x25e56f);}(_0x7ba4,0x108));var _0x47ba=function(_0x3057ca,_0x1c1756){_0x3057ca=_0x3057ca-0x0;var _0x5ae785=_0x7ba4[_0x3057ca];return _0x5ae785;};'use strict';var Sequelize=require(_0x47ba('0x0'));module[_0x47ba('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x47ba('0x2')},'mode':{'type':Sequelize[_0x47ba('0x3')](_0x47ba('0x4'),_0x47ba('0x5'),_0x47ba('0x6'),'quietmp3nb',_0x47ba('0x7'),'mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x47ba('0x8')],'allowNull':!![]},'application':{'type':Sequelize[_0x47ba('0x8')],'allowNull':!![]},'digit':{'type':Sequelize[_0x47ba('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0x47ba('0x8')],'allowNull':!![],'defaultValue':_0x47ba('0x9')},'format':{'type':Sequelize[_0x47ba('0x8')],'allowNull':!![]},'stamp':{'type':_0x47ba('0xa')},'defaultEntry':{'type':Sequelize[_0x47ba('0xb')],'defaultValue':0x0}};
\ No newline at end of file
index 64ca189..cd47092 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2913=['day','merge','map','filter','options','includeAll','include','rows','show','rawAttributes','find','catch','body','params','create','sequelize','transaction','mode','directory','join','root','server/files/moh','files','mkdirSync','0777','destroy','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','converted_format','symlinkSync','removeSound','id2','getSounds','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','VoiceMusicOnHold','model','keys','query','dateEnd','dateStart','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','add'];(function(_0x550839,_0xf664c){var _0x145c26=function(_0x254fc8){while(--_0x254fc8){_0x550839['push'](_0x550839['shift']());}};_0x145c26(++_0xf664c);}(_0x2913,0x1c7));var _0x3291=function(_0x359479,_0x19b27c){_0x359479=_0x359479-0x0;var _0xa80759=_0x2913[_0x359479];return _0xa80759;};'use strict';var pdf=require(_0x3291('0x0'));var emlformat=require(_0x3291('0x1'));var rimraf=require(_0x3291('0x2'));var zipdir=require(_0x3291('0x3'));var jsonpatch=require(_0x3291('0x4'));var rp=require(_0x3291('0x5'));var moment=require(_0x3291('0x6'));var BPromise=require(_0x3291('0x7'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3291('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3291('0x9'));var squel=require(_0x3291('0xa'));var crypto=require(_0x3291('0xb'));var jsforce=require(_0x3291('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3291('0x8'));var querystring=require(_0x3291('0xd'));var Papa=require(_0x3291('0xe'));var qs=require(_0x3291('0xf'));var logger=require(_0x3291('0x10'))(_0x3291('0x11'));var utils=require(_0x3291('0x12'));var config=require(_0x3291('0x13'));var db=require(_0x3291('0x14'))['db'];function respondWithStatusCode(_0x486a39,_0x205255){_0x205255=_0x205255||0xcc;return function(_0x5b8531){if(_0x5b8531){return _0x486a39['sendStatus'](_0x205255);}return _0x486a39[_0x3291('0x15')](_0x205255)[_0x3291('0x16')]();};}function respondWithResult(_0x5df281,_0x58ab87){_0x58ab87=_0x58ab87||0xc8;return function(_0x2417bf){if(_0x2417bf){return _0x5df281['status'](_0x58ab87)[_0x3291('0x17')](_0x2417bf);}};}function respondWithFilteredResult(_0x57ac78,_0x3401b5){return function(_0x1f9008){if(_0x1f9008){var _0x17f6a5=_0x1f9008[_0x3291('0x18')],_0x120abd=_0x3401b5[_0x3291('0x19')],_0x1ad4a9=_0x3401b5['offset']+_0x3401b5[_0x3291('0x1a')],_0x35a286;if(_0x1ad4a9>=_0x17f6a5){_0x1ad4a9=_0x17f6a5;_0x35a286=0xc8;}else{_0x35a286=0xce;}_0x57ac78['status'](_0x35a286);return _0x57ac78[_0x3291('0x1b')](_0x3291('0x1c'),_0x120abd+'-'+_0x1ad4a9+'/'+_0x17f6a5)[_0x3291('0x17')](_0x1f9008);}return null;};}function patchUpdates(_0x57f1d9){return function(_0x57203c){try{jsonpatch[_0x3291('0x1d')](_0x57203c,_0x57f1d9,!![]);}catch(_0x3d79e8){return BPromise[_0x3291('0x1e')](_0x3d79e8);}return _0x57203c[_0x3291('0x1f')]();};}function saveUpdates(_0x3c036c,_0x4d2544){return function(_0x303a65){if(_0x303a65){return _0x303a65[_0x3291('0x20')](_0x3c036c)[_0x3291('0x21')](function(_0x46c8f1){return _0x46c8f1;});}return null;};}function removeEntity(_0x38a360,_0x53053d){return function(_0x487095){if(_0x487095){return _0x487095['destroy']()[_0x3291('0x21')](function(){_0x38a360[_0x3291('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x253b50,_0x1d345a){return function(_0x156ceb){if(!_0x156ceb){_0x253b50['sendStatus'](0x194);}return _0x156ceb;};}function handleError(_0x4678ef,_0x4e5cbb){_0x4e5cbb=_0x4e5cbb||0x1f4;return function(_0x222e57){logger[_0x3291('0x22')](_0x222e57['stack']);if(_0x222e57['name']){delete _0x222e57[_0x3291('0x23')];}_0x4678ef[_0x3291('0x15')](_0x4e5cbb)[_0x3291('0x24')](_0x222e57);};}exports['index']=function(_0x5a8705,_0x49d471){var _0x14d1a7={},_0x210d65={},_0xac4017={'count':0x0,'rows':[]};var _0x981986=db[_0x3291('0x25')]['rawAttributes'];_0x210d65[_0x3291('0x26')]=_[_0x3291('0x27')](_0x981986);var _0x249846={'dateStart':_0x5a8705[_0x3291('0x28')]['dateStart'],'dateEnd':_0x5a8705[_0x3291('0x28')][_0x3291('0x29')]};delete _0x5a8705[_0x3291('0x28')][_0x3291('0x2a')];delete _0x5a8705[_0x3291('0x28')][_0x3291('0x29')];_0x210d65[_0x3291('0x28')]=_[_0x3291('0x27')](_0x5a8705[_0x3291('0x28')]);_0x210d65[_0x3291('0x2b')]=_[_0x3291('0x2c')](_0x210d65[_0x3291('0x26')],_0x210d65[_0x3291('0x28')]);_0x14d1a7[_0x3291('0x2d')]=_[_0x3291('0x2c')](_0x210d65[_0x3291('0x26')],qs[_0x3291('0x2e')](_0x5a8705[_0x3291('0x28')][_0x3291('0x2e')]));_0x14d1a7[_0x3291('0x2d')]=_0x14d1a7['attributes'][_0x3291('0x2f')]?_0x14d1a7[_0x3291('0x2d')]:_0x210d65[_0x3291('0x26')];if(!_0x5a8705[_0x3291('0x28')][_0x3291('0x30')](_0x3291('0x31'))){_0x14d1a7[_0x3291('0x1a')]=qs[_0x3291('0x1a')](_0x5a8705[_0x3291('0x28')]['limit']);_0x14d1a7[_0x3291('0x19')]=qs[_0x3291('0x19')](_0x5a8705[_0x3291('0x28')]['offset']);}_0x14d1a7[_0x3291('0x32')]=qs[_0x3291('0x33')](_0x5a8705[_0x3291('0x28')]['sort']);_0x14d1a7[_0x3291('0x34')]=qs[_0x3291('0x2b')](_[_0x3291('0x35')](_0x5a8705['query'],_0x210d65[_0x3291('0x2b')]));if(_0x249846[_0x3291('0x2a')]){if(_0x249846[_0x3291('0x29')]){_0x249846['dateEnd']=moment(_0x249846['dateEnd'])[_0x3291('0x36')](0x1,_0x3291('0x37'));}else{_0x249846[_0x3291('0x29')]=moment(_0x249846[_0x3291('0x2a')])[_0x3291('0x36')](0x1,_0x3291('0x37'));}_[_0x3291('0x38')](_0x14d1a7['where'],{'createdAt':{'$gte':_0x249846[_0x3291('0x2a')],'$lte':_0x249846['dateEnd']}});}if(_0x5a8705[_0x3291('0x28')]['filter']){_0x14d1a7[_0x3291('0x34')]=_[_0x3291('0x38')](_0x14d1a7[_0x3291('0x34')],{'$or':_[_0x3291('0x39')](_0x14d1a7['attributes'],function(_0x2d66c1){var _0x2df127={};_0x2df127[_0x2d66c1]={'$like':'%'+_0x5a8705['query'][_0x3291('0x3a')]+'%'};return _0x2df127;})});}_0x14d1a7=_['merge']({},_0x14d1a7,_0x5a8705[_0x3291('0x3b')]);var _0x34d4b1={'where':_0x14d1a7['where']};return db[_0x3291('0x25')][_0x3291('0x18')](_0x34d4b1)[_0x3291('0x21')](function(_0x3345e1){_0xac4017['count']=_0x3345e1;if(_0x5a8705[_0x3291('0x28')][_0x3291('0x3c')]){_0x14d1a7[_0x3291('0x3d')]=[{'all':!![]}];}return db['VoiceMusicOnHold']['findAll'](_0x14d1a7);})['then'](function(_0x560307){_0xac4017[_0x3291('0x3e')]=_0x560307;return _0xac4017;})[_0x3291('0x21')](respondWithFilteredResult(_0x49d471,_0x14d1a7))['catch'](handleError(_0x49d471,null));};exports[_0x3291('0x3f')]=function(_0x104b7d,_0x524e64){var _0x261747={'raw':![],'where':{'id':_0x104b7d['params']['id']}},_0x1e8583={};_0x1e8583[_0x3291('0x26')]=_[_0x3291('0x27')](db[_0x3291('0x25')][_0x3291('0x40')]);_0x1e8583[_0x3291('0x28')]=_['keys'](_0x104b7d[_0x3291('0x28')]);_0x1e8583['filters']=_[_0x3291('0x2c')](_0x1e8583[_0x3291('0x26')],_0x1e8583[_0x3291('0x28')]);_0x261747[_0x3291('0x2d')]=_['intersection'](_0x1e8583[_0x3291('0x26')],qs['fields'](_0x104b7d[_0x3291('0x28')]['fields']));_0x261747[_0x3291('0x2d')]=_0x261747['attributes'][_0x3291('0x2f')]?_0x261747[_0x3291('0x2d')]:_0x1e8583[_0x3291('0x26')];if(_0x104b7d[_0x3291('0x28')][_0x3291('0x3c')]){_0x261747[_0x3291('0x3d')]=[{'all':!![]}];}_0x261747=_['merge']({},_0x261747,_0x104b7d[_0x3291('0x3b')]);return db[_0x3291('0x25')][_0x3291('0x41')](_0x261747)['then'](handleEntityNotFound(_0x524e64,null))[_0x3291('0x21')](respondWithResult(_0x524e64,null))[_0x3291('0x42')](handleError(_0x524e64,null));};exports[_0x3291('0x20')]=function(_0x5da42c,_0x3480c){if(_0x5da42c[_0x3291('0x43')]['id']){delete _0x5da42c['body']['id'];}return db['VoiceMusicOnHold'][_0x3291('0x41')]({'where':{'id':_0x5da42c[_0x3291('0x44')]['id']}})[_0x3291('0x21')](handleEntityNotFound(_0x3480c,null))[_0x3291('0x21')](saveUpdates(_0x5da42c[_0x3291('0x43')],null))[_0x3291('0x21')](respondWithResult(_0x3480c,null))[_0x3291('0x42')](handleError(_0x3480c,null));};exports[_0x3291('0x45')]=function(_0x4ae4dc,_0x3ed3cc,_0x5782b2){return db[_0x3291('0x46')][_0x3291('0x47')](function(_0x5f1164){if(_0x4ae4dc['body'][_0x3291('0x48')]==='files'){_0x4ae4dc[_0x3291('0x43')][_0x3291('0x49')]=path[_0x3291('0x4a')](config[_0x3291('0x4b')],_0x3291('0x4c'),_0x4ae4dc[_0x3291('0x43')][_0x3291('0x23')]);}return db[_0x3291('0x25')][_0x3291('0x45')](_0x4ae4dc[_0x3291('0x43')],{'transaction':_0x5f1164})['then'](function(_0x3d4c7c){if(_0x4ae4dc[_0x3291('0x43')][_0x3291('0x48')]===_0x3291('0x4d')){fs[_0x3291('0x4e')](_0x3d4c7c[_0x3291('0x49')],parseInt(_0x3291('0x4f'),0x8));}return _0x3d4c7c;});})['then'](respondWithResult(_0x3ed3cc,0xc9))['catch'](handleError(_0x3ed3cc,null));};exports[_0x3291('0x50')]=function(_0x5a0107,_0x3bd2a1,_0x34cce1){var _0x33afb6;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x5a0107[_0x3291('0x44')]['id']}})[_0x3291('0x21')](function(_0x3c6ab2){if(_0x3c6ab2){return db['sequelize']['transaction'](function(_0x29e771){return _0x3c6ab2['destroy']({'transaction':_0x29e771,'raw':!![]})[_0x3291('0x21')](function(_0x3a7da4){if(_0x3a7da4[_0x3291('0x49')]){fs['readdirSync'](_0x3a7da4['directory'])[_0x3291('0x51')](function(_0x6d6e24){fs[_0x3291('0x52')](path[_0x3291('0x4a')](_0x3a7da4[_0x3291('0x49')],_0x6d6e24));});fs[_0x3291('0x53')](_0x3a7da4['directory']);}return _0x3a7da4;});})['catch'](function(_0x141c1d){throw new db[(_0x3291('0x54'))][(_0x3291('0x55'))](_0x141c1d[_0x3291('0x56')]);});}})[_0x3291('0x21')](handleEntityNotFound(_0x3bd2a1,null))[_0x3291('0x21')](removeEntity(_0x3bd2a1,null))[_0x3291('0x42')](handleError(_0x3bd2a1,null));};exports[_0x3291('0x57')]=function(_0x2f28a4,_0x521062,_0x4d34db){return db[_0x3291('0x46')]['transaction'](function(_0x13ea8c){var _0x314e0c;return db[_0x3291('0x25')][_0x3291('0x41')]({'where':{'id':_0x2f28a4[_0x3291('0x44')]['id']}})[_0x3291('0x21')](function(_0x521fcd){if(_0x521fcd){_0x314e0c=_0x521fcd;return _0x521fcd[_0x3291('0x57')](_0x2f28a4[_0x3291('0x43')]['id'],{'transaction':_0x13ea8c});}})[_0x3291('0x21')](function(_0x3a1fae){if(_0x3a1fae){return db[_0x3291('0x58')][_0x3291('0x59')]({'where':{'id':_0x2f28a4[_0x3291('0x43')]['id']},'attributes':['id',_0x3291('0x23'),_0x3291('0x5a'),'converted_format',_0x3291('0x5b')],'raw':!![]});}})[_0x3291('0x21')](function(_0x57c741){if(_0x57c741){var _0x220973=path[_0x3291('0x4a')](config[_0x3291('0x4b')],_0x3291('0x5c'),util[_0x3291('0x5d')](_0x3291('0x5e'),path[_0x3291('0x5f')](_0x57c741[_0x3291('0x5a')],path[_0x3291('0x60')](_0x57c741[_0x3291('0x5a')])),_0x57c741[_0x3291('0x61')]));var _0x18dd0c=path[_0x3291('0x4a')](config[_0x3291('0x4b')],_0x3291('0x4c'),_0x314e0c['name'],util[_0x3291('0x5d')](_0x3291('0x5e'),_0x57c741[_0x3291('0x23')],_0x57c741[_0x3291('0x61')]));fs[_0x3291('0x62')](_0x220973,_0x18dd0c);return _0x57c741;}})[_0x3291('0x42')](function(_0x379ed4){throw new db[(_0x3291('0x54'))][(_0x3291('0x55'))](_0x379ed4[_0x3291('0x56')]);});})[_0x3291('0x21')](handleEntityNotFound(_0x521062,null))['then'](respondWithResult(_0x521062,0xc9))['catch'](handleError(_0x521062,null));};exports[_0x3291('0x63')]=function(_0x28f3db,_0x39d514,_0x5b248c){return db[_0x3291('0x46')]['transaction'](function(_0x4b5629){var _0x1d3b5d;return db[_0x3291('0x25')][_0x3291('0x59')]({'where':{'id':_0x28f3db[_0x3291('0x44')]['id']}})[_0x3291('0x21')](handleEntityNotFound(_0x39d514,null))[_0x3291('0x21')](function(_0x2cafb2){if(_0x2cafb2){_0x1d3b5d=_0x2cafb2;return _0x2cafb2[_0x3291('0x63')](_0x28f3db['params']['id2']);}})[_0x3291('0x21')](function(_0x547fea){if(_0x547fea){return db['Sound']['findOne']({'where':{'id':_0x28f3db[_0x3291('0x44')][_0x3291('0x64')]},'attributes':['id',_0x3291('0x23'),_0x3291('0x5a'),'converted_format',_0x3291('0x5b')],'raw':!![]});}})[_0x3291('0x21')](function(_0x399815){if(_0x399815){fs[_0x3291('0x52')](path[_0x3291('0x4a')](_0x1d3b5d[_0x3291('0x49')],util[_0x3291('0x5d')](_0x3291('0x5e'),_0x399815[_0x3291('0x23')],_0x399815[_0x3291('0x61')])));return _0x399815;}})[_0x3291('0x42')](function(_0x5ae036){throw new db['Sequelize'][(_0x3291('0x55'))](_0x5ae036[_0x3291('0x56')]);});})[_0x3291('0x21')](handleEntityNotFound(_0x39d514,null))[_0x3291('0x21')](respondWithStatusCode(_0x39d514,0xcc))[_0x3291('0x42')](handleError(_0x39d514,null));};exports[_0x3291('0x65')]=function(_0x306848,_0x2b1858,_0x5c42ea){var _0x346669={};var _0x2a5586={};var _0x340fc8;var _0x5b0da2;return db[_0x3291('0x25')][_0x3291('0x59')]({'where':{'id':_0x306848[_0x3291('0x44')]['id']}})[_0x3291('0x21')](handleEntityNotFound(_0x2b1858,null))[_0x3291('0x21')](function(_0x4f0b92){if(_0x4f0b92){_0x340fc8=_0x4f0b92;_0x2a5586[_0x3291('0x26')]=_[_0x3291('0x27')](db[_0x3291('0x58')][_0x3291('0x40')]);_0x2a5586['query']=_[_0x3291('0x27')](_0x306848[_0x3291('0x28')]);_0x2a5586[_0x3291('0x2b')]=_['intersection'](_0x2a5586[_0x3291('0x26')],_0x2a5586[_0x3291('0x28')]);_0x346669[_0x3291('0x2d')]=_[_0x3291('0x2c')](_0x2a5586[_0x3291('0x26')],qs[_0x3291('0x2e')](_0x306848['query'][_0x3291('0x2e')]));_0x346669[_0x3291('0x2d')]=_0x346669['attributes']['length']?_0x346669[_0x3291('0x2d')]:_0x2a5586[_0x3291('0x26')];_0x346669[_0x3291('0x32')]=qs[_0x3291('0x33')](_0x306848[_0x3291('0x28')]['sort']);_0x346669[_0x3291('0x34')]=qs[_0x3291('0x2b')](_[_0x3291('0x35')](_0x306848[_0x3291('0x28')],_0x2a5586[_0x3291('0x2b')]));if(_0x306848[_0x3291('0x28')][_0x3291('0x3a')]){_0x346669[_0x3291('0x34')]=_['merge'](_0x346669[_0x3291('0x34')],{'$or':_['map'](_0x346669[_0x3291('0x2d')],function(_0x2a30b5){var _0x203813={};_0x203813[_0x2a30b5]={'$like':'%'+_0x306848[_0x3291('0x28')][_0x3291('0x3a')]+'%'};return _0x203813;})});}_0x346669=_[_0x3291('0x38')]({},_0x346669,_0x306848[_0x3291('0x3b')]);return _0x340fc8[_0x3291('0x65')](_0x346669);}})[_0x3291('0x21')](function(_0x40b4c2){if(_0x40b4c2){_0x5b0da2=_0x40b4c2[_0x3291('0x2f')];if(!_0x306848[_0x3291('0x28')][_0x3291('0x30')](_0x3291('0x31'))){_0x346669[_0x3291('0x1a')]=qs[_0x3291('0x1a')](_0x306848[_0x3291('0x28')][_0x3291('0x1a')]);_0x346669['offset']=qs['offset'](_0x306848[_0x3291('0x28')][_0x3291('0x19')]);}return _0x340fc8[_0x3291('0x65')](_0x346669);}})[_0x3291('0x21')](function(_0x431e2a){if(_0x431e2a){return _0x431e2a?{'count':_0x5b0da2,'rows':_0x431e2a}:null;}})[_0x3291('0x21')](respondWithResult(_0x2b1858,null))['catch'](handleError(_0x2b1858,null));};
\ No newline at end of file
+var _0x054b=['../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','dateStart','query','dateEnd','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','pick','add','day','merge','filter','map','options','includeAll','include','VoiceMusicOnHold','findAll','rows','params','fields','length','find','catch','body','create','sequelize','mode','files','directory','server/files/moh','mkdirSync','0777','transaction','readdirSync','forEach','join','Sequelize','ValidationError','addSound','Sound','findOne','converted_format','root','server/files/sounds/converted','format','%s.%s','extname','save_name','message','removeSound','id2','createdAt','getSounds','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils'];(function(_0x1999fb,_0x3a4d55){var _0x1fd92d=function(_0x426ed5){while(--_0x426ed5){_0x1999fb['push'](_0x1999fb['shift']());}};_0x1fd92d(++_0x3a4d55);}(_0x054b,0x11c));var _0xb054=function(_0x3681f7,_0x36cc79){_0x3681f7=_0x3681f7-0x0;var _0x1f86af=_0x054b[_0x3681f7];return _0x1f86af;};'use strict';var pdf=require(_0xb054('0x0'));var emlformat=require(_0xb054('0x1'));var rimraf=require(_0xb054('0x2'));var zipdir=require(_0xb054('0x3'));var jsonpatch=require(_0xb054('0x4'));var rp=require(_0xb054('0x5'));var moment=require(_0xb054('0x6'));var BPromise=require(_0xb054('0x7'));var Mustache=require('mustache');var util=require(_0xb054('0x8'));var path=require(_0xb054('0x9'));var sox=require(_0xb054('0xa'));var csv=require(_0xb054('0xb'));var ejs=require(_0xb054('0xc'));var fs=require('fs');var _=require(_0xb054('0xd'));var squel=require(_0xb054('0xe'));var crypto=require('crypto');var jsforce=require(_0xb054('0xf'));var deskjs=require(_0xb054('0x10'));var toCsv=require(_0xb054('0xb'));var querystring=require(_0xb054('0x11'));var Papa=require(_0xb054('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0xb054('0x13'))(_0xb054('0x14'));var utils=require(_0xb054('0x15'));var config=require(_0xb054('0x16'));var db=require(_0xb054('0x17'))['db'];function respondWithStatusCode(_0x17631e,_0x2f7552){_0x2f7552=_0x2f7552||0xcc;return function(_0x4334a6){if(_0x4334a6){return _0x17631e[_0xb054('0x18')](_0x2f7552);}return _0x17631e[_0xb054('0x19')](_0x2f7552)[_0xb054('0x1a')]();};}function respondWithResult(_0x1d2199,_0x2f81b1){_0x2f81b1=_0x2f81b1||0xc8;return function(_0x10c243){if(_0x10c243){return _0x1d2199[_0xb054('0x19')](_0x2f81b1)['json'](_0x10c243);}};}function respondWithFilteredResult(_0x358770,_0x26ace6){return function(_0x3981ae){if(_0x3981ae){var _0xad1a26=_0x3981ae[_0xb054('0x1b')],_0x526d02=_0x26ace6[_0xb054('0x1c')],_0x332519=_0x26ace6[_0xb054('0x1c')]+_0x26ace6[_0xb054('0x1d')],_0x41927a;if(_0x332519>=_0xad1a26){_0x332519=_0xad1a26;_0x41927a=0xc8;}else{_0x41927a=0xce;}_0x358770['status'](_0x41927a);return _0x358770[_0xb054('0x1e')](_0xb054('0x1f'),_0x526d02+'-'+_0x332519+'/'+_0xad1a26)[_0xb054('0x20')](_0x3981ae);}return null;};}function patchUpdates(_0x45c916){return function(_0x389603){try{jsonpatch['apply'](_0x389603,_0x45c916,!![]);}catch(_0x34f198){return BPromise[_0xb054('0x21')](_0x34f198);}return _0x389603['save']();};}function saveUpdates(_0x39ad7f,_0x4f7116){return function(_0x289f35){if(_0x289f35){return _0x289f35['update'](_0x39ad7f)[_0xb054('0x22')](function(_0x6047d4){return _0x6047d4;});}return null;};}function removeEntity(_0x15f69d,_0x315246){return function(_0xf43c2f){if(_0xf43c2f){return _0xf43c2f[_0xb054('0x23')]()['then'](function(){_0x15f69d[_0xb054('0x19')](0xcc)[_0xb054('0x1a')]();});}};}function handleEntityNotFound(_0x3f8ece,_0x1e7bb1){return function(_0x3f54ca){if(!_0x3f54ca){_0x3f8ece[_0xb054('0x18')](0x194);}return _0x3f54ca;};}function handleError(_0x334986,_0x46a478){_0x46a478=_0x46a478||0x1f4;return function(_0xdb6795){logger[_0xb054('0x24')](_0xdb6795[_0xb054('0x25')]);if(_0xdb6795[_0xb054('0x26')]){delete _0xdb6795['name'];}_0x334986[_0xb054('0x19')](_0x46a478)[_0xb054('0x27')](_0xdb6795);};}exports[_0xb054('0x28')]=function(_0x57005a,_0x5ad441){var _0x119d38={},_0x6f2182={},_0x375ded={'count':0x0,'rows':[]};var _0x361a82=db['VoiceMusicOnHold'][_0xb054('0x29')];_0x6f2182[_0xb054('0x2a')]=_[_0xb054('0x2b')](_0x361a82);var _0x4630fd={'dateStart':_0x57005a['query'][_0xb054('0x2c')],'dateEnd':_0x57005a[_0xb054('0x2d')]['dateEnd']};delete _0x57005a[_0xb054('0x2d')][_0xb054('0x2c')];delete _0x57005a[_0xb054('0x2d')][_0xb054('0x2e')];_0x6f2182[_0xb054('0x2d')]=_['keys'](_0x57005a['query']);_0x6f2182[_0xb054('0x2f')]=_['intersection'](_0x6f2182[_0xb054('0x2a')],_0x6f2182[_0xb054('0x2d')]);_0x119d38[_0xb054('0x30')]=_[_0xb054('0x31')](_0x6f2182[_0xb054('0x2a')],qs['fields'](_0x57005a[_0xb054('0x2d')]['fields']));_0x119d38[_0xb054('0x30')]=_0x119d38[_0xb054('0x30')]['length']?_0x119d38[_0xb054('0x30')]:_0x6f2182[_0xb054('0x2a')];if(!_0x57005a[_0xb054('0x2d')][_0xb054('0x32')](_0xb054('0x33'))){_0x119d38[_0xb054('0x1d')]=qs['limit'](_0x57005a['query'][_0xb054('0x1d')]);_0x119d38[_0xb054('0x1c')]=qs[_0xb054('0x1c')](_0x57005a[_0xb054('0x2d')][_0xb054('0x1c')]);}_0x119d38[_0xb054('0x34')]=qs[_0xb054('0x35')](_0x57005a[_0xb054('0x2d')][_0xb054('0x35')]);_0x119d38[_0xb054('0x36')]=qs[_0xb054('0x2f')](_[_0xb054('0x37')](_0x57005a[_0xb054('0x2d')],_0x6f2182[_0xb054('0x2f')]));if(_0x4630fd[_0xb054('0x2c')]){if(_0x4630fd['dateEnd']){_0x4630fd[_0xb054('0x2e')]=moment(_0x4630fd[_0xb054('0x2e')])[_0xb054('0x38')](0x1,_0xb054('0x39'));}else{_0x4630fd[_0xb054('0x2e')]=moment(_0x4630fd[_0xb054('0x2c')])[_0xb054('0x38')](0x1,_0xb054('0x39'));}_[_0xb054('0x3a')](_0x119d38[_0xb054('0x36')],{'createdAt':{'$gte':_0x4630fd['dateStart'],'$lte':_0x4630fd[_0xb054('0x2e')]}});}if(_0x57005a['query'][_0xb054('0x3b')]){_0x119d38[_0xb054('0x36')]=_[_0xb054('0x3a')](_0x119d38['where'],{'$or':_[_0xb054('0x3c')](_0x119d38['attributes'],function(_0x56c6d4){var _0x141925={};_0x141925[_0x56c6d4]={'$like':'%'+_0x57005a[_0xb054('0x2d')][_0xb054('0x3b')]+'%'};return _0x141925;})});}_0x119d38=_[_0xb054('0x3a')]({},_0x119d38,_0x57005a[_0xb054('0x3d')]);var _0x203d19={'where':_0x119d38[_0xb054('0x36')]};return db['VoiceMusicOnHold']['count'](_0x203d19)['then'](function(_0xbc7f5f){_0x375ded[_0xb054('0x1b')]=_0xbc7f5f;if(_0x57005a[_0xb054('0x2d')][_0xb054('0x3e')]){_0x119d38[_0xb054('0x3f')]=[{'all':!![]}];}return db[_0xb054('0x40')][_0xb054('0x41')](_0x119d38);})[_0xb054('0x22')](function(_0x1ec1c6){_0x375ded[_0xb054('0x42')]=_0x1ec1c6;return _0x375ded;})[_0xb054('0x22')](respondWithFilteredResult(_0x5ad441,_0x119d38))['catch'](handleError(_0x5ad441,null));};exports['show']=function(_0x59b136,_0x768273){var _0x4239df={'raw':![],'where':{'id':_0x59b136[_0xb054('0x43')]['id']}},_0x8aa756={};_0x8aa756[_0xb054('0x2a')]=_[_0xb054('0x2b')](db['VoiceMusicOnHold']['rawAttributes']);_0x8aa756[_0xb054('0x2d')]=_[_0xb054('0x2b')](_0x59b136[_0xb054('0x2d')]);_0x8aa756[_0xb054('0x2f')]=_[_0xb054('0x31')](_0x8aa756[_0xb054('0x2a')],_0x8aa756[_0xb054('0x2d')]);_0x4239df[_0xb054('0x30')]=_[_0xb054('0x31')](_0x8aa756[_0xb054('0x2a')],qs[_0xb054('0x44')](_0x59b136['query']['fields']));_0x4239df['attributes']=_0x4239df[_0xb054('0x30')][_0xb054('0x45')]?_0x4239df[_0xb054('0x30')]:_0x8aa756[_0xb054('0x2a')];if(_0x59b136[_0xb054('0x2d')][_0xb054('0x3e')]){_0x4239df[_0xb054('0x3f')]=[{'all':!![]}];}_0x4239df=_[_0xb054('0x3a')]({},_0x4239df,_0x59b136[_0xb054('0x3d')]);return db[_0xb054('0x40')][_0xb054('0x46')](_0x4239df)[_0xb054('0x22')](handleEntityNotFound(_0x768273,null))[_0xb054('0x22')](respondWithResult(_0x768273,null))[_0xb054('0x47')](handleError(_0x768273,null));};exports['update']=function(_0x36184f,_0xb0bd0){if(_0x36184f[_0xb054('0x48')]['id']){delete _0x36184f['body']['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x36184f[_0xb054('0x43')]['id']}})['then'](handleEntityNotFound(_0xb0bd0,null))['then'](saveUpdates(_0x36184f[_0xb054('0x48')],null))['then'](respondWithResult(_0xb0bd0,null))[_0xb054('0x47')](handleError(_0xb0bd0,null));};exports[_0xb054('0x49')]=function(_0x9de1ae,_0x429ab1,_0x1a6e00){return db[_0xb054('0x4a')]['transaction'](function(_0x195f26){if(_0x9de1ae[_0xb054('0x48')][_0xb054('0x4b')]===_0xb054('0x4c')){_0x9de1ae[_0xb054('0x48')][_0xb054('0x4d')]=path['join'](config['root'],_0xb054('0x4e'),_0x9de1ae[_0xb054('0x48')][_0xb054('0x26')]);}return db['VoiceMusicOnHold'][_0xb054('0x49')](_0x9de1ae[_0xb054('0x48')],{'transaction':_0x195f26})[_0xb054('0x22')](function(_0x1a19f8){if(_0x9de1ae[_0xb054('0x48')][_0xb054('0x4b')]===_0xb054('0x4c')){fs[_0xb054('0x4f')](_0x1a19f8[_0xb054('0x4d')],parseInt(_0xb054('0x50'),0x8));}return _0x1a19f8;});})[_0xb054('0x22')](respondWithResult(_0x429ab1,0xc9))[_0xb054('0x47')](handleError(_0x429ab1,null));};exports[_0xb054('0x23')]=function(_0x39e4f8,_0x1e41b8,_0x173a13){var _0x3e371a;return db[_0xb054('0x40')]['find']({'where':{'id':_0x39e4f8[_0xb054('0x43')]['id']}})[_0xb054('0x22')](function(_0x4f7690){if(_0x4f7690){return db[_0xb054('0x4a')][_0xb054('0x51')](function(_0x23727b){return _0x4f7690[_0xb054('0x23')]({'transaction':_0x23727b,'raw':!![]})[_0xb054('0x22')](function(_0x4a44ac){if(_0x4a44ac[_0xb054('0x4d')]){fs[_0xb054('0x52')](_0x4a44ac[_0xb054('0x4d')])[_0xb054('0x53')](function(_0xb1010c){fs['unlinkSync'](path[_0xb054('0x54')](_0x4a44ac['directory'],_0xb1010c));});fs['rmdirSync'](_0x4a44ac[_0xb054('0x4d')]);}return _0x4a44ac;});})[_0xb054('0x47')](function(_0x66a912){throw new db[(_0xb054('0x55'))][(_0xb054('0x56'))](_0x66a912['message']);});}})[_0xb054('0x22')](handleEntityNotFound(_0x1e41b8,null))['then'](removeEntity(_0x1e41b8,null))[_0xb054('0x47')](handleError(_0x1e41b8,null));};exports[_0xb054('0x57')]=function(_0x35950a,_0x57e6c8,_0x45a19b){return db['sequelize'][_0xb054('0x51')](function(_0x45d36b){var _0x1eeda5;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x35950a['params']['id']}})[_0xb054('0x22')](function(_0x34542f){if(_0x34542f){_0x1eeda5=_0x34542f;return _0x34542f[_0xb054('0x57')](_0x35950a['body']['id'],{'transaction':_0x45d36b});}})[_0xb054('0x22')](function(_0x196d56){if(_0x196d56){return db[_0xb054('0x58')][_0xb054('0x59')]({'where':{'id':_0x35950a[_0xb054('0x48')]['id']},'attributes':['id',_0xb054('0x26'),'save_name',_0xb054('0x5a'),'createdAt'],'raw':!![]});}})[_0xb054('0x22')](function(_0x4730b3){if(_0x4730b3){var _0x3ac21c=path[_0xb054('0x54')](config[_0xb054('0x5b')],_0xb054('0x5c'),util[_0xb054('0x5d')](_0xb054('0x5e'),path['basename'](_0x4730b3['save_name'],path[_0xb054('0x5f')](_0x4730b3[_0xb054('0x60')])),_0x4730b3[_0xb054('0x5a')]));var _0x271b36=path[_0xb054('0x54')](config['root'],_0xb054('0x4e'),_0x1eeda5[_0xb054('0x26')],util['format'](_0xb054('0x5e'),_0x4730b3[_0xb054('0x26')],_0x4730b3[_0xb054('0x5a')]));fs['symlinkSync'](_0x3ac21c,_0x271b36);return _0x4730b3;}})[_0xb054('0x47')](function(_0x13aaed){throw new db[(_0xb054('0x55'))]['ValidationError'](_0x13aaed[_0xb054('0x61')]);});})[_0xb054('0x22')](handleEntityNotFound(_0x57e6c8,null))['then'](respondWithResult(_0x57e6c8,0xc9))[_0xb054('0x47')](handleError(_0x57e6c8,null));};exports[_0xb054('0x62')]=function(_0x4a95ec,_0x437efc,_0x192b24){return db[_0xb054('0x4a')][_0xb054('0x51')](function(_0xf59bc9){var _0xc49ace;return db['VoiceMusicOnHold'][_0xb054('0x59')]({'where':{'id':_0x4a95ec[_0xb054('0x43')]['id']}})['then'](handleEntityNotFound(_0x437efc,null))[_0xb054('0x22')](function(_0x4e4f8c){if(_0x4e4f8c){_0xc49ace=_0x4e4f8c;return _0x4e4f8c[_0xb054('0x62')](_0x4a95ec[_0xb054('0x43')]['id2']);}})['then'](function(_0x2b9555){if(_0x2b9555){return db[_0xb054('0x58')][_0xb054('0x59')]({'where':{'id':_0x4a95ec['params'][_0xb054('0x63')]},'attributes':['id','name',_0xb054('0x60'),'converted_format',_0xb054('0x64')],'raw':!![]});}})[_0xb054('0x22')](function(_0x1d929c){if(_0x1d929c){fs['unlinkSync'](path['join'](_0xc49ace[_0xb054('0x4d')],util[_0xb054('0x5d')](_0xb054('0x5e'),_0x1d929c[_0xb054('0x26')],_0x1d929c[_0xb054('0x5a')])));return _0x1d929c;}})[_0xb054('0x47')](function(_0x2792c2){throw new db[(_0xb054('0x55'))]['ValidationError'](_0x2792c2[_0xb054('0x61')]);});})['then'](handleEntityNotFound(_0x437efc,null))[_0xb054('0x22')](respondWithStatusCode(_0x437efc,0xcc))[_0xb054('0x47')](handleError(_0x437efc,null));};exports[_0xb054('0x65')]=function(_0x3d5154,_0x38440d,_0x3fc0bf){var _0x5b9dad={};var _0x1f51ab={};var _0x22e589;var _0x16b81b;return db[_0xb054('0x40')][_0xb054('0x59')]({'where':{'id':_0x3d5154['params']['id']}})['then'](handleEntityNotFound(_0x38440d,null))[_0xb054('0x22')](function(_0x29e9cf){if(_0x29e9cf){_0x22e589=_0x29e9cf;_0x1f51ab['model']=_['keys'](db[_0xb054('0x58')]['rawAttributes']);_0x1f51ab['query']=_[_0xb054('0x2b')](_0x3d5154[_0xb054('0x2d')]);_0x1f51ab[_0xb054('0x2f')]=_[_0xb054('0x31')](_0x1f51ab[_0xb054('0x2a')],_0x1f51ab[_0xb054('0x2d')]);_0x5b9dad[_0xb054('0x30')]=_[_0xb054('0x31')](_0x1f51ab[_0xb054('0x2a')],qs[_0xb054('0x44')](_0x3d5154[_0xb054('0x2d')]['fields']));_0x5b9dad[_0xb054('0x30')]=_0x5b9dad[_0xb054('0x30')]['length']?_0x5b9dad[_0xb054('0x30')]:_0x1f51ab['model'];_0x5b9dad['order']=qs[_0xb054('0x35')](_0x3d5154[_0xb054('0x2d')][_0xb054('0x35')]);_0x5b9dad[_0xb054('0x36')]=qs[_0xb054('0x2f')](_[_0xb054('0x37')](_0x3d5154[_0xb054('0x2d')],_0x1f51ab['filters']));if(_0x3d5154[_0xb054('0x2d')][_0xb054('0x3b')]){_0x5b9dad[_0xb054('0x36')]=_[_0xb054('0x3a')](_0x5b9dad[_0xb054('0x36')],{'$or':_[_0xb054('0x3c')](_0x5b9dad[_0xb054('0x30')],function(_0x597a1c){var _0x426b40={};_0x426b40[_0x597a1c]={'$like':'%'+_0x3d5154['query'][_0xb054('0x3b')]+'%'};return _0x426b40;})});}_0x5b9dad=_[_0xb054('0x3a')]({},_0x5b9dad,_0x3d5154[_0xb054('0x3d')]);return _0x22e589[_0xb054('0x65')](_0x5b9dad);}})['then'](function(_0x29f130){if(_0x29f130){_0x16b81b=_0x29f130[_0xb054('0x45')];if(!_0x3d5154[_0xb054('0x2d')]['hasOwnProperty']('nolimit')){_0x5b9dad[_0xb054('0x1d')]=qs[_0xb054('0x1d')](_0x3d5154[_0xb054('0x2d')][_0xb054('0x1d')]);_0x5b9dad['offset']=qs['offset'](_0x3d5154[_0xb054('0x2d')][_0xb054('0x1c')]);}return _0x22e589[_0xb054('0x65')](_0x5b9dad);}})[_0xb054('0x22')](function(_0x2a79a7){if(_0x2a79a7){return _0x2a79a7?{'count':_0x16b81b,'rows':_0x2a79a7}:null;}})[_0xb054('0x22')](respondWithResult(_0x38440d,null))['catch'](handleError(_0x38440d,null));};
\ No newline at end of file
index 8e7ed2d..4f05b80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x766e=['VoiceMusicOnHold','voice_musiconhold','api','exports'];(function(_0x48ebb1,_0x28e189){var _0x5f5934=function(_0xd02e23){while(--_0xd02e23){_0x48ebb1['push'](_0x48ebb1['shift']());}};_0x5f5934(++_0x28e189);}(_0x766e,0x1ea));var _0xe766=function(_0xdeffe6,_0x198150){_0xdeffe6=_0xdeffe6-0x0;var _0x5baeb=_0x766e[_0xdeffe6];return _0x5baeb;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe766('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require('./voiceMusicOnHold.attributes');module[_0xe766('0x1')]=function(_0x4c7447,_0x24d98f){return _0x4c7447['define'](_0xe766('0x2'),attributes,{'tableName':_0xe766('0x3'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5b09=['lodash','../../config/logger','api','moment','bluebird','request-promise','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x5b09,0x1e0));var _0x95b0=function(_0x435095,_0x3b5a53){_0x435095=_0x435095-0x0;var _0x1e6f54=_0x5b09[_0x435095];return _0x1e6f54;};'use strict';var _=require(_0x95b0('0x0'));var util=require('util');var logger=require(_0x95b0('0x1'))(_0x95b0('0x2'));var moment=require(_0x95b0('0x3'));var BPromise=require(_0x95b0('0x4'));var rp=require(_0x95b0('0x5'));var attributes=require(_0x95b0('0x6'));module[_0x95b0('0x7')]=function(_0x524136,_0x5949ed){return _0x524136['define'](_0x95b0('0x8'),attributes,{'tableName':_0x95b0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1fbd338..31d4cc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf18f=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x35edbe,_0x3385e5){var _0x57aa6d=function(_0x3d63d1){while(--_0x3d63d1){_0x35edbe['push'](_0x35edbe['shift']());}};_0x57aa6d(++_0x3385e5);}(_0xf18f,0x86));var _0xff18=function(_0x13e7b2,_0x1be99b){_0x13e7b2=_0x13e7b2-0x0;var _0x1ecb71=_0xf18f[_0x13e7b2];return _0x1ecb71;};'use strict';var _=require(_0xff18('0x0'));var util=require(_0xff18('0x1'));var moment=require(_0xff18('0x2'));var BPromise=require(_0xff18('0x3'));var rs=require(_0xff18('0x4'));var fs=require('fs');var db=require(_0xff18('0x5'))['db'];var utils=require(_0xff18('0x6'));var logger=require(_0xff18('0x7'))(_0xff18('0x8'));var config=require(_0xff18('0x9'));var jayson=require(_0xff18('0xa'));var client=jayson[_0xff18('0xb')][_0xff18('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ba652,_0xe7b9e0,_0x1915ab){return new BPromise(function(_0x75316,_0x550d00){return client[_0xff18('0xd')](_0x5ba652,_0x1915ab)[_0xff18('0xe')](function(_0x4f498a){logger[_0xff18('0xf')](_0xff18('0x10'),_0xe7b9e0,_0xff18('0x11'));logger[_0xff18('0x12')](_0xff18('0x13'),_0xe7b9e0,_0xff18('0x11'),JSON[_0xff18('0x14')](_0x4f498a));if(_0x4f498a[_0xff18('0x15')]){if(_0x4f498a[_0xff18('0x15')][_0xff18('0x16')]===0x1f4){logger[_0xff18('0x15')](_0xff18('0x10'),_0xe7b9e0,_0x4f498a['error']['message']);return _0x550d00(_0x4f498a['error'][_0xff18('0x17')]);}logger[_0xff18('0x15')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xe7b9e0,_0x4f498a[_0xff18('0x15')][_0xff18('0x17')]);return _0x75316(_0x4f498a['error'][_0xff18('0x17')]);}else{logger['info'](_0xff18('0x10'),_0xe7b9e0,_0xff18('0x11'));_0x75316(_0x4f498a['result'][_0xff18('0x17')]);}})[_0xff18('0x18')](function(_0x507ac0){logger[_0xff18('0x15')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xe7b9e0,_0x507ac0);_0x550d00(_0x507ac0);});});}
\ No newline at end of file
+var _0xe4d0=['result','catch','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','VoiceMusicOnHold,\x20%s,\x20%s','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe4d0,0x1a4));var _0x0e4d=function(_0x1ebb10,_0x156b3e){_0x1ebb10=_0x1ebb10-0x0;var _0x20d709=_0xe4d0[_0x1ebb10];return _0x20d709;};'use strict';var _=require('lodash');var util=require(_0x0e4d('0x0'));var moment=require('moment');var BPromise=require(_0x0e4d('0x1'));var rs=require(_0x0e4d('0x2'));var fs=require('fs');var db=require(_0x0e4d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0e4d('0x4'));var config=require(_0x0e4d('0x5'));var jayson=require(_0x0e4d('0x6'));var client=jayson['client'][_0x0e4d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x23ad1c,_0x8b81b8,_0x3e2cee){return new BPromise(function(_0x43d3f7,_0x59623c){return client['request'](_0x23ad1c,_0x3e2cee)[_0x0e4d('0x8')](function(_0x49a737){logger[_0x0e4d('0x9')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x8b81b8,_0x0e4d('0xa'));logger[_0x0e4d('0xb')](_0x0e4d('0xc'),_0x8b81b8,_0x0e4d('0xa'),JSON[_0x0e4d('0xd')](_0x49a737));if(_0x49a737['error']){if(_0x49a737[_0x0e4d('0xe')]['code']===0x1f4){logger[_0x0e4d('0xe')](_0x0e4d('0xf'),_0x8b81b8,_0x49a737['error'][_0x0e4d('0x10')]);return _0x59623c(_0x49a737['error'][_0x0e4d('0x10')]);}logger['error'](_0x0e4d('0xf'),_0x8b81b8,_0x49a737['error'][_0x0e4d('0x10')]);return _0x43d3f7(_0x49a737[_0x0e4d('0xe')][_0x0e4d('0x10')]);}else{logger[_0x0e4d('0x9')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x8b81b8,_0x0e4d('0xa'));_0x43d3f7(_0x49a737[_0x0e4d('0x11')][_0x0e4d('0x10')]);}})[_0x0e4d('0x12')](function(_0x20292f){logger[_0x0e4d('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x8b81b8,_0x20292f);_0x59623c(_0x20292f);});});}
\ No newline at end of file
index de1d585..183454b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36a6=['express','../../config/environment','./voicePrefix.controller','get','isAuthenticated','/describe','/:id','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','removeAgents','exports','multer','path'];(function(_0x5eb64a,_0x9301f5){var _0x3d3be1=function(_0x4fcf2b){while(--_0x4fcf2b){_0x5eb64a['push'](_0x5eb64a['shift']());}};_0x3d3be1(++_0x9301f5);}(_0x36a6,0x1de));var _0x636a=function(_0x2da42a,_0x40b453){_0x2da42a=_0x2da42a-0x0;var _0x2078f0=_0x36a6[_0x2da42a];return _0x2078f0;};'use strict';var multer=require(_0x636a('0x0'));var util=require('util');var path=require(_0x636a('0x1'));var express=require(_0x636a('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x636a('0x3'));var controller=require(_0x636a('0x4'));router[_0x636a('0x5')]('/',auth[_0x636a('0x6')](),controller['index']);router['get'](_0x636a('0x7'),auth[_0x636a('0x6')](),controller['describe']);router[_0x636a('0x5')](_0x636a('0x8'),auth[_0x636a('0x6')](),controller['show']);router[_0x636a('0x5')](_0x636a('0x9'),auth[_0x636a('0x6')](),controller[_0x636a('0xa')]);router[_0x636a('0xb')]('/',auth[_0x636a('0x6')](),controller[_0x636a('0xc')]);router[_0x636a('0xb')]('/:id/users',auth[_0x636a('0x6')](),controller[_0x636a('0xd')]);router[_0x636a('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x636a('0xf')]);router[_0x636a('0x10')](_0x636a('0x8'),auth[_0x636a('0x6')](),controller[_0x636a('0x11')]);router[_0x636a('0x10')](_0x636a('0x9'),auth[_0x636a('0x6')](),controller[_0x636a('0x12')]);module[_0x636a('0x13')]=router;
\ No newline at end of file
+var _0x1160=['../../config/environment','./voicePrefix.controller','get','isAuthenticated','/describe','/:id','getAgents','post','create','addAgents','put','destroy','/:id/users','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5056d9,_0x1f678c){var _0x166f29=function(_0x4e761c){while(--_0x4e761c){_0x5056d9['push'](_0x5056d9['shift']());}};_0x166f29(++_0x1f678c);}(_0x1160,0x19e));var _0x0116=function(_0x1d9e40,_0x1c44db){_0x1d9e40=_0x1d9e40-0x0;var _0x2ee94f=_0x1160[_0x1d9e40];return _0x2ee94f;};'use strict';var multer=require('multer');var util=require(_0x0116('0x0'));var path=require(_0x0116('0x1'));var express=require(_0x0116('0x2'));var router=express[_0x0116('0x3')]();var auth=require(_0x0116('0x4'));var interaction=require(_0x0116('0x5'));var config=require(_0x0116('0x6'));var controller=require(_0x0116('0x7'));router[_0x0116('0x8')]('/',auth[_0x0116('0x9')](),controller['index']);router[_0x0116('0x8')](_0x0116('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0116('0x8')](_0x0116('0xb'),auth[_0x0116('0x9')](),controller['show']);router['get']('/:id/users',auth[_0x0116('0x9')](),controller[_0x0116('0xc')]);router[_0x0116('0xd')]('/',auth[_0x0116('0x9')](),controller[_0x0116('0xe')]);router[_0x0116('0xd')]('/:id/users',auth['isAuthenticated'](),controller[_0x0116('0xf')]);router[_0x0116('0x10')]('/:id',auth[_0x0116('0x9')](),controller['update']);router['delete'](_0x0116('0xb'),auth[_0x0116('0x9')](),controller[_0x0116('0x11')]);router['delete'](_0x0116('0x12'),auth[_0x0116('0x9')](),controller['removeAgents']);module[_0x0116('0x13')]=router;
\ No newline at end of file
index d4f6f1c..ce9ada5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf1a=['name','INTEGER','sequelize','exports','STRING'];(function(_0x8b2cc7,_0x3f492b){var _0x2a4a45=function(_0x4bd7d1){while(--_0x4bd7d1){_0x8b2cc7['push'](_0x8b2cc7['shift']());}};_0x2a4a45(++_0x3f492b);}(_0xbf1a,0xa2));var _0xabf1=function(_0x2dbc75,_0xa680f){_0x2dbc75=_0x2dbc75-0x0;var _0x5ac112=_0xbf1a[_0x2dbc75];return _0x5ac112;};'use strict';var Sequelize=require(_0xabf1('0x0'));module[_0xabf1('0x1')]={'name':{'type':Sequelize[_0xabf1('0x2')],'allowNull':![],'unique':_0xabf1('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x302dc7){return'system-'+this['getDataValue'](_0xabf1('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xabf1('0x4')]}};
\ No newline at end of file
+var _0xf97c=['STRING','VIRTUAL','system-','getDataValue','INTEGER','sequelize','exports'];(function(_0x299e1e,_0x20eab5){var _0x3757dc=function(_0x211535){while(--_0x211535){_0x299e1e['push'](_0x299e1e['shift']());}};_0x3757dc(++_0x20eab5);}(_0xf97c,0xbb));var _0xcf97=function(_0x1b3a72,_0x3a1f98){_0x1b3a72=_0x1b3a72-0x0;var _0x8b247f=_0xf97c[_0x1b3a72];return _0x8b247f;};'use strict';var Sequelize=require(_0xcf97('0x0'));module[_0xcf97('0x1')]={'name':{'type':Sequelize[_0xcf97('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xcf97('0x3')],'get':function(_0x440e79){return _0xcf97('0x4')+this[_0xcf97('0x5')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xcf97('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xcf97('0x6')]}};
\ No newline at end of file
index 16347b3..8a4fe98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe09=['api','../../config/utils','../../config/environment','../../mysqldb','localhost','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','VoicePrefix','model','keys','query','dateStart','dateEnd','intersection','fields','attributes','length','order','sort','filters','pick','add','day','filter','where','merge','map','options','includeAll','include','findAll','rows','catch','show','params','find','describe','sequelize','transaction','create','body','VoiceExtension','VoiceExtensionId','context','from-sip','exten','app','type','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','charAt','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','rawAttributes','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xfe09,0x66));var _0x9fe0=function(_0x3c0613,_0x5c0540){_0x3c0613=_0x3c0613-0x0;var _0x4917ca=_0xfe09[_0x3c0613];return _0x4917ca;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9fe0('0x0'));var rimraf=require(_0x9fe0('0x1'));var zipdir=require(_0x9fe0('0x2'));var jsonpatch=require(_0x9fe0('0x3'));var rp=require(_0x9fe0('0x4'));var moment=require(_0x9fe0('0x5'));var BPromise=require(_0x9fe0('0x6'));var Mustache=require(_0x9fe0('0x7'));var util=require(_0x9fe0('0x8'));var path=require(_0x9fe0('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9fe0('0xa'));var squel=require(_0x9fe0('0xb'));var crypto=require(_0x9fe0('0xc'));var jsforce=require(_0x9fe0('0xd'));var deskjs=require(_0x9fe0('0xe'));var toCsv=require(_0x9fe0('0xf'));var querystring=require(_0x9fe0('0x10'));var Papa=require(_0x9fe0('0x11'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x9fe0('0x12'));var utils=require(_0x9fe0('0x13'));var config=require(_0x9fe0('0x14'));var db=require(_0x9fe0('0x15'))['db'];var socket=require('socket.io-emitter')({'host':_0x9fe0('0x16'),'port':0x18eb});require('./voicePrefix.socket')[_0x9fe0('0x17')](socket);function respondWithStatusCode(_0x872c62,_0x3c0151){_0x3c0151=_0x3c0151||0xcc;return function(_0x2fd6ec){if(_0x2fd6ec){return _0x872c62['sendStatus'](_0x3c0151);}return _0x872c62[_0x9fe0('0x18')](_0x3c0151)[_0x9fe0('0x19')]();};}function respondWithResult(_0x178acf,_0x3b3d4f){_0x3b3d4f=_0x3b3d4f||0xc8;return function(_0x379adb){if(_0x379adb){return _0x178acf[_0x9fe0('0x18')](_0x3b3d4f)[_0x9fe0('0x1a')](_0x379adb);}};}function respondWithFilteredResult(_0x10d8ae,_0x13585a){return function(_0x4bd099){if(_0x4bd099){var _0x256fa7=_0x4bd099[_0x9fe0('0x1b')],_0x3a1cd0=_0x13585a[_0x9fe0('0x1c')],_0x2bc5ed=_0x13585a['offset']+_0x13585a[_0x9fe0('0x1d')],_0x25e6ee;if(_0x2bc5ed>=_0x256fa7){_0x2bc5ed=_0x256fa7;_0x25e6ee=0xc8;}else{_0x25e6ee=0xce;}_0x10d8ae['status'](_0x25e6ee);return _0x10d8ae[_0x9fe0('0x1e')](_0x9fe0('0x1f'),_0x3a1cd0+'-'+_0x2bc5ed+'/'+_0x256fa7)[_0x9fe0('0x1a')](_0x4bd099);}return null;};}function patchUpdates(_0x3dec4){return function(_0x1a1256){try{jsonpatch[_0x9fe0('0x20')](_0x1a1256,_0x3dec4,!![]);}catch(_0x1d158f){return BPromise[_0x9fe0('0x21')](_0x1d158f);}return _0x1a1256[_0x9fe0('0x22')]();};}function saveUpdates(_0x5755f7,_0x9a828a){return function(_0x252b8d){if(_0x252b8d){return _0x252b8d[_0x9fe0('0x23')](_0x5755f7)[_0x9fe0('0x24')](function(_0x50a818){return _0x50a818;});}return null;};}function removeEntity(_0x4a681b,_0x1f80ea){return function(_0x1dc299){if(_0x1dc299){return _0x1dc299[_0x9fe0('0x25')]()[_0x9fe0('0x24')](function(){_0x4a681b[_0x9fe0('0x18')](0xcc)[_0x9fe0('0x19')]();});}};}function handleEntityNotFound(_0x57e474,_0x43c62f){return function(_0x26e7a6){if(!_0x26e7a6){_0x57e474['sendStatus'](0x194);}return _0x26e7a6;};}function handleError(_0x52bee1,_0x2321d2){_0x2321d2=_0x2321d2||0x1f4;return function(_0x122c24){logger[_0x9fe0('0x26')](_0x122c24[_0x9fe0('0x27')]);if(_0x122c24[_0x9fe0('0x28')]){delete _0x122c24[_0x9fe0('0x28')];}_0x52bee1[_0x9fe0('0x18')](_0x2321d2)[_0x9fe0('0x29')](_0x122c24);};}exports[_0x9fe0('0x2a')]=function(_0x5ac527,_0xc6cbb){var _0x3adbf8={},_0x156096={},_0x171673={'count':0x0,'rows':[]};var _0x16c4c4=db[_0x9fe0('0x2b')]['rawAttributes'];_0x156096[_0x9fe0('0x2c')]=_[_0x9fe0('0x2d')](_0x16c4c4);var _0xfdae7e={'dateStart':_0x5ac527[_0x9fe0('0x2e')][_0x9fe0('0x2f')],'dateEnd':_0x5ac527['query'][_0x9fe0('0x30')]};delete _0x5ac527['query'][_0x9fe0('0x2f')];delete _0x5ac527['query'][_0x9fe0('0x30')];_0x156096[_0x9fe0('0x2e')]=_[_0x9fe0('0x2d')](_0x5ac527[_0x9fe0('0x2e')]);_0x156096['filters']=_[_0x9fe0('0x31')](_0x156096['model'],_0x156096['query']);_0x3adbf8['attributes']=_[_0x9fe0('0x31')](_0x156096[_0x9fe0('0x2c')],qs[_0x9fe0('0x32')](_0x5ac527[_0x9fe0('0x2e')][_0x9fe0('0x32')]));_0x3adbf8[_0x9fe0('0x33')]=_0x3adbf8[_0x9fe0('0x33')][_0x9fe0('0x34')]?_0x3adbf8['attributes']:_0x156096[_0x9fe0('0x2c')];if(!_0x5ac527[_0x9fe0('0x2e')]['hasOwnProperty']('nolimit')){_0x3adbf8[_0x9fe0('0x1d')]=qs[_0x9fe0('0x1d')](_0x5ac527[_0x9fe0('0x2e')][_0x9fe0('0x1d')]);_0x3adbf8[_0x9fe0('0x1c')]=qs['offset'](_0x5ac527['query']['offset']);}_0x3adbf8[_0x9fe0('0x35')]=qs['sort'](_0x5ac527[_0x9fe0('0x2e')][_0x9fe0('0x36')]);_0x3adbf8['where']=qs[_0x9fe0('0x37')](_[_0x9fe0('0x38')](_0x5ac527[_0x9fe0('0x2e')],_0x156096['filters']));if(_0xfdae7e['dateStart']){if(_0xfdae7e[_0x9fe0('0x30')]){_0xfdae7e['dateEnd']=moment(_0xfdae7e[_0x9fe0('0x30')])[_0x9fe0('0x39')](0x1,'day');}else{_0xfdae7e[_0x9fe0('0x30')]=moment(_0xfdae7e[_0x9fe0('0x2f')])[_0x9fe0('0x39')](0x1,_0x9fe0('0x3a'));}_['merge'](_0x3adbf8['where'],{'createdAt':{'$gte':_0xfdae7e[_0x9fe0('0x2f')],'$lte':_0xfdae7e['dateEnd']}});}if(_0x5ac527['query'][_0x9fe0('0x3b')]){_0x3adbf8[_0x9fe0('0x3c')]=_[_0x9fe0('0x3d')](_0x3adbf8[_0x9fe0('0x3c')],{'$or':_[_0x9fe0('0x3e')](_0x3adbf8[_0x9fe0('0x33')],function(_0x489d8d){var _0x2ff045={};_0x2ff045[_0x489d8d]={'$like':'%'+_0x5ac527[_0x9fe0('0x2e')][_0x9fe0('0x3b')]+'%'};return _0x2ff045;})});}_0x3adbf8=_[_0x9fe0('0x3d')]({},_0x3adbf8,_0x5ac527[_0x9fe0('0x3f')]);var _0x2c54d4={'where':_0x3adbf8[_0x9fe0('0x3c')]};return db['VoicePrefix'][_0x9fe0('0x1b')](_0x2c54d4)[_0x9fe0('0x24')](function(_0x3eaec6){_0x171673[_0x9fe0('0x1b')]=_0x3eaec6;if(_0x5ac527[_0x9fe0('0x2e')][_0x9fe0('0x40')]){_0x3adbf8[_0x9fe0('0x41')]=[{'all':!![]}];}return db['VoicePrefix'][_0x9fe0('0x42')](_0x3adbf8);})[_0x9fe0('0x24')](function(_0x4f0433){_0x171673[_0x9fe0('0x43')]=_0x4f0433;return _0x171673;})[_0x9fe0('0x24')](respondWithFilteredResult(_0xc6cbb,_0x3adbf8))[_0x9fe0('0x44')](handleError(_0xc6cbb,null));};exports[_0x9fe0('0x45')]=function(_0x502f5b,_0x4b8abb){var _0xc39955={'raw':![],'where':{'id':_0x502f5b[_0x9fe0('0x46')]['id']}},_0x17e382={};_0x17e382[_0x9fe0('0x2c')]=_['keys'](db[_0x9fe0('0x2b')]['rawAttributes']);_0x17e382[_0x9fe0('0x2e')]=_[_0x9fe0('0x2d')](_0x502f5b[_0x9fe0('0x2e')]);_0x17e382[_0x9fe0('0x37')]=_[_0x9fe0('0x31')](_0x17e382['model'],_0x17e382['query']);_0xc39955[_0x9fe0('0x33')]=_[_0x9fe0('0x31')](_0x17e382['model'],qs[_0x9fe0('0x32')](_0x502f5b['query'][_0x9fe0('0x32')]));_0xc39955['attributes']=_0xc39955[_0x9fe0('0x33')]['length']?_0xc39955[_0x9fe0('0x33')]:_0x17e382[_0x9fe0('0x2c')];if(_0x502f5b[_0x9fe0('0x2e')][_0x9fe0('0x40')]){_0xc39955[_0x9fe0('0x41')]=[{'all':!![]}];}_0xc39955=_[_0x9fe0('0x3d')]({},_0xc39955,_0x502f5b[_0x9fe0('0x3f')]);return db[_0x9fe0('0x2b')][_0x9fe0('0x47')](_0xc39955)[_0x9fe0('0x24')](handleEntityNotFound(_0x4b8abb,null))[_0x9fe0('0x24')](respondWithResult(_0x4b8abb,null))[_0x9fe0('0x44')](handleError(_0x4b8abb,null));};exports['destroy']=function(_0x145878,_0x2c1ca7){return db['VoicePrefix'][_0x9fe0('0x47')]({'where':{'id':_0x145878[_0x9fe0('0x46')]['id']}})[_0x9fe0('0x24')](handleEntityNotFound(_0x2c1ca7,null))[_0x9fe0('0x24')](removeEntity(_0x2c1ca7,null))['catch'](handleError(_0x2c1ca7,null));};exports[_0x9fe0('0x48')]=function(_0x29b86e,_0x443565){return db[_0x9fe0('0x2b')]['describe']()['then'](respondWithResult(_0x443565,null))[_0x9fe0('0x44')](handleError(_0x443565,null));};exports['create']=function(_0x5b8842,_0x5cf2c6){var _0x487f88;return db[_0x9fe0('0x49')][_0x9fe0('0x4a')](function(_0xdb0260){return db['VoicePrefix'][_0x9fe0('0x4b')](_0x5b8842[_0x9fe0('0x4c')],{'transaction':_0xdb0260})[_0x9fe0('0x24')](function(_0x594f2b){_0x487f88=_0x594f2b['get']({'plain':!![]});return db[_0x9fe0('0x4d')][_0x9fe0('0x47')]({'where':{'id':_0x487f88[_0x9fe0('0x4e')]},'raw':!![]})[_0x9fe0('0x24')](function(_0x1bf68d){return createVoicePrefixExtensions(_0x487f88,_0x1bf68d,_0xdb0260);});});})[_0x9fe0('0x24')](function(){return _0x487f88;})[_0x9fe0('0x24')](respondWithResult(_0x5cf2c6,null))[_0x9fe0('0x44')](handleError(_0x5cf2c6,null));};function Extension(_0xb07e1c,_0x2c85c7,_0x34af02,_0xce5df){this[_0x9fe0('0x4f')]=_0x9fe0('0x50');this[_0x9fe0('0x51')]=_0xb07e1c;this[_0x9fe0('0x52')]=_0x34af02;this[_0x9fe0('0x53')]=_0x9fe0('0x54');this[_0x9fe0('0x55')]=_0x9fe0('0x56');this[_0x9fe0('0x57')]=_0x2c85c7;this[_0x9fe0('0x58')]=_0xce5df;}function createVoicePrefixExtensions(_0x428ad9,_0x99f755,_0x51deeb){return new BPromise(function(_0x216fbb,_0x2dfd1){var _0x4ec5d4=new Extension(formatPrefixName(_0x428ad9[_0x9fe0('0x59')]),0x1,_0x9fe0('0x5a'),_0x9fe0('0x5b'));_0x4ec5d4[_0x9fe0('0x5c')]=_0x428ad9['id'];return db[_0x9fe0('0x4d')][_0x9fe0('0x4b')](_0x4ec5d4,{'transaction':_0x51deeb})[_0x9fe0('0x24')](function(_0x368d4b){var _0x12e786=_0x368d4b['get']({'plain':!![]});var _0x59047d=_['map'](addVoicePrefixExtensions(_0x428ad9,_0x99f755),function(_0x35db40){_0x35db40[_0x9fe0('0x4e')]=_0x12e786['id'];_0x35db40[_0x9fe0('0x5c')]=_0x428ad9['id'];return _0x35db40;});return db[_0x9fe0('0x4d')][_0x9fe0('0x5d')](_0x59047d,{'transaction':_0x51deeb})[_0x9fe0('0x24')](function(_0xe481ae){if(!_0xe481ae){return _0x2dfd1(_0x9fe0('0x5e'));}else{return _0x216fbb(_0xe481ae);}})[_0x9fe0('0x44')](function(_0xeec5b4){return _0x2dfd1(_0xeec5b4);});});;});};function addVoicePrefixExtensions(_0x3acc8d,_0x4355c9){var _0x22a177=[];var _0x1761af=formatPrefixName(_0x3acc8d['prefix']);_0x22a177[_0x9fe0('0x5f')](new Extension(_0x1761af,0x2,_0x9fe0('0x60'),_0x9fe0('0x61')+_0x3acc8d[_0x9fe0('0x28')]));if(_0x3acc8d['callerIdAll']){_0x22a177[_0x9fe0('0x5f')](new Extension(_0x1761af,0x3,_0x9fe0('0x60'),_0x9fe0('0x62')+_0x3acc8d[_0x9fe0('0x63')]));}else{_0x22a177[_0x9fe0('0x5f')](new Extension(_0x1761af,0x3,'NoOp',_0x9fe0('0x64')));}_0x22a177[_0x9fe0('0x5f')](new Extension(_0x1761af,0x4,_0x9fe0('0x65'),_0x4355c9[_0x9fe0('0x4f')]+','+'${EXTEN:'+(0x8+_0x3acc8d[_0x9fe0('0x28')]['length'])+'}'+','+0x1));return _0x22a177;}function formatPrefixName(_0x276f69){var _0x107994='_';for(var _0x4514bd=0x0;_0x4514bd<_0x276f69[_0x9fe0('0x34')];_0x4514bd++){if(_0x276f69[_0x9fe0('0x66')](_0x4514bd)=='-'){_0x107994+=_0x276f69[_0x9fe0('0x66')](_0x4514bd);}else{_0x107994+='['+_0x276f69[_0x9fe0('0x66')](_0x4514bd)+']';}}_0x107994+='.';return _0x107994;}exports['update']=function(_0x3cb4b2,_0x27fd11,_0xc0516e){var _0x5d594e=_0x3cb4b2['body'];_0x5d594e[_0x9fe0('0x59')]=_0x9fe0('0x67')+_0x5d594e[_0x9fe0('0x28')]+'-';return db[_0x9fe0('0x49')][_0x9fe0('0x4a')](function(_0x15de76){return db['VoicePrefix'][_0x9fe0('0x23')](_0x5d594e,{'where':{'id':_0x5d594e['id']},'transaction':_0x15de76})[_0x9fe0('0x24')](function(){return db[_0x9fe0('0x4d')][_0x9fe0('0x25')]({'where':{'VoicePrefixId':_0x5d594e['id']},'transaction':_0x15de76})[_0x9fe0('0x24')](function(){return db['VoiceExtension'][_0x9fe0('0x47')]({'where':{'id':_0x5d594e[_0x9fe0('0x4e')]},'raw':!![]})[_0x9fe0('0x24')](function(_0x25014e){return createVoicePrefixExtensions(_0x5d594e,_0x25014e,_0x15de76);});});});})[_0x9fe0('0x24')](function(){return db[_0x9fe0('0x2b')][_0x9fe0('0x68')](_0x5d594e['id']);})[_0x9fe0('0x24')](respondWithResult(_0x27fd11,null))['catch'](handleError(_0x27fd11,null));};exports[_0x9fe0('0x69')]=function(_0x3759f8,_0x615b8e,_0x593de6){return db['VoicePrefix'][_0x9fe0('0x47')]({'where':{'id':_0x3759f8['params']['id']}})[_0x9fe0('0x24')](handleEntityNotFound(_0x615b8e,null))[_0x9fe0('0x24')](function(_0x34aacb){if(_0x34aacb){return _0x34aacb[_0x9fe0('0x69')](_0x3759f8[_0x9fe0('0x4c')][_0x9fe0('0x6a')],_[_0x9fe0('0x6b')](_0x3759f8[_0x9fe0('0x4c')],[_0x9fe0('0x6a'),'id'])||{})[_0x9fe0('0x6c')](function(_0xefd9cf){for(var _0x4b9e6e=0x0;_0x4b9e6e<_0x3759f8[_0x9fe0('0x4c')][_0x9fe0('0x6a')][_0x9fe0('0x34')];_0x4b9e6e+=0x1){socket[_0x9fe0('0x6d')](_0x9fe0('0x6e'),{'UserId':_0x3759f8[_0x9fe0('0x4c')]['ids'][_0x4b9e6e],'VoicePrefixId':_0x3759f8['params']['id']});}return _0xefd9cf;});}})[_0x9fe0('0x24')](respondWithResult(_0x615b8e,null))['catch'](handleError(_0x615b8e,null));};exports[_0x9fe0('0x6f')]=function(_0x4e27e,_0x3196bf,_0x99fcab){var _0x2a7ff8;return db[_0x9fe0('0x2b')][_0x9fe0('0x47')]({'where':{'id':_0x4e27e[_0x9fe0('0x46')]['id']}})[_0x9fe0('0x24')](handleEntityNotFound(_0x3196bf,null))[_0x9fe0('0x24')](function(_0x38b952){if(_0x38b952){return _0x38b952[_0x9fe0('0x6f')](_0x4e27e[_0x9fe0('0x2e')]['ids'])[_0x9fe0('0x24')](function(_0x477b20){if(_[_0x9fe0('0x70')](_0x4e27e[_0x9fe0('0x2e')][_0x9fe0('0x6a')])){for(var _0x25e003=0x0;_0x25e003<_0x4e27e[_0x9fe0('0x2e')][_0x9fe0('0x6a')][_0x9fe0('0x34')];_0x25e003+=0x1){socket[_0x9fe0('0x6d')](_0x9fe0('0x71'),{'UserId':_0x4e27e[_0x9fe0('0x2e')][_0x9fe0('0x6a')][_0x25e003],'VoicePrefixId':_0x4e27e[_0x9fe0('0x46')]['id']});}}else{socket['emit'](_0x9fe0('0x71'),{'UserId':_0x4e27e['query']['ids'],'VoicePrefixId':_0x4e27e[_0x9fe0('0x46')]['id']});}});}})[_0x9fe0('0x24')](respondWithStatusCode(_0x3196bf,null))[_0x9fe0('0x44')](handleError(_0x3196bf,null));};exports[_0x9fe0('0x72')]=function(_0x128d9b,_0x54a56b,_0x4ba7ea){var _0x5f3214={};var _0x7ca6c9={};var _0xe4092a;var _0x401da6;return db['VoicePrefix'][_0x9fe0('0x73')]({'where':{'id':_0x128d9b[_0x9fe0('0x46')]['id']}})[_0x9fe0('0x24')](handleEntityNotFound(_0x54a56b,null))[_0x9fe0('0x24')](function(_0x59b297){if(_0x59b297){_0xe4092a=_0x59b297;_0x7ca6c9[_0x9fe0('0x2c')]=_[_0x9fe0('0x2d')](db[_0x9fe0('0x74')][_0x9fe0('0x75')]);_0x7ca6c9[_0x9fe0('0x2e')]=_['keys'](_0x128d9b[_0x9fe0('0x2e')]);_0x7ca6c9[_0x9fe0('0x37')]=_[_0x9fe0('0x31')](_0x7ca6c9[_0x9fe0('0x2c')],_0x7ca6c9['query']);_0x5f3214[_0x9fe0('0x33')]=_['intersection'](_0x7ca6c9[_0x9fe0('0x2c')],qs['fields'](_0x128d9b['query'][_0x9fe0('0x32')]));_0x5f3214[_0x9fe0('0x33')]=_0x5f3214[_0x9fe0('0x33')][_0x9fe0('0x34')]?_0x5f3214['attributes']:_0x7ca6c9['model'];_0x5f3214[_0x9fe0('0x35')]=qs[_0x9fe0('0x36')](_0x128d9b['query']['sort']);_0x5f3214[_0x9fe0('0x3c')]=qs[_0x9fe0('0x37')](_[_0x9fe0('0x38')](_0x128d9b['query'],_0x7ca6c9[_0x9fe0('0x37')]));if(_0x128d9b[_0x9fe0('0x2e')][_0x9fe0('0x3b')]){_0x5f3214[_0x9fe0('0x3c')]=_[_0x9fe0('0x3d')](_0x5f3214[_0x9fe0('0x3c')],{'$or':_['map'](_0x5f3214['attributes'],function(_0x1d1ed9){var _0x2e980e={};_0x2e980e[_0x1d1ed9]={'$like':'%'+_0x128d9b['query'][_0x9fe0('0x3b')]+'%'};return _0x2e980e;})});}_0x5f3214=_[_0x9fe0('0x3d')]({},_0x5f3214,_0x128d9b[_0x9fe0('0x3f')]);return _0xe4092a[_0x9fe0('0x72')](_0x5f3214);}})[_0x9fe0('0x24')](function(_0x1c6968){if(_0x1c6968){_0x401da6=_0x1c6968[_0x9fe0('0x34')];if(!_0x128d9b[_0x9fe0('0x2e')][_0x9fe0('0x76')](_0x9fe0('0x77'))){_0x5f3214['limit']=qs[_0x9fe0('0x1d')](_0x128d9b['query']['limit']);_0x5f3214['offset']=qs['offset'](_0x128d9b[_0x9fe0('0x2e')][_0x9fe0('0x1c')]);}return _0xe4092a[_0x9fe0('0x72')](_0x5f3214);}})['then'](function(_0x599f42){if(_0x599f42){return _0x599f42?{'count':_0x401da6,'rows':_0x599f42}:null;}})[_0x9fe0('0x24')](respondWithResult(_0x54a56b,null))[_0x9fe0('0x44')](handleError(_0x54a56b,null));};
\ No newline at end of file
+var _0x2c46=['getAgents','findOne','User','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','socket.io-emitter','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','offset','limit','set','apply','reject','update','then','destroy','error','stack','name','send','index','VoicePrefix','model','keys','query','dateStart','dateEnd','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','add','day','merge','where','filter','map','options','count','findAll','rows','catch','params','rawAttributes','includeAll','include','find','describe','sequelize','transaction','create','get','VoiceExtensionId','from-sip','type','description','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','body','system-','addAgents','ids','omit','spread','emit','removeAgents','isArray','userVoicePrefix:remove'];(function(_0x21a773,_0x378efb){var _0x34adb3=function(_0x113cd1){while(--_0x113cd1){_0x21a773['push'](_0x21a773['shift']());}};_0x34adb3(++_0x378efb);}(_0x2c46,0x1d7));var _0x62c4=function(_0x489646,_0x2fed71){_0x489646=_0x489646-0x0;var _0x45de80=_0x2c46[_0x489646];return _0x45de80;};'use strict';var pdf=require(_0x62c4('0x0'));var emlformat=require(_0x62c4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x62c4('0x2'));var jsonpatch=require(_0x62c4('0x3'));var rp=require(_0x62c4('0x4'));var moment=require(_0x62c4('0x5'));var BPromise=require(_0x62c4('0x6'));var Mustache=require('mustache');var util=require(_0x62c4('0x7'));var path=require(_0x62c4('0x8'));var sox=require(_0x62c4('0x9'));var csv=require(_0x62c4('0xa'));var ejs=require(_0x62c4('0xb'));var fs=require('fs');var _=require(_0x62c4('0xc'));var squel=require('squel');var crypto=require(_0x62c4('0xd'));var jsforce=require(_0x62c4('0xe'));var deskjs=require(_0x62c4('0xf'));var toCsv=require(_0x62c4('0xa'));var querystring=require(_0x62c4('0x10'));var Papa=require(_0x62c4('0x11'));var qs=require(_0x62c4('0x12'));var logger=require(_0x62c4('0x13'))(_0x62c4('0x14'));var utils=require(_0x62c4('0x15'));var config=require(_0x62c4('0x16'));var db=require('../../mysqldb')['db'];var socket=require(_0x62c4('0x17'))({'host':_0x62c4('0x18'),'port':0x18eb});require(_0x62c4('0x19'))[_0x62c4('0x1a')](socket);function respondWithStatusCode(_0x5c69fd,_0x56d2b3){_0x56d2b3=_0x56d2b3||0xcc;return function(_0x4eaf9f){if(_0x4eaf9f){return _0x5c69fd[_0x62c4('0x1b')](_0x56d2b3);}return _0x5c69fd[_0x62c4('0x1c')](_0x56d2b3)[_0x62c4('0x1d')]();};}function respondWithResult(_0x2333e2,_0x43c809){_0x43c809=_0x43c809||0xc8;return function(_0x3a2ab6){if(_0x3a2ab6){return _0x2333e2['status'](_0x43c809)[_0x62c4('0x1e')](_0x3a2ab6);}};}function respondWithFilteredResult(_0x56fcc2,_0x3a8983){return function(_0x359cc0){if(_0x359cc0){var _0x5ee124=_0x359cc0['count'],_0x513a5b=_0x3a8983['offset'],_0x77f511=_0x3a8983[_0x62c4('0x1f')]+_0x3a8983[_0x62c4('0x20')],_0x383f6d;if(_0x77f511>=_0x5ee124){_0x77f511=_0x5ee124;_0x383f6d=0xc8;}else{_0x383f6d=0xce;}_0x56fcc2['status'](_0x383f6d);return _0x56fcc2[_0x62c4('0x21')]('Content-Range',_0x513a5b+'-'+_0x77f511+'/'+_0x5ee124)[_0x62c4('0x1e')](_0x359cc0);}return null;};}function patchUpdates(_0x12f811){return function(_0x1d0acc){try{jsonpatch[_0x62c4('0x22')](_0x1d0acc,_0x12f811,!![]);}catch(_0x11d26d){return BPromise[_0x62c4('0x23')](_0x11d26d);}return _0x1d0acc['save']();};}function saveUpdates(_0x5b0fc7,_0x7dfa32){return function(_0x5a5362){if(_0x5a5362){return _0x5a5362[_0x62c4('0x24')](_0x5b0fc7)[_0x62c4('0x25')](function(_0x36d019){return _0x36d019;});}return null;};}function removeEntity(_0x20dd33,_0xe2876a){return function(_0x32d3c0){if(_0x32d3c0){return _0x32d3c0[_0x62c4('0x26')]()[_0x62c4('0x25')](function(){_0x20dd33[_0x62c4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22677d,_0x3b5228){return function(_0x565ff9){if(!_0x565ff9){_0x22677d[_0x62c4('0x1b')](0x194);}return _0x565ff9;};}function handleError(_0x2abfc5,_0x156d10){_0x156d10=_0x156d10||0x1f4;return function(_0x14942c){logger[_0x62c4('0x27')](_0x14942c[_0x62c4('0x28')]);if(_0x14942c['name']){delete _0x14942c[_0x62c4('0x29')];}_0x2abfc5[_0x62c4('0x1c')](_0x156d10)[_0x62c4('0x2a')](_0x14942c);};}exports[_0x62c4('0x2b')]=function(_0x18b64a,_0x15fc1e){var _0x284825={},_0x14355e={},_0x50d3a8={'count':0x0,'rows':[]};var _0x4584de=db[_0x62c4('0x2c')]['rawAttributes'];_0x14355e[_0x62c4('0x2d')]=_[_0x62c4('0x2e')](_0x4584de);var _0x2b4654={'dateStart':_0x18b64a[_0x62c4('0x2f')][_0x62c4('0x30')],'dateEnd':_0x18b64a['query']['dateEnd']};delete _0x18b64a['query']['dateStart'];delete _0x18b64a[_0x62c4('0x2f')][_0x62c4('0x31')];_0x14355e[_0x62c4('0x2f')]=_[_0x62c4('0x2e')](_0x18b64a[_0x62c4('0x2f')]);_0x14355e[_0x62c4('0x32')]=_['intersection'](_0x14355e[_0x62c4('0x2d')],_0x14355e[_0x62c4('0x2f')]);_0x284825[_0x62c4('0x33')]=_[_0x62c4('0x34')](_0x14355e[_0x62c4('0x2d')],qs[_0x62c4('0x35')](_0x18b64a[_0x62c4('0x2f')][_0x62c4('0x35')]));_0x284825[_0x62c4('0x33')]=_0x284825['attributes'][_0x62c4('0x36')]?_0x284825['attributes']:_0x14355e['model'];if(!_0x18b64a[_0x62c4('0x2f')][_0x62c4('0x37')](_0x62c4('0x38'))){_0x284825[_0x62c4('0x20')]=qs[_0x62c4('0x20')](_0x18b64a['query']['limit']);_0x284825['offset']=qs[_0x62c4('0x1f')](_0x18b64a[_0x62c4('0x2f')][_0x62c4('0x1f')]);}_0x284825[_0x62c4('0x39')]=qs[_0x62c4('0x3a')](_0x18b64a[_0x62c4('0x2f')]['sort']);_0x284825['where']=qs['filters'](_[_0x62c4('0x3b')](_0x18b64a[_0x62c4('0x2f')],_0x14355e[_0x62c4('0x32')]));if(_0x2b4654['dateStart']){if(_0x2b4654[_0x62c4('0x31')]){_0x2b4654[_0x62c4('0x31')]=moment(_0x2b4654[_0x62c4('0x31')])[_0x62c4('0x3c')](0x1,_0x62c4('0x3d'));}else{_0x2b4654[_0x62c4('0x31')]=moment(_0x2b4654[_0x62c4('0x30')])[_0x62c4('0x3c')](0x1,'day');}_[_0x62c4('0x3e')](_0x284825[_0x62c4('0x3f')],{'createdAt':{'$gte':_0x2b4654['dateStart'],'$lte':_0x2b4654[_0x62c4('0x31')]}});}if(_0x18b64a[_0x62c4('0x2f')][_0x62c4('0x40')]){_0x284825[_0x62c4('0x3f')]=_[_0x62c4('0x3e')](_0x284825[_0x62c4('0x3f')],{'$or':_[_0x62c4('0x41')](_0x284825[_0x62c4('0x33')],function(_0x546ea6){var _0x37a181={};_0x37a181[_0x546ea6]={'$like':'%'+_0x18b64a[_0x62c4('0x2f')][_0x62c4('0x40')]+'%'};return _0x37a181;})});}_0x284825=_[_0x62c4('0x3e')]({},_0x284825,_0x18b64a[_0x62c4('0x42')]);var _0x543d84={'where':_0x284825[_0x62c4('0x3f')]};return db['VoicePrefix'][_0x62c4('0x43')](_0x543d84)[_0x62c4('0x25')](function(_0xf7a6c1){_0x50d3a8['count']=_0xf7a6c1;if(_0x18b64a[_0x62c4('0x2f')]['includeAll']){_0x284825['include']=[{'all':!![]}];}return db['VoicePrefix'][_0x62c4('0x44')](_0x284825);})[_0x62c4('0x25')](function(_0x3c1ccc){_0x50d3a8[_0x62c4('0x45')]=_0x3c1ccc;return _0x50d3a8;})[_0x62c4('0x25')](respondWithFilteredResult(_0x15fc1e,_0x284825))[_0x62c4('0x46')](handleError(_0x15fc1e,null));};exports['show']=function(_0x5a218e,_0x1ecf40){var _0x17c9de={'raw':![],'where':{'id':_0x5a218e[_0x62c4('0x47')]['id']}},_0x3c98ea={};_0x3c98ea[_0x62c4('0x2d')]=_[_0x62c4('0x2e')](db[_0x62c4('0x2c')][_0x62c4('0x48')]);_0x3c98ea[_0x62c4('0x2f')]=_['keys'](_0x5a218e[_0x62c4('0x2f')]);_0x3c98ea[_0x62c4('0x32')]=_[_0x62c4('0x34')](_0x3c98ea[_0x62c4('0x2d')],_0x3c98ea[_0x62c4('0x2f')]);_0x17c9de[_0x62c4('0x33')]=_['intersection'](_0x3c98ea[_0x62c4('0x2d')],qs[_0x62c4('0x35')](_0x5a218e[_0x62c4('0x2f')]['fields']));_0x17c9de[_0x62c4('0x33')]=_0x17c9de[_0x62c4('0x33')][_0x62c4('0x36')]?_0x17c9de['attributes']:_0x3c98ea['model'];if(_0x5a218e[_0x62c4('0x2f')][_0x62c4('0x49')]){_0x17c9de[_0x62c4('0x4a')]=[{'all':!![]}];}_0x17c9de=_[_0x62c4('0x3e')]({},_0x17c9de,_0x5a218e['options']);return db[_0x62c4('0x2c')]['find'](_0x17c9de)['then'](handleEntityNotFound(_0x1ecf40,null))[_0x62c4('0x25')](respondWithResult(_0x1ecf40,null))[_0x62c4('0x46')](handleError(_0x1ecf40,null));};exports['destroy']=function(_0x36ad08,_0x569dbc){return db[_0x62c4('0x2c')][_0x62c4('0x4b')]({'where':{'id':_0x36ad08['params']['id']}})['then'](handleEntityNotFound(_0x569dbc,null))['then'](removeEntity(_0x569dbc,null))[_0x62c4('0x46')](handleError(_0x569dbc,null));};exports['describe']=function(_0x40813e,_0x14d93a){return db[_0x62c4('0x2c')][_0x62c4('0x4c')]()[_0x62c4('0x25')](respondWithResult(_0x14d93a,null))[_0x62c4('0x46')](handleError(_0x14d93a,null));};exports['create']=function(_0x598604,_0x5e5813){var _0x5b747c;return db[_0x62c4('0x4d')][_0x62c4('0x4e')](function(_0x2f1e57){return db[_0x62c4('0x2c')][_0x62c4('0x4f')](_0x598604['body'],{'transaction':_0x2f1e57})[_0x62c4('0x25')](function(_0x13cf19){_0x5b747c=_0x13cf19[_0x62c4('0x50')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x5b747c[_0x62c4('0x51')]},'raw':!![]})[_0x62c4('0x25')](function(_0x21862f){return createVoicePrefixExtensions(_0x5b747c,_0x21862f,_0x2f1e57);});});})[_0x62c4('0x25')](function(){return _0x5b747c;})[_0x62c4('0x25')](respondWithResult(_0x5e5813,null))[_0x62c4('0x46')](handleError(_0x5e5813,null));};function Extension(_0x35a991,_0x11d07d,_0x48b45e,_0x6369e5){this['context']=_0x62c4('0x52');this['exten']=_0x35a991;this['app']=_0x48b45e;this[_0x62c4('0x53')]='system';this[_0x62c4('0x54')]='Voice\x20Prefix\x20Extension';this[_0x62c4('0x55')]=_0x11d07d;this[_0x62c4('0x56')]=_0x6369e5;}function createVoicePrefixExtensions(_0x1fb28a,_0x5f3e13,_0x199a7d){return new BPromise(function(_0x496e21,_0x39b68a){var _0x2eccfd=new Extension(formatPrefixName(_0x1fb28a['prefix']),0x1,_0x62c4('0x57'),_0x62c4('0x58'));_0x2eccfd[_0x62c4('0x59')]=_0x1fb28a['id'];return db[_0x62c4('0x5a')][_0x62c4('0x4f')](_0x2eccfd,{'transaction':_0x199a7d})['then'](function(_0x2c8590){var _0x2c4bff=_0x2c8590[_0x62c4('0x50')]({'plain':!![]});var _0x4893e0=_[_0x62c4('0x41')](addVoicePrefixExtensions(_0x1fb28a,_0x5f3e13),function(_0x45d9ce){_0x45d9ce[_0x62c4('0x51')]=_0x2c4bff['id'];_0x45d9ce[_0x62c4('0x59')]=_0x1fb28a['id'];return _0x45d9ce;});return db[_0x62c4('0x5a')][_0x62c4('0x5b')](_0x4893e0,{'transaction':_0x199a7d})['then'](function(_0x299d95){if(!_0x299d95){return _0x39b68a(_0x62c4('0x5c'));}else{return _0x496e21(_0x299d95);}})[_0x62c4('0x46')](function(_0x169364){return _0x39b68a(_0x169364);});});;});};function addVoicePrefixExtensions(_0x25c304,_0x59587e){var _0x35def1=[];var _0x543a68=formatPrefixName(_0x25c304[_0x62c4('0x5d')]);_0x35def1[_0x62c4('0x5e')](new Extension(_0x543a68,0x2,_0x62c4('0x5f'),_0x62c4('0x60')+_0x25c304[_0x62c4('0x29')]));if(_0x25c304[_0x62c4('0x61')]){_0x35def1[_0x62c4('0x5e')](new Extension(_0x543a68,0x3,_0x62c4('0x5f'),_0x62c4('0x62')+_0x25c304[_0x62c4('0x61')]));}else{_0x35def1[_0x62c4('0x5e')](new Extension(_0x543a68,0x3,'NoOp',_0x62c4('0x63')));}_0x35def1[_0x62c4('0x5e')](new Extension(_0x543a68,0x4,_0x62c4('0x64'),_0x59587e[_0x62c4('0x65')]+','+_0x62c4('0x66')+(0x8+_0x25c304[_0x62c4('0x29')][_0x62c4('0x36')])+'}'+','+0x1));return _0x35def1;}function formatPrefixName(_0x153ca9){var _0x5259a0='_';for(var _0x121719=0x0;_0x121719<_0x153ca9[_0x62c4('0x36')];_0x121719++){if(_0x153ca9[_0x62c4('0x67')](_0x121719)=='-'){_0x5259a0+=_0x153ca9[_0x62c4('0x67')](_0x121719);}else{_0x5259a0+='['+_0x153ca9[_0x62c4('0x67')](_0x121719)+']';}}_0x5259a0+='.';return _0x5259a0;}exports[_0x62c4('0x24')]=function(_0x41df32,_0x2b607c,_0x467d90){var _0x48777d=_0x41df32[_0x62c4('0x68')];_0x48777d[_0x62c4('0x5d')]=_0x62c4('0x69')+_0x48777d['name']+'-';return db['sequelize']['transaction'](function(_0x33db88){return db[_0x62c4('0x2c')][_0x62c4('0x24')](_0x48777d,{'where':{'id':_0x48777d['id']},'transaction':_0x33db88})[_0x62c4('0x25')](function(){return db[_0x62c4('0x5a')]['destroy']({'where':{'VoicePrefixId':_0x48777d['id']},'transaction':_0x33db88})[_0x62c4('0x25')](function(){return db[_0x62c4('0x5a')]['find']({'where':{'id':_0x48777d[_0x62c4('0x51')]},'raw':!![]})['then'](function(_0x5daf2f){return createVoicePrefixExtensions(_0x48777d,_0x5daf2f,_0x33db88);});});});})[_0x62c4('0x25')](function(){return db[_0x62c4('0x2c')]['findById'](_0x48777d['id']);})['then'](respondWithResult(_0x2b607c,null))['catch'](handleError(_0x2b607c,null));};exports[_0x62c4('0x6a')]=function(_0x230442,_0x38e4ca,_0x3dff86){return db[_0x62c4('0x2c')][_0x62c4('0x4b')]({'where':{'id':_0x230442[_0x62c4('0x47')]['id']}})[_0x62c4('0x25')](handleEntityNotFound(_0x38e4ca,null))[_0x62c4('0x25')](function(_0x46ccb7){if(_0x46ccb7){return _0x46ccb7[_0x62c4('0x6a')](_0x230442['body'][_0x62c4('0x6b')],_[_0x62c4('0x6c')](_0x230442[_0x62c4('0x68')],[_0x62c4('0x6b'),'id'])||{})[_0x62c4('0x6d')](function(_0x32596f){for(var _0x402700=0x0;_0x402700<_0x230442[_0x62c4('0x68')]['ids']['length'];_0x402700+=0x1){socket[_0x62c4('0x6e')]('userVoicePrefix:save',{'UserId':_0x230442[_0x62c4('0x68')][_0x62c4('0x6b')][_0x402700],'VoicePrefixId':_0x230442[_0x62c4('0x47')]['id']});}return _0x32596f;});}})[_0x62c4('0x25')](respondWithResult(_0x38e4ca,null))[_0x62c4('0x46')](handleError(_0x38e4ca,null));};exports[_0x62c4('0x6f')]=function(_0x4b77ac,_0x8fd612,_0x3740a2){var _0x2de3c0;return db[_0x62c4('0x2c')]['find']({'where':{'id':_0x4b77ac[_0x62c4('0x47')]['id']}})[_0x62c4('0x25')](handleEntityNotFound(_0x8fd612,null))['then'](function(_0x220435){if(_0x220435){return _0x220435[_0x62c4('0x6f')](_0x4b77ac['query']['ids'])[_0x62c4('0x25')](function(_0x123cfe){if(_[_0x62c4('0x70')](_0x4b77ac[_0x62c4('0x2f')][_0x62c4('0x6b')])){for(var _0x917224=0x0;_0x917224<_0x4b77ac[_0x62c4('0x2f')]['ids']['length'];_0x917224+=0x1){socket[_0x62c4('0x6e')]('userVoicePrefix:remove',{'UserId':_0x4b77ac['query']['ids'][_0x917224],'VoicePrefixId':_0x4b77ac['params']['id']});}}else{socket[_0x62c4('0x6e')](_0x62c4('0x71'),{'UserId':_0x4b77ac[_0x62c4('0x2f')][_0x62c4('0x6b')],'VoicePrefixId':_0x4b77ac[_0x62c4('0x47')]['id']});}});}})['then'](respondWithStatusCode(_0x8fd612,null))[_0x62c4('0x46')](handleError(_0x8fd612,null));};exports[_0x62c4('0x72')]=function(_0x31310c,_0x578e55,_0x3b6336){var _0x43ae38={};var _0x42fc16={};var _0xc395a6;var _0x55b6f0;return db[_0x62c4('0x2c')][_0x62c4('0x73')]({'where':{'id':_0x31310c[_0x62c4('0x47')]['id']}})[_0x62c4('0x25')](handleEntityNotFound(_0x578e55,null))[_0x62c4('0x25')](function(_0x3ee30b){if(_0x3ee30b){_0xc395a6=_0x3ee30b;_0x42fc16[_0x62c4('0x2d')]=_[_0x62c4('0x2e')](db[_0x62c4('0x74')][_0x62c4('0x48')]);_0x42fc16[_0x62c4('0x2f')]=_[_0x62c4('0x2e')](_0x31310c['query']);_0x42fc16['filters']=_[_0x62c4('0x34')](_0x42fc16['model'],_0x42fc16['query']);_0x43ae38[_0x62c4('0x33')]=_[_0x62c4('0x34')](_0x42fc16['model'],qs['fields'](_0x31310c['query']['fields']));_0x43ae38[_0x62c4('0x33')]=_0x43ae38[_0x62c4('0x33')]['length']?_0x43ae38[_0x62c4('0x33')]:_0x42fc16[_0x62c4('0x2d')];_0x43ae38[_0x62c4('0x39')]=qs['sort'](_0x31310c[_0x62c4('0x2f')][_0x62c4('0x3a')]);_0x43ae38['where']=qs['filters'](_[_0x62c4('0x3b')](_0x31310c['query'],_0x42fc16[_0x62c4('0x32')]));if(_0x31310c[_0x62c4('0x2f')][_0x62c4('0x40')]){_0x43ae38[_0x62c4('0x3f')]=_[_0x62c4('0x3e')](_0x43ae38[_0x62c4('0x3f')],{'$or':_[_0x62c4('0x41')](_0x43ae38[_0x62c4('0x33')],function(_0x5e0fc3){var _0x3832d5={};_0x3832d5[_0x5e0fc3]={'$like':'%'+_0x31310c[_0x62c4('0x2f')][_0x62c4('0x40')]+'%'};return _0x3832d5;})});}_0x43ae38=_[_0x62c4('0x3e')]({},_0x43ae38,_0x31310c[_0x62c4('0x42')]);return _0xc395a6[_0x62c4('0x72')](_0x43ae38);}})[_0x62c4('0x25')](function(_0x167387){if(_0x167387){_0x55b6f0=_0x167387[_0x62c4('0x36')];if(!_0x31310c[_0x62c4('0x2f')][_0x62c4('0x37')](_0x62c4('0x38'))){_0x43ae38['limit']=qs[_0x62c4('0x20')](_0x31310c['query']['limit']);_0x43ae38[_0x62c4('0x1f')]=qs[_0x62c4('0x1f')](_0x31310c[_0x62c4('0x2f')]['offset']);}return _0xc395a6[_0x62c4('0x72')](_0x43ae38);}})[_0x62c4('0x25')](function(_0x1a2b25){if(_0x1a2b25){return _0x1a2b25?{'count':_0x55b6f0,'rows':_0x1a2b25}:null;}})[_0x62c4('0x25')](respondWithResult(_0x578e55,null))[_0x62c4('0x46')](handleError(_0x578e55,null));};
\ No newline at end of file
index d4f6458..2f04162 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5089=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x3766a2,_0x165182){var _0x2a714f=function(_0x3a6117){while(--_0x3a6117){_0x3766a2['push'](_0x3766a2['shift']());}};_0x2a714f(++_0x165182);}(_0x5089,0x1bb));var _0x9508=function(_0x5af812,_0x43d252){_0x5af812=_0x5af812-0x0;var _0x1489f2=_0x5089[_0x5af812];return _0x1489f2;};'use strict';var EventEmitter=require(_0x9508('0x0'));var VoicePrefix=require(_0x9508('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x9508('0x2')](0x0);var events={'afterCreate':_0x9508('0x3'),'afterUpdate':_0x9508('0x4'),'afterDestroy':_0x9508('0x5')};function emitEvent(_0x172549){return function(_0x59d3ee,_0x86540d,_0x5e80fa){VoicePrefixEvents[_0x9508('0x6')](_0x172549+':'+_0x59d3ee['id'],_0x59d3ee);VoicePrefixEvents[_0x9508('0x6')](_0x172549,_0x59d3ee);_0x5e80fa(null);};}for(var e in events){if(events[_0x9508('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x9508('0x8')]=VoicePrefixEvents;
\ No newline at end of file
+var _0xc3b5=['setMaxListeners','save','update','remove','emit','hook','exports','VoicePrefix'];(function(_0x17d1c0,_0x15edf8){var _0x5e078c=function(_0x5e8ff9){while(--_0x5e8ff9){_0x17d1c0['push'](_0x17d1c0['shift']());}};_0x5e078c(++_0x15edf8);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x3bdea4,_0x15753b){_0x3bdea4=_0x3bdea4-0x0;var _0x2f03af=_0xc3b5[_0x3bdea4];return _0x2f03af;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0x5c3b('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x5c3b('0x1')](0x0);var events={'afterCreate':_0x5c3b('0x2'),'afterUpdate':_0x5c3b('0x3'),'afterDestroy':_0x5c3b('0x4')};function emitEvent(_0x34be81){return function(_0x237a61,_0x48f8a1,_0x587055){VoicePrefixEvents[_0x5c3b('0x5')](_0x34be81+':'+_0x237a61['id'],_0x237a61);VoicePrefixEvents[_0x5c3b('0x5')](_0x34be81,_0x237a61);_0x587055(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x5c3b('0x6')](e,emitEvent(event));}}module[_0x5c3b('0x7')]=VoicePrefixEvents;
\ No newline at end of file
index 01fc75e..94a75f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f19=['VoicePrefix','voice_prefixes','util','api','bluebird','request-promise','./voicePrefix.attributes','exports','define'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3f19,0x1f1));var _0x93f1=function(_0x335e24,_0x3fbd76){_0x335e24=_0x335e24-0x0;var _0x3e3b08=_0x3f19[_0x335e24];return _0x3e3b08;};'use strict';var _=require('lodash');var util=require(_0x93f1('0x0'));var logger=require('../../config/logger')(_0x93f1('0x1'));var moment=require('moment');var BPromise=require(_0x93f1('0x2'));var rp=require(_0x93f1('0x3'));var attributes=require(_0x93f1('0x4'));module[_0x93f1('0x5')]=function(_0x2e707f,_0x1cb8b3){return _0x2e707f[_0x93f1('0x6')](_0x93f1('0x7'),attributes,{'tableName':_0x93f1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbb91=['bluebird','request-promise','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','moment'];(function(_0x17e09f,_0x1e12be){var _0x4ac806=function(_0x2684f5){while(--_0x2684f5){_0x17e09f['push'](_0x17e09f['shift']());}};_0x4ac806(++_0x1e12be);}(_0xbb91,0xce));var _0x1bb9=function(_0x1f0724,_0x3a58bf){_0x1f0724=_0x1f0724-0x0;var _0x253ffb=_0xbb91[_0x1f0724];return _0x253ffb;};'use strict';var _=require(_0x1bb9('0x0'));var util=require(_0x1bb9('0x1'));var logger=require(_0x1bb9('0x2'))('api');var moment=require(_0x1bb9('0x3'));var BPromise=require(_0x1bb9('0x4'));var rp=require(_0x1bb9('0x5'));var attributes=require(_0x1bb9('0x6'));module[_0x1bb9('0x7')]=function(_0x3699f8,_0x256ff5){return _0x3699f8['define'](_0x1bb9('0x8'),attributes,{'tableName':_0x1bb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1ddbaa9..46ab054 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde8f=['../../config/environment','http','localhost','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x2da8a2,_0x30cb59){var _0x30bc49=function(_0x15ddee){while(--_0x15ddee){_0x2da8a2['push'](_0x2da8a2['shift']());}};_0x30bc49(++_0x30cb59);}(_0xde8f,0xfd));var _0xfde8=function(_0x25def4,_0x4a4c7d){_0x25def4=_0x25def4-0x0;var _0x3bc600=_0xde8f[_0x25def4];return _0x3bc600;};'use strict';var _=require(_0xfde8('0x0'));var util=require(_0xfde8('0x1'));var moment=require(_0xfde8('0x2'));var BPromise=require(_0xfde8('0x3'));var rs=require(_0xfde8('0x4'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfde8('0x5'))(_0xfde8('0x6'));var config=require(_0xfde8('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfde8('0x8')]({'port':0x232a});var socket=require('socket.io-emitter')({'host':_0xfde8('0x9'),'port':0x18eb});require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x112424,_0x5e1a89,_0x2bb0b2){return new BPromise(function(_0x5b563c,_0x1f34c8){return client['request'](_0x112424,_0x2bb0b2)[_0xfde8('0xa')](function(_0x949689){logger[_0xfde8('0xb')](_0xfde8('0xc'),_0x5e1a89,_0xfde8('0xd'));logger['debug'](_0xfde8('0xe'),_0x5e1a89,_0xfde8('0xd'),JSON[_0xfde8('0xf')](_0x949689));if(_0x949689[_0xfde8('0x10')]){if(_0x949689[_0xfde8('0x10')][_0xfde8('0x11')]===0x1f4){logger[_0xfde8('0x10')]('VoicePrefix,\x20%s,\x20%s',_0x5e1a89,_0x949689[_0xfde8('0x10')]['message']);return _0x1f34c8(_0x949689['error'][_0xfde8('0x12')]);}logger[_0xfde8('0x10')]('VoicePrefix,\x20%s,\x20%s',_0x5e1a89,_0x949689[_0xfde8('0x10')][_0xfde8('0x12')]);return _0x5b563c(_0x949689[_0xfde8('0x10')]['message']);}else{logger[_0xfde8('0xb')](_0xfde8('0xc'),_0x5e1a89,_0xfde8('0xd'));_0x5b563c(_0x949689['result'][_0xfde8('0x12')]);}})[_0xfde8('0x13')](function(_0x3b66b0){logger['error'](_0xfde8('0xc'),_0x5e1a89,_0x3b66b0);_0x1f34c8(_0x3b66b0);});});}
\ No newline at end of file
+var _0x1c71=['info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','localhost','./voicePrefix.socket','register','request'];(function(_0xf41a1c,_0x3dcf8b){var _0x2f82b6=function(_0x7f98bb){while(--_0x7f98bb){_0xf41a1c['push'](_0xf41a1c['shift']());}};_0x2f82b6(++_0x3dcf8b);}(_0x1c71,0x110));var _0x11c7=function(_0x19d06f,_0xd1bacb){_0x19d06f=_0x19d06f-0x0;var _0x3803ac=_0x1c71[_0x19d06f];return _0x3803ac;};'use strict';var _=require(_0x11c7('0x0'));var util=require(_0x11c7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x11c7('0x2'));var fs=require('fs');var db=require(_0x11c7('0x3'))['db'];var utils=require(_0x11c7('0x4'));var logger=require(_0x11c7('0x5'))(_0x11c7('0x6'));var config=require(_0x11c7('0x7'));var jayson=require(_0x11c7('0x8'));var client=jayson['client'][_0x11c7('0x9')]({'port':0x232a});var socket=require('socket.io-emitter')({'host':_0x11c7('0xa'),'port':0x18eb});require(_0x11c7('0xb'))[_0x11c7('0xc')](socket);function respondWithRpcPromise(_0x1fddb4,_0x1e2997,_0xf1e7){return new BPromise(function(_0xbf8e2,_0x48cd34){return client[_0x11c7('0xd')](_0x1fddb4,_0xf1e7)['then'](function(_0x35340d){logger[_0x11c7('0xe')](_0x11c7('0xf'),_0x1e2997,_0x11c7('0x10'));logger[_0x11c7('0x11')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x1e2997,'request\x20sent',JSON[_0x11c7('0x12')](_0x35340d));if(_0x35340d[_0x11c7('0x13')]){if(_0x35340d[_0x11c7('0x13')][_0x11c7('0x14')]===0x1f4){logger[_0x11c7('0x13')](_0x11c7('0xf'),_0x1e2997,_0x35340d[_0x11c7('0x13')][_0x11c7('0x15')]);return _0x48cd34(_0x35340d['error']['message']);}logger[_0x11c7('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x1e2997,_0x35340d[_0x11c7('0x13')][_0x11c7('0x15')]);return _0xbf8e2(_0x35340d[_0x11c7('0x13')]['message']);}else{logger[_0x11c7('0xe')]('VoicePrefix,\x20%s,\x20%s',_0x1e2997,_0x11c7('0x10'));_0xbf8e2(_0x35340d['result'][_0x11c7('0x15')]);}})['catch'](function(_0x558ef9){logger[_0x11c7('0x13')](_0x11c7('0xf'),_0x1e2997,_0x558ef9);_0x48cd34(_0x558ef9);});});}
\ No newline at end of file
index cc78424..106578b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf592=['removeListener','register','length','voicePrefix:','save','remove'];(function(_0x18e00c,_0x2c59b0){var _0x2ce0a7=function(_0x272a35){while(--_0x272a35){_0x18e00c['push'](_0x18e00c['shift']());}};_0x2ce0a7(++_0x2c59b0);}(_0xf592,0x100));var _0x2f59=function(_0x16da6d,_0x55955b){_0x16da6d=_0x16da6d-0x0;var _0x497998=_0xf592[_0x16da6d];return _0x497998;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x2f59('0x0'),_0x2f59('0x1'),'update'];function createListener(_0x59638b,_0x3fd7d2){return function(_0x46f1af){_0x3fd7d2['emit'](_0x59638b,_0x46f1af);};}function removeListener(_0x3256e2,_0x1e6747){return function(){VoicePrefixEvents[_0x2f59('0x2')](_0x3256e2,_0x1e6747);};}exports[_0x2f59('0x3')]=function(_0x36a18f){for(var _0x4dac99=0x0,_0x1eedba=events[_0x2f59('0x4')];_0x4dac99<_0x1eedba;_0x4dac99++){var _0x3112c6=events[_0x4dac99];var _0xf6f162=createListener(_0x2f59('0x5')+_0x3112c6,_0x36a18f);VoicePrefixEvents['on'](_0x3112c6,_0xf6f162);}};
\ No newline at end of file
+var _0x3388=['update','emit','removeListener','register','length','voicePrefix:','save','remove'];(function(_0x12e2d9,_0x27675b){var _0x5942ce=function(_0x944aa0){while(--_0x944aa0){_0x12e2d9['push'](_0x12e2d9['shift']());}};_0x5942ce(++_0x27675b);}(_0x3388,0x1de));var _0x8338=function(_0x532799,_0x431878){_0x532799=_0x532799-0x0;var _0x3f9c22=_0x3388[_0x532799];return _0x3f9c22;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x8338('0x0'),_0x8338('0x1'),_0x8338('0x2')];function createListener(_0x1d0b81,_0x4379da){return function(_0x5b2896){_0x4379da[_0x8338('0x3')](_0x1d0b81,_0x5b2896);};}function removeListener(_0x18ef41,_0x52d09a){return function(){VoicePrefixEvents[_0x8338('0x4')](_0x18ef41,_0x52d09a);};}exports[_0x8338('0x5')]=function(_0x2ec68f){for(var _0x2c44a9=0x0,_0x1d90b8=events[_0x8338('0x6')];_0x2c44a9<_0x1d90b8;_0x2c44a9++){var _0x56be51=events[_0x2c44a9];var _0x35009a=createListener(_0x8338('0x7')+_0x56be51,_0x2ec68f);VoicePrefixEvents['on'](_0x56be51,_0x35009a);}};
\ No newline at end of file
index 68b97b7..551cedb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0404=['addLists','addBlackLists','put','update','destroy','removeTeams','removeAgents','delete','removeLists','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','getHoppers','getHopperHistories','getHopperFinals','/:id/hopper_black','/:id/teams','getAgents','getMembers','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','/:id/users','addAgents','/:id/lists'];(function(_0x133b6f,_0x73a35b){var _0xd30746=function(_0xec5346){while(--_0xec5346){_0x133b6f['push'](_0x133b6f['shift']());}};_0xd30746(++_0x73a35b);}(_0x0404,0xf4));var _0x4040=function(_0x2defb5,_0x1cda14){_0x2defb5=_0x2defb5-0x0;var _0x229c53=_0x0404[_0x2defb5];return _0x229c53;};'use strict';var multer=require('multer');var util=require(_0x4040('0x0'));var path=require(_0x4040('0x1'));var express=require(_0x4040('0x2'));var router=express[_0x4040('0x3')]();var auth=require(_0x4040('0x4'));var interaction=require(_0x4040('0x5'));var config=require('../../config/environment');var controller=require(_0x4040('0x6'));router[_0x4040('0x7')]('/',auth[_0x4040('0x8')](),controller[_0x4040('0x9')]);router['get'](_0x4040('0xa'),auth['isAuthenticated'](),controller[_0x4040('0xb')]);router['get']('/:id/hoppers',auth[_0x4040('0x8')](),controller[_0x4040('0xc')]);router[_0x4040('0x7')]('/:id/hopper_histories',auth[_0x4040('0x8')](),controller[_0x4040('0xd')]);router[_0x4040('0x7')]('/:id/hopper_finals',auth[_0x4040('0x8')](),controller[_0x4040('0xe')]);router['get'](_0x4040('0xf'),auth[_0x4040('0x8')](),controller['getHopperBlacks']);router[_0x4040('0x7')](_0x4040('0x10'),auth[_0x4040('0x8')](),controller['getTeams']);router[_0x4040('0x7')]('/:id/users',auth[_0x4040('0x8')](),controller[_0x4040('0x11')]);router[_0x4040('0x7')]('/:id/members',auth[_0x4040('0x8')](),controller[_0x4040('0x12')]);router['get']('/:id/lists',auth['isAuthenticated'](),controller[_0x4040('0x13')]);router[_0x4040('0x7')](_0x4040('0x14'),auth[_0x4040('0x8')](),controller[_0x4040('0x15')]);router[_0x4040('0x16')]('/',auth[_0x4040('0x8')](),controller[_0x4040('0x17')]);router[_0x4040('0x16')](_0x4040('0x18'),auth[_0x4040('0x8')](),controller['clone']);router['post'](_0x4040('0x10'),auth[_0x4040('0x8')](),controller[_0x4040('0x19')]);router['post'](_0x4040('0x1a'),auth[_0x4040('0x8')](),controller[_0x4040('0x1b')]);router[_0x4040('0x16')](_0x4040('0x1c'),auth[_0x4040('0x8')](),controller[_0x4040('0x1d')]);router[_0x4040('0x16')](_0x4040('0x14'),auth[_0x4040('0x8')](),controller[_0x4040('0x1e')]);router[_0x4040('0x1f')](_0x4040('0xa'),auth['isAuthenticated'](),controller[_0x4040('0x20')]);router['delete'](_0x4040('0xa'),auth['isAuthenticated'](),controller[_0x4040('0x21')]);router['delete'](_0x4040('0x10'),auth[_0x4040('0x8')](),controller[_0x4040('0x22')]);router['delete'](_0x4040('0x1a'),auth[_0x4040('0x8')](),controller[_0x4040('0x23')]);router[_0x4040('0x24')](_0x4040('0x1c'),auth[_0x4040('0x8')](),controller[_0x4040('0x25')]);router[_0x4040('0x24')](_0x4040('0x14'),auth[_0x4040('0x8')](),controller['removeBlackLists']);module[_0x4040('0x26')]=router;
\ No newline at end of file
+var _0xcd70=['delete','destroy','removeAgents','exports','util','path','express','../../components/auth/service','../../components/interaction/service','./voiceQueue.controller','get','index','/:id','isAuthenticated','show','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','addTeams','addAgents','/:id/lists','addLists','update'];(function(_0x2eb5a4,_0x46b517){var _0x1e6cf8=function(_0xf8bfdc){while(--_0xf8bfdc){_0x2eb5a4['push'](_0x2eb5a4['shift']());}};_0x1e6cf8(++_0x46b517);}(_0xcd70,0xb8));var _0x0cd7=function(_0x545ddc,_0x2a253a){_0x545ddc=_0x545ddc-0x0;var _0x20661a=_0xcd70[_0x545ddc];return _0x20661a;};'use strict';var multer=require('multer');var util=require(_0x0cd7('0x0'));var path=require(_0x0cd7('0x1'));var express=require(_0x0cd7('0x2'));var router=express['Router']();var auth=require(_0x0cd7('0x3'));var interaction=require(_0x0cd7('0x4'));var config=require('../../config/environment');var controller=require(_0x0cd7('0x5'));router[_0x0cd7('0x6')]('/',auth['isAuthenticated'](),controller[_0x0cd7('0x7')]);router['get'](_0x0cd7('0x8'),auth[_0x0cd7('0x9')](),controller[_0x0cd7('0xa')]);router['get']('/:id/hoppers',auth[_0x0cd7('0x9')](),controller['getHoppers']);router['get'](_0x0cd7('0xb'),auth[_0x0cd7('0x9')](),controller[_0x0cd7('0xc')]);router[_0x0cd7('0x6')](_0x0cd7('0xd'),auth['isAuthenticated'](),controller[_0x0cd7('0xe')]);router[_0x0cd7('0x6')](_0x0cd7('0xf'),auth[_0x0cd7('0x9')](),controller[_0x0cd7('0x10')]);router[_0x0cd7('0x6')](_0x0cd7('0x11'),auth[_0x0cd7('0x9')](),controller['getTeams']);router[_0x0cd7('0x6')](_0x0cd7('0x12'),auth['isAuthenticated'](),controller[_0x0cd7('0x13')]);router[_0x0cd7('0x6')](_0x0cd7('0x14'),auth[_0x0cd7('0x9')](),controller[_0x0cd7('0x15')]);router[_0x0cd7('0x6')]('/:id/lists',auth['isAuthenticated'](),controller[_0x0cd7('0x16')]);router['get'](_0x0cd7('0x17'),auth['isAuthenticated'](),controller[_0x0cd7('0x18')]);router[_0x0cd7('0x19')]('/',auth[_0x0cd7('0x9')](),controller['create']);router[_0x0cd7('0x19')](_0x0cd7('0x1a'),auth[_0x0cd7('0x9')](),controller['clone']);router[_0x0cd7('0x19')](_0x0cd7('0x11'),auth[_0x0cd7('0x9')](),controller[_0x0cd7('0x1b')]);router['post']('/:id/users',auth[_0x0cd7('0x9')](),controller[_0x0cd7('0x1c')]);router[_0x0cd7('0x19')](_0x0cd7('0x1d'),auth[_0x0cd7('0x9')](),controller[_0x0cd7('0x1e')]);router[_0x0cd7('0x19')]('/:id/blacklists',auth[_0x0cd7('0x9')](),controller['addBlackLists']);router['put'](_0x0cd7('0x8'),auth[_0x0cd7('0x9')](),controller[_0x0cd7('0x1f')]);router[_0x0cd7('0x20')](_0x0cd7('0x8'),auth[_0x0cd7('0x9')](),controller[_0x0cd7('0x21')]);router['delete']('/:id/teams',auth[_0x0cd7('0x9')](),controller['removeTeams']);router[_0x0cd7('0x20')](_0x0cd7('0x12'),auth['isAuthenticated'](),controller[_0x0cd7('0x22')]);router[_0x0cd7('0x20')]('/:id/lists',auth[_0x0cd7('0x9')](),controller['removeLists']);router[_0x0cd7('0x20')](_0x0cd7('0x17'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x0cd7('0x23')]=router;
\ No newline at end of file
index 5573849..ae14189 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','STRING','name','ENUM','outbound','inbound','default','leastrecent','fewestcalls','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','dialMethod','booked','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','split','join','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length'];(function(_0x489a7b,_0x2a4b87){var _0x245dfe=function(_0x41d1be){while(--_0x41d1be){_0x489a7b['push'](_0x489a7b['shift']());}};_0x245dfe(++_0x2a4b87);}(_0xb10b,0x12a));var _0xbb10=function(_0x385567,_0x40550f){_0x385567=_0x385567-0x0;var _0x49cf95=_0xb10b[_0x385567];return _0x49cf95;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xbb10('0x3')]('inbound',_0xbb10('0x4')),'allowNull':![],'defaultValue':_0xbb10('0x5')},'musiconhold':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':_0xbb10('0x6')},'announce':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0xbb10('0x3')]('rr','ringall',_0xbb10('0x7'),_0xbb10('0x8'),'random',_0xbb10('0x9'),_0xbb10('0xa'),_0xbb10('0xb'),_0xbb10('0xc')),'allowNull':![],'defaultValue':_0xbb10('0xd'),'set':function(_0x1ce33e){this[_0xbb10('0xe')](_0xbb10('0xf'),_0x1ce33e?_0x1ce33e:'rrmemory');},'get':function(){var _0x4e47f8=this[_0xbb10('0x10')](_0xbb10('0x11'));var _0xce64f3=this['getDataValue'](_0xbb10('0x12'));var _0x5be7e0=this[_0xbb10('0x10')](_0xbb10('0xf'));if(_0x4e47f8===_0xbb10('0x5')){return _0x5be7e0;}if(_0xce64f3===_0xbb10('0x13')&&_0x5be7e0===_0xbb10('0x9')||_0xce64f3===_0xbb10('0x13')&&_0x5be7e0==='roundrobin'){return _0x5be7e0;}if(_0xce64f3===_0xbb10('0x14')||_0xce64f3===_0xbb10('0x15')||_0xce64f3===_0xbb10('0x16')){return _0x5be7e0;}return null;}},'servicelevel':{'type':Sequelize[_0xbb10('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xbb10('0x17')](0xb)},'timeout':{'type':Sequelize[_0xbb10('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xbb10('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xbb10('0x1')]},'weight':{'type':Sequelize[_0xbb10('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x18'),'no'),'defaultValue':_0xbb10('0x18')},'autopause':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x18'),'no',_0xbb10('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xbb10('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xbb10('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xbb10('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xbb10('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xbb10('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x18'),'no'),'defaultValue':_0xbb10('0x18')},'announce_holdtime':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x18'),'no',_0xbb10('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xbb10('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xbb10('0x1')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xbb10('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0xbb10('0x1')]},'queue_quantity2':{'type':Sequelize[_0xbb10('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0xbb10('0x1')]},'queue_less_than':{'type':Sequelize[_0xbb10('0x1')]},'periodic_announce':{'type':Sequelize[_0xbb10('0x1b')],'set':function(_0x2ff4c1){this['setDataValue'](_0xbb10('0x1c'),_0x2ff4c1?_0x2ff4c1['join'](','):[]);},'get':function(){return this[_0xbb10('0x10')]('periodic_announce')?this[_0xbb10('0x10')](_0xbb10('0x1c'))[_0xbb10('0x1d')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':'yes','set':function(_0x4c3744){this[_0xbb10('0xe')]('joinempty',_0x4c3744?_0x4c3744[_0xbb10('0x1e')](','):[]);},'get':function(){return this[_0xbb10('0x10')](_0xbb10('0x1f'))?this[_0xbb10('0x10')](_0xbb10('0x1f'))[_0xbb10('0x1d')](','):[];}},'leavewhenempty':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':'no','set':function(_0x4975f5){this[_0xbb10('0xe')](_0xbb10('0x20'),_0x4975f5?_0x4975f5[_0xbb10('0x1e')](','):[]);},'get':function(){return this[_0xbb10('0x10')](_0xbb10('0x20'))?this[_0xbb10('0x10')](_0xbb10('0x20'))[_0xbb10('0x1d')](','):[];}},'reportholdtime':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xbb10('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xbb10('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x3eb3cc){this[_0xbb10('0xe')](_0xbb10('0x21'),_0x3eb3cc);if(_0x3eb3cc){if(this[_0xbb10('0x10')](_0xbb10('0x22'))<0x2){this[_0xbb10('0xe')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xbb10('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xbb10('0x23')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM']('preview',_0xbb10('0x14'),_0xbb10('0x16'),_0xbb10('0x15'),'booked'),'defaultValue':_0xbb10('0x14'),'comment':_0xbb10('0x24')},'dialLimitChannel':{'type':Sequelize[_0xbb10('0x17')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xbb10('0x25')},'dialLimitQueue':{'type':Sequelize[_0xbb10('0x17')](0x4)[_0xbb10('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xbb10('0x27')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xbb10('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xbb10('0x28')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xbb10('0x29'),_0xbb10('0x2a')),'defaultValue':_0xbb10('0x2a'),'comment':_0xbb10('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xbb10('0x2c')](0x2)[_0xbb10('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0xbb10('0x17')](0x3)[_0xbb10('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xbb10('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0xbb10('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xbb10('0x17')](0x3)[_0xbb10('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbb10('0x2e')},'dialQueueOptions':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':'tTxX','comment':_0xbb10('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0xbb10('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0xbb10('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xbb10('0x17')](0x3)[_0xbb10('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xbb10('0x17')](0x5)[_0xbb10('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbb10('0x30')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbb10('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbb10('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0xbb10('0x17')](0x5)[_0xbb10('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbb10('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xbb10('0x17')](0x3)[_0xbb10('0x26')],'defaultValue':0x3,'comment':_0xbb10('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xbb10('0x17')](0x5)[_0xbb10('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbb10('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0xbb10('0x17')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xbb10('0x35')},'dialTimezone':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0x36')},'dialPrefix':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x37'),_0xbb10('0x38'),_0xbb10('0x39')),'defaultValue':_0xbb10('0x37')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xbb10('0x17')](0x9)[_0xbb10('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xbb10('0x3a')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xbb10('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xbb10('0x17')](0x9)[_0xbb10('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xbb10('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xbb10('0x17')](0x9)[_0xbb10('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbb10('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0xbb10('0x17')](0x9)[_0xbb10('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xbb10('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xbb10('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xbb10('0x17')](0x9)[_0xbb10('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xbb10('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xbb10('0x17')](0x5)[_0xbb10('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xbb10('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xbb10('0x17')](0x9)[_0xbb10('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbb10('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0xbb10('0x17')](0x5)[_0xbb10('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xbb10('0x43')},'dialRecallInQueue':{'type':Sequelize[_0xbb10('0x23')],'defaultValue':0x0,'comment':_0xbb10('0x44')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xbb10('0x45'),'ASC'),'defaultValue':_0xbb10('0x45')},'dialQueueProject2':{'type':Sequelize[_0xbb10('0x1')],'comment':_0xbb10('0x46')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xbb10('0x23')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xbb10('0x23')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xbb10('0x17')](0x3)[_0xbb10('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbb10('0x47')},'dialCutDigit':{'type':Sequelize[_0xbb10('0x17')](0x3)[_0xbb10('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbb10('0x48')}};
\ No newline at end of file
+var _0x7a54=['booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\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)','sequelize','exports','STRING','ENUM','inbound','default','leastrecent','random','rrmemory','wrandom','setDataValue','strategy','getDataValue','dialMethod'];(function(_0x43b487,_0x21893a){var _0x2f707a=function(_0x477ee0){while(--_0x477ee0){_0x43b487['push'](_0x43b487['shift']());}};_0x2f707a(++_0x21893a);}(_0x7a54,0x106));var _0x47a5=function(_0x3cab8c,_0x25c97d){_0x3cab8c=_0x3cab8c-0x0;var _0x11b2f0=_0x7a54[_0x3cab8c];return _0x11b2f0;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'name':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x4'),'outbound'),'allowNull':![],'defaultValue':_0x47a5('0x4')},'musiconhold':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':_0x47a5('0x5')},'announce':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x47a5('0x3')]('rr','ringall',_0x47a5('0x6'),'fewestcalls',_0x47a5('0x7'),_0x47a5('0x8'),'linear',_0x47a5('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x582352){this[_0x47a5('0xa')](_0x47a5('0xb'),_0x582352?_0x582352:'rrmemory');},'get':function(){var _0x2eb0dd=this['getDataValue']('type');var _0x1f47f4=this[_0x47a5('0xc')](_0x47a5('0xd'));var _0x250fad=this[_0x47a5('0xc')](_0x47a5('0xb'));if(_0x2eb0dd===_0x47a5('0x4')){return _0x250fad;}if(_0x1f47f4==='booked'&&_0x250fad===_0x47a5('0x8')||_0x1f47f4===_0x47a5('0xe')&&_0x250fad===_0x47a5('0xf')){return _0x250fad;}if(_0x1f47f4===_0x47a5('0x10')||_0x1f47f4===_0x47a5('0x11')||_0x1f47f4===_0x47a5('0x12')){return _0x250fad;}return null;}},'servicelevel':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x47a5('0x2')]},'weight':{'type':Sequelize[_0x47a5('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x47a5('0x14')},'autopause':{'type':Sequelize['ENUM']('yes','no',_0x47a5('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x47a5('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x47a5('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x47a5('0x3')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x47a5('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x47a5('0x3')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x14'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x14'),'no',_0x47a5('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x47a5('0x3')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x47a5('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x47a5('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x47a5('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x47a5('0x2')]},'queue_quantity1':{'type':Sequelize[_0x47a5('0x2')]},'queue_quantity2':{'type':Sequelize[_0x47a5('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x47a5('0x2')]},'queue_less_than':{'type':Sequelize[_0x47a5('0x2')]},'periodic_announce':{'type':Sequelize[_0x47a5('0x17')],'set':function(_0x528582){this[_0x47a5('0xa')]('periodic_announce',_0x528582?_0x528582[_0x47a5('0x18')](','):[]);},'get':function(){return this[_0x47a5('0xc')](_0x47a5('0x19'))?this['getDataValue'](_0x47a5('0x19'))[_0x47a5('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':_0x47a5('0x14'),'set':function(_0x51cc81){this['setDataValue'](_0x47a5('0x1b'),_0x51cc81?_0x51cc81[_0x47a5('0x18')](','):[]);},'get':function(){return this['getDataValue']('joinempty')?this[_0x47a5('0xc')](_0x47a5('0x1b'))['split'](','):[];}},'leavewhenempty':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':'no','set':function(_0x53119b){this[_0x47a5('0xa')](_0x47a5('0x1c'),_0x53119b?_0x53119b['join'](','):[]);},'get':function(){return this['getDataValue'](_0x47a5('0x1c'))?this['getDataValue'](_0x47a5('0x1c'))[_0x47a5('0x1a')](','):[];}},'reportholdtime':{'type':Sequelize[_0x47a5('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x47a5('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x47a5('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x47a5('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x47a5('0x1d')],'defaultValue':0x0,'set':function(_0x3534cb){this[_0x47a5('0xa')](_0x47a5('0x1e'),_0x3534cb);if(_0x3534cb){if(this[_0x47a5('0xc')](_0x47a5('0x1f'))<0x2){this[_0x47a5('0xa')](_0x47a5('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x47a5('0x20')},'dialMethod':{'type':Sequelize[_0x47a5('0x3')]('preview',_0x47a5('0x10'),_0x47a5('0x12'),_0x47a5('0x11'),'booked'),'defaultValue':_0x47a5('0x10'),'comment':_0x47a5('0x21')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x47a5('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x47a5('0x23')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x47a5('0x24')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x47a5('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x26'),_0x47a5('0x27')),'defaultValue':_0x47a5('0x27'),'comment':_0x47a5('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x47a5('0x24')](0x2)[_0x47a5('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x47a5('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x47a5('0x13')](0x3)[_0x47a5('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x47a5('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x47a5('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x47a5('0x13')](0x3)[_0x47a5('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x47a5('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':'tTxX','comment':_0x47a5('0x2c')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x47a5('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x47a5('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x47a5('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x47a5('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x47a5('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x47a5('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x47a5('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x47a5('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x47a5('0x13')](0x3)[_0x47a5('0x22')],'defaultValue':0x3,'comment':_0x47a5('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x47a5('0x13')](0x5)[_0x47a5('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x47a5('0x32')},'dialGlobalMaxRetry':{'type':Sequelize[_0x47a5('0x13')](0x3)[_0x47a5('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x47a5('0x33')},'dialTimezone':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':_0x47a5('0x34')},'dialPrefix':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x35'),'never',_0x47a5('0x36')),'defaultValue':_0x47a5('0x35')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x47a5('0x13')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x47a5('0x37')},'dialAMDGreeting':{'type':Sequelize[_0x47a5('0x13')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x47a5('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x47a5('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x47a5('0x13')](0x9)[_0x47a5('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x47a5('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0x47a5('0x13')](0x9)[_0x47a5('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x47a5('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x47a5('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x47a5('0x13')](0x9)[_0x47a5('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x47a5('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x47a5('0x13')](0x5)[_0x47a5('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x47a5('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x47a5('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x47a5('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x47a5('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x47a5('0x3f')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x47a5('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x41'),_0x47a5('0x42')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x47a5('0x2')],'comment':_0x47a5('0x2d')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x47a5('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x47a5('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x47a5('0x13')](0x3)[_0x47a5('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x47a5('0x43')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x47a5('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x47a5('0x44')}};
\ No newline at end of file
index 366b8cf..fc3c678 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e05=['index','model','keys','query','dateEnd','filters','intersection','attributes','length','order','sort','where','day','dateStart','add','merge','map','filter','options','VoiceQueue','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','clone','fields','get','createdAt','updatedAt','omit','update','getHoppers','CmHopper','hasOwnProperty','nolimit','pick','VoiceQueueId','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','CmHopperBlack','getTeams','addTeams','ids','User','Agents','union','addAgents','penalty','removeTeams','Team','removeAgents','spread','voicePause','UserVoiceQueueRt','upsert','%s/%s','SIP','all','isArray','userVoiceQueue:remove','emit','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','VoiceQueueId\x20=\x20?','onlyIfOpen','ListId\x20=\x20?','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/environment','socket.io-emitter','localhost','./voiceQueue.socket','register','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','save','then','destroy','error','stack','name'];(function(_0x5951e8,_0x42b9a7){var _0x20a1f5=function(_0x2bc968){while(--_0x2bc968){_0x5951e8['push'](_0x5951e8['shift']());}};_0x20a1f5(++_0x42b9a7);}(_0x7e05,0x69));var _0x57e0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7e05[_0x19e35c];return _0x3e1fe8;};'use strict';var pdf=require(_0x57e0('0x0'));var emlformat=require(_0x57e0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x57e0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x57e0('0x3'));var moment=require(_0x57e0('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x57e0('0x5'));var path=require(_0x57e0('0x6'));var sox=require(_0x57e0('0x7'));var csv=require(_0x57e0('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x57e0('0x9'));var squel=require('squel');var crypto=require(_0x57e0('0xa'));var jsforce=require(_0x57e0('0xb'));var deskjs=require(_0x57e0('0xc'));var toCsv=require(_0x57e0('0x8'));var querystring=require(_0x57e0('0xd'));var Papa=require(_0x57e0('0xe'));var qs=require(_0x57e0('0xf'));var logger=require('../../config/logger')(_0x57e0('0x10'));var utils=require('../../config/utils');var config=require(_0x57e0('0x11'));var db=require('../../mysqldb')['db'];var socket=require(_0x57e0('0x12'))({'host':_0x57e0('0x13'),'port':0x18eb});require(_0x57e0('0x14'))[_0x57e0('0x15')](socket);function respondWithStatusCode(_0x3eb495,_0x254141){_0x254141=_0x254141||0xcc;return function(_0x142d1f){if(_0x142d1f){return _0x3eb495[_0x57e0('0x16')](_0x254141);}return _0x3eb495[_0x57e0('0x17')](_0x254141)['end']();};}function respondWithResult(_0x28b305,_0x1ed2c1){_0x1ed2c1=_0x1ed2c1||0xc8;return function(_0x4a4562){if(_0x4a4562){return _0x28b305[_0x57e0('0x17')](_0x1ed2c1)['json'](_0x4a4562);}};}function respondWithFilteredResult(_0x3fbb99,_0x3797e2){return function(_0x746a9d){if(_0x746a9d){var _0x2e0beb=_0x746a9d[_0x57e0('0x18')],_0x304ec4=_0x3797e2[_0x57e0('0x19')],_0x489fa2=_0x3797e2[_0x57e0('0x19')]+_0x3797e2[_0x57e0('0x1a')],_0x8ddc60;if(_0x489fa2>=_0x2e0beb){_0x489fa2=_0x2e0beb;_0x8ddc60=0xc8;}else{_0x8ddc60=0xce;}_0x3fbb99['status'](_0x8ddc60);return _0x3fbb99[_0x57e0('0x1b')](_0x57e0('0x1c'),_0x304ec4+'-'+_0x489fa2+'/'+_0x2e0beb)[_0x57e0('0x1d')](_0x746a9d);}return null;};}function patchUpdates(_0x1e3cfe){return function(_0x39f412){try{jsonpatch[_0x57e0('0x1e')](_0x39f412,_0x1e3cfe,!![]);}catch(_0x6065c6){return BPromise['reject'](_0x6065c6);}return _0x39f412[_0x57e0('0x1f')]();};}function saveUpdates(_0x133c84,_0x2007ff){return function(_0x3814a3){if(_0x3814a3){return _0x3814a3['update'](_0x133c84)[_0x57e0('0x20')](function(_0x373100){return _0x373100;});}return null;};}function removeEntity(_0x3ebac0,_0x3bc1c0){return function(_0x5d83c6){if(_0x5d83c6){return _0x5d83c6[_0x57e0('0x21')]()[_0x57e0('0x20')](function(){_0x3ebac0[_0x57e0('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x595696,_0x44e84c){return function(_0x3a6a14){if(!_0x3a6a14){_0x595696[_0x57e0('0x16')](0x194);}return _0x3a6a14;};}function handleError(_0x404553,_0xe9c8b){_0xe9c8b=_0xe9c8b||0x1f4;return function(_0x34cac4){logger[_0x57e0('0x22')](_0x34cac4[_0x57e0('0x23')]);if(_0x34cac4[_0x57e0('0x24')]){delete _0x34cac4['name'];}_0x404553[_0x57e0('0x17')](_0xe9c8b)['send'](_0x34cac4);};}exports[_0x57e0('0x25')]=function(_0x16b550,_0x55c77f){var _0x21c4fb={},_0xb97120={},_0x529ad1={'count':0x0,'rows':[]};var _0x17302b=db['VoiceQueue']['rawAttributes'];_0xb97120[_0x57e0('0x26')]=_[_0x57e0('0x27')](_0x17302b);var _0x2cef3e={'dateStart':_0x16b550[_0x57e0('0x28')]['dateStart'],'dateEnd':_0x16b550[_0x57e0('0x28')][_0x57e0('0x29')]};delete _0x16b550['query']['dateStart'];delete _0x16b550['query'][_0x57e0('0x29')];_0xb97120[_0x57e0('0x28')]=_['keys'](_0x16b550[_0x57e0('0x28')]);_0xb97120[_0x57e0('0x2a')]=_[_0x57e0('0x2b')](_0xb97120[_0x57e0('0x26')],_0xb97120['query']);_0x21c4fb[_0x57e0('0x2c')]=_[_0x57e0('0x2b')](_0xb97120['model'],qs['fields'](_0x16b550['query']['fields']));_0x21c4fb['attributes']=_0x21c4fb[_0x57e0('0x2c')][_0x57e0('0x2d')]?_0x21c4fb[_0x57e0('0x2c')]:_0xb97120[_0x57e0('0x26')];if(!_0x16b550[_0x57e0('0x28')]['hasOwnProperty']('nolimit')){_0x21c4fb[_0x57e0('0x1a')]=qs[_0x57e0('0x1a')](_0x16b550[_0x57e0('0x28')][_0x57e0('0x1a')]);_0x21c4fb[_0x57e0('0x19')]=qs[_0x57e0('0x19')](_0x16b550[_0x57e0('0x28')][_0x57e0('0x19')]);}_0x21c4fb[_0x57e0('0x2e')]=qs[_0x57e0('0x2f')](_0x16b550[_0x57e0('0x28')]['sort']);_0x21c4fb[_0x57e0('0x30')]=qs[_0x57e0('0x2a')](_['pick'](_0x16b550['query'],_0xb97120[_0x57e0('0x2a')]));if(_0x2cef3e['dateStart']){if(_0x2cef3e[_0x57e0('0x29')]){_0x2cef3e[_0x57e0('0x29')]=moment(_0x2cef3e['dateEnd'])['add'](0x1,_0x57e0('0x31'));}else{_0x2cef3e[_0x57e0('0x29')]=moment(_0x2cef3e[_0x57e0('0x32')])[_0x57e0('0x33')](0x1,_0x57e0('0x31'));}_[_0x57e0('0x34')](_0x21c4fb['where'],{'createdAt':{'$gte':_0x2cef3e[_0x57e0('0x32')],'$lte':_0x2cef3e[_0x57e0('0x29')]}});}if(_0x16b550[_0x57e0('0x28')]['filter']){_0x21c4fb[_0x57e0('0x30')]=_[_0x57e0('0x34')](_0x21c4fb[_0x57e0('0x30')],{'$or':_[_0x57e0('0x35')](_0x21c4fb['attributes'],function(_0x257d9f){var _0x10c40d={};_0x10c40d[_0x257d9f]={'$like':'%'+_0x16b550[_0x57e0('0x28')][_0x57e0('0x36')]+'%'};return _0x10c40d;})});}_0x21c4fb=_[_0x57e0('0x34')]({},_0x21c4fb,_0x16b550[_0x57e0('0x37')]);var _0x2af8d1={'where':_0x21c4fb[_0x57e0('0x30')]};return db[_0x57e0('0x38')][_0x57e0('0x18')](_0x2af8d1)[_0x57e0('0x20')](function(_0x243ecf){_0x529ad1[_0x57e0('0x18')]=_0x243ecf;if(_0x16b550['query'][_0x57e0('0x39')]){_0x21c4fb['include']=[{'all':!![]}];}return db['VoiceQueue'][_0x57e0('0x3a')](_0x21c4fb);})[_0x57e0('0x20')](function(_0x424a06){_0x529ad1[_0x57e0('0x3b')]=_0x424a06;return _0x529ad1;})[_0x57e0('0x20')](respondWithFilteredResult(_0x55c77f,_0x21c4fb))[_0x57e0('0x3c')](handleError(_0x55c77f,null));};exports['show']=function(_0xd5ffbf,_0x28a3db){var _0x206d49={'raw':![],'where':{'id':_0xd5ffbf[_0x57e0('0x3d')]['id']}},_0xdf4981={};_0xdf4981[_0x57e0('0x26')]=_['keys'](db['VoiceQueue'][_0x57e0('0x3e')]);_0xdf4981[_0x57e0('0x28')]=_[_0x57e0('0x27')](_0xd5ffbf[_0x57e0('0x28')]);_0xdf4981[_0x57e0('0x2a')]=_[_0x57e0('0x2b')](_0xdf4981[_0x57e0('0x26')],_0xdf4981[_0x57e0('0x28')]);_0x206d49['attributes']=_['intersection'](_0xdf4981[_0x57e0('0x26')],qs['fields'](_0xd5ffbf[_0x57e0('0x28')]['fields']));_0x206d49[_0x57e0('0x2c')]=_0x206d49['attributes'][_0x57e0('0x2d')]?_0x206d49[_0x57e0('0x2c')]:_0xdf4981[_0x57e0('0x26')];if(_0xd5ffbf['query'][_0x57e0('0x39')]){_0x206d49[_0x57e0('0x3f')]=[{'all':!![]}];}_0x206d49=_[_0x57e0('0x34')]({},_0x206d49,_0xd5ffbf[_0x57e0('0x37')]);return db[_0x57e0('0x38')][_0x57e0('0x40')](_0x206d49)[_0x57e0('0x20')](handleEntityNotFound(_0x28a3db,null))[_0x57e0('0x20')](respondWithResult(_0x28a3db,null))[_0x57e0('0x3c')](handleError(_0x28a3db,null));};exports['create']=function(_0x646ee4,_0x33dbdd){return db[_0x57e0('0x38')][_0x57e0('0x41')](_0x646ee4[_0x57e0('0x42')],{})[_0x57e0('0x20')](respondWithResult(_0x33dbdd,0xc9))[_0x57e0('0x3c')](handleError(_0x33dbdd,null));};exports[_0x57e0('0x43')]=function(_0x1aa5c9,_0x10823a){var _0x34b0eb={'raw':![],'where':{'id':_0x1aa5c9[_0x57e0('0x3d')]['id']}},_0x1fb777={};_0x1fb777['model']=_[_0x57e0('0x27')](db['VoiceQueue'][_0x57e0('0x3e')]);_0x34b0eb[_0x57e0('0x2c')]=_[_0x57e0('0x2b')](_0x1fb777[_0x57e0('0x26')],qs['fields'](_0x1aa5c9['query'][_0x57e0('0x44')]));_0x34b0eb['attributes']=_0x34b0eb[_0x57e0('0x2c')][_0x57e0('0x2d')]?_0x34b0eb[_0x57e0('0x2c')]:_0x1fb777['model'];if(_0x1aa5c9[_0x57e0('0x28')][_0x57e0('0x39')]){_0x34b0eb[_0x57e0('0x3f')]=[{'all':!![]}];}_0x34b0eb=_[_0x57e0('0x34')]({},_0x34b0eb,_0x1aa5c9[_0x57e0('0x37')]);return db[_0x57e0('0x38')][_0x57e0('0x40')](_0x34b0eb)[_0x57e0('0x20')](handleEntityNotFound(_0x10823a,null))[_0x57e0('0x20')](function(_0xa93399){if(_0xa93399){var _0x59a547=_0xa93399[_0x57e0('0x45')]({'plain':!![]});_0x59a547=qs['omit'](_0x59a547,['id',_0x57e0('0x46'),_0x57e0('0x47')]);_0x1aa5c9[_0x57e0('0x42')]=_[_0x57e0('0x48')](_0x1aa5c9[_0x57e0('0x42')],['id',_0x57e0('0x46'),_0x57e0('0x47')]);return db[_0x57e0('0x38')][_0x57e0('0x41')](_[_0x57e0('0x34')](_0x59a547,_0x1aa5c9['body']),{'include':_0x1aa5c9['query']['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x10823a,0xc9))[_0x57e0('0x3c')](handleError(_0x10823a,null));};exports[_0x57e0('0x49')]=function(_0x402ccc,_0x1ec9cc){if(_0x402ccc['body']['id']){delete _0x402ccc['body']['id'];}return db[_0x57e0('0x38')]['find']({'where':{'id':_0x402ccc[_0x57e0('0x3d')]['id']}})[_0x57e0('0x20')](handleEntityNotFound(_0x1ec9cc,null))[_0x57e0('0x20')](saveUpdates(_0x402ccc[_0x57e0('0x42')],null))['then'](respondWithResult(_0x1ec9cc,null))[_0x57e0('0x3c')](handleError(_0x1ec9cc,null));};exports[_0x57e0('0x21')]=function(_0x169b51,_0x40ad44){return db[_0x57e0('0x38')][_0x57e0('0x40')]({'where':{'id':_0x169b51[_0x57e0('0x3d')]['id']}})['then'](handleEntityNotFound(_0x40ad44,null))[_0x57e0('0x20')](removeEntity(_0x40ad44,null))[_0x57e0('0x3c')](handleError(_0x40ad44,null));};exports[_0x57e0('0x4a')]=function(_0x22d374,_0x3c1e3c,_0x548c20){var _0x5879d8={'raw':![],'where':{}};var _0x354048={};var _0x27f4a0={'count':0x0,'rows':[]};return db[_0x57e0('0x38')]['findOne']({'where':{'id':_0x22d374[_0x57e0('0x3d')]['id']}})[_0x57e0('0x20')](handleEntityNotFound(_0x3c1e3c,null))[_0x57e0('0x20')](function(_0x5a9983){if(_0x5a9983){_0x354048[_0x57e0('0x26')]=_[_0x57e0('0x27')](db[_0x57e0('0x4b')]['rawAttributes']);_0x354048[_0x57e0('0x28')]=_[_0x57e0('0x27')](_0x22d374['query']);_0x354048[_0x57e0('0x2a')]=_[_0x57e0('0x2b')](_0x354048[_0x57e0('0x26')],_0x354048[_0x57e0('0x28')]);_0x5879d8['attributes']=_['intersection'](_0x354048[_0x57e0('0x26')],qs[_0x57e0('0x44')](_0x22d374[_0x57e0('0x28')]['fields']));_0x5879d8[_0x57e0('0x2c')]=_0x5879d8[_0x57e0('0x2c')][_0x57e0('0x2d')]?_0x5879d8[_0x57e0('0x2c')]:_0x354048[_0x57e0('0x26')];if(!_0x22d374['query'][_0x57e0('0x4c')](_0x57e0('0x4d'))){_0x5879d8[_0x57e0('0x1a')]=qs['limit'](_0x22d374['query'][_0x57e0('0x1a')]);_0x5879d8[_0x57e0('0x19')]=qs[_0x57e0('0x19')](_0x22d374[_0x57e0('0x28')]['offset']);}_0x5879d8['order']=qs[_0x57e0('0x2f')](_0x22d374[_0x57e0('0x28')][_0x57e0('0x2f')]);_0x5879d8['where']=qs[_0x57e0('0x2a')](_[_0x57e0('0x4e')](_0x22d374['query'],_0x354048['filters']));_0x5879d8[_0x57e0('0x30')][_0x57e0('0x4f')]=_0x5a9983['id'];if(_0x22d374[_0x57e0('0x28')][_0x57e0('0x36')]){_0x5879d8[_0x57e0('0x30')]=_['merge'](_0x5879d8[_0x57e0('0x30')],{'$or':_[_0x57e0('0x35')](_0x5879d8[_0x57e0('0x2c')],function(_0x1fb772){var _0x37a272={};_0x37a272[_0x1fb772]={'$like':'%'+_0x22d374['query']['filter']+'%'};return _0x37a272;})});}_0x5879d8=_['merge']({},_0x5879d8,_0x22d374[_0x57e0('0x37')]);return db[_0x57e0('0x4b')][_0x57e0('0x18')]({'where':_0x5879d8[_0x57e0('0x30')]})[_0x57e0('0x20')](function(_0x4c7df7){_0x27f4a0[_0x57e0('0x18')]=_0x4c7df7;if(_0x22d374[_0x57e0('0x28')][_0x57e0('0x39')]){_0x5879d8[_0x57e0('0x3f')]=[{'all':!![]}];}return db[_0x57e0('0x4b')][_0x57e0('0x3a')](_0x5879d8);})[_0x57e0('0x20')](function(_0x100827){_0x27f4a0[_0x57e0('0x3b')]=_0x100827;return _0x27f4a0;});}})[_0x57e0('0x20')](respondWithFilteredResult(_0x3c1e3c,_0x5879d8))['catch'](handleError(_0x3c1e3c,null));};exports[_0x57e0('0x50')]=function(_0x23e0b6,_0xa66566,_0x42787e){var _0x315afb={'raw':!![],'where':{}};var _0x25ad3c={};var _0x92acd5={'count':0x0,'rows':[]};return db[_0x57e0('0x38')][_0x57e0('0x51')]({'where':{'id':_0x23e0b6['params']['id']}})[_0x57e0('0x20')](handleEntityNotFound(_0xa66566,null))[_0x57e0('0x20')](function(_0x3bffbc){if(_0x3bffbc){_0x25ad3c[_0x57e0('0x26')]=_['keys'](db[_0x57e0('0x52')][_0x57e0('0x3e')]);_0x25ad3c[_0x57e0('0x28')]=_[_0x57e0('0x27')](_0x23e0b6[_0x57e0('0x28')]);_0x25ad3c[_0x57e0('0x2a')]=_[_0x57e0('0x2b')](_0x25ad3c[_0x57e0('0x26')],_0x25ad3c[_0x57e0('0x28')]);_0x315afb[_0x57e0('0x2c')]=_[_0x57e0('0x2b')](_0x25ad3c['model'],qs[_0x57e0('0x44')](_0x23e0b6[_0x57e0('0x28')][_0x57e0('0x44')]));_0x315afb[_0x57e0('0x2c')]=_0x315afb[_0x57e0('0x2c')][_0x57e0('0x2d')]?_0x315afb['attributes']:_0x25ad3c[_0x57e0('0x26')];if(!_0x23e0b6[_0x57e0('0x28')][_0x57e0('0x4c')](_0x57e0('0x4d'))){_0x315afb[_0x57e0('0x1a')]=qs[_0x57e0('0x1a')](_0x23e0b6[_0x57e0('0x28')]['limit']);_0x315afb[_0x57e0('0x19')]=qs[_0x57e0('0x19')](_0x23e0b6[_0x57e0('0x28')][_0x57e0('0x19')]);}_0x315afb[_0x57e0('0x2e')]=qs[_0x57e0('0x2f')](_0x23e0b6[_0x57e0('0x28')][_0x57e0('0x2f')]);_0x315afb['where']=qs[_0x57e0('0x2a')](_[_0x57e0('0x4e')](_0x23e0b6[_0x57e0('0x28')],_0x25ad3c[_0x57e0('0x2a')]));_0x315afb[_0x57e0('0x30')][_0x57e0('0x4f')]=_0x3bffbc['id'];if(_0x23e0b6[_0x57e0('0x28')]['filter']){_0x315afb['where']=_['merge'](_0x315afb[_0x57e0('0x30')],{'$or':_[_0x57e0('0x35')](_0x315afb[_0x57e0('0x2c')],function(_0x81d05b){var _0x2490df={};_0x2490df[_0x81d05b]={'$like':'%'+_0x23e0b6[_0x57e0('0x28')]['filter']+'%'};return _0x2490df;})});}_0x315afb=_[_0x57e0('0x34')]({},_0x315afb,_0x23e0b6[_0x57e0('0x37')]);return db[_0x57e0('0x52')][_0x57e0('0x18')]({'where':_0x315afb[_0x57e0('0x30')]})[_0x57e0('0x20')](function(_0x298006){_0x92acd5[_0x57e0('0x18')]=_0x298006;if(_0x23e0b6['query'][_0x57e0('0x39')]){_0x315afb[_0x57e0('0x3f')]=[{'all':!![]}];}return db[_0x57e0('0x52')]['findAll'](_0x315afb);})[_0x57e0('0x20')](function(_0x3fa5c4){_0x92acd5['rows']=_0x3fa5c4;return _0x92acd5;});}})['then'](respondWithFilteredResult(_0xa66566,_0x315afb))[_0x57e0('0x3c')](handleError(_0xa66566,null));};exports['getHopperFinals']=function(_0x253086,_0x30e7ed,_0x2664d2){var _0x4c6775={'raw':!![],'where':{}};var _0x30dbc4={};var _0x5f0e6f={'count':0x0,'rows':[]};return db[_0x57e0('0x38')][_0x57e0('0x51')]({'where':{'id':_0x253086[_0x57e0('0x3d')]['id']}})[_0x57e0('0x20')](handleEntityNotFound(_0x30e7ed,null))[_0x57e0('0x20')](function(_0x443716){if(_0x443716){_0x30dbc4[_0x57e0('0x26')]=_[_0x57e0('0x27')](db['CmHopperFinal']['rawAttributes']);_0x30dbc4['query']=_[_0x57e0('0x27')](_0x253086[_0x57e0('0x28')]);_0x30dbc4[_0x57e0('0x2a')]=_['intersection'](_0x30dbc4[_0x57e0('0x26')],_0x30dbc4[_0x57e0('0x28')]);_0x4c6775['attributes']=_[_0x57e0('0x2b')](_0x30dbc4['model'],qs[_0x57e0('0x44')](_0x253086[_0x57e0('0x28')][_0x57e0('0x44')]));_0x4c6775[_0x57e0('0x2c')]=_0x4c6775['attributes'][_0x57e0('0x2d')]?_0x4c6775[_0x57e0('0x2c')]:_0x30dbc4[_0x57e0('0x26')];if(!_0x253086[_0x57e0('0x28')][_0x57e0('0x4c')](_0x57e0('0x4d'))){_0x4c6775['limit']=qs[_0x57e0('0x1a')](_0x253086[_0x57e0('0x28')][_0x57e0('0x1a')]);_0x4c6775[_0x57e0('0x19')]=qs[_0x57e0('0x19')](_0x253086['query'][_0x57e0('0x19')]);}_0x4c6775[_0x57e0('0x2e')]=qs['sort'](_0x253086['query'][_0x57e0('0x2f')]);_0x4c6775[_0x57e0('0x30')]=qs['filters'](_[_0x57e0('0x4e')](_0x253086['query'],_0x30dbc4[_0x57e0('0x2a')]));_0x4c6775[_0x57e0('0x30')][_0x57e0('0x4f')]=_0x443716['id'];if(_0x253086[_0x57e0('0x28')][_0x57e0('0x36')]){_0x4c6775[_0x57e0('0x30')]=_[_0x57e0('0x34')](_0x4c6775['where'],{'$or':_[_0x57e0('0x35')](_0x4c6775['attributes'],function(_0x55bdd0){var _0x4a77b7={};_0x4a77b7[_0x55bdd0]={'$like':'%'+_0x253086[_0x57e0('0x28')][_0x57e0('0x36')]+'%'};return _0x4a77b7;})});}_0x4c6775=_[_0x57e0('0x34')]({},_0x4c6775,_0x253086[_0x57e0('0x37')]);return db[_0x57e0('0x53')]['count']({'where':_0x4c6775[_0x57e0('0x30')]})[_0x57e0('0x20')](function(_0x5ef5c0){_0x5f0e6f[_0x57e0('0x18')]=_0x5ef5c0;if(_0x253086[_0x57e0('0x28')][_0x57e0('0x39')]){_0x4c6775[_0x57e0('0x3f')]=[{'all':!![]}];}return db[_0x57e0('0x53')]['findAll'](_0x4c6775);})[_0x57e0('0x20')](function(_0x1ee6d4){_0x5f0e6f[_0x57e0('0x3b')]=_0x1ee6d4;return _0x5f0e6f;});}})[_0x57e0('0x20')](respondWithFilteredResult(_0x30e7ed,_0x4c6775))[_0x57e0('0x3c')](handleError(_0x30e7ed,null));};exports['getHopperBlacks']=function(_0x566d62,_0x3c82c7,_0x507d0a){var _0x42e43b={'raw':!![],'where':{}};var _0xc54de7={};var _0x4b2683={'count':0x0,'rows':[]};return db[_0x57e0('0x38')][_0x57e0('0x51')]({'where':{'id':_0x566d62[_0x57e0('0x3d')]['id']}})[_0x57e0('0x20')](handleEntityNotFound(_0x3c82c7,null))['then'](function(_0x7151c0){if(_0x7151c0){_0xc54de7[_0x57e0('0x26')]=_[_0x57e0('0x27')](db[_0x57e0('0x54')][_0x57e0('0x3e')]);_0xc54de7[_0x57e0('0x28')]=_[_0x57e0('0x27')](_0x566d62[_0x57e0('0x28')]);_0xc54de7['filters']=_['intersection'](_0xc54de7[_0x57e0('0x26')],_0xc54de7['query']);_0x42e43b[_0x57e0('0x2c')]=_[_0x57e0('0x2b')](_0xc54de7['model'],qs[_0x57e0('0x44')](_0x566d62[_0x57e0('0x28')]['fields']));_0x42e43b['attributes']=_0x42e43b[_0x57e0('0x2c')][_0x57e0('0x2d')]?_0x42e43b['attributes']:_0xc54de7['model'];if(!_0x566d62[_0x57e0('0x28')][_0x57e0('0x4c')](_0x57e0('0x4d'))){_0x42e43b[_0x57e0('0x1a')]=qs[_0x57e0('0x1a')](_0x566d62[_0x57e0('0x28')][_0x57e0('0x1a')]);_0x42e43b[_0x57e0('0x19')]=qs['offset'](_0x566d62[_0x57e0('0x28')]['offset']);}_0x42e43b['order']=qs[_0x57e0('0x2f')](_0x566d62[_0x57e0('0x28')][_0x57e0('0x2f')]);_0x42e43b[_0x57e0('0x30')]=qs[_0x57e0('0x2a')](_[_0x57e0('0x4e')](_0x566d62[_0x57e0('0x28')],_0xc54de7[_0x57e0('0x2a')]));_0x42e43b[_0x57e0('0x30')][_0x57e0('0x4f')]=_0x7151c0['id'];if(_0x566d62['query'][_0x57e0('0x36')]){_0x42e43b[_0x57e0('0x30')]=_['merge'](_0x42e43b[_0x57e0('0x30')],{'$or':_[_0x57e0('0x35')](_0x42e43b[_0x57e0('0x2c')],function(_0x38df77){var _0x4af02d={};_0x4af02d[_0x38df77]={'$like':'%'+_0x566d62['query'][_0x57e0('0x36')]+'%'};return _0x4af02d;})});}_0x42e43b=_[_0x57e0('0x34')]({},_0x42e43b,_0x566d62['options']);return db[_0x57e0('0x54')][_0x57e0('0x18')]({'where':_0x42e43b[_0x57e0('0x30')]})[_0x57e0('0x20')](function(_0x1421ec){_0x4b2683[_0x57e0('0x18')]=_0x1421ec;if(_0x566d62['query']['includeAll']){_0x42e43b[_0x57e0('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x57e0('0x3a')](_0x42e43b);})[_0x57e0('0x20')](function(_0x10e6b2){_0x4b2683['rows']=_0x10e6b2;return _0x4b2683;});}})['then'](respondWithFilteredResult(_0x3c82c7,_0x42e43b))[_0x57e0('0x3c')](handleError(_0x3c82c7,null));};exports[_0x57e0('0x55')]=function(_0x57a30c,_0x35f3e9,_0x4878d5){var _0x527f60={};var _0x5af3be={};var _0x252588;var _0x495adc;return db[_0x57e0('0x38')][_0x57e0('0x51')]({'where':{'id':_0x57a30c['params']['id']}})[_0x57e0('0x20')](handleEntityNotFound(_0x35f3e9,null))[_0x57e0('0x20')](function(_0xcc4828){if(_0xcc4828){_0x252588=_0xcc4828;_0x5af3be[_0x57e0('0x26')]=_[_0x57e0('0x27')](db['Team'][_0x57e0('0x3e')]);_0x5af3be[_0x57e0('0x28')]=_[_0x57e0('0x27')](_0x57a30c[_0x57e0('0x28')]);_0x5af3be['filters']=_[_0x57e0('0x2b')](_0x5af3be[_0x57e0('0x26')],_0x5af3be[_0x57e0('0x28')]);_0x527f60[_0x57e0('0x2c')]=_[_0x57e0('0x2b')](_0x5af3be[_0x57e0('0x26')],qs[_0x57e0('0x44')](_0x57a30c[_0x57e0('0x28')][_0x57e0('0x44')]));_0x527f60[_0x57e0('0x2c')]=_0x527f60[_0x57e0('0x2c')][_0x57e0('0x2d')]?_0x527f60[_0x57e0('0x2c')]:_0x5af3be[_0x57e0('0x26')];_0x527f60[_0x57e0('0x2e')]=qs[_0x57e0('0x2f')](_0x57a30c[_0x57e0('0x28')][_0x57e0('0x2f')]);_0x527f60[_0x57e0('0x30')]=qs['filters'](_[_0x57e0('0x4e')](_0x57a30c[_0x57e0('0x28')],_0x5af3be[_0x57e0('0x2a')]));if(_0x57a30c[_0x57e0('0x28')][_0x57e0('0x36')]){_0x527f60[_0x57e0('0x30')]=_['merge'](_0x527f60[_0x57e0('0x30')],{'$or':_[_0x57e0('0x35')](_0x527f60[_0x57e0('0x2c')],function(_0x228471){var _0x1eb04={};_0x1eb04[_0x228471]={'$like':'%'+_0x57a30c[_0x57e0('0x28')][_0x57e0('0x36')]+'%'};return _0x1eb04;})});}_0x527f60=_['merge']({},_0x527f60,_0x57a30c[_0x57e0('0x37')]);return _0x252588['getTeams'](_0x527f60);}})['then'](function(_0xc22773){if(_0xc22773){_0x495adc=_0xc22773[_0x57e0('0x2d')];if(!_0x57a30c[_0x57e0('0x28')][_0x57e0('0x4c')](_0x57e0('0x4d'))){_0x527f60[_0x57e0('0x1a')]=qs[_0x57e0('0x1a')](_0x57a30c[_0x57e0('0x28')][_0x57e0('0x1a')]);_0x527f60[_0x57e0('0x19')]=qs[_0x57e0('0x19')](_0x57a30c[_0x57e0('0x28')]['offset']);}return _0x252588[_0x57e0('0x55')](_0x527f60);}})[_0x57e0('0x20')](function(_0x2c7d25){if(_0x2c7d25){return _0x2c7d25?{'count':_0x495adc,'rows':_0x2c7d25}:null;}})[_0x57e0('0x20')](respondWithResult(_0x35f3e9,null))[_0x57e0('0x3c')](handleError(_0x35f3e9,null));};exports[_0x57e0('0x56')]=function(_0x129e1d,_0x289660,_0x495031){var _0x62c6e2=[];var _0x4931e3;return db['Team'][_0x57e0('0x3a')]({'where':{'id':_0x129e1d[_0x57e0('0x42')][_0x57e0('0x57')]},'attributes':['id'],'include':[{'model':db[_0x57e0('0x58')],'as':_0x57e0('0x59'),'attributes':['id'],'raw':!![]}]})[_0x57e0('0x20')](function(_0x143c0d){if(_0x143c0d){for(var _0x377f2c=0x0;_0x377f2c<_0x143c0d[_0x57e0('0x2d')];_0x377f2c+=0x1){for(var _0xe9c46b=0x0;_0xe9c46b<_0x143c0d[_0x377f2c][_0x57e0('0x59')]['length'];_0xe9c46b+=0x1){_0x62c6e2=_[_0x57e0('0x5a')](_0x62c6e2,[_0x143c0d[_0x377f2c][_0x57e0('0x59')][_0xe9c46b]['id']]);}}return _0x62c6e2;}})[_0x57e0('0x20')](function(_0x4df6e7){if(_0x4df6e7){return db['VoiceQueue']['find']({'where':{'id':_0x129e1d[_0x57e0('0x3d')]['id']}});}})[_0x57e0('0x20')](function(_0x5ab2d8){if(_0x5ab2d8){_0x4931e3=_0x5ab2d8;return _0x4931e3[_0x57e0('0x5b')](_0x62c6e2,{'penalty':_0x129e1d[_0x57e0('0x42')][_0x57e0('0x5c')]});}})[_0x57e0('0x20')](function(_0x536653){if(_0x536653){return _0x4931e3[_0x57e0('0x56')](_0x129e1d[_0x57e0('0x42')][_0x57e0('0x57')]);}})[_0x57e0('0x20')](handleEntityNotFound(_0x289660,null))[_0x57e0('0x20')](respondWithStatusCode(_0x289660,null))['catch'](handleError(_0x289660,null));};exports[_0x57e0('0x5d')]=function(_0x472c87,_0x47044a,_0x285a78){var _0x22595c=[];var _0x595ae4;return db[_0x57e0('0x5e')][_0x57e0('0x3a')]({'where':{'id':_0x472c87[_0x57e0('0x28')][_0x57e0('0x57')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x57e0('0x59'),'attributes':['id'],'raw':!![]}]})[_0x57e0('0x20')](function(_0x12ef1e){if(_0x12ef1e){for(var _0x62093d=0x0;_0x62093d<_0x12ef1e[_0x57e0('0x2d')];_0x62093d+=0x1){for(var _0xbd13a1=0x0;_0xbd13a1<_0x12ef1e[_0x62093d]['Agents'][_0x57e0('0x2d')];_0xbd13a1+=0x1){_0x22595c=_[_0x57e0('0x5a')](_0x22595c,[_0x12ef1e[_0x62093d][_0x57e0('0x59')][_0xbd13a1]['id']]);}}return _0x22595c;}})['then'](function(_0xca341e){if(_0xca341e){return db[_0x57e0('0x38')][_0x57e0('0x40')]({'where':{'id':_0x472c87[_0x57e0('0x3d')]['id']}});}})[_0x57e0('0x20')](function(_0x54fb4a){if(_0x54fb4a){_0x595ae4=_0x54fb4a;return _0x595ae4[_0x57e0('0x5f')](_0x22595c);}})[_0x57e0('0x20')](function(_0x2f0dee){if(_0x595ae4){return _0x595ae4['removeTeams'](_0x472c87['query'][_0x57e0('0x57')]);}})['then'](handleEntityNotFound(_0x47044a,null))[_0x57e0('0x20')](respondWithStatusCode(_0x47044a,null))[_0x57e0('0x3c')](handleError(_0x47044a,null));};exports[_0x57e0('0x5b')]=function(_0x414d35,_0x46e71e,_0x5904b0){var _0x45e03b,_0x86c62d;return db[_0x57e0('0x38')]['find']({'where':{'id':_0x414d35['params']['id']}})[_0x57e0('0x20')](handleEntityNotFound(_0x46e71e,null))[_0x57e0('0x20')](function(_0x55b3e8){if(_0x55b3e8){_0x86c62d=_0x55b3e8;return _0x55b3e8[_0x57e0('0x5b')](_0x414d35[_0x57e0('0x42')][_0x57e0('0x57')],_[_0x57e0('0x48')](_0x414d35[_0x57e0('0x42')],[_0x57e0('0x57'),'id'])||{})[_0x57e0('0x60')](function(_0x29a412){for(var _0x6abff2=0x0;_0x6abff2<_0x414d35['body'][_0x57e0('0x57')][_0x57e0('0x2d')];_0x6abff2+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':_0x414d35[_0x57e0('0x42')][_0x57e0('0x57')][_0x6abff2],'VoiceQueueId':_0x414d35[_0x57e0('0x3d')]['id']});}return _0x29a412;});}})[_0x57e0('0x20')](function(_0x163e84){_0x45e03b=_0x163e84||[];if(_0x86c62d){return db[_0x57e0('0x58')][_0x57e0('0x3a')]({'where':{'id':_0x414d35[_0x57e0('0x42')][_0x57e0('0x57')]},'attributes':['id','name','loginInPause',_0x57e0('0x61')],'raw':!![]});}})[_0x57e0('0x20')](function(_0x3419bd){if(_0x3419bd&&_0x3419bd[_0x57e0('0x2d')]){var _0x121a7d=[];for(var _0x765f8d=0x0;_0x765f8d<_0x3419bd[_0x57e0('0x2d')];_0x765f8d++){_0x121a7d['push'](db[_0x57e0('0x62')][_0x57e0('0x63')]({'membername':_0x3419bd[_0x765f8d]['name'],'UserId':_0x3419bd[_0x765f8d]['id'],'queue_name':_0x86c62d[_0x57e0('0x24')],'VoiceQueueId':_0x86c62d['id'],'interface':util['format'](_0x57e0('0x64'),_0x57e0('0x65'),_0x3419bd[_0x765f8d][_0x57e0('0x24')]),'paused':_0x3419bd[_0x765f8d][_0x57e0('0x61')]||![],'penalty':_0x414d35[_0x57e0('0x42')][_0x57e0('0x5c')]||0x0}));}return BPromise[_0x57e0('0x66')](_0x121a7d);}})['then'](function(_0x590298){return _0x45e03b;})['then'](respondWithResult(_0x46e71e,null))[_0x57e0('0x3c')](handleError(_0x46e71e,null));};exports['removeAgents']=function(_0x1c0698,_0x286d3d,_0x198078){var _0x250ccb;return db[_0x57e0('0x38')]['find']({'where':{'id':_0x1c0698['params']['id']}})['then'](handleEntityNotFound(_0x286d3d,null))[_0x57e0('0x20')](function(_0x467f9b){if(_0x467f9b){return _0x467f9b[_0x57e0('0x5f')](_0x1c0698[_0x57e0('0x28')][_0x57e0('0x57')])[_0x57e0('0x20')](function(_0x2617b3){if(_[_0x57e0('0x67')](_0x1c0698[_0x57e0('0x28')][_0x57e0('0x57')])){for(var _0x21cd28=0x0;_0x21cd28<_0x1c0698[_0x57e0('0x28')]['ids'][_0x57e0('0x2d')];_0x21cd28+=0x1){socket['emit'](_0x57e0('0x68'),{'UserId':_0x1c0698['query'][_0x57e0('0x57')][_0x21cd28],'VoiceQueueId':_0x1c0698[_0x57e0('0x3d')]['id']});}}else{socket[_0x57e0('0x69')](_0x57e0('0x68'),{'UserId':_0x1c0698[_0x57e0('0x28')][_0x57e0('0x57')],'VoiceQueueId':_0x1c0698[_0x57e0('0x3d')]['id']});}});}})['then'](function(_0x5ad86f){if(_0x1c0698[_0x57e0('0x28')]['realtime']){_0x250ccb=_0x5ad86f;return db['UserVoiceQueueRt'][_0x57e0('0x21')]({'where':{'VoiceQueueId':_0x1c0698[_0x57e0('0x3d')]['id'],'UserId':_0x1c0698[_0x57e0('0x28')][_0x57e0('0x57')]}})[_0x57e0('0x20')](function(){return _0x250ccb;});}})['then'](respondWithStatusCode(_0x286d3d,null))[_0x57e0('0x3c')](handleError(_0x286d3d,null));};exports[_0x57e0('0x6a')]=function(_0x358d52,_0x126eaf,_0x34baa0){var _0x48a7b2={};var _0x250b73={};var _0x50e222;var _0x5da0b3;return db[_0x57e0('0x38')]['findOne']({'where':{'id':_0x358d52[_0x57e0('0x3d')]['id']}})[_0x57e0('0x20')](handleEntityNotFound(_0x126eaf,null))[_0x57e0('0x20')](function(_0x588bd8){if(_0x588bd8){_0x50e222=_0x588bd8;_0x250b73['model']=_[_0x57e0('0x27')](db[_0x57e0('0x58')]['rawAttributes']);_0x250b73[_0x57e0('0x28')]=_[_0x57e0('0x27')](_0x358d52['query']);_0x250b73[_0x57e0('0x2a')]=_[_0x57e0('0x2b')](_0x250b73['model'],_0x250b73['query']);_0x48a7b2[_0x57e0('0x2c')]=_[_0x57e0('0x2b')](_0x250b73[_0x57e0('0x26')],qs[_0x57e0('0x44')](_0x358d52['query'][_0x57e0('0x44')]));_0x48a7b2[_0x57e0('0x2c')]=_0x48a7b2[_0x57e0('0x2c')][_0x57e0('0x2d')]?_0x48a7b2[_0x57e0('0x2c')]:_0x250b73[_0x57e0('0x26')];_0x48a7b2[_0x57e0('0x2e')]=qs[_0x57e0('0x2f')](_0x358d52[_0x57e0('0x28')]['sort']);_0x48a7b2[_0x57e0('0x30')]=qs[_0x57e0('0x2a')](_[_0x57e0('0x4e')](_0x358d52[_0x57e0('0x28')],_0x250b73[_0x57e0('0x2a')]));if(_0x358d52[_0x57e0('0x28')][_0x57e0('0x36')]){_0x48a7b2[_0x57e0('0x30')]=_['merge'](_0x48a7b2[_0x57e0('0x30')],{'$or':_[_0x57e0('0x35')](_0x48a7b2['attributes'],function(_0x8fc9c8){var _0x5b79bc={};_0x5b79bc[_0x8fc9c8]={'$like':'%'+_0x358d52['query'][_0x57e0('0x36')]+'%'};return _0x5b79bc;})});}_0x48a7b2=_[_0x57e0('0x34')]({},_0x48a7b2,_0x358d52[_0x57e0('0x37')]);return _0x50e222['getAgents'](_0x48a7b2);}})[_0x57e0('0x20')](function(_0x13d895){if(_0x13d895){_0x5da0b3=_0x13d895[_0x57e0('0x2d')];if(!_0x358d52['query'][_0x57e0('0x4c')](_0x57e0('0x4d'))){_0x48a7b2[_0x57e0('0x1a')]=qs[_0x57e0('0x1a')](_0x358d52[_0x57e0('0x28')][_0x57e0('0x1a')]);_0x48a7b2[_0x57e0('0x19')]=qs['offset'](_0x358d52[_0x57e0('0x28')][_0x57e0('0x19')]);}return _0x50e222[_0x57e0('0x6a')](_0x48a7b2);}})[_0x57e0('0x20')](function(_0x3da5ee){if(_0x3da5ee){return _0x3da5ee?{'count':_0x5da0b3,'rows':_0x3da5ee}:null;}})[_0x57e0('0x20')](respondWithResult(_0x126eaf,null))['catch'](handleError(_0x126eaf,null));};exports[_0x57e0('0x6b')]=function(_0x3011b8,_0x4c0b1f,_0x2cc574){var _0x274b1d={};var _0x367dc4={};var _0x2945e6;var _0x567255;return db[_0x57e0('0x38')][_0x57e0('0x51')]({'where':{'id':_0x3011b8['params']['id']}})['then'](handleEntityNotFound(_0x4c0b1f,null))[_0x57e0('0x20')](function(_0x8fe42c){if(_0x8fe42c){_0x2945e6=_0x8fe42c;_0x367dc4[_0x57e0('0x26')]=_[_0x57e0('0x27')](db[_0x57e0('0x62')]['rawAttributes']);_0x367dc4[_0x57e0('0x28')]=_['keys'](_0x3011b8[_0x57e0('0x28')]);_0x367dc4[_0x57e0('0x2a')]=_[_0x57e0('0x2b')](_0x367dc4[_0x57e0('0x26')],_0x367dc4[_0x57e0('0x28')]);_0x274b1d[_0x57e0('0x2c')]=_[_0x57e0('0x2b')](_0x367dc4[_0x57e0('0x26')],qs[_0x57e0('0x44')](_0x3011b8[_0x57e0('0x28')][_0x57e0('0x44')]));_0x274b1d['attributes']=_0x274b1d[_0x57e0('0x2c')][_0x57e0('0x2d')]?_0x274b1d[_0x57e0('0x2c')]:_0x367dc4[_0x57e0('0x26')];_0x274b1d[_0x57e0('0x2e')]=qs['sort'](_0x3011b8[_0x57e0('0x28')][_0x57e0('0x2f')]);_0x274b1d['where']=qs[_0x57e0('0x2a')](_['pick'](_0x3011b8['query'],_0x367dc4[_0x57e0('0x2a')]));if(_0x3011b8['query'][_0x57e0('0x36')]){_0x274b1d['where']=_[_0x57e0('0x34')](_0x274b1d[_0x57e0('0x30')],{'$or':_['map'](_0x274b1d[_0x57e0('0x2c')],function(_0x370dab){var _0x28675c={};_0x28675c[_0x370dab]={'$like':'%'+_0x3011b8[_0x57e0('0x28')][_0x57e0('0x36')]+'%'};return _0x28675c;})});}_0x274b1d=_[_0x57e0('0x34')]({},_0x274b1d,_0x3011b8['options']);return _0x2945e6[_0x57e0('0x6b')](_0x274b1d);}})[_0x57e0('0x20')](function(_0x55c9c1){if(_0x55c9c1){_0x567255=_0x55c9c1['length'];if(!_0x3011b8[_0x57e0('0x28')][_0x57e0('0x4c')](_0x57e0('0x4d'))){_0x274b1d[_0x57e0('0x1a')]=qs[_0x57e0('0x1a')](_0x3011b8[_0x57e0('0x28')][_0x57e0('0x1a')]);_0x274b1d[_0x57e0('0x19')]=qs[_0x57e0('0x19')](_0x3011b8[_0x57e0('0x28')][_0x57e0('0x19')]);}return _0x2945e6['getMembers'](_0x274b1d);}})[_0x57e0('0x20')](function(_0x509553){return _0x509553?{'count':_0x567255,'rows':_0x509553}:null;})[_0x57e0('0x20')](respondWithResult(_0x4c0b1f,null))[_0x57e0('0x3c')](handleError(_0x4c0b1f,null));};exports[_0x57e0('0x6c')]=function(_0x2fd081,_0x18a235,_0x4dd44b){var _0x5aace8={};var _0x20b2cf={};var _0x2ec5f2;var _0x94f341;return db['VoiceQueue'][_0x57e0('0x51')]({'where':{'id':_0x2fd081[_0x57e0('0x3d')]['id']}})[_0x57e0('0x20')](handleEntityNotFound(_0x18a235,null))[_0x57e0('0x20')](function(_0x6a614d){if(_0x6a614d){_0x2ec5f2=_0x6a614d;_0x20b2cf[_0x57e0('0x26')]=_['keys'](db[_0x57e0('0x6d')][_0x57e0('0x3e')]);_0x20b2cf[_0x57e0('0x28')]=_[_0x57e0('0x27')](_0x2fd081[_0x57e0('0x28')]);_0x20b2cf[_0x57e0('0x2a')]=_[_0x57e0('0x2b')](_0x20b2cf[_0x57e0('0x26')],_0x20b2cf[_0x57e0('0x28')]);_0x5aace8[_0x57e0('0x2c')]=_[_0x57e0('0x2b')](_0x20b2cf[_0x57e0('0x26')],qs[_0x57e0('0x44')](_0x2fd081[_0x57e0('0x28')][_0x57e0('0x44')]));_0x5aace8[_0x57e0('0x2c')]=_0x5aace8[_0x57e0('0x2c')]['length']?_0x5aace8[_0x57e0('0x2c')]:_0x20b2cf['model'];_0x5aace8[_0x57e0('0x2e')]=qs[_0x57e0('0x2f')](_0x2fd081[_0x57e0('0x28')][_0x57e0('0x2f')]);_0x5aace8['where']=qs[_0x57e0('0x2a')](_['pick'](_0x2fd081[_0x57e0('0x28')],_0x20b2cf[_0x57e0('0x2a')]));if(_0x2fd081['query'][_0x57e0('0x36')]){_0x5aace8['where']=_[_0x57e0('0x34')](_0x5aace8[_0x57e0('0x30')],{'$or':_[_0x57e0('0x35')](_0x5aace8['attributes'],function(_0x409bcd){var _0x4f1e80={};_0x4f1e80[_0x409bcd]={'$like':'%'+_0x2fd081[_0x57e0('0x28')][_0x57e0('0x36')]+'%'};return _0x4f1e80;})});}_0x5aace8=_['merge']({},_0x5aace8,_0x2fd081[_0x57e0('0x37')]);return _0x2ec5f2[_0x57e0('0x6c')](_0x5aace8);}})['then'](function(_0x3e68e7){if(_0x3e68e7){_0x94f341=_0x3e68e7[_0x57e0('0x2d')];if(!_0x2fd081['query'][_0x57e0('0x4c')](_0x57e0('0x4d'))){_0x5aace8[_0x57e0('0x1a')]=qs[_0x57e0('0x1a')](_0x2fd081[_0x57e0('0x28')][_0x57e0('0x1a')]);_0x5aace8[_0x57e0('0x19')]=qs[_0x57e0('0x19')](_0x2fd081[_0x57e0('0x28')][_0x57e0('0x19')]);}return _0x2ec5f2['getLists'](_0x5aace8);}})[_0x57e0('0x20')](function(_0x44b9e2){if(_0x44b9e2){return _0x44b9e2?{'count':_0x94f341,'rows':_0x44b9e2}:null;}})[_0x57e0('0x20')](respondWithResult(_0x18a235,null))['catch'](handleError(_0x18a235,null));};exports[_0x57e0('0x6e')]=function(_0x2f340d,_0x2f2fe8,_0x383575){var _0x329570,_0x214aae;return db['VoiceQueue'][_0x57e0('0x40')]({'where':{'id':_0x2f340d[_0x57e0('0x3d')]['id']}})[_0x57e0('0x20')](handleEntityNotFound(_0x2f2fe8,null))[_0x57e0('0x20')](function(_0x5581d6){if(_0x5581d6){_0x214aae=_0x5581d6;return _0x5581d6[_0x57e0('0x6e')](_0x2f340d[_0x57e0('0x42')][_0x57e0('0x57')],_['omit'](_0x2f340d[_0x57e0('0x42')],[_0x57e0('0x57'),'id'])||{});}return null;})['spread'](function(_0x5e961c){var _0xf25639;_0x329570=_0x5e961c||[];var _0x4490b4=[];if(_0x5e961c){for(var _0x2b2b4b=0x0;_0x2b2b4b<_0x5e961c[_0x57e0('0x2d')];_0x2b2b4b+=0x1){var _0x5e89db=_0x5e961c[_0x2b2b4b][_0x57e0('0x45')]({'plain':!![]});_0x214aae['dialCheckDuplicateType']=_0x2f340d['body']['dialCheckDuplicateType']?_0x2f340d[_0x57e0('0x42')][_0x57e0('0x6f')]:_0x214aae['dialCheckDuplicateType'];switch(_0x214aae[_0x57e0('0x6f')]){case'always':_0xf25639=squel[_0x57e0('0x70')]()[_0x57e0('0x71')](_0x57e0('0x72'))[_0x57e0('0x73')]([_0x57e0('0x74'),_0x57e0('0x75'),_0x57e0('0x76'),_0x57e0('0x77'),'VoiceQueueId',_0x57e0('0x46'),_0x57e0('0x47')],squel[_0x57e0('0x78')]()[_0x57e0('0x79')](_0x57e0('0x74'),_0x57e0('0x74'))[_0x57e0('0x79')](_0x57e0('0x7a'),'scheduledAt')[_0x57e0('0x79')]('id',_0x57e0('0x76'))[_0x57e0('0x79')](_0x5e89db[_0x57e0('0x7b')]['toString'](),_0x57e0('0x77'))['field'](_0x2f340d[_0x57e0('0x3d')]['id'][_0x57e0('0x7c')](),_0x57e0('0x4f'))['field'](_0x57e0('0x7a'),_0x57e0('0x46'))['field'](_0x57e0('0x7a'),_0x57e0('0x47'))[_0x57e0('0x7d')](_0x57e0('0x7e'))[_0x57e0('0x30')](_0x57e0('0x7f'))[_0x57e0('0x30')]('ListId\x20=\x20?',_0x5e89db[_0x57e0('0x7b')]['toString']())[_0x57e0('0x30')](_0x57e0('0x80'))[_0x57e0('0x30')](_0x57e0('0x81'),squel['select']()[_0x57e0('0x79')](_0x57e0('0x82'))[_0x57e0('0x7d')](_0x57e0('0x83'))[_0x57e0('0x30')](_0x57e0('0x84'),_0x2f340d[_0x57e0('0x3d')]['id'][_0x57e0('0x7c')]()))['where'](_0x57e0('0x81'),squel['select']()[_0x57e0('0x79')](_0x57e0('0x74'))['from'](_0x57e0('0x72'))['where'](_0x57e0('0x84'),_0x2f340d['params']['id'][_0x57e0('0x7c')]())))['toString']();break;case _0x57e0('0x85'):_0xf25639=squel['insert']()[_0x57e0('0x71')](_0x57e0('0x72'))[_0x57e0('0x73')](['phone',_0x57e0('0x75'),_0x57e0('0x76'),_0x57e0('0x77'),_0x57e0('0x4f'),_0x57e0('0x46'),_0x57e0('0x47')],squel[_0x57e0('0x78')]()[_0x57e0('0x79')](_0x57e0('0x74'),_0x57e0('0x74'))['field'](_0x57e0('0x7a'),_0x57e0('0x75'))[_0x57e0('0x79')]('id','ContactId')[_0x57e0('0x79')](_0x5e89db[_0x57e0('0x7b')]['toString'](),_0x57e0('0x77'))[_0x57e0('0x79')](_0x2f340d[_0x57e0('0x3d')]['id'][_0x57e0('0x7c')](),'VoiceQueueId')[_0x57e0('0x79')](_0x57e0('0x7a'),_0x57e0('0x46'))[_0x57e0('0x79')]('NOW()',_0x57e0('0x47'))[_0x57e0('0x7d')](_0x57e0('0x7e'))[_0x57e0('0x30')](_0x57e0('0x7f'))[_0x57e0('0x30')](_0x57e0('0x86'),_0x5e89db['CmListId'][_0x57e0('0x7c')]())[_0x57e0('0x30')](_0x57e0('0x80'))[_0x57e0('0x30')](_0x57e0('0x81'),squel['select']()[_0x57e0('0x79')](_0x57e0('0x74'))[_0x57e0('0x7d')](_0x57e0('0x72'))[_0x57e0('0x30')]('VoiceQueueId\x20=\x20?',_0x2f340d['params']['id'][_0x57e0('0x7c')]())))[_0x57e0('0x7c')]();break;default:_0xf25639=squel[_0x57e0('0x70')]()[_0x57e0('0x71')](_0x57e0('0x72'))[_0x57e0('0x73')]([_0x57e0('0x74'),_0x57e0('0x75'),_0x57e0('0x76'),_0x57e0('0x77'),_0x57e0('0x4f'),_0x57e0('0x46'),'updatedAt'],squel[_0x57e0('0x78')]()[_0x57e0('0x79')](_0x57e0('0x74'),_0x57e0('0x74'))[_0x57e0('0x79')](_0x57e0('0x7a'),_0x57e0('0x75'))['field']('id','ContactId')[_0x57e0('0x79')](_0x5e89db[_0x57e0('0x7b')][_0x57e0('0x7c')](),'ListId')[_0x57e0('0x79')](_0x2f340d[_0x57e0('0x3d')]['id'][_0x57e0('0x7c')](),'VoiceQueueId')[_0x57e0('0x79')]('NOW()',_0x57e0('0x46'))[_0x57e0('0x79')](_0x57e0('0x7a'),'updatedAt')['from'](_0x57e0('0x7e'))[_0x57e0('0x30')](_0x57e0('0x7f'))['where'](_0x57e0('0x86'),_0x5e89db['CmListId']['toString']())['where'](_0x57e0('0x80')))[_0x57e0('0x7c')]();}_0x4490b4[_0x57e0('0x87')](db[_0x57e0('0x88')][_0x57e0('0x28')](_0xf25639));}return BPromise[_0x57e0('0x66')](_0x4490b4);}})[_0x57e0('0x20')](function(){return _0x329570;})['then'](respondWithResult(_0x2f2fe8,null))[_0x57e0('0x3c')](handleError(_0x2f2fe8,null));};exports[_0x57e0('0x89')]=function(_0x474ea9,_0x87d03c,_0x3a3dc5){var _0xf081fb;return db['VoiceQueue'][_0x57e0('0x40')]({'where':{'id':_0x474ea9['params']['id']}})[_0x57e0('0x20')](handleEntityNotFound(_0x87d03c,null))[_0x57e0('0x20')](function(_0x1f0b5a){if(_0x1f0b5a){return _0x1f0b5a[_0x57e0('0x89')](_0x474ea9[_0x57e0('0x28')][_0x57e0('0x57')]);}})[_0x57e0('0x20')](function(_0x347a95){if(_0x347a95){_0xf081fb=_0x347a95;return db['CmHopper'][_0x57e0('0x21')]({'where':{'ListId':_0x474ea9[_0x57e0('0x28')][_0x57e0('0x57')],'VoiceQueueId':_0x474ea9['params']['id']}})['then'](function(){return _0xf081fb;});}})[_0x57e0('0x20')](respondWithStatusCode(_0x87d03c,null))['catch'](handleError(_0x87d03c,null));};exports[_0x57e0('0x8a')]=function(_0x5640f3,_0x5a443b,_0x21a276){var _0xbb377c={};var _0x482cf3={};var _0x7b024d;var _0x32e72a;return db['VoiceQueue'][_0x57e0('0x51')]({'where':{'id':_0x5640f3[_0x57e0('0x3d')]['id']}})[_0x57e0('0x20')](handleEntityNotFound(_0x5a443b,null))[_0x57e0('0x20')](function(_0x360461){if(_0x360461){_0x7b024d=_0x360461;_0x482cf3['model']=_[_0x57e0('0x27')](db[_0x57e0('0x6d')]['rawAttributes']);_0x482cf3[_0x57e0('0x28')]=_['keys'](_0x5640f3['query']);_0x482cf3['filters']=_[_0x57e0('0x2b')](_0x482cf3['model'],_0x482cf3[_0x57e0('0x28')]);_0xbb377c[_0x57e0('0x2c')]=_['intersection'](_0x482cf3['model'],qs['fields'](_0x5640f3[_0x57e0('0x28')][_0x57e0('0x44')]));_0xbb377c[_0x57e0('0x2c')]=_0xbb377c[_0x57e0('0x2c')]['length']?_0xbb377c[_0x57e0('0x2c')]:_0x482cf3[_0x57e0('0x26')];_0xbb377c[_0x57e0('0x2e')]=qs[_0x57e0('0x2f')](_0x5640f3[_0x57e0('0x28')][_0x57e0('0x2f')]);_0xbb377c[_0x57e0('0x30')]=qs['filters'](_[_0x57e0('0x4e')](_0x5640f3[_0x57e0('0x28')],_0x482cf3['filters']));if(_0x5640f3[_0x57e0('0x28')][_0x57e0('0x36')]){_0xbb377c[_0x57e0('0x30')]=_[_0x57e0('0x34')](_0xbb377c[_0x57e0('0x30')],{'$or':_[_0x57e0('0x35')](_0xbb377c['attributes'],function(_0x192aa1){var _0x1a50f9={};_0x1a50f9[_0x192aa1]={'$like':'%'+_0x5640f3[_0x57e0('0x28')][_0x57e0('0x36')]+'%'};return _0x1a50f9;})});}_0xbb377c=_['merge']({},_0xbb377c,_0x5640f3[_0x57e0('0x37')]);return _0x7b024d[_0x57e0('0x8a')](_0xbb377c);}})[_0x57e0('0x20')](function(_0x35f4d2){if(_0x35f4d2){_0x32e72a=_0x35f4d2[_0x57e0('0x2d')];if(!_0x5640f3[_0x57e0('0x28')][_0x57e0('0x4c')](_0x57e0('0x4d'))){_0xbb377c[_0x57e0('0x1a')]=qs['limit'](_0x5640f3[_0x57e0('0x28')][_0x57e0('0x1a')]);_0xbb377c[_0x57e0('0x19')]=qs['offset'](_0x5640f3[_0x57e0('0x28')][_0x57e0('0x19')]);}return _0x7b024d['getBlackLists'](_0xbb377c);}})[_0x57e0('0x20')](function(_0x2dcd9e){if(_0x2dcd9e){return _0x2dcd9e?{'count':_0x32e72a,'rows':_0x2dcd9e}:null;}})[_0x57e0('0x20')](respondWithResult(_0x5a443b,null))[_0x57e0('0x3c')](handleError(_0x5a443b,null));};exports[_0x57e0('0x8b')]=function(_0x4e31e4,_0x55b557,_0x289c48){var _0x22c5ad,_0x29b49d;return db['VoiceQueue'][_0x57e0('0x40')]({'where':{'id':_0x4e31e4[_0x57e0('0x3d')]['id']}})['then'](handleEntityNotFound(_0x55b557,null))['then'](function(_0x1c9a9e){if(_0x1c9a9e){_0x29b49d=_0x1c9a9e;return _0x1c9a9e[_0x57e0('0x8b')](_0x4e31e4[_0x57e0('0x42')][_0x57e0('0x57')],_[_0x57e0('0x48')](_0x4e31e4[_0x57e0('0x42')],[_0x57e0('0x57'),'id'])||{});}return null;})[_0x57e0('0x60')](function(_0x27856e){var _0x5a0c9c;_0x22c5ad=_0x27856e||[];var _0x41abee=[];if(_0x27856e){for(var _0x310274=0x0;_0x310274<_0x27856e[_0x57e0('0x2d')];_0x310274+=0x1){var _0x2dd81b=_0x27856e[_0x310274][_0x57e0('0x45')]({'plain':!![]});_0x5a0c9c=squel[_0x57e0('0x70')]()['into'](_0x57e0('0x8c'))[_0x57e0('0x73')]([_0x57e0('0x74'),_0x57e0('0x76'),'ListId',_0x57e0('0x4f'),_0x57e0('0x46'),'updatedAt'],squel[_0x57e0('0x78')]()[_0x57e0('0x79')](_0x57e0('0x74'),_0x57e0('0x74'))[_0x57e0('0x79')]('id',_0x57e0('0x76'))[_0x57e0('0x79')](_0x2dd81b['CmListId'][_0x57e0('0x7c')](),_0x57e0('0x77'))[_0x57e0('0x79')](_0x4e31e4[_0x57e0('0x3d')]['id']['toString'](),_0x57e0('0x4f'))[_0x57e0('0x79')](_0x57e0('0x7a'),_0x57e0('0x46'))['field'](_0x57e0('0x7a'),'updatedAt')[_0x57e0('0x7d')](_0x57e0('0x7e'))['where'](_0x57e0('0x7f'))[_0x57e0('0x30')](_0x57e0('0x86'),_0x2dd81b[_0x57e0('0x7b')][_0x57e0('0x7c')]())[_0x57e0('0x30')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x41abee['push'](db[_0x57e0('0x88')][_0x57e0('0x28')](_0x5a0c9c));}return BPromise['all'](_0x41abee);}})[_0x57e0('0x20')](function(){return _0x22c5ad;})[_0x57e0('0x20')](respondWithResult(_0x55b557,null))[_0x57e0('0x3c')](handleError(_0x55b557,null));};exports[_0x57e0('0x8d')]=function(_0x215a09,_0x3faaf2,_0x989c3a){var _0x2cfbea;return db[_0x57e0('0x38')][_0x57e0('0x40')]({'where':{'id':_0x215a09[_0x57e0('0x3d')]['id']}})[_0x57e0('0x20')](handleEntityNotFound(_0x3faaf2,null))[_0x57e0('0x20')](function(_0x569782){if(_0x569782){return _0x569782[_0x57e0('0x8d')](_0x215a09[_0x57e0('0x28')][_0x57e0('0x57')]);}})['then'](function(_0x46c905){if(_0x46c905){_0x2cfbea=_0x46c905;return db[_0x57e0('0x54')][_0x57e0('0x21')]({'where':{'ListId':_0x215a09[_0x57e0('0x28')][_0x57e0('0x57')],'VoiceQueueId':_0x215a09[_0x57e0('0x3d')]['id']}})[_0x57e0('0x20')](function(){return _0x2cfbea;});}})['then'](respondWithStatusCode(_0x3faaf2,null))['catch'](handleError(_0x3faaf2,null));};
\ No newline at end of file
+var _0x8c50=['ids','User','Agents','union','addAgents','penalty','removeTeams','removeAgents','userVoiceQueue:save','loginInPause','push','UserVoiceQueueRt','upsert','format','%s/%s','SIP','voicePause','all','isArray','emit','userVoiceQueue:remove','realtime','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','into','cm_hopper','fromQuery','ContactId','ListId','select','field','phone','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','from','cm_hopper_final','VoiceQueueId\x20=\x20?','onlyIfOpen','insert','scheduledAt','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','crypto','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','localhost','./voiceQueue.socket','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','name','index','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','add','day','merge','filter','map','VoiceQueue','includeAll','include','findAll','rows','catch','params','body','clone','rawAttributes','length','options','get','omit','createdAt','updatedAt','create','find','getHoppers','findOne','CmHopper','VoiceQueueId','CmHopperHistory','order','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams'];(function(_0x38b269,_0x306f53){var _0x59e8ef=function(_0x5a9540){while(--_0x5a9540){_0x38b269['push'](_0x38b269['shift']());}};_0x59e8ef(++_0x306f53);}(_0x8c50,0xcd));var _0x08c5=function(_0x542158,_0xdbca3f){_0x542158=_0x542158-0x0;var _0x494712=_0x8c50[_0x542158];return _0x494712;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x08c5('0x0'));var rimraf=require(_0x08c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x08c5('0x2'));var rp=require(_0x08c5('0x3'));var moment=require(_0x08c5('0x4'));var BPromise=require(_0x08c5('0x5'));var Mustache=require(_0x08c5('0x6'));var util=require('util');var path=require(_0x08c5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x08c5('0x8'));var fs=require('fs');var _=require(_0x08c5('0x9'));var squel=require('squel');var crypto=require(_0x08c5('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x08c5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x08c5('0xc'));var Papa=require(_0x08c5('0xd'));var qs=require('../../components/parsers/qs');var logger=require(_0x08c5('0xe'))(_0x08c5('0xf'));var utils=require(_0x08c5('0x10'));var config=require(_0x08c5('0x11'));var db=require(_0x08c5('0x12'))['db'];var socket=require(_0x08c5('0x13'))({'host':_0x08c5('0x14'),'port':0x18eb});require(_0x08c5('0x15'))['register'](socket);function respondWithStatusCode(_0x52a1c2,_0x302bbc){_0x302bbc=_0x302bbc||0xcc;return function(_0x26e00f){if(_0x26e00f){return _0x52a1c2[_0x08c5('0x16')](_0x302bbc);}return _0x52a1c2[_0x08c5('0x17')](_0x302bbc)['end']();};}function respondWithResult(_0x35668f,_0x38e1e4){_0x38e1e4=_0x38e1e4||0xc8;return function(_0x27b562){if(_0x27b562){return _0x35668f[_0x08c5('0x17')](_0x38e1e4)[_0x08c5('0x18')](_0x27b562);}};}function respondWithFilteredResult(_0x15af77,_0x27696d){return function(_0x4d6e2f){if(_0x4d6e2f){var _0x14936f=_0x4d6e2f[_0x08c5('0x19')],_0x5c5db0=_0x27696d[_0x08c5('0x1a')],_0xa589ce=_0x27696d['offset']+_0x27696d[_0x08c5('0x1b')],_0xc08175;if(_0xa589ce>=_0x14936f){_0xa589ce=_0x14936f;_0xc08175=0xc8;}else{_0xc08175=0xce;}_0x15af77['status'](_0xc08175);return _0x15af77[_0x08c5('0x1c')](_0x08c5('0x1d'),_0x5c5db0+'-'+_0xa589ce+'/'+_0x14936f)[_0x08c5('0x18')](_0x4d6e2f);}return null;};}function patchUpdates(_0xb278c5){return function(_0x4695c1){try{jsonpatch[_0x08c5('0x1e')](_0x4695c1,_0xb278c5,!![]);}catch(_0xb6b966){return BPromise[_0x08c5('0x1f')](_0xb6b966);}return _0x4695c1[_0x08c5('0x20')]();};}function saveUpdates(_0x2e155c,_0x65bf0a){return function(_0x273e7e){if(_0x273e7e){return _0x273e7e[_0x08c5('0x21')](_0x2e155c)['then'](function(_0x1aede7){return _0x1aede7;});}return null;};}function removeEntity(_0x183842,_0x268488){return function(_0x490a9c){if(_0x490a9c){return _0x490a9c[_0x08c5('0x22')]()[_0x08c5('0x23')](function(){_0x183842['status'](0xcc)[_0x08c5('0x24')]();});}};}function handleEntityNotFound(_0x11950d,_0x1869e2){return function(_0x53ff91){if(!_0x53ff91){_0x11950d[_0x08c5('0x16')](0x194);}return _0x53ff91;};}function handleError(_0x1b1bfb,_0x36c109){_0x36c109=_0x36c109||0x1f4;return function(_0x51b761){logger[_0x08c5('0x25')](_0x51b761['stack']);if(_0x51b761[_0x08c5('0x26')]){delete _0x51b761[_0x08c5('0x26')];}_0x1b1bfb[_0x08c5('0x17')](_0x36c109)['send'](_0x51b761);};}exports[_0x08c5('0x27')]=function(_0x238167,_0x1b65e4){var _0x5e48fa={},_0x5cd264={},_0x36bdd={'count':0x0,'rows':[]};var _0x22c96=db['VoiceQueue']['rawAttributes'];_0x5cd264[_0x08c5('0x28')]=_[_0x08c5('0x29')](_0x22c96);var _0x3b3aff={'dateStart':_0x238167[_0x08c5('0x2a')][_0x08c5('0x2b')],'dateEnd':_0x238167[_0x08c5('0x2a')]['dateEnd']};delete _0x238167[_0x08c5('0x2a')][_0x08c5('0x2b')];delete _0x238167['query'][_0x08c5('0x2c')];_0x5cd264[_0x08c5('0x2a')]=_[_0x08c5('0x29')](_0x238167[_0x08c5('0x2a')]);_0x5cd264[_0x08c5('0x2d')]=_[_0x08c5('0x2e')](_0x5cd264['model'],_0x5cd264[_0x08c5('0x2a')]);_0x5e48fa[_0x08c5('0x2f')]=_[_0x08c5('0x2e')](_0x5cd264[_0x08c5('0x28')],qs[_0x08c5('0x30')](_0x238167[_0x08c5('0x2a')][_0x08c5('0x30')]));_0x5e48fa[_0x08c5('0x2f')]=_0x5e48fa['attributes']['length']?_0x5e48fa[_0x08c5('0x2f')]:_0x5cd264[_0x08c5('0x28')];if(!_0x238167[_0x08c5('0x2a')][_0x08c5('0x31')](_0x08c5('0x32'))){_0x5e48fa[_0x08c5('0x1b')]=qs[_0x08c5('0x1b')](_0x238167[_0x08c5('0x2a')]['limit']);_0x5e48fa[_0x08c5('0x1a')]=qs[_0x08c5('0x1a')](_0x238167['query']['offset']);}_0x5e48fa['order']=qs[_0x08c5('0x33')](_0x238167[_0x08c5('0x2a')][_0x08c5('0x33')]);_0x5e48fa[_0x08c5('0x34')]=qs[_0x08c5('0x2d')](_[_0x08c5('0x35')](_0x238167[_0x08c5('0x2a')],_0x5cd264[_0x08c5('0x2d')]));if(_0x3b3aff[_0x08c5('0x2b')]){if(_0x3b3aff['dateEnd']){_0x3b3aff[_0x08c5('0x2c')]=moment(_0x3b3aff[_0x08c5('0x2c')])[_0x08c5('0x36')](0x1,'day');}else{_0x3b3aff[_0x08c5('0x2c')]=moment(_0x3b3aff[_0x08c5('0x2b')])[_0x08c5('0x36')](0x1,_0x08c5('0x37'));}_[_0x08c5('0x38')](_0x5e48fa['where'],{'createdAt':{'$gte':_0x3b3aff[_0x08c5('0x2b')],'$lte':_0x3b3aff[_0x08c5('0x2c')]}});}if(_0x238167[_0x08c5('0x2a')][_0x08c5('0x39')]){_0x5e48fa[_0x08c5('0x34')]=_[_0x08c5('0x38')](_0x5e48fa[_0x08c5('0x34')],{'$or':_[_0x08c5('0x3a')](_0x5e48fa[_0x08c5('0x2f')],function(_0x587fbf){var _0x5625ff={};_0x5625ff[_0x587fbf]={'$like':'%'+_0x238167[_0x08c5('0x2a')][_0x08c5('0x39')]+'%'};return _0x5625ff;})});}_0x5e48fa=_[_0x08c5('0x38')]({},_0x5e48fa,_0x238167['options']);var _0x39fae9={'where':_0x5e48fa['where']};return db[_0x08c5('0x3b')]['count'](_0x39fae9)[_0x08c5('0x23')](function(_0x2c54cd){_0x36bdd[_0x08c5('0x19')]=_0x2c54cd;if(_0x238167[_0x08c5('0x2a')][_0x08c5('0x3c')]){_0x5e48fa[_0x08c5('0x3d')]=[{'all':!![]}];}return db[_0x08c5('0x3b')][_0x08c5('0x3e')](_0x5e48fa);})[_0x08c5('0x23')](function(_0x29b2b5){_0x36bdd[_0x08c5('0x3f')]=_0x29b2b5;return _0x36bdd;})[_0x08c5('0x23')](respondWithFilteredResult(_0x1b65e4,_0x5e48fa))[_0x08c5('0x40')](handleError(_0x1b65e4,null));};exports['show']=function(_0x27489c,_0x256019){var _0x1012d5={'raw':![],'where':{'id':_0x27489c[_0x08c5('0x41')]['id']}},_0x349cdf={};_0x349cdf['model']=_[_0x08c5('0x29')](db[_0x08c5('0x3b')]['rawAttributes']);_0x349cdf[_0x08c5('0x2a')]=_[_0x08c5('0x29')](_0x27489c[_0x08c5('0x2a')]);_0x349cdf[_0x08c5('0x2d')]=_[_0x08c5('0x2e')](_0x349cdf[_0x08c5('0x28')],_0x349cdf[_0x08c5('0x2a')]);_0x1012d5[_0x08c5('0x2f')]=_[_0x08c5('0x2e')](_0x349cdf[_0x08c5('0x28')],qs[_0x08c5('0x30')](_0x27489c['query'][_0x08c5('0x30')]));_0x1012d5[_0x08c5('0x2f')]=_0x1012d5[_0x08c5('0x2f')]['length']?_0x1012d5[_0x08c5('0x2f')]:_0x349cdf[_0x08c5('0x28')];if(_0x27489c[_0x08c5('0x2a')][_0x08c5('0x3c')]){_0x1012d5[_0x08c5('0x3d')]=[{'all':!![]}];}_0x1012d5=_[_0x08c5('0x38')]({},_0x1012d5,_0x27489c['options']);return db[_0x08c5('0x3b')]['find'](_0x1012d5)['then'](handleEntityNotFound(_0x256019,null))[_0x08c5('0x23')](respondWithResult(_0x256019,null))[_0x08c5('0x40')](handleError(_0x256019,null));};exports['create']=function(_0x34bc0d,_0x53b94d){return db[_0x08c5('0x3b')]['create'](_0x34bc0d[_0x08c5('0x42')],{})[_0x08c5('0x23')](respondWithResult(_0x53b94d,0xc9))[_0x08c5('0x40')](handleError(_0x53b94d,null));};exports[_0x08c5('0x43')]=function(_0x25d5c7,_0x264505){var _0x2b681f={'raw':![],'where':{'id':_0x25d5c7[_0x08c5('0x41')]['id']}},_0x380465={};_0x380465[_0x08c5('0x28')]=_['keys'](db[_0x08c5('0x3b')][_0x08c5('0x44')]);_0x2b681f[_0x08c5('0x2f')]=_[_0x08c5('0x2e')](_0x380465[_0x08c5('0x28')],qs['fields'](_0x25d5c7[_0x08c5('0x2a')][_0x08c5('0x30')]));_0x2b681f[_0x08c5('0x2f')]=_0x2b681f[_0x08c5('0x2f')][_0x08c5('0x45')]?_0x2b681f['attributes']:_0x380465[_0x08c5('0x28')];if(_0x25d5c7[_0x08c5('0x2a')][_0x08c5('0x3c')]){_0x2b681f[_0x08c5('0x3d')]=[{'all':!![]}];}_0x2b681f=_[_0x08c5('0x38')]({},_0x2b681f,_0x25d5c7[_0x08c5('0x46')]);return db['VoiceQueue']['find'](_0x2b681f)[_0x08c5('0x23')](handleEntityNotFound(_0x264505,null))[_0x08c5('0x23')](function(_0x4a4bf1){if(_0x4a4bf1){var _0x5c1193=_0x4a4bf1[_0x08c5('0x47')]({'plain':!![]});_0x5c1193=qs[_0x08c5('0x48')](_0x5c1193,['id',_0x08c5('0x49'),_0x08c5('0x4a')]);_0x25d5c7[_0x08c5('0x42')]=_[_0x08c5('0x48')](_0x25d5c7[_0x08c5('0x42')],['id',_0x08c5('0x49'),_0x08c5('0x4a')]);return db[_0x08c5('0x3b')][_0x08c5('0x4b')](_[_0x08c5('0x38')](_0x5c1193,_0x25d5c7[_0x08c5('0x42')]),{'include':_0x25d5c7[_0x08c5('0x2a')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x08c5('0x23')](respondWithResult(_0x264505,0xc9))[_0x08c5('0x40')](handleError(_0x264505,null));};exports[_0x08c5('0x21')]=function(_0x347993,_0x45ca1c){if(_0x347993[_0x08c5('0x42')]['id']){delete _0x347993[_0x08c5('0x42')]['id'];}return db[_0x08c5('0x3b')][_0x08c5('0x4c')]({'where':{'id':_0x347993[_0x08c5('0x41')]['id']}})[_0x08c5('0x23')](handleEntityNotFound(_0x45ca1c,null))[_0x08c5('0x23')](saveUpdates(_0x347993[_0x08c5('0x42')],null))[_0x08c5('0x23')](respondWithResult(_0x45ca1c,null))[_0x08c5('0x40')](handleError(_0x45ca1c,null));};exports['destroy']=function(_0x3fd9c3,_0x3ae289){return db[_0x08c5('0x3b')][_0x08c5('0x4c')]({'where':{'id':_0x3fd9c3['params']['id']}})[_0x08c5('0x23')](handleEntityNotFound(_0x3ae289,null))[_0x08c5('0x23')](removeEntity(_0x3ae289,null))['catch'](handleError(_0x3ae289,null));};exports[_0x08c5('0x4d')]=function(_0x4c08dd,_0x5cce55,_0x2fcb37){var _0xbbeeca={'raw':![],'where':{}};var _0x7e9c82={};var _0x4d12d2={'count':0x0,'rows':[]};return db[_0x08c5('0x3b')][_0x08c5('0x4e')]({'where':{'id':_0x4c08dd[_0x08c5('0x41')]['id']}})[_0x08c5('0x23')](handleEntityNotFound(_0x5cce55,null))[_0x08c5('0x23')](function(_0xd28366){if(_0xd28366){_0x7e9c82[_0x08c5('0x28')]=_[_0x08c5('0x29')](db[_0x08c5('0x4f')][_0x08c5('0x44')]);_0x7e9c82['query']=_[_0x08c5('0x29')](_0x4c08dd[_0x08c5('0x2a')]);_0x7e9c82[_0x08c5('0x2d')]=_[_0x08c5('0x2e')](_0x7e9c82[_0x08c5('0x28')],_0x7e9c82[_0x08c5('0x2a')]);_0xbbeeca[_0x08c5('0x2f')]=_[_0x08c5('0x2e')](_0x7e9c82[_0x08c5('0x28')],qs['fields'](_0x4c08dd[_0x08c5('0x2a')][_0x08c5('0x30')]));_0xbbeeca[_0x08c5('0x2f')]=_0xbbeeca['attributes']['length']?_0xbbeeca[_0x08c5('0x2f')]:_0x7e9c82[_0x08c5('0x28')];if(!_0x4c08dd[_0x08c5('0x2a')]['hasOwnProperty'](_0x08c5('0x32'))){_0xbbeeca[_0x08c5('0x1b')]=qs[_0x08c5('0x1b')](_0x4c08dd['query'][_0x08c5('0x1b')]);_0xbbeeca[_0x08c5('0x1a')]=qs[_0x08c5('0x1a')](_0x4c08dd[_0x08c5('0x2a')][_0x08c5('0x1a')]);}_0xbbeeca['order']=qs[_0x08c5('0x33')](_0x4c08dd[_0x08c5('0x2a')]['sort']);_0xbbeeca[_0x08c5('0x34')]=qs[_0x08c5('0x2d')](_[_0x08c5('0x35')](_0x4c08dd['query'],_0x7e9c82[_0x08c5('0x2d')]));_0xbbeeca[_0x08c5('0x34')][_0x08c5('0x50')]=_0xd28366['id'];if(_0x4c08dd[_0x08c5('0x2a')][_0x08c5('0x39')]){_0xbbeeca[_0x08c5('0x34')]=_['merge'](_0xbbeeca[_0x08c5('0x34')],{'$or':_[_0x08c5('0x3a')](_0xbbeeca[_0x08c5('0x2f')],function(_0x909c62){var _0x44ebf2={};_0x44ebf2[_0x909c62]={'$like':'%'+_0x4c08dd[_0x08c5('0x2a')][_0x08c5('0x39')]+'%'};return _0x44ebf2;})});}_0xbbeeca=_[_0x08c5('0x38')]({},_0xbbeeca,_0x4c08dd[_0x08c5('0x46')]);return db[_0x08c5('0x4f')][_0x08c5('0x19')]({'where':_0xbbeeca[_0x08c5('0x34')]})[_0x08c5('0x23')](function(_0x59c90d){_0x4d12d2[_0x08c5('0x19')]=_0x59c90d;if(_0x4c08dd['query'][_0x08c5('0x3c')]){_0xbbeeca[_0x08c5('0x3d')]=[{'all':!![]}];}return db['CmHopper'][_0x08c5('0x3e')](_0xbbeeca);})[_0x08c5('0x23')](function(_0x158f9f){_0x4d12d2[_0x08c5('0x3f')]=_0x158f9f;return _0x4d12d2;});}})[_0x08c5('0x23')](respondWithFilteredResult(_0x5cce55,_0xbbeeca))['catch'](handleError(_0x5cce55,null));};exports['getHopperHistories']=function(_0x3df8a3,_0x5160f1,_0x3d6fb4){var _0x2f3098={'raw':!![],'where':{}};var _0x591122={};var _0x97cf97={'count':0x0,'rows':[]};return db[_0x08c5('0x3b')][_0x08c5('0x4e')]({'where':{'id':_0x3df8a3[_0x08c5('0x41')]['id']}})[_0x08c5('0x23')](handleEntityNotFound(_0x5160f1,null))[_0x08c5('0x23')](function(_0x1dc924){if(_0x1dc924){_0x591122[_0x08c5('0x28')]=_[_0x08c5('0x29')](db[_0x08c5('0x51')][_0x08c5('0x44')]);_0x591122['query']=_[_0x08c5('0x29')](_0x3df8a3['query']);_0x591122[_0x08c5('0x2d')]=_['intersection'](_0x591122[_0x08c5('0x28')],_0x591122[_0x08c5('0x2a')]);_0x2f3098[_0x08c5('0x2f')]=_[_0x08c5('0x2e')](_0x591122[_0x08c5('0x28')],qs[_0x08c5('0x30')](_0x3df8a3[_0x08c5('0x2a')]['fields']));_0x2f3098['attributes']=_0x2f3098[_0x08c5('0x2f')][_0x08c5('0x45')]?_0x2f3098[_0x08c5('0x2f')]:_0x591122['model'];if(!_0x3df8a3[_0x08c5('0x2a')][_0x08c5('0x31')]('nolimit')){_0x2f3098[_0x08c5('0x1b')]=qs[_0x08c5('0x1b')](_0x3df8a3['query']['limit']);_0x2f3098[_0x08c5('0x1a')]=qs['offset'](_0x3df8a3['query'][_0x08c5('0x1a')]);}_0x2f3098[_0x08c5('0x52')]=qs['sort'](_0x3df8a3['query'][_0x08c5('0x33')]);_0x2f3098[_0x08c5('0x34')]=qs[_0x08c5('0x2d')](_[_0x08c5('0x35')](_0x3df8a3[_0x08c5('0x2a')],_0x591122[_0x08c5('0x2d')]));_0x2f3098[_0x08c5('0x34')][_0x08c5('0x50')]=_0x1dc924['id'];if(_0x3df8a3['query'][_0x08c5('0x39')]){_0x2f3098[_0x08c5('0x34')]=_[_0x08c5('0x38')](_0x2f3098['where'],{'$or':_['map'](_0x2f3098['attributes'],function(_0x26c32f){var _0x278ab0={};_0x278ab0[_0x26c32f]={'$like':'%'+_0x3df8a3['query'][_0x08c5('0x39')]+'%'};return _0x278ab0;})});}_0x2f3098=_[_0x08c5('0x38')]({},_0x2f3098,_0x3df8a3[_0x08c5('0x46')]);return db[_0x08c5('0x51')]['count']({'where':_0x2f3098[_0x08c5('0x34')]})[_0x08c5('0x23')](function(_0x1e4217){_0x97cf97[_0x08c5('0x19')]=_0x1e4217;if(_0x3df8a3[_0x08c5('0x2a')][_0x08c5('0x3c')]){_0x2f3098[_0x08c5('0x3d')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x08c5('0x3e')](_0x2f3098);})[_0x08c5('0x23')](function(_0x3f1a67){_0x97cf97[_0x08c5('0x3f')]=_0x3f1a67;return _0x97cf97;});}})['then'](respondWithFilteredResult(_0x5160f1,_0x2f3098))[_0x08c5('0x40')](handleError(_0x5160f1,null));};exports[_0x08c5('0x53')]=function(_0x5b4de9,_0x428a15,_0x1c0d7a){var _0x35d8c2={'raw':!![],'where':{}};var _0x32a583={};var _0x156882={'count':0x0,'rows':[]};return db[_0x08c5('0x3b')][_0x08c5('0x4e')]({'where':{'id':_0x5b4de9[_0x08c5('0x41')]['id']}})['then'](handleEntityNotFound(_0x428a15,null))[_0x08c5('0x23')](function(_0x46d55c){if(_0x46d55c){_0x32a583[_0x08c5('0x28')]=_[_0x08c5('0x29')](db[_0x08c5('0x54')][_0x08c5('0x44')]);_0x32a583[_0x08c5('0x2a')]=_[_0x08c5('0x29')](_0x5b4de9['query']);_0x32a583['filters']=_['intersection'](_0x32a583[_0x08c5('0x28')],_0x32a583[_0x08c5('0x2a')]);_0x35d8c2[_0x08c5('0x2f')]=_[_0x08c5('0x2e')](_0x32a583[_0x08c5('0x28')],qs[_0x08c5('0x30')](_0x5b4de9[_0x08c5('0x2a')][_0x08c5('0x30')]));_0x35d8c2['attributes']=_0x35d8c2[_0x08c5('0x2f')]['length']?_0x35d8c2[_0x08c5('0x2f')]:_0x32a583[_0x08c5('0x28')];if(!_0x5b4de9[_0x08c5('0x2a')][_0x08c5('0x31')](_0x08c5('0x32'))){_0x35d8c2['limit']=qs['limit'](_0x5b4de9[_0x08c5('0x2a')][_0x08c5('0x1b')]);_0x35d8c2['offset']=qs['offset'](_0x5b4de9['query']['offset']);}_0x35d8c2['order']=qs[_0x08c5('0x33')](_0x5b4de9[_0x08c5('0x2a')]['sort']);_0x35d8c2[_0x08c5('0x34')]=qs[_0x08c5('0x2d')](_[_0x08c5('0x35')](_0x5b4de9['query'],_0x32a583[_0x08c5('0x2d')]));_0x35d8c2[_0x08c5('0x34')][_0x08c5('0x50')]=_0x46d55c['id'];if(_0x5b4de9[_0x08c5('0x2a')][_0x08c5('0x39')]){_0x35d8c2[_0x08c5('0x34')]=_[_0x08c5('0x38')](_0x35d8c2['where'],{'$or':_[_0x08c5('0x3a')](_0x35d8c2[_0x08c5('0x2f')],function(_0x2e0664){var _0x451924={};_0x451924[_0x2e0664]={'$like':'%'+_0x5b4de9[_0x08c5('0x2a')][_0x08c5('0x39')]+'%'};return _0x451924;})});}_0x35d8c2=_[_0x08c5('0x38')]({},_0x35d8c2,_0x5b4de9[_0x08c5('0x46')]);return db['CmHopperFinal']['count']({'where':_0x35d8c2[_0x08c5('0x34')]})[_0x08c5('0x23')](function(_0x21cc47){_0x156882[_0x08c5('0x19')]=_0x21cc47;if(_0x5b4de9[_0x08c5('0x2a')][_0x08c5('0x3c')]){_0x35d8c2[_0x08c5('0x3d')]=[{'all':!![]}];}return db[_0x08c5('0x54')][_0x08c5('0x3e')](_0x35d8c2);})[_0x08c5('0x23')](function(_0x460e6c){_0x156882[_0x08c5('0x3f')]=_0x460e6c;return _0x156882;});}})['then'](respondWithFilteredResult(_0x428a15,_0x35d8c2))[_0x08c5('0x40')](handleError(_0x428a15,null));};exports['getHopperBlacks']=function(_0x2f6a5e,_0x188fd4,_0x6540f4){var _0x3cf0ae={'raw':!![],'where':{}};var _0x50e52c={};var _0x744b60={'count':0x0,'rows':[]};return db[_0x08c5('0x3b')]['findOne']({'where':{'id':_0x2f6a5e['params']['id']}})[_0x08c5('0x23')](handleEntityNotFound(_0x188fd4,null))[_0x08c5('0x23')](function(_0x4b01be){if(_0x4b01be){_0x50e52c[_0x08c5('0x28')]=_['keys'](db[_0x08c5('0x55')][_0x08c5('0x44')]);_0x50e52c['query']=_[_0x08c5('0x29')](_0x2f6a5e[_0x08c5('0x2a')]);_0x50e52c['filters']=_['intersection'](_0x50e52c[_0x08c5('0x28')],_0x50e52c['query']);_0x3cf0ae['attributes']=_['intersection'](_0x50e52c['model'],qs[_0x08c5('0x30')](_0x2f6a5e[_0x08c5('0x2a')][_0x08c5('0x30')]));_0x3cf0ae[_0x08c5('0x2f')]=_0x3cf0ae[_0x08c5('0x2f')][_0x08c5('0x45')]?_0x3cf0ae[_0x08c5('0x2f')]:_0x50e52c[_0x08c5('0x28')];if(!_0x2f6a5e[_0x08c5('0x2a')][_0x08c5('0x31')]('nolimit')){_0x3cf0ae[_0x08c5('0x1b')]=qs[_0x08c5('0x1b')](_0x2f6a5e['query'][_0x08c5('0x1b')]);_0x3cf0ae[_0x08c5('0x1a')]=qs[_0x08c5('0x1a')](_0x2f6a5e[_0x08c5('0x2a')]['offset']);}_0x3cf0ae['order']=qs[_0x08c5('0x33')](_0x2f6a5e[_0x08c5('0x2a')][_0x08c5('0x33')]);_0x3cf0ae[_0x08c5('0x34')]=qs[_0x08c5('0x2d')](_[_0x08c5('0x35')](_0x2f6a5e['query'],_0x50e52c['filters']));_0x3cf0ae[_0x08c5('0x34')][_0x08c5('0x50')]=_0x4b01be['id'];if(_0x2f6a5e['query'][_0x08c5('0x39')]){_0x3cf0ae['where']=_[_0x08c5('0x38')](_0x3cf0ae[_0x08c5('0x34')],{'$or':_[_0x08c5('0x3a')](_0x3cf0ae[_0x08c5('0x2f')],function(_0x2f1e71){var _0x12b3f5={};_0x12b3f5[_0x2f1e71]={'$like':'%'+_0x2f6a5e[_0x08c5('0x2a')]['filter']+'%'};return _0x12b3f5;})});}_0x3cf0ae=_['merge']({},_0x3cf0ae,_0x2f6a5e[_0x08c5('0x46')]);return db['CmHopperBlack'][_0x08c5('0x19')]({'where':_0x3cf0ae['where']})[_0x08c5('0x23')](function(_0x4c4205){_0x744b60[_0x08c5('0x19')]=_0x4c4205;if(_0x2f6a5e[_0x08c5('0x2a')][_0x08c5('0x3c')]){_0x3cf0ae[_0x08c5('0x3d')]=[{'all':!![]}];}return db[_0x08c5('0x55')][_0x08c5('0x3e')](_0x3cf0ae);})[_0x08c5('0x23')](function(_0x3fe2cb){_0x744b60['rows']=_0x3fe2cb;return _0x744b60;});}})[_0x08c5('0x23')](respondWithFilteredResult(_0x188fd4,_0x3cf0ae))[_0x08c5('0x40')](handleError(_0x188fd4,null));};exports[_0x08c5('0x56')]=function(_0x4cbfef,_0x351e9b,_0x455951){var _0x3fe1ba={};var _0x480e97={};var _0x599d6c;var _0x27334d;return db['VoiceQueue'][_0x08c5('0x4e')]({'where':{'id':_0x4cbfef['params']['id']}})[_0x08c5('0x23')](handleEntityNotFound(_0x351e9b,null))['then'](function(_0x2fc97d){if(_0x2fc97d){_0x599d6c=_0x2fc97d;_0x480e97[_0x08c5('0x28')]=_['keys'](db[_0x08c5('0x57')][_0x08c5('0x44')]);_0x480e97[_0x08c5('0x2a')]=_[_0x08c5('0x29')](_0x4cbfef['query']);_0x480e97['filters']=_[_0x08c5('0x2e')](_0x480e97['model'],_0x480e97[_0x08c5('0x2a')]);_0x3fe1ba['attributes']=_['intersection'](_0x480e97[_0x08c5('0x28')],qs['fields'](_0x4cbfef['query'][_0x08c5('0x30')]));_0x3fe1ba[_0x08c5('0x2f')]=_0x3fe1ba[_0x08c5('0x2f')][_0x08c5('0x45')]?_0x3fe1ba[_0x08c5('0x2f')]:_0x480e97['model'];_0x3fe1ba['order']=qs[_0x08c5('0x33')](_0x4cbfef[_0x08c5('0x2a')][_0x08c5('0x33')]);_0x3fe1ba[_0x08c5('0x34')]=qs[_0x08c5('0x2d')](_[_0x08c5('0x35')](_0x4cbfef[_0x08c5('0x2a')],_0x480e97[_0x08c5('0x2d')]));if(_0x4cbfef[_0x08c5('0x2a')][_0x08c5('0x39')]){_0x3fe1ba[_0x08c5('0x34')]=_[_0x08c5('0x38')](_0x3fe1ba[_0x08c5('0x34')],{'$or':_[_0x08c5('0x3a')](_0x3fe1ba[_0x08c5('0x2f')],function(_0x1c8378){var _0x36695c={};_0x36695c[_0x1c8378]={'$like':'%'+_0x4cbfef[_0x08c5('0x2a')][_0x08c5('0x39')]+'%'};return _0x36695c;})});}_0x3fe1ba=_[_0x08c5('0x38')]({},_0x3fe1ba,_0x4cbfef[_0x08c5('0x46')]);return _0x599d6c[_0x08c5('0x56')](_0x3fe1ba);}})['then'](function(_0x1ff664){if(_0x1ff664){_0x27334d=_0x1ff664[_0x08c5('0x45')];if(!_0x4cbfef[_0x08c5('0x2a')]['hasOwnProperty'](_0x08c5('0x32'))){_0x3fe1ba[_0x08c5('0x1b')]=qs[_0x08c5('0x1b')](_0x4cbfef['query'][_0x08c5('0x1b')]);_0x3fe1ba[_0x08c5('0x1a')]=qs[_0x08c5('0x1a')](_0x4cbfef['query'][_0x08c5('0x1a')]);}return _0x599d6c['getTeams'](_0x3fe1ba);}})[_0x08c5('0x23')](function(_0x23f96a){if(_0x23f96a){return _0x23f96a?{'count':_0x27334d,'rows':_0x23f96a}:null;}})[_0x08c5('0x23')](respondWithResult(_0x351e9b,null))['catch'](handleError(_0x351e9b,null));};exports[_0x08c5('0x58')]=function(_0x5aaf40,_0x19070f,_0x338173){var _0x3a3bff=[];var _0x2f406a;return db[_0x08c5('0x57')]['findAll']({'where':{'id':_0x5aaf40[_0x08c5('0x42')][_0x08c5('0x59')]},'attributes':['id'],'include':[{'model':db[_0x08c5('0x5a')],'as':_0x08c5('0x5b'),'attributes':['id'],'raw':!![]}]})[_0x08c5('0x23')](function(_0x1262e5){if(_0x1262e5){for(var _0x18ccbb=0x0;_0x18ccbb<_0x1262e5[_0x08c5('0x45')];_0x18ccbb+=0x1){for(var _0x23763f=0x0;_0x23763f<_0x1262e5[_0x18ccbb][_0x08c5('0x5b')][_0x08c5('0x45')];_0x23763f+=0x1){_0x3a3bff=_[_0x08c5('0x5c')](_0x3a3bff,[_0x1262e5[_0x18ccbb]['Agents'][_0x23763f]['id']]);}}return _0x3a3bff;}})[_0x08c5('0x23')](function(_0x154352){if(_0x154352){return db['VoiceQueue'][_0x08c5('0x4c')]({'where':{'id':_0x5aaf40[_0x08c5('0x41')]['id']}});}})['then'](function(_0x36597a){if(_0x36597a){_0x2f406a=_0x36597a;return _0x2f406a[_0x08c5('0x5d')](_0x3a3bff,{'penalty':_0x5aaf40[_0x08c5('0x42')][_0x08c5('0x5e')]});}})[_0x08c5('0x23')](function(_0x13e81b){if(_0x13e81b){return _0x2f406a[_0x08c5('0x58')](_0x5aaf40[_0x08c5('0x42')][_0x08c5('0x59')]);}})[_0x08c5('0x23')](handleEntityNotFound(_0x19070f,null))[_0x08c5('0x23')](respondWithStatusCode(_0x19070f,null))['catch'](handleError(_0x19070f,null));};exports[_0x08c5('0x5f')]=function(_0x29a6ac,_0x34cbb7,_0x184e03){var _0x1bc8d1=[];var _0x305e0e;return db[_0x08c5('0x57')][_0x08c5('0x3e')]({'where':{'id':_0x29a6ac['query'][_0x08c5('0x59')]},'attributes':['id'],'include':[{'model':db[_0x08c5('0x5a')],'as':_0x08c5('0x5b'),'attributes':['id'],'raw':!![]}]})[_0x08c5('0x23')](function(_0x3b740a){if(_0x3b740a){for(var _0x446063=0x0;_0x446063<_0x3b740a[_0x08c5('0x45')];_0x446063+=0x1){for(var _0x5d6f10=0x0;_0x5d6f10<_0x3b740a[_0x446063][_0x08c5('0x5b')][_0x08c5('0x45')];_0x5d6f10+=0x1){_0x1bc8d1=_[_0x08c5('0x5c')](_0x1bc8d1,[_0x3b740a[_0x446063][_0x08c5('0x5b')][_0x5d6f10]['id']]);}}return _0x1bc8d1;}})[_0x08c5('0x23')](function(_0x2099ed){if(_0x2099ed){return db['VoiceQueue'][_0x08c5('0x4c')]({'where':{'id':_0x29a6ac[_0x08c5('0x41')]['id']}});}})['then'](function(_0xf00896){if(_0xf00896){_0x305e0e=_0xf00896;return _0x305e0e[_0x08c5('0x60')](_0x1bc8d1);}})['then'](function(_0x423f26){if(_0x305e0e){return _0x305e0e[_0x08c5('0x5f')](_0x29a6ac[_0x08c5('0x2a')][_0x08c5('0x59')]);}})['then'](handleEntityNotFound(_0x34cbb7,null))[_0x08c5('0x23')](respondWithStatusCode(_0x34cbb7,null))[_0x08c5('0x40')](handleError(_0x34cbb7,null));};exports['addAgents']=function(_0x37ff00,_0x1657ee,_0x23e4cd){var _0x3b31b6,_0x509c27;return db['VoiceQueue'][_0x08c5('0x4c')]({'where':{'id':_0x37ff00[_0x08c5('0x41')]['id']}})[_0x08c5('0x23')](handleEntityNotFound(_0x1657ee,null))[_0x08c5('0x23')](function(_0x5938f1){if(_0x5938f1){_0x509c27=_0x5938f1;return _0x5938f1[_0x08c5('0x5d')](_0x37ff00['body'][_0x08c5('0x59')],_['omit'](_0x37ff00[_0x08c5('0x42')],[_0x08c5('0x59'),'id'])||{})['spread'](function(_0x35d7bc){for(var _0x58ad5c=0x0;_0x58ad5c<_0x37ff00[_0x08c5('0x42')][_0x08c5('0x59')][_0x08c5('0x45')];_0x58ad5c+=0x1){socket['emit'](_0x08c5('0x61'),{'UserId':_0x37ff00[_0x08c5('0x42')][_0x08c5('0x59')][_0x58ad5c],'VoiceQueueId':_0x37ff00[_0x08c5('0x41')]['id']});}return _0x35d7bc;});}})[_0x08c5('0x23')](function(_0x5ee313){_0x3b31b6=_0x5ee313||[];if(_0x509c27){return db[_0x08c5('0x5a')]['findAll']({'where':{'id':_0x37ff00[_0x08c5('0x42')]['ids']},'attributes':['id',_0x08c5('0x26'),_0x08c5('0x62'),'voicePause'],'raw':!![]});}})['then'](function(_0x50f8be){if(_0x50f8be&&_0x50f8be['length']){var _0x15b6aa=[];for(var _0x9d5361=0x0;_0x9d5361<_0x50f8be['length'];_0x9d5361++){_0x15b6aa[_0x08c5('0x63')](db[_0x08c5('0x64')][_0x08c5('0x65')]({'membername':_0x50f8be[_0x9d5361][_0x08c5('0x26')],'UserId':_0x50f8be[_0x9d5361]['id'],'queue_name':_0x509c27[_0x08c5('0x26')],'VoiceQueueId':_0x509c27['id'],'interface':util[_0x08c5('0x66')](_0x08c5('0x67'),_0x08c5('0x68'),_0x50f8be[_0x9d5361][_0x08c5('0x26')]),'paused':_0x50f8be[_0x9d5361][_0x08c5('0x69')]||![],'penalty':_0x37ff00[_0x08c5('0x42')][_0x08c5('0x5e')]||0x0}));}return BPromise[_0x08c5('0x6a')](_0x15b6aa);}})['then'](function(_0x1c5a4b){return _0x3b31b6;})[_0x08c5('0x23')](respondWithResult(_0x1657ee,null))['catch'](handleError(_0x1657ee,null));};exports[_0x08c5('0x60')]=function(_0x1c67b7,_0x143cbb,_0x4b0dcd){var _0x4cb215;return db['VoiceQueue'][_0x08c5('0x4c')]({'where':{'id':_0x1c67b7[_0x08c5('0x41')]['id']}})[_0x08c5('0x23')](handleEntityNotFound(_0x143cbb,null))[_0x08c5('0x23')](function(_0x31539e){if(_0x31539e){return _0x31539e[_0x08c5('0x60')](_0x1c67b7[_0x08c5('0x2a')]['ids'])[_0x08c5('0x23')](function(_0x440c08){if(_[_0x08c5('0x6b')](_0x1c67b7[_0x08c5('0x2a')][_0x08c5('0x59')])){for(var _0x19c832=0x0;_0x19c832<_0x1c67b7[_0x08c5('0x2a')]['ids'][_0x08c5('0x45')];_0x19c832+=0x1){socket[_0x08c5('0x6c')](_0x08c5('0x6d'),{'UserId':_0x1c67b7[_0x08c5('0x2a')]['ids'][_0x19c832],'VoiceQueueId':_0x1c67b7[_0x08c5('0x41')]['id']});}}else{socket['emit'](_0x08c5('0x6d'),{'UserId':_0x1c67b7[_0x08c5('0x2a')][_0x08c5('0x59')],'VoiceQueueId':_0x1c67b7['params']['id']});}});}})[_0x08c5('0x23')](function(_0x578ee6){if(_0x1c67b7[_0x08c5('0x2a')][_0x08c5('0x6e')]){_0x4cb215=_0x578ee6;return db[_0x08c5('0x64')][_0x08c5('0x22')]({'where':{'VoiceQueueId':_0x1c67b7['params']['id'],'UserId':_0x1c67b7[_0x08c5('0x2a')][_0x08c5('0x59')]}})[_0x08c5('0x23')](function(){return _0x4cb215;});}})[_0x08c5('0x23')](respondWithStatusCode(_0x143cbb,null))['catch'](handleError(_0x143cbb,null));};exports[_0x08c5('0x6f')]=function(_0x58eee2,_0x4f27b8,_0x42ff98){var _0x56fece={};var _0x3e5e3a={};var _0x2dc85c;var _0x1207b6;return db['VoiceQueue'][_0x08c5('0x4e')]({'where':{'id':_0x58eee2[_0x08c5('0x41')]['id']}})[_0x08c5('0x23')](handleEntityNotFound(_0x4f27b8,null))[_0x08c5('0x23')](function(_0xca1f9d){if(_0xca1f9d){_0x2dc85c=_0xca1f9d;_0x3e5e3a[_0x08c5('0x28')]=_[_0x08c5('0x29')](db['User'][_0x08c5('0x44')]);_0x3e5e3a[_0x08c5('0x2a')]=_[_0x08c5('0x29')](_0x58eee2['query']);_0x3e5e3a[_0x08c5('0x2d')]=_['intersection'](_0x3e5e3a[_0x08c5('0x28')],_0x3e5e3a['query']);_0x56fece['attributes']=_[_0x08c5('0x2e')](_0x3e5e3a[_0x08c5('0x28')],qs[_0x08c5('0x30')](_0x58eee2['query']['fields']));_0x56fece[_0x08c5('0x2f')]=_0x56fece[_0x08c5('0x2f')][_0x08c5('0x45')]?_0x56fece[_0x08c5('0x2f')]:_0x3e5e3a[_0x08c5('0x28')];_0x56fece[_0x08c5('0x52')]=qs[_0x08c5('0x33')](_0x58eee2['query'][_0x08c5('0x33')]);_0x56fece['where']=qs[_0x08c5('0x2d')](_[_0x08c5('0x35')](_0x58eee2[_0x08c5('0x2a')],_0x3e5e3a['filters']));if(_0x58eee2[_0x08c5('0x2a')][_0x08c5('0x39')]){_0x56fece[_0x08c5('0x34')]=_[_0x08c5('0x38')](_0x56fece[_0x08c5('0x34')],{'$or':_[_0x08c5('0x3a')](_0x56fece[_0x08c5('0x2f')],function(_0x38dec7){var _0x547a5a={};_0x547a5a[_0x38dec7]={'$like':'%'+_0x58eee2[_0x08c5('0x2a')][_0x08c5('0x39')]+'%'};return _0x547a5a;})});}_0x56fece=_[_0x08c5('0x38')]({},_0x56fece,_0x58eee2[_0x08c5('0x46')]);return _0x2dc85c[_0x08c5('0x6f')](_0x56fece);}})[_0x08c5('0x23')](function(_0x1602d9){if(_0x1602d9){_0x1207b6=_0x1602d9[_0x08c5('0x45')];if(!_0x58eee2['query'][_0x08c5('0x31')](_0x08c5('0x32'))){_0x56fece[_0x08c5('0x1b')]=qs[_0x08c5('0x1b')](_0x58eee2['query']['limit']);_0x56fece[_0x08c5('0x1a')]=qs[_0x08c5('0x1a')](_0x58eee2['query'][_0x08c5('0x1a')]);}return _0x2dc85c[_0x08c5('0x6f')](_0x56fece);}})[_0x08c5('0x23')](function(_0x4634eb){if(_0x4634eb){return _0x4634eb?{'count':_0x1207b6,'rows':_0x4634eb}:null;}})[_0x08c5('0x23')](respondWithResult(_0x4f27b8,null))[_0x08c5('0x40')](handleError(_0x4f27b8,null));};exports[_0x08c5('0x70')]=function(_0x3ed0cf,_0x1c9001,_0x3df369){var _0x485b8b={};var _0x6e98ed={};var _0x315d9c;var _0x3b3ae8;return db[_0x08c5('0x3b')][_0x08c5('0x4e')]({'where':{'id':_0x3ed0cf['params']['id']}})[_0x08c5('0x23')](handleEntityNotFound(_0x1c9001,null))[_0x08c5('0x23')](function(_0x4418f2){if(_0x4418f2){_0x315d9c=_0x4418f2;_0x6e98ed['model']=_[_0x08c5('0x29')](db[_0x08c5('0x64')]['rawAttributes']);_0x6e98ed[_0x08c5('0x2a')]=_['keys'](_0x3ed0cf[_0x08c5('0x2a')]);_0x6e98ed[_0x08c5('0x2d')]=_[_0x08c5('0x2e')](_0x6e98ed['model'],_0x6e98ed[_0x08c5('0x2a')]);_0x485b8b[_0x08c5('0x2f')]=_[_0x08c5('0x2e')](_0x6e98ed[_0x08c5('0x28')],qs['fields'](_0x3ed0cf['query'][_0x08c5('0x30')]));_0x485b8b[_0x08c5('0x2f')]=_0x485b8b['attributes'][_0x08c5('0x45')]?_0x485b8b[_0x08c5('0x2f')]:_0x6e98ed[_0x08c5('0x28')];_0x485b8b[_0x08c5('0x52')]=qs[_0x08c5('0x33')](_0x3ed0cf[_0x08c5('0x2a')][_0x08c5('0x33')]);_0x485b8b[_0x08c5('0x34')]=qs['filters'](_['pick'](_0x3ed0cf['query'],_0x6e98ed[_0x08c5('0x2d')]));if(_0x3ed0cf['query'][_0x08c5('0x39')]){_0x485b8b['where']=_[_0x08c5('0x38')](_0x485b8b['where'],{'$or':_['map'](_0x485b8b[_0x08c5('0x2f')],function(_0x445ba5){var _0x5e952a={};_0x5e952a[_0x445ba5]={'$like':'%'+_0x3ed0cf[_0x08c5('0x2a')][_0x08c5('0x39')]+'%'};return _0x5e952a;})});}_0x485b8b=_['merge']({},_0x485b8b,_0x3ed0cf[_0x08c5('0x46')]);return _0x315d9c[_0x08c5('0x70')](_0x485b8b);}})[_0x08c5('0x23')](function(_0x24105b){if(_0x24105b){_0x3b3ae8=_0x24105b[_0x08c5('0x45')];if(!_0x3ed0cf[_0x08c5('0x2a')][_0x08c5('0x31')]('nolimit')){_0x485b8b[_0x08c5('0x1b')]=qs[_0x08c5('0x1b')](_0x3ed0cf[_0x08c5('0x2a')][_0x08c5('0x1b')]);_0x485b8b[_0x08c5('0x1a')]=qs[_0x08c5('0x1a')](_0x3ed0cf[_0x08c5('0x2a')][_0x08c5('0x1a')]);}return _0x315d9c[_0x08c5('0x70')](_0x485b8b);}})[_0x08c5('0x23')](function(_0x427351){return _0x427351?{'count':_0x3b3ae8,'rows':_0x427351}:null;})[_0x08c5('0x23')](respondWithResult(_0x1c9001,null))[_0x08c5('0x40')](handleError(_0x1c9001,null));};exports[_0x08c5('0x71')]=function(_0x167334,_0x81d08a,_0x37f00f){var _0x38abdb={};var _0x1c3edd={};var _0x37772e;var _0x4eafc3;return db['VoiceQueue'][_0x08c5('0x4e')]({'where':{'id':_0x167334['params']['id']}})[_0x08c5('0x23')](handleEntityNotFound(_0x81d08a,null))[_0x08c5('0x23')](function(_0x59263e){if(_0x59263e){_0x37772e=_0x59263e;_0x1c3edd['model']=_[_0x08c5('0x29')](db[_0x08c5('0x72')][_0x08c5('0x44')]);_0x1c3edd[_0x08c5('0x2a')]=_[_0x08c5('0x29')](_0x167334['query']);_0x1c3edd[_0x08c5('0x2d')]=_[_0x08c5('0x2e')](_0x1c3edd[_0x08c5('0x28')],_0x1c3edd[_0x08c5('0x2a')]);_0x38abdb['attributes']=_[_0x08c5('0x2e')](_0x1c3edd['model'],qs[_0x08c5('0x30')](_0x167334[_0x08c5('0x2a')][_0x08c5('0x30')]));_0x38abdb['attributes']=_0x38abdb[_0x08c5('0x2f')][_0x08c5('0x45')]?_0x38abdb[_0x08c5('0x2f')]:_0x1c3edd[_0x08c5('0x28')];_0x38abdb[_0x08c5('0x52')]=qs[_0x08c5('0x33')](_0x167334[_0x08c5('0x2a')][_0x08c5('0x33')]);_0x38abdb[_0x08c5('0x34')]=qs['filters'](_[_0x08c5('0x35')](_0x167334[_0x08c5('0x2a')],_0x1c3edd[_0x08c5('0x2d')]));if(_0x167334[_0x08c5('0x2a')][_0x08c5('0x39')]){_0x38abdb['where']=_[_0x08c5('0x38')](_0x38abdb[_0x08c5('0x34')],{'$or':_[_0x08c5('0x3a')](_0x38abdb[_0x08c5('0x2f')],function(_0x5bbedc){var _0x27ea23={};_0x27ea23[_0x5bbedc]={'$like':'%'+_0x167334[_0x08c5('0x2a')][_0x08c5('0x39')]+'%'};return _0x27ea23;})});}_0x38abdb=_['merge']({},_0x38abdb,_0x167334[_0x08c5('0x46')]);return _0x37772e[_0x08c5('0x71')](_0x38abdb);}})[_0x08c5('0x23')](function(_0x1e1a9d){if(_0x1e1a9d){_0x4eafc3=_0x1e1a9d['length'];if(!_0x167334[_0x08c5('0x2a')][_0x08c5('0x31')](_0x08c5('0x32'))){_0x38abdb[_0x08c5('0x1b')]=qs[_0x08c5('0x1b')](_0x167334[_0x08c5('0x2a')][_0x08c5('0x1b')]);_0x38abdb[_0x08c5('0x1a')]=qs[_0x08c5('0x1a')](_0x167334[_0x08c5('0x2a')][_0x08c5('0x1a')]);}return _0x37772e[_0x08c5('0x71')](_0x38abdb);}})[_0x08c5('0x23')](function(_0x276d97){if(_0x276d97){return _0x276d97?{'count':_0x4eafc3,'rows':_0x276d97}:null;}})[_0x08c5('0x23')](respondWithResult(_0x81d08a,null))['catch'](handleError(_0x81d08a,null));};exports[_0x08c5('0x73')]=function(_0x410cac,_0x288ab7,_0x333f57){var _0x45503f,_0x339b35;return db[_0x08c5('0x3b')][_0x08c5('0x4c')]({'where':{'id':_0x410cac[_0x08c5('0x41')]['id']}})[_0x08c5('0x23')](handleEntityNotFound(_0x288ab7,null))[_0x08c5('0x23')](function(_0x3da762){if(_0x3da762){_0x339b35=_0x3da762;return _0x3da762['addLists'](_0x410cac[_0x08c5('0x42')][_0x08c5('0x59')],_[_0x08c5('0x48')](_0x410cac[_0x08c5('0x42')],[_0x08c5('0x59'),'id'])||{});}return null;})[_0x08c5('0x74')](function(_0x817273){var _0x290893;_0x45503f=_0x817273||[];var _0x5b7cde=[];if(_0x817273){for(var _0x1ba4f9=0x0;_0x1ba4f9<_0x817273[_0x08c5('0x45')];_0x1ba4f9+=0x1){var _0x4374d7=_0x817273[_0x1ba4f9][_0x08c5('0x47')]({'plain':!![]});_0x339b35['dialCheckDuplicateType']=_0x410cac[_0x08c5('0x42')]['dialCheckDuplicateType']?_0x410cac[_0x08c5('0x42')][_0x08c5('0x75')]:_0x339b35[_0x08c5('0x75')];switch(_0x339b35[_0x08c5('0x75')]){case'always':_0x290893=squel['insert']()[_0x08c5('0x76')](_0x08c5('0x77'))[_0x08c5('0x78')](['phone','scheduledAt',_0x08c5('0x79'),_0x08c5('0x7a'),_0x08c5('0x50'),'createdAt',_0x08c5('0x4a')],squel[_0x08c5('0x7b')]()[_0x08c5('0x7c')](_0x08c5('0x7d'),'phone')['field'](_0x08c5('0x7e'),'scheduledAt')[_0x08c5('0x7c')]('id','ContactId')[_0x08c5('0x7c')](_0x4374d7[_0x08c5('0x7f')][_0x08c5('0x80')](),'ListId')[_0x08c5('0x7c')](_0x410cac[_0x08c5('0x41')]['id']['toString'](),'VoiceQueueId')[_0x08c5('0x7c')](_0x08c5('0x7e'),_0x08c5('0x49'))[_0x08c5('0x7c')](_0x08c5('0x7e'),_0x08c5('0x4a'))['from'](_0x08c5('0x81'))['where'](_0x08c5('0x82'))[_0x08c5('0x34')](_0x08c5('0x83'),_0x4374d7['CmListId'][_0x08c5('0x80')]())[_0x08c5('0x34')](_0x08c5('0x84'))[_0x08c5('0x34')](_0x08c5('0x85'),squel[_0x08c5('0x7b')]()[_0x08c5('0x7c')](_0x08c5('0x86'))[_0x08c5('0x87')](_0x08c5('0x88'))[_0x08c5('0x34')](_0x08c5('0x89'),_0x410cac[_0x08c5('0x41')]['id']['toString']()))[_0x08c5('0x34')]('phone\x20NOT\x20IN\x20(?)',squel[_0x08c5('0x7b')]()[_0x08c5('0x7c')]('phone')['from'](_0x08c5('0x77'))[_0x08c5('0x34')](_0x08c5('0x89'),_0x410cac[_0x08c5('0x41')]['id'][_0x08c5('0x80')]())))[_0x08c5('0x80')]();break;case _0x08c5('0x8a'):_0x290893=squel[_0x08c5('0x8b')]()[_0x08c5('0x76')](_0x08c5('0x77'))[_0x08c5('0x78')]([_0x08c5('0x7d'),_0x08c5('0x8c'),_0x08c5('0x79'),'ListId',_0x08c5('0x50'),_0x08c5('0x49'),_0x08c5('0x4a')],squel['select']()[_0x08c5('0x7c')](_0x08c5('0x7d'),_0x08c5('0x7d'))['field']('NOW()',_0x08c5('0x8c'))[_0x08c5('0x7c')]('id',_0x08c5('0x79'))[_0x08c5('0x7c')](_0x4374d7[_0x08c5('0x7f')][_0x08c5('0x80')](),_0x08c5('0x7a'))[_0x08c5('0x7c')](_0x410cac[_0x08c5('0x41')]['id'][_0x08c5('0x80')](),_0x08c5('0x50'))[_0x08c5('0x7c')](_0x08c5('0x7e'),_0x08c5('0x49'))[_0x08c5('0x7c')](_0x08c5('0x7e'),_0x08c5('0x4a'))['from'](_0x08c5('0x81'))['where'](_0x08c5('0x82'))[_0x08c5('0x34')](_0x08c5('0x83'),_0x4374d7['CmListId']['toString']())['where'](_0x08c5('0x84'))[_0x08c5('0x34')](_0x08c5('0x85'),squel[_0x08c5('0x7b')]()[_0x08c5('0x7c')](_0x08c5('0x7d'))[_0x08c5('0x87')](_0x08c5('0x77'))[_0x08c5('0x34')](_0x08c5('0x89'),_0x410cac[_0x08c5('0x41')]['id'][_0x08c5('0x80')]())))[_0x08c5('0x80')]();break;default:_0x290893=squel[_0x08c5('0x8b')]()[_0x08c5('0x76')]('cm_hopper')[_0x08c5('0x78')]([_0x08c5('0x7d'),'scheduledAt',_0x08c5('0x79'),_0x08c5('0x7a'),_0x08c5('0x50'),_0x08c5('0x49'),_0x08c5('0x4a')],squel['select']()[_0x08c5('0x7c')](_0x08c5('0x7d'),_0x08c5('0x7d'))['field'](_0x08c5('0x7e'),_0x08c5('0x8c'))[_0x08c5('0x7c')]('id','ContactId')['field'](_0x4374d7[_0x08c5('0x7f')][_0x08c5('0x80')](),_0x08c5('0x7a'))['field'](_0x410cac[_0x08c5('0x41')]['id']['toString'](),'VoiceQueueId')[_0x08c5('0x7c')](_0x08c5('0x7e'),_0x08c5('0x49'))[_0x08c5('0x7c')](_0x08c5('0x7e'),_0x08c5('0x4a'))[_0x08c5('0x87')]('cm_contacts')[_0x08c5('0x34')](_0x08c5('0x82'))['where'](_0x08c5('0x83'),_0x4374d7[_0x08c5('0x7f')][_0x08c5('0x80')]())['where'](_0x08c5('0x84')))[_0x08c5('0x80')]();}_0x5b7cde[_0x08c5('0x63')](db[_0x08c5('0x8d')][_0x08c5('0x2a')](_0x290893));}return BPromise[_0x08c5('0x6a')](_0x5b7cde);}})[_0x08c5('0x23')](function(){return _0x45503f;})[_0x08c5('0x23')](respondWithResult(_0x288ab7,null))[_0x08c5('0x40')](handleError(_0x288ab7,null));};exports[_0x08c5('0x8e')]=function(_0x59a84a,_0x4d6238,_0xd68f48){var _0x4de226;return db[_0x08c5('0x3b')]['find']({'where':{'id':_0x59a84a[_0x08c5('0x41')]['id']}})['then'](handleEntityNotFound(_0x4d6238,null))[_0x08c5('0x23')](function(_0x1259db){if(_0x1259db){return _0x1259db[_0x08c5('0x8e')](_0x59a84a[_0x08c5('0x2a')]['ids']);}})[_0x08c5('0x23')](function(_0x57aa88){if(_0x57aa88){_0x4de226=_0x57aa88;return db[_0x08c5('0x4f')][_0x08c5('0x22')]({'where':{'ListId':_0x59a84a[_0x08c5('0x2a')]['ids'],'VoiceQueueId':_0x59a84a[_0x08c5('0x41')]['id']}})[_0x08c5('0x23')](function(){return _0x4de226;});}})[_0x08c5('0x23')](respondWithStatusCode(_0x4d6238,null))[_0x08c5('0x40')](handleError(_0x4d6238,null));};exports['getBlackLists']=function(_0xbc2cbe,_0x2cfcf9,_0x6ae66b){var _0x34525c={};var _0x10abe4={};var _0x482499;var _0x42809a;return db[_0x08c5('0x3b')]['findOne']({'where':{'id':_0xbc2cbe[_0x08c5('0x41')]['id']}})['then'](handleEntityNotFound(_0x2cfcf9,null))['then'](function(_0xe72a66){if(_0xe72a66){_0x482499=_0xe72a66;_0x10abe4['model']=_[_0x08c5('0x29')](db[_0x08c5('0x72')][_0x08c5('0x44')]);_0x10abe4[_0x08c5('0x2a')]=_[_0x08c5('0x29')](_0xbc2cbe['query']);_0x10abe4[_0x08c5('0x2d')]=_[_0x08c5('0x2e')](_0x10abe4[_0x08c5('0x28')],_0x10abe4['query']);_0x34525c[_0x08c5('0x2f')]=_[_0x08c5('0x2e')](_0x10abe4[_0x08c5('0x28')],qs[_0x08c5('0x30')](_0xbc2cbe['query'][_0x08c5('0x30')]));_0x34525c[_0x08c5('0x2f')]=_0x34525c[_0x08c5('0x2f')][_0x08c5('0x45')]?_0x34525c[_0x08c5('0x2f')]:_0x10abe4['model'];_0x34525c[_0x08c5('0x52')]=qs['sort'](_0xbc2cbe[_0x08c5('0x2a')][_0x08c5('0x33')]);_0x34525c['where']=qs[_0x08c5('0x2d')](_[_0x08c5('0x35')](_0xbc2cbe[_0x08c5('0x2a')],_0x10abe4[_0x08c5('0x2d')]));if(_0xbc2cbe[_0x08c5('0x2a')][_0x08c5('0x39')]){_0x34525c[_0x08c5('0x34')]=_['merge'](_0x34525c[_0x08c5('0x34')],{'$or':_[_0x08c5('0x3a')](_0x34525c['attributes'],function(_0x4fca71){var _0xa598={};_0xa598[_0x4fca71]={'$like':'%'+_0xbc2cbe['query'][_0x08c5('0x39')]+'%'};return _0xa598;})});}_0x34525c=_['merge']({},_0x34525c,_0xbc2cbe['options']);return _0x482499[_0x08c5('0x8f')](_0x34525c);}})[_0x08c5('0x23')](function(_0x39ffe1){if(_0x39ffe1){_0x42809a=_0x39ffe1['length'];if(!_0xbc2cbe['query'][_0x08c5('0x31')](_0x08c5('0x32'))){_0x34525c[_0x08c5('0x1b')]=qs[_0x08c5('0x1b')](_0xbc2cbe[_0x08c5('0x2a')][_0x08c5('0x1b')]);_0x34525c[_0x08c5('0x1a')]=qs[_0x08c5('0x1a')](_0xbc2cbe[_0x08c5('0x2a')][_0x08c5('0x1a')]);}return _0x482499[_0x08c5('0x8f')](_0x34525c);}})[_0x08c5('0x23')](function(_0x5041fd){if(_0x5041fd){return _0x5041fd?{'count':_0x42809a,'rows':_0x5041fd}:null;}})[_0x08c5('0x23')](respondWithResult(_0x2cfcf9,null))[_0x08c5('0x40')](handleError(_0x2cfcf9,null));};exports[_0x08c5('0x90')]=function(_0x16ca86,_0x2969ea,_0x3357ca){var _0x50c856,_0xbdbf83;return db[_0x08c5('0x3b')][_0x08c5('0x4c')]({'where':{'id':_0x16ca86[_0x08c5('0x41')]['id']}})['then'](handleEntityNotFound(_0x2969ea,null))[_0x08c5('0x23')](function(_0x1ed8cc){if(_0x1ed8cc){_0xbdbf83=_0x1ed8cc;return _0x1ed8cc[_0x08c5('0x90')](_0x16ca86[_0x08c5('0x42')][_0x08c5('0x59')],_[_0x08c5('0x48')](_0x16ca86[_0x08c5('0x42')],['ids','id'])||{});}return null;})[_0x08c5('0x74')](function(_0x563fe2){var _0x20a2f5;_0x50c856=_0x563fe2||[];var _0x21452b=[];if(_0x563fe2){for(var _0x542904=0x0;_0x542904<_0x563fe2[_0x08c5('0x45')];_0x542904+=0x1){var _0x246ac1=_0x563fe2[_0x542904][_0x08c5('0x47')]({'plain':!![]});_0x20a2f5=squel[_0x08c5('0x8b')]()['into'](_0x08c5('0x91'))[_0x08c5('0x78')](['phone',_0x08c5('0x79'),_0x08c5('0x7a'),_0x08c5('0x50'),_0x08c5('0x49'),_0x08c5('0x4a')],squel[_0x08c5('0x7b')]()[_0x08c5('0x7c')](_0x08c5('0x7d'),_0x08c5('0x7d'))[_0x08c5('0x7c')]('id',_0x08c5('0x79'))[_0x08c5('0x7c')](_0x246ac1[_0x08c5('0x7f')]['toString'](),_0x08c5('0x7a'))['field'](_0x16ca86[_0x08c5('0x41')]['id'][_0x08c5('0x80')](),_0x08c5('0x50'))[_0x08c5('0x7c')](_0x08c5('0x7e'),_0x08c5('0x49'))[_0x08c5('0x7c')](_0x08c5('0x7e'),_0x08c5('0x4a'))['from'](_0x08c5('0x81'))[_0x08c5('0x34')](_0x08c5('0x82'))[_0x08c5('0x34')](_0x08c5('0x83'),_0x246ac1['CmListId']['toString']())[_0x08c5('0x34')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x21452b[_0x08c5('0x63')](db[_0x08c5('0x8d')]['query'](_0x20a2f5));}return BPromise['all'](_0x21452b);}})[_0x08c5('0x23')](function(){return _0x50c856;})[_0x08c5('0x23')](respondWithResult(_0x2969ea,null))[_0x08c5('0x40')](handleError(_0x2969ea,null));};exports[_0x08c5('0x92')]=function(_0x47ec1b,_0x177fec,_0x4aa3ce){var _0x41247f;return db[_0x08c5('0x3b')][_0x08c5('0x4c')]({'where':{'id':_0x47ec1b[_0x08c5('0x41')]['id']}})[_0x08c5('0x23')](handleEntityNotFound(_0x177fec,null))[_0x08c5('0x23')](function(_0xaa18b6){if(_0xaa18b6){return _0xaa18b6['removeBlackLists'](_0x47ec1b[_0x08c5('0x2a')][_0x08c5('0x59')]);}})[_0x08c5('0x23')](function(_0x47b483){if(_0x47b483){_0x41247f=_0x47b483;return db[_0x08c5('0x55')][_0x08c5('0x22')]({'where':{'ListId':_0x47ec1b[_0x08c5('0x2a')][_0x08c5('0x59')],'VoiceQueueId':_0x47ec1b[_0x08c5('0x41')]['id']}})[_0x08c5('0x23')](function(){return _0x41247f;});}})['then'](respondWithStatusCode(_0x177fec,null))['catch'](handleError(_0x177fec,null));};
\ No newline at end of file
index 6242876..53c0541 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ff1=['remove','emit','events','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x300633,_0x515abc){var _0x50d2b6=function(_0x4df281){while(--_0x4df281){_0x300633['push'](_0x300633['shift']());}};_0x50d2b6(++_0x515abc);}(_0x6ff1,0x10a));var _0x16ff=function(_0x822c9c,_0x5ca7a0){_0x822c9c=_0x822c9c-0x0;var _0x29aade=_0x6ff1[_0x822c9c];return _0x29aade;};'use strict';var EventEmitter=require(_0x16ff('0x0'));var VoiceQueue=require(_0x16ff('0x1'))['db'][_0x16ff('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x16ff('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x16ff('0x4')};function emitEvent(_0x5cca46){return function(_0x1db386,_0x2bf329,_0x335008){VoiceQueueEvents[_0x16ff('0x5')](_0x5cca46+':'+_0x1db386['id'],_0x1db386);VoiceQueueEvents['emit'](_0x5cca46,_0x1db386);_0x335008(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
+var _0xd23e=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x962dd2,_0x1018c3){var _0x4fe7ec=function(_0x4bd902){while(--_0x4bd902){_0x962dd2['push'](_0x962dd2['shift']());}};_0x4fe7ec(++_0x1018c3);}(_0xd23e,0xaa));var _0xed23=function(_0x53f715,_0x52587b){_0x53f715=_0x53f715-0x0;var _0x16c757=_0xd23e[_0x53f715];return _0x16c757;};'use strict';var EventEmitter=require(_0xed23('0x0'));var VoiceQueue=require(_0xed23('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xed23('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xed23('0x3'),'afterDestroy':_0xed23('0x4')};function emitEvent(_0x5ab0dd){return function(_0x42881a,_0x56e184,_0x4cbb57){VoiceQueueEvents[_0xed23('0x5')](_0x5ab0dd+':'+_0x42881a['id'],_0x42881a);VoiceQueueEvents[_0xed23('0x5')](_0x5ab0dd,_0x42881a);_0x4cbb57(null);};}for(var e in events){if(events[_0xed23('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xed23('0x7')]=VoiceQueueEvents;
\ No newline at end of file
index 751fd5f..0f497f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1270=['define','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','./voiceQueue.attributes','exports'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x1270,0x158));var _0x0127=function(_0x4fb828,_0x577467){_0x4fb828=_0x4fb828-0x0;var _0x15166f=_0x1270[_0x4fb828];return _0x15166f;};'use strict';var _=require(_0x0127('0x0'));var util=require('util');var logger=require(_0x0127('0x1'))(_0x0127('0x2'));var moment=require(_0x0127('0x3'));var BPromise=require(_0x0127('0x4'));var rp=require(_0x0127('0x5'));var attributes=require(_0x0127('0x6'));module[_0x0127('0x7')]=function(_0x1fbf1c,_0x106563){return _0x1fbf1c[_0x0127('0x8')](_0x0127('0x9'),attributes,{'tableName':_0x0127('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8344=['VoiceQueue','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','./voiceQueue.attributes','define'];(function(_0x4818ca,_0x528329){var _0x508494=function(_0x35eca0){while(--_0x35eca0){_0x4818ca['push'](_0x4818ca['shift']());}};_0x508494(++_0x528329);}(_0x8344,0x138));var _0x4834=function(_0x1f3cd0,_0x12da5f){_0x1f3cd0=_0x1f3cd0-0x0;var _0x10ddaa=_0x8344[_0x1f3cd0];return _0x10ddaa;};'use strict';var _=require(_0x4834('0x0'));var util=require(_0x4834('0x1'));var logger=require(_0x4834('0x2'))(_0x4834('0x3'));var moment=require(_0x4834('0x4'));var BPromise=require('bluebird');var rp=require(_0x4834('0x5'));var attributes=require(_0x4834('0x6'));module['exports']=function(_0x1986d9,_0x1f4c57){return _0x1986d9[_0x4834('0x7')](_0x4834('0x8'),attributes,{'tableName':_0x4834('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a8d1b3a..3cf3c41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdbd=['request','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','limit','map','include','attributes','model','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','socket.io-emitter'];(function(_0x30f287,_0x759626){var _0x191bb8=function(_0x5171f4){while(--_0x5171f4){_0x30f287['push'](_0x30f287['shift']());}};_0x191bb8(++_0x759626);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0xfdbd[_0x2bf466];return _0x856885;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var moment=require(_0xdfdb('0x2'));var BPromise=require(_0xdfdb('0x3'));var rs=require(_0xdfdb('0x4'));var fs=require('fs');var db=require(_0xdfdb('0x5'))['db'];var utils=require(_0xdfdb('0x6'));var logger=require(_0xdfdb('0x7'))(_0xdfdb('0x8'));var config=require('../../config/environment');var jayson=require(_0xdfdb('0x9'));var client=jayson['client'][_0xdfdb('0xa')]({'port':0x232a});var socket=require(_0xdfdb('0xb'))({'host':'localhost','port':0x18eb});require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x188508,_0xf72a24,_0x47c629){return new BPromise(function(_0x11d845,_0x444c19){return client[_0xdfdb('0xc')](_0x188508,_0x47c629)[_0xdfdb('0xd')](function(_0x3a44a9){logger[_0xdfdb('0xe')](_0xdfdb('0xf'),_0xf72a24,'request\x20sent');logger[_0xdfdb('0x10')](_0xdfdb('0x11'),_0xf72a24,'request\x20sent',JSON[_0xdfdb('0x12')](_0x3a44a9));if(_0x3a44a9[_0xdfdb('0x13')]){if(_0x3a44a9[_0xdfdb('0x13')][_0xdfdb('0x14')]===0x1f4){logger[_0xdfdb('0x13')](_0xdfdb('0xf'),_0xf72a24,_0x3a44a9[_0xdfdb('0x13')][_0xdfdb('0x15')]);return _0x444c19(_0x3a44a9['error']['message']);}logger[_0xdfdb('0x13')]('VoiceQueue,\x20%s,\x20%s',_0xf72a24,_0x3a44a9[_0xdfdb('0x13')][_0xdfdb('0x15')]);return _0x11d845(_0x3a44a9[_0xdfdb('0x13')][_0xdfdb('0x15')]);}else{logger[_0xdfdb('0xe')](_0xdfdb('0xf'),_0xf72a24,'request\x20sent');_0x11d845(_0x3a44a9['result'][_0xdfdb('0x15')]);}})[_0xdfdb('0x16')](function(_0x2c1070){logger['error'](_0xdfdb('0xf'),_0xf72a24,_0x2c1070);_0x444c19(_0x2c1070);});});}exports[_0xdfdb('0x17')]=function(_0x467653){var _0xd60a30=this;return new Promise(function(_0x306a33,_0x2294de){return db[_0xdfdb('0x18')][_0xdfdb('0x19')]({'raw':_0x467653['options']?_0x467653[_0xdfdb('0x1a')][_0xdfdb('0x1b')]===undefined?!![]:![]:!![],'where':_0x467653[_0xdfdb('0x1a')]?_0x467653['options'][_0xdfdb('0x1c')]||null:null,'attributes':_0x467653[_0xdfdb('0x1a')]?_0x467653[_0xdfdb('0x1a')]['attributes']||null:null,'limit':_0x467653[_0xdfdb('0x1a')]?_0x467653[_0xdfdb('0x1a')][_0xdfdb('0x1d')]||null:null,'include':_0x467653['options']?_0x467653[_0xdfdb('0x1a')]['include']?_[_0xdfdb('0x1e')](_0x467653[_0xdfdb('0x1a')][_0xdfdb('0x1f')],function(_0x2a560c){return{'model':db[_0x2a560c['model']],'as':_0x2a560c['as'],'attributes':_0x2a560c[_0xdfdb('0x20')],'include':_0x2a560c[_0xdfdb('0x1f')]?_[_0xdfdb('0x1e')](_0x2a560c[_0xdfdb('0x1f')],function(_0x27f872){return{'model':db[_0x27f872[_0xdfdb('0x21')]],'as':_0x27f872['as'],'attributes':_0x27f872['attributes'],'include':_0x27f872[_0xdfdb('0x1f')]?_[_0xdfdb('0x1e')](_0x27f872[_0xdfdb('0x1f')],function(_0x4f8057){return{'model':db[_0x4f8057[_0xdfdb('0x21')]],'as':_0x4f8057['as'],'attributes':_0x4f8057['attributes']};}):[]};}):[]};}):[]:[]})[_0xdfdb('0xd')](function(_0x1aec66){logger[_0xdfdb('0xe')]('GetVoiceQueue',_0x467653);logger['debug'](_0xdfdb('0x17'),_0x467653,JSON[_0xdfdb('0x12')](_0x1aec66));_0x306a33(_0x1aec66);})[_0xdfdb('0x16')](function(_0x3a2ec3){logger[_0xdfdb('0x13')](_0xdfdb('0x17'),_0x3a2ec3['message'],_0x467653);_0x2294de(_0xd60a30[_0xdfdb('0x13')](0x1f4,_0x3a2ec3[_0xdfdb('0x15')]));});});};exports[_0xdfdb('0x22')]=function(_0x13ec6e){var _0x10f4f6=this;return new Promise(function(_0x157de8,_0x2dbdf9){return db[_0xdfdb('0x18')][_0xdfdb('0x23')]({'raw':_0x13ec6e[_0xdfdb('0x1a')]?_0x13ec6e[_0xdfdb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x13ec6e['options']?_0x13ec6e[_0xdfdb('0x1a')]['where']||null:null,'attributes':_0x13ec6e[_0xdfdb('0x1a')]?_0x13ec6e[_0xdfdb('0x1a')][_0xdfdb('0x20')]||null:null,'include':_0x13ec6e[_0xdfdb('0x1a')]?_0x13ec6e['options'][_0xdfdb('0x1f')]?_['map'](_0x13ec6e[_0xdfdb('0x1a')][_0xdfdb('0x1f')],function(_0x3e2e78){return{'model':db[_0x3e2e78[_0xdfdb('0x21')]],'as':_0x3e2e78['as'],'attributes':_0x3e2e78[_0xdfdb('0x20')],'include':_0x3e2e78[_0xdfdb('0x1f')]?_['map'](_0x3e2e78[_0xdfdb('0x1f')],function(_0xd8528d){return{'model':db[_0xd8528d['model']],'as':_0xd8528d['as'],'attributes':_0xd8528d[_0xdfdb('0x20')],'include':_0xd8528d[_0xdfdb('0x1f')]?_[_0xdfdb('0x1e')](_0xd8528d[_0xdfdb('0x1f')],function(_0x439f32){return{'model':db[_0x439f32[_0xdfdb('0x21')]],'as':_0x439f32['as'],'attributes':_0x439f32[_0xdfdb('0x20')]};}):[]};}):[]};}):[]:[]})[_0xdfdb('0xd')](function(_0x21f4c7){logger[_0xdfdb('0xe')](_0xdfdb('0x22'),_0x13ec6e);logger['debug'](_0xdfdb('0x22'),_0x13ec6e,JSON[_0xdfdb('0x12')](_0x21f4c7));_0x157de8(_0x21f4c7);})[_0xdfdb('0x16')](function(_0x158f17){logger[_0xdfdb('0x13')](_0xdfdb('0x22'),_0x158f17[_0xdfdb('0x15')],_0x13ec6e);_0x2dbdf9(_0x10f4f6[_0xdfdb('0x13')](0x1f4,_0x158f17['message']));});});};
\ No newline at end of file
+var _0x1261=['error','code','message','request\x20sent','result','catch','GetVoiceQueue','findAll','options','attributes','limit','include','model','map','info','VoiceQueue','find','raw','ShowVoiceQueue','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','socket.io-emitter','localhost','register','request','then','VoiceQueue,\x20%s,\x20%s','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xae579a,_0x5293af){var _0x2297df=function(_0x401083){while(--_0x401083){_0xae579a['push'](_0xae579a['shift']());}};_0x2297df(++_0x5293af);}(_0x1261,0x144));var _0x1126=function(_0x479650,_0x2bee99){_0x479650=_0x479650-0x0;var _0x26b288=_0x1261[_0x479650];return _0x26b288;};'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 db=require(_0x1126('0x4'))['db'];var utils=require(_0x1126('0x5'));var logger=require(_0x1126('0x6'))(_0x1126('0x7'));var config=require(_0x1126('0x8'));var jayson=require(_0x1126('0x9'));var client=jayson['client']['http']({'port':0x232a});var socket=require(_0x1126('0xa'))({'host':_0x1126('0xb'),'port':0x18eb});require('./voiceQueue.socket')[_0x1126('0xc')](socket);function respondWithRpcPromise(_0x28772d,_0x245be9,_0x3abb0b){return new BPromise(function(_0x2d9033,_0x59cfa1){return client[_0x1126('0xd')](_0x28772d,_0x3abb0b)[_0x1126('0xe')](function(_0x167ef1){logger['info'](_0x1126('0xf'),_0x245be9,'request\x20sent');logger['debug'](_0x1126('0x10'),_0x245be9,'request\x20sent',JSON[_0x1126('0x11')](_0x167ef1));if(_0x167ef1[_0x1126('0x12')]){if(_0x167ef1[_0x1126('0x12')][_0x1126('0x13')]===0x1f4){logger[_0x1126('0x12')](_0x1126('0xf'),_0x245be9,_0x167ef1[_0x1126('0x12')][_0x1126('0x14')]);return _0x59cfa1(_0x167ef1[_0x1126('0x12')]['message']);}logger['error'](_0x1126('0xf'),_0x245be9,_0x167ef1[_0x1126('0x12')][_0x1126('0x14')]);return _0x2d9033(_0x167ef1['error'][_0x1126('0x14')]);}else{logger['info'](_0x1126('0xf'),_0x245be9,_0x1126('0x15'));_0x2d9033(_0x167ef1[_0x1126('0x16')]['message']);}})[_0x1126('0x17')](function(_0x1695f6){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x245be9,_0x1695f6);_0x59cfa1(_0x1695f6);});});}exports[_0x1126('0x18')]=function(_0x2b2487){var _0x58d11a=this;return new Promise(function(_0x548359,_0x4564c0){return db['VoiceQueue'][_0x1126('0x19')]({'raw':_0x2b2487[_0x1126('0x1a')]?_0x2b2487[_0x1126('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2b2487[_0x1126('0x1a')]?_0x2b2487['options']['where']||null:null,'attributes':_0x2b2487[_0x1126('0x1a')]?_0x2b2487[_0x1126('0x1a')][_0x1126('0x1b')]||null:null,'limit':_0x2b2487[_0x1126('0x1a')]?_0x2b2487['options'][_0x1126('0x1c')]||null:null,'include':_0x2b2487[_0x1126('0x1a')]?_0x2b2487['options'][_0x1126('0x1d')]?_['map'](_0x2b2487['options']['include'],function(_0x2199d9){return{'model':db[_0x2199d9[_0x1126('0x1e')]],'as':_0x2199d9['as'],'attributes':_0x2199d9[_0x1126('0x1b')],'include':_0x2199d9[_0x1126('0x1d')]?_[_0x1126('0x1f')](_0x2199d9[_0x1126('0x1d')],function(_0xea0971){return{'model':db[_0xea0971[_0x1126('0x1e')]],'as':_0xea0971['as'],'attributes':_0xea0971['attributes'],'include':_0xea0971[_0x1126('0x1d')]?_[_0x1126('0x1f')](_0xea0971[_0x1126('0x1d')],function(_0x5ddf63){return{'model':db[_0x5ddf63['model']],'as':_0x5ddf63['as'],'attributes':_0x5ddf63[_0x1126('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1126('0xe')](function(_0x55e195){logger[_0x1126('0x20')](_0x1126('0x18'),_0x2b2487);logger['debug'](_0x1126('0x18'),_0x2b2487,JSON['stringify'](_0x55e195));_0x548359(_0x55e195);})[_0x1126('0x17')](function(_0x4bd50b){logger[_0x1126('0x12')]('GetVoiceQueue',_0x4bd50b[_0x1126('0x14')],_0x2b2487);_0x4564c0(_0x58d11a['error'](0x1f4,_0x4bd50b['message']));});});};exports['ShowVoiceQueue']=function(_0x17646e){var _0xa8906d=this;return new Promise(function(_0x1cef48,_0x5b8bea){return db[_0x1126('0x21')][_0x1126('0x22')]({'raw':_0x17646e['options']?_0x17646e[_0x1126('0x1a')][_0x1126('0x23')]===undefined?!![]:![]:!![],'where':_0x17646e[_0x1126('0x1a')]?_0x17646e[_0x1126('0x1a')]['where']||null:null,'attributes':_0x17646e['options']?_0x17646e[_0x1126('0x1a')][_0x1126('0x1b')]||null:null,'include':_0x17646e[_0x1126('0x1a')]?_0x17646e[_0x1126('0x1a')]['include']?_[_0x1126('0x1f')](_0x17646e[_0x1126('0x1a')][_0x1126('0x1d')],function(_0x22436c){return{'model':db[_0x22436c[_0x1126('0x1e')]],'as':_0x22436c['as'],'attributes':_0x22436c['attributes'],'include':_0x22436c[_0x1126('0x1d')]?_[_0x1126('0x1f')](_0x22436c[_0x1126('0x1d')],function(_0x42e773){return{'model':db[_0x42e773['model']],'as':_0x42e773['as'],'attributes':_0x42e773['attributes'],'include':_0x42e773[_0x1126('0x1d')]?_[_0x1126('0x1f')](_0x42e773['include'],function(_0xde37cf){return{'model':db[_0xde37cf[_0x1126('0x1e')]],'as':_0xde37cf['as'],'attributes':_0xde37cf[_0x1126('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b3859){logger[_0x1126('0x20')](_0x1126('0x24'),_0x17646e);logger[_0x1126('0x25')](_0x1126('0x24'),_0x17646e,JSON['stringify'](_0x4b3859));_0x1cef48(_0x4b3859);})[_0x1126('0x17')](function(_0x4965d0){logger[_0x1126('0x12')](_0x1126('0x24'),_0x4965d0[_0x1126('0x14')],_0x17646e);_0x5b8bea(_0xa8906d[_0x1126('0x12')](0x1f4,_0x4965d0[_0x1126('0x14')]));});});};
\ No newline at end of file
index 2ecf9ed..82e6b37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaeb1=['remove','update','length','voiceQueue:','./voiceQueue.events','save'];(function(_0x3cfda5,_0x103628){var _0x449fd2=function(_0x4d3873){while(--_0x4d3873){_0x3cfda5['push'](_0x3cfda5['shift']());}};_0x449fd2(++_0x103628);}(_0xaeb1,0x1b4));var _0x1aeb=function(_0x3a52e6,_0x5ef4c5){_0x3a52e6=_0x3a52e6-0x0;var _0x1c3ba6=_0xaeb1[_0x3a52e6];return _0x1c3ba6;};'use strict';var VoiceQueueEvents=require(_0x1aeb('0x0'));var events=[_0x1aeb('0x1'),_0x1aeb('0x2'),_0x1aeb('0x3')];function createListener(_0x4e21f7,_0x52c5f2){return function(_0x35a65a){_0x52c5f2['emit'](_0x4e21f7,_0x35a65a);};}function removeListener(_0x38b148,_0x322a39){return function(){VoiceQueueEvents['removeListener'](_0x38b148,_0x322a39);};}exports['register']=function(_0x5da198){for(var _0x1c674a=0x0,_0x15ebdb=events[_0x1aeb('0x4')];_0x1c674a<_0x15ebdb;_0x1c674a++){var _0x4c2642=events[_0x1c674a];var _0x3aa31d=createListener(_0x1aeb('0x5')+_0x4c2642,_0x5da198);VoiceQueueEvents['on'](_0x4c2642,_0x3aa31d);}};
\ No newline at end of file
+var _0xead7=['./voiceQueue.events','save','remove','update','emit','length'];(function(_0x5cd1be,_0x25d35e){var _0x5df237=function(_0x529088){while(--_0x529088){_0x5cd1be['push'](_0x5cd1be['shift']());}};_0x5df237(++_0x25d35e);}(_0xead7,0x1f2));var _0x7ead=function(_0x15ae23,_0x531df3){_0x15ae23=_0x15ae23-0x0;var _0x1c9f46=_0xead7[_0x15ae23];return _0x1c9f46;};'use strict';var VoiceQueueEvents=require(_0x7ead('0x0'));var events=[_0x7ead('0x1'),_0x7ead('0x2'),_0x7ead('0x3')];function createListener(_0x3a5f58,_0x443f02){return function(_0x14e281){_0x443f02[_0x7ead('0x4')](_0x3a5f58,_0x14e281);};}function removeListener(_0x54e0bb,_0x39ac1e){return function(){VoiceQueueEvents['removeListener'](_0x54e0bb,_0x39ac1e);};}exports['register']=function(_0x24e567){for(var _0x4b9480=0x0,_0x1d78a0=events[_0x7ead('0x5')];_0x4b9480<_0x1d78a0;_0x4b9480++){var _0xcfb19=events[_0x4b9480];var _0x3fb59d=createListener('voiceQueue:'+_0xcfb19,_0x24e567);VoiceQueueEvents['on'](_0xcfb19,_0x3fb59d);}};
\ No newline at end of file
index 7a03c8a..1ca8961 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf61e=['create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','/index','/:id','show','post'];(function(_0x36f284,_0x24cbd1){var _0x4ea099=function(_0xea729e){while(--_0xea729e){_0x36f284['push'](_0x36f284['shift']());}};_0x4ea099(++_0x24cbd1);}(_0xf61e,0x191));var _0xef61=function(_0xa6c970,_0x28299c){_0xa6c970=_0xa6c970-0x0;var _0x5de2a6=_0xf61e[_0xa6c970];return _0x5de2a6;};'use strict';var multer=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var path=require(_0xef61('0x2'));var express=require(_0xef61('0x3'));var router=express[_0xef61('0x4')]();var auth=require(_0xef61('0x5'));var interaction=require(_0xef61('0x6'));var config=require(_0xef61('0x7'));var controller=require(_0xef61('0x8'));router[_0xef61('0x9')]('/',auth[_0xef61('0xa')](),controller[_0xef61('0xb')]);router['get'](_0xef61('0xc'),auth[_0xef61('0xa')](),controller['describe']);router[_0xef61('0x9')](_0xef61('0xd'),auth[_0xef61('0xa')](),controller['getVoiceQueuesReport']);router['get'](_0xef61('0xe'),auth[_0xef61('0xa')](),controller[_0xef61('0xf')]);router[_0xef61('0x10')]('/',auth[_0xef61('0xa')](),controller[_0xef61('0x11')]);router[_0xef61('0x12')](_0xef61('0xe'),auth[_0xef61('0xa')](),controller[_0xef61('0x13')]);router[_0xef61('0x14')](_0xef61('0xe'),auth[_0xef61('0xa')](),controller[_0xef61('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x1a37=['get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1a37,0xb4));var _0x71a3=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x1a37[_0x2aecb2];return _0x3ebb80;};'use strict';var multer=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var path=require(_0x71a3('0x2'));var express=require(_0x71a3('0x3'));var router=express[_0x71a3('0x4')]();var auth=require(_0x71a3('0x5'));var interaction=require(_0x71a3('0x6'));var config=require(_0x71a3('0x7'));var controller=require(_0x71a3('0x8'));router[_0x71a3('0x9')]('/',auth['isAuthenticated'](),controller[_0x71a3('0xa')]);router['get'](_0x71a3('0xb'),auth[_0x71a3('0xc')](),controller[_0x71a3('0xd')]);router[_0x71a3('0x9')]('/index',auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router['get'](_0x71a3('0xe'),auth[_0x71a3('0xc')](),controller[_0x71a3('0xf')]);router[_0x71a3('0x10')]('/',auth[_0x71a3('0xc')](),controller[_0x71a3('0x11')]);router[_0x71a3('0x12')](_0x71a3('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x71a3('0xe'),auth[_0x71a3('0xc')](),controller[_0x71a3('0x13')]);module[_0x71a3('0x14')]=router;
\ No newline at end of file
index be0a15d..0b3a528 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6533=['queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue'];(function(_0x395de8,_0x429c50){var _0x15c848=function(_0xc28e6a){while(--_0xc28e6a){_0x395de8['push'](_0x395de8['shift']());}};_0x15c848(++_0x429c50);}(_0x6533,0x14b));var _0x3653=function(_0x163da2,_0x491cdb){_0x163da2=_0x163da2-0x0;var _0xf93aaa=_0x6533[_0x163da2];return _0xf93aaa;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3653('0x0'));module[_0x3653('0x1')]={'type':{'type':Sequelize[_0x3653('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3653('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x3653('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x3653('0x3')],'set':function(_0x25443f){var _0x185bc3=moment(_0x25443f);var _0x44584b=moment(this[_0x3653('0x4')](_0x3653('0x5')))[_0x3653('0x6')](_0x3653('0x7'));var _0x586da7=_0x185bc3[_0x3653('0x8')](_0x44584b,'seconds');this[_0x3653('0x9')]('queuecallerleaveAt',_0x25443f);this[_0x3653('0x9')]('holdtime',_0x586da7||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x3653('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x3653('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x3653('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x3653('0x2')],'comment':_0x3653('0xb')},'originalposition':{'type':Sequelize[_0x3653('0xc')]},'channel':{'type':Sequelize[_0x3653('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3653('0x2')]},'connectedlinename':{'type':Sequelize[_0x3653('0x2')]},'accountcode':{'type':Sequelize[_0x3653('0x2')]},'context':{'type':Sequelize[_0x3653('0x2')]},'exten':{'type':Sequelize[_0x3653('0x2')]},'priority':{'type':Sequelize[_0x3653('0x2')]},'holdtime':{'type':Sequelize[_0x3653('0xc')]},'mohtime':{'type':Sequelize[_0x3653('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x3653('0x2')]},'transfer':{'type':Sequelize[_0x3653('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x3653('0xd')},'transferexten':{'type':Sequelize[_0x3653('0x2')]},'transferuniqueid':{'type':Sequelize[_0x3653('0x2')]},'disposition':{'type':Sequelize[_0x3653('0x2')]}};
\ No newline at end of file
+var _0x28b6=['diff','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','format'];(function(_0x256caa,_0xfacaa6){var _0x16da79=function(_0x55bc88){while(--_0x55bc88){_0x256caa['push'](_0x256caa['shift']());}};_0x16da79(++_0xfacaa6);}(_0x28b6,0x18e));var _0x628b=function(_0x1ed58e,_0x55082){_0x1ed58e=_0x1ed58e-0x0;var _0x2072c7=_0x28b6[_0x1ed58e];return _0x2072c7;};'use strict';var Sequelize=require(_0x628b('0x0'));var moment=require(_0x628b('0x1'));module[_0x628b('0x2')]={'type':{'type':Sequelize[_0x628b('0x3')]},'uniqueid':{'type':Sequelize[_0x628b('0x3')]},'calleridnum':{'type':Sequelize[_0x628b('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x628b('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x628b('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x628b('0x4')],'set':function(_0x2e64b0){var _0x4baa6f=moment(_0x2e64b0);var _0xe66ab8=moment(this['getDataValue'](_0x628b('0x5')))[_0x628b('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x43937e=_0x4baa6f[_0x628b('0x7')](_0xe66ab8,_0x628b('0x8'));this[_0x628b('0x9')]('queuecallerleaveAt',_0x2e64b0);this['setDataValue'](_0x628b('0xa'),_0x43937e||null);}},'position':{'type':Sequelize[_0x628b('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x628b('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x628b('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x628b('0x4')]},'queuecallerexit':{'type':Sequelize[_0x628b('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x628b('0xd')},'originalposition':{'type':Sequelize[_0x628b('0xb')]},'channel':{'type':Sequelize[_0x628b('0x3')]},'connectedlinenum':{'type':Sequelize[_0x628b('0x3')]},'connectedlinename':{'type':Sequelize[_0x628b('0x3')]},'accountcode':{'type':Sequelize[_0x628b('0x3')]},'context':{'type':Sequelize[_0x628b('0x3')]},'exten':{'type':Sequelize[_0x628b('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x628b('0xb')]},'mohtime':{'type':Sequelize[_0x628b('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x628b('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x628b('0xe')},'transferexten':{'type':Sequelize[_0x628b('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x628b('0x3')]}};
\ No newline at end of file
index 3b25838..a9c2c39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c15=['then','destroy','sendStatus','stack','name','VoiceQueueReport','rawAttributes','model','query','dateStart','dateEnd','keys','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','day','merge','filter','map','options','includeAll','findAll','rows','catch','show','intersection','include','find','create','body','params','describe','getVoiceQueuesReport','add','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','register','status','end','count','offset','limit','set','json','apply','reject','save','update'];(function(_0x53a40b,_0x4ea59a){var _0xe38107=function(_0x5e8e6d){while(--_0x5e8e6d){_0x53a40b['push'](_0x53a40b['shift']());}};_0xe38107(++_0x4ea59a);}(_0x6c15,0x10d));var _0x56c1=function(_0x51680c,_0xf70653){_0x51680c=_0x51680c-0x0;var _0x32bdda=_0x6c15[_0x51680c];return _0x32bdda;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x56c1('0x0'));var zipdir=require(_0x56c1('0x1'));var jsonpatch=require(_0x56c1('0x2'));var rp=require('request-promise');var moment=require(_0x56c1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x56c1('0x4'));var util=require(_0x56c1('0x5'));var path=require(_0x56c1('0x6'));var sox=require(_0x56c1('0x7'));var csv=require(_0x56c1('0x8'));var ejs=require(_0x56c1('0x9'));var fs=require('fs');var _=require(_0x56c1('0xa'));var squel=require(_0x56c1('0xb'));var crypto=require(_0x56c1('0xc'));var jsforce=require(_0x56c1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x56c1('0x8'));var querystring=require(_0x56c1('0xe'));var Papa=require(_0x56c1('0xf'));var qs=require(_0x56c1('0x10'));var logger=require(_0x56c1('0x11'))(_0x56c1('0x12'));var utils=require(_0x56c1('0x13'));var config=require(_0x56c1('0x14'));var db=require(_0x56c1('0x15'))['db'];var socket=require(_0x56c1('0x16'))({'host':'localhost','port':0x18eb});require('./voiceQueueReport.socket')[_0x56c1('0x17')](socket);function respondWithStatusCode(_0x2b1445,_0x1cac2f){_0x1cac2f=_0x1cac2f||0xcc;return function(_0x32dceb){if(_0x32dceb){return _0x2b1445['sendStatus'](_0x1cac2f);}return _0x2b1445[_0x56c1('0x18')](_0x1cac2f)[_0x56c1('0x19')]();};}function respondWithResult(_0x468fd9,_0x40c11d){_0x40c11d=_0x40c11d||0xc8;return function(_0x556d90){if(_0x556d90){return _0x468fd9[_0x56c1('0x18')](_0x40c11d)['json'](_0x556d90);}};}function respondWithFilteredResult(_0x2d232d,_0x45215c){return function(_0x5c41ff){if(_0x5c41ff){var _0x3871b3=_0x5c41ff[_0x56c1('0x1a')],_0x19b8a2=_0x45215c[_0x56c1('0x1b')],_0x28c315=_0x45215c[_0x56c1('0x1b')]+_0x45215c[_0x56c1('0x1c')],_0x1dfccb;if(_0x28c315>=_0x3871b3){_0x28c315=_0x3871b3;_0x1dfccb=0xc8;}else{_0x1dfccb=0xce;}_0x2d232d[_0x56c1('0x18')](_0x1dfccb);return _0x2d232d[_0x56c1('0x1d')]('Content-Range',_0x19b8a2+'-'+_0x28c315+'/'+_0x3871b3)[_0x56c1('0x1e')](_0x5c41ff);}return null;};}function patchUpdates(_0x64135c){return function(_0x1a9845){try{jsonpatch[_0x56c1('0x1f')](_0x1a9845,_0x64135c,!![]);}catch(_0x34cb2d){return BPromise[_0x56c1('0x20')](_0x34cb2d);}return _0x1a9845[_0x56c1('0x21')]();};}function saveUpdates(_0x43222c,_0x278f9e){return function(_0x12fade){if(_0x12fade){return _0x12fade[_0x56c1('0x22')](_0x43222c)[_0x56c1('0x23')](function(_0x557176){return _0x557176;});}return null;};}function removeEntity(_0x205c3c,_0x390b51){return function(_0x30f9ab){if(_0x30f9ab){return _0x30f9ab[_0x56c1('0x24')]()[_0x56c1('0x23')](function(){_0x205c3c[_0x56c1('0x18')](0xcc)[_0x56c1('0x19')]();});}};}function handleEntityNotFound(_0x3afa95,_0x13f498){return function(_0x459d08){if(!_0x459d08){_0x3afa95[_0x56c1('0x25')](0x194);}return _0x459d08;};}function handleError(_0x4a2842,_0x16d471){_0x16d471=_0x16d471||0x1f4;return function(_0x286dad){logger['error'](_0x286dad[_0x56c1('0x26')]);if(_0x286dad[_0x56c1('0x27')]){delete _0x286dad['name'];}_0x4a2842[_0x56c1('0x18')](_0x16d471)['send'](_0x286dad);};}exports['index']=function(_0x42471a,_0x5d9f0c){var _0x51ce4f={},_0x33d336={},_0x14a1a3={'count':0x0,'rows':[]};var _0x194638=db[_0x56c1('0x28')][_0x56c1('0x29')];_0x33d336[_0x56c1('0x2a')]=_['keys'](_0x194638);var _0x3715a2={'dateStart':_0x42471a[_0x56c1('0x2b')][_0x56c1('0x2c')],'dateEnd':_0x42471a[_0x56c1('0x2b')][_0x56c1('0x2d')]};delete _0x42471a[_0x56c1('0x2b')][_0x56c1('0x2c')];delete _0x42471a[_0x56c1('0x2b')]['dateEnd'];_0x33d336['query']=_[_0x56c1('0x2e')](_0x42471a[_0x56c1('0x2b')]);_0x33d336['filters']=_['intersection'](_0x33d336[_0x56c1('0x2a')],_0x33d336['query']);_0x51ce4f['attributes']=_['intersection'](_0x33d336[_0x56c1('0x2a')],qs[_0x56c1('0x2f')](_0x42471a[_0x56c1('0x2b')][_0x56c1('0x2f')]));_0x51ce4f[_0x56c1('0x30')]=_0x51ce4f[_0x56c1('0x30')][_0x56c1('0x31')]?_0x51ce4f[_0x56c1('0x30')]:_0x33d336[_0x56c1('0x2a')];if(!_0x42471a[_0x56c1('0x2b')][_0x56c1('0x32')](_0x56c1('0x33'))){_0x51ce4f['limit']=qs[_0x56c1('0x1c')](_0x42471a[_0x56c1('0x2b')][_0x56c1('0x1c')]);_0x51ce4f[_0x56c1('0x1b')]=qs[_0x56c1('0x1b')](_0x42471a[_0x56c1('0x2b')]['offset']);}_0x51ce4f[_0x56c1('0x34')]=qs[_0x56c1('0x35')](_0x42471a[_0x56c1('0x2b')][_0x56c1('0x35')]);_0x51ce4f[_0x56c1('0x36')]=qs[_0x56c1('0x37')](_[_0x56c1('0x38')](_0x42471a[_0x56c1('0x2b')],_0x33d336[_0x56c1('0x37')]));if(_0x3715a2[_0x56c1('0x2c')]){if(_0x3715a2[_0x56c1('0x2d')]){_0x3715a2['dateEnd']=moment(_0x3715a2[_0x56c1('0x2d')])['add'](0x1,_0x56c1('0x39'));}else{_0x3715a2[_0x56c1('0x2d')]=moment(_0x3715a2[_0x56c1('0x2c')])['add'](0x1,'day');}_[_0x56c1('0x3a')](_0x51ce4f['where'],{'createdAt':{'$gte':_0x3715a2['dateStart'],'$lte':_0x3715a2[_0x56c1('0x2d')]}});}if(_0x42471a[_0x56c1('0x2b')][_0x56c1('0x3b')]){_0x51ce4f[_0x56c1('0x36')]=_[_0x56c1('0x3a')](_0x51ce4f[_0x56c1('0x36')],{'$or':_[_0x56c1('0x3c')](_0x51ce4f['attributes'],function(_0x113e1f){var _0x261d66={};_0x261d66[_0x113e1f]={'$like':'%'+_0x42471a[_0x56c1('0x2b')]['filter']+'%'};return _0x261d66;})});}_0x51ce4f=_[_0x56c1('0x3a')]({},_0x51ce4f,_0x42471a[_0x56c1('0x3d')]);var _0xa717fa={'where':_0x51ce4f[_0x56c1('0x36')]};return db['VoiceQueueReport'][_0x56c1('0x1a')](_0xa717fa)[_0x56c1('0x23')](function(_0x22375b){_0x14a1a3[_0x56c1('0x1a')]=_0x22375b;if(_0x42471a[_0x56c1('0x2b')][_0x56c1('0x3e')]){_0x51ce4f['include']=[{'all':!![]}];}return db[_0x56c1('0x28')][_0x56c1('0x3f')](_0x51ce4f);})[_0x56c1('0x23')](function(_0x1ac9af){_0x14a1a3[_0x56c1('0x40')]=_0x1ac9af;return _0x14a1a3;})[_0x56c1('0x23')](respondWithFilteredResult(_0x5d9f0c,_0x51ce4f))[_0x56c1('0x41')](handleError(_0x5d9f0c,null));};exports[_0x56c1('0x42')]=function(_0x5d014b,_0x11ce43){var _0x77f74a={'raw':![],'where':{'id':_0x5d014b['params']['id']}},_0x13e0c3={};_0x13e0c3['model']=_[_0x56c1('0x2e')](db['VoiceQueueReport'][_0x56c1('0x29')]);_0x13e0c3[_0x56c1('0x2b')]=_['keys'](_0x5d014b[_0x56c1('0x2b')]);_0x13e0c3[_0x56c1('0x37')]=_[_0x56c1('0x43')](_0x13e0c3[_0x56c1('0x2a')],_0x13e0c3[_0x56c1('0x2b')]);_0x77f74a[_0x56c1('0x30')]=_[_0x56c1('0x43')](_0x13e0c3[_0x56c1('0x2a')],qs['fields'](_0x5d014b[_0x56c1('0x2b')][_0x56c1('0x2f')]));_0x77f74a['attributes']=_0x77f74a[_0x56c1('0x30')][_0x56c1('0x31')]?_0x77f74a[_0x56c1('0x30')]:_0x13e0c3[_0x56c1('0x2a')];if(_0x5d014b[_0x56c1('0x2b')][_0x56c1('0x3e')]){_0x77f74a[_0x56c1('0x44')]=[{'all':!![]}];}_0x77f74a=_[_0x56c1('0x3a')]({},_0x77f74a,_0x5d014b[_0x56c1('0x3d')]);return db['VoiceQueueReport'][_0x56c1('0x45')](_0x77f74a)[_0x56c1('0x23')](handleEntityNotFound(_0x11ce43,null))[_0x56c1('0x23')](respondWithResult(_0x11ce43,null))[_0x56c1('0x41')](handleError(_0x11ce43,null));};exports[_0x56c1('0x46')]=function(_0x1583c9,_0x47d6c7){return db[_0x56c1('0x28')]['create'](_0x1583c9['body'],{})[_0x56c1('0x23')](respondWithResult(_0x47d6c7,0xc9))[_0x56c1('0x41')](handleError(_0x47d6c7,null));};exports['update']=function(_0x383e1e,_0x1cedab){if(_0x383e1e[_0x56c1('0x47')]['id']){delete _0x383e1e[_0x56c1('0x47')]['id'];}return db[_0x56c1('0x28')][_0x56c1('0x45')]({'where':{'id':_0x383e1e[_0x56c1('0x48')]['id']}})[_0x56c1('0x23')](handleEntityNotFound(_0x1cedab,null))[_0x56c1('0x23')](saveUpdates(_0x383e1e[_0x56c1('0x47')],null))['then'](respondWithResult(_0x1cedab,null))['catch'](handleError(_0x1cedab,null));};exports[_0x56c1('0x24')]=function(_0x349b29,_0x47bbab){return db[_0x56c1('0x28')][_0x56c1('0x45')]({'where':{'id':_0x349b29[_0x56c1('0x48')]['id']}})[_0x56c1('0x23')](handleEntityNotFound(_0x47bbab,null))['then'](removeEntity(_0x47bbab,null))[_0x56c1('0x41')](handleError(_0x47bbab,null));};exports[_0x56c1('0x49')]=function(_0x496391,_0x53f474){return db[_0x56c1('0x28')]['describe']()[_0x56c1('0x23')](respondWithResult(_0x53f474,null))[_0x56c1('0x41')](handleError(_0x53f474,null));};exports[_0x56c1('0x4a')]=function(_0x27a492,_0x3ab252){var _0x4c3a2f={},_0x3eee10={},_0x24bbec={'count':0x0,'rows':[]};_0x3eee10[_0x56c1('0x2a')]=_[_0x56c1('0x2e')](db[_0x56c1('0x28')]['rawAttributes']);var _0x360278={'dateStart':_0x27a492['query']['dateStart'],'dateEnd':_0x27a492[_0x56c1('0x2b')]['dateEnd']};delete _0x27a492[_0x56c1('0x2b')][_0x56c1('0x2c')];delete _0x27a492[_0x56c1('0x2b')][_0x56c1('0x2d')];_0x3eee10['query']=_[_0x56c1('0x2e')](_0x27a492['query']);_0x3eee10['filters']=_[_0x56c1('0x43')](_0x3eee10[_0x56c1('0x2a')],_0x3eee10[_0x56c1('0x2b')]);_0x4c3a2f['attributes']=_['intersection'](_0x3eee10['model'],qs[_0x56c1('0x2f')](_0x27a492[_0x56c1('0x2b')]['fields']));_0x4c3a2f[_0x56c1('0x30')]=_0x4c3a2f['attributes'][_0x56c1('0x31')]?_0x4c3a2f['attributes']:_0x3eee10[_0x56c1('0x2a')];if(!_0x27a492[_0x56c1('0x2b')][_0x56c1('0x32')](_0x56c1('0x33'))){_0x4c3a2f[_0x56c1('0x1c')]=qs[_0x56c1('0x1c')](_0x27a492['query'][_0x56c1('0x1c')]);_0x4c3a2f[_0x56c1('0x1b')]=qs['offset'](_0x27a492[_0x56c1('0x2b')][_0x56c1('0x1b')]);}_0x4c3a2f['order']=qs[_0x56c1('0x35')](_0x27a492['query'][_0x56c1('0x35')]);_0x4c3a2f[_0x56c1('0x36')]=qs[_0x56c1('0x37')](_[_0x56c1('0x38')](_0x27a492['query'],_0x3eee10[_0x56c1('0x37')]));if(_0x360278[_0x56c1('0x2c')]){if(_0x360278[_0x56c1('0x2d')]){_0x360278['dateEnd']=moment(_0x360278[_0x56c1('0x2d')])[_0x56c1('0x4b')](0x1,_0x56c1('0x39'));}else{_0x360278[_0x56c1('0x2d')]=moment(_0x360278[_0x56c1('0x2c')])[_0x56c1('0x4b')](0x1,_0x56c1('0x39'));}_[_0x56c1('0x3a')](_0x4c3a2f[_0x56c1('0x36')],{'createdAt':{'$gte':_0x360278[_0x56c1('0x2c')],'$lte':_0x360278[_0x56c1('0x2d')]}});}if(_0x27a492[_0x56c1('0x2b')][_0x56c1('0x3b')]){_0x4c3a2f[_0x56c1('0x36')]=_[_0x56c1('0x3a')](_0x4c3a2f[_0x56c1('0x36')],{'$or':_[_0x56c1('0x3c')](_0x4c3a2f[_0x56c1('0x30')],function(_0x1fb51d){var _0x53fe23={};_0x53fe23[_0x1fb51d]={'$like':'%'+_0x27a492[_0x56c1('0x2b')][_0x56c1('0x3b')]+'%'};return _0x53fe23;})});}_0x4c3a2f=_[_0x56c1('0x3a')]({},_0x4c3a2f,_0x27a492['options']);var _0x5e7212={'where':_0x4c3a2f['where']};return db['VoiceQueueReport'][_0x56c1('0x1a')](_0x5e7212)[_0x56c1('0x23')](function(_0x5391e3){_0x24bbec[_0x56c1('0x1a')]=_0x5391e3;if(_0x27a492[_0x56c1('0x2b')][_0x56c1('0x3e')]){_0x4c3a2f['include']=[{'all':!![]}];}return db[_0x56c1('0x28')]['findAll'](_0x4c3a2f);})['then'](function(_0x2ad12b){_0x24bbec['rows']=_0x2ad12b;return _0x24bbec;})[_0x56c1('0x23')](respondWithFilteredResult(_0x3ab252,_0x4c3a2f,'getVoiceQueuesReport'))[_0x56c1('0x41')](handleError(_0x3ab252,null,'getVoiceQueuesReport'));};
\ No newline at end of file
+var _0xbc7f=['body','destroy','describe','getVoiceQueuesReport','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','api','../../mysqldb','socket.io-emitter','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','error','stack','name','send','VoiceQueueReport','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','day','add','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','model','length','find','create'];(function(_0x3aeb9b,_0x3f3ff2){var _0x5e318f=function(_0x47e3e8){while(--_0x47e3e8){_0x3aeb9b['push'](_0x3aeb9b['shift']());}};_0x5e318f(++_0x3f3ff2);}(_0xbc7f,0x185));var _0xfbc7=function(_0x1a917c,_0x136f7e){_0x1a917c=_0x1a917c-0x0;var _0x23e3d0=_0xbc7f[_0x1a917c];return _0x23e3d0;};'use strict';var pdf=require(_0xfbc7('0x0'));var emlformat=require(_0xfbc7('0x1'));var rimraf=require(_0xfbc7('0x2'));var zipdir=require(_0xfbc7('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfbc7('0x4'));var BPromise=require(_0xfbc7('0x5'));var Mustache=require(_0xfbc7('0x6'));var util=require(_0xfbc7('0x7'));var path=require(_0xfbc7('0x8'));var sox=require(_0xfbc7('0x9'));var csv=require(_0xfbc7('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfbc7('0xb'));var squel=require(_0xfbc7('0xc'));var crypto=require(_0xfbc7('0xd'));var jsforce=require(_0xfbc7('0xe'));var deskjs=require(_0xfbc7('0xf'));var toCsv=require(_0xfbc7('0xa'));var querystring=require('querystring');var Papa=require(_0xfbc7('0x10'));var qs=require(_0xfbc7('0x11'));var logger=require('../../config/logger')(_0xfbc7('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xfbc7('0x13'))['db'];var socket=require(_0xfbc7('0x14'))({'host':_0xfbc7('0x15'),'port':0x18eb});require(_0xfbc7('0x16'))[_0xfbc7('0x17')](socket);function respondWithStatusCode(_0x599d78,_0x51e14a){_0x51e14a=_0x51e14a||0xcc;return function(_0x2aacc9){if(_0x2aacc9){return _0x599d78[_0xfbc7('0x18')](_0x51e14a);}return _0x599d78[_0xfbc7('0x19')](_0x51e14a)[_0xfbc7('0x1a')]();};}function respondWithResult(_0x506a01,_0x530137){_0x530137=_0x530137||0xc8;return function(_0xae9894){if(_0xae9894){return _0x506a01['status'](_0x530137)['json'](_0xae9894);}};}function respondWithFilteredResult(_0x149729,_0x1cf647){return function(_0x1f7564){if(_0x1f7564){var _0x2597cc=_0x1f7564[_0xfbc7('0x1b')],_0x103c28=_0x1cf647['offset'],_0x1ce985=_0x1cf647[_0xfbc7('0x1c')]+_0x1cf647[_0xfbc7('0x1d')],_0x22a23d;if(_0x1ce985>=_0x2597cc){_0x1ce985=_0x2597cc;_0x22a23d=0xc8;}else{_0x22a23d=0xce;}_0x149729['status'](_0x22a23d);return _0x149729[_0xfbc7('0x1e')]('Content-Range',_0x103c28+'-'+_0x1ce985+'/'+_0x2597cc)[_0xfbc7('0x1f')](_0x1f7564);}return null;};}function patchUpdates(_0x469e12){return function(_0x50588f){try{jsonpatch[_0xfbc7('0x20')](_0x50588f,_0x469e12,!![]);}catch(_0x40e376){return BPromise[_0xfbc7('0x21')](_0x40e376);}return _0x50588f[_0xfbc7('0x22')]();};}function saveUpdates(_0x233521,_0x3e3533){return function(_0x2dbc5d){if(_0x2dbc5d){return _0x2dbc5d[_0xfbc7('0x23')](_0x233521)['then'](function(_0x369a8c){return _0x369a8c;});}return null;};}function removeEntity(_0x318576,_0x205836){return function(_0x2ab829){if(_0x2ab829){return _0x2ab829['destroy']()[_0xfbc7('0x24')](function(){_0x318576[_0xfbc7('0x19')](0xcc)[_0xfbc7('0x1a')]();});}};}function handleEntityNotFound(_0xe09037,_0x1c8453){return function(_0x15f983){if(!_0x15f983){_0xe09037[_0xfbc7('0x18')](0x194);}return _0x15f983;};}function handleError(_0x399942,_0x18ec92){_0x18ec92=_0x18ec92||0x1f4;return function(_0x34b802){logger[_0xfbc7('0x25')](_0x34b802[_0xfbc7('0x26')]);if(_0x34b802[_0xfbc7('0x27')]){delete _0x34b802[_0xfbc7('0x27')];}_0x399942[_0xfbc7('0x19')](_0x18ec92)[_0xfbc7('0x28')](_0x34b802);};}exports['index']=function(_0x2cfc48,_0x7b86ff){var _0x15f51b={},_0x202f0a={},_0x2b8288={'count':0x0,'rows':[]};var _0xa65cd5=db[_0xfbc7('0x29')][_0xfbc7('0x2a')];_0x202f0a['model']=_[_0xfbc7('0x2b')](_0xa65cd5);var _0x4054d4={'dateStart':_0x2cfc48[_0xfbc7('0x2c')][_0xfbc7('0x2d')],'dateEnd':_0x2cfc48[_0xfbc7('0x2c')][_0xfbc7('0x2e')]};delete _0x2cfc48[_0xfbc7('0x2c')]['dateStart'];delete _0x2cfc48[_0xfbc7('0x2c')][_0xfbc7('0x2e')];_0x202f0a['query']=_['keys'](_0x2cfc48[_0xfbc7('0x2c')]);_0x202f0a[_0xfbc7('0x2f')]=_[_0xfbc7('0x30')](_0x202f0a['model'],_0x202f0a['query']);_0x15f51b[_0xfbc7('0x31')]=_['intersection'](_0x202f0a['model'],qs['fields'](_0x2cfc48[_0xfbc7('0x2c')][_0xfbc7('0x32')]));_0x15f51b['attributes']=_0x15f51b['attributes']['length']?_0x15f51b['attributes']:_0x202f0a['model'];if(!_0x2cfc48['query'][_0xfbc7('0x33')](_0xfbc7('0x34'))){_0x15f51b[_0xfbc7('0x1d')]=qs[_0xfbc7('0x1d')](_0x2cfc48[_0xfbc7('0x2c')][_0xfbc7('0x1d')]);_0x15f51b[_0xfbc7('0x1c')]=qs[_0xfbc7('0x1c')](_0x2cfc48[_0xfbc7('0x2c')][_0xfbc7('0x1c')]);}_0x15f51b[_0xfbc7('0x35')]=qs[_0xfbc7('0x36')](_0x2cfc48['query'][_0xfbc7('0x36')]);_0x15f51b[_0xfbc7('0x37')]=qs[_0xfbc7('0x2f')](_[_0xfbc7('0x38')](_0x2cfc48[_0xfbc7('0x2c')],_0x202f0a[_0xfbc7('0x2f')]));if(_0x4054d4[_0xfbc7('0x2d')]){if(_0x4054d4[_0xfbc7('0x2e')]){_0x4054d4[_0xfbc7('0x2e')]=moment(_0x4054d4[_0xfbc7('0x2e')])['add'](0x1,_0xfbc7('0x39'));}else{_0x4054d4[_0xfbc7('0x2e')]=moment(_0x4054d4[_0xfbc7('0x2d')])[_0xfbc7('0x3a')](0x1,'day');}_[_0xfbc7('0x3b')](_0x15f51b[_0xfbc7('0x37')],{'createdAt':{'$gte':_0x4054d4[_0xfbc7('0x2d')],'$lte':_0x4054d4[_0xfbc7('0x2e')]}});}if(_0x2cfc48[_0xfbc7('0x2c')][_0xfbc7('0x3c')]){_0x15f51b[_0xfbc7('0x37')]=_[_0xfbc7('0x3b')](_0x15f51b['where'],{'$or':_['map'](_0x15f51b[_0xfbc7('0x31')],function(_0x278c00){var _0x20995a={};_0x20995a[_0x278c00]={'$like':'%'+_0x2cfc48['query'][_0xfbc7('0x3c')]+'%'};return _0x20995a;})});}_0x15f51b=_[_0xfbc7('0x3b')]({},_0x15f51b,_0x2cfc48[_0xfbc7('0x3d')]);var _0x1b3832={'where':_0x15f51b['where']};return db[_0xfbc7('0x29')]['count'](_0x1b3832)[_0xfbc7('0x24')](function(_0x30c698){_0x2b8288[_0xfbc7('0x1b')]=_0x30c698;if(_0x2cfc48[_0xfbc7('0x2c')][_0xfbc7('0x3e')]){_0x15f51b[_0xfbc7('0x3f')]=[{'all':!![]}];}return db[_0xfbc7('0x29')][_0xfbc7('0x40')](_0x15f51b);})[_0xfbc7('0x24')](function(_0x2b9fb2){_0x2b8288[_0xfbc7('0x41')]=_0x2b9fb2;return _0x2b8288;})[_0xfbc7('0x24')](respondWithFilteredResult(_0x7b86ff,_0x15f51b))[_0xfbc7('0x42')](handleError(_0x7b86ff,null));};exports[_0xfbc7('0x43')]=function(_0x3116b5,_0x186483){var _0x4cebdf={'raw':![],'where':{'id':_0x3116b5[_0xfbc7('0x44')]['id']}},_0x1e5d08={};_0x1e5d08[_0xfbc7('0x45')]=_['keys'](db[_0xfbc7('0x29')][_0xfbc7('0x2a')]);_0x1e5d08[_0xfbc7('0x2c')]=_[_0xfbc7('0x2b')](_0x3116b5['query']);_0x1e5d08[_0xfbc7('0x2f')]=_[_0xfbc7('0x30')](_0x1e5d08[_0xfbc7('0x45')],_0x1e5d08[_0xfbc7('0x2c')]);_0x4cebdf[_0xfbc7('0x31')]=_['intersection'](_0x1e5d08['model'],qs[_0xfbc7('0x32')](_0x3116b5[_0xfbc7('0x2c')][_0xfbc7('0x32')]));_0x4cebdf['attributes']=_0x4cebdf[_0xfbc7('0x31')][_0xfbc7('0x46')]?_0x4cebdf['attributes']:_0x1e5d08[_0xfbc7('0x45')];if(_0x3116b5[_0xfbc7('0x2c')]['includeAll']){_0x4cebdf[_0xfbc7('0x3f')]=[{'all':!![]}];}_0x4cebdf=_[_0xfbc7('0x3b')]({},_0x4cebdf,_0x3116b5['options']);return db['VoiceQueueReport'][_0xfbc7('0x47')](_0x4cebdf)[_0xfbc7('0x24')](handleEntityNotFound(_0x186483,null))[_0xfbc7('0x24')](respondWithResult(_0x186483,null))[_0xfbc7('0x42')](handleError(_0x186483,null));};exports['create']=function(_0x53b18c,_0x44aa5c){return db['VoiceQueueReport'][_0xfbc7('0x48')](_0x53b18c[_0xfbc7('0x49')],{})[_0xfbc7('0x24')](respondWithResult(_0x44aa5c,0xc9))[_0xfbc7('0x42')](handleError(_0x44aa5c,null));};exports[_0xfbc7('0x23')]=function(_0x1a9ee8,_0x3370e0){if(_0x1a9ee8[_0xfbc7('0x49')]['id']){delete _0x1a9ee8[_0xfbc7('0x49')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x1a9ee8['params']['id']}})['then'](handleEntityNotFound(_0x3370e0,null))['then'](saveUpdates(_0x1a9ee8['body'],null))['then'](respondWithResult(_0x3370e0,null))['catch'](handleError(_0x3370e0,null));};exports[_0xfbc7('0x4a')]=function(_0x71e477,_0x23047f){return db[_0xfbc7('0x29')][_0xfbc7('0x47')]({'where':{'id':_0x71e477['params']['id']}})['then'](handleEntityNotFound(_0x23047f,null))[_0xfbc7('0x24')](removeEntity(_0x23047f,null))['catch'](handleError(_0x23047f,null));};exports[_0xfbc7('0x4b')]=function(_0x5509d0,_0x1cf17e){return db[_0xfbc7('0x29')][_0xfbc7('0x4b')]()[_0xfbc7('0x24')](respondWithResult(_0x1cf17e,null))[_0xfbc7('0x42')](handleError(_0x1cf17e,null));};exports[_0xfbc7('0x4c')]=function(_0x4ff3ca,_0x395567){var _0x27f5db={},_0x58ade3={},_0x3561b5={'count':0x0,'rows':[]};_0x58ade3['model']=_['keys'](db['VoiceQueueReport'][_0xfbc7('0x2a')]);var _0x1e30cc={'dateStart':_0x4ff3ca[_0xfbc7('0x2c')]['dateStart'],'dateEnd':_0x4ff3ca[_0xfbc7('0x2c')][_0xfbc7('0x2e')]};delete _0x4ff3ca[_0xfbc7('0x2c')][_0xfbc7('0x2d')];delete _0x4ff3ca['query'][_0xfbc7('0x2e')];_0x58ade3['query']=_['keys'](_0x4ff3ca[_0xfbc7('0x2c')]);_0x58ade3[_0xfbc7('0x2f')]=_[_0xfbc7('0x30')](_0x58ade3[_0xfbc7('0x45')],_0x58ade3[_0xfbc7('0x2c')]);_0x27f5db[_0xfbc7('0x31')]=_[_0xfbc7('0x30')](_0x58ade3[_0xfbc7('0x45')],qs[_0xfbc7('0x32')](_0x4ff3ca['query'][_0xfbc7('0x32')]));_0x27f5db['attributes']=_0x27f5db['attributes'][_0xfbc7('0x46')]?_0x27f5db['attributes']:_0x58ade3[_0xfbc7('0x45')];if(!_0x4ff3ca[_0xfbc7('0x2c')][_0xfbc7('0x33')]('nolimit')){_0x27f5db[_0xfbc7('0x1d')]=qs[_0xfbc7('0x1d')](_0x4ff3ca[_0xfbc7('0x2c')]['limit']);_0x27f5db[_0xfbc7('0x1c')]=qs[_0xfbc7('0x1c')](_0x4ff3ca[_0xfbc7('0x2c')][_0xfbc7('0x1c')]);}_0x27f5db[_0xfbc7('0x35')]=qs[_0xfbc7('0x36')](_0x4ff3ca[_0xfbc7('0x2c')]['sort']);_0x27f5db['where']=qs[_0xfbc7('0x2f')](_[_0xfbc7('0x38')](_0x4ff3ca[_0xfbc7('0x2c')],_0x58ade3[_0xfbc7('0x2f')]));if(_0x1e30cc[_0xfbc7('0x2d')]){if(_0x1e30cc['dateEnd']){_0x1e30cc['dateEnd']=moment(_0x1e30cc[_0xfbc7('0x2e')])[_0xfbc7('0x3a')](0x1,_0xfbc7('0x39'));}else{_0x1e30cc[_0xfbc7('0x2e')]=moment(_0x1e30cc['dateStart'])[_0xfbc7('0x3a')](0x1,'day');}_[_0xfbc7('0x3b')](_0x27f5db[_0xfbc7('0x37')],{'createdAt':{'$gte':_0x1e30cc['dateStart'],'$lte':_0x1e30cc[_0xfbc7('0x2e')]}});}if(_0x4ff3ca[_0xfbc7('0x2c')][_0xfbc7('0x3c')]){_0x27f5db[_0xfbc7('0x37')]=_[_0xfbc7('0x3b')](_0x27f5db[_0xfbc7('0x37')],{'$or':_['map'](_0x27f5db['attributes'],function(_0x5968b2){var _0x9002cb={};_0x9002cb[_0x5968b2]={'$like':'%'+_0x4ff3ca[_0xfbc7('0x2c')][_0xfbc7('0x3c')]+'%'};return _0x9002cb;})});}_0x27f5db=_['merge']({},_0x27f5db,_0x4ff3ca[_0xfbc7('0x3d')]);var _0x27c878={'where':_0x27f5db['where']};return db[_0xfbc7('0x29')][_0xfbc7('0x1b')](_0x27c878)[_0xfbc7('0x24')](function(_0x9c0171){_0x3561b5[_0xfbc7('0x1b')]=_0x9c0171;if(_0x4ff3ca[_0xfbc7('0x2c')][_0xfbc7('0x3e')]){_0x27f5db[_0xfbc7('0x3f')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x27f5db);})['then'](function(_0x4e6692){_0x3561b5[_0xfbc7('0x41')]=_0x4e6692;return _0x3561b5;})['then'](respondWithFilteredResult(_0x395567,_0x27f5db,_0xfbc7('0x4c')))[_0xfbc7('0x42')](handleError(_0x395567,null,_0xfbc7('0x4c')));};
\ No newline at end of file
index 06ccff4..2feb1da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a08=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x4fb260,_0x3f502a){var _0x17f5df=function(_0x16095c){while(--_0x16095c){_0x4fb260['push'](_0x4fb260['shift']());}};_0x17f5df(++_0x3f502a);}(_0x5a08,0x117));var _0x85a0=function(_0x1b2b81,_0x301414){_0x1b2b81=_0x1b2b81-0x0;var _0x27cc3a=_0x5a08[_0x1b2b81];return _0x27cc3a;};'use strict';var EventEmitter=require(_0x85a0('0x0'));var VoiceQueueReport=require(_0x85a0('0x1'))['db'][_0x85a0('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x85a0('0x3')](0x0);var events={'afterCreate':_0x85a0('0x4'),'afterUpdate':_0x85a0('0x5'),'afterDestroy':'remove'};function emitEvent(_0x52f0f9){return function(_0x3c4cb7,_0x1d4d13,_0x3f731d){VoiceQueueReportEvents[_0x85a0('0x6')](_0x52f0f9+':'+_0x3c4cb7['id'],_0x3c4cb7);VoiceQueueReportEvents[_0x85a0('0x6')](_0x52f0f9,_0x3c4cb7);_0x3f731d(null);};}for(var e in events){if(events[_0x85a0('0x7')](e)){var event=events[e];VoiceQueueReport[_0x85a0('0x8')](e,emitEvent(event));}}module[_0x85a0('0x9')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0xe953=['events','../../mysqldb','VoiceQueueReport','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5c25e5,_0x267457){var _0x1dbf02=function(_0x264735){while(--_0x264735){_0x5c25e5['push'](_0x5c25e5['shift']());}};_0x1dbf02(++_0x267457);}(_0xe953,0x1b9));var _0x3e95=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0xe953[_0x44a64f];return _0x52024b;};'use strict';var EventEmitter=require(_0x3e95('0x0'));var VoiceQueueReport=require(_0x3e95('0x1'))['db'][_0x3e95('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x3e95('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3e95('0x4')};function emitEvent(_0x240f3f){return function(_0x1eb112,_0x5cfe6b,_0x75f728){VoiceQueueReportEvents[_0x3e95('0x5')](_0x240f3f+':'+_0x1eb112['id'],_0x1eb112);VoiceQueueReportEvents['emit'](_0x240f3f,_0x1eb112);_0x75f728(null);};}for(var e in events){if(events[_0x3e95('0x6')](e)){var event=events[e];VoiceQueueReport[_0x3e95('0x7')](e,emitEvent(event));}}module[_0x3e95('0x8')]=VoiceQueueReportEvents;
\ No newline at end of file
index 7fe1066..2ebe7cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10d4=['api','moment','bluebird','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x3b4f36,_0x5c1bc5){var _0x42c965=function(_0x599a81){while(--_0x599a81){_0x3b4f36['push'](_0x3b4f36['shift']());}};_0x42c965(++_0x5c1bc5);}(_0x10d4,0x1a1));var _0x410d=function(_0x1e7600,_0x11348d){_0x1e7600=_0x1e7600-0x0;var _0x80b052=_0x10d4[_0x1e7600];return _0x80b052;};'use strict';var _=require(_0x410d('0x0'));var util=require(_0x410d('0x1'));var logger=require(_0x410d('0x2'))(_0x410d('0x3'));var moment=require(_0x410d('0x4'));var BPromise=require(_0x410d('0x5'));var rp=require('request-promise');var attributes=require(_0x410d('0x6'));module[_0x410d('0x7')]=function(_0x31189a,_0x5bf32a){return _0x31189a[_0x410d('0x8')](_0x410d('0x9'),attributes,{'tableName':_0x410d('0xa'),'paranoid':![],'indexes':[{'fields':[_0x410d('0xb')]},{'fields':['calleridnum']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x977c=['VoiceQueueReport','report_queue','uniqueid','calleridnum','../../config/logger','moment','bluebird','request-promise','exports','define'];(function(_0x2f993f,_0x25b5bb){var _0xec9b91=function(_0x9f0a7a){while(--_0x9f0a7a){_0x2f993f['push'](_0x2f993f['shift']());}};_0xec9b91(++_0x25b5bb);}(_0x977c,0x180));var _0xc977=function(_0x5d35c4,_0x594f71){_0x5d35c4=_0x5d35c4-0x0;var _0x5f5898=_0x977c[_0x5d35c4];return _0x5f5898;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc977('0x0'))('api');var moment=require(_0xc977('0x1'));var BPromise=require(_0xc977('0x2'));var rp=require(_0xc977('0x3'));var attributes=require('./voiceQueueReport.attributes');module[_0xc977('0x4')]=function(_0x5e66a2,_0x248c8c){return _0x5e66a2[_0xc977('0x5')](_0xc977('0x6'),attributes,{'tableName':_0xc977('0x7'),'paranoid':![],'indexes':[{'fields':[_0xc977('0x8')]},{'fields':[_0xc977('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index fba599b..8420129 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbee7=['jayson/promise','client','socket.io-emitter','localhost','./voiceQueueReport.socket','register','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueueReport','findAll','options','raw','limit','include','model','attributes','map','then','CreateVoiceQueueReport','VoiceQueueReport','create','body','UpdateVoiceQueueReport','update','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment'];(function(_0x1b07a8,_0x46b15b){var _0x45c84b=function(_0x81321){while(--_0x81321){_0x1b07a8['push'](_0x1b07a8['shift']());}};_0x45c84b(++_0x46b15b);}(_0xbee7,0x1c6));var _0x7bee=function(_0x5d6a51,_0x30c4c0){_0x5d6a51=_0x5d6a51-0x0;var _0x551c72=_0xbee7[_0x5d6a51];return _0x551c72;};'use strict';var _=require(_0x7bee('0x0'));var util=require(_0x7bee('0x1'));var moment=require(_0x7bee('0x2'));var BPromise=require(_0x7bee('0x3'));var rs=require(_0x7bee('0x4'));var fs=require('fs');var db=require(_0x7bee('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7bee('0x6'));var config=require(_0x7bee('0x7'));var jayson=require(_0x7bee('0x8'));var client=jayson[_0x7bee('0x9')]['http']({'port':0x232a});var socket=require(_0x7bee('0xa'))({'host':_0x7bee('0xb'),'port':0x18eb});require(_0x7bee('0xc'))[_0x7bee('0xd')](socket);function respondWithRpcPromise(_0x4d40a0,_0xf5f30b,_0x54b525){return new BPromise(function(_0x10f0f6,_0x3f3a7b){return client[_0x7bee('0xe')](_0x4d40a0,_0x54b525)['then'](function(_0xbf9bf1){logger[_0x7bee('0xf')](_0x7bee('0x10'),_0xf5f30b,_0x7bee('0x11'));logger[_0x7bee('0x12')](_0x7bee('0x13'),_0xf5f30b,_0x7bee('0x11'),JSON[_0x7bee('0x14')](_0xbf9bf1));if(_0xbf9bf1[_0x7bee('0x15')]){if(_0xbf9bf1['error']['code']===0x1f4){logger[_0x7bee('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0xf5f30b,_0xbf9bf1['error']['message']);return _0x3f3a7b(_0xbf9bf1[_0x7bee('0x15')]['message']);}logger[_0x7bee('0x15')](_0x7bee('0x10'),_0xf5f30b,_0xbf9bf1[_0x7bee('0x15')]['message']);return _0x10f0f6(_0xbf9bf1[_0x7bee('0x15')][_0x7bee('0x16')]);}else{logger[_0x7bee('0xf')](_0x7bee('0x10'),_0xf5f30b,_0x7bee('0x11'));_0x10f0f6(_0xbf9bf1[_0x7bee('0x17')][_0x7bee('0x16')]);}})[_0x7bee('0x18')](function(_0x5a7cd9){logger[_0x7bee('0x15')](_0x7bee('0x10'),_0xf5f30b,_0x5a7cd9);_0x3f3a7b(_0x5a7cd9);});});}exports[_0x7bee('0x19')]=function(_0x210c10){var _0x375944=this;return new Promise(function(_0x7a577,_0x583d5b){return db['VoiceQueueReport'][_0x7bee('0x1a')]({'raw':_0x210c10[_0x7bee('0x1b')]?_0x210c10['options'][_0x7bee('0x1c')]===undefined?!![]:![]:!![],'where':_0x210c10[_0x7bee('0x1b')]?_0x210c10[_0x7bee('0x1b')]['where']||null:null,'attributes':_0x210c10['options']?_0x210c10[_0x7bee('0x1b')]['attributes']||null:null,'limit':_0x210c10['options']?_0x210c10[_0x7bee('0x1b')][_0x7bee('0x1d')]||null:null,'include':_0x210c10[_0x7bee('0x1b')]?_0x210c10[_0x7bee('0x1b')]['include']?_['map'](_0x210c10[_0x7bee('0x1b')][_0x7bee('0x1e')],function(_0x24df88){return{'model':db[_0x24df88[_0x7bee('0x1f')]],'as':_0x24df88['as'],'attributes':_0x24df88[_0x7bee('0x20')],'include':_0x24df88[_0x7bee('0x1e')]?_[_0x7bee('0x21')](_0x24df88[_0x7bee('0x1e')],function(_0x318f66){return{'model':db[_0x318f66[_0x7bee('0x1f')]],'as':_0x318f66['as'],'attributes':_0x318f66['attributes'],'include':_0x318f66['include']?_[_0x7bee('0x21')](_0x318f66[_0x7bee('0x1e')],function(_0x2fdeb5){return{'model':db[_0x2fdeb5[_0x7bee('0x1f')]],'as':_0x2fdeb5['as'],'attributes':_0x2fdeb5[_0x7bee('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7bee('0x22')](function(_0x22efee){logger['info'](_0x7bee('0x19'),_0x210c10);logger[_0x7bee('0x12')](_0x7bee('0x19'),_0x210c10,JSON['stringify'](_0x22efee));_0x7a577(_0x22efee);})[_0x7bee('0x18')](function(_0x5070ac){logger[_0x7bee('0x15')](_0x7bee('0x19'),_0x5070ac['message'],_0x210c10);_0x583d5b(_0x375944['error'](0x1f4,_0x5070ac[_0x7bee('0x16')]));});});};exports[_0x7bee('0x23')]=function(_0x4a6d60){var _0x18ab29=this;return new Promise(function(_0x3c070a,_0x28da66){return db[_0x7bee('0x24')][_0x7bee('0x25')](_0x4a6d60[_0x7bee('0x26')],{'raw':_0x4a6d60[_0x7bee('0x1b')]?_0x4a6d60[_0x7bee('0x1b')][_0x7bee('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x10985d){logger[_0x7bee('0xf')](_0x7bee('0x23'),_0x4a6d60);logger[_0x7bee('0x12')](_0x7bee('0x23'),_0x4a6d60,JSON[_0x7bee('0x14')](_0x10985d));_0x3c070a(_0x10985d);})[_0x7bee('0x18')](function(_0x21fcd6){logger['error'](_0x7bee('0x23'),_0x21fcd6['message'],_0x4a6d60);_0x28da66(_0x18ab29[_0x7bee('0x15')](0x1f4,_0x21fcd6['message']));});});};exports[_0x7bee('0x27')]=function(_0x37ff3f){var _0x3ff857=this;return new Promise(function(_0x25662f,_0x5213e4){return db[_0x7bee('0x24')][_0x7bee('0x28')](_0x37ff3f['body'],{'raw':_0x37ff3f[_0x7bee('0x1b')]?_0x37ff3f[_0x7bee('0x1b')][_0x7bee('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37ff3f[_0x7bee('0x1b')]?_0x37ff3f[_0x7bee('0x1b')][_0x7bee('0x29')]||null:null,'attributes':_0x37ff3f[_0x7bee('0x1b')]?_0x37ff3f['options'][_0x7bee('0x20')]||null:null,'limit':_0x37ff3f[_0x7bee('0x1b')]?_0x37ff3f['options'][_0x7bee('0x1d')]||null:null})[_0x7bee('0x22')](function(_0x270ff5){logger[_0x7bee('0xf')](_0x7bee('0x27'),_0x37ff3f);logger[_0x7bee('0x12')](_0x7bee('0x27'),_0x37ff3f,JSON[_0x7bee('0x14')](_0x270ff5));_0x25662f(_0x270ff5);})[_0x7bee('0x18')](function(_0x2d01ce){logger[_0x7bee('0x15')](_0x7bee('0x27'),_0x2d01ce['message'],_0x37ff3f);_0x5213e4(_0x3ff857[_0x7bee('0x15')](0x1f4,_0x2d01ce[_0x7bee('0x16')]));});});};
\ No newline at end of file
+var _0x8c6c=['message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','include','map','attributes','model','CreateVoiceQueueReport','create','body','stringify','update','where','limit','UpdateVoiceQueueReport','lodash','util','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','http','./voiceQueueReport.socket','request','then','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','VoiceQueueReport,\x20%s,\x20%s'];(function(_0x5db124,_0x460a28){var _0x10f356=function(_0xf9f678){while(--_0xf9f678){_0x5db124['push'](_0x5db124['shift']());}};_0x10f356(++_0x460a28);}(_0x8c6c,0x133));var _0xc8c6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x8c6c[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xc8c6('0x0'));var util=require(_0xc8c6('0x1'));var moment=require('moment');var BPromise=require(_0xc8c6('0x2'));var rs=require('randomstring');var fs=require('fs');var db=require(_0xc8c6('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc8c6('0x4'));var config=require(_0xc8c6('0x5'));var jayson=require(_0xc8c6('0x6'));var client=jayson['client'][_0xc8c6('0x7')]({'port':0x232a});var socket=require('socket.io-emitter')({'host':'localhost','port':0x18eb});require(_0xc8c6('0x8'))['register'](socket);function respondWithRpcPromise(_0x266a75,_0x29b6cc,_0xe1a778){return new BPromise(function(_0x10ade3,_0x556147){return client[_0xc8c6('0x9')](_0x266a75,_0xe1a778)[_0xc8c6('0xa')](function(_0x333620){logger[_0xc8c6('0xb')]('VoiceQueueReport,\x20%s,\x20%s',_0x29b6cc,_0xc8c6('0xc'));logger[_0xc8c6('0xd')](_0xc8c6('0xe'),_0x29b6cc,_0xc8c6('0xc'),JSON['stringify'](_0x333620));if(_0x333620[_0xc8c6('0xf')]){if(_0x333620[_0xc8c6('0xf')]['code']===0x1f4){logger[_0xc8c6('0xf')](_0xc8c6('0x10'),_0x29b6cc,_0x333620[_0xc8c6('0xf')][_0xc8c6('0x11')]);return _0x556147(_0x333620[_0xc8c6('0xf')][_0xc8c6('0x11')]);}logger[_0xc8c6('0xf')](_0xc8c6('0x10'),_0x29b6cc,_0x333620[_0xc8c6('0xf')][_0xc8c6('0x11')]);return _0x10ade3(_0x333620[_0xc8c6('0xf')][_0xc8c6('0x11')]);}else{logger[_0xc8c6('0xb')](_0xc8c6('0x10'),_0x29b6cc,_0xc8c6('0xc'));_0x10ade3(_0x333620['result'][_0xc8c6('0x11')]);}})[_0xc8c6('0x12')](function(_0x56736e){logger[_0xc8c6('0xf')](_0xc8c6('0x10'),_0x29b6cc,_0x56736e);_0x556147(_0x56736e);});});}exports[_0xc8c6('0x13')]=function(_0x16c881){var _0x1fffbb=this;return new Promise(function(_0x96dfa6,_0x3c50cf){return db[_0xc8c6('0x14')][_0xc8c6('0x15')]({'raw':_0x16c881[_0xc8c6('0x16')]?_0x16c881[_0xc8c6('0x16')][_0xc8c6('0x17')]===undefined?!![]:![]:!![],'where':_0x16c881[_0xc8c6('0x16')]?_0x16c881['options']['where']||null:null,'attributes':_0x16c881[_0xc8c6('0x16')]?_0x16c881['options']['attributes']||null:null,'limit':_0x16c881['options']?_0x16c881[_0xc8c6('0x16')]['limit']||null:null,'include':_0x16c881[_0xc8c6('0x16')]?_0x16c881['options'][_0xc8c6('0x18')]?_[_0xc8c6('0x19')](_0x16c881['options'][_0xc8c6('0x18')],function(_0x2b4a40){return{'model':db[_0x2b4a40['model']],'as':_0x2b4a40['as'],'attributes':_0x2b4a40[_0xc8c6('0x1a')],'include':_0x2b4a40[_0xc8c6('0x18')]?_[_0xc8c6('0x19')](_0x2b4a40[_0xc8c6('0x18')],function(_0x331cc8){return{'model':db[_0x331cc8[_0xc8c6('0x1b')]],'as':_0x331cc8['as'],'attributes':_0x331cc8[_0xc8c6('0x1a')],'include':_0x331cc8[_0xc8c6('0x18')]?_['map'](_0x331cc8[_0xc8c6('0x18')],function(_0x2ad01d){return{'model':db[_0x2ad01d[_0xc8c6('0x1b')]],'as':_0x2ad01d['as'],'attributes':_0x2ad01d[_0xc8c6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc8c6('0xa')](function(_0x5054b5){logger[_0xc8c6('0xb')](_0xc8c6('0x13'),_0x16c881);logger['debug'](_0xc8c6('0x13'),_0x16c881,JSON['stringify'](_0x5054b5));_0x96dfa6(_0x5054b5);})[_0xc8c6('0x12')](function(_0x5a63cc){logger[_0xc8c6('0xf')](_0xc8c6('0x13'),_0x5a63cc[_0xc8c6('0x11')],_0x16c881);_0x3c50cf(_0x1fffbb[_0xc8c6('0xf')](0x1f4,_0x5a63cc[_0xc8c6('0x11')]));});});};exports[_0xc8c6('0x1c')]=function(_0x1df126){var _0x500853=this;return new Promise(function(_0x2b8979,_0x5d1c09){return db[_0xc8c6('0x14')][_0xc8c6('0x1d')](_0x1df126[_0xc8c6('0x1e')],{'raw':_0x1df126[_0xc8c6('0x16')]?_0x1df126['options'][_0xc8c6('0x17')]===undefined?!![]:![]:!![]})[_0xc8c6('0xa')](function(_0x55a2c2){logger['info'](_0xc8c6('0x1c'),_0x1df126);logger['debug'](_0xc8c6('0x1c'),_0x1df126,JSON[_0xc8c6('0x1f')](_0x55a2c2));_0x2b8979(_0x55a2c2);})[_0xc8c6('0x12')](function(_0x75ea0f){logger[_0xc8c6('0xf')](_0xc8c6('0x1c'),_0x75ea0f[_0xc8c6('0x11')],_0x1df126);_0x5d1c09(_0x500853[_0xc8c6('0xf')](0x1f4,_0x75ea0f[_0xc8c6('0x11')]));});});};exports['UpdateVoiceQueueReport']=function(_0x460253){var _0x515a12=this;return new Promise(function(_0x34cbda,_0x27fa1f){return db[_0xc8c6('0x14')][_0xc8c6('0x20')](_0x460253[_0xc8c6('0x1e')],{'raw':_0x460253[_0xc8c6('0x16')]?_0x460253[_0xc8c6('0x16')][_0xc8c6('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x460253[_0xc8c6('0x16')]?_0x460253[_0xc8c6('0x16')][_0xc8c6('0x21')]||null:null,'attributes':_0x460253[_0xc8c6('0x16')]?_0x460253[_0xc8c6('0x16')][_0xc8c6('0x1a')]||null:null,'limit':_0x460253[_0xc8c6('0x16')]?_0x460253[_0xc8c6('0x16')][_0xc8c6('0x22')]||null:null})[_0xc8c6('0xa')](function(_0x3d4458){logger['info'](_0xc8c6('0x23'),_0x460253);logger[_0xc8c6('0xd')]('UpdateVoiceQueueReport',_0x460253,JSON[_0xc8c6('0x1f')](_0x3d4458));_0x34cbda(_0x3d4458);})[_0xc8c6('0x12')](function(_0xf6f88){logger['error'](_0xc8c6('0x23'),_0xf6f88[_0xc8c6('0x11')],_0x460253);_0x27fa1f(_0x515a12[_0xc8c6('0xf')](0x1f4,_0xf6f88['message']));});});};
\ No newline at end of file
index d7599ff..661266a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa137=['emit','register','length','voiceQueueReport:','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa137,0x82));var _0x7a13=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xa137[_0x49b207];return _0x2dc8fa;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x7a13('0x0'),_0x7a13('0x1'),_0x7a13('0x2')];function createListener(_0x525ade,_0x143684){return function(_0xd0b1ce){_0x143684[_0x7a13('0x3')](_0x525ade,_0xd0b1ce);};}function removeListener(_0x2fef64,_0x2b47a3){return function(){VoiceQueueReportEvents['removeListener'](_0x2fef64,_0x2b47a3);};}exports[_0x7a13('0x4')]=function(_0x56245e){for(var _0x4cbd6a=0x0,_0xea26a7=events[_0x7a13('0x5')];_0x4cbd6a<_0xea26a7;_0x4cbd6a++){var _0xc76abe=events[_0x4cbd6a];var _0x238af6=createListener(_0x7a13('0x6')+_0xc76abe,_0x56245e);VoiceQueueReportEvents['on'](_0xc76abe,_0x238af6);}};
\ No newline at end of file
+var _0x3800=['emit','removeListener','register','length','remove','update'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x3800,0x1a2));var _0x0380=function(_0x5465b7,_0x722953){_0x5465b7=_0x5465b7-0x0;var _0x2caee7=_0x3800[_0x5465b7];return _0x2caee7;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=['save',_0x0380('0x0'),_0x0380('0x1')];function createListener(_0x23a78e,_0x569aa4){return function(_0x2d36f5){_0x569aa4[_0x0380('0x2')](_0x23a78e,_0x2d36f5);};}function removeListener(_0x1d7790,_0x395c10){return function(){VoiceQueueReportEvents[_0x0380('0x3')](_0x1d7790,_0x395c10);};}exports[_0x0380('0x4')]=function(_0x15f5bb){for(var _0x4ea9dc=0x0,_0x301d5f=events[_0x0380('0x5')];_0x4ea9dc<_0x301d5f;_0x4ea9dc++){var _0x4fe5e3=events[_0x4ea9dc];var _0x14af97=createListener('voiceQueueReport:'+_0x4fe5e3,_0x15f5bb);VoiceQueueReportEvents['on'](_0x4fe5e3,_0x14af97);}};
\ No newline at end of file
index d042bd0..2fe74ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['/:id','show','create','update','delete','destroy','multer','util','path','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index'];(function(_0x25a7c6,_0x38a574){var _0x2fae39=function(_0x505e63){while(--_0x505e63){_0x25a7c6['push'](_0x25a7c6['shift']());}};_0x2fae39(++_0x38a574);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x0a9e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0a9e('0x4'));var controller=require(_0x0a9e('0x5'));router[_0x0a9e('0x6')]('/',auth[_0x0a9e('0x7')](),controller[_0x0a9e('0x8')]);router['get'](_0x0a9e('0x9'),auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router['put']('/:id',auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0x9'),auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['/:id','show','create','update','delete','destroy','multer','util','path','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index'];(function(_0x38f3b0,_0x24c6c7){var _0x5689f1=function(_0x34f0eb){while(--_0x34f0eb){_0x38f3b0['push'](_0x38f3b0['shift']());}};_0x5689f1(++_0x24c6c7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x0a9e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0a9e('0x4'));var controller=require(_0x0a9e('0x5'));router[_0x0a9e('0x6')]('/',auth[_0x0a9e('0x7')](),controller[_0x0a9e('0x8')]);router['get'](_0x0a9e('0x9'),auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router['put']('/:id',auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0x9'),auth[_0x0a9e('0x7')](),controller[_0x0a9e('0xe')]);module['exports']=router;
\ No newline at end of file
index 396b429..10551d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c12=['moment','exports','STRING','DATE'];(function(_0x32c314,_0x41148f){var _0x5966f5=function(_0x53877a){while(--_0x53877a){_0x32c314['push'](_0x32c314['shift']());}};_0x5966f5(++_0x41148f);}(_0x5c12,0x188));var _0x25c1=function(_0x53fe97,_0x544271){_0x53fe97=_0x53fe97-0x0;var _0x5c49a2=_0x5c12[_0x53fe97];return _0x5c49a2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x25c1('0x0'));module[_0x25c1('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x25c1('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x25c1('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x25c1('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x25c1('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x25c1('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x25c1('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x25c1('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x25c1('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x25c1('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x25c1('0x3')],'allowNull':![],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}};
\ No newline at end of file
+var _0x4bc3=['STRING','DATE','sequelize','moment'];(function(_0x1c8e8d,_0x5c1d10){var _0x49d76b=function(_0x1ba43c){while(--_0x1ba43c){_0x1c8e8d['push'](_0x1c8e8d['shift']());}};_0x49d76b(++_0x5c1d10);}(_0x4bc3,0x16e));var _0x34bc=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x4bc3[_0x3c8e9a];return _0x2d4c57;};'use strict';var Sequelize=require(_0x34bc('0x0'));var moment=require(_0x34bc('0x1'));module['exports']={'time':{'type':Sequelize[_0x34bc('0x2')]},'callid':{'type':Sequelize[_0x34bc('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x34bc('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x34bc('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x34bc('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x34bc('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x34bc('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x34bc('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x34bc('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x34bc('0x3')],'allowNull':![],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}};
\ No newline at end of file
index cfb5978..ea060c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82ad=['params','includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filters','pick','add','day','merge','filter','map','options','VoiceQueuesLog','include','findAll','catch'];(function(_0x3c500f,_0x61c133){var _0x2bd2f9=function(_0x51b894){while(--_0x51b894){_0x3c500f['push'](_0x3c500f['shift']());}};_0x2bd2f9(++_0x61c133);}(_0x82ad,0x1a3));var _0xd82a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x82ad[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd82a('0x0'));var rimraf=require(_0xd82a('0x1'));var zipdir=require(_0xd82a('0x2'));var jsonpatch=require(_0xd82a('0x3'));var rp=require(_0xd82a('0x4'));var moment=require(_0xd82a('0x5'));var BPromise=require(_0xd82a('0x6'));var Mustache=require('mustache');var util=require(_0xd82a('0x7'));var path=require(_0xd82a('0x8'));var sox=require('sox');var csv=require(_0xd82a('0x9'));var ejs=require(_0xd82a('0xa'));var fs=require('fs');var _=require(_0xd82a('0xb'));var squel=require('squel');var crypto=require(_0xd82a('0xc'));var jsforce=require(_0xd82a('0xd'));var deskjs=require(_0xd82a('0xe'));var toCsv=require(_0xd82a('0x9'));var querystring=require('querystring');var Papa=require(_0xd82a('0xf'));var qs=require(_0xd82a('0x10'));var logger=require(_0xd82a('0x11'))(_0xd82a('0x12'));var utils=require(_0xd82a('0x13'));var config=require('../../config/environment');var db=require(_0xd82a('0x14'))['db'];function respondWithStatusCode(_0x321eff,_0x48b353){_0x48b353=_0x48b353||0xcc;return function(_0x3a4e61){if(_0x3a4e61){return _0x321eff['sendStatus'](_0x48b353);}return _0x321eff[_0xd82a('0x15')](_0x48b353)['end']();};}function respondWithResult(_0x83ec53,_0x8ede84){_0x8ede84=_0x8ede84||0xc8;return function(_0x271ad0){if(_0x271ad0){return _0x83ec53['status'](_0x8ede84)[_0xd82a('0x16')](_0x271ad0);}};}function respondWithFilteredResult(_0x1d5df3,_0x40b869){return function(_0x3caad6){if(_0x3caad6){var _0x50ce50=_0x3caad6[_0xd82a('0x17')],_0x1e8b37=_0x40b869[_0xd82a('0x18')],_0x10806d=_0x40b869[_0xd82a('0x18')]+_0x40b869['limit'],_0xf2dc32;if(_0x10806d>=_0x50ce50){_0x10806d=_0x50ce50;_0xf2dc32=0xc8;}else{_0xf2dc32=0xce;}_0x1d5df3[_0xd82a('0x15')](_0xf2dc32);return _0x1d5df3[_0xd82a('0x19')](_0xd82a('0x1a'),_0x1e8b37+'-'+_0x10806d+'/'+_0x50ce50)[_0xd82a('0x16')](_0x3caad6);}return null;};}function patchUpdates(_0x3cee4f){return function(_0x1318f2){try{jsonpatch[_0xd82a('0x1b')](_0x1318f2,_0x3cee4f,!![]);}catch(_0x8009ed){return BPromise[_0xd82a('0x1c')](_0x8009ed);}return _0x1318f2[_0xd82a('0x1d')]();};}function saveUpdates(_0xe96c2d,_0x462973){return function(_0x207612){if(_0x207612){return _0x207612[_0xd82a('0x1e')](_0xe96c2d)[_0xd82a('0x1f')](function(_0x5b2a9f){return _0x5b2a9f;});}return null;};}function removeEntity(_0x411e10,_0x49f2bf){return function(_0x2eac18){if(_0x2eac18){return _0x2eac18[_0xd82a('0x20')]()['then'](function(){_0x411e10[_0xd82a('0x15')](0xcc)[_0xd82a('0x21')]();});}};}function handleEntityNotFound(_0x175313,_0x4524b8){return function(_0x366d06){if(!_0x366d06){_0x175313['sendStatus'](0x194);}return _0x366d06;};}function handleError(_0x2ba176,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x265bb6){logger[_0xd82a('0x22')](_0x265bb6[_0xd82a('0x23')]);if(_0x265bb6[_0xd82a('0x24')]){delete _0x265bb6[_0xd82a('0x24')];}_0x2ba176[_0xd82a('0x15')](_0x2772fe)['send'](_0x265bb6);};}exports['index']=function(_0x196ab8,_0x461645){var _0x454850={},_0x1d0c23={},_0x383038={'count':0x0,'rows':[]};var _0x5c460b=db['VoiceQueuesLog'][_0xd82a('0x25')];_0x1d0c23[_0xd82a('0x26')]=_[_0xd82a('0x27')](_0x5c460b);var _0x7c7587={'dateStart':_0x196ab8[_0xd82a('0x28')][_0xd82a('0x29')],'dateEnd':_0x196ab8['query'][_0xd82a('0x2a')]};delete _0x196ab8['query'][_0xd82a('0x29')];delete _0x196ab8[_0xd82a('0x28')][_0xd82a('0x2a')];_0x1d0c23['query']=_[_0xd82a('0x27')](_0x196ab8[_0xd82a('0x28')]);_0x1d0c23['filters']=_[_0xd82a('0x2b')](_0x1d0c23['model'],_0x1d0c23['query']);_0x454850[_0xd82a('0x2c')]=_[_0xd82a('0x2b')](_0x1d0c23[_0xd82a('0x26')],qs['fields'](_0x196ab8[_0xd82a('0x28')][_0xd82a('0x2d')]));_0x454850[_0xd82a('0x2c')]=_0x454850['attributes'][_0xd82a('0x2e')]?_0x454850[_0xd82a('0x2c')]:_0x1d0c23[_0xd82a('0x26')];if(!_0x196ab8[_0xd82a('0x28')][_0xd82a('0x2f')](_0xd82a('0x30'))){_0x454850[_0xd82a('0x31')]=qs['limit'](_0x196ab8[_0xd82a('0x28')][_0xd82a('0x31')]);_0x454850[_0xd82a('0x18')]=qs[_0xd82a('0x18')](_0x196ab8['query'][_0xd82a('0x18')]);}_0x454850[_0xd82a('0x32')]=qs['sort'](_0x196ab8[_0xd82a('0x28')]['sort']);_0x454850[_0xd82a('0x33')]=qs[_0xd82a('0x34')](_[_0xd82a('0x35')](_0x196ab8[_0xd82a('0x28')],_0x1d0c23[_0xd82a('0x34')]));if(_0x7c7587['dateStart']){if(_0x7c7587['dateEnd']){_0x7c7587['dateEnd']=moment(_0x7c7587['dateEnd'])[_0xd82a('0x36')](0x1,_0xd82a('0x37'));}else{_0x7c7587['dateEnd']=moment(_0x7c7587[_0xd82a('0x29')])[_0xd82a('0x36')](0x1,_0xd82a('0x37'));}_[_0xd82a('0x38')](_0x454850[_0xd82a('0x33')],{'createdAt':{'$gte':_0x7c7587['dateStart'],'$lte':_0x7c7587[_0xd82a('0x2a')]}});}if(_0x196ab8[_0xd82a('0x28')][_0xd82a('0x39')]){_0x454850[_0xd82a('0x33')]=_[_0xd82a('0x38')](_0x454850['where'],{'$or':_[_0xd82a('0x3a')](_0x454850[_0xd82a('0x2c')],function(_0x401463){var _0x2a89f9={};_0x2a89f9[_0x401463]={'$like':'%'+_0x196ab8[_0xd82a('0x28')]['filter']+'%'};return _0x2a89f9;})});}_0x454850=_['merge']({},_0x454850,_0x196ab8[_0xd82a('0x3b')]);var _0x78b72={'where':_0x454850['where']};return db[_0xd82a('0x3c')][_0xd82a('0x17')](_0x78b72)[_0xd82a('0x1f')](function(_0x5ae638){_0x383038[_0xd82a('0x17')]=_0x5ae638;if(_0x196ab8['query']['includeAll']){_0x454850[_0xd82a('0x3d')]=[{'all':!![]}];}return db[_0xd82a('0x3c')][_0xd82a('0x3e')](_0x454850);})[_0xd82a('0x1f')](function(_0x141463){_0x383038['rows']=_0x141463;return _0x383038;})[_0xd82a('0x1f')](respondWithFilteredResult(_0x461645,_0x454850))[_0xd82a('0x3f')](handleError(_0x461645,null));};exports['show']=function(_0x36c044,_0x26c365){var _0x2644cf={'raw':!![],'where':{'id':_0x36c044[_0xd82a('0x40')]['id']}},_0xad7f61={};_0xad7f61[_0xd82a('0x26')]=_[_0xd82a('0x27')](db[_0xd82a('0x3c')]['rawAttributes']);_0xad7f61[_0xd82a('0x28')]=_['keys'](_0x36c044[_0xd82a('0x28')]);_0xad7f61['filters']=_[_0xd82a('0x2b')](_0xad7f61[_0xd82a('0x26')],_0xad7f61[_0xd82a('0x28')]);_0x2644cf['attributes']=_[_0xd82a('0x2b')](_0xad7f61[_0xd82a('0x26')],qs[_0xd82a('0x2d')](_0x36c044['query'][_0xd82a('0x2d')]));_0x2644cf[_0xd82a('0x2c')]=_0x2644cf[_0xd82a('0x2c')]['length']?_0x2644cf['attributes']:_0xad7f61[_0xd82a('0x26')];if(_0x36c044[_0xd82a('0x28')][_0xd82a('0x41')]){_0x2644cf[_0xd82a('0x3d')]=[{'all':!![]}];}_0x2644cf=_[_0xd82a('0x38')]({},_0x2644cf,_0x36c044[_0xd82a('0x3b')]);return db['VoiceQueuesLog']['find'](_0x2644cf)[_0xd82a('0x1f')](handleEntityNotFound(_0x26c365,null))[_0xd82a('0x1f')](respondWithResult(_0x26c365,null))[_0xd82a('0x3f')](handleError(_0x26c365,null));};exports['create']=function(_0x3b0fd5,_0x1f6c11){return db['VoiceQueuesLog'][_0xd82a('0x42')](_0x3b0fd5[_0xd82a('0x43')],{})['then'](respondWithResult(_0x1f6c11,0xc9))[_0xd82a('0x3f')](handleError(_0x1f6c11,null));};exports[_0xd82a('0x1e')]=function(_0x192668,_0x37017f){if(_0x192668[_0xd82a('0x43')]['id']){delete _0x192668[_0xd82a('0x43')]['id'];}return db['VoiceQueuesLog'][_0xd82a('0x44')]({'where':{'id':_0x192668[_0xd82a('0x40')]['id']}})[_0xd82a('0x1f')](handleEntityNotFound(_0x37017f,null))[_0xd82a('0x1f')](saveUpdates(_0x192668['body'],null))['then'](respondWithResult(_0x37017f,null))[_0xd82a('0x3f')](handleError(_0x37017f,null));};exports[_0xd82a('0x20')]=function(_0x58e9c8,_0x726d62){return db[_0xd82a('0x3c')][_0xd82a('0x44')]({'where':{'id':_0x58e9c8[_0xd82a('0x40')]['id']}})['then'](handleEntityNotFound(_0x726d62,null))['then'](removeEntity(_0x726d62,null))[_0xd82a('0x3f')](handleError(_0x726d62,null));};
\ No newline at end of file
+var _0x6fd9=['nolimit','limit','order','sort','pick','add','day','merge','where','filter','includeAll','VoiceQueuesLog','rows','catch','show','params','rawAttributes','fields','include','options','find','create','body','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','keys','query','dateStart','dateEnd','filters','intersection','model','attributes','length','hasOwnProperty'];(function(_0x469458,_0x26aa60){var _0x3d9334=function(_0x239396){while(--_0x239396){_0x469458['push'](_0x469458['shift']());}};_0x3d9334(++_0x26aa60);}(_0x6fd9,0xe3));var _0x96fd=function(_0x19fcb3,_0x1ac102){_0x19fcb3=_0x19fcb3-0x0;var _0x4ef6f1=_0x6fd9[_0x19fcb3];return _0x4ef6f1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x96fd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x96fd('0x1'));var moment=require(_0x96fd('0x2'));var BPromise=require(_0x96fd('0x3'));var Mustache=require(_0x96fd('0x4'));var util=require(_0x96fd('0x5'));var path=require('path');var sox=require(_0x96fd('0x6'));var csv=require(_0x96fd('0x7'));var ejs=require(_0x96fd('0x8'));var fs=require('fs');var _=require(_0x96fd('0x9'));var squel=require(_0x96fd('0xa'));var crypto=require(_0x96fd('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x96fd('0xc'));var Papa=require(_0x96fd('0xd'));var qs=require('../../components/parsers/qs');var logger=require(_0x96fd('0xe'))(_0x96fd('0xf'));var utils=require(_0x96fd('0x10'));var config=require('../../config/environment');var db=require(_0x96fd('0x11'))['db'];function respondWithStatusCode(_0x490e51,_0x2e4dce){_0x2e4dce=_0x2e4dce||0xcc;return function(_0x1c708a){if(_0x1c708a){return _0x490e51[_0x96fd('0x12')](_0x2e4dce);}return _0x490e51[_0x96fd('0x13')](_0x2e4dce)['end']();};}function respondWithResult(_0x3b6a81,_0x377ffa){_0x377ffa=_0x377ffa||0xc8;return function(_0x43598d){if(_0x43598d){return _0x3b6a81[_0x96fd('0x13')](_0x377ffa)[_0x96fd('0x14')](_0x43598d);}};}function respondWithFilteredResult(_0x3a18a0,_0x5342d0){return function(_0x55f62){if(_0x55f62){var _0x5aeb31=_0x55f62[_0x96fd('0x15')],_0x22ab53=_0x5342d0[_0x96fd('0x16')],_0x1e8be0=_0x5342d0[_0x96fd('0x16')]+_0x5342d0['limit'],_0xe5b0bd;if(_0x1e8be0>=_0x5aeb31){_0x1e8be0=_0x5aeb31;_0xe5b0bd=0xc8;}else{_0xe5b0bd=0xce;}_0x3a18a0[_0x96fd('0x13')](_0xe5b0bd);return _0x3a18a0[_0x96fd('0x17')](_0x96fd('0x18'),_0x22ab53+'-'+_0x1e8be0+'/'+_0x5aeb31)['json'](_0x55f62);}return null;};}function patchUpdates(_0x568685){return function(_0x3b8faa){try{jsonpatch['apply'](_0x3b8faa,_0x568685,!![]);}catch(_0x2fb978){return BPromise['reject'](_0x2fb978);}return _0x3b8faa[_0x96fd('0x19')]();};}function saveUpdates(_0x1dcd92,_0x20d697){return function(_0x48a1d5){if(_0x48a1d5){return _0x48a1d5[_0x96fd('0x1a')](_0x1dcd92)[_0x96fd('0x1b')](function(_0x305393){return _0x305393;});}return null;};}function removeEntity(_0x92c4e,_0x4bf543){return function(_0x1942ac){if(_0x1942ac){return _0x1942ac[_0x96fd('0x1c')]()[_0x96fd('0x1b')](function(){_0x92c4e[_0x96fd('0x13')](0xcc)[_0x96fd('0x1d')]();});}};}function handleEntityNotFound(_0x5e67a5,_0x29810b){return function(_0x20f956){if(!_0x20f956){_0x5e67a5[_0x96fd('0x12')](0x194);}return _0x20f956;};}function handleError(_0x709109,_0x239e50){_0x239e50=_0x239e50||0x1f4;return function(_0x5474b2){logger[_0x96fd('0x1e')](_0x5474b2[_0x96fd('0x1f')]);if(_0x5474b2[_0x96fd('0x20')]){delete _0x5474b2['name'];}_0x709109[_0x96fd('0x13')](_0x239e50)[_0x96fd('0x21')](_0x5474b2);};}exports[_0x96fd('0x22')]=function(_0x40f434,_0x4eda0b){var _0x2f3c23={},_0x4aaeff={},_0x56d057={'count':0x0,'rows':[]};var _0x5f4bc5=db['VoiceQueuesLog']['rawAttributes'];_0x4aaeff['model']=_[_0x96fd('0x23')](_0x5f4bc5);var _0x5a4b53={'dateStart':_0x40f434[_0x96fd('0x24')][_0x96fd('0x25')],'dateEnd':_0x40f434[_0x96fd('0x24')]['dateEnd']};delete _0x40f434[_0x96fd('0x24')][_0x96fd('0x25')];delete _0x40f434[_0x96fd('0x24')][_0x96fd('0x26')];_0x4aaeff[_0x96fd('0x24')]=_[_0x96fd('0x23')](_0x40f434[_0x96fd('0x24')]);_0x4aaeff[_0x96fd('0x27')]=_[_0x96fd('0x28')](_0x4aaeff[_0x96fd('0x29')],_0x4aaeff[_0x96fd('0x24')]);_0x2f3c23[_0x96fd('0x2a')]=_[_0x96fd('0x28')](_0x4aaeff['model'],qs['fields'](_0x40f434[_0x96fd('0x24')]['fields']));_0x2f3c23[_0x96fd('0x2a')]=_0x2f3c23[_0x96fd('0x2a')][_0x96fd('0x2b')]?_0x2f3c23[_0x96fd('0x2a')]:_0x4aaeff[_0x96fd('0x29')];if(!_0x40f434[_0x96fd('0x24')][_0x96fd('0x2c')](_0x96fd('0x2d'))){_0x2f3c23[_0x96fd('0x2e')]=qs[_0x96fd('0x2e')](_0x40f434[_0x96fd('0x24')][_0x96fd('0x2e')]);_0x2f3c23[_0x96fd('0x16')]=qs[_0x96fd('0x16')](_0x40f434[_0x96fd('0x24')]['offset']);}_0x2f3c23[_0x96fd('0x2f')]=qs[_0x96fd('0x30')](_0x40f434[_0x96fd('0x24')][_0x96fd('0x30')]);_0x2f3c23['where']=qs[_0x96fd('0x27')](_[_0x96fd('0x31')](_0x40f434[_0x96fd('0x24')],_0x4aaeff['filters']));if(_0x5a4b53['dateStart']){if(_0x5a4b53[_0x96fd('0x26')]){_0x5a4b53['dateEnd']=moment(_0x5a4b53[_0x96fd('0x26')])[_0x96fd('0x32')](0x1,_0x96fd('0x33'));}else{_0x5a4b53[_0x96fd('0x26')]=moment(_0x5a4b53[_0x96fd('0x25')])['add'](0x1,_0x96fd('0x33'));}_[_0x96fd('0x34')](_0x2f3c23['where'],{'createdAt':{'$gte':_0x5a4b53[_0x96fd('0x25')],'$lte':_0x5a4b53[_0x96fd('0x26')]}});}if(_0x40f434['query']['filter']){_0x2f3c23[_0x96fd('0x35')]=_[_0x96fd('0x34')](_0x2f3c23[_0x96fd('0x35')],{'$or':_['map'](_0x2f3c23[_0x96fd('0x2a')],function(_0x5dd881){var _0x15dc67={};_0x15dc67[_0x5dd881]={'$like':'%'+_0x40f434['query'][_0x96fd('0x36')]+'%'};return _0x15dc67;})});}_0x2f3c23=_[_0x96fd('0x34')]({},_0x2f3c23,_0x40f434['options']);var _0x3a7d97={'where':_0x2f3c23[_0x96fd('0x35')]};return db['VoiceQueuesLog'][_0x96fd('0x15')](_0x3a7d97)['then'](function(_0x4820c8){_0x56d057[_0x96fd('0x15')]=_0x4820c8;if(_0x40f434[_0x96fd('0x24')][_0x96fd('0x37')]){_0x2f3c23['include']=[{'all':!![]}];}return db[_0x96fd('0x38')]['findAll'](_0x2f3c23);})[_0x96fd('0x1b')](function(_0x1e9685){_0x56d057[_0x96fd('0x39')]=_0x1e9685;return _0x56d057;})[_0x96fd('0x1b')](respondWithFilteredResult(_0x4eda0b,_0x2f3c23))[_0x96fd('0x3a')](handleError(_0x4eda0b,null));};exports[_0x96fd('0x3b')]=function(_0x254b13,_0x2fef6c){var _0x151c67={'raw':!![],'where':{'id':_0x254b13[_0x96fd('0x3c')]['id']}},_0x1d39d4={};_0x1d39d4[_0x96fd('0x29')]=_[_0x96fd('0x23')](db[_0x96fd('0x38')][_0x96fd('0x3d')]);_0x1d39d4[_0x96fd('0x24')]=_[_0x96fd('0x23')](_0x254b13[_0x96fd('0x24')]);_0x1d39d4['filters']=_[_0x96fd('0x28')](_0x1d39d4['model'],_0x1d39d4[_0x96fd('0x24')]);_0x151c67['attributes']=_['intersection'](_0x1d39d4['model'],qs[_0x96fd('0x3e')](_0x254b13['query'][_0x96fd('0x3e')]));_0x151c67[_0x96fd('0x2a')]=_0x151c67['attributes']['length']?_0x151c67[_0x96fd('0x2a')]:_0x1d39d4[_0x96fd('0x29')];if(_0x254b13[_0x96fd('0x24')]['includeAll']){_0x151c67[_0x96fd('0x3f')]=[{'all':!![]}];}_0x151c67=_[_0x96fd('0x34')]({},_0x151c67,_0x254b13[_0x96fd('0x40')]);return db['VoiceQueuesLog'][_0x96fd('0x41')](_0x151c67)[_0x96fd('0x1b')](handleEntityNotFound(_0x2fef6c,null))[_0x96fd('0x1b')](respondWithResult(_0x2fef6c,null))[_0x96fd('0x3a')](handleError(_0x2fef6c,null));};exports['create']=function(_0x405821,_0x4f7bd2){return db[_0x96fd('0x38')][_0x96fd('0x42')](_0x405821[_0x96fd('0x43')],{})['then'](respondWithResult(_0x4f7bd2,0xc9))[_0x96fd('0x3a')](handleError(_0x4f7bd2,null));};exports[_0x96fd('0x1a')]=function(_0x2e5fe3,_0x1103b9){if(_0x2e5fe3[_0x96fd('0x43')]['id']){delete _0x2e5fe3[_0x96fd('0x43')]['id'];}return db[_0x96fd('0x38')][_0x96fd('0x41')]({'where':{'id':_0x2e5fe3['params']['id']}})['then'](handleEntityNotFound(_0x1103b9,null))[_0x96fd('0x1b')](saveUpdates(_0x2e5fe3['body'],null))[_0x96fd('0x1b')](respondWithResult(_0x1103b9,null))[_0x96fd('0x3a')](handleError(_0x1103b9,null));};exports['destroy']=function(_0x43423e,_0x8c1ad1){return db[_0x96fd('0x38')][_0x96fd('0x41')]({'where':{'id':_0x43423e['params']['id']}})[_0x96fd('0x1b')](handleEntityNotFound(_0x8c1ad1,null))[_0x96fd('0x1b')](removeEntity(_0x8c1ad1,null))['catch'](handleError(_0x8c1ad1,null));};
\ No newline at end of file
index c64a487..f97c48a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fd8=['dtm','lodash','util','../../config/logger','bluebird','define','voice_queues_log','event'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x4fd8,0x129));var _0x84fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4fd8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x84fd('0x0'));var util=require(_0x84fd('0x1'));var logger=require(_0x84fd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x84fd('0x3'));var rp=require('request-promise');var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x5408fb,_0x3e0c1e){return _0x5408fb[_0x84fd('0x4')]('VoiceQueuesLog',attributes,{'tableName':_0x84fd('0x5'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x84fd('0x6'),_0x84fd('0x7')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x81d4=['bluebird','request-promise','define','voice_queues_log','event_dtm','event','dtm','util','../../config/logger','moment'];(function(_0x3da920,_0x1c7d2c){var _0xb9ef8a=function(_0x44fdd0){while(--_0x44fdd0){_0x3da920['push'](_0x3da920['shift']());}};_0xb9ef8a(++_0x1c7d2c);}(_0x81d4,0x197));var _0x481d=function(_0x3e7ce8,_0x2b9409){_0x3e7ce8=_0x3e7ce8-0x0;var _0xeee8b5=_0x81d4[_0x3e7ce8];return _0xeee8b5;};'use strict';var _=require('lodash');var util=require(_0x481d('0x0'));var logger=require(_0x481d('0x1'))('api');var moment=require(_0x481d('0x2'));var BPromise=require(_0x481d('0x3'));var rp=require(_0x481d('0x4'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x37813e,_0x1a9ee1){return _0x37813e[_0x481d('0x5')]('VoiceQueuesLog',attributes,{'tableName':_0x481d('0x6'),'paranoid':![],'indexes':[{'name':_0x481d('0x7'),'fields':[_0x481d('0x8'),_0x481d('0x9')]}],'timestamps':![]});};
\ No newline at end of file
index 98c855b..0f93cd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5f8=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceQueuesLog,\x20%s,\x20%s','result','catch','moment','randomstring','../../config/utils'];(function(_0x54bf9b,_0x10d2ad){var _0x21999c=function(_0x1274bb){while(--_0x1274bb){_0x54bf9b['push'](_0x54bf9b['shift']());}};_0x21999c(++_0x10d2ad);}(_0xb5f8,0xa5));var _0x8b5f=function(_0x522d8e,_0x5bfba5){_0x522d8e=_0x522d8e-0x0;var _0x745591=_0xb5f8[_0x522d8e];return _0x745591;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8b5f('0x0'));var BPromise=require('bluebird');var rs=require(_0x8b5f('0x1'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x8b5f('0x2'));var logger=require(_0x8b5f('0x3'))(_0x8b5f('0x4'));var config=require(_0x8b5f('0x5'));var jayson=require(_0x8b5f('0x6'));var client=jayson[_0x8b5f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x95cb32,_0x1329aa,_0x6237d3){return new BPromise(function(_0x307073,_0x1606df){return client[_0x8b5f('0x8')](_0x95cb32,_0x6237d3)[_0x8b5f('0x9')](function(_0x293d85){logger[_0x8b5f('0xa')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1329aa,'request\x20sent');logger[_0x8b5f('0xb')](_0x8b5f('0xc'),_0x1329aa,_0x8b5f('0xd'),JSON[_0x8b5f('0xe')](_0x293d85));if(_0x293d85[_0x8b5f('0xf')]){if(_0x293d85[_0x8b5f('0xf')][_0x8b5f('0x10')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x1329aa,_0x293d85[_0x8b5f('0xf')]['message']);return _0x1606df(_0x293d85[_0x8b5f('0xf')][_0x8b5f('0x11')]);}logger[_0x8b5f('0xf')](_0x8b5f('0x12'),_0x1329aa,_0x293d85[_0x8b5f('0xf')][_0x8b5f('0x11')]);return _0x307073(_0x293d85[_0x8b5f('0xf')][_0x8b5f('0x11')]);}else{logger['info'](_0x8b5f('0x12'),_0x1329aa,_0x8b5f('0xd'));_0x307073(_0x293d85[_0x8b5f('0x13')]['message']);}})[_0x8b5f('0x14')](function(_0xd54971){logger[_0x8b5f('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1329aa,_0xd54971);_0x1606df(_0xd54971);});});}
\ No newline at end of file
+var _0xfa5d=['../../mysqldb','../../config/utils','../../config/logger','client','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','moment','randomstring'];(function(_0x26aee4,_0x530ead){var _0x2e1048=function(_0x2e92db){while(--_0x2e92db){_0x26aee4['push'](_0x26aee4['shift']());}};_0x2e1048(++_0x530ead);}(_0xfa5d,0x140));var _0xdfa5=function(_0xa12da2,_0x37ba7f){_0xa12da2=_0xa12da2-0x0;var _0x50ab29=_0xfa5d[_0xa12da2];return _0x50ab29;};'use strict';var _=require(_0xdfa5('0x0'));var util=require('util');var moment=require(_0xdfa5('0x1'));var BPromise=require('bluebird');var rs=require(_0xdfa5('0x2'));var fs=require('fs');var db=require(_0xdfa5('0x3'))['db'];var utils=require(_0xdfa5('0x4'));var logger=require(_0xdfa5('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdfa5('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c6004,_0x13ece7,_0x633ccb){return new BPromise(function(_0x329837,_0x19310e){return client['request'](_0x5c6004,_0x633ccb)[_0xdfa5('0x7')](function(_0x5cf27d){logger[_0xdfa5('0x8')](_0xdfa5('0x9'),_0x13ece7,'request\x20sent');logger[_0xdfa5('0xa')](_0xdfa5('0xb'),_0x13ece7,_0xdfa5('0xc'),JSON['stringify'](_0x5cf27d));if(_0x5cf27d[_0xdfa5('0xd')]){if(_0x5cf27d[_0xdfa5('0xd')][_0xdfa5('0xe')]===0x1f4){logger[_0xdfa5('0xd')](_0xdfa5('0x9'),_0x13ece7,_0x5cf27d['error']['message']);return _0x19310e(_0x5cf27d[_0xdfa5('0xd')][_0xdfa5('0xf')]);}logger[_0xdfa5('0xd')](_0xdfa5('0x9'),_0x13ece7,_0x5cf27d[_0xdfa5('0xd')][_0xdfa5('0xf')]);return _0x329837(_0x5cf27d['error'][_0xdfa5('0xf')]);}else{logger[_0xdfa5('0x8')](_0xdfa5('0x9'),_0x13ece7,_0xdfa5('0xc'));_0x329837(_0x5cf27d['result'][_0xdfa5('0xf')]);}})[_0xdfa5('0x10')](function(_0xe2bf5c){logger[_0xdfa5('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x13ece7,_0xe2bf5c);_0x19310e(_0xe2bf5c);});});}
\ No newline at end of file
index 31cf5ee..778c968 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa2b=['download','/:id/downloads','downloads','post','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download'];(function(_0x32f78b,_0x178f58){var _0x51d847=function(_0xc010c3){while(--_0xc010c3){_0x32f78b['push'](_0x32f78b['shift']());}};_0x51d847(++_0x178f58);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x337d98,_0x3bccd2){_0x337d98=_0x337d98-0x0;var _0x582f7d=_0xfa2b[_0x337d98];return _0x582f7d;};'use strict';var multer=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var path=require(_0xbfa2('0x2'));var express=require(_0xbfa2('0x3'));var router=express[_0xbfa2('0x4')]();var auth=require(_0xbfa2('0x5'));var interaction=require(_0xbfa2('0x6'));var config=require(_0xbfa2('0x7'));var controller=require(_0xbfa2('0x8'));router[_0xbfa2('0x9')]('/',auth[_0xbfa2('0xa')](),controller[_0xbfa2('0xb')]);router[_0xbfa2('0x9')](_0xbfa2('0xc'),auth[_0xbfa2('0xa')](),controller[_0xbfa2('0xd')]);router['get'](_0xbfa2('0xe'),auth['isAuthenticated'](),controller[_0xbfa2('0xf')]);router[_0xbfa2('0x9')](_0xbfa2('0x10'),auth[_0xbfa2('0xa')](),controller[_0xbfa2('0x11')]);router[_0xbfa2('0x9')](_0xbfa2('0x12'),controller[_0xbfa2('0x13')]);router[_0xbfa2('0x14')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xbfa2('0xe'),auth[_0xbfa2('0xa')](),controller[_0xbfa2('0x15')]);router[_0xbfa2('0x16')](_0xbfa2('0xe'),auth[_0xbfa2('0xa')](),controller['destroy']);module[_0xbfa2('0x17')]=router;
\ No newline at end of file
+var _0x47c7=['downloads','post','put','update','delete','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download'];(function(_0x123034,_0x52323a){var _0x414dcb=function(_0x9a8777){while(--_0x9a8777){_0x123034['push'](_0x123034['shift']());}};_0x414dcb(++_0x52323a);}(_0x47c7,0x1ab));var _0x747c=function(_0x2abc3d,_0x48edca){_0x2abc3d=_0x2abc3d-0x0;var _0x252745=_0x47c7[_0x2abc3d];return _0x252745;};'use strict';var multer=require(_0x747c('0x0'));var util=require('util');var path=require(_0x747c('0x1'));var express=require(_0x747c('0x2'));var router=express['Router']();var auth=require(_0x747c('0x3'));var interaction=require(_0x747c('0x4'));var config=require('../../config/environment');var controller=require(_0x747c('0x5'));router[_0x747c('0x6')]('/',auth[_0x747c('0x7')](),controller[_0x747c('0x8')]);router['get'](_0x747c('0x9'),auth['isAuthenticated'](),controller[_0x747c('0xa')]);router[_0x747c('0x6')](_0x747c('0xb'),auth[_0x747c('0x7')](),controller[_0x747c('0xc')]);router['get']('/:id/download',auth[_0x747c('0x7')](),controller[_0x747c('0xd')]);router[_0x747c('0x6')]('/:id/downloads',controller[_0x747c('0xe')]);router[_0x747c('0xf')]('/',auth[_0x747c('0x7')](),controller['create']);router[_0x747c('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x747c('0x11')]);router[_0x747c('0x12')](_0x747c('0xb'),auth[_0x747c('0x7')](),controller[_0x747c('0x13')]);module[_0x747c('0x14')]=router;
\ No newline at end of file
index ec751f9..1df3427 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4973=['createdAt','format','MM-DD-YYYY\x20HH:mm','toString','sequelize','moment','path','VIRTUAL','getDataValue','value','STRING','setDataValue','membername','split','DATE'];(function(_0x47b5bf,_0x450fc8){var _0x5186dd=function(_0xe377f){while(--_0xe377f){_0x47b5bf['push'](_0x47b5bf['shift']());}};_0x5186dd(++_0x450fc8);}(_0x4973,0x17b));var _0x3497=function(_0x11bc40,_0x537bbc){_0x11bc40=_0x11bc40-0x0;var _0x2b7a99=_0x4973[_0x11bc40];return _0x2b7a99;};'use strict';var Sequelize=require(_0x3497('0x0'));var moment=require(_0x3497('0x1'));var path=require(_0x3497('0x2'));module['exports']={'format':{'type':Sequelize[_0x3497('0x3')],'get':function(){return this[_0x3497('0x4')]('value')?path['extname'](this[_0x3497('0x4')](_0x3497('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x3497('0x6')]},'channel':{'type':Sequelize[_0x3497('0x6')],'set':function(_0x5ac72e){if(_0x5ac72e){this['setDataValue']('channel',_0x5ac72e);this[_0x3497('0x7')](_0x3497('0x8'),_0x5ac72e[_0x3497('0x9')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x3497('0x6')]},'connectedlinename':{'type':Sequelize[_0x3497('0x6')]},'accountcode':{'type':Sequelize[_0x3497('0x6')]},'context':{'type':Sequelize[_0x3497('0x6')]},'exten':{'type':Sequelize[_0x3497('0x6')]},'value':{'type':Sequelize[_0x3497('0x6')]},'type':{'type':Sequelize[_0x3497('0x6')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x3497('0x6')]},'userDisposition':{'type':Sequelize[_0x3497('0x6')]},'createdAt':{'type':Sequelize[_0x3497('0xa')],'get':function(){return moment(this[_0x3497('0x4')](_0x3497('0xb')))[_0x3497('0xc')](_0x3497('0xd'))[_0x3497('0xe')]();}},'updatedAt':{'type':Sequelize[_0x3497('0xa')],'get':function(){return moment(this[_0x3497('0x4')]('updatedAt'))[_0x3497('0xc')](_0x3497('0xd'))[_0x3497('0xe')]();}}};
\ No newline at end of file
+var _0x9dd6=['exports','VIRTUAL','getDataValue','STRING','setDataValue','membername','split','INTEGER','DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','path'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x9dd6,0x12e));var _0x69dd=function(_0x3a3072,_0x207a4b){_0x3a3072=_0x3a3072-0x0;var _0x567409=_0x9dd6[_0x3a3072];return _0x567409;};'use strict';var Sequelize=require(_0x69dd('0x0'));var moment=require('moment');var path=require(_0x69dd('0x1'));module[_0x69dd('0x2')]={'format':{'type':Sequelize[_0x69dd('0x3')],'get':function(){return this['getDataValue']('value')?path['extname'](this[_0x69dd('0x4')]('value')):undefined;}},'uniqueid':{'type':Sequelize[_0x69dd('0x5')]},'channel':{'type':Sequelize[_0x69dd('0x5')],'set':function(_0x569dff){if(_0x569dff){this[_0x69dd('0x6')]('channel',_0x569dff);this[_0x69dd('0x6')](_0x69dd('0x7'),_0x569dff[_0x69dd('0x8')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x69dd('0x5')]},'calleridname':{'type':Sequelize[_0x69dd('0x5')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x69dd('0x5')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x69dd('0x5')]},'exten':{'type':Sequelize[_0x69dd('0x5')]},'value':{'type':Sequelize[_0x69dd('0x5')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize[_0x69dd('0x9')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x69dd('0x5')]},'userDisposition':{'type':Sequelize[_0x69dd('0x5')]},'createdAt':{'type':Sequelize[_0x69dd('0xa')],'get':function(){return moment(this['getDataValue'](_0x69dd('0xb')))[_0x69dd('0xc')](_0x69dd('0xd'))[_0x69dd('0xe')]();}},'updatedAt':{'type':Sequelize[_0x69dd('0xa')],'get':function(){return moment(this['getDataValue'](_0x69dd('0xf')))[_0x69dd('0xc')](_0x69dd('0xd'))['toString']();}}};
\ No newline at end of file
index bba19c6..91895b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ede=['unlink','downloads','sequelize','col','token','$and','push','format','decryptFile','secrets','recording','Sequelize','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','to-csv','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','VoiceRecording','rawAttributes','differenceBy','query','dateStart','dateEnd','keys','filters','intersection','model','fields','attributes','length','nolimit','limit','offset','sort','where','pick','day','add','merge','filter','map','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','../../components/encryptor','type','uniqueid','value','%s.cypher','existsSync','ValidationError','VoiceRecording\x20not\x20found','filename','extname'];(function(_0x27a0fc,_0x41f0ba){var _0x5da03a=function(_0x2fca1a){while(--_0x2fca1a){_0x27a0fc['push'](_0x27a0fc['shift']());}};_0x5da03a(++_0x41f0ba);}(_0x5ede,0x189));var _0xe5ed=function(_0x509b03,_0xb7bb46){_0x509b03=_0x509b03-0x0;var _0x777462=_0x5ede[_0x509b03];return _0x777462;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe5ed('0x0'));var rimraf=require(_0xe5ed('0x1'));var zipdir=require(_0xe5ed('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5ed('0x3'));var moment=require(_0xe5ed('0x4'));var BPromise=require(_0xe5ed('0x5'));var Mustache=require(_0xe5ed('0x6'));var util=require(_0xe5ed('0x7'));var path=require(_0xe5ed('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe5ed('0x9'));var squel=require(_0xe5ed('0xa'));var crypto=require(_0xe5ed('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe5ed('0xc'));var querystring=require('querystring');var Papa=require(_0xe5ed('0xd'));var qs=require(_0xe5ed('0xe'));var logger=require(_0xe5ed('0xf'))(_0xe5ed('0x10'));var utils=require(_0xe5ed('0x11'));var config=require(_0xe5ed('0x12'));var db=require(_0xe5ed('0x13'))['db'];function respondWithStatusCode(_0x4b26d2,_0x48dbc7){_0x48dbc7=_0x48dbc7||0xcc;return function(_0x5582df){if(_0x5582df){return _0x4b26d2[_0xe5ed('0x14')](_0x48dbc7);}return _0x4b26d2[_0xe5ed('0x15')](_0x48dbc7)[_0xe5ed('0x16')]();};}function respondWithResult(_0x20a925,_0x1ebe73){_0x1ebe73=_0x1ebe73||0xc8;return function(_0x48db1b){if(_0x48db1b){return _0x20a925[_0xe5ed('0x15')](_0x1ebe73)['json'](_0x48db1b);}};}function respondWithFilteredResult(_0x4aada1,_0x19bd72){return function(_0x4aef70){if(_0x4aef70){var _0x3a680d=_0x4aef70[_0xe5ed('0x17')],_0x45a67e=_0x19bd72['offset'],_0xc8b8b6=_0x19bd72['offset']+_0x19bd72['limit'],_0x4891e6;if(_0xc8b8b6>=_0x3a680d){_0xc8b8b6=_0x3a680d;_0x4891e6=0xc8;}else{_0x4891e6=0xce;}_0x4aada1[_0xe5ed('0x15')](_0x4891e6);return _0x4aada1['set'](_0xe5ed('0x18'),_0x45a67e+'-'+_0xc8b8b6+'/'+_0x3a680d)['json'](_0x4aef70);}return null;};}function patchUpdates(_0x52c640){return function(_0x5ee9a8){try{jsonpatch[_0xe5ed('0x19')](_0x5ee9a8,_0x52c640,!![]);}catch(_0x252eda){return BPromise[_0xe5ed('0x1a')](_0x252eda);}return _0x5ee9a8[_0xe5ed('0x1b')]();};}function saveUpdates(_0x41d3bb,_0x375681){return function(_0x230a4e){if(_0x230a4e){return _0x230a4e[_0xe5ed('0x1c')](_0x41d3bb)['then'](function(_0x248da8){return _0x248da8;});}return null;};}function removeEntity(_0x5400b3,_0x58cefc){return function(_0xf6b8b8){if(_0xf6b8b8){return _0xf6b8b8[_0xe5ed('0x1d')]()[_0xe5ed('0x1e')](function(){_0x5400b3[_0xe5ed('0x15')](0xcc)[_0xe5ed('0x16')]();});}};}function handleEntityNotFound(_0x6c0b71,_0x2bf396){return function(_0x48b139){if(!_0x48b139){_0x6c0b71['sendStatus'](0x194);}return _0x48b139;};}function handleError(_0x4b3990,_0xdde8da){_0xdde8da=_0xdde8da||0x1f4;return function(_0x49ab69){logger[_0xe5ed('0x1f')](_0x49ab69[_0xe5ed('0x20')]);if(_0x49ab69[_0xe5ed('0x21')]){delete _0x49ab69[_0xe5ed('0x21')];}_0x4b3990[_0xe5ed('0x15')](_0xdde8da)[_0xe5ed('0x22')](_0x49ab69);};}exports[_0xe5ed('0x23')]=function(_0x34b95f,_0x23ac18){var _0x1ae7d3={},_0x2c584e={},_0x2edb24={'count':0x0,'rows':[]};var _0x23ae74=db[_0xe5ed('0x24')][_0xe5ed('0x25')];_0x2c584e['model']=_[_0xe5ed('0x26')](_['keys'](_0x23ae74),['format']);var _0x1ed9d6={'dateStart':_0x34b95f[_0xe5ed('0x27')][_0xe5ed('0x28')],'dateEnd':_0x34b95f['query'][_0xe5ed('0x29')]};delete _0x34b95f['query'][_0xe5ed('0x28')];delete _0x34b95f[_0xe5ed('0x27')][_0xe5ed('0x29')];_0x2c584e[_0xe5ed('0x27')]=_[_0xe5ed('0x2a')](_0x34b95f[_0xe5ed('0x27')]);_0x2c584e[_0xe5ed('0x2b')]=_[_0xe5ed('0x2c')](_0x2c584e[_0xe5ed('0x2d')],_0x2c584e[_0xe5ed('0x27')]);_0x1ae7d3['attributes']=_[_0xe5ed('0x2c')](_0x2c584e['model'],qs[_0xe5ed('0x2e')](_0x34b95f['query']['fields']));_0x1ae7d3['attributes']=_0x1ae7d3[_0xe5ed('0x2f')][_0xe5ed('0x30')]?_0x1ae7d3['attributes']:_0x2c584e[_0xe5ed('0x2d')];if(!_0x34b95f[_0xe5ed('0x27')]['hasOwnProperty'](_0xe5ed('0x31'))){_0x1ae7d3['limit']=qs[_0xe5ed('0x32')](_0x34b95f[_0xe5ed('0x27')][_0xe5ed('0x32')]);_0x1ae7d3[_0xe5ed('0x33')]=qs[_0xe5ed('0x33')](_0x34b95f['query']['offset']);}_0x1ae7d3['order']=qs[_0xe5ed('0x34')](_0x34b95f['query'][_0xe5ed('0x34')]);_0x1ae7d3[_0xe5ed('0x35')]=qs[_0xe5ed('0x2b')](_[_0xe5ed('0x36')](_0x34b95f['query'],_0x2c584e[_0xe5ed('0x2b')]));if(_0x1ed9d6['dateStart']){if(_0x1ed9d6[_0xe5ed('0x29')]){_0x1ed9d6['dateEnd']=moment(_0x1ed9d6['dateEnd'])['add'](0x1,_0xe5ed('0x37'));}else{_0x1ed9d6[_0xe5ed('0x29')]=moment(_0x1ed9d6['dateStart'])[_0xe5ed('0x38')](0x1,_0xe5ed('0x37'));}_[_0xe5ed('0x39')](_0x1ae7d3['where'],{'createdAt':{'$gte':_0x1ed9d6[_0xe5ed('0x28')],'$lte':_0x1ed9d6['dateEnd']}});}if(_0x34b95f['query'][_0xe5ed('0x3a')]){_0x1ae7d3[_0xe5ed('0x35')]=_[_0xe5ed('0x39')](_0x1ae7d3[_0xe5ed('0x35')],{'$or':_[_0xe5ed('0x3b')](_0x1ae7d3[_0xe5ed('0x2f')],function(_0x5befdb){var _0x26325f={};_0x26325f[_0x5befdb]={'$like':'%'+_0x34b95f[_0xe5ed('0x27')]['filter']+'%'};return _0x26325f;})});}_0x1ae7d3=_[_0xe5ed('0x39')]({},_0x1ae7d3,_0x34b95f['options']);var _0x256a0a={'where':_0x1ae7d3['where']};return db[_0xe5ed('0x24')][_0xe5ed('0x17')](_0x256a0a)[_0xe5ed('0x1e')](function(_0x5ea17e){_0x2edb24[_0xe5ed('0x17')]=_0x5ea17e;if(_0x34b95f[_0xe5ed('0x27')][_0xe5ed('0x3c')]){_0x1ae7d3[_0xe5ed('0x3d')]=[{'all':!![]}];}return db[_0xe5ed('0x24')][_0xe5ed('0x3e')](_0x1ae7d3);})['then'](function(_0x52e587){_0x2edb24[_0xe5ed('0x3f')]=_0x52e587;return _0x2edb24;})[_0xe5ed('0x1e')](respondWithFilteredResult(_0x23ac18,_0x1ae7d3))[_0xe5ed('0x40')](handleError(_0x23ac18,null));};exports[_0xe5ed('0x41')]=function(_0x5ea86f,_0x5cdb83){var _0xde6454={'raw':![],'where':{'id':_0x5ea86f[_0xe5ed('0x42')]['id']}},_0x252736={};_0x252736[_0xe5ed('0x2d')]=_[_0xe5ed('0x2a')](db[_0xe5ed('0x24')]['rawAttributes']);_0x252736['query']=_[_0xe5ed('0x2a')](_0x5ea86f['query']);_0x252736['filters']=_['intersection'](_0x252736[_0xe5ed('0x2d')],_0x252736[_0xe5ed('0x27')]);_0xde6454['attributes']=_[_0xe5ed('0x2c')](_0x252736[_0xe5ed('0x2d')],qs['fields'](_0x5ea86f['query']['fields']));_0xde6454[_0xe5ed('0x2f')]=_0xde6454['attributes'][_0xe5ed('0x30')]?_0xde6454[_0xe5ed('0x2f')]:_0x252736[_0xe5ed('0x2d')];if(_0x5ea86f[_0xe5ed('0x27')][_0xe5ed('0x3c')]){_0xde6454[_0xe5ed('0x3d')]=[{'all':!![]}];}_0xde6454=_[_0xe5ed('0x39')]({},_0xde6454,_0x5ea86f[_0xe5ed('0x43')]);return db[_0xe5ed('0x24')][_0xe5ed('0x44')](_0xde6454)[_0xe5ed('0x1e')](handleEntityNotFound(_0x5cdb83,null))[_0xe5ed('0x1e')](respondWithResult(_0x5cdb83,null))[_0xe5ed('0x40')](handleError(_0x5cdb83,null));};exports[_0xe5ed('0x45')]=function(_0x520a11,_0x36fb83){return db[_0xe5ed('0x24')][_0xe5ed('0x45')](_0x520a11[_0xe5ed('0x46')],{})[_0xe5ed('0x1e')](respondWithResult(_0x36fb83,0xc9))[_0xe5ed('0x40')](handleError(_0x36fb83,null));};exports[_0xe5ed('0x1c')]=function(_0x4d8b24,_0x24b71c){if(_0x4d8b24[_0xe5ed('0x46')]['id']){delete _0x4d8b24['body']['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x4d8b24[_0xe5ed('0x42')]['id']}})['then'](handleEntityNotFound(_0x24b71c,null))[_0xe5ed('0x1e')](saveUpdates(_0x4d8b24[_0xe5ed('0x46')],null))[_0xe5ed('0x1e')](respondWithResult(_0x24b71c,null))[_0xe5ed('0x40')](handleError(_0x24b71c,null));};exports[_0xe5ed('0x1d')]=function(_0x1d8ce9,_0x37116f){return db[_0xe5ed('0x24')]['find']({'where':{'id':_0x1d8ce9['params']['id']}})['then'](handleEntityNotFound(_0x37116f,null))[_0xe5ed('0x1e')](removeEntity(_0x37116f,null))[_0xe5ed('0x40')](handleError(_0x37116f,null));};exports[_0xe5ed('0x47')]=function(_0x5e2c4,_0x25b139){return db[_0xe5ed('0x24')][_0xe5ed('0x47')]()[_0xe5ed('0x1e')](respondWithResult(_0x25b139,null))[_0xe5ed('0x40')](handleError(_0x25b139,null));};exports['download']=function(_0x905fa,_0x305732,_0x496e3d){var _0x3798e5=require(_0xe5ed('0x48'));var _0x2b0a7e=![];var _0x323fe3={};if(_0x905fa[_0xe5ed('0x27')][_0xe5ed('0x49')]&&_0x905fa[_0xe5ed('0x27')]['type']==='uniqueid'){_0x323fe3[_0xe5ed('0x4a')]=_0x905fa[_0xe5ed('0x42')]['id'];}else{_0x323fe3['id']=_0x905fa[_0xe5ed('0x42')]['id'];}return db[_0xe5ed('0x24')][_0xe5ed('0x44')]({'where':_0x323fe3,'attributes':['id',_0xe5ed('0x4b')],'raw':!![]})[_0xe5ed('0x1e')](handleEntityNotFound(_0x305732,null))['then'](function(_0x5a5b28){if(_0x5a5b28){var _0x3cfd1c=util['format'](_0xe5ed('0x4c'),_0x5a5b28[_0xe5ed('0x4b')]);if(fs[_0xe5ed('0x4d')](_0x3cfd1c)){_0x2b0a7e=!![];return _0x3798e5['decryptFile'](_0x3cfd1c,_0x5a5b28[_0xe5ed('0x4b')],config['secrets']['recording'])[_0xe5ed('0x1e')](function(){return _0x5a5b28;});}return _0x5a5b28;}})[_0xe5ed('0x1e')](function(_0x3169b5){if(_0x3169b5){if(!fs['existsSync'](_0x3169b5[_0xe5ed('0x4b')])){throw new db['Sequelize'][(_0xe5ed('0x4e'))](_0xe5ed('0x4f'));}if(_0x3169b5[_0xe5ed('0x50')]){return _0x305732['download'](_0x3169b5['value'],_0x3169b5['filename']+path[_0xe5ed('0x51')](_0x3169b5['value']),function(){if(_0x2b0a7e){fs[_0xe5ed('0x52')](_0x3169b5[_0xe5ed('0x4b')]);}});}else{return _0x305732['download'](_0x3169b5['value'],function(_0x14c07e){if(_0x2b0a7e){fs[_0xe5ed('0x52')](_0x3169b5[_0xe5ed('0x4b')]);}});}}})['catch'](handleError(_0x305732,null));};exports[_0xe5ed('0x53')]=function(_0x538a7c,_0x42ed0e,_0x5166e0){var _0x44e6ec=require(_0xe5ed('0x48'));var _0x564319=![];var _0x398bd5={'$and':[db['sequelize'][_0xe5ed('0x35')](db[_0xe5ed('0x54')]['fn']('MD5',db[_0xe5ed('0x54')][_0xe5ed('0x55')](_0xe5ed('0x4a'))),_0x538a7c[_0xe5ed('0x27')][_0xe5ed('0x56')])]};if(_0x538a7c['query']['type']&&_0x538a7c[_0xe5ed('0x27')][_0xe5ed('0x49')]==='uniqueid'){_0x398bd5[_0xe5ed('0x57')]['push']({'uniqueid':_0x538a7c['params']['id']});}else{_0x398bd5[_0xe5ed('0x57')][_0xe5ed('0x58')]({'id':_0x538a7c[_0xe5ed('0x42')]['id']});}return db[_0xe5ed('0x24')][_0xe5ed('0x44')]({'where':_0x398bd5,'attributes':['id',_0xe5ed('0x4b')],'raw':!![]})[_0xe5ed('0x1e')](handleEntityNotFound(_0x42ed0e,null))[_0xe5ed('0x1e')](function(_0x23b0c9){if(_0x23b0c9){var _0x4bf292=util[_0xe5ed('0x59')](_0xe5ed('0x4c'),_0x23b0c9[_0xe5ed('0x4b')]);if(fs[_0xe5ed('0x4d')](_0x4bf292)){_0x564319=!![];return _0x44e6ec[_0xe5ed('0x5a')](_0x4bf292,_0x23b0c9[_0xe5ed('0x4b')],config[_0xe5ed('0x5b')][_0xe5ed('0x5c')])[_0xe5ed('0x1e')](function(){return _0x23b0c9;});}return _0x23b0c9;}})['then'](function(_0x16ea96){if(_0x16ea96){if(!fs[_0xe5ed('0x4d')](_0x16ea96['value'])){throw new db[(_0xe5ed('0x5d'))]['ValidationError'](_0xe5ed('0x4f'));}if(_0x16ea96[_0xe5ed('0x50')]){return _0x42ed0e[_0xe5ed('0x5e')](_0x16ea96[_0xe5ed('0x4b')],_0x16ea96[_0xe5ed('0x50')]+path[_0xe5ed('0x51')](_0x16ea96[_0xe5ed('0x4b')]),function(){if(_0x564319){fs[_0xe5ed('0x52')](_0x16ea96[_0xe5ed('0x4b')]);}});}else{return _0x42ed0e[_0xe5ed('0x5e')](_0x16ea96[_0xe5ed('0x4b')],function(_0x4eee50){if(_0x564319){fs[_0xe5ed('0x52')](_0x16ea96[_0xe5ed('0x4b')]);}});}}})[_0xe5ed('0x40')](handleError(_0x42ed0e,null));};
\ No newline at end of file
+var _0x9e52=['describe','download','../../components/encryptor','type','uniqueid','existsSync','decryptFile','value','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','extname','unlink','downloads','sequelize','MD5','$and','push','filename','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','index','VoiceRecording','rawAttributes','model','keys','format','query','dateStart','dateEnd','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','add','day','merge','map','filter','options','include','findAll','catch','params','includeAll','find','create','body'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x9e52,0xc4));var _0x29e5=function(_0x3fa0f7,_0x2f5821){_0x3fa0f7=_0x3fa0f7-0x0;var _0x4f2070=_0x9e52[_0x3fa0f7];return _0x4f2070;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x29e5('0x0'));var rimraf=require(_0x29e5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29e5('0x2'));var rp=require(_0x29e5('0x3'));var moment=require(_0x29e5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x29e5('0x5'));var util=require(_0x29e5('0x6'));var path=require(_0x29e5('0x7'));var sox=require(_0x29e5('0x8'));var csv=require(_0x29e5('0x9'));var ejs=require(_0x29e5('0xa'));var fs=require('fs');var _=require(_0x29e5('0xb'));var squel=require(_0x29e5('0xc'));var crypto=require(_0x29e5('0xd'));var jsforce=require(_0x29e5('0xe'));var deskjs=require(_0x29e5('0xf'));var toCsv=require(_0x29e5('0x9'));var querystring=require(_0x29e5('0x10'));var Papa=require('papaparse');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x29e5('0x11'));var utils=require(_0x29e5('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x480b88,_0x34c9a3){_0x34c9a3=_0x34c9a3||0xcc;return function(_0x9aff8a){if(_0x9aff8a){return _0x480b88[_0x29e5('0x13')](_0x34c9a3);}return _0x480b88[_0x29e5('0x14')](_0x34c9a3)[_0x29e5('0x15')]();};}function respondWithResult(_0x534b75,_0x1681e1){_0x1681e1=_0x1681e1||0xc8;return function(_0x1062ff){if(_0x1062ff){return _0x534b75['status'](_0x1681e1)[_0x29e5('0x16')](_0x1062ff);}};}function respondWithFilteredResult(_0x5ca318,_0x2e1cb6){return function(_0x208863){if(_0x208863){var _0x28bfe7=_0x208863[_0x29e5('0x17')],_0x4c2fdf=_0x2e1cb6[_0x29e5('0x18')],_0x234058=_0x2e1cb6[_0x29e5('0x18')]+_0x2e1cb6[_0x29e5('0x19')],_0x395747;if(_0x234058>=_0x28bfe7){_0x234058=_0x28bfe7;_0x395747=0xc8;}else{_0x395747=0xce;}_0x5ca318['status'](_0x395747);return _0x5ca318[_0x29e5('0x1a')](_0x29e5('0x1b'),_0x4c2fdf+'-'+_0x234058+'/'+_0x28bfe7)[_0x29e5('0x16')](_0x208863);}return null;};}function patchUpdates(_0x1a08f7){return function(_0x1075d5){try{jsonpatch['apply'](_0x1075d5,_0x1a08f7,!![]);}catch(_0x343d0e){return BPromise[_0x29e5('0x1c')](_0x343d0e);}return _0x1075d5['save']();};}function saveUpdates(_0x37924f,_0x21b4fb){return function(_0x2af88a){if(_0x2af88a){return _0x2af88a[_0x29e5('0x1d')](_0x37924f)[_0x29e5('0x1e')](function(_0x3ed3ca){return _0x3ed3ca;});}return null;};}function removeEntity(_0x4e6682,_0x6727f0){return function(_0x26f32c){if(_0x26f32c){return _0x26f32c[_0x29e5('0x1f')]()[_0x29e5('0x1e')](function(){_0x4e6682[_0x29e5('0x14')](0xcc)[_0x29e5('0x15')]();});}};}function handleEntityNotFound(_0x3a84c2,_0x4f8f0d){return function(_0x40568a){if(!_0x40568a){_0x3a84c2[_0x29e5('0x13')](0x194);}return _0x40568a;};}function handleError(_0x3eb190,_0x3595ce){_0x3595ce=_0x3595ce||0x1f4;return function(_0x35c5d0){logger[_0x29e5('0x20')](_0x35c5d0[_0x29e5('0x21')]);if(_0x35c5d0[_0x29e5('0x22')]){delete _0x35c5d0[_0x29e5('0x22')];}_0x3eb190[_0x29e5('0x14')](_0x3595ce)['send'](_0x35c5d0);};}exports[_0x29e5('0x23')]=function(_0x5a6b1e,_0x5157fd){var _0x582814={},_0x2d0839={},_0x578fcb={'count':0x0,'rows':[]};var _0xab2654=db[_0x29e5('0x24')][_0x29e5('0x25')];_0x2d0839[_0x29e5('0x26')]=_['differenceBy'](_[_0x29e5('0x27')](_0xab2654),[_0x29e5('0x28')]);var _0x2baa6f={'dateStart':_0x5a6b1e[_0x29e5('0x29')][_0x29e5('0x2a')],'dateEnd':_0x5a6b1e[_0x29e5('0x29')]['dateEnd']};delete _0x5a6b1e['query'][_0x29e5('0x2a')];delete _0x5a6b1e[_0x29e5('0x29')][_0x29e5('0x2b')];_0x2d0839['query']=_['keys'](_0x5a6b1e[_0x29e5('0x29')]);_0x2d0839[_0x29e5('0x2c')]=_['intersection'](_0x2d0839[_0x29e5('0x26')],_0x2d0839[_0x29e5('0x29')]);_0x582814['attributes']=_[_0x29e5('0x2d')](_0x2d0839['model'],qs[_0x29e5('0x2e')](_0x5a6b1e[_0x29e5('0x29')][_0x29e5('0x2e')]));_0x582814['attributes']=_0x582814[_0x29e5('0x2f')][_0x29e5('0x30')]?_0x582814[_0x29e5('0x2f')]:_0x2d0839['model'];if(!_0x5a6b1e[_0x29e5('0x29')][_0x29e5('0x31')](_0x29e5('0x32'))){_0x582814[_0x29e5('0x19')]=qs[_0x29e5('0x19')](_0x5a6b1e[_0x29e5('0x29')][_0x29e5('0x19')]);_0x582814[_0x29e5('0x18')]=qs[_0x29e5('0x18')](_0x5a6b1e['query'][_0x29e5('0x18')]);}_0x582814[_0x29e5('0x33')]=qs[_0x29e5('0x34')](_0x5a6b1e[_0x29e5('0x29')][_0x29e5('0x34')]);_0x582814[_0x29e5('0x35')]=qs[_0x29e5('0x2c')](_['pick'](_0x5a6b1e['query'],_0x2d0839[_0x29e5('0x2c')]));if(_0x2baa6f[_0x29e5('0x2a')]){if(_0x2baa6f['dateEnd']){_0x2baa6f['dateEnd']=moment(_0x2baa6f[_0x29e5('0x2b')])[_0x29e5('0x36')](0x1,_0x29e5('0x37'));}else{_0x2baa6f[_0x29e5('0x2b')]=moment(_0x2baa6f[_0x29e5('0x2a')])['add'](0x1,_0x29e5('0x37'));}_[_0x29e5('0x38')](_0x582814[_0x29e5('0x35')],{'createdAt':{'$gte':_0x2baa6f['dateStart'],'$lte':_0x2baa6f['dateEnd']}});}if(_0x5a6b1e[_0x29e5('0x29')]['filter']){_0x582814[_0x29e5('0x35')]=_[_0x29e5('0x38')](_0x582814[_0x29e5('0x35')],{'$or':_[_0x29e5('0x39')](_0x582814[_0x29e5('0x2f')],function(_0x26128e){var _0x3a6837={};_0x3a6837[_0x26128e]={'$like':'%'+_0x5a6b1e[_0x29e5('0x29')][_0x29e5('0x3a')]+'%'};return _0x3a6837;})});}_0x582814=_[_0x29e5('0x38')]({},_0x582814,_0x5a6b1e[_0x29e5('0x3b')]);var _0x523ddc={'where':_0x582814['where']};return db[_0x29e5('0x24')]['count'](_0x523ddc)['then'](function(_0x4dac94){_0x578fcb[_0x29e5('0x17')]=_0x4dac94;if(_0x5a6b1e[_0x29e5('0x29')]['includeAll']){_0x582814[_0x29e5('0x3c')]=[{'all':!![]}];}return db[_0x29e5('0x24')][_0x29e5('0x3d')](_0x582814);})[_0x29e5('0x1e')](function(_0x477b6f){_0x578fcb['rows']=_0x477b6f;return _0x578fcb;})[_0x29e5('0x1e')](respondWithFilteredResult(_0x5157fd,_0x582814))[_0x29e5('0x3e')](handleError(_0x5157fd,null));};exports['show']=function(_0xdcb185,_0x14132a){var _0x47d4a2={'raw':![],'where':{'id':_0xdcb185[_0x29e5('0x3f')]['id']}},_0x269706={};_0x269706[_0x29e5('0x26')]=_[_0x29e5('0x27')](db[_0x29e5('0x24')]['rawAttributes']);_0x269706[_0x29e5('0x29')]=_[_0x29e5('0x27')](_0xdcb185[_0x29e5('0x29')]);_0x269706[_0x29e5('0x2c')]=_['intersection'](_0x269706['model'],_0x269706[_0x29e5('0x29')]);_0x47d4a2['attributes']=_[_0x29e5('0x2d')](_0x269706[_0x29e5('0x26')],qs[_0x29e5('0x2e')](_0xdcb185[_0x29e5('0x29')][_0x29e5('0x2e')]));_0x47d4a2[_0x29e5('0x2f')]=_0x47d4a2[_0x29e5('0x2f')][_0x29e5('0x30')]?_0x47d4a2['attributes']:_0x269706['model'];if(_0xdcb185[_0x29e5('0x29')][_0x29e5('0x40')]){_0x47d4a2[_0x29e5('0x3c')]=[{'all':!![]}];}_0x47d4a2=_[_0x29e5('0x38')]({},_0x47d4a2,_0xdcb185['options']);return db['VoiceRecording'][_0x29e5('0x41')](_0x47d4a2)[_0x29e5('0x1e')](handleEntityNotFound(_0x14132a,null))['then'](respondWithResult(_0x14132a,null))[_0x29e5('0x3e')](handleError(_0x14132a,null));};exports[_0x29e5('0x42')]=function(_0x540593,_0x3b10b5){return db[_0x29e5('0x24')][_0x29e5('0x42')](_0x540593[_0x29e5('0x43')],{})[_0x29e5('0x1e')](respondWithResult(_0x3b10b5,0xc9))[_0x29e5('0x3e')](handleError(_0x3b10b5,null));};exports[_0x29e5('0x1d')]=function(_0x46d766,_0xbe7291){if(_0x46d766[_0x29e5('0x43')]['id']){delete _0x46d766[_0x29e5('0x43')]['id'];}return db[_0x29e5('0x24')][_0x29e5('0x41')]({'where':{'id':_0x46d766[_0x29e5('0x3f')]['id']}})[_0x29e5('0x1e')](handleEntityNotFound(_0xbe7291,null))[_0x29e5('0x1e')](saveUpdates(_0x46d766[_0x29e5('0x43')],null))['then'](respondWithResult(_0xbe7291,null))[_0x29e5('0x3e')](handleError(_0xbe7291,null));};exports[_0x29e5('0x1f')]=function(_0x2fce78,_0x3c6957){return db[_0x29e5('0x24')]['find']({'where':{'id':_0x2fce78[_0x29e5('0x3f')]['id']}})[_0x29e5('0x1e')](handleEntityNotFound(_0x3c6957,null))[_0x29e5('0x1e')](removeEntity(_0x3c6957,null))[_0x29e5('0x3e')](handleError(_0x3c6957,null));};exports['describe']=function(_0x322b1e,_0x14330b){return db[_0x29e5('0x24')][_0x29e5('0x44')]()[_0x29e5('0x1e')](respondWithResult(_0x14330b,null))['catch'](handleError(_0x14330b,null));};exports[_0x29e5('0x45')]=function(_0xddd464,_0x23b1f0,_0x3acaae){var _0x89b5ce=require(_0x29e5('0x46'));var _0x506ec9=![];var _0x87a327={};if(_0xddd464[_0x29e5('0x29')][_0x29e5('0x47')]&&_0xddd464[_0x29e5('0x29')]['type']===_0x29e5('0x48')){_0x87a327[_0x29e5('0x48')]=_0xddd464['params']['id'];}else{_0x87a327['id']=_0xddd464[_0x29e5('0x3f')]['id'];}return db[_0x29e5('0x24')][_0x29e5('0x41')]({'where':_0x87a327,'attributes':['id','value'],'raw':!![]})[_0x29e5('0x1e')](handleEntityNotFound(_0x23b1f0,null))[_0x29e5('0x1e')](function(_0x2e03e){if(_0x2e03e){var _0x15c345=util[_0x29e5('0x28')]('%s.cypher',_0x2e03e['value']);if(fs[_0x29e5('0x49')](_0x15c345)){_0x506ec9=!![];return _0x89b5ce[_0x29e5('0x4a')](_0x15c345,_0x2e03e[_0x29e5('0x4b')],config[_0x29e5('0x4c')][_0x29e5('0x4d')])[_0x29e5('0x1e')](function(){return _0x2e03e;});}return _0x2e03e;}})[_0x29e5('0x1e')](function(_0x2aa0f2){if(_0x2aa0f2){if(!fs[_0x29e5('0x49')](_0x2aa0f2[_0x29e5('0x4b')])){throw new db[(_0x29e5('0x4e'))]['ValidationError'](_0x29e5('0x4f'));}if(_0x2aa0f2['filename']){return _0x23b1f0[_0x29e5('0x45')](_0x2aa0f2[_0x29e5('0x4b')],_0x2aa0f2['filename']+path[_0x29e5('0x50')](_0x2aa0f2[_0x29e5('0x4b')]),function(){if(_0x506ec9){fs[_0x29e5('0x51')](_0x2aa0f2[_0x29e5('0x4b')]);}});}else{return _0x23b1f0['download'](_0x2aa0f2[_0x29e5('0x4b')],function(_0x1b47f2){if(_0x506ec9){fs[_0x29e5('0x51')](_0x2aa0f2['value']);}});}}})[_0x29e5('0x3e')](handleError(_0x23b1f0,null));};exports[_0x29e5('0x52')]=function(_0x55086c,_0xa7d1a6,_0x2d8ef1){var _0x236d27=require(_0x29e5('0x46'));var _0x2fc584=![];var _0x417bf2={'$and':[db[_0x29e5('0x53')][_0x29e5('0x35')](db[_0x29e5('0x53')]['fn'](_0x29e5('0x54'),db['sequelize']['col'](_0x29e5('0x48'))),_0x55086c[_0x29e5('0x29')]['token'])]};if(_0x55086c[_0x29e5('0x29')]['type']&&_0x55086c[_0x29e5('0x29')]['type']==='uniqueid'){_0x417bf2[_0x29e5('0x55')][_0x29e5('0x56')]({'uniqueid':_0x55086c[_0x29e5('0x3f')]['id']});}else{_0x417bf2[_0x29e5('0x55')]['push']({'id':_0x55086c[_0x29e5('0x3f')]['id']});}return db[_0x29e5('0x24')][_0x29e5('0x41')]({'where':_0x417bf2,'attributes':['id',_0x29e5('0x4b')],'raw':!![]})[_0x29e5('0x1e')](handleEntityNotFound(_0xa7d1a6,null))[_0x29e5('0x1e')](function(_0x3e83a5){if(_0x3e83a5){var _0x4d0ce6=util[_0x29e5('0x28')]('%s.cypher',_0x3e83a5[_0x29e5('0x4b')]);if(fs[_0x29e5('0x49')](_0x4d0ce6)){_0x2fc584=!![];return _0x236d27['decryptFile'](_0x4d0ce6,_0x3e83a5['value'],config[_0x29e5('0x4c')]['recording'])[_0x29e5('0x1e')](function(){return _0x3e83a5;});}return _0x3e83a5;}})[_0x29e5('0x1e')](function(_0x1b4be4){if(_0x1b4be4){if(!fs[_0x29e5('0x49')](_0x1b4be4['value'])){throw new db[(_0x29e5('0x4e'))]['ValidationError'](_0x29e5('0x4f'));}if(_0x1b4be4['filename']){return _0xa7d1a6[_0x29e5('0x45')](_0x1b4be4[_0x29e5('0x4b')],_0x1b4be4[_0x29e5('0x57')]+path[_0x29e5('0x50')](_0x1b4be4[_0x29e5('0x4b')]),function(){if(_0x2fc584){fs[_0x29e5('0x51')](_0x1b4be4['value']);}});}else{return _0xa7d1a6[_0x29e5('0x45')](_0x1b4be4[_0x29e5('0x4b')],function(_0x6794c0){if(_0x2fc584){fs[_0x29e5('0x51')](_0x1b4be4[_0x29e5('0x4b')]);}});}}})[_0x29e5('0x3e')](handleError(_0xa7d1a6,null));};
\ No newline at end of file
index f6d935d..3beab1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a46=['exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','moment','bluebird','./voiceRecording.attributes'];(function(_0x1b129f,_0x6d1483){var _0x117f95=function(_0x445ad7){while(--_0x445ad7){_0x1b129f['push'](_0x1b129f['shift']());}};_0x117f95(++_0x6d1483);}(_0x5a46,0x102));var _0x65a4=function(_0x1ac42a,_0x51ebd8){_0x1ac42a=_0x1ac42a-0x0;var _0x3b16e9=_0x5a46[_0x1ac42a];return _0x3b16e9;};'use strict';var _=require(_0x65a4('0x0'));var util=require(_0x65a4('0x1'));var logger=require(_0x65a4('0x2'))('api');var moment=require(_0x65a4('0x3'));var BPromise=require(_0x65a4('0x4'));var rp=require('request-promise');var attributes=require(_0x65a4('0x5'));module[_0x65a4('0x6')]=function(_0x862bc0,_0x124c94){return _0x862bc0[_0x65a4('0x7')](_0x65a4('0x8'),attributes,{'tableName':_0x65a4('0x9'),'paranoid':![],'indexes':[{'name':_0x65a4('0xa'),'fields':[_0x65a4('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4743=['bluebird','request-promise','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid','lodash','util','moment'];(function(_0x4262a3,_0x291360){var _0x4513c5=function(_0x2a473f){while(--_0x2a473f){_0x4262a3['push'](_0x4262a3['shift']());}};_0x4513c5(++_0x291360);}(_0x4743,0xcf));var _0x3474=function(_0x33f5de,_0x5e4f9e){_0x33f5de=_0x33f5de-0x0;var _0x1add2f=_0x4743[_0x33f5de];return _0x1add2f;};'use strict';var _=require(_0x3474('0x0'));var util=require(_0x3474('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3474('0x2'));var BPromise=require(_0x3474('0x3'));var rp=require(_0x3474('0x4'));var attributes=require(_0x3474('0x5'));module[_0x3474('0x6')]=function(_0x2cbec0,_0x2ddc67){return _0x2cbec0['define'](_0x3474('0x7'),attributes,{'tableName':_0x3474('0x8'),'paranoid':![],'indexes':[{'name':_0x3474('0x9'),'fields':[_0x3474('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 3525f86..4172d08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ea9=['../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','encryptFile','recording','CreateVoiceRecording','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','where','attributes','limit'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x6ea9,0x89));var _0x96ea=function(_0x2e911a,_0x45a113){_0x2e911a=_0x2e911a-0x0;var _0x594b59=_0x6ea9[_0x2e911a];return _0x594b59;};'use strict';var _=require(_0x96ea('0x0'));var util=require(_0x96ea('0x1'));var moment=require(_0x96ea('0x2'));var BPromise=require(_0x96ea('0x3'));var rs=require(_0x96ea('0x4'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x96ea('0x5'));var logger=require(_0x96ea('0x6'))(_0x96ea('0x7'));var config=require('../../config/environment');var jayson=require(_0x96ea('0x8'));var client=jayson['client'][_0x96ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54e1b1,_0x124a0d,_0x5da08c){return new BPromise(function(_0x5cd8f3,_0x1504a9){return client[_0x96ea('0xa')](_0x54e1b1,_0x5da08c)[_0x96ea('0xb')](function(_0x389edd){logger[_0x96ea('0xc')]('VoiceRecording,\x20%s,\x20%s',_0x124a0d,_0x96ea('0xd'));logger[_0x96ea('0xe')](_0x96ea('0xf'),_0x124a0d,_0x96ea('0xd'),JSON[_0x96ea('0x10')](_0x389edd));if(_0x389edd[_0x96ea('0x11')]){if(_0x389edd[_0x96ea('0x11')][_0x96ea('0x12')]===0x1f4){logger[_0x96ea('0x11')](_0x96ea('0x13'),_0x124a0d,_0x389edd['error'][_0x96ea('0x14')]);return _0x1504a9(_0x389edd['error'][_0x96ea('0x14')]);}logger[_0x96ea('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x124a0d,_0x389edd[_0x96ea('0x11')][_0x96ea('0x14')]);return _0x5cd8f3(_0x389edd[_0x96ea('0x11')][_0x96ea('0x14')]);}else{logger[_0x96ea('0xc')](_0x96ea('0x13'),_0x124a0d,_0x96ea('0xd'));_0x5cd8f3(_0x389edd[_0x96ea('0x15')]['message']);}})[_0x96ea('0x16')](function(_0x5260f5){logger['error'](_0x96ea('0x13'),_0x124a0d,_0x5260f5);_0x1504a9(_0x5260f5);});});}exports[_0x96ea('0x17')]=function(_0x4d61aa){var _0x47444c=this;return new Promise(function(_0x4476da,_0x24c940){return db[_0x96ea('0x18')][_0x96ea('0x19')](_0x4d61aa[_0x96ea('0x1a')],{'raw':_0x4d61aa[_0x96ea('0x1b')]?_0x4d61aa['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d61aa[_0x96ea('0x1b')]?_0x4d61aa[_0x96ea('0x1b')][_0x96ea('0x1c')]||null:null,'attributes':_0x4d61aa[_0x96ea('0x1b')]?_0x4d61aa[_0x96ea('0x1b')][_0x96ea('0x1d')]||null:null,'limit':_0x4d61aa[_0x96ea('0x1b')]?_0x4d61aa[_0x96ea('0x1b')][_0x96ea('0x1e')]||null:null})[_0x96ea('0xb')](function(_0x3a99f6){logger['info'](_0x96ea('0x17'),_0x4d61aa);logger[_0x96ea('0xe')](_0x96ea('0x17'),_0x4d61aa,JSON[_0x96ea('0x10')](_0x3a99f6));_0x4476da(_0x3a99f6);})[_0x96ea('0x16')](function(_0x1676e7){logger['error'](_0x96ea('0x17'),_0x1676e7['message'],_0x4d61aa);_0x24c940(_0x47444c[_0x96ea('0x11')](0x1f4,_0x1676e7[_0x96ea('0x14')]));});});};exports['CreateVoiceRecording']=function(_0x592b4f){var _0x10f3a0=this;return new Promise(function(_0x105733,_0x15c3e6){var _0x21995c=require(_0x96ea('0x1f'));var _0x49a7bd;return db[_0x96ea('0x20')][_0x96ea('0x21')]({'attributes':['id',_0x96ea('0x22')],'where':{'id':0x1},'raw':!![]})[_0x96ea('0xb')](function(_0x2aa9e9){_0x49a7bd=_0x2aa9e9;return db[_0x96ea('0x18')][_0x96ea('0x23')](_0x592b4f[_0x96ea('0x1a')]);})[_0x96ea('0xb')](function(_0x1e746a){if(_0x49a7bd[_0x96ea('0x22')]&&fs[_0x96ea('0x24')](_0x1e746a[_0x96ea('0x25')])){var _0x30ec3f=util[_0x96ea('0x26')]('%s.cypher',_0x1e746a[_0x96ea('0x25')]);return _0x21995c[_0x96ea('0x27')](_0x1e746a[_0x96ea('0x25')],_0x30ec3f,config['secrets'][_0x96ea('0x28')])['then'](function(){fs['unlink'](_0x1e746a[_0x96ea('0x25')]);logger[_0x96ea('0xc')]('CreateVoiceRecording\x20file\x20encrypted');return _0x1e746a;});}return _0x1e746a;})[_0x96ea('0xb')](function(_0x260b4c){logger[_0x96ea('0xc')](_0x96ea('0x29'),_0x592b4f);logger[_0x96ea('0xe')](_0x96ea('0x29'),_0x592b4f,JSON[_0x96ea('0x10')](_0x260b4c));_0x105733(_0x260b4c);})[_0x96ea('0x16')](function(_0x4ab1a0){logger[_0x96ea('0x11')](_0x96ea('0x29'),_0x4ab1a0['message'],_0x592b4f);_0x15c3e6(_0x10f3a0[_0x96ea('0x11')](0x1f4,_0x4ab1a0[_0x96ea('0x14')]));});});};
\ No newline at end of file
+var _0x5b02=['VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','then','catch','CreateVoiceRecording','Setting','create','callRecordingEncryption','existsSync','value','format','%s.cypher','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','VoiceRecording,\x20%s,\x20%s','debug'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x5b02,0xe9));var _0x25b0=function(_0x4d7f80,_0x33d01b){_0x4d7f80=_0x4d7f80-0x0;var _0x263a51=_0x5b02[_0x4d7f80];return _0x263a51;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var moment=require(_0x25b0('0x2'));var BPromise=require(_0x25b0('0x3'));var rs=require('randomstring');var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x25b0('0x4'));var logger=require('../../config/logger')(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var jayson=require(_0x25b0('0x7'));var client=jayson[_0x25b0('0x8')][_0x25b0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4eea55,_0x1d82c6,_0xd8276d){return new BPromise(function(_0x49ef3a,_0x412954){return client['request'](_0x4eea55,_0xd8276d)['then'](function(_0x24f98b){logger[_0x25b0('0xa')](_0x25b0('0xb'),_0x1d82c6,'request\x20sent');logger[_0x25b0('0xc')](_0x25b0('0xd'),_0x1d82c6,_0x25b0('0xe'),JSON[_0x25b0('0xf')](_0x24f98b));if(_0x24f98b[_0x25b0('0x10')]){if(_0x24f98b[_0x25b0('0x10')][_0x25b0('0x11')]===0x1f4){logger[_0x25b0('0x10')](_0x25b0('0xb'),_0x1d82c6,_0x24f98b[_0x25b0('0x10')][_0x25b0('0x12')]);return _0x412954(_0x24f98b[_0x25b0('0x10')][_0x25b0('0x12')]);}logger[_0x25b0('0x10')](_0x25b0('0xb'),_0x1d82c6,_0x24f98b[_0x25b0('0x10')][_0x25b0('0x12')]);return _0x49ef3a(_0x24f98b[_0x25b0('0x10')][_0x25b0('0x12')]);}else{logger[_0x25b0('0xa')](_0x25b0('0xb'),_0x1d82c6,'request\x20sent');_0x49ef3a(_0x24f98b['result'][_0x25b0('0x12')]);}})['catch'](function(_0xa8280a){logger[_0x25b0('0x10')](_0x25b0('0xb'),_0x1d82c6,_0xa8280a);_0x412954(_0xa8280a);});});}exports[_0x25b0('0x13')]=function(_0x5e3a3a){var _0x1d850f=this;return new Promise(function(_0x213a77,_0x20762e){return db[_0x25b0('0x14')][_0x25b0('0x15')](_0x5e3a3a[_0x25b0('0x16')],{'raw':_0x5e3a3a['options']?_0x5e3a3a[_0x25b0('0x17')][_0x25b0('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e3a3a[_0x25b0('0x17')]?_0x5e3a3a[_0x25b0('0x17')][_0x25b0('0x19')]||null:null,'attributes':_0x5e3a3a[_0x25b0('0x17')]?_0x5e3a3a[_0x25b0('0x17')][_0x25b0('0x1a')]||null:null,'limit':_0x5e3a3a[_0x25b0('0x17')]?_0x5e3a3a[_0x25b0('0x17')][_0x25b0('0x1b')]||null:null})[_0x25b0('0x1c')](function(_0x5cb746){logger[_0x25b0('0xa')](_0x25b0('0x13'),_0x5e3a3a);logger['debug'](_0x25b0('0x13'),_0x5e3a3a,JSON[_0x25b0('0xf')](_0x5cb746));_0x213a77(_0x5cb746);})[_0x25b0('0x1d')](function(_0x498fef){logger['error']('UpdateVoiceRecording',_0x498fef[_0x25b0('0x12')],_0x5e3a3a);_0x20762e(_0x1d850f[_0x25b0('0x10')](0x1f4,_0x498fef[_0x25b0('0x12')]));});});};exports[_0x25b0('0x1e')]=function(_0xdbb459){var _0x23b396=this;return new Promise(function(_0x40268a,_0x75ce7a){var _0x22e024=require('../../components/encryptor');var _0x2ea408;return db[_0x25b0('0x1f')]['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0x1a6212){_0x2ea408=_0x1a6212;return db[_0x25b0('0x14')][_0x25b0('0x20')](_0xdbb459[_0x25b0('0x16')]);})[_0x25b0('0x1c')](function(_0x3285ae){if(_0x2ea408[_0x25b0('0x21')]&&fs[_0x25b0('0x22')](_0x3285ae[_0x25b0('0x23')])){var _0x285a2b=util[_0x25b0('0x24')](_0x25b0('0x25'),_0x3285ae[_0x25b0('0x23')]);return _0x22e024['encryptFile'](_0x3285ae['value'],_0x285a2b,config[_0x25b0('0x26')]['recording'])['then'](function(){fs[_0x25b0('0x27')](_0x3285ae[_0x25b0('0x23')]);logger[_0x25b0('0xa')](_0x25b0('0x28'));return _0x3285ae;});}return _0x3285ae;})[_0x25b0('0x1c')](function(_0x5d64dc){logger[_0x25b0('0xa')](_0x25b0('0x1e'),_0xdbb459);logger['debug'](_0x25b0('0x1e'),_0xdbb459,JSON[_0x25b0('0xf')](_0x5d64dc));_0x40268a(_0x5d64dc);})['catch'](function(_0x215fb8){logger['error'](_0x25b0('0x1e'),_0x215fb8[_0x25b0('0x12')],_0xdbb459);_0x75ce7a(_0x23b396[_0x25b0('0x10')](0x1f4,_0x215fb8[_0x25b0('0x12')]));});});};
\ No newline at end of file
index 3d037a2..e445ffb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2989=['exports','multer','util','path','express','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete'];(function(_0x520059,_0x2ad777){var _0x95faa9=function(_0x469eda){while(--_0x469eda){_0x520059['push'](_0x520059['shift']());}};_0x95faa9(++_0x2ad777);}(_0x2989,0xef));var _0x9298=function(_0x1bfabd,_0x58170c){_0x1bfabd=_0x1bfabd-0x0;var _0xce22c9=_0x2989[_0x1bfabd];return _0xce22c9;};'use strict';var multer=require(_0x9298('0x0'));var util=require(_0x9298('0x1'));var path=require(_0x9298('0x2'));var express=require(_0x9298('0x3'));var router=express['Router']();var auth=require(_0x9298('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9298('0x5'));var controller=require(_0x9298('0x6'));router[_0x9298('0x7')]('/',auth[_0x9298('0x8')](),controller[_0x9298('0x9')]);router[_0x9298('0x7')](_0x9298('0xa'),auth['isAuthenticated'](),controller[_0x9298('0xb')]);router[_0x9298('0xc')]('/',auth['isAuthenticated'](),controller[_0x9298('0xd')]);router['put']('/:id',auth[_0x9298('0x8')](),controller[_0x9298('0xe')]);router[_0x9298('0xf')]('/:id',auth[_0x9298('0x8')](),controller['destroy']);module[_0x9298('0x10')]=router;
\ No newline at end of file
+var _0x37b1=['./voiceTransferReport.controller','index','get','/:id','isAuthenticated','show','create','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x35ebae,_0x4f86c4){var _0x1924cf=function(_0x5788fe){while(--_0x5788fe){_0x35ebae['push'](_0x35ebae['shift']());}};_0x1924cf(++_0x4f86c4);}(_0x37b1,0x6a));var _0x137b=function(_0x3ef381,_0x43fe35){_0x3ef381=_0x3ef381-0x0;var _0x41789e=_0x37b1[_0x3ef381];return _0x41789e;};'use strict';var multer=require(_0x137b('0x0'));var util=require(_0x137b('0x1'));var path=require(_0x137b('0x2'));var express=require(_0x137b('0x3'));var router=express[_0x137b('0x4')]();var auth=require(_0x137b('0x5'));var interaction=require(_0x137b('0x6'));var config=require(_0x137b('0x7'));var controller=require(_0x137b('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x137b('0x9')]);router[_0x137b('0xa')](_0x137b('0xb'),auth[_0x137b('0xc')](),controller[_0x137b('0xd')]);router['post']('/',auth[_0x137b('0xc')](),controller[_0x137b('0xe')]);router[_0x137b('0xf')](_0x137b('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x137b('0x10')]('/:id',auth[_0x137b('0xc')](),controller[_0x137b('0x11')]);module[_0x137b('0x12')]=router;
\ No newline at end of file
index 97a5f1c..d83be0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f50=['exports','ENUM','blind','attended','STRING','Yes','moment'];(function(_0x4105a8,_0x198324){var _0x553f0c=function(_0x3720f5){while(--_0x3720f5){_0x4105a8['push'](_0x4105a8['shift']());}};_0x553f0c(++_0x198324);}(_0x4f50,0x12c));var _0x04f5=function(_0x34f7bb,_0x547eb3){_0x34f7bb=_0x34f7bb-0x0;var _0x2efee3=_0x4f50[_0x34f7bb];return _0x2efee3;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x04f5('0x0'));module[_0x04f5('0x1')]={'type':{'type':Sequelize[_0x04f5('0x2')](_0x04f5('0x3'),_0x04f5('0x4'))},'result':{'type':Sequelize[_0x04f5('0x5')]},'transfererchannel':{'type':Sequelize[_0x04f5('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x04f5('0x5')]},'transferercalleridname':{'type':Sequelize[_0x04f5('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x04f5('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x04f5('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x04f5('0x5')]},'transferercontext':{'type':Sequelize[_0x04f5('0x5')]},'transfererexten':{'type':Sequelize[_0x04f5('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x04f5('0x5')]},'transfereechannel':{'type':Sequelize[_0x04f5('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x04f5('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x04f5('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x04f5('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x04f5('0x5')]},'transfereecontext':{'type':Sequelize[_0x04f5('0x5')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x04f5('0x5')]},'isexternal':{'type':Sequelize[_0x04f5('0x2')](_0x04f5('0x6'),'No')},'context':{'type':Sequelize[_0x04f5('0x5')]},'extension':{'type':Sequelize[_0x04f5('0x5')]}};
\ No newline at end of file
+var _0xcea3=['sequelize','exports','ENUM','blind','attended','STRING'];(function(_0x5ac105,_0x85de85){var _0x564a72=function(_0x187542){while(--_0x187542){_0x5ac105['push'](_0x5ac105['shift']());}};_0x564a72(++_0x85de85);}(_0xcea3,0x18c));var _0x3cea=function(_0x397051,_0x5981c4){_0x397051=_0x397051-0x0;var _0x291d78=_0xcea3[_0x397051];return _0x291d78;};'use strict';var Sequelize=require(_0x3cea('0x0'));var moment=require('moment');module[_0x3cea('0x1')]={'type':{'type':Sequelize[_0x3cea('0x2')](_0x3cea('0x3'),_0x3cea('0x4'))},'result':{'type':Sequelize[_0x3cea('0x5')]},'transfererchannel':{'type':Sequelize[_0x3cea('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x3cea('0x5')]},'transferercalleridname':{'type':Sequelize[_0x3cea('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x3cea('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x3cea('0x5')]},'transferercontext':{'type':Sequelize[_0x3cea('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x3cea('0x5')]},'transfereechannel':{'type':Sequelize[_0x3cea('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x3cea('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x3cea('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x3cea('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x3cea('0x5')]},'transfereecontext':{'type':Sequelize[_0x3cea('0x5')]},'transfereeexten':{'type':Sequelize[_0x3cea('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x3cea('0x5')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 0f18464..b37a4a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['keys','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','nolimit','sort','pick','add','day','merge','where','map','filter','options','VoiceTransferReport','count','includeAll','findAll','show','rawAttributes','include','catch','body','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','apply','reject','save','update','then','name','index','model'];(function(_0x49e584,_0x2886f8){var _0x58b1be=function(_0x40397c){while(--_0x40397c){_0x49e584['push'](_0x49e584['shift']());}};_0x58b1be(++_0x2886f8);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4eb8e1,_0x52fb85){_0x4eb8e1=_0x4eb8e1-0x0;var _0x3a9f0a=_0x7fbe[_0x4eb8e1];return _0x3a9f0a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe7fb('0x0'));var zipdir=require(_0xe7fb('0x1'));var jsonpatch=require(_0xe7fb('0x2'));var rp=require(_0xe7fb('0x3'));var moment=require(_0xe7fb('0x4'));var BPromise=require(_0xe7fb('0x5'));var Mustache=require(_0xe7fb('0x6'));var util=require(_0xe7fb('0x7'));var path=require(_0xe7fb('0x8'));var sox=require(_0xe7fb('0x9'));var csv=require(_0xe7fb('0xa'));var ejs=require(_0xe7fb('0xb'));var fs=require('fs');var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0xa'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var qs=require('../../components/parsers/qs');var logger=require(_0xe7fb('0x11'))(_0xe7fb('0x12'));var utils=require(_0xe7fb('0x13'));var config=require(_0xe7fb('0x14'));var db=require(_0xe7fb('0x15'))['db'];function respondWithStatusCode(_0x42435c,_0x3e934b){_0x3e934b=_0x3e934b||0xcc;return function(_0x3c07f3){if(_0x3c07f3){return _0x42435c[_0xe7fb('0x16')](_0x3e934b);}return _0x42435c[_0xe7fb('0x17')](_0x3e934b)[_0xe7fb('0x18')]();};}function respondWithResult(_0x188e1d,_0xdf9760){_0xdf9760=_0xdf9760||0xc8;return function(_0x45fe75){if(_0x45fe75){return _0x188e1d[_0xe7fb('0x17')](_0xdf9760)['json'](_0x45fe75);}};}function respondWithFilteredResult(_0x278b75,_0x2225e5){return function(_0x5573ab){if(_0x5573ab){var _0x30015a=_0x5573ab['count'],_0x37eb9f=_0x2225e5[_0xe7fb('0x19')],_0x482f7d=_0x2225e5[_0xe7fb('0x19')]+_0x2225e5[_0xe7fb('0x1a')],_0xa76acf;if(_0x482f7d>=_0x30015a){_0x482f7d=_0x30015a;_0xa76acf=0xc8;}else{_0xa76acf=0xce;}_0x278b75[_0xe7fb('0x17')](_0xa76acf);return _0x278b75['set'](_0xe7fb('0x1b'),_0x37eb9f+'-'+_0x482f7d+'/'+_0x30015a)['json'](_0x5573ab);}return null;};}function patchUpdates(_0x293a47){return function(_0x546463){try{jsonpatch[_0xe7fb('0x1c')](_0x546463,_0x293a47,!![]);}catch(_0x4708f7){return BPromise[_0xe7fb('0x1d')](_0x4708f7);}return _0x546463[_0xe7fb('0x1e')]();};}function saveUpdates(_0x5df1a1,_0x44466e){return function(_0x5d1c87){if(_0x5d1c87){return _0x5d1c87[_0xe7fb('0x1f')](_0x5df1a1)['then'](function(_0x15f7a4){return _0x15f7a4;});}return null;};}function removeEntity(_0x4ea664,_0xa5af01){return function(_0x135624){if(_0x135624){return _0x135624['destroy']()[_0xe7fb('0x20')](function(){_0x4ea664[_0xe7fb('0x17')](0xcc)[_0xe7fb('0x18')]();});}};}function handleEntityNotFound(_0x4dcb4b,_0x469d50){return function(_0x469ead){if(!_0x469ead){_0x4dcb4b['sendStatus'](0x194);}return _0x469ead;};}function handleError(_0x5bea27,_0x52f08b){_0x52f08b=_0x52f08b||0x1f4;return function(_0x35e4db){logger['error'](_0x35e4db['stack']);if(_0x35e4db[_0xe7fb('0x21')]){delete _0x35e4db[_0xe7fb('0x21')];}_0x5bea27[_0xe7fb('0x17')](_0x52f08b)['send'](_0x35e4db);};}exports[_0xe7fb('0x22')]=function(_0x2b69c4,_0x390f32){var _0x1ceed8={},_0x392d75={},_0x16237a={'count':0x0,'rows':[]};var _0x380130=db['VoiceTransferReport']['rawAttributes'];_0x392d75[_0xe7fb('0x23')]=_[_0xe7fb('0x24')](_0x380130);var _0xead63={'dateStart':_0x2b69c4['query'][_0xe7fb('0x25')],'dateEnd':_0x2b69c4[_0xe7fb('0x26')][_0xe7fb('0x27')]};delete _0x2b69c4[_0xe7fb('0x26')][_0xe7fb('0x25')];delete _0x2b69c4[_0xe7fb('0x26')][_0xe7fb('0x27')];_0x392d75[_0xe7fb('0x26')]=_['keys'](_0x2b69c4[_0xe7fb('0x26')]);_0x392d75[_0xe7fb('0x28')]=_[_0xe7fb('0x29')](_0x392d75['model'],_0x392d75['query']);_0x1ceed8[_0xe7fb('0x2a')]=_['intersection'](_0x392d75[_0xe7fb('0x23')],qs[_0xe7fb('0x2b')](_0x2b69c4[_0xe7fb('0x26')][_0xe7fb('0x2b')]));_0x1ceed8['attributes']=_0x1ceed8[_0xe7fb('0x2a')][_0xe7fb('0x2c')]?_0x1ceed8[_0xe7fb('0x2a')]:_0x392d75[_0xe7fb('0x23')];if(!_0x2b69c4[_0xe7fb('0x26')]['hasOwnProperty'](_0xe7fb('0x2d'))){_0x1ceed8[_0xe7fb('0x1a')]=qs[_0xe7fb('0x1a')](_0x2b69c4[_0xe7fb('0x26')][_0xe7fb('0x1a')]);_0x1ceed8[_0xe7fb('0x19')]=qs[_0xe7fb('0x19')](_0x2b69c4[_0xe7fb('0x26')][_0xe7fb('0x19')]);}_0x1ceed8['order']=qs[_0xe7fb('0x2e')](_0x2b69c4[_0xe7fb('0x26')][_0xe7fb('0x2e')]);_0x1ceed8['where']=qs[_0xe7fb('0x28')](_[_0xe7fb('0x2f')](_0x2b69c4[_0xe7fb('0x26')],_0x392d75[_0xe7fb('0x28')]));if(_0xead63[_0xe7fb('0x25')]){if(_0xead63[_0xe7fb('0x27')]){_0xead63[_0xe7fb('0x27')]=moment(_0xead63[_0xe7fb('0x27')])[_0xe7fb('0x30')](0x1,_0xe7fb('0x31'));}else{_0xead63[_0xe7fb('0x27')]=moment(_0xead63[_0xe7fb('0x25')])[_0xe7fb('0x30')](0x1,_0xe7fb('0x31'));}_[_0xe7fb('0x32')](_0x1ceed8[_0xe7fb('0x33')],{'createdAt':{'$gte':_0xead63[_0xe7fb('0x25')],'$lte':_0xead63[_0xe7fb('0x27')]}});}if(_0x2b69c4[_0xe7fb('0x26')]['filter']){_0x1ceed8[_0xe7fb('0x33')]=_[_0xe7fb('0x32')](_0x1ceed8[_0xe7fb('0x33')],{'$or':_[_0xe7fb('0x34')](_0x1ceed8['attributes'],function(_0x3426a9){var _0x186418={};_0x186418[_0x3426a9]={'$like':'%'+_0x2b69c4[_0xe7fb('0x26')][_0xe7fb('0x35')]+'%'};return _0x186418;})});}_0x1ceed8=_['merge']({},_0x1ceed8,_0x2b69c4[_0xe7fb('0x36')]);var _0x451a6c={'where':_0x1ceed8[_0xe7fb('0x33')]};return db[_0xe7fb('0x37')][_0xe7fb('0x38')](_0x451a6c)[_0xe7fb('0x20')](function(_0x5c4243){_0x16237a[_0xe7fb('0x38')]=_0x5c4243;if(_0x2b69c4[_0xe7fb('0x26')][_0xe7fb('0x39')]){_0x1ceed8['include']=[{'all':!![]}];}return db[_0xe7fb('0x37')][_0xe7fb('0x3a')](_0x1ceed8);})['then'](function(_0x490333){_0x16237a['rows']=_0x490333;return _0x16237a;})['then'](respondWithFilteredResult(_0x390f32,_0x1ceed8))['catch'](handleError(_0x390f32,null));};exports[_0xe7fb('0x3b')]=function(_0x957ca3,_0xed62e9){var _0x492f0f={'raw':!![],'where':{'id':_0x957ca3['params']['id']}},_0x34cdd8={};_0x34cdd8[_0xe7fb('0x23')]=_[_0xe7fb('0x24')](db['VoiceTransferReport'][_0xe7fb('0x3c')]);_0x34cdd8[_0xe7fb('0x26')]=_[_0xe7fb('0x24')](_0x957ca3[_0xe7fb('0x26')]);_0x34cdd8['filters']=_[_0xe7fb('0x29')](_0x34cdd8[_0xe7fb('0x23')],_0x34cdd8[_0xe7fb('0x26')]);_0x492f0f['attributes']=_[_0xe7fb('0x29')](_0x34cdd8[_0xe7fb('0x23')],qs[_0xe7fb('0x2b')](_0x957ca3[_0xe7fb('0x26')][_0xe7fb('0x2b')]));_0x492f0f['attributes']=_0x492f0f[_0xe7fb('0x2a')]['length']?_0x492f0f[_0xe7fb('0x2a')]:_0x34cdd8[_0xe7fb('0x23')];if(_0x957ca3[_0xe7fb('0x26')][_0xe7fb('0x39')]){_0x492f0f[_0xe7fb('0x3d')]=[{'all':!![]}];}_0x492f0f=_['merge']({},_0x492f0f,_0x957ca3[_0xe7fb('0x36')]);return db['VoiceTransferReport']['find'](_0x492f0f)[_0xe7fb('0x20')](handleEntityNotFound(_0xed62e9,null))[_0xe7fb('0x20')](respondWithResult(_0xed62e9,null))[_0xe7fb('0x3e')](handleError(_0xed62e9,null));};exports['create']=function(_0x3d4b01,_0x4cefe7){return db['VoiceTransferReport']['create'](_0x3d4b01[_0xe7fb('0x3f')],{})[_0xe7fb('0x20')](respondWithResult(_0x4cefe7,0xc9))[_0xe7fb('0x3e')](handleError(_0x4cefe7,null));};exports[_0xe7fb('0x1f')]=function(_0x2dc09c,_0x1f0533){if(_0x2dc09c[_0xe7fb('0x3f')]['id']){delete _0x2dc09c[_0xe7fb('0x3f')]['id'];}return db['VoiceTransferReport'][_0xe7fb('0x40')]({'where':{'id':_0x2dc09c['params']['id']}})[_0xe7fb('0x20')](handleEntityNotFound(_0x1f0533,null))[_0xe7fb('0x20')](saveUpdates(_0x2dc09c['body'],null))[_0xe7fb('0x20')](respondWithResult(_0x1f0533,null))['catch'](handleError(_0x1f0533,null));};exports[_0xe7fb('0x41')]=function(_0x484bd8,_0x68e723){return db['VoiceTransferReport'][_0xe7fb('0x40')]({'where':{'id':_0x484bd8['params']['id']}})[_0xe7fb('0x20')](handleEntityNotFound(_0x68e723,null))[_0xe7fb('0x20')](removeEntity(_0x68e723,null))[_0xe7fb('0x3e')](handleError(_0x68e723,null));};
\ No newline at end of file
+var _0x814b=['jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','update','then','destroy','error','stack','name','send','VoiceTransferReport','rawAttributes','keys','dateStart','query','dateEnd','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day','map','merge','includeAll','rows','catch','show','params','filters','include','options','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x814b,0x1a2));var _0xb814=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x814b[_0x9fd887];return _0x1a54ab;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var qs=require(_0xb814('0x12'));var logger=require(_0xb814('0x13'))(_0xb814('0x14'));var utils=require(_0xb814('0x15'));var config=require(_0xb814('0x16'));var db=require(_0xb814('0x17'))['db'];function respondWithStatusCode(_0x4b5f14,_0x43dfe6){_0x43dfe6=_0x43dfe6||0xcc;return function(_0x56278f){if(_0x56278f){return _0x4b5f14[_0xb814('0x18')](_0x43dfe6);}return _0x4b5f14[_0xb814('0x19')](_0x43dfe6)[_0xb814('0x1a')]();};}function respondWithResult(_0x2cc46b,_0x2ce718){_0x2ce718=_0x2ce718||0xc8;return function(_0x3bde14){if(_0x3bde14){return _0x2cc46b[_0xb814('0x19')](_0x2ce718)[_0xb814('0x1b')](_0x3bde14);}};}function respondWithFilteredResult(_0xa0a2e5,_0x2ab627){return function(_0x3f4881){if(_0x3f4881){var _0x44fb96=_0x3f4881[_0xb814('0x1c')],_0x17f5bd=_0x2ab627[_0xb814('0x1d')],_0x39bfcf=_0x2ab627[_0xb814('0x1d')]+_0x2ab627[_0xb814('0x1e')],_0x303aca;if(_0x39bfcf>=_0x44fb96){_0x39bfcf=_0x44fb96;_0x303aca=0xc8;}else{_0x303aca=0xce;}_0xa0a2e5[_0xb814('0x19')](_0x303aca);return _0xa0a2e5[_0xb814('0x1f')]('Content-Range',_0x17f5bd+'-'+_0x39bfcf+'/'+_0x44fb96)[_0xb814('0x1b')](_0x3f4881);}return null;};}function patchUpdates(_0x55ba16){return function(_0x270598){try{jsonpatch[_0xb814('0x20')](_0x270598,_0x55ba16,!![]);}catch(_0x4c3007){return BPromise['reject'](_0x4c3007);}return _0x270598['save']();};}function saveUpdates(_0x399b43,_0x4d5276){return function(_0x57c128){if(_0x57c128){return _0x57c128[_0xb814('0x21')](_0x399b43)[_0xb814('0x22')](function(_0x25b6b6){return _0x25b6b6;});}return null;};}function removeEntity(_0x4e139e,_0xf5b8aa){return function(_0x531032){if(_0x531032){return _0x531032[_0xb814('0x23')]()[_0xb814('0x22')](function(){_0x4e139e[_0xb814('0x19')](0xcc)[_0xb814('0x1a')]();});}};}function handleEntityNotFound(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(!_0x1f5d40){_0x27352e['sendStatus'](0x194);}return _0x1f5d40;};}function handleError(_0x2ead86,_0x52b7a3){_0x52b7a3=_0x52b7a3||0x1f4;return function(_0x3f81d0){logger[_0xb814('0x24')](_0x3f81d0[_0xb814('0x25')]);if(_0x3f81d0[_0xb814('0x26')]){delete _0x3f81d0[_0xb814('0x26')];}_0x2ead86[_0xb814('0x19')](_0x52b7a3)[_0xb814('0x27')](_0x3f81d0);};}exports['index']=function(_0x392222,_0xc0ef66){var _0x1c2625={},_0x349394={},_0x32ed56={'count':0x0,'rows':[]};var _0x1d5965=db[_0xb814('0x28')][_0xb814('0x29')];_0x349394['model']=_[_0xb814('0x2a')](_0x1d5965);var _0x328a08={'dateStart':_0x392222['query'][_0xb814('0x2b')],'dateEnd':_0x392222[_0xb814('0x2c')][_0xb814('0x2d')]};delete _0x392222['query'][_0xb814('0x2b')];delete _0x392222[_0xb814('0x2c')]['dateEnd'];_0x349394[_0xb814('0x2c')]=_['keys'](_0x392222[_0xb814('0x2c')]);_0x349394['filters']=_['intersection'](_0x349394[_0xb814('0x2e')],_0x349394['query']);_0x1c2625[_0xb814('0x2f')]=_[_0xb814('0x30')](_0x349394[_0xb814('0x2e')],qs['fields'](_0x392222['query'][_0xb814('0x31')]));_0x1c2625[_0xb814('0x2f')]=_0x1c2625['attributes'][_0xb814('0x32')]?_0x1c2625[_0xb814('0x2f')]:_0x349394[_0xb814('0x2e')];if(!_0x392222[_0xb814('0x2c')][_0xb814('0x33')](_0xb814('0x34'))){_0x1c2625[_0xb814('0x1e')]=qs['limit'](_0x392222[_0xb814('0x2c')][_0xb814('0x1e')]);_0x1c2625[_0xb814('0x1d')]=qs[_0xb814('0x1d')](_0x392222[_0xb814('0x2c')]['offset']);}_0x1c2625[_0xb814('0x35')]=qs['sort'](_0x392222[_0xb814('0x2c')][_0xb814('0x36')]);_0x1c2625[_0xb814('0x37')]=qs['filters'](_[_0xb814('0x38')](_0x392222[_0xb814('0x2c')],_0x349394['filters']));if(_0x328a08[_0xb814('0x2b')]){if(_0x328a08[_0xb814('0x2d')]){_0x328a08[_0xb814('0x2d')]=moment(_0x328a08[_0xb814('0x2d')])[_0xb814('0x39')](0x1,_0xb814('0x3a'));}else{_0x328a08['dateEnd']=moment(_0x328a08[_0xb814('0x2b')])['add'](0x1,_0xb814('0x3a'));}_['merge'](_0x1c2625[_0xb814('0x37')],{'createdAt':{'$gte':_0x328a08['dateStart'],'$lte':_0x328a08[_0xb814('0x2d')]}});}if(_0x392222[_0xb814('0x2c')]['filter']){_0x1c2625['where']=_['merge'](_0x1c2625['where'],{'$or':_[_0xb814('0x3b')](_0x1c2625[_0xb814('0x2f')],function(_0x38cdc2){var _0x42c2ed={};_0x42c2ed[_0x38cdc2]={'$like':'%'+_0x392222['query']['filter']+'%'};return _0x42c2ed;})});}_0x1c2625=_[_0xb814('0x3c')]({},_0x1c2625,_0x392222['options']);var _0x2a93da={'where':_0x1c2625[_0xb814('0x37')]};return db[_0xb814('0x28')][_0xb814('0x1c')](_0x2a93da)[_0xb814('0x22')](function(_0x37369f){_0x32ed56[_0xb814('0x1c')]=_0x37369f;if(_0x392222[_0xb814('0x2c')][_0xb814('0x3d')]){_0x1c2625['include']=[{'all':!![]}];}return db['VoiceTransferReport']['findAll'](_0x1c2625);})[_0xb814('0x22')](function(_0x5ba0bc){_0x32ed56[_0xb814('0x3e')]=_0x5ba0bc;return _0x32ed56;})['then'](respondWithFilteredResult(_0xc0ef66,_0x1c2625))[_0xb814('0x3f')](handleError(_0xc0ef66,null));};exports[_0xb814('0x40')]=function(_0x9ef639,_0x2e97cc){var _0x4fae23={'raw':!![],'where':{'id':_0x9ef639[_0xb814('0x41')]['id']}},_0x30fc57={};_0x30fc57[_0xb814('0x2e')]=_[_0xb814('0x2a')](db[_0xb814('0x28')][_0xb814('0x29')]);_0x30fc57['query']=_[_0xb814('0x2a')](_0x9ef639[_0xb814('0x2c')]);_0x30fc57[_0xb814('0x42')]=_[_0xb814('0x30')](_0x30fc57[_0xb814('0x2e')],_0x30fc57[_0xb814('0x2c')]);_0x4fae23[_0xb814('0x2f')]=_['intersection'](_0x30fc57['model'],qs[_0xb814('0x31')](_0x9ef639[_0xb814('0x2c')][_0xb814('0x31')]));_0x4fae23[_0xb814('0x2f')]=_0x4fae23[_0xb814('0x2f')][_0xb814('0x32')]?_0x4fae23[_0xb814('0x2f')]:_0x30fc57[_0xb814('0x2e')];if(_0x9ef639[_0xb814('0x2c')][_0xb814('0x3d')]){_0x4fae23[_0xb814('0x43')]=[{'all':!![]}];}_0x4fae23=_['merge']({},_0x4fae23,_0x9ef639[_0xb814('0x44')]);return db[_0xb814('0x28')]['find'](_0x4fae23)[_0xb814('0x22')](handleEntityNotFound(_0x2e97cc,null))['then'](respondWithResult(_0x2e97cc,null))[_0xb814('0x3f')](handleError(_0x2e97cc,null));};exports[_0xb814('0x45')]=function(_0xc71270,_0x22b2ef){return db[_0xb814('0x28')][_0xb814('0x45')](_0xc71270[_0xb814('0x46')],{})[_0xb814('0x22')](respondWithResult(_0x22b2ef,0xc9))[_0xb814('0x3f')](handleError(_0x22b2ef,null));};exports[_0xb814('0x21')]=function(_0x5e6df7,_0x4d4a7e){if(_0x5e6df7[_0xb814('0x46')]['id']){delete _0x5e6df7[_0xb814('0x46')]['id'];}return db[_0xb814('0x28')][_0xb814('0x47')]({'where':{'id':_0x5e6df7[_0xb814('0x41')]['id']}})[_0xb814('0x22')](handleEntityNotFound(_0x4d4a7e,null))[_0xb814('0x22')](saveUpdates(_0x5e6df7['body'],null))[_0xb814('0x22')](respondWithResult(_0x4d4a7e,null))[_0xb814('0x3f')](handleError(_0x4d4a7e,null));};exports[_0xb814('0x23')]=function(_0x5a916d,_0x3a5556){return db['VoiceTransferReport'][_0xb814('0x47')]({'where':{'id':_0x5a916d['params']['id']}})[_0xb814('0x22')](handleEntityNotFound(_0x3a5556,null))[_0xb814('0x22')](removeEntity(_0x3a5556,null))['catch'](handleError(_0x3a5556,null));};
\ No newline at end of file
index 5c6a51e..3db490f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78f4=['VoiceTransferReport','report_call_transfer','lodash','util','api','moment','bluebird','request-promise','exports','define'];(function(_0x31f7b8,_0x23ada5){var _0x3dd40b=function(_0x4d0499){while(--_0x4d0499){_0x31f7b8['push'](_0x31f7b8['shift']());}};_0x3dd40b(++_0x23ada5);}(_0x78f4,0x7a));var _0x478f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78f4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x478f('0x0'));var util=require(_0x478f('0x1'));var logger=require('../../config/logger')(_0x478f('0x2'));var moment=require(_0x478f('0x3'));var BPromise=require(_0x478f('0x4'));var rp=require(_0x478f('0x5'));var attributes=require('./voiceTransferReport.attributes');module[_0x478f('0x6')]=function(_0x58419c,_0x63d912){return _0x58419c[_0x478f('0x7')](_0x478f('0x8'),attributes,{'tableName':_0x478f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeb2a=['bluebird','request-promise','./voiceTransferReport.attributes','exports','define','report_call_transfer','util','../../config/logger','api','moment'];(function(_0x11647a,_0x7abb6c){var _0x30633e=function(_0x1c4b90){while(--_0x1c4b90){_0x11647a['push'](_0x11647a['shift']());}};_0x30633e(++_0x7abb6c);}(_0xeb2a,0x178));var _0xaeb2=function(_0x4f9b25,_0x2170c4){_0x4f9b25=_0x4f9b25-0x0;var _0x2e22ff=_0xeb2a[_0x4f9b25];return _0x2e22ff;};'use strict';var _=require('lodash');var util=require(_0xaeb2('0x0'));var logger=require(_0xaeb2('0x1'))(_0xaeb2('0x2'));var moment=require(_0xaeb2('0x3'));var BPromise=require(_0xaeb2('0x4'));var rp=require(_0xaeb2('0x5'));var attributes=require(_0xaeb2('0x6'));module[_0xaeb2('0x7')]=function(_0x213047,_0x10163b){return _0x213047[_0xaeb2('0x8')]('VoiceTransferReport',attributes,{'tableName':_0xaeb2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ffd3f41..f2c13e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6de0=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','debug','stringify','lodash','util'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x6de0,0x8a));var _0x06de=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x6de0[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0x06de('0x0'));var util=require(_0x06de('0x1'));var moment=require(_0x06de('0x2'));var BPromise=require(_0x06de('0x3'));var rs=require(_0x06de('0x4'));var fs=require('fs');var db=require(_0x06de('0x5'))['db'];var utils=require(_0x06de('0x6'));var logger=require(_0x06de('0x7'))(_0x06de('0x8'));var config=require(_0x06de('0x9'));var jayson=require(_0x06de('0xa'));var client=jayson[_0x06de('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c437f,_0x43f4b3,_0x4f1bc0){return new BPromise(function(_0x1541a2,_0x399bf1){return client[_0x06de('0xc')](_0x5c437f,_0x4f1bc0)[_0x06de('0xd')](function(_0x5b4141){logger[_0x06de('0xe')](_0x06de('0xf'),_0x43f4b3,_0x06de('0x10'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x43f4b3,'request\x20sent',JSON['stringify'](_0x5b4141));if(_0x5b4141[_0x06de('0x11')]){if(_0x5b4141['error']['code']===0x1f4){logger[_0x06de('0x11')](_0x06de('0xf'),_0x43f4b3,_0x5b4141[_0x06de('0x11')][_0x06de('0x12')]);return _0x399bf1(_0x5b4141['error'][_0x06de('0x12')]);}logger[_0x06de('0x11')](_0x06de('0xf'),_0x43f4b3,_0x5b4141[_0x06de('0x11')][_0x06de('0x12')]);return _0x1541a2(_0x5b4141['error'][_0x06de('0x12')]);}else{logger[_0x06de('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x43f4b3,_0x06de('0x10'));_0x1541a2(_0x5b4141[_0x06de('0x13')][_0x06de('0x12')]);}})[_0x06de('0x14')](function(_0x1161e7){logger[_0x06de('0x11')](_0x06de('0xf'),_0x43f4b3,_0x1161e7);_0x399bf1(_0x1161e7);});});}exports[_0x06de('0x15')]=function(_0x4537f7){var _0x33e746=this;return new Promise(function(_0x1ddb00,_0x16e7e9){return db[_0x06de('0x16')][_0x06de('0x17')](_0x4537f7[_0x06de('0x18')],{'raw':_0x4537f7[_0x06de('0x19')]?_0x4537f7[_0x06de('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x26352b){logger[_0x06de('0xe')](_0x06de('0x15'),_0x4537f7);logger[_0x06de('0x1a')](_0x06de('0x15'),_0x4537f7,JSON[_0x06de('0x1b')](_0x26352b));_0x1ddb00(_0x26352b);})[_0x06de('0x14')](function(_0x1d9228){logger[_0x06de('0x11')](_0x06de('0x15'),_0x1d9228[_0x06de('0x12')],_0x4537f7);_0x16e7e9(_0x33e746[_0x06de('0x11')](0x1f4,_0x1d9228['message']));});});};
\ No newline at end of file
+var _0xa449=['code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5c47de,_0x3373d0){var _0x4fd812=function(_0x5caf6f){while(--_0x5caf6f){_0x5c47de['push'](_0x5c47de['shift']());}};_0x4fd812(++_0x3373d0);}(_0xa449,0x1a0));var _0x9a44=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xa449[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x9a44('0x0'));var util=require(_0x9a44('0x1'));var moment=require(_0x9a44('0x2'));var BPromise=require(_0x9a44('0x3'));var rs=require(_0x9a44('0x4'));var fs=require('fs');var db=require(_0x9a44('0x5'))['db'];var utils=require(_0x9a44('0x6'));var logger=require(_0x9a44('0x7'))('rpc');var config=require(_0x9a44('0x8'));var jayson=require(_0x9a44('0x9'));var client=jayson[_0x9a44('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54de9c,_0x1ffcbc,_0x4cc7ab){return new BPromise(function(_0x1a8879,_0x429bd7){return client['request'](_0x54de9c,_0x4cc7ab)[_0x9a44('0xb')](function(_0x2b2062){logger[_0x9a44('0xc')](_0x9a44('0xd'),_0x1ffcbc,_0x9a44('0xe'));logger[_0x9a44('0xf')](_0x9a44('0x10'),_0x1ffcbc,_0x9a44('0xe'),JSON[_0x9a44('0x11')](_0x2b2062));if(_0x2b2062[_0x9a44('0x12')]){if(_0x2b2062[_0x9a44('0x12')][_0x9a44('0x13')]===0x1f4){logger[_0x9a44('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x1ffcbc,_0x2b2062['error'][_0x9a44('0x14')]);return _0x429bd7(_0x2b2062[_0x9a44('0x12')]['message']);}logger[_0x9a44('0x12')](_0x9a44('0xd'),_0x1ffcbc,_0x2b2062[_0x9a44('0x12')][_0x9a44('0x14')]);return _0x1a8879(_0x2b2062[_0x9a44('0x12')][_0x9a44('0x14')]);}else{logger[_0x9a44('0xc')](_0x9a44('0xd'),_0x1ffcbc,_0x9a44('0xe'));_0x1a8879(_0x2b2062[_0x9a44('0x15')][_0x9a44('0x14')]);}})[_0x9a44('0x16')](function(_0x15020d){logger[_0x9a44('0x12')](_0x9a44('0xd'),_0x1ffcbc,_0x15020d);_0x429bd7(_0x15020d);});});}exports[_0x9a44('0x17')]=function(_0x37da0e){var _0x3033cd=this;return new Promise(function(_0x192a8e,_0x385f53){return db[_0x9a44('0x18')][_0x9a44('0x19')](_0x37da0e[_0x9a44('0x1a')],{'raw':_0x37da0e[_0x9a44('0x1b')]?_0x37da0e[_0x9a44('0x1b')][_0x9a44('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x335dd5){logger['info'](_0x9a44('0x17'),_0x37da0e);logger[_0x9a44('0xf')](_0x9a44('0x17'),_0x37da0e,JSON[_0x9a44('0x11')](_0x335dd5));_0x192a8e(_0x335dd5);})['catch'](function(_0xd3282e){logger[_0x9a44('0x12')]('CreateVoiceTransferReport',_0xd3282e[_0x9a44('0x14')],_0x37da0e);_0x385f53(_0x3033cd[_0x9a44('0x12')](0x1f4,_0xd3282e[_0x9a44('0x14')]));});});};
\ No newline at end of file
index 80f0fe3..872be82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x739e=['./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','sync','then','info','start','Online\x20apps:','online','name','join','Offline\x20apps:','map','status','None','seedDB','./config/seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc'];(function(_0x6ab30c,_0x2c713b){var _0x36e953=function(_0x1aea9a){while(--_0x1aea9a){_0x6ab30c['push'](_0x6ab30c['shift']());}};_0x36e953(++_0x2c713b);}(_0x739e,0x193));var _0xe739=function(_0x63a96d,_0x200b67){_0x63a96d=_0x63a96d-0x0;var _0x4604b7=_0x739e[_0x63a96d];return _0x4604b7;};'use strict';var _=require(_0xe739('0x0'));var mysqldb=require(_0xe739('0x1'));var rpc=require(_0xe739('0x2'));var config=require(_0xe739('0x3'));var logger=require(_0xe739('0x4'))('app');var pm2=require(_0xe739('0x5'));var pm2Config=require(_0xe739('0x6'));var schedule=require(_0xe739('0x7'));var chat=require(_0xe739('0x8'));function main(){return mysqldb['db'][_0xe739('0x9')][_0xe739('0xa')]()[_0xe739('0xb')](function(){return rpc['listen']();})[_0xe739('0xb')](function(_0x52a3d2){logger[_0xe739('0xc')](_0x52a3d2);return chat[_0xe739('0xd')]();})[_0xe739('0xb')](function(){return schedule['start']();})[_0xe739('0xb')](function(_0x2fd90a){logger[_0xe739('0xc')](_0x2fd90a);return pm2[_0xe739('0xd')](pm2Config);})[_0xe739('0xb')](function(_0x551399){logger[_0xe739('0xc')](_0xe739('0xe'),_['map'](_['filter'](_0x551399,{'status':_0xe739('0xf')}),_0xe739('0x10'))[_0xe739('0x11')]());logger[_0xe739('0xc')](_0xe739('0x12'),_[_0xe739('0x13')](_['filter'](_0x551399,function(_0x438099){return _0x438099[_0xe739('0x14')]!==_0xe739('0xf');}),'name')[_0xe739('0x11')]()||_0xe739('0x15'));config[_0xe739('0x16')]&&require(_0xe739('0x17'))[_0xe739('0x18')]();require('./config/license')[_0xe739('0x18')]();})[_0xe739('0x19')](function(_0xd30408){logger[_0xe739('0x1a')](_0xe739('0x1b'),_0xd30408);process[_0xe739('0x1c')](0x1);});}main();
\ No newline at end of file
+var _0x9275=['./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','listen','then','info','start','Online\x20apps:','filter','online','name','join','Offline\x20apps:','status','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc'];(function(_0x244c93,_0x2d7307){var _0x10545b=function(_0x20526f){while(--_0x20526f){_0x244c93['push'](_0x244c93['shift']());}};_0x10545b(++_0x2d7307);}(_0x9275,0x183));var _0x5927=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0x9275[_0x5a636f];return _0x6a8cfb;};'use strict';var _=require(_0x5927('0x0'));var mysqldb=require(_0x5927('0x1'));var rpc=require(_0x5927('0x2'));var config=require(_0x5927('0x3'));var logger=require(_0x5927('0x4'))('app');var pm2=require(_0x5927('0x5'));var pm2Config=require(_0x5927('0x6'));var schedule=require(_0x5927('0x7'));var chat=require(_0x5927('0x8'));function main(){return mysqldb['db'][_0x5927('0x9')]['sync']()['then'](function(){return rpc[_0x5927('0xa')]();})[_0x5927('0xb')](function(_0x34e731){logger[_0x5927('0xc')](_0x34e731);return chat[_0x5927('0xd')]();})[_0x5927('0xb')](function(){return schedule[_0x5927('0xd')]();})[_0x5927('0xb')](function(_0x59bc71){logger[_0x5927('0xc')](_0x59bc71);return pm2[_0x5927('0xd')](pm2Config);})[_0x5927('0xb')](function(_0xfd8335){logger[_0x5927('0xc')](_0x5927('0xe'),_['map'](_[_0x5927('0xf')](_0xfd8335,{'status':_0x5927('0x10')}),_0x5927('0x11'))[_0x5927('0x12')]());logger['info'](_0x5927('0x13'),_['map'](_[_0x5927('0xf')](_0xfd8335,function(_0x19e3e6){return _0x19e3e6[_0x5927('0x14')]!==_0x5927('0x10');}),'name')[_0x5927('0x12')]()||_0x5927('0x15'));config[_0x5927('0x16')]&&require(_0x5927('0x17'))[_0x5927('0x18')]();require(_0x5927('0x19'))[_0x5927('0x18')]();})[_0x5927('0x1a')](function(_0x249c99){logger[_0x5927('0x1b')](_0x5927('0x1c'),_0x249c99);process[_0x5927('0x1d')](0x1);});}main();
\ No newline at end of file
index 2733774..72eadd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad15=['It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','motion.user','stringify','pick','redirect','../../mysqldb','../../config/environment','lodash','jsonwebtoken','express-jwt','ipaddr.js','secrets','session','internal','email','permissions','voicePause','chatPause','smsPause','pauseType','showWebBar','phoneBarRemoteControlPort','phoneBarRemoteControl','isChatInteractionAuthorized','user','findOne','params','closed','disposition','status','unmanaged','json','Unmanaged.','Forbidden.','use','headers','startsWith','Basic','find','then','authenticate','pass','Wrong\x20credentials.','authorization','Bearer','Unknown\x20authorization\x20format.','User','catch','User\x20object\x20not\x20found.','isAuthenticated','../../config/license/util','update','Forbidden','canUpdate','sign','signToken','hasRole','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','role','setTokenCookie'];(function(_0x2649e2,_0x3e73be){var _0x4797d4=function(_0xfa2d8b){while(--_0xfa2d8b){_0x2649e2['push'](_0x2649e2['shift']());}};_0x4797d4(++_0x3e73be);}(_0xad15,0x180));var _0x5ad1=function(_0x21f013,_0x3a2050){_0x21f013=_0x21f013-0x0;var _0x1addf8=_0xad15[_0x21f013];return _0x1addf8;};'use strict';var db=require(_0x5ad1('0x0'))['db'];var config=require(_0x5ad1('0x1'));var _=require(_0x5ad1('0x2'));var jwt=require(_0x5ad1('0x3'));var expressJwt=require(_0x5ad1('0x4'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var ipaddr=require(_0x5ad1('0x5'));var validateJwt=expressJwt({'secret':config[_0x5ad1('0x6')][_0x5ad1('0x7')]});var userAttributes=['id','role','fullname','name',_0x5ad1('0x8'),_0x5ad1('0x9'),'userpic',_0x5ad1('0xa'),_0x5ad1('0xb'),_0x5ad1('0xc'),'mailPause','faxPause',_0x5ad1('0xd'),'openchannelPause',_0x5ad1('0xe'),_0x5ad1('0xf'),_0x5ad1('0x10'),_0x5ad1('0x11')];exports[_0x5ad1('0x12')]=function(){return isAuthenticated(!![])['use'](function(_0x27cbff,_0xbbf1db,_0xf21846){if(_0x27cbff[_0x5ad1('0x13')]){_0xf21846();}else{return db['ChatInteraction'][_0x5ad1('0x14')]({'where':{'id':_0x27cbff[_0x5ad1('0x15')]['id']},'attributes':['id',_0x5ad1('0x16'),_0x5ad1('0x17')],'raw':!![]})['then'](function(_0x1bcf3a){if(_0x1bcf3a&&_0x1bcf3a['closed']){return _0xbbf1db[_0x5ad1('0x18')](_0x1bcf3a[_0x5ad1('0x17')]===_0x5ad1('0x19')?0x195:0x193)[_0x5ad1('0x1a')]({'message':_0x1bcf3a['disposition']===_0x5ad1('0x19')?_0x5ad1('0x1b'):_0x5ad1('0x1c')});}else{_0xf21846();}})['catch'](function(_0x4f5c75){_0xf21846(_0x4f5c75);});}});};function isAuthenticated(_0x145612){return compose()[_0x5ad1('0x1d')](function(_0x20d35d,_0x3792ca,_0xccb288){if(_0x20d35d[_0x5ad1('0x1e')]['authorization']){if(_[_0x5ad1('0x1f')](_0x20d35d['headers']['authorization'],_0x5ad1('0x20'))){var _0x4ec3b5=basicAuth(_0x20d35d);db['User'][_0x5ad1('0x21')]({'where':{'name':_0x4ec3b5['name']}})[_0x5ad1('0x22')](function(_0x4c7dec){if(!_0x4c7dec||!_0x4c7dec[_0x5ad1('0x23')](_0x4ec3b5[_0x5ad1('0x24')])){return _0x3792ca[_0x5ad1('0x18')](0x191)['json']({'message':_0x5ad1('0x25')});}_0x20d35d[_0x5ad1('0x13')]={'id':_0x4c7dec['id']};_0xccb288();})['catch'](function(_0x16022a){_0xccb288(_0x16022a);});}else if(_[_0x5ad1('0x1f')](_0x20d35d[_0x5ad1('0x1e')][_0x5ad1('0x26')],_0x5ad1('0x27'))){validateJwt(_0x20d35d,_0x3792ca,_0xccb288);}}else{if(_0x145612){_0xccb288();}else{return _0x3792ca[_0x5ad1('0x18')](0x191)[_0x5ad1('0x1a')]({'message':_0x5ad1('0x28')});}}})[_0x5ad1('0x1d')](function(_0x2b3225,_0xe6193f,_0x2ba3bc){if(_0x2b3225['user']){db[_0x5ad1('0x29')][_0x5ad1('0x21')]({'where':{'id':_0x2b3225[_0x5ad1('0x13')]['id']},'attributes':userAttributes})[_0x5ad1('0x22')](function(_0x5b3ed5){if(!_0x5b3ed5){return _0xe6193f[_0x5ad1('0x18')](0x194)[_0x5ad1('0x1a')]({'message':'User\x20not\x20found.'});}_0x2b3225[_0x5ad1('0x13')]=_0x5b3ed5;_0x2ba3bc();})[_0x5ad1('0x2a')](function(_0xfb7756){_0x2ba3bc(_0xfb7756);});}else if(_0x145612){_0x2ba3bc();}else{return _0xe6193f[_0x5ad1('0x18')](0x194)[_0x5ad1('0x1a')]({'message':_0x5ad1('0x2b')});}});}exports[_0x5ad1('0x2c')]=isAuthenticated;function canUpdate(){return compose()[_0x5ad1('0x1d')](function(_0x391832,_0x1c759e,_0x4bd1f0){return require(_0x5ad1('0x2d'))['getLicense']()[_0x5ad1('0x22')](function(_0x11dea3){if(_0x11dea3[_0x5ad1('0x2e')]){_0x4bd1f0();}else{return _0x1c759e['status'](0x193)[_0x5ad1('0x1a')]({'message':_0x5ad1('0x2f')});}})[_0x5ad1('0x2a')](function(_0x10aa8f){_0x4bd1f0(_0x10aa8f);});});}exports[_0x5ad1('0x30')]=canUpdate;function signToken(_0x167d29,_0x146e2c){return jwt[_0x5ad1('0x31')]({'id':_0x167d29,'role':_0x146e2c},config[_0x5ad1('0x6')][_0x5ad1('0x7')],{'expiresIn':0x15180});}exports[_0x5ad1('0x32')]=signToken;exports[_0x5ad1('0x33')]=function(_0xe80361){if(!_0xe80361){throw new Error(_0x5ad1('0x34'));}return compose()[_0x5ad1('0x1d')](isAuthenticated())[_0x5ad1('0x1d')](function meetsRequirements(_0x5546c9,_0x1d5e7b,_0x15da3a){if(config[_0x5ad1('0x35')][_0x5ad1('0x36')](_0x5546c9['user'][_0x5ad1('0x37')])>=config[_0x5ad1('0x35')][_0x5ad1('0x36')](_0xe80361)){return _0x15da3a();}else{return _0x1d5e7b['status'](0x193)[_0x5ad1('0x1a')]({'message':'Forbidden'});}});};exports[_0x5ad1('0x38')]=function(_0x289cca,_0x432298){if(!_0x289cca['user']){return _0x432298['status'](0x194)[_0x5ad1('0x1a')]({'message':_0x5ad1('0x39')});}var _0x45d0f2=signToken(_0x289cca[_0x5ad1('0x13')]['id'],_0x289cca['user'][_0x5ad1('0x37')]);_0x432298['cookie'](_0x5ad1('0x3a'),_0x45d0f2);_0x432298['cookie'](_0x5ad1('0x3b'),JSON[_0x5ad1('0x3c')](_[_0x5ad1('0x3d')](_0x289cca[_0x5ad1('0x13')],userAttributes)));_0x432298[_0x5ad1('0x3e')]('/dashboards/general');};
\ No newline at end of file
+var _0x26d7=['status','unmanaged','json','Unmanaged.','catch','authorization','startsWith','headers','Basic','User','authenticate','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format.','find','isAuthenticated','getLicense','update','Forbidden','canUpdate','signToken','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','pick','/dashboards/general','../../mysqldb','../../config/environment','lodash','express-jwt','composable-middleware','ipaddr.js','secrets','session','role','fullname','name','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','phoneBarRemoteControlPort','phoneBarRemoteControl','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','closed','disposition','then'];(function(_0x4581ee,_0x413d31){var _0x54af7d=function(_0x27a2eb){while(--_0x27a2eb){_0x4581ee['push'](_0x4581ee['shift']());}};_0x54af7d(++_0x413d31);}(_0x26d7,0x18b));var _0x726d=function(_0x204a12,_0x232489){_0x204a12=_0x204a12-0x0;var _0x3ca486=_0x26d7[_0x204a12];return _0x3ca486;};'use strict';var db=require(_0x726d('0x0'))['db'];var config=require(_0x726d('0x1'));var _=require(_0x726d('0x2'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x726d('0x3'));var compose=require(_0x726d('0x4'));var basicAuth=require('basic-auth');var ipaddr=require(_0x726d('0x5'));var validateJwt=expressJwt({'secret':config[_0x726d('0x6')][_0x726d('0x7')]});var userAttributes=['id',_0x726d('0x8'),_0x726d('0x9'),_0x726d('0xa'),'internal',_0x726d('0xb'),_0x726d('0xc'),_0x726d('0xd'),_0x726d('0xe'),_0x726d('0xf'),_0x726d('0x10'),_0x726d('0x11'),_0x726d('0x12'),_0x726d('0x13'),_0x726d('0x14'),_0x726d('0x15'),_0x726d('0x16'),_0x726d('0x17')];exports[_0x726d('0x18')]=function(){return isAuthenticated(!![])[_0x726d('0x19')](function(_0x2755ba,_0xa2b99e,_0x4a44b7){if(_0x2755ba[_0x726d('0x1a')]){_0x4a44b7();}else{return db[_0x726d('0x1b')][_0x726d('0x1c')]({'where':{'id':_0x2755ba['params']['id']},'attributes':['id',_0x726d('0x1d'),_0x726d('0x1e')],'raw':!![]})[_0x726d('0x1f')](function(_0x3556a5){if(_0x3556a5&&_0x3556a5['closed']){return _0xa2b99e[_0x726d('0x20')](_0x3556a5[_0x726d('0x1e')]===_0x726d('0x21')?0x195:0x193)[_0x726d('0x22')]({'message':_0x3556a5[_0x726d('0x1e')]===_0x726d('0x21')?_0x726d('0x23'):'Forbidden.'});}else{_0x4a44b7();}})[_0x726d('0x24')](function(_0x4c8420){_0x4a44b7(_0x4c8420);});}});};function isAuthenticated(_0x287998){return compose()[_0x726d('0x19')](function(_0x464933,_0x1cd9a7,_0x4c2be7){if(_0x464933['headers'][_0x726d('0x25')]){if(_[_0x726d('0x26')](_0x464933[_0x726d('0x27')][_0x726d('0x25')],_0x726d('0x28'))){var _0x5a508b=basicAuth(_0x464933);db[_0x726d('0x29')]['find']({'where':{'name':_0x5a508b[_0x726d('0xa')]}})[_0x726d('0x1f')](function(_0x10181a){if(!_0x10181a||!_0x10181a[_0x726d('0x2a')](_0x5a508b['pass'])){return _0x1cd9a7[_0x726d('0x20')](0x191)['json']({'message':_0x726d('0x2b')});}_0x464933[_0x726d('0x1a')]={'id':_0x10181a['id']};_0x4c2be7();})['catch'](function(_0x4211c6){_0x4c2be7(_0x4211c6);});}else if(_[_0x726d('0x26')](_0x464933[_0x726d('0x27')][_0x726d('0x25')],_0x726d('0x2c'))){validateJwt(_0x464933,_0x1cd9a7,_0x4c2be7);}}else{if(_0x287998){_0x4c2be7();}else{return _0x1cd9a7[_0x726d('0x20')](0x191)['json']({'message':_0x726d('0x2d')});}}})['use'](function(_0x9cb9ce,_0xf55b59,_0x308516){if(_0x9cb9ce[_0x726d('0x1a')]){db[_0x726d('0x29')][_0x726d('0x2e')]({'where':{'id':_0x9cb9ce[_0x726d('0x1a')]['id']},'attributes':userAttributes})[_0x726d('0x1f')](function(_0x4eea8b){if(!_0x4eea8b){return _0xf55b59[_0x726d('0x20')](0x194)[_0x726d('0x22')]({'message':'User\x20not\x20found.'});}_0x9cb9ce[_0x726d('0x1a')]=_0x4eea8b;_0x308516();})['catch'](function(_0x567e7c){_0x308516(_0x567e7c);});}else if(_0x287998){_0x308516();}else{return _0xf55b59[_0x726d('0x20')](0x194)[_0x726d('0x22')]({'message':'User\x20object\x20not\x20found.'});}});}exports[_0x726d('0x2f')]=isAuthenticated;function canUpdate(){return compose()[_0x726d('0x19')](function(_0x271992,_0x49bea5,_0x59add9){return require('../../config/license/util')[_0x726d('0x30')]()[_0x726d('0x1f')](function(_0x2b7f0c){if(_0x2b7f0c[_0x726d('0x31')]){_0x59add9();}else{return _0x49bea5[_0x726d('0x20')](0x193)[_0x726d('0x22')]({'message':_0x726d('0x32')});}})[_0x726d('0x24')](function(_0x169c61){_0x59add9(_0x169c61);});});}exports[_0x726d('0x33')]=canUpdate;function signToken(_0x321119,_0x39699a){return jwt['sign']({'id':_0x321119,'role':_0x39699a},config['secrets'][_0x726d('0x7')],{'expiresIn':0x15180});}exports[_0x726d('0x34')]=signToken;exports['hasRole']=function(_0xcaefe9){if(!_0xcaefe9){throw new Error(_0x726d('0x35'));}return compose()[_0x726d('0x19')](isAuthenticated())[_0x726d('0x19')](function meetsRequirements(_0x254dc1,_0x49df7f,_0x194eb6){if(config[_0x726d('0x36')][_0x726d('0x37')](_0x254dc1['user']['role'])>=config[_0x726d('0x36')]['indexOf'](_0xcaefe9)){return _0x194eb6();}else{return _0x49df7f[_0x726d('0x20')](0x193)[_0x726d('0x22')]({'message':_0x726d('0x32')});}});};exports[_0x726d('0x38')]=function(_0xe8b0f4,_0x3f7327){if(!_0xe8b0f4[_0x726d('0x1a')]){return _0x3f7327['status'](0x194)[_0x726d('0x22')]({'message':_0x726d('0x39')});}var _0x8c47e4=signToken(_0xe8b0f4[_0x726d('0x1a')]['id'],_0xe8b0f4[_0x726d('0x1a')][_0x726d('0x8')]);_0x3f7327[_0x726d('0x3a')]('motion.token',_0x8c47e4);_0x3f7327['cookie']('motion.user',JSON['stringify'](_[_0x726d('0x3b')](_0xe8b0f4[_0x726d('0x1a')],userAttributes)));_0x3f7327['redirect'](_0x726d('0x3c'));};
\ No newline at end of file
index 9888925..db5bb03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd91=['createCipher','algorithm','data','update','write','end','binary','close','createDecipher','final','unlink','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream'];(function(_0x377912,_0x2ff40c){var _0x2aa36c=function(_0x4b7b34){while(--_0x4b7b34){_0x377912['push'](_0x377912['shift']());}};_0x2aa36c(++_0x2ff40c);}(_0xdd91,0x161));var _0x1dd9=function(_0x27b88c,_0x323836){_0x27b88c=_0x27b88c-0x0;var _0x2e678f=_0xdd91[_0x27b88c];return _0x2e678f;};'use strict';var crypto=require(_0x1dd9('0x0'));var fs=require('fs');var BPromise=require(_0x1dd9('0x1'));var defaultOptions={'algorithm':_0x1dd9('0x2')};function combineOptions(_0x2d2dae){var _0x525b68={};for(var _0x23bcd7 in defaultOptions){if(defaultOptions[_0x1dd9('0x3')](_0x23bcd7)){_0x525b68[_0x23bcd7]=defaultOptions[_0x23bcd7];}}if(_0x2d2dae){for(var _0x2983bd in _0x2d2dae){if(_0x2d2dae[_0x1dd9('0x3')](_0x2983bd)){_0x525b68[_0x2983bd]=_0x2d2dae[_0x2983bd];}}}return _0x525b68;}exports[_0x1dd9('0x4')]=function(_0x37feae,_0x30c043,_0x3f9b7b,_0x509f3d){return new BPromise(function(_0xa6330d,_0x10893d){_0x509f3d=combineOptions(_0x509f3d);var _0x5e89c2=new Buffer(_0x3f9b7b);var _0x95cc38=fs[_0x1dd9('0x5')](_0x37feae);var _0x1b2a3c=fs[_0x1dd9('0x6')](_0x30c043);var _0x24dd8b=crypto[_0x1dd9('0x7')](_0x509f3d[_0x1dd9('0x8')],_0x5e89c2);_0x95cc38['on'](_0x1dd9('0x9'),function(_0x5dc162){var _0x138aff=new Buffer(_0x24dd8b[_0x1dd9('0xa')](_0x5dc162),'binary');_0x1b2a3c[_0x1dd9('0xb')](_0x138aff);});_0x95cc38['on'](_0x1dd9('0xc'),function(){try{var _0x245ffc=new Buffer(_0x24dd8b['final'](_0x1dd9('0xd')),_0x1dd9('0xd'));_0x1b2a3c[_0x1dd9('0xb')](_0x245ffc);_0x1b2a3c[_0x1dd9('0xc')]();_0x1b2a3c['on'](_0x1dd9('0xe'),function(){return _0xa6330d(_0x30c043);});}catch(_0x167fc5){fs['unlink'](_0x30c043);return _0x10893d(_0x167fc5);}});});};exports['decryptFile']=function(_0x545cf8,_0x445e85,_0x3dcaf5,_0x26018d){return new BPromise(function(_0x4ae17a,_0x467c87){_0x26018d=combineOptions(_0x26018d);var _0x34e829=new Buffer(_0x3dcaf5);var _0x12e082=fs[_0x1dd9('0x5')](_0x545cf8);var _0x23eb78=fs[_0x1dd9('0x6')](_0x445e85);var _0x47f7d5=crypto[_0x1dd9('0xf')](_0x26018d[_0x1dd9('0x8')],_0x34e829);_0x12e082['on'](_0x1dd9('0x9'),function(_0xe575d8){var _0x13b6da=new Buffer(_0x47f7d5[_0x1dd9('0xa')](_0xe575d8),_0x1dd9('0xd'));_0x23eb78[_0x1dd9('0xb')](_0x13b6da);});_0x12e082['on']('end',function(){try{var _0x5757f8=new Buffer(_0x47f7d5[_0x1dd9('0x10')](_0x1dd9('0xd')),_0x1dd9('0xd'));_0x23eb78[_0x1dd9('0xb')](_0x5757f8);_0x23eb78['end']();_0x23eb78['on'](_0x1dd9('0xe'),function(){return _0x4ae17a(_0x445e85);});}catch(_0x1e08c6){fs[_0x1dd9('0x11')](_0x445e85);return _0x467c87(_0x1e08c6);}});});};
\ No newline at end of file
+var _0x7aca=['update','end','crypto','aes192','hasOwnProperty','createWriteStream','createCipher','algorithm','binary','write','final','close','unlink','decryptFile'];(function(_0x51cca0,_0x5f1c69){var _0xf10777=function(_0x1b08d7){while(--_0x1b08d7){_0x51cca0['push'](_0x51cca0['shift']());}};_0xf10777(++_0x5f1c69);}(_0x7aca,0x16e));var _0xa7ac=function(_0x5207e4,_0x3c95ea){_0x5207e4=_0x5207e4-0x0;var _0x4f0ed6=_0x7aca[_0x5207e4];return _0x4f0ed6;};'use strict';var crypto=require(_0xa7ac('0x0'));var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0xa7ac('0x1')};function combineOptions(_0x1ff733){var _0x36b345={};for(var _0x1b7c02 in defaultOptions){if(defaultOptions[_0xa7ac('0x2')](_0x1b7c02)){_0x36b345[_0x1b7c02]=defaultOptions[_0x1b7c02];}}if(_0x1ff733){for(var _0x5c392c in _0x1ff733){if(_0x1ff733[_0xa7ac('0x2')](_0x5c392c)){_0x36b345[_0x5c392c]=_0x1ff733[_0x5c392c];}}}return _0x36b345;}exports['encryptFile']=function(_0x9ea5fe,_0x1b6c44,_0x13ee44,_0x4d33e0){return new BPromise(function(_0x4ce184,_0x3349ed){_0x4d33e0=combineOptions(_0x4d33e0);var _0x5f4775=new Buffer(_0x13ee44);var _0x1718d9=fs['createReadStream'](_0x9ea5fe);var _0x336417=fs[_0xa7ac('0x3')](_0x1b6c44);var _0x37f0d3=crypto[_0xa7ac('0x4')](_0x4d33e0[_0xa7ac('0x5')],_0x5f4775);_0x1718d9['on']('data',function(_0x285c04){var _0x4ea38=new Buffer(_0x37f0d3['update'](_0x285c04),_0xa7ac('0x6'));_0x336417[_0xa7ac('0x7')](_0x4ea38);});_0x1718d9['on']('end',function(){try{var _0x47657d=new Buffer(_0x37f0d3[_0xa7ac('0x8')](_0xa7ac('0x6')),'binary');_0x336417[_0xa7ac('0x7')](_0x47657d);_0x336417['end']();_0x336417['on'](_0xa7ac('0x9'),function(){return _0x4ce184(_0x1b6c44);});}catch(_0x1179cf){fs[_0xa7ac('0xa')](_0x1b6c44);return _0x3349ed(_0x1179cf);}});});};exports[_0xa7ac('0xb')]=function(_0x44ce0e,_0x410cb0,_0xedf866,_0x277e03){return new BPromise(function(_0x4a3389,_0x478273){_0x277e03=combineOptions(_0x277e03);var _0x1e4c43=new Buffer(_0xedf866);var _0x417fe4=fs['createReadStream'](_0x44ce0e);var _0x596fd4=fs[_0xa7ac('0x3')](_0x410cb0);var _0x223bd3=crypto['createDecipher'](_0x277e03['algorithm'],_0x1e4c43);_0x417fe4['on']('data',function(_0x14bf5f){var _0x3c2d7b=new Buffer(_0x223bd3[_0xa7ac('0xc')](_0x14bf5f),'binary');_0x596fd4[_0xa7ac('0x7')](_0x3c2d7b);});_0x417fe4['on']('end',function(){try{var _0x2bb19a=new Buffer(_0x223bd3[_0xa7ac('0x8')](_0xa7ac('0x6')),'binary');_0x596fd4[_0xa7ac('0x7')](_0x2bb19a);_0x596fd4[_0xa7ac('0xd')]();_0x596fd4['on'](_0xa7ac('0x9'),function(){return _0x4a3389(_0x410cb0);});}catch(_0x557bb3){fs[_0xa7ac('0xa')](_0x410cb0);return _0x478273(_0x557bb3);}});});};
\ No newline at end of file
index dc7ab57..be06770 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['SELECT','num','Empty','length','push','dirname','basename','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Completed','error','util','path','lodash','to-csv','bluebird','zip-dir','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','update','Setting','find','split','splitSizeCsv','then','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes'];(function(_0xc52898,_0x165722){var _0x1941d7=function(_0x3de672){while(--_0x3de672){_0xc52898['push'](_0xc52898['shift']());}};_0x1941d7(++_0x165722);}(_0x814b,0x1a2));var _0xb814=function(_0x39cad6,_0x1edf41){_0x39cad6=_0x39cad6-0x0;var _0x5a82f2=_0x814b[_0x39cad6];return _0x5a82f2;};'use strict';var util=require(_0xb814('0x0'));var path=require(_0xb814('0x1'));var _=require(_0xb814('0x2'));var csv=require(_0xb814('0x3'));var fs=require('fs');var BPromise=require(_0xb814('0x4'));var zipdir=require(_0xb814('0x5'));var rimraf=require('rimraf');var db=require(_0xb814('0x6'))['db'];var dbH=require(_0xb814('0x6'))[_0xb814('0x7')];var EXTRACTED_REPORT_ID=Number(process[_0xb814('0x8')][0x2]);var QUERY=process[_0xb814('0x8')][0x3];var PATH=process[_0xb814('0x8')][0x4];function analyticExtractedReport(_0x53e507,_0x3b0829){var _0x2e6272={'status':_0x53e507};var _0x5c8539={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3b0829){_0x2e6272[_0xb814('0x9')]=_0x3b0829;}return db[_0xb814('0xa')][_0xb814('0xb')](_0x2e6272,_0x5c8539);}function main(){var _0x41166c=0x1388;var _0x1fea33;return db[_0xb814('0xc')][_0xb814('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb814('0xe'),_0xb814('0xf')]})[_0xb814('0x10')](function(_0x10e4a6){if(_0x10e4a6){_0x1fea33=_0x10e4a6;_0x41166c=_0x1fea33['splitSizeCsv']||0x1388;}})[_0xb814('0x10')](function(){return dbH['sequelize'][_0xb814('0x11')](util[_0xb814('0x12')](_0xb814('0x13'),QUERY),{'type':dbH[_0xb814('0x14')][_0xb814('0x15')][_0xb814('0x16')]});})[_0xb814('0x10')](function(_0x41ed7b){if(!_0x41ed7b[0x0][_0xb814('0x17')]){return analyticExtractedReport(_0xb814('0x18'));}var _0x3f4881=[];var _0x44fb96=0x0;var _0x17f5bd=!![];if(_0x41ed7b&&_0x41ed7b[_0xb814('0x19')]){var _0x303aca=_0x41ed7b[0x0][_0xb814('0x17')]%(_0x44fb96+_0x41166c);if(_0x1fea33[_0xb814('0xe')]){for(;_0x17f5bd;_0x44fb96+=_0x41166c,_0x303aca=_0x41ed7b[0x0][_0xb814('0x17')]%(_0x44fb96+_0x41166c)){if(_0x303aca==0x0||_0x303aca==_0x41ed7b[0x0][_0xb814('0x17')]){_0x17f5bd=![];}_0x3f4881[_0xb814('0x1a')](dbH[_0xb814('0x14')]['query'](util[_0xb814('0x12')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x41166c,_0x44fb96),{'type':dbH[_0xb814('0x14')][_0xb814('0x15')]['SELECT']}));}}else{_0x3f4881['push'](dbH['sequelize'][_0xb814('0x11')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xb814('0x16')]}));}}var _0x24211d=path[_0xb814('0x1b')](PATH);var _0x4e139e=path[_0xb814('0x1c')](PATH,'.csv');var _0x1e6393=_0x1fea33[_0xb814('0xe')]&&_0x3f4881[_0xb814('0x19')]>0x1;var _0x470e81=[];if(!fs[_0xb814('0x1d')](path[_0xb814('0x1e')](_0x24211d,_0x4e139e))&&_0x1e6393){fs[_0xb814('0x1f')](path['join'](_0x24211d,_0x4e139e));}return BPromise[_0xb814('0x20')](_0x3f4881,function(_0x52b7a3){_0x470e81[_0xb814('0x1a')](_0x52b7a3);})[_0xb814('0x10')](function(){for(var _0x31c7ec=0x0;_0x31c7ec<_0x470e81[_0xb814('0x19')];_0x31c7ec+=0x1){var _0x1c8a2e;var _0xb9e57d=_0x470e81[_0x31c7ec];if(_0x1e6393){_0x1c8a2e=path[_0xb814('0x1e')](_0x24211d,_0x4e139e,util['format'](_0xb814('0x21'),_0x4e139e,_0x31c7ec,_0xb814('0x22')));}else{_0x1c8a2e=path[_0xb814('0x1e')](_0x24211d,util[_0xb814('0x12')](_0xb814('0x23'),_0x4e139e,_0xb814('0x22')));}fs[_0xb814('0x24')](_0x1c8a2e,csv(_0xb9e57d));}})[_0xb814('0x10')](function(){if(_0x1e6393){zipdir(path['join'](_0x24211d,_0x4e139e),{'saveTo':path[_0xb814('0x1e')](_0x24211d,util[_0xb814('0x12')]('%s.%s',_0x4e139e,_0xb814('0x25')))},function(_0x37d24d,_0x530744){});rimraf(path['join'](_0x24211d,_0x4e139e),function(){});}})[_0xb814('0x10')](function(){return analyticExtractedReport(_0xb814('0x26'),_0x1e6393?util['format'](_0xb814('0x23'),_0x4e139e,_0x1e6393?'zip':_0xb814('0x22')):null);});})['catch'](function(_0x4cfc58){console[_0xb814('0x27')](_0x4cfc58);return analyticExtractedReport('Error');});}main();
\ No newline at end of file
+var _0x7a54=['zip-dir','../../mysqldb','dbH','argv','AnalyticExtractedReport','Setting','find','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','split','QueryTypes','push','dirname','.csv','existsSync','join','mkdirSync','each','length','%s%d.%s','%s.%s','csv','writeFileSync','zip','catch','error','Error','util','path','lodash','bluebird'];(function(_0x23420f,_0x5a1b53){var _0x240536=function(_0x2b7c96){while(--_0x2b7c96){_0x23420f['push'](_0x23420f['shift']());}};_0x240536(++_0x5a1b53);}(_0x7a54,0x106));var _0x47a5=function(_0x3e8277,_0x56b854){_0x3e8277=_0x3e8277-0x0;var _0x9aec92=_0x7a54[_0x3e8277];return _0x9aec92;};'use strict';var util=require(_0x47a5('0x0'));var path=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x47a5('0x3'));var zipdir=require(_0x47a5('0x4'));var rimraf=require('rimraf');var db=require(_0x47a5('0x5'))['db'];var dbH=require(_0x47a5('0x5'))[_0x47a5('0x6')];var EXTRACTED_REPORT_ID=Number(process[_0x47a5('0x7')][0x2]);var QUERY=process[_0x47a5('0x7')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x3d5629,_0x59199c){var _0x343372={'status':_0x3d5629};var _0x30e405={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x59199c){_0x343372['savename']=_0x59199c;}return db[_0x47a5('0x8')]['update'](_0x343372,_0x30e405);}function main(){var _0x5d90b3=0x1388;var _0x582352;return db[_0x47a5('0x9')][_0x47a5('0xa')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x47a5('0xb')]})['then'](function(_0x5de6d7){if(_0x5de6d7){_0x582352=_0x5de6d7;_0x5d90b3=_0x582352[_0x47a5('0xb')]||0x1388;}})[_0x47a5('0xc')](function(){return dbH[_0x47a5('0xd')][_0x47a5('0xe')](util[_0x47a5('0xf')](_0x47a5('0x10'),QUERY),{'type':dbH[_0x47a5('0xd')]['QueryTypes'][_0x47a5('0x11')]});})[_0x47a5('0xc')](function(_0x1cf309){if(!_0x1cf309[0x0][_0x47a5('0x12')]){return analyticExtractedReport(_0x47a5('0x13'));}var _0x620ee9=[];var _0x3c6c46=0x0;var _0x190faa=!![];if(_0x1cf309&&_0x1cf309['length']){var _0x362359=_0x1cf309[0x0][_0x47a5('0x12')]%(_0x3c6c46+_0x5d90b3);if(_0x582352[_0x47a5('0x14')]){for(;_0x190faa;_0x3c6c46+=_0x5d90b3,_0x362359=_0x1cf309[0x0][_0x47a5('0x12')]%(_0x3c6c46+_0x5d90b3)){if(_0x362359==0x0||_0x362359==_0x1cf309[0x0][_0x47a5('0x12')]){_0x190faa=![];}_0x620ee9['push'](dbH['sequelize'][_0x47a5('0xe')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5d90b3,_0x3c6c46),{'type':dbH[_0x47a5('0xd')][_0x47a5('0x15')][_0x47a5('0x11')]}));}}else{_0x620ee9[_0x47a5('0x16')](dbH[_0x47a5('0xd')][_0x47a5('0xe')](QUERY,{'type':dbH[_0x47a5('0xd')][_0x47a5('0x15')][_0x47a5('0x11')]}));}}var _0x4a9fcb=path[_0x47a5('0x17')](PATH);var _0xf160ba=path['basename'](PATH,_0x47a5('0x18'));var _0x1f03f7=_0x582352[_0x47a5('0x14')]&&_0x620ee9['length']>0x1;var _0xb8ae6c=[];if(!fs[_0x47a5('0x19')](path[_0x47a5('0x1a')](_0x4a9fcb,_0xf160ba))&&_0x1f03f7){fs[_0x47a5('0x1b')](path['join'](_0x4a9fcb,_0xf160ba));}return BPromise[_0x47a5('0x1c')](_0x620ee9,function(_0x385687){_0xb8ae6c['push'](_0x385687);})[_0x47a5('0xc')](function(){for(var _0xc4cd63=0x0;_0xc4cd63<_0xb8ae6c[_0x47a5('0x1d')];_0xc4cd63+=0x1){var _0x129ce5;var _0x3abd6a=_0xb8ae6c[_0xc4cd63];if(_0x1f03f7){_0x129ce5=path['join'](_0x4a9fcb,_0xf160ba,util['format'](_0x47a5('0x1e'),_0xf160ba,_0xc4cd63,'csv'));}else{_0x129ce5=path[_0x47a5('0x1a')](_0x4a9fcb,util['format'](_0x47a5('0x1f'),_0xf160ba,_0x47a5('0x20')));}fs[_0x47a5('0x21')](_0x129ce5,csv(_0x3abd6a));}})[_0x47a5('0xc')](function(){if(_0x1f03f7){zipdir(path[_0x47a5('0x1a')](_0x4a9fcb,_0xf160ba),{'saveTo':path[_0x47a5('0x1a')](_0x4a9fcb,util[_0x47a5('0xf')](_0x47a5('0x1f'),_0xf160ba,_0x47a5('0x22')))},function(_0x361bfa,_0x1127f8){});rimraf(path[_0x47a5('0x1a')](_0x4a9fcb,_0xf160ba),function(){});}})[_0x47a5('0xc')](function(){return analyticExtractedReport('Completed',_0x1f03f7?util[_0x47a5('0xf')]('%s.%s',_0xf160ba,_0x1f03f7?_0x47a5('0x22'):_0x47a5('0x20')):null);});})[_0x47a5('0x23')](function(_0x4d6b57){console[_0x47a5('0x24')](_0x4d6b57);return analyticExtractedReport(_0x47a5('0x25'));});}main();
\ No newline at end of file
index 4184584..df7451f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64c4=['length','format','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','query','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','landscape','header','black','body','hasOwnProperty','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','%s.%s','finish','error','err','end','zip','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','lodash','bluebird','util','path','moment','pdfmake/src/printer','zip-dir','../../mysqldb','dbH','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','push','num','Empty','.pdf','Setting','find','split','splitSizePdf','then'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x64c4,0x11b));var _0x464c=function(_0x549f13,_0x35dd2d){_0x549f13=_0x549f13-0x0;var _0x5d5e61=_0x64c4[_0x549f13];return _0x5d5e61;};'use strict';var _=require(_0x464c('0x0'));var fs=require('fs');var BPromise=require(_0x464c('0x1'));var util=require(_0x464c('0x2'));var path=require(_0x464c('0x3'));var moment=require(_0x464c('0x4'));var PdfPrinter=require(_0x464c('0x5'));var zipdir=require(_0x464c('0x6'));var rimraf=require('rimraf');var db=require(_0x464c('0x7'))['db'];var dbH=require(_0x464c('0x7'))[_0x464c('0x8')];var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x464c('0x9')][0x4];var NAME=process[_0x464c('0x9')][0x5];var FORMAT=_0x464c('0xa');var _extractedReport;function analyticExtractedReport(_0x126758,_0x1100b0){var _0x49f849={'status':_0x126758};var _0x148377={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1100b0){_0x49f849[_0x464c('0xb')]=_0x1100b0;}return db['AnalyticExtractedReport'][_0x464c('0xc')](_0x49f849,_0x148377);}function getHeader(_0x37da60){var _0x1cfc66=[];for(var _0x4f8d5c in _0x37da60){if(_0x37da60['hasOwnProperty'](_0x4f8d5c)){_0x1cfc66[_0x464c('0xd')]({'text':_0x4f8d5c,'style':'tableHeader'});}}return _0x1cfc66;}function extractReport(_0x41ca89){var _0x498622=0x1388;var _0x32533f;if(!_0x41ca89[0x0][_0x464c('0xe')]){return analyticExtractedReport(_0x464c('0xf'));}var _0x55b5de=[];var _0x52760c=0x0;var _0x75d10a=!![];var _0x224586=path['dirname'](PATH);var _0xc84fb7=path['basename'](PATH,_0x464c('0x10'));var _0x49ce5d=![];var _0x1a09d0=[];return db[_0x464c('0x11')][_0x464c('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x464c('0x13'),_0x464c('0x14')]})[_0x464c('0x15')](function(_0x4ff3e0){if(_0x4ff3e0){_0x32533f=_0x4ff3e0;_0x498622=_0x32533f[_0x464c('0x14')]||0x3e8;}})[_0x464c('0x15')](function(){if(_0x41ca89&&_0x41ca89[_0x464c('0x16')]){var _0x2162d3=_0x41ca89[0x0][_0x464c('0xe')]%(_0x52760c+_0x498622);if(_0x32533f[_0x464c('0x13')]){for(;_0x75d10a;_0x52760c+=_0x498622,_0x2162d3=_0x41ca89[0x0][_0x464c('0xe')]%(_0x52760c+_0x498622)){if(_0x2162d3==0x0||_0x2162d3==_0x41ca89[0x0]['num']){_0x75d10a=![];}_0x55b5de[_0x464c('0xd')](dbH['sequelize']['query'](util[_0x464c('0x17')](_0x464c('0x18'),QUERY,_0x498622,_0x52760c),{'type':dbH[_0x464c('0x19')][_0x464c('0x1a')][_0x464c('0x1b')]}));}}else{_0x55b5de[_0x464c('0xd')](dbH['sequelize'][_0x464c('0x1c')](QUERY,{'type':dbH['sequelize'][_0x464c('0x1a')][_0x464c('0x1b')]}));}}_0x49ce5d=_0x32533f[_0x464c('0x13')]&&_0x55b5de[_0x464c('0x16')]>0x1;if(!fs[_0x464c('0x1d')](path[_0x464c('0x1e')](_0x224586,_0xc84fb7))&&_0x49ce5d){fs[_0x464c('0x1f')](path[_0x464c('0x1e')](_0x224586,_0xc84fb7));}return BPromise[_0x464c('0x20')](_0x55b5de,function(_0x1158eb){_0x1a09d0[_0x464c('0xd')](_0x1158eb);});})[_0x464c('0x15')](function(){return BPromise[_0x464c('0x20')](_0x55b5de,function(_0x53cb6f,_0x4571ad){var _0x5c8dd8;var _0x13b70a=util[_0x464c('0x17')](_0x464c('0x21'),NAME,_extractedReport[_0x464c('0x22')],moment(_extractedReport[_0x464c('0x23')])[_0x464c('0x17')](FORMAT),moment(_extractedReport[_0x464c('0x24')])[_0x464c('0x17')](FORMAT));var _0x1468bd={'pageSize':'A4','pageOrientation':_0x464c('0x25'),'content':[{'text':_0x13b70a,'style':_0x464c('0x26')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x464c('0x27')}}};var _0x26689e={'headerRows':0x1,'body':[]};_0x26689e[_0x464c('0x28')][_0x464c('0xd')](getHeader(_0x53cb6f[0x0]));var _0x234da8;for(var _0x5a3dbf=0x0;_0x5a3dbf<_0x53cb6f[_0x464c('0x16')];_0x5a3dbf+=0x1){_0x234da8=[];for(var _0x49e6a8 in _0x53cb6f[_0x5a3dbf]){if(_0x53cb6f[_0x5a3dbf][_0x464c('0x29')](_0x49e6a8)){_0x234da8['push'](_0x53cb6f[_0x5a3dbf][_0x49e6a8]?_[_0x464c('0x2a')](_0x53cb6f[_0x5a3dbf][_0x49e6a8]):'');}}_0x26689e['body'][_0x464c('0xd')](_0x234da8);}_0x1468bd[_0x464c('0x2b')][_0x464c('0xd')]({'table':_0x26689e});return new BPromise(function(_0x5416af,_0x2fce62){var _0x3b693e=new PdfPrinter({'Roboto':{'normal':__dirname+_0x464c('0x2c'),'bold':__dirname+_0x464c('0x2d'),'italics':__dirname+_0x464c('0x2e'),'bolditalics':__dirname+_0x464c('0x2f')}});var _0x3ee5e5=_0x3b693e[_0x464c('0x30')](_0x1468bd);if(_0x49ce5d){_0x5c8dd8=path[_0x464c('0x1e')](_0x224586,_0xc84fb7,util[_0x464c('0x17')](_0x464c('0x31'),_0xc84fb7,_0x4571ad,_0x464c('0x32')));}else{_0x5c8dd8=path[_0x464c('0x1e')](_0x224586,util['format'](_0x464c('0x33'),_0xc84fb7,_0x464c('0x32')));}var _0x165cc5=_0x3ee5e5['pipe'](fs['createWriteStream'](_0x5c8dd8));_0x165cc5['on'](_0x464c('0x34'),function(){_0x5416af();});_0x165cc5['on'](_0x464c('0x35'),function(_0x472e0c){console['log'](_0x464c('0x36'),_0x472e0c);_0x2fce62(_0x472e0c);});_0x3ee5e5[_0x464c('0x37')]();});});})['then'](function(){if(_0x49ce5d){return new BPromise(function(_0x39d76a,_0x56d7af){zipdir(path[_0x464c('0x1e')](_0x224586,_0xc84fb7),{'saveTo':path[_0x464c('0x1e')](_0x224586,util[_0x464c('0x17')](_0x464c('0x33'),_0xc84fb7,_0x464c('0x38')))},function(_0x2ad132){if(_0x2ad132){_0x56d7af(_0x2ad132);}else{_0x39d76a();}});});}})[_0x464c('0x15')](function(){if(_0x49ce5d){rimraf(path[_0x464c('0x1e')](_0x224586,_0xc84fb7),function(){});}})['then'](function(){return analyticExtractedReport('Completed',_0x49ce5d?util['format'](_0x464c('0x33'),_0xc84fb7,_0x49ce5d?_0x464c('0x38'):_0x464c('0x32')):null);});}function main(){return db[_0x464c('0x39')][_0x464c('0x3a')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x24f572){_extractedReport=_0x24f572;return dbH['sequelize'][_0x464c('0x1c')](util[_0x464c('0x17')](_0x464c('0x3b'),QUERY),{'type':dbH[_0x464c('0x19')][_0x464c('0x1a')]['SELECT']});})[_0x464c('0x15')](extractReport)[_0x464c('0x3c')](function(_0xb8a7a){console[_0x464c('0x35')](_0xb8a7a);return analyticExtractedReport('Error');});}main();
\ No newline at end of file
+var _0x044c=['rimraf','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','hasOwnProperty','push','tableHeader','num','Empty','dirname','basename','.pdf','Setting','split','then','length','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','black','body','toString','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','pdf','%s.%s','pipe','createWriteStream','finish','error','err','end','zip','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error','lodash','bluebird','util','path','moment','pdfmake/src/printer','zip-dir'];(function(_0x2d05fa,_0x372364){var _0x10ae61=function(_0x17c8e3){while(--_0x17c8e3){_0x2d05fa['push'](_0x2d05fa['shift']());}};_0x10ae61(++_0x372364);}(_0x044c,0x1d1));var _0xc044=function(_0x310ad7,_0x1f8c6c){_0x310ad7=_0x310ad7-0x0;var _0x41a2c6=_0x044c[_0x310ad7];return _0x41a2c6;};'use strict';var _=require(_0xc044('0x0'));var fs=require('fs');var BPromise=require(_0xc044('0x1'));var util=require(_0xc044('0x2'));var path=require(_0xc044('0x3'));var moment=require(_0xc044('0x4'));var PdfPrinter=require(_0xc044('0x5'));var zipdir=require(_0xc044('0x6'));var rimraf=require(_0xc044('0x7'));var db=require(_0xc044('0x8'))['db'];var dbH=require(_0xc044('0x8'))[_0xc044('0x9')];var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xc044('0xa')][0x3];var PATH=process[_0xc044('0xa')][0x4];var NAME=process[_0xc044('0xa')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var _extractedReport;function analyticExtractedReport(_0x2c2613,_0x1179b7){var _0x1c5169={'status':_0x2c2613};var _0x3ecf7a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1179b7){_0x1c5169[_0xc044('0xb')]=_0x1179b7;}return db[_0xc044('0xc')]['update'](_0x1c5169,_0x3ecf7a);}function getHeader(_0x5c166b){var _0x2b2893=[];for(var _0x1beda5 in _0x5c166b){if(_0x5c166b[_0xc044('0xd')](_0x1beda5)){_0x2b2893[_0xc044('0xe')]({'text':_0x1beda5,'style':_0xc044('0xf')});}}return _0x2b2893;}function extractReport(_0x4c7b52){var _0x4a500e=0x1388;var _0x37c204;if(!_0x4c7b52[0x0][_0xc044('0x10')]){return analyticExtractedReport(_0xc044('0x11'));}var _0x1ad3ad=[];var _0x1f3924=0x0;var _0x50c326=!![];var _0x375c82=path[_0xc044('0x12')](PATH);var _0x1398d6=path[_0xc044('0x13')](PATH,_0xc044('0x14'));var _0x13efd8=![];var _0x1ccc5c=[];return db[_0xc044('0x15')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc044('0x16'),'splitSizePdf']})['then'](function(_0x590bc4){if(_0x590bc4){_0x37c204=_0x590bc4;_0x4a500e=_0x37c204['splitSizePdf']||0x3e8;}})[_0xc044('0x17')](function(){if(_0x4c7b52&&_0x4c7b52[_0xc044('0x18')]){var _0xdb3663=_0x4c7b52[0x0]['num']%(_0x1f3924+_0x4a500e);if(_0x37c204[_0xc044('0x16')]){for(;_0x50c326;_0x1f3924+=_0x4a500e,_0xdb3663=_0x4c7b52[0x0][_0xc044('0x10')]%(_0x1f3924+_0x4a500e)){if(_0xdb3663==0x0||_0xdb3663==_0x4c7b52[0x0]['num']){_0x50c326=![];}_0x1ad3ad[_0xc044('0xe')](dbH[_0xc044('0x19')][_0xc044('0x1a')](util[_0xc044('0x1b')](_0xc044('0x1c'),QUERY,_0x4a500e,_0x1f3924),{'type':dbH[_0xc044('0x19')][_0xc044('0x1d')][_0xc044('0x1e')]}));}}else{_0x1ad3ad[_0xc044('0xe')](dbH[_0xc044('0x19')]['query'](QUERY,{'type':dbH[_0xc044('0x19')][_0xc044('0x1d')][_0xc044('0x1e')]}));}}_0x13efd8=_0x37c204['split']&&_0x1ad3ad[_0xc044('0x18')]>0x1;if(!fs[_0xc044('0x1f')](path['join'](_0x375c82,_0x1398d6))&&_0x13efd8){fs['mkdirSync'](path[_0xc044('0x20')](_0x375c82,_0x1398d6));}return BPromise['each'](_0x1ad3ad,function(_0x4f11cb){_0x1ccc5c[_0xc044('0xe')](_0x4f11cb);});})[_0xc044('0x17')](function(){return BPromise[_0xc044('0x21')](_0x1ad3ad,function(_0x249d67,_0x57f199){var _0x95767a;var _0x3a980b=util[_0xc044('0x1b')](_0xc044('0x22'),NAME,_extractedReport['name'],moment(_extractedReport[_0xc044('0x23')])['format'](FORMAT),moment(_extractedReport[_0xc044('0x24')])[_0xc044('0x1b')](FORMAT));var _0x5b25d7={'pageSize':'A4','pageOrientation':'landscape','content':[{'text':_0x3a980b,'style':_0xc044('0x25')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xc044('0x26')}}};var _0xed75fb={'headerRows':0x1,'body':[]};_0xed75fb[_0xc044('0x27')][_0xc044('0xe')](getHeader(_0x249d67[0x0]));var _0xb2c48b;for(var _0x3fd79b=0x0;_0x3fd79b<_0x249d67[_0xc044('0x18')];_0x3fd79b+=0x1){_0xb2c48b=[];for(var _0x396a8b in _0x249d67[_0x3fd79b]){if(_0x249d67[_0x3fd79b][_0xc044('0xd')](_0x396a8b)){_0xb2c48b[_0xc044('0xe')](_0x249d67[_0x3fd79b][_0x396a8b]?_[_0xc044('0x28')](_0x249d67[_0x3fd79b][_0x396a8b]):'');}}_0xed75fb[_0xc044('0x27')][_0xc044('0xe')](_0xb2c48b);}_0x5b25d7['content'][_0xc044('0xe')]({'table':_0xed75fb});return new BPromise(function(_0xa93b72,_0x5953ac){var _0x3477ca=new PdfPrinter({'Roboto':{'normal':__dirname+_0xc044('0x29'),'bold':__dirname+_0xc044('0x2a'),'italics':__dirname+_0xc044('0x2b'),'bolditalics':__dirname+_0xc044('0x2c')}});var _0x5a8c71=_0x3477ca[_0xc044('0x2d')](_0x5b25d7);if(_0x13efd8){_0x95767a=path[_0xc044('0x20')](_0x375c82,_0x1398d6,util[_0xc044('0x1b')]('%s%d.%s',_0x1398d6,_0x57f199,_0xc044('0x2e')));}else{_0x95767a=path[_0xc044('0x20')](_0x375c82,util['format'](_0xc044('0x2f'),_0x1398d6,_0xc044('0x2e')));}var _0x19d59e=_0x5a8c71[_0xc044('0x30')](fs[_0xc044('0x31')](_0x95767a));_0x19d59e['on'](_0xc044('0x32'),function(){_0xa93b72();});_0x19d59e['on'](_0xc044('0x33'),function(_0x1df1e2){console['log'](_0xc044('0x34'),_0x1df1e2);_0x5953ac(_0x1df1e2);});_0x5a8c71[_0xc044('0x35')]();});});})[_0xc044('0x17')](function(){if(_0x13efd8){return new BPromise(function(_0x21be20,_0x2ea3b9){zipdir(path[_0xc044('0x20')](_0x375c82,_0x1398d6),{'saveTo':path[_0xc044('0x20')](_0x375c82,util[_0xc044('0x1b')](_0xc044('0x2f'),_0x1398d6,_0xc044('0x36')))},function(_0x47ccbb){if(_0x47ccbb){_0x2ea3b9(_0x47ccbb);}else{_0x21be20();}});});}})[_0xc044('0x17')](function(){if(_0x13efd8){rimraf(path['join'](_0x375c82,_0x1398d6),function(){});}})[_0xc044('0x17')](function(){return analyticExtractedReport('Completed',_0x13efd8?util[_0xc044('0x1b')]('%s.%s',_0x1398d6,_0x13efd8?_0xc044('0x36'):'pdf'):null);});}function main(){return db[_0xc044('0xc')][_0xc044('0x37')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x148734){_extractedReport=_0x148734;return dbH[_0xc044('0x19')]['query'](util[_0xc044('0x1b')](_0xc044('0x38'),QUERY),{'type':dbH['sequelize'][_0xc044('0x1d')][_0xc044('0x1e')]});})[_0xc044('0x17')](extractReport)[_0xc044('0x39')](function(_0x4250fe){console['error'](_0x4250fe);return analyticExtractedReport(_0xc044('0x3a'));});}main();
\ No newline at end of file
index a7fd529..94f832c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9fd=['basename','.xlsx','existsSync','join','mkdirSync','length','xlsx','%s.%s','binary','zip','catch','Error','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','Setting','find','split','then','splitSizeXlsx','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','num','Empty','push','format','SELECT'];(function(_0x409656,_0x18001a){var _0x1877b1=function(_0x32f2d2){while(--_0x32f2d2){_0x409656['push'](_0x409656['shift']());}};_0x1877b1(++_0x18001a);}(_0xf9fd,0x159));var _0xdf9f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf9fd[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xdf9f('0x0'));var path=require('path');var _=require(_0xdf9f('0x1'));var fs=require('fs');var json2xls=require(_0xdf9f('0x2'));var BPromise=require(_0xdf9f('0x3'));var zipdir=require(_0xdf9f('0x4'));var rimraf=require(_0xdf9f('0x5'));var db=require(_0xdf9f('0x6'))['db'];var dbH=require(_0xdf9f('0x6'))[_0xdf9f('0x7')];var EXTRACTED_REPORT_ID=Number(process[_0xdf9f('0x8')][0x2]);var QUERY=process[_0xdf9f('0x8')][0x3];var PATH=process[_0xdf9f('0x8')][0x4];function analyticExtractedReport(_0x927b1e,_0x50b467){var _0x499aba={'status':_0x927b1e};var _0x218956={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x50b467){_0x499aba[_0xdf9f('0x9')]=_0x50b467;}return db[_0xdf9f('0xa')]['update'](_0x499aba,_0x218956);}function main(){var _0x5caa19=0x1388;var _0x4862dc;return db[_0xdf9f('0xb')][_0xdf9f('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xdf9f('0xd'),'splitSizeXlsx']})[_0xdf9f('0xe')](function(_0x103b50){if(_0x103b50){_0x4862dc=_0x103b50;_0x5caa19=_0x4862dc[_0xdf9f('0xf')]||0x1388;}})[_0xdf9f('0xe')](function(){return dbH['sequelize'][_0xdf9f('0x10')](util['format'](_0xdf9f('0x11'),QUERY),{'type':dbH[_0xdf9f('0x12')][_0xdf9f('0x13')]['SELECT']});})[_0xdf9f('0xe')](function(_0x2681dc){if(!_0x2681dc[0x0][_0xdf9f('0x14')]){return analyticExtractedReport(_0xdf9f('0x15'));}var _0x2d405b=[];var _0x102c37=0x0;var _0x11f0f7=!![];if(_0x4862dc[_0xdf9f('0xd')]){if(_0x2681dc&&_0x2681dc['length']){var _0x548f7b=_0x2681dc[0x0][_0xdf9f('0x14')]%(_0x102c37+_0x5caa19);for(;_0x11f0f7;_0x102c37+=_0x5caa19,_0x548f7b=_0x2681dc[0x0][_0xdf9f('0x14')]%(_0x102c37+_0x5caa19)){if(_0x548f7b==0x0||_0x548f7b==_0x2681dc[0x0][_0xdf9f('0x14')]){_0x11f0f7=![];}_0x2d405b[_0xdf9f('0x16')](dbH['sequelize'][_0xdf9f('0x10')](util[_0xdf9f('0x17')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5caa19,_0x102c37),{'type':dbH[_0xdf9f('0x12')][_0xdf9f('0x13')][_0xdf9f('0x18')]}));}}}else{_0x2d405b['push'](dbH['sequelize'][_0xdf9f('0x10')](QUERY,{'type':dbH[_0xdf9f('0x12')]['QueryTypes'][_0xdf9f('0x18')]}));}var _0x2c4760=path['dirname'](PATH);var _0x497df5=path[_0xdf9f('0x19')](PATH,_0xdf9f('0x1a'));var _0x214eb2=_0x4862dc[_0xdf9f('0xd')]&&_0x2d405b['length']>0x1;var _0x50e22e=[];if(!fs[_0xdf9f('0x1b')](path[_0xdf9f('0x1c')](_0x2c4760,_0x497df5))&&_0x214eb2){fs[_0xdf9f('0x1d')](path[_0xdf9f('0x1c')](_0x2c4760,_0x497df5));}return BPromise['each'](_0x2d405b,function(_0x1b17be){_0x50e22e[_0xdf9f('0x16')](_0x1b17be);})['then'](function(){for(var _0x8edf3f=0x0;_0x8edf3f<_0x50e22e[_0xdf9f('0x1e')];_0x8edf3f+=0x1){var _0x40fe29;var _0x5647a9=_0x50e22e[_0x8edf3f];if(_0x214eb2){_0x40fe29=path[_0xdf9f('0x1c')](_0x2c4760,_0x497df5,util[_0xdf9f('0x17')]('%s%d.%s',_0x497df5,_0x8edf3f,_0xdf9f('0x1f')));}else{_0x40fe29=path['join'](_0x2c4760,util['format'](_0xdf9f('0x20'),_0x497df5,_0xdf9f('0x1f')));}fs['writeFileSync'](_0x40fe29,json2xls(_0x5647a9),_0xdf9f('0x21'));}})[_0xdf9f('0xe')](function(){if(_0x214eb2){zipdir(path[_0xdf9f('0x1c')](_0x2c4760,_0x497df5),{'saveTo':path[_0xdf9f('0x1c')](_0x2c4760,util[_0xdf9f('0x17')](_0xdf9f('0x20'),_0x497df5,_0xdf9f('0x22')))},function(_0x424961,_0x140eab){});rimraf(path[_0xdf9f('0x1c')](_0x2c4760,_0x497df5),function(){});}})[_0xdf9f('0xe')](function(){return analyticExtractedReport('Completed',_0x214eb2?util[_0xdf9f('0x17')](_0xdf9f('0x20'),_0x497df5,_0x214eb2?_0xdf9f('0x22'):_0xdf9f('0x1f')):null);});})[_0xdf9f('0x23')](function(_0x140b81){console['error'](_0x140b81);return analyticExtractedReport(_0xdf9f('0x24'));});}main();
\ No newline at end of file
+var _0xe37d=['push','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','binary','zip','Completed','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','Setting','split','then','splitSizeXlsx','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','length','num'];(function(_0x3e9b51,_0x8330c1){var _0x1648fc=function(_0x121c6f){while(--_0x121c6f){_0x3e9b51['push'](_0x3e9b51['shift']());}};_0x1648fc(++_0x8330c1);}(_0xe37d,0x1ca));var _0xde37=function(_0x5ee507,_0x59e998){_0x5ee507=_0x5ee507-0x0;var _0x223caf=_0xe37d[_0x5ee507];return _0x223caf;};'use strict';var util=require(_0xde37('0x0'));var path=require(_0xde37('0x1'));var _=require(_0xde37('0x2'));var fs=require('fs');var json2xls=require(_0xde37('0x3'));var BPromise=require(_0xde37('0x4'));var zipdir=require(_0xde37('0x5'));var rimraf=require(_0xde37('0x6'));var db=require(_0xde37('0x7'))['db'];var dbH=require(_0xde37('0x7'))[_0xde37('0x8')];var EXTRACTED_REPORT_ID=Number(process[_0xde37('0x9')][0x2]);var QUERY=process[_0xde37('0x9')][0x3];var PATH=process[_0xde37('0x9')][0x4];function analyticExtractedReport(_0x3174ab,_0x2ad9cd){var _0x21c03a={'status':_0x3174ab};var _0x55205b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ad9cd){_0x21c03a[_0xde37('0xa')]=_0x2ad9cd;}return db[_0xde37('0xb')]['update'](_0x21c03a,_0x55205b);}function main(){var _0x57afcf=0x1388;var _0x39d183;return db[_0xde37('0xc')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xde37('0xd'),'splitSizeXlsx']})[_0xde37('0xe')](function(_0x4c5ba5){if(_0x4c5ba5){_0x39d183=_0x4c5ba5;_0x57afcf=_0x39d183[_0xde37('0xf')]||0x1388;}})['then'](function(){return dbH[_0xde37('0x10')]['query'](util['format'](_0xde37('0x11'),QUERY),{'type':dbH[_0xde37('0x10')][_0xde37('0x12')]['SELECT']});})[_0xde37('0xe')](function(_0x65cf40){if(!_0x65cf40[0x0]['num']){return analyticExtractedReport(_0xde37('0x13'));}var _0x5e4e20=[];var _0x407cf3=0x0;var _0x2eb890=!![];if(_0x39d183[_0xde37('0xd')]){if(_0x65cf40&&_0x65cf40[_0xde37('0x14')]){var _0xcd8472=_0x65cf40[0x0][_0xde37('0x15')]%(_0x407cf3+_0x57afcf);for(;_0x2eb890;_0x407cf3+=_0x57afcf,_0xcd8472=_0x65cf40[0x0][_0xde37('0x15')]%(_0x407cf3+_0x57afcf)){if(_0xcd8472==0x0||_0xcd8472==_0x65cf40[0x0]['num']){_0x2eb890=![];}_0x5e4e20[_0xde37('0x16')](dbH['sequelize'][_0xde37('0x17')](util[_0xde37('0x18')](_0xde37('0x19'),QUERY,_0x57afcf,_0x407cf3),{'type':dbH[_0xde37('0x10')][_0xde37('0x12')][_0xde37('0x1a')]}));}}}else{_0x5e4e20[_0xde37('0x16')](dbH['sequelize'][_0xde37('0x17')](QUERY,{'type':dbH[_0xde37('0x10')][_0xde37('0x12')][_0xde37('0x1a')]}));}var _0x47eaf1=path[_0xde37('0x1b')](PATH);var _0x2f057f=path[_0xde37('0x1c')](PATH,_0xde37('0x1d'));var _0x19414a=_0x39d183['split']&&_0x5e4e20[_0xde37('0x14')]>0x1;var _0x197cec=[];if(!fs[_0xde37('0x1e')](path[_0xde37('0x1f')](_0x47eaf1,_0x2f057f))&&_0x19414a){fs[_0xde37('0x20')](path['join'](_0x47eaf1,_0x2f057f));}return BPromise[_0xde37('0x21')](_0x5e4e20,function(_0xfcedba){_0x197cec['push'](_0xfcedba);})['then'](function(){for(var _0x3820e9=0x0;_0x3820e9<_0x197cec[_0xde37('0x14')];_0x3820e9+=0x1){var _0x180052;var _0x4d691c=_0x197cec[_0x3820e9];if(_0x19414a){_0x180052=path[_0xde37('0x1f')](_0x47eaf1,_0x2f057f,util[_0xde37('0x18')](_0xde37('0x22'),_0x2f057f,_0x3820e9,_0xde37('0x23')));}else{_0x180052=path[_0xde37('0x1f')](_0x47eaf1,util[_0xde37('0x18')](_0xde37('0x24'),_0x2f057f,'xlsx'));}fs['writeFileSync'](_0x180052,json2xls(_0x4d691c),_0xde37('0x25'));}})['then'](function(){if(_0x19414a){zipdir(path['join'](_0x47eaf1,_0x2f057f),{'saveTo':path[_0xde37('0x1f')](_0x47eaf1,util[_0xde37('0x18')](_0xde37('0x24'),_0x2f057f,_0xde37('0x26')))},function(_0x3f32c4,_0x3b01e1){});rimraf(path[_0xde37('0x1f')](_0x47eaf1,_0x2f057f),function(){});}})['then'](function(){return analyticExtractedReport(_0xde37('0x27'),_0x19414a?util[_0xde37('0x18')]('%s.%s',_0x2f057f,_0x19414a?_0xde37('0x26'):_0xde37('0x23')):null);});})['catch'](function(_0x29769e){console['error'](_0x29769e);return analyticExtractedReport('Error');});}main();
\ No newline at end of file
index 27716ce..7281112 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b0f=['${UNIQUEID}.',',ab','StopMixMonitor','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','sortBy','catch','error','rewrite','lodash','util','Interval','findAll','models','VoiceExtension','then','map','exten','CAST(priority\x20AS\x20UNSIGNED)','queue','hasOwnProperty','answer','progress','priority','extensions','push','type','context','Set','VoiceExtensionId','length','createdAt','updatedAt','interval','*,*,*,*','filter','intervals','IntervalId','tag','CDR(tag)=','callerID','indexOf','app','toLowerCase','appType','custom','Answer','Progress','recordingFormat','record'];(function(_0xfed031,_0x23c5e8){var _0x3ac165=function(_0x525bc1){while(--_0x525bc1){_0xfed031['push'](_0xfed031['shift']());}};_0x3ac165(++_0x23c5e8);}(_0x1b0f,0x1cf));var _0xf1b0=function(_0x35bdbc,_0x2beb9a){_0x35bdbc=_0x35bdbc-0x0;var _0x5c8b04=_0x1b0f[_0x35bdbc];return _0x5c8b04;};'use strict';var _=require(_0xf1b0('0x0'));var util=require(_0xf1b0('0x1'));function rewrite(_0x14b7f4,_0x4ded80){var _0xf678f9=this;return _0x14b7f4['models'][_0xf1b0('0x2')][_0xf1b0('0x3')]({'raw':!![]})['then'](function(_0x8651be){_0xf678f9['intervals']=_0x8651be;return _0x14b7f4[_0xf1b0('0x4')][_0xf1b0('0x5')][_0xf1b0('0x3')]({'where':{'IntervalId':_0x4ded80['IntervalId']},'raw':!![]});})[_0xf1b0('0x6')](function(_0x31b11e){return _0x14b7f4[_0xf1b0('0x4')][_0xf1b0('0x5')]['findAll']({'where':{'exten':{'$in':_['uniq'](_[_0xf1b0('0x7')](_0x31b11e,_0xf1b0('0x8')))},'isApp':!![]},'order':[{'raw':_0xf1b0('0x9')}],'raw':!![]});})['then'](function(_0x2b3f2c){var _0x3f7800=_['groupBy'](_0x2b3f2c,_0xf1b0('0x8'));var _0x6dd0e3=[_0xf1b0('0xa'),'playback'];var _0x6c6b59=[];var _0x2bb5ea=[];for(var _0x20e38e in _0x3f7800){if(_0x3f7800[_0xf1b0('0xb')](_0x20e38e)){_0xf678f9[_0xf1b0('0xc')]=![];_0xf678f9[_0xf1b0('0xd')]=![];_0xf678f9[_0xf1b0('0xe')]=0x2;_0xf678f9[_0xf1b0('0xf')]=[];_0xf678f9['extensions'][_0xf1b0('0x10')]({'type':_0x3f7800[_0x20e38e][0x0][_0xf1b0('0x11')],'context':_0x3f7800[_0x20e38e][0x0][_0xf1b0('0x12')],'exten':_0x3f7800[_0x20e38e][0x0][_0xf1b0('0x8')],'priority':_0xf678f9['priority']++,'app':_0xf1b0('0x13'),'appdata':util['format']('CDR(type)=%s',_0x3f7800[_0x20e38e][0x0]['type']),'VoiceExtensionId':_0x3f7800[_0x20e38e][0x0][_0xf1b0('0x14')]});for(var _0x2bddf9=0x0,_0x380471=0x0;_0x2bddf9<_0x3f7800[_0x20e38e][_0xf1b0('0x15')];_0x2bddf9+=0x1,_0x380471=0x0){var _0x17b180=_0x3f7800[_0x20e38e][_0x2bddf9];var _0x58561a=[];var _0x8caa7b=[];delete _0x17b180['id'];delete _0x17b180[_0xf1b0('0x16')];delete _0x17b180[_0xf1b0('0x17')];var _0x2bf13e=_0x17b180[_0xf1b0('0x18')]!==_0xf1b0('0x19')?[_0x17b180[_0xf1b0('0x18')]]:_0x17b180['IntervalId']?_[_0xf1b0('0x7')](_[_0xf1b0('0x1a')](_0xf678f9[_0xf1b0('0x1b')],{'IntervalId':_0x17b180[_0xf1b0('0x1c')]}),_0xf1b0('0x18')):[];if(_0x17b180[_0xf1b0('0xb')](_0xf1b0('0x1d'))){if(_0x17b180[_0xf1b0('0x1d')]&&_0x17b180['tag']!=='--'){_0x58561a[_0xf1b0('0x10')]({'type':_0x17b180[_0xf1b0('0x11')],'app':'Set','appdata':_0xf1b0('0x1e')+_0x17b180[_0xf1b0('0x1d')],'context':_0x17b180[_0xf1b0('0x12')],'exten':_0x17b180[_0xf1b0('0x8')],'priority':_0x2bf13e[_0xf1b0('0x15')]+_0xf678f9[_0xf1b0('0xe')]+_0x380471++,'VoiceExtensionId':_0x3f7800[_0x20e38e][0x0][_0xf1b0('0x14')]});}}if(_0x17b180[_0xf1b0('0xb')]('callerID')){if(_0x17b180[_0xf1b0('0x1f')]){_0x58561a['push']({'type':_0x17b180[_0xf1b0('0x11')],'app':'Set','appdata':'CALLERID(all)='+_0x17b180['callerID'],'context':_0x17b180[_0xf1b0('0x12')],'exten':_0x17b180[_0xf1b0('0x8')],'priority':_0x2bf13e['length']+_0xf678f9[_0xf1b0('0xe')]+_0x380471++,'VoiceExtensionId':_0x3f7800[_0x20e38e][0x0][_0xf1b0('0x14')]});}}if(_0x17b180[_0xf1b0('0xb')]('answer')){if(_0x6dd0e3[_0xf1b0('0x20')](_0x17b180[_0xf1b0('0x21')][_0xf1b0('0x22')]())>=0x0&&_0x17b180[_0xf1b0('0x23')]!==_0xf1b0('0x24')){if(!_0xf678f9[_0xf1b0('0xc')]&&_0x17b180[_0xf1b0('0xc')]){_0xf678f9['answer']=!![];_0x58561a[_0xf1b0('0x10')]({'type':_0x17b180['type'],'app':_0xf1b0('0x25'),'context':_0x17b180['context'],'exten':_0x17b180['exten'],'priority':_0x2bf13e[_0xf1b0('0x15')]+_0xf678f9[_0xf1b0('0xe')]+_0x380471++,'VoiceExtensionId':_0x3f7800[_0x20e38e][0x0][_0xf1b0('0x14')]});}if(!_0xf678f9[_0xf1b0('0xc')]&&!_0xf678f9[_0xf1b0('0xd')]&&!_0x17b180[_0xf1b0('0xc')]){_0xf678f9[_0xf1b0('0xd')]=!![];_0x58561a[_0xf1b0('0x10')]({'type':_0x17b180[_0xf1b0('0x11')],'app':_0xf1b0('0x26'),'context':_0x17b180[_0xf1b0('0x12')],'exten':_0x17b180[_0xf1b0('0x8')],'priority':_0x2bf13e[_0xf1b0('0x15')]+_0xf678f9[_0xf1b0('0xe')]+_0x380471++,'VoiceExtensionId':_0x3f7800[_0x20e38e][0x0][_0xf1b0('0x14')]});}}}if(_0x17b180[_0xf1b0('0xb')]('record')&&_0x17b180[_0xf1b0('0xb')](_0xf1b0('0x27'))){if(_0x17b180[_0xf1b0('0x28')]){_0x58561a[_0xf1b0('0x10')]({'type':_0x17b180[_0xf1b0('0x11')],'app':'MixMonitor','appdata':_0xf1b0('0x29')+_0x17b180[_0xf1b0('0x27')]+_0xf1b0('0x2a'),'context':_0x17b180[_0xf1b0('0x12')],'exten':_0x17b180[_0xf1b0('0x8')],'priority':_0x2bf13e[_0xf1b0('0x15')]+_0xf678f9[_0xf1b0('0xe')]+_0x380471++,'VoiceExtensionId':_0x3f7800[_0x20e38e][0x0][_0xf1b0('0x14')]});}}if(_0x17b180['hasOwnProperty'](_0xf1b0('0x28'))&&_0x17b180['hasOwnProperty']('recordingFormat')){if(_0x17b180[_0xf1b0('0x28')]){_0x8caa7b[_0xf1b0('0x10')]({'type':_0x17b180[_0xf1b0('0x11')],'app':_0xf1b0('0x2b'),'appdata':null,'context':_0x17b180[_0xf1b0('0x12')],'exten':_0x17b180[_0xf1b0('0x8')],'priority':_0x2bf13e[_0xf1b0('0x15')]+_0xf678f9['priority']+_0x380471++ +0x1,'VoiceExtensionId':_0x3f7800[_0x20e38e][0x0]['VoiceExtensionId']});}}for(var _0x55d160=0x0;_0x55d160<_0x2bf13e[_0xf1b0('0x15')];_0x55d160+=0x1){var _0x108d68=_0xf678f9[_0xf1b0('0xe')]+_0x2bf13e[_0xf1b0('0x15')];var _0x1ec72b=_0x55d160===_0x2bf13e[_0xf1b0('0x15')]-0x1?_0xf678f9[_0xf1b0('0xe')]+_0x58561a[_0xf1b0('0x15')]+_0x8caa7b[_0xf1b0('0x15')]+0x2:_0xf678f9[_0xf1b0('0xe')]+_0x55d160+0x1;_0x58561a[_0xf1b0('0x2c')](_0x55d160,0x0,{'type':_0x17b180[_0xf1b0('0x11')],'app':_0xf1b0('0x2d'),'appdata':_0x2bf13e[_0x55d160]+'?'+_0x17b180[_0xf1b0('0x12')]+_0xf1b0('0x2e')+_0x108d68+':'+_0x17b180[_0xf1b0('0x12')]+_0xf1b0('0x2e')+_0x1ec72b,'exten':_0x17b180['exten'],'context':_0x17b180[_0xf1b0('0x12')],'priority':_0xf678f9[_0xf1b0('0xe')]+_0x55d160,'VoiceExtensionId':_0x3f7800[_0x20e38e][0x0][_0xf1b0('0x14')]});}_0x17b180['priority']=_0x58561a['length']?_['last'](_0x58561a)[_0xf1b0('0xe')]+0x1:_0xf678f9[_0xf1b0('0xe')];_0xf678f9['priority']=(_0x8caa7b[_0xf1b0('0x15')]?_[_0xf1b0('0x2f')](_0x8caa7b)[_0xf1b0('0xe')]:_0x17b180[_0xf1b0('0xe')])+0x1;_0xf678f9[_0xf1b0('0xf')]=_[_0xf1b0('0x30')](_0xf678f9[_0xf1b0('0xf')],_0x58561a,[_0x17b180],_0x8caa7b);}_0xf678f9[_0xf1b0('0xf')]['push']({'type':_0x3f7800[_0x20e38e][0x0][_0xf1b0('0x11')],'app':_0xf1b0('0x31'),'exten':_0x3f7800[_0x20e38e][0x0]['exten'],'context':_0x3f7800[_0x20e38e][0x0][_0xf1b0('0x12')],'priority':_0xf678f9['priority'],'VoiceExtensionId':_0x3f7800[_0x20e38e][0x0][_0xf1b0('0x14')]});_0x6c6b59[_0xf1b0('0x10')](_0x3f7800[_0x20e38e][0x0][_0xf1b0('0x14')]);_0x2bb5ea=_[_0xf1b0('0x30')](_0x2bb5ea,_0xf678f9[_0xf1b0('0xf')]);}}return _0x14b7f4[_0xf1b0('0x32')](function(_0x22feae){return _0x14b7f4[_0xf1b0('0x4')][_0xf1b0('0x5')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x6c6b59}},'transaction':_0x22feae})['then'](function(_0x393d9f){return _0x14b7f4[_0xf1b0('0x4')][_0xf1b0('0x5')][_0xf1b0('0x33')](_[_0xf1b0('0x34')](_0x2bb5ea,'priority'),{'transaction':_0x22feae});});});})[_0xf1b0('0x35')](function(_0xe8830a){console[_0xf1b0('0x36')](_0xe8830a);});}exports[_0xf1b0('0x37')]=rewrite;
\ No newline at end of file
+var _0xa000=['context','Set','VoiceExtensionId','length','createdAt','updatedAt','interval','filter','hasOwnProperty','tag','CDR(tag)=','callerID','CALLERID(all)=','indexOf','app','toLowerCase','appType','custom','Answer','record','recordingFormat','${UNIQUEID}.',',ab','StopMixMonitor','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','sortBy','catch','error','lodash','util','models','then','intervals','IntervalId','VoiceExtension','findAll','uniq','map','exten','groupBy','queue','playback','answer','progress','priority','extensions','push','type'];(function(_0x27a1e0,_0x3ff2cb){var _0x1ca624=function(_0x435802){while(--_0x435802){_0x27a1e0['push'](_0x27a1e0['shift']());}};_0x1ca624(++_0x3ff2cb);}(_0xa000,0x19c));var _0x0a00=function(_0x1f8ca7,_0x261d3a){_0x1f8ca7=_0x1f8ca7-0x0;var _0x9697fd=_0xa000[_0x1f8ca7];return _0x9697fd;};'use strict';var _=require(_0x0a00('0x0'));var util=require(_0x0a00('0x1'));function rewrite(_0x3d49c9,_0x3f7cb1){var _0x3670fe=this;return _0x3d49c9[_0x0a00('0x2')]['Interval']['findAll']({'raw':!![]})[_0x0a00('0x3')](function(_0x298b16){_0x3670fe[_0x0a00('0x4')]=_0x298b16;return _0x3d49c9['models']['VoiceExtension']['findAll']({'where':{'IntervalId':_0x3f7cb1[_0x0a00('0x5')]},'raw':!![]});})[_0x0a00('0x3')](function(_0x173f1a){return _0x3d49c9['models'][_0x0a00('0x6')][_0x0a00('0x7')]({'where':{'exten':{'$in':_[_0x0a00('0x8')](_[_0x0a00('0x9')](_0x173f1a,_0x0a00('0xa')))},'isApp':!![]},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x0a00('0x3')](function(_0x3dee53){var _0x10205c=_[_0x0a00('0xb')](_0x3dee53,_0x0a00('0xa'));var _0x5e1e87=[_0x0a00('0xc'),_0x0a00('0xd')];var _0x32ba5e=[];var _0x4c0ce3=[];for(var _0x1d431c in _0x10205c){if(_0x10205c['hasOwnProperty'](_0x1d431c)){_0x3670fe[_0x0a00('0xe')]=![];_0x3670fe[_0x0a00('0xf')]=![];_0x3670fe[_0x0a00('0x10')]=0x2;_0x3670fe[_0x0a00('0x11')]=[];_0x3670fe[_0x0a00('0x11')][_0x0a00('0x12')]({'type':_0x10205c[_0x1d431c][0x0][_0x0a00('0x13')],'context':_0x10205c[_0x1d431c][0x0][_0x0a00('0x14')],'exten':_0x10205c[_0x1d431c][0x0][_0x0a00('0xa')],'priority':_0x3670fe['priority']++,'app':_0x0a00('0x15'),'appdata':util['format']('CDR(type)=%s',_0x10205c[_0x1d431c][0x0][_0x0a00('0x13')]),'VoiceExtensionId':_0x10205c[_0x1d431c][0x0][_0x0a00('0x16')]});for(var _0x561dc0=0x0,_0x4ffecc=0x0;_0x561dc0<_0x10205c[_0x1d431c][_0x0a00('0x17')];_0x561dc0+=0x1,_0x4ffecc=0x0){var _0x37b517=_0x10205c[_0x1d431c][_0x561dc0];var _0x219d11=[];var _0x36667b=[];delete _0x37b517['id'];delete _0x37b517[_0x0a00('0x18')];delete _0x37b517[_0x0a00('0x19')];var _0x49e093=_0x37b517[_0x0a00('0x1a')]!=='*,*,*,*'?[_0x37b517[_0x0a00('0x1a')]]:_0x37b517['IntervalId']?_[_0x0a00('0x9')](_[_0x0a00('0x1b')](_0x3670fe['intervals'],{'IntervalId':_0x37b517['IntervalId']}),'interval'):[];if(_0x37b517[_0x0a00('0x1c')](_0x0a00('0x1d'))){if(_0x37b517[_0x0a00('0x1d')]&&_0x37b517[_0x0a00('0x1d')]!=='--'){_0x219d11[_0x0a00('0x12')]({'type':_0x37b517[_0x0a00('0x13')],'app':_0x0a00('0x15'),'appdata':_0x0a00('0x1e')+_0x37b517[_0x0a00('0x1d')],'context':_0x37b517[_0x0a00('0x14')],'exten':_0x37b517[_0x0a00('0xa')],'priority':_0x49e093[_0x0a00('0x17')]+_0x3670fe[_0x0a00('0x10')]+_0x4ffecc++,'VoiceExtensionId':_0x10205c[_0x1d431c][0x0][_0x0a00('0x16')]});}}if(_0x37b517[_0x0a00('0x1c')](_0x0a00('0x1f'))){if(_0x37b517[_0x0a00('0x1f')]){_0x219d11[_0x0a00('0x12')]({'type':_0x37b517[_0x0a00('0x13')],'app':_0x0a00('0x15'),'appdata':_0x0a00('0x20')+_0x37b517[_0x0a00('0x1f')],'context':_0x37b517[_0x0a00('0x14')],'exten':_0x37b517[_0x0a00('0xa')],'priority':_0x49e093['length']+_0x3670fe[_0x0a00('0x10')]+_0x4ffecc++,'VoiceExtensionId':_0x10205c[_0x1d431c][0x0]['VoiceExtensionId']});}}if(_0x37b517[_0x0a00('0x1c')]('answer')){if(_0x5e1e87[_0x0a00('0x21')](_0x37b517[_0x0a00('0x22')][_0x0a00('0x23')]())>=0x0&&_0x37b517[_0x0a00('0x24')]!==_0x0a00('0x25')){if(!_0x3670fe[_0x0a00('0xe')]&&_0x37b517[_0x0a00('0xe')]){_0x3670fe[_0x0a00('0xe')]=!![];_0x219d11[_0x0a00('0x12')]({'type':_0x37b517[_0x0a00('0x13')],'app':_0x0a00('0x26'),'context':_0x37b517[_0x0a00('0x14')],'exten':_0x37b517['exten'],'priority':_0x49e093[_0x0a00('0x17')]+_0x3670fe[_0x0a00('0x10')]+_0x4ffecc++,'VoiceExtensionId':_0x10205c[_0x1d431c][0x0][_0x0a00('0x16')]});}if(!_0x3670fe['answer']&&!_0x3670fe[_0x0a00('0xf')]&&!_0x37b517[_0x0a00('0xe')]){_0x3670fe[_0x0a00('0xf')]=!![];_0x219d11[_0x0a00('0x12')]({'type':_0x37b517[_0x0a00('0x13')],'app':'Progress','context':_0x37b517['context'],'exten':_0x37b517[_0x0a00('0xa')],'priority':_0x49e093['length']+_0x3670fe[_0x0a00('0x10')]+_0x4ffecc++,'VoiceExtensionId':_0x10205c[_0x1d431c][0x0][_0x0a00('0x16')]});}}}if(_0x37b517[_0x0a00('0x1c')](_0x0a00('0x27'))&&_0x37b517['hasOwnProperty'](_0x0a00('0x28'))){if(_0x37b517[_0x0a00('0x27')]){_0x219d11[_0x0a00('0x12')]({'type':_0x37b517[_0x0a00('0x13')],'app':'MixMonitor','appdata':_0x0a00('0x29')+_0x37b517[_0x0a00('0x28')]+_0x0a00('0x2a'),'context':_0x37b517[_0x0a00('0x14')],'exten':_0x37b517[_0x0a00('0xa')],'priority':_0x49e093[_0x0a00('0x17')]+_0x3670fe['priority']+_0x4ffecc++,'VoiceExtensionId':_0x10205c[_0x1d431c][0x0][_0x0a00('0x16')]});}}if(_0x37b517[_0x0a00('0x1c')]('record')&&_0x37b517[_0x0a00('0x1c')](_0x0a00('0x28'))){if(_0x37b517[_0x0a00('0x27')]){_0x36667b[_0x0a00('0x12')]({'type':_0x37b517[_0x0a00('0x13')],'app':_0x0a00('0x2b'),'appdata':null,'context':_0x37b517[_0x0a00('0x14')],'exten':_0x37b517[_0x0a00('0xa')],'priority':_0x49e093['length']+_0x3670fe[_0x0a00('0x10')]+_0x4ffecc++ +0x1,'VoiceExtensionId':_0x10205c[_0x1d431c][0x0][_0x0a00('0x16')]});}}for(var _0xdccafa=0x0;_0xdccafa<_0x49e093[_0x0a00('0x17')];_0xdccafa+=0x1){var _0x4b15d6=_0x3670fe[_0x0a00('0x10')]+_0x49e093[_0x0a00('0x17')];var _0x58f4aa=_0xdccafa===_0x49e093[_0x0a00('0x17')]-0x1?_0x3670fe['priority']+_0x219d11[_0x0a00('0x17')]+_0x36667b[_0x0a00('0x17')]+0x2:_0x3670fe[_0x0a00('0x10')]+_0xdccafa+0x1;_0x219d11[_0x0a00('0x2c')](_0xdccafa,0x0,{'type':_0x37b517[_0x0a00('0x13')],'app':_0x0a00('0x2d'),'appdata':_0x49e093[_0xdccafa]+'?'+_0x37b517[_0x0a00('0x14')]+_0x0a00('0x2e')+_0x4b15d6+':'+_0x37b517['context']+_0x0a00('0x2e')+_0x58f4aa,'exten':_0x37b517[_0x0a00('0xa')],'context':_0x37b517[_0x0a00('0x14')],'priority':_0x3670fe[_0x0a00('0x10')]+_0xdccafa,'VoiceExtensionId':_0x10205c[_0x1d431c][0x0][_0x0a00('0x16')]});}_0x37b517['priority']=_0x219d11[_0x0a00('0x17')]?_[_0x0a00('0x2f')](_0x219d11)[_0x0a00('0x10')]+0x1:_0x3670fe[_0x0a00('0x10')];_0x3670fe['priority']=(_0x36667b[_0x0a00('0x17')]?_['last'](_0x36667b)['priority']:_0x37b517[_0x0a00('0x10')])+0x1;_0x3670fe[_0x0a00('0x11')]=_[_0x0a00('0x30')](_0x3670fe['extensions'],_0x219d11,[_0x37b517],_0x36667b);}_0x3670fe[_0x0a00('0x11')][_0x0a00('0x12')]({'type':_0x10205c[_0x1d431c][0x0][_0x0a00('0x13')],'app':_0x0a00('0x31'),'exten':_0x10205c[_0x1d431c][0x0][_0x0a00('0xa')],'context':_0x10205c[_0x1d431c][0x0][_0x0a00('0x14')],'priority':_0x3670fe[_0x0a00('0x10')],'VoiceExtensionId':_0x10205c[_0x1d431c][0x0]['VoiceExtensionId']});_0x32ba5e[_0x0a00('0x12')](_0x10205c[_0x1d431c][0x0][_0x0a00('0x16')]);_0x4c0ce3=_[_0x0a00('0x30')](_0x4c0ce3,_0x3670fe[_0x0a00('0x11')]);}}return _0x3d49c9['transaction'](function(_0x31d13c){return _0x3d49c9[_0x0a00('0x2')][_0x0a00('0x6')][_0x0a00('0x32')]({'where':{'VoiceExtensionId':{'$in':_0x32ba5e}},'transaction':_0x31d13c})['then'](function(_0x430590){return _0x3d49c9['models']['VoiceExtension']['bulkCreate'](_[_0x0a00('0x33')](_0x4c0ce3,_0x0a00('0x10')),{'transaction':_0x31d13c});});});})[_0x0a00('0x34')](function(_0x23067a){console[_0x0a00('0x35')](_0x23067a);});}exports['rewrite']=rewrite;
\ No newline at end of file
index 40c745e..c30bea3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9aea=['info','CmContact','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','../../../config/logger','util','lodash','papaparse','socket.io-emitter','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','error','errors','length','map','message','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','CompanyId','find','Duplicate\x20Contact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','fromQuery','scheduledAt','ContactId','ListId','updatedAt','select','field','toString','NOW()','createdAt','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','from','cm_contacts','id\x20IN\x20?','str','\x20=\x20?','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','CmList','get','always','sequelize','query','onlyIfOpen','VoiceQueueId','all','findAll','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','resume','resolve','contact:csv_','Unable\x20to\x20delete\x20temp\x20file:','exit'];(function(_0x31bf26,_0x25f4b4){var _0x27ac9e=function(_0x4f7b3a){while(--_0x4f7b3a){_0x31bf26['push'](_0x31bf26['shift']());}};_0x27ac9e(++_0x25f4b4);}(_0x9aea,0xdd));var _0xa9ae=function(_0x23b339,_0x5c4493){_0x23b339=_0x23b339-0x0;var _0x5f3a1f=_0x9aea[_0x23b339];return _0x5f3a1f;};'use strict';var BPromise=require(_0xa9ae('0x0'));var db=require('../../../mysqldb')['db'];var logger=require(_0xa9ae('0x1'))('api');var util=require(_0xa9ae('0x2'));var _=require(_0xa9ae('0x3'));var fs=require('fs');var squel=require('squel');var Papa=require(_0xa9ae('0x4'));var socket=require(_0xa9ae('0x5'))({'host':_0xa9ae('0x6'),'port':0x18eb});require(_0xa9ae('0x7'))[_0xa9ae('0x8')](socket);try{if(!process['argv'][0x2]||process[_0xa9ae('0x9')][0x2]===_0xa9ae('0xa')||process[_0xa9ae('0x9')][0x2]==='null'){throw new Error(_0xa9ae('0xb'));}var FILEPATH=process[_0xa9ae('0x9')][0x2];if(!process[_0xa9ae('0x9')][0x3]||process[_0xa9ae('0x9')][0x3]===_0xa9ae('0xa')||process[_0xa9ae('0x9')][0x3]===_0xa9ae('0xc')||!process[_0xa9ae('0x9')][0x4]||process[_0xa9ae('0x9')][0x4]==='undefined'||process[_0xa9ae('0x9')][0x4]==='null'){throw new Error(_0xa9ae('0xd'));}var FIELDS=_[_0xa9ae('0xe')](process[_0xa9ae('0x9')][0x3][_0xa9ae('0xf')](','),process[_0xa9ae('0x9')][0x4][_0xa9ae('0xf')](','));if(!process[_0xa9ae('0x9')][0x5]||process[_0xa9ae('0x9')][0x5]==='undefined'||process[_0xa9ae('0x9')][0x5]===_0xa9ae('0xc')){throw new Error(_0xa9ae('0x10'));}var LISTID=process[_0xa9ae('0x9')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xa9ae('0x9')][0x6]!==_0xa9ae('0xa')&&process[_0xa9ae('0x9')][0x6]!==_0xa9ae('0xc')?process[_0xa9ae('0x9')][0x6]:null;var DUPLICATES=process[_0xa9ae('0x9')][0x7]&&process['argv'][0x7]!==_0xa9ae('0xa')&&process[_0xa9ae('0x9')][0x7]!==_0xa9ae('0xc')?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0xa9ae('0x9')][0x8]==='undefined'||process['argv'][0x8]===_0xa9ae('0xc')){throw new Error(_0xa9ae('0x11'));}var SOCKET_TIMESTAMP=process[_0xa9ae('0x9')][0x8];}catch(_0x42f961){logger['error'](_0x42f961);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(_0x27371a,_0x3d5d81,_0x39f133,_0x688153){var _0x426317={'message':_0x3d5d81};_0x426317[_0x27371a]=!![];if(_0x39f133){_0x426317[_0xa9ae('0x12')]=_0x39f133;}if(_0x688153){_0x426317[_0xa9ae('0x13')]=_0x688153;}return _0x426317;}function isEmail(_0x5a062d){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))*$/[_0xa9ae('0x14')](_0x5a062d);}function checkRow(_0x4ca9a9,_0x49dca9,_0x597222){return new BPromise(function(_0x478bb7,_0x1afd07){if(_['isNil'](_0x4ca9a9)){return _0x1afd07(handleCheckRowError(_0xa9ae('0x15'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x597222));}if(_0x4ca9a9[_0xa9ae('0x16')]&&_0x4ca9a9[_0xa9ae('0x16')][_0xa9ae('0x17')]){var _0x7a7fab=_[_0xa9ae('0x18')](_0x4ca9a9[_0xa9ae('0x16')],_0xa9ae('0x19'))['join'](';');return _0x1afd07(handleCheckRowError(_0xa9ae('0x15'),_0x7a7fab,null,_0x597222));}var _0x3873aa={};for(var _0x2aac9e in FIELDS){if(FIELDS[_0xa9ae('0x1a')](_0x2aac9e)&&FIELDS[_0x2aac9e]){_0x3873aa[_0x2aac9e]=_0x4ca9a9[_0xa9ae('0x1b')][0x0][FIELDS[_0x2aac9e]]||_0x4ca9a9[_0xa9ae('0x1b')][0x0]['\ufeff'+FIELDS[_0x2aac9e]];}}if(!_0x3873aa[_0xa9ae('0x1c')]){return _0x1afd07(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x597222));}if(!_0x3873aa[_0xa9ae('0x1d')]){return _0x1afd07(handleCheckRowError(_0xa9ae('0x15'),_0xa9ae('0x1e'),null,_0x597222));}if(_0x3873aa[_0xa9ae('0x1f')]){var _0x74cd94=moment(_0x3873aa['birthDate'],'YYYY-MM-DD');if(!_0x74cd94[_0xa9ae('0x20')]()){return _0x1afd07(handleCheckRowError(_0xa9ae('0x15'),_0xa9ae('0x21'),null,_0x597222));}}if(_0x3873aa[_0xa9ae('0x22')]){if(!isEmail(_0x3873aa[_0xa9ae('0x22')])){return _0x1afd07(handleCheckRowError(_0xa9ae('0x15'),'email\x20format\x20is\x20not\x20valid!',null,_0x597222));}}_0x3873aa['ListId']=LISTID;_0x3873aa[_0xa9ae('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xa9ae('0x17')]&&_0x49dca9){var _0x3d9b30={};for(var _0x3cd87a=0x0,_0x36c4d5=DUPLICATES[_0xa9ae('0x17')];_0x3cd87a<_0x36c4d5;_0x3cd87a+=0x1){_0x3d9b30[DUPLICATES[_0x3cd87a]]=_0x3873aa[DUPLICATES[_0x3cd87a]];}var _0x15f060=_[_0xa9ae('0x24')](_0x49dca9,_0x3d9b30);if(_0x15f060){return _0x1afd07(handleCheckRowError('duplicate',_0xa9ae('0x25'),_0x15f060,_0x597222));}}return db['CmContact'][_0xa9ae('0x26')](_0x3873aa,{'raw':!![],'hooks':![],'fields':_[_0xa9ae('0x27')](_0x3873aa)})[_0xa9ae('0x28')](function(_0x5cf88c){if(DUPLICATES&&DUPLICATES[_0xa9ae('0x17')]&&_0x49dca9){_0x49dca9[_0xa9ae('0x29')](_[_0xa9ae('0x2a')](_0x3873aa,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5cf88c['id'];return _0x478bb7();})[_0xa9ae('0x2b')](function(_0x353227){return _0x1afd07(handleCheckRowError('error',_0xa9ae('0x2c')+(_0x353227[_0xa9ae('0x19')]||JSON[_0xa9ae('0x2d')](_0x353227)),null,_0x597222));});});}function checkHopper(){function _0x52fdfa(){return function(_0x4e9710){logger[_0xa9ae('0x15')](_0xa9ae('0x2e'),_0xa9ae('0x2f'),util[_0xa9ae('0x30')](_0x4e9710,{'showHidden':![],'depth':null}));};}var _0x484f67=function(_0x356307,_0x2f5ba4){var _0x231192=squel[_0xa9ae('0x31')]()[_0xa9ae('0x32')]('cm_hopper')[_0xa9ae('0x33')](['phone',_0xa9ae('0x34'),_0xa9ae('0x35'),_0xa9ae('0x36'),_0x2f5ba4,'createdAt',_0xa9ae('0x37')],squel[_0xa9ae('0x38')]()[_0xa9ae('0x39')]('phone',_0xa9ae('0x1d'))[_0xa9ae('0x39')]('NOW()',_0xa9ae('0x34'))['field']('id',_0xa9ae('0x35'))[_0xa9ae('0x39')](LISTID['toString'](),_0xa9ae('0x36'))[_0xa9ae('0x39')](_0x356307['id'][_0xa9ae('0x3a')](),_0x2f5ba4)[_0xa9ae('0x39')](_0xa9ae('0x3b'),_0xa9ae('0x3c'))['field'](_0xa9ae('0x3b'),_0xa9ae('0x37'))['from']('cm_contacts')[_0xa9ae('0x3d')](_0xa9ae('0x3e'))[_0xa9ae('0x3d')](_0xa9ae('0x3f'),LISTID['toString']())[_0xa9ae('0x3d')](_0xa9ae('0x40'))[_0xa9ae('0x3d')](_0xa9ae('0x41'),squel[_0xa9ae('0x38')]()[_0xa9ae('0x39')](_0xa9ae('0x1d'))['from'](_0xa9ae('0x42'))[_0xa9ae('0x3d')](_0x2f5ba4+'\x20=\x20?',_0x356307['id'][_0xa9ae('0x3a')]())))['toString']();return _0x231192;};var _0xb51a6c=function(_0x34baa2,_0x27b5f3){var _0x166e61=squel[_0xa9ae('0x31')]()[_0xa9ae('0x32')](_0xa9ae('0x42'))['fromQuery']([_0xa9ae('0x1d'),_0xa9ae('0x34'),'ContactId',_0xa9ae('0x36'),_0x27b5f3,_0xa9ae('0x3c'),_0xa9ae('0x37')],squel[_0xa9ae('0x38')]()[_0xa9ae('0x39')](_0xa9ae('0x1d'),'phone')[_0xa9ae('0x39')]('NOW()',_0xa9ae('0x34'))[_0xa9ae('0x39')]('id','ContactId')['field'](LISTID[_0xa9ae('0x3a')](),_0xa9ae('0x36'))[_0xa9ae('0x39')](_0x34baa2['id'][_0xa9ae('0x3a')](),_0x27b5f3)[_0xa9ae('0x39')](_0xa9ae('0x3b'),_0xa9ae('0x3c'))[_0xa9ae('0x39')]('NOW()','updatedAt')[_0xa9ae('0x43')](_0xa9ae('0x44'))['where'](_0xa9ae('0x3e'))[_0xa9ae('0x3d')](_0xa9ae('0x3f'),LISTID[_0xa9ae('0x3a')]())[_0xa9ae('0x3d')](_0xa9ae('0x45'),squel[_0xa9ae('0x46')](hopperContacts))[_0xa9ae('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0xa9ae('0x3d')](_0xa9ae('0x41'),squel['select']()[_0xa9ae('0x39')]('calleridnum')['from']('cm_hopper_final')[_0xa9ae('0x3d')](_0x27b5f3+_0xa9ae('0x47'),_0x34baa2['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa9ae('0x38')]()['field'](_0xa9ae('0x1d'))[_0xa9ae('0x43')]('cm_hopper')[_0xa9ae('0x3d')](_0x27b5f3+'\x20=\x20?',_0x34baa2['id'][_0xa9ae('0x3a')]())))[_0xa9ae('0x3a')]();return _0x166e61;};function _0x1523be(_0x4e0d69,_0x371760){var _0x233dd6=squel[_0xa9ae('0x31')]()[_0xa9ae('0x32')](_0xa9ae('0x42'))[_0xa9ae('0x33')]([_0xa9ae('0x1d'),_0xa9ae('0x34'),'ContactId',_0xa9ae('0x36'),_0x371760,_0xa9ae('0x3c'),_0xa9ae('0x37')],squel[_0xa9ae('0x38')]()[_0xa9ae('0x39')]('phone','phone')[_0xa9ae('0x39')](_0xa9ae('0x3b'),'scheduledAt')['field']('id',_0xa9ae('0x35'))['field'](LISTID[_0xa9ae('0x3a')](),_0xa9ae('0x36'))[_0xa9ae('0x39')](_0x4e0d69['id']['toString'](),_0x371760)[_0xa9ae('0x39')]('NOW()',_0xa9ae('0x3c'))['field'](_0xa9ae('0x3b'),_0xa9ae('0x37'))[_0xa9ae('0x43')](_0xa9ae('0x44'))[_0xa9ae('0x3d')](_0xa9ae('0x3e'))['where'](_0xa9ae('0x3f'),LISTID[_0xa9ae('0x3a')]())[_0xa9ae('0x3d')](_0xa9ae('0x45'),squel['str'](hopperContacts))[_0xa9ae('0x3d')](_0xa9ae('0x40')))[_0xa9ae('0x3a')]();return _0x233dd6;}function _0x1219fa(_0x2d8140,_0x1f563a){var _0x66935f=squel[_0xa9ae('0x31')]()[_0xa9ae('0x32')](_0xa9ae('0x48'))['fromQuery']([_0xa9ae('0x1d'),_0xa9ae('0x35'),_0xa9ae('0x36'),_0x1f563a,_0xa9ae('0x3c'),'updatedAt'],squel[_0xa9ae('0x38')]()[_0xa9ae('0x39')]('phone',_0xa9ae('0x1d'))[_0xa9ae('0x39')]('id',_0xa9ae('0x35'))['field'](LISTID['toString'](),_0xa9ae('0x36'))[_0xa9ae('0x39')](_0x2d8140['id']['toString'](),_0x1f563a)['field'](_0xa9ae('0x3b'),_0xa9ae('0x3c'))[_0xa9ae('0x39')]('NOW()',_0xa9ae('0x37'))[_0xa9ae('0x43')](_0xa9ae('0x44'))[_0xa9ae('0x3d')](_0xa9ae('0x3e'))[_0xa9ae('0x3d')](_0xa9ae('0x3f'),LISTID[_0xa9ae('0x3a')]())[_0xa9ae('0x3d')](_0xa9ae('0x45'),squel['str'](hopperContacts))['where'](_0xa9ae('0x40')))[_0xa9ae('0x3a')]();return _0x66935f;}return db[_0xa9ae('0x49')]['findAll']({'where':{'type':_0xa9ae('0x4a')},'attributes':['id',_0xa9ae('0x4b')],'include':[{'model':db[_0xa9ae('0x4c')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x18635c){var _0x57f67c=[];if(_0x18635c){var _0x14a720;for(var _0x13524f=0x0,_0x25e825;_0x13524f<_0x18635c[_0xa9ae('0x17')];_0x13524f+=0x1){_0x25e825=_0x18635c[_0x13524f][_0xa9ae('0x4d')]({'plain':!![]});switch(_0x25e825[_0xa9ae('0x4b')]){case _0xa9ae('0x4e'):_0x57f67c[_0xa9ae('0x29')](db[_0xa9ae('0x4f')][_0xa9ae('0x50')](_0xb51a6c(_0x25e825,'VoiceQueueId'))[_0xa9ae('0x28')](function(){})['catch'](_0x52fdfa()));break;case _0xa9ae('0x51'):_0x57f67c[_0xa9ae('0x29')](db[_0xa9ae('0x4f')][_0xa9ae('0x50')](_0x484f67(_0x25e825,_0xa9ae('0x52')))['then'](function(){})[_0xa9ae('0x2b')](_0x52fdfa()));break;default:_0x57f67c[_0xa9ae('0x29')](db[_0xa9ae('0x4f')][_0xa9ae('0x50')](_0x1523be(_0x25e825,_0xa9ae('0x52')))['then'](function(){})[_0xa9ae('0x2b')](_0x52fdfa()));}}}return _0x57f67c;})[_0xa9ae('0x53')]()[_0xa9ae('0x28')](function(){return db[_0xa9ae('0x49')][_0xa9ae('0x54')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xa9ae('0x55'),'where':{'id':LISTID}}]})[_0xa9ae('0x28')](function(_0x5c9072){var _0x192701=[];if(_0x5c9072){var _0x25faf8;for(var _0x579e2b=0x0,_0x50b8c3;_0x579e2b<_0x5c9072[_0xa9ae('0x17')];_0x579e2b+=0x1){_0x50b8c3=_0x5c9072[_0x579e2b][_0xa9ae('0x4d')]({'plain':!![]});_0x192701['push'](db['sequelize'][_0xa9ae('0x50')](_0x1219fa(_0x50b8c3,_0xa9ae('0x52')))[_0xa9ae('0x28')](function(){})[_0xa9ae('0x2b')](_0x52fdfa()));}}return _0x192701;})['all']();})['then'](function(){return db[_0xa9ae('0x56')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0xa9ae('0x28')](function(_0x21751a){var _0x32bbfa=[];if(_0x21751a){for(var _0x35e1b1=0x0,_0x4be573;_0x35e1b1<_0x21751a[_0xa9ae('0x17')];_0x35e1b1+=0x1){_0x4be573=_0x21751a[_0x35e1b1][_0xa9ae('0x4d')]({'plain':!![]});switch(_0x4be573['dialCheckDuplicateType']){case _0xa9ae('0x4e'):_0x32bbfa['push'](db[_0xa9ae('0x4f')][_0xa9ae('0x50')](_0xb51a6c(_0x4be573,_0xa9ae('0x57')))[_0xa9ae('0x28')](function(){})[_0xa9ae('0x2b')](_0x52fdfa()));break;case _0xa9ae('0x51'):_0x32bbfa['push'](db[_0xa9ae('0x4f')][_0xa9ae('0x50')](_0x484f67(_0x4be573,_0xa9ae('0x57')))[_0xa9ae('0x28')](function(){})[_0xa9ae('0x2b')](_0x52fdfa()));break;default:_0x32bbfa[_0xa9ae('0x29')](db[_0xa9ae('0x4f')][_0xa9ae('0x50')](_0x1523be(_0x4be573,'CampaignId'))[_0xa9ae('0x28')](function(){})[_0xa9ae('0x2b')](_0x52fdfa()));}}}return _0x32bbfa;})[_0xa9ae('0x53')]();})[_0xa9ae('0x28')](function(){return db[_0xa9ae('0x56')][_0xa9ae('0x54')]({'attributes':['id'],'include':[{'model':db[_0xa9ae('0x4c')],'as':_0xa9ae('0x55'),'where':{'id':LISTID}}]})[_0xa9ae('0x28')](function(_0x373f60){var _0x19420e=[];if(_0x373f60){for(var _0x3b92d7=0x0,_0x2d1112;_0x3b92d7<_0x373f60[_0xa9ae('0x17')];_0x3b92d7+=0x1){_0x2d1112=_0x373f60[_0x3b92d7][_0xa9ae('0x4d')]({'plain':!![]});_0x19420e[_0xa9ae('0x29')](db[_0xa9ae('0x4f')][_0xa9ae('0x50')](_0x1219fa(_0x2d1112,_0xa9ae('0x57')))['then'](function(){})[_0xa9ae('0x2b')](_0x52fdfa()));}}return _0x19420e;})[_0xa9ae('0x53')]();})[_0xa9ae('0x2b')](function(_0x3fab74){logger[_0xa9ae('0x15')](_0xa9ae('0x58'),_0xa9ae('0x59'),_0x3fab74[_0xa9ae('0x19')]);});}var processPromises=function(_0x383397){return BPromise['all'](promises)[_0xa9ae('0x28')](function(_0x4630c4){})[_0xa9ae('0x2b')](function(_0x39130e){logger[_0xa9ae('0x15')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x39130e));})[_0xa9ae('0x5a')](function(){socket[_0xa9ae('0x5b')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x383397){return _0x383397[_0xa9ae('0x5c')]();}});};var endCsv=function(){return BPromise[_0xa9ae('0x5d')]()[_0xa9ae('0x28')](function(){if(hopperContacts){return checkHopper();}})[_0xa9ae('0x28')](function(){socket[_0xa9ae('0x5b')](_0xa9ae('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x20bd4d){logger[_0xa9ae('0x15')](_0xa9ae('0x5f'),JSON[_0xa9ae('0x2d')](_0x20bd4d));}finally{process[_0xa9ae('0x60')](0x0);}});};process['on']('SIGINT',function(){logger[_0xa9ae('0x61')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xa9ae('0x5d')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xa9ae('0xf')](',');return db[_0xa9ae('0x62')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x20e091){var _0x1baa42=fs[_0xa9ae('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xa9ae('0x64')](_0x1baa42,{'header':!![],'skipEmptyLines':!![],'step':function(_0x14f3f6,_0x1c9b26){total+=0x1;var _0x1a4acb=total;promises['push'](checkRow(_0x14f3f6,_0x20e091,_0x1a4acb)[_0xa9ae('0x28')](function(){success+=0x1;})['catch'](function(_0x1e6347){if(_0x1e6347[_0xa9ae('0x15')]){errors+=0x1;delete _0x1e6347['error'];}else if(_0x1e6347['duplicate']){duplicates+=0x1;delete _0x1e6347[_0xa9ae('0x65')];}rows[_0xa9ae('0x29')](_0x1e6347);}));if(total%0xc8===0x0){_0x1c9b26[_0xa9ae('0x66')]();return processPromises(_0x1c9b26);}},'complete':function(){return processPromises()[_0xa9ae('0x28')](function(){logger[_0xa9ae('0x61')](_0xa9ae('0x67'));endCsv();});},'error':function(_0x26bbee,_0x4fad30){logger[_0xa9ae('0x61')](_0xa9ae('0x68'),JSON['stringify'](_0x26bbee));endCsv();}});})[_0xa9ae('0x2b')](function(_0x85e4aa){logger['error'](_0xa9ae('0x69'),JSON[_0xa9ae('0x2d')](_0x85e4aa));});}main();
\ No newline at end of file
+var _0x0713=['CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','../../../config/logger','api','util','lodash','squel','socket.io-emitter','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','insert','into','fromQuery','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','cm_hopper','\x20=\x20?','ListId\x20=\x20?','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','cm_hopper_black','outbound','dialCheckDuplicateType','CmList','always','sequelize','query','VoiceQueueId','all','VoiceQueue','BlackLists','get','findAll','Lists','onlyIfOpen','CampaignId','Campaign','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','resume','resolve','unlinkSync','exit','SIGINT','CSV\x20import\x20process\x20stopped!','parse','pause','CSV\x20parsed\x20correctly!','info'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var db=require('../../../mysqldb')['db'];var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var util=require(_0x3071('0x2'));var _=require(_0x3071('0x3'));var fs=require('fs');var squel=require(_0x3071('0x4'));var Papa=require('papaparse');var socket=require(_0x3071('0x5'))({'host':_0x3071('0x6'),'port':0x18eb});require(_0x3071('0x7'))[_0x3071('0x8')](socket);try{if(!process[_0x3071('0x9')][0x2]||process[_0x3071('0x9')][0x2]===_0x3071('0xa')||process[_0x3071('0x9')][0x2]===_0x3071('0xb')){throw new Error(_0x3071('0xc'));}var FILEPATH=process[_0x3071('0x9')][0x2];if(!process[_0x3071('0x9')][0x3]||process[_0x3071('0x9')][0x3]==='undefined'||process[_0x3071('0x9')][0x3]===_0x3071('0xb')||!process[_0x3071('0x9')][0x4]||process[_0x3071('0x9')][0x4]===_0x3071('0xa')||process['argv'][0x4]===_0x3071('0xb')){throw new Error(_0x3071('0xd'));}var FIELDS=_[_0x3071('0xe')](process[_0x3071('0x9')][0x3][_0x3071('0xf')](','),process['argv'][0x4]['split'](','));if(!process[_0x3071('0x9')][0x5]||process['argv'][0x5]===_0x3071('0xa')||process[_0x3071('0x9')][0x5]==='null'){throw new Error(_0x3071('0x10'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x3071('0x9')][0x6]&&process[_0x3071('0x9')][0x6]!==_0x3071('0xa')&&process[_0x3071('0x9')][0x6]!==_0x3071('0xb')?process[_0x3071('0x9')][0x6]:null;var DUPLICATES=process[_0x3071('0x9')][0x7]&&process[_0x3071('0x9')][0x7]!==_0x3071('0xa')&&process[_0x3071('0x9')][0x7]!=='null'?process[_0x3071('0x9')][0x7]:null;if(!process[_0x3071('0x9')][0x8]||process[_0x3071('0x9')][0x8]===_0x3071('0xa')||process[_0x3071('0x9')][0x8]===_0x3071('0xb')){throw new Error(_0x3071('0x11'));}var SOCKET_TIMESTAMP=process[_0x3071('0x9')][0x8];}catch(_0x502a16){logger[_0x3071('0x12')](_0x502a16);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(_0x2bfa33,_0xd3e23d,_0x56c267,_0xb8f4e3){var _0x5cd80d={'message':_0xd3e23d};_0x5cd80d[_0x2bfa33]=!![];if(_0x56c267){_0x5cd80d[_0x3071('0x13')]=_0x56c267;}if(_0xb8f4e3){_0x5cd80d[_0x3071('0x14')]=_0xb8f4e3;}return _0x5cd80d;}function isEmail(_0x3762d8){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))*$/[_0x3071('0x15')](_0x3762d8);}function checkRow(_0x33090c,_0x34c50e,_0x3c5cef){return new BPromise(function(_0x211b4f,_0x542646){if(_['isNil'](_0x33090c)){return _0x542646(handleCheckRowError(_0x3071('0x12'),_0x3071('0x16'),null,_0x3c5cef));}if(_0x33090c[_0x3071('0x17')]&&_0x33090c[_0x3071('0x17')][_0x3071('0x18')]){var _0x44b45f=_[_0x3071('0x19')](_0x33090c[_0x3071('0x17')],_0x3071('0x1a'))['join'](';');return _0x542646(handleCheckRowError(_0x3071('0x12'),_0x44b45f,null,_0x3c5cef));}var _0x3f1e6e={};for(var _0x177138 in FIELDS){if(FIELDS['hasOwnProperty'](_0x177138)&&FIELDS[_0x177138]){_0x3f1e6e[_0x177138]=_0x33090c[_0x3071('0x1b')][0x0][FIELDS[_0x177138]]||_0x33090c[_0x3071('0x1b')][0x0]['\ufeff'+FIELDS[_0x177138]];}}if(!_0x3f1e6e[_0x3071('0x1c')]){return _0x542646(handleCheckRowError(_0x3071('0x12'),_0x3071('0x1d'),null,_0x3c5cef));}if(!_0x3f1e6e[_0x3071('0x1e')]){return _0x542646(handleCheckRowError(_0x3071('0x12'),_0x3071('0x1f'),null,_0x3c5cef));}if(_0x3f1e6e[_0x3071('0x20')]){var _0x292205=moment(_0x3f1e6e[_0x3071('0x20')],'YYYY-MM-DD');if(!_0x292205['isValid']()){return _0x542646(handleCheckRowError(_0x3071('0x12'),_0x3071('0x21'),null,_0x3c5cef));}}if(_0x3f1e6e[_0x3071('0x22')]){if(!isEmail(_0x3f1e6e[_0x3071('0x22')])){return _0x542646(handleCheckRowError(_0x3071('0x12'),_0x3071('0x23'),null,_0x3c5cef));}}_0x3f1e6e[_0x3071('0x24')]=LISTID;_0x3f1e6e[_0x3071('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x34c50e){var _0x55d230={};for(var _0x4ab983=0x0,_0x1b0aaf=DUPLICATES[_0x3071('0x18')];_0x4ab983<_0x1b0aaf;_0x4ab983+=0x1){_0x55d230[DUPLICATES[_0x4ab983]]=_0x3f1e6e[DUPLICATES[_0x4ab983]];}var _0x5b5bf1=_[_0x3071('0x26')](_0x34c50e,_0x55d230);if(_0x5b5bf1){return _0x542646(handleCheckRowError(_0x3071('0x27'),_0x3071('0x28'),_0x5b5bf1,_0x3c5cef));}}return db[_0x3071('0x29')]['create'](_0x3f1e6e,{'raw':!![],'hooks':![],'fields':_[_0x3071('0x2a')](_0x3f1e6e)})[_0x3071('0x2b')](function(_0x602719){if(DUPLICATES&&DUPLICATES[_0x3071('0x18')]&&_0x34c50e){_0x34c50e[_0x3071('0x2c')](_[_0x3071('0x2d')](_0x3f1e6e,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x602719['id'];return _0x211b4f();})[_0x3071('0x2e')](function(_0x148f7a){return _0x542646(handleCheckRowError('error',_0x3071('0x2f')+(_0x148f7a['message']||JSON['stringify'](_0x148f7a)),null,_0x3c5cef));});});}function checkHopper(){function _0x1a1a64(){return function(_0xa3a7ae){logger['error'](_0x3071('0x30'),_0x3071('0x31'),util[_0x3071('0x32')](_0xa3a7ae,{'showHidden':![],'depth':null}));};}var _0x14ac42=function(_0xc60572,_0x232235){var _0x5610ab=squel[_0x3071('0x33')]()[_0x3071('0x34')]('cm_hopper')[_0x3071('0x35')](['phone',_0x3071('0x36'),_0x3071('0x37'),'ListId',_0x232235,'createdAt',_0x3071('0x38')],squel[_0x3071('0x39')]()[_0x3071('0x3a')]('phone',_0x3071('0x1e'))['field'](_0x3071('0x3b'),'scheduledAt')[_0x3071('0x3a')]('id',_0x3071('0x37'))[_0x3071('0x3a')](LISTID[_0x3071('0x3c')](),_0x3071('0x24'))['field'](_0xc60572['id']['toString'](),_0x232235)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3d'))[_0x3071('0x3a')]('NOW()',_0x3071('0x38'))[_0x3071('0x3e')](_0x3071('0x3f'))[_0x3071('0x40')](_0x3071('0x41'))[_0x3071('0x40')]('ListId\x20=\x20?',LISTID[_0x3071('0x3c')]())['where']('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x3071('0x39')]()[_0x3071('0x3a')](_0x3071('0x1e'))[_0x3071('0x3e')](_0x3071('0x42'))[_0x3071('0x40')](_0x232235+_0x3071('0x43'),_0xc60572['id'][_0x3071('0x3c')]())))['toString']();return _0x5610ab;};var _0x1e8222=function(_0x1641d9,_0x44a879){var _0x151a9c=squel[_0x3071('0x33')]()['into']('cm_hopper')[_0x3071('0x35')]([_0x3071('0x1e'),_0x3071('0x36'),_0x3071('0x37'),_0x3071('0x24'),_0x44a879,'createdAt',_0x3071('0x38')],squel['select']()[_0x3071('0x3a')]('phone','phone')[_0x3071('0x3a')]('NOW()',_0x3071('0x36'))['field']('id',_0x3071('0x37'))[_0x3071('0x3a')](LISTID[_0x3071('0x3c')](),_0x3071('0x24'))['field'](_0x1641d9['id'][_0x3071('0x3c')](),_0x44a879)['field'](_0x3071('0x3b'),'createdAt')[_0x3071('0x3a')](_0x3071('0x3b'),'updatedAt')[_0x3071('0x3e')](_0x3071('0x3f'))[_0x3071('0x40')](_0x3071('0x41'))[_0x3071('0x40')](_0x3071('0x44'),LISTID[_0x3071('0x3c')]())['where'](_0x3071('0x45'),squel[_0x3071('0x46')](hopperContacts))[_0x3071('0x40')](_0x3071('0x47'))['where'](_0x3071('0x48'),squel[_0x3071('0x39')]()[_0x3071('0x3a')](_0x3071('0x49'))[_0x3071('0x3e')](_0x3071('0x4a'))[_0x3071('0x40')](_0x44a879+_0x3071('0x43'),_0x1641d9['id'][_0x3071('0x3c')]()))[_0x3071('0x40')](_0x3071('0x48'),squel[_0x3071('0x39')]()[_0x3071('0x3a')](_0x3071('0x1e'))[_0x3071('0x3e')](_0x3071('0x42'))['where'](_0x44a879+'\x20=\x20?',_0x1641d9['id'][_0x3071('0x3c')]())))['toString']();return _0x151a9c;};function _0x403761(_0x198168,_0x15c6f8){var _0x514821=squel[_0x3071('0x33')]()[_0x3071('0x34')]('cm_hopper')['fromQuery']([_0x3071('0x1e'),_0x3071('0x36'),_0x3071('0x37'),_0x3071('0x24'),_0x15c6f8,'createdAt',_0x3071('0x38')],squel[_0x3071('0x39')]()[_0x3071('0x3a')](_0x3071('0x1e'),_0x3071('0x1e'))['field'](_0x3071('0x3b'),_0x3071('0x36'))[_0x3071('0x3a')]('id',_0x3071('0x37'))[_0x3071('0x3a')](LISTID[_0x3071('0x3c')](),_0x3071('0x24'))['field'](_0x198168['id']['toString'](),_0x15c6f8)[_0x3071('0x3a')]('NOW()',_0x3071('0x3d'))[_0x3071('0x3a')]('NOW()',_0x3071('0x38'))[_0x3071('0x3e')]('cm_contacts')[_0x3071('0x40')](_0x3071('0x41'))[_0x3071('0x40')](_0x3071('0x44'),LISTID[_0x3071('0x3c')]())['where'](_0x3071('0x45'),squel[_0x3071('0x46')](hopperContacts))[_0x3071('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0x3071('0x3c')]();return _0x514821;}function _0x238fa9(_0x291e28,_0x25680e){var _0x379723=squel[_0x3071('0x33')]()[_0x3071('0x34')](_0x3071('0x4b'))[_0x3071('0x35')](['phone',_0x3071('0x37'),_0x3071('0x24'),_0x25680e,_0x3071('0x3d'),_0x3071('0x38')],squel[_0x3071('0x39')]()[_0x3071('0x3a')](_0x3071('0x1e'),_0x3071('0x1e'))[_0x3071('0x3a')]('id',_0x3071('0x37'))[_0x3071('0x3a')](LISTID['toString'](),_0x3071('0x24'))[_0x3071('0x3a')](_0x291e28['id'][_0x3071('0x3c')](),_0x25680e)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3d'))[_0x3071('0x3a')](_0x3071('0x3b'),'updatedAt')[_0x3071('0x3e')](_0x3071('0x3f'))['where']('deletedAt\x20IS\x20NULL')[_0x3071('0x40')](_0x3071('0x44'),LISTID[_0x3071('0x3c')]())[_0x3071('0x40')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x3071('0x40')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x379723;}return db['VoiceQueue']['findAll']({'where':{'type':_0x3071('0x4c')},'attributes':['id',_0x3071('0x4d')],'include':[{'model':db[_0x3071('0x4e')],'as':'Lists','where':{'id':LISTID}}]})[_0x3071('0x2b')](function(_0xfab3d9){var _0xc5749b=[];if(_0xfab3d9){var _0x19a03d;for(var _0x5a0c1b=0x0,_0x2103a4;_0x5a0c1b<_0xfab3d9[_0x3071('0x18')];_0x5a0c1b+=0x1){_0x2103a4=_0xfab3d9[_0x5a0c1b]['get']({'plain':!![]});switch(_0x2103a4[_0x3071('0x4d')]){case _0x3071('0x4f'):_0xc5749b[_0x3071('0x2c')](db[_0x3071('0x50')][_0x3071('0x51')](_0x1e8222(_0x2103a4,_0x3071('0x52')))[_0x3071('0x2b')](function(){})['catch'](_0x1a1a64()));break;case'onlyIfOpen':_0xc5749b[_0x3071('0x2c')](db[_0x3071('0x50')][_0x3071('0x51')](_0x14ac42(_0x2103a4,'VoiceQueueId'))['then'](function(){})[_0x3071('0x2e')](_0x1a1a64()));break;default:_0xc5749b[_0x3071('0x2c')](db[_0x3071('0x50')][_0x3071('0x51')](_0x403761(_0x2103a4,_0x3071('0x52')))[_0x3071('0x2b')](function(){})[_0x3071('0x2e')](_0x1a1a64()));}}}return _0xc5749b;})[_0x3071('0x53')]()['then'](function(){return db[_0x3071('0x54')]['findAll']({'where':{'type':_0x3071('0x4c')},'attributes':['id'],'include':[{'model':db[_0x3071('0x4e')],'as':_0x3071('0x55'),'where':{'id':LISTID}}]})[_0x3071('0x2b')](function(_0x37cec5){var _0x44b5dc=[];if(_0x37cec5){var _0x155542;for(var _0x2ae053=0x0,_0x4fa372;_0x2ae053<_0x37cec5[_0x3071('0x18')];_0x2ae053+=0x1){_0x4fa372=_0x37cec5[_0x2ae053][_0x3071('0x56')]({'plain':!![]});_0x44b5dc[_0x3071('0x2c')](db['sequelize'][_0x3071('0x51')](_0x238fa9(_0x4fa372,_0x3071('0x52')))[_0x3071('0x2b')](function(){})['catch'](_0x1a1a64()));}}return _0x44b5dc;})['all']();})[_0x3071('0x2b')](function(){return db['Campaign'][_0x3071('0x57')]({'attributes':['id',_0x3071('0x4d')],'include':[{'model':db[_0x3071('0x4e')],'as':_0x3071('0x58'),'where':{'id':LISTID}}]})[_0x3071('0x2b')](function(_0x437098){var _0x242665=[];if(_0x437098){for(var _0x4c67ec=0x0,_0x1f2be3;_0x4c67ec<_0x437098[_0x3071('0x18')];_0x4c67ec+=0x1){_0x1f2be3=_0x437098[_0x4c67ec][_0x3071('0x56')]({'plain':!![]});switch(_0x1f2be3[_0x3071('0x4d')]){case _0x3071('0x4f'):_0x242665[_0x3071('0x2c')](db[_0x3071('0x50')][_0x3071('0x51')](_0x1e8222(_0x1f2be3,'CampaignId'))[_0x3071('0x2b')](function(){})['catch'](_0x1a1a64()));break;case _0x3071('0x59'):_0x242665[_0x3071('0x2c')](db[_0x3071('0x50')][_0x3071('0x51')](_0x14ac42(_0x1f2be3,_0x3071('0x5a')))[_0x3071('0x2b')](function(){})[_0x3071('0x2e')](_0x1a1a64()));break;default:_0x242665[_0x3071('0x2c')](db[_0x3071('0x50')][_0x3071('0x51')](_0x403761(_0x1f2be3,'CampaignId'))[_0x3071('0x2b')](function(){})[_0x3071('0x2e')](_0x1a1a64()));}}}return _0x242665;})['all']();})[_0x3071('0x2b')](function(){return db[_0x3071('0x5b')][_0x3071('0x57')]({'attributes':['id'],'include':[{'model':db[_0x3071('0x4e')],'as':_0x3071('0x55'),'where':{'id':LISTID}}]})['then'](function(_0x5a7d28){var _0x3d2860=[];if(_0x5a7d28){for(var _0x4da539=0x0,_0x2e6103;_0x4da539<_0x5a7d28[_0x3071('0x18')];_0x4da539+=0x1){_0x2e6103=_0x5a7d28[_0x4da539][_0x3071('0x56')]({'plain':!![]});_0x3d2860[_0x3071('0x2c')](db[_0x3071('0x50')][_0x3071('0x51')](_0x238fa9(_0x2e6103,'CampaignId'))[_0x3071('0x2b')](function(){})[_0x3071('0x2e')](_0x1a1a64()));}}return _0x3d2860;})[_0x3071('0x53')]();})[_0x3071('0x2e')](function(_0x5da839){logger[_0x3071('0x12')](_0x3071('0x5c'),'generalCheckHopper',_0x5da839[_0x3071('0x1a')]);});}var processPromises=function(_0x2ea7e9){return BPromise[_0x3071('0x53')](promises)[_0x3071('0x2b')](function(_0x34e4f3){})['catch'](function(_0x44cecd){logger['error'](_0x3071('0x5d'),JSON[_0x3071('0x5e')](_0x44cecd));})[_0x3071('0x5f')](function(){socket[_0x3071('0x60')](_0x3071('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2ea7e9){return _0x2ea7e9[_0x3071('0x62')]();}});};var endCsv=function(){return BPromise[_0x3071('0x63')]()[_0x3071('0x2b')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x3071('0x60')](_0x3071('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x3071('0x64')](FILEPATH);}catch(_0x4dfb45){logger[_0x3071('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x3071('0x5e')](_0x4dfb45));}finally{process[_0x3071('0x65')](0x0);}});};process['on'](_0x3071('0x66'),function(){logger['info'](_0x3071('0x67'));endCsv();});function main(){return BPromise[_0x3071('0x63')]()[_0x3071('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x3071('0xf')](',');return db[_0x3071('0x29')][_0x3071('0x57')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3071('0x2b')](function(_0x2c7749){var _0x39acd9=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x3071('0x68')](_0x39acd9,{'header':!![],'skipEmptyLines':!![],'step':function(_0xd4ef21,_0x34b376){total+=0x1;var _0x5b2830=total;promises['push'](checkRow(_0xd4ef21,_0x2c7749,_0x5b2830)['then'](function(){success+=0x1;})['catch'](function(_0x4eb9e2){if(_0x4eb9e2[_0x3071('0x12')]){errors+=0x1;delete _0x4eb9e2[_0x3071('0x12')];}else if(_0x4eb9e2['duplicate']){duplicates+=0x1;delete _0x4eb9e2[_0x3071('0x27')];}rows[_0x3071('0x2c')](_0x4eb9e2);}));if(total%0xc8===0x0){_0x34b376[_0x3071('0x69')]();return processPromises(_0x34b376);}},'complete':function(){return processPromises()['then'](function(){logger['info'](_0x3071('0x6a'));endCsv();});},'error':function(_0x2927b2,_0x285a96){logger[_0x3071('0x6b')](_0x3071('0x6c'),JSON[_0x3071('0x5e')](_0x2927b2));endCsv();}});})[_0x3071('0x2e')](function(_0x5eb60d){logger['error'](_0x3071('0x6d'),JSON[_0x3071('0x5e')](_0x5eb60d));});}main();
\ No newline at end of file
index 2f74fb0..4bee915 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x077c=['select','field','phone','join','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ListId','UserId','recallme','fields','from','cm_contacts','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.ListId','cm_contacts.createdAt','cm_hopper_black','ContactId','createdAt','updatedAt','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','error','message','push','sequelize','query','spread','catch','main','stringify','send','start','binding','socket_timestamp','.csv','header','writeFileSync','parse','createReadStream','data','errors','trim','replace','isValid','priority','isNaN','isNumber','includes','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','length','SystemRow','appendFileSync','rows','emit','contact:import:','SystemError','step','cm_contacts_','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','duplicates','DROP\x20TABLE\x20','voice_queues','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','campaigns','each','affectedRows','unlink','exit','complete','arguments\x20<filename>\x20<parameters>\x20<agents>','root','argv','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','../../../mysqldb','import','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test'];(function(_0x5abdbe,_0x2e460a){var _0x37c849=function(_0x51a37b){while(--_0x51a37b){_0x5abdbe['push'](_0x5abdbe['shift']());}};_0x37c849(++_0x2e460a);}(_0x077c,0x16f));var _0xc077=function(_0xf013e5,_0x1fa2da){_0xf013e5=_0xf013e5-0x0;var _0x3b0c71=_0x077c[_0xf013e5];return _0x3b0c71;};'use strict';var fs=require('fs');var path=require(_0xc077('0x0'));var _=require(_0xc077('0x1'));var Papa=require('papaparse');var util=require(_0xc077('0x2'));var BPromise=require(_0xc077('0x3'));var moment=require(_0xc077('0x4'));var squel=require('squel');var db=require(_0xc077('0x5'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xc077('0x6'));var socket=require('socket.io-emitter')({'host':_0xc077('0x7'),'port':0x18eb});var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xc077('0x8')](_0xc077('0x9'));function isEmail(_0x539409){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))*$/[_0xc077('0xa')](_0x539409);}function selectNotIn(_0x3130fe,_0x3cadaf,_0x3c8071,_0x1c7434,_0x50f8a8){return squel[_0xc077('0xb')]()[_0xc077('0xc')](_0xc077('0xd'))['from'](_0x1c7434)[_0xc077('0xe')](_0x3cadaf,null,_0x3cadaf+'.id\x20=\x20'+_0x1c7434+'.'+_0x3c8071)[_0xc077('0xf')](_0x1c7434+'.'+_0x3c8071+'\x20=\x20'+_0x3130fe+'.'+_0x3c8071)['where'](_0x3cadaf+_0xc077('0x10')+_0x50f8a8[_0xc077('0xe')]()+')');}function insertCmHopper(_0x519847,_0x29d424,_0xf2774f,_0x4f2b3d,_0x52fdb8){var _0x1724e8=[_0xc077('0x11'),_0xc077('0x12'),_0xc077('0x13'),'cm_contacts.ListId',_0x29d424+'.'+_0x4f2b3d,'cm_contacts.createdAt',_0xc077('0x14'),'cm_contacts.priority',_0xc077('0x15'),'\x22'+_0x52fdb8+'\x22'];return squel[_0xc077('0x16')]()[_0xc077('0x17')](_0xc077('0x18'))[_0xc077('0x19')]([_0xc077('0xd'),_0xc077('0x1a'),'ContactId',_0xc077('0x1b'),_0x4f2b3d,'createdAt','updatedAt','priority',_0xc077('0x1c'),_0xc077('0x1d')],squel[_0xc077('0xb')]()[_0xc077('0x1e')](_0x1724e8)[_0xc077('0x1f')](_0x29d424)[_0xc077('0xe')](_0xc077('0x20'),null,'cm_contacts.ListId\x20=\x20'+_0x29d424+'.CmListId')[_0xc077('0xe')](_0xf2774f,null,_0xf2774f+_0xc077('0x21')+_0x29d424+'.'+_0x4f2b3d)[_0xc077('0xf')](_0x29d424+'.CmListId\x20=\x20?',_0x519847)[_0xc077('0xf')](_0xc077('0x22'),NOW)[_0xc077('0xf')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x29d424,_0xf2774f,_0x4f2b3d,_0xc077('0x18'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0xc077('0xf')](_0xc077('0x23'),selectNotIn(_0x29d424,_0xf2774f,_0x4f2b3d,_0xc077('0x18'),['\x22always\x22'])))[_0xc077('0x24')]();}function insertCmHopperBlack(_0x24f02b,_0xb7c2a6,_0xc7bba6,_0x1703df){var _0x1a52bb=[_0xc077('0x11'),_0xc077('0x13'),_0xc077('0x25'),_0xb7c2a6+'.'+_0x1703df,_0xc077('0x26'),_0xc077('0x14')];return squel[_0xc077('0x16')]()['into'](_0xc077('0x27'))[_0xc077('0x19')]([_0xc077('0xd'),_0xc077('0x28'),'ListId',_0x1703df,_0xc077('0x29'),_0xc077('0x2a')],squel[_0xc077('0xb')]()['fields'](_0x1a52bb)[_0xc077('0x1f')](_0xb7c2a6)[_0xc077('0xe')](_0xc077('0x20'),null,_0xc077('0x2b')+_0xb7c2a6+'.CmListId')[_0xc077('0xe')](_0xc7bba6,null,_0xc7bba6+_0xc077('0x21')+_0xb7c2a6+'.'+_0x1703df)['where'](_0xb7c2a6+_0xc077('0x2c'),_0x24f02b)[_0xc077('0xf')](_0xc077('0x22'),NOW)[_0xc077('0xf')](_0xc077('0x23'),squel[_0xc077('0xb')]()[_0xc077('0xc')]('phone')[_0xc077('0x1f')](_0xc077('0x27'))[_0xc077('0xf')](_0xc077('0x2d'),_0x24f02b)[_0xc077('0xf')](_0x1703df+_0xc077('0x2e'),_0xb7c2a6+'.'+_0x1703df)))[_0xc077('0x24')]();}function insertCmContact(_0x490807,_0x91a041,_0x4ea1b2,_0xdb700f){var _0x131531=_[_0xc077('0x2f')](_[_0xc077('0x30')](_0xdb700f),[_0xc077('0x1b'),_0xc077('0x31'),_0xc077('0x29'),_0xc077('0x2a')]);return squel[_0xc077('0x16')]()[_0xc077('0x17')]('cm_contacts')[_0xc077('0x19')](_0x131531,squel['select']()[_0xc077('0x1e')](_0x131531)['from'](_0x91a041)['where']('('+_0x4ea1b2[_0xc077('0xe')](',')+_0xc077('0x32'),squel[_0xc077('0xb')]()[_0xc077('0x1e')](_0x4ea1b2)[_0xc077('0x1f')](_0xc077('0x20'))[_0xc077('0xf')](_0xc077('0x2d'),_0x490807))['where'](_0xc077('0x33'),squel[_0xc077('0xb')]()['field'](_0xc077('0x34'),_0xc077('0x35'))[_0xc077('0x1f')](_0x91a041)[_0xc077('0x36')](_0x4ea1b2[_0xc077('0xe')](','))))[_0xc077('0x24')]();}function handleStop(){logger[_0xc077('0x37')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x23e1f0){logger[_0xc077('0x38')](_0x23e1f0[_0xc077('0x39')]);process['exit'](0x1);}function handleError(_0x58c3d8,_0xf3a5de){stats['errors'][_0xc077('0x3a')]({'name':_0xf3a5de['code'],'message':_0xf3a5de['message'],'row':_0x58c3d8});}function handleQuery(_0x444970){logger[_0xc077('0x37')](_0x444970);return db[_0xc077('0x3b')][_0xc077('0x3c')](_0x444970)[_0xc077('0x3d')](function(_0x55f7aa){results[_0xc077('0x3a')](_0x55f7aa);})[_0xc077('0x3e')](function(_0x1210aa){logger['error'](_0x1210aa[_0xc077('0x39')]);});}function main(_0x1185d5,_0x58f404,_0x33486d,_0x10a50e){logger[_0xc077('0x37')](_0xc077('0x3f'),_0x1185d5,JSON[_0xc077('0x40')](_0x58f404));process[_0xc077('0x41')](_0xc077('0x42'));var _0x3a1bed=_0x58f404[_0xc077('0x43')];var _0x2f48eb=_0x58f404[_0xc077('0x44')];var _0x50f86d=path[_0xc077('0xe')](config['root'],'server/files/tmp',_0x2f48eb+_0xc077('0x45'));var _0x1f4574=_[_0xc077('0x30')](_0x3a1bed)['join']();logger[_0xc077('0x37')](_0xc077('0x46'),_0x1f4574);fs[_0xc077('0x47')](_0x50f86d,_0x1f4574+'\x0a');Papa[_0xc077('0x48')](fs[_0xc077('0x49')](_0x1185d5),{'header':!![],'skipEmptyLines':!![],'step':function(_0x283b3a,_0x1b2098){try{for(var _0x59e809=0x0,_0x299e75=[];_0x59e809<_0x283b3a['data']['length'];_0x59e809++){stats['rows']+=0x1;if(_0x283b3a['errors'][_0x59e809]){handleError(_0x283b3a[_0xc077('0x4a')][_0x59e809],_0x283b3a[_0xc077('0x4b')][_0x59e809]);}else{var _0x3709fc=[];for(var _0x1c3243 in _0x3a1bed){if(_0x3a1bed['hasOwnProperty'](_0x1c3243)){if(_0x283b3a[_0xc077('0x4a')][_0x59e809][_0x3a1bed[_0x1c3243]]){var _0x1b0d25=_[_0xc077('0x4c')](_0x283b3a['data'][_0x59e809][_0x3a1bed[_0x1c3243]][_0xc077('0x4d')](/"/g,'\x27'));switch(_0x1c3243){case _0xc077('0x1a'):var _0x171712=moment(_0x1b0d25,_0xc077('0x9'),!![]);if(_0x171712[_0xc077('0x4e')]()){_0x299e75['push']('\x22'+_0x1b0d25+'\x22');}else{_0x3709fc[_0xc077('0x3a')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xc077('0x4f'):var _0x507b2f=parseInt(_0x1b0d25);_0x1b0d25=_[_0xc077('0x50')](_0x507b2f)||_0x507b2f<0x0||_0x507b2f>0x4?_0x10a50e?0x3:0x2:_0x507b2f;_0x299e75[_0xc077('0x3a')]('\x22'+_0x1b0d25+'\x22');break;case _0xc077('0x1c'):var _0x251a27=parseInt(_0x1b0d25);if(_[_0xc077('0x51')](_0x251a27)&&_[_0xc077('0x52')](_0x33486d,_0x251a27)){_0x299e75[_0xc077('0x3a')]('\x22'+_0x251a27+'\x22');}else{_0x3709fc['push']('agent\x20not\x20exists');}break;case _0xc077('0x53'):if(isEmail(_0x1b0d25)){_0x299e75[_0xc077('0x3a')]('\x22'+_0x1b0d25+'\x22');}else{_0x3709fc[_0xc077('0x3a')](_0xc077('0x54'));}break;case _0xc077('0x55'):var _0x47d70e=moment(_0x1b0d25,_0xc077('0x56'),!![]);if(_0x47d70e[_0xc077('0x4e')]()){_0x299e75[_0xc077('0x3a')]('\x22'+_0x1b0d25+'\x22');}else{_0x3709fc['push'](_0xc077('0x57'));}break;default:_0x299e75[_0xc077('0x3a')]('\x22'+_0x1b0d25+'\x22');}}else{switch(_0x1c3243){case _0xc077('0x58'):case _0xc077('0xd'):_0x3709fc[_0xc077('0x3a')](_0x1c3243+_0xc077('0x59'));break;default:_0x299e75['push']('\x22\x22');}}}}if(_0x3709fc[_0xc077('0x5a')]){handleError(_0x283b3a['data'][_0x59e809],{'code':_0xc077('0x5b'),'message':_0x3709fc['join']()});}else{fs[_0xc077('0x5c')](_0x50f86d,_0x299e75[_0xc077('0xe')]()+'\x0a');}_0x299e75=[];}if(!(stats[_0xc077('0x5d')]%0xc8)){socket[_0xc077('0x5e')](_0xc077('0x5f')+_0x2f48eb,stats);stats['errors']=[];}}if(stopped){logger['info']('Abort\x20parser');_0x1b2098['abort']();}}catch(_0x462cd3){handleError(_0x283b3a[_0xc077('0x4a')][_0x59e809],{'code':_0xc077('0x60'),'message':_0x462cd3[_0xc077('0x39')]});logger[_0xc077('0x38')](_0xc077('0x61'),_0x462cd3[_0xc077('0x39')]);}},'complete':function(){try{var _0x3071cb=[];var _0x2c950e=_0xc077('0x20');if(_0x58f404['duplicates']&&_0x58f404['duplicates'][_0xc077('0x5a')]){_0x2c950e=_0xc077('0x62')+_0x2f48eb;_0x3071cb['push']('CREATE\x20TABLE\x20'+_0x2c950e+_0xc077('0x63'));}var _0x3c6da1=util[_0xc077('0x8')](_0xc077('0x64'),_0x50f86d,_0x2c950e,_0x1f4574,_0x58f404['ListId'],_0x58f404[_0xc077('0x31')]||null,NOW,NOW);if(_['isNil'](_0x3a1bed['scheduledat'])){_0x3c6da1+=',\x20scheduledAt\x20=\x20NOW()';}_0x3071cb[_0xc077('0x3a')](_0x3c6da1);if(_0x58f404['duplicates']&&_0x58f404[_0xc077('0x65')][_0xc077('0x5a')]){_0x3071cb[_0xc077('0x3a')](insertCmContact(_0x58f404[_0xc077('0x1b')],_0x2c950e,_0x58f404[_0xc077('0x65')],_0x3a1bed));_0x3071cb[_0xc077('0x3a')](_0xc077('0x66')+_0x2c950e+';');}_0x3071cb[_0xc077('0x3a')](insertCmHopper(_0x58f404[_0xc077('0x1b')],'voice_queues_has_cm_lists','voice_queues','VoiceQueueId',_0x10a50e));_0x3071cb[_0xc077('0x3a')](insertCmHopperBlack(_0x58f404[_0xc077('0x1b')],'voice_queues_has_cm_blacklists',_0xc077('0x67'),'VoiceQueueId'));_0x3071cb[_0xc077('0x3a')](insertCmHopper(_0x58f404[_0xc077('0x1b')],_0xc077('0x68'),'campaigns',_0xc077('0x69'),_0x10a50e));_0x3071cb['push'](insertCmHopperBlack(_0x58f404[_0xc077('0x1b')],_0xc077('0x6a'),_0xc077('0x6b'),_0xc077('0x69')));BPromise[_0xc077('0x6c')](_0x3071cb,handleQuery)['then'](function(_0x56f0cd){stats['finish']=!![];stats['affectedRows']=_0x58f404[_0xc077('0x65')]&&_0x58f404[_0xc077('0x65')]['length']?results[0x2][_0xc077('0x6d')]:results[0x0][_0xc077('0x6d')];socket[_0xc077('0x5e')]('contact:import:'+_0x2f48eb,stats);fs[_0xc077('0x6e')](_0x1185d5);fs[_0xc077('0x6e')](_0x50f86d);process[_0xc077('0x6f')](0x0);})['catch'](function(_0x1e4752){logger['error'](_0x1e4752[_0xc077('0x39')]);process[_0xc077('0x6f')](0x1);});}catch(_0x3eede8){logger[_0xc077('0x38')](_0xc077('0x70'),_0x3eede8[_0xc077('0x39')]);process[_0xc077('0x6f')](0x1);}},'error':function(_0x4f8bcd,_0x1021b7,_0x24a055,_0x4ee073){throw new Error(_0x4ee073);}});}function validate(){if(process['argv']&&process['argv'][_0xc077('0x5a')]<0x4){throw new Error(_0xc077('0x71'));}var _0x5b4d02=path[_0xc077('0xe')](config[_0xc077('0x72')],'server/files/tmp',process[_0xc077('0x73')][0x2]);if(!fs[_0xc077('0x74')](_0x5b4d02)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x4d696e={};try{_0x4d696e=JSON['parse'](process[_0xc077('0x73')][0x3]);if(!_0x4d696e[_0xc077('0x43')]){throw new Error(_0xc077('0x75'));}if(!_0x4d696e[_0xc077('0x43')][_0xc077('0xd')]){throw new Error(_0xc077('0x76'));}if(!_0x4d696e[_0xc077('0x43')][_0xc077('0x58')]){throw new Error(_0xc077('0x77'));}var _0x416c89=0x0;if(_0x4d696e['binding'][_0xc077('0x1c')]){_0x416c89=0x1;}if(!_0x4d696e[_0xc077('0x1b')]){throw new Error(_0xc077('0x78'));}}catch(_0x38a23e){throw new Error(_0xc077('0x79'));}var _0x5cb661=[];try{_0x5cb661=_[_0xc077('0x7a')](JSON[_0xc077('0x48')](process[_0xc077('0x73')][0x4]),'id');}catch(_0x4f95de){logger[_0xc077('0x37')](_0xc077('0x7b'));}main(_0x5b4d02,_0x4d696e,_0x5cb661,_0x416c89);}validate();process['on'](_0xc077('0x7c'),handleStop);process['on'](_0xc077('0x7d'),handleUncaughtException);
\ No newline at end of file
+var _0xc83c=['keys',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','info','Received\x20SIGINT','error','message','push','spread','stringify','send','start','socket_timestamp','root','server/files/tmp','header','writeFileSync','parse','createReadStream','data','length','rows','errors','hasOwnProperty','trim','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','abort','SystemError','step','duplicates','\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','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','CampaignId','campaigns','each','then','finish','affectedRows','unlink','catch','exit','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','binding','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','../../../mysqldb','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','join','.id\x20=\x20','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','createdAt','priority','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','where','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','ListId','updatedAt','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','concat'];(function(_0x111fdd,_0x4ad5cb){var _0x2aa6ed=function(_0x38a3bd){while(--_0x38a3bd){_0x111fdd['push'](_0x111fdd['shift']());}};_0x2aa6ed(++_0x4ad5cb);}(_0xc83c,0x1ac));var _0xcc83=function(_0x5db657,_0x2f40b3){_0x5db657=_0x5db657-0x0;var _0x2d6e70=_0xc83c[_0x5db657];return _0x2d6e70;};'use strict';var fs=require('fs');var path=require(_0xcc83('0x0'));var _=require(_0xcc83('0x1'));var Papa=require(_0xcc83('0x2'));var util=require(_0xcc83('0x3'));var BPromise=require(_0xcc83('0x4'));var moment=require('moment');var squel=require('squel');var db=require(_0xcc83('0x5'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')('import');var socket=require('socket.io-emitter')({'host':'localhost','port':0x18eb});var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0xcc83('0x6'));function isEmail(_0x16097a){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'](_0x16097a);}function selectNotIn(_0x3ac0be,_0x2f43d9,_0x16180f,_0x5cba88,_0x11204b){return squel[_0xcc83('0x7')]()[_0xcc83('0x8')](_0xcc83('0x9'))[_0xcc83('0xa')](_0x5cba88)[_0xcc83('0xb')](_0x2f43d9,null,_0x2f43d9+_0xcc83('0xc')+_0x5cba88+'.'+_0x16180f)['where'](_0x5cba88+'.'+_0x16180f+_0xcc83('0xd')+_0x3ac0be+'.'+_0x16180f)['where'](_0x2f43d9+_0xcc83('0xe')+_0x11204b[_0xcc83('0xb')]()+')');}function insertCmHopper(_0x5064ca,_0x2a832c,_0x17ce76,_0x5aa083,_0x4adee2){var _0xc84697=[_0xcc83('0xf'),_0xcc83('0x10'),'cm_contacts.id',_0xcc83('0x11'),_0x2a832c+'.'+_0x5aa083,_0xcc83('0x12'),_0xcc83('0x13'),'cm_contacts.priority',_0xcc83('0x14'),'\x22'+_0x4adee2+'\x22'];return squel[_0xcc83('0x15')]()[_0xcc83('0x16')](_0xcc83('0x17'))['fromQuery'](['phone',_0xcc83('0x18'),'ContactId','ListId',_0x5aa083,_0xcc83('0x19'),'updatedAt',_0xcc83('0x1a'),'UserId',_0xcc83('0x1b')],squel[_0xcc83('0x7')]()[_0xcc83('0x1c')](_0xc84697)[_0xcc83('0xa')](_0x2a832c)[_0xcc83('0xb')]('cm_contacts',null,_0xcc83('0x1d')+_0x2a832c+_0xcc83('0x1e'))[_0xcc83('0xb')](_0x17ce76,null,_0x17ce76+_0xcc83('0xc')+_0x2a832c+'.'+_0x5aa083)[_0xcc83('0x1f')](_0x2a832c+_0xcc83('0x20'),_0x5064ca)[_0xcc83('0x1f')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xcc83('0x21'),selectNotIn(_0x2a832c,_0x17ce76,_0x5aa083,_0xcc83('0x17'),[_0xcc83('0x22'),_0xcc83('0x23')]))[_0xcc83('0x1f')](_0xcc83('0x21'),selectNotIn(_0x2a832c,_0x17ce76,_0x5aa083,_0xcc83('0x17'),['\x22always\x22'])))[_0xcc83('0x24')]();}function insertCmHopperBlack(_0x193bd1,_0x2b87ac,_0x1b54ca,_0x18393b){var _0x225d99=[_0xcc83('0xf'),'cm_contacts.id',_0xcc83('0x11'),_0x2b87ac+'.'+_0x18393b,_0xcc83('0x12'),'cm_contacts.updatedAt'];return squel[_0xcc83('0x15')]()[_0xcc83('0x16')](_0xcc83('0x25'))['fromQuery']([_0xcc83('0x9'),'ContactId',_0xcc83('0x26'),_0x18393b,_0xcc83('0x19'),_0xcc83('0x27')],squel['select']()['fields'](_0x225d99)[_0xcc83('0xa')](_0x2b87ac)['join']('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x2b87ac+_0xcc83('0x1e'))['join'](_0x1b54ca,null,_0x1b54ca+_0xcc83('0xc')+_0x2b87ac+'.'+_0x18393b)[_0xcc83('0x1f')](_0x2b87ac+'.CmListId\x20=\x20?',_0x193bd1)[_0xcc83('0x1f')](_0xcc83('0x28'),NOW)[_0xcc83('0x1f')](_0xcc83('0x21'),squel['select']()[_0xcc83('0x8')](_0xcc83('0x9'))[_0xcc83('0xa')]('cm_hopper_black')[_0xcc83('0x1f')](_0xcc83('0x29'),_0x193bd1)[_0xcc83('0x1f')](_0x18393b+_0xcc83('0x2a'),_0x2b87ac+'.'+_0x18393b)))[_0xcc83('0x24')]();}function insertCmContact(_0x1307c6,_0x207a88,_0x3a21a2,_0x45a869){var _0x28b525=_[_0xcc83('0x2b')](_[_0xcc83('0x2c')](_0x45a869),[_0xcc83('0x26'),'CompanyId',_0xcc83('0x19'),'updatedAt']);return squel['insert']()[_0xcc83('0x16')]('cm_contacts')['fromQuery'](_0x28b525,squel[_0xcc83('0x7')]()['fields'](_0x28b525)[_0xcc83('0xa')](_0x207a88)[_0xcc83('0x1f')]('('+_0x3a21a2[_0xcc83('0xb')](',')+_0xcc83('0x2d'),squel[_0xcc83('0x7')]()[_0xcc83('0x1c')](_0x3a21a2)[_0xcc83('0xa')]('cm_contacts')[_0xcc83('0x1f')](_0xcc83('0x29'),_0x1307c6))[_0xcc83('0x1f')](_0xcc83('0x2e'),squel[_0xcc83('0x7')]()[_0xcc83('0x8')](_0xcc83('0x2f'),'min_id')['from'](_0x207a88)['group'](_0x3a21a2['join'](','))))[_0xcc83('0x24')]();}function handleStop(){logger[_0xcc83('0x30')](_0xcc83('0x31'));stopped=!![];}function handleUncaughtException(_0x2b2e1f){logger[_0xcc83('0x32')](_0x2b2e1f[_0xcc83('0x33')]);process['exit'](0x1);}function handleError(_0x5124c4,_0x6c3501){stats['errors'][_0xcc83('0x34')]({'name':_0x6c3501['code'],'message':_0x6c3501[_0xcc83('0x33')],'row':_0x5124c4});}function handleQuery(_0x5a7839){logger[_0xcc83('0x30')](_0x5a7839);return db['sequelize']['query'](_0x5a7839)[_0xcc83('0x35')](function(_0x447abf){results['push'](_0x447abf);})['catch'](function(_0x14f7d8){logger[_0xcc83('0x32')](_0x14f7d8[_0xcc83('0x33')]);});}function main(_0x762c0f,_0x239fd6,_0x1c09d7,_0x762f0f){logger[_0xcc83('0x30')]('main',_0x762c0f,JSON[_0xcc83('0x36')](_0x239fd6));process[_0xcc83('0x37')](_0xcc83('0x38'));var _0xb7709a=_0x239fd6['binding'];var _0x42e001=_0x239fd6[_0xcc83('0x39')];var _0x2269ac=path[_0xcc83('0xb')](config[_0xcc83('0x3a')],_0xcc83('0x3b'),_0x42e001+'.csv');var _0x1f757b=_[_0xcc83('0x2c')](_0xb7709a)[_0xcc83('0xb')]();logger[_0xcc83('0x30')](_0xcc83('0x3c'),_0x1f757b);fs[_0xcc83('0x3d')](_0x2269ac,_0x1f757b+'\x0a');Papa[_0xcc83('0x3e')](fs[_0xcc83('0x3f')](_0x762c0f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2316a8,_0x3bb8fa){try{for(var _0x506d5a=0x0,_0x3b4f9a=[];_0x506d5a<_0x2316a8[_0xcc83('0x40')][_0xcc83('0x41')];_0x506d5a++){stats[_0xcc83('0x42')]+=0x1;if(_0x2316a8['errors'][_0x506d5a]){handleError(_0x2316a8['data'][_0x506d5a],_0x2316a8[_0xcc83('0x43')][_0x506d5a]);}else{var _0x4abd40=[];for(var _0x3090b0 in _0xb7709a){if(_0xb7709a[_0xcc83('0x44')](_0x3090b0)){if(_0x2316a8[_0xcc83('0x40')][_0x506d5a][_0xb7709a[_0x3090b0]]){var _0x36707d=_[_0xcc83('0x45')](_0x2316a8['data'][_0x506d5a][_0xb7709a[_0x3090b0]]['replace'](/"/g,'\x27'));switch(_0x3090b0){case'scheduledat':var _0x45a497=moment(_0x36707d,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x45a497['isValid']()){_0x3b4f9a[_0xcc83('0x34')]('\x22'+_0x36707d+'\x22');}else{_0x4abd40[_0xcc83('0x34')](_0xcc83('0x46'));}break;case'priority':var _0x221d49=parseInt(_0x36707d);_0x36707d=_[_0xcc83('0x47')](_0x221d49)||_0x221d49<0x0||_0x221d49>0x4?_0x762f0f?0x3:0x2:_0x221d49;_0x3b4f9a['push']('\x22'+_0x36707d+'\x22');break;case _0xcc83('0x48'):var _0x4b47d8=parseInt(_0x36707d);if(_[_0xcc83('0x49')](_0x4b47d8)&&_['includes'](_0x1c09d7,_0x4b47d8)){_0x3b4f9a['push']('\x22'+_0x4b47d8+'\x22');}else{_0x4abd40[_0xcc83('0x34')](_0xcc83('0x4a'));}break;case _0xcc83('0x4b'):if(isEmail(_0x36707d)){_0x3b4f9a['push']('\x22'+_0x36707d+'\x22');}else{_0x4abd40[_0xcc83('0x34')](_0xcc83('0x4c'));}break;case _0xcc83('0x4d'):var _0x5ccf43=moment(_0x36707d,_0xcc83('0x4e'),!![]);if(_0x5ccf43[_0xcc83('0x4f')]()){_0x3b4f9a[_0xcc83('0x34')]('\x22'+_0x36707d+'\x22');}else{_0x4abd40[_0xcc83('0x34')](_0xcc83('0x50'));}break;default:_0x3b4f9a[_0xcc83('0x34')]('\x22'+_0x36707d+'\x22');}}else{switch(_0x3090b0){case'firstName':case _0xcc83('0x9'):_0x4abd40[_0xcc83('0x34')](_0x3090b0+_0xcc83('0x51'));break;default:_0x3b4f9a[_0xcc83('0x34')]('\x22\x22');}}}}if(_0x4abd40[_0xcc83('0x41')]){handleError(_0x2316a8[_0xcc83('0x40')][_0x506d5a],{'code':_0xcc83('0x52'),'message':_0x4abd40['join']()});}else{fs[_0xcc83('0x53')](_0x2269ac,_0x3b4f9a[_0xcc83('0xb')]()+'\x0a');}_0x3b4f9a=[];}if(!(stats[_0xcc83('0x42')]%0xc8)){socket[_0xcc83('0x54')](_0xcc83('0x55')+_0x42e001,stats);stats[_0xcc83('0x43')]=[];}}if(stopped){logger[_0xcc83('0x30')]('Abort\x20parser');_0x3bb8fa[_0xcc83('0x56')]();}}catch(_0x5a16d6){handleError(_0x2316a8[_0xcc83('0x40')][_0x506d5a],{'code':_0xcc83('0x57'),'message':_0x5a16d6[_0xcc83('0x33')]});logger['error'](_0xcc83('0x58'),_0x5a16d6['message']);}},'complete':function(){try{var _0x24aa7a=[];var _0x47250f='cm_contacts';if(_0x239fd6[_0xcc83('0x59')]&&_0x239fd6[_0xcc83('0x59')][_0xcc83('0x41')]){_0x47250f='cm_contacts_'+_0x42e001;_0x24aa7a[_0xcc83('0x34')]('CREATE\x20TABLE\x20'+_0x47250f+_0xcc83('0x5a'));}var _0x1fe4a6=util[_0xcc83('0x5b')](_0xcc83('0x5c'),_0x2269ac,_0x47250f,_0x1f757b,_0x239fd6['ListId'],_0x239fd6[_0xcc83('0x5d')]||null,NOW,NOW);if(_['isNil'](_0xb7709a[_0xcc83('0x18')])){_0x1fe4a6+=',\x20scheduledAt\x20=\x20NOW()';}_0x24aa7a[_0xcc83('0x34')](_0x1fe4a6);if(_0x239fd6[_0xcc83('0x59')]&&_0x239fd6[_0xcc83('0x59')][_0xcc83('0x41')]){_0x24aa7a[_0xcc83('0x34')](insertCmContact(_0x239fd6[_0xcc83('0x26')],_0x47250f,_0x239fd6[_0xcc83('0x59')],_0xb7709a));_0x24aa7a['push']('DROP\x20TABLE\x20'+_0x47250f+';');}_0x24aa7a[_0xcc83('0x34')](insertCmHopper(_0x239fd6[_0xcc83('0x26')],_0xcc83('0x5e'),_0xcc83('0x5f'),'VoiceQueueId',_0x762f0f));_0x24aa7a[_0xcc83('0x34')](insertCmHopperBlack(_0x239fd6[_0xcc83('0x26')],'voice_queues_has_cm_blacklists',_0xcc83('0x5f'),_0xcc83('0x60')));_0x24aa7a[_0xcc83('0x34')](insertCmHopper(_0x239fd6['ListId'],'campaigns_has_cm_lists','campaigns',_0xcc83('0x61'),_0x762f0f));_0x24aa7a[_0xcc83('0x34')](insertCmHopperBlack(_0x239fd6[_0xcc83('0x26')],'campaigns_has_cm_blacklists',_0xcc83('0x62'),_0xcc83('0x61')));BPromise[_0xcc83('0x63')](_0x24aa7a,handleQuery)[_0xcc83('0x64')](function(_0x353367){stats[_0xcc83('0x65')]=!![];stats[_0xcc83('0x66')]=_0x239fd6[_0xcc83('0x59')]&&_0x239fd6['duplicates']['length']?results[0x2]['affectedRows']:results[0x0][_0xcc83('0x66')];socket[_0xcc83('0x54')](_0xcc83('0x55')+_0x42e001,stats);fs['unlink'](_0x762c0f);fs[_0xcc83('0x67')](_0x2269ac);process['exit'](0x0);})[_0xcc83('0x68')](function(_0x5b2ac7){logger[_0xcc83('0x32')](_0x5b2ac7[_0xcc83('0x33')]);process[_0xcc83('0x69')](0x1);});}catch(_0x20bf19){logger['error'](_0xcc83('0x6a'),_0x20bf19[_0xcc83('0x33')]);process[_0xcc83('0x69')](0x1);}},'error':function(_0x474b91,_0x3d2ad2,_0x55834f,_0x3acdae){throw new Error(_0x3acdae);}});}function validate(){if(process['argv']&&process[_0xcc83('0x6b')][_0xcc83('0x41')]<0x4){throw new Error(_0xcc83('0x6c'));}var _0x107436=path[_0xcc83('0xb')](config[_0xcc83('0x3a')],'server/files/tmp',process[_0xcc83('0x6b')][0x2]);if(!fs['existsSync'](_0x107436)){throw new Error('file\x20doesn\x27t\x20exists');}var _0xfa46ea={};try{_0xfa46ea=JSON['parse'](process['argv'][0x3]);if(!_0xfa46ea[_0xcc83('0x6d')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0xfa46ea['binding'][_0xcc83('0x9')]){throw new Error(_0xcc83('0x6e'));}if(!_0xfa46ea['binding'][_0xcc83('0x6f')]){throw new Error(_0xcc83('0x70'));}var _0x2c3ca8=0x0;if(_0xfa46ea[_0xcc83('0x6d')][_0xcc83('0x48')]){_0x2c3ca8=0x1;}if(!_0xfa46ea[_0xcc83('0x26')]){throw new Error(_0xcc83('0x71'));}}catch(_0x40941e){throw new Error(_0xcc83('0x72'));}var _0x1c5957=[];try{_0x1c5957=_[_0xcc83('0x73')](JSON['parse'](process[_0xcc83('0x6b')][0x4]),'id');}catch(_0xfeac3b){logger[_0xcc83('0x30')](_0xcc83('0x74'));}main(_0x107436,_0xfa46ea,_0x1c5957,_0x2c3ca8);}validate();process['on'](_0xcc83('0x75'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
index 968982d..4055bac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec56=['Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','membername','starttime','endtime','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname'];(function(_0x31eb1b,_0x45abde){var _0x5b9db2=function(_0x174a0b){while(--_0x174a0b){_0x31eb1b['push'](_0x31eb1b['shift']());}};_0x5b9db2(++_0x45abde);}(_0xec56,0x1bd));var _0x6ec5=function(_0x4ae31d,_0x4ddb52){_0x4ae31d=_0x4ae31d-0x0;var _0x279dff=_0xec56[_0x4ae31d];return _0x279dff;};'use strict';exports[_0x6ec5('0x0')]=function(_0x546db0,_0x4d6dcd){var _0x10a273=[{'type':_0x6ec5('0x1'),'content':_0x6ec5('0x2'),'variableName':null}];switch(_0x546db0[_0x6ec5('0x3')]()){case _0x6ec5('0x4'):switch(_0x4d6dcd[_0x6ec5('0x3')]()){case _0x6ec5('0x5'):_0x10a273[_0x6ec5('0x6')]({'type':_0x6ec5('0x7'),'content':'','variableName':_0x6ec5('0x8')});_0x10a273[_0x6ec5('0x6')]({'type':_0x6ec5('0x7'),'content':'','variableName':_0x6ec5('0x9')});break;case _0x6ec5('0xa'):_0x10a273[_0x6ec5('0x6')]({'type':_0x6ec5('0x1'),'content':_0x6ec5('0xb'),'variableName':null});_0x10a273[_0x6ec5('0x6')]({'type':_0x6ec5('0x7'),'content':'','variableName':'destcalleridnum'});break;}}return _0x10a273;};exports[_0x6ec5('0xc')]=function(_0x3ef4f6,_0x444093){var _0x1964ae=[];switch(_0x3ef4f6[_0x6ec5('0x3')]()){case _0x6ec5('0x4'):switch(_0x444093[_0x6ec5('0x3')]()){case'inbound':_0x1964ae=[{'type':_0x6ec5('0x1'),'content':_0x6ec5('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x6ec5('0xe'),'content':'','key':_0x6ec5('0xf'),'keyType':_0x6ec5('0x7'),'variableName':_0x6ec5('0x9')},{'type':_0x6ec5('0xe'),'content':'','key':_0x6ec5('0x10'),'keyType':'variable','variableName':_0x6ec5('0x11')},{'type':'keyValue','content':'','key':_0x6ec5('0x12'),'keyType':_0x6ec5('0x7'),'variableName':_0x6ec5('0x13')},{'type':_0x6ec5('0xe'),'content':'','key':_0x6ec5('0x14'),'keyType':'variable','variableName':_0x6ec5('0x8')},{'type':_0x6ec5('0xe'),'content':'','key':_0x6ec5('0x15'),'keyType':_0x6ec5('0x7'),'variableName':_0x6ec5('0x16')},{'type':_0x6ec5('0xe'),'content':'','key':_0x6ec5('0x17'),'keyType':_0x6ec5('0x7'),'variableName':_0x6ec5('0x18')},{'type':_0x6ec5('0x1'),'content':_0x6ec5('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0x6ec5('0xe'),'content':'','key':_0x6ec5('0x1a'),'keyType':_0x6ec5('0x7'),'variableName':_0x6ec5('0x1b')},{'type':_0x6ec5('0xe'),'content':'','key':_0x6ec5('0x1c'),'keyType':'variable','variableName':_0x6ec5('0x1d')},{'type':_0x6ec5('0x1'),'content':_0x6ec5('0x1e'),'key':null,'keyType':null,'variableName':null},{'type':_0x6ec5('0xe'),'content':'','key':_0x6ec5('0x1f'),'keyType':_0x6ec5('0x7'),'variableName':_0x6ec5('0x18')},{'type':'keyValue','content':'','key':_0x6ec5('0x20'),'keyType':_0x6ec5('0x7'),'variableName':_0x6ec5('0x21')},{'type':_0x6ec5('0xe'),'content':'','key':'Agent\x20Complete','keyType':_0x6ec5('0x7'),'variableName':_0x6ec5('0x22')},{'type':'keyValue','content':'','key':_0x6ec5('0x23'),'keyType':_0x6ec5('0x7'),'variableName':_0x6ec5('0x24')},{'type':'keyValue','content':'','key':_0x6ec5('0x25'),'keyType':_0x6ec5('0x7'),'variableName':_0x6ec5('0x26')}];break;case _0x6ec5('0xa'):_0x1964ae=[{'type':_0x6ec5('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x6ec5('0xe'),'content':'','key':_0x6ec5('0x27'),'keyType':'variable','keyContent':'','variableName':_0x6ec5('0x1d')},{'type':_0x6ec5('0xe'),'content':'','key':'Member\x20Name','keyType':_0x6ec5('0x7'),'keyContent':'','variableName':_0x6ec5('0x28')},{'type':_0x6ec5('0xe'),'content':'','key':_0x6ec5('0x15'),'keyType':_0x6ec5('0x7'),'keyContent':'','variableName':'uniqueid'},{'type':_0x6ec5('0xe'),'content':'','key':_0x6ec5('0x17'),'keyType':_0x6ec5('0x7'),'keyContent':'','variableName':_0x6ec5('0x29')},{'type':_0x6ec5('0x1'),'content':_0x6ec5('0x1e')},{'type':_0x6ec5('0xe'),'content':'','key':'Answer\x20Time','keyType':_0x6ec5('0x7'),'keyContent':'','variableName':'answertime'},{'type':_0x6ec5('0xe'),'content':'','key':'Complete\x20Time','keyType':_0x6ec5('0x7'),'keyContent':'','variableName':_0x6ec5('0x2a')}];break;}}return _0x1964ae;};
\ No newline at end of file
+var _0x00bb=['***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','talktime','Called\x20Number','Member\x20Name','starttime','Answer\x20Time','answertime','endtime','getSubjects','string','toLowerCase','voice','inbound','push','variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','Call\x20To','Queue','UniqueId','uniqueid','Date','agentcalledAt'];(function(_0x4c0f43,_0x2f0750){var _0x2c4277=function(_0x1bd056){while(--_0x1bd056){_0x4c0f43['push'](_0x4c0f43['shift']());}};_0x2c4277(++_0x2f0750);}(_0x00bb,0x1d8));var _0xb00b=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x00bb[_0x56482c];return _0x5aae7a;};'use strict';exports[_0xb00b('0x0')]=function(_0x25ec18,_0x468a51){var _0x54f40d=[{'type':_0xb00b('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x25ec18[_0xb00b('0x2')]()){case _0xb00b('0x3'):switch(_0x468a51['toLowerCase']()){case _0xb00b('0x4'):_0x54f40d[_0xb00b('0x5')]({'type':'variable','content':'','variableName':'queue'});_0x54f40d['push']({'type':_0xb00b('0x6'),'content':'','variableName':_0xb00b('0x7')});break;case _0xb00b('0x8'):_0x54f40d[_0xb00b('0x5')]({'type':_0xb00b('0x1'),'content':_0xb00b('0x9'),'variableName':null});_0x54f40d['push']({'type':'variable','content':'','variableName':_0xb00b('0xa')});break;}}return _0x54f40d;};exports[_0xb00b('0xb')]=function(_0x5851d4,_0x46a25c){var _0x28d3cc=[];switch(_0x5851d4['toLowerCase']()){case _0xb00b('0x3'):switch(_0x46a25c['toLowerCase']()){case'inbound':_0x28d3cc=[{'type':'string','content':_0xb00b('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xb00b('0xd'),'content':'','key':_0xb00b('0xe'),'keyType':_0xb00b('0x6'),'variableName':_0xb00b('0x7')},{'type':_0xb00b('0xd'),'content':'','key':'Caller\x20Name','keyType':_0xb00b('0x6'),'variableName':_0xb00b('0xf')},{'type':'keyValue','content':'','key':_0xb00b('0x10'),'keyType':_0xb00b('0x6'),'variableName':'destexten'},{'type':'keyValue','content':'','key':_0xb00b('0x11'),'keyType':'variable','variableName':'queue'},{'type':_0xb00b('0xd'),'content':'','key':_0xb00b('0x12'),'keyType':_0xb00b('0x6'),'variableName':_0xb00b('0x13')},{'type':'keyValue','content':'','key':_0xb00b('0x14'),'keyType':'variable','variableName':_0xb00b('0x15')},{'type':'string','content':_0xb00b('0x16'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xb00b('0x17'),'keyType':_0xb00b('0x6'),'variableName':'destcalleridname'},{'type':'keyValue','content':'','key':_0xb00b('0x18'),'keyType':'variable','variableName':_0xb00b('0xa')},{'type':_0xb00b('0x1'),'content':_0xb00b('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xb00b('0xd'),'content':'','key':'Agent\x20Ring','keyType':_0xb00b('0x6'),'variableName':'agentcalledAt'},{'type':_0xb00b('0xd'),'content':'','key':_0xb00b('0x1a'),'keyType':'variable','variableName':_0xb00b('0x1b')},{'type':_0xb00b('0xd'),'content':'','key':'Agent\x20Complete','keyType':_0xb00b('0x6'),'variableName':_0xb00b('0x1c')},{'type':'keyValue','content':'','key':_0xb00b('0x1d'),'keyType':_0xb00b('0x6'),'variableName':_0xb00b('0x1e')},{'type':_0xb00b('0xd'),'content':'','key':'Talk\x20Time','keyType':'variable','variableName':_0xb00b('0x1f')}];break;case'outbound':_0x28d3cc=[{'type':'string','content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0xb00b('0xd'),'content':'','key':_0xb00b('0x20'),'keyType':_0xb00b('0x6'),'keyContent':'','variableName':_0xb00b('0xa')},{'type':_0xb00b('0xd'),'content':'','key':_0xb00b('0x21'),'keyType':_0xb00b('0x6'),'keyContent':'','variableName':'membername'},{'type':_0xb00b('0xd'),'content':'','key':'UniqueId','keyType':_0xb00b('0x6'),'keyContent':'','variableName':_0xb00b('0x13')},{'type':_0xb00b('0xd'),'content':'','key':'Date','keyType':_0xb00b('0x6'),'keyContent':'','variableName':_0xb00b('0x22')},{'type':_0xb00b('0x1'),'content':_0xb00b('0x19')},{'type':_0xb00b('0xd'),'content':'','key':_0xb00b('0x23'),'keyType':_0xb00b('0x6'),'keyContent':'','variableName':_0xb00b('0x24')},{'type':_0xb00b('0xd'),'content':'','key':'Complete\x20Time','keyType':_0xb00b('0x6'),'keyContent':'','variableName':_0xb00b('0x25')}];break;}}return _0x28d3cc;};
\ No newline at end of file
index c461f2d..b801172 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02b9=['mail-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','update','then','catch','error','tracked','user','query','body','omit','phone','fax','lodash','../../config/logger','openchannel-interactions'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x02b9,0x115));var _0x902b=function(_0x3215e4,_0x3d2838){_0x3215e4=_0x3215e4-0x0;var _0x4b648f=_0x02b9[_0x3215e4];return _0x4b648f;};'use strict';var _=require(_0x902b('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x902b('0x1'))(_0x902b('0x2')),'mail':require(_0x902b('0x1'))(_0x902b('0x3')),'fax':require(_0x902b('0x1'))('fax-interactions'),'sms':require(_0x902b('0x1'))('sms-interactions'),'chat':require(_0x902b('0x1'))(_0x902b('0x4'))};function getInteractionId(_0x33e103,_0x38fd55,_0x40a449){if(_0x33e103&&_0x33e103[_[_0x902b('0x5')](_0x40a449)+_0x902b('0x6')]){return _0x33e103[_[_0x902b('0x5')](_0x40a449)+_0x902b('0x6')];}else if(_0x33e103&&_0x33e103['id']){return _0x33e103['id'];}else if(_0x38fd55&&_0x38fd55['id']){return _0x38fd55['id'];}else{return _0x902b('0x7');}}function log(_0x507333,_0x1b4a0f,_0x3b8a2c,_0x46780f,_0x5c1a31,_0x186b23){loggers[_0x5c1a31[_0x902b('0x8')]()][_0x507333](_0x902b('0x9'),_0x186b23[_0x902b('0xa')](),_0x1b4a0f?_0x1b4a0f['id']:null,_0x1b4a0f?_0x1b4a0f[_0x902b('0xb')]:null,_0x1b4a0f?_0x1b4a0f[_0x902b('0xc')]:null,getInteractionId(_0x3b8a2c,_0x46780f,_0x5c1a31),_0x3b8a2c?JSON[_0x902b('0xd')](_0x3b8a2c):_0x902b('0xe'));}function updateUser(_0x58808f,_0x117ba6,_0x2b5cca,_0x3f44a4,_0x104a10){db[_[_0x902b('0x5')](_0x3f44a4)+_0x902b('0xf')][_0x902b('0x10')]({'where':{'id':getInteractionId(_0x117ba6,_0x2b5cca,_0x3f44a4)}})['then'](function(_0x464970){if(_0x464970){return _0x464970[_0x902b('0x11')]({'UserId':_0x58808f?_0x58808f['id']:null});}})[_0x902b('0x12')](function(_0x4f76f1){if(_0x4f76f1){log('info',_0x58808f,_0x117ba6,_0x2b5cca,_0x3f44a4,_0x104a10);}})[_0x902b('0x13')](function(){log(_0x902b('0x14'),_0x58808f,_0x117ba6,_0x2b5cca,_0x3f44a4,_0x104a10);});}exports[_0x902b('0x15')]=function(_0x1da22f,_0x510975){return function(_0x6e9561,_0x15d679,_0x3142ff){var _0x336bed=_0x6e9561[_0x902b('0x16')];var _0x15d6e8={};var _0x3e796a=_0x6e9561[_0x902b('0x17')];if(_0x15d6e8){_0x15d6e8=_['clone'](_0x6e9561[_0x902b('0x18')]);_0x15d6e8=_[_0x902b('0x19')](_0x15d6e8,[_0x902b('0x18'),'html',_0x902b('0x1a'),_0x902b('0x1b'),'mobile']);}updateUser(_0x336bed,_0x15d6e8,_0x3e796a,_0x1da22f,_0x510975);_0x3142ff(null);};};
\ No newline at end of file
+var _0x5386=['html','lodash','../../mysqldb','../../config/logger','openchannel-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','Interaction','findOne','then','update','info','catch','user','body','omit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5386,0x1b6));var _0x6538=function(_0x4147ff,_0x154530){_0x4147ff=_0x4147ff-0x0;var _0x1e71e6=_0x5386[_0x4147ff];return _0x1e71e6;};'use strict';var _=require(_0x6538('0x0'));var db=require(_0x6538('0x1'))['db'];var loggers={'openchannel':require(_0x6538('0x2'))(_0x6538('0x3')),'mail':require(_0x6538('0x2'))('mail-interactions'),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0x6538('0x2'))(_0x6538('0x4')),'chat':require(_0x6538('0x2'))(_0x6538('0x5'))};function getInteractionId(_0x536882,_0x3f5ae1,_0x312ed6){if(_0x536882&&_0x536882[_[_0x6538('0x6')](_0x312ed6)+_0x6538('0x7')]){return _0x536882[_[_0x6538('0x6')](_0x312ed6)+_0x6538('0x7')];}else if(_0x536882&&_0x536882['id']){return _0x536882['id'];}else if(_0x3f5ae1&&_0x3f5ae1['id']){return _0x3f5ae1['id'];}else{return _0x6538('0x8');}}function log(_0x1aef69,_0x56cae2,_0x45b7d1,_0x4c967a,_0x37539a,_0x5761b0){loggers[_0x37539a[_0x6538('0x9')]()][_0x1aef69](_0x6538('0xa'),_0x5761b0['toUpperCase'](),_0x56cae2?_0x56cae2['id']:null,_0x56cae2?_0x56cae2['name']:null,_0x56cae2?_0x56cae2[_0x6538('0xb')]:null,getInteractionId(_0x45b7d1,_0x4c967a,_0x37539a),_0x45b7d1?JSON[_0x6538('0xc')](_0x45b7d1):'null');}function updateUser(_0x396aa8,_0x1fc778,_0x4ae14c,_0x3cd494,_0x348793){db[_['upperFirst'](_0x3cd494)+_0x6538('0xd')][_0x6538('0xe')]({'where':{'id':getInteractionId(_0x1fc778,_0x4ae14c,_0x3cd494)}})[_0x6538('0xf')](function(_0x3055d7){if(_0x3055d7){return _0x3055d7[_0x6538('0x10')]({'UserId':_0x396aa8?_0x396aa8['id']:null});}})[_0x6538('0xf')](function(_0x2d4af7){if(_0x2d4af7){log(_0x6538('0x11'),_0x396aa8,_0x1fc778,_0x4ae14c,_0x3cd494,_0x348793);}})[_0x6538('0x12')](function(){log('error',_0x396aa8,_0x1fc778,_0x4ae14c,_0x3cd494,_0x348793);});}exports['tracked']=function(_0x401677,_0x53f016){return function(_0x596b23,_0x58ad75,_0x3e1f72){var _0x2ec4fa=_0x596b23[_0x6538('0x13')];var _0x2afba5={};var _0x3e8260=_0x596b23['query'];if(_0x2afba5){_0x2afba5=_['clone'](_0x596b23[_0x6538('0x14')]);_0x2afba5=_[_0x6538('0x15')](_0x2afba5,[_0x6538('0x14'),_0x6538('0x16'),'phone','fax','mobile']);}updateUser(_0x2ec4fa,_0x2afba5,_0x3e8260,_0x401677,_0x53f016);_0x3e1f72(null);};};
\ No newline at end of file
index 04165c8..f172813 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18cc=['admin','user','isUserLimit','crypto','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format','base64','utf8','final','parse','hasOwnProperty','License','findOne','count','then','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x18cc,0x116));var _0xc18c=function(_0x4ae6e5,_0x4b69d8){_0x4ae6e5=_0x4ae6e5-0x0;var _0x20abed=_0x18cc[_0x4ae6e5];return _0x20abed;};'use strict';var crypto=require(_0xc18c('0x0'));var util=require('util');var compose=require('composable-middleware');var db=require(_0xc18c('0x1'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x70042d,_0x4b0ed0){if(_0x70042d&&_0x4b0ed0){if(_0x4b0ed0[_0xc18c('0x2')]&&_0x4b0ed0[_0xc18c('0x3')]){var _0x22f1e6=_0x4b0ed0['data1'];var _0x260f5c=_0x4b0ed0[_0xc18c('0x3')];var _0x23395c=_0x22f1e6['split']('-')[0x4];var _0x334eea=_0x22f1e6[_0xc18c('0x4')]('-')[0x0];var _0x1b058f=crypto[_0xc18c('0x5')](_0xc18c('0x6'),util[_0xc18c('0x7')]('%s:%s:%s',_0x23395c,_0x22f1e6,_0x334eea));var _0x1ec9fd=_0x1b058f['update'](_0x260f5c,_0xc18c('0x8'),_0xc18c('0x9'));_0x1ec9fd+=_0x1b058f[_0xc18c('0xa')](_0xc18c('0x9'));var _0x30e163=JSON[_0xc18c('0xb')](_0x1ec9fd);return _0x30e163[_0xc18c('0xc')](_0x70042d)?_0x30e163[_0x70042d]:null;}}return null;}function isLimit(_0x3ec59c,_0x73031e,_0x351593,_0x426b5a){var _0x419e40=_0x73031e;return compose()['use'](function(_0x4c66a2,_0x58d908,_0x369f9f){return db[_0xc18c('0xd')][_0xc18c('0xe')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x5c6113){var _0x2ea6ca=getValueFromLicense(_0x3ec59c,_0x5c6113);return _0x2ea6ca?_0x2ea6ca:_0x419e40;})['then'](function(_0x598f60){_0x419e40=_0x598f60;return _0x351593[_0xc18c('0xf')](_0x426b5a);})[_0xc18c('0x10')](function(_0x2e9d57){if(_0x2e9d57>=_0x419e40){return _0x58d908[_0xc18c('0x11')](0x193)['json']({'message':util[_0xc18c('0x7')](_0xc18c('0x12'),_0x3ec59c)});}_0x369f9f();})[_0xc18c('0x13')](function(_0x48bc4a){_0x369f9f(_0x48bc4a);});});}function isUserLimit(){return isLimit(_0xc18c('0x14'),0x1,db[_0xc18c('0x15')],{'where':{'$or':[{'role':_0xc18c('0x16')},{'role':_0xc18c('0x17')}]}});}exports[_0xc18c('0x18')]=isUserLimit;
\ No newline at end of file
+var _0x7ebf=['split','createDecipher','aes-256-ctr','format','update','final','parse','hasOwnProperty','findOne','then','status','catch','users','User','admin','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0x7ebf,0x153));var _0xf7eb=function(_0x68f4a6,_0x4ffa13){_0x68f4a6=_0x68f4a6-0x0;var _0x4ab1ed=_0x7ebf[_0x68f4a6];return _0x4ab1ed;};'use strict';var crypto=require(_0xf7eb('0x0'));var util=require(_0xf7eb('0x1'));var compose=require('composable-middleware');var db=require(_0xf7eb('0x2'))['db'];var config=require(_0xf7eb('0x3'));function getValueFromLicense(_0x190427,_0x1903fe){if(_0x190427&&_0x1903fe){if(_0x1903fe[_0xf7eb('0x4')]&&_0x1903fe[_0xf7eb('0x5')]){var _0x141527=_0x1903fe[_0xf7eb('0x4')];var _0x9496e7=_0x1903fe['license'];var _0x2d3334=_0x141527[_0xf7eb('0x6')]('-')[0x4];var _0xc78635=_0x141527[_0xf7eb('0x6')]('-')[0x0];var _0x17b748=crypto[_0xf7eb('0x7')](_0xf7eb('0x8'),util[_0xf7eb('0x9')]('%s:%s:%s',_0x2d3334,_0x141527,_0xc78635));var _0x174432=_0x17b748[_0xf7eb('0xa')](_0x9496e7,'base64','utf8');_0x174432+=_0x17b748[_0xf7eb('0xb')]('utf8');var _0x5a0055=JSON[_0xf7eb('0xc')](_0x174432);return _0x5a0055[_0xf7eb('0xd')](_0x190427)?_0x5a0055[_0x190427]:null;}}return null;}function isLimit(_0x48461f,_0x3ccf7d,_0x2d58fc,_0x4ad386){var _0x39eefe=_0x3ccf7d;return compose()['use'](function(_0x4f15a8,_0x24eb54,_0x1c019b){return db['License'][_0xf7eb('0xe')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x5962d8){var _0x91e683=getValueFromLicense(_0x48461f,_0x5962d8);return _0x91e683?_0x91e683:_0x39eefe;})['then'](function(_0x1c2b1c){_0x39eefe=_0x1c2b1c;return _0x2d58fc['count'](_0x4ad386);})[_0xf7eb('0xf')](function(_0x590de8){if(_0x590de8>=_0x39eefe){return _0x24eb54[_0xf7eb('0x10')](0x193)['json']({'message':util[_0xf7eb('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x48461f)});}_0x1c019b();})[_0xf7eb('0x11')](function(_0x5a099c){_0x1c019b(_0x5a099c);});});}function isUserLimit(){return isLimit(_0xf7eb('0x12'),0x1,db[_0xf7eb('0x13')],{'where':{'$or':[{'role':_0xf7eb('0x14')},{'role':_0xf7eb('0x15')}]}});}exports[_0xf7eb('0x16')]=isUserLimit;
\ No newline at end of file
index 5e39287..8796058 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4a2=['offset','sort','split','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','isArray','isString','hasOwnProperty','lodash','sequelize','filters','isEmpty','forOwn','limit'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0xe4a2,0x144));var _0x2e4a=function(_0xb393ca,_0x419586){_0xb393ca=_0xb393ca-0x0;var _0x25e148=_0xe4a2[_0xb393ca];return _0x25e148;};'use strict';var _=require(_0x2e4a('0x0'));var sequelize=require(_0x2e4a('0x1'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x2be6d3){var _0x4dd116=null;if(_0x2be6d3){_0x4dd116=_0x2be6d3['split'](',');}return _0x4dd116;};exports[_0x2e4a('0x2')]=function(_0x1303d7){var _0x2255d8={};if(!_[_0x2e4a('0x3')](_0x1303d7)){_0x2255d8={};_[_0x2e4a('0x4')](_0x1303d7,function(_0x4ee7ca,_0x512320){try{_0x2255d8[_0x512320]=JSON['parse'](_0x4ee7ca);}catch(_0xb883e8){_0x2255d8[_0x512320]=_0x4ee7ca['split'](',');}});}return _0x2255d8;};exports[_0x2e4a('0x5')]=function(_0x481cbc){_0x481cbc=parseInt(_0x481cbc,0xa);if(!_0x481cbc||_0x481cbc<0x0){_0x481cbc=LIMIT_VALUE;}return _0x481cbc;};exports[_0x2e4a('0x6')]=function(_0x291e74){_0x291e74=parseInt(_0x291e74,0xa);if(!_0x291e74||_0x291e74<0x0){_0x291e74=0x0;}return _0x291e74;};exports[_0x2e4a('0x7')]=function(_0x3cd7a1){var _0xcb4d86,_0xb0c77=null;if(_0x3cd7a1){_0xcb4d86=_0x3cd7a1[_0x2e4a('0x8')](',');_0xb0c77=_[_0x2e4a('0x9')](_0xcb4d86,function(_0x1fc3e8){if(_0x1fc3e8[_0x2e4a('0xa')]('-')===0x0){return[_0x1fc3e8===_0x2e4a('0xb')?sequelize[_0x2e4a('0xc')](sequelize[_0x2e4a('0xd')](_0x2e4a('0xb')),_0x2e4a('0xe')):_0x1fc3e8[_0x2e4a('0xf')](0x1),_0x2e4a('0x10')];}else{return[_0x1fc3e8===_0x2e4a('0xb')?sequelize[_0x2e4a('0xc')](sequelize[_0x2e4a('0xd')]('priority'),_0x2e4a('0xe')):_0x1fc3e8,_0x2e4a('0x11')];}});}return _0xb0c77;};exports[_0x2e4a('0x12')]=function(_0x56e7fd,_0x1a0a77){if(_['isEmpty'](_0x56e7fd)){return _0x56e7fd;}if(_[_0x2e4a('0x13')](_0x56e7fd)){for(var _0x5ce14b=0x0;_0x5ce14b<_0x56e7fd['length'];_0x5ce14b+=0x1){_0x56e7fd[_0x5ce14b]=this[_0x2e4a('0x12')](_0x56e7fd[_0x5ce14b],_0x1a0a77);}return _0x56e7fd;}if(!_['isObject'](_0x56e7fd)){return _0x56e7fd;}if(_[_0x2e4a('0x14')](_0x1a0a77)){_0x1a0a77=[_0x1a0a77];}if(!_[_0x2e4a('0x13')](_0x1a0a77)){return _0x56e7fd;}for(var _0x5a9b0e=0x0;_0x5a9b0e<_0x1a0a77['length'];_0x5a9b0e+=0x1){_['unset'](_0x56e7fd,_0x1a0a77[_0x5a9b0e]);}for(var _0x215ec1 in _0x56e7fd){if(_0x56e7fd[_0x2e4a('0x15')](_0x215ec1)){_0x56e7fd[_0x215ec1]=this['omit'](_0x56e7fd[_0x215ec1],_0x1a0a77);}}return _0x56e7fd;};
\ No newline at end of file
+var _0xc64b=['col','priority','substr','DESC','cast','unsigned','ASC','omit','length','isObject','isString','unset','fields','filters','isEmpty','forOwn','parse','split','limit','offset','sort','map','indexOf'];(function(_0x3c0080,_0x5ec1c9){var _0x237f6d=function(_0x306031){while(--_0x306031){_0x3c0080['push'](_0x3c0080['shift']());}};_0x237f6d(++_0x5ec1c9);}(_0xc64b,0x1c1));var _0xbc64=function(_0xf26bf5,_0x3835fb){_0xf26bf5=_0xf26bf5-0x0;var _0x30e480=_0xc64b[_0xf26bf5];return _0x30e480;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var LIMIT_VALUE=0xfa;exports[_0xbc64('0x0')]=function(_0x2717ec){var _0x4eca2d=null;if(_0x2717ec){_0x4eca2d=_0x2717ec['split'](',');}return _0x4eca2d;};exports[_0xbc64('0x1')]=function(_0x413bcb){var _0x4e6597={};if(!_[_0xbc64('0x2')](_0x413bcb)){_0x4e6597={};_[_0xbc64('0x3')](_0x413bcb,function(_0x4fabc9,_0x4179cc){try{_0x4e6597[_0x4179cc]=JSON[_0xbc64('0x4')](_0x4fabc9);}catch(_0x4e161c){_0x4e6597[_0x4179cc]=_0x4fabc9[_0xbc64('0x5')](',');}});}return _0x4e6597;};exports[_0xbc64('0x6')]=function(_0x40a4be){_0x40a4be=parseInt(_0x40a4be,0xa);if(!_0x40a4be||_0x40a4be<0x0){_0x40a4be=LIMIT_VALUE;}return _0x40a4be;};exports[_0xbc64('0x7')]=function(_0x2aa7f1){_0x2aa7f1=parseInt(_0x2aa7f1,0xa);if(!_0x2aa7f1||_0x2aa7f1<0x0){_0x2aa7f1=0x0;}return _0x2aa7f1;};exports[_0xbc64('0x8')]=function(_0x428792){var _0x2e55ef,_0x2d4c07=null;if(_0x428792){_0x2e55ef=_0x428792[_0xbc64('0x5')](',');_0x2d4c07=_[_0xbc64('0x9')](_0x2e55ef,function(_0x1e346a){if(_0x1e346a[_0xbc64('0xa')]('-')===0x0){return[_0x1e346a==='priority'?sequelize['cast'](sequelize[_0xbc64('0xb')](_0xbc64('0xc')),'unsigned'):_0x1e346a[_0xbc64('0xd')](0x1),_0xbc64('0xe')];}else{return[_0x1e346a===_0xbc64('0xc')?sequelize[_0xbc64('0xf')](sequelize[_0xbc64('0xb')](_0xbc64('0xc')),_0xbc64('0x10')):_0x1e346a,_0xbc64('0x11')];}});}return _0x2d4c07;};exports[_0xbc64('0x12')]=function(_0x1ae09a,_0xabdb6a){if(_[_0xbc64('0x2')](_0x1ae09a)){return _0x1ae09a;}if(_['isArray'](_0x1ae09a)){for(var _0x55be8a=0x0;_0x55be8a<_0x1ae09a[_0xbc64('0x13')];_0x55be8a+=0x1){_0x1ae09a[_0x55be8a]=this[_0xbc64('0x12')](_0x1ae09a[_0x55be8a],_0xabdb6a);}return _0x1ae09a;}if(!_[_0xbc64('0x14')](_0x1ae09a)){return _0x1ae09a;}if(_[_0xbc64('0x15')](_0xabdb6a)){_0xabdb6a=[_0xabdb6a];}if(!_['isArray'](_0xabdb6a)){return _0x1ae09a;}for(var _0x438fac=0x0;_0x438fac<_0xabdb6a[_0xbc64('0x13')];_0x438fac+=0x1){_[_0xbc64('0x16')](_0x1ae09a,_0xabdb6a[_0x438fac]);}for(var _0x412dcf in _0x1ae09a){if(_0x1ae09a['hasOwnProperty'](_0x412dcf)){_0x1ae09a[_0x412dcf]=this['omit'](_0x1ae09a[_0x412dcf],_0xabdb6a);}}return _0x1ae09a;};
\ No newline at end of file
index 6faa672..9c5bcfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['use','join','root','favicon.ico','set','appPath','development','test','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','body-parser','method-override','cookie-parser','errorhandler','path','cors','moment','./environment','../mysqldb','default','get','env','production'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0x3071('0x0'));var methodOverride=require(_0x3071('0x1'));var cookieParser=require(_0x3071('0x2'));var errorHandler=require(_0x3071('0x3'));var path=require(_0x3071('0x4'));var passport=require('passport');var cors=require(_0x3071('0x5'));var moment=require(_0x3071('0x6'));var config=require(_0x3071('0x7'));var db=require(_0x3071('0x8'))['db'];exports[_0x3071('0x9')]=function(_0x41cf76){var _0x1d3dd6=_0x41cf76[_0x3071('0xa')](_0x3071('0xb'));if(_0x1d3dd6===_0x3071('0xc')){_0x41cf76[_0x3071('0xd')](favicon(path[_0x3071('0xe')](config[_0x3071('0xf')],'public',_0x3071('0x10'))));_0x41cf76[_0x3071('0x11')](_0x3071('0x12'),path[_0x3071('0xe')](config[_0x3071('0xf')],'public'));}if(_0x1d3dd6===_0x3071('0x13')||_0x1d3dd6===_0x3071('0x14')){_0x41cf76[_0x3071('0xd')](favicon(path[_0x3071('0xe')](config[_0x3071('0xf')],'client','favicon.ico')));_0x41cf76[_0x3071('0x11')]('appPath',path[_0x3071('0xe')](config[_0x3071('0xf')],'client'));_0x41cf76[_0x3071('0xd')](errorHandler());}_0x41cf76['set'](_0x3071('0x15'),function(_0x45c93b,_0x1271d0){if(this[_0x45c93b]instanceof Date){_0x1271d0=this[_0x45c93b][_0x3071('0x16')]()[_0x3071('0x17')]('.')[0x0]+'Z';}return _0x1271d0;});_0x41cf76[_0x3071('0xd')](express[_0x3071('0x18')](_0x41cf76[_0x3071('0xa')](_0x3071('0x12'))));_0x41cf76[_0x3071('0x11')]('views',config[_0x3071('0xf')]+_0x3071('0x19'));_0x41cf76[_0x3071('0x1a')](_0x3071('0x1b'),require(_0x3071('0x1c'))[_0x3071('0x1d')]);_0x41cf76[_0x3071('0x11')](_0x3071('0x1e'),'html');_0x41cf76[_0x3071('0xd')](bodyParser[_0x3071('0x1f')]({'limit':_0x3071('0x20'),'extended':!![]}));_0x41cf76['use'](bodyParser[_0x3071('0x21')]({'limit':'50mb'}));_0x41cf76[_0x3071('0xd')](cors());_0x41cf76[_0x3071('0xd')](methodOverride());_0x41cf76[_0x3071('0xd')](cookieParser());_0x41cf76[_0x3071('0xd')](passport[_0x3071('0x22')]());};
\ No newline at end of file
+var _0xedd9=['errorhandler','path','passport','cors','./environment','../mysqldb','default','get','production','use','join','root','favicon.ico','appPath','public','development','client','set','json\x20replacer','toISOString','split','static','views','/server/views','html','renderFile','50mb','initialize','serve-favicon','body-parser','method-override','cookie-parser'];(function(_0x20779a,_0x183e3c){var _0x1ef24f=function(_0x5edf0b){while(--_0x5edf0b){_0x20779a['push'](_0x20779a['shift']());}};_0x1ef24f(++_0x183e3c);}(_0xedd9,0xfc));var _0x9edd=function(_0x5901b9,_0x3c3829){_0x5901b9=_0x5901b9-0x0;var _0x43cd20=_0xedd9[_0x5901b9];return _0x43cd20;};'use strict';var express=require('express');var favicon=require(_0x9edd('0x0'));var bodyParser=require(_0x9edd('0x1'));var methodOverride=require(_0x9edd('0x2'));var cookieParser=require(_0x9edd('0x3'));var errorHandler=require(_0x9edd('0x4'));var path=require(_0x9edd('0x5'));var passport=require(_0x9edd('0x6'));var cors=require(_0x9edd('0x7'));var moment=require('moment');var config=require(_0x9edd('0x8'));var db=require(_0x9edd('0x9'))['db'];exports[_0x9edd('0xa')]=function(_0x34c1a7){var _0x5319f7=_0x34c1a7[_0x9edd('0xb')]('env');if(_0x5319f7===_0x9edd('0xc')){_0x34c1a7[_0x9edd('0xd')](favicon(path[_0x9edd('0xe')](config[_0x9edd('0xf')],'public',_0x9edd('0x10'))));_0x34c1a7['set'](_0x9edd('0x11'),path[_0x9edd('0xe')](config['root'],_0x9edd('0x12')));}if(_0x5319f7===_0x9edd('0x13')||_0x5319f7==='test'){_0x34c1a7[_0x9edd('0xd')](favicon(path[_0x9edd('0xe')](config[_0x9edd('0xf')],_0x9edd('0x14'),_0x9edd('0x10'))));_0x34c1a7[_0x9edd('0x15')](_0x9edd('0x11'),path[_0x9edd('0xe')](config['root'],_0x9edd('0x14')));_0x34c1a7[_0x9edd('0xd')](errorHandler());}_0x34c1a7[_0x9edd('0x15')](_0x9edd('0x16'),function(_0x13b6b6,_0x338f3c){if(this[_0x13b6b6]instanceof Date){_0x338f3c=this[_0x13b6b6][_0x9edd('0x17')]()[_0x9edd('0x18')]('.')[0x0]+'Z';}return _0x338f3c;});_0x34c1a7['use'](express[_0x9edd('0x19')](_0x34c1a7[_0x9edd('0xb')](_0x9edd('0x11'))));_0x34c1a7['set'](_0x9edd('0x1a'),config[_0x9edd('0xf')]+_0x9edd('0x1b'));_0x34c1a7['engine'](_0x9edd('0x1c'),require('ejs')[_0x9edd('0x1d')]);_0x34c1a7[_0x9edd('0x15')]('view\x20engine','html');_0x34c1a7[_0x9edd('0xd')](bodyParser['urlencoded']({'limit':_0x9edd('0x1e'),'extended':!![]}));_0x34c1a7['use'](bodyParser['json']({'limit':_0x9edd('0x1e')}));_0x34c1a7[_0x9edd('0xd')](cors());_0x34c1a7['use'](methodOverride());_0x34c1a7['use'](cookieParser());_0x34c1a7[_0x9edd('0xd')](passport[_0x9edd('0x1f')]());};
\ No newline at end of file
index 6704f55..c5026fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3320=['orderBy','keys','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','model','join','createHash','md5','digest','hex','getUuid','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','update','substring','crypto','bimedia-machine-uuid','execSync','networkInterfaces'];(function(_0x58d379,_0x4d6fa5){var _0x4c322b=function(_0x1eb1ad){while(--_0x1eb1ad){_0x58d379['push'](_0x58d379['shift']());}};_0x4c322b(++_0x4d6fa5);}(_0x3320,0x13c));var _0x0332=function(_0xd70515,_0x50cfb3){_0xd70515=_0xd70515-0x0;var _0x1e9a3a=_0x3320[_0xd70515];return _0x1e9a3a;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x0332('0x0'));var machine=require(_0x0332('0x1'));var exec=require('child_process')[_0x0332('0x2')];function getInterfaces(){var _0x427f3d=[];var _0x1f4988=os[_0x0332('0x3')]();var _0x54068c=_[_0x0332('0x4')](_[_0x0332('0x5')](_0x1f4988));for(var _0x1f91b5=0x0;_0x1f91b5<_0x54068c['length'];_0x1f91b5++){var _0x2aef5e=_0x1f4988[_0x54068c[_0x1f91b5]][_0x0332('0x6')](function(_0xa1553f){return _0xa1553f['family']===_0x0332('0x7')&&_0xa1553f[_0x0332('0x8')]===![];});_0x427f3d=_0x427f3d[_0x0332('0x9')](_0x2aef5e);}return _0x427f3d;}function getFirstInterface(){var _0x1895db=_[_0x0332('0xa')](getInterfaces());return{'macAddress':_0x1895db&&_0x1895db[_0x0332('0xb')]?_0x1895db['mac']:_0x0332('0xc'),'ipAddress':_0x1895db&&_0x1895db[_0x0332('0xd')]?_0x1895db['address']:_0x0332('0xe')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x4ad85e=_['orderBy'](os[_0x0332('0xf')]()['map'](function(_0x3e8fc6){return _0x3e8fc6[_0x0332('0x10')];}))[_0x0332('0x11')](':');return crypto[_0x0332('0x12')](_0x0332('0x13'))['update'](_0x4ad85e)[_0x0332('0x14')](_0x0332('0x15'));}exports[_0x0332('0x16')]=function(){switch(os['platform']()){case _0x0332('0x17'):return exec(_0x0332('0x18'),{'encoding':_0x0332('0x19')})[_0x0332('0x1a')]('\x0d\x0a','');default:var _0x53904a=getFirstInterface();var _0x1e71e5=getCPUhash();var _0x396cbc=_0x1e71e5+'|'+os[_0x0332('0x1b')]()+'|'+_0x53904a[_0x0332('0x1c')]+'|'+_0x53904a[_0x0332('0x1d')];var _0x19ec9f=crypto[_0x0332('0x12')](_0x0332('0x13'))[_0x0332('0x1e')](_0x396cbc)[_0x0332('0x14')](_0x0332('0x15'));return _0x19ec9f['substring'](0x0,0x8)+'-'+_0x19ec9f[_0x0332('0x1f')](0x8,0xc)+'-'+_0x19ec9f[_0x0332('0x1f')](0xc,0x10)+'-'+_0x19ec9f[_0x0332('0x1f')](0x10,0x14)+'-'+_0x19ec9f[_0x0332('0x1f')](0x14);}};
\ No newline at end of file
+var _0x7b5b=['getFirstInterface','cpus','map','createHash','md5','update','digest','hex','getUuid','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','substring','crypto','bimedia-machine-uuid','child_process','networkInterfaces','orderBy','keys','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1'];(function(_0x217372,_0x1822ce){var _0x2715a1=function(_0x5712db){while(--_0x5712db){_0x217372['push'](_0x217372['shift']());}};_0x2715a1(++_0x1822ce);}(_0x7b5b,0x127));var _0xb7b5=function(_0x565012,_0x507412){_0x565012=_0x565012-0x0;var _0x91ebe5=_0x7b5b[_0x565012];return _0x91ebe5;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xb7b5('0x0'));var machine=require(_0xb7b5('0x1'));var exec=require(_0xb7b5('0x2'))['execSync'];function getInterfaces(){var _0x4e3ebc=[];var _0x10cbe0=os[_0xb7b5('0x3')]();var _0x5128cf=_[_0xb7b5('0x4')](_[_0xb7b5('0x5')](_0x10cbe0));for(var _0x31be7f=0x0;_0x31be7f<_0x5128cf['length'];_0x31be7f++){var _0x4892cf=_0x10cbe0[_0x5128cf[_0x31be7f]]['filter'](function(_0x70e276){return _0x70e276[_0xb7b5('0x6')]===_0xb7b5('0x7')&&_0x70e276[_0xb7b5('0x8')]===![];});_0x4e3ebc=_0x4e3ebc[_0xb7b5('0x9')](_0x4892cf);}return _0x4e3ebc;}function getFirstInterface(){var _0x85bc88=_[_0xb7b5('0xa')](getInterfaces());return{'macAddress':_0x85bc88&&_0x85bc88[_0xb7b5('0xb')]?_0x85bc88[_0xb7b5('0xb')]:_0xb7b5('0xc'),'ipAddress':_0x85bc88&&_0x85bc88[_0xb7b5('0xd')]?_0x85bc88[_0xb7b5('0xd')]:_0xb7b5('0xe')};}exports[_0xb7b5('0xf')]=getFirstInterface;function getCPUhash(){var _0x371cd8=_['orderBy'](os[_0xb7b5('0x10')]()[_0xb7b5('0x11')](function(_0x2c3eb1){return _0x2c3eb1['model'];}))['join'](':');return crypto[_0xb7b5('0x12')](_0xb7b5('0x13'))[_0xb7b5('0x14')](_0x371cd8)[_0xb7b5('0x15')](_0xb7b5('0x16'));}exports[_0xb7b5('0x17')]=function(){switch(os['platform']()){case _0xb7b5('0x18'):return exec(_0xb7b5('0x19'),{'encoding':_0xb7b5('0x1a')})[_0xb7b5('0x1b')]('\x0d\x0a','');default:var _0x518200=getFirstInterface();var _0x1ebbe1=getCPUhash();var _0x1ce446=_0x1ebbe1+'|'+os[_0xb7b5('0x1c')]()+'|'+_0x518200[_0xb7b5('0x1d')]+'|'+_0x518200['ipAddress'];var _0x265e30=crypto[_0xb7b5('0x12')](_0xb7b5('0x13'))[_0xb7b5('0x14')](_0x1ce446)[_0xb7b5('0x15')](_0xb7b5('0x16'));return _0x265e30[_0xb7b5('0x1e')](0x0,0x8)+'-'+_0x265e30[_0xb7b5('0x1e')](0x8,0xc)+'-'+_0x265e30[_0xb7b5('0x1e')](0xc,0x10)+'-'+_0x265e30[_0xb7b5('0x1e')](0x10,0x14)+'-'+_0x265e30[_0xb7b5('0x1e')](0x14);}};
\ No newline at end of file
index 9c2a4b8..bec7e9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa220=['end','parse','error','createCipher','aes-256-ctr','secrets','session','update','final','base64','createDecipher','utf8','||FIELD||VALUE||\x0a','User','admin','fullname','email','|uuid|','|machineUuid|','|name|','|email|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','then','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','format','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','https','moment','pkginfo','version','../../mysqldb','../environment','./hardware','../logger','license','../../api/jira/jira.controller','www.xcallymotion.com','/api/servers/%s/check?version=%s','GET','application/json','request','setEncoding','data'];(function(_0x1b02a6,_0x74f890){var _0x31c442=function(_0x185c54){while(--_0x185c54){_0x1b02a6['push'](_0x1b02a6['shift']());}};_0x31c442(++_0x74f890);}(_0xa220,0xc3));var _0x0a22=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa220[_0x167cc1];return _0x10bc4b;};'use strict';var util=require(_0x0a22('0x0'));var https=require(_0x0a22('0x1'));var crypto=require('crypto');var moment=require(_0x0a22('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x0a22('0x3'))(module,_0x0a22('0x4'));var db=require(_0x0a22('0x5'))['db'];var config=require(_0x0a22('0x6'));var hardware=require(_0x0a22('0x7'));var logger=require(_0x0a22('0x8'))(_0x0a22('0x9'));var jira=require(_0x0a22('0xa'));var HOST=_0x0a22('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;function httpRequest(_0xe6793b){return new BPromise(function(_0x38f3b8,_0x5a0c6c){var _0x2c4956={'host':HOST,'port':0x1bb,'path':util['format'](_0x0a22('0xc'),_0xe6793b,module['exports']['version']),'method':_0x0a22('0xd'),'timeout':0xea60,'headers':{'Content-Type':_0x0a22('0xe')}};var _0x214fe1=https[_0x0a22('0xf')](_0x2c4956,function(_0x3dde8b){_0x3dde8b[_0x0a22('0x10')]('utf8');var _0x44faab='';_0x3dde8b['on'](_0x0a22('0x11'),function(_0x29c189){_0x44faab+=_0x29c189;});_0x3dde8b['on'](_0x0a22('0x12'),function(){try{_0x38f3b8(JSON[_0x0a22('0x13')](_0x44faab));}catch(_0x3d15d4){_0x5a0c6c(_0x3d15d4);}});});_0x214fe1['on'](_0x0a22('0x14'),_0x5a0c6c);_0x214fe1['end']();});}function encryptDate(_0x468501){var _0x1fc635=crypto[_0x0a22('0x15')](_0x0a22('0x16'),config[_0x0a22('0x17')][_0x0a22('0x18')]);var _0x5605c5=_0x1fc635[_0x0a22('0x19')](_0x468501,'utf8','base64');_0x5605c5+=_0x1fc635[_0x0a22('0x1a')](_0x0a22('0x1b'));return _0x5605c5;}function decryptDate(_0x3220b6){var _0x36f999=crypto[_0x0a22('0x1c')](_0x0a22('0x16'),config[_0x0a22('0x17')][_0x0a22('0x18')]);var _0x1cfa09=_0x36f999[_0x0a22('0x19')](_0x3220b6,_0x0a22('0x1b'),_0x0a22('0x1d'));_0x1cfa09+=_0x36f999['final']('utf8');return _0x1cfa09;}function sendJiraAlert(_0x3232fd,_0xf44b47,_0x2a4f61){var _0x1edea9=_0x0a22('0x1e');return db[_0x0a22('0x1f')]['findOne']({'where':{'role':_0x0a22('0x20')},'attributes':[_0x0a22('0x21'),_0x0a22('0x22')],'raw':!![]})['then'](function(_0x63791b){ADMIN=_0x63791b;_0x1edea9+='|reason|'+_0x2a4f61+'|\x0a';_0x1edea9+=_0x0a22('0x23')+_0x3232fd+'|\x0a';_0x1edea9+=_0x0a22('0x24')+_0xf44b47+'|\x0a';_0x1edea9+=_0x0a22('0x25')+ADMIN[_0x0a22('0x21')]+'|\x0a';_0x1edea9+=_0x0a22('0x26')+ADMIN['email']+'|\x0a';return _0x1edea9;})['then'](function(_0x3a1e55){var _0x2ca255=hardware[_0x0a22('0x27')]()[_0x0a22('0x28')];return jira[_0x0a22('0x29')]({'key':_0x0a22('0x2a'),'summary':_0x0a22('0x2b'),'description':_0x3a1e55,'issuetype':_0x0a22('0x2c'),'oldToken':_0x3232fd,'newToken':_0xf44b47,'email':ADMIN[_0x0a22('0x22')],'name':ADMIN[_0x0a22('0x21')],'reason':GRAY_PERIOD_REASON,'ip':_0x2ca255});});}function manageLicense(_0x4c121a,_0x3d5bf2){var _0x178ebc=_0x3d5bf2['get']({'plain':!![]});httpRequest(_0x4c121a)[_0x0a22('0x2d')](function(_0x35815a){if(_0x35815a['active']){if(!_0x178ebc[_0x0a22('0x9')]&&_0x178ebc[_0x0a22('0x9')]!=_0x35815a[_0x0a22('0x9')]||_0x178ebc[_0x0a22('0x9')]&&_0x178ebc[_0x0a22('0x2e')]){logger[_0x0a22('0x2f')](_0x0a22('0x30'));}if(_0x178ebc['license']&&!_0x178ebc[_0x0a22('0x2e')]&&_0x178ebc['license']!=_0x35815a[_0x0a22('0x9')]){logger[_0x0a22('0x2f')](_0x0a22('0x31'));}if(_0x178ebc[_0x0a22('0x9')]&&!_0x178ebc[_0x0a22('0x2e')]&&_0x178ebc[_0x0a22('0x9')]==_0x35815a['license']){return _0x3d5bf2;}return _0x3d5bf2[_0x0a22('0x19')]({'data1':_0x4c121a,'data2':null,'license':_0x35815a[_0x0a22('0x9')]});}else{if(_0x35815a['license']||_0x178ebc[_0x0a22('0x9')]){if(!_0x178ebc[_0x0a22('0x2e')]){if(_0x178ebc[_0x0a22('0x32')]==_0x4c121a){GRAY_PERIOD_REASON=_0x0a22('0x33');logger[_0x0a22('0x2f')](_0x0a22('0x34'));}else{GRAY_PERIOD_REASON=_0x0a22('0x35');logger[_0x0a22('0x2f')](_0x0a22('0x36'),_0x178ebc[_0x0a22('0x32')],_0x4c121a);}sendJiraAlert(_0x178ebc[_0x0a22('0x32')],_0x35815a[_0x0a22('0x37')],GRAY_PERIOD_REASON);logger[_0x0a22('0x2f')](_0x0a22('0x38'),GRAY_PERIOD_REASON[_0x0a22('0x39')](),moment()[_0x0a22('0x3a')](_0x0a22('0x3b')));return _0x3d5bf2[_0x0a22('0x19')]({'data2':encryptDate(moment()[_0x0a22('0x3a')](_0x0a22('0x3b')))});}else{if(moment()[_0x0a22('0x3c')](decryptDate(_0x178ebc[_0x0a22('0x2e')]),_0x0a22('0x3d'))>DAYS){logger[_0x0a22('0x2f')](_0x0a22('0x3e'),moment()[_0x0a22('0x3a')](_0x0a22('0x3b')));return _0x3d5bf2['update']({'data1':_0x4c121a,'data2':null,'license':null});}}}else{if(_0x178ebc[_0x0a22('0x32')]!=_0x4c121a){logger[_0x0a22('0x2f')](_0x0a22('0x36'),_0x178ebc[_0x0a22('0x32')],_0x4c121a);return _0x3d5bf2[_0x0a22('0x19')]({'data1':_0x4c121a,'data2':null,'license':null});}}}return _0x3d5bf2;})[_0x0a22('0x2d')](function(_0x573847){_0x3d5bf2=_0x573847;})['catch'](function(_0x16a2bd){logger[_0x0a22('0x14')](_0x16a2bd[_0x0a22('0x3f')]);})[_0x0a22('0x40')](function(){setTimeout(function(){manageLicense(hardware[_0x0a22('0x41')](),_0x3d5bf2);},TIME);});}function defaultLicense(){var _0x3aa770=hardware[_0x0a22('0x41')]();if(_0x3aa770){return db[_0x0a22('0x42')][_0x0a22('0x43')]({'where':{'id':0x1},'defaults':{'data1':_0x3aa770}})[_0x0a22('0x44')](function(_0x347d92,_0x5e2d25){logger['info'](_0x0a22('0x45'),_0x3aa770);manageLicense(_0x3aa770,_0x347d92);})['catch'](function(_0x5531a8){logger[_0x0a22('0x14')](_0x5531a8[_0x0a22('0x3f')]);});}}exports[_0x0a22('0x46')]=defaultLicense;
\ No newline at end of file
+var _0xc3ad=['final','base64','createDecipher','aes-256-ctr','||FIELD||VALUE||\x0a','User','fullname','email','|uuid|','|machineUuid|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','Changed','info','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','DEMO\x20START\x20AT\x20%s','then','catch','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','https','crypto','moment','bluebird','pkginfo','version','./hardware','license','../../api/jira/jira.controller','www.xcallymotion.com','format','exports','GET','application/json','request','setEncoding','utf8','data','parse','error','end','createCipher','secrets','session','update'];(function(_0x188360,_0x3d93f8){var _0x1fbe6d=function(_0x3d9d32){while(--_0x3d9d32){_0x188360['push'](_0x188360['shift']());}};_0x1fbe6d(++_0x3d93f8);}(_0xc3ad,0xf6));var _0xdc3a=function(_0x23361e,_0x102cdc){_0x23361e=_0x23361e-0x0;var _0x2f4142=_0xc3ad[_0x23361e];return _0x2f4142;};'use strict';var util=require(_0xdc3a('0x0'));var https=require(_0xdc3a('0x1'));var crypto=require(_0xdc3a('0x2'));var moment=require(_0xdc3a('0x3'));var BPromise=require(_0xdc3a('0x4'));var pkginfo=require(_0xdc3a('0x5'))(module,_0xdc3a('0x6'));var db=require('../../mysqldb')['db'];var config=require('../environment');var hardware=require(_0xdc3a('0x7'));var logger=require('../logger')(_0xdc3a('0x8'));var jira=require(_0xdc3a('0x9'));var HOST=_0xdc3a('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;function httpRequest(_0x40fb8a){return new BPromise(function(_0x189be3,_0x21d2c1){var _0x12d7fb={'host':HOST,'port':0x1bb,'path':util[_0xdc3a('0xb')]('/api/servers/%s/check?version=%s',_0x40fb8a,module[_0xdc3a('0xc')][_0xdc3a('0x6')]),'method':_0xdc3a('0xd'),'timeout':0xea60,'headers':{'Content-Type':_0xdc3a('0xe')}};var _0x4b83c0=https[_0xdc3a('0xf')](_0x12d7fb,function(_0x32c085){_0x32c085[_0xdc3a('0x10')](_0xdc3a('0x11'));var _0x1f7b8b='';_0x32c085['on'](_0xdc3a('0x12'),function(_0x4d5e63){_0x1f7b8b+=_0x4d5e63;});_0x32c085['on']('end',function(){try{_0x189be3(JSON[_0xdc3a('0x13')](_0x1f7b8b));}catch(_0x41a60a){_0x21d2c1(_0x41a60a);}});});_0x4b83c0['on'](_0xdc3a('0x14'),_0x21d2c1);_0x4b83c0[_0xdc3a('0x15')]();});}function encryptDate(_0xa7488e){var _0x19a694=crypto[_0xdc3a('0x16')]('aes-256-ctr',config[_0xdc3a('0x17')][_0xdc3a('0x18')]);var _0x337dec=_0x19a694[_0xdc3a('0x19')](_0xa7488e,_0xdc3a('0x11'),'base64');_0x337dec+=_0x19a694[_0xdc3a('0x1a')](_0xdc3a('0x1b'));return _0x337dec;}function decryptDate(_0x5041c6){var _0x51569b=crypto[_0xdc3a('0x1c')](_0xdc3a('0x1d'),config['secrets'][_0xdc3a('0x18')]);var _0x44dee3=_0x51569b[_0xdc3a('0x19')](_0x5041c6,_0xdc3a('0x1b'),_0xdc3a('0x11'));_0x44dee3+=_0x51569b['final'](_0xdc3a('0x11'));return _0x44dee3;}function sendJiraAlert(_0x369e06,_0x57c5ae,_0x4775e3){var _0x426048=_0xdc3a('0x1e');return db[_0xdc3a('0x1f')]['findOne']({'where':{'role':'admin'},'attributes':[_0xdc3a('0x20'),_0xdc3a('0x21')],'raw':!![]})['then'](function(_0x4d74d3){ADMIN=_0x4d74d3;_0x426048+='|reason|'+_0x4775e3+'|\x0a';_0x426048+=_0xdc3a('0x22')+_0x369e06+'|\x0a';_0x426048+=_0xdc3a('0x23')+_0x57c5ae+'|\x0a';_0x426048+='|name|'+ADMIN[_0xdc3a('0x20')]+'|\x0a';_0x426048+='|email|'+ADMIN['email']+'|\x0a';return _0x426048;})['then'](function(_0x517fd0){var _0x4b029a=hardware[_0xdc3a('0x24')]()[_0xdc3a('0x25')];return jira[_0xdc3a('0x26')]({'key':_0xdc3a('0x27'),'summary':_0xdc3a('0x28'),'description':_0x517fd0,'issuetype':_0xdc3a('0x29'),'oldToken':_0x369e06,'newToken':_0x57c5ae,'email':ADMIN[_0xdc3a('0x21')],'name':ADMIN[_0xdc3a('0x20')],'reason':GRAY_PERIOD_REASON,'ip':_0x4b029a});});}function manageLicense(_0x1a9223,_0x57b2d9){var _0x134b75=_0x57b2d9[_0xdc3a('0x2a')]({'plain':!![]});httpRequest(_0x1a9223)['then'](function(_0x35bbcd){if(_0x35bbcd[_0xdc3a('0x2b')]){if(!_0x134b75[_0xdc3a('0x8')]&&_0x134b75[_0xdc3a('0x8')]!=_0x35bbcd[_0xdc3a('0x8')]||_0x134b75[_0xdc3a('0x8')]&&_0x134b75['data2']){logger['info'](_0xdc3a('0x2c'));}if(_0x134b75[_0xdc3a('0x8')]&&!_0x134b75[_0xdc3a('0x2d')]&&_0x134b75[_0xdc3a('0x8')]!=_0x35bbcd[_0xdc3a('0x8')]){logger['info'](_0xdc3a('0x2e'));}if(_0x134b75[_0xdc3a('0x8')]&&!_0x134b75['data2']&&_0x134b75[_0xdc3a('0x8')]==_0x35bbcd[_0xdc3a('0x8')]){return _0x57b2d9;}return _0x57b2d9[_0xdc3a('0x19')]({'data1':_0x1a9223,'data2':null,'license':_0x35bbcd[_0xdc3a('0x8')]});}else{if(_0x35bbcd[_0xdc3a('0x8')]||_0x134b75[_0xdc3a('0x8')]){if(!_0x134b75[_0xdc3a('0x2d')]){if(_0x134b75[_0xdc3a('0x2f')]==_0x1a9223){GRAY_PERIOD_REASON=_0xdc3a('0x30');logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xdc3a('0x31');logger[_0xdc3a('0x32')](_0xdc3a('0x33'),_0x134b75['data1'],_0x1a9223);}sendJiraAlert(_0x134b75[_0xdc3a('0x2f')],_0x35bbcd[_0xdc3a('0x34')],GRAY_PERIOD_REASON);logger[_0xdc3a('0x32')](_0xdc3a('0x35'),GRAY_PERIOD_REASON[_0xdc3a('0x36')](),moment()['format'](_0xdc3a('0x37')));return _0x57b2d9[_0xdc3a('0x19')]({'data2':encryptDate(moment()[_0xdc3a('0xb')](_0xdc3a('0x37')))});}else{if(moment()[_0xdc3a('0x38')](decryptDate(_0x134b75[_0xdc3a('0x2d')]),'days')>DAYS){logger[_0xdc3a('0x32')](_0xdc3a('0x39'),moment()[_0xdc3a('0xb')](_0xdc3a('0x37')));return _0x57b2d9['update']({'data1':_0x1a9223,'data2':null,'license':null});}}}else{if(_0x134b75[_0xdc3a('0x2f')]!=_0x1a9223){logger[_0xdc3a('0x32')](_0xdc3a('0x33'),_0x134b75[_0xdc3a('0x2f')],_0x1a9223);return _0x57b2d9['update']({'data1':_0x1a9223,'data2':null,'license':null});}}}return _0x57b2d9;})[_0xdc3a('0x3a')](function(_0x23fc8d){_0x57b2d9=_0x23fc8d;})[_0xdc3a('0x3b')](function(_0x44f5f3){logger[_0xdc3a('0x14')](_0x44f5f3[_0xdc3a('0x3c')]);})[_0xdc3a('0x3d')](function(){setTimeout(function(){manageLicense(hardware[_0xdc3a('0x3e')](),_0x57b2d9);},TIME);});}function defaultLicense(){var _0x205a4d=hardware[_0xdc3a('0x3e')]();if(_0x205a4d){return db[_0xdc3a('0x3f')][_0xdc3a('0x40')]({'where':{'id':0x1},'defaults':{'data1':_0x205a4d}})[_0xdc3a('0x41')](function(_0x3e84a,_0x116171){logger[_0xdc3a('0x32')](_0xdc3a('0x42'),_0x205a4d);manageLicense(_0x205a4d,_0x3e84a);})['catch'](function(_0x2773eb){logger[_0xdc3a('0x14')](_0x2773eb[_0xdc3a('0x3c')]);});}}exports[_0xdc3a('0x43')]=defaultLicense;
\ No newline at end of file
index f58848a..bae6dcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9741=['changed','disabled','2027-01-01T00:00:00.000Z','message','Demo\x20license','getLicense','find','defaults','then','checkLicense','util','lodash','moment','./hardware','../environment','../../mysqldb','license','data1','data2','split','aes-256-ctr','format','%s:%s:%s','utf8','machineUuid','getUuid','createDecipher','secrets','session','update','base64','deadline','grayReason','uuid'];(function(_0x3ccf96,_0x5e0892){var _0x10dec4=function(_0x25629d){while(--_0x25629d){_0x3ccf96['push'](_0x3ccf96['shift']());}};_0x10dec4(++_0x5e0892);}(_0x9741,0x1e6));var _0x1974=function(_0x5f3c9e,_0x1bd7b7){_0x5f3c9e=_0x5f3c9e-0x0;var _0x5ac39e=_0x9741[_0x5f3c9e];return _0x5ac39e;};'use strict';var crypto=require('crypto');var util=require(_0x1974('0x0'));var _=require(_0x1974('0x1'));var moment=require(_0x1974('0x2'));var hardware=require(_0x1974('0x3'));var config=require(_0x1974('0x4'));var db=require(_0x1974('0x5'))['db'];function checkLicense(_0x233902,_0x53b8d3){if(_0x233902){try{var _0x4b12e5=_0x53b8d3||_0x233902[_0x1974('0x6')];if(_['isEmpty'](_0x4b12e5)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x169bac=_0x233902[_0x1974('0x7')];var _0x19b848=_0x233902[_0x1974('0x8')];var _0xc16955=_0x169bac[_0x1974('0x9')]('-')[0x4];var _0x5c78ea=_0x169bac[_0x1974('0x9')]('-')[0x0];var _0xc02918=crypto['createDecipher'](_0x1974('0xa'),util[_0x1974('0xb')](_0x1974('0xc'),_0xc16955,_0x169bac,_0x5c78ea));var _0xebbe07=_0xc02918['update'](_0x4b12e5,'base64',_0x1974('0xd'));_0xebbe07+=_0xc02918['final']('utf8');var _0x544693=JSON['parse'](_0xebbe07);_0x544693['demo']=![];_0x544693['uuid']=_0x169bac;_0x544693[_0x1974('0xe')]=hardware[_0x1974('0xf')]();if(_0x19b848){var _0x2eea46=crypto[_0x1974('0x10')](_0x1974('0xa'),config[_0x1974('0x11')][_0x1974('0x12')]);var _0x4dc01d=_0x2eea46[_0x1974('0x13')](_0x19b848,_0x1974('0x14'),_0x1974('0xd'));_0x4dc01d+=_0x2eea46['final']('utf8');_0x544693['gray']=_0x4dc01d;_0x544693[_0x1974('0x15')]=moment(_0x4dc01d)['add'](0x7,'days')[_0x1974('0xb')]();_0x544693[_0x1974('0x16')]=_0x544693[_0x1974('0x17')]!=_0x544693[_0x1974('0xe')]?_0x1974('0x18'):_0x1974('0x19');}return _0x544693;}catch(_0x5219ba){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1974('0x1a'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x233902[_0x1974('0x7')],'machineUuid':hardware[_0x1974('0xf')](),'message':_0x5219ba[_0x1974('0x1b')],'virtual':0x0,'voice':!![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1974('0x1a'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x1974('0x1c'),'uuid':_0x233902['data1'],'machineUuid':hardware[_0x1974('0xf')](),'virtual':0x0,'voice':!![]};}exports[_0x1974('0x1d')]=function(_0x39be87){return db['License'][_0x1974('0x1e')](_[_0x1974('0x1f')](_0x39be87,{'raw':!![],'where':{'id':0x1}}))[_0x1974('0x20')](function(_0x4c1c51){return checkLicense(_0x4c1c51,null);});};exports[_0x1974('0x21')]=checkLicense;
\ No newline at end of file
+var _0xbedd=['moment','./hardware','../environment','../../mysqldb','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','aes-256-ctr','%s:%s:%s','base64','final','parse','demo','machineUuid','update','utf8','gray','deadline','add','format','grayReason','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','getUuid','message','Demo\x20license','getLicense','find','defaults','then','crypto','util','lodash'];(function(_0xf2f46b,_0x89cf58){var _0x382051=function(_0x177d63){while(--_0x177d63){_0xf2f46b['push'](_0xf2f46b['shift']());}};_0x382051(++_0x89cf58);}(_0xbedd,0x91));var _0xdbed=function(_0xe80e5c,_0x38e90a){_0xe80e5c=_0xe80e5c-0x0;var _0x2bff61=_0xbedd[_0xe80e5c];return _0x2bff61;};'use strict';var crypto=require(_0xdbed('0x0'));var util=require(_0xdbed('0x1'));var _=require(_0xdbed('0x2'));var moment=require(_0xdbed('0x3'));var hardware=require(_0xdbed('0x4'));var config=require(_0xdbed('0x5'));var db=require(_0xdbed('0x6'))['db'];function checkLicense(_0x8c7cf3,_0x57a728){if(_0x8c7cf3){try{var _0x44d480=_0x57a728||_0x8c7cf3['license'];if(_[_0xdbed('0x7')](_0x44d480)){throw new Error(_0xdbed('0x8'));}var _0x7811c1=_0x8c7cf3[_0xdbed('0x9')];var _0x45705a=_0x8c7cf3[_0xdbed('0xa')];var _0x18c1bc=_0x7811c1[_0xdbed('0xb')]('-')[0x4];var _0x16de5d=_0x7811c1[_0xdbed('0xb')]('-')[0x0];var _0x1dcf60=crypto[_0xdbed('0xc')](_0xdbed('0xd'),util['format'](_0xdbed('0xe'),_0x18c1bc,_0x7811c1,_0x16de5d));var _0x14ba55=_0x1dcf60['update'](_0x44d480,_0xdbed('0xf'),'utf8');_0x14ba55+=_0x1dcf60[_0xdbed('0x10')]('utf8');var _0x3678ff=JSON[_0xdbed('0x11')](_0x14ba55);_0x3678ff[_0xdbed('0x12')]=![];_0x3678ff['uuid']=_0x7811c1;_0x3678ff[_0xdbed('0x13')]=hardware['getUuid']();if(_0x45705a){var _0x1f10aa=crypto[_0xdbed('0xc')]('aes-256-ctr',config['secrets']['session']);var _0x1ec13d=_0x1f10aa[_0xdbed('0x14')](_0x45705a,_0xdbed('0xf'),_0xdbed('0x15'));_0x1ec13d+=_0x1f10aa[_0xdbed('0x10')]('utf8');_0x3678ff[_0xdbed('0x16')]=_0x1ec13d;_0x3678ff[_0xdbed('0x17')]=moment(_0x1ec13d)[_0xdbed('0x18')](0x7,'days')[_0xdbed('0x19')]();_0x3678ff[_0xdbed('0x1a')]=_0x3678ff['uuid']!=_0x3678ff['machineUuid']?'changed':_0xdbed('0x1b');}return _0x3678ff;}catch(_0x59448a){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdbed('0x1c'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xdbed('0x1d'),'uuid':_0x8c7cf3[_0xdbed('0x9')],'machineUuid':hardware[_0xdbed('0x1e')](),'message':_0x59448a[_0xdbed('0x1f')],'virtual':0x0,'voice':!![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdbed('0x1c'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xdbed('0x20'),'uuid':_0x8c7cf3['data1'],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![]};}exports[_0xdbed('0x21')]=function(_0x5c1669){return db['License'][_0xdbed('0x22')](_[_0xdbed('0x23')](_0x5c1669,{'raw':!![],'where':{'id':0x1}}))[_0xdbed('0x24')](function(_0x330eef){return checkLicense(_0x330eef,null);});};exports['checkLicense']=checkLicense;
\ No newline at end of file
index 3b2e124..e946576 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2285=['myappanuglar-secret','app-id','secret','http://localhost:9000'];(function(_0x528365,_0xb2ff2f){var _0x18cbbd=function(_0x193124){while(--_0x193124){_0x528365['push'](_0x528365['shift']());}};_0x18cbbd(++_0xb2ff2f);}(_0x2285,0x177));var _0x5228=function(_0x2907a9,_0x3f59d2){_0x2907a9=_0x2907a9-0x0;var _0x320db5=_0x2285[_0x2907a9];return _0x320db5;};'use strict';module['exports']={'DOMAIN':_0x5228('0x0'),'SESSION_SECRET':_0x5228('0x1'),'GOOGLE_ID':_0x5228('0x2'),'GOOGLE_SECRET':_0x5228('0x3'),'DEBUG':''};
\ No newline at end of file
+var _0x9234=['secret','exports','myappanuglar-secret','app-id'];(function(_0x1f75e8,_0x7fa97f){var _0x120699=function(_0x4d817b){while(--_0x4d817b){_0x1f75e8['push'](_0x1f75e8['shift']());}};_0x120699(++_0x7fa97f);}(_0x9234,0x1bd));var _0x4923=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x9234[_0x9df060];return _0x338dfe;};'use strict';module[_0x4923('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x4923('0x1'),'GOOGLE_ID':_0x4923('0x2'),'GOOGLE_SECRET':_0x4923('0x3'),'DEBUG':''};
\ No newline at end of file
index dec66f4..b083ff7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5f6=['%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','exports','Logger','File','%s-%s','error','transports','info','env','debugLevel','moment','winston','path','INFO','join','/var','log','xcally','format'];(function(_0x520464,_0x1bff63){var _0x332383=function(_0x2fcaff){while(--_0x2fcaff){_0x520464['push'](_0x520464['shift']());}};_0x332383(++_0x1bff63);}(_0xc5f6,0x6f));var _0x6c5f=function(_0xbeb9fd,_0x5de590){_0xbeb9fd=_0xbeb9fd-0x0;var _0x357db2=_0xc5f6[_0xbeb9fd];return _0x357db2;};'use strict';var moment=require(_0x6c5f('0x0'));var winston=require(_0x6c5f('0x1'));var util=require('util');var path=require(_0x6c5f('0x2'));var debugLevel=_0x6c5f('0x3');function filename(_0x1048ea,_0x54ea46){return path[_0x6c5f('0x4')](_0x6c5f('0x5'),_0x6c5f('0x6'),_0x6c5f('0x7'),util[_0x6c5f('0x8')](_0x6c5f('0x9'),_0x1048ea,_0x54ea46));}function formatter(_0x9d54f8,_0x2bf60b){return util['format'](_0x6c5f('0xa'),moment()[_0x6c5f('0x8')](_0x6c5f('0xb')),_0x2bf60b[_0x6c5f('0xc')][_0x6c5f('0xd')](),_0x9d54f8,_0x2bf60b[_0x6c5f('0xe')]);}module[_0x6c5f('0xf')]=function(_0x15eda0){return new winston[(_0x6c5f('0x10'))]({'transports':[new winston['transports'][(_0x6c5f('0x11'))]({'name':util[_0x6c5f('0x8')](_0x6c5f('0x12'),_0x15eda0,_0x6c5f('0x13')),'filename':filename(_0x15eda0,'error'),'level':_0x6c5f('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x29bd79){return formatter(_0x15eda0,_0x29bd79);}}),new winston[(_0x6c5f('0x14'))]['File']({'name':util[_0x6c5f('0x8')](_0x6c5f('0x12'),_0x15eda0,_0x6c5f('0x15')),'filename':filename(_0x15eda0,_0x6c5f('0x15')),'level':_0x6c5f('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5c83c0){return formatter(_0x15eda0,_0x5c83c0);}}),new winston[(_0x6c5f('0x14'))]['Console']({'level':process[_0x6c5f('0x16')][_0x6c5f('0x17')]||debugLevel,'json':![],'formatter':function(_0x147664){return formatter(_0x15eda0,_0x147664);}})]});};
\ No newline at end of file
+var _0x8796=['[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','message','exports','Logger','File','%s-%s','error','transports','info','Console','env','debugLevel','util','path','INFO','join','/var','format'];(function(_0x1586f1,_0x50cbfc){var _0x392d3b=function(_0x5d521a){while(--_0x5d521a){_0x1586f1['push'](_0x1586f1['shift']());}};_0x392d3b(++_0x50cbfc);}(_0x8796,0x176));var _0x6879=function(_0x47d4bc,_0x463853){_0x47d4bc=_0x47d4bc-0x0;var _0x323f6d=_0x8796[_0x47d4bc];return _0x323f6d;};'use strict';var moment=require('moment');var winston=require('winston');var util=require(_0x6879('0x0'));var path=require(_0x6879('0x1'));var debugLevel=_0x6879('0x2');function filename(_0x57566d,_0x55d91e){return path[_0x6879('0x3')](_0x6879('0x4'),'log','xcally',util[_0x6879('0x5')]('%s-%s.log',_0x57566d,_0x55d91e));}function formatter(_0x2e0241,_0xce3194){return util[_0x6879('0x5')](_0x6879('0x6'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0xce3194[_0x6879('0x7')][_0x6879('0x8')](),_0x2e0241,_0xce3194[_0x6879('0x9')]);}module[_0x6879('0xa')]=function(_0x16589f){return new winston[(_0x6879('0xb'))]({'transports':[new winston['transports'][(_0x6879('0xc'))]({'name':util[_0x6879('0x5')](_0x6879('0xd'),_0x16589f,_0x6879('0xe')),'filename':filename(_0x16589f,'error'),'level':_0x6879('0xe'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x156ddf){return formatter(_0x16589f,_0x156ddf);}}),new winston[(_0x6879('0xf'))]['File']({'name':util['format']('%s-%s',_0x16589f,_0x6879('0x10')),'filename':filename(_0x16589f,_0x6879('0x10')),'level':_0x6879('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3921cd){return formatter(_0x16589f,_0x3921cd);}}),new winston[(_0x6879('0xf'))][(_0x6879('0x11'))]({'level':process[_0x6879('0x12')][_0x6879('0x13')]||debugLevel,'json':![],'formatter':function(_0x25cfa6){return formatter(_0x16589f,_0x25cfa6);}})]});};
\ No newline at end of file
index d7817d4..ae8433f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ed=['path','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x53ed,0xfd));var _0xd53e=function(_0x587b4d,_0xdfbfda){_0x587b4d=_0x587b4d-0x0;var _0x3c8dfd=_0x53ed[_0x587b4d];return _0x3c8dfd;};'use strict';var path=require(_0xd53e('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0xd53e('0x1')](__dirname,_0xd53e('0x2'))},{'name':_0xd53e('0x3'),'script':path[_0xd53e('0x1')](__dirname,_0xd53e('0x4'))},{'name':_0xd53e('0x5'),'script':path[_0xd53e('0x1')](__dirname,_0xd53e('0x6'))},{'name':_0xd53e('0x7'),'script':path[_0xd53e('0x1')](__dirname,_0xd53e('0x8'))},{'name':_0xd53e('0x9'),'script':path[_0xd53e('0x1')](__dirname,_0xd53e('0xa'))}]};module['exports']=config;
\ No newline at end of file
+var _0xf9d7=['../../services/ami/index.js','../../services/agi/index.js','email','routing','../../services/routing/index.js','exports','join','ami'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xf9d7,0x10e));var _0x7f9d=function(_0x5f4d59,_0x554969){_0x5f4d59=_0x5f4d59-0x0;var _0x4d5dea=_0xf9d7[_0x5f4d59];return _0x4d5dea;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':'express','script':path[_0x7f9d('0x0')](__dirname,'../../services/express/index.js')},{'name':_0x7f9d('0x1'),'script':path['join'](__dirname,_0x7f9d('0x2'))},{'name':'agi','script':path[_0x7f9d('0x0')](__dirname,_0x7f9d('0x3'))},{'name':_0x7f9d('0x4'),'script':path['join'](__dirname,'../../services/email/index.js')},{'name':_0x7f9d('0x5'),'script':path[_0x7f9d('0x0')](__dirname,_0x7f9d('0x6'))}]};module[_0x7f9d('0x7')]=config;
\ No newline at end of file
index 4433e6e..075ba0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['describe','delete','dump','saved','./config','connect','connected','then','start','disconnect','restart','list'];(function(_0x14a862,_0x2b559d){var _0x245eb5=function(_0x6e014c){while(--_0x6e014c){_0x14a862['push'](_0x14a862['shift']());}};_0x245eb5(++_0x2b559d);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x49c4('0x0'));function connect(){return new BPromise(function(_0x18bf2d,_0x26844b){return pm2[_0x49c4('0x1')](function(_0x455700){if(_0x455700){return _0x26844b(_0x455700);}return _0x18bf2d(_0x49c4('0x2'));});});};exports['start']=function(_0x4941f1){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x57effd,_0xc1278f){return pm2[_0x49c4('0x4')](_0x4941f1,function(_0x69bc41,_0x2c4e2e){if(_0x69bc41){return _0xc1278f(_0x69bc41);}pm2[_0x49c4('0x5')]();return _0x57effd(_0x2c4e2e);});});});};exports['stop']=function(_0x11c586){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x1d13fb,_0x4487ca){return pm2['stop'](_0x11c586,function(_0x5ab4a3,_0x451ea6){if(_0x5ab4a3){return _0x4487ca(_0x5ab4a3);}pm2[_0x49c4('0x5')]();return _0x1d13fb(_0x451ea6);});});});};exports['restart']=function(_0xb611a1){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x4adb3c,_0x536d42){return pm2[_0x49c4('0x6')](_0xb611a1,function(_0x6d1b08,_0x5487cd){if(_0x6d1b08){return _0x536d42(_0x6d1b08);}pm2[_0x49c4('0x5')]();return _0x4adb3c(_0x5487cd);});});});};exports[_0x49c4('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1909fe,_0x280996){return pm2[_0x49c4('0x7')](function(_0x2decee,_0x12777c){if(_0x2decee){return _0x280996(_0x2decee);}pm2[_0x49c4('0x5')]();return _0x1909fe(_0x12777c);});});});};exports[_0x49c4('0x8')]=function(_0x3de397){return connect()['then'](function(){return new BPromise(function(_0x3acd06,_0x141003){return pm2[_0x49c4('0x8')](_0x3de397,function(_0x81e831,_0x2abc78){if(_0x81e831){return _0x141003(_0x81e831);}pm2['disconnect']();return _0x3acd06(_0x2abc78);});});});};exports[_0x49c4('0x9')]=function(_0x2891f4){return connect()['then'](function(){return new BPromise(function(_0x512650,_0x3c782d){return pm2[_0x49c4('0x9')](_0x2891f4,function(_0x3addb2,_0x59f29b){if(_0x3addb2){return _0x3c782d(_0x3addb2);}pm2[_0x49c4('0x5')]();return _0x512650(_0x59f29b);});});});};exports['dump']=function(){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x1806c2,_0xe31fcc){return pm2[_0x49c4('0xa')](function(_0x382040){if(_0x382040){return _0xe31fcc(_0x382040);}return _0x1806c2(_0x49c4('0xb'));});});});};
\ No newline at end of file
+var _0x9c44=['describe','delete','dump','saved','./config','connect','connected','then','start','disconnect','restart','list'];(function(_0x1c5142,_0x30ea72){var _0x1268cb=function(_0xaa2299){while(--_0xaa2299){_0x1c5142['push'](_0x1c5142['shift']());}};_0x1268cb(++_0x30ea72);}(_0x9c44,0x178));var _0x49c4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9c44[_0x4fde08];return _0x12e725;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x49c4('0x0'));function connect(){return new BPromise(function(_0x18bf2d,_0x26844b){return pm2[_0x49c4('0x1')](function(_0x455700){if(_0x455700){return _0x26844b(_0x455700);}return _0x18bf2d(_0x49c4('0x2'));});});};exports['start']=function(_0x4941f1){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x57effd,_0xc1278f){return pm2[_0x49c4('0x4')](_0x4941f1,function(_0x69bc41,_0x2c4e2e){if(_0x69bc41){return _0xc1278f(_0x69bc41);}pm2[_0x49c4('0x5')]();return _0x57effd(_0x2c4e2e);});});});};exports['stop']=function(_0x11c586){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x1d13fb,_0x4487ca){return pm2['stop'](_0x11c586,function(_0x5ab4a3,_0x451ea6){if(_0x5ab4a3){return _0x4487ca(_0x5ab4a3);}pm2[_0x49c4('0x5')]();return _0x1d13fb(_0x451ea6);});});});};exports['restart']=function(_0xb611a1){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x4adb3c,_0x536d42){return pm2[_0x49c4('0x6')](_0xb611a1,function(_0x6d1b08,_0x5487cd){if(_0x6d1b08){return _0x536d42(_0x6d1b08);}pm2[_0x49c4('0x5')]();return _0x4adb3c(_0x5487cd);});});});};exports[_0x49c4('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1909fe,_0x280996){return pm2[_0x49c4('0x7')](function(_0x2decee,_0x12777c){if(_0x2decee){return _0x280996(_0x2decee);}pm2[_0x49c4('0x5')]();return _0x1909fe(_0x12777c);});});});};exports[_0x49c4('0x8')]=function(_0x3de397){return connect()['then'](function(){return new BPromise(function(_0x3acd06,_0x141003){return pm2[_0x49c4('0x8')](_0x3de397,function(_0x81e831,_0x2abc78){if(_0x81e831){return _0x141003(_0x81e831);}pm2['disconnect']();return _0x3acd06(_0x2abc78);});});});};exports[_0x49c4('0x9')]=function(_0x2891f4){return connect()['then'](function(){return new BPromise(function(_0x512650,_0x3c782d){return pm2[_0x49c4('0x9')](_0x2891f4,function(_0x3addb2,_0x59f29b){if(_0x3addb2){return _0x3c782d(_0x3addb2);}pm2[_0x49c4('0x5')]();return _0x512650(_0x59f29b);});});});};exports['dump']=function(){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x1806c2,_0xe31fcc){return pm2[_0x49c4('0xa')](function(_0x382040){if(_0x382040){return _0xe31fcc(_0x382040);}return _0x1806c2(_0x49c4('0xb'));});});});};
\ No newline at end of file
index a43ee91..a3299b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf41e=['moment','../../mysqldb','socket.io-emitter','localhost','Setting','then','chatTimeout','minutes','ChatInteraction','update','system','YYYY-MM-DD\x20HH:mm:ss','length','chatInteraction:update','catch','error','start','lodash'];(function(_0xe45118,_0x5dffbc){var _0x15e15d=function(_0x17eaec){while(--_0x17eaec){_0xe45118['push'](_0xe45118['shift']());}};_0x15e15d(++_0x5dffbc);}(_0xf41e,0x167));var _0xef41=function(_0x144fee,_0x241132){_0x144fee=_0x144fee-0x0;var _0x319c3d=_0xf41e[_0x144fee];return _0x319c3d;};'use strict';var _=require(_0xef41('0x0'));var moment=require(_0xef41('0x1'));var db=require(_0xef41('0x2'))['db'];var io=require(_0xef41('0x3'))({'host':_0xef41('0x4'),'port':0x18eb});function closeInteractions(){var _0x2bf580=0x0;var _0x12629d=[];return db[_0xef41('0x5')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xef41('0x6')](function(_0x1fb446){_0x2bf580=_0x1fb446[_0xef41('0x7')];if(_0x2bf580){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x1fb446[_0xef41('0x7')],_0xef41('0x8'))}}});}else{return[];}})['then'](function(_0x305e69){_0x12629d=_0x305e69;if(_0x2bf580){return db[_0xef41('0x9')][_0xef41('0xa')]({'closeReason':_0xef41('0xb'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0xef41('0xc'))},{'where':{'id':_['map'](_0x12629d||[],'id')}});}})['then'](function(_0x3b0d76){for(var _0x595702=0x0;_0x595702<_0x12629d[_0xef41('0xd')];_0x595702++){io['emit'](_0xef41('0xe'),{'id':_0x12629d[_0x595702]['id'],'closed':!![]});}})[_0xef41('0xf')](function(_0x46aadf){console[_0xef41('0x10')](_0x46aadf);});}exports[_0xef41('0x11')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xb7e7=['moment','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','update','timeout','format','map','length','chatInteraction:update','catch','error','lodash'];(function(_0x3c9095,_0x2e69d5){var _0x34a7a7=function(_0x14d1d9){while(--_0x14d1d9){_0x3c9095['push'](_0x3c9095['shift']());}};_0x34a7a7(++_0x2e69d5);}(_0xb7e7,0x109));var _0x7b7e=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xb7e7[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x7b7e('0x0'));var moment=require(_0x7b7e('0x1'));var db=require('../../mysqldb')['db'];var io=require('socket.io-emitter')({'host':'localhost','port':0x18eb});function closeInteractions(){var _0x56830f=0x0;var _0x4a256b=[];return db[_0x7b7e('0x2')][_0x7b7e('0x3')]({'raw':!![],'attributes':['id',_0x7b7e('0x4')],'where':{'id':0x1}})[_0x7b7e('0x5')](function(_0x649369){_0x56830f=_0x649369[_0x7b7e('0x4')];if(_0x56830f){return db[_0x7b7e('0x6')][_0x7b7e('0x7')]({'raw':!![],'attributes':['id',_0x7b7e('0x8')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x7b7e('0x9')](_0x649369[_0x7b7e('0x4')],_0x7b7e('0xa'))}}});}else{return[];}})[_0x7b7e('0x5')](function(_0xbc106b){_0x4a256b=_0xbc106b;if(_0x56830f){return db['ChatInteraction'][_0x7b7e('0xb')]({'closeReason':'system','disposition':_0x7b7e('0xc'),'closed':!![],'closedAt':moment()[_0x7b7e('0xd')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_[_0x7b7e('0xe')](_0x4a256b||[],'id')}});}})[_0x7b7e('0x5')](function(_0x6f8fc3){for(var _0x1ba742=0x0;_0x1ba742<_0x4a256b[_0x7b7e('0xf')];_0x1ba742++){io['emit'](_0x7b7e('0x10'),{'id':_0x4a256b[_0x1ba742]['id'],'closed':!![]});}})[_0x7b7e('0x11')](function(_0x6dd95a){console[_0x7b7e('0x12')](_0x6dd95a);});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 1ec4200..44d7984 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a88=['scheduled','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','catch','CustomReportId','no\x20report\x20id','Schedule','keys','jobs','toString','keyBy','difference','intersection','length','stop','deleteJob','delete\x20cron','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','start','add\x20cron','exists','stop\x20cron','active','update\x20cron','run','util','path','lodash','cron-job-manager','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','../../files/reports','savename','basename','extname','zip','join','existsSync','status','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtract','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x318767,_0x4171ec){var _0x3a7da4=function(_0x1b32cc){while(--_0x1b32cc){_0x318767['push'](_0x318767['shift']());}};_0x3a7da4(++_0x4171ec);}(_0x0a88,0x7a));var _0x80a8=function(_0xb6e2ea,_0x3b26e9){_0xb6e2ea=_0xb6e2ea-0x0;var _0x2a57bb=_0x0a88[_0xb6e2ea];return _0x2a57bb;};'use strict';var fs=require('fs');var util=require(_0x80a8('0x0'));var path=require(_0x80a8('0x1'));var _=require(_0x80a8('0x2'));var moment=require('moment');var CronJobManager=require(_0x80a8('0x3'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x80a8('0x4'))(_0x80a8('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x80a8('0x6'));var analyticDefaultReportController=require(_0x80a8('0x7'));var client=jayson[_0x80a8('0x8')][_0x80a8('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x26342a,_0x208be9){return function(){logger[_0x80a8('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x26342a[_0x80a8('0xb')]);var _0x42e721=!![];var _0x14ea97={'tls':{'rejectUnauthorized':![]}};if(_0x26342a[_0x80a8('0xc')][_0x80a8('0xd')]['service']){_0x14ea97[_0x80a8('0xe')]=_0x26342a[_0x80a8('0xc')][_0x80a8('0xd')]['service'];}else{_0x14ea97[_0x80a8('0xf')]=_0x26342a[_0x80a8('0xc')][_0x80a8('0xd')][_0x80a8('0xf')];_0x14ea97[_0x80a8('0x10')]=_0x26342a[_0x80a8('0xc')][_0x80a8('0xd')][_0x80a8('0x10')];_0x14ea97[_0x80a8('0x11')]=_0x26342a[_0x80a8('0xc')]['Smtp']['secure'];}if(_0x26342a[_0x80a8('0xc')][_0x80a8('0xd')][_0x80a8('0x12')]){_0x14ea97[_0x80a8('0x13')]={'user':_0x26342a[_0x80a8('0xc')][_0x80a8('0xd')][_0x80a8('0x14')],'pass':_0x26342a[_0x80a8('0xc')][_0x80a8('0xd')][_0x80a8('0x15')]};}var _0x540c13={'account':_0x14ea97,'message':{'from':util[_0x80a8('0x16')](_0x80a8('0x17'),_0x26342a['MailAccount'][_0x80a8('0x18')],_0x26342a['MailAccount'][_0x80a8('0xb')]||_0x26342a[_0x80a8('0xc')][_0x80a8('0xd')]['user']),'to':_0x26342a['email'],'cc':_0x26342a['cc'],'bcc':_0x26342a['bcc'],'subject':util[_0x80a8('0x16')](_0x80a8('0x19'),_0x208be9[_0x80a8('0x18')],_0x26342a[_0x80a8('0x1a')],_0x26342a['subtractUnit'])}};var _0x18563f=path['join'](__dirname,_0x80a8('0x1b'));var _0x3a14cb=_0x208be9[_0x80a8('0x1c')];var _0x1ba389=util[_0x80a8('0x16')]('%s.%s',path[_0x80a8('0x1d')](_0x208be9[_0x80a8('0x1c')],path[_0x80a8('0x1e')](_0x208be9[_0x80a8('0x1c')])),_0x80a8('0x1f'));var _0x62de98=path[_0x80a8('0x20')](_0x18563f,_0x3a14cb);var _0x5af85f=path[_0x80a8('0x20')](_0x18563f,_0x1ba389);if(fs[_0x80a8('0x21')](_0x62de98)){_0x208be9[_0x80a8('0x22')]=_0x80a8('0x23');_0x540c13['message'][_0x80a8('0x24')]=[{'filename':_0x3a14cb,'path':_0x62de98}];_0x540c13[_0x80a8('0x25')][_0x80a8('0x26')]=util[_0x80a8('0x16')](_0x80a8('0x27'),JSON['stringify'](_0x208be9,null,0x2));}else if(fs[_0x80a8('0x21')](_0x5af85f)){_0x208be9['status']=_0x80a8('0x23');_0x540c13[_0x80a8('0x25')][_0x80a8('0x24')]=[{'filename':_0x1ba389,'path':_0x5af85f}];}else{_0x540c13[_0x80a8('0x25')][_0x80a8('0x26')]=_0x80a8('0x28');if(!_0x26342a[_0x80a8('0x29')]){_0x42e721=![];logger[_0x80a8('0xa')](_0x80a8('0x2a'));}}if(_0x42e721){return client[_0x80a8('0x2b')](_0x80a8('0x2c'),_0x540c13)[_0x80a8('0x2d')](function(_0xed5dcf){if(_0xed5dcf['error']){return logger[_0x80a8('0x2e')](_0x80a8('0x2f'),JSON[_0x80a8('0x30')](_0xed5dcf));}return logger[_0x80a8('0xa')](_0x80a8('0x31'));})['catch'](function(_0xe22ee2){return logger[_0x80a8('0x2e')](_0x80a8('0x2f'),JSON[_0x80a8('0x30')](_0xe22ee2));});}};}function handleError(){return function(_0x536ab1){return logger[_0x80a8('0x2e')](JSON[_0x80a8('0x30')](_0x536ab1));};}function handleResult(_0x4aaa57){return function(_0x5796bd){logger[_0x80a8('0xa')](_0x80a8('0x32'),JSON['stringify'](_0x5796bd));if(_0x4aaa57[_0x80a8('0xc')]&&_0x4aaa57[_0x80a8('0xc')][_0x80a8('0xd')]&&!_[_0x80a8('0x33')](_0x4aaa57[_0x80a8('0xb')])){setTimeout(handleSendEmail(_0x4aaa57,_0x5796bd),0x3c*0x3e8);}};}function handleJob(_0x4eb04b){return function(){try{if(_[_0x80a8('0x33')](_0x4eb04b[_0x80a8('0x1a')])){return logger['info'](_0x80a8('0x34'));}if(_[_0x80a8('0x33')](_0x4eb04b[_0x80a8('0x35')])){return logger[_0x80a8('0xa')]('subtractUnit\x20null\x20or\x20undefined');}var _0x426542={'startDate':moment()[_0x80a8('0x36')](_0x4eb04b[_0x80a8('0x1a')],_0x4eb04b[_0x80a8('0x35')])['format'](_0x80a8('0x37')),'endDate':moment()[_0x80a8('0x16')](_0x80a8('0x37')),'type':_0x80a8('0x38'),'output':_0x4eb04b['output'],'name':_0x4eb04b[_0x80a8('0x18')]};if(!_[_0x80a8('0x33')](_0x4eb04b['DefaultReportId'])){logger[_0x80a8('0xa')](_0x80a8('0x39'),_0x4eb04b[_0x80a8('0x3a')]);return analyticDefaultReportController[_0x80a8('0x3b')]({'id':_0x4eb04b[_0x80a8('0x3a')]},_0x426542)['then'](handleResult(_0x4eb04b))[_0x80a8('0x3c')](handleError());}if(!_[_0x80a8('0x33')](_0x4eb04b[_0x80a8('0x3d')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x4eb04b[_0x80a8('0x3d')]);return analyticCustomReportController[_0x80a8('0x3b')]({'id':_0x4eb04b[_0x80a8('0x3d')]},_0x426542)[_0x80a8('0x2d')](handleResult(_0x4eb04b))[_0x80a8('0x3c')](handleError());}}catch(_0xa13d50){logger[_0x80a8('0x2e')](JSON[_0x80a8('0x30')](_0xa13d50));}return logger[_0x80a8('0xa')](_0x80a8('0x3e'));};}function getJobs(_0x1facd9){var _0xd482d8={};if(_0x1facd9){_0xd482d8['id']=_0x1facd9;}return db[_0x80a8('0x3f')]['findAll']({'where':_0xd482d8,'include':[{'model':db[_0x80a8('0xc')],'attributes':['id',_0x80a8('0x18'),_0x80a8('0xb')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]}]})[_0x80a8('0x2d')](function(_0x36f9e9){var _0x4a6aab=_[_0x80a8('0x40')](manager[_0x80a8('0x41')]);var _0x515733=_['map'](_0x36f9e9,function(_0x3e330e){return _0x3e330e['id'][_0x80a8('0x42')]();});var _0x1dabda=_[_0x80a8('0x43')](_0x36f9e9,function(_0x343438){return _0x343438['id'][_0x80a8('0x42')]();});var _0x3a7996=_0x1facd9?_0x515733:_[_0x80a8('0x44')](_0x515733,_0x4a6aab);var _0xd84198=_[_0x80a8('0x45')](_0x515733,_0x4a6aab);var _0x43bbcd=_[_0x80a8('0x44')](_0x4a6aab,_0x515733);var _0x5a4620;var _0x163dfd;for(_0x5a4620=0x0;_0x5a4620<_0x43bbcd[_0x80a8('0x46')]&&!_0x1facd9;_0x5a4620+=0x1){_0x163dfd=_0x43bbcd[_0x5a4620]['toString']();if(manager['exists'](_0x163dfd)){manager[_0x80a8('0x47')](_0x163dfd);manager[_0x80a8('0x48')](_0x163dfd);logger[_0x80a8('0xa')](_0x80a8('0x49'),_0x163dfd);}}logger['info']('toRun',JSON[_0x80a8('0x30')](_0x3a7996));for(_0x5a4620=0x0;_0x5a4620<_0x3a7996[_0x80a8('0x46')];_0x5a4620+=0x1){_0x163dfd=_0x3a7996[_0x5a4620][_0x80a8('0x42')]();logger[_0x80a8('0xa')](_0x80a8('0x4a'),_0x163dfd);if(_0x1facd9){logger[_0x80a8('0xa')](_0x80a8('0x4b'),_0x1facd9);logger['info'](JSON[_0x80a8('0x30')](_0x1dabda[_0x163dfd]));BPromise[_0x80a8('0x4c')]()[_0x80a8('0x2d')](handleJob(_0x1dabda[_0x163dfd]));logger['info'](_0x80a8('0x4d'),_0x1dabda[_0x163dfd][_0x80a8('0x18')],_0x1dabda[_0x163dfd][_0x80a8('0x4e')]);}else if(_0x1dabda[_0x163dfd][_0x80a8('0x4e')]&&_0x1dabda[_0x163dfd]['active']&&moment()[_0x80a8('0x4f')](_0x1dabda[_0x163dfd][_0x80a8('0x50')],_0x1dabda[_0x163dfd][_0x80a8('0x51')])){manager['add'](_0x163dfd,_0x1dabda[_0x163dfd][_0x80a8('0x4e')],handleJob(_0x1dabda[_0x163dfd]));manager[_0x80a8('0x52')](_0x163dfd);logger['info'](_0x80a8('0x53'),_0x1dabda[_0x163dfd][_0x80a8('0x18')],_0x1dabda[_0x163dfd]['cron']);}else if(manager[_0x80a8('0x54')](_0x163dfd)){manager['stop'](_0x163dfd);manager['deleteJob'](_0x163dfd);logger['info'](_0x80a8('0x55'),_0x1dabda[_0x163dfd][_0x80a8('0x18')],_0x1dabda[_0x163dfd][_0x80a8('0x4e')]);}}for(_0x5a4620=0x0,_0x163dfd;_0x5a4620<_0xd84198[_0x80a8('0x46')]&&!_0x1facd9;_0x5a4620+=0x1){_0x163dfd=_0xd84198[_0x5a4620]['toString']();if(manager[_0x80a8('0x54')](_0x163dfd)){if(_0x1dabda[_0x163dfd][_0x80a8('0x4e')]&&_0x1dabda[_0x163dfd][_0x80a8('0x56')]&&moment()['isBetween'](_0x1dabda[_0x163dfd][_0x80a8('0x50')],_0x1dabda[_0x163dfd][_0x80a8('0x51')])){manager['update'](_0x163dfd,_0x1dabda[_0x163dfd][_0x80a8('0x4e')],handleJob(_0x1dabda[_0x163dfd]));logger[_0x80a8('0xa')](_0x80a8('0x57'),_0x1dabda[_0x163dfd][_0x80a8('0x18')],_0x1dabda[_0x163dfd]['cron']);}else{manager[_0x80a8('0x47')](_0x163dfd);manager[_0x80a8('0x48')](_0x163dfd);logger[_0x80a8('0xa')](_0x80a8('0x55'),_0x1dabda[_0x163dfd]['name'],_0x1dabda[_0x163dfd][_0x80a8('0x4e')]);}}}})[_0x80a8('0x3c')](function(_0x33de34){logger[_0x80a8('0x2e')](JSON[_0x80a8('0x30')](_0x33de34));});}exports[_0x80a8('0x58')]=function(_0x281294){return getJobs(_0x281294);};exports[_0x80a8('0x52')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0xdd04=['SendMail','then','error','email\x20sent','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','isNil','DefaultReportId','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','keyBy','difference','intersection','toString','exists','deleteJob','length','index','my\x20id','resolve','run\x20job','active','isBetween','startAt','endAt','start','add\x20cron','cron','stop','stop\x20cron','update','update\x20cron','run','path','lodash','moment','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','\x22%s\x22\x20<%s>','name','format','subtractNumber','subtractUnit','join','%s.%s','basename','extname','savename','zip','existsSync','status','Sent','message','attachments','text','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xdd04,0xde));var _0x4dd0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd04[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x4dd0('0x0'));var _=require(_0x4dd0('0x1'));var moment=require(_0x4dd0('0x2'));var CronJobManager=require(_0x4dd0('0x3'));var jayson=require(_0x4dd0('0x4'));var BPromise=require('bluebird');var logger=require(_0x4dd0('0x5'))(_0x4dd0('0x6'));var db=require(_0x4dd0('0x7'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x4dd0('0x8'));var client=jayson[_0x4dd0('0x9')][_0x4dd0('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5a04c0,_0xc773ca){return function(){logger[_0x4dd0('0xb')](_0x4dd0('0xc'),_0x5a04c0[_0x4dd0('0xd')]);var _0x28fff2=!![];var _0x258efc={'tls':{'rejectUnauthorized':![]}};if(_0x5a04c0[_0x4dd0('0xe')][_0x4dd0('0xf')][_0x4dd0('0x10')]){_0x258efc[_0x4dd0('0x10')]=_0x5a04c0['MailAccount'][_0x4dd0('0xf')][_0x4dd0('0x10')];}else{_0x258efc[_0x4dd0('0x11')]=_0x5a04c0[_0x4dd0('0xe')][_0x4dd0('0xf')]['host'];_0x258efc[_0x4dd0('0x12')]=_0x5a04c0['MailAccount'][_0x4dd0('0xf')]['port'];_0x258efc[_0x4dd0('0x13')]=_0x5a04c0[_0x4dd0('0xe')][_0x4dd0('0xf')][_0x4dd0('0x13')];}if(_0x5a04c0[_0x4dd0('0xe')][_0x4dd0('0xf')][_0x4dd0('0x14')]){_0x258efc[_0x4dd0('0x15')]={'user':_0x5a04c0['MailAccount'][_0x4dd0('0xf')][_0x4dd0('0x16')],'pass':_0x5a04c0[_0x4dd0('0xe')][_0x4dd0('0xf')]['pass']};}var _0x2937de={'account':_0x258efc,'message':{'from':util['format'](_0x4dd0('0x17'),_0x5a04c0['MailAccount'][_0x4dd0('0x18')],_0x5a04c0[_0x4dd0('0xe')][_0x4dd0('0xd')]||_0x5a04c0[_0x4dd0('0xe')]['Smtp']['user']),'to':_0x5a04c0[_0x4dd0('0xd')],'cc':_0x5a04c0['cc'],'bcc':_0x5a04c0['bcc'],'subject':util[_0x4dd0('0x19')]('Report\x20%s\x20last\x20%s\x20%s',_0xc773ca[_0x4dd0('0x18')],_0x5a04c0[_0x4dd0('0x1a')],_0x5a04c0[_0x4dd0('0x1b')])}};var _0xaea44d=path[_0x4dd0('0x1c')](__dirname,'../../files/reports');var _0x1444e8=_0xc773ca['savename'];var _0x323a09=util[_0x4dd0('0x19')](_0x4dd0('0x1d'),path[_0x4dd0('0x1e')](_0xc773ca['savename'],path[_0x4dd0('0x1f')](_0xc773ca[_0x4dd0('0x20')])),_0x4dd0('0x21'));var _0x5be4a2=path[_0x4dd0('0x1c')](_0xaea44d,_0x1444e8);var _0x36f1f8=path[_0x4dd0('0x1c')](_0xaea44d,_0x323a09);if(fs[_0x4dd0('0x22')](_0x5be4a2)){_0xc773ca[_0x4dd0('0x23')]=_0x4dd0('0x24');_0x2937de[_0x4dd0('0x25')][_0x4dd0('0x26')]=[{'filename':_0x1444e8,'path':_0x5be4a2}];_0x2937de[_0x4dd0('0x25')][_0x4dd0('0x27')]=util[_0x4dd0('0x19')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x4dd0('0x28')](_0xc773ca,null,0x2));}else if(fs['existsSync'](_0x36f1f8)){_0xc773ca[_0x4dd0('0x23')]='Sent';_0x2937de['message'][_0x4dd0('0x26')]=[{'filename':_0x323a09,'path':_0x36f1f8}];}else{_0x2937de['message']['text']=_0x4dd0('0x29');if(!_0x5a04c0[_0x4dd0('0x2a')]){_0x28fff2=![];logger['info'](_0x4dd0('0x2b'));}}if(_0x28fff2){return client[_0x4dd0('0x2c')](_0x4dd0('0x2d'),_0x2937de)[_0x4dd0('0x2e')](function(_0x2fd7b0){if(_0x2fd7b0['error']){return logger[_0x4dd0('0x2f')]('error\x20mail',JSON[_0x4dd0('0x28')](_0x2fd7b0));}return logger['info'](_0x4dd0('0x30'));})['catch'](function(_0x4d66d5){return logger[_0x4dd0('0x2f')]('error\x20mail',JSON[_0x4dd0('0x28')](_0x4d66d5));});}};}function handleError(){return function(_0x5099a6){return logger[_0x4dd0('0x2f')](JSON['stringify'](_0x5099a6));};}function handleResult(_0x2fe9ba){return function(_0x1d064d){logger[_0x4dd0('0xb')]('data',JSON[_0x4dd0('0x28')](_0x1d064d));if(_0x2fe9ba[_0x4dd0('0xe')]&&_0x2fe9ba['MailAccount']['Smtp']&&!_['isNil'](_0x2fe9ba[_0x4dd0('0xd')])){setTimeout(handleSendEmail(_0x2fe9ba,_0x1d064d),0x3c*0x3e8);}};}function handleJob(_0x5a7195){return function(){try{if(_['isNil'](_0x5a7195[_0x4dd0('0x1a')])){return logger[_0x4dd0('0xb')]('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0x5a7195[_0x4dd0('0x1b')])){return logger[_0x4dd0('0xb')](_0x4dd0('0x31'));}var _0x340b8b={'startDate':moment()[_0x4dd0('0x32')](_0x5a7195['subtractNumber'],_0x5a7195[_0x4dd0('0x1b')])[_0x4dd0('0x19')](_0x4dd0('0x33')),'endDate':moment()[_0x4dd0('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x5a7195[_0x4dd0('0x34')],'name':_0x5a7195['name']};if(!_[_0x4dd0('0x35')](_0x5a7195[_0x4dd0('0x36')])){logger[_0x4dd0('0xb')]('exec\x20defaul\x20report\x20id:%s',_0x5a7195['DefaultReportId']);return analyticDefaultReportController[_0x4dd0('0x37')]({'id':_0x5a7195[_0x4dd0('0x36')]},_0x340b8b)[_0x4dd0('0x2e')](handleResult(_0x5a7195))[_0x4dd0('0x38')](handleError());}if(!_['isNil'](_0x5a7195[_0x4dd0('0x39')])){logger['info'](_0x4dd0('0x3a'),_0x5a7195['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x5a7195[_0x4dd0('0x39')]},_0x340b8b)[_0x4dd0('0x2e')](handleResult(_0x5a7195))[_0x4dd0('0x38')](handleError());}}catch(_0xbd93ba){logger[_0x4dd0('0x2f')](JSON[_0x4dd0('0x28')](_0xbd93ba));}return logger[_0x4dd0('0xb')](_0x4dd0('0x3b'));};}function getJobs(_0x85488a){var _0x299331={};if(_0x85488a){_0x299331['id']=_0x85488a;}return db[_0x4dd0('0x3c')][_0x4dd0('0x3d')]({'where':_0x299331,'include':[{'model':db[_0x4dd0('0xe')],'attributes':['id',_0x4dd0('0x18'),_0x4dd0('0xd')],'include':[{'model':db[_0x4dd0('0x3e')],'as':_0x4dd0('0xf')}]}]})[_0x4dd0('0x2e')](function(_0x530557){var _0x125141=_[_0x4dd0('0x3f')](manager[_0x4dd0('0x40')]);var _0x38c14f=_[_0x4dd0('0x41')](_0x530557,function(_0x5a72dc){return _0x5a72dc['id']['toString']();});var _0x9d7751=_[_0x4dd0('0x42')](_0x530557,function(_0x4ccfb0){return _0x4ccfb0['id']['toString']();});var _0x3ff3ad=_0x85488a?_0x38c14f:_[_0x4dd0('0x43')](_0x38c14f,_0x125141);var _0x1fee2d=_[_0x4dd0('0x44')](_0x38c14f,_0x125141);var _0x5a4360=_[_0x4dd0('0x43')](_0x125141,_0x38c14f);var _0x21fc46;var _0x3d0859;for(_0x21fc46=0x0;_0x21fc46<_0x5a4360['length']&&!_0x85488a;_0x21fc46+=0x1){_0x3d0859=_0x5a4360[_0x21fc46][_0x4dd0('0x45')]();if(manager[_0x4dd0('0x46')](_0x3d0859)){manager['stop'](_0x3d0859);manager[_0x4dd0('0x47')](_0x3d0859);logger['info']('delete\x20cron',_0x3d0859);}}logger[_0x4dd0('0xb')]('toRun',JSON['stringify'](_0x3ff3ad));for(_0x21fc46=0x0;_0x21fc46<_0x3ff3ad[_0x4dd0('0x48')];_0x21fc46+=0x1){_0x3d0859=_0x3ff3ad[_0x21fc46][_0x4dd0('0x45')]();logger['info'](_0x4dd0('0x49'),_0x3d0859);if(_0x85488a){logger[_0x4dd0('0xb')](_0x4dd0('0x4a'),_0x85488a);logger['info'](JSON['stringify'](_0x9d7751[_0x3d0859]));BPromise[_0x4dd0('0x4b')]()[_0x4dd0('0x2e')](handleJob(_0x9d7751[_0x3d0859]));logger[_0x4dd0('0xb')](_0x4dd0('0x4c'),_0x9d7751[_0x3d0859]['name'],_0x9d7751[_0x3d0859]['cron']);}else if(_0x9d7751[_0x3d0859]['cron']&&_0x9d7751[_0x3d0859][_0x4dd0('0x4d')]&&moment()[_0x4dd0('0x4e')](_0x9d7751[_0x3d0859][_0x4dd0('0x4f')],_0x9d7751[_0x3d0859][_0x4dd0('0x50')])){manager['add'](_0x3d0859,_0x9d7751[_0x3d0859]['cron'],handleJob(_0x9d7751[_0x3d0859]));manager[_0x4dd0('0x51')](_0x3d0859);logger['info'](_0x4dd0('0x52'),_0x9d7751[_0x3d0859][_0x4dd0('0x18')],_0x9d7751[_0x3d0859][_0x4dd0('0x53')]);}else if(manager['exists'](_0x3d0859)){manager[_0x4dd0('0x54')](_0x3d0859);manager['deleteJob'](_0x3d0859);logger['info'](_0x4dd0('0x55'),_0x9d7751[_0x3d0859][_0x4dd0('0x18')],_0x9d7751[_0x3d0859]['cron']);}}for(_0x21fc46=0x0,_0x3d0859;_0x21fc46<_0x1fee2d['length']&&!_0x85488a;_0x21fc46+=0x1){_0x3d0859=_0x1fee2d[_0x21fc46][_0x4dd0('0x45')]();if(manager[_0x4dd0('0x46')](_0x3d0859)){if(_0x9d7751[_0x3d0859][_0x4dd0('0x53')]&&_0x9d7751[_0x3d0859][_0x4dd0('0x4d')]&&moment()[_0x4dd0('0x4e')](_0x9d7751[_0x3d0859]['startAt'],_0x9d7751[_0x3d0859]['endAt'])){manager[_0x4dd0('0x56')](_0x3d0859,_0x9d7751[_0x3d0859][_0x4dd0('0x53')],handleJob(_0x9d7751[_0x3d0859]));logger[_0x4dd0('0xb')](_0x4dd0('0x57'),_0x9d7751[_0x3d0859][_0x4dd0('0x18')],_0x9d7751[_0x3d0859][_0x4dd0('0x53')]);}else{manager[_0x4dd0('0x54')](_0x3d0859);manager[_0x4dd0('0x47')](_0x3d0859);logger[_0x4dd0('0xb')]('stop\x20cron',_0x9d7751[_0x3d0859]['name'],_0x9d7751[_0x3d0859][_0x4dd0('0x53')]);}}}})[_0x4dd0('0x38')](function(_0x27d843){logger['error'](JSON[_0x4dd0('0x28')](_0x27d843));});}exports[_0x4dd0('0x58')]=function(_0x24ee0c){return getJobs(_0x24ee0c);};exports[_0x4dd0('0x51')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index 4bbb0f3..cb6ece5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f1f=['destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','hopper2','catch','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact'];(function(_0x1ff072,_0x21e20c){var _0x2eb287=function(_0x4b7ab6){while(--_0x4b7ab6){_0x1ff072['push'](_0x1ff072['shift']());}};_0x2eb287(++_0x21e20c);}(_0x4f1f,0xbe));var _0xf4f1=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x4f1f[_0x455c6c];return _0x488242;};'use strict';var util=require('util');var db=require(_0xf4f1('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xf4f1('0x1')]({'id':i,'firstName':_0xf4f1('0x2')+i,'lastName':_0xf4f1('0x3')+i,'phone':0xf879fb460+i,'email':_0xf4f1('0x4')+i+_0xf4f1('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xf4f1('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xf4f1('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xf4f1('0x1')]({'id':i,'firstName':_0xf4f1('0x2')+i,'lastName':_0xf4f1('0x3')+i,'phone':0xf879fb460+i,'email':_0xf4f1('0x4')+i+_0xf4f1('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xf4f1('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xf4f1('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf4f1('0x6')](),'updatedAt':Date[_0xf4f1('0x6')]()});}db[_0xf4f1('0x7')][_0xf4f1('0x8')]({'where':{}})[_0xf4f1('0x9')](function(){return db[_0xf4f1('0x7')][_0xf4f1('0xa')](contacts);})[_0xf4f1('0x9')](function(){console[_0xf4f1('0xb')](_0xf4f1('0xc'),_0xf4f1('0xd'));return db[_0xf4f1('0xe')][_0xf4f1('0x8')]({'where':{}});})[_0xf4f1('0x9')](function(){return db[_0xf4f1('0xe')][_0xf4f1('0xa')](hopper);})['then'](function(){console['log'](_0xf4f1('0xc'),_0xf4f1('0xf'));return db[_0xf4f1('0x7')][_0xf4f1('0xa')](contacts2);})[_0xf4f1('0x9')](function(){console[_0xf4f1('0xb')](_0xf4f1('0xc'),'contacts2');return db[_0xf4f1('0xe')][_0xf4f1('0xa')](hopper2);})[_0xf4f1('0x9')](function(){console['log'](_0xf4f1('0xc'),_0xf4f1('0x10'));})[_0xf4f1('0x11')](function(_0x257f01){console[_0xf4f1('0xb')](_0x257f01);});
\ No newline at end of file
+var _0x054f=['destroy','bulkCreate','hopper1','contacts2','catch','util','../mysqldb','Biondo','innocenzo.biondo','@xcally.com','push','now','Innocenzo','CmContact','then','log','finished\x20populating','contacts1','CmHopper'];(function(_0x56d80e,_0x29a4e3){var _0x48805f=function(_0x2b2e79){while(--_0x2b2e79){_0x56d80e['push'](_0x56d80e['shift']());}};_0x48805f(++_0x29a4e3);}(_0x054f,0x181));var _0xf054=function(_0x1b251b,_0x148f6f){_0x1b251b=_0x1b251b-0x0;var _0x5caca1=_0x054f[_0x1b251b];return _0x5caca1;};'use strict';var util=require(_0xf054('0x0'));var db=require(_0xf054('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':_0xf054('0x2')+i,'phone':0xf879fb460+i,'email':_0xf054('0x3')+i+_0xf054('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xf054('0x5')]({'id':i,'active':![],'scheduledat':Date[_0xf054('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xf054('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xf054('0x5')]({'id':i,'firstName':_0xf054('0x7')+i,'lastName':_0xf054('0x2')+i,'phone':0xf879fb460+i,'email':_0xf054('0x3')+i+_0xf054('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xf054('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf054('0x6')](),'updatedAt':Date[_0xf054('0x6')]()});}db[_0xf054('0x8')]['destroy']({'where':{}})[_0xf054('0x9')](function(){return db[_0xf054('0x8')]['bulkCreate'](contacts);})[_0xf054('0x9')](function(){console[_0xf054('0xa')](_0xf054('0xb'),_0xf054('0xc'));return db[_0xf054('0xd')][_0xf054('0xe')]({'where':{}});})[_0xf054('0x9')](function(){return db[_0xf054('0xd')][_0xf054('0xf')](hopper);})[_0xf054('0x9')](function(){console[_0xf054('0xa')](_0xf054('0xb'),_0xf054('0x10'));return db[_0xf054('0x8')][_0xf054('0xf')](contacts2);})[_0xf054('0x9')](function(){console[_0xf054('0xa')]('finished\x20populating',_0xf054('0x11'));return db[_0xf054('0xd')][_0xf054('0xf')](hopper2);})['then'](function(){console[_0xf054('0xa')]('finished\x20populating','hopper2');})[_0xf054('0x12')](function(_0x5a4d2f){console['log'](_0x5a4d2f);});
\ No newline at end of file
index 25d148f..94faf64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x017a=['catch','util','../mysqldb','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','then','log','add\x20user'];(function(_0x2c3b65,_0x147d96){var _0x1f975a=function(_0x7288d4){while(--_0x7288d4){_0x2c3b65['push'](_0x2c3b65['shift']());}};_0x1f975a(++_0x147d96);}(_0x017a,0x151));var _0xa017=function(_0x3f736a,_0x515c60){_0x3f736a=_0x3f736a-0x0;var _0x1bed5f=_0x017a[_0x3f736a];return _0x1bed5f;};'use strict';var util=require(_0xa017('0x0'));var db=require(_0xa017('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xa017('0x2')](_0xa017('0x3'),_0xa017('0x4'),i),'fullname':util[_0xa017('0x2')](_0xa017('0x3'),_0xa017('0x4'),i),'email':util[_0xa017('0x2')](_0xa017('0x5'),_0xa017('0x4'),i),'role':_0xa017('0x4'),'password':_0xa017('0x6'),'internal':0xfa0+i,'type':_0xa017('0x7'),'transport':[_0xa017('0x8'),'ws',_0xa017('0x9')],'disallow':[_0xa017('0xa')],'allow':[_0xa017('0xb')],'defaultuser':util['format'](_0xa017('0x3'),_0xa017('0x4'),i),'encryption':_0xa017('0xc'),'avpf':_0xa017('0xc'),'force_avp':_0xa017('0xc'),'icesupport':_0xa017('0xc'),'dtlsenable':_0xa017('0xc'),'dtlsverify':'no','dtlscertfile':_0xa017('0xd'),'dtlsprivatekey':_0xa017('0xe'),'dtlssetup':'actpass','callerid':util[_0xa017('0x2')](_0xa017('0xf'),util[_0xa017('0x2')]('%s%s',_0xa017('0x4'),i),0xfa0+i)});}db[_0xa017('0x10')]['bulkCreate'](users)[_0xa017('0x11')](function(){console[_0xa017('0x12')](_0xa017('0x13'));})[_0xa017('0x14')](function(_0xd05dd7){console[_0xa017('0x12')](_0xd05dd7);});
\ No newline at end of file
+var _0x2839=['push','format','%s%s','agent','%s%s@xcally.com','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','bulkCreate','add\x20user','log','../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2839,0xe3));var _0x9283=function(_0x197188,_0x258467){_0x197188=_0x197188-0x0;var _0x49832f=_0x2839[_0x197188];return _0x49832f;};'use strict';var util=require('util');var db=require(_0x9283('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x9283('0x1')]({'name':util[_0x9283('0x2')](_0x9283('0x3'),_0x9283('0x4'),i),'fullname':util['format']('%s%s',_0x9283('0x4'),i),'email':util[_0x9283('0x2')](_0x9283('0x5'),_0x9283('0x4'),i),'role':_0x9283('0x4'),'password':'password','internal':0xfa0+i,'type':_0x9283('0x6'),'transport':[_0x9283('0x7'),'ws',_0x9283('0x8')],'disallow':[_0x9283('0x9')],'allow':[_0x9283('0xa')],'defaultuser':util[_0x9283('0x2')](_0x9283('0x3'),_0x9283('0x4'),i),'encryption':_0x9283('0xb'),'avpf':_0x9283('0xb'),'force_avp':_0x9283('0xb'),'icesupport':'yes','dtlsenable':_0x9283('0xb'),'dtlsverify':'no','dtlscertfile':_0x9283('0xc'),'dtlsprivatekey':_0x9283('0xd'),'dtlssetup':_0x9283('0xe'),'callerid':util[_0x9283('0x2')](_0x9283('0xf'),util[_0x9283('0x2')](_0x9283('0x3'),_0x9283('0x4'),i),0xfa0+i)});}db['User'][_0x9283('0x10')](users)['then'](function(){console['log'](_0x9283('0x11'));})['catch'](function(_0x317696){console[_0x9283('0x12')](_0x317696);});
\ No newline at end of file
index 38ba188..31260a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6d8=['query','User','find','ChatInteraction','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','OpenchannelInteraction','user:%s','admin','include','push','ChatQueue','SmsQueue','findAll','MailQueue','Trunk','Campaign','user','voice:inbound','voice:outbound','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getSmsQueues','all','then','length','voice','chat','fax','sms','mail','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','ChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','removeFaxInteractions','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','address','request','connection','remoteAddress','connectedAt','SocketIO\x20','disconnect','DISCONNECTED','lodash','bluebird','./environment','Agents','role','agent','name','telephone','type','ivr','format','%s:queue:%s','handshake'];(function(_0x298abe,_0x54b3bf){var _0x47cb9d=function(_0x148df8){while(--_0x148df8){_0x298abe['push'](_0x298abe['shift']());}};_0x47cb9d(++_0x54b3bf);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x42e988,_0xd8abe0){_0x42e988=_0x42e988-0x0;var _0x5ce1fb=_0xc6d8[_0x42e988];return _0x5ce1fb;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var BPromise=require(_0x8c6d('0x1'));var db=require('../mysqldb')['db'];var config=require(_0x8c6d('0x2'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x8c6d('0x3'),'model':db['User'],'attributes':['id','name',_0x8c6d('0x4')],'raw':!![],'where':{'role':_0x8c6d('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x8c6d('0x6')],'where':{'role':_0x8c6d('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x8c6d('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0x8c6d('0x6')],'where':{'role':_0x8c6d('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x8c6d('0x8')],'where':{'type':_0x8c6d('0x9')}};function joinOrLeaveQueues(_0x16d4b2,_0x5c8fec,_0x3cecc1,_0x1ec65c){_0x16d4b2[_0x5c8fec](util[_0x8c6d('0xa')](_0x8c6d('0xb'),_0x3cecc1,_0x1ec65c[_0x8c6d('0x6')]));if(_0x1ec65c[_0x8c6d('0x3')]){for(var _0x60cd5c=0x0;_0x60cd5c<_0x1ec65c[_0x8c6d('0x3')]['length'];_0x60cd5c+=0x1){_0x16d4b2[_0x5c8fec](util[_0x8c6d('0xa')]('user:%s',_0x1ec65c['Agents'][_0x60cd5c][_0x8c6d('0x6')]));}}}function joinOrLeave(_0x890e85,_0x131d97,_0x8ec2d4){var _0x30ecfa;if(_0x890e85[_0x8c6d('0xc')][_0x8c6d('0xd')]['id']){db[_0x8c6d('0xe')][_0x8c6d('0xf')]({'attributes':['id',_0x8c6d('0x6'),'role'],'where':{'id':_0x890e85[_0x8c6d('0xc')]['query']['id']},'include':[{'model':db[_0x8c6d('0x10')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x8c6d('0x11')],'as':_0x8c6d('0x12'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x8c6d('0x13'),'attributes':['id'],'raw':!![]},{'model':db[_0x8c6d('0x14')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x8c6d('0x15')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x21b8ee){if(_0x21b8ee){_0x30ecfa=_0x21b8ee;_0x890e85[_0x131d97](util['format'](_0x8c6d('0x16'),_0x21b8ee[_0x8c6d('0x6')]));var _0x1d0f0a=[];switch(_0x21b8ee[_0x8c6d('0x4')]){case _0x8c6d('0x17'):_0x890e85[_0x131d97]('voice:inbound');_0x890e85[_0x131d97]('voice:outbound');if(queryQueues['hasOwnProperty'](_0x8c6d('0x18'))){delete queryQueues['include'];}_0x1d0f0a[_0x8c6d('0x19')](db['VoiceQueue']['findAll'](queryQueues));_0x1d0f0a[_0x8c6d('0x19')](db[_0x8c6d('0x1a')]['findAll'](queryQueues));_0x1d0f0a['push'](db['FaxQueue']['findAll'](queryQueues));_0x1d0f0a[_0x8c6d('0x19')](db[_0x8c6d('0x1b')][_0x8c6d('0x1c')](queryQueues));_0x1d0f0a['push'](db[_0x8c6d('0x1d')]['findAll'](queryQueues));_0x1d0f0a[_0x8c6d('0x19')](db['OpenchannelQueue'][_0x8c6d('0x1c')](queryQueues));_0x1d0f0a[_0x8c6d('0x19')](db[_0x8c6d('0xe')][_0x8c6d('0x1c')](queryTelephones));_0x1d0f0a[_0x8c6d('0x19')](db[_0x8c6d('0x1e')][_0x8c6d('0x1c')](queryTrunks));_0x1d0f0a[_0x8c6d('0x19')](db[_0x8c6d('0x1f')]['findAll'](queryCampaigns));_0x1d0f0a['push'](db[_0x8c6d('0xe')][_0x8c6d('0x1c')](queryAgents));break;case _0x8c6d('0x20'):_0x890e85[_0x131d97](_0x8c6d('0x21'));_0x890e85[_0x131d97](_0x8c6d('0x22'));_0x1d0f0a[_0x8c6d('0x19')](_0x21b8ee[_0x8c6d('0x23')](queryQueues));_0x1d0f0a[_0x8c6d('0x19')](_0x21b8ee[_0x8c6d('0x24')](queryQueues));_0x1d0f0a[_0x8c6d('0x19')](_0x21b8ee[_0x8c6d('0x25')](queryQueues));_0x1d0f0a[_0x8c6d('0x19')](_0x21b8ee['getSmsQueues'](queryQueues));_0x1d0f0a[_0x8c6d('0x19')](_0x21b8ee[_0x8c6d('0x26')](queryQueues));_0x1d0f0a[_0x8c6d('0x19')](_0x21b8ee[_0x8c6d('0x27')](queryQueues));_0x1d0f0a[_0x8c6d('0x19')](db[_0x8c6d('0xe')][_0x8c6d('0x1c')](queryTelephones));_0x1d0f0a[_0x8c6d('0x19')](db[_0x8c6d('0x1e')]['findAll'](queryTrunks));_0x1d0f0a[_0x8c6d('0x19')](db['Campaign'][_0x8c6d('0x1c')](queryCampaigns));_0x1d0f0a[_0x8c6d('0x19')](db[_0x8c6d('0xe')][_0x8c6d('0x1c')](queryAgents));break;case _0x8c6d('0x5'):_0x890e85[_0x131d97](_0x8c6d('0x21'));_0x890e85[_0x131d97]('voice:outbound');_0x1d0f0a['push'](_0x21b8ee[_0x8c6d('0x23')]({'attributes':['id',_0x8c6d('0x6')]}));_0x1d0f0a[_0x8c6d('0x19')](_0x21b8ee[_0x8c6d('0x24')]({'attributes':['id','name']}));_0x1d0f0a[_0x8c6d('0x19')](_0x21b8ee[_0x8c6d('0x25')]({'attributes':['id',_0x8c6d('0x6')]}));_0x1d0f0a[_0x8c6d('0x19')](_0x21b8ee[_0x8c6d('0x28')]({'attributes':['id',_0x8c6d('0x6')]}));_0x1d0f0a['push'](_0x21b8ee[_0x8c6d('0x26')]({'attributes':['id',_0x8c6d('0x6')]}));_0x1d0f0a[_0x8c6d('0x19')](_0x21b8ee[_0x8c6d('0x27')]({'attributes':['id',_0x8c6d('0x6')]}));break;}return BPromise[_0x8c6d('0x29')](_0x1d0f0a);}})[_0x8c6d('0x2a')](function(_0x301332){if(_0x301332&&_0x301332[_0x8c6d('0x2b')]){for(var _0x30025b=0x0;_0x30025b<_0x301332[_0x8c6d('0x2b')];_0x30025b+=0x1){for(var _0x3254dd=0x0;_0x3254dd<_0x301332[_0x30025b]['length'];_0x3254dd+=0x1){switch(_0x30025b){case 0x0:joinOrLeaveQueues(_0x890e85,_0x131d97,_0x8c6d('0x2c'),_0x301332[_0x30025b][_0x3254dd]);break;case 0x1:joinOrLeaveQueues(_0x890e85,_0x131d97,_0x8c6d('0x2d'),_0x301332[_0x30025b][_0x3254dd]);break;case 0x2:joinOrLeaveQueues(_0x890e85,_0x131d97,_0x8c6d('0x2e'),_0x301332[_0x30025b][_0x3254dd]);break;case 0x3:joinOrLeaveQueues(_0x890e85,_0x131d97,_0x8c6d('0x2f'),_0x301332[_0x30025b][_0x3254dd]);break;case 0x4:joinOrLeaveQueues(_0x890e85,_0x131d97,_0x8c6d('0x30'),_0x301332[_0x30025b][_0x3254dd]);break;case 0x5:joinOrLeaveQueues(_0x890e85,_0x131d97,'openchannel',_0x301332[_0x30025b][_0x3254dd]);break;case 0x6:_0x890e85[_0x131d97](util[_0x8c6d('0xa')](_0x8c6d('0x31'),_0x301332[_0x30025b][_0x3254dd]['name']));break;case 0x7:_0x890e85[_0x131d97](util[_0x8c6d('0xa')](_0x8c6d('0x32'),_0x301332[_0x30025b][_0x3254dd][_0x8c6d('0x6')]));break;case 0x8:_0x890e85[_0x131d97](util['format'](_0x8c6d('0x33'),_0x301332[_0x30025b][_0x3254dd][_0x8c6d('0x8')],_0x301332[_0x30025b][_0x3254dd][_0x8c6d('0x6')]));break;case 0x9:_0x890e85[_0x131d97](util[_0x8c6d('0xa')](_0x8c6d('0x16'),_0x301332[_0x30025b][_0x3254dd][_0x8c6d('0x6')]));break;}}}}})[_0x8c6d('0x2a')](function(){if(_0x131d97===_0x8c6d('0x34')){var _0x925988=_[_0x8c6d('0x35')](_0x30ecfa[_0x8c6d('0x36')],'id');return _0x30ecfa['removeChatInteractions'](_0x925988)['then'](function(){for(var _0x55d18e=0x0;_0x55d18e<_0x925988[_0x8c6d('0x2b')];_0x55d18e+=0x1){_0x8ec2d4[_0x8c6d('0x37')](_0x8c6d('0x38'),{'ChatInteractionId':Number(_0x925988[_0x55d18e]),'UserId':Number(_0x30ecfa['id'])});}});}})[_0x8c6d('0x2a')](function(){if(_0x131d97===_0x8c6d('0x34')){var _0x546f04=_[_0x8c6d('0x35')](_0x30ecfa[_0x8c6d('0x12')],'id');return _0x30ecfa[_0x8c6d('0x39')](_0x546f04)['then'](function(){for(var _0xf8d466=0x0;_0xf8d466<_0x546f04[_0x8c6d('0x2b')];_0xf8d466+=0x1){_0x8ec2d4['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x546f04[_0xf8d466]),'UserId':Number(_0x30ecfa['id'])});}});}})['then'](function(){if(_0x131d97==='leave'){var _0x4a033f=_[_0x8c6d('0x35')](_0x30ecfa[_0x8c6d('0x13')],'id');return _0x30ecfa[_0x8c6d('0x3a')](_0x4a033f)[_0x8c6d('0x2a')](function(){for(var _0x25e00e=0x0;_0x25e00e<_0x4a033f['length'];_0x25e00e+=0x1){_0x8ec2d4['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x4a033f[_0x25e00e]),'UserId':Number(_0x30ecfa['id'])});}});}})['then'](function(){if(_0x131d97===_0x8c6d('0x34')){var _0x4e2df3=_[_0x8c6d('0x35')](_0x30ecfa[_0x8c6d('0x3b')],'id');return _0x30ecfa[_0x8c6d('0x3c')](_0x4e2df3)[_0x8c6d('0x2a')](function(){for(var _0x3daa32=0x0;_0x3daa32<_0x4e2df3[_0x8c6d('0x2b')];_0x3daa32+=0x1){_0x8ec2d4['emit'](_0x8c6d('0x3d'),{'SmsInteractionId':Number(_0x4e2df3[_0x3daa32]),'UserId':Number(_0x30ecfa['id'])});}});}})[_0x8c6d('0x2a')](function(){if(_0x131d97==='leave'){var _0xe0693a=_[_0x8c6d('0x35')](_0x30ecfa['OpenchannelInteractions'],'id');return _0x30ecfa[_0x8c6d('0x3e')](_0xe0693a)[_0x8c6d('0x2a')](function(){for(var _0x78647c=0x0;_0x78647c<_0xe0693a[_0x8c6d('0x2b')];_0x78647c+=0x1){_0x8ec2d4[_0x8c6d('0x37')](_0x8c6d('0x3f'),{'OpenchannelInteractionId':Number(_0xe0693a[_0x78647c]),'UserId':Number(_0x30ecfa['id'])});}});}})[_0x8c6d('0x40')](function(_0x17eb0f){_0x890e85[_0x8c6d('0x41')](_0x17eb0f);});}}function onDisconnect(_0x1d6c29,_0x361956){joinOrLeave(_0x1d6c29,_0x8c6d('0x34'),_0x361956);}function onConnect(_0x4f4d51){joinOrLeave(_0x4f4d51,_0x8c6d('0x42'));}exports[_0x8c6d('0x43')]=function(_0x337e37){_0x337e37['on']('connection',function(_0x5b4191){_0x5b4191['setMaxListeners'](0x0);_0x5b4191[_0x8c6d('0x44')]=_0x5b4191[_0x8c6d('0x45')][_0x8c6d('0x46')][_0x8c6d('0x47')]+':'+_0x5b4191['request'][_0x8c6d('0x46')]['remotePort'];_0x5b4191[_0x8c6d('0x48')]=new Date();_0x5b4191[_0x8c6d('0x41')]=function(_0x173752){console['log'](_0x8c6d('0x49')+_0x5b4191['nsp'][_0x8c6d('0x6')]+'['+_0x5b4191['address']+']',_0x173752);};_0x5b4191['on'](_0x8c6d('0x4a'),function(){onDisconnect(_0x5b4191,_0x337e37);_0x5b4191[_0x8c6d('0x41')](_0x8c6d('0x4b'));});onConnect(_0x5b4191);_0x5b4191[_0x8c6d('0x41')]('CONNECTED');});};
\ No newline at end of file
+var _0xb887=['fax','mail','openchannel','telephone:%s','campaign:%s:%s','map','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','leave','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','connection','setMaxListeners','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','../mysqldb','./environment','name','role','agent','telephone','type','ivr','Agents','user:%s','handshake','User','find','query','ChatInteractions','MailInteraction','MailInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','then','format','admin','voice:inbound','hasOwnProperty','include','push','findAll','ChatQueue','FaxQueue','SmsQueue','Trunk','voice:outbound','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','length','voice','chat'];(function(_0x573b90,_0x2e9052){var _0x3b389e=function(_0x47ae49){while(--_0x47ae49){_0x573b90['push'](_0x573b90['shift']());}};_0x3b389e(++_0x2e9052);}(_0xb887,0xaf));var _0x7b88=function(_0x305e8f,_0x52e532){_0x305e8f=_0x305e8f-0x0;var _0x251584=_0xb887[_0x305e8f];return _0x251584;};'use strict';var _=require(_0x7b88('0x0'));var util=require('util');var BPromise=require('bluebird');var db=require(_0x7b88('0x1'))['db'];var config=require(_0x7b88('0x2'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db['User'],'attributes':['id',_0x7b88('0x3'),_0x7b88('0x4')],'raw':!![],'where':{'role':_0x7b88('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x7b88('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0x7b88('0x3')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x7b88('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x7b88('0x7')],'where':{'type':_0x7b88('0x8')}};function joinOrLeaveQueues(_0x3a5db8,_0x295f56,_0x3d0452,_0x16753d){_0x3a5db8[_0x295f56](util['format']('%s:queue:%s',_0x3d0452,_0x16753d['name']));if(_0x16753d[_0x7b88('0x9')]){for(var _0x360dc9=0x0;_0x360dc9<_0x16753d[_0x7b88('0x9')]['length'];_0x360dc9+=0x1){_0x3a5db8[_0x295f56](util['format'](_0x7b88('0xa'),_0x16753d[_0x7b88('0x9')][_0x360dc9][_0x7b88('0x3')]));}}}function joinOrLeave(_0x4d67c9,_0x20d703,_0x34959c){var _0x1820ee;if(_0x4d67c9[_0x7b88('0xb')]['query']['id']){db[_0x7b88('0xc')][_0x7b88('0xd')]({'attributes':['id',_0x7b88('0x3'),_0x7b88('0x4')],'where':{'id':_0x4d67c9[_0x7b88('0xb')][_0x7b88('0xe')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x7b88('0xf'),'attributes':['id'],'raw':!![]},{'model':db[_0x7b88('0x10')],'as':_0x7b88('0x11'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x7b88('0x12')],'as':_0x7b88('0x13'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x7b88('0x14'),'attributes':['id'],'raw':!![]}]})[_0x7b88('0x15')](function(_0x544a66){if(_0x544a66){_0x1820ee=_0x544a66;_0x4d67c9[_0x20d703](util[_0x7b88('0x16')](_0x7b88('0xa'),_0x544a66[_0x7b88('0x3')]));var _0x3f2f2b=[];switch(_0x544a66[_0x7b88('0x4')]){case _0x7b88('0x17'):_0x4d67c9[_0x20d703](_0x7b88('0x18'));_0x4d67c9[_0x20d703]('voice:outbound');if(queryQueues[_0x7b88('0x19')](_0x7b88('0x1a'))){delete queryQueues[_0x7b88('0x1a')];}_0x3f2f2b[_0x7b88('0x1b')](db['VoiceQueue'][_0x7b88('0x1c')](queryQueues));_0x3f2f2b['push'](db[_0x7b88('0x1d')]['findAll'](queryQueues));_0x3f2f2b[_0x7b88('0x1b')](db[_0x7b88('0x1e')]['findAll'](queryQueues));_0x3f2f2b[_0x7b88('0x1b')](db[_0x7b88('0x1f')][_0x7b88('0x1c')](queryQueues));_0x3f2f2b[_0x7b88('0x1b')](db['MailQueue'][_0x7b88('0x1c')](queryQueues));_0x3f2f2b[_0x7b88('0x1b')](db['OpenchannelQueue'][_0x7b88('0x1c')](queryQueues));_0x3f2f2b['push'](db[_0x7b88('0xc')][_0x7b88('0x1c')](queryTelephones));_0x3f2f2b['push'](db[_0x7b88('0x20')][_0x7b88('0x1c')](queryTrunks));_0x3f2f2b[_0x7b88('0x1b')](db['Campaign']['findAll'](queryCampaigns));_0x3f2f2b[_0x7b88('0x1b')](db['User']['findAll'](queryAgents));break;case'user':_0x4d67c9[_0x20d703]('voice:inbound');_0x4d67c9[_0x20d703](_0x7b88('0x21'));_0x3f2f2b[_0x7b88('0x1b')](_0x544a66[_0x7b88('0x22')](queryQueues));_0x3f2f2b[_0x7b88('0x1b')](_0x544a66[_0x7b88('0x23')](queryQueues));_0x3f2f2b[_0x7b88('0x1b')](_0x544a66[_0x7b88('0x24')](queryQueues));_0x3f2f2b['push'](_0x544a66[_0x7b88('0x25')](queryQueues));_0x3f2f2b['push'](_0x544a66[_0x7b88('0x26')](queryQueues));_0x3f2f2b[_0x7b88('0x1b')](_0x544a66['getOpenchannelQueues'](queryQueues));_0x3f2f2b[_0x7b88('0x1b')](db[_0x7b88('0xc')][_0x7b88('0x1c')](queryTelephones));_0x3f2f2b['push'](db[_0x7b88('0x20')][_0x7b88('0x1c')](queryTrunks));_0x3f2f2b[_0x7b88('0x1b')](db['Campaign'][_0x7b88('0x1c')](queryCampaigns));_0x3f2f2b[_0x7b88('0x1b')](db[_0x7b88('0xc')][_0x7b88('0x1c')](queryAgents));break;case'agent':_0x4d67c9[_0x20d703]('voice:inbound');_0x4d67c9[_0x20d703](_0x7b88('0x21'));_0x3f2f2b['push'](_0x544a66[_0x7b88('0x22')]({'attributes':['id','name']}));_0x3f2f2b[_0x7b88('0x1b')](_0x544a66['getChatQueues']({'attributes':['id',_0x7b88('0x3')]}));_0x3f2f2b[_0x7b88('0x1b')](_0x544a66[_0x7b88('0x24')]({'attributes':['id',_0x7b88('0x3')]}));_0x3f2f2b[_0x7b88('0x1b')](_0x544a66['getSmsQueues']({'attributes':['id',_0x7b88('0x3')]}));_0x3f2f2b['push'](_0x544a66[_0x7b88('0x26')]({'attributes':['id',_0x7b88('0x3')]}));_0x3f2f2b['push'](_0x544a66[_0x7b88('0x27')]({'attributes':['id',_0x7b88('0x3')]}));break;}return BPromise[_0x7b88('0x28')](_0x3f2f2b);}})[_0x7b88('0x15')](function(_0x4d226e){if(_0x4d226e&&_0x4d226e[_0x7b88('0x29')]){for(var _0x4fa2c6=0x0;_0x4fa2c6<_0x4d226e[_0x7b88('0x29')];_0x4fa2c6+=0x1){for(var _0xe88764=0x0;_0xe88764<_0x4d226e[_0x4fa2c6][_0x7b88('0x29')];_0xe88764+=0x1){switch(_0x4fa2c6){case 0x0:joinOrLeaveQueues(_0x4d67c9,_0x20d703,_0x7b88('0x2a'),_0x4d226e[_0x4fa2c6][_0xe88764]);break;case 0x1:joinOrLeaveQueues(_0x4d67c9,_0x20d703,_0x7b88('0x2b'),_0x4d226e[_0x4fa2c6][_0xe88764]);break;case 0x2:joinOrLeaveQueues(_0x4d67c9,_0x20d703,_0x7b88('0x2c'),_0x4d226e[_0x4fa2c6][_0xe88764]);break;case 0x3:joinOrLeaveQueues(_0x4d67c9,_0x20d703,'sms',_0x4d226e[_0x4fa2c6][_0xe88764]);break;case 0x4:joinOrLeaveQueues(_0x4d67c9,_0x20d703,_0x7b88('0x2d'),_0x4d226e[_0x4fa2c6][_0xe88764]);break;case 0x5:joinOrLeaveQueues(_0x4d67c9,_0x20d703,_0x7b88('0x2e'),_0x4d226e[_0x4fa2c6][_0xe88764]);break;case 0x6:_0x4d67c9[_0x20d703](util[_0x7b88('0x16')](_0x7b88('0x2f'),_0x4d226e[_0x4fa2c6][_0xe88764][_0x7b88('0x3')]));break;case 0x7:_0x4d67c9[_0x20d703](util[_0x7b88('0x16')]('trunk:%s',_0x4d226e[_0x4fa2c6][_0xe88764][_0x7b88('0x3')]));break;case 0x8:_0x4d67c9[_0x20d703](util['format'](_0x7b88('0x30'),_0x4d226e[_0x4fa2c6][_0xe88764][_0x7b88('0x7')],_0x4d226e[_0x4fa2c6][_0xe88764][_0x7b88('0x3')]));break;case 0x9:_0x4d67c9[_0x20d703](util['format'](_0x7b88('0xa'),_0x4d226e[_0x4fa2c6][_0xe88764][_0x7b88('0x3')]));break;}}}}})['then'](function(){if(_0x20d703==='leave'){var _0x4f32a2=_[_0x7b88('0x31')](_0x1820ee['ChatInteractions'],'id');return _0x1820ee[_0x7b88('0x32')](_0x4f32a2)['then'](function(){for(var _0x5a829c=0x0;_0x5a829c<_0x4f32a2[_0x7b88('0x29')];_0x5a829c+=0x1){_0x34959c[_0x7b88('0x33')](_0x7b88('0x34'),{'ChatInteractionId':Number(_0x4f32a2[_0x5a829c]),'UserId':Number(_0x1820ee['id'])});}});}})[_0x7b88('0x15')](function(){if(_0x20d703==='leave'){var _0x558c8f=_['map'](_0x1820ee[_0x7b88('0x11')],'id');return _0x1820ee['removeMailInteractions'](_0x558c8f)[_0x7b88('0x15')](function(){for(var _0x1cc821=0x0;_0x1cc821<_0x558c8f[_0x7b88('0x29')];_0x1cc821+=0x1){_0x34959c[_0x7b88('0x33')](_0x7b88('0x35'),{'MailInteractionId':Number(_0x558c8f[_0x1cc821]),'UserId':Number(_0x1820ee['id'])});}});}})[_0x7b88('0x15')](function(){if(_0x20d703===_0x7b88('0x36')){var _0x4af057=_['map'](_0x1820ee[_0x7b88('0x37')],'id');return _0x1820ee[_0x7b88('0x38')](_0x4af057)[_0x7b88('0x15')](function(){for(var _0x4030be=0x0;_0x4030be<_0x4af057['length'];_0x4030be+=0x1){_0x34959c[_0x7b88('0x33')](_0x7b88('0x39'),{'FaxInteractionId':Number(_0x4af057[_0x4030be]),'UserId':Number(_0x1820ee['id'])});}});}})[_0x7b88('0x15')](function(){if(_0x20d703===_0x7b88('0x36')){var _0x593596=_[_0x7b88('0x31')](_0x1820ee[_0x7b88('0x13')],'id');return _0x1820ee[_0x7b88('0x3a')](_0x593596)[_0x7b88('0x15')](function(){for(var _0xb4df16=0x0;_0xb4df16<_0x593596[_0x7b88('0x29')];_0xb4df16+=0x1){_0x34959c[_0x7b88('0x33')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x593596[_0xb4df16]),'UserId':Number(_0x1820ee['id'])});}});}})[_0x7b88('0x15')](function(){if(_0x20d703===_0x7b88('0x36')){var _0x49912a=_[_0x7b88('0x31')](_0x1820ee[_0x7b88('0x14')],'id');return _0x1820ee[_0x7b88('0x3b')](_0x49912a)['then'](function(){for(var _0x59b388=0x0;_0x59b388<_0x49912a[_0x7b88('0x29')];_0x59b388+=0x1){_0x34959c[_0x7b88('0x33')](_0x7b88('0x3c'),{'OpenchannelInteractionId':Number(_0x49912a[_0x59b388]),'UserId':Number(_0x1820ee['id'])});}});}})[_0x7b88('0x3d')](function(_0x56fc13){_0x4d67c9[_0x7b88('0x3e')](_0x56fc13);});}}function onDisconnect(_0x368c89,_0x7a5e8b){joinOrLeave(_0x368c89,_0x7b88('0x36'),_0x7a5e8b);}function onConnect(_0x4798d8){joinOrLeave(_0x4798d8,'join');}exports['default']=function(_0x202ea5){_0x202ea5['on'](_0x7b88('0x3f'),function(_0x697e80){_0x697e80[_0x7b88('0x40')](0x0);_0x697e80['address']=_0x697e80[_0x7b88('0x41')][_0x7b88('0x3f')][_0x7b88('0x42')]+':'+_0x697e80['request'][_0x7b88('0x3f')][_0x7b88('0x43')];_0x697e80[_0x7b88('0x44')]=new Date();_0x697e80[_0x7b88('0x3e')]=function(_0x3836d7){console[_0x7b88('0x3e')](_0x7b88('0x45')+_0x697e80[_0x7b88('0x46')][_0x7b88('0x3')]+'['+_0x697e80['address']+']',_0x3836d7);};_0x697e80['on'](_0x7b88('0x47'),function(){onDisconnect(_0x697e80,_0x202ea5);_0x697e80[_0x7b88('0x3e')](_0x7b88('0x48'));});onConnect(_0x697e80);_0x697e80[_0x7b88('0x3e')]('CONNECTED');});};
\ No newline at end of file
index 7ffd638..c70c9b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1880=['util','jayson/promise','../logger','triggers','client','Chat','ChatInteraction','closedinteraction','ChatMessage','afterCreate','newmessage','SmsInteraction','newinteraction','Sms','SmsMessage','Fax','FaxInteraction','afterUpdate','FaxMessage','Mail','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','event','UserId','User','find','name','interface','format','SIP/%s','incomingmessage','outgoingmessage','changed','closed','default','hasOwnProperty','model','toLowerCase'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1880,0x1c2));var _0x0188=function(_0x53995f,_0x1b135c){_0x53995f=_0x53995f-0x0;var _0x1649a9=_0x1880[_0x53995f];return _0x1649a9;};'use strict';var util=require(_0x0188('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x0188('0x1'));var logger=require(_0x0188('0x2'))(_0x0188('0x3'));var client=jayson[_0x0188('0x4')]['http']({'port':0x232a});var triggers=[{'channel':_0x0188('0x5'),'model':_0x0188('0x6'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Chat','model':'ChatInteraction','event':'afterUpdate','condition':_0x0188('0x7'),'callback':afterUpdate},{'channel':_0x0188('0x5'),'model':_0x0188('0x8'),'event':_0x0188('0x9'),'condition':_0x0188('0xa'),'callback':afterCreateMessage},{'channel':'Sms','model':_0x0188('0xb'),'event':'afterCreate','condition':_0x0188('0xc'),'callback':afterCreate},{'channel':_0x0188('0xd'),'model':_0x0188('0xb'),'event':'afterUpdate','condition':_0x0188('0x7'),'callback':afterUpdate},{'channel':'Sms','model':_0x0188('0xe'),'event':'afterCreate','condition':_0x0188('0xa'),'callback':afterCreateMessage},{'channel':_0x0188('0xf'),'model':_0x0188('0x10'),'event':_0x0188('0x9'),'condition':_0x0188('0xc'),'callback':afterCreate},{'channel':_0x0188('0xf'),'model':_0x0188('0x10'),'event':_0x0188('0x11'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x0188('0xf'),'model':_0x0188('0x12'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':'MailInteraction','event':_0x0188('0x9'),'condition':_0x0188('0xc'),'callback':afterCreate},{'channel':_0x0188('0x13'),'model':'MailInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x0188('0x13'),'model':_0x0188('0x14'),'event':_0x0188('0x9'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x0188('0x15'),'model':_0x0188('0x16'),'event':_0x0188('0x9'),'condition':_0x0188('0xc'),'callback':afterCreate},{'channel':_0x0188('0x15'),'model':_0x0188('0x16'),'event':_0x0188('0x11'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x0188('0x15'),'model':_0x0188('0x17'),'event':_0x0188('0x9'),'condition':_0x0188('0xa'),'callback':afterCreateMessage}];function request(_0x33c451){return client[_0x0188('0x18')](_0x0188('0x19'),_0x33c451)[_0x0188('0x1a')](function(_0x355e80){logger[_0x0188('0x1b')](_0x0188('0x1c'),_0x0188('0x19'),_0x355e80);if(_0x355e80['error']){if(_0x355e80[_0x0188('0x1d')][_0x0188('0x1e')]===0x1f4){logger[_0x0188('0x1d')](_0x0188('0x1c'),'EventManager',_0x355e80[_0x0188('0x1d')]);}}})[_0x0188('0x1f')](function(_0x32ae1e){logger[_0x0188('0x1d')]('Trigger,\x20%s','EventManager',_0x32ae1e);});}function afterCreateMessage(_0x84737e,_0x5787b8){return function(_0x12f240,_0x9d43d3){_0x12f240=_0x12f240[_0x0188('0x20')]({'plain':!![]});_0x12f240[_0x0188('0x21')]=_0x84737e;_0x12f240[_0x0188('0x22')]=_0x12f240['direction'];if(_0x12f240[_0x0188('0x23')]){return db[_0x0188('0x24')][_0x0188('0x25')]({'where':{'id':_0x12f240[_0x0188('0x23')]},'attributes':['id',_0x0188('0x26')],'raw':!![]})['then'](function(_0x471e1b){_0x12f240[_0x0188('0x27')]=util[_0x0188('0x28')](_0x0188('0x29'),_0x471e1b[_0x0188('0x26')]);_0x12f240[_0x0188('0x21')]=_0x84737e;return request({'event':_0x0188('0x2a'),'message':_0x12f240});})[_0x0188('0x1f')](function(_0x6dbec1){console['error'](_0x6dbec1);});}else{return request({'event':_0x0188('0x2b'),'message':_0x12f240});}};}function afterCreate(_0x4dd641,_0x5ceadb){return function(_0x4c6536,_0x2b46e3){_0x4c6536=_0x4c6536[_0x0188('0x20')]({'plain':!![]});_0x4c6536[_0x0188('0x21')]=_0x4dd641;_0x4c6536[_0x0188('0x22')]='opened';return request({'event':_0x5ceadb,'message':_0x4c6536});};}function afterUpdate(_0x22828d,_0x2be896){return function(_0x30b7ba,_0x5007ca){if(_0x30b7ba[_0x0188('0x2c')]('closed')&&_0x30b7ba['closed']){_0x30b7ba=_0x30b7ba[_0x0188('0x20')]({'plain':!![]});_0x30b7ba[_0x0188('0x21')]=_0x22828d;_0x30b7ba['event']=_0x0188('0x2d');if(_0x30b7ba[_0x0188('0x23')]){return db[_0x0188('0x24')]['find']({'where':{'id':_0x30b7ba[_0x0188('0x23')]},'attributes':['id',_0x0188('0x26')],'raw':!![]})['then'](function(_0x1979a1){_0x30b7ba['interface']=util['format'](_0x0188('0x29'),_0x1979a1[_0x0188('0x26')]);return request({'event':_0x2be896,'message':_0x30b7ba});})[_0x0188('0x1f')](function(_0x2bb48f){console['error'](_0x2bb48f);});}else{return request({'event':_0x2be896,'message':_0x30b7ba});}}};}exports[_0x0188('0x2e')]=function(){for(var _0x18ca53=0x0;_0x18ca53<triggers['length'];_0x18ca53+=0x1){if(db[_0x0188('0x2f')](triggers[_0x18ca53][_0x0188('0x30')])){db[triggers[_0x18ca53][_0x0188('0x30')]]['hook'](triggers[_0x18ca53][_0x0188('0x22')],triggers[_0x18ca53]['callback'](triggers[_0x18ca53][_0x0188('0x21')][_0x0188('0x31')](),triggers[_0x18ca53]['condition']));}}};
\ No newline at end of file
+var _0x43ad=['incomingmessage','outgoingmessage','changed','closed','interface','default','length','hasOwnProperty','model','hook','callback','toLowerCase','util','../../mysqldb','../logger','client','http','Chat','ChatInteraction','afterCreate','newinteraction','ChatMessage','newmessage','Sms','SmsInteraction','afterUpdate','closedinteraction','SmsMessage','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','Trigger,\x20%s','error','code','catch','get','channel','event','direction','UserId','User','find','format','SIP/%s','name'];(function(_0x148316,_0x43b1e0){var _0x456205=function(_0x473509){while(--_0x473509){_0x148316['push'](_0x148316['shift']());}};_0x456205(++_0x43b1e0);}(_0x43ad,0xab));var _0xd43a=function(_0x1e2892,_0x2adb78){_0x1e2892=_0x1e2892-0x0;var _0x365b4e=_0x43ad[_0x1e2892];return _0x365b4e;};'use strict';var util=require(_0xd43a('0x0'));var db=require(_0xd43a('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0xd43a('0x2'))('triggers');var client=jayson[_0xd43a('0x3')][_0xd43a('0x4')]({'port':0x232a});var triggers=[{'channel':_0xd43a('0x5'),'model':_0xd43a('0x6'),'event':_0xd43a('0x7'),'condition':_0xd43a('0x8'),'callback':afterCreate},{'channel':_0xd43a('0x5'),'model':_0xd43a('0x6'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':'Chat','model':_0xd43a('0x9'),'event':_0xd43a('0x7'),'condition':_0xd43a('0xa'),'callback':afterCreateMessage},{'channel':_0xd43a('0xb'),'model':_0xd43a('0xc'),'event':_0xd43a('0x7'),'condition':_0xd43a('0x8'),'callback':afterCreate},{'channel':_0xd43a('0xb'),'model':_0xd43a('0xc'),'event':_0xd43a('0xd'),'condition':_0xd43a('0xe'),'callback':afterUpdate},{'channel':_0xd43a('0xb'),'model':_0xd43a('0xf'),'event':_0xd43a('0x7'),'condition':_0xd43a('0xa'),'callback':afterCreateMessage},{'channel':_0xd43a('0x10'),'model':_0xd43a('0x11'),'event':'afterCreate','condition':_0xd43a('0x8'),'callback':afterCreate},{'channel':'Fax','model':_0xd43a('0x11'),'event':_0xd43a('0xd'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xd43a('0x10'),'model':'FaxMessage','event':_0xd43a('0x7'),'condition':_0xd43a('0xa'),'callback':afterCreateMessage},{'channel':_0xd43a('0x12'),'model':_0xd43a('0x13'),'event':'afterCreate','condition':_0xd43a('0x8'),'callback':afterCreate},{'channel':_0xd43a('0x12'),'model':_0xd43a('0x13'),'event':_0xd43a('0xd'),'condition':_0xd43a('0xe'),'callback':afterUpdate},{'channel':_0xd43a('0x12'),'model':_0xd43a('0x14'),'event':_0xd43a('0x7'),'condition':_0xd43a('0xa'),'callback':afterCreateMessage},{'channel':_0xd43a('0x15'),'model':_0xd43a('0x16'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xd43a('0x15'),'model':'OpenchannelInteraction','event':_0xd43a('0xd'),'condition':_0xd43a('0xe'),'callback':afterUpdate},{'channel':_0xd43a('0x15'),'model':_0xd43a('0x17'),'event':_0xd43a('0x7'),'condition':_0xd43a('0xa'),'callback':afterCreateMessage}];function request(_0x40664e){return client[_0xd43a('0x18')](_0xd43a('0x19'),_0x40664e)[_0xd43a('0x1a')](function(_0x52f1d4){logger['info'](_0xd43a('0x1b'),'EventManager',_0x52f1d4);if(_0x52f1d4[_0xd43a('0x1c')]){if(_0x52f1d4[_0xd43a('0x1c')][_0xd43a('0x1d')]===0x1f4){logger[_0xd43a('0x1c')](_0xd43a('0x1b'),_0xd43a('0x19'),_0x52f1d4[_0xd43a('0x1c')]);}}})[_0xd43a('0x1e')](function(_0x4c14fc){logger[_0xd43a('0x1c')](_0xd43a('0x1b'),'EventManager',_0x4c14fc);});}function afterCreateMessage(_0x438a16,_0x2fcce6){return function(_0x56e693,_0x16198c){_0x56e693=_0x56e693[_0xd43a('0x1f')]({'plain':!![]});_0x56e693[_0xd43a('0x20')]=_0x438a16;_0x56e693[_0xd43a('0x21')]=_0x56e693[_0xd43a('0x22')];if(_0x56e693[_0xd43a('0x23')]){return db[_0xd43a('0x24')][_0xd43a('0x25')]({'where':{'id':_0x56e693[_0xd43a('0x23')]},'attributes':['id','name'],'raw':!![]})['then'](function(_0xcaa20b){_0x56e693['interface']=util[_0xd43a('0x26')](_0xd43a('0x27'),_0xcaa20b[_0xd43a('0x28')]);_0x56e693[_0xd43a('0x20')]=_0x438a16;return request({'event':_0xd43a('0x29'),'message':_0x56e693});})[_0xd43a('0x1e')](function(_0x2a5375){console[_0xd43a('0x1c')](_0x2a5375);});}else{return request({'event':_0xd43a('0x2a'),'message':_0x56e693});}};}function afterCreate(_0xb6b5c8,_0x3b6189){return function(_0x4da8ac,_0x4643b0){_0x4da8ac=_0x4da8ac['get']({'plain':!![]});_0x4da8ac[_0xd43a('0x20')]=_0xb6b5c8;_0x4da8ac[_0xd43a('0x21')]='opened';return request({'event':_0x3b6189,'message':_0x4da8ac});};}function afterUpdate(_0x40ed6a,_0x2bd252){return function(_0x5b4be0,_0x4903bc){if(_0x5b4be0[_0xd43a('0x2b')](_0xd43a('0x2c'))&&_0x5b4be0[_0xd43a('0x2c')]){_0x5b4be0=_0x5b4be0[_0xd43a('0x1f')]({'plain':!![]});_0x5b4be0[_0xd43a('0x20')]=_0x40ed6a;_0x5b4be0[_0xd43a('0x21')]=_0xd43a('0x2c');if(_0x5b4be0[_0xd43a('0x23')]){return db['User'][_0xd43a('0x25')]({'where':{'id':_0x5b4be0[_0xd43a('0x23')]},'attributes':['id',_0xd43a('0x28')],'raw':!![]})[_0xd43a('0x1a')](function(_0x3111ca){_0x5b4be0[_0xd43a('0x2d')]=util[_0xd43a('0x26')](_0xd43a('0x27'),_0x3111ca[_0xd43a('0x28')]);return request({'event':_0x2bd252,'message':_0x5b4be0});})[_0xd43a('0x1e')](function(_0x1088a5){console[_0xd43a('0x1c')](_0x1088a5);});}else{return request({'event':_0x2bd252,'message':_0x5b4be0});}}};}exports[_0xd43a('0x2e')]=function(){for(var _0x966e5f=0x0;_0x966e5f<triggers[_0xd43a('0x2f')];_0x966e5f+=0x1){if(db[_0xd43a('0x30')](triggers[_0x966e5f][_0xd43a('0x31')])){db[triggers[_0x966e5f][_0xd43a('0x31')]][_0xd43a('0x32')](triggers[_0x966e5f][_0xd43a('0x21')],triggers[_0x966e5f][_0xd43a('0x33')](triggers[_0x966e5f][_0xd43a('0x20')][_0xd43a('0x34')](),triggers[_0x966e5f]['condition']));}}};
\ No newline at end of file
index d5bad88..f2c3706 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6d6=['voice','mail','chat','exports','toLowerCase','includes','lodash'];(function(_0x1e9e56,_0x34a74a){var _0x5d5e2e=function(_0x4bfcc2){while(--_0x4bfcc2){_0x1e9e56['push'](_0x1e9e56['shift']());}};_0x5d5e2e(++_0x34a74a);}(_0xd6d6,0x1aa));var _0x6d6d=function(_0xaff60,_0x8119a9){_0xaff60=_0xaff60-0x0;var _0x1dfc84=_0xd6d6[_0xaff60];return _0x1dfc84;};'use strict';var _=require(_0x6d6d('0x0'));var channels=[_0x6d6d('0x1'),_0x6d6d('0x2'),_0x6d6d('0x3'),'fax','sms','openchannel'];module[_0x6d6d('0x4')]={'getChannels':function(){return channels;},'isValidChannel':function(_0x1aa087){_0x1aa087=_0x1aa087[_0x6d6d('0x5')]();return _[_0x6d6d('0x6')](channels,_0x1aa087);}};
\ No newline at end of file
+var _0x7b9b=['includes','voice','chat','fax','openchannel','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7b9b,0x97));var _0xb7b9=function(_0x5dd173,_0x292312){_0x5dd173=_0x5dd173-0x0;var _0x42786a=_0x7b9b[_0x5dd173];return _0x42786a;};'use strict';var _=require('lodash');var channels=[_0xb7b9('0x0'),'mail',_0xb7b9('0x1'),_0xb7b9('0x2'),'sms',_0xb7b9('0x3')];module[_0xb7b9('0x4')]={'getChannels':function(){return channels;},'isValidChannel':function(_0xaa6f20){_0xaa6f20=_0xaa6f20['toLowerCase']();return _[_0xb7b9('0x5')](channels,_0xaa6f20);}};
\ No newline at end of file
index c2e5172..e262316 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0118=['send','404','status','render'];(function(_0x2f01fc,_0x1c496d){var _0x49a5be=function(_0x9e373c){while(--_0x9e373c){_0x2f01fc['push'](_0x2f01fc['shift']());}};_0x49a5be(++_0x1c496d);}(_0x0118,0xe5));var _0x8011=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0118[_0x20a584];return _0x4b41a8;};'use strict';module['exports'][0x194]=function pageNotFound(_0x1b9129,_0x266ec9){var _0x36278e=_0x8011('0x0');var _0x44ca32=0x194;var _0x3cc038={'status':_0x44ca32};_0x266ec9[_0x8011('0x1')](_0x3cc038['status']);_0x266ec9[_0x8011('0x2')](_0x36278e,{},function(_0x367fef,_0x13a68b){if(_0x367fef){return _0x266ec9[_0x8011('0x1')](_0x3cc038[_0x8011('0x1')])['json'](_0x3cc038);}_0x266ec9[_0x8011('0x3')](_0x13a68b);});};
\ No newline at end of file
+var _0x3682=['send','exports','status','json'];(function(_0x33ab39,_0x27b533){var _0x290493=function(_0x2638bb){while(--_0x2638bb){_0x33ab39['push'](_0x33ab39['shift']());}};_0x290493(++_0x27b533);}(_0x3682,0x91));var _0x2368=function(_0x56a7dd,_0x3fd9ae){_0x56a7dd=_0x56a7dd-0x0;var _0xc7b980=_0x3682[_0x56a7dd];return _0xc7b980;};'use strict';module[_0x2368('0x0')][0x194]=function pageNotFound(_0x648639,_0x36b1c6){var _0xc6a0b1='404';var _0x22e74e=0x194;var _0x4d251f={'status':_0x22e74e};_0x36b1c6[_0x2368('0x1')](_0x4d251f['status']);_0x36b1c6['render'](_0xc6a0b1,{},function(_0xc2ed53,_0x2c4b9c){if(_0xc2ed53){return _0x36b1c6[_0x2368('0x1')](_0x4d251f[_0x2368('0x1')])[_0x2368('0x2')](_0x4d251f);}_0x36b1c6[_0x2368('0x3')](_0x2c4b9c);});};
\ No newline at end of file
index 90f84f6..215d6f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x424e=['CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','MailInteraction','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','MailQueues','ChatQueues','UserChatQueue','UserFaxQueue','SmsQueues','UserSmsQueue','OpenchannelQueue','OpenchannelQueues','VoicePrefixes','user_has_voice_prefixes','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','Applications','Sounds','moh_has_sounds','Members','Hoppers','VoiceQueueId','CmHopperFinal','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','voice_queues_has_cm_lists','UserVoiceQueue','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','uniqueid','Contact','ContactId','MailServerOut','MailAccountId','Smtp','Dispositions','Answers','MailMessage','Interactions','List','ListId','Template','TemplateId','Agents','team_has_mail_queues','Account','Owner','Tag','mail_interaction_has_tags','Users','MailInteractionId','Interaction','restrict','TagId','Items','FaxAccountId','FaxApplication','Exntensions','FaxInteractionId','Tags','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','ThroughTags','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ChatWebsiteId','ChatProactiveAction','ProactiveActions','Agent','Queue','Website','chat_interaction_has_tags','user_has_chat_interactions','ChatInteractionId','CompanyId','CmCompany','Company','cm_contact_has_tags','Campaign','CampaignId','All','OneAll','AutomationAllId','Any','AutomationAnyId','Actions','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','AnalyticDefaultReport','DefaultReportId','Mohs','AllCondition','TriggerAllId','TriggerAnyId','TriggerId','Fields','CustomReportId','AnalyticFieldReport','SalesforceAccount','AccountId','SalesforceConfiguration','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','Configurations','VariableId','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskAccount','int_zendesk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','int_vtiger_configuration_has_tags','ToId','SessionId','ProjectId','team_has_voice_queues','team_has_chat_queues','FaxQueues','HopperHistories','campaigns_has_cm_blacklists','FromAccount','FromAgent','ToUserId','ToMailQueueId','ToQueue','FromChatWebsiteId','FromUserId','ToAgent','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','Queues','exports','path','../config/environment','lodash','determine','sequelize','defaultsDeep','motion2','xcall','mysql','name','utf8','sequelizeHistory','xC@LL1234','127.0.0.1','database','username','options','password','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','VoiceMail','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../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/schedule/schedule.model','Sound','../api/tag/tag.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','Integration','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','hasOne','cascade','UserId','hasMany','UserVoiceQueueRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','MailInteractions','Groups','chat_group_has_users','belongsToMany'];(function(_0x2bd0db,_0x1509b8){var _0x5dafba=function(_0x512f6e){while(--_0x512f6e){_0x2bd0db['push'](_0x2bd0db['shift']());}};_0x5dafba(++_0x1509b8);}(_0x424e,0xba));var _0xe424=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x424e[_0x3511d3];return _0x5d6321;};'use strict';var path=require(_0xe424('0x0'));var config=require(_0xe424('0x1'));var Sequelize=require('sequelize');var _=require(_0xe424('0x2'));var jstz=require('jstz');var timezone=jstz[_0xe424('0x3')]();config[_0xe424('0x4')]=_[_0xe424('0x5')](config[_0xe424('0x4')],{'database':_0xe424('0x6'),'username':_0xe424('0x7'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xe424('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xe424('0x9')](),'define':{'charset':_0xe424('0xa'),'collate':'utf8_general_ci'}}});config[_0xe424('0xb')]=_[_0xe424('0x5')](config[_0xe424('0xb')],{'database':_0xe424('0x6'),'username':_0xe424('0x7'),'password':_0xe424('0xc'),'options':{'host':_0xe424('0xd'),'port':0xcea,'dialect':_0xe424('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xe424('0x9')](),'define':{'charset':_0xe424('0xa'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe424('0x4')][_0xe424('0xe')],config[_0xe424('0x4')][_0xe424('0xf')],config[_0xe424('0x4')]['password'],config[_0xe424('0x4')][_0xe424('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe424('0xb')]['database'],config[_0xe424('0xb')][_0xe424('0xf')],config[_0xe424('0xb')][_0xe424('0x11')],config[_0xe424('0xb')][_0xe424('0x10')])};db[_0xe424('0x12')]=db[_0xe424('0x4')][_0xe424('0x13')]('../api/user/user.model');db[_0xe424('0x14')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x15'));db[_0xe424('0x16')]=db[_0xe424('0x4')]['import']('../api/voiceContext/voiceContext.model');db[_0xe424('0x17')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x18'));db[_0xe424('0x19')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x1a'));db[_0xe424('0x1b')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x1c'));db[_0xe424('0x1d')]=db[_0xe424('0x4')][_0xe424('0x13')]('../api/voiceRecording/voiceRecording.model');db[_0xe424('0x1e')]=db['sequelize']['import']('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x1f'));db[_0xe424('0x20')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x21'));db[_0xe424('0x22')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x23'));db[_0xe424('0x24')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x25'));db[_0xe424('0x26')]=db['sequelize'][_0xe424('0x13')](_0xe424('0x27'));db[_0xe424('0x28')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x29'));db[_0xe424('0x2a')]=db['sequelize'][_0xe424('0x13')](_0xe424('0x2b'));db['VoiceTransferReport']=db[_0xe424('0x4')]['import'](_0xe424('0x2c'));db['UserVoiceQueueRt']=db['sequelize'][_0xe424('0x13')](_0xe424('0x2d'));db['UserVoiceQueue']=db['sequelize']['import'](_0xe424('0x2e'));db['UserChatQueue']=db['sequelize'][_0xe424('0x13')]('../api/userChatQueue/userChatQueue.model');db[_0xe424('0x2f')]=db['sequelize'][_0xe424('0x13')](_0xe424('0x30'));db['UserFaxQueue']=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x31'));db['UserSmsQueue']=db['sequelize'][_0xe424('0x13')](_0xe424('0x32'));db[_0xe424('0x33')]=db[_0xe424('0x4')][_0xe424('0x13')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xe424('0x34')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x35'));db['MailServerOut']=db['sequelize'][_0xe424('0x13')](_0xe424('0x36'));db[_0xe424('0x37')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x38'));db[_0xe424('0x39')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x3a'));db[_0xe424('0x3b')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x3c'));db['MailInteraction']=db[_0xe424('0x4')][_0xe424('0x13')]('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db[_0xe424('0x4')][_0xe424('0x13')]('../api/mailMessage/mailMessage.model');db[_0xe424('0x3d')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x3e'));db[_0xe424('0x3f')]=db[_0xe424('0x4')][_0xe424('0x13')]('../api/mailQueueReport/mailQueueReport.model');db[_0xe424('0x40')]=db['sequelize'][_0xe424('0x13')]('../api/dashboard/dashboard.model');db[_0xe424('0x41')]=db[_0xe424('0x4')][_0xe424('0x13')]('../api/dashboardItem/dashboardItem.model');db[_0xe424('0x42')]=db['sequelize'][_0xe424('0x13')](_0xe424('0x43'));db['FaxApplication']=db[_0xe424('0x4')]['import'](_0xe424('0x44'));db[_0xe424('0x45')]=db[_0xe424('0x4')][_0xe424('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0xe424('0x46')]=db['sequelize'][_0xe424('0x13')](_0xe424('0x47'));db[_0xe424('0x48')]=db['sequelize'][_0xe424('0x13')](_0xe424('0x49'));db[_0xe424('0x4a')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x4b'));db[_0xe424('0x4c')]=db[_0xe424('0x4')]['import'](_0xe424('0x4d'));db[_0xe424('0x4e')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x4f'));db['SmsInteraction']=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x50'));db[_0xe424('0x51')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x52'));db[_0xe424('0x53')]=db['sequelize'][_0xe424('0x13')](_0xe424('0x54'));db[_0xe424('0x55')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x56'));db[_0xe424('0x57')]=db['sequelize'][_0xe424('0x13')]('../api/openchannelApplication/openchannelApplication.model');db[_0xe424('0x58')]=db['sequelize']['import'](_0xe424('0x59'));db['OpenchannelMessage']=db[_0xe424('0x4')]['import'](_0xe424('0x5a'));db['OpenchannelQueue']=db[_0xe424('0x4')][_0xe424('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0xe424('0x5b')]=db[_0xe424('0x4')]['import'](_0xe424('0x5c'));db[_0xe424('0x5d')]=db[_0xe424('0x4')][_0xe424('0x13')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xe424('0x5e')]=db['sequelize'][_0xe424('0x13')](_0xe424('0x5f'));db[_0xe424('0x60')]=db['sequelize'][_0xe424('0x13')]('../api/chatInteraction/chatInteraction.model');db[_0xe424('0x61')]=db['sequelize'][_0xe424('0x13')](_0xe424('0x62'));db[_0xe424('0x63')]=db[_0xe424('0x4')]['import'](_0xe424('0x64'));db[_0xe424('0x65')]=db[_0xe424('0x4')]['import'](_0xe424('0x66'));db[_0xe424('0x67')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x68'));db['ChatProactiveAction']=db['sequelize'][_0xe424('0x13')]('../api/chatProactiveAction/chatProactiveAction.model');db['CmCompany']=db[_0xe424('0x4')]['import'](_0xe424('0x69'));db['CmContact']=db[_0xe424('0x4')]['import'](_0xe424('0x6a'));db[_0xe424('0x6b')]=db[_0xe424('0x4')][_0xe424('0x13')]('../api/cmHopper/cmHopper.model');db[_0xe424('0x6c')]=db['sequelize'][_0xe424('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x6d'));db['CmHopperHistory']=db[_0xe424('0x4')]['import'](_0xe424('0x6e'));db[_0xe424('0x6f')]=db['sequelize'][_0xe424('0x13')](_0xe424('0x70'));db[_0xe424('0x71')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x72'));db[_0xe424('0x73')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x74'));db[_0xe424('0x75')]=db[_0xe424('0x4')][_0xe424('0x13')]('../api/automation/automation.model');db[_0xe424('0x76')]=db[_0xe424('0x4')]['import'](_0xe424('0x77'));db[_0xe424('0x78')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x79'));db[_0xe424('0x7a')]=db[_0xe424('0x4')]['import'](_0xe424('0x7b'));db[_0xe424('0x7c')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x7d'));db[_0xe424('0x7e')]=db[_0xe424('0x4')]['import'](_0xe424('0x7f'));db[_0xe424('0x80')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x81'));db['VoiceQueuesLog']=db['sequelize']['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x82'));db[_0xe424('0x83')]=db['sequelize']['import']('../api/sound/sound.model');db['Tag']=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x84'));db['Template']=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x85'));db[_0xe424('0x86')]=db[_0xe424('0x4')]['import'](_0xe424('0x87'));db[_0xe424('0x88')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x89'));db['Integration']=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x8a'));db[_0xe424('0x8b')]=db['sequelize'][_0xe424('0x13')](_0xe424('0x8c'));db[_0xe424('0x8d')]=db['sequelize'][_0xe424('0x13')](_0xe424('0x8e'));db['AnalyticDefaultReport']=db['sequelize'][_0xe424('0x13')](_0xe424('0x8f'));db[_0xe424('0x90')]=db['sequelize']['import'](_0xe424('0x91'));db[_0xe424('0x92')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x93'));db['AnalyticFieldReport']=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x94'));db[_0xe424('0x95')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x96'));db['SalesforceAccount']=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x97'));db['SalesforceConfiguration']=db['sequelize'][_0xe424('0x13')](_0xe424('0x98'));db['SalesforceField']=db['sequelize'][_0xe424('0x13')](_0xe424('0x99'));db[_0xe424('0x9a')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x9b'));db[_0xe424('0x9c')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x9d'));db[_0xe424('0x9e')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0x9f'));db[_0xe424('0xa0')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xa1'));db[_0xe424('0xa2')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xa3'));db[_0xe424('0xa4')]=db[_0xe424('0x4')]['import']('../api/intDeskField/intDeskField.model');db[_0xe424('0xa5')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xa6'));db['ZohoConfiguration']=db['sequelize'][_0xe424('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xe424('0xa7')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xa8'));db['ZendeskAccount']=db[_0xe424('0x4')]['import'](_0xe424('0xa9'));db[_0xe424('0xaa')]=db[_0xe424('0x4')]['import'](_0xe424('0xab'));db[_0xe424('0xac')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xad'));db['FreshdeskAccount']=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xae'));db[_0xe424('0xaf')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xb0'));db[_0xe424('0xb1')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xb2'));db[_0xe424('0xb3')]=db[_0xe424('0x4')]['import']('../api/intVtigerAccount/intVtigerAccount.model');db[_0xe424('0xb4')]=db[_0xe424('0x4')]['import'](_0xe424('0xb5'));db[_0xe424('0xb6')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xb7'));db[_0xe424('0xb8')]=db['sequelize'][_0xe424('0x13')](_0xe424('0x8a'));db['Network']=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xb9'));db[_0xe424('0xba')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xbb'));db[_0xe424('0xbc')]=db['sequelize'][_0xe424('0x13')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xe424('0xbd')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xbe'));db[_0xe424('0xbf')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xc0'));db[_0xe424('0xc1')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xc2'));db[_0xe424('0xc3')]=db['sequelize']['import'](_0xe424('0xc4'));db[_0xe424('0xc5')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xc6'));db[_0xe424('0xc7')]=db[_0xe424('0x4')]['import'](_0xe424('0xc8'));db[_0xe424('0xc9')]=db[_0xe424('0x4')][_0xe424('0x13')]('../api/jscriptyProject/jscriptyProject.model');db[_0xe424('0xca')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xcb'));db[_0xe424('0xcc')]=db[_0xe424('0x4')][_0xe424('0x13')]('../api/squareOdbc/squareOdbc.model');db[_0xe424('0xcd')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xce'));db[_0xe424('0xcf')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xd0'));db[_0xe424('0xd1')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xd2'));db[_0xe424('0xd3')]=db[_0xe424('0x4')]['import'](_0xe424('0xd4'));db['Campaign']=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xd5'));db['Migration']=db[_0xe424('0x4')][_0xe424('0x13')]('../api/migration/migration.model');db[_0xe424('0xd6')]=db['sequelize'][_0xe424('0x13')]('../api/attachment/attachment.model');db[_0xe424('0xd7')]=db['sequelize'][_0xe424('0x13')](_0xe424('0xd8'));db[_0xe424('0xd9')]=db[_0xe424('0x4')]['import'](_0xe424('0xda'));db[_0xe424('0xdb')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xdc'));db[_0xe424('0xdd')]=db[_0xe424('0x4')][_0xe424('0x13')]('../api/faxTransferReport/faxTransferReport.model');db[_0xe424('0xde')]=db['sequelize'][_0xe424('0x13')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xe424('0xdf')]=db[_0xe424('0x4')][_0xe424('0x13')]('../api/smsTransferReport/smsTransferReport.model');db[_0xe424('0xe0')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xe1'));db[_0xe424('0xe2')]=db[_0xe424('0x4')][_0xe424('0x13')](_0xe424('0xe3'));db['User'][_0xe424('0xe4')](db['VoiceMail'],{'as':_0xe424('0x1e'),'onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0xe6')});db[_0xe424('0x12')][_0xe424('0xe7')](db[_0xe424('0x1d')],{'as':'Recordings','foreignKey':_0xe424('0xe6')});db[_0xe424('0x12')][_0xe424('0xe7')](db[_0xe424('0xe8')],{'as':'VoiceQueuesRt','foreignKey':'UserId'});db[_0xe424('0x12')][_0xe424('0xe7')](db[_0xe424('0x17')],{'as':_0xe424('0xe9'),'onDelete':'cascade','hooks':!![]});db[_0xe424('0x12')]['hasMany'](db['CmHopperFinal'],{'as':_0xe424('0xea'),'foreignKey':_0xe424('0xe6')});db[_0xe424('0x12')]['hasMany'](db[_0xe424('0xeb')],{'as':_0xe424('0xec'),'foreignKey':_0xe424('0xe6')});db[_0xe424('0x12')][_0xe424('0xe7')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xe424('0xe6')});db['User'][_0xe424('0xe7')](db[_0xe424('0x58')],{'as':_0xe424('0xed'),'foreignKey':'UserId'});db['User'][_0xe424('0xe7')](db['ChatInteraction'],{'as':_0xe424('0xee'),'foreignKey':_0xe424('0xe6')});db[_0xe424('0x12')][_0xe424('0xe7')](db[_0xe424('0xef')],{'as':_0xe424('0xf0'),'foreignKey':_0xe424('0xe6')});db[_0xe424('0x12')][_0xe424('0xe7')](db[_0xe424('0x45')],{'as':'FaxInteractions','foreignKey':_0xe424('0xe6')});db[_0xe424('0x12')][_0xe424('0xe7')](db['MailInteraction'],{'as':_0xe424('0xf1'),'foreignKey':_0xe424('0xe6')});db[_0xe424('0x12')]['belongsToMany'](db[_0xe424('0x67')],{'as':_0xe424('0xf2'),'through':_0xe424('0xf3')});db[_0xe424('0x12')][_0xe424('0xf4')](db[_0xe424('0xf5')],{'as':_0xe424('0xf6'),'through':_0xe424('0xf7')});db[_0xe424('0x12')]['belongsToMany'](db[_0xe424('0xe0')],{'as':_0xe424('0xf8'),'through':_0xe424('0xf9')});db[_0xe424('0x12')][_0xe424('0xf4')](db['Team'],{'through':_0xe424('0xfa')});db[_0xe424('0x12')][_0xe424('0xf4')](db[_0xe424('0xfb')],{'as':_0xe424('0xf1'),'through':_0xe424('0xfc')});db[_0xe424('0x12')][_0xe424('0xf4')](db[_0xe424('0x60')],{'as':_0xe424('0xee'),'through':'user_has_chat_interactions'});db[_0xe424('0x12')]['belongsToMany'](db[_0xe424('0x45')],{'as':_0xe424('0xfd'),'through':_0xe424('0xfe')});db[_0xe424('0x12')]['belongsToMany'](db['SmsInteraction'],{'as':_0xe424('0xf0'),'through':_0xe424('0xff')});db['User'][_0xe424('0xf4')](db[_0xe424('0x58')],{'as':_0xe424('0xed'),'through':_0xe424('0x100')});db[_0xe424('0x12')][_0xe424('0xf4')](db[_0xe424('0x1b')],{'as':_0xe424('0x101'),'through':'UserVoiceQueue','required':![]});db['User']['belongsToMany'](db[_0xe424('0x39')],{'as':_0xe424('0x102'),'through':_0xe424('0x2f'),'required':![]});db[_0xe424('0x12')][_0xe424('0xf4')](db['ChatQueue'],{'as':_0xe424('0x103'),'through':_0xe424('0x104'),'required':![],'hooks':!![]});db[_0xe424('0x12')][_0xe424('0xf4')](db[_0xe424('0x48')],{'as':'FaxQueues','through':_0xe424('0x105'),'required':![]});db[_0xe424('0x12')]['belongsToMany'](db['SmsQueue'],{'as':_0xe424('0x106'),'through':_0xe424('0x107'),'required':![]});db[_0xe424('0x12')][_0xe424('0xf4')](db[_0xe424('0x108')],{'as':_0xe424('0x109'),'through':_0xe424('0x33'),'required':![]});db[_0xe424('0x12')][_0xe424('0xf4')](db[_0xe424('0xe0')],{'through':_0xe424('0xf9')});db[_0xe424('0x12')]['belongsToMany'](db[_0xe424('0xe2')],{'as':_0xe424('0x10a'),'through':_0xe424('0x10b'),'required':![]});db[_0xe424('0x12')][_0xe424('0xf4')](db[_0xe424('0x5b')],{'as':'ChatWebsites','through':_0xe424('0x10c')});db[_0xe424('0x12')][_0xe424('0xf4')](db[_0xe424('0x42')],{'as':_0xe424('0x10d'),'through':_0xe424('0x10e')});db[_0xe424('0x12')][_0xe424('0xf4')](db[_0xe424('0x37')],{'as':_0xe424('0x10f'),'through':_0xe424('0x110')});db[_0xe424('0x12')][_0xe424('0xf4')](db[_0xe424('0x55')],{'as':'OpenchannelAccounts','through':_0xe424('0x111')});db[_0xe424('0x12')][_0xe424('0xf4')](db[_0xe424('0x4c')],{'as':_0xe424('0x112'),'through':_0xe424('0x113')});db['User']['belongsToMany'](db[_0xe424('0xcd')],{'as':_0xe424('0x114'),'through':_0xe424('0x115')});db[_0xe424('0x14')][_0xe424('0xe7')](db[_0xe424('0x17')],{'as':'SpiedAgents','onDelete':_0xe424('0xe5'),'foreignKey':'ChanSpyId'});db[_0xe424('0x16')]['hasMany'](db[_0xe424('0x17')],{'onDelete':_0xe424('0xe5')});db[_0xe424('0x17')][_0xe424('0xe7')](db[_0xe424('0x17')],{'as':_0xe424('0x116'),'onDelete':'cascade'});db['VoiceMusicOnHold']['belongsToMany'](db['Sound'],{'as':_0xe424('0x117'),'through':_0xe424('0x118')});db['VoiceQueue'][_0xe424('0xe7')](db[_0xe424('0xe8')],{'as':_0xe424('0x119'),'foreignKey':'VoiceQueueId'});db[_0xe424('0x1b')][_0xe424('0xe7')](db['CmHopper'],{'as':_0xe424('0x11a'),'foreignKey':_0xe424('0x11b')});db[_0xe424('0x1b')]['hasMany'](db[_0xe424('0x11c')],{'as':_0xe424('0xea'),'foreignKey':_0xe424('0x11b')});db['VoiceQueue'][_0xe424('0xe7')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xe424('0x11b')});db[_0xe424('0x1b')][_0xe424('0xe7')](db[_0xe424('0x6f')],{'as':_0xe424('0x6f'),'foreignKey':_0xe424('0x11b')});db[_0xe424('0x1b')][_0xe424('0xe7')](db[_0xe424('0x6c')],{'as':_0xe424('0x11d'),'foreignKey':_0xe424('0x11b')});db[_0xe424('0x1b')][_0xe424('0xe7')](db[_0xe424('0xc1')],{'as':_0xe424('0x11e'),'foreignKey':_0xe424('0x11b')});db[_0xe424('0x1b')][_0xe424('0x11f')](db[_0xe424('0x2a')],{'as':_0xe424('0x2a'),'foreignKey':_0xe424('0x120')});db[_0xe424('0x1b')][_0xe424('0x11f')](db['Trunk'],{'as':_0xe424('0x121'),'foreignKey':_0xe424('0x122')});db[_0xe424('0x1b')][_0xe424('0x11f')](db[_0xe424('0x7c')],{'as':'Interval','foreignKey':_0xe424('0x123')});db['VoiceQueue'][_0xe424('0xf4')](db[_0xe424('0xe0')],{'as':'Lists','through':_0xe424('0x124')});db[_0xe424('0x1b')][_0xe424('0xf4')](db[_0xe424('0x12')],{'as':'Agents','through':_0xe424('0x125')});db[_0xe424('0x1b')]['belongsToMany'](db['Team'],{'as':_0xe424('0x126'),'through':'team_has_voice_queues'});db['VoiceQueue']['belongsToMany'](db[_0xe424('0xe0')],{'as':_0xe424('0x127'),'through':_0xe424('0x128')});db[_0xe424('0x1d')][_0xe424('0x11f')](db[_0xe424('0x12')],{'as':'User','foreignKey':_0xe424('0xe6')});db[_0xe424('0x1e')][_0xe424('0xe7')](db[_0xe424('0x129')],{'as':_0xe424('0x12a'),'onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x12b'),'sourceKey':_0xe424('0x12c')});db[_0xe424('0x129')][_0xe424('0x11f')](db[_0xe424('0x1e')],{'foreignKey':_0xe424('0x12b'),'targetKey':_0xe424('0x12c')});db['VoiceCallReport'][_0xe424('0xe7')](db[_0xe424('0x26')],{'as':'QueueCalls','foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport'][_0xe424('0xe7')](db[_0xe424('0x24')],{'as':'AgentReports','foreignKey':_0xe424('0x12d'),'constraints':![]});db['VoiceCallReport'][_0xe424('0x11f')](db[_0xe424('0x12')],{'as':_0xe424('0x12'),'foreignKey':_0xe424('0xe6')});db[_0xe424('0x20')][_0xe424('0x11f')](db[_0xe424('0xf5')],{'as':_0xe424('0x12e'),'foreignKey':_0xe424('0x12f')});db[_0xe424('0x34')][_0xe424('0x11f')](db[_0xe424('0x37')],{'as':_0xe424('0x37'),'foreignKey':'MailAccountId'});db[_0xe424('0x130')][_0xe424('0x11f')](db[_0xe424('0x37')],{'as':_0xe424('0x37'),'foreignKey':_0xe424('0x131')});db['MailAccount'][_0xe424('0xe4')](db[_0xe424('0x34')],{'as':'Imap','onDelete':'cascade'});db[_0xe424('0x37')][_0xe424('0xe4')](db[_0xe424('0x130')],{'as':_0xe424('0x132'),'onDelete':_0xe424('0xe5')});db['MailAccount']['hasMany'](db['Disposition'],{'as':_0xe424('0x133'),'foreignKey':'MailAccountId'});db[_0xe424('0x37')]['hasMany'](db['CannedAnswer'],{'as':_0xe424('0x134'),'foreignKey':_0xe424('0x131')});db[_0xe424('0x37')][_0xe424('0xe7')](db[_0xe424('0x135')],{'as':_0xe424('0x12a'),'foreignKey':'MailAccountId'});db['MailAccount'][_0xe424('0xe7')](db[_0xe424('0xfb')],{'as':_0xe424('0x136')});db[_0xe424('0x37')][_0xe424('0xe7')](db['MailApplication'],{'as':'Applications'});db[_0xe424('0x37')]['belongsTo'](db[_0xe424('0xe0')],{'as':_0xe424('0x137'),'foreignKey':_0xe424('0x138')});db[_0xe424('0x37')][_0xe424('0x11f')](db[_0xe424('0x139')],{'as':_0xe424('0x139'),'foreignKey':_0xe424('0x13a')});db['MailAccount'][_0xe424('0xf4')](db[_0xe424('0x12')],{'as':_0xe424('0x13b'),'through':_0xe424('0x110')});db[_0xe424('0x39')][_0xe424('0xf4')](db[_0xe424('0x12')],{'as':_0xe424('0x13b'),'through':_0xe424('0x2f')});db['MailQueue'][_0xe424('0xf4')](db[_0xe424('0xd1')],{'through':_0xe424('0x13c'),'as':_0xe424('0x126')});db[_0xe424('0xfb')][_0xe424('0xe7')](db[_0xe424('0x135')],{'as':_0xe424('0x12a'),'onDelete':_0xe424('0xe5'),'foreignKey':'MailInteractionId'});db['MailInteraction'][_0xe424('0x11f')](db[_0xe424('0x37')],{'as':_0xe424('0x13d'),'foreignKey':_0xe424('0x131')});db['MailInteraction'][_0xe424('0x11f')](db[_0xe424('0xf5')],{'as':_0xe424('0x12e'),'foreignKey':'ContactId'});db[_0xe424('0xfb')][_0xe424('0x11f')](db['User'],{'as':_0xe424('0x13e'),'foreignKey':_0xe424('0xe6')});db[_0xe424('0xfb')][_0xe424('0xf4')](db[_0xe424('0x13f')],{'through':_0xe424('0x140'),'as':'Tags'});db['MailInteraction'][_0xe424('0xf4')](db[_0xe424('0x13f')],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db['MailInteraction']['belongsToMany'](db['User'],{'as':_0xe424('0x141'),'through':_0xe424('0xfc'),'foreignKey':_0xe424('0x142')});db[_0xe424('0x135')][_0xe424('0xe7')](db[_0xe424('0xd6')],{'as':'Attachments','onDelete':_0xe424('0xe5')});db['MailMessage'][_0xe424('0x11f')](db[_0xe424('0x12')],{'as':'User'});db[_0xe424('0x135')][_0xe424('0x11f')](db[_0xe424('0xf5')],{'onDelete':_0xe424('0xe5'),'as':_0xe424('0x12e')});db[_0xe424('0x135')][_0xe424('0x11f')](db['MailInteraction'],{'as':_0xe424('0x143'),'foreignKey':_0xe424('0x142')});db[_0xe424('0x135')]['belongsTo'](db[_0xe424('0x37')],{'as':_0xe424('0x13d'),'foreignKey':_0xe424('0x131')});db[_0xe424('0x3d')]['belongsTo'](db[_0xe424('0x12')],{'onDelete':'restrict'});db['MailApplication'][_0xe424('0x11f')](db[_0xe424('0x39')],{'onDelete':'restrict'});db[_0xe424('0x3d')][_0xe424('0x11f')](db[_0xe424('0x37')],{'onDelete':_0xe424('0x144')});db[_0xe424('0x3d')][_0xe424('0x11f')](db[_0xe424('0x7c')],{'onDelete':_0xe424('0x144'),'foreignKey':_0xe424('0x123')});db[_0xe424('0x3d')]['belongsTo'](db[_0xe424('0x13f')],{'onDelete':'restrict','foreignKey':_0xe424('0x145')});db[_0xe424('0x3f')][_0xe424('0x11f')](db[_0xe424('0x37')],{});db['MailQueueReport'][_0xe424('0x11f')](db[_0xe424('0xe0')],{'as':_0xe424('0x137'),'foreignKey':_0xe424('0x138')});db[_0xe424('0x3f')][_0xe424('0x11f')](db[_0xe424('0xf5')],{'as':_0xe424('0x12e'),'foreignKey':_0xe424('0x12f')});db[_0xe424('0x3f')][_0xe424('0x11f')](db['MailInteraction'],{});db[_0xe424('0x3f')]['belongsTo'](db[_0xe424('0x135')],{});db[_0xe424('0x3f')][_0xe424('0x11f')](db['User'],{});db[_0xe424('0x3f')][_0xe424('0x11f')](db[_0xe424('0x39')],{});db[_0xe424('0x40')]['hasMany'](db[_0xe424('0x41')],{'as':_0xe424('0x146'),'onDelete':_0xe424('0xe5')});db[_0xe424('0x42')]['hasMany'](db[_0xe424('0x78')],{'as':_0xe424('0x133'),'foreignKey':_0xe424('0x147')});db[_0xe424('0x42')]['hasMany'](db[_0xe424('0x76')],{'as':'Answers','foreignKey':_0xe424('0x147')});db['FaxAccount']['hasMany'](db[_0xe424('0x45')],{'as':_0xe424('0x136')});db['FaxAccount'][_0xe424('0xe7')](db[_0xe424('0x148')],{'as':_0xe424('0x116')});db['FaxAccount'][_0xe424('0xe7')](db[_0xe424('0x17')],{'as':_0xe424('0x149'),'onDelete':'cascade'});db['FaxAccount'][_0xe424('0xe7')](db[_0xe424('0x46')],{'as':_0xe424('0x12a')});db[_0xe424('0x42')]['belongsTo'](db[_0xe424('0x2a')],{'as':_0xe424('0x2a')});db[_0xe424('0x42')]['belongsTo'](db[_0xe424('0xe0')],{'as':'List','foreignKey':_0xe424('0x138')});db[_0xe424('0x42')][_0xe424('0xf4')](db['User'],{'as':_0xe424('0x13b'),'through':_0xe424('0x10e')});db[_0xe424('0x148')]['belongsTo'](db[_0xe424('0x12')],{'onDelete':_0xe424('0x144')});db[_0xe424('0x148')][_0xe424('0x11f')](db[_0xe424('0x48')],{'onDelete':_0xe424('0x144')});db['FaxApplication']['belongsTo'](db['FaxAccount'],{'onDelete':_0xe424('0x144')});db[_0xe424('0x148')]['belongsTo'](db[_0xe424('0x13f')],{'onDelete':_0xe424('0x144'),'foreignKey':'TagId'});db['FaxInteraction'][_0xe424('0xe7')](db['FaxMessage'],{'as':_0xe424('0x12a'),'onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x14a')});db[_0xe424('0x45')]['belongsTo'](db[_0xe424('0x42')],{'as':'Account','foreignKey':_0xe424('0x147')});db[_0xe424('0x45')][_0xe424('0x11f')](db[_0xe424('0xf5')],{'as':_0xe424('0x12e'),'foreignKey':'ContactId'});db[_0xe424('0x45')]['belongsTo'](db[_0xe424('0x12')],{'as':'Owner','foreignKey':_0xe424('0xe6')});db[_0xe424('0x45')][_0xe424('0xf4')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0xe424('0x14b')});db[_0xe424('0x45')][_0xe424('0xf4')](db['Tag'],{'through':_0xe424('0x14c'),'as':'ThroughTags'});db['FaxInteraction'][_0xe424('0xf4')](db['User'],{'as':'Users','through':_0xe424('0xfe'),'foreignKey':'FaxInteractionId'});db[_0xe424('0x46')][_0xe424('0x11f')](db[_0xe424('0x12')],{'onDelete':'cascade','as':_0xe424('0x12')});db['FaxMessage'][_0xe424('0x11f')](db['FaxInteraction'],{'as':_0xe424('0x143'),'foreignKey':_0xe424('0x14a')});db[_0xe424('0x46')][_0xe424('0x11f')](db[_0xe424('0xf5')],{'onDelete':_0xe424('0xe5'),'as':_0xe424('0x12e')});db[_0xe424('0x46')]['belongsTo'](db[_0xe424('0xd6')],{'as':_0xe424('0xd6'),'foreignKey':_0xe424('0x14d')});db[_0xe424('0x46')]['belongsTo'](db[_0xe424('0x42')],{'as':_0xe424('0x13d'),'foreignKey':'FaxAccountId'});db[_0xe424('0x48')][_0xe424('0xf4')](db[_0xe424('0x12')],{'as':_0xe424('0x13b'),'through':_0xe424('0x105')});db[_0xe424('0x48')][_0xe424('0xf4')](db[_0xe424('0xd1')],{'through':_0xe424('0x14e'),'as':_0xe424('0x126')});db[_0xe424('0x4a')][_0xe424('0x11f')](db['FaxAccount'],{});db['FaxQueueReport'][_0xe424('0x11f')](db[_0xe424('0xe0')],{'as':_0xe424('0x137'),'foreignKey':_0xe424('0x138')});db[_0xe424('0x4a')][_0xe424('0x11f')](db[_0xe424('0xf5')],{'as':_0xe424('0x12e'),'foreignKey':_0xe424('0x12f')});db['FaxQueueReport'][_0xe424('0x11f')](db[_0xe424('0x45')],{});db[_0xe424('0x4a')][_0xe424('0x11f')](db[_0xe424('0x46')],{});db['FaxQueueReport']['belongsTo'](db['User'],{});db['FaxQueueReport'][_0xe424('0x11f')](db['FaxQueue'],{});db[_0xe424('0x4c')][_0xe424('0xe7')](db[_0xe424('0x78')],{'as':'Dispositions','foreignKey':_0xe424('0x14f')});db[_0xe424('0x4c')][_0xe424('0xe7')](db[_0xe424('0x76')],{'as':_0xe424('0x134'),'foreignKey':_0xe424('0x14f')});db[_0xe424('0x4c')][_0xe424('0xe7')](db[_0xe424('0x51')],{'as':_0xe424('0x12a'),'foreignKey':'SmsAccountId'});db['SmsAccount']['hasMany'](db[_0xe424('0xef')],{'as':_0xe424('0x136')});db[_0xe424('0x4c')][_0xe424('0xe7')](db[_0xe424('0x4e')],{'as':_0xe424('0x116')});db[_0xe424('0x4c')]['belongsTo'](db[_0xe424('0xe0')],{'as':_0xe424('0x137'),'foreignKey':_0xe424('0x138')});db[_0xe424('0x4c')][_0xe424('0xf4')](db[_0xe424('0x12')],{'as':_0xe424('0x13b'),'through':'user_has_sms_accounts'});db[_0xe424('0x4e')][_0xe424('0x11f')](db['User'],{'onDelete':_0xe424('0x144')});db[_0xe424('0x4e')][_0xe424('0x11f')](db[_0xe424('0x53')],{'onDelete':'restrict'});db['SmsApplication'][_0xe424('0x11f')](db[_0xe424('0x4c')],{'onDelete':_0xe424('0x144')});db['SmsApplication'][_0xe424('0x11f')](db[_0xe424('0x7c')],{'onDelete':_0xe424('0x144'),'foreignKey':_0xe424('0x123')});db['SmsApplication'][_0xe424('0x11f')](db[_0xe424('0x13f')],{'onDelete':'restrict','foreignKey':_0xe424('0x145')});db[_0xe424('0xef')][_0xe424('0xe7')](db[_0xe424('0x51')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xe424('0x150')});db[_0xe424('0xef')]['belongsTo'](db['SmsAccount'],{'as':_0xe424('0x13d'),'foreignKey':_0xe424('0x14f')});db['SmsInteraction'][_0xe424('0x11f')](db[_0xe424('0xf5')],{'as':'Contact','foreignKey':'ContactId'});db[_0xe424('0xef')]['belongsTo'](db['User'],{'as':_0xe424('0x13e'),'foreignKey':_0xe424('0xe6')});db[_0xe424('0xef')][_0xe424('0xf4')](db[_0xe424('0x13f')],{'through':'sms_interaction_has_tags','as':_0xe424('0x14b')});db[_0xe424('0xef')]['belongsToMany'](db[_0xe424('0x13f')],{'through':_0xe424('0x151'),'as':_0xe424('0x152')});db['SmsInteraction'][_0xe424('0xf4')](db[_0xe424('0x12')],{'as':_0xe424('0x141'),'through':_0xe424('0xff'),'foreignKey':'SmsInteractionId'});db[_0xe424('0x51')]['belongsTo'](db[_0xe424('0x12')],{'as':_0xe424('0x12')});db[_0xe424('0x51')][_0xe424('0x11f')](db[_0xe424('0xf5')],{'onDelete':'cascade','as':'Contact'});db[_0xe424('0x51')][_0xe424('0x11f')](db[_0xe424('0xef')],{'onDelete':_0xe424('0xe5'),'as':_0xe424('0x143'),'foreignKey':_0xe424('0x150')});db[_0xe424('0x51')][_0xe424('0x11f')](db['SmsAccount'],{'as':_0xe424('0x13d'),'foreignKey':'SmsAccountId'});db[_0xe424('0x53')][_0xe424('0xf4')](db[_0xe424('0x12')],{'as':_0xe424('0x13b'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0xe424('0x53')][_0xe424('0xf4')](db['Team'],{'through':_0xe424('0x153'),'as':'Teams'});db['OpenchannelAccount'][_0xe424('0xe7')](db[_0xe424('0x78')],{'as':_0xe424('0x133'),'foreignKey':_0xe424('0x154')});db[_0xe424('0x55')][_0xe424('0xe7')](db[_0xe424('0x76')],{'as':'Answers','foreignKey':_0xe424('0x154')});db[_0xe424('0x55')][_0xe424('0xe7')](db[_0xe424('0x58')],{'as':'Interactions','foreignKey':_0xe424('0x154')});db[_0xe424('0x55')]['hasMany'](db[_0xe424('0x155')],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db[_0xe424('0x55')][_0xe424('0xe7')](db[_0xe424('0x57')],{'as':_0xe424('0x116'),'foreignKey':_0xe424('0x154')});db[_0xe424('0x55')][_0xe424('0x11f')](db['CmList'],{'as':_0xe424('0x137'),'foreignKey':_0xe424('0x138')});db[_0xe424('0x55')][_0xe424('0xf4')](db[_0xe424('0x12')],{'as':_0xe424('0x13b'),'through':'user_has_openchannel_accounts'});db[_0xe424('0x57')][_0xe424('0x11f')](db[_0xe424('0x12')],{'onDelete':_0xe424('0x144')});db[_0xe424('0x57')][_0xe424('0x11f')](db[_0xe424('0x108')],{'onDelete':'restrict','foreignKey':_0xe424('0x156')});db[_0xe424('0x57')][_0xe424('0x11f')](db[_0xe424('0x55')],{'onDelete':_0xe424('0x144'),'foreignKey':_0xe424('0x154')});db[_0xe424('0x57')]['belongsTo'](db[_0xe424('0x7c')],{'onDelete':_0xe424('0x144'),'foreignKey':'IntervalId'});db[_0xe424('0x57')][_0xe424('0x11f')](db['Tag'],{'onDelete':_0xe424('0x144'),'foreignKey':'TagId'});db[_0xe424('0x58')][_0xe424('0xe7')](db[_0xe424('0x155')],{'as':_0xe424('0x12a'),'onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db['OpenchannelInteraction']['belongsTo'](db[_0xe424('0x55')],{'as':_0xe424('0x13d'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0xe424('0x11f')](db[_0xe424('0xf5')],{'as':_0xe424('0x12e'),'foreignKey':_0xe424('0x12f')});db[_0xe424('0x58')][_0xe424('0x11f')](db['User'],{'as':'Owner','foreignKey':_0xe424('0xe6')});db[_0xe424('0x58')][_0xe424('0xf4')](db[_0xe424('0x13f')],{'through':_0xe424('0x157'),'as':_0xe424('0x14b')});db[_0xe424('0x58')][_0xe424('0xf4')](db[_0xe424('0x13f')],{'through':_0xe424('0x157'),'as':_0xe424('0x152')});db[_0xe424('0x58')]['belongsToMany'](db[_0xe424('0x12')],{'as':_0xe424('0x141'),'through':'user_has_openchannel_interactions','foreignKey':_0xe424('0x158')});db[_0xe424('0x155')][_0xe424('0x11f')](db['User'],{'onDelete':'cascade','as':'User'});db[_0xe424('0x155')][_0xe424('0x11f')](db[_0xe424('0xf5')],{'onDelete':_0xe424('0xe5'),'as':_0xe424('0x12e')});db['OpenchannelMessage'][_0xe424('0x11f')](db[_0xe424('0x58')],{'onDelete':_0xe424('0xe5'),'as':_0xe424('0x143'),'foreignKey':_0xe424('0x158')});db[_0xe424('0x155')][_0xe424('0x11f')](db['Attachment'],{'as':_0xe424('0xd6'),'foreignKey':_0xe424('0x14d')});db[_0xe424('0x155')]['belongsTo'](db[_0xe424('0x55')],{'as':_0xe424('0x13d'),'foreignKey':'OpenchannelAccountId'});db[_0xe424('0x108')][_0xe424('0xf4')](db[_0xe424('0x12')],{'as':'Agents','through':_0xe424('0x33'),'foreignKey':_0xe424('0x156')});db[_0xe424('0x108')][_0xe424('0xf4')](db[_0xe424('0xd1')],{'through':_0xe424('0x159'),'as':'Teams'});db['ChatWebsite'][_0xe424('0xe7')](db['Disposition'],{'as':_0xe424('0x133'),'foreignKey':_0xe424('0x15a')});db[_0xe424('0x5b')]['hasMany'](db[_0xe424('0x76')],{'as':_0xe424('0x134'),'foreignKey':_0xe424('0x15a')});db['ChatWebsite'][_0xe424('0xe7')](db[_0xe424('0x15b')],{'as':_0xe424('0x15c')});db[_0xe424('0x5b')][_0xe424('0xe7')](db[_0xe424('0x60')],{'as':'Interactions'});db[_0xe424('0x5b')][_0xe424('0xe7')](db[_0xe424('0x5e')],{'as':_0xe424('0x116')});db['ChatWebsite'][_0xe424('0xe7')](db[_0xe424('0x61')],{'as':_0xe424('0x12a')});db[_0xe424('0x5b')][_0xe424('0x11f')](db[_0xe424('0xe0')],{'as':_0xe424('0x137'),'foreignKey':'ListId'});db['ChatWebsite'][_0xe424('0x11f')](db['Interval'],{'as':_0xe424('0x7c'),'foreignKey':_0xe424('0x123')});db[_0xe424('0x5b')][_0xe424('0xf4')](db['User'],{'as':_0xe424('0x13b'),'through':_0xe424('0x10c')});db['OpenchannelQueueReport'][_0xe424('0x11f')](db[_0xe424('0x55')],{});db[_0xe424('0x5d')][_0xe424('0x11f')](db['CmList'],{'as':'List','foreignKey':_0xe424('0x138')});db[_0xe424('0x5d')][_0xe424('0x11f')](db[_0xe424('0xf5')],{'as':_0xe424('0x12e'),'foreignKey':'ContactId'});db['OpenchannelQueueReport'][_0xe424('0x11f')](db['OpenchannelInteraction'],{});db[_0xe424('0x5d')][_0xe424('0x11f')](db['OpenchannelMessage'],{});db['OpenchannelQueueReport'][_0xe424('0x11f')](db[_0xe424('0x12')],{});db[_0xe424('0x5d')][_0xe424('0x11f')](db['OpenchannelQueue'],{});db[_0xe424('0x5e')][_0xe424('0x11f')](db[_0xe424('0x12')],{'as':_0xe424('0x15d'),'foreignKey':_0xe424('0xe6'),'onDelete':_0xe424('0x144')});db['ChatApplication'][_0xe424('0x11f')](db[_0xe424('0x65')],{'as':_0xe424('0x15e'),'foreignKey':'ChatQueueId','onDelete':_0xe424('0x144')});db['ChatApplication']['belongsTo'](db[_0xe424('0x5b')],{'as':_0xe424('0x15f'),'foreignKey':_0xe424('0x15a'),'onDelete':'restrict'});db[_0xe424('0x5e')][_0xe424('0x11f')](db[_0xe424('0x13f')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xe424('0x60')][_0xe424('0xe7')](db[_0xe424('0x61')],{'as':_0xe424('0x12a'),'onDelete':_0xe424('0xe5'),'foreignKey':'ChatInteractionId'});db[_0xe424('0x60')][_0xe424('0x11f')](db[_0xe424('0x5b')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xe424('0x60')]['belongsTo'](db[_0xe424('0xf5')],{'as':_0xe424('0x12e'),'foreignKey':_0xe424('0x12f')});db[_0xe424('0x60')][_0xe424('0x11f')](db[_0xe424('0x12')],{'as':_0xe424('0x13e'),'foreignKey':_0xe424('0xe6')});db[_0xe424('0x60')][_0xe424('0xf4')](db[_0xe424('0x13f')],{'through':_0xe424('0x160'),'as':_0xe424('0x14b')});db['ChatInteraction'][_0xe424('0xf4')](db['Tag'],{'through':_0xe424('0x160'),'as':'ThroughTags'});db[_0xe424('0x60')]['belongsToMany'](db[_0xe424('0x12')],{'as':'Users','through':_0xe424('0x161'),'foreignKey':_0xe424('0x162')});db[_0xe424('0x61')][_0xe424('0x11f')](db['User'],{'onDelete':_0xe424('0xe5'),'as':_0xe424('0x12')});db['ChatMessage'][_0xe424('0x11f')](db[_0xe424('0xf5')],{'onDelete':_0xe424('0xe5'),'as':'Contact','foreignKey':_0xe424('0x12f')});db[_0xe424('0x61')]['belongsTo'](db[_0xe424('0x60')],{'onDelete':_0xe424('0xe5'),'as':_0xe424('0x143'),'foreignKey':_0xe424('0x162')});db[_0xe424('0x61')][_0xe424('0x11f')](db[_0xe424('0xd6')],{'as':_0xe424('0xd6'),'foreignKey':'AttachmentId'});db['ChatMessage']['belongsTo'](db['ChatWebsite'],{'as':_0xe424('0x13d'),'foreignKey':_0xe424('0x15a')});db['ChatOfflineMessage']['belongsTo'](db[_0xe424('0xf5')],{'onDelete':_0xe424('0xe5'),'as':_0xe424('0x12e'),'foreignKey':_0xe424('0x12f')});db[_0xe424('0x63')][_0xe424('0x11f')](db[_0xe424('0x5b')],{'as':_0xe424('0x13d'),'foreignKey':_0xe424('0x15a')});db['ChatQueue'][_0xe424('0xf4')](db[_0xe424('0x12')],{'as':'Agents','through':_0xe424('0x104'),'hooks':!![]});db[_0xe424('0x65')][_0xe424('0xf4')](db['Team'],{'through':'team_has_chat_queues','as':'Teams'});db[_0xe424('0x67')][_0xe424('0xe7')](db[_0xe424('0xbc')],{'as':_0xe424('0x12a'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0xe424('0x67')][_0xe424('0xf4')](db[_0xe424('0x12')],{'as':'Members','through':'chat_group_has_users'});db[_0xe424('0x15b')][_0xe424('0x11f')](db[_0xe424('0x5b')],{'as':_0xe424('0x15f'),'foreignKey':_0xe424('0x15a')});db['CmCompany'][_0xe424('0xe7')](db[_0xe424('0xf5')],{'as':_0xe424('0xf6'),'foreignKey':_0xe424('0x163')});db[_0xe424('0xf5')]['hasMany'](db[_0xe424('0x6b')],{'as':_0xe424('0x11a'),'foreignKey':_0xe424('0x12f')});db[_0xe424('0xf5')]['hasMany'](db[_0xe424('0x11c')],{'as':_0xe424('0xea'),'foreignKey':_0xe424('0x12f')});db[_0xe424('0xf5')][_0xe424('0xe7')](db[_0xe424('0xeb')],{'as':'HopperHistories','foreignKey':_0xe424('0x12f')});db['CmContact']['hasMany'](db[_0xe424('0x6f')],{'as':_0xe424('0x6f'),'foreignKey':_0xe424('0x12f')});db[_0xe424('0xf5')][_0xe424('0xe7')](db[_0xe424('0xc1')],{'as':_0xe424('0x11e'),'foreignKey':_0xe424('0x12f')});db[_0xe424('0xf5')]['hasMany'](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0xe424('0x12f'),'onDelete':_0xe424('0x144')});db[_0xe424('0xf5')][_0xe424('0xe7')](db[_0xe424('0x60')],{'as':_0xe424('0xee'),'foreignKey':_0xe424('0x12f'),'onDelete':'restrict'});db[_0xe424('0xf5')][_0xe424('0xe7')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0xe424('0x12f'),'onDelete':_0xe424('0x144')});db[_0xe424('0xf5')]['hasMany'](db['FaxInteraction'],{'as':_0xe424('0xfd'),'foreignKey':'ContactId','onDelete':_0xe424('0x144')});db[_0xe424('0xf5')][_0xe424('0xe7')](db[_0xe424('0xfb')],{'as':_0xe424('0xf1'),'foreignKey':_0xe424('0x12f'),'onDelete':_0xe424('0x144')});db[_0xe424('0xf5')]['belongsTo'](db[_0xe424('0x164')],{'as':_0xe424('0x165'),'foreignKey':_0xe424('0x163')});db[_0xe424('0xf5')][_0xe424('0x11f')](db[_0xe424('0xe0')],{'as':_0xe424('0x137'),'foreignKey':_0xe424('0x138'),'onDelete':'cascade'});db[_0xe424('0xf5')][_0xe424('0xf4')](db[_0xe424('0x12')],{'as':_0xe424('0x141'),'through':_0xe424('0xf7')});db[_0xe424('0xf5')][_0xe424('0xf4')](db[_0xe424('0x13f')],{'as':'Tags','through':_0xe424('0x166')});db[_0xe424('0xf5')][_0xe424('0xf4')](db[_0xe424('0x13f')],{'through':_0xe424('0x166'),'as':_0xe424('0x152')});db[_0xe424('0x6b')][_0xe424('0x11f')](db[_0xe424('0xf5')],{'as':_0xe424('0x12e'),'foreignKey':'ContactId','onDelete':_0xe424('0xe5')});db[_0xe424('0x6b')][_0xe424('0x11f')](db['CmList'],{'as':'List','foreignKey':'ListId','onDelete':_0xe424('0xe5')});db['CmHopper']['belongsTo'](db['User'],{'as':_0xe424('0x15d'),'foreignKey':'UserId'});db[_0xe424('0x6b')]['belongsTo'](db[_0xe424('0x1b')],{'as':'Queue','foreignKey':_0xe424('0x11b'),'onDelete':_0xe424('0xe5')});db['CmHopper'][_0xe424('0x11f')](db[_0xe424('0x167')],{'as':_0xe424('0x167'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0xe424('0x6c')]['belongsTo'](db[_0xe424('0xf5')],{'as':_0xe424('0x12e'),'foreignKey':'ContactId','onDelete':_0xe424('0xe5')});db[_0xe424('0x6c')]['belongsTo'](db[_0xe424('0xe0')],{'as':_0xe424('0x137'),'foreignKey':_0xe424('0x138'),'onDelete':_0xe424('0xe5')});db['CmHopperBlack']['belongsTo'](db[_0xe424('0x1b')],{'as':_0xe424('0x15e'),'foreignKey':_0xe424('0x11b'),'onDelete':_0xe424('0xe5')});db[_0xe424('0x6c')][_0xe424('0x11f')](db[_0xe424('0x167')],{'as':'Campaign','foreignKey':_0xe424('0x168'),'onDelete':_0xe424('0xe5')});db['Automation'][_0xe424('0xe7')](db[_0xe424('0x7a')],{'as':{'plural':_0xe424('0x169'),'singular':_0xe424('0x16a')},'foreignKey':_0xe424('0x16b'),'onDelete':'cascade','hooks':!![]});db[_0xe424('0x75')][_0xe424('0xe7')](db[_0xe424('0x7a')],{'as':{'plural':_0xe424('0x16c'),'singular':'OneAny'},'foreignKey':_0xe424('0x16d'),'onDelete':_0xe424('0xe5'),'hooks':!![]});db['Automation']['hasMany'](db[_0xe424('0x73')],{'as':_0xe424('0x16e'),'foreignKey':'AutomationId','onDelete':_0xe424('0xe5'),'hooks':!![]});db[_0xe424('0x7c')]['hasMany'](db[_0xe424('0x7c')],{'as':_0xe424('0x16f'),'foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db['Interval'][_0xe424('0xe7')](db[_0xe424('0x17')],{'as':_0xe424('0xe9'),'foreignKey':_0xe424('0x123'),'onDelete':_0xe424('0x144')});db[_0xe424('0x7c')]['hasMany'](db[_0xe424('0x3d')],{'as':_0xe424('0x170'),'foreignKey':_0xe424('0x123')});db[_0xe424('0x7c')][_0xe424('0xe7')](db['ChatApplication'],{'as':_0xe424('0x171'),'foreignKey':_0xe424('0x123')});db['Interval']['hasMany'](db[_0xe424('0x148')],{'as':_0xe424('0x172'),'foreignKey':_0xe424('0x123')});db[_0xe424('0x7c')][_0xe424('0xe7')](db['SmsApplication'],{'as':_0xe424('0x173'),'foreignKey':'IntervalId'});db[_0xe424('0x174')][_0xe424('0x11f')](db[_0xe424('0x37')],{});db[_0xe424('0x174')][_0xe424('0x11f')](db[_0xe424('0x175')],{'foreignKey':_0xe424('0x176')});db[_0xe424('0x174')][_0xe424('0x11f')](db[_0xe424('0x8d')],{'foreignKey':'CustomReportId'});db[_0xe424('0x83')][_0xe424('0xf4')](db[_0xe424('0x19')],{'as':_0xe424('0x177'),'through':_0xe424('0x118'),'onDelete':_0xe424('0x144')});db[_0xe424('0x13f')]['belongsToMany'](db[_0xe424('0xf5')],{'through':_0xe424('0x166')});db[_0xe424('0x13f')][_0xe424('0xf4')](db[_0xe424('0x60')],{'through':_0xe424('0x160')});db['Tag'][_0xe424('0xf4')](db[_0xe424('0xfb')],{'through':_0xe424('0x140')});db[_0xe424('0x13f')][_0xe424('0xf4')](db[_0xe424('0xef')],{'through':_0xe424('0x151')});db['Tag']['belongsToMany'](db[_0xe424('0x45')],{'through':'fax_interaction_has_tags'});db[_0xe424('0x13f')][_0xe424('0xf4')](db['OpenchannelInteraction'],{'through':_0xe424('0x157')});db[_0xe424('0x86')][_0xe424('0xe7')](db['Condition'],{'as':{'plural':'AllConditions','singular':_0xe424('0x178')},'foreignKey':_0xe424('0x179'),'onDelete':_0xe424('0xe5'),'hooks':!![]});db[_0xe424('0x86')][_0xe424('0xe7')](db[_0xe424('0x7a')],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':_0xe424('0x17a'),'onDelete':_0xe424('0xe5'),'hooks':!![]});db['Trigger'][_0xe424('0xe7')](db[_0xe424('0x73')],{'as':_0xe424('0x16e'),'foreignKey':_0xe424('0x17b'),'onDelete':_0xe424('0xe5'),'hooks':!![]});db[_0xe424('0x8d')][_0xe424('0xe7')](db['AnalyticFieldReport'],{'as':_0xe424('0x17c'),'onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x17d'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0xe424('0x17e')],{'as':_0xe424('0x17c'),'onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x176')});db[_0xe424('0x92')][_0xe424('0xe7')](db[_0xe424('0x17e')],{'as':_0xe424('0x17c'),'onDelete':'cascade','foreignKey':'MetricId'});db[_0xe424('0x17e')][_0xe424('0x11f')](db[_0xe424('0x92')],{'foreignKey':'MetricId'});db[_0xe424('0x17f')][_0xe424('0xe7')](db['SalesforceConfiguration'],{'as':'Configurations','onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x180')});db[_0xe424('0x181')]['hasMany'](db[_0xe424('0x182')],{'as':_0xe424('0x183'),'onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x184')});db[_0xe424('0x181')][_0xe424('0xe7')](db[_0xe424('0x182')],{'as':_0xe424('0x185'),'onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x186')});db[_0xe424('0x181')]['hasMany'](db[_0xe424('0x182')],{'as':'Fields','onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x187')});db[_0xe424('0x181')][_0xe424('0x11f')](db[_0xe424('0x17f')],{'as':'Account','foreignKey':_0xe424('0x180')});db[_0xe424('0x182')]['hasMany'](db[_0xe424('0x182')],{'as':_0xe424('0x188'),'foreignKey':_0xe424('0x184')});db['SalesforceField']['hasMany'](db[_0xe424('0x182')],{'as':_0xe424('0x189'),'foreignKey':_0xe424('0x186')});db[_0xe424('0x182')][_0xe424('0xe7')](db['SalesforceField'],{'as':_0xe424('0x18a'),'foreignKey':_0xe424('0x187')});db[_0xe424('0x182')][_0xe424('0x11f')](db['Variable'],{'as':_0xe424('0x88'),'foreignKey':'VariableId'});db[_0xe424('0x9a')][_0xe424('0xe7')](db[_0xe424('0x9c')],{'as':_0xe424('0x18b'),'onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x180')});db[_0xe424('0x9c')][_0xe424('0xe7')](db[_0xe424('0x9e')],{'as':'Subjects','onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x184')});db[_0xe424('0x9c')][_0xe424('0xe7')](db[_0xe424('0x9e')],{'as':'Descriptions','onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x186')});db[_0xe424('0x9c')][_0xe424('0xe7')](db[_0xe424('0x9e')],{'as':_0xe424('0x17c'),'onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x187')});db[_0xe424('0x9c')]['belongsTo'](db[_0xe424('0x9a')],{'as':_0xe424('0x13d'),'foreignKey':_0xe424('0x180')});db[_0xe424('0x9e')]['hasMany'](db[_0xe424('0x9e')],{'as':'Subject','foreignKey':_0xe424('0x184')});db[_0xe424('0x9e')][_0xe424('0xe7')](db[_0xe424('0x9e')],{'as':_0xe424('0x189'),'foreignKey':_0xe424('0x186')});db[_0xe424('0x9e')][_0xe424('0xe7')](db['SugarcrmField'],{'as':_0xe424('0x18a'),'foreignKey':_0xe424('0x187')});db['SugarcrmField'][_0xe424('0x11f')](db[_0xe424('0x88')],{'as':'Variable','foreignKey':_0xe424('0x18c')});db[_0xe424('0xa0')][_0xe424('0xe7')](db[_0xe424('0xa2')],{'as':_0xe424('0x18b'),'onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x180')});db[_0xe424('0xa2')][_0xe424('0xe7')](db['DeskField'],{'as':_0xe424('0x183'),'onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x184')});db[_0xe424('0xa2')][_0xe424('0xe7')](db[_0xe424('0xa4')],{'as':_0xe424('0x185'),'onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x186')});db['DeskConfiguration'][_0xe424('0xe7')](db[_0xe424('0xa4')],{'as':_0xe424('0x17c'),'onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x187')});db[_0xe424('0xa2')][_0xe424('0x11f')](db[_0xe424('0xa0')],{'as':_0xe424('0x13d'),'foreignKey':_0xe424('0x180')});db[_0xe424('0xa2')][_0xe424('0xf4')](db[_0xe424('0x13f')],{'through':_0xe424('0x18d')});db[_0xe424('0xa4')]['hasMany'](db[_0xe424('0xa4')],{'as':_0xe424('0x188'),'foreignKey':_0xe424('0x184')});db[_0xe424('0xa4')][_0xe424('0xe7')](db['DeskField'],{'as':_0xe424('0x189'),'foreignKey':_0xe424('0x186')});db['DeskField'][_0xe424('0xe7')](db[_0xe424('0xa4')],{'as':_0xe424('0x18a'),'foreignKey':_0xe424('0x187')});db[_0xe424('0xa4')][_0xe424('0x11f')](db['Variable'],{'as':_0xe424('0x88'),'foreignKey':'VariableId'});db[_0xe424('0xa5')]['hasMany'](db[_0xe424('0x18e')],{'as':_0xe424('0x18b'),'onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x180')});db[_0xe424('0x18e')][_0xe424('0xe7')](db['ZohoField'],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xe424('0x184')});db[_0xe424('0x18e')][_0xe424('0xe7')](db[_0xe424('0xa7')],{'as':_0xe424('0x185'),'onDelete':'cascade','foreignKey':_0xe424('0x186')});db['ZohoConfiguration']['hasMany'](db[_0xe424('0xa7')],{'as':_0xe424('0x17c'),'onDelete':_0xe424('0xe5'),'foreignKey':'FieldId'});db[_0xe424('0x18e')]['belongsTo'](db[_0xe424('0xa5')],{'as':'Account','foreignKey':_0xe424('0x180')});db[_0xe424('0xa7')]['hasMany'](db[_0xe424('0xa7')],{'as':_0xe424('0x188'),'foreignKey':_0xe424('0x184')});db[_0xe424('0xa7')][_0xe424('0xe7')](db['ZohoField'],{'as':'Description','foreignKey':_0xe424('0x186')});db[_0xe424('0xa7')][_0xe424('0xe7')](db[_0xe424('0xa7')],{'as':_0xe424('0x18a'),'foreignKey':_0xe424('0x187')});db[_0xe424('0xa7')][_0xe424('0x11f')](db['Variable'],{'as':_0xe424('0x88'),'foreignKey':'VariableId'});db[_0xe424('0x18f')][_0xe424('0xe7')](db[_0xe424('0xaa')],{'as':_0xe424('0x18b'),'onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x180')});db[_0xe424('0xaa')][_0xe424('0xe7')](db[_0xe424('0xac')],{'as':'Subjects','foreignKey':_0xe424('0x184')});db[_0xe424('0xaa')][_0xe424('0xe7')](db['ZendeskField'],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xe424('0xaa')][_0xe424('0xe7')](db['ZendeskField'],{'as':_0xe424('0x17c'),'foreignKey':_0xe424('0x187')});db[_0xe424('0xaa')][_0xe424('0x11f')](db[_0xe424('0x18f')],{'as':_0xe424('0x13d'),'foreignKey':'AccountId'});db[_0xe424('0xaa')][_0xe424('0xf4')](db[_0xe424('0x13f')],{'through':_0xe424('0x190')});db[_0xe424('0xac')][_0xe424('0xe7')](db[_0xe424('0xac')],{'as':'Subject','foreignKey':_0xe424('0x184')});db[_0xe424('0xac')]['hasMany'](db[_0xe424('0xac')],{'as':'Description','foreignKey':_0xe424('0x186')});db[_0xe424('0xac')][_0xe424('0xe7')](db[_0xe424('0xac')],{'as':_0xe424('0x18a'),'foreignKey':'FieldId'});db[_0xe424('0xac')]['belongsTo'](db[_0xe424('0x88')],{'as':_0xe424('0x88'),'foreignKey':_0xe424('0x18c')});db[_0xe424('0x191')]['hasMany'](db[_0xe424('0xaf')],{'as':_0xe424('0x18b'),'onDelete':_0xe424('0xe5'),'foreignKey':'AccountId'});db[_0xe424('0xaf')][_0xe424('0xe7')](db['FreshdeskField'],{'as':_0xe424('0x183'),'onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x184')});db['FreshdeskConfiguration'][_0xe424('0xe7')](db[_0xe424('0xb1')],{'as':_0xe424('0x185'),'onDelete':_0xe424('0xe5'),'foreignKey':'DescriptionId'});db[_0xe424('0xaf')][_0xe424('0xe7')](db['FreshdeskField'],{'as':_0xe424('0x17c'),'onDelete':'cascade','foreignKey':_0xe424('0x187')});db['FreshdeskConfiguration']['belongsTo'](db[_0xe424('0x191')],{'as':_0xe424('0x13d'),'foreignKey':_0xe424('0x180')});db[_0xe424('0xaf')][_0xe424('0xf4')](db['Tag'],{'through':_0xe424('0x192')});db[_0xe424('0xb1')][_0xe424('0xe7')](db[_0xe424('0xb1')],{'as':_0xe424('0x188'),'foreignKey':_0xe424('0x184')});db[_0xe424('0xb1')]['hasMany'](db[_0xe424('0xb1')],{'as':_0xe424('0x189'),'foreignKey':_0xe424('0x186')});db[_0xe424('0xb1')][_0xe424('0xe7')](db[_0xe424('0xb1')],{'as':'Field','foreignKey':_0xe424('0x187')});db[_0xe424('0xb1')][_0xe424('0x11f')](db[_0xe424('0x88')],{'as':_0xe424('0x88'),'foreignKey':_0xe424('0x18c')});db[_0xe424('0xb3')][_0xe424('0xe7')](db[_0xe424('0xb4')],{'as':_0xe424('0x18b'),'onDelete':_0xe424('0xe5'),'foreignKey':'AccountId'});db[_0xe424('0xb4')][_0xe424('0xe7')](db['VtigerField'],{'as':_0xe424('0x183'),'foreignKey':'SubjectId'});db[_0xe424('0xb4')]['hasMany'](db['VtigerField'],{'as':_0xe424('0x185'),'foreignKey':_0xe424('0x186')});db['VtigerConfiguration']['hasMany'](db[_0xe424('0xb6')],{'as':_0xe424('0x17c'),'foreignKey':_0xe424('0x187')});db[_0xe424('0xb4')]['belongsTo'](db[_0xe424('0xb3')],{'as':_0xe424('0x13d'),'foreignKey':'AccountId'});db[_0xe424('0xb4')][_0xe424('0xf4')](db['Tag'],{'through':_0xe424('0x193')});db[_0xe424('0xb6')]['hasMany'](db[_0xe424('0xb6')],{'as':_0xe424('0x188'),'foreignKey':'SubjectId'});db[_0xe424('0xb6')]['hasMany'](db['VtigerField'],{'as':_0xe424('0x189'),'foreignKey':_0xe424('0x186')});db['VtigerField']['hasMany'](db[_0xe424('0xb6')],{'as':_0xe424('0x18a'),'foreignKey':_0xe424('0x187')});db[_0xe424('0xb6')][_0xe424('0x11f')](db[_0xe424('0x88')],{'as':_0xe424('0x88'),'foreignKey':_0xe424('0x18c')});db['ChatQueueReport'][_0xe424('0x11f')](db[_0xe424('0x5b')],{});db[_0xe424('0xba')][_0xe424('0x11f')](db[_0xe424('0xe0')],{'as':_0xe424('0x137'),'foreignKey':'ListId'});db[_0xe424('0xba')][_0xe424('0x11f')](db[_0xe424('0xf5')],{'as':_0xe424('0x12e'),'foreignKey':_0xe424('0x12f')});db[_0xe424('0xba')]['belongsTo'](db[_0xe424('0x60')],{});db[_0xe424('0xba')][_0xe424('0x11f')](db[_0xe424('0x61')],{});db[_0xe424('0xba')]['belongsTo'](db[_0xe424('0x12')],{});db['ChatQueueReport'][_0xe424('0x11f')](db[_0xe424('0x65')],{});db[_0xe424('0xbc')][_0xe424('0x11f')](db[_0xe424('0x12')],{'onDelete':_0xe424('0xe5'),'foreignKey':'FromId'});db['ChatInternalMessage']['belongsTo'](db[_0xe424('0x12')],{'onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x194')});db[_0xe424('0xc1')][_0xe424('0xe7')](db[_0xe424('0xbf')],{'foreignKey':_0xe424('0x195'),'onDelete':_0xe424('0xe5')});db[_0xe424('0xc1')]['hasMany'](db[_0xe424('0xbd')],{'foreignKey':_0xe424('0x195'),'onDelete':_0xe424('0xe5')});db['SmsQueueReport'][_0xe424('0x11f')](db[_0xe424('0x4c')],{});db[_0xe424('0xc3')][_0xe424('0x11f')](db[_0xe424('0xe0')],{'as':_0xe424('0x137'),'foreignKey':_0xe424('0x138')});db[_0xe424('0xc3')][_0xe424('0x11f')](db['CmContact'],{'as':_0xe424('0x12e'),'foreignKey':_0xe424('0x12f')});db[_0xe424('0xc3')][_0xe424('0x11f')](db[_0xe424('0xef')],{});db[_0xe424('0xc3')][_0xe424('0x11f')](db['SmsMessage'],{});db['SmsQueueReport'][_0xe424('0x11f')](db[_0xe424('0x12')],{});db[_0xe424('0xc3')][_0xe424('0x11f')](db[_0xe424('0x53')],{});db[_0xe424('0xc9')][_0xe424('0xe7')](db[_0xe424('0xc1')],{'foreignKey':'ProjectId'});db[_0xe424('0xc9')][_0xe424('0xe7')](db[_0xe424('0xbf')],{'foreignKey':_0xe424('0x196')});db[_0xe424('0xc9')]['hasMany'](db[_0xe424('0xbd')],{'foreignKey':_0xe424('0x196')});db[_0xe424('0xcd')][_0xe424('0xf4')](db[_0xe424('0x12')],{'as':_0xe424('0x141'),'through':_0xe424('0x115')});db[_0xe424('0xd1')][_0xe424('0xf4')](db[_0xe424('0x12')],{'as':'Agents','through':_0xe424('0xfa')});db[_0xe424('0xd1')][_0xe424('0xf4')](db[_0xe424('0x1b')],{'through':_0xe424('0x197'),'as':_0xe424('0x101')});db[_0xe424('0xd1')][_0xe424('0xf4')](db['MailQueue'],{'through':_0xe424('0x13c'),'as':_0xe424('0x102')});db[_0xe424('0xd1')][_0xe424('0xf4')](db[_0xe424('0x65')],{'through':_0xe424('0x198'),'as':_0xe424('0x103')});db[_0xe424('0xd1')]['belongsToMany'](db['FaxQueue'],{'through':'team_has_fax_queues','as':_0xe424('0x199')});db[_0xe424('0xd1')][_0xe424('0xf4')](db[_0xe424('0x53')],{'through':'team_has_sms_queues','as':'SmsQueues'});db[_0xe424('0xd1')][_0xe424('0xf4')](db[_0xe424('0x108')],{'through':_0xe424('0x159'),'as':_0xe424('0x109')});db[_0xe424('0x167')]['hasMany'](db['CmHopper'],{'as':_0xe424('0x11a'),'foreignKey':_0xe424('0x168')});db['Campaign'][_0xe424('0xe7')](db[_0xe424('0x11c')],{'as':_0xe424('0xea'),'foreignKey':_0xe424('0x168')});db[_0xe424('0x167')][_0xe424('0xe7')](db['CmHopperHistory'],{'as':_0xe424('0x19a'),'foreignKey':_0xe424('0x168')});db[_0xe424('0x167')]['hasMany'](db[_0xe424('0x6c')],{'as':_0xe424('0x11d'),'foreignKey':'CampaignId'});db[_0xe424('0x167')][_0xe424('0x11f')](db['Trunk'],{'as':_0xe424('0x2a'),'foreignKey':_0xe424('0x120')});db['Campaign'][_0xe424('0x11f')](db[_0xe424('0x2a')],{'as':_0xe424('0x121'),'foreignKey':'TrunkBackupId'});db[_0xe424('0x167')][_0xe424('0x11f')](db[_0xe424('0x7c')],{'as':_0xe424('0x7c'),'foreignKey':_0xe424('0x123')});db[_0xe424('0x167')][_0xe424('0x11f')](db[_0xe424('0xcd')],{'as':_0xe424('0xcd'),'foreignKey':'SquareProjectId'});db[_0xe424('0x167')][_0xe424('0xf4')](db[_0xe424('0xe0')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0xe424('0x167')][_0xe424('0xf4')](db[_0xe424('0xe0')],{'as':'BlackLists','through':_0xe424('0x19b')});db[_0xe424('0xd9')][_0xe424('0x11f')](db[_0xe424('0x135')],{});db['MailTransferReport']['belongsTo'](db['MailInteraction'],{});db['MailTransferReport']['belongsTo'](db[_0xe424('0x37')],{'foreignKey':'FromMailAccountId','as':_0xe424('0x19c')});db[_0xe424('0xd9')][_0xe424('0x11f')](db[_0xe424('0x12')],{'foreignKey':'FromUserId','as':_0xe424('0x19d')});db[_0xe424('0xd9')][_0xe424('0x11f')](db[_0xe424('0x12')],{'foreignKey':_0xe424('0x19e'),'as':'ToAgent'});db[_0xe424('0xd9')][_0xe424('0x11f')](db['MailQueue'],{'foreignKey':_0xe424('0x19f'),'as':_0xe424('0x1a0')});db[_0xe424('0xd9')]['belongsTo'](db[_0xe424('0x37')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db[_0xe424('0xdb')][_0xe424('0x11f')](db[_0xe424('0x61')],{});db['ChatTransferReport']['belongsTo'](db[_0xe424('0x60')],{});db[_0xe424('0xdb')][_0xe424('0x11f')](db[_0xe424('0x5b')],{'foreignKey':_0xe424('0x1a1'),'as':_0xe424('0x19c')});db[_0xe424('0xdb')][_0xe424('0x11f')](db[_0xe424('0x12')],{'foreignKey':_0xe424('0x1a2'),'as':_0xe424('0x19d')});db[_0xe424('0xdb')][_0xe424('0x11f')](db['User'],{'foreignKey':'ToUserId','as':_0xe424('0x1a3')});db[_0xe424('0xdb')][_0xe424('0x11f')](db[_0xe424('0x65')],{'foreignKey':'ToChatQueueId','as':_0xe424('0x1a0')});db[_0xe424('0xdb')][_0xe424('0x11f')](db[_0xe424('0x5b')],{'foreignKey':_0xe424('0x1a4'),'as':_0xe424('0x1a5')});db[_0xe424('0xdd')][_0xe424('0x11f')](db[_0xe424('0x46')],{});db[_0xe424('0xdd')][_0xe424('0x11f')](db[_0xe424('0x45')],{});db['FaxTransferReport']['belongsTo'](db[_0xe424('0x42')],{'foreignKey':_0xe424('0x1a6'),'as':'FromAccount'});db['FaxTransferReport'][_0xe424('0x11f')](db[_0xe424('0x12')],{'foreignKey':_0xe424('0x1a2'),'as':_0xe424('0x19d')});db[_0xe424('0xdd')][_0xe424('0x11f')](db[_0xe424('0x12')],{'foreignKey':_0xe424('0x19e'),'as':_0xe424('0x1a3')});db[_0xe424('0xdd')][_0xe424('0x11f')](db[_0xe424('0x48')],{'foreignKey':_0xe424('0x1a7'),'as':_0xe424('0x1a0')});db[_0xe424('0xdd')][_0xe424('0x11f')](db[_0xe424('0x42')],{'foreignKey':'ToFaxAccountId','as':_0xe424('0x1a5')});db[_0xe424('0xde')]['belongsTo'](db['OpenchannelMessage'],{});db[_0xe424('0xde')]['belongsTo'](db[_0xe424('0x58')],{});db[_0xe424('0xde')][_0xe424('0x11f')](db[_0xe424('0x55')],{'foreignKey':_0xe424('0x1a8'),'as':'FromAccount'});db[_0xe424('0xde')][_0xe424('0x11f')](db[_0xe424('0x12')],{'foreignKey':_0xe424('0x1a2'),'as':'FromAgent'});db[_0xe424('0xde')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':_0xe424('0x1a3')});db['OpenchannelTransferReport'][_0xe424('0x11f')](db[_0xe424('0x108')],{'foreignKey':'ToOpenchannelQueueId','as':_0xe424('0x1a0')});db[_0xe424('0xde')]['belongsTo'](db[_0xe424('0x55')],{'foreignKey':_0xe424('0x1a9'),'as':_0xe424('0x1a5')});db[_0xe424('0xdf')]['belongsTo'](db[_0xe424('0x51')],{});db[_0xe424('0xdf')][_0xe424('0x11f')](db[_0xe424('0xef')],{});db['SmsTransferReport']['belongsTo'](db[_0xe424('0x4c')],{'foreignKey':_0xe424('0x1aa'),'as':_0xe424('0x19c')});db[_0xe424('0xdf')][_0xe424('0x11f')](db[_0xe424('0x12')],{'foreignKey':'FromUserId','as':_0xe424('0x19d')});db[_0xe424('0xdf')]['belongsTo'](db['User'],{'foreignKey':_0xe424('0x19e'),'as':_0xe424('0x1a3')});db['SmsTransferReport'][_0xe424('0x11f')](db[_0xe424('0x53')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0xe424('0xdf')]['belongsTo'](db[_0xe424('0x4c')],{'foreignKey':_0xe424('0x1ab'),'as':_0xe424('0x1a5')});db['CmList'][_0xe424('0xe7')](db['Disposition'],{'as':_0xe424('0x133'),'foreignKey':_0xe424('0x138')});db[_0xe424('0xe0')][_0xe424('0xe7')](db['CmCustomField'],{'as':_0xe424('0x1ac'),'foreignKey':_0xe424('0x138')});db[_0xe424('0xe0')]['hasMany'](db[_0xe424('0xf5')],{'as':_0xe424('0xf6'),'onDelete':_0xe424('0xe5'),'foreignKey':_0xe424('0x138')});db[_0xe424('0xe0')][_0xe424('0xe7')](db['CmHopperFinal'],{'as':_0xe424('0xea'),'foreignKey':_0xe424('0x138')});db['CmList'][_0xe424('0xe7')](db[_0xe424('0xeb')],{'as':_0xe424('0xec'),'foreignKey':'ListId'});db[_0xe424('0xe0')][_0xe424('0xe7')](db[_0xe424('0x6f')],{'as':_0xe424('0x6f'),'foreignKey':_0xe424('0x138')});db[_0xe424('0xe0')][_0xe424('0xf4')](db[_0xe424('0x1b')],{'as':_0xe424('0x1ad'),'through':_0xe424('0x124')});db[_0xe424('0xe0')]['belongsToMany'](db[_0xe424('0x12')],{'as':_0xe424('0x13b'),'through':_0xe424('0xf9')});db['VoicePrefix'][_0xe424('0xe7')](db['VoiceExtension'],{'as':'Extensions','onDelete':_0xe424('0x144')});db[_0xe424('0xe2')][_0xe424('0xf4')](db[_0xe424('0x12')],{'as':_0xe424('0x13b'),'through':'user_has_voice_prefixes'});module[_0xe424('0x1ae')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x2614=['../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','cascade','UserId','hasMany','VoiceRecording','VoiceQueuesRt','Extensions','HopperFinals','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','FaxInteractions','MailInteractions','belongsToMany','ChatGroup','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','SmsInteractions','user_has_sms_interactions','VoiceQueues','ChatQueues','UserSmsQueue','OpenchannelQueues','UserOpenchannelQueue','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','user_has_square_projects','SpiedAgents','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','VoiceQueueId','CmHopper','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','uniqueid','Contact','ContactId','MailServerIn','MailAccountId','Imap','hasOne','Smtp','Disposition','Answers','Interactions','List','ListId','Account','Owner','mail_interaction_has_tags','ThroughTags','Users','MailInteractionId','Attachments','restrict','TagId','MailQueueReport','Dashboard','DashboardItem','Items','Dispositions','FaxAccountId','FaxApplication','Exntensions','FaxQueue','FaxInteractionId','fax_interaction_has_tags','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','Tags','team_has_openchannel_queues','ChatWebsite','ChatWebsiteId','ProactiveActions','Agent','ChatQueueId','team_has_chat_queues','ChatGroupId','Website','Company','CompanyId','Queue','CampaignId','All','OneAll','AutomationAllId','Any','Action','Actions','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','cm_contact_has_tags','chat_interaction_has_tags','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticMetric','Fields','MetricId','SalesforceConfiguration','Configurations','AccountId','Subjects','SubjectId','DescriptionId','FieldId','Subject','Description','Field','Descriptions','VariableId','DeskField','int_desk_configuration_has_tags','ZendeskAccount','int_zendesk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','VtigerField','int_vtiger_configuration_has_tags','ChatInternalMessage','FromId','ToId','SessionId','ProjectId','team_has_mail_queues','MailQueues','FaxQueues','SmsQueues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAccount','ToChatQueueId','ToQueue','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','CmCustomField','HopperHistory','Queues','exports','path','determine','sequelize','defaultsDeep','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','motion2','xC@LL1234','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model'];(function(_0x5858bf,_0xae4f9f){var _0x30e412=function(_0x1188c5){while(--_0x1188c5){_0x5858bf['push'](_0x5858bf['shift']());}};_0x30e412(++_0xae4f9f);}(_0x2614,0x169));var _0x4261=function(_0x654c4f,_0x486f01){_0x654c4f=_0x654c4f-0x0;var _0x3a8ad1=_0x2614[_0x654c4f];return _0x3a8ad1;};'use strict';var path=require(_0x4261('0x0'));var config=require('../config/environment');var Sequelize=require('sequelize');var _=require('lodash');var jstz=require('jstz');var timezone=jstz[_0x4261('0x1')]();config[_0x4261('0x2')]=_[_0x4261('0x3')](config[_0x4261('0x2')],{'database':'motion2','username':'xcall','password':'xC@LL1234','options':{'host':_0x4261('0x4'),'port':0xcea,'dialect':_0x4261('0x5'),'dialectOptions':{'charset':_0x4261('0x6')},'logging':![],'timezone':timezone[_0x4261('0x7')](),'define':{'charset':'utf8','collate':_0x4261('0x8')}}});config[_0x4261('0x9')]=_[_0x4261('0x3')](config[_0x4261('0x9')],{'database':_0x4261('0xa'),'username':'xcall','password':_0x4261('0xb'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x4261('0x5'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x4261('0xc')],config[_0x4261('0x2')][_0x4261('0xd')],config[_0x4261('0x2')][_0x4261('0xe')],config[_0x4261('0x2')][_0x4261('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4261('0x9')]['database'],config[_0x4261('0x9')]['username'],config['sequelizeHistory']['password'],config[_0x4261('0x9')][_0x4261('0xf')])};db[_0x4261('0x10')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x12'));db[_0x4261('0x13')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x14'));db[_0x4261('0x15')]=db[_0x4261('0x2')]['import'](_0x4261('0x16'));db[_0x4261('0x17')]=db['sequelize'][_0x4261('0x11')](_0x4261('0x18'));db['VoiceMusicOnHold']=db['sequelize'][_0x4261('0x11')](_0x4261('0x19'));db[_0x4261('0x1a')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x1b'));db['VoiceRecording']=db['sequelize'][_0x4261('0x11')](_0x4261('0x1c'));db[_0x4261('0x1d')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x1e'));db[_0x4261('0x1f')]=db[_0x4261('0x2')]['import'](_0x4261('0x20'));db[_0x4261('0x21')]=db[_0x4261('0x2')]['import']('../api/voiceCallReport/voiceCallReport.model');db[_0x4261('0x22')]=db['sequelize'][_0x4261('0x11')](_0x4261('0x23'));db[_0x4261('0x24')]=db['sequelize'][_0x4261('0x11')](_0x4261('0x25'));db['VoiceQueueReport']=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x26'));db[_0x4261('0x27')]=db[_0x4261('0x2')]['import'](_0x4261('0x28'));db[_0x4261('0x29')]=db['sequelize']['import'](_0x4261('0x2a'));db[_0x4261('0x2b')]=db['sequelize'][_0x4261('0x11')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x4261('0x2c')]=db[_0x4261('0x2')]['import'](_0x4261('0x2d'));db[_0x4261('0x2e')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x2f'));db[_0x4261('0x30')]=db['sequelize']['import'](_0x4261('0x31'));db[_0x4261('0x32')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x33'));db[_0x4261('0x34')]=db[_0x4261('0x2')][_0x4261('0x11')]('../api/userFaxQueue/userFaxQueue.model');db['UserSmsQueue']=db['sequelize'][_0x4261('0x11')](_0x4261('0x35'));db['UserOpenchannelQueue']=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x36'));db['MailServerIn']=db[_0x4261('0x2')][_0x4261('0x11')]('../api/mailServerIn/mailServerIn.model');db[_0x4261('0x37')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x38'));db['MailAccount']=db[_0x4261('0x2')]['import']('../api/mailAccount/mailAccount.model');db[_0x4261('0x39')]=db['sequelize'][_0x4261('0x11')](_0x4261('0x3a'));db[_0x4261('0x3b')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x3c'));db[_0x4261('0x3d')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x3e'));db[_0x4261('0x3f')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x40'));db[_0x4261('0x41')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x42'));db['MailQueueReport']=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x43'));db['Dashboard']=db['sequelize'][_0x4261('0x11')]('../api/dashboard/dashboard.model');db['DashboardItem']=db['sequelize'][_0x4261('0x11')]('../api/dashboardItem/dashboardItem.model');db[_0x4261('0x44')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x45'));db['FaxApplication']=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x46'));db[_0x4261('0x47')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x48'));db[_0x4261('0x49')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x4a'));db['FaxQueue']=db[_0x4261('0x2')]['import'](_0x4261('0x4b'));db[_0x4261('0x4c')]=db['sequelize'][_0x4261('0x11')](_0x4261('0x4d'));db['SmsAccount']=db[_0x4261('0x2')][_0x4261('0x11')]('../api/smsAccount/smsAccount.model');db[_0x4261('0x4e')]=db[_0x4261('0x2')]['import'](_0x4261('0x4f'));db[_0x4261('0x50')]=db[_0x4261('0x2')]['import'](_0x4261('0x51'));db[_0x4261('0x52')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x53'));db[_0x4261('0x54')]=db[_0x4261('0x2')][_0x4261('0x11')]('../api/smsQueue/smsQueue.model');db[_0x4261('0x55')]=db[_0x4261('0x2')]['import'](_0x4261('0x56'));db['OpenchannelApplication']=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x57'));db['OpenchannelInteraction']=db['sequelize'][_0x4261('0x11')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x4261('0x58')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x59'));db[_0x4261('0x5a')]=db[_0x4261('0x2')]['import'](_0x4261('0x5b'));db['ChatWebsite']=db[_0x4261('0x2')][_0x4261('0x11')]('../api/chatWebsite/chatWebsite.model');db[_0x4261('0x5c')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x5d'));db[_0x4261('0x5e')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x5f'));db[_0x4261('0x60')]=db[_0x4261('0x2')][_0x4261('0x11')]('../api/chatInteraction/chatInteraction.model');db[_0x4261('0x61')]=db[_0x4261('0x2')][_0x4261('0x11')]('../api/chatMessage/chatMessage.model');db[_0x4261('0x62')]=db[_0x4261('0x2')][_0x4261('0x11')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x4261('0x63')]=db[_0x4261('0x2')]['import'](_0x4261('0x64'));db['ChatGroup']=db['sequelize'][_0x4261('0x11')](_0x4261('0x65'));db[_0x4261('0x66')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x67'));db[_0x4261('0x68')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x69'));db['CmContact']=db[_0x4261('0x2')]['import'](_0x4261('0x6a'));db['CmHopper']=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x6b'));db[_0x4261('0x6c')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x6d'));db[_0x4261('0x6e')]=db[_0x4261('0x2')]['import'](_0x4261('0x6f'));db[_0x4261('0x70')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x71'));db[_0x4261('0x72')]=db[_0x4261('0x2')][_0x4261('0x11')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db[_0x4261('0x2')][_0x4261('0x11')]('../api/cmCustomField/cmCustomField.model');db['Action']=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x73'));db[_0x4261('0x74')]=db['sequelize'][_0x4261('0x11')](_0x4261('0x75'));db[_0x4261('0x76')]=db['sequelize']['import'](_0x4261('0x77'));db['Disposition']=db[_0x4261('0x2')][_0x4261('0x11')]('../api/disposition/disposition.model');db[_0x4261('0x78')]=db['sequelize'][_0x4261('0x11')](_0x4261('0x79'));db[_0x4261('0x7a')]=db['sequelize'][_0x4261('0x11')](_0x4261('0x7b'));db['Pause']=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x7c'));db['Cdr']=db[_0x4261('0x2')]['import'](_0x4261('0x7d'));db['VoiceQueuesLog']=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x7e'));db[_0x4261('0x7f')]=db[_0x4261('0x2')]['import'](_0x4261('0x80'));db[_0x4261('0x81')]=db[_0x4261('0x2')]['import'](_0x4261('0x82'));db[_0x4261('0x83')]=db[_0x4261('0x2')]['import'](_0x4261('0x84'));db[_0x4261('0x85')]=db[_0x4261('0x2')][_0x4261('0x11')]('../api/template/template.model');db[_0x4261('0x86')]=db['sequelize'][_0x4261('0x11')](_0x4261('0x87'));db[_0x4261('0x88')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x89'));db[_0x4261('0x8a')]=db[_0x4261('0x2')]['import'](_0x4261('0x8b'));db[_0x4261('0x8c')]=db[_0x4261('0x2')]['import'](_0x4261('0x8d'));db[_0x4261('0x8e')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x8f'));db[_0x4261('0x90')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x91'));db['AnalyticExtractedReport']=db['sequelize'][_0x4261('0x11')](_0x4261('0x92'));db['AnalyticMetric']=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x93'));db[_0x4261('0x94')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x95'));db[_0x4261('0x96')]=db[_0x4261('0x2')][_0x4261('0x11')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x4261('0x97')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0x98'));db['SalesforceConfiguration']=db['sequelize']['import'](_0x4261('0x99'));db[_0x4261('0x9a')]=db['sequelize'][_0x4261('0x11')](_0x4261('0x9b'));db[_0x4261('0x9c')]=db['sequelize'][_0x4261('0x11')](_0x4261('0x9d'));db[_0x4261('0x9e')]=db[_0x4261('0x2')]['import'](_0x4261('0x9f'));db[_0x4261('0xa0')]=db['sequelize'][_0x4261('0x11')](_0x4261('0xa1'));db[_0x4261('0xa2')]=db['sequelize']['import'](_0x4261('0xa3'));db[_0x4261('0xa4')]=db[_0x4261('0x2')]['import'](_0x4261('0xa5'));db['DeskField']=db[_0x4261('0x2')]['import'](_0x4261('0xa6'));db[_0x4261('0xa7')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0xa8'));db[_0x4261('0xa9')]=db['sequelize'][_0x4261('0x11')](_0x4261('0xaa'));db[_0x4261('0xab')]=db[_0x4261('0x2')]['import'](_0x4261('0xac'));db['ZendeskAccount']=db[_0x4261('0x2')][_0x4261('0x11')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x4261('0xad')]=db['sequelize']['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x4261('0xae')]=db['sequelize'][_0x4261('0x11')](_0x4261('0xaf'));db['FreshdeskAccount']=db[_0x4261('0x2')]['import'](_0x4261('0xb0'));db[_0x4261('0xb1')]=db[_0x4261('0x2')][_0x4261('0x11')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x4261('0xb2')]=db[_0x4261('0x2')]['import'](_0x4261('0xb3'));db[_0x4261('0xb4')]=db[_0x4261('0x2')]['import'](_0x4261('0xb5'));db[_0x4261('0xb6')]=db[_0x4261('0x2')][_0x4261('0x11')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0x4261('0x2')][_0x4261('0x11')]('../api/intVtigerField/intVtigerField.model');db['Integration']=db['sequelize'][_0x4261('0x11')](_0x4261('0x8b'));db[_0x4261('0xb7')]=db[_0x4261('0x2')][_0x4261('0x11')]('../api/network/network.model');db[_0x4261('0xb8')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0xb9'));db['ChatInternalMessage']=db[_0x4261('0x2')][_0x4261('0x11')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x4261('0xba')]=db[_0x4261('0x2')][_0x4261('0x11')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x4261('0xbb')]=db[_0x4261('0x2')]['import'](_0x4261('0xbc'));db[_0x4261('0xbd')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0xbe'));db[_0x4261('0xbf')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0xc0'));db['SquareReport']=db['sequelize'][_0x4261('0x11')](_0x4261('0xc1'));db[_0x4261('0xc2')]=db[_0x4261('0x2')]['import'](_0x4261('0xc3'));db[_0x4261('0xc4')]=db[_0x4261('0x2')]['import']('../api/jscriptyProject/jscriptyProject.model');db[_0x4261('0xc5')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0xc6'));db[_0x4261('0xc7')]=db['sequelize'][_0x4261('0x11')]('../api/squareOdbc/squareOdbc.model');db[_0x4261('0xc8')]=db[_0x4261('0x2')]['import'](_0x4261('0xc9'));db[_0x4261('0xca')]=db[_0x4261('0x2')][_0x4261('0x11')]('../api/squareRecording/squareRecording.model');db['Team']=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0xcb'));db[_0x4261('0xcc')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0xcd'));db[_0x4261('0xce')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0xcf'));db['Migration']=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0xd0'));db[_0x4261('0xd1')]=db[_0x4261('0x2')]['import'](_0x4261('0xd2'));db['Plugin']=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0xd3'));db[_0x4261('0xd4')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0xd5'));db[_0x4261('0xd6')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0xd7'));db[_0x4261('0xd8')]=db['sequelize'][_0x4261('0x11')](_0x4261('0xd9'));db[_0x4261('0xda')]=db[_0x4261('0x2')]['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x4261('0xdb')]=db[_0x4261('0x2')][_0x4261('0x11')]('../api/smsTransferReport/smsTransferReport.model');db[_0x4261('0xdc')]=db[_0x4261('0x2')][_0x4261('0x11')](_0x4261('0xdd'));db[_0x4261('0xde')]=db[_0x4261('0x2')][_0x4261('0x11')]('../api/voicePrefix/voicePrefix.model');db[_0x4261('0x10')]['hasOne'](db['VoiceMail'],{'as':_0x4261('0x1d'),'onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0xe0')});db[_0x4261('0x10')][_0x4261('0xe1')](db[_0x4261('0xe2')],{'as':'Recordings','foreignKey':_0x4261('0xe0')});db[_0x4261('0x10')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0x4261('0xe3'),'foreignKey':_0x4261('0xe0')});db[_0x4261('0x10')][_0x4261('0xe1')](db[_0x4261('0x17')],{'as':_0x4261('0xe4'),'onDelete':_0x4261('0xdf'),'hooks':!![]});db[_0x4261('0x10')][_0x4261('0xe1')](db[_0x4261('0x6e')],{'as':_0x4261('0xe5'),'foreignKey':_0x4261('0xe0')});db[_0x4261('0x10')][_0x4261('0xe1')](db[_0x4261('0x70')],{'as':'HopperHistory','foreignKey':'UserId'});db[_0x4261('0x10')]['hasMany'](db['ReportAgentPreview'],{'as':_0x4261('0x72'),'foreignKey':'UserId'});db[_0x4261('0x10')][_0x4261('0xe1')](db[_0x4261('0xe6')],{'as':_0x4261('0xe7'),'foreignKey':'UserId'});db[_0x4261('0x10')]['hasMany'](db[_0x4261('0x60')],{'as':_0x4261('0xe8'),'foreignKey':'UserId'});db[_0x4261('0x10')][_0x4261('0xe1')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x4261('0xe0')});db[_0x4261('0x10')][_0x4261('0xe1')](db[_0x4261('0x47')],{'as':_0x4261('0xe9'),'foreignKey':_0x4261('0xe0')});db['User'][_0x4261('0xe1')](db['MailInteraction'],{'as':_0x4261('0xea'),'foreignKey':_0x4261('0xe0')});db[_0x4261('0x10')][_0x4261('0xeb')](db[_0x4261('0xec')],{'as':_0x4261('0xed'),'through':_0x4261('0xee')});db[_0x4261('0x10')][_0x4261('0xeb')](db[_0x4261('0xef')],{'as':_0x4261('0xf0'),'through':_0x4261('0xf1')});db[_0x4261('0x10')][_0x4261('0xeb')](db['CmList'],{'as':_0x4261('0xf2'),'through':_0x4261('0xf3')});db['User'][_0x4261('0xeb')](db[_0x4261('0xf4')],{'through':_0x4261('0xf5')});db[_0x4261('0x10')]['belongsToMany'](db[_0x4261('0x3d')],{'as':'MailInteractions','through':_0x4261('0xf6')});db['User'][_0x4261('0xeb')](db[_0x4261('0x60')],{'as':_0x4261('0xe8'),'through':_0x4261('0xf7')});db[_0x4261('0x10')]['belongsToMany'](db[_0x4261('0x47')],{'as':_0x4261('0xe9'),'through':'user_has_fax_interactions'});db[_0x4261('0x10')][_0x4261('0xeb')](db[_0x4261('0x50')],{'as':_0x4261('0xf8'),'through':_0x4261('0xf9')});db[_0x4261('0x10')][_0x4261('0xeb')](db[_0x4261('0xe6')],{'as':_0x4261('0xe7'),'through':'user_has_openchannel_interactions'});db['User'][_0x4261('0xeb')](db[_0x4261('0x1a')],{'as':_0x4261('0xfa'),'through':_0x4261('0x2e'),'required':![]});db[_0x4261('0x10')][_0x4261('0xeb')](db[_0x4261('0x39')],{'as':'MailQueues','through':'UserMailQueue','required':![]});db[_0x4261('0x10')]['belongsToMany'](db[_0x4261('0x63')],{'as':_0x4261('0xfb'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0x4261('0xeb')](db['FaxQueue'],{'as':'FaxQueues','through':_0x4261('0x34'),'required':![]});db['User'][_0x4261('0xeb')](db[_0x4261('0x54')],{'as':'SmsQueues','through':_0x4261('0xfc'),'required':![]});db[_0x4261('0x10')][_0x4261('0xeb')](db[_0x4261('0x5a')],{'as':_0x4261('0xfd'),'through':_0x4261('0xfe'),'required':![]});db[_0x4261('0x10')][_0x4261('0xeb')](db[_0x4261('0xdc')],{'through':_0x4261('0xf3')});db[_0x4261('0x10')][_0x4261('0xeb')](db[_0x4261('0xde')],{'as':_0x4261('0xff'),'through':_0x4261('0x100'),'required':![]});db[_0x4261('0x10')]['belongsToMany'](db['ChatWebsite'],{'as':_0x4261('0x101'),'through':_0x4261('0x102')});db[_0x4261('0x10')][_0x4261('0xeb')](db['FaxAccount'],{'as':_0x4261('0x103'),'through':_0x4261('0x104')});db['User'][_0x4261('0xeb')](db[_0x4261('0x105')],{'as':_0x4261('0x106'),'through':_0x4261('0x107')});db[_0x4261('0x10')][_0x4261('0xeb')](db['OpenchannelAccount'],{'as':_0x4261('0x108'),'through':_0x4261('0x109')});db[_0x4261('0x10')][_0x4261('0xeb')](db[_0x4261('0x10a')],{'as':_0x4261('0x10b'),'through':_0x4261('0x10c')});db[_0x4261('0x10')][_0x4261('0xeb')](db['SquareProject'],{'as':'SquareProjects','through':_0x4261('0x10d')});db[_0x4261('0x13')][_0x4261('0xe1')](db[_0x4261('0x17')],{'as':_0x4261('0x10e'),'onDelete':_0x4261('0xdf'),'foreignKey':'ChanSpyId'});db[_0x4261('0x15')]['hasMany'](db[_0x4261('0x17')],{'onDelete':'cascade'});db['VoiceExtension']['hasMany'](db['VoiceExtension'],{'as':_0x4261('0x10f'),'onDelete':'cascade'});db[_0x4261('0x110')][_0x4261('0xeb')](db[_0x4261('0x81')],{'as':_0x4261('0x111'),'through':_0x4261('0x112')});db[_0x4261('0x1a')]['hasMany'](db[_0x4261('0x2c')],{'as':_0x4261('0x113'),'foreignKey':_0x4261('0x114')});db[_0x4261('0x1a')][_0x4261('0xe1')](db[_0x4261('0x115')],{'as':'Hoppers','foreignKey':_0x4261('0x114')});db[_0x4261('0x1a')]['hasMany'](db[_0x4261('0x6e')],{'as':_0x4261('0xe5'),'foreignKey':_0x4261('0x114')});db['VoiceQueue'][_0x4261('0xe1')](db[_0x4261('0x70')],{'as':_0x4261('0x116'),'foreignKey':_0x4261('0x114')});db[_0x4261('0x1a')][_0x4261('0xe1')](db[_0x4261('0x72')],{'as':_0x4261('0x72'),'foreignKey':_0x4261('0x114')});db[_0x4261('0x1a')][_0x4261('0xe1')](db['CmHopperBlack'],{'as':_0x4261('0x117'),'foreignKey':_0x4261('0x114')});db['VoiceQueue']['hasMany'](db[_0x4261('0xbd')],{'as':_0x4261('0x118'),'foreignKey':_0x4261('0x114')});db[_0x4261('0x1a')][_0x4261('0x119')](db['Trunk'],{'as':_0x4261('0x29'),'foreignKey':_0x4261('0x11a')});db[_0x4261('0x1a')]['belongsTo'](db[_0x4261('0x29')],{'as':_0x4261('0x11b'),'foreignKey':_0x4261('0x11c')});db[_0x4261('0x1a')][_0x4261('0x119')](db[_0x4261('0x7a')],{'as':_0x4261('0x7a'),'foreignKey':_0x4261('0x11d')});db[_0x4261('0x1a')][_0x4261('0xeb')](db[_0x4261('0xdc')],{'as':_0x4261('0xf2'),'through':_0x4261('0x11e')});db[_0x4261('0x1a')][_0x4261('0xeb')](db[_0x4261('0x10')],{'as':_0x4261('0x11f'),'through':_0x4261('0x2e')});db['VoiceQueue'][_0x4261('0xeb')](db[_0x4261('0xf4')],{'as':_0x4261('0x120'),'through':_0x4261('0x121')});db[_0x4261('0x1a')][_0x4261('0xeb')](db['CmList'],{'as':_0x4261('0x122'),'through':_0x4261('0x123')});db['VoiceRecording'][_0x4261('0x119')](db[_0x4261('0x10')],{'as':_0x4261('0x10'),'foreignKey':_0x4261('0xe0')});db[_0x4261('0x1d')][_0x4261('0xe1')](db[_0x4261('0x1f')],{'as':_0x4261('0x124'),'onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x125'),'sourceKey':_0x4261('0x126')});db['VoiceMailMessage'][_0x4261('0x119')](db[_0x4261('0x1d')],{'foreignKey':_0x4261('0x125'),'targetKey':_0x4261('0x126')});db[_0x4261('0x21')][_0x4261('0xe1')](db[_0x4261('0x127')],{'as':'QueueCalls','foreignKey':_0x4261('0x128'),'constraints':![]});db[_0x4261('0x21')]['hasMany'](db[_0x4261('0x24')],{'as':'AgentReports','foreignKey':_0x4261('0x128'),'constraints':![]});db['VoiceCallReport'][_0x4261('0x119')](db['User'],{'as':'User','foreignKey':_0x4261('0xe0')});db[_0x4261('0x21')]['belongsTo'](db[_0x4261('0xef')],{'as':_0x4261('0x129'),'foreignKey':_0x4261('0x12a')});db[_0x4261('0x12b')][_0x4261('0x119')](db[_0x4261('0x105')],{'as':'MailAccount','foreignKey':_0x4261('0x12c')});db[_0x4261('0x37')][_0x4261('0x119')](db['MailAccount'],{'as':_0x4261('0x105'),'foreignKey':_0x4261('0x12c')});db[_0x4261('0x105')]['hasOne'](db['MailServerIn'],{'as':_0x4261('0x12d'),'onDelete':_0x4261('0xdf')});db[_0x4261('0x105')][_0x4261('0x12e')](db[_0x4261('0x37')],{'as':_0x4261('0x12f'),'onDelete':_0x4261('0xdf')});db[_0x4261('0x105')][_0x4261('0xe1')](db[_0x4261('0x130')],{'as':'Dispositions','foreignKey':'MailAccountId'});db[_0x4261('0x105')][_0x4261('0xe1')](db[_0x4261('0x76')],{'as':_0x4261('0x131'),'foreignKey':_0x4261('0x12c')});db[_0x4261('0x105')][_0x4261('0xe1')](db[_0x4261('0x3f')],{'as':_0x4261('0x124'),'foreignKey':_0x4261('0x12c')});db['MailAccount']['hasMany'](db[_0x4261('0x3d')],{'as':_0x4261('0x132')});db['MailAccount'][_0x4261('0xe1')](db[_0x4261('0x41')],{'as':_0x4261('0x10f')});db['MailAccount'][_0x4261('0x119')](db[_0x4261('0xdc')],{'as':_0x4261('0x133'),'foreignKey':_0x4261('0x134')});db['MailAccount'][_0x4261('0x119')](db[_0x4261('0x85')],{'as':_0x4261('0x85'),'foreignKey':'TemplateId'});db[_0x4261('0x105')][_0x4261('0xeb')](db[_0x4261('0x10')],{'as':_0x4261('0x11f'),'through':'user_has_mail_accounts'});db[_0x4261('0x39')]['belongsToMany'](db[_0x4261('0x10')],{'as':'Agents','through':'UserMailQueue'});db['MailQueue'][_0x4261('0xeb')](db[_0x4261('0xf4')],{'through':'team_has_mail_queues','as':_0x4261('0x120')});db['MailInteraction']['hasMany'](db['MailMessage'],{'as':_0x4261('0x124'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db['MailInteraction']['belongsTo'](db[_0x4261('0x105')],{'as':_0x4261('0x135'),'foreignKey':'MailAccountId'});db['MailInteraction']['belongsTo'](db[_0x4261('0xef')],{'as':_0x4261('0x129'),'foreignKey':'ContactId'});db[_0x4261('0x3d')]['belongsTo'](db[_0x4261('0x10')],{'as':_0x4261('0x136'),'foreignKey':_0x4261('0xe0')});db[_0x4261('0x3d')]['belongsToMany'](db[_0x4261('0x83')],{'through':_0x4261('0x137'),'as':'Tags'});db[_0x4261('0x3d')][_0x4261('0xeb')](db[_0x4261('0x83')],{'through':_0x4261('0x137'),'as':_0x4261('0x138')});db[_0x4261('0x3d')][_0x4261('0xeb')](db[_0x4261('0x10')],{'as':_0x4261('0x139'),'through':_0x4261('0xf6'),'foreignKey':_0x4261('0x13a')});db[_0x4261('0x3f')][_0x4261('0xe1')](db[_0x4261('0xd1')],{'as':_0x4261('0x13b'),'onDelete':_0x4261('0xdf')});db['MailMessage']['belongsTo'](db[_0x4261('0x10')],{'as':_0x4261('0x10')});db[_0x4261('0x3f')][_0x4261('0x119')](db[_0x4261('0xef')],{'onDelete':_0x4261('0xdf'),'as':_0x4261('0x129')});db[_0x4261('0x3f')][_0x4261('0x119')](db['MailInteraction'],{'as':'Interaction','foreignKey':_0x4261('0x13a')});db[_0x4261('0x3f')][_0x4261('0x119')](db[_0x4261('0x105')],{'as':_0x4261('0x135'),'foreignKey':_0x4261('0x12c')});db['MailApplication'][_0x4261('0x119')](db[_0x4261('0x10')],{'onDelete':'restrict'});db[_0x4261('0x41')][_0x4261('0x119')](db[_0x4261('0x39')],{'onDelete':_0x4261('0x13c')});db[_0x4261('0x41')][_0x4261('0x119')](db[_0x4261('0x105')],{'onDelete':_0x4261('0x13c')});db[_0x4261('0x41')][_0x4261('0x119')](db[_0x4261('0x7a')],{'onDelete':_0x4261('0x13c'),'foreignKey':_0x4261('0x11d')});db[_0x4261('0x41')][_0x4261('0x119')](db[_0x4261('0x83')],{'onDelete':_0x4261('0x13c'),'foreignKey':_0x4261('0x13d')});db[_0x4261('0x13e')][_0x4261('0x119')](db[_0x4261('0x105')],{});db[_0x4261('0x13e')][_0x4261('0x119')](db[_0x4261('0xdc')],{'as':'List','foreignKey':'ListId'});db[_0x4261('0x13e')][_0x4261('0x119')](db[_0x4261('0xef')],{'as':_0x4261('0x129'),'foreignKey':_0x4261('0x12a')});db[_0x4261('0x13e')]['belongsTo'](db[_0x4261('0x3d')],{});db[_0x4261('0x13e')]['belongsTo'](db[_0x4261('0x3f')],{});db[_0x4261('0x13e')][_0x4261('0x119')](db[_0x4261('0x10')],{});db[_0x4261('0x13e')]['belongsTo'](db[_0x4261('0x39')],{});db[_0x4261('0x13f')][_0x4261('0xe1')](db[_0x4261('0x140')],{'as':_0x4261('0x141'),'onDelete':'cascade'});db[_0x4261('0x44')][_0x4261('0xe1')](db[_0x4261('0x130')],{'as':_0x4261('0x142'),'foreignKey':_0x4261('0x143')});db[_0x4261('0x44')][_0x4261('0xe1')](db[_0x4261('0x76')],{'as':_0x4261('0x131'),'foreignKey':'FaxAccountId'});db['FaxAccount'][_0x4261('0xe1')](db[_0x4261('0x47')],{'as':'Interactions'});db[_0x4261('0x44')][_0x4261('0xe1')](db[_0x4261('0x144')],{'as':_0x4261('0x10f')});db[_0x4261('0x44')][_0x4261('0xe1')](db[_0x4261('0x17')],{'as':_0x4261('0x145'),'onDelete':_0x4261('0xdf')});db[_0x4261('0x44')]['hasMany'](db[_0x4261('0x49')],{'as':_0x4261('0x124')});db[_0x4261('0x44')][_0x4261('0x119')](db['Trunk'],{'as':_0x4261('0x29')});db['FaxAccount']['belongsTo'](db[_0x4261('0xdc')],{'as':_0x4261('0x133'),'foreignKey':_0x4261('0x134')});db[_0x4261('0x44')][_0x4261('0xeb')](db[_0x4261('0x10')],{'as':'Agents','through':_0x4261('0x104')});db[_0x4261('0x144')][_0x4261('0x119')](db[_0x4261('0x10')],{'onDelete':'restrict'});db['FaxApplication']['belongsTo'](db[_0x4261('0x146')],{'onDelete':'restrict'});db[_0x4261('0x144')][_0x4261('0x119')](db[_0x4261('0x44')],{'onDelete':_0x4261('0x13c')});db[_0x4261('0x144')][_0x4261('0x119')](db[_0x4261('0x83')],{'onDelete':_0x4261('0x13c'),'foreignKey':_0x4261('0x13d')});db[_0x4261('0x47')][_0x4261('0xe1')](db['FaxMessage'],{'as':_0x4261('0x124'),'onDelete':'cascade','foreignKey':_0x4261('0x147')});db['FaxInteraction'][_0x4261('0x119')](db[_0x4261('0x44')],{'as':_0x4261('0x135'),'foreignKey':_0x4261('0x143')});db[_0x4261('0x47')][_0x4261('0x119')](db['CmContact'],{'as':_0x4261('0x129'),'foreignKey':'ContactId'});db[_0x4261('0x47')]['belongsTo'](db['User'],{'as':_0x4261('0x136'),'foreignKey':'UserId'});db['FaxInteraction'][_0x4261('0xeb')](db[_0x4261('0x83')],{'through':_0x4261('0x148'),'as':'Tags'});db[_0x4261('0x47')][_0x4261('0xeb')](db[_0x4261('0x83')],{'through':'fax_interaction_has_tags','as':_0x4261('0x138')});db[_0x4261('0x47')][_0x4261('0xeb')](db[_0x4261('0x10')],{'as':_0x4261('0x139'),'through':'user_has_fax_interactions','foreignKey':'FaxInteractionId'});db[_0x4261('0x49')][_0x4261('0x119')](db[_0x4261('0x10')],{'onDelete':_0x4261('0xdf'),'as':_0x4261('0x10')});db[_0x4261('0x49')]['belongsTo'](db[_0x4261('0x47')],{'as':_0x4261('0x149'),'foreignKey':_0x4261('0x147')});db[_0x4261('0x49')][_0x4261('0x119')](db[_0x4261('0xef')],{'onDelete':_0x4261('0xdf'),'as':_0x4261('0x129')});db[_0x4261('0x49')][_0x4261('0x119')](db[_0x4261('0xd1')],{'as':_0x4261('0xd1'),'foreignKey':_0x4261('0x14a')});db['FaxMessage'][_0x4261('0x119')](db[_0x4261('0x44')],{'as':_0x4261('0x135'),'foreignKey':_0x4261('0x143')});db['FaxQueue']['belongsToMany'](db[_0x4261('0x10')],{'as':_0x4261('0x11f'),'through':_0x4261('0x34')});db[_0x4261('0x146')][_0x4261('0xeb')](db['Team'],{'through':_0x4261('0x14b'),'as':_0x4261('0x120')});db[_0x4261('0x4c')][_0x4261('0x119')](db[_0x4261('0x44')],{});db[_0x4261('0x4c')][_0x4261('0x119')](db[_0x4261('0xdc')],{'as':_0x4261('0x133'),'foreignKey':_0x4261('0x134')});db[_0x4261('0x4c')][_0x4261('0x119')](db[_0x4261('0xef')],{'as':'Contact','foreignKey':_0x4261('0x12a')});db['FaxQueueReport'][_0x4261('0x119')](db[_0x4261('0x47')],{});db['FaxQueueReport'][_0x4261('0x119')](db['FaxMessage'],{});db[_0x4261('0x4c')][_0x4261('0x119')](db[_0x4261('0x10')],{});db[_0x4261('0x4c')][_0x4261('0x119')](db['FaxQueue'],{});db[_0x4261('0x10a')][_0x4261('0xe1')](db['Disposition'],{'as':_0x4261('0x142'),'foreignKey':'SmsAccountId'});db[_0x4261('0x10a')][_0x4261('0xe1')](db[_0x4261('0x76')],{'as':_0x4261('0x131'),'foreignKey':_0x4261('0x14c')});db[_0x4261('0x10a')][_0x4261('0xe1')](db[_0x4261('0x52')],{'as':_0x4261('0x124'),'foreignKey':'SmsAccountId'});db[_0x4261('0x10a')][_0x4261('0xe1')](db[_0x4261('0x50')],{'as':_0x4261('0x132')});db['SmsAccount'][_0x4261('0xe1')](db[_0x4261('0x4e')],{'as':_0x4261('0x10f')});db[_0x4261('0x10a')][_0x4261('0x119')](db['CmList'],{'as':_0x4261('0x133'),'foreignKey':_0x4261('0x134')});db[_0x4261('0x10a')][_0x4261('0xeb')](db['User'],{'as':'Agents','through':'user_has_sms_accounts'});db[_0x4261('0x4e')][_0x4261('0x119')](db['User'],{'onDelete':_0x4261('0x13c')});db['SmsApplication'][_0x4261('0x119')](db[_0x4261('0x54')],{'onDelete':_0x4261('0x13c')});db[_0x4261('0x4e')][_0x4261('0x119')](db['SmsAccount'],{'onDelete':_0x4261('0x13c')});db['SmsApplication']['belongsTo'](db[_0x4261('0x7a')],{'onDelete':'restrict','foreignKey':_0x4261('0x11d')});db[_0x4261('0x4e')]['belongsTo'](db[_0x4261('0x83')],{'onDelete':_0x4261('0x13c'),'foreignKey':_0x4261('0x13d')});db['SmsInteraction']['hasMany'](db[_0x4261('0x52')],{'as':_0x4261('0x124'),'onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x14d')});db[_0x4261('0x50')][_0x4261('0x119')](db[_0x4261('0x10a')],{'as':_0x4261('0x135'),'foreignKey':'SmsAccountId'});db['SmsInteraction'][_0x4261('0x119')](db[_0x4261('0xef')],{'as':_0x4261('0x129'),'foreignKey':_0x4261('0x12a')});db[_0x4261('0x50')][_0x4261('0x119')](db[_0x4261('0x10')],{'as':'Owner','foreignKey':_0x4261('0xe0')});db['SmsInteraction'][_0x4261('0xeb')](db['Tag'],{'through':_0x4261('0x14e'),'as':'Tags'});db[_0x4261('0x50')]['belongsToMany'](db[_0x4261('0x83')],{'through':_0x4261('0x14e'),'as':_0x4261('0x138')});db[_0x4261('0x50')][_0x4261('0xeb')](db['User'],{'as':_0x4261('0x139'),'through':'user_has_sms_interactions','foreignKey':_0x4261('0x14d')});db[_0x4261('0x52')]['belongsTo'](db[_0x4261('0x10')],{'as':_0x4261('0x10')});db[_0x4261('0x52')][_0x4261('0x119')](db[_0x4261('0xef')],{'onDelete':_0x4261('0xdf'),'as':_0x4261('0x129')});db[_0x4261('0x52')]['belongsTo'](db[_0x4261('0x50')],{'onDelete':_0x4261('0xdf'),'as':_0x4261('0x149'),'foreignKey':'SmsInteractionId'});db[_0x4261('0x52')][_0x4261('0x119')](db['SmsAccount'],{'as':_0x4261('0x135'),'foreignKey':_0x4261('0x14c')});db['SmsQueue'][_0x4261('0xeb')](db[_0x4261('0x10')],{'as':'Agents','through':_0x4261('0xfc'),'foreignKey':'SmsQueueId'});db[_0x4261('0x54')]['belongsToMany'](db[_0x4261('0xf4')],{'through':_0x4261('0x14f'),'as':_0x4261('0x120')});db[_0x4261('0x55')][_0x4261('0xe1')](db[_0x4261('0x130')],{'as':_0x4261('0x142'),'foreignKey':_0x4261('0x150')});db[_0x4261('0x55')]['hasMany'](db[_0x4261('0x76')],{'as':_0x4261('0x131'),'foreignKey':_0x4261('0x150')});db['OpenchannelAccount']['hasMany'](db['OpenchannelInteraction'],{'as':_0x4261('0x132'),'foreignKey':_0x4261('0x150')});db[_0x4261('0x55')][_0x4261('0xe1')](db[_0x4261('0x58')],{'as':_0x4261('0x124'),'foreignKey':_0x4261('0x150')});db[_0x4261('0x55')][_0x4261('0xe1')](db['OpenchannelApplication'],{'as':_0x4261('0x10f'),'foreignKey':_0x4261('0x150')});db[_0x4261('0x55')][_0x4261('0x119')](db[_0x4261('0xdc')],{'as':_0x4261('0x133'),'foreignKey':_0x4261('0x134')});db[_0x4261('0x55')][_0x4261('0xeb')](db['User'],{'as':_0x4261('0x11f'),'through':_0x4261('0x109')});db['OpenchannelApplication']['belongsTo'](db[_0x4261('0x10')],{'onDelete':_0x4261('0x13c')});db[_0x4261('0x151')][_0x4261('0x119')](db[_0x4261('0x5a')],{'onDelete':'restrict','foreignKey':_0x4261('0x152')});db[_0x4261('0x151')][_0x4261('0x119')](db[_0x4261('0x55')],{'onDelete':_0x4261('0x13c'),'foreignKey':_0x4261('0x150')});db[_0x4261('0x151')][_0x4261('0x119')](db[_0x4261('0x7a')],{'onDelete':_0x4261('0x13c'),'foreignKey':_0x4261('0x11d')});db[_0x4261('0x151')]['belongsTo'](db[_0x4261('0x83')],{'onDelete':'restrict','foreignKey':_0x4261('0x13d')});db[_0x4261('0xe6')][_0x4261('0xe1')](db['OpenchannelMessage'],{'as':_0x4261('0x124'),'onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x153')});db[_0x4261('0xe6')][_0x4261('0x119')](db['OpenchannelAccount'],{'as':_0x4261('0x135'),'foreignKey':'OpenchannelAccountId'});db[_0x4261('0xe6')][_0x4261('0x119')](db[_0x4261('0xef')],{'as':_0x4261('0x129'),'foreignKey':_0x4261('0x12a')});db[_0x4261('0xe6')]['belongsTo'](db[_0x4261('0x10')],{'as':'Owner','foreignKey':_0x4261('0xe0')});db[_0x4261('0xe6')][_0x4261('0xeb')](db[_0x4261('0x83')],{'through':_0x4261('0x154'),'as':_0x4261('0x155')});db[_0x4261('0xe6')][_0x4261('0xeb')](db[_0x4261('0x83')],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db[_0x4261('0xe6')][_0x4261('0xeb')](db['User'],{'as':_0x4261('0x139'),'through':'user_has_openchannel_interactions','foreignKey':_0x4261('0x153')});db[_0x4261('0x58')][_0x4261('0x119')](db['User'],{'onDelete':_0x4261('0xdf'),'as':_0x4261('0x10')});db[_0x4261('0x58')]['belongsTo'](db[_0x4261('0xef')],{'onDelete':_0x4261('0xdf'),'as':'Contact'});db['OpenchannelMessage'][_0x4261('0x119')](db[_0x4261('0xe6')],{'onDelete':_0x4261('0xdf'),'as':_0x4261('0x149'),'foreignKey':_0x4261('0x153')});db[_0x4261('0x58')]['belongsTo'](db[_0x4261('0xd1')],{'as':'Attachment','foreignKey':_0x4261('0x14a')});db[_0x4261('0x58')][_0x4261('0x119')](db[_0x4261('0x55')],{'as':_0x4261('0x135'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue'][_0x4261('0xeb')](db[_0x4261('0x10')],{'as':_0x4261('0x11f'),'through':_0x4261('0xfe'),'foreignKey':_0x4261('0x152')});db['OpenchannelQueue'][_0x4261('0xeb')](db[_0x4261('0xf4')],{'through':_0x4261('0x156'),'as':_0x4261('0x120')});db[_0x4261('0x157')][_0x4261('0xe1')](db[_0x4261('0x130')],{'as':_0x4261('0x142'),'foreignKey':_0x4261('0x158')});db[_0x4261('0x157')][_0x4261('0xe1')](db[_0x4261('0x76')],{'as':'Answers','foreignKey':_0x4261('0x158')});db[_0x4261('0x157')][_0x4261('0xe1')](db[_0x4261('0x66')],{'as':_0x4261('0x159')});db['ChatWebsite']['hasMany'](db['ChatInteraction'],{'as':_0x4261('0x132')});db[_0x4261('0x157')][_0x4261('0xe1')](db[_0x4261('0x5e')],{'as':_0x4261('0x10f')});db['ChatWebsite']['hasMany'](db[_0x4261('0x61')],{'as':_0x4261('0x124')});db[_0x4261('0x157')][_0x4261('0x119')](db[_0x4261('0xdc')],{'as':_0x4261('0x133'),'foreignKey':_0x4261('0x134')});db[_0x4261('0x157')][_0x4261('0x119')](db[_0x4261('0x7a')],{'as':_0x4261('0x7a'),'foreignKey':'IntervalId'});db[_0x4261('0x157')][_0x4261('0xeb')](db[_0x4261('0x10')],{'as':_0x4261('0x11f'),'through':'user_has_chat_websites'});db[_0x4261('0x5c')]['belongsTo'](db[_0x4261('0x55')],{});db[_0x4261('0x5c')][_0x4261('0x119')](db['CmList'],{'as':_0x4261('0x133'),'foreignKey':_0x4261('0x134')});db['OpenchannelQueueReport'][_0x4261('0x119')](db[_0x4261('0xef')],{'as':_0x4261('0x129'),'foreignKey':'ContactId'});db[_0x4261('0x5c')][_0x4261('0x119')](db['OpenchannelInteraction'],{});db[_0x4261('0x5c')][_0x4261('0x119')](db[_0x4261('0x58')],{});db['OpenchannelQueueReport'][_0x4261('0x119')](db['User'],{});db[_0x4261('0x5c')]['belongsTo'](db[_0x4261('0x5a')],{});db['ChatApplication']['belongsTo'](db[_0x4261('0x10')],{'as':_0x4261('0x15a'),'foreignKey':_0x4261('0xe0'),'onDelete':_0x4261('0x13c')});db['ChatApplication'][_0x4261('0x119')](db[_0x4261('0x63')],{'as':'Queue','foreignKey':_0x4261('0x15b'),'onDelete':'restrict'});db[_0x4261('0x5e')][_0x4261('0x119')](db[_0x4261('0x157')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':'restrict'});db[_0x4261('0x5e')][_0x4261('0x119')](db[_0x4261('0x83')],{'onDelete':_0x4261('0x13c'),'foreignKey':_0x4261('0x13d')});db['ChatInteraction']['hasMany'](db[_0x4261('0x61')],{'as':'Messages','onDelete':_0x4261('0xdf'),'foreignKey':'ChatInteractionId'});db['ChatInteraction']['belongsTo'](db[_0x4261('0x157')],{'as':_0x4261('0x135'),'foreignKey':'ChatWebsiteId'});db[_0x4261('0x60')][_0x4261('0x119')](db[_0x4261('0xef')],{'as':_0x4261('0x129'),'foreignKey':_0x4261('0x12a')});db['ChatInteraction'][_0x4261('0x119')](db[_0x4261('0x10')],{'as':_0x4261('0x136'),'foreignKey':_0x4261('0xe0')});db['ChatInteraction'][_0x4261('0xeb')](db['Tag'],{'through':'chat_interaction_has_tags','as':'Tags'});db[_0x4261('0x60')][_0x4261('0xeb')](db[_0x4261('0x83')],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db[_0x4261('0x60')][_0x4261('0xeb')](db[_0x4261('0x10')],{'as':'Users','through':_0x4261('0xf7'),'foreignKey':'ChatInteractionId'});db[_0x4261('0x61')]['belongsTo'](db[_0x4261('0x10')],{'onDelete':_0x4261('0xdf'),'as':'User'});db[_0x4261('0x61')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0x4261('0x129'),'foreignKey':_0x4261('0x12a')});db['ChatMessage'][_0x4261('0x119')](db['ChatInteraction'],{'onDelete':_0x4261('0xdf'),'as':_0x4261('0x149'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0x4261('0x119')](db['Attachment'],{'as':_0x4261('0xd1'),'foreignKey':_0x4261('0x14a')});db[_0x4261('0x61')][_0x4261('0x119')](db[_0x4261('0x157')],{'as':_0x4261('0x135'),'foreignKey':_0x4261('0x158')});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x4261('0xdf'),'as':_0x4261('0x129'),'foreignKey':'ContactId'});db[_0x4261('0x62')]['belongsTo'](db['ChatWebsite'],{'as':_0x4261('0x135'),'foreignKey':_0x4261('0x158')});db[_0x4261('0x63')][_0x4261('0xeb')](db['User'],{'as':_0x4261('0x11f'),'through':_0x4261('0x30'),'hooks':!![]});db[_0x4261('0x63')]['belongsToMany'](db[_0x4261('0xf4')],{'through':_0x4261('0x15c'),'as':'Teams'});db[_0x4261('0xec')][_0x4261('0xe1')](db['ChatInternalMessage'],{'as':_0x4261('0x124'),'foreignKey':_0x4261('0x15d'),'onDelete':_0x4261('0xdf')});db[_0x4261('0xec')][_0x4261('0xeb')](db[_0x4261('0x10')],{'as':_0x4261('0x113'),'through':'chat_group_has_users'});db['ChatProactiveAction'][_0x4261('0x119')](db['ChatWebsite'],{'as':_0x4261('0x15e'),'foreignKey':'ChatWebsiteId'});db['CmCompany']['hasMany'](db[_0x4261('0xef')],{'as':'Contacts','foreignKey':'CompanyId'});db[_0x4261('0xef')][_0x4261('0xe1')](db[_0x4261('0x115')],{'as':'Hoppers','foreignKey':'ContactId'});db[_0x4261('0xef')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x4261('0x12a')});db[_0x4261('0xef')]['hasMany'](db[_0x4261('0x70')],{'as':_0x4261('0x116'),'foreignKey':_0x4261('0x12a')});db[_0x4261('0xef')][_0x4261('0xe1')](db[_0x4261('0x72')],{'as':_0x4261('0x72'),'foreignKey':'ContactId'});db[_0x4261('0xef')][_0x4261('0xe1')](db['JscriptySessionReport'],{'as':_0x4261('0x118'),'foreignKey':_0x4261('0x12a')});db[_0x4261('0xef')][_0x4261('0xe1')](db['OpenchannelInteraction'],{'as':_0x4261('0xe7'),'foreignKey':_0x4261('0x12a'),'onDelete':'restrict'});db['CmContact'][_0x4261('0xe1')](db[_0x4261('0x60')],{'as':_0x4261('0xe8'),'foreignKey':_0x4261('0x12a'),'onDelete':_0x4261('0x13c')});db[_0x4261('0xef')]['hasMany'](db[_0x4261('0x50')],{'as':_0x4261('0xf8'),'foreignKey':_0x4261('0x12a'),'onDelete':_0x4261('0x13c')});db[_0x4261('0xef')][_0x4261('0xe1')](db[_0x4261('0x47')],{'as':_0x4261('0xe9'),'foreignKey':_0x4261('0x12a'),'onDelete':_0x4261('0x13c')});db[_0x4261('0xef')][_0x4261('0xe1')](db[_0x4261('0x3d')],{'as':_0x4261('0xea'),'foreignKey':_0x4261('0x12a'),'onDelete':_0x4261('0x13c')});db[_0x4261('0xef')]['belongsTo'](db['CmCompany'],{'as':_0x4261('0x15f'),'foreignKey':_0x4261('0x160')});db[_0x4261('0xef')][_0x4261('0x119')](db['CmList'],{'as':_0x4261('0x133'),'foreignKey':_0x4261('0x134'),'onDelete':_0x4261('0xdf')});db[_0x4261('0xef')][_0x4261('0xeb')](db['User'],{'as':_0x4261('0x139'),'through':_0x4261('0xf1')});db['CmContact'][_0x4261('0xeb')](db[_0x4261('0x83')],{'as':_0x4261('0x155'),'through':'cm_contact_has_tags'});db[_0x4261('0xef')][_0x4261('0xeb')](db[_0x4261('0x83')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db['CmHopper'][_0x4261('0x119')](db[_0x4261('0xef')],{'as':'Contact','foreignKey':_0x4261('0x12a'),'onDelete':'cascade'});db[_0x4261('0x115')][_0x4261('0x119')](db['CmList'],{'as':_0x4261('0x133'),'foreignKey':_0x4261('0x134'),'onDelete':'cascade'});db['CmHopper'][_0x4261('0x119')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x4261('0x115')][_0x4261('0x119')](db[_0x4261('0x1a')],{'as':_0x4261('0x161'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x4261('0x115')][_0x4261('0x119')](db['Campaign'],{'as':_0x4261('0xce'),'foreignKey':_0x4261('0x162'),'onDelete':_0x4261('0xdf')});db['CmHopperBlack'][_0x4261('0x119')](db[_0x4261('0xef')],{'as':_0x4261('0x129'),'foreignKey':_0x4261('0x12a'),'onDelete':'cascade'});db[_0x4261('0x6c')][_0x4261('0x119')](db['CmList'],{'as':_0x4261('0x133'),'foreignKey':_0x4261('0x134'),'onDelete':'cascade'});db[_0x4261('0x6c')][_0x4261('0x119')](db[_0x4261('0x1a')],{'as':_0x4261('0x161'),'foreignKey':_0x4261('0x114'),'onDelete':_0x4261('0xdf')});db[_0x4261('0x6c')][_0x4261('0x119')](db[_0x4261('0xce')],{'as':_0x4261('0xce'),'foreignKey':_0x4261('0x162'),'onDelete':_0x4261('0xdf')});db[_0x4261('0x74')]['hasMany'](db[_0x4261('0x78')],{'as':{'plural':_0x4261('0x163'),'singular':_0x4261('0x164')},'foreignKey':_0x4261('0x165'),'onDelete':_0x4261('0xdf'),'hooks':!![]});db[_0x4261('0x74')][_0x4261('0xe1')](db[_0x4261('0x78')],{'as':{'plural':_0x4261('0x166'),'singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':_0x4261('0xdf'),'hooks':!![]});db[_0x4261('0x74')][_0x4261('0xe1')](db[_0x4261('0x167')],{'as':_0x4261('0x168'),'foreignKey':_0x4261('0x169'),'onDelete':'cascade','hooks':!![]});db[_0x4261('0x7a')]['hasMany'](db[_0x4261('0x7a')],{'as':_0x4261('0x16a'),'foreignKey':_0x4261('0x11d'),'onDelete':'cascade','hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0x4261('0x17')],{'as':_0x4261('0xe4'),'foreignKey':_0x4261('0x11d'),'onDelete':_0x4261('0x13c')});db[_0x4261('0x7a')][_0x4261('0xe1')](db[_0x4261('0x41')],{'as':_0x4261('0x16b'),'foreignKey':_0x4261('0x11d')});db['Interval'][_0x4261('0xe1')](db[_0x4261('0x5e')],{'as':_0x4261('0x16c'),'foreignKey':_0x4261('0x11d')});db[_0x4261('0x7a')][_0x4261('0xe1')](db[_0x4261('0x144')],{'as':_0x4261('0x16d'),'foreignKey':_0x4261('0x11d')});db[_0x4261('0x7a')][_0x4261('0xe1')](db['SmsApplication'],{'as':_0x4261('0x16e'),'foreignKey':_0x4261('0x11d')});db['Schedule']['belongsTo'](db[_0x4261('0x105')],{});db['Schedule'][_0x4261('0x119')](db[_0x4261('0x90')],{'foreignKey':_0x4261('0x16f')});db['Schedule'][_0x4261('0x119')](db[_0x4261('0x8e')],{'foreignKey':_0x4261('0x170')});db[_0x4261('0x81')][_0x4261('0xeb')](db[_0x4261('0x110')],{'as':_0x4261('0x171'),'through':_0x4261('0x112'),'onDelete':'restrict'});db[_0x4261('0x83')][_0x4261('0xeb')](db[_0x4261('0xef')],{'through':_0x4261('0x172')});db[_0x4261('0x83')][_0x4261('0xeb')](db[_0x4261('0x60')],{'through':_0x4261('0x173')});db[_0x4261('0x83')]['belongsToMany'](db['MailInteraction'],{'through':_0x4261('0x137')});db[_0x4261('0x83')][_0x4261('0xeb')](db['SmsInteraction'],{'through':_0x4261('0x14e')});db['Tag']['belongsToMany'](db[_0x4261('0x47')],{'through':_0x4261('0x148')});db[_0x4261('0x83')]['belongsToMany'](db[_0x4261('0xe6')],{'through':_0x4261('0x154')});db[_0x4261('0x86')][_0x4261('0xe1')](db[_0x4261('0x78')],{'as':{'plural':_0x4261('0x174'),'singular':_0x4261('0x175')},'foreignKey':'TriggerAllId','onDelete':_0x4261('0xdf'),'hooks':!![]});db[_0x4261('0x86')][_0x4261('0xe1')](db[_0x4261('0x78')],{'as':{'plural':_0x4261('0x176'),'singular':_0x4261('0x177')},'foreignKey':_0x4261('0x178'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0x4261('0xe1')](db[_0x4261('0x167')],{'as':_0x4261('0x168'),'foreignKey':_0x4261('0x179'),'onDelete':_0x4261('0xdf'),'hooks':!![]});db[_0x4261('0x8e')][_0x4261('0xe1')](db[_0x4261('0x94')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x4261('0x170'),'hooks':!![]});db[_0x4261('0x90')][_0x4261('0xe1')](db[_0x4261('0x94')],{'as':'Fields','onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x16f')});db[_0x4261('0x17a')][_0x4261('0xe1')](db[_0x4261('0x94')],{'as':_0x4261('0x17b'),'onDelete':'cascade','foreignKey':_0x4261('0x17c')});db[_0x4261('0x94')][_0x4261('0x119')](db['AnalyticMetric'],{'foreignKey':_0x4261('0x17c')});db['SalesforceAccount'][_0x4261('0xe1')](db[_0x4261('0x17d')],{'as':_0x4261('0x17e'),'onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x17f')});db[_0x4261('0x17d')][_0x4261('0xe1')](db[_0x4261('0x9a')],{'as':_0x4261('0x180'),'onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x181')});db[_0x4261('0x17d')][_0x4261('0xe1')](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x182')});db[_0x4261('0x17d')][_0x4261('0xe1')](db[_0x4261('0x9a')],{'as':'Fields','onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x183')});db[_0x4261('0x17d')][_0x4261('0x119')](db[_0x4261('0x97')],{'as':'Account','foreignKey':_0x4261('0x17f')});db['SalesforceField'][_0x4261('0xe1')](db['SalesforceField'],{'as':_0x4261('0x184'),'foreignKey':_0x4261('0x181')});db[_0x4261('0x9a')]['hasMany'](db['SalesforceField'],{'as':_0x4261('0x185'),'foreignKey':_0x4261('0x182')});db[_0x4261('0x9a')][_0x4261('0xe1')](db['SalesforceField'],{'as':_0x4261('0x186'),'foreignKey':_0x4261('0x183')});db['SalesforceField'][_0x4261('0x119')](db[_0x4261('0x88')],{'as':_0x4261('0x88'),'foreignKey':'VariableId'});db[_0x4261('0x9c')]['hasMany'](db[_0x4261('0x9e')],{'as':_0x4261('0x17e'),'onDelete':_0x4261('0xdf'),'foreignKey':'AccountId'});db[_0x4261('0x9e')][_0x4261('0xe1')](db[_0x4261('0xa0')],{'as':_0x4261('0x180'),'onDelete':_0x4261('0xdf'),'foreignKey':'SubjectId'});db[_0x4261('0x9e')]['hasMany'](db[_0x4261('0xa0')],{'as':_0x4261('0x187'),'onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x182')});db[_0x4261('0x9e')][_0x4261('0xe1')](db[_0x4261('0xa0')],{'as':_0x4261('0x17b'),'onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x183')});db[_0x4261('0x9e')]['belongsTo'](db['SugarcrmAccount'],{'as':_0x4261('0x135'),'foreignKey':'AccountId'});db[_0x4261('0xa0')][_0x4261('0xe1')](db[_0x4261('0xa0')],{'as':_0x4261('0x184'),'foreignKey':_0x4261('0x181')});db[_0x4261('0xa0')]['hasMany'](db[_0x4261('0xa0')],{'as':_0x4261('0x185'),'foreignKey':_0x4261('0x182')});db[_0x4261('0xa0')]['hasMany'](db['SugarcrmField'],{'as':_0x4261('0x186'),'foreignKey':_0x4261('0x183')});db[_0x4261('0xa0')]['belongsTo'](db[_0x4261('0x88')],{'as':'Variable','foreignKey':_0x4261('0x188')});db['DeskAccount'][_0x4261('0xe1')](db[_0x4261('0xa4')],{'as':_0x4261('0x17e'),'onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x17f')});db[_0x4261('0xa4')][_0x4261('0xe1')](db[_0x4261('0x189')],{'as':_0x4261('0x180'),'onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x181')});db[_0x4261('0xa4')][_0x4261('0xe1')](db[_0x4261('0x189')],{'as':_0x4261('0x187'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['DeskConfiguration'][_0x4261('0xe1')](db[_0x4261('0x189')],{'as':_0x4261('0x17b'),'onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x183')});db[_0x4261('0xa4')][_0x4261('0x119')](db[_0x4261('0xa2')],{'as':_0x4261('0x135'),'foreignKey':_0x4261('0x17f')});db[_0x4261('0xa4')][_0x4261('0xeb')](db[_0x4261('0x83')],{'through':_0x4261('0x18a')});db[_0x4261('0x189')][_0x4261('0xe1')](db[_0x4261('0x189')],{'as':_0x4261('0x184'),'foreignKey':_0x4261('0x181')});db[_0x4261('0x189')][_0x4261('0xe1')](db[_0x4261('0x189')],{'as':'Description','foreignKey':_0x4261('0x182')});db[_0x4261('0x189')][_0x4261('0xe1')](db['DeskField'],{'as':_0x4261('0x186'),'foreignKey':_0x4261('0x183')});db[_0x4261('0x189')][_0x4261('0x119')](db[_0x4261('0x88')],{'as':'Variable','foreignKey':_0x4261('0x188')});db[_0x4261('0xa7')]['hasMany'](db[_0x4261('0xa9')],{'as':_0x4261('0x17e'),'onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x17f')});db[_0x4261('0xa9')][_0x4261('0xe1')](db[_0x4261('0xab')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x4261('0x181')});db[_0x4261('0xa9')][_0x4261('0xe1')](db[_0x4261('0xab')],{'as':'Descriptions','onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x182')});db[_0x4261('0xa9')]['hasMany'](db['ZohoField'],{'as':_0x4261('0x17b'),'onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x183')});db[_0x4261('0xa9')][_0x4261('0x119')](db[_0x4261('0xa7')],{'as':_0x4261('0x135'),'foreignKey':_0x4261('0x17f')});db['ZohoField'][_0x4261('0xe1')](db[_0x4261('0xab')],{'as':_0x4261('0x184'),'foreignKey':_0x4261('0x181')});db[_0x4261('0xab')][_0x4261('0xe1')](db[_0x4261('0xab')],{'as':'Description','foreignKey':_0x4261('0x182')});db['ZohoField'][_0x4261('0xe1')](db['ZohoField'],{'as':_0x4261('0x186'),'foreignKey':'FieldId'});db[_0x4261('0xab')][_0x4261('0x119')](db['Variable'],{'as':_0x4261('0x88'),'foreignKey':_0x4261('0x188')});db[_0x4261('0x18b')][_0x4261('0xe1')](db['ZendeskConfiguration'],{'as':_0x4261('0x17e'),'onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x17f')});db[_0x4261('0xad')][_0x4261('0xe1')](db[_0x4261('0xae')],{'as':'Subjects','foreignKey':_0x4261('0x181')});db[_0x4261('0xad')][_0x4261('0xe1')](db[_0x4261('0xae')],{'as':_0x4261('0x187'),'foreignKey':_0x4261('0x182')});db[_0x4261('0xad')][_0x4261('0xe1')](db['ZendeskField'],{'as':'Fields','foreignKey':_0x4261('0x183')});db[_0x4261('0xad')][_0x4261('0x119')](db[_0x4261('0x18b')],{'as':'Account','foreignKey':'AccountId'});db[_0x4261('0xad')][_0x4261('0xeb')](db[_0x4261('0x83')],{'through':_0x4261('0x18c')});db[_0x4261('0xae')]['hasMany'](db[_0x4261('0xae')],{'as':_0x4261('0x184'),'foreignKey':_0x4261('0x181')});db['ZendeskField'][_0x4261('0xe1')](db[_0x4261('0xae')],{'as':_0x4261('0x185'),'foreignKey':_0x4261('0x182')});db[_0x4261('0xae')][_0x4261('0xe1')](db[_0x4261('0xae')],{'as':_0x4261('0x186'),'foreignKey':_0x4261('0x183')});db['ZendeskField'][_0x4261('0x119')](db['Variable'],{'as':_0x4261('0x88'),'foreignKey':_0x4261('0x188')});db[_0x4261('0x18d')][_0x4261('0xe1')](db[_0x4261('0xb1')],{'as':_0x4261('0x17e'),'onDelete':_0x4261('0xdf'),'foreignKey':'AccountId'});db['FreshdeskConfiguration']['hasMany'](db[_0x4261('0xb2')],{'as':_0x4261('0x180'),'onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x181')});db[_0x4261('0xb1')][_0x4261('0xe1')](db[_0x4261('0xb2')],{'as':_0x4261('0x187'),'onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x182')});db['FreshdeskConfiguration']['hasMany'](db[_0x4261('0xb2')],{'as':'Fields','onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x183')});db[_0x4261('0xb1')][_0x4261('0x119')](db[_0x4261('0x18d')],{'as':_0x4261('0x135'),'foreignKey':_0x4261('0x17f')});db[_0x4261('0xb1')][_0x4261('0xeb')](db[_0x4261('0x83')],{'through':_0x4261('0x18e')});db[_0x4261('0xb2')][_0x4261('0xe1')](db[_0x4261('0xb2')],{'as':_0x4261('0x184'),'foreignKey':_0x4261('0x181')});db[_0x4261('0xb2')]['hasMany'](db[_0x4261('0xb2')],{'as':_0x4261('0x185'),'foreignKey':_0x4261('0x182')});db[_0x4261('0xb2')][_0x4261('0xe1')](db[_0x4261('0xb2')],{'as':_0x4261('0x186'),'foreignKey':'FieldId'});db['FreshdeskField'][_0x4261('0x119')](db[_0x4261('0x88')],{'as':_0x4261('0x88'),'foreignKey':_0x4261('0x188')});db['VtigerAccount'][_0x4261('0xe1')](db[_0x4261('0xb6')],{'as':_0x4261('0x17e'),'onDelete':'cascade','foreignKey':_0x4261('0x17f')});db[_0x4261('0xb6')][_0x4261('0xe1')](db[_0x4261('0x18f')],{'as':_0x4261('0x180'),'foreignKey':_0x4261('0x181')});db[_0x4261('0xb6')]['hasMany'](db[_0x4261('0x18f')],{'as':'Descriptions','foreignKey':_0x4261('0x182')});db['VtigerConfiguration'][_0x4261('0xe1')](db[_0x4261('0x18f')],{'as':_0x4261('0x17b'),'foreignKey':_0x4261('0x183')});db[_0x4261('0xb6')]['belongsTo'](db['VtigerAccount'],{'as':_0x4261('0x135'),'foreignKey':_0x4261('0x17f')});db[_0x4261('0xb6')][_0x4261('0xeb')](db[_0x4261('0x83')],{'through':_0x4261('0x190')});db[_0x4261('0x18f')][_0x4261('0xe1')](db[_0x4261('0x18f')],{'as':_0x4261('0x184'),'foreignKey':_0x4261('0x181')});db[_0x4261('0x18f')][_0x4261('0xe1')](db[_0x4261('0x18f')],{'as':_0x4261('0x185'),'foreignKey':_0x4261('0x182')});db[_0x4261('0x18f')][_0x4261('0xe1')](db[_0x4261('0x18f')],{'as':_0x4261('0x186'),'foreignKey':_0x4261('0x183')});db[_0x4261('0x18f')][_0x4261('0x119')](db[_0x4261('0x88')],{'as':'Variable','foreignKey':_0x4261('0x188')});db[_0x4261('0xb8')][_0x4261('0x119')](db[_0x4261('0x157')],{});db[_0x4261('0xb8')]['belongsTo'](db[_0x4261('0xdc')],{'as':_0x4261('0x133'),'foreignKey':_0x4261('0x134')});db[_0x4261('0xb8')][_0x4261('0x119')](db[_0x4261('0xef')],{'as':_0x4261('0x129'),'foreignKey':_0x4261('0x12a')});db[_0x4261('0xb8')]['belongsTo'](db[_0x4261('0x60')],{});db['ChatQueueReport'][_0x4261('0x119')](db[_0x4261('0x61')],{});db[_0x4261('0xb8')][_0x4261('0x119')](db[_0x4261('0x10')],{});db[_0x4261('0xb8')]['belongsTo'](db['ChatQueue'],{});db[_0x4261('0x191')][_0x4261('0x119')](db['User'],{'onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x192')});db[_0x4261('0x191')]['belongsTo'](db[_0x4261('0x10')],{'onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x193')});db[_0x4261('0xbd')][_0x4261('0xe1')](db[_0x4261('0xbb')],{'foreignKey':'SessionId','onDelete':_0x4261('0xdf')});db['JscriptySessionReport'][_0x4261('0xe1')](db[_0x4261('0xba')],{'foreignKey':_0x4261('0x194'),'onDelete':_0x4261('0xdf')});db[_0x4261('0xbf')][_0x4261('0x119')](db[_0x4261('0x10a')],{});db[_0x4261('0xbf')][_0x4261('0x119')](db[_0x4261('0xdc')],{'as':_0x4261('0x133'),'foreignKey':_0x4261('0x134')});db[_0x4261('0xbf')][_0x4261('0x119')](db[_0x4261('0xef')],{'as':_0x4261('0x129'),'foreignKey':_0x4261('0x12a')});db[_0x4261('0xbf')]['belongsTo'](db[_0x4261('0x50')],{});db[_0x4261('0xbf')][_0x4261('0x119')](db[_0x4261('0x52')],{});db[_0x4261('0xbf')]['belongsTo'](db['User'],{});db[_0x4261('0xbf')]['belongsTo'](db[_0x4261('0x54')],{});db['JscriptyProject']['hasMany'](db[_0x4261('0xbd')],{'foreignKey':_0x4261('0x195')});db[_0x4261('0xc4')][_0x4261('0xe1')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0x4261('0xc4')][_0x4261('0xe1')](db['JscriptyAnswerReport'],{'foreignKey':_0x4261('0x195')});db['SquareProject']['belongsToMany'](db[_0x4261('0x10')],{'as':_0x4261('0x139'),'through':'user_has_square_projects'});db['Team'][_0x4261('0xeb')](db[_0x4261('0x10')],{'as':_0x4261('0x11f'),'through':'user_has_teams'});db[_0x4261('0xf4')][_0x4261('0xeb')](db[_0x4261('0x1a')],{'through':_0x4261('0x121'),'as':_0x4261('0xfa')});db[_0x4261('0xf4')][_0x4261('0xeb')](db[_0x4261('0x39')],{'through':_0x4261('0x196'),'as':_0x4261('0x197')});db[_0x4261('0xf4')][_0x4261('0xeb')](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0x4261('0xfb')});db['Team'][_0x4261('0xeb')](db[_0x4261('0x146')],{'through':_0x4261('0x14b'),'as':_0x4261('0x198')});db[_0x4261('0xf4')][_0x4261('0xeb')](db['SmsQueue'],{'through':_0x4261('0x14f'),'as':_0x4261('0x199')});db[_0x4261('0xf4')][_0x4261('0xeb')](db[_0x4261('0x5a')],{'through':_0x4261('0x156'),'as':_0x4261('0xfd')});db[_0x4261('0xce')]['hasMany'](db[_0x4261('0x115')],{'as':'Hoppers','foreignKey':_0x4261('0x162')});db[_0x4261('0xce')][_0x4261('0xe1')](db[_0x4261('0x6e')],{'as':_0x4261('0xe5'),'foreignKey':_0x4261('0x162')});db['Campaign'][_0x4261('0xe1')](db[_0x4261('0x70')],{'as':_0x4261('0x116'),'foreignKey':_0x4261('0x162')});db[_0x4261('0xce')][_0x4261('0xe1')](db[_0x4261('0x6c')],{'as':_0x4261('0x117'),'foreignKey':_0x4261('0x162')});db[_0x4261('0xce')][_0x4261('0x119')](db[_0x4261('0x29')],{'as':_0x4261('0x29'),'foreignKey':_0x4261('0x11a')});db[_0x4261('0xce')][_0x4261('0x119')](db[_0x4261('0x29')],{'as':_0x4261('0x11b'),'foreignKey':_0x4261('0x11c')});db[_0x4261('0xce')][_0x4261('0x119')](db[_0x4261('0x7a')],{'as':_0x4261('0x7a'),'foreignKey':_0x4261('0x11d')});db[_0x4261('0xce')][_0x4261('0x119')](db[_0x4261('0xc8')],{'as':_0x4261('0xc8'),'foreignKey':_0x4261('0x19a')});db[_0x4261('0xce')]['belongsToMany'](db[_0x4261('0xdc')],{'as':'Lists','through':_0x4261('0x19b')});db[_0x4261('0xce')][_0x4261('0xeb')](db[_0x4261('0xdc')],{'as':'BlackLists','through':_0x4261('0x19c')});db[_0x4261('0xd4')][_0x4261('0x119')](db[_0x4261('0x3f')],{});db[_0x4261('0xd4')]['belongsTo'](db['MailInteraction'],{});db[_0x4261('0xd4')]['belongsTo'](db[_0x4261('0x105')],{'foreignKey':_0x4261('0x19d'),'as':'FromAccount'});db[_0x4261('0xd4')][_0x4261('0x119')](db[_0x4261('0x10')],{'foreignKey':_0x4261('0x19e'),'as':_0x4261('0x19f')});db[_0x4261('0xd4')][_0x4261('0x119')](db['User'],{'foreignKey':_0x4261('0x1a0'),'as':_0x4261('0x1a1')});db[_0x4261('0xd4')][_0x4261('0x119')](db[_0x4261('0x39')],{'foreignKey':_0x4261('0x1a2'),'as':'ToQueue'});db['MailTransferReport'][_0x4261('0x119')](db[_0x4261('0x105')],{'foreignKey':_0x4261('0x1a3'),'as':_0x4261('0x1a4')});db['ChatTransferReport'][_0x4261('0x119')](db[_0x4261('0x61')],{});db['ChatTransferReport'][_0x4261('0x119')](db['ChatInteraction'],{});db[_0x4261('0xd6')][_0x4261('0x119')](db[_0x4261('0x157')],{'foreignKey':_0x4261('0x1a5'),'as':_0x4261('0x1a6')});db[_0x4261('0xd6')][_0x4261('0x119')](db[_0x4261('0x10')],{'foreignKey':_0x4261('0x19e'),'as':_0x4261('0x19f')});db[_0x4261('0xd6')]['belongsTo'](db['User'],{'foreignKey':_0x4261('0x1a0'),'as':_0x4261('0x1a1')});db[_0x4261('0xd6')][_0x4261('0x119')](db[_0x4261('0x63')],{'foreignKey':_0x4261('0x1a7'),'as':_0x4261('0x1a8')});db[_0x4261('0xd6')]['belongsTo'](db[_0x4261('0x157')],{'foreignKey':_0x4261('0x1a9'),'as':_0x4261('0x1a4')});db['FaxTransferReport'][_0x4261('0x119')](db['FaxMessage'],{});db[_0x4261('0xd8')][_0x4261('0x119')](db[_0x4261('0x47')],{});db[_0x4261('0xd8')][_0x4261('0x119')](db[_0x4261('0x44')],{'foreignKey':_0x4261('0x1aa'),'as':_0x4261('0x1a6')});db['FaxTransferReport'][_0x4261('0x119')](db[_0x4261('0x10')],{'foreignKey':'FromUserId','as':_0x4261('0x19f')});db['FaxTransferReport'][_0x4261('0x119')](db[_0x4261('0x10')],{'foreignKey':_0x4261('0x1a0'),'as':'ToAgent'});db[_0x4261('0xd8')]['belongsTo'](db[_0x4261('0x146')],{'foreignKey':_0x4261('0x1ab'),'as':_0x4261('0x1a8')});db[_0x4261('0xd8')]['belongsTo'](db[_0x4261('0x44')],{'foreignKey':'ToFaxAccountId','as':_0x4261('0x1a4')});db['OpenchannelTransferReport'][_0x4261('0x119')](db[_0x4261('0x58')],{});db[_0x4261('0xda')][_0x4261('0x119')](db[_0x4261('0xe6')],{});db[_0x4261('0xda')][_0x4261('0x119')](db[_0x4261('0x55')],{'foreignKey':_0x4261('0x1ac'),'as':_0x4261('0x1a6')});db[_0x4261('0xda')]['belongsTo'](db[_0x4261('0x10')],{'foreignKey':_0x4261('0x19e'),'as':_0x4261('0x19f')});db[_0x4261('0xda')][_0x4261('0x119')](db[_0x4261('0x10')],{'foreignKey':'ToUserId','as':_0x4261('0x1a1')});db[_0x4261('0xda')]['belongsTo'](db[_0x4261('0x5a')],{'foreignKey':_0x4261('0x1ad'),'as':_0x4261('0x1a8')});db['OpenchannelTransferReport'][_0x4261('0x119')](db[_0x4261('0x55')],{'foreignKey':'ToOpenchannelAccountId','as':_0x4261('0x1a4')});db[_0x4261('0xdb')][_0x4261('0x119')](db[_0x4261('0x52')],{});db['SmsTransferReport']['belongsTo'](db['SmsInteraction'],{});db[_0x4261('0xdb')][_0x4261('0x119')](db[_0x4261('0x10a')],{'foreignKey':_0x4261('0x1ae'),'as':_0x4261('0x1a6')});db[_0x4261('0xdb')]['belongsTo'](db[_0x4261('0x10')],{'foreignKey':_0x4261('0x19e'),'as':_0x4261('0x19f')});db[_0x4261('0xdb')][_0x4261('0x119')](db[_0x4261('0x10')],{'foreignKey':_0x4261('0x1a0'),'as':_0x4261('0x1a1')});db['SmsTransferReport'][_0x4261('0x119')](db[_0x4261('0x54')],{'foreignKey':_0x4261('0x1af'),'as':_0x4261('0x1a8')});db['SmsTransferReport'][_0x4261('0x119')](db[_0x4261('0x10a')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db[_0x4261('0xdc')]['hasMany'](db['Disposition'],{'as':_0x4261('0x142'),'foreignKey':'ListId'});db[_0x4261('0xdc')][_0x4261('0xe1')](db[_0x4261('0x1b0')],{'as':'CustomFields','foreignKey':_0x4261('0x134')});db['CmList'][_0x4261('0xe1')](db[_0x4261('0xef')],{'as':_0x4261('0xf0'),'onDelete':_0x4261('0xdf'),'foreignKey':_0x4261('0x134')});db[_0x4261('0xdc')][_0x4261('0xe1')](db[_0x4261('0x6e')],{'as':_0x4261('0xe5'),'foreignKey':_0x4261('0x134')});db[_0x4261('0xdc')][_0x4261('0xe1')](db['CmHopperHistory'],{'as':_0x4261('0x1b1'),'foreignKey':_0x4261('0x134')});db[_0x4261('0xdc')][_0x4261('0xe1')](db[_0x4261('0x72')],{'as':'ReportAgentPreview','foreignKey':_0x4261('0x134')});db[_0x4261('0xdc')][_0x4261('0xeb')](db[_0x4261('0x1a')],{'as':_0x4261('0x1b2'),'through':_0x4261('0x11e')});db[_0x4261('0xdc')][_0x4261('0xeb')](db['User'],{'as':_0x4261('0x11f'),'through':_0x4261('0xf3')});db[_0x4261('0xde')]['hasMany'](db[_0x4261('0x17')],{'as':'Extensions','onDelete':_0x4261('0x13c')});db['VoicePrefix'][_0x4261('0xeb')](db[_0x4261('0x10')],{'as':'Agents','through':'user_has_voice_prefixes'});module[_0x4261('0x1b3')]={'db':db,'dbH':dbH};
\ No newline at end of file
index 12249d8..e15ba6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f59=['./api/voiceTransferReport','/api/mail/out_servers','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelInteraction','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/groups','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/automation','./api/disposition','/api/conditions','/api/intervals','/api/cdr','./api/cdr','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/templates','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/integrations/salesforce/accounts','./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/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','./api/voicePrefix','/api/auth/local','./api/authLocal','/api/auth/google','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','/api/system','./api/system','./api/pm2','static','join','root','/apidoc','/www','/demo','/snippet','1.0.10','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','path','express','util','./errors','./config/environment','./config/logger','api','auth','default','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','connection','remoteAddress','url','statusCode','user','role','use','logger','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)','headers','x-forwarded-for','responseTime','name','other','agent_name','test','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/trunk','/api/voice/transfers/reports'];(function(_0x24a2a5,_0x1a7d0c){var _0x2f7eab=function(_0x137b37){while(--_0x137b37){_0x24a2a5['push'](_0x24a2a5['shift']());}};_0x2f7eab(++_0x1a7d0c);}(_0x3f59,0x1b0));var _0x93f5=function(_0x3b768f,_0x444589){_0x3b768f=_0x3b768f-0x0;var _0xa95f39=_0x3f59[_0x3b768f];return _0xa95f39;};'use strict';var path=require(_0x93f5('0x0'));var express=require(_0x93f5('0x1'));var ewinston=require('express-winston');var util=require(_0x93f5('0x2'));var errors=require(_0x93f5('0x3'));var config=require(_0x93f5('0x4'));var logger=require(_0x93f5('0x5'))(_0x93f5('0x6'));var authLogger=require(_0x93f5('0x5'))(_0x93f5('0x7'));exports[_0x93f5('0x8')]=function(_0x3de6ce){_0x3de6ce['use'](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0xb86c2d,_0x456295){return util[_0x93f5('0x9')](_0x93f5('0xa'),_0xb86c2d[_0x93f5('0xb')],_0xb86c2d['headers']['x-forwarded-for']?_0xb86c2d['headers']['x-forwarded-for']:_0xb86c2d[_0x93f5('0xc')][_0x93f5('0xd')]||_0xb86c2d['ip'],_0xb86c2d[_0x93f5('0xe')],_0x456295[_0x93f5('0xf')],_0x456295['responseTime'],_0xb86c2d['user']?_0xb86c2d[_0x93f5('0x10')]['id']:null,_0xb86c2d[_0x93f5('0x10')]?_0xb86c2d[_0x93f5('0x10')]['name']:null,_0xb86c2d[_0x93f5('0x10')]?_0xb86c2d['user'][_0x93f5('0x11')]:null);}}));_0x3de6ce[_0x93f5('0x12')](ewinston[_0x93f5('0x13')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x161fe1,_0x3d85da){var _0x45a275='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x161fe1[_0x93f5('0x14')]&&_0x161fe1[_0x93f5('0x14')][_0x93f5('0x15')]&&_0x161fe1[_0x93f5('0x14')][_0x93f5('0x16')]){_0x45a275=_0x93f5('0x17');}return util[_0x93f5('0x9')](_0x45a275,_0x161fe1[_0x93f5('0xb')],_0x161fe1[_0x93f5('0x18')][_0x93f5('0x19')]?_0x161fe1[_0x93f5('0x18')][_0x93f5('0x19')]:_0x161fe1['connection'][_0x93f5('0xd')]||_0x161fe1['ip'],_0x161fe1[_0x93f5('0xe')],_0x3d85da[_0x93f5('0xf')],_0x3d85da[_0x93f5('0x1a')],_0x161fe1[_0x93f5('0x10')]?_0x161fe1['user']['id']:null,_0x161fe1[_0x93f5('0x10')]?_0x161fe1[_0x93f5('0x10')][_0x93f5('0x1b')]:null,_0x161fe1[_0x93f5('0x10')]?_0x161fe1[_0x93f5('0x10')][_0x93f5('0x11')]:null,_0x161fe1[_0x93f5('0x14')]&&_0x161fe1[_0x93f5('0x14')][_0x93f5('0x15')]?_0x161fe1[_0x93f5('0x14')][_0x93f5('0x15')]:_0x93f5('0x1c'),_0x161fe1[_0x93f5('0x14')]&&_0x161fe1['body'][_0x93f5('0x16')]?_0x161fe1[_0x93f5('0x14')][_0x93f5('0x16')]:'',_0x161fe1[_0x93f5('0x14')]&&_0x161fe1[_0x93f5('0x14')][_0x93f5('0x1d')]?_0x161fe1['body'][_0x93f5('0x1d')]:'');},'ignoreRoute':function(_0x2e035f){var _0x54955f=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x54955f[_0x93f5('0x1e')](_0x2e035f[_0x93f5('0xe')]);}}));_0x3de6ce['use']('/api/users',require(_0x93f5('0x1f')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x20'),require(_0x93f5('0x21')));_0x3de6ce['use'](_0x93f5('0x22'),require('./api/voiceContext'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x23'),require('./api/voiceExtension'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x24'),require(_0x93f5('0x25')));_0x3de6ce['use'](_0x93f5('0x26'),require('./api/voiceQueue'));_0x3de6ce[_0x93f5('0x12')]('/api/voice/recordings',require(_0x93f5('0x27')));_0x3de6ce[_0x93f5('0x12')]('/api/voice/mails',require(_0x93f5('0x28')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x29'),require(_0x93f5('0x2a')));_0x3de6ce['use'](_0x93f5('0x2b'),require('./api/voiceCallReport'));_0x3de6ce[_0x93f5('0x12')]('/api/voice/dials/reports',require(_0x93f5('0x2c')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x2d'),require(_0x93f5('0x2e')));_0x3de6ce['use'](_0x93f5('0x2f'),require(_0x93f5('0x30')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x31'),require('./api/memberReport'));_0x3de6ce[_0x93f5('0x12')]('/api/trunks',require(_0x93f5('0x32')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x33'),require(_0x93f5('0x34')));_0x3de6ce['use'](_0x93f5('0x35'),require('./api/mailServerOut'));_0x3de6ce[_0x93f5('0x12')]('/api/mail/accounts',require('./api/mailAccount'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x36'),require(_0x93f5('0x37')));_0x3de6ce['use'](_0x93f5('0x38'),require(_0x93f5('0x39')));_0x3de6ce['use'](_0x93f5('0x3a'),require('./api/mailInteraction'));_0x3de6ce[_0x93f5('0x12')]('/api/mail/messages',require(_0x93f5('0x3b')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x3c'),require(_0x93f5('0x3d')));_0x3de6ce[_0x93f5('0x12')]('/api/mail/reports/queue',require(_0x93f5('0x3e')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x3f'),require(_0x93f5('0x40')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x41'),require('./api/dashboardItem'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x42'),require(_0x93f5('0x43')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x44'),require(_0x93f5('0x45')));_0x3de6ce['use'](_0x93f5('0x46'),require('./api/faxInteraction'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x47'),require('./api/faxMessage'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x48'),require(_0x93f5('0x49')));_0x3de6ce[_0x93f5('0x12')]('/api/fax/reports/queue',require(_0x93f5('0x4a')));_0x3de6ce['use'](_0x93f5('0x4b'),require(_0x93f5('0x4c')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x4d'),require(_0x93f5('0x4e')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x4f'),require('./api/smsInteraction'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x50'),require(_0x93f5('0x51')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x52'),require(_0x93f5('0x53')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x54'),require('./api/openchannelAccount'));_0x3de6ce['use'](_0x93f5('0x55'),require('./api/openchannelApplication'));_0x3de6ce[_0x93f5('0x12')]('/api/openchannel/interactions',require(_0x93f5('0x56')));_0x3de6ce[_0x93f5('0x12')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0x3de6ce[_0x93f5('0x12')]('/api/openchannel/queues',require(_0x93f5('0x57')));_0x3de6ce[_0x93f5('0x12')]('/api/chat/websites',require(_0x93f5('0x58')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x59'),require(_0x93f5('0x5a')));_0x3de6ce['use'](_0x93f5('0x5b'),require('./api/chatApplication'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x5c'),require('./api/chatInteraction'));_0x3de6ce['use'](_0x93f5('0x5d'),require(_0x93f5('0x5e')));_0x3de6ce['use'](_0x93f5('0x5f'),require(_0x93f5('0x60')));_0x3de6ce[_0x93f5('0x12')]('/api/chat/queues',require('./api/chatQueue'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x61'),require('./api/chatGroup'));_0x3de6ce[_0x93f5('0x12')]('/api/chat/proactive_actions',require(_0x93f5('0x62')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x63'),require(_0x93f5('0x64')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x65'),require(_0x93f5('0x66')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x67'),require(_0x93f5('0x68')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x69'),require(_0x93f5('0x6a')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x6b'),require(_0x93f5('0x6c')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x6d'),require(_0x93f5('0x6e')));_0x3de6ce['use'](_0x93f5('0x6f'),require('./api/cmCustomField'));_0x3de6ce['use'](_0x93f5('0x70'),require('./api/action'));_0x3de6ce[_0x93f5('0x12')]('/api/automations',require(_0x93f5('0x71')));_0x3de6ce[_0x93f5('0x12')]('/api/canned_answers',require('./api/cannedAnswer'));_0x3de6ce[_0x93f5('0x12')]('/api/dispositions',require(_0x93f5('0x72')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x73'),require('./api/condition'));_0x3de6ce['use'](_0x93f5('0x74'),require('./api/interval'));_0x3de6ce['use']('/api/pauses',require('./api/pause'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x75'),require(_0x93f5('0x76')));_0x3de6ce[_0x93f5('0x12')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x3de6ce['use'](_0x93f5('0x77'),require(_0x93f5('0x78')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x79'),require(_0x93f5('0x7a')));_0x3de6ce[_0x93f5('0x12')]('/api/tags',require('./api/tag'));_0x3de6ce['use'](_0x93f5('0x7b'),require('./api/template'));_0x3de6ce[_0x93f5('0x12')]('/api/triggers',require(_0x93f5('0x7c')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x7d'),require(_0x93f5('0x7e')));_0x3de6ce['use']('/api/integrations',require(_0x93f5('0x7f')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x80'),require(_0x93f5('0x81')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x82'),require(_0x93f5('0x83')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x84'),require(_0x93f5('0x85')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x86'),require(_0x93f5('0x87')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x88'),require(_0x93f5('0x89')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x8a'),require(_0x93f5('0x8b')));_0x3de6ce[_0x93f5('0x12')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x3de6ce['use'](_0x93f5('0x8c'),require(_0x93f5('0x8d')));_0x3de6ce['use'](_0x93f5('0x8e'),require(_0x93f5('0x8f')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x90'),require(_0x93f5('0x91')));_0x3de6ce['use'](_0x93f5('0x92'),require(_0x93f5('0x93')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x94'),require(_0x93f5('0x95')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x96'),require(_0x93f5('0x97')));_0x3de6ce['use'](_0x93f5('0x98'),require(_0x93f5('0x99')));_0x3de6ce[_0x93f5('0x12')]('/api/integrations/desk/configurations',require(_0x93f5('0x9a')));_0x3de6ce['use']('/api/integrations/desk/fields',require(_0x93f5('0x9b')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x9c'),require('./api/intZohoAccount'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0x9d'),require(_0x93f5('0x9e')));_0x3de6ce['use'](_0x93f5('0x9f'),require(_0x93f5('0xa0')));_0x3de6ce[_0x93f5('0x12')]('/api/integrations/zendesk/accounts',require(_0x93f5('0xa1')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xa2'),require(_0x93f5('0xa3')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xa4'),require('./api/intZendeskField'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xa5'),require('./api/intFreshdeskAccount'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xa6'),require(_0x93f5('0xa7')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xa8'),require(_0x93f5('0xa9')));_0x3de6ce[_0x93f5('0x12')]('/api/integrations/vtiger/accounts',require(_0x93f5('0xaa')));_0x3de6ce['use'](_0x93f5('0xab'),require(_0x93f5('0xac')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xad'),require(_0x93f5('0xae')));_0x3de6ce['use'](_0x93f5('0xaf'),require(_0x93f5('0xb0')));_0x3de6ce['use'](_0x93f5('0xb1'),require(_0x93f5('0xb2')));_0x3de6ce['use']('/api/chat/internal/messages',require(_0x93f5('0xb3')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xb4'),require(_0x93f5('0xb5')));_0x3de6ce['use']('/api/jscripty/questions/reports',require(_0x93f5('0xb6')));_0x3de6ce['use'](_0x93f5('0xb7'),require(_0x93f5('0xb8')));_0x3de6ce['use'](_0x93f5('0xb9'),require('./api/smsQueueReport'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xba'),require(_0x93f5('0xbb')));_0x3de6ce['use'](_0x93f5('0xbc'),require('./api/squareReportDetail'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xbd'),require(_0x93f5('0xbe')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xbf'),require(_0x93f5('0xc0')));_0x3de6ce['use'](_0x93f5('0xc1'),require(_0x93f5('0xc2')));_0x3de6ce[_0x93f5('0x12')]('/api/square/projects',require(_0x93f5('0xc3')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xc4'),require('./api/squareRecording'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xc5'),require(_0x93f5('0xc6')));_0x3de6ce['use'](_0x93f5('0xc7'),require(_0x93f5('0xc8')));_0x3de6ce['use'](_0x93f5('0xc9'),require(_0x93f5('0xca')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xcb'),require('./api/migration'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xcc'),require('./api/attachment'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xcd'),require(_0x93f5('0xce')));_0x3de6ce['use']('/api/mail/reports/transfer',require(_0x93f5('0xcf')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xd0'),require(_0x93f5('0xd1')));_0x3de6ce[_0x93f5('0x12')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xd2'),require('./api/openchannelTransferReport'));_0x3de6ce['use'](_0x93f5('0xd3'),require(_0x93f5('0xd4')));_0x3de6ce[_0x93f5('0x12')]('/api/cm/lists',require(_0x93f5('0xd5')));_0x3de6ce[_0x93f5('0x12')]('/api/voice/prefixes',require(_0x93f5('0xd6')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xd7'),require(_0x93f5('0xd8')));_0x3de6ce['use'](_0x93f5('0xd9'),require('./api/authGoogle'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xda'),require(_0x93f5('0xdb')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xdc'),require(_0x93f5('0xdd')));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xde'),require('./api/version'));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xdf'),require(_0x93f5('0xe0')));_0x3de6ce['use']('/api/pm2',require(_0x93f5('0xe1')));_0x3de6ce['use']('/apidoc',express[_0x93f5('0xe2')](path[_0x93f5('0xe3')](config[_0x93f5('0xe4')],_0x93f5('0xe5'))));_0x3de6ce[_0x93f5('0x12')](_0x93f5('0xe6'),express['static'](path['join'](config[_0x93f5('0xe4')],'/www')));_0x3de6ce['use'](_0x93f5('0xe7'),express[_0x93f5('0xe2')](path[_0x93f5('0xe3')](config[_0x93f5('0xe4')],'/demo')));_0x3de6ce['use'](_0x93f5('0xe8'),express['static'](path[_0x93f5('0xe3')](config[_0x93f5('0xe4')],'snippet',_0x93f5('0xe9'))));_0x3de6ce['use'](_0x93f5('0xea'),express[_0x93f5('0xe2')](path[_0x93f5('0xe3')](config[_0x93f5('0xe4')],_0x93f5('0xeb'))));_0x3de6ce[_0x93f5('0xec')](_0x93f5('0xed'))[_0x93f5('0xee')](errors[0x194]);_0x3de6ce[_0x93f5('0xec')]('/*')[_0x93f5('0xee')](function(_0x146771,_0x5b959e){_0x5b959e['sendFile'](path[_0x93f5('0xef')](_0x3de6ce[_0x93f5('0xee')](_0x93f5('0xf0'))+_0x93f5('0xf1')));});};
\ No newline at end of file
+var _0xf998=['./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerConfiguration','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/teams','./api/team','/api/license','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/auth/local','./api/authLocal','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','./api/pm2','/apidoc','static','join','root','/www','/demo','/snippet','snippet','1.0.10','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','route','get','sendFile','/index.html','path','express-winston','util','./config/logger','api','default','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','url','statusCode','responseTime','user','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','other','agent_name','test','/api/users','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceQueue','/api/voice/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxMessage','/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/sms/messages','/api/sms/queues','/api/openchannel/accounts','./api/openchannelApplication','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','./api/chatOfflineMessage','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/sound','/api/tags','./api/tag','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports'];(function(_0x5774af,_0x411c94){var _0x480589=function(_0x414114){while(--_0x414114){_0x5774af['push'](_0x5774af['shift']());}};_0x480589(++_0x411c94);}(_0xf998,0x6c));var _0x8f99=function(_0x5c3a6a,_0x5e567a){_0x5c3a6a=_0x5c3a6a-0x0;var _0x68d5d6=_0xf998[_0x5c3a6a];return _0x68d5d6;};'use strict';var path=require(_0x8f99('0x0'));var express=require('express');var ewinston=require(_0x8f99('0x1'));var util=require(_0x8f99('0x2'));var errors=require('./errors');var config=require('./config/environment');var logger=require(_0x8f99('0x3'))(_0x8f99('0x4'));var authLogger=require(_0x8f99('0x3'))('auth');exports[_0x8f99('0x5')]=function(_0x375d9c){_0x375d9c[_0x8f99('0x6')](ewinston[_0x8f99('0x7')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x2de4fa,_0x4d80a8){return util[_0x8f99('0x8')](_0x8f99('0x9'),_0x2de4fa[_0x8f99('0xa')],_0x2de4fa[_0x8f99('0xb')][_0x8f99('0xc')]?_0x2de4fa['headers']['x-forwarded-for']:_0x2de4fa['connection']['remoteAddress']||_0x2de4fa['ip'],_0x2de4fa[_0x8f99('0xd')],_0x4d80a8[_0x8f99('0xe')],_0x4d80a8[_0x8f99('0xf')],_0x2de4fa[_0x8f99('0x10')]?_0x2de4fa['user']['id']:null,_0x2de4fa[_0x8f99('0x10')]?_0x2de4fa['user']['name']:null,_0x2de4fa[_0x8f99('0x10')]?_0x2de4fa[_0x8f99('0x10')][_0x8f99('0x11')]:null);}}));_0x375d9c['use'](ewinston[_0x8f99('0x7')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x3e9d8b,_0x4b7bf8){var _0x37a348=_0x8f99('0x12');if(_0x3e9d8b[_0x8f99('0x13')]&&_0x3e9d8b[_0x8f99('0x13')][_0x8f99('0x14')]&&_0x3e9d8b[_0x8f99('0x13')][_0x8f99('0x15')]){_0x37a348=_0x8f99('0x16');}return util[_0x8f99('0x8')](_0x37a348,_0x3e9d8b[_0x8f99('0xa')],_0x3e9d8b[_0x8f99('0xb')][_0x8f99('0xc')]?_0x3e9d8b['headers'][_0x8f99('0xc')]:_0x3e9d8b['connection'][_0x8f99('0x17')]||_0x3e9d8b['ip'],_0x3e9d8b[_0x8f99('0xd')],_0x4b7bf8[_0x8f99('0xe')],_0x4b7bf8[_0x8f99('0xf')],_0x3e9d8b[_0x8f99('0x10')]?_0x3e9d8b[_0x8f99('0x10')]['id']:null,_0x3e9d8b['user']?_0x3e9d8b[_0x8f99('0x10')]['name']:null,_0x3e9d8b[_0x8f99('0x10')]?_0x3e9d8b[_0x8f99('0x10')]['role']:null,_0x3e9d8b['body']&&_0x3e9d8b[_0x8f99('0x13')][_0x8f99('0x14')]?_0x3e9d8b[_0x8f99('0x13')]['device']:_0x8f99('0x18'),_0x3e9d8b[_0x8f99('0x13')]&&_0x3e9d8b[_0x8f99('0x13')][_0x8f99('0x15')]?_0x3e9d8b['body'][_0x8f99('0x15')]:'',_0x3e9d8b[_0x8f99('0x13')]&&_0x3e9d8b[_0x8f99('0x13')]['agent_name']?_0x3e9d8b[_0x8f99('0x13')][_0x8f99('0x19')]:'');},'ignoreRoute':function(_0x16d552){var _0x123783=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x123783[_0x8f99('0x1a')](_0x16d552[_0x8f99('0xd')]);}}));_0x375d9c['use'](_0x8f99('0x1b'),require('./api/user'));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x1c'),require(_0x8f99('0x1d')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x1e'),require(_0x8f99('0x1f')));_0x375d9c['use'](_0x8f99('0x20'),require(_0x8f99('0x21')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x22'),require('./api/voiceMusicOnHold'));_0x375d9c[_0x8f99('0x6')]('/api/voice/queues',require(_0x8f99('0x23')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x24'),require('./api/voiceRecording'));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x25'),require(_0x8f99('0x26')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x27'),require('./api/voiceMailMessage'));_0x375d9c[_0x8f99('0x6')]('/api/voice/calls/reports',require(_0x8f99('0x28')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x29'),require(_0x8f99('0x2a')));_0x375d9c['use'](_0x8f99('0x2b'),require(_0x8f99('0x2c')));_0x375d9c['use'](_0x8f99('0x2d'),require('./api/voiceQueueReport'));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x2e'),require('./api/memberReport'));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x2f'),require(_0x8f99('0x30')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x31'),require('./api/voiceTransferReport'));_0x375d9c['use'](_0x8f99('0x32'),require(_0x8f99('0x33')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x34'),require('./api/mailAccount'));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x35'),require('./api/mailQueue'));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x36'),require(_0x8f99('0x37')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x38'),require(_0x8f99('0x39')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x3a'),require(_0x8f99('0x3b')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x3c'),require(_0x8f99('0x3d')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x3e'),require(_0x8f99('0x3f')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x40'),require('./api/dashboard'));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x41'),require('./api/dashboardItem'));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x42'),require(_0x8f99('0x43')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x44'),require(_0x8f99('0x45')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x46'),require('./api/faxInteraction'));_0x375d9c[_0x8f99('0x6')]('/api/fax/messages',require(_0x8f99('0x47')));_0x375d9c['use'](_0x8f99('0x48'),require(_0x8f99('0x49')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x4a'),require(_0x8f99('0x4b')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x4c'),require(_0x8f99('0x4d')));_0x375d9c['use'](_0x8f99('0x4e'),require(_0x8f99('0x4f')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x50'),require(_0x8f99('0x51')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x52'),require('./api/smsMessage'));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x53'),require('./api/smsQueue'));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x54'),require('./api/openchannelAccount'));_0x375d9c[_0x8f99('0x6')]('/api/openchannel/applications',require(_0x8f99('0x55')));_0x375d9c[_0x8f99('0x6')]('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0x375d9c[_0x8f99('0x6')]('/api/openchannel/messages',require(_0x8f99('0x56')));_0x375d9c[_0x8f99('0x6')]('/api/openchannel/queues',require(_0x8f99('0x57')));_0x375d9c['use'](_0x8f99('0x58'),require('./api/chatWebsite'));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x59'),require(_0x8f99('0x5a')));_0x375d9c['use'](_0x8f99('0x5b'),require(_0x8f99('0x5c')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x5d'),require(_0x8f99('0x5e')));_0x375d9c[_0x8f99('0x6')]('/api/chat/messages',require(_0x8f99('0x5f')));_0x375d9c['use']('/api/chat/offline_messages',require(_0x8f99('0x60')));_0x375d9c[_0x8f99('0x6')]('/api/chat/queues',require('./api/chatQueue'));_0x375d9c['use'](_0x8f99('0x61'),require('./api/chatGroup'));_0x375d9c['use'](_0x8f99('0x62'),require(_0x8f99('0x63')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x64'),require(_0x8f99('0x65')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x66'),require(_0x8f99('0x67')));_0x375d9c['use']('/api/cm/hopper',require(_0x8f99('0x68')));_0x375d9c['use']('/api/cm/hopper_black',require(_0x8f99('0x69')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x6a'),require('./api/cmHopperFinal'));_0x375d9c['use'](_0x8f99('0x6b'),require(_0x8f99('0x6c')));_0x375d9c[_0x8f99('0x6')]('/api/cm/custom_fields',require(_0x8f99('0x6d')));_0x375d9c[_0x8f99('0x6')]('/api/actions',require(_0x8f99('0x6e')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x6f'),require(_0x8f99('0x70')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x71'),require(_0x8f99('0x72')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x73'),require(_0x8f99('0x74')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x75'),require(_0x8f99('0x76')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x77'),require(_0x8f99('0x78')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x79'),require('./api/pause'));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x7a'),require(_0x8f99('0x7b')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x7c'),require(_0x8f99('0x7d')));_0x375d9c['use'](_0x8f99('0x7e'),require('./api/schedule'));_0x375d9c[_0x8f99('0x6')]('/api/sounds',require(_0x8f99('0x7f')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x80'),require(_0x8f99('0x81')));_0x375d9c['use']('/api/templates',require('./api/template'));_0x375d9c[_0x8f99('0x6')]('/api/triggers',require(_0x8f99('0x82')));_0x375d9c['use'](_0x8f99('0x83'),require('./api/variable'));_0x375d9c['use'](_0x8f99('0x84'),require(_0x8f99('0x85')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x86'),require('./api/integrationReport'));_0x375d9c['use'](_0x8f99('0x87'),require(_0x8f99('0x88')));_0x375d9c['use'](_0x8f99('0x89'),require('./api/analyticDefaultReport'));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x8a'),require(_0x8f99('0x8b')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x8c'),require(_0x8f99('0x8d')));_0x375d9c['use'](_0x8f99('0x8e'),require('./api/analyticFieldReport'));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x8f'),require(_0x8f99('0x90')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x91'),require(_0x8f99('0x92')));_0x375d9c[_0x8f99('0x6')]('/api/integrations/salesforce/configurations',require(_0x8f99('0x93')));_0x375d9c[_0x8f99('0x6')]('/api/integrations/salesforce/fields',require(_0x8f99('0x94')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x95'),require(_0x8f99('0x96')));_0x375d9c['use'](_0x8f99('0x97'),require('./api/intSugarcrmConfiguration'));_0x375d9c['use'](_0x8f99('0x98'),require('./api/intSugarcrmField'));_0x375d9c[_0x8f99('0x6')]('/api/integrations/desk/accounts',require(_0x8f99('0x99')));_0x375d9c['use'](_0x8f99('0x9a'),require(_0x8f99('0x9b')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0x9c'),require(_0x8f99('0x9d')));_0x375d9c['use'](_0x8f99('0x9e'),require(_0x8f99('0x9f')));_0x375d9c['use']('/api/integrations/zoho/configurations',require(_0x8f99('0xa0')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xa1'),require(_0x8f99('0xa2')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xa3'),require(_0x8f99('0xa4')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xa5'),require(_0x8f99('0xa6')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xa7'),require(_0x8f99('0xa8')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xa9'),require('./api/intFreshdeskAccount'));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xaa'),require('./api/intFreshdeskConfiguration'));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xab'),require(_0x8f99('0xac')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xad'),require('./api/intVtigerAccount'));_0x375d9c['use']('/api/integrations/vtiger/configurations',require(_0x8f99('0xae')));_0x375d9c['use']('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x375d9c['use']('/api/networks',require(_0x8f99('0xaf')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xb0'),require(_0x8f99('0xb1')));_0x375d9c[_0x8f99('0x6')]('/api/chat/internal/messages',require(_0x8f99('0xb2')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xb3'),require(_0x8f99('0xb4')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xb5'),require(_0x8f99('0xb6')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xb7'),require(_0x8f99('0xb8')));_0x375d9c['use'](_0x8f99('0xb9'),require(_0x8f99('0xba')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xbb'),require('./api/squareReport'));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xbc'),require(_0x8f99('0xbd')));_0x375d9c[_0x8f99('0x6')]('/api/jscripty/projects',require(_0x8f99('0xbe')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xbf'),require(_0x8f99('0xc0')));_0x375d9c['use'](_0x8f99('0xc1'),require('./api/squareOdbc'));_0x375d9c['use'](_0x8f99('0xc2'),require(_0x8f99('0xc3')));_0x375d9c['use'](_0x8f99('0xc4'),require(_0x8f99('0xc5')));_0x375d9c['use'](_0x8f99('0xc6'),require(_0x8f99('0xc7')));_0x375d9c['use'](_0x8f99('0xc8'),require('./api/license'));_0x375d9c[_0x8f99('0x6')]('/api/campaigns',require(_0x8f99('0xc9')));_0x375d9c[_0x8f99('0x6')]('/api/migrations',require(_0x8f99('0xca')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xcb'),require(_0x8f99('0xcc')));_0x375d9c['use'](_0x8f99('0xcd'),require(_0x8f99('0xce')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xcf'),require('./api/mailTransferReport'));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xd0'),require(_0x8f99('0xd1')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xd2'),require(_0x8f99('0xd3')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xd4'),require('./api/openchannelTransferReport'));_0x375d9c['use'](_0x8f99('0xd5'),require(_0x8f99('0xd6')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xd7'),require('./api/cmList'));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xd8'),require(_0x8f99('0xd9')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xda'),require(_0x8f99('0xdb')));_0x375d9c[_0x8f99('0x6')]('/api/auth/google',require('./api/authGoogle'));_0x375d9c['use'](_0x8f99('0xdc'),require(_0x8f99('0xdd')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xde'),require(_0x8f99('0xdf')));_0x375d9c[_0x8f99('0x6')]('/api/version',require(_0x8f99('0xe0')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xe1'),require(_0x8f99('0xe2')));_0x375d9c[_0x8f99('0x6')]('/api/pm2',require(_0x8f99('0xe3')));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xe4'),express[_0x8f99('0xe5')](path[_0x8f99('0xe6')](config[_0x8f99('0xe7')],_0x8f99('0xe4'))));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xe8'),express[_0x8f99('0xe5')](path[_0x8f99('0xe6')](config[_0x8f99('0xe7')],_0x8f99('0xe8'))));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xe9'),express[_0x8f99('0xe5')](path['join'](config[_0x8f99('0xe7')],_0x8f99('0xe9'))));_0x375d9c[_0x8f99('0x6')](_0x8f99('0xea'),express[_0x8f99('0xe5')](path['join'](config[_0x8f99('0xe7')],_0x8f99('0xeb'),_0x8f99('0xec'))));_0x375d9c['use'](_0x8f99('0xed'),express[_0x8f99('0xe5')](path[_0x8f99('0xe6')](config[_0x8f99('0xe7')],_0x8f99('0xee'))));_0x375d9c['route'](_0x8f99('0xef'))['get'](errors[0x194]);_0x375d9c[_0x8f99('0xf0')]('/*')[_0x8f99('0xf1')](function(_0x1a6161,_0x135c2f){_0x135c2f[_0x8f99('0xf2')](path['resolve'](_0x375d9c['get']('appPath')+_0x8f99('0xf3')));});};
\ No newline at end of file
index c0492df..0c22b7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ed7=['../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','server','rpc','port','localhost','error','log','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc'];(function(_0x435eca,_0xee7714){var _0x3dd6d9=function(_0x2a1981){while(--_0x2a1981){_0x435eca['push'](_0x435eca['shift']());}};_0x3dd6d9(++_0xee7714);}(_0x0ed7,0xba));var _0x70ed=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x0ed7[_0x491a7f];return _0x3d8f44;};'use strict';var jayson=require(_0x70ed('0x0'));var BPromise=require(_0x70ed('0x1'));var _=require(_0x70ed('0x2'));var config=require(_0x70ed('0x3'));exports[_0x70ed('0x4')]=function(){return new BPromise(function(_0x259b59,_0x548e27){var _0x22efac={};_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x6')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x7')));_0x22efac=_['merge'](_0x22efac,require(_0x70ed('0x8')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x9')));_0x22efac=_['merge'](_0x22efac,require(_0x70ed('0xa')));_0x22efac=_['merge'](_0x22efac,require(_0x70ed('0xb')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0xc')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0xd')));_0x22efac=_['merge'](_0x22efac,require('../api/trunk/trunk.rpc'));_0x22efac=_['merge'](_0x22efac,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x22efac=_['merge'](_0x22efac,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0xe')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0xf')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x10')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x11')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x12')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x13')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x22efac=_['merge'](_0x22efac,require(_0x70ed('0x14')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require('../api/faxApplication/faxApplication.rpc'));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require('../api/faxInteraction/faxInteraction.rpc'));_0x22efac=_['merge'](_0x22efac,require('../api/faxMessage/faxMessage.rpc'));_0x22efac=_['merge'](_0x22efac,require(_0x70ed('0x15')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x16')));_0x22efac=_['merge'](_0x22efac,require(_0x70ed('0x17')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x18')));_0x22efac=_['merge'](_0x22efac,require(_0x70ed('0x19')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x1a')));_0x22efac=_['merge'](_0x22efac,require(_0x70ed('0x1b')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x1c')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x22efac=_['merge'](_0x22efac,require(_0x70ed('0x1d')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x1e')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x1f')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x20')));_0x22efac=_['merge'](_0x22efac,require(_0x70ed('0x21')));_0x22efac=_['merge'](_0x22efac,require('../api/cmHopper/cmHopper.rpc'));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x22')));_0x22efac=_['merge'](_0x22efac,require(_0x70ed('0x23')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x24')));_0x22efac=_['merge'](_0x22efac,require(_0x70ed('0x25')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x26')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x27')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x28')));_0x22efac=_['merge'](_0x22efac,require(_0x70ed('0x29')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x2a')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x2b')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x2c')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x2d')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x2e')));_0x22efac=_['merge'](_0x22efac,require(_0x70ed('0x2f')));_0x22efac=_['merge'](_0x22efac,require(_0x70ed('0x30')));_0x22efac=_['merge'](_0x22efac,require(_0x70ed('0x31')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x32')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x33')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x34')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x35')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x36')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x37')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x38')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require(_0x70ed('0x39')));_0x22efac=_['merge'](_0x22efac,require(_0x70ed('0x3a')));_0x22efac=_[_0x70ed('0x5')](_0x22efac,require('../api/plugin/plugin.rpc'));var _0x155935=jayson[_0x70ed('0x3b')](_0x22efac)['http']();var _0x3ef6c5=config[_0x70ed('0x3c')]['port']||config[_0x70ed('0x3d')]+0x1;var _0x365931=config['rpc']['ip']||_0x70ed('0x3e');_0x155935['on'](_0x70ed('0x3f'),function(_0x48b8dc){return _0x548e27(_0x48b8dc);});_0x155935[_0x70ed('0x4')](_0x3ef6c5,_0x365931,function(){console[_0x70ed('0x40')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x365931,_0x3ef6c5);require('../config/triggers')['default']();return _0x259b59(_0x70ed('0x41')+_0x365931+':'+_0x3ef6c5);});});};
\ No newline at end of file
+var _0x905d=['../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','http','rpc','port','localhost','error','log','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x905d,0x141));var _0xd905=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x905d[_0x2dafbe];return _0x58a45a;};'use strict';var jayson=require(_0xd905('0x0'));var BPromise=require(_0xd905('0x1'));var _=require(_0xd905('0x2'));var config=require(_0xd905('0x3'));exports[_0xd905('0x4')]=function(){return new BPromise(function(_0x536c44,_0x311bfd){var _0x10b5f={};_0x10b5f=_['merge'](_0x10b5f,require(_0xd905('0x5')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x7')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x8')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x9')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0xa')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x10b5f=_['merge'](_0x10b5f,require('../api/memberReport/memberReport.rpc'));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0xb')));_0x10b5f=_['merge'](_0x10b5f,require(_0xd905('0xc')));_0x10b5f=_['merge'](_0x10b5f,require(_0xd905('0xd')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0xe')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require('../api/mailAccount/mailAccount.rpc'));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0xf')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require('../api/mailInteraction/mailInteraction.rpc'));_0x10b5f=_['merge'](_0x10b5f,require(_0xd905('0x10')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require('../api/mailApplication/mailApplication.rpc'));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x11')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x12')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x13')));_0x10b5f=_['merge'](_0x10b5f,require(_0xd905('0x14')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x15')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x16')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x17')));_0x10b5f=_['merge'](_0x10b5f,require('../api/smsAccount/smsAccount.rpc'));_0x10b5f=_['merge'](_0x10b5f,require(_0xd905('0x18')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require('../api/smsMessage/smsMessage.rpc'));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require('../api/smsQueue/smsQueue.rpc'));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x19')));_0x10b5f=_['merge'](_0x10b5f,require(_0xd905('0x1a')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x1b')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x1c')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x1d')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x1e')));_0x10b5f=_['merge'](_0x10b5f,require(_0xd905('0x1f')));_0x10b5f=_['merge'](_0x10b5f,require(_0xd905('0x20')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require('../api/cmHopper/cmHopper.rpc'));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x21')));_0x10b5f=_['merge'](_0x10b5f,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x10b5f=_['merge'](_0x10b5f,require(_0xd905('0x22')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require('../api/interval/interval.rpc'));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x23')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require('../api/sound/sound.rpc'));_0x10b5f=_['merge'](_0x10b5f,require(_0xd905('0x24')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x25')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x26')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x27')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x28')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x29')));_0x10b5f=_['merge'](_0x10b5f,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x2a')));_0x10b5f=_['merge'](_0x10b5f,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x2b')));_0x10b5f=_['merge'](_0x10b5f,require(_0xd905('0x2c')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x2d')));_0x10b5f=_['merge'](_0x10b5f,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x2e')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x2f')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require('../api/squareRecording/squareRecording.rpc'));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x30')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x31')));_0x10b5f=_[_0xd905('0x6')](_0x10b5f,require(_0xd905('0x32')));var _0x15364c=jayson['server'](_0x10b5f)[_0xd905('0x33')]();var _0x37174f=config[_0xd905('0x34')][_0xd905('0x35')]||config[_0xd905('0x35')]+0x1;var _0x4c984d=config[_0xd905('0x34')]['ip']||_0xd905('0x36');_0x15364c['on'](_0xd905('0x37'),function(_0x525a78){return _0x311bfd(_0x525a78);});_0x15364c[_0xd905('0x4')](_0x37174f,_0x4c984d,function(){console[_0xd905('0x38')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x4c984d,_0x37174f);require(_0xd905('0x39'))[_0xd905('0x3a')]();return _0x536c44(_0xd905('0x3b')+_0x4c984d+':'+_0x37174f);});});};
\ No newline at end of file
index fd9d45e..dfd4043 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ab1=['sendRequest','sync','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','setPriority','HANGUP','setVariable','toString','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','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','agi','AGI','wait','WAIT','label','exports','util','events','EventEmitter','./error','call','setEncoding','utf8','setTimeout','headers','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','length','match','emit','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','inherits','prototype'];(function(_0x1c9491,_0x2ba00b){var _0x2c3512=function(_0x4a70ef){while(--_0x4a70ef){_0x1c9491['push'](_0x1c9491['shift']());}};_0x2c3512(++_0x2ba00b);}(_0x4ab1,0xc5));var _0x14ab=function(_0x2e4d6b,_0x2750de){_0x2e4d6b=_0x2e4d6b-0x0;var _0x121440=_0x4ab1[_0x2e4d6b];return _0x121440;};'use strict';var util=require(_0x14ab('0x0'));var _=require('lodash');var EventEmitter=require(_0x14ab('0x1'))[_0x14ab('0x2')];var AGIReply=require('./reply');var AGIError=require(_0x14ab('0x3'));function AGIChannel(_0x5375cc){var _0xed0e87=this,_0x438289=new AGIReply(),_0x3f9749=![],_0x2362a3={};EventEmitter[_0x14ab('0x4')](_0xed0e87);_0x5375cc[_0x14ab('0x5')](_0x14ab('0x6'));_0x5375cc[_0x14ab('0x7')](0x8*0x3c*0x3c*0x3e8);_0x438289[_0x14ab('0x5')](_0x14ab('0x6'));_0x438289['on'](_0x14ab('0x8'),function(_0x594987){for(var _0x9fee85 in _0x594987){_0xed0e87[_0x9fee85]=_0x594987[_0x9fee85];}_0xed0e87['emit'](_0x14ab('0x9'));});_0x438289['on'](_0x14ab('0xa'),function(_0x23f71c){if(_0x23f71c['toLowerCase']()==_0x14ab('0xb')){_0xed0e87['emit'](_0x14ab('0xb'));return;}if(_0x23f71c[_0x14ab('0xc')](0x0,0xb)==_0x14ab('0xd')){_0x3f9749=!![];}if(_0x3f9749){_0x2362a3['rx']+=_0x23f71c+'\x0a';if(_0x23f71c[_0x14ab('0xe')](_0x14ab('0xf'))!=-0x1){_0x3f9749=![];}}else{_0x2362a3['rx']=_0x23f71c;}if(_0x3f9749){return;}if(typeof _0x2362a3['cb']==_0x14ab('0x10')){var _0x5131ea=_0x2362a3['rx'][_0x14ab('0xc')](0x0,0x3),_0x492952=null,_0x144898=null;_0x5131ea=parseInt(_0x5131ea);if(isNaN(_0x5131ea)){_0x2362a3['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x14ab('0x11')});return;}if(_0x5131ea!=0xc8){_0x2362a3['cb'](null,{'code':_0x5131ea,'result':-0x1,'extra':'KO'});return;}_0x492952=_0x2362a3['rx'][_0x14ab('0xc')](0x4)[_0x14ab('0x12')](_0x14ab('0x13'),'');if(_0x492952[_0x14ab('0x14')]('\x20')!=-0x1){_0x492952=_0x492952[_0x14ab('0x15')](0x0,_0x492952['indexOf']('\x20'));}if(_[_0x14ab('0x16')](_0x492952,'-1')){_0x492952=parseInt(_0x492952);}_0x144898=_0x2362a3['rx']['split']('\x20');if(_0x144898[_0x14ab('0x17')]==0x3){_0x144898=_0x144898[0x2]['substring'](0x1,_0x144898[0x2][_0x14ab('0x17')]-0x1);}else if(_0x144898[_0x14ab('0x17')]>0x3){var _0x553a7c=/\((.+)\)/;var _0x263b6c=_0x2362a3['rx'][_0x14ab('0x18')](_0x553a7c);if(_0x263b6c){_0x144898=_0x263b6c[0x1];}else{_0x144898=null;}}else{_0x144898=null;}_0x2362a3['cb'](null,{'code':_0x5131ea,'result':_0x492952,'extra':_0x144898});}});_0x5375cc['on']('error',function(_0x208f1e){_0xed0e87[_0x14ab('0x19')](_0x14ab('0x1a'),new AGIError('E_AGI_SOCKET_ERROR',_0x208f1e[_0x14ab('0x1b')]));});_0x5375cc['on'](_0x14ab('0x1c'),function(){_0xed0e87[_0x14ab('0x19')](_0x14ab('0x1c'),new AGIError(_0x14ab('0x1d')));});_0x5375cc['on'](_0x14ab('0x1e'),function(){_0xed0e87[_0x14ab('0x19')](_0x14ab('0x1e'),new AGIError(_0x14ab('0x1f')));_0x5375cc[_0x14ab('0x20')]();});_0x5375cc[_0x14ab('0x21')](_0x438289);this[_0x14ab('0x22')]=function(_0x28b6dd,_0x228d4f){var _0x28b6dd=_0x28b6dd||'',_0x228d4f=typeof _0x228d4f==_0x14ab('0x10')?_0x228d4f:new Function();_0x2362a3={'tx':_0x28b6dd,'rx':'','cb':_0x228d4f};_0x5375cc['write'](_0x28b6dd+'\x0a');},this[_0x14ab('0x1c')]=function(){_0x5375cc[_0x14ab('0x20')]();};}util[_0x14ab('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x14ab('0x24')][_0x14ab('0x25')]=function(_0x5a1954){return this[_0x14ab('0x22')][_0x14ab('0x26')](this,_0x5a1954);};AGIChannel[_0x14ab('0x24')][_0x14ab('0x27')]=function(){return this[_0x14ab('0x25')](_0x14ab('0x28'));};AGIChannel[_0x14ab('0x24')][_0x14ab('0x29')]=function(_0x56e838,_0x5d8cfd,_0x4171e0){_0x56e838=_0x56e838===undefined?_0x14ab('0x2a'):_0x56e838;_0x5d8cfd=_0x5d8cfd===undefined?'5':_0x5d8cfd;_0x4171e0=_0x4171e0===undefined?'1':_0x4171e0;return this[_0x14ab('0x25')](util[_0x14ab('0x2b')](_0x14ab('0x2c'),_0x56e838,_0x5d8cfd*0x3e8,_0x4171e0));};AGIChannel[_0x14ab('0x24')][_0x14ab('0x2d')]=function(_0x2b59ac){_0x2b59ac=_0x2b59ac||_0x14ab('0x2e');return this[_0x14ab('0x25')](util[_0x14ab('0x2b')](_0x14ab('0x2f'),_0x2b59ac));};AGIChannel[_0x14ab('0x24')][_0x14ab('0x30')]=function(_0x20610a,_0x1fb43e){if(_[_0x14ab('0x31')](_0x1fb43e)){return this[_0x14ab('0x25')](util[_0x14ab('0x2b')](_0x14ab('0x32'),_0x20610a,_0x1fb43e[_0x14ab('0x33')](',')));}return this[_0x14ab('0x25')](util[_0x14ab('0x2b')](_0x14ab('0x32'),_0x20610a,_0x1fb43e));};AGIChannel[_0x14ab('0x24')][_0x14ab('0x34')]=function(_0x101510){return this[_0x14ab('0x25')](util[_0x14ab('0x2b')]('SET\x20CONTEXT\x20%s',_0x101510));};AGIChannel['prototype'][_0x14ab('0x35')]=function(_0x2beb35){return this[_0x14ab('0x25')](util[_0x14ab('0x2b')]('SET\x20EXTENSION\x20%s',_0x2beb35));};AGIChannel['prototype'][_0x14ab('0x36')]=function(_0x25cab4){return this[_0x14ab('0x25')](util[_0x14ab('0x2b')]('SET\x20PRIORITY\x20%s',_0x25cab4));};AGIChannel[_0x14ab('0x24')][_0x14ab('0xb')]=function(){return this[_0x14ab('0x25')](_0x14ab('0x37'));};AGIChannel[_0x14ab('0x24')][_0x14ab('0x38')]=function(_0x313d0f,_0x125073){return this[_0x14ab('0x25')](util[_0x14ab('0x2b')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x313d0f,_0x125073?_0x125073[_0x14ab('0x39')]()[_0x14ab('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x14ab('0x3a')]=function(_0x129b30,_0x36ee70){return this[_0x14ab('0x25')](util['format']('SAY\x20NUMBER\x20%s\x20%s',_0x129b30,_0x36ee70));};AGIChannel[_0x14ab('0x24')][_0x14ab('0x3b')]=function(_0x4957a0,_0x32bcce){return this['sendRequest'](util['format'](_0x14ab('0x3c'),_0x4957a0,_0x32bcce));};AGIChannel[_0x14ab('0x24')][_0x14ab('0x3d')]=function(_0x3fbd0e,_0x2e7673){return this[_0x14ab('0x25')](util[_0x14ab('0x2b')](_0x14ab('0x3e'),_0x3fbd0e,_0x2e7673));};AGIChannel['prototype'][_0x14ab('0x3f')]=function(_0x5c26f1,_0x1b52a5,_0x12b3a3){_0x1b52a5=_0x1b52a5||this[_0x14ab('0x40')];_0x12b3a3=_0x12b3a3||0x1;this[_0x14ab('0x34')](_0x5c26f1);this[_0x14ab('0x35')](_0x1b52a5);this[_0x14ab('0x36')](_0x12b3a3);return this[_0x14ab('0x2d')](util[_0x14ab('0x2b')](_0x14ab('0x41'),_0x5c26f1,_0x1b52a5,_0x12b3a3));};AGIChannel['prototype']['getVariable']=function(_0x20d08e){return this[_0x14ab('0x25')](util[_0x14ab('0x2b')](_0x14ab('0x42'),_0x20d08e));};AGIChannel['prototype'][_0x14ab('0x43')]=function(_0x2b6bc8,_0x3a3051,_0x394b78,_0x32869d,_0x262a3a,_0x2c4203){_0x3a3051=_0x3a3051||_0x14ab('0x44');_0x394b78=_0x394b78||'';_0x32869d=_0x32869d===undefined?-0x1:_0x32869d==='-1'?-0x1:_0x32869d*0x3e8;_0x262a3a=_0x262a3a===undefined?'':'s='+_0x262a3a;_0x2c4203=_0x2c4203?_0x14ab('0x45'):'';return this[_0x14ab('0x25')](util[_0x14ab('0x2b')](_0x14ab('0x46'),_0x2b6bc8,_0x3a3051,_0x394b78,_0x32869d,_0x2c4203,_0x262a3a));};AGIChannel[_0x14ab('0x24')][_0x14ab('0x47')]=function(_0x345fa3,_0x5b2ae6){_0x5b2ae6=_0x5b2ae6||'';return this[_0x14ab('0x25')](util[_0x14ab('0x2b')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x345fa3,_0x5b2ae6));};AGIChannel[_0x14ab('0x24')][_0x14ab('0x48')]=function(_0x331614){return this[_0x14ab('0x30')](_0x14ab('0x49'),_0x331614);};AGIChannel[_0x14ab('0x24')][_0x14ab('0x4a')]=function(_0x5de1aa){return this[_0x14ab('0x30')](_0x14ab('0x4b'),_0x5de1aa);};AGIChannel[_0x14ab('0x24')][_0x14ab('0x1a')]=function(_0x456012,_0x576eb2){this[_0x14ab('0x2d')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x456012['id'],_0x456012[_0x14ab('0x4c')],_0x576eb2));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x14ab('0x4d')]=AGIChannel;
\ No newline at end of file
+var _0x458e=['code','close','timeout','E_AGI_SOCKET_TIMEOUT','pipe','write','destroy','inherits','sendRequest','command','sync','prototype','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','lodash','./reply','./error','call','setEncoding','utf8','setTimeout','emit','ready','line','toLowerCase','hangup','substring','search','function','no\x20code','replace','result=','indexOf','startsWith','length','match','error','E_AGI_SOCKET_ERROR'];(function(_0xbb2e25,_0x30535e){var _0xf49318=function(_0x86428d){while(--_0x86428d){_0xbb2e25['push'](_0xbb2e25['shift']());}};_0xf49318(++_0x30535e);}(_0x458e,0x1aa));var _0xe458=function(_0x596586,_0x4df4da){_0x596586=_0x596586-0x0;var _0x3dee5a=_0x458e[_0x596586];return _0x3dee5a;};'use strict';var util=require('util');var _=require(_0xe458('0x0'));var EventEmitter=require('events')['EventEmitter'];var AGIReply=require(_0xe458('0x1'));var AGIError=require(_0xe458('0x2'));function AGIChannel(_0x36974f){var _0x6ec6ca=this,_0x3d1fd7=new AGIReply(),_0x38338d=![],_0x17e0cc={};EventEmitter[_0xe458('0x3')](_0x6ec6ca);_0x36974f[_0xe458('0x4')](_0xe458('0x5'));_0x36974f[_0xe458('0x6')](0x8*0x3c*0x3c*0x3e8);_0x3d1fd7[_0xe458('0x4')]('utf8');_0x3d1fd7['on']('headers',function(_0x5ea698){for(var _0x3bfe25 in _0x5ea698){_0x6ec6ca[_0x3bfe25]=_0x5ea698[_0x3bfe25];}_0x6ec6ca[_0xe458('0x7')](_0xe458('0x8'));});_0x3d1fd7['on'](_0xe458('0x9'),function(_0x1a9863){if(_0x1a9863[_0xe458('0xa')]()=='hangup'){_0x6ec6ca[_0xe458('0x7')](_0xe458('0xb'));return;}if(_0x1a9863[_0xe458('0xc')](0x0,0xb)=='520-Invalid'){_0x38338d=!![];}if(_0x38338d){_0x17e0cc['rx']+=_0x1a9863+'\x0a';if(_0x1a9863[_0xe458('0xd')]('520\x20End\x20of\x20proper')!=-0x1){_0x38338d=![];}}else{_0x17e0cc['rx']=_0x1a9863;}if(_0x38338d){return;}if(typeof _0x17e0cc['cb']==_0xe458('0xe')){var _0x6f41cc=_0x17e0cc['rx'][_0xe458('0xc')](0x0,0x3),_0x330cf4=null,_0x12f61a=null;_0x6f41cc=parseInt(_0x6f41cc);if(isNaN(_0x6f41cc)){_0x17e0cc['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xe458('0xf')});return;}if(_0x6f41cc!=0xc8){_0x17e0cc['cb'](null,{'code':_0x6f41cc,'result':-0x1,'extra':'KO'});return;}_0x330cf4=_0x17e0cc['rx']['substring'](0x4)[_0xe458('0x10')](_0xe458('0x11'),'');if(_0x330cf4['indexOf']('\x20')!=-0x1){_0x330cf4=_0x330cf4['substr'](0x0,_0x330cf4[_0xe458('0x12')]('\x20'));}if(_[_0xe458('0x13')](_0x330cf4,'-1')){_0x330cf4=parseInt(_0x330cf4);}_0x12f61a=_0x17e0cc['rx']['split']('\x20');if(_0x12f61a[_0xe458('0x14')]==0x3){_0x12f61a=_0x12f61a[0x2][_0xe458('0xc')](0x1,_0x12f61a[0x2][_0xe458('0x14')]-0x1);}else if(_0x12f61a[_0xe458('0x14')]>0x3){var _0xa90940=/\((.+)\)/;var _0x31dc55=_0x17e0cc['rx'][_0xe458('0x15')](_0xa90940);if(_0x31dc55){_0x12f61a=_0x31dc55[0x1];}else{_0x12f61a=null;}}else{_0x12f61a=null;}_0x17e0cc['cb'](null,{'code':_0x6f41cc,'result':_0x330cf4,'extra':_0x12f61a});}});_0x36974f['on']('error',function(_0x714b1){_0x6ec6ca[_0xe458('0x7')](_0xe458('0x16'),new AGIError(_0xe458('0x17'),_0x714b1[_0xe458('0x18')]));});_0x36974f['on'](_0xe458('0x19'),function(){_0x6ec6ca['emit'](_0xe458('0x19'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x36974f['on'](_0xe458('0x1a'),function(){_0x6ec6ca[_0xe458('0x7')](_0xe458('0x1a'),new AGIError(_0xe458('0x1b')));_0x36974f['destroy']();});_0x36974f[_0xe458('0x1c')](_0x3d1fd7);this['command']=function(_0x4832a6,_0x539a8a){var _0x4832a6=_0x4832a6||'',_0x539a8a=typeof _0x539a8a=='function'?_0x539a8a:new Function();_0x17e0cc={'tx':_0x4832a6,'rx':'','cb':_0x539a8a};_0x36974f[_0xe458('0x1d')](_0x4832a6+'\x0a');},this[_0xe458('0x19')]=function(){_0x36974f[_0xe458('0x1e')]();};}util[_0xe458('0x1f')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xe458('0x20')]=function(_0x53b9d1){return this[_0xe458('0x21')][_0xe458('0x22')](this,_0x53b9d1);};AGIChannel[_0xe458('0x23')][_0xe458('0x24')]=function(){return this[_0xe458('0x20')](_0xe458('0x25'));};AGIChannel[_0xe458('0x23')][_0xe458('0x26')]=function(_0x108cdc,_0x27b1d9,_0x4b42ec){_0x108cdc=_0x108cdc===undefined?_0xe458('0x27'):_0x108cdc;_0x27b1d9=_0x27b1d9===undefined?'5':_0x27b1d9;_0x4b42ec=_0x4b42ec===undefined?'1':_0x4b42ec;return this['sendRequest'](util[_0xe458('0x28')](_0xe458('0x29'),_0x108cdc,_0x27b1d9*0x3e8,_0x4b42ec));};AGIChannel[_0xe458('0x23')][_0xe458('0x2a')]=function(_0x408434){_0x408434=_0x408434||_0xe458('0x2b');return this[_0xe458('0x20')](util[_0xe458('0x28')](_0xe458('0x2c'),_0x408434));};AGIChannel[_0xe458('0x23')][_0xe458('0x2d')]=function(_0x4e92c7,_0x8fd934){if(_[_0xe458('0x2e')](_0x8fd934)){return this[_0xe458('0x20')](util[_0xe458('0x28')]('EXEC\x20%s\x20%s',_0x4e92c7,_0x8fd934[_0xe458('0x2f')](',')));}return this[_0xe458('0x20')](util['format'](_0xe458('0x30'),_0x4e92c7,_0x8fd934));};AGIChannel[_0xe458('0x23')][_0xe458('0x31')]=function(_0x210585){return this[_0xe458('0x20')](util['format'](_0xe458('0x32'),_0x210585));};AGIChannel['prototype'][_0xe458('0x33')]=function(_0x300e3a){return this[_0xe458('0x20')](util['format'](_0xe458('0x34'),_0x300e3a));};AGIChannel[_0xe458('0x23')][_0xe458('0x35')]=function(_0x3a8aa7){return this[_0xe458('0x20')](util[_0xe458('0x28')]('SET\x20PRIORITY\x20%s',_0x3a8aa7));};AGIChannel[_0xe458('0x23')]['hangup']=function(){return this[_0xe458('0x20')](_0xe458('0x36'));};AGIChannel[_0xe458('0x23')][_0xe458('0x37')]=function(_0x2c7dbf,_0x1371e4){return this[_0xe458('0x20')](util['format'](_0xe458('0x38'),_0x2c7dbf,_0x1371e4?_0x1371e4[_0xe458('0x39')]()[_0xe458('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xe458('0x23')][_0xe458('0x3a')]=function(_0x34ac3f,_0x43bdd7){return this[_0xe458('0x20')](util[_0xe458('0x28')](_0xe458('0x3b'),_0x34ac3f,_0x43bdd7));};AGIChannel[_0xe458('0x23')]['sayDigits']=function(_0x1c3d9b,_0x174673){return this['sendRequest'](util[_0xe458('0x28')](_0xe458('0x3c'),_0x1c3d9b,_0x174673));};AGIChannel[_0xe458('0x23')]['sayPhonetic']=function(_0x599109,_0x421688){return this[_0xe458('0x20')](util[_0xe458('0x28')](_0xe458('0x3d'),_0x599109,_0x421688));};AGIChannel[_0xe458('0x23')]['continueAt']=function(_0x5c4d22,_0x3d92a5,_0x2d95bb){_0x3d92a5=_0x3d92a5||this[_0xe458('0x3e')];_0x2d95bb=_0x2d95bb||0x1;this[_0xe458('0x31')](_0x5c4d22);this[_0xe458('0x33')](_0x3d92a5);this[_0xe458('0x35')](_0x2d95bb);return this[_0xe458('0x2a')](util[_0xe458('0x28')](_0xe458('0x3f'),_0x5c4d22,_0x3d92a5,_0x2d95bb));};AGIChannel[_0xe458('0x23')][_0xe458('0x40')]=function(_0x2d860c){return this['sendRequest'](util[_0xe458('0x28')]('GET\x20VARIABLE\x20\x22%s\x22',_0x2d860c));};AGIChannel[_0xe458('0x23')][_0xe458('0x41')]=function(_0x1b6527,_0x4a6ce7,_0x25f1cb,_0x5d4742,_0x3fe3e1,_0x135cf0){_0x4a6ce7=_0x4a6ce7||_0xe458('0x42');_0x25f1cb=_0x25f1cb||'';_0x5d4742=_0x5d4742===undefined?-0x1:_0x5d4742==='-1'?-0x1:_0x5d4742*0x3e8;_0x3fe3e1=_0x3fe3e1===undefined?'':'s='+_0x3fe3e1;_0x135cf0=_0x135cf0?'BEEP':'';return this[_0xe458('0x20')](util[_0xe458('0x28')](_0xe458('0x43'),_0x1b6527,_0x4a6ce7,_0x25f1cb,_0x5d4742,_0x135cf0,_0x3fe3e1));};AGIChannel[_0xe458('0x23')]['streamFile']=function(_0x2991c9,_0x27006c){_0x27006c=_0x27006c||'';return this[_0xe458('0x20')](util[_0xe458('0x28')](_0xe458('0x44'),_0x2991c9,_0x27006c));};AGIChannel[_0xe458('0x23')][_0xe458('0x45')]=function(_0x178245){return this[_0xe458('0x2d')](_0xe458('0x46'),_0x178245);};AGIChannel[_0xe458('0x23')][_0xe458('0x47')]=function(_0x5d22e0){return this[_0xe458('0x2d')](_0xe458('0x48'),_0x5d22e0);};AGIChannel[_0xe458('0x23')][_0xe458('0x16')]=function(_0x551f7d,_0x1f6c78){this['noop'](util[_0xe458('0x28')](_0xe458('0x49'),_0x551f7d['id'],_0x551f7d[_0xe458('0x4a')],_0x1f6c78));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel;
\ No newline at end of file
index c98d88b..509f32c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6593=['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.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','apply'];(function(_0x4392af,_0xec5afe){var _0x9fa8eb=function(_0x41d7a4){while(--_0x41d7a4){_0x4392af['push'](_0x4392af['shift']());}};_0x9fa8eb(++_0xec5afe);}(_0x6593,0x146));var _0x3659=function(_0x536256,_0x237fb5){_0x536256=_0x536256-0x0;var _0x1675f7=_0x6593[_0x536256];return _0x1675f7;};'use strict';var util=require(_0x3659('0x0'));var error={'E_AGI_UNDEFINED':_0x3659('0x1'),'E_AGI_ARGUMENT_PORT':_0x3659('0x2'),'E_AGI_SERVER_ERROR':_0x3659('0x3'),'E_AGI_SERVER_CLOSE':_0x3659('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x3659('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x3659('0x6'),'E_AGI_SOCKET_ERROR':_0x3659('0x7'),'E_AGI_SOCKET_CLOSE':_0x3659('0x8'),'E_AGI_SOCKET_TIMEOUT':_0x3659('0x9'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x3659('0xa'),'E_AGI_IVR_ENTRY':_0x3659('0xb')};function AGIError(_0x2d62e8){var _0x2d62e8=_0x2d62e8||null,_0x103614=_0x103614||[],_0x244728=0x1,_0x57a1ae='';if(!error[_0x2d62e8]){_0x2d62e8='E_AGI_UNDEFINED';}_0x103614[_0x3659('0xc')](error[_0x2d62e8]);while(arguments[_0x244728]){_0x103614[_0x3659('0xc')](arguments[_0x244728]);_0x244728++;}_0x57a1ae=util['format'][_0x3659('0xd')](util,_0x103614);this[_0x3659('0xe')]=_0x57a1ae;this[_0x3659('0xf')]=_0x2d62e8;}module[_0x3659('0x10')]=AGIError;
\ No newline at end of file
+var _0x9817=['Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20timeout.','Missing\x20\x27ivr.entry\x27\x20menu.','push','name','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.'];(function(_0x48fdf7,_0x25f112){var _0x5c0a3b=function(_0x232964){while(--_0x232964){_0x48fdf7['push'](_0x48fdf7['shift']());}};_0x5c0a3b(++_0x25f112);}(_0x9817,0xf0));var _0x7981=function(_0x4cd585,_0x449d33){_0x4cd585=_0x4cd585-0x0;var _0x29cd43=_0x9817[_0x4cd585];return _0x29cd43;};'use strict';var util=require(_0x7981('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x7981('0x1'),'E_AGI_SERVER_ERROR':_0x7981('0x2'),'E_AGI_SERVER_CLOSE':_0x7981('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x7981('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x7981('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x7981('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x7981('0x7')};function AGIError(_0x54c493){var _0x54c493=_0x54c493||null,_0x4ebaed=_0x4ebaed||[],_0x5b37ee=0x1,_0x43cd11='';if(!error[_0x54c493]){_0x54c493='E_AGI_UNDEFINED';}_0x4ebaed['push'](error[_0x54c493]);while(arguments[_0x5b37ee]){_0x4ebaed[_0x7981('0x8')](arguments[_0x5b37ee]);_0x5b37ee++;}_0x43cd11=util['format']['apply'](util,_0x4ebaed);this['message']=_0x43cd11;this[_0x7981('0x9')]=_0x54c493;}module[_0x7981('0xa')]=AGIError;
\ No newline at end of file
index e416a1e..e274699 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x174b=['getsecretdigits','vertices','edges','numberOfEdges','prototype','addEdge','push','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','info','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default\x20on\x20switch\x20not\x20found','condition\x20not\x20found','exports','lodash','menu','getdigits'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x174b,0x19d));var _0xb174=function(_0x3dd39b,_0x5bba6c){_0x3dd39b=_0x3dd39b-0x0;var _0x451f01=_0x174b[_0x3dd39b];return _0x451f01;};'use strict';var _=require(_0xb174('0x0'));var logger=require('../../../config/logger')('agi');var verticesWithRetry=[_0xb174('0x1'),_0xb174('0x2'),_0xb174('0x3')];var Graph=function(){this[_0xb174('0x4')]={};this[_0xb174('0x5')]={};this[_0xb174('0x6')]=0x0;};Graph['prototype']['addVertex']=function(_0x1bfe22){this[_0xb174('0x4')][_0x1bfe22['id']]=_0x1bfe22;this[_0xb174('0x5')][_0x1bfe22['id']]=[];};Graph[_0xb174('0x7')][_0xb174('0x8')]=function(_0x1e3e13,_0x465cd6,_0x149942){this[_0xb174('0x5')][_0x1e3e13][_0xb174('0x9')]({'target':_0x465cd6,'condition':_0x149942});this['numberOfEdges']+=0x1;};Graph[_0xb174('0x7')]['size']=function(){return _[_0xb174('0xa')](this[_0xb174('0x4')]);};Graph['prototype'][_0xb174('0xb')]=function(){return this['numberOfEdges'];};Graph[_0xb174('0x7')][_0xb174('0xc')]=function(_0x4bd275){return this[_0xb174('0x4')][_0x4bd275];};Graph[_0xb174('0x7')][_0xb174('0xd')]=function(_0x344326,_0x533741){if(!this[_0xb174('0x4')][_0x344326]){return logger['info'](_0xb174('0xe'));}var _0x2a5c42=_0x533741(this[_0xb174('0x4')][_0x344326]);if(!_0x2a5c42){return logger[_0xb174('0xf')]('stop\x20traverse');}if(this[_0xb174('0x5')][_0x344326][_0xb174('0x10')]===0x0){return logger[_0xb174('0xf')](_0xb174('0x11'));}for(var _0x12c2c5=0x0,_0x2cb9a8=[],_0x5d31ac=![];_0x12c2c5<this['edges'][_0x344326]['length'];_0x12c2c5+=0x1){if(this['edges'][_0x344326][_0x12c2c5][_0xb174('0x12')]){_0x2cb9a8=this['edges'][_0x344326][_0x12c2c5][_0xb174('0x12')][_0xb174('0x13')](',');for(var _0x5ac337=0x0;_0x5ac337<_0x2cb9a8[_0xb174('0x10')];_0x5ac337+=0x1){if(this[_0xb174('0x4')][_0x344326][_0xb174('0x14')]===_0xb174('0x15')&&_0x2cb9a8[_0x5ac337]==='-'){_0x5d31ac=this[_0xb174('0x5')][_0x344326][_0x12c2c5][_0xb174('0x16')];logger[_0xb174('0xf')]('default',_0x2cb9a8[_0x5ac337],this[_0xb174('0x5')][_0x344326][_0x12c2c5][_0xb174('0x16')]);}else if(this['vertices'][_0x344326]['agicommand']==='menu'&&_0x2cb9a8[_0x5ac337]==='i'){_0x5d31ac=this[_0xb174('0x5')][_0x344326][_0x12c2c5][_0xb174('0x16')];logger[_0xb174('0xf')]('invalid',_0x2cb9a8[_0x5ac337],this[_0xb174('0x5')][_0x344326][_0x12c2c5][_0xb174('0x16')]);}if(_0x2cb9a8[_0x5ac337]===_0x2a5c42){return this[_0xb174('0xd')](this['edges'][_0x344326][_0x12c2c5][_0xb174('0x16')],_0x533741);}}}else{return this[_0xb174('0xd')](this[_0xb174('0x5')][_0x344326][_0x12c2c5][_0xb174('0x16')],_0x533741);}}if(_0x2cb9a8[_0xb174('0x10')]){if(this['vertices'][_0x344326][_0xb174('0x14')]==='vswitch'){if(_0x5d31ac){return this[_0xb174('0xd')](_0x5d31ac,_0x533741);}return logger[_0xb174('0xf')](_0xb174('0x17'));}else if(_['includes'](verticesWithRetry,this['vertices'][_0x344326][_0xb174('0x14')])){if(_0x2a5c42==='-'){return logger[_0xb174('0xf')]('max\x20retry\x20reach');}if(_0x5d31ac&&_0x2a5c42!=='t'){return this['traverseBFS'](_0x5d31ac,_0x533741);}return this[_0xb174('0xd')](_0x344326,_0x533741);}return logger['info'](_0xb174('0x18'));}};module[_0xb174('0x19')]=Graph;
\ No newline at end of file
+var _0x96cc=['lodash','agi','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','getVertex','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','agicommand','vswitch','target','default','menu','traverseBFS','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','exports'];(function(_0x592921,_0x1eb72f){var _0x4619bc=function(_0x1131f8){while(--_0x1131f8){_0x592921['push'](_0x592921['shift']());}};_0x4619bc(++_0x1eb72f);}(_0x96cc,0x16c));var _0xc96c=function(_0x58fe01,_0x42ccdf){_0x58fe01=_0x58fe01-0x0;var _0x758a11=_0x96cc[_0x58fe01];return _0x758a11;};'use strict';var _=require(_0xc96c('0x0'));var logger=require('../../../config/logger')(_0xc96c('0x1'));var verticesWithRetry=['menu',_0xc96c('0x2'),_0xc96c('0x3')];var Graph=function(){this[_0xc96c('0x4')]={};this[_0xc96c('0x5')]={};this[_0xc96c('0x6')]=0x0;};Graph[_0xc96c('0x7')][_0xc96c('0x8')]=function(_0x7b632c){this[_0xc96c('0x4')][_0x7b632c['id']]=_0x7b632c;this['edges'][_0x7b632c['id']]=[];};Graph[_0xc96c('0x7')][_0xc96c('0x9')]=function(_0x408afb,_0x86c1a8,_0x13363d){this[_0xc96c('0x5')][_0x408afb][_0xc96c('0xa')]({'target':_0x86c1a8,'condition':_0x13363d});this['numberOfEdges']+=0x1;};Graph[_0xc96c('0x7')][_0xc96c('0xb')]=function(){return _[_0xc96c('0xb')](this['vertices']);};Graph[_0xc96c('0x7')]['relations']=function(){return this[_0xc96c('0x6')];};Graph['prototype'][_0xc96c('0xc')]=function(_0x32f682){return this[_0xc96c('0x4')][_0x32f682];};Graph[_0xc96c('0x7')]['traverseBFS']=function(_0x3fe3d5,_0x43fcaa){if(!this[_0xc96c('0x4')][_0x3fe3d5]){return logger[_0xc96c('0xd')]('no\x20vertex\x20found');}var _0x35da94=_0x43fcaa(this[_0xc96c('0x4')][_0x3fe3d5]);if(!_0x35da94){return logger[_0xc96c('0xd')](_0xc96c('0xe'));}if(this[_0xc96c('0x5')][_0x3fe3d5][_0xc96c('0xf')]===0x0){return logger[_0xc96c('0xd')](_0xc96c('0x10'));}for(var _0x174852=0x0,_0x4248c9=[],_0x861230=![];_0x174852<this['edges'][_0x3fe3d5]['length'];_0x174852+=0x1){if(this[_0xc96c('0x5')][_0x3fe3d5][_0x174852][_0xc96c('0x11')]){_0x4248c9=this[_0xc96c('0x5')][_0x3fe3d5][_0x174852][_0xc96c('0x11')]['split'](',');for(var _0x2c4c83=0x0;_0x2c4c83<_0x4248c9[_0xc96c('0xf')];_0x2c4c83+=0x1){if(this[_0xc96c('0x4')][_0x3fe3d5][_0xc96c('0x12')]===_0xc96c('0x13')&&_0x4248c9[_0x2c4c83]==='-'){_0x861230=this[_0xc96c('0x5')][_0x3fe3d5][_0x174852][_0xc96c('0x14')];logger[_0xc96c('0xd')](_0xc96c('0x15'),_0x4248c9[_0x2c4c83],this[_0xc96c('0x5')][_0x3fe3d5][_0x174852][_0xc96c('0x14')]);}else if(this[_0xc96c('0x4')][_0x3fe3d5][_0xc96c('0x12')]===_0xc96c('0x16')&&_0x4248c9[_0x2c4c83]==='i'){_0x861230=this[_0xc96c('0x5')][_0x3fe3d5][_0x174852][_0xc96c('0x14')];logger[_0xc96c('0xd')]('invalid',_0x4248c9[_0x2c4c83],this[_0xc96c('0x5')][_0x3fe3d5][_0x174852][_0xc96c('0x14')]);}if(_0x4248c9[_0x2c4c83]===_0x35da94){return this[_0xc96c('0x17')](this[_0xc96c('0x5')][_0x3fe3d5][_0x174852][_0xc96c('0x14')],_0x43fcaa);}}}else{return this[_0xc96c('0x17')](this[_0xc96c('0x5')][_0x3fe3d5][_0x174852][_0xc96c('0x14')],_0x43fcaa);}}if(_0x4248c9[_0xc96c('0xf')]){if(this[_0xc96c('0x4')][_0x3fe3d5]['agicommand']===_0xc96c('0x13')){if(_0x861230){return this[_0xc96c('0x17')](_0x861230,_0x43fcaa);}return logger[_0xc96c('0xd')](_0xc96c('0x18'));}else if(_['includes'](verticesWithRetry,this['vertices'][_0x3fe3d5][_0xc96c('0x12')])){if(_0x35da94==='-'){return logger[_0xc96c('0xd')](_0xc96c('0x19'));}if(_0x861230&&_0x35da94!=='t'){return this[_0xc96c('0x17')](_0x861230,_0x43fcaa);}return this[_0xc96c('0x17')](_0x3fe3d5,_0x43fcaa);}return logger[_0xc96c('0xd')](_0xc96c('0x1a'));}};module[_0xc96c('0x1b')]=Graph;
\ No newline at end of file
index b9f5b41..100adff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb633=['Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','./server','0.0.0.0','listening','connection','xml2json','lodash','syncho','util','moment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','nextTick','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','[LISTENING]\x20Cally\x20Square\x20listening\x200.0.0.0:4573','format','[%s]\x20%s','name','message','[ERROR]\x20%s','stack','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','root','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','value','then','createSquareReport','catch','indexOf','inspect','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','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','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','response','isUndefined','agicommand\x20not\x20found','finally','clear','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','close','Project\x20%s\x20not\x20published','continueAt'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xb633,0x1be));var _0x3b63=function(_0x40f9a9,_0x171ffd){_0x40f9a9=_0x40f9a9-0x0;var _0x39672c=_0xb633[_0x40f9a9];return _0x39672c;};'use strict';var parser=require(_0x3b63('0x0'));var _=require(_0x3b63('0x1'));var syncho=require(_0x3b63('0x2'));var util=require(_0x3b63('0x3'));var moment=require(_0x3b63('0x4'));var config=require('../../config/environment');var logger=require(_0x3b63('0x5'))(_0x3b63('0x6'));var utilLicense=require(_0x3b63('0x7'));var rpc=require(_0x3b63('0x8'));var mailRpc=require(_0x3b63('0x9'));var Graph=require(_0x3b63('0xa'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function connectionHandler(_0x3151b5){process[_0x3b63('0xb')](function(){syncho(function(){try{setChannelVariables(_0x3151b5);agiHandler(_0x3151b5);}catch(_0x43d739){logger[_0x3b63('0xc')](_0x43d739['stack']);}});});}function listeningHandler(_0x289047){console[_0x3b63('0xd')](_0x3b63('0xe'),0x11dd);logger[_0x3b63('0xf')](_0x3b63('0x10'));}function errorHandler(_0x529aa4){if(_0x529aa4&&_0x529aa4['name']&&_0x529aa4['message']){logger[_0x3b63('0xc')](util[_0x3b63('0x11')](_0x3b63('0x12'),_0x529aa4[_0x3b63('0x13')],_0x529aa4[_0x3b63('0x14')]));}else{logger[_0x3b63('0xc')](util[_0x3b63('0x11')](_0x3b63('0x15'),_0x529aa4[_0x3b63('0x16')]));}}function closeHandler(){logger['info'](util[_0x3b63('0x11')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x3b63('0x17')],this[_0x3b63('0x18')],this[_0x3b63('0x19')],this[_0x3b63('0x1a')],this[_0x3b63('0x1b')]));try{createSquareReport(this);}catch(_0x822e8f){logger[_0x3b63('0xc')](_0x822e8f[_0x3b63('0x16')]);}}function timeoutHandler(){logger['info'](util[_0x3b63('0x11')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x3b63('0x17')],this[_0x3b63('0x18')],this['callerid'],this['dnid'],this[_0x3b63('0x1b')]));}function hangupHandler(){logger[_0x3b63('0xf')](util[_0x3b63('0x11')](_0x3b63('0x1c'),this['arg_1'],this[_0x3b63('0x18')],this[_0x3b63('0x19')],this['dnid'],this[_0x3b63('0x1b')]));this[_0x3b63('0x1d')]=!![];}function getRoot(_0xc4768f){return parser[_0x3b63('0x1e')](_0xc4768f,{'object':!![]})['mxGraphModel'][_0x3b63('0x1f')];}function addVertex(_0x31b552,_0x54ba34,_0x318983){_0x54ba34[_0x3b63('0x20')]=_0x318983;if(_0x54ba34[_0x3b63('0x21')](_0x3b63('0x22'))){_0x54ba34['maxRetry']=parseInt(_0x54ba34[_0x3b63('0x22')],0xa);}_0x31b552[_0x3b63('0x23')](_[_0x3b63('0x24')](_0x54ba34,_0x3b63('0x25')));}function initGraph(_0x5e9695,_0x18454a){var _0x5ddd3e=new Graph();for(var _0x2439c6 in _0x5e9695){if(_0x5e9695[_0x3b63('0x21')](_0x2439c6)){if(_[_0x3b63('0x26')](_0x5e9695[_0x2439c6])){for(var _0x1ba97b=0x0;_0x1ba97b<_0x5e9695[_0x2439c6][_0x3b63('0x27')];_0x1ba97b+=0x1){addVertex(_0x5ddd3e,_0x5e9695[_0x2439c6][_0x1ba97b],_0x2439c6);}}else{addVertex(_0x5ddd3e,_0x5e9695[_0x2439c6],_0x2439c6);}}}for(var _0x5c0232=0x0;_0x5c0232<_0x18454a[_0x3b63('0x27')];_0x5c0232+=0x1){if(_0x18454a[_0x5c0232][_0x3b63('0x28')]&&_0x18454a[_0x5c0232][_0x3b63('0x29')]){_0x5ddd3e['addEdge'](_0x18454a[_0x5c0232]['source'],_0x18454a[_0x5c0232][_0x3b63('0x29')],_0x18454a[_0x5c0232][_0x3b63('0x2a')]);}}return _0x5ddd3e;}function getSquareProject(_0x1b7062,_0x50ceb5){rpc['getSquareProject'](_0x1b7062)[_0x3b63('0x2b')](function(_0x7fc1a7){_0x50ceb5(null,_0x7fc1a7);})['catch'](function(_0x319ed0){_0x50ceb5(null,_0x319ed0);});}function createSquareReport(_0x41c7f4,_0x2937d6){rpc[_0x3b63('0x2c')](_0x41c7f4)[_0x3b63('0x2b')](function(_0x229958){if(_0x2937d6){_0x2937d6(null,_0x229958);}})[_0x3b63('0x2d')](function(_0x133446){if(_0x2937d6){_0x2937d6(null,_0x133446);}});}function setChannelVariables(_0x487960){for(var _0x1fc107 in _0x487960){if(_0x487960[_0x3b63('0x21')](_0x1fc107)){if(_0x1fc107[_0x3b63('0x2e')]('agi_')===0x0){_0x487960[_0x1fc107['substring'](0x4)]=_0x487960[_0x1fc107];delete _0x487960[_0x1fc107];}}}}function getLogFromObject(_0x454273){return util[_0x3b63('0x2f')](_0x454273,{'showHidden':![],'depth':null});}function agiHandler(_0x2cf47d){var _0x5cf085,_0x133f52,_0x49ba27,_0x533a13,_0x3c1d98;logger['debug']('variables',JSON[_0x3b63('0x30')](_0x2cf47d,null,0x2));logger[_0x3b63('0xf')](util[_0x3b63('0x11')](_0x3b63('0x31'),_0x2cf47d[_0x3b63('0x17')],_0x2cf47d[_0x3b63('0x18')],_0x2cf47d[_0x3b63('0x19')],_0x2cf47d['dnid'],_0x2cf47d[_0x3b63('0x1b')]));_0x2cf47d['on']('error',errorHandler);_0x2cf47d['on']('close',closeHandler);_0x2cf47d['on']('timeout',timeoutHandler);_0x2cf47d['evtHangup']=![];_0x2cf47d['on']('hangup',hangupHandler);var _0x3c642c=getSquareProject[_0x3b63('0x32')](null,_0x2cf47d['arg_1']);if(_0x3c642c){if(_0x3c642c[_0x3b63('0x33')]){_0x5cf085=getRoot(_0x3c642c[_0x3b63('0x33')]);if(_0x5cf085&&_0x5cf085[_0x3b63('0x34')]){logger[_0x3b63('0x35')](_0x3b63('0x1f'),JSON[_0x3b63('0x30')](_0x5cf085,null,0x2));_0x2cf47d[_0x3b63('0x36')]=moment()[_0x3b63('0x11')](_0x3b63('0x37'));_0x133f52=initGraph(_[_0x3b63('0x24')](_0x5cf085,_0x3b63('0x25')),_0x5cf085['mxCell']);_0x49ba27=new Vertices(_0x2cf47d,rpc,mailRpc);logger[_0x3b63('0xf')](util[_0x3b63('0x11')](_0x3b63('0x38'),_0x2cf47d[_0x3b63('0x17')],_0x2cf47d['calleridname'],_0x2cf47d[_0x3b63('0x19')],_0x2cf47d[_0x3b63('0x1a')],_0x2cf47d[_0x3b63('0x1b')]));_0x133f52[_0x3b63('0x39')](_0x5cf085[_0x3b63('0x34')]['id'],function(_0x1f17e9){try{_0x1f17e9=_0x49ba27['clear'](_0x1f17e9);logger[_0x3b63('0x35')]('vertex',JSON[_0x3b63('0x30')](_0x1f17e9,null,0x2));if(_0x1f17e9[_0x3b63('0x20')]===_0x3b63('0x3a')){logger['info'](_0x3b63('0x3b'));_0x2cf47d['context']=_0x1f17e9[_0x3b63('0x3c')]||_0x2cf47d[_0x3b63('0x3c')];_0x2cf47d[_0x3b63('0x3d')]=_0x1f17e9[_0x3b63('0x3d')];_0x2cf47d[_0x3b63('0x3e')]=_0x1f17e9[_0x3b63('0x3e')]?_0x1f17e9[_0x3b63('0x3e')]-0x1:0x1;return null;}else if(_0x1f17e9&&_0x49ba27[_0x1f17e9['agicommand']]){_0x3c1d98=_0x49ba27[_0x1f17e9['agicommand']](_0x1f17e9);logger[_0x3b63('0xf')]('response',JSON[_0x3b63('0x30')](_0x3c1d98,null,0x2));if(_0x3c1d98&&_0x3c1d98[_0x3b63('0x3f')]===AGI_CODE_SUCCESS&&_0x3c1d98[_0x3b63('0x40')]!==AGI_RESULT_ERROR&&!_0x2cf47d[_0x3b63('0x1d')]){logger[_0x3b63('0x35')](_0x3b63('0x41'),getLogFromObject(_0x3c1d98));return _[_0x3b63('0x42')](_0x3c1d98[_0x3b63('0x40')])?null:_0x3c1d98['result']['toString']();}else{logger[_0x3b63('0xc')]('response',getLogFromObject(_0x3c1d98));return null;}}else{logger[_0x3b63('0xc')](_0x3b63('0x43'));return null;}}catch(_0x2bff49){logger['error'](_0x2bff49['stack']);return null;}});if(_0x5cf085[_0x3b63('0x44')]){logger[_0x3b63('0xf')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2cf47d[_0x3b63('0x17')],_0x2cf47d['calleridname'],_0x2cf47d[_0x3b63('0x19')],_0x2cf47d['dnid'],_0x2cf47d['uniqueid']));_0x133f52[_0x3b63('0x39')](_0x5cf085[_0x3b63('0x44')]['id'],function(_0x5bd657){try{_0x5bd657=_0x49ba27[_0x3b63('0x45')](_0x5bd657);logger['debug'](_0x3b63('0x46'),JSON[_0x3b63('0x30')](_0x5bd657,null,0x2));if(_0x5bd657&&_0x49ba27[_0x5bd657[_0x3b63('0x20')]]){_0x3c1d98=_0x49ba27[_0x5bd657[_0x3b63('0x20')]](_0x5bd657);if(_0x3c1d98){logger[_0x3b63('0x35')]('response',getLogFromObject(_0x3c1d98));return _[_0x3b63('0x42')](_0x3c1d98[_0x3b63('0x40')])?null:_0x3c1d98[_0x3b63('0x40')]['toString']();}else{logger['error'](_0x3b63('0x41'),getLogFromObject(_0x3c1d98));return null;}}else{logger[_0x3b63('0xc')](_0x3b63('0x43'));return null;}}catch(_0x168292){logger[_0x3b63('0xc')](_0x168292['stack']);return null;}});}logger[_0x3b63('0xf')](util[_0x3b63('0x11')](_0x3b63('0x47'),_0x2cf47d[_0x3b63('0x17')],_0x2cf47d[_0x3b63('0x18')],_0x2cf47d[_0x3b63('0x19')],_0x2cf47d[_0x3b63('0x1a')],_0x2cf47d[_0x3b63('0x1b')]));logger[_0x3b63('0xf')](util[_0x3b63('0x11')](_0x3b63('0x48'),_0x2cf47d[_0x3b63('0x3c')],_0x2cf47d[_0x3b63('0x3d')],parseInt(_0x2cf47d[_0x3b63('0x3e')],0xa)+0x1));_0x2cf47d['continueAt'](_0x2cf47d[_0x3b63('0x3c')],_0x2cf47d[_0x3b63('0x3d')],parseInt(_0x2cf47d[_0x3b63('0x3e')],0xa)+0x1);_0x2cf47d[_0x3b63('0x49')]();}}else{logger[_0x3b63('0xc')](util[_0x3b63('0x11')](_0x3b63('0x4a'),_0x2cf47d[_0x3b63('0x17')]));_0x2cf47d[_0x3b63('0x4b')](_0x2cf47d[_0x3b63('0x3c')],_0x2cf47d['extension'],parseInt(_0x2cf47d[_0x3b63('0x3e')],0xa)+0x1);_0x2cf47d[_0x3b63('0x49')]();}}else{logger[_0x3b63('0xc')](util[_0x3b63('0x11')](_0x3b63('0x4c'),_0x2cf47d[_0x3b63('0x17')]));_0x2cf47d[_0x3b63('0x4b')](_0x2cf47d['context'],_0x2cf47d['extension'],parseInt(_0x2cf47d[_0x3b63('0x3e')],0xa)+0x1);_0x2cf47d[_0x3b63('0x49')]();}}function main(){var _0x6600d2;return utilLicense[_0x3b63('0x4d')]()['then'](function(_0x156289){if(_0x156289){if(_0x156289[_0x3b63('0x4e')]){if(_0x156289[_0x3b63('0x4f')]&&_0x156289['callysquare']>0x0){logger[_0x3b63('0xf')](util[_0x3b63('0x11')](_0x3b63('0x50'),_0x156289[_0x3b63('0x4f')]));_0x6600d2=_0x156289[_0x3b63('0x4f')];}else{logger[_0x3b63('0xf')](_0x3b63('0x51'));}}else{logger[_0x3b63('0xf')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x6600d2=-0x1;}}})[_0x3b63('0x2d')](function(_0x623702){logger['error'](_0x3b63('0x52'),_0x623702[_0x3b63('0x16')]);})[_0x3b63('0x44')](function(){var _0x47df44=require(_0x3b63('0x53'))(0x11dd,_0x3b63('0x54'),_0x6600d2);_0x47df44['on'](_0x3b63('0xc'),errorHandler);_0x47df44['on'](_0x3b63('0x55'),listeningHandler);_0x47df44['on'](_0x3b63('0x56'),connectionHandler);_0x47df44['on'](_0x3b63('0x49'),closeHandler);});}main();
\ No newline at end of file
+var _0xfc13=['debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','hangup','sync','production','start','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','response','isUndefined','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[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','close','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','./server','listening','connection','xml2json','lodash','util','moment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','name','message','error','format','[%s]\x20%s','[ERROR]\x20%s','dnid','uniqueid','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','omit','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring'];(function(_0x513605,_0xb88346){var _0x3c6b73=function(_0x39c874){while(--_0x39c874){_0x513605['push'](_0x513605['shift']());}};_0x3c6b73(++_0xb88346);}(_0xfc13,0xcd));var _0x3fc1=function(_0x462fc7,_0x4abe72){_0x462fc7=_0x462fc7-0x0;var _0x6f3f10=_0xfc13[_0x462fc7];return _0x6f3f10;};'use strict';var parser=require(_0x3fc1('0x0'));var _=require(_0x3fc1('0x1'));var syncho=require('syncho');var util=require(_0x3fc1('0x2'));var moment=require(_0x3fc1('0x3'));var config=require('../../config/environment');var logger=require(_0x3fc1('0x4'))(_0x3fc1('0x5'));var utilLicense=require(_0x3fc1('0x6'));var rpc=require(_0x3fc1('0x7'));var mailRpc=require(_0x3fc1('0x8'));var Graph=require(_0x3fc1('0x9'));var Vertices=require(_0x3fc1('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function connectionHandler(_0x4c516c){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x4c516c);agiHandler(_0x4c516c);}catch(_0x470c79){logger['error'](_0x470c79[_0x3fc1('0xb')]);}});});}function listeningHandler(_0xc2eb58){console[_0x3fc1('0xc')](_0x3fc1('0xd'),0x11dd);logger[_0x3fc1('0xe')]('[LISTENING]\x20Cally\x20Square\x20listening\x200.0.0.0:4573');}function errorHandler(_0x42e075){if(_0x42e075&&_0x42e075[_0x3fc1('0xf')]&&_0x42e075[_0x3fc1('0x10')]){logger[_0x3fc1('0x11')](util[_0x3fc1('0x12')](_0x3fc1('0x13'),_0x42e075[_0x3fc1('0xf')],_0x42e075['message']));}else{logger[_0x3fc1('0x11')](util[_0x3fc1('0x12')](_0x3fc1('0x14'),_0x42e075[_0x3fc1('0xb')]));}}function closeHandler(){logger['info'](util[_0x3fc1('0x12')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this['callerid'],this[_0x3fc1('0x15')],this[_0x3fc1('0x16')]));try{createSquareReport(this);}catch(_0x55f89f){logger[_0x3fc1('0x11')](_0x55f89f['stack']);}}function timeoutHandler(){logger[_0x3fc1('0xe')](util[_0x3fc1('0x12')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x3fc1('0x17')],this['callerid'],this[_0x3fc1('0x15')],this[_0x3fc1('0x16')]));}function hangupHandler(){logger[_0x3fc1('0xe')](util['format'](_0x3fc1('0x18'),this[_0x3fc1('0x19')],this[_0x3fc1('0x17')],this[_0x3fc1('0x1a')],this[_0x3fc1('0x15')],this[_0x3fc1('0x16')]));this[_0x3fc1('0x1b')]=!![];}function getRoot(_0x4ba9e3){return parser[_0x3fc1('0x1c')](_0x4ba9e3,{'object':!![]})[_0x3fc1('0x1d')][_0x3fc1('0x1e')];}function addVertex(_0x5478f9,_0x5ab480,_0x4fde3f){_0x5ab480[_0x3fc1('0x1f')]=_0x4fde3f;if(_0x5ab480[_0x3fc1('0x20')](_0x3fc1('0x21'))){_0x5ab480[_0x3fc1('0x22')]=parseInt(_0x5ab480['retry'],0xa);}_0x5478f9['addVertex'](_[_0x3fc1('0x23')](_0x5ab480,_0x3fc1('0x24')));}function initGraph(_0x266713,_0x58e07d){var _0x5af0c4=new Graph();for(var _0x54736f in _0x266713){if(_0x266713[_0x3fc1('0x20')](_0x54736f)){if(_[_0x3fc1('0x25')](_0x266713[_0x54736f])){for(var _0x935447=0x0;_0x935447<_0x266713[_0x54736f][_0x3fc1('0x26')];_0x935447+=0x1){addVertex(_0x5af0c4,_0x266713[_0x54736f][_0x935447],_0x54736f);}}else{addVertex(_0x5af0c4,_0x266713[_0x54736f],_0x54736f);}}}for(var _0x477b6e=0x0;_0x477b6e<_0x58e07d['length'];_0x477b6e+=0x1){if(_0x58e07d[_0x477b6e][_0x3fc1('0x27')]&&_0x58e07d[_0x477b6e][_0x3fc1('0x28')]){_0x5af0c4[_0x3fc1('0x29')](_0x58e07d[_0x477b6e][_0x3fc1('0x27')],_0x58e07d[_0x477b6e][_0x3fc1('0x28')],_0x58e07d[_0x477b6e][_0x3fc1('0x2a')]);}}return _0x5af0c4;}function getSquareProject(_0x4df3ca,_0x42644c){rpc[_0x3fc1('0x2b')](_0x4df3ca)[_0x3fc1('0x2c')](function(_0x4a066f){_0x42644c(null,_0x4a066f);})[_0x3fc1('0x2d')](function(_0x5d544d){_0x42644c(null,_0x5d544d);});}function createSquareReport(_0x38ddfb,_0xc2aedb){rpc[_0x3fc1('0x2e')](_0x38ddfb)[_0x3fc1('0x2c')](function(_0x1da054){if(_0xc2aedb){_0xc2aedb(null,_0x1da054);}})[_0x3fc1('0x2d')](function(_0x2b2bc7){if(_0xc2aedb){_0xc2aedb(null,_0x2b2bc7);}});}function setChannelVariables(_0x48a79c){for(var _0x49ffc1 in _0x48a79c){if(_0x48a79c['hasOwnProperty'](_0x49ffc1)){if(_0x49ffc1[_0x3fc1('0x2f')](_0x3fc1('0x30'))===0x0){_0x48a79c[_0x49ffc1[_0x3fc1('0x31')](0x4)]=_0x48a79c[_0x49ffc1];delete _0x48a79c[_0x49ffc1];}}}}function getLogFromObject(_0x4ef46e){return util['inspect'](_0x4ef46e,{'showHidden':![],'depth':null});}function agiHandler(_0x191c6c){var _0x594814,_0x280b31,_0x39d887,_0x1a6e91,_0x1ca1c5;logger[_0x3fc1('0x32')]('variables',JSON[_0x3fc1('0x33')](_0x191c6c,null,0x2));logger[_0x3fc1('0xe')](util[_0x3fc1('0x12')](_0x3fc1('0x34'),_0x191c6c[_0x3fc1('0x19')],_0x191c6c[_0x3fc1('0x17')],_0x191c6c[_0x3fc1('0x1a')],_0x191c6c['dnid'],_0x191c6c['uniqueid']));_0x191c6c['on'](_0x3fc1('0x11'),errorHandler);_0x191c6c['on']('close',closeHandler);_0x191c6c['on']('timeout',timeoutHandler);_0x191c6c[_0x3fc1('0x1b')]=![];_0x191c6c['on'](_0x3fc1('0x35'),hangupHandler);var _0x10289f=getSquareProject[_0x3fc1('0x36')](null,_0x191c6c[_0x3fc1('0x19')]);if(_0x10289f){if(_0x10289f['production']){_0x594814=getRoot(_0x10289f[_0x3fc1('0x37')]);if(_0x594814&&_0x594814[_0x3fc1('0x38')]){logger[_0x3fc1('0x32')]('root',JSON['stringify'](_0x594814,null,0x2));_0x191c6c['joinAt']=moment()[_0x3fc1('0x12')](_0x3fc1('0x39'));_0x280b31=initGraph(_[_0x3fc1('0x23')](_0x594814,_0x3fc1('0x24')),_0x594814[_0x3fc1('0x24')]);_0x39d887=new Vertices(_0x191c6c,rpc,mailRpc);logger[_0x3fc1('0xe')](util['format'](_0x3fc1('0x3a'),_0x191c6c[_0x3fc1('0x19')],_0x191c6c[_0x3fc1('0x17')],_0x191c6c[_0x3fc1('0x1a')],_0x191c6c[_0x3fc1('0x15')],_0x191c6c[_0x3fc1('0x16')]));_0x280b31[_0x3fc1('0x3b')](_0x594814[_0x3fc1('0x38')]['id'],function(_0x5a9c4f){try{_0x5a9c4f=_0x39d887[_0x3fc1('0x3c')](_0x5a9c4f);logger[_0x3fc1('0x32')](_0x3fc1('0x3d'),JSON[_0x3fc1('0x33')](_0x5a9c4f,null,0x2));if(_0x5a9c4f[_0x3fc1('0x1f')]===_0x3fc1('0x3e')){logger[_0x3fc1('0xe')](_0x3fc1('0x3f'));_0x191c6c[_0x3fc1('0x40')]=_0x5a9c4f[_0x3fc1('0x40')]||_0x191c6c[_0x3fc1('0x40')];_0x191c6c[_0x3fc1('0x41')]=_0x5a9c4f['extension'];_0x191c6c['priority']=_0x5a9c4f['priority']?_0x5a9c4f[_0x3fc1('0x42')]-0x1:0x1;return null;}else if(_0x5a9c4f&&_0x39d887[_0x5a9c4f[_0x3fc1('0x1f')]]){_0x1ca1c5=_0x39d887[_0x5a9c4f[_0x3fc1('0x1f')]](_0x5a9c4f);logger[_0x3fc1('0xe')](_0x3fc1('0x43'),JSON[_0x3fc1('0x33')](_0x1ca1c5,null,0x2));if(_0x1ca1c5&&_0x1ca1c5['code']===AGI_CODE_SUCCESS&&_0x1ca1c5['result']!==AGI_RESULT_ERROR&&!_0x191c6c['evtHangup']){logger[_0x3fc1('0x32')](_0x3fc1('0x43'),getLogFromObject(_0x1ca1c5));return _[_0x3fc1('0x44')](_0x1ca1c5[_0x3fc1('0x45')])?null:_0x1ca1c5[_0x3fc1('0x45')][_0x3fc1('0x46')]();}else{logger[_0x3fc1('0x11')](_0x3fc1('0x43'),getLogFromObject(_0x1ca1c5));return null;}}else{logger[_0x3fc1('0x11')](_0x3fc1('0x47'));return null;}}catch(_0x4cb576){logger[_0x3fc1('0x11')](_0x4cb576[_0x3fc1('0xb')]);return null;}});if(_0x594814[_0x3fc1('0x48')]){logger[_0x3fc1('0xe')](util['format'](_0x3fc1('0x49'),_0x191c6c['arg_1'],_0x191c6c['calleridname'],_0x191c6c[_0x3fc1('0x1a')],_0x191c6c[_0x3fc1('0x15')],_0x191c6c[_0x3fc1('0x16')]));_0x280b31['traverseBFS'](_0x594814['finally']['id'],function(_0x5cd56e){try{_0x5cd56e=_0x39d887[_0x3fc1('0x3c')](_0x5cd56e);logger[_0x3fc1('0x32')](_0x3fc1('0x3d'),JSON[_0x3fc1('0x33')](_0x5cd56e,null,0x2));if(_0x5cd56e&&_0x39d887[_0x5cd56e[_0x3fc1('0x1f')]]){_0x1ca1c5=_0x39d887[_0x5cd56e['agicommand']](_0x5cd56e);if(_0x1ca1c5){logger[_0x3fc1('0x32')](_0x3fc1('0x43'),getLogFromObject(_0x1ca1c5));return _[_0x3fc1('0x44')](_0x1ca1c5[_0x3fc1('0x45')])?null:_0x1ca1c5[_0x3fc1('0x45')][_0x3fc1('0x46')]();}else{logger[_0x3fc1('0x11')]('response',getLogFromObject(_0x1ca1c5));return null;}}else{logger[_0x3fc1('0x11')](_0x3fc1('0x47'));return null;}}catch(_0x23de0c){logger[_0x3fc1('0x11')](_0x23de0c[_0x3fc1('0xb')]);return null;}});}logger['info'](util[_0x3fc1('0x12')](_0x3fc1('0x4a'),_0x191c6c[_0x3fc1('0x19')],_0x191c6c[_0x3fc1('0x17')],_0x191c6c[_0x3fc1('0x1a')],_0x191c6c[_0x3fc1('0x15')],_0x191c6c[_0x3fc1('0x16')]));logger[_0x3fc1('0xe')](util[_0x3fc1('0x12')](_0x3fc1('0x4b'),_0x191c6c['context'],_0x191c6c['extension'],parseInt(_0x191c6c['priority'],0xa)+0x1));_0x191c6c['continueAt'](_0x191c6c[_0x3fc1('0x40')],_0x191c6c[_0x3fc1('0x41')],parseInt(_0x191c6c['priority'],0xa)+0x1);_0x191c6c['close']();}}else{logger[_0x3fc1('0x11')](util[_0x3fc1('0x12')]('Project\x20%s\x20not\x20published',_0x191c6c[_0x3fc1('0x19')]));_0x191c6c[_0x3fc1('0x4c')](_0x191c6c[_0x3fc1('0x40')],_0x191c6c[_0x3fc1('0x41')],parseInt(_0x191c6c[_0x3fc1('0x42')],0xa)+0x1);_0x191c6c[_0x3fc1('0x4d')]();}}else{logger[_0x3fc1('0x11')](util[_0x3fc1('0x12')]('Project\x20%s\x20not\x20found',_0x191c6c[_0x3fc1('0x19')]));_0x191c6c[_0x3fc1('0x4c')](_0x191c6c[_0x3fc1('0x40')],_0x191c6c[_0x3fc1('0x41')],parseInt(_0x191c6c[_0x3fc1('0x42')],0xa)+0x1);_0x191c6c[_0x3fc1('0x4d')]();}}function main(){var _0x6b8fcf;return utilLicense[_0x3fc1('0x4e')]()[_0x3fc1('0x2c')](function(_0x26a767){if(_0x26a767){if(_0x26a767['voice']){if(_0x26a767['callysquare']&&_0x26a767[_0x3fc1('0x4f')]>0x0){logger[_0x3fc1('0xe')](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0x26a767['callysquare']));_0x6b8fcf=_0x26a767[_0x3fc1('0x4f')];}else{logger[_0x3fc1('0xe')](_0x3fc1('0x50'));}}else{logger['info'](_0x3fc1('0x51'));_0x6b8fcf=-0x1;}}})[_0x3fc1('0x2d')](function(_0x1fc246){logger[_0x3fc1('0x11')]('[LICENSE]',_0x1fc246[_0x3fc1('0xb')]);})[_0x3fc1('0x48')](function(){var _0x1e4719=require(_0x3fc1('0x52'))(0x11dd,'0.0.0.0',_0x6b8fcf);_0x1e4719['on']('error',errorHandler);_0x1e4719['on'](_0x3fc1('0x53'),listeningHandler);_0x1e4719['on'](_0x3fc1('0x54'),connectionHandler);_0x1e4719['on'](_0x3fc1('0x4d'),closeHandler);});}main();
\ No newline at end of file
index 1f613d1..c375574 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x3a0c64,_0x59da7c){var _0x2abf80=function(_0x2f9ed4){while(--_0x2f9ed4){_0x3a0c64['push'](_0x3a0c64['shift']());}};_0x2abf80(++_0x59da7c);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});};
\ No newline at end of file
+var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x4b8d54,_0x2196c6){var _0xabedd8=function(_0x22b75f){while(--_0x22b75f){_0x4b8d54['push'](_0x4b8d54['shift']());}};_0xabedd8(++_0x2196c6);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});};
\ No newline at end of file
index 7eb16b0..45ec4b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x41e507,_0x694b79){var _0x3bbe37=function(_0x2df851){while(--_0x2df851){_0x41e507['push'](_0x41e507['shift']());}};_0x3bbe37(++_0x694b79);}(_0x5f2f,0x73));var _0xf5f2=function(_0x123474,_0x13e194){_0x123474=_0x123474-0x0;var _0x304d98=_0x5f2f[_0x123474];return _0x304d98;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply;
\ No newline at end of file
+var _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0xf80b3,_0x25d5f3){var _0x10c489=function(_0x3c5aee){while(--_0x3c5aee){_0xf80b3['push'](_0xf80b3['shift']());}};_0x10c489(++_0x25d5f3);}(_0xb10b,0x12a));var _0xbb10=function(_0xe22435,_0x27157f){_0xe22435=_0xe22435-0x0;var _0x4fa237=_0xb10b[_0xe22435];return _0x4fa237;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply;
\ No newline at end of file
index fc58ddd..7a8591e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbbb=['arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createCmContact','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','http','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','email','getSquareProjectById','name','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge'];(function(_0x1683c6,_0x1c6664){var _0x15f8f3=function(_0x18434c){while(--_0x18434c){_0x1683c6['push'](_0x1683c6['shift']());}};_0x15f8f3(++_0x1c6664);}(_0xbbbb,0xf4));var _0xbbbb=function(_0x20de5a,_0x4c5b23){_0x20de5a=_0x20de5a-0x0;var _0xce8951=_0xbbbb[_0x20de5a];return _0xce8951;};'use strict';var BPromise=require(_0xbbbb('0x0'));var moment=require(_0xbbbb('0x1'));var _=require(_0xbbbb('0x2'));var util=require(_0xbbbb('0x3'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbbbb('0x4')]({'port':0x2329});function request(_0x371647,_0x2ffd2f){return new BPromise(function(_0x28a671,_0x574cd1){return client[_0xbbbb('0x5')](_0x371647,_0x2ffd2f)[_0xbbbb('0x6')](function(_0x562c92){if(_0x562c92[_0xbbbb('0x7')]){return _0x574cd1(_0x562c92[_0xbbbb('0x7')][_0xbbbb('0x8')]);}else{return _0x28a671(_0x562c92[_0xbbbb('0x9')]);}})[_0xbbbb('0xa')](function(_0x2c4ec4){return _0x574cd1(_0x2c4ec4);});});}exports[_0xbbbb('0xb')]=function(_0x24d3cc){return request(_0xbbbb('0xc'),{'options':{'raw':![],'where':{'name':_0x24d3cc},'attributes':[_0xbbbb('0xd')]}});};exports[_0xbbbb('0xe')]=function(_0x2fdf42){return request(_0xbbbb('0xf'),{'options':{'raw':![],'where':{'id':_0x2fdf42},'include':[{'model':_0xbbbb('0x10'),'as':_0xbbbb('0x11')}],'attributes':['id','name',_0xbbbb('0x12')]}});};exports[_0xbbbb('0x13')]=function(_0x364529){return request('ShowSquareProject',{'options':{'where':{'id':_0x364529},'attributes':[_0xbbbb('0x14')]}});};exports['getVoiceQueueById']=function(_0x5c2ef7){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x5c2ef7},'attributes':[_0xbbbb('0x14')]}});};exports['getVariableById']=function(_0x4c184f){return request(_0xbbbb('0x15'),{'options':{'where':{'id':_0x4c184f},'attributes':[_0xbbbb('0x14')]}});};exports[_0xbbbb('0x16')]=function(_0x306219){return request(_0xbbbb('0x17'),{'options':{'where':{'id':_0x306219},'attributes':[_0xbbbb('0x18')]}});};exports[_0xbbbb('0x19')]=function(_0xd9aef3){return request(_0xbbbb('0x1a'),{'options':{'where':{'id':_0xd9aef3},'attributes':['name']}});};exports['getTrunkById']=function(_0x3cc53c){return request(_0xbbbb('0x1b'),{'options':{'where':{'id':_0x3cc53c},'attributes':[_0xbbbb('0x14')]}});};exports[_0xbbbb('0x1c')]=function(_0x24a2f2){return request(_0xbbbb('0x1d'),{'options':{'where':{'id':_0x24a2f2},'attributes':[_0xbbbb('0x1e')]}});};exports[_0xbbbb('0x1f')]=function(_0x885b3b){return request(_0xbbbb('0x20'),{'options':{'raw':![],'where':{'id':_0x885b3b},'include':[{'model':_0xbbbb('0x21'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x51b846){return request(_0xbbbb('0x22'),{'options':{'where':{'id':_0x51b846},'attributes':['id','name']}});};exports[_0xbbbb('0x23')]=function(_0x322a6a){return request(_0xbbbb('0x24'),{'body':_0x322a6a});};exports[_0xbbbb('0x25')]=function(_0x251ee5){return request(_0xbbbb('0x26'),{'body':_0x251ee5});};exports['createSquareReport']=function(_0x3b257c){return request(_0xbbbb('0x27'),{'body':_[_0xbbbb('0x28')](_0x3b257c,{'project_name':_0x3b257c['arg_1'],'prev_project_name':_0x3b257c[_0xbbbb('0x29')]||'','is_subproject':_0x3b257c[_0xbbbb('0x29')]?!![]:![],'leaveAt':moment()['format'](_0xbbbb('0x2a'))})});};exports[_0xbbbb('0x2b')]=function(_0x2a41ee){return request(_0xbbbb('0x2c'),{'body':_0x2a41ee});};exports[_0xbbbb('0x2d')]=function(_0xcd655b){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0xcd655b[_0xbbbb('0x2e')],'ListId':_0xcd655b[_0xbbbb('0x2f')]}}})['then'](function(_0x17fee4){if(_0x17fee4){return _0x17fee4;}return request(_0xbbbb('0x30'),{'body':_0xcd655b});});};exports[_0xbbbb('0x31')]=function(_0x5a92fd){return request(_0xbbbb('0x32'),{'options':{'where':{'id':_0x5a92fd},'attributes':[_0xbbbb('0x14')]}});};exports['agentLogin']=function(_0x431e4e,_0x442d62){return request('LoginUser',{'body':{'interface':_0x442d62},'options':{'where':_0x431e4e}});};exports[_0xbbbb('0x33')]=function(_0x4b962c,_0x1f83f1,_0x452a80){return request(_0xbbbb('0x34'),{'body':{'type':_0x1f83f1,'uniqueid':_0x452a80},'options':{'where':_0x4b962c}});};exports[_0xbbbb('0x35')]=function(_0x11ba8c){return request(_0xbbbb('0x36'),{'body':{},'options':{'where':_0x11ba8c}});};exports[_0xbbbb('0x37')]=function(_0xb54086){return request(_0xbbbb('0x38'),{'body':{},'options':{'where':_0xb54086}});};
\ No newline at end of file
+var _0x3dd3=['result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','name','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowSquareOdbc','getUserById','ShowUser','ShowTrunk','getSoundById','ShowSound','getIntervalById','Interval','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createCmContact','ShowCmHopper','phone','ListId','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','request','then','error','message'];(function(_0x58d777,_0x256244){var _0x5e760f=function(_0x296d2c){while(--_0x296d2c){_0x58d777['push'](_0x58d777['shift']());}};_0x5e760f(++_0x256244);}(_0x3dd3,0x1d2));var _0x33dd=function(_0xd3d833,_0x114244){_0xd3d833=_0xd3d833-0x0;var _0x4f14f3=_0x3dd3[_0xd3d833];return _0x4f14f3;};'use strict';var BPromise=require(_0x33dd('0x0'));var moment=require(_0x33dd('0x1'));var _=require(_0x33dd('0x2'));var util=require(_0x33dd('0x3'));var jayson=require(_0x33dd('0x4'));var client=jayson[_0x33dd('0x5')][_0x33dd('0x6')]({'port':0x2329});function request(_0x46215f,_0x1b6a8a){return new BPromise(function(_0x7ad341,_0x358f1c){return client[_0x33dd('0x7')](_0x46215f,_0x1b6a8a)[_0x33dd('0x8')](function(_0x5d7276){if(_0x5d7276[_0x33dd('0x9')]){return _0x358f1c(_0x5d7276[_0x33dd('0x9')][_0x33dd('0xa')]);}else{return _0x7ad341(_0x5d7276[_0x33dd('0xb')]);}})[_0x33dd('0xc')](function(_0x3b5a63){return _0x358f1c(_0x3b5a63);});});}exports[_0x33dd('0xd')]=function(_0x431fe8){return request(_0x33dd('0xe'),{'options':{'raw':![],'where':{'name':_0x431fe8},'attributes':[_0x33dd('0xf')]}});};exports[_0x33dd('0x10')]=function(_0xac9e45){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0xac9e45},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id',_0x33dd('0x11'),'email']}});};exports[_0x33dd('0x12')]=function(_0x5b14b4){return request(_0x33dd('0xe'),{'options':{'where':{'id':_0x5b14b4},'attributes':[_0x33dd('0x11')]}});};exports[_0x33dd('0x13')]=function(_0x3265b8){return request(_0x33dd('0x14'),{'options':{'where':{'id':_0x3265b8},'attributes':[_0x33dd('0x11')]}});};exports[_0x33dd('0x15')]=function(_0x4e40d8){return request('ShowVariable',{'options':{'where':{'id':_0x4e40d8},'attributes':[_0x33dd('0x11')]}});};exports['getSquareOdbcById']=function(_0x1cd4ca){return request(_0x33dd('0x16'),{'options':{'where':{'id':_0x1cd4ca},'attributes':['dsn']}});};exports[_0x33dd('0x17')]=function(_0x4ab204){return request(_0x33dd('0x18'),{'options':{'where':{'id':_0x4ab204},'attributes':['name']}});};exports['getTrunkById']=function(_0x175b3b){return request(_0x33dd('0x19'),{'options':{'where':{'id':_0x175b3b},'attributes':['name']}});};exports[_0x33dd('0x1a')]=function(_0x17792a){return request(_0x33dd('0x1b'),{'options':{'where':{'id':_0x17792a},'attributes':['save_name']}});};exports[_0x33dd('0x1c')]=function(_0x210c55){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x210c55},'include':[{'model':_0x33dd('0x1d'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x479d15){return request(_0x33dd('0x1e'),{'options':{'where':{'id':_0x479d15},'attributes':['id',_0x33dd('0x11')]}});};exports[_0x33dd('0x1f')]=function(_0x4e1f7b){return request('CreateSmsMessage',{'body':_0x4e1f7b});};exports[_0x33dd('0x20')]=function(_0x1b3114){return request(_0x33dd('0x21'),{'body':_0x1b3114});};exports[_0x33dd('0x22')]=function(_0x1efa34){return request(_0x33dd('0x23'),{'body':_[_0x33dd('0x24')](_0x1efa34,{'project_name':_0x1efa34[_0x33dd('0x25')],'prev_project_name':_0x1efa34[_0x33dd('0x26')]||'','is_subproject':_0x1efa34[_0x33dd('0x26')]?!![]:![],'leaveAt':moment()[_0x33dd('0x27')](_0x33dd('0x28'))})});};exports['createSquareRecording']=function(_0x3257fe){return request(_0x33dd('0x29'),{'body':_0x3257fe});};exports[_0x33dd('0x2a')]=function(_0x531ae2){return request(_0x33dd('0x2b'),{'options':{'raw':![],'where':{'phone':_0x531ae2[_0x33dd('0x2c')],'ListId':_0x531ae2[_0x33dd('0x2d')]}}})[_0x33dd('0x8')](function(_0x2a4d22){if(_0x2a4d22){return _0x2a4d22;}return request('CreateCmContact',{'body':_0x531ae2});});};exports['getPauseById']=function(_0x15c9df){return request(_0x33dd('0x2e'),{'options':{'where':{'id':_0x15c9df},'attributes':[_0x33dd('0x11')]}});};exports['agentLogin']=function(_0x4912bd,_0x173df0){return request(_0x33dd('0x2f'),{'body':{'interface':_0x173df0},'options':{'where':_0x4912bd}});};exports[_0x33dd('0x30')]=function(_0x411a1a,_0x5d516f,_0xefe1d2){return request(_0x33dd('0x31'),{'body':{'type':_0x5d516f,'uniqueid':_0xefe1d2},'options':{'where':_0x411a1a}});};exports[_0x33dd('0x32')]=function(_0xa144ea){return request('UnpauseUser',{'body':{},'options':{'where':_0xa144ea}});};exports[_0x33dd('0x33')]=function(_0x363562){return request(_0x33dd('0x34'),{'body':{},'options':{'where':_0x363562}});};
\ No newline at end of file
index 8aeef25..2889e06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabe0=['exports','./polly'];(function(_0x2f9151,_0x422442){var _0x21dfa4=function(_0x5cbb4e){while(--_0x5cbb4e){_0x2f9151['push'](_0x2f9151['shift']());}};_0x21dfa4(++_0x422442);}(_0xabe0,0x165));var _0x0abe=function(_0x1c012d,_0x229718){_0x1c012d=_0x1c012d-0x0;var _0x3c0925=_0xabe0[_0x1c012d];return _0x3c0925;};var polly=require(_0x0abe('0x0'));module[_0x0abe('0x1')]={'polly':polly};
\ No newline at end of file
+var _0x327f=['exports'];(function(_0x110bb7,_0x56c479){var _0x1e6ac2=function(_0x27ca58){while(--_0x27ca58){_0x110bb7['push'](_0x110bb7['shift']());}};_0x1e6ac2(++_0x56c479);}(_0x327f,0x7d));var _0xf327=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x327f[_0x4b369d];return _0x571a98;};var polly=require('./polly');module[_0xf327('0x0')]={'polly':polly};
\ No newline at end of file
index d696dc3..ca9ac93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd26c=['./lib/api','exports'];(function(_0x3a5e0c,_0x2f82fe){var _0x5d8a14=function(_0x409d73){while(--_0x409d73){_0x3a5e0c['push'](_0x3a5e0c['shift']());}};_0x5d8a14(++_0x2f82fe);}(_0xd26c,0x1e6));var _0xcd26=function(_0x30c12d,_0x1e7339){_0x30c12d=_0x30c12d-0x0;var _0x4d5ea0=_0xd26c[_0x30c12d];return _0x4d5ea0;};'use strict';var polly=require(_0xcd26('0x0'));module[_0xcd26('0x1')]=function(_0x1e42bf,_0x17d0e9,_0xaa88ef,_0x38fbdf,_0x57b844,_0xb4668a,_0x36cd57){return polly(_0x1e42bf,_0x17d0e9,_0xaa88ef,_0x38fbdf,_0x57b844,_0xb4668a,_0x36cd57);};
\ No newline at end of file
+var _0x9daf=['./lib/api'];(function(_0x5e9e7b,_0x50ac0d){var _0x25c125=function(_0x820aa5){while(--_0x820aa5){_0x5e9e7b['push'](_0x5e9e7b['shift']());}};_0x25c125(++_0x50ac0d);}(_0x9daf,0xd5));var _0xf9da=function(_0x3b6aaf,_0x4aef36){_0x3b6aaf=_0x3b6aaf-0x0;var _0x295fa9=_0x9daf[_0x3b6aaf];return _0x295fa9;};'use strict';var polly=require(_0xf9da('0x0'));module['exports']=function(_0x2efbea,_0x23af09,_0x3c6a5e,_0x1b0c8e,_0x5aba12,_0x331cf5,_0x597808){return polly(_0x2efbea,_0x23af09,_0x3c6a5e,_0x1b0c8e,_0x5aba12,_0x331cf5,_0x597808);};
\ No newline at end of file
index 56ac7b4..f657993 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b84=['writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','path','bluebird','synthesizeSpeech'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x7b84,0x179));var _0x47b8=function(_0x5426da,_0xd15e29){_0x5426da=_0x5426da-0x0;var _0x97cb60=_0x7b84[_0x5426da];return _0x97cb60;};'use strict';var fs=require('fs');var path=require(_0x47b8('0x0'));var BPromise=require(_0x47b8('0x1'));var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x1f0017,_0x54a168,_0xd36ddc){return new BPromise(function(_0x1c56cd,_0x3bf91f){_0x1f0017[_0x47b8('0x2')](_0x54a168,function(_0x936d6f,_0x40a21f){if(_0x936d6f){_0x3bf91f(_0x936d6f);}else if(_0x40a21f){if(_0x40a21f['AudioStream']instanceof Buffer){fs[_0x47b8('0x3')](_0xd36ddc,_0x40a21f[_0x47b8('0x4')],function(_0x4ed73f){if(_0x4ed73f){_0x3bf91f(_0x4ed73f);}else{_0x1c56cd();}});}else{_0x3bf91f(new Error(_0x47b8('0x5')));}}else{_0x3bf91f(new Error(_0x47b8('0x6')));}});});}module[_0x47b8('0x7')]=function(_0x24d723,_0x530471,_0x4843a5,_0x4d24c4,_0x2b0e57,_0x7878e3,_0x118b45){var _0x1d47bc=new AWS['Polly']({'accessKeyId':_0x24d723,'secretAccessKey':_0x530471,'region':_0x4843a5});var _0x2b5d16={'Text':_0x2b0e57,'TextType':_0x7878e3||_0x47b8('0x8'),'OutputFormat':_0x47b8('0x9'),'VoiceId':_0x4d24c4};return pollyResult(_0x1d47bc,_0x2b5d16,_0x118b45);};
\ No newline at end of file
+var _0x756b=['mp3','path','bluebird','randomstring','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x756b,0x7a));var _0xb756=function(_0x6aae22,_0x15b7df){_0x6aae22=_0x6aae22-0x0;var _0x5c07d0=_0x756b[_0x6aae22];return _0x5c07d0;};'use strict';var fs=require('fs');var path=require(_0xb756('0x0'));var BPromise=require(_0xb756('0x1'));var rs=require(_0xb756('0x2'));var AWS=require(_0xb756('0x3'));function pollyResult(_0x3b9ad0,_0x24f110,_0x1a61b0){return new BPromise(function(_0xa9235f,_0x2f8152){_0x3b9ad0['synthesizeSpeech'](_0x24f110,function(_0x52fc03,_0x31ed55){if(_0x52fc03){_0x2f8152(_0x52fc03);}else if(_0x31ed55){if(_0x31ed55[_0xb756('0x4')]instanceof Buffer){fs[_0xb756('0x5')](_0x1a61b0,_0x31ed55[_0xb756('0x4')],function(_0x39021f){if(_0x39021f){_0x2f8152(_0x39021f);}else{_0xa9235f();}});}else{_0x2f8152(new Error(_0xb756('0x6')));}}else{_0x2f8152(new Error(_0xb756('0x7')));}});});}module[_0xb756('0x8')]=function(_0x601592,_0x1a509c,_0x1197b8,_0xe56acb,_0x173e83,_0x4a7d97,_0x520b3b){var _0x32be57=new AWS[(_0xb756('0x9'))]({'accessKeyId':_0x601592,'secretAccessKey':_0x1a509c,'region':_0x1197b8});var _0x145205={'Text':_0x173e83,'TextType':_0x4a7d97||'text','OutputFormat':_0xb756('0xa'),'VoiceId':_0xe56acb};return pollyResult(_0x32be57,_0x145205,_0x520b3b);};
\ No newline at end of file
index 5234876..6846965 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d90=['./lib/api'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x1d90,0x13e));var _0x01d9=function(_0x3e8d78,_0xef4524){_0x3e8d78=_0x3e8d78-0x0;var _0x50532d=_0x1d90[_0x3e8d78];return _0x50532d;};'use strict';var asr=require(_0x01d9('0x0'));module['exports']=function(_0x3e5e87,_0x4bc896,_0x433fc8,_0x5525be){return asr(_0x3e5e87,_0x4bc896,_0x433fc8);};
\ No newline at end of file
+var _0x7427=['exports','./lib/api'];(function(_0xeaf92d,_0x26a3bf){var _0x573a6a=function(_0x3214f1){while(--_0x3214f1){_0xeaf92d['push'](_0xeaf92d['shift']());}};_0x573a6a(++_0x26a3bf);}(_0x7427,0x111));var _0x7742=function(_0x2ee790,_0x5a8661){_0x2ee790=_0x2ee790-0x0;var _0x5a54a5=_0x7427[_0x2ee790];return _0x5a54a5;};'use strict';var asr=require(_0x7742('0x0'));module[_0x7742('0x1')]=function(_0x191137,_0x334de0,_0x4c1421,_0x3b6268){return asr(_0x191137,_0x334de0,_0x4c1421);};
\ No newline at end of file
index 83a087c..b8c0a7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1509=['POST','/v1/speech:recognize?key=','LINEAR16','8000','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','base64'];(function(_0x3d6da5,_0x46d892){var _0xe26da=function(_0x5960c7){while(--_0x5960c7){_0x3d6da5['push'](_0x3d6da5['shift']());}};_0xe26da(++_0x46d892);}(_0x1509,0xe1));var _0x9150=function(_0x1d605a,_0x31b776){_0x1d605a=_0x1d605a-0x0;var _0x24a38c=_0x1509[_0x1d605a];return _0x24a38c;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host=_0x9150('0x0');module[_0x9150('0x1')]=function(_0x5f0dda,_0x1b7750,_0x403c9d){return new BPromise(function(_0x3171fb,_0x10f6a3){var _0xb8f8f3;if(typeof _0x5f0dda!==_0x9150('0x2')||_0x5f0dda[_0x9150('0x3')]===0x0){return _0x10f6a3(_0x9150('0x4'));}if(typeof _0x1b7750!=='string'||_0x1b7750[_0x9150('0x3')]===0x0){return _0x10f6a3(_0x9150('0x5'));}if(typeof _0x403c9d!=='undefined'&&(typeof _0x403c9d!=='string'||_0x403c9d[_0x9150('0x3')]===0x0)){return _0x10f6a3(_0x9150('0x6'));}try{_0xb8f8f3=fs[_0x9150('0x7')](_0x5f0dda)['toString'](_0x9150('0x8'));}catch(_0x5e7ffd){return _0x10f6a3(_0x5e7ffd);}return _0x3171fb({'method':_0x9150('0x9'),'uri':host+_0x9150('0xa')+_0x1b7750,'body':{'config':{'encoding':_0x9150('0xb'),'sampleRateHertz':_0x9150('0xc'),'languageCode':_0x403c9d},'audio':{'content':_0xb8f8f3}},'json':!![]});});};
\ No newline at end of file
+var _0x6641=['readFileSync','POST','/v1/speech:recognize?key=','8000','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string'];(function(_0x10347f,_0x5b48de){var _0x7efd56=function(_0x2d309b){while(--_0x2d309b){_0x10347f['push'](_0x10347f['shift']());}};_0x7efd56(++_0x5b48de);}(_0x6641,0x138));var _0x1664=function(_0x2b2933,_0xda2d1a){_0x2b2933=_0x2b2933-0x0;var _0x10e2e2=_0x6641[_0x2b2933];return _0x10e2e2;};'use strict';var url=require(_0x1664('0x0'));var BPromise=require(_0x1664('0x1'));var fs=require('fs');var host=_0x1664('0x2');module[_0x1664('0x3')]=function(_0x430791,_0x5a4e71,_0x54e70e){return new BPromise(function(_0x526d8e,_0xfa2697){var _0x4476b1;if(typeof _0x430791!==_0x1664('0x4')||_0x430791[_0x1664('0x5')]===0x0){return _0xfa2697(_0x1664('0x6'));}if(typeof _0x5a4e71!==_0x1664('0x4')||_0x5a4e71[_0x1664('0x5')]===0x0){return _0xfa2697(_0x1664('0x7'));}if(typeof _0x54e70e!==_0x1664('0x8')&&(typeof _0x54e70e!==_0x1664('0x4')||_0x54e70e['length']===0x0)){return _0xfa2697(_0x1664('0x9'));}try{_0x4476b1=fs[_0x1664('0xa')](_0x430791)['toString']('base64');}catch(_0x1baf35){return _0xfa2697(_0x1baf35);}return _0x526d8e({'method':_0x1664('0xb'),'uri':host+_0x1664('0xc')+_0x5a4e71,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x1664('0xd'),'languageCode':_0x54e70e},'audio':{'content':_0x4476b1}},'json':!![]});});};
\ No newline at end of file
index 10cb4be..eda969d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var asr=require('./asr');module['exports']={'asr':asr};
\ No newline at end of file
+var _0x34e8=['./asr','exports'];(function(_0x880aed,_0x16597b){var _0x40df37=function(_0x303925){while(--_0x303925){_0x880aed['push'](_0x880aed['shift']());}};_0x40df37(++_0x16597b);}(_0x34e8,0x12c));var _0x834e=function(_0x54e7ef,_0x1e5b3c){_0x54e7ef=_0x54e7ef-0x0;var _0xd1835f=_0x34e8[_0x54e7ef];return _0xd1835f;};var asr=require(_0x834e('0x0'));module[_0x834e('0x1')]={'asr':asr};
\ No newline at end of file
index ccddcdc..15addc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a0c=['util','querystring','moment','apiai-promise','./tilde','agi','https://api.ispeech.org/api/rest','protocol','https:','host','path','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','close','download\x20error','data','end','transcode','wav','finish\x20to\x20convert','readFileSync','toString','base64','googleTTS','then','tmp','.mp3','resolve','.wav','unlink','chmodSync','777','split','googleASR','asr','uri','results','transcript','join','map','alternatives','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','actionIncomplete','speech','score','code','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','generate','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','dirName','http','url','parse','randomstring','request-promise'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4a0c,0x9d));var _0xc4a0=function(_0x2f49d7,_0x1a8527){_0x2f49d7=_0x2f49d7-0x0;var _0x4fa2d3=_0x4a0c[_0x2f49d7];return _0x4fa2d3;};'use strict';var fs=require('fs');var path=require('path');var http=require(_0xc4a0('0x0'));var https=require('https');var urlParse=require(_0xc4a0('0x1'))[_0xc4a0('0x2')];var BPromise=require('bluebird');var rs=require(_0xc4a0('0x3'));var sox=require('sox');var rp=require(_0xc4a0('0x4'));var util=require(_0xc4a0('0x5'));var querystring=require(_0xc4a0('0x6'));var moment=require(_0xc4a0('0x7'));var tts=require('google-tts-api');var apiai=require(_0xc4a0('0x8'));var google=require('./google');var aws=require('./aws');var tilde=require(_0xc4a0('0x9'));var logger=require('../../../config/logger')(_0xc4a0('0xa'));var ISPEECH_API=_0xc4a0('0xb');function downloadFile(_0x2ea94a,_0x5a9586){return new BPromise(function(_0x1196f6,_0x492357){var _0x3380e7=urlParse(_0x2ea94a);var _0x1d230d=_0x3380e7[_0xc4a0('0xc')]===_0xc4a0('0xd')?https:http;var _0x2dc1c2={'host':_0x3380e7[_0xc4a0('0xe')],'path':_0x3380e7[_0xc4a0('0xf')],'headers':{'user-agent':_0xc4a0('0x10')}};_0x1d230d[_0xc4a0('0x11')](_0x2dc1c2,function(_0x214233){if(_0x214233[_0xc4a0('0x12')]!==0xc8){logger[_0xc4a0('0x13')](_0xc4a0('0x14')+_0x2ea94a+_0xc4a0('0x15')+_0x214233['statusCode']+'\x20('+_0x214233[_0xc4a0('0x16')]+')');_0x492357(new Error(_0xc4a0('0x14')+_0x2ea94a+_0xc4a0('0x15')+_0x214233[_0xc4a0('0x12')]+'\x20('+_0x214233[_0xc4a0('0x16')]+')'));return;}var _0x542b5f=fs[_0xc4a0('0x17')](_0x5a9586);_0x542b5f['on'](_0xc4a0('0x18'),function(){logger[_0xc4a0('0x19')]('finish\x20download\x20file');_0x542b5f[_0xc4a0('0x1a')](_0x1196f6);});_0x542b5f['on'](_0xc4a0('0x13'),function(_0x4e3c99){fs['unlink'](_0x5a9586);logger[_0xc4a0('0x13')](_0xc4a0('0x1b'),_0x4e3c99);_0x492357(_0x4e3c99);});_0x214233['pipe'](_0x542b5f);})['on'](_0xc4a0('0x13'),function(_0x98b8da){logger['error'](_0x98b8da);_0x492357(_0x98b8da);})['end']();});}function uploadFile(_0x41a823){return new BPromise(function(_0x14a3ca,_0x3db5ef){var _0x18f839=urlParse(_0x41a823);var _0x54fa6a=_0x18f839['protocol']===_0xc4a0('0xd')?https:http;var _0x5581c3={'host':_0x18f839[_0xc4a0('0xe')],'path':_0x18f839[_0xc4a0('0xf')],'headers':{'user-agent':_0xc4a0('0x10')}};_0x54fa6a[_0xc4a0('0x11')](_0x5581c3,function(_0x23872d){if(_0x23872d[_0xc4a0('0x12')]!==0xc8){_0x3db5ef(new Error(_0xc4a0('0x14')+_0x41a823+_0xc4a0('0x15')+_0x23872d[_0xc4a0('0x12')]+'\x20('+_0x23872d[_0xc4a0('0x16')]+')'));return;}var _0x1009f8='';_0x23872d['on'](_0xc4a0('0x1c'),function(_0x1ce8e7){_0x1009f8+=_0x1ce8e7;});_0x23872d['on'](_0xc4a0('0x1d'),function(){_0x14a3ca(_0x1009f8);});})['on'](_0xc4a0('0x13'),function(_0x54330b){_0x3db5ef(_0x54330b);})[_0xc4a0('0x1d')]();});}function convertFile(_0x7f9e6d,_0x197304){return new BPromise(function(_0x39fb06,_0x2ee051){var _0x248423=sox[_0xc4a0('0x1e')](_0x7f9e6d,_0x197304,{'sampleRate':0x1f40,'format':_0xc4a0('0x1f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x248423['on'](_0xc4a0('0x13'),function(_0x4f254b){logger[_0xc4a0('0x13')]('error\x20convert',_0x4f254b);_0x2ee051(_0x4f254b);});_0x248423['on'](_0xc4a0('0x1d'),function(){logger['info'](_0xc4a0('0x20'));_0x39fb06();});_0x248423['start']();});}function base64Encode(_0x5ddc50){var _0x25e808=fs[_0xc4a0('0x21')](_0x5ddc50);return new Buffer(_0x25e808)[_0xc4a0('0x22')](_0xc4a0('0x23'));}exports[_0xc4a0('0x24')]=function(_0x21b59c,_0x396d42){var _0x501026,_0x3b951d;return tts(_0x21b59c,_0x396d42||'en',0x1)[_0xc4a0('0x25')](function(_0x28202a){logger[_0xc4a0('0x19')](_0x28202a);_0x501026=path['resolve'](__dirname,_0xc4a0('0x26'),rs['generate'](0x4)+_0xc4a0('0x27'));return downloadFile(_0x28202a,_0x501026);})[_0xc4a0('0x25')](function(){_0x3b951d=path[_0xc4a0('0x28')](__dirname,_0xc4a0('0x26'),rs['generate'](0x4)+_0xc4a0('0x29'));return convertFile(_0x501026,_0x3b951d);})[_0xc4a0('0x25')](function(){try{fs[_0xc4a0('0x2a')](_0x501026);fs[_0xc4a0('0x2b')](_0x3b951d,_0xc4a0('0x2c'));}catch(_0xd1a65b){logger['error'](_0xd1a65b);}logger[_0xc4a0('0x19')]('goggleTTS\x20path',_0x3b951d[_0xc4a0('0x2d')]('.')[0x0]);return _0x3b951d[_0xc4a0('0x2d')]('.')[0x0];});};exports[_0xc4a0('0x2e')]=function(_0x193573,_0x2ba36d,_0x290da5){return google[_0xc4a0('0x2f')](_0x193573,_0x2ba36d,_0x290da5)[_0xc4a0('0x25')](function(_0x1986d6){logger[_0xc4a0('0x19')](_0x1986d6[_0xc4a0('0x30')]);return rp(_0x1986d6);})[_0xc4a0('0x25')](function(_0x732b56){var _0x47ef0b='';var _0x3229d2=0x0;try{fs[_0xc4a0('0x2a')](_0x193573);}catch(_0x63a7b2){logger[_0xc4a0('0x13')](_0x63a7b2);}if(_0x732b56&&_0x732b56[_0xc4a0('0x31')]){_0x47ef0b=_0x732b56[_0xc4a0('0x31')]['map'](function(_0x34923b){return _0x34923b&&_0x34923b['alternatives'][0x0]&&_0x34923b['alternatives'][0x0][_0xc4a0('0x32')]?_0x34923b['alternatives'][0x0][_0xc4a0('0x32')]:'';})[_0xc4a0('0x33')]('\x0a');_0x3229d2=_0x732b56[_0xc4a0('0x31')][_0xc4a0('0x34')](function(_0x23d33b){return _0x23d33b&&_0x23d33b[_0xc4a0('0x35')][0x0]&&_0x23d33b[_0xc4a0('0x35')][0x0][_0xc4a0('0x36')]?_0x23d33b[_0xc4a0('0x35')][0x0]['confidence']:0x0;})['join']('\x0a');}logger['info'](_0xc4a0('0x37'),_0x47ef0b);logger[_0xc4a0('0x19')](_0xc4a0('0x38'),_0x3229d2);return{'transcript':_0x47ef0b,'confidence':_0x3229d2};})[_0xc4a0('0x39')](function(_0x2a84d1){logger['error']('[%s]\x20%s:%s',_0x2a84d1[_0xc4a0('0x12')],_0x2a84d1[_0xc4a0('0x3a')],_0x2a84d1[_0xc4a0('0x3b')]);});};exports[_0xc4a0('0x3c')]=function(_0x64a24f,_0x4e330e,_0x4235e7,_0x31aa16){var _0x29ccdb=apiai(_0x4e330e,{'language':_0x31aa16||'en'});return _0x29ccdb[_0xc4a0('0x3d')](_0x4235e7,{'sessionId':_0x64a24f})[_0xc4a0('0x25')](function(_0x5b3f31){logger['info'](JSON[_0xc4a0('0x3e')](_0x5b3f31));return{'source':_0x5b3f31[_0xc4a0('0x3f')][_0xc4a0('0x40')],'resolvedQuery':_0x5b3f31[_0xc4a0('0x3f')][_0xc4a0('0x41')],'action':_0x5b3f31[_0xc4a0('0x3f')]['action'],'actionIncomplete':_0x5b3f31[_0xc4a0('0x3f')][_0xc4a0('0x42')],'speech':_0x5b3f31[_0xc4a0('0x3f')]['fulfillment'][_0xc4a0('0x43')],'score':_0x5b3f31[_0xc4a0('0x3f')][_0xc4a0('0x44')],'statusCode':_0x5b3f31['status'][_0xc4a0('0x45')]};});};exports[_0xc4a0('0x46')]=function(_0x1cf912,_0x24c769,_0x164752,_0x4da6a3){return tilde[_0xc4a0('0x2f')](_0x1cf912,_0x24c769,_0x164752,_0x4da6a3)['then'](function(_0x412df8){try{fs[_0xc4a0('0x2a')](_0x1cf912);}catch(_0x2085eb){logger[_0xc4a0('0x13')](_0x2085eb);}logger[_0xc4a0('0x19')](_0xc4a0('0x47'),_0x412df8[_0xc4a0('0x32')]);logger[_0xc4a0('0x19')](_0xc4a0('0x48'),_0x412df8['confidence']);return _0x412df8;});};exports['awsPolly']=function(_0x199965,_0x47ab35,_0x49897a,_0x120ba7,_0x3a5046,_0x41dfed){var _0x1704b7=path[_0xc4a0('0x28')](__dirname,_0xc4a0('0x26'),rs['generate'](0x4)+_0xc4a0('0x27'));var _0x641f00;return aws['polly'](_0x199965,_0x47ab35,_0x49897a,_0x120ba7,_0x3a5046,_0x41dfed,_0x1704b7)[_0xc4a0('0x25')](function(){_0x641f00=path['resolve'](__dirname,_0xc4a0('0x26'),rs[_0xc4a0('0x49')](0x4)+_0xc4a0('0x29'));return convertFile(_0x1704b7,_0x641f00);})[_0xc4a0('0x25')](function(){try{fs[_0xc4a0('0x2a')](_0x1704b7);fs[_0xc4a0('0x2b')](_0x641f00,_0xc4a0('0x2c'));}catch(_0x33c7e0){logger[_0xc4a0('0x13')](_0x33c7e0);}return _0x641f00[_0xc4a0('0x2d')]('.')[0x0];});};exports[_0xc4a0('0x4a')]=function(_0x4b9357,_0x15e3a2,_0x5cae9f,_0x230833){var _0x4e3e00=util[_0xc4a0('0x4b')](_0xc4a0('0x4c'),ISPEECH_API,_0x4b9357,encodeURIComponent(_0x15e3a2),_0x5cae9f,_0x230833);var _0x3ba103=path[_0xc4a0('0x28')](__dirname,_0xc4a0('0x26'),rs[_0xc4a0('0x49')](0x4)+_0xc4a0('0x27'));var _0x1bcc55;return downloadFile(_0x4e3e00,_0x3ba103)[_0xc4a0('0x25')](function(){_0x1bcc55=path[_0xc4a0('0x28')](__dirname,_0xc4a0('0x26'),rs['generate'](0x4)+_0xc4a0('0x29'));return convertFile(_0x3ba103,_0x1bcc55);})[_0xc4a0('0x25')](function(){try{fs[_0xc4a0('0x2a')](_0x3ba103);fs[_0xc4a0('0x2b')](_0x1bcc55,_0xc4a0('0x2c'));}catch(_0x216a95){logger[_0xc4a0('0x13')](_0x216a95);}return _0x1bcc55[_0xc4a0('0x2d')]('.')[0x0];});};exports[_0xc4a0('0x4d')]=function(_0x1a9cef,_0x1d2f70,_0x42907c,_0x48dd37){var _0x102b4a=util[_0xc4a0('0x4b')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x1d2f70,_0x42907c,base64Encode(_0x1a9cef),_0x48dd37?util[_0xc4a0('0x4b')](_0xc4a0('0x4e'),encodeURIComponent(_0x48dd37)):_0xc4a0('0x4f'));return uploadFile(_0x102b4a)[_0xc4a0('0x25')](function(_0x242d85){return querystring[_0xc4a0('0x2')](_0x242d85);});};exports[_0xc4a0('0x50')]=function(){return __dirname;};
\ No newline at end of file
+var _0xe433=['transcript','confidence','join','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','stringify','result','source','action','fulfillment','score','status','code','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','.mp3','polly','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','freeform=3','dirName','path','http','url','parse','sox','request-promise','querystring','moment','google-tts-api','apiai-promise','./google','./aws','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','error','request\x20to\x20','statusCode','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish\x20download\x20file','unlink','download\x20error','pipe','protocol','statusMessage','data','end','wav','info','finish\x20to\x20convert','start','toString','base64','then','tmp','generate','resolve','.wav','chmodSync','777','goggleTTS\x20path','split','asr','uri','results','map','alternatives'];(function(_0x3f18ba,_0x38da0e){var _0x1d3b77=function(_0x1b8889){while(--_0x1b8889){_0x3f18ba['push'](_0x3f18ba['shift']());}};_0x1d3b77(++_0x38da0e);}(_0xe433,0x1b7));var _0x3e43=function(_0x283a57,_0x449802){_0x283a57=_0x283a57-0x0;var _0x129ce6=_0xe433[_0x283a57];return _0x129ce6;};'use strict';var fs=require('fs');var path=require(_0x3e43('0x0'));var http=require(_0x3e43('0x1'));var https=require('https');var urlParse=require(_0x3e43('0x2'))[_0x3e43('0x3')];var BPromise=require('bluebird');var rs=require('randomstring');var sox=require(_0x3e43('0x4'));var rp=require(_0x3e43('0x5'));var util=require('util');var querystring=require(_0x3e43('0x6'));var moment=require(_0x3e43('0x7'));var tts=require(_0x3e43('0x8'));var apiai=require(_0x3e43('0x9'));var google=require(_0x3e43('0xa'));var aws=require(_0x3e43('0xb'));var tilde=require(_0x3e43('0xc'));var logger=require(_0x3e43('0xd'))(_0x3e43('0xe'));var ISPEECH_API=_0x3e43('0xf');function downloadFile(_0x2419a7,_0x1d38ef){return new BPromise(function(_0x5724b5,_0x5ecf9d){var _0x159bf3=urlParse(_0x2419a7);var _0x453a18=_0x159bf3['protocol']===_0x3e43('0x10')?https:http;var _0x4f67d7={'host':_0x159bf3[_0x3e43('0x11')],'path':_0x159bf3[_0x3e43('0x0')],'headers':{'user-agent':_0x3e43('0x12')}};_0x453a18[_0x3e43('0x13')](_0x4f67d7,function(_0x4e1d68){if(_0x4e1d68['statusCode']!==0xc8){logger[_0x3e43('0x14')](_0x3e43('0x15')+_0x2419a7+'\x20failed,\x20status\x20code\x20=\x20'+_0x4e1d68[_0x3e43('0x16')]+'\x20('+_0x4e1d68['statusMessage']+')');_0x5ecf9d(new Error(_0x3e43('0x15')+_0x2419a7+_0x3e43('0x17')+_0x4e1d68['statusCode']+'\x20('+_0x4e1d68['statusMessage']+')'));return;}var _0x4b12c3=fs[_0x3e43('0x18')](_0x1d38ef);_0x4b12c3['on']('finish',function(){logger['info'](_0x3e43('0x19'));_0x4b12c3['close'](_0x5724b5);});_0x4b12c3['on'](_0x3e43('0x14'),function(_0x1da497){fs[_0x3e43('0x1a')](_0x1d38ef);logger[_0x3e43('0x14')](_0x3e43('0x1b'),_0x1da497);_0x5ecf9d(_0x1da497);});_0x4e1d68[_0x3e43('0x1c')](_0x4b12c3);})['on']('error',function(_0x2ea0ab){logger['error'](_0x2ea0ab);_0x5ecf9d(_0x2ea0ab);})['end']();});}function uploadFile(_0x5da1c2){return new BPromise(function(_0x4986c6,_0x165dae){var _0xd808c7=urlParse(_0x5da1c2);var _0x296963=_0xd808c7[_0x3e43('0x1d')]==='https:'?https:http;var _0x3092b5={'host':_0xd808c7[_0x3e43('0x11')],'path':_0xd808c7[_0x3e43('0x0')],'headers':{'user-agent':_0x3e43('0x12')}};_0x296963[_0x3e43('0x13')](_0x3092b5,function(_0x30265d){if(_0x30265d['statusCode']!==0xc8){_0x165dae(new Error('request\x20to\x20'+_0x5da1c2+'\x20failed,\x20status\x20code\x20=\x20'+_0x30265d[_0x3e43('0x16')]+'\x20('+_0x30265d[_0x3e43('0x1e')]+')'));return;}var _0x3ba07a='';_0x30265d['on'](_0x3e43('0x1f'),function(_0x3a5754){_0x3ba07a+=_0x3a5754;});_0x30265d['on'](_0x3e43('0x20'),function(){_0x4986c6(_0x3ba07a);});})['on'](_0x3e43('0x14'),function(_0x4b8878){_0x165dae(_0x4b8878);})[_0x3e43('0x20')]();});}function convertFile(_0x57c7ac,_0x4955dc){return new BPromise(function(_0x1b0a1e,_0x47a1b7){var _0x519dd2=sox['transcode'](_0x57c7ac,_0x4955dc,{'sampleRate':0x1f40,'format':_0x3e43('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x519dd2['on'](_0x3e43('0x14'),function(_0x235d08){logger[_0x3e43('0x14')]('error\x20convert',_0x235d08);_0x47a1b7(_0x235d08);});_0x519dd2['on'](_0x3e43('0x20'),function(){logger[_0x3e43('0x22')](_0x3e43('0x23'));_0x1b0a1e();});_0x519dd2[_0x3e43('0x24')]();});}function base64Encode(_0x42fc4e){var _0x1a38f1=fs['readFileSync'](_0x42fc4e);return new Buffer(_0x1a38f1)[_0x3e43('0x25')](_0x3e43('0x26'));}exports['googleTTS']=function(_0x128de0,_0x54b3fc){var _0x29288f,_0x741940;return tts(_0x128de0,_0x54b3fc||'en',0x1)[_0x3e43('0x27')](function(_0x22c106){logger[_0x3e43('0x22')](_0x22c106);_0x29288f=path['resolve'](__dirname,_0x3e43('0x28'),rs[_0x3e43('0x29')](0x4)+'.mp3');return downloadFile(_0x22c106,_0x29288f);})[_0x3e43('0x27')](function(){_0x741940=path[_0x3e43('0x2a')](__dirname,_0x3e43('0x28'),rs[_0x3e43('0x29')](0x4)+_0x3e43('0x2b'));return convertFile(_0x29288f,_0x741940);})[_0x3e43('0x27')](function(){try{fs[_0x3e43('0x1a')](_0x29288f);fs[_0x3e43('0x2c')](_0x741940,_0x3e43('0x2d'));}catch(_0x435178){logger['error'](_0x435178);}logger[_0x3e43('0x22')](_0x3e43('0x2e'),_0x741940[_0x3e43('0x2f')]('.')[0x0]);return _0x741940[_0x3e43('0x2f')]('.')[0x0];});};exports['googleASR']=function(_0x44b2b4,_0xbf4f62,_0x4c9f96){return google[_0x3e43('0x30')](_0x44b2b4,_0xbf4f62,_0x4c9f96)[_0x3e43('0x27')](function(_0x1fd9ee){logger[_0x3e43('0x22')](_0x1fd9ee[_0x3e43('0x31')]);return rp(_0x1fd9ee);})[_0x3e43('0x27')](function(_0x11af3d){var _0x11ad85='';var _0x49e610=0x0;try{fs[_0x3e43('0x1a')](_0x44b2b4);}catch(_0x3c855b){logger[_0x3e43('0x14')](_0x3c855b);}if(_0x11af3d&&_0x11af3d['results']){_0x11ad85=_0x11af3d[_0x3e43('0x32')][_0x3e43('0x33')](function(_0x319481){return _0x319481&&_0x319481[_0x3e43('0x34')][0x0]&&_0x319481[_0x3e43('0x34')][0x0]['transcript']?_0x319481[_0x3e43('0x34')][0x0][_0x3e43('0x35')]:'';})['join']('\x0a');_0x49e610=_0x11af3d['results'][_0x3e43('0x33')](function(_0x434df3){return _0x434df3&&_0x434df3['alternatives'][0x0]&&_0x434df3[_0x3e43('0x34')][0x0][_0x3e43('0x36')]?_0x434df3[_0x3e43('0x34')][0x0]['confidence']:0x0;})[_0x3e43('0x37')]('\x0a');}logger[_0x3e43('0x22')]('googleASR\x20transcription',_0x11ad85);logger[_0x3e43('0x22')](_0x3e43('0x38'),_0x49e610);return{'transcript':_0x11ad85,'confidence':_0x49e610};})[_0x3e43('0x39')](function(_0x3e1b13){logger[_0x3e43('0x14')](_0x3e43('0x3a'),_0x3e1b13['statusCode'],_0x3e1b13[_0x3e43('0x3b')],_0x3e1b13[_0x3e43('0x3c')]);});};exports['googleDialogflow']=function(_0xebcd6a,_0xafdce,_0x8a2b04,_0x3d65d6){var _0x26b5b4=apiai(_0xafdce,{'language':_0x3d65d6||'en'});return _0x26b5b4[_0x3e43('0x3d')](_0x8a2b04,{'sessionId':_0xebcd6a})['then'](function(_0x49cc07){logger[_0x3e43('0x22')](JSON[_0x3e43('0x3e')](_0x49cc07));return{'source':_0x49cc07[_0x3e43('0x3f')][_0x3e43('0x40')],'resolvedQuery':_0x49cc07[_0x3e43('0x3f')]['resolvedQuery'],'action':_0x49cc07['result'][_0x3e43('0x41')],'actionIncomplete':_0x49cc07[_0x3e43('0x3f')]['actionIncomplete'],'speech':_0x49cc07[_0x3e43('0x3f')][_0x3e43('0x42')]['speech'],'score':_0x49cc07[_0x3e43('0x3f')][_0x3e43('0x43')],'statusCode':_0x49cc07[_0x3e43('0x44')][_0x3e43('0x45')]};});};exports[_0x3e43('0x46')]=function(_0x9b7036,_0x50460f,_0x29d053,_0x3bb648){return tilde[_0x3e43('0x30')](_0x9b7036,_0x50460f,_0x29d053,_0x3bb648)[_0x3e43('0x27')](function(_0x34e8c9){try{fs[_0x3e43('0x1a')](_0x9b7036);}catch(_0x4a0c72){logger[_0x3e43('0x14')](_0x4a0c72);}logger[_0x3e43('0x22')](_0x3e43('0x47'),_0x34e8c9[_0x3e43('0x35')]);logger[_0x3e43('0x22')]('Tilde\x20ASR\x20confidence',_0x34e8c9[_0x3e43('0x36')]);return _0x34e8c9;});};exports[_0x3e43('0x48')]=function(_0x36cab8,_0x516e9b,_0x2979e1,_0x304b94,_0x5ee091,_0x2c40a0){var _0x5769a2=path[_0x3e43('0x2a')](__dirname,_0x3e43('0x28'),rs[_0x3e43('0x29')](0x4)+_0x3e43('0x49'));var _0x12276f;return aws[_0x3e43('0x4a')](_0x36cab8,_0x516e9b,_0x2979e1,_0x304b94,_0x5ee091,_0x2c40a0,_0x5769a2)[_0x3e43('0x27')](function(){_0x12276f=path[_0x3e43('0x2a')](__dirname,_0x3e43('0x28'),rs[_0x3e43('0x29')](0x4)+_0x3e43('0x2b'));return convertFile(_0x5769a2,_0x12276f);})[_0x3e43('0x27')](function(){try{fs[_0x3e43('0x1a')](_0x5769a2);fs[_0x3e43('0x2c')](_0x12276f,_0x3e43('0x2d'));}catch(_0x29479b){logger['error'](_0x29479b);}return _0x12276f[_0x3e43('0x2f')]('.')[0x0];});};exports['ispeechTTS']=function(_0x53be72,_0x47e5d4,_0x3db3c0,_0x318f9a){var _0x629616=util[_0x3e43('0x4b')](_0x3e43('0x4c'),ISPEECH_API,_0x53be72,encodeURIComponent(_0x47e5d4),_0x3db3c0,_0x318f9a);var _0x1c208f=path[_0x3e43('0x2a')](__dirname,_0x3e43('0x28'),rs[_0x3e43('0x29')](0x4)+'.mp3');var _0x22bfcd;return downloadFile(_0x629616,_0x1c208f)[_0x3e43('0x27')](function(){_0x22bfcd=path[_0x3e43('0x2a')](__dirname,_0x3e43('0x28'),rs['generate'](0x4)+_0x3e43('0x2b'));return convertFile(_0x1c208f,_0x22bfcd);})[_0x3e43('0x27')](function(){try{fs[_0x3e43('0x1a')](_0x1c208f);fs[_0x3e43('0x2c')](_0x22bfcd,_0x3e43('0x2d'));}catch(_0x52bbcd){logger[_0x3e43('0x14')](_0x52bbcd);}return _0x22bfcd[_0x3e43('0x2f')]('.')[0x0];});};exports[_0x3e43('0x4d')]=function(_0x4b7ce0,_0x5d7416,_0x2a63d7,_0x3273f1){var _0x39e13e=util[_0x3e43('0x4b')](_0x3e43('0x4e'),ISPEECH_API,_0x5d7416,_0x2a63d7,base64Encode(_0x4b7ce0),_0x3273f1?util['format'](_0x3e43('0x4f'),encodeURIComponent(_0x3273f1)):_0x3e43('0x50'));return uploadFile(_0x39e13e)[_0x3e43('0x27')](function(_0x3e700b){return querystring[_0x3e43('0x3')](_0x3e700b);});};exports[_0x3e43('0x51')]=function(){return __dirname;};
\ No newline at end of file
index 0a8689f..0d7d510 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb49b=['./lib/api','exports'];(function(_0x3d8d0a,_0x11bb87){var _0x5b9df5=function(_0x3ecba2){while(--_0x3ecba2){_0x3d8d0a['push'](_0x3d8d0a['shift']());}};_0x5b9df5(++_0x11bb87);}(_0xb49b,0xc2));var _0xbb49=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xb49b[_0x4cf98e];return _0x1623ac;};'use strict';var asr=require(_0xbb49('0x0'));module[_0xbb49('0x1')]=function(_0x4f48be,_0x4a2bc4,_0x2e4dff,_0x573b62){return asr(_0x4f48be,_0x4a2bc4,_0x2e4dff,_0x573b62);};
\ No newline at end of file
+var _0x9718=['exports','./lib/api'];(function(_0x3ccac1,_0x5cc7ea){var _0x10b20b=function(_0x4ed4f5){while(--_0x4ed4f5){_0x3ccac1['push'](_0x3ccac1['shift']());}};_0x10b20b(++_0x5cc7ea);}(_0x9718,0xf7));var _0x8971=function(_0xe48bd4,_0x5dc31b){_0xe48bd4=_0xe48bd4-0x0;var _0x52a109=_0x9718[_0xe48bd4];return _0x52a109;};'use strict';var asr=require(_0x8971('0x0'));module[_0x8971('0x1')]=function(_0x11857b,_0x51e6fe,_0x53517c,_0x18d47d){return asr(_0x11857b,_0x51e6fe,_0x53517c,_0x18d47d);};
\ No newline at end of file
index 9434c12..ae79b72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe15a=['update','hex','unix','send','stringify','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','hypotheses','likelihood','Success.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1'];(function(_0x2e913b,_0x4b7071){var _0x173899=function(_0x2a7d22){while(--_0x2a7d22){_0x2e913b['push'](_0x2e913b['shift']());}};_0x173899(++_0x4b7071);}(_0xe15a,0x133));var _0xae15=function(_0x58a4ac,_0x43fd42){_0x58a4ac=_0x58a4ac-0x0;var _0x545810=_0xe15a[_0x58a4ac];return _0x545810;};'use strict';var BPromise=require(_0xae15('0x0'));var _=require(_0xae15('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xae15('0x2'));var crypto=require(_0xae15('0x3'));var logger=require(_0xae15('0x4'))(_0xae15('0x5'));module[_0xae15('0x6')]=function(_0x5a5de7,_0x234308,_0x32fbff,_0x52e5b0){return new BPromise(function(_0xfc89dc,_0x206d3d){logger[_0xae15('0x7')](_0xae15('0x8'),_0x52e5b0||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x26a255=new WebSocket(_0x52e5b0||_0xae15('0x9'),{'perMessageDeflate':![]});var _0x5827f6='';var _0x5ea491='0';var _0x30f8b1='1';var _0x3e6635=_0xae15('0xa');function _0x39f31d(_0x10ea38){var _0x12ad32=crypto[_0xae15('0xb')](_0xae15('0xc'));_0x12ad32[_0xae15('0xd')](_0x10ea38);return _0x12ad32['digest'](_0xae15('0xe'));}function _0x48455f(){try{logger[_0xae15('0x7')]('Open\x20Tilde\x20ASR\x20socket');var _0x184056=moment()[_0xae15('0xf')]();var _0x1f7c68=_0x39f31d(_0x184056+_0x234308+_0x32fbff);_0x26a255[_0xae15('0x10')](JSON[_0xae15('0x11')]({'appID':_0x234308,'timestamp':_0x184056,'appKey':_0x1f7c68}));var _0x3035df=fs[_0xae15('0x12')](_0x5a5de7);_0x3035df['on'](_0xae15('0x13'),function(_0x5f2f1d){_0x26a255['send'](_0x5f2f1d);});_0x3035df['on']('close',function(){_0x26a255[_0xae15('0x10')](_0xae15('0x14'));});}catch(_0x2cfbb4){logger[_0xae15('0x15')](_0xae15('0x16'),JSON['stringify'](_0x2cfbb4));_0x26a255[_0xae15('0x17')]();}}function _0x3b672d(_0x1ad181){try{if(_0x1ad181){var _0x2b42ba=JSON[_0xae15('0x18')](_0x1ad181);switch(_0x2b42ba[_0xae15('0x19')]){case 0x0:if(_0x2b42ba[_0xae15('0x1a')]){if(_0x2b42ba[_0xae15('0x1a')][_0xae15('0x1b')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0xae15('0x11')](_0x2b42ba['result'][_0xae15('0x1c')]));_0x5827f6=_0x2b42ba[_0xae15('0x1a')]['hypotheses'][0x0]['transcript'];_0x5ea491=_0x2b42ba['result']['hypotheses'][0x0][_0xae15('0x1d')];_0x30f8b1='0';_0x3e6635=_0xae15('0x1e');_0x26a255[_0xae15('0x17')]();}}break;case 0x1:logger[_0xae15('0x7')](_0xae15('0xa'));_0x30f8b1='1';_0x3e6635=_0xae15('0xa');break;case 0x2:logger[_0xae15('0x7')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x30f8b1='2';_0x3e6635='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xae15('0x7')](_0xae15('0x1f'));_0x30f8b1='9';_0x3e6635=_0xae15('0x1f');break;case 0xa:logger[_0xae15('0x7')](_0xae15('0x20'));_0x30f8b1='10';_0x3e6635=_0xae15('0x20');break;case 0xb:logger[_0xae15('0x7')](_0xae15('0x21'));_0x30f8b1='11';_0x3e6635=_0xae15('0x21');}}}catch(_0x18b926){logger[_0xae15('0x15')](_0xae15('0x22'),JSON['stringify'](_0x18b926));_0x26a255[_0xae15('0x17')]();}}function _0x4b7438(){logger['info'](_0xae15('0x23'));_0xfc89dc({'transcript':_0x5827f6,'confidence':_0x5ea491,'status':_0x30f8b1,'status_message':_0x3e6635});}function _0x309c83(_0x4643e2){logger['error'](_0xae15('0x24'));if(!_[_0xae15('0x25')](_0x4643e2)){logger[_0xae15('0x15')](_['isObject'](_0x4643e2)?JSON[_0xae15('0x11')](_0x4643e2):_0x4643e2);}}_0x26a255['on'](_0xae15('0x26'),_0x48455f);_0x26a255['on'](_0xae15('0x27'),_0x3b672d);_0x26a255['on']('close',_0x4b7438);_0x26a255['on'](_0xae15('0x15'),_0x309c83);});};
\ No newline at end of file
+var _0x26bc=['crypto','../../../../../../config/logger','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','unix','stringify','createReadStream','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','bluebird','lodash','moment'];(function(_0x4e087a,_0x5ecf13){var _0x9af0ed=function(_0x14b6c6){while(--_0x14b6c6){_0x4e087a['push'](_0x4e087a['shift']());}};_0x9af0ed(++_0x5ecf13);}(_0x26bc,0x1aa));var _0xc26b=function(_0x549763,_0x29c87f){_0x549763=_0x549763-0x0;var _0xdb5977=_0x26bc[_0x549763];return _0xdb5977;};'use strict';var BPromise=require(_0xc26b('0x0'));var _=require(_0xc26b('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xc26b('0x2'));var crypto=require(_0xc26b('0x3'));var logger=require(_0xc26b('0x4'))('agi');module[_0xc26b('0x5')]=function(_0x2901b3,_0x427d05,_0x3571c1,_0x8c7acf){return new BPromise(function(_0x42651a,_0x54ed68){logger[_0xc26b('0x6')]('Tilde\x20URI',_0x8c7acf||_0xc26b('0x7'));var _0x2e821e=new WebSocket(_0x8c7acf||_0xc26b('0x7'),{'perMessageDeflate':![]});var _0x1cd643='';var _0x1110b1='0';var _0x1ce1ca='1';var _0x17fbad=_0xc26b('0x8');function _0x25f498(_0x3fc220){var _0x25940f=crypto[_0xc26b('0x9')](_0xc26b('0xa'));_0x25940f[_0xc26b('0xb')](_0x3fc220);return _0x25940f[_0xc26b('0xc')](_0xc26b('0xd'));}function _0xf70e0d(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x4f68af=moment()[_0xc26b('0xe')]();var _0x5f12b4=_0x25f498(_0x4f68af+_0x427d05+_0x3571c1);_0x2e821e['send'](JSON[_0xc26b('0xf')]({'appID':_0x427d05,'timestamp':_0x4f68af,'appKey':_0x5f12b4}));var _0x2c4df8=fs[_0xc26b('0x10')](_0x2901b3);_0x2c4df8['on']('data',function(_0x101716){_0x2e821e[_0xc26b('0x11')](_0x101716);});_0x2c4df8['on'](_0xc26b('0x12'),function(){_0x2e821e[_0xc26b('0x11')](_0xc26b('0x13'));});}catch(_0x2be3a7){logger[_0xc26b('0x14')](_0xc26b('0x15'),JSON[_0xc26b('0xf')](_0x2be3a7));_0x2e821e['terminate']();}}function _0x36a122(_0x249daa){try{if(_0x249daa){var _0x46a970=JSON['parse'](_0x249daa);switch(_0x46a970[_0xc26b('0x16')]){case 0x0:if(_0x46a970[_0xc26b('0x17')]){if(_0x46a970['result'][_0xc26b('0x18')]){logger[_0xc26b('0x6')](_0xc26b('0x19'),JSON[_0xc26b('0xf')](_0x46a970[_0xc26b('0x17')][_0xc26b('0x1a')]));_0x1cd643=_0x46a970[_0xc26b('0x17')][_0xc26b('0x1a')][0x0][_0xc26b('0x1b')];_0x1110b1=_0x46a970[_0xc26b('0x17')][_0xc26b('0x1a')][0x0][_0xc26b('0x1c')];_0x1ce1ca='0';_0x17fbad='Success.';_0x2e821e[_0xc26b('0x1d')]();}}break;case 0x1:logger[_0xc26b('0x6')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x1ce1ca='1';_0x17fbad='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xc26b('0x6')](_0xc26b('0x1e'));_0x1ce1ca='2';_0x17fbad='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xc26b('0x6')](_0xc26b('0x1f'));_0x1ce1ca='9';_0x17fbad=_0xc26b('0x1f');break;case 0xa:logger[_0xc26b('0x6')]('Authentication\x20failed.');_0x1ce1ca='10';_0x17fbad=_0xc26b('0x20');break;case 0xb:logger[_0xc26b('0x6')](_0xc26b('0x21'));_0x1ce1ca='11';_0x17fbad=_0xc26b('0x21');}}}catch(_0xccaa6c){logger['error'](_0xc26b('0x22'),JSON[_0xc26b('0xf')](_0xccaa6c));_0x2e821e[_0xc26b('0x1d')]();}}function _0x17c434(){logger[_0xc26b('0x6')](_0xc26b('0x23'));_0x42651a({'transcript':_0x1cd643,'confidence':_0x1110b1,'status':_0x1ce1ca,'status_message':_0x17fbad});}function _0x3f6244(_0x17ef29){logger['error'](_0xc26b('0x24'));if(!_[_0xc26b('0x25')](_0x17ef29)){logger[_0xc26b('0x14')](_[_0xc26b('0x26')](_0x17ef29)?JSON[_0xc26b('0xf')](_0x17ef29):_0x17ef29);}}_0x2e821e['on']('open',_0xf70e0d);_0x2e821e['on']('message',_0x36a122);_0x2e821e['on'](_0xc26b('0x12'),_0x17c434);_0x2e821e['on']('error',_0x3f6244);});};
\ No newline at end of file
index b10cacb..4f8f0e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['./asr'];(function(_0xe97b13,_0x209948){var _0xc35507=function(_0x71c2fa){while(--_0x71c2fa){_0xe97b13['push'](_0xe97b13['shift']());}};_0xc35507(++_0x209948);}(_0x3e74,0x175));var _0x43e7=function(_0x7c1183,_0x56c529){_0x7c1183=_0x7c1183-0x0;var _0x5ea164=_0x3e74[_0x7c1183];return _0x5ea164;};var asr=require(_0x43e7('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
+var _0xa9e0=['exports','./asr'];(function(_0x4b6de8,_0x296d07){var _0x335fe7=function(_0x59c582){while(--_0x59c582){_0x4b6de8['push'](_0x4b6de8['shift']());}};_0x335fe7(++_0x296d07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};var asr=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'asr':asr};
\ No newline at end of file
index a8c120d..a4e636e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x296c=['call','emit','error','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','./error'];(function(_0x1a92de,_0x4c051c){var _0x422be7=function(_0x1e1424){while(--_0x1e1424){_0x1a92de['push'](_0x1a92de['shift']());}};_0x422be7(++_0x4c051c);}(_0x296c,0x18e));var _0xc296=function(_0x45d71d,_0x2033e9){_0x45d71d=_0x45d71d-0x0;var _0x27a1b9=_0x296c[_0x45d71d];return _0x27a1b9;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require('events')['EventEmitter'];var AGIError=require(_0xc296('0x0'));var AGIChannel=require('./channel');var AGIServer=function(_0x5d22b6,_0x137d0e,_0x41182c){var _0x1a4712=this,_0x5d22b6=_0x5d22b6||0x11dd,_0x137d0e=_0x137d0e||'0.0.0.0',_0x5a1b38=null,_0x5225b4=0x0;EventEmitter[_0xc296('0x1')](_0x1a4712);function _0x5ea115(){if(!_0x5d22b6){_0x1a4712[_0xc296('0x2')](_0xc296('0x3'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x5a1b38=net['createServer']();_0x5a1b38[_0xc296('0x4')](_0x5d22b6,_0x137d0e);_0x5a1b38['on'](_0xc296('0x5'),function(){_0x1a4712[_0xc296('0x2')](_0xc296('0x5'));});_0x5a1b38['on'](_0xc296('0x6'),function(_0x2b4b9a){_0x5a1b38[_0xc296('0x7')](function(_0x468e84,_0x2088d6){if(_0x468e84){_0x1a4712['emit'](_0xc296('0x3'),new AGIError(_0xc296('0x8'),_0x468e84));}else if(_0x41182c&&_0x41182c<0x0){_0x1a4712['emit'](_0xc296('0x3'),new AGIError(_0xc296('0x9')));_0x2b4b9a[_0xc296('0xa')]();}else if(_0x41182c&&_0x41182c>0x0&&_0x41182c<_0x2088d6){_0x5225b4+=0x1;_0x1a4712[_0xc296('0x2')]('error',new AGIError(_0xc296('0xb'),_0x5225b4));_0x2b4b9a[_0xc296('0xa')]();}else{var _0x1ec022=new AGIChannel(_0x2b4b9a);_0x1ec022['on'](_0xc296('0xc'),function(){_0x1a4712['emit'](_0xc296('0x6'),_0x1ec022);});}});});_0x5a1b38['on'](_0xc296('0x3'),function(_0xf5b779){_0x1a4712[_0xc296('0x2')](_0xc296('0x3'),new AGIError(_0xc296('0x8'),_0xf5b779[_0xc296('0xd')]));});_0x5a1b38['on'](_0xc296('0xe'),function(){_0x1a4712['emit'](_0xc296('0xe'),new AGIError(_0xc296('0xf')));});}process[_0xc296('0x10')](function(){_0x5ea115();});};util[_0xc296('0x11')](AGIServer,EventEmitter);module[_0xc296('0x12')]=function(_0x4663b0,_0x3e0b1d,_0x3c7143){return new AGIServer(_0x4663b0,_0x3e0b1d,_0x3c7143);};
\ No newline at end of file
+var _0x240d=['E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','connection','code','close','E_AGI_SERVER_CLOSE','nextTick','util','net','events','EventEmitter','./error','0.0.0.0','call','emit','E_AGI_ARGUMENT_PORT','createServer','listen','listening','error','E_AGI_SERVER_ERROR'];(function(_0x14b241,_0x429bf7){var _0xafcc46=function(_0x58c6af){while(--_0x58c6af){_0x14b241['push'](_0x14b241['shift']());}};_0xafcc46(++_0x429bf7);}(_0x240d,0xc4));var _0xd240=function(_0x1f0bd5,_0x4bf29f){_0x1f0bd5=_0x1f0bd5-0x0;var _0x58baa5=_0x240d[_0x1f0bd5];return _0x58baa5;};'use strict';var util=require(_0xd240('0x0'));var net=require(_0xd240('0x1'));var EventEmitter=require(_0xd240('0x2'))[_0xd240('0x3')];var AGIError=require(_0xd240('0x4'));var AGIChannel=require('./channel');var AGIServer=function(_0x118d79,_0x4ccbef,_0xf467ed){var _0x3dbd7f=this,_0x118d79=_0x118d79||0x11dd,_0x4ccbef=_0x4ccbef||_0xd240('0x5'),_0x4b353c=null,_0xdbb7f5=0x0;EventEmitter[_0xd240('0x6')](_0x3dbd7f);function _0x347d66(){if(!_0x118d79){_0x3dbd7f[_0xd240('0x7')]('error',new AGIError(_0xd240('0x8')));return![];}_0x4b353c=net[_0xd240('0x9')]();_0x4b353c[_0xd240('0xa')](_0x118d79,_0x4ccbef);_0x4b353c['on']('listening',function(){_0x3dbd7f[_0xd240('0x7')](_0xd240('0xb'));});_0x4b353c['on']('connection',function(_0x367db3){_0x4b353c['getConnections'](function(_0xe9b713,_0x592d4e){if(_0xe9b713){_0x3dbd7f['emit'](_0xd240('0xc'),new AGIError(_0xd240('0xd'),_0xe9b713));}else if(_0xf467ed&&_0xf467ed<0x0){_0x3dbd7f[_0xd240('0x7')](_0xd240('0xc'),new AGIError(_0xd240('0xe')));_0x367db3['destroy']();}else if(_0xf467ed&&_0xf467ed>0x0&&_0xf467ed<_0x592d4e){_0xdbb7f5+=0x1;_0x3dbd7f['emit'](_0xd240('0xc'),new AGIError(_0xd240('0xf'),_0xdbb7f5));_0x367db3['destroy']();}else{var _0x16e7dd=new AGIChannel(_0x367db3);_0x16e7dd['on']('ready',function(){_0x3dbd7f[_0xd240('0x7')](_0xd240('0x10'),_0x16e7dd);});}});});_0x4b353c['on'](_0xd240('0xc'),function(_0x3f0051){_0x3dbd7f['emit'](_0xd240('0xc'),new AGIError(_0xd240('0xd'),_0x3f0051[_0xd240('0x11')]));});_0x4b353c['on'](_0xd240('0x12'),function(){_0x3dbd7f[_0xd240('0x7')]('close',new AGIError(_0xd240('0x13')));});}process[_0xd240('0x14')](function(){_0x347d66();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x14e170,_0x5d1173,_0x1238d7){return new AGIServer(_0x14e170,_0x5d1173,_0x1238d7);};
\ No newline at end of file
index fbae63d..f49bdcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef1=['url','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','getMailAccount','Smtp','email','user','subject','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','exports','path','lodash','shelljs','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','menu','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','name','getVoiceQueue','then','catch','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getSound','getSoundById','getSoundPath','save_name','sendMailMessage','IntervalId','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','extension','dnid','file','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogin','internal','%s/%s@from-sip/n','shellCommand','exec','googleTTS','text','google_tts_language','googleDialogflow','key','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','includes','clone','isString','replaceAllVariables','split','length','extra','getAndSetVariable','result','setVariable','maxRetry','sync','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','timeout','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','noop','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','options','lumenvoxtts','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','no\x20query\x20configured','replace','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','no\x20text\x20configured','Trying\x20Dialogflow:\x20%s','hasOwnProperty','DIALOGFLOW_%s','Dialogflow\x20Result\x20%s','Google\x20TTS\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','test','stringify','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_secret_access_key','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','unlink','.wav','aws\x20Polly\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','%s.%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','toUpperCase','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','agentLogout','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','opts','Executed\x20command\x20%s\x20%s','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','indexOf','XMCS-QUEUE','toLowerCase','QUEUE'];(function(_0x18ad21,_0x475afe){var _0x51d6f3=function(_0x45ea92){while(--_0x45ea92){_0x18ad21['push'](_0x18ad21['shift']());}};_0x51d6f3(++_0x475afe);}(_0x8ef1,0x1bb));var _0x18ef=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x8ef1[_0x7e2eb0];return _0xd92de4;};'use strict';var fs=require('fs');var path=require(_0x18ef('0x0'));var util=require('util');var _=require(_0x18ef('0x1'));var sh=require(_0x18ef('0x2'));var odbc=require(_0x18ef('0x3'))();var rs=require(_0x18ef('0x4'));var moment=require(_0x18ef('0x5'));var Mustache=require(_0x18ef('0x6'));var logger=require(_0x18ef('0x7'))(_0x18ef('0x8'));var config=require(_0x18ef('0x9'));var scripts=require(_0x18ef('0xa'));var FILES_PATH=_0x18ef('0xb');var verticesWithRetry=[_0x18ef('0xc'),'getdigits',_0x18ef('0xd')];var AGIVertices=function(_0x11d8e6,_0x1afb6a,_0x3e979e){this[_0x18ef('0xe')]=_0x11d8e6;this[_0x18ef('0xf')]=_0x1afb6a;this[_0x18ef('0x10')]=_0x3e979e;};AGIVertices[_0x18ef('0x11')][_0x18ef('0x12')]=function(_0x5313ec,_0x4c73e8){this[_0x18ef('0xf')]['getVariableById'](_0x5313ec)['then'](function(_0x1b0107){_0x4c73e8(null,_0x1b0107?_0x1b0107[_0x18ef('0x13')]:![]);})['catch'](function(_0x2665e3){_0x4c73e8(_0x2665e3);});};AGIVertices['prototype'][_0x18ef('0x14')]=function(_0x4c55b6,_0x4d8a7b){this[_0x18ef('0xf')]['getVoiceQueueById'](_0x4c55b6)[_0x18ef('0x15')](function(_0x3468f4){_0x4d8a7b(null,_0x3468f4?_0x3468f4['name']:![]);})[_0x18ef('0x16')](function(_0x312afe){_0x4d8a7b(_0x312afe);});};AGIVertices[_0x18ef('0x11')]['getSquareProject']=function(_0x152163,_0x15fef5){this[_0x18ef('0xf')][_0x18ef('0x17')](_0x152163)[_0x18ef('0x15')](function(_0x47f020){_0x15fef5(null,_0x47f020?_0x47f020['name']:![]);})[_0x18ef('0x16')](function(_0x1e2f79){_0x15fef5(_0x1e2f79);});};AGIVertices[_0x18ef('0x11')][_0x18ef('0x18')]=function(_0xcbd6b,_0x4b743a){this[_0x18ef('0xf')][_0x18ef('0x19')](_0xcbd6b)[_0x18ef('0x15')](function(_0x4b6d33){_0x4b743a(null,_0x4b6d33?_0x4b6d33[_0x18ef('0x1a')]:![]);})[_0x18ef('0x16')](function(_0x44290e){_0x4b743a(_0x44290e);});};AGIVertices[_0x18ef('0x11')][_0x18ef('0x1b')]=function(_0x173867,_0x49e1b9){this['rpc'][_0x18ef('0x1c')](_0x173867)[_0x18ef('0x15')](function(_0x5abaa3){_0x49e1b9(null,_0x5abaa3?_0x5abaa3['name']:![]);})[_0x18ef('0x16')](function(_0x2213fa){_0x49e1b9(_0x2213fa);});};AGIVertices['prototype']['getTrunk']=function(_0x1237d6,_0x3c83b1){this['rpc']['getTrunkById'](_0x1237d6)[_0x18ef('0x15')](function(_0x4171d0){_0x3c83b1(null,_0x4171d0?_0x4171d0[_0x18ef('0x13')]:![]);})[_0x18ef('0x16')](function(_0x1d12c8){_0x3c83b1(_0x1d12c8);});};AGIVertices['prototype'][_0x18ef('0x1d')]=function(_0x46405c,_0x35de18){var _0x3bcaf9=this;this[_0x18ef('0xf')][_0x18ef('0x1e')](_0x46405c)[_0x18ef('0x15')](function(_0x1f2c7f){_0x35de18(null,_0x1f2c7f?_0x3bcaf9[_0x18ef('0x1f')](_0x1f2c7f[_0x18ef('0x20')]):![]);})[_0x18ef('0x16')](function(_0x413f46){_0x35de18(_0x413f46);});};AGIVertices[_0x18ef('0x11')]['getMailAccount']=function(_0x1045d0,_0x2b6758){this['rpc']['getMailAccountById'](_0x1045d0)[_0x18ef('0x15')](function(_0x4124dc){_0x2b6758(null,_0x4124dc?_0x4124dc:![]);})[_0x18ef('0x16')](function(_0x518ebc){_0x2b6758(_0x518ebc);});};AGIVertices[_0x18ef('0x11')]['sendMailMessage']=function(_0x2de88e,_0x594efb,_0x202e3c){this[_0x18ef('0x10')][_0x18ef('0x21')](_0x2de88e,_0x594efb)[_0x18ef('0x15')](function(){_0x202e3c(null);})[_0x18ef('0x16')](function(_0x40da5e){_0x202e3c(_0x40da5e);});};AGIVertices[_0x18ef('0x11')]['getIntervals']=function(_0x2713ef,_0x46216e){this[_0x18ef('0xf')]['getIntervalById'](_0x2713ef)[_0x18ef('0x15')](function(_0x4d73f3){if(_0x4d73f3){if(_0x4d73f3[_0x18ef('0x22')]){_0x46216e(null,[_0x4d73f3['interval']]);}else{_0x46216e(null,_[_0x18ef('0x23')](_0x4d73f3[_0x18ef('0x24')],'interval'));}}else{_0x46216e(null,![]);}})['catch'](function(_0x1d09ad){_0x46216e(_0x1d09ad);});};AGIVertices[_0x18ef('0x11')][_0x18ef('0x1f')]=function(_0x48e149){return util[_0x18ef('0x25')](_0x18ef('0x26'),FILES_PATH,_0x48e149);};AGIVertices['prototype'][_0x18ef('0x27')]=function(_0x20da5c,_0x31ff3b,_0x26dcbb){odbc['open'](_0x20da5c,function(_0x3fe36f){if(_0x3fe36f){logger['error'](_0x18ef('0x28'),_0x3fe36f);_0x26dcbb(_0x3fe36f);}else{logger[_0x18ef('0x29')](_0x18ef('0x2a'));odbc[_0x18ef('0x2b')](_0x31ff3b,function(_0x56b649,_0x406e54){if(_0x56b649){logger[_0x18ef('0x29')]('Error\x20executing\x20query\x20%s',_0x31ff3b);_0x26dcbb(_0x56b649);}else{logger[_0x18ef('0x29')](_0x18ef('0x2c'),_0x31ff3b);odbc['close'](function(_0x257fd6){if(_0x257fd6){logger[_0x18ef('0x2d')](_0x18ef('0x2e'),_0x257fd6);}_0x26dcbb(null,_0x406e54);});}});}});};AGIVertices[_0x18ef('0x11')][_0x18ef('0x2f')]=function(_0x238146,_0x5437d4){this[_0x18ef('0xf')][_0x18ef('0x30')](_0x238146)['then'](function(_0x14de0f){_0x5437d4(null,_0x14de0f?_0x14de0f:![]);})[_0x18ef('0x16')](function(_0x40f663){_0x5437d4(_0x40f663);});};AGIVertices[_0x18ef('0x11')][_0x18ef('0x31')]=function(_0x231905,_0x26a418){this['rpc'][_0x18ef('0x31')](_0x231905)[_0x18ef('0x15')](function(_0x10eb28){_0x26a418(null,_0x10eb28);})[_0x18ef('0x16')](function(_0x2d62cb){_0x26a418(_0x2d62cb);});};AGIVertices['prototype'][_0x18ef('0x32')]=function(_0x44b784,_0x5f4be3,_0x54317d){this[_0x18ef('0xf')]['createSquareDetailsReport']({'uniqueid':this[_0x18ef('0xe')][_0x18ef('0x33')],'node':_0x44b784[_0x18ef('0x34')],'application':_0x44b784[_0x18ef('0x35')],'data':_0x5f4be3||null,'project_name':this[_0x18ef('0xe')][_0x18ef('0x36')],'callerid':this[_0x18ef('0xe')][_0x18ef('0x37')]})[_0x18ef('0x15')](function(_0x27d1cd){_0x54317d(null,_0x27d1cd);})['catch'](function(_0x4ada27){_0x54317d(_0x4ada27);});};AGIVertices[_0x18ef('0x11')][_0x18ef('0x38')]=function(_0x20ab42,_0x5aac1f,_0x59f767,_0x85d79f){this['rpc'][_0x18ef('0x38')]({'uniqueid':this[_0x18ef('0xe')]['uniqueid'],'callerid':this[_0x18ef('0xe')][_0x18ef('0x37')],'calleridname':this['channel']['calleridname'],'context':this[_0x18ef('0xe')]['context'],'extension':this[_0x18ef('0xe')][_0x18ef('0x39')],'priority':this[_0x18ef('0xe')]['priority'],'accountcode':this[_0x18ef('0xe')]['accountcode'],'dnid':this[_0x18ef('0xe')][_0x18ef('0x3a')],'projectName':this[_0x18ef('0xe')]['arg_1'],'saveName':_0x5aac1f,'filename':_0x20ab42[_0x18ef('0x3b')]||_0x5aac1f,'savePath':_0x59f767})[_0x18ef('0x15')](function(_0x357ea6){_0x85d79f(null,_0x357ea6);})[_0x18ef('0x16')](function(_0xe599ac){_0x85d79f(_0xe599ac);});};AGIVertices[_0x18ef('0x11')][_0x18ef('0x3c')]=function(_0x5c767d,_0x48054f){this[_0x18ef('0xf')][_0x18ef('0x3c')]({'firstName':_[_0x18ef('0x3d')](_0x5c767d[_0x18ef('0x13')])||_[_0x18ef('0x3e')](_0x5c767d[_0x18ef('0x13')])?_0x18ef('0x3f')+Math['random']():_0x5c767d[_0x18ef('0x13')],'lastName':_['isEmpty'](_0x5c767d[_0x18ef('0x40')])||_[_0x18ef('0x3e')](_0x5c767d['lastName'])?null:_0x5c767d[_0x18ef('0x40')],'phone':_0x5c767d[_0x18ef('0x41')],'ListId':_0x5c767d[_0x18ef('0x42')],'scheduledAt':_0x5c767d[_0x18ef('0x43')],'callbackUniqueid':this[_0x18ef('0xe')][_0x18ef('0x33')],'tags':'callback','description':_0x18ef('0x44')+_0x5c767d['scheduledAt'][_0x18ef('0x45')](),'priority':_0x5c767d[_0x18ef('0x46')]})[_0x18ef('0x15')](function(_0x4aba12){_0x48054f(null,_0x4aba12);})[_0x18ef('0x16')](function(_0x3281a2){_0x48054f(_0x3281a2);});};AGIVertices[_0x18ef('0x11')]['getPause']=function(_0x68ca3,_0x193eb0){this[_0x18ef('0xf')][_0x18ef('0x47')](_0x68ca3)[_0x18ef('0x15')](function(_0x4819d3){_0x193eb0(null,_0x4819d3?_0x4819d3[_0x18ef('0x13')]:![]);})[_0x18ef('0x16')](function(_0x22b654){_0x193eb0(_0x22b654);});};AGIVertices[_0x18ef('0x11')][_0x18ef('0x48')]=function(_0x5b2d6a,_0x3f148c,_0x4daecb){var _0xf90678={'role':_0x18ef('0x49')};_0xf90678[_0x5b2d6a]=this[_0x18ef('0xe')][_0x18ef('0x37')];this[_0x18ef('0xf')][_0x18ef('0x48')](_0xf90678,_0x3f148c,this['channel'][_0x18ef('0x33')])[_0x18ef('0x15')](function(_0x9fa614){_0x4daecb(null,_['isNil'](_0x9fa614)?![]:!![]);})[_0x18ef('0x16')](function(_0x5ee86e){logger[_0x18ef('0x2d')](_0x5ee86e);_0x4daecb(null,![]);});};AGIVertices[_0x18ef('0x11')][_0x18ef('0x4a')]=function(_0x1725a7,_0x28e8d1){var _0x26381f={'role':'agent'};_0x26381f[_0x1725a7]=this[_0x18ef('0xe')][_0x18ef('0x37')];this[_0x18ef('0xf')]['agentUnpause'](_0x26381f)[_0x18ef('0x15')](function(_0x132752){_0x28e8d1(null,_[_0x18ef('0x3e')](_0x132752)?![]:!![]);})[_0x18ef('0x16')](function(_0x25bf57){logger[_0x18ef('0x2d')](_0x25bf57);_0x28e8d1(null,![]);});};AGIVertices[_0x18ef('0x11')]['agentLogout']=function(_0x5f1181,_0x12975d){var _0x24183d={'role':_0x18ef('0x49')};_0x24183d[_0x5f1181]=this[_0x18ef('0xe')][_0x18ef('0x37')];this[_0x18ef('0xf')]['agentLogout'](_0x24183d)['then'](function(_0x102087){_0x12975d(null,_['isNil'](_0x102087)?![]:!![]);})[_0x18ef('0x16')](function(_0x837d78){logger[_0x18ef('0x2d')](_0x837d78);_0x12975d(null,![]);});};AGIVertices[_0x18ef('0x11')][_0x18ef('0x4b')]=function(_0x22b71f,_0x4a076e){var _0x5aa517={'role':'agent'};_0x5aa517[_0x22b71f]=this[_0x18ef('0xe')][_0x18ef('0x37')];var _0x3fa5f3=_0x22b71f!=_0x18ef('0x4c')?util['format'](_0x18ef('0x4d'),'LOCAL',this[_0x18ef('0xe')][_0x18ef('0x37')]):undefined;this[_0x18ef('0xf')]['agentLogin'](_0x5aa517,_0x3fa5f3)['then'](function(_0x354fa0){_0x4a076e(null,_['isNil'](_0x354fa0)?![]:!![]);})['catch'](function(_0x4999db){logger[_0x18ef('0x2d')](_0x4999db);_0x4a076e(null,![]);});};AGIVertices['prototype'][_0x18ef('0x4e')]=function(_0x5565bb,_0x42add9){sh[_0x18ef('0x4f')](_['trim'](_0x5565bb),function(_0x3270eb,_0x1a3920){var _0x5dabeb=_0x1a3920['replace'](/(\r\n|\n|\r)/gm,'');_0x42add9(null,_0x5dabeb);});};AGIVertices[_0x18ef('0x11')]['googleTTS']=function(_0x23790e,_0x1f3871){scripts[_0x18ef('0x50')](_0x23790e[_0x18ef('0x51')],_0x23790e[_0x18ef('0x52')]||'en',0x1)[_0x18ef('0x15')](function(_0xb0ee8d){_0x1f3871(null,_0xb0ee8d);})[_0x18ef('0x16')](function(_0x1f8fbc){_0x1f3871(_0x1f8fbc);});};AGIVertices[_0x18ef('0x11')][_0x18ef('0x53')]=function(_0x28f5b7,_0x3f067c){scripts[_0x18ef('0x53')](this[_0x18ef('0xe')][_0x18ef('0x33')],_0x28f5b7[_0x18ef('0x54')],_0x28f5b7[_0x18ef('0x51')],_0x28f5b7['dialogflow_language']||'en')['then'](function(_0x4d7258){_0x3f067c(null,_0x4d7258);})[_0x18ef('0x16')](function(_0x53fc4a){_0x3f067c(_0x53fc4a);});};AGIVertices['prototype']['ispeechTTS']=function(_0x4efc67,_0x5c6013){scripts[_0x18ef('0x55')](_0x4efc67['key'],_0x4efc67['text'],_0x4efc67[_0x18ef('0x56')]||_0x18ef('0x57'),_0x4efc67[_0x18ef('0x58')])[_0x18ef('0x15')](function(_0x4eb2d7){_0x5c6013(null,_0x4eb2d7);})[_0x18ef('0x16')](function(_0xdddc5a){_0x5c6013(_0xdddc5a);});};AGIVertices[_0x18ef('0x11')]['ispeechASR']=function(_0x5efe35,_0x589a2a,_0x5a2774){scripts[_0x18ef('0x59')](_0x589a2a,_0x5efe35[_0x18ef('0x54')],_0x5efe35[_0x18ef('0x5a')]||_0x18ef('0x57'),this[_0x18ef('0x5b')](_0x5efe35[_0x18ef('0x5c')])?_0x5efe35[_0x18ef('0x5c')]:undefined)[_0x18ef('0x15')](function(_0x434325){_0x5a2774(null,_0x434325);})[_0x18ef('0x16')](function(_0x4b2282){_0x5a2774(_0x4b2282);});};AGIVertices[_0x18ef('0x11')][_0x18ef('0x5d')]=function(_0x10771f,_0xbcc906){scripts[_0x18ef('0x5d')](_0x10771f[_0x18ef('0x5e')],_0x10771f['aws_secret_access_key'],_0x10771f[_0x18ef('0x5f')],_0x10771f[_0x18ef('0x60')]||'Amy',_0x10771f[_0x18ef('0x51')],_0x10771f['aws_text_type']||'text')['then'](function(_0x6c71b9){_0xbcc906(null,_0x6c71b9);})[_0x18ef('0x16')](function(_0x2910d0){_0xbcc906(_0x2910d0);});};AGIVertices['prototype'][_0x18ef('0x61')]=function(_0x953606,_0x2576a9,_0x5573d8){scripts[_0x18ef('0x61')](_0x2576a9,_0x953606[_0x18ef('0x54')],_0x953606[_0x18ef('0x62')]||_0x18ef('0x57'))['then'](function(_0x4d3c60){_0x5573d8(null,_0x4d3c60);})['catch'](function(_0x45d829){_0x5573d8(_0x45d829);});};AGIVertices[_0x18ef('0x11')]['tildeASR']=function(_0x577c7c,_0x424719,_0x2e33e2){scripts[_0x18ef('0x63')](_0x424719,_0x577c7c[_0x18ef('0x64')],_0x577c7c[_0x18ef('0x65')],_0x577c7c[_0x18ef('0x66')])[_0x18ef('0x15')](function(_0x3ceaf1){_0x2e33e2(null,_0x3ceaf1);})[_0x18ef('0x16')](function(_0x2f6fbd){_0x2e33e2(_0x2f6fbd);});};AGIVertices[_0x18ef('0x11')][_0x18ef('0x67')]=function(_0x419ac5){var _0x2ba35a=_[_0x18ef('0x68')](verticesWithRetry,_0x419ac5[_0x18ef('0x35')])?_0x419ac5:_[_0x18ef('0x69')](_0x419ac5);for(var _0x2fc08c in _0x2ba35a){if(_0x2ba35a['hasOwnProperty'](_0x2fc08c)){if(_0x2ba35a[_0x2fc08c]&&_[_0x18ef('0x6a')](_0x2ba35a[_0x2fc08c])){_0x2ba35a[_0x2fc08c]=this[_0x18ef('0x6b')](_0x2ba35a[_0x2fc08c]);}}}return _0x2ba35a;};AGIVertices[_0x18ef('0x11')][_0x18ef('0x6b')]=function(_0x597751){var _0x2514c4=_0x597751[_0x18ef('0x6c')]('{');for(var _0x2bea0b=0x1;_0x2bea0b<_0x2514c4[_0x18ef('0x6d')];_0x2bea0b+=0x1){var _0xbd1cf1=_0x2514c4[_0x2bea0b][_0x18ef('0x6c')]('}');if(_0xbd1cf1[_0x18ef('0x6d')]>0x1){_0x597751=_0x597751['replaceAll']('{'+_0xbd1cf1[0x0]+'}',this[_0x18ef('0xe')][_0x18ef('0x12')](_0xbd1cf1[0x0])[_0x18ef('0x6e')]||_0xbd1cf1[0x0]);}}if(_0x2514c4[_0x18ef('0x6d')]===0x1){return _0x597751[_0x18ef('0x45')]();}return this[_0x18ef('0x6b')](_0x597751);};AGIVertices[_0x18ef('0x11')][_0x18ef('0x6f')]=function(_0x1a76a7,_0x248c39){var _0x47dd89=this[_0x18ef('0xe')]['getVariable'](_0x1a76a7);if(_0x47dd89[_0x18ef('0x70')]===-0x1){return _0x47dd89;}logger[_0x18ef('0x29')](util[_0x18ef('0x25')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x248c39,_0x47dd89['extra']));return this[_0x18ef('0xe')][_0x18ef('0x71')](_0x248c39,_0x47dd89['extra']);};AGIVertices[_0x18ef('0x11')][_0x18ef('0x5b')]=function(_0x20890b){return _0x20890b&&_0x20890b!=='0'&&_0x20890b!=='-1'&&_0x20890b!=='';};AGIVertices['prototype'][_0x18ef('0x72')]=function(_0x5b52a7){this[_0x18ef('0x32')][_0x18ef('0x73')](this,_0x5b52a7,'-');_0x5b52a7['retry']=_0x5b52a7[_0x18ef('0x72')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x18ef('0x11')][_0x18ef('0x8')]=function(_0x28c763){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0x74'),_0x28c763[_0x18ef('0x34')]));return this[_0x18ef('0xe')][_0x18ef('0x8')]([_0x28c763[_0x18ef('0x75')],_0x28c763['args']]);};AGIVertices[_0x18ef('0x11')][_0x18ef('0x76')]=function(_0x58bca1){logger['info'](util[_0x18ef('0x25')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x58bca1[_0x18ef('0x34')]));if(this[_0x18ef('0x5b')](_0x58bca1[_0x18ef('0x77')])){logger[_0x18ef('0x29')](util[_0x18ef('0x25')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x58bca1[_0x18ef('0x77')]));var _0x17beec=this[_0x18ef('0xe')][_0x18ef('0x78')](_0x58bca1['timeout']);if(_0x17beec[_0x18ef('0x70')]===-0x1){return _0x17beec;}}return this['channel'][_0x18ef('0x76')]();};AGIVertices[_0x18ef('0x11')][_0x18ef('0x79')]=function(_0x3294ef){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0x7a'),_0x3294ef[_0x18ef('0x34')]));if(!this[_0x18ef('0x5b')](_0x3294ef[_0x18ef('0x42')])){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x3294ef,_0x18ef('0x7b'));}_0x3294ef[_0x18ef('0x43')]=moment();if(this[_0x18ef('0x5b')](_0x3294ef['delay'])){_0x3294ef[_0x18ef('0x43')]=moment()[_0x18ef('0x7c')](_0x3294ef['delay'],'minutes');}if(!this[_0x18ef('0x5b')](_0x3294ef['callback_priority'])){_0x3294ef[_0x18ef('0x46')]=0x2;}this[_0x18ef('0x3c')][_0x18ef('0x73')](this,_0x3294ef);return this[_0x18ef('0xe')][_0x18ef('0x7d')](util[_0x18ef('0x25')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x3294ef[_0x18ef('0x41')],_0x3294ef[_0x18ef('0x42')],_0x3294ef[_0x18ef('0x43')]));};AGIVertices['prototype'][_0x18ef('0x7e')]=function(_0x1e1630){logger['info'](util[_0x18ef('0x25')](_0x18ef('0x7f'),_0x1e1630[_0x18ef('0x34')]));var _0x47a98f=this[_0x18ef('0xe')][_0x18ef('0x4f')](_0x1e1630[_0x18ef('0x80')],_0x1e1630[_0x18ef('0x81')]);if(_0x47a98f['result']===-0x1){return _0x47a98f;}return this[_0x18ef('0xe')]['noop'](util[_0x18ef('0x25')]('Executed\x20command\x20%s\x20%s',_0x1e1630[_0x18ef('0x80')],_0x1e1630[_0x18ef('0x81')]));};AGIVertices[_0x18ef('0x11')][_0x18ef('0x82')]=function(_0xeae2b6){logger[_0x18ef('0x29')](util[_0x18ef('0x25')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0xeae2b6['label']));if(!this[_0x18ef('0x5b')](_0xeae2b6[_0x18ef('0x51')])){return this[_0x18ef('0xe')][_0x18ef('0x7d')]('no\x20text\x20configured');}var _0x55c24a='\x22'+_0xeae2b6[_0x18ef('0x51')]+'\x22';if(this[_0x18ef('0x5b')](_0xeae2b6[_0x18ef('0x81')])){_0x55c24a+=','+_0xeae2b6[_0x18ef('0x81')];}var _0x40f0b3=this['channel'][_0x18ef('0x4f')](_0x18ef('0x83'),_0x55c24a);if(_0x40f0b3[_0x18ef('0x70')]===-0x1){return _0x40f0b3;}return this[_0x18ef('0xe')]['noop'](util[_0x18ef('0x25')](_0x18ef('0x84'),_0x55c24a));};AGIVertices['prototype'][_0x18ef('0x85')]=function(_0x4da315){logger['info'](util[_0x18ef('0x25')](_0x18ef('0x86'),_0x4da315[_0x18ef('0x34')]));if(!this[_0x18ef('0x5b')](_0x4da315[_0x18ef('0x87')])){return this[_0x18ef('0xe')][_0x18ef('0x7d')](_0x18ef('0x88'));}var _0x4ff948=_0x4da315[_0x18ef('0x87')];if(this[_0x18ef('0x5b')](_0x4da315[_0x18ef('0x81')])){_0x4ff948+=','+_0x4da315[_0x18ef('0x81')];}var _0x131b15=this['channel']['exec'](_0x18ef('0x89'),_0x4ff948);if(_0x131b15[_0x18ef('0x70')]===-0x1){return _0x131b15;}var _0x590359=this[_0x18ef('0x6f')](_0x18ef('0x8a'),_0x18ef('0x8b'));if(_0x590359['result']===-0x1){return _0x590359;}var _0x46ed1d=this[_0x18ef('0x6f')]('RECOG_INPUT()',_0x18ef('0x8c'));if(_0x46ed1d['result']===-0x1){return _0x46ed1d;}var _0x3bffce=this[_0x18ef('0x6f')](_0x18ef('0x8d'),_0x18ef('0x8e'));if(_0x3bffce[_0x18ef('0x70')]===-0x1){return _0x3bffce;}return this[_0x18ef('0xe')][_0x18ef('0x7d')](util['format'](_0x18ef('0x8f'),_0x4ff948));};AGIVertices['prototype'][_0x18ef('0x90')]=function(_0x18161c){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0x91'),_0x18161c[_0x18ef('0x34')]));if(!this[_0x18ef('0x5b')](_0x18161c['odbc_id'])){return this['channel'][_0x18ef('0x2d')](_0x18161c,_0x18ef('0x92'));}var _0x3ba4ea=this[_0x18ef('0x18')]['sync'](this,_0x18161c['odbc_id']);if(!_0x3ba4ea){return this['channel'][_0x18ef('0x2d')](_0x18161c,'no\x20odbc\x20database\x20found');}if(!this[_0x18ef('0x5b')](_0x18161c['query'])){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x18161c,_0x18ef('0x93'));}var _0x14d51e=_0x18161c[_0x18ef('0x2b')][_0x18ef('0x94')](/(\r\n|\n|\r)/gm,'\x20');this[_0x18ef('0xe')]['noop'](util[_0x18ef('0x25')]('query:\x20%s',_0x14d51e));var _0x2d5bbb=this[_0x18ef('0x27')][_0x18ef('0x73')](this,_0x3ba4ea,_0x14d51e);this[_0x18ef('0x32')][_0x18ef('0x73')](this,_0x18161c,_0x14d51e);if(!this['isConfigured'](_0x18161c[_0x18ef('0x95')])){return this[_0x18ef('0xe')]['noop'](_0x18ef('0x96'));}var _0x4dcb1f=this[_0x18ef('0x12')][_0x18ef('0x73')](this,_0x18161c[_0x18ef('0x95')]);if(!_0x4dcb1f){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x18161c,_0x18ef('0x97'));}var _0x3dabfd=this;_0x2d5bbb[_0x18ef('0x98')](function(_0x5cdb99,_0x5827e5){Object[_0x18ef('0x99')](_0x5cdb99)[_0x18ef('0x98')](function(_0x5926b9){_0x3dabfd[_0x18ef('0xe')][_0x18ef('0x71')](util[_0x18ef('0x25')](_0x18ef('0x9a'),_0x4dcb1f,_0x5827e5,_0x5926b9),_0x5cdb99[_0x5926b9]);});});this['channel'][_0x18ef('0x71')](util[_0x18ef('0x25')]('%s_ROWS_COUNT',_0x4dcb1f),_0x2d5bbb[_0x18ef('0x6d')]);return this[_0x18ef('0xe')]['noop'](util[_0x18ef('0x25')]('variable\x20%s\x20set',_0x4dcb1f));};AGIVertices[_0x18ef('0x11')]['dial']=function(_0x4e481c){logger[_0x18ef('0x9b')](util[_0x18ef('0x25')](_0x18ef('0x9c'),_0x4e481c['label']));if(!this[_0x18ef('0x5b')](_0x4e481c[_0x18ef('0x9d')])){return this['channel'][_0x18ef('0x2d')](_0x4e481c,_0x18ef('0x9e'));}var _0x5ddeeb=this[_0x18ef('0x1b')][_0x18ef('0x73')](this,_0x4e481c[_0x18ef('0x9d')]);if(!_0x5ddeeb){return this['channel'][_0x18ef('0x2d')](_0x4e481c,_0x18ef('0x9f'));}var _0x29bdfd=this['channel']['exec'](_0x18ef('0xa0'),[util['format'](_0x18ef('0xa1'),_0x5ddeeb),_0x4e481c[_0x18ef('0x77')],_0x4e481c['opts'],_0x4e481c['url']]);if(_0x29bdfd[_0x18ef('0x70')]===-0x1){return _0x29bdfd;}return this[_0x18ef('0xe')][_0x18ef('0x7d')](util[_0x18ef('0x25')](_0x18ef('0xa2'),'DIAL'));};AGIVertices[_0x18ef('0x11')][_0x18ef('0xa3')]=function(_0x3f0eaf){logger['info'](util[_0x18ef('0x25')](_0x18ef('0xa4'),_0x3f0eaf[_0x18ef('0x34')]));if(!this[_0x18ef('0x5b')](_0x3f0eaf[_0x18ef('0x54')])){return this[_0x18ef('0xe')][_0x18ef('0x7d')](_0x18ef('0xa5'));}if(!this[_0x18ef('0x5b')](_0x3f0eaf['text'])){return this[_0x18ef('0xe')][_0x18ef('0x7d')](_0x18ef('0xa6'));}this[_0x18ef('0xe')][_0x18ef('0x7d')](util['format'](_0x18ef('0xa7'),_0x3f0eaf[_0x18ef('0x51')]));var _0x4189d5=this['googleDialogflow'][_0x18ef('0x73')](this,_0x3f0eaf);if(_0x4189d5){for(var _0x4fbd49 in _0x4189d5){if(_0x4189d5[_0x18ef('0xa8')](_0x4fbd49)){this[_0x18ef('0xe')][_0x18ef('0x71')](util[_0x18ef('0x25')](_0x18ef('0xa9'),_0x4fbd49['toUpperCase']()),_0x4189d5[_0x4fbd49]);}}return this[_0x18ef('0xe')][_0x18ef('0x7d')](util[_0x18ef('0x25')](_0x18ef('0xaa'),_0x4189d5['speech']));}return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x3f0eaf,_0x18ef('0xab'));};AGIVertices[_0x18ef('0x11')][_0x18ef('0xac')]=function(_0x52d534){logger[_0x18ef('0x29')](util['format'](_0x18ef('0xad'),_0x52d534['label']));return this[_0x18ef('0xe')]['noop'](_0x18ef('0xac'));};AGIVertices[_0x18ef('0x11')][_0x18ef('0xae')]=function(_0x594780){logger['info'](util['format'](_0x18ef('0xaf'),_0x594780[_0x18ef('0x34')]));var _0x2742ef='';if(_0x594780[_0x18ef('0xb0')]){if(!this['isConfigured'](_0x594780[_0x18ef('0xb0')])){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x594780,_0x18ef('0xb1'));}else{var _0x35ed18=parseInt(_0x594780['trunk_id'],0xa);if(isNaN(_0x35ed18)){_0x2742ef=_0x594780[_0x18ef('0xb0')];}else{_0x2742ef=this[_0x18ef('0xb2')][_0x18ef('0x73')](this,_0x594780[_0x18ef('0xb0')]);if(!_0x2742ef){return this['channel'][_0x18ef('0x2d')](_0x594780,_0x18ef('0xb3'));}}}}else if(_0x594780[_0x18ef('0xb4')]){_0x2742ef=_0x594780['trunk_name'];}else{return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x594780,'no\x20trunk\x20selected');}var _0x93a67=this['channel'][_0x18ef('0x4f')]('DIAL',[util[_0x18ef('0x25')]('SIP/%s/%s',_0x2742ef,_0x594780[_0x18ef('0x41')]),_0x594780['timeout'],_0x594780['opts'],_0x594780['url']]);if(_0x93a67[_0x18ef('0x70')]===-0x1){return _0x93a67;}return this[_0x18ef('0xe')][_0x18ef('0x7d')](util[_0x18ef('0x25')](_0x18ef('0xa2'),_0x18ef('0xa0')));};AGIVertices['prototype']['finally']=function(_0x26ea67){logger[_0x18ef('0x29')](util[_0x18ef('0x25')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x26ea67[_0x18ef('0x34')]));return this[_0x18ef('0xe')][_0x18ef('0x7d')](_0x18ef('0xb5'));};AGIVertices[_0x18ef('0x11')][_0x18ef('0xb6')]=function(_0x4d93be){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0xb7'),_0x4d93be[_0x18ef('0x34')]));if(_0x4d93be[_0x18ef('0xb8')]===0x0){return this[_0x18ef('0x72')](_0x4d93be);}_0x4d93be[_0x18ef('0xb8')]-=0x1;if(!this[_0x18ef('0x5b')](_0x4d93be['file_id'])){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x4d93be,_0x18ef('0xb9'));}var _0x54859b=this[_0x18ef('0x1d')][_0x18ef('0x73')](this,_0x4d93be[_0x18ef('0xba')]);if(!_0x54859b){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x4d93be,_0x18ef('0xbb'));}if(!this[_0x18ef('0x5b')](_0x4d93be[_0x18ef('0x95')])){return this['channel'][_0x18ef('0x2d')](_0x18ef('0x96'));}var _0x137c88=this[_0x18ef('0xe')][_0x18ef('0xbc')](_0x54859b,_0x4d93be[_0x18ef('0xbd')],_0x4d93be[_0x18ef('0xbe')]);var _0x44c8f5=_0x137c88[_0x18ef('0x70')]?_0x137c88[_0x18ef('0x70')][_0x18ef('0x45')]():'';logger[_0x18ef('0x29')](_0x18ef('0xbf'),JSON[_0x18ef('0xc0')](_0x137c88));if(_0x137c88[_0x18ef('0x70')]===-0x1){this[_0x18ef('0x32')]['sync'](this,_0x4d93be,_0x44c8f5);return _0x137c88;}else if(_0x137c88[_0x18ef('0x6e')]===_0x18ef('0x77')){_0x137c88[_0x18ef('0x70')]=_0x44c8f5[_0x18ef('0x6d')]>=parseInt(_0x4d93be[_0x18ef('0xc1')])?'x':'i';}else{_0x137c88[_0x18ef('0x70')]=_0x44c8f5[_0x18ef('0x6d')]>=parseInt(_0x4d93be[_0x18ef('0xc1')])&&_0x44c8f5['length']<=parseInt(_0x4d93be[_0x18ef('0xbe')])?'x':'i';}var _0x3505e8=this[_0x18ef('0x12')][_0x18ef('0x73')](this,_0x4d93be['variable_id']);if(!_0x3505e8){return this['channel'][_0x18ef('0x2d')](_0x4d93be,_0x18ef('0x97'));}this[_0x18ef('0xe')][_0x18ef('0x71')](_0x3505e8,_0x44c8f5);if(this[_0x18ef('0x5b')](_0x4d93be[_0x18ef('0xc2')])){var _0x560d61=parseInt(_0x4d93be[_0x18ef('0xc2')],0xa);var _0x33381c=rs[_0x18ef('0xc3')]({'charset':'*','length':_0x560d61});var _0x25ba65=_0x44c8f5[_0x18ef('0x6d')];if(_0x25ba65>0x0){if(_0x25ba65>_0x560d61){this[_0x18ef('0x32')]['sync'](this,_0x4d93be,_0x4d93be[_0x18ef('0xc4')]===_0x18ef('0xc5')?_0x33381c+_0x44c8f5['substr'](_0x560d61):_0x44c8f5[_0x18ef('0xc6')](0x0,_0x25ba65-_0x560d61)+_0x33381c);}else{this[_0x18ef('0x32')][_0x18ef('0x73')](this,_0x4d93be,rs[_0x18ef('0xc3')]({'charset':'*','length':_0x25ba65}));}}else{this[_0x18ef('0x32')][_0x18ef('0x73')](this,_0x4d93be,'');}}else{this[_0x18ef('0x32')][_0x18ef('0x73')](this,_0x4d93be,_0x44c8f5);}return _0x137c88;};AGIVertices[_0x18ef('0x11')]['getsecretdigits']=function(_0x1e3b62){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0xc7'),_0x1e3b62[_0x18ef('0x34')]));return this['getdigits'](_0x1e3b62);};AGIVertices['prototype'][_0x18ef('0xc8')]=function(_0x4634fd){logger['info'](util['format'](_0x18ef('0xc9'),_0x4634fd['label']));this[_0x18ef('0x32')]['sync'](this,_0x4634fd,_0x4634fd['goalname']);return this['channel'][_0x18ef('0x7d')](util['format'](_0x18ef('0xca'),_0x4634fd[_0x18ef('0xcb')]));};AGIVertices[_0x18ef('0x11')][_0x18ef('0xcc')]=function(_0x364f47){logger[_0x18ef('0x29')](util['format'](_0x18ef('0xcd'),_0x364f47[_0x18ef('0x34')]));if(!this[_0x18ef('0x5b')](_0x364f47[_0x18ef('0x5e')])||!this[_0x18ef('0x5b')](_0x364f47[_0x18ef('0xce')])){return this[_0x18ef('0xe')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x364f47[_0x18ef('0x51')])){return this[_0x18ef('0xe')]['noop'](_0x18ef('0xa6'));}this[_0x18ef('0xe')][_0x18ef('0x7d')](util[_0x18ef('0x25')](_0x18ef('0xcf'),_0x364f47[_0x18ef('0x51')]));var _0x1d5080=this['awsPolly']['sync'](this,_0x364f47);if(_0x1d5080){this[_0x18ef('0xe')][_0x18ef('0x7d')](util[_0x18ef('0x25')](_0x18ef('0xd0'),_0x1d5080));var _0x3cc8d3=this['channel'][_0x18ef('0xd1')](_0x1d5080);try{fs[_0x18ef('0xd2')](_0x1d5080+_0x18ef('0xd3'));}catch(_0x4cf603){logger['error'](_0x4cf603);}return _0x3cc8d3;}return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x364f47,_0x18ef('0xd4'));};AGIVertices[_0x18ef('0x11')][_0x18ef('0xd5')]=function(_0x3a7b2a){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0xd6'),_0x3a7b2a['label'],_0x3a7b2a['timeout']));if(!this['isConfigured'](_0x3a7b2a['key'])){return this['channel'][_0x18ef('0x7d')](_0x18ef('0xa5'));}var _0x288470=_0x18ef('0xd7');var _0x405dde=util[_0x18ef('0x25')](_0x18ef('0xd8'),FILES_PATH,rs[_0x18ef('0xc3')](0x4));var _0x173137=util[_0x18ef('0x25')](_0x18ef('0xd9'),_0x405dde,_0x288470);var _0x34bf36=!![];if(_0x3a7b2a[_0x18ef('0xda')]===_0x18ef('0xdb')){_0x34bf36=![];}var _0x51382b=this[_0x18ef('0xe')][_0x18ef('0xdc')](_0x405dde,_0x288470,_0x3a7b2a[_0x18ef('0xdd')],_0x3a7b2a[_0x18ef('0x77')],undefined,_0x34bf36);if(_0x51382b[_0x18ef('0x70')]!==-0x1){this[_0x18ef('0xe')][_0x18ef('0x7d')](util[_0x18ef('0x25')](_0x18ef('0xde'),_0x173137));var _0x48c5f2=this[_0x18ef('0x61')][_0x18ef('0x73')](this,_0x3a7b2a,_0x173137);if(_0x48c5f2){for(var _0x43d42a in _0x48c5f2){if(_0x48c5f2[_0x18ef('0xa8')](_0x43d42a)){this['channel'][_0x18ef('0x71')](util[_0x18ef('0x25')](_0x18ef('0xdf'),_0x43d42a[_0x18ef('0xe0')]()),_0x48c5f2[_0x43d42a]);}}return this['channel'][_0x18ef('0x7d')](util[_0x18ef('0x25')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x48c5f2)));}}return _0x51382b;};AGIVertices['prototype'][_0x18ef('0xe1')]=function(_0x5ae692){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0xe2'),_0x5ae692[_0x18ef('0x34')]));if(!this[_0x18ef('0x5b')](_0x5ae692[_0x18ef('0x64')])){return this[_0x18ef('0xe')][_0x18ef('0x7d')](_0x18ef('0xe3'));}if(!this[_0x18ef('0x5b')](_0x5ae692[_0x18ef('0x65')])){return this[_0x18ef('0xe')][_0x18ef('0x7d')](_0x18ef('0xe4'));}var _0x4693f1='wav';var _0x5916cd=util[_0x18ef('0x25')]('%s/recordings/%s',FILES_PATH,rs[_0x18ef('0xc3')](0x4));var _0x1c0e38=util['format'](_0x18ef('0xd9'),_0x5916cd,_0x4693f1);var _0xc4261d=!![];if(_0x5ae692[_0x18ef('0xda')]===_0x18ef('0xdb')){_0xc4261d=![];}var _0x48c1c7=this[_0x18ef('0xe')][_0x18ef('0xdc')](_0x5916cd,_0x4693f1,_0x5ae692['intKey'],_0x5ae692[_0x18ef('0x77')],undefined,_0xc4261d);if(_0x48c1c7['result']!==-0x1){this[_0x18ef('0xe')][_0x18ef('0x7d')](util[_0x18ef('0x25')]('tilde\x20%s\x20file\x20created',_0x1c0e38));var _0x5ec777=this[_0x18ef('0x63')]['sync'](this,_0x5ae692,_0x1c0e38);if(_0x5ec777){for(var _0x9a67a5 in _0x5ec777){if(_0x5ec777['hasOwnProperty'](_0x9a67a5)){this[_0x18ef('0xe')][_0x18ef('0x71')](util[_0x18ef('0x25')](_0x18ef('0xe5'),_0x9a67a5[_0x18ef('0xe0')]()),_0x5ec777[_0x9a67a5]);}}return this['channel'][_0x18ef('0x7d')](util[_0x18ef('0x25')](_0x18ef('0xe6'),JSON['stringify'](_0x5ec777)));}}return _0x48c1c7;};AGIVertices['prototype'][_0x18ef('0xe7')]=function(_0xed3608){logger[_0x18ef('0x29')](util['format'](_0x18ef('0xe8'),_0xed3608[_0x18ef('0x34')]));return this[_0x18ef('0xe')][_0x18ef('0xe9')](_0xed3608[_0x18ef('0xea')],_0xed3608['extension'],_0xed3608[_0x18ef('0xeb')]);};AGIVertices[_0x18ef('0x11')][_0x18ef('0xec')]=function(_0x5c693f){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0xed'),_0x5c693f[_0x18ef('0x34')]));if(!this[_0x18ef('0x5b')](_0x5c693f[_0x18ef('0xee')])){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x5c693f,_0x18ef('0xef'));}try{var _0xfe4df5=eval(_0x5c693f[_0x18ef('0xee')])?_0x18ef('0xf0'):_0x18ef('0xf1');this[_0x18ef('0xe')][_0x18ef('0x7d')](util[_0x18ef('0x25')](_0x18ef('0xf2'),_0x5c693f['condition'],_0xfe4df5));return{'code':0xc8,'result':_0xfe4df5};}catch(_0x2ce2d1){return{'code':0xc8,'result':_0x18ef('0xf1')};}};AGIVertices['prototype'][_0x18ef('0xf3')]=function(_0x94b18e){logger['info'](util[_0x18ef('0x25')](_0x18ef('0xf4'),_0x94b18e[_0x18ef('0x34')]));if(!this['isConfigured'](_0x94b18e['interval_id'])){return this[_0x18ef('0xe')]['error'](_0x94b18e,_0x18ef('0xf5'));}var _0x46959f=this['getIntervals']['sync'](this,_0x94b18e[_0x18ef('0xf6')]);if(!_0x46959f){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x94b18e,_0x18ef('0xf7'));}for(var _0x526444=0x0;_0x526444<_0x46959f[_0x18ef('0x6d')];_0x526444+=0x1){var _0x292a63=this[_0x18ef('0xe')][_0x18ef('0x12')](util[_0x18ef('0x25')](_0x18ef('0xf8'),_0x46959f[_0x526444]));if(_0x292a63[_0x18ef('0x70')]===-0x1){return _0x292a63;}logger['info'](util[_0x18ef('0x25')]('IFTIME\x20%s\x20%s',_0x46959f[_0x526444],_0x292a63[_0x18ef('0x6e')]));if(_0x292a63[_0x18ef('0x6e')]===_0x18ef('0xf0')){logger[_0x18ef('0x29')](util['format'](_0x18ef('0xf9'),_0x46959f[_0x526444],'true'));this[_0x18ef('0xe')][_0x18ef('0x7d')](util['format'](_0x18ef('0xf9'),_0x46959f[_0x526444],_0x18ef('0xf0')));return{'code':0xc8,'result':_0x18ef('0xf0')};}else{logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0xf9'),_0x46959f[_0x526444],_0x18ef('0xf1')));this[_0x18ef('0xe')][_0x18ef('0x7d')](util[_0x18ef('0x25')](_0x18ef('0xf9'),_0x46959f[_0x526444],_0x18ef('0xf1')));}}return{'code':0xc8,'result':_0x18ef('0xf1')};};AGIVertices[_0x18ef('0x11')][_0x18ef('0xfa')]=function(_0x5ca8f4){logger[_0x18ef('0x29')](util['format'](_0x18ef('0xfb'),_0x5ca8f4[_0x18ef('0x34')]));return this[_0x18ef('0xe')]['hangup']();};AGIVertices[_0x18ef('0x11')]['ispeechasr']=function(_0x797d4d){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0xfc'),_0x797d4d['label']));if(!this[_0x18ef('0x5b')](_0x797d4d[_0x18ef('0x54')])){return this['channel'][_0x18ef('0x7d')](_0x18ef('0xa5'));}var _0x2f7b29='wav';var _0xb6ce6=util['format'](_0x18ef('0xd8'),FILES_PATH,rs[_0x18ef('0xc3')](0x4));var _0x1cbb14=util['format']('%s.%s',_0xb6ce6,_0x2f7b29);var _0x206bc3=!![];if(_0x797d4d[_0x18ef('0xda')]===_0x18ef('0xdb')){_0x206bc3=![];}var _0x410931=this['channel']['recordFile'](_0xb6ce6,_0x2f7b29,_0x797d4d[_0x18ef('0xdd')],_0x797d4d[_0x18ef('0x77')],undefined,_0x206bc3);if(_0x410931[_0x18ef('0x70')]!==-0x1){this[_0x18ef('0xe')]['noop'](util['format'](_0x18ef('0xfd'),_0x1cbb14));var _0x204d6e=this['ispeechASR']['sync'](this,_0x797d4d,_0x1cbb14);if(_0x204d6e){for(var _0x1408cf in _0x204d6e){if(_0x204d6e[_0x18ef('0xa8')](_0x1408cf)){this[_0x18ef('0xe')][_0x18ef('0x71')](util[_0x18ef('0x25')]('ISPEECH_ASR_%s',_0x1408cf[_0x18ef('0xe0')]()),_0x204d6e[_0x1408cf]);}}return this['channel'][_0x18ef('0x7d')](util[_0x18ef('0x25')](_0x18ef('0xfe'),JSON['stringify'](_0x204d6e)));}}return _0x410931;};AGIVertices[_0x18ef('0x11')][_0x18ef('0xff')]=function(_0xb61e50){logger['info'](util[_0x18ef('0x25')](_0x18ef('0x100'),_0xb61e50[_0x18ef('0x34')]));if(!this[_0x18ef('0x5b')](_0xb61e50[_0x18ef('0x54')])){return this[_0x18ef('0xe')][_0x18ef('0x7d')](_0x18ef('0xa5'));}if(!this[_0x18ef('0x5b')](_0xb61e50['text'])){return this[_0x18ef('0xe')][_0x18ef('0x7d')]('no\x20text\x20configured');}this[_0x18ef('0xe')][_0x18ef('0x7d')](util[_0x18ef('0x25')]('Trying\x20ispeech\x20TTS\x20%s',_0xb61e50[_0x18ef('0x51')]));var _0x53401a=this['ispeechTTS']['sync'](this,_0xb61e50);if(_0x53401a){this[_0x18ef('0xe')][_0x18ef('0x7d')](util['format'](_0x18ef('0xfd'),_0x53401a));var _0x18c5d9=this[_0x18ef('0xe')][_0x18ef('0xd1')](_0x53401a,_0xb61e50[_0x18ef('0xdd')]);try{fs['unlink'](_0x53401a+_0x18ef('0xd3'));}catch(_0x223fd8){logger[_0x18ef('0x2d')](_0x223fd8);}return _0x18c5d9;}return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0xb61e50,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x18ef('0x11')][_0x18ef('0x101')]=function(_0x53ff9c){logger[_0x18ef('0x29')](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x53ff9c[_0x18ef('0x34')]));if(!this[_0x18ef('0x5b')](_0x53ff9c[_0x18ef('0x102')])){return this['channel'][_0x18ef('0x2d')](_0x53ff9c,_0x18ef('0x103'));}logger['info'](util[_0x18ef('0x25')](_0x18ef('0x104'),this[_0x18ef('0xe')][_0x18ef('0x37')],_0x53ff9c[_0x18ef('0x102')]));var _0x2e25dd=this[_0x18ef('0x4b')]['sync'](this,_0x53ff9c['findBy']);if(_0x2e25dd){logger[_0x18ef('0x29')](util['format'](_0x18ef('0x105'),this[_0x18ef('0xe')]['callerid'],_0x53ff9c[_0x18ef('0x102')]));this['channel']['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x18ef('0xe')][_0x18ef('0x37')],_0x53ff9c['findBy']));return{'code':0xc8,'result':_0x18ef('0x106')};}else{logger[_0x18ef('0x29')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x18ef('0xe')][_0x18ef('0x37')],_0x53ff9c['findBy']));this['channel']['noop'](util[_0x18ef('0x25')](_0x18ef('0x107'),this[_0x18ef('0xe')][_0x18ef('0x37')],_0x53ff9c[_0x18ef('0x102')]));return{'code':0xc8,'result':_0x18ef('0x108')};}};AGIVertices['prototype'][_0x18ef('0x109')]=function(_0x58a391){logger[_0x18ef('0x29')](util[_0x18ef('0x25')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x58a391['label']));if(!this['isConfigured'](_0x58a391[_0x18ef('0x102')])){return this['channel'][_0x18ef('0x2d')](_0x58a391,_0x18ef('0x103'));}logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0x104'),this[_0x18ef('0xe')][_0x18ef('0x37')],_0x58a391[_0x18ef('0x102')]));var _0x50f4c7=this[_0x18ef('0x10a')][_0x18ef('0x73')](this,_0x58a391[_0x18ef('0x102')]);if(_0x50f4c7){logger[_0x18ef('0x29')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x18ef('0xe')][_0x18ef('0x37')],_0x58a391[_0x18ef('0x102')]));this[_0x18ef('0xe')][_0x18ef('0x7d')](util['format'](_0x18ef('0x105'),this[_0x18ef('0xe')][_0x18ef('0x37')],_0x58a391[_0x18ef('0x102')]));return{'code':0xc8,'result':_0x18ef('0x106')};}else{logger[_0x18ef('0x29')](util[_0x18ef('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x58a391[_0x18ef('0x102')]));this['channel'][_0x18ef('0x7d')](util[_0x18ef('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x18ef('0xe')][_0x18ef('0x37')],_0x58a391[_0x18ef('0x102')]));return{'code':0xc8,'result':_0x18ef('0x108')};}};AGIVertices[_0x18ef('0x11')][_0x18ef('0x10b')]=function(_0x22da96){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0x10c'),_0x22da96[_0x18ef('0x34')]));if(!this[_0x18ef('0x5b')](_0x22da96[_0x18ef('0x10d')])){return this['channel']['error'](_0x22da96,_0x18ef('0x10e'));}this[_0x18ef('0xe')][_0x18ef('0x7d')](util[_0x18ef('0x25')](_0x18ef('0x10f'),_0x22da96[_0x18ef('0x10d')]));var _0x4673be=eval(_0x22da96[_0x18ef('0x10d')]);if(!this[_0x18ef('0x5b')](_0x22da96[_0x18ef('0x95')])){return this[_0x18ef('0xe')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0xdf9d4a=this['getVariable'][_0x18ef('0x73')](this,_0x22da96[_0x18ef('0x95')]);if(!_0xdf9d4a){return this['channel'][_0x18ef('0x2d')](_0x22da96,_0x18ef('0x97'));}if(_['isArray'](_0x4673be)){var _0x21e219=this;_0x4673be[_0x18ef('0x98')](function(_0x31ce8b,_0x4a949a){_0x21e219[_0x18ef('0xe')][_0x18ef('0x71')](util['format'](_0x18ef('0x110'),_0xdf9d4a,_0x4a949a),_0x31ce8b);});return this[_0x18ef('0xe')][_0x18ef('0x7d')](util[_0x18ef('0x25')](_0x18ef('0x111'),_0xdf9d4a));}else{return this[_0x18ef('0xe')][_0x18ef('0x71')](_0xdf9d4a,_0x4673be);}};AGIVertices[_0x18ef('0x11')][_0x18ef('0xc')]=function(_0x4cadae){logger['info'](util[_0x18ef('0x25')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x4cadae[_0x18ef('0x34')]));if(_0x4cadae[_0x18ef('0xb8')]===0x0){return this[_0x18ef('0x72')](_0x4cadae);}_0x4cadae[_0x18ef('0xb8')]-=0x1;if(!this[_0x18ef('0x5b')](_0x4cadae['file_id'])){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x4cadae,_0x18ef('0xb9'));}var _0x3e5b48=this[_0x18ef('0x1d')][_0x18ef('0x73')](this,_0x4cadae[_0x18ef('0xba')]);if(!_0x3e5b48){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x4cadae,_0x18ef('0xbb'));}var _0x5f5c22=this['channel'][_0x18ef('0xbc')](_0x3e5b48,_0x4cadae[_0x18ef('0xbd')],_0x4cadae[_0x18ef('0x112')]);var _0x22694e=_0x5f5c22[_0x18ef('0x70')];if(_0x5f5c22[_0x18ef('0x70')]===-0x1){this['createSquareDetailsReport'][_0x18ef('0x73')](this,_0x4cadae,'-1');return _0x5f5c22;}else if(_0x5f5c22[_0x18ef('0x6e')]===_0x18ef('0x77')){_0x5f5c22['result']=_0x5f5c22['result'][_0x18ef('0x6d')]>0x0?_0x5f5c22[_0x18ef('0x70')]:'t';}else if(_[_0x18ef('0x3d')](_0x5f5c22[_0x18ef('0x70')])){_0x5f5c22['result']='#';_0x22694e='#';}if(!this[_0x18ef('0x5b')](_0x4cadae[_0x18ef('0x95')])){this[_0x18ef('0xe')][_0x18ef('0x7d')](_0x18ef('0x96'));}else{var _0x4fe8d9=this['getVariable'][_0x18ef('0x73')](this,_0x4cadae[_0x18ef('0x95')]);if(!_0x4fe8d9){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x4cadae,'no\x20variable\x20found');}this[_0x18ef('0xe')]['setVariable'](_0x4fe8d9,_0x22694e);}this[_0x18ef('0x32')]['sync'](this,_0x4cadae,_0x22694e);return _0x5f5c22;};AGIVertices[_0x18ef('0x11')]['noop']=function(_0x4a4381){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0x113'),_0x4a4381[_0x18ef('0x34')]));return this[_0x18ef('0xe')][_0x18ef('0x7d')](_0x4a4381[_0x18ef('0x114')]||_0x4a4381[_0x18ef('0x34')]);};AGIVertices[_0x18ef('0x11')][_0x18ef('0x115')]=function(_0x3822a4){logger['info'](util[_0x18ef('0x25')](_0x18ef('0x116'),_0x3822a4['label']));if(!this[_0x18ef('0x5b')](_0x3822a4['findBy'])){return this[_0x18ef('0xe')]['error'](_0x3822a4,'no\x20find\x20by\x20configured');}logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0x104'),this['channel'][_0x18ef('0x37')],_0x3822a4[_0x18ef('0x102')]));var _0x303d70=this[_0x18ef('0x117')][_0x18ef('0x73')](this,_0x3822a4[_0x18ef('0x118')]);var _0x37029c=this[_0x18ef('0x48')][_0x18ef('0x73')](this,_0x3822a4[_0x18ef('0x102')],_0x303d70);if(_0x37029c){logger[_0x18ef('0x29')](util['format'](_0x18ef('0x105'),this[_0x18ef('0xe')]['callerid'],_0x3822a4[_0x18ef('0x102')]));this[_0x18ef('0xe')][_0x18ef('0x7d')](util['format'](_0x18ef('0x105'),this[_0x18ef('0xe')]['callerid'],_0x3822a4['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0x107'),this[_0x18ef('0xe')]['callerid'],_0x3822a4[_0x18ef('0x102')]));this[_0x18ef('0xe')]['noop'](util[_0x18ef('0x25')](_0x18ef('0x105'),this[_0x18ef('0xe')]['callerid'],_0x3822a4['findBy']));return{'code':0xc8,'result':_0x18ef('0x108')};}};AGIVertices[_0x18ef('0x11')][_0x18ef('0x119')]=function(_0x958a33){logger['info'](util[_0x18ef('0x25')](_0x18ef('0x11a'),_0x958a33[_0x18ef('0x34')]));if(!this[_0x18ef('0x5b')](_0x958a33[_0x18ef('0xba')])){return this['channel'][_0x18ef('0x2d')](_0x958a33,_0x18ef('0xb9'));}var _0x62d278=this[_0x18ef('0x1d')][_0x18ef('0x73')](this,_0x958a33[_0x18ef('0xba')]);if(!_0x62d278){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x958a33,'no\x20file\x20audio\x20found');}var _0x2a04b3=this[_0x18ef('0xe')][_0x18ef('0x4f')](_0x18ef('0x11b'),[_0x62d278,_0x958a33[_0x18ef('0x11c')]]);if(_0x2a04b3[_0x18ef('0x70')]===-0x1){return _0x2a04b3;}return this['channel'][_0x18ef('0x7d')](util[_0x18ef('0x25')](_0x18ef('0x11d'),'PLAYBACK',_0x62d278));};AGIVertices[_0x18ef('0x11')]['queue']=function(_0x586d88){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0x11e'),_0x586d88[_0x18ef('0x34')]));if(!this['isConfigured'](_0x586d88['queue_id'])){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x586d88,_0x18ef('0x11f'));}var _0x130da2='';var _0x135146=parseInt(_0x586d88['queue_id'],0xa);if(isNaN(_0x135146)){_0x130da2=_0x586d88[_0x18ef('0x120')];}else{_0x130da2=this['getVoiceQueue']['sync'](this,_0x586d88[_0x18ef('0x120')]);if(!_0x130da2){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x586d88,'no\x20queue\x20found');}}var _0x5b24af='';if(this[_0x18ef('0x5b')](_0x586d88[_0x18ef('0xba')])){var _0x2822e3=this[_0x18ef('0x1d')][_0x18ef('0x73')](this,_0x586d88[_0x18ef('0xba')]);if(_0x2822e3){_0x5b24af=_0x2822e3;}}this[_0x18ef('0x32')][_0x18ef('0x73')](this,_0x586d88,_0x130da2);if(_0x586d88[_0x18ef('0x11c')][_0x18ef('0x121')]('x')<0x0){_0x586d88[_0x18ef('0x11c')]+='x';}if(_0x586d88[_0x18ef('0x11c')][_0x18ef('0x121')]('X')<0x0){_0x586d88[_0x18ef('0x11c')]+='X';}this[_0x18ef('0xe')]['setVariable'](_0x18ef('0x122'),_0x130da2?_0x130da2[_0x18ef('0x123')]():'');var _0x591a51=this[_0x18ef('0xe')]['exec'](_0x18ef('0x124'),[_0x130da2,_0x586d88[_0x18ef('0x11c')],_0x586d88[_0x18ef('0x125')],_0x5b24af,_0x586d88[_0x18ef('0x77')],_0x586d88['agi'],_0x586d88['macro'],_0x586d88[_0x18ef('0x126')],'',_0x586d88[_0x18ef('0x127')]]);if(_0x591a51[_0x18ef('0x70')]===-0x1){return _0x591a51;}return this[_0x18ef('0xe')]['noop'](util[_0x18ef('0x25')]('Executed\x20command\x20%s\x20%s','QUEUE',_0x130da2));};AGIVertices[_0x18ef('0x11')][_0x18ef('0x128')]=function(_0x2a8c2f){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0x129'),_0x2a8c2f[_0x18ef('0x34')]));var _0x575c58=_0x2a8c2f['recordingFormat']||_0x18ef('0xd7');var _0x46c9b0=util[_0x18ef('0x25')](_0x18ef('0x12a'),this[_0x18ef('0xe')]['uniqueid'],rs[_0x18ef('0xc3')](0x5));var _0x267f64=util[_0x18ef('0x25')](_0x18ef('0x12b'),FILES_PATH,_0x46c9b0,_0x575c58);var _0x192805=util['format'](_0x18ef('0xd8'),FILES_PATH,_0x46c9b0);this['createSquareRecording'][_0x18ef('0x73')](this,_0x2a8c2f,_0x46c9b0,_0x267f64);this['channel'][_0x18ef('0x71')]('RECORDING_SAVENAME',_0x46c9b0);logger[_0x18ef('0x29')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x192805,_0x575c58,_0x2a8c2f[_0x18ef('0x12c')],_0x2a8c2f[_0x18ef('0x77')]);return this[_0x18ef('0xe')][_0x18ef('0xdc')](_0x192805,_0x575c58,_0x2a8c2f[_0x18ef('0x12c')],_0x2a8c2f['timeout'],undefined,!![]);};AGIVertices[_0x18ef('0x11')][_0x18ef('0x12d')]=function(_0x5c0179){logger[_0x18ef('0x29')](util['format'](_0x18ef('0x12e'),_0x5c0179['label']));return this['channel'][_0x18ef('0x12f')](_0x5c0179[_0x18ef('0x130')][_0x18ef('0x94')](/\s+/g,''),_0x5c0179['escape_digits']);};AGIVertices[_0x18ef('0x11')][_0x18ef('0x131')]=function(_0x130811){logger['info'](util[_0x18ef('0x25')](_0x18ef('0x132'),_0x130811[_0x18ef('0x34')]));return this[_0x18ef('0xe')]['sayNumber'](_0x130811[_0x18ef('0x133')]['replace'](/\s+/g,''),_0x130811[_0x18ef('0x12c')]);};AGIVertices['prototype'][_0x18ef('0x134')]=function(_0x235221){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0x135'),_0x235221[_0x18ef('0x34')]));return this[_0x18ef('0xe')][_0x18ef('0x136')](_0x235221[_0x18ef('0x51')],_0x235221[_0x18ef('0x12c')]);};AGIVertices[_0x18ef('0x11')][_0x18ef('0x137')]=function(_0x3b7a8c){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0x138'),_0x3b7a8c[_0x18ef('0x34')]));if(!this['isConfigured'](_0x3b7a8c[_0x18ef('0x139')])){return this[_0x18ef('0xe')][_0x18ef('0x7d')]('no\x20mail\x20account\x20configured');}var _0x459123=this[_0x18ef('0x13a')][_0x18ef('0x73')](this,_0x3b7a8c[_0x18ef('0x139')]);if(!_0x459123||!_0x459123[_0x18ef('0x13b')]){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x3b7a8c,'no\x20mail\x20account\x20found');}var _0x348e49={'from':util[_0x18ef('0x25')]('\x22%s\x22\x20<%s>',_0x459123[_0x18ef('0x13')],_0x459123[_0x18ef('0x13c')]||_0x459123['Smtp'][_0x18ef('0x13d')]),'to':_0x3b7a8c['to']||'','cc':_0x3b7a8c['cc']||'','bcc':_0x3b7a8c['bcc']||'','subject':_0x3b7a8c[_0x18ef('0x13e')],'html':_0x3b7a8c[_0x18ef('0x51')],'text':_0x3b7a8c[_0x18ef('0x51')]};var _0x2d3ca9={'tls':{'rejectUnauthorized':![]}};if(_0x459123[_0x18ef('0x13b')][_0x18ef('0x13f')]){_0x2d3ca9[_0x18ef('0x13f')]=_0x459123[_0x18ef('0x13b')][_0x18ef('0x13f')];}else{_0x2d3ca9[_0x18ef('0x140')]=_0x459123[_0x18ef('0x13b')][_0x18ef('0x140')];_0x2d3ca9['port']=_0x459123[_0x18ef('0x13b')][_0x18ef('0x141')];_0x2d3ca9[_0x18ef('0x142')]=_0x459123['Smtp']['secure'];}if(_0x459123[_0x18ef('0x13b')][_0x18ef('0x143')]){_0x2d3ca9[_0x18ef('0x144')]={'user':_0x459123['Smtp'][_0x18ef('0x13d')],'pass':_0x459123['Smtp'][_0x18ef('0x145')]};}if(this[_0x18ef('0x5b')](_0x3b7a8c[_0x18ef('0x146')])){}logger[_0x18ef('0x9b')](_0x18ef('0x147'),JSON[_0x18ef('0xc0')](_0x348e49));this[_0x18ef('0x32')]['sync'](this,_0x3b7a8c,_0x3b7a8c['account_id']);this[_0x18ef('0xe')]['noop'](util[_0x18ef('0x25')](_0x18ef('0x148'),_0x459123[_0x18ef('0x13')]));this[_0x18ef('0x21')][_0x18ef('0x73')](this,_0x2d3ca9,_0x348e49);return this[_0x18ef('0xe')][_0x18ef('0x7d')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x18ef('0x11')][_0x18ef('0x149')]=function(_0x24eb7a){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0x14a'),_0x24eb7a['label']));return this[_0x18ef('0xe')][_0x18ef('0x7d')](_0x18ef('0x14b'));};AGIVertices[_0x18ef('0x11')][_0x18ef('0x14c')]=function(_0x165cfd){logger[_0x18ef('0x29')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x165cfd[_0x18ef('0x34')]));if(!this[_0x18ef('0x5b')](_0x165cfd[_0x18ef('0x14d')])){return this[_0x18ef('0xe')][_0x18ef('0x7d')](_0x18ef('0x14e'));}var _0x47cd2e=this[_0x18ef('0x2f')][_0x18ef('0x73')](this,_0x165cfd[_0x18ef('0x14d')]);if(!_0x47cd2e){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x165cfd,_0x18ef('0x14f'));}var _0x53c576={'body':_0x165cfd['sms_text'],'phone':_0x165cfd['to']||'','SmsAccountId':_0x47cd2e['id']};logger[_0x18ef('0x9b')]('sendSMS\x20message',JSON[_0x18ef('0xc0')](_0x53c576));this[_0x18ef('0x32')][_0x18ef('0x73')](this,_0x165cfd,_0x165cfd['sms_account_id']);this['channel'][_0x18ef('0x7d')](util[_0x18ef('0x25')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x47cd2e[_0x18ef('0x13')]));this['createSmsMessage'][_0x18ef('0x73')](this,_0x53c576);return this[_0x18ef('0xe')][_0x18ef('0x7d')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x18ef('0x150')]=function(_0x4ff34f){logger[_0x18ef('0x29')](util['format'](_0x18ef('0x151'),_0x4ff34f[_0x18ef('0x34')]));if(!this[_0x18ef('0x5b')](_0x4ff34f[_0x18ef('0x95')])){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x4ff34f,_0x18ef('0x152'));}var _0x4e7eb3=this[_0x18ef('0x12')][_0x18ef('0x73')](this,_0x4ff34f[_0x18ef('0x95')]);if(!_0x4e7eb3){return this['channel'][_0x18ef('0x2d')](_0x4ff34f,_0x18ef('0x97'));}return this[_0x18ef('0xe')][_0x18ef('0x71')](_0x4e7eb3,_0x4ff34f[_0x18ef('0x153')]);};AGIVertices[_0x18ef('0x11')][_0x18ef('0x154')]=function(_0x165746){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0x155'),_0x165746['label']));this[_0x18ef('0xe')][_0x18ef('0x7d')]('START\x20CALLY\x20SQUARE');if(_0x165746[_0x18ef('0x76')]==='yes'){this[_0x18ef('0xe')]['noop'](_0x18ef('0x156'));return this[_0x18ef('0xe')][_0x18ef('0x76')]();}return this['channel'][_0x18ef('0x7d')](_0x18ef('0x157'));};AGIVertices[_0x18ef('0x11')][_0x18ef('0x158')]=function(_0x4c365d){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0x159'),_0x4c365d[_0x18ef('0x34')]));if(!this[_0x18ef('0x5b')](_0x4c365d[_0x18ef('0x15a')])){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x4c365d,_0x18ef('0x15b'));}var _0x58da59=this[_0x18ef('0x15c')]['sync'](this,_0x4c365d[_0x18ef('0x15a')]);if(!this[_0x18ef('0x5b')](_0x58da59)){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x4c365d,util[_0x18ef('0x25')](_0x18ef('0x15d'),_0x4c365d['project_id']));}if(_0x58da59===this[_0x18ef('0xe')][_0x18ef('0x36')]){return this[_0x18ef('0xe')]['error'](_0x4c365d,_0x18ef('0x15e'));}this[_0x18ef('0x32')][_0x18ef('0x73')](this,_0x4c365d,_0x58da59);var _0x3bdade=this['channel'][_0x18ef('0x4f')]('AGI',util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x18ef('0x8')][_0x18ef('0x140')]||_0x18ef('0x15f'),_0x58da59,this[_0x18ef('0xe')][_0x18ef('0x36')]));if(_0x3bdade['result']===-0x1){return _0x3bdade;}return this['channel'][_0x18ef('0x7d')](util[_0x18ef('0x25')](_0x18ef('0x11d'),_0x18ef('0x160'),_0x58da59));};AGIVertices[_0x18ef('0x11')][_0x18ef('0x161')]=function(_0xf27d95){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0x162'),_0xf27d95[_0x18ef('0x34')]));var _0x4eb024=this[_0x18ef('0x4e')][_0x18ef('0x73')](this,_0xf27d95[_0x18ef('0x75')]);this[_0x18ef('0x32')][_0x18ef('0x73')](this,_0xf27d95,_0xf27d95['command']);if(this[_0x18ef('0x5b')](_0xf27d95[_0x18ef('0x95')])){var _0x5d5934=this['getVariable'][_0x18ef('0x73')](this,_0xf27d95['variable_id']);if(_0x5d5934){this[_0x18ef('0xe')]['setVariable'](_0x5d5934,_0x4eb024);return this[_0x18ef('0xe')][_0x18ef('0x7d')](util[_0x18ef('0x25')](_0x18ef('0x163'),_0xf27d95[_0x18ef('0x75')],_0x5d5934));}}return this[_0x18ef('0xe')][_0x18ef('0x7d')](util[_0x18ef('0x25')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0xf27d95['command']));};AGIVertices[_0x18ef('0x11')]['tts']=function(_0x3948ef){logger['info'](util[_0x18ef('0x25')](_0x18ef('0x164'),_0x3948ef[_0x18ef('0x34')]));if(!this[_0x18ef('0x5b')](_0x3948ef['text'])){return this[_0x18ef('0xe')][_0x18ef('0x7d')]('no\x20text\x20configured');}this[_0x18ef('0xe')]['noop'](util[_0x18ef('0x25')]('Trying\x20Google\x20TTS\x20%s',_0x3948ef[_0x18ef('0x51')]));var _0x410853=this['googleTTS'][_0x18ef('0x73')](this,_0x3948ef);if(_0x410853){this['channel']['noop'](util[_0x18ef('0x25')](_0x18ef('0x165'),_0x410853));var _0x4f7999=this[_0x18ef('0xe')]['streamFile'](_0x410853);try{fs[_0x18ef('0xd2')](_0x410853+_0x18ef('0xd3'));}catch(_0x2c771f){logger['error'](_0x2c771f);}return _0x4f7999;}return this[_0x18ef('0xe')]['error'](_0x3948ef,_0x18ef('0xab'));};AGIVertices[_0x18ef('0x11')][_0x18ef('0x166')]=function(_0x57dffc){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0x167'),_0x57dffc[_0x18ef('0x34')]));if(!this['isConfigured'](_0x57dffc[_0x18ef('0x102')])){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x57dffc,_0x18ef('0x103'));}logger['info'](util[_0x18ef('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x18ef('0xe')][_0x18ef('0x37')],_0x57dffc['findBy']));var _0x5cef07=this[_0x18ef('0x4a')][_0x18ef('0x73')](this,_0x57dffc[_0x18ef('0x102')]);if(_0x5cef07){logger[_0x18ef('0x29')](util['format'](_0x18ef('0x105'),this['channel']['callerid'],_0x57dffc[_0x18ef('0x102')]));this[_0x18ef('0xe')][_0x18ef('0x7d')](util[_0x18ef('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x18ef('0xe')]['callerid'],_0x57dffc[_0x18ef('0x102')]));return{'code':0xc8,'result':_0x18ef('0x106')};}else{logger[_0x18ef('0x29')](util['format'](_0x18ef('0x107'),this[_0x18ef('0xe')][_0x18ef('0x37')],_0x57dffc['findBy']));this[_0x18ef('0xe')][_0x18ef('0x7d')](util[_0x18ef('0x25')](_0x18ef('0x107'),this['channel'][_0x18ef('0x37')],_0x57dffc[_0x18ef('0x102')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x18ef('0x168')]=function(_0x232739){logger['info'](util[_0x18ef('0x25')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x232739[_0x18ef('0x34')]));var _0x26dba6=this[_0x18ef('0xe')]['exec'](_0x18ef('0x169'),[_0x232739[_0x18ef('0x16a')],_0x232739[_0x18ef('0x81')]]);if(_0x26dba6[_0x18ef('0x70')]===-0x1){return _0x26dba6;}return this[_0x18ef('0xe')]['noop'](util['format'](_0x18ef('0x11d'),_0x18ef('0x169'),_0x232739[_0x18ef('0x16a')]));};AGIVertices[_0x18ef('0x11')][_0x18ef('0x16b')]=function(_0x2294d0){logger[_0x18ef('0x29')](util[_0x18ef('0x25')](_0x18ef('0x16c'),_0x2294d0['label']));if(!this[_0x18ef('0x5b')](_0x2294d0[_0x18ef('0x95')])){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x2294d0,_0x18ef('0x152'));}var _0x971eab=this[_0x18ef('0x12')]['sync'](this,_0x2294d0['variable_id']);if(!_0x971eab){return this[_0x18ef('0xe')][_0x18ef('0x2d')](_0x2294d0,_0x18ef('0x97'));}var _0x57c0b9=this[_0x18ef('0xe')]['getVariable'](_0x971eab);return{'code':0xc8,'result':_0x57c0b9['extra']?_0x57c0b9[_0x18ef('0x6e')]:'-'};};String[_0x18ef('0x11')][_0x18ef('0x16d')]=function(_0x5ec096,_0x1963c3){return this[_0x18ef('0x6c')](_0x5ec096)[_0x18ef('0x16e')](_0x1963c3);};module[_0x18ef('0x16f')]=AGIVertices;
\ No newline at end of file
+var _0xa276=['vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','shelljs','odbc','randomstring','moment','mustache','../../config/logger','../../config/environment','./scripts','/var/opt/motion2/server/files','menu','getsecretdigits','channel','mailRpc','prototype','getVariable','rpc','getVariableById','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareOdbc','getUser','getUserById','getTrunkById','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','calleridname','context','extension','dnid','file','createCmContact','isEmpty','isNil','random','lastName','phone','scheduledAt','callback','toString','callback_priority','getPause','getPauseById','agent','callerid','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleTTS','text','google_tts_language','googleDialogflow','key','dialogflow_language','ispeechTTS','en-US','speed','ispeechASR','model','awsPolly','aws_polly_region','aws_polly_voice','Amy','aws_text_type','googleASR','tildeASR','appid','appsecret','uri','clear','clone','hasOwnProperty','isString','replaceAllVariables','split','length','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','isConfigured','maxRetry','sync','retry','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','noop','Executed\x20command\x20%s\x20%s','application','options','lumenvoxtts','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','url','DIAL','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','no\x20text\x20configured','DIALOGFLOW_%s','speech','end','ext_dial','trunk_id','getTrunk','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Executed\x20command\x20%s','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_secret_access_key','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','streamFile','aws\x20Polly\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','generate','%s.%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','toUpperCase','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','stringify','unlink','.wav','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20FOUND\x20BY','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','file_id','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','agentPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','escape_digits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','Enter\x20in\x20START\x20(%s)\x20block','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox'];(function(_0x1a6c24,_0x9ce98f){var _0x37cde2=function(_0x44ec56){while(--_0x44ec56){_0x1a6c24['push'](_0x1a6c24['shift']());}};_0x37cde2(++_0x9ce98f);}(_0xa276,0x177));var _0x6a27=function(_0x4b096a,_0x36ca1b){_0x4b096a=_0x4b096a-0x0;var _0x1462a4=_0xa276[_0x4b096a];return _0x1462a4;};'use strict';var fs=require('fs');var path=require(_0x6a27('0x0'));var util=require(_0x6a27('0x1'));var _=require('lodash');var sh=require(_0x6a27('0x2'));var odbc=require(_0x6a27('0x3'))();var rs=require(_0x6a27('0x4'));var moment=require(_0x6a27('0x5'));var Mustache=require(_0x6a27('0x6'));var logger=require(_0x6a27('0x7'))('agi');var config=require(_0x6a27('0x8'));var scripts=require(_0x6a27('0x9'));var FILES_PATH=_0x6a27('0xa');var verticesWithRetry=[_0x6a27('0xb'),'getdigits',_0x6a27('0xc')];var AGIVertices=function(_0x36e178,_0x56fdaa,_0x132b54){this[_0x6a27('0xd')]=_0x36e178;this['rpc']=_0x56fdaa;this[_0x6a27('0xe')]=_0x132b54;};AGIVertices[_0x6a27('0xf')][_0x6a27('0x10')]=function(_0x13a92d,_0x41ae41){this[_0x6a27('0x11')][_0x6a27('0x12')](_0x13a92d)[_0x6a27('0x13')](function(_0x469575){_0x41ae41(null,_0x469575?_0x469575[_0x6a27('0x14')]:![]);})['catch'](function(_0x1be058){_0x41ae41(_0x1be058);});};AGIVertices[_0x6a27('0xf')][_0x6a27('0x15')]=function(_0x5ce755,_0x123e00){this[_0x6a27('0x11')][_0x6a27('0x16')](_0x5ce755)[_0x6a27('0x13')](function(_0x4f049f){_0x123e00(null,_0x4f049f?_0x4f049f[_0x6a27('0x14')]:![]);})[_0x6a27('0x17')](function(_0x2cc9d4){_0x123e00(_0x2cc9d4);});};AGIVertices[_0x6a27('0xf')][_0x6a27('0x18')]=function(_0x48c522,_0x41a057){this[_0x6a27('0x11')]['getSquareProjectById'](_0x48c522)['then'](function(_0x527d4b){_0x41a057(null,_0x527d4b?_0x527d4b['name']:![]);})[_0x6a27('0x17')](function(_0x25d10c){_0x41a057(_0x25d10c);});};AGIVertices[_0x6a27('0xf')][_0x6a27('0x19')]=function(_0x3e5918,_0x525746){this[_0x6a27('0x11')]['getSquareOdbcById'](_0x3e5918)[_0x6a27('0x13')](function(_0x559055){_0x525746(null,_0x559055?_0x559055['dsn']:![]);})[_0x6a27('0x17')](function(_0x4d7b6e){_0x525746(_0x4d7b6e);});};AGIVertices[_0x6a27('0xf')][_0x6a27('0x1a')]=function(_0x5a7269,_0x5a0bb9){this[_0x6a27('0x11')][_0x6a27('0x1b')](_0x5a7269)['then'](function(_0x1f542b){_0x5a0bb9(null,_0x1f542b?_0x1f542b[_0x6a27('0x14')]:![]);})['catch'](function(_0x26c617){_0x5a0bb9(_0x26c617);});};AGIVertices[_0x6a27('0xf')]['getTrunk']=function(_0x447109,_0x1143dd){this[_0x6a27('0x11')][_0x6a27('0x1c')](_0x447109)[_0x6a27('0x13')](function(_0x5976de){_0x1143dd(null,_0x5976de?_0x5976de['name']:![]);})[_0x6a27('0x17')](function(_0x3dc52b){_0x1143dd(_0x3dc52b);});};AGIVertices[_0x6a27('0xf')]['getSound']=function(_0xfe6ef1,_0x3b0c71){var _0x280f91=this;this['rpc']['getSoundById'](_0xfe6ef1)['then'](function(_0x3fc335){_0x3b0c71(null,_0x3fc335?_0x280f91['getSoundPath'](_0x3fc335[_0x6a27('0x1d')]):![]);})['catch'](function(_0x1de5e2){_0x3b0c71(_0x1de5e2);});};AGIVertices['prototype'][_0x6a27('0x1e')]=function(_0x85103c,_0x66f2a7){this[_0x6a27('0x11')]['getMailAccountById'](_0x85103c)[_0x6a27('0x13')](function(_0x439206){_0x66f2a7(null,_0x439206?_0x439206:![]);})['catch'](function(_0x5aad9a){_0x66f2a7(_0x5aad9a);});};AGIVertices[_0x6a27('0xf')][_0x6a27('0x1f')]=function(_0x5deed5,_0xe783ed,_0x12d02b){this[_0x6a27('0xe')]['sendMailMessage'](_0x5deed5,_0xe783ed)[_0x6a27('0x13')](function(){_0x12d02b(null);})['catch'](function(_0x48d3ee){_0x12d02b(_0x48d3ee);});};AGIVertices['prototype'][_0x6a27('0x20')]=function(_0xf0aff,_0x4136d4){this[_0x6a27('0x11')][_0x6a27('0x21')](_0xf0aff)['then'](function(_0xd36396){if(_0xd36396){if(_0xd36396[_0x6a27('0x22')]){_0x4136d4(null,[_0xd36396[_0x6a27('0x23')]]);}else{_0x4136d4(null,_['map'](_0xd36396[_0x6a27('0x24')],_0x6a27('0x23')));}}else{_0x4136d4(null,![]);}})['catch'](function(_0x2ae5d0){_0x4136d4(_0x2ae5d0);});};AGIVertices['prototype']['getSoundPath']=function(_0x185ec6){return util[_0x6a27('0x25')](_0x6a27('0x26'),FILES_PATH,_0x185ec6);};AGIVertices[_0x6a27('0xf')][_0x6a27('0x27')]=function(_0x278963,_0x20e8fb,_0x944dd3){odbc[_0x6a27('0x28')](_0x278963,function(_0x37b733){if(_0x37b733){logger[_0x6a27('0x29')](_0x6a27('0x2a'),_0x37b733);_0x944dd3(_0x37b733);}else{logger[_0x6a27('0x2b')](_0x6a27('0x2c'));odbc[_0x6a27('0x2d')](_0x20e8fb,function(_0x210ab4,_0x50bd2f){if(_0x210ab4){logger['info']('Error\x20executing\x20query\x20%s',_0x20e8fb);_0x944dd3(_0x210ab4);}else{logger[_0x6a27('0x2b')](_0x6a27('0x2e'),_0x20e8fb);odbc[_0x6a27('0x2f')](function(_0x4de957){if(_0x4de957){logger[_0x6a27('0x29')](_0x6a27('0x30'),_0x4de957);}_0x944dd3(null,_0x50bd2f);});}});}});};AGIVertices[_0x6a27('0xf')]['getSmsAccount']=function(_0x3ad466,_0x597952){this[_0x6a27('0x11')][_0x6a27('0x31')](_0x3ad466)['then'](function(_0x12aad9){_0x597952(null,_0x12aad9?_0x12aad9:![]);})[_0x6a27('0x17')](function(_0x48c1f0){_0x597952(_0x48c1f0);});};AGIVertices[_0x6a27('0xf')]['createSmsMessage']=function(_0x8549dc,_0x1ada32){this[_0x6a27('0x11')][_0x6a27('0x32')](_0x8549dc)['then'](function(_0x2666c2){_0x1ada32(null,_0x2666c2);})[_0x6a27('0x17')](function(_0x5eb5f0){_0x1ada32(_0x5eb5f0);});};AGIVertices[_0x6a27('0xf')]['createSquareDetailsReport']=function(_0x121da7,_0x3af045,_0x431656){this[_0x6a27('0x11')][_0x6a27('0x33')]({'uniqueid':this['channel'][_0x6a27('0x34')],'node':_0x121da7[_0x6a27('0x35')],'application':_0x121da7[_0x6a27('0x36')],'data':_0x3af045||null,'project_name':this[_0x6a27('0xd')][_0x6a27('0x37')],'callerid':this[_0x6a27('0xd')]['callerid']})[_0x6a27('0x13')](function(_0x2a0ada){_0x431656(null,_0x2a0ada);})['catch'](function(_0x2cd4c9){_0x431656(_0x2cd4c9);});};AGIVertices[_0x6a27('0xf')][_0x6a27('0x38')]=function(_0x32aae1,_0xf44f00,_0x50e23f,_0x56117a){this['rpc'][_0x6a27('0x38')]({'uniqueid':this[_0x6a27('0xd')][_0x6a27('0x34')],'callerid':this['channel']['callerid'],'calleridname':this[_0x6a27('0xd')][_0x6a27('0x39')],'context':this['channel'][_0x6a27('0x3a')],'extension':this['channel'][_0x6a27('0x3b')],'priority':this['channel']['priority'],'accountcode':this[_0x6a27('0xd')]['accountcode'],'dnid':this[_0x6a27('0xd')][_0x6a27('0x3c')],'projectName':this[_0x6a27('0xd')][_0x6a27('0x37')],'saveName':_0xf44f00,'filename':_0x32aae1[_0x6a27('0x3d')]||_0xf44f00,'savePath':_0x50e23f})[_0x6a27('0x13')](function(_0x5ad9ed){_0x56117a(null,_0x5ad9ed);})[_0x6a27('0x17')](function(_0x26d9cf){_0x56117a(_0x26d9cf);});};AGIVertices[_0x6a27('0xf')][_0x6a27('0x3e')]=function(_0x3c189e,_0x5339ba){this[_0x6a27('0x11')][_0x6a27('0x3e')]({'firstName':_[_0x6a27('0x3f')](_0x3c189e['name'])||_[_0x6a27('0x40')](_0x3c189e[_0x6a27('0x14')])?'callback_'+Math[_0x6a27('0x41')]():_0x3c189e[_0x6a27('0x14')],'lastName':_[_0x6a27('0x3f')](_0x3c189e[_0x6a27('0x42')])||_[_0x6a27('0x40')](_0x3c189e['lastName'])?null:_0x3c189e[_0x6a27('0x42')],'phone':_0x3c189e[_0x6a27('0x43')],'ListId':_0x3c189e['list_id'],'scheduledAt':_0x3c189e[_0x6a27('0x44')],'callbackUniqueid':this[_0x6a27('0xd')][_0x6a27('0x34')],'tags':_0x6a27('0x45'),'description':'Callback\x20scheduled\x20at\x20'+_0x3c189e[_0x6a27('0x44')][_0x6a27('0x46')](),'priority':_0x3c189e[_0x6a27('0x47')]})[_0x6a27('0x13')](function(_0x415003){_0x5339ba(null,_0x415003);})['catch'](function(_0x425328){_0x5339ba(_0x425328);});};AGIVertices[_0x6a27('0xf')][_0x6a27('0x48')]=function(_0x4aab23,_0x23c3ca){this['rpc'][_0x6a27('0x49')](_0x4aab23)['then'](function(_0x4827bc){_0x23c3ca(null,_0x4827bc?_0x4827bc[_0x6a27('0x14')]:![]);})[_0x6a27('0x17')](function(_0x3fa7a1){_0x23c3ca(_0x3fa7a1);});};AGIVertices['prototype']['agentPause']=function(_0x5b9b79,_0x4375a9,_0xe7fb13){var _0x11a9a9={'role':_0x6a27('0x4a')};_0x11a9a9[_0x5b9b79]=this[_0x6a27('0xd')][_0x6a27('0x4b')];this[_0x6a27('0x11')]['agentPause'](_0x11a9a9,_0x4375a9,this[_0x6a27('0xd')]['uniqueid'])[_0x6a27('0x13')](function(_0x19ded5){_0xe7fb13(null,_['isNil'](_0x19ded5)?![]:!![]);})[_0x6a27('0x17')](function(_0x246c93){logger[_0x6a27('0x29')](_0x246c93);_0xe7fb13(null,![]);});};AGIVertices[_0x6a27('0xf')][_0x6a27('0x4c')]=function(_0x4e9afa,_0x5a97f9){var _0x17a254={'role':_0x6a27('0x4a')};_0x17a254[_0x4e9afa]=this[_0x6a27('0xd')]['callerid'];this['rpc'][_0x6a27('0x4c')](_0x17a254)[_0x6a27('0x13')](function(_0x4373d7){_0x5a97f9(null,_['isNil'](_0x4373d7)?![]:!![]);})[_0x6a27('0x17')](function(_0x15020b){logger[_0x6a27('0x29')](_0x15020b);_0x5a97f9(null,![]);});};AGIVertices['prototype'][_0x6a27('0x4d')]=function(_0x2491d9,_0x33da5c){var _0x3e655b={'role':_0x6a27('0x4a')};_0x3e655b[_0x2491d9]=this['channel'][_0x6a27('0x4b')];this['rpc'][_0x6a27('0x4d')](_0x3e655b)['then'](function(_0x4ca0d4){_0x33da5c(null,_[_0x6a27('0x40')](_0x4ca0d4)?![]:!![]);})[_0x6a27('0x17')](function(_0x1cd88e){logger[_0x6a27('0x29')](_0x1cd88e);_0x33da5c(null,![]);});};AGIVertices[_0x6a27('0xf')][_0x6a27('0x4e')]=function(_0x3dfb3e,_0x4a9e6e){var _0x2fd70b={'role':'agent'};_0x2fd70b[_0x3dfb3e]=this[_0x6a27('0xd')][_0x6a27('0x4b')];var _0xb9e81b=_0x3dfb3e!=_0x6a27('0x4f')?util['format'](_0x6a27('0x50'),_0x6a27('0x51'),this[_0x6a27('0xd')][_0x6a27('0x4b')]):undefined;this[_0x6a27('0x11')][_0x6a27('0x4e')](_0x2fd70b,_0xb9e81b)['then'](function(_0x2cb8ea){_0x4a9e6e(null,_[_0x6a27('0x40')](_0x2cb8ea)?![]:!![]);})[_0x6a27('0x17')](function(_0x395d04){logger[_0x6a27('0x29')](_0x395d04);_0x4a9e6e(null,![]);});};AGIVertices['prototype'][_0x6a27('0x52')]=function(_0xb616fd,_0x13b03d){sh[_0x6a27('0x53')](_[_0x6a27('0x54')](_0xb616fd),function(_0x223bea,_0x2fc992){var _0xe48db2=_0x2fc992[_0x6a27('0x55')](/(\r\n|\n|\r)/gm,'');_0x13b03d(null,_0xe48db2);});};AGIVertices[_0x6a27('0xf')][_0x6a27('0x56')]=function(_0x4f10e7,_0x4faa81){scripts[_0x6a27('0x56')](_0x4f10e7[_0x6a27('0x57')],_0x4f10e7[_0x6a27('0x58')]||'en',0x1)['then'](function(_0x2ccccb){_0x4faa81(null,_0x2ccccb);})[_0x6a27('0x17')](function(_0x3b5ea5){_0x4faa81(_0x3b5ea5);});};AGIVertices[_0x6a27('0xf')][_0x6a27('0x59')]=function(_0x4730d8,_0xf68a53){scripts['googleDialogflow'](this[_0x6a27('0xd')]['uniqueid'],_0x4730d8[_0x6a27('0x5a')],_0x4730d8[_0x6a27('0x57')],_0x4730d8[_0x6a27('0x5b')]||'en')[_0x6a27('0x13')](function(_0x2000d8){_0xf68a53(null,_0x2000d8);})['catch'](function(_0x51b0b8){_0xf68a53(_0x51b0b8);});};AGIVertices['prototype'][_0x6a27('0x5c')]=function(_0x4f618c,_0x5232fb){scripts[_0x6a27('0x5c')](_0x4f618c[_0x6a27('0x5a')],_0x4f618c[_0x6a27('0x57')],_0x4f618c['ispeech_tts_language']||_0x6a27('0x5d'),_0x4f618c[_0x6a27('0x5e')])['then'](function(_0x1ff28d){_0x5232fb(null,_0x1ff28d);})[_0x6a27('0x17')](function(_0x5cc1f0){_0x5232fb(_0x5cc1f0);});};AGIVertices[_0x6a27('0xf')][_0x6a27('0x5f')]=function(_0x50c19c,_0x29698d,_0x57ba5d){scripts[_0x6a27('0x5f')](_0x29698d,_0x50c19c[_0x6a27('0x5a')],_0x50c19c['ispeech_asr_language']||'en-US',this['isConfigured'](_0x50c19c[_0x6a27('0x60')])?_0x50c19c[_0x6a27('0x60')]:undefined)[_0x6a27('0x13')](function(_0x31d763){_0x57ba5d(null,_0x31d763);})['catch'](function(_0x445da1){_0x57ba5d(_0x445da1);});};AGIVertices[_0x6a27('0xf')][_0x6a27('0x61')]=function(_0x5567ba,_0xb6ef2){scripts[_0x6a27('0x61')](_0x5567ba['aws_access_key_id'],_0x5567ba['aws_secret_access_key'],_0x5567ba[_0x6a27('0x62')],_0x5567ba[_0x6a27('0x63')]||_0x6a27('0x64'),_0x5567ba[_0x6a27('0x57')],_0x5567ba[_0x6a27('0x65')]||_0x6a27('0x57'))['then'](function(_0x3e6568){_0xb6ef2(null,_0x3e6568);})[_0x6a27('0x17')](function(_0x73c8d3){_0xb6ef2(_0x73c8d3);});};AGIVertices[_0x6a27('0xf')][_0x6a27('0x66')]=function(_0x57c371,_0x470c3d,_0x68c166){scripts[_0x6a27('0x66')](_0x470c3d,_0x57c371[_0x6a27('0x5a')],_0x57c371['google_asr_language']||'en-US')[_0x6a27('0x13')](function(_0x230182){_0x68c166(null,_0x230182);})[_0x6a27('0x17')](function(_0x2e3bbf){_0x68c166(_0x2e3bbf);});};AGIVertices[_0x6a27('0xf')][_0x6a27('0x67')]=function(_0x5aa125,_0x1de2af,_0x29a2a1){scripts['tildeASR'](_0x1de2af,_0x5aa125[_0x6a27('0x68')],_0x5aa125[_0x6a27('0x69')],_0x5aa125[_0x6a27('0x6a')])[_0x6a27('0x13')](function(_0x5b7a95){_0x29a2a1(null,_0x5b7a95);})[_0x6a27('0x17')](function(_0x1ae961){_0x29a2a1(_0x1ae961);});};AGIVertices[_0x6a27('0xf')][_0x6a27('0x6b')]=function(_0x22cc1d){var _0x28bb82=_['includes'](verticesWithRetry,_0x22cc1d[_0x6a27('0x36')])?_0x22cc1d:_[_0x6a27('0x6c')](_0x22cc1d);for(var _0x9354ee in _0x28bb82){if(_0x28bb82[_0x6a27('0x6d')](_0x9354ee)){if(_0x28bb82[_0x9354ee]&&_[_0x6a27('0x6e')](_0x28bb82[_0x9354ee])){_0x28bb82[_0x9354ee]=this[_0x6a27('0x6f')](_0x28bb82[_0x9354ee]);}}}return _0x28bb82;};AGIVertices['prototype'][_0x6a27('0x6f')]=function(_0x5d5251){var _0x567be9=_0x5d5251[_0x6a27('0x70')]('{');for(var _0x2dd186=0x1;_0x2dd186<_0x567be9[_0x6a27('0x71')];_0x2dd186+=0x1){var _0x3a3363=_0x567be9[_0x2dd186]['split']('}');if(_0x3a3363[_0x6a27('0x71')]>0x1){_0x5d5251=_0x5d5251[_0x6a27('0x72')]('{'+_0x3a3363[0x0]+'}',this['channel'][_0x6a27('0x10')](_0x3a3363[0x0])[_0x6a27('0x73')]||_0x3a3363[0x0]);}}if(_0x567be9['length']===0x1){return _0x5d5251['toString']();}return this['replaceAllVariables'](_0x5d5251);};AGIVertices['prototype'][_0x6a27('0x74')]=function(_0x3ce0ec,_0x13be77){var _0x4b5183=this[_0x6a27('0xd')][_0x6a27('0x10')](_0x3ce0ec);if(_0x4b5183[_0x6a27('0x75')]===-0x1){return _0x4b5183;}logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0x76'),_0x13be77,_0x4b5183[_0x6a27('0x73')]));return this[_0x6a27('0xd')][_0x6a27('0x77')](_0x13be77,_0x4b5183[_0x6a27('0x73')]);};AGIVertices['prototype'][_0x6a27('0x78')]=function(_0x3f45ea){return _0x3f45ea&&_0x3f45ea!=='0'&&_0x3f45ea!=='-1'&&_0x3f45ea!=='';};AGIVertices['prototype'][_0x6a27('0x79')]=function(_0x22ddfd){this[_0x6a27('0x33')][_0x6a27('0x7a')](this,_0x22ddfd,'-');_0x22ddfd[_0x6a27('0x7b')]=_0x22ddfd[_0x6a27('0x79')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x6a27('0xf')][_0x6a27('0x7c')]=function(_0x103800){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0x7d'),_0x103800[_0x6a27('0x35')]));return this['channel'][_0x6a27('0x7c')]([_0x103800[_0x6a27('0x7e')],_0x103800[_0x6a27('0x7f')]]);};AGIVertices['prototype'][_0x6a27('0x80')]=function(_0x44e9c5){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0x81'),_0x44e9c5[_0x6a27('0x35')]));if(this[_0x6a27('0x78')](_0x44e9c5[_0x6a27('0x82')])){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0x83'),_0x44e9c5[_0x6a27('0x82')]));var _0x4cbafd=this[_0x6a27('0xd')][_0x6a27('0x84')](_0x44e9c5[_0x6a27('0x82')]);if(_0x4cbafd[_0x6a27('0x75')]===-0x1){return _0x4cbafd;}}return this[_0x6a27('0xd')][_0x6a27('0x80')]();};AGIVertices[_0x6a27('0xf')][_0x6a27('0x45')]=function(_0x56b692){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0x85'),_0x56b692['label']));if(!this['isConfigured'](_0x56b692[_0x6a27('0x86')])){return this[_0x6a27('0xd')]['error'](_0x56b692,'no\x20list\x20selected');}_0x56b692[_0x6a27('0x44')]=moment();if(this['isConfigured'](_0x56b692[_0x6a27('0x87')])){_0x56b692['scheduledAt']=moment()[_0x6a27('0x88')](_0x56b692[_0x6a27('0x87')],_0x6a27('0x89'));}if(!this[_0x6a27('0x78')](_0x56b692['callback_priority'])){_0x56b692[_0x6a27('0x47')]=0x2;}this[_0x6a27('0x3e')][_0x6a27('0x7a')](this,_0x56b692);return this[_0x6a27('0xd')]['noop'](util['format'](_0x6a27('0x8a'),_0x56b692[_0x6a27('0x43')],_0x56b692[_0x6a27('0x86')],_0x56b692['scheduledAt']));};AGIVertices[_0x6a27('0xf')][_0x6a27('0x8b')]=function(_0x32e08c){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0x8c'),_0x32e08c[_0x6a27('0x35')]));var _0x4db73d=this[_0x6a27('0xd')][_0x6a27('0x53')](_0x32e08c['application'],_0x32e08c['options']);if(_0x4db73d['result']===-0x1){return _0x4db73d;}return this[_0x6a27('0xd')][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0x8e'),_0x32e08c[_0x6a27('0x8f')],_0x32e08c[_0x6a27('0x90')]));};AGIVertices[_0x6a27('0xf')][_0x6a27('0x91')]=function(_0xbc2a9a){logger[_0x6a27('0x2b')](util['format']('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0xbc2a9a[_0x6a27('0x35')]));if(!this[_0x6a27('0x78')](_0xbc2a9a[_0x6a27('0x57')])){return this[_0x6a27('0xd')]['noop']('no\x20text\x20configured');}var _0x531887='\x22'+_0xbc2a9a['text']+'\x22';if(this['isConfigured'](_0xbc2a9a[_0x6a27('0x90')])){_0x531887+=','+_0xbc2a9a[_0x6a27('0x90')];}var _0x13ae59=this['channel'][_0x6a27('0x53')](_0x6a27('0x92'),_0x531887);if(_0x13ae59['result']===-0x1){return _0x13ae59;}return this[_0x6a27('0xd')][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0x93'),_0x531887));};AGIVertices[_0x6a27('0xf')][_0x6a27('0x94')]=function(_0x4ffbcb){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x4ffbcb[_0x6a27('0x35')]));if(!this[_0x6a27('0x78')](_0x4ffbcb[_0x6a27('0x95')])){return this[_0x6a27('0xd')][_0x6a27('0x8d')](_0x6a27('0x96'));}var _0x154a9b=_0x4ffbcb[_0x6a27('0x95')];if(this[_0x6a27('0x78')](_0x4ffbcb['options'])){_0x154a9b+=','+_0x4ffbcb[_0x6a27('0x90')];}var _0x333012=this[_0x6a27('0xd')]['exec'](_0x6a27('0x97'),_0x154a9b);if(_0x333012[_0x6a27('0x75')]===-0x1){return _0x333012;}var _0x5d54ad=this[_0x6a27('0x74')](_0x6a27('0x98'),_0x6a27('0x99'));if(_0x5d54ad['result']===-0x1){return _0x5d54ad;}var _0x5cf62a=this[_0x6a27('0x74')](_0x6a27('0x9a'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x5cf62a[_0x6a27('0x75')]===-0x1){return _0x5cf62a;}var _0x564ce3=this[_0x6a27('0x74')]('RECOG_INSTANCE()',_0x6a27('0x9b'));if(_0x564ce3[_0x6a27('0x75')]===-0x1){return _0x564ce3;}return this[_0x6a27('0xd')]['noop'](util['format'](_0x6a27('0x9c'),_0x154a9b));};AGIVertices[_0x6a27('0xf')][_0x6a27('0x9d')]=function(_0x59edc0){logger['info'](util[_0x6a27('0x25')](_0x6a27('0x9e'),_0x59edc0['label']));if(!this[_0x6a27('0x78')](_0x59edc0[_0x6a27('0x9f')])){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x59edc0,_0x6a27('0xa0'));}var _0x2da08b=this['getSquareOdbc'][_0x6a27('0x7a')](this,_0x59edc0[_0x6a27('0x9f')]);if(!_0x2da08b){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x59edc0,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x59edc0[_0x6a27('0x2d')])){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x59edc0,_0x6a27('0xa1'));}var _0x6c3bc6=_0x59edc0[_0x6a27('0x2d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x6a27('0xd')][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0xa2'),_0x6c3bc6));var _0x2652e7=this[_0x6a27('0x27')][_0x6a27('0x7a')](this,_0x2da08b,_0x6c3bc6);this[_0x6a27('0x33')][_0x6a27('0x7a')](this,_0x59edc0,_0x6c3bc6);if(!this[_0x6a27('0x78')](_0x59edc0[_0x6a27('0xa3')])){return this[_0x6a27('0xd')][_0x6a27('0x8d')](_0x6a27('0xa4'));}var _0x1cc00d=this[_0x6a27('0x10')][_0x6a27('0x7a')](this,_0x59edc0['variable_id']);if(!_0x1cc00d){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x59edc0,'no\x20variable\x20found');}var _0x5c76af=this;_0x2652e7[_0x6a27('0xa5')](function(_0x1b7284,_0x39caca){Object[_0x6a27('0xa6')](_0x1b7284)[_0x6a27('0xa5')](function(_0x4add02){_0x5c76af[_0x6a27('0xd')][_0x6a27('0x77')](util[_0x6a27('0x25')](_0x6a27('0xa7'),_0x1cc00d,_0x39caca,_0x4add02),_0x1b7284[_0x4add02]);});});this[_0x6a27('0xd')][_0x6a27('0x77')](util[_0x6a27('0x25')](_0x6a27('0xa8'),_0x1cc00d),_0x2652e7[_0x6a27('0x71')]);return this['channel'][_0x6a27('0x8d')](util['format'](_0x6a27('0xa9'),_0x1cc00d));};AGIVertices[_0x6a27('0xf')][_0x6a27('0xaa')]=function(_0xcd8c4f){logger[_0x6a27('0xab')](util[_0x6a27('0x25')](_0x6a27('0xac'),_0xcd8c4f['label']));if(!this[_0x6a27('0x78')](_0xcd8c4f[_0x6a27('0xad')])){return this['channel']['error'](_0xcd8c4f,_0x6a27('0xae'));}var _0x3ef32=this[_0x6a27('0x1a')][_0x6a27('0x7a')](this,_0xcd8c4f[_0x6a27('0xad')]);if(!_0x3ef32){return this['channel'][_0x6a27('0x29')](_0xcd8c4f,_0x6a27('0xaf'));}var _0x35e13a=this[_0x6a27('0xd')]['exec']('DIAL',[util[_0x6a27('0x25')](_0x6a27('0xb0'),_0x3ef32),_0xcd8c4f[_0x6a27('0x82')],_0xcd8c4f[_0x6a27('0xb1')],_0xcd8c4f[_0x6a27('0xb2')]]);if(_0x35e13a[_0x6a27('0x75')]===-0x1){return _0x35e13a;}return this[_0x6a27('0xd')][_0x6a27('0x8d')](util['format']('Executed\x20command\x20%s',_0x6a27('0xb3')));};AGIVertices[_0x6a27('0xf')]['dialogflow']=function(_0x1df766){logger['info'](util[_0x6a27('0x25')](_0x6a27('0xb4'),_0x1df766['label']));if(!this[_0x6a27('0x78')](_0x1df766[_0x6a27('0x5a')])){return this[_0x6a27('0xd')][_0x6a27('0x8d')](_0x6a27('0xb5'));}if(!this[_0x6a27('0x78')](_0x1df766['text'])){return this[_0x6a27('0xd')]['noop'](_0x6a27('0xb6'));}this[_0x6a27('0xd')][_0x6a27('0x8d')](util[_0x6a27('0x25')]('Trying\x20Dialogflow:\x20%s',_0x1df766[_0x6a27('0x57')]));var _0x51e59f=this['googleDialogflow'][_0x6a27('0x7a')](this,_0x1df766);if(_0x51e59f){for(var _0x16773c in _0x51e59f){if(_0x51e59f[_0x6a27('0x6d')](_0x16773c)){this[_0x6a27('0xd')][_0x6a27('0x77')](util[_0x6a27('0x25')](_0x6a27('0xb7'),_0x16773c['toUpperCase']()),_0x51e59f[_0x16773c]);}}return this['channel'][_0x6a27('0x8d')](util[_0x6a27('0x25')]('Dialogflow\x20Result\x20%s',_0x51e59f[_0x6a27('0xb8')]));}return this['channel']['error'](_0x1df766,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x6a27('0xf')][_0x6a27('0xb9')]=function(_0x2c53b8){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')]('Enter\x20in\x20END\x20(%s)\x20block',_0x2c53b8[_0x6a27('0x35')]));return this[_0x6a27('0xd')][_0x6a27('0x8d')](_0x6a27('0xb9'));};AGIVertices[_0x6a27('0xf')][_0x6a27('0xba')]=function(_0x9aa6aa){logger[_0x6a27('0x2b')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x9aa6aa[_0x6a27('0x35')]));var _0x1ea105='';if(_0x9aa6aa[_0x6a27('0xbb')]){if(!this[_0x6a27('0x78')](_0x9aa6aa['trunk_id'])){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x9aa6aa,'no\x20trunk\x20selected');}else{var _0xa021cb=parseInt(_0x9aa6aa[_0x6a27('0xbb')],0xa);if(isNaN(_0xa021cb)){_0x1ea105=_0x9aa6aa['trunk_id'];}else{_0x1ea105=this[_0x6a27('0xbc')][_0x6a27('0x7a')](this,_0x9aa6aa[_0x6a27('0xbb')]);if(!_0x1ea105){return this['channel'][_0x6a27('0x29')](_0x9aa6aa,_0x6a27('0xbd'));}}}}else if(_0x9aa6aa[_0x6a27('0xbe')]){_0x1ea105=_0x9aa6aa[_0x6a27('0xbe')];}else{return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x9aa6aa,_0x6a27('0xbf'));}var _0x31f68f=this['channel'][_0x6a27('0x53')](_0x6a27('0xb3'),[util['format'](_0x6a27('0xc0'),_0x1ea105,_0x9aa6aa['phone']),_0x9aa6aa[_0x6a27('0x82')],_0x9aa6aa[_0x6a27('0xb1')],_0x9aa6aa['url']]);if(_0x31f68f['result']===-0x1){return _0x31f68f;}return this[_0x6a27('0xd')][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0xc1'),_0x6a27('0xb3')));};AGIVertices['prototype'][_0x6a27('0xc2')]=function(_0x1aa0ab){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x1aa0ab[_0x6a27('0x35')]));return this[_0x6a27('0xd')][_0x6a27('0x8d')](_0x6a27('0xc2'));};AGIVertices['prototype'][_0x6a27('0xc3')]=function(_0x306891){logger[_0x6a27('0x2b')](util['format'](_0x6a27('0xc4'),_0x306891[_0x6a27('0x35')]));if(_0x306891[_0x6a27('0x7b')]===0x0){return this[_0x6a27('0x79')](_0x306891);}_0x306891[_0x6a27('0x7b')]-=0x1;if(!this['isConfigured'](_0x306891['file_id'])){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x306891,_0x6a27('0xc5'));}var _0x2e8add=this[_0x6a27('0xc6')][_0x6a27('0x7a')](this,_0x306891['file_id']);if(!_0x2e8add){return this['channel'][_0x6a27('0x29')](_0x306891,_0x6a27('0xc7'));}if(!this[_0x6a27('0x78')](_0x306891['variable_id'])){return this['channel'][_0x6a27('0x29')](_0x6a27('0xa4'));}var _0x235c7d=this['channel'][_0x6a27('0xc8')](_0x2e8add,_0x306891[_0x6a27('0xc9')],_0x306891[_0x6a27('0xca')]);var _0x280d71=_0x235c7d['result']?_0x235c7d['result'][_0x6a27('0x46')]():'';logger[_0x6a27('0x2b')](_0x6a27('0xcb'),JSON['stringify'](_0x235c7d));if(_0x235c7d[_0x6a27('0x75')]===-0x1){this['createSquareDetailsReport'][_0x6a27('0x7a')](this,_0x306891,_0x280d71);return _0x235c7d;}else if(_0x235c7d[_0x6a27('0x73')]==='timeout'){_0x235c7d['result']=_0x280d71['length']>=parseInt(_0x306891[_0x6a27('0xcc')])?'x':'i';}else{_0x235c7d[_0x6a27('0x75')]=_0x280d71['length']>=parseInt(_0x306891[_0x6a27('0xcc')])&&_0x280d71[_0x6a27('0x71')]<=parseInt(_0x306891['maxdigit'])?'x':'i';}var _0x24c2ae=this['getVariable'][_0x6a27('0x7a')](this,_0x306891[_0x6a27('0xa3')]);if(!_0x24c2ae){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x306891,_0x6a27('0xcd'));}this[_0x6a27('0xd')][_0x6a27('0x77')](_0x24c2ae,_0x280d71);if(this[_0x6a27('0x78')](_0x306891[_0x6a27('0xce')])){var _0x2b9c26=parseInt(_0x306891[_0x6a27('0xce')],0xa);var _0x1d2239=rs['generate']({'charset':'*','length':_0x2b9c26});var _0x29257a=_0x280d71[_0x6a27('0x71')];if(_0x29257a>0x0){if(_0x29257a>_0x2b9c26){this[_0x6a27('0x33')]['sync'](this,_0x306891,_0x306891[_0x6a27('0xcf')]===_0x6a27('0xd0')?_0x1d2239+_0x280d71[_0x6a27('0xd1')](_0x2b9c26):_0x280d71[_0x6a27('0xd1')](0x0,_0x29257a-_0x2b9c26)+_0x1d2239);}else{this['createSquareDetailsReport'][_0x6a27('0x7a')](this,_0x306891,rs['generate']({'charset':'*','length':_0x29257a}));}}else{this[_0x6a27('0x33')][_0x6a27('0x7a')](this,_0x306891,'');}}else{this[_0x6a27('0x33')]['sync'](this,_0x306891,_0x280d71);}return _0x235c7d;};AGIVertices['prototype'][_0x6a27('0xc')]=function(_0x14f9cb){logger[_0x6a27('0x2b')](util['format'](_0x6a27('0xd2'),_0x14f9cb['label']));return this[_0x6a27('0xc3')](_0x14f9cb);};AGIVertices[_0x6a27('0xf')][_0x6a27('0xd3')]=function(_0x2a96bf){logger[_0x6a27('0x2b')](util['format'](_0x6a27('0xd4'),_0x2a96bf['label']));this['createSquareDetailsReport'][_0x6a27('0x7a')](this,_0x2a96bf,_0x2a96bf[_0x6a27('0xd5')]);return this[_0x6a27('0xd')][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0xd6'),_0x2a96bf['goalname']));};AGIVertices[_0x6a27('0xf')][_0x6a27('0xd7')]=function(_0x34cf83){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0xd8'),_0x34cf83['label']));if(!this['isConfigured'](_0x34cf83['aws_access_key_id'])||!this[_0x6a27('0x78')](_0x34cf83[_0x6a27('0xd9')])){return this[_0x6a27('0xd')][_0x6a27('0x8d')](_0x6a27('0xda'));}if(!this[_0x6a27('0x78')](_0x34cf83['text'])){return this['channel'][_0x6a27('0x8d')](_0x6a27('0xb6'));}this[_0x6a27('0xd')][_0x6a27('0x8d')](util['format'](_0x6a27('0xdb'),_0x34cf83[_0x6a27('0x57')]));var _0x19e815=this[_0x6a27('0x61')]['sync'](this,_0x34cf83);if(_0x19e815){this[_0x6a27('0xd')][_0x6a27('0x8d')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x19e815));var _0x5f3163=this[_0x6a27('0xd')][_0x6a27('0xdc')](_0x19e815);try{fs['unlink'](_0x19e815+'.wav');}catch(_0x499509){logger[_0x6a27('0x29')](_0x499509);}return _0x5f3163;}return this[_0x6a27('0xd')]['error'](_0x34cf83,_0x6a27('0xdd'));};AGIVertices[_0x6a27('0xf')][_0x6a27('0xde')]=function(_0x24a91f){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x24a91f['label'],_0x24a91f['timeout']));if(!this[_0x6a27('0x78')](_0x24a91f[_0x6a27('0x5a')])){return this['channel']['noop']('no\x20key\x20configured');}var _0x4e7eb1=_0x6a27('0xdf');var _0x41f940=util[_0x6a27('0x25')](_0x6a27('0xe0'),FILES_PATH,rs[_0x6a27('0xe1')](0x4));var _0x2e4856=util[_0x6a27('0x25')](_0x6a27('0xe2'),_0x41f940,_0x4e7eb1);var _0x79df6f=!![];if(_0x24a91f[_0x6a27('0xe3')]===_0x6a27('0xe4')){_0x79df6f=![];}var _0xf69534=this[_0x6a27('0xd')][_0x6a27('0xe5')](_0x41f940,_0x4e7eb1,_0x24a91f['intKey'],_0x24a91f[_0x6a27('0x82')],undefined,_0x79df6f);if(_0xf69534[_0x6a27('0x75')]!==-0x1){this[_0x6a27('0xd')][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0xe6'),_0x2e4856));var _0x2aca6d=this['googleASR'][_0x6a27('0x7a')](this,_0x24a91f,_0x2e4856);if(_0x2aca6d){for(var _0x20b922 in _0x2aca6d){if(_0x2aca6d[_0x6a27('0x6d')](_0x20b922)){this[_0x6a27('0xd')][_0x6a27('0x77')](util[_0x6a27('0x25')](_0x6a27('0xe7'),_0x20b922[_0x6a27('0xe8')]()),_0x2aca6d[_0x20b922]);}}return this['channel'][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0xe9'),JSON['stringify'](_0x2aca6d)));}}return _0xf69534;};AGIVertices[_0x6a27('0xf')][_0x6a27('0xea')]=function(_0x157bd9){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x157bd9['label']));if(!this[_0x6a27('0x78')](_0x157bd9[_0x6a27('0x68')])){return this[_0x6a27('0xd')]['noop'](_0x6a27('0xeb'));}if(!this['isConfigured'](_0x157bd9[_0x6a27('0x69')])){return this[_0x6a27('0xd')][_0x6a27('0x8d')](_0x6a27('0xec'));}var _0x536360=_0x6a27('0xdf');var _0x1c0e77=util[_0x6a27('0x25')](_0x6a27('0xe0'),FILES_PATH,rs['generate'](0x4));var _0x4e9ed4=util[_0x6a27('0x25')](_0x6a27('0xe2'),_0x1c0e77,_0x536360);var _0x146e7f=!![];if(_0x157bd9[_0x6a27('0xe3')]===_0x6a27('0xe4')){_0x146e7f=![];}var _0x5775a9=this[_0x6a27('0xd')][_0x6a27('0xe5')](_0x1c0e77,_0x536360,_0x157bd9[_0x6a27('0xed')],_0x157bd9[_0x6a27('0x82')],undefined,_0x146e7f);if(_0x5775a9[_0x6a27('0x75')]!==-0x1){this['channel'][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0xee'),_0x4e9ed4));var _0x516480=this['tildeASR'][_0x6a27('0x7a')](this,_0x157bd9,_0x4e9ed4);if(_0x516480){for(var _0x2addd4 in _0x516480){if(_0x516480[_0x6a27('0x6d')](_0x2addd4)){this[_0x6a27('0xd')][_0x6a27('0x77')](util['format']('TILDE_ASR_%s',_0x2addd4[_0x6a27('0xe8')]()),_0x516480[_0x2addd4]);}}return this[_0x6a27('0xd')][_0x6a27('0x8d')](util[_0x6a27('0x25')]('TildeASR\x20Result\x20%s',JSON['stringify'](_0x516480)));}}return _0x5775a9;};AGIVertices['prototype'][_0x6a27('0xef')]=function(_0x52e437){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0xf0'),_0x52e437[_0x6a27('0x35')]));return this[_0x6a27('0xd')]['continueAt'](_0x52e437[_0x6a27('0x3a')],_0x52e437[_0x6a27('0x3b')],_0x52e437['priority']);};AGIVertices[_0x6a27('0xf')][_0x6a27('0xf1')]=function(_0x38fd08){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0xf2'),_0x38fd08[_0x6a27('0x35')]));if(!this['isConfigured'](_0x38fd08[_0x6a27('0xf3')])){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x38fd08,_0x6a27('0xf4'));}try{var _0x4582be=eval(_0x38fd08['condition'])?_0x6a27('0xf5'):'false';this[_0x6a27('0xd')]['noop'](util[_0x6a27('0x25')](_0x6a27('0xf6'),_0x38fd08['condition'],_0x4582be));return{'code':0xc8,'result':_0x4582be};}catch(_0x455cbb){return{'code':0xc8,'result':_0x6a27('0xf7')};}};AGIVertices[_0x6a27('0xf')][_0x6a27('0xf8')]=function(_0x301030){logger['info'](util['format']('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x301030['label']));if(!this[_0x6a27('0x78')](_0x301030[_0x6a27('0xf9')])){return this[_0x6a27('0xd')]['error'](_0x301030,'no\x20interval\x20configured');}var _0x17f7d4=this[_0x6a27('0x20')]['sync'](this,_0x301030[_0x6a27('0xf9')]);if(!_0x17f7d4){return this[_0x6a27('0xd')]['error'](_0x301030,_0x6a27('0xfa'));}for(var _0x4dff2b=0x0;_0x4dff2b<_0x17f7d4[_0x6a27('0x71')];_0x4dff2b+=0x1){var _0x222171=this['channel'][_0x6a27('0x10')](util[_0x6a27('0x25')]('IFTIME(%s?true:false)',_0x17f7d4[_0x4dff2b]));if(_0x222171[_0x6a27('0x75')]===-0x1){return _0x222171;}logger[_0x6a27('0x2b')](util['format'](_0x6a27('0xfb'),_0x17f7d4[_0x4dff2b],_0x222171[_0x6a27('0x73')]));if(_0x222171[_0x6a27('0x73')]===_0x6a27('0xf5')){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')]('IFTIME\x20%s\x20%s',_0x17f7d4[_0x4dff2b],_0x6a27('0xf5')));this[_0x6a27('0xd')][_0x6a27('0x8d')](util['format']('IFTIME\x20%s\x20%s',_0x17f7d4[_0x4dff2b],_0x6a27('0xf5')));return{'code':0xc8,'result':_0x6a27('0xf5')};}else{logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0xfb'),_0x17f7d4[_0x4dff2b],_0x6a27('0xf7')));this['channel'][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0xfb'),_0x17f7d4[_0x4dff2b],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype'][_0x6a27('0xfc')]=function(_0x2751c0){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0xfd'),_0x2751c0[_0x6a27('0x35')]));return this[_0x6a27('0xd')][_0x6a27('0xfc')]();};AGIVertices['prototype']['ispeechasr']=function(_0x5912d3){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x5912d3['label']));if(!this['isConfigured'](_0x5912d3[_0x6a27('0x5a')])){return this[_0x6a27('0xd')][_0x6a27('0x8d')](_0x6a27('0xb5'));}var _0x16518d=_0x6a27('0xdf');var _0x44cbba=util[_0x6a27('0x25')](_0x6a27('0xe0'),FILES_PATH,rs[_0x6a27('0xe1')](0x4));var _0x51e83c=util['format']('%s.%s',_0x44cbba,_0x16518d);var _0x72e869=!![];if(_0x5912d3[_0x6a27('0xe3')]===_0x6a27('0xe4')){_0x72e869=![];}var _0x191208=this[_0x6a27('0xd')][_0x6a27('0xe5')](_0x44cbba,_0x16518d,_0x5912d3[_0x6a27('0xed')],_0x5912d3['timeout'],undefined,_0x72e869);if(_0x191208[_0x6a27('0x75')]!==-0x1){this[_0x6a27('0xd')][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0xfe'),_0x51e83c));var _0x1434cf=this['ispeechASR'][_0x6a27('0x7a')](this,_0x5912d3,_0x51e83c);if(_0x1434cf){for(var _0x5065d2 in _0x1434cf){if(_0x1434cf[_0x6a27('0x6d')](_0x5065d2)){this['channel'][_0x6a27('0x77')](util[_0x6a27('0x25')](_0x6a27('0xff'),_0x5065d2[_0x6a27('0xe8')]()),_0x1434cf[_0x5065d2]);}}return this[_0x6a27('0xd')][_0x6a27('0x8d')](util['format'](_0x6a27('0x100'),JSON[_0x6a27('0x101')](_0x1434cf)));}}return _0x191208;};AGIVertices[_0x6a27('0xf')]['ispeechtts']=function(_0x2e4895){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x2e4895['label']));if(!this['isConfigured'](_0x2e4895[_0x6a27('0x5a')])){return this[_0x6a27('0xd')][_0x6a27('0x8d')]('no\x20key\x20configured');}if(!this[_0x6a27('0x78')](_0x2e4895[_0x6a27('0x57')])){return this[_0x6a27('0xd')]['noop'](_0x6a27('0xb6'));}this[_0x6a27('0xd')]['noop'](util[_0x6a27('0x25')]('Trying\x20ispeech\x20TTS\x20%s',_0x2e4895['text']));var _0xc0dfc7=this['ispeechTTS'][_0x6a27('0x7a')](this,_0x2e4895);if(_0xc0dfc7){this[_0x6a27('0xd')][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0xfe'),_0xc0dfc7));var _0x2e0f34=this['channel'][_0x6a27('0xdc')](_0xc0dfc7,_0x2e4895[_0x6a27('0xed')]);try{fs[_0x6a27('0x102')](_0xc0dfc7+_0x6a27('0x103'));}catch(_0x2ce95b){logger[_0x6a27('0x29')](_0x2ce95b);}return _0x2e0f34;}return this['channel']['error'](_0x2e4895,_0x6a27('0x104'));};AGIVertices[_0x6a27('0xf')][_0x6a27('0x105')]=function(_0x22fa6d){logger[_0x6a27('0x2b')](util['format'](_0x6a27('0x106'),_0x22fa6d[_0x6a27('0x35')]));if(!this['isConfigured'](_0x22fa6d['findBy'])){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x22fa6d,_0x6a27('0x107'));}logger[_0x6a27('0x2b')](util['format'](_0x6a27('0x108'),this[_0x6a27('0xd')][_0x6a27('0x4b')],_0x22fa6d[_0x6a27('0x109')]));var _0x279baf=this['agentLogin'][_0x6a27('0x7a')](this,_0x22fa6d[_0x6a27('0x109')]);if(_0x279baf){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x6a27('0xd')][_0x6a27('0x4b')],_0x22fa6d[_0x6a27('0x109')]));this[_0x6a27('0xd')][_0x6a27('0x8d')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x6a27('0xd')][_0x6a27('0x4b')],_0x22fa6d[_0x6a27('0x109')]));return{'code':0xc8,'result':_0x6a27('0x10a')};}else{logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0x10b'),this[_0x6a27('0xd')][_0x6a27('0x4b')],_0x22fa6d['findBy']));this[_0x6a27('0xd')]['noop'](util[_0x6a27('0x25')](_0x6a27('0x10b'),this[_0x6a27('0xd')]['callerid'],_0x22fa6d[_0x6a27('0x109')]));return{'code':0xc8,'result':_0x6a27('0x10c')};}};AGIVertices[_0x6a27('0xf')][_0x6a27('0x10d')]=function(_0x4bab1f){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0x10e'),_0x4bab1f[_0x6a27('0x35')]));if(!this[_0x6a27('0x78')](_0x4bab1f[_0x6a27('0x109')])){return this['channel']['error'](_0x4bab1f,_0x6a27('0x107'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x6a27('0xd')]['callerid'],_0x4bab1f[_0x6a27('0x109')]));var _0x965ac8=this[_0x6a27('0x4d')][_0x6a27('0x7a')](this,_0x4bab1f[_0x6a27('0x109')]);if(_0x965ac8){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x6a27('0xd')][_0x6a27('0x4b')],_0x4bab1f[_0x6a27('0x109')]));this[_0x6a27('0xd')][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0x10f'),this['channel'][_0x6a27('0x4b')],_0x4bab1f[_0x6a27('0x109')]));return{'code':0xc8,'result':_0x6a27('0x10a')};}else{logger[_0x6a27('0x2b')](util['format'](_0x6a27('0x10b'),this[_0x6a27('0xd')]['callerid'],_0x4bab1f['findBy']));this[_0x6a27('0xd')][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0x10b'),this[_0x6a27('0xd')]['callerid'],_0x4bab1f[_0x6a27('0x109')]));return{'code':0xc8,'result':_0x6a27('0x10c')};}};AGIVertices['prototype']['math']=function(_0x30b0d8){logger['info'](util[_0x6a27('0x25')](_0x6a27('0x110'),_0x30b0d8['label']));if(!this[_0x6a27('0x78')](_0x30b0d8[_0x6a27('0x111')])){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x30b0d8,_0x6a27('0x112'));}this[_0x6a27('0xd')][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0x113'),_0x30b0d8[_0x6a27('0x111')]));var _0x326101=eval(_0x30b0d8[_0x6a27('0x111')]);if(!this['isConfigured'](_0x30b0d8['variable_id'])){return this[_0x6a27('0xd')][_0x6a27('0x8d')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x129628=this['getVariable'][_0x6a27('0x7a')](this,_0x30b0d8[_0x6a27('0xa3')]);if(!_0x129628){return this[_0x6a27('0xd')]['error'](_0x30b0d8,'no\x20variable\x20found');}if(_[_0x6a27('0x114')](_0x326101)){var _0x119ab0=this;_0x326101['forEach'](function(_0x4638bf,_0x562c06){_0x119ab0[_0x6a27('0xd')][_0x6a27('0x77')](util['format'](_0x6a27('0x115'),_0x129628,_0x562c06),_0x4638bf);});return this[_0x6a27('0xd')][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0x116'),_0x129628));}else{return this[_0x6a27('0xd')][_0x6a27('0x77')](_0x129628,_0x326101);}};AGIVertices[_0x6a27('0xf')]['menu']=function(_0x2d4e1d){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0x117'),_0x2d4e1d[_0x6a27('0x35')]));if(_0x2d4e1d['retry']===0x0){return this[_0x6a27('0x79')](_0x2d4e1d);}_0x2d4e1d[_0x6a27('0x7b')]-=0x1;if(!this[_0x6a27('0x78')](_0x2d4e1d[_0x6a27('0x118')])){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x2d4e1d,_0x6a27('0xc5'));}var _0xf0f9cf=this[_0x6a27('0xc6')][_0x6a27('0x7a')](this,_0x2d4e1d[_0x6a27('0x118')]);if(!_0xf0f9cf){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x2d4e1d,'no\x20file\x20audio\x20found');}var _0x29b44e=this[_0x6a27('0xd')][_0x6a27('0xc8')](_0xf0f9cf,_0x2d4e1d[_0x6a27('0xc9')],_0x2d4e1d[_0x6a27('0x119')]);var _0x30d7a3=_0x29b44e[_0x6a27('0x75')];if(_0x29b44e[_0x6a27('0x75')]===-0x1){this[_0x6a27('0x33')][_0x6a27('0x7a')](this,_0x2d4e1d,'-1');return _0x29b44e;}else if(_0x29b44e['extra']===_0x6a27('0x82')){_0x29b44e[_0x6a27('0x75')]=_0x29b44e[_0x6a27('0x75')]['length']>0x0?_0x29b44e[_0x6a27('0x75')]:'t';}else if(_['isEmpty'](_0x29b44e[_0x6a27('0x75')])){_0x29b44e[_0x6a27('0x75')]='#';_0x30d7a3='#';}if(!this[_0x6a27('0x78')](_0x2d4e1d[_0x6a27('0xa3')])){this[_0x6a27('0xd')][_0x6a27('0x8d')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x2a1c13=this[_0x6a27('0x10')][_0x6a27('0x7a')](this,_0x2d4e1d[_0x6a27('0xa3')]);if(!_0x2a1c13){return this['channel'][_0x6a27('0x29')](_0x2d4e1d,_0x6a27('0xcd'));}this[_0x6a27('0xd')][_0x6a27('0x77')](_0x2a1c13,_0x30d7a3);}this[_0x6a27('0x33')][_0x6a27('0x7a')](this,_0x2d4e1d,_0x30d7a3);return _0x29b44e;};AGIVertices[_0x6a27('0xf')]['noop']=function(_0x2d3603){logger[_0x6a27('0x2b')](util['format'](_0x6a27('0x11a'),_0x2d3603[_0x6a27('0x35')]));return this['channel']['noop'](_0x2d3603[_0x6a27('0x11b')]||_0x2d3603['label']);};AGIVertices[_0x6a27('0xf')][_0x6a27('0x11c')]=function(_0x8bf09f){logger[_0x6a27('0x2b')](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x8bf09f['label']));if(!this['isConfigured'](_0x8bf09f[_0x6a27('0x109')])){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x8bf09f,_0x6a27('0x107'));}logger[_0x6a27('0x2b')](util[_0x6a27('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x6a27('0xd')][_0x6a27('0x4b')],_0x8bf09f['findBy']));var _0x6751f1=this[_0x6a27('0x48')][_0x6a27('0x7a')](this,_0x8bf09f[_0x6a27('0x11d')]);var _0x33496c=this[_0x6a27('0x11e')]['sync'](this,_0x8bf09f[_0x6a27('0x109')],_0x6751f1);if(_0x33496c){logger[_0x6a27('0x2b')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x8bf09f['findBy']));this[_0x6a27('0xd')]['noop'](util['format'](_0x6a27('0x10f'),this[_0x6a27('0xd')]['callerid'],_0x8bf09f['findBy']));return{'code':0xc8,'result':_0x6a27('0x10a')};}else{logger[_0x6a27('0x2b')](util[_0x6a27('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x6a27('0x4b')],_0x8bf09f[_0x6a27('0x109')]));this[_0x6a27('0xd')]['noop'](util['format'](_0x6a27('0x10f'),this[_0x6a27('0xd')][_0x6a27('0x4b')],_0x8bf09f['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x6a27('0xf')][_0x6a27('0x11f')]=function(_0x5cdf1a){logger[_0x6a27('0x2b')](util['format'](_0x6a27('0x120'),_0x5cdf1a[_0x6a27('0x35')]));if(!this[_0x6a27('0x78')](_0x5cdf1a['file_id'])){return this['channel']['error'](_0x5cdf1a,_0x6a27('0xc5'));}var _0xda79d=this[_0x6a27('0xc6')][_0x6a27('0x7a')](this,_0x5cdf1a[_0x6a27('0x118')]);if(!_0xda79d){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x5cdf1a,'no\x20file\x20audio\x20found');}var _0x478181=this[_0x6a27('0xd')]['exec']('PLAYBACK',[_0xda79d,_0x5cdf1a[_0x6a27('0xb1')]]);if(_0x478181[_0x6a27('0x75')]===-0x1){return _0x478181;}return this[_0x6a27('0xd')][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0x8e'),_0x6a27('0x121'),_0xda79d));};AGIVertices['prototype'][_0x6a27('0x122')]=function(_0x125386){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0x123'),_0x125386[_0x6a27('0x35')]));if(!this[_0x6a27('0x78')](_0x125386[_0x6a27('0x124')])){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x125386,_0x6a27('0x125'));}var _0x28c70e='';var _0x111997=parseInt(_0x125386[_0x6a27('0x124')],0xa);if(isNaN(_0x111997)){_0x28c70e=_0x125386[_0x6a27('0x124')];}else{_0x28c70e=this[_0x6a27('0x15')][_0x6a27('0x7a')](this,_0x125386[_0x6a27('0x124')]);if(!_0x28c70e){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x125386,_0x6a27('0x126'));}}var _0x274e92='';if(this[_0x6a27('0x78')](_0x125386[_0x6a27('0x118')])){var _0x39505a=this['getSound'][_0x6a27('0x7a')](this,_0x125386[_0x6a27('0x118')]);if(_0x39505a){_0x274e92=_0x39505a;}}this[_0x6a27('0x33')][_0x6a27('0x7a')](this,_0x125386,_0x28c70e);if(_0x125386[_0x6a27('0xb1')][_0x6a27('0x127')]('x')<0x0){_0x125386[_0x6a27('0xb1')]+='x';}if(_0x125386[_0x6a27('0xb1')][_0x6a27('0x127')]('X')<0x0){_0x125386['opts']+='X';}this['channel']['setVariable'](_0x6a27('0x128'),_0x28c70e?_0x28c70e['toLowerCase']():'');var _0x4352d0=this['channel'][_0x6a27('0x53')](_0x6a27('0x129'),[_0x28c70e,_0x125386[_0x6a27('0xb1')],_0x125386[_0x6a27('0xb2')],_0x274e92,_0x125386[_0x6a27('0x82')],_0x125386[_0x6a27('0x7c')],_0x125386[_0x6a27('0x12a')],_0x125386[_0x6a27('0x12b')],'',_0x125386[_0x6a27('0x12c')]]);if(_0x4352d0[_0x6a27('0x75')]===-0x1){return _0x4352d0;}return this[_0x6a27('0xd')]['noop'](util[_0x6a27('0x25')](_0x6a27('0x8e'),_0x6a27('0x129'),_0x28c70e));};AGIVertices[_0x6a27('0xf')][_0x6a27('0x12d')]=function(_0x4b9995){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0x12e'),_0x4b9995[_0x6a27('0x35')]));var _0x9bc295=_0x4b9995[_0x6a27('0x12f')]||'wav';var _0x3726f9=util[_0x6a27('0x25')]('%s_%s',this['channel']['uniqueid'],rs[_0x6a27('0xe1')](0x5));var _0x477a6d=util[_0x6a27('0x25')]('%s/recordings/%s.%s',FILES_PATH,_0x3726f9,_0x9bc295);var _0x16afac=util[_0x6a27('0x25')](_0x6a27('0xe0'),FILES_PATH,_0x3726f9);this[_0x6a27('0x38')]['sync'](this,_0x4b9995,_0x3726f9,_0x477a6d);this[_0x6a27('0xd')][_0x6a27('0x77')]('RECORDING_SAVENAME',_0x3726f9);logger[_0x6a27('0x2b')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x16afac,_0x9bc295,_0x4b9995[_0x6a27('0x130')],_0x4b9995[_0x6a27('0x82')]);return this[_0x6a27('0xd')][_0x6a27('0xe5')](_0x16afac,_0x9bc295,_0x4b9995['escape_digits'],_0x4b9995[_0x6a27('0x82')],undefined,!![]);};AGIVertices[_0x6a27('0xf')]['saydigits']=function(_0x5ab3c6){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0x131'),_0x5ab3c6['label']));return this[_0x6a27('0xd')][_0x6a27('0x132')](_0x5ab3c6[_0x6a27('0x133')][_0x6a27('0x55')](/\s+/g,''),_0x5ab3c6[_0x6a27('0x130')]);};AGIVertices['prototype']['saynumber']=function(_0x368969){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0x134'),_0x368969[_0x6a27('0x35')]));return this[_0x6a27('0xd')]['sayNumber'](_0x368969['number'][_0x6a27('0x55')](/\s+/g,''),_0x368969[_0x6a27('0x130')]);};AGIVertices[_0x6a27('0xf')][_0x6a27('0x135')]=function(_0x140325){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0x136'),_0x140325[_0x6a27('0x35')]));return this['channel'][_0x6a27('0x137')](_0x140325['text'],_0x140325['escape_digits']);};AGIVertices[_0x6a27('0xf')]['sendMail']=function(_0x19be0f){logger[_0x6a27('0x2b')](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x19be0f[_0x6a27('0x35')]));if(!this['isConfigured'](_0x19be0f[_0x6a27('0x138')])){return this['channel'][_0x6a27('0x8d')](_0x6a27('0x139'));}var _0x375959=this[_0x6a27('0x1e')]['sync'](this,_0x19be0f['account_id']);if(!_0x375959||!_0x375959[_0x6a27('0x13a')]){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x19be0f,_0x6a27('0x13b'));}var _0x539395={'from':util[_0x6a27('0x25')](_0x6a27('0x13c'),_0x375959[_0x6a27('0x14')],_0x375959[_0x6a27('0x13d')]||_0x375959[_0x6a27('0x13a')][_0x6a27('0x13e')]),'to':_0x19be0f['to']||'','cc':_0x19be0f['cc']||'','bcc':_0x19be0f[_0x6a27('0x13f')]||'','subject':_0x19be0f[_0x6a27('0x140')],'html':_0x19be0f[_0x6a27('0x57')],'text':_0x19be0f[_0x6a27('0x57')]};var _0x230563={'tls':{'rejectUnauthorized':![]}};if(_0x375959[_0x6a27('0x13a')]['service']){_0x230563[_0x6a27('0x141')]=_0x375959['Smtp'][_0x6a27('0x141')];}else{_0x230563[_0x6a27('0x142')]=_0x375959[_0x6a27('0x13a')][_0x6a27('0x142')];_0x230563[_0x6a27('0x143')]=_0x375959[_0x6a27('0x13a')]['port'];_0x230563['secure']=_0x375959['Smtp'][_0x6a27('0x144')];}if(_0x375959[_0x6a27('0x13a')][_0x6a27('0x145')]){_0x230563[_0x6a27('0x146')]={'user':_0x375959[_0x6a27('0x13a')][_0x6a27('0x13e')],'pass':_0x375959[_0x6a27('0x13a')][_0x6a27('0x147')]};}if(this[_0x6a27('0x78')](_0x19be0f[_0x6a27('0x148')])){}logger[_0x6a27('0xab')](_0x6a27('0x149'),JSON[_0x6a27('0x101')](_0x539395));this['createSquareDetailsReport']['sync'](this,_0x19be0f,_0x19be0f[_0x6a27('0x138')]);this[_0x6a27('0xd')][_0x6a27('0x8d')](util['format'](_0x6a27('0x14a'),_0x375959[_0x6a27('0x14')]));this[_0x6a27('0x1f')][_0x6a27('0x7a')](this,_0x230563,_0x539395);return this[_0x6a27('0xd')][_0x6a27('0x8d')](_0x6a27('0x14b'));};AGIVertices[_0x6a27('0xf')][_0x6a27('0x14c')]=function(_0x93ed79){logger['info'](util[_0x6a27('0x25')](_0x6a27('0x14d'),_0x93ed79[_0x6a27('0x35')]));return this['channel'][_0x6a27('0x8d')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x6a27('0xf')][_0x6a27('0x14e')]=function(_0x218748){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0x14f'),_0x218748['label']));if(!this[_0x6a27('0x78')](_0x218748[_0x6a27('0x150')])){return this['channel'][_0x6a27('0x8d')](_0x6a27('0x151'));}var _0x896d1=this[_0x6a27('0x152')][_0x6a27('0x7a')](this,_0x218748[_0x6a27('0x150')]);if(!_0x896d1){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x218748,'no\x20sms\x20account\x20found');}var _0x443f44={'body':_0x218748[_0x6a27('0x153')],'phone':_0x218748['to']||'','SmsAccountId':_0x896d1['id']};logger[_0x6a27('0xab')](_0x6a27('0x154'),JSON[_0x6a27('0x101')](_0x443f44));this[_0x6a27('0x33')]['sync'](this,_0x218748,_0x218748[_0x6a27('0x150')]);this[_0x6a27('0xd')][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0x155'),_0x896d1['name']));this[_0x6a27('0x32')]['sync'](this,_0x443f44);return this[_0x6a27('0xd')][_0x6a27('0x8d')](_0x6a27('0x156'));};AGIVertices[_0x6a27('0xf')][_0x6a27('0x157')]=function(_0x88fe73){logger['info'](util[_0x6a27('0x25')](_0x6a27('0x158'),_0x88fe73[_0x6a27('0x35')]));if(!this[_0x6a27('0x78')](_0x88fe73[_0x6a27('0xa3')])){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x88fe73,'no\x20variable\x20selected');}var _0x47057a=this[_0x6a27('0x10')][_0x6a27('0x7a')](this,_0x88fe73[_0x6a27('0xa3')]);if(!_0x47057a){return this['channel']['error'](_0x88fe73,_0x6a27('0xcd'));}return this['channel'][_0x6a27('0x77')](_0x47057a,_0x88fe73[_0x6a27('0x159')]);};AGIVertices[_0x6a27('0xf')]['start']=function(_0xd4de0a){logger['info'](util[_0x6a27('0x25')](_0x6a27('0x15a'),_0xd4de0a['label']));this['channel'][_0x6a27('0x8d')]('START\x20CALLY\x20SQUARE');if(_0xd4de0a['answer']==='yes'){this['channel'][_0x6a27('0x8d')](_0x6a27('0x15b'));return this[_0x6a27('0xd')]['answer']();}return this[_0x6a27('0xd')][_0x6a27('0x8d')](_0x6a27('0x15c'));};AGIVertices[_0x6a27('0xf')][_0x6a27('0x15d')]=function(_0x74c21f){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0x15e'),_0x74c21f[_0x6a27('0x35')]));if(!this['isConfigured'](_0x74c21f[_0x6a27('0x15f')])){return this['channel']['error'](_0x74c21f,_0x6a27('0x160'));}var _0x4bdaf6=this[_0x6a27('0x18')][_0x6a27('0x7a')](this,_0x74c21f[_0x6a27('0x15f')]);if(!this[_0x6a27('0x78')](_0x4bdaf6)){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x74c21f,util[_0x6a27('0x25')](_0x6a27('0x161'),_0x74c21f[_0x6a27('0x15f')]));}if(_0x4bdaf6===this[_0x6a27('0xd')][_0x6a27('0x37')]){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x74c21f,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x6a27('0x33')]['sync'](this,_0x74c21f,_0x4bdaf6);var _0x541f37=this[_0x6a27('0xd')][_0x6a27('0x53')](_0x6a27('0x162'),util['format'](_0x6a27('0x163'),config['agi'][_0x6a27('0x142')]||_0x6a27('0x164'),_0x4bdaf6,this[_0x6a27('0xd')][_0x6a27('0x37')]));if(_0x541f37[_0x6a27('0x75')]===-0x1){return _0x541f37;}return this[_0x6a27('0xd')][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0x8e'),_0x6a27('0x162'),_0x4bdaf6));};AGIVertices[_0x6a27('0xf')][_0x6a27('0x165')]=function(_0x2d71f7){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x2d71f7[_0x6a27('0x35')]));var _0xee3d70=this[_0x6a27('0x52')][_0x6a27('0x7a')](this,_0x2d71f7[_0x6a27('0x7e')]);this[_0x6a27('0x33')][_0x6a27('0x7a')](this,_0x2d71f7,_0x2d71f7['command']);if(this[_0x6a27('0x78')](_0x2d71f7['variable_id'])){var _0x16c4ea=this[_0x6a27('0x10')]['sync'](this,_0x2d71f7[_0x6a27('0xa3')]);if(_0x16c4ea){this['channel']['setVariable'](_0x16c4ea,_0xee3d70);return this[_0x6a27('0xd')][_0x6a27('0x8d')](util['format'](_0x6a27('0x166'),_0x2d71f7['command'],_0x16c4ea));}}return this['channel'][_0x6a27('0x8d')](util['format'](_0x6a27('0x167'),_0x2d71f7[_0x6a27('0x7e')]));};AGIVertices[_0x6a27('0xf')]['tts']=function(_0x1c6d06){logger['info'](util['format'](_0x6a27('0x168'),_0x1c6d06['label']));if(!this[_0x6a27('0x78')](_0x1c6d06[_0x6a27('0x57')])){return this[_0x6a27('0xd')][_0x6a27('0x8d')](_0x6a27('0xb6'));}this[_0x6a27('0xd')][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0x169'),_0x1c6d06[_0x6a27('0x57')]));var _0x5b1a50=this['googleTTS']['sync'](this,_0x1c6d06);if(_0x5b1a50){this[_0x6a27('0xd')][_0x6a27('0x8d')](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x5b1a50));var _0x3b2d6f=this[_0x6a27('0xd')][_0x6a27('0xdc')](_0x5b1a50);try{fs[_0x6a27('0x102')](_0x5b1a50+'.wav');}catch(_0x38c9f7){logger['error'](_0x38c9f7);}return _0x3b2d6f;}return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x1c6d06,_0x6a27('0x16a'));};AGIVertices[_0x6a27('0xf')]['unpause']=function(_0x501856){logger[_0x6a27('0x2b')](util['format'](_0x6a27('0x16b'),_0x501856[_0x6a27('0x35')]));if(!this[_0x6a27('0x78')](_0x501856['findBy'])){return this['channel'][_0x6a27('0x29')](_0x501856,_0x6a27('0x107'));}logger['info'](util['format'](_0x6a27('0x108'),this[_0x6a27('0xd')][_0x6a27('0x4b')],_0x501856['findBy']));var _0x438bed=this[_0x6a27('0x4c')]['sync'](this,_0x501856[_0x6a27('0x109')]);if(_0x438bed){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0x10f'),this['channel'][_0x6a27('0x4b')],_0x501856['findBy']));this['channel']['noop'](util[_0x6a27('0x25')](_0x6a27('0x10f'),this[_0x6a27('0xd')][_0x6a27('0x4b')],_0x501856[_0x6a27('0x109')]));return{'code':0xc8,'result':_0x6a27('0x10a')};}else{logger['info'](util['format'](_0x6a27('0x10b'),this['channel'][_0x6a27('0x4b')],_0x501856['findBy']));this['channel'][_0x6a27('0x8d')](util['format'](_0x6a27('0x10b'),this[_0x6a27('0xd')][_0x6a27('0x4b')],_0x501856[_0x6a27('0x109')]));return{'code':0xc8,'result':_0x6a27('0x10c')};}};AGIVertices[_0x6a27('0xf')]['voicemail']=function(_0xa8bd1e){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0x16c'),_0xa8bd1e[_0x6a27('0x35')]));var _0x565262=this[_0x6a27('0xd')][_0x6a27('0x53')](_0x6a27('0x16d'),[_0xa8bd1e[_0x6a27('0x16e')],_0xa8bd1e[_0x6a27('0x90')]]);if(_0x565262[_0x6a27('0x75')]===-0x1){return _0x565262;}return this[_0x6a27('0xd')][_0x6a27('0x8d')](util[_0x6a27('0x25')](_0x6a27('0x8e'),'VOICEMAIL',_0xa8bd1e[_0x6a27('0x16e')]));};AGIVertices[_0x6a27('0xf')][_0x6a27('0x16f')]=function(_0x3d4514){logger[_0x6a27('0x2b')](util[_0x6a27('0x25')](_0x6a27('0x170'),_0x3d4514[_0x6a27('0x35')]));if(!this['isConfigured'](_0x3d4514[_0x6a27('0xa3')])){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x3d4514,'no\x20variable\x20selected');}var _0x3cc086=this[_0x6a27('0x10')][_0x6a27('0x7a')](this,_0x3d4514[_0x6a27('0xa3')]);if(!_0x3cc086){return this[_0x6a27('0xd')][_0x6a27('0x29')](_0x3d4514,_0x6a27('0xcd'));}var _0xe8c4b2=this[_0x6a27('0xd')][_0x6a27('0x10')](_0x3cc086);return{'code':0xc8,'result':_0xe8c4b2['extra']?_0xe8c4b2['extra']:'-'};};String[_0x6a27('0xf')][_0x6a27('0x72')]=function(_0x329aab,_0x1dfc85){return this['split'](_0x329aab)[_0x6a27('0x171')](_0x1dfc85);};module[_0x6a27('0x172')]=AGIVertices;
\ No newline at end of file
index bffe346..2e4e693 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbea1=['milliseconds','seconds','prototype','Action','QueuePause','ACW','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','queue','updateAcw','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','uniqueid','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','origtransfereruniqueid','[%s][ATTENDEDTRANSFER:LINKEDID]','origtransfererlinkedid','[%s][ATTENDEDTRANSFER:TRANSFERTARGETUNIQUEID]','transfertargetuniqueid','find','format','localtwoconnectedlinename','findKey','SIP/%s','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','../ami','../../../config/logger','acw','socket.io-emitter','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','custom:agentConnectPreview','syncAgentConnectPreview'];(function(_0x283d53,_0x116754){var _0x5b3046=function(_0x5dd789){while(--_0x5dd789){_0x283d53['push'](_0x283d53['shift']());}};_0x5b3046(++_0x116754);}(_0xbea1,0x98));var _0x1bea=function(_0x27efcf,_0x320952){_0x27efcf=_0x27efcf-0x0;var _0xdb0237=_0xbea1[_0x27efcf];return _0xdb0237;};'use strict';var util=require(_0x1bea('0x0'));var _=require(_0x1bea('0x1'));var moment=require('moment');var ami=require(_0x1bea('0x2'));var logger=require(_0x1bea('0x3'))(_0x1bea('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var io=require(_0x1bea('0x5'))({'host':'localhost','port':0x18eb});function Acw(_0x4e7b0f){this[_0x1bea('0x6')]=_0x4e7b0f['voiceQueues'];this['agents']=_0x4e7b0f[_0x1bea('0x7')];this['timers']=_0x4e7b0f[_0x1bea('0x8')];this[_0x1bea('0x9')]={};ami['on'](_0x1bea('0xa'),this[_0x1bea('0xb')]['bind'](this));ami['on'](_0x1bea('0xc'),this[_0x1bea('0xd')][_0x1bea('0xe')](this));ami['on'](_0x1bea('0xf'),this[_0x1bea('0x10')][_0x1bea('0xe')](this));ami['on'](_0x1bea('0x11'),this[_0x1bea('0x12')][_0x1bea('0xe')](this));ami['on']('attendedtransfer',this[_0x1bea('0x13')]['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x1bea('0xe')](this));ami['on'](_0x1bea('0x14'),this[_0x1bea('0x15')][_0x1bea('0xe')](this));}function getDiff(_0x470af2){var _0x5e7437=moment()['milliseconds'](0x0);var _0x3bede9=moment(_0x470af2)[_0x1bea('0x16')](0x0);return _0x5e7437['diff'](_0x3bede9,_0x1bea('0x17'));}Acw[_0x1bea('0x18')]['startAcw']=function(_0x485473){try{var _0x41d241=this;var _0x115e8d=this['channels'][_0x485473]['interface'];var _0x35366e=this[_0x1bea('0x9')][_0x485473]['queue'];ami[_0x1bea('0x19')]({'action':_0x1bea('0x1a'),'interface':_0x115e8d,'paused':!![],'reason':_0x1bea('0x1b')})[_0x1bea('0x1c')](function(_0x35fc06){if(_0x41d241[_0x1bea('0x7')][_0x115e8d]){return RpcUser[_0x1bea('0x1d')](_0x41d241[_0x1bea('0x7')][_0x115e8d]['id'])[_0x1bea('0x1c')](function(_0x242b2f){if(_0x242b2f&&!_0x242b2f[_0x1bea('0x1e')]){logger['info'](_0x1bea('0x1f'),_0x485473,_0x115e8d,_0x35366e);return RpcUser[_0x1bea('0x20')](_0x41d241[_0x1bea('0x7')][_0x115e8d],_0x1bea('0x1b'),_0x485473)['then'](function(_0xf6d4a6){_0x41d241[_0x1bea('0x8')][_0x115e8d]={};logger[_0x1bea('0x21')](_0x1bea('0x22'),_0x485473,_0x41d241[_0x1bea('0x6')][_0x35366e][_0x1bea('0x23')],_0x115e8d,_0x35366e);_0x41d241[_0x1bea('0x8')][_0x115e8d][_0x1bea('0x24')]=setTimeout(_0x41d241[_0x1bea('0x25')][_0x1bea('0xe')](_0x41d241,_0x115e8d),_0x41d241['voiceQueues'][_0x35366e][_0x1bea('0x23')]*0x3e8);_0x41d241[_0x1bea('0x8')][_0x115e8d]['lastPauseAt']=_0xf6d4a6['lastPauseAt'];_0x41d241['timers'][_0x115e8d]['uniqueid']=_0x485473;_0x41d241['timers'][_0x115e8d][_0x1bea('0x26')]=_0x35366e;_0x41d241['timers'][_0x115e8d][_0x1bea('0x27')]=function(){var _0x37ce70=getDiff(_0x41d241[_0x1bea('0x8')][_0x115e8d][_0x1bea('0x28')]);clearTimeout(_0x41d241['timers'][_0x115e8d][_0x1bea('0x24')]);RpcVoiceAgentReport[_0x1bea('0x29')]({'acwtime':_0x37ce70},_0x41d241['timers'][_0x115e8d]['uniqueid'],_0x115e8d)['then'](function(_0x4e9c17){logger['info'](_0x1bea('0x2a'),_0x485473,_0x37ce70,_0x4e9c17);})[_0x1bea('0x2b')](function(_0xa3dc1f){logger['error'](_0x1bea('0x2c'),_0x485473,_0xa3dc1f);});delete _0x41d241[_0x1bea('0x8')][_0x115e8d];};});}else{logger[_0x1bea('0x21')](_0x1bea('0x2d'),_0x485473,_0x115e8d,_0x35366e);}});}})[_0x1bea('0x2b')](function(_0x544b30){logger[_0x1bea('0x2e')](_0x1bea('0x22'),_0x485473,_0x41d241[_0x1bea('0x6')][_0x35366e]['acwTimeout'],_0x115e8d,_0x35366e);})[_0x1bea('0x2f')](function(){delete _0x41d241[_0x1bea('0x9')][_0x485473];});}catch(_0x1a4a1d){logger[_0x1bea('0x2e')](_0x1bea('0x30'),_0x1a4a1d[_0x1bea('0x31')]);}};Acw[_0x1bea('0x18')][_0x1bea('0x25')]=function(_0x34e53b){try{var _0xe37295=this;if(_0xe37295[_0x1bea('0x8')][_0x34e53b]){var _0xdf78f4=_0xe37295[_0x1bea('0x8')][_0x34e53b][_0x1bea('0x32')];var _0x4234c2=_0xe37295[_0x1bea('0x8')][_0x34e53b]['queue'];var _0x560b0a=_0xe37295[_0x1bea('0x6')][_0x4234c2][_0x1bea('0x23')];logger[_0x1bea('0x21')]('[TIMER][STOP][AGENT:%s]',_0x34e53b);RpcUser['saveUnpause'](this[_0x1bea('0x7')][_0x34e53b]);RpcVoiceAgentReport[_0x1bea('0x29')]({'acwtime':_0x560b0a,'agentacw':!![]},_0xdf78f4,_0x34e53b)[_0x1bea('0x1c')](function(_0x424d0f){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0xdf78f4,_0x560b0a,_0x424d0f);})['catch'](function(_0x31bc99){logger['error']('[%s][UPDATE][ERRORS:%s]',_0xdf78f4,_0x31bc99);});}else{logger[_0x1bea('0x2e')](_0x1bea('0x33'),_0x34e53b);if(_0xe37295['timers']){logger[_0x1bea('0x21')]('[ACW][TIMERS]',JSON[_0x1bea('0x34')](_0xe37295[_0x1bea('0x8')]));}}}catch(_0xdb427f){logger[_0x1bea('0x2e')](_0x1bea('0x35'),_0xdb427f[_0x1bea('0x31')]);}};Acw[_0x1bea('0x18')][_0x1bea('0xb')]=function(_0x2e4f5a){try{if(this['voiceQueues'][_0x2e4f5a[_0x1bea('0x26')]]&&this['voiceQueues'][_0x2e4f5a[_0x1bea('0x26')]][_0x1bea('0x4')]){if(this[_0x1bea('0x7')][_0x2e4f5a['interface']]){this['channels'][_0x2e4f5a[_0x1bea('0x32')]]={'queue':_0x2e4f5a[_0x1bea('0x26')],'interface':_0x2e4f5a[_0x1bea('0x36')]};}}}catch(_0x33c864){logger[_0x1bea('0x2e')](_0x1bea('0x37'),_0x33c864[_0x1bea('0x31')]);}};Acw[_0x1bea('0x18')][_0x1bea('0x15')]=function(_0x25bcd5){try{if(this['voiceQueues'][_0x25bcd5[_0x1bea('0x26')]]&&this[_0x1bea('0x6')][_0x25bcd5[_0x1bea('0x26')]][_0x1bea('0x4')]){if(this[_0x1bea('0x7')][_0x25bcd5[_0x1bea('0x36')]]){this['channels'][_0x25bcd5[_0x1bea('0x32')]]={'queue':_0x25bcd5[_0x1bea('0x26')],'interface':_0x25bcd5['interface']};}}}catch(_0x5bfbb6){logger[_0x1bea('0x2e')](_0x1bea('0x38'),_0x5bfbb6[_0x1bea('0x31')]);}};Acw[_0x1bea('0x18')]['syncHangupRequest']=function(_0x55d721){try{if(this[_0x1bea('0x9')][_0x55d721['uniqueid']]&&_[_0x1bea('0x39')](this[_0x1bea('0x9')][_0x55d721[_0x1bea('0x32')]][_0x1bea('0x3a')])){logger[_0x1bea('0x21')](_0x1bea('0x3b'),_0x55d721[_0x1bea('0x32')]);this[_0x1bea('0x3c')](_0x55d721[_0x1bea('0x32')]);}else if(this[_0x1bea('0x9')][_0x55d721[_0x1bea('0x3d')]]&&_['isUndefined'](this[_0x1bea('0x9')][_0x55d721['linkedid']][_0x1bea('0x3a')])){logger['info'](_0x1bea('0x3e'),_0x55d721[_0x1bea('0x3d')]);this[_0x1bea('0x3c')](_0x55d721['linkedid']);}}catch(_0x14bd43){logger[_0x1bea('0x2e')]('[ACW][syncHangupRequest]\x20%s',_0x14bd43['message']);}};Acw[_0x1bea('0x18')][_0x1bea('0x10')]=function(_0x3c18e7){try{if(this[_0x1bea('0x9')][_0x3c18e7['uniqueid']]&&this[_0x1bea('0x9')][_0x3c18e7[_0x1bea('0x32')]][_0x1bea('0x3a')]){logger['info'](_0x1bea('0x3f'),_0x3c18e7[_0x1bea('0x32')]);this[_0x1bea('0x3c')](_0x3c18e7[_0x1bea('0x32')]);}}catch(_0x14e6a4){logger['error'](_0x1bea('0x40'),_0x14e6a4[_0x1bea('0x31')]);}};Acw[_0x1bea('0x18')][_0x1bea('0x13')]=function(_0x44b777){try{if(this[_0x1bea('0x9')][_0x44b777[_0x1bea('0x41')]]){logger['info']('[%s][ATTENDEDTRANSFER:UNIQUEID]',_0x44b777[_0x1bea('0x41')]);this['startAcw'](_0x44b777[_0x1bea('0x41')]);}else if(this['channels'][_0x44b777['origtransfererlinkedid']]){logger[_0x1bea('0x21')](_0x1bea('0x42'),_0x44b777[_0x1bea('0x43')]);this['startAcw'](_0x44b777[_0x1bea('0x43')]);}logger[_0x1bea('0x21')](_0x1bea('0x44'),_0x44b777[_0x1bea('0x45')]);this[_0x1bea('0x9')][_0x44b777[_0x1bea('0x45')]]=_[_0x1bea('0x46')](this['channels'],[_0x1bea('0x36'),util[_0x1bea('0x47')]('SIP/%s',_0x44b777[_0x1bea('0x48')])]);if(this[_0x1bea('0x9')][_0x44b777[_0x1bea('0x45')]]){this['channels'][_0x44b777['transfertargetuniqueid']]['attended']=!![];delete this[_0x1bea('0x9')][_[_0x1bea('0x49')](this['channels'],[_0x1bea('0x36'),util[_0x1bea('0x47')](_0x1bea('0x4a'),_0x44b777['localtwoconnectedlinename'])])];}}catch(_0x170d8c){logger['error'](_0x1bea('0x4b'),_0x170d8c['message']);}};Acw['prototype'][_0x1bea('0x4c')]=function(_0x59cdfc){try{if(this[_0x1bea('0x9')][_0x59cdfc[_0x1bea('0x4d')]]){logger['info'](_0x1bea('0x4e'),JSON[_0x1bea('0x34')](_0x59cdfc['transfereruniqueid']));this[_0x1bea('0x3c')](_0x59cdfc[_0x1bea('0x4d')]);}else if(this[_0x1bea('0x9')][_0x59cdfc[_0x1bea('0x4f')]]){logger[_0x1bea('0x21')](_0x1bea('0x50'),JSON[_0x1bea('0x34')](_0x59cdfc[_0x1bea('0x4f')]));this[_0x1bea('0x3c')](_0x59cdfc[_0x1bea('0x4f')]);}}catch(_0x457df8){logger[_0x1bea('0x2e')](_0x1bea('0x51'),_0x457df8[_0x1bea('0x31')]);}};Acw[_0x1bea('0x18')]['syncAgentRingNoAnswer']=function(_0x161019){try{if(this[_0x1bea('0x6')][_0x161019['queue']]&&this['voiceQueues'][_0x161019['queue']][_0x1bea('0x52')]===_0x1bea('0x53')){if(this[_0x1bea('0x7')][_0x161019[_0x1bea('0x36')]]){logger[_0x1bea('0x21')](_0x1bea('0x54'),_0x161019[_0x1bea('0x32')],_0x161019['interface'],_0x161019[_0x1bea('0x26')]);return RpcUser[_0x1bea('0x20')](this[_0x1bea('0x7')][_0x161019['interface']],_0x1bea('0x55'),_0x161019[_0x1bea('0x32')]);}}}catch(_0x67b1df){logger[_0x1bea('0x2e')](_0x1bea('0x56'),_0x67b1df['message']);}};module['exports']=Acw;
\ No newline at end of file
+var _0x5f13=['[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','interface','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','origtransfereruniqueid','[%s][ATTENDEDTRANSFER:UNIQUEID]','origtransfererlinkedid','[%s][ATTENDEDTRANSFER:LINKEDID]','transfertargetuniqueid','format','findKey','SIP/%s','localtwoconnectedlinename','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','lodash','../../../config/logger','acw','socket.io-emitter','localhost','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','queue','Action','ACW','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','savePause','info','acwTimeout','timer','stopAcw','updateAcw','lastPauseAt','update','error','[%s][UPDATE][ERRORS:%s]','catch','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','message','uniqueid','saveUnpause'];(function(_0x4e4061,_0x26503b){var _0x371dbd=function(_0x31a31f){while(--_0x31a31f){_0x4e4061['push'](_0x4e4061['shift']());}};_0x371dbd(++_0x26503b);}(_0x5f13,0x74));var _0x35f1=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x5f13[_0x4709c0];return _0x13348b;};'use strict';var util=require('util');var _=require(_0x35f1('0x0'));var moment=require('moment');var ami=require('../ami');var logger=require(_0x35f1('0x1'))(_0x35f1('0x2'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var io=require(_0x35f1('0x3'))({'host':_0x35f1('0x4'),'port':0x18eb});function Acw(_0x4a27a2){this[_0x35f1('0x5')]=_0x4a27a2[_0x35f1('0x5')];this[_0x35f1('0x6')]=_0x4a27a2[_0x35f1('0x6')];this[_0x35f1('0x7')]=_0x4a27a2[_0x35f1('0x7')];this[_0x35f1('0x8')]={};ami['on'](_0x35f1('0x9'),this[_0x35f1('0xa')][_0x35f1('0xb')](this));ami['on'](_0x35f1('0xc'),this[_0x35f1('0xd')][_0x35f1('0xb')](this));ami['on'](_0x35f1('0xe'),this['syncHangup'][_0x35f1('0xb')](this));ami['on'](_0x35f1('0xf'),this['syncAgentRingNoAnswer'][_0x35f1('0xb')](this));ami['on'](_0x35f1('0x10'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x35f1('0x11'),this[_0x35f1('0x12')][_0x35f1('0xb')](this));ami['on'](_0x35f1('0x13'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x2dc1d7){var _0x302a70=moment()[_0x35f1('0x14')](0x0);var _0x598af0=moment(_0x2dc1d7)['milliseconds'](0x0);return _0x302a70[_0x35f1('0x15')](_0x598af0,_0x35f1('0x16'));}Acw[_0x35f1('0x17')][_0x35f1('0x18')]=function(_0x25f32d){try{var _0x1a144f=this;var _0x45ad63=this[_0x35f1('0x8')][_0x25f32d]['interface'];var _0xaa8267=this[_0x35f1('0x8')][_0x25f32d][_0x35f1('0x19')];ami[_0x35f1('0x1a')]({'action':'QueuePause','interface':_0x45ad63,'paused':!![],'reason':_0x35f1('0x1b')})[_0x35f1('0x1c')](function(_0x2d2f20){if(_0x1a144f[_0x35f1('0x6')][_0x45ad63]){return RpcUser[_0x35f1('0x1d')](_0x1a144f[_0x35f1('0x6')][_0x45ad63]['id'])[_0x35f1('0x1c')](function(_0xdb3a2d){if(_0xdb3a2d&&!_0xdb3a2d[_0x35f1('0x1e')]){logger['info'](_0x35f1('0x1f'),_0x25f32d,_0x45ad63,_0xaa8267);return RpcUser[_0x35f1('0x20')](_0x1a144f[_0x35f1('0x6')][_0x45ad63],_0x35f1('0x1b'),_0x25f32d)['then'](function(_0x378a93){_0x1a144f['timers'][_0x45ad63]={};logger[_0x35f1('0x21')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x25f32d,_0x1a144f[_0x35f1('0x5')][_0xaa8267][_0x35f1('0x22')],_0x45ad63,_0xaa8267);_0x1a144f['timers'][_0x45ad63][_0x35f1('0x23')]=setTimeout(_0x1a144f[_0x35f1('0x24')][_0x35f1('0xb')](_0x1a144f,_0x45ad63),_0x1a144f['voiceQueues'][_0xaa8267]['acwTimeout']*0x3e8);_0x1a144f[_0x35f1('0x7')][_0x45ad63]['lastPauseAt']=_0x378a93['lastPauseAt'];_0x1a144f[_0x35f1('0x7')][_0x45ad63]['uniqueid']=_0x25f32d;_0x1a144f[_0x35f1('0x7')][_0x45ad63][_0x35f1('0x19')]=_0xaa8267;_0x1a144f[_0x35f1('0x7')][_0x45ad63][_0x35f1('0x25')]=function(){var _0x5d0574=getDiff(_0x1a144f[_0x35f1('0x7')][_0x45ad63][_0x35f1('0x26')]);clearTimeout(_0x1a144f['timers'][_0x45ad63][_0x35f1('0x23')]);RpcVoiceAgentReport[_0x35f1('0x27')]({'acwtime':_0x5d0574},_0x1a144f['timers'][_0x45ad63]['uniqueid'],_0x45ad63)['then'](function(_0x19585e){logger[_0x35f1('0x21')]('[%s][UPDATE][ACWTIME:%s]',_0x25f32d,_0x5d0574,_0x19585e);})['catch'](function(_0x2808a0){logger[_0x35f1('0x28')](_0x35f1('0x29'),_0x25f32d,_0x2808a0);});delete _0x1a144f[_0x35f1('0x7')][_0x45ad63];};});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x25f32d,_0x45ad63,_0xaa8267);}});}})[_0x35f1('0x2a')](function(_0x56bf9f){logger['error'](_0x35f1('0x2b'),_0x25f32d,_0x1a144f[_0x35f1('0x5')][_0xaa8267]['acwTimeout'],_0x45ad63,_0xaa8267);})[_0x35f1('0x2c')](function(){delete _0x1a144f[_0x35f1('0x8')][_0x25f32d];});}catch(_0x10de57){logger[_0x35f1('0x28')]('[ACW][START]\x20%s',_0x10de57[_0x35f1('0x2d')]);}};Acw['prototype'][_0x35f1('0x24')]=function(_0x32eee9){try{var _0xa70de8=this;if(_0xa70de8[_0x35f1('0x7')][_0x32eee9]){var _0x18f8ac=_0xa70de8[_0x35f1('0x7')][_0x32eee9][_0x35f1('0x2e')];var _0x2a44de=_0xa70de8['timers'][_0x32eee9][_0x35f1('0x19')];var _0x3870e3=_0xa70de8[_0x35f1('0x5')][_0x2a44de]['acwTimeout'];logger[_0x35f1('0x21')]('[TIMER][STOP][AGENT:%s]',_0x32eee9);RpcUser[_0x35f1('0x2f')](this[_0x35f1('0x6')][_0x32eee9]);RpcVoiceAgentReport[_0x35f1('0x27')]({'acwtime':_0x3870e3,'agentacw':!![]},_0x18f8ac,_0x32eee9)['then'](function(_0x49b693){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x18f8ac,_0x3870e3,_0x49b693);})[_0x35f1('0x2a')](function(_0x37e30a){logger[_0x35f1('0x28')]('[%s][UPDATE][ERRORS:%s]',_0x18f8ac,_0x37e30a);});}else{logger[_0x35f1('0x28')](_0x35f1('0x30'),_0x32eee9);if(_0xa70de8[_0x35f1('0x7')]){logger[_0x35f1('0x21')](_0x35f1('0x31'),JSON[_0x35f1('0x32')](_0xa70de8[_0x35f1('0x7')]));}}}catch(_0x25581e){logger['error'](_0x35f1('0x33'),_0x25581e[_0x35f1('0x2d')]);}};Acw['prototype'][_0x35f1('0xa')]=function(_0xae8035){try{if(this['voiceQueues'][_0xae8035[_0x35f1('0x19')]]&&this[_0x35f1('0x5')][_0xae8035[_0x35f1('0x19')]]['acw']){if(this['agents'][_0xae8035[_0x35f1('0x34')]]){this[_0x35f1('0x8')][_0xae8035[_0x35f1('0x2e')]]={'queue':_0xae8035['queue'],'interface':_0xae8035['interface']};}}}catch(_0x4396fc){logger[_0x35f1('0x28')](_0x35f1('0x35'),_0x4396fc[_0x35f1('0x2d')]);}};Acw[_0x35f1('0x17')][_0x35f1('0x36')]=function(_0x3df822){try{if(this[_0x35f1('0x5')][_0x3df822[_0x35f1('0x19')]]&&this['voiceQueues'][_0x3df822[_0x35f1('0x19')]]['acw']){if(this[_0x35f1('0x6')][_0x3df822[_0x35f1('0x34')]]){this['channels'][_0x3df822[_0x35f1('0x2e')]]={'queue':_0x3df822['queue'],'interface':_0x3df822[_0x35f1('0x34')]};}}}catch(_0x21484c){logger[_0x35f1('0x28')]('[ACW][syncAgentConnectPreview]\x20%s',_0x21484c['message']);}};Acw['prototype'][_0x35f1('0xd')]=function(_0x27e7d0){try{if(this[_0x35f1('0x8')][_0x27e7d0[_0x35f1('0x2e')]]&&_[_0x35f1('0x37')](this[_0x35f1('0x8')][_0x27e7d0[_0x35f1('0x2e')]][_0x35f1('0x38')])){logger[_0x35f1('0x21')](_0x35f1('0x39'),_0x27e7d0[_0x35f1('0x2e')]);this['startAcw'](_0x27e7d0[_0x35f1('0x2e')]);}else if(this['channels'][_0x27e7d0['linkedid']]&&_[_0x35f1('0x37')](this[_0x35f1('0x8')][_0x27e7d0['linkedid']][_0x35f1('0x38')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x27e7d0[_0x35f1('0x3a')]);this[_0x35f1('0x18')](_0x27e7d0[_0x35f1('0x3a')]);}}catch(_0x3abae2){logger[_0x35f1('0x28')](_0x35f1('0x3b'),_0x3abae2[_0x35f1('0x2d')]);}};Acw[_0x35f1('0x17')][_0x35f1('0x3c')]=function(_0x51a408){try{if(this[_0x35f1('0x8')][_0x51a408[_0x35f1('0x2e')]]&&this['channels'][_0x51a408['uniqueid']]['attended']){logger['info'](_0x35f1('0x3d'),_0x51a408[_0x35f1('0x2e')]);this[_0x35f1('0x18')](_0x51a408['uniqueid']);}}catch(_0x2a1790){logger[_0x35f1('0x28')](_0x35f1('0x3e'),_0x2a1790[_0x35f1('0x2d')]);}};Acw[_0x35f1('0x17')][_0x35f1('0x3f')]=function(_0x1e4b6b){try{if(this['channels'][_0x1e4b6b[_0x35f1('0x40')]]){logger['info'](_0x35f1('0x41'),_0x1e4b6b[_0x35f1('0x40')]);this[_0x35f1('0x18')](_0x1e4b6b['origtransfereruniqueid']);}else if(this[_0x35f1('0x8')][_0x1e4b6b[_0x35f1('0x42')]]){logger[_0x35f1('0x21')](_0x35f1('0x43'),_0x1e4b6b[_0x35f1('0x42')]);this[_0x35f1('0x18')](_0x1e4b6b[_0x35f1('0x42')]);}logger[_0x35f1('0x21')]('[%s][ATTENDEDTRANSFER:TRANSFERTARGETUNIQUEID]',_0x1e4b6b[_0x35f1('0x44')]);this['channels'][_0x1e4b6b[_0x35f1('0x44')]]=_['find'](this[_0x35f1('0x8')],[_0x35f1('0x34'),util[_0x35f1('0x45')]('SIP/%s',_0x1e4b6b['localtwoconnectedlinename'])]);if(this['channels'][_0x1e4b6b['transfertargetuniqueid']]){this[_0x35f1('0x8')][_0x1e4b6b[_0x35f1('0x44')]][_0x35f1('0x38')]=!![];delete this[_0x35f1('0x8')][_[_0x35f1('0x46')](this[_0x35f1('0x8')],[_0x35f1('0x34'),util[_0x35f1('0x45')](_0x35f1('0x47'),_0x1e4b6b[_0x35f1('0x48')])])];}}catch(_0x3362ab){logger[_0x35f1('0x28')](_0x35f1('0x49'),_0x3362ab[_0x35f1('0x2d')]);}};Acw[_0x35f1('0x17')][_0x35f1('0x12')]=function(_0x234992){try{if(this['channels'][_0x234992[_0x35f1('0x4a')]]){logger[_0x35f1('0x21')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x35f1('0x32')](_0x234992[_0x35f1('0x4a')]));this['startAcw'](_0x234992[_0x35f1('0x4a')]);}else if(this[_0x35f1('0x8')][_0x234992[_0x35f1('0x4b')]]){logger[_0x35f1('0x21')](_0x35f1('0x4c'),JSON[_0x35f1('0x32')](_0x234992['transfererlinkedid']));this[_0x35f1('0x18')](_0x234992[_0x35f1('0x4b')]);}}catch(_0x9f8267){logger[_0x35f1('0x28')](_0x35f1('0x4d'),_0x9f8267[_0x35f1('0x2d')]);}};Acw[_0x35f1('0x17')]['syncAgentRingNoAnswer']=function(_0x37d1f0){try{if(this[_0x35f1('0x5')][_0x37d1f0[_0x35f1('0x19')]]&&this['voiceQueues'][_0x37d1f0['queue']][_0x35f1('0x4e')]==='all'){if(this['agents'][_0x37d1f0[_0x35f1('0x34')]]){logger[_0x35f1('0x21')](_0x35f1('0x4f'),_0x37d1f0['uniqueid'],_0x37d1f0[_0x35f1('0x34')],_0x37d1f0[_0x35f1('0x19')]);return RpcUser[_0x35f1('0x20')](this[_0x35f1('0x6')][_0x37d1f0[_0x35f1('0x34')]],_0x35f1('0x50'),_0x37d1f0[_0x35f1('0x2e')]);}}}catch(_0x15c112){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0x15c112[_0x35f1('0x2d')]);}};module[_0x35f1('0x51')]=Acw;
\ No newline at end of file
index a52fc7e..5c1a753 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','error','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','username','actionSipShowRegistry','info','action:','SipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','SipPeerStatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','once','close','connect','shutdown','resolve','then','catch','log','exports','asterisk-manager','bluebird','moment','lodash','../../config/logger','../../config/environment','asterisk','port','keepConnected','Action','action'];(function(_0x17feac,_0x2b88b5){var _0x5c064b=function(_0x2f4728){while(--_0x2f4728){_0x17feac['push'](_0x17feac['shift']());}};_0x5c064b(++_0x2b88b5);}(_0x7a54,0x106));var _0x47a5=function(_0x17bb50,_0x2149af){_0x17bb50=_0x17bb50-0x0;var _0xd60e50=_0x7a54[_0x17bb50];return _0xd60e50;};'use strict';var Manager=require(_0x47a5('0x0'));var BPromise=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var util=require('util');var _=require(_0x47a5('0x3'));var logger=require(_0x47a5('0x4'))('ami');var config=require(_0x47a5('0x5'));var ami=new Manager(config[_0x47a5('0x6')][_0x47a5('0x7')],config[_0x47a5('0x6')]['ip'],config[_0x47a5('0x6')]['username'],config[_0x47a5('0x6')]['password'],!![]);ami[_0x47a5('0x8')]();ami[_0x47a5('0x9')]=BPromise['promisify'](ami[_0x47a5('0xa')]);function error(_0x5077f3){logger['error'](util['format'](_0x47a5('0xb'),config[_0x47a5('0x6')]['username'],config[_0x47a5('0x6')]['ip'],config['asterisk']['port'],util[_0x47a5('0xc')](_0x5077f3,![],null)));}function close(){logger[_0x47a5('0xd')](util[_0x47a5('0xe')](_0x47a5('0xf'),config[_0x47a5('0x6')][_0x47a5('0x10')],config[_0x47a5('0x6')]['ip'],config['asterisk'][_0x47a5('0x7')]));}ami[_0x47a5('0x11')]=function(){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x47a5('0x14'));return function(){return ami[_0x47a5('0x9')]({'action':_0x47a5('0x15')});};};ami[_0x47a5('0x16')]=function(){logger['info'](_0x47a5('0x13'),_0x47a5('0x14'));return function(){return ami[_0x47a5('0x9')]({'action':_0x47a5('0x17')});};};ami[_0x47a5('0x18')]=function(){logger['info']('action:',_0x47a5('0x19'));return function(){return ami['Action']({'action':'sippeerstatus'});};};ami[_0x47a5('0x1a')]=function(){return function(){return ami[_0x47a5('0x9')]({'action':_0x47a5('0x1b')});};};ami[_0x47a5('0x1c')]=function(){return function(){return ami[_0x47a5('0x9')]({'action':_0x47a5('0x1d')});};};function connect(_0x2763d6){logger[_0x47a5('0x12')](util[_0x47a5('0xe')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x47a5('0x6')][_0x47a5('0x10')],config['asterisk']['ip'],config[_0x47a5('0x6')][_0x47a5('0x7')]));ami[_0x47a5('0x1e')]('error',error);ami[_0x47a5('0x1e')](_0x47a5('0x1f'),close);}ami['on'](_0x47a5('0x20'),connect);ami['on'](_0x47a5('0x21'),function(_0x5ef1b1){logger[_0x47a5('0x12')](util[_0x47a5('0xe')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x47a5('0x6')][_0x47a5('0x10')],config[_0x47a5('0x6')]['ip'],config[_0x47a5('0x6')][_0x47a5('0x7')],util['inspect'](_0x5ef1b1,![],null)));});ami['on']('fullybooted',function(_0x136745){logger['info'](util[_0x47a5('0xe')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x47a5('0x6')][_0x47a5('0x10')],config[_0x47a5('0x6')]['ip'],config[_0x47a5('0x6')][_0x47a5('0x7')]));return BPromise[_0x47a5('0x22')]()[_0x47a5('0x23')](ami[_0x47a5('0x11')]())[_0x47a5('0x23')](ami[_0x47a5('0x16')]())[_0x47a5('0x23')](ami[_0x47a5('0x18')]())[_0x47a5('0x23')](ami['actionQueueSummary']())[_0x47a5('0x23')](ami['actionCoreShowChannels']())[_0x47a5('0x24')](function(_0x9ac908){console[_0x47a5('0x25')](_0x9ac908);});});ami['once'](_0x47a5('0xd'),error);ami[_0x47a5('0x1e')](_0x47a5('0x1f'),close);module[_0x47a5('0x26')]=ami;
\ No newline at end of file
+var _0x9957=['password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','port','actionSipShowRegistry','SipShowRegistry','Action','sipshowregistry','actionDeviceStateList','info','action:','actionSipPeerStatus','SipPeerStatus','sippeerstatus','actionQueueSummary','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','catch','log','asterisk-manager','bluebird','moment','util','../../config/logger','ami','../../config/environment','asterisk','username'];(function(_0x440dbe,_0x7d7a36){var _0x2936d2=function(_0x36d5f0){while(--_0x36d5f0){_0x440dbe['push'](_0x440dbe['shift']());}};_0x2936d2(++_0x7d7a36);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var Manager=require(_0x7995('0x0'));var BPromise=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var _=require('lodash');var logger=require(_0x7995('0x4'))(_0x7995('0x5'));var config=require(_0x7995('0x6'));var ami=new Manager(config[_0x7995('0x7')]['port'],config[_0x7995('0x7')]['ip'],config[_0x7995('0x7')][_0x7995('0x8')],config[_0x7995('0x7')][_0x7995('0x9')],!![]);ami[_0x7995('0xa')]();ami['Action']=BPromise[_0x7995('0xb')](ami[_0x7995('0xc')]);function error(_0x4a64f7){logger[_0x7995('0xd')](util[_0x7995('0xe')](_0x7995('0xf'),config[_0x7995('0x7')][_0x7995('0x8')],config[_0x7995('0x7')]['ip'],config[_0x7995('0x7')]['port'],util[_0x7995('0x10')](_0x4a64f7,![],null)));}function close(){logger[_0x7995('0xd')](util['format'](_0x7995('0x11'),config[_0x7995('0x7')][_0x7995('0x8')],config[_0x7995('0x7')]['ip'],config[_0x7995('0x7')][_0x7995('0x12')]));}ami[_0x7995('0x13')]=function(){logger['info']('action:',_0x7995('0x14'));return function(){return ami[_0x7995('0x15')]({'action':_0x7995('0x16')});};};ami[_0x7995('0x17')]=function(){logger[_0x7995('0x18')](_0x7995('0x19'),_0x7995('0x14'));return function(){return ami[_0x7995('0x15')]({'action':'devicestatelist'});};};ami[_0x7995('0x1a')]=function(){logger['info'](_0x7995('0x19'),_0x7995('0x1b'));return function(){return ami[_0x7995('0x15')]({'action':_0x7995('0x1c')});};};ami[_0x7995('0x1d')]=function(){return function(){return ami[_0x7995('0x15')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x7995('0x15')]({'action':'coreshowchannels'});};};function connect(_0x555f74){logger[_0x7995('0x18')](util[_0x7995('0xe')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x7995('0x7')]['username'],config['asterisk']['ip'],config[_0x7995('0x7')][_0x7995('0x12')]));ami[_0x7995('0x1e')](_0x7995('0xd'),error);ami[_0x7995('0x1e')](_0x7995('0x1f'),close);}ami['on']('connect',connect);ami['on'](_0x7995('0x20'),function(_0x46ee4b){logger[_0x7995('0x18')](util[_0x7995('0xe')](_0x7995('0x21'),config[_0x7995('0x7')][_0x7995('0x8')],config[_0x7995('0x7')]['ip'],config['asterisk'][_0x7995('0x12')],util[_0x7995('0x10')](_0x46ee4b,![],null)));});ami['on'](_0x7995('0x22'),function(_0x268ce7){logger[_0x7995('0x18')](util[_0x7995('0xe')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x7995('0x7')]['username'],config[_0x7995('0x7')]['ip'],config[_0x7995('0x7')][_0x7995('0x12')]));return BPromise[_0x7995('0x23')]()[_0x7995('0x24')](ami['actionSipShowRegistry']())[_0x7995('0x24')](ami['actionDeviceStateList']())[_0x7995('0x24')](ami[_0x7995('0x1a')]())[_0x7995('0x24')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())[_0x7995('0x25')](function(_0xe6b0b3){console[_0x7995('0x26')](_0xe6b0b3);});});ami[_0x7995('0x1e')](_0x7995('0xd'),error);ami[_0x7995('0x1e')]('close',close);module['exports']=ami;
\ No newline at end of file
index d0b03a4..c8bd515 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b8e=['http','Request','then','rpc','memberReport','error','message','result','catch','exports','jayson/promise','ami','client'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x1b8e,0xc0));var _0xe1b8=function(_0x419edc,_0x4391ef){_0x419edc=_0x419edc-0x0;var _0x47b32c=_0x1b8e[_0x419edc];return _0x47b32c;};'use strict';var jayson=require(_0xe1b8('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0xe1b8('0x1'));var client=jayson[_0xe1b8('0x2')][_0xe1b8('0x3')]({'port':0x2329});client[_0xe1b8('0x4')]=function(_0x1bf8db,_0x43bb28){return new BPromise(function(_0x21bbe9,_0x3be393){return client['request'](_0x1bf8db,_0x43bb28)[_0xe1b8('0x5')](function(_0x22258e){logger['debug'](_0xe1b8('0x6'),_0xe1b8('0x7'),_0x1bf8db,_0x43bb28,_0x22258e);if(_0x22258e[_0xe1b8('0x8')]){logger[_0xe1b8('0x8')]('rpc','memberReport',_0x1bf8db,_0x22258e[_0xe1b8('0x8')]['message'],_0x43bb28);return _0x3be393(_0x22258e[_0xe1b8('0x8')][_0xe1b8('0x9')]);}else{return _0x21bbe9(_0x22258e[_0xe1b8('0xa')]);}})[_0xe1b8('0xb')](function(_0x9b2b78){logger[_0xe1b8('0x8')](_0xe1b8('0x6'),_0xe1b8('0x7'),_0x1bf8db,_0x9b2b78,_0x43bb28);return _0x3be393(_0x9b2b78);});});};module[_0xe1b8('0xc')]=client;
\ No newline at end of file
+var _0xde26=['ami','client','http','Request','request','then','debug','rpc','memberReport','error','result','catch','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x49b8ca,_0x41089d){var _0xc3071e=function(_0x25a878){while(--_0x25a878){_0x49b8ca['push'](_0x49b8ca['shift']());}};_0xc3071e(++_0x41089d);}(_0xde26,0x17d));var _0x6de2=function(_0x5cca9f,_0x154684){_0x5cca9f=_0x5cca9f-0x0;var _0x55edda=_0xde26[_0x5cca9f];return _0x55edda;};'use strict';var jayson=require(_0x6de2('0x0'));var BPromise=require(_0x6de2('0x1'));var logger=require(_0x6de2('0x2'))(_0x6de2('0x3'));var client=jayson[_0x6de2('0x4')][_0x6de2('0x5')]({'port':0x2329});client[_0x6de2('0x6')]=function(_0x388840,_0x185866){return new BPromise(function(_0x43df52,_0x858ec6){return client[_0x6de2('0x7')](_0x388840,_0x185866)[_0x6de2('0x8')](function(_0x4a707e){logger[_0x6de2('0x9')](_0x6de2('0xa'),_0x6de2('0xb'),_0x388840,_0x185866,_0x4a707e);if(_0x4a707e['error']){logger[_0x6de2('0xc')](_0x6de2('0xa'),_0x6de2('0xb'),_0x388840,_0x4a707e[_0x6de2('0xc')]['message'],_0x185866);return _0x858ec6(_0x4a707e[_0x6de2('0xc')]['message']);}else{return _0x43df52(_0x4a707e[_0x6de2('0xd')]);}})[_0x6de2('0xe')](function(_0x4339b3){logger[_0x6de2('0xc')]('rpc',_0x6de2('0xb'),_0x388840,_0x4339b3,_0x185866);return _0x858ec6(_0x4339b3);});});};module[_0x6de2('0xf')]=client;
\ No newline at end of file
index a923202..f9401d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fad=['getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','Contact','firstName','lastName','number','queue','name','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring'];(function(_0xc76521,_0x34b9c2){var _0xac4bba=function(_0x56f9db){while(--_0x56f9db){_0xc76521['push'](_0xc76521['shift']());}};_0xac4bba(++_0x34b9c2);}(_0x6fad,0x174));var _0xd6fa=function(_0x46f7fe,_0x40ecd3){_0x46f7fe=_0x46f7fe-0x0;var _0x276f00=_0x6fad[_0x46f7fe];return _0x276f00;};'use strict';var util=require(_0xd6fa('0x0'));var _=require(_0xd6fa('0x1'));var moment=require(_0xd6fa('0x2'));function checkNameSurname(_0x44c709,_0x4f8a1c,_0x2f5f9b){var _0x4ae415='';if(!_[_0xd6fa('0x3')](_0x4f8a1c)&&_0xd6fa('0x4')===typeof _0x4f8a1c){_0x4ae415+=_0x4f8a1c;}if(!_[_0xd6fa('0x3')](_0x2f5f9b)&&_0xd6fa('0x4')===typeof _0x2f5f9b){_0x4ae415+='\x20'+_0x2f5f9b;}if(_0x4ae415!==''){return _0x4ae415;}return _0x44c709;}function Action(_0x58325c,_0x45dad4,_0x329390){this[_0xd6fa('0x5')]=_0x58325c;this[_0xd6fa('0x6')]=_0x329390||undefined;this['name']=checkNameSurname(_0x45dad4[_0xd6fa('0x7')]['phone'],_0x45dad4[_0xd6fa('0x7')][_0xd6fa('0x8')],_0x45dad4[_0xd6fa('0x7')][_0xd6fa('0x9')]);this[_0xd6fa('0xa')]=_0x45dad4['Contact']['phone'];this[_0xd6fa('0xb')]=_0x58325c[_0xd6fa('0xc')];this[_0xd6fa('0xd')]=_0x45dad4[_0xd6fa('0xd')]||![];this[_0xd6fa('0xe')]=_0x58325c['type'];this['dialQueueTimeout']=_0x58325c[_0xd6fa('0xf')]||0x3;this['scheduledat']=_0x45dad4['scheduledat'];this[_0xd6fa('0x10')]=_0x45dad4[_0xd6fa('0x10')];this[_0xd6fa('0x11')]=_0x45dad4[_0xd6fa('0x11')];this[_0xd6fa('0x12')]=_0x45dad4[_0xd6fa('0x12')];this[_0xd6fa('0x13')]=_0x45dad4[_0xd6fa('0x13')];this[_0xd6fa('0x14')]=_0x45dad4['ListId'];this[_0xd6fa('0x15')]=_0x45dad4[_0xd6fa('0x15')];this[_0xd6fa('0x16')]=_0x45dad4[_0xd6fa('0x16')];this['CampaignId']=_0x45dad4['CampaignId'];this['idHopper']=_0x45dad4['id'];this['ContactFirstName']=_0x45dad4['Contact'][_0xd6fa('0x8')]||'';this['starttime']=moment()[_0xd6fa('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xd6fa('0x18')]=_0x45dad4[_0xd6fa('0x18')];this[_0xd6fa('0x19')]=_0x45dad4[_0xd6fa('0x19')];this[_0xd6fa('0x1a')]=_0x45dad4[_0xd6fa('0x1a')];this[_0xd6fa('0x1b')]=_0x45dad4[_0xd6fa('0x1b')];this[_0xd6fa('0x1c')]='';this[_0xd6fa('0x1d')]='';}Action[_0xd6fa('0x1e')][_0xd6fa('0x1f')]=function(){return util[_0xd6fa('0x17')](_0xd6fa('0x20'),this[_0xd6fa('0xc')],this[_0xd6fa('0x5')][_0xd6fa('0x21')]>0x0?this[_0xd6fa('0xa')][_0xd6fa('0x22')](this['voiceQueue']['dialCutDigit']):this[_0xd6fa('0xa')]);};Action[_0xd6fa('0x1e')][_0xd6fa('0x23')]=function(){return this[_0xd6fa('0xb')];};module[_0xd6fa('0x24')]=Action;
\ No newline at end of file
+var _0x8c25=['util','lodash','moment','isNil','name','Contact','firstName','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ListId','UserId','VoiceQueueId','CampaignId','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','getQueue'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x8c25,0x15e));var _0x58c2=function(_0x4f2370,_0xb27230){_0x4f2370=_0x4f2370-0x0;var _0x443acd=_0x8c25[_0x4f2370];return _0x443acd;};'use strict';var util=require(_0x58c2('0x0'));var _=require(_0x58c2('0x1'));var moment=require(_0x58c2('0x2'));function checkNameSurname(_0x163893,_0x30dc2c,_0x38dd7c){var _0x4e657d='';if(!_[_0x58c2('0x3')](_0x30dc2c)&&'string'===typeof _0x30dc2c){_0x4e657d+=_0x30dc2c;}if(!_['isNil'](_0x38dd7c)&&'string'===typeof _0x38dd7c){_0x4e657d+='\x20'+_0x38dd7c;}if(_0x4e657d!==''){return _0x4e657d;}return _0x163893;}function Action(_0x28c3fa,_0x5bd455,_0x105ba6){this['voiceQueue']=_0x28c3fa;this['uniqueid']=_0x105ba6||undefined;this[_0x58c2('0x4')]=checkNameSurname(_0x5bd455[_0x58c2('0x5')]['phone'],_0x5bd455[_0x58c2('0x5')][_0x58c2('0x6')],_0x5bd455[_0x58c2('0x5')][_0x58c2('0x7')]);this[_0x58c2('0x8')]=_0x5bd455[_0x58c2('0x5')][_0x58c2('0x9')];this[_0x58c2('0xa')]=_0x28c3fa['name'];this[_0x58c2('0xb')]=_0x5bd455[_0x58c2('0xb')]||![];this[_0x58c2('0xc')]=_0x28c3fa['type'];this[_0x58c2('0xd')]=_0x28c3fa[_0x58c2('0xd')]||0x3;this[_0x58c2('0xe')]=_0x5bd455[_0x58c2('0xe')];this[_0x58c2('0xf')]=_0x5bd455[_0x58c2('0xf')];this[_0x58c2('0x10')]=_0x5bd455[_0x58c2('0x10')];this[_0x58c2('0x11')]=_0x5bd455[_0x58c2('0x11')];this['ContactId']=_0x5bd455['ContactId'];this[_0x58c2('0x12')]=_0x5bd455[_0x58c2('0x12')];this[_0x58c2('0x13')]=_0x5bd455[_0x58c2('0x13')];this[_0x58c2('0x14')]=_0x5bd455['VoiceQueueId'];this[_0x58c2('0x15')]=_0x5bd455[_0x58c2('0x15')];this['idHopper']=_0x5bd455['id'];this['ContactFirstName']=_0x5bd455['Contact'][_0x58c2('0x6')]||'';this['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x5bd455[_0x58c2('0x16')];this[_0x58c2('0x17')]=_0x5bd455[_0x58c2('0x17')];this[_0x58c2('0x18')]=_0x5bd455[_0x58c2('0x18')];this[_0x58c2('0x19')]=_0x5bd455['recallme'];this[_0x58c2('0x1a')]='';this[_0x58c2('0x1b')]='';}Action[_0x58c2('0x1c')][_0x58c2('0x1d')]=function(){return util['format'](_0x58c2('0x1e'),this[_0x58c2('0x4')],this[_0x58c2('0x1f')][_0x58c2('0x20')]>0x0?this[_0x58c2('0x8')][_0x58c2('0x21')](this[_0x58c2('0x1f')][_0x58c2('0x20')]):this[_0x58c2('0x8')]);};Action[_0x58c2('0x1c')][_0x58c2('0x22')]=function(){return this['queue'];};module['exports']=Action;
\ No newline at end of file
index 730fd3a..45357e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca74=['milliseconds','diff','seconds','state','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname','name','starttime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','responsetime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment'];(function(_0x271489,_0x4a5d9d){var _0x392004=function(_0x1dcea3){while(--_0x1dcea3){_0x271489['push'](_0x271489['shift']());}};_0x392004(++_0x4a5d9d);}(_0xca74,0x1ae));var _0x4ca7=function(_0x355494,_0x592917){_0x355494=_0x355494-0x0;var _0x59d215=_0xca74[_0x355494];return _0x59d215;};'use strict';var util=require('util');var _=require(_0x4ca7('0x0'));var moment=require(_0x4ca7('0x1'));function getSeconds(_0x3ae324,_0x1fbf1d){var _0x5755a2=moment(_0x3ae324)[_0x4ca7('0x2')](0x0);var _0xef636f=moment(_0x1fbf1d)['milliseconds'](0x0);return _0x5755a2[_0x4ca7('0x3')](_0xef636f,_0x4ca7('0x4'));}function AgentComplete(_0x33d3ca,_0x2eae5c){this[_0x4ca7('0x5')]=0x4;this['statedesc']='Answer';this[_0x4ca7('0x6')]=_0x33d3ca['scheduledat'];this['type']=_0x33d3ca[_0x4ca7('0x7')];this[_0x4ca7('0x8')]=_0x33d3ca['type']===_0x4ca7('0x9')?_0x4ca7('0xa'):_0x33d3ca[_0x4ca7('0x7')];this[_0x4ca7('0xb')]=_0x33d3ca[_0x4ca7('0xb')];this[_0x4ca7('0xc')]=_0x33d3ca[_0x4ca7('0xc')];this[_0x4ca7('0xd')]=_0x33d3ca[_0x4ca7('0xd')];this['countglobal']=_0x33d3ca[_0x4ca7('0xb')]+_0x33d3ca[_0x4ca7('0xc')]+_0x33d3ca[_0x4ca7('0xd')];this[_0x4ca7('0xe')]=_0x2eae5c[_0x4ca7('0xe')];this[_0x4ca7('0xf')]=_0x33d3ca[_0x4ca7('0x10')];this['calleridnum']=_0x33d3ca['number'];this[_0x4ca7('0x11')]=_0x33d3ca[_0x4ca7('0x11')];this['responsetime']=_0x33d3ca['responsetime'];this[_0x4ca7('0x12')]=_0x33d3ca[_0x4ca7('0x12')];this[_0x4ca7('0x13')]=moment()[_0x4ca7('0x14')](_0x4ca7('0x15'));this['ringtime']=getSeconds(_0x33d3ca[_0x4ca7('0x16')],_0x33d3ca['starttime']);this[_0x4ca7('0x17')]=getSeconds(_0x33d3ca[_0x4ca7('0x12')],_0x33d3ca[_0x4ca7('0x16')]);this['talktime']=getSeconds(this[_0x4ca7('0x13')],_0x33d3ca[_0x4ca7('0x12')]);this['queue']=_0x2eae5c[_0x4ca7('0xa')];this[_0x4ca7('0x18')]=_0x2eae5c[_0x4ca7('0x18')];this[_0x4ca7('0x19')]=_0x2eae5c['reason'];this[_0x4ca7('0x1a')]=_0x33d3ca[_0x4ca7('0x1a')];this[_0x4ca7('0x1b')]=_0x33d3ca[_0x4ca7('0x1b')];this[_0x4ca7('0x1c')]=_0x33d3ca[_0x4ca7('0x1c')];this[_0x4ca7('0x1d')]=_0x33d3ca[_0x4ca7('0x1d')];this['ContactId']=_0x33d3ca['ContactId'];this['ListId']=_0x33d3ca[_0x4ca7('0x1e')];this[_0x4ca7('0x1f')]=_0x33d3ca[_0x4ca7('0x1f')];this['VoiceQueueId']=_0x33d3ca[_0x4ca7('0x20')];this[_0x4ca7('0x21')]=_0x33d3ca[_0x4ca7('0x21')];this[_0x4ca7('0x22')]=_0x33d3ca[_0x4ca7('0x22')]||'';this[_0x4ca7('0x23')]=_0x33d3ca[_0x4ca7('0x23')]||'';}module['exports']=AgentComplete;
\ No newline at end of file
+var _0x7ddc=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x3899cd,_0x5b858a){var _0x5e6665=function(_0x35a191){while(--_0x35a191){_0x3899cd['push'](_0x3899cd['shift']());}};_0x5e6665(++_0x5b858a);}(_0x7ddc,0x124));var _0xc7dd=function(_0x567534,_0x8f04b6){_0x567534=_0x567534-0x0;var _0x333e95=_0x7ddc[_0x567534];return _0x333e95;};'use strict';var util=require('util');var _=require(_0xc7dd('0x0'));var moment=require(_0xc7dd('0x1'));function getSeconds(_0x322828,_0x5097d2){var _0x2fae14=moment(_0x322828)['milliseconds'](0x0);var _0x5d08e8=moment(_0x5097d2)[_0xc7dd('0x2')](0x0);return _0x2fae14[_0xc7dd('0x3')](_0x5d08e8,'seconds');}function AgentComplete(_0x163bed,_0x418154){this[_0xc7dd('0x4')]=0x4;this[_0xc7dd('0x5')]=_0xc7dd('0x6');this[_0xc7dd('0x7')]=_0x163bed[_0xc7dd('0x7')];this[_0xc7dd('0x8')]=_0x163bed[_0xc7dd('0x8')];this[_0xc7dd('0x9')]=_0x163bed[_0xc7dd('0x8')]===_0xc7dd('0xa')?_0xc7dd('0xb'):_0x163bed[_0xc7dd('0x8')];this['countbusyretry']=_0x163bed['countbusyretry'];this[_0xc7dd('0xc')]=_0x163bed['countcongestionretry'];this[_0xc7dd('0xd')]=_0x163bed[_0xc7dd('0xd')];this['countglobal']=_0x163bed[_0xc7dd('0xe')]+_0x163bed['countcongestionretry']+_0x163bed[_0xc7dd('0xd')];this[_0xc7dd('0xf')]=_0x418154[_0xc7dd('0xf')];this['calleridname']=_0x163bed[_0xc7dd('0x10')];this[_0xc7dd('0x11')]=_0x163bed[_0xc7dd('0x12')];this[_0xc7dd('0x13')]=_0x163bed[_0xc7dd('0x13')];this[_0xc7dd('0x14')]=_0x163bed[_0xc7dd('0x14')];this[_0xc7dd('0x15')]=_0x163bed[_0xc7dd('0x15')];this[_0xc7dd('0x16')]=moment()[_0xc7dd('0x17')](_0xc7dd('0x18'));this[_0xc7dd('0x19')]=getSeconds(_0x163bed[_0xc7dd('0x14')],_0x163bed[_0xc7dd('0x13')]);this[_0xc7dd('0x1a')]=getSeconds(_0x163bed[_0xc7dd('0x15')],_0x163bed[_0xc7dd('0x14')]);this[_0xc7dd('0x1b')]=getSeconds(this[_0xc7dd('0x16')],_0x163bed[_0xc7dd('0x15')]);this[_0xc7dd('0xb')]=_0x418154[_0xc7dd('0xb')];this['membername']=_0x418154[_0xc7dd('0x1c')];this[_0xc7dd('0x1d')]=_0x418154['reason'];this[_0xc7dd('0x1e')]=_0x163bed['callback'];this['callbackuniqueid']=_0x163bed[_0xc7dd('0x1f')];this[_0xc7dd('0x20')]=_0x163bed[_0xc7dd('0x20')];this[_0xc7dd('0x21')]=_0x163bed[_0xc7dd('0x21')];this[_0xc7dd('0x22')]=_0x163bed[_0xc7dd('0x22')];this[_0xc7dd('0x23')]=_0x163bed[_0xc7dd('0x23')];this['UserId']=_0x163bed[_0xc7dd('0x24')];this[_0xc7dd('0x25')]=_0x163bed[_0xc7dd('0x25')];this[_0xc7dd('0x26')]=_0x163bed[_0xc7dd('0x26')];this['originatecalleridnum']=_0x163bed[_0xc7dd('0x27')]||'';this['originatecalleridname']=_0x163bed[_0xc7dd('0x28')]||'';}module['exports']=AgentComplete;
\ No newline at end of file
index 1671a39..4704514 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ac9=['holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','queue','calleridname','calleridnum','starttime','endtime','responsetime'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x8ac9,0x199));var _0x98ac=function(_0xd655a9,_0x3aeebd){_0xd655a9=_0xd655a9-0x0;var _0x56c9c0=_0x8ac9[_0xd655a9];return _0x56c9c0;};'use strict';var util=require(_0x98ac('0x0'));var _=require(_0x98ac('0x1'));var moment=require(_0x98ac('0x2'));function getSeconds(_0x549f3f,_0x48dbda){var _0x4496e8=moment(_0x549f3f)[_0x98ac('0x3')](0x0);var _0xd555bb=moment(_0x48dbda)['milliseconds'](0x0);return _0x4496e8['diff'](_0xd555bb,_0x98ac('0x4'));}function Final(_0x291d4b){this[_0x98ac('0x5')]=_0x291d4b['uniqueid'];this['scheduledat']=_0x291d4b[_0x98ac('0x6')];this[_0x98ac('0x7')]=_0x291d4b[_0x98ac('0x7')];this[_0x98ac('0x8')]=_0x291d4b[_0x98ac('0x7')]===_0x98ac('0x9')?'queue':_0x291d4b[_0x98ac('0x7')];this['countbusyretry']=_0x291d4b[_0x98ac('0xa')];this[_0x98ac('0xb')]=_0x291d4b[_0x98ac('0xb')];this[_0x98ac('0xc')]=_0x291d4b[_0x98ac('0xc')];this[_0x98ac('0xd')]=_0x291d4b[_0x98ac('0xa')]+_0x291d4b['countcongestionretry']+_0x291d4b['countnoanswerretry'];this[_0x98ac('0xe')]=_0x291d4b[_0x98ac('0xe')];this[_0x98ac('0xf')]=_0x291d4b[_0x98ac('0xf')];this['calleridnum']=_0x291d4b[_0x98ac('0x10')];this[_0x98ac('0x11')]=_0x291d4b[_0x98ac('0x11')];this['responsetime']=_0x291d4b['responsetime'];this[_0x98ac('0x12')]=_0x291d4b[_0x98ac('0x13')];this['ringtime']=_0x291d4b['ringtime']||0x0;this['holdtime']=_0x291d4b[_0x98ac('0x14')]||0x0;this[_0x98ac('0x15')]=_0x291d4b['talktime']||0x0;this[_0x98ac('0x16')]=_0x291d4b[_0x98ac('0x16')];this[_0x98ac('0x17')]=_0x291d4b['callbackuniqueid'];this[_0x98ac('0x18')]=_0x291d4b[_0x98ac('0x18')];this[_0x98ac('0x19')]=_0x291d4b['recallme'];this[_0x98ac('0x1a')]=_0x291d4b[_0x98ac('0x1a')];this[_0x98ac('0x1b')]=_0x291d4b[_0x98ac('0x1b')];this['UserId']=_0x291d4b['UserId'];this[_0x98ac('0x1c')]=_0x291d4b[_0x98ac('0x1c')];this[_0x98ac('0x1d')]=_0x291d4b[_0x98ac('0x1d')];this[_0x98ac('0x1e')]=_0x291d4b[_0x98ac('0x1e')]||'';this[_0x98ac('0x1f')]=_0x291d4b[_0x98ac('0x1f')]||'';}module[_0x98ac('0x20')]=Final;
\ No newline at end of file
+var _0x539d=['responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','calleridname','calleridnum','starttime'];(function(_0x4f7efe,_0x17a5a3){var _0x475d54=function(_0x48b74f){while(--_0x48b74f){_0x4f7efe['push'](_0x4f7efe['shift']());}};_0x475d54(++_0x17a5a3);}(_0x539d,0x17b));var _0xd539=function(_0x4e7551,_0x398ee5){_0x4e7551=_0x4e7551-0x0;var _0x2c2ae8=_0x539d[_0x4e7551];return _0x2c2ae8;};'use strict';var util=require(_0xd539('0x0'));var _=require('lodash');var moment=require(_0xd539('0x1'));function getSeconds(_0x1c859a,_0x4f0303){var _0x58f7bd=moment(_0x1c859a)[_0xd539('0x2')](0x0);var _0x2a38d5=moment(_0x4f0303)[_0xd539('0x2')](0x0);return _0x58f7bd[_0xd539('0x3')](_0x2a38d5,_0xd539('0x4'));}function Final(_0x4c9697){this[_0xd539('0x5')]=_0x4c9697[_0xd539('0x5')];this[_0xd539('0x6')]=_0x4c9697[_0xd539('0x6')];this[_0xd539('0x7')]=_0x4c9697[_0xd539('0x7')];this['campaigntype']=_0x4c9697[_0xd539('0x7')]===_0xd539('0x8')?_0xd539('0x9'):_0x4c9697[_0xd539('0x7')];this['countbusyretry']=_0x4c9697['countbusyretry'];this[_0xd539('0xa')]=_0x4c9697[_0xd539('0xa')];this[_0xd539('0xb')]=_0x4c9697[_0xd539('0xb')];this[_0xd539('0xc')]=_0x4c9697[_0xd539('0xd')]+_0x4c9697[_0xd539('0xa')]+_0x4c9697[_0xd539('0xb')];this['queue']=_0x4c9697[_0xd539('0x9')];this[_0xd539('0xe')]=_0x4c9697[_0xd539('0xe')];this[_0xd539('0xf')]=_0x4c9697[_0xd539('0xf')];this[_0xd539('0x10')]=_0x4c9697['starttime'];this[_0xd539('0x11')]=_0x4c9697[_0xd539('0x11')];this[_0xd539('0x12')]=_0x4c9697[_0xd539('0x11')];this[_0xd539('0x13')]=_0x4c9697[_0xd539('0x13')]||0x0;this[_0xd539('0x14')]=_0x4c9697[_0xd539('0x14')]||0x0;this[_0xd539('0x15')]=_0x4c9697[_0xd539('0x15')]||0x0;this[_0xd539('0x16')]=_0x4c9697['callback'];this[_0xd539('0x17')]=_0x4c9697[_0xd539('0x17')];this[_0xd539('0x18')]=_0x4c9697[_0xd539('0x18')];this[_0xd539('0x19')]=_0x4c9697[_0xd539('0x19')];this[_0xd539('0x1a')]=_0x4c9697[_0xd539('0x1a')];this['ListId']=_0x4c9697['ListId'];this[_0xd539('0x1b')]=_0x4c9697[_0xd539('0x1b')];this[_0xd539('0x1c')]=_0x4c9697[_0xd539('0x1c')];this['CampaignId']=_0x4c9697[_0xd539('0x1d')];this[_0xd539('0x1e')]=_0x4c9697[_0xd539('0x1e')]||'';this[_0xd539('0x1f')]=_0x4c9697[_0xd539('0x1f')]||'';}module[_0xd539('0x20')]=Final;
\ No newline at end of file
index 805f051..3126b45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0x38550,_0x1e36a6){var _0x556e2c=function(_0x20777a){while(--_0x20777a){_0x38550['push'](_0x38550['shift']());}};_0x556e2c(++_0x1e36a6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup;
\ No newline at end of file
+var _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0x32be62,_0x22e6fd){var _0x1a37e9=function(_0x35a9c1){while(--_0x35a9c1){_0x32be62['push'](_0x32be62['shift']());}};_0x1a37e9(++_0x22e6fd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup;
\ No newline at end of file
index 6e18e5e..f1d0f07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2137=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','seconds','uniqueid','scheduledat','type','outbound','countcongestionretry','countnoanswerretry','countglobal','queue','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','recallme','ContactId','ListId'];(function(_0xb345cb,_0x371313){var _0x7cb9bc=function(_0x44401a){while(--_0x44401a){_0xb345cb['push'](_0xb345cb['shift']());}};_0x7cb9bc(++_0x371313);}(_0x2137,0x1aa));var _0x7213=function(_0x331536,_0x1db37e){_0x331536=_0x331536-0x0;var _0x23d19d=_0x2137[_0x331536];return _0x23d19d;};'use strict';var util=require(_0x7213('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x117f3f,_0x255214){var _0x47fd3e=moment(_0x117f3f)['milliseconds'](0x0);var _0x116469=moment(_0x255214)[_0x7213('0x1')](0x0);return _0x47fd3e['diff'](_0x116469,_0x7213('0x2'));}function History(_0xb7fec2){this[_0x7213('0x3')]=_0xb7fec2[_0x7213('0x3')];this[_0x7213('0x4')]=_0xb7fec2['scheduledat']||undefined;this['type']=_0xb7fec2[_0x7213('0x5')];this['campaigntype']=_0xb7fec2[_0x7213('0x5')]===_0x7213('0x6')?'queue':_0xb7fec2[_0x7213('0x5')];this['countbusyretry']=_0xb7fec2['countbusyretry'];this[_0x7213('0x7')]=_0xb7fec2['countcongestionretry'];this[_0x7213('0x8')]=_0xb7fec2[_0x7213('0x8')];this[_0x7213('0x9')]=_0xb7fec2['countbusyretry']+_0xb7fec2[_0x7213('0x7')]+_0xb7fec2[_0x7213('0x8')];this[_0x7213('0xa')]=_0xb7fec2[_0x7213('0xa')];this['calleridname']=_0xb7fec2[_0x7213('0xb')];this[_0x7213('0xc')]=_0xb7fec2[_0x7213('0xd')];this[_0x7213('0xe')]=_0xb7fec2['starttime'];this[_0x7213('0xf')]=_0xb7fec2['responsetime'];this[_0x7213('0x10')]=_0xb7fec2[_0x7213('0xf')];this[_0x7213('0x11')]=getSeconds(_0xb7fec2['responsetime'],_0xb7fec2[_0x7213('0xe')]);this[_0x7213('0x12')]=0x0;this['talktime']=0x0;this[_0x7213('0x13')]=_0xb7fec2['callback'];this[_0x7213('0x14')]=_0xb7fec2[_0x7213('0x14')];this['callbackat']=_0xb7fec2['callbackat'];this[_0x7213('0x15')]=_0xb7fec2[_0x7213('0x15')];this[_0x7213('0x16')]=_0xb7fec2[_0x7213('0x16')];this[_0x7213('0x17')]=_0xb7fec2[_0x7213('0x17')];this[_0x7213('0x18')]=_0xb7fec2['UserId'];this[_0x7213('0x19')]=_0xb7fec2[_0x7213('0x19')];this[_0x7213('0x1a')]=_0xb7fec2['CampaignId'];this[_0x7213('0x1b')]=_0xb7fec2[_0x7213('0x1b')]||'';this[_0x7213('0x1c')]=_0xb7fec2[_0x7213('0x1c')]||'';}module[_0x7213('0x1d')]=History;
\ No newline at end of file
+var _0xc9a2=['exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countnoanswerretry','queue','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xc9a2,0xa6));var _0x2c9a=function(_0x43e7d6,_0x3ed017){_0x43e7d6=_0x43e7d6-0x0;var _0x2073d3=_0xc9a2[_0x43e7d6];return _0x2073d3;};'use strict';var util=require(_0x2c9a('0x0'));var _=require(_0x2c9a('0x1'));var moment=require(_0x2c9a('0x2'));function getSeconds(_0x3ccb23,_0xc8e08c){var _0x11a65b=moment(_0x3ccb23)[_0x2c9a('0x3')](0x0);var _0x130c3a=moment(_0xc8e08c)['milliseconds'](0x0);return _0x11a65b['diff'](_0x130c3a,_0x2c9a('0x4'));}function History(_0xb96e95){this['uniqueid']=_0xb96e95[_0x2c9a('0x5')];this[_0x2c9a('0x6')]=_0xb96e95[_0x2c9a('0x6')]||undefined;this[_0x2c9a('0x7')]=_0xb96e95[_0x2c9a('0x7')];this[_0x2c9a('0x8')]=_0xb96e95['type']===_0x2c9a('0x9')?'queue':_0xb96e95['type'];this[_0x2c9a('0xa')]=_0xb96e95[_0x2c9a('0xa')];this['countcongestionretry']=_0xb96e95['countcongestionretry'];this['countnoanswerretry']=_0xb96e95[_0x2c9a('0xb')];this['countglobal']=_0xb96e95[_0x2c9a('0xa')]+_0xb96e95['countcongestionretry']+_0xb96e95[_0x2c9a('0xb')];this[_0x2c9a('0xc')]=_0xb96e95[_0x2c9a('0xc')];this['calleridname']=_0xb96e95['name'];this[_0x2c9a('0xd')]=_0xb96e95[_0x2c9a('0xe')];this[_0x2c9a('0xf')]=_0xb96e95[_0x2c9a('0xf')];this[_0x2c9a('0x10')]=_0xb96e95[_0x2c9a('0x10')];this[_0x2c9a('0x11')]=_0xb96e95['responsetime'];this[_0x2c9a('0x12')]=getSeconds(_0xb96e95[_0x2c9a('0x10')],_0xb96e95[_0x2c9a('0xf')]);this[_0x2c9a('0x13')]=0x0;this[_0x2c9a('0x14')]=0x0;this[_0x2c9a('0x15')]=_0xb96e95[_0x2c9a('0x15')];this[_0x2c9a('0x16')]=_0xb96e95[_0x2c9a('0x16')];this['callbackat']=_0xb96e95[_0x2c9a('0x17')];this[_0x2c9a('0x18')]=_0xb96e95[_0x2c9a('0x18')];this[_0x2c9a('0x19')]=_0xb96e95[_0x2c9a('0x19')];this[_0x2c9a('0x1a')]=_0xb96e95[_0x2c9a('0x1a')];this[_0x2c9a('0x1b')]=_0xb96e95['UserId'];this['VoiceQueueId']=_0xb96e95[_0x2c9a('0x1c')];this[_0x2c9a('0x1d')]=_0xb96e95[_0x2c9a('0x1d')];this['originatecalleridnum']=_0xb96e95[_0x2c9a('0x1e')]||'';this[_0x2c9a('0x1f')]=_0xb96e95[_0x2c9a('0x1f')]||'';}module[_0x2c9a('0x20')]=History;
\ No newline at end of file
index dc86b73..7aa0f3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93bc=['updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact]','Success','active','SIP/%s','reachable','unmonitored','uniqueId','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','[syncMachine][createHistory]','[syncHangupInAMDIvr][createHistory]','amd','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','dialQueueProject','cause-txt','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','YYYY-MM-DD\x20HH:mm:ss','droptime','responsetime','dialQueueTimeout','Drop','dropreason','queueCallerAbandonCreateState','Abandoned','CALLEREXIT','actionid','paused','agents','stateinterface','locked','queueBooked','push','idHopper','queueStatusComplete','syncQueueStatusComplete','run','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','finally','Agent:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','launchHandleIvr','\x5cw{0,','pow','replace','random','match','object','originate','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','XMD-AMDINITIALSILENCE','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','dialCutDigit','substring','SIP/%s/%s%s','trim','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','countcongestionretry','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[moveContactManagedDialer][0]','contact\x20not\x20moved','predictive','dialPredictiveOptimizationPercentage','predictiveIntervalLowerLimit','floor','erlangCalls','erlangAbandonmentRate','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive][First]','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Date]','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','agent\x20max\x20free\x20','dropRate','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','[averageHandleTime][ErlangB]\x20','[startMethodPredictive][StartPredictive][Repeat]','dialPredictiveOptimization','outboundQueuePauses','abandonmentRate','[CatchErlangB]','busyFactor','check\x20failure','erlangCallToSecond','[startMethodPredictive]','[handlePredictive]','Failure\x20','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','dialLimitQueue','ACTIVE','tryOriginatePredictive','not_inuse','[getContactDialerPredictive]','[abandonmentRate]','\x20m\x20=\x20','\x20interval\x20=\x20','\x20Ts\x20=\x20','\x20p\x20=\x20','\x20Amax\x20=\x20','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','[busyFactor]','\x20Umin\x20=\x20','exports','lodash','uuid','moment','md5','../../../config/logger','booked','predictiveCalls','../../../config/environment/','socket.io-emitter','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','sequence','voiceQueues','campaigns','trunks','maxNumberOriginate','channels','actions','contactsId','startProgressive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','INTERVAL_IS_NULL','Interval','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','talking','total','type','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','originated','Trunk','callerid','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','predictiveIntervalTotalCalls','info','[checkGetDataPredictive][avgTalktime]','predictiveIntervalAvgHoldtime','[checkGetDataPredictive][avgHoldtime]','[checkGetDataPredictive][totalCalls]','[checkGetDataPredictive][objIsEmpty]','merge','[freeVariablesPredictive]','startPredictive','handlePredictive','outbound','preview','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','inspect','error','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','isNil','Action','status','channel','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x93bc,0x134));var _0xc93b=function(_0x1c2deb,_0x47a2a9){_0x1c2deb=_0x1c2deb-0x0;var _0x336693=_0x93bc[_0x1c2deb];return _0x336693;};'use strict';var util=require('util');var _=require(_0xc93b('0x0'));var BPromise=require('bluebird');var uuid=require(_0xc93b('0x1'));var moment=require(_0xc93b('0x2'));var rr=require('rr');var md5=require(_0xc93b('0x3'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require(_0xc93b('0x4'))(_0xc93b('0x5'));var loggerPredictive=require(_0xc93b('0x4'))('predictive');var loggerPredictiveCalls=require(_0xc93b('0x4'))(_0xc93b('0x6'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var config=require(_0xc93b('0x7'));var ami=require('../ami');var io=require(_0xc93b('0x8'))({'host':_0xc93b('0x9'),'port':0x18eb});var cmHopper=require(_0xc93b('0xa'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xc93b('0xb'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xc93b('0xc'));var Action=require(_0xc93b('0xd'));var History=require('./history');var Final=require('./final');var AgentComplete=require(_0xc93b('0xe'));var QueueCallerAbandon=require(_0xc93b('0xf'));var Hangup=require(_0xc93b('0x10'));var ipAgi=process[_0xc93b('0x11')][_0xc93b('0x12')]||_0xc93b('0x13');var strategy={'rrmemory':_0xc93b('0x14'),'roundrobin':_0xc93b('0x15')};var Sequence=function(){};Sequence[_0xc93b('0x16')][_0xc93b('0x17')]=function(_0x372a6e){this[_0xc93b('0x18')]=this[_0xc93b('0x18')]?this['tail']['finally'](_0x372a6e):_0x372a6e();};function Dialer(_0x109748,_0x5da94a){this[_0xc93b('0x19')]=new Sequence();this['preview']=_0x5da94a;this[_0xc93b('0x1a')]=_0x109748[_0xc93b('0x1a')];this['campaigns']=_0x109748[_0xc93b('0x1b')];this['agents']=_0x109748['agents'];this[_0xc93b('0x1c')]=_0x109748[_0xc93b('0x1c')];this[_0xc93b('0x1d')]=config[_0xc93b('0x1d')]||0x2;this[_0xc93b('0x1e')]={};this[_0xc93b('0x1f')]={};this[_0xc93b('0x20')]={};this['uniqueId']={};this['optionPredictive']={};this['startPredictive']={};this[_0xc93b('0x21')]={};this[_0xc93b('0x22')]={};this['queueBooked']={};this[_0xc93b('0x23')]={};ami['on'](_0xc93b('0x24'),this[_0xc93b('0x25')]['bind'](this));ami['on'](_0xc93b('0x26'),this[_0xc93b('0x27')][_0xc93b('0x28')](this));ami['on'](_0xc93b('0x29'),this['syncOriginateResponse'][_0xc93b('0x28')](this));ami['on']('agentcomplete',this[_0xc93b('0x2a')]['bind'](this));ami['on'](_0xc93b('0x2b'),this[_0xc93b('0x2c')][_0xc93b('0x28')](this));ami['on'](_0xc93b('0x2d'),this[_0xc93b('0x2e')]['bind'](this));ami['on'](_0xc93b('0x2f'),this[_0xc93b('0x30')][_0xc93b('0x28')](this));ami['on'](_0xc93b('0x31'),this[_0xc93b('0x32')][_0xc93b('0x28')](this));ami['on'](_0xc93b('0x33'),this[_0xc93b('0x34')]['bind'](this));ami['on'](_0xc93b('0x35'),this['syncQueueStatusComplete'][_0xc93b('0x28')](this));this[_0xc93b('0x36')]();this[_0xc93b('0x37')]();}function isNotNull(_0x565f51){return _0x565f51!==null&&!_[_0xc93b('0x38')](_0x565f51);}function checkIsLoggedIn(_0x1f6deb,_0x3d7c2d){return function(){if(_0x3d7c2d<=0x0){_0x1f6deb[_0xc93b('0x39')]='AGENTS_NOT_LOGGED';throw _0x1f6deb['name']+_0xc93b('0x3a');}};}function isActive(_0x14c97b){return _0x14c97b;}function checkIsActive(_0x36624b,_0x1f4f57){return function(){if(!isActive(_0x1f4f57)){_0x36624b[_0xc93b('0x39')]=_0xc93b('0x3b');throw _0x36624b[_0xc93b('0x3c')]+'\x20NOT\x20Active';}};}function checkInterval(_0x56259d){return function(){if(!isNotNull(_0x56259d['Interval'])){_0x56259d[_0xc93b('0x39')]=_0xc93b('0x3d');throw _0x56259d[_0xc93b('0x3c')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x56259d[_0xc93b('0x3e')][_0xc93b('0x3f')])){_0x56259d[_0xc93b('0x39')]=_0xc93b('0x3d');throw _0x56259d['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xc93b('0x40')](_0x56259d['Interval'][_0xc93b('0x3f')]))){_0x56259d[_0xc93b('0x39')]=_0xc93b('0x3d');throw _0x56259d[_0xc93b('0x3c')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x589b4f,_0x2a6677,_0x62af34){return{'action':_0x589b4f,'response':_0x2a6677,'message':_0x62af34};}function myreject(_0xe2ef1f){return function(_0x548191){return _0xe2ef1f(msgResponse(_0xc93b('0x41'),_0xc93b('0x42'),JSON[_0xc93b('0x43')](_0x548191)));};}function getSeconds(_0x4d3982,_0x2e4050){var _0x4c4008=moment(_0x4d3982)[_0xc93b('0x44')](0x0);var _0x43e46f=moment(_0x2e4050)['milliseconds'](0x0);return _0x4c4008[_0xc93b('0x45')](_0x43e46f,'seconds');}function emit(_0x4af244,_0x20e3de,_0x2ef514){io['to'](_0x4af244)[_0xc93b('0x46')](_0x20e3de,_0x2ef514);}function emitVoiceQueueSummary(_0x84aa2e){if(_0x84aa2e['type']==='outbound'){var _0xc0644d={'id':_0x84aa2e['id'],'name':_0x84aa2e[_0xc93b('0x3c')],'strategy':_0x84aa2e[_0xc93b('0x47')],'answered':_0x84aa2e[_0xc93b('0x48')],'available':_0x84aa2e[_0xc93b('0x49')],'loggedIn':_0x84aa2e[_0xc93b('0x4a')],'pTalking':_0x84aa2e['pTalking'],'sumBillable':_0x84aa2e[_0xc93b('0x4b')],'sumDuration':_0x84aa2e['sumDuration'],'sumHoldTime':_0x84aa2e[_0xc93b('0x4c')]||0x0,'talking':_0x84aa2e[_0xc93b('0x4d')],'total':_0x84aa2e[_0xc93b('0x4e')],'type':_0x84aa2e[_0xc93b('0x4f')],'unmanaged':_0x84aa2e['unmanaged'],'waiting':_0x84aa2e[_0xc93b('0x50')],'loggedInDb':_0x84aa2e[_0xc93b('0x51')],'dialActive':_0x84aa2e[_0xc93b('0x52')],'dialMethod':_0x84aa2e[_0xc93b('0x53')],'dialOriginateCallerIdName':_0x84aa2e[_0xc93b('0x54')],'dialOriginateCallerIdNumber':_0x84aa2e['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x84aa2e[_0xc93b('0x55')],'dialPrefix':_0x84aa2e[_0xc93b('0x56')],'outboundAnswerAgiCallsDay':_0x84aa2e[_0xc93b('0x57')],'outboundAnswerCallsDay':_0x84aa2e[_0xc93b('0x58')],'outboundBlacklistCallsDay':_0x84aa2e[_0xc93b('0x59')],'outboundBusyCallsDay':_0x84aa2e[_0xc93b('0x5a')],'outboundCongestionCallsDay':_0x84aa2e[_0xc93b('0x5b')],'outboundDropCallsDayACS':_0x84aa2e[_0xc93b('0x5c')],'outboundDropCallsDayCallersExit':_0x84aa2e[_0xc93b('0x5d')],'outboundDropCallsDayTimeout':_0x84aa2e[_0xc93b('0x5e')],'outboundNoAnswerCallsDay':_0x84aa2e[_0xc93b('0x5f')],'outboundNoSuchCallsDay':_0x84aa2e[_0xc93b('0x60')],'outboundOriginateFailureCallsDay':_0x84aa2e[_0xc93b('0x61')],'outboundReCallsDay':_0x84aa2e[_0xc93b('0x62')],'outboundRejectCallsDay':_0x84aa2e[_0xc93b('0x63')],'outboundUnknownCallsDay':_0x84aa2e[_0xc93b('0x64')],'predictiveIntervalAnsweredCalls':_0x84aa2e[_0xc93b('0x65')],'predictiveIntervalAvgHoldtime':_0x84aa2e['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x84aa2e[_0xc93b('0x66')],'predictiveIntervalDroppedCallsCallersExit':_0x84aa2e[_0xc93b('0x67')],'predictiveIntervalDroppedCallsTimeout':_0x84aa2e[_0xc93b('0x68')],'predictiveIntervalErlangCalls':_0x84aa2e[_0xc93b('0x69')],'predictiveIntervalErlangCallsDroppedCalls':_0x84aa2e[_0xc93b('0x6a')],'predictiveIntervalHitRate':_0x84aa2e['predictiveIntervalHitRate'],'predictiveIntervalLowerLimit':_0x84aa2e['predictiveIntervalLowerLimit'],'predictiveIntervalMultiplicativeFactor':_0x84aa2e[_0xc93b('0x6b')],'predictiveIntervalPauses':_0x84aa2e[_0xc93b('0x6c')],'predictiveIntervalTotalCalls':_0x84aa2e['predictiveIntervalTotalCalls'],'message':_0x84aa2e['message'],'originated':_0x84aa2e[_0xc93b('0x6d')]};if(_0x84aa2e[_0xc93b('0x6e')]){_0xc0644d['Trunk']={'id':_0x84aa2e[_0xc93b('0x6e')]['id'],'name':_0x84aa2e['Trunk'][_0xc93b('0x3c')],'active':_0x84aa2e['Trunk']['active'],'callerid':_0x84aa2e[_0xc93b('0x6e')][_0xc93b('0x6f')]};}if(_0x84aa2e[_0xc93b('0x3e')]){_0xc0644d[_0xc93b('0x3e')]={'id':_0x84aa2e[_0xc93b('0x3e')]['id'],'name':_0x84aa2e['Interval'][_0xc93b('0x3c')]};}var _0x2f134f=md5(JSON[_0xc93b('0x43')](_0xc0644d));if(_0x84aa2e[_0xc93b('0x3')]!==_0x2f134f){_0x84aa2e[_0xc93b('0x3')]=_0x2f134f;emit(util['format'](_0xc93b('0x70'),_0xc0644d[_0xc93b('0x3c')]),_0xc93b('0x71'),_0xc0644d);}}}function emitCampaignSummary(_0x2c84d3){if(_0x2c84d3[_0xc93b('0x4f')]===_0xc93b('0x72')){emit(util['format'](_0xc93b('0x73'),_0x2c84d3['name']),_0xc93b('0x74'),_0x2c84d3);}}function checkGetDataPredictive(_0x3fc8d1){if(isNotNull(_0x3fc8d1)){if(!_[_0xc93b('0x40')](_0x3fc8d1)){if(_0x3fc8d1[_0xc93b('0x75')]>0x0){if(!_['isUndefined'](_0x3fc8d1[_0xc93b('0x66')])&&_0x3fc8d1[_0xc93b('0x66')]>0x0){return!![];}else{loggerPredictive[_0xc93b('0x76')](_0xc93b('0x77'),JSON['stringify'](_0x3fc8d1));}if(!_[_0xc93b('0x38')](_0x3fc8d1[_0xc93b('0x78')])&&_0x3fc8d1[_0xc93b('0x78')]>0x0){return!![];}else{loggerPredictive['info'](_0xc93b('0x79'),JSON[_0xc93b('0x43')](_0x3fc8d1));}}else{loggerPredictive[_0xc93b('0x76')](_0xc93b('0x7a'),JSON['stringify'](_0x3fc8d1));}}else{loggerPredictive[_0xc93b('0x76')](_0xc93b('0x7b'),JSON[_0xc93b('0x43')](_0x3fc8d1));}}else{loggerPredictive[_0xc93b('0x76')]('[checkGetDataPredictive][obj]',JSON[_0xc93b('0x43')](_0x3fc8d1));}return![];}function mergeDataErlangB(_0x5a5512){return function(_0x27581d){loggerPredictive[_0xc93b('0x76')]('[ErlangB]',JSON['stringify'](_0x27581d));_[_0xc93b('0x7c')](_0x5a5512,_0x27581d);};}function getDiff(_0x291a1a){var _0x4259e3=moment()[_0xc93b('0x44')](0x0);var _0x11d75a=moment(_0x291a1a)[_0xc93b('0x44')](0x0);return _0x4259e3[_0xc93b('0x45')](_0x11d75a,'seconds');}function ifInterval(_0x1c8c51,_0x3c64ef){if(_[_0xc93b('0x38')](_0x3c64ef)){return![];}if(getDiff(_0x3c64ef)<_0x1c8c51*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x5625aa){if(isNotNull(_0x5625aa)){if(!_[_0xc93b('0x38')](_0x5625aa['startProgressive'])){_0x5625aa[_0xc93b('0x21')]=undefined;loggerPredictive['info'](_0xc93b('0x7d'),_0xc93b('0x21'),_0x5625aa[_0xc93b('0x3c')]);}if(!_[_0xc93b('0x38')](_0x5625aa['startPredictive'])){_0x5625aa[_0xc93b('0x7e')]=undefined;loggerPredictive[_0xc93b('0x76')](_0xc93b('0x7d'),_0xc93b('0x7e'),_0x5625aa['name']);}if(!_['isUndefined'](_0x5625aa['handlePredictive'])){clearInterval(_0x5625aa[_0xc93b('0x7f')]);_0x5625aa[_0xc93b('0x7f')]=undefined;loggerPredictive[_0xc93b('0x76')](_0xc93b('0x7d'),_0xc93b('0x7f'),_0x5625aa[_0xc93b('0x3c')]);}}}function erlangb(_0x43d230,_0x547f4b){if(_0x547f4b===0x0){return 0x0;}var _0x1452d2=0x1;for(var _0x73c958=0x1;_0x73c958<=_0x547f4b;_0x73c958+=0x1){_0x1452d2=0x1+_0x1452d2*_0x73c958/_0x43d230;}return 0x1/_0x1452d2;}function isVoiceQueueOutbound(_0x2463f3){return _0x2463f3===_0xc93b('0x80');}function isNotPreview(_0x4202b3){return _0x4202b3!==_0xc93b('0x81');}function isCampaignIvr(_0x2b14dc){return _0x2b14dc==='ivr';}function getCallerId(_0x193753,_0xda502c,_0x554cba){if(!_[_0xc93b('0x38')](_0x554cba)&&_0xc93b('0x82')===typeof _0x554cba&&!_[_0xc93b('0x40')](_0x554cba)){if(!_[_0xc93b('0x38')](_0xda502c)&&_0xc93b('0x82')===typeof _0xda502c&&!_[_0xc93b('0x40')](_0xda502c)){return util['format'](_0xc93b('0x83'),_0xda502c,_0x554cba);}return util[_0xc93b('0x84')](_0xc93b('0x83'),_0x554cba,_0x554cba);}if(!_[_0xc93b('0x38')](_0x193753)&&'string'===typeof _0x193753&&!_[_0xc93b('0x40')](_0x193753)){return _0x193753;}return _0xc93b('0x85');}function loggerCatchQueueSummary(_0x5c7644,_0x424a24){return function(_0x1c078c){freeVariablesPredictive(_0x424a24);emitVoiceQueueSummary(_0x424a24);emitCampaignSummary(_0x424a24);loggerSyncQueueSummary['error'](_0x5c7644,util[_0xc93b('0x86')](_0x1c078c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x54b92c,_0x1e65ed){return function(_0x440de6){loggerPredictive[_0xc93b('0x87')](_0x54b92c,JSON[_0xc93b('0x43')](_0x440de6));freeVariablesPredictive(_0x1e65ed);};}function loggerCatch(_0x2685ba){return function(_0x289a9e){logger[_0xc93b('0x87')](_0x2685ba,util[_0xc93b('0x86')](_0x289a9e,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2eba17){return _0x2eba17&&!_['isUndefined'](_0x2eba17)&&_0x2eba17[_0xc93b('0x88')]>0x0;}function decremetOriginate(_0x4142d6){if(!_[_0xc93b('0x38')](_0x4142d6)&&_0x4142d6!==null){if(_0x4142d6[_0xc93b('0x89')]('originated')){if(_0x4142d6[_0xc93b('0x6d')]>0x0){_0x4142d6[_0xc93b('0x6d')]-=0x1;}else{logger[_0xc93b('0x87')](_0xc93b('0x8a'));}}}else{logger[_0xc93b('0x87')](_0xc93b('0x8b'));}}function checkContactLowerLimitOriginate(_0x4b2804,_0x3b5249,_0x315920){if(_0x3b5249>_0x315920){for(var _0x23626f=0x0;_0x23626f<_0x3b5249-_0x315920;_0x23626f+=0x1){decremetOriginate(_0x4b2804);}}}function loggerGetContactDialer(_0x2a3797,_0x397b96,_0x35e8d3){return function(_0x4aea51){checkContactLowerLimitOriginate(_0x397b96,_0x35e8d3,0x0);logger['error'](_0x2a3797,util[_0xc93b('0x86')](_0x4aea51,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x558d52){return function(_0x5ee551){if(isNotNull(_0x5ee551)&&isNotNull(_0x5ee551[0x0])){if(_0x5ee551[0x0][_0xc93b('0x8c')]>0x0){_0x558d52[_0xc93b('0x39')]=_0xc93b('0x8d');logger[_0xc93b('0x76')](_0xc93b('0x8e')+_0x558d52[_0xc93b('0x3c')],_0x5ee551[0x0]['contactsRescheduled'],_0xc93b('0x8f'));}else{_0x558d52[_0xc93b('0x39')]=_0xc93b('0x90');logger[_0xc93b('0x76')]('[getContactDialer2][Empty]'+_0x558d52[_0xc93b('0x3c')]);}}};}function notSendMessagesQueue(_0x356566){if(_0x356566[_0xc93b('0x91')]){freeVariablesPredictive(_0x356566);if(_0x356566[_0xc93b('0x6d')]===0x0&&_0x356566[_0xc93b('0x4d')]===0x0&&_0x356566[_0xc93b('0x50')]===0x0&&(_0x356566[_0xc93b('0x92')]||0x0)===0x0){_0x356566[_0xc93b('0x91')]=![];_0x356566['available']=0x0;_0x356566[_0xc93b('0x39')]=_0xc93b('0x3b');loggerSyncQueueSummary[_0xc93b('0x87')](_0xc93b('0x93'),_0x356566['name'],_0xc93b('0x94'));}else{_0x356566[_0xc93b('0x39')]='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0xc93b('0x93'),_0x356566[_0xc93b('0x3c')],_0xc93b('0x95'));}emitVoiceQueueSummary(_0x356566);}}function notSendMessagesCampaign(_0x1ed30a){if(_0x1ed30a[_0xc93b('0x91')]){if(_0x1ed30a[_0xc93b('0x6d')]===0x0){_0x1ed30a[_0xc93b('0x91')]=![];_0x1ed30a[_0xc93b('0x39')]=_0xc93b('0x3b');loggerSyncQueueSummary['error'](_0xc93b('0x96'),_0x1ed30a[_0xc93b('0x3c')],'is\x20not\x20active');}else{_0x1ed30a[_0xc93b('0x39')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xc93b('0x87')](_0xc93b('0x96'),_0x1ed30a[_0xc93b('0x3c')],'is\x20disactive');}emitCampaignSummary(_0x1ed30a);}}function createObjHistory(_0x2ff1d7,_0x258f8a,_0x2f13ea,_0x3e9172,_0x27aaed){_0x2ff1d7['message']=_0x2f13ea;var _0x5308b5=new Action(_0x2ff1d7,_0x258f8a);var _0xac3be2=new History(_0x5308b5);_0xac3be2[_0xc93b('0x97')]=_0x3e9172;_0xac3be2[_0xc93b('0x98')]=_0x27aaed;_0xac3be2[_0xc93b('0x99')]=_0x5308b5[_0xc93b('0x9a')];return _0xac3be2;}Dialer[_0xc93b('0x16')][_0xc93b('0x37')]=function(){var _0x436980=this;setInterval(function(){_0x436980[_0xc93b('0x9b')](_0x436980['uniqueId'],_0xc93b('0x9c'));_0x436980[_0xc93b('0x9b')](_0x436980[_0xc93b('0x1f')],'[actions]');},0x32c8);};Dialer[_0xc93b('0x16')][_0xc93b('0x9b')]=function(_0x5c9b4f,_0x1e8685){var _0x9a57dc=this;for(var _0x2b93fc in _0x5c9b4f){if(_0x5c9b4f['hasOwnProperty'](_0x2b93fc)){this[_0xc93b('0x19')][_0xc93b('0x17')](function(){if(!_[_0xc93b('0x9d')](_0x5c9b4f[_0x2b93fc])){return ami[_0xc93b('0x9e')]({'action':_0xc93b('0x9f'),'channel':_0x5c9b4f[_0x2b93fc][_0xc93b('0xa0')]})[_0xc93b('0xa1')](function(_0x4205fd){if(_0x4205fd[_0xc93b('0x39')]===_0xc93b('0xa2')){setTimeout(function(){if(_0x5c9b4f[_0x2b93fc]&&_0x5c9b4f[_0x2b93fc]['type']!=='ivr'){_0x9a57dc['updateOriginated'](_0x9a57dc['voiceQueues'][_0x5c9b4f[_0x2b93fc][_0xc93b('0xa3')]]);logger[_0xc93b('0x87')](_0xc93b('0xa4'),_0x1e8685,_0x2b93fc,_0x5c9b4f[_0x2b93fc]['queue']);delete _0x5c9b4f[_0x2b93fc];}if(_0x5c9b4f[_0x2b93fc]&&_0x5c9b4f[_0x2b93fc][_0xc93b('0x4f')]===_0xc93b('0x72')){_0x9a57dc[_0xc93b('0xa5')](_0x9a57dc['campaigns'][_0x5c9b4f[_0x2b93fc][_0xc93b('0xa3')]]);logger[_0xc93b('0x87')](_0xc93b('0xa6'),_0x1e8685,_0x2b93fc,_0x5c9b4f[_0x2b93fc][_0xc93b('0xa3')]);delete _0x5c9b4f[_0x2b93fc];}},0x2328);}});}});}}};Dialer[_0xc93b('0x16')][_0xc93b('0xa7')]=function(_0x1cc82e){return BPromise[_0xc93b('0xa8')]()[_0xc93b('0xa9')](cmHopper['countReScheduled'](_0x1cc82e))[_0xc93b('0xa1')](loggerCatch(_0xc93b('0xaa')));};Dialer[_0xc93b('0x16')]['checkIsBlackList']=function(_0x2c4776){return BPromise[_0xc93b('0xa8')]()[_0xc93b('0xa9')](cmHopperBlack[_0xc93b('0xab')](_0x2c4776))[_0xc93b('0xa1')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0xc93b('0x16')][_0xc93b('0xac')]=function(_0x2ca16a){return BPromise[_0xc93b('0xa8')]()[_0xc93b('0xa9')](cmHopperBlack[_0xc93b('0xac')](_0x2ca16a))[_0xc93b('0xa1')](loggerCatch(_0xc93b('0xad')));};Dialer[_0xc93b('0x16')][_0xc93b('0xae')]=function(_0x148297){return BPromise['resolve']()[_0xc93b('0xa9')](cmHopperHistory[_0xc93b('0xaf')](_0x148297))['catch'](loggerCatch(_0xc93b('0xb0')));};Dialer[_0xc93b('0x16')][_0xc93b('0xb1')]=function(_0x2219b5){return BPromise[_0xc93b('0xa8')]()[_0xc93b('0xa9')](cmHopper[_0xc93b('0xb1')](_0x2219b5))[_0xc93b('0xa1')](loggerCatch(_0xc93b('0xb2')));};Dialer[_0xc93b('0x16')][_0xc93b('0xb3')]=function(_0x4b7f8a,_0x405a2a,_0x4b5e2a,_0x4c7a4e){return BPromise['resolve']()[_0xc93b('0xa9')](cmHopper['getContactDialer'](_0x4b7f8a,_0x405a2a,_0x4b5e2a,_0x4c7a4e))['catch'](loggerCatch(_0xc93b('0xb4')));};Dialer[_0xc93b('0x16')][_0xc93b('0xb5')]=function(_0x3e97d6,_0xdaed69,_0x29dae2){return BPromise[_0xc93b('0xa8')]()[_0xc93b('0xa9')](cmHopper[_0xc93b('0xb5')](_0x3e97d6,_0xdaed69,_0x29dae2))['catch'](loggerCatch(_0xc93b('0xb4')));};Dialer[_0xc93b('0x16')][_0xc93b('0xb6')]=function(_0x220aa2){return BPromise[_0xc93b('0xa8')]()['then'](voiceQueueRt[_0xc93b('0xb6')](_0x220aa2))[_0xc93b('0xa1')](loggerCatch(_0xc93b('0xb7')));};Dialer[_0xc93b('0x16')]['moveContactManagedDialer']=function(_0x179c3e){return BPromise[_0xc93b('0xa8')]()[_0xc93b('0xa9')](cmHopper[_0xc93b('0xb8')](_0x179c3e))[_0xc93b('0xa1')](loggerCatch(_0xc93b('0xb9')));};Dialer[_0xc93b('0x16')][_0xc93b('0xba')]=function(_0xdf6c99){return BPromise[_0xc93b('0xa8')]()[_0xc93b('0xa9')](cmHopperHistory['createHistory'](_0xdf6c99))['catch'](loggerCatch(_0xc93b('0xbb')));};Dialer[_0xc93b('0x16')][_0xc93b('0xa5')]=function(_0x529e97){if(!_[_0xc93b('0x38')](_0x529e97)&&_0x529e97!==null){if(_0x529e97[_0xc93b('0x89')](_0xc93b('0x6d'))){if(_0x529e97[_0xc93b('0x6d')]>0x0){_0x529e97['originated']-=0x1;}else{logger['error'](_0xc93b('0xbc'));}}}else{logger['error'](_0xc93b('0xbd'));}};Dialer[_0xc93b('0x16')]['loggerHandler']=function(_0x51425d,_0x1e380d){var _0x220a6b=this;return function(_0x2650be){_0x220a6b[_0xc93b('0xa5')](_0x1e380d);logger[_0xc93b('0x87')](_0x51425d,util[_0xc93b('0x86')](_0x2650be,{'showHidden':![],'depth':null}));};};Dialer[_0xc93b('0x16')][_0xc93b('0xbe')]=function(_0x235378,_0x1abf93,_0x121d13){var _0x2488b5={'state':0x19,'statedesc':_0xc93b('0xbf')};this[_0xc93b('0xa5')](_0x1abf93);this['saveInDb'](_['merge'](_0x2488b5,_[_0xc93b('0xc0')](_0x121d13,[_0xc93b('0xc1'),_0xc93b('0xc2'),_0xc93b('0xc3'),_0xc93b('0xc4'),_0xc93b('0xc5')])),'[emptyContact][createHistory]',_0xc93b('0xc6'));logger[_0xc93b('0x87')](_0x235378);};Dialer['prototype']['isSuccess']=function(_0x204375){return _0x204375===_0xc93b('0xc7');};Dialer[_0xc93b('0x16')]['isTrunkReachable']=function(_0x198864){return!_[_0xc93b('0x38')](_0x198864)&&_0x198864&&!_[_0xc93b('0x38')](_0x198864['name'])&&!_[_0xc93b('0x38')](_0x198864[_0xc93b('0xc8')])&&_0x198864[_0xc93b('0xc8')]&&(this[_0xc93b('0x1c')][util[_0xc93b('0x84')](_0xc93b('0xc9'),_0x198864[_0xc93b('0x3c')])][_0xc93b('0x9f')]===_0xc93b('0xca')||this[_0xc93b('0x1c')][util[_0xc93b('0x84')]('SIP/%s',_0x198864[_0xc93b('0x3c')])]['status']===_0xc93b('0xcb'));};Dialer[_0xc93b('0x16')]['saveInDb']=function(_0xcdb98,_0x429671,_0x42c859){this[_0xc93b('0xba')](_0xcdb98)[_0xc93b('0xa1')](loggerCatch(_0x429671));this[_0xc93b('0xb8')](_0xcdb98)[_0xc93b('0xa1')](loggerCatch(_0x42c859));};Dialer[_0xc93b('0x16')][_0xc93b('0x32')]=function(_0x1db442){var _0x541b51=this[_0xc93b('0xcc')][_0x1db442[_0xc93b('0xcd')]];var _0x39cd37;if(!_['isNil'](_0x1db442)&&!_[_0xc93b('0x9d')](_0x1db442[_0xc93b('0xce')])&&!_['isNil'](_0x1db442[_0xc93b('0xce')][_0xc93b('0xcf')])&&_0x1db442[_0xc93b('0xd0')]===_0xc93b('0xd1')&&_0x541b51){if(_0x541b51['type']!==_0xc93b('0x72')&&this['voiceQueues'][_0x541b51[_0xc93b('0xa3')]][_0xc93b('0xd2')]&&_0x1db442[_0xc93b('0xd3')]===_0xc93b('0xd4')){delete this['uniqueId'][_0x1db442['uniqueid']];this['updateOriginated'](this[_0xc93b('0x1a')][_0x541b51[_0xc93b('0xa3')]]);this[_0xc93b('0x1a')][_0x541b51['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x541b51['queue']][_0xc93b('0x57')]+=0x1;_0x39cd37=new Hangup(_0x541b51,_0x1db442);_0x39cd37[_0xc93b('0x97')]=0x12;_0x39cd37[_0xc93b('0x98')]=_0xc93b('0xd5');_0x39cd37[_0xc93b('0xd6')]=_0xc93b('0xd7');this[_0xc93b('0xd8')](_0x39cd37,_0xc93b('0xd9'),_0xc93b('0xda'));}if(_0x541b51['type']!==_0xc93b('0x72')&&this['voiceQueues'][_0x541b51[_0xc93b('0xa3')]][_0xc93b('0xd2')]&&_0x1db442[_0xc93b('0xd3')]===_0xc93b('0xdb')){delete this[_0xc93b('0xcc')][_0x1db442['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x541b51[_0xc93b('0xa3')]]);this[_0xc93b('0x1a')][_0x541b51['queue']][_0xc93b('0x58')]+=0x1;this[_0xc93b('0x1a')][_0x541b51[_0xc93b('0xa3')]]['outboundAnswerAgiCallsDay']+=0x1;_0x39cd37=new Hangup(_0x541b51,_0x1db442);_0x39cd37[_0xc93b('0x97')]=0x13;_0x39cd37[_0xc93b('0x98')]=_0xc93b('0xdc');_0x39cd37[_0xc93b('0xd6')]=_0xc93b('0xd7');_0x39cd37['amd']=!![];this[_0xc93b('0xd8')](_0x39cd37,_0xc93b('0xdd'),'[syncMachine]');}if(_0x541b51[_0xc93b('0x4f')]===_0xc93b('0x72')&&this[_0xc93b('0x1b')][_0x541b51[_0xc93b('0xa3')]]['dialAMDActive']&&_0x1db442['value']===_0xc93b('0xd4')){delete this[_0xc93b('0xcc')][_0x1db442[_0xc93b('0xcd')]];this[_0xc93b('0xa5')](this[_0xc93b('0x1b')][_0x541b51[_0xc93b('0xa3')]]);_0x39cd37=new Hangup(_0x541b51,_0x1db442);_0x39cd37[_0xc93b('0x97')]=0x12;_0x39cd37[_0xc93b('0x98')]=_0xc93b('0xd5');_0x39cd37['membername']=_0xc93b('0xd7');this['saveInDb'](_0x39cd37,_0xc93b('0xde'),'[syncHangupInAMDIvr]');}if(_0x541b51[_0xc93b('0x4f')]===_0xc93b('0x72')&&this[_0xc93b('0x1b')][_0x541b51[_0xc93b('0xa3')]][_0xc93b('0xd2')]&&_0x1db442['value']===_0xc93b('0xdb')){delete this[_0xc93b('0xcc')][_0x1db442['uniqueid']];this[_0xc93b('0xa5')](this[_0xc93b('0x1b')][_0x541b51[_0xc93b('0xa3')]]);_0x39cd37=new Hangup(_0x541b51,_0x1db442);_0x39cd37[_0xc93b('0x97')]=0x13;_0x39cd37[_0xc93b('0x98')]=_0xc93b('0xdc');_0x39cd37[_0xc93b('0xd6')]='AMD';_0x39cd37[_0xc93b('0xdf')]=!![];this[_0xc93b('0xd8')](_0x39cd37,'[syncMachineIvr][createHistory]',_0xc93b('0xe0'));}}};Dialer[_0xc93b('0x16')]['syncHangup']=function(_0x351d43){var _0x398112=this[_0xc93b('0xcc')][_0x351d43[_0xc93b('0xcd')]];var _0x493047=this;var _0x510e73;if(_0x398112&&_0x398112[_0xc93b('0x4f')]===_0xc93b('0x72')){delete this[_0xc93b('0xcc')][_0x351d43[_0xc93b('0xcd')]];this[_0xc93b('0xa5')](this[_0xc93b('0x1b')][_0x398112[_0xc93b('0xa3')]]);this['campaigns'][_0x398112[_0xc93b('0xa3')]][_0xc93b('0xe1')]+=0x1;_0x510e73=new Hangup(_0x398112,_0x351d43);this[_0xc93b('0xba')](_0x510e73)[_0xc93b('0xa1')](loggerCatch(_0xc93b('0xe2')));this['moveContactManagedDialer'](_0x510e73)[_0xc93b('0xa1')](loggerCatch(_0xc93b('0xe3')));}if(_0x398112&&_0x398112[_0xc93b('0x4f')]!==_0xc93b('0x72')&&isNotNull(this[_0xc93b('0x1a')][_0x398112[_0xc93b('0xa3')]]['dialQueueProject'])){delete this[_0xc93b('0xcc')][_0x351d43[_0xc93b('0xcd')]];this['updateOriginated'](this[_0xc93b('0x1a')][_0x398112[_0xc93b('0xa3')]]);this[_0xc93b('0x1a')][_0x398112['queue']][_0xc93b('0x58')]+=0x1;this[_0xc93b('0x1a')][_0x398112['queue']][_0xc93b('0x57')]+=0x1;_0x510e73=new Hangup(_0x398112,_0x351d43);_0x510e73[_0xc93b('0x97')]=0x10;_0x510e73[_0xc93b('0x98')]=_0xc93b('0xe4');_0x510e73[_0xc93b('0xd6')]='AGI';this[_0xc93b('0xba')](_0x510e73)[_0xc93b('0xa1')](loggerCatch(_0xc93b('0xe2')));this['moveContactManagedDialer'](_0x510e73)[_0xc93b('0xa1')](loggerCatch('[syncHangupIvr]'));}if(_0x398112&&_0x398112[_0xc93b('0x4f')]!==_0xc93b('0x72')&&!isNotNull(this[_0xc93b('0x1a')][_0x398112['queue']][_0xc93b('0xe5')])){delete this['uniqueId'][_0x351d43[_0xc93b('0xcd')]];this['updateOriginated'](this['voiceQueues'][_0x398112['queue']]);this[_0xc93b('0x1a')][_0x398112[_0xc93b('0xa3')]]['outboundUnknownCallsDay']+=0x1;_0x510e73=new Hangup(_0x398112,_0x351d43);_0x510e73[_0xc93b('0x97')]=0xc;_0x510e73[_0xc93b('0x98')]=_0x351d43[_0xc93b('0xe6')];_0x510e73['membername']='Unknow';this['createHistory'](_0x510e73)['catch'](loggerCatch(_0xc93b('0xe2')));this[_0xc93b('0xb8')](_0x510e73)['catch'](loggerCatch(_0xc93b('0xe3')));}};Dialer['prototype'][_0xc93b('0x2a')]=function(_0x5e1950){var _0x3aa26a=this[_0xc93b('0xcc')][_0x5e1950[_0xc93b('0xcd')]];var _0x2ef9b1=this;if(this[_0xc93b('0x1a')][_0x5e1950['queue']]){if(_0x3aa26a&&_0x3aa26a['type']!=='ivr'){delete this['uniqueId'][_0x5e1950[_0xc93b('0xcd')]];this[_0xc93b('0x1a')][_0x5e1950[_0xc93b('0xa3')]][_0xc93b('0x58')]+=0x1;var _0x3f6edd=new AgentComplete(_0x3aa26a,_0x5e1950);if(_0x5e1950[_0xc93b('0xe7')]===_0xc93b('0xe8')){_0x3f6edd[_0xc93b('0xe9')]=this[_0xc93b('0x1a')][_0x5e1950[_0xc93b('0xa3')]][_0xc93b('0xea')]&&this[_0xc93b('0x1a')][_0x5e1950[_0xc93b('0xa3')]][_0xc93b('0xeb')]?moment()[_0xc93b('0x84')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xc93b('0xba')](_0x3f6edd)['catch'](loggerCatch(_0xc93b('0xec')));this[_0xc93b('0xb8')](_0x3f6edd)['catch'](loggerCatch(_0xc93b('0xed')));}}};Dialer[_0xc93b('0x16')][_0xc93b('0x25')]=function(_0x2458da){if(this[_0xc93b('0x1a')][_0x2458da['queue']]){if(this[_0xc93b('0xcc')][_0x2458da['uniqueid']]&&this['uniqueId'][_0x2458da[_0xc93b('0xcd')]][_0xc93b('0x4f')]!==_0xc93b('0x72')){this['updateOriginated'](this[_0xc93b('0x1a')][_0x2458da[_0xc93b('0xa3')]]);this[_0xc93b('0xcc')][_0x2458da[_0xc93b('0xcd')]][_0xc93b('0xee')]=moment()[_0xc93b('0x84')](_0xc93b('0xef'));}}};Dialer[_0xc93b('0x16')]['queueCallerAbandonCreateState']=function(_0x1d2dba){this[_0xc93b('0xba')](_0x1d2dba)[_0xc93b('0xa1')](loggerCatch(_0xc93b('0xec')));this[_0xc93b('0xb8')](_0x1d2dba)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xc93b('0x16')][_0xc93b('0x27')]=function(_0x2682a8){var _0x40f8bb=this[_0xc93b('0xcc')][_0x2682a8[_0xc93b('0xcd')]];var _0x27667e=this;if(this[_0xc93b('0x1a')][_0x2682a8[_0xc93b('0xa3')]]){if(_0x40f8bb&&_0x40f8bb['type']!==_0xc93b('0x72')){delete this[_0xc93b('0xcc')][_0x2682a8[_0xc93b('0xcd')]];this['updateOriginated'](this[_0xc93b('0x1a')][_0x2682a8[_0xc93b('0xa3')]]);_0x40f8bb['droptime']=moment()['format'](_0xc93b('0xef'));var _0x321c75=new QueueCallerAbandon(_0x40f8bb,_0x2682a8);if(getSeconds(_0x40f8bb[_0xc93b('0xf0')],_0x40f8bb[_0xc93b('0xf1')])>=_0x40f8bb[_0xc93b('0xf2')]){this['voiceQueues'][_0x2682a8[_0xc93b('0xa3')]][_0xc93b('0x68')]+=0x1;this[_0xc93b('0x1a')][_0x2682a8[_0xc93b('0xa3')]][_0xc93b('0x5e')]+=0x1;this[_0xc93b('0x1a')][_0x2682a8['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x321c75[_0xc93b('0x97')]=0xa;_0x321c75['statedesc']=_0xc93b('0xf3');_0x321c75[_0xc93b('0xf4')]='TIMEOUT';_0x321c75[_0xc93b('0xe9')]=this[_0xc93b('0x1a')][_0x2682a8['queue']]['dialQueueProject2']?moment()[_0xc93b('0x84')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;this[_0xc93b('0xf5')](_0x321c75);}else{this[_0xc93b('0x1a')][_0x2682a8[_0xc93b('0xa3')]][_0xc93b('0x67')]+=0x1;this[_0xc93b('0x1a')][_0x2682a8[_0xc93b('0xa3')]]['outboundDropCallsDayCallersExit']+=0x1;_0x321c75[_0xc93b('0x97')]=0xb;_0x321c75[_0xc93b('0x98')]=_0xc93b('0xf6');_0x321c75[_0xc93b('0xf4')]=_0xc93b('0xf7');this[_0xc93b('0xf5')](_0x321c75);}}}};Dialer['prototype'][_0xc93b('0x30')]=function(_0x2f9fd8){if(this['actions'][_0x2f9fd8[_0xc93b('0xcd')]]){this[_0xc93b('0x1f')][_0x2f9fd8[_0xc93b('0xcd')]][_0xc93b('0xa0')]=_0x2f9fd8[_0xc93b('0xa0')];}if(this[_0xc93b('0xcc')][_0x2f9fd8[_0xc93b('0xcd')]]){this[_0xc93b('0xcc')][_0x2f9fd8[_0xc93b('0xcd')]][_0xc93b('0xa0')]=_0x2f9fd8[_0xc93b('0xa0')];}};Dialer[_0xc93b('0x16')][_0xc93b('0x34')]=function(_0x447bc8){if(strategy[this['voiceQueues'][this[_0xc93b('0x1f')][_0x447bc8[_0xc93b('0xf8')]]['queue']][_0xc93b('0x47')]]===_0xc93b('0x15')){if(this[_0xc93b('0x1f')][_0x447bc8[_0xc93b('0xf8')]]&&_['isNil'](this[_0xc93b('0x1f')][_0x447bc8[_0xc93b('0xf8')]]['locked'])&&_0x447bc8[_0xc93b('0x9f')]==='1'&&_0x447bc8[_0xc93b('0xf9')]==='0'){if(this[_0xc93b('0xfa')][_0x447bc8[_0xc93b('0xfb')]]){if(!this[_0xc93b('0xfa')][_0x447bc8[_0xc93b('0xfb')]][_0xc93b('0xfc')]){this[_0xc93b('0xfa')][_0x447bc8[_0xc93b('0xfb')]][_0xc93b('0xfc')]=!![];this['actions'][_0x447bc8['actionid']][_0xc93b('0xfc')]=!![];this['actions'][_0x447bc8[_0xc93b('0xf8')]][_0xc93b('0xfb')]=_0x447bc8[_0xc93b('0xfb')];}}}}else if((strategy[this['voiceQueues'][this[_0xc93b('0x1f')][_0x447bc8[_0xc93b('0xf8')]]['queue']][_0xc93b('0x47')]]||_0xc93b('0x14'))==='rrmemory'){if(this[_0xc93b('0x1f')][_0x447bc8[_0xc93b('0xf8')]]){if(this['agents'][_0x447bc8['stateinterface']]){this[_0xc93b('0x1f')][_0x447bc8[_0xc93b('0xf8')]][_0xc93b('0xfb')]=_0x447bc8['stateinterface'];if(_[_0xc93b('0x9d')](this[_0xc93b('0xfd')][this['actions'][_0x447bc8['actionid']][_0xc93b('0xa3')]])){this[_0xc93b('0xfd')][this['actions'][_0x447bc8['actionid']]['queue']]=[];}this['queueBooked'][this['actions'][_0x447bc8[_0xc93b('0xf8')]]['queue']][_0xc93b('0xfe')](_['merge'](_[_0xc93b('0xc0')](this[_0xc93b('0x1f')][_0x447bc8[_0xc93b('0xf8')]],[_0xc93b('0xff'),_0xc93b('0xfb')]),{'status':_0x447bc8[_0xc93b('0x9f')],'paused':_0x447bc8[_0xc93b('0xf9')]}));}}}};function unlockQueueStatus(_0x4abd64,_0x440e02){setTimeout(function(){if(_['isUndefined'](_0x4abd64['queueStatusComplete'])){loggerBooked[_0xc93b('0x87')]('[unlockQueueStatus][undefined]',_0x440e02);}_0x4abd64[_0xc93b('0x100')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x440e02,JSON[_0xc93b('0x43')](_['pick'](_0x4abd64,[_0xc93b('0x3c'),'queueStatusComplete'])));},0x1f3);}Dialer[_0xc93b('0x16')][_0xc93b('0x101')]=function(_0xb1f1ea){var _0x34eb67=this;var _0x3ddef9=_0x34eb67[_0xc93b('0x1a')][_0x34eb67[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xa3')]];if(strategy[this[_0xc93b('0x1a')][this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]]['queue']]['strategy']]===_0xc93b('0x15')){if(this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]]&&this['actions'][_0xb1f1ea[_0xc93b('0xf8')]]['stateinterface']){this[_0xc93b('0x81')][_0xc93b('0x102')](this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xff')],this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]]['stateinterface'])[_0xc93b('0xa1')](function(_0x35b179){logger[_0xc93b('0x87')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xc93b('0x86')](_0x35b179,{'showHidden':![],'depth':null}));})['finally'](function(){_0x34eb67[_0xc93b('0xa5')](_0x34eb67['voiceQueues'][_0x34eb67['actions'][_0xb1f1ea[_0xc93b('0xf8')]]['queue']]);_0x34eb67[_0xc93b('0xfa')][_0x34eb67['actions'][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xfb')]][_0xc93b('0xfc')]=![];delete _0x34eb67[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]];unlockQueueStatus(_0x3ddef9);});}else{this[_0xc93b('0xa5')](this[_0xc93b('0x1a')][this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]]['queue']]);this[_0xc93b('0xb1')]({'active':![],'ContactId':this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xc1')],'ListId':this['actions'][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xc2')],'VoiceQueueId':this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0xb1f1ea[_0xc93b('0xf8')]]['CampaignId']||undefined})[_0xc93b('0xa1')](loggerCatch(_0xc93b('0x103')));delete this['actions'][_0xb1f1ea[_0xc93b('0xf8')]];unlockQueueStatus(_0x3ddef9);}}else if((strategy[this[_0xc93b('0x1a')][this['actions'][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xa3')]][_0xc93b('0x47')]]||_0xc93b('0x14'))===_0xc93b('0x14')){var _0x575ec6;if(this['actions'][_0xb1f1ea['actionid']]&&!_[_0xc93b('0x40')](this[_0xc93b('0xfd')][this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xa3')]])){if(this[_0xc93b('0x23')][_0x34eb67[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xa3')]]){this['queueBookedRR'][_0x34eb67['actions'][_0xb1f1ea['actionid']]['queue']]=this['queueBookedRR'][this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xa3')]]?this[_0xc93b('0x23')][this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xa3')]]:this[_0xc93b('0xfd')][this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xa3')]]?this[_0xc93b('0xfd')][this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xa3')]][_0xc93b('0x104')]||0x0:0x0;}this[_0xc93b('0xfd')][this['actions'][_0xb1f1ea['actionid']]['queue']]['_rr']=this[_0xc93b('0x23')][this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xa3')]];for(var _0x281d9e=0x0;_0x281d9e<this[_0xc93b('0xfd')][this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xa3')]]['length'];_0x281d9e+=0x1){_0x575ec6=rr(this['queueBooked'][this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xa3')]]);this[_0xc93b('0x23')][_0x34eb67[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]]['queue']]=this[_0xc93b('0xfd')][this['actions'][_0xb1f1ea['actionid']][_0xc93b('0xa3')]]['_rr'];if(_0x575ec6[_0xc93b('0x9f')]==='1'&&_0x575ec6[_0xc93b('0xf9')]==='0'){break;}}if(!_[_0xc93b('0x9d')](_0x575ec6)){this[_0xc93b('0xfa')][_0x575ec6[_0xc93b('0xfb')]][_0xc93b('0x105')]=_[_0xc93b('0x38')](this[_0xc93b('0xfa')][_0x575ec6[_0xc93b('0xfb')]][_0xc93b('0x105')])?!![]:this['agents'][_0x575ec6[_0xc93b('0xfb')]][_0xc93b('0x105')];}loggerBooked[_0xc93b('0x76')](_0xc93b('0x106'),_0xb1f1ea['actionid'],'Agent:\x20',JSON['stringify'](_['pick'](this[_0xc93b('0xfa')][_0x575ec6[_0xc93b('0xfb')]],[_0xc93b('0x3c'),_0xc93b('0x105')])),_0xc93b('0x107'),JSON[_0xc93b('0x43')](_0x575ec6['idHopper']));if(!_[_0xc93b('0x9d')](_0x575ec6)&&_0x575ec6['status']==='1'&&_0x575ec6[_0xc93b('0xf9')]==='0'&&this['agents'][_0x575ec6[_0xc93b('0xfb')]][_0xc93b('0x105')]){this[_0xc93b('0xfa')][_0x575ec6[_0xc93b('0xfb')]]['unlockRR']=![];this[_0xc93b('0xfd')][_0x34eb67[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]]['queue']]=[];this[_0xc93b('0x81')][_0xc93b('0x102')](_0x575ec6[_0xc93b('0xff')],_0x575ec6[_0xc93b('0xfb')])[_0xc93b('0xa1')](function(_0x399595){logger[_0xc93b('0x87')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xc93b('0x86')](_0x399595,{'showHidden':![],'depth':null}));})[_0xc93b('0x108')](function(){_0x34eb67[_0xc93b('0xa5')](_0x34eb67[_0xc93b('0x1a')][_0x34eb67[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xa3')]]);setTimeout(function(){_0x34eb67[_0xc93b('0xfa')][_0x575ec6[_0xc93b('0xfb')]]['unlockRR']=!![];loggerBooked[_0xc93b('0x76')]('[booked][RR][finaly]',_0xb1f1ea[_0xc93b('0xf8')],_0xc93b('0x109'),JSON[_0xc93b('0x43')](_[_0xc93b('0xc0')](_0x34eb67[_0xc93b('0xfa')][_0x575ec6[_0xc93b('0xfb')]],[_0xc93b('0x3c'),_0xc93b('0x105')])),_0xc93b('0x107'),JSON[_0xc93b('0x43')](_0x575ec6['idHopper']));},0xc7);delete _0x34eb67[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]];unlockQueueStatus(_0x3ddef9,_0xb1f1ea[_0xc93b('0xf8')]);});}else{loggerBooked[_0xc93b('0x76')]('[booked][unlock]');this[_0xc93b('0xa5')](this['voiceQueues'][this[_0xc93b('0x1f')][_0xb1f1ea['actionid']]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0xc93b('0x1f')][_0xb1f1ea['actionid']][_0xc93b('0xc1')],'ListId':this[_0xc93b('0x1f')][_0xb1f1ea['actionid']][_0xc93b('0xc2')],'VoiceQueueId':this['actions'][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xc4')]||undefined,'CampaignId':this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xc5')]||undefined})[_0xc93b('0xa1')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]];unlockQueueStatus(_0x3ddef9);}}else{loggerBooked[_0xc93b('0x76')](_0xc93b('0x10a'));this['updateOriginated'](this['voiceQueues'][this[_0xc93b('0x1f')][_0xb1f1ea['actionid']][_0xc93b('0xa3')]]);this[_0xc93b('0xb1')]({'active':![],'ContactId':this['actions'][_0xb1f1ea[_0xc93b('0xf8')]]['ContactId'],'ListId':this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]]['ListId'],'VoiceQueueId':this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xc4')]||undefined,'CampaignId':this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xc5')]||undefined})[_0xc93b('0xa1')](loggerCatch(_0xc93b('0x10b')));delete this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]];unlockQueueStatus(_0x3ddef9);}}else{loggerBooked[_0xc93b('0x76')](_0xc93b('0x10c'));this[_0xc93b('0xa5')](this[_0xc93b('0x1a')][this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xa3')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xc93b('0x1f')][_0xb1f1ea['actionid']][_0xc93b('0xc1')],'ListId':this['actions'][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xc2')],'VoiceQueueId':this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]][_0xc93b('0xc4')]||undefined,'CampaignId':this[_0xc93b('0x1f')][_0xb1f1ea['actionid']][_0xc93b('0xc5')]||undefined})[_0xc93b('0xa1')](loggerCatch(_0xc93b('0x10d')));delete this[_0xc93b('0x1f')][_0xb1f1ea[_0xc93b('0xf8')]];unlockQueueStatus(_0x3ddef9);}};Dialer[_0xc93b('0x16')][_0xc93b('0x36')]=function(){var _0x359523=this;setInterval(function(){_0x359523[_0xc93b('0x10e')]();},0x3e8);};Dialer[_0xc93b('0x16')][_0xc93b('0x10f')]=function(_0x46fd38){var _0x561bef=this;return function(){if(!_0x561bef[_0xc93b('0x110')](_0x46fd38[_0xc93b('0x6e')])){if(!_0x561bef[_0xc93b('0x110')](_0x46fd38['TrunkBackup'])){_0x46fd38[_0xc93b('0x39')]=_0xc93b('0x111');throw _0x46fd38[_0xc93b('0x3c')]+_0xc93b('0x112');}}};};Dialer[_0xc93b('0x16')][_0xc93b('0x113')]=function(_0x550b41,_0x3cac62,_0x268267,_0x5dc5e4){var _0x30aea6=this;return function(){var _0x3defad=!![];return _0x30aea6['ifTime'](_0x550b41,_0x3cac62,_0x268267,_0x5dc5e4,_0x3defad);};};Dialer[_0xc93b('0x16')][_0xc93b('0x114')]=function(_0x2c7c6a,_0x28b5e7,_0x4d74d5,_0x163453){var _0x566f9f=this;return function(){var _0x28c48c=![];return _0x566f9f[_0xc93b('0x115')](_0x2c7c6a['Intervals'],_0x28b5e7,_0x4d74d5,_0x163453,_0x28c48c);};};Dialer[_0xc93b('0x16')][_0xc93b('0x115')]=function(_0x5aad1d,_0x56ad93,_0x4dda2f,_0x36960d,_0x1bfa1f){var _0x3aaacd=[];return new BPromise(function(_0x25948e,_0x5bb7b4){if(!isNotNull(_0x5aad1d)){_0x36960d[_0xc93b('0x39')]=_0xc93b('0x3d');return _0x5bb7b4(msgResponse(_0xc93b('0x115'),_0xc93b('0x116'),_0x4dda2f+_0xc93b('0x117')));}if(_[_0xc93b('0x40')](_0x5aad1d)){_0x36960d['message']=_0xc93b('0x118');return _0x5bb7b4(msgResponse(_0xc93b('0x115'),_0xc93b('0x116'),_0x4dda2f+_0xc93b('0x119')));}if(_0x56ad93&&_['isUndefined'](config[_0xc93b('0x11a')][_0x56ad93])){_0x36960d['message']=_0xc93b('0x11b');return _0x5bb7b4(msgResponse(_0xc93b('0x115'),_0xc93b('0x116'),_0x4dda2f+_0xc93b('0x11c')+_0x56ad93));}if(_[_0xc93b('0x11d')](_0x5aad1d)){for(var _0x1b4a33=0x0;_0x1b4a33<_0x5aad1d['length'];_0x1b4a33+=0x1){_0x3aaacd[_0xc93b('0xfe')](ami[_0xc93b('0x9e')]({'action':_0xc93b('0x11e'),'command':util['format'](_0xc93b('0x11f'),_0x5aad1d[_0x1b4a33][_0xc93b('0x120')],!_[_0xc93b('0x38')](config[_0xc93b('0x11a')][_0x56ad93])?_0x56ad93:'')})[_0xc93b('0xa9')](function(_0x3104f8){return _0x3104f8[_0xc93b('0x121')][_0xc93b('0x122')](_0xc93b('0x123'))>=0x0?!![]:![];})['catch'](myreject(_0x5bb7b4)));}}else{_0x3aaacd[_0xc93b('0xfe')](ami[_0xc93b('0x9e')]({'action':_0xc93b('0x11e'),'command':util[_0xc93b('0x84')](_0xc93b('0x11f'),_0x5aad1d,!_['isUndefined'](config['timezones'][_0x56ad93])?_0x56ad93:'')})[_0xc93b('0xa9')](function(_0x349954){return _0x349954['content']['indexOf'](_0xc93b('0x123'))>=0x0?!![]:![];})['catch'](myreject(_0x5bb7b4)));}BPromise[_0xc93b('0x124')](_0x3aaacd)[_0xc93b('0xa9')](function(_0x41bd4e){var _0x5deb26=_[_0xc93b('0x125')](_0x41bd4e);if(_0x5deb26){return _0x25948e(_0x5deb26);}else{_0x36960d['message']=_0x1bfa1f?'GLOBAL_INTERVAL_IS_OVERTIME':_0xc93b('0x126');return _0x5bb7b4(msgResponse(_0xc93b('0x127'),_0xc93b('0x116'),_0xc93b('0x128')+_0x1bfa1f+'\x20'+_0x4dda2f+'\x20Interval\x20is\x20overtime:\x20'+util[_0xc93b('0x86')](_0x5aad1d,{'showHidden':![],'depth':null})+_0xc93b('0x129')+_0x56ad93));}})[_0xc93b('0xa1')](function(_0x18edc4){return _0x5bb7b4(msgResponse(_0xc93b('0x115'),_0xc93b('0x116'),JSON['stringify'](_0x18edc4)));});});};Dialer[_0xc93b('0x16')][_0xc93b('0x12a')]=function(_0x4435e9){var _0x365e3f=this;return function(){switch(_0x4435e9[_0xc93b('0x53')]){case _0xc93b('0x12b'):freeVariablesPredictive(_0x4435e9);_0x365e3f[_0xc93b('0x12c')](_0x4435e9,0x1);break;case _0xc93b('0x12d'):freeVariablesPredictive(_0x4435e9);_0x365e3f[_0xc93b('0x12c')](_0x4435e9,_0x4435e9[_0xc93b('0x12e')]);break;case'predictive':_0x365e3f['predictive'](_0x4435e9);break;case _0xc93b('0x5'):freeVariablesPredictive(_0x4435e9);_0x365e3f[_0xc93b('0x12c')](_0x4435e9,0x1);break;default:freeVariablesPredictive(_0x4435e9);logger['error'](_0xc93b('0x12f'),_0x4435e9[_0xc93b('0x3c')],_0xc93b('0x130'));}};};Dialer[_0xc93b('0x16')]['launchHandleIvr']=function(_0x3e545d){var _0x19b8a5=this;return function(){_0x19b8a5[_0xc93b('0x131')](_0x3e545d);};};Dialer[_0xc93b('0x16')][_0xc93b('0x2c')]=function(_0x2a8bfb){var _0x88a22d=this;if(isNotPreview(_0x2a8bfb['dialMethod'])){if(isVoiceQueueOutbound(_0x2a8bfb[_0xc93b('0x4f')])&&isActive(_0x2a8bfb[_0xc93b('0x52')])){_0x2a8bfb[_0xc93b('0x91')]=!![];BPromise[_0xc93b('0xa8')]()[_0xc93b('0xa9')](checkIsLoggedIn(_0x2a8bfb,_0x2a8bfb[_0xc93b('0x4a')]))['then'](checkIsActive(_0x2a8bfb,_0x2a8bfb[_0xc93b('0x52')]))[_0xc93b('0xa9')](checkInterval(_0x2a8bfb))[_0xc93b('0xa9')](_0x88a22d[_0xc93b('0x10f')](_0x2a8bfb))[_0xc93b('0xa9')](_0x88a22d[_0xc93b('0x113')](_0x2a8bfb[_0xc93b('0x132')],_0x2a8bfb['dialTimezone'],_0x2a8bfb[_0xc93b('0x3c')],_0x2a8bfb))[_0xc93b('0xa9')](_0x88a22d['checkIfTimeIntervals'](_0x2a8bfb['Interval'],_0x2a8bfb[_0xc93b('0x133')],_0x2a8bfb[_0xc93b('0x3c')],_0x2a8bfb))['then'](_0x88a22d[_0xc93b('0x12a')](_0x2a8bfb))['catch'](loggerCatchQueueSummary(_0xc93b('0x134'),_0x2a8bfb));}else{notSendMessagesQueue(_0x2a8bfb);}}else{freeVariablesPredictive(_0x2a8bfb);}};Dialer[_0xc93b('0x16')][_0xc93b('0x10e')]=function(){var _0x464ef5=this;var _0x29347f;for(var _0x342503 in this[_0xc93b('0x1b')]){if(this[_0xc93b('0x1b')][_0xc93b('0x89')](_0x342503)){_0x29347f=this['campaigns'][_0x342503];if(isCampaignIvr(_0x29347f[_0xc93b('0x4f')])&&isActive(_0x29347f[_0xc93b('0xc8')])){_0x29347f[_0xc93b('0x91')]=!![];BPromise[_0xc93b('0xa8')]()[_0xc93b('0xa9')](checkIsActive(_0x29347f,_0x29347f[_0xc93b('0xc8')]))['then'](checkInterval(_0x29347f))[_0xc93b('0xa9')](_0x464ef5[_0xc93b('0x10f')](_0x29347f))[_0xc93b('0xa9')](_0x464ef5[_0xc93b('0x113')](_0x29347f[_0xc93b('0x132')],_0x29347f[_0xc93b('0x133')],_0x29347f[_0xc93b('0x3c')],_0x29347f))[_0xc93b('0xa9')](_0x464ef5['checkIfTimeIntervals'](_0x29347f[_0xc93b('0x3e')],_0x29347f[_0xc93b('0x133')],_0x29347f[_0xc93b('0x3c')],_0x29347f))[_0xc93b('0xa9')](_0x464ef5[_0xc93b('0x135')](_0x29347f))[_0xc93b('0xa1')](loggerCatchQueueSummary('[syncCampaigns]',_0x29347f));}else{notSendMessagesCampaign(_0x29347f);}}}};function getCallerIdRandom(_0x47113c,_0xe9bbd0){var _0x5e9d7b,_0x56aaf4,_0x339f23;if(_0xe9bbd0<=0x0){_0xe9bbd0=0x1;}_0x5e9d7b=new RegExp(_0xc93b('0x136')+_0xe9bbd0+'}$');_0x56aaf4=Math['pow'](0xa,_0xe9bbd0-0x1);_0x339f23=Math[_0xc93b('0x137')](0xa,_0xe9bbd0)-0x1;return util[_0xc93b('0x84')]('%s',_[_0xc93b('0x138')](_0x47113c,_0x5e9d7b,_[_0xc93b('0x139')](_0x56aaf4,_0x339f23)));}function extractCalleridName(_0x3eb6a3){var _0x4423f2=_0x3eb6a3[_0xc93b('0x13a')](/"(.*?)"/);return _0x4423f2?_0x4423f2[0x1]:_0x3eb6a3;}function extractCalleridNumber(_0x1fe52f){var _0x2d1e4e=_0x1fe52f[_0xc93b('0x13a')](/<(.*?)>/);return _0x2d1e4e?_0x2d1e4e[0x1]:_0x1fe52f;}Dialer[_0xc93b('0x16')]['actionOriginate']=function(_0x5831ce,_0x523481){var _0x468957=this;var _0x98dab3=uuid['v4']();this['actions'][_0x98dab3]=new Action(_0x5831ce,_0x523481,_0x98dab3);return new BPromise(function(_0x131268,_0x47ff63){if(_[_0xc93b('0x38')](_0x5831ce)&&_0xc93b('0x13b')!==typeof _0x5831ce){return _0x47ff63(msgResponse(_0xc93b('0x13c'),_0xc93b('0x116'),'voiceQueue\x20is\x20undefine'));}if(_[_0xc93b('0x38')](_0x523481[_0xc93b('0x13d')][_0xc93b('0x13e')])||_0x523481['Contact']['phone']===null){return _0x47ff63(msgResponse(_0xc93b('0x13c'),_0xc93b('0x116'),_0xc93b('0x13f')));}var _0x310501={'XMD-CALLERID':_0x468957[_0xc93b('0x1f')][_0x98dab3][_0xc93b('0x140')](),'XMD-AGI':_0x5831ce[_0xc93b('0xe5')]?util[_0xc93b('0x84')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5831ce[_0xc93b('0xe5')]):'NONE','XMD-AGIAFTER':_0x5831ce[_0xc93b('0xea')]?util['format'](_0xc93b('0x141'),ipAgi,_0x5831ce['dialQueueProject2']):_0xc93b('0x142'),'XMD-QUEUE':_0x5831ce[_0xc93b('0x4f')]===_0xc93b('0x80')?util[_0xc93b('0x84')](_0xc93b('0x143'),_0x5831ce['name'],_0x5831ce['dialQueueOptions']||'',_0x5831ce[_0xc93b('0xeb')]?'c':'',_0x5831ce['dialQueueTimeout']||0x3):_0xc93b('0x142'),'XMD-CONTACTID':_0x523481['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x468957['actions'][_0x98dab3]['getCaller'](),'XMD-AMD':_0x5831ce['dialAMDActive']?'ACTIVE':_0xc93b('0x142'),'XMD-DESTINATION':_0xc93b('0xd1')};if(_0x5831ce['dialAMDActive']){_0x310501[_0xc93b('0x144')]=_0x5831ce['dialAMDInitialSilence']||0x9c4;_0x310501['XMD-AMDGREETING']=_0x5831ce[_0xc93b('0x145')]||0x5dc;_0x310501['XMD-AMDAFTERGREETINGSILENCE']=_0x5831ce[_0xc93b('0x146')]||0x320;_0x310501['XMD-AMDTOTALANALYSISTIME']=_0x5831ce[_0xc93b('0x147')]||0x1388;_0x310501[_0xc93b('0x148')]=_0x5831ce['dialAMDMinWordLength']||0x64;_0x310501['XMD-AMDBETWEENWORDSSILENCE']=_0x5831ce[_0xc93b('0x149')]||0x32;_0x310501[_0xc93b('0x14a')]=_0x5831ce[_0xc93b('0x14b')]||0x3;_0x310501[_0xc93b('0x14c')]=_0x5831ce[_0xc93b('0x14d')]||0x100;_0x310501[_0xc93b('0x14e')]=_0x5831ce[_0xc93b('0x14f')]||0x1388;}if(_0x5831ce[_0xc93b('0x4f')]===_0xc93b('0x80')){_0x310501[_0xc93b('0x150')]=_0x523481[_0xc93b('0xc4')];}else{_0x310501[_0xc93b('0x151')]=_0x523481['CampaignId'];}for(var _0x70c3dc in _0x523481[_0xc93b('0x13d')]){if(_0x523481['Contact']['hasOwnProperty'](_0x70c3dc)){if(isNotNull(_0x523481[_0xc93b('0x13d')][_0x70c3dc])&&_0x70c3dc!=='id'&&_0x70c3dc!=='tags'&&_0x70c3dc!=='createdAt'&&_0x70c3dc!==_0xc93b('0x152')){_0x310501[util[_0xc93b('0x84')](_0xc93b('0x153'),_0xc93b('0x154'),_['toUpper'](_0x70c3dc))]=_0x523481['Contact'][_0x70c3dc];}}}var _0xad6fd9=_0x468957[_0xc93b('0x110')](_0x5831ce[_0xc93b('0x6e')])?getCallerId(_0x5831ce[_0xc93b('0x6e')][_0xc93b('0x6f')],_0x5831ce['dialOriginateCallerIdName'],_0x5831ce[_0xc93b('0x155')]>0x0?getCallerIdRandom(_0x5831ce[_0xc93b('0x156')],_0x5831ce[_0xc93b('0x155')]):_0x5831ce['dialOriginateCallerIdNumber']):getCallerId(_[_0xc93b('0x9d')](_0x5831ce[_0xc93b('0x157')])?_0x5831ce[_0xc93b('0x6e')][_0xc93b('0x6f')]:_0x5831ce[_0xc93b('0x157')]['callerid'],_0x5831ce[_0xc93b('0x54')],_0x5831ce[_0xc93b('0x155')]>0x0?getCallerIdRandom(_0x5831ce[_0xc93b('0x156')],_0x5831ce[_0xc93b('0x155')]):_0x5831ce[_0xc93b('0x156')]);if(_0xad6fd9){_0x310501[_0xc93b('0x158')]=_0x468957[_0xc93b('0x1f')][_0x98dab3][_0xc93b('0x159')]=extractCalleridName(_0xad6fd9);_0x310501['XMD-ORIGINATECALLERIDNUM']=_0x468957[_0xc93b('0x1f')][_0x98dab3]['originatecalleridnum']=extractCalleridNumber(_0xad6fd9);}return ami['Action']({'actionid':_0x98dab3,'action':'originate','channel':_0x468957[_0xc93b('0x110')](_0x5831ce[_0xc93b('0x6e')])?util[_0xc93b('0x84')]('SIP/%s/%s%s',_0x5831ce[_0xc93b('0x6e')][_0xc93b('0x3c')],isNotNull(_0x5831ce[_0xc93b('0x56')])?_0x5831ce[_0xc93b('0x56')]['trim']()||'':'',_0x5831ce[_0xc93b('0x15a')]>0x0?_0x523481[_0xc93b('0x13d')][_0xc93b('0x13e')][_0xc93b('0x15b')](_0x5831ce[_0xc93b('0x15a')]):_0x523481[_0xc93b('0x13d')][_0xc93b('0x13e')]):util[_0xc93b('0x84')](_0xc93b('0x15c'),_['isNil'](_0x5831ce[_0xc93b('0x157')])?_0x5831ce[_0xc93b('0x6e')]['name']:_0x5831ce[_0xc93b('0x157')]['name'],isNotNull(_0x5831ce[_0xc93b('0x56')])?_0x5831ce[_0xc93b('0x56')][_0xc93b('0x15d')]()||'':'',_0x5831ce[_0xc93b('0x15a')]>0x0?_0x523481['Contact'][_0xc93b('0x13e')][_0xc93b('0x15b')](_0x5831ce[_0xc93b('0x15a')]):_0x523481[_0xc93b('0x13d')]['phone']),'callerid':_0xad6fd9,'Exten':'xcally-motion-dialer','Context':_0xc93b('0x15e'),'Priority':'1','variable':_0x310501,'timeout':(_0x5831ce[_0xc93b('0x55')]||0x1e)*0x3e8,'async':!![],'channelid':_0x98dab3})[_0xc93b('0xa9')](function(_0x252ff8){return _0x131268(_0x252ff8);})[_0xc93b('0xa1')](function(_0x524ec5){_0x5831ce['outboundOriginateFailureCallsDay']+=0x1;var _0x46d2e2=new History(_0x468957[_0xc93b('0x1f')][_0x98dab3]);logger['error'](util[_0xc93b('0x84')](_0xc93b('0x15f'),JSON[_0xc93b('0x43')](_0x524ec5)));_0x46d2e2[_0xc93b('0x97')]=0xe;_0x46d2e2[_0xc93b('0x98')]=_0xc93b('0x160');_0x46d2e2[_0xc93b('0x9a')]=moment()[_0xc93b('0x84')](_0xc93b('0xef'));_0x46d2e2[_0xc93b('0x99')]=_0x46d2e2[_0xc93b('0x9a')];_0x468957[_0xc93b('0xba')](_0x46d2e2)['catch'](loggerCatch(_0xc93b('0x161')));_0x468957[_0xc93b('0xb8')](_0x46d2e2)['catch'](loggerCatch(_0xc93b('0x161')))[_0xc93b('0x108')](function(){delete _0x468957[_0xc93b('0x1f')][_0x98dab3];return _0x47ff63(msgResponse(_0xc93b('0x13c'),_0xc93b('0x42'),_0xc93b('0x162')));});});});};Dialer[_0xc93b('0x16')]['syncOriginateResponse']=function(_0x4c65c3){var _0x440d9f=this[_0xc93b('0x1f')][_0x4c65c3[_0xc93b('0xf8')]];var _0x5bce50=this;if(_0x440d9f){delete this['actions'][_0x4c65c3[_0xc93b('0xf8')]];_0x440d9f['responsetime']=moment()['format'](_0xc93b('0xef'));var _0xee35d4=_0x440d9f[_0xc93b('0x4f')]==='ivr'?this[_0xc93b('0x1b')][_0x440d9f[_0xc93b('0xa3')]]:this['voiceQueues'][_0x440d9f[_0xc93b('0x163')]()];if(!this[_0xc93b('0x164')](_0x4c65c3[_0xc93b('0x165')])){this[_0xc93b('0xa5')](_0xee35d4);return this[_0xc93b('0x166')](_0x440d9f,_0xee35d4,_0x4c65c3)[_0xc93b('0xa9')](function(_0x302050){})['catch'](loggerCatch(_0xc93b('0x167')));}else{this['uniqueId'][_0x4c65c3[_0xc93b('0xcd')]]=_0x440d9f;}}};Dialer[_0xc93b('0x16')][_0xc93b('0x168')]=function(_0xe83acf,_0x140fd1,_0x454a1d){var _0x83ad91=new History(_0x140fd1);if(_0x83ad91['countbusyretry']+_0x83ad91['countcongestionretry']+_0x83ad91[_0xc93b('0x169')]>=_0x454a1d[_0xc93b('0x16a')]-0x1){return!![];}switch(_0xe83acf){case 0x3:if(_0x83ad91[_0xc93b('0x169')]>=_0x454a1d[_0xc93b('0x16b')]-0x1){return!![];}else{this[_0xc93b('0xb1')]({'active':![],'countnoanswerretry':_0x83ad91[_0xc93b('0x169')]+=0x1,'scheduledat':moment()[_0xc93b('0x16c')](_0x454a1d[_0xc93b('0x16d')],_0xc93b('0x16e'))[_0xc93b('0x84')](_0xc93b('0xef')),'ContactId':_0x83ad91[_0xc93b('0xc1')],'ListId':_0x83ad91[_0xc93b('0xc2')],'VoiceQueueId':_0x83ad91['VoiceQueueId']||undefined,'CampaignId':_0x83ad91[_0xc93b('0xc5')]||undefined})['catch'](loggerCatch(_0xc93b('0x16f')));}break;case 0x5:if(_0x83ad91[_0xc93b('0x170')]>=_0x454a1d[_0xc93b('0x171')]-0x1){return!![];}else{this[_0xc93b('0xb1')]({'active':![],'countbusyretry':_0x83ad91['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x454a1d[_0xc93b('0x172')],'minutes')['format'](_0xc93b('0xef')),'ContactId':_0x83ad91['ContactId'],'ListId':_0x83ad91[_0xc93b('0xc2')],'VoiceQueueId':_0x83ad91[_0xc93b('0xc4')]||undefined,'CampaignId':_0x83ad91[_0xc93b('0xc5')]||undefined})[_0xc93b('0xa1')](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x83ad91[_0xc93b('0x173')]>=_0x454a1d[_0xc93b('0x174')]-0x1){return!![];}else{this[_0xc93b('0xb1')]({'active':![],'countcongestionretry':_0x83ad91[_0xc93b('0x173')]+=0x1,'scheduledat':moment()[_0xc93b('0x16c')](_0x454a1d['dialCongestionRetryFrequency'],'minutes')[_0xc93b('0x84')](_0xc93b('0xef')),'ContactId':_0x83ad91[_0xc93b('0xc1')],'ListId':_0x83ad91[_0xc93b('0xc2')],'VoiceQueueId':_0x83ad91['VoiceQueueId']||undefined,'CampaignId':_0x83ad91[_0xc93b('0xc5')]||undefined})[_0xc93b('0xa1')](loggerCatch(_0xc93b('0x175')));}break;default:return!![];}};Dialer[_0xc93b('0x16')]['callProgressDetecting']=function(_0x37c0ba,_0x3a4973,_0x39a9e5){var _0x45902d=this;var _0x37bec0=new History(_0x37c0ba);return new BPromise(function(_0x59a661,_0x24d168){if(_[_0xc93b('0x38')](_0x3a4973)&&_0xc93b('0x13b')!==typeof _0x3a4973){return _0x24d168(msgResponse(_0xc93b('0x176'),_0xc93b('0x116'),'entity\x20is\x20undefine'));}if(_[_0xc93b('0x38')](_0x39a9e5)&&_0xc93b('0x13b')!==typeof _0x39a9e5){return _0x24d168(msgResponse(_0xc93b('0x176'),_0xc93b('0x116'),'evt\x20is\x20undefine'));}switch(_0x39a9e5[_0xc93b('0xe7')]){case'0':_0x3a4973[_0xc93b('0x60')]+=0x1;_0x37bec0[_0xc93b('0x97')]=0x0;_0x37bec0[_0xc93b('0x98')]='NoSuchNumber';_0x45902d[_0xc93b('0xba')](_0x37bec0)[_0xc93b('0xa1')](loggerCatch(_0xc93b('0x177')));if(_0x45902d['checkRetriveMax'](0x0,_0x37c0ba,_0x3a4973)){if(_0x37bec0[_0xc93b('0x170')]+_0x37bec0[_0xc93b('0x173')]+_0x37bec0[_0xc93b('0x169')]>=_0x3a4973[_0xc93b('0x16a')]){_0x45902d[_0xc93b('0x178')](_0x37bec0,_0x59a661,_0x24d168,_0xc93b('0x179'));}else{_0x45902d[_0xc93b('0x17a')](_0x37bec0,_0x59a661,_0x24d168,_0xc93b('0x179'));}}break;case'3':_0x3a4973[_0xc93b('0x5f')]+=0x1;_0x37bec0[_0xc93b('0x97')]=0x3;_0x37bec0[_0xc93b('0x98')]=_0xc93b('0x17b');_0x37bec0['countnoanswerretry']+=0x1;_0x37bec0[_0xc93b('0x17c')]+=0x1;_0x45902d[_0xc93b('0xba')](_0x37bec0)[_0xc93b('0xa1')](loggerCatch(_0xc93b('0x17d')));if(_0x45902d[_0xc93b('0x168')](0x3,_0x37c0ba,_0x3a4973)){if(_0x37bec0[_0xc93b('0x169')]>=_0x3a4973['dialNoAnswerMaxRetry']){_0x45902d[_0xc93b('0x17a')](_0x37bec0,_0x59a661,_0x24d168,_0xc93b('0x17e'));}else{_0x45902d[_0xc93b('0x178')](_0x37bec0,_0x59a661,_0x24d168,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x3a4973[_0xc93b('0x5a')]+=0x1;_0x37bec0[_0xc93b('0x97')]=0x5;_0x37bec0[_0xc93b('0x98')]=_0xc93b('0x17f');_0x37bec0[_0xc93b('0x170')]+=0x1;_0x37bec0['countglobal']+=0x1;_0x45902d[_0xc93b('0xba')](_0x37bec0)[_0xc93b('0xa1')](loggerCatch(_0xc93b('0x180')));if(_0x45902d['checkRetriveMax'](0x5,_0x37c0ba,_0x3a4973)){if(_0x37bec0[_0xc93b('0x170')]>=_0x3a4973[_0xc93b('0x171')]){_0x45902d[_0xc93b('0x17a')](_0x37bec0,_0x59a661,_0x24d168,_0xc93b('0x181'));}else{_0x45902d['stateGlobal'](_0x37bec0,_0x59a661,_0x24d168,_0xc93b('0x181'));}}break;case'8':_0x3a4973[_0xc93b('0x5b')]+=0x1;_0x37bec0[_0xc93b('0x97')]=0x8;_0x37bec0[_0xc93b('0x98')]='Congestion';_0x37bec0['countcongestionretry']+=0x1;_0x37bec0['countglobal']+=0x1;_0x45902d[_0xc93b('0xba')](_0x37bec0)[_0xc93b('0xa1')](loggerCatch(_0xc93b('0x182')));if(_0x45902d['checkRetriveMax'](0x8,_0x37c0ba,_0x3a4973)){if(_0x37bec0[_0xc93b('0x173')]>=_0x3a4973['dialCongestionMaxRetry']){_0x45902d[_0xc93b('0x17a')](_0x37bec0,_0x59a661,_0x24d168,'reason\x208\x20congestion');}else{_0x45902d[_0xc93b('0x178')](_0x37bec0,_0x59a661,_0x24d168,_0xc93b('0x183'));}}break;default:_0x3a4973[_0xc93b('0x64')]+=0x1;_0x37bec0[_0xc93b('0x97')]=0xc;_0x37bec0['statedesc']=_0x39a9e5[_0xc93b('0xe7')];_0x45902d[_0xc93b('0xba')](_0x37bec0)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x45902d[_0xc93b('0x168')](_0x39a9e5['reason'],_0x37c0ba,_0x3a4973)){if(_0x37bec0['countbusyretry']+_0x37bec0['countcongestionretry']+_0x37bec0[_0xc93b('0x169')]>=_0x3a4973[_0xc93b('0x16a')]){_0x45902d[_0xc93b('0x178')](_0x37bec0,_0x59a661,_0x24d168,_0x39a9e5['reason']);}else{_0x45902d[_0xc93b('0x17a')](_0x37bec0,_0x59a661,_0x24d168,_0x39a9e5[_0xc93b('0xe7')]);}}}});};Dialer['prototype'][_0xc93b('0x178')]=function(_0x26135a,_0x45484b,_0x14fe34,_0x23f81d){var _0x38c86e=new Final(_0x26135a);_0x38c86e[_0xc93b('0x97')]=0xf;_0x38c86e[_0xc93b('0x98')]='Global';this['createStateFinal'](_0x38c86e,_0x45484b,_0x14fe34,_0x23f81d);};Dialer[_0xc93b('0x16')][_0xc93b('0x17a')]=function(_0x34ae88,_0xbdc950,_0x37b9b3,_0x2342a3){this['moveContactManagedDialer'](_0x34ae88)[_0xc93b('0xa9')](function(_0x24b0a7){return _0xbdc950(msgResponse(_0xc93b('0x176'),_0xc93b('0xc7'),_0x2342a3));})[_0xc93b('0xa1')](function(_0x43b14c){return _0x37b9b3(msgResponse(_0xc93b('0x184'),_0xc93b('0x116'),_0xc93b('0x185')));});};Dialer[_0xc93b('0x16')][_0xc93b('0x186')]=function(_0x117d93){var _0x558d89=this;var _0x171f1b=_0x117d93[_0xc93b('0x187')]/0x64;var _0x39d8c0=_0x117d93[_0xc93b('0x5e')]/(_0x117d93[_0xc93b('0x5e')]+_0x117d93[_0xc93b('0x58')]);var _0x42ff44=_0x117d93[_0xc93b('0x4a')]-_0x117d93['predictiveIntervalPauses']-_0x117d93['waiting']-_0x117d93[_0xc93b('0x6d')]-_0x117d93[_0xc93b('0x4d')];var _0x1ecbc6=(_0x117d93[_0xc93b('0x4a')]-_0x117d93[_0xc93b('0x6c')])*_0x117d93[_0xc93b('0x188')];var _0x5dde97=Math[_0xc93b('0x189')](_0x117d93[_0xc93b('0x18a')]*_0x117d93[_0xc93b('0x18b')]*_0x117d93[_0xc93b('0x18c')]*_0x117d93[_0xc93b('0x6b')]);if(_[_0xc93b('0x38')](_0x117d93['startProgressive'])){loggerPredictive['info'](_0xc93b('0x18d'));if(!_['isUndefined'](_0x117d93[_0xc93b('0x7e')])){_0x117d93['startPredictive']=undefined;loggerPredictive[_0xc93b('0x87')](_0xc93b('0x18e'),_0xc93b('0x18f'));}if(!_[_0xc93b('0x38')](_0x117d93[_0xc93b('0x7f')])){loggerPredictive[_0xc93b('0x87')](_0xc93b('0x18e'),_0xc93b('0x190'));clearInterval(_0x117d93['handlePredictive']);_0x117d93[_0xc93b('0x7f')]=undefined;}_0x117d93[_0xc93b('0x21')]=moment()[_0xc93b('0x84')](_0xc93b('0xef'));loggerPredictive[_0xc93b('0x76')](_0xc93b('0x191'),_0x117d93[_0xc93b('0x21')],_0x117d93[_0xc93b('0x3c')]);this[_0xc93b('0x12c')](_0x117d93,0x1);}else if(ifInterval(_0x117d93[_0xc93b('0x192')],_0x117d93[_0xc93b('0x21')])){this[_0xc93b('0x12c')](_0x117d93,0x1);loggerPredictiveCalls[_0xc93b('0x76')](_0xc93b('0x193'),_0x117d93[_0xc93b('0x21')],_0x117d93['name']);_0x117d93[_0xc93b('0x18a')]=0x0;_0x117d93['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x171f1b<_0x39d8c0&&_0x117d93['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x117d93);loggerPredictive[_0xc93b('0x76')](_0xc93b('0x194'),_0xc93b('0x195'),_0x39d8c0,_0xc93b('0x21'),_0x117d93[_0xc93b('0x3c')]);}else if(_0x42ff44>_0x1ecbc6){freeVariablesPredictive(_0x117d93);loggerPredictive[_0xc93b('0x76')]('[stopMethodPredictive][ReStartProgressive][LowerLimitInterval]','Agent\x20free',_0x42ff44,_0xc93b('0x196'),_0x1ecbc6);}else if(_0x5dde97<_0x117d93[_0xc93b('0x6a')]&&_0x117d93['dialPredictiveOptimization']===_0xc93b('0x197')){freeVariablesPredictive(_0x117d93);loggerPredictive[_0xc93b('0x76')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xc93b('0x198'),_0x5dde97,_0xc93b('0x199'),_0x117d93[_0xc93b('0x6a')],_0xc93b('0x21'),_0x117d93[_0xc93b('0x3c')]);}else if(!ifInterval(_0x117d93[_0xc93b('0x192')],_0x117d93[_0xc93b('0x21')])&&_[_0xc93b('0x38')](_0x117d93[_0xc93b('0x7e')])&&!_['isUndefined'](_0x117d93[_0xc93b('0x21')])){_0x117d93[_0xc93b('0x7e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xc93b('0x76')]('[startMethodPredictive][StartPredictive][First]',_0x117d93[_0xc93b('0x7e')],_0x117d93[_0xc93b('0x3c')]);this[_0xc93b('0xae')](_0x117d93['dialPredictiveInterval'])[_0xc93b('0xa9')](this[_0xc93b('0x19a')](_0x117d93))[_0xc93b('0xa9')](mergeDataErlangB(_0x117d93))[_0xc93b('0xa9')](this[_0xc93b('0x19b')](_0x117d93))[_0xc93b('0xa1')](loggerCatchPredictive(_0xc93b('0x19c'),_0x117d93));}else if(!ifInterval(_0x117d93['dialPredictiveInterval'],_0x117d93['startPredictive'])){_0x117d93['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x117d93['startPredictive']=moment()[_0xc93b('0x84')](_0xc93b('0xef'));loggerPredictive[_0xc93b('0x76')](_0xc93b('0x19d'),_0x117d93[_0xc93b('0x7e')],_0x117d93[_0xc93b('0x3c')]);clearInterval(_0x117d93['handlePredictive']);_0x117d93['handlePredictive']=undefined;this['averageHandleTime'](_0x117d93['dialPredictiveInterval'])[_0xc93b('0xa9')](this[_0xc93b('0x19a')](_0x117d93))[_0xc93b('0xa9')](mergeDataErlangB(_0x117d93))[_0xc93b('0xa9')](this[_0xc93b('0x19b')](_0x117d93))[_0xc93b('0xa1')](loggerCatchPredictive('[averageHandleTime][ErlangB]\x20',_0x117d93));}};Dialer['prototype'][_0xc93b('0x19a')]=function(_0x3276ca){var _0x3af524=this;return function(_0x3aedd9){return new BPromise(function(_0x558cc4,_0x13da23){_[_0xc93b('0x7c')](_0x3276ca,_0x3aedd9[0x0]);if(checkGetDataPredictive(_0x3aedd9[0x0])){loggerPredictive[_0xc93b('0x76')](JSON['stringify'](_0x3aedd9[0x0]));if(_0x3276ca[_0xc93b('0x19e')]==='dropRate'){return _0x3af524[_0xc93b('0xb6')](_0x3276ca['id'])[_0xc93b('0xa9')](function(_0x2b8899){var _0x74e492=_0x3276ca[_0xc93b('0x4a')]-_0x2b8899[0x0]['outboundQueuePauses'];var _0x56cb36=_0x3276ca[_0xc93b('0x192')]*0x3c;var _0x5f27dd=_0x3aedd9[0x0][_0xc93b('0x66')]+_0x3aedd9[0x0]['predictiveIntervalAvgHoldtime'];var _0x584386=(_0x3aedd9[0x0][_0xc93b('0x65')]+_0x3aedd9[0x0][_0xc93b('0x68')]+_0x3aedd9[0x0][_0xc93b('0x67')])/_0x3aedd9[0x0][_0xc93b('0x75')];var _0x23afba=_0x3276ca[_0xc93b('0x187')]/0x64;_0x3276ca[_0xc93b('0x6c')]=_0x2b8899[0x0][_0xc93b('0x19f')]||0x0;_0x3276ca[_0xc93b('0x18c')]=_0x584386>0x0?_0x584386:0x1;return _0x3af524[_0xc93b('0x1a0')](_0x74e492,_0x56cb36,_0x5f27dd,_0x584386,_0x23afba);})[_0xc93b('0xa9')](function(_0x5d5390){return _0x558cc4(_0x5d5390);})[_0xc93b('0xa1')](function(_0x44b0f2){return _0x13da23(msgResponse(_0xc93b('0x1a1'),_0xc93b('0x116'),JSON[_0xc93b('0x43')](_0x44b0f2)));});}if(_0x3276ca[_0xc93b('0x19e')]==='agentBusyFactor'){return _0x3af524[_0xc93b('0xb6')](_0x3276ca['id'])[_0xc93b('0xa9')](function(_0x3f6f51){var _0x2db5bc=_0x3276ca['loggedIn']-_0x3f6f51[0x0][_0xc93b('0x19f')];var _0x2a829a=_0x3276ca[_0xc93b('0x192')]*0x3c;var _0x23b99e=_0x3aedd9[0x0]['predictiveIntervalAvgTalktime']+_0x3aedd9[0x0][_0xc93b('0x78')];var _0x54ae56=(_0x3aedd9[0x0][_0xc93b('0x65')]+_0x3aedd9[0x0][_0xc93b('0x68')]+_0x3aedd9[0x0][_0xc93b('0x67')])/_0x3aedd9[0x0][_0xc93b('0x75')];var _0x41d168=_0x3276ca['dialPredictiveOptimizationPercentage']/0x64;_0x3276ca[_0xc93b('0x6c')]=_0x3f6f51[0x0]['outboundQueuePauses']||0x0;_0x3276ca['predictiveIntervalHitRate']=_0x54ae56>0x0?_0x54ae56:0x1;return _0x3af524[_0xc93b('0x1a2')](_0x2db5bc,_0x2a829a,_0x23b99e,_0x54ae56,_0x41d168);})[_0xc93b('0xa9')](function(_0xdb3f4a){return _0x558cc4(_0xdb3f4a);})['catch'](function(_0x2e275b){return _0x13da23(msgResponse(_0xc93b('0x1a1'),'Failure',JSON[_0xc93b('0x43')](_0x2e275b)));});}}else{return _0x13da23(msgResponse('[getDataPredictive]','Failure',_0xc93b('0x1a3')));}});};};Dialer[_0xc93b('0x16')][_0xc93b('0x19b')]=function(_0x35a6c7){var _0x1b3e1d=this;return function(){var _0x308df5=0x0;var _0xe96889=Math[_0xc93b('0x189')](_0x35a6c7[_0xc93b('0x1a4')]*0x3e8);if(_0xe96889>0x0){_0xe96889=_0xe96889<0x64?0x64:_0xe96889;loggerPredictive['info'](_0xc93b('0x1a5'),_0xe96889);_0x35a6c7[_0xc93b('0x7f')]=setInterval(function(){_0x1b3e1d[_0xc93b('0x7f')](_0x35a6c7);loggerPredictiveCalls[_0xc93b('0x76')](_0xc93b('0x1a6'),_0x308df5+=0x1);},_0xe96889);}else{loggerPredictive['info']('[startMethodPredictive][milliseconds]\x20',_0xc93b('0x1a7'),_0xe96889);}};};Dialer[_0xc93b('0x16')][_0xc93b('0x1a8')]=function(_0xf1bcff,_0x54634a){var _0x4e8f39=this;return function(_0x133db5){if(_['isEmpty'](_0x133db5)){if(_[_0xc93b('0x9d')](_0x54634a[_0xc93b('0xc3')])||!_0x54634a[_0xc93b('0x1a9')]){if(_0xf1bcff[_0xc93b('0x53')]===_0xc93b('0x5')){_0xf1bcff['queueStatusComplete']=_[_0xc93b('0x38')](_0xf1bcff[_0xc93b('0x100')])?!![]:_0xf1bcff[_0xc93b('0x100')];var _0x15f568=uuid['v4']();_0x4e8f39[_0xc93b('0x1f')][_0x15f568]=new Action(_0xf1bcff,_0x54634a,_0x15f568);loggerBooked[_0xc93b('0x76')](_0xc93b('0x1aa'),_0x15f568,'queueStatusComplete:\x20',JSON[_0xc93b('0x43')](_0xf1bcff['queueStatusComplete']),_0xc93b('0x1ab'),_0xf1bcff[_0xc93b('0x3c')]);if(_0xf1bcff[_0xc93b('0x100')]){_0xf1bcff[_0xc93b('0x100')]=![];_0x4e8f39[_0xc93b('0xfd')][_0x4e8f39[_0xc93b('0x1f')][_0x15f568][_0xc93b('0xa3')]]=[];ami['Action']({'actionid':_0x15f568,'action':'queuestatus','queue':_0xf1bcff[_0xc93b('0x3c')]})[_0xc93b('0xa1')](function(_0xe98929){_0x4e8f39[_0xc93b('0xa5')](_0xf1bcff);_0x4e8f39[_0xc93b('0xb1')]({'active':![],'ContactId':_0x4e8f39[_0xc93b('0x1f')][_0x15f568][_0xc93b('0xc1')],'ListId':_0x4e8f39[_0xc93b('0x1f')][_0x15f568]['ListId'],'VoiceQueueId':_0x4e8f39[_0xc93b('0x1f')][_0x15f568]['VoiceQueueId']||undefined,'CampaignId':_0x4e8f39[_0xc93b('0x1f')][_0x15f568]['CampaignId']||undefined})[_0xc93b('0xa1')](loggerCatch(_0xc93b('0x1ac')));delete _0x4e8f39[_0xc93b('0x1f')][_0x15f568];});}else{loggerBooked[_0xc93b('0x76')](_0xc93b('0x1ad'),JSON[_0xc93b('0x43')](_0xf1bcff[_0xc93b('0x100')]),_0xc93b('0x1ab'),_0xf1bcff[_0xc93b('0x3c')]);_0x4e8f39[_0xc93b('0xa5')](_0xf1bcff);_0x4e8f39[_0xc93b('0xb1')]({'active':![],'ContactId':_0x4e8f39[_0xc93b('0x1f')][_0x15f568][_0xc93b('0xc1')],'ListId':_0x4e8f39[_0xc93b('0x1f')][_0x15f568][_0xc93b('0xc2')],'VoiceQueueId':_0x4e8f39[_0xc93b('0x1f')][_0x15f568][_0xc93b('0xc4')]||undefined,'CampaignId':_0x4e8f39[_0xc93b('0x1f')][_0x15f568][_0xc93b('0xc5')]||undefined})[_0xc93b('0xa1')](loggerCatch(_0xc93b('0x1ac')));delete _0x4e8f39[_0xc93b('0x1f')][_0x15f568];}}else{return _0x4e8f39[_0xc93b('0x1ae')](_0xf1bcff,_0x54634a);}}else{if(getDiff(_0x54634a[_0xc93b('0x1af')])<_0xf1bcff[_0xc93b('0x1b0')]*0x3c){_0x4e8f39[_0xc93b('0x81')][_0xc93b('0x102')](_0x54634a['id'])[_0xc93b('0x108')](function(){_0x4e8f39[_0xc93b('0xa5')](_0xf1bcff);});}else{_0xf1bcff[_0xc93b('0x62')]+=0x1;_0x4e8f39[_0xc93b('0xa5')](_0xf1bcff);if(_0xf1bcff[_0xc93b('0x1b1')]){_0x4e8f39[_0xc93b('0xb1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x54634a[_0xc93b('0xc1')],'ListId':_0x54634a[_0xc93b('0xc2')],'VoiceQueueId':_0x54634a['VoiceQueueId']||undefined,'CampaignId':_0x54634a[_0xc93b('0xc5')]||undefined})['catch'](loggerCatch(_0xc93b('0x1b2')));_0x4e8f39[_0xc93b('0xba')](createObjHistory(_0xf1bcff,_0x54634a,_0xc93b('0x1b3'),0x17,_0xc93b('0x1b4')))[_0xc93b('0xa1')](loggerCatch(_0xc93b('0x1b5')));}else{_0x4e8f39[_0xc93b('0xd8')](createObjHistory(_0xf1bcff,_0x54634a,_0xc93b('0x1b6'),0x16,_0xc93b('0x1b7')),_0xc93b('0x1b8'),_0xc93b('0x1b9'));}}}}else{_0xf1bcff[_0xc93b('0x59')]+=0x1;_0x4e8f39['saveInDb'](createObjHistory(_0xf1bcff,_0x54634a,'BLACKLIST',0xd,_0xc93b('0x1ba')),_0xc93b('0x1bb'),_0xc93b('0x1bc'));throw _0xc93b('0x1bd');}};};Dialer[_0xc93b('0x16')][_0xc93b('0x131')]=function(_0x2e2757){var _0x14fa4d=this;var _0x133407=[];var _0x23d421=_0x2e2757['limitCalls']-_0x2e2757[_0xc93b('0x6d')]-_0x2e2757['temp'];emitCampaignSummary(_0x2e2757);if(_0x23d421>0x0){if(_0x23d421>this['maxNumberOriginate']){_0x23d421=this[_0xc93b('0x1d')];}_0x2e2757[_0xc93b('0x1be')]+=_0x23d421;this[_0xc93b('0xb5')](_0x2e2757['id'],_0x23d421,_0x2e2757[_0xc93b('0x1bf')])[_0xc93b('0xa9')](function(_0x5c0d73){_0x2e2757[_0xc93b('0x1be')]-=_0x23d421;_0x2e2757[_0xc93b('0x1be')]=_0x2e2757['temp']>0x0?_0x2e2757[_0xc93b('0x1be')]:0x0;if(!checkContactEmpty(_0x5c0d73)){_0x2e2757[_0xc93b('0x39')]=_0xc93b('0x90');logger[_0xc93b('0x76')](_0xc93b('0x1c0')+_0x2e2757[_0xc93b('0x3c')]);}else{_0x2e2757[_0xc93b('0x6d')]+=_0x5c0d73['length'];_0x2e2757[_0xc93b('0x39')]='RUNNING';for(var _0x398778=0x0;_0x398778<_0x5c0d73[_0xc93b('0x88')];_0x398778+=0x1){_0x2e2757[_0xc93b('0x1c1')]+=0x1;if(_[_0xc93b('0x9d')](_0x5c0d73[_0x398778])||_[_0xc93b('0x9d')](_0x5c0d73[_0x398778]['Contact'])||_[_0xc93b('0x9d')](_0x5c0d73[_0x398778]['Contact'][_0xc93b('0x13e')])){_0x14fa4d['emptyContact'](_0xc93b('0x1c2'),_0x2e2757,_0x5c0d73[_0x398778]);}else{_0x14fa4d[_0xc93b('0xac')](_['pick'](_0x5c0d73[_0x398778],[_0xc93b('0xc5'),_0xc93b('0x1c3')]))[_0xc93b('0xa9')](_0x14fa4d[_0xc93b('0x1a8')](_0x2e2757,_0x5c0d73[_0x398778]))['catch'](_0x14fa4d[_0xc93b('0x1c4')](_0xc93b('0x1c5'),_0x2e2757));}}}})[_0xc93b('0xa1')](loggerGetContactDialer('[getContactCampaign2]',_0x2e2757,_0x23d421));}};Dialer[_0xc93b('0x16')][_0xc93b('0x12c')]=function(_0xf9f2e7,_0x5dc89e){var _0x442aa8=this;var _0xbb253c=[];var _0x28ce26=_0x5dc89e>=0x1?_0x5dc89e:0x1;var _0x1ea5ed=[];if(_0xf9f2e7[_0xc93b('0x53')]===_0xc93b('0x5')){_0x28ce26=0x1;}var _0x14c337=Math['floor'](_0xf9f2e7[_0xc93b('0x49')]*_0x28ce26)-_0xf9f2e7['originated']-_0xf9f2e7[_0xc93b('0x1be')];emitVoiceQueueSummary(_0xf9f2e7);if(_0xf9f2e7[_0xc93b('0x1c6')]>0x0){var _0x53658c=_0xf9f2e7['dialLimitQueue']-_0xf9f2e7[_0xc93b('0x6d')]-_0xf9f2e7[_0xc93b('0x4d')]-_0xf9f2e7[_0xc93b('0x1be')]-_0xf9f2e7[_0xc93b('0x92')];if(_0x14c337>_0x53658c){_0x14c337=_0x53658c;}}if(_0x14c337>0x0){if(_0xf9f2e7[_0xc93b('0x53')]==='booked'){_0x14c337=0x1;}if(_0x14c337>this[_0xc93b('0x1d')]){_0x14c337=this['maxNumberOriginate'];}_0xf9f2e7[_0xc93b('0x1be')]+=_0x14c337;for(var _0x3ec4c8 in this[_0xc93b('0xfa')]){if(this[_0xc93b('0xfa')][_0xc93b('0x89')](_0x3ec4c8)){if(this[_0xc93b('0xfa')][_0x3ec4c8]['state']==='not_inuse'&&this['agents'][_0x3ec4c8][_0xc93b('0x9f')]===_0xc93b('0xca')){_0xbb253c[_0xc93b('0xfe')](this[_0xc93b('0xfa')][_0x3ec4c8]['id']);}}}this[_0xc93b('0xb3')](_0xf9f2e7['id'],_0xbb253c,_0x14c337,_0xf9f2e7[_0xc93b('0x1bf')])[_0xc93b('0xa9')](function(_0x3f8a1e){_0xf9f2e7[_0xc93b('0x1be')]-=_0x14c337;_0xf9f2e7[_0xc93b('0x1be')]=_0xf9f2e7[_0xc93b('0x1be')]>0x0?_0xf9f2e7[_0xc93b('0x1be')]:0x0;if(!checkContactEmpty(_0x3f8a1e)){_0x442aa8['countReScheduled'](_0xf9f2e7)['then'](sendMessageReschedule(_0xf9f2e7))['catch'](loggerCatch(_0xc93b('0xaa')));}else{_0xf9f2e7['originated']+=_0x3f8a1e[_0xc93b('0x88')];_0xf9f2e7[_0xc93b('0x39')]=_0xf9f2e7[_0xc93b('0x53')]==='booked'?_0xc93b('0x1c7'):'RUNNING';for(var _0x4e29fb=0x0;_0x4e29fb<_0x3f8a1e[_0xc93b('0x88')];_0x4e29fb+=0x1){if(_[_0xc93b('0x9d')](_0x3f8a1e[_0x4e29fb])||_['isNil'](_0x3f8a1e[_0x4e29fb][_0xc93b('0x13d')])||_[_0xc93b('0x9d')](_0x3f8a1e[_0x4e29fb][_0xc93b('0x13d')][_0xc93b('0x13e')])){_0x442aa8['emptyContact'](_0xc93b('0x1c2'),_0xf9f2e7,_0x3f8a1e[_0x4e29fb]);}else{_0x442aa8['checkIsBlackList'](_['pick'](_0x3f8a1e[_0x4e29fb],[_0xc93b('0xc4'),'Contact.phone']))[_0xc93b('0xa9')](_0x442aa8['checkContactBlack'](_0xf9f2e7,_0x3f8a1e[_0x4e29fb]))[_0xc93b('0xa1')](_0x442aa8[_0xc93b('0x1c4')](_0xc93b('0x1c2'),_0xf9f2e7));}}}})[_0xc93b('0xa1')](loggerGetContactDialer('[getContactDialer2]',_0xf9f2e7,_0x14c337));}};Dialer[_0xc93b('0x16')][_0xc93b('0x7f')]=function(_0x301f82){var _0x273706=this;if(_0x301f82[_0xc93b('0x1c6')]>0x0){var _0x474119=_0x301f82[_0xc93b('0x1c6')]-_0x301f82[_0xc93b('0x6d')]-_0x301f82[_0xc93b('0x4d')];if(_0x474119>0x0){this[_0xc93b('0x1c8')](_0x301f82);}else{loggerPredictiveCalls[_0xc93b('0x76')]('[handlePredictive][limitChannel]');}}else{this[_0xc93b('0x1c8')](_0x301f82);}};Dialer['prototype'][_0xc93b('0x1c8')]=function(_0x2bfb5c){var _0x31485d=this;var _0x3e44fe=[];_0x2bfb5c[_0xc93b('0x6d')]+=0x1;for(var _0x17bfbb in this['agents']){if(this[_0xc93b('0xfa')]['hasOwnProperty'](_0x17bfbb)){if(this[_0xc93b('0xfa')][_0x17bfbb][_0xc93b('0x97')]===_0xc93b('0x1c9')&&this['agents'][_0x17bfbb][_0xc93b('0x9f')]===_0xc93b('0xca')){_0x3e44fe[_0xc93b('0xfe')](this[_0xc93b('0xfa')][_0x17bfbb]['id']);}}}this[_0xc93b('0xb3')](_0x2bfb5c['id'],_0x3e44fe,0x1,_0x2bfb5c['dialOrderByScheduledAt'])[_0xc93b('0xa9')](function(_0x5cbcdc){if(!checkContactEmpty(_0x5cbcdc)){checkContactLowerLimitOriginate(_0x2bfb5c,0x1,0x0);_0x31485d[_0xc93b('0xa7')](_0x2bfb5c)[_0xc93b('0xa9')](sendMessageReschedule(_0x2bfb5c))[_0xc93b('0xa1')](loggerCatch(_0xc93b('0xaa')));}else{_0x2bfb5c['message']='RUNNING';if(_[_0xc93b('0x9d')](_0x5cbcdc[0x0])||_[_0xc93b('0x9d')](_0x5cbcdc[0x0][_0xc93b('0x13d')])||_['isNil'](_0x5cbcdc[0x0][_0xc93b('0x13d')][_0xc93b('0x13e')])){_0x31485d['emptyContact'](_0xc93b('0x1c2'),_0x2bfb5c,_0x5cbcdc[0x0]);}else{_0x31485d[_0xc93b('0xab')](_[_0xc93b('0xc0')](_0x5cbcdc[0x0],[_0xc93b('0xc4'),_0xc93b('0x1c3')]))[_0xc93b('0xa9')](_0x31485d[_0xc93b('0x1a8')](_0x2bfb5c,_0x5cbcdc[0x0]))['catch'](_0x31485d[_0xc93b('0x1c4')]('[actionOriginatePredictive]\x20',_0x2bfb5c));}}})[_0xc93b('0xa1')](loggerGetContactDialer(_0xc93b('0x1ca'),_0x2bfb5c,0x1));emitVoiceQueueSummary(_0x2bfb5c);};Dialer[_0xc93b('0x16')][_0xc93b('0x1a0')]=function(_0x1295b4,_0x5a3d21,_0x347430,_0x46abff,_0x40c3e7,_0x383d9f){loggerPredictive[_0xc93b('0x76')](_0xc93b('0x1cb'),_0xc93b('0x1cc'),_0x1295b4,_0xc93b('0x1cd'),_0x5a3d21,_0xc93b('0x1ce'),_0x347430,_0xc93b('0x1cf'),_0x46abff,_0xc93b('0x1d0'),_0x40c3e7);return new BPromise(function(_0x1fadfb,_0x210fef){if(_0x1295b4<=0x0||isNaN(_0x1295b4)){return _0x210fef(msgResponse(_0xc93b('0x1cb'),_0xc93b('0x42'),_0xc93b('0x1d1')+_0x1295b4));}if(_0x347430<=0x0||isNaN(_0x347430)){return _0x210fef(msgResponse(_0xc93b('0x1cb'),_0xc93b('0x42'),_0xc93b('0x1d2')+_0x347430));}if(_0x46abff<=0x0||isNaN(_0x46abff)){return _0x210fef(msgResponse('[abandonmentRate]',_0xc93b('0x42'),_0xc93b('0x1d3')+_0x46abff));}if(_0x5a3d21<=0x0||isNaN(_0x5a3d21)){return _0x210fef(msgResponse('[abandonmentRate]',_0xc93b('0x42'),_0xc93b('0x1d4')+_0x5a3d21));}if(_0x40c3e7<=0x0||isNaN(_0x40c3e7)){return _0x210fef(msgResponse(_0xc93b('0x1cb'),'Error',_0xc93b('0x1d5')+_0x40c3e7));}_0x383d9f=_0x383d9f||0x0;var _0x29d14e=0x1/_0x347430;var _0x3df2d3=0x0;var _0x592d68=0x0;var _0x4fcf5a=0x0;var _0x47b34d=0x0;for(var _0x4b6ec7=0x0;_0x4fcf5a<_0x40c3e7;_0x4b6ec7+=0x1){_0x592d68=_0x4b6ec7/_0x5a3d21;_0x3df2d3=(_0x46abff*_0x592d68+_0x383d9f)/_0x29d14e;_0x4fcf5a=erlangb(_0x3df2d3,_0x1295b4);_0x47b34d=_0x3df2d3/_0x1295b4*(0x1-erlangb(_0x3df2d3,_0x1295b4));}return _0x1fadfb({'erlangCalls':_0x4b6ec7,'erlangCallToSecond':_0x5a3d21/_0x4b6ec7,'erlangAbandonmentRate':_0x4fcf5a,'erlangBusyFactor':_0x47b34d});});};Dialer[_0xc93b('0x16')]['busyFactor']=function(_0x57541f,_0x4fc3ef,_0xca1ace,_0x51ad20,_0xcb7c7f,_0x3385f9){loggerPredictive[_0xc93b('0x76')](_0xc93b('0x1d6'),_0xc93b('0x1cc'),_0x57541f,_0xc93b('0x1cd'),_0x4fc3ef,'\x20Ts\x20=\x20',_0xca1ace,'\x20p\x20=\x20',_0x51ad20,_0xc93b('0x1d7'),_0xcb7c7f);return new BPromise(function(_0x56b21b,_0x148530){if(_0x57541f<=0x0||isNaN(_0x57541f)){return _0x148530(msgResponse('[abandonmentRate]',_0xc93b('0x42'),'m\x20=\x20'+_0x57541f));}if(_0xca1ace<=0x0||isNaN(_0xca1ace)){return _0x148530(msgResponse('[abandonmentRate]',_0xc93b('0x42'),_0xc93b('0x1d2')+_0xca1ace));}if(_0x51ad20<=0x0||isNaN(_0x51ad20)){return _0x148530(msgResponse(_0xc93b('0x1cb'),_0xc93b('0x42'),_0xc93b('0x1d3')+_0x51ad20));}if(_0x4fc3ef<=0x0||isNaN(_0x4fc3ef)){return _0x148530(msgResponse(_0xc93b('0x1cb'),_0xc93b('0x42'),_0xc93b('0x1d4')+_0x4fc3ef));}if(_0xcb7c7f<=0x0||isNaN(_0xcb7c7f)){return _0x148530(msgResponse('[abandonmentRate]',_0xc93b('0x42'),_0xc93b('0x1d5')+_0xcb7c7f));}_0x3385f9=_0x3385f9||0x0;var _0x17e99b=0x1/_0xca1ace;var _0x4e8d2e=0x0;var _0x59e093=0x0;var _0x3d9488=0x0;var _0x2f4742=0x0;for(var _0x156688=0x0;_0x2f4742<_0xcb7c7f;_0x156688+=0x1){_0x59e093=_0x156688/_0x4fc3ef;_0x4e8d2e=(_0x51ad20*_0x59e093+_0x3385f9)/_0x17e99b;_0x3d9488=erlangb(_0x4e8d2e,_0x57541f);_0x2f4742=_0x4e8d2e/_0x57541f*(0x1-erlangb(_0x4e8d2e,_0x57541f));}return _0x56b21b({'erlangCalls':_0x156688,'erlangCallToSecond':_0x4fc3ef/_0x156688,'erlangAbandonmentRate':_0x3d9488,'erlangBusyFactor':_0x2f4742});});};module[_0xc93b('0x1d8')]=Dialer;
\ No newline at end of file
+var _0x5770=['idHopper','paused','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','queueStatusComplete','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','rescheduleContact','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','Action','command','interval','content','indexOf','true','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','method\x20not\x20recognized','launchHandleIvr','loggedIn','checkIfTime','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','\x5cw{0,','pow','replace','random','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','callerid','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','trim','substring','dialCutDigit','OriginateError','starttime','[originate][error]','originate\x20action\x20Error','getQueue','callProgressDetecting','[callProgressDetecting]\x20','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','[rescheduleContact][NoAnswer]','countbusyretry','dialBusyRetryFrequency','minutes','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','entity\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','[syncAgentComplete][createHistory][0]','checkRetriveMax','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','outboundNoAnswerCallsDay','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','floor','erlangAbandonmentRate','[startMethodPredictive][StartProgressive][First]','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Date]','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','erlangCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][LowerLimitInterval]','Agent\x20free','agent\x20max\x20free\x20','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','[startMethodPredictive][StartPredictive][First]','averageHandleTime','getDataPredictive','startMethodPredictive','[averageHandleTime][ErlangB]\x20','[startMethodPredictive][StartPredictive][Repeat]','outboundQueuePauses','abandonmentRate','[CatchErlangB]','agentBusyFactor','dialPredictiveOptimizationPercentage','[getDataPredictive]','check\x20failure','erlangCallToSecond','[startMethodPredictive][milliseconds]\x20','Failure\x20','checkContactBlack','recallme','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','[countReScheduled]\x20','ACTIVE','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','getContactDialer','[getContactDialerPredictive]','[abandonmentRate]','\x20m\x20=\x20','\x20Ts\x20=\x20','\x20p\x20=\x20','\x20Amax\x20=\x20','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','busyFactor','[busyFactor]','\x20interval\x20=\x20','exports','util','lodash','uuid','moment','md5','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../../../config/environment/','../ami','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','optionPredictive','startPredictive','startProgressive','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','milliseconds','seconds','emit','strategy','answered','pTalking','sumDuration','total','type','unmanaged','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','Trunk','active','stringify','format','voice_queue:save','ivr','campaign:ivr:%s','isEmpty','predictiveIntervalAvgTalktime','info','[checkGetDataPredictive][avgTalktime]','[checkGetDataPredictive][avgHoldtime]','[checkGetDataPredictive][objIsEmpty]','[checkGetDataPredictive][obj]','[ErlangB]','merge','diff','[freeVariablesPredictive]','handlePredictive','outbound','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','available','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','clearZombieChannels','uniqueId','hasOwnProperty','isNil','status','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','then','countReScheduled','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','resolve','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','[rescheduleContact]\x20','getContactDialerIvr','[getContactDialer]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','isTrunkReachable','SIP/%s','reachable','unmonitored','syncVarSet','variable','amdstatus','exten','dialAMDActive','HANGUP','uniqueid','outboundAnswerAgiCallsDay','statedesc','HangupInAMD','membername','[syncHangupInAMD]','MACHINE','Machine','AMD','amd','[syncMachine]','value','[syncHangupInAMDIvr][createHistory]','[syncMachineIvr][createHistory]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','Drop','dropreason','TIMEOUT','Abandoned','CALLEREXIT','channel','actionid','locked','stateinterface','queueBooked','push'];(function(_0x1f530d,_0x18a19e){var _0x22103f=function(_0x2664c5){while(--_0x2664c5){_0x1f530d['push'](_0x1f530d['shift']());}};_0x22103f(++_0x18a19e);}(_0x5770,0xe2));var _0x0577=function(_0x92b797,_0x1fcc80){_0x92b797=_0x92b797-0x0;var _0x201327=_0x5770[_0x92b797];return _0x201327;};'use strict';var util=require(_0x0577('0x0'));var _=require(_0x0577('0x1'));var BPromise=require('bluebird');var uuid=require(_0x0577('0x2'));var moment=require(_0x0577('0x3'));var rr=require('rr');var md5=require(_0x0577('0x4'));var logger=require(_0x0577('0x5'))(_0x0577('0x6'));var loggerBooked=require(_0x0577('0x5'))(_0x0577('0x7'));var loggerPredictive=require(_0x0577('0x5'))(_0x0577('0x8'));var loggerPredictiveCalls=require(_0x0577('0x5'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x0577('0x5'))(_0x0577('0x9'));var config=require(_0x0577('0xa'));var ami=require(_0x0577('0xb'));var io=require(_0x0577('0xc'))({'host':'localhost','port':0x18eb});var cmHopper=require(_0x0577('0xd'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x0577('0xe'));var cmHopperBlack=require(_0x0577('0xf'));var voiceQueueRt=require(_0x0577('0x10'));var Action=require(_0x0577('0x11'));var History=require(_0x0577('0x12'));var Final=require(_0x0577('0x13'));var AgentComplete=require(_0x0577('0x14'));var QueueCallerAbandon=require(_0x0577('0x15'));var Hangup=require(_0x0577('0x16'));var ipAgi=process[_0x0577('0x17')][_0x0577('0x18')]||_0x0577('0x19');var strategy={'rrmemory':_0x0577('0x1a'),'roundrobin':_0x0577('0x1b')};var Sequence=function(){};Sequence[_0x0577('0x1c')][_0x0577('0x1d')]=function(_0x183203){this[_0x0577('0x1e')]=this[_0x0577('0x1e')]?this['tail'][_0x0577('0x1f')](_0x183203):_0x183203();};function Dialer(_0x407b3a,_0x32d074){this[_0x0577('0x20')]=new Sequence();this[_0x0577('0x21')]=_0x32d074;this[_0x0577('0x22')]=_0x407b3a['voiceQueues'];this[_0x0577('0x23')]=_0x407b3a[_0x0577('0x23')];this[_0x0577('0x24')]=_0x407b3a['agents'];this[_0x0577('0x25')]=_0x407b3a[_0x0577('0x25')];this['maxNumberOriginate']=config[_0x0577('0x26')]||0x2;this['channels']={};this[_0x0577('0x27')]={};this['contactsId']={};this['uniqueId']={};this[_0x0577('0x28')]={};this[_0x0577('0x29')]={};this[_0x0577('0x2a')]={};this['ivrOriginated']={};this['queueBooked']={};this[_0x0577('0x2b')]={};ami['on'](_0x0577('0x2c'),this[_0x0577('0x2d')][_0x0577('0x2e')](this));ami['on'](_0x0577('0x2f'),this[_0x0577('0x30')][_0x0577('0x2e')](this));ami['on']('originateresponse',this[_0x0577('0x31')]['bind'](this));ami['on'](_0x0577('0x32'),this[_0x0577('0x33')]['bind'](this));ami['on'](_0x0577('0x34'),this[_0x0577('0x9')][_0x0577('0x2e')](this));ami['on'](_0x0577('0x35'),this[_0x0577('0x36')][_0x0577('0x2e')](this));ami['on'](_0x0577('0x37'),this[_0x0577('0x38')][_0x0577('0x2e')](this));ami['on'](_0x0577('0x39'),this['syncVarSet'][_0x0577('0x2e')](this));ami['on'](_0x0577('0x3a'),this[_0x0577('0x3b')][_0x0577('0x2e')](this));ami['on'](_0x0577('0x3c'),this['syncQueueStatusComplete']['bind'](this));this[_0x0577('0x3d')]();this[_0x0577('0x3e')]();}function isNotNull(_0x38deea){return _0x38deea!==null&&!_[_0x0577('0x3f')](_0x38deea);}function checkIsLoggedIn(_0x109d74,_0x3b779e){return function(){if(_0x3b779e<=0x0){_0x109d74[_0x0577('0x40')]='AGENTS_NOT_LOGGED';throw _0x109d74[_0x0577('0x41')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x291a7e){return _0x291a7e;}function checkIsActive(_0x138fc9,_0x208ba4){return function(){if(!isActive(_0x208ba4)){_0x138fc9[_0x0577('0x40')]='NOT_ACTIVE';throw _0x138fc9[_0x0577('0x41')]+_0x0577('0x42');}};}function checkInterval(_0x41edbc){return function(){if(!isNotNull(_0x41edbc[_0x0577('0x43')])){_0x41edbc['message']=_0x0577('0x44');throw _0x41edbc[_0x0577('0x41')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x41edbc[_0x0577('0x43')]['Intervals'])){_0x41edbc[_0x0577('0x40')]=_0x0577('0x44');throw _0x41edbc[_0x0577('0x41')]+_0x0577('0x45');}if(!isNotNull(_['isEmpty'](_0x41edbc[_0x0577('0x43')][_0x0577('0x46')]))){_0x41edbc[_0x0577('0x40')]=_0x0577('0x44');throw _0x41edbc[_0x0577('0x41')]+_0x0577('0x45');}};}function msgResponse(_0xedca00,_0x4fe636,_0x5e0bed){return{'action':_0xedca00,'response':_0x4fe636,'message':_0x5e0bed};}function myreject(_0x1be93f){return function(_0x3e1b51){return _0x1be93f(msgResponse(_0x0577('0x47'),_0x0577('0x48'),JSON['stringify'](_0x3e1b51)));};}function getSeconds(_0x3a75b9,_0x51f9d0){var _0x1d1461=moment(_0x3a75b9)['milliseconds'](0x0);var _0x21ecd0=moment(_0x51f9d0)[_0x0577('0x49')](0x0);return _0x1d1461['diff'](_0x21ecd0,_0x0577('0x4a'));}function emit(_0x534411,_0x24c6ce,_0x2a95e3){io['to'](_0x534411)[_0x0577('0x4b')](_0x24c6ce,_0x2a95e3);}function emitVoiceQueueSummary(_0xcb97aa){if(_0xcb97aa['type']==='outbound'){var _0x5e2e85={'id':_0xcb97aa['id'],'name':_0xcb97aa[_0x0577('0x41')],'strategy':_0xcb97aa[_0x0577('0x4c')],'answered':_0xcb97aa[_0x0577('0x4d')],'available':_0xcb97aa['available'],'loggedIn':_0xcb97aa['loggedIn'],'pTalking':_0xcb97aa[_0x0577('0x4e')],'sumBillable':_0xcb97aa['sumBillable'],'sumDuration':_0xcb97aa[_0x0577('0x4f')],'sumHoldTime':_0xcb97aa['sumHoldTime']||0x0,'talking':_0xcb97aa['talking'],'total':_0xcb97aa[_0x0577('0x50')],'type':_0xcb97aa[_0x0577('0x51')],'unmanaged':_0xcb97aa[_0x0577('0x52')],'waiting':_0xcb97aa['waiting'],'loggedInDb':_0xcb97aa[_0x0577('0x53')],'dialActive':_0xcb97aa[_0x0577('0x54')],'dialMethod':_0xcb97aa[_0x0577('0x55')],'dialOriginateCallerIdName':_0xcb97aa[_0x0577('0x56')],'dialOriginateCallerIdNumber':_0xcb97aa[_0x0577('0x57')],'dialOriginateTimeout':_0xcb97aa[_0x0577('0x58')],'dialPrefix':_0xcb97aa[_0x0577('0x59')],'outboundAnswerAgiCallsDay':_0xcb97aa['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0xcb97aa[_0x0577('0x5a')],'outboundBlacklistCallsDay':_0xcb97aa[_0x0577('0x5b')],'outboundBusyCallsDay':_0xcb97aa['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0xcb97aa[_0x0577('0x5c')],'outboundDropCallsDayACS':_0xcb97aa['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0xcb97aa[_0x0577('0x5d')],'outboundDropCallsDayTimeout':_0xcb97aa[_0x0577('0x5e')],'outboundNoAnswerCallsDay':_0xcb97aa['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0xcb97aa['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0xcb97aa[_0x0577('0x5f')],'outboundReCallsDay':_0xcb97aa[_0x0577('0x60')],'outboundRejectCallsDay':_0xcb97aa[_0x0577('0x61')],'outboundUnknownCallsDay':_0xcb97aa['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0xcb97aa[_0x0577('0x62')],'predictiveIntervalAvgHoldtime':_0xcb97aa[_0x0577('0x63')],'predictiveIntervalAvgTalktime':_0xcb97aa['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0xcb97aa[_0x0577('0x64')],'predictiveIntervalDroppedCallsTimeout':_0xcb97aa[_0x0577('0x65')],'predictiveIntervalErlangCalls':_0xcb97aa[_0x0577('0x66')],'predictiveIntervalErlangCallsDroppedCalls':_0xcb97aa[_0x0577('0x67')],'predictiveIntervalHitRate':_0xcb97aa[_0x0577('0x68')],'predictiveIntervalLowerLimit':_0xcb97aa[_0x0577('0x69')],'predictiveIntervalMultiplicativeFactor':_0xcb97aa[_0x0577('0x6a')],'predictiveIntervalPauses':_0xcb97aa[_0x0577('0x6b')],'predictiveIntervalTotalCalls':_0xcb97aa[_0x0577('0x6c')],'message':_0xcb97aa[_0x0577('0x40')],'originated':_0xcb97aa[_0x0577('0x6d')]};if(_0xcb97aa['Trunk']){_0x5e2e85[_0x0577('0x6e')]={'id':_0xcb97aa[_0x0577('0x6e')]['id'],'name':_0xcb97aa[_0x0577('0x6e')][_0x0577('0x41')],'active':_0xcb97aa['Trunk'][_0x0577('0x6f')],'callerid':_0xcb97aa['Trunk']['callerid']};}if(_0xcb97aa[_0x0577('0x43')]){_0x5e2e85[_0x0577('0x43')]={'id':_0xcb97aa['Interval']['id'],'name':_0xcb97aa[_0x0577('0x43')][_0x0577('0x41')]};}var _0x20b759=md5(JSON[_0x0577('0x70')](_0x5e2e85));if(_0xcb97aa['md5']!==_0x20b759){_0xcb97aa['md5']=_0x20b759;emit(util[_0x0577('0x71')]('voice:queue:%s',_0x5e2e85[_0x0577('0x41')]),_0x0577('0x72'),_0x5e2e85);}}}function emitCampaignSummary(_0x5e0015){if(_0x5e0015['type']===_0x0577('0x73')){emit(util[_0x0577('0x71')](_0x0577('0x74'),_0x5e0015[_0x0577('0x41')]),'campaign:save',_0x5e0015);}}function checkGetDataPredictive(_0x3e5899){if(isNotNull(_0x3e5899)){if(!_[_0x0577('0x75')](_0x3e5899)){if(_0x3e5899[_0x0577('0x6c')]>0x0){if(!_[_0x0577('0x3f')](_0x3e5899[_0x0577('0x76')])&&_0x3e5899['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0x0577('0x77')](_0x0577('0x78'),JSON[_0x0577('0x70')](_0x3e5899));}if(!_[_0x0577('0x3f')](_0x3e5899['predictiveIntervalAvgHoldtime'])&&_0x3e5899['predictiveIntervalAvgHoldtime']>0x0){return!![];}else{loggerPredictive[_0x0577('0x77')](_0x0577('0x79'),JSON['stringify'](_0x3e5899));}}else{loggerPredictive[_0x0577('0x77')]('[checkGetDataPredictive][totalCalls]',JSON['stringify'](_0x3e5899));}}else{loggerPredictive[_0x0577('0x77')](_0x0577('0x7a'),JSON[_0x0577('0x70')](_0x3e5899));}}else{loggerPredictive[_0x0577('0x77')](_0x0577('0x7b'),JSON[_0x0577('0x70')](_0x3e5899));}return![];}function mergeDataErlangB(_0x6dff87){return function(_0x585cb6){loggerPredictive['info'](_0x0577('0x7c'),JSON[_0x0577('0x70')](_0x585cb6));_[_0x0577('0x7d')](_0x6dff87,_0x585cb6);};}function getDiff(_0x394538){var _0xf073f7=moment()[_0x0577('0x49')](0x0);var _0x160d6c=moment(_0x394538)[_0x0577('0x49')](0x0);return _0xf073f7[_0x0577('0x7e')](_0x160d6c,_0x0577('0x4a'));}function ifInterval(_0x35e671,_0x41c76){if(_['isUndefined'](_0x41c76)){return![];}if(getDiff(_0x41c76)<_0x35e671*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x2a551c){if(isNotNull(_0x2a551c)){if(!_[_0x0577('0x3f')](_0x2a551c['startProgressive'])){_0x2a551c[_0x0577('0x2a')]=undefined;loggerPredictive['info']('[freeVariablesPredictive]',_0x0577('0x2a'),_0x2a551c[_0x0577('0x41')]);}if(!_[_0x0577('0x3f')](_0x2a551c['startPredictive'])){_0x2a551c[_0x0577('0x29')]=undefined;loggerPredictive[_0x0577('0x77')](_0x0577('0x7f'),_0x0577('0x29'),_0x2a551c[_0x0577('0x41')]);}if(!_['isUndefined'](_0x2a551c[_0x0577('0x80')])){clearInterval(_0x2a551c[_0x0577('0x80')]);_0x2a551c[_0x0577('0x80')]=undefined;loggerPredictive[_0x0577('0x77')](_0x0577('0x7f'),_0x0577('0x80'),_0x2a551c[_0x0577('0x41')]);}}}function erlangb(_0xd14c07,_0x1faa2b){if(_0x1faa2b===0x0){return 0x0;}var _0x25a9e7=0x1;for(var _0x17ac43=0x1;_0x17ac43<=_0x1faa2b;_0x17ac43+=0x1){_0x25a9e7=0x1+_0x25a9e7*_0x17ac43/_0xd14c07;}return 0x1/_0x25a9e7;}function isVoiceQueueOutbound(_0x124272){return _0x124272===_0x0577('0x81');}function isNotPreview(_0x312848){return _0x312848!==_0x0577('0x21');}function isCampaignIvr(_0xcd6594){return _0xcd6594===_0x0577('0x73');}function getCallerId(_0x5b7097,_0x37b9b8,_0x318124){if(!_['isUndefined'](_0x318124)&&'string'===typeof _0x318124&&!_[_0x0577('0x75')](_0x318124)){if(!_[_0x0577('0x3f')](_0x37b9b8)&&_0x0577('0x82')===typeof _0x37b9b8&&!_['isEmpty'](_0x37b9b8)){return util[_0x0577('0x71')](_0x0577('0x83'),_0x37b9b8,_0x318124);}return util[_0x0577('0x71')](_0x0577('0x83'),_0x318124,_0x318124);}if(!_[_0x0577('0x3f')](_0x5b7097)&&'string'===typeof _0x5b7097&&!_[_0x0577('0x75')](_0x5b7097)){return _0x5b7097;}return _0x0577('0x84');}function loggerCatchQueueSummary(_0x1549a6,_0x12978c){return function(_0x1474b3){freeVariablesPredictive(_0x12978c);emitVoiceQueueSummary(_0x12978c);emitCampaignSummary(_0x12978c);loggerSyncQueueSummary['error'](_0x1549a6,util[_0x0577('0x85')](_0x1474b3,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x22da51,_0x33ec2a){return function(_0x3a3cf7){loggerPredictive[_0x0577('0x86')](_0x22da51,JSON[_0x0577('0x70')](_0x3a3cf7));freeVariablesPredictive(_0x33ec2a);};}function loggerCatch(_0x3629c2){return function(_0x510b9a){logger['error'](_0x3629c2,util['inspect'](_0x510b9a,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x327758){return _0x327758&&!_[_0x0577('0x3f')](_0x327758)&&_0x327758[_0x0577('0x87')]>0x0;}function decremetOriginate(_0x40152f){if(!_[_0x0577('0x3f')](_0x40152f)&&_0x40152f!==null){if(_0x40152f['hasOwnProperty'](_0x0577('0x6d'))){if(_0x40152f[_0x0577('0x6d')]>0x0){_0x40152f[_0x0577('0x6d')]-=0x1;}else{logger[_0x0577('0x86')](_0x0577('0x88'));}}}else{logger[_0x0577('0x86')](_0x0577('0x89'));}}function checkContactLowerLimitOriginate(_0x1cc12f,_0x48523d,_0x4d64d5){if(_0x48523d>_0x4d64d5){for(var _0x2c183c=0x0;_0x2c183c<_0x48523d-_0x4d64d5;_0x2c183c+=0x1){decremetOriginate(_0x1cc12f);}}}function loggerGetContactDialer(_0x1f981c,_0x4e3db1,_0x446305){return function(_0x5e2035){checkContactLowerLimitOriginate(_0x4e3db1,_0x446305,0x0);logger[_0x0577('0x86')](_0x1f981c,util[_0x0577('0x85')](_0x5e2035,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x225e40){return function(_0x296511){if(isNotNull(_0x296511)&&isNotNull(_0x296511[0x0])){if(_0x296511[0x0]['contactsRescheduled']>0x0){_0x225e40[_0x0577('0x40')]=_0x0577('0x8a');logger[_0x0577('0x77')](_0x0577('0x8b')+_0x225e40[_0x0577('0x41')],_0x296511[0x0][_0x0577('0x8c')],'contacts');}else{_0x225e40[_0x0577('0x40')]=_0x0577('0x8d');logger[_0x0577('0x77')](_0x0577('0x8e')+_0x225e40['name']);}}};}function notSendMessagesQueue(_0x14b874){if(_0x14b874[_0x0577('0x8f')]){freeVariablesPredictive(_0x14b874);if(_0x14b874[_0x0577('0x6d')]===0x0&&_0x14b874[_0x0577('0x90')]===0x0&&_0x14b874['waiting']===0x0&&(_0x14b874['pTalking']||0x0)===0x0){_0x14b874['sendMessageOneNotActive']=![];_0x14b874[_0x0577('0x91')]=0x0;_0x14b874['message']=_0x0577('0x92');loggerSyncQueueSummary[_0x0577('0x86')](_0x0577('0x93'),_0x14b874['name'],_0x0577('0x94'));}else{_0x14b874['message']=_0x0577('0x95');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x14b874['name'],_0x0577('0x96'));}emitVoiceQueueSummary(_0x14b874);}}function notSendMessagesCampaign(_0x5d0b72){if(_0x5d0b72[_0x0577('0x8f')]){if(_0x5d0b72['originated']===0x0){_0x5d0b72[_0x0577('0x8f')]=![];_0x5d0b72['message']=_0x0577('0x92');loggerSyncQueueSummary['error'](_0x0577('0x97'),_0x5d0b72[_0x0577('0x41')],_0x0577('0x94'));}else{_0x5d0b72[_0x0577('0x40')]=_0x0577('0x95');loggerSyncQueueSummary[_0x0577('0x86')](_0x0577('0x97'),_0x5d0b72[_0x0577('0x41')],'is\x20disactive');}emitCampaignSummary(_0x5d0b72);}}function createObjHistory(_0x59f743,_0x3c845b,_0x183731,_0x3ad889,_0x1b6fe5){_0x59f743[_0x0577('0x40')]=_0x183731;var _0x337d59=new Action(_0x59f743,_0x3c845b);var _0x2f016a=new History(_0x337d59);_0x2f016a[_0x0577('0x98')]=_0x3ad889;_0x2f016a['statedesc']=_0x1b6fe5;_0x2f016a[_0x0577('0x99')]=_0x337d59['starttime'];return _0x2f016a;}Dialer['prototype'][_0x0577('0x3e')]=function(){var _0x5f44a5=this;setInterval(function(){_0x5f44a5[_0x0577('0x9a')](_0x5f44a5[_0x0577('0x9b')],'[uniqueid]');_0x5f44a5['clearZombieChannels'](_0x5f44a5['actions'],'[actions]');},0x32c8);};Dialer[_0x0577('0x1c')][_0x0577('0x9a')]=function(_0x400508,_0x427b4f){var _0x4e681b=this;for(var _0x46a4e8 in _0x400508){if(_0x400508[_0x0577('0x9c')](_0x46a4e8)){this[_0x0577('0x20')][_0x0577('0x1d')](function(){if(!_[_0x0577('0x9d')](_0x400508[_0x46a4e8])){return ami['Action']({'action':_0x0577('0x9e'),'channel':_0x400508[_0x46a4e8]['channel']})[_0x0577('0x9f')](function(_0x49f23a){if(_0x49f23a[_0x0577('0x40')]===_0x0577('0xa0')){setTimeout(function(){if(_0x400508[_0x46a4e8]&&_0x400508[_0x46a4e8]['type']!==_0x0577('0x73')){_0x4e681b[_0x0577('0xa1')](_0x4e681b[_0x0577('0x22')][_0x400508[_0x46a4e8][_0x0577('0xa2')]]);logger[_0x0577('0x86')](_0x0577('0xa3'),_0x427b4f,_0x46a4e8,_0x400508[_0x46a4e8]['queue']);delete _0x400508[_0x46a4e8];}if(_0x400508[_0x46a4e8]&&_0x400508[_0x46a4e8][_0x0577('0x51')]==='ivr'){_0x4e681b['updateOriginated'](_0x4e681b[_0x0577('0x23')][_0x400508[_0x46a4e8][_0x0577('0xa2')]]);logger[_0x0577('0x86')](_0x0577('0xa4'),_0x427b4f,_0x46a4e8,_0x400508[_0x46a4e8][_0x0577('0xa2')]);delete _0x400508[_0x46a4e8];}},0x2328);}});}});}}};Dialer[_0x0577('0x1c')]['countReScheduled']=function(_0x3d996f){return BPromise['resolve']()[_0x0577('0xa5')](cmHopper[_0x0577('0xa6')](_0x3d996f))['catch'](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype'][_0x0577('0xa7')]=function(_0x55f385){return BPromise['resolve']()[_0x0577('0xa5')](cmHopperBlack[_0x0577('0xa7')](_0x55f385))['catch'](loggerCatch(_0x0577('0xa8')));};Dialer[_0x0577('0x1c')][_0x0577('0xa9')]=function(_0x4af7e5){return BPromise[_0x0577('0xaa')]()['then'](cmHopperBlack[_0x0577('0xa9')](_0x4af7e5))['catch'](loggerCatch(_0x0577('0xab')));};Dialer[_0x0577('0x1c')]['averageHandleTime']=function(_0x59ff7e){return BPromise[_0x0577('0xaa')]()[_0x0577('0xa5')](cmHopperHistory[_0x0577('0xac')](_0x59ff7e))[_0x0577('0x9f')](loggerCatch(_0x0577('0xad')));};Dialer['prototype']['rescheduleContact']=function(_0x373ebe){return BPromise['resolve']()[_0x0577('0xa5')](cmHopper['rescheduleContact'](_0x373ebe))['catch'](loggerCatch(_0x0577('0xae')));};Dialer[_0x0577('0x1c')]['getContactDialer']=function(_0x13da2d,_0x20f378,_0x313a61,_0x3bb75f){return BPromise[_0x0577('0xaa')]()[_0x0577('0xa5')](cmHopper['getContactDialer'](_0x13da2d,_0x20f378,_0x313a61,_0x3bb75f))['catch'](loggerCatch('[getContactDialer]\x20'));};Dialer[_0x0577('0x1c')][_0x0577('0xaf')]=function(_0x323d1b,_0x1af8ae,_0x43f316){return BPromise['resolve']()['then'](cmHopper['getContactDialerIvr'](_0x323d1b,_0x1af8ae,_0x43f316))[_0x0577('0x9f')](loggerCatch(_0x0577('0xb0')));};Dialer[_0x0577('0x1c')][_0x0577('0xb1')]=function(_0x59c70b){return BPromise['resolve']()[_0x0577('0xa5')](voiceQueueRt[_0x0577('0xb1')](_0x59c70b))[_0x0577('0x9f')](loggerCatch(_0x0577('0xb2')));};Dialer[_0x0577('0x1c')]['moveContactManagedDialer']=function(_0x868faf){return BPromise[_0x0577('0xaa')]()[_0x0577('0xa5')](cmHopper[_0x0577('0xb3')](_0x868faf))[_0x0577('0x9f')](loggerCatch(_0x0577('0xb4')));};Dialer[_0x0577('0x1c')]['createHistory']=function(_0x32e41e){return BPromise[_0x0577('0xaa')]()[_0x0577('0xa5')](cmHopperHistory[_0x0577('0xb5')](_0x32e41e))[_0x0577('0x9f')](loggerCatch(_0x0577('0xb6')));};Dialer[_0x0577('0x1c')]['updateOriginated']=function(_0x54d1b1){if(!_[_0x0577('0x3f')](_0x54d1b1)&&_0x54d1b1!==null){if(_0x54d1b1[_0x0577('0x9c')](_0x0577('0x6d'))){if(_0x54d1b1[_0x0577('0x6d')]>0x0){_0x54d1b1[_0x0577('0x6d')]-=0x1;}else{logger[_0x0577('0x86')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x0577('0x86')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x0577('0x1c')][_0x0577('0xb7')]=function(_0x2c95f2,_0x4fbde6){var _0xc815c8=this;return function(_0x9ce7e4){_0xc815c8[_0x0577('0xa1')](_0x4fbde6);logger[_0x0577('0x86')](_0x2c95f2,util[_0x0577('0x85')](_0x9ce7e4,{'showHidden':![],'depth':null}));};};Dialer[_0x0577('0x1c')][_0x0577('0xb8')]=function(_0x599a36,_0x425a89,_0x116b30){var _0x3a2741={'state':0x19,'statedesc':_0x0577('0xb9')};this[_0x0577('0xa1')](_0x425a89);this[_0x0577('0xba')](_[_0x0577('0x7d')](_0x3a2741,_[_0x0577('0xbb')](_0x116b30,[_0x0577('0xbc'),_0x0577('0xbd'),_0x0577('0xbe'),_0x0577('0xbf'),_0x0577('0xc0')])),_0x0577('0xc1'),'[emptyContact]');logger[_0x0577('0x86')](_0x599a36);};Dialer[_0x0577('0x1c')][_0x0577('0xc2')]=function(_0x414d2b){return _0x414d2b==='Success';};Dialer[_0x0577('0x1c')][_0x0577('0xc3')]=function(_0x31feab){return!_[_0x0577('0x3f')](_0x31feab)&&_0x31feab&&!_[_0x0577('0x3f')](_0x31feab[_0x0577('0x41')])&&!_[_0x0577('0x3f')](_0x31feab[_0x0577('0x6f')])&&_0x31feab[_0x0577('0x6f')]&&(this[_0x0577('0x25')][util[_0x0577('0x71')](_0x0577('0xc4'),_0x31feab[_0x0577('0x41')])][_0x0577('0x9e')]===_0x0577('0xc5')||this[_0x0577('0x25')][util[_0x0577('0x71')](_0x0577('0xc4'),_0x31feab['name'])][_0x0577('0x9e')]===_0x0577('0xc6'));};Dialer['prototype'][_0x0577('0xba')]=function(_0xccb231,_0x189ae1,_0x2c4d72){this[_0x0577('0xb5')](_0xccb231)[_0x0577('0x9f')](loggerCatch(_0x189ae1));this['moveContactManagedDialer'](_0xccb231)[_0x0577('0x9f')](loggerCatch(_0x2c4d72));};Dialer[_0x0577('0x1c')][_0x0577('0xc7')]=function(_0x264752){var _0x48f16f=this['uniqueId'][_0x264752['uniqueid']];var _0x3472df;if(!_[_0x0577('0x9d')](_0x264752)&&!_['isNil'](_0x264752[_0x0577('0xc8')])&&!_[_0x0577('0x9d')](_0x264752[_0x0577('0xc8')][_0x0577('0xc9')])&&_0x264752[_0x0577('0xca')]==='xcally-motion-dialer'&&_0x48f16f){if(_0x48f16f[_0x0577('0x51')]!==_0x0577('0x73')&&this[_0x0577('0x22')][_0x48f16f[_0x0577('0xa2')]][_0x0577('0xcb')]&&_0x264752['value']===_0x0577('0xcc')){delete this['uniqueId'][_0x264752[_0x0577('0xcd')]];this['updateOriginated'](this[_0x0577('0x22')][_0x48f16f['queue']]);this['voiceQueues'][_0x48f16f[_0x0577('0xa2')]][_0x0577('0x5a')]+=0x1;this[_0x0577('0x22')][_0x48f16f[_0x0577('0xa2')]][_0x0577('0xce')]+=0x1;_0x3472df=new Hangup(_0x48f16f,_0x264752);_0x3472df[_0x0577('0x98')]=0x12;_0x3472df[_0x0577('0xcf')]=_0x0577('0xd0');_0x3472df[_0x0577('0xd1')]='AMD';this[_0x0577('0xba')](_0x3472df,'[syncHangupInAMD][createHistory]',_0x0577('0xd2'));}if(_0x48f16f[_0x0577('0x51')]!==_0x0577('0x73')&&this[_0x0577('0x22')][_0x48f16f[_0x0577('0xa2')]][_0x0577('0xcb')]&&_0x264752['value']===_0x0577('0xd3')){delete this['uniqueId'][_0x264752['uniqueid']];this[_0x0577('0xa1')](this[_0x0577('0x22')][_0x48f16f[_0x0577('0xa2')]]);this[_0x0577('0x22')][_0x48f16f[_0x0577('0xa2')]][_0x0577('0x5a')]+=0x1;this[_0x0577('0x22')][_0x48f16f[_0x0577('0xa2')]][_0x0577('0xce')]+=0x1;_0x3472df=new Hangup(_0x48f16f,_0x264752);_0x3472df[_0x0577('0x98')]=0x13;_0x3472df[_0x0577('0xcf')]=_0x0577('0xd4');_0x3472df[_0x0577('0xd1')]=_0x0577('0xd5');_0x3472df[_0x0577('0xd6')]=!![];this[_0x0577('0xba')](_0x3472df,'[syncMachine][createHistory]',_0x0577('0xd7'));}if(_0x48f16f[_0x0577('0x51')]==='ivr'&&this[_0x0577('0x23')][_0x48f16f[_0x0577('0xa2')]][_0x0577('0xcb')]&&_0x264752[_0x0577('0xd8')]===_0x0577('0xcc')){delete this[_0x0577('0x9b')][_0x264752[_0x0577('0xcd')]];this['updateOriginated'](this[_0x0577('0x23')][_0x48f16f[_0x0577('0xa2')]]);_0x3472df=new Hangup(_0x48f16f,_0x264752);_0x3472df[_0x0577('0x98')]=0x12;_0x3472df['statedesc']=_0x0577('0xd0');_0x3472df[_0x0577('0xd1')]='AMD';this[_0x0577('0xba')](_0x3472df,_0x0577('0xd9'),'[syncHangupInAMDIvr]');}if(_0x48f16f[_0x0577('0x51')]==='ivr'&&this[_0x0577('0x23')][_0x48f16f['queue']][_0x0577('0xcb')]&&_0x264752[_0x0577('0xd8')]===_0x0577('0xd3')){delete this[_0x0577('0x9b')][_0x264752[_0x0577('0xcd')]];this['updateOriginated'](this[_0x0577('0x23')][_0x48f16f[_0x0577('0xa2')]]);_0x3472df=new Hangup(_0x48f16f,_0x264752);_0x3472df['state']=0x13;_0x3472df[_0x0577('0xcf')]=_0x0577('0xd4');_0x3472df[_0x0577('0xd1')]='AMD';_0x3472df[_0x0577('0xd6')]=!![];this[_0x0577('0xba')](_0x3472df,_0x0577('0xda'),'[syncMachineIvr]');}}};Dialer[_0x0577('0x1c')][_0x0577('0x36')]=function(_0x5104de){var _0x1f1188=this[_0x0577('0x9b')][_0x5104de['uniqueid']];var _0x1f64e5=this;var _0x32fa4a;if(_0x1f1188&&_0x1f1188[_0x0577('0x51')]===_0x0577('0x73')){delete this['uniqueId'][_0x5104de[_0x0577('0xcd')]];this[_0x0577('0xa1')](this[_0x0577('0x23')][_0x1f1188[_0x0577('0xa2')]]);this[_0x0577('0x23')][_0x1f1188[_0x0577('0xa2')]][_0x0577('0xdb')]+=0x1;_0x32fa4a=new Hangup(_0x1f1188,_0x5104de);this['createHistory'](_0x32fa4a)[_0x0577('0x9f')](loggerCatch(_0x0577('0xdc')));this['moveContactManagedDialer'](_0x32fa4a)[_0x0577('0x9f')](loggerCatch('[syncHangupIvr]'));}if(_0x1f1188&&_0x1f1188[_0x0577('0x51')]!==_0x0577('0x73')&&isNotNull(this[_0x0577('0x22')][_0x1f1188[_0x0577('0xa2')]][_0x0577('0xdd')])){delete this[_0x0577('0x9b')][_0x5104de[_0x0577('0xcd')]];this[_0x0577('0xa1')](this[_0x0577('0x22')][_0x1f1188[_0x0577('0xa2')]]);this['voiceQueues'][_0x1f1188['queue']][_0x0577('0x5a')]+=0x1;this[_0x0577('0x22')][_0x1f1188['queue']][_0x0577('0xce')]+=0x1;_0x32fa4a=new Hangup(_0x1f1188,_0x5104de);_0x32fa4a['state']=0x10;_0x32fa4a['statedesc']=_0x0577('0xde');_0x32fa4a[_0x0577('0xd1')]=_0x0577('0xdf');this['createHistory'](_0x32fa4a)[_0x0577('0x9f')](loggerCatch(_0x0577('0xdc')));this['moveContactManagedDialer'](_0x32fa4a)[_0x0577('0x9f')](loggerCatch('[syncHangupIvr]'));}if(_0x1f1188&&_0x1f1188[_0x0577('0x51')]!==_0x0577('0x73')&&!isNotNull(this['voiceQueues'][_0x1f1188['queue']][_0x0577('0xdd')])){delete this[_0x0577('0x9b')][_0x5104de[_0x0577('0xcd')]];this['updateOriginated'](this[_0x0577('0x22')][_0x1f1188['queue']]);this['voiceQueues'][_0x1f1188['queue']]['outboundUnknownCallsDay']+=0x1;_0x32fa4a=new Hangup(_0x1f1188,_0x5104de);_0x32fa4a[_0x0577('0x98')]=0xc;_0x32fa4a[_0x0577('0xcf')]=_0x5104de[_0x0577('0xe0')];_0x32fa4a[_0x0577('0xd1')]=_0x0577('0xe1');this[_0x0577('0xb5')](_0x32fa4a)[_0x0577('0x9f')](loggerCatch(_0x0577('0xdc')));this['moveContactManagedDialer'](_0x32fa4a)[_0x0577('0x9f')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x0577('0x1c')]['syncAgentComplete']=function(_0x2ba1f3){var _0x3e388b=this[_0x0577('0x9b')][_0x2ba1f3['uniqueid']];var _0x16fbbf=this;if(this[_0x0577('0x22')][_0x2ba1f3[_0x0577('0xa2')]]){if(_0x3e388b&&_0x3e388b[_0x0577('0x51')]!==_0x0577('0x73')){delete this[_0x0577('0x9b')][_0x2ba1f3[_0x0577('0xcd')]];this[_0x0577('0x22')][_0x2ba1f3[_0x0577('0xa2')]][_0x0577('0x5a')]+=0x1;var _0x1c6291=new AgentComplete(_0x3e388b,_0x2ba1f3);if(_0x2ba1f3[_0x0577('0xe2')]==='agent'){_0x1c6291[_0x0577('0xe3')]=this['voiceQueues'][_0x2ba1f3['queue']][_0x0577('0xe4')]&&this[_0x0577('0x22')][_0x2ba1f3[_0x0577('0xa2')]][_0x0577('0xe5')]?moment()[_0x0577('0x71')](_0x0577('0xe6')):undefined;}this['createHistory'](_0x1c6291)[_0x0577('0x9f')](loggerCatch(_0x0577('0xe7')));this['moveContactManagedDialer'](_0x1c6291)[_0x0577('0x9f')](loggerCatch(_0x0577('0xe8')));}}};Dialer['prototype']['syncAgentConnect']=function(_0x5de272){if(this['voiceQueues'][_0x5de272[_0x0577('0xa2')]]){if(this['uniqueId'][_0x5de272[_0x0577('0xcd')]]&&this[_0x0577('0x9b')][_0x5de272[_0x0577('0xcd')]][_0x0577('0x51')]!==_0x0577('0x73')){this[_0x0577('0xa1')](this['voiceQueues'][_0x5de272[_0x0577('0xa2')]]);this['uniqueId'][_0x5de272[_0x0577('0xcd')]][_0x0577('0xe9')]=moment()[_0x0577('0x71')](_0x0577('0xe6'));}}};Dialer['prototype'][_0x0577('0xea')]=function(_0x306976){this[_0x0577('0xb5')](_0x306976)[_0x0577('0x9f')](loggerCatch(_0x0577('0xe7')));this[_0x0577('0xb3')](_0x306976)['catch'](loggerCatch(_0x0577('0xeb')));};Dialer[_0x0577('0x1c')]['syncQueueCallerAbandon']=function(_0x31f4e9){var _0x341bab=this[_0x0577('0x9b')][_0x31f4e9['uniqueid']];var _0x5e2592=this;if(this['voiceQueues'][_0x31f4e9[_0x0577('0xa2')]]){if(_0x341bab&&_0x341bab['type']!==_0x0577('0x73')){delete this[_0x0577('0x9b')][_0x31f4e9[_0x0577('0xcd')]];this[_0x0577('0xa1')](this[_0x0577('0x22')][_0x31f4e9[_0x0577('0xa2')]]);_0x341bab[_0x0577('0xec')]=moment()[_0x0577('0x71')](_0x0577('0xe6'));var _0x995732=new QueueCallerAbandon(_0x341bab,_0x31f4e9);if(getSeconds(_0x341bab[_0x0577('0xec')],_0x341bab[_0x0577('0xed')])>=_0x341bab['dialQueueTimeout']){this[_0x0577('0x22')][_0x31f4e9[_0x0577('0xa2')]][_0x0577('0x65')]+=0x1;this[_0x0577('0x22')][_0x31f4e9[_0x0577('0xa2')]][_0x0577('0x5e')]+=0x1;this[_0x0577('0x22')][_0x31f4e9[_0x0577('0xa2')]][_0x0577('0x67')]+=0x1;_0x995732[_0x0577('0x98')]=0xa;_0x995732['statedesc']=_0x0577('0xee');_0x995732[_0x0577('0xef')]=_0x0577('0xf0');_0x995732[_0x0577('0xe3')]=this['voiceQueues'][_0x31f4e9[_0x0577('0xa2')]]['dialQueueProject2']?moment()[_0x0577('0x71')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;this[_0x0577('0xea')](_0x995732);}else{this['voiceQueues'][_0x31f4e9[_0x0577('0xa2')]][_0x0577('0x64')]+=0x1;this[_0x0577('0x22')][_0x31f4e9['queue']][_0x0577('0x5d')]+=0x1;_0x995732[_0x0577('0x98')]=0xb;_0x995732[_0x0577('0xcf')]=_0x0577('0xf1');_0x995732['dropreason']=_0x0577('0xf2');this[_0x0577('0xea')](_0x995732);}}}};Dialer[_0x0577('0x1c')][_0x0577('0x38')]=function(_0x10160e){if(this['actions'][_0x10160e[_0x0577('0xcd')]]){this['actions'][_0x10160e[_0x0577('0xcd')]][_0x0577('0xf3')]=_0x10160e[_0x0577('0xf3')];}if(this[_0x0577('0x9b')][_0x10160e[_0x0577('0xcd')]]){this['uniqueId'][_0x10160e[_0x0577('0xcd')]][_0x0577('0xf3')]=_0x10160e[_0x0577('0xf3')];}};Dialer[_0x0577('0x1c')][_0x0577('0x3b')]=function(_0x9614c){if(strategy[this[_0x0577('0x22')][this[_0x0577('0x27')][_0x9614c[_0x0577('0xf4')]][_0x0577('0xa2')]][_0x0577('0x4c')]]===_0x0577('0x1b')){if(this[_0x0577('0x27')][_0x9614c['actionid']]&&_['isNil'](this[_0x0577('0x27')][_0x9614c[_0x0577('0xf4')]][_0x0577('0xf5')])&&_0x9614c[_0x0577('0x9e')]==='1'&&_0x9614c['paused']==='0'){if(this[_0x0577('0x24')][_0x9614c[_0x0577('0xf6')]]){if(!this[_0x0577('0x24')][_0x9614c[_0x0577('0xf6')]][_0x0577('0xf5')]){this[_0x0577('0x24')][_0x9614c[_0x0577('0xf6')]][_0x0577('0xf5')]=!![];this[_0x0577('0x27')][_0x9614c[_0x0577('0xf4')]][_0x0577('0xf5')]=!![];this[_0x0577('0x27')][_0x9614c[_0x0577('0xf4')]][_0x0577('0xf6')]=_0x9614c['stateinterface'];}}}}else if((strategy[this[_0x0577('0x22')][this[_0x0577('0x27')][_0x9614c[_0x0577('0xf4')]]['queue']][_0x0577('0x4c')]]||_0x0577('0x1a'))===_0x0577('0x1a')){if(this[_0x0577('0x27')][_0x9614c[_0x0577('0xf4')]]){if(this[_0x0577('0x24')][_0x9614c[_0x0577('0xf6')]]){this['actions'][_0x9614c[_0x0577('0xf4')]][_0x0577('0xf6')]=_0x9614c[_0x0577('0xf6')];if(_[_0x0577('0x9d')](this[_0x0577('0xf7')][this['actions'][_0x9614c[_0x0577('0xf4')]][_0x0577('0xa2')]])){this[_0x0577('0xf7')][this[_0x0577('0x27')][_0x9614c[_0x0577('0xf4')]]['queue']]=[];}this['queueBooked'][this[_0x0577('0x27')][_0x9614c['actionid']]['queue']][_0x0577('0xf8')](_[_0x0577('0x7d')](_[_0x0577('0xbb')](this[_0x0577('0x27')][_0x9614c[_0x0577('0xf4')]],[_0x0577('0xf9'),_0x0577('0xf6')]),{'status':_0x9614c[_0x0577('0x9e')],'paused':_0x9614c[_0x0577('0xfa')]}));}}}};function unlockQueueStatus(_0x1cb497,_0x485301){setTimeout(function(){if(_['isUndefined'](_0x1cb497['queueStatusComplete'])){loggerBooked[_0x0577('0x86')](_0x0577('0xfb'),_0x485301);}_0x1cb497['queueStatusComplete']=!![];loggerBooked[_0x0577('0x77')](_0x0577('0xfc'),_0x485301,JSON[_0x0577('0x70')](_[_0x0577('0xbb')](_0x1cb497,[_0x0577('0x41'),_0x0577('0xfd')])));},0x1f3);}Dialer[_0x0577('0x1c')][_0x0577('0xfe')]=function(_0x6c0d89){var _0x5b902f=this;var _0x35dfb2=_0x5b902f[_0x0577('0x22')][_0x5b902f[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xa2')]];if(strategy[this[_0x0577('0x22')][this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xa2')]][_0x0577('0x4c')]]==='roundrobin'){if(this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]]&&this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xf6')]){this[_0x0577('0x21')][_0x0577('0xff')](this['actions'][_0x6c0d89[_0x0577('0xf4')]]['idHopper'],this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xf6')])['catch'](function(_0x504dbb){logger[_0x0577('0x86')](_0x0577('0x100'),util['inspect'](_0x504dbb,{'showHidden':![],'depth':null}));})[_0x0577('0x1f')](function(){_0x5b902f[_0x0577('0xa1')](_0x5b902f[_0x0577('0x22')][_0x5b902f['actions'][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xa2')]]);_0x5b902f[_0x0577('0x24')][_0x5b902f[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xf6')]]['locked']=![];delete _0x5b902f['actions'][_0x6c0d89[_0x0577('0xf4')]];unlockQueueStatus(_0x35dfb2);});}else{this[_0x0577('0xa1')](this[_0x0577('0x22')][this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]]['queue']]);this[_0x0577('0x101')]({'active':![],'ContactId':this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xbc')],'ListId':this['actions'][_0x6c0d89['actionid']][_0x0577('0xbd')],'VoiceQueueId':this[_0x0577('0x27')][_0x6c0d89['actionid']][_0x0577('0xbf')]||undefined,'CampaignId':this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xc0')]||undefined})[_0x0577('0x9f')](loggerCatch(_0x0577('0x102')));delete this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]];unlockQueueStatus(_0x35dfb2);}}else if((strategy[this['voiceQueues'][this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xa2')]][_0x0577('0x4c')]]||_0x0577('0x1a'))==='rrmemory'){var _0xb73a17;if(this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]]&&!_[_0x0577('0x75')](this[_0x0577('0xf7')][this[_0x0577('0x27')][_0x6c0d89['actionid']][_0x0577('0xa2')]])){if(this[_0x0577('0x2b')][_0x5b902f['actions'][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xa2')]]){this[_0x0577('0x2b')][_0x5b902f[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xa2')]]=this[_0x0577('0x2b')][this[_0x0577('0x27')][_0x6c0d89['actionid']][_0x0577('0xa2')]]?this[_0x0577('0x2b')][this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]]['queue']]:this[_0x0577('0xf7')][this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xa2')]]?this['queueBooked'][this['actions'][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xa2')]][_0x0577('0x103')]||0x0:0x0;}this['queueBooked'][this[_0x0577('0x27')][_0x6c0d89['actionid']][_0x0577('0xa2')]][_0x0577('0x103')]=this['queueBookedRR'][this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xa2')]];for(var _0x3f6a58=0x0;_0x3f6a58<this[_0x0577('0xf7')][this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]]['queue']]['length'];_0x3f6a58+=0x1){_0xb73a17=rr(this[_0x0577('0xf7')][this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xa2')]]);this[_0x0577('0x2b')][_0x5b902f[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xa2')]]=this[_0x0577('0xf7')][this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xa2')]][_0x0577('0x103')];if(_0xb73a17[_0x0577('0x9e')]==='1'&&_0xb73a17[_0x0577('0xfa')]==='0'){break;}}if(!_[_0x0577('0x9d')](_0xb73a17)){this['agents'][_0xb73a17[_0x0577('0xf6')]]['unlockRR']=_[_0x0577('0x3f')](this[_0x0577('0x24')][_0xb73a17[_0x0577('0xf6')]][_0x0577('0x104')])?!![]:this[_0x0577('0x24')][_0xb73a17['stateinterface']][_0x0577('0x104')];}loggerBooked[_0x0577('0x77')](_0x0577('0x105'),_0x6c0d89[_0x0577('0xf4')],_0x0577('0x106'),JSON['stringify'](_[_0x0577('0xbb')](this[_0x0577('0x24')][_0xb73a17[_0x0577('0xf6')]],[_0x0577('0x41'),_0x0577('0x104')])),_0x0577('0x107'),JSON[_0x0577('0x70')](_0xb73a17[_0x0577('0xf9')]));if(!_[_0x0577('0x9d')](_0xb73a17)&&_0xb73a17[_0x0577('0x9e')]==='1'&&_0xb73a17[_0x0577('0xfa')]==='0'&&this[_0x0577('0x24')][_0xb73a17['stateinterface']][_0x0577('0x104')]){this[_0x0577('0x24')][_0xb73a17[_0x0577('0xf6')]][_0x0577('0x104')]=![];this[_0x0577('0xf7')][_0x5b902f[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xa2')]]=[];this[_0x0577('0x21')][_0x0577('0xff')](_0xb73a17['idHopper'],_0xb73a17[_0x0577('0xf6')])[_0x0577('0x9f')](function(_0xdb0f6b){logger[_0x0577('0x86')](_0x0577('0x100'),util['inspect'](_0xdb0f6b,{'showHidden':![],'depth':null}));})[_0x0577('0x1f')](function(){_0x5b902f[_0x0577('0xa1')](_0x5b902f[_0x0577('0x22')][_0x5b902f[_0x0577('0x27')][_0x6c0d89['actionid']][_0x0577('0xa2')]]);setTimeout(function(){_0x5b902f[_0x0577('0x24')][_0xb73a17[_0x0577('0xf6')]][_0x0577('0x104')]=!![];loggerBooked[_0x0577('0x77')]('[booked][RR][finaly]',_0x6c0d89[_0x0577('0xf4')],_0x0577('0x106'),JSON['stringify'](_[_0x0577('0xbb')](_0x5b902f[_0x0577('0x24')][_0xb73a17[_0x0577('0xf6')]],[_0x0577('0x41'),_0x0577('0x104')])),_0x0577('0x107'),JSON[_0x0577('0x70')](_0xb73a17[_0x0577('0xf9')]));},0xc7);delete _0x5b902f['actions'][_0x6c0d89[_0x0577('0xf4')]];unlockQueueStatus(_0x35dfb2,_0x6c0d89['actionid']);});}else{loggerBooked['info']('[booked][unlock]');this[_0x0577('0xa1')](this['voiceQueues'][this['actions'][_0x6c0d89[_0x0577('0xf4')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xbc')],'ListId':this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xbd')],'VoiceQueueId':this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xbf')]||undefined,'CampaignId':this['actions'][_0x6c0d89['actionid']][_0x0577('0xc0')]||undefined})[_0x0577('0x9f')](loggerCatch(_0x0577('0x102')));delete this['actions'][_0x6c0d89[_0x0577('0xf4')]];unlockQueueStatus(_0x35dfb2);}}else{loggerBooked['info'](_0x0577('0x108'));this[_0x0577('0xa1')](this[_0x0577('0x22')][this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xa2')]]);this[_0x0577('0x101')]({'active':![],'ContactId':this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]]['ContactId'],'ListId':this['actions'][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xbd')],'VoiceQueueId':this['actions'][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xbf')]||undefined,'CampaignId':this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]]['CampaignId']||undefined})[_0x0577('0x9f')](loggerCatch(_0x0577('0x109')));delete this['actions'][_0x6c0d89[_0x0577('0xf4')]];unlockQueueStatus(_0x35dfb2);}}else{loggerBooked['info']('[booked][unlock3]');this[_0x0577('0xa1')](this[_0x0577('0x22')][this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xa2')]]);this[_0x0577('0x101')]({'active':![],'ContactId':this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xbc')],'ListId':this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xbd')],'VoiceQueueId':this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x0577('0x27')][_0x6c0d89[_0x0577('0xf4')]][_0x0577('0xc0')]||undefined})[_0x0577('0x9f')](loggerCatch(_0x0577('0x10a')));delete this[_0x0577('0x27')][_0x6c0d89['actionid']];unlockQueueStatus(_0x35dfb2);}};Dialer[_0x0577('0x1c')][_0x0577('0x3d')]=function(){var _0x408c1d=this;setInterval(function(){_0x408c1d[_0x0577('0x10b')]();},0x3e8);};Dialer['prototype'][_0x0577('0x10c')]=function(_0x374b9d){var _0x2163e9=this;return function(){if(!_0x2163e9[_0x0577('0xc3')](_0x374b9d['Trunk'])){if(!_0x2163e9[_0x0577('0xc3')](_0x374b9d[_0x0577('0x10d')])){_0x374b9d[_0x0577('0x40')]=_0x0577('0x10e');throw _0x374b9d[_0x0577('0x41')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0x0577('0x1c')]['checkIfTime']=function(_0x28a724,_0x1e9c1e,_0xa8e3ea,_0x2557df){var _0xefae2c=this;return function(){var _0x1aa438=!![];return _0xefae2c[_0x0577('0x10f')](_0x28a724,_0x1e9c1e,_0xa8e3ea,_0x2557df,_0x1aa438);};};Dialer['prototype']['checkIfTimeIntervals']=function(_0x1df25d,_0x16d872,_0x5d5a02,_0x58e79e){var _0x2af45e=this;return function(){var _0x2cffac=![];return _0x2af45e[_0x0577('0x10f')](_0x1df25d[_0x0577('0x46')],_0x16d872,_0x5d5a02,_0x58e79e,_0x2cffac);};};Dialer[_0x0577('0x1c')][_0x0577('0x10f')]=function(_0xefe49f,_0x51ad04,_0x109ec9,_0x55d170,_0x2dea68){var _0x11d6b7=[];return new BPromise(function(_0x67dd5c,_0x51409f){if(!isNotNull(_0xefe49f)){_0x55d170[_0x0577('0x40')]=_0x0577('0x44');return _0x51409f(msgResponse(_0x0577('0x10f'),_0x0577('0x110'),_0x109ec9+_0x0577('0x111')));}if(_[_0x0577('0x75')](_0xefe49f)){_0x55d170[_0x0577('0x40')]=_0x0577('0x112');return _0x51409f(msgResponse(_0x0577('0x10f'),_0x0577('0x110'),_0x109ec9+_0x0577('0x113')));}if(_0x51ad04&&_['isUndefined'](config[_0x0577('0x114')][_0x51ad04])){_0x55d170[_0x0577('0x40')]='TIMEZONE_UNKNOW';return _0x51409f(msgResponse(_0x0577('0x10f'),_0x0577('0x110'),_0x109ec9+_0x0577('0x115')+_0x51ad04));}if(_['isArray'](_0xefe49f)){for(var _0x1d59ac=0x0;_0x1d59ac<_0xefe49f[_0x0577('0x87')];_0x1d59ac+=0x1){_0x11d6b7[_0x0577('0xf8')](ami[_0x0577('0x116')]({'action':_0x0577('0x117'),'command':util[_0x0577('0x71')]('iftime\x20%s,%s',_0xefe49f[_0x1d59ac][_0x0577('0x118')],!_[_0x0577('0x3f')](config['timezones'][_0x51ad04])?_0x51ad04:'')})[_0x0577('0xa5')](function(_0x27b3cb){return _0x27b3cb[_0x0577('0x119')][_0x0577('0x11a')]('true')>=0x0?!![]:![];})[_0x0577('0x9f')](myreject(_0x51409f)));}}else{_0x11d6b7[_0x0577('0xf8')](ami['Action']({'action':_0x0577('0x117'),'command':util[_0x0577('0x71')]('iftime\x20%s,%s',_0xefe49f,!_[_0x0577('0x3f')](config[_0x0577('0x114')][_0x51ad04])?_0x51ad04:'')})[_0x0577('0xa5')](function(_0x3cdee8){return _0x3cdee8[_0x0577('0x119')][_0x0577('0x11a')](_0x0577('0x11b'))>=0x0?!![]:![];})[_0x0577('0x9f')](myreject(_0x51409f)));}BPromise['all'](_0x11d6b7)['then'](function(_0x1c61b9){var _0x5d3996=_[_0x0577('0x11c')](_0x1c61b9);if(_0x5d3996){return _0x67dd5c(_0x5d3996);}else{_0x55d170[_0x0577('0x40')]=_0x2dea68?_0x0577('0x11d'):_0x0577('0x11e');return _0x51409f(msgResponse('[ifTime][promiseAll]',_0x0577('0x110'),_0x0577('0x11f')+_0x2dea68+'\x20'+_0x109ec9+'\x20Interval\x20is\x20overtime:\x20'+util[_0x0577('0x85')](_0xefe49f,{'showHidden':![],'depth':null})+_0x0577('0x120')+_0x51ad04));}})[_0x0577('0x9f')](function(_0x4e6a14){return _0x51409f(msgResponse(_0x0577('0x10f'),_0x0577('0x110'),JSON[_0x0577('0x70')](_0x4e6a14)));});});};Dialer[_0x0577('0x1c')][_0x0577('0x121')]=function(_0x3e4333){var _0x84ad51=this;return function(){switch(_0x3e4333[_0x0577('0x55')]){case _0x0577('0x122'):freeVariablesPredictive(_0x3e4333);_0x84ad51[_0x0577('0x123')](_0x3e4333,0x1);break;case _0x0577('0x124'):freeVariablesPredictive(_0x3e4333);_0x84ad51[_0x0577('0x123')](_0x3e4333,_0x3e4333[_0x0577('0x125')]);break;case _0x0577('0x8'):_0x84ad51['predictive'](_0x3e4333);break;case _0x0577('0x7'):freeVariablesPredictive(_0x3e4333);_0x84ad51[_0x0577('0x123')](_0x3e4333,0x1);break;default:freeVariablesPredictive(_0x3e4333);logger[_0x0577('0x86')]('Queue',_0x3e4333[_0x0577('0x41')],_0x0577('0x126'));}};};Dialer[_0x0577('0x1c')][_0x0577('0x127')]=function(_0xe19143){var _0x2a83d5=this;return function(){_0x2a83d5['handleIvr'](_0xe19143);};};Dialer['prototype'][_0x0577('0x9')]=function(_0x238dd0){var _0x14e3cf=this;if(isNotPreview(_0x238dd0[_0x0577('0x55')])){if(isVoiceQueueOutbound(_0x238dd0['type'])&&isActive(_0x238dd0['dialActive'])){_0x238dd0[_0x0577('0x8f')]=!![];BPromise[_0x0577('0xaa')]()[_0x0577('0xa5')](checkIsLoggedIn(_0x238dd0,_0x238dd0[_0x0577('0x128')]))['then'](checkIsActive(_0x238dd0,_0x238dd0[_0x0577('0x54')]))[_0x0577('0xa5')](checkInterval(_0x238dd0))[_0x0577('0xa5')](_0x14e3cf[_0x0577('0x10c')](_0x238dd0))[_0x0577('0xa5')](_0x14e3cf[_0x0577('0x129')](_0x238dd0[_0x0577('0x12a')],_0x238dd0[_0x0577('0x12b')],_0x238dd0[_0x0577('0x41')],_0x238dd0))[_0x0577('0xa5')](_0x14e3cf[_0x0577('0x12c')](_0x238dd0[_0x0577('0x43')],_0x238dd0[_0x0577('0x12b')],_0x238dd0['name'],_0x238dd0))[_0x0577('0xa5')](_0x14e3cf[_0x0577('0x121')](_0x238dd0))['catch'](loggerCatchQueueSummary(_0x0577('0x12d'),_0x238dd0));}else{notSendMessagesQueue(_0x238dd0);}}else{freeVariablesPredictive(_0x238dd0);}};Dialer[_0x0577('0x1c')][_0x0577('0x10b')]=function(){var _0x136d32=this;var _0x546de4;for(var _0x21575a in this[_0x0577('0x23')]){if(this['campaigns'][_0x0577('0x9c')](_0x21575a)){_0x546de4=this[_0x0577('0x23')][_0x21575a];if(isCampaignIvr(_0x546de4[_0x0577('0x51')])&&isActive(_0x546de4[_0x0577('0x6f')])){_0x546de4[_0x0577('0x8f')]=!![];BPromise[_0x0577('0xaa')]()[_0x0577('0xa5')](checkIsActive(_0x546de4,_0x546de4['active']))[_0x0577('0xa5')](checkInterval(_0x546de4))['then'](_0x136d32[_0x0577('0x10c')](_0x546de4))[_0x0577('0xa5')](_0x136d32[_0x0577('0x129')](_0x546de4['dialGlobalInterval'],_0x546de4[_0x0577('0x12b')],_0x546de4[_0x0577('0x41')],_0x546de4))[_0x0577('0xa5')](_0x136d32['checkIfTimeIntervals'](_0x546de4['Interval'],_0x546de4['dialTimezone'],_0x546de4[_0x0577('0x41')],_0x546de4))[_0x0577('0xa5')](_0x136d32[_0x0577('0x127')](_0x546de4))[_0x0577('0x9f')](loggerCatchQueueSummary('[syncCampaigns]',_0x546de4));}else{notSendMessagesCampaign(_0x546de4);}}}};function getCallerIdRandom(_0x36b0f5,_0x155682){var _0x30bb57,_0x541913,_0x4898aa;if(_0x155682<=0x0){_0x155682=0x1;}_0x30bb57=new RegExp(_0x0577('0x12e')+_0x155682+'}$');_0x541913=Math[_0x0577('0x12f')](0xa,_0x155682-0x1);_0x4898aa=Math[_0x0577('0x12f')](0xa,_0x155682)-0x1;return util['format']('%s',_[_0x0577('0x130')](_0x36b0f5,_0x30bb57,_[_0x0577('0x131')](_0x541913,_0x4898aa)));}function extractCalleridName(_0x9661dd){var _0x55fe9a=_0x9661dd[_0x0577('0x132')](/"(.*?)"/);return _0x55fe9a?_0x55fe9a[0x1]:_0x9661dd;}function extractCalleridNumber(_0x290f66){var _0x154237=_0x290f66[_0x0577('0x132')](/<(.*?)>/);return _0x154237?_0x154237[0x1]:_0x290f66;}Dialer['prototype'][_0x0577('0x133')]=function(_0x4c7b9a,_0x31573f){var _0x1dd3da=this;var _0x8c7d13=uuid['v4']();this['actions'][_0x8c7d13]=new Action(_0x4c7b9a,_0x31573f,_0x8c7d13);return new BPromise(function(_0x4da4cf,_0x5096c7){if(_['isUndefined'](_0x4c7b9a)&&'object'!==typeof _0x4c7b9a){return _0x5096c7(msgResponse(_0x0577('0x134'),_0x0577('0x110'),_0x0577('0x135')));}if(_[_0x0577('0x3f')](_0x31573f[_0x0577('0x136')][_0x0577('0x137')])||_0x31573f['Contact'][_0x0577('0x137')]===null){return _0x5096c7(msgResponse(_0x0577('0x134'),_0x0577('0x110'),_0x0577('0x138')));}var _0xbc9257={'XMD-CALLERID':_0x1dd3da[_0x0577('0x27')][_0x8c7d13][_0x0577('0x139')](),'XMD-AGI':_0x4c7b9a[_0x0577('0xdd')]?util[_0x0577('0x71')](_0x0577('0x13a'),ipAgi,_0x4c7b9a['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x4c7b9a['dialQueueProject2']?util[_0x0577('0x71')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4c7b9a[_0x0577('0xe4')]):_0x0577('0x13b'),'XMD-QUEUE':_0x4c7b9a[_0x0577('0x51')]===_0x0577('0x81')?util['format'](_0x0577('0x13c'),_0x4c7b9a[_0x0577('0x41')],_0x4c7b9a[_0x0577('0x13d')]||'',_0x4c7b9a[_0x0577('0xe5')]?'c':'',_0x4c7b9a['dialQueueTimeout']||0x3):_0x0577('0x13b'),'XMD-CONTACTID':_0x31573f[_0x0577('0xbc')],'XMD-CDRTYPE':_0x0577('0x6'),'CALLERID(all)':_0x1dd3da[_0x0577('0x27')][_0x8c7d13][_0x0577('0x139')](),'XMD-AMD':_0x4c7b9a[_0x0577('0xcb')]?'ACTIVE':_0x0577('0x13b'),'XMD-DESTINATION':_0x0577('0x13e')};if(_0x4c7b9a['dialAMDActive']){_0xbc9257[_0x0577('0x13f')]=_0x4c7b9a[_0x0577('0x140')]||0x9c4;_0xbc9257[_0x0577('0x141')]=_0x4c7b9a['dialAMDGreeting']||0x5dc;_0xbc9257[_0x0577('0x142')]=_0x4c7b9a[_0x0577('0x143')]||0x320;_0xbc9257[_0x0577('0x144')]=_0x4c7b9a[_0x0577('0x145')]||0x1388;_0xbc9257[_0x0577('0x146')]=_0x4c7b9a[_0x0577('0x147')]||0x64;_0xbc9257[_0x0577('0x148')]=_0x4c7b9a['dialAMDBetweenWordsSilence']||0x32;_0xbc9257[_0x0577('0x149')]=_0x4c7b9a['dialAMDMaximumNumberOfWords']||0x3;_0xbc9257['XMD-AMDSILENCETHRESHOLD']=_0x4c7b9a['dialAMDSilenceThreshold']||0x100;_0xbc9257[_0x0577('0x14a')]=_0x4c7b9a[_0x0577('0x14b')]||0x1388;}if(_0x4c7b9a['type']===_0x0577('0x81')){_0xbc9257['XMD-VOICEQUEUEID']=_0x31573f['VoiceQueueId'];}else{_0xbc9257['XMD-CAMPAIGNID']=_0x31573f['CampaignId'];}for(var _0x5e7e51 in _0x31573f['Contact']){if(_0x31573f[_0x0577('0x136')]['hasOwnProperty'](_0x5e7e51)){if(isNotNull(_0x31573f[_0x0577('0x136')][_0x5e7e51])&&_0x5e7e51!=='id'&&_0x5e7e51!=='tags'&&_0x5e7e51!==_0x0577('0x14c')&&_0x5e7e51!==_0x0577('0x14d')){_0xbc9257[util[_0x0577('0x71')](_0x0577('0x14e'),_0x0577('0x14f'),_[_0x0577('0x150')](_0x5e7e51))]=_0x31573f[_0x0577('0x136')][_0x5e7e51];}}}var _0x4539bc=_0x1dd3da['isTrunkReachable'](_0x4c7b9a[_0x0577('0x6e')])?getCallerId(_0x4c7b9a[_0x0577('0x6e')]['callerid'],_0x4c7b9a[_0x0577('0x56')],_0x4c7b9a['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x4c7b9a[_0x0577('0x57')],_0x4c7b9a[_0x0577('0x151')]):_0x4c7b9a['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x4c7b9a[_0x0577('0x10d')])?_0x4c7b9a[_0x0577('0x6e')][_0x0577('0x152')]:_0x4c7b9a['TrunkBackup']['callerid'],_0x4c7b9a[_0x0577('0x56')],_0x4c7b9a[_0x0577('0x151')]>0x0?getCallerIdRandom(_0x4c7b9a[_0x0577('0x57')],_0x4c7b9a[_0x0577('0x151')]):_0x4c7b9a['dialOriginateCallerIdNumber']);if(_0x4539bc){_0xbc9257[_0x0577('0x153')]=_0x1dd3da[_0x0577('0x27')][_0x8c7d13][_0x0577('0x154')]=extractCalleridName(_0x4539bc);_0xbc9257[_0x0577('0x155')]=_0x1dd3da[_0x0577('0x27')][_0x8c7d13]['originatecalleridnum']=extractCalleridNumber(_0x4539bc);}return ami['Action']({'actionid':_0x8c7d13,'action':_0x0577('0x134'),'channel':_0x1dd3da[_0x0577('0xc3')](_0x4c7b9a['Trunk'])?util['format']('SIP/%s/%s%s',_0x4c7b9a['Trunk'][_0x0577('0x41')],isNotNull(_0x4c7b9a[_0x0577('0x59')])?_0x4c7b9a[_0x0577('0x59')][_0x0577('0x156')]()||'':'',_0x4c7b9a['dialCutDigit']>0x0?_0x31573f['Contact']['phone'][_0x0577('0x157')](_0x4c7b9a[_0x0577('0x158')]):_0x31573f[_0x0577('0x136')][_0x0577('0x137')]):util[_0x0577('0x71')]('SIP/%s/%s%s',_[_0x0577('0x9d')](_0x4c7b9a[_0x0577('0x10d')])?_0x4c7b9a[_0x0577('0x6e')][_0x0577('0x41')]:_0x4c7b9a[_0x0577('0x10d')][_0x0577('0x41')],isNotNull(_0x4c7b9a[_0x0577('0x59')])?_0x4c7b9a['dialPrefix'][_0x0577('0x156')]()||'':'',_0x4c7b9a[_0x0577('0x158')]>0x0?_0x31573f[_0x0577('0x136')][_0x0577('0x137')][_0x0577('0x157')](_0x4c7b9a[_0x0577('0x158')]):_0x31573f[_0x0577('0x136')][_0x0577('0x137')]),'callerid':_0x4539bc,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0xbc9257,'timeout':(_0x4c7b9a['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x8c7d13})[_0x0577('0xa5')](function(_0x542150){return _0x4da4cf(_0x542150);})[_0x0577('0x9f')](function(_0x4fa401){_0x4c7b9a[_0x0577('0x5f')]+=0x1;var _0x4cceee=new History(_0x1dd3da[_0x0577('0x27')][_0x8c7d13]);logger[_0x0577('0x86')](util['format']('[originateError]:\x20%s',JSON['stringify'](_0x4fa401)));_0x4cceee['state']=0xe;_0x4cceee[_0x0577('0xcf')]=_0x0577('0x159');_0x4cceee['starttime']=moment()[_0x0577('0x71')](_0x0577('0xe6'));_0x4cceee[_0x0577('0x99')]=_0x4cceee[_0x0577('0x15a')];_0x1dd3da['createHistory'](_0x4cceee)['catch'](loggerCatch(_0x0577('0x15b')));_0x1dd3da[_0x0577('0xb3')](_0x4cceee)[_0x0577('0x9f')](loggerCatch(_0x0577('0x15b')))[_0x0577('0x1f')](function(){delete _0x1dd3da[_0x0577('0x27')][_0x8c7d13];return _0x5096c7(msgResponse('originate',_0x0577('0x48'),_0x0577('0x15c')));});});});};Dialer['prototype'][_0x0577('0x31')]=function(_0x326aad){var _0x2f8747=this[_0x0577('0x27')][_0x326aad[_0x0577('0xf4')]];var _0x401a13=this;if(_0x2f8747){delete this[_0x0577('0x27')][_0x326aad[_0x0577('0xf4')]];_0x2f8747[_0x0577('0xed')]=moment()[_0x0577('0x71')](_0x0577('0xe6'));var _0x372c7a=_0x2f8747[_0x0577('0x51')]==='ivr'?this[_0x0577('0x23')][_0x2f8747[_0x0577('0xa2')]]:this[_0x0577('0x22')][_0x2f8747[_0x0577('0x15d')]()];if(!this[_0x0577('0xc2')](_0x326aad['response'])){this['updateOriginated'](_0x372c7a);return this[_0x0577('0x15e')](_0x2f8747,_0x372c7a,_0x326aad)[_0x0577('0xa5')](function(_0x1d34be){})[_0x0577('0x9f')](loggerCatch(_0x0577('0x15f')));}else{this[_0x0577('0x9b')][_0x326aad['uniqueid']]=_0x2f8747;}}};Dialer[_0x0577('0x1c')]['checkRetriveMax']=function(_0x4a5b9a,_0x56c75b,_0x100f36){var _0x161a2a=new History(_0x56c75b);if(_0x161a2a['countbusyretry']+_0x161a2a[_0x0577('0x160')]+_0x161a2a[_0x0577('0x161')]>=_0x100f36[_0x0577('0x162')]-0x1){return!![];}switch(_0x4a5b9a){case 0x3:if(_0x161a2a[_0x0577('0x161')]>=_0x100f36[_0x0577('0x163')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0x161a2a[_0x0577('0x161')]+=0x1,'scheduledat':moment()[_0x0577('0x164')](_0x100f36['dialNoAnswerRetryFrequency'],'minutes')[_0x0577('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x161a2a[_0x0577('0xbc')],'ListId':_0x161a2a['ListId'],'VoiceQueueId':_0x161a2a[_0x0577('0xbf')]||undefined,'CampaignId':_0x161a2a[_0x0577('0xc0')]||undefined})[_0x0577('0x9f')](loggerCatch(_0x0577('0x165')));}break;case 0x5:if(_0x161a2a[_0x0577('0x166')]>=_0x100f36['dialBusyMaxRetry']-0x1){return!![];}else{this[_0x0577('0x101')]({'active':![],'countbusyretry':_0x161a2a[_0x0577('0x166')]+=0x1,'scheduledat':moment()[_0x0577('0x164')](_0x100f36[_0x0577('0x167')],_0x0577('0x168'))[_0x0577('0x71')](_0x0577('0xe6')),'ContactId':_0x161a2a[_0x0577('0xbc')],'ListId':_0x161a2a[_0x0577('0xbd')],'VoiceQueueId':_0x161a2a[_0x0577('0xbf')]||undefined,'CampaignId':_0x161a2a[_0x0577('0xc0')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x161a2a[_0x0577('0x160')]>=_0x100f36[_0x0577('0x169')]-0x1){return!![];}else{this[_0x0577('0x101')]({'active':![],'countcongestionretry':_0x161a2a['countcongestionretry']+=0x1,'scheduledat':moment()[_0x0577('0x164')](_0x100f36[_0x0577('0x16a')],_0x0577('0x168'))[_0x0577('0x71')](_0x0577('0xe6')),'ContactId':_0x161a2a[_0x0577('0xbc')],'ListId':_0x161a2a[_0x0577('0xbd')],'VoiceQueueId':_0x161a2a[_0x0577('0xbf')]||undefined,'CampaignId':_0x161a2a['CampaignId']||undefined})[_0x0577('0x9f')](loggerCatch(_0x0577('0x16b')));}break;default:return!![];}};Dialer[_0x0577('0x1c')][_0x0577('0x15e')]=function(_0x34f6a6,_0x36a008,_0x3c0863){var _0x559e8d=this;var _0x1b2b54=new History(_0x34f6a6);return new BPromise(function(_0x1042ab,_0x1bb2c5){if(_[_0x0577('0x3f')](_0x36a008)&&'object'!==typeof _0x36a008){return _0x1bb2c5(msgResponse('[callProgressDetecting]','Failure',_0x0577('0x16c')));}if(_[_0x0577('0x3f')](_0x3c0863)&&'object'!==typeof _0x3c0863){return _0x1bb2c5(msgResponse('[callProgressDetecting]',_0x0577('0x110'),'evt\x20is\x20undefine'));}switch(_0x3c0863[_0x0577('0xe2')]){case'0':_0x36a008[_0x0577('0x16d')]+=0x1;_0x1b2b54[_0x0577('0x98')]=0x0;_0x1b2b54[_0x0577('0xcf')]=_0x0577('0x16e');_0x559e8d[_0x0577('0xb5')](_0x1b2b54)[_0x0577('0x9f')](loggerCatch(_0x0577('0x16f')));if(_0x559e8d[_0x0577('0x170')](0x0,_0x34f6a6,_0x36a008)){if(_0x1b2b54['countbusyretry']+_0x1b2b54['countcongestionretry']+_0x1b2b54['countnoanswerretry']>=_0x36a008[_0x0577('0x162')]){_0x559e8d[_0x0577('0x171')](_0x1b2b54,_0x1042ab,_0x1bb2c5,_0x0577('0x172'));}else{_0x559e8d[_0x0577('0x173')](_0x1b2b54,_0x1042ab,_0x1bb2c5,_0x0577('0x172'));}}break;case'3':_0x36a008[_0x0577('0x174')]+=0x1;_0x1b2b54['state']=0x3;_0x1b2b54[_0x0577('0xcf')]=_0x0577('0x175');_0x1b2b54[_0x0577('0x161')]+=0x1;_0x1b2b54[_0x0577('0x176')]+=0x1;_0x559e8d[_0x0577('0xb5')](_0x1b2b54)[_0x0577('0x9f')](loggerCatch(_0x0577('0x177')));if(_0x559e8d[_0x0577('0x170')](0x3,_0x34f6a6,_0x36a008)){if(_0x1b2b54[_0x0577('0x161')]>=_0x36a008[_0x0577('0x163')]){_0x559e8d[_0x0577('0x173')](_0x1b2b54,_0x1042ab,_0x1bb2c5,'reason\x203\x20ringing\x20no\x20answer');}else{_0x559e8d[_0x0577('0x171')](_0x1b2b54,_0x1042ab,_0x1bb2c5,_0x0577('0x178'));}}break;case'5':_0x36a008[_0x0577('0x179')]+=0x1;_0x1b2b54[_0x0577('0x98')]=0x5;_0x1b2b54[_0x0577('0xcf')]=_0x0577('0x17a');_0x1b2b54['countbusyretry']+=0x1;_0x1b2b54[_0x0577('0x176')]+=0x1;_0x559e8d['createHistory'](_0x1b2b54)[_0x0577('0x9f')](loggerCatch(_0x0577('0x17b')));if(_0x559e8d[_0x0577('0x170')](0x5,_0x34f6a6,_0x36a008)){if(_0x1b2b54[_0x0577('0x166')]>=_0x36a008[_0x0577('0x17c')]){_0x559e8d[_0x0577('0x173')](_0x1b2b54,_0x1042ab,_0x1bb2c5,'reason\x205\x20busy');}else{_0x559e8d[_0x0577('0x171')](_0x1b2b54,_0x1042ab,_0x1bb2c5,_0x0577('0x17d'));}}break;case'8':_0x36a008[_0x0577('0x5c')]+=0x1;_0x1b2b54[_0x0577('0x98')]=0x8;_0x1b2b54[_0x0577('0xcf')]=_0x0577('0x17e');_0x1b2b54[_0x0577('0x160')]+=0x1;_0x1b2b54[_0x0577('0x176')]+=0x1;_0x559e8d['createHistory'](_0x1b2b54)[_0x0577('0x9f')](loggerCatch(_0x0577('0x17f')));if(_0x559e8d[_0x0577('0x170')](0x8,_0x34f6a6,_0x36a008)){if(_0x1b2b54['countcongestionretry']>=_0x36a008['dialCongestionMaxRetry']){_0x559e8d[_0x0577('0x173')](_0x1b2b54,_0x1042ab,_0x1bb2c5,_0x0577('0x180'));}else{_0x559e8d[_0x0577('0x171')](_0x1b2b54,_0x1042ab,_0x1bb2c5,_0x0577('0x180'));}}break;default:_0x36a008[_0x0577('0x181')]+=0x1;_0x1b2b54['state']=0xc;_0x1b2b54[_0x0577('0xcf')]=_0x3c0863[_0x0577('0xe2')];_0x559e8d[_0x0577('0xb5')](_0x1b2b54)['catch'](loggerCatch(_0x0577('0x182')));if(_0x559e8d['checkRetriveMax'](_0x3c0863[_0x0577('0xe2')],_0x34f6a6,_0x36a008)){if(_0x1b2b54['countbusyretry']+_0x1b2b54[_0x0577('0x160')]+_0x1b2b54['countnoanswerretry']>=_0x36a008['dialGlobalMaxRetry']){_0x559e8d[_0x0577('0x171')](_0x1b2b54,_0x1042ab,_0x1bb2c5,_0x3c0863[_0x0577('0xe2')]);}else{_0x559e8d[_0x0577('0x173')](_0x1b2b54,_0x1042ab,_0x1bb2c5,_0x3c0863['reason']);}}}});};Dialer[_0x0577('0x1c')]['stateGlobal']=function(_0x20ec82,_0x21b4e8,_0x44a1c8,_0x3a5295){var _0x51160d=new Final(_0x20ec82);_0x51160d[_0x0577('0x98')]=0xf;_0x51160d[_0x0577('0xcf')]=_0x0577('0x183');this[_0x0577('0x173')](_0x51160d,_0x21b4e8,_0x44a1c8,_0x3a5295);};Dialer[_0x0577('0x1c')][_0x0577('0x173')]=function(_0x1951e6,_0x9474df,_0x323c6d,_0x1f42fd){this['moveContactManagedDialer'](_0x1951e6)[_0x0577('0xa5')](function(_0x227b45){return _0x9474df(msgResponse('[callProgressDetecting]','Success',_0x1f42fd));})[_0x0577('0x9f')](function(_0x589c8f){return _0x323c6d(msgResponse(_0x0577('0x184'),_0x0577('0x110'),_0x0577('0x185')));});};Dialer[_0x0577('0x1c')][_0x0577('0x8')]=function(_0x3278be){var _0x229ad8=this;var _0x33e87f=_0x3278be['dialPredictiveOptimizationPercentage']/0x64;var _0x3b4aae=_0x3278be[_0x0577('0x5e')]/(_0x3278be[_0x0577('0x5e')]+_0x3278be[_0x0577('0x5a')]);var _0x285591=_0x3278be[_0x0577('0x128')]-_0x3278be[_0x0577('0x6b')]-_0x3278be['waiting']-_0x3278be[_0x0577('0x6d')]-_0x3278be[_0x0577('0x90')];var _0x2dcb02=(_0x3278be['loggedIn']-_0x3278be['predictiveIntervalPauses'])*_0x3278be[_0x0577('0x69')];var _0x27dd23=Math[_0x0577('0x186')](_0x3278be['erlangCalls']*_0x3278be[_0x0577('0x187')]*_0x3278be[_0x0577('0x68')]*_0x3278be[_0x0577('0x6a')]);if(_['isUndefined'](_0x3278be[_0x0577('0x2a')])){loggerPredictive[_0x0577('0x77')](_0x0577('0x188'));if(!_['isUndefined'](_0x3278be[_0x0577('0x29')])){_0x3278be['startPredictive']=undefined;loggerPredictive[_0x0577('0x86')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x0577('0x3f')](_0x3278be[_0x0577('0x80')])){loggerPredictive[_0x0577('0x86')](_0x0577('0x189'),_0x0577('0x18a'));clearInterval(_0x3278be[_0x0577('0x80')]);_0x3278be[_0x0577('0x80')]=undefined;}_0x3278be[_0x0577('0x2a')]=moment()[_0x0577('0x71')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x0577('0x18b'),_0x3278be['startProgressive'],_0x3278be['name']);this[_0x0577('0x123')](_0x3278be,0x1);}else if(ifInterval(_0x3278be[_0x0577('0x18c')],_0x3278be['startProgressive'])){this[_0x0577('0x123')](_0x3278be,0x1);loggerPredictiveCalls[_0x0577('0x77')](_0x0577('0x18d'),_0x3278be[_0x0577('0x2a')],_0x3278be[_0x0577('0x41')]);_0x3278be[_0x0577('0x18e')]=0x0;_0x3278be[_0x0577('0x67')]=0x0;}else if(_0x33e87f<_0x3b4aae&&_0x3278be[_0x0577('0x18f')]===_0x0577('0x190')){freeVariablesPredictive(_0x3278be);loggerPredictive['info'](_0x0577('0x191'),_0x0577('0x192'),_0x3b4aae,_0x0577('0x2a'),_0x3278be[_0x0577('0x41')]);}else if(_0x285591>_0x2dcb02){freeVariablesPredictive(_0x3278be);loggerPredictive[_0x0577('0x77')](_0x0577('0x193'),_0x0577('0x194'),_0x285591,_0x0577('0x195'),_0x2dcb02);}else if(_0x27dd23<_0x3278be[_0x0577('0x67')]&&_0x3278be[_0x0577('0x18f')]===_0x0577('0x190')){freeVariablesPredictive(_0x3278be);loggerPredictive['info'](_0x0577('0x196'),_0x0577('0x197'),_0x27dd23,_0x0577('0x198'),_0x3278be[_0x0577('0x67')],_0x0577('0x2a'),_0x3278be['name']);}else if(!ifInterval(_0x3278be[_0x0577('0x18c')],_0x3278be[_0x0577('0x2a')])&&_[_0x0577('0x3f')](_0x3278be[_0x0577('0x29')])&&!_[_0x0577('0x3f')](_0x3278be[_0x0577('0x2a')])){_0x3278be['startPredictive']=moment()['format'](_0x0577('0xe6'));loggerPredictive[_0x0577('0x77')](_0x0577('0x199'),_0x3278be[_0x0577('0x29')],_0x3278be[_0x0577('0x41')]);this[_0x0577('0x19a')](_0x3278be[_0x0577('0x18c')])[_0x0577('0xa5')](this[_0x0577('0x19b')](_0x3278be))[_0x0577('0xa5')](mergeDataErlangB(_0x3278be))[_0x0577('0xa5')](this[_0x0577('0x19c')](_0x3278be))[_0x0577('0x9f')](loggerCatchPredictive(_0x0577('0x19d'),_0x3278be));}else if(!ifInterval(_0x3278be['dialPredictiveInterval'],_0x3278be['startPredictive'])){_0x3278be[_0x0577('0x67')]=0x0;_0x3278be[_0x0577('0x29')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x0577('0x19e'),_0x3278be['startPredictive'],_0x3278be[_0x0577('0x41')]);clearInterval(_0x3278be['handlePredictive']);_0x3278be[_0x0577('0x80')]=undefined;this[_0x0577('0x19a')](_0x3278be[_0x0577('0x18c')])['then'](this[_0x0577('0x19b')](_0x3278be))[_0x0577('0xa5')](mergeDataErlangB(_0x3278be))[_0x0577('0xa5')](this[_0x0577('0x19c')](_0x3278be))[_0x0577('0x9f')](loggerCatchPredictive(_0x0577('0x19d'),_0x3278be));}};Dialer[_0x0577('0x1c')][_0x0577('0x19b')]=function(_0xc5a608){var _0x257d62=this;return function(_0x1176f9){return new BPromise(function(_0x353e84,_0x3b1532){_['merge'](_0xc5a608,_0x1176f9[0x0]);if(checkGetDataPredictive(_0x1176f9[0x0])){loggerPredictive[_0x0577('0x77')](JSON['stringify'](_0x1176f9[0x0]));if(_0xc5a608[_0x0577('0x18f')]===_0x0577('0x190')){return _0x257d62[_0x0577('0xb1')](_0xc5a608['id'])[_0x0577('0xa5')](function(_0xf0301){var _0x53527f=_0xc5a608[_0x0577('0x128')]-_0xf0301[0x0]['outboundQueuePauses'];var _0x48d13a=_0xc5a608[_0x0577('0x18c')]*0x3c;var _0x31b25b=_0x1176f9[0x0]['predictiveIntervalAvgTalktime']+_0x1176f9[0x0][_0x0577('0x63')];var _0x586010=(_0x1176f9[0x0][_0x0577('0x62')]+_0x1176f9[0x0][_0x0577('0x65')]+_0x1176f9[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1176f9[0x0]['predictiveIntervalTotalCalls'];var _0x2cec29=_0xc5a608['dialPredictiveOptimizationPercentage']/0x64;_0xc5a608[_0x0577('0x6b')]=_0xf0301[0x0][_0x0577('0x19f')]||0x0;_0xc5a608[_0x0577('0x68')]=_0x586010>0x0?_0x586010:0x1;return _0x257d62[_0x0577('0x1a0')](_0x53527f,_0x48d13a,_0x31b25b,_0x586010,_0x2cec29);})[_0x0577('0xa5')](function(_0x27ad65){return _0x353e84(_0x27ad65);})['catch'](function(_0x402e94){return _0x3b1532(msgResponse(_0x0577('0x1a1'),_0x0577('0x110'),JSON[_0x0577('0x70')](_0x402e94)));});}if(_0xc5a608[_0x0577('0x18f')]===_0x0577('0x1a2')){return _0x257d62[_0x0577('0xb1')](_0xc5a608['id'])[_0x0577('0xa5')](function(_0x422033){var _0x3d9704=_0xc5a608['loggedIn']-_0x422033[0x0][_0x0577('0x19f')];var _0x17695f=_0xc5a608[_0x0577('0x18c')]*0x3c;var _0x24e156=_0x1176f9[0x0][_0x0577('0x76')]+_0x1176f9[0x0][_0x0577('0x63')];var _0xa66f39=(_0x1176f9[0x0][_0x0577('0x62')]+_0x1176f9[0x0][_0x0577('0x65')]+_0x1176f9[0x0][_0x0577('0x64')])/_0x1176f9[0x0][_0x0577('0x6c')];var _0x1bcca2=_0xc5a608[_0x0577('0x1a3')]/0x64;_0xc5a608[_0x0577('0x6b')]=_0x422033[0x0][_0x0577('0x19f')]||0x0;_0xc5a608[_0x0577('0x68')]=_0xa66f39>0x0?_0xa66f39:0x1;return _0x257d62['busyFactor'](_0x3d9704,_0x17695f,_0x24e156,_0xa66f39,_0x1bcca2);})[_0x0577('0xa5')](function(_0x538678){return _0x353e84(_0x538678);})[_0x0577('0x9f')](function(_0x227622){return _0x3b1532(msgResponse(_0x0577('0x1a1'),_0x0577('0x110'),JSON[_0x0577('0x70')](_0x227622)));});}}else{return _0x3b1532(msgResponse(_0x0577('0x1a4'),_0x0577('0x110'),_0x0577('0x1a5')));}});};};Dialer[_0x0577('0x1c')]['startMethodPredictive']=function(_0x725034){var _0x5e84db=this;return function(){var _0xa77ef7=0x0;var _0x281768=Math[_0x0577('0x186')](_0x725034[_0x0577('0x1a6')]*0x3e8);if(_0x281768>0x0){_0x281768=_0x281768<0x64?0x64:_0x281768;loggerPredictive[_0x0577('0x77')]('[startMethodPredictive]',_0x281768);_0x725034[_0x0577('0x80')]=setInterval(function(){_0x5e84db[_0x0577('0x80')](_0x725034);loggerPredictiveCalls[_0x0577('0x77')]('[handlePredictive]',_0xa77ef7+=0x1);},_0x281768);}else{loggerPredictive[_0x0577('0x77')](_0x0577('0x1a7'),_0x0577('0x1a8'),_0x281768);}};};Dialer[_0x0577('0x1c')][_0x0577('0x1a9')]=function(_0xed48f1,_0x17e5b5){var _0x1cc4f4=this;return function(_0x1f3b13){if(_['isEmpty'](_0x1f3b13)){if(_[_0x0577('0x9d')](_0x17e5b5[_0x0577('0xbe')])||!_0x17e5b5[_0x0577('0x1aa')]){if(_0xed48f1[_0x0577('0x55')]===_0x0577('0x7')){_0xed48f1[_0x0577('0xfd')]=_[_0x0577('0x3f')](_0xed48f1[_0x0577('0xfd')])?!![]:_0xed48f1['queueStatusComplete'];var _0x2962df=uuid['v4']();_0x1cc4f4[_0x0577('0x27')][_0x2962df]=new Action(_0xed48f1,_0x17e5b5,_0x2962df);loggerBooked['info']('[booked][checkContactBlack]',_0x2962df,_0x0577('0x1ab'),JSON[_0x0577('0x70')](_0xed48f1[_0x0577('0xfd')]),'Queue:\x20',_0xed48f1[_0x0577('0x41')]);if(_0xed48f1['queueStatusComplete']){_0xed48f1['queueStatusComplete']=![];_0x1cc4f4[_0x0577('0xf7')][_0x1cc4f4['actions'][_0x2962df][_0x0577('0xa2')]]=[];ami['Action']({'actionid':_0x2962df,'action':'queuestatus','queue':_0xed48f1[_0x0577('0x41')]})['catch'](function(_0xc72014){_0x1cc4f4[_0x0577('0xa1')](_0xed48f1);_0x1cc4f4[_0x0577('0x101')]({'active':![],'ContactId':_0x1cc4f4[_0x0577('0x27')][_0x2962df][_0x0577('0xbc')],'ListId':_0x1cc4f4[_0x0577('0x27')][_0x2962df][_0x0577('0xbd')],'VoiceQueueId':_0x1cc4f4[_0x0577('0x27')][_0x2962df][_0x0577('0xbf')]||undefined,'CampaignId':_0x1cc4f4[_0x0577('0x27')][_0x2962df][_0x0577('0xc0')]||undefined})['catch'](loggerCatch(_0x0577('0x1ac')));delete _0x1cc4f4[_0x0577('0x27')][_0x2962df];});}else{loggerBooked[_0x0577('0x77')](_0x0577('0x1ad'),JSON[_0x0577('0x70')](_0xed48f1[_0x0577('0xfd')]),_0x0577('0x1ae'),_0xed48f1['name']);_0x1cc4f4[_0x0577('0xa1')](_0xed48f1);_0x1cc4f4[_0x0577('0x101')]({'active':![],'ContactId':_0x1cc4f4[_0x0577('0x27')][_0x2962df][_0x0577('0xbc')],'ListId':_0x1cc4f4['actions'][_0x2962df][_0x0577('0xbd')],'VoiceQueueId':_0x1cc4f4[_0x0577('0x27')][_0x2962df][_0x0577('0xbf')]||undefined,'CampaignId':_0x1cc4f4[_0x0577('0x27')][_0x2962df][_0x0577('0xc0')]||undefined})['catch'](loggerCatch(_0x0577('0x1ac')));delete _0x1cc4f4[_0x0577('0x27')][_0x2962df];}}else{return _0x1cc4f4[_0x0577('0x133')](_0xed48f1,_0x17e5b5);}}else{if(getDiff(_0x17e5b5['scheduledat'])<_0xed48f1['dialRecallMeTimeout']*0x3c){_0x1cc4f4[_0x0577('0x21')][_0x0577('0xff')](_0x17e5b5['id'])[_0x0577('0x1f')](function(){_0x1cc4f4['updateOriginated'](_0xed48f1);});}else{_0xed48f1['outboundReCallsDay']+=0x1;_0x1cc4f4[_0x0577('0xa1')](_0xed48f1);if(_0xed48f1[_0x0577('0x1af')]){_0x1cc4f4[_0x0577('0x101')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x17e5b5['ContactId'],'ListId':_0x17e5b5[_0x0577('0xbd')],'VoiceQueueId':_0x17e5b5[_0x0577('0xbf')]||undefined,'CampaignId':_0x17e5b5['CampaignId']||undefined})[_0x0577('0x9f')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x1cc4f4[_0x0577('0xb5')](createObjHistory(_0xed48f1,_0x17e5b5,_0x0577('0x1b0'),0x17,_0x0577('0x1b1')))[_0x0577('0x9f')](loggerCatch(_0x0577('0x1b2')));}else{_0x1cc4f4[_0x0577('0xba')](createObjHistory(_0xed48f1,_0x17e5b5,_0x0577('0x1b3'),0x16,_0x0577('0x1b4')),'[Originate][HistoryRecallClose][historyCatch]',_0x0577('0x1b5'));}}}}else{_0xed48f1[_0x0577('0x5b')]+=0x1;_0x1cc4f4[_0x0577('0xba')](createObjHistory(_0xed48f1,_0x17e5b5,_0x0577('0x1b6'),0xd,_0x0577('0x1b7')),_0x0577('0x1b8'),_0x0577('0x1b9'));throw _0x0577('0x1ba');}};};Dialer[_0x0577('0x1c')]['handleIvr']=function(_0x8c5bc1){var _0x2599a3=this;var _0x2b9e8b=[];var _0x2955b5=_0x8c5bc1[_0x0577('0x1bb')]-_0x8c5bc1[_0x0577('0x6d')]-_0x8c5bc1['temp'];emitCampaignSummary(_0x8c5bc1);if(_0x2955b5>0x0){if(_0x2955b5>this[_0x0577('0x26')]){_0x2955b5=this['maxNumberOriginate'];}_0x8c5bc1[_0x0577('0x1bc')]+=_0x2955b5;this[_0x0577('0xaf')](_0x8c5bc1['id'],_0x2955b5,_0x8c5bc1[_0x0577('0x1bd')])[_0x0577('0xa5')](function(_0x224d52){_0x8c5bc1[_0x0577('0x1bc')]-=_0x2955b5;_0x8c5bc1[_0x0577('0x1bc')]=_0x8c5bc1[_0x0577('0x1bc')]>0x0?_0x8c5bc1['temp']:0x0;if(!checkContactEmpty(_0x224d52)){_0x8c5bc1['message']=_0x0577('0x8d');logger[_0x0577('0x77')](_0x0577('0x1be')+_0x8c5bc1[_0x0577('0x41')]);}else{_0x8c5bc1[_0x0577('0x6d')]+=_0x224d52[_0x0577('0x87')];_0x8c5bc1[_0x0577('0x40')]=_0x0577('0x1bf');for(var _0x42c88d=0x0;_0x42c88d<_0x224d52[_0x0577('0x87')];_0x42c88d+=0x1){_0x8c5bc1[_0x0577('0x1c0')]+=0x1;if(_[_0x0577('0x9d')](_0x224d52[_0x42c88d])||_[_0x0577('0x9d')](_0x224d52[_0x42c88d][_0x0577('0x136')])||_['isNil'](_0x224d52[_0x42c88d][_0x0577('0x136')][_0x0577('0x137')])){_0x2599a3[_0x0577('0xb8')](_0x0577('0x1c1'),_0x8c5bc1,_0x224d52[_0x42c88d]);}else{_0x2599a3[_0x0577('0xa9')](_[_0x0577('0xbb')](_0x224d52[_0x42c88d],['CampaignId','Contact.phone']))['then'](_0x2599a3[_0x0577('0x1a9')](_0x8c5bc1,_0x224d52[_0x42c88d]))[_0x0577('0x9f')](_0x2599a3['loggerHandler'](_0x0577('0x1c2'),_0x8c5bc1));}}}})[_0x0577('0x9f')](loggerGetContactDialer('[getContactCampaign2]',_0x8c5bc1,_0x2955b5));}};Dialer['prototype'][_0x0577('0x123')]=function(_0x3db184,_0x663361){var _0x286815=this;var _0xfe71b9=[];var _0x2aa155=_0x663361>=0x1?_0x663361:0x1;var _0x1db7ef=[];if(_0x3db184[_0x0577('0x55')]===_0x0577('0x7')){_0x2aa155=0x1;}var _0xf84bf4=Math[_0x0577('0x186')](_0x3db184[_0x0577('0x91')]*_0x2aa155)-_0x3db184['originated']-_0x3db184[_0x0577('0x1bc')];emitVoiceQueueSummary(_0x3db184);if(_0x3db184[_0x0577('0x1c3')]>0x0){var _0x5cf4f7=_0x3db184[_0x0577('0x1c3')]-_0x3db184[_0x0577('0x6d')]-_0x3db184[_0x0577('0x90')]-_0x3db184['temp']-_0x3db184[_0x0577('0x4e')];if(_0xf84bf4>_0x5cf4f7){_0xf84bf4=_0x5cf4f7;}}if(_0xf84bf4>0x0){if(_0x3db184[_0x0577('0x55')]===_0x0577('0x7')){_0xf84bf4=0x1;}if(_0xf84bf4>this[_0x0577('0x26')]){_0xf84bf4=this[_0x0577('0x26')];}_0x3db184['temp']+=_0xf84bf4;for(var _0x35daf8 in this['agents']){if(this[_0x0577('0x24')][_0x0577('0x9c')](_0x35daf8)){if(this['agents'][_0x35daf8][_0x0577('0x98')]===_0x0577('0x1c4')&&this[_0x0577('0x24')][_0x35daf8][_0x0577('0x9e')]===_0x0577('0xc5')){_0xfe71b9[_0x0577('0xf8')](this[_0x0577('0x24')][_0x35daf8]['id']);}}}this['getContactDialer'](_0x3db184['id'],_0xfe71b9,_0xf84bf4,_0x3db184[_0x0577('0x1bd')])[_0x0577('0xa5')](function(_0x437e2d){_0x3db184[_0x0577('0x1bc')]-=_0xf84bf4;_0x3db184['temp']=_0x3db184[_0x0577('0x1bc')]>0x0?_0x3db184[_0x0577('0x1bc')]:0x0;if(!checkContactEmpty(_0x437e2d)){_0x286815[_0x0577('0xa6')](_0x3db184)[_0x0577('0xa5')](sendMessageReschedule(_0x3db184))[_0x0577('0x9f')](loggerCatch(_0x0577('0x1c5')));}else{_0x3db184['originated']+=_0x437e2d['length'];_0x3db184[_0x0577('0x40')]=_0x3db184['dialMethod']===_0x0577('0x7')?_0x0577('0x1c6'):_0x0577('0x1bf');for(var _0x5b91ac=0x0;_0x5b91ac<_0x437e2d['length'];_0x5b91ac+=0x1){if(_[_0x0577('0x9d')](_0x437e2d[_0x5b91ac])||_[_0x0577('0x9d')](_0x437e2d[_0x5b91ac][_0x0577('0x136')])||_[_0x0577('0x9d')](_0x437e2d[_0x5b91ac][_0x0577('0x136')][_0x0577('0x137')])){_0x286815['emptyContact'](_0x0577('0x1c1'),_0x3db184,_0x437e2d[_0x5b91ac]);}else{_0x286815[_0x0577('0xa7')](_[_0x0577('0xbb')](_0x437e2d[_0x5b91ac],[_0x0577('0xbf'),_0x0577('0x1c7')]))[_0x0577('0xa5')](_0x286815[_0x0577('0x1a9')](_0x3db184,_0x437e2d[_0x5b91ac]))['catch'](_0x286815[_0x0577('0xb7')]('[actionOriginate]\x20',_0x3db184));}}}})[_0x0577('0x9f')](loggerGetContactDialer(_0x0577('0x1c8'),_0x3db184,_0xf84bf4));}};Dialer[_0x0577('0x1c')][_0x0577('0x80')]=function(_0x50c261){var _0x573e27=this;if(_0x50c261['dialLimitQueue']>0x0){var _0x490828=_0x50c261[_0x0577('0x1c3')]-_0x50c261[_0x0577('0x6d')]-_0x50c261[_0x0577('0x90')];if(_0x490828>0x0){this[_0x0577('0x1c9')](_0x50c261);}else{loggerPredictiveCalls[_0x0577('0x77')](_0x0577('0x1ca'));}}else{this['tryOriginatePredictive'](_0x50c261);}};Dialer[_0x0577('0x1c')][_0x0577('0x1c9')]=function(_0x40bc94){var _0x1a23e0=this;var _0x1be220=[];_0x40bc94['originated']+=0x1;for(var _0x3d66dc in this[_0x0577('0x24')]){if(this[_0x0577('0x24')]['hasOwnProperty'](_0x3d66dc)){if(this[_0x0577('0x24')][_0x3d66dc][_0x0577('0x98')]==='not_inuse'&&this[_0x0577('0x24')][_0x3d66dc]['status']===_0x0577('0xc5')){_0x1be220[_0x0577('0xf8')](this[_0x0577('0x24')][_0x3d66dc]['id']);}}}this[_0x0577('0x1cb')](_0x40bc94['id'],_0x1be220,0x1,_0x40bc94[_0x0577('0x1bd')])['then'](function(_0x43709e){if(!checkContactEmpty(_0x43709e)){checkContactLowerLimitOriginate(_0x40bc94,0x1,0x0);_0x1a23e0[_0x0577('0xa6')](_0x40bc94)[_0x0577('0xa5')](sendMessageReschedule(_0x40bc94))[_0x0577('0x9f')](loggerCatch(_0x0577('0x1c5')));}else{_0x40bc94[_0x0577('0x40')]=_0x0577('0x1bf');if(_[_0x0577('0x9d')](_0x43709e[0x0])||_['isNil'](_0x43709e[0x0][_0x0577('0x136')])||_[_0x0577('0x9d')](_0x43709e[0x0][_0x0577('0x136')][_0x0577('0x137')])){_0x1a23e0[_0x0577('0xb8')](_0x0577('0x1c1'),_0x40bc94,_0x43709e[0x0]);}else{_0x1a23e0[_0x0577('0xa7')](_['pick'](_0x43709e[0x0],[_0x0577('0xbf'),_0x0577('0x1c7')]))[_0x0577('0xa5')](_0x1a23e0[_0x0577('0x1a9')](_0x40bc94,_0x43709e[0x0]))[_0x0577('0x9f')](_0x1a23e0[_0x0577('0xb7')]('[actionOriginatePredictive]\x20',_0x40bc94));}}})[_0x0577('0x9f')](loggerGetContactDialer(_0x0577('0x1cc'),_0x40bc94,0x1));emitVoiceQueueSummary(_0x40bc94);};Dialer[_0x0577('0x1c')][_0x0577('0x1a0')]=function(_0x376f5f,_0x5769c4,_0x3359f4,_0x1bdf7c,_0x4bd6a9,_0x3679b3){loggerPredictive['info'](_0x0577('0x1cd'),_0x0577('0x1ce'),_0x376f5f,'\x20interval\x20=\x20',_0x5769c4,_0x0577('0x1cf'),_0x3359f4,_0x0577('0x1d0'),_0x1bdf7c,_0x0577('0x1d1'),_0x4bd6a9);return new BPromise(function(_0x227512,_0x3c9399){if(_0x376f5f<=0x0||isNaN(_0x376f5f)){return _0x3c9399(msgResponse(_0x0577('0x1cd'),_0x0577('0x48'),_0x0577('0x1d2')+_0x376f5f));}if(_0x3359f4<=0x0||isNaN(_0x3359f4)){return _0x3c9399(msgResponse(_0x0577('0x1cd'),_0x0577('0x48'),_0x0577('0x1d3')+_0x3359f4));}if(_0x1bdf7c<=0x0||isNaN(_0x1bdf7c)){return _0x3c9399(msgResponse('[abandonmentRate]',_0x0577('0x48'),_0x0577('0x1d4')+_0x1bdf7c));}if(_0x5769c4<=0x0||isNaN(_0x5769c4)){return _0x3c9399(msgResponse(_0x0577('0x1cd'),_0x0577('0x48'),_0x0577('0x1d5')+_0x5769c4));}if(_0x4bd6a9<=0x0||isNaN(_0x4bd6a9)){return _0x3c9399(msgResponse(_0x0577('0x1cd'),_0x0577('0x48'),_0x0577('0x1d6')+_0x4bd6a9));}_0x3679b3=_0x3679b3||0x0;var _0xa76cb4=0x1/_0x3359f4;var _0x1a8ce2=0x0;var _0x50c467=0x0;var _0x2577c7=0x0;var _0x387e49=0x0;for(var _0x1675ee=0x0;_0x2577c7<_0x4bd6a9;_0x1675ee+=0x1){_0x50c467=_0x1675ee/_0x5769c4;_0x1a8ce2=(_0x1bdf7c*_0x50c467+_0x3679b3)/_0xa76cb4;_0x2577c7=erlangb(_0x1a8ce2,_0x376f5f);_0x387e49=_0x1a8ce2/_0x376f5f*(0x1-erlangb(_0x1a8ce2,_0x376f5f));}return _0x227512({'erlangCalls':_0x1675ee,'erlangCallToSecond':_0x5769c4/_0x1675ee,'erlangAbandonmentRate':_0x2577c7,'erlangBusyFactor':_0x387e49});});};Dialer['prototype'][_0x0577('0x1d7')]=function(_0x12111a,_0x9dce0f,_0x27f67b,_0x275f06,_0x25a4af,_0x228d97){loggerPredictive[_0x0577('0x77')](_0x0577('0x1d8'),_0x0577('0x1ce'),_0x12111a,_0x0577('0x1d9'),_0x9dce0f,_0x0577('0x1cf'),_0x27f67b,_0x0577('0x1d0'),_0x275f06,'\x20Umin\x20=\x20',_0x25a4af);return new BPromise(function(_0x45f8f5,_0x1b702f){if(_0x12111a<=0x0||isNaN(_0x12111a)){return _0x1b702f(msgResponse('[abandonmentRate]','Error',_0x0577('0x1d2')+_0x12111a));}if(_0x27f67b<=0x0||isNaN(_0x27f67b)){return _0x1b702f(msgResponse(_0x0577('0x1cd'),_0x0577('0x48'),_0x0577('0x1d3')+_0x27f67b));}if(_0x275f06<=0x0||isNaN(_0x275f06)){return _0x1b702f(msgResponse(_0x0577('0x1cd'),_0x0577('0x48'),'p\x20=\x20'+_0x275f06));}if(_0x9dce0f<=0x0||isNaN(_0x9dce0f)){return _0x1b702f(msgResponse('[abandonmentRate]',_0x0577('0x48'),_0x0577('0x1d5')+_0x9dce0f));}if(_0x25a4af<=0x0||isNaN(_0x25a4af)){return _0x1b702f(msgResponse(_0x0577('0x1cd'),'Error',_0x0577('0x1d6')+_0x25a4af));}_0x228d97=_0x228d97||0x0;var _0x6bfb1a=0x1/_0x27f67b;var _0x1d740d=0x0;var _0x162197=0x0;var _0x374f2a=0x0;var _0x182e0b=0x0;for(var _0x107b7c=0x0;_0x182e0b<_0x25a4af;_0x107b7c+=0x1){_0x162197=_0x107b7c/_0x9dce0f;_0x1d740d=(_0x275f06*_0x162197+_0x228d97)/_0x6bfb1a;_0x374f2a=erlangb(_0x1d740d,_0x12111a);_0x182e0b=_0x1d740d/_0x12111a*(0x1-erlangb(_0x1d740d,_0x12111a));}return _0x45f8f5({'erlangCalls':_0x107b7c,'erlangCallToSecond':_0x9dce0f/_0x107b7c,'erlangAbandonmentRate':_0x374f2a,'erlangBusyFactor':_0x182e0b});});};module[_0x0577('0x1da')]=Dialer;
\ No newline at end of file
index 84ba3bd..50c0796 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9418=['outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','responsetime','droptime','endtime','ringtime','holdtime','talktime','queue','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','scheduledat','type','campaigntype'];(function(_0x38323a,_0x3374f5){var _0x5af6d3=function(_0x576803){while(--_0x576803){_0x38323a['push'](_0x38323a['shift']());}};_0x5af6d3(++_0x3374f5);}(_0x9418,0xb7));var _0x8941=function(_0x324496,_0x3a4cdd){_0x324496=_0x324496-0x0;var _0x899545=_0x9418[_0x324496];return _0x899545;};'use strict';var util=require(_0x8941('0x0'));var _=require(_0x8941('0x1'));var moment=require(_0x8941('0x2'));function getSeconds(_0x4e3a6b,_0x1dfcc9){var _0x3308d0=moment(_0x4e3a6b)[_0x8941('0x3')](0x0);var _0x123f1e=moment(_0x1dfcc9)[_0x8941('0x3')](0x0);return _0x3308d0['diff'](_0x123f1e,'seconds');}function QueueCallerAbandon(_0x400b41,_0x1e7c4b){this[_0x8941('0x4')]=_0x400b41[_0x8941('0x4')];this[_0x8941('0x5')]=_0x400b41[_0x8941('0x5')];this[_0x8941('0x6')]=_0x400b41[_0x8941('0x5')]===_0x8941('0x7')?'queue':_0x400b41[_0x8941('0x5')];this[_0x8941('0x8')]=_0x400b41[_0x8941('0x8')];this[_0x8941('0x9')]=_0x400b41[_0x8941('0x9')];this['countnoanswerretry']=_0x400b41[_0x8941('0xa')];this[_0x8941('0xb')]=_0x400b41[_0x8941('0x8')]+_0x400b41[_0x8941('0x9')]+_0x400b41['countnoanswerretry'];this[_0x8941('0xc')]=_0x1e7c4b[_0x8941('0xc')];this[_0x8941('0xd')]=_0x400b41[_0x8941('0xe')];this[_0x8941('0xf')]=_0x400b41[_0x8941('0x10')];this['starttime']=_0x400b41['starttime'];this[_0x8941('0x11')]=_0x400b41[_0x8941('0x11')];this[_0x8941('0x12')]=_0x400b41['droptime'];this[_0x8941('0x13')]=this[_0x8941('0x12')];this[_0x8941('0x14')]=getSeconds(_0x400b41[_0x8941('0x11')],_0x400b41['starttime']);this[_0x8941('0x15')]=getSeconds(this['droptime'],_0x400b41['responsetime']);this[_0x8941('0x16')]=0x0;this[_0x8941('0x17')]=_0x1e7c4b[_0x8941('0x17')];this['membername']=_0x1e7c4b[_0x8941('0x18')];this[_0x8941('0x19')]=_0x1e7c4b[_0x8941('0x19')];this[_0x8941('0x1a')]=_0x400b41[_0x8941('0x1a')];this['callbackuniqueid']=_0x400b41[_0x8941('0x1b')];this[_0x8941('0x1c')]=_0x400b41[_0x8941('0x1c')];this[_0x8941('0x1d')]=_0x400b41[_0x8941('0x1d')];this[_0x8941('0x1e')]=_0x400b41[_0x8941('0x1e')];this[_0x8941('0x1f')]=_0x400b41['ListId'];this[_0x8941('0x20')]=_0x400b41['UserId'];this[_0x8941('0x21')]=_0x400b41[_0x8941('0x21')];this['CampaignId']=_0x400b41[_0x8941('0x22')];this[_0x8941('0x23')]=_0x400b41[_0x8941('0x23')]||'';this[_0x8941('0x24')]=_0x400b41[_0x8941('0x24')]||'';}module[_0x8941('0x25')]=QueueCallerAbandon;
\ No newline at end of file
+var _0xb6cd=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x41d0e7,_0x2a5994){var _0x4c04e0=function(_0x5d3e96){while(--_0x5d3e96){_0x41d0e7['push'](_0x41d0e7['shift']());}};_0x4c04e0(++_0x2a5994);}(_0xb6cd,0x16f));var _0xdb6c=function(_0x48d259,_0x4b1395){_0x48d259=_0x48d259-0x0;var _0x1e97c9=_0xb6cd[_0x48d259];return _0x1e97c9;};'use strict';var util=require(_0xdb6c('0x0'));var _=require(_0xdb6c('0x1'));var moment=require('moment');function getSeconds(_0x199e7d,_0x2177ee){var _0x26321d=moment(_0x199e7d)[_0xdb6c('0x2')](0x0);var _0x229e67=moment(_0x2177ee)['milliseconds'](0x0);return _0x26321d[_0xdb6c('0x3')](_0x229e67,'seconds');}function QueueCallerAbandon(_0x28a49f,_0x5637a2){this[_0xdb6c('0x4')]=_0x28a49f['scheduledat'];this[_0xdb6c('0x5')]=_0x28a49f[_0xdb6c('0x5')];this[_0xdb6c('0x6')]=_0x28a49f['type']===_0xdb6c('0x7')?_0xdb6c('0x8'):_0x28a49f[_0xdb6c('0x5')];this[_0xdb6c('0x9')]=_0x28a49f[_0xdb6c('0x9')];this[_0xdb6c('0xa')]=_0x28a49f[_0xdb6c('0xa')];this[_0xdb6c('0xb')]=_0x28a49f['countnoanswerretry'];this['countglobal']=_0x28a49f['countbusyretry']+_0x28a49f[_0xdb6c('0xa')]+_0x28a49f[_0xdb6c('0xb')];this[_0xdb6c('0xc')]=_0x5637a2[_0xdb6c('0xc')];this['calleridname']=_0x28a49f[_0xdb6c('0xd')];this[_0xdb6c('0xe')]=_0x28a49f[_0xdb6c('0xf')];this[_0xdb6c('0x10')]=_0x28a49f[_0xdb6c('0x10')];this['responsetime']=_0x28a49f[_0xdb6c('0x11')];this[_0xdb6c('0x12')]=_0x28a49f[_0xdb6c('0x12')];this[_0xdb6c('0x13')]=this[_0xdb6c('0x12')];this[_0xdb6c('0x14')]=getSeconds(_0x28a49f[_0xdb6c('0x11')],_0x28a49f['starttime']);this[_0xdb6c('0x15')]=getSeconds(this[_0xdb6c('0x12')],_0x28a49f[_0xdb6c('0x11')]);this[_0xdb6c('0x16')]=0x0;this[_0xdb6c('0x8')]=_0x5637a2['queue'];this['membername']=_0x5637a2['connectedlinename'];this['reason']=_0x5637a2[_0xdb6c('0x17')];this['callback']=_0x28a49f[_0xdb6c('0x18')];this['callbackuniqueid']=_0x28a49f[_0xdb6c('0x19')];this[_0xdb6c('0x1a')]=_0x28a49f[_0xdb6c('0x1a')];this[_0xdb6c('0x1b')]=_0x28a49f['recallme'];this[_0xdb6c('0x1c')]=_0x28a49f['ContactId'];this['ListId']=_0x28a49f[_0xdb6c('0x1d')];this[_0xdb6c('0x1e')]=_0x28a49f[_0xdb6c('0x1e')];this[_0xdb6c('0x1f')]=_0x28a49f[_0xdb6c('0x1f')];this['CampaignId']=_0x28a49f[_0xdb6c('0x20')];this['originatecalleridnum']=_0x28a49f[_0xdb6c('0x21')]||'';this['originatecalleridname']=_0x28a49f[_0xdb6c('0x22')]||'';}module[_0xdb6c('0x23')]=QueueCallerAbandon;
\ No newline at end of file
index 9a9d590..b9f34e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9104=['name','fax','localstationid','headerinfo','path','AttachmentId','exports','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x5763b7,_0x17eaa1){var _0x2430a5=function(_0x4fe8d8){while(--_0x4fe8d8){_0x5763b7['push'](_0x5763b7['shift']());}};_0x2430a5(++_0x17eaa1);}(_0x9104,0x1ab));var _0x4910=function(_0x2b95e1,_0x493700){_0x2b95e1=_0x2b95e1-0x0;var _0x12a9b8=_0x9104[_0x2b95e1];return _0x12a9b8;};'use strict';var util=require('util');var _=require(_0x4910('0x0'));var moment=require(_0x4910('0x1'));function Action(_0xf9ffae,_0x11548c,_0x4e5b32){this['uniqueid']=_0xf9ffae||undefined;this[_0x4910('0x2')]=util[_0x4910('0x3')](_0x4910('0x4'),_0x11548c[_0x4910('0x5')],_0x11548c[_0x4910('0x6')][_0x4910('0x7')],_0x4e5b32[_0x4910('0x8')]);this[_0x4910('0x9')]=_0x11548c[_0x4910('0x9')];this[_0x4910('0xa')]=_0x11548c['headerinfo'];this['path']=_0x4e5b32[_0x4910('0xb')];this[_0x4910('0xc')]=_0x4e5b32['AttachmentId'];}module[_0x4910('0xd')]=Action;
\ No newline at end of file
+var _0x46f0=['path','AttachmentId','exports','lodash','moment','uniqueid','format','%s/%s/%s','name','fax','localstationid','headerinfo'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x46f0,0x1a7));var _0x046f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x46f0[_0x4a9fb1];return _0x348672;};'use strict';var util=require('util');var _=require(_0x046f('0x0'));var moment=require(_0x046f('0x1'));function Action(_0x9a4ff5,_0x104c05,_0x549667){this[_0x046f('0x2')]=_0x9a4ff5||undefined;this['channel']=util[_0x046f('0x3')](_0x046f('0x4'),_0x104c05['tech'],_0x104c05['Trunk'][_0x046f('0x5')],_0x549667[_0x046f('0x6')]);this[_0x046f('0x7')]=_0x104c05[_0x046f('0x7')];this['headerinfo']=_0x104c05[_0x046f('0x8')];this[_0x046f('0x9')]=_0x549667[_0x046f('0x9')];this[_0x046f('0xa')]=_0x549667[_0x046f('0xa')];}module[_0x046f('0xb')]=Action;
\ No newline at end of file
index e823e19..926cce4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f00=['syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','prototype','channelstate','channelstatedesc','value','operation','status','remotestationid','pagestransferred','resolution','transferrate','filename','calleridnum','message','create','parse','application/pdf','then','notify','.pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','dir','Convert\x20pdf\x20to\x20tif','ext','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','./util/gs','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate'];(function(_0x391c55,_0x168617){var _0xa434e0=function(_0x51fa5c){while(--_0x51fa5c){_0x391c55['push'](_0x391c55['shift']());}};_0xa434e0(++_0x168617);}(_0x9f00,0x147));var _0x09f0=function(_0x2dee2f,_0x19572f){_0x2dee2f=_0x2dee2f-0x0;var _0x327c18=_0x9f00[_0x2dee2f];return _0x327c18;};'use strict';var util=require(_0x09f0('0x0'));var _=require(_0x09f0('0x1'));var BPromise=require(_0x09f0('0x2'));var uuid=require(_0x09f0('0x3'));var moment=require(_0x09f0('0x4'));var path=require(_0x09f0('0x5'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x09f0('0x6'));var logger=require('../../../config/logger')(_0x09f0('0x7'));var ami=require(_0x09f0('0x8'));var rpcDb=require(_0x09f0('0x9'));var Channel=require(_0x09f0('0xa'));var ut=require(_0x09f0('0xb'));var Action=require(_0x09f0('0xc'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x09f0('0xd'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x1cfa74){this[_0x09f0('0xe')]={};this[_0x09f0('0xf')]=_0x1cfa74[_0x09f0('0xf')];this[_0x09f0('0x10')]=_0x1cfa74['trunks'];this[_0x09f0('0x11')]={};ami['on'](_0x09f0('0x12'),this[_0x09f0('0x13')][_0x09f0('0x14')](this));ami['on'](_0x09f0('0x15'),this[_0x09f0('0x16')][_0x09f0('0x14')](this));ami['on'](_0x09f0('0x17'),this[_0x09f0('0x18')][_0x09f0('0x14')](this));ami['on'](_0x09f0('0x19'),this[_0x09f0('0x1a')][_0x09f0('0x14')](this));ami['on'](_0x09f0('0x1b'),this[_0x09f0('0x1c')][_0x09f0('0x14')](this));ami['on'](_0x09f0('0x1d'),this[_0x09f0('0x1e')][_0x09f0('0x14')](this));ami['on'](_0x09f0('0x1f'),this[_0x09f0('0x20')][_0x09f0('0x14')](this));ami['on'](_0x09f0('0x21'),this['syncOriginateResponse'][_0x09f0('0x14')](this));}Fax['prototype']['syncNewchannel']=function(_0x9ae5f3){if(_0x9ae5f3[_0x09f0('0x22')]===_0x09f0('0x23')){for(var _0x45810c in this[_0x09f0('0xf')]){if(this[_0x09f0('0xf')][_0x09f0('0x24')](_0x45810c)){if(_0x9ae5f3[_0x09f0('0x25')]===this[_0x09f0('0xf')][_0x45810c][_0x09f0('0x26')]){this[_0x09f0('0xe')][_0x9ae5f3[_0x09f0('0x27')]]={};this[_0x09f0('0xe')][_0x9ae5f3[_0x09f0('0x27')]][_0x09f0('0x28')]=_0x9ae5f3['channel'];this[_0x09f0('0xe')][_0x9ae5f3[_0x09f0('0x27')]]['id']=this['faxAccounts'][_0x45810c]['id'];this[_0x09f0('0xe')][_0x9ae5f3['uniqueid']][_0x09f0('0x29')]=this[_0x09f0('0xf')][_0x45810c]['name'];logger[_0x09f0('0x2a')](_0x9ae5f3[_0x09f0('0x27')],_0x09f0('0x2b'));}}}}if(this['actions'][_0x9ae5f3[_0x09f0('0x27')]]){this['channels'][_0x9ae5f3[_0x09f0('0x27')]]={};this[_0x09f0('0xe')][_0x9ae5f3[_0x09f0('0x27')]][_0x09f0('0x28')]=_0x9ae5f3[_0x09f0('0x28')];logger['info'](_0x9ae5f3[_0x09f0('0x27')],_0x09f0('0x2b'));}};Fax['prototype'][_0x09f0('0x16')]=function(_0x5cae89){if(this[_0x09f0('0xe')][_0x5cae89[_0x09f0('0x27')]]){for(var _0x33028a in _0x5cae89[_0x09f0('0x2c')]){if(_0x5cae89[_0x09f0('0x2c')]['hasOwnProperty'](_0x33028a)){this[_0x09f0('0xe')][_0x5cae89[_0x09f0('0x27')]][_0x33028a]=_0x5cae89['value'];}}}};Fax[_0x09f0('0x2d')][_0x09f0('0x18')]=function(_0x537faa){if(this[_0x09f0('0xe')][_0x537faa[_0x09f0('0x27')]]){this[_0x09f0('0xe')][_0x537faa['uniqueid']][_0x09f0('0x2e')]=_0x537faa[_0x09f0('0x2e')];this[_0x09f0('0xe')][_0x537faa[_0x09f0('0x27')]][_0x09f0('0x2f')]=_0x537faa[_0x09f0('0x2f')];}};Fax[_0x09f0('0x2d')]['syncNewExten']=function(_0x43788b){if(this[_0x09f0('0xe')][_0x43788b['uniqueid']]){for(var _0x52e19a in _0x43788b[_0x09f0('0x2c')]){if(_0x43788b['variable'][_0x09f0('0x24')](_0x52e19a)){this[_0x09f0('0xe')][_0x43788b[_0x09f0('0x27')]][_0x52e19a]=_0x43788b[_0x09f0('0x30')];}}}};Fax[_0x09f0('0x2d')][_0x09f0('0x1c')]=function(_0x46a11a){if(this['channels'][_0x46a11a[_0x09f0('0x27')]]){this[_0x09f0('0xe')][_0x46a11a[_0x09f0('0x27')]]['operation']=_0x46a11a[_0x09f0('0x31')];this[_0x09f0('0xe')][_0x46a11a[_0x09f0('0x27')]]['status']=_0x46a11a[_0x09f0('0x32')];this[_0x09f0('0xe')][_0x46a11a[_0x09f0('0x27')]][_0x09f0('0x26')]=_0x46a11a[_0x09f0('0x26')];this['channels'][_0x46a11a['uniqueid']]['filename']=_0x46a11a['filename'];logger['info'](_0x46a11a[_0x09f0('0x27')],'\x20syncFaxStatus\x20');}};Fax[_0x09f0('0x2d')][_0x09f0('0x1e')]=function(_0x4507ad){var _0xe5a620=this;if(this[_0x09f0('0xe')][_0x4507ad[_0x09f0('0x27')]]){var _0x21e961=this[_0x09f0('0xe')][_0x4507ad[_0x09f0('0x27')]]['id'];this[_0x09f0('0xe')][_0x4507ad[_0x09f0('0x27')]][_0x09f0('0x33')]=_0x4507ad[_0x09f0('0x33')];this['channels'][_0x4507ad['uniqueid']]['pagestransferred']=_0x4507ad[_0x09f0('0x34')];this[_0x09f0('0xe')][_0x4507ad['uniqueid']][_0x09f0('0x26')]=_0x4507ad[_0x09f0('0x26')];this[_0x09f0('0xe')][_0x4507ad[_0x09f0('0x27')]][_0x09f0('0x35')]=_0x4507ad[_0x09f0('0x35')];this[_0x09f0('0xe')][_0x4507ad[_0x09f0('0x27')]][_0x09f0('0x36')]=_0x4507ad[_0x09f0('0x36')];this[_0x09f0('0xe')][_0x4507ad[_0x09f0('0x27')]][_0x09f0('0x37')]=_0x4507ad[_0x09f0('0x37')];this[_0x09f0('0xe')][_0x4507ad[_0x09f0('0x27')]][_0x09f0('0x38')]=_0x4507ad[_0x09f0('0x38')];if(this['channels'][_0x4507ad[_0x09f0('0x27')]][_0x09f0('0x34')]>0x0){tiff2pdf(_0x4507ad['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x4a32a7){logger[_0x09f0('0x2a')](_0x4507ad[_0x09f0('0x27')],'\x20result\x20conversion\x20file\x20',_0x4a32a7[_0x09f0('0x39')]);attachment[_0x09f0('0x3a')]({'name':path['parse'](_0x4507ad[_0x09f0('0x37')])[_0x09f0('0x29')],'basename':path[_0x09f0('0x3b')](_0x4507ad['filename'])[_0x09f0('0x29')]+'.pdf','type':_0x09f0('0x3c')})[_0x09f0('0x3d')](function(_0x4d5dbb){faxAccount[_0x09f0('0x3e')](_0x21e961,{'from':_0x4507ad[_0x09f0('0x38')],'mapKey':_0x09f0('0x7'),'body':path[_0x09f0('0x3b')](_0x4507ad[_0x09f0('0x37')])[_0x09f0('0x29')]+_0x09f0('0x3f'),'AttachmentId':_0x4d5dbb['id']})[_0x09f0('0x40')](function(_0x5f3adf){logger[_0x09f0('0x41')](_0x4507ad[_0x09f0('0x27')],_0x09f0('0x42'),JSON[_0x09f0('0x43')](_0x5f3adf));});})[_0x09f0('0x40')](function(_0x7bf2fd){logger[_0x09f0('0x41')](_0x4507ad['uniqueid'],'\x20receiveFax\x20',JSON[_0x09f0('0x43')](_0x7bf2fd));});});}logger[_0x09f0('0x2a')](_0x4507ad[_0x09f0('0x27')],_0x09f0('0x44'));}};Fax[_0x09f0('0x2d')][_0x09f0('0x45')]=function(_0x2e1c81){if(this['actions'][_0x2e1c81[_0x09f0('0x27')]]){_[_0x09f0('0x46')](this[_0x09f0('0xe')][_0x2e1c81[_0x09f0('0x27')]],_[_0x09f0('0x47')](_0x2e1c81,[_0x09f0('0x48'),'reason']));}};function updateStatus(_0x190a09){if(_0x190a09[_0x09f0('0x49')]){faxMessage['update'](_0x190a09[_0x09f0('0x49')],{'failMessage':_0x09f0('0x4a')})[_0x09f0('0x3d')](function(_0x2ce33f){ut[_0x09f0('0x4b')]('[Fax][Message][Error][Updated]',_0x2ce33f);})[_0x09f0('0x40')](function(_0x157694){ut[_0x09f0('0x4b')](_0x09f0('0x4c'),_0x157694);});}else{ut['logger'](_0x09f0('0x4d'));}}Fax[_0x09f0('0x2d')][_0x09f0('0x4e')]=function(_0x153668,_0x10e8c6,_0x2a77a1){var _0x4011a3=this;var _0x1b903a={};if(_0x10e8c6){_0x1b903a={'read':_0x10e8c6};}else{_0x1b903a={'failMessage':_0x2a77a1};}if(this[_0x09f0('0x11')][_0x153668][_0x09f0('0x49')]){faxMessage[_0x09f0('0x4f')](this[_0x09f0('0x11')][_0x153668][_0x09f0('0x49')],_0x1b903a)['then'](function(_0x1c705){ut['logger'](_0x09f0('0x50'),_0x1c705);})['catch'](function(_0x43d0df){ut['logger'](_0x09f0('0x51'),_0x43d0df);})[_0x09f0('0x52')](function(){delete _0x4011a3[_0x09f0('0xe')][_0x153668];delete _0x4011a3[_0x09f0('0x11')][_0x153668];});}else{ut[_0x09f0('0x4b')](_0x09f0('0x53'));delete this[_0x09f0('0xe')][_0x153668];delete this[_0x09f0('0x11')][_0x153668];}};Fax[_0x09f0('0x2d')]['syncHangup']=function(_0x2affb0){var _0x2710f5=this;if(this[_0x09f0('0xe')][_0x2affb0[_0x09f0('0x27')]]){if(this['actions'][_0x2affb0[_0x09f0('0x27')]]){this[_0x09f0('0xe')][_0x2affb0[_0x09f0('0x27')]]['id']=this[_0x09f0('0x11')][_0x2affb0[_0x09f0('0x27')]]['id'];this['channels'][_0x2affb0['uniqueid']][_0x09f0('0x29')]=this[_0x09f0('0x11')][_0x2affb0['uniqueid']][_0x09f0('0x29')];}logger[_0x09f0('0x2a')](_0x2affb0['uniqueid'],this[_0x09f0('0x11')][_0x2affb0[_0x09f0('0x27')]]?_0x09f0('0x54'):_0x09f0('0x55'),JSON['stringify'](this['channels'][_0x2affb0[_0x09f0('0x27')]]));if(this[_0x09f0('0x11')][_0x2affb0[_0x09f0('0x27')]]){if(this[_0x09f0('0xe')][_0x2affb0[_0x09f0('0x27')]]['faxpages']>0x0&&this[_0x09f0('0xe')][_0x2affb0[_0x09f0('0x27')]][_0x09f0('0x1b')]===_0x09f0('0x56')){this['updateStatus'](_0x2affb0[_0x09f0('0x27')],!![]);}else{this[_0x09f0('0x4e')](_0x2affb0[_0x09f0('0x27')],![],this[_0x09f0('0xe')][_0x2affb0[_0x09f0('0x27')]][_0x09f0('0x57')]?_0x09f0('0x58')+this[_0x09f0('0xe')][_0x2affb0[_0x09f0('0x27')]][_0x09f0('0x57')]:_0x09f0('0x59'));}}}};Fax[_0x09f0('0x2d')]['send']=function(_0xd8241a){var _0x13f1dc=this;return new BPromise(function(_0x3a65ed,_0x3c2017){_0x13f1dc[_0x09f0('0x5a')](_0xd8241a,_0x13f1dc['faxAccounts'][_0xd8241a[_0x09f0('0x5b')]])[_0x09f0('0x3d')](function(_0x18d6cf){ut['logger'](_0x09f0('0x5c'),_0x18d6cf);_0x3a65ed(ut[_0x09f0('0x39')]('Fax\x20received'));})[_0x09f0('0x40')](function(_0x167b2f){ut[_0x09f0('0x4b')](_0x09f0('0x5d'),_0x167b2f);updateStatus(_0xd8241a);_0x3c2017(ut[_0x09f0('0x39')](_0x09f0('0x5e')));});});};Fax[_0x09f0('0x2d')][_0x09f0('0x5f')]=function(_0xaac30f){var _0x12a98e=this;return new BPromise(function(_0x59eb38,_0x280b1f){var _0x50773a=_0x12a98e[_0x09f0('0x60')](_0x12a98e[_0x09f0('0xf')][_0xaac30f[_0x09f0('0x5b')]][_0x09f0('0x61')],_0xaac30f);if(_0x50773a['isValid']){_0x59eb38(ut[_0x09f0('0x39')](_0x09f0('0x62')));}else{_0x280b1f(ut['message'](_0x50773a[_0x09f0('0x39')]));}});};function originate(_0x187cdc,_0x5a20fd,_0x26a236){return new BPromise(function(_0x196cc3,_0x46afab){if(_0x26a236){var _0x3d34c0=util[_0x09f0('0x63')](_0x09f0('0x64'),path[_0x09f0('0x3b')](_0x187cdc['path'])[_0x09f0('0x29')],_0x187cdc[_0x09f0('0x5')]);gs[_0x09f0('0x65')](_0x3d34c0)[_0x09f0('0x3d')](function(){_0x187cdc[_0x09f0('0x5')]=util[_0x09f0('0x63')]('%s/%s.tif',path[_0x09f0('0x3b')](_0x187cdc[_0x09f0('0x5')])[_0x09f0('0x66')],path[_0x09f0('0x3b')](_0x187cdc[_0x09f0('0x5')])[_0x09f0('0x29')]);_0x5a20fd['XMF-PATH']=_0x187cdc[_0x09f0('0x5')];ut['logger'](_0x09f0('0x67'),'');ami['Action'](ut['variablesAction'](_0x187cdc,_0x5a20fd))[_0x09f0('0x3d')](function(_0x4bd395){_0x196cc3(_0x4bd395);})[_0x09f0('0x40')](function(_0x5ed0ce){_0x46afab(_0x5ed0ce);});})[_0x09f0('0x40')](function(_0x1ad2d2){_0x46afab(_0x1ad2d2);});}else{ami['Action'](ut['variablesAction'](_0x187cdc,_0x5a20fd))[_0x09f0('0x3d')](function(_0x5ee9ce){_0x196cc3(_0x5ee9ce);})[_0x09f0('0x40')](function(_0x3875bb){_0x46afab(_0x3875bb);});}});}Fax[_0x09f0('0x2d')][_0x09f0('0x5a')]=function(_0x550440,_0x29b6b6){var _0x2b8dd4=this;return new BPromise(function(_0x123c1a,_0x2577ab){var _0x305d1e=uuid['v4']();var _0x2609c7=ut['addVariables'](_0x550440,_0x29b6b6);_0x2b8dd4[_0x09f0('0x11')][_0x305d1e]=new Action(_0x305d1e,_0x29b6b6,_0x550440);var _0x2a5fe8=_0x2b8dd4[_0x09f0('0x11')][_0x305d1e];if(path[_0x09f0('0x3b')](_0x550440[_0x09f0('0x5')])[_0x09f0('0x68')]===_0x09f0('0x3f')){originate(_0x2a5fe8,_0x2609c7,!![])[_0x09f0('0x3d')](function(_0x1bee31){_0x123c1a(_0x1bee31);})[_0x09f0('0x40')](function(_0x25c5e0){_0x2577ab(_0x25c5e0);});}else{originate(_0x2a5fe8,_0x2609c7,![])['then'](function(_0x520810){_0x123c1a(_0x520810);})[_0x09f0('0x40')](function(_0x30b52f){_0x2577ab(_0x30b52f);});}});};Fax[_0x09f0('0x2d')]['isTrunkReachable']=function(_0x2b0cc5){return!_[_0x09f0('0x69')](_0x2b0cc5)&&!_[_0x09f0('0x69')](_0x2b0cc5[_0x09f0('0x29')])&&!_['isNil'](_0x2b0cc5[_0x09f0('0x6a')])&&_0x2b0cc5[_0x09f0('0x6a')]&&!_['isNil'](this[_0x09f0('0x10')][util[_0x09f0('0x63')](_0x09f0('0x6b'),_0x2b0cc5[_0x09f0('0x29')])])&&!_[_0x09f0('0x69')](this[_0x09f0('0x10')][util[_0x09f0('0x63')]('SIP/%s',_0x2b0cc5[_0x09f0('0x29')])]['status'])&&(this[_0x09f0('0x10')][util[_0x09f0('0x63')](_0x09f0('0x6b'),_0x2b0cc5[_0x09f0('0x29')])][_0x09f0('0x32')]===_0x09f0('0x6c')||this[_0x09f0('0x10')][util['format']('SIP/%s',_0x2b0cc5[_0x09f0('0x29')])][_0x09f0('0x32')]===_0x09f0('0x6d'));};Fax['prototype']['checkTrunk']=function(_0x2a9095,_0x50c9fe){if(!this[_0x09f0('0x6e')](_0x2a9095)){ut[_0x09f0('0x4b')](_0x09f0('0x6f'),_[_0x09f0('0x69')](_0x2a9095)?'':_0x2a9095[_0x09f0('0x29')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x09f0('0x70')};}if(_[_0x09f0('0x69')](_0x50c9fe['fax'])){ut[_0x09f0('0x4b')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x50c9fe));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x09f0('0x69')](_0x50c9fe[_0x09f0('0x5')])){ut[_0x09f0('0x4b')](_0x09f0('0x71'),JSON[_0x09f0('0x43')](_0x50c9fe));return{'isValid':![],'message':_0x09f0('0x72')};}return{'isValid':!![],'message':_0x09f0('0x73')};};module[_0x09f0('0x74')]=Fax;
\ No newline at end of file
+var _0x7016=['originateresponse','syncOriginateResponse','syncNewchannel','hasOwnProperty','exten','localstationid','uniqueid','name','\x20syncNewchannel\x20','actions','channel','prototype','variable','value','syncNewState','channelstate','channelstatedesc','operation','status','filename','info','syncReceiveFax','remotestationid','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxstatus','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','channels','faxAccounts','trunks','bind','varset','syncVarSet','syncNewExten','syncFaxStatus'];(function(_0x1bb7d5,_0x2f723a){var _0x375831=function(_0x3d442e){while(--_0x3d442e){_0x1bb7d5['push'](_0x1bb7d5['shift']());}};_0x375831(++_0x2f723a);}(_0x7016,0x145));var _0x6701=function(_0x428774,_0x383962){_0x428774=_0x428774-0x0;var _0x53a01c=_0x7016[_0x428774];return _0x53a01c;};'use strict';var util=require(_0x6701('0x0'));var _=require(_0x6701('0x1'));var BPromise=require(_0x6701('0x2'));var uuid=require(_0x6701('0x3'));var moment=require(_0x6701('0x4'));var path=require(_0x6701('0x5'));var tiff2pdf=require(_0x6701('0x6'));var gs=require('./util/gs');var logger=require(_0x6701('0x7'))(_0x6701('0x8'));var ami=require(_0x6701('0x9'));var rpcDb=require(_0x6701('0xa'));var Channel=require(_0x6701('0xb'));var ut=require(_0x6701('0xc'));var Action=require(_0x6701('0xd'));var faxAccount=require(_0x6701('0xe'));var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x509eb8){this[_0x6701('0xf')]={};this[_0x6701('0x10')]=_0x509eb8['faxAccounts'];this[_0x6701('0x11')]=_0x509eb8['trunks'];this['actions']={};ami['on']('newchannel',this['syncNewchannel'][_0x6701('0x12')](this));ami['on'](_0x6701('0x13'),this[_0x6701('0x14')][_0x6701('0x12')](this));ami['on']('newstate',this['syncNewState'][_0x6701('0x12')](this));ami['on']('newexten',this[_0x6701('0x15')][_0x6701('0x12')](this));ami['on']('faxstatus',this[_0x6701('0x16')]['bind'](this));ami['on']('receivefax',this['syncReceiveFax'][_0x6701('0x12')](this));ami['on']('hangup',this['syncHangup'][_0x6701('0x12')](this));ami['on'](_0x6701('0x17'),this[_0x6701('0x18')]['bind'](this));}Fax['prototype'][_0x6701('0x19')]=function(_0x2b119a){if(_0x2b119a['context']==='from-voip-provider'){for(var _0xe6613a in this['faxAccounts']){if(this[_0x6701('0x10')][_0x6701('0x1a')](_0xe6613a)){if(_0x2b119a[_0x6701('0x1b')]===this[_0x6701('0x10')][_0xe6613a][_0x6701('0x1c')]){this['channels'][_0x2b119a['uniqueid']]={};this['channels'][_0x2b119a[_0x6701('0x1d')]]['channel']=_0x2b119a['channel'];this[_0x6701('0xf')][_0x2b119a[_0x6701('0x1d')]]['id']=this[_0x6701('0x10')][_0xe6613a]['id'];this[_0x6701('0xf')][_0x2b119a[_0x6701('0x1d')]][_0x6701('0x1e')]=this['faxAccounts'][_0xe6613a][_0x6701('0x1e')];logger['info'](_0x2b119a['uniqueid'],_0x6701('0x1f'));}}}}if(this[_0x6701('0x20')][_0x2b119a[_0x6701('0x1d')]]){this[_0x6701('0xf')][_0x2b119a['uniqueid']]={};this['channels'][_0x2b119a[_0x6701('0x1d')]][_0x6701('0x21')]=_0x2b119a[_0x6701('0x21')];logger['info'](_0x2b119a[_0x6701('0x1d')],'\x20syncNewchannel\x20');}};Fax[_0x6701('0x22')][_0x6701('0x14')]=function(_0xb0bd24){if(this[_0x6701('0xf')][_0xb0bd24['uniqueid']]){for(var _0x2c98e4 in _0xb0bd24[_0x6701('0x23')]){if(_0xb0bd24['variable'][_0x6701('0x1a')](_0x2c98e4)){this[_0x6701('0xf')][_0xb0bd24[_0x6701('0x1d')]][_0x2c98e4]=_0xb0bd24[_0x6701('0x24')];}}}};Fax[_0x6701('0x22')][_0x6701('0x25')]=function(_0x2ef677){if(this[_0x6701('0xf')][_0x2ef677[_0x6701('0x1d')]]){this[_0x6701('0xf')][_0x2ef677[_0x6701('0x1d')]]['channelstate']=_0x2ef677[_0x6701('0x26')];this['channels'][_0x2ef677[_0x6701('0x1d')]]['channelstatedesc']=_0x2ef677[_0x6701('0x27')];}};Fax[_0x6701('0x22')]['syncNewExten']=function(_0x72a890){if(this[_0x6701('0xf')][_0x72a890[_0x6701('0x1d')]]){for(var _0x5efa70 in _0x72a890[_0x6701('0x23')]){if(_0x72a890[_0x6701('0x23')]['hasOwnProperty'](_0x5efa70)){this[_0x6701('0xf')][_0x72a890['uniqueid']][_0x5efa70]=_0x72a890[_0x6701('0x24')];}}}};Fax[_0x6701('0x22')][_0x6701('0x16')]=function(_0x22c709){if(this[_0x6701('0xf')][_0x22c709[_0x6701('0x1d')]]){this[_0x6701('0xf')][_0x22c709[_0x6701('0x1d')]][_0x6701('0x28')]=_0x22c709[_0x6701('0x28')];this[_0x6701('0xf')][_0x22c709['uniqueid']][_0x6701('0x29')]=_0x22c709[_0x6701('0x29')];this[_0x6701('0xf')][_0x22c709[_0x6701('0x1d')]]['localstationid']=_0x22c709[_0x6701('0x1c')];this[_0x6701('0xf')][_0x22c709[_0x6701('0x1d')]][_0x6701('0x2a')]=_0x22c709[_0x6701('0x2a')];logger[_0x6701('0x2b')](_0x22c709['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0x6701('0x22')][_0x6701('0x2c')]=function(_0x505916){var _0x32fd4a=this;if(this[_0x6701('0xf')][_0x505916[_0x6701('0x1d')]]){var _0x271803=this[_0x6701('0xf')][_0x505916[_0x6701('0x1d')]]['id'];this[_0x6701('0xf')][_0x505916[_0x6701('0x1d')]][_0x6701('0x2d')]=_0x505916[_0x6701('0x2d')];this[_0x6701('0xf')][_0x505916['uniqueid']]['pagestransferred']=_0x505916['pagestransferred'];this['channels'][_0x505916[_0x6701('0x1d')]][_0x6701('0x1c')]=_0x505916[_0x6701('0x1c')];this['channels'][_0x505916[_0x6701('0x1d')]][_0x6701('0x2e')]=_0x505916[_0x6701('0x2e')];this[_0x6701('0xf')][_0x505916[_0x6701('0x1d')]][_0x6701('0x2f')]=_0x505916[_0x6701('0x2f')];this[_0x6701('0xf')][_0x505916['uniqueid']][_0x6701('0x2a')]=_0x505916[_0x6701('0x2a')];this[_0x6701('0xf')][_0x505916['uniqueid']]['calleridnum']=_0x505916[_0x6701('0x30')];if(this[_0x6701('0xf')][_0x505916[_0x6701('0x1d')]]['pagestransferred']>0x0){tiff2pdf(_0x505916[_0x6701('0x2a')],_0x6701('0x31'),function(_0x4644ed){logger[_0x6701('0x2b')](_0x505916[_0x6701('0x1d')],_0x6701('0x32'),_0x4644ed[_0x6701('0x33')]);attachment[_0x6701('0x34')]({'name':path[_0x6701('0x35')](_0x505916[_0x6701('0x2a')])[_0x6701('0x1e')],'basename':path[_0x6701('0x35')](_0x505916[_0x6701('0x2a')])[_0x6701('0x1e')]+_0x6701('0x36'),'type':_0x6701('0x37')})[_0x6701('0x38')](function(_0x20a53b){faxAccount[_0x6701('0x39')](_0x271803,{'from':_0x505916['calleridnum'],'mapKey':_0x6701('0x8'),'body':path[_0x6701('0x35')](_0x505916['filename'])[_0x6701('0x1e')]+_0x6701('0x36'),'AttachmentId':_0x20a53b['id']})[_0x6701('0x3a')](function(_0x2a9205){logger['error'](_0x505916[_0x6701('0x1d')],_0x6701('0x3b'),JSON[_0x6701('0x3c')](_0x2a9205));});})['catch'](function(_0x111dd1){logger['error'](_0x505916[_0x6701('0x1d')],_0x6701('0x3d'),JSON['stringify'](_0x111dd1));});});}logger[_0x6701('0x2b')](_0x505916[_0x6701('0x1d')],_0x6701('0x3d'));}};Fax[_0x6701('0x22')][_0x6701('0x18')]=function(_0x4f4a76){if(this[_0x6701('0x20')][_0x4f4a76['uniqueid']]){_[_0x6701('0x3e')](this[_0x6701('0xf')][_0x4f4a76[_0x6701('0x1d')]],_[_0x6701('0x3f')](_0x4f4a76,[_0x6701('0x40'),_0x6701('0x41')]));}};function updateStatus(_0x4413b3){if(_0x4413b3[_0x6701('0x42')]){faxMessage[_0x6701('0x43')](_0x4413b3['AttachmentId'],{'failMessage':_0x6701('0x44')})[_0x6701('0x38')](function(_0x174c14){ut[_0x6701('0x45')](_0x6701('0x46'),_0x174c14);})[_0x6701('0x3a')](function(_0x4801d7){ut['logger'](_0x6701('0x47'),_0x4801d7);});}else{ut[_0x6701('0x45')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x6701('0x22')]['updateStatus']=function(_0x151d22,_0x5d626f,_0x24839d){var _0x46fc76=this;var _0xd1ccff={};if(_0x5d626f){_0xd1ccff={'read':_0x5d626f};}else{_0xd1ccff={'failMessage':_0x24839d};}if(this[_0x6701('0x20')][_0x151d22][_0x6701('0x42')]){faxMessage['update'](this[_0x6701('0x20')][_0x151d22][_0x6701('0x42')],_0xd1ccff)[_0x6701('0x38')](function(_0x44d168){ut[_0x6701('0x45')](_0x6701('0x48'),_0x44d168);})[_0x6701('0x3a')](function(_0x4b8a49){ut['logger'](_0x6701('0x49'),_0x4b8a49);})[_0x6701('0x4a')](function(){delete _0x46fc76[_0x6701('0xf')][_0x151d22];delete _0x46fc76[_0x6701('0x20')][_0x151d22];});}else{ut[_0x6701('0x45')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x151d22];delete this[_0x6701('0x20')][_0x151d22];}};Fax[_0x6701('0x22')][_0x6701('0x4b')]=function(_0x9c2493){var _0x5beafc=this;if(this[_0x6701('0xf')][_0x9c2493['uniqueid']]){if(this[_0x6701('0x20')][_0x9c2493[_0x6701('0x1d')]]){this[_0x6701('0xf')][_0x9c2493[_0x6701('0x1d')]]['id']=this['actions'][_0x9c2493[_0x6701('0x1d')]]['id'];this['channels'][_0x9c2493[_0x6701('0x1d')]][_0x6701('0x1e')]=this[_0x6701('0x20')][_0x9c2493[_0x6701('0x1d')]][_0x6701('0x1e')];}logger[_0x6701('0x2b')](_0x9c2493[_0x6701('0x1d')],this[_0x6701('0x20')][_0x9c2493[_0x6701('0x1d')]]?_0x6701('0x4c'):_0x6701('0x4d'),JSON[_0x6701('0x3c')](this['channels'][_0x9c2493[_0x6701('0x1d')]]));if(this[_0x6701('0x20')][_0x9c2493['uniqueid']]){if(this[_0x6701('0xf')][_0x9c2493[_0x6701('0x1d')]]['faxpages']>0x0&&this[_0x6701('0xf')][_0x9c2493[_0x6701('0x1d')]][_0x6701('0x4e')]===_0x6701('0x4f')){this[_0x6701('0x50')](_0x9c2493[_0x6701('0x1d')],!![]);}else{this[_0x6701('0x50')](_0x9c2493[_0x6701('0x1d')],![],this['channels'][_0x9c2493[_0x6701('0x1d')]][_0x6701('0x51')]?_0x6701('0x52')+this[_0x6701('0xf')][_0x9c2493[_0x6701('0x1d')]][_0x6701('0x51')]:'SENDING\x20FAILED');}}}};Fax[_0x6701('0x22')][_0x6701('0x53')]=function(_0x316881){var _0x21d032=this;return new BPromise(function(_0x50b36f,_0x18654e){_0x21d032[_0x6701('0x54')](_0x316881,_0x21d032[_0x6701('0x10')][_0x316881[_0x6701('0x55')]])[_0x6701('0x38')](function(_0x4879e7){ut[_0x6701('0x45')](_0x6701('0x56'),_0x4879e7);_0x50b36f(ut[_0x6701('0x33')](_0x6701('0x57')));})[_0x6701('0x3a')](function(_0x3b4881){ut[_0x6701('0x45')](_0x6701('0x58'),_0x3b4881);updateStatus(_0x316881);_0x18654e(ut[_0x6701('0x33')](_0x6701('0x59')));});});};Fax[_0x6701('0x22')]['checkAfterSend']=function(_0x49e3f1){var _0x4815d4=this;return new BPromise(function(_0x364320,_0x5c9e6f){var _0x2047d6=_0x4815d4[_0x6701('0x5a')](_0x4815d4[_0x6701('0x10')][_0x49e3f1['FaxAccountId']]['Trunk'],_0x49e3f1);if(_0x2047d6[_0x6701('0x5b')]){_0x364320(ut[_0x6701('0x33')]('Trunk\x20Reachable'));}else{_0x5c9e6f(ut[_0x6701('0x33')](_0x2047d6[_0x6701('0x33')]));}});};function originate(_0x1767c5,_0x43a474,_0x1a8221){return new BPromise(function(_0x51382d,_0x30d141){if(_0x1a8221){var _0x4e93ed=util[_0x6701('0x5c')](_0x6701('0x5d'),path[_0x6701('0x35')](_0x1767c5[_0x6701('0x5')])['name'],_0x1767c5[_0x6701('0x5')]);gs[_0x6701('0x5e')](_0x4e93ed)[_0x6701('0x38')](function(){_0x1767c5[_0x6701('0x5')]=util[_0x6701('0x5c')](_0x6701('0x5f'),path[_0x6701('0x35')](_0x1767c5[_0x6701('0x5')])[_0x6701('0x60')],path[_0x6701('0x35')](_0x1767c5['path'])['name']);_0x43a474[_0x6701('0x61')]=_0x1767c5[_0x6701('0x5')];ut[_0x6701('0x45')](_0x6701('0x62'),'');ami['Action'](ut[_0x6701('0x63')](_0x1767c5,_0x43a474))['then'](function(_0x1d1490){_0x51382d(_0x1d1490);})['catch'](function(_0x5b9568){_0x30d141(_0x5b9568);});})['catch'](function(_0x50d29c){_0x30d141(_0x50d29c);});}else{ami[_0x6701('0x64')](ut['variablesAction'](_0x1767c5,_0x43a474))[_0x6701('0x38')](function(_0x55f838){_0x51382d(_0x55f838);})[_0x6701('0x3a')](function(_0x59de12){_0x30d141(_0x59de12);});}});}Fax[_0x6701('0x22')][_0x6701('0x54')]=function(_0x50edd6,_0x5256fb){var _0x5a1971=this;return new BPromise(function(_0x3bb646,_0x28b8b4){var _0x399fe1=uuid['v4']();var _0x43118b=ut[_0x6701('0x65')](_0x50edd6,_0x5256fb);_0x5a1971[_0x6701('0x20')][_0x399fe1]=new Action(_0x399fe1,_0x5256fb,_0x50edd6);var _0x285504=_0x5a1971[_0x6701('0x20')][_0x399fe1];if(path[_0x6701('0x35')](_0x50edd6[_0x6701('0x5')])[_0x6701('0x66')]===_0x6701('0x36')){originate(_0x285504,_0x43118b,!![])[_0x6701('0x38')](function(_0x5befec){_0x3bb646(_0x5befec);})[_0x6701('0x3a')](function(_0x5b2b0e){_0x28b8b4(_0x5b2b0e);});}else{originate(_0x285504,_0x43118b,![])['then'](function(_0x480675){_0x3bb646(_0x480675);})['catch'](function(_0x7943dd){_0x28b8b4(_0x7943dd);});}});};Fax[_0x6701('0x22')][_0x6701('0x67')]=function(_0x85bc81){return!_[_0x6701('0x68')](_0x85bc81)&&!_[_0x6701('0x68')](_0x85bc81['name'])&&!_[_0x6701('0x68')](_0x85bc81[_0x6701('0x69')])&&_0x85bc81[_0x6701('0x69')]&&!_[_0x6701('0x68')](this['trunks'][util['format'](_0x6701('0x6a'),_0x85bc81['name'])])&&!_[_0x6701('0x68')](this[_0x6701('0x11')][util[_0x6701('0x5c')](_0x6701('0x6a'),_0x85bc81['name'])][_0x6701('0x29')])&&(this[_0x6701('0x11')][util[_0x6701('0x5c')](_0x6701('0x6a'),_0x85bc81[_0x6701('0x1e')])]['status']===_0x6701('0x6b')||this['trunks'][util[_0x6701('0x5c')]('SIP/%s',_0x85bc81['name'])]['status']===_0x6701('0x6c'));};Fax['prototype'][_0x6701('0x5a')]=function(_0x514635,_0x30e5f3){if(!this['isTrunkReachable'](_0x514635)){ut['logger'](_0x6701('0x6d'),_[_0x6701('0x68')](_0x514635)?'':_0x514635[_0x6701('0x1e')]+_0x6701('0x6e'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_['isNil'](_0x30e5f3[_0x6701('0x8')])){ut['logger'](_0x6701('0x6f'),JSON['stringify'](_0x30e5f3));return{'isValid':![],'message':_0x6701('0x70')};}if(_[_0x6701('0x68')](_0x30e5f3[_0x6701('0x5')])){ut[_0x6701('0x45')](_0x6701('0x71'),JSON['stringify'](_0x30e5f3));return{'isValid':![],'message':_0x6701('0x72')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x6701('0x73')]=Fax;
\ No newline at end of file
index c46b0d0..2aa8bc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bfa=['then','catch','[Notify]\x20','bluebird','preview','lodash','error','inspect','notify','resolve'];(function(_0x4e7fc1,_0x100df3){var _0x5db4a4=function(_0x229dde){while(--_0x229dde){_0x4e7fc1['push'](_0x4e7fc1['shift']());}};_0x5db4a4(++_0x100df3);}(_0x2bfa,0x17f));var _0xa2bf=function(_0x9aff6e,_0x53b338){_0x9aff6e=_0x9aff6e-0x0;var _0x3c6af4=_0x2bfa[_0x9aff6e];return _0x3c6af4;};'use strict';var util=require('util');var BPromise=require(_0xa2bf('0x0'));var logger=require('../../../config/logger')(_0xa2bf('0x1'));var _=require(_0xa2bf('0x2'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x379a8c){return function(_0x2d0bf8){logger[_0xa2bf('0x3')](_0x379a8c,util[_0xa2bf('0x4')](_0x2d0bf8,{'showHidden':![],'depth':null}));};}exports[_0xa2bf('0x5')]=function(_0x4e36f0,_0x4a0150){return BPromise[_0xa2bf('0x6')]()[_0xa2bf('0x7')](faxAccount[_0xa2bf('0x5')](_0x4e36f0,_0x4a0150))[_0xa2bf('0x8')](loggerCatch(_0xa2bf('0x9')));};
\ No newline at end of file
+var _0x8850=['notify','catch','[Notify]\x20','util','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect'];(function(_0x2a6a07,_0x2128e5){var _0x12349b=function(_0x143a49){while(--_0x143a49){_0x2a6a07['push'](_0x2a6a07['shift']());}};_0x12349b(++_0x2128e5);}(_0x8850,0x8f));var _0x0885=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8850[_0x40a045];return _0x1a687c;};'use strict';var util=require(_0x0885('0x0'));var BPromise=require('bluebird');var logger=require(_0x0885('0x1'))(_0x0885('0x2'));var _=require(_0x0885('0x3'));var faxAccount=require(_0x0885('0x4'));function loggerCatch(_0x40ed39){return function(_0x169191){logger[_0x0885('0x5')](_0x40ed39,util[_0x0885('0x6')](_0x169191,{'showHidden':![],'depth':null}));};}exports[_0x0885('0x7')]=function(_0x15ef8f,_0x1aa41d){return BPromise['resolve']()['then'](faxAccount[_0x0885('0x7')](_0x15ef8f,_0x1aa41d))[_0x0885('0x8')](loggerCatch(_0x0885('0x9')));};
\ No newline at end of file
index 39b8a72..d86817f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c81=['bluebird','exec','execute','info','Exec\x20gs','inspect','util','../../../../config/logger','fax'];(function(_0x56529b,_0xbd4f12){var _0x4869d1=function(_0x31a23a){while(--_0x31a23a){_0x56529b['push'](_0x56529b['shift']());}};_0x4869d1(++_0xbd4f12);}(_0x1c81,0x102));var _0x11c8=function(_0x108401,_0x4b4f53){_0x108401=_0x108401-0x0;var _0x55bede=_0x1c81[_0x108401];return _0x55bede;};'use strict';var util=require(_0x11c8('0x0'));var logger=require(_0x11c8('0x1'))(_0x11c8('0x2'));var BPromise=require(_0x11c8('0x3'));var exec=require('child_process')[_0x11c8('0x4')];exports[_0x11c8('0x5')]=function(_0x58c011){return new BPromise(function(_0x42b178,_0x32f7ea){exec(_0x58c011,function(_0x30f5a1,_0x300876,_0x3e3750){logger[_0x11c8('0x6')](_0x11c8('0x7'),_0x300876);if(_0x30f5a1){logger[_0x11c8('0x6')](_0x11c8('0x7'),'\x20Error\x20:',util[_0x11c8('0x8')](_0x30f5a1,{'showHidden':![],'depth':null}),_0x300876,_0x3e3750);_0x32f7ea(_0x30f5a1);}_0x42b178(_0x300876);});});};
\ No newline at end of file
+var _0xfbc0=['util','../../../../config/logger','fax','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x16daf6,_0x46a249){var _0x165740=function(_0x1ab48d){while(--_0x1ab48d){_0x16daf6['push'](_0x16daf6['shift']());}};_0x165740(++_0x46a249);}(_0xfbc0,0x1cc));var _0x0fbc=function(_0x3c1daa,_0xfb6015){_0x3c1daa=_0x3c1daa-0x0;var _0x264928=_0xfbc0[_0x3c1daa];return _0x264928;};'use strict';var util=require(_0x0fbc('0x0'));var logger=require(_0x0fbc('0x1'))(_0x0fbc('0x2'));var BPromise=require('bluebird');var exec=require(_0x0fbc('0x3'))[_0x0fbc('0x4')];exports[_0x0fbc('0x5')]=function(_0x193996){return new BPromise(function(_0x28f1f0,_0x4aa37c){exec(_0x193996,function(_0x1a314a,_0x3468d8,_0x4163ff){logger[_0x0fbc('0x6')]('Exec\x20gs',_0x3468d8);if(_0x1a314a){logger[_0x0fbc('0x6')](_0x0fbc('0x7'),_0x0fbc('0x8'),util[_0x0fbc('0x9')](_0x1a314a,{'showHidden':![],'depth':null}),_0x3468d8,_0x4163ff);_0x4aa37c(_0x1a314a);}_0x28f1f0(_0x3468d8);});});};
\ No newline at end of file
index 1f00e30..4ecb031 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf071=['headerinfo','localstationid','util','lodash','moment','../../../../config/logger','fax','message','info','inspect','minrate','maxrate','format','\x22%s\x22','modem','gateway','t38timeout','path','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>'];(function(_0x1af48c,_0x9263ee){var _0x202303=function(_0x324c4a){while(--_0x324c4a){_0x1af48c['push'](_0x1af48c['shift']());}};_0x202303(++_0x9263ee);}(_0xf071,0xaa));var _0x1f07=function(_0x3eb266,_0x2f0945){_0x3eb266=_0x3eb266-0x0;var _0x1a5a7a=_0xf071[_0x3eb266];return _0x1a5a7a;};'use strict';var util=require(_0x1f07('0x0'));var _=require(_0x1f07('0x1'));var moment=require(_0x1f07('0x2'));var logger=require(_0x1f07('0x3'))(_0x1f07('0x4'));exports[_0x1f07('0x5')]=function(_0x45ab06){return{'message':_0x45ab06};};exports['logger']=function(_0x4fb34f,_0x3c9956){logger[_0x1f07('0x6')](_0x4fb34f,util[_0x1f07('0x7')](_0x3c9956,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x4ecfc6,_0xa521d4){var _0x149559={'XMF-ECM':_0xa521d4['ecm'],'XMF-HEADERINFO':_0xa521d4['headerinfo'],'XMF-MINRATE':_0xa521d4[_0x1f07('0x8')],'XMF-MAXRATE':_0xa521d4[_0x1f07('0x9')],'XMF-MODEM':util[_0x1f07('0xa')](_0x1f07('0xb'),_0xa521d4[_0x1f07('0xc')]),'XMF-GATEWAY':_0xa521d4[_0x1f07('0xd')],'XMF-FAXDETECT':_0xa521d4['faxdetect'],'XMF-T38TIMEOUT':_0xa521d4[_0x1f07('0xe')],'XMF-LOCALSTATIONID':_0xa521d4['localstationid'],'XMF-PATH':_0x4ecfc6[_0x1f07('0xf')]};return _0x149559;};exports[_0x1f07('0x10')]=function(_0x28333d,_0x393b0d){return{'actionid':_0x28333d[_0x1f07('0x11')],'action':_0x1f07('0x12'),'channel':_0x28333d['channel'],'Exten':_0x1f07('0x13'),'Context':_0x1f07('0x14'),'Priority':'1','callerid':util[_0x1f07('0xa')](_0x1f07('0x15'),_0x28333d['headerinfo']?_0x28333d[_0x1f07('0x16')]:'',_0x28333d[_0x1f07('0x17')]),'variable':_0x393b0d,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x28333d[_0x1f07('0x11')]};};
\ No newline at end of file
+var _0x27bc=['addVariables','ecm','headerinfo','minrate','maxrate','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','uniqueid','originate','channel','xcally-motion-fax','from-sip','format','util','lodash','message','logger','info','inspect'];(function(_0x53a87a,_0x2132cd){var _0x4db1e0=function(_0x214979){while(--_0x214979){_0x53a87a['push'](_0x53a87a['shift']());}};_0x4db1e0(++_0x2132cd);}(_0x27bc,0xc9));var _0xc27b=function(_0x4d575d,_0xc2fb2d){_0x4d575d=_0x4d575d-0x0;var _0x3d8c29=_0x27bc[_0x4d575d];return _0x3d8c29;};'use strict';var util=require(_0xc27b('0x0'));var _=require(_0xc27b('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')('fax');exports[_0xc27b('0x2')]=function(_0x2ed602){return{'message':_0x2ed602};};exports[_0xc27b('0x3')]=function(_0x30cbe5,_0x3360d2){logger[_0xc27b('0x4')](_0x30cbe5,util[_0xc27b('0x5')](_0x3360d2,{'showHidden':![],'depth':null}));};exports[_0xc27b('0x6')]=function(_0x3252a3,_0x4389f9){var _0x52daaf={'XMF-ECM':_0x4389f9[_0xc27b('0x7')],'XMF-HEADERINFO':_0x4389f9[_0xc27b('0x8')],'XMF-MINRATE':_0x4389f9[_0xc27b('0x9')],'XMF-MAXRATE':_0x4389f9[_0xc27b('0xa')],'XMF-MODEM':util['format'](_0xc27b('0xb'),_0x4389f9[_0xc27b('0xc')]),'XMF-GATEWAY':_0x4389f9[_0xc27b('0xd')],'XMF-FAXDETECT':_0x4389f9[_0xc27b('0xe')],'XMF-T38TIMEOUT':_0x4389f9[_0xc27b('0xf')],'XMF-LOCALSTATIONID':_0x4389f9[_0xc27b('0x10')],'XMF-PATH':_0x3252a3['path']};return _0x52daaf;};exports['variablesAction']=function(_0x3efe9d,_0x2cdb52){return{'actionid':_0x3efe9d[_0xc27b('0x11')],'action':_0xc27b('0x12'),'channel':_0x3efe9d[_0xc27b('0x13')],'Exten':_0xc27b('0x14'),'Context':_0xc27b('0x15'),'Priority':'1','callerid':util[_0xc27b('0x16')]('\x22%s\x22\x20<%s>',_0x3efe9d['headerinfo']?_0x3efe9d[_0xc27b('0x8')]:'',_0x3efe9d[_0xc27b('0x10')]),'variable':_0x2cdb52,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3efe9d['uniqueid']};};
\ No newline at end of file
index 2ff6e58..99a944a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fb8=['initFaxAccounts','getVoiceQueueReports','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','moment','./server','./report','./acw','./trigger','./dialer','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','get','hour','resolve','initAgents','getTelephones','then','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts'];(function(_0x4d71ba,_0x427795){var _0x1608f2=function(_0x3b511){while(--_0x3b511){_0x4d71ba['push'](_0x4d71ba['shift']());}};_0x1608f2(++_0x427795);}(_0x9fb8,0xf2));var _0x89fb=function(_0x10b477,_0x3f5cbf){_0x10b477=_0x10b477-0x0;var _0x311ed4=_0x9fb8[_0x10b477];return _0x311ed4;};'use strict';var BPromise=require(_0x89fb('0x0'));var util=require('util');var moment=require(_0x89fb('0x1'));var server=require(_0x89fb('0x2'));var Realtime=require('./realtime');var Report=require(_0x89fb('0x3'));var Acw=require(_0x89fb('0x4'));var Trigger=require(_0x89fb('0x5'));var Dialer=require(_0x89fb('0x6'));var Preview=require('./preview');var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require(_0x89fb('0x7'));var voiceQueueReport=require(_0x89fb('0x8'));var voiceCallReport=require(_0x89fb('0x9'));var trunk=require(_0x89fb('0xa'));var trigger=require(_0x89fb('0xb'));var template=require('./rpc/template');var cmHopperHistory=require(_0x89fb('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x89fb('0xd'));var faxAccount=require(_0x89fb('0xe'));var zendesk=require(_0x89fb('0xf'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x89fb('0x10'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x89fb('0x11'));var vtiger=require(_0x89fb('0x12'));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()[_0x89fb('0x13')](_0x89fb('0x14'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x89fb('0x13')](_0x89fb('0x14'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x89fb('0x15')]()['then'](user['getAgents']())['then'](realtime[_0x89fb('0x16')]())['then'](user[_0x89fb('0x17')]())[_0x89fb('0x18')](realtime[_0x89fb('0x19')]())[_0x89fb('0x18')](trunk[_0x89fb('0x1a')]())['then'](realtime[_0x89fb('0x1b')]())[_0x89fb('0x18')](voiceQueue[_0x89fb('0x1c')]())[_0x89fb('0x18')](realtime['initVoiceQueues']())[_0x89fb('0x18')](trigger[_0x89fb('0x1d')]())[_0x89fb('0x18')](realtime[_0x89fb('0x1e')]())[_0x89fb('0x18')](template[_0x89fb('0x1f')]())[_0x89fb('0x18')](realtime[_0x89fb('0x20')]())[_0x89fb('0x18')](zendesk[_0x89fb('0x21')]())[_0x89fb('0x18')](realtime[_0x89fb('0x22')]())[_0x89fb('0x18')](salesforce['getSalesforceAccounts']())['then'](realtime[_0x89fb('0x23')]())[_0x89fb('0x18')](sugarcrm[_0x89fb('0x24')]())[_0x89fb('0x18')](realtime[_0x89fb('0x25')]())[_0x89fb('0x18')](freshdesk[_0x89fb('0x26')]())[_0x89fb('0x18')](realtime[_0x89fb('0x27')]())[_0x89fb('0x18')](desk['getDeskAccounts']())['then'](realtime[_0x89fb('0x28')]())['then'](zoho[_0x89fb('0x29')]())[_0x89fb('0x18')](realtime[_0x89fb('0x2a')]())['then'](vtiger[_0x89fb('0x2b')]())[_0x89fb('0x18')](realtime['initVtigerAccounts']())['then'](campaign[_0x89fb('0x2c')]())[_0x89fb('0x18')](realtime['initCampaigns']())['then'](voiceExtension[_0x89fb('0x2d')]())['then'](realtime[_0x89fb('0x2e')]())['then'](faxAccount[_0x89fb('0x2f')]())[_0x89fb('0x18')](realtime[_0x89fb('0x30')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x89fb('0x15')]()[_0x89fb('0x18')](voiceQueueReport[_0x89fb('0x31')]())['then'](realtime['initVoiceQueueReports']())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime['initVoiceQueueHopperHistory']())[_0x89fb('0x18')](cmHopperHistory[_0x89fb('0x32')]())[_0x89fb('0x18')](realtime[_0x89fb('0x33')]())['then'](voiceCallReport[_0x89fb('0x34')]())['then'](realtime[_0x89fb('0x35')]())[_0x89fb('0x18')](function(_0x54118c){})[_0x89fb('0x36')](function(_0x51c81a){console[_0x89fb('0x37')](_0x51c81a);});}function main(){return server[_0x89fb('0x38')](realtime,preview,fax)['then'](function(_0x18cb94){return initRealtime();})[_0x89fb('0x18')](function(){return initParams();})[_0x89fb('0x18')](function(){report[_0x89fb('0x39')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x3002f4){console[_0x89fb('0x37')](_0x3002f4);});}main();
\ No newline at end of file
+var _0xdb63=['./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','hour','get','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','sync','bluebird','util','./realtime','./report','./trigger','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/campaign'];(function(_0x5e5132,_0x20f86e){var _0x2b872d=function(_0x2c9756){while(--_0x2c9756){_0x5e5132['push'](_0x5e5132['shift']());}};_0x2b872d(++_0x20f86e);}(_0xdb63,0x162));var _0x3db6=function(_0x1f4e1b,_0x4d3ece){_0x1f4e1b=_0x1f4e1b-0x0;var _0x4de493=_0xdb63[_0x1f4e1b];return _0x4de493;};'use strict';var BPromise=require(_0x3db6('0x0'));var util=require(_0x3db6('0x1'));var moment=require('moment');var server=require('./server');var Realtime=require(_0x3db6('0x2'));var Report=require(_0x3db6('0x3'));var Acw=require('./acw');var Trigger=require(_0x3db6('0x4'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0x3db6('0x5'));var user=require('./rpc/user');var voiceQueue=require(_0x3db6('0x6'));var voiceQueueReport=require(_0x3db6('0x7'));var voiceCallReport=require(_0x3db6('0x8'));var trunk=require('./rpc/trunk');var trigger=require(_0x3db6('0x9'));var template=require(_0x3db6('0xa'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x3db6('0xb'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x3db6('0xc'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x3db6('0xd'));var sugarcrm=require(_0x3db6('0xe'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x3db6('0xf'));var zoho=require(_0x3db6('0x10'));var vtiger=require(_0x3db6('0x11'));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()['get'](_0x3db6('0x12'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x3db6('0x13')](_0x3db6('0x12'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x3db6('0x14')](user[_0x3db6('0x15')]())['then'](realtime[_0x3db6('0x16')]())[_0x3db6('0x14')](user[_0x3db6('0x17')]())['then'](realtime[_0x3db6('0x18')]())[_0x3db6('0x14')](trunk[_0x3db6('0x19')]())[_0x3db6('0x14')](realtime[_0x3db6('0x1a')]())[_0x3db6('0x14')](voiceQueue[_0x3db6('0x1b')]())[_0x3db6('0x14')](realtime[_0x3db6('0x1c')]())[_0x3db6('0x14')](trigger[_0x3db6('0x1d')]())[_0x3db6('0x14')](realtime[_0x3db6('0x1e')]())['then'](template[_0x3db6('0x1f')]())[_0x3db6('0x14')](realtime[_0x3db6('0x20')]())[_0x3db6('0x14')](zendesk[_0x3db6('0x21')]())[_0x3db6('0x14')](realtime[_0x3db6('0x22')]())[_0x3db6('0x14')](salesforce[_0x3db6('0x23')]())['then'](realtime[_0x3db6('0x24')]())[_0x3db6('0x14')](sugarcrm[_0x3db6('0x25')]())[_0x3db6('0x14')](realtime['initSugarcrmAccounts']())[_0x3db6('0x14')](freshdesk[_0x3db6('0x26')]())[_0x3db6('0x14')](realtime[_0x3db6('0x27')]())['then'](desk[_0x3db6('0x28')]())[_0x3db6('0x14')](realtime[_0x3db6('0x29')]())[_0x3db6('0x14')](zoho['getZohoAccounts']())[_0x3db6('0x14')](realtime[_0x3db6('0x2a')]())['then'](vtiger[_0x3db6('0x2b')]())[_0x3db6('0x14')](realtime[_0x3db6('0x2c')]())[_0x3db6('0x14')](campaign[_0x3db6('0x2d')]())[_0x3db6('0x14')](realtime[_0x3db6('0x2e')]())['then'](voiceExtension[_0x3db6('0x2f')]())['then'](realtime[_0x3db6('0x30')]())['then'](faxAccount['getFaxAccounts']())[_0x3db6('0x14')](realtime[_0x3db6('0x31')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x3db6('0x32')]()[_0x3db6('0x14')](voiceQueueReport[_0x3db6('0x33')]())[_0x3db6('0x14')](realtime[_0x3db6('0x34')]())[_0x3db6('0x14')](cmHopperHistory[_0x3db6('0x35')]())[_0x3db6('0x14')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0x3db6('0x36')]())[_0x3db6('0x14')](realtime[_0x3db6('0x37')]())['then'](voiceCallReport[_0x3db6('0x38')]())[_0x3db6('0x14')](realtime[_0x3db6('0x39')]())[_0x3db6('0x14')](function(_0x28a338){})[_0x3db6('0x3a')](function(_0x537d09){console[_0x3db6('0x3b')](_0x537d09);});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x9ddedc){return initRealtime();})[_0x3db6('0x14')](function(){return initParams();})[_0x3db6('0x14')](function(){report[_0x3db6('0x3c')]();setInterval(initRealtime,0x1388);})[_0x3db6('0x3a')](function(_0x3c282a){console['log'](_0x3c282a);});}main();
\ No newline at end of file
index cbebb88..0bddffe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8ea=['voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','toNumber','format','name','stringify','emit','user:save','exports','lodash','util','moment','md5','socket.io-emitter','email','accountcode','fullname','state','unknown','stateTime','status','address','mobile'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xa8ea,0x172));var _0xaa8e=function(_0x1b7629,_0x59d745){_0x1b7629=_0x1b7629-0x0;var _0x5d7e41=_0xa8ea[_0x1b7629];return _0x5d7e41;};'use strict';var _=require(_0xaa8e('0x0'));var util=require(_0xaa8e('0x1'));var moment=require(_0xaa8e('0x2'));var md5=require(_0xaa8e('0x3'));var io=require(_0xaa8e('0x4'))({'host':'localhost','port':0x18eb});function Agent(_0x2cb4c3){this['id']=_0x2cb4c3['id']||0x0;this['name']=_0x2cb4c3['name']||'';this[_0xaa8e('0x5')]=_0x2cb4c3[_0xaa8e('0x5')]||'';this['accountcode']=_0x2cb4c3[_0xaa8e('0x6')]||'';this[_0xaa8e('0x7')]=_0x2cb4c3[_0xaa8e('0x7')]||'';this[_0xaa8e('0x8')]=_0xaa8e('0x9');this[_0xaa8e('0xa')]=0x0;this[_0xaa8e('0xb')]=_0xaa8e('0x9');this[_0xaa8e('0xc')]='';this['phone']='';this[_0xaa8e('0xd')]='';this['online']=_0x2cb4c3['online']||![];this[_0xaa8e('0xe')]=_0xaa8e('0x9');this[_0xaa8e('0xf')]=0x0;this[_0xaa8e('0x10')]='';this[_0xaa8e('0x11')]='';this[_0xaa8e('0x12')]=![];this[_0xaa8e('0x3')]='';}Agent['prototype'][_0xaa8e('0x13')]=function(_0x60ac5e){var _0x21403d;if(_0x60ac5e&&_0x60ac5e['state']){_0x21403d=_0x60ac5e[_0xaa8e('0x8')][_0xaa8e('0x14')]();switch(_0x21403d){case _0xaa8e('0x15'):_0x21403d=_0xaa8e('0x16');break;case _0xaa8e('0x17'):_0x21403d=_0xaa8e('0x18');break;}}if(_0x21403d&&this[_0xaa8e('0xe')]!==_0x21403d||_0x60ac5e['statePause']){this['voiceStatusTime']=_[_0xaa8e('0x19')](moment()[_0xaa8e('0x1a')]('x'));}if(_0x21403d){this[_0xaa8e('0xe')]=_0x21403d;}var _0x23ec1c={'id':this['id'],'name':this[_0xaa8e('0x1b')],'email':this[_0xaa8e('0x5')],'accountcode':this[_0xaa8e('0x6')],'fullname':this[_0xaa8e('0x7')],'state':this[_0xaa8e('0x8')],'stateTime':this['stateTime'],'status':this[_0xaa8e('0xb')],'address':this[_0xaa8e('0xc')],'online':this['online'],'voiceStatus':this[_0xaa8e('0xe')],'voiceStatusTime':this[_0xaa8e('0xf')],'voiceStatusCallerIdNumber':this[_0xaa8e('0x10')],'voiceStatusQueue':this[_0xaa8e('0x11')]};var _0x2b2f3e=md5(JSON[_0xaa8e('0x1c')](_0x23ec1c));if(this[_0xaa8e('0x3')]!==_0x2b2f3e){this[_0xaa8e('0x3')]=_0x2b2f3e;io['to'](util[_0xaa8e('0x1a')]('user:%s',_0x23ec1c['name']))[_0xaa8e('0x1d')](_0xaa8e('0x1e'),_0x23ec1c);}};module[_0xaa8e('0x1f')]=Agent;
\ No newline at end of file
+var _0xfd2c=['address','phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','updateStatusRealtime','toLowerCase','inuse','statePause','format','stringify','user:%s','emit','exports','util','md5','localhost','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfd2c,0x16e));var _0xcfd2=function(_0x2af5b5,_0x50d1d9){_0x2af5b5=_0x2af5b5-0x0;var _0x4f1fb2=_0xfd2c[_0x2af5b5];return _0x4f1fb2;};'use strict';var _=require('lodash');var util=require(_0xcfd2('0x0'));var moment=require('moment');var md5=require(_0xcfd2('0x1'));var io=require('socket.io-emitter')({'host':_0xcfd2('0x2'),'port':0x18eb});function Agent(_0x2145a4){this['id']=_0x2145a4['id']||0x0;this[_0xcfd2('0x3')]=_0x2145a4[_0xcfd2('0x3')]||'';this[_0xcfd2('0x4')]=_0x2145a4['email']||'';this['accountcode']=_0x2145a4[_0xcfd2('0x5')]||'';this['fullname']=_0x2145a4[_0xcfd2('0x6')]||'';this[_0xcfd2('0x7')]=_0xcfd2('0x8');this[_0xcfd2('0x9')]=0x0;this[_0xcfd2('0xa')]='unknown';this[_0xcfd2('0xb')]='';this[_0xcfd2('0xc')]='';this[_0xcfd2('0xd')]='';this[_0xcfd2('0xe')]=_0x2145a4[_0xcfd2('0xe')]||![];this[_0xcfd2('0xf')]=_0xcfd2('0x8');this[_0xcfd2('0x10')]=0x0;this[_0xcfd2('0x11')]='';this[_0xcfd2('0x12')]='';this[_0xcfd2('0x13')]=![];this[_0xcfd2('0x1')]='';}Agent['prototype'][_0xcfd2('0x14')]=function(_0x4582e3){var _0x3d4019;if(_0x4582e3&&_0x4582e3[_0xcfd2('0x7')]){_0x3d4019=_0x4582e3[_0xcfd2('0x7')][_0xcfd2('0x15')]();switch(_0x3d4019){case'not_inuse':_0x3d4019='idle';break;case _0xcfd2('0x16'):_0x3d4019='talking';break;}}if(_0x3d4019&&this[_0xcfd2('0xf')]!==_0x3d4019||_0x4582e3[_0xcfd2('0x17')]){this['voiceStatusTime']=_['toNumber'](moment()[_0xcfd2('0x18')]('x'));}if(_0x3d4019){this[_0xcfd2('0xf')]=_0x3d4019;}var _0x1592d8={'id':this['id'],'name':this[_0xcfd2('0x3')],'email':this[_0xcfd2('0x4')],'accountcode':this[_0xcfd2('0x5')],'fullname':this[_0xcfd2('0x6')],'state':this[_0xcfd2('0x7')],'stateTime':this[_0xcfd2('0x9')],'status':this[_0xcfd2('0xa')],'address':this[_0xcfd2('0xb')],'online':this[_0xcfd2('0xe')],'voiceStatus':this[_0xcfd2('0xf')],'voiceStatusTime':this[_0xcfd2('0x10')],'voiceStatusCallerIdNumber':this[_0xcfd2('0x11')],'voiceStatusQueue':this['voiceStatusQueue']};var _0x17ef0a=md5(JSON[_0xcfd2('0x19')](_0x1592d8));if(this['md5']!==_0x17ef0a){this[_0xcfd2('0x1')]=_0x17ef0a;io['to'](util[_0xcfd2('0x18')](_0xcfd2('0x1a'),_0x1592d8['name']))[_0xcfd2('0x1b')]('user:save',_0x1592d8);}};module[_0xcfd2('0x1c')]=Agent;
\ No newline at end of file
index ab2419a..baf8259 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9099=['type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name'];(function(_0x41d1e8,_0x112fa0){var _0x33c7bb=function(_0x222489){while(--_0x222489){_0x41d1e8['push'](_0x41d1e8['shift']());}};_0x33c7bb(++_0x112fa0);}(_0x9099,0x1ac));var _0x9909=function(_0x4c8a8f,_0x997ef){_0x4c8a8f=_0x4c8a8f-0x0;var _0x404500=_0x9099[_0x4c8a8f];return _0x404500;};'use strict';function Campaign(_0x4020b8){this['id']=_0x4020b8['id']||0x0;this['name']=_0x4020b8[_0x9909('0x0')]||'';this[_0x9909('0x1')]=_0x4020b8[_0x9909('0x1')]||_0x9909('0x2');this[_0x9909('0x3')]=0x0;this[_0x9909('0x4')]=0x0;this[_0x9909('0x5')]=0x0;this[_0x9909('0x6')]=0x0;this[_0x9909('0x7')]='';this[_0x9909('0x8')]=!![];this[_0x9909('0x9')]=_0x4020b8[_0x9909('0x9')];this[_0x9909('0xa')]=_0x4020b8[_0x9909('0xa')];this['dialTimezone']=_0x4020b8[_0x9909('0xb')]||null;this['dialGlobalInterval']=_0x4020b8['dialGlobalInterval']?_0x4020b8['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x4020b8[_0x9909('0xc')];this['dialOriginateCallerIdNumber']=_0x4020b8[_0x9909('0xd')];this[_0x9909('0xe')]=_0x4020b8[_0x9909('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x4020b8[_0x9909('0xf')];this['dialCongestionRetryFrequency']=_0x4020b8[_0x9909('0x10')];this[_0x9909('0x11')]=_0x4020b8[_0x9909('0x11')];this[_0x9909('0x12')]=_0x4020b8[_0x9909('0x12')];this[_0x9909('0x13')]=_0x4020b8[_0x9909('0x13')];this[_0x9909('0x14')]=_0x4020b8[_0x9909('0x14')];this[_0x9909('0x15')]=_0x4020b8[_0x9909('0x15')];this[_0x9909('0x16')]=_0x4020b8[_0x9909('0x16')]||'DESC';this[_0x9909('0x17')]=_0x4020b8['dialPrefix']||undefined;this[_0x9909('0x18')]=_0x4020b8['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x9909('0x19')]=_0x4020b8[_0x9909('0x19')]||undefined;this[_0x9909('0x1a')]=_0x4020b8['TrunkBackup']?_0x4020b8[_0x9909('0x1a')]:undefined;this[_0x9909('0x1b')]=_0x4020b8[_0x9909('0x1b')]?_0x4020b8[_0x9909('0x1b')]:undefined;this[_0x9909('0x1c')]=_0x4020b8[_0x9909('0x1c')]?_0x4020b8[_0x9909('0x1c')]:undefined;this['SquareProject']=_0x4020b8[_0x9909('0x1d')]?_0x4020b8[_0x9909('0x1d')]:undefined;this['dialQueueProject']=_0x4020b8[_0x9909('0x1d')]?_0x4020b8[_0x9909('0x1d')][_0x9909('0x0')]:undefined;this[_0x9909('0x1e')]=_0x4020b8[_0x9909('0x1e')]||![];this[_0x9909('0x1f')]=_0x4020b8[_0x9909('0x1f')];this['dialAMDGreeting']=_0x4020b8[_0x9909('0x20')];this[_0x9909('0x21')]=_0x4020b8['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x4020b8[_0x9909('0x22')];this[_0x9909('0x23')]=_0x4020b8[_0x9909('0x23')];this[_0x9909('0x24')]=_0x4020b8[_0x9909('0x24')];this['dialAMDMaximumNumberOfWords']=_0x4020b8['dialAMDMaximumNumberOfWords'];this[_0x9909('0x25')]=_0x4020b8[_0x9909('0x25')];this[_0x9909('0x26')]=_0x4020b8[_0x9909('0x26')];}module['exports']=Campaign;
\ No newline at end of file
+var _0x8b29=['dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency'];(function(_0x4aba66,_0x1d803d){var _0x3d7ebe=function(_0x37e689){while(--_0x37e689){_0x4aba66['push'](_0x4aba66['shift']());}};_0x3d7ebe(++_0x1d803d);}(_0x8b29,0xbe));var _0x98b2=function(_0x256d46,_0x2a37e2){_0x256d46=_0x256d46-0x0;var _0x23a670=_0x8b29[_0x256d46];return _0x23a670;};'use strict';function Campaign(_0x1552d6){this['id']=_0x1552d6['id']||0x0;this['name']=_0x1552d6[_0x98b2('0x0')]||'';this[_0x98b2('0x1')]=_0x1552d6['type']||'campaign';this[_0x98b2('0x2')]=0x0;this[_0x98b2('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x98b2('0x4')]=0x0;this['message']='';this[_0x98b2('0x5')]=!![];this[_0x98b2('0x6')]=_0x1552d6[_0x98b2('0x6')];this[_0x98b2('0x7')]=_0x1552d6[_0x98b2('0x7')];this[_0x98b2('0x8')]=_0x1552d6[_0x98b2('0x8')]||null;this[_0x98b2('0x9')]=_0x1552d6[_0x98b2('0x9')]?_0x1552d6[_0x98b2('0x9')]:null;this['dialOriginateCallerIdName']=_0x1552d6['dialOriginateCallerIdName'];this[_0x98b2('0xa')]=_0x1552d6[_0x98b2('0xa')];this[_0x98b2('0xb')]=_0x1552d6[_0x98b2('0xb')]||0x1e;this[_0x98b2('0xc')]=_0x1552d6[_0x98b2('0xc')];this['dialCongestionRetryFrequency']=_0x1552d6[_0x98b2('0xd')];this[_0x98b2('0xe')]=_0x1552d6['dialBusyMaxRetry'];this[_0x98b2('0xf')]=_0x1552d6[_0x98b2('0xf')];this[_0x98b2('0x10')]=_0x1552d6['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x1552d6[_0x98b2('0x11')];this['dialGlobalMaxRetry']=_0x1552d6[_0x98b2('0x12')];this['dialOrderByScheduledAt']=_0x1552d6['dialOrderByScheduledAt']||'DESC';this[_0x98b2('0x13')]=_0x1552d6[_0x98b2('0x13')]||undefined;this[_0x98b2('0x14')]=_0x1552d6['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x1552d6['dialCutDigit']||undefined;this[_0x98b2('0x15')]=_0x1552d6[_0x98b2('0x15')]?_0x1552d6[_0x98b2('0x15')]:undefined;this[_0x98b2('0x16')]=_0x1552d6['Trunk']?_0x1552d6[_0x98b2('0x16')]:undefined;this['Interval']=_0x1552d6[_0x98b2('0x17')]?_0x1552d6['Interval']:undefined;this[_0x98b2('0x18')]=_0x1552d6[_0x98b2('0x18')]?_0x1552d6[_0x98b2('0x18')]:undefined;this[_0x98b2('0x19')]=_0x1552d6['SquareProject']?_0x1552d6[_0x98b2('0x18')][_0x98b2('0x0')]:undefined;this['dialAMDActive']=_0x1552d6['dialAMDActive']||![];this[_0x98b2('0x1a')]=_0x1552d6[_0x98b2('0x1a')];this['dialAMDGreeting']=_0x1552d6['dialAMDGreeting'];this[_0x98b2('0x1b')]=_0x1552d6[_0x98b2('0x1b')];this['dialAMDTotalAnalysisTime']=_0x1552d6[_0x98b2('0x1c')];this[_0x98b2('0x1d')]=_0x1552d6[_0x98b2('0x1d')];this['dialAMDBetweenWordsSilence']=_0x1552d6[_0x98b2('0x1e')];this['dialAMDMaximumNumberOfWords']=_0x1552d6[_0x98b2('0x1f')];this['dialAMDSilenceThreshold']=_0x1552d6['dialAMDSilenceThreshold'];this[_0x98b2('0x20')]=_0x1552d6[_0x98b2('0x20')];}module[_0x98b2('0x21')]=Campaign;
\ No newline at end of file
index 04f8330..5bf949c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44fe=['answertime','endtime','lastapplication','lastdata','duration','billableseconds','holdtime','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x44fe,0x16f));var _0xe44f=function(_0x5ed557,_0xdee230){_0x5ed557=_0x5ed557-0x0;var _0x23f878=_0x44fe[_0x5ed557];return _0x23f878;};'use strict';function Channel(){this[_0xe44f('0x0')]=null;this[_0xe44f('0x1')]='';this[_0xe44f('0x2')]='';this[_0xe44f('0x3')]=0x0;this[_0xe44f('0x4')]='';this[_0xe44f('0x5')]=undefined;this[_0xe44f('0x6')]=undefined;this[_0xe44f('0x7')]=0x0;this[_0xe44f('0x8')]='';this[_0xe44f('0x9')]=0x0;this[_0xe44f('0xa')]=0x0;this['exten']=0x0;this['answered']=![];this[_0xe44f('0xb')]=null;this[_0xe44f('0xc')]=null;this['unmanaged']=![];this[_0xe44f('0xd')]='';this[_0xe44f('0xe')]='';this[_0xe44f('0xf')]=0x0;this[_0xe44f('0x10')]=0x0;this[_0xe44f('0x11')]=0x0;this['type']=null;this[_0xe44f('0x12')]=null;this[_0xe44f('0x13')]=null;this[_0xe44f('0x14')]=![];this[_0xe44f('0x15')]=null;this[_0xe44f('0x16')]=null;this[_0xe44f('0x17')]=[];this[_0xe44f('0x18')]=undefined;this[_0xe44f('0x19')]=undefined;this[_0xe44f('0x1a')]=0x0;}module['exports']=Channel;
\ No newline at end of file
+var _0x647b=['monitors','transfercalleridnum','transferconnectedlinenum','mohtime','starttime','channel','calleridnum','calleridname','connectedlinename','accountcode','uniqueid','exten','answered','answertime','unmanaged','lastdata','duration','holdtime','type','tag','disposition','monitor','monitorFilename','queue'];(function(_0x15b5ce,_0x136582){var _0x11dec5=function(_0x20a26f){while(--_0x20a26f){_0x15b5ce['push'](_0x15b5ce['shift']());}};_0x11dec5(++_0x136582);}(_0x647b,0x7c));var _0xb647=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x647b[_0xb0f7c3];return _0x28ea68;};'use strict';function Channel(){this[_0xb647('0x0')]=null;this[_0xb647('0x1')]='';this['destinationchannel']='';this[_0xb647('0x2')]=0x0;this[_0xb647('0x3')]='';this['connectedlinenum']=undefined;this[_0xb647('0x4')]=undefined;this[_0xb647('0x5')]=0x0;this['context']='';this[_0xb647('0x6')]=0x0;this['linkedid']=0x0;this[_0xb647('0x7')]=0x0;this[_0xb647('0x8')]=![];this[_0xb647('0x9')]=null;this['endtime']=null;this[_0xb647('0xa')]=![];this['lastapplication']='';this[_0xb647('0xb')]='';this[_0xb647('0xc')]=0x0;this['billableseconds']=0x0;this[_0xb647('0xd')]=0x0;this[_0xb647('0xe')]=null;this[_0xb647('0xf')]=null;this[_0xb647('0x10')]=null;this[_0xb647('0x11')]=![];this[_0xb647('0x12')]=null;this[_0xb647('0x13')]=null;this[_0xb647('0x14')]=[];this[_0xb647('0x15')]=undefined;this[_0xb647('0x16')]=undefined;this[_0xb647('0x17')]=0x0;}module['exports']=Channel;
\ No newline at end of file
index f42118f..d88fc26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x263b=['consumerSecret','token','type','serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey'];(function(_0xe2b79a,_0x261908){var _0x528c94=function(_0x7ea447){while(--_0x7ea447){_0xe2b79a['push'](_0xe2b79a['shift']());}};_0x528c94(++_0x261908);}(_0x263b,0xd6));var _0xb263=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x263b[_0x14add3];return _0x4a174f;};'use strict';function DeskAccount(_0x5ecd20){this['id']=_0x5ecd20['id']||0x0;this[_0xb263('0x0')]=_0x5ecd20[_0xb263('0x0')]||'';this[_0xb263('0x1')]=_0x5ecd20[_0xb263('0x1')]||'';this[_0xb263('0x2')]=_0x5ecd20[_0xb263('0x2')]||'';this[_0xb263('0x3')]=_0x5ecd20[_0xb263('0x3')]||'';this[_0xb263('0x4')]=_0x5ecd20[_0xb263('0x4')]||'';this[_0xb263('0x5')]=_0x5ecd20[_0xb263('0x5')]||'';this[_0xb263('0x6')]=_0x5ecd20[_0xb263('0x6')]||'';this['token']=_0x5ecd20[_0xb263('0x7')]||'';this['tokenSecret']=_0x5ecd20['tokenSecret']||'';this[_0xb263('0x8')]=_0x5ecd20[_0xb263('0x8')]||'';this[_0xb263('0x9')]=_0x5ecd20[_0xb263('0x9')]||'';this[_0xb263('0xa')]=_0x5ecd20['Configurations']||{};}module['exports']=DeskAccount;
\ No newline at end of file
+var _0xfe6e=['name','username','remoteUri','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports'];(function(_0x5ec608,_0x1214bb){var _0x7deeb8=function(_0x4b4f1b){while(--_0x4b4f1b){_0x5ec608['push'](_0x5ec608['shift']());}};_0x7deeb8(++_0x1214bb);}(_0xfe6e,0x90));var _0xefe6=function(_0x42df49,_0x44b1ff){_0x42df49=_0x42df49-0x0;var _0x39c160=_0xfe6e[_0x42df49];return _0x39c160;};'use strict';function DeskAccount(_0x1cbb89){this['id']=_0x1cbb89['id']||0x0;this[_0xefe6('0x0')]=_0x1cbb89[_0xefe6('0x0')]||'';this[_0xefe6('0x1')]=_0x1cbb89[_0xefe6('0x1')]||'';this['remoteUri']=_0x1cbb89[_0xefe6('0x2')]||'';this['authType']=_0x1cbb89['authType']||'';this[_0xefe6('0x3')]=_0x1cbb89[_0xefe6('0x3')]||'';this[_0xefe6('0x4')]=_0x1cbb89[_0xefe6('0x4')]||'';this[_0xefe6('0x5')]=_0x1cbb89[_0xefe6('0x5')]||'';this[_0xefe6('0x6')]=_0x1cbb89['token']||'';this[_0xefe6('0x7')]=_0x1cbb89[_0xefe6('0x7')]||'';this[_0xefe6('0x8')]=_0x1cbb89[_0xefe6('0x8')]||'';this[_0xefe6('0x9')]=_0x1cbb89[_0xefe6('0x9')]||'';this['Configurations']=_0x1cbb89[_0xefe6('0xa')]||{};}module[_0xefe6('0xb')]=DeskAccount;
\ No newline at end of file
index 12b3f52..98ce486 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ded=['faxdetect','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x4ded,0x116));var _0xd4de=function(_0x41eed6,_0x49dd96){_0x41eed6=_0x41eed6-0x0;var _0xe51e28=_0x4ded[_0x41eed6];return _0xe51e28;};'use strict';function FaxAccount(_0x553862){this['id']=_0x553862['id']||0x0;this[_0xd4de('0x0')]=_0x553862[_0xd4de('0x0')]||'';this[_0xd4de('0x1')]=_0x553862[_0xd4de('0x1')];this[_0xd4de('0x2')]=_0x553862[_0xd4de('0x2')];this[_0xd4de('0x3')]=_0x553862[_0xd4de('0x3')];this[_0xd4de('0x4')]=_0x553862[_0xd4de('0x4')];this[_0xd4de('0x5')]=_0x553862['minrate']||0x960;this[_0xd4de('0x6')]=_0x553862[_0xd4de('0x6')]||0x3840;this[_0xd4de('0x7')]=_0x553862[_0xd4de('0x7')]||_0xd4de('0x8');this[_0xd4de('0x9')]=_0x553862['gateway']||'no';this[_0xd4de('0xa')]=_0x553862['faxdetect']||'no';this['t38timeout']=_0x553862['t38timeout']||0x1388;this[_0xd4de('0xb')]=_0x553862[_0xd4de('0xb')]||'SIP';this['Trunk']=_0x553862['Trunk']?_0x553862[_0xd4de('0xc')]:undefined;this['ListId']=_0x553862[_0xd4de('0xd')];this[_0xd4de('0xe')]=_0x553862[_0xd4de('0xe')];}module[_0xd4de('0xf')]=FaxAccount;
\ No newline at end of file
+var _0x2547=['key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','t38timeout','tech','SIP','Trunk','ListId'];(function(_0x3ab69b,_0x8b1e05){var _0x5a4975=function(_0x595d72){while(--_0x595d72){_0x3ab69b['push'](_0x3ab69b['shift']());}};_0x5a4975(++_0x8b1e05);}(_0x2547,0x1cd));var _0x7254=function(_0x3c9bd9,_0x7f3a1f){_0x3c9bd9=_0x3c9bd9-0x0;var _0x4dcb67=_0x2547[_0x3c9bd9];return _0x4dcb67;};'use strict';function FaxAccount(_0x4cc9c6){this['id']=_0x4cc9c6['id']||0x0;this[_0x7254('0x0')]=_0x4cc9c6[_0x7254('0x0')]||'';this[_0x7254('0x1')]=_0x4cc9c6[_0x7254('0x1')];this[_0x7254('0x2')]=_0x4cc9c6[_0x7254('0x2')];this[_0x7254('0x3')]=_0x4cc9c6[_0x7254('0x3')];this['localstationid']=_0x4cc9c6[_0x7254('0x4')];this[_0x7254('0x5')]=_0x4cc9c6[_0x7254('0x5')]||0x960;this[_0x7254('0x6')]=_0x4cc9c6['maxrate']||0x3840;this[_0x7254('0x7')]=_0x4cc9c6[_0x7254('0x7')]||_0x7254('0x8');this['gateway']=_0x4cc9c6[_0x7254('0x9')]||'no';this['faxdetect']=_0x4cc9c6['faxdetect']||'no';this['t38timeout']=_0x4cc9c6[_0x7254('0xa')]||0x1388;this[_0x7254('0xb')]=_0x4cc9c6[_0x7254('0xb')]||_0x7254('0xc');this[_0x7254('0xd')]=_0x4cc9c6[_0x7254('0xd')]?_0x4cc9c6['Trunk']:undefined;this[_0x7254('0xe')]=_0x4cc9c6['ListId'];this[_0x7254('0xf')]=_0x4cc9c6['key'];}module[_0x7254('0x10')]=FaxAccount;
\ No newline at end of file
index bc2f503..eae4194 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x431f=['serverUrl','Configurations','exports','name','username','token','remoteUri'];(function(_0x2612dd,_0x1b3ed){var _0x15af02=function(_0x41b8cc){while(--_0x41b8cc){_0x2612dd['push'](_0x2612dd['shift']());}};_0x15af02(++_0x1b3ed);}(_0x431f,0xce));var _0xf431=function(_0x35e677,_0x2d682f){_0x35e677=_0x35e677-0x0;var _0x55a47b=_0x431f[_0x35e677];return _0x55a47b;};'use strict';function FreshdeskAccount(_0x2f9fd4){this['id']=_0x2f9fd4['id']||0x0;this[_0xf431('0x0')]=_0x2f9fd4[_0xf431('0x0')]||'';this[_0xf431('0x1')]=_0x2f9fd4['username']||'';this['apiKey']=_0x2f9fd4[_0xf431('0x2')]||'';this[_0xf431('0x3')]=_0x2f9fd4['remoteUri']||'';this[_0xf431('0x4')]=_0x2f9fd4[_0xf431('0x4')]||'';this['Configurations']=_0x2f9fd4[_0xf431('0x5')]||{};}module[_0xf431('0x6')]=FreshdeskAccount;
\ No newline at end of file
+var _0x1e82=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x2772f3,_0x47b9b6){var _0xd5871=function(_0x55e3c3){while(--_0x55e3c3){_0x2772f3['push'](_0x2772f3['shift']());}};_0xd5871(++_0x47b9b6);}(_0x1e82,0x1da));var _0x21e8=function(_0x50cdf2,_0x1df3d5){_0x50cdf2=_0x50cdf2-0x0;var _0x32cbaf=_0x1e82[_0x50cdf2];return _0x32cbaf;};'use strict';function FreshdeskAccount(_0x16e224){this['id']=_0x16e224['id']||0x0;this[_0x21e8('0x0')]=_0x16e224[_0x21e8('0x0')]||'';this[_0x21e8('0x1')]=_0x16e224[_0x21e8('0x1')]||'';this[_0x21e8('0x2')]=_0x16e224[_0x21e8('0x3')]||'';this[_0x21e8('0x4')]=_0x16e224[_0x21e8('0x4')]||'';this[_0x21e8('0x5')]=_0x16e224[_0x21e8('0x5')]||'';this[_0x21e8('0x6')]=_0x16e224['Configurations']||{};}module[_0x21e8('0x7')]=FreshdeskAccount;
\ No newline at end of file
index 2a6573b..4baaf08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34be=['queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','accountcode','context','priority','holdtime','lastAssignedTo','mohtime','variables','exports','type','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt'];(function(_0xdd2a39,_0x1f7b7b){var _0xdc5ce3=function(_0x5d74b6){while(--_0x5d74b6){_0xdd2a39['push'](_0xdd2a39['shift']());}};_0xdc5ce3(++_0x1f7b7b);}(_0x34be,0x177));var _0xe34b=function(_0x13342f,_0x3d6303){_0x13342f=_0x13342f-0x0;var _0x2fc1fc=_0x34be[_0x13342f];return _0x2fc1fc;};'use strict';function QueueReport(){this[_0xe34b('0x0')]='inbound';this[_0xe34b('0x1')]='';this['calleridnum']='';this['calleridname']='';this[_0xe34b('0x2')]='';this[_0xe34b('0x3')]=null;this[_0xe34b('0x4')]=null;this['position']=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0xe34b('0x5')]=null;this[_0xe34b('0x6')]=![];this[_0xe34b('0x7')]=null;this[_0xe34b('0x8')]=![];this[_0xe34b('0x9')]=null;this['originalposition']=0x1;this[_0xe34b('0xa')]='';this[_0xe34b('0xb')]='';this['connectedlinename']='';this[_0xe34b('0xc')]='';this[_0xe34b('0xd')]='';this['exten']='';this[_0xe34b('0xe')]='';this[_0xe34b('0xf')]=0x0;this['assigned']=![];this[_0xe34b('0x10')]='';this[_0xe34b('0x11')]=0x0;this[_0xe34b('0x12')]={};}module[_0xe34b('0x13')]=QueueReport;
\ No newline at end of file
+var _0x8950=['holdtime','lastAssignedTo','mohtime','variables','exports','type','inbound','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandonAt','queuecallerexit','originalposition','channel','connectedlinenum','accountcode','exten','priority'];(function(_0x2a0805,_0x21aa95){var _0x31a0cb=function(_0x29d767){while(--_0x29d767){_0x2a0805['push'](_0x2a0805['shift']());}};_0x31a0cb(++_0x21aa95);}(_0x8950,0x17f));var _0x0895=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x8950[_0x502c7d];return _0x30b7ed;};'use strict';function QueueReport(){this[_0x0895('0x0')]=_0x0895('0x1');this['uniqueid']='';this[_0x0895('0x2')]='';this[_0x0895('0x3')]='';this[_0x0895('0x4')]='';this[_0x0895('0x5')]=null;this[_0x0895('0x6')]=null;this['position']=0x1;this[_0x0895('0x7')]=0x1;this['queuecallerabandon']=![];this[_0x0895('0x8')]=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0x0895('0x9')]=![];this['queuecallerexitAt']=null;this[_0x0895('0xa')]=0x1;this[_0x0895('0xb')]='';this[_0x0895('0xc')]='';this['connectedlinename']='';this[_0x0895('0xd')]='';this['context']='';this[_0x0895('0xe')]='';this[_0x0895('0xf')]='';this[_0x0895('0x10')]=0x0;this['assigned']=![];this[_0x0895('0x11')]='';this[_0x0895('0x12')]=0x0;this[_0x0895('0x13')]={};}module[_0x0895('0x14')]=QueueReport;
\ No newline at end of file
index 215e68d..a9ca9aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ade=['name','username','remoteUri','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x188703,_0x596b26){var _0x1a0c81=function(_0x1cd22d){while(--_0x1cd22d){_0x188703['push'](_0x188703['shift']());}};_0x1a0c81(++_0x596b26);}(_0x8ade,0x1b8));var _0xe8ad=function(_0x253f90,_0x5e06f8){_0x253f90=_0x253f90-0x0;var _0x4651eb=_0x8ade[_0x253f90];return _0x4651eb;};'use strict';function SalesforceAccount(_0x5227e0){this['id']=_0x5227e0['id']||0x0;this[_0xe8ad('0x0')]=_0x5227e0[_0xe8ad('0x0')]||'';this[_0xe8ad('0x1')]=_0x5227e0[_0xe8ad('0x1')]||'';this[_0xe8ad('0x2')]=_0x5227e0['remoteUri']||'';this['password']=_0x5227e0['password']||'';this['clientId']=_0x5227e0[_0xe8ad('0x3')]||'';this[_0xe8ad('0x4')]=_0x5227e0[_0xe8ad('0x4')]||'';this[_0xe8ad('0x5')]=_0x5227e0[_0xe8ad('0x5')]||'';this[_0xe8ad('0x6')]=_0x5227e0[_0xe8ad('0x6')]||_0xe8ad('0x7');this[_0xe8ad('0x8')]=_0x5227e0[_0xe8ad('0x8')]||'';this['Configurations']=_0x5227e0[_0xe8ad('0x9')]||{};}module['exports']=SalesforceAccount;
\ No newline at end of file
+var _0xae86=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x391f15,_0x551736){var _0x246da6=function(_0x18f9d0){while(--_0x18f9d0){_0x391f15['push'](_0x391f15['shift']());}};_0x246da6(++_0x551736);}(_0xae86,0x108));var _0x6ae8=function(_0x220540,_0x534c70){_0x220540=_0x220540-0x0;var _0x2b8b99=_0xae86[_0x220540];return _0x2b8b99;};'use strict';function SalesforceAccount(_0x11a3bb){this['id']=_0x11a3bb['id']||0x0;this[_0x6ae8('0x0')]=_0x11a3bb[_0x6ae8('0x0')]||'';this['username']=_0x11a3bb[_0x6ae8('0x1')]||'';this[_0x6ae8('0x2')]=_0x11a3bb[_0x6ae8('0x2')]||'';this[_0x6ae8('0x3')]=_0x11a3bb[_0x6ae8('0x3')]||'';this[_0x6ae8('0x4')]=_0x11a3bb['clientId']||'';this['clientSecret']=_0x11a3bb[_0x6ae8('0x5')]||'';this['securityToken']=_0x11a3bb[_0x6ae8('0x6')]||'';this['type']=_0x11a3bb[_0x6ae8('0x7')]||_0x6ae8('0x8');this[_0x6ae8('0x9')]=_0x11a3bb[_0x6ae8('0x9')]||'';this[_0x6ae8('0xa')]=_0x11a3bb[_0x6ae8('0xa')]||{};}module[_0x6ae8('0xb')]=SalesforceAccount;
\ No newline at end of file
index 80e9515..d002011 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cb2=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x3aa706,_0x2a05b5){var _0xec7573=function(_0x5954fe){while(--_0x5954fe){_0x3aa706['push'](_0x3aa706['shift']());}};_0xec7573(++_0x2a05b5);}(_0x2cb2,0x98));var _0x22cb=function(_0x131288,_0xa2f8be){_0x131288=_0x131288-0x0;var _0x30e8c2=_0x2cb2[_0x131288];return _0x30e8c2;};'use strict';function SugarcrmAccount(_0x52238f){this['id']=_0x52238f['id']||0x0;this[_0x22cb('0x0')]=_0x52238f[_0x22cb('0x0')]||'';this[_0x22cb('0x1')]=_0x52238f[_0x22cb('0x1')]||'';this[_0x22cb('0x2')]=_0x52238f[_0x22cb('0x2')]||'';this[_0x22cb('0x3')]=_0x52238f[_0x22cb('0x3')]||'';this['serverUrl']=_0x52238f[_0x22cb('0x4')]||'';this[_0x22cb('0x5')]=_0x52238f[_0x22cb('0x5')]||{};}module[_0x22cb('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0xb1a0=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb1a0,0x1d4));var _0x0b1a=function(_0x489031,_0x2e5f9f){_0x489031=_0x489031-0x0;var _0x3fd8f1=_0xb1a0[_0x489031];return _0x3fd8f1;};'use strict';function SugarcrmAccount(_0x51eb0a){this['id']=_0x51eb0a['id']||0x0;this['name']=_0x51eb0a[_0x0b1a('0x0')]||'';this[_0x0b1a('0x1')]=_0x51eb0a[_0x0b1a('0x1')]||'';this[_0x0b1a('0x2')]=_0x51eb0a[_0x0b1a('0x2')]||'';this['remoteUri']=_0x51eb0a[_0x0b1a('0x3')]||'';this[_0x0b1a('0x4')]=_0x51eb0a[_0x0b1a('0x4')]||'';this['Configurations']=_0x51eb0a[_0x0b1a('0x5')]||{};}module[_0x0b1a('0x6')]=SugarcrmAccount;
\ No newline at end of file
index 4a5c25c..ecf8d89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84b0=['address','exports','name','state','unknown','status'];(function(_0x5d5787,_0x3c7f6f){var _0x86eb0=function(_0x19718f){while(--_0x19718f){_0x5d5787['push'](_0x5d5787['shift']());}};_0x86eb0(++_0x3c7f6f);}(_0x84b0,0x19a));var _0x084b=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x84b0[_0x187ee1];return _0x388160;};'use strict';function Telephone(_0x1731b4){this['id']=_0x1731b4['id']||0x0;this[_0x084b('0x0')]=_0x1731b4[_0x084b('0x0')]||'';this[_0x084b('0x1')]=_0x084b('0x2');this['stateTime']=0x0;this[_0x084b('0x3')]=_0x084b('0x2');this[_0x084b('0x4')]='';}module[_0x084b('0x5')]=Telephone;
\ No newline at end of file
+var _0x020b=['unknown','status','name','state'];(function(_0x296754,_0x5befe9){var _0x1d9f1d=function(_0x3f033e){while(--_0x3f033e){_0x296754['push'](_0x296754['shift']());}};_0x1d9f1d(++_0x5befe9);}(_0x020b,0xbe));var _0xb020=function(_0x35c076,_0x5e51d5){_0x35c076=_0x35c076-0x0;var _0xb5d7ad=_0x020b[_0x35c076];return _0xb5d7ad;};'use strict';function Telephone(_0x113287){this['id']=_0x113287['id']||0x0;this[_0xb020('0x0')]=_0x113287[_0xb020('0x0')]||'';this[_0xb020('0x1')]=_0xb020('0x2');this['stateTime']=0x0;this[_0xb020('0x3')]=_0xb020('0x2');this['address']='';}module['exports']=Telephone;
\ No newline at end of file
index 116a813..e85b45b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['html','exports','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2f129c,_0x37433f){_0x2f129c=_0x2f129c-0x0;var _0x350935=_0xb43b[_0x2f129c];return _0x350935;};'use strict';function template(_0x2ee678){this['id']=_0x2ee678['id']||0x0;this[_0xbb43('0x0')]=_0x2ee678['name']||'';this[_0xbb43('0x1')]=_0x2ee678[_0xbb43('0x1')]||'';}module[_0xbb43('0x2')]=template;
\ No newline at end of file
+var _0x579c=['name','html'];(function(_0x55c016,_0xc40056){var _0x1f1417=function(_0x30f3c6){while(--_0x30f3c6){_0x55c016['push'](_0x55c016['shift']());}};_0x1f1417(++_0xc40056);}(_0x579c,0xda));var _0xc579=function(_0xf3c51c,_0x4f5db2){_0xf3c51c=_0xf3c51c-0x0;var _0x440d95=_0x579c[_0xf3c51c];return _0x440d95;};'use strict';function template(_0x1e78b7){this['id']=_0x1e78b7['id']||0x0;this[_0xc579('0x0')]=_0x1e78b7[_0xc579('0x0')]||'';this[_0xc579('0x1')]=_0x1e78b7[_0xc579('0x1')]||'';}module['exports']=template;
\ No newline at end of file
index f35d4a2..4b3f08d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9813=['AllConditions','AnyConditions','Actions','exports','name','channel','voice','status'];(function(_0x2973a7,_0x16d0ac){var _0xfce949=function(_0x521d85){while(--_0x521d85){_0x2973a7['push'](_0x2973a7['shift']());}};_0xfce949(++_0x16d0ac);}(_0x9813,0x144));var _0x3981=function(_0x73171f,_0x52fd5c){_0x73171f=_0x73171f-0x0;var _0x5e8d13=_0x9813[_0x73171f];return _0x5e8d13;};'use strict';function Trigger(_0x52e3dc){this['id']=_0x52e3dc['id']||0x0;this[_0x3981('0x0')]=_0x52e3dc[_0x3981('0x0')]||'';this[_0x3981('0x1')]=_0x52e3dc['channel']||_0x3981('0x2');this['status']=_0x52e3dc[_0x3981('0x3')]||![];this[_0x3981('0x4')]=_0x52e3dc['AllConditions']||[];this['AnyConditions']=_0x52e3dc[_0x3981('0x5')]||[];this[_0x3981('0x6')]=_0x52e3dc[_0x3981('0x6')]||[];}module[_0x3981('0x7')]=Trigger;
\ No newline at end of file
+var _0x42ac=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x3570ae,_0xf4b6d1){var _0x1fb978=function(_0x1d969e){while(--_0x1d969e){_0x3570ae['push'](_0x3570ae['shift']());}};_0x1fb978(++_0xf4b6d1);}(_0x42ac,0x192));var _0xc42a=function(_0x118a6d,_0x2f0271){_0x118a6d=_0x118a6d-0x0;var _0x2bf4be=_0x42ac[_0x118a6d];return _0x2bf4be;};'use strict';function Trigger(_0x27bc4a){this['id']=_0x27bc4a['id']||0x0;this[_0xc42a('0x0')]=_0x27bc4a[_0xc42a('0x0')]||'';this[_0xc42a('0x1')]=_0x27bc4a[_0xc42a('0x1')]||_0xc42a('0x2');this['status']=_0x27bc4a[_0xc42a('0x3')]||![];this[_0xc42a('0x4')]=_0x27bc4a[_0xc42a('0x4')]||[];this['AnyConditions']=_0x27bc4a[_0xc42a('0x5')]||[];this['Actions']=_0x27bc4a[_0xc42a('0x6')]||[];}module['exports']=Trigger;
\ No newline at end of file
index b1f302b..a672daf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea89=['registrationtime','exports','active','name','state','stateTime','status','unknown','registry','indexOf','split','host','port','refresh','stateRegistry'];(function(_0x43d560,_0x56e472){var _0xb33118=function(_0x2f00f7){while(--_0x2f00f7){_0x43d560['push'](_0x43d560['shift']());}};_0xb33118(++_0x56e472);}(_0xea89,0x1b5));var _0x9ea8=function(_0x41be19,_0x546ffc){_0x41be19=_0x41be19-0x0;var _0x3c6c74=_0xea89[_0x41be19];return _0x3c6c74;};'use strict';function Trunk(_0x34faa4){this['id']=_0x34faa4['id']||0x0;this['active']=_0x34faa4[_0x9ea8('0x0')]||![];this[_0x9ea8('0x1')]=_0x34faa4['name']||'';this[_0x9ea8('0x2')]='unknown';this[_0x9ea8('0x3')]=0x0;this[_0x9ea8('0x4')]=_0x9ea8('0x5');this['registry']=_0x34faa4[_0x9ea8('0x6')]&&_0x34faa4[_0x9ea8('0x6')][_0x9ea8('0x7')](':')?_0x34faa4[_0x9ea8('0x6')][_0x9ea8('0x8')](':')[0x0]:'';this[_0x9ea8('0x9')]='';this[_0x9ea8('0xa')]='';this['domain']='';this['domainport']='';this[_0x9ea8('0xb')]='';this[_0x9ea8('0xc')]=_0x9ea8('0x5');this[_0x9ea8('0xd')]='';this['address']='';}module[_0x9ea8('0xe')]=Trunk;
\ No newline at end of file
+var _0xff57=['domain','domainport','refresh','stateRegistry','address','exports','active','name','state','stateTime','status','unknown','registry','split','port'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff57,0x18c));var _0x7ff5=function(_0x24881b,_0x50d67e){_0x24881b=_0x24881b-0x0;var _0x433b51=_0xff57[_0x24881b];return _0x433b51;};'use strict';function Trunk(_0x5773c5){this['id']=_0x5773c5['id']||0x0;this[_0x7ff5('0x0')]=_0x5773c5['active']||![];this[_0x7ff5('0x1')]=_0x5773c5['name']||'';this[_0x7ff5('0x2')]='unknown';this[_0x7ff5('0x3')]=0x0;this[_0x7ff5('0x4')]=_0x7ff5('0x5');this[_0x7ff5('0x6')]=_0x5773c5[_0x7ff5('0x6')]&&_0x5773c5['registry']['indexOf'](':')?_0x5773c5[_0x7ff5('0x6')][_0x7ff5('0x7')](':')[0x0]:'';this['host']='';this[_0x7ff5('0x8')]='';this[_0x7ff5('0x9')]='';this[_0x7ff5('0xa')]='';this[_0x7ff5('0xb')]='';this[_0x7ff5('0xc')]=_0x7ff5('0x5');this['registrationtime']='';this[_0x7ff5('0xd')]='';}module[_0x7ff5('0xe')]=Trunk;
\ No newline at end of file
index 2911229..a764ff3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['none','exports','exten','recordingFormat'];(function(_0x2b2564,_0x1e1124){var _0xa97e01=function(_0x5cc8bc){while(--_0x5cc8bc){_0x2b2564['push'](_0x2b2564['shift']());}};_0xa97e01(++_0x1e1124);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';function voiceExtension(_0x4bf247){this['id']=_0x4bf247['id']||0x0;this['exten']=_0x4bf247[_0x3071('0x0')]||'';this[_0x3071('0x1')]=_0x4bf247[_0x3071('0x1')]||_0x3071('0x2');}module[_0x3071('0x3')]=voiceExtension;
\ No newline at end of file
+var _0xb4e6=['exten','recordingFormat','none','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x1ebeea,_0x2f54f4){_0x1ebeea=_0x1ebeea-0x0;var _0x576465=_0xb4e6[_0x1ebeea];return _0x576465;};'use strict';function voiceExtension(_0x54acd0){this['id']=_0x54acd0['id']||0x0;this['exten']=_0x54acd0[_0x6b4e('0x0')]||'';this[_0x6b4e('0x1')]=_0x54acd0[_0x6b4e('0x1')]||_0x6b4e('0x2');}module[_0x6b4e('0x3')]=voiceExtension;
\ No newline at end of file
index e307e55..a8ac5df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd28=['timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','exports','not_inuse','inuse','invalid','ringing','ringinuse','onhold','wav49','gsm','rrmemory','roundrobin','monitor_format','type','inbound','talking','answered','sumHoldTime','unmanaged','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay'];(function(_0x2bb30a,_0x13c669){var _0x1d0ae8=function(_0x3083b5){while(--_0x3083b5){_0x2bb30a['push'](_0x2bb30a['shift']());}};_0x1d0ae8(++_0x13c669);}(_0xfd28,0x148));var _0x8fd2=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xfd28[_0x45d55e];return _0x29812a;};'use strict';var statusDesc=['unknown',_0x8fd2('0x0'),_0x8fd2('0x1'),'busy',_0x8fd2('0x2'),'unavailable',_0x8fd2('0x3'),_0x8fd2('0x4'),_0x8fd2('0x5')];var monitorFormat={'wav':'wav','wav49':_0x8fd2('0x6'),'gsm':_0x8fd2('0x7')};var strategy={'rrmemory':_0x8fd2('0x8'),'roundrobin':_0x8fd2('0x9')};function VoiceQueue(_0x2f0afc){this['id']=_0x2f0afc['id']||0x0;this['name']=_0x2f0afc['name']||'';this[_0x8fd2('0xa')]=_0x2f0afc[_0x8fd2('0xa')]||'';this[_0x8fd2('0xb')]=_0x2f0afc['type']||_0x8fd2('0xc');this['waiting']=0x0;this[_0x8fd2('0xd')]=0x0;this['total']=0x0;this[_0x8fd2('0xe')]=0x0;this['sumDuration']=0x0;this[_0x8fd2('0xf')]=0x0;this['sumBillable']=0x0;this[_0x8fd2('0x10')]=0x0;this['loggedIn']=0x0;this[_0x8fd2('0x11')]=0x0;this[_0x8fd2('0x12')]=_0x2f0afc[_0x8fd2('0x12')]||![];this[_0x8fd2('0x13')]=_0x2f0afc[_0x8fd2('0x13')]||0xa;this[_0x8fd2('0x14')]=_0x2f0afc[_0x8fd2('0x14')]||'no';this[_0x8fd2('0x15')]=!![];this[_0x8fd2('0x16')]='';this[_0x8fd2('0x17')]=0x0;this[_0x8fd2('0x18')]=0x0;this[_0x8fd2('0x19')]=_0x2f0afc[_0x8fd2('0x19')]||null;this[_0x8fd2('0x1a')]=_0x2f0afc[_0x8fd2('0x1a')]?_0x2f0afc['dialGlobalInterval']:null;this[_0x8fd2('0x1b')]=_0x2f0afc['dialActive'];this['dialMethod']=_0x2f0afc['dialMethod']||_0x8fd2('0x1c');this[_0x8fd2('0x1d')]=_0x2f0afc[_0x8fd2('0x1d')]||0x0;this[_0x8fd2('0x1e')]=_0x2f0afc['dialLimitQueue']||0x0;this[_0x8fd2('0x1f')]=_0x2f0afc[_0x8fd2('0x1f')]||0x1;this[_0x8fd2('0x20')]=_0x2f0afc[_0x8fd2('0x20')]||_0x8fd2('0x21');this['dialPredictiveOptimizationPercentage']=_0x2f0afc['dialPredictiveOptimizationPercentage']||0.03;this[_0x8fd2('0x22')]=_0x2f0afc['dialPredictiveInterval']||0x258;this[_0x8fd2('0x23')]=_0x2f0afc['dialOriginateCallerIdName']||_0x8fd2('0x24');this[_0x8fd2('0x25')]=_0x2f0afc['dialOriginateCallerIdNumber']||_0x8fd2('0x24');this['dialOriginateTimeout']=_0x2f0afc[_0x8fd2('0x26')]||0x1e;this[_0x8fd2('0x27')]=_0x2f0afc['dialQueueOptions']||_0x8fd2('0x28');this[_0x8fd2('0x29')]=_0x2f0afc[_0x8fd2('0x29')]||0x3;this['dialQueueProject']=_0x2f0afc[_0x8fd2('0x2a')]||undefined;this[_0x8fd2('0x2b')]=_0x2f0afc[_0x8fd2('0x2b')]||0x3;this[_0x8fd2('0x2c')]=_0x2f0afc[_0x8fd2('0x2c')]||0x96;this[_0x8fd2('0x2d')]=_0x2f0afc[_0x8fd2('0x2d')]||0x3;this[_0x8fd2('0x2e')]=_0x2f0afc[_0x8fd2('0x2e')]||0x96;this[_0x8fd2('0x2f')]=_0x2f0afc[_0x8fd2('0x2f')]||0x3;this[_0x8fd2('0x30')]=_0x2f0afc[_0x8fd2('0x30')]||0x96;this['dialGlobalMaxRetry']=_0x2f0afc['dialGlobalMaxRetry']||0x4;this[_0x8fd2('0x31')]=_0x2f0afc[_0x8fd2('0x31')]?_0x2f0afc[_0x8fd2('0x31')]:undefined;this['TrunkBackup']=_0x2f0afc[_0x8fd2('0x32')]?_0x2f0afc[_0x8fd2('0x32')]:undefined;this[_0x8fd2('0x33')]=_0x2f0afc[_0x8fd2('0x33')]||undefined;this[_0x8fd2('0x34')]=_0x2f0afc[_0x8fd2('0x34')]?_0x2f0afc[_0x8fd2('0x34')]:undefined;this['dialOrderByScheduledAt']=_0x2f0afc[_0x8fd2('0x35')]||_0x8fd2('0x36');this[_0x8fd2('0x37')]=_0x2f0afc[_0x8fd2('0x37')]||undefined;this[_0x8fd2('0x38')]=_0x2f0afc[_0x8fd2('0x38')]||undefined;this[_0x8fd2('0x39')]=strategy[_0x2f0afc['strategy']]||'rrmemory';this['queueStatusComplete']=!![];this[_0x8fd2('0x3a')]=_0x2f0afc[_0x8fd2('0x3a')]||![];this[_0x8fd2('0x3b')]=_0x2f0afc[_0x8fd2('0x3b')];this['dialAMDGreeting']=_0x2f0afc['dialAMDGreeting'];this[_0x8fd2('0x3c')]=_0x2f0afc[_0x8fd2('0x3c')];this[_0x8fd2('0x3d')]=_0x2f0afc[_0x8fd2('0x3d')];this[_0x8fd2('0x3e')]=_0x2f0afc['dialAMDMinWordLength'];this[_0x8fd2('0x3f')]=_0x2f0afc['dialAMDBetweenWordsSilence'];this[_0x8fd2('0x40')]=_0x2f0afc['dialAMDMaximumNumberOfWords'];this[_0x8fd2('0x41')]=_0x2f0afc['dialAMDSilenceThreshold'];this[_0x8fd2('0x42')]=_0x2f0afc[_0x8fd2('0x42')];this[_0x8fd2('0x43')]=0x0;this['pTalking']=0x0;this[_0x8fd2('0x44')]=_0x2f0afc['timeout'];this[_0x8fd2('0x45')]=0x0;this[_0x8fd2('0x46')]=0x0;this[_0x8fd2('0x47')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x8fd2('0x48')]=0x0;this[_0x8fd2('0x49')]=0x0;this[_0x8fd2('0x4a')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x8fd2('0x4b')]=0x0;this[_0x8fd2('0x4c')]=0x0;this[_0x8fd2('0x4d')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x8fd2('0x4e')]=0x0;this[_0x8fd2('0x4f')]=undefined;this['startPredictive']=undefined;this[_0x8fd2('0x50')]=undefined;this[_0x8fd2('0x51')]=1.05;this[_0x8fd2('0x52')]=0x0;this[_0x8fd2('0x53')]=0x0;this[_0x8fd2('0x54')]=0x0;this[_0x8fd2('0x55')]=0x0;this[_0x8fd2('0x56')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x8fd2('0x57')]=0x0;this['predictiveIntervalLowerLimit']=0.4;this['predictiveIntervalErlangCalls']=0x0;this[_0x8fd2('0x58')]=0x0;this[_0x8fd2('0x59')]=0x1;this[_0x8fd2('0x5a')]=0x0;this[_0x8fd2('0x5b')]=0x0;this[_0x8fd2('0x5c')]=0x0;this[_0x8fd2('0x5d')]=0x0;this['dialRecallMeTimeout']=_0x2f0afc['dialRecallMeTimeout']||0x1e;this[_0x8fd2('0x5e')]=_0x2f0afc['dialRecallInQueue']||![];this['dialQueueProject2']=_0x2f0afc[_0x8fd2('0x5f')]||undefined;this[_0x8fd2('0x60')]=_0x2f0afc[_0x8fd2('0x60')]||![];this[_0x8fd2('0x61')]=_0x2f0afc['dialAgiAfterHangupAgent']||![];this[_0x8fd2('0xa')]=monitorFormat[_0x2f0afc[_0x8fd2('0xa')]]?monitorFormat[_0x2f0afc[_0x8fd2('0xa')]]:undefined;}module[_0x8fd2('0x62')]=VoiceQueue;
\ No newline at end of file
+var _0xf18d=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalLowerLimit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','exports','unknown','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumHoldTime','sumBillable','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency'];(function(_0x15c536,_0x45dbca){var _0x514730=function(_0x357e90){while(--_0x357e90){_0x15c536['push'](_0x15c536['shift']());}};_0x514730(++_0x45dbca);}(_0xf18d,0x1e7));var _0xdf18=function(_0xa23eff,_0x54fc75){_0xa23eff=_0xa23eff-0x0;var _0x3a5f6d=_0xf18d[_0xa23eff];return _0x3a5f6d;};'use strict';var statusDesc=[_0xdf18('0x0'),'not_inuse',_0xdf18('0x1'),_0xdf18('0x2'),_0xdf18('0x3'),_0xdf18('0x4'),_0xdf18('0x5'),_0xdf18('0x6'),_0xdf18('0x7')];var monitorFormat={'wav':_0xdf18('0x8'),'wav49':'wav49','gsm':_0xdf18('0x9')};var strategy={'rrmemory':_0xdf18('0xa'),'roundrobin':_0xdf18('0xb')};function VoiceQueue(_0x21d72b){this['id']=_0x21d72b['id']||0x0;this[_0xdf18('0xc')]=_0x21d72b['name']||'';this[_0xdf18('0xd')]=_0x21d72b[_0xdf18('0xd')]||'';this[_0xdf18('0xe')]=_0x21d72b[_0xdf18('0xe')]||_0xdf18('0xf');this[_0xdf18('0x10')]=0x0;this[_0xdf18('0x11')]=0x0;this[_0xdf18('0x12')]=0x0;this[_0xdf18('0x13')]=0x0;this['sumDuration']=0x0;this[_0xdf18('0x14')]=0x0;this[_0xdf18('0x15')]=0x0;this['unmanaged']=0x0;this[_0xdf18('0x16')]=0x0;this[_0xdf18('0x17')]=0x0;this['acw']=_0x21d72b[_0xdf18('0x18')]||![];this[_0xdf18('0x19')]=_0x21d72b[_0xdf18('0x19')]||0xa;this[_0xdf18('0x1a')]=_0x21d72b[_0xdf18('0x1a')]||'no';this[_0xdf18('0x1b')]=!![];this['message']='';this[_0xdf18('0x1c')]=0x0;this[_0xdf18('0x1d')]=0x0;this[_0xdf18('0x1e')]=_0x21d72b[_0xdf18('0x1e')]||null;this[_0xdf18('0x1f')]=_0x21d72b['dialGlobalInterval']?_0x21d72b[_0xdf18('0x1f')]:null;this[_0xdf18('0x20')]=_0x21d72b[_0xdf18('0x20')];this['dialMethod']=_0x21d72b[_0xdf18('0x21')]||_0xdf18('0x22');this[_0xdf18('0x23')]=_0x21d72b['dialLimitChannel']||0x0;this[_0xdf18('0x24')]=_0x21d72b[_0xdf18('0x24')]||0x0;this[_0xdf18('0x25')]=_0x21d72b[_0xdf18('0x25')]||0x1;this[_0xdf18('0x26')]=_0x21d72b[_0xdf18('0x26')]||_0xdf18('0x27');this[_0xdf18('0x28')]=_0x21d72b[_0xdf18('0x28')]||0.03;this[_0xdf18('0x29')]=_0x21d72b['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x21d72b[_0xdf18('0x2a')]||_0xdf18('0x2b');this['dialOriginateCallerIdNumber']=_0x21d72b['dialOriginateCallerIdNumber']||_0xdf18('0x2b');this[_0xdf18('0x2c')]=_0x21d72b[_0xdf18('0x2c')]||0x1e;this[_0xdf18('0x2d')]=_0x21d72b[_0xdf18('0x2d')]||_0xdf18('0x2e');this['dialQueueTimeout']=_0x21d72b[_0xdf18('0x2f')]||0x3;this[_0xdf18('0x30')]=_0x21d72b[_0xdf18('0x30')]||undefined;this[_0xdf18('0x31')]=_0x21d72b['dialCongestionMaxRetry']||0x3;this[_0xdf18('0x32')]=_0x21d72b[_0xdf18('0x32')]||0x96;this[_0xdf18('0x33')]=_0x21d72b[_0xdf18('0x33')]||0x3;this[_0xdf18('0x34')]=_0x21d72b[_0xdf18('0x34')]||0x96;this[_0xdf18('0x35')]=_0x21d72b[_0xdf18('0x35')]||0x3;this[_0xdf18('0x36')]=_0x21d72b['dialNoAnswerRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x21d72b[_0xdf18('0x37')]||0x4;this[_0xdf18('0x38')]=_0x21d72b[_0xdf18('0x38')]?_0x21d72b['Trunk']:undefined;this['TrunkBackup']=_0x21d72b[_0xdf18('0x39')]?_0x21d72b[_0xdf18('0x39')]:undefined;this[_0xdf18('0x3a')]=_0x21d72b[_0xdf18('0x3a')]||undefined;this[_0xdf18('0x3b')]=_0x21d72b[_0xdf18('0x3b')]?_0x21d72b['Interval']:undefined;this[_0xdf18('0x3c')]=_0x21d72b[_0xdf18('0x3c')]||_0xdf18('0x3d');this[_0xdf18('0x3e')]=_0x21d72b[_0xdf18('0x3e')]||undefined;this['dialCutDigit']=_0x21d72b[_0xdf18('0x3f')]||undefined;this[_0xdf18('0x40')]=strategy[_0x21d72b[_0xdf18('0x40')]]||_0xdf18('0xa');this[_0xdf18('0x41')]=!![];this[_0xdf18('0x42')]=_0x21d72b[_0xdf18('0x42')]||![];this['dialAMDInitialSilence']=_0x21d72b[_0xdf18('0x43')];this[_0xdf18('0x44')]=_0x21d72b[_0xdf18('0x44')];this['dialAMDAfterGreetingSilence']=_0x21d72b[_0xdf18('0x45')];this[_0xdf18('0x46')]=_0x21d72b[_0xdf18('0x46')];this['dialAMDMinWordLength']=_0x21d72b[_0xdf18('0x47')];this[_0xdf18('0x48')]=_0x21d72b[_0xdf18('0x48')];this[_0xdf18('0x49')]=_0x21d72b[_0xdf18('0x49')];this['dialAMDSilenceThreshold']=_0x21d72b[_0xdf18('0x4a')];this['dialAMDMaximumWordLength']=_0x21d72b['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0xdf18('0x4b')]=0x0;this[_0xdf18('0x4c')]=_0x21d72b[_0xdf18('0x4c')];this[_0xdf18('0x4d')]=0x0;this[_0xdf18('0x4e')]=0x0;this[_0xdf18('0x4f')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xdf18('0x50')]=0x0;this[_0xdf18('0x51')]=0x0;this[_0xdf18('0x52')]=0x0;this[_0xdf18('0x53')]=0x0;this[_0xdf18('0x54')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xdf18('0x55')]=0x0;this[_0xdf18('0x56')]=0x0;this[_0xdf18('0x57')]=0x0;this[_0xdf18('0x58')]=undefined;this['startPredictive']=undefined;this[_0xdf18('0x59')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xdf18('0x5a')]=0x0;this[_0xdf18('0x5b')]=0x0;this[_0xdf18('0x5c')]=0x0;this[_0xdf18('0x5d')]=0x0;this[_0xdf18('0x5e')]=0x0;this[_0xdf18('0x5f')]=0x0;this[_0xdf18('0x60')]=0x0;this[_0xdf18('0x61')]=0.4;this[_0xdf18('0x62')]=0x0;this[_0xdf18('0x63')]=0x0;this[_0xdf18('0x64')]=0x1;this['erlangCalls']=0x0;this[_0xdf18('0x65')]=0x0;this[_0xdf18('0x66')]=0x0;this['erlangBusyFactor']=0x0;this[_0xdf18('0x67')]=_0x21d72b[_0xdf18('0x67')]||0x1e;this[_0xdf18('0x68')]=_0x21d72b['dialRecallInQueue']||![];this[_0xdf18('0x69')]=_0x21d72b[_0xdf18('0x69')]||undefined;this['dialAgiAfterHangupClient']=_0x21d72b[_0xdf18('0x6a')]||![];this['dialAgiAfterHangupAgent']=_0x21d72b['dialAgiAfterHangupAgent']||![];this[_0xdf18('0xd')]=monitorFormat[_0x21d72b['monitor_format']]?monitorFormat[_0x21d72b[_0xdf18('0xd')]]:undefined;}module[_0xdf18('0x6b')]=VoiceQueue;
\ No newline at end of file
index a626089..4432695 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0285=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x0285,0x14c));var _0x5028=function(_0x31aec1,_0x394b02){_0x31aec1=_0x31aec1-0x0;var _0x277efa=_0x0285[_0x31aec1];return _0x277efa;};'use strict';function VtigerAccount(_0x1a28bf){this['id']=_0x1a28bf['id']||0x0;this[_0x5028('0x0')]=_0x1a28bf[_0x5028('0x0')]||'';this[_0x5028('0x1')]=_0x1a28bf['username']||'';this[_0x5028('0x2')]=_0x1a28bf['accessKey']||'';this[_0x5028('0x3')]=_0x1a28bf[_0x5028('0x3')]||'';this[_0x5028('0x4')]=_0x1a28bf['serverUrl']||'';this[_0x5028('0x5')]=_0x1a28bf[_0x5028('0x5')]||{};}module[_0x5028('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0xca9e=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x22df90,_0x309a8d){var _0x2a931d=function(_0x3779f3){while(--_0x3779f3){_0x22df90['push'](_0x22df90['shift']());}};_0x2a931d(++_0x309a8d);}(_0xca9e,0x136));var _0xeca9=function(_0x33c1a9,_0x2a1d47){_0x33c1a9=_0x33c1a9-0x0;var _0x24b4fb=_0xca9e[_0x33c1a9];return _0x24b4fb;};'use strict';function VtigerAccount(_0x4512fa){this['id']=_0x4512fa['id']||0x0;this[_0xeca9('0x0')]=_0x4512fa[_0xeca9('0x0')]||'';this[_0xeca9('0x1')]=_0x4512fa[_0xeca9('0x1')]||'';this[_0xeca9('0x2')]=_0x4512fa[_0xeca9('0x2')]||'';this[_0xeca9('0x3')]=_0x4512fa[_0xeca9('0x3')]||'';this[_0xeca9('0x4')]=_0x4512fa[_0xeca9('0x4')]||'';this[_0xeca9('0x5')]=_0x4512fa[_0xeca9('0x5')]||{};}module[_0xeca9('0x6')]=VtigerAccount;
\ No newline at end of file
index 985fae4..61aeee3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffa9=['password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','name','username'];(function(_0x258b6e,_0x116d61){var _0x36a5c0=function(_0x3928ea){while(--_0x3928ea){_0x258b6e['push'](_0x258b6e['shift']());}};_0x36a5c0(++_0x116d61);}(_0xffa9,0x6c));var _0x9ffa=function(_0x21b74b,_0x543c76){_0x21b74b=_0x21b74b-0x0;var _0x518cc6=_0xffa9[_0x21b74b];return _0x518cc6;};'use strict';function ZendeskAccount(_0x1a6e7a){this['id']=_0x1a6e7a['id']||0x0;this[_0x9ffa('0x0')]=_0x1a6e7a['name']||'';this[_0x9ffa('0x1')]=_0x1a6e7a[_0x9ffa('0x1')]||'';this[_0x9ffa('0x2')]=_0x1a6e7a['password']||'';this[_0x9ffa('0x3')]=_0x1a6e7a[_0x9ffa('0x3')]||'';this[_0x9ffa('0x4')]=_0x1a6e7a[_0x9ffa('0x4')]||'';this[_0x9ffa('0x5')]=_0x1a6e7a[_0x9ffa('0x5')]||'';this[_0x9ffa('0x6')]=_0x1a6e7a[_0x9ffa('0x6')]||_0x9ffa('0x7');this[_0x9ffa('0x8')]=_0x1a6e7a[_0x9ffa('0x8')]||'';this[_0x9ffa('0x9')]=_0x1a6e7a[_0x9ffa('0x9')]||{};}module['exports']=ZendeskAccount;
\ No newline at end of file
+var _0xf777=['token','remoteUri','authType','type','serverUrl','Configurations','exports','name','username','password'];(function(_0x20b81e,_0x4fec12){var _0xf1f97b=function(_0x2f7558){while(--_0x2f7558){_0x20b81e['push'](_0x20b81e['shift']());}};_0xf1f97b(++_0x4fec12);}(_0xf777,0x93));var _0x7f77=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf777[_0x14add3];return _0x4a174f;};'use strict';function ZendeskAccount(_0x454c5c){this['id']=_0x454c5c['id']||0x0;this[_0x7f77('0x0')]=_0x454c5c[_0x7f77('0x0')]||'';this[_0x7f77('0x1')]=_0x454c5c['username']||'';this[_0x7f77('0x2')]=_0x454c5c[_0x7f77('0x2')]||'';this[_0x7f77('0x3')]=_0x454c5c[_0x7f77('0x3')]||'';this[_0x7f77('0x4')]=_0x454c5c[_0x7f77('0x4')]||'';this[_0x7f77('0x5')]=_0x454c5c[_0x7f77('0x5')]||'';this[_0x7f77('0x6')]=_0x454c5c[_0x7f77('0x6')]||'integrationTab';this[_0x7f77('0x7')]=_0x454c5c[_0x7f77('0x7')]||'';this[_0x7f77('0x8')]=_0x454c5c[_0x7f77('0x8')]||{};}module[_0x7f77('0x9')]=ZendeskAccount;
\ No newline at end of file
index 2554279..34d3026 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9536=['authToken','host','Configurations','serverUrl','exports','name'];(function(_0x3ee52f,_0x34d5da){var _0x2f6c39=function(_0x3c48b9){while(--_0x3c48b9){_0x3ee52f['push'](_0x3ee52f['shift']());}};_0x2f6c39(++_0x34d5da);}(_0x9536,0x179));var _0x6953=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0x9536[_0x4c7935];return _0x30651d;};'use strict';function ZohoAccount(_0x57c4b8){this['id']=_0x57c4b8['id']||0x0;this[_0x6953('0x0')]=_0x57c4b8[_0x6953('0x0')]||'';this[_0x6953('0x1')]=_0x57c4b8['authToken']||'';this[_0x6953('0x2')]=_0x57c4b8['host']||'';this[_0x6953('0x3')]=_0x57c4b8[_0x6953('0x3')]||{};this[_0x6953('0x4')]=_0x57c4b8[_0x6953('0x4')]||'';}module[_0x6953('0x5')]=ZohoAccount;
\ No newline at end of file
+var _0x01d9=['name','authToken','host','Configurations','serverUrl','exports'];(function(_0xeab7ad,_0x4dd687){var _0x27fa97=function(_0x26bca9){while(--_0x26bca9){_0xeab7ad['push'](_0xeab7ad['shift']());}};_0x27fa97(++_0x4dd687);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';function ZohoAccount(_0x215d5a){this['id']=_0x215d5a['id']||0x0;this[_0x901d('0x0')]=_0x215d5a[_0x901d('0x0')]||'';this[_0x901d('0x1')]=_0x215d5a['authToken']||'';this[_0x901d('0x2')]=_0x215d5a[_0x901d('0x2')]||'';this[_0x901d('0x3')]=_0x215d5a[_0x901d('0x3')]||{};this[_0x901d('0x4')]=_0x215d5a[_0x901d('0x4')]||'';}module[_0x901d('0x5')]=ZohoAccount;
\ No newline at end of file
index 5ec743c..3a94044 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8df=['isNil','string','queue','name','type','campaigntype','dialAnswer','membername','channelAgent','format','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','Agent','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','calleridname','number','exports','util','lodash'];(function(_0x575e5d,_0x250299){var _0x953d20=function(_0x2b0d7a){while(--_0x2b0d7a){_0x575e5d['push'](_0x575e5d['shift']());}};_0x953d20(++_0x250299);}(_0xd8df,0x1de));var _0xfd8d=function(_0x54575d,_0xda212c){_0x54575d=_0x54575d-0x0;var _0x3d5f88=_0xd8df[_0x54575d];return _0x3d5f88;};'use strict';var util=require(_0xfd8d('0x0'));var _=require(_0xfd8d('0x1'));var moment=require('moment');function checkNameSurname(_0x40a90f,_0x3a5ce6,_0x2d9e4c){var _0x4b9472='';if(!_[_0xfd8d('0x2')](_0x3a5ce6)&&_0xfd8d('0x3')===typeof _0x3a5ce6){_0x4b9472+=_0x3a5ce6;}if(!_[_0xfd8d('0x2')](_0x2d9e4c)&&_0xfd8d('0x3')===typeof _0x2d9e4c){_0x4b9472+='\x20'+_0x2d9e4c;}if(_0x4b9472!==''){return _0x4b9472;}return _0x40a90f;}function Action(_0x475840,_0x1f5cd8,_0x2e77ac,_0x37161d,_0x58c275){this['uniqueid']=_0x2e77ac||undefined;this['idContact']=_0x475840['id'];this[_0xfd8d('0x4')]=_0x1f5cd8[_0xfd8d('0x5')];this[_0xfd8d('0x6')]=_0x1f5cd8[_0xfd8d('0x6')];this[_0xfd8d('0x7')]=_0xfd8d('0x4');this[_0xfd8d('0x8')]=![];this[_0xfd8d('0x9')]=_[_0xfd8d('0x2')](_0x475840['Agent'])?undefined:_0x475840['Agent']['name'];this[_0xfd8d('0xa')]=this[_0xfd8d('0x9')]?util[_0xfd8d('0xb')](_0xfd8d('0xc'),this[_0xfd8d('0x9')]):_0x37161d||undefined;this['calleridname']=checkNameSurname(_0x475840[_0xfd8d('0xd')][_0xfd8d('0xe')],_0x475840[_0xfd8d('0xd')][_0xfd8d('0xf')],_0x475840[_0xfd8d('0xd')][_0xfd8d('0x10')]);this[_0xfd8d('0x11')]=_0x475840[_0xfd8d('0x11')]||![];this[_0xfd8d('0x12')]=_0x475840['Contact'][_0xfd8d('0xe')];this[_0xfd8d('0x13')]=_0x475840[_0xfd8d('0x13')];this['countbusyretry']=_0x475840[_0xfd8d('0x14')]||0x0;this[_0xfd8d('0x15')]=_0x475840[_0xfd8d('0x15')]||0x0;this['countnoanswerretry']=_0x475840['countnoanswerretry']||0x0;this[_0xfd8d('0x16')]=(_0x475840[_0xfd8d('0x14')]||0x0)+(_0x475840['countcongestionretry']||0x0)+(_0x475840[_0xfd8d('0x17')]||0x0);this['callback']=_0x475840[_0xfd8d('0x18')];this[_0xfd8d('0x19')]=_0x475840[_0xfd8d('0x19')];this[_0xfd8d('0x1a')]=_0x475840['callbackat'];this[_0xfd8d('0x1b')]=_0x475840[_0xfd8d('0x1b')];this[_0xfd8d('0x1c')]=_0x475840[_0xfd8d('0x1c')];this[_0xfd8d('0x1d')]=_0x475840[_0xfd8d('0x1d')];this[_0xfd8d('0x1e')]=_[_0xfd8d('0x2')](_0x475840[_0xfd8d('0x1f')])?_0x475840['UserId']:_0x475840[_0xfd8d('0x1f')]['id'];this[_0xfd8d('0x20')]=_0x475840[_0xfd8d('0x20')];this[_0xfd8d('0x21')]='';this[_0xfd8d('0x22')]='';}Action[_0xfd8d('0x23')][_0xfd8d('0x24')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0xfd8d('0x25')],this[_0xfd8d('0x26')]);};module[_0xfd8d('0x27')]=Action;
\ No newline at end of file
+var _0x38e9=['\x22%s\x22\x20<%s>','calleridname','number','exports','util','isNil','string','queue','name','campaigntype','dialAnswer','membername','Agent','channelAgent','format','Contact','phone','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x38e9,0x94));var _0x938e=function(_0x54abae,_0x154d8f){_0x54abae=_0x54abae-0x0;var _0x297e50=_0x38e9[_0x54abae];return _0x297e50;};'use strict';var util=require(_0x938e('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x470eb9,_0x22f801,_0x5763e0){var _0x32e407='';if(!_[_0x938e('0x1')](_0x22f801)&&_0x938e('0x2')===typeof _0x22f801){_0x32e407+=_0x22f801;}if(!_['isNil'](_0x5763e0)&&_0x938e('0x2')===typeof _0x5763e0){_0x32e407+='\x20'+_0x5763e0;}if(_0x32e407!==''){return _0x32e407;}return _0x470eb9;}function Action(_0x5bed3a,_0xb1c12c,_0x3ef361,_0x57da97,_0x2f55d3){this['uniqueid']=_0x3ef361||undefined;this['idContact']=_0x5bed3a['id'];this[_0x938e('0x3')]=_0xb1c12c[_0x938e('0x4')];this['type']=_0xb1c12c['type'];this[_0x938e('0x5')]='queue';this[_0x938e('0x6')]=![];this[_0x938e('0x7')]=_[_0x938e('0x1')](_0x5bed3a[_0x938e('0x8')])?undefined:_0x5bed3a[_0x938e('0x8')][_0x938e('0x4')];this[_0x938e('0x9')]=this[_0x938e('0x7')]?util[_0x938e('0xa')]('SIP/%s',this['membername']):_0x57da97||undefined;this['calleridname']=checkNameSurname(_0x5bed3a[_0x938e('0xb')][_0x938e('0xc')],_0x5bed3a[_0x938e('0xb')]['firstName'],_0x5bed3a['Contact'][_0x938e('0xd')]);this['active']=_0x5bed3a[_0x938e('0xe')]||![];this['calleridnum']=_0x5bed3a[_0x938e('0xb')][_0x938e('0xc')];this['scheduledat']=_0x5bed3a[_0x938e('0xf')];this[_0x938e('0x10')]=_0x5bed3a[_0x938e('0x10')]||0x0;this[_0x938e('0x11')]=_0x5bed3a[_0x938e('0x11')]||0x0;this['countnoanswerretry']=_0x5bed3a[_0x938e('0x12')]||0x0;this[_0x938e('0x13')]=(_0x5bed3a['countbusyretry']||0x0)+(_0x5bed3a['countcongestionretry']||0x0)+(_0x5bed3a[_0x938e('0x12')]||0x0);this[_0x938e('0x14')]=_0x5bed3a[_0x938e('0x14')];this[_0x938e('0x15')]=_0x5bed3a[_0x938e('0x15')];this['callbackat']=_0x5bed3a[_0x938e('0x16')];this['recallme']=_0x5bed3a[_0x938e('0x17')];this[_0x938e('0x18')]=_0x5bed3a[_0x938e('0x18')];this[_0x938e('0x19')]=_0x5bed3a[_0x938e('0x19')];this[_0x938e('0x1a')]=_[_0x938e('0x1')](_0x5bed3a[_0x938e('0x8')])?_0x5bed3a[_0x938e('0x1a')]:_0x5bed3a['Agent']['id'];this[_0x938e('0x1b')]=_0x5bed3a['VoiceQueueId'];this[_0x938e('0x1c')]='';this[_0x938e('0x1d')]='';}Action[_0x938e('0x1e')][_0x938e('0x1f')]=function(){return util[_0x938e('0xa')](_0x938e('0x20'),this[_0x938e('0x21')],this[_0x938e('0x22')]);};module[_0x938e('0x23')]=Action;
\ No newline at end of file
index 1e71d4a..7f8fbc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6050=['[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','CANCEL','[syncHangupRequest][logAgentReject]','idContact','disableContact','[Dialer][decrementTalkink][no\x20Hangup][Preview]','outboundUnknownCallsDay','cause-txt','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','object','reason','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','isNil','Contact','phone','Contact\x20is\x20undefined','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','called','Call\x20failed','[Blacklist][error]','SIP/%s','reachable','unmonitored','execRun','unlockContact','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','dialPrefix','trim','dialCutDigit','SIP/%s/%s%s','substring','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','starttime','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','lookAgent','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','channelstate','isUndefined','transfer','destlinkedid','dialstatus','addVariable','variables','filterKey','keys','variable','error','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','uuid','moment','md5','preview','../../../config/logger','actionPreview','./util/util','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','type','outbound','name','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','talking','total','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','sendMessageOneNotActive','pTalking','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','clearZombieChannels','setMessage','recallMe','info','Queue','originated:\x20','pTalking:\x20','queue','pick','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','getContactRecallMe','agentReadyId','then','getDiff','dialRecallMeTimeout','run','logger2','[RecallMe]','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','emit','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','buildObj','complete','[16]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','BUSY','Busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','rescheduleContact','dialBusyRetryFrequency','unlockAgent','activeContact','NOANSWER','NoAnswer','dialGlobalMaxRetry','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswer]','scheduledAt','outboundCongestionCallsDay','Congestion'];(function(_0x33c506,_0x100975){var _0x3d26c4=function(_0x1dfc08){while(--_0x1dfc08){_0x33c506['push'](_0x33c506['shift']());}};_0x3d26c4(++_0x100975);}(_0x6050,0x196));var _0x0605=function(_0x4c711d,_0xee4916){_0x4c711d=_0x4c711d-0x0;var _0x1fb7fc=_0x6050[_0x4c711d];return _0x1fb7fc;};'use strict';var util=require(_0x0605('0x0'));var _=require(_0x0605('0x1'));var BPromise=require(_0x0605('0x2'));var uuid=require(_0x0605('0x3'));var moment=require(_0x0605('0x4'));var md5=require(_0x0605('0x5'));var logger=require('../../../config/logger')(_0x0605('0x6'));var loggerAction=require(_0x0605('0x7'))(_0x0605('0x8'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require('./action');var ut=require(_0x0605('0x9'));var io=require('socket.io-emitter')({'host':'localhost','port':0x18eb});var Sequence=function(){};Sequence['prototype'][_0x0605('0xa')]=function(_0x11b8b5){this[_0x0605('0xb')]=this[_0x0605('0xb')]?this[_0x0605('0xb')]['finally'](_0x11b8b5):_0x11b8b5();};function Preview(_0x1882e6){this[_0x0605('0xc')]=new Sequence();this[_0x0605('0xd')]=_0x1882e6[_0x0605('0xe')];this[_0x0605('0xf')]=_0x1882e6[_0x0605('0xf')];this[_0x0605('0x10')]={};this[_0x0605('0x11')]=_0x1882e6[_0x0605('0x11')];this[_0x0605('0x12')]=0x0;ami['on'](_0x0605('0x13'),this[_0x0605('0x14')][_0x0605('0x15')](this));ami['on'](_0x0605('0x16'),this[_0x0605('0x17')][_0x0605('0x15')](this));ami['on'](_0x0605('0x18'),this[_0x0605('0x19')][_0x0605('0x15')](this));ami['on']('dialend',this[_0x0605('0x1a')][_0x0605('0x15')](this));ami['on'](_0x0605('0x1b'),this['syncNewExten']['bind'](this));ami['on'](_0x0605('0x1c'),this[_0x0605('0x1d')][_0x0605('0x15')](this));ami['on'](_0x0605('0x1e'),this[_0x0605('0x1f')][_0x0605('0x15')](this));ami['on'](_0x0605('0x20'),this[_0x0605('0x21')][_0x0605('0x15')](this));this[_0x0605('0x22')](this[_0x0605('0xd')]);}function emit(_0x2fa77e,_0x2e2204,_0x103952){io['to'](_0x2fa77e)['emit'](_0x2e2204,_0x103952);}function emitCampaignPreview(_0x254020){if(_0x254020[_0x0605('0x23')]===_0x0605('0x24')){var _0x443326={'id':_0x254020['id'],'name':_0x254020[_0x0605('0x25')],'strategy':_0x254020[_0x0605('0x26')],'answered':_0x254020[_0x0605('0x27')],'available':_0x254020[_0x0605('0x28')],'loggedIn':_0x254020[_0x0605('0x29')],'pTalking':_0x254020['pTalking'],'sumBillable':_0x254020[_0x0605('0x2a')],'sumDuration':_0x254020['sumDuration'],'sumHoldTime':_0x254020[_0x0605('0x2b')]||0x0,'talking':_0x254020[_0x0605('0x2c')],'total':_0x254020[_0x0605('0x2d')],'type':_0x254020[_0x0605('0x23')],'unmanaged':_0x254020[_0x0605('0x2e')],'waiting':_0x254020[_0x0605('0x2f')],'loggedInDb':_0x254020[_0x0605('0x30')],'dialActive':_0x254020[_0x0605('0x31')],'dialMethod':_0x254020[_0x0605('0x32')],'dialOriginateCallerIdName':_0x254020[_0x0605('0x33')],'dialOriginateCallerIdNumber':_0x254020[_0x0605('0x34')],'dialOriginateTimeout':_0x254020[_0x0605('0x35')],'dialPrefix':_0x254020['dialPrefix'],'outboundAnswerAgiCallsDay':_0x254020[_0x0605('0x36')],'outboundAnswerCallsDay':_0x254020[_0x0605('0x37')],'outboundBlacklistCallsDay':_0x254020['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x254020['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x254020['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x254020[_0x0605('0x38')],'outboundDropCallsDayCallersExit':_0x254020[_0x0605('0x39')],'outboundDropCallsDayTimeout':_0x254020[_0x0605('0x3a')],'outboundNoAnswerCallsDay':_0x254020[_0x0605('0x3b')],'outboundNoSuchCallsDay':_0x254020[_0x0605('0x3c')],'outboundOriginateFailureCallsDay':_0x254020[_0x0605('0x3d')],'outboundReCallsDay':_0x254020['outboundReCallsDay'],'outboundRejectCallsDay':_0x254020[_0x0605('0x3e')],'outboundUnknownCallsDay':_0x254020['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x254020[_0x0605('0x3f')],'predictiveIntervalAvgHoldtime':_0x254020[_0x0605('0x40')],'predictiveIntervalAvgTalktime':_0x254020[_0x0605('0x41')],'predictiveIntervalDroppedCallsCallersExit':_0x254020[_0x0605('0x42')],'predictiveIntervalDroppedCallsTimeout':_0x254020[_0x0605('0x43')],'predictiveIntervalErlangCalls':_0x254020[_0x0605('0x44')],'predictiveIntervalErlangCallsDroppedCalls':_0x254020['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x254020[_0x0605('0x45')],'predictiveIntervalLowerLimit':_0x254020[_0x0605('0x46')],'predictiveIntervalMultiplicativeFactor':_0x254020[_0x0605('0x47')],'predictiveIntervalPauses':_0x254020[_0x0605('0x48')],'predictiveIntervalTotalCalls':_0x254020[_0x0605('0x49')],'message':_0x254020[_0x0605('0x4a')],'originated':_0x254020[_0x0605('0x4b')]};if(_0x254020[_0x0605('0x4c')]){_0x443326[_0x0605('0x4c')]={'id':_0x254020[_0x0605('0x4c')]['id'],'name':_0x254020[_0x0605('0x4c')][_0x0605('0x25')],'active':_0x254020[_0x0605('0x4c')][_0x0605('0x4d')],'callerid':_0x254020[_0x0605('0x4c')][_0x0605('0x4e')]};}if(_0x254020[_0x0605('0x4f')]){_0x443326[_0x0605('0x4f')]={'id':_0x254020[_0x0605('0x4f')]['id'],'name':_0x254020[_0x0605('0x4f')][_0x0605('0x25')]};}var _0x1fbd2c=md5(JSON[_0x0605('0x50')](_0x443326));if(_0x254020[_0x0605('0x5')]!==_0x1fbd2c){_0x254020[_0x0605('0x5')]=_0x1fbd2c;emit(util[_0x0605('0x51')](_0x0605('0x52'),_0x443326['name']),_0x0605('0x53'),_0x443326);}}}function emitVoiceQueueChannelRemove(_0x111298){emit(util['format'](_0x0605('0x52'),_0x111298[_0x0605('0x25')]),'voice_queue_channel:remove',_0x111298);}function notSendMessagesQueue(_0x2aac18){if(_0x2aac18[_0x0605('0x54')]){if(_0x2aac18[_0x0605('0x4b')]===0x0&&_0x2aac18[_0x0605('0x55')]===0x0){_0x2aac18[_0x0605('0x54')]=![];_0x2aac18[_0x0605('0x28')]=0x0;_0x2aac18['paused']=0x0;_0x2aac18['message']=_0x0605('0x56');ut[_0x0605('0x57')](_0x0605('0x58'),_0x2aac18['name']+_0x0605('0x59'));}else{_0x2aac18['message']=_0x0605('0x5a');ut[_0x0605('0x57')](_0x0605('0x58'),_0x2aac18[_0x0605('0x25')]+_0x0605('0x5b'));}emitCampaignPreview(_0x2aac18);}}Preview[_0x0605('0x5c')][_0x0605('0x22')]=function(){var _0x24e5af=this;setInterval(function(){_0x24e5af[_0x0605('0x5d')]();},0x7cf);};Preview[_0x0605('0x5c')]['syncCampaigns']=function(){var _0x3aa844=this['campaignsPreview'];this[_0x0605('0x12')]+=0x1;for(var _0x12e527 in _0x3aa844){if(_0x3aa844[_0x0605('0x5e')](_0x12e527)&&(_0x3aa844[_0x12e527]['dialMethod']==='preview'||_0x3aa844[_0x12e527][_0x0605('0x32')]==='booked')&&_0x3aa844[_0x12e527][_0x0605('0x23')]===_0x0605('0x24')){if(this[_0x0605('0x12')]>0x7){this[_0x0605('0x12')]=0x0;this[_0x0605('0x5f')]();}}if(_0x3aa844[_0x0605('0x5e')](_0x12e527)&&_0x3aa844[_0x12e527][_0x0605('0x32')]===_0x0605('0x6')&&_0x3aa844[_0x12e527][_0x0605('0x23')]===_0x0605('0x24')){if(_0x3aa844[_0x12e527][_0x0605('0x31')]){this[_0x0605('0x60')](_0x3aa844[_0x12e527]);this[_0x0605('0x61')](_0x3aa844[_0x12e527]);}else{notSendMessagesQueue(_0x3aa844[_0x12e527]);}}}};Preview['prototype']['clearZombieChannel']=function(_0x403ad6){var _0x506f6c=this;this[_0x0605('0xc')][_0x0605('0xa')](function(){if(!_['isNil'](_0x506f6c[_0x0605('0x10')][_0x403ad6])){loggerAction[_0x0605('0x62')]('[clearZombieChannels][talking]',_0x403ad6,_0x0605('0x63'),_0x506f6c[_0x0605('0x10')][_0x403ad6]['queue'],_0x0605('0x64'),JSON[_0x0605('0x50')](_0x506f6c['campaignsPreview'][_0x506f6c[_0x0605('0x10')][_0x403ad6]['queue']]['originated']),_0x0605('0x65'),JSON[_0x0605('0x50')](_0x506f6c[_0x0605('0xd')][_0x506f6c[_0x0605('0x10')][_0x403ad6][_0x0605('0x66')]][_0x0605('0x55')]),JSON[_0x0605('0x50')](_0x506f6c[_0x0605('0x10')][_0x403ad6]['dialAnswer']),JSON[_0x0605('0x50')](_[_0x0605('0x67')](_0x506f6c[_0x0605('0x10')][_0x403ad6],['contactId',_0x0605('0x68'),_0x0605('0x69'),_0x0605('0x6a')])));return ami[_0x0605('0x6b')]({'action':_0x0605('0x6c'),'channel':_0x506f6c[_0x0605('0x10')][_0x403ad6][_0x0605('0x6d')]})[_0x0605('0x6e')](function(_0x3cc131){if(_0x3cc131['message']===_0x0605('0x6f')){setTimeout(function(){if(_0x506f6c[_0x0605('0x10')][_0x403ad6]){ut[_0x0605('0x70')](_0x506f6c[_0x0605('0xd')][_0x506f6c[_0x0605('0x10')][_0x403ad6][_0x0605('0x66')]],_0x0605('0x71'));if(_0x506f6c[_0x0605('0x10')][_0x403ad6][_0x0605('0x72')]===!![]){ut[_0x0605('0x73')](_0x506f6c['campaignsPreview'][_0x506f6c['actions'][_0x403ad6]['queue']],_0x0605('0x71'));ut[_0x0605('0x74')](_0x0605('0x75')+_0x403ad6,_0x506f6c[_0x0605('0x10')][_0x403ad6][_0x0605('0x66')]);}ut[_0x0605('0x74')]('[Dialer][checkChannel][Preview]'+_0x403ad6,_0x506f6c[_0x0605('0x10')][_0x403ad6][_0x0605('0x66')]);delete _0x506f6c[_0x0605('0x10')][_0x403ad6];}},0x2328);}});}});};Preview[_0x0605('0x5c')]['clearZombieChannels']=function(){var _0x2c5709=this;loggerAction[_0x0605('0x62')](_0x0605('0x76'),_['size'](this['actions']));for(var _0x3bea0c in this[_0x0605('0x10')]){if(_0x2c5709[_0x0605('0x10')]['hasOwnProperty'](_0x3bea0c)){_0x2c5709['clearZombieChannel'](_0x3bea0c);}}};Preview[_0x0605('0x5c')]['recallMe']=function(_0x31f73a){var _0x283600=this;rpcDb[_0x0605('0x77')](_0x31f73a['id'],ut[_0x0605('0x78')](this[_0x0605('0x11')]))[_0x0605('0x79')](function(_0x13017e){if(!_['isNil'](_0x13017e)){for(var _0xf1f926=0x0;_0xf1f926<_0x13017e['length'];_0xf1f926+=0x1){if(ut[_0x0605('0x7a')](_0x13017e[_0xf1f926]['scheduledat'])<_0x31f73a[_0x0605('0x7b')]*0x3c){_0x283600[_0x0605('0x7c')](_0x13017e[_0xf1f926]['id'])[_0x0605('0x79')](ut[_0x0605('0x7d')]('[RecallMe]'))['catch'](ut[_0x0605('0x7d')](_0x0605('0x7e')));}else{var _0x56ae03=new Action(_0x13017e[_0xf1f926],_0x31f73a);_0x56ae03['starttime']=moment()['format'](_0x0605('0x7f'));_0x31f73a[_0x0605('0x80')]+=0x1;ut[_0x0605('0x81')](_0x56ae03,0x17,_0x0605('0x82'));if(_0x31f73a[_0x0605('0x83')]){rpcDb[_0x0605('0x84')](ut['createBody'](_0x13017e[_0xf1f926]));rpcDb[_0x0605('0x85')](_0x56ae03,_0x0605('0x86'));}else{ut[_0x0605('0x81')](_0x56ae03,0x16,_0x0605('0x87'));rpcDb[_0x0605('0x85')](_0x56ae03,_0x0605('0x88'));rpcDb[_0x0605('0x89')](_0x56ae03,_0x0605('0x88'));}}}}})['catch'](ut['logger2']('[getContactRecallMe]'));};Preview[_0x0605('0x5c')][_0x0605('0x60')]=function(_0xe53cb6){_0xe53cb6['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0xe53cb6[_0x0605('0x29')])){_0xe53cb6[_0x0605('0x4a')]=_0x0605('0x8a');}else if(!ut[_0x0605('0x8b')](_0xe53cb6[_0x0605('0x31')])){_0xe53cb6[_0x0605('0x4a')]=_0x0605('0x56');}else if(!this[_0x0605('0x8c')](_0xe53cb6[_0x0605('0x4c')])){if(!this[_0x0605('0x8c')](_0xe53cb6[_0x0605('0x8d')])){_0xe53cb6[_0x0605('0x4a')]='TRUNK_IS_NOT_REACHABLE';}else{_0xe53cb6[_0x0605('0x4a')]=_0x0605('0x8e');}}else{_0xe53cb6[_0x0605('0x4a')]=_0x0605('0x8e');}emitCampaignPreview(_0xe53cb6);};Preview[_0x0605('0x5c')][_0x0605('0x8f')]=function(_0x5e61a6,_0x2533a1,_0x4b7917){var _0x5f2063=this;var _0x3d2414=this[_0x0605('0x10')][_0x2533a1];var _0x855868=this[_0x0605('0xd')][_0x3d2414[_0x0605('0x66')]];var _0x13e6f4;if(_0x855868){switch(_0x4b7917){case'1':_0x855868[_0x0605('0x3c')]+=0x1;_0x3d2414[_0x0605('0x90')]=ut[_0x0605('0x91')](_0x3d2414);ut[_0x0605('0x81')](_0x3d2414,0x0,'NoSuchNumber');rpcDb['createCustomerHistory'](_0x3d2414,'[callProgressDetectingCustomer][logNoSuch]');if(ut['totalGlobal'](_0x3d2414)>=_0x855868['dialGlobalMaxRetry']){_0x13e6f4=ut[_0x0605('0x92')](_0x3d2414,0xf,_0x0605('0x93'));rpcDb[_0x0605('0x89')](_0x13e6f4,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x0605('0x89')](_0x3d2414,_0x0605('0x94'));}delete this[_0x0605('0x10')][_0x5e61a6[_0x0605('0x95')]];break;case _0x0605('0x96'):var _0x249ab2=moment()['format'](_0x0605('0x7f'));_0x3d2414[_0x0605('0x97')]=_0x249ab2;_0x3d2414[_0x0605('0x98')]=_0x249ab2;_0x3d2414['dialAnswer']=!![];_0x855868['pTalking']+=0x1;logger['info'](_0x0605('0x99'),_0x3d2414[_0x0605('0x9a')],_0x0605('0x9b'),_0x855868[_0x0605('0x25')],'pTalking:\x20',_0x855868['pTalking']);ami[_0x0605('0x9c')](_0x0605('0x9d'),ut['buildObj'](_0x3d2414,_0x0605('0x9e')));if(_0x855868[_0x0605('0x9f')]){ami[_0x0605('0x9c')](_0x0605('0xa0'),ut[_0x0605('0xa1')](_0x3d2414));}break;case'16':ami[_0x0605('0x9c')](_0x0605('0xa2'),ut[_0x0605('0xa3')](_0x3d2414,_0x0605('0xa4')));emitVoiceQueueChannelRemove(ut[_0x0605('0xa3')](_0x3d2414,_0x0605('0xa4')));_0x855868[_0x0605('0x37')]+=0x1;_0x855868[_0x0605('0x2d')]+=0x1;_0x855868['answered']+=0x1;ut['decrementTalkink'](_0x855868,_0x0605('0xa5'));_0x3d2414[_0x0605('0x90')]=ut[_0x0605('0x91')](_0x3d2414);ut['logCustomer'](_0x3d2414,0x4,'Answer');rpcDb[_0x0605('0x85')](_0x3d2414,'[callProgressDetectingCustomer][logAnswer]');rpcDb['createCustomerFinal'](_0x3d2414,_0x0605('0xa6'));rpcDb[_0x0605('0xa7')](_0x3d2414);_0x855868[_0x0605('0xa8')]+=_0x3d2414['talktime'];_0x855868['sumBillable']+=_0x3d2414['talktime'];logger[_0x0605('0x62')]('[syncHangup][talking][decrement]',_0x3d2414[_0x0605('0x9a')],_0x0605('0x9b'),_0x855868[_0x0605('0x25')],_0x0605('0x65'),_0x855868[_0x0605('0x55')]);delete this[_0x0605('0x10')][_0x5e61a6[_0x0605('0x95')]];break;case _0x0605('0xa9'):_0x855868['outboundBusyCallsDay']+=0x1;_0x3d2414['countbusyretry']+=0x1;_0x3d2414[_0x0605('0x90')]=ut[_0x0605('0x91')](_0x3d2414);ut['logCustomer'](_0x3d2414,0x5,_0x0605('0xaa'));rpcDb['createCustomerHistory'](_0x3d2414,_0x0605('0xab'));if(ut[_0x0605('0x91')](_0x3d2414)>=_0x855868['dialGlobalMaxRetry']){_0x13e6f4=ut[_0x0605('0x92')](_0x3d2414,0xf,'Global');rpcDb[_0x0605('0x89')](_0x13e6f4,_0x0605('0xac'));}else{if(_0x3d2414[_0x0605('0xad')]>=_0x855868[_0x0605('0xae')]){rpcDb['createCustomerFinal'](_0x3d2414,_0x0605('0xab'));}else{rpcDb[_0x0605('0xaf')](ut['scheduledAt'](_0x3d2414,_0x0605('0xad'),_0x855868[_0x0605('0xb0')]),_0x3d2414[_0x0605('0xb1')],_0x3d2414[_0x0605('0xb2')]);}}break;case _0x0605('0xb3'):_0x855868[_0x0605('0x3b')]+=0x1;_0x3d2414['countnoanswerretry']+=0x1;_0x3d2414['countglobal']=ut[_0x0605('0x91')](_0x3d2414);ut[_0x0605('0x81')](_0x3d2414,0x3,_0x0605('0xb4'));rpcDb[_0x0605('0x85')](_0x3d2414,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x0605('0x91')](_0x3d2414)>=_0x855868[_0x0605('0xb5')]){_0x13e6f4=ut[_0x0605('0x92')](_0x3d2414,0xf,_0x0605('0x93'));rpcDb[_0x0605('0x89')](_0x13e6f4,_0x0605('0xb6'));}else{if(_0x3d2414[_0x0605('0xb7')]>=_0x855868['dialNoAnswerMaxRetry']){rpcDb[_0x0605('0x89')](_0x3d2414,_0x0605('0xb8'));}else{rpcDb[_0x0605('0xaf')](ut[_0x0605('0xb9')](_0x3d2414,'countnoanswerretry',_0x855868['dialNoAnswerRetryFrequency']),_0x3d2414[_0x0605('0xb1')],_0x3d2414[_0x0605('0xb2')]);}}break;case'CONGESTION':_0x855868[_0x0605('0xba')]+=0x1;_0x3d2414['countcongestionretry']+=0x1;_0x3d2414['countglobal']=ut[_0x0605('0x91')](_0x3d2414);ut[_0x0605('0x81')](_0x3d2414,0x8,_0x0605('0xbb'));rpcDb['createCustomerHistory'](_0x3d2414,_0x0605('0xbc'));if(ut[_0x0605('0x91')](_0x3d2414)>=_0x855868[_0x0605('0xb5')]){_0x13e6f4=ut[_0x0605('0x92')](_0x3d2414,0xf,_0x0605('0x93'));rpcDb[_0x0605('0x89')](_0x13e6f4,_0x0605('0xbd'));}else{if(_0x3d2414[_0x0605('0xbe')]>=_0x855868[_0x0605('0xbf')]){rpcDb[_0x0605('0x89')](_0x3d2414,_0x0605('0xbc'));}else{rpcDb[_0x0605('0xaf')](ut[_0x0605('0xb9')](_0x3d2414,_0x0605('0xbe'),_0x855868[_0x0605('0xb0')]),_0x3d2414[_0x0605('0xb1')],_0x3d2414['activeContact']);}}break;case _0x0605('0xc0'):_0x855868[_0x0605('0x3e')]+=0x1;_0x3d2414[_0x0605('0x90')]=ut[_0x0605('0x91')](_0x3d2414);ut[_0x0605('0x81')](_0x3d2414,0x14,'AgentReject');rpcDb[_0x0605('0x85')](_0x3d2414,_0x0605('0xc1'));if(_0x3d2414[_0x0605('0xb1')]){rpcDb['unlockContact'](_0x3d2414[_0x0605('0xc2')]);}if(_0x3d2414['activeContact']){rpcDb[_0x0605('0xc3')](_0x3d2414['idContact']);}break;default:if(_0x3d2414['dialAnswer']){ut[_0x0605('0x73')](_0x855868,'[default]');ut['loggerError'](_0x0605('0xc4')+_0x855868[_0x0605('0x25')],_0x5e61a6);}_0x855868[_0x0605('0xc5')]+=0x1;_0x3d2414[_0x0605('0x90')]=ut[_0x0605('0x91')](_0x3d2414);ut[_0x0605('0x81')](_0x3d2414,0xc,_0x5e61a6[_0x0605('0xc6')]||_0x5e61a6['dialstatus']);rpcDb[_0x0605('0x85')](_0x3d2414,_0x0605('0xc7'));if(ut[_0x0605('0x91')](_0x3d2414)>=_0x855868['dialGlobalMaxRetry']){_0x13e6f4=ut[_0x0605('0x92')](_0x3d2414,0xf,'Global');rpcDb[_0x0605('0x89')](_0x13e6f4,_0x0605('0xc8'));}else{rpcDb['createCustomerFinal'](_0x3d2414,_0x0605('0xc8'));}delete this['actions'][_0x5e61a6['linkedid']];}if(!(_0x3d2414[_0x0605('0x72')]&&_0x4b7917==='16')){ut[_0x0605('0x70')](_0x855868,_0x0605('0xc9'));logger['info'](_0x0605('0xca'),_0x3d2414[_0x0605('0x9a')],_0x0605('0x9b'),_0x855868[_0x0605('0x25')],_0x0605('0x64'),_0x855868[_0x0605('0x4b')]);}if(_0x4b7917!==_0x0605('0x96')){delete this[_0x0605('0x10')][_0x5e61a6[_0x0605('0x95')]];delete this[_0x0605('0x10')][_0x5e61a6['destlinkedid']];}}};Preview[_0x0605('0x5c')][_0x0605('0xcb')]=function(_0xb75eda,_0x23a6ef,_0x42c1fa){if(_['isUndefined'](_0x23a6ef)&&_0x0605('0xcc')!==typeof _0x23a6ef){return;}if(_['isUndefined'](_0x42c1fa)&&_0x0605('0xcc')!==typeof _0x42c1fa){return;}switch(_0x42c1fa[_0x0605('0xcd')]){case'0':ut['logAgent'](_0xb75eda,0x0,_0x0605('0xce'));rpcDb[_0x0605('0xcf')](_0xb75eda,_0x0605('0xd0'));break;case'3':ut[_0x0605('0xd1')](_0xb75eda,0x3,_0x0605('0xb4'));rpcDb[_0x0605('0xcf')](_0xb75eda,_0x0605('0xd2'));break;case'5':ut[_0x0605('0xd1')](_0xb75eda,0x5,'Busy');rpcDb[_0x0605('0xcf')](_0xb75eda,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x0605('0xd1')](_0xb75eda,0x8,_0x0605('0xbb'));rpcDb[_0x0605('0xcf')](_0xb75eda,_0x0605('0xd3'));break;case'22':ut[_0x0605('0xd1')](_0xb75eda,0x16,'AnswerAGI');rpcDb[_0x0605('0xcf')](_0xb75eda,_0x0605('0xd4'));break;default:ut[_0x0605('0xd1')](_0xb75eda,0xc,_0x42c1fa[_0x0605('0xcd')]);rpcDb[_0x0605('0xcf')](_0xb75eda,_0x0605('0xd3'));}ut['updateOriginated'](_0x23a6ef,_0x0605('0xd5'));logger[_0x0605('0x62')](_0x0605('0xd6'),_0xb75eda[_0x0605('0x9a')],_0x0605('0x9b'),_0x23a6ef[_0x0605('0x25')],_0x0605('0x64'),_0x23a6ef['originated']);delete this[_0x0605('0x10')][_0xb75eda['uniqueid']];};Preview[_0x0605('0x5c')][_0x0605('0xd7')]=function(_0x5adad8,_0x3dbf1e,_0x200963,_0x43cc45,_0x26c006){var _0x31f09d=this;return new BPromise(function(_0x9d30a1,_0x59bc5d){if(_['isNil'](_0x3dbf1e)||_[_0x0605('0xd8')](_0x3dbf1e['Contact'])||_[_0x0605('0xd8')](_0x3dbf1e[_0x0605('0xd9')][_0x0605('0xda')])||_[_0x0605('0xd8')](_0x3dbf1e[_0x0605('0x69')])){_0x59bc5d(ut[_0x0605('0x4a')](_0x0605('0xdb'),_0x43cc45,_0x26c006));return;}var _0x38f81f=uuid['v4']();var _0x3f89a1=_0x31f09d[_0x0605('0xd')][_0x3dbf1e[_0x0605('0x63')][_0x0605('0x25')]];var _0x3f34bc=_0x200963?_0x31f09d[_0x0605('0x11')][_0x200963]['id']:undefined;_0x31f09d[_0x0605('0x10')][_0x38f81f]=new Action(_0x3dbf1e,_0x3f89a1,_0x38f81f,_0x200963,_0x3f34bc);var _0x37c637=_0x31f09d[_0x0605('0x10')][_0x38f81f];_0x37c637[_0x0605('0xb1')]=_0x43cc45;_0x37c637[_0x0605('0xb2')]=_0x26c006;_0x37c637['lookAgent']=_0x200963;if(_[_0x0605('0xdc')](_0x5adad8)){_0x31f09d['execCall'](_0x37c637,_0x3f89a1,_0x3dbf1e,_0x200963)[_0x0605('0x79')](function(_0x6ea107){logger['info'](_0x0605('0xdd'),_0x0605('0xde')+_0x37c637[_0x0605('0x66')]+_0x0605('0xdf')+_0x37c637[_0x0605('0xc2')],JSON[_0x0605('0x50')](_0x6ea107));ami[_0x0605('0x9c')]('custom:agentcalled',ut[_0x0605('0xa3')](_0x37c637,_0x0605('0xe0')));_0x9d30a1(ut['message']('Calling'));})[_0x0605('0x6e')](function(_0x4a305b){ut[_0x0605('0x57')]('[Preview][execCall][failure]',_0x4a305b);_0x59bc5d(ut[_0x0605('0x4a')](_0x0605('0xe1'),_0x43cc45,_0x26c006));});}else{_0x3f89a1['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x37c637);rpcDb['createHistory'](_0x37c637,_0x0605('0xe2'));delete _0x31f09d['actions'][_0x38f81f];_0x59bc5d(ut[_0x0605('0x4a')]('Contact\x20in\x20black\x20List',_0x43cc45,_0x26c006));}});};Preview[_0x0605('0x5c')][_0x0605('0x8c')]=function(_0x4076e9){return!_[_0x0605('0xd8')](_0x4076e9)&&!_['isNil'](_0x4076e9[_0x0605('0x25')])&&!_[_0x0605('0xd8')](_0x4076e9[_0x0605('0x4d')])&&_0x4076e9['active']&&!_['isNil'](this['trunks'][util['format'](_0x0605('0xe3'),_0x4076e9[_0x0605('0x25')])])&&!_[_0x0605('0xd8')](this[_0x0605('0xf')][util[_0x0605('0x51')](_0x0605('0xe3'),_0x4076e9[_0x0605('0x25')])][_0x0605('0x6c')])&&(this[_0x0605('0xf')][util['format'](_0x0605('0xe3'),_0x4076e9[_0x0605('0x25')])][_0x0605('0x6c')]===_0x0605('0xe4')||this['trunks'][util[_0x0605('0x51')](_0x0605('0xe3'),_0x4076e9['name'])][_0x0605('0x6c')]===_0x0605('0xe5'));};Preview[_0x0605('0x5c')]['run']=function(_0xb2f166,_0x3932f8){var _0x2385e6=this;return new BPromise(function(_0x875089,_0x17e686){_0x2385e6[_0x0605('0xe6')](_0xb2f166,_0x3932f8)[_0x0605('0x79')](function(_0x35f7d2){_0x875089(_[_0x0605('0x67')](_0x35f7d2,[_0x0605('0x4a')]));})[_0x0605('0x6e')](function(_0x4e6f02){if(_0x4e6f02['unlock']){rpcDb[_0x0605('0xe7')](_0xb2f166);}if(_0x4e6f02[_0x0605('0x4d')]){rpcDb[_0x0605('0xc3')](_0xb2f166);}_0x17e686(_[_0x0605('0x67')](_0x4e6f02,[_0x0605('0x4a')]));});});};Preview[_0x0605('0x5c')][_0x0605('0xe6')]=function(_0x4b3f17,_0x5aed0f){var _0x436734=this;return new BPromise(function(_0x5acac2,_0x1c149d){var _0x549338,_0x23133a;rpcDb['getContactPreview'](_0x4b3f17)[_0x0605('0x79')](function(_0x3b79ec){if(!_[_0x0605('0xd8')](_0x3b79ec[0x0])){_0x23133a=_0x3b79ec[0x0][_0x0605('0xe8')]?![]:!![];_0x549338=_0x3b79ec[0x0][_0x0605('0xe8')]?!![]:![];_0x549338=_0x5aed0f?!![]:_0x549338;}var _0x45895d=_0x436734[_0x0605('0xe9')](_0x3b79ec);if(_0x45895d[_0x0605('0xea')]){rpcDb[_0x0605('0xeb')](_['pick'](_0x3b79ec[0x0],['VoiceQueueId',_0x0605('0xec')]))[_0x0605('0x79')](function(_0x4ce270){_0x436734[_0x0605('0xd7')](_0x4ce270,_0x3b79ec[0x0],_0x5aed0f,_0x23133a,_0x549338)['then'](function(_0x4aa8d3){_0x5acac2(_0x4aa8d3);})[_0x0605('0x6e')](function(_0x16a71f){_0x1c149d(_0x16a71f);});})[_0x0605('0x6e')](function(_0x38f54b){ut[_0x0605('0x57')](_0x0605('0xed'),_0x38f54b);_0x1c149d(ut[_0x0605('0x4a')](_0x0605('0xee'),_0x23133a,_0x549338));});}else{_0x1c149d(ut['message'](_0x45895d[_0x0605('0x4a')],_0x23133a,_0x549338));}})['catch'](function(_0x3d6240){ut[_0x0605('0x57')](_0x0605('0xef'),_0x3d6240);_0x1c149d(ut[_0x0605('0x4a')](_0x0605('0xee'),![],!![]));});});};Preview[_0x0605('0x5c')][_0x0605('0xe9')]=function(_0x3b1655){if(_['isNil'](_0x3b1655)||_[_0x0605('0xdc')](_0x3b1655)||!_[_0x0605('0xd8')](_0x3b1655[0x0]['Agent'])&&_[_0x0605('0xd8')](_0x3b1655[0x0]['Agent'][_0x0605('0x25')])){ut[_0x0605('0x57')](_0x0605('0xf0'),_0x3b1655);return{'isValid':![],'message':_0x0605('0xf1')};}var _0x185be7=this['campaignsPreview'][_0x3b1655[0x0][_0x0605('0x63')][_0x0605('0x25')]];_0x185be7[_0x0605('0x4a')]='ACTIVE';if(_[_0x0605('0xd8')](_0x185be7)){ut['logger'](_0x0605('0xf2'),_0x185be7);return{'isValid':![],'message':_0x0605('0xf3')};}if(!this[_0x0605('0x8c')](_0x185be7[_0x0605('0x4c')])){ut[_0x0605('0x57')](_0x0605('0xf4'),_0x0605('0xf5')+_0x185be7[_0x0605('0x25')]+_0x0605('0xf6'));if(!this[_0x0605('0x8c')](_0x185be7[_0x0605('0x8d')])){ut[_0x0605('0x57')](_0x0605('0xf4'),_0x185be7[_0x0605('0x25')]+_0x0605('0xf7'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x0605('0x8b')](_0x185be7['dialActive'])){ut[_0x0605('0x57')](_0x0605('0xf8'),_0x185be7[_0x0605('0x25')]+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x185be7['name']+_0x0605('0xf9')};}return{'isValid':!![],'message':_0x0605('0xfa')};};Preview['prototype'][_0x0605('0xfb')]=function(_0x130302,_0x40b677,_0x1d7502,_0x447325){var _0x1f5f70=this;return new BPromise(function(_0xa50416,_0x470c1a){var _0x2e263f=_0x130302[_0x0605('0x9a')];var _0x2f4aea=_0x1f5f70['isTrunkReachable'](_0x40b677['Trunk'])?util['format']('SIP/%s/%s%s',_0x40b677[_0x0605('0x4c')][_0x0605('0x25')],_[_0x0605('0xd8')](_0x40b677[_0x0605('0xfc')])?'':_0x40b677[_0x0605('0xfc')][_0x0605('0xfd')]()||'',_0x40b677[_0x0605('0xfe')]>0x0?_0x1d7502['Contact'][_0x0605('0xda')]['substring'](_0x40b677['dialCutDigit']):_0x1d7502[_0x0605('0xd9')][_0x0605('0xda')]):util[_0x0605('0x51')](_0x0605('0xff'),_[_0x0605('0xd8')](_0x40b677[_0x0605('0x8d')])?_0x40b677[_0x0605('0x4c')][_0x0605('0x25')]:_0x40b677[_0x0605('0x8d')][_0x0605('0x25')],_[_0x0605('0xd8')](_0x40b677[_0x0605('0xfc')])?'':_0x40b677[_0x0605('0xfc')][_0x0605('0xfd')]()||'',_0x40b677[_0x0605('0xfe')]>0x0?_0x1d7502[_0x0605('0xd9')][_0x0605('0xda')][_0x0605('0x100')](_0x40b677[_0x0605('0xfe')]):_0x1d7502['Contact']['phone']);var _0x7be3d1=_0x1f5f70['isTrunkReachable'](_0x40b677[_0x0605('0x4c')])?ut['getCallerId'](_0x40b677['Trunk']['callerid'],_0x40b677['dialOriginateCallerIdName'],_0x40b677[_0x0605('0x101')]>0x0?ut[_0x0605('0x102')](_0x40b677[_0x0605('0x34')],_0x40b677['dialRandomLastDigitCallerIdNumber']):_0x40b677['dialOriginateCallerIdNumber']):ut['getCallerId'](_['isNil'](_0x40b677[_0x0605('0x8d')])?_0x40b677[_0x0605('0x4c')][_0x0605('0x4e')]:_0x40b677[_0x0605('0x8d')]['callerid'],_0x40b677[_0x0605('0x33')],_0x40b677[_0x0605('0x101')]>0x0?ut[_0x0605('0x102')](_0x40b677[_0x0605('0x34')],_0x40b677[_0x0605('0x101')]):_0x40b677[_0x0605('0x34')]);if(_0x7be3d1){_0x130302[_0x0605('0x103')]=ut[_0x0605('0x104')](_0x7be3d1);_0x130302[_0x0605('0x105')]=ut[_0x0605('0x106')](_0x7be3d1);}var _0xb970c6=ut[_0x0605('0x107')](_0x40b677,_0x1d7502,_0x2f4aea,_0x7be3d1,_0x2e263f,_0x130302);_[_0x0605('0x108')](_0x130302,ut[_0x0605('0x109')](_0xb970c6));_0x130302[_0x0605('0x10a')]=moment()[_0x0605('0x51')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x0605('0x6b')](ut[_0x0605('0x10b')](_0x130302,_0x40b677,_0xb970c6,_0x130302['activeContact'],_0x447325))[_0x0605('0x79')](function(_0x50e960){_0x40b677[_0x0605('0x4b')]+=0x1;logger[_0x0605('0x62')]('[originated][increment]',_0x2e263f,'\x20Queue',_0x40b677[_0x0605('0x25')],_0x0605('0x64'),_0x40b677[_0x0605('0x4b')]);_0xa50416(_0x50e960);})['catch'](function(_0x5860d7){ut[_0x0605('0xd1')](_0x130302,0xe,_0x0605('0x10c'));rpcDb['createAgentHistory'](_0x130302,_0x0605('0x10d'));_0x470c1a(_0x5860d7);});});};Preview[_0x0605('0x5c')][_0x0605('0x10e')]=function(_0x447eb6){if(this[_0x0605('0x10')][_0x447eb6[_0x0605('0x95')]]){this[_0x0605('0x10')][_0x447eb6[_0x0605('0x95')]][_0x0605('0x6d')]=_0x447eb6[_0x0605('0x6d')];}};Preview[_0x0605('0x5c')][_0x0605('0x14')]=function(_0x1b9f20){var _0x35e6b3=this;var _0x225726=this[_0x0605('0x10')][_0x1b9f20[_0x0605('0x10f')]];if(_0x225726){if(_0x225726['lookAgent']&&this[_0x0605('0x11')][_0x225726[_0x0605('0x110')]]){ut[_0x0605('0x111')](_0x225726,this[_0x0605('0x11')][_0x225726[_0x0605('0x110')]][_0x0605('0x25')],this[_0x0605('0x11')][_0x225726[_0x0605('0x110')]]['id']);}var _0x2a513a=_[_0x0605('0x112')](_0x225726);_0x2a513a[_0x0605('0x97')]=moment()[_0x0605('0x51')](_0x0605('0x7f'));var _0xafa39=_0x35e6b3[_0x0605('0xd')][_0x225726[_0x0605('0x66')]];if(ut[_0x0605('0x113')](_0x1b9f20[_0x0605('0x114')])){if(_0x225726[_0x0605('0xb1')]){rpcDb[_0x0605('0xe7')](_0x225726[_0x0605('0xc2')]);}if(_0x225726[_0x0605('0xb2')]){rpcDb[_0x0605('0xc3')](_0x225726[_0x0605('0xc2')]);}ami[_0x0605('0x9c')](_0x0605('0x115'),ut[_0x0605('0xa3')](_0x225726,'rejected'));this['callProgressDetectingAgent'](_0x2a513a,_0xafa39,_0x1b9f20);}else{_0x225726[_0x0605('0x10a')]=moment()[_0x0605('0x51')](_0x0605('0x7f'));ut[_0x0605('0xd1')](_0x2a513a,0x4,_0x0605('0x116'));rpcDb['createAgentHistory'](_0x2a513a,_0x0605('0x117'));}}};Preview[_0x0605('0x5c')][_0x0605('0x17')]=function(_0x38cd10){var _0x319943=this;var _0x3721df=this[_0x0605('0x10')][_0x38cd10[_0x0605('0x95')]];var _0x518b30;if(_0x3721df){_0x518b30=this[_0x0605('0xd')][_0x3721df[_0x0605('0x66')]];logger[_0x0605('0x62')](_0x0605('0x118'),_0x38cd10[_0x0605('0x95')],'\x20Queue',_0x518b30[_0x0605('0x25')],_0x0605('0x65'),_0x518b30['pTalking']);}if(this[_0x0605('0x10')][_0x38cd10['linkedid']]&&_0x38cd10[_0x0605('0x95')]!==_0x38cd10[_0x0605('0x9a')]){if(_0x38cd10[_0x0605('0x119')]==='16'&&this['actions'][_0x38cd10[_0x0605('0x95')]][_0x0605('0x72')]){this['callProgressDetectingCustomer'](_0x38cd10,_0x38cd10[_0x0605('0x95')],_0x38cd10[_0x0605('0x119')]);}else if(this[_0x0605('0x10')][_0x38cd10[_0x0605('0x95')]][_0x0605('0x72')]){logger[_0x0605('0x62')](_0x0605('0x11a'),_0x38cd10[_0x0605('0x95')],_0x38cd10[_0x0605('0x119')],_0x0605('0x9b'),_0x518b30[_0x0605('0x25')],_0x0605('0x65'),_0x518b30[_0x0605('0x55')]);this['callProgressDetectingCustomer'](_0x38cd10,_0x38cd10[_0x0605('0x95')],_0x38cd10[_0x0605('0x119')]);}}else if(_0x3721df&&_['isNil'](_0x3721df['statedesc'])&&_0x518b30['dialQueueProject']&&_0x38cd10[_0x0605('0x95')]===_0x38cd10['uniqueid']&&_[_0x0605('0xd8')](_0x38cd10[_0x0605('0xcd')])&&_0x38cd10[_0x0605('0x119')]==='16'&&_0x38cd10[_0x0605('0x11b')]==='6'&&_[_0x0605('0x11c')](_0x3721df[_0x0605('0x11d')])){if(_0x3721df[_0x0605('0xb1')]){rpcDb['unlockContact'](_0x3721df[_0x0605('0xc2')]);}if(_0x3721df[_0x0605('0xb2')]){rpcDb['disableContact'](_0x3721df['idContact']);}_0x38cd10[_0x0605('0xcd')]='22';this[_0x0605('0xcb')](_0x3721df,_0x518b30,_0x38cd10);}else if(_0x3721df&&_0x3721df[_0x0605('0x11d')]){if(_0x38cd10[_0x0605('0x119')]==='16'&&this[_0x0605('0x10')][_0x38cd10[_0x0605('0x95')]]['dialAnswer']){logger[_0x0605('0x62')]('[syncHangup][talking][transfer]',_0x38cd10[_0x0605('0x95')],_0x38cd10[_0x0605('0x119')],_0x0605('0x9b'),_0x518b30[_0x0605('0x25')],_0x0605('0x65'),_0x518b30[_0x0605('0x55')]);this[_0x0605('0x8f')](_0x38cd10,_0x38cd10[_0x0605('0x95')],_0x38cd10[_0x0605('0x119')]);}else if(this[_0x0605('0x10')][_0x38cd10[_0x0605('0x95')]][_0x0605('0x72')]){logger[_0x0605('0x62')]('[syncHangup][talking][cause]',_0x38cd10[_0x0605('0x95')],_0x38cd10[_0x0605('0x119')],_0x0605('0x9b'),_0x518b30[_0x0605('0x25')],_0x0605('0x65'),_0x518b30['pTalking']);this[_0x0605('0x8f')](_0x38cd10,_0x38cd10[_0x0605('0x95')],_0x38cd10[_0x0605('0x119')]);}}};Preview[_0x0605('0x5c')][_0x0605('0x1a')]=function(_0x30b8c9){if(this[_0x0605('0x10')][_0x30b8c9[_0x0605('0x11e')]]&&_0x30b8c9[_0x0605('0x11e')]!==_0x30b8c9['destuniqueid']){this[_0x0605('0x8f')](_0x30b8c9,_0x30b8c9[_0x0605('0x11e')],_0x30b8c9[_0x0605('0x11f')]);}};Preview['prototype'][_0x0605('0x19')]=function(_0x33d7d6){if(this[_0x0605('0x10')][_0x33d7d6['linkedid']]&&_0x33d7d6[_0x0605('0x95')]!==_0x33d7d6[_0x0605('0x9a')]&&!this[_0x0605('0x10')][_0x33d7d6[_0x0605('0x95')]][_0x0605('0x72')]){if(_0x33d7d6[_0x0605('0x119')]==='1'){this[_0x0605('0x8f')](_0x33d7d6,_0x33d7d6['linkedid'],_0x33d7d6[_0x0605('0x119')]);}}};Preview['prototype'][_0x0605('0x120')]=function(_0x47d7d8,_0x31f5e0,_0x5ba1ff){if(this[_0x0605('0x10')][_0x47d7d8]){if(_[_0x0605('0xd8')](this[_0x0605('0x10')][_0x47d7d8][_0x0605('0x121')])){this[_0x0605('0x10')][_0x47d7d8][_0x0605('0x121')]={};}this[_0x0605('0x10')][_0x47d7d8][_0x0605('0x121')][_0x31f5e0]=_0x5ba1ff;}};Preview[_0x0605('0x5c')][_0x0605('0x1d')]=function(_0x286846){try{if(!_[_0x0605('0xd8')](_0x286846)){if(ut[_0x0605('0x122')](_[_0x0605('0x123')](_0x286846[_0x0605('0x124')])[0x0])){this['addVariable'](_0x286846[_0x0605('0x9a')],_[_0x0605('0x123')](_0x286846['variable'])[0x0],_0x286846['value']);}}}catch(_0x36ef36){logger[_0x0605('0x125')]('[syncVarSet][Preview]',util[_0x0605('0x126')](_0x36ef36,{'showHidden':![],'depth':null}));}};Preview[_0x0605('0x5c')][_0x0605('0x1f')]=function(_0x5ddebf){if(_0x5ddebf){if(this[_0x0605('0x10')][_0x5ddebf[_0x0605('0x127')]]){this[_0x0605('0x10')][_0x5ddebf['transfertargetlinkedid']][_0x0605('0x11d')]=!![];}}};Preview[_0x0605('0x5c')][_0x0605('0x21')]=function(_0xd1dabe){if(_0xd1dabe){if(this[_0x0605('0x10')][_0xd1dabe[_0x0605('0x128')]]){this[_0x0605('0x10')][_0xd1dabe['transfererlinkedid']][_0x0605('0x11d')]=!![];}}};module['exports']=Preview;
\ No newline at end of file
+var _0x40bd=['[getContactRecallMe]','setMessage','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','cloneAction','createCustomerFinal','ANSWER','answertime','\x20Queue','pTalking:\x20','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','complete','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','[syncHangup][talking][decrement]','uniqueid','linkedid','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','activeContact','disableContact','[default]','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','destlinkedid','callProgressDetectingAgent','isUndefined','object','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','phone','Contact\x20is\x20undefined','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','reachable','execRun','pick','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','Is\x20Valid','trim','dialCutDigit','Contact','substring','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','getCallerId','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','lookAgent','logLookAgent','responsetime','isFailure','response','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','keys','variable','error','[syncVarSet][Preview]','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','lodash','moment','md5','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./util/util','socket.io-emitter','localhost','enqueue','tail','sequence','campaignsPreview','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','emit','type','outbound','strategy','answered','pTalking','sumDuration','sumHoldTime','total','unmanaged','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','originated','Trunk','name','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','available','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','prototype','loopCampaigns','syncCampaigns','clockClearZombieChannels','hasOwnProperty','dialMethod','booked','clearZombieChannels','recallMe','isNil','[clearZombieChannels][talking]','Queue','queue','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','info','size','clearZombieChannel','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','run','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','logger2'];(function(_0x454f13,_0x41ce66){var _0x136b9b=function(_0x2d6202){while(--_0x2d6202){_0x454f13['push'](_0x454f13['shift']());}};_0x136b9b(++_0x41ce66);}(_0x40bd,0x1d2));var _0xd40b=function(_0x50aef5,_0x2276fa){_0x50aef5=_0x50aef5-0x0;var _0x161472=_0x40bd[_0x50aef5];return _0x161472;};'use strict';var util=require(_0xd40b('0x0'));var _=require(_0xd40b('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0xd40b('0x2'));var md5=require(_0xd40b('0x3'));var logger=require(_0xd40b('0x4'))(_0xd40b('0x5'));var loggerAction=require(_0xd40b('0x4'))(_0xd40b('0x6'));var ami=require(_0xd40b('0x7'));var rpcDb=require(_0xd40b('0x8'));var Action=require('./action');var ut=require(_0xd40b('0x9'));var io=require(_0xd40b('0xa'))({'host':_0xd40b('0xb'),'port':0x18eb});var Sequence=function(){};Sequence['prototype'][_0xd40b('0xc')]=function(_0x5f0ff5){this[_0xd40b('0xd')]=this['tail']?this[_0xd40b('0xd')]['finally'](_0x5f0ff5):_0x5f0ff5();};function Preview(_0x23cda8){this[_0xd40b('0xe')]=new Sequence();this[_0xd40b('0xf')]=_0x23cda8['voiceQueues'];this[_0xd40b('0x10')]=_0x23cda8['trunks'];this[_0xd40b('0x11')]={};this[_0xd40b('0x12')]=_0x23cda8[_0xd40b('0x12')];this['clockClearZombieChannels']=0x0;ami['on'](_0xd40b('0x13'),this[_0xd40b('0x14')][_0xd40b('0x15')](this));ami['on'](_0xd40b('0x16'),this[_0xd40b('0x17')][_0xd40b('0x15')](this));ami['on'](_0xd40b('0x18'),this[_0xd40b('0x19')][_0xd40b('0x15')](this));ami['on'](_0xd40b('0x1a'),this[_0xd40b('0x1b')]['bind'](this));ami['on'](_0xd40b('0x1c'),this['syncNewExten'][_0xd40b('0x15')](this));ami['on'](_0xd40b('0x1d'),this[_0xd40b('0x1e')]['bind'](this));ami['on']('attendedtransfer',this[_0xd40b('0x1f')][_0xd40b('0x15')](this));ami['on'](_0xd40b('0x20'),this['syncBlindTransfer'][_0xd40b('0x15')](this));this['loopCampaigns'](this[_0xd40b('0xf')]);}function emit(_0x186bce,_0x5cfb91,_0x414f43){io['to'](_0x186bce)[_0xd40b('0x21')](_0x5cfb91,_0x414f43);}function emitCampaignPreview(_0x26bab7){if(_0x26bab7[_0xd40b('0x22')]===_0xd40b('0x23')){var _0x499848={'id':_0x26bab7['id'],'name':_0x26bab7['name'],'strategy':_0x26bab7[_0xd40b('0x24')],'answered':_0x26bab7[_0xd40b('0x25')],'available':_0x26bab7['available'],'loggedIn':_0x26bab7['loggedIn'],'pTalking':_0x26bab7[_0xd40b('0x26')],'sumBillable':_0x26bab7['sumBillable'],'sumDuration':_0x26bab7[_0xd40b('0x27')],'sumHoldTime':_0x26bab7[_0xd40b('0x28')]||0x0,'talking':_0x26bab7['talking'],'total':_0x26bab7[_0xd40b('0x29')],'type':_0x26bab7[_0xd40b('0x22')],'unmanaged':_0x26bab7[_0xd40b('0x2a')],'waiting':_0x26bab7['waiting'],'loggedInDb':_0x26bab7[_0xd40b('0x2b')],'dialActive':_0x26bab7[_0xd40b('0x2c')],'dialMethod':_0x26bab7['dialMethod'],'dialOriginateCallerIdName':_0x26bab7[_0xd40b('0x2d')],'dialOriginateCallerIdNumber':_0x26bab7[_0xd40b('0x2e')],'dialOriginateTimeout':_0x26bab7[_0xd40b('0x2f')],'dialPrefix':_0x26bab7[_0xd40b('0x30')],'outboundAnswerAgiCallsDay':_0x26bab7[_0xd40b('0x31')],'outboundAnswerCallsDay':_0x26bab7[_0xd40b('0x32')],'outboundBlacklistCallsDay':_0x26bab7[_0xd40b('0x33')],'outboundBusyCallsDay':_0x26bab7[_0xd40b('0x34')],'outboundCongestionCallsDay':_0x26bab7[_0xd40b('0x35')],'outboundDropCallsDayACS':_0x26bab7[_0xd40b('0x36')],'outboundDropCallsDayCallersExit':_0x26bab7['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x26bab7[_0xd40b('0x37')],'outboundNoAnswerCallsDay':_0x26bab7[_0xd40b('0x38')],'outboundNoSuchCallsDay':_0x26bab7[_0xd40b('0x39')],'outboundOriginateFailureCallsDay':_0x26bab7[_0xd40b('0x3a')],'outboundReCallsDay':_0x26bab7[_0xd40b('0x3b')],'outboundRejectCallsDay':_0x26bab7[_0xd40b('0x3c')],'outboundUnknownCallsDay':_0x26bab7[_0xd40b('0x3d')],'predictiveIntervalAnsweredCalls':_0x26bab7[_0xd40b('0x3e')],'predictiveIntervalAvgHoldtime':_0x26bab7[_0xd40b('0x3f')],'predictiveIntervalAvgTalktime':_0x26bab7[_0xd40b('0x40')],'predictiveIntervalDroppedCallsCallersExit':_0x26bab7[_0xd40b('0x41')],'predictiveIntervalDroppedCallsTimeout':_0x26bab7[_0xd40b('0x42')],'predictiveIntervalErlangCalls':_0x26bab7['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x26bab7[_0xd40b('0x43')],'predictiveIntervalHitRate':_0x26bab7['predictiveIntervalHitRate'],'predictiveIntervalLowerLimit':_0x26bab7[_0xd40b('0x44')],'predictiveIntervalMultiplicativeFactor':_0x26bab7[_0xd40b('0x45')],'predictiveIntervalPauses':_0x26bab7[_0xd40b('0x46')],'predictiveIntervalTotalCalls':_0x26bab7['predictiveIntervalTotalCalls'],'message':_0x26bab7['message'],'originated':_0x26bab7[_0xd40b('0x47')]};if(_0x26bab7[_0xd40b('0x48')]){_0x499848[_0xd40b('0x48')]={'id':_0x26bab7[_0xd40b('0x48')]['id'],'name':_0x26bab7[_0xd40b('0x48')][_0xd40b('0x49')],'active':_0x26bab7[_0xd40b('0x48')][_0xd40b('0x4a')],'callerid':_0x26bab7[_0xd40b('0x48')][_0xd40b('0x4b')]};}if(_0x26bab7[_0xd40b('0x4c')]){_0x499848[_0xd40b('0x4c')]={'id':_0x26bab7['Interval']['id'],'name':_0x26bab7['Interval'][_0xd40b('0x49')]};}var _0x2da6df=md5(JSON[_0xd40b('0x4d')](_0x499848));if(_0x26bab7[_0xd40b('0x3')]!==_0x2da6df){_0x26bab7['md5']=_0x2da6df;emit(util[_0xd40b('0x4e')]('voice:queue:%s',_0x499848[_0xd40b('0x49')]),'voice_queue:save',_0x499848);}}}function emitVoiceQueueChannelRemove(_0x2ef1be){emit(util[_0xd40b('0x4e')](_0xd40b('0x4f'),_0x2ef1be[_0xd40b('0x49')]),_0xd40b('0x50'),_0x2ef1be);}function notSendMessagesQueue(_0x497fcc){if(_0x497fcc[_0xd40b('0x51')]){if(_0x497fcc[_0xd40b('0x47')]===0x0&&_0x497fcc[_0xd40b('0x26')]===0x0){_0x497fcc['sendMessageOneNotActive']=![];_0x497fcc[_0xd40b('0x52')]=0x0;_0x497fcc['paused']=0x0;_0x497fcc[_0xd40b('0x53')]=_0xd40b('0x54');ut[_0xd40b('0x55')](_0xd40b('0x56'),_0x497fcc['name']+'\x20is\x20not\x20active');}else{_0x497fcc['message']=_0xd40b('0x57');ut['logger'](_0xd40b('0x56'),_0x497fcc[_0xd40b('0x49')]+'\x20is\x20disactive');}emitCampaignPreview(_0x497fcc);}}Preview[_0xd40b('0x58')][_0xd40b('0x59')]=function(){var _0x2bb595=this;setInterval(function(){_0x2bb595[_0xd40b('0x5a')]();},0x7cf);};Preview[_0xd40b('0x58')]['syncCampaigns']=function(){var _0x3c1e33=this[_0xd40b('0xf')];this[_0xd40b('0x5b')]+=0x1;for(var _0x2b3597 in _0x3c1e33){if(_0x3c1e33[_0xd40b('0x5c')](_0x2b3597)&&(_0x3c1e33[_0x2b3597][_0xd40b('0x5d')]===_0xd40b('0x5')||_0x3c1e33[_0x2b3597][_0xd40b('0x5d')]===_0xd40b('0x5e'))&&_0x3c1e33[_0x2b3597][_0xd40b('0x22')]===_0xd40b('0x23')){if(this[_0xd40b('0x5b')]>0x7){this[_0xd40b('0x5b')]=0x0;this[_0xd40b('0x5f')]();}}if(_0x3c1e33[_0xd40b('0x5c')](_0x2b3597)&&_0x3c1e33[_0x2b3597][_0xd40b('0x5d')]==='preview'&&_0x3c1e33[_0x2b3597][_0xd40b('0x22')]==='outbound'){if(_0x3c1e33[_0x2b3597][_0xd40b('0x2c')]){this['setMessage'](_0x3c1e33[_0x2b3597]);this[_0xd40b('0x60')](_0x3c1e33[_0x2b3597]);}else{notSendMessagesQueue(_0x3c1e33[_0x2b3597]);}}}};Preview[_0xd40b('0x58')]['clearZombieChannel']=function(_0x1dd2b8){var _0x3e9fff=this;this['sequence'][_0xd40b('0xc')](function(){if(!_[_0xd40b('0x61')](_0x3e9fff[_0xd40b('0x11')][_0x1dd2b8])){loggerAction['info'](_0xd40b('0x62'),_0x1dd2b8,_0xd40b('0x63'),_0x3e9fff[_0xd40b('0x11')][_0x1dd2b8][_0xd40b('0x64')],'originated:\x20',JSON[_0xd40b('0x4d')](_0x3e9fff[_0xd40b('0xf')][_0x3e9fff[_0xd40b('0x11')][_0x1dd2b8]['queue']][_0xd40b('0x47')]),'pTalking:\x20',JSON[_0xd40b('0x4d')](_0x3e9fff['campaignsPreview'][_0x3e9fff[_0xd40b('0x11')][_0x1dd2b8]['queue']][_0xd40b('0x26')]),JSON[_0xd40b('0x4d')](_0x3e9fff[_0xd40b('0x11')][_0x1dd2b8]['dialAnswer']),JSON[_0xd40b('0x4d')](_['pick'](_0x3e9fff['actions'][_0x1dd2b8],['contactId','UserId',_0xd40b('0x65'),_0xd40b('0x66')])));return ami[_0xd40b('0x67')]({'action':_0xd40b('0x68'),'channel':_0x3e9fff[_0xd40b('0x11')][_0x1dd2b8][_0xd40b('0x69')]})[_0xd40b('0x6a')](function(_0x442b0f){if(_0x442b0f[_0xd40b('0x53')]===_0xd40b('0x6b')){setTimeout(function(){if(_0x3e9fff[_0xd40b('0x11')][_0x1dd2b8]){ut[_0xd40b('0x6c')](_0x3e9fff['campaignsPreview'][_0x3e9fff[_0xd40b('0x11')][_0x1dd2b8][_0xd40b('0x64')]],_0xd40b('0x6d'));if(_0x3e9fff['actions'][_0x1dd2b8][_0xd40b('0x6e')]===!![]){ut[_0xd40b('0x6f')](_0x3e9fff[_0xd40b('0xf')][_0x3e9fff[_0xd40b('0x11')][_0x1dd2b8][_0xd40b('0x64')]],_0xd40b('0x6d'));ut[_0xd40b('0x70')](_0xd40b('0x71')+_0x1dd2b8,_0x3e9fff['actions'][_0x1dd2b8][_0xd40b('0x64')]);}ut[_0xd40b('0x70')]('[Dialer][checkChannel][Preview]'+_0x1dd2b8,_0x3e9fff[_0xd40b('0x11')][_0x1dd2b8][_0xd40b('0x64')]);delete _0x3e9fff[_0xd40b('0x11')][_0x1dd2b8];}},0x2328);}});}});};Preview[_0xd40b('0x58')][_0xd40b('0x5f')]=function(){var _0x3747e9=this;loggerAction[_0xd40b('0x72')]('[action]',_[_0xd40b('0x73')](this[_0xd40b('0x11')]));for(var _0x1e25e8 in this[_0xd40b('0x11')]){if(_0x3747e9[_0xd40b('0x11')]['hasOwnProperty'](_0x1e25e8)){_0x3747e9[_0xd40b('0x74')](_0x1e25e8);}}};Preview[_0xd40b('0x58')][_0xd40b('0x60')]=function(_0x12a112){var _0x393faf=this;rpcDb[_0xd40b('0x75')](_0x12a112['id'],ut[_0xd40b('0x76')](this['agents']))[_0xd40b('0x77')](function(_0x2a9f09){if(!_[_0xd40b('0x61')](_0x2a9f09)){for(var _0x337e71=0x0;_0x337e71<_0x2a9f09[_0xd40b('0x78')];_0x337e71+=0x1){if(ut[_0xd40b('0x79')](_0x2a9f09[_0x337e71][_0xd40b('0x7a')])<_0x12a112['dialRecallMeTimeout']*0x3c){_0x393faf[_0xd40b('0x7b')](_0x2a9f09[_0x337e71]['id'])[_0xd40b('0x77')](ut['logger2']('[RecallMe]'))[_0xd40b('0x6a')](ut['logger2']('[RecallMe]'));}else{var _0x3d880f=new Action(_0x2a9f09[_0x337e71],_0x12a112);_0x3d880f[_0xd40b('0x7c')]=moment()[_0xd40b('0x4e')](_0xd40b('0x7d'));_0x12a112[_0xd40b('0x3b')]+=0x1;ut[_0xd40b('0x7e')](_0x3d880f,0x17,_0xd40b('0x7f'));if(_0x12a112[_0xd40b('0x80')]){rpcDb['rescheduleContactInQueue'](ut[_0xd40b('0x81')](_0x2a9f09[_0x337e71]));rpcDb[_0xd40b('0x82')](_0x3d880f,'[HistoryDialRecallInQueue][historyCatch]');}else{ut['logCustomer'](_0x3d880f,0x16,_0xd40b('0x83'));rpcDb[_0xd40b('0x82')](_0x3d880f,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x3d880f,_0xd40b('0x84'));}}}}})[_0xd40b('0x6a')](ut[_0xd40b('0x85')](_0xd40b('0x86')));};Preview['prototype'][_0xd40b('0x87')]=function(_0x411947){_0x411947['sendMessageOneNotActive']=!![];if(ut[_0xd40b('0x88')](_0x411947[_0xd40b('0x89')])){_0x411947[_0xd40b('0x53')]=_0xd40b('0x8a');}else if(!ut[_0xd40b('0x8b')](_0x411947[_0xd40b('0x2c')])){_0x411947[_0xd40b('0x53')]='NOT_ACTIVE';}else if(!this[_0xd40b('0x8c')](_0x411947[_0xd40b('0x48')])){if(!this[_0xd40b('0x8c')](_0x411947[_0xd40b('0x8d')])){_0x411947[_0xd40b('0x53')]=_0xd40b('0x8e');}else{_0x411947[_0xd40b('0x53')]='ACTIVE';}}else{_0x411947[_0xd40b('0x53')]=_0xd40b('0x8f');}emitCampaignPreview(_0x411947);};Preview[_0xd40b('0x58')][_0xd40b('0x90')]=function(_0x150858,_0x103878,_0x490af4){var _0x3b5e68=this;var _0x44d5ef=this[_0xd40b('0x11')][_0x103878];var _0x531e20=this[_0xd40b('0xf')][_0x44d5ef[_0xd40b('0x64')]];var _0x4a6b40;if(_0x531e20){switch(_0x490af4){case'1':_0x531e20[_0xd40b('0x39')]+=0x1;_0x44d5ef[_0xd40b('0x91')]=ut[_0xd40b('0x92')](_0x44d5ef);ut[_0xd40b('0x7e')](_0x44d5ef,0x0,'NoSuchNumber');rpcDb[_0xd40b('0x82')](_0x44d5ef,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xd40b('0x92')](_0x44d5ef)>=_0x531e20['dialGlobalMaxRetry']){_0x4a6b40=ut[_0xd40b('0x93')](_0x44d5ef,0xf,'Global');rpcDb[_0xd40b('0x94')](_0x4a6b40,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['createCustomerFinal'](_0x44d5ef,'[callProgressDetectingCustomer][logNoSuchGlobal]');}delete this['actions'][_0x150858['linkedid']];break;case _0xd40b('0x95'):var _0xd1437b=moment()[_0xd40b('0x4e')](_0xd40b('0x7d'));_0x44d5ef['responsetime']=_0xd1437b;_0x44d5ef[_0xd40b('0x96')]=_0xd1437b;_0x44d5ef[_0xd40b('0x6e')]=!![];_0x531e20[_0xd40b('0x26')]+=0x1;logger[_0xd40b('0x72')]('[syncHangup][talking][increment]',_0x44d5ef['uniqueid'],_0xd40b('0x97'),_0x531e20['name'],_0xd40b('0x98'),_0x531e20[_0xd40b('0x26')]);ami[_0xd40b('0x21')]('custom:agentconnect',ut[_0xd40b('0x99')](_0x44d5ef,_0xd40b('0x9a')));if(_0x531e20[_0xd40b('0x9b')]){ami[_0xd40b('0x21')](_0xd40b('0x9c'),ut[_0xd40b('0x9d')](_0x44d5ef));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0xd40b('0x99')](_0x44d5ef,_0xd40b('0x9e')));emitVoiceQueueChannelRemove(ut[_0xd40b('0x99')](_0x44d5ef,_0xd40b('0x9e')));_0x531e20[_0xd40b('0x32')]+=0x1;_0x531e20[_0xd40b('0x29')]+=0x1;_0x531e20[_0xd40b('0x25')]+=0x1;ut[_0xd40b('0x6f')](_0x531e20,'[16]');_0x44d5ef['countglobal']=ut[_0xd40b('0x92')](_0x44d5ef);ut[_0xd40b('0x7e')](_0x44d5ef,0x4,_0xd40b('0x9f'));rpcDb[_0xd40b('0x82')](_0x44d5ef,_0xd40b('0xa0'));rpcDb[_0xd40b('0x94')](_0x44d5ef,_0xd40b('0xa1'));rpcDb[_0xd40b('0xa2')](_0x44d5ef);_0x531e20[_0xd40b('0x27')]+=_0x44d5ef[_0xd40b('0xa3')];_0x531e20[_0xd40b('0xa4')]+=_0x44d5ef[_0xd40b('0xa3')];logger['info'](_0xd40b('0xa5'),_0x44d5ef[_0xd40b('0xa6')],_0xd40b('0x97'),_0x531e20[_0xd40b('0x49')],_0xd40b('0x98'),_0x531e20['pTalking']);delete this['actions'][_0x150858[_0xd40b('0xa7')]];break;case'BUSY':_0x531e20[_0xd40b('0x34')]+=0x1;_0x44d5ef[_0xd40b('0xa8')]+=0x1;_0x44d5ef[_0xd40b('0x91')]=ut[_0xd40b('0x92')](_0x44d5ef);ut['logCustomer'](_0x44d5ef,0x5,_0xd40b('0xa9'));rpcDb[_0xd40b('0x82')](_0x44d5ef,_0xd40b('0xaa'));if(ut[_0xd40b('0x92')](_0x44d5ef)>=_0x531e20[_0xd40b('0xab')]){_0x4a6b40=ut[_0xd40b('0x93')](_0x44d5ef,0xf,_0xd40b('0xac'));rpcDb[_0xd40b('0x94')](_0x4a6b40,_0xd40b('0xad'));}else{if(_0x44d5ef[_0xd40b('0xa8')]>=_0x531e20[_0xd40b('0xae')]){rpcDb[_0xd40b('0x94')](_0x44d5ef,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xd40b('0xaf')](ut[_0xd40b('0xb0')](_0x44d5ef,_0xd40b('0xa8'),_0x531e20[_0xd40b('0xb1')]),_0x44d5ef[_0xd40b('0xb2')],_0x44d5ef['activeContact']);}}break;case _0xd40b('0xb3'):_0x531e20[_0xd40b('0x38')]+=0x1;_0x44d5ef[_0xd40b('0xb4')]+=0x1;_0x44d5ef['countglobal']=ut[_0xd40b('0x92')](_0x44d5ef);ut['logCustomer'](_0x44d5ef,0x3,_0xd40b('0xb5'));rpcDb[_0xd40b('0x82')](_0x44d5ef,_0xd40b('0xb6'));if(ut['totalGlobal'](_0x44d5ef)>=_0x531e20['dialGlobalMaxRetry']){_0x4a6b40=ut[_0xd40b('0x93')](_0x44d5ef,0xf,_0xd40b('0xac'));rpcDb[_0xd40b('0x94')](_0x4a6b40,_0xd40b('0xb7'));}else{if(_0x44d5ef[_0xd40b('0xb4')]>=_0x531e20[_0xd40b('0xb8')]){rpcDb[_0xd40b('0x94')](_0x44d5ef,_0xd40b('0xb6'));}else{rpcDb[_0xd40b('0xaf')](ut['scheduledAt'](_0x44d5ef,_0xd40b('0xb4'),_0x531e20['dialNoAnswerRetryFrequency']),_0x44d5ef[_0xd40b('0xb2')],_0x44d5ef['activeContact']);}}break;case _0xd40b('0xb9'):_0x531e20[_0xd40b('0x35')]+=0x1;_0x44d5ef[_0xd40b('0xba')]+=0x1;_0x44d5ef[_0xd40b('0x91')]=ut[_0xd40b('0x92')](_0x44d5ef);ut[_0xd40b('0x7e')](_0x44d5ef,0x8,_0xd40b('0xbb'));rpcDb['createCustomerHistory'](_0x44d5ef,_0xd40b('0xbc'));if(ut['totalGlobal'](_0x44d5ef)>=_0x531e20[_0xd40b('0xab')]){_0x4a6b40=ut[_0xd40b('0x93')](_0x44d5ef,0xf,'Global');rpcDb[_0xd40b('0x94')](_0x4a6b40,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x44d5ef[_0xd40b('0xba')]>=_0x531e20[_0xd40b('0xbd')]){rpcDb[_0xd40b('0x94')](_0x44d5ef,_0xd40b('0xbc'));}else{rpcDb['rescheduleContact'](ut[_0xd40b('0xb0')](_0x44d5ef,_0xd40b('0xba'),_0x531e20[_0xd40b('0xb1')]),_0x44d5ef[_0xd40b('0xb2')],_0x44d5ef['activeContact']);}}break;case'CANCEL':_0x531e20[_0xd40b('0x3c')]+=0x1;_0x44d5ef['countglobal']=ut[_0xd40b('0x92')](_0x44d5ef);ut[_0xd40b('0x7e')](_0x44d5ef,0x14,_0xd40b('0xbe'));rpcDb[_0xd40b('0x82')](_0x44d5ef,_0xd40b('0xbf'));if(_0x44d5ef[_0xd40b('0xb2')]){rpcDb[_0xd40b('0xc0')](_0x44d5ef['idContact']);}if(_0x44d5ef[_0xd40b('0xc1')]){rpcDb[_0xd40b('0xc2')](_0x44d5ef['idContact']);}break;default:if(_0x44d5ef[_0xd40b('0x6e')]){ut[_0xd40b('0x6f')](_0x531e20,_0xd40b('0xc3'));ut[_0xd40b('0x70')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x531e20[_0xd40b('0x49')],_0x150858);}_0x531e20[_0xd40b('0x3d')]+=0x1;_0x44d5ef[_0xd40b('0x91')]=ut[_0xd40b('0x92')](_0x44d5ef);ut[_0xd40b('0x7e')](_0x44d5ef,0xc,_0x150858['cause-txt']||_0x150858[_0xd40b('0xc4')]);rpcDb['createCustomerHistory'](_0x44d5ef,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0xd40b('0x92')](_0x44d5ef)>=_0x531e20[_0xd40b('0xab')]){_0x4a6b40=ut[_0xd40b('0x93')](_0x44d5ef,0xf,_0xd40b('0xac'));rpcDb['createCustomerFinal'](_0x4a6b40,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xd40b('0x94')](_0x44d5ef,_0xd40b('0xc5'));}delete this[_0xd40b('0x11')][_0x150858[_0xd40b('0xa7')]];}if(!(_0x44d5ef[_0xd40b('0x6e')]&&_0x490af4==='16')){ut[_0xd40b('0x6c')](_0x531e20,_0xd40b('0xc6'));logger[_0xd40b('0x72')](_0xd40b('0xc7'),_0x44d5ef[_0xd40b('0xa6')],_0xd40b('0x97'),_0x531e20[_0xd40b('0x49')],_0xd40b('0xc8'),_0x531e20['originated']);}if(_0x490af4!==_0xd40b('0x95')){delete this[_0xd40b('0x11')][_0x150858[_0xd40b('0xa7')]];delete this['actions'][_0x150858[_0xd40b('0xc9')]];}}};Preview['prototype'][_0xd40b('0xca')]=function(_0xd861d9,_0x58a491,_0x5b71d3){if(_[_0xd40b('0xcb')](_0x58a491)&&_0xd40b('0xcc')!==typeof _0x58a491){return;}if(_[_0xd40b('0xcb')](_0x5b71d3)&&_0xd40b('0xcc')!==typeof _0x5b71d3){return;}switch(_0x5b71d3['reason']){case'0':ut[_0xd40b('0xcd')](_0xd861d9,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0xd861d9,_0xd40b('0xce'));break;case'3':ut['logAgent'](_0xd861d9,0x3,_0xd40b('0xb5'));rpcDb[_0xd40b('0xcf')](_0xd861d9,_0xd40b('0xd0'));break;case'5':ut[_0xd40b('0xcd')](_0xd861d9,0x5,_0xd40b('0xa9'));rpcDb[_0xd40b('0xcf')](_0xd861d9,_0xd40b('0xd1'));break;case'8':ut[_0xd40b('0xcd')](_0xd861d9,0x8,_0xd40b('0xbb'));rpcDb[_0xd40b('0xcf')](_0xd861d9,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut['logAgent'](_0xd861d9,0x16,_0xd40b('0xd2'));rpcDb[_0xd40b('0xcf')](_0xd861d9,_0xd40b('0xd3'));break;default:ut[_0xd40b('0xcd')](_0xd861d9,0xc,_0x5b71d3[_0xd40b('0xd4')]);rpcDb[_0xd40b('0xcf')](_0xd861d9,_0xd40b('0xd5'));}ut['updateOriginated'](_0x58a491,_0xd40b('0xd6'));logger[_0xd40b('0x72')](_0xd40b('0xd7'),_0xd861d9[_0xd40b('0xa6')],_0xd40b('0x97'),_0x58a491[_0xd40b('0x49')],_0xd40b('0xc8'),_0x58a491['originated']);delete this[_0xd40b('0x11')][_0xd861d9[_0xd40b('0xa6')]];};Preview['prototype'][_0xd40b('0xd8')]=function(_0x599f24,_0x24c847,_0x3499d9,_0x458c77,_0x542ea8){var _0x125a09=this;return new BPromise(function(_0x374d5a,_0x151415){if(_[_0xd40b('0x61')](_0x24c847)||_[_0xd40b('0x61')](_0x24c847['Contact'])||_[_0xd40b('0x61')](_0x24c847['Contact'][_0xd40b('0xd9')])||_['isNil'](_0x24c847[_0xd40b('0x65')])){_0x151415(ut[_0xd40b('0x53')](_0xd40b('0xda'),_0x458c77,_0x542ea8));return;}var _0x2b8c33=uuid['v4']();var _0x40cf88=_0x125a09[_0xd40b('0xf')][_0x24c847['Queue'][_0xd40b('0x49')]];var _0xbd7999=_0x3499d9?_0x125a09['agents'][_0x3499d9]['id']:undefined;_0x125a09['actions'][_0x2b8c33]=new Action(_0x24c847,_0x40cf88,_0x2b8c33,_0x3499d9,_0xbd7999);var _0xdc5425=_0x125a09[_0xd40b('0x11')][_0x2b8c33];_0xdc5425[_0xd40b('0xb2')]=_0x458c77;_0xdc5425[_0xd40b('0xc1')]=_0x542ea8;_0xdc5425['lookAgent']=_0x3499d9;if(_['isEmpty'](_0x599f24)){_0x125a09[_0xd40b('0xdb')](_0xdc5425,_0x40cf88,_0x24c847,_0x3499d9)[_0xd40b('0x77')](function(_0x10aabb){logger[_0xd40b('0x72')](_0xd40b('0xdc'),_0xd40b('0xdd')+_0xdc5425[_0xd40b('0x64')]+_0xd40b('0xde')+_0xdc5425[_0xd40b('0xdf')],JSON[_0xd40b('0x4d')](_0x10aabb));ami[_0xd40b('0x21')](_0xd40b('0xe0'),ut['buildObj'](_0xdc5425,_0xd40b('0xe1')));_0x374d5a(ut[_0xd40b('0x53')](_0xd40b('0xe2')));})[_0xd40b('0x6a')](function(_0x2e33c8){ut[_0xd40b('0x55')](_0xd40b('0xe3'),_0x2e33c8);_0x151415(ut[_0xd40b('0x53')](_0xd40b('0xe4'),_0x458c77,_0x542ea8));});}else{_0x40cf88['outboundBlacklistCallsDay']+=0x1;ut[_0xd40b('0xe5')](_0xdc5425);rpcDb[_0xd40b('0xe6')](_0xdc5425,_0xd40b('0xe7'));delete _0x125a09['actions'][_0x2b8c33];_0x151415(ut[_0xd40b('0x53')]('Contact\x20in\x20black\x20List',_0x458c77,_0x542ea8));}});};Preview['prototype']['isTrunkReachable']=function(_0xa26cbd){return!_[_0xd40b('0x61')](_0xa26cbd)&&!_['isNil'](_0xa26cbd[_0xd40b('0x49')])&&!_[_0xd40b('0x61')](_0xa26cbd[_0xd40b('0x4a')])&&_0xa26cbd['active']&&!_[_0xd40b('0x61')](this['trunks'][util['format'](_0xd40b('0xe8'),_0xa26cbd[_0xd40b('0x49')])])&&!_['isNil'](this[_0xd40b('0x10')][util[_0xd40b('0x4e')]('SIP/%s',_0xa26cbd[_0xd40b('0x49')])][_0xd40b('0x68')])&&(this['trunks'][util[_0xd40b('0x4e')]('SIP/%s',_0xa26cbd[_0xd40b('0x49')])]['status']===_0xd40b('0xe9')||this[_0xd40b('0x10')][util[_0xd40b('0x4e')](_0xd40b('0xe8'),_0xa26cbd['name'])][_0xd40b('0x68')]==='unmonitored');};Preview[_0xd40b('0x58')][_0xd40b('0x7b')]=function(_0x22b2af,_0x12301b){var _0x1729e8=this;return new BPromise(function(_0x532156,_0x30e462){_0x1729e8[_0xd40b('0xea')](_0x22b2af,_0x12301b)[_0xd40b('0x77')](function(_0x2ac1bf){_0x532156(_[_0xd40b('0xeb')](_0x2ac1bf,[_0xd40b('0x53')]));})['catch'](function(_0x55392b){if(_0x55392b[_0xd40b('0xec')]){rpcDb[_0xd40b('0xc0')](_0x22b2af);}if(_0x55392b[_0xd40b('0x4a')]){rpcDb['disableContact'](_0x22b2af);}_0x30e462(_[_0xd40b('0xeb')](_0x55392b,['message']));});});};Preview['prototype'][_0xd40b('0xea')]=function(_0x5be203,_0x5105b0){var _0x3d69a5=this;return new BPromise(function(_0x36bca0,_0x44694c){var _0x4714fe,_0x94a369;rpcDb[_0xd40b('0xed')](_0x5be203)['then'](function(_0x107af6){if(!_[_0xd40b('0x61')](_0x107af6[0x0])){_0x94a369=_0x107af6[0x0][_0xd40b('0xee')]?![]:!![];_0x4714fe=_0x107af6[0x0][_0xd40b('0xee')]?!![]:![];_0x4714fe=_0x5105b0?!![]:_0x4714fe;}var _0x248e07=_0x3d69a5[_0xd40b('0xef')](_0x107af6);if(_0x248e07[_0xd40b('0xf0')]){rpcDb[_0xd40b('0xf1')](_[_0xd40b('0xeb')](_0x107af6[0x0],[_0xd40b('0x65'),_0xd40b('0xf2')]))[_0xd40b('0x77')](function(_0x3bde32){_0x3d69a5[_0xd40b('0xd8')](_0x3bde32,_0x107af6[0x0],_0x5105b0,_0x94a369,_0x4714fe)['then'](function(_0x3eea12){_0x36bca0(_0x3eea12);})[_0xd40b('0x6a')](function(_0x4674a4){_0x44694c(_0x4674a4);});})['catch'](function(_0x407a8a){ut[_0xd40b('0x55')]('[Preview][checkIsBlackList]',_0x407a8a);_0x44694c(ut[_0xd40b('0x53')](_0xd40b('0xf3'),_0x94a369,_0x4714fe));});}else{_0x44694c(ut[_0xd40b('0x53')](_0x248e07['message'],_0x94a369,_0x4714fe));}})[_0xd40b('0x6a')](function(_0x35a695){ut[_0xd40b('0x55')](_0xd40b('0xf4'),_0x35a695);_0x44694c(ut[_0xd40b('0x53')](_0xd40b('0xf3'),![],!![]));});});};Preview[_0xd40b('0x58')][_0xd40b('0xef')]=function(_0x58bd37){if(_['isNil'](_0x58bd37)||_['isEmpty'](_0x58bd37)||!_[_0xd40b('0x61')](_0x58bd37[0x0][_0xd40b('0xf5')])&&_['isNil'](_0x58bd37[0x0][_0xd40b('0xf5')][_0xd40b('0x49')])){ut['logger'](_0xd40b('0xf6'),_0x58bd37);return{'isValid':![],'message':_0xd40b('0xf7')};}var _0x3f2d50=this[_0xd40b('0xf')][_0x58bd37[0x0][_0xd40b('0x63')][_0xd40b('0x49')]];_0x3f2d50[_0xd40b('0x53')]=_0xd40b('0x8f');if(_[_0xd40b('0x61')](_0x3f2d50)){ut['logger'](_0xd40b('0xf8'),_0x3f2d50);return{'isValid':![],'message':_0xd40b('0xf9')};}if(!this[_0xd40b('0x8c')](_0x3f2d50['Trunk'])){ut['logger'](_0xd40b('0xfa'),_0xd40b('0xfb')+_0x3f2d50[_0xd40b('0x49')]+_0xd40b('0xfc'));if(!this[_0xd40b('0x8c')](_0x3f2d50[_0xd40b('0x8d')])){ut['logger'](_0xd40b('0xfa'),_0x3f2d50[_0xd40b('0x49')]+_0xd40b('0xfd'));return{'isValid':![],'message':_0xd40b('0xfe')};}}if(!ut['isActive'](_0x3f2d50[_0xd40b('0x2c')])){ut[_0xd40b('0x55')]('[Preview][validateContact][Campaign\x20Active]',_0x3f2d50[_0xd40b('0x49')]+_0xd40b('0xff'));return{'isValid':![],'message':_0xd40b('0xfb')+_0x3f2d50[_0xd40b('0x49')]+_0xd40b('0xff')};}return{'isValid':!![],'message':_0xd40b('0x100')};};Preview[_0xd40b('0x58')][_0xd40b('0xdb')]=function(_0xa526f2,_0x35a3a4,_0x307c21,_0x3981b0){var _0x55d4c6=this;return new BPromise(function(_0x1b09af,_0x18358c){var _0x385cb3=_0xa526f2[_0xd40b('0xa6')];var _0x32cbb0=_0x55d4c6[_0xd40b('0x8c')](_0x35a3a4['Trunk'])?util['format']('SIP/%s/%s%s',_0x35a3a4['Trunk'][_0xd40b('0x49')],_[_0xd40b('0x61')](_0x35a3a4[_0xd40b('0x30')])?'':_0x35a3a4[_0xd40b('0x30')][_0xd40b('0x101')]()||'',_0x35a3a4[_0xd40b('0x102')]>0x0?_0x307c21[_0xd40b('0x103')][_0xd40b('0xd9')][_0xd40b('0x104')](_0x35a3a4[_0xd40b('0x102')]):_0x307c21['Contact'][_0xd40b('0xd9')]):util['format']('SIP/%s/%s%s',_[_0xd40b('0x61')](_0x35a3a4[_0xd40b('0x8d')])?_0x35a3a4['Trunk']['name']:_0x35a3a4[_0xd40b('0x8d')]['name'],_[_0xd40b('0x61')](_0x35a3a4['dialPrefix'])?'':_0x35a3a4[_0xd40b('0x30')][_0xd40b('0x101')]()||'',_0x35a3a4['dialCutDigit']>0x0?_0x307c21[_0xd40b('0x103')][_0xd40b('0xd9')][_0xd40b('0x104')](_0x35a3a4['dialCutDigit']):_0x307c21['Contact'][_0xd40b('0xd9')]);var _0x4ca60b=_0x55d4c6[_0xd40b('0x8c')](_0x35a3a4[_0xd40b('0x48')])?ut['getCallerId'](_0x35a3a4['Trunk'][_0xd40b('0x4b')],_0x35a3a4[_0xd40b('0x2d')],_0x35a3a4[_0xd40b('0x105')]>0x0?ut[_0xd40b('0x106')](_0x35a3a4['dialOriginateCallerIdNumber'],_0x35a3a4[_0xd40b('0x105')]):_0x35a3a4[_0xd40b('0x2e')]):ut[_0xd40b('0x107')](_['isNil'](_0x35a3a4[_0xd40b('0x8d')])?_0x35a3a4[_0xd40b('0x48')][_0xd40b('0x4b')]:_0x35a3a4['TrunkBackup']['callerid'],_0x35a3a4[_0xd40b('0x2d')],_0x35a3a4['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xd40b('0x106')](_0x35a3a4[_0xd40b('0x2e')],_0x35a3a4[_0xd40b('0x105')]):_0x35a3a4[_0xd40b('0x2e')]);if(_0x4ca60b){_0xa526f2[_0xd40b('0x108')]=ut[_0xd40b('0x109')](_0x4ca60b);_0xa526f2[_0xd40b('0x10a')]=ut[_0xd40b('0x10b')](_0x4ca60b);}var _0xd84b27=ut['addVariables'](_0x35a3a4,_0x307c21,_0x32cbb0,_0x4ca60b,_0x385cb3,_0xa526f2);_[_0xd40b('0x10c')](_0xa526f2,ut['toLowerVariables'](_0xd84b27));_0xa526f2[_0xd40b('0x7c')]=moment()[_0xd40b('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');ami['Action'](ut[_0xd40b('0x10d')](_0xa526f2,_0x35a3a4,_0xd84b27,_0xa526f2[_0xd40b('0xc1')],_0x3981b0))['then'](function(_0x193ac6){_0x35a3a4['originated']+=0x1;logger['info'](_0xd40b('0x10e'),_0x385cb3,_0xd40b('0x97'),_0x35a3a4[_0xd40b('0x49')],_0xd40b('0xc8'),_0x35a3a4[_0xd40b('0x47')]);_0x1b09af(_0x193ac6);})[_0xd40b('0x6a')](function(_0x4462e9){ut['logAgent'](_0xa526f2,0xe,_0xd40b('0x10f'));rpcDb[_0xd40b('0xcf')](_0xa526f2,_0xd40b('0x110'));_0x18358c(_0x4462e9);});});};Preview[_0xd40b('0x58')][_0xd40b('0x111')]=function(_0x3a82b2){if(this[_0xd40b('0x11')][_0x3a82b2[_0xd40b('0xa7')]]){this[_0xd40b('0x11')][_0x3a82b2[_0xd40b('0xa7')]][_0xd40b('0x69')]=_0x3a82b2[_0xd40b('0x69')];}};Preview[_0xd40b('0x58')]['syncOriginateResponse']=function(_0x51f8ff){var _0x4bda5d=this;var _0x4c20ed=this['actions'][_0x51f8ff[_0xd40b('0x112')]];if(_0x4c20ed){if(_0x4c20ed[_0xd40b('0x113')]&&this[_0xd40b('0x12')][_0x4c20ed[_0xd40b('0x113')]]){ut[_0xd40b('0x114')](_0x4c20ed,this['agents'][_0x4c20ed[_0xd40b('0x113')]][_0xd40b('0x49')],this['agents'][_0x4c20ed[_0xd40b('0x113')]]['id']);}var _0x11f97f=_['clone'](_0x4c20ed);_0x11f97f[_0xd40b('0x115')]=moment()[_0xd40b('0x4e')](_0xd40b('0x7d'));var _0xd2b2a3=_0x4bda5d[_0xd40b('0xf')][_0x4c20ed[_0xd40b('0x64')]];if(ut[_0xd40b('0x116')](_0x51f8ff[_0xd40b('0x117')])){if(_0x4c20ed[_0xd40b('0xb2')]){rpcDb[_0xd40b('0xc0')](_0x4c20ed['idContact']);}if(_0x4c20ed['activeContact']){rpcDb[_0xd40b('0xc2')](_0x4c20ed[_0xd40b('0xdf')]);}ami[_0xd40b('0x21')]('custom:agentringnoanswer',ut[_0xd40b('0x99')](_0x4c20ed,'rejected'));this['callProgressDetectingAgent'](_0x11f97f,_0xd2b2a3,_0x51f8ff);}else{_0x4c20ed[_0xd40b('0x7c')]=moment()[_0xd40b('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x11f97f,0x4,'Answer');rpcDb[_0xd40b('0xcf')](_0x11f97f,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0xd40b('0x58')][_0xd40b('0x17')]=function(_0x42232a){var _0x56eb7b=this;var _0x3ad529=this[_0xd40b('0x11')][_0x42232a[_0xd40b('0xa7')]];var _0x471fc8;if(_0x3ad529){_0x471fc8=this['campaignsPreview'][_0x3ad529[_0xd40b('0x64')]];logger[_0xd40b('0x72')](_0xd40b('0x118'),_0x42232a[_0xd40b('0xa7')],_0xd40b('0x97'),_0x471fc8[_0xd40b('0x49')],_0xd40b('0x98'),_0x471fc8[_0xd40b('0x26')]);}if(this[_0xd40b('0x11')][_0x42232a[_0xd40b('0xa7')]]&&_0x42232a[_0xd40b('0xa7')]!==_0x42232a[_0xd40b('0xa6')]){if(_0x42232a[_0xd40b('0x119')]==='16'&&this['actions'][_0x42232a[_0xd40b('0xa7')]][_0xd40b('0x6e')]){this[_0xd40b('0x90')](_0x42232a,_0x42232a[_0xd40b('0xa7')],_0x42232a[_0xd40b('0x119')]);}else if(this[_0xd40b('0x11')][_0x42232a['linkedid']][_0xd40b('0x6e')]){logger[_0xd40b('0x72')](_0xd40b('0x11a'),_0x42232a['linkedid'],_0x42232a[_0xd40b('0x119')],_0xd40b('0x97'),_0x471fc8[_0xd40b('0x49')],_0xd40b('0x98'),_0x471fc8[_0xd40b('0x26')]);this['callProgressDetectingCustomer'](_0x42232a,_0x42232a['linkedid'],_0x42232a['cause']);}}else if(_0x3ad529&&_[_0xd40b('0x61')](_0x3ad529[_0xd40b('0x11b')])&&_0x471fc8[_0xd40b('0x11c')]&&_0x42232a[_0xd40b('0xa7')]===_0x42232a[_0xd40b('0xa6')]&&_[_0xd40b('0x61')](_0x42232a['reason'])&&_0x42232a[_0xd40b('0x119')]==='16'&&_0x42232a[_0xd40b('0x11d')]==='6'&&_[_0xd40b('0xcb')](_0x3ad529[_0xd40b('0x11e')])){if(_0x3ad529[_0xd40b('0xb2')]){rpcDb[_0xd40b('0xc0')](_0x3ad529[_0xd40b('0xdf')]);}if(_0x3ad529[_0xd40b('0xc1')]){rpcDb[_0xd40b('0xc2')](_0x3ad529[_0xd40b('0xdf')]);}_0x42232a[_0xd40b('0xd4')]='22';this[_0xd40b('0xca')](_0x3ad529,_0x471fc8,_0x42232a);}else if(_0x3ad529&&_0x3ad529[_0xd40b('0x11e')]){if(_0x42232a[_0xd40b('0x119')]==='16'&&this[_0xd40b('0x11')][_0x42232a[_0xd40b('0xa7')]][_0xd40b('0x6e')]){logger[_0xd40b('0x72')](_0xd40b('0x11f'),_0x42232a['linkedid'],_0x42232a[_0xd40b('0x119')],'\x20Queue',_0x471fc8[_0xd40b('0x49')],_0xd40b('0x98'),_0x471fc8[_0xd40b('0x26')]);this['callProgressDetectingCustomer'](_0x42232a,_0x42232a[_0xd40b('0xa7')],_0x42232a[_0xd40b('0x119')]);}else if(this[_0xd40b('0x11')][_0x42232a[_0xd40b('0xa7')]][_0xd40b('0x6e')]){logger[_0xd40b('0x72')](_0xd40b('0x11a'),_0x42232a[_0xd40b('0xa7')],_0x42232a[_0xd40b('0x119')],_0xd40b('0x97'),_0x471fc8[_0xd40b('0x49')],'pTalking:\x20',_0x471fc8[_0xd40b('0x26')]);this['callProgressDetectingCustomer'](_0x42232a,_0x42232a[_0xd40b('0xa7')],_0x42232a[_0xd40b('0x119')]);}}};Preview[_0xd40b('0x58')][_0xd40b('0x1b')]=function(_0x154341){if(this[_0xd40b('0x11')][_0x154341['destlinkedid']]&&_0x154341[_0xd40b('0xc9')]!==_0x154341[_0xd40b('0x120')]){this[_0xd40b('0x90')](_0x154341,_0x154341[_0xd40b('0xc9')],_0x154341[_0xd40b('0xc4')]);}};Preview[_0xd40b('0x58')]['syncHangupRequest']=function(_0x3b4576){if(this['actions'][_0x3b4576[_0xd40b('0xa7')]]&&_0x3b4576['linkedid']!==_0x3b4576['uniqueid']&&!this['actions'][_0x3b4576[_0xd40b('0xa7')]]['dialAnswer']){if(_0x3b4576['cause']==='1'){this['callProgressDetectingCustomer'](_0x3b4576,_0x3b4576[_0xd40b('0xa7')],_0x3b4576['cause']);}}};Preview[_0xd40b('0x58')][_0xd40b('0x121')]=function(_0x144605,_0x3a3e2c,_0x127f16){if(this['actions'][_0x144605]){if(_['isNil'](this[_0xd40b('0x11')][_0x144605][_0xd40b('0x122')])){this[_0xd40b('0x11')][_0x144605][_0xd40b('0x122')]={};}this[_0xd40b('0x11')][_0x144605][_0xd40b('0x122')][_0x3a3e2c]=_0x127f16;}};Preview[_0xd40b('0x58')][_0xd40b('0x1e')]=function(_0x5e4118){try{if(!_[_0xd40b('0x61')](_0x5e4118)){if(ut[_0xd40b('0x123')](_[_0xd40b('0x124')](_0x5e4118['variable'])[0x0])){this[_0xd40b('0x121')](_0x5e4118['uniqueid'],_['keys'](_0x5e4118[_0xd40b('0x125')])[0x0],_0x5e4118['value']);}}}catch(_0x39f5aa){logger[_0xd40b('0x126')](_0xd40b('0x127'),util['inspect'](_0x39f5aa,{'showHidden':![],'depth':null}));}};Preview[_0xd40b('0x58')][_0xd40b('0x1f')]=function(_0xf0cc95){if(_0xf0cc95){if(this[_0xd40b('0x11')][_0xf0cc95[_0xd40b('0x128')]]){this['actions'][_0xf0cc95['transfertargetlinkedid']]['transfer']=!![];}}};Preview[_0xd40b('0x58')][_0xd40b('0x129')]=function(_0x1ba22b){if(_0x1ba22b){if(this[_0xd40b('0x11')][_0x1ba22b[_0xd40b('0x12a')]]){this[_0xd40b('0x11')][_0x1ba22b['transfererlinkedid']]['transfer']=!![];}}};module[_0xd40b('0x12b')]=Preview;
\ No newline at end of file
index 7a90476..abaab99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb526=['crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','create','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xb526,0xfc));var _0x6b52=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0xb526[_0xa79977];return _0x109f10;};'use strict';var util=require(_0x6b52('0x0'));var BPromise=require(_0x6b52('0x1'));var logger=require('../../../config/logger')(_0x6b52('0x2'));var _=require('lodash');var cmHopper=require(_0x6b52('0x3'));var cmHopperFinal=require(_0x6b52('0x4'));var cmHopperHistory=require(_0x6b52('0x5'));var cmHopperBlack=require(_0x6b52('0x6'));var voiceQueueRt=require(_0x6b52('0x7'));var agentReportPreview=require(_0x6b52('0x8'));var voiceQueueReport=require(_0x6b52('0x9'));function loggerCatch(_0xa1c8c0){return function(_0x1a2b45){logger['error'](_0xa1c8c0,util[_0x6b52('0xa')](_0x1a2b45,{'showHidden':![],'depth':null}));};}function create(_0x441fb0){return BPromise[_0x6b52('0xb')]()[_0x6b52('0xc')](cmHopperHistory['createHistory'](_0x441fb0))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x3b61bc){return BPromise[_0x6b52('0xb')]()['then'](agentReportPreview[_0x6b52('0xd')](_0x3b61bc))[_0x6b52('0xe')](loggerCatch(_0x6b52('0xf')));}function moveContact(_0x4a5fdd){return BPromise['resolve']()[_0x6b52('0xc')](cmHopper[_0x6b52('0x10')](_0x4a5fdd,!![]))[_0x6b52('0xe')](loggerCatch(_0x6b52('0x11')));}exports[_0x6b52('0x12')]=function(_0x3806e0){return BPromise[_0x6b52('0xb')]()[_0x6b52('0xc')](cmHopperBlack[_0x6b52('0x12')](_0x3806e0))[_0x6b52('0xe')](loggerCatch(_0x6b52('0x13')));};exports[_0x6b52('0x14')]=function(_0x476d3d){return BPromise[_0x6b52('0xb')]()[_0x6b52('0xc')](cmHopper[_0x6b52('0x14')](_0x476d3d))['catch'](loggerCatch(_0x6b52('0x15')));};exports[_0x6b52('0xd')]=function(_0x5dd8b8,_0x2dd3e4){create(_0x5dd8b8)[_0x6b52('0xe')](loggerCatch(_0x2dd3e4));moveContact(_0x5dd8b8)[_0x6b52('0xe')](loggerCatch(_0x2dd3e4));};exports[_0x6b52('0x16')]=function(_0x173706,_0x2a9e63){createAgent(_0x173706)[_0x6b52('0xe')](loggerCatch(_0x2a9e63));};exports[_0x6b52('0x17')]=function(_0x544493,_0x2485f0){create(_0x544493)[_0x6b52('0xe')](loggerCatch(_0x2485f0));};exports[_0x6b52('0x18')]=function(_0x20fd2f,_0x41315b){moveContact(_0x20fd2f)[_0x6b52('0xe')](loggerCatch(_0x41315b));};exports[_0x6b52('0x19')]=function(_0x4f5223,_0x4e68d6,_0x17b84b){if(_0x4e68d6){_0x4f5223[_0x6b52('0x1a')]=null;}if(_0x17b84b){_0x4f5223[_0x6b52('0x1b')]=![];}return BPromise[_0x6b52('0xb')]()[_0x6b52('0xc')](cmHopper[_0x6b52('0x19')](_0x4f5223))['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0x6b52('0x1c')]=function(_0x53fbbc){return BPromise[_0x6b52('0xb')]()['then'](cmHopper[_0x6b52('0x1c')](_0x53fbbc))['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0x6b52('0x1d')]=function(_0x2f6569){return BPromise[_0x6b52('0xb')]()['then'](cmHopper[_0x6b52('0x1d')]({'UserId':null},_0x2f6569,0x1))['catch'](loggerCatch(_0x6b52('0x1e')));};exports[_0x6b52('0x1f')]=function(_0x52f6c4){return BPromise[_0x6b52('0xb')]()[_0x6b52('0xc')](cmHopper[_0x6b52('0x1d')]({'active':![]},_0x52f6c4,0x1))[_0x6b52('0xe')](loggerCatch(_0x6b52('0x20')));};exports[_0x6b52('0x21')]=function(_0x38c628){var _0x48046c={};_0x48046c[_0x6b52('0x22')]=_0x38c628[_0x6b52('0x22')];_0x48046c['uniqueid']=_0x38c628[_0x6b52('0x23')];_0x48046c['calleridnum']=_0x38c628[_0x6b52('0x24')];_0x48046c[_0x6b52('0x25')]=_0x38c628['calleridname'];_0x48046c[_0x6b52('0x26')]=_0x38c628[_0x6b52('0x26')];_0x48046c[_0x6b52('0x27')]=_0x38c628[_0x6b52('0x28')];_0x48046c[_0x6b52('0x29')]=_0x38c628[_0x6b52('0x28')];_0x48046c[_0x6b52('0x2a')]=0x1;_0x48046c[_0x6b52('0x2b')]=_0x38c628[_0x6b52('0x2c')];_0x48046c[_0x6b52('0x2d')]=_0x38c628[_0x6b52('0x2e')];_0x48046c[_0x6b52('0x2f')]=_0x6b52('0x30');_0x48046c['exten']=_0x6b52('0x31');_0x48046c[_0x6b52('0x32')]=0x0;_0x48046c[_0x6b52('0x33')]=0x1;_0x48046c[_0x6b52('0x34')]=_0x38c628[_0x6b52('0x2e')];_0x48046c['queuecallerexitreason']='COMPLETED';return BPromise['resolve']()['then'](voiceQueueReport[_0x6b52('0x35')](_0x48046c))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x6b52('0x36')]=function(_0x4666f3,_0x10628d){return BPromise[_0x6b52('0xb')]()[_0x6b52('0xc')](cmHopper[_0x6b52('0x36')](_0x4666f3,_0x10628d))[_0x6b52('0xe')](loggerCatch(_0x6b52('0x37')));};exports['rescheduleContactInQueue']=function(_0x37f4e6){return BPromise[_0x6b52('0xb')]()['then'](cmHopper[_0x6b52('0x19')](_0x37f4e6,!![],!![]))['catch'](loggerCatch(_0x6b52('0x38')));};
\ No newline at end of file
+var _0x1c41=['unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','exten','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','then','createHistory','catch','[createHistory]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20'];(function(_0x407a17,_0x120a2e){var _0x36ac5b=function(_0x131723){while(--_0x131723){_0x407a17['push'](_0x407a17['shift']());}};_0x36ac5b(++_0x120a2e);}(_0x1c41,0x13a));var _0x11c4=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x1c41[_0x21aec3];return _0x288bbc;};'use strict';var util=require('util');var BPromise=require(_0x11c4('0x0'));var logger=require(_0x11c4('0x1'))(_0x11c4('0x2'));var _=require('lodash');var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x11c4('0x3'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x11c4('0x4'));var voiceQueueReport=require(_0x11c4('0x5'));function loggerCatch(_0x28acf0){return function(_0x30ce54){logger['error'](_0x28acf0,util[_0x11c4('0x6')](_0x30ce54,{'showHidden':![],'depth':null}));};}function create(_0x5b3fa5){return BPromise[_0x11c4('0x7')]()[_0x11c4('0x8')](cmHopperHistory[_0x11c4('0x9')](_0x5b3fa5))[_0x11c4('0xa')](loggerCatch(_0x11c4('0xb')));}function createAgent(_0x506656){return BPromise['resolve']()[_0x11c4('0x8')](agentReportPreview[_0x11c4('0x9')](_0x506656))[_0x11c4('0xa')](loggerCatch(_0x11c4('0xb')));}function moveContact(_0x120ba0){return BPromise[_0x11c4('0x7')]()[_0x11c4('0x8')](cmHopper['moveContactManagedDialer'](_0x120ba0,!![]))[_0x11c4('0xa')](loggerCatch('[moveContactManagedDialer]\x20'));}exports['checkIsBlackList']=function(_0x36da06){return BPromise[_0x11c4('0x7')]()[_0x11c4('0x8')](cmHopperBlack[_0x11c4('0xc')](_0x36da06))['catch'](loggerCatch(_0x11c4('0xd')));};exports[_0x11c4('0xe')]=function(_0x1a4856){return BPromise[_0x11c4('0x7')]()[_0x11c4('0x8')](cmHopper['getContactPreview'](_0x1a4856))['catch'](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x1c7b4e,_0x4fe62f){create(_0x1c7b4e)[_0x11c4('0xa')](loggerCatch(_0x4fe62f));moveContact(_0x1c7b4e)[_0x11c4('0xa')](loggerCatch(_0x4fe62f));};exports[_0x11c4('0xf')]=function(_0x3bcae4,_0x7babc5){createAgent(_0x3bcae4)[_0x11c4('0xa')](loggerCatch(_0x7babc5));};exports[_0x11c4('0x10')]=function(_0x1b512a,_0x48dbda){create(_0x1b512a)[_0x11c4('0xa')](loggerCatch(_0x48dbda));};exports['createCustomerFinal']=function(_0xbbf1df,_0x2839cb){moveContact(_0xbbf1df)[_0x11c4('0xa')](loggerCatch(_0x2839cb));};exports[_0x11c4('0x11')]=function(_0x412038,_0x51ae24,_0x59f1d2){if(_0x51ae24){_0x412038['UserId']=null;}if(_0x59f1d2){_0x412038[_0x11c4('0x12')]=![];}return BPromise[_0x11c4('0x7')]()[_0x11c4('0x8')](cmHopper[_0x11c4('0x11')](_0x412038))['catch'](loggerCatch(_0x11c4('0x13')));};exports[_0x11c4('0x14')]=function(_0x35d817){return BPromise[_0x11c4('0x7')]()[_0x11c4('0x8')](cmHopper[_0x11c4('0x14')](_0x35d817))[_0x11c4('0xa')](loggerCatch(_0x11c4('0x15')));};exports['unlockContact']=function(_0x35f5e7){return BPromise[_0x11c4('0x7')]()[_0x11c4('0x8')](cmHopper[_0x11c4('0x16')]({'UserId':null},_0x35f5e7,0x1))['catch'](loggerCatch(_0x11c4('0x17')));};exports[_0x11c4('0x18')]=function(_0x579f79){return BPromise[_0x11c4('0x7')]()['then'](cmHopper['unlockContact']({'active':![]},_0x579f79,0x1))[_0x11c4('0xa')](loggerCatch(_0x11c4('0x19')));};exports['crateCustomerReportQueue']=function(_0x354086){var _0x13379b={};_0x13379b['type']=_0x354086[_0x11c4('0x1a')];_0x13379b[_0x11c4('0x1b')]=_0x354086[_0x11c4('0x1b')];_0x13379b['calleridnum']=_0x354086[_0x11c4('0x1c')];_0x13379b[_0x11c4('0x1d')]=_0x354086[_0x11c4('0x1d')];_0x13379b[_0x11c4('0x1e')]=_0x354086[_0x11c4('0x1e')];_0x13379b[_0x11c4('0x1f')]=_0x354086['answertime'];_0x13379b['queuecallerleaveAt']=_0x354086['answertime'];_0x13379b[_0x11c4('0x20')]=0x1;_0x13379b[_0x11c4('0x21')]=_0x354086[_0x11c4('0x22')];_0x13379b[_0x11c4('0x23')]=_0x354086[_0x11c4('0x24')];_0x13379b[_0x11c4('0x25')]='from-sip';_0x13379b[_0x11c4('0x26')]='xcally-motion-preview';_0x13379b[_0x11c4('0x27')]=0x0;_0x13379b['assigned']=0x1;_0x13379b[_0x11c4('0x28')]=_0x354086[_0x11c4('0x24')];_0x13379b[_0x11c4('0x29')]=_0x11c4('0x2a');return BPromise[_0x11c4('0x7')]()['then'](voiceQueueReport[_0x11c4('0x2b')](_0x13379b))[_0x11c4('0xa')](loggerCatch(_0x11c4('0x2c')));};exports[_0x11c4('0x2d')]=function(_0x4fe31c,_0x47e27b){return BPromise['resolve']()[_0x11c4('0x8')](cmHopper[_0x11c4('0x2d')](_0x4fe31c,_0x47e27b))[_0x11c4('0xa')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x11c4('0x2e')]=function(_0x21c8ec){return BPromise[_0x11c4('0x7')]()[_0x11c4('0x8')](cmHopper[_0x11c4('0x11')](_0x21c8ec,!![],!![]))[_0x11c4('0xa')](loggerCatch(_0x11c4('0x2f')));};
\ No newline at end of file
index 1d2be27..ed04b9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4d1=['countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-phone','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','milliseconds','diff','loggerCatch','inspect','logger','info','loggerError','error','logger2','message','getCallerId','isUndefined','isEmpty','format','string','\x22\x22\x20<>','isActive','isNil','addVariables','name','\x22%s\x22\x20<%s>','calleridnum','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','XMD-','toUpper','toLowerVariables','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','Blacklist','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','responsetime','ringtime','membername','UserId','statedesc','answertime','isFailure','RECALL','calleridname','BOOKED','originate','channelAgent','xcally-motion-preview','from-sip','timeout','uniqueid','totalGlobal','countcongestionretry','countnoanswerretry','cloneAction','Global','active','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','interface','agentReadyId','not_inuse','status','reachable','push','seconds','createBody','ContactId','CampaignId','filterKey','idContact','campaigntype','dialAnswer'];(function(_0x27d8fc,_0x22d172){var _0x5cd1bb=function(_0x70f8a){while(--_0x70f8a){_0x27d8fc['push'](_0x27d8fc['shift']());}};_0x5cd1bb(++_0x22d172);}(_0xd4d1,0x123));var _0x1d4d=function(_0x5f1609,_0x1f80e0){_0x5f1609=_0x5f1609-0x0;var _0x1fa25e=_0xd4d1[_0x5f1609];return _0x1fa25e;};'use strict';var util=require(_0x1d4d('0x0'));var _=require(_0x1d4d('0x1'));var moment=require(_0x1d4d('0x2'));var logger=require(_0x1d4d('0x3'))(_0x1d4d('0x4'));var ipAgi=process['env'][_0x1d4d('0x5')]||'127.0.0.1';function getSeconds(_0x37e888,_0x4c5ac9){var _0xee2758=moment(_0x37e888)['milliseconds'](0x0);var _0x2bc295=moment(_0x4c5ac9)[_0x1d4d('0x6')](0x0);return _0xee2758[_0x1d4d('0x7')](_0x2bc295,'seconds');}exports[_0x1d4d('0x8')]=function(_0x515887){return function(_0x2415d7){logger['error'](_0x515887,util[_0x1d4d('0x9')](_0x2415d7,{'showHidden':![],'depth':null}));};};exports[_0x1d4d('0xa')]=function(_0x324f5b,_0x4855f9){logger[_0x1d4d('0xb')](_0x324f5b,util[_0x1d4d('0x9')](_0x4855f9,{'showHidden':![],'depth':null}));};exports[_0x1d4d('0xc')]=function(_0x5d6119,_0x448c4e){logger[_0x1d4d('0xd')](_0x5d6119,util[_0x1d4d('0x9')](_0x448c4e,{'showHidden':![],'depth':null}));};exports[_0x1d4d('0xe')]=function(_0x62a84c){return function(_0x9f5623){logger[_0x1d4d('0xb')](_0x62a84c,util[_0x1d4d('0x9')](_0x9f5623,{'showHidden':![],'depth':null}));};};exports[_0x1d4d('0xf')]=function(_0xd9244f,_0x521ea3,_0x2941e6){return{'message':_0xd9244f,'unlock':_0x521ea3,'active':_0x2941e6};};exports[_0x1d4d('0x10')]=function(_0x505e7e,_0x5aea3c,_0x5d85d2){if(!_[_0x1d4d('0x11')](_0x5d85d2)&&'string'===typeof _0x5d85d2&&!_[_0x1d4d('0x12')](_0x5d85d2)){if(!_['isUndefined'](_0x5aea3c)&&'string'===typeof _0x5aea3c&&!_[_0x1d4d('0x12')](_0x5aea3c)){return util[_0x1d4d('0x13')]('\x22%s\x22\x20<%s>',_0x5aea3c,_0x5d85d2);}return util[_0x1d4d('0x13')]('\x22%s\x22\x20<%s>',_0x5d85d2,_0x5d85d2);}if(!_[_0x1d4d('0x11')](_0x505e7e)&&_0x1d4d('0x14')===typeof _0x505e7e&&!_[_0x1d4d('0x12')](_0x505e7e)){return _0x505e7e;}return _0x1d4d('0x15');};exports[_0x1d4d('0x16')]=function(_0x504360){if(_[_0x1d4d('0x17')](_0x504360)){return![];}return _0x504360;};exports[_0x1d4d('0x18')]=function(_0x4b43ba,_0x482074,_0x32b005,_0x39f05d,_0x3a2f35,_0x4de56f){var _0x5a0f32={'XMD-QUEUE':_0x482074['Queue']?_0x482074['Queue'][_0x1d4d('0x19')]:'','XMD-CALLERID':_0x39f05d,'XMD-CALLERID-PREVIEW':_0x4de56f?util[_0x1d4d('0x13')](_0x1d4d('0x1a'),_0x4de56f['calleridname'],_0x4de56f[_0x1d4d('0x1b')]):_0x39f05d,'XMD-DIALID':_0x3a2f35,'XMD-CONTACTID':_0x482074['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x39f05d,'XMD-VOICEQUEUEID':_0x482074[_0x1d4d('0x1c')],'XMD-DIALCHANNEL':_0x32b005,'XMD-DIALTIMEOUT':_0x4b43ba[_0x1d4d('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x1d4d('0x13')]('\x22rtTxX%s%s\x22',_0x4b43ba[_0x1d4d('0x1e')]?'g':'',_[_0x1d4d('0x12')](_0x4b43ba[_0x1d4d('0x1f')])?'':_0x1d4d('0x20')),'XMD-DIALURL':_0x4b43ba['dialPreviewUrl']||'','XMD-AGI':_0x4b43ba[_0x1d4d('0x21')]?util[_0x1d4d('0x13')](_0x1d4d('0x22'),ipAgi,_0x4b43ba['dialQueueProject']):_0x1d4d('0x23'),'XMD-AGIAFTER':_0x4b43ba['dialQueueProject2']?util['format'](_0x1d4d('0x22'),ipAgi,_0x4b43ba[_0x1d4d('0x1e')]):_0x1d4d('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x4de56f?_0x4de56f[_0x1d4d('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x4de56f?_0x4de56f[_0x1d4d('0x25')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0x1d4d('0x12')](_0x4b43ba[_0x1d4d('0x1f')])){_0x5a0f32[util['format']('%s',_0x1d4d('0x26'))]=_0x4b43ba[_0x1d4d('0x1f')];_0x5a0f32[util['format']('%s',_0x1d4d('0x27'))]=_0x3a2f35;}if(_0x482074&&_0x482074[_0x1d4d('0x28')]){for(var _0x89cd09 in _0x482074[_0x1d4d('0x28')]){if(_0x482074[_0x1d4d('0x28')][_0x1d4d('0x29')](_0x89cd09)){if(!_[_0x1d4d('0x17')](_0x482074['Contact'][_0x89cd09])&&_0x89cd09!=='id'&&_0x89cd09!==_0x1d4d('0x2a')&&_0x89cd09!==_0x1d4d('0x2b')&&_0x89cd09!=='updatedAt'){_0x5a0f32[util[_0x1d4d('0x13')]('%s%s',_0x1d4d('0x2c'),_[_0x1d4d('0x2d')](_0x89cd09))]=_0x482074[_0x1d4d('0x28')][_0x89cd09];}}}}return _0x5a0f32;};exports[_0x1d4d('0x2e')]=function(_0x1383ee){var _0x1df322={};for(var _0x28131f in _0x1383ee){if(_0x1383ee[_0x1d4d('0x29')](_0x28131f)){_0x1df322[util[_0x1d4d('0x13')]('%s',_['toLower'](_0x28131f))]=_0x1383ee[_0x28131f];}}return{'variables':_0x1df322};};exports['updateOriginated']=function(_0x5b1f4d,_0x5c3e71){if(!_[_0x1d4d('0x17')](_0x5b1f4d)){if(_0x5b1f4d[_0x1d4d('0x29')](_0x1d4d('0x2f'))){if(_0x5b1f4d[_0x1d4d('0x2f')]>0x0){_0x5b1f4d[_0x1d4d('0x2f')]-=0x1;}else{logger[_0x1d4d('0xd')](_0x1d4d('0x30'),_0x5c3e71);}}}else{logger[_0x1d4d('0xd')](_0x1d4d('0x31'),_0x5c3e71);}};exports[_0x1d4d('0x32')]=function(_0x29bfc0){var _0x1a1b20=moment()[_0x1d4d('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x29bfc0[_0x1d4d('0x33')]=0xd;_0x29bfc0['statedesc']=_0x1d4d('0x34');_0x29bfc0[_0x1d4d('0x35')]=_0x1a1b20;_0x29bfc0['responsetime']=_0x1a1b20;_0x29bfc0[_0x1d4d('0x36')]=_0x1a1b20;};exports['logAgent']=function(_0x82439a,_0x281f25,_0xc1eada){var _0x35d994=moment()['format'](_0x1d4d('0x37'));_0x82439a[_0x1d4d('0x33')]=_0x281f25;_0x82439a['statedesc']=_0xc1eada;_0x82439a[_0x1d4d('0x38')]=_0x35d994;_0x82439a[_0x1d4d('0x39')]=getSeconds(_0x82439a[_0x1d4d('0x38')],_0x82439a[_0x1d4d('0x35')]);};exports['logLookAgent']=function(_0x4d2956,_0x4a4510,_0x436f8a){_0x4d2956[_0x1d4d('0x3a')]=_0x4a4510;_0x4d2956[_0x1d4d('0x3b')]=_0x436f8a;};exports['logCustomer']=function(_0x5a7310,_0x1d6c5f,_0x108ded){var _0x55f05e=moment()[_0x1d4d('0x13')](_0x1d4d('0x37'));_0x5a7310[_0x1d4d('0x33')]=_0x1d6c5f;_0x5a7310[_0x1d4d('0x3c')]=_0x108ded;_0x5a7310[_0x1d4d('0x38')]=_0x5a7310[_0x1d4d('0x38')]?_0x5a7310['responsetime']:_0x55f05e;_0x5a7310[_0x1d4d('0x36')]=_0x5a7310[_0x1d4d('0x36')]?_0x5a7310[_0x1d4d('0x36')]:_0x55f05e;_0x5a7310['ringtime']=getSeconds(_0x5a7310[_0x1d4d('0x38')]||0x0,_0x5a7310[_0x1d4d('0x35')]||0x0);_0x5a7310['talktime']=_0x5a7310[_0x1d4d('0x3d')]?getSeconds(_0x5a7310[_0x1d4d('0x36')],_0x5a7310[_0x1d4d('0x3d')]):0x0;};exports[_0x1d4d('0x3e')]=function(_0x50f432){return _0x50f432==='Failure';};exports['variablesAction']=function(_0x4bc2d1,_0x18811e,_0x5a8738,_0x1258a6,_0x343feb){var _0x2ec420=_0x1258a6?_0x1d4d('0x3f'):_0x4bc2d1[_0x1d4d('0x40')];_0x2ec420=_0x343feb?_0x1d4d('0x41'):_0x2ec420;return{'actionid':_0x4bc2d1['uniqueid'],'action':_0x1d4d('0x42'),'channel':_0x4bc2d1[_0x1d4d('0x43')],'callerid':util[_0x1d4d('0x13')](_0x1d4d('0x1a'),_0x2ec420,_0x4bc2d1['calleridnum']),'Exten':_0x1d4d('0x44'),'Context':_0x1d4d('0x45'),'Priority':'1','variable':_0x5a8738,'timeout':(_0x18811e[_0x1d4d('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4bc2d1[_0x1d4d('0x47')]};};exports[_0x1d4d('0x48')]=function(_0xd1d52d){return _0xd1d52d['countbusyretry']+_0xd1d52d[_0x1d4d('0x49')]+_0xd1d52d[_0x1d4d('0x4a')];};exports[_0x1d4d('0x4b')]=function(_0x49cfdb){var _0x17cfcf=_['clone'](_0x49cfdb);_0x17cfcf['state']=0xf;_0x17cfcf[_0x1d4d('0x3c')]=_0x1d4d('0x4c');return _0x17cfcf;};exports['scheduledAt']=function(_0x50b3c9,_0xba2835,_0x4e19e0){var _0x2e0a57={};_0x2e0a57[_0xba2835]=_0x50b3c9[_0xba2835];_0x2e0a57[_0x1d4d('0x4d')]=![];_0x2e0a57[_0x1d4d('0x4e')]=moment()[_0x1d4d('0x4f')](_0x4e19e0,'minutes')[_0x1d4d('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x2e0a57['ContactId']=_0x50b3c9['ContactId'];_0x2e0a57[_0x1d4d('0x50')]=_0x50b3c9[_0x1d4d('0x50')];_0x2e0a57[_0x1d4d('0x1c')]=_0x50b3c9[_0x1d4d('0x1c')]||undefined;return _0x2e0a57;};exports[_0x1d4d('0x51')]=function(_0x628fa3,_0x3d9e3a){if(!_[_0x1d4d('0x17')](_0x628fa3)){if(_0x628fa3[_0x1d4d('0x52')]>0x0){_0x628fa3[_0x1d4d('0x52')]-=0x1;}else{logger[_0x1d4d('0xd')](_0x3d9e3a,_0x1d4d('0x53'));}}else{logger[_0x1d4d('0xd')](_0x3d9e3a,_0x1d4d('0x54'));}};exports['IsNotLoggedIn']=function(_0x5ed40f){if(_0x5ed40f<=0x0){return!![];}return![];};exports[_0x1d4d('0x55')]=function(_0x6a0612,_0x2ce12c){_0x6a0612[_0x1d4d('0x56')]=_0x2ce12c;_0x6a0612[_0x1d4d('0x19')]=_0x6a0612[_0x1d4d('0x57')];_0x6a0612[_0x1d4d('0x58')]=_0x6a0612['channelAgent'];return _0x6a0612;};exports['buildAcw']=function(_0x41f071){var _0x56d63f={};_0x56d63f[_0x1d4d('0x57')]=_0x41f071[_0x1d4d('0x57')];_0x56d63f['interface']=_0x41f071['channelAgent'];_0x56d63f[_0x1d4d('0x47')]=_0x41f071[_0x1d4d('0x47')];return _0x56d63f;};exports[_0x1d4d('0x59')]=function(_0x1a530b){var _0x58db33=[];for(var _0x208a6b in _0x1a530b){if(_0x1a530b['hasOwnProperty'](_0x208a6b)){if(!_[_0x1d4d('0x17')](_0x1a530b[_0x208a6b])&&_0x1a530b[_0x208a6b][_0x1d4d('0x33')]===_0x1d4d('0x5a')&&_0x1a530b[_0x208a6b][_0x1d4d('0x5b')]===_0x1d4d('0x5c')){_0x58db33[_0x1d4d('0x5d')](_0x1a530b[_0x208a6b]['id']);}}}return _0x58db33;};exports['getDiff']=function(_0x36f24e){var _0x4ae4e1=moment()['milliseconds'](0x0);var _0x2d30a5=moment(_0x36f24e)['milliseconds'](0x0);return _0x4ae4e1[_0x1d4d('0x7')](_0x2d30a5,_0x1d4d('0x5e'));};exports[_0x1d4d('0x5f')]=function(_0x1aae7f){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1aae7f[_0x1d4d('0x60')],'ListId':_0x1aae7f[_0x1d4d('0x50')],'VoiceQueueId':_0x1aae7f['VoiceQueueId']||undefined,'CampaignId':_0x1aae7f[_0x1d4d('0x61')]||undefined};};exports[_0x1d4d('0x62')]=function(_0x1b15b3){if(_0x1b15b3===_0x1d4d('0x47')||_0x1b15b3===_0x1d4d('0x63')||_0x1b15b3===_0x1d4d('0x57')||_0x1b15b3==='type'||_0x1b15b3===_0x1d4d('0x64')||_0x1b15b3===_0x1d4d('0x65')||_0x1b15b3===_0x1d4d('0x3a')||_0x1b15b3===_0x1d4d('0x43')||_0x1b15b3===_0x1d4d('0x40')||_0x1b15b3===_0x1d4d('0x4d')||_0x1b15b3===_0x1d4d('0x1b')||_0x1b15b3===_0x1d4d('0x4e')||_0x1b15b3==='countbusyretry'||_0x1b15b3===_0x1d4d('0x49')||_0x1b15b3===_0x1d4d('0x4a')||_0x1b15b3===_0x1d4d('0x66')||_0x1b15b3===_0x1d4d('0x67')||_0x1b15b3===_0x1d4d('0x68')||_0x1b15b3===_0x1d4d('0x69')||_0x1b15b3==='recallme'||_0x1b15b3===_0x1d4d('0x60')||_0x1b15b3===_0x1d4d('0x50')||_0x1b15b3===_0x1d4d('0x3b')||_0x1b15b3===_0x1d4d('0x1c')||_0x1b15b3===_0x1d4d('0x6a')||_0x1b15b3===_0x1d4d('0x6b')||_0x1b15b3==='xmd-queue'||_0x1b15b3===_0x1d4d('0x6c')||_0x1b15b3==='xmd-listid'||_0x1b15b3==='xmd-dialurl'||_0x1b15b3===_0x1d4d('0x6d')||_0x1b15b3===_0x1d4d('0x6e')||_0x1b15b3==='xmd-dialid'||_0x1b15b3===_0x1d4d('0x6f')||_0x1b15b3==='xmd-contactid'||_0x1b15b3===_0x1d4d('0x70')||_0x1b15b3===_0x1d4d('0x71')||_0x1b15b3===_0x1d4d('0x72')||_0x1b15b3===_0x1d4d('0x73')||_0x1b15b3==='rtpaudioqos'||_0x1b15b3==='rtpaudioqosbridged'||_0x1b15b3===_0x1d4d('0x74')||_0x1b15b3===_0x1d4d('0x75')||_0x1b15b3===_0x1d4d('0x76')||_0x1b15b3===_0x1d4d('0x77')||_0x1b15b3===_0x1d4d('0x78')||_0x1b15b3===_0x1d4d('0x79')||_0x1b15b3===_0x1d4d('0x7a')||_0x1b15b3==='rtpaudioqosbridged'||_0x1b15b3==='rtpaudioqosjitter'||_0x1b15b3==='rtpaudioqosjitterbridged'||_0x1b15b3===_0x1d4d('0x76')||_0x1b15b3==='rtpaudioqoslossbridged'||_0x1b15b3===_0x1d4d('0x78')||_0x1b15b3===_0x1d4d('0x79')||_0x1b15b3==='bridgepeer'||_0x1b15b3===_0x1d4d('0x7b')||_0x1b15b3===_0x1d4d('0x33')||_0x1b15b3===_0x1d4d('0x3c')){return![];}return!![];};exports[_0x1d4d('0x7c')]=function(_0x48d085,_0x4beca3){var _0x52ccba,_0x24d090,_0x23d621;if(_0x4beca3<=0x0){_0x4beca3=0x1;}_0x52ccba=new RegExp('\x5cw{0,'+_0x4beca3+'}$');_0x24d090=Math[_0x1d4d('0x7d')](0xa,_0x4beca3-0x1);_0x23d621=Math[_0x1d4d('0x7d')](0xa,_0x4beca3)-0x1;return util[_0x1d4d('0x13')]('%s',_[_0x1d4d('0x7e')](_0x48d085,_0x52ccba,_[_0x1d4d('0x7f')](_0x24d090,_0x23d621)));};exports[_0x1d4d('0x80')]=function(_0xc6a7f8){var _0x36bd1e=_0xc6a7f8[_0x1d4d('0x81')](/"(.*?)"/);return _0x36bd1e?_0x36bd1e[0x1]:_0xc6a7f8;};exports[_0x1d4d('0x82')]=function(_0x1e4c1f){var _0x41cad8=_0x1e4c1f[_0x1d4d('0x81')](/<(.*?)>/);return _0x41cad8?_0x41cad8[0x1]:_0x1e4c1f;};
\ No newline at end of file
+var _0x77f2=['lastevent','interface','buildAcw','not_inuse','status','push','getDiff','diff','filterKey','idContact','countbusyretry','countnoanswerretry','countglobal','callbackat','recallme','UserId','xmd-queue','xmd-phone','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','random','extractCalleridNumber','match','lodash','../../../../config/logger','preview','milliseconds','seconds','loggerCatch','error','inspect','logger','loggerError','logger2','message','getCallerId','isUndefined','isEmpty','format','string','isNil','addVariables','Queue','\x22%s\x22\x20<%s>','calleridname','calleridnum','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','Contact','createdAt','updatedAt','%s%s','XMD-','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','membername','logCustomer','YYYY-MM-DD\x20HH:mm:ss','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','channelAgent','from-sip','timeout','countcongestionretry','cloneAction','scheduledAt','active','minutes','ContactId','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj'];(function(_0x30b825,_0x50661c){var _0x101c55=function(_0x546ab6){while(--_0x546ab6){_0x30b825['push'](_0x30b825['shift']());}};_0x101c55(++_0x50661c);}(_0x77f2,0x188));var _0x277f=function(_0x3be2e2,_0x5c166d){_0x3be2e2=_0x3be2e2-0x0;var _0x53b9c5=_0x77f2[_0x3be2e2];return _0x53b9c5;};'use strict';var util=require('util');var _=require(_0x277f('0x0'));var moment=require('moment');var logger=require(_0x277f('0x1'))(_0x277f('0x2'));var ipAgi=process['env']['XCALLY_IP_AGI']||'127.0.0.1';function getSeconds(_0x148ab0,_0x26bc5b){var _0x59fd13=moment(_0x148ab0)[_0x277f('0x3')](0x0);var _0x4e3fa5=moment(_0x26bc5b)['milliseconds'](0x0);return _0x59fd13['diff'](_0x4e3fa5,_0x277f('0x4'));}exports[_0x277f('0x5')]=function(_0x422495){return function(_0x548c80){logger[_0x277f('0x6')](_0x422495,util[_0x277f('0x7')](_0x548c80,{'showHidden':![],'depth':null}));};};exports[_0x277f('0x8')]=function(_0x137076,_0x374c3d){logger['info'](_0x137076,util[_0x277f('0x7')](_0x374c3d,{'showHidden':![],'depth':null}));};exports[_0x277f('0x9')]=function(_0xdbb809,_0x1dcd34){logger[_0x277f('0x6')](_0xdbb809,util[_0x277f('0x7')](_0x1dcd34,{'showHidden':![],'depth':null}));};exports[_0x277f('0xa')]=function(_0x39d884){return function(_0x469287){logger['info'](_0x39d884,util[_0x277f('0x7')](_0x469287,{'showHidden':![],'depth':null}));};};exports[_0x277f('0xb')]=function(_0x1e4a07,_0x1c5b75,_0x1b5673){return{'message':_0x1e4a07,'unlock':_0x1c5b75,'active':_0x1b5673};};exports[_0x277f('0xc')]=function(_0x1f57da,_0x47c7d0,_0x2bafd9){if(!_[_0x277f('0xd')](_0x2bafd9)&&'string'===typeof _0x2bafd9&&!_[_0x277f('0xe')](_0x2bafd9)){if(!_[_0x277f('0xd')](_0x47c7d0)&&'string'===typeof _0x47c7d0&&!_[_0x277f('0xe')](_0x47c7d0)){return util[_0x277f('0xf')]('\x22%s\x22\x20<%s>',_0x47c7d0,_0x2bafd9);}return util[_0x277f('0xf')]('\x22%s\x22\x20<%s>',_0x2bafd9,_0x2bafd9);}if(!_[_0x277f('0xd')](_0x1f57da)&&_0x277f('0x10')===typeof _0x1f57da&&!_[_0x277f('0xe')](_0x1f57da)){return _0x1f57da;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x4780d3){if(_[_0x277f('0x11')](_0x4780d3)){return![];}return _0x4780d3;};exports[_0x277f('0x12')]=function(_0x29f4c7,_0x49dfc8,_0x412b86,_0x76e72f,_0x179ba2,_0xd40589){var _0x59b8ae={'XMD-QUEUE':_0x49dfc8[_0x277f('0x13')]?_0x49dfc8['Queue']['name']:'','XMD-CALLERID':_0x76e72f,'XMD-CALLERID-PREVIEW':_0xd40589?util[_0x277f('0xf')](_0x277f('0x14'),_0xd40589[_0x277f('0x15')],_0xd40589[_0x277f('0x16')]):_0x76e72f,'XMD-DIALID':_0x179ba2,'XMD-CONTACTID':_0x49dfc8['ContactId'],'XMD-CDRTYPE':_0x277f('0x17'),'CALLERID(all)':_0x76e72f,'XMD-VOICEQUEUEID':_0x49dfc8['VoiceQueueId'],'XMD-DIALCHANNEL':_0x412b86,'XMD-DIALTIMEOUT':_0x29f4c7[_0x277f('0x18')]||0x1e,'XMD-DIALOPTIONS':util[_0x277f('0xf')](_0x277f('0x19'),_0x29f4c7[_0x277f('0x1a')]?'g':'',_[_0x277f('0xe')](_0x29f4c7['monitor_format'])?'':_0x277f('0x1b')),'XMD-DIALURL':_0x29f4c7[_0x277f('0x1c')]||'','XMD-AGI':_0x29f4c7[_0x277f('0x1d')]?util[_0x277f('0xf')](_0x277f('0x1e'),ipAgi,_0x29f4c7['dialQueueProject']):_0x277f('0x1f'),'XMD-AGIAFTER':_0x29f4c7['dialQueueProject2']?util['format'](_0x277f('0x1e'),ipAgi,_0x29f4c7['dialQueueProject2']):_0x277f('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0xd40589?_0xd40589[_0x277f('0x20')]:'','XMD-ORIGINATECALLERIDNAME':_0xd40589?_0xd40589['originatecalleridname']:'','XMD-DESTINATION':_0x277f('0x21')};if(!_[_0x277f('0xe')](_0x29f4c7['monitor_format'])){_0x59b8ae[util[_0x277f('0xf')]('%s',_0x277f('0x22'))]=_0x29f4c7[_0x277f('0x23')];_0x59b8ae[util[_0x277f('0xf')]('%s',_0x277f('0x24'))]=_0x179ba2;}if(_0x49dfc8&&_0x49dfc8[_0x277f('0x25')]){for(var _0x326f7e in _0x49dfc8[_0x277f('0x25')]){if(_0x49dfc8[_0x277f('0x25')]['hasOwnProperty'](_0x326f7e)){if(!_['isNil'](_0x49dfc8[_0x277f('0x25')][_0x326f7e])&&_0x326f7e!=='id'&&_0x326f7e!=='tags'&&_0x326f7e!==_0x277f('0x26')&&_0x326f7e!==_0x277f('0x27')){_0x59b8ae[util['format'](_0x277f('0x28'),_0x277f('0x29'),_['toUpper'](_0x326f7e))]=_0x49dfc8[_0x277f('0x25')][_0x326f7e];}}}}return _0x59b8ae;};exports[_0x277f('0x2a')]=function(_0x31b17c){var _0x4e3a15={};for(var _0x4bbfac in _0x31b17c){if(_0x31b17c[_0x277f('0x2b')](_0x4bbfac)){_0x4e3a15[util[_0x277f('0xf')]('%s',_[_0x277f('0x2c')](_0x4bbfac))]=_0x31b17c[_0x4bbfac];}}return{'variables':_0x4e3a15};};exports[_0x277f('0x2d')]=function(_0x362b57,_0x59e8ee){if(!_[_0x277f('0x11')](_0x362b57)){if(_0x362b57[_0x277f('0x2b')](_0x277f('0x2e'))){if(_0x362b57[_0x277f('0x2e')]>0x0){_0x362b57[_0x277f('0x2e')]-=0x1;}else{logger[_0x277f('0x6')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x59e8ee);}}}else{logger[_0x277f('0x6')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x59e8ee);}};exports[_0x277f('0x2f')]=function(_0x1c6448){var _0x5376ff=moment()[_0x277f('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c6448[_0x277f('0x30')]=0xd;_0x1c6448[_0x277f('0x31')]=_0x277f('0x32');_0x1c6448[_0x277f('0x33')]=_0x5376ff;_0x1c6448[_0x277f('0x34')]=_0x5376ff;_0x1c6448[_0x277f('0x35')]=_0x5376ff;};exports[_0x277f('0x36')]=function(_0x5b40f8,_0x52955a,_0x4a83f7){var _0x18e45d=moment()[_0x277f('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x5b40f8[_0x277f('0x30')]=_0x52955a;_0x5b40f8[_0x277f('0x31')]=_0x4a83f7;_0x5b40f8[_0x277f('0x34')]=_0x18e45d;_0x5b40f8[_0x277f('0x37')]=getSeconds(_0x5b40f8[_0x277f('0x34')],_0x5b40f8[_0x277f('0x33')]);};exports['logLookAgent']=function(_0x377d0d,_0xfeeea6,_0x3fdf49){_0x377d0d[_0x277f('0x38')]=_0xfeeea6;_0x377d0d['UserId']=_0x3fdf49;};exports[_0x277f('0x39')]=function(_0x4d2999,_0x35a8b7,_0x38ec96){var _0x157025=moment()[_0x277f('0xf')](_0x277f('0x3a'));_0x4d2999[_0x277f('0x30')]=_0x35a8b7;_0x4d2999[_0x277f('0x31')]=_0x38ec96;_0x4d2999[_0x277f('0x34')]=_0x4d2999['responsetime']?_0x4d2999['responsetime']:_0x157025;_0x4d2999[_0x277f('0x35')]=_0x4d2999[_0x277f('0x35')]?_0x4d2999['endtime']:_0x157025;_0x4d2999[_0x277f('0x37')]=getSeconds(_0x4d2999[_0x277f('0x34')]||0x0,_0x4d2999[_0x277f('0x33')]||0x0);_0x4d2999['talktime']=_0x4d2999[_0x277f('0x3b')]?getSeconds(_0x4d2999[_0x277f('0x35')],_0x4d2999[_0x277f('0x3b')]):0x0;};exports['isFailure']=function(_0x55d0a2){return _0x55d0a2===_0x277f('0x3c');};exports[_0x277f('0x3d')]=function(_0x3ace4d,_0x7acb45,_0x16fca4,_0x3b7cab,_0x2e1319){var _0x580e47=_0x3b7cab?_0x277f('0x3e'):_0x3ace4d['calleridname'];_0x580e47=_0x2e1319?_0x277f('0x3f'):_0x580e47;return{'actionid':_0x3ace4d[_0x277f('0x40')],'action':'originate','channel':_0x3ace4d[_0x277f('0x41')],'callerid':util[_0x277f('0xf')](_0x277f('0x14'),_0x580e47,_0x3ace4d['calleridnum']),'Exten':'xcally-motion-preview','Context':_0x277f('0x42'),'Priority':'1','variable':_0x16fca4,'timeout':(_0x7acb45[_0x277f('0x43')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3ace4d[_0x277f('0x40')]};};exports['totalGlobal']=function(_0x18c737){return _0x18c737['countbusyretry']+_0x18c737[_0x277f('0x44')]+_0x18c737['countnoanswerretry'];};exports[_0x277f('0x45')]=function(_0x378858){var _0x131ae1=_['clone'](_0x378858);_0x131ae1[_0x277f('0x30')]=0xf;_0x131ae1[_0x277f('0x31')]='Global';return _0x131ae1;};exports[_0x277f('0x46')]=function(_0x1a2b16,_0x1be7d7,_0x33b7cd){var _0x39b80c={};_0x39b80c[_0x1be7d7]=_0x1a2b16[_0x1be7d7];_0x39b80c[_0x277f('0x47')]=![];_0x39b80c['scheduledat']=moment()['add'](_0x33b7cd,_0x277f('0x48'))[_0x277f('0xf')](_0x277f('0x3a'));_0x39b80c[_0x277f('0x49')]=_0x1a2b16['ContactId'];_0x39b80c[_0x277f('0x4a')]=_0x1a2b16[_0x277f('0x4a')];_0x39b80c[_0x277f('0x4b')]=_0x1a2b16[_0x277f('0x4b')]||undefined;return _0x39b80c;};exports['decrementTalkink']=function(_0x185597,_0x5cd1fa){if(!_['isNil'](_0x185597)){if(_0x185597[_0x277f('0x4c')]>0x0){_0x185597[_0x277f('0x4c')]-=0x1;}else{logger[_0x277f('0x6')](_0x5cd1fa,_0x277f('0x4d'));}}else{logger['error'](_0x5cd1fa,_0x277f('0x4e'));}};exports['IsNotLoggedIn']=function(_0x1c1c4c){if(_0x1c1c4c<=0x0){return!![];}return![];};exports[_0x277f('0x4f')]=function(_0x4360a7,_0x174b66){_0x4360a7[_0x277f('0x50')]=_0x174b66;_0x4360a7['name']=_0x4360a7['queue'];_0x4360a7[_0x277f('0x51')]=_0x4360a7[_0x277f('0x41')];return _0x4360a7;};exports[_0x277f('0x52')]=function(_0x16b801){var _0x3117ef={};_0x3117ef['queue']=_0x16b801['queue'];_0x3117ef[_0x277f('0x51')]=_0x16b801[_0x277f('0x41')];_0x3117ef[_0x277f('0x40')]=_0x16b801[_0x277f('0x40')];return _0x3117ef;};exports['agentReadyId']=function(_0x3f1eb2){var _0x40c038=[];for(var _0x4f5ef4 in _0x3f1eb2){if(_0x3f1eb2[_0x277f('0x2b')](_0x4f5ef4)){if(!_['isNil'](_0x3f1eb2[_0x4f5ef4])&&_0x3f1eb2[_0x4f5ef4][_0x277f('0x30')]===_0x277f('0x53')&&_0x3f1eb2[_0x4f5ef4][_0x277f('0x54')]==='reachable'){_0x40c038[_0x277f('0x55')](_0x3f1eb2[_0x4f5ef4]['id']);}}}return _0x40c038;};exports[_0x277f('0x56')]=function(_0x183cd9){var _0x4d359a=moment()[_0x277f('0x3')](0x0);var _0x13ad53=moment(_0x183cd9)['milliseconds'](0x0);return _0x4d359a[_0x277f('0x57')](_0x13ad53,_0x277f('0x4'));};exports['createBody']=function(_0x2a67c8){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2a67c8[_0x277f('0x49')],'ListId':_0x2a67c8['ListId'],'VoiceQueueId':_0x2a67c8[_0x277f('0x4b')]||undefined,'CampaignId':_0x2a67c8['CampaignId']||undefined};};exports[_0x277f('0x58')]=function(_0x2b1e8d){if(_0x2b1e8d===_0x277f('0x40')||_0x2b1e8d===_0x277f('0x59')||_0x2b1e8d==='queue'||_0x2b1e8d==='type'||_0x2b1e8d==='campaigntype'||_0x2b1e8d==='dialAnswer'||_0x2b1e8d===_0x277f('0x38')||_0x2b1e8d===_0x277f('0x41')||_0x2b1e8d===_0x277f('0x15')||_0x2b1e8d==='active'||_0x2b1e8d===_0x277f('0x16')||_0x2b1e8d==='scheduledat'||_0x2b1e8d===_0x277f('0x5a')||_0x2b1e8d===_0x277f('0x44')||_0x2b1e8d===_0x277f('0x5b')||_0x2b1e8d===_0x277f('0x5c')||_0x2b1e8d==='callback'||_0x2b1e8d==='callbackuniqueid'||_0x2b1e8d===_0x277f('0x5d')||_0x2b1e8d===_0x277f('0x5e')||_0x2b1e8d===_0x277f('0x49')||_0x2b1e8d==='ListId'||_0x2b1e8d===_0x277f('0x5f')||_0x2b1e8d===_0x277f('0x4b')||_0x2b1e8d==='sipcallid'||_0x2b1e8d==='xmd-voicequeueid'||_0x2b1e8d===_0x277f('0x60')||_0x2b1e8d===_0x277f('0x61')||_0x2b1e8d==='xmd-listid'||_0x2b1e8d==='xmd-dialurl'||_0x2b1e8d===_0x277f('0x62')||_0x2b1e8d===_0x277f('0x63')||_0x2b1e8d==='xmd-dialid'||_0x2b1e8d===_0x277f('0x64')||_0x2b1e8d===_0x277f('0x65')||_0x2b1e8d===_0x277f('0x66')||_0x2b1e8d===_0x277f('0x67')||_0x2b1e8d===_0x277f('0x68')||_0x2b1e8d==='xmd-agi'||_0x2b1e8d===_0x277f('0x69')||_0x2b1e8d===_0x277f('0x6a')||_0x2b1e8d==='rtpaudioqosjitter'||_0x2b1e8d==='rtpaudioqosjitterbridged'||_0x2b1e8d===_0x277f('0x6b')||_0x2b1e8d===_0x277f('0x6c')||_0x2b1e8d===_0x277f('0x6d')||_0x2b1e8d===_0x277f('0x6e')||_0x2b1e8d===_0x277f('0x69')||_0x2b1e8d===_0x277f('0x6a')||_0x2b1e8d==='rtpaudioqosjitter'||_0x2b1e8d==='rtpaudioqosjitterbridged'||_0x2b1e8d==='rtpaudioqosloss'||_0x2b1e8d===_0x277f('0x6c')||_0x2b1e8d==='rtpaudioqosrtt'||_0x2b1e8d===_0x277f('0x6e')||_0x2b1e8d===_0x277f('0x6f')||_0x2b1e8d===_0x277f('0x70')||_0x2b1e8d===_0x277f('0x30')||_0x2b1e8d===_0x277f('0x31')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x1faf7e,_0x1ea330){var _0x109ed1,_0x524fe7,_0x5170ac;if(_0x1ea330<=0x0){_0x1ea330=0x1;}_0x109ed1=new RegExp(_0x277f('0x71')+_0x1ea330+'}$');_0x524fe7=Math[_0x277f('0x72')](0xa,_0x1ea330-0x1);_0x5170ac=Math[_0x277f('0x72')](0xa,_0x1ea330)-0x1;return util['format']('%s',_['replace'](_0x1faf7e,_0x109ed1,_[_0x277f('0x73')](_0x524fe7,_0x5170ac)));};exports['extractCalleridName']=function(_0x43387e){var _0x4ca4b9=_0x43387e['match'](/"(.*?)"/);return _0x4ca4b9?_0x4ca4b9[0x1]:_0x43387e;};exports[_0x277f('0x74')]=function(_0x5702bc){var _0x230c82=_0x5702bc[_0x277f('0x75')](/<(.*?)>/);return _0x230c82?_0x230c82[0x1]:_0x5702bc;};
\ No newline at end of file
index 2d8b1c4..4cafeea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcbd=['voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','voicequeuechannel','voicechannel'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xfcbd,0x160));var _0xdfcb=function(_0x11a9b5,_0x18e003){_0x11a9b5=_0x11a9b5-0x0;var _0x1d1573=_0xfcbd[_0x11a9b5];return _0x1d1573;};'use strict';exports[_0xdfcb('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xdfcb('0x1'),'required':!![]},'penalty':{'type':_0xdfcb('0x2'),'required':![]},'paused':{'type':_0xdfcb('0x3'),'required':![]}};exports[_0xdfcb('0x4')]={'queue':{'type':_0xdfcb('0x1'),'required':!![]},'interface':{'type':_0xdfcb('0x1'),'required':!![]}};exports[_0xdfcb('0x5')]={'interface':{'type':_0xdfcb('0x1'),'required':!![]},'paused':{'type':_0xdfcb('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0xdfcb('0x1'),'required':![]}};exports[_0xdfcb('0x6')]={'uniqueid':{'type':_0xdfcb('0x1'),'required':!![]}};exports[_0xdfcb('0x7')]={'uniqueid':{'type':_0xdfcb('0x1'),'required':!![]},'filename':{'type':_0xdfcb('0x1')},'format':{'type':_0xdfcb('0x1')},'mixmonitorid':{'type':'string'}};exports[_0xdfcb('0x8')]={'uniqueid':{'type':_0xdfcb('0x1'),'required':!![]}};exports[_0xdfcb('0x9')]={'uniqueid':{'type':_0xdfcb('0x1'),'required':!![]},'exten':{'type':_0xdfcb('0x1'),'required':!![]},'context':{'type':_0xdfcb('0x1')}};
\ No newline at end of file
+var _0xe132=['reload','voicequeuechannel','voicechannel','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause'];(function(_0x36519a,_0x264ce2){var _0x43a91e=function(_0x320b05){while(--_0x320b05){_0x36519a['push'](_0x36519a['shift']());}};_0x43a91e(++_0x264ce2);}(_0xe132,0x162));var _0x2e13=function(_0x2464a2,_0x2d8367){_0x2464a2=_0x2464a2-0x0;var _0x4a8a8a=_0xe132[_0x2464a2];return _0x4a8a8a;};'use strict';exports[_0x2e13('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x2e13('0x1'),'required':!![]},'membername':{'type':_0x2e13('0x1'),'required':!![]},'penalty':{'type':_0x2e13('0x2'),'required':![]},'paused':{'type':_0x2e13('0x3'),'required':![]}};exports[_0x2e13('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x2e13('0x1'),'required':!![]}};exports[_0x2e13('0x5')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x2e13('0x1'),'required':![]}};exports[_0x2e13('0x6')]={'module':{'type':_0x2e13('0x1'),'required':![]}};exports[_0x2e13('0x7')]={'uniqueid':{'type':_0x2e13('0x1'),'required':!![]}};exports[_0x2e13('0x8')]={'uniqueid':{'type':_0x2e13('0x1'),'required':!![]},'filename':{'type':_0x2e13('0x1')},'format':{'type':_0x2e13('0x1')},'mixmonitorid':{'type':_0x2e13('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x2e13('0x1'),'required':!![]}};exports[_0x2e13('0x9')]={'uniqueid':{'type':_0x2e13('0x1'),'required':!![]},'exten':{'type':_0x2e13('0x1'),'required':!![]},'context':{'type':_0x2e13('0x1')}};
\ No newline at end of file
index e3faaa7..d764e17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0553=['queuecallerexit','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','initVoiceExtensions','initFaxAccounts','exports','bluebird','../model/trunk','../model/voiceQueue','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/faxAccount','agents','telephones','trunks','triggers','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','total','answered','sumHoldTime','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','unmanaged','sumDuration','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initTrunks','initVoiceQueues','voiceQueues','initTriggers','initTemplates','templates','initZendeskAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','merge','initVoiceQueueReports','groupBy','uniqueid','queue'];(function(_0x3b711c,_0x4b22dc){var _0x2685f0=function(_0x3b5ba6){while(--_0x3b5ba6){_0x3b711c['push'](_0x3b711c['shift']());}};_0x2685f0(++_0x4b22dc);}(_0x0553,0x6b));var _0x3055=function(_0x36cba4,_0x53a452){_0x36cba4=_0x36cba4-0x0;var _0xcc6047=_0x0553[_0x36cba4];return _0xcc6047;};'use strict';var BPromise=require(_0x3055('0x0'));var util=require('util');var _=require('lodash');var moment=require('moment');var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require(_0x3055('0x1'));var VoiceQueue=require(_0x3055('0x2'));var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require(_0x3055('0x3'));var VoiceExtension=require(_0x3055('0x4'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x3055('0x5'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x3055('0x6'));var ZohoAccount=require(_0x3055('0x7'));var DeskAccount=require(_0x3055('0x8'));var VtigerAccount=require('../model/vtigerAccount');var FaxAccount=require(_0x3055('0x9'));var Realtime=function(){this[_0x3055('0xa')]={};this[_0x3055('0xb')]={};this[_0x3055('0xc')]={};this['voiceQueues']={};this[_0x3055('0xd')]={};this['campaigns']={};this['templates']={};this[_0x3055('0xe')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x3055('0xf')]={};this[_0x3055('0x10')]={};this[_0x3055('0x11')]={};this[_0x3055('0x12')]={};this[_0x3055('0x13')]={};this[_0x3055('0x14')]={};this['salesforceAccounts']={};this[_0x3055('0x15')]={};this[_0x3055('0x16')]={};this[_0x3055('0x17')]={};this[_0x3055('0x18')]={};this[_0x3055('0x19')]={};this[_0x3055('0x1a')]={};};function freeIsNotKey(_0x5d2065,_0x416739,_0x20ca34){var _0x4826dc=_[_0x3055('0x1b')](_0x5d2065,function(_0x301775,_0x3fc24f){return _0x301775[_0x20ca34];});for(var _0x41559b in _0x416739){if(_0x416739[_0x3055('0x1c')](_0x41559b)){if(!_0x4826dc[_0x41559b]){delete _0x416739[_0x41559b];}}}}function freeIsNotKeySip(_0x137b15,_0x28a1ea){var _0x3f4f75=_[_0x3055('0x1b')](_0x137b15,function(_0x51f37d,_0x58cc12){return util[_0x3055('0x1d')](_0x3055('0x1e'),_0x51f37d[_0x3055('0x1f')]);});for(var _0x4dc688 in _0x28a1ea){if(_0x28a1ea[_0x3055('0x1c')](_0x4dc688)){if(!_0x3f4f75[_0x4dc688]){delete _0x28a1ea[_0x4dc688];}}}}function clearVoiceCallReports(_0x381ba0){_0x381ba0[_0x3055('0x20')]=0x0;_0x381ba0[_0x3055('0x21')]=0x0;_0x381ba0[_0x3055('0x22')]=0x0;_0x381ba0['sumDuration']=0x0;_0x381ba0[_0x3055('0x23')]=0x0;}function clearCampaigns(_0x26f74e){if(!_['isEmpty'](_0x26f74e)){for(var _0x51d6d5 in _0x26f74e){if(_0x26f74e[_0x3055('0x1c')](_0x51d6d5)){_0x26f74e[_0x51d6d5][_0x3055('0x24')]=0x0;_0x26f74e[_0x51d6d5][_0x3055('0x25')]=0x0;}}}}function clearVoiceQueues(_0x40b506){if(!_[_0x3055('0x26')](_0x40b506)){for(var _0x2c04ab in _0x40b506){if(_0x40b506[_0x3055('0x1c')](_0x2c04ab)){_0x40b506[_0x2c04ab][_0x3055('0x20')]=0x0;_0x40b506[_0x2c04ab][_0x3055('0x21')]=0x0;_0x40b506[_0x2c04ab][_0x3055('0x27')]=0x0;_0x40b506[_0x2c04ab][_0x3055('0x22')]=0x0;_0x40b506[_0x2c04ab][_0x3055('0x28')]=0x0;_0x40b506[_0x2c04ab]['sumBillable']=0x0;_0x40b506[_0x2c04ab]['outboundAnswerAgiCallsDay']=0x0;_0x40b506[_0x2c04ab][_0x3055('0x29')]=0x0;_0x40b506[_0x2c04ab][_0x3055('0x2a')]=0x0;_0x40b506[_0x2c04ab][_0x3055('0x2b')]=0x0;_0x40b506[_0x2c04ab]['outboundNoSuchCallsDay']=0x0;_0x40b506[_0x2c04ab][_0x3055('0x2c')]=0x0;_0x40b506[_0x2c04ab][_0x3055('0x2d')]=0x0;_0x40b506[_0x2c04ab][_0x3055('0x2e')]=0x0;_0x40b506[_0x2c04ab][_0x3055('0x2f')]=0x0;_0x40b506[_0x2c04ab][_0x3055('0x30')]=0x0;_0x40b506[_0x2c04ab]['outboundRejectCallsDay']=0x0;_0x40b506[_0x2c04ab][_0x3055('0x31')]=0x0;_0x40b506[_0x2c04ab][_0x3055('0x32')]=0x0;_0x40b506[_0x2c04ab][_0x3055('0x33')]=0x0;_0x40b506[_0x2c04ab]['queueStatusComplete']=!![];}}}}Realtime[_0x3055('0x34')][_0x3055('0x35')]=function(_0x450c30,_0x45aba7){for(var _0x4b9701 in _0x45aba7){if(_0x450c30[_0x3055('0x1c')](_0x4b9701)){_0x450c30[_0x4b9701]=_0x45aba7[_0x4b9701];}}};Realtime[_0x3055('0x34')][_0x3055('0x36')]=function(){var _0x18e485=this;return function(_0x49afc6){if(_0x49afc6){freeIsNotKeySip(_0x49afc6,_0x18e485[_0x3055('0xa')]);for(var _0x35f13d=0x0,_0x4e4f57={},_0x2bb292={};_0x35f13d<_0x49afc6[_0x3055('0x37')];_0x35f13d+=0x1){_0x4e4f57=_0x49afc6[_0x35f13d];if(_[_0x3055('0x38')](_0x18e485[_0x3055('0xa')][util[_0x3055('0x1d')](_0x3055('0x1e'),_0x4e4f57[_0x3055('0x1f')])])){_0x18e485[_0x3055('0xa')][util[_0x3055('0x1d')](_0x3055('0x1e'),_0x4e4f57[_0x3055('0x1f')])]=new Agent(_0x4e4f57);}else{_0x18e485[_0x3055('0x35')](_0x18e485[_0x3055('0xa')][util[_0x3055('0x1d')](_0x3055('0x1e'),_0x4e4f57[_0x3055('0x1f')])],_0x4e4f57);}}}return _0x18e485['agents'];};};Realtime['prototype'][_0x3055('0x39')]=function(){var _0x969c51=this;return function(_0x491d91){if(_0x491d91){freeIsNotKeySip(_0x491d91,_0x969c51['telephones']);for(var _0x2dda08=0x0,_0x4eaa68={},_0x509d54={};_0x2dda08<_0x491d91[_0x3055('0x37')];_0x2dda08+=0x1){_0x4eaa68=_0x491d91[_0x2dda08];if(_[_0x3055('0x38')](_0x969c51['telephones'][util[_0x3055('0x1d')](_0x3055('0x1e'),_0x4eaa68[_0x3055('0x1f')])])){_0x969c51[_0x3055('0xb')][util[_0x3055('0x1d')](_0x3055('0x1e'),_0x4eaa68[_0x3055('0x1f')])]=new Telephone(_0x4eaa68);}else{_0x969c51[_0x3055('0x35')](_0x969c51['telephones'][util['format'](_0x3055('0x1e'),_0x4eaa68[_0x3055('0x1f')])],_0x4eaa68);}}}return _0x969c51['telephones'];};};Realtime[_0x3055('0x34')][_0x3055('0x3a')]=function(){var _0x12b19b=this;return function(_0x32ba8d){if(_0x32ba8d){freeIsNotKeySip(_0x32ba8d,_0x12b19b['trunks']);for(var _0x117ac1=0x0,_0x345219={},_0x472d32={};_0x117ac1<_0x32ba8d['length'];_0x117ac1+=0x1){_0x345219=_0x32ba8d[_0x117ac1];if(_[_0x3055('0x38')](_0x12b19b['trunks'][util[_0x3055('0x1d')](_0x3055('0x1e'),_0x345219[_0x3055('0x1f')])])){_0x12b19b['trunks'][util[_0x3055('0x1d')](_0x3055('0x1e'),_0x345219['name'])]=new Trunk(_0x345219);}else{_0x12b19b[_0x3055('0x35')](_0x12b19b[_0x3055('0xc')][util[_0x3055('0x1d')](_0x3055('0x1e'),_0x345219[_0x3055('0x1f')])],_0x345219);}}}return _0x12b19b['trunks'];};};Realtime[_0x3055('0x34')][_0x3055('0x3b')]=function(){var _0x7389e7=this;return function(_0x3c179e){if(_0x3c179e){freeIsNotKey(_0x3c179e,_0x7389e7['voiceQueues'],_0x3055('0x1f'));for(var _0x4eedca=0x0,_0x411740={},_0x23b90f={};_0x4eedca<_0x3c179e[_0x3055('0x37')];_0x4eedca+=0x1){_0x411740=_0x3c179e[_0x4eedca];if(_[_0x3055('0x38')](_0x7389e7[_0x3055('0x3c')][_0x411740[_0x3055('0x1f')]])){_0x7389e7[_0x3055('0x3c')][_0x411740[_0x3055('0x1f')]]=new VoiceQueue(_0x411740);}else{_0x7389e7[_0x3055('0x35')](_0x7389e7[_0x3055('0x3c')][_0x411740[_0x3055('0x1f')]],_0x411740);}}}return _0x7389e7['voiceQueues'];};};Realtime[_0x3055('0x34')][_0x3055('0x3d')]=function(){var _0x48d82a=this;return function(_0xb8d754){if(_0xb8d754){freeIsNotKey(_0xb8d754,_0x48d82a['triggers'],'id');for(var _0x252af1=0x0,_0x399cfa={},_0x5d5267={};_0x252af1<_0xb8d754['length'];_0x252af1+=0x1){_0x399cfa=_0xb8d754[_0x252af1];if(_[_0x3055('0x38')](_0x48d82a[_0x3055('0xd')][_0x399cfa['id']])){_0x48d82a[_0x3055('0xd')][_0x399cfa['id']]=new Trigger(_0x399cfa);}else{_0x48d82a[_0x3055('0x35')](_0x48d82a[_0x3055('0xd')][_0x399cfa['id']],_0x399cfa);}}}return _0x48d82a['triggers'];};};Realtime[_0x3055('0x34')][_0x3055('0x3e')]=function(){var _0x1ede34=this;return function(_0xb27bdb){if(_0xb27bdb){freeIsNotKey(_0xb27bdb,_0x1ede34[_0x3055('0x3f')],'id');for(var _0x48f608=0x0,_0x4ff193={},_0x586299={};_0x48f608<_0xb27bdb['length'];_0x48f608+=0x1){_0x4ff193=_0xb27bdb[_0x48f608];if(_['isUndefined'](_0x1ede34[_0x3055('0x3f')][_0x4ff193['id']])){_0x1ede34[_0x3055('0x3f')][_0x4ff193['id']]=new Template(_0x4ff193);}else{_0x1ede34[_0x3055('0x35')](_0x1ede34[_0x3055('0x3f')][_0x4ff193['id']],_0x4ff193);}}}return _0x1ede34[_0x3055('0x3f')];};};Realtime[_0x3055('0x34')][_0x3055('0x40')]=function(){var _0x982746=this;return function(_0x1b5b44){if(_0x1b5b44){freeIsNotKey(_0x1b5b44,_0x982746[_0x3055('0x14')],'id');for(var _0x113bf2=0x0,_0x16a71f={},_0x47bf74={};_0x113bf2<_0x1b5b44[_0x3055('0x37')];_0x113bf2+=0x1){_0x16a71f=_0x1b5b44[_0x113bf2];if(_[_0x3055('0x38')](_0x982746['zendeskAccounts'][_0x16a71f['id']])){_0x982746['zendeskAccounts'][_0x16a71f['id']]=new ZendeskAccount(_0x16a71f);}else{_0x982746[_0x3055('0x35')](_0x982746[_0x3055('0x14')][_0x16a71f['id']],_0x16a71f);}}}return _0x982746[_0x3055('0x14')];};};Realtime[_0x3055('0x34')]['initSalesforceAccounts']=function(){var _0x130298=this;return function(_0x1e8832){if(_0x1e8832){freeIsNotKey(_0x1e8832,_0x130298[_0x3055('0x41')],'id');for(var _0x23cc7c=0x0,_0x4d0d82={},_0x24886a={};_0x23cc7c<_0x1e8832['length'];_0x23cc7c+=0x1){_0x4d0d82=_0x1e8832[_0x23cc7c];if(_[_0x3055('0x38')](_0x130298['salesforceAccounts'][_0x4d0d82['id']])){_0x130298[_0x3055('0x41')][_0x4d0d82['id']]=new SalesforceAccount(_0x4d0d82);}else{_0x130298[_0x3055('0x35')](_0x130298[_0x3055('0x41')][_0x4d0d82['id']],_0x4d0d82);}}}return _0x130298[_0x3055('0x41')];};};Realtime[_0x3055('0x34')][_0x3055('0x42')]=function(){var _0x42e931=this;return function(_0x3e57b7){if(_0x3e57b7){freeIsNotKey(_0x3e57b7,_0x42e931['freshdeskAccounts'],'id');for(var _0x516e6a=0x0,_0x503ff6={},_0x5e4c47={};_0x516e6a<_0x3e57b7[_0x3055('0x37')];_0x516e6a+=0x1){_0x503ff6=_0x3e57b7[_0x516e6a];if(_['isUndefined'](_0x42e931[_0x3055('0x16')][_0x503ff6['id']])){_0x42e931[_0x3055('0x16')][_0x503ff6['id']]=new FreshdeskAccount(_0x503ff6);}else{_0x42e931['mergeFromDatabase'](_0x42e931[_0x3055('0x16')][_0x503ff6['id']],_0x503ff6);}}}return _0x42e931[_0x3055('0x16')];};};Realtime[_0x3055('0x34')][_0x3055('0x43')]=function(){var _0x362efe=this;return function(_0x44e807){if(_0x44e807){freeIsNotKey(_0x44e807,_0x362efe[_0x3055('0x17')],'id');for(var _0x137b86=0x0,_0x4e931d={},_0x1b2f4e={};_0x137b86<_0x44e807['length'];_0x137b86+=0x1){_0x4e931d=_0x44e807[_0x137b86];if(_['isUndefined'](_0x362efe[_0x3055('0x17')][_0x4e931d['id']])){_0x362efe[_0x3055('0x17')][_0x4e931d['id']]=new ZohoAccount(_0x4e931d);}else{_0x362efe[_0x3055('0x35')](_0x362efe[_0x3055('0x17')][_0x4e931d['id']],_0x4e931d);}}}return _0x362efe[_0x3055('0x17')];};};Realtime[_0x3055('0x34')]['initDeskAccounts']=function(){var _0x37dcd1=this;return function(_0x17eea4){if(_0x17eea4){freeIsNotKey(_0x17eea4,_0x37dcd1[_0x3055('0x18')],'id');for(var _0x444a31=0x0,_0x1ac721={},_0x3f4c9f={};_0x444a31<_0x17eea4['length'];_0x444a31+=0x1){_0x1ac721=_0x17eea4[_0x444a31];if(_[_0x3055('0x38')](_0x37dcd1[_0x3055('0x18')][_0x1ac721['id']])){_0x37dcd1[_0x3055('0x18')][_0x1ac721['id']]=new DeskAccount(_0x1ac721);}else{_0x37dcd1[_0x3055('0x35')](_0x37dcd1[_0x3055('0x18')][_0x1ac721['id']],_0x1ac721);}}}return _0x37dcd1[_0x3055('0x18')];};};Realtime[_0x3055('0x34')]['initSugarcrmAccounts']=function(){var _0x54e410=this;return function(_0x1f87cd){if(_0x1f87cd){freeIsNotKey(_0x1f87cd,_0x54e410[_0x3055('0x15')],'id');for(var _0xb9bd56=0x0,_0x23d71f={},_0x48f189={};_0xb9bd56<_0x1f87cd[_0x3055('0x37')];_0xb9bd56+=0x1){_0x23d71f=_0x1f87cd[_0xb9bd56];if(_['isUndefined'](_0x54e410['sugarcrmAccounts'][_0x23d71f['id']])){_0x54e410[_0x3055('0x15')][_0x23d71f['id']]=new SugarcrmAccount(_0x23d71f);}else{_0x54e410[_0x3055('0x35')](_0x54e410[_0x3055('0x15')][_0x23d71f['id']],_0x23d71f);}}}return _0x54e410[_0x3055('0x15')];};};Realtime['prototype']['initVtigerAccounts']=function(){var _0x2e20e9=this;return function(_0x2c747d){if(_0x2c747d){freeIsNotKey(_0x2c747d,_0x2e20e9[_0x3055('0x19')],'id');for(var _0x7403f0=0x0,_0x3cc946={},_0x10d08a={};_0x7403f0<_0x2c747d['length'];_0x7403f0+=0x1){_0x3cc946=_0x2c747d[_0x7403f0];if(_[_0x3055('0x38')](_0x2e20e9[_0x3055('0x19')][_0x3cc946['id']])){_0x2e20e9['vtigerAccounts'][_0x3cc946['id']]=new VtigerAccount(_0x3cc946);}else{_0x2e20e9[_0x3055('0x35')](_0x2e20e9[_0x3055('0x19')][_0x3cc946['id']],_0x3cc946);}}}return _0x2e20e9[_0x3055('0x19')];};};Realtime[_0x3055('0x34')]['initVoiceQueueHopperHistory']=function(){var _0x2c0d84=this;return function(_0x59ce0e){for(var _0xc31740=0x0;_0xc31740<_0x59ce0e[_0x3055('0x37')];_0xc31740+=0x1){_[_0x3055('0x44')](_0x2c0d84['voiceQueues'][_0x59ce0e[_0xc31740][_0x3055('0x1f')]],_0x59ce0e[_0xc31740]);}return _0x2c0d84[_0x3055('0x3c')];};};Realtime[_0x3055('0x34')][_0x3055('0x45')]=function(){var _0x318a4c=this;return function(_0x294723){clearVoiceQueues(_0x318a4c[_0x3055('0x3c')]);if(_0x294723){_0x294723=_[_0x3055('0x46')](_0x294723,_0x3055('0x47'));for(var _0x4ac1ca in _0x294723){if(_0x294723[_0x3055('0x1c')](_0x4ac1ca)){var _0x5dab61={};for(var _0x93cb9c=0x0;_0x93cb9c<_0x294723[_0x4ac1ca][_0x3055('0x37')];_0x93cb9c+=0x1){var _0x25c856=_0x294723[_0x4ac1ca][_0x93cb9c][_0x3055('0x48')];if(_0x318a4c[_0x3055('0x3c')][_0x25c856]){if(_0x294723[_0x4ac1ca][_0x93cb9c][_0x3055('0x49')]){_0x318a4c['voiceQueues'][_0x25c856][_0x3055('0x27')]+=0x1;}_0x318a4c['voiceQueues'][_0x25c856][_0x3055('0x22')]+=moment(_0x294723[_0x4ac1ca][_0x93cb9c]['queuecallerleaveAt'])[_0x3055('0x4a')](moment(_0x294723[_0x4ac1ca][_0x93cb9c]['queuecallerjoinAt']),_0x3055('0x4b'))||0x0;if(_0x93cb9c===_0x294723[_0x4ac1ca][_0x3055('0x37')]-0x1){_0x318a4c[_0x3055('0x3c')][_0x25c856][_0x3055('0x28')]+=moment(_0x294723[_0x4ac1ca][_0x93cb9c][_0x3055('0x4c')]||_0x294723[_0x4ac1ca][_0x93cb9c][_0x3055('0x4d')]||_0x294723[_0x4ac1ca][_0x93cb9c][_0x3055('0x4e')])[_0x3055('0x4a')](moment(_0x294723[_0x4ac1ca][_0x93cb9c][_0x3055('0x4f')]),'seconds')||0x0;_0x318a4c[_0x3055('0x3c')][_0x25c856][_0x3055('0x20')]+=0x1;if(_0x294723[_0x4ac1ca][_0x93cb9c][_0x3055('0x50')]){_0x318a4c[_0x3055('0x3c')][_0x25c856][_0x3055('0x21')]+=0x1;_0x318a4c['voiceQueues'][_0x25c856][_0x3055('0x23')]+=moment(_0x294723[_0x4ac1ca][_0x93cb9c][_0x3055('0x4c')])[_0x3055('0x4a')](moment(_0x294723[_0x4ac1ca][_0x93cb9c]['queuecallerleaveAt']),_0x3055('0x4b'))||0x0;}}else{_0x318a4c[_0x3055('0x3c')][_0x25c856][_0x3055('0x28')]+=_0x318a4c[_0x3055('0x3c')][_0x25c856][_0x3055('0x22')]||0x0;}}}}}}return _0x318a4c[_0x3055('0x3c')];};};Realtime[_0x3055('0x34')]['initVoiceCallReports']=function(){var _0x2d0195=this;return function(_0x339270){clearVoiceCallReports(_0x2d0195['outbound']);if(_0x339270){for(var _0x4f6e57=0x0;_0x4f6e57<_0x339270[_0x3055('0x37')];_0x4f6e57+=0x1){_0x2d0195[_0x3055('0xe')][_0x3055('0x20')]+=0x1;_0x2d0195[_0x3055('0xe')][_0x3055('0x28')]+=_0x339270[_0x4f6e57][_0x3055('0x51')];if(_0x339270[_0x4f6e57][_0x3055('0x52')]===_0x3055('0x53')){_0x2d0195['outbound'][_0x3055('0x21')]+=0x1;_0x2d0195[_0x3055('0xe')][_0x3055('0x22')]+=_0x339270[_0x4f6e57][_0x3055('0x51')]-_0x339270[_0x4f6e57][_0x3055('0x54')]||0x0;_0x2d0195[_0x3055('0xe')][_0x3055('0x23')]+=_0x339270[_0x4f6e57][_0x3055('0x54')];}}}return _0x2d0195['outbound'];};};Realtime[_0x3055('0x34')][_0x3055('0x55')]=function(){var _0x49ca3b=this;return function(_0x23c00b){if(_0x23c00b){freeIsNotKey(_0x23c00b,_0x49ca3b[_0x3055('0x56')],_0x3055('0x1f'));for(var _0x48477c=0x0,_0x490446={};_0x48477c<_0x23c00b[_0x3055('0x37')];_0x48477c+=0x1){_0x490446=_0x23c00b[_0x48477c];if(_[_0x3055('0x38')](_0x49ca3b[_0x3055('0x56')][_0x490446[_0x3055('0x1f')]])){_0x49ca3b[_0x3055('0x56')][_0x490446[_0x3055('0x1f')]]=new Campaign(_0x490446);}else{_0x49ca3b[_0x3055('0x35')](_0x49ca3b[_0x3055('0x56')][_0x490446[_0x3055('0x1f')]],_0x490446);}}}return _0x49ca3b['campaigns'];};};Realtime[_0x3055('0x34')][_0x3055('0x57')]=function(){var _0x5d804a=this;return function(_0x112089){if(_0x112089){freeIsNotKey(_0x112089,_0x5d804a[_0x3055('0xf')],'id');for(var _0x572398=0x0,_0x22fd81={};_0x572398<_0x112089[_0x3055('0x37')];_0x572398+=0x1){_0x22fd81=_0x112089[_0x572398];if(_[_0x3055('0x38')](_0x5d804a['voiceExtensions'][_0x22fd81['id']])){_0x5d804a[_0x3055('0xf')][_0x22fd81['id']]=new VoiceExtension(_0x22fd81);}else{_0x5d804a[_0x3055('0x35')](_0x5d804a[_0x3055('0xf')][_0x22fd81['id']],_0x22fd81);}}}return _0x5d804a['voiceExtensions'];};};Realtime['prototype']['initCampaignHopperHistory']=function(){var _0x31860f=this;return function(_0x1105df){clearCampaigns(_0x31860f[_0x3055('0x56')]);for(var _0xfabc60=0x0;_0xfabc60<_0x1105df[_0x3055('0x37')];_0xfabc60+=0x1){_['merge'](_0x31860f[_0x3055('0x56')][_0x1105df[_0xfabc60][_0x3055('0x1f')]],_0x1105df[_0xfabc60]);}return _0x31860f[_0x3055('0x56')];};};Realtime[_0x3055('0x34')][_0x3055('0x58')]=function(){var _0x1db672=this;return function(_0x5c650f){if(_0x5c650f){freeIsNotKey(_0x5c650f,_0x1db672['faxAccounts'],'id');for(var _0x39de9b=0x0,_0x12508a={},_0x2821fe={};_0x39de9b<_0x5c650f['length'];_0x39de9b+=0x1){_0x12508a=_0x5c650f[_0x39de9b];if(_[_0x3055('0x38')](_0x1db672['faxAccounts'][_0x12508a['id']])){_0x1db672[_0x3055('0x1a')][_0x12508a['id']]=new FaxAccount(_0x12508a);}else{_0x1db672['mergeFromDatabase'](_0x1db672['faxAccounts'][_0x12508a['id']],_0x12508a);}}}return _0x1db672[_0x3055('0x1a')];};};module[_0x3055('0x59')]=Realtime;
\ No newline at end of file
+var _0xf640=['vtigerAccounts','faxAccounts','hasOwnProperty','format','SIP/%s','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','unmanaged','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','mergeFromDatabase','prototype','initAgents','length','isUndefined','name','initTelephones','initTrunks','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initSugarcrmAccounts','initVtigerAccounts','groupBy','queue','queuecallerexit','queuecallerleaveAt','diff','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','seconds','initVoiceCallReports','disposition','duration','billableseconds','initCampaigns','campaigns','initCampaignHopperHistory','initFaxAccounts','bluebird','util','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/template','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','templates','outbound','voiceExtensions','queueChannels','zendeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts'];(function(_0x567fff,_0xd8acd8){var _0x465a37=function(_0x9d7bf7){while(--_0x9d7bf7){_0x567fff['push'](_0x567fff['shift']());}};_0x465a37(++_0xd8acd8);}(_0xf640,0xdb));var _0x0f64=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf640[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0x0f64('0x0'));var util=require(_0x0f64('0x1'));var _=require('lodash');var moment=require(_0x0f64('0x2'));var Agent=require(_0x0f64('0x3'));var Telephone=require(_0x0f64('0x4'));var Trunk=require(_0x0f64('0x5'));var VoiceQueue=require(_0x0f64('0x6'));var Trigger=require('../model/trigger');var Template=require(_0x0f64('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x0f64('0x8'));var FreshdeskAccount=require(_0x0f64('0x9'));var SugarcrmAccount=require(_0x0f64('0xa'));var ZohoAccount=require(_0x0f64('0xb'));var DeskAccount=require(_0x0f64('0xc'));var VtigerAccount=require('../model/vtigerAccount');var FaxAccount=require(_0x0f64('0xd'));var Realtime=function(){this[_0x0f64('0xe')]={};this[_0x0f64('0xf')]={};this[_0x0f64('0x10')]={};this[_0x0f64('0x11')]={};this[_0x0f64('0x12')]={};this['campaigns']={};this[_0x0f64('0x13')]={};this[_0x0f64('0x14')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x0f64('0x15')]={};this['channels']={};this[_0x0f64('0x16')]={};this['outboundChannels']={};this['timers']={};this[_0x0f64('0x17')]={};this['salesforceAccounts']={};this[_0x0f64('0x18')]={};this['freshdeskAccounts']={};this[_0x0f64('0x19')]={};this[_0x0f64('0x1a')]={};this[_0x0f64('0x1b')]={};this[_0x0f64('0x1c')]={};};function freeIsNotKey(_0x2fd5f2,_0x378bf3,_0x6e5d4c){var _0x14fd5d=_['mapKeys'](_0x2fd5f2,function(_0x482e8b,_0x56a817){return _0x482e8b[_0x6e5d4c];});for(var _0x58ac93 in _0x378bf3){if(_0x378bf3[_0x0f64('0x1d')](_0x58ac93)){if(!_0x14fd5d[_0x58ac93]){delete _0x378bf3[_0x58ac93];}}}}function freeIsNotKeySip(_0x49c4d2,_0x57a43a){var _0xb73f5e=_['mapKeys'](_0x49c4d2,function(_0x26f26b,_0x4f83f8){return util[_0x0f64('0x1e')](_0x0f64('0x1f'),_0x26f26b['name']);});for(var _0x541f18 in _0x57a43a){if(_0x57a43a[_0x0f64('0x1d')](_0x541f18)){if(!_0xb73f5e[_0x541f18]){delete _0x57a43a[_0x541f18];}}}}function clearVoiceCallReports(_0x201322){_0x201322[_0x0f64('0x20')]=0x0;_0x201322[_0x0f64('0x21')]=0x0;_0x201322[_0x0f64('0x22')]=0x0;_0x201322[_0x0f64('0x23')]=0x0;_0x201322[_0x0f64('0x24')]=0x0;}function clearCampaigns(_0x38872a){if(!_[_0x0f64('0x25')](_0x38872a)){for(var _0x2ea4ee in _0x38872a){if(_0x38872a[_0x0f64('0x1d')](_0x2ea4ee)){_0x38872a[_0x2ea4ee][_0x0f64('0x26')]=0x0;_0x38872a[_0x2ea4ee]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x44e25c){if(!_[_0x0f64('0x25')](_0x44e25c)){for(var _0x58784b in _0x44e25c){if(_0x44e25c[_0x0f64('0x1d')](_0x58784b)){_0x44e25c[_0x58784b][_0x0f64('0x20')]=0x0;_0x44e25c[_0x58784b][_0x0f64('0x21')]=0x0;_0x44e25c[_0x58784b][_0x0f64('0x27')]=0x0;_0x44e25c[_0x58784b][_0x0f64('0x22')]=0x0;_0x44e25c[_0x58784b][_0x0f64('0x23')]=0x0;_0x44e25c[_0x58784b][_0x0f64('0x24')]=0x0;_0x44e25c[_0x58784b]['outboundAnswerAgiCallsDay']=0x0;_0x44e25c[_0x58784b]['outboundNoAnswerCallsDay']=0x0;_0x44e25c[_0x58784b]['outboundBusyCallsDay']=0x0;_0x44e25c[_0x58784b][_0x0f64('0x28')]=0x0;_0x44e25c[_0x58784b]['outboundNoSuchCallsDay']=0x0;_0x44e25c[_0x58784b]['outboundUnknownCallsDay']=0x0;_0x44e25c[_0x58784b]['outboundDropCallsDayTimeout']=0x0;_0x44e25c[_0x58784b][_0x0f64('0x29')]=0x0;_0x44e25c[_0x58784b][_0x0f64('0x2a')]=0x0;_0x44e25c[_0x58784b][_0x0f64('0x2b')]=0x0;_0x44e25c[_0x58784b]['outboundRejectCallsDay']=0x0;_0x44e25c[_0x58784b][_0x0f64('0x2c')]=0x0;_0x44e25c[_0x58784b][_0x0f64('0x2d')]=0x0;_0x44e25c[_0x58784b][_0x0f64('0x2e')]=0x0;_0x44e25c[_0x58784b]['queueStatusComplete']=!![];}}}}Realtime['prototype'][_0x0f64('0x2f')]=function(_0x2fce8d,_0x4355a1){for(var _0x410692 in _0x4355a1){if(_0x2fce8d['hasOwnProperty'](_0x410692)){_0x2fce8d[_0x410692]=_0x4355a1[_0x410692];}}};Realtime[_0x0f64('0x30')][_0x0f64('0x31')]=function(){var _0x3c88bf=this;return function(_0xcd382b){if(_0xcd382b){freeIsNotKeySip(_0xcd382b,_0x3c88bf[_0x0f64('0xe')]);for(var _0xb12166=0x0,_0x10cb5c={},_0x38d037={};_0xb12166<_0xcd382b[_0x0f64('0x32')];_0xb12166+=0x1){_0x10cb5c=_0xcd382b[_0xb12166];if(_[_0x0f64('0x33')](_0x3c88bf[_0x0f64('0xe')][util[_0x0f64('0x1e')](_0x0f64('0x1f'),_0x10cb5c[_0x0f64('0x34')])])){_0x3c88bf['agents'][util[_0x0f64('0x1e')]('SIP/%s',_0x10cb5c[_0x0f64('0x34')])]=new Agent(_0x10cb5c);}else{_0x3c88bf[_0x0f64('0x2f')](_0x3c88bf[_0x0f64('0xe')][util[_0x0f64('0x1e')](_0x0f64('0x1f'),_0x10cb5c['name'])],_0x10cb5c);}}}return _0x3c88bf[_0x0f64('0xe')];};};Realtime[_0x0f64('0x30')][_0x0f64('0x35')]=function(){var _0x423e71=this;return function(_0x765325){if(_0x765325){freeIsNotKeySip(_0x765325,_0x423e71[_0x0f64('0xf')]);for(var _0x261742=0x0,_0x301aeb={},_0x3b6557={};_0x261742<_0x765325['length'];_0x261742+=0x1){_0x301aeb=_0x765325[_0x261742];if(_[_0x0f64('0x33')](_0x423e71[_0x0f64('0xf')][util['format'](_0x0f64('0x1f'),_0x301aeb[_0x0f64('0x34')])])){_0x423e71['telephones'][util[_0x0f64('0x1e')](_0x0f64('0x1f'),_0x301aeb[_0x0f64('0x34')])]=new Telephone(_0x301aeb);}else{_0x423e71[_0x0f64('0x2f')](_0x423e71[_0x0f64('0xf')][util[_0x0f64('0x1e')](_0x0f64('0x1f'),_0x301aeb[_0x0f64('0x34')])],_0x301aeb);}}}return _0x423e71[_0x0f64('0xf')];};};Realtime[_0x0f64('0x30')][_0x0f64('0x36')]=function(){var _0x73465a=this;return function(_0xe021ce){if(_0xe021ce){freeIsNotKeySip(_0xe021ce,_0x73465a['trunks']);for(var _0x4fcb8a=0x0,_0x4117e5={},_0x39c179={};_0x4fcb8a<_0xe021ce[_0x0f64('0x32')];_0x4fcb8a+=0x1){_0x4117e5=_0xe021ce[_0x4fcb8a];if(_['isUndefined'](_0x73465a[_0x0f64('0x10')][util['format'](_0x0f64('0x1f'),_0x4117e5[_0x0f64('0x34')])])){_0x73465a[_0x0f64('0x10')][util[_0x0f64('0x1e')](_0x0f64('0x1f'),_0x4117e5['name'])]=new Trunk(_0x4117e5);}else{_0x73465a['mergeFromDatabase'](_0x73465a[_0x0f64('0x10')][util[_0x0f64('0x1e')](_0x0f64('0x1f'),_0x4117e5[_0x0f64('0x34')])],_0x4117e5);}}}return _0x73465a['trunks'];};};Realtime[_0x0f64('0x30')]['initVoiceQueues']=function(){var _0x45498f=this;return function(_0x540975){if(_0x540975){freeIsNotKey(_0x540975,_0x45498f[_0x0f64('0x11')],_0x0f64('0x34'));for(var _0x423834=0x0,_0x32e01f={},_0x4897df={};_0x423834<_0x540975[_0x0f64('0x32')];_0x423834+=0x1){_0x32e01f=_0x540975[_0x423834];if(_['isUndefined'](_0x45498f['voiceQueues'][_0x32e01f[_0x0f64('0x34')]])){_0x45498f['voiceQueues'][_0x32e01f['name']]=new VoiceQueue(_0x32e01f);}else{_0x45498f[_0x0f64('0x2f')](_0x45498f[_0x0f64('0x11')][_0x32e01f[_0x0f64('0x34')]],_0x32e01f);}}}return _0x45498f['voiceQueues'];};};Realtime['prototype'][_0x0f64('0x37')]=function(){var _0x42e553=this;return function(_0xbf3594){if(_0xbf3594){freeIsNotKey(_0xbf3594,_0x42e553['triggers'],'id');for(var _0x5646eb=0x0,_0x181069={},_0x1cc702={};_0x5646eb<_0xbf3594[_0x0f64('0x32')];_0x5646eb+=0x1){_0x181069=_0xbf3594[_0x5646eb];if(_[_0x0f64('0x33')](_0x42e553[_0x0f64('0x12')][_0x181069['id']])){_0x42e553[_0x0f64('0x12')][_0x181069['id']]=new Trigger(_0x181069);}else{_0x42e553[_0x0f64('0x2f')](_0x42e553['triggers'][_0x181069['id']],_0x181069);}}}return _0x42e553[_0x0f64('0x12')];};};Realtime[_0x0f64('0x30')][_0x0f64('0x38')]=function(){var _0x578ac8=this;return function(_0x3041df){if(_0x3041df){freeIsNotKey(_0x3041df,_0x578ac8[_0x0f64('0x13')],'id');for(var _0x58255a=0x0,_0xe9eb03={},_0x28c3ab={};_0x58255a<_0x3041df[_0x0f64('0x32')];_0x58255a+=0x1){_0xe9eb03=_0x3041df[_0x58255a];if(_[_0x0f64('0x33')](_0x578ac8[_0x0f64('0x13')][_0xe9eb03['id']])){_0x578ac8['templates'][_0xe9eb03['id']]=new Template(_0xe9eb03);}else{_0x578ac8['mergeFromDatabase'](_0x578ac8[_0x0f64('0x13')][_0xe9eb03['id']],_0xe9eb03);}}}return _0x578ac8[_0x0f64('0x13')];};};Realtime[_0x0f64('0x30')][_0x0f64('0x39')]=function(){var _0x1ebc1e=this;return function(_0x2c4ade){if(_0x2c4ade){freeIsNotKey(_0x2c4ade,_0x1ebc1e[_0x0f64('0x17')],'id');for(var _0x2d87ca=0x0,_0x2ade5e={},_0x3893b2={};_0x2d87ca<_0x2c4ade[_0x0f64('0x32')];_0x2d87ca+=0x1){_0x2ade5e=_0x2c4ade[_0x2d87ca];if(_[_0x0f64('0x33')](_0x1ebc1e['zendeskAccounts'][_0x2ade5e['id']])){_0x1ebc1e[_0x0f64('0x17')][_0x2ade5e['id']]=new ZendeskAccount(_0x2ade5e);}else{_0x1ebc1e[_0x0f64('0x2f')](_0x1ebc1e[_0x0f64('0x17')][_0x2ade5e['id']],_0x2ade5e);}}}return _0x1ebc1e['zendeskAccounts'];};};Realtime['prototype'][_0x0f64('0x3a')]=function(){var _0xe01224=this;return function(_0x90d13a){if(_0x90d13a){freeIsNotKey(_0x90d13a,_0xe01224[_0x0f64('0x3b')],'id');for(var _0x38493f=0x0,_0x4b409d={},_0x1dcc2a={};_0x38493f<_0x90d13a[_0x0f64('0x32')];_0x38493f+=0x1){_0x4b409d=_0x90d13a[_0x38493f];if(_['isUndefined'](_0xe01224[_0x0f64('0x3b')][_0x4b409d['id']])){_0xe01224[_0x0f64('0x3b')][_0x4b409d['id']]=new SalesforceAccount(_0x4b409d);}else{_0xe01224['mergeFromDatabase'](_0xe01224[_0x0f64('0x3b')][_0x4b409d['id']],_0x4b409d);}}}return _0xe01224[_0x0f64('0x3b')];};};Realtime[_0x0f64('0x30')][_0x0f64('0x3c')]=function(){var _0x52465f=this;return function(_0x221c3a){if(_0x221c3a){freeIsNotKey(_0x221c3a,_0x52465f[_0x0f64('0x3d')],'id');for(var _0x13998b=0x0,_0x175ba8={},_0x17cefc={};_0x13998b<_0x221c3a['length'];_0x13998b+=0x1){_0x175ba8=_0x221c3a[_0x13998b];if(_[_0x0f64('0x33')](_0x52465f['freshdeskAccounts'][_0x175ba8['id']])){_0x52465f[_0x0f64('0x3d')][_0x175ba8['id']]=new FreshdeskAccount(_0x175ba8);}else{_0x52465f[_0x0f64('0x2f')](_0x52465f['freshdeskAccounts'][_0x175ba8['id']],_0x175ba8);}}}return _0x52465f[_0x0f64('0x3d')];};};Realtime['prototype']['initZohoAccounts']=function(){var _0x3002b5=this;return function(_0x594068){if(_0x594068){freeIsNotKey(_0x594068,_0x3002b5[_0x0f64('0x19')],'id');for(var _0x3ae46a=0x0,_0x1bceaa={},_0x19238c={};_0x3ae46a<_0x594068[_0x0f64('0x32')];_0x3ae46a+=0x1){_0x1bceaa=_0x594068[_0x3ae46a];if(_['isUndefined'](_0x3002b5['zohoAccounts'][_0x1bceaa['id']])){_0x3002b5['zohoAccounts'][_0x1bceaa['id']]=new ZohoAccount(_0x1bceaa);}else{_0x3002b5[_0x0f64('0x2f')](_0x3002b5[_0x0f64('0x19')][_0x1bceaa['id']],_0x1bceaa);}}}return _0x3002b5[_0x0f64('0x19')];};};Realtime[_0x0f64('0x30')]['initDeskAccounts']=function(){var _0x29cfd0=this;return function(_0xf97325){if(_0xf97325){freeIsNotKey(_0xf97325,_0x29cfd0[_0x0f64('0x1a')],'id');for(var _0x329a85=0x0,_0x2ac320={},_0x1bbd41={};_0x329a85<_0xf97325[_0x0f64('0x32')];_0x329a85+=0x1){_0x2ac320=_0xf97325[_0x329a85];if(_[_0x0f64('0x33')](_0x29cfd0['deskAccounts'][_0x2ac320['id']])){_0x29cfd0[_0x0f64('0x1a')][_0x2ac320['id']]=new DeskAccount(_0x2ac320);}else{_0x29cfd0['mergeFromDatabase'](_0x29cfd0[_0x0f64('0x1a')][_0x2ac320['id']],_0x2ac320);}}}return _0x29cfd0['deskAccounts'];};};Realtime[_0x0f64('0x30')][_0x0f64('0x3e')]=function(){var _0x569066=this;return function(_0x2c2b30){if(_0x2c2b30){freeIsNotKey(_0x2c2b30,_0x569066[_0x0f64('0x18')],'id');for(var _0x26043e=0x0,_0xb8617a={},_0x2e5888={};_0x26043e<_0x2c2b30[_0x0f64('0x32')];_0x26043e+=0x1){_0xb8617a=_0x2c2b30[_0x26043e];if(_[_0x0f64('0x33')](_0x569066[_0x0f64('0x18')][_0xb8617a['id']])){_0x569066[_0x0f64('0x18')][_0xb8617a['id']]=new SugarcrmAccount(_0xb8617a);}else{_0x569066[_0x0f64('0x2f')](_0x569066['sugarcrmAccounts'][_0xb8617a['id']],_0xb8617a);}}}return _0x569066[_0x0f64('0x18')];};};Realtime[_0x0f64('0x30')][_0x0f64('0x3f')]=function(){var _0x5109ae=this;return function(_0x39e913){if(_0x39e913){freeIsNotKey(_0x39e913,_0x5109ae[_0x0f64('0x1b')],'id');for(var _0x2e9cf6=0x0,_0xad9bfe={},_0x198338={};_0x2e9cf6<_0x39e913[_0x0f64('0x32')];_0x2e9cf6+=0x1){_0xad9bfe=_0x39e913[_0x2e9cf6];if(_[_0x0f64('0x33')](_0x5109ae['vtigerAccounts'][_0xad9bfe['id']])){_0x5109ae[_0x0f64('0x1b')][_0xad9bfe['id']]=new VtigerAccount(_0xad9bfe);}else{_0x5109ae[_0x0f64('0x2f')](_0x5109ae['vtigerAccounts'][_0xad9bfe['id']],_0xad9bfe);}}}return _0x5109ae['vtigerAccounts'];};};Realtime[_0x0f64('0x30')]['initVoiceQueueHopperHistory']=function(){var _0x1c706f=this;return function(_0xc67351){for(var _0x4ad372=0x0;_0x4ad372<_0xc67351[_0x0f64('0x32')];_0x4ad372+=0x1){_['merge'](_0x1c706f[_0x0f64('0x11')][_0xc67351[_0x4ad372]['name']],_0xc67351[_0x4ad372]);}return _0x1c706f[_0x0f64('0x11')];};};Realtime[_0x0f64('0x30')]['initVoiceQueueReports']=function(){var _0x556ed5=this;return function(_0x464653){clearVoiceQueues(_0x556ed5[_0x0f64('0x11')]);if(_0x464653){_0x464653=_[_0x0f64('0x40')](_0x464653,'uniqueid');for(var _0x42ed0a in _0x464653){if(_0x464653['hasOwnProperty'](_0x42ed0a)){var _0x45092a={};for(var _0x5b5ee0=0x0;_0x5b5ee0<_0x464653[_0x42ed0a]['length'];_0x5b5ee0+=0x1){var _0x7ebc89=_0x464653[_0x42ed0a][_0x5b5ee0][_0x0f64('0x41')];if(_0x556ed5['voiceQueues'][_0x7ebc89]){if(_0x464653[_0x42ed0a][_0x5b5ee0][_0x0f64('0x42')]){_0x556ed5[_0x0f64('0x11')][_0x7ebc89][_0x0f64('0x27')]+=0x1;}_0x556ed5[_0x0f64('0x11')][_0x7ebc89][_0x0f64('0x22')]+=moment(_0x464653[_0x42ed0a][_0x5b5ee0][_0x0f64('0x43')])[_0x0f64('0x44')](moment(_0x464653[_0x42ed0a][_0x5b5ee0]['queuecallerjoinAt']),'seconds')||0x0;if(_0x5b5ee0===_0x464653[_0x42ed0a][_0x0f64('0x32')]-0x1){_0x556ed5['voiceQueues'][_0x7ebc89]['sumDuration']+=moment(_0x464653[_0x42ed0a][_0x5b5ee0][_0x0f64('0x45')]||_0x464653[_0x42ed0a][_0x5b5ee0][_0x0f64('0x46')]||_0x464653[_0x42ed0a][_0x5b5ee0][_0x0f64('0x47')])[_0x0f64('0x44')](moment(_0x464653[_0x42ed0a][_0x5b5ee0][_0x0f64('0x48')]),_0x0f64('0x49'))||0x0;_0x556ed5[_0x0f64('0x11')][_0x7ebc89][_0x0f64('0x20')]+=0x1;if(_0x464653[_0x42ed0a][_0x5b5ee0]['queuecallercomplete']){_0x556ed5['voiceQueues'][_0x7ebc89][_0x0f64('0x21')]+=0x1;_0x556ed5[_0x0f64('0x11')][_0x7ebc89]['sumBillable']+=moment(_0x464653[_0x42ed0a][_0x5b5ee0][_0x0f64('0x45')])['diff'](moment(_0x464653[_0x42ed0a][_0x5b5ee0]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x556ed5[_0x0f64('0x11')][_0x7ebc89][_0x0f64('0x23')]+=_0x556ed5[_0x0f64('0x11')][_0x7ebc89]['sumHoldTime']||0x0;}}}}}}return _0x556ed5[_0x0f64('0x11')];};};Realtime['prototype'][_0x0f64('0x4a')]=function(){var _0x4a94db=this;return function(_0x42f3d1){clearVoiceCallReports(_0x4a94db['outbound']);if(_0x42f3d1){for(var _0x54eb3f=0x0;_0x54eb3f<_0x42f3d1[_0x0f64('0x32')];_0x54eb3f+=0x1){_0x4a94db[_0x0f64('0x14')][_0x0f64('0x20')]+=0x1;_0x4a94db[_0x0f64('0x14')]['sumDuration']+=_0x42f3d1[_0x54eb3f]['duration'];if(_0x42f3d1[_0x54eb3f][_0x0f64('0x4b')]==='ANSWERED'){_0x4a94db[_0x0f64('0x14')][_0x0f64('0x21')]+=0x1;_0x4a94db[_0x0f64('0x14')][_0x0f64('0x22')]+=_0x42f3d1[_0x54eb3f][_0x0f64('0x4c')]-_0x42f3d1[_0x54eb3f][_0x0f64('0x4d')]||0x0;_0x4a94db[_0x0f64('0x14')][_0x0f64('0x24')]+=_0x42f3d1[_0x54eb3f]['billableseconds'];}}}return _0x4a94db[_0x0f64('0x14')];};};Realtime[_0x0f64('0x30')][_0x0f64('0x4e')]=function(){var _0x4906c3=this;return function(_0x52dff8){if(_0x52dff8){freeIsNotKey(_0x52dff8,_0x4906c3[_0x0f64('0x4f')],_0x0f64('0x34'));for(var _0x2bd938=0x0,_0x476e10={};_0x2bd938<_0x52dff8[_0x0f64('0x32')];_0x2bd938+=0x1){_0x476e10=_0x52dff8[_0x2bd938];if(_[_0x0f64('0x33')](_0x4906c3[_0x0f64('0x4f')][_0x476e10[_0x0f64('0x34')]])){_0x4906c3[_0x0f64('0x4f')][_0x476e10[_0x0f64('0x34')]]=new Campaign(_0x476e10);}else{_0x4906c3['mergeFromDatabase'](_0x4906c3[_0x0f64('0x4f')][_0x476e10[_0x0f64('0x34')]],_0x476e10);}}}return _0x4906c3[_0x0f64('0x4f')];};};Realtime[_0x0f64('0x30')]['initVoiceExtensions']=function(){var _0x27ff63=this;return function(_0x25dbc5){if(_0x25dbc5){freeIsNotKey(_0x25dbc5,_0x27ff63['voiceExtensions'],'id');for(var _0x2974e0=0x0,_0x3aaeff={};_0x2974e0<_0x25dbc5['length'];_0x2974e0+=0x1){_0x3aaeff=_0x25dbc5[_0x2974e0];if(_['isUndefined'](_0x27ff63[_0x0f64('0x15')][_0x3aaeff['id']])){_0x27ff63[_0x0f64('0x15')][_0x3aaeff['id']]=new VoiceExtension(_0x3aaeff);}else{_0x27ff63[_0x0f64('0x2f')](_0x27ff63[_0x0f64('0x15')][_0x3aaeff['id']],_0x3aaeff);}}}return _0x27ff63['voiceExtensions'];};};Realtime[_0x0f64('0x30')][_0x0f64('0x50')]=function(){var _0x410ed9=this;return function(_0x30250f){clearCampaigns(_0x410ed9[_0x0f64('0x4f')]);for(var _0x12d218=0x0;_0x12d218<_0x30250f[_0x0f64('0x32')];_0x12d218+=0x1){_['merge'](_0x410ed9[_0x0f64('0x4f')][_0x30250f[_0x12d218]['name']],_0x30250f[_0x12d218]);}return _0x410ed9[_0x0f64('0x4f')];};};Realtime['prototype'][_0x0f64('0x51')]=function(){var _0x1c689d=this;return function(_0xae29f6){if(_0xae29f6){freeIsNotKey(_0xae29f6,_0x1c689d[_0x0f64('0x1c')],'id');for(var _0x589752=0x0,_0x3609c0={},_0x41bfa7={};_0x589752<_0xae29f6[_0x0f64('0x32')];_0x589752+=0x1){_0x3609c0=_0xae29f6[_0x589752];if(_[_0x0f64('0x33')](_0x1c689d[_0x0f64('0x1c')][_0x3609c0['id']])){_0x1c689d['faxAccounts'][_0x3609c0['id']]=new FaxAccount(_0x3609c0);}else{_0x1c689d['mergeFromDatabase'](_0x1c689d[_0x0f64('0x1c')][_0x3609c0['id']],_0x3609c0);}}}return _0x1c689d[_0x0f64('0x1c')];};};module['exports']=Realtime;
\ No newline at end of file
index 7c0c36b..916e074 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x641b=['../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','agents','prototype','sync','realtime','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','length','accountcode','connectedlinenum','lastAssignedTo','name','queuecallercomplete','queuecallercompleteAt','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','dialer','lastapplication','queue','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','destinationchannel','channel','calleridnum','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','filename','createdAt','connectedlinename','membername','originatecalleridnum','voiceAgentReport','bluebird','lodash','moment','util','ami','../rpc/voiceCallReport','../rpc/voiceDialReport'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0x641b,0x143));var _0xb641=function(_0x28e829,_0x16ea6c){_0x28e829=_0x28e829-0x0;var _0x2e75b2=_0x641b[_0x28e829];return _0x2e75b2;};'use strict';var BPromise=require(_0xb641('0x0'));var _=require(_0xb641('0x1'));var moment=require(_0xb641('0x2'));var util=require(_0xb641('0x3'));var logger=require('../../../config/logger')(_0xb641('0x4'));var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xb641('0x5'));var RpcVoiceDialReport=require(_0xb641('0x6'));var RpcMemberReport=require(_0xb641('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xb641('0x8'));var RpcVoiceTransferReport=require(_0xb641('0x9'));var VoiceQueueReport=require(_0xb641('0xa'));var VoiceCallReport=require(_0xb641('0xb'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xb641('0xc'));var UserReport=require('./userReport');function Report(_0x39169c){this['realtime']=_0x39169c;this[_0xb641('0xd')]=_0x39169c[_0xb641('0xd')];}Report[_0xb641('0xe')][_0xb641('0xf')]=function(_0x144fea){var _0x56cdae=new VoiceQueueReport(this[_0xb641('0x10')]);var _0x378f35=new VoiceAgentReport(this[_0xb641('0x10')]);var _0x40f7a4=new VoiceDialReport(this[_0xb641('0x10')]);var _0x5ec2a3=new VoiceCallReport(this[_0xb641('0x10')]);var _0x208264=new UserReport(this[_0xb641('0x10')]);ami['on'](_0xb641('0x11'),this[_0xb641('0x12')][_0xb641('0x13')](this));ami['on'](_0xb641('0x14'),this['voiceCallReport'][_0xb641('0x13')](this));ami['on'](_0xb641('0x15'),this['voiceAgentReport']['bind'](this));ami['on'](_0xb641('0x16'),this[_0xb641('0x17')]['bind'](this));ami['on']('blindtransfer',this[_0xb641('0x18')][_0xb641('0x13')](this));ami['on'](_0xb641('0x19'),this[_0xb641('0x1a')][_0xb641('0x13')](this));};Report['prototype']['voiceQueueReport']=function(_0x15b7bc){for(var _0x10fb44=0x0;_0x10fb44<_0x15b7bc[_0xb641('0x1b')];_0x10fb44+=0x1){var _0x1debce=_['find'](this[_0xb641('0xd')],function(_0x41e0e7){return _0x41e0e7[_0xb641('0x1c')]==_0x15b7bc[_0x10fb44][_0xb641('0x1d')];});if(_0x1debce){_0x15b7bc[_0x10fb44][_0xb641('0x1c')]=_0x1debce[_0xb641('0x1c')];_0x15b7bc[_0x10fb44]['assigned']=!![];_0x15b7bc[_0x10fb44][_0xb641('0x1e')]=_0x1debce[_0xb641('0x1f')];if(_0x15b7bc[_0x10fb44][_0xb641('0x20')]){_0x15b7bc[_0x10fb44][_0xb641('0x21')]=moment()[_0xb641('0x22')](_0xb641('0x23'));}if(_0x15b7bc[_0x10fb44][_0xb641('0x24')]){_0x15b7bc[_0x10fb44][_0xb641('0x25')]=moment()[_0xb641('0x22')](_0xb641('0x23'));}RpcMemberReport[_0xb641('0x12')](_0x15b7bc[_0x10fb44]);}RpcVoiceQueueReport[_0xb641('0x26')](_0x15b7bc[_0x10fb44]);}};function extractCalleridNumber(_0x18c033){var _0x3ed675=_0x18c033[_0xb641('0x27')](/<(.*?)>/);return _0x3ed675?_0x3ed675[0x1]:_0x18c033;}Report[_0xb641('0xe')]['voiceCallReport']=function(_0x4103b0){_0x4103b0[_0xb641('0x28')]=_0x4103b0['destination']||_0x4103b0[_0xb641('0x29')];if(_0x4103b0[_0xb641('0x2a')]==_0xb641('0x2b')){_0x4103b0[_0xb641('0x2c')]='queue';_0x4103b0['lastdata']=_0x4103b0[_0xb641('0x2d')];if(_0x4103b0['context']==_0xb641('0x2e')){_0x4103b0[_0xb641('0x1c')]='';_0x4103b0[_0xb641('0x28')]=extractCalleridNumber(_0x4103b0[_0xb641('0x2f')]);}else if(_0x4103b0['context']==_0xb641('0x30')){if(_0x4103b0[_0xb641('0x28')]==_0xb641('0x31')){_0x4103b0[_0xb641('0x28')]=extractCalleridNumber(_0x4103b0[_0xb641('0x32')]);_0x4103b0['calleridnum']=_0x4103b0['originatecalleridnum'];_0x4103b0[_0xb641('0x33')]=[_0x4103b0[_0xb641('0x34')],_0x4103b0[_0xb641('0x34')]=_0x4103b0[_0xb641('0x33')]][0x0];_0x4103b0['callerid']=_0x4103b0[_0xb641('0x32')];}else{_0x4103b0[_0xb641('0x28')]=_0x4103b0[_0xb641('0x35')];_0x4103b0[_0xb641('0x35')]=_0x4103b0['originatecalleridnum'];if(_0x4103b0[_0xb641('0x36')]==_0xb641('0x37')){_0x4103b0['accountcode']=_0x4103b0[_0xb641('0x1d')];}else{_0x4103b0[_0xb641('0x1c')]='';}}}}else{_0x4103b0[_0xb641('0x2f')]=util['format'](_0xb641('0x38'),_0x4103b0[_0xb641('0x39')],_0x4103b0[_0xb641('0x35')]);}RpcVoiceCallReport[_0xb641('0x26')](_0x4103b0);if(_0x4103b0[_0xb641('0x3a')]){for(var _0xe5debd=0x0;_0xe5debd<_0x4103b0[_0xb641('0x3b')][_0xb641('0x1b')];_0xe5debd+=0x1){_0x4103b0['monitorFilename']=_0x4103b0[_0xb641('0x3b')][_0xe5debd][_0xb641('0x3c')];_0x4103b0[_0xb641('0x3d')]=_0x4103b0[_0xb641('0x3b')][_0xe5debd][_0xb641('0x3d')];if(_0x4103b0[_0xb641('0x29')]==_0xb641('0x31')){_0x4103b0[_0xb641('0x35')]=_0x4103b0[_0xb641('0x1d')];_0x4103b0[_0xb641('0x39')]=_0x4103b0[_0xb641('0x3e')];_0x4103b0[_0xb641('0x1d')]=_0x4103b0[_0xb641('0x1c')];_0x4103b0[_0xb641('0x3e')]=_0x4103b0[_0xb641('0x3f')];_0x4103b0[_0xb641('0x29')]=_0x4103b0[_0xb641('0x40')];}else if(_0x4103b0['exten']=='xcally-motion-dialer'){_0x4103b0[_0xb641('0x35')]=_0x4103b0['destination'];_0x4103b0[_0xb641('0x29')]=_0x4103b0[_0xb641('0x40')];}RpcVoiceRecording[_0xb641('0x26')](_0x4103b0);}}};Report[_0xb641('0xe')][_0xb641('0x41')]=function(_0x5bacdd){for(var _0x518998=0x0;_0x518998<_0x5bacdd['length'];_0x518998+=0x1){RpcVoiceAgentReport[_0xb641('0x26')](_0x5bacdd[_0x518998]);}};Report['prototype'][_0xb641('0x17')]=function(_0x5b3f6a){RpcVoiceDialReport[_0xb641('0x26')](_0x5b3f6a);RpcMemberReport[_0xb641('0x17')](_0x5b3f6a);};Report[_0xb641('0xe')]['blindTransfer']=function(_0x10d86e){RpcVoiceTransferReport['blindTransfer'](_0x10d86e);};Report[_0xb641('0xe')][_0xb641('0x1a')]=function(_0x2bf266){RpcVoiceTransferReport[_0xb641('0x1a')](_0x2bf266);};module['exports']=Report;
\ No newline at end of file
+var _0x7738=['lastdata','context','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','channel','originatecalleridnum','disposition','ANSWERED','calleridname','monitor','monitors','length','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','voiceAgentReport','bluebird','moment','ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','prototype','sync','realtime','custom:voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceDialReport','blindTransfer','attendedTransfer','voiceQueueReport','find','agents','connectedlinenum','accountcode','assigned','lastAssignedTo','name','queuecallercompleteAt','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','dialer','queue'];(function(_0x296d93,_0x27ee37){var _0xba3f66=function(_0x4ff475){while(--_0x4ff475){_0x296d93['push'](_0x296d93['shift']());}};_0xba3f66(++_0x27ee37);}(_0x7738,0x116));var _0x8773=function(_0x33ea9e,_0x2f0d10){_0x33ea9e=_0x33ea9e-0x0;var _0x3ac557=_0x7738[_0x33ea9e];return _0x3ac557;};'use strict';var BPromise=require(_0x8773('0x0'));var _=require('lodash');var moment=require(_0x8773('0x1'));var util=require('util');var logger=require('../../../config/logger')(_0x8773('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0x8773('0x3'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x8773('0x4'));var RpcMemberReport=require(_0x8773('0x5'));var RpcVoiceQueueReport=require(_0x8773('0x6'));var RpcVoiceRecording=require(_0x8773('0x7'));var RpcVoiceTransferReport=require(_0x8773('0x8'));var VoiceQueueReport=require(_0x8773('0x9'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x8773('0xa'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x39b30f){this['realtime']=_0x39b30f;this['agents']=_0x39b30f['agents'];}Report[_0x8773('0xb')][_0x8773('0xc')]=function(_0x212d3a){var _0xb513a6=new VoiceQueueReport(this[_0x8773('0xd')]);var _0x542ce8=new VoiceAgentReport(this[_0x8773('0xd')]);var _0x56c343=new VoiceDialReport(this[_0x8773('0xd')]);var _0x57af66=new VoiceCallReport(this['realtime']);var _0x39119f=new UserReport(this[_0x8773('0xd')]);ami['on'](_0x8773('0xe'),this['voiceQueueReport']['bind'](this));ami['on'](_0x8773('0xf'),this[_0x8773('0x10')][_0x8773('0x11')](this));ami['on'](_0x8773('0x12'),this['voiceAgentReport'][_0x8773('0x11')](this));ami['on']('custom:voiceDialReport',this[_0x8773('0x13')][_0x8773('0x11')](this));ami['on']('blindtransfer',this[_0x8773('0x14')][_0x8773('0x11')](this));ami['on']('attendedtransfer',this[_0x8773('0x15')]['bind'](this));};Report['prototype'][_0x8773('0x16')]=function(_0x2de937){for(var _0x4a47b5=0x0;_0x4a47b5<_0x2de937['length'];_0x4a47b5+=0x1){var _0x2ff0db=_[_0x8773('0x17')](this[_0x8773('0x18')],function(_0x46582f){return _0x46582f['accountcode']==_0x2de937[_0x4a47b5][_0x8773('0x19')];});if(_0x2ff0db){_0x2de937[_0x4a47b5][_0x8773('0x1a')]=_0x2ff0db[_0x8773('0x1a')];_0x2de937[_0x4a47b5][_0x8773('0x1b')]=!![];_0x2de937[_0x4a47b5][_0x8773('0x1c')]=_0x2ff0db[_0x8773('0x1d')];if(_0x2de937[_0x4a47b5]['queuecallercomplete']){_0x2de937[_0x4a47b5][_0x8773('0x1e')]=moment()[_0x8773('0x1f')](_0x8773('0x20'));}if(_0x2de937[_0x4a47b5][_0x8773('0x21')]){_0x2de937[_0x4a47b5][_0x8773('0x22')]=moment()[_0x8773('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x2de937[_0x4a47b5]);}RpcVoiceQueueReport[_0x8773('0x23')](_0x2de937[_0x4a47b5]);}};function extractCalleridNumber(_0x5f55dd){var _0x1d9bd1=_0x5f55dd[_0x8773('0x24')](/<(.*?)>/);return _0x1d9bd1?_0x1d9bd1[0x1]:_0x5f55dd;}Report[_0x8773('0xb')][_0x8773('0x10')]=function(_0x2807ca){_0x2807ca[_0x8773('0x25')]=_0x2807ca[_0x8773('0x25')]||_0x2807ca[_0x8773('0x26')];if(_0x2807ca[_0x8773('0x27')]==_0x8773('0x28')){_0x2807ca['lastapplication']=_0x8773('0x29');_0x2807ca[_0x8773('0x2a')]=_0x2807ca[_0x8773('0x29')];if(_0x2807ca[_0x8773('0x2b')]==_0x8773('0x2c')){_0x2807ca[_0x8773('0x1a')]='';_0x2807ca['destination']=extractCalleridNumber(_0x2807ca[_0x8773('0x2d')]);}else if(_0x2807ca[_0x8773('0x2b')]=='from-sip'){if(_0x2807ca[_0x8773('0x25')]==_0x8773('0x2e')){_0x2807ca['destination']=extractCalleridNumber(_0x2807ca[_0x8773('0x2f')]);_0x2807ca[_0x8773('0x30')]=_0x2807ca['originatecalleridnum'];_0x2807ca[_0x8773('0x31')]=[_0x2807ca[_0x8773('0x32')],_0x2807ca[_0x8773('0x32')]=_0x2807ca[_0x8773('0x31')]][0x0];_0x2807ca[_0x8773('0x2d')]=_0x2807ca['calleridpreview'];}else{_0x2807ca[_0x8773('0x25')]=_0x2807ca['calleridnum'];_0x2807ca[_0x8773('0x30')]=_0x2807ca[_0x8773('0x33')];if(_0x2807ca[_0x8773('0x34')]==_0x8773('0x35')){_0x2807ca[_0x8773('0x1a')]=_0x2807ca[_0x8773('0x19')];}else{_0x2807ca[_0x8773('0x1a')]='';}}}}else{_0x2807ca['callerid']=util['format']('\x22%s\x22\x20<%s>',_0x2807ca[_0x8773('0x36')],_0x2807ca[_0x8773('0x30')]);}RpcVoiceCallReport[_0x8773('0x23')](_0x2807ca);if(_0x2807ca[_0x8773('0x37')]){for(var _0x4017a9=0x0;_0x4017a9<_0x2807ca[_0x8773('0x38')][_0x8773('0x39')];_0x4017a9+=0x1){_0x2807ca['monitorFilename']=_0x2807ca['monitors'][_0x4017a9][_0x8773('0x3a')];_0x2807ca[_0x8773('0x3b')]=_0x2807ca[_0x8773('0x38')][_0x4017a9][_0x8773('0x3b')];if(_0x2807ca[_0x8773('0x26')]==_0x8773('0x2e')){_0x2807ca[_0x8773('0x30')]=_0x2807ca['connectedlinenum'];_0x2807ca['calleridname']=_0x2807ca['connectedlinename'];_0x2807ca[_0x8773('0x19')]=_0x2807ca[_0x8773('0x1a')];_0x2807ca[_0x8773('0x3c')]=_0x2807ca[_0x8773('0x3d')];_0x2807ca['exten']=_0x2807ca[_0x8773('0x33')];}else if(_0x2807ca[_0x8773('0x26')]==_0x8773('0x3e')){_0x2807ca[_0x8773('0x30')]=_0x2807ca[_0x8773('0x25')];_0x2807ca['exten']=_0x2807ca['originatecalleridnum'];}RpcVoiceRecording[_0x8773('0x23')](_0x2807ca);}}};Report['prototype'][_0x8773('0x3f')]=function(_0x187078){for(var _0x4cf2f5=0x0;_0x4cf2f5<_0x187078[_0x8773('0x39')];_0x4cf2f5+=0x1){RpcVoiceAgentReport['create'](_0x187078[_0x4cf2f5]);}};Report[_0x8773('0xb')][_0x8773('0x13')]=function(_0xb1ca0d){RpcVoiceDialReport['create'](_0xb1ca0d);RpcMemberReport[_0x8773('0x13')](_0xb1ca0d);};Report[_0x8773('0xb')][_0x8773('0x14')]=function(_0x2d690d){RpcVoiceTransferReport[_0x8773('0x14')](_0x2d690d);};Report[_0x8773('0xb')][_0x8773('0x15')]=function(_0x3a413a){RpcVoiceTransferReport[_0x8773('0x15')](_0x3a413a);};module['exports']=Report;
\ No newline at end of file
index 175f9e8..fa1d0b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe549=['syncDeviceState','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','inspect','isNotNull','emit','syncRegistry','find','username','state','omit','event','format','trunk:%s','name','trunk:save','error','[syncRegistry][UserReport]','prototype','local','toLowerCase','inuse','device','stateTime','toNumber','updateStatusRealtime','telephone:%s','telephone:save','startsWith','Queue','Local','substring','mobile','phone','accountcode','peerstatus','peer','registered','status','address','[syncPeerStatus][UserReport]','exports','lodash','moment','bluebird','util','localhost','trunks','agents','telephones','registryentry','bind','devicestatechange'];(function(_0x175b9f,_0x537909){var _0x1a5ce5=function(_0x376d88){while(--_0x376d88){_0x175b9f['push'](_0x175b9f['shift']());}};_0x1a5ce5(++_0x537909);}(_0xe549,0x15d));var _0x9e54=function(_0x41d5cd,_0xb06286){_0x41d5cd=_0x41d5cd-0x0;var _0x2d5eea=_0xe549[_0x41d5cd];return _0x2d5eea;};'use strict';var _=require(_0x9e54('0x0'));var moment=require(_0x9e54('0x1'));var BPromise=require(_0x9e54('0x2'));var util=require(_0x9e54('0x3'));var logger=require('../../../config/logger')('ami');var ami=require('../ami');var io=require('socket.io-emitter')({'host':_0x9e54('0x4'),'port':0x18eb});function UserReport(_0x1c90b0){this[_0x9e54('0x5')]=_0x1c90b0[_0x9e54('0x5')];this[_0x9e54('0x6')]=_0x1c90b0[_0x9e54('0x6')];this[_0x9e54('0x7')]=_0x1c90b0[_0x9e54('0x7')];ami['on'](_0x9e54('0x8'),this['syncRegistry'][_0x9e54('0x9')](this));ami['on']('registry',this['syncRegistry']['bind'](this));ami['on'](_0x9e54('0xa'),this[_0x9e54('0xb')][_0x9e54('0x9')](this));ami['on']('peerstatus',this[_0x9e54('0xc')][_0x9e54('0x9')](this));this[_0x9e54('0xd')]();return BPromise[_0x9e54('0xe')]()[_0x9e54('0xf')](ami[_0x9e54('0x10')]())[_0x9e54('0xf')](ami[_0x9e54('0x11')]())[_0x9e54('0xf')](ami[_0x9e54('0x12')]())[_0x9e54('0x13')](loggerCatch(_0x9e54('0x14')));}function loggerCatch(_0x46665e){return function(_0x120547){logger['error'](_0x46665e,util[_0x9e54('0x15')](_0x120547,{'showHidden':![],'depth':null}));};}UserReport['prototype']['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise[_0x9e54('0xe')]()[_0x9e54('0xf')](ami['actionSipShowRegistry']())[_0x9e54('0xf')](ami[_0x9e54('0x11')]())['then'](ami[_0x9e54('0x12')]())[_0x9e54('0x13')](loggerCatch(_0x9e54('0x14')));},0x32c8);};UserReport['prototype'][_0x9e54('0x16')]=function(_0x2728d9){return _0x2728d9!==null&&!_['isUndefined'](_0x2728d9);};UserReport['prototype'][_0x9e54('0x17')]=function(_0x2b56ce,_0x25f14b,_0x55f9ab){io['to'](_0x2b56ce)[_0x9e54('0x17')](_0x25f14b,_0x55f9ab);};UserReport['prototype'][_0x9e54('0x18')]=function(_0x32770e){try{if(this[_0x9e54('0x16')](_0x32770e)){var _0x5c60ac=_[_0x9e54('0x19')](this[_0x9e54('0x5')],{'registry':_0x32770e[_0x9e54('0x1a')]});if(_0x5c60ac){_0x32770e['stateRegistry']=_0x32770e[_0x9e54('0x1b')];_['merge'](_0x5c60ac,_[_0x9e54('0x1c')](_0x32770e,[_0x9e54('0x1d'),'actionid',_0x9e54('0x1a'),_0x9e54('0x1b')]));this[_0x9e54('0x17')](util[_0x9e54('0x1e')](_0x9e54('0x1f'),_0x5c60ac[_0x9e54('0x20')]),_0x9e54('0x21'),_0x5c60ac);}}}catch(_0x420576){logger[_0x9e54('0x22')](_0x9e54('0x23'),util[_0x9e54('0x15')](_0x420576,{'showHidden':![],'depth':null}));}};UserReport[_0x9e54('0x24')][_0x9e54('0xb')]=function(_0x10fc37){try{if(this[_0x9e54('0x16')](_0x10fc37)){if(this['agents'][_0x10fc37['device']]){if(!this[_0x9e54('0x6')][_0x10fc37['device']][_0x9e54('0x25')]||_0x10fc37[_0x9e54('0x1b')][_0x9e54('0x26')]()==_0x9e54('0x27')){this[_0x9e54('0x6')][_0x10fc37['device']][_0x9e54('0x25')]=![];if(this[_0x9e54('0x6')][_0x10fc37[_0x9e54('0x28')]][_0x9e54('0x1b')]!==_0x10fc37[_0x9e54('0x1b')]['toLowerCase']()){this['agents'][_0x10fc37[_0x9e54('0x28')]][_0x9e54('0x29')]=_[_0x9e54('0x2a')](moment()[_0x9e54('0x1e')]('x'));}this['agents'][_0x10fc37['device']][_0x9e54('0x1b')]=_0x10fc37[_0x9e54('0x1b')]['toLowerCase']();this['agents'][_0x10fc37[_0x9e54('0x28')]][_0x9e54('0x2b')](_0x10fc37);}}else if(this['telephones'][_0x10fc37['device']]){if(this[_0x9e54('0x7')][_0x10fc37[_0x9e54('0x28')]][_0x9e54('0x1b')]!==_0x10fc37[_0x9e54('0x1b')][_0x9e54('0x26')]()){this[_0x9e54('0x7')][_0x10fc37[_0x9e54('0x28')]]['stateTime']=_[_0x9e54('0x2a')](moment()[_0x9e54('0x1e')]('x'));}this['telephones'][_0x10fc37[_0x9e54('0x28')]][_0x9e54('0x1b')]=_0x10fc37['state'][_0x9e54('0x26')]();this[_0x9e54('0x17')](util[_0x9e54('0x1e')](_0x9e54('0x2c'),this['telephones'][_0x10fc37[_0x9e54('0x28')]][_0x9e54('0x20')]),_0x9e54('0x2d'),this['telephones'][_0x10fc37[_0x9e54('0x28')]]);}else if(this[_0x9e54('0x5')][_0x10fc37['device']]){if(this[_0x9e54('0x5')][_0x10fc37[_0x9e54('0x28')]]['state']!==_0x10fc37[_0x9e54('0x1b')][_0x9e54('0x26')]()){this[_0x9e54('0x5')][_0x10fc37[_0x9e54('0x28')]][_0x9e54('0x29')]=_[_0x9e54('0x2a')](moment()[_0x9e54('0x1e')]('x'));}this[_0x9e54('0x5')][_0x10fc37[_0x9e54('0x28')]][_0x9e54('0x1b')]=_0x10fc37[_0x9e54('0x1b')][_0x9e54('0x26')]();this[_0x9e54('0x17')](util[_0x9e54('0x1e')](_0x9e54('0x1f'),this[_0x9e54('0x5')][_0x10fc37[_0x9e54('0x28')]][_0x9e54('0x20')]),_0x9e54('0x21'),this[_0x9e54('0x5')][_0x10fc37[_0x9e54('0x28')]]);}else if(_[_0x9e54('0x2e')](_0x10fc37['device'],_0x9e54('0x2f'))){}else if(_[_0x9e54('0x2e')](_0x10fc37[_0x9e54('0x28')],_0x9e54('0x30'))){var _0x198b63=_0x10fc37['device'];var _0x202c71=_0x198b63[_0x9e54('0x31')](_0x198b63['indexOf']('/')+0x1,_0x198b63['indexOf']('@'));var _0x3e8a07=_[_0x9e54('0x19')](this[_0x9e54('0x6')],function(_0x576372){return _0x576372[_0x9e54('0x32')]==_0x202c71||_0x576372[_0x9e54('0x33')]==_0x202c71||_0x576372[_0x9e54('0x34')]==_0x202c71;});if(_0x3e8a07){if(_0x3e8a07[_0x9e54('0x1b')]!==_0x10fc37['state'][_0x9e54('0x26')]()){_0x3e8a07[_0x9e54('0x29')]=_['toNumber'](moment()[_0x9e54('0x1e')]('x'));}_0x3e8a07['state']=_0x10fc37[_0x9e54('0x1b')][_0x9e54('0x26')]();_0x3e8a07['local']=!![];_0x3e8a07[_0x9e54('0x2b')](_0x10fc37);}}else{}}}catch(_0x386e6c){logger[_0x9e54('0x22')]('[syncDeviceState][UserReport]',util[_0x9e54('0x15')](_0x386e6c,{'showHidden':![],'depth':null}));}};UserReport[_0x9e54('0x24')][_0x9e54('0xc')]=function(_0x3643c0){try{if(this[_0x9e54('0x16')](_0x3643c0)&&this[_0x9e54('0x16')](_0x3643c0[_0x9e54('0x35')])){if(this[_0x9e54('0x6')][_0x3643c0[_0x9e54('0x36')]]){if(!this[_0x9e54('0x6')][_0x3643c0[_0x9e54('0x36')]][_0x9e54('0x25')]||_0x3643c0['peerstatus'][_0x9e54('0x26')]()==_0x9e54('0x37')){this['agents'][_0x3643c0[_0x9e54('0x36')]][_0x9e54('0x25')]=![];this[_0x9e54('0x6')][_0x3643c0[_0x9e54('0x36')]][_0x9e54('0x38')]=_0x3643c0[_0x9e54('0x35')][_0x9e54('0x26')]();this['agents'][_0x3643c0['peer']]['address']=_0x3643c0[_0x9e54('0x39')];this['agents'][_0x3643c0['peer']]['updateStatusRealtime'](_0x3643c0);}}else if(this['telephones'][_0x3643c0[_0x9e54('0x36')]]){this[_0x9e54('0x7')][_0x3643c0['peer']][_0x9e54('0x38')]=_0x3643c0[_0x9e54('0x35')][_0x9e54('0x26')]();this[_0x9e54('0x7')][_0x3643c0[_0x9e54('0x36')]]['address']=_0x3643c0[_0x9e54('0x39')];this[_0x9e54('0x17')](util['format'](_0x9e54('0x2c'),this['telephones'][_0x3643c0[_0x9e54('0x36')]]['name']),_0x9e54('0x2d'),this[_0x9e54('0x7')][_0x3643c0[_0x9e54('0x36')]]);}else if(this[_0x9e54('0x5')][_0x3643c0[_0x9e54('0x36')]]){this[_0x9e54('0x5')][_0x3643c0[_0x9e54('0x36')]]['status']=_0x3643c0[_0x9e54('0x35')]['toLowerCase']();this[_0x9e54('0x5')][_0x3643c0[_0x9e54('0x36')]][_0x9e54('0x39')]=_0x3643c0[_0x9e54('0x39')];this[_0x9e54('0x17')](util[_0x9e54('0x1e')](_0x9e54('0x1f'),this[_0x9e54('0x5')][_0x3643c0[_0x9e54('0x36')]]['name']),_0x9e54('0x21'),this['trunks'][_0x3643c0[_0x9e54('0x36')]]);}else{}}}catch(_0x52ca99){logger[_0x9e54('0x22')](_0x9e54('0x3a'),util['inspect'](_0x52ca99,{'showHidden':![],'depth':null}));}};module[_0x9e54('0x3b')]=UserReport;
\ No newline at end of file
+var _0xa1f8=['local','toLowerCase','inuse','stateTime','toNumber','format','telephone:%s','trunk:%s','trunk:save','startsWith','substring','indexOf','mobile','phone','syncPeerStatus','peer','status','address','updateStatusRealtime','[syncPeerStatus][UserReport]','exports','lodash','moment','bluebird','util','../../../config/logger','ami','../ami','socket.io-emitter','localhost','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','loopSyncRealTimeShow','then','actionSipShowRegistry','[loopSyncRealTimeShow]','error','inspect','prototype','resolve','actionDeviceStateList','actionSipPeerStatus','catch','isNotNull','isUndefined','emit','find','stateRegistry','state','merge','omit','event','actionid','username','name','[syncRegistry][UserReport]','device'];(function(_0x50a134,_0x119b60){var _0x13c289=function(_0x12b960){while(--_0x12b960){_0x50a134['push'](_0x50a134['shift']());}};_0x13c289(++_0x119b60);}(_0xa1f8,0x1dc));var _0x8a1f=function(_0x15647c,_0x84f761){_0x15647c=_0x15647c-0x0;var _0x4ebe3b=_0xa1f8[_0x15647c];return _0x4ebe3b;};'use strict';var _=require(_0x8a1f('0x0'));var moment=require(_0x8a1f('0x1'));var BPromise=require(_0x8a1f('0x2'));var util=require(_0x8a1f('0x3'));var logger=require(_0x8a1f('0x4'))(_0x8a1f('0x5'));var ami=require(_0x8a1f('0x6'));var io=require(_0x8a1f('0x7'))({'host':_0x8a1f('0x8'),'port':0x18eb});function UserReport(_0xc60df6){this[_0x8a1f('0x9')]=_0xc60df6[_0x8a1f('0x9')];this[_0x8a1f('0xa')]=_0xc60df6[_0x8a1f('0xa')];this[_0x8a1f('0xb')]=_0xc60df6[_0x8a1f('0xb')];ami['on'](_0x8a1f('0xc'),this[_0x8a1f('0xd')][_0x8a1f('0xe')](this));ami['on'](_0x8a1f('0xf'),this[_0x8a1f('0xd')]['bind'](this));ami['on'](_0x8a1f('0x10'),this[_0x8a1f('0x11')]['bind'](this));ami['on'](_0x8a1f('0x12'),this['syncPeerStatus'][_0x8a1f('0xe')](this));this[_0x8a1f('0x13')]();return BPromise['resolve']()[_0x8a1f('0x14')](ami[_0x8a1f('0x15')]())[_0x8a1f('0x14')](ami['actionDeviceStateList']())['then'](ami['actionSipPeerStatus']())['catch'](loggerCatch(_0x8a1f('0x16')));}function loggerCatch(_0x365f14){return function(_0x22e0ca){logger[_0x8a1f('0x17')](_0x365f14,util[_0x8a1f('0x18')](_0x22e0ca,{'showHidden':![],'depth':null}));};}UserReport[_0x8a1f('0x19')][_0x8a1f('0x13')]=function(){setInterval(function(){BPromise[_0x8a1f('0x1a')]()[_0x8a1f('0x14')](ami[_0x8a1f('0x15')]())[_0x8a1f('0x14')](ami[_0x8a1f('0x1b')]())[_0x8a1f('0x14')](ami[_0x8a1f('0x1c')]())[_0x8a1f('0x1d')](loggerCatch('[loopSyncRealTimeShow]'));},0x32c8);};UserReport[_0x8a1f('0x19')][_0x8a1f('0x1e')]=function(_0x326c6f){return _0x326c6f!==null&&!_[_0x8a1f('0x1f')](_0x326c6f);};UserReport[_0x8a1f('0x19')][_0x8a1f('0x20')]=function(_0x420db4,_0x23bc64,_0x1b3e28){io['to'](_0x420db4)[_0x8a1f('0x20')](_0x23bc64,_0x1b3e28);};UserReport[_0x8a1f('0x19')][_0x8a1f('0xd')]=function(_0x28d83d){try{if(this[_0x8a1f('0x1e')](_0x28d83d)){var _0x2fa1d8=_[_0x8a1f('0x21')](this['trunks'],{'registry':_0x28d83d['username']});if(_0x2fa1d8){_0x28d83d[_0x8a1f('0x22')]=_0x28d83d[_0x8a1f('0x23')];_[_0x8a1f('0x24')](_0x2fa1d8,_[_0x8a1f('0x25')](_0x28d83d,[_0x8a1f('0x26'),_0x8a1f('0x27'),_0x8a1f('0x28'),_0x8a1f('0x23')]));this[_0x8a1f('0x20')](util['format']('trunk:%s',_0x2fa1d8[_0x8a1f('0x29')]),'trunk:save',_0x2fa1d8);}}}catch(_0x2473cd){logger['error'](_0x8a1f('0x2a'),util[_0x8a1f('0x18')](_0x2473cd,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x8a1f('0x11')]=function(_0xc0ab37){try{if(this['isNotNull'](_0xc0ab37)){if(this[_0x8a1f('0xa')][_0xc0ab37[_0x8a1f('0x2b')]]){if(!this[_0x8a1f('0xa')][_0xc0ab37[_0x8a1f('0x2b')]][_0x8a1f('0x2c')]||_0xc0ab37['state'][_0x8a1f('0x2d')]()==_0x8a1f('0x2e')){this['agents'][_0xc0ab37[_0x8a1f('0x2b')]][_0x8a1f('0x2c')]=![];if(this[_0x8a1f('0xa')][_0xc0ab37[_0x8a1f('0x2b')]][_0x8a1f('0x23')]!==_0xc0ab37['state'][_0x8a1f('0x2d')]()){this[_0x8a1f('0xa')][_0xc0ab37[_0x8a1f('0x2b')]][_0x8a1f('0x2f')]=_[_0x8a1f('0x30')](moment()[_0x8a1f('0x31')]('x'));}this[_0x8a1f('0xa')][_0xc0ab37[_0x8a1f('0x2b')]]['state']=_0xc0ab37[_0x8a1f('0x23')][_0x8a1f('0x2d')]();this['agents'][_0xc0ab37[_0x8a1f('0x2b')]]['updateStatusRealtime'](_0xc0ab37);}}else if(this[_0x8a1f('0xb')][_0xc0ab37[_0x8a1f('0x2b')]]){if(this['telephones'][_0xc0ab37[_0x8a1f('0x2b')]][_0x8a1f('0x23')]!==_0xc0ab37['state'][_0x8a1f('0x2d')]()){this[_0x8a1f('0xb')][_0xc0ab37[_0x8a1f('0x2b')]]['stateTime']=_[_0x8a1f('0x30')](moment()['format']('x'));}this[_0x8a1f('0xb')][_0xc0ab37[_0x8a1f('0x2b')]][_0x8a1f('0x23')]=_0xc0ab37[_0x8a1f('0x23')]['toLowerCase']();this[_0x8a1f('0x20')](util['format'](_0x8a1f('0x32'),this['telephones'][_0xc0ab37[_0x8a1f('0x2b')]]['name']),'telephone:save',this[_0x8a1f('0xb')][_0xc0ab37[_0x8a1f('0x2b')]]);}else if(this['trunks'][_0xc0ab37[_0x8a1f('0x2b')]]){if(this['trunks'][_0xc0ab37[_0x8a1f('0x2b')]]['state']!==_0xc0ab37['state'][_0x8a1f('0x2d')]()){this['trunks'][_0xc0ab37['device']][_0x8a1f('0x2f')]=_[_0x8a1f('0x30')](moment()['format']('x'));}this[_0x8a1f('0x9')][_0xc0ab37[_0x8a1f('0x2b')]][_0x8a1f('0x23')]=_0xc0ab37[_0x8a1f('0x23')][_0x8a1f('0x2d')]();this[_0x8a1f('0x20')](util[_0x8a1f('0x31')](_0x8a1f('0x33'),this[_0x8a1f('0x9')][_0xc0ab37[_0x8a1f('0x2b')]]['name']),_0x8a1f('0x34'),this[_0x8a1f('0x9')][_0xc0ab37[_0x8a1f('0x2b')]]);}else if(_[_0x8a1f('0x35')](_0xc0ab37[_0x8a1f('0x2b')],'Queue')){}else if(_['startsWith'](_0xc0ab37[_0x8a1f('0x2b')],'Local')){var _0x5ee5c5=_0xc0ab37[_0x8a1f('0x2b')];var _0x5e8176=_0x5ee5c5[_0x8a1f('0x36')](_0x5ee5c5[_0x8a1f('0x37')]('/')+0x1,_0x5ee5c5[_0x8a1f('0x37')]('@'));var _0xedc6b2=_[_0x8a1f('0x21')](this[_0x8a1f('0xa')],function(_0x164421){return _0x164421[_0x8a1f('0x38')]==_0x5e8176||_0x164421[_0x8a1f('0x39')]==_0x5e8176||_0x164421['accountcode']==_0x5e8176;});if(_0xedc6b2){if(_0xedc6b2['state']!==_0xc0ab37['state'][_0x8a1f('0x2d')]()){_0xedc6b2['stateTime']=_[_0x8a1f('0x30')](moment()[_0x8a1f('0x31')]('x'));}_0xedc6b2[_0x8a1f('0x23')]=_0xc0ab37[_0x8a1f('0x23')]['toLowerCase']();_0xedc6b2[_0x8a1f('0x2c')]=!![];_0xedc6b2['updateStatusRealtime'](_0xc0ab37);}}else{}}}catch(_0x32b3ce){logger[_0x8a1f('0x17')]('[syncDeviceState][UserReport]',util[_0x8a1f('0x18')](_0x32b3ce,{'showHidden':![],'depth':null}));}};UserReport[_0x8a1f('0x19')][_0x8a1f('0x3a')]=function(_0x16d3b7){try{if(this['isNotNull'](_0x16d3b7)&&this['isNotNull'](_0x16d3b7[_0x8a1f('0x12')])){if(this[_0x8a1f('0xa')][_0x16d3b7[_0x8a1f('0x3b')]]){if(!this[_0x8a1f('0xa')][_0x16d3b7[_0x8a1f('0x3b')]][_0x8a1f('0x2c')]||_0x16d3b7[_0x8a1f('0x12')][_0x8a1f('0x2d')]()=='registered'){this[_0x8a1f('0xa')][_0x16d3b7[_0x8a1f('0x3b')]][_0x8a1f('0x2c')]=![];this[_0x8a1f('0xa')][_0x16d3b7['peer']][_0x8a1f('0x3c')]=_0x16d3b7[_0x8a1f('0x12')][_0x8a1f('0x2d')]();this[_0x8a1f('0xa')][_0x16d3b7['peer']][_0x8a1f('0x3d')]=_0x16d3b7[_0x8a1f('0x3d')];this[_0x8a1f('0xa')][_0x16d3b7[_0x8a1f('0x3b')]][_0x8a1f('0x3e')](_0x16d3b7);}}else if(this[_0x8a1f('0xb')][_0x16d3b7['peer']]){this['telephones'][_0x16d3b7['peer']][_0x8a1f('0x3c')]=_0x16d3b7[_0x8a1f('0x12')][_0x8a1f('0x2d')]();this[_0x8a1f('0xb')][_0x16d3b7[_0x8a1f('0x3b')]][_0x8a1f('0x3d')]=_0x16d3b7[_0x8a1f('0x3d')];this[_0x8a1f('0x20')](util[_0x8a1f('0x31')]('telephone:%s',this[_0x8a1f('0xb')][_0x16d3b7['peer']]['name']),'telephone:save',this[_0x8a1f('0xb')][_0x16d3b7[_0x8a1f('0x3b')]]);}else if(this[_0x8a1f('0x9')][_0x16d3b7[_0x8a1f('0x3b')]]){this[_0x8a1f('0x9')][_0x16d3b7[_0x8a1f('0x3b')]]['status']=_0x16d3b7[_0x8a1f('0x12')][_0x8a1f('0x2d')]();this['trunks'][_0x16d3b7[_0x8a1f('0x3b')]][_0x8a1f('0x3d')]=_0x16d3b7['address'];this[_0x8a1f('0x20')](util[_0x8a1f('0x31')](_0x8a1f('0x33'),this[_0x8a1f('0x9')][_0x16d3b7[_0x8a1f('0x3b')]][_0x8a1f('0x29')]),_0x8a1f('0x34'),this[_0x8a1f('0x9')][_0x16d3b7[_0x8a1f('0x3b')]]);}else{}}}catch(_0x3f1df0){logger['error'](_0x8a1f('0x3f'),util[_0x8a1f('0x18')](_0x3f1df0,{'showHidden':![],'depth':null}));}};module[_0x8a1f('0x40')]=UserReport;
\ No newline at end of file
index 8755b2f..8f291a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x381e=['[syncHangup][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','lodash','moment','../../../config/logger','../ami','localhost','channels','voiceQueues','agents','variables','agentcalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','prototype','emit','isUndefined','isNotNull','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','omit','event','custom:agentcalled','user:%s','membername','user:called','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','user:agentconnect','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','error','[syncAgentConnect][VoiceAgentReport]','[syncAgentRingNoAnswer][VoiceAgentReport]','agentringnoanswerAt','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcomplete','talktime','acw','agentacw','acwtime','acwTimeout','destconnectedlinenum','user:agentcomplete','custom:agentcomplete','addVariable','keys','value','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepvtcallid','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','custom:voiceAgentReport','values'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x381e,0xcc));var _0xe381=function(_0x1499f0,_0x28024b){_0x1499f0=_0x1499f0-0x0;var _0x48eeb1=_0x381e[_0x1499f0];return _0x48eeb1;};'use strict';var _=require(_0xe381('0x0'));var moment=require(_0xe381('0x1'));var util=require('util');var logger=require(_0xe381('0x2'))('ami');var ami=require(_0xe381('0x3'));var io=require('socket.io-emitter')({'host':_0xe381('0x4'),'port':0x18eb});function VoiceAgentReport(_0x146428){this[_0xe381('0x5')]={};this['voiceQueues']=_0x146428[_0xe381('0x6')];this['agents']=_0x146428[_0xe381('0x7')];this[_0xe381('0x8')]={};ami['on'](_0xe381('0x9'),this['syncAgentCalled'][_0xe381('0xa')](this));ami['on']('agentconnect',this[_0xe381('0xb')][_0xe381('0xa')](this));ami['on'](_0xe381('0xc'),this[_0xe381('0xd')][_0xe381('0xa')](this));ami['on'](_0xe381('0xe'),this[_0xe381('0xf')][_0xe381('0xa')](this));ami['on']('agentcomplete',this[_0xe381('0x10')][_0xe381('0xa')](this));ami['on'](_0xe381('0x11'),this[_0xe381('0x12')][_0xe381('0xa')](this));ami['on'](_0xe381('0x13'),this[_0xe381('0x14')][_0xe381('0xa')](this));ami['on'](_0xe381('0x15'),this[_0xe381('0x16')][_0xe381('0xa')](this));ami['on'](_0xe381('0x17'),this[_0xe381('0x18')]['bind'](this));}VoiceAgentReport[_0xe381('0x19')][_0xe381('0x1a')]=function(_0x56515a,_0xfaa20f,_0x18d5be){io['to'](_0x56515a)['emit'](_0xfaa20f,_0x18d5be);};VoiceAgentReport[_0xe381('0x19')]['isNotNull']=function(_0x10d0f2){return _0x10d0f2!==null&&!_[_0xe381('0x1b')](_0x10d0f2);};VoiceAgentReport[_0xe381('0x19')]['syncAgentCalled']=function(_0x43a8e4){try{if(this[_0xe381('0x1c')](_0x43a8e4)){if(_['isUndefined'](this['channels'][_0x43a8e4['uniqueid']])){this[_0xe381('0x5')][_0x43a8e4[_0xe381('0x1d')]]={};}if(_[_0xe381('0x1b')](this[_0xe381('0x5')][_0x43a8e4['uniqueid']][_0x43a8e4[_0xe381('0x1e')]])){this[_0xe381('0x5')][_0x43a8e4['uniqueid']][_0x43a8e4[_0xe381('0x1e')]]={'agentcalledAt':moment()[_0xe381('0x1f')](_0xe381('0x20')),'lastevent':_0xe381('0x21'),'variables':this[_0xe381('0x8')][_0x43a8e4[_0xe381('0x1d')]],'type':this[_0xe381('0x6')][_0x43a8e4[_0xe381('0x22')]]?this[_0xe381('0x6')][_0x43a8e4[_0xe381('0x22')]][_0xe381('0x23')]||_0xe381('0x24'):'inbound'};}_[_0xe381('0x25')](this['channels'][_0x43a8e4['uniqueid']][_0x43a8e4[_0xe381('0x1e')]],_[_0xe381('0x26')](_0x43a8e4,[_0xe381('0x27'),'privilege']));ami[_0xe381('0x1a')](_0xe381('0x28'),this['channels'][_0x43a8e4['uniqueid']][_0x43a8e4['destuniqueid']]);this[_0xe381('0x1a')](util[_0xe381('0x1f')](_0xe381('0x29'),_0x43a8e4[_0xe381('0x2a')]),_0xe381('0x2b'),this[_0xe381('0x5')][_0x43a8e4[_0xe381('0x1d')]][_0x43a8e4['destuniqueid']]);}}catch(_0x14000f){logger['error'](_0xe381('0x2c'),util[_0xe381('0x2d')](_0x14000f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe381('0x19')][_0xe381('0xb')]=function(_0x527a0f){try{if(this[_0xe381('0x1c')](_0x527a0f)){if(this[_0xe381('0x5')][_0x527a0f[_0xe381('0x1d')]]){for(var _0x470a99 in this[_0xe381('0x5')][_0x527a0f['uniqueid']]){if(this[_0xe381('0x5')][_0x527a0f[_0xe381('0x1d')]][_0xe381('0x2e')](_0x470a99)){if(_0x527a0f[_0xe381('0x1e')]===_0x470a99){this[_0xe381('0x5')][_0x527a0f[_0xe381('0x1d')]][_0x470a99][_0xe381('0x2f')]=moment()[_0xe381('0x1f')](_0xe381('0x20'));this[_0xe381('0x5')][_0x527a0f[_0xe381('0x1d')]][_0x470a99][_0xe381('0x30')]=_0xe381('0x31');this[_0xe381('0x5')][_0x527a0f[_0xe381('0x1d')]][_0x470a99][_0xe381('0x32')]=_0x527a0f[_0xe381('0x32')];this[_0xe381('0x5')][_0x527a0f[_0xe381('0x1d')]][_0x470a99]['connectedlinenum']=_0x527a0f[_0xe381('0x33')];this['channels'][_0x527a0f[_0xe381('0x1d')]][_0x470a99][_0xe381('0x34')]=_0x527a0f[_0xe381('0x34')];this['channels'][_0x527a0f[_0xe381('0x1d')]][_0x470a99][_0xe381('0x35')]=_0x527a0f[_0xe381('0x35')];this[_0xe381('0x5')][_0x527a0f[_0xe381('0x1d')]][_0x470a99]['destchannelstatedesc']=_0x527a0f[_0xe381('0x36')];_[_0xe381('0x25')](this[_0xe381('0x7')][_0x527a0f[_0xe381('0x37')]],_[_0xe381('0x38')](_0x527a0f,['queue','destconnectedlinenum']));this[_0xe381('0x1a')](util[_0xe381('0x1f')](_0xe381('0x29'),_0x527a0f['membername']),_0xe381('0x39'),this[_0xe381('0x5')][_0x527a0f[_0xe381('0x1d')]][_0x527a0f[_0xe381('0x1e')]]);ami[_0xe381('0x1a')]('custom:agentconnect',this[_0xe381('0x5')][_0x527a0f['uniqueid']][_0x470a99]);}else if(this[_0xe381('0x1c')](this[_0xe381('0x5')][_0x527a0f['uniqueid']][_0x470a99]['agentringnoanswer'])){this[_0xe381('0x5')][_0x527a0f['uniqueid']][_0x470a99][_0xe381('0xc')]=!![];this[_0xe381('0x5')][_0x527a0f['uniqueid']][_0x470a99]['agentringnoanswerAt']=moment()[_0xe381('0x1f')](_0xe381('0x20'));this['channels'][_0x527a0f['uniqueid']][_0x470a99][_0xe381('0x3a')]=_0xe381('0x3b');this[_0xe381('0x5')][_0x527a0f[_0xe381('0x1d')]][_0x470a99][_0xe381('0x30')]=_0xe381('0x3b');this[_0xe381('0x5')][_0x527a0f['uniqueid']][_0x470a99][_0xe381('0x3c')]=_0x527a0f[_0xe381('0x1e')];this[_0xe381('0x5')][_0x527a0f[_0xe381('0x1d')]][_0x470a99][_0xe381('0x3d')]=_0x527a0f['membername'];ami[_0xe381('0x1a')]('custom:agentansweredelsewhere',this[_0xe381('0x5')][_0x527a0f['uniqueid']][_0x470a99]);}}}}}}catch(_0x47079b){logger[_0xe381('0x3e')](_0xe381('0x3f'),util[_0xe381('0x2d')](_0x47079b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe381('0xd')]=function(_0x2ba047){try{if(this[_0xe381('0x1c')](_0x2ba047)){if(this[_0xe381('0x5')][_0x2ba047['uniqueid']]&&this[_0xe381('0x5')][_0x2ba047[_0xe381('0x1d')]][_0x2ba047['destuniqueid']]&&_['isUndefined'](this[_0xe381('0x5')][_0x2ba047[_0xe381('0x1d')]][_0x2ba047[_0xe381('0x1e')]][_0xe381('0xc')])){this[_0xe381('0x5')][_0x2ba047[_0xe381('0x1d')]][_0x2ba047['destuniqueid']][_0xe381('0xc')]=!![];this[_0xe381('0x5')][_0x2ba047['uniqueid']][_0x2ba047[_0xe381('0x1e')]]['agentringnoanswerAt']=moment()[_0xe381('0x1f')](_0xe381('0x20'));this[_0xe381('0x5')][_0x2ba047[_0xe381('0x1d')]][_0x2ba047[_0xe381('0x1e')]][_0xe381('0x3a')]='rejected';this['channels'][_0x2ba047[_0xe381('0x1d')]][_0x2ba047[_0xe381('0x1e')]][_0xe381('0x30')]='rejected';ami[_0xe381('0x1a')]('custom:agentringnoanswer',this['channels'][_0x2ba047[_0xe381('0x1d')]][_0x2ba047['destuniqueid']]);}}}catch(_0x53ff21){logger['error'](_0xe381('0x40'),util[_0xe381('0x2d')](_0x53ff21,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe381('0x19')][_0xe381('0xf')]=function(_0x54d666){try{if(this[_0xe381('0x1c')](_0x54d666)){if(this[_0xe381('0x5')][_0x54d666[_0xe381('0x1d')]]){for(var _0x5a112f in this['channels'][_0x54d666[_0xe381('0x1d')]]){if(this[_0xe381('0x5')][_0x54d666['uniqueid']][_0xe381('0x2e')](_0x5a112f)&&_[_0xe381('0x1b')](this[_0xe381('0x5')][_0x54d666[_0xe381('0x1d')]][_0x5a112f]['agentringnoanswer'])){this[_0xe381('0x5')][_0x54d666[_0xe381('0x1d')]][_0x5a112f][_0xe381('0xc')]=!![];this[_0xe381('0x5')][_0x54d666[_0xe381('0x1d')]][_0x5a112f][_0xe381('0x41')]=moment()[_0xe381('0x1f')](_0xe381('0x20'));this[_0xe381('0x5')][_0x54d666[_0xe381('0x1d')]][_0x5a112f]['reason']='abandoned';this['channels'][_0x54d666[_0xe381('0x1d')]][_0x5a112f][_0xe381('0x30')]=_0xe381('0x42');ami[_0xe381('0x1a')](_0xe381('0x43'),this[_0xe381('0x5')][_0x54d666[_0xe381('0x1d')]][_0x5a112f]);}}}}}catch(_0x5dc71b){logger[_0xe381('0x3e')](_0xe381('0x44'),util[_0xe381('0x2d')](_0x5dc71b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe381('0x19')][_0xe381('0x10')]=function(_0x2befca){try{if(this[_0xe381('0x1c')](_0x2befca)){if(this[_0xe381('0x5')][_0x2befca[_0xe381('0x1d')]]&&this[_0xe381('0x5')][_0x2befca['uniqueid']][_0x2befca[_0xe381('0x1e')]]&&_[_0xe381('0x1b')](this[_0xe381('0x5')][_0x2befca[_0xe381('0x1d')]][_0x2befca['destuniqueid']][_0xe381('0x45')])){this[_0xe381('0x5')][_0x2befca[_0xe381('0x1d')]][_0x2befca[_0xe381('0x1e')]][_0xe381('0x45')]=!![];this[_0xe381('0x5')][_0x2befca[_0xe381('0x1d')]][_0x2befca['destuniqueid']]['agentcompleteAt']=moment()[_0xe381('0x1f')](_0xe381('0x20'));this['channels'][_0x2befca[_0xe381('0x1d')]][_0x2befca[_0xe381('0x1e')]]['lastevent']='complete';this[_0xe381('0x5')][_0x2befca['uniqueid']][_0x2befca[_0xe381('0x1e')]][_0xe381('0x46')]=_0x2befca['talktime'];this[_0xe381('0x5')][_0x2befca[_0xe381('0x1d')]][_0x2befca[_0xe381('0x1e')]][_0xe381('0x3a')]=_0x2befca[_0xe381('0x3a')];if(this[_0xe381('0x6')][_0x2befca[_0xe381('0x22')]]&&this[_0xe381('0x6')][_0x2befca[_0xe381('0x22')]][_0xe381('0x47')]){this[_0xe381('0x5')][_0x2befca[_0xe381('0x1d')]][_0x2befca[_0xe381('0x1e')]][_0xe381('0x48')]=!![];this[_0xe381('0x5')][_0x2befca[_0xe381('0x1d')]][_0x2befca['destuniqueid']][_0xe381('0x49')]=this['voiceQueues'][_0x2befca[_0xe381('0x22')]][_0xe381('0x4a')];}this['agents'][_0x2befca[_0xe381('0x37')]]=_[_0xe381('0x26')](this[_0xe381('0x7')][_0x2befca[_0xe381('0x37')]],[_0xe381('0x22'),_0xe381('0x4b')]);this[_0xe381('0x1a')](util['format'](_0xe381('0x29'),_0x2befca[_0xe381('0x2a')]),_0xe381('0x4c'),this[_0xe381('0x5')][_0x2befca[_0xe381('0x1d')]][_0x2befca[_0xe381('0x1e')]]);ami['emit'](_0xe381('0x4d'),this[_0xe381('0x5')][_0x2befca[_0xe381('0x1d')]][_0x2befca['destuniqueid']]);}}}catch(_0x41fb2a){logger[_0xe381('0x3e')]('[syncAgentComplete][VoiceAgentReport]',util[_0xe381('0x2d')](_0x41fb2a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe381('0x19')][_0xe381('0x12')]=function(_0x423f5b){try{if(this[_0xe381('0x1c')](_0x423f5b)){this[_0xe381('0x4e')](_0x423f5b[_0xe381('0x1d')],_[_0xe381('0x4f')](_0x423f5b['variable'])[0x0],_0x423f5b[_0xe381('0x50')]);if(this[_0xe381('0x5')][_0x423f5b[_0xe381('0x1d')]]){for(var _0x1a9caf in this[_0xe381('0x5')][_0x423f5b[_0xe381('0x1d')]]){if(this[_0xe381('0x5')][_0x423f5b[_0xe381('0x1d')]][_0xe381('0x2e')](_0x1a9caf)){if(_[_0xe381('0x1b')](this[_0xe381('0x5')][_0x423f5b[_0xe381('0x1d')]][_0x1a9caf]['variables'])){this[_0xe381('0x5')][_0x423f5b[_0xe381('0x1d')]][_0x1a9caf][_0xe381('0x8')]={};}this[_0xe381('0x5')][_0x423f5b[_0xe381('0x1d')]][_0x1a9caf]['variables']=this['variables'][_0x423f5b[_0xe381('0x1d')]];}}}}}catch(_0xa8d9a){logger[_0xe381('0x3e')](_0xe381('0x51'),util[_0xe381('0x2d')](_0xa8d9a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe381('0x4e')]=function(_0x33578b,_0x684e97,_0x1a5e79){var _0x59d229=[_0xe381('0x52'),_0xe381('0x53'),_0xe381('0x54'),_0xe381('0x55'),_0xe381('0x56'),'rtpaudioqoslossbridged',_0xe381('0x57'),_0xe381('0x58'),_0xe381('0x59'),'sipuri','bridgepeer',_0xe381('0x5a'),'membercalls','memberdynamic',_0xe381('0x5b'),_0xe381('0x5c'),_0xe381('0x2a'),_0xe381('0x5d'),_0xe381('0x5e')];if(!_[_0xe381('0x5f')](_0x684e97)&&!_[_0xe381('0x60')](_0x59d229,_0x684e97)){if(_[_0xe381('0x1b')](this['variables'][_0x33578b])){this[_0xe381('0x8')][_0x33578b]={};}this[_0xe381('0x8')][_0x33578b][_0x684e97]=_0x1a5e79;}};VoiceAgentReport[_0xe381('0x19')][_0xe381('0x14')]=function(_0x4ba0fd){try{if(this[_0xe381('0x1c')](_0x4ba0fd)){if(this[_0xe381('0x5')][_0x4ba0fd['uniqueid']]){ami['emit'](_0xe381('0x61'),_[_0xe381('0x62')](this[_0xe381('0x5')][_0x4ba0fd[_0xe381('0x1d')]]));delete this[_0xe381('0x5')][_0x4ba0fd[_0xe381('0x1d')]];}if(this[_0xe381('0x8')][_0x4ba0fd[_0xe381('0x1d')]]){delete this[_0xe381('0x8')][_0x4ba0fd[_0xe381('0x1d')]];}}}catch(_0x5822fa){logger[_0xe381('0x3e')](_0xe381('0x63'),util[_0xe381('0x2d')](_0x5822fa,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe381('0x19')][_0xe381('0x16')]=function(_0x202e9b){try{if(this[_0xe381('0x1c')](_0x202e9b)){if(this[_0xe381('0x5')][_0x202e9b[_0xe381('0x1d')]]){}}}catch(_0xcd8541){logger[_0xe381('0x3e')]('[syncMusicOnHoldStart][VoiceAgentReport]',util['inspect'](_0xcd8541,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe381('0x19')]['syncMusicOnHoldStop']=function(_0x5068c5){try{if(this[_0xe381('0x1c')](_0x5068c5)){if(this[_0xe381('0x5')][_0x5068c5[_0xe381('0x1d')]]){}}}catch(_0x503bef){logger[_0xe381('0x3e')](_0xe381('0x64'),util[_0xe381('0x2d')](_0x503bef,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
+var _0x1935=['called','queue','inbound','omit','event','privilege','custom:agentcalled','user:%s','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','destconnectedlinenum','membername','user:agentconnect','custom:agentconnect','reason','answered_elsewhere','lastevent','answeredelsewheremembername','rejected','custom:agentringnoanswer','agentringnoanswerAt','abandoned','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','complete','talktime','acw','agentacw','acwTimeout','user:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','isNil','includes','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','syncMusicOnHoldStart','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','exports','moment','util','../../../config/logger','ami','socket.io-emitter','localhost','voiceQueues','agents','variables','syncAgentCalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstop','syncMusicOnHoldStop','prototype','emit','isUndefined','isNotNull','channels','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1935,0xab));var _0x5193=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x1935[_0x1cb18a];return _0x22442e;};'use strict';var _=require('lodash');var moment=require(_0x5193('0x0'));var util=require(_0x5193('0x1'));var logger=require(_0x5193('0x2'))(_0x5193('0x3'));var ami=require('../ami');var io=require(_0x5193('0x4'))({'host':_0x5193('0x5'),'port':0x18eb});function VoiceAgentReport(_0x46536b){this['channels']={};this['voiceQueues']=_0x46536b[_0x5193('0x6')];this['agents']=_0x46536b[_0x5193('0x7')];this[_0x5193('0x8')]={};ami['on']('agentcalled',this[_0x5193('0x9')][_0x5193('0xa')](this));ami['on']('agentconnect',this[_0x5193('0xb')][_0x5193('0xa')](this));ami['on'](_0x5193('0xc'),this[_0x5193('0xd')][_0x5193('0xa')](this));ami['on'](_0x5193('0xe'),this[_0x5193('0xf')]['bind'](this));ami['on'](_0x5193('0x10'),this[_0x5193('0x11')][_0x5193('0xa')](this));ami['on'](_0x5193('0x12'),this[_0x5193('0x13')][_0x5193('0xa')](this));ami['on'](_0x5193('0x14'),this[_0x5193('0x15')][_0x5193('0xa')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0x5193('0x16'),this[_0x5193('0x17')][_0x5193('0xa')](this));}VoiceAgentReport[_0x5193('0x18')][_0x5193('0x19')]=function(_0x5d7a54,_0x5dee8b,_0x1a7190){io['to'](_0x5d7a54)['emit'](_0x5dee8b,_0x1a7190);};VoiceAgentReport['prototype']['isNotNull']=function(_0x26476a){return _0x26476a!==null&&!_[_0x5193('0x1a')](_0x26476a);};VoiceAgentReport[_0x5193('0x18')]['syncAgentCalled']=function(_0x30ecf7){try{if(this[_0x5193('0x1b')](_0x30ecf7)){if(_['isUndefined'](this[_0x5193('0x1c')][_0x30ecf7['uniqueid']])){this[_0x5193('0x1c')][_0x30ecf7[_0x5193('0x1d')]]={};}if(_[_0x5193('0x1a')](this[_0x5193('0x1c')][_0x30ecf7[_0x5193('0x1d')]][_0x30ecf7[_0x5193('0x1e')]])){this[_0x5193('0x1c')][_0x30ecf7[_0x5193('0x1d')]][_0x30ecf7[_0x5193('0x1e')]]={'agentcalledAt':moment()[_0x5193('0x1f')](_0x5193('0x20')),'lastevent':_0x5193('0x21'),'variables':this['variables'][_0x30ecf7[_0x5193('0x1d')]],'type':this[_0x5193('0x6')][_0x30ecf7[_0x5193('0x22')]]?this[_0x5193('0x6')][_0x30ecf7[_0x5193('0x22')]]['type']||_0x5193('0x23'):_0x5193('0x23')};}_['merge'](this[_0x5193('0x1c')][_0x30ecf7[_0x5193('0x1d')]][_0x30ecf7[_0x5193('0x1e')]],_[_0x5193('0x24')](_0x30ecf7,[_0x5193('0x25'),_0x5193('0x26')]));ami[_0x5193('0x19')](_0x5193('0x27'),this[_0x5193('0x1c')][_0x30ecf7[_0x5193('0x1d')]][_0x30ecf7[_0x5193('0x1e')]]);this[_0x5193('0x19')](util[_0x5193('0x1f')](_0x5193('0x28'),_0x30ecf7['membername']),_0x5193('0x29'),this[_0x5193('0x1c')][_0x30ecf7[_0x5193('0x1d')]][_0x30ecf7[_0x5193('0x1e')]]);}}catch(_0x408928){logger[_0x5193('0x2a')](_0x5193('0x2b'),util[_0x5193('0x2c')](_0x408928,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5193('0x18')][_0x5193('0xb')]=function(_0xfb651d){try{if(this[_0x5193('0x1b')](_0xfb651d)){if(this['channels'][_0xfb651d[_0x5193('0x1d')]]){for(var _0x57d4af in this[_0x5193('0x1c')][_0xfb651d[_0x5193('0x1d')]]){if(this[_0x5193('0x1c')][_0xfb651d[_0x5193('0x1d')]][_0x5193('0x2d')](_0x57d4af)){if(_0xfb651d[_0x5193('0x1e')]===_0x57d4af){this['channels'][_0xfb651d[_0x5193('0x1d')]][_0x57d4af][_0x5193('0x2e')]=moment()[_0x5193('0x1f')](_0x5193('0x20'));this[_0x5193('0x1c')][_0xfb651d['uniqueid']][_0x57d4af]['lastevent']=_0x5193('0x2f');this['channels'][_0xfb651d[_0x5193('0x1d')]][_0x57d4af][_0x5193('0x30')]=_0xfb651d[_0x5193('0x30')];this[_0x5193('0x1c')][_0xfb651d[_0x5193('0x1d')]][_0x57d4af][_0x5193('0x31')]=_0xfb651d[_0x5193('0x31')];this[_0x5193('0x1c')][_0xfb651d[_0x5193('0x1d')]][_0x57d4af]['connectedlinename']=_0xfb651d[_0x5193('0x32')];this[_0x5193('0x1c')][_0xfb651d['uniqueid']][_0x57d4af][_0x5193('0x33')]=_0xfb651d['destchannelstate'];this['channels'][_0xfb651d[_0x5193('0x1d')]][_0x57d4af][_0x5193('0x34')]=_0xfb651d['destchannelstatedesc'];_['merge'](this[_0x5193('0x7')][_0xfb651d[_0x5193('0x35')]],_['pick'](_0xfb651d,[_0x5193('0x22'),_0x5193('0x36')]));this[_0x5193('0x19')](util['format'](_0x5193('0x28'),_0xfb651d[_0x5193('0x37')]),_0x5193('0x38'),this[_0x5193('0x1c')][_0xfb651d['uniqueid']][_0xfb651d['destuniqueid']]);ami[_0x5193('0x19')](_0x5193('0x39'),this[_0x5193('0x1c')][_0xfb651d['uniqueid']][_0x57d4af]);}else if(this[_0x5193('0x1b')](this[_0x5193('0x1c')][_0xfb651d[_0x5193('0x1d')]][_0x57d4af][_0x5193('0xc')])){this['channels'][_0xfb651d[_0x5193('0x1d')]][_0x57d4af][_0x5193('0xc')]=!![];this['channels'][_0xfb651d[_0x5193('0x1d')]][_0x57d4af]['agentringnoanswerAt']=moment()[_0x5193('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0xfb651d[_0x5193('0x1d')]][_0x57d4af][_0x5193('0x3a')]=_0x5193('0x3b');this[_0x5193('0x1c')][_0xfb651d['uniqueid']][_0x57d4af][_0x5193('0x3c')]=_0x5193('0x3b');this[_0x5193('0x1c')][_0xfb651d[_0x5193('0x1d')]][_0x57d4af]['answeredelsewheredestinationuniqueid']=_0xfb651d[_0x5193('0x1e')];this[_0x5193('0x1c')][_0xfb651d[_0x5193('0x1d')]][_0x57d4af][_0x5193('0x3d')]=_0xfb651d[_0x5193('0x37')];ami[_0x5193('0x19')]('custom:agentansweredelsewhere',this[_0x5193('0x1c')][_0xfb651d[_0x5193('0x1d')]][_0x57d4af]);}}}}}}catch(_0x58c1b4){logger[_0x5193('0x2a')]('[syncAgentConnect][VoiceAgentReport]',util[_0x5193('0x2c')](_0x58c1b4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5193('0x18')][_0x5193('0xd')]=function(_0x4a2df2){try{if(this[_0x5193('0x1b')](_0x4a2df2)){if(this[_0x5193('0x1c')][_0x4a2df2[_0x5193('0x1d')]]&&this[_0x5193('0x1c')][_0x4a2df2[_0x5193('0x1d')]][_0x4a2df2['destuniqueid']]&&_['isUndefined'](this[_0x5193('0x1c')][_0x4a2df2[_0x5193('0x1d')]][_0x4a2df2['destuniqueid']][_0x5193('0xc')])){this[_0x5193('0x1c')][_0x4a2df2['uniqueid']][_0x4a2df2[_0x5193('0x1e')]]['agentringnoanswer']=!![];this['channels'][_0x4a2df2[_0x5193('0x1d')]][_0x4a2df2[_0x5193('0x1e')]]['agentringnoanswerAt']=moment()[_0x5193('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5193('0x1c')][_0x4a2df2[_0x5193('0x1d')]][_0x4a2df2[_0x5193('0x1e')]][_0x5193('0x3a')]=_0x5193('0x3e');this[_0x5193('0x1c')][_0x4a2df2[_0x5193('0x1d')]][_0x4a2df2[_0x5193('0x1e')]]['lastevent']='rejected';ami[_0x5193('0x19')](_0x5193('0x3f'),this[_0x5193('0x1c')][_0x4a2df2[_0x5193('0x1d')]][_0x4a2df2[_0x5193('0x1e')]]);}}}catch(_0x3593cd){logger['error']('[syncAgentRingNoAnswer][VoiceAgentReport]',util[_0x5193('0x2c')](_0x3593cd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5193('0xf')]=function(_0x209624){try{if(this[_0x5193('0x1b')](_0x209624)){if(this[_0x5193('0x1c')][_0x209624['uniqueid']]){for(var _0x120824 in this[_0x5193('0x1c')][_0x209624[_0x5193('0x1d')]]){if(this[_0x5193('0x1c')][_0x209624[_0x5193('0x1d')]][_0x5193('0x2d')](_0x120824)&&_['isUndefined'](this[_0x5193('0x1c')][_0x209624[_0x5193('0x1d')]][_0x120824][_0x5193('0xc')])){this[_0x5193('0x1c')][_0x209624[_0x5193('0x1d')]][_0x120824][_0x5193('0xc')]=!![];this[_0x5193('0x1c')][_0x209624['uniqueid']][_0x120824][_0x5193('0x40')]=moment()['format'](_0x5193('0x20'));this['channels'][_0x209624[_0x5193('0x1d')]][_0x120824][_0x5193('0x3a')]=_0x5193('0x41');this[_0x5193('0x1c')][_0x209624[_0x5193('0x1d')]][_0x120824][_0x5193('0x3c')]=_0x5193('0x41');ami[_0x5193('0x19')]('custom:agentqueuecallerabandon',this[_0x5193('0x1c')][_0x209624['uniqueid']][_0x120824]);}}}}}catch(_0x22c43e){logger[_0x5193('0x2a')](_0x5193('0x42'),util[_0x5193('0x2c')](_0x22c43e,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentComplete']=function(_0x818685){try{if(this[_0x5193('0x1b')](_0x818685)){if(this[_0x5193('0x1c')][_0x818685[_0x5193('0x1d')]]&&this[_0x5193('0x1c')][_0x818685[_0x5193('0x1d')]][_0x818685[_0x5193('0x1e')]]&&_[_0x5193('0x1a')](this[_0x5193('0x1c')][_0x818685[_0x5193('0x1d')]][_0x818685[_0x5193('0x1e')]][_0x5193('0x10')])){this[_0x5193('0x1c')][_0x818685['uniqueid']][_0x818685[_0x5193('0x1e')]][_0x5193('0x10')]=!![];this[_0x5193('0x1c')][_0x818685[_0x5193('0x1d')]][_0x818685[_0x5193('0x1e')]][_0x5193('0x43')]=moment()[_0x5193('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5193('0x1c')][_0x818685[_0x5193('0x1d')]][_0x818685[_0x5193('0x1e')]][_0x5193('0x3c')]=_0x5193('0x44');this['channels'][_0x818685[_0x5193('0x1d')]][_0x818685[_0x5193('0x1e')]][_0x5193('0x45')]=_0x818685['talktime'];this[_0x5193('0x1c')][_0x818685[_0x5193('0x1d')]][_0x818685[_0x5193('0x1e')]]['reason']=_0x818685[_0x5193('0x3a')];if(this['voiceQueues'][_0x818685['queue']]&&this['voiceQueues'][_0x818685['queue']][_0x5193('0x46')]){this[_0x5193('0x1c')][_0x818685[_0x5193('0x1d')]][_0x818685[_0x5193('0x1e')]][_0x5193('0x47')]=!![];this['channels'][_0x818685[_0x5193('0x1d')]][_0x818685[_0x5193('0x1e')]]['acwtime']=this[_0x5193('0x6')][_0x818685['queue']][_0x5193('0x48')];}this[_0x5193('0x7')][_0x818685[_0x5193('0x35')]]=_[_0x5193('0x24')](this['agents'][_0x818685['interface']],[_0x5193('0x22'),_0x5193('0x36')]);this[_0x5193('0x19')](util[_0x5193('0x1f')](_0x5193('0x28'),_0x818685[_0x5193('0x37')]),_0x5193('0x49'),this['channels'][_0x818685[_0x5193('0x1d')]][_0x818685['destuniqueid']]);ami['emit']('custom:agentcomplete',this[_0x5193('0x1c')][_0x818685['uniqueid']][_0x818685[_0x5193('0x1e')]]);}}}catch(_0x203557){logger[_0x5193('0x2a')](_0x5193('0x4a'),util[_0x5193('0x2c')](_0x203557,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5193('0x18')]['syncVarSet']=function(_0x30c8ab){try{if(this[_0x5193('0x1b')](_0x30c8ab)){this[_0x5193('0x4b')](_0x30c8ab[_0x5193('0x1d')],_[_0x5193('0x4c')](_0x30c8ab[_0x5193('0x4d')])[0x0],_0x30c8ab[_0x5193('0x4e')]);if(this['channels'][_0x30c8ab[_0x5193('0x1d')]]){for(var _0x1511a7 in this['channels'][_0x30c8ab[_0x5193('0x1d')]]){if(this[_0x5193('0x1c')][_0x30c8ab[_0x5193('0x1d')]][_0x5193('0x2d')](_0x1511a7)){if(_[_0x5193('0x1a')](this['channels'][_0x30c8ab[_0x5193('0x1d')]][_0x1511a7][_0x5193('0x8')])){this[_0x5193('0x1c')][_0x30c8ab[_0x5193('0x1d')]][_0x1511a7]['variables']={};}this[_0x5193('0x1c')][_0x30c8ab[_0x5193('0x1d')]][_0x1511a7][_0x5193('0x8')]=this[_0x5193('0x8')][_0x30c8ab['uniqueid']];}}}}}catch(_0x4f0637){logger[_0x5193('0x2a')](_0x5193('0x4f'),util['inspect'](_0x4f0637,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5193('0x18')][_0x5193('0x4b')]=function(_0x2b485a,_0x207324,_0x2183ce){var _0x315d93=[_0x5193('0x50'),_0x5193('0x51'),_0x5193('0x52'),_0x5193('0x53'),_0x5193('0x54'),_0x5193('0x55'),_0x5193('0x56'),'rtpaudioqosrttbridged','sipcallid',_0x5193('0x57'),_0x5193('0x58'),'bridgepvtcallid',_0x5193('0x59'),_0x5193('0x5a'),_0x5193('0x5b'),_0x5193('0x5c'),_0x5193('0x37'),'memberpenalty','memberrealtime'];if(!_[_0x5193('0x5d')](_0x207324)&&!_[_0x5193('0x5e')](_0x315d93,_0x207324)){if(_[_0x5193('0x1a')](this['variables'][_0x2b485a])){this[_0x5193('0x8')][_0x2b485a]={};}this['variables'][_0x2b485a][_0x207324]=_0x2183ce;}};VoiceAgentReport[_0x5193('0x18')][_0x5193('0x15')]=function(_0x57883a){try{if(this[_0x5193('0x1b')](_0x57883a)){if(this['channels'][_0x57883a[_0x5193('0x1d')]]){ami['emit'](_0x5193('0x5f'),_[_0x5193('0x60')](this[_0x5193('0x1c')][_0x57883a[_0x5193('0x1d')]]));delete this['channels'][_0x57883a[_0x5193('0x1d')]];}if(this[_0x5193('0x8')][_0x57883a[_0x5193('0x1d')]]){delete this[_0x5193('0x8')][_0x57883a['uniqueid']];}}}catch(_0x4851a2){logger[_0x5193('0x2a')](_0x5193('0x61'),util[_0x5193('0x2c')](_0x4851a2,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5193('0x62')]=function(_0x108bc6){try{if(this[_0x5193('0x1b')](_0x108bc6)){if(this[_0x5193('0x1c')][_0x108bc6[_0x5193('0x1d')]]){}}}catch(_0x2b7073){logger['error'](_0x5193('0x63'),util['inspect'](_0x2b7073,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5193('0x18')][_0x5193('0x17')]=function(_0x8432b8){try{if(this[_0x5193('0x1b')](_0x8432b8)){if(this['channels'][_0x8432b8[_0x5193('0x1d')]]){}}}catch(_0x5e8539){logger['error'](_0x5193('0x64'),util['inspect'](_0x5e8539,{'showHidden':![],'depth':null}));}};module[_0x5193('0x65')]=VoiceAgentReport;
\ No newline at end of file
index a2719aa..2c7b4e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04c7=['syncNewCallerId','attendedtransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','resolve','actionCoreShowChannels','catch','isNotNull','prototype','emit','uniqueid','linkedid','isUndefined','merge','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','channel','OutgoingSpoolFailed','format','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','pick','context','split','destconnectedlinenum','exten','name','user:agentconnect','accountcode','application','toLowerCase','applicationdata','duration','seconds','disposition','includes','set','cdr(','match','[syncNewExten][VoiceCallReport]','answered','answertime','calleridnum','xcally-motion-preview','connectedlinenum','membername','UserId','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','rec','syncVarSet','variable','mixmonitor_filename','value','xmd-phone','xmd-callerid','xmd-cdrtype','type','xmd-queue','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','parse','sipcalllinkedid','[syncVarSet][VoiceCallReport]','diff','starttime','billableseconds','holdtime','user:%s','user:agentcomplete','[syncHangup][VoiceCallReport]','syncAttendedTransfer','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','syncMusicOnHoldStop','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','util','path','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','queue','agi','dial','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','socket.io-emitter','localhost','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','varset','hangup','syncHangup'];(function(_0x4b2494,_0x494d41){var _0x2c1436=function(_0x3eaf82){while(--_0x3eaf82){_0x4b2494['push'](_0x4b2494['shift']());}};_0x2c1436(++_0x494d41);}(_0x04c7,0x190));var _0x704c=function(_0x338f73,_0x1945c8){_0x338f73=_0x338f73-0x0;var _0x163fdf=_0x04c7[_0x338f73];return _0x163fdf;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var moment=require('moment');var util=require(_0x704c('0x0'));var path=require(_0x704c('0x1'));var logger=require(_0x704c('0x2'))(_0x704c('0x3'));var ami=require(_0x704c('0x4'));var Channel=require(_0x704c('0x5'));var statusDesc=[_0x704c('0x6'),_0x704c('0x7'),_0x704c('0x8'),_0x704c('0x9'),_0x704c('0xa'),_0x704c('0xb'),_0x704c('0xc'),_0x704c('0xd'),'onhold'];var applications=['set',_0x704c('0xe'),_0x704c('0xf'),_0x704c('0x10'),_0x704c('0x11'),_0x704c('0x12')];var dispositions=['NO\x20ANSWER',_0x704c('0x13'),_0x704c('0x13'),_0x704c('0x14'),'NO\x20ANSWER',_0x704c('0x14'),_0x704c('0x15'),_0x704c('0x16'),_0x704c('0x13'),_0x704c('0x13'),'FAILED'];var actions={};var io=require(_0x704c('0x17'))({'host':_0x704c('0x18'),'port':0x18eb});function VoiceCallReport(_0x251132){this[_0x704c('0x19')]=_0x251132[_0x704c('0x19')];this['agents']=_0x251132[_0x704c('0x1a')];ami['on'](_0x704c('0x1b'),this[_0x704c('0x1c')][_0x704c('0x1d')](this));ami['on'](_0x704c('0x1e'),this[_0x704c('0x1c')]['bind'](this));ami['on'](_0x704c('0x1f'),this[_0x704c('0x20')][_0x704c('0x1d')](this));ami['on'](_0x704c('0x21'),this[_0x704c('0x22')]['bind'](this));ami['on'](_0x704c('0x23'),this['syncVarSet'][_0x704c('0x1d')](this));ami['on'](_0x704c('0x24'),this[_0x704c('0x25')][_0x704c('0x1d')](this));ami['on']('newcallerid',this[_0x704c('0x26')]['bind'](this));ami['on'](_0x704c('0x27'),this['syncAttendedTransfer'][_0x704c('0x1d')](this));ami['on'](_0x704c('0x28'),this[_0x704c('0x29')][_0x704c('0x1d')](this));ami['on'](_0x704c('0x2a'),this[_0x704c('0x2b')][_0x704c('0x1d')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x704c('0x1d')](this));return BPromise[_0x704c('0x2c')]()['then'](ami[_0x704c('0x2d')]())[_0x704c('0x2e')](function(_0x427e13){console['log'](_0x427e13);});}VoiceCallReport['prototype'][_0x704c('0x2f')]=function(_0x265715){return _0x265715!==null&&!_['isUndefined'](_0x265715);};VoiceCallReport[_0x704c('0x30')]['emit']=function(_0x5b4d19,_0x7ebcd6,_0x609bff){io['to'](_0x5b4d19)[_0x704c('0x31')](_0x7ebcd6,_0x609bff);};VoiceCallReport[_0x704c('0x30')][_0x704c('0x26')]=function(_0x105765){try{if(this[_0x704c('0x2f')](_0x105765)){if(_0x105765[_0x704c('0x32')]===_0x105765[_0x704c('0x33')]){if(!_[_0x704c('0x34')](this['channels'][_0x105765['uniqueid']])){_[_0x704c('0x35')](this[_0x704c('0x19')][_0x105765[_0x704c('0x32')]],_['pick'](_0x105765,_[_0x704c('0x36')](this[_0x704c('0x19')][_0x105765[_0x704c('0x32')]])));}}}}catch(_0x20bcf9){logger[_0x704c('0x37')](_0x704c('0x38'),util[_0x704c('0x39')](_0x20bcf9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x704c('0x30')][_0x704c('0x20')]=function(_0x145edd){try{if(this[_0x704c('0x2f')](_0x145edd)){if(_0x145edd[_0x704c('0x32')]===_0x145edd[_0x704c('0x33')]&&_0x145edd[_0x704c('0x3a')]!=_0x704c('0x3b')){if(_['isUndefined'](this[_0x704c('0x19')][_0x145edd['uniqueid']])){this[_0x704c('0x19')][_0x145edd[_0x704c('0x32')]]=new Channel();this['channels'][_0x145edd[_0x704c('0x32')]]['starttime']=moment()[_0x704c('0x3c')](_0x704c('0x3d'));this['channels'][_0x145edd[_0x704c('0x32')]]['disposition']=dispositions[_[_0x704c('0x3e')](_0x145edd[_0x704c('0x3f')])];_[_0x704c('0x35')](this[_0x704c('0x19')][_0x145edd['uniqueid']],_[_0x704c('0x40')](_0x145edd,_['keys'](this[_0x704c('0x19')][_0x145edd[_0x704c('0x32')]])));if(_0x145edd[_0x704c('0x41')]==='from-sip'){if(this['agents'][_0x145edd[_0x704c('0x3a')][_0x704c('0x42')]('-')[0x0]]){this[_0x704c('0x1a')][_0x145edd[_0x704c('0x3a')][_0x704c('0x42')]('-')[0x0]][_0x704c('0x43')]=_0x145edd[_0x704c('0x44')];this[_0x704c('0x31')](util[_0x704c('0x3c')]('user:%s',this[_0x704c('0x1a')][_0x145edd['channel'][_0x704c('0x42')]('-')[0x0]][_0x704c('0x45')]),_0x704c('0x46'),{'destaccountcode':this[_0x704c('0x1a')][_0x145edd[_0x704c('0x3a')][_0x704c('0x42')]('-')[0x0]][_0x704c('0x47')],'destconnectedlinenum':_0x145edd[_0x704c('0x44')]});}}}}}}catch(_0x1a7bb2){logger[_0x704c('0x37')]('[syncNewChannel][VoiceCallReport]',util['inspect'](_0x1a7bb2,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewExten']=function(_0x1c1486){try{if(this['isNotNull'](_0x1c1486)){if(_0x1c1486[_0x704c('0x32')]===_0x1c1486['linkedid']&&_0x1c1486['exten']!='h'&&_0x1c1486['channel']!=_0x704c('0x3b')){_0x1c1486[_0x704c('0x48')]=_0x1c1486[_0x704c('0x48')][_0x704c('0x49')]();_0x1c1486[_0x704c('0x4a')]=(_0x1c1486['appdata']||_0x1c1486[_0x704c('0x4a')])[_0x704c('0x49')]();if(_['isUndefined'](this['channels'][_0x1c1486[_0x704c('0x32')]])){this['channels'][_0x1c1486['uniqueid']]=new Channel();this[_0x704c('0x19')][_0x1c1486['uniqueid']]['starttime']=_0x1c1486[_0x704c('0x4b')]?moment()['subtract'](moment[_0x704c('0x4b')](_0x1c1486[_0x704c('0x4b')])['seconds'](),_0x704c('0x4c'))[_0x704c('0x3c')](_0x704c('0x3d')):moment()['format'](_0x704c('0x3d'));this[_0x704c('0x19')][_0x1c1486['uniqueid']][_0x704c('0x4d')]='NO\x20ANSWER';}_['merge'](this[_0x704c('0x19')][_0x1c1486['uniqueid']],_[_0x704c('0x40')](_0x1c1486,_['keys'](this[_0x704c('0x19')][_0x1c1486[_0x704c('0x32')]])));if(_[_0x704c('0x4e')](applications,_0x1c1486['application'])){this['channels'][_0x1c1486[_0x704c('0x32')]]['lastapplication']=_0x1c1486[_0x704c('0x48')];this[_0x704c('0x19')][_0x1c1486['uniqueid']]['lastdata']=_0x1c1486['applicationdata'];if(_0x1c1486[_0x704c('0x48')]===_0x704c('0x4f')&&_['startsWith'](_0x1c1486['applicationdata'],_0x704c('0x50'))){var _0x30ec42=_0x1c1486['applicationdata'][_0x704c('0x42')]('=');var _0x151072=_0x30ec42[0x0][_0x704c('0x51')](/cdr\((.*)\)/);if(_0x151072){this[_0x704c('0x19')][_0x1c1486[_0x704c('0x32')]][_0x151072[0x1]]=_0x30ec42[0x1];}}else if(_0x1c1486[_0x704c('0x48')]===_0x704c('0xe')){this[_0x704c('0x19')][_0x1c1486[_0x704c('0x32')]][_0x704c('0xe')]=_0x1c1486[_0x704c('0x4a')][_0x704c('0x42')](',')[0x0];}}}}}catch(_0x973715){logger[_0x704c('0x37')](_0x704c('0x52'),util[_0x704c('0x39')](_0x973715,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x704c('0x30')][_0x704c('0x22')]=function(_0x5cef17){try{if(this[_0x704c('0x2f')](_0x5cef17)){if(_0x5cef17[_0x704c('0x32')]!==_0x5cef17[_0x704c('0x33')]){if(this['channels'][_0x5cef17[_0x704c('0x33')]]){if(_0x5cef17['channelstate']==='6'){if(!this[_0x704c('0x19')][_0x5cef17[_0x704c('0x33')]][_0x704c('0x53')]){this[_0x704c('0x19')][_0x5cef17[_0x704c('0x33')]][_0x704c('0x53')]=!![];this[_0x704c('0x19')][_0x5cef17[_0x704c('0x33')]][_0x704c('0x54')]=moment()[_0x704c('0x3c')]('YYYY-MM-DD\x20HH:mm:ss');}this[_0x704c('0x19')][_0x5cef17[_0x704c('0x33')]][_0x704c('0x33')]=_0x5cef17[_0x704c('0x32')];if(_0x5cef17[_0x704c('0x55')]!==_0x704c('0x56')){this[_0x704c('0x19')][_0x5cef17[_0x704c('0x33')]][_0x704c('0x57')]=_0x5cef17[_0x704c('0x55')];}this[_0x704c('0x19')][_0x5cef17['linkedid']]['connectedlinename']=_0x5cef17['calleridname'];this[_0x704c('0x19')][_0x5cef17[_0x704c('0x33')]]['destinationchannel']=_0x5cef17[_0x704c('0x3a')];this[_0x704c('0x19')][_0x5cef17['linkedid']][_0x704c('0x4d')]=dispositions[_[_0x704c('0x3e')](_0x5cef17[_0x704c('0x3f')])];if(this[_0x704c('0x1a')][_0x5cef17[_0x704c('0x3a')]['split']('-')[0x0]]){this['channels'][_0x5cef17[_0x704c('0x33')]]['UserId']=this[_0x704c('0x1a')][_0x5cef17['channel'][_0x704c('0x42')]('-')[0x0]]['id'];this[_0x704c('0x19')][_0x5cef17[_0x704c('0x33')]][_0x704c('0x58')]=this[_0x704c('0x1a')][_0x5cef17[_0x704c('0x3a')][_0x704c('0x42')]('-')[0x0]][_0x704c('0x45')];}}}}else{if(this['channels'][_0x5cef17[_0x704c('0x32')]]){if(_0x5cef17[_0x704c('0x3f')]==='6'){if(this[_0x704c('0x1a')][_0x5cef17[_0x704c('0x3a')]['split']('-')[0x0]]){this[_0x704c('0x19')][_0x5cef17[_0x704c('0x32')]][_0x704c('0x59')]=this['agents'][_0x5cef17[_0x704c('0x3a')][_0x704c('0x42')]('-')[0x0]]['id'];this['channels'][_0x5cef17[_0x704c('0x32')]][_0x704c('0x58')]=this[_0x704c('0x1a')][_0x5cef17['channel'][_0x704c('0x42')]('-')[0x0]]['name'];}}}}}}catch(_0x29e0c0){logger[_0x704c('0x37')](_0x704c('0x5a'),util[_0x704c('0x39')](_0x29e0c0,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x704c('0x5b')]=function(_0x1ed621,_0x4b8488){if(this[_0x704c('0x19')][_0x1ed621]){this[_0x704c('0x19')][_0x1ed621]['monitor']=!![];if(_[_0x704c('0x5c')](_0x4b8488,_0x704c('0x5d'))){_0x4b8488=_0x4b8488[_0x704c('0x5e')](_0x704c('0x5d'),_0x704c('0x5f'));}this[_0x704c('0x19')][_0x1ed621][_0x704c('0x60')]=_0x4b8488;var _0x511d17=_[_0x704c('0x61')](this['channels'][_0x1ed621][_0x704c('0x62')],{'filename':_0x4b8488});if(_[_0x704c('0x63')](_0x511d17)){this['channels'][_0x1ed621][_0x704c('0x62')][_0x704c('0x64')]({'filename':_0x4b8488,'createdAt':moment()[_0x704c('0x3c')](_0x704c('0x3d')),'mixmonitorid':'','status':_0x704c('0x65')});}}};VoiceCallReport[_0x704c('0x30')][_0x704c('0x66')]=function(_0x7c00fc){try{if(this[_0x704c('0x2f')](_0x7c00fc)){if(this['channels'][_0x7c00fc[_0x704c('0x32')]]&&_0x7c00fc[_0x704c('0x3a')]!='OutgoingSpoolFailed'){if(this[_0x704c('0x2f')](_0x7c00fc['variable'])){if(this[_0x704c('0x2f')](_0x7c00fc[_0x704c('0x67')][_0x704c('0x68')])){this[_0x704c('0x5b')](_0x7c00fc[_0x704c('0x32')],_0x7c00fc[_0x704c('0x69')]);}else if(this[_0x704c('0x2f')](_0x7c00fc['variable'][_0x704c('0x6a')])){this[_0x704c('0x19')][_0x7c00fc[_0x704c('0x32')]][_0x704c('0x55')]=_0x7c00fc['value'];}else if(this[_0x704c('0x2f')](_0x7c00fc[_0x704c('0x67')][_0x704c('0x6b')])){this[_0x704c('0x19')][_0x7c00fc['uniqueid']]['callerid']=_0x7c00fc[_0x704c('0x69')];}else if(this[_0x704c('0x2f')](_0x7c00fc[_0x704c('0x67')][_0x704c('0x6c')])){this[_0x704c('0x19')][_0x7c00fc[_0x704c('0x32')]][_0x704c('0x6d')]=_0x7c00fc[_0x704c('0x69')];}else if(this[_0x704c('0x2f')](_0x7c00fc[_0x704c('0x67')][_0x704c('0x6e')])){this[_0x704c('0x19')][_0x7c00fc['uniqueid']][_0x704c('0xe')]=_0x7c00fc[_0x704c('0x69')][_0x704c('0x42')](',')[0x0];}else if(this['isNotNull'](_0x7c00fc['variable']['xmd-originatecalleridnum'])){this[_0x704c('0x19')][_0x7c00fc[_0x704c('0x32')]][_0x704c('0x6f')]=_0x7c00fc[_0x704c('0x69')];}else if(this[_0x704c('0x2f')](_0x7c00fc[_0x704c('0x67')][_0x704c('0x70')])){this[_0x704c('0x19')][_0x7c00fc[_0x704c('0x32')]][_0x704c('0x71')]=_0x7c00fc[_0x704c('0x69')];}else if(this[_0x704c('0x2f')](_0x7c00fc[_0x704c('0x67')][_0x704c('0x72')])){this[_0x704c('0x19')][_0x7c00fc[_0x704c('0x32')]][_0x704c('0x73')]=_0x7c00fc[_0x704c('0x69')];}else if(this['isNotNull'](_0x7c00fc['variable'][_0x704c('0x74')])){this[_0x704c('0x19')][_0x7c00fc[_0x704c('0x32')]][_0x704c('0xe')]=_0x7c00fc[_0x704c('0x69')];}else if(this[_0x704c('0x2f')](_0x7c00fc[_0x704c('0x67')][_0x704c('0x75')])){this[_0x704c('0x19')][_0x7c00fc[_0x704c('0x32')]]['sipcalluniqueid']=_0x7c00fc[_0x704c('0x69')];}}}else if(this['isNotNull'](_0x7c00fc[_0x704c('0x67')][_0x704c('0x68')])){if(_0x7c00fc['value']){var _0x57e249=path[_0x704c('0x76')](_0x7c00fc[_0x704c('0x69')])[_0x704c('0x45')];this[_0x704c('0x5b')](_0x57e249,_0x7c00fc[_0x704c('0x69')]);}}else if(this[_0x704c('0x19')][_0x7c00fc[_0x704c('0x33')]]){if(this[_0x704c('0x2f')](_0x7c00fc[_0x704c('0x67')])){if(this[_0x704c('0x2f')](_0x7c00fc['variable']['sipcallid'])){this[_0x704c('0x19')][_0x7c00fc[_0x704c('0x33')]][_0x704c('0x77')]=_0x7c00fc['value'];}}}}}catch(_0x105f8b){logger[_0x704c('0x37')](_0x704c('0x78'),util[_0x704c('0x39')](_0x105f8b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x704c('0x30')][_0x704c('0x25')]=function(_0x807d51){try{if(this[_0x704c('0x2f')](_0x807d51)){if(this[_0x704c('0x19')][_0x807d51[_0x704c('0x32')]]){var _0x4124e9=moment();this['channels'][_0x807d51[_0x704c('0x32')]]['endtime']=_0x4124e9['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x704c('0x19')][_0x807d51['uniqueid']][_0x704c('0x4b')]=_0x4124e9[_0x704c('0x79')](this[_0x704c('0x19')][_0x807d51[_0x704c('0x32')]][_0x704c('0x7a')],_0x704c('0x4c'));if(this[_0x704c('0x19')][_0x807d51[_0x704c('0x32')]][_0x704c('0x53')]){this[_0x704c('0x19')][_0x807d51['uniqueid']][_0x704c('0x7b')]=_0x4124e9[_0x704c('0x79')](this[_0x704c('0x19')][_0x807d51['uniqueid']][_0x704c('0x54')],'seconds');this[_0x704c('0x19')][_0x807d51[_0x704c('0x32')]][_0x704c('0x7c')]=this[_0x704c('0x19')][_0x807d51[_0x704c('0x32')]][_0x704c('0x4b')]-this[_0x704c('0x19')][_0x807d51[_0x704c('0x32')]]['billableseconds'];}if(_0x807d51['context']==='from-sip'){if(this[_0x704c('0x1a')][_0x807d51[_0x704c('0x3a')][_0x704c('0x42')]('-')[0x0]]){this[_0x704c('0x1a')][_0x807d51[_0x704c('0x3a')][_0x704c('0x42')]('-')[0x0]]=_['omit'](this[_0x704c('0x1a')][_0x807d51[_0x704c('0x3a')][_0x704c('0x42')]('-')[0x0]],[_0x704c('0x43')]);this[_0x704c('0x31')](util['format'](_0x704c('0x7d'),this[_0x704c('0x1a')][_0x807d51[_0x704c('0x3a')][_0x704c('0x42')]('-')[0x0]][_0x704c('0x45')]),_0x704c('0x7e'),{'destaccountcode':this[_0x704c('0x1a')][_0x807d51[_0x704c('0x3a')][_0x704c('0x42')]('-')[0x0]][_0x704c('0x47')]});}}ami[_0x704c('0x31')]('custom:voiceCallReport',this[_0x704c('0x19')][_0x807d51[_0x704c('0x32')]]);delete this[_0x704c('0x19')][_0x807d51['uniqueid']];}}}catch(_0x524579){logger[_0x704c('0x37')](_0x704c('0x7f'),util[_0x704c('0x39')](_0x524579,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x704c('0x80')]=function(_0x10091b){try{if(this[_0x704c('0x2f')](_0x10091b)){if(this[_0x704c('0x19')][_0x10091b[_0x704c('0x81')]]){this[_0x704c('0x19')][_0x10091b[_0x704c('0x81')]][_0x704c('0x82')]=_0x10091b[_0x704c('0x83')];this['channels'][_0x10091b[_0x704c('0x81')]][_0x704c('0x84')]=_0x10091b[_0x704c('0x85')];var _0x43464a=this[_0x704c('0x19')][_0x10091b[_0x704c('0x86')]];this[_0x704c('0x19')][_0x10091b[_0x704c('0x86')]]=this['channels'][_0x10091b['transfereeuniqueid']];this[_0x704c('0x19')][_0x10091b[_0x704c('0x81')]]=_0x43464a;}}}catch(_0x56f5d1){logger['error']('[syncAttendedTransfer][VoiceCallReport]',util[_0x704c('0x39')](_0x56f5d1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x704c('0x30')][_0x704c('0x29')]=function(_0x4ce778){try{if(this[_0x704c('0x2f')](_0x4ce778)){if(this[_0x704c('0x19')][_0x4ce778[_0x704c('0x81')]]){this[_0x704c('0x19')][_0x4ce778[_0x704c('0x81')]]['transfercalleridnum']=_0x4ce778['transfereecalleridnum'];this[_0x704c('0x19')][_0x4ce778['transfereeuniqueid']]['transferconnectedlinenum']=_0x4ce778[_0x704c('0x87')];this[_0x704c('0x25')]({'event':_0x704c('0x88'),'uniqueid':_0x4ce778[_0x704c('0x81')],'context':_0x4ce778[_0x704c('0x41')],'channel':_0x4ce778[_0x704c('0x89')]});}}}catch(_0x54e952){logger[_0x704c('0x37')](_0x704c('0x8a'),util['inspect'](_0x54e952,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x704c('0x30')][_0x704c('0x2b')]=function(_0x1fa16c){try{if(this[_0x704c('0x2f')](_0x1fa16c)){if(this[_0x704c('0x19')][_0x1fa16c[_0x704c('0x32')]]){if(!_[_0x704c('0x63')](this['channels'][_0x1fa16c[_0x704c('0x32')]][_0x704c('0x54')])){this[_0x704c('0x19')][_0x1fa16c[_0x704c('0x32')]][_0x704c('0x8b')]=moment()[_0x704c('0x3c')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x30bbd5){logger['error'](_0x704c('0x8c'),util[_0x704c('0x39')](_0x30bbd5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x704c('0x30')][_0x704c('0x8d')]=function(_0x43d0e4){try{if(this[_0x704c('0x2f')](_0x43d0e4)){if(this[_0x704c('0x19')][_0x43d0e4[_0x704c('0x32')]]){if(!_[_0x704c('0x63')](this['channels'][_0x43d0e4[_0x704c('0x32')]]['mohstarttime'])){this[_0x704c('0x19')][_0x43d0e4['uniqueid']][_0x704c('0x8e')]+=moment()[_0x704c('0x8f')](0x0)['diff'](this[_0x704c('0x19')][_0x43d0e4[_0x704c('0x32')]]['mohstarttime'],_0x704c('0x4c'));delete this[_0x704c('0x19')][_0x43d0e4['uniqueid']][_0x704c('0x8b')];}}}}catch(_0x174f57){logger[_0x704c('0x37')](_0x704c('0x90'),util['inspect'](_0x174f57,{'showHidden':![],'depth':null}));}};module[_0x704c('0x91')]=VoiceCallReport;
\ No newline at end of file
+var _0xe275=['syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','monitors','isNil','push','rec','variable','mixmonitor_filename','value','callerid','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcalluniqueid','parse','sipcallid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','diff','holdtime','billableseconds','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','[syncBlindTransfer][VoiceCallReport]','mohstarttime','mohtime','exports','bluebird','lodash','util','path','../../../config/logger','ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','set','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','socket.io-emitter','localhost','channels','agents','coreshowchannel','bind','newexten','syncNewExten','newchannel','syncNewChannel','newstate','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','then','actionCoreShowChannels','catch','log','prototype','isNotNull','isUndefined','emit','uniqueid','linkedid','merge','pick','error','[syncNewCallerId][VoiceCallReport]','inspect','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','keys','context','from-sip','split','destconnectedlinenum','exten','user:%s','accountcode','application','toLowerCase','applicationdata','appdata','duration','seconds','includes','lastapplication','lastdata','startsWith','cdr(','queue','syncNewState','channelstate','answered','answertime','calleridnum','connectedlinenum','connectedlinename','calleridname','UserId','membername','name','[syncNewState][VoiceCallReport]'];(function(_0x51d232,_0x4cd4ee){var _0x1ca45c=function(_0x19ef94){while(--_0x19ef94){_0x51d232['push'](_0x51d232['shift']());}};_0x1ca45c(++_0x4cd4ee);}(_0xe275,0xc3));var _0x5e27=function(_0x3d5ffb,_0x35b037){_0x3d5ffb=_0x3d5ffb-0x0;var _0x5c0639=_0xe275[_0x3d5ffb];return _0x5c0639;};'use strict';var BPromise=require(_0x5e27('0x0'));var _=require(_0x5e27('0x1'));var moment=require('moment');var util=require(_0x5e27('0x2'));var path=require(_0x5e27('0x3'));var logger=require(_0x5e27('0x4'))(_0x5e27('0x5'));var ami=require('../ami');var Channel=require(_0x5e27('0x6'));var statusDesc=[_0x5e27('0x7'),_0x5e27('0x8'),_0x5e27('0x9'),_0x5e27('0xa'),_0x5e27('0xb'),_0x5e27('0xc'),_0x5e27('0xd'),'ringinuse','onhold'];var applications=[_0x5e27('0xe'),'queue',_0x5e27('0xf'),_0x5e27('0x10'),_0x5e27('0x11'),_0x5e27('0x12')];var dispositions=[_0x5e27('0x13'),_0x5e27('0x14'),_0x5e27('0x14'),'NO\x20ANSWER',_0x5e27('0x13'),_0x5e27('0x13'),_0x5e27('0x15'),_0x5e27('0x16'),_0x5e27('0x14'),_0x5e27('0x14'),_0x5e27('0x14')];var actions={};var io=require(_0x5e27('0x17'))({'host':_0x5e27('0x18'),'port':0x18eb});function VoiceCallReport(_0x4c97c3){this[_0x5e27('0x19')]=_0x4c97c3[_0x5e27('0x19')];this[_0x5e27('0x1a')]=_0x4c97c3[_0x5e27('0x1a')];ami['on'](_0x5e27('0x1b'),this['syncNewExten'][_0x5e27('0x1c')](this));ami['on'](_0x5e27('0x1d'),this[_0x5e27('0x1e')][_0x5e27('0x1c')](this));ami['on'](_0x5e27('0x1f'),this[_0x5e27('0x20')][_0x5e27('0x1c')](this));ami['on'](_0x5e27('0x21'),this['syncNewState']['bind'](this));ami['on'](_0x5e27('0x22'),this[_0x5e27('0x23')]['bind'](this));ami['on'](_0x5e27('0x24'),this[_0x5e27('0x25')][_0x5e27('0x1c')](this));ami['on'](_0x5e27('0x26'),this[_0x5e27('0x27')]['bind'](this));ami['on'](_0x5e27('0x28'),this[_0x5e27('0x29')][_0x5e27('0x1c')](this));ami['on'](_0x5e27('0x2a'),this[_0x5e27('0x2b')][_0x5e27('0x1c')](this));ami['on'](_0x5e27('0x2c'),this[_0x5e27('0x2d')][_0x5e27('0x1c')](this));ami['on'](_0x5e27('0x2e'),this['syncMusicOnHoldStop'][_0x5e27('0x1c')](this));return BPromise['resolve']()[_0x5e27('0x2f')](ami[_0x5e27('0x30')]())[_0x5e27('0x31')](function(_0x1276a7){console[_0x5e27('0x32')](_0x1276a7);});}VoiceCallReport[_0x5e27('0x33')][_0x5e27('0x34')]=function(_0xc757ca){return _0xc757ca!==null&&!_[_0x5e27('0x35')](_0xc757ca);};VoiceCallReport['prototype'][_0x5e27('0x36')]=function(_0x2be43a,_0x45003e,_0x12815e){io['to'](_0x2be43a)[_0x5e27('0x36')](_0x45003e,_0x12815e);};VoiceCallReport['prototype'][_0x5e27('0x27')]=function(_0x37c80a){try{if(this[_0x5e27('0x34')](_0x37c80a)){if(_0x37c80a[_0x5e27('0x37')]===_0x37c80a[_0x5e27('0x38')]){if(!_[_0x5e27('0x35')](this[_0x5e27('0x19')][_0x37c80a[_0x5e27('0x37')]])){_[_0x5e27('0x39')](this[_0x5e27('0x19')][_0x37c80a['uniqueid']],_[_0x5e27('0x3a')](_0x37c80a,_['keys'](this['channels'][_0x37c80a[_0x5e27('0x37')]])));}}}}catch(_0x3d05a0){logger[_0x5e27('0x3b')](_0x5e27('0x3c'),util[_0x5e27('0x3d')](_0x3d05a0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5e27('0x33')][_0x5e27('0x20')]=function(_0x1b6108){try{if(this[_0x5e27('0x34')](_0x1b6108)){if(_0x1b6108[_0x5e27('0x37')]===_0x1b6108['linkedid']&&_0x1b6108[_0x5e27('0x3e')]!=_0x5e27('0x3f')){if(_[_0x5e27('0x35')](this[_0x5e27('0x19')][_0x1b6108[_0x5e27('0x37')]])){this[_0x5e27('0x19')][_0x1b6108[_0x5e27('0x37')]]=new Channel();this[_0x5e27('0x19')][_0x1b6108[_0x5e27('0x37')]][_0x5e27('0x40')]=moment()[_0x5e27('0x41')](_0x5e27('0x42'));this[_0x5e27('0x19')][_0x1b6108[_0x5e27('0x37')]][_0x5e27('0x43')]=dispositions[_[_0x5e27('0x44')](_0x1b6108['channelstate'])];_['merge'](this[_0x5e27('0x19')][_0x1b6108[_0x5e27('0x37')]],_['pick'](_0x1b6108,_[_0x5e27('0x45')](this[_0x5e27('0x19')][_0x1b6108[_0x5e27('0x37')]])));if(_0x1b6108[_0x5e27('0x46')]===_0x5e27('0x47')){if(this[_0x5e27('0x1a')][_0x1b6108['channel']['split']('-')[0x0]]){this[_0x5e27('0x1a')][_0x1b6108[_0x5e27('0x3e')][_0x5e27('0x48')]('-')[0x0]][_0x5e27('0x49')]=_0x1b6108[_0x5e27('0x4a')];this[_0x5e27('0x36')](util[_0x5e27('0x41')](_0x5e27('0x4b'),this[_0x5e27('0x1a')][_0x1b6108[_0x5e27('0x3e')][_0x5e27('0x48')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this['agents'][_0x1b6108[_0x5e27('0x3e')][_0x5e27('0x48')]('-')[0x0]][_0x5e27('0x4c')],'destconnectedlinenum':_0x1b6108[_0x5e27('0x4a')]});}}}}}}catch(_0x4c668c){logger[_0x5e27('0x3b')]('[syncNewChannel][VoiceCallReport]',util[_0x5e27('0x3d')](_0x4c668c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x5e27('0x1e')]=function(_0x147200){try{if(this[_0x5e27('0x34')](_0x147200)){if(_0x147200[_0x5e27('0x37')]===_0x147200[_0x5e27('0x38')]&&_0x147200[_0x5e27('0x4a')]!='h'&&_0x147200[_0x5e27('0x3e')]!=_0x5e27('0x3f')){_0x147200[_0x5e27('0x4d')]=_0x147200[_0x5e27('0x4d')][_0x5e27('0x4e')]();_0x147200[_0x5e27('0x4f')]=(_0x147200[_0x5e27('0x50')]||_0x147200[_0x5e27('0x4f')])[_0x5e27('0x4e')]();if(_[_0x5e27('0x35')](this[_0x5e27('0x19')][_0x147200[_0x5e27('0x37')]])){this['channels'][_0x147200[_0x5e27('0x37')]]=new Channel();this[_0x5e27('0x19')][_0x147200['uniqueid']][_0x5e27('0x40')]=_0x147200[_0x5e27('0x51')]?moment()['subtract'](moment[_0x5e27('0x51')](_0x147200[_0x5e27('0x51')])[_0x5e27('0x52')](),_0x5e27('0x52'))[_0x5e27('0x41')](_0x5e27('0x42')):moment()['format'](_0x5e27('0x42'));this[_0x5e27('0x19')][_0x147200[_0x5e27('0x37')]][_0x5e27('0x43')]=_0x5e27('0x13');}_[_0x5e27('0x39')](this[_0x5e27('0x19')][_0x147200[_0x5e27('0x37')]],_[_0x5e27('0x3a')](_0x147200,_[_0x5e27('0x45')](this[_0x5e27('0x19')][_0x147200[_0x5e27('0x37')]])));if(_[_0x5e27('0x53')](applications,_0x147200[_0x5e27('0x4d')])){this['channels'][_0x147200['uniqueid']][_0x5e27('0x54')]=_0x147200[_0x5e27('0x4d')];this['channels'][_0x147200[_0x5e27('0x37')]][_0x5e27('0x55')]=_0x147200[_0x5e27('0x4f')];if(_0x147200['application']===_0x5e27('0xe')&&_[_0x5e27('0x56')](_0x147200['applicationdata'],_0x5e27('0x57'))){var _0x4bd948=_0x147200[_0x5e27('0x4f')][_0x5e27('0x48')]('=');var _0x254cce=_0x4bd948[0x0]['match'](/cdr\((.*)\)/);if(_0x254cce){this[_0x5e27('0x19')][_0x147200['uniqueid']][_0x254cce[0x1]]=_0x4bd948[0x1];}}else if(_0x147200[_0x5e27('0x4d')]===_0x5e27('0x58')){this[_0x5e27('0x19')][_0x147200['uniqueid']][_0x5e27('0x58')]=_0x147200['applicationdata'][_0x5e27('0x48')](',')[0x0];}}}}}catch(_0x5154e9){logger[_0x5e27('0x3b')]('[syncNewExten][VoiceCallReport]',util[_0x5e27('0x3d')](_0x5154e9,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x5e27('0x59')]=function(_0x2bdf4f){try{if(this[_0x5e27('0x34')](_0x2bdf4f)){if(_0x2bdf4f[_0x5e27('0x37')]!==_0x2bdf4f['linkedid']){if(this[_0x5e27('0x19')][_0x2bdf4f[_0x5e27('0x38')]]){if(_0x2bdf4f[_0x5e27('0x5a')]==='6'){if(!this[_0x5e27('0x19')][_0x2bdf4f[_0x5e27('0x38')]][_0x5e27('0x5b')]){this['channels'][_0x2bdf4f[_0x5e27('0x38')]]['answered']=!![];this[_0x5e27('0x19')][_0x2bdf4f['linkedid']][_0x5e27('0x5c')]=moment()[_0x5e27('0x41')](_0x5e27('0x42'));}this[_0x5e27('0x19')][_0x2bdf4f[_0x5e27('0x38')]][_0x5e27('0x38')]=_0x2bdf4f[_0x5e27('0x37')];if(_0x2bdf4f[_0x5e27('0x5d')]!=='xcally-motion-preview'){this[_0x5e27('0x19')][_0x2bdf4f[_0x5e27('0x38')]][_0x5e27('0x5e')]=_0x2bdf4f[_0x5e27('0x5d')];}this[_0x5e27('0x19')][_0x2bdf4f[_0x5e27('0x38')]][_0x5e27('0x5f')]=_0x2bdf4f[_0x5e27('0x60')];this['channels'][_0x2bdf4f[_0x5e27('0x38')]]['destinationchannel']=_0x2bdf4f[_0x5e27('0x3e')];this[_0x5e27('0x19')][_0x2bdf4f['linkedid']][_0x5e27('0x43')]=dispositions[_['toNumber'](_0x2bdf4f[_0x5e27('0x5a')])];if(this[_0x5e27('0x1a')][_0x2bdf4f['channel']['split']('-')[0x0]]){this[_0x5e27('0x19')][_0x2bdf4f[_0x5e27('0x38')]][_0x5e27('0x61')]=this['agents'][_0x2bdf4f[_0x5e27('0x3e')][_0x5e27('0x48')]('-')[0x0]]['id'];this[_0x5e27('0x19')][_0x2bdf4f['linkedid']][_0x5e27('0x62')]=this[_0x5e27('0x1a')][_0x2bdf4f['channel'][_0x5e27('0x48')]('-')[0x0]][_0x5e27('0x63')];}}}}else{if(this[_0x5e27('0x19')][_0x2bdf4f[_0x5e27('0x37')]]){if(_0x2bdf4f['channelstate']==='6'){if(this[_0x5e27('0x1a')][_0x2bdf4f[_0x5e27('0x3e')][_0x5e27('0x48')]('-')[0x0]]){this[_0x5e27('0x19')][_0x2bdf4f['uniqueid']][_0x5e27('0x61')]=this[_0x5e27('0x1a')][_0x2bdf4f[_0x5e27('0x3e')][_0x5e27('0x48')]('-')[0x0]]['id'];this[_0x5e27('0x19')][_0x2bdf4f[_0x5e27('0x37')]][_0x5e27('0x62')]=this[_0x5e27('0x1a')][_0x2bdf4f[_0x5e27('0x3e')][_0x5e27('0x48')]('-')[0x0]][_0x5e27('0x63')];}}}}}}catch(_0x5e684f){logger[_0x5e27('0x3b')](_0x5e27('0x64'),util[_0x5e27('0x3d')](_0x5e684f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5e27('0x33')][_0x5e27('0x65')]=function(_0x3277f2,_0x58c55e){if(this[_0x5e27('0x19')][_0x3277f2]){this['channels'][_0x3277f2][_0x5e27('0x66')]=!![];if(_[_0x5e27('0x67')](_0x58c55e,_0x5e27('0x68'))){_0x58c55e=_0x58c55e[_0x5e27('0x69')](_0x5e27('0x68'),_0x5e27('0x6a'));}this[_0x5e27('0x19')][_0x3277f2][_0x5e27('0x6b')]=_0x58c55e;var _0x41dee4=_['find'](this['channels'][_0x3277f2][_0x5e27('0x6c')],{'filename':_0x58c55e});if(_[_0x5e27('0x6d')](_0x41dee4)){this[_0x5e27('0x19')][_0x3277f2]['monitors'][_0x5e27('0x6e')]({'filename':_0x58c55e,'createdAt':moment()[_0x5e27('0x41')](_0x5e27('0x42')),'mixmonitorid':'','status':_0x5e27('0x6f')});}}};VoiceCallReport[_0x5e27('0x33')][_0x5e27('0x23')]=function(_0x38aca9){try{if(this[_0x5e27('0x34')](_0x38aca9)){if(this[_0x5e27('0x19')][_0x38aca9[_0x5e27('0x37')]]&&_0x38aca9[_0x5e27('0x3e')]!=_0x5e27('0x3f')){if(this[_0x5e27('0x34')](_0x38aca9['variable'])){if(this[_0x5e27('0x34')](_0x38aca9[_0x5e27('0x70')][_0x5e27('0x71')])){this[_0x5e27('0x65')](_0x38aca9[_0x5e27('0x37')],_0x38aca9[_0x5e27('0x72')]);}else if(this[_0x5e27('0x34')](_0x38aca9[_0x5e27('0x70')]['xmd-phone'])){this['channels'][_0x38aca9['uniqueid']][_0x5e27('0x5d')]=_0x38aca9[_0x5e27('0x72')];}else if(this[_0x5e27('0x34')](_0x38aca9[_0x5e27('0x70')]['xmd-callerid'])){this[_0x5e27('0x19')][_0x38aca9[_0x5e27('0x37')]][_0x5e27('0x73')]=_0x38aca9[_0x5e27('0x72')];}else if(this[_0x5e27('0x34')](_0x38aca9['variable']['xmd-cdrtype'])){this[_0x5e27('0x19')][_0x38aca9['uniqueid']]['type']=_0x38aca9[_0x5e27('0x72')];}else if(this['isNotNull'](_0x38aca9[_0x5e27('0x70')][_0x5e27('0x74')])){this[_0x5e27('0x19')][_0x38aca9[_0x5e27('0x37')]][_0x5e27('0x58')]=_0x38aca9[_0x5e27('0x72')]['split'](',')[0x0];}else if(this['isNotNull'](_0x38aca9[_0x5e27('0x70')][_0x5e27('0x75')])){this[_0x5e27('0x19')][_0x38aca9[_0x5e27('0x37')]][_0x5e27('0x76')]=_0x38aca9[_0x5e27('0x72')];}else if(this[_0x5e27('0x34')](_0x38aca9['variable']['xmd-destination'])){this[_0x5e27('0x19')][_0x38aca9[_0x5e27('0x37')]]['destination']=_0x38aca9[_0x5e27('0x72')];}else if(this[_0x5e27('0x34')](_0x38aca9[_0x5e27('0x70')][_0x5e27('0x77')])){this[_0x5e27('0x19')][_0x38aca9[_0x5e27('0x37')]][_0x5e27('0x78')]=_0x38aca9['value'];}else if(this[_0x5e27('0x34')](_0x38aca9[_0x5e27('0x70')][_0x5e27('0x79')])){this[_0x5e27('0x19')][_0x38aca9['uniqueid']]['queue']=_0x38aca9[_0x5e27('0x72')];}else if(this[_0x5e27('0x34')](_0x38aca9['variable']['sipcallid'])){this[_0x5e27('0x19')][_0x38aca9['uniqueid']][_0x5e27('0x7a')]=_0x38aca9[_0x5e27('0x72')];}}}else if(this[_0x5e27('0x34')](_0x38aca9[_0x5e27('0x70')][_0x5e27('0x71')])){if(_0x38aca9[_0x5e27('0x72')]){var _0x26f26b=path[_0x5e27('0x7b')](_0x38aca9['value'])[_0x5e27('0x63')];this['syncMixMonitorFilename'](_0x26f26b,_0x38aca9[_0x5e27('0x72')]);}}else if(this['channels'][_0x38aca9[_0x5e27('0x38')]]){if(this[_0x5e27('0x34')](_0x38aca9[_0x5e27('0x70')])){if(this['isNotNull'](_0x38aca9['variable'][_0x5e27('0x7c')])){this[_0x5e27('0x19')][_0x38aca9['linkedid']][_0x5e27('0x7d')]=_0x38aca9['value'];}}}}}catch(_0x43e017){logger[_0x5e27('0x3b')](_0x5e27('0x7e'),util[_0x5e27('0x3d')](_0x43e017,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5e27('0x33')]['syncHangup']=function(_0x3e37a3){try{if(this[_0x5e27('0x34')](_0x3e37a3)){if(this['channels'][_0x3e37a3[_0x5e27('0x37')]]){var _0xb77530=moment();this[_0x5e27('0x19')][_0x3e37a3['uniqueid']][_0x5e27('0x7f')]=_0xb77530[_0x5e27('0x41')](_0x5e27('0x42'));this[_0x5e27('0x19')][_0x3e37a3[_0x5e27('0x37')]][_0x5e27('0x51')]=_0xb77530[_0x5e27('0x80')](this[_0x5e27('0x19')][_0x3e37a3['uniqueid']][_0x5e27('0x40')],'seconds');if(this[_0x5e27('0x19')][_0x3e37a3[_0x5e27('0x37')]][_0x5e27('0x5b')]){this['channels'][_0x3e37a3[_0x5e27('0x37')]]['billableseconds']=_0xb77530[_0x5e27('0x80')](this[_0x5e27('0x19')][_0x3e37a3['uniqueid']]['answertime'],_0x5e27('0x52'));this[_0x5e27('0x19')][_0x3e37a3['uniqueid']][_0x5e27('0x81')]=this[_0x5e27('0x19')][_0x3e37a3[_0x5e27('0x37')]][_0x5e27('0x51')]-this['channels'][_0x3e37a3[_0x5e27('0x37')]][_0x5e27('0x82')];}if(_0x3e37a3[_0x5e27('0x46')]==='from-sip'){if(this[_0x5e27('0x1a')][_0x3e37a3[_0x5e27('0x3e')]['split']('-')[0x0]]){this[_0x5e27('0x1a')][_0x3e37a3[_0x5e27('0x3e')][_0x5e27('0x48')]('-')[0x0]]=_[_0x5e27('0x83')](this[_0x5e27('0x1a')][_0x3e37a3[_0x5e27('0x3e')][_0x5e27('0x48')]('-')[0x0]],[_0x5e27('0x49')]);this[_0x5e27('0x36')](util[_0x5e27('0x41')](_0x5e27('0x4b'),this[_0x5e27('0x1a')][_0x3e37a3[_0x5e27('0x3e')][_0x5e27('0x48')]('-')[0x0]][_0x5e27('0x63')]),_0x5e27('0x84'),{'destaccountcode':this['agents'][_0x3e37a3['channel'][_0x5e27('0x48')]('-')[0x0]][_0x5e27('0x4c')]});}}ami[_0x5e27('0x36')](_0x5e27('0x85'),this[_0x5e27('0x19')][_0x3e37a3[_0x5e27('0x37')]]);delete this['channels'][_0x3e37a3[_0x5e27('0x37')]];}}}catch(_0x52840d){logger[_0x5e27('0x3b')](_0x5e27('0x86'),util[_0x5e27('0x3d')](_0x52840d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5e27('0x33')]['syncAttendedTransfer']=function(_0x566450){try{if(this[_0x5e27('0x34')](_0x566450)){if(this['channels'][_0x566450[_0x5e27('0x87')]]){this['channels'][_0x566450[_0x5e27('0x87')]][_0x5e27('0x88')]=_0x566450['origtransferercalleridnum'];this[_0x5e27('0x19')][_0x566450[_0x5e27('0x87')]][_0x5e27('0x89')]=_0x566450[_0x5e27('0x8a')];var _0x1b2e76=this[_0x5e27('0x19')][_0x566450['secondtransfereruniqueid']];this[_0x5e27('0x19')][_0x566450[_0x5e27('0x8b')]]=this['channels'][_0x566450[_0x5e27('0x87')]];this['channels'][_0x566450[_0x5e27('0x87')]]=_0x1b2e76;}}}catch(_0x2a3af0){logger[_0x5e27('0x3b')](_0x5e27('0x8c'),util[_0x5e27('0x3d')](_0x2a3af0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5e27('0x33')][_0x5e27('0x2b')]=function(_0xc0a95f){try{if(this[_0x5e27('0x34')](_0xc0a95f)){if(this[_0x5e27('0x19')][_0xc0a95f[_0x5e27('0x87')]]){this['channels'][_0xc0a95f[_0x5e27('0x87')]][_0x5e27('0x88')]=_0xc0a95f[_0x5e27('0x8d')];this[_0x5e27('0x19')][_0xc0a95f[_0x5e27('0x87')]][_0x5e27('0x89')]=_0xc0a95f[_0x5e27('0x8e')];this[_0x5e27('0x25')]({'event':_0x5e27('0x8f'),'uniqueid':_0xc0a95f[_0x5e27('0x87')],'context':_0xc0a95f[_0x5e27('0x46')],'channel':_0xc0a95f['transfererchannel']});}}}catch(_0x4792a7){logger[_0x5e27('0x3b')](_0x5e27('0x90'),util[_0x5e27('0x3d')](_0x4792a7,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x5e27('0x2d')]=function(_0x53f617){try{if(this[_0x5e27('0x34')](_0x53f617)){if(this['channels'][_0x53f617[_0x5e27('0x37')]]){if(!_[_0x5e27('0x6d')](this[_0x5e27('0x19')][_0x53f617['uniqueid']][_0x5e27('0x5c')])){this[_0x5e27('0x19')][_0x53f617[_0x5e27('0x37')]][_0x5e27('0x91')]=moment()[_0x5e27('0x41')](_0x5e27('0x42'));}}}}catch(_0x2f5cd6){logger[_0x5e27('0x3b')]('[syncMusicOnHoldStart][VoiceCallReport]',util[_0x5e27('0x3d')](_0x2f5cd6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5e27('0x33')]['syncMusicOnHoldStop']=function(_0x43b5f7){try{if(this[_0x5e27('0x34')](_0x43b5f7)){if(this[_0x5e27('0x19')][_0x43b5f7[_0x5e27('0x37')]]){if(!_[_0x5e27('0x6d')](this[_0x5e27('0x19')][_0x43b5f7[_0x5e27('0x37')]]['mohstarttime'])){this[_0x5e27('0x19')][_0x43b5f7['uniqueid']][_0x5e27('0x92')]+=moment()['milliseconds'](0x0)[_0x5e27('0x80')](this[_0x5e27('0x19')][_0x43b5f7['uniqueid']][_0x5e27('0x91')],_0x5e27('0x52'));delete this['channels'][_0x43b5f7[_0x5e27('0x37')]][_0x5e27('0x91')];}}}}catch(_0x12bdf6){logger[_0x5e27('0x3b')]('[syncMusicOnHoldStop][VoiceCallReport]',util[_0x5e27('0x3d')](_0x12bdf6,{'showHidden':![],'depth':null}));}};module[_0x5e27('0x93')]=VoiceCallReport;
\ No newline at end of file
index 393c903..387ec1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa51f=['membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','syncHangup','endtime','diff','starttime','seconds','complete','total','answered','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','duration','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','moment','util','../../../config/logger','ami','../ami','socket.io-emitter','outboundChannels','outbound','variables','syncDialBegin','bind','varset','hangup','prototype','isNotNull','isUndefined','emit','channels','merge','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','privilege','voice:outbound','error','[syncDialBegin][VoiceDialReport]','syncDialEnd','dialstatus','ANSWER','connectedlinename','answertime','lastevent','connect','voice_outbound_channel:save','[syncDialEnd][VoiceDialReport]','inspect','syncVarSet','addVariable','keys','variable','value','outboundrouteid','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','bridgepeer','bridgepvtcallid'];(function(_0x53b662,_0x391f83){var _0x5717a5=function(_0x3c2a38){while(--_0x3c2a38){_0x53b662['push'](_0x53b662['shift']());}};_0x5717a5(++_0x391f83);}(_0xa51f,0x10d));var _0xfa51=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xa51f[_0x2dadb9];return _0x2f0097;};'use strict';var _=require('lodash');var moment=require(_0xfa51('0x0'));var util=require(_0xfa51('0x1'));var logger=require(_0xfa51('0x2'))(_0xfa51('0x3'));var ami=require(_0xfa51('0x4'));var io=require(_0xfa51('0x5'))({'host':'localhost','port':0x18eb});function VoiceDialReport(_0x1a92e4){this['channels']=_0x1a92e4[_0xfa51('0x6')];this['outbound']=_0x1a92e4[_0xfa51('0x7')];this[_0xfa51('0x8')]={};ami['on']('dialbegin',this[_0xfa51('0x9')][_0xfa51('0xa')](this));ami['on']('dialend',this['syncDialEnd']['bind'](this));ami['on'](_0xfa51('0xb'),this['syncVarSet']['bind'](this));ami['on'](_0xfa51('0xc'),this['syncHangup']['bind'](this));}VoiceDialReport[_0xfa51('0xd')][_0xfa51('0xe')]=function(_0x33f563){return _0x33f563!==null&&!_[_0xfa51('0xf')](_0x33f563);};VoiceDialReport[_0xfa51('0xd')][_0xfa51('0x10')]=function(_0x119ace,_0x230e67,_0x45523a){io['to'](_0x119ace)[_0xfa51('0x10')](_0x230e67,_0x45523a);};VoiceDialReport[_0xfa51('0xd')][_0xfa51('0x9')]=function(_0x55b6e4){try{if(this[_0xfa51('0xe')](_0x55b6e4)){if(this[_0xfa51('0x11')][_0x55b6e4['uniqueid']]){_[_0xfa51('0x12')](this['channels'][_0x55b6e4[_0xfa51('0x13')]],{'starttime':moment()[_0xfa51('0x14')](_0xfa51('0x15')),'lastevent':_0xfa51('0x16'),'interface':_0x55b6e4[_0xfa51('0x17')][_0xfa51('0x18')](0x0,_0x55b6e4[_0xfa51('0x17')][_0xfa51('0x19')]('-')),'membername':_0x55b6e4['channel'][_0xfa51('0x18')](_0x55b6e4[_0xfa51('0x17')]['lastIndexOf']('/')+0x1,_0x55b6e4[_0xfa51('0x17')][_0xfa51('0x19')]('-'))},_[_0xfa51('0x1a')](_0x55b6e4,[_0xfa51('0x1b'),_0xfa51('0x1c')]));this['emit'](_0xfa51('0x1d'),'voice_outbound_channel:save',this[_0xfa51('0x11')][_0x55b6e4['uniqueid']]);ami[_0xfa51('0x10')]('custom:dialbegin',this[_0xfa51('0x11')][_0x55b6e4[_0xfa51('0x13')]]);}}}catch(_0x6cb2bc){logger[_0xfa51('0x1e')](_0xfa51('0x1f'),util['inspect'](_0x6cb2bc,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xfa51('0x20')]=function(_0x4a89d7){try{if(this['isNotNull'](_0x4a89d7)){if(this[_0xfa51('0x11')][_0x4a89d7[_0xfa51('0x13')]]){this[_0xfa51('0x11')][_0x4a89d7[_0xfa51('0x13')]][_0xfa51('0x21')]=_0x4a89d7[_0xfa51('0x21')];if(_0x4a89d7[_0xfa51('0x21')]===_0xfa51('0x22')){this[_0xfa51('0x11')][_0x4a89d7[_0xfa51('0x13')]]['connectedlinenum']=_0x4a89d7['connectedlinenum'];this['channels'][_0x4a89d7[_0xfa51('0x13')]][_0xfa51('0x23')]=_0x4a89d7['connectedlinename'];this[_0xfa51('0x11')][_0x4a89d7[_0xfa51('0x13')]][_0xfa51('0x24')]=moment()[_0xfa51('0x14')](_0xfa51('0x15'));this[_0xfa51('0x11')][_0x4a89d7['uniqueid']][_0xfa51('0x25')]=_0xfa51('0x26');ami[_0xfa51('0x10')]('custom:dialconnect',this[_0xfa51('0x11')][_0x4a89d7[_0xfa51('0x13')]]);}this['emit']('voice:outbound',_0xfa51('0x27'),this[_0xfa51('0x11')][_0x4a89d7[_0xfa51('0x13')]]);}}}catch(_0x3eda43){logger['error'](_0xfa51('0x28'),util[_0xfa51('0x29')](_0x3eda43,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xfa51('0xd')][_0xfa51('0x2a')]=function(_0x4d83f3){try{if(this[_0xfa51('0xe')](_0x4d83f3)){this[_0xfa51('0x2b')](_0x4d83f3[_0xfa51('0x13')],_[_0xfa51('0x2c')](_0x4d83f3[_0xfa51('0x2d')])[0x0],_0x4d83f3[_0xfa51('0x2e')]);if(this[_0xfa51('0xe')](_0x4d83f3[_0xfa51('0x2d')])&&this['isNotNull'](_0x4d83f3[_0xfa51('0x2d')][_0xfa51('0x2f')])){if(_[_0xfa51('0xf')](this[_0xfa51('0x11')][_0x4d83f3[_0xfa51('0x13')]])){this[_0xfa51('0x11')][_0x4d83f3[_0xfa51('0x13')]]={'routeId':_0x4d83f3[_0xfa51('0x2e')],'variables':this[_0xfa51('0x8')][_0x4d83f3[_0xfa51('0x13')]]};this['emit'](_0xfa51('0x1d'),'voice_outbound_channel:save',this[_0xfa51('0x11')][_0x4d83f3[_0xfa51('0x13')]]);}}}}catch(_0x2c30da){logger[_0xfa51('0x1e')]('[syncVarSet][VoiceDialReport]',util['inspect'](_0x2c30da,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['addVariable']=function(_0x1b6789,_0x1feec6,_0x21ec68){var _0xb43c0f=['rtpaudioqos',_0xfa51('0x30'),_0xfa51('0x31'),_0xfa51('0x32'),_0xfa51('0x33'),'rtpaudioqoslossbridged',_0xfa51('0x34'),'rtpaudioqosrttbridged','sipcallid','sipuri',_0xfa51('0x35'),_0xfa51('0x36'),_0xfa51('0x37'),_0xfa51('0x38'),_0xfa51('0x39'),_0xfa51('0x3a'),_0xfa51('0x3b'),_0xfa51('0x3c'),_0xfa51('0x3d')];if(!_[_0xfa51('0x3e')](_0x1feec6)&&!_[_0xfa51('0x3f')](_0xb43c0f,_0x1feec6)){if(_[_0xfa51('0xf')](this['variables'][_0x1b6789])){this[_0xfa51('0x8')][_0x1b6789]={};}this[_0xfa51('0x8')][_0x1b6789][_0x1feec6]=_0x21ec68;}};VoiceDialReport['prototype'][_0xfa51('0x40')]=function(_0x3ca1f3){try{if(this['isNotNull'](_0x3ca1f3)){if(this[_0xfa51('0x11')][_0x3ca1f3[_0xfa51('0x13')]]){this['channels'][_0x3ca1f3[_0xfa51('0x13')]][_0xfa51('0x41')]=moment()[_0xfa51('0x14')](_0xfa51('0x15'));this[_0xfa51('0x11')][_0x3ca1f3[_0xfa51('0x13')]]['duration']=moment(this[_0xfa51('0x11')][_0x3ca1f3[_0xfa51('0x13')]][_0xfa51('0x41')])[_0xfa51('0x42')](this[_0xfa51('0x11')][_0x3ca1f3['uniqueid']][_0xfa51('0x43')],_0xfa51('0x44'));this['channels'][_0x3ca1f3[_0xfa51('0x13')]][_0xfa51('0x25')]=_0xfa51('0x45');this['outbound'][_0xfa51('0x46')]+=0x1;if(this[_0xfa51('0x11')][_0x3ca1f3['uniqueid']]['answertime']){this[_0xfa51('0x7')][_0xfa51('0x47')]+=0x1;this[_0xfa51('0x11')][_0x3ca1f3[_0xfa51('0x13')]][_0xfa51('0x48')]=moment(this['channels'][_0x3ca1f3[_0xfa51('0x13')]][_0xfa51('0x24')])['diff'](this[_0xfa51('0x11')][_0x3ca1f3[_0xfa51('0x13')]][_0xfa51('0x43')],'seconds');this[_0xfa51('0x11')][_0x3ca1f3[_0xfa51('0x13')]][_0xfa51('0x49')]=moment(this[_0xfa51('0x11')][_0x3ca1f3['uniqueid']][_0xfa51('0x41')])[_0xfa51('0x42')](this[_0xfa51('0x11')][_0x3ca1f3[_0xfa51('0x13')]][_0xfa51('0x24')],_0xfa51('0x44'));this[_0xfa51('0x7')][_0xfa51('0x4a')]+=this['channels'][_0x3ca1f3[_0xfa51('0x13')]][_0xfa51('0x48')]||0x0;this['outbound'][_0xfa51('0x4b')]+=this['channels'][_0x3ca1f3['uniqueid']]['billableseconds'];}this[_0xfa51('0x7')][_0xfa51('0x4c')]+=this[_0xfa51('0x11')][_0x3ca1f3[_0xfa51('0x13')]][_0xfa51('0x4d')];ami[_0xfa51('0x10')]('custom:voiceDialReport',this[_0xfa51('0x11')][_0x3ca1f3[_0xfa51('0x13')]]);ami[_0xfa51('0x10')](_0xfa51('0x4e'),this[_0xfa51('0x11')][_0x3ca1f3['uniqueid']]);this[_0xfa51('0x10')](_0xfa51('0x1d'),_0xfa51('0x4f'),this[_0xfa51('0x7')]);this[_0xfa51('0x10')](_0xfa51('0x1d'),_0xfa51('0x50'),this[_0xfa51('0x11')][_0x3ca1f3[_0xfa51('0x13')]]);delete this[_0xfa51('0x11')][_0x3ca1f3[_0xfa51('0x13')]];}if(this['variables'][_0x3ca1f3['uniqueid']]){delete this[_0xfa51('0x8')][_0x3ca1f3['uniqueid']];}}}catch(_0x434499){logger[_0xfa51('0x1e')]('[syncHangup][VoiceDialReport]',util['inspect'](_0x434499,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file
+var _0xc532=['bind','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','channels','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','lastIndexOf','substring','omit','event','privilege','voice:outbound','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','connect','custom:dialconnect','voice_outbound_channel:save','[syncDialEnd][VoiceDialReport]','keys','variable','outboundrouteid','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','membername','memberpenalty','memberrealtime','isNil','includes','endtime','duration','diff','starttime','seconds','lastevent','complete','total','answered','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','custom:voiceDialReport','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','moment','util','../../../config/logger','ami','../ami','localhost','outbound','variables','dialbegin'];(function(_0x1f6e0d,_0x133384){var _0x128037=function(_0x5c4c24){while(--_0x5c4c24){_0x1f6e0d['push'](_0x1f6e0d['shift']());}};_0x128037(++_0x133384);}(_0xc532,0x1e9));var _0x2c53=function(_0xf7834a,_0x49d445){_0xf7834a=_0xf7834a-0x0;var _0x21fada=_0xc532[_0xf7834a];return _0x21fada;};'use strict';var _=require('lodash');var moment=require(_0x2c53('0x0'));var util=require(_0x2c53('0x1'));var logger=require(_0x2c53('0x2'))(_0x2c53('0x3'));var ami=require(_0x2c53('0x4'));var io=require('socket.io-emitter')({'host':_0x2c53('0x5'),'port':0x18eb});function VoiceDialReport(_0x341994){this['channels']=_0x341994['outboundChannels'];this[_0x2c53('0x6')]=_0x341994[_0x2c53('0x6')];this[_0x2c53('0x7')]={};ami['on'](_0x2c53('0x8'),this['syncDialBegin'][_0x2c53('0x9')](this));ami['on']('dialend',this[_0x2c53('0xa')][_0x2c53('0x9')](this));ami['on'](_0x2c53('0xb'),this[_0x2c53('0xc')]['bind'](this));ami['on'](_0x2c53('0xd'),this[_0x2c53('0xe')][_0x2c53('0x9')](this));}VoiceDialReport[_0x2c53('0xf')][_0x2c53('0x10')]=function(_0xc63cbf){return _0xc63cbf!==null&&!_[_0x2c53('0x11')](_0xc63cbf);};VoiceDialReport[_0x2c53('0xf')][_0x2c53('0x12')]=function(_0x2c10e9,_0x241107,_0x58913f){io['to'](_0x2c10e9)[_0x2c53('0x12')](_0x241107,_0x58913f);};VoiceDialReport[_0x2c53('0xf')]['syncDialBegin']=function(_0x4d3e86){try{if(this[_0x2c53('0x10')](_0x4d3e86)){if(this[_0x2c53('0x13')][_0x4d3e86[_0x2c53('0x14')]]){_[_0x2c53('0x15')](this[_0x2c53('0x13')][_0x4d3e86[_0x2c53('0x14')]],{'starttime':moment()[_0x2c53('0x16')](_0x2c53('0x17')),'lastevent':_0x2c53('0x18'),'interface':_0x4d3e86[_0x2c53('0x19')]['substring'](0x0,_0x4d3e86[_0x2c53('0x19')][_0x2c53('0x1a')]('-')),'membername':_0x4d3e86['channel'][_0x2c53('0x1b')](_0x4d3e86['channel'][_0x2c53('0x1a')]('/')+0x1,_0x4d3e86[_0x2c53('0x19')][_0x2c53('0x1a')]('-'))},_[_0x2c53('0x1c')](_0x4d3e86,[_0x2c53('0x1d'),_0x2c53('0x1e')]));this[_0x2c53('0x12')](_0x2c53('0x1f'),'voice_outbound_channel:save',this[_0x2c53('0x13')][_0x4d3e86['uniqueid']]);ami[_0x2c53('0x12')](_0x2c53('0x20'),this[_0x2c53('0x13')][_0x4d3e86[_0x2c53('0x14')]]);}}}catch(_0x9d7f73){logger[_0x2c53('0x21')](_0x2c53('0x22'),util[_0x2c53('0x23')](_0x9d7f73,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2c53('0xf')][_0x2c53('0xa')]=function(_0x21fb57){try{if(this['isNotNull'](_0x21fb57)){if(this['channels'][_0x21fb57[_0x2c53('0x14')]]){this[_0x2c53('0x13')][_0x21fb57[_0x2c53('0x14')]][_0x2c53('0x24')]=_0x21fb57[_0x2c53('0x24')];if(_0x21fb57[_0x2c53('0x24')]===_0x2c53('0x25')){this['channels'][_0x21fb57['uniqueid']]['connectedlinenum']=_0x21fb57[_0x2c53('0x26')];this[_0x2c53('0x13')][_0x21fb57[_0x2c53('0x14')]][_0x2c53('0x27')]=_0x21fb57['connectedlinename'];this[_0x2c53('0x13')][_0x21fb57[_0x2c53('0x14')]][_0x2c53('0x28')]=moment()[_0x2c53('0x16')](_0x2c53('0x17'));this['channels'][_0x21fb57['uniqueid']]['lastevent']=_0x2c53('0x29');ami[_0x2c53('0x12')](_0x2c53('0x2a'),this[_0x2c53('0x13')][_0x21fb57['uniqueid']]);}this[_0x2c53('0x12')](_0x2c53('0x1f'),_0x2c53('0x2b'),this['channels'][_0x21fb57[_0x2c53('0x14')]]);}}}catch(_0x1b1152){logger[_0x2c53('0x21')](_0x2c53('0x2c'),util['inspect'](_0x1b1152,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2c53('0xf')][_0x2c53('0xc')]=function(_0x4ab189){try{if(this[_0x2c53('0x10')](_0x4ab189)){this['addVariable'](_0x4ab189[_0x2c53('0x14')],_[_0x2c53('0x2d')](_0x4ab189[_0x2c53('0x2e')])[0x0],_0x4ab189['value']);if(this[_0x2c53('0x10')](_0x4ab189['variable'])&&this[_0x2c53('0x10')](_0x4ab189[_0x2c53('0x2e')][_0x2c53('0x2f')])){if(_[_0x2c53('0x11')](this[_0x2c53('0x13')][_0x4ab189[_0x2c53('0x14')]])){this[_0x2c53('0x13')][_0x4ab189[_0x2c53('0x14')]]={'routeId':_0x4ab189['value'],'variables':this[_0x2c53('0x7')][_0x4ab189['uniqueid']]};this['emit']('voice:outbound','voice_outbound_channel:save',this['channels'][_0x4ab189['uniqueid']]);}}}}catch(_0x23c4c4){logger[_0x2c53('0x21')]('[syncVarSet][VoiceDialReport]',util['inspect'](_0x23c4c4,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2c53('0xf')][_0x2c53('0x30')]=function(_0x4ef863,_0x364076,_0x215b86){var _0x1fcd65=[_0x2c53('0x31'),_0x2c53('0x32'),_0x2c53('0x33'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0x2c53('0x34'),_0x2c53('0x35'),'rtpaudioqosrttbridged','sipcallid',_0x2c53('0x36'),'bridgepeer',_0x2c53('0x37'),_0x2c53('0x38'),_0x2c53('0x39'),_0x2c53('0x3a'),'memberlastcall',_0x2c53('0x3b'),_0x2c53('0x3c'),_0x2c53('0x3d')];if(!_[_0x2c53('0x3e')](_0x364076)&&!_[_0x2c53('0x3f')](_0x1fcd65,_0x364076)){if(_[_0x2c53('0x11')](this[_0x2c53('0x7')][_0x4ef863])){this['variables'][_0x4ef863]={};}this[_0x2c53('0x7')][_0x4ef863][_0x364076]=_0x215b86;}};VoiceDialReport['prototype']['syncHangup']=function(_0x351cbe){try{if(this[_0x2c53('0x10')](_0x351cbe)){if(this[_0x2c53('0x13')][_0x351cbe[_0x2c53('0x14')]]){this[_0x2c53('0x13')][_0x351cbe['uniqueid']][_0x2c53('0x40')]=moment()[_0x2c53('0x16')](_0x2c53('0x17'));this[_0x2c53('0x13')][_0x351cbe[_0x2c53('0x14')]][_0x2c53('0x41')]=moment(this[_0x2c53('0x13')][_0x351cbe[_0x2c53('0x14')]]['endtime'])[_0x2c53('0x42')](this[_0x2c53('0x13')][_0x351cbe[_0x2c53('0x14')]][_0x2c53('0x43')],_0x2c53('0x44'));this['channels'][_0x351cbe[_0x2c53('0x14')]][_0x2c53('0x45')]=_0x2c53('0x46');this['outbound'][_0x2c53('0x47')]+=0x1;if(this[_0x2c53('0x13')][_0x351cbe[_0x2c53('0x14')]]['answertime']){this[_0x2c53('0x6')][_0x2c53('0x48')]+=0x1;this[_0x2c53('0x13')][_0x351cbe[_0x2c53('0x14')]][_0x2c53('0x49')]=moment(this['channels'][_0x351cbe['uniqueid']][_0x2c53('0x28')])[_0x2c53('0x42')](this[_0x2c53('0x13')][_0x351cbe[_0x2c53('0x14')]][_0x2c53('0x43')],_0x2c53('0x44'));this[_0x2c53('0x13')][_0x351cbe['uniqueid']][_0x2c53('0x4a')]=moment(this[_0x2c53('0x13')][_0x351cbe[_0x2c53('0x14')]][_0x2c53('0x40')])[_0x2c53('0x42')](this[_0x2c53('0x13')][_0x351cbe[_0x2c53('0x14')]][_0x2c53('0x28')],_0x2c53('0x44'));this[_0x2c53('0x6')][_0x2c53('0x4b')]+=this['channels'][_0x351cbe[_0x2c53('0x14')]][_0x2c53('0x49')]||0x0;this[_0x2c53('0x6')][_0x2c53('0x4c')]+=this['channels'][_0x351cbe['uniqueid']][_0x2c53('0x4a')];}this['outbound'][_0x2c53('0x4d')]+=this['channels'][_0x351cbe[_0x2c53('0x14')]]['duration'];ami[_0x2c53('0x12')](_0x2c53('0x4e'),this[_0x2c53('0x13')][_0x351cbe[_0x2c53('0x14')]]);ami[_0x2c53('0x12')]('custom:dialend',this[_0x2c53('0x13')][_0x351cbe['uniqueid']]);this[_0x2c53('0x12')]('voice:outbound',_0x2c53('0x4f'),this['outbound']);this[_0x2c53('0x12')](_0x2c53('0x1f'),_0x2c53('0x50'),this[_0x2c53('0x13')][_0x351cbe[_0x2c53('0x14')]]);delete this[_0x2c53('0x13')][_0x351cbe[_0x2c53('0x14')]];}if(this[_0x2c53('0x7')][_0x351cbe[_0x2c53('0x14')]]){delete this[_0x2c53('0x7')][_0x351cbe[_0x2c53('0x14')]];}}}catch(_0x441ac8){logger[_0x2c53('0x21')](_0x2c53('0x51'),util[_0x2c53('0x23')](_0x441ac8,{'showHidden':![],'depth':null}));}};module[_0x2c53('0x52')]=VoiceDialReport;
\ No newline at end of file
index 80f0af8..967d98a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6666=['rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepvtcallid','memberdynamic','memberlastcall','membername','memberpenalty','memberrealtime','includes','length','diff','milliseconds','lastevent','abandoned','custom:queuecallerabandon','custom:queuecallerunmanaged','custom:voiceQueueReport','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','ATTENDEDTRANSFER','[syncAttendedTransfer][VoiceQueueReport]','BLIND','extension','[syncBlindTransfer][VoiceQueueReport]','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','syncMusicOnHoldStop','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','lodash','moment','md5','../../../config/logger','ami','../ami','socket.io-emitter','localhost','prototype','enqueue','tail','agents','queueChannels','voiceQueues','flagQueueSummary','variables','syncQueueSummary','bind','queuesummarycomplete','queuecallerjoin','syncQueueCallerJoin','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','fullybooted','musiconholdstart','syncMusicOnHoldStart','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueShow','isUndefined','isEmpty','hasOwnProperty','originated','pTalking','unlockRR','channels','switch','sequence','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','queueReports','[voiceQueueReport][checkVariables]','syncFullyBooted','campaigns','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','waiting','Trunk','active','Interval','stringify','voice_queue:save','isNotNull','clearZombieChannels','queues','[queues]','loopQueueSummary','queuesummary','then','[queuesummary]','queue','countBy','callers','toNumber','loggedin','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','syncQueueSummaryComplete','syncNewExten','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','pick','keys','[syncQueueCallerJoin][VoiceQueueReport]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandon','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[syncQueueCallerAbandon][VoiceQueueReport]','queuecallerleaveAt','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','assigned','queuecallerexit','reason','transfer','COMPLETED','startsWith','local/','linkedid','queuecallerexitAt','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','variable','value','queuestatus','CONTINUE','queueposition','EXITWITHKEY','[syncVarSet][VoiceQueueReport]'];(function(_0x1a00b8,_0x5363fb){var _0x664a54=function(_0xaadc0c){while(--_0xaadc0c){_0x1a00b8['push'](_0x1a00b8['shift']());}};_0x664a54(++_0x5363fb);}(_0x6666,0x1a6));var _0x6666=function(_0x273f77,_0xe5b0cb){_0x273f77=_0x273f77-0x0;var _0x71e147=_0x6666[_0x273f77];return _0x71e147;};'use strict';var _=require(_0x6666('0x0'));var moment=require(_0x6666('0x1'));var BPromise=require('bluebird');var util=require('util');var md5=require(_0x6666('0x2'));var logger=require(_0x6666('0x3'))(_0x6666('0x4'));var ami=require(_0x6666('0x5'));var QueueReport=require('../model/queueReport');var io=require(_0x6666('0x6'))({'host':_0x6666('0x7'),'port':0x18eb});var Sequence=function(){};Sequence[_0x6666('0x8')][_0x6666('0x9')]=function(_0x4f6b6b){this[_0x6666('0xa')]=this[_0x6666('0xa')]?this[_0x6666('0xa')]['finally'](_0x4f6b6b):_0x4f6b6b();};function VoiceQueueReport(_0x34fca2){this['sequence']=new Sequence();this['queueReports']={};this[_0x6666('0xb')]=_0x34fca2['agents'];this['channels']=_0x34fca2[_0x6666('0xc')];this[_0x6666('0xd')]=_0x34fca2[_0x6666('0xd')];this[_0x6666('0xe')]=!![];this['campaigns']=_0x34fca2['campaigns'];this[_0x6666('0xf')]={};ami['on']('queuesummary',this[_0x6666('0x10')][_0x6666('0x11')](this));ami['on'](_0x6666('0x12'),this['syncQueueSummaryComplete'][_0x6666('0x11')](this));ami['on'](_0x6666('0x13'),this[_0x6666('0x14')][_0x6666('0x11')](this));ami['on']('queuecallerabandon',this[_0x6666('0x15')][_0x6666('0x11')](this));ami['on'](_0x6666('0x16'),this[_0x6666('0x17')][_0x6666('0x11')](this));ami['on'](_0x6666('0x18'),this[_0x6666('0x19')]['bind'](this));ami['on'](_0x6666('0x1a'),this[_0x6666('0x1b')]['bind'](this));ami['on'](_0x6666('0x1c'),this[_0x6666('0x1d')]['bind'](this));ami['on'](_0x6666('0x1e'),this['syncFullyBooted'][_0x6666('0x11')](this));ami['on'](_0x6666('0x1f'),this[_0x6666('0x20')][_0x6666('0x11')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x6666('0x11')](this));ami['on']('attendedtransfer',this[_0x6666('0x21')][_0x6666('0x11')](this));ami['on'](_0x6666('0x22'),this[_0x6666('0x23')][_0x6666('0x11')](this));this['loopQueueSummary']();this[_0x6666('0x24')]();}function isNotNull(_0x1e21d9){return _0x1e21d9!==null&&!_[_0x6666('0x25')](_0x1e21d9);}function clearChannels(_0x3cba15){if(!_[_0x6666('0x26')](_0x3cba15)){for(var _0x2ada06 in _0x3cba15){if(_0x3cba15['hasOwnProperty'](_0x2ada06)){delete _0x3cba15[_0x2ada06];}}}}function clearCampaigns(_0x156419){if(!_[_0x6666('0x26')](_0x156419)){for(var _0x42bbc3 in _0x156419){if(_0x156419[_0x6666('0x27')](_0x42bbc3)){_0x156419[_0x42bbc3][_0x6666('0x28')]=0x0;}}}}function clearVoiceQueues(_0x493d56){if(!_[_0x6666('0x26')](_0x493d56)){for(var _0x45f665 in _0x493d56){if(_0x493d56[_0x6666('0x27')](_0x45f665)){_0x493d56[_0x45f665]['originated']=0x0;_0x493d56[_0x45f665]['talking']=0x0;_0x493d56[_0x45f665][_0x6666('0x29')]=0x0;_0x493d56[_0x45f665]['waiting']=0x0;_0x493d56[_0x45f665]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x283eae){if(!_['isEmpty'](_0x283eae)){for(var _0x3411b6 in _0x283eae){if(_0x283eae[_0x6666('0x27')](_0x3411b6)){_0x283eae[_0x3411b6][_0x6666('0x2a')]=!![];}}}}VoiceQueueReport[_0x6666('0x8')]['clearZombieChannels']=function(){var _0x2b0d63=this;for(var _0x5115d0 in this[_0x6666('0x2b')]){if(this[_0x6666('0x2b')]['hasOwnProperty'](_0x5115d0)&&!this[_0x6666('0x2b')][_0x5115d0][_0x6666('0x2c')]){this[_0x6666('0x2d')][_0x6666('0x9')](function(){if(!_[_0x6666('0x2e')](_0x2b0d63[_0x6666('0x2b')][_0x5115d0])){return ami[_0x6666('0x2f')]({'action':_0x6666('0x30'),'channel':_0x2b0d63[_0x6666('0x2b')][_0x5115d0][_0x6666('0x31')]})[_0x6666('0x32')](function(_0x1b28bd){if(_0x1b28bd[_0x6666('0x33')]===_0x6666('0x34')){setTimeout(function(){if(_0x2b0d63['channels'][_0x5115d0]){delete _0x2b0d63[_0x6666('0x2b')][_0x5115d0];logger[_0x6666('0x35')](_0x6666('0x36'),_0x5115d0);}if(_0x2b0d63[_0x6666('0x37')][_0x5115d0]){delete _0x2b0d63[_0x6666('0x37')][_0x5115d0];logger[_0x6666('0x35')]('[voiceQueueReport][checkQueueReport]',_0x5115d0);}if(_0x2b0d63[_0x6666('0xf')][_0x5115d0]){delete _0x2b0d63['variables'][_0x5115d0];logger[_0x6666('0x35')](_0x6666('0x38'),_0x5115d0);}},0x1f40);}});}});}}};VoiceQueueReport[_0x6666('0x8')][_0x6666('0x39')]=function(){logger[_0x6666('0x35')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x6666('0x2b')]);this['clearQueueReport'](this['queueReports']);clearAgentBooked(this[_0x6666('0xb')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x6666('0x3a')]);};VoiceQueueReport[_0x6666('0x8')][_0x6666('0x3b')]=function(_0x225546){var _0x3f2e25=this;if(!_[_0x6666('0x26')](_0x225546)){for(var _0x43d713 in _0x225546){if(_0x225546[_0x6666('0x27')](_0x43d713)){_0x3f2e25[_0x6666('0x3c')](_0x225546[_0x43d713]);delete _0x225546[_0x43d713];}}}};function loggerCatch(_0x1e3fcb){return function(_0x40e139){logger[_0x6666('0x35')](_0x1e3fcb,util[_0x6666('0x3d')](_0x40e139,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0x6666('0x8')][_0x6666('0x3e')]=function(_0x4bfa7b,_0x4549d1,_0x2bf88f){io['to'](_0x4bfa7b)[_0x6666('0x3e')](_0x4549d1,_0x2bf88f);};VoiceQueueReport['prototype'][_0x6666('0x3f')]=function(_0x4b64ba){this[_0x6666('0x3e')](util[_0x6666('0x40')](_0x6666('0x41'),_0x4b64ba[_0x6666('0x42')]),_0x6666('0x43'),_0x4b64ba);};VoiceQueueReport[_0x6666('0x8')][_0x6666('0x3c')]=function(_0x407c73){this[_0x6666('0x3e')](util[_0x6666('0x40')](_0x6666('0x41'),_0x407c73[_0x6666('0x42')]),_0x6666('0x44'),_0x407c73);};VoiceQueueReport[_0x6666('0x8')][_0x6666('0x45')]=function(_0x3f4b68){if(_0x3f4b68[_0x6666('0x46')]===_0x6666('0x47')){var _0x33ce66={'id':_0x3f4b68['id'],'name':_0x3f4b68[_0x6666('0x42')],'strategy':_0x3f4b68[_0x6666('0x48')],'answered':_0x3f4b68[_0x6666('0x49')],'available':_0x3f4b68[_0x6666('0x4a')],'loggedIn':_0x3f4b68[_0x6666('0x4b')],'pTalking':_0x3f4b68[_0x6666('0x29')],'sumBillable':_0x3f4b68[_0x6666('0x4c')],'sumDuration':_0x3f4b68[_0x6666('0x4d')],'sumHoldTime':_0x3f4b68[_0x6666('0x4e')]||0x0,'talking':_0x3f4b68[_0x6666('0x4f')],'total':_0x3f4b68['total'],'type':_0x3f4b68['type'],'unmanaged':_0x3f4b68[_0x6666('0x50')],'waiting':_0x3f4b68[_0x6666('0x51')]};if(_0x3f4b68['Trunk']){_0x33ce66[_0x6666('0x52')]={'id':_0x3f4b68['Trunk']['id'],'name':_0x3f4b68['Trunk'][_0x6666('0x42')],'active':_0x3f4b68['Trunk'][_0x6666('0x53')],'callerid':_0x3f4b68[_0x6666('0x52')]['callerid']};}if(_0x3f4b68[_0x6666('0x54')]){_0x33ce66[_0x6666('0x54')]={'id':_0x3f4b68['Interval']['id'],'name':_0x3f4b68[_0x6666('0x54')][_0x6666('0x42')]};}var _0x4d5b6f=md5(JSON[_0x6666('0x55')](_0x33ce66));if(_0x3f4b68[_0x6666('0x2')]!==_0x4d5b6f){_0x3f4b68[_0x6666('0x2')]=_0x4d5b6f;this[_0x6666('0x3e')](util[_0x6666('0x40')]('voice:queue:%s',_0x33ce66[_0x6666('0x42')]),_0x6666('0x56'),_0x33ce66);}}};VoiceQueueReport[_0x6666('0x8')][_0x6666('0x57')]=function(_0x64ffbe){return _0x64ffbe!==null&&!_['isUndefined'](_0x64ffbe);};VoiceQueueReport[_0x6666('0x8')][_0x6666('0x24')]=function(){var _0x18b85e=this;setInterval(function(){_0x18b85e[_0x6666('0x58')]();ami['Action']({'action':_0x6666('0x59')})['catch'](loggerCatch(_0x6666('0x5a')));},0x2710);};VoiceQueueReport['prototype'][_0x6666('0x5b')]=function(){var _0x566f32=this;setInterval(function(){if(_0x566f32['flagQueueSummary']){return ami['Action']({'action':_0x6666('0x5c')})[_0x6666('0x5d')](function(_0x132fcc){_0x566f32['flagQueueSummary']=![];})[_0x6666('0x32')](loggerCatch(_0x6666('0x5e')));}},0x3e8);};VoiceQueueReport[_0x6666('0x8')]['syncQueueSummary']=function(_0x4de9ce){try{if(this[_0x6666('0x57')](_0x4de9ce)&&this[_0x6666('0x57')](_0x4de9ce[_0x6666('0x5f')])){if(this['voiceQueues'][_0x4de9ce[_0x6666('0x5f')]]){var _0x445484=_[_0x6666('0x60')](this[_0x6666('0x2b')],'queue')[_0x4de9ce[_0x6666('0x5f')]]||0x0;var _0x58bace=_0x445484-_0x4de9ce[_0x6666('0x61')];if(this[_0x6666('0xd')][_0x4de9ce[_0x6666('0x5f')]][_0x6666('0x51')]!==_[_0x6666('0x62')](_0x4de9ce[_0x6666('0x61')])||this[_0x6666('0xd')][_0x4de9ce[_0x6666('0x5f')]]['loggedIn']!==_['toNumber'](_0x4de9ce[_0x6666('0x63')])||this[_0x6666('0xd')][_0x4de9ce[_0x6666('0x5f')]][_0x6666('0x4a')]!==_[_0x6666('0x62')](_0x4de9ce[_0x6666('0x4a')])||this['voiceQueues'][_0x4de9ce[_0x6666('0x5f')]]['talking']!==_0x58bace){this[_0x6666('0xd')][_0x4de9ce['queue']][_0x6666('0x51')]=_[_0x6666('0x62')](_0x4de9ce[_0x6666('0x61')]);this['voiceQueues'][_0x4de9ce[_0x6666('0x5f')]][_0x6666('0x4b')]=_[_0x6666('0x62')](_0x4de9ce[_0x6666('0x63')]);this['voiceQueues'][_0x4de9ce[_0x6666('0x5f')]][_0x6666('0x4a')]=_[_0x6666('0x62')](_0x4de9ce[_0x6666('0x4a')]);this[_0x6666('0xd')][_0x4de9ce[_0x6666('0x5f')]]['talking']=_0x58bace>0x0?_0x58bace:0x0;this[_0x6666('0xd')][_0x4de9ce['queue']][_0x6666('0x4f')]=this[_0x6666('0xd')][_0x4de9ce[_0x6666('0x5f')]][_0x6666('0x4f')]>_[_0x6666('0x62')](_0x4de9ce['loggedin'])?_[_0x6666('0x62')](_0x4de9ce[_0x6666('0x63')]):this[_0x6666('0xd')][_0x4de9ce[_0x6666('0x5f')]][_0x6666('0x4f')];this[_0x6666('0x45')](this[_0x6666('0xd')][_0x4de9ce[_0x6666('0x5f')]]);}ami[_0x6666('0x3e')](_0x6666('0x64'),this[_0x6666('0xd')][_0x4de9ce[_0x6666('0x5f')]]);}}}catch(_0xf53fb2){logger[_0x6666('0x35')](_0x6666('0x65'),util[_0x6666('0x3d')](_0xf53fb2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6666('0x8')][_0x6666('0x66')]=function(_0x16872c){this[_0x6666('0xe')]=!![];};VoiceQueueReport[_0x6666('0x8')][_0x6666('0x67')]=function(_0x248770){};VoiceQueueReport[_0x6666('0x8')]['syncQueueCallerJoin']=function(_0x433cd9){try{if(this[_0x6666('0x57')](_0x433cd9)){if(_[_0x6666('0x25')](this['queueReports'][_0x433cd9[_0x6666('0x68')]])){this[_0x6666('0x37')][_0x433cd9[_0x6666('0x68')]]=[];this[_0x6666('0x2b')][_0x433cd9[_0x6666('0x68')]]={};}var _0x116418=new QueueReport();_0x116418['name']=_0x433cd9[_0x6666('0x5f')];_0x116418[_0x6666('0x46')]=this[_0x6666('0xd')][_0x116418[_0x6666('0x42')]]&&this[_0x6666('0xd')][_0x116418['name']][_0x6666('0x46')]?this[_0x6666('0xd')][_0x116418[_0x6666('0x42')]][_0x6666('0x46')]||_0x6666('0x47'):'inbound';_0x116418[_0x6666('0x5f')]=_0x433cd9[_0x6666('0x5f')];_0x116418[_0x6666('0x69')]=moment()['format'](_0x6666('0x6a'));_0x116418[_0x6666('0x6b')]=_0x433cd9[_0x6666('0x6b')];_0x116418[_0x6666('0x6c')]=_0x433cd9[_0x6666('0x6c')];_[_0x6666('0x6d')](_0x116418,_[_0x6666('0x6e')](_0x433cd9,_[_0x6666('0x6f')](_0x116418)));this['queueReports'][_0x433cd9['uniqueid']]['push'](_0x116418);this[_0x6666('0x2b')][_0x433cd9[_0x6666('0x68')]]=_0x116418;this['emitVoiceQueueChannelSave'](_0x116418);}}catch(_0x508096){logger[_0x6666('0x35')](_0x6666('0x70'),util[_0x6666('0x3d')](_0x508096,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6666('0x8')][_0x6666('0x15')]=function(_0x441943){try{if(this['isNotNull'](_0x441943)){if(this[_0x6666('0x37')][_0x441943[_0x6666('0x68')]]){var _0x5e4813=_[_0x6666('0x71')](this[_0x6666('0x37')][_0x441943['uniqueid']]);_0x5e4813[_0x6666('0x72')]=![];_0x5e4813[_0x6666('0x73')]=null;_0x5e4813[_0x6666('0x74')]=_0x441943['holdtime'];_0x5e4813[_0x6666('0x75')]=_0x441943['originalposition'];_0x5e4813[_0x6666('0x76')]=!![];_0x5e4813[_0x6666('0x77')]=moment()[_0x6666('0x40')](_0x6666('0x6a'));_0x5e4813[_0x6666('0x78')]=_0x6666('0x79');_0x5e4813[_0x6666('0x7a')]=null;this[_0x6666('0x2b')][_0x441943[_0x6666('0x68')]]=_0x5e4813;this[_0x6666('0x3c')](_0x5e4813);}}}catch(_0x148cc1){logger['error'](_0x6666('0x7b'),util[_0x6666('0x3d')](_0x148cc1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6666('0x8')]['syncQueueCallerLeave']=function(_0x2f728a){try{if(this[_0x6666('0x57')](_0x2f728a)){if(this[_0x6666('0x37')][_0x2f728a[_0x6666('0x68')]]){var _0x38c766=_[_0x6666('0x71')](this[_0x6666('0x37')][_0x2f728a['uniqueid']]);_0x38c766[_0x6666('0x7c')]=moment()['format'](_0x6666('0x6a'));_0x38c766['connectedlinenum']=_0x2f728a[_0x6666('0x7d')];_0x38c766[_0x6666('0x7e')]=_0x2f728a[_0x6666('0x7e')];this[_0x6666('0x2b')][_0x2f728a[_0x6666('0x68')]]=_0x38c766;this[_0x6666('0x3f')](_0x38c766);}}}catch(_0x2785b1){logger[_0x6666('0x35')](_0x6666('0x7f'),util[_0x6666('0x3d')](_0x2785b1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6666('0x8')][_0x6666('0x19')]=function(_0x49d9b7){try{if(this[_0x6666('0x57')](_0x49d9b7)){if(this[_0x6666('0x37')][_0x49d9b7[_0x6666('0x68')]]){var _0x3d990d=_['last'](this['queueReports'][_0x49d9b7['uniqueid']]);_0x3d990d['queuecallerabandon']=![];_0x3d990d[_0x6666('0x77')]=null;_0x3d990d[_0x6666('0x80')]=!![];_0x3d990d[_0x6666('0x7a')]=_0x49d9b7['membername'];_0x3d990d[_0x6666('0x74')]=_0x49d9b7[_0x6666('0x74')];_0x3d990d[_0x6666('0x72')]=!![];_0x3d990d[_0x6666('0x81')]=![];_0x3d990d['queuecallerexitAt']=null;if(!_0x3d990d['transfer']){if(_0x49d9b7[_0x6666('0x82')]==_0x6666('0x83')){_0x3d990d[_0x6666('0x78')]=_0x6666('0x84');}else{if(_[_0x6666('0x85')](_0x49d9b7[_0x6666('0x31')]['toLowerCase'](),_0x6666('0x86'))){if(this[_0x6666('0x37')][_0x49d9b7[_0x6666('0x87')]]){var _0x56abe4=_['last'](this[_0x6666('0x37')][_0x49d9b7[_0x6666('0x87')]]);_0x56abe4[_0x6666('0x72')]=![];_0x56abe4[_0x6666('0x81')]=!![];_0x56abe4[_0x6666('0x88')]=moment(_0x3d990d['queuecallerjoinAt'])[_0x6666('0x89')](_0x49d9b7[_0x6666('0x74')],_0x6666('0x8a'))[_0x6666('0x40')](_0x6666('0x6a'));_0x56abe4['queuecallerexitreason']=_0x6666('0x8b');_0x56abe4[_0x6666('0x83')]=!![];_0x56abe4[_0x6666('0x8c')]=_0x6666('0x8d');_0x56abe4[_0x6666('0x8e')]=_0x49d9b7[_0x6666('0x8f')];_0x56abe4[_0x6666('0x90')]=_0x49d9b7[_0x6666('0x68')];var _0x3a8e9c=this[_0x6666('0x37')][_0x49d9b7['linkedid']];this[_0x6666('0x37')][_0x49d9b7[_0x6666('0x87')]]=this[_0x6666('0x37')][_0x49d9b7[_0x6666('0x68')]];this[_0x6666('0x37')][_0x49d9b7[_0x6666('0x68')]]=_0x3a8e9c;}}else{_0x3d990d[_0x6666('0x78')]=_0x6666('0x91')+_0x49d9b7[_0x6666('0x82')][_0x6666('0x92')]();}}}this[_0x6666('0x2b')][_0x49d9b7['uniqueid']]=_0x3d990d;this[_0x6666('0x3c')](_0x3d990d);}}}catch(_0x22f2e1){logger[_0x6666('0x35')]('[syncAgentComplete][VoiceQueueReport]',util[_0x6666('0x3d')](_0x22f2e1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6666('0x8')][_0x6666('0x1b')]=function(_0x4c4715){try{if(this[_0x6666('0x57')](_0x4c4715)){this['addVariable'](_0x4c4715['uniqueid'],_[_0x6666('0x6f')](_0x4c4715[_0x6666('0x93')])[0x0],_0x4c4715[_0x6666('0x94')]);if(this[_0x6666('0x37')][_0x4c4715[_0x6666('0x68')]]){var _0x499134=_[_0x6666('0x71')](this[_0x6666('0x37')][_0x4c4715[_0x6666('0x68')]]);if(_0x499134){if(this['isNotNull'](_0x4c4715[_0x6666('0x93')])&&this[_0x6666('0x57')](_0x4c4715[_0x6666('0x93')][_0x6666('0x95')])){switch(_0x4c4715['value']){case _0x6666('0x96'):_0x499134[_0x6666('0x81')]=![];_0x499134['queuecallerexitAt']=null;break;default:_0x499134['queuecallerexit']=!![];_0x499134[_0x6666('0x88')]=moment()[_0x6666('0x40')](_0x6666('0x6a'));_0x499134['queuecallerleaveAt']=moment()[_0x6666('0x40')](_0x6666('0x6a'));}_0x499134[_0x6666('0x76')]=![];_0x499134[_0x6666('0x77')]=null;_0x499134[_0x6666('0x78')]=_0x4c4715[_0x6666('0x94')];this[_0x6666('0x2b')][_0x4c4715['uniqueid']]=_0x499134;this[_0x6666('0x3c')](_0x499134);}else if(this[_0x6666('0x57')](_0x4c4715['variable'])&&this[_0x6666('0x57')](_0x4c4715[_0x6666('0x93')][_0x6666('0x97')])){if(!_0x499134['queuecallerabandon']){_0x499134[_0x6666('0x81')]=!![];_0x499134[_0x6666('0x88')]=moment()[_0x6666('0x40')]('YYYY-MM-DD\x20HH:mm:ss');_0x499134[_0x6666('0x78')]=_0x6666('0x98');_0x499134[_0x6666('0x7c')]=moment()[_0x6666('0x40')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6666('0x2b')][_0x4c4715[_0x6666('0x68')]]=_0x499134;}}_0x499134['variables']=this['variables'][_0x4c4715[_0x6666('0x68')]];}}}}catch(_0x12f3ee){logger[_0x6666('0x35')](_0x6666('0x99'),util[_0x6666('0x3d')](_0x12f3ee,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6666('0x8')]['addVariable']=function(_0xdfb8c0,_0x449f0b,_0x456582){var _0x42848f=['rtpaudioqos',_0x6666('0x9a'),_0x6666('0x9b'),_0x6666('0x9c'),'rtpaudioqosloss',_0x6666('0x9d'),'rtpaudioqosrtt',_0x6666('0x9e'),_0x6666('0x9f'),'sipuri','bridgepeer',_0x6666('0xa0'),'membercalls',_0x6666('0xa1'),'memberinterface',_0x6666('0xa2'),_0x6666('0xa3'),_0x6666('0xa4'),_0x6666('0xa5')];if(!_[_0x6666('0x2e')](_0x449f0b)&&!_[_0x6666('0xa6')](_0x42848f,_0x449f0b)){if(_[_0x6666('0x25')](this[_0x6666('0xf')][_0xdfb8c0])){this[_0x6666('0xf')][_0xdfb8c0]={};}this[_0x6666('0xf')][_0xdfb8c0][_0x449f0b]=_0x456582;}};VoiceQueueReport[_0x6666('0x8')][_0x6666('0x1d')]=function(_0x599a02){try{if(this[_0x6666('0x57')](_0x599a02)){if(this['queueReports'][_0x599a02[_0x6666('0x68')]]){for(var _0x488cb2=0x0,_0x3d4d4f={};_0x488cb2<this[_0x6666('0x37')][_0x599a02['uniqueid']][_0x6666('0xa7')];_0x488cb2+=0x1){_0x3d4d4f=this[_0x6666('0x37')][_0x599a02[_0x6666('0x68')]][_0x488cb2];if(this[_0x6666('0xd')][_0x3d4d4f['queue']]){if(_0x3d4d4f['queuecallerexit']){this[_0x6666('0xd')][_0x3d4d4f[_0x6666('0x5f')]][_0x6666('0x50')]+=0x1;}this[_0x6666('0xd')][_0x3d4d4f[_0x6666('0x5f')]]['sumHoldTime']+=moment(_0x3d4d4f[_0x6666('0x7c')])[_0x6666('0xa8')](_0x3d4d4f[_0x6666('0x69')],'seconds')||0x0;if(_0x488cb2===this[_0x6666('0x37')][_0x599a02[_0x6666('0x68')]][_0x6666('0xa7')]-0x1){this['voiceQueues'][_0x3d4d4f[_0x6666('0x5f')]][_0x6666('0x4d')]+=moment()['milliseconds'](0x0)[_0x6666('0xa8')](_0x3d4d4f[_0x6666('0x69')],'seconds');this[_0x6666('0xd')][_0x3d4d4f[_0x6666('0x5f')]]['total']+=0x1;if(_0x3d4d4f['queuecallercomplete']){this[_0x6666('0xd')][_0x3d4d4f['queue']][_0x6666('0x49')]+=0x1;this[_0x6666('0xd')][_0x3d4d4f[_0x6666('0x5f')]]['sumBillable']+=moment()[_0x6666('0xa9')](0x0)[_0x6666('0xa8')](_0x3d4d4f[_0x6666('0x7c')],'seconds');_0x3d4d4f['queuecallercompleteAt']=moment()[_0x6666('0x40')](_0x6666('0x6a'));}if(_0x3d4d4f['queuecallerabandon']){_0x3d4d4f[_0x6666('0xaa')]=_0x6666('0xab');ami['emit'](_0x6666('0xac'),_0x3d4d4f);}if(_0x3d4d4f['queuecallerexit']){_0x3d4d4f[_0x6666('0xaa')]=_0x6666('0x50');ami['emit'](_0x6666('0xad'),_0x3d4d4f);}}else{this[_0x6666('0xd')][_0x3d4d4f[_0x6666('0x5f')]]['sumDuration']+=this[_0x6666('0xd')][_0x3d4d4f[_0x6666('0x5f')]][_0x6666('0x4e')];}this[_0x6666('0x2b')][_0x599a02['uniqueid']]=_0x3d4d4f;this[_0x6666('0x3c')](_0x3d4d4f);}}ami[_0x6666('0x3e')](_0x6666('0xae'),this[_0x6666('0x37')][_0x599a02[_0x6666('0x68')]]);delete this['queueReports'][_0x599a02['uniqueid']];delete this[_0x6666('0x2b')][_0x599a02[_0x6666('0x68')]];}if(this[_0x6666('0xf')][_0x599a02[_0x6666('0x68')]]){delete this[_0x6666('0xf')][_0x599a02[_0x6666('0x68')]];}}}catch(_0x3dbf90){logger['error']('[syncHangup][VoiceQueueReport]',util[_0x6666('0x3d')](_0x3dbf90,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6666('0x8')]['syncAttendedTransfer']=function(_0x32bf4f){try{if(this[_0x6666('0x57')](_0x32bf4f)){var _0x5b8f2c;if(this['queueReports'][_0x32bf4f[_0x6666('0xaf')]]){_0x5b8f2c=_[_0x6666('0x71')](this['queueReports'][_0x32bf4f['transfereeuniqueid']]);_0x5b8f2c['transferexten']=_0x32bf4f[_0x6666('0xb0')];_0x5b8f2c[_0x6666('0x90')]=_0x32bf4f[_0x6666('0xb1')];_0x5b8f2c[_0x6666('0x78')]='ATTENDEDTRANSFER';_0x5b8f2c[_0x6666('0x83')]=!![];_0x5b8f2c[_0x6666('0x8c')]=_0x6666('0xb2');if(this['queueReports'][_0x32bf4f[_0x6666('0xb1')]]){var _0x122a86=this[_0x6666('0x37')][_0x32bf4f[_0x6666('0xb1')]];this['queueReports'][_0x32bf4f[_0x6666('0xb1')]]=this[_0x6666('0x37')][_0x32bf4f['transfereeuniqueid']];this[_0x6666('0x37')][_0x32bf4f['transfereeuniqueid']]=_0x122a86;var _0x66b77f=_[_0x6666('0x71')](this['queueReports'][_0x32bf4f[_0x6666('0xaf')]]);_0x66b77f[_0x6666('0x2c')]=!![];}}else if(this['queueReports'][_0x32bf4f[_0x6666('0xb3')]]){_0x5b8f2c=_[_0x6666('0x71')](this[_0x6666('0x37')][_0x32bf4f[_0x6666('0xb3')]]);_0x5b8f2c['transferexten']=_0x32bf4f['origtransfererexten'];_0x5b8f2c[_0x6666('0x90')]=_0x32bf4f[_0x6666('0xb4')];_0x5b8f2c[_0x6666('0x78')]=_0x6666('0xb5');_0x5b8f2c[_0x6666('0x83')]=!![];_0x5b8f2c[_0x6666('0x8c')]=_0x6666('0xb2');if(this[_0x6666('0x37')][_0x32bf4f[_0x6666('0xb4')]]){var _0x122a86=this[_0x6666('0x37')][_0x32bf4f[_0x6666('0xb4')]];this[_0x6666('0x37')][_0x32bf4f[_0x6666('0xb4')]]=this['queueReports'][_0x32bf4f['transfertargetuniqueid']];this['queueReports'][_0x32bf4f[_0x6666('0xb3')]]=_0x122a86;var _0x66b77f=_[_0x6666('0x71')](this[_0x6666('0x37')][_0x32bf4f['transfertargetuniqueid']]);_0x66b77f['switch']=!![];}}}}catch(_0x42f5cf){logger[_0x6666('0x35')](_0x6666('0xb6'),util['inspect'](_0x42f5cf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6666('0x8')][_0x6666('0x23')]=function(_0x227880){try{if(this['isNotNull'](_0x227880)){if(this['queueReports'][_0x227880['transfereeuniqueid']]){var _0x59f0a8=_[_0x6666('0x71')](this[_0x6666('0x37')][_0x227880['transfereeuniqueid']]);_0x59f0a8[_0x6666('0x78')]='BLINDTRANSFER';_0x59f0a8['transfer']=!![];_0x59f0a8[_0x6666('0x8c')]=_0x6666('0xb7');_0x59f0a8[_0x6666('0x8e')]=_0x227880[_0x6666('0xb8')];_0x59f0a8[_0x6666('0x90')]=_0x227880[_0x6666('0xaf')];}}}catch(_0x2b5633){logger[_0x6666('0x35')](_0x6666('0xb9'),util[_0x6666('0x3d')](_0x2b5633,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6666('0x8')][_0x6666('0x20')]=function(_0x47e4fe){try{if(this[_0x6666('0x57')](_0x47e4fe)){if(this['queueReports'][_0x47e4fe[_0x6666('0x68')]]){var _0x39df33=_[_0x6666('0x71')](this[_0x6666('0x37')][_0x47e4fe[_0x6666('0x68')]]);if(!_[_0x6666('0x2e')](_0x39df33[_0x6666('0x7c')])){_0x39df33[_0x6666('0xba')]=moment()[_0x6666('0x40')](_0x6666('0x6a'));}}}}catch(_0xb75ac2){logger['error'](_0x6666('0xbb'),util[_0x6666('0x3d')](_0xb75ac2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6666('0x8')][_0x6666('0xbc')]=function(_0x3028b1){try{if(this[_0x6666('0x57')](_0x3028b1)){if(this[_0x6666('0x37')][_0x3028b1[_0x6666('0x68')]]){var _0x4143ec=_[_0x6666('0x71')](this[_0x6666('0x37')][_0x3028b1[_0x6666('0x68')]]);if(!_[_0x6666('0x2e')](_0x4143ec[_0x6666('0xba')])){_0x4143ec[_0x6666('0xbd')]+=moment()[_0x6666('0xa9')](0x0)['diff'](_0x4143ec[_0x6666('0xba')],_0x6666('0x8a'));delete _0x4143ec[_0x6666('0xba')];}}}}catch(_0xa6528c){logger['error'](_0x6666('0xbe'),util['inspect'](_0xa6528c,{'showHidden':![],'depth':null}));}};module[_0x6666('0xbf')]=VoiceQueueReport;
\ No newline at end of file
+var _0xe531=['error','[voiceQueueReport][checkQueueReport]','[voiceQueueReport][checkVariables]','syncFullyBooted','clearQueueReport','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','loggedIn','sumDuration','sumHoldTime','total','unmanaged','Trunk','active','callerid','Interval','voice_queue:save','isNotNull','queues','flagQueueSummary','then','[queuesummary]','queue','callers','toNumber','loggedin','custom:queuesummary','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','count','merge','pick','keys','push','[syncQueueCallerJoin][VoiceQueueReport]','queuecallercomplete','queuecallercompleteAt','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','emitVoiceQueueChannelRemove','[syncQueueCallerAbandon][VoiceQueueReport]','last','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','assigned','membername','holdtime','queuecallerexit','queuecallerexitAt','transfer','reason','startsWith','toLowerCase','local/','linkedid','queuecallerjoinAt','add','seconds','transfertype','FORWARD','transferexten','transferuniqueid','COMPLETEDBY','[syncAgentComplete][VoiceQueueReport]','variable','CONTINUE','queuecallerleaveAt','queueposition','addVariable','rtpaudioqos','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberinterface','memberpenalty','memberrealtime','length','diff','milliseconds','sumBillable','lastevent','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','syncAttendedTransfer','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','transfertargetuniqueid','origtransfererexten','ATTENDEDTRANSFER','origtransfereruniqueid','switch','[syncAttendedTransfer][VoiceQueueReport]','syncBlindTransfer','BLINDTRANSFER','BLIND','[syncBlindTransfer][VoiceQueueReport]','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','lodash','moment','bluebird','util','md5','../../../config/logger','ami','../ami','../model/queueReport','socket.io-emitter','localhost','enqueue','tail','finally','sequence','queueReports','agents','voiceQueues','campaigns','variables','queuesummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','fullybooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','loopQueueSummary','loopQueueShow','isUndefined','isEmpty','originated','hasOwnProperty','talking','pTalking','waiting','unlockRR','prototype','clearZombieChannels','channels','isNil','Action','channel','catch','No\x20such\x20channel','[voiceQueueReport][checkChannel]'];(function(_0x2e19ab,_0x4d527f){var _0x510981=function(_0x808e9){while(--_0x808e9){_0x2e19ab['push'](_0x2e19ab['shift']());}};_0x510981(++_0x4d527f);}(_0xe531,0x1e8));var _0x1e53=function(_0x48f9d2,_0x33ba0d){_0x48f9d2=_0x48f9d2-0x0;var _0x5228da=_0xe531[_0x48f9d2];return _0x5228da;};'use strict';var _=require(_0x1e53('0x0'));var moment=require(_0x1e53('0x1'));var BPromise=require(_0x1e53('0x2'));var util=require(_0x1e53('0x3'));var md5=require(_0x1e53('0x4'));var logger=require(_0x1e53('0x5'))(_0x1e53('0x6'));var ami=require(_0x1e53('0x7'));var QueueReport=require(_0x1e53('0x8'));var io=require(_0x1e53('0x9'))({'host':_0x1e53('0xa'),'port':0x18eb});var Sequence=function(){};Sequence['prototype'][_0x1e53('0xb')]=function(_0x327add){this[_0x1e53('0xc')]=this[_0x1e53('0xc')]?this[_0x1e53('0xc')][_0x1e53('0xd')](_0x327add):_0x327add();};function VoiceQueueReport(_0x473e7b){this[_0x1e53('0xe')]=new Sequence();this[_0x1e53('0xf')]={};this[_0x1e53('0x10')]=_0x473e7b[_0x1e53('0x10')];this['channels']=_0x473e7b['queueChannels'];this[_0x1e53('0x11')]=_0x473e7b[_0x1e53('0x11')];this['flagQueueSummary']=!![];this[_0x1e53('0x12')]=_0x473e7b[_0x1e53('0x12')];this[_0x1e53('0x13')]={};ami['on'](_0x1e53('0x14'),this['syncQueueSummary'][_0x1e53('0x15')](this));ami['on'](_0x1e53('0x16'),this[_0x1e53('0x17')][_0x1e53('0x15')](this));ami['on'](_0x1e53('0x18'),this[_0x1e53('0x19')][_0x1e53('0x15')](this));ami['on'](_0x1e53('0x1a'),this['syncQueueCallerAbandon'][_0x1e53('0x15')](this));ami['on'](_0x1e53('0x1b'),this[_0x1e53('0x1c')][_0x1e53('0x15')](this));ami['on'](_0x1e53('0x1d'),this[_0x1e53('0x1e')][_0x1e53('0x15')](this));ami['on'](_0x1e53('0x1f'),this[_0x1e53('0x20')][_0x1e53('0x15')](this));ami['on'](_0x1e53('0x21'),this[_0x1e53('0x22')]['bind'](this));ami['on'](_0x1e53('0x23'),this['syncFullyBooted'][_0x1e53('0x15')](this));ami['on'](_0x1e53('0x24'),this[_0x1e53('0x25')][_0x1e53('0x15')](this));ami['on'](_0x1e53('0x26'),this[_0x1e53('0x27')]['bind'](this));ami['on'](_0x1e53('0x28'),this['syncAttendedTransfer'][_0x1e53('0x15')](this));ami['on'](_0x1e53('0x29'),this['syncBlindTransfer']['bind'](this));this[_0x1e53('0x2a')]();this[_0x1e53('0x2b')]();}function isNotNull(_0x3a04b1){return _0x3a04b1!==null&&!_[_0x1e53('0x2c')](_0x3a04b1);}function clearChannels(_0x52d574){if(!_[_0x1e53('0x2d')](_0x52d574)){for(var _0x37f044 in _0x52d574){if(_0x52d574['hasOwnProperty'](_0x37f044)){delete _0x52d574[_0x37f044];}}}}function clearCampaigns(_0x13d1bf){if(!_[_0x1e53('0x2d')](_0x13d1bf)){for(var _0x19e759 in _0x13d1bf){if(_0x13d1bf['hasOwnProperty'](_0x19e759)){_0x13d1bf[_0x19e759][_0x1e53('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x4983c9){if(!_[_0x1e53('0x2d')](_0x4983c9)){for(var _0x3d933d in _0x4983c9){if(_0x4983c9[_0x1e53('0x2f')](_0x3d933d)){_0x4983c9[_0x3d933d]['originated']=0x0;_0x4983c9[_0x3d933d][_0x1e53('0x30')]=0x0;_0x4983c9[_0x3d933d][_0x1e53('0x31')]=0x0;_0x4983c9[_0x3d933d][_0x1e53('0x32')]=0x0;_0x4983c9[_0x3d933d]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0xb80dd2){if(!_['isEmpty'](_0xb80dd2)){for(var _0x49c3a7 in _0xb80dd2){if(_0xb80dd2[_0x1e53('0x2f')](_0x49c3a7)){_0xb80dd2[_0x49c3a7][_0x1e53('0x33')]=!![];}}}}VoiceQueueReport[_0x1e53('0x34')][_0x1e53('0x35')]=function(){var _0x4cef68=this;for(var _0x4303d7 in this['channels']){if(this[_0x1e53('0x36')][_0x1e53('0x2f')](_0x4303d7)&&!this['channels'][_0x4303d7]['switch']){this[_0x1e53('0xe')][_0x1e53('0xb')](function(){if(!_[_0x1e53('0x37')](_0x4cef68['channels'][_0x4303d7])){return ami[_0x1e53('0x38')]({'action':'status','channel':_0x4cef68['channels'][_0x4303d7][_0x1e53('0x39')]})[_0x1e53('0x3a')](function(_0x4d0610){if(_0x4d0610['message']===_0x1e53('0x3b')){setTimeout(function(){if(_0x4cef68['channels'][_0x4303d7]){delete _0x4cef68[_0x1e53('0x36')][_0x4303d7];logger['error'](_0x1e53('0x3c'),_0x4303d7);}if(_0x4cef68['queueReports'][_0x4303d7]){delete _0x4cef68['queueReports'][_0x4303d7];logger[_0x1e53('0x3d')](_0x1e53('0x3e'),_0x4303d7);}if(_0x4cef68[_0x1e53('0x13')][_0x4303d7]){delete _0x4cef68[_0x1e53('0x13')][_0x4303d7];logger[_0x1e53('0x3d')](_0x1e53('0x3f'),_0x4303d7);}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0x1e53('0x40')]=function(){logger[_0x1e53('0x3d')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this['channels']);this['clearQueueReport'](this['queueReports']);clearAgentBooked(this[_0x1e53('0x10')]);clearVoiceQueues(this[_0x1e53('0x11')]);clearCampaigns(this[_0x1e53('0x12')]);};VoiceQueueReport[_0x1e53('0x34')][_0x1e53('0x41')]=function(_0x30f77f){var _0x4f141c=this;if(!_[_0x1e53('0x2d')](_0x30f77f)){for(var _0x4d27b4 in _0x30f77f){if(_0x30f77f[_0x1e53('0x2f')](_0x4d27b4)){_0x4f141c['emitVoiceQueueChannelRemove'](_0x30f77f[_0x4d27b4]);delete _0x30f77f[_0x4d27b4];}}}};function loggerCatch(_0x28ef88){return function(_0x2aa763){logger[_0x1e53('0x3d')](_0x28ef88,util['inspect'](_0x2aa763,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0x1e53('0x34')][_0x1e53('0x42')]=function(_0x32c4cf,_0x2331c4,_0x5e9c0f){io['to'](_0x32c4cf)['emit'](_0x2331c4,_0x5e9c0f);};VoiceQueueReport[_0x1e53('0x34')][_0x1e53('0x43')]=function(_0x4cda56){this[_0x1e53('0x42')](util[_0x1e53('0x44')](_0x1e53('0x45'),_0x4cda56[_0x1e53('0x46')]),_0x1e53('0x47'),_0x4cda56);};VoiceQueueReport['prototype']['emitVoiceQueueChannelRemove']=function(_0x282c16){this[_0x1e53('0x42')](util[_0x1e53('0x44')](_0x1e53('0x45'),_0x282c16[_0x1e53('0x46')]),_0x1e53('0x48'),_0x282c16);};VoiceQueueReport[_0x1e53('0x34')][_0x1e53('0x49')]=function(_0x3bc899){if(_0x3bc899[_0x1e53('0x4a')]===_0x1e53('0x4b')){var _0x3adaaa={'id':_0x3bc899['id'],'name':_0x3bc899[_0x1e53('0x46')],'strategy':_0x3bc899[_0x1e53('0x4c')],'answered':_0x3bc899[_0x1e53('0x4d')],'available':_0x3bc899[_0x1e53('0x4e')],'loggedIn':_0x3bc899[_0x1e53('0x4f')],'pTalking':_0x3bc899[_0x1e53('0x31')],'sumBillable':_0x3bc899['sumBillable'],'sumDuration':_0x3bc899[_0x1e53('0x50')],'sumHoldTime':_0x3bc899[_0x1e53('0x51')]||0x0,'talking':_0x3bc899[_0x1e53('0x30')],'total':_0x3bc899[_0x1e53('0x52')],'type':_0x3bc899[_0x1e53('0x4a')],'unmanaged':_0x3bc899[_0x1e53('0x53')],'waiting':_0x3bc899['waiting']};if(_0x3bc899[_0x1e53('0x54')]){_0x3adaaa['Trunk']={'id':_0x3bc899[_0x1e53('0x54')]['id'],'name':_0x3bc899[_0x1e53('0x54')][_0x1e53('0x46')],'active':_0x3bc899[_0x1e53('0x54')][_0x1e53('0x55')],'callerid':_0x3bc899[_0x1e53('0x54')][_0x1e53('0x56')]};}if(_0x3bc899['Interval']){_0x3adaaa[_0x1e53('0x57')]={'id':_0x3bc899[_0x1e53('0x57')]['id'],'name':_0x3bc899[_0x1e53('0x57')][_0x1e53('0x46')]};}var _0x162639=md5(JSON['stringify'](_0x3adaaa));if(_0x3bc899[_0x1e53('0x4')]!==_0x162639){_0x3bc899['md5']=_0x162639;this['emit'](util[_0x1e53('0x44')](_0x1e53('0x45'),_0x3adaaa[_0x1e53('0x46')]),_0x1e53('0x58'),_0x3adaaa);}}};VoiceQueueReport[_0x1e53('0x34')][_0x1e53('0x59')]=function(_0x56901b){return _0x56901b!==null&&!_[_0x1e53('0x2c')](_0x56901b);};VoiceQueueReport['prototype'][_0x1e53('0x2b')]=function(){var _0x19d525=this;setInterval(function(){_0x19d525[_0x1e53('0x35')]();ami['Action']({'action':_0x1e53('0x5a')})[_0x1e53('0x3a')](loggerCatch('[queues]'));},0x2710);};VoiceQueueReport['prototype'][_0x1e53('0x2a')]=function(){var _0x5d9a5b=this;setInterval(function(){if(_0x5d9a5b[_0x1e53('0x5b')]){return ami[_0x1e53('0x38')]({'action':_0x1e53('0x14')})[_0x1e53('0x5c')](function(_0x4e0704){_0x5d9a5b['flagQueueSummary']=![];})['catch'](loggerCatch(_0x1e53('0x5d')));}},0x3e8);};VoiceQueueReport[_0x1e53('0x34')]['syncQueueSummary']=function(_0x290b22){try{if(this[_0x1e53('0x59')](_0x290b22)&&this['isNotNull'](_0x290b22[_0x1e53('0x5e')])){if(this[_0x1e53('0x11')][_0x290b22[_0x1e53('0x5e')]]){var _0x5e92c0=_['countBy'](this[_0x1e53('0x36')],'queue')[_0x290b22[_0x1e53('0x5e')]]||0x0;var _0x402af8=_0x5e92c0-_0x290b22[_0x1e53('0x5f')];if(this[_0x1e53('0x11')][_0x290b22[_0x1e53('0x5e')]][_0x1e53('0x32')]!==_['toNumber'](_0x290b22[_0x1e53('0x5f')])||this['voiceQueues'][_0x290b22[_0x1e53('0x5e')]][_0x1e53('0x4f')]!==_[_0x1e53('0x60')](_0x290b22[_0x1e53('0x61')])||this[_0x1e53('0x11')][_0x290b22[_0x1e53('0x5e')]][_0x1e53('0x4e')]!==_[_0x1e53('0x60')](_0x290b22[_0x1e53('0x4e')])||this['voiceQueues'][_0x290b22['queue']]['talking']!==_0x402af8){this[_0x1e53('0x11')][_0x290b22[_0x1e53('0x5e')]][_0x1e53('0x32')]=_[_0x1e53('0x60')](_0x290b22[_0x1e53('0x5f')]);this[_0x1e53('0x11')][_0x290b22[_0x1e53('0x5e')]]['loggedIn']=_[_0x1e53('0x60')](_0x290b22[_0x1e53('0x61')]);this['voiceQueues'][_0x290b22['queue']][_0x1e53('0x4e')]=_[_0x1e53('0x60')](_0x290b22[_0x1e53('0x4e')]);this[_0x1e53('0x11')][_0x290b22['queue']][_0x1e53('0x30')]=_0x402af8>0x0?_0x402af8:0x0;this['voiceQueues'][_0x290b22[_0x1e53('0x5e')]][_0x1e53('0x30')]=this[_0x1e53('0x11')][_0x290b22['queue']]['talking']>_[_0x1e53('0x60')](_0x290b22[_0x1e53('0x61')])?_[_0x1e53('0x60')](_0x290b22[_0x1e53('0x61')]):this['voiceQueues'][_0x290b22[_0x1e53('0x5e')]][_0x1e53('0x30')];this[_0x1e53('0x49')](this[_0x1e53('0x11')][_0x290b22[_0x1e53('0x5e')]]);}ami[_0x1e53('0x42')](_0x1e53('0x62'),this[_0x1e53('0x11')][_0x290b22[_0x1e53('0x5e')]]);}}}catch(_0x39a204){logger['error']('[syncQueueSummary][VoiceQueueReport]',util[_0x1e53('0x63')](_0x39a204,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x1e53('0x17')]=function(_0x3797d7){this[_0x1e53('0x5b')]=!![];};VoiceQueueReport[_0x1e53('0x34')]['syncNewExten']=function(_0x5f2a56){};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x129ad9){try{if(this[_0x1e53('0x59')](_0x129ad9)){if(_[_0x1e53('0x2c')](this[_0x1e53('0xf')][_0x129ad9[_0x1e53('0x64')]])){this['queueReports'][_0x129ad9['uniqueid']]=[];this['channels'][_0x129ad9[_0x1e53('0x64')]]={};}var _0x2eb4c2=new QueueReport();_0x2eb4c2[_0x1e53('0x46')]=_0x129ad9[_0x1e53('0x5e')];_0x2eb4c2[_0x1e53('0x4a')]=this[_0x1e53('0x11')][_0x2eb4c2[_0x1e53('0x46')]]&&this[_0x1e53('0x11')][_0x2eb4c2['name']][_0x1e53('0x4a')]?this[_0x1e53('0x11')][_0x2eb4c2['name']]['type']||_0x1e53('0x4b'):'inbound';_0x2eb4c2[_0x1e53('0x5e')]=_0x129ad9[_0x1e53('0x5e')];_0x2eb4c2['queuecallerjoinAt']=moment()['format'](_0x1e53('0x65'));_0x2eb4c2['position']=_0x129ad9['position'];_0x2eb4c2[_0x1e53('0x66')]=_0x129ad9['count'];_[_0x1e53('0x67')](_0x2eb4c2,_[_0x1e53('0x68')](_0x129ad9,_[_0x1e53('0x69')](_0x2eb4c2)));this[_0x1e53('0xf')][_0x129ad9[_0x1e53('0x64')]][_0x1e53('0x6a')](_0x2eb4c2);this[_0x1e53('0x36')][_0x129ad9[_0x1e53('0x64')]]=_0x2eb4c2;this[_0x1e53('0x43')](_0x2eb4c2);}}catch(_0x40ac54){logger[_0x1e53('0x3d')](_0x1e53('0x6b'),util['inspect'](_0x40ac54,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1e53('0x34')]['syncQueueCallerAbandon']=function(_0x48f639){try{if(this[_0x1e53('0x59')](_0x48f639)){if(this[_0x1e53('0xf')][_0x48f639[_0x1e53('0x64')]]){var _0x5b149e=_['last'](this[_0x1e53('0xf')][_0x48f639[_0x1e53('0x64')]]);_0x5b149e[_0x1e53('0x6c')]=![];_0x5b149e[_0x1e53('0x6d')]=null;_0x5b149e['holdtime']=_0x48f639['holdtime'];_0x5b149e['originalposition']=_0x48f639[_0x1e53('0x6e')];_0x5b149e['queuecallerabandon']=!![];_0x5b149e[_0x1e53('0x6f')]=moment()[_0x1e53('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x5b149e[_0x1e53('0x70')]=_0x1e53('0x71');_0x5b149e[_0x1e53('0x72')]=null;this[_0x1e53('0x36')][_0x48f639['uniqueid']]=_0x5b149e;this[_0x1e53('0x73')](_0x5b149e);}}}catch(_0x4e2258){logger[_0x1e53('0x3d')](_0x1e53('0x74'),util[_0x1e53('0x63')](_0x4e2258,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1e53('0x34')]['syncQueueCallerLeave']=function(_0x532b64){try{if(this[_0x1e53('0x59')](_0x532b64)){if(this[_0x1e53('0xf')][_0x532b64['uniqueid']]){var _0x403b71=_[_0x1e53('0x75')](this[_0x1e53('0xf')][_0x532b64['uniqueid']]);_0x403b71['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x403b71[_0x1e53('0x76')]=_0x532b64[_0x1e53('0x76')];_0x403b71[_0x1e53('0x77')]=_0x532b64[_0x1e53('0x77')];this[_0x1e53('0x36')][_0x532b64[_0x1e53('0x64')]]=_0x403b71;this[_0x1e53('0x43')](_0x403b71);}}}catch(_0x1ea4fe){logger[_0x1e53('0x3d')](_0x1e53('0x78'),util[_0x1e53('0x63')](_0x1ea4fe,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x1e53('0x1e')]=function(_0x557aa0){try{if(this[_0x1e53('0x59')](_0x557aa0)){if(this['queueReports'][_0x557aa0[_0x1e53('0x64')]]){var _0x12172b=_[_0x1e53('0x75')](this[_0x1e53('0xf')][_0x557aa0['uniqueid']]);_0x12172b[_0x1e53('0x1a')]=![];_0x12172b[_0x1e53('0x6f')]=null;_0x12172b[_0x1e53('0x79')]=!![];_0x12172b[_0x1e53('0x72')]=_0x557aa0[_0x1e53('0x7a')];_0x12172b['holdtime']=_0x557aa0[_0x1e53('0x7b')];_0x12172b['queuecallercomplete']=!![];_0x12172b[_0x1e53('0x7c')]=![];_0x12172b[_0x1e53('0x7d')]=null;if(!_0x12172b[_0x1e53('0x7e')]){if(_0x557aa0[_0x1e53('0x7f')]=='transfer'){_0x12172b[_0x1e53('0x70')]='COMPLETED';}else{if(_[_0x1e53('0x80')](_0x557aa0[_0x1e53('0x39')][_0x1e53('0x81')](),_0x1e53('0x82'))){if(this[_0x1e53('0xf')][_0x557aa0[_0x1e53('0x83')]]){var _0x2a92dd=_[_0x1e53('0x75')](this['queueReports'][_0x557aa0[_0x1e53('0x83')]]);_0x2a92dd[_0x1e53('0x6c')]=![];_0x2a92dd[_0x1e53('0x7c')]=!![];_0x2a92dd['queuecallerexitAt']=moment(_0x12172b[_0x1e53('0x84')])[_0x1e53('0x85')](_0x557aa0[_0x1e53('0x7b')],_0x1e53('0x86'))[_0x1e53('0x44')](_0x1e53('0x65'));_0x2a92dd[_0x1e53('0x70')]='FORWARDTRANSFER';_0x2a92dd['transfer']=!![];_0x2a92dd[_0x1e53('0x87')]=_0x1e53('0x88');_0x2a92dd[_0x1e53('0x89')]=_0x557aa0['destexten'];_0x2a92dd[_0x1e53('0x8a')]=_0x557aa0['uniqueid'];var _0x20e553=this['queueReports'][_0x557aa0[_0x1e53('0x83')]];this[_0x1e53('0xf')][_0x557aa0[_0x1e53('0x83')]]=this['queueReports'][_0x557aa0[_0x1e53('0x64')]];this[_0x1e53('0xf')][_0x557aa0['uniqueid']]=_0x20e553;}}else{_0x12172b[_0x1e53('0x70')]=_0x1e53('0x8b')+_0x557aa0[_0x1e53('0x7f')]['toUpperCase']();}}}this[_0x1e53('0x36')][_0x557aa0[_0x1e53('0x64')]]=_0x12172b;this[_0x1e53('0x73')](_0x12172b);}}}catch(_0x24b5a3){logger[_0x1e53('0x3d')](_0x1e53('0x8c'),util[_0x1e53('0x63')](_0x24b5a3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1e53('0x34')][_0x1e53('0x20')]=function(_0x3a79f1){try{if(this[_0x1e53('0x59')](_0x3a79f1)){this['addVariable'](_0x3a79f1[_0x1e53('0x64')],_[_0x1e53('0x69')](_0x3a79f1[_0x1e53('0x8d')])[0x0],_0x3a79f1['value']);if(this[_0x1e53('0xf')][_0x3a79f1[_0x1e53('0x64')]]){var _0x46e79b=_[_0x1e53('0x75')](this[_0x1e53('0xf')][_0x3a79f1[_0x1e53('0x64')]]);if(_0x46e79b){if(this['isNotNull'](_0x3a79f1[_0x1e53('0x8d')])&&this[_0x1e53('0x59')](_0x3a79f1[_0x1e53('0x8d')]['queuestatus'])){switch(_0x3a79f1['value']){case _0x1e53('0x8e'):_0x46e79b[_0x1e53('0x7c')]=![];_0x46e79b[_0x1e53('0x7d')]=null;break;default:_0x46e79b['queuecallerexit']=!![];_0x46e79b['queuecallerexitAt']=moment()[_0x1e53('0x44')](_0x1e53('0x65'));_0x46e79b[_0x1e53('0x8f')]=moment()[_0x1e53('0x44')]('YYYY-MM-DD\x20HH:mm:ss');}_0x46e79b[_0x1e53('0x1a')]=![];_0x46e79b[_0x1e53('0x6f')]=null;_0x46e79b[_0x1e53('0x70')]=_0x3a79f1['value'];this[_0x1e53('0x36')][_0x3a79f1[_0x1e53('0x64')]]=_0x46e79b;this[_0x1e53('0x73')](_0x46e79b);}else if(this[_0x1e53('0x59')](_0x3a79f1['variable'])&&this[_0x1e53('0x59')](_0x3a79f1[_0x1e53('0x8d')][_0x1e53('0x90')])){if(!_0x46e79b[_0x1e53('0x1a')]){_0x46e79b[_0x1e53('0x7c')]=!![];_0x46e79b['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x46e79b['queuecallerexitreason']='EXITWITHKEY';_0x46e79b[_0x1e53('0x8f')]=moment()['format'](_0x1e53('0x65'));this['channels'][_0x3a79f1[_0x1e53('0x64')]]=_0x46e79b;}}_0x46e79b['variables']=this[_0x1e53('0x13')][_0x3a79f1[_0x1e53('0x64')]];}}}}catch(_0x28ba3d){logger[_0x1e53('0x3d')]('[syncVarSet][VoiceQueueReport]',util[_0x1e53('0x63')](_0x28ba3d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1e53('0x34')][_0x1e53('0x91')]=function(_0x41220e,_0x34437e,_0x3e7a64){var _0x3c8c8c=[_0x1e53('0x92'),'rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss',_0x1e53('0x93'),_0x1e53('0x94'),_0x1e53('0x95'),_0x1e53('0x96'),_0x1e53('0x97'),_0x1e53('0x98'),'bridgepvtcallid',_0x1e53('0x99'),'memberdynamic',_0x1e53('0x9a'),'memberlastcall',_0x1e53('0x7a'),_0x1e53('0x9b'),_0x1e53('0x9c')];if(!_[_0x1e53('0x37')](_0x34437e)&&!_['includes'](_0x3c8c8c,_0x34437e)){if(_[_0x1e53('0x2c')](this[_0x1e53('0x13')][_0x41220e])){this['variables'][_0x41220e]={};}this[_0x1e53('0x13')][_0x41220e][_0x34437e]=_0x3e7a64;}};VoiceQueueReport[_0x1e53('0x34')][_0x1e53('0x22')]=function(_0x45065b){try{if(this[_0x1e53('0x59')](_0x45065b)){if(this[_0x1e53('0xf')][_0x45065b[_0x1e53('0x64')]]){for(var _0x3c9572=0x0,_0x11d866={};_0x3c9572<this[_0x1e53('0xf')][_0x45065b[_0x1e53('0x64')]][_0x1e53('0x9d')];_0x3c9572+=0x1){_0x11d866=this[_0x1e53('0xf')][_0x45065b['uniqueid']][_0x3c9572];if(this[_0x1e53('0x11')][_0x11d866[_0x1e53('0x5e')]]){if(_0x11d866[_0x1e53('0x7c')]){this['voiceQueues'][_0x11d866['queue']]['unmanaged']+=0x1;}this[_0x1e53('0x11')][_0x11d866['queue']][_0x1e53('0x51')]+=moment(_0x11d866[_0x1e53('0x8f')])[_0x1e53('0x9e')](_0x11d866[_0x1e53('0x84')],_0x1e53('0x86'))||0x0;if(_0x3c9572===this[_0x1e53('0xf')][_0x45065b['uniqueid']]['length']-0x1){this[_0x1e53('0x11')][_0x11d866[_0x1e53('0x5e')]][_0x1e53('0x50')]+=moment()[_0x1e53('0x9f')](0x0)[_0x1e53('0x9e')](_0x11d866[_0x1e53('0x84')],_0x1e53('0x86'));this[_0x1e53('0x11')][_0x11d866[_0x1e53('0x5e')]][_0x1e53('0x52')]+=0x1;if(_0x11d866[_0x1e53('0x6c')]){this[_0x1e53('0x11')][_0x11d866['queue']][_0x1e53('0x4d')]+=0x1;this[_0x1e53('0x11')][_0x11d866[_0x1e53('0x5e')]][_0x1e53('0xa0')]+=moment()[_0x1e53('0x9f')](0x0)[_0x1e53('0x9e')](_0x11d866['queuecallerleaveAt'],_0x1e53('0x86'));_0x11d866['queuecallercompleteAt']=moment()[_0x1e53('0x44')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x11d866['queuecallerabandon']){_0x11d866[_0x1e53('0xa1')]='abandoned';ami['emit']('custom:queuecallerabandon',_0x11d866);}if(_0x11d866[_0x1e53('0x7c')]){_0x11d866[_0x1e53('0xa1')]=_0x1e53('0x53');ami[_0x1e53('0x42')]('custom:queuecallerunmanaged',_0x11d866);}}else{this[_0x1e53('0x11')][_0x11d866[_0x1e53('0x5e')]][_0x1e53('0x50')]+=this[_0x1e53('0x11')][_0x11d866[_0x1e53('0x5e')]][_0x1e53('0x51')];}this[_0x1e53('0x36')][_0x45065b['uniqueid']]=_0x11d866;this[_0x1e53('0x73')](_0x11d866);}}ami['emit'](_0x1e53('0xa2'),this['queueReports'][_0x45065b[_0x1e53('0x64')]]);delete this['queueReports'][_0x45065b['uniqueid']];delete this['channels'][_0x45065b[_0x1e53('0x64')]];}if(this[_0x1e53('0x13')][_0x45065b[_0x1e53('0x64')]]){delete this[_0x1e53('0x13')][_0x45065b['uniqueid']];}}}catch(_0x5df685){logger['error'](_0x1e53('0xa3'),util[_0x1e53('0x63')](_0x5df685,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1e53('0x34')][_0x1e53('0xa4')]=function(_0x423ebf){try{if(this[_0x1e53('0x59')](_0x423ebf)){var _0x5835d8;if(this[_0x1e53('0xf')][_0x423ebf[_0x1e53('0xa5')]]){_0x5835d8=_[_0x1e53('0x75')](this['queueReports'][_0x423ebf[_0x1e53('0xa5')]]);_0x5835d8[_0x1e53('0x89')]=_0x423ebf[_0x1e53('0xa6')];_0x5835d8[_0x1e53('0x8a')]=_0x423ebf[_0x1e53('0xa7')];_0x5835d8[_0x1e53('0x70')]='ATTENDEDTRANSFER';_0x5835d8[_0x1e53('0x7e')]=!![];_0x5835d8[_0x1e53('0x87')]='ATTENDED';if(this['queueReports'][_0x423ebf[_0x1e53('0xa7')]]){var _0x3855cc=this[_0x1e53('0xf')][_0x423ebf[_0x1e53('0xa7')]];this[_0x1e53('0xf')][_0x423ebf[_0x1e53('0xa7')]]=this[_0x1e53('0xf')][_0x423ebf[_0x1e53('0xa5')]];this[_0x1e53('0xf')][_0x423ebf[_0x1e53('0xa5')]]=_0x3855cc;var _0x43d8fd=_[_0x1e53('0x75')](this[_0x1e53('0xf')][_0x423ebf[_0x1e53('0xa5')]]);_0x43d8fd['switch']=!![];}}else if(this[_0x1e53('0xf')][_0x423ebf[_0x1e53('0xa8')]]){_0x5835d8=_[_0x1e53('0x75')](this['queueReports'][_0x423ebf['transfertargetuniqueid']]);_0x5835d8[_0x1e53('0x89')]=_0x423ebf[_0x1e53('0xa9')];_0x5835d8[_0x1e53('0x8a')]=_0x423ebf['origtransfereruniqueid'];_0x5835d8[_0x1e53('0x70')]=_0x1e53('0xaa');_0x5835d8[_0x1e53('0x7e')]=!![];_0x5835d8['transfertype']='ATTENDED';if(this[_0x1e53('0xf')][_0x423ebf[_0x1e53('0xab')]]){var _0x3855cc=this[_0x1e53('0xf')][_0x423ebf[_0x1e53('0xab')]];this['queueReports'][_0x423ebf[_0x1e53('0xab')]]=this[_0x1e53('0xf')][_0x423ebf[_0x1e53('0xa8')]];this['queueReports'][_0x423ebf[_0x1e53('0xa8')]]=_0x3855cc;var _0x43d8fd=_[_0x1e53('0x75')](this[_0x1e53('0xf')][_0x423ebf[_0x1e53('0xa8')]]);_0x43d8fd[_0x1e53('0xac')]=!![];}}}}catch(_0x1747d4){logger[_0x1e53('0x3d')](_0x1e53('0xad'),util[_0x1e53('0x63')](_0x1747d4,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x1e53('0xae')]=function(_0x1b594f){try{if(this['isNotNull'](_0x1b594f)){if(this[_0x1e53('0xf')][_0x1b594f['transfereeuniqueid']]){var _0x17b371=_[_0x1e53('0x75')](this['queueReports'][_0x1b594f[_0x1e53('0xa5')]]);_0x17b371[_0x1e53('0x70')]=_0x1e53('0xaf');_0x17b371[_0x1e53('0x7e')]=!![];_0x17b371['transfertype']=_0x1e53('0xb0');_0x17b371[_0x1e53('0x89')]=_0x1b594f['extension'];_0x17b371['transferuniqueid']=_0x1b594f[_0x1e53('0xa5')];}}}catch(_0x19eb51){logger[_0x1e53('0x3d')](_0x1e53('0xb1'),util[_0x1e53('0x63')](_0x19eb51,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1e53('0x34')][_0x1e53('0x25')]=function(_0x56ccc3){try{if(this[_0x1e53('0x59')](_0x56ccc3)){if(this[_0x1e53('0xf')][_0x56ccc3['uniqueid']]){var _0x134d69=_[_0x1e53('0x75')](this[_0x1e53('0xf')][_0x56ccc3[_0x1e53('0x64')]]);if(!_[_0x1e53('0x37')](_0x134d69[_0x1e53('0x8f')])){_0x134d69[_0x1e53('0xb2')]=moment()[_0x1e53('0x44')](_0x1e53('0x65'));}}}}catch(_0xd6431b){logger[_0x1e53('0x3d')](_0x1e53('0xb3'),util[_0x1e53('0x63')](_0xd6431b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1e53('0x34')][_0x1e53('0x27')]=function(_0x6a09d0){try{if(this['isNotNull'](_0x6a09d0)){if(this[_0x1e53('0xf')][_0x6a09d0[_0x1e53('0x64')]]){var _0x16ab34=_[_0x1e53('0x75')](this['queueReports'][_0x6a09d0['uniqueid']]);if(!_[_0x1e53('0x37')](_0x16ab34['mohstarttime'])){_0x16ab34[_0x1e53('0xb4')]+=moment()[_0x1e53('0x9f')](0x0)[_0x1e53('0x9e')](_0x16ab34['mohstarttime'],_0x1e53('0x86'));delete _0x16ab34[_0x1e53('0xb2')];}}}}catch(_0x18db9e){logger[_0x1e53('0x3d')](_0x1e53('0xb5'),util['inspect'](_0x18db9e,{'showHidden':![],'depth':null}));}};module[_0x1e53('0xb6')]=VoiceQueueReport;
\ No newline at end of file
index a3a40e7..e227e5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eea=['queue','Request','CreateReportAgentPreview','../client','campaign'];(function(_0x51df1c,_0x44c590){var _0x31eae6=function(_0x1cf945){while(--_0x1cf945){_0x51df1c['push'](_0x51df1c['shift']());}};_0x31eae6(++_0x44c590);}(_0x3eea,0x1ca));var _0xa3ee=function(_0xcf9b02,_0x5b9a98){_0xcf9b02=_0xcf9b02-0x0;var _0x32fef6=_0x3eea[_0xcf9b02];return _0x32fef6;};'use strict';var client=require(_0xa3ee('0x0'));exports['createHistory']=function(_0x8d10d0){return function(){_0x8d10d0[_0xa3ee('0x1')]=_0x8d10d0[_0xa3ee('0x2')];return client[_0xa3ee('0x3')](_0xa3ee('0x4'),{'body':_0x8d10d0,'log':_0xa3ee('0x4')});};};
\ No newline at end of file
+var _0xa630=['queue','CreateReportAgentPreview','../client','createHistory'];(function(_0xbe4145,_0x324f4d){var _0x14f720=function(_0x1de944){while(--_0x1de944){_0xbe4145['push'](_0xbe4145['shift']());}};_0x14f720(++_0x324f4d);}(_0xa630,0xbe));var _0x0a63=function(_0x18e333,_0x50f4c2){_0x18e333=_0x18e333-0x0;var _0x24d6a1=_0xa630[_0x18e333];return _0x24d6a1;};'use strict';var client=require(_0x0a63('0x0'));exports[_0x0a63('0x1')]=function(_0x51d2c0){return function(){_0x51d2c0['campaign']=_0x51d2c0[_0x0a63('0x2')];return client['Request'](_0x0a63('0x3'),{'body':_0x51d2c0,'log':'CreateReportAgentPreview'});};};
\ No newline at end of file
index c026a36..c20d22d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1158=['Request','CreateAttachment'];(function(_0x2de020,_0x252df0){var _0x182b7c=function(_0xcbcdaa){while(--_0xcbcdaa){_0x2de020['push'](_0x2de020['shift']());}};_0x182b7c(++_0x252df0);}(_0x1158,0x1dc));var _0x8115=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x1158[_0x4a53d];return _0x27410e;};'use strict';var client=require('../client');exports['create']=function(_0x2d6199){return client[_0x8115('0x0')](_0x8115('0x1'),{'body':_0x2d6199,'log':_0x8115('0x1')});};
\ No newline at end of file
+var _0x294e=['../client','create','CreateAttachment'];(function(_0x17730a,_0x362127){var _0x485db1=function(_0x144233){while(--_0x144233){_0x17730a['push'](_0x17730a['shift']());}};_0x485db1(++_0x362127);}(_0x294e,0x162));var _0xe294=function(_0x5e5cae,_0xead61){_0x5e5cae=_0x5e5cae-0x0;var _0x554fda=_0x294e[_0x5e5cae];return _0x554fda;};'use strict';var client=require(_0xe294('0x0'));exports[_0xe294('0x1')]=function(_0x2623d9){return client['Request'](_0xe294('0x2'),{'body':_0x2623d9,'log':_0xe294('0x2')});};
\ No newline at end of file
index 0ce7106..e0a5bfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17d7=['SquareProject','getCampaign','getCampaigns','Request','GetCampaign','name','type','active','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','Trunk','callerid','TrunkBackup','Interval','Intervals'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x17d7,0x10a));var _0x717d=function(_0x510560,_0xff7333){_0x510560=_0x510560-0x0;var _0xbc9627=_0x17d7[_0x510560];return _0xbc9627;};'use strict';var client=require('../client');exports[_0x717d('0x0')]=function(){return function(){return client[_0x717d('0x1')](_0x717d('0x2'),{'options':{'raw':![],'attributes':['id',_0x717d('0x3'),_0x717d('0x4'),_0x717d('0x5'),_0x717d('0x6'),_0x717d('0x7'),_0x717d('0x8'),_0x717d('0x9'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x717d('0xa'),_0x717d('0xb'),_0x717d('0xc'),_0x717d('0xd'),'dialGlobalMaxRetry','dialTimezone',_0x717d('0xe'),_0x717d('0xf'),_0x717d('0x10'),_0x717d('0x11'),_0x717d('0x12'),_0x717d('0x13'),'dialAMDMinWordLength',_0x717d('0x14'),_0x717d('0x15'),_0x717d('0x16'),_0x717d('0x17'),_0x717d('0x18'),'dialPrefix',_0x717d('0x19'),'dialCutDigit'],'include':[{'model':'Trunk','as':_0x717d('0x1a'),'attributes':['id','name',_0x717d('0x1b'),_0x717d('0x5')]},{'model':'Trunk','as':_0x717d('0x1c'),'attributes':['id',_0x717d('0x3'),'callerid','active']},{'model':_0x717d('0x1d'),'as':_0x717d('0x1d'),'attributes':['id',_0x717d('0x3')],'include':[{'model':_0x717d('0x1d'),'as':_0x717d('0x1e'),'attributes':['id',_0x717d('0x3'),'interval']}]},{'model':_0x717d('0x1f'),'as':'SquareProject','attributes':['id',_0x717d('0x3')]}]},'log':_0x717d('0x20')});};};
\ No newline at end of file
+var _0x9653=['dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','Trunk','callerid','Interval','Intervals','interval','SquareProject','getCampaign','getCampaigns','GetCampaign','name','type','active','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength'];(function(_0x49706a,_0x5e6986){var _0x30d58d=function(_0x15dfdf){while(--_0x15dfdf){_0x49706a['push'](_0x49706a['shift']());}};_0x30d58d(++_0x5e6986);}(_0x9653,0x6c));var _0x3965=function(_0x487c27,_0x5ea184){_0x487c27=_0x487c27-0x0;var _0x22a2ad=_0x9653[_0x487c27];return _0x22a2ad;};'use strict';var client=require('../client');exports[_0x3965('0x0')]=function(){return function(){return client['Request'](_0x3965('0x1'),{'options':{'raw':![],'attributes':['id',_0x3965('0x2'),_0x3965('0x3'),_0x3965('0x4'),'limitCalls',_0x3965('0x5'),'dialOriginateCallerIdNumber',_0x3965('0x6'),_0x3965('0x7'),_0x3965('0x8'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0x3965('0x9'),_0x3965('0xa'),_0x3965('0xb'),_0x3965('0xc'),_0x3965('0xd'),_0x3965('0xe'),_0x3965('0xf'),_0x3965('0x10'),_0x3965('0x11'),_0x3965('0x12'),_0x3965('0x13'),_0x3965('0x14'),'dialAMDMaximumNumberOfWords',_0x3965('0x15'),_0x3965('0x16'),_0x3965('0x17'),_0x3965('0x18'),'dialRandomLastDigitCallerIdNumber','dialCutDigit'],'include':[{'model':'Trunk','as':_0x3965('0x19'),'attributes':['id',_0x3965('0x2'),_0x3965('0x1a'),_0x3965('0x4')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0x3965('0x2'),_0x3965('0x1a'),_0x3965('0x4')]},{'model':_0x3965('0x1b'),'as':_0x3965('0x1b'),'attributes':['id',_0x3965('0x2')],'include':[{'model':_0x3965('0x1b'),'as':_0x3965('0x1c'),'attributes':['id',_0x3965('0x2'),_0x3965('0x1d')]}]},{'model':'SquareProject','as':_0x3965('0x1e'),'attributes':['id','name']}]},'log':_0x3965('0x1f')});};};
\ No newline at end of file
index b54e1c2..ded14b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c24=['showContact','ShowCmContact','Request','CreateCmContact'];(function(_0x3572b2,_0x5bfd95){var _0x448cd5=function(_0x760edc){while(--_0x760edc){_0x3572b2['push'](_0x3572b2['shift']());}};_0x448cd5(++_0x5bfd95);}(_0x9c24,0x7e));var _0x49c2=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x9c24[_0x47aa64];return _0x549c7a;};'use strict';var client=require('../client');exports['createContact']=function(_0x2e5e9d){return function(){return client[_0x49c2('0x0')](_0x49c2('0x1'),{'body':_0x2e5e9d,'log':_0x49c2('0x1')});};};exports[_0x49c2('0x2')]=function(_0x5d8a3e){return function(){return client['Request']('ShowCmContact',{'options':_0x5d8a3e,'log':_0x49c2('0x3')});};};
\ No newline at end of file
+var _0x2ea8=['showContact','ShowCmContact','../client','createContact','Request','CreateCmContact'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2ea8,0xb6));var _0x82ea=function(_0x574f3b,_0x31f052){_0x574f3b=_0x574f3b-0x0;var _0x1a1b1f=_0x2ea8[_0x574f3b];return _0x1a1b1f;};'use strict';var client=require(_0x82ea('0x0'));exports[_0x82ea('0x1')]=function(_0x55e19f){return function(){return client[_0x82ea('0x2')]('CreateCmContact',{'body':_0x55e19f,'log':_0x82ea('0x3')});};};exports[_0x82ea('0x4')]=function(_0x127251){return function(){return client[_0x82ea('0x2')](_0x82ea('0x5'),{'options':_0x127251,'log':_0x82ea('0x5')});};};
\ No newline at end of file
index 7d7d4a0..ea689a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['CmContact','Contact','getCmHopper','updateContacts','Request','UpdateCmHopper','YYYY-MM-DD\x20HH:mm:ss','ListId','rescheduleContact','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','format','priority','DESC','scheduledat','getContactDialerIvr','ASC','GetContactDialerIvr','campaign','MoveContactManagedDialer','ContactId','CampaignId','CountReScheduled','countReScheduled','getContactPreview','Agent','name','VoiceQueue','Queue','unlockContact','GetContactRecallMe','db.CmHopper.UserId','../client','moment','lodash','GetCmHopper'];(function(_0x519b55,_0x1597a7){var _0x5baf3d=function(_0x5d3901){while(--_0x5d3901){_0x519b55['push'](_0x519b55['shift']());}};_0x5baf3d(++_0x1597a7);}(_0x7a54,0x106));var _0x47a5=function(_0x12d215,_0x512549){_0x12d215=_0x12d215-0x0;var _0x2879db=_0x7a54[_0x12d215];return _0x2879db;};'use strict';var client=require(_0x47a5('0x0'));var moment=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));exports['getContacts']=function(_0x1d33e,_0x4086cd){return function(){return client['Request'](_0x47a5('0x3'),{'options':{'where':{'VoiceQueueId':_0x1d33e},'include':[{'model':_0x47a5('0x4'),'as':_0x47a5('0x5')}],'limit':_0x4086cd,'raw':![]},'log':_0x47a5('0x6')});};};exports[_0x47a5('0x7')]=function(_0x545a97,_0x3d5629,_0x59199c){return function(){return client[_0x47a5('0x8')](_0x47a5('0x9'),{'body':_0x545a97,'options':{'where':{'VoiceQueueId':_0x3d5629,'scheduledat':{'$lte':moment()['format'](_0x47a5('0xa'))}},'limit':_0x59199c},'log':'UpdateCmHopper'});};};exports['rescheduleContact']=function(_0x582352){return function(){return client[_0x47a5('0x8')](_0x47a5('0x9'),{'body':_0x582352,'options':{'where':{'ContactId':_0x582352['ContactId'],'ListId':_0x582352[_0x47a5('0xb')],'VoiceQueueId':_0x582352['VoiceQueueId'],'CampaignId':_0x582352['CampaignId']}},'log':_0x47a5('0xc')});};};exports[_0x47a5('0xd')]=function(_0x2f399b,_0x250fad,_0xd612dd){return function(){return client[_0x47a5('0x8')](_0x47a5('0xe'),{'options':{'where':{'VoiceQueueId':_0x2f399b,'ListId':_0x250fad,'ContactId':_0xd612dd}},'log':'DestroyCmHopper'});};};exports[_0x47a5('0xf')]=function(_0x221b54,_0x1cf309,_0x711793,_0x139f25){return function(){return client[_0x47a5('0x8')](_0x47a5('0x10'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x221b54,'active':![],'scheduledat':{'$lte':moment()[_0x47a5('0x11')]('YYYY-MM-DD\x20HH:mm:ss')},'$or':[{'UserId':null},{'UserId':{'$in':_0x1cf309}}]},'include':[{'model':_0x47a5('0x4'),'as':_0x47a5('0x5')}],'order':[[_0x47a5('0x12'),_0x47a5('0x13')],[_0x47a5('0x14'),_0x139f25],['id','ASC']],'raw':!![],'limit':_0x711793},'log':'GetContactDialer'});};};exports[_0x47a5('0x15')]=function(_0x4b966e,_0x5247fd,_0x423a81){return function(){return client[_0x47a5('0x8')](_0x47a5('0x10'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x4b966e,'active':![],'scheduledat':{'$lte':moment()[_0x47a5('0x11')](_0x47a5('0xa'))}},'include':[{'model':_0x47a5('0x4'),'as':_0x47a5('0x5')}],'order':[[_0x47a5('0x12'),_0x47a5('0x13')],['scheduledat',_0x423a81],['id',_0x47a5('0x16')]],'raw':!![],'limit':_0x5247fd},'log':_0x47a5('0x17')});};};exports['moveContactManagedDialer']=function(_0x2b0360,_0x1f03f7){return function(){_0x2b0360[_0x47a5('0x18')]=_0x2b0360['queue'];return client[_0x47a5('0x8')](_0x47a5('0x19'),{'body':_0x2b0360,'options':{'where':{'ContactId':_0x2b0360[_0x47a5('0x1a')],'ListId':_0x2b0360[_0x47a5('0xb')],'VoiceQueueId':_0x2b0360['VoiceQueueId'],'CampaignId':_0x2b0360[_0x47a5('0x1b')],'active':_0x1f03f7?undefined:!![]}},'log':_0x47a5('0x19')});};};exports['countReScheduled']=function(_0x28747d){return function(){return client[_0x47a5('0x8')](_0x47a5('0x1c'),{'options':{'where':{'VoiceQueueId':_0x28747d['id']?_0x28747d['id']||null:null}},'log':_0x47a5('0x1d')});};};exports[_0x47a5('0x1e')]=function(_0x50bf17){return function(){return client['Request'](_0x47a5('0x3'),{'options':{'where':{'id':_0x50bf17},'include':[{'model':'CmContact','as':_0x47a5('0x5')},{'model':'User','as':_0x47a5('0x1f'),'attributes':['id',_0x47a5('0x20')]},{'model':_0x47a5('0x21'),'as':_0x47a5('0x22'),'attributes':['id',_0x47a5('0x20')]}],'raw':!![]},'log':_0x47a5('0x6')});};};exports[_0x47a5('0x23')]=function(_0x136b14,_0x16631f,_0x361bfa){return function(){return client[_0x47a5('0x8')](_0x47a5('0x9'),{'body':_0x136b14,'options':{'where':{'id':_0x16631f},'limit':_0x361bfa},'log':_0x47a5('0x9')});};};exports['getContactRecallMe']=function(_0x243210,_0x51833b){return function(){return client[_0x47a5('0x8')](_0x47a5('0x24'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x243210,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x47a5('0x11')]('YYYY-MM-DD\x20HH:mm:ss')},'UserId':{'$in':_0x51833b}},'order':[[_0x47a5('0x12'),_0x47a5('0x13')],[_0x47a5('0x14'),_0x47a5('0x13')],['id','ASC']],'include':[{'model':'CmContact','as':_0x47a5('0x5')}],'group':_0x47a5('0x25'),'raw':!![]},'log':'GetContactDialer'});};};
\ No newline at end of file
+var _0x0295=['name','VoiceQueue','unlockContact','UpdateCmHopper','getContactRecallMe','GetContactRecallMe','../client','getContacts','Request','GetCmHopper','CmContact','Contact','getCmHopper','updateContacts','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','ListId','VoiceQueueId','destroyContact','GetContactDialer','format','priority','DESC','scheduledat','ASC','getContactDialerIvr','GetContactDialerIvr','moveContactManagedDialer','campaign','MoveContactManagedDialer','CampaignId','countReScheduled','getContactPreview','User'];(function(_0x5e62d4,_0x2e2ba1){var _0x94eb77=function(_0x15a277){while(--_0x15a277){_0x5e62d4['push'](_0x5e62d4['shift']());}};_0x94eb77(++_0x2e2ba1);}(_0x0295,0x1f0));var _0x5029=function(_0x2feb53,_0x264ef7){_0x2feb53=_0x2feb53-0x0;var _0x5700ee=_0x0295[_0x2feb53];return _0x5700ee;};'use strict';var client=require(_0x5029('0x0'));var moment=require('moment');var _=require('lodash');exports[_0x5029('0x1')]=function(_0x4f552a,_0x53c2e1){return function(){return client[_0x5029('0x2')](_0x5029('0x3'),{'options':{'where':{'VoiceQueueId':_0x4f552a},'include':[{'model':_0x5029('0x4'),'as':_0x5029('0x5')}],'limit':_0x53c2e1,'raw':![]},'log':_0x5029('0x6')});};};exports[_0x5029('0x7')]=function(_0x200217,_0x215955,_0x5b3cd){return function(){return client['Request']('UpdateCmHopper',{'body':_0x200217,'options':{'where':{'VoiceQueueId':_0x215955,'scheduledat':{'$lte':moment()['format'](_0x5029('0x8'))}},'limit':_0x5b3cd},'log':'UpdateCmHopper'});};};exports[_0x5029('0x9')]=function(_0x5bccfc){return function(){return client[_0x5029('0x2')]('UpdateCmHopper',{'body':_0x5bccfc,'options':{'where':{'ContactId':_0x5bccfc[_0x5029('0xa')],'ListId':_0x5bccfc[_0x5029('0xb')],'VoiceQueueId':_0x5bccfc[_0x5029('0xc')],'CampaignId':_0x5bccfc['CampaignId']}},'log':_0x5029('0x9')});};};exports[_0x5029('0xd')]=function(_0x3fe6d1,_0x4f295e,_0x3bc005){return function(){return client[_0x5029('0x2')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x3fe6d1,'ListId':_0x4f295e,'ContactId':_0x3bc005}},'log':'DestroyCmHopper'});};};exports['getContactDialer']=function(_0x4aebb6,_0x2484ac,_0x2e0369,_0x12c237){return function(){return client[_0x5029('0x2')](_0x5029('0xe'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x4aebb6,'active':![],'scheduledat':{'$lte':moment()[_0x5029('0xf')](_0x5029('0x8'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x2484ac}}]},'include':[{'model':_0x5029('0x4'),'as':_0x5029('0x5')}],'order':[[_0x5029('0x10'),_0x5029('0x11')],[_0x5029('0x12'),_0x12c237],['id',_0x5029('0x13')]],'raw':!![],'limit':_0x2e0369},'log':_0x5029('0xe')});};};exports[_0x5029('0x14')]=function(_0x4f7ab4,_0x1ed567,_0x31a155){return function(){return client[_0x5029('0x2')](_0x5029('0xe'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x4f7ab4,'active':![],'scheduledat':{'$lte':moment()[_0x5029('0xf')](_0x5029('0x8'))}},'include':[{'model':_0x5029('0x4'),'as':'Contact'}],'order':[[_0x5029('0x10'),'DESC'],[_0x5029('0x12'),_0x31a155],['id',_0x5029('0x13')]],'raw':!![],'limit':_0x1ed567},'log':_0x5029('0x15')});};};exports[_0x5029('0x16')]=function(_0x4b5854,_0x47ecca){return function(){_0x4b5854[_0x5029('0x17')]=_0x4b5854['queue'];return client[_0x5029('0x2')](_0x5029('0x18'),{'body':_0x4b5854,'options':{'where':{'ContactId':_0x4b5854[_0x5029('0xa')],'ListId':_0x4b5854[_0x5029('0xb')],'VoiceQueueId':_0x4b5854[_0x5029('0xc')],'CampaignId':_0x4b5854[_0x5029('0x19')],'active':_0x47ecca?undefined:!![]}},'log':_0x5029('0x18')});};};exports[_0x5029('0x1a')]=function(_0x3e857d){return function(){return client['Request']('CountReScheduled',{'options':{'where':{'VoiceQueueId':_0x3e857d['id']?_0x3e857d['id']||null:null}},'log':'countReScheduled'});};};exports[_0x5029('0x1b')]=function(_0x45666c){return function(){return client['Request']('GetCmHopper',{'options':{'where':{'id':_0x45666c},'include':[{'model':_0x5029('0x4'),'as':_0x5029('0x5')},{'model':_0x5029('0x1c'),'as':'Agent','attributes':['id',_0x5029('0x1d')]},{'model':_0x5029('0x1e'),'as':'Queue','attributes':['id',_0x5029('0x1d')]}],'raw':!![]},'log':_0x5029('0x6')});};};exports[_0x5029('0x1f')]=function(_0x4a24b9,_0x32da06,_0x251f99){return function(){return client[_0x5029('0x2')]('UpdateCmHopper',{'body':_0x4a24b9,'options':{'where':{'id':_0x32da06},'limit':_0x251f99},'log':_0x5029('0x20')});};};exports[_0x5029('0x21')]=function(_0x4cc16a,_0x1d79b9){return function(){return client[_0x5029('0x2')](_0x5029('0x22'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x4cc16a,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x5029('0xf')](_0x5029('0x8'))},'UserId':{'$in':_0x1d79b9}},'order':[[_0x5029('0x10'),_0x5029('0x11')],[_0x5029('0x12'),_0x5029('0x11')],['id',_0x5029('0x13')]],'include':[{'model':_0x5029('0x4'),'as':_0x5029('0x5')}],'group':'db.CmHopper.UserId','raw':!![]},'log':_0x5029('0xe')});};};
\ No newline at end of file
index 99bf76f..5cd872d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6bc=['CampaignId','GetCmHopperBlackIvr','../client','checkIsBlackList','GetCmHopperBlack','VoiceQueueId','phone','Request'];(function(_0x5670c7,_0x578be5){var _0x1d8551=function(_0x360dbc){while(--_0x360dbc){_0x5670c7['push'](_0x5670c7['shift']());}};_0x1d8551(++_0x578be5);}(_0xd6bc,0x1e2));var _0xcd6b=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xd6bc[_0x4b7895];return _0x264180;};'use strict';var client=require(_0xcd6b('0x0'));exports[_0xcd6b('0x1')]=function(_0x3d5f25){return function(){return client['Request'](_0xcd6b('0x2'),{'options':{'where':{'VoiceQueueId':_0x3d5f25[_0xcd6b('0x3')],'phone':_0x3d5f25['Contact'][_0xcd6b('0x4')]},'raw':![]},'log':'GetCmHopperBlack'});};};exports['checkIsBlackListIvr']=function(_0x1df974){return function(){return client[_0xcd6b('0x5')]('GetCmHopperBlack',{'options':{'where':{'CampaignId':_0x1df974[_0xcd6b('0x6')],'phone':_0x1df974['Contact'][_0xcd6b('0x4')]},'raw':![]},'log':_0xcd6b('0x7')});};};
\ No newline at end of file
+var _0x8761=['checkIsBlackListIvr','CampaignId','GetCmHopperBlackIvr','../client','checkIsBlackList','Request','GetCmHopperBlack','VoiceQueueId','Contact'];(function(_0x51d83d,_0x14ea45){var _0x2ae75d=function(_0x2aa957){while(--_0x2aa957){_0x51d83d['push'](_0x51d83d['shift']());}};_0x2ae75d(++_0x14ea45);}(_0x8761,0xff));var _0x1876=function(_0x4ea14d,_0x3c43f0){_0x4ea14d=_0x4ea14d-0x0;var _0x3ab706=_0x8761[_0x4ea14d];return _0x3ab706;};'use strict';var client=require(_0x1876('0x0'));exports[_0x1876('0x1')]=function(_0xbcc0b9){return function(){return client[_0x1876('0x2')](_0x1876('0x3'),{'options':{'where':{'VoiceQueueId':_0xbcc0b9[_0x1876('0x4')],'phone':_0xbcc0b9[_0x1876('0x5')]['phone']},'raw':![]},'log':_0x1876('0x3')});};};exports[_0x1876('0x6')]=function(_0x51a265){return function(){return client[_0x1876('0x2')](_0x1876('0x3'),{'options':{'where':{'CampaignId':_0x51a265[_0x1876('0x7')],'phone':_0x51a265[_0x1876('0x5')]['phone']},'raw':![]},'log':_0x1876('0x8')});};};
\ No newline at end of file
index cc1a7db..5ff1109 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b07=['CreateCmHopperFinal','../client','createContact','campaign','queue'];(function(_0x2e5e78,_0x1b2b3e){var _0x50b947=function(_0x46f39f){while(--_0x46f39f){_0x2e5e78['push'](_0x2e5e78['shift']());}};_0x50b947(++_0x1b2b3e);}(_0x6b07,0x1a5));var _0x76b0=function(_0x1d6426,_0x453975){_0x1d6426=_0x1d6426-0x0;var _0x4468cf=_0x6b07[_0x1d6426];return _0x4468cf;};'use strict';var client=require(_0x76b0('0x0'));exports[_0x76b0('0x1')]=function(_0x3a016b){return function(){_0x3a016b[_0x76b0('0x2')]=_0x3a016b[_0x76b0('0x3')];return client['Request'](_0x76b0('0x4'),{'body':_0x3a016b,'log':_0x76b0('0x4')});};};
\ No newline at end of file
+var _0xd0e0=['createContact','campaign','queue','Request','CreateCmHopperFinal','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd0e0,0x1e5));var _0x0d0e=function(_0x1121c1,_0x2a3a0f){_0x1121c1=_0x1121c1-0x0;var _0xc296db=_0xd0e0[_0x1121c1];return _0xc296db;};'use strict';var client=require(_0x0d0e('0x0'));exports[_0x0d0e('0x1')]=function(_0x2589b){return function(){_0x2589b[_0x0d0e('0x2')]=_0x2589b[_0x0d0e('0x3')];return client[_0x0d0e('0x4')](_0x0d0e('0x5'),{'body':_0x2589b,'log':_0x0d0e('0x5')});};};
\ No newline at end of file
index 1f9d812..583af79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94d4=['avgHandleTime','Request','AvgHandleTime','subtract','format','YYYY-MM-DD\x20HH:mm:ss','startOf','day','getCampaignHopperHistory','GetCampaignHopperHistory','endOf','ivr','../client','moment','campaign','queue','CreateCmHopperHistory'];(function(_0x4b48e5,_0xc3c425){var _0x210b17=function(_0x43ccc1){while(--_0x43ccc1){_0x4b48e5['push'](_0x4b48e5['shift']());}};_0x210b17(++_0xc3c425);}(_0x94d4,0xa5));var _0x494d=function(_0xf3d5a0,_0x4c3828){_0xf3d5a0=_0xf3d5a0-0x0;var _0x1c3150=_0x94d4[_0xf3d5a0];return _0x1c3150;};'use strict';var client=require(_0x494d('0x0'));var moment=require(_0x494d('0x1'));exports['createHistory']=function(_0x117f3c){return function(){_0x117f3c[_0x494d('0x2')]=_0x117f3c[_0x494d('0x3')];return client['Request'](_0x494d('0x4'),{'body':_0x117f3c,'log':_0x494d('0x4')});};};exports[_0x494d('0x5')]=function(_0x38f96d){return function(){return client[_0x494d('0x6')](_0x494d('0x7'),{'options':{'where':{'endtime':{'$between':[moment()[_0x494d('0x8')](_0x38f96d,'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x494d('0x9')](_0x494d('0xa'))]}},'raw':![]},'log':'GetCmHopperHistory'});};};exports['getVoiceQueueHopperHistory']=function(_0x456fe8){return function(){return client[_0x494d('0x6')]('GetVoiceQueueHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0x494d('0xb')](_0x494d('0xc'))[_0x494d('0x9')](_0x494d('0xa')),moment()['endOf'](_0x494d('0xc'))[_0x494d('0x9')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':'queue'},'raw':![]},'log':'GetVoiceQueueHopperHistory'});};};exports[_0x494d('0xd')]=function(_0x41e92f){return function(){return client[_0x494d('0x6')](_0x494d('0xe'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x494d('0xb')](_0x494d('0xc'))[_0x494d('0x9')](_0x494d('0xa')),moment()[_0x494d('0xf')](_0x494d('0xc'))[_0x494d('0x9')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0x494d('0x10')},'raw':![]},'log':_0x494d('0xe')});};};
\ No newline at end of file
+var _0x9ccd=['day','endOf','queue','getCampaignHopperHistory','ivr','../client','createHistory','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime','subtract','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory'];(function(_0x18d721,_0x1d01df){var _0xf6f63=function(_0x184bbe){while(--_0x184bbe){_0x18d721['push'](_0x18d721['shift']());}};_0xf6f63(++_0x1d01df);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9ccd[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xd9cc('0x0'));var moment=require('moment');exports[_0xd9cc('0x1')]=function(_0x3ad6c4){return function(){_0x3ad6c4['campaign']=_0x3ad6c4['queue'];return client[_0xd9cc('0x2')]('CreateCmHopperHistory',{'body':_0x3ad6c4,'log':_0xd9cc('0x3')});};};exports[_0xd9cc('0x4')]=function(_0x425ab8){return function(){return client[_0xd9cc('0x2')](_0xd9cc('0x5'),{'options':{'where':{'endtime':{'$between':[moment()[_0xd9cc('0x6')](_0x425ab8,_0xd9cc('0x7'))[_0xd9cc('0x8')](_0xd9cc('0x9')),moment()[_0xd9cc('0x8')](_0xd9cc('0x9'))]}},'raw':![]},'log':_0xd9cc('0xa')});};};exports[_0xd9cc('0xb')]=function(_0x1737e5){return function(){return client[_0xd9cc('0x2')](_0xd9cc('0xc'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xd9cc('0xd'))[_0xd9cc('0x8')](_0xd9cc('0x9')),moment()[_0xd9cc('0xe')](_0xd9cc('0xd'))[_0xd9cc('0x8')](_0xd9cc('0x9'))]},'campaigntype':_0xd9cc('0xf')},'raw':![]},'log':'GetVoiceQueueHopperHistory'});};};exports[_0xd9cc('0x10')]=function(_0x5534f4){return function(){return client['Request']('GetCampaignHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()['startOf']('day')[_0xd9cc('0x8')](_0xd9cc('0x9')),moment()[_0xd9cc('0xe')](_0xd9cc('0xd'))[_0xd9cc('0x8')](_0xd9cc('0x9'))]},'campaigntype':_0xd9cc('0x11')},'raw':![]},'log':'GetCampaignHopperHistory'});};};
\ No newline at end of file
index 9fb8541..2af1689 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['headerinfo','localstationid','minrate','maxrate','modem','faxdetect','tech','TrunkId','ListId','Trunk','callerid','active','getFaxAccount','notify','../client','Request','GetFaxAccount','name','description','ecm'];(function(_0x369a98,_0x32250c){var _0x29565c=function(_0x1a6973){while(--_0x1a6973){_0x369a98['push'](_0x369a98['shift']());}};_0x29565c(++_0x32250c);}(_0x4975,0x86));var _0x5497=function(_0x8ada24,_0x3b450e){_0x8ada24=_0x8ada24-0x0;var _0x2c0160=_0x4975[_0x8ada24];return _0x2c0160;};'use strict';var client=require(_0x5497('0x0'));exports['getFaxAccounts']=function(){return function(){return client[_0x5497('0x1')](_0x5497('0x2'),{'options':{'raw':![],'attributes':['id',_0x5497('0x3'),_0x5497('0x4'),_0x5497('0x5'),_0x5497('0x6'),_0x5497('0x7'),_0x5497('0x8'),_0x5497('0x9'),_0x5497('0xa'),'gateway',_0x5497('0xb'),'t38timeout',_0x5497('0xc'),_0x5497('0xd'),_0x5497('0xe'),'key'],'include':[{'model':_0x5497('0xf'),'as':'Trunk','attributes':['id',_0x5497('0x3'),_0x5497('0x10'),_0x5497('0x11')]}]},'log':_0x5497('0x12')});};};exports[_0x5497('0x13')]=function(_0x425288,_0x3e7886){return client[_0x5497('0x1')]('NotifyFaxAccount',{'account':{'id':_0x425288},'body':_0x3e7886,'log':'NotifyFaxAccount'});};
\ No newline at end of file
+var _0x814b=['../client','getFaxAccounts','Request','GetFaxAccount','name','description','headerinfo','localstationid','minrate','maxrate','modem','gateway','t38timeout','tech','ListId','key','Trunk','callerid','active','getFaxAccount','notify','NotifyFaxAccount'];(function(_0x1d586f,_0x3f8c57){var _0x132bd4=function(_0x440bc1){while(--_0x440bc1){_0x1d586f['push'](_0x1d586f['shift']());}};_0x132bd4(++_0x3f8c57);}(_0x814b,0x1a2));var _0xb814=function(_0x140202,_0x4245c7){_0x140202=_0x140202-0x0;var _0x3037c2=_0x814b[_0x140202];return _0x3037c2;};'use strict';var client=require(_0xb814('0x0'));exports[_0xb814('0x1')]=function(){return function(){return client[_0xb814('0x2')](_0xb814('0x3'),{'options':{'raw':![],'attributes':['id',_0xb814('0x4'),_0xb814('0x5'),'ecm',_0xb814('0x6'),_0xb814('0x7'),_0xb814('0x8'),_0xb814('0x9'),_0xb814('0xa'),_0xb814('0xb'),'faxdetect',_0xb814('0xc'),_0xb814('0xd'),'TrunkId',_0xb814('0xe'),_0xb814('0xf')],'include':[{'model':_0xb814('0x10'),'as':_0xb814('0x10'),'attributes':['id',_0xb814('0x4'),_0xb814('0x11'),_0xb814('0x12')]}]},'log':_0xb814('0x13')});};};exports[_0xb814('0x14')]=function(_0x3450f2,_0x10e4a6){return client['Request'](_0xb814('0x15'),{'account':{'id':_0x3450f2},'body':_0x10e4a6,'log':'NotifyFaxAccount'});};
\ No newline at end of file
index 7769011..732cf43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5334=['../client','update','Request','UpdateFaxMessage'];(function(_0x45b38a,_0x48706e){var _0x4a5b93=function(_0x3b6a62){while(--_0x3b6a62){_0x45b38a['push'](_0x45b38a['shift']());}};_0x4a5b93(++_0x48706e);}(_0x5334,0x84));var _0x4533=function(_0xc7d0cd,_0x2ff84e){_0xc7d0cd=_0xc7d0cd-0x0;var _0x2d0db9=_0x5334[_0xc7d0cd];return _0x2d0db9;};'use strict';var client=require(_0x4533('0x0'));exports[_0x4533('0x1')]=function(_0x6499ca,_0x35fb80){return client[_0x4533('0x2')]('UpdateFaxMessage',{'body':_0x35fb80,'options':{'where':{'AttachmentId':_0x6499ca}},'log':_0x4533('0x3')});};
\ No newline at end of file
+var _0x3c6c=['../client','Request','UpdateFaxMessage'];(function(_0x5855fc,_0x17936f){var _0x59019e=function(_0x5f50da){while(--_0x5f50da){_0x5855fc['push'](_0x5855fc['shift']());}};_0x59019e(++_0x17936f);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x1549c9,_0x1687d5){_0x1549c9=_0x1549c9-0x0;var _0x14111a=_0x3c6c[_0x1549c9];return _0x14111a;};'use strict';var client=require(_0xc3c6('0x0'));exports['update']=function(_0x26d304,_0x2fc57d){return client[_0xc3c6('0x1')](_0xc3c6('0x2'),{'body':_0x2fc57d,'options':{'where':{'AttachmentId':_0x26d304}},'log':_0xc3c6('0x2')});};
\ No newline at end of file
index 5268ba2..adc69fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe88e=['serverUrl','DeskConfiguration','DeskField','content','variableName','Variable','Descriptions','key','keyType','keyContent','nameField','customField','Tag','Tags','../../client','getDeskAccounts','Request','GetDeskAccount','name','description','username','password','type'];(function(_0x58998c,_0x2b9ab4){var _0x9789db=function(_0x1c4108){while(--_0x1c4108){_0x58998c['push'](_0x58998c['shift']());}};_0x9789db(++_0x2b9ab4);}(_0xe88e,0x167));var _0xee88=function(_0x5af9b3,_0x516c90){_0x5af9b3=_0x5af9b3-0x0;var _0x129f28=_0xe88e[_0x5af9b3];return _0x129f28;};'use strict';var client=require(_0xee88('0x0'));exports[_0xee88('0x1')]=function(){return function(_0x44e094){return client[_0xee88('0x2')](_0xee88('0x3'),{'options':{'raw':![],'attributes':['id',_0xee88('0x4'),_0xee88('0x5'),_0xee88('0x6'),_0xee88('0x7'),'remoteUri','authType',_0xee88('0x8'),_0xee88('0x9')],'include':[{'model':_0xee88('0xa'),'as':'Configurations','attributes':['id',_0xee88('0x4')],'include':[{'model':_0xee88('0xb'),'as':'Subjects','attributes':['id','type',_0xee88('0xc'),_0xee88('0xd')],'include':[{'model':_0xee88('0xe'),'as':_0xee88('0xe'),'attributes':['id',_0xee88('0x4')]}]},{'model':_0xee88('0xb'),'as':_0xee88('0xf'),'attributes':['id',_0xee88('0x8'),_0xee88('0xc'),_0xee88('0x10'),_0xee88('0x11'),_0xee88('0x12'),_0xee88('0xd')],'include':[{'model':_0xee88('0xe'),'as':_0xee88('0xe'),'attributes':['id',_0xee88('0x4')]}]},{'model':_0xee88('0xb'),'as':'Fields','attributes':['id',_0xee88('0x8'),_0xee88('0xc'),'idField',_0xee88('0x13'),_0xee88('0x14'),_0xee88('0xd')],'include':[{'model':_0xee88('0xe'),'as':_0xee88('0xe'),'attributes':['id',_0xee88('0x4')]}]},{'model':_0xee88('0x15'),'as':_0xee88('0x16'),'attributes':['id','name']}]}]},'log':_0xee88('0x3')});};};
\ No newline at end of file
+var _0x3650=['keyContent','Fields','idField','variableName','Tag','Tags','GetDeskAccount','../../client','getDeskAccounts','Request','name','description','username','password','remoteUri','authType','type','serverUrl','DeskConfiguration','Configurations','DeskField','Subjects','content','Variable','Descriptions','key','keyType'];(function(_0x6dfeb6,_0x2a9b64){var _0x2f5e2f=function(_0x8c5425){while(--_0x8c5425){_0x6dfeb6['push'](_0x6dfeb6['shift']());}};_0x2f5e2f(++_0x2a9b64);}(_0x3650,0x19c));var _0x0365=function(_0x521fb7,_0x1155cb){_0x521fb7=_0x521fb7-0x0;var _0x2ff4c5=_0x3650[_0x521fb7];return _0x2ff4c5;};'use strict';var client=require(_0x0365('0x0'));exports[_0x0365('0x1')]=function(){return function(_0x1cb947){return client[_0x0365('0x2')]('GetDeskAccount',{'options':{'raw':![],'attributes':['id',_0x0365('0x3'),_0x0365('0x4'),_0x0365('0x5'),_0x0365('0x6'),_0x0365('0x7'),_0x0365('0x8'),_0x0365('0x9'),_0x0365('0xa')],'include':[{'model':_0x0365('0xb'),'as':_0x0365('0xc'),'attributes':['id',_0x0365('0x3')],'include':[{'model':_0x0365('0xd'),'as':_0x0365('0xe'),'attributes':['id',_0x0365('0x9'),_0x0365('0xf'),'variableName'],'include':[{'model':_0x0365('0x10'),'as':_0x0365('0x10'),'attributes':['id',_0x0365('0x3')]}]},{'model':'DeskField','as':_0x0365('0x11'),'attributes':['id',_0x0365('0x9'),_0x0365('0xf'),_0x0365('0x12'),_0x0365('0x13'),_0x0365('0x14'),'variableName'],'include':[{'model':_0x0365('0x10'),'as':_0x0365('0x10'),'attributes':['id',_0x0365('0x3')]}]},{'model':_0x0365('0xd'),'as':_0x0365('0x15'),'attributes':['id',_0x0365('0x9'),_0x0365('0xf'),_0x0365('0x16'),'nameField','customField',_0x0365('0x17')],'include':[{'model':_0x0365('0x10'),'as':'Variable','attributes':['id','name']}]},{'model':_0x0365('0x18'),'as':_0x0365('0x19'),'attributes':['id',_0x0365('0x3')]}]}]},'log':_0x0365('0x1a')});};};
\ No newline at end of file
index 6858ea0..c789d3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5075=['keyContent','variableName','Fields','nameField','customField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','name','username','remoteUri','serverUrl','FreshdeskConfiguration','Tag','Subjects','type','content','Variable','FreshdeskField','Descriptions','key'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x5075,0x73));var _0x5507=function(_0x30631b,_0x50799b){_0x30631b=_0x30631b-0x0;var _0x3d57c6=_0x5075[_0x30631b];return _0x3d57c6;};'use strict';var client=require(_0x5507('0x0'));exports[_0x5507('0x1')]=function(){return function(_0x701161){return client[_0x5507('0x2')](_0x5507('0x3'),{'options':{'raw':![],'attributes':['id',_0x5507('0x4'),_0x5507('0x5'),'apiKey',_0x5507('0x6'),_0x5507('0x7')],'include':[{'model':_0x5507('0x8'),'as':'Configurations','attributes':['id','name'],'include':[{'model':_0x5507('0x9'),'attributes':['id',_0x5507('0x4')]},{'model':'FreshdeskField','as':_0x5507('0xa'),'attributes':['id',_0x5507('0xb'),_0x5507('0xc'),'variableName'],'include':[{'model':'Variable','as':_0x5507('0xd'),'attributes':['id',_0x5507('0x4')]}]},{'model':_0x5507('0xe'),'as':_0x5507('0xf'),'attributes':['id','type',_0x5507('0xc'),_0x5507('0x10'),'keyType',_0x5507('0x11'),_0x5507('0x12')],'include':[{'model':'Variable','as':_0x5507('0xd'),'attributes':['id',_0x5507('0x4')]}]},{'model':_0x5507('0xe'),'as':_0x5507('0x13'),'attributes':['id',_0x5507('0xb'),_0x5507('0xc'),'idField',_0x5507('0x14'),_0x5507('0x15'),_0x5507('0x12')],'include':[{'model':_0x5507('0xd'),'as':'Variable','attributes':['id',_0x5507('0x4')]}]}]}]},'log':_0x5507('0x3')});};};
\ No newline at end of file
+var _0x81bd=['FreshdeskConfiguration','Tag','type','variableName','Variable','FreshdeskField','Descriptions','content','key','keyType','keyContent','Fields','idField','customField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','name','username','remoteUri','serverUrl'];(function(_0x2450b4,_0x37a559){var _0x4a1608=function(_0x395128){while(--_0x395128){_0x2450b4['push'](_0x2450b4['shift']());}};_0x4a1608(++_0x37a559);}(_0x81bd,0x7c));var _0xd81b=function(_0x380016,_0x178dd6){_0x380016=_0x380016-0x0;var _0x5c7ac0=_0x81bd[_0x380016];return _0x5c7ac0;};'use strict';var client=require(_0xd81b('0x0'));exports[_0xd81b('0x1')]=function(){return function(_0x1fd006){return client[_0xd81b('0x2')](_0xd81b('0x3'),{'options':{'raw':![],'attributes':['id',_0xd81b('0x4'),_0xd81b('0x5'),'apiKey',_0xd81b('0x6'),_0xd81b('0x7')],'include':[{'model':_0xd81b('0x8'),'as':'Configurations','attributes':['id',_0xd81b('0x4')],'include':[{'model':_0xd81b('0x9'),'attributes':['id',_0xd81b('0x4')]},{'model':'FreshdeskField','as':'Subjects','attributes':['id',_0xd81b('0xa'),'content',_0xd81b('0xb')],'include':[{'model':_0xd81b('0xc'),'as':_0xd81b('0xc'),'attributes':['id',_0xd81b('0x4')]}]},{'model':_0xd81b('0xd'),'as':_0xd81b('0xe'),'attributes':['id',_0xd81b('0xa'),_0xd81b('0xf'),_0xd81b('0x10'),_0xd81b('0x11'),_0xd81b('0x12'),_0xd81b('0xb')],'include':[{'model':_0xd81b('0xc'),'as':'Variable','attributes':['id',_0xd81b('0x4')]}]},{'model':'FreshdeskField','as':_0xd81b('0x13'),'attributes':['id',_0xd81b('0xa'),'content',_0xd81b('0x14'),'nameField',_0xd81b('0x15'),_0xd81b('0xb')],'include':[{'model':_0xd81b('0xc'),'as':_0xd81b('0xc'),'attributes':['id',_0xd81b('0x4')]}]}]}]},'log':'GetFreshdeskAccount'});};};
\ No newline at end of file
index ebf5a44..5f2bcf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30ae=['GetSalesforceAccount','name','username','password','clientId','securityToken','serverUrl','type','SalesforceConfiguration','Configurations','moduleSearch','moduleCreate','Variable','SalesforceField','Descriptions','Fields','../../client','getSalesforceAccounts'];(function(_0x453a98,_0x652c8f){var _0x4544fc=function(_0x48bdd3){while(--_0x48bdd3){_0x453a98['push'](_0x453a98['shift']());}};_0x4544fc(++_0x652c8f);}(_0x30ae,0x6a));var _0xe30a=function(_0x4d4251,_0xa5c7cf){_0x4d4251=_0x4d4251-0x0;var _0x14027f=_0x30ae[_0x4d4251];return _0x14027f;};'use strict';var client=require(_0xe30a('0x0'));exports[_0xe30a('0x1')]=function(){return function(_0x1c51f3){return client['Request'](_0xe30a('0x2'),{'options':{'raw':![],'attributes':['id',_0xe30a('0x3'),_0xe30a('0x4'),_0xe30a('0x5'),'remoteUri',_0xe30a('0x6'),'clientSecret',_0xe30a('0x7'),_0xe30a('0x8'),_0xe30a('0x9')],'include':[{'model':_0xe30a('0xa'),'as':_0xe30a('0xb'),'attributes':['id','name',_0xe30a('0xc'),_0xe30a('0xd')],'include':[{'model':'SalesforceField','as':'Subjects','include':[{'model':'Variable','as':_0xe30a('0xe'),'attributes':['id',_0xe30a('0x3')]}]},{'model':_0xe30a('0xf'),'as':_0xe30a('0x10'),'include':[{'model':_0xe30a('0xe'),'as':_0xe30a('0xe'),'attributes':['id',_0xe30a('0x3')]}]},{'model':_0xe30a('0xf'),'as':_0xe30a('0x11'),'include':[{'model':_0xe30a('0xe'),'as':_0xe30a('0xe'),'attributes':['id',_0xe30a('0x3')]}]}]}]},'log':'GetSalesforceAccount'});};};
\ No newline at end of file
+var _0xe6cf=['Fields','../../client','Request','GetSalesforceAccount','name','username','password','clientId','clientSecret','securityToken','serverUrl','type','Configurations','SalesforceField','Subjects','Variable','Descriptions'];(function(_0x5c6654,_0x6aff64){var _0x138353=function(_0x5c1dfb){while(--_0x5c1dfb){_0x5c6654['push'](_0x5c6654['shift']());}};_0x138353(++_0x6aff64);}(_0xe6cf,0x1dd));var _0xfe6c=function(_0x1282a0,_0x58b2f9){_0x1282a0=_0x1282a0-0x0;var _0x18af0c=_0xe6cf[_0x1282a0];return _0x18af0c;};'use strict';var client=require(_0xfe6c('0x0'));exports['getSalesforceAccounts']=function(){return function(_0x5046b8){return client[_0xfe6c('0x1')](_0xfe6c('0x2'),{'options':{'raw':![],'attributes':['id',_0xfe6c('0x3'),_0xfe6c('0x4'),_0xfe6c('0x5'),'remoteUri',_0xfe6c('0x6'),_0xfe6c('0x7'),_0xfe6c('0x8'),_0xfe6c('0x9'),_0xfe6c('0xa')],'include':[{'model':'SalesforceConfiguration','as':_0xfe6c('0xb'),'attributes':['id','name','moduleSearch','moduleCreate'],'include':[{'model':_0xfe6c('0xc'),'as':_0xfe6c('0xd'),'include':[{'model':_0xfe6c('0xe'),'as':_0xfe6c('0xe'),'attributes':['id','name']}]},{'model':_0xfe6c('0xc'),'as':_0xfe6c('0xf'),'include':[{'model':_0xfe6c('0xe'),'as':_0xfe6c('0xe'),'attributes':['id','name']}]},{'model':_0xfe6c('0xc'),'as':_0xfe6c('0x10'),'include':[{'model':_0xfe6c('0xe'),'as':_0xfe6c('0xe'),'attributes':['id',_0xfe6c('0x3')]}]}]}]},'log':_0xfe6c('0x2')});};};
\ No newline at end of file
index f0ca2a0..37e37db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x610f=['name','username','password','remoteUri','serverUrl','Configurations','SugarcrmField','Subjects','type','Variable','Descriptions','key','variableName','Fields','content','nameField','customField','../../client','getSugarcrmAccounts','Request','GetSugarcrmAccount'];(function(_0x4b64bc,_0x51db87){var _0x3d69b3=function(_0x4b72bb){while(--_0x4b72bb){_0x4b64bc['push'](_0x4b64bc['shift']());}};_0x3d69b3(++_0x51db87);}(_0x610f,0x1f4));var _0xf610=function(_0x284885,_0x34b143){_0x284885=_0x284885-0x0;var _0x3a9710=_0x610f[_0x284885];return _0x3a9710;};'use strict';var client=require(_0xf610('0x0'));exports[_0xf610('0x1')]=function(){return function(_0x10af44){return client[_0xf610('0x2')](_0xf610('0x3'),{'options':{'raw':![],'attributes':['id',_0xf610('0x4'),_0xf610('0x5'),_0xf610('0x6'),_0xf610('0x7'),_0xf610('0x8')],'include':[{'model':'SugarcrmConfiguration','as':_0xf610('0x9'),'attributes':['id',_0xf610('0x4')],'include':[{'model':_0xf610('0xa'),'as':_0xf610('0xb'),'attributes':['id',_0xf610('0xc'),'content','variableName'],'include':[{'model':'Variable','as':_0xf610('0xd'),'attributes':['id','name']}]},{'model':_0xf610('0xa'),'as':_0xf610('0xe'),'attributes':['id',_0xf610('0xc'),'content',_0xf610('0xf'),'keyType','keyContent',_0xf610('0x10')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xf610('0x4')]}]},{'model':_0xf610('0xa'),'as':_0xf610('0x11'),'attributes':['id',_0xf610('0xc'),_0xf610('0x12'),'idField',_0xf610('0x13'),_0xf610('0x14'),_0xf610('0x10')],'include':[{'model':_0xf610('0xd'),'as':'Variable','attributes':['id',_0xf610('0x4')]}]}]}]},'log':_0xf610('0x3')});};};
\ No newline at end of file
+var _0xc04b=['Fields','type','idField','customField','GetSugarcrmAccount','getSugarcrmAccounts','Request','name','username','password','Configurations','Subjects','content','variableName','Variable','SugarcrmField','key','keyType','keyContent'];(function(_0x5c619e,_0xd5d312){var _0x4e4572=function(_0x467172){while(--_0x467172){_0x5c619e['push'](_0x5c619e['shift']());}};_0x4e4572(++_0xd5d312);}(_0xc04b,0x1e0));var _0xbc04=function(_0x3470ab,_0x3387ba){_0x3470ab=_0x3470ab-0x0;var _0x30680d=_0xc04b[_0x3470ab];return _0x30680d;};'use strict';var client=require('../../client');exports[_0xbc04('0x0')]=function(){return function(_0x33c0fc){return client[_0xbc04('0x1')]('GetSugarcrmAccount',{'options':{'raw':![],'attributes':['id',_0xbc04('0x2'),_0xbc04('0x3'),_0xbc04('0x4'),'remoteUri','serverUrl'],'include':[{'model':'SugarcrmConfiguration','as':_0xbc04('0x5'),'attributes':['id',_0xbc04('0x2')],'include':[{'model':'SugarcrmField','as':_0xbc04('0x6'),'attributes':['id','type',_0xbc04('0x7'),_0xbc04('0x8')],'include':[{'model':_0xbc04('0x9'),'as':_0xbc04('0x9'),'attributes':['id',_0xbc04('0x2')]}]},{'model':_0xbc04('0xa'),'as':'Descriptions','attributes':['id','type','content',_0xbc04('0xb'),_0xbc04('0xc'),_0xbc04('0xd'),_0xbc04('0x8')],'include':[{'model':_0xbc04('0x9'),'as':_0xbc04('0x9'),'attributes':['id',_0xbc04('0x2')]}]},{'model':_0xbc04('0xa'),'as':_0xbc04('0xe'),'attributes':['id',_0xbc04('0xf'),'content',_0xbc04('0x10'),'nameField',_0xbc04('0x11'),_0xbc04('0x8')],'include':[{'model':_0xbc04('0x9'),'as':_0xbc04('0x9'),'attributes':['id','name']}]}]}]},'log':_0xbc04('0x12')});};};
\ No newline at end of file
index 69f99ea..e0353e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6424=['content','variableName','Variable','Descriptions','type','key','keyType','keyContent','Fields','idField','customField','../../client','getVtigerAccounts','Request','GetVtigerAccount','name','description','username','accessKey','serverUrl','Configurations','VtigerField','Subjects'];(function(_0x175796,_0x2686c4){var _0x353315=function(_0x3ca279){while(--_0x3ca279){_0x175796['push'](_0x175796['shift']());}};_0x353315(++_0x2686c4);}(_0x6424,0xac));var _0x4642=function(_0x1ddba3,_0x72ef33){_0x1ddba3=_0x1ddba3-0x0;var _0x83c080=_0x6424[_0x1ddba3];return _0x83c080;};'use strict';var client=require(_0x4642('0x0'));exports[_0x4642('0x1')]=function(){return function(_0x102eda){return client[_0x4642('0x2')](_0x4642('0x3'),{'options':{'raw':![],'attributes':['id',_0x4642('0x4'),_0x4642('0x5'),_0x4642('0x6'),_0x4642('0x7'),'remoteUri',_0x4642('0x8')],'include':[{'model':'VtigerConfiguration','as':_0x4642('0x9'),'attributes':['id',_0x4642('0x4')],'include':[{'model':_0x4642('0xa'),'as':_0x4642('0xb'),'attributes':['id','type',_0x4642('0xc'),_0x4642('0xd')],'include':[{'model':_0x4642('0xe'),'as':_0x4642('0xe'),'attributes':['id',_0x4642('0x4')]}]},{'model':_0x4642('0xa'),'as':_0x4642('0xf'),'attributes':['id',_0x4642('0x10'),'content',_0x4642('0x11'),_0x4642('0x12'),_0x4642('0x13'),_0x4642('0xd')],'include':[{'model':_0x4642('0xe'),'as':_0x4642('0xe'),'attributes':['id',_0x4642('0x4')]}]},{'model':'VtigerField','as':_0x4642('0x14'),'attributes':['id',_0x4642('0x10'),_0x4642('0xc'),_0x4642('0x15'),'nameField',_0x4642('0x16'),_0x4642('0xd')],'include':[{'model':'Variable','as':_0x4642('0xe'),'attributes':['id',_0x4642('0x4')]}]}]}]},'log':'GetVtigerAccount'});};};
\ No newline at end of file
+var _0xadbd=['variableName','Variable','Descriptions','type','key','keyType','Fields','idField','nameField','../../client','getVtigerAccounts','GetVtigerAccount','name','accessKey','remoteUri','serverUrl','VtigerConfiguration','Configurations','VtigerField','content'];(function(_0x5d33d6,_0x327863){var _0x28e381=function(_0x4ad109){while(--_0x4ad109){_0x5d33d6['push'](_0x5d33d6['shift']());}};_0x28e381(++_0x327863);}(_0xadbd,0x1c1));var _0xdadb=function(_0xcf4a8e,_0x30c19a){_0xcf4a8e=_0xcf4a8e-0x0;var _0x4557e5=_0xadbd[_0xcf4a8e];return _0x4557e5;};'use strict';var client=require(_0xdadb('0x0'));exports[_0xdadb('0x1')]=function(){return function(_0x19b09a){return client['Request'](_0xdadb('0x2'),{'options':{'raw':![],'attributes':['id',_0xdadb('0x3'),'description','username',_0xdadb('0x4'),_0xdadb('0x5'),_0xdadb('0x6')],'include':[{'model':_0xdadb('0x7'),'as':_0xdadb('0x8'),'attributes':['id',_0xdadb('0x3')],'include':[{'model':_0xdadb('0x9'),'as':'Subjects','attributes':['id','type',_0xdadb('0xa'),_0xdadb('0xb')],'include':[{'model':_0xdadb('0xc'),'as':'Variable','attributes':['id','name']}]},{'model':_0xdadb('0x9'),'as':_0xdadb('0xd'),'attributes':['id',_0xdadb('0xe'),_0xdadb('0xa'),_0xdadb('0xf'),_0xdadb('0x10'),'keyContent','variableName'],'include':[{'model':_0xdadb('0xc'),'as':_0xdadb('0xc'),'attributes':['id','name']}]},{'model':_0xdadb('0x9'),'as':_0xdadb('0x11'),'attributes':['id',_0xdadb('0xe'),_0xdadb('0xa'),_0xdadb('0x12'),_0xdadb('0x13'),'customField',_0xdadb('0xb')],'include':[{'model':'Variable','as':_0xdadb('0xc'),'attributes':['id',_0xdadb('0x3')]}]}]}]},'log':_0xdadb('0x2')});};};
\ No newline at end of file
index 4cf8bda..b51d4d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66ad=['Tag','ZendeskField','type','variableName','Variable','Descriptions','key','keyType','name','content','customField','getZendeskAccounts','Request','GetZendeskAccount','username','password','remoteUri','authType','serverUrl','Configurations'];(function(_0x3c4062,_0x3767fc){var _0x3f5bf3=function(_0x105e55){while(--_0x105e55){_0x3c4062['push'](_0x3c4062['shift']());}};_0x3f5bf3(++_0x3767fc);}(_0x66ad,0x1c3));var _0xd66a=function(_0xc77b01,_0x5650e2){_0xc77b01=_0xc77b01-0x0;var _0x1d10c5=_0x66ad[_0xc77b01];return _0x1d10c5;};'use strict';var client=require('../../client');exports[_0xd66a('0x0')]=function(){return function(_0x11b4a9){return client[_0xd66a('0x1')](_0xd66a('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xd66a('0x3'),_0xd66a('0x4'),'token',_0xd66a('0x5'),_0xd66a('0x6'),_0xd66a('0x7'),'type'],'include':[{'model':'ZendeskConfiguration','as':_0xd66a('0x8'),'attributes':['id','name'],'include':[{'model':_0xd66a('0x9'),'attributes':['id','name']},{'model':_0xd66a('0xa'),'as':'Subjects','attributes':['id',_0xd66a('0xb'),'content',_0xd66a('0xc')],'include':[{'model':'Variable','as':_0xd66a('0xd'),'attributes':['id','name']}]},{'model':'ZendeskField','as':_0xd66a('0xe'),'attributes':['id',_0xd66a('0xb'),'content',_0xd66a('0xf'),_0xd66a('0x10'),'keyContent',_0xd66a('0xc')],'include':[{'model':_0xd66a('0xd'),'as':_0xd66a('0xd'),'attributes':['id',_0xd66a('0x11')]}]},{'model':_0xd66a('0xa'),'as':'Fields','attributes':['id',_0xd66a('0xb'),_0xd66a('0x12'),'idField','nameField',_0xd66a('0x13'),'variableName'],'include':[{'model':'Variable','as':_0xd66a('0xd'),'attributes':['id',_0xd66a('0x11')]}]}]}]},'log':_0xd66a('0x2')});};};
\ No newline at end of file
+var _0x3e98=['name','ZendeskField','Subjects','Variable','Descriptions','content','variableName','Fields','idField','nameField','customField','../../client','getZendeskAccounts','Request','GetZendeskAccount','username','token','remoteUri','authType','serverUrl','type','Configurations'];(function(_0x2b61f6,_0x166d6a){var _0x4d6836=function(_0x123e19){while(--_0x123e19){_0x2b61f6['push'](_0x2b61f6['shift']());}};_0x4d6836(++_0x166d6a);}(_0x3e98,0x181));var _0x83e9=function(_0x458edc,_0x9baf98){_0x458edc=_0x458edc-0x0;var _0x44af29=_0x3e98[_0x458edc];return _0x44af29;};'use strict';var client=require(_0x83e9('0x0'));exports[_0x83e9('0x1')]=function(){return function(_0x5421ae){return client[_0x83e9('0x2')](_0x83e9('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x83e9('0x4'),'password',_0x83e9('0x5'),_0x83e9('0x6'),_0x83e9('0x7'),_0x83e9('0x8'),_0x83e9('0x9')],'include':[{'model':'ZendeskConfiguration','as':_0x83e9('0xa'),'attributes':['id',_0x83e9('0xb')],'include':[{'model':'Tag','attributes':['id','name']},{'model':_0x83e9('0xc'),'as':_0x83e9('0xd'),'attributes':['id',_0x83e9('0x9'),'content','variableName'],'include':[{'model':_0x83e9('0xe'),'as':_0x83e9('0xe'),'attributes':['id','name']}]},{'model':_0x83e9('0xc'),'as':_0x83e9('0xf'),'attributes':['id',_0x83e9('0x9'),_0x83e9('0x10'),'key','keyType','keyContent',_0x83e9('0x11')],'include':[{'model':_0x83e9('0xe'),'as':_0x83e9('0xe'),'attributes':['id',_0x83e9('0xb')]}]},{'model':_0x83e9('0xc'),'as':_0x83e9('0x12'),'attributes':['id',_0x83e9('0x9'),_0x83e9('0x10'),_0x83e9('0x13'),_0x83e9('0x14'),_0x83e9('0x15'),_0x83e9('0x11')],'include':[{'model':_0x83e9('0xe'),'as':_0x83e9('0xe'),'attributes':['id',_0x83e9('0xb')]}]}]}]},'log':_0x83e9('0x3')});};};
\ No newline at end of file
index c52df70..f136dd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6def=['host','serverUrl','ZohoConfiguration','Configurations','ZohoField','Subjects','type','content','variableName','Variable','Descriptions','key','keyType','keyContent','Fields','idField','nameField','customField','GetZohoAccount','../../client','getZohoAccounts','Request','name','authToken'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6def,0x1c3));var _0xf6de=function(_0x5dbb0d,_0x3e1b74){_0x5dbb0d=_0x5dbb0d-0x0;var _0x390492=_0x6def[_0x5dbb0d];return _0x390492;};'use strict';var client=require(_0xf6de('0x0'));exports[_0xf6de('0x1')]=function(){return function(_0x4cb7fd){return client[_0xf6de('0x2')]('GetZohoAccount',{'options':{'raw':![],'attributes':['id',_0xf6de('0x3'),'description',_0xf6de('0x4'),_0xf6de('0x5'),_0xf6de('0x6')],'include':[{'model':_0xf6de('0x7'),'as':_0xf6de('0x8'),'attributes':['id',_0xf6de('0x3')],'include':[{'model':_0xf6de('0x9'),'as':_0xf6de('0xa'),'attributes':['id',_0xf6de('0xb'),_0xf6de('0xc'),_0xf6de('0xd')],'include':[{'model':'Variable','as':_0xf6de('0xe'),'attributes':['id',_0xf6de('0x3')]}]},{'model':_0xf6de('0x9'),'as':_0xf6de('0xf'),'attributes':['id',_0xf6de('0xb'),_0xf6de('0xc'),_0xf6de('0x10'),_0xf6de('0x11'),_0xf6de('0x12'),_0xf6de('0xd')],'include':[{'model':_0xf6de('0xe'),'as':_0xf6de('0xe'),'attributes':['id',_0xf6de('0x3')]}]},{'model':_0xf6de('0x9'),'as':_0xf6de('0x13'),'attributes':['id','type',_0xf6de('0xc'),_0xf6de('0x14'),_0xf6de('0x15'),_0xf6de('0x16'),_0xf6de('0xd')],'include':[{'model':_0xf6de('0xe'),'as':_0xf6de('0xe'),'attributes':['id',_0xf6de('0x3')]}]}]}]},'log':_0xf6de('0x17')});};};
\ No newline at end of file
+var _0xf481=['../../client','getZohoAccounts','GetZohoAccount','description','host','serverUrl','Configurations','name','ZohoField','Subjects','type','content','variableName','Variable','Descriptions','key','keyType','keyContent','Fields','nameField','customField'];(function(_0x18b5e8,_0x51e875){var _0x25baed=function(_0x3fcdf9){while(--_0x3fcdf9){_0x18b5e8['push'](_0x18b5e8['shift']());}};_0x25baed(++_0x51e875);}(_0xf481,0x126));var _0x1f48=function(_0x115d8d,_0xacde78){_0x115d8d=_0x115d8d-0x0;var _0x250c76=_0xf481[_0x115d8d];return _0x250c76;};'use strict';var client=require(_0x1f48('0x0'));exports[_0x1f48('0x1')]=function(){return function(_0x4b377c){return client['Request'](_0x1f48('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x1f48('0x3'),'authToken',_0x1f48('0x4'),_0x1f48('0x5')],'include':[{'model':'ZohoConfiguration','as':_0x1f48('0x6'),'attributes':['id',_0x1f48('0x7')],'include':[{'model':_0x1f48('0x8'),'as':_0x1f48('0x9'),'attributes':['id',_0x1f48('0xa'),_0x1f48('0xb'),_0x1f48('0xc')],'include':[{'model':_0x1f48('0xd'),'as':_0x1f48('0xd'),'attributes':['id',_0x1f48('0x7')]}]},{'model':_0x1f48('0x8'),'as':_0x1f48('0xe'),'attributes':['id','type','content',_0x1f48('0xf'),_0x1f48('0x10'),_0x1f48('0x11'),_0x1f48('0xc')],'include':[{'model':_0x1f48('0xd'),'as':_0x1f48('0xd'),'attributes':['id',_0x1f48('0x7')]}]},{'model':'ZohoField','as':_0x1f48('0x12'),'attributes':['id','type',_0x1f48('0xb'),'idField',_0x1f48('0x13'),_0x1f48('0x14'),_0x1f48('0xc')],'include':[{'model':_0x1f48('0xd'),'as':_0x1f48('0xd'),'attributes':['id',_0x1f48('0x7')]}]}]}]},'log':_0x1f48('0x2')});};};
\ No newline at end of file
index aabce68..0c2571f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5204=['lodash','voiceQueueReport','queuecallerexitAt','CreateMemberReport','voice','lastAssignedTo','SIP/','TALKING','queuecallerleaveAt','diff','seconds','calleridnum','exten','agent','accountcode','voiceDialReport','channel','split','endtime','starttime','outbound','dialstring','toNumber','uniqueid'];(function(_0x6fa50a,_0x15f7a6){var _0x2e65aa=function(_0x4fac7a){while(--_0x4fac7a){_0x6fa50a['push'](_0x6fa50a['shift']());}};_0x2e65aa(++_0x15f7a6);}(_0x5204,0x1b0));var _0x4520=function(_0x4812e0,_0x2ccf3c){_0x4812e0=_0x4812e0-0x0;var _0x252e0f=_0x5204[_0x4812e0];return _0x252e0f;};'use strict';var moment=require('moment');var _=require(_0x4520('0x0'));var client=require('../client');exports[_0x4520('0x1')]=function(_0x349f79){var _0x3863ba=_0x349f79['queuecallercompleteAt']||_0x349f79[_0x4520('0x2')];return client['Request'](_0x4520('0x3'),{'body':{'channel':_0x4520('0x4'),'membername':_0x349f79[_0x4520('0x5')],'interface':_0x4520('0x6')+_0x349f79[_0x4520('0x5')],'type':_0x4520('0x7'),'enterAt':_0x349f79[_0x4520('0x8')],'exitAt':_0x3863ba,'duration':moment(_0x3863ba)[_0x4520('0x9')](_0x349f79['queuecallerleaveAt'],_0x4520('0xa')),'data1':'inbound','data2':_0x349f79[_0x4520('0xb')],'data3':_0x349f79[_0x4520('0xc')],'data4':null,'data5':_0x349f79['queue'],'role':_0x4520('0xd'),'internal':_0x349f79[_0x4520('0xe')]?_['toNumber'](_0x349f79[_0x4520('0xe')]):undefined,'uniqueid':_0x349f79['uniqueid']},'log':_0x4520('0x3')});};exports[_0x4520('0xf')]=function(_0x47726f){return client['Request'](_0x4520('0x3'),{'body':{'channel':_0x4520('0x4'),'membername':_0x47726f[_0x4520('0x10')]?_0x47726f[_0x4520('0x10')][_0x4520('0x11')](/\/|-/)[0x1]:undefined,'interface':_0x47726f[_0x4520('0x10')]?_0x47726f[_0x4520('0x10')][_0x4520('0x11')]('-')[0x0]:undefined,'type':_0x4520('0x7'),'enterAt':_0x47726f['starttime'],'exitAt':_0x47726f[_0x4520('0x12')],'duration':moment(_0x47726f[_0x4520('0x12')])[_0x4520('0x9')](_0x47726f['starttime'],'seconds')>=0x0?moment(_0x47726f[_0x4520('0x12')])['diff'](_0x47726f[_0x4520('0x13')],'seconds'):null,'data1':_0x4520('0x14'),'data2':_0x47726f[_0x4520('0xe')],'data3':_0x47726f['exten'],'data4':_0x47726f[_0x4520('0x15')]||null,'role':_0x4520('0xd'),'internal':_0x47726f[_0x4520('0xe')]?_[_0x4520('0x16')](_0x47726f[_0x4520('0xe')]):undefined,'uniqueid':_0x47726f[_0x4520('0x17')]},'log':_0x4520('0x3')});};
\ No newline at end of file
+var _0xf980=['SIP/','TALKING','queuecallerleaveAt','seconds','inbound','calleridnum','exten','agent','toNumber','uniqueid','voiceDialReport','channel','split','endtime','diff','starttime','outbound','accountcode','dialstring','moment','lodash','voiceQueueReport','queuecallercompleteAt','Request','CreateMemberReport','voice','lastAssignedTo'];(function(_0x593831,_0x1f26b6){var _0x389ff7=function(_0x31c495){while(--_0x31c495){_0x593831['push'](_0x593831['shift']());}};_0x389ff7(++_0x1f26b6);}(_0xf980,0xd0));var _0x0f98=function(_0x53c2ec,_0x56b6f8){_0x53c2ec=_0x53c2ec-0x0;var _0xbd4cd0=_0xf980[_0x53c2ec];return _0xbd4cd0;};'use strict';var moment=require(_0x0f98('0x0'));var _=require(_0x0f98('0x1'));var client=require('../client');exports[_0x0f98('0x2')]=function(_0x50f230){var _0x4db7a8=_0x50f230[_0x0f98('0x3')]||_0x50f230['queuecallerexitAt'];return client[_0x0f98('0x4')](_0x0f98('0x5'),{'body':{'channel':_0x0f98('0x6'),'membername':_0x50f230[_0x0f98('0x7')],'interface':_0x0f98('0x8')+_0x50f230[_0x0f98('0x7')],'type':_0x0f98('0x9'),'enterAt':_0x50f230[_0x0f98('0xa')],'exitAt':_0x4db7a8,'duration':moment(_0x4db7a8)['diff'](_0x50f230['queuecallerleaveAt'],_0x0f98('0xb')),'data1':_0x0f98('0xc'),'data2':_0x50f230[_0x0f98('0xd')],'data3':_0x50f230[_0x0f98('0xe')],'data4':null,'data5':_0x50f230['queue'],'role':_0x0f98('0xf'),'internal':_0x50f230['accountcode']?_[_0x0f98('0x10')](_0x50f230['accountcode']):undefined,'uniqueid':_0x50f230[_0x0f98('0x11')]},'log':_0x0f98('0x5')});};exports[_0x0f98('0x12')]=function(_0x8ef51e){return client['Request'](_0x0f98('0x5'),{'body':{'channel':_0x0f98('0x6'),'membername':_0x8ef51e['channel']?_0x8ef51e[_0x0f98('0x13')][_0x0f98('0x14')](/\/|-/)[0x1]:undefined,'interface':_0x8ef51e[_0x0f98('0x13')]?_0x8ef51e[_0x0f98('0x13')][_0x0f98('0x14')]('-')[0x0]:undefined,'type':_0x0f98('0x9'),'enterAt':_0x8ef51e['starttime'],'exitAt':_0x8ef51e[_0x0f98('0x15')],'duration':moment(_0x8ef51e['endtime'])[_0x0f98('0x16')](_0x8ef51e[_0x0f98('0x17')],'seconds')>=0x0?moment(_0x8ef51e[_0x0f98('0x15')])[_0x0f98('0x16')](_0x8ef51e[_0x0f98('0x17')],'seconds'):null,'data1':_0x0f98('0x18'),'data2':_0x8ef51e[_0x0f98('0x19')],'data3':_0x8ef51e[_0x0f98('0xe')],'data4':_0x8ef51e[_0x0f98('0x1a')]||null,'role':'agent','internal':_0x8ef51e[_0x0f98('0x19')]?_[_0x0f98('0x10')](_0x8ef51e['accountcode']):undefined,'uniqueid':_0x8ef51e[_0x0f98('0x11')]},'log':'CreateMemberReport'});};
\ No newline at end of file
index b6f614f..35f6a25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd95f=['html','GetTemplate','getTemplates'];(function(_0x497ce9,_0x29315e){var _0x2eac22=function(_0x5cef5a){while(--_0x5cef5a){_0x497ce9['push'](_0x497ce9['shift']());}};_0x2eac22(++_0x29315e);}(_0xd95f,0x101));var _0xfd95=function(_0x33d90a,_0x16bdc6){_0x33d90a=_0x33d90a-0x0;var _0x3ec590=_0xd95f[_0x33d90a];return _0x3ec590;};'use strict';var client=require('../client');exports[_0xfd95('0x0')]=function(_0x45d17c){return function(_0x1c69b6){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id','name',_0xfd95('0x1')]},'log':_0xfd95('0x2')});};};
\ No newline at end of file
+var _0xa78f=['getTemplates','Request','GetTemplate','name','../client'];(function(_0x11ba46,_0x1d6752){var _0x1c8c6f=function(_0x4cf96f){while(--_0x4cf96f){_0x11ba46['push'](_0x11ba46['shift']());}};_0x1c8c6f(++_0x1d6752);}(_0xa78f,0x7c));var _0xfa78=function(_0x1ea6eb,_0x33d3d4){_0x1ea6eb=_0x1ea6eb-0x0;var _0x127200=_0xa78f[_0x1ea6eb];return _0x127200;};'use strict';var client=require(_0xfa78('0x0'));exports[_0xfa78('0x1')]=function(_0x15e411){return function(_0x29aca8){return client[_0xfa78('0x2')](_0xfa78('0x3'),{'options':{'raw':!![],'attributes':['id',_0xfa78('0x4'),'html']},'log':'GetTemplate'});};};
\ No newline at end of file
index e362352..4993039 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x3bd576,_0x27f261){var _0x12c459=function(_0x5748a5){while(--_0x5748a5){_0x3bd576['push'](_0x3bd576['shift']());}};_0x12c459(++_0x27f261);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};};
\ No newline at end of file
+var _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x9e0b81,_0x1cef77){var _0xd0c21e=function(_0x455ac9){while(--_0x455ac9){_0x9e0b81['push'](_0x9e0b81['shift']());}};_0xd0c21e(++_0x1cef77);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};};
\ No newline at end of file
index 20131ef..a9fc854 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b91=['getTrunks','Request','GetTrunk','name','registry','../client'];(function(_0x2df204,_0x2cf8c5){var _0x37396c=function(_0x157df5){while(--_0x157df5){_0x2df204['push'](_0x2df204['shift']());}};_0x37396c(++_0x2cf8c5);}(_0x3b91,0x65));var _0x13b9=function(_0x1085fd,_0x3400c9){_0x1085fd=_0x1085fd-0x0;var _0x294634=_0x3b91[_0x1085fd];return _0x294634;};'use strict';var client=require(_0x13b9('0x0'));exports[_0x13b9('0x1')]=function(_0x4358d5){return function(_0x591c02){return client[_0x13b9('0x2')](_0x13b9('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x13b9('0x4'),_0x13b9('0x5')]},'log':'GetTrunk'});};};
\ No newline at end of file
+var _0x7ee0=['../client','getTrunks','Request','GetTrunk','name','registry'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x7ee0,0x14a));var _0x07ee=function(_0xe02986,_0x5c3a60){_0xe02986=_0xe02986-0x0;var _0x1a014a=_0x7ee0[_0xe02986];return _0x1a014a;};'use strict';var client=require(_0x07ee('0x0'));exports[_0x07ee('0x1')]=function(_0x57054b){return function(_0x5313d5){return client[_0x07ee('0x2')](_0x07ee('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x07ee('0x4'),_0x07ee('0x5')]},'log':_0x07ee('0x3')});};};
\ No newline at end of file
index d55afd0..ae2d8d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffcd=['fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','getTelephones','savePause','saveUnpause','UnpauseUser','getAgent','ShowUser','email','../client','getAgents','Request','GetUser','name','accountcode'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xffcd,0x1c8));var _0xdffc=function(_0x480c08,_0x22df15){_0x480c08=_0x480c08-0x0;var _0x38b58d=_0xffcd[_0x480c08];return _0x38b58d;};'use strict';var client=require(_0xdffc('0x0'));exports[_0xdffc('0x1')]=function(){return function(){return client[_0xdffc('0x2')](_0xdffc('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0xdffc('0x4'),'email',_0xdffc('0x5'),_0xdffc('0x6'),_0xdffc('0x7'),_0xdffc('0x8'),_0xdffc('0x9'),_0xdffc('0xa'),_0xdffc('0xb'),_0xdffc('0xc'),_0xdffc('0xd')]},'log':_0xdffc('0x1')});};};exports[_0xdffc('0xe')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0xdffc('0x4')]},'log':'getTelephones'});};};exports['savePause']=function(_0x4258d8,_0x265e51,_0x211a97){return client[_0xdffc('0x2')]('PauseUser',{'body':{'type':_0x265e51,'uniqueid':_0x211a97},'options':{'where':{'id':_0x4258d8['id']}},'log':_0xdffc('0xf')});};exports[_0xdffc('0x10')]=function(_0x2a33df){return client[_0xdffc('0x2')](_0xdffc('0x11'),{'body':{},'options':{'where':{'id':_0x2a33df['id']}},'log':_0xdffc('0xf')});};exports[_0xdffc('0x12')]=function(_0x5d1abe){return client[_0xdffc('0x2')](_0xdffc('0x13'),{'options':{'raw':![],'where':{'role':'agent','id':_0x5d1abe},'attributes':['id','name',_0xdffc('0x14'),_0xdffc('0x5'),'fullname',_0xdffc('0x7'),_0xdffc('0x8'),_0xdffc('0x9'),_0xdffc('0xa'),_0xdffc('0xb')]},'log':_0xdffc('0x12')});};
\ No newline at end of file
+var _0x8cea=['online','pauseType','lastPauseAt','voicePause','phone','mobile','getTelephones','name','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastLoginAt','../client','Request','GetUser','email','accountcode','fullname'];(function(_0x474bf9,_0x1a3884){var _0x383308=function(_0x2412cb){while(--_0x2412cb){_0x474bf9['push'](_0x474bf9['shift']());}};_0x383308(++_0x1a3884);}(_0x8cea,0x144));var _0xa8ce=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x8cea[_0x4bfac3];return _0x15f0f2;};'use strict';var client=require(_0xa8ce('0x0'));exports['getAgents']=function(){return function(){return client[_0xa8ce('0x1')](_0xa8ce('0x2'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id','name',_0xa8ce('0x3'),_0xa8ce('0x4'),_0xa8ce('0x5'),_0xa8ce('0x6'),'lastLoginAt',_0xa8ce('0x7'),_0xa8ce('0x8'),_0xa8ce('0x9'),_0xa8ce('0xa'),_0xa8ce('0xb')]},'log':'getAgents'});};};exports[_0xa8ce('0xc')]=function(){return function(){return client[_0xa8ce('0x1')](_0xa8ce('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0xa8ce('0xd')]},'log':_0xa8ce('0xc')});};};exports[_0xa8ce('0xe')]=function(_0x7a2807,_0x2439cc,_0x2e5401){return client[_0xa8ce('0x1')](_0xa8ce('0xf'),{'body':{'type':_0x2439cc,'uniqueid':_0x2e5401},'options':{'where':{'id':_0x7a2807['id']}},'log':_0xa8ce('0xe')});};exports[_0xa8ce('0x10')]=function(_0x5e6d54){return client['Request'](_0xa8ce('0x11'),{'body':{},'options':{'where':{'id':_0x5e6d54['id']}},'log':_0xa8ce('0xe')});};exports[_0xa8ce('0x12')]=function(_0x19eded){return client[_0xa8ce('0x1')](_0xa8ce('0x13'),{'options':{'raw':![],'where':{'role':_0xa8ce('0x14'),'id':_0x19eded},'attributes':['id',_0xa8ce('0xd'),_0xa8ce('0x3'),'accountcode',_0xa8ce('0x5'),_0xa8ce('0x6'),_0xa8ce('0x15'),_0xa8ce('0x7'),'lastPauseAt','voicePause']},'log':_0xa8ce('0x12')});};
\ No newline at end of file
index 754f425..15efd05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fb2=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x4c4f87,_0x3116c3){var _0x47c5f5=function(_0x36420e){while(--_0x36420e){_0x4c4f87['push'](_0x4c4f87['shift']());}};_0x47c5f5(++_0x3116c3);}(_0x0fb2,0x1ad));var _0x20fb=function(_0x30bd66,_0x36a93d){_0x30bd66=_0x30bd66-0x0;var _0x74c9dd=_0x0fb2[_0x30bd66];return _0x74c9dd;};'use strict';var client=require(_0x20fb('0x0'));exports[_0x20fb('0x1')]=function(_0x4cea43){return client[_0x20fb('0x2')](_0x20fb('0x3'),{'body':_0x4cea43,'log':_0x20fb('0x3')});};exports[_0x20fb('0x4')]=function(_0x51d6b0,_0x589e00,_0x20998d){return client[_0x20fb('0x2')](_0x20fb('0x5'),{'body':_0x51d6b0,'options':{'where':{'uniqueid':_0x589e00,'interface':_0x20998d}},'log':_0x20fb('0x5')});};
\ No newline at end of file
+var _0xe9b5=['create','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport','../client'];(function(_0x2a3c4d,_0x9c6b37){var _0x55c390=function(_0x4871cf){while(--_0x4871cf){_0x2a3c4d['push'](_0x2a3c4d['shift']());}};_0x55c390(++_0x9c6b37);}(_0xe9b5,0x119));var _0x5e9b=function(_0x2a9220,_0x2fa9d4){_0x2a9220=_0x2a9220-0x0;var _0xae5c45=_0xe9b5[_0x2a9220];return _0xae5c45;};'use strict';var client=require(_0x5e9b('0x0'));exports[_0x5e9b('0x1')]=function(_0x4e3b49){return client['Request']('CreateVoiceAgentReport',{'body':_0x4e3b49,'log':_0x5e9b('0x2')});};exports[_0x5e9b('0x3')]=function(_0xd2b849,_0x472687,_0x226427){return client[_0x5e9b('0x4')](_0x5e9b('0x5'),{'body':_0xd2b849,'options':{'where':{'uniqueid':_0x472687,'interface':_0x226427}},'log':_0x5e9b('0x5')});};
\ No newline at end of file
index 82021b8..636f79d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdacb=['util','lodash','../client','create','Request','merge','calleridnum','context','getVoiceCallReports','day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','GetVoiceCallReports'];(function(_0x456270,_0x32842b){var _0x4b13cf=function(_0x196b4e){while(--_0x196b4e){_0x456270['push'](_0x456270['shift']());}};_0x4b13cf(++_0x32842b);}(_0xdacb,0x1ce));var _0xbdac=function(_0x487fcd,_0x24c2ff){_0x487fcd=_0x487fcd-0x0;var _0x561e18=_0xdacb[_0x487fcd];return _0x561e18;};'use strict';var moment=require('moment');var util=require(_0xbdac('0x0'));var _=require(_0xbdac('0x1'));var client=require(_0xbdac('0x2'));exports[_0xbdac('0x3')]=function(_0x57418d){return client[_0xbdac('0x4')]('CreateVoiceCallReport',{'body':_[_0xbdac('0x5')](_0x57418d,{'source':_0x57418d[_0xbdac('0x6')],'destinationcontext':_0x57418d[_0xbdac('0x7')],'callerid':_0x57418d['callerid'],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0xbdac('0x8')]=function(){return function(){return client[_0xbdac('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0xbdac('0x9'))[_0xbdac('0xa')](_0xbdac('0xb')),moment()['endOf']('day')[_0xbdac('0xa')](_0xbdac('0xb'))]}},'attributes':['type',_0xbdac('0xc'),'duration','billableseconds']},'log':_0xbdac('0xd')});};};
\ No newline at end of file
+var _0xd32e=['util','lodash','../client','create','merge','calleridnum','callerid','DOCUMENTATION','CreateVoiceCallReport','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','moment'];(function(_0x4dcfb5,_0x3f42a6){var _0x4015b9=function(_0x39e6a4){while(--_0x39e6a4){_0x4dcfb5['push'](_0x4dcfb5['shift']());}};_0x4015b9(++_0x3f42a6);}(_0xd32e,0xa7));var _0xed32=function(_0x2c10c0,_0x16bf04){_0x2c10c0=_0x2c10c0-0x0;var _0x4d882a=_0xd32e[_0x2c10c0];return _0x4d882a;};'use strict';var moment=require(_0xed32('0x0'));var util=require(_0xed32('0x1'));var _=require(_0xed32('0x2'));var client=require(_0xed32('0x3'));exports[_0xed32('0x4')]=function(_0x3834d5){return client['Request']('CreateVoiceCallReport',{'body':_[_0xed32('0x5')](_0x3834d5,{'source':_0x3834d5[_0xed32('0x6')],'destinationcontext':_0x3834d5['context'],'callerid':_0x3834d5[_0xed32('0x7')],'amaflags':_0xed32('0x8')}),'log':_0xed32('0x9')});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0xed32('0xa'),{'options':{'where':{'type':[_0xed32('0xb')],'createdAt':{'$between':[moment()['startOf'](_0xed32('0xc'))[_0xed32('0xd')](_0xed32('0xe')),moment()[_0xed32('0xf')](_0xed32('0xc'))[_0xed32('0xd')](_0xed32('0xe'))]}},'attributes':[_0xed32('0x10'),_0xed32('0x11'),_0xed32('0x12'),_0xed32('0x13')]},'log':_0xed32('0x14')});};};
\ No newline at end of file
index 5cb782e..44b3893 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';var client=require('../client');exports['create']=function(_0x25f2e0){return client['Request']('CreateVoiceDialReport',{'body':_0x25f2e0,'log':'CreateVoiceDialReport'});};
\ No newline at end of file
+var _0xcc55=['Request','CreateVoiceDialReport','create'];(function(_0x4a7040,_0x297839){var _0x543edb=function(_0x4645de){while(--_0x4645de){_0x4a7040['push'](_0x4a7040['shift']());}};_0x543edb(++_0x297839);}(_0xcc55,0xdd));var _0x5cc5=function(_0x336fba,_0x185ecb){_0x336fba=_0x336fba-0x0;var _0x17e896=_0xcc55[_0x336fba];return _0x17e896;};'use strict';var client=require('../client');exports[_0x5cc5('0x0')]=function(_0x271cd1){return client[_0x5cc5('0x1')](_0x5cc5('0x2'),{'body':_0x271cd1,'log':_0x5cc5('0x2')});};
\ No newline at end of file
index 4b18181..bd3ff59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcee3=['GetVoiceExtension','recordingFormat','getVoiceExtensions'];(function(_0xfd4788,_0x4ee7be){var _0x4ab3ec=function(_0x303989){while(--_0x303989){_0xfd4788['push'](_0xfd4788['shift']());}};_0x4ab3ec(++_0x4ee7be);}(_0xcee3,0x197));var _0x3cee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcee3[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x3cee('0x0')]=function(){return function(){return client['Request'](_0x3cee('0x1'),{'options':{'raw':!![],'attributes':['id','exten',_0x3cee('0x2')],'where':{'VoiceExtensionId':null}},'log':_0x3cee('0x0')});};};
\ No newline at end of file
+var _0x27bd=['getVoiceExtensions','Request','GetVoiceExtension','recordingFormat','../client'];(function(_0x4ae92f,_0x350108){var _0x7d6d22=function(_0x443d0c){while(--_0x443d0c){_0x4ae92f['push'](_0x4ae92f['shift']());}};_0x7d6d22(++_0x350108);}(_0x27bd,0x199));var _0xd27b=function(_0x42663d,_0x491d98){_0x42663d=_0x42663d-0x0;var _0x26f1e8=_0x27bd[_0x42663d];return _0x26f1e8;};'use strict';var client=require(_0xd27b('0x0'));exports[_0xd27b('0x1')]=function(){return function(){return client[_0xd27b('0x2')](_0xd27b('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0xd27b('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xd27b('0x1')});};};
\ No newline at end of file
index 6b50518..5a74ab9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6000=['name','acw','autopause','monitor_format','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','callerid','active','Interval','../client','getVoiceQueues','Request','GetVoiceQueue'];(function(_0xdbf424,_0x3f2a41){var _0x54520e=function(_0x8f9e5e){while(--_0x8f9e5e){_0xdbf424['push'](_0xdbf424['shift']());}};_0x54520e(++_0x3f2a41);}(_0x6000,0x17c));var _0x0600=function(_0x40aa22,_0x1f1717){_0x40aa22=_0x40aa22-0x0;var _0x4ae27f=_0x6000[_0x40aa22];return _0x4ae27f;};'use strict';var client=require(_0x0600('0x0'));exports[_0x0600('0x1')]=function(){return function(){return client[_0x0600('0x2')](_0x0600('0x3'),{'options':{'raw':![],'attributes':['id',_0x0600('0x4'),_0x0600('0x5'),'acwTimeout',_0x0600('0x6'),_0x0600('0x7'),'type',_0x0600('0x8'),'dialMethod',_0x0600('0x9'),_0x0600('0xa'),_0x0600('0xb'),'dialPredictiveOptimization',_0x0600('0xc'),'dialPredictiveInterval',_0x0600('0xd'),_0x0600('0xe'),_0x0600('0xf'),_0x0600('0x10'),_0x0600('0x11'),_0x0600('0x12'),_0x0600('0x13'),_0x0600('0x14'),'dialBusyMaxRetry',_0x0600('0x15'),_0x0600('0x16'),'dialNoAnswerRetryFrequency',_0x0600('0x17'),_0x0600('0x18'),_0x0600('0x19'),'dialPrefix',_0x0600('0x1a'),'dialAMDActive',_0x0600('0x1b'),_0x0600('0x1c'),_0x0600('0x1d'),_0x0600('0x1e'),_0x0600('0x1f'),'dialAMDBetweenWordsSilence',_0x0600('0x20'),_0x0600('0x21'),'dialAMDMaximumWordLength',_0x0600('0x22'),_0x0600('0x23'),_0x0600('0x24'),_0x0600('0x25'),_0x0600('0x26'),_0x0600('0x27'),_0x0600('0x28'),'monitor_format',_0x0600('0x29'),_0x0600('0x2a'),_0x0600('0x2b')],'include':[{'model':'Trunk','as':_0x0600('0x2c'),'attributes':['id',_0x0600('0x4'),_0x0600('0x2d'),_0x0600('0x2e')]},{'model':_0x0600('0x2c'),'as':'TrunkBackup','attributes':['id',_0x0600('0x4'),_0x0600('0x2d'),_0x0600('0x2e')]},{'model':_0x0600('0x2f'),'as':'Interval','attributes':['id',_0x0600('0x4')],'include':[{'model':_0x0600('0x2f'),'as':'Intervals','attributes':['id',_0x0600('0x4'),'interval']}]}]},'log':_0x0600('0x1')});};};
\ No newline at end of file
+var _0x4c99=['dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialCutDigit','Trunk','name','callerid','active','Interval','Intervals','interval','getVoiceQueues','../client','Request','acwTimeout','autopause','type','dialActive','dialLimitChannel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout'];(function(_0x45fe9c,_0x55e0d7){var _0x233d48=function(_0xa2ba2e){while(--_0xa2ba2e){_0x45fe9c['push'](_0x45fe9c['shift']());}};_0x233d48(++_0x55e0d7);}(_0x4c99,0x1ec));var _0x94c9=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x4c99[_0x26462c];return _0x509a42;};'use strict';var client=require(_0x94c9('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x94c9('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name','acw',_0x94c9('0x2'),_0x94c9('0x3'),'monitor_format',_0x94c9('0x4'),_0x94c9('0x5'),'dialMethod',_0x94c9('0x6'),'dialLimitQueue','dialPowerLevel','dialPredictiveOptimization',_0x94c9('0x7'),_0x94c9('0x8'),_0x94c9('0x9'),_0x94c9('0xa'),_0x94c9('0xb'),_0x94c9('0xc'),_0x94c9('0xd'),_0x94c9('0xe'),_0x94c9('0xf'),_0x94c9('0x10'),'dialBusyMaxRetry',_0x94c9('0x11'),_0x94c9('0x12'),_0x94c9('0x13'),'dialGlobalMaxRetry',_0x94c9('0x14'),_0x94c9('0x15'),_0x94c9('0x16'),_0x94c9('0x17'),_0x94c9('0x18'),_0x94c9('0x19'),_0x94c9('0x1a'),_0x94c9('0x1b'),'dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0x94c9('0x1c'),_0x94c9('0x1d'),'dialAMDMaximumWordLength',_0x94c9('0x1e'),_0x94c9('0x1f'),_0x94c9('0x20'),'dialOrderByScheduledAt','dialAgiAfterHangupAgent',_0x94c9('0x21'),_0x94c9('0x22'),_0x94c9('0x23'),_0x94c9('0x24'),'dialRandomLastDigitCallerIdNumber',_0x94c9('0x25')],'include':[{'model':_0x94c9('0x26'),'as':_0x94c9('0x26'),'attributes':['id',_0x94c9('0x27'),_0x94c9('0x28'),_0x94c9('0x29')]},{'model':_0x94c9('0x26'),'as':'TrunkBackup','attributes':['id',_0x94c9('0x27'),_0x94c9('0x28'),'active']},{'model':_0x94c9('0x2a'),'as':_0x94c9('0x2a'),'attributes':['id',_0x94c9('0x27')],'include':[{'model':_0x94c9('0x2a'),'as':_0x94c9('0x2b'),'attributes':['id',_0x94c9('0x27'),_0x94c9('0x2c')]}]}]},'log':_0x94c9('0x2d')});};};
\ No newline at end of file
index e99867a..26e337b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb62a=['format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','GetVoiceQueueReports','moment','lodash','Request','CreateVoiceQueueReport','getVoiceQueueReports','startOf','day'];(function(_0x3256b6,_0x379213){var _0x4f9a31=function(_0x33aedd){while(--_0x33aedd){_0x3256b6['push'](_0x3256b6['shift']());}};_0x4f9a31(++_0x379213);}(_0xb62a,0x175));var _0xab62=function(_0x5781c4,_0x2e7438){_0x5781c4=_0x5781c4-0x0;var _0x32996d=_0xb62a[_0x5781c4];return _0x32996d;};'use strict';var moment=require(_0xab62('0x0'));var _=require(_0xab62('0x1'));var client=require('../client');exports['create']=function(_0x18d4dc){return client[_0xab62('0x2')](_0xab62('0x3'),{'body':_0x18d4dc,'log':'CreateVoiceQueueReport'});};exports[_0xab62('0x4')]=function(){return function(){return client[_0xab62('0x2')]('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()[_0xab62('0x5')](_0xab62('0x6'))[_0xab62('0x7')](_0xab62('0x8')),moment()[_0xab62('0x9')](_0xab62('0x6'))[_0xab62('0x7')](_0xab62('0x8'))]}},'attributes':[_0xab62('0xa'),'queue',_0xab62('0xb'),_0xab62('0xc'),_0xab62('0xd'),_0xab62('0xe'),_0xab62('0xf'),_0xab62('0x10'),_0xab62('0x11'),'queuecallerabandonAt']},'log':_0xab62('0x12')});};};
\ No newline at end of file
+var _0xc19c=['../client','create','Request','CreateVoiceQueueReport','GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','queuecallerleaveAt','queuecallercompleteAt','queuecallerexit','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash'];(function(_0x255ac0,_0x3f6645){var _0x437bf1=function(_0x5baff0){while(--_0x5baff0){_0x255ac0['push'](_0x255ac0['shift']());}};_0x437bf1(++_0x3f6645);}(_0xc19c,0x96));var _0xcc19=function(_0x41f598,_0x42c54c){_0x41f598=_0x41f598-0x0;var _0x3bf658=_0xc19c[_0x41f598];return _0x3bf658;};'use strict';var moment=require(_0xcc19('0x0'));var _=require(_0xcc19('0x1'));var client=require(_0xcc19('0x2'));exports[_0xcc19('0x3')]=function(_0x27f3b9){return client[_0xcc19('0x4')](_0xcc19('0x5'),{'body':_0x27f3b9,'log':_0xcc19('0x5')});};exports['getVoiceQueueReports']=function(){return function(){return client[_0xcc19('0x4')](_0xcc19('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xcc19('0x7')](_0xcc19('0x8'))[_0xcc19('0x9')](_0xcc19('0xa')),moment()['endOf'](_0xcc19('0x8'))[_0xcc19('0x9')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xcc19('0xb'),_0xcc19('0xc'),'queuecallerjoinAt',_0xcc19('0xd'),'queuecallercomplete',_0xcc19('0xe'),_0xcc19('0xf'),'queuecallerexitAt',_0xcc19('0x10'),_0xcc19('0x11')]},'log':_0xcc19('0x12')});};};
\ No newline at end of file
index 22043ac..18f08b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b31=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0x31e06b,_0x1a6b08){var _0xd5c39a=function(_0x570c21){while(--_0x570c21){_0x31e06b['push'](_0x31e06b['shift']());}};_0xd5c39a(++_0x1a6b08);}(_0x7b31,0xb5));var _0x17b3=function(_0x24a7a1,_0x23bc7d){_0x24a7a1=_0x24a7a1-0x0;var _0x5e7af7=_0x7b31[_0x24a7a1];return _0x5e7af7;};'use strict';var client=require('../client');exports[_0x17b3('0x0')]=function(_0x204eab){return function(){return client[_0x17b3('0x1')](_0x17b3('0x2'),{'options':{'where':{'VoiceQueueId':_0x204eab,'paused':!![]},'raw':!![]},'log':_0x17b3('0x0')});};};
\ No newline at end of file
+var _0x5140=['Request','GetVoiceQueueRtPauses','../client'];(function(_0x26931e,_0x16f950){var _0x36bb27=function(_0x1bbcef){while(--_0x1bbcef){_0x26931e['push'](_0x26931e['shift']());}};_0x36bb27(++_0x16f950);}(_0x5140,0xa1));var _0x0514=function(_0x544d6e,_0x50eb78){_0x544d6e=_0x544d6e-0x0;var _0xa97a=_0x5140[_0x544d6e];return _0xa97a;};'use strict';var client=require(_0x0514('0x0'));exports['getVoiceQueueRtPauses']=function(_0x1ff44e){return function(){return client[_0x0514('0x1')](_0x0514('0x2'),{'options':{'where':{'VoiceQueueId':_0x1ff44e,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};};
\ No newline at end of file
index eb7ae6c..515b522 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fc0=['merge','monitorFilename','../client','create','Request'];(function(_0x5ef582,_0x27ad34){var _0x4ea436=function(_0x9adab7){while(--_0x9adab7){_0x5ef582['push'](_0x5ef582['shift']());}};_0x4ea436(++_0x27ad34);}(_0x6fc0,0x9d));var _0x06fc=function(_0x1213ef,_0x4477af){_0x1213ef=_0x1213ef-0x0;var _0x4b354a=_0x6fc0[_0x1213ef];return _0x4b354a;};'use strict';var _=require('lodash');var client=require(_0x06fc('0x0'));exports[_0x06fc('0x1')]=function(_0x418abf){return client[_0x06fc('0x2')]('CreateVoiceRecording',{'body':_[_0x06fc('0x3')](_0x418abf,{'value':_0x418abf[_0x06fc('0x4')]}),'log':'CreateVoiceRecording'});};
\ No newline at end of file
+var _0xa940=['CreateVoiceRecording','lodash','../client','create','Request'];(function(_0x5738fe,_0x2c8658){var _0x47984e=function(_0x57bcc5){while(--_0x57bcc5){_0x5738fe['push'](_0x5738fe['shift']());}};_0x47984e(++_0x2c8658);}(_0xa940,0x79));var _0x0a94=function(_0x57b97f,_0x1c5062){_0x57b97f=_0x57b97f-0x0;var _0x55e4b1=_0xa940[_0x57b97f];return _0x55e4b1;};'use strict';var _=require(_0x0a94('0x0'));var client=require(_0x0a94('0x1'));exports[_0x0a94('0x2')]=function(_0xcecf15){return client[_0x0a94('0x3')](_0x0a94('0x4'),{'body':_['merge'](_0xcecf15,{'value':_0xcecf15['monitorFilename']}),'log':'CreateVoiceRecording'});};
\ No newline at end of file
index f111514..fae0dea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf81e=['origtransfererexten','attended','blindTransfer','CreateVoiceTransferReport','result','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeaccountcode','transfereeexten','transfereelinkedid','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal'];(function(_0x4fbb86,_0x374ed0){var _0xb141fe=function(_0x382195){while(--_0x382195){_0x4fbb86['push'](_0x4fbb86['shift']());}};_0xb141fe(++_0x374ed0);}(_0xf81e,0x122));var _0xef81=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xf81e[_0x618414];return _0x21c19a;};'use strict';var client=require('../client');exports[_0xef81('0x0')]=function(_0x1b4307){return client['Request'](_0xef81('0x1'),{'body':{'result':_0x1b4307[_0xef81('0x2')],'transfererchannel':_0x1b4307['transfererchannel'],'transferercalleridnum':_0x1b4307['transferercalleridnum'],'transferercalleridname':_0x1b4307[_0xef81('0x3')],'transfererconnectedlinenum':_0x1b4307['transfererconnectedlinenum'],'transfererconnectedlinename':_0x1b4307[_0xef81('0x4')],'transfereraccountcode':_0x1b4307[_0xef81('0x5')],'transferercontext':_0x1b4307[_0xef81('0x6')],'transfererexten':_0x1b4307[_0xef81('0x7')],'transfererlinkedid':_0x1b4307['transfererlinkedid'],'transfereechannel':_0x1b4307[_0xef81('0x8')],'transfereecalleridnum':_0x1b4307[_0xef81('0x9')],'transfereecalleridname':_0x1b4307['transfereecalleridname'],'transfereeconnectedlinenum':_0x1b4307[_0xef81('0xa')],'transfereeconnectedlinename':_0x1b4307['transfereeconnectedlinename'],'transfereeaccountcode':_0x1b4307[_0xef81('0xb')],'transfereecontext':_0x1b4307['transfereecontext'],'transfereeexten':_0x1b4307[_0xef81('0xc')],'transfereelinkedid':_0x1b4307[_0xef81('0xd')],'isexternal':_0x1b4307['isexternal'],'context':_0x1b4307[_0xef81('0xe')],'extension':_0x1b4307[_0xef81('0xf')],'type':_0xef81('0x10')},'log':'CreateVoiceTransferReport'});};exports[_0xef81('0x11')]=function(_0x126ad7){return client['Request'](_0xef81('0x1'),{'body':{'result':_0x126ad7[_0xef81('0x2')],'transfererchannel':_0x126ad7[_0xef81('0x12')],'transferercalleridnum':_0x126ad7[_0xef81('0x13')],'transferercalleridname':_0x126ad7['origtransferercalleridname'],'transfererconnectedlinenum':_0x126ad7[_0xef81('0x14')],'transfererconnectedlinename':_0x126ad7[_0xef81('0x15')],'transfereraccountcode':_0x126ad7['origtransfereraccountcode'],'transferercontext':_0x126ad7['secondtransferercontext'],'transfererexten':_0x126ad7[_0xef81('0x16')],'transfererlinkedid':_0x126ad7[_0xef81('0x17')],'transfereechannel':_0x126ad7['transfertargetchannel'],'transfereecalleridnum':_0x126ad7['transfertargetcalleridnum'],'transfereecalleridname':_0x126ad7[_0xef81('0x18')],'transfereeconnectedlinenum':_0x126ad7[_0xef81('0x19')],'transfereeconnectedlinename':_0x126ad7['transfertargetconnectedlinename'],'transfereeaccountcode':_0x126ad7['transfertargetaccountcode'],'transfereecontext':_0x126ad7[_0xef81('0x1a')],'transfereeexten':_0x126ad7[_0xef81('0x1b')],'transfereelinkedid':_0x126ad7[_0xef81('0x1c')],'isexternal':_0x126ad7[_0xef81('0x1d')],'context':_0x126ad7['origtransferercontext'],'extension':_0x126ad7[_0xef81('0x1e')],'type':_0xef81('0x1f')},'log':_0xef81('0x1')});};
\ No newline at end of file
+var _0xdf8d=['secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','origtransfererexten','attended','../client','Request','result','transfererchannel','transferercalleridnum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','extension','blind','CreateVoiceTransferReport','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum'];(function(_0x349916,_0x5a4d25){var _0x5efff5=function(_0x2845f9){while(--_0x2845f9){_0x349916['push'](_0x349916['shift']());}};_0x5efff5(++_0x5a4d25);}(_0xdf8d,0x1ee));var _0xddf8=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0xdf8d[_0x1e6db3];return _0x1de886;};'use strict';var client=require(_0xddf8('0x0'));exports['blindTransfer']=function(_0x4b4f39){return client[_0xddf8('0x1')]('CreateVoiceTransferReport',{'body':{'result':_0x4b4f39[_0xddf8('0x2')],'transfererchannel':_0x4b4f39[_0xddf8('0x3')],'transferercalleridnum':_0x4b4f39[_0xddf8('0x4')],'transferercalleridname':_0x4b4f39['transferercalleridname'],'transfererconnectedlinenum':_0x4b4f39['transfererconnectedlinenum'],'transfererconnectedlinename':_0x4b4f39[_0xddf8('0x5')],'transfereraccountcode':_0x4b4f39[_0xddf8('0x6')],'transferercontext':_0x4b4f39[_0xddf8('0x7')],'transfererexten':_0x4b4f39['transfererexten'],'transfererlinkedid':_0x4b4f39[_0xddf8('0x8')],'transfereechannel':_0x4b4f39[_0xddf8('0x9')],'transfereecalleridnum':_0x4b4f39[_0xddf8('0xa')],'transfereecalleridname':_0x4b4f39['transfereecalleridname'],'transfereeconnectedlinenum':_0x4b4f39[_0xddf8('0xb')],'transfereeconnectedlinename':_0x4b4f39[_0xddf8('0xc')],'transfereeaccountcode':_0x4b4f39[_0xddf8('0xd')],'transfereecontext':_0x4b4f39[_0xddf8('0xe')],'transfereeexten':_0x4b4f39[_0xddf8('0xf')],'transfereelinkedid':_0x4b4f39['transfereelinkedid'],'isexternal':_0x4b4f39[_0xddf8('0x10')],'context':_0x4b4f39['context'],'extension':_0x4b4f39[_0xddf8('0x11')],'type':_0xddf8('0x12')},'log':_0xddf8('0x13')});};exports[_0xddf8('0x14')]=function(_0x14df74){return client[_0xddf8('0x1')](_0xddf8('0x13'),{'body':{'result':_0x14df74['result'],'transfererchannel':_0x14df74['origtransfererchannel'],'transferercalleridnum':_0x14df74[_0xddf8('0x15')],'transferercalleridname':_0x14df74[_0xddf8('0x16')],'transfererconnectedlinenum':_0x14df74[_0xddf8('0x17')],'transfererconnectedlinename':_0x14df74[_0xddf8('0x18')],'transfereraccountcode':_0x14df74[_0xddf8('0x19')],'transferercontext':_0x14df74[_0xddf8('0x1a')],'transfererexten':_0x14df74[_0xddf8('0x1b')],'transfererlinkedid':_0x14df74[_0xddf8('0x1c')],'transfereechannel':_0x14df74[_0xddf8('0x1d')],'transfereecalleridnum':_0x14df74[_0xddf8('0x1e')],'transfereecalleridname':_0x14df74['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x14df74[_0xddf8('0x1f')],'transfereeconnectedlinename':_0x14df74[_0xddf8('0x20')],'transfereeaccountcode':_0x14df74['transfertargetaccountcode'],'transfereecontext':_0x14df74[_0xddf8('0x21')],'transfereeexten':_0x14df74[_0xddf8('0x22')],'transfereelinkedid':_0x14df74['transfertargetlinkedid'],'isexternal':_0x14df74['isexternal'],'context':_0x14df74['origtransferercontext'],'extension':_0x14df74[_0xddf8('0x23')],'type':_0xddf8('0x24')},'log':'CreateVoiceTransferReport'});};
\ No newline at end of file
index 2acc948..6e226f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb934=['campaigns','run','event','Event\x20name\x20mandatory','emit','faxAccounts','send','checkAfterSend','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','moment','../../../config/environment','../properties','../ami','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','pick','keys','module','action','Reload','then','message','Action','content','catch','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','type','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalLowerLimit','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','Trunk','active','Interval','length','channels','join','voicechannel','map','find','channel','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','uniqueid','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','validate','resolve','StopMixMonitor','destinationchannel','status','stop','%s.%s','/var/spool/asterisk/monitor/','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannel','voicequeuechannelhangup','Redirect','exten','context','telephones','outboundChannels'];(function(_0x4cb3d0,_0x276b07){var _0x543540=function(_0x456b67){while(--_0x456b67){_0x4cb3d0['push'](_0x4cb3d0['shift']());}};_0x543540(++_0x276b07);}(_0xb934,0x92));var _0x4b93=function(_0x4e1f51,_0x4e08b6){_0x4e1f51=_0x4e1f51-0x0;var _0xdb1a9d=_0xb934[_0x4e1f51];return _0xdb1a9d;};'use strict';var _=require(_0x4b93('0x0'));var util=require(_0x4b93('0x1'));var jayson=require(_0x4b93('0x2'));var schema=require('validate');var BPromise=require(_0x4b93('0x3'));var moment=require(_0x4b93('0x4'));var config=require(_0x4b93('0x5'));var properties=require(_0x4b93('0x6'));var ami=require(_0x4b93('0x7'));exports['listen']=function(_0x5e6389,_0x912ffb,_0x1fa8af){return new BPromise(function(_0x2ea5ad,_0x403554){var _0x47ceac={'QueuePause':function(_0x3ee934){return new Promise(function(_0x20d624,_0x36cdc8){var _0xa7f4c2=util[_0x4b93('0x8')](_0x4b93('0x9'),_0x4b93('0xa'),_0x3ee934[_0x4b93('0xb')]);if(_0x5e6389[_0x4b93('0xc')]&&_0x5e6389['timers'][_0xa7f4c2]&&_0x5e6389[_0x4b93('0xc')][_0xa7f4c2][_0x4b93('0xd')]){_0x5e6389[_0x4b93('0xc')][_0xa7f4c2][_0x4b93('0xe')]();}if(_0x5e6389[_0x4b93('0xf')][_0xa7f4c2]){_0x5e6389[_0x4b93('0xf')][_0xa7f4c2][_0x4b93('0x10')]({'statePause':_0x3ee934[_0x4b93('0x11')]?!![]:![]});}_0x20d624({'code':0xc8,'message':_0x4b93('0x12')});});},'Reload':function(_0x28bebf){var _0x79a4d0=this;return new Promise(function(_0x1d2234,_0x332359){if(ami[_0x4b93('0x13')]()==![]){return _0x332359(_0x79a4d0[_0x4b93('0x14')](0x1f4,[config['asterisk']['ip'],config[_0x4b93('0x15')][_0x4b93('0x16')],_0x4b93('0x17')]['join']('\x20')));}_0x28bebf=_[_0x4b93('0x18')](_0x28bebf,_[_0x4b93('0x19')](properties[_0x4b93('0x1a')]));_0x28bebf[_0x4b93('0x1b')]=_0x4b93('0x1c');return ami['Action'](_0x28bebf)[_0x4b93('0x1d')](function(_0xd304ec){_0x1d2234({'code':0xc8,'message':_0xd304ec['message']});})['catch'](function(_0x11a1f3){_0x332359(_0x79a4d0[_0x4b93('0x14')](0x1f5,_0x11a1f3[_0x4b93('0x1e')]));});});},'Command':function(_0x1b17d0){var _0x2899cb=this;return new Promise(function(_0xe1f7ff,_0xe26eb8){if(ami[_0x4b93('0x13')]()==![]){return _0xe26eb8(_0x2899cb[_0x4b93('0x14')](0x1f4,[config[_0x4b93('0x15')]['ip'],config[_0x4b93('0x15')]['username'],'ami\x20disconnected']['join']('\x20')));}_0x1b17d0=_['pick'](_0x1b17d0,'command');_0x1b17d0[_0x4b93('0x1b')]='Command';return ami[_0x4b93('0x1f')](_0x1b17d0)[_0x4b93('0x1d')](function(_0x40e9a3){_0xe1f7ff({'code':0xc8,'message':_0x40e9a3[_0x4b93('0x20')]});})[_0x4b93('0x21')](function(_0x135c6a){_0xe26eb8(_0x2899cb[_0x4b93('0x14')](0x1f5,_0x135c6a[_0x4b93('0x1e')]));});});},'VoiceQueues':function(_0x4b6b29){return new Promise(function(_0x5691ba,_0x1a74eb){var _0x4fff6a=[];for(var _0x118afb in _0x5e6389['voiceQueues']){if(_0x5e6389[_0x4b93('0x22')]['hasOwnProperty'](_0x118afb)){var _0x5ec0af=_0x5e6389[_0x4b93('0x22')][_0x118afb];var _0x66df79={'id':_0x5ec0af['id'],'name':_0x5ec0af[_0x4b93('0xb')],'strategy':_0x5ec0af[_0x4b93('0x23')],'answered':_0x5ec0af[_0x4b93('0x24')],'available':_0x5ec0af[_0x4b93('0x25')],'loggedIn':_0x5ec0af[_0x4b93('0x26')],'pTalking':_0x5ec0af[_0x4b93('0x27')],'sumBillable':_0x5ec0af['sumBillable'],'sumDuration':_0x5ec0af[_0x4b93('0x28')],'sumHoldTime':_0x5ec0af[_0x4b93('0x29')]||0x0,'talking':_0x5ec0af[_0x4b93('0x2a')],'total':_0x5ec0af['total'],'type':_0x5ec0af[_0x4b93('0x2b')],'unmanaged':_0x5ec0af['unmanaged'],'waiting':_0x5ec0af['waiting'],'loggedInDb':_0x5ec0af[_0x4b93('0x2c')]};if(_0x5ec0af[_0x4b93('0x2b')]===_0x4b93('0x2d')){_0x66df79[_0x4b93('0x2e')]=_0x5ec0af[_0x4b93('0x2e')];_0x66df79[_0x4b93('0x2f')]=_0x5ec0af[_0x4b93('0x2f')];_0x66df79[_0x4b93('0x30')]=_0x5ec0af[_0x4b93('0x30')];_0x66df79[_0x4b93('0x31')]=_0x5ec0af['dialOriginateCallerIdNumber'];_0x66df79[_0x4b93('0x32')]=_0x5ec0af['dialOriginateTimeout'];_0x66df79['dialPrefix']=_0x5ec0af[_0x4b93('0x33')];_0x66df79[_0x4b93('0x34')]=_0x5ec0af[_0x4b93('0x34')];_0x66df79[_0x4b93('0x35')]=_0x5ec0af[_0x4b93('0x35')];_0x66df79[_0x4b93('0x36')]=_0x5ec0af[_0x4b93('0x36')];_0x66df79[_0x4b93('0x37')]=_0x5ec0af['outboundBusyCallsDay'];_0x66df79[_0x4b93('0x38')]=_0x5ec0af[_0x4b93('0x38')];_0x66df79['outboundDropCallsDayACS']=_0x5ec0af['outboundDropCallsDayACS'];_0x66df79[_0x4b93('0x39')]=_0x5ec0af[_0x4b93('0x39')];_0x66df79[_0x4b93('0x3a')]=_0x5ec0af[_0x4b93('0x3a')];_0x66df79[_0x4b93('0x3b')]=_0x5ec0af['outboundNoAnswerCallsDay'];_0x66df79[_0x4b93('0x3c')]=_0x5ec0af[_0x4b93('0x3c')];_0x66df79[_0x4b93('0x3d')]=_0x5ec0af[_0x4b93('0x3d')];_0x66df79[_0x4b93('0x3e')]=_0x5ec0af[_0x4b93('0x3e')];_0x66df79['outboundRejectCallsDay']=_0x5ec0af['outboundRejectCallsDay'];_0x66df79['outboundUnknownCallsDay']=_0x5ec0af['outboundUnknownCallsDay'];_0x66df79[_0x4b93('0x3f')]=_0x5ec0af[_0x4b93('0x3f')];_0x66df79['predictiveIntervalAvgHoldtime']=_0x5ec0af[_0x4b93('0x40')];_0x66df79[_0x4b93('0x41')]=_0x5ec0af[_0x4b93('0x41')];_0x66df79[_0x4b93('0x42')]=_0x5ec0af['predictiveIntervalDroppedCallsCallersExit'];_0x66df79[_0x4b93('0x43')]=_0x5ec0af[_0x4b93('0x43')];_0x66df79['predictiveIntervalErlangCalls']=_0x5ec0af[_0x4b93('0x44')];_0x66df79['predictiveIntervalErlangCallsDroppedCalls']=_0x5ec0af[_0x4b93('0x45')];_0x66df79['predictiveIntervalHitRate']=_0x5ec0af['predictiveIntervalHitRate'];_0x66df79[_0x4b93('0x46')]=_0x5ec0af[_0x4b93('0x46')];_0x66df79['predictiveIntervalMultiplicativeFactor']=_0x5ec0af['predictiveIntervalMultiplicativeFactor'];_0x66df79[_0x4b93('0x47')]=_0x5ec0af[_0x4b93('0x47')];_0x66df79[_0x4b93('0x48')]=_0x5ec0af[_0x4b93('0x48')];_0x66df79[_0x4b93('0x1e')]=_0x5ec0af[_0x4b93('0x1e')];_0x66df79[_0x4b93('0x49')]=_0x5ec0af[_0x4b93('0x49')];}if(_0x5ec0af['Trunk']){_0x66df79[_0x4b93('0x4a')]={'id':_0x5ec0af['Trunk']['id'],'name':_0x5ec0af[_0x4b93('0x4a')]['name'],'active':_0x5ec0af[_0x4b93('0x4a')][_0x4b93('0x4b')],'callerid':_0x5ec0af[_0x4b93('0x4a')]['callerid']};}if(_0x5ec0af[_0x4b93('0x4c')]){_0x66df79[_0x4b93('0x4c')]={'id':_0x5ec0af['Interval']['id'],'name':_0x5ec0af['Interval']['name']};}_0x4fff6a['push'](_0x66df79);}}_0x5691ba({'count':_0x4fff6a[_0x4b93('0x4d')],'rows':_0x4fff6a});});},'VoiceChannels':function(_0x29f6eb){return new Promise(function(_0x12904f,_0x3d93f3){var _0x4daadd=_['values'](_0x5e6389[_0x4b93('0x4e')]);_0x12904f({'count':_0x4daadd[_0x4b93('0x4d')],'rows':_0x4daadd});});},'VoiceChannelMixMonitor':function(_0x5685a6){var _0xcecbc7=this;return new Promise(function(_0x3754a3,_0x5e5e0c){if(ami['isConnected']()==![]){return _0x5e5e0c(_0xcecbc7[_0x4b93('0x14')](0x1f4,[config[_0x4b93('0x15')]['ip'],config[_0x4b93('0x15')][_0x4b93('0x16')],_0x4b93('0x17')][_0x4b93('0x4f')]('\x20')));}var _0xb9adb6=schema(properties[_0x4b93('0x50')])['validate'](_0x5685a6);if(_0xb9adb6[_0x4b93('0x4d')]>0x0){return _0x5e5e0c(_0xcecbc7[_0x4b93('0x14')](0x1f4,_[_0x4b93('0x51')](_0xb9adb6,_0x4b93('0x1e'))[_0x4b93('0x4f')](',\x20')));}var _0x244ddc=_[_0x4b93('0x52')](_0x5e6389['channels'],{'uniqueid':_0x5685a6['uniqueid']});if(_0x244ddc&&_0x244ddc[_0x4b93('0x53')]){var _0x159086=util[_0x4b93('0x8')]('%s.%s',_0x5685a6[_0x4b93('0x54')]||_0x5685a6['uniqueid'],_0x5685a6['format']||_0x4b93('0x55'));return ami['Action']({'action':_0x4b93('0x56'),'channel':_0x244ddc[_0x4b93('0x53')],'file':_0x159086,'options':_0x4b93('0x57')})[_0x4b93('0x1d')](function(_0xc3895){var _0x43254f=_[_0x4b93('0x52')](_0x244ddc[_0x4b93('0x58')],{'filename':'/var/spool/asterisk/monitor/'+_0x159086[_0x4b93('0x59')]()});if(_[_0x4b93('0x5a')](_0x43254f)){_0x244ddc[_0x4b93('0x58')][_0x4b93('0x5b')]({'filename':'/var/spool/asterisk/monitor/'+_0x159086[_0x4b93('0x59')](),'createdAt':moment()[_0x4b93('0x8')](_0x4b93('0x5c')),'mixmonitorid':_0xc3895[_0x4b93('0x5d')],'status':'rec'});}else{_0x43254f['mixmonitorid']=_0xc3895[_0x4b93('0x5d')];_0x43254f['status']=_0x4b93('0x5e');}_0x3754a3({'code':0xc8,'message':[_0x5685a6[_0x4b93('0x5f')],_0x4b93('0x60'),_0xc3895[_0x4b93('0x5d')]][_0x4b93('0x4f')]('\x20'),'mixmonitorid':_0xc3895['mixmonitorid']});})[_0x4b93('0x21')](function(_0x170b3a){_0x5e5e0c(_0xcecbc7[_0x4b93('0x14')](0x1f5,[_0x5685a6['uniqueid'],_0x170b3a[_0x4b93('0x1e')][_0x4b93('0x59')]()][_0x4b93('0x4f')]('\x20')));});}else{return _0x5e5e0c(_0xcecbc7['error'](0x1f5,_0x4b93('0x61')));}});},'VoiceChannelStopMixMonitor':function(_0x122eb6){var _0x545f54=this;return new Promise(function(_0xd18be2,_0x42fe93){if(ami[_0x4b93('0x13')]()==![]){return _0x42fe93(_0x545f54[_0x4b93('0x14')](0x1f4,[config['asterisk']['ip'],config[_0x4b93('0x15')][_0x4b93('0x16')],_0x4b93('0x17')][_0x4b93('0x4f')]('\x20')));}var _0x138a05=schema(properties[_0x4b93('0x50')])[_0x4b93('0x62')](_0x122eb6);if(_0x138a05[_0x4b93('0x4d')]>0x0){return _0x42fe93(_0x545f54['error'](0x1f4,_['map'](_0x138a05,_0x4b93('0x1e'))[_0x4b93('0x4f')](',\x20')));}var _0x309ff9=_[_0x4b93('0x52')](_0x5e6389[_0x4b93('0x4e')],{'uniqueid':_0x122eb6[_0x4b93('0x5f')]});if(_0x309ff9){return BPromise[_0x4b93('0x63')]()[_0x4b93('0x1d')](function(){if(_0x309ff9[_0x4b93('0x53')]){return ami['Action']({'action':_0x4b93('0x64'),'channel':_0x309ff9[_0x4b93('0x53')],'mixmonitorid':_0x122eb6['mixmonitorid']})[_0x4b93('0x21')](function(_0xad9b68){});}})[_0x4b93('0x1d')](function(){if(_0x309ff9[_0x4b93('0x65')]){return ami[_0x4b93('0x1f')]({'action':'StopMixMonitor','channel':_0x309ff9[_0x4b93('0x65')],'mixmonitorid':_0x122eb6['mixmonitorid']})[_0x4b93('0x21')](function(_0x51fece){});}})[_0x4b93('0x1d')](function(_0xb4076c){var _0x31292c=_[_0x4b93('0x52')](_0x309ff9[_0x4b93('0x58')],{'mixmonitorid':_0x122eb6[_0x4b93('0x5d')]});if(_0x31292c){_0x31292c[_0x4b93('0x66')]=_0x4b93('0x67');}})['then'](function(){var _0x533cf1=util[_0x4b93('0x8')](_0x4b93('0x68'),_0x122eb6[_0x4b93('0x54')]||_0x122eb6[_0x4b93('0x5f')],_0x122eb6[_0x4b93('0x8')]||_0x4b93('0x55'));var _0x153379=_[_0x4b93('0x52')](_0x309ff9[_0x4b93('0x58')],{'filename':_0x4b93('0x69')+_0x533cf1[_0x4b93('0x59')]()});if(_0x153379){_0x153379[_0x4b93('0x66')]=_0x4b93('0x67');}})['then'](function(){_0xd18be2({'code':0xc8,'message':[_0x122eb6['uniqueid'],_0x4b93('0x6a')][_0x4b93('0x4f')]('\x20')});})[_0x4b93('0x21')](function(_0x38071c){_0x42fe93(_0x545f54['error'](0x1f5,[_0x122eb6[_0x4b93('0x5f')],_0x38071c[_0x4b93('0x1e')][_0x4b93('0x59')]()][_0x4b93('0x4f')]('\x20')));});}else{return _0x42fe93(_0x545f54[_0x4b93('0x14')](0x1f5,_0x4b93('0x61')));}});},'VoiceQueuesChannels':function(_0x499f10){return new Promise(function(_0x534caf,_0x28e26b){var _0x16b0c9=_[_0x4b93('0x6b')](_0x5e6389[_0x4b93('0x6c')]);_0x534caf({'count':_0x16b0c9[_0x4b93('0x4d')],'rows':_0x16b0c9});});},'VoiceQueuesChannel':function(_0x4080b9){var _0x4ee674=this;return new Promise(function(_0x3b1663,_0x55941f){var _0x288b77=schema(properties[_0x4b93('0x6d')])['validate'](_0x4080b9);if(_0x288b77[_0x4b93('0x4d')]>0x0){return _0x55941f(_0x4ee674['error'](0x1f4,_['map'](_0x288b77,_0x4b93('0x1e'))[_0x4b93('0x4f')](',\x20')));}var _0x5e9d3d=_[_0x4b93('0x52')](_0x5e6389[_0x4b93('0x6c')],{'uniqueid':_0x4080b9['uniqueid']});if(_0x5e9d3d){_0x3b1663(_0x5e9d3d);}else{return _0x55941f(_0x4ee674['error'](0x1f5,_0x4b93('0x61')));}});},'VoiceQueuesChannelHangup':function(_0x571b99){var _0x14f83d=this;return new Promise(function(_0x1460bc,_0x168026){if(ami[_0x4b93('0x13')]()==![]){return _0x168026(_0x14f83d[_0x4b93('0x14')](0x1f4,[config[_0x4b93('0x15')]['ip'],config[_0x4b93('0x15')][_0x4b93('0x16')],_0x4b93('0x17')][_0x4b93('0x4f')]('\x20')));}var _0x2ea493=schema(properties[_0x4b93('0x6e')])[_0x4b93('0x62')](_0x571b99);if(_0x2ea493[_0x4b93('0x4d')]>0x0){return _0x168026(_0x14f83d[_0x4b93('0x14')](0x1f4,_[_0x4b93('0x51')](_0x2ea493,_0x4b93('0x1e'))[_0x4b93('0x4f')](',\x20')));}var _0x14c980=_[_0x4b93('0x52')](_0x5e6389['queueChannels'],{'uniqueid':_0x571b99['uniqueid']});if(_0x14c980&&_0x14c980[_0x4b93('0x53')]){return ami[_0x4b93('0x1f')]({'action':'Hangup','channel':_0x14c980[_0x4b93('0x53')]})['then'](function(_0x4eaa51){_0x1460bc({'code':0xc8,'message':[_0x571b99['uniqueid'],_0x4eaa51[_0x4b93('0x1e')]['toLowerCase']()][_0x4b93('0x4f')]('\x20')});})['catch'](function(_0x279d08){_0x168026(_0x14f83d[_0x4b93('0x14')](0x1f5,[_0x571b99[_0x4b93('0x5f')],_0x279d08[_0x4b93('0x1e')][_0x4b93('0x59')]()][_0x4b93('0x4f')]('\x20')));});}else{return _0x168026(_0x14f83d[_0x4b93('0x14')](0x1f5,_0x4b93('0x61')));}});},'VoiceQueuesChannelRedirect':function(_0x3411b7){var _0x33b487=this;return new Promise(function(_0x2b5705,_0x1aeaad){if(ami[_0x4b93('0x13')]()==![]){return _0x1aeaad(_0x33b487[_0x4b93('0x14')](0x1f4,[config['asterisk']['ip'],config[_0x4b93('0x15')]['username'],_0x4b93('0x17')][_0x4b93('0x4f')]('\x20')));}var _0x363927=schema(properties['voicequeuechannelredirect'])[_0x4b93('0x62')](_0x3411b7);if(_0x363927[_0x4b93('0x4d')]>0x0){return _0x1aeaad(_0x33b487[_0x4b93('0x14')](0x1f4,_[_0x4b93('0x51')](_0x363927,_0x4b93('0x1e'))[_0x4b93('0x4f')](',\x20')));}var _0x2e83bd=_['find'](_0x5e6389[_0x4b93('0x6c')],{'uniqueid':_0x3411b7[_0x4b93('0x5f')]});if(_0x2e83bd&&_0x2e83bd[_0x4b93('0x53')]){return ami['Action']({'action':_0x4b93('0x6f'),'channel':_0x2e83bd[_0x4b93('0x53')],'exten':_0x3411b7[_0x4b93('0x70')],'context':_0x3411b7[_0x4b93('0x71')]||_0x2e83bd[_0x4b93('0x71')],'priority':0x1})[_0x4b93('0x1d')](function(_0x27df0b){_0x2b5705({'code':0xc8,'message':[_0x3411b7['uniqueid'],_0x27df0b[_0x4b93('0x1e')][_0x4b93('0x59')]()]['join']('\x20')});})['catch'](function(_0x1bafdb){_0x1aeaad(_0x33b487['error'](0x1f5,[_0x3411b7['uniqueid'],_0x1bafdb[_0x4b93('0x1e')][_0x4b93('0x59')]()]['join']('\x20')));});}else{return _0x1aeaad(_0x33b487[_0x4b93('0x14')](0x1f5,_0x4b93('0x61')));}});},'Agents':function(_0x120c1d){return new Promise(function(_0x17044e,_0x53508e){var _0x24bbe1=_[_0x4b93('0x6b')](_0x5e6389[_0x4b93('0xf')]);_0x17044e({'count':_0x24bbe1['length'],'rows':_0x24bbe1});});},'Telephones':function(_0x3b6dcd){return new Promise(function(_0x3f69dd,_0x5eb222){var _0x272e1d=_[_0x4b93('0x6b')](_0x5e6389[_0x4b93('0x72')]);_0x3f69dd({'count':_0x272e1d[_0x4b93('0x4d')],'rows':_0x272e1d});});},'Trunks':function(_0x462a24){return new Promise(function(_0x40dedd,_0x49f2b9){var _0x2518af=_[_0x4b93('0x6b')](_0x5e6389['trunks']);_0x40dedd({'count':_0x2518af['length'],'rows':_0x2518af});});},'OutboundChannels':function(_0x17af5d){return new Promise(function(_0x3dbd1c,_0x27f449){var _0x4c8706=_[_0x4b93('0x6b')](_0x5e6389[_0x4b93('0x73')]);_0x3dbd1c({'count':_0x4c8706[_0x4b93('0x4d')],'rows':_0x4c8706});});},'Outbound':function(_0x1044c0){return new Promise(function(_0x22f700,_0x26d6b2){_0x22f700(_0x5e6389[_0x4b93('0x2d')]);});},'Campaigns':function(_0x54dacd){return new Promise(function(_0x36efde,_0x25dde1){var _0x1f66f6=_['values'](_0x5e6389[_0x4b93('0x74')]);_0x36efde({'count':_0x1f66f6['length'],'rows':_0x1f66f6});});},'VoiceQueuesPreview':function(_0x44d96a){var _0x58d60b=this;return new Promise(function(_0x111ceb,_0x53f131){_0x912ffb[_0x4b93('0x75')](_0x44d96a['id'])[_0x4b93('0x1d')](function(_0x451480){_0x111ceb({'code':0xc8,'message':_0x451480[_0x4b93('0x1e')]});})[_0x4b93('0x21')](function(_0x4898e6){_0x53f131(_0x58d60b[_0x4b93('0x14')](0x1f4,_0x4898e6[_0x4b93('0x1e')]));});});},'EventManager':function(_0x5db97e){var _0x46170d=this;return new Promise(function(_0x22d2ef,_0x12bb55){if(!_0x5db97e[_0x4b93('0x76')]){return _0x12bb55(_0x46170d['error'](0x1f4,_0x4b93('0x77')));}ami[_0x4b93('0x78')]('custom:'+_0x5db97e['event'],_0x5db97e[_0x4b93('0x1e')]);_0x22d2ef({'code':0xc8,'message':_0x5db97e});});},'FaxAccounts':function(_0x57d2c7){return new Promise(function(_0x436402,_0x2c72b2){var _0xa0d0af=_['values'](_0x5e6389[_0x4b93('0x79')]);_0x436402({'count':_0xa0d0af[_0x4b93('0x4d')],'rows':_0xa0d0af});});},'SendFax':function(_0x80eaeb){var _0x259e7b=this;return new Promise(function(_0x3076d6,_0x52c4e5){_0x1fa8af[_0x4b93('0x7a')](_0x80eaeb)['then'](function(_0x1db82a){_0x3076d6({'code':0xc8,'message':_0x1db82a[_0x4b93('0x1e')]});})['catch'](function(_0x50cc4e){_0x52c4e5(_0x259e7b[_0x4b93('0x14')](0x1f4,_0x50cc4e[_0x4b93('0x1e')]));});});},'CheckAfterSend':function(_0x4c1d77){var _0x262014=this;return new Promise(function(_0x54d1e9,_0x730094){_0x1fa8af[_0x4b93('0x7b')](_0x4c1d77)[_0x4b93('0x1d')](function(_0x147885){_0x54d1e9({'code':0xc8,'message':_0x147885['message']});})['catch'](function(_0x567031){_0x730094(_0x262014[_0x4b93('0x14')](0x1f4,_0x567031[_0x4b93('0x1e')]));});});}};var _0xdf00fe=jayson[_0x4b93('0x7c')](_0x47ceac)[_0x4b93('0x7d')]();_0xdf00fe['on'](_0x4b93('0x14'),function(_0x4cd74f){return _0x403554(_0x4cd74f);});_0xdf00fe[_0x4b93('0x7e')](0x232a,_0x4b93('0x7f'),function(){console[_0x4b93('0x80')](_0x4b93('0x81'),0x232a);return _0x2ea5ad(_0x4b93('0x82')+0x232a);});});};
\ No newline at end of file
+var _0xce22=['timer','updateAcw','agents','updateStatusRealtime','QueuePause','asterisk','username','ami\x20disconnected','join','pick','keys','Action','then','message','catch','error','isConnected','content','voiceQueues','hasOwnProperty','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','type','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','Trunk','callerid','Interval','push','length','values','channels','voicechannel','map','find','channel','uniqueid','wav','MixMonitor','ai(mixmonitorid)','monitors','isNil','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','%s.%s','filename','stop','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','trunks','campaigns','run','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','checkAfterSend','http','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','../../../config/environment','../ami','listen','format','%s/%s','name','timers'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xce22,0xea));var _0x2ce2=function(_0x45d64f,_0x43de0d){_0x45d64f=_0x45d64f-0x0;var _0x3d3ca0=_0xce22[_0x45d64f];return _0x3d3ca0;};'use strict';var _=require(_0x2ce2('0x0'));var util=require(_0x2ce2('0x1'));var jayson=require(_0x2ce2('0x2'));var schema=require(_0x2ce2('0x3'));var BPromise=require(_0x2ce2('0x4'));var moment=require('moment');var config=require(_0x2ce2('0x5'));var properties=require('../properties');var ami=require(_0x2ce2('0x6'));exports[_0x2ce2('0x7')]=function(_0x470a06,_0xc5a3d3,_0x25110e){return new BPromise(function(_0x29f060,_0x6515b5){var _0x4d0c17={'QueuePause':function(_0x225737){return new Promise(function(_0x111f56,_0x3c3d0b){var _0x28a682=util[_0x2ce2('0x8')](_0x2ce2('0x9'),'SIP',_0x225737[_0x2ce2('0xa')]);if(_0x470a06[_0x2ce2('0xb')]&&_0x470a06['timers'][_0x28a682]&&_0x470a06[_0x2ce2('0xb')][_0x28a682][_0x2ce2('0xc')]){_0x470a06['timers'][_0x28a682][_0x2ce2('0xd')]();}if(_0x470a06[_0x2ce2('0xe')][_0x28a682]){_0x470a06[_0x2ce2('0xe')][_0x28a682][_0x2ce2('0xf')]({'statePause':_0x225737['pause']?!![]:![]});}_0x111f56({'code':0xc8,'message':_0x2ce2('0x10')});});},'Reload':function(_0x112244){var _0x2b7e86=this;return new Promise(function(_0x5efaa1,_0x2a45ea){if(ami['isConnected']()==![]){return _0x2a45ea(_0x2b7e86['error'](0x1f4,[config[_0x2ce2('0x11')]['ip'],config[_0x2ce2('0x11')][_0x2ce2('0x12')],_0x2ce2('0x13')][_0x2ce2('0x14')]('\x20')));}_0x112244=_[_0x2ce2('0x15')](_0x112244,_[_0x2ce2('0x16')](properties['module']));_0x112244['action']='Reload';return ami[_0x2ce2('0x17')](_0x112244)[_0x2ce2('0x18')](function(_0x2493b0){_0x5efaa1({'code':0xc8,'message':_0x2493b0[_0x2ce2('0x19')]});})[_0x2ce2('0x1a')](function(_0x560a77){_0x2a45ea(_0x2b7e86[_0x2ce2('0x1b')](0x1f5,_0x560a77['message']));});});},'Command':function(_0x280e3d){var _0x42f597=this;return new Promise(function(_0x1da7db,_0x21e948){if(ami[_0x2ce2('0x1c')]()==![]){return _0x21e948(_0x42f597[_0x2ce2('0x1b')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x2ce2('0x12')],_0x2ce2('0x13')][_0x2ce2('0x14')]('\x20')));}_0x280e3d=_[_0x2ce2('0x15')](_0x280e3d,'command');_0x280e3d['action']='Command';return ami[_0x2ce2('0x17')](_0x280e3d)[_0x2ce2('0x18')](function(_0x4ae9b9){_0x1da7db({'code':0xc8,'message':_0x4ae9b9[_0x2ce2('0x1d')]});})[_0x2ce2('0x1a')](function(_0x51249f){_0x21e948(_0x42f597[_0x2ce2('0x1b')](0x1f5,_0x51249f[_0x2ce2('0x19')]));});});},'VoiceQueues':function(_0xcba5ca){return new Promise(function(_0x3f3927,_0x5c748f){var _0x528fec=[];for(var _0x10748a in _0x470a06['voiceQueues']){if(_0x470a06[_0x2ce2('0x1e')][_0x2ce2('0x1f')](_0x10748a)){var _0x3a701e=_0x470a06[_0x2ce2('0x1e')][_0x10748a];var _0x17be99={'id':_0x3a701e['id'],'name':_0x3a701e['name'],'strategy':_0x3a701e['strategy'],'answered':_0x3a701e[_0x2ce2('0x20')],'available':_0x3a701e['available'],'loggedIn':_0x3a701e[_0x2ce2('0x21')],'pTalking':_0x3a701e[_0x2ce2('0x22')],'sumBillable':_0x3a701e[_0x2ce2('0x23')],'sumDuration':_0x3a701e[_0x2ce2('0x24')],'sumHoldTime':_0x3a701e[_0x2ce2('0x25')]||0x0,'talking':_0x3a701e[_0x2ce2('0x26')],'total':_0x3a701e['total'],'type':_0x3a701e[_0x2ce2('0x27')],'unmanaged':_0x3a701e[_0x2ce2('0x28')],'waiting':_0x3a701e[_0x2ce2('0x29')],'loggedInDb':_0x3a701e[_0x2ce2('0x2a')]};if(_0x3a701e[_0x2ce2('0x27')]===_0x2ce2('0x2b')){_0x17be99[_0x2ce2('0x2c')]=_0x3a701e[_0x2ce2('0x2c')];_0x17be99['dialMethod']=_0x3a701e[_0x2ce2('0x2d')];_0x17be99['dialOriginateCallerIdName']=_0x3a701e['dialOriginateCallerIdName'];_0x17be99[_0x2ce2('0x2e')]=_0x3a701e[_0x2ce2('0x2e')];_0x17be99['dialOriginateTimeout']=_0x3a701e[_0x2ce2('0x2f')];_0x17be99[_0x2ce2('0x30')]=_0x3a701e[_0x2ce2('0x30')];_0x17be99[_0x2ce2('0x31')]=_0x3a701e[_0x2ce2('0x31')];_0x17be99[_0x2ce2('0x32')]=_0x3a701e['outboundAnswerCallsDay'];_0x17be99[_0x2ce2('0x33')]=_0x3a701e[_0x2ce2('0x33')];_0x17be99[_0x2ce2('0x34')]=_0x3a701e[_0x2ce2('0x34')];_0x17be99['outboundCongestionCallsDay']=_0x3a701e[_0x2ce2('0x35')];_0x17be99[_0x2ce2('0x36')]=_0x3a701e[_0x2ce2('0x36')];_0x17be99[_0x2ce2('0x37')]=_0x3a701e[_0x2ce2('0x37')];_0x17be99[_0x2ce2('0x38')]=_0x3a701e[_0x2ce2('0x38')];_0x17be99[_0x2ce2('0x39')]=_0x3a701e[_0x2ce2('0x39')];_0x17be99[_0x2ce2('0x3a')]=_0x3a701e[_0x2ce2('0x3a')];_0x17be99['outboundOriginateFailureCallsDay']=_0x3a701e[_0x2ce2('0x3b')];_0x17be99[_0x2ce2('0x3c')]=_0x3a701e[_0x2ce2('0x3c')];_0x17be99[_0x2ce2('0x3d')]=_0x3a701e[_0x2ce2('0x3d')];_0x17be99[_0x2ce2('0x3e')]=_0x3a701e[_0x2ce2('0x3e')];_0x17be99[_0x2ce2('0x3f')]=_0x3a701e[_0x2ce2('0x3f')];_0x17be99[_0x2ce2('0x40')]=_0x3a701e[_0x2ce2('0x40')];_0x17be99[_0x2ce2('0x41')]=_0x3a701e['predictiveIntervalAvgTalktime'];_0x17be99[_0x2ce2('0x42')]=_0x3a701e[_0x2ce2('0x42')];_0x17be99['predictiveIntervalDroppedCallsTimeout']=_0x3a701e[_0x2ce2('0x43')];_0x17be99[_0x2ce2('0x44')]=_0x3a701e[_0x2ce2('0x44')];_0x17be99[_0x2ce2('0x45')]=_0x3a701e[_0x2ce2('0x45')];_0x17be99['predictiveIntervalHitRate']=_0x3a701e[_0x2ce2('0x46')];_0x17be99[_0x2ce2('0x47')]=_0x3a701e[_0x2ce2('0x47')];_0x17be99['predictiveIntervalMultiplicativeFactor']=_0x3a701e[_0x2ce2('0x48')];_0x17be99[_0x2ce2('0x49')]=_0x3a701e[_0x2ce2('0x49')];_0x17be99[_0x2ce2('0x4a')]=_0x3a701e[_0x2ce2('0x4a')];_0x17be99[_0x2ce2('0x19')]=_0x3a701e[_0x2ce2('0x19')];_0x17be99['originated']=_0x3a701e['originated'];}if(_0x3a701e[_0x2ce2('0x4b')]){_0x17be99[_0x2ce2('0x4b')]={'id':_0x3a701e[_0x2ce2('0x4b')]['id'],'name':_0x3a701e[_0x2ce2('0x4b')][_0x2ce2('0xa')],'active':_0x3a701e[_0x2ce2('0x4b')]['active'],'callerid':_0x3a701e[_0x2ce2('0x4b')][_0x2ce2('0x4c')]};}if(_0x3a701e[_0x2ce2('0x4d')]){_0x17be99[_0x2ce2('0x4d')]={'id':_0x3a701e['Interval']['id'],'name':_0x3a701e['Interval'][_0x2ce2('0xa')]};}_0x528fec[_0x2ce2('0x4e')](_0x17be99);}}_0x3f3927({'count':_0x528fec[_0x2ce2('0x4f')],'rows':_0x528fec});});},'VoiceChannels':function(_0x55d988){return new Promise(function(_0x25cf85,_0x11a50d){var _0x2cf62c=_[_0x2ce2('0x50')](_0x470a06[_0x2ce2('0x51')]);_0x25cf85({'count':_0x2cf62c['length'],'rows':_0x2cf62c});});},'VoiceChannelMixMonitor':function(_0x55a531){var _0x1ca9b7=this;return new Promise(function(_0x1ad716,_0x192f53){if(ami[_0x2ce2('0x1c')]()==![]){return _0x192f53(_0x1ca9b7[_0x2ce2('0x1b')](0x1f4,[config[_0x2ce2('0x11')]['ip'],config['asterisk']['username'],_0x2ce2('0x13')][_0x2ce2('0x14')]('\x20')));}var _0x2b2c18=schema(properties[_0x2ce2('0x52')])[_0x2ce2('0x3')](_0x55a531);if(_0x2b2c18[_0x2ce2('0x4f')]>0x0){return _0x192f53(_0x1ca9b7['error'](0x1f4,_[_0x2ce2('0x53')](_0x2b2c18,_0x2ce2('0x19'))['join'](',\x20')));}var _0x922c1=_[_0x2ce2('0x54')](_0x470a06[_0x2ce2('0x51')],{'uniqueid':_0x55a531['uniqueid']});if(_0x922c1&&_0x922c1[_0x2ce2('0x55')]){var _0x39cfd8=util[_0x2ce2('0x8')]('%s.%s',_0x55a531['filename']||_0x55a531[_0x2ce2('0x56')],_0x55a531[_0x2ce2('0x8')]||_0x2ce2('0x57'));return ami[_0x2ce2('0x17')]({'action':_0x2ce2('0x58'),'channel':_0x922c1['channel'],'file':_0x39cfd8,'options':_0x2ce2('0x59')})[_0x2ce2('0x18')](function(_0x228437){var _0x14d34c=_[_0x2ce2('0x54')](_0x922c1[_0x2ce2('0x5a')],{'filename':'/var/spool/asterisk/monitor/'+_0x39cfd8['toLowerCase']()});if(_[_0x2ce2('0x5b')](_0x14d34c)){_0x922c1[_0x2ce2('0x5a')][_0x2ce2('0x4e')]({'filename':_0x2ce2('0x5c')+_0x39cfd8[_0x2ce2('0x5d')](),'createdAt':moment()[_0x2ce2('0x8')](_0x2ce2('0x5e')),'mixmonitorid':_0x228437['mixmonitorid'],'status':'rec'});}else{_0x14d34c['mixmonitorid']=_0x228437[_0x2ce2('0x5f')];_0x14d34c[_0x2ce2('0x60')]=_0x2ce2('0x61');}_0x1ad716({'code':0xc8,'message':[_0x55a531[_0x2ce2('0x56')],_0x2ce2('0x62'),_0x228437[_0x2ce2('0x5f')]][_0x2ce2('0x14')]('\x20'),'mixmonitorid':_0x228437[_0x2ce2('0x5f')]});})['catch'](function(_0x454d12){_0x192f53(_0x1ca9b7[_0x2ce2('0x1b')](0x1f5,[_0x55a531[_0x2ce2('0x56')],_0x454d12[_0x2ce2('0x19')][_0x2ce2('0x5d')]()][_0x2ce2('0x14')]('\x20')));});}else{return _0x192f53(_0x1ca9b7[_0x2ce2('0x1b')](0x1f5,_0x2ce2('0x63')));}});},'VoiceChannelStopMixMonitor':function(_0x184e8c){var _0x267e23=this;return new Promise(function(_0x2dcd10,_0x2fd01f){if(ami[_0x2ce2('0x1c')]()==![]){return _0x2fd01f(_0x267e23['error'](0x1f4,[config[_0x2ce2('0x11')]['ip'],config[_0x2ce2('0x11')][_0x2ce2('0x12')],'ami\x20disconnected'][_0x2ce2('0x14')]('\x20')));}var _0x53a8c4=schema(properties[_0x2ce2('0x52')])[_0x2ce2('0x3')](_0x184e8c);if(_0x53a8c4[_0x2ce2('0x4f')]>0x0){return _0x2fd01f(_0x267e23[_0x2ce2('0x1b')](0x1f4,_[_0x2ce2('0x53')](_0x53a8c4,_0x2ce2('0x19'))[_0x2ce2('0x14')](',\x20')));}var _0x2e390d=_[_0x2ce2('0x54')](_0x470a06['channels'],{'uniqueid':_0x184e8c[_0x2ce2('0x56')]});if(_0x2e390d){return BPromise[_0x2ce2('0x64')]()['then'](function(){if(_0x2e390d[_0x2ce2('0x55')]){return ami[_0x2ce2('0x17')]({'action':_0x2ce2('0x65'),'channel':_0x2e390d[_0x2ce2('0x55')],'mixmonitorid':_0x184e8c[_0x2ce2('0x5f')]})[_0x2ce2('0x1a')](function(_0x4e3d16){});}})[_0x2ce2('0x18')](function(){if(_0x2e390d[_0x2ce2('0x66')]){return ami[_0x2ce2('0x17')]({'action':_0x2ce2('0x65'),'channel':_0x2e390d[_0x2ce2('0x66')],'mixmonitorid':_0x184e8c['mixmonitorid']})[_0x2ce2('0x1a')](function(_0x32c75b){});}})[_0x2ce2('0x18')](function(_0x4a404d){var _0x1fd295=_[_0x2ce2('0x54')](_0x2e390d[_0x2ce2('0x5a')],{'mixmonitorid':_0x184e8c[_0x2ce2('0x5f')]});if(_0x1fd295){_0x1fd295['status']='stop';}})['then'](function(){var _0x2f1cec=util['format'](_0x2ce2('0x67'),_0x184e8c[_0x2ce2('0x68')]||_0x184e8c[_0x2ce2('0x56')],_0x184e8c[_0x2ce2('0x8')]||_0x2ce2('0x57'));var _0x54ce48=_[_0x2ce2('0x54')](_0x2e390d['monitors'],{'filename':_0x2ce2('0x5c')+_0x2f1cec[_0x2ce2('0x5d')]()});if(_0x54ce48){_0x54ce48[_0x2ce2('0x60')]=_0x2ce2('0x69');}})[_0x2ce2('0x18')](function(){_0x2dcd10({'code':0xc8,'message':[_0x184e8c['uniqueid'],'StopMixMonitor\x20Success']['join']('\x20')});})['catch'](function(_0x1ebceb){_0x2fd01f(_0x267e23[_0x2ce2('0x1b')](0x1f5,[_0x184e8c[_0x2ce2('0x56')],_0x1ebceb[_0x2ce2('0x19')][_0x2ce2('0x5d')]()]['join']('\x20')));});}else{return _0x2fd01f(_0x267e23[_0x2ce2('0x1b')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x23b43b){return new Promise(function(_0x12d094,_0xfaec00){var _0x301552=_[_0x2ce2('0x50')](_0x470a06[_0x2ce2('0x6a')]);_0x12d094({'count':_0x301552['length'],'rows':_0x301552});});},'VoiceQueuesChannel':function(_0x360cd6){var _0x353418=this;return new Promise(function(_0x256451,_0x4a3f74){var _0x33d67f=schema(properties[_0x2ce2('0x6b')])[_0x2ce2('0x3')](_0x360cd6);if(_0x33d67f['length']>0x0){return _0x4a3f74(_0x353418[_0x2ce2('0x1b')](0x1f4,_[_0x2ce2('0x53')](_0x33d67f,_0x2ce2('0x19'))[_0x2ce2('0x14')](',\x20')));}var _0x3555b6=_['find'](_0x470a06[_0x2ce2('0x6a')],{'uniqueid':_0x360cd6['uniqueid']});if(_0x3555b6){_0x256451(_0x3555b6);}else{return _0x4a3f74(_0x353418['error'](0x1f5,_0x2ce2('0x63')));}});},'VoiceQueuesChannelHangup':function(_0x55ffa3){var _0x433fe4=this;return new Promise(function(_0x18df3b,_0x3387dc){if(ami[_0x2ce2('0x1c')]()==![]){return _0x3387dc(_0x433fe4[_0x2ce2('0x1b')](0x1f4,[config[_0x2ce2('0x11')]['ip'],config[_0x2ce2('0x11')]['username'],_0x2ce2('0x13')][_0x2ce2('0x14')]('\x20')));}var _0x4c39ee=schema(properties[_0x2ce2('0x6c')])[_0x2ce2('0x3')](_0x55ffa3);if(_0x4c39ee[_0x2ce2('0x4f')]>0x0){return _0x3387dc(_0x433fe4[_0x2ce2('0x1b')](0x1f4,_[_0x2ce2('0x53')](_0x4c39ee,_0x2ce2('0x19'))[_0x2ce2('0x14')](',\x20')));}var _0x4e3126=_[_0x2ce2('0x54')](_0x470a06[_0x2ce2('0x6a')],{'uniqueid':_0x55ffa3[_0x2ce2('0x56')]});if(_0x4e3126&&_0x4e3126[_0x2ce2('0x55')]){return ami[_0x2ce2('0x17')]({'action':_0x2ce2('0x6d'),'channel':_0x4e3126[_0x2ce2('0x55')]})[_0x2ce2('0x18')](function(_0x253efd){_0x18df3b({'code':0xc8,'message':[_0x55ffa3[_0x2ce2('0x56')],_0x253efd['message'][_0x2ce2('0x5d')]()][_0x2ce2('0x14')]('\x20')});})[_0x2ce2('0x1a')](function(_0xd6d3a7){_0x3387dc(_0x433fe4[_0x2ce2('0x1b')](0x1f5,[_0x55ffa3[_0x2ce2('0x56')],_0xd6d3a7[_0x2ce2('0x19')][_0x2ce2('0x5d')]()][_0x2ce2('0x14')]('\x20')));});}else{return _0x3387dc(_0x433fe4['error'](0x1f5,_0x2ce2('0x63')));}});},'VoiceQueuesChannelRedirect':function(_0x28ad06){var _0x253ffe=this;return new Promise(function(_0x25ef37,_0x5b337f){if(ami[_0x2ce2('0x1c')]()==![]){return _0x5b337f(_0x253ffe[_0x2ce2('0x1b')](0x1f4,[config[_0x2ce2('0x11')]['ip'],config[_0x2ce2('0x11')][_0x2ce2('0x12')],'ami\x20disconnected'][_0x2ce2('0x14')]('\x20')));}var _0x56d606=schema(properties[_0x2ce2('0x6e')])[_0x2ce2('0x3')](_0x28ad06);if(_0x56d606[_0x2ce2('0x4f')]>0x0){return _0x5b337f(_0x253ffe[_0x2ce2('0x1b')](0x1f4,_[_0x2ce2('0x53')](_0x56d606,_0x2ce2('0x19'))[_0x2ce2('0x14')](',\x20')));}var _0x2c90bb=_['find'](_0x470a06['queueChannels'],{'uniqueid':_0x28ad06[_0x2ce2('0x56')]});if(_0x2c90bb&&_0x2c90bb[_0x2ce2('0x55')]){return ami[_0x2ce2('0x17')]({'action':'Redirect','channel':_0x2c90bb[_0x2ce2('0x55')],'exten':_0x28ad06['exten'],'context':_0x28ad06['context']||_0x2c90bb['context'],'priority':0x1})[_0x2ce2('0x18')](function(_0x516c4e){_0x25ef37({'code':0xc8,'message':[_0x28ad06[_0x2ce2('0x56')],_0x516c4e['message']['toLowerCase']()][_0x2ce2('0x14')]('\x20')});})[_0x2ce2('0x1a')](function(_0xdbf033){_0x5b337f(_0x253ffe['error'](0x1f5,[_0x28ad06[_0x2ce2('0x56')],_0xdbf033[_0x2ce2('0x19')][_0x2ce2('0x5d')]()][_0x2ce2('0x14')]('\x20')));});}else{return _0x5b337f(_0x253ffe['error'](0x1f5,_0x2ce2('0x63')));}});},'Agents':function(_0x3f8347){return new Promise(function(_0x26818,_0x2b7445){var _0x461934=_[_0x2ce2('0x50')](_0x470a06[_0x2ce2('0xe')]);_0x26818({'count':_0x461934[_0x2ce2('0x4f')],'rows':_0x461934});});},'Telephones':function(_0xd40438){return new Promise(function(_0x34611a,_0x2d7694){var _0x521fb3=_[_0x2ce2('0x50')](_0x470a06['telephones']);_0x34611a({'count':_0x521fb3['length'],'rows':_0x521fb3});});},'Trunks':function(_0x2a0c3b){return new Promise(function(_0x3adc6d,_0x429557){var _0x1a38e=_[_0x2ce2('0x50')](_0x470a06[_0x2ce2('0x6f')]);_0x3adc6d({'count':_0x1a38e['length'],'rows':_0x1a38e});});},'OutboundChannels':function(_0x7c9595){return new Promise(function(_0x14e929,_0x1563c9){var _0x2052d9=_['values'](_0x470a06['outboundChannels']);_0x14e929({'count':_0x2052d9['length'],'rows':_0x2052d9});});},'Outbound':function(_0x487d8a){return new Promise(function(_0x5cc09c,_0x143497){_0x5cc09c(_0x470a06['outbound']);});},'Campaigns':function(_0x52b271){return new Promise(function(_0x3770b8,_0x255d39){var _0x4e27c1=_[_0x2ce2('0x50')](_0x470a06[_0x2ce2('0x70')]);_0x3770b8({'count':_0x4e27c1['length'],'rows':_0x4e27c1});});},'VoiceQueuesPreview':function(_0x3c4640){var _0x1246e3=this;return new Promise(function(_0x15c0d3,_0x45add5){_0xc5a3d3[_0x2ce2('0x71')](_0x3c4640['id'])[_0x2ce2('0x18')](function(_0x5072ed){_0x15c0d3({'code':0xc8,'message':_0x5072ed[_0x2ce2('0x19')]});})['catch'](function(_0x2c5df3){_0x45add5(_0x1246e3[_0x2ce2('0x1b')](0x1f4,_0x2c5df3[_0x2ce2('0x19')]));});});},'EventManager':function(_0x237538){var _0x4dd36b=this;return new Promise(function(_0x2eaa1d,_0xc94fa1){if(!_0x237538[_0x2ce2('0x72')]){return _0xc94fa1(_0x4dd36b[_0x2ce2('0x1b')](0x1f4,_0x2ce2('0x73')));}ami['emit'](_0x2ce2('0x74')+_0x237538[_0x2ce2('0x72')],_0x237538['message']);_0x2eaa1d({'code':0xc8,'message':_0x237538});});},'FaxAccounts':function(_0x57a642){return new Promise(function(_0x1b8432,_0x150593){var _0x237ead=_[_0x2ce2('0x50')](_0x470a06[_0x2ce2('0x75')]);_0x1b8432({'count':_0x237ead[_0x2ce2('0x4f')],'rows':_0x237ead});});},'SendFax':function(_0x5857ed){var _0xa3cce2=this;return new Promise(function(_0x56cf2b,_0x35ee98){_0x25110e[_0x2ce2('0x76')](_0x5857ed)['then'](function(_0x35c546){_0x56cf2b({'code':0xc8,'message':_0x35c546[_0x2ce2('0x19')]});})['catch'](function(_0x41ae02){_0x35ee98(_0xa3cce2[_0x2ce2('0x1b')](0x1f4,_0x41ae02[_0x2ce2('0x19')]));});});},'CheckAfterSend':function(_0x25c152){var _0x1e38f6=this;return new Promise(function(_0x2bf4dc,_0x32a124){_0x25110e[_0x2ce2('0x77')](_0x25c152)[_0x2ce2('0x18')](function(_0xd7e137){_0x2bf4dc({'code':0xc8,'message':_0xd7e137['message']});})[_0x2ce2('0x1a')](function(_0x5934f3){_0x32a124(_0x1e38f6[_0x2ce2('0x1b')](0x1f4,_0x5934f3[_0x2ce2('0x19')]));});});}};var _0x14ecfa=jayson['server'](_0x4d0c17)[_0x2ce2('0x78')]();_0x14ecfa['on'](_0x2ce2('0x1b'),function(_0x2fd1d0){return _0x6515b5(_0x2fd1d0);});_0x14ecfa[_0x2ce2('0x7')](0x232a,'127.0.0.1',function(){console['log'](_0x2ce2('0x79'),0x232a);return _0x29f060(_0x2ce2('0x7a')+0x232a);});});};
\ No newline at end of file
index 8749564..034da0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6808=['util','lodash','../../../../config/logger','../../rpc/cmContact','localhost','info','stringify','emit','exec','autoCreate','data2','data1','calleridnum','calleridname','<unknown>','uniqueid','firstName','destcalleridname','destcalleridnum','resolve','showContact','user:%s','format','trigger:%s','action','toLowerCase','merge','createContact','then','xmd-contactid2','name','catch','Error\x20creating\x20contact','bluebird'];(function(_0x4c1ffb,_0x6839a8){var _0x360df6=function(_0x30d4eb){while(--_0x30d4eb){_0x4c1ffb['push'](_0x4c1ffb['shift']());}};_0x360df6(++_0x6839a8);}(_0x6808,0x197));var _0x8680=function(_0x50c12f,_0x28e72b){_0x50c12f=_0x50c12f-0x0;var _0x544cb6=_0x6808[_0x50c12f];return _0x544cb6;};'use strict';var BPromise=require(_0x8680('0x0'));var util=require(_0x8680('0x1'));var _=require(_0x8680('0x2'));var logger=require(_0x8680('0x3'))('trigger');var cmContactRpc=require(_0x8680('0x4'));var io=require('socket.io-emitter')({'host':_0x8680('0x5'),'port':0x18eb});function emit(_0x493c4d,_0x2d3e66,_0x13b22c){logger[_0x8680('0x6')](_0x493c4d,_0x2d3e66,JSON[_0x8680('0x7')](_0x13b22c));io['to'](_0x493c4d)[_0x8680('0x8')](_0x2d3e66,_0x13b22c);}exports[_0x8680('0x9')]=function(_0x2ee4d2,_0x3d4822,_0x97b33c){_0x97b33c[_0x8680('0xa')]=0x0;if(_0x3d4822[_0x8680('0xb')]&&parseInt(_0x3d4822[_0x8680('0xb')],0xa)){var _0x4d8420={'ListId':parseInt(_0x3d4822[_0x8680('0xc')],0xa),'phone':_0x97b33c[_0x8680('0xd')]};if(_['isNil'](_0x97b33c['routeId'])){_0x4d8420['firstName']=_0x97b33c['calleridname']&&_0x97b33c[_0x8680('0xe')]!==_0x8680('0xf')?_0x97b33c[_0x8680('0xe')]:_0x97b33c[_0x8680('0xd')]||_0x97b33c[_0x8680('0x10')];}else{_0x4d8420[_0x8680('0x11')]=_0x97b33c[_0x8680('0x12')]&&_0x97b33c[_0x8680('0x12')]!==_0x8680('0xf')?_0x97b33c[_0x8680('0x12')]:_0x97b33c[_0x8680('0x13')]||_0x97b33c['uniqueid'];_0x4d8420['phone']=_0x97b33c['destcalleridname']&&_0x97b33c[_0x8680('0x12')]!==_0x8680('0xf')?_0x97b33c[_0x8680('0x12')]:_0x97b33c['destcalleridnum']||_0x97b33c[_0x8680('0x10')];}BPromise[_0x8680('0x14')]()['then'](cmContactRpc[_0x8680('0x15')]({'where':_['omit'](_0x4d8420,['firstName'])}))['then'](function(_0x286a4f){if(_0x286a4f){_0x97b33c['xmd-contactid2']=_0x286a4f['id'];emit(util['format'](_0x8680('0x16'),_0x2ee4d2['name']),util[_0x8680('0x17')](_0x8680('0x18'),_0x3d4822[_0x8680('0x19')][_0x8680('0x1a')]()),_[_0x8680('0x1b')](_0x97b33c,{'ListId':parseInt(_0x3d4822[_0x8680('0xc')],0xa)}));return;}else{return BPromise[_0x8680('0x14')]()['then'](cmContactRpc[_0x8680('0x1c')](_0x4d8420));}})[_0x8680('0x1d')](function(_0x35efcc){if(_0x35efcc){_0x97b33c[_0x8680('0x1e')]=_0x35efcc['id'];emit(util[_0x8680('0x17')](_0x8680('0x16'),_0x2ee4d2[_0x8680('0x1f')]),util[_0x8680('0x17')](_0x8680('0x18'),_0x3d4822[_0x8680('0x19')][_0x8680('0x1a')]()),_['merge'](_0x97b33c,{'ListId':parseInt(_0x3d4822[_0x8680('0xc')],0xa)}));}})[_0x8680('0x20')](function(_0x194fb2){logger['error'](_0x8680('0x21'),JSON['stringify'](_0x194fb2));});}else{if(_0x2ee4d2){emit(util[_0x8680('0x17')]('user:%s',_0x2ee4d2[_0x8680('0x1f')]),util[_0x8680('0x17')]('trigger:%s',_0x3d4822[_0x8680('0x19')][_0x8680('0x1a')]()),_['merge']({'ListId':parseInt(_0x3d4822[_0x8680('0xc')],0xa)},_0x97b33c));}}};
\ No newline at end of file
+var _0xe9e7=['firstName','<unknown>','calleridname','uniqueid','destcalleridname','destcalleridnum','phone','resolve','omit','then','format','user:%s','name','trigger:%s','action','toLowerCase','merge','createContact','xmd-contactid2','catch','Error\x20creating\x20contact','bluebird','lodash','../../../../config/logger','trigger','../../rpc/cmContact','localhost','stringify','emit','exec','autoCreate','data2','data1','calleridnum'];(function(_0x3243ca,_0x47c495){var _0x3b74e7=function(_0x3f147b){while(--_0x3f147b){_0x3243ca['push'](_0x3243ca['shift']());}};_0x3b74e7(++_0x47c495);}(_0xe9e7,0x1cf));var _0x7e9e=function(_0x540904,_0x103e30){_0x540904=_0x540904-0x0;var _0x3f40b8=_0xe9e7[_0x540904];return _0x3f40b8;};'use strict';var BPromise=require(_0x7e9e('0x0'));var util=require('util');var _=require(_0x7e9e('0x1'));var logger=require(_0x7e9e('0x2'))(_0x7e9e('0x3'));var cmContactRpc=require(_0x7e9e('0x4'));var io=require('socket.io-emitter')({'host':_0x7e9e('0x5'),'port':0x18eb});function emit(_0x13fa26,_0x37d609,_0x3f66d1){logger['info'](_0x13fa26,_0x37d609,JSON[_0x7e9e('0x6')](_0x3f66d1));io['to'](_0x13fa26)[_0x7e9e('0x7')](_0x37d609,_0x3f66d1);}exports[_0x7e9e('0x8')]=function(_0x416036,_0x5e8fa9,_0x54a28e){_0x54a28e[_0x7e9e('0x9')]=0x0;if(_0x5e8fa9[_0x7e9e('0xa')]&&parseInt(_0x5e8fa9['data2'],0xa)){var _0x14a36b={'ListId':parseInt(_0x5e8fa9[_0x7e9e('0xb')],0xa),'phone':_0x54a28e[_0x7e9e('0xc')]};if(_['isNil'](_0x54a28e['routeId'])){_0x14a36b[_0x7e9e('0xd')]=_0x54a28e['calleridname']&&_0x54a28e['calleridname']!==_0x7e9e('0xe')?_0x54a28e[_0x7e9e('0xf')]:_0x54a28e[_0x7e9e('0xc')]||_0x54a28e[_0x7e9e('0x10')];}else{_0x14a36b[_0x7e9e('0xd')]=_0x54a28e['destcalleridname']&&_0x54a28e[_0x7e9e('0x11')]!=='<unknown>'?_0x54a28e[_0x7e9e('0x11')]:_0x54a28e[_0x7e9e('0x12')]||_0x54a28e[_0x7e9e('0x10')];_0x14a36b[_0x7e9e('0x13')]=_0x54a28e[_0x7e9e('0x11')]&&_0x54a28e['destcalleridname']!==_0x7e9e('0xe')?_0x54a28e['destcalleridname']:_0x54a28e[_0x7e9e('0x12')]||_0x54a28e['uniqueid'];}BPromise[_0x7e9e('0x14')]()['then'](cmContactRpc['showContact']({'where':_[_0x7e9e('0x15')](_0x14a36b,[_0x7e9e('0xd')])}))[_0x7e9e('0x16')](function(_0xddf220){if(_0xddf220){_0x54a28e['xmd-contactid2']=_0xddf220['id'];emit(util[_0x7e9e('0x17')](_0x7e9e('0x18'),_0x416036[_0x7e9e('0x19')]),util[_0x7e9e('0x17')](_0x7e9e('0x1a'),_0x5e8fa9[_0x7e9e('0x1b')][_0x7e9e('0x1c')]()),_[_0x7e9e('0x1d')](_0x54a28e,{'ListId':parseInt(_0x5e8fa9[_0x7e9e('0xb')],0xa)}));return;}else{return BPromise['resolve']()[_0x7e9e('0x16')](cmContactRpc[_0x7e9e('0x1e')](_0x14a36b));}})['then'](function(_0x4c2862){if(_0x4c2862){_0x54a28e[_0x7e9e('0x1f')]=_0x4c2862['id'];emit(util[_0x7e9e('0x17')]('user:%s',_0x416036[_0x7e9e('0x19')]),util[_0x7e9e('0x17')](_0x7e9e('0x1a'),_0x5e8fa9[_0x7e9e('0x1b')][_0x7e9e('0x1c')]()),_[_0x7e9e('0x1d')](_0x54a28e,{'ListId':parseInt(_0x5e8fa9['data1'],0xa)}));}})[_0x7e9e('0x20')](function(_0x3bae21){logger['error'](_0x7e9e('0x21'),JSON[_0x7e9e('0x6')](_0x3bae21));});}else{if(_0x416036){emit(util['format'](_0x7e9e('0x18'),_0x416036['name']),util[_0x7e9e('0x17')](_0x7e9e('0x1a'),_0x5e8fa9[_0x7e9e('0x1b')][_0x7e9e('0x1c')]()),_['merge']({'ListId':parseInt(_0x5e8fa9[_0x7e9e('0xb')],0xa)},_0x54a28e));}}};
\ No newline at end of file
index e1f39bd..8278f51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a19=['query','search','AllConditions','every','checkConditions','channel','AnyConditions','some','field','account','chat','ChatWebsiteId','value','upperFirst','AccountId','message','operator','event','queue','lastevent','exports','url','mustache','./urlforward','./integration','./cmContact','../rpc/cmContact','../../../config/logger','trigger','../ami','socket.io-emitter','localhost','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','accounts','vtigerAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:dialbegin','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','info','stringify','emit','status','checkTrigger','merge','variables','Actions','length','interface','motionbar','data1','TemplateId','data2','html','render','uri','buildUri','isNil','data3','data4','location','windowWidth','data5','800','windowHeight','600','data6','winApplication','format','name','trigger:%s:%s','action','toLowerCase','jscripty','user:%s','contactmanager','exec','integration','routeId','urlforward','parse'];(function(_0x998bf1,_0x459392){var _0x581025=function(_0x47aa4c){while(--_0x47aa4c){_0x998bf1['push'](_0x998bf1['shift']());}};_0x581025(++_0x459392);}(_0x6a19,0x144));var _0x96a1=function(_0x154c0e,_0x1390ca){_0x154c0e=_0x154c0e-0x0;var _0x2e57fe=_0x6a19[_0x154c0e];return _0x2e57fe;};'use strict';var util=require('util');var _=require('lodash');var url=require(_0x96a1('0x0'));var Mustache=require(_0x96a1('0x1'));var urlforward=require(_0x96a1('0x2'));var integration=require(_0x96a1('0x3'));var cmContact=require(_0x96a1('0x4'));var cmContactRpc=require(_0x96a1('0x5'));var logger=require(_0x96a1('0x6'))(_0x96a1('0x7'));var ami=require(_0x96a1('0x8'));var io=require(_0x96a1('0x9'))({'host':_0x96a1('0xa'),'port':0x18eb});var operators={'equals':function(_0x5b7d76,_0x4fe712){return _0x5b7d76==_0x4fe712;},'not_equals':function(_0x173eb0,_0xb84ff5){return _0x173eb0!=_0xb84ff5;}};var barAndWebActions=['popup',_0x96a1('0x0'),_0x96a1('0xb')];function Trigger(_0x199ce9){this[_0x96a1('0xc')]=_0x199ce9['triggers'];this[_0x96a1('0xd')]=_0x199ce9['agents'];this[_0x96a1('0xe')]=_0x199ce9['voiceQueues'];this[_0x96a1('0xf')]=_0x199ce9['templates'];this[_0x96a1('0x10')]=_0x199ce9[_0x96a1('0x10')];this['zendeskAccounts']=_0x199ce9[_0x96a1('0x11')];this[_0x96a1('0x12')]=_0x199ce9[_0x96a1('0x12')];this[_0x96a1('0x13')]=_0x199ce9[_0x96a1('0x13')];this[_0x96a1('0x14')]=_0x199ce9[_0x96a1('0x14')];this[_0x96a1('0x15')]=_0x199ce9['zohoAccounts'];this[_0x96a1('0x16')]=_0x199ce9[_0x96a1('0x16')];this['vtigerAccounts']=_0x199ce9['vtigerAccounts'];this[_0x96a1('0x17')]={'zendesk':this[_0x96a1('0x11')],'salesforce':this[_0x96a1('0x13')],'freshdesk':this[_0x96a1('0x12')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x96a1('0x15')],'desk':this[_0x96a1('0x16')],'vtiger':this[_0x96a1('0x18')]};ami['on'](_0x96a1('0x19'),this[_0x96a1('0x1a')][_0x96a1('0x1b')](this));ami['on']('custom:agentconnect',this['syncCustomEvent'][_0x96a1('0x1b')](this));ami['on'](_0x96a1('0x1c'),this[_0x96a1('0x1a')][_0x96a1('0x1b')](this));ami['on'](_0x96a1('0x1d'),this[_0x96a1('0x1a')][_0x96a1('0x1b')](this));ami['on']('custom:queuecallerabandon',this['syncCustomEvent'][_0x96a1('0x1b')](this));ami['on'](_0x96a1('0x1e'),this['syncCustomEvent'][_0x96a1('0x1b')](this));ami['on'](_0x96a1('0x1f'),this[_0x96a1('0x1a')][_0x96a1('0x1b')](this));ami['on']('custom:dialend',this[_0x96a1('0x1a')][_0x96a1('0x1b')](this));ami['on'](_0x96a1('0x20'),this[_0x96a1('0x1a')][_0x96a1('0x1b')](this));ami['on'](_0x96a1('0x21'),this[_0x96a1('0x1a')][_0x96a1('0x1b')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent']['bind'](this));ami['on'](_0x96a1('0x22'),this[_0x96a1('0x1a')]['bind'](this));ami['on'](_0x96a1('0x23'),this[_0x96a1('0x1a')][_0x96a1('0x1b')](this));ami['on'](_0x96a1('0x24'),this[_0x96a1('0x1a')]['bind'](this));}Trigger[_0x96a1('0x25')]['emit']=function(_0x35526a,_0x2d7c37,_0x5227fb){logger[_0x96a1('0x26')](_0x35526a,_0x2d7c37,JSON[_0x96a1('0x27')](_0x5227fb));io['to'](_0x35526a)[_0x96a1('0x28')](_0x2d7c37,_0x5227fb);};Trigger[_0x96a1('0x25')][_0x96a1('0x1a')]=function(_0x49f1fd){var _0x297bf6=_['clone'](_0x49f1fd);this['checkTriggers'](_0x297bf6);};Trigger[_0x96a1('0x25')]['checkTriggers']=function(_0x2afb83){var _0x1ae97a;for(var _0x29bb3a in this[_0x96a1('0xc')]){if(this[_0x96a1('0xc')]['hasOwnProperty'](_0x29bb3a)){if(this['triggers'][_0x29bb3a][_0x96a1('0x29')]){_0x1ae97a=this[_0x96a1('0x2a')](this[_0x96a1('0xc')][_0x29bb3a],_0x2afb83);if(_0x1ae97a){_[_0x96a1('0x2b')](_0x2afb83,_0x2afb83[_0x96a1('0x2c')]);for(var _0x56af55=0x0,_0x25afa8,_0x837bff,_0x17523f;_0x56af55<this[_0x96a1('0xc')][_0x29bb3a][_0x96a1('0x2d')][_0x96a1('0x2e')];_0x56af55+=0x1){_0x25afa8=this[_0x96a1('0xc')][_0x29bb3a][_0x96a1('0x2d')][_0x56af55];if(this[_0x96a1('0xd')][_0x2afb83[_0x96a1('0x2f')]]){switch(_0x25afa8['action']['toLowerCase']()){case _0x96a1('0x30'):case'browser':var _0x3ee980={};switch(barAndWebActions[_0x25afa8[_0x96a1('0x31')]]){case'popup':_0x3ee980[_0x96a1('0x32')]=_0x25afa8[_0x96a1('0x33')];_0x3ee980[_0x96a1('0x34')]=this[_0x96a1('0xf')][_0x25afa8[_0x96a1('0x33')]]?Mustache[_0x96a1('0x35')](this[_0x96a1('0xf')][_0x25afa8['data2']][_0x96a1('0x34')],_0x2afb83):'template\x20not\x20found';break;case _0x96a1('0x0'):_0x3ee980[_0x96a1('0x36')]=this[_0x96a1('0x37')](_0x25afa8[_0x96a1('0x33')],_0x2afb83,_[_0x96a1('0x38')](_0x25afa8[_0x96a1('0x39')])?!![]:parseInt(_0x25afa8[_0x96a1('0x39')],0xa));if(_[_0x96a1('0x38')](_0x25afa8[_0x96a1('0x3a')])){_0x3ee980[_0x96a1('0x3b')]='0';}else{_0x3ee980['uriLocation']=_0x25afa8[_0x96a1('0x3a')];_0x3ee980[_0x96a1('0x3c')]=_[_0x96a1('0x38')](_0x25afa8[_0x96a1('0x3d')])?_0x96a1('0x3e'):_0x25afa8[_0x96a1('0x3d')];_0x3ee980[_0x96a1('0x3f')]=_[_0x96a1('0x38')](_0x25afa8['data6'])?_0x96a1('0x40'):_0x25afa8[_0x96a1('0x41')];}break;case _0x96a1('0xb'):_0x3ee980[_0x96a1('0x42')]=_0x25afa8['data2']?Mustache[_0x96a1('0x35')](_0x25afa8[_0x96a1('0x33')],_0x2afb83):'';_0x3ee980['winArguments']=_0x25afa8[_0x96a1('0x39')]?Mustache[_0x96a1('0x35')](_0x25afa8[_0x96a1('0x39')],_0x2afb83):'';break;}this[_0x96a1('0x28')](util[_0x96a1('0x43')]('user:%s',this['agents'][_0x2afb83[_0x96a1('0x2f')]][_0x96a1('0x44')]),util[_0x96a1('0x43')](_0x96a1('0x45'),_0x25afa8[_0x96a1('0x46')][_0x96a1('0x47')](),barAndWebActions[_0x25afa8[_0x96a1('0x31')]]),_[_0x96a1('0x2b')](_0x3ee980,_0x2afb83));break;case _0x96a1('0x48'):this[_0x96a1('0x28')](util[_0x96a1('0x43')](_0x96a1('0x49'),this[_0x96a1('0xd')][_0x2afb83[_0x96a1('0x2f')]][_0x96a1('0x44')]),util[_0x96a1('0x43')]('trigger:%s',_0x25afa8[_0x96a1('0x46')][_0x96a1('0x47')]()),_[_0x96a1('0x2b')]({'ProjectId':parseInt(_0x25afa8['data1'],0xa)},_0x2afb83));break;default:this[_0x96a1('0x28')](util[_0x96a1('0x43')](_0x96a1('0x49'),this[_0x96a1('0xd')][_0x2afb83[_0x96a1('0x2f')]][_0x96a1('0x44')]),util[_0x96a1('0x43')]('trigger:%s',_0x25afa8[_0x96a1('0x46')][_0x96a1('0x47')]()),_['merge']({},_0x25afa8,_0x2afb83));}}switch(_0x25afa8[_0x96a1('0x46')][_0x96a1('0x47')]()){case _0x96a1('0x4a'):cmContact[_0x96a1('0x4b')](this[_0x96a1('0xd')][_0x2afb83[_0x96a1('0x2f')]],_0x25afa8,_0x2afb83,cmContactRpc);break;case _0x96a1('0x4c'):integration[_0x96a1('0x4b')](_0x25afa8,_0x2afb83,this[_0x96a1('0x17')],this[_0x96a1('0xd')][_0x2afb83[_0x96a1('0x2f')]],this[_0x96a1('0xe')][_0x2afb83['queue']],this[_0x96a1('0x10')][_0x2afb83[_0x96a1('0x4d')]]);break;case _0x96a1('0x4e'):urlforward['exec'](_0x25afa8,_0x2afb83);break;}}}}}}};Trigger['prototype'][_0x96a1('0x37')]=function(_0x5b0d0d,_0x35349d,_0x5993c7){var _0x36c72c=url[_0x96a1('0x4f')](Mustache[_0x96a1('0x35')](_0x5b0d0d,_0x35349d),!![]);if(_0x5993c7){_[_0x96a1('0x2b')](_0x36c72c[_0x96a1('0x50')],_0x35349d);}delete _0x36c72c[_0x96a1('0x51')];return url[_0x96a1('0x43')](_0x36c72c);};Trigger[_0x96a1('0x25')][_0x96a1('0x2a')]=function(_0x3f624d,_0x538024){var _0x3d479f=!![],_0x2c44ea=!![];if(_0x3f624d[_0x96a1('0x52')][_0x96a1('0x2e')]){_0x3d479f=_[_0x96a1('0x53')](_0x3f624d[_0x96a1('0x52')],this[_0x96a1('0x54')](_0x538024,_0x3f624d[_0x96a1('0x55')]));}if(_0x3f624d[_0x96a1('0x56')][_0x96a1('0x2e')]){_0x2c44ea=_[_0x96a1('0x57')](_0x3f624d[_0x96a1('0x56')],this[_0x96a1('0x54')](_0x538024,_0x3f624d['channel']));}return _0x3d479f&&_0x2c44ea;};Trigger[_0x96a1('0x25')][_0x96a1('0x54')]=function(_0x268b34,_0x33c950){return function(_0x1ea06a){switch(_0x1ea06a[_0x96a1('0x58')]){case _0x96a1('0x59'):if(_0x268b34[_0x96a1('0x55')]===_0x33c950){if(_0x33c950===_0x96a1('0x5a')){return _0x268b34[_0x96a1('0x5b')]?operators[_0x1ea06a['operator']](Number(_0x1ea06a[_0x96a1('0x5c')]),_0x268b34[_0x96a1('0x5b')]):![];}else{return _0x268b34[_[_0x96a1('0x5d')](_0x33c950)+_0x96a1('0x5e')]?operators[_0x1ea06a['operator']](Number(_0x1ea06a[_0x96a1('0x5c')]),_0x268b34[_[_0x96a1('0x5d')](_0x33c950)+_0x96a1('0x5e')]):![];}}break;case'interaction':case _0x96a1('0x5f'):if(_0x268b34['channel']===_0x33c950){return _0x268b34['event']?operators[_0x1ea06a[_0x96a1('0x60')]](_0x1ea06a[_0x96a1('0x5c')],_0x268b34[_0x96a1('0x61')]):![];}break;case _0x96a1('0x62'):return _0x268b34[_0x96a1('0x62')]?operators[_0x1ea06a['operator']](_0x1ea06a[_0x96a1('0x5c')],_0x268b34[_0x96a1('0x62')]):![];case _0x96a1('0x63'):return _0x268b34[_0x96a1('0x63')]?operators[_0x1ea06a[_0x96a1('0x60')]](_0x1ea06a[_0x96a1('0x5c')],_0x268b34['lastevent']):![];case _0x96a1('0x4d'):return _0x268b34[_0x96a1('0x4d')]?operators[_0x1ea06a[_0x96a1('0x60')]](_0x1ea06a[_0x96a1('0x5c')],_0x268b34[_0x96a1('0x4d')]):![];}return![];};};module[_0x96a1('0x64')]=Trigger;
\ No newline at end of file
+var _0xf4eb=['hasOwnProperty','status','checkTrigger','merge','length','Actions','interface','action','motionbar','browser','data1','popup','data2','render','html','template\x20not\x20found','url','uri','buildUri','data3','isNil','location','data4','windowWidth','data5','windowHeight','data6','winApplication','winArguments','user:%s','format','trigger:%s:%s','toLowerCase','trigger:%s','contactmanager','integration','exec','queue','routeId','urlforward','parse','query','AllConditions','every','checkConditions','channel','AnyConditions','account','ChatWebsiteId','operator','value','upperFirst','interaction','event','lastevent','exports','util','./integration','../../../config/logger','trigger','../ami','socket.io-emitter','localhost','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','accounts','custom:agentcalled','bind','custom:agentringnoanswer','syncCustomEvent','custom:queuecallerabandon','custom:dialbegin','custom:dialconnect','custom:closedinteraction','custom:outgoingmessage','prototype','emit','info','checkTriggers'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf4eb,0xec));var _0xbf4e=function(_0x58e961,_0x5dfa19){_0x58e961=_0x58e961-0x0;var _0x1bb783=_0xf4eb[_0x58e961];return _0x1bb783;};'use strict';var util=require(_0xbf4e('0x0'));var _=require('lodash');var url=require('url');var Mustache=require('mustache');var urlforward=require('./urlforward');var integration=require(_0xbf4e('0x1'));var cmContact=require('./cmContact');var cmContactRpc=require('../rpc/cmContact');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var ami=require(_0xbf4e('0x4'));var io=require(_0xbf4e('0x5'))({'host':_0xbf4e('0x6'),'port':0x18eb});var operators={'equals':function(_0x2fcfed,_0x15b99f){return _0x2fcfed==_0x15b99f;},'not_equals':function(_0x540736,_0x449d55){return _0x540736!=_0x449d55;}};var barAndWebActions=['popup','url',_0xbf4e('0x7')];function Trigger(_0x3761c1){this[_0xbf4e('0x8')]=_0x3761c1[_0xbf4e('0x8')];this[_0xbf4e('0x9')]=_0x3761c1[_0xbf4e('0x9')];this[_0xbf4e('0xa')]=_0x3761c1['voiceQueues'];this['templates']=_0x3761c1[_0xbf4e('0xb')];this['voiceExtensions']=_0x3761c1[_0xbf4e('0xc')];this[_0xbf4e('0xd')]=_0x3761c1['zendeskAccounts'];this[_0xbf4e('0xe')]=_0x3761c1['freshdeskAccounts'];this['salesforceAccounts']=_0x3761c1[_0xbf4e('0xf')];this[_0xbf4e('0x10')]=_0x3761c1[_0xbf4e('0x10')];this[_0xbf4e('0x11')]=_0x3761c1[_0xbf4e('0x11')];this[_0xbf4e('0x12')]=_0x3761c1['deskAccounts'];this['vtigerAccounts']=_0x3761c1[_0xbf4e('0x13')];this[_0xbf4e('0x14')]={'zendesk':this[_0xbf4e('0xd')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0xbf4e('0xe')],'sugarcrm':this[_0xbf4e('0x10')],'zoho':this[_0xbf4e('0x11')],'desk':this[_0xbf4e('0x12')],'vtiger':this['vtigerAccounts']};ami['on'](_0xbf4e('0x15'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentconnect',this['syncCustomEvent'][_0xbf4e('0x16')](this));ami['on'](_0xbf4e('0x17'),this[_0xbf4e('0x18')]['bind'](this));ami['on']('custom:agentcomplete',this[_0xbf4e('0x18')][_0xbf4e('0x16')](this));ami['on'](_0xbf4e('0x19'),this[_0xbf4e('0x18')][_0xbf4e('0x16')](this));ami['on'](_0xbf4e('0x1a'),this[_0xbf4e('0x18')][_0xbf4e('0x16')](this));ami['on'](_0xbf4e('0x1b'),this[_0xbf4e('0x18')][_0xbf4e('0x16')](this));ami['on']('custom:dialend',this[_0xbf4e('0x18')][_0xbf4e('0x16')](this));ami['on']('custom:newinteraction',this[_0xbf4e('0x18')][_0xbf4e('0x16')](this));ami['on'](_0xbf4e('0x1c'),this[_0xbf4e('0x18')][_0xbf4e('0x16')](this));ami['on']('custom:incomingmessage',this[_0xbf4e('0x18')][_0xbf4e('0x16')](this));ami['on'](_0xbf4e('0x1d'),this['syncCustomEvent'][_0xbf4e('0x16')](this));ami['on']('custom:acceptmessage',this['syncCustomEvent'][_0xbf4e('0x16')](this));ami['on']('custom:rejectmessage',this[_0xbf4e('0x18')][_0xbf4e('0x16')](this));}Trigger[_0xbf4e('0x1e')][_0xbf4e('0x1f')]=function(_0x5c912f,_0x2d4686,_0x8e0ab5){logger[_0xbf4e('0x20')](_0x5c912f,_0x2d4686,JSON['stringify'](_0x8e0ab5));io['to'](_0x5c912f)[_0xbf4e('0x1f')](_0x2d4686,_0x8e0ab5);};Trigger['prototype'][_0xbf4e('0x18')]=function(_0x1421e1){var _0xb8b58e=_['clone'](_0x1421e1);this[_0xbf4e('0x21')](_0xb8b58e);};Trigger[_0xbf4e('0x1e')][_0xbf4e('0x21')]=function(_0xc7ca87){var _0x2343dd;for(var _0x3b5776 in this['triggers']){if(this[_0xbf4e('0x8')][_0xbf4e('0x22')](_0x3b5776)){if(this['triggers'][_0x3b5776][_0xbf4e('0x23')]){_0x2343dd=this[_0xbf4e('0x24')](this['triggers'][_0x3b5776],_0xc7ca87);if(_0x2343dd){_[_0xbf4e('0x25')](_0xc7ca87,_0xc7ca87['variables']);for(var _0x10722a=0x0,_0x59b161,_0x2f49d8,_0x2f5a2b;_0x10722a<this[_0xbf4e('0x8')][_0x3b5776]['Actions'][_0xbf4e('0x26')];_0x10722a+=0x1){_0x59b161=this[_0xbf4e('0x8')][_0x3b5776][_0xbf4e('0x27')][_0x10722a];if(this[_0xbf4e('0x9')][_0xc7ca87[_0xbf4e('0x28')]]){switch(_0x59b161[_0xbf4e('0x29')]['toLowerCase']()){case _0xbf4e('0x2a'):case _0xbf4e('0x2b'):var _0x25b837={};switch(barAndWebActions[_0x59b161[_0xbf4e('0x2c')]]){case _0xbf4e('0x2d'):_0x25b837['TemplateId']=_0x59b161['data2'];_0x25b837['html']=this['templates'][_0x59b161[_0xbf4e('0x2e')]]?Mustache[_0xbf4e('0x2f')](this[_0xbf4e('0xb')][_0x59b161[_0xbf4e('0x2e')]][_0xbf4e('0x30')],_0xc7ca87):_0xbf4e('0x31');break;case _0xbf4e('0x32'):_0x25b837[_0xbf4e('0x33')]=this[_0xbf4e('0x34')](_0x59b161['data2'],_0xc7ca87,_['isNil'](_0x59b161[_0xbf4e('0x35')])?!![]:parseInt(_0x59b161[_0xbf4e('0x35')],0xa));if(_[_0xbf4e('0x36')](_0x59b161['data4'])){_0x25b837[_0xbf4e('0x37')]='0';}else{_0x25b837['uriLocation']=_0x59b161[_0xbf4e('0x38')];_0x25b837[_0xbf4e('0x39')]=_[_0xbf4e('0x36')](_0x59b161[_0xbf4e('0x3a')])?'800':_0x59b161[_0xbf4e('0x3a')];_0x25b837[_0xbf4e('0x3b')]=_[_0xbf4e('0x36')](_0x59b161[_0xbf4e('0x3c')])?'600':_0x59b161[_0xbf4e('0x3c')];}break;case _0xbf4e('0x7'):_0x25b837[_0xbf4e('0x3d')]=_0x59b161[_0xbf4e('0x2e')]?Mustache[_0xbf4e('0x2f')](_0x59b161[_0xbf4e('0x2e')],_0xc7ca87):'';_0x25b837[_0xbf4e('0x3e')]=_0x59b161['data3']?Mustache[_0xbf4e('0x2f')](_0x59b161[_0xbf4e('0x35')],_0xc7ca87):'';break;}this['emit'](util['format'](_0xbf4e('0x3f'),this[_0xbf4e('0x9')][_0xc7ca87['interface']]['name']),util[_0xbf4e('0x40')](_0xbf4e('0x41'),_0x59b161[_0xbf4e('0x29')][_0xbf4e('0x42')](),barAndWebActions[_0x59b161[_0xbf4e('0x2c')]]),_[_0xbf4e('0x25')](_0x25b837,_0xc7ca87));break;case'jscripty':this[_0xbf4e('0x1f')](util[_0xbf4e('0x40')]('user:%s',this['agents'][_0xc7ca87['interface']]['name']),util[_0xbf4e('0x40')]('trigger:%s',_0x59b161[_0xbf4e('0x29')][_0xbf4e('0x42')]()),_['merge']({'ProjectId':parseInt(_0x59b161['data1'],0xa)},_0xc7ca87));break;default:this[_0xbf4e('0x1f')](util[_0xbf4e('0x40')](_0xbf4e('0x3f'),this[_0xbf4e('0x9')][_0xc7ca87[_0xbf4e('0x28')]]['name']),util[_0xbf4e('0x40')](_0xbf4e('0x43'),_0x59b161[_0xbf4e('0x29')][_0xbf4e('0x42')]()),_[_0xbf4e('0x25')]({},_0x59b161,_0xc7ca87));}}switch(_0x59b161[_0xbf4e('0x29')][_0xbf4e('0x42')]()){case _0xbf4e('0x44'):cmContact['exec'](this[_0xbf4e('0x9')][_0xc7ca87[_0xbf4e('0x28')]],_0x59b161,_0xc7ca87,cmContactRpc);break;case _0xbf4e('0x45'):integration[_0xbf4e('0x46')](_0x59b161,_0xc7ca87,this[_0xbf4e('0x14')],this[_0xbf4e('0x9')][_0xc7ca87[_0xbf4e('0x28')]],this[_0xbf4e('0xa')][_0xc7ca87[_0xbf4e('0x47')]],this[_0xbf4e('0xc')][_0xc7ca87[_0xbf4e('0x48')]]);break;case _0xbf4e('0x49'):urlforward[_0xbf4e('0x46')](_0x59b161,_0xc7ca87);break;}}}}}}};Trigger[_0xbf4e('0x1e')][_0xbf4e('0x34')]=function(_0x2892ce,_0x10bc23,_0x5492bf){var _0x22d8ef=url[_0xbf4e('0x4a')](Mustache[_0xbf4e('0x2f')](_0x2892ce,_0x10bc23),!![]);if(_0x5492bf){_['merge'](_0x22d8ef[_0xbf4e('0x4b')],_0x10bc23);}delete _0x22d8ef['search'];return url['format'](_0x22d8ef);};Trigger[_0xbf4e('0x1e')][_0xbf4e('0x24')]=function(_0x4d32b3,_0x22e73b){var _0x1ac906=!![],_0x31d779=!![];if(_0x4d32b3[_0xbf4e('0x4c')][_0xbf4e('0x26')]){_0x1ac906=_[_0xbf4e('0x4d')](_0x4d32b3[_0xbf4e('0x4c')],this[_0xbf4e('0x4e')](_0x22e73b,_0x4d32b3[_0xbf4e('0x4f')]));}if(_0x4d32b3[_0xbf4e('0x50')][_0xbf4e('0x26')]){_0x31d779=_['some'](_0x4d32b3['AnyConditions'],this[_0xbf4e('0x4e')](_0x22e73b,_0x4d32b3[_0xbf4e('0x4f')]));}return _0x1ac906&&_0x31d779;};Trigger[_0xbf4e('0x1e')]['checkConditions']=function(_0x339ce6,_0x3924dc){return function(_0x481c06){switch(_0x481c06['field']){case _0xbf4e('0x51'):if(_0x339ce6['channel']===_0x3924dc){if(_0x3924dc==='chat'){return _0x339ce6[_0xbf4e('0x52')]?operators[_0x481c06[_0xbf4e('0x53')]](Number(_0x481c06[_0xbf4e('0x54')]),_0x339ce6[_0xbf4e('0x52')]):![];}else{return _0x339ce6[_[_0xbf4e('0x55')](_0x3924dc)+'AccountId']?operators[_0x481c06[_0xbf4e('0x53')]](Number(_0x481c06['value']),_0x339ce6[_[_0xbf4e('0x55')](_0x3924dc)+'AccountId']):![];}}break;case _0xbf4e('0x56'):case'message':if(_0x339ce6[_0xbf4e('0x4f')]===_0x3924dc){return _0x339ce6[_0xbf4e('0x57')]?operators[_0x481c06[_0xbf4e('0x53')]](_0x481c06[_0xbf4e('0x54')],_0x339ce6[_0xbf4e('0x57')]):![];}break;case'queue':return _0x339ce6['queue']?operators[_0x481c06['operator']](_0x481c06['value'],_0x339ce6[_0xbf4e('0x47')]):![];case _0xbf4e('0x58'):return _0x339ce6['lastevent']?operators[_0x481c06[_0xbf4e('0x53')]](_0x481c06[_0xbf4e('0x54')],_0x339ce6[_0xbf4e('0x58')]):![];case _0xbf4e('0x48'):return _0x339ce6[_0xbf4e('0x48')]?operators[_0x481c06[_0xbf4e('0x53')]](_0x481c06[_0xbf4e('0x54')],_0x339ce6['routeId']):![];}return![];};};module[_0xbf4e('0x59')]=Trigger;
\ No newline at end of file
index daa7f5d..0342303 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a34=['trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','Desk\x20account\x20type\x20not\x20recognized','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridnum','Ticket\x20created!','%s/agent/tickets/%s','abandoned','[ABANDONED]','lodash','request-promise','md5','./util','../../../../config/logger','desk','socket.io-emitter','localhost','emit','application/json','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','stringify','GET','basic','%s:%s','username','password','authType','token','%s/token:%s','Basic\x20%s','toString','Searching\x20enduser\x20with\x20phone','%s/customers/search','remoteUri','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','length','map','nameField','toLowerCase','content','type','string','idField','customField','variable','variableName','customVariable','Variable','name','custom_fields','priority','merge','getString','Subjects','new','Motion','CTI','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s'];(function(_0x4b1665,_0xb0c095){var _0x5850c0=function(_0x44b7a4){while(--_0x44b7a4){_0x4b1665['push'](_0x4b1665['shift']());}};_0x5850c0(++_0xb0c095);}(_0x1a34,0xdc));var _0x41a3=function(_0x32be53,_0x50860d){_0x32be53=_0x32be53-0x0;var _0x10d08e=_0x1a34[_0x32be53];return _0x10d08e;};'use strict';var _=require(_0x41a3('0x0'));var rp=require(_0x41a3('0x1'));var md5=require(_0x41a3('0x2'));var util=require('util');var intUtil=require(_0x41a3('0x3'));var logger=require(_0x41a3('0x4'))(_0x41a3('0x5'));var io=require(_0x41a3('0x6'))({'host':_0x41a3('0x7'),'port':0x18eb});function emit(_0x4cb399,_0xadfab5,_0x4c05ba){io['to'](_0x4cb399)[_0x41a3('0x8')](_0xadfab5,_0x4c05ba);}var headers={'Content-Type':_0x41a3('0x9'),'Accept':_0x41a3('0x9')};function getUser(_0xd4f180,_0x24336e){logger[_0x41a3('0xa')](_0x41a3('0xb'),_0x24336e);return request({'uri':util[_0x41a3('0xc')](_0x41a3('0xd'),_0xd4f180['remoteUri'])})[_0x41a3('0xe')](function(_0x2b8bc4){if(_0x2b8bc4[_0x41a3('0xf')]){return _['find'](_0x2b8bc4['_embedded'][_0x41a3('0x10')],{'email':_0x24336e});}})['then'](function(_0x9f122f){if(_0x9f122f){logger[_0x41a3('0xa')]('Agent\x20found!');return _0x9f122f;}else{logger[_0x41a3('0xa')](_0x41a3('0x11'));return request({'uri':util[_0x41a3('0xc')]('%s/users/me',_0xd4f180['remoteUri'])});}});}function request(_0x3846b3){logger[_0x41a3('0x12')](_0x41a3('0x13'),JSON[_0x41a3('0x14')](_0x3846b3));return rp(_['defaults'](_0x3846b3,{'method':_0x41a3('0x15'),'headers':headers,'json':!![]}));}function getAuth(_0x92cc3e){var _0xe5ff4b;if(_0x92cc3e['authType']===_0x41a3('0x16')){_0xe5ff4b=util[_0x41a3('0xc')](_0x41a3('0x17'),_0x92cc3e[_0x41a3('0x18')],_0x92cc3e[_0x41a3('0x19')]);}else if(_0x92cc3e[_0x41a3('0x1a')]===_0x41a3('0x1b')){_0xe5ff4b=util['format'](_0x41a3('0x1c'),_0x92cc3e['username'],_0x92cc3e[_0x41a3('0x1b')]);}return util[_0x41a3('0xc')](_0x41a3('0x1d'),new Buffer(_0xe5ff4b)[_0x41a3('0x1e')]('base64'));}function getEndUser(_0x411003,_0x5bfe29,_0x4b1493){logger[_0x41a3('0xa')](_0x41a3('0x1f'),_0x4b1493);return request({'uri':util[_0x41a3('0xc')](_0x41a3('0x20'),_0x411003[_0x41a3('0x21')]),'qs':{'phone':_0x4b1493}})[_0x41a3('0xe')](function(_0x23bd9c){if(_0x23bd9c[_0x41a3('0xf')]){logger[_0x41a3('0xa')](_0x41a3('0x22'));return _0x23bd9c['_embedded']['entries'][0x0];}else{logger[_0x41a3('0xa')](_0x41a3('0x23'));return request({'uri':util[_0x41a3('0xc')](_0x41a3('0x24'),_0x411003[_0x41a3('0x21')]),'method':_0x41a3('0x25'),'body':{'first_name':_0x5bfe29,'title':_0x5bfe29,'phone_numbers':[{'type':_0x41a3('0x26'),'value':_0x4b1493}]}});}});}function getTags(_0xf22583,_0x2ed9c2){var _0x1bee71=[];if(_0xf22583&&_0xf22583[_0x41a3('0x27')]>0x0){_0x1bee71=_[_0x41a3('0x28')](_0xf22583,_0x2ed9c2);}return _0x1bee71;}function getCustomFields(_0x46e128,_0x3908c1){var _0x14f317=[];var _0x531edb={'custom_fields':{}};if(_0x46e128[_0x41a3('0x27')]>0x0){_['forEach'](_0x46e128,function(_0x4448b7){if(_0x4448b7['type']==='string'&&_0x4448b7[_0x41a3('0x29')]&&!_0x4448b7['customField']){_0x531edb[_0x4448b7['nameField'][_0x41a3('0x2a')]()]=_0x4448b7[_0x41a3('0x2b')][_0x41a3('0x1e')]();}else if(_0x4448b7[_0x41a3('0x2c')]===_0x41a3('0x2d')&&_0x4448b7[_0x41a3('0x2e')]&&_0x4448b7[_0x41a3('0x2f')]){_0x531edb['custom_fields'][_0x4448b7[_0x41a3('0x2e')]]=_0x4448b7[_0x41a3('0x2b')][_0x41a3('0x1e')]();}else if(_0x4448b7[_0x41a3('0x2c')]===_0x41a3('0x30')&&_0x4448b7[_0x41a3('0x31')]&&_0x4448b7[_0x41a3('0x2e')]&&_0x4448b7[_0x41a3('0x2f')]){_0x3908c1[_0x4448b7[_0x41a3('0x31')]]&&(_0x531edb['custom_fields'][_0x4448b7['idField']]=_0x3908c1[_0x4448b7['variableName']][_0x41a3('0x1e')]());}else if(_0x4448b7[_0x41a3('0x2c')]===_0x41a3('0x32')&&_0x4448b7[_0x41a3('0x33')]&&_0x4448b7[_0x41a3('0x33')][_0x41a3('0x34')]&&_0x4448b7[_0x41a3('0x2e')]&&_0x4448b7[_0x41a3('0x2f')]){_0x3908c1[_0x4448b7[_0x41a3('0x33')][_0x41a3('0x34')]['toLowerCase']()]&&(_0x531edb[_0x41a3('0x35')][_0x4448b7['idField']]=_0x3908c1[_0x4448b7[_0x41a3('0x33')][_0x41a3('0x34')][_0x41a3('0x2a')]()][_0x41a3('0x1e')]());}});}if(_0x531edb['priority']){_0x531edb['priority']=Number(_0x531edb[_0x41a3('0x36')]);}return _0x531edb;}function getTicket(_0x4d304e,_0x3dff1e,_0x231dc1,_0x463c1d,_0x5bb558){logger[_0x41a3('0xa')]('Creating\x20new\x20ticket...');var _0x2595f6=_[_0x41a3('0x37')]({'subject':intUtil[_0x41a3('0x38')](_0x463c1d[_0x41a3('0x39')],_0x5bb558,'\x20'),'type':'phone','status':_0x41a3('0x3a'),'labels':['xCALLY',_0x41a3('0x3b'),_0x41a3('0x3c')]['concat'](getTags(_0x463c1d['Tags'],'name')),'description':intUtil[_0x41a3('0x38')](_0x463c1d[_0x41a3('0x3d')],_0x5bb558,'\x0a'),'_links':{'assigned_user':{'href':util[_0x41a3('0xc')](_0x41a3('0x3e'),_0x3dff1e['id']),'class':_0x41a3('0x3f')}},'message':{'direction':'in','body':intUtil[_0x41a3('0x38')](_0x463c1d[_0x41a3('0x3d')],_0x5bb558,'\x0a')}},getCustomFields(_0x463c1d[_0x41a3('0x40')],_0x5bb558));return request({'uri':util[_0x41a3('0xc')](_0x41a3('0x41'),_0x4d304e[_0x41a3('0x21')],_0x231dc1['id']),'method':_0x41a3('0x25'),'body':_0x2595f6});}exports[_0x41a3('0x42')]=function(_0x43a197,_0x2928ac,_0x13c80e,_0x58151c,_0x2495c5,_0x339876){var _0x196f3b,_0x5bb464;_0x339876[_0x41a3('0x21')]=intUtil[_0x41a3('0x43')](_0x339876['remoteUri']);_0x339876[_0x41a3('0x44')]=intUtil['stripTrailingSlash'](_0x339876[_0x41a3('0x44')]);if(_0x2495c5&&_0x2495c5['monitor_format']){logger['info'](_0x41a3('0x45'),_0x41a3('0x46'));_0x2928ac['recordingURL']=util[_0x41a3('0xc')](_0x41a3('0x47'),_0x339876[_0x41a3('0x44')],_0x2928ac[_0x41a3('0x48')],md5(_0x2928ac[_0x41a3('0x48')]));}else{_0x2928ac[_0x41a3('0x49')]='';}headers['Authorization']=getAuth(_0x339876);return getUser(_0x339876,_0x58151c[_0x41a3('0x4a')])['then'](function(_0xc259d5){_0x196f3b=_0xc259d5;logger[_0x41a3('0xa')](_0x41a3('0x4b'),_0x196f3b['id']);return getEndUser(_0x339876,_0x2928ac[_0x41a3('0x4c')],_0x2928ac[_0x41a3('0x4d')]);})[_0x41a3('0xe')](function(_0x139c92){_0x5bb464=_0x139c92;logger[_0x41a3('0xa')](_0x41a3('0x4e'),_0x5bb464['id']);return getTicket(_0x339876,_0x196f3b,_0x5bb464,_0x13c80e,_0x2928ac);})[_0x41a3('0xe')](function(_0x32514e){if(_0x32514e){logger[_0x41a3('0xa')]('Ticket\x20created!');logger[_0x41a3('0xa')](_0x41a3('0x4f'),_0x32514e['id']);switch(_0x339876[_0x41a3('0x2c')]){case _0x41a3('0x50'):logger[_0x41a3('0xa')](_0x41a3('0x45'),_0x41a3('0x51'));emit(util[_0x41a3('0xc')](_0x41a3('0x52'),_0x58151c[_0x41a3('0x34')]),_0x41a3('0x53'),{'recordId':_0x32514e['id']});break;case _0x41a3('0x54'):logger[_0x41a3('0xa')](_0x41a3('0x45'),_0x41a3('0x55'));emit(util['format'](_0x41a3('0x52'),_0x58151c[_0x41a3('0x34')]),_0x41a3('0x56'),{'uri':util[_0x41a3('0xc')](_0x41a3('0x57'),_0x32514e['id'])});break;default:logger['error']('[QUEUE]',_0x41a3('0x58'));}}})[_0x41a3('0x59')](function(_0x188de0){console['error'](_0x188de0);logger[_0x41a3('0x5a')](_0x41a3('0x45'),JSON['stringify'](_0x188de0));});};exports[_0x41a3('0x5b')]=function(_0x5831c0,_0x3fae5e,_0x5f283f,_0x4637e2,_0x1ea664,_0x3ed1ae,_0x227454){var _0x378bb4,_0x809ae4;_0x3ed1ae[_0x41a3('0x21')]=intUtil[_0x41a3('0x43')](_0x3ed1ae[_0x41a3('0x21')]);_0x3ed1ae['serverUrl']=intUtil['stripTrailingSlash'](_0x3ed1ae[_0x41a3('0x44')]);if(_0x227454&&_0x227454[_0x41a3('0x5c')]&&_0x227454[_0x41a3('0x5c')]!==_0x41a3('0x5d')){logger[_0x41a3('0xa')](_0x41a3('0x5e'),_0x41a3('0x46'));_0x3fae5e[_0x41a3('0x49')]=util[_0x41a3('0xc')](_0x41a3('0x47'),_0x3ed1ae['serverUrl'],_0x3fae5e[_0x41a3('0x48')],md5(_0x3fae5e[_0x41a3('0x48')]));}headers[_0x41a3('0x5f')]=getAuth(_0x3ed1ae);return getUser(_0x3ed1ae,_0x4637e2[_0x41a3('0x4a')])['then'](function(_0x37fc4f){_0x378bb4=_0x37fc4f;logger['info']('The\x20User\x20ID\x20is:',_0x378bb4['id']);return getEndUser(_0x3ed1ae,_0x3fae5e['destcalleridname'],_0x3fae5e[_0x41a3('0x60')]);})[_0x41a3('0xe')](function(_0x4b634f){_0x809ae4=_0x4b634f;logger[_0x41a3('0xa')](_0x41a3('0x4e'),_0x809ae4['id']);return getTicket(_0x3ed1ae,_0x378bb4,_0x809ae4,_0x5f283f,_0x3fae5e);})['then'](function(_0x5d2920){if(_0x5d2920){logger['info'](_0x41a3('0x61'));logger[_0x41a3('0xa')](_0x41a3('0x4f'),_0x5d2920['id']);switch(_0x3ed1ae[_0x41a3('0x2c')]){case _0x41a3('0x50'):logger[_0x41a3('0xa')](_0x41a3('0x45'),_0x41a3('0x51'));emit(util['format']('user:%s',_0x4637e2[_0x41a3('0x34')]),_0x41a3('0x53'),{'recordId':_0x5d2920['id']});break;case _0x41a3('0x54'):logger[_0x41a3('0xa')](_0x41a3('0x45'),_0x41a3('0x55'));emit(util['format'](_0x41a3('0x52'),_0x4637e2[_0x41a3('0x34')]),_0x41a3('0x56'),{'uri':util[_0x41a3('0xc')](_0x41a3('0x62'),_0x3ed1ae[_0x41a3('0x21')],_0x5d2920['id'])});break;default:logger[_0x41a3('0x5a')]('[OUTBOUND]',_0x41a3('0x58'));}}})[_0x41a3('0x59')](function(_0x4ea2a0){logger[_0x41a3('0x5a')](_0x41a3('0x5e'),JSON[_0x41a3('0x14')](_0x4ea2a0));});};exports[_0x41a3('0x63')]=function(_0x2b2d80,_0xf71e3c,_0x383569,_0x2caad1,_0x3d5708,_0x3b5b29){var _0x3468f5,_0x1b4502;_0x3b5b29[_0x41a3('0x21')]=intUtil[_0x41a3('0x43')](_0x3b5b29[_0x41a3('0x21')]);_0x3b5b29['serverUrl']=intUtil['stripTrailingSlash'](_0x3b5b29[_0x41a3('0x44')]);if(_0x3d5708&&_0x3d5708['monitor_format']){logger['info'](_0x41a3('0x64'),_0x41a3('0x46'));_0xf71e3c[_0x41a3('0x49')]=util[_0x41a3('0xc')](_0x41a3('0x47'),_0x3b5b29[_0x41a3('0x44')],_0xf71e3c[_0x41a3('0x48')],md5(_0xf71e3c[_0x41a3('0x48')]));}else{_0xf71e3c[_0x41a3('0x49')]='';}headers[_0x41a3('0x5f')]=getAuth(_0x3b5b29);return getUser(_0x3b5b29)[_0x41a3('0xe')](function(_0x260634){_0x3468f5=_0x260634;logger[_0x41a3('0xa')]('The\x20User\x20ID\x20is:',_0x3468f5['id']);return getEndUser(_0x3b5b29,_0xf71e3c[_0x41a3('0x4c')],_0xf71e3c[_0x41a3('0x4d')]);})[_0x41a3('0xe')](function(_0xa85530){_0x1b4502=_0xa85530;logger[_0x41a3('0xa')](_0x41a3('0x4e'),_0x1b4502['id']);return getTicket(_0x3b5b29,_0x3468f5,_0x1b4502,_0x383569,_0xf71e3c);})[_0x41a3('0xe')](function(_0x23fdc5){if(_0x23fdc5){logger[_0x41a3('0xa')](_0x41a3('0x61'));logger[_0x41a3('0xa')](_0x41a3('0x4f'),_0x23fdc5['id']);}})[_0x41a3('0x59')](function(_0x3732df){logger[_0x41a3('0x5a')](_0x41a3('0x64'),JSON[_0x41a3('0x14')](_0x3732df));});};
\ No newline at end of file
+var _0xd1d7=['entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify','authType','basic','username','token','%s/token:%s','Basic\x20%s','toString','Searching\x20enduser\x20with\x20phone','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','work','map','length','forEach','type','string','nameField','customField','content','idField','custom_fields','variableName','Variable','name','toLowerCase','priority','merge','getString','Subjects','xCALLY','Motion','CTI','concat','Tags','/api/v2/users/%d','user','Descriptions','Fields','%s/customers/%d/cases','POST','serverUrl','stripTrailingSlash','monitor_format','[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:','The\x20Ticket\x20ID\x20is:','user:%s','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','integrationTab','trigger:desk:display','%s/agent/tickets/%s','Desk\x20account\x20type\x20not\x20recognized','abandoned','Ticket\x20created!','[ABANDONED]','request-promise','util','./util','../../../../config/logger','desk','socket.io-emitter','localhost','emit','application/json','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','_embedded'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd1d7,0x176));var _0x7d1d=function(_0x1bdc52,_0x4876a9){_0x1bdc52=_0x1bdc52-0x0;var _0xdf3fa3=_0xd1d7[_0x1bdc52];return _0xdf3fa3;};'use strict';var _=require('lodash');var rp=require(_0x7d1d('0x0'));var md5=require('md5');var util=require(_0x7d1d('0x1'));var intUtil=require(_0x7d1d('0x2'));var logger=require(_0x7d1d('0x3'))(_0x7d1d('0x4'));var io=require(_0x7d1d('0x5'))({'host':_0x7d1d('0x6'),'port':0x18eb});function emit(_0x5ba9cb,_0x127fa6,_0x5b5274){io['to'](_0x5ba9cb)[_0x7d1d('0x7')](_0x127fa6,_0x5b5274);}var headers={'Content-Type':_0x7d1d('0x8'),'Accept':_0x7d1d('0x8')};function getUser(_0x1deb23,_0x1b0c8d){logger[_0x7d1d('0x9')](_0x7d1d('0xa'),_0x1b0c8d);return request({'uri':util[_0x7d1d('0xb')](_0x7d1d('0xc'),_0x1deb23[_0x7d1d('0xd')])})[_0x7d1d('0xe')](function(_0x565c99){if(_0x565c99[_0x7d1d('0xf')]){return _[_0x7d1d('0x10')](_0x565c99[_0x7d1d('0x11')][_0x7d1d('0x12')],{'email':_0x1b0c8d});}})['then'](function(_0x472015){if(_0x472015){logger[_0x7d1d('0x9')]('Agent\x20found!');return _0x472015;}else{logger['info'](_0x7d1d('0x13'));return request({'uri':util[_0x7d1d('0xb')](_0x7d1d('0x14'),_0x1deb23[_0x7d1d('0xd')])});}});}function request(_0x3030d0){logger[_0x7d1d('0x15')](_0x7d1d('0x16'),JSON[_0x7d1d('0x17')](_0x3030d0));return rp(_['defaults'](_0x3030d0,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x1483f5){var _0x688179;if(_0x1483f5[_0x7d1d('0x18')]===_0x7d1d('0x19')){_0x688179=util[_0x7d1d('0xb')]('%s:%s',_0x1483f5[_0x7d1d('0x1a')],_0x1483f5['password']);}else if(_0x1483f5[_0x7d1d('0x18')]===_0x7d1d('0x1b')){_0x688179=util[_0x7d1d('0xb')](_0x7d1d('0x1c'),_0x1483f5[_0x7d1d('0x1a')],_0x1483f5[_0x7d1d('0x1b')]);}return util[_0x7d1d('0xb')](_0x7d1d('0x1d'),new Buffer(_0x688179)[_0x7d1d('0x1e')]('base64'));}function getEndUser(_0x3f92a0,_0x384778,_0x3f4687){logger['info'](_0x7d1d('0x1f'),_0x3f4687);return request({'uri':util['format']('%s/customers/search',_0x3f92a0[_0x7d1d('0xd')]),'qs':{'phone':_0x3f4687}})[_0x7d1d('0xe')](function(_0x302af9){if(_0x302af9[_0x7d1d('0xf')]){logger[_0x7d1d('0x9')]('Enduser\x20found!');return _0x302af9[_0x7d1d('0x11')]['entries'][0x0];}else{logger[_0x7d1d('0x9')](_0x7d1d('0x20'));return request({'uri':util[_0x7d1d('0xb')](_0x7d1d('0x21'),_0x3f92a0[_0x7d1d('0xd')]),'method':'POST','body':{'first_name':_0x384778,'title':_0x384778,'phone_numbers':[{'type':_0x7d1d('0x22'),'value':_0x3f4687}]}});}});}function getTags(_0x296d12,_0x38766b){var _0x269046=[];if(_0x296d12&&_0x296d12['length']>0x0){_0x269046=_[_0x7d1d('0x23')](_0x296d12,_0x38766b);}return _0x269046;}function getCustomFields(_0x26f07a,_0x4df7f1){var _0x411c7c=[];var _0x8495fa={'custom_fields':{}};if(_0x26f07a[_0x7d1d('0x24')]>0x0){_[_0x7d1d('0x25')](_0x26f07a,function(_0x2dcf1b){if(_0x2dcf1b[_0x7d1d('0x26')]===_0x7d1d('0x27')&&_0x2dcf1b[_0x7d1d('0x28')]&&!_0x2dcf1b[_0x7d1d('0x29')]){_0x8495fa[_0x2dcf1b[_0x7d1d('0x28')]['toLowerCase']()]=_0x2dcf1b[_0x7d1d('0x2a')]['toString']();}else if(_0x2dcf1b[_0x7d1d('0x26')]===_0x7d1d('0x27')&&_0x2dcf1b[_0x7d1d('0x2b')]&&_0x2dcf1b[_0x7d1d('0x29')]){_0x8495fa[_0x7d1d('0x2c')][_0x2dcf1b[_0x7d1d('0x2b')]]=_0x2dcf1b[_0x7d1d('0x2a')]['toString']();}else if(_0x2dcf1b[_0x7d1d('0x26')]==='variable'&&_0x2dcf1b['variableName']&&_0x2dcf1b[_0x7d1d('0x2b')]&&_0x2dcf1b[_0x7d1d('0x29')]){_0x4df7f1[_0x2dcf1b['variableName']]&&(_0x8495fa[_0x7d1d('0x2c')][_0x2dcf1b[_0x7d1d('0x2b')]]=_0x4df7f1[_0x2dcf1b[_0x7d1d('0x2d')]][_0x7d1d('0x1e')]());}else if(_0x2dcf1b[_0x7d1d('0x26')]==='customVariable'&&_0x2dcf1b[_0x7d1d('0x2e')]&&_0x2dcf1b[_0x7d1d('0x2e')][_0x7d1d('0x2f')]&&_0x2dcf1b[_0x7d1d('0x2b')]&&_0x2dcf1b[_0x7d1d('0x29')]){_0x4df7f1[_0x2dcf1b[_0x7d1d('0x2e')]['name'][_0x7d1d('0x30')]()]&&(_0x8495fa[_0x7d1d('0x2c')][_0x2dcf1b[_0x7d1d('0x2b')]]=_0x4df7f1[_0x2dcf1b[_0x7d1d('0x2e')]['name']['toLowerCase']()][_0x7d1d('0x1e')]());}});}if(_0x8495fa[_0x7d1d('0x31')]){_0x8495fa[_0x7d1d('0x31')]=Number(_0x8495fa[_0x7d1d('0x31')]);}return _0x8495fa;}function getTicket(_0x1f990e,_0x5424cd,_0x4c1dc5,_0x22b3eb,_0xccba0){logger[_0x7d1d('0x9')]('Creating\x20new\x20ticket...');var _0xc92f6=_[_0x7d1d('0x32')]({'subject':intUtil[_0x7d1d('0x33')](_0x22b3eb[_0x7d1d('0x34')],_0xccba0,'\x20'),'type':'phone','status':'new','labels':[_0x7d1d('0x35'),_0x7d1d('0x36'),_0x7d1d('0x37')][_0x7d1d('0x38')](getTags(_0x22b3eb[_0x7d1d('0x39')],'name')),'description':intUtil[_0x7d1d('0x33')](_0x22b3eb['Descriptions'],_0xccba0,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7d1d('0xb')](_0x7d1d('0x3a'),_0x5424cd['id']),'class':_0x7d1d('0x3b')}},'message':{'direction':'in','body':intUtil[_0x7d1d('0x33')](_0x22b3eb[_0x7d1d('0x3c')],_0xccba0,'\x0a')}},getCustomFields(_0x22b3eb[_0x7d1d('0x3d')],_0xccba0));return request({'uri':util[_0x7d1d('0xb')](_0x7d1d('0x3e'),_0x1f990e['remoteUri'],_0x4c1dc5['id']),'method':_0x7d1d('0x3f'),'body':_0xc92f6});}exports['queue']=function(_0xd5904a,_0x1de399,_0x32bc97,_0x49ed8c,_0x3309f1,_0x2cf8f4){var _0x773fad,_0xc073e3;_0x2cf8f4['remoteUri']=intUtil['stripTrailingSlash'](_0x2cf8f4[_0x7d1d('0xd')]);_0x2cf8f4[_0x7d1d('0x40')]=intUtil[_0x7d1d('0x41')](_0x2cf8f4['serverUrl']);if(_0x3309f1&&_0x3309f1[_0x7d1d('0x42')]){logger[_0x7d1d('0x9')](_0x7d1d('0x43'),'Recording\x20is\x20enabled!');_0x1de399[_0x7d1d('0x44')]=util['format'](_0x7d1d('0x45'),_0x2cf8f4[_0x7d1d('0x40')],_0x1de399[_0x7d1d('0x46')],md5(_0x1de399[_0x7d1d('0x46')]));}else{_0x1de399[_0x7d1d('0x44')]='';}headers[_0x7d1d('0x47')]=getAuth(_0x2cf8f4);return getUser(_0x2cf8f4,_0x49ed8c[_0x7d1d('0x48')])[_0x7d1d('0xe')](function(_0x2dc766){_0x773fad=_0x2dc766;logger[_0x7d1d('0x9')](_0x7d1d('0x49'),_0x773fad['id']);return getEndUser(_0x2cf8f4,_0x1de399[_0x7d1d('0x4a')],_0x1de399[_0x7d1d('0x4b')]);})[_0x7d1d('0xe')](function(_0x3da749){_0xc073e3=_0x3da749;logger['info'](_0x7d1d('0x4c'),_0xc073e3['id']);return getTicket(_0x2cf8f4,_0x773fad,_0xc073e3,_0x32bc97,_0x1de399);})[_0x7d1d('0xe')](function(_0x2d76af){if(_0x2d76af){logger[_0x7d1d('0x9')]('Ticket\x20created!');logger[_0x7d1d('0x9')](_0x7d1d('0x4d'),_0x2d76af['id']);switch(_0x2cf8f4['type']){case'integrationTab':logger[_0x7d1d('0x9')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0x7d1d('0xb')](_0x7d1d('0x4e'),_0x49ed8c[_0x7d1d('0x2f')]),'trigger:desk:display',{'recordId':_0x2d76af['id']});break;case _0x7d1d('0x4f'):logger[_0x7d1d('0x9')](_0x7d1d('0x43'),_0x7d1d('0x50'));emit(util[_0x7d1d('0xb')](_0x7d1d('0x4e'),_0x49ed8c[_0x7d1d('0x2f')]),_0x7d1d('0x51'),{'uri':util['format'](_0x7d1d('0x52'),_0x2d76af['id'])});break;default:logger[_0x7d1d('0x53')](_0x7d1d('0x43'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7d1d('0x54')](function(_0x3bf8ba){console[_0x7d1d('0x53')](_0x3bf8ba);logger['error'](_0x7d1d('0x43'),JSON['stringify'](_0x3bf8ba));});};exports[_0x7d1d('0x55')]=function(_0x3d7751,_0x4174f3,_0xd44768,_0x83a8c5,_0x284777,_0x336349,_0x21795c){var _0x3ca515,_0x41c674;_0x336349[_0x7d1d('0xd')]=intUtil['stripTrailingSlash'](_0x336349['remoteUri']);_0x336349[_0x7d1d('0x40')]=intUtil[_0x7d1d('0x41')](_0x336349['serverUrl']);if(_0x21795c&&_0x21795c[_0x7d1d('0x56')]&&_0x21795c[_0x7d1d('0x56')]!==_0x7d1d('0x57')){logger[_0x7d1d('0x9')](_0x7d1d('0x58'),_0x7d1d('0x59'));_0x4174f3[_0x7d1d('0x44')]=util[_0x7d1d('0xb')](_0x7d1d('0x45'),_0x336349['serverUrl'],_0x4174f3['uniqueid'],md5(_0x4174f3[_0x7d1d('0x46')]));}headers[_0x7d1d('0x47')]=getAuth(_0x336349);return getUser(_0x336349,_0x83a8c5[_0x7d1d('0x48')])[_0x7d1d('0xe')](function(_0x273e99){_0x3ca515=_0x273e99;logger[_0x7d1d('0x9')](_0x7d1d('0x49'),_0x3ca515['id']);return getEndUser(_0x336349,_0x4174f3[_0x7d1d('0x5a')],_0x4174f3['destcalleridnum']);})['then'](function(_0x1729a2){_0x41c674=_0x1729a2;logger['info'](_0x7d1d('0x4c'),_0x41c674['id']);return getTicket(_0x336349,_0x3ca515,_0x41c674,_0xd44768,_0x4174f3);})[_0x7d1d('0xe')](function(_0x5d806f){if(_0x5d806f){logger['info']('Ticket\x20created!');logger[_0x7d1d('0x9')](_0x7d1d('0x4d'),_0x5d806f['id']);switch(_0x336349[_0x7d1d('0x26')]){case _0x7d1d('0x5b'):logger[_0x7d1d('0x9')](_0x7d1d('0x43'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x7d1d('0x4e'),_0x83a8c5[_0x7d1d('0x2f')]),_0x7d1d('0x5c'),{'recordId':_0x5d806f['id']});break;case _0x7d1d('0x4f'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7d1d('0xb')](_0x7d1d('0x4e'),_0x83a8c5['name']),_0x7d1d('0x51'),{'uri':util[_0x7d1d('0xb')](_0x7d1d('0x5d'),_0x336349['remoteUri'],_0x5d806f['id'])});break;default:logger[_0x7d1d('0x53')](_0x7d1d('0x58'),_0x7d1d('0x5e'));}}})[_0x7d1d('0x54')](function(_0x492b29){logger[_0x7d1d('0x53')](_0x7d1d('0x58'),JSON['stringify'](_0x492b29));});};exports[_0x7d1d('0x5f')]=function(_0x751cfc,_0x533fb1,_0x55c042,_0x5ea949,_0x2289e4,_0x10f702){var _0x529672,_0x2e54b6;_0x10f702['remoteUri']=intUtil[_0x7d1d('0x41')](_0x10f702[_0x7d1d('0xd')]);_0x10f702[_0x7d1d('0x40')]=intUtil['stripTrailingSlash'](_0x10f702['serverUrl']);if(_0x2289e4&&_0x2289e4[_0x7d1d('0x42')]){logger['info']('[ABANDONED]',_0x7d1d('0x59'));_0x533fb1[_0x7d1d('0x44')]=util[_0x7d1d('0xb')](_0x7d1d('0x45'),_0x10f702[_0x7d1d('0x40')],_0x533fb1[_0x7d1d('0x46')],md5(_0x533fb1[_0x7d1d('0x46')]));}else{_0x533fb1[_0x7d1d('0x44')]='';}headers[_0x7d1d('0x47')]=getAuth(_0x10f702);return getUser(_0x10f702)[_0x7d1d('0xe')](function(_0x347d72){_0x529672=_0x347d72;logger[_0x7d1d('0x9')]('The\x20User\x20ID\x20is:',_0x529672['id']);return getEndUser(_0x10f702,_0x533fb1[_0x7d1d('0x4a')],_0x533fb1['calleridnum']);})[_0x7d1d('0xe')](function(_0x3e221e){_0x2e54b6=_0x3e221e;logger['info'](_0x7d1d('0x4c'),_0x2e54b6['id']);return getTicket(_0x10f702,_0x529672,_0x2e54b6,_0x55c042,_0x533fb1);})[_0x7d1d('0xe')](function(_0x2bf104){if(_0x2bf104){logger['info'](_0x7d1d('0x60'));logger['info'](_0x7d1d('0x4d'),_0x2bf104['id']);}})[_0x7d1d('0x54')](function(_0x2eecfc){logger[_0x7d1d('0x53')](_0x7d1d('0x61'),JSON[_0x7d1d('0x17')](_0x2eecfc));});};
\ No newline at end of file
index a90b2a9..129d2bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug','defaults','GET','map','forEach','type','string','nameField','toLowerCase','idField','customField','custom_fields','content','toString','variable','variableName','push','customVariable','Variable','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','stringify','outbound','recordingFormat','none','uniqueid','destcalleridname','The\x20Enduser\x20ID\x20is:','monitor_format','[ABANDONED]','lodash','request-promise','md5','../../../../config/logger','freshdesk','socket.io-emitter','localhost','application/json','info','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','<br>','Tags','name','Fields','keyBy','%s/api/v2/tickets','remoteUri','Ticket\x20created!','Getting\x20agent\x20with\x20email','format','%s/api/v2/agents','then','length','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!'];(function(_0x382e07,_0x38dad8){var _0x4f5020=function(_0x26c7a4){while(--_0x26c7a4){_0x382e07['push'](_0x382e07['shift']());}};_0x4f5020(++_0x38dad8);}(_0x70e0,0x17b));var _0x070e=function(_0xaf530f,_0x5a05d6){_0xaf530f=_0xaf530f-0x0;var _0x450964=_0x70e0[_0xaf530f];return _0x450964;};'use strict';var _=require(_0x070e('0x0'));var rp=require(_0x070e('0x1'));var md5=require(_0x070e('0x2'));var util=require('util');var intUtil=require('./util');var logger=require(_0x070e('0x3'))(_0x070e('0x4'));var io=require(_0x070e('0x5'))({'host':_0x070e('0x6'),'port':0x18eb});var headers={'Content-Type':'application/json','Accept':_0x070e('0x7')};function emit(_0x579a6b,_0x46fe68,_0x4b041d){io['to'](_0x579a6b)['emit'](_0x46fe68,_0x4b041d);}function getTicket(_0x5032e5,_0x35ab0c,_0x1e11f0,_0x604664,_0x2611e6){logger[_0x070e('0x8')](_0x070e('0x9'));var _0x11ffa8=_['merge']({'responder_id':_0x35ab0c['id'],'requester_id':_0x1e11f0['id'],'name':util['format'](_0x070e('0xa'),_0x2611e6[_0x070e('0xb')]),'phone':_0x2611e6[_0x070e('0xc')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x070e('0xd')](_0x604664[_0x070e('0xe')],_0x2611e6,'\x20'),'description':intUtil[_0x070e('0xd')](_0x604664[_0x070e('0xf')],_0x2611e6,_0x070e('0x10')),'tags':getTags(_0x604664[_0x070e('0x11')],_0x070e('0x12'))},getCustomFields(_0x604664[_0x070e('0x13')],_0x2611e6));_0x11ffa8['custom_fields']=_['mapValues'](_[_0x070e('0x14')](_0x11ffa8['custom_fields'],'id'),'value');return request({'uri':util['format'](_0x070e('0x15'),_0x5032e5[_0x070e('0x16')]),'method':'POST','body':_0x11ffa8})['then'](function(_0x373d86){logger[_0x070e('0x8')](_0x070e('0x17'));return _0x373d86;});}function getUser(_0x19d9da,_0x5bc71e){logger['info'](_0x070e('0x18'),_0x5bc71e);return request({'uri':util[_0x070e('0x19')](_0x070e('0x1a'),_0x19d9da[_0x070e('0x16')]),'qs':{'email':_0x5bc71e}})[_0x070e('0x1b')](function(_0x5037eb){if(_0x5037eb[_0x070e('0x1c')]){logger[_0x070e('0x8')](_0x070e('0x1d'));return _[_0x070e('0x1e')](_0x5037eb,function(_0x259893){return _0x259893['contact']['email']===_0x5bc71e;});}else{logger['info'](_0x070e('0x1f'));return request({'uri':util[_0x070e('0x19')](_0x070e('0x20'),_0x19d9da['remoteUri'])})[_0x070e('0x1b')](function(_0x5dc5d2){logger[_0x070e('0x8')](_0x070e('0x21'));return _0x5dc5d2;});}});}function getEndUser(_0x27a01e,_0x33e8c6,_0x28a1c3){logger[_0x070e('0x8')](_0x070e('0x22'),_0x28a1c3);return request({'uri':util[_0x070e('0x19')]('%s/api/v2/contacts',_0x27a01e[_0x070e('0x16')]),'qs':{'phone':_0x28a1c3}})[_0x070e('0x1b')](function(_0x4790eb){if(_0x4790eb['length']){logger[_0x070e('0x8')]('Enduser\x20found!');return _['find'](_0x4790eb,{'phone':_0x28a1c3});}else{logger[_0x070e('0x8')](_0x070e('0x23'));return request({'uri':util[_0x070e('0x19')](_0x070e('0x24'),_0x27a01e[_0x070e('0x16')]),'method':'POST','body':{'name':_0x33e8c6,'phone':_0x28a1c3}})[_0x070e('0x1b')](function(_0x219e48){logger[_0x070e('0x8')](_0x070e('0x25'));return _0x219e48;});}});}function getAuth(_0x43dd96){return util[_0x070e('0x19')](_0x070e('0x26'),new Buffer(_0x43dd96[_0x070e('0x27')]+':X')['toString'](_0x070e('0x28')));}function request(_0x351641){logger[_0x070e('0x29')]('[HTTP]',JSON['stringify'](_0x351641));return rp(_[_0x070e('0x2a')](_0x351641,{'method':_0x070e('0x2b'),'headers':headers,'json':!![]}));}function getTags(_0xa6c0ab,_0x51402c){var _0x3fa994=[];if(_0xa6c0ab&&_0xa6c0ab[_0x070e('0x1c')]>0x0){_0x3fa994=_[_0x070e('0x2c')](_0xa6c0ab,_0x51402c);}return _0x3fa994;}function getCustomFields(_0x5f2bee,_0x53d473){var _0x5bf522=[];var _0x523b75={'custom_fields':[]};if(_0x5f2bee['length']>0x0){_[_0x070e('0x2d')](_0x5f2bee,function(_0x4e0a7d){if(_0x4e0a7d[_0x070e('0x2e')]===_0x070e('0x2f')&&_0x4e0a7d['nameField']&&!_0x4e0a7d['customField']){_0x523b75[_0x4e0a7d[_0x070e('0x30')][_0x070e('0x31')]()]=_0x4e0a7d['content']['toString']();}else if(_0x4e0a7d[_0x070e('0x2e')]===_0x070e('0x2f')&&_0x4e0a7d[_0x070e('0x32')]&&_0x4e0a7d[_0x070e('0x33')]){_0x523b75[_0x070e('0x34')]['push']({'id':_0x4e0a7d['idField'],'value':_0x4e0a7d[_0x070e('0x35')][_0x070e('0x36')]()});}else if(_0x4e0a7d[_0x070e('0x2e')]===_0x070e('0x37')&&_0x4e0a7d[_0x070e('0x38')]&&_0x4e0a7d['idField']&&_0x4e0a7d[_0x070e('0x33')]){_0x53d473[_0x4e0a7d[_0x070e('0x38')]]&&_0x523b75['custom_fields'][_0x070e('0x39')]({'id':_0x4e0a7d[_0x070e('0x32')],'value':_0x53d473[_0x4e0a7d['variableName']]['toString']()});}else if(_0x4e0a7d['type']===_0x070e('0x3a')&&_0x4e0a7d[_0x070e('0x3b')]&&_0x4e0a7d[_0x070e('0x3b')][_0x070e('0x12')]&&_0x4e0a7d[_0x070e('0x32')]&&_0x4e0a7d['customField']){_0x53d473[_0x4e0a7d[_0x070e('0x3b')][_0x070e('0x12')][_0x070e('0x31')]()]&&_0x523b75['custom_fields'][_0x070e('0x39')]({'id':_0x4e0a7d[_0x070e('0x32')],'value':_0x53d473[_0x4e0a7d[_0x070e('0x3b')]['name'][_0x070e('0x31')]()][_0x070e('0x36')]()});}});}return _0x523b75;}exports['queue']=function(_0x173602,_0x5d689b,_0x18dae9,_0x146bf6,_0x3462d3,_0x30319c){var _0xd03404,_0x47b929;_0x30319c[_0x070e('0x16')]=intUtil['stripTrailingSlash'](_0x30319c['remoteUri']);_0x30319c[_0x070e('0x3c')]=intUtil[_0x070e('0x3d')](_0x30319c[_0x070e('0x3c')]);if(_0x3462d3&&_0x3462d3['monitor_format']){logger[_0x070e('0x8')](_0x070e('0x3e'),_0x070e('0x3f'));_0x5d689b[_0x070e('0x40')]=util['format'](_0x070e('0x41'),_0x30319c['serverUrl'],_0x5d689b['uniqueid'],md5(_0x5d689b['uniqueid']));}else{_0x5d689b[_0x070e('0x40')]='';}headers[_0x070e('0x42')]=getAuth(_0x30319c);return getUser(_0x30319c,_0x146bf6[_0x070e('0x43')])[_0x070e('0x1b')](function(_0x34f23e){_0xd03404=_0x34f23e;logger['info'](_0x070e('0x44'),_0xd03404['id']);return getEndUser(_0x30319c,_0x5d689b['calleridname'],_0x5d689b[_0x070e('0xc')]);})[_0x070e('0x1b')](function(_0xff760c){_0x47b929=_0xff760c;logger['info']('The\x20Enduser\x20ID\x20is:',_0x47b929['id']);return getTicket(_0x30319c,_0xd03404,_0x47b929,_0x18dae9,_0x5d689b);})[_0x070e('0x1b')](function(_0x5ee4b8){if(_0x5ee4b8&&_0x5ee4b8['id']){logger[_0x070e('0x8')](_0x070e('0x17'));logger[_0x070e('0x8')]('The\x20Ticket\x20ID\x20is:',_0x5ee4b8['id']);logger[_0x070e('0x8')](_0x070e('0x3e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x070e('0x45'),_0x146bf6[_0x070e('0x12')]),_0x070e('0x46'),{'uri':util[_0x070e('0x19')](_0x070e('0x47'),_0x30319c['remoteUri'],_0x5ee4b8['id'])});}})[_0x070e('0x48')](function(_0x3f6c64){logger[_0x070e('0x49')](_0x070e('0x3e'),JSON[_0x070e('0x4a')](_0x3f6c64));});};exports[_0x070e('0x4b')]=function(_0x1f54d5,_0x1b5374,_0xd67987,_0x66a3f3,_0x210c4d,_0x3be553,_0x5254f8){var _0x216d27,_0x402c82;_0x3be553['remoteUri']=intUtil[_0x070e('0x3d')](_0x3be553[_0x070e('0x16')]);_0x3be553[_0x070e('0x3c')]=intUtil[_0x070e('0x3d')](_0x3be553[_0x070e('0x3c')]);if(_0x5254f8&&_0x5254f8[_0x070e('0x4c')]&&_0x5254f8[_0x070e('0x4c')]!==_0x070e('0x4d')){logger[_0x070e('0x8')]('[OUTBOUND]',_0x070e('0x3f'));_0x1b5374['recordingURL']=util[_0x070e('0x19')](_0x070e('0x41'),_0x3be553['serverUrl'],_0x1b5374[_0x070e('0x4e')],md5(_0x1b5374[_0x070e('0x4e')]));}headers[_0x070e('0x42')]=getAuth(_0x3be553);return getUser(_0x3be553,_0x66a3f3[_0x070e('0x43')])[_0x070e('0x1b')](function(_0x1e8a4f){_0x216d27=_0x1e8a4f;logger[_0x070e('0x8')]('The\x20User\x20ID\x20is:',_0x216d27['id']);return getEndUser(_0x3be553,_0x1b5374[_0x070e('0x4f')],_0x1b5374['destcalleridnum']);})['then'](function(_0x3a06c6){_0x402c82=_0x3a06c6;logger[_0x070e('0x8')](_0x070e('0x50'),_0x402c82['id']);return getTicket(_0x3be553,_0x216d27,_0x402c82,_0xd67987,_0x1b5374);})[_0x070e('0x1b')](function(_0x202015){if(_0x202015&&_0x202015['id']){logger[_0x070e('0x8')](_0x070e('0x17'));logger[_0x070e('0x8')]('The\x20Ticket\x20ID\x20is:',_0x202015['id']);logger[_0x070e('0x8')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x070e('0x19')](_0x070e('0x45'),_0x66a3f3['name']),_0x070e('0x46'),{'uri':util[_0x070e('0x19')](_0x070e('0x47'),_0x3be553[_0x070e('0x16')],_0x202015['id'])});}})[_0x070e('0x48')](function(_0x382ce3){logger[_0x070e('0x49')]('[OUTBOUND]',JSON['stringify'](_0x382ce3));});};exports['abandoned']=function(_0x3087e5,_0x1948a5,_0x29f497,_0x2f8fcb,_0x5ac0b5,_0x25f34c){var _0x5d3c3a,_0x212710;_0x25f34c[_0x070e('0x16')]=intUtil[_0x070e('0x3d')](_0x25f34c[_0x070e('0x16')]);_0x25f34c[_0x070e('0x3c')]=intUtil[_0x070e('0x3d')](_0x25f34c['serverUrl']);if(_0x5ac0b5&&_0x5ac0b5[_0x070e('0x51')]){logger[_0x070e('0x8')](_0x070e('0x52'),'Recording\x20is\x20enabled!');_0x1948a5[_0x070e('0x40')]=util[_0x070e('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x25f34c[_0x070e('0x3c')],_0x1948a5['uniqueid'],md5(_0x1948a5[_0x070e('0x4e')]));}else{_0x1948a5['recordingURL']='';}headers['Authorization']=getAuth(_0x25f34c);return getUser(_0x25f34c,_0x2f8fcb['email'])[_0x070e('0x1b')](function(_0x1ae5cb){_0x5d3c3a=_0x1ae5cb;logger[_0x070e('0x8')](_0x070e('0x44'),_0x5d3c3a['id']);return getEndUser(_0x25f34c,_0x1948a5[_0x070e('0xb')],_0x1948a5[_0x070e('0xc')]);})['then'](function(_0x841c89){_0x212710=_0x841c89;logger['info'](_0x070e('0x50'),_0x212710['id']);return getTicket(_0x25f34c,_0x5d3c3a,_0x212710,_0x29f497,_0x1948a5);})['then'](function(_0x2e10f7){if(_0x2e10f7){logger[_0x070e('0x8')]('Ticket\x20created!');logger[_0x070e('0x8')]('The\x20Ticket\x20ID\x20is:',_0x2e10f7['id']);}})[_0x070e('0x48')](function(_0x139630){logger[_0x070e('0x49')](_0x070e('0x52'),JSON[_0x070e('0x4a')](_0x139630));});};
\ No newline at end of file
+var _0xa9e0=['base64','debug','[HTTP]','stringify','defaults','map','forEach','type','string','nameField','customField','content','idField','push','variable','variableName','Variable','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','[OUTBOUND]','destcalleridnum','[ABANDONED]','lodash','request-promise','md5','../../../../config/logger','socket.io-emitter','localhost','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','Descriptions','<br>','Tags','name','Fields','custom_fields','keyBy','value','%s/api/v2/tickets','remoteUri','then','info','Getting\x20agent\x20with\x20email','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString'];(function(_0x57dfcb,_0x5ef9ba){var _0x2d376c=function(_0x5950c8){while(--_0x5950c8){_0x57dfcb['push'](_0x57dfcb['shift']());}};_0x2d376c(++_0x5ef9ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var md5=require(_0x0a9e('0x2'));var util=require('util');var intUtil=require('./util');var logger=require(_0x0a9e('0x3'))('freshdesk');var io=require(_0x0a9e('0x4'))({'host':_0x0a9e('0x5'),'port':0x18eb});var headers={'Content-Type':_0x0a9e('0x6'),'Accept':_0x0a9e('0x6')};function emit(_0x981158,_0x57b080,_0x219af0){io['to'](_0x981158)[_0x0a9e('0x7')](_0x57b080,_0x219af0);}function getTicket(_0x2cc193,_0x5f41ea,_0x503809,_0xe42b77,_0x56465b){logger['info'](_0x0a9e('0x8'));var _0xf81284=_[_0x0a9e('0x9')]({'responder_id':_0x5f41ea['id'],'requester_id':_0x503809['id'],'name':util[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x56465b[_0x0a9e('0xc')]),'phone':_0x56465b['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0xe42b77['Subjects'],_0x56465b,'\x20'),'description':intUtil['getString'](_0xe42b77[_0x0a9e('0xd')],_0x56465b,_0x0a9e('0xe')),'tags':getTags(_0xe42b77[_0x0a9e('0xf')],_0x0a9e('0x10'))},getCustomFields(_0xe42b77[_0x0a9e('0x11')],_0x56465b));_0xf81284[_0x0a9e('0x12')]=_['mapValues'](_[_0x0a9e('0x13')](_0xf81284[_0x0a9e('0x12')],'id'),_0x0a9e('0x14'));return request({'uri':util[_0x0a9e('0xa')](_0x0a9e('0x15'),_0x2cc193[_0x0a9e('0x16')]),'method':'POST','body':_0xf81284})[_0x0a9e('0x17')](function(_0x5d0880){logger[_0x0a9e('0x18')]('Ticket\x20created!');return _0x5d0880;});}function getUser(_0x16033c,_0x12066b){logger['info'](_0x0a9e('0x19'),_0x12066b);return request({'uri':util['format'](_0x0a9e('0x1a'),_0x16033c[_0x0a9e('0x16')]),'qs':{'email':_0x12066b}})[_0x0a9e('0x17')](function(_0x205fd6){if(_0x205fd6[_0x0a9e('0x1b')]){logger[_0x0a9e('0x18')](_0x0a9e('0x1c'));return _[_0x0a9e('0x1d')](_0x205fd6,function(_0x1314ae){return _0x1314ae[_0x0a9e('0x1e')][_0x0a9e('0x1f')]===_0x12066b;});}else{logger[_0x0a9e('0x18')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x0a9e('0xa')](_0x0a9e('0x20'),_0x16033c['remoteUri'])})[_0x0a9e('0x17')](function(_0x5a09ef){logger['info'](_0x0a9e('0x21'));return _0x5a09ef;});}});}function getEndUser(_0x432e56,_0x38e7c4,_0x30bae6){logger['info'](_0x0a9e('0x22'),_0x30bae6);return request({'uri':util[_0x0a9e('0xa')](_0x0a9e('0x23'),_0x432e56[_0x0a9e('0x16')]),'qs':{'phone':_0x30bae6}})[_0x0a9e('0x17')](function(_0x42ac8f){if(_0x42ac8f[_0x0a9e('0x1b')]){logger['info']('Enduser\x20found!');return _[_0x0a9e('0x1d')](_0x42ac8f,{'phone':_0x30bae6});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x24'));return request({'uri':util[_0x0a9e('0xa')]('%s/api/v2/contacts',_0x432e56[_0x0a9e('0x16')]),'method':'POST','body':{'name':_0x38e7c4,'phone':_0x30bae6}})[_0x0a9e('0x17')](function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x25'));return _0x5bfb33;});}});}function getAuth(_0x25fba9){return util[_0x0a9e('0xa')](_0x0a9e('0x26'),new Buffer(_0x25fba9[_0x0a9e('0x27')]+':X')[_0x0a9e('0x28')](_0x0a9e('0x29')));}function request(_0x5a101a){logger[_0x0a9e('0x2a')](_0x0a9e('0x2b'),JSON[_0x0a9e('0x2c')](_0x5a101a));return rp(_[_0x0a9e('0x2d')](_0x5a101a,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x15b200,_0x40e7a3){var _0x1843b2=[];if(_0x15b200&&_0x15b200[_0x0a9e('0x1b')]>0x0){_0x1843b2=_[_0x0a9e('0x2e')](_0x15b200,_0x40e7a3);}return _0x1843b2;}function getCustomFields(_0x563b45,_0x296f41){var _0x2e8759=[];var _0x1dbde2={'custom_fields':[]};if(_0x563b45['length']>0x0){_[_0x0a9e('0x2f')](_0x563b45,function(_0x5d1e0e){if(_0x5d1e0e[_0x0a9e('0x30')]===_0x0a9e('0x31')&&_0x5d1e0e[_0x0a9e('0x32')]&&!_0x5d1e0e[_0x0a9e('0x33')]){_0x1dbde2[_0x5d1e0e[_0x0a9e('0x32')]['toLowerCase']()]=_0x5d1e0e[_0x0a9e('0x34')][_0x0a9e('0x28')]();}else if(_0x5d1e0e[_0x0a9e('0x30')]===_0x0a9e('0x31')&&_0x5d1e0e[_0x0a9e('0x35')]&&_0x5d1e0e[_0x0a9e('0x33')]){_0x1dbde2[_0x0a9e('0x12')][_0x0a9e('0x36')]({'id':_0x5d1e0e['idField'],'value':_0x5d1e0e[_0x0a9e('0x34')]['toString']()});}else if(_0x5d1e0e[_0x0a9e('0x30')]===_0x0a9e('0x37')&&_0x5d1e0e[_0x0a9e('0x38')]&&_0x5d1e0e[_0x0a9e('0x35')]&&_0x5d1e0e['customField']){_0x296f41[_0x5d1e0e[_0x0a9e('0x38')]]&&_0x1dbde2[_0x0a9e('0x12')][_0x0a9e('0x36')]({'id':_0x5d1e0e[_0x0a9e('0x35')],'value':_0x296f41[_0x5d1e0e['variableName']]['toString']()});}else if(_0x5d1e0e[_0x0a9e('0x30')]==='customVariable'&&_0x5d1e0e[_0x0a9e('0x39')]&&_0x5d1e0e[_0x0a9e('0x39')][_0x0a9e('0x10')]&&_0x5d1e0e[_0x0a9e('0x35')]&&_0x5d1e0e['customField']){_0x296f41[_0x5d1e0e[_0x0a9e('0x39')][_0x0a9e('0x10')][_0x0a9e('0x3a')]()]&&_0x1dbde2['custom_fields'][_0x0a9e('0x36')]({'id':_0x5d1e0e[_0x0a9e('0x35')],'value':_0x296f41[_0x5d1e0e[_0x0a9e('0x39')]['name']['toLowerCase']()][_0x0a9e('0x28')]()});}});}return _0x1dbde2;}exports[_0x0a9e('0x3b')]=function(_0x5adda1,_0x2b814e,_0x419125,_0x2e1b3a,_0x148f55,_0x4b38d9){var _0x5a594b,_0x15e37d;_0x4b38d9[_0x0a9e('0x16')]=intUtil['stripTrailingSlash'](_0x4b38d9[_0x0a9e('0x16')]);_0x4b38d9[_0x0a9e('0x3c')]=intUtil[_0x0a9e('0x3d')](_0x4b38d9['serverUrl']);if(_0x148f55&&_0x148f55[_0x0a9e('0x3e')]){logger[_0x0a9e('0x18')](_0x0a9e('0x3f'),_0x0a9e('0x40'));_0x2b814e[_0x0a9e('0x41')]=util[_0x0a9e('0xa')](_0x0a9e('0x42'),_0x4b38d9[_0x0a9e('0x3c')],_0x2b814e[_0x0a9e('0x43')],md5(_0x2b814e[_0x0a9e('0x43')]));}else{_0x2b814e[_0x0a9e('0x41')]='';}headers[_0x0a9e('0x44')]=getAuth(_0x4b38d9);return getUser(_0x4b38d9,_0x2e1b3a[_0x0a9e('0x1f')])[_0x0a9e('0x17')](function(_0x37f6cc){_0x5a594b=_0x37f6cc;logger['info']('The\x20User\x20ID\x20is:',_0x5a594b['id']);return getEndUser(_0x4b38d9,_0x2b814e[_0x0a9e('0xc')],_0x2b814e[_0x0a9e('0x45')]);})[_0x0a9e('0x17')](function(_0x315881){_0x15e37d=_0x315881;logger[_0x0a9e('0x18')](_0x0a9e('0x46'),_0x15e37d['id']);return getTicket(_0x4b38d9,_0x5a594b,_0x15e37d,_0x419125,_0x2b814e);})[_0x0a9e('0x17')](function(_0x445e25){if(_0x445e25&&_0x445e25['id']){logger[_0x0a9e('0x18')](_0x0a9e('0x47'));logger[_0x0a9e('0x18')](_0x0a9e('0x48'),_0x445e25['id']);logger['info'](_0x0a9e('0x3f'),_0x0a9e('0x49'));emit(util[_0x0a9e('0xa')](_0x0a9e('0x4a'),_0x2e1b3a[_0x0a9e('0x10')]),_0x0a9e('0x4b'),{'uri':util[_0x0a9e('0xa')](_0x0a9e('0x4c'),_0x4b38d9['remoteUri'],_0x445e25['id'])});}})[_0x0a9e('0x4d')](function(_0x48fd45){logger[_0x0a9e('0x4e')](_0x0a9e('0x3f'),JSON[_0x0a9e('0x2c')](_0x48fd45));});};exports['outbound']=function(_0x14bec2,_0x7f6eb1,_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73,_0x45bf7f){var _0x5bbcde,_0x13f44d;_0x37be73[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x3d')](_0x37be73[_0x0a9e('0x16')]);_0x37be73[_0x0a9e('0x3c')]=intUtil[_0x0a9e('0x3d')](_0x37be73[_0x0a9e('0x3c')]);if(_0x45bf7f&&_0x45bf7f[_0x0a9e('0x4f')]&&_0x45bf7f[_0x0a9e('0x4f')]!=='none'){logger[_0x0a9e('0x18')](_0x0a9e('0x50'),'Recording\x20is\x20enabled!');_0x7f6eb1['recordingURL']=util['format'](_0x0a9e('0x42'),_0x37be73[_0x0a9e('0x3c')],_0x7f6eb1[_0x0a9e('0x43')],md5(_0x7f6eb1[_0x0a9e('0x43')]));}headers[_0x0a9e('0x44')]=getAuth(_0x37be73);return getUser(_0x37be73,_0x34aa5a[_0x0a9e('0x1f')])[_0x0a9e('0x17')](function(_0x375c18){_0x5bbcde=_0x375c18;logger['info']('The\x20User\x20ID\x20is:',_0x5bbcde['id']);return getEndUser(_0x37be73,_0x7f6eb1['destcalleridname'],_0x7f6eb1[_0x0a9e('0x51')]);})[_0x0a9e('0x17')](function(_0x14d602){_0x13f44d=_0x14d602;logger['info'](_0x0a9e('0x46'),_0x13f44d['id']);return getTicket(_0x37be73,_0x5bbcde,_0x13f44d,_0x4774f4,_0x7f6eb1);})[_0x0a9e('0x17')](function(_0x53d113){if(_0x53d113&&_0x53d113['id']){logger['info'](_0x0a9e('0x47'));logger['info'](_0x0a9e('0x48'),_0x53d113['id']);logger['info'](_0x0a9e('0x50'),_0x0a9e('0x49'));emit(util[_0x0a9e('0xa')]('user:%s',_0x34aa5a[_0x0a9e('0x10')]),_0x0a9e('0x4b'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x37be73[_0x0a9e('0x16')],_0x53d113['id'])});}})[_0x0a9e('0x4d')](function(_0x49c095){logger[_0x0a9e('0x4e')]('[OUTBOUND]',JSON[_0x0a9e('0x2c')](_0x49c095));});};exports['abandoned']=function(_0xe22ccc,_0x4a6deb,_0x5da27d,_0x5df0ad,_0x2da03c,_0x47de4c){var _0x2f7092,_0x65432;_0x47de4c[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x3d')](_0x47de4c[_0x0a9e('0x16')]);_0x47de4c[_0x0a9e('0x3c')]=intUtil[_0x0a9e('0x3d')](_0x47de4c[_0x0a9e('0x3c')]);if(_0x2da03c&&_0x2da03c['monitor_format']){logger[_0x0a9e('0x18')](_0x0a9e('0x52'),_0x0a9e('0x40'));_0x4a6deb[_0x0a9e('0x41')]=util[_0x0a9e('0xa')](_0x0a9e('0x42'),_0x47de4c['serverUrl'],_0x4a6deb[_0x0a9e('0x43')],md5(_0x4a6deb[_0x0a9e('0x43')]));}else{_0x4a6deb['recordingURL']='';}headers[_0x0a9e('0x44')]=getAuth(_0x47de4c);return getUser(_0x47de4c,_0x5df0ad['email'])[_0x0a9e('0x17')](function(_0x5ba1f9){_0x2f7092=_0x5ba1f9;logger['info']('The\x20User\x20ID\x20is:',_0x2f7092['id']);return getEndUser(_0x47de4c,_0x4a6deb[_0x0a9e('0xc')],_0x4a6deb['calleridnum']);})[_0x0a9e('0x17')](function(_0x1fc70e){_0x65432=_0x1fc70e;logger[_0x0a9e('0x18')](_0x0a9e('0x46'),_0x65432['id']);return getTicket(_0x47de4c,_0x2f7092,_0x65432,_0x5da27d,_0x4a6deb);})[_0x0a9e('0x17')](function(_0x26d7db){if(_0x26d7db){logger['info'](_0x0a9e('0x47'));logger['info'](_0x0a9e('0x48'),_0x26d7db['id']);}})[_0x0a9e('0x4d')](function(_0x51aaf7){logger['error'](_0x0a9e('0x52'),JSON[_0x0a9e('0x2c')](_0x51aaf7));});};
\ No newline at end of file
index 45ba243..02f96a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4baa=['queue','outbound','log','EVENT\x20UNKNOWN','abandoned','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','./zendesk','./sugarcrm','./freshdesk','./zoho','./desk','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','exec','data1','toLowerCase','data2'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0x4baa,0x14f));var _0xa4ba=function(_0x553f8c,_0x30e67c){_0x553f8c=_0x553f8c-0x0;var _0x4707c0=_0x4baa[_0x553f8c];return _0x4707c0;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require(_0xa4ba('0x0'));var salesforce=require('./salesforce');var sugarcrm=require(_0xa4ba('0x1'));var freshdesk=require(_0xa4ba('0x2'));var zoho=require(_0xa4ba('0x3'));var desk=require(_0xa4ba('0x4'));var vtiger=require('./vtiger');var integrations=[_0xa4ba('0x5'),_0xa4ba('0x6'),_0xa4ba('0x7'),_0xa4ba('0x8'),_0xa4ba('0x9'),_0xa4ba('0xa'),_0xa4ba('0xb')];exports[_0xa4ba('0xc')]=function(_0x7e0ed6,_0x4a83ac,_0x15d51a,_0x2a226e,_0x5c930f,_0x39c04b){if(_0x15d51a){if(_['includes'](integrations,_0x7e0ed6[_0xa4ba('0xd')]['toLowerCase']())){try{var _0x23f1d7=null;var _0x38180d='';var _0x475b9b=_0x15d51a[_0x7e0ed6[_0xa4ba('0xd')][_0xa4ba('0xe')]()];if(_0x475b9b){var _0x55de17=_0x475b9b[_0x7e0ed6[_0xa4ba('0xf')]];if(_0x55de17){var _0x55b0f2=_['find'](_0x55de17['Configurations'],{'id':parseInt(_0x7e0ed6['data3'],0xa)});if(_0x55b0f2){if(_0x2a226e){if(_0x5c930f&&_0x4a83ac['queue']){_0x38180d=_0xa4ba('0x10');}else if(_0x4a83ac['routeId']){_0x38180d=_0xa4ba('0x11');}else{console[_0xa4ba('0x12')](_0xa4ba('0x13'),_0x4a83ac);}}else{_0x38180d=_0xa4ba('0x14');}switch(_0x7e0ed6[_0xa4ba('0xd')][_0xa4ba('0xe')]()){case _0xa4ba('0x5'):zendesk[_0x38180d](_0x7e0ed6,_0x4a83ac,_0x55b0f2,_0x2a226e,_0x5c930f,_0x55de17,_0x39c04b);break;case _0xa4ba('0x6'):salesforce[_0x38180d](_0x7e0ed6,_0x4a83ac,_0x55b0f2,_0x2a226e,_0x5c930f,_0x55de17,_0x39c04b);break;case _0xa4ba('0x7'):sugarcrm[_0x38180d](_0x7e0ed6,_0x4a83ac,_0x55b0f2,_0x2a226e,_0x5c930f,_0x55de17,_0x39c04b);break;case _0xa4ba('0x8'):freshdesk[_0x38180d](_0x7e0ed6,_0x4a83ac,_0x55b0f2,_0x2a226e,_0x5c930f,_0x55de17,_0x39c04b);break;case _0xa4ba('0x9'):zoho[_0x38180d](_0x7e0ed6,_0x4a83ac,_0x55b0f2,_0x2a226e,_0x5c930f,_0x55de17,_0x39c04b);break;case _0xa4ba('0xa'):desk[_0x38180d](_0x7e0ed6,_0x4a83ac,_0x55b0f2,_0x2a226e,_0x5c930f,_0x55de17,_0x39c04b);break;case _0xa4ba('0xb'):vtiger[_0x38180d](_0x7e0ed6,_0x4a83ac,_0x55b0f2,_0x2a226e,_0x5c930f,_0x55de17,_0x39c04b);break;default:console[_0xa4ba('0x12')]('unknown\x20integration');}}else{_0x23f1d7=require('../../../../config/logger')(_0x7e0ed6['data1'][_0xa4ba('0xe')]());_0x23f1d7[_0xa4ba('0x15')](_0xa4ba('0x16'),util[_0xa4ba('0x17')](_0xa4ba('0x18'),_0x7e0ed6['data1'][_0xa4ba('0xe')](),_0x7e0ed6[_0xa4ba('0x19')]));}}else{_0x23f1d7=require('../../../../config/logger')(_0x7e0ed6[_0xa4ba('0xd')][_0xa4ba('0xe')]());_0x23f1d7[_0xa4ba('0x15')]('[EXEC]',util['format'](_0xa4ba('0x1a'),_0x7e0ed6[_0xa4ba('0xd')][_0xa4ba('0xe')](),_0x7e0ed6[_0xa4ba('0xf')]));}}else{}}catch(_0xdcd42d){console['error'](_0xdcd42d);}}}};
\ No newline at end of file
+var _0x74da=['desk','vtiger','includes','toLowerCase','data1','data2','find','Configurations','queue','outbound','log','EVENT\x20UNKNOWN','abandoned','zendesk','zoho','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','salesforce','sugarcrm','freshdesk'];(function(_0x5af898,_0x573c82){var _0x522c30=function(_0x3b4e54){while(--_0x3b4e54){_0x5af898['push'](_0x5af898['shift']());}};_0x522c30(++_0x573c82);}(_0x74da,0x140));var _0xa74d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x74da[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa74d('0x0'));var util=require('util');var zendesk=require(_0xa74d('0x1'));var salesforce=require(_0xa74d('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xa74d('0x3'));var zoho=require(_0xa74d('0x4'));var desk=require(_0xa74d('0x5'));var vtiger=require(_0xa74d('0x6'));var integrations=['zendesk',_0xa74d('0x7'),_0xa74d('0x8'),_0xa74d('0x9'),'zoho',_0xa74d('0xa'),_0xa74d('0xb')];exports['exec']=function(_0x4b1a49,_0x2313c0,_0x294649,_0x4a4946,_0x3e4fce,_0x1fa312){if(_0x294649){if(_[_0xa74d('0xc')](integrations,_0x4b1a49['data1'][_0xa74d('0xd')]())){try{var _0x5d602e=null;var _0x5ce677='';var _0x797366=_0x294649[_0x4b1a49[_0xa74d('0xe')]['toLowerCase']()];if(_0x797366){var _0x444334=_0x797366[_0x4b1a49[_0xa74d('0xf')]];if(_0x444334){var _0x31b859=_[_0xa74d('0x10')](_0x444334[_0xa74d('0x11')],{'id':parseInt(_0x4b1a49['data3'],0xa)});if(_0x31b859){if(_0x4a4946){if(_0x3e4fce&&_0x2313c0['queue']){_0x5ce677=_0xa74d('0x12');}else if(_0x2313c0['routeId']){_0x5ce677=_0xa74d('0x13');}else{console[_0xa74d('0x14')](_0xa74d('0x15'),_0x2313c0);}}else{_0x5ce677=_0xa74d('0x16');}switch(_0x4b1a49[_0xa74d('0xe')][_0xa74d('0xd')]()){case _0xa74d('0x17'):zendesk[_0x5ce677](_0x4b1a49,_0x2313c0,_0x31b859,_0x4a4946,_0x3e4fce,_0x444334,_0x1fa312);break;case _0xa74d('0x7'):salesforce[_0x5ce677](_0x4b1a49,_0x2313c0,_0x31b859,_0x4a4946,_0x3e4fce,_0x444334,_0x1fa312);break;case _0xa74d('0x8'):sugarcrm[_0x5ce677](_0x4b1a49,_0x2313c0,_0x31b859,_0x4a4946,_0x3e4fce,_0x444334,_0x1fa312);break;case _0xa74d('0x9'):freshdesk[_0x5ce677](_0x4b1a49,_0x2313c0,_0x31b859,_0x4a4946,_0x3e4fce,_0x444334,_0x1fa312);break;case _0xa74d('0x18'):zoho[_0x5ce677](_0x4b1a49,_0x2313c0,_0x31b859,_0x4a4946,_0x3e4fce,_0x444334,_0x1fa312);break;case _0xa74d('0xa'):desk[_0x5ce677](_0x4b1a49,_0x2313c0,_0x31b859,_0x4a4946,_0x3e4fce,_0x444334,_0x1fa312);break;case _0xa74d('0xb'):vtiger[_0x5ce677](_0x4b1a49,_0x2313c0,_0x31b859,_0x4a4946,_0x3e4fce,_0x444334,_0x1fa312);break;default:console[_0xa74d('0x14')](_0xa74d('0x19'));}}else{_0x5d602e=require(_0xa74d('0x1a'))(_0x4b1a49[_0xa74d('0xe')][_0xa74d('0xd')]());_0x5d602e[_0xa74d('0x1b')](_0xa74d('0x1c'),util[_0xa74d('0x1d')](_0xa74d('0x1e'),_0x4b1a49[_0xa74d('0xe')]['toLowerCase'](),_0x4b1a49[_0xa74d('0x1f')]));}}else{_0x5d602e=require(_0xa74d('0x1a'))(_0x4b1a49[_0xa74d('0xe')][_0xa74d('0xd')]());_0x5d602e[_0xa74d('0x1b')]('[EXEC]',util[_0xa74d('0x1d')](_0xa74d('0x20'),_0x4b1a49[_0xa74d('0xe')][_0xa74d('0xd')](),_0x4b1a49[_0xa74d('0xf')]));}}else{}}catch(_0x225a59){console[_0xa74d('0x1b')](_0x225a59);}}}};
\ No newline at end of file
index fa5cd10..ceb8dff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x112e=['clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','stringify','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','newTab','Salesforce\x20account\x20type\x20not\x20recognized','monitor_format','[ABANDONED]','calleridname','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','jsforce','util','salesforce','socket.io-emitter','localhost','emit','utc','Subjects','getString','Descriptions','create','sobject','User','find','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','identity','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','execute','Lead','contact','lead','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','forEach','type','string','idField','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','Connection','remoteUri','https://login.salesforce.com'];(function(_0x479160,_0x3ab560){var _0x47ac6d=function(_0x3f7314){while(--_0x3f7314){_0x479160['push'](_0x479160['shift']());}};_0x47ac6d(++_0x3ab560);}(_0x112e,0x8f));var _0xe112=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x112e[_0x26b80e];return _0x84a8a8;};'use strict';var _=require(_0xe112('0x0'));var rp=require(_0xe112('0x1'));var moment=require(_0xe112('0x2'));var BPromise=require('bluebird');var md5=require(_0xe112('0x3'));var jsforce=require(_0xe112('0x4'));var util=require(_0xe112('0x5'));var intUtil=require('./util');var logger=require('../../../../config/logger')(_0xe112('0x6'));var io=require(_0xe112('0x7'))({'host':_0xe112('0x8'),'port':0x18eb});function emit(_0x58a333,_0x23175c,_0xe02fac){io['to'](_0x58a333)[_0xe112('0x9')](_0x23175c,_0xe02fac);}function getTicket(_0x5d211e,_0x2ac64f,_0xc9e92,_0x290577,_0x39f5c5,_0x1ba3d1,_0x3f9bd9){var _0x12debb=_['merge']({'OwnerId':_0x2ac64f['id'],'ActivityDate':moment[_0xe112('0xa')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x290577[_0xe112('0xb')],_0x39f5c5,'\x20'),'Description':intUtil[_0xe112('0xc')](_0x290577[_0xe112('0xd')],_0x39f5c5,'\x0a')},getCustomFields(_0x1ba3d1,_0x39f5c5));if(_0xc9e92){_0x12debb['WhoId']=_0xc9e92['id'];}return _0x3f9bd9['sobject']('Task')[_0xe112('0xe')](_0x12debb);}function getUser(_0x4d2885,_0x5d3512,_0x49f2e6){var _0x2f69a2={'Email':_0x5d3512};var _0x51611a={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x49f2e6[_0xe112('0xf')](_0xe112('0x10'))[_0xe112('0x11')](_0x2f69a2,_0x51611a)['execute']()[_0xe112('0x12')](function(_0x5de611){if(_0x5de611[_0xe112('0x13')]){var _0x98b535=_[_0xe112('0x11')](_0x5de611,function(_0x4f14cd){return _0x4f14cd[_0xe112('0x14')]===_0x5d3512;});if(_0x98b535){logger[_0xe112('0x15')](_0xe112('0x16'),_0x5d3512);return BPromise[_0xe112('0x17')]({'id':_0x98b535['Id'],'name':_0x98b535[_0xe112('0x18')]});}}else{logger[_0xe112('0x15')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5d3512);return _0x49f2e6[_0xe112('0x19')]()[_0xe112('0x12')](function(_0x12bbe6){return BPromise[_0xe112('0x17')]({'id':_0x12bbe6['user_id'],'name':_0x12bbe6[_0xe112('0x1a')]});});}});}function getEndUser(_0x55a111,_0x401f4f,_0x4552eb,_0x50e499,_0x24cc49){var _0xafb15b={'Phone':_0x50e499};var _0x3f521c={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xe112('0x17')]()[_0xe112('0x12')](function(){logger[_0xe112('0x15')](_0xe112('0x1b'),_0x50e499,_0x401f4f[_0xe112('0x1c')]);switch(_0x401f4f['moduleSearch']){case _0xe112('0x1d'):return _0x24cc49[_0xe112('0xf')](_0xe112('0x1e'))['find'](_0xafb15b,_0x3f521c)[_0xe112('0x1f')]()[_0xe112('0x12')](function(_0x567170){if(_0x567170&&_0x567170['length']){return _0x567170;}else{return _0x24cc49['sobject'](_0xe112('0x20'))['find'](_0xafb15b,_0x3f521c);}});case _0xe112('0x21'):return _0x24cc49[_0xe112('0xf')](_0xe112('0x1e'))[_0xe112('0x11')](_0xafb15b,_0x3f521c)[_0xe112('0x1f')]();case _0xe112('0x22'):return _0x24cc49[_0xe112('0xf')]('Lead')[_0xe112('0x11')](_0xafb15b,_0x3f521c);default:return null;}})[_0xe112('0x12')](function(_0x22ad89){if(_0x22ad89&&_0x22ad89[_0xe112('0x13')]){var _0x406e45=_['find'](_0x22ad89,function(_0x456397){return _0x456397[_0xe112('0x23')]===_0x50e499;});if(_0x406e45){return BPromise['resolve']({'id':_0x406e45['Id'],'name':_0x406e45[_0xe112('0x18')],'phone':_0x406e45[_0xe112('0x23')]});}}})[_0xe112('0x12')](function(_0x17c65a){if(_0x17c65a){logger[_0xe112('0x15')](_0xe112('0x24'),_0x50e499);return BPromise['resolve'](_0x17c65a);}else{logger[_0xe112('0x15')](_0xe112('0x25'),_0x50e499);var _0x45dc22={'LastName':_0x4552eb!=='<unknown>'?_0x4552eb:util[_0xe112('0x26')](_0xe112('0x27'),_0x50e499),'Phone':_0x50e499};if(_0x401f4f[_0xe112('0x28')]){switch(_0x401f4f[_0xe112('0x28')]){case _0xe112('0x21'):logger[_0xe112('0x15')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x50e499,_0x401f4f[_0xe112('0x28')]);break;case _0xe112('0x22'):logger['info'](_0xe112('0x29'),_0x50e499,_0x401f4f[_0xe112('0x28')]);_0x45dc22[_0xe112('0x2a')]='No\x20Company';break;default:return null;}}return _0x24cc49[_0xe112('0xf')](_[_0xe112('0x2b')](_0x401f4f[_0xe112('0x28')]))['create'](_0x45dc22);}});}function getCustomFields(_0x34bd03,_0x264160){var _0x35e323={};if(_0x34bd03['length']>0x0){_[_0xe112('0x2c')](_0x34bd03,function(_0xb5282f){if(_0xb5282f[_0xe112('0x2d')]===_0xe112('0x2e')&&_0xb5282f[_0xe112('0x2f')]){_0x35e323[_0xb5282f[_0xe112('0x2f')]]=_0xb5282f['content']['toString']();}else if(_0xb5282f[_0xe112('0x2d')]===_0xe112('0x30')&&_0xb5282f[_0xe112('0x31')]&&_0xb5282f[_0xe112('0x2f')]){_0x264160[_0xb5282f[_0xe112('0x31')]]&&(_0x35e323[_0xb5282f['idField']]=_0x264160[_0xb5282f[_0xe112('0x31')]]['toString']());}else if(_0xb5282f[_0xe112('0x2d')]===_0xe112('0x32')&&_0xb5282f['Variable']&&_0xb5282f['Variable']['name']&&_0xb5282f['idField']){_0x264160[_0xb5282f[_0xe112('0x33')][_0xe112('0x34')][_0xe112('0x35')]()]&&(_0x35e323[_0xb5282f[_0xe112('0x2f')]]=_0x264160[_0xb5282f[_0xe112('0x33')][_0xe112('0x34')][_0xe112('0x35')]()]['toString']());}});}return _0x35e323;}function getConnection(_0x529af3){var _0x2ee917=_0x529af3[_0xe112('0x36')][_0xe112('0x37')](_0x529af3['securityToken']);var _0x5c2e16=new jsforce[(_0xe112('0x38'))]({'oauth2':{'loginUrl':_0x529af3[_0xe112('0x39')]||_0xe112('0x3a'),'clientId':_0x529af3[_0xe112('0x3b')],'clientSecret':_0x529af3[_0xe112('0x3c')]}});return _0x5c2e16[_0xe112('0x3d')](_0x529af3[_0xe112('0x3e')],_0x2ee917)[_0xe112('0x12')](function(){logger[_0xe112('0x15')](_0xe112('0x3f'));return _0x5c2e16;});}exports[_0xe112('0x40')]=function(_0x166482,_0x5c5ce7,_0x54b24c,_0x3a819a,_0x5879dc,_0x166c26){var _0x13c14a,_0x427f8d,_0x56aae9,_0x4316d0;_0x166c26[_0xe112('0x41')]=intUtil['stripTrailingSlash'](_0x166c26[_0xe112('0x41')]);if(_0x5879dc&&_0x5879dc['monitor_format']){logger[_0xe112('0x15')](_0xe112('0x42'),_0xe112('0x43'));_0x5c5ce7[_0xe112('0x44')]=util['format'](_0xe112('0x45'),_0x166c26[_0xe112('0x41')],_0x5c5ce7[_0xe112('0x46')],md5(_0x5c5ce7[_0xe112('0x46')]));}else{_0x5c5ce7[_0xe112('0x44')]='';}return getConnection(_0x166c26)[_0xe112('0x12')](function(_0x1c4758){_0x4316d0=_0x1c4758;return getUser(_0x166c26,_0x3a819a['email'],_0x4316d0);})[_0xe112('0x12')](function(_0xff37fa){_0x13c14a=_0xff37fa;return getEndUser(_0x166c26,_0x54b24c,_0x5c5ce7['calleridname'],_0x5c5ce7[_0xe112('0x47')],_0x4316d0);})[_0xe112('0x12')](function(_0x5b65ff){_0x427f8d=_0x5b65ff;return getTicket(_0x166c26,_0x13c14a,_0x427f8d,_0x54b24c,_0x5c5ce7,_0x54b24c['Fields'],_0x4316d0);})[_0xe112('0x12')](function(_0x186475){_0x56aae9=_0x186475;logger[_0xe112('0x15')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x56aae9['id']);logger[_0xe112('0x15')](_0xe112('0x48'),_0x56aae9['id'],_0x3a819a[_0xe112('0x34')],_0x166c26[_0xe112('0x2d')]);switch(_0x166c26[_0xe112('0x2d')]){case'integrationTab':emit(util[_0xe112('0x26')](_0xe112('0x49'),_0x3a819a[_0xe112('0x34')]),_0xe112('0x4a'),{'recordId':_0x56aae9['id']});break;case'newTab':emit(util[_0xe112('0x26')](_0xe112('0x49'),_0x3a819a[_0xe112('0x34')]),_0xe112('0x4b'),{'uri':util[_0xe112('0x26')](_0xe112('0x4c'),_0x4316d0[_0xe112('0x4d')],_0x56aae9['id'])});break;default:logger['error'](_0xe112('0x4e'));}})[_0xe112('0x4f')](function(_0xbd7a3d){logger[_0xe112('0x50')](_0xe112('0x42'),JSON[_0xe112('0x51')](_0xbd7a3d));});};exports[_0xe112('0x52')]=function(_0x222f88,_0xd89363,_0x174787,_0x5b0e3a,_0x49b44a,_0x40ce8b,_0x5717d4){var _0x5e9fa8,_0x1400ae,_0x4bdc1a,_0x17e799;_0x40ce8b[_0xe112('0x41')]=intUtil[_0xe112('0x53')](_0x40ce8b[_0xe112('0x41')]);if(_0x5717d4&&_0x5717d4[_0xe112('0x54')]&&_0x5717d4[_0xe112('0x54')]!==_0xe112('0x55')){logger[_0xe112('0x15')](_0xe112('0x56'),_0xe112('0x43'));_0xd89363[_0xe112('0x44')]=util[_0xe112('0x26')](_0xe112('0x45'),_0x40ce8b[_0xe112('0x41')],_0xd89363[_0xe112('0x46')],md5(_0xd89363[_0xe112('0x46')]));}return getConnection(_0x40ce8b)[_0xe112('0x12')](function(_0x1483ab){_0x17e799=_0x1483ab;return getUser(_0x40ce8b,_0x5b0e3a[_0xe112('0x57')],_0x17e799);})[_0xe112('0x12')](function(_0x44b879){_0x5e9fa8=_0x44b879;return getEndUser(_0x40ce8b,_0x174787,_0xd89363[_0xe112('0x58')],_0xd89363[_0xe112('0x59')],_0x17e799);})['then'](function(_0x529e90){_0x1400ae=_0x529e90;return getTicket(_0x40ce8b,_0x5e9fa8,_0x1400ae,_0x174787,_0xd89363,_0x174787[_0xe112('0x5a')],_0x17e799);})['then'](function(_0x4f2884){_0x4bdc1a=_0x4f2884;logger[_0xe112('0x15')](_0xe112('0x5b'),_0x4bdc1a['id']);logger[_0xe112('0x15')](_0xe112('0x5c'),_0x4bdc1a['id'],_0x5b0e3a['name'],_0x40ce8b['type']);switch(_0x40ce8b['type']){case _0xe112('0x5d'):emit(util['format']('user:%s',_0x5b0e3a['name']),_0xe112('0x4a'),{'recordId':_0x4bdc1a['id']});break;case _0xe112('0x5e'):emit(util[_0xe112('0x26')](_0xe112('0x49'),_0x5b0e3a[_0xe112('0x34')]),_0xe112('0x4b'),{'uri':util[_0xe112('0x26')](_0xe112('0x4c'),_0x17e799[_0xe112('0x4d')],_0x4bdc1a['id'])});break;default:logger[_0xe112('0x50')](_0xe112('0x56'),_0xe112('0x5f'));}})[_0xe112('0x4f')](function(_0x422012){logger[_0xe112('0x50')](_0xe112('0x56'),JSON[_0xe112('0x51')](_0x422012));});};exports['abandoned']=function(_0x517fc5,_0xe5ff5c,_0x13980a,_0x21d654,_0x422304,_0x5eae73){var _0x1489a2,_0x43f194,_0x5dc0e8,_0x478499;_0x5eae73[_0xe112('0x41')]=intUtil[_0xe112('0x53')](_0x5eae73[_0xe112('0x41')]);if(_0x422304&&_0x422304[_0xe112('0x60')]){logger[_0xe112('0x15')](_0xe112('0x61'),_0xe112('0x43'));_0xe5ff5c['recordingURL']=util[_0xe112('0x26')](_0xe112('0x45'),_0x5eae73[_0xe112('0x41')],_0xe5ff5c[_0xe112('0x46')],md5(_0xe5ff5c['uniqueid']));}else{_0xe5ff5c['recordingURL']='';}return getConnection(_0x5eae73)[_0xe112('0x12')](function(_0x5e005f){_0x478499=_0x5e005f;return getUser(_0x5eae73,_0x21d654[_0xe112('0x57')],_0x478499);})[_0xe112('0x12')](function(_0x599df4){_0x1489a2=_0x599df4;return getEndUser(_0x5eae73,_0x13980a,_0xe5ff5c[_0xe112('0x62')],_0xe5ff5c['calleridnum'],_0x478499);})[_0xe112('0x12')](function(_0x5cfd90){_0x43f194=_0x5cfd90;return getTicket(_0x5eae73,_0x1489a2,_0x43f194,_0x13980a,_0xe5ff5c,_0x13980a['Fields'],_0x478499);})['then'](function(_0x43b69a){_0x5dc0e8=_0x43b69a;logger[_0xe112('0x15')](_0xe112('0x63'),_0x5dc0e8['id']);logger['info'](_0xe112('0x64'),_0x5eae73['type']);})[_0xe112('0x4f')](function(_0x31ba7c){logger[_0xe112('0x50')](_0xe112('0x61'),JSON[_0xe112('0x51')](_0x31ba7c));});};
\ No newline at end of file
+var _0x6eb4=['Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','type','string','idField','variable','variableName','Variable','name','toString','password','concat','Connection','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridname','calleridnum','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','error','catch','stringify','abandoned','[ABANDONED]','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','jsforce','./util','salesforce','socket.io-emitter','emit','merge','utc','getString','Descriptions','WhoId','Task','create','sobject','User','find','execute','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','contact','lead','Phone','<unknown>','format','Caller\x20-\x20%s','moduleCreate'];(function(_0x47b9b3,_0x549537){var _0x3fdc90=function(_0x773d0d){while(--_0x773d0d){_0x47b9b3['push'](_0x47b9b3['shift']());}};_0x3fdc90(++_0x549537);}(_0x6eb4,0x1c2));var _0x46eb=function(_0x39cf25,_0x5c1576){_0x39cf25=_0x39cf25-0x0;var _0x37fe40=_0x6eb4[_0x39cf25];return _0x37fe40;};'use strict';var _=require('lodash');var rp=require(_0x46eb('0x0'));var moment=require(_0x46eb('0x1'));var BPromise=require(_0x46eb('0x2'));var md5=require('md5');var jsforce=require(_0x46eb('0x3'));var util=require('util');var intUtil=require(_0x46eb('0x4'));var logger=require('../../../../config/logger')(_0x46eb('0x5'));var io=require(_0x46eb('0x6'))({'host':'localhost','port':0x18eb});function emit(_0x89aeac,_0x40bea8,_0x159356){io['to'](_0x89aeac)[_0x46eb('0x7')](_0x40bea8,_0x159356);}function getTicket(_0x3e36d3,_0x15ab05,_0x287407,_0x14c75f,_0x1076a9,_0x106e82,_0x37f34b){var _0x56cea0=_[_0x46eb('0x8')]({'OwnerId':_0x15ab05['id'],'ActivityDate':moment[_0x46eb('0x9')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x46eb('0xa')](_0x14c75f['Subjects'],_0x1076a9,'\x20'),'Description':intUtil[_0x46eb('0xa')](_0x14c75f[_0x46eb('0xb')],_0x1076a9,'\x0a')},getCustomFields(_0x106e82,_0x1076a9));if(_0x287407){_0x56cea0[_0x46eb('0xc')]=_0x287407['id'];}return _0x37f34b['sobject'](_0x46eb('0xd'))[_0x46eb('0xe')](_0x56cea0);}function getUser(_0x4b8674,_0x575c67,_0x488622){var _0x1bbe73={'Email':_0x575c67};var _0x49e674={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x488622[_0x46eb('0xf')](_0x46eb('0x10'))[_0x46eb('0x11')](_0x1bbe73,_0x49e674)[_0x46eb('0x12')]()[_0x46eb('0x13')](function(_0x4e0b7e){if(_0x4e0b7e[_0x46eb('0x14')]){var _0x395ce3=_['find'](_0x4e0b7e,function(_0x336169){return _0x336169[_0x46eb('0x15')]===_0x575c67;});if(_0x395ce3){logger[_0x46eb('0x16')](_0x46eb('0x17'),_0x575c67);return BPromise[_0x46eb('0x18')]({'id':_0x395ce3['Id'],'name':_0x395ce3[_0x46eb('0x19')]});}}else{logger[_0x46eb('0x16')](_0x46eb('0x1a'),_0x575c67);return _0x488622[_0x46eb('0x1b')]()[_0x46eb('0x13')](function(_0x23d790){return BPromise[_0x46eb('0x18')]({'id':_0x23d790[_0x46eb('0x1c')],'name':_0x23d790['display_name']});});}});}function getEndUser(_0x8e9638,_0xcb636c,_0x2dfb8f,_0xeef9b3,_0x2c9dba){var _0x3bb7f5={'Phone':_0xeef9b3};var _0x3976f9={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x46eb('0x13')](function(){logger[_0x46eb('0x16')](_0x46eb('0x1d'),_0xeef9b3,_0xcb636c[_0x46eb('0x1e')]);switch(_0xcb636c[_0x46eb('0x1e')]){case _0x46eb('0x1f'):return _0x2c9dba['sobject'](_0x46eb('0x20'))[_0x46eb('0x11')](_0x3bb7f5,_0x3976f9)[_0x46eb('0x12')]()['then'](function(_0x2b3f54){if(_0x2b3f54&&_0x2b3f54[_0x46eb('0x14')]){return _0x2b3f54;}else{return _0x2c9dba[_0x46eb('0xf')]('Lead')[_0x46eb('0x11')](_0x3bb7f5,_0x3976f9);}});case _0x46eb('0x21'):return _0x2c9dba[_0x46eb('0xf')](_0x46eb('0x20'))['find'](_0x3bb7f5,_0x3976f9)[_0x46eb('0x12')]();case _0x46eb('0x22'):return _0x2c9dba[_0x46eb('0xf')]('Lead')[_0x46eb('0x11')](_0x3bb7f5,_0x3976f9);default:return null;}})[_0x46eb('0x13')](function(_0x179743){if(_0x179743&&_0x179743[_0x46eb('0x14')]){var _0x44bc95=_[_0x46eb('0x11')](_0x179743,function(_0x323e7a){return _0x323e7a[_0x46eb('0x23')]===_0xeef9b3;});if(_0x44bc95){return BPromise[_0x46eb('0x18')]({'id':_0x44bc95['Id'],'name':_0x44bc95[_0x46eb('0x19')],'phone':_0x44bc95[_0x46eb('0x23')]});}}})[_0x46eb('0x13')](function(_0x460f24){if(_0x460f24){logger[_0x46eb('0x16')]('Enduser\x20with\x20phone\x20%s\x20found.',_0xeef9b3);return BPromise[_0x46eb('0x18')](_0x460f24);}else{logger[_0x46eb('0x16')]('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0xeef9b3);var _0x400d2c={'LastName':_0x2dfb8f!==_0x46eb('0x24')?_0x2dfb8f:util[_0x46eb('0x25')](_0x46eb('0x26'),_0xeef9b3),'Phone':_0xeef9b3};if(_0xcb636c['moduleCreate']){switch(_0xcb636c[_0x46eb('0x27')]){case'contact':logger[_0x46eb('0x16')](_0x46eb('0x28'),_0xeef9b3,_0xcb636c[_0x46eb('0x27')]);break;case _0x46eb('0x22'):logger[_0x46eb('0x16')](_0x46eb('0x28'),_0xeef9b3,_0xcb636c[_0x46eb('0x27')]);_0x400d2c[_0x46eb('0x29')]=_0x46eb('0x2a');break;default:return null;}}return _0x2c9dba[_0x46eb('0xf')](_[_0x46eb('0x2b')](_0xcb636c[_0x46eb('0x27')]))['create'](_0x400d2c);}});}function getCustomFields(_0x90ea74,_0x56cb78){var _0x358b55={};if(_0x90ea74[_0x46eb('0x14')]>0x0){_[_0x46eb('0x2c')](_0x90ea74,function(_0xf54ee7){if(_0xf54ee7[_0x46eb('0x2d')]===_0x46eb('0x2e')&&_0xf54ee7[_0x46eb('0x2f')]){_0x358b55[_0xf54ee7[_0x46eb('0x2f')]]=_0xf54ee7['content']['toString']();}else if(_0xf54ee7[_0x46eb('0x2d')]===_0x46eb('0x30')&&_0xf54ee7[_0x46eb('0x31')]&&_0xf54ee7[_0x46eb('0x2f')]){_0x56cb78[_0xf54ee7[_0x46eb('0x31')]]&&(_0x358b55[_0xf54ee7[_0x46eb('0x2f')]]=_0x56cb78[_0xf54ee7[_0x46eb('0x31')]]['toString']());}else if(_0xf54ee7[_0x46eb('0x2d')]==='customVariable'&&_0xf54ee7[_0x46eb('0x32')]&&_0xf54ee7[_0x46eb('0x32')]['name']&&_0xf54ee7[_0x46eb('0x2f')]){_0x56cb78[_0xf54ee7[_0x46eb('0x32')][_0x46eb('0x33')]['toLowerCase']()]&&(_0x358b55[_0xf54ee7[_0x46eb('0x2f')]]=_0x56cb78[_0xf54ee7[_0x46eb('0x32')][_0x46eb('0x33')]['toLowerCase']()][_0x46eb('0x34')]());}});}return _0x358b55;}function getConnection(_0x392b31){var _0x16a61a=_0x392b31[_0x46eb('0x35')][_0x46eb('0x36')](_0x392b31['securityToken']);var _0x1a5dc8=new jsforce[(_0x46eb('0x37'))]({'oauth2':{'loginUrl':_0x392b31['remoteUri']||_0x46eb('0x38'),'clientId':_0x392b31[_0x46eb('0x39')],'clientSecret':_0x392b31[_0x46eb('0x3a')]}});return _0x1a5dc8[_0x46eb('0x3b')](_0x392b31['username'],_0x16a61a)['then'](function(){logger[_0x46eb('0x16')](_0x46eb('0x3c'));return _0x1a5dc8;});}exports[_0x46eb('0x3d')]=function(_0x386ecb,_0x5f365b,_0x44e071,_0x21b22f,_0x3d2971,_0x338280){var _0x1ef9b,_0x458175,_0x9d3bf5,_0x3c1cb6;_0x338280[_0x46eb('0x3e')]=intUtil[_0x46eb('0x3f')](_0x338280[_0x46eb('0x3e')]);if(_0x3d2971&&_0x3d2971[_0x46eb('0x40')]){logger[_0x46eb('0x16')](_0x46eb('0x41'),_0x46eb('0x42'));_0x5f365b[_0x46eb('0x43')]=util[_0x46eb('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x338280[_0x46eb('0x3e')],_0x5f365b[_0x46eb('0x44')],md5(_0x5f365b[_0x46eb('0x44')]));}else{_0x5f365b[_0x46eb('0x43')]='';}return getConnection(_0x338280)[_0x46eb('0x13')](function(_0x1e0e04){_0x3c1cb6=_0x1e0e04;return getUser(_0x338280,_0x21b22f['email'],_0x3c1cb6);})[_0x46eb('0x13')](function(_0xb65c0c){_0x1ef9b=_0xb65c0c;return getEndUser(_0x338280,_0x44e071,_0x5f365b[_0x46eb('0x45')],_0x5f365b[_0x46eb('0x46')],_0x3c1cb6);})['then'](function(_0x1fa076){_0x458175=_0x1fa076;return getTicket(_0x338280,_0x1ef9b,_0x458175,_0x44e071,_0x5f365b,_0x44e071['Fields'],_0x3c1cb6);})[_0x46eb('0x13')](function(_0x36dc1c){_0x9d3bf5=_0x36dc1c;logger[_0x46eb('0x16')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x9d3bf5['id']);logger[_0x46eb('0x16')](_0x46eb('0x47'),_0x9d3bf5['id'],_0x21b22f[_0x46eb('0x33')],_0x338280[_0x46eb('0x2d')]);switch(_0x338280[_0x46eb('0x2d')]){case _0x46eb('0x48'):emit(util[_0x46eb('0x25')](_0x46eb('0x49'),_0x21b22f[_0x46eb('0x33')]),_0x46eb('0x4a'),{'recordId':_0x9d3bf5['id']});break;case _0x46eb('0x4b'):emit(util[_0x46eb('0x25')](_0x46eb('0x49'),_0x21b22f['name']),_0x46eb('0x4c'),{'uri':util[_0x46eb('0x25')](_0x46eb('0x4d'),_0x3c1cb6[_0x46eb('0x4e')],_0x9d3bf5['id'])});break;default:logger['error'](_0x46eb('0x4f'));}})['catch'](function(_0x316203){logger['error'](_0x46eb('0x41'),JSON['stringify'](_0x316203));});};exports[_0x46eb('0x50')]=function(_0x4e441c,_0x5da0ea,_0x44d840,_0x1ba056,_0x23a495,_0x2239b2,_0x20f455){var _0x5b8805,_0x447611,_0x4f250b,_0x547cc2;_0x2239b2[_0x46eb('0x3e')]=intUtil[_0x46eb('0x3f')](_0x2239b2[_0x46eb('0x3e')]);if(_0x20f455&&_0x20f455[_0x46eb('0x51')]&&_0x20f455[_0x46eb('0x51')]!==_0x46eb('0x52')){logger[_0x46eb('0x16')](_0x46eb('0x53'),_0x46eb('0x42'));_0x5da0ea['recordingURL']=util[_0x46eb('0x25')](_0x46eb('0x54'),_0x2239b2[_0x46eb('0x3e')],_0x5da0ea[_0x46eb('0x44')],md5(_0x5da0ea[_0x46eb('0x44')]));}return getConnection(_0x2239b2)[_0x46eb('0x13')](function(_0x5f3251){_0x547cc2=_0x5f3251;return getUser(_0x2239b2,_0x1ba056[_0x46eb('0x55')],_0x547cc2);})[_0x46eb('0x13')](function(_0x59ccdd){_0x5b8805=_0x59ccdd;return getEndUser(_0x2239b2,_0x44d840,_0x5da0ea[_0x46eb('0x56')],_0x5da0ea[_0x46eb('0x57')],_0x547cc2);})[_0x46eb('0x13')](function(_0xb1e6c5){_0x447611=_0xb1e6c5;return getTicket(_0x2239b2,_0x5b8805,_0x447611,_0x44d840,_0x5da0ea,_0x44d840[_0x46eb('0x58')],_0x547cc2);})[_0x46eb('0x13')](function(_0x257d00){_0x4f250b=_0x257d00;logger['info'](_0x46eb('0x59'),_0x4f250b['id']);logger[_0x46eb('0x16')](_0x46eb('0x5a'),_0x4f250b['id'],_0x1ba056[_0x46eb('0x33')],_0x2239b2[_0x46eb('0x2d')]);switch(_0x2239b2[_0x46eb('0x2d')]){case _0x46eb('0x48'):emit(util[_0x46eb('0x25')](_0x46eb('0x49'),_0x1ba056['name']),_0x46eb('0x4a'),{'recordId':_0x4f250b['id']});break;case _0x46eb('0x4b'):emit(util['format'](_0x46eb('0x49'),_0x1ba056['name']),_0x46eb('0x4c'),{'uri':util[_0x46eb('0x25')](_0x46eb('0x4d'),_0x547cc2[_0x46eb('0x4e')],_0x4f250b['id'])});break;default:logger[_0x46eb('0x5b')](_0x46eb('0x53'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x46eb('0x5c')](function(_0x109723){logger[_0x46eb('0x5b')](_0x46eb('0x53'),JSON[_0x46eb('0x5d')](_0x109723));});};exports[_0x46eb('0x5e')]=function(_0x54b0ea,_0x335e20,_0x21f2ea,_0x500396,_0x5bc6e8,_0x454b50){var _0x34c88c,_0x31e79a,_0x114ef0,_0x1f4d2b;_0x454b50['serverUrl']=intUtil[_0x46eb('0x3f')](_0x454b50[_0x46eb('0x3e')]);if(_0x5bc6e8&&_0x5bc6e8[_0x46eb('0x40')]){logger[_0x46eb('0x16')](_0x46eb('0x5f'),_0x46eb('0x42'));_0x335e20['recordingURL']=util['format'](_0x46eb('0x54'),_0x454b50[_0x46eb('0x3e')],_0x335e20['uniqueid'],md5(_0x335e20[_0x46eb('0x44')]));}else{_0x335e20['recordingURL']='';}return getConnection(_0x454b50)[_0x46eb('0x13')](function(_0x4bffc6){_0x1f4d2b=_0x4bffc6;return getUser(_0x454b50,_0x500396['email'],_0x1f4d2b);})[_0x46eb('0x13')](function(_0xcabc87){_0x34c88c=_0xcabc87;return getEndUser(_0x454b50,_0x21f2ea,_0x335e20[_0x46eb('0x45')],_0x335e20['calleridnum'],_0x1f4d2b);})[_0x46eb('0x13')](function(_0x1307fc){_0x31e79a=_0x1307fc;return getTicket(_0x454b50,_0x34c88c,_0x31e79a,_0x21f2ea,_0x335e20,_0x21f2ea[_0x46eb('0x58')],_0x1f4d2b);})[_0x46eb('0x13')](function(_0x784133){_0x114ef0=_0x784133;logger[_0x46eb('0x16')](_0x46eb('0x60'),_0x114ef0['id']);logger['info'](_0x46eb('0x61'),_0x454b50[_0x46eb('0x2d')]);})[_0x46eb('0x5c')](function(_0x303142){logger['error'](_0x46eb('0x5f'),JSON[_0x46eb('0x5d')](_0x303142));});};
\ No newline at end of file
index 617946b..490301a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf55e=['user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','then','entry_list','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','map','string','customField','nameField','toLowerCase','toString','type','custom_fields','content','variable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','Fields','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','outbound','uri','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','users','contacts','version','trigger:browser:url','error','abandoned','[ABANDONED]','calleridname','calleridnum','Ticket\x20created!','lodash','request-promise','md5','./util','localhost','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','description','Descriptions','date_start','toISOString','slice','replace','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','base64','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','length','find','name_value_list','info','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!'];(function(_0x2faa69,_0x28c424){var _0x450949=function(_0x417ab6){while(--_0x417ab6){_0x2faa69['push'](_0x2faa69['shift']());}};_0x450949(++_0x28c424);}(_0xf55e,0xb4));var _0xef55=function(_0x2a44a2,_0x5f5148){_0x2a44a2=_0x2a44a2-0x0;var _0xde7c53=_0xf55e[_0x2a44a2];return _0xde7c53;};'use strict';var _=require(_0xef55('0x0'));var rp=require(_0xef55('0x1'));var BPromise=require('bluebird');var md5=require(_0xef55('0x2'));var util=require('util');var intUtil=require(_0xef55('0x3'));var logger=require('../../../../config/logger')('sugarcrm');var io=require('socket.io-emitter')({'host':_0xef55('0x4'),'port':0x18eb});var def={'method':'POST','json':!![]};function emit(_0x1df2a2,_0x18e0c7,_0x431a0c){io['to'](_0x1df2a2)['emit'](_0x18e0c7,_0x431a0c);}function getTicket(_0x3479cc,_0x67dc4e,_0x4e0322,_0x45216d,_0x22a528,_0x44c1df,_0x24aaa2){logger['info'](_0xef55('0x5'));var _0x2c794a=new Date();var _0x4f10f5=[{'name':'name','value':intUtil[_0xef55('0x6')](_0x45216d[_0xef55('0x7')],_0x22a528,'\x20')},{'name':_0xef55('0x8'),'value':_0x67dc4e['id']},{'name':'created_by','value':_0x67dc4e['id']},{'name':_0xef55('0x9'),'value':intUtil[_0xef55('0x6')](_0x45216d[_0xef55('0xa')],_0x22a528,'\x0a')},{'name':_0xef55('0xb'),'value':_0x2c794a[_0xef55('0xc')]()[_0xef55('0xd')](0x0,0x13)[_0xef55('0xe')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xef55('0xf'),'value':'15'},{'name':_0xef55('0x10'),'value':_0x4e0322['id']},{'name':_0xef55('0x11'),'value':_0xef55('0x12')},{'name':_0xef55('0x13'),'value':_0x4e0322[_0xef55('0x14')]}];if(_0x44c1df['length']){_['forEach'](_0x44c1df,function(_0x96d14){if(_0x22a528[_0x96d14[_0xef55('0x15')]]){_0x4f10f5[_0xef55('0x16')]({'name':_0x96d14[_0xef55('0x17')],'value':_0x22a528[_0x96d14['variableName']]});}});}return request({'form':{'method':_0xef55('0x18'),'input_type':_0xef55('0x19'),'response_type':_0xef55('0x19'),'rest_data':JSON[_0xef55('0x1a')]({'session':_0x24aaa2['id'],'module_name':_0xef55('0x1b'),'name_value_list':_0x4f10f5})}});}function getAuth(_0x3ab598){return util[_0xef55('0x1c')](_0xef55('0x1d'),new Buffer(_0x3ab598[_0xef55('0x1e')]+':X')['toString'](_0xef55('0x1f')));}function getServerInfo(_0x448fe6){return request({'form':{'method':_0xef55('0x20'),'input_type':_0xef55('0x19'),'response_type':_0xef55('0x19'),'rest_data':JSON[_0xef55('0x1a')]({'session':_0x448fe6['id']})}});}function getUser(_0x28c067,_0x4130be,_0x2d24de){logger['info'](_0xef55('0x21'),_0x4130be);return request({'form':{'method':_0xef55('0x22'),'input_type':_0xef55('0x19'),'response_type':'JSON','rest_data':JSON[_0xef55('0x1a')]({'session':_0x2d24de['id'],'module_name':_0xef55('0x23'),'query':util[_0xef55('0x1c')](_0xef55('0x24'),_0x4130be),'order_by':'','offset':'0','select_fields':['id','name',_0xef55('0x25')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x575ddb){if(_0x575ddb['entry_list'][_0xef55('0x26')]){var _0x659314=_[_0xef55('0x27')](_0x575ddb['entry_list'],function(_0x34f554){return _0x34f554[_0xef55('0x28')]['user_name']['value']===_0x4130be;});if(_0x659314){logger[_0xef55('0x29')](_0xef55('0x2a'));return BPromise[_0xef55('0x2b')]({'id':_0x659314[_0xef55('0x28')]['id'][_0xef55('0x2c')],'name':_0x659314[_0xef55('0x28')][_0xef55('0x14')][_0xef55('0x2c')]});}}else{logger[_0xef55('0x29')](_0xef55('0x2d'));return BPromise[_0xef55('0x2b')]({'id':_0x2d24de['name_value_list'][_0xef55('0x2e')]['id'],'name':_0x2d24de[_0xef55('0x28')][_0xef55('0x25')]['id']});}});}function getEndUser(_0x415eea,_0x3ccda2,_0x149cdf,_0x32d641){logger[_0xef55('0x29')](_0xef55('0x2f'),_0x149cdf);return request({'form':{'method':_0xef55('0x22'),'input_type':'JSON','response_type':_0xef55('0x19'),'rest_data':JSON[_0xef55('0x1a')]({'session':_0x32d641['id'],'module_name':_0xef55('0x12'),'query':util[_0xef55('0x1c')](_0xef55('0x30'),_0x149cdf),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xef55('0x31')](function(_0x3f5710){if(_0x3f5710['entry_list'][_0xef55('0x26')]){var _0x40f164=_['find'](_0x3f5710[_0xef55('0x32')],function(_0x3ea699){return _0x3ea699[_0xef55('0x28')][_0xef55('0x33')][_0xef55('0x2c')]===_0x149cdf;});if(_0x40f164){logger[_0xef55('0x29')]('Enduser\x20found!');return BPromise[_0xef55('0x2b')]({'id':_0x40f164[_0xef55('0x28')]['id'][_0xef55('0x2c')],'name':_0x40f164[_0xef55('0x28')]['name'][_0xef55('0x2c')],'phone':_0x40f164[_0xef55('0x28')][_0xef55('0x33')][_0xef55('0x2c')]});}}else{logger[_0xef55('0x29')](_0xef55('0x34'));return request({'form':{'method':'set_entry','input_type':_0xef55('0x19'),'response_type':'JSON','rest_data':JSON[_0xef55('0x1a')]({'session':_0x32d641['id'],'module_name':_0xef55('0x12'),'name_value_list':[{'name':_0xef55('0x35'),'value':_0x3ccda2!==_0xef55('0x36')?_0x3ccda2:util['format'](_0xef55('0x37'),_0x149cdf)},{'name':_0xef55('0x33'),'value':_0x149cdf}]})}})['then'](function(_0x1e7b48){logger[_0xef55('0x29')](_0xef55('0x38'));return BPromise[_0xef55('0x2b')]({'id':_0x1e7b48['id'],'name':_0x1e7b48['entry_list']['first_name']['value'],'phone':_0x1e7b48[_0xef55('0x32')][_0xef55('0x33')][_0xef55('0x2c')]});});}});}function request(_0x13fb2f){logger['debug']('[HTTP]',JSON[_0xef55('0x1a')](_0x13fb2f));return rp(_['merge'](def,_0x13fb2f));}function getTags(_0x45db51,_0x2310ec){var _0x124d25=[];if(_0x45db51&&_0x45db51['length']>0x0){_0x124d25=_[_0xef55('0x39')](_0x45db51,_0x2310ec);}return _0x124d25;}function getCustomFields(_0x53e077,_0x1fb4fa){var _0x2fe1dd=[];var _0x4baebf={'custom_fields':[]};if(_0x53e077[_0xef55('0x26')]>0x0){_['forEach'](_0x53e077,function(_0x29d261){if(_0x29d261['type']===_0xef55('0x3a')&&_0x29d261['nameField']&&!_0x29d261[_0xef55('0x3b')]){_0x4baebf[_0x29d261[_0xef55('0x3c')][_0xef55('0x3d')]()]=_0x29d261['content'][_0xef55('0x3e')]();}else if(_0x29d261[_0xef55('0x3f')]===_0xef55('0x3a')&&_0x29d261[_0xef55('0x17')]&&_0x29d261['customField']){_0x4baebf[_0xef55('0x40')][_0xef55('0x16')]({'id':_0x29d261[_0xef55('0x17')],'value':_0x29d261[_0xef55('0x41')][_0xef55('0x3e')]()});}else if(_0x29d261[_0xef55('0x3f')]===_0xef55('0x42')&&_0x29d261[_0xef55('0x15')]&&_0x29d261[_0xef55('0x17')]&&_0x29d261[_0xef55('0x3b')]){_0x1fb4fa[_0x29d261[_0xef55('0x15')]]&&_0x4baebf['custom_fields']['push']({'id':_0x29d261[_0xef55('0x17')],'value':_0x1fb4fa[_0x29d261['variableName']][_0xef55('0x3e')]()});}else if(_0x29d261[_0xef55('0x3f')]==='customVariable'&&_0x29d261[_0xef55('0x43')]&&_0x29d261[_0xef55('0x43')][_0xef55('0x14')]&&_0x29d261[_0xef55('0x17')]&&_0x29d261['customField']){_0x1fb4fa[_0x29d261[_0xef55('0x43')][_0xef55('0x14')][_0xef55('0x3d')]()]&&_0x4baebf[_0xef55('0x40')][_0xef55('0x16')]({'id':_0x29d261[_0xef55('0x17')],'value':_0x1fb4fa[_0x29d261[_0xef55('0x43')][_0xef55('0x14')][_0xef55('0x3d')]()][_0xef55('0x3e')]()});}});}return _0x4baebf;}function getConnection(_0x344fb7){return request({'method':'POST','form':{'method':_0xef55('0x44'),'input_type':_0xef55('0x19'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x344fb7[_0xef55('0x45')],'password':_0x344fb7[_0xef55('0x46')],'encryption':_0xef55('0x47')},'application':_0xef55('0x48')})}})[_0xef55('0x31')](function(_0x2d9e05){var _0x6575e4=_0x2d9e05;if(_0x6575e4['id']){def[_0xef55('0x49')]=_0x6575e4['id'];return BPromise[_0xef55('0x2b')](_0x6575e4);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x344fb7['id']));}});}function setRelationship(_0x49f21c,_0xc227c9,_0x48ca18,_0x21c96b){return request({'form':{'method':_0xef55('0x4a'),'input_type':_0xef55('0x19'),'response_type':'JSON','rest_data':JSON[_0xef55('0x1a')]({'session':_0x49f21c['id'],'module_name':'Calls','module_id':_0x48ca18['id'],'link_field_name':_0x21c96b,'related_ids':[_0xc227c9['id']]})}});}exports[_0xef55('0x4b')]=function(_0x1d4bea,_0x48ec91,_0x299f52,_0x232d73,_0x4ce58a,_0x3b31e4){var _0x28e249,_0x37d12f,_0x324c38,_0x1b5633;_0x3b31e4[_0xef55('0x4c')]=intUtil[_0xef55('0x4d')](_0x3b31e4[_0xef55('0x4c')]);_0x3b31e4[_0xef55('0x4e')]=intUtil['stripTrailingSlash'](_0x3b31e4[_0xef55('0x4e')]);def['uri']=util[_0xef55('0x1c')](_0xef55('0x4f'),_0x3b31e4['remoteUri']);if(_0x4ce58a&&_0x4ce58a[_0xef55('0x50')]){logger[_0xef55('0x29')](_0xef55('0x51'),_0xef55('0x52'));_0x48ec91[_0xef55('0x53')]=util[_0xef55('0x1c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3b31e4[_0xef55('0x4e')],_0x48ec91[_0xef55('0x54')],md5(_0x48ec91[_0xef55('0x54')]));}else{_0x48ec91[_0xef55('0x53')]='';}return getConnection(_0x3b31e4)[_0xef55('0x31')](function(_0x2278fb){_0x1b5633=_0x2278fb;return getUser(_0x3b31e4,_0x232d73[_0xef55('0x14')],_0x1b5633);})[_0xef55('0x31')](function(_0x32525e){_0x28e249=_0x32525e;logger[_0xef55('0x29')](_0xef55('0x55'),_0x28e249['id']);return getEndUser(_0x3b31e4,_0x48ec91['calleridname'],_0x48ec91['calleridnum'],_0x1b5633);})[_0xef55('0x31')](function(_0x249e3d){_0x37d12f=_0x249e3d;logger[_0xef55('0x29')]('The\x20Enduser\x20ID\x20is:',_0x37d12f['id']);return getTicket(_0x3b31e4,_0x28e249,_0x37d12f,_0x299f52,_0x48ec91,_0x299f52[_0xef55('0x56')],_0x1b5633);})[_0xef55('0x31')](function(_0x416015){_0x324c38=_0x416015;logger[_0xef55('0x29')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x324c38['id']);return setRelationship(_0x1b5633,_0x28e249,_0x324c38,'users');})[_0xef55('0x31')](function(){return setRelationship(_0x1b5633,_0x37d12f,_0x324c38,'contacts');})[_0xef55('0x31')](function(){return getServerInfo(_0x1b5633);})[_0xef55('0x31')](function(_0x8514a2){var _0x260d29=parseInt(_0x8514a2['version'][_0xef55('0x57')](0x0));var _0x51a093=util[_0xef55('0x1c')](_0xef55('0x58'),_0x3b31e4[_0xef55('0x4c')],_0x324c38['id']);if(_0x260d29>0x6){_0x51a093=util[_0xef55('0x1c')](_0xef55('0x59'),_0x3b31e4['remoteUri'],_0x324c38['id']);}logger[_0xef55('0x29')](_0xef55('0x51'),_0xef55('0x5a'));emit(util[_0xef55('0x1c')](_0xef55('0x5b'),_0x232d73[_0xef55('0x14')]),'trigger:browser:url',{'uri':_0x51a093});})[_0xef55('0x5c')](function(_0x278807){logger['error'](_0xef55('0x51'),JSON[_0xef55('0x1a')](_0x278807));});};exports[_0xef55('0x5d')]=function(_0x396962,_0x5c4797,_0x419709,_0xf73b08,_0x5b1d76,_0x58b19f,_0x92f927){var _0x15c75e,_0x1e3060,_0x444967,_0x2cf72b;_0x58b19f['remoteUri']=intUtil[_0xef55('0x4d')](_0x58b19f['remoteUri']);_0x58b19f[_0xef55('0x4e')]=intUtil[_0xef55('0x4d')](_0x58b19f['serverUrl']);def[_0xef55('0x5e')]=util['format'](_0xef55('0x4f'),_0x58b19f[_0xef55('0x4c')]);if(_0x92f927&&_0x92f927[_0xef55('0x5f')]&&_0x92f927['recordingFormat']!==_0xef55('0x60')){logger['info'](_0xef55('0x61'),_0xef55('0x52'));_0x5c4797[_0xef55('0x53')]=util['format'](_0xef55('0x62'),_0x58b19f[_0xef55('0x4e')],_0x5c4797[_0xef55('0x54')],md5(_0x5c4797[_0xef55('0x54')]));}return getConnection(_0x58b19f)[_0xef55('0x31')](function(_0x2df477){_0x2cf72b=_0x2df477;return getUser(_0x58b19f,_0xf73b08[_0xef55('0x14')],_0x2cf72b);})['then'](function(_0x3f1bf7){_0x15c75e=_0x3f1bf7;logger[_0xef55('0x29')](_0xef55('0x55'),_0x15c75e['id']);return getEndUser(_0x58b19f,_0x5c4797[_0xef55('0x63')],_0x5c4797[_0xef55('0x64')],_0x2cf72b);})[_0xef55('0x31')](function(_0x23f1f9){_0x1e3060=_0x23f1f9;logger[_0xef55('0x29')](_0xef55('0x65'),_0x1e3060['id']);return getTicket(_0x58b19f,_0x15c75e,_0x1e3060,_0x419709,_0x5c4797,_0x419709[_0xef55('0x56')],_0x2cf72b);})[_0xef55('0x31')](function(_0x2650b8){_0x444967=_0x2650b8;logger['info']('Ticket\x20created!');logger[_0xef55('0x29')](_0xef55('0x66'),_0x444967['id']);return setRelationship(_0x2cf72b,_0x15c75e,_0x444967,_0xef55('0x67'));})[_0xef55('0x31')](function(){return setRelationship(_0x2cf72b,_0x1e3060,_0x444967,_0xef55('0x68'));})[_0xef55('0x31')](function(){return getServerInfo(_0x2cf72b);})[_0xef55('0x31')](function(_0x248544){var _0x1246cc=parseInt(_0x248544[_0xef55('0x69')]['charAt'](0x0));var _0x1b9965=util[_0xef55('0x1c')](_0xef55('0x58'),_0x58b19f[_0xef55('0x4c')],_0x444967['id']);if(_0x1246cc>0x6){_0x1b9965=util[_0xef55('0x1c')](_0xef55('0x59'),_0x58b19f[_0xef55('0x4c')],_0x444967['id']);}logger['info']('[OUTBOUND]',_0xef55('0x5a'));emit(util[_0xef55('0x1c')]('user:%s',_0xf73b08[_0xef55('0x14')]),_0xef55('0x6a'),{'uri':_0x1b9965});})[_0xef55('0x5c')](function(_0x5e36ea){logger[_0xef55('0x6b')](_0xef55('0x61'),JSON[_0xef55('0x1a')](_0x5e36ea));});};exports[_0xef55('0x6c')]=function(_0x13386f,_0x8a1b7c,_0x8451cb,_0x212467,_0x2c33a3,_0x1548d0){var _0x1a13c9,_0x412ec1,_0x44d0f3,_0x529166;_0x1548d0['remoteUri']=intUtil[_0xef55('0x4d')](_0x1548d0[_0xef55('0x4c')]);_0x1548d0[_0xef55('0x4e')]=intUtil[_0xef55('0x4d')](_0x1548d0[_0xef55('0x4e')]);def[_0xef55('0x5e')]=util[_0xef55('0x1c')]('%s/service/v4_1/rest.php',_0x1548d0[_0xef55('0x4c')]);if(_0x2c33a3&&_0x2c33a3[_0xef55('0x50')]){logger[_0xef55('0x29')](_0xef55('0x6d'),_0xef55('0x52'));_0x8a1b7c[_0xef55('0x53')]=util['format'](_0xef55('0x62'),_0x1548d0[_0xef55('0x4e')],_0x8a1b7c[_0xef55('0x54')],md5(_0x8a1b7c['uniqueid']));}else{_0x8a1b7c[_0xef55('0x53')]='';}return getConnection(_0x1548d0)[_0xef55('0x31')](function(_0x3929d2){_0x529166=_0x3929d2;return getUser(_0x1548d0,_0x212467[_0xef55('0x14')],_0x529166);})['then'](function(_0x107ae2){_0x1a13c9=_0x107ae2;logger[_0xef55('0x29')](_0xef55('0x55'),_0x1a13c9['id']);return getEndUser(_0x1548d0,_0x8a1b7c[_0xef55('0x6e')],_0x8a1b7c[_0xef55('0x6f')],_0x529166);})[_0xef55('0x31')](function(_0x305dd2){_0x412ec1=_0x305dd2;logger[_0xef55('0x29')](_0xef55('0x65'),_0x412ec1['id']);return getTicket(_0x1548d0,_0x1a13c9,_0x412ec1,_0x8451cb,_0x8a1b7c,_0x8451cb[_0xef55('0x56')],_0x529166);})[_0xef55('0x31')](function(_0x403c88){_0x44d0f3=_0x403c88;logger[_0xef55('0x29')](_0xef55('0x70'));logger[_0xef55('0x29')]('The\x20Ticket\x20ID\x20is:',_0x44d0f3['id']);return setRelationship(_0x529166,_0x1a13c9,_0x44d0f3,'users');})[_0xef55('0x31')](function(){return setRelationship(_0x529166,_0x412ec1,_0x44d0f3,_0xef55('0x68'));})[_0xef55('0x31')](function(){return getServerInfo(_0x529166);})[_0xef55('0x5c')](function(_0xe81d26){logger[_0xef55('0x6b')](_0xef55('0x6d'),JSON['stringify'](_0xe81d26));});};
\ No newline at end of file
+var _0x94b7=['[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','The\x20Enduser\x20ID\x20is:','contacts','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[ABANDONED]','error','bluebird','./util','../../../../config/logger','sugarcrm','socket.io-emitter','localhost','POST','info','name','getString','Subjects','created_by','Descriptions','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_name','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','user_name','then','entry_list','find','name_value_list','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','debug','[HTTP]','merge','type','string','nameField','customField','toLowerCase','content','toString','custom_fields','variable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format'];(function(_0x35bb03,_0x41b9fb){var _0x38a98e=function(_0x20c7a2){while(--_0x20c7a2){_0x35bb03['push'](_0x35bb03['shift']());}};_0x38a98e(++_0x41b9fb);}(_0x94b7,0x1b3));var _0x794b=function(_0x48a6d8,_0x1e5a03){_0x48a6d8=_0x48a6d8-0x0;var _0x1926f3=_0x94b7[_0x48a6d8];return _0x1926f3;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x794b('0x0'));var md5=require('md5');var util=require('util');var intUtil=require(_0x794b('0x1'));var logger=require(_0x794b('0x2'))(_0x794b('0x3'));var io=require(_0x794b('0x4'))({'host':_0x794b('0x5'),'port':0x18eb});var def={'method':_0x794b('0x6'),'json':!![]};function emit(_0x19cc1e,_0x19bf5c,_0x4828e9){io['to'](_0x19cc1e)['emit'](_0x19bf5c,_0x4828e9);}function getTicket(_0x4f44de,_0x110041,_0x1e7bdd,_0x2504ad,_0x2b1328,_0x3f4655,_0x2cfbe4){logger[_0x794b('0x7')]('Creating\x20new\x20ticket...');var _0x2c2005=new Date();var _0x440af5=[{'name':_0x794b('0x8'),'value':intUtil[_0x794b('0x9')](_0x2504ad[_0x794b('0xa')],_0x2b1328,'\x20')},{'name':'assigned_user_id','value':_0x110041['id']},{'name':_0x794b('0xb'),'value':_0x110041['id']},{'name':'description','value':intUtil[_0x794b('0x9')](_0x2504ad[_0x794b('0xc')],_0x2b1328,'\x0a')},{'name':'date_start','value':_0x2c2005[_0x794b('0xd')]()['slice'](0x0,0x13)[_0x794b('0xe')]('T','\x20')},{'name':_0x794b('0xf'),'value':'0'},{'name':_0x794b('0x10'),'value':'15'},{'name':_0x794b('0x11'),'value':_0x1e7bdd['id']},{'name':'parent_type','value':'Contacts'},{'name':_0x794b('0x12'),'value':_0x1e7bdd[_0x794b('0x8')]}];if(_0x3f4655[_0x794b('0x13')]){_[_0x794b('0x14')](_0x3f4655,function(_0x1af365){if(_0x2b1328[_0x1af365[_0x794b('0x15')]]){_0x440af5[_0x794b('0x16')]({'name':_0x1af365[_0x794b('0x17')],'value':_0x2b1328[_0x1af365[_0x794b('0x15')]]});}});}return request({'form':{'method':_0x794b('0x18'),'input_type':'JSON','response_type':_0x794b('0x19'),'rest_data':JSON[_0x794b('0x1a')]({'session':_0x2cfbe4['id'],'module_name':_0x794b('0x1b'),'name_value_list':_0x440af5})}});}function getAuth(_0x4e358b){return util[_0x794b('0x1c')](_0x794b('0x1d'),new Buffer(_0x4e358b['apiKey']+':X')['toString']('base64'));}function getServerInfo(_0x396965){return request({'form':{'method':'get_server_info','input_type':_0x794b('0x19'),'response_type':_0x794b('0x19'),'rest_data':JSON['stringify']({'session':_0x396965['id']})}});}function getUser(_0x186489,_0x4f15b2,_0x4d7f32){logger[_0x794b('0x7')]('Getting\x20agent\x20with\x20name',_0x4f15b2);return request({'form':{'method':'get_entry_list','input_type':_0x794b('0x19'),'response_type':_0x794b('0x19'),'rest_data':JSON[_0x794b('0x1a')]({'session':_0x4d7f32['id'],'module_name':'Employees','query':util[_0x794b('0x1c')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x4f15b2),'order_by':'','offset':'0','select_fields':['id',_0x794b('0x8'),_0x794b('0x1e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x794b('0x1f')](function(_0x104bea){if(_0x104bea[_0x794b('0x20')]['length']){var _0x10bd5b=_[_0x794b('0x21')](_0x104bea[_0x794b('0x20')],function(_0x9f7977){return _0x9f7977[_0x794b('0x22')][_0x794b('0x1e')]['value']===_0x4f15b2;});if(_0x10bd5b){logger['info']('Agent\x20found!');return BPromise['resolve']({'id':_0x10bd5b[_0x794b('0x22')]['id'][_0x794b('0x23')],'name':_0x10bd5b[_0x794b('0x22')][_0x794b('0x8')][_0x794b('0x23')]});}}else{logger[_0x794b('0x7')](_0x794b('0x24'));return BPromise[_0x794b('0x25')]({'id':_0x4d7f32[_0x794b('0x22')][_0x794b('0x26')]['id'],'name':_0x4d7f32[_0x794b('0x22')]['user_name']['id']});}});}function getEndUser(_0x307c37,_0x23618a,_0x360da1,_0x1f8311){logger[_0x794b('0x7')](_0x794b('0x27'),_0x360da1);return request({'form':{'method':'get_entry_list','input_type':_0x794b('0x19'),'response_type':_0x794b('0x19'),'rest_data':JSON['stringify']({'session':_0x1f8311['id'],'module_name':_0x794b('0x28'),'query':util['format'](_0x794b('0x29'),_0x360da1),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x794b('0x1f')](function(_0xf29c20){if(_0xf29c20[_0x794b('0x20')][_0x794b('0x13')]){var _0x3540fa=_[_0x794b('0x21')](_0xf29c20[_0x794b('0x20')],function(_0x5ca73d){return _0x5ca73d['name_value_list'][_0x794b('0x2a')][_0x794b('0x23')]===_0x360da1;});if(_0x3540fa){logger[_0x794b('0x7')](_0x794b('0x2b'));return BPromise[_0x794b('0x25')]({'id':_0x3540fa[_0x794b('0x22')]['id'][_0x794b('0x23')],'name':_0x3540fa[_0x794b('0x22')]['name'][_0x794b('0x23')],'phone':_0x3540fa[_0x794b('0x22')][_0x794b('0x2a')]['value']});}}else{logger[_0x794b('0x7')](_0x794b('0x2c'));return request({'form':{'method':_0x794b('0x18'),'input_type':'JSON','response_type':_0x794b('0x19'),'rest_data':JSON[_0x794b('0x1a')]({'session':_0x1f8311['id'],'module_name':_0x794b('0x28'),'name_value_list':[{'name':_0x794b('0x2d'),'value':_0x23618a!==_0x794b('0x2e')?_0x23618a:util[_0x794b('0x1c')]('Caller\x20-\x20%s',_0x360da1)},{'name':'phone_home','value':_0x360da1}]})}})['then'](function(_0x54f646){logger['info']('Enduser\x20created.');return BPromise[_0x794b('0x25')]({'id':_0x54f646['id'],'name':_0x54f646[_0x794b('0x20')][_0x794b('0x2d')][_0x794b('0x23')],'phone':_0x54f646[_0x794b('0x20')][_0x794b('0x2a')][_0x794b('0x23')]});});}});}function request(_0x3fa8bc){logger[_0x794b('0x2f')](_0x794b('0x30'),JSON[_0x794b('0x1a')](_0x3fa8bc));return rp(_[_0x794b('0x31')](def,_0x3fa8bc));}function getTags(_0x15a606,_0x10e534){var _0x3e0c7f=[];if(_0x15a606&&_0x15a606['length']>0x0){_0x3e0c7f=_['map'](_0x15a606,_0x10e534);}return _0x3e0c7f;}function getCustomFields(_0x2b14f2,_0x16f2f5){var _0x17c9a0=[];var _0x17d734={'custom_fields':[]};if(_0x2b14f2[_0x794b('0x13')]>0x0){_['forEach'](_0x2b14f2,function(_0x42b28a){if(_0x42b28a[_0x794b('0x32')]===_0x794b('0x33')&&_0x42b28a[_0x794b('0x34')]&&!_0x42b28a[_0x794b('0x35')]){_0x17d734[_0x42b28a[_0x794b('0x34')][_0x794b('0x36')]()]=_0x42b28a[_0x794b('0x37')][_0x794b('0x38')]();}else if(_0x42b28a[_0x794b('0x32')]==='string'&&_0x42b28a[_0x794b('0x17')]&&_0x42b28a[_0x794b('0x35')]){_0x17d734[_0x794b('0x39')][_0x794b('0x16')]({'id':_0x42b28a[_0x794b('0x17')],'value':_0x42b28a[_0x794b('0x37')][_0x794b('0x38')]()});}else if(_0x42b28a[_0x794b('0x32')]===_0x794b('0x3a')&&_0x42b28a['variableName']&&_0x42b28a[_0x794b('0x17')]&&_0x42b28a['customField']){_0x16f2f5[_0x42b28a['variableName']]&&_0x17d734[_0x794b('0x39')][_0x794b('0x16')]({'id':_0x42b28a[_0x794b('0x17')],'value':_0x16f2f5[_0x42b28a[_0x794b('0x15')]][_0x794b('0x38')]()});}else if(_0x42b28a[_0x794b('0x32')]==='customVariable'&&_0x42b28a[_0x794b('0x3b')]&&_0x42b28a[_0x794b('0x3b')][_0x794b('0x8')]&&_0x42b28a[_0x794b('0x17')]&&_0x42b28a[_0x794b('0x35')]){_0x16f2f5[_0x42b28a[_0x794b('0x3b')][_0x794b('0x8')][_0x794b('0x36')]()]&&_0x17d734[_0x794b('0x39')][_0x794b('0x16')]({'id':_0x42b28a['idField'],'value':_0x16f2f5[_0x42b28a[_0x794b('0x3b')][_0x794b('0x8')][_0x794b('0x36')]()]['toString']()});}});}return _0x17d734;}function getConnection(_0x18356a){return request({'method':_0x794b('0x6'),'form':{'method':_0x794b('0x3c'),'input_type':_0x794b('0x19'),'response_type':'JSON','rest_data':JSON[_0x794b('0x1a')]({'user_auth':{'user_name':_0x18356a[_0x794b('0x3d')],'password':_0x18356a[_0x794b('0x3e')],'encryption':_0x794b('0x3f')},'application':_0x794b('0x40')})}})[_0x794b('0x1f')](function(_0x473cb2){var _0x5b67d5=_0x473cb2;if(_0x5b67d5['id']){def[_0x794b('0x41')]=_0x5b67d5['id'];return BPromise[_0x794b('0x25')](_0x5b67d5);}else{throw new Error(util[_0x794b('0x1c')](_0x794b('0x42'),_0x18356a['id']));}});}function setRelationship(_0x44e24b,_0x576e3d,_0x2684ed,_0x148f06){return request({'form':{'method':_0x794b('0x43'),'input_type':_0x794b('0x19'),'response_type':_0x794b('0x19'),'rest_data':JSON[_0x794b('0x1a')]({'session':_0x44e24b['id'],'module_name':_0x794b('0x1b'),'module_id':_0x2684ed['id'],'link_field_name':_0x148f06,'related_ids':[_0x576e3d['id']]})}});}exports[_0x794b('0x44')]=function(_0x2d6e47,_0x58d24e,_0x312b4e,_0x363797,_0x5a8cc0,_0x3773ae){var _0x5dff3d,_0x58aae9,_0x17bc0d,_0x1ad06f;_0x3773ae[_0x794b('0x45')]=intUtil['stripTrailingSlash'](_0x3773ae[_0x794b('0x45')]);_0x3773ae[_0x794b('0x46')]=intUtil[_0x794b('0x47')](_0x3773ae[_0x794b('0x46')]);def[_0x794b('0x48')]=util[_0x794b('0x1c')](_0x794b('0x49'),_0x3773ae[_0x794b('0x45')]);if(_0x5a8cc0&&_0x5a8cc0[_0x794b('0x4a')]){logger[_0x794b('0x7')](_0x794b('0x4b'),_0x794b('0x4c'));_0x58d24e[_0x794b('0x4d')]=util[_0x794b('0x1c')](_0x794b('0x4e'),_0x3773ae['serverUrl'],_0x58d24e[_0x794b('0x4f')],md5(_0x58d24e[_0x794b('0x4f')]));}else{_0x58d24e[_0x794b('0x4d')]='';}return getConnection(_0x3773ae)[_0x794b('0x1f')](function(_0x2e41a3){_0x1ad06f=_0x2e41a3;return getUser(_0x3773ae,_0x363797[_0x794b('0x8')],_0x1ad06f);})[_0x794b('0x1f')](function(_0x5d25f4){_0x5dff3d=_0x5d25f4;logger[_0x794b('0x7')]('The\x20User\x20ID\x20is:',_0x5dff3d['id']);return getEndUser(_0x3773ae,_0x58d24e[_0x794b('0x50')],_0x58d24e[_0x794b('0x51')],_0x1ad06f);})[_0x794b('0x1f')](function(_0xa663c8){_0x58aae9=_0xa663c8;logger[_0x794b('0x7')]('The\x20Enduser\x20ID\x20is:',_0x58aae9['id']);return getTicket(_0x3773ae,_0x5dff3d,_0x58aae9,_0x312b4e,_0x58d24e,_0x312b4e[_0x794b('0x52')],_0x1ad06f);})[_0x794b('0x1f')](function(_0x323573){_0x17bc0d=_0x323573;logger['info'](_0x794b('0x53'));logger['info'](_0x794b('0x54'),_0x17bc0d['id']);return setRelationship(_0x1ad06f,_0x5dff3d,_0x17bc0d,_0x794b('0x55'));})[_0x794b('0x1f')](function(){return setRelationship(_0x1ad06f,_0x58aae9,_0x17bc0d,'contacts');})[_0x794b('0x1f')](function(){return getServerInfo(_0x1ad06f);})['then'](function(_0x566e7f){var _0xfdd5a5=parseInt(_0x566e7f[_0x794b('0x56')][_0x794b('0x57')](0x0));var _0x428138=util['format'](_0x794b('0x58'),_0x3773ae['remoteUri'],_0x17bc0d['id']);if(_0xfdd5a5>0x6){_0x428138=util[_0x794b('0x1c')](_0x794b('0x59'),_0x3773ae['remoteUri'],_0x17bc0d['id']);}logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x794b('0x1c')](_0x794b('0x5a'),_0x363797['name']),_0x794b('0x5b'),{'uri':_0x428138});})[_0x794b('0x5c')](function(_0x5282f1){logger['error'](_0x794b('0x4b'),JSON[_0x794b('0x1a')](_0x5282f1));});};exports['outbound']=function(_0x343a36,_0x577fec,_0x3fd900,_0x3cb475,_0x3d7d76,_0x5b9c96,_0x11fb0a){var _0x2cdd58,_0x406b3e,_0x40659f,_0x16c1d1;_0x5b9c96[_0x794b('0x45')]=intUtil[_0x794b('0x47')](_0x5b9c96[_0x794b('0x45')]);_0x5b9c96[_0x794b('0x46')]=intUtil['stripTrailingSlash'](_0x5b9c96[_0x794b('0x46')]);def[_0x794b('0x48')]=util[_0x794b('0x1c')]('%s/service/v4_1/rest.php',_0x5b9c96['remoteUri']);if(_0x11fb0a&&_0x11fb0a[_0x794b('0x5d')]&&_0x11fb0a[_0x794b('0x5d')]!=='none'){logger[_0x794b('0x7')](_0x794b('0x5e'),'Recording\x20is\x20enabled!');_0x577fec['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5b9c96[_0x794b('0x46')],_0x577fec[_0x794b('0x4f')],md5(_0x577fec[_0x794b('0x4f')]));}return getConnection(_0x5b9c96)[_0x794b('0x1f')](function(_0x4b9db1){_0x16c1d1=_0x4b9db1;return getUser(_0x5b9c96,_0x3cb475[_0x794b('0x8')],_0x16c1d1);})[_0x794b('0x1f')](function(_0x5188b4){_0x2cdd58=_0x5188b4;logger[_0x794b('0x7')](_0x794b('0x5f'),_0x2cdd58['id']);return getEndUser(_0x5b9c96,_0x577fec['destcalleridname'],_0x577fec[_0x794b('0x60')],_0x16c1d1);})[_0x794b('0x1f')](function(_0x1d8dfa){_0x406b3e=_0x1d8dfa;logger[_0x794b('0x7')](_0x794b('0x61'),_0x406b3e['id']);return getTicket(_0x5b9c96,_0x2cdd58,_0x406b3e,_0x3fd900,_0x577fec,_0x3fd900['Fields'],_0x16c1d1);})[_0x794b('0x1f')](function(_0x233799){_0x40659f=_0x233799;logger['info']('Ticket\x20created!');logger[_0x794b('0x7')]('The\x20Ticket\x20ID\x20is:',_0x40659f['id']);return setRelationship(_0x16c1d1,_0x2cdd58,_0x40659f,_0x794b('0x55'));})[_0x794b('0x1f')](function(){return setRelationship(_0x16c1d1,_0x406b3e,_0x40659f,_0x794b('0x62'));})[_0x794b('0x1f')](function(){return getServerInfo(_0x16c1d1);})[_0x794b('0x1f')](function(_0x29d3a2){var _0x399627=parseInt(_0x29d3a2['version'][_0x794b('0x57')](0x0));var _0x2bc53b=util[_0x794b('0x1c')](_0x794b('0x58'),_0x5b9c96[_0x794b('0x45')],_0x40659f['id']);if(_0x399627>0x6){_0x2bc53b=util[_0x794b('0x1c')](_0x794b('0x59'),_0x5b9c96[_0x794b('0x45')],_0x40659f['id']);}logger[_0x794b('0x7')](_0x794b('0x5e'),_0x794b('0x63'));emit(util[_0x794b('0x1c')](_0x794b('0x5a'),_0x3cb475[_0x794b('0x8')]),_0x794b('0x5b'),{'uri':_0x2bc53b});})[_0x794b('0x5c')](function(_0x4c40bf){logger['error'](_0x794b('0x5e'),JSON[_0x794b('0x1a')](_0x4c40bf));});};exports['abandoned']=function(_0xf241f6,_0x14b819,_0x159a66,_0xf133cd,_0x3f4daa,_0x15c273){var _0x5338c8,_0x2fb1c8,_0xab122f,_0x5943ef;_0x15c273[_0x794b('0x45')]=intUtil[_0x794b('0x47')](_0x15c273[_0x794b('0x45')]);_0x15c273[_0x794b('0x46')]=intUtil[_0x794b('0x47')](_0x15c273[_0x794b('0x46')]);def[_0x794b('0x48')]=util[_0x794b('0x1c')](_0x794b('0x49'),_0x15c273[_0x794b('0x45')]);if(_0x3f4daa&&_0x3f4daa[_0x794b('0x4a')]){logger['info'](_0x794b('0x64'),_0x794b('0x4c'));_0x14b819[_0x794b('0x4d')]=util[_0x794b('0x1c')](_0x794b('0x4e'),_0x15c273[_0x794b('0x46')],_0x14b819[_0x794b('0x4f')],md5(_0x14b819[_0x794b('0x4f')]));}else{_0x14b819[_0x794b('0x4d')]='';}return getConnection(_0x15c273)['then'](function(_0x4ebb0d){_0x5943ef=_0x4ebb0d;return getUser(_0x15c273,_0xf133cd[_0x794b('0x8')],_0x5943ef);})[_0x794b('0x1f')](function(_0x1ecc01){_0x5338c8=_0x1ecc01;logger['info'](_0x794b('0x5f'),_0x5338c8['id']);return getEndUser(_0x15c273,_0x14b819[_0x794b('0x50')],_0x14b819[_0x794b('0x51')],_0x5943ef);})[_0x794b('0x1f')](function(_0x37172f){_0x2fb1c8=_0x37172f;logger[_0x794b('0x7')](_0x794b('0x61'),_0x2fb1c8['id']);return getTicket(_0x15c273,_0x5338c8,_0x2fb1c8,_0x159a66,_0x14b819,_0x159a66[_0x794b('0x52')],_0x5943ef);})[_0x794b('0x1f')](function(_0x7f4f52){_0xab122f=_0x7f4f52;logger[_0x794b('0x7')]('Ticket\x20created!');logger['info'](_0x794b('0x54'),_0xab122f['id']);return setRelationship(_0x5943ef,_0x5338c8,_0xab122f,_0x794b('0x55'));})['then'](function(){return setRelationship(_0x5943ef,_0x2fb1c8,_0xab122f,_0x794b('0x62'));})[_0x794b('0x1f')](function(){return getServerInfo(_0x5943ef);})[_0x794b('0x5c')](function(_0x4ffd25){logger[_0x794b('0x65')](_0x794b('0x64'),JSON['stringify'](_0x4ffd25));});};
\ No newline at end of file
index 0a840c7..c59a2cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9b4=['type','string','content','variable','variableName','push','toString','Variable','name','toLowerCase','keyValue','keyType','key','format','keyContent','%s:\x20%s','customVariable','join','stripTrailingSlash','substr','lodash','util','getString','length','sortBy'];(function(_0x3ed408,_0x28c967){var _0x1a6c91=function(_0x122d1f){while(--_0x122d1f){_0x3ed408['push'](_0x3ed408['shift']());}};_0x1a6c91(++_0x28c967);}(_0xb9b4,0x172));var _0x4b9b=function(_0x420271,_0x1503a7){_0x420271=_0x420271-0x0;var _0x33ae52=_0xb9b4[_0x420271];return _0x33ae52;};'use strict';var _=require(_0x4b9b('0x0'));var util=require(_0x4b9b('0x1'));exports[_0x4b9b('0x2')]=function(_0xa390c1,_0x3d13bd,_0x2b6524){var _0x15bcc3=[];if(_0xa390c1[_0x4b9b('0x3')]>0x0){var _0xcd4bde=_[_0x4b9b('0x4')](_0xa390c1,['id']);for(var _0x267f40=0x0;_0x267f40<_0xcd4bde[_0x4b9b('0x3')];_0x267f40++){var _0x4e93c7=_0xcd4bde[_0x267f40];if(_0x4e93c7[_0x4b9b('0x5')]===_0x4b9b('0x6')){_0x15bcc3['push'](_0x4e93c7[_0x4b9b('0x7')]);}else if(_0x4e93c7[_0x4b9b('0x5')]===_0x4b9b('0x8')&&_0x4e93c7[_0x4b9b('0x9')]){_0x3d13bd[_0x4e93c7['variableName']]&&_0x15bcc3[_0x4b9b('0xa')](_0x3d13bd[_0x4e93c7[_0x4b9b('0x9')]][_0x4b9b('0xb')]());}else if(_0x4e93c7[_0x4b9b('0x5')]==='customVariable'&&_0x4e93c7[_0x4b9b('0xc')]&&_0x4e93c7[_0x4b9b('0xc')][_0x4b9b('0xd')]){_0x3d13bd[_0x4e93c7['Variable']['name'][_0x4b9b('0xe')]()]&&_0x15bcc3[_0x4b9b('0xa')](_0x3d13bd[_0x4e93c7[_0x4b9b('0xc')][_0x4b9b('0xd')][_0x4b9b('0xe')]()]['toString']());}else if(_0x4e93c7['type']===_0x4b9b('0xf')){if(_0x4e93c7[_0x4b9b('0x10')]===_0x4b9b('0x6')&&_0x4e93c7[_0x4b9b('0x11')]){_0x15bcc3['push'](util[_0x4b9b('0x12')]('%s:\x20%s',_0x4e93c7[_0x4b9b('0x11')],_0x4e93c7[_0x4b9b('0x13')]));}else if(_0x4e93c7[_0x4b9b('0x10')]===_0x4b9b('0x8')&&_0x4e93c7[_0x4b9b('0x9')]&&_0x4e93c7[_0x4b9b('0x11')]){_0x3d13bd[_0x4e93c7['variableName']]&&_0x15bcc3['push'](util[_0x4b9b('0x12')](_0x4b9b('0x14'),_0x4e93c7['key'],_0x3d13bd[_0x4e93c7[_0x4b9b('0x9')]]));}else if(_0x4e93c7[_0x4b9b('0x10')]===_0x4b9b('0x15')&&_0x4e93c7['Variable']&&_0x4e93c7[_0x4b9b('0xc')]['name']&&_0x4e93c7[_0x4b9b('0x11')]){_0x3d13bd[_0x4e93c7['Variable'][_0x4b9b('0xd')][_0x4b9b('0xe')]()]&&_0x15bcc3[_0x4b9b('0xa')](util[_0x4b9b('0x12')](_0x4b9b('0x14'),_0x4e93c7['key'],_0x3d13bd[_0x4e93c7[_0x4b9b('0xc')][_0x4b9b('0xd')][_0x4b9b('0xe')]()]));}}}}return _0x15bcc3[_0x4b9b('0x16')](_0x2b6524);};exports[_0x4b9b('0x17')]=function(_0x27ac3a){if(_0x27ac3a&&_0x27ac3a[_0x4b9b('0x18')](-0x1)==='/'){return _0x27ac3a[_0x4b9b('0x18')](0x0,_0x27ac3a[_0x4b9b('0x3')]-0x1);}return _0x27ac3a;};
\ No newline at end of file
+var _0x0b4c=['push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyType','string','key','format','keyContent','%s:\x20%s','join','stripTrailingSlash','substr','lodash','util','getString','length','sortBy','type'];(function(_0x4be83a,_0x3622ea){var _0x207392=function(_0xc80654){while(--_0xc80654){_0x4be83a['push'](_0x4be83a['shift']());}};_0x207392(++_0x3622ea);}(_0x0b4c,0x14a));var _0xc0b4=function(_0x6cb421,_0x7720c9){_0x6cb421=_0x6cb421-0x0;var _0x23820d=_0x0b4c[_0x6cb421];return _0x23820d;};'use strict';var _=require(_0xc0b4('0x0'));var util=require(_0xc0b4('0x1'));exports[_0xc0b4('0x2')]=function(_0x519bf9,_0x56709e,_0x4d3c61){var _0x50aa84=[];if(_0x519bf9[_0xc0b4('0x3')]>0x0){var _0x726b04=_[_0xc0b4('0x4')](_0x519bf9,['id']);for(var _0x5070c3=0x0;_0x5070c3<_0x726b04['length'];_0x5070c3++){var _0x32aaf5=_0x726b04[_0x5070c3];if(_0x32aaf5[_0xc0b4('0x5')]==='string'){_0x50aa84[_0xc0b4('0x6')](_0x32aaf5[_0xc0b4('0x7')]);}else if(_0x32aaf5[_0xc0b4('0x5')]===_0xc0b4('0x8')&&_0x32aaf5['variableName']){_0x56709e[_0x32aaf5[_0xc0b4('0x9')]]&&_0x50aa84['push'](_0x56709e[_0x32aaf5[_0xc0b4('0x9')]][_0xc0b4('0xa')]());}else if(_0x32aaf5[_0xc0b4('0x5')]===_0xc0b4('0xb')&&_0x32aaf5[_0xc0b4('0xc')]&&_0x32aaf5[_0xc0b4('0xc')][_0xc0b4('0xd')]){_0x56709e[_0x32aaf5[_0xc0b4('0xc')][_0xc0b4('0xd')][_0xc0b4('0xe')]()]&&_0x50aa84['push'](_0x56709e[_0x32aaf5['Variable']['name'][_0xc0b4('0xe')]()][_0xc0b4('0xa')]());}else if(_0x32aaf5[_0xc0b4('0x5')]==='keyValue'){if(_0x32aaf5[_0xc0b4('0xf')]===_0xc0b4('0x10')&&_0x32aaf5[_0xc0b4('0x11')]){_0x50aa84[_0xc0b4('0x6')](util[_0xc0b4('0x12')]('%s:\x20%s',_0x32aaf5['key'],_0x32aaf5[_0xc0b4('0x13')]));}else if(_0x32aaf5['keyType']===_0xc0b4('0x8')&&_0x32aaf5['variableName']&&_0x32aaf5[_0xc0b4('0x11')]){_0x56709e[_0x32aaf5['variableName']]&&_0x50aa84[_0xc0b4('0x6')](util['format'](_0xc0b4('0x14'),_0x32aaf5[_0xc0b4('0x11')],_0x56709e[_0x32aaf5[_0xc0b4('0x9')]]));}else if(_0x32aaf5['keyType']==='customVariable'&&_0x32aaf5[_0xc0b4('0xc')]&&_0x32aaf5[_0xc0b4('0xc')][_0xc0b4('0xd')]&&_0x32aaf5[_0xc0b4('0x11')]){_0x56709e[_0x32aaf5[_0xc0b4('0xc')]['name'][_0xc0b4('0xe')]()]&&_0x50aa84['push'](util[_0xc0b4('0x12')](_0xc0b4('0x14'),_0x32aaf5['key'],_0x56709e[_0x32aaf5[_0xc0b4('0xc')]['name'][_0xc0b4('0xe')]()]));}}}}return _0x50aa84[_0xc0b4('0x15')](_0x4d3c61);};exports[_0xc0b4('0x16')]=function(_0xa3aef3){if(_0xa3aef3&&_0xa3aef3[_0xc0b4('0x17')](-0x1)==='/'){return _0xa3aef3[_0xc0b4('0x17')](0x0,_0xa3aef3[_0xc0b4('0x3')]-0x1);}return _0xa3aef3;};
\ No newline at end of file
index f35ea0b..1a83dcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73ae=['monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridnum','Fields','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lodash','request-promise','bluebird','util','./util','../../../../config/logger','vTiger','localhost','emit','length','forEach','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','format','remoteUri','create','admin','sessionName','stringify','then','success','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','query','test','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','catch','statusCode','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','getchallenge','login','token','getConnection','[HTTP]'];(function(_0x3b3a82,_0x53b5e0){var _0x267063=function(_0x5aaf3d){while(--_0x5aaf3d){_0x3b3a82['push'](_0x3b3a82['shift']());}};_0x267063(++_0x53b5e0);}(_0x73ae,0x146));var _0xe73a=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x73ae[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0xe73a('0x0'));var rp=require(_0xe73a('0x1'));var BPromise=require(_0xe73a('0x2'));var md5=require('md5');var util=require(_0xe73a('0x3'));var intUtil=require(_0xe73a('0x4'));var logger=require(_0xe73a('0x5'))(_0xe73a('0x6'));var io=require('socket.io-emitter')({'host':_0xe73a('0x7'),'port':0x18eb});function emit(_0x3f0571,_0x1c9e2a,_0x369a30){io['to'](_0x3f0571)[_0xe73a('0x8')](_0x1c9e2a,_0x369a30);}function getCustomFields(_0x3173b8,_0x4ab4a8){var _0x43b498={};if(_0x3173b8[_0xe73a('0x9')]>0x0){_[_0xe73a('0xa')](_0x3173b8,function(_0x4fa5d7){if(_0x4fa5d7[_0xe73a('0xb')]===_0xe73a('0xc')&&_0x4fa5d7[_0xe73a('0xd')]){_0x43b498[_0x4fa5d7[_0xe73a('0xd')]]=_0x4fa5d7[_0xe73a('0xe')][_0xe73a('0xf')]();}else if(_0x4fa5d7[_0xe73a('0xb')]===_0xe73a('0x10')&&_0x4fa5d7[_0xe73a('0x11')]&&_0x4fa5d7[_0xe73a('0xd')]&&_0x4ab4a8[_0x4fa5d7['variableName']]){_0x43b498[_0x4fa5d7['idField']]=_0x4ab4a8[_0x4fa5d7[_0xe73a('0x11')]][_0xe73a('0xf')]();}else if(_0x4fa5d7[_0xe73a('0xb')]===_0xe73a('0x12')&&_0x4fa5d7[_0xe73a('0x13')]&&_0x4fa5d7[_0xe73a('0x13')][_0xe73a('0x14')]&&_0x4fa5d7[_0xe73a('0xd')]&&_0x4ab4a8[_0x4fa5d7[_0xe73a('0x13')][_0xe73a('0x14')][_0xe73a('0x15')]()]){_0x43b498[_0x4fa5d7[_0xe73a('0xd')]]=_0x4ab4a8[_0x4fa5d7[_0xe73a('0x13')][_0xe73a('0x14')][_0xe73a('0x15')]()][_0xe73a('0xf')]();}});}return _0x43b498;}function createTicket(_0x4b8ce0,_0x4b6403,_0xe552ac,_0x43c467,_0x532565,_0x4e02b1,_0x24644f){logger[_0xe73a('0x16')](_0xe73a('0x17'));var _0x5570c2=_[_0xe73a('0x18')]({'parent_id':'','assigned_user_id':_0x4b6403['id'],'ticketpriorities':_0xe73a('0x19'),'ticketstatus':_0xe73a('0x1a'),'ticket_title':intUtil[_0xe73a('0x1b')](_0x43c467[_0xe73a('0x1c')],_0x532565,'\x20'),'description':intUtil[_0xe73a('0x1b')](_0x43c467['Descriptions'],_0x532565,'\x0a'),'contact_id':_0xe552ac['id']},getCustomFields(_0x4e02b1,_0x532565));var _0x515d42={'method':_0xe73a('0x1d'),'uri':util[_0xe73a('0x1e')]('%s/webservice.php',_0x4b8ce0[_0xe73a('0x1f')]),'form':{'operation':_0xe73a('0x20'),'username':_0xe73a('0x21'),'sessionName':_0x24644f[_0xe73a('0x22')],'elementType':'HelpDesk','element':JSON[_0xe73a('0x23')](_0x5570c2)},'json':!![]};return request(_0x515d42)[_0xe73a('0x24')](function(_0x5786e5){if(_0x5786e5[_0xe73a('0x25')]){return BPromise[_0xe73a('0x26')]({'id':_0x5786e5[_0xe73a('0x27')]['id']});}else{throw new Error(util[_0xe73a('0x1e')](_0xe73a('0x28'),JSON[_0xe73a('0x23')](_0x5786e5[_0xe73a('0x29')])));}})['catch'](function(_0x1ec1b8){var _0x4c3017=req[_0xe73a('0x2a')][_0xe73a('0x2b')]?0x1f4:_0x1ec1b8['statusCode']||0x1f4;logger[_0xe73a('0x29')](_0xe73a('0x2c'),_0xe73a('0x2d'),_0x4c3017,JSON['stringify'](_0x1ec1b8));});}function getUser(_0x180def,_0x4351f7,_0x50fdbb){logger[_0xe73a('0x16')](_0xe73a('0x2e'),_0x4351f7);return request({'method':_0xe73a('0x2f'),'uri':util[_0xe73a('0x1e')](_0xe73a('0x30'),_0x180def['remoteUri']),'qs':{'operation':'query','username':_0xe73a('0x21'),'sessionName':_0x50fdbb[_0xe73a('0x22')],'query':util[_0xe73a('0x1e')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x4351f7)},'json':!![]})['then'](function(_0xd1bf0a){if(_0xd1bf0a[_0xe73a('0x25')]&&_0xd1bf0a[_0xe73a('0x27')][_0xe73a('0x9')]){logger['info'](_0xe73a('0x31'));return BPromise[_0xe73a('0x26')]({'id':_0xd1bf0a['result'][0x0]['id'],'email':_0xd1bf0a[_0xe73a('0x27')][0x0][_0xe73a('0x32')],'name':_0xd1bf0a[_0xe73a('0x27')][0x0][_0xe73a('0x33')]+'\x20'+_0xd1bf0a[_0xe73a('0x27')][_0xe73a('0x34')]});}else{logger[_0xe73a('0x16')](_0xe73a('0x35'));return BPromise[_0xe73a('0x26')]({'id':_0x50fdbb[_0xe73a('0x36')],'email':_0x180def[_0xe73a('0x37')],'name':_0xe73a('0x21')});}})[_0xe73a('0x38')](function(_0x225f8a){var _0x5c424a=req['query'][_0xe73a('0x2b')]?0x1f4:_0x225f8a[_0xe73a('0x39')]||0x1f4;logger[_0xe73a('0x29')](_0xe73a('0x2c'),'getUser',_0x5c424a,JSON['stringify'](_0x225f8a));});}function getEndUser(_0x1848e4,_0xa621ad,_0x4cfcf7,_0xe40a74){logger[_0xe73a('0x16')](_0xe73a('0x3a'),_0x4cfcf7);return request({'method':_0xe73a('0x2f'),'uri':util[_0xe73a('0x1e')](_0xe73a('0x30'),_0x1848e4[_0xe73a('0x1f')]),'qs':{'operation':_0xe73a('0x2a'),'username':'admin','sessionName':_0xe40a74[_0xe73a('0x22')],'query':util[_0xe73a('0x1e')](_0xe73a('0x3b'),_0x4cfcf7,_0x4cfcf7,_0x4cfcf7,_0x4cfcf7,_0x4cfcf7)},'json':!![]})[_0xe73a('0x24')](function(_0xb9b14a){if(_0xb9b14a[_0xe73a('0x25')]&&_0xb9b14a['result']['length']){logger['info'](_0xe73a('0x3c'));return BPromise['resolve']({'id':_0xb9b14a[_0xe73a('0x27')][0x0]['id'],'name':_0xb9b14a[_0xe73a('0x27')][0x0][_0xe73a('0x3d')]+'\x20'+_0xb9b14a[_0xe73a('0x27')][0x0][_0xe73a('0x3e')],'phone':_0x4cfcf7});}else{logger['info'](_0xe73a('0x3f'));return request({'method':'POST','uri':util[_0xe73a('0x1e')]('%s/webservice.php',_0x1848e4['remoteUri']),'form':{'operation':_0xe73a('0x20'),'sessionName':_0xe40a74[_0xe73a('0x22')],'elementType':_0xe73a('0x40'),'element':JSON[_0xe73a('0x23')]({'lastname':_0xa621ad,'phone':_0x4cfcf7,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x26ca1e){logger[_0xe73a('0x16')](_0xe73a('0x41'));return BPromise[_0xe73a('0x26')]({'id':_0x26ca1e['result']['id'],'name':_0x26ca1e['result'][_0xe73a('0x3e')],'phone':_0x26ca1e['result'][_0xe73a('0x42')]});})[_0xe73a('0x38')](function(_0x506bf1){var _0x1dd119=req[_0xe73a('0x2a')]['test']?0x1f4:_0x506bf1[_0xe73a('0x39')]||0x1f4;logger[_0xe73a('0x29')](_0xe73a('0x2c'),_0xe73a('0x43'),_0x1dd119,JSON[_0xe73a('0x23')](_0x506bf1));});}});}function getConnection(_0x551728){var _0x228b9a=_0x551728['username'];var _0x1f5626=_0x551728[_0xe73a('0x44')];return request({'method':_0xe73a('0x2f'),'uri':util[_0xe73a('0x1e')](_0xe73a('0x30'),_0x551728['remoteUri']),'qs':{'operation':_0xe73a('0x45'),'username':_0x228b9a},'json':!![]})[_0xe73a('0x24')](function(_0x4a5d0a){if(_0x4a5d0a[_0xe73a('0x25')]){return request({'method':_0xe73a('0x1d'),'uri':util[_0xe73a('0x1e')](_0xe73a('0x30'),_0x551728['remoteUri']),'form':{'operation':_0xe73a('0x46'),'username':'admin','accessKey':md5(_0x4a5d0a[_0xe73a('0x27')][_0xe73a('0x47')]+_0x1f5626)},'json':!![]});}})[_0xe73a('0x24')](function(_0x4e595b){if(_0x4e595b[_0xe73a('0x25')]){return BPromise[_0xe73a('0x26')](_0x4e595b['result']);}else{throw new Error(util[_0xe73a('0x1e')]('Account\x20%d\x20is\x20not\x20valid',_0x551728['id']));}})['catch'](function(_0x4067dd){var _0x3433c3=req[_0xe73a('0x2a')][_0xe73a('0x2b')]?0x1f4:_0x4067dd[_0xe73a('0x39')]||0x1f4;logger[_0xe73a('0x29')](_0xe73a('0x2c'),_0xe73a('0x48'),_0x3433c3,JSON[_0xe73a('0x23')](_0x4067dd));});}function request(_0x2c7c53){logger['info'](_0xe73a('0x49'),JSON[_0xe73a('0x23')](_0x2c7c53));return rp(_0x2c7c53);}exports['queue']=function(_0x243bd7,_0x81a72f,_0x2124b5,_0x1afc1f,_0x1f1d26,_0x2479f0){var _0x4d44e1,_0x5a97ae,_0x47c8bd,_0x3cf49e;_0x2479f0[_0xe73a('0x1f')]=intUtil['stripTrailingSlash'](_0x2479f0[_0xe73a('0x1f')]);if(_0x1f1d26&&_0x1f1d26[_0xe73a('0x4a')]){logger[_0xe73a('0x16')](_0xe73a('0x4b'),_0xe73a('0x4c'));_0x81a72f[_0xe73a('0x4d')]=util[_0xe73a('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2479f0[_0xe73a('0x4e')],_0x81a72f[_0xe73a('0x4f')],md5(_0x81a72f[_0xe73a('0x4f')]));}else{_0x81a72f[_0xe73a('0x4d')]='';}return getConnection(_0x2479f0)[_0xe73a('0x24')](function(_0x470899){_0x3cf49e=_0x470899;return getUser(_0x2479f0,_0x1afc1f?_0x1afc1f[_0xe73a('0x50')]:'',_0x3cf49e);})[_0xe73a('0x24')](function(_0x1b6e35){_0x4d44e1=_0x1b6e35;logger[_0xe73a('0x16')](_0xe73a('0x51'),_0x4d44e1['id']);return getEndUser(_0x2479f0,_0x81a72f['calleridname'],_0x81a72f[_0xe73a('0x52')],_0x3cf49e);})[_0xe73a('0x24')](function(_0x2640d4){_0x5a97ae=_0x2640d4;logger['info']('The\x20Enduser\x20ID\x20is:',_0x5a97ae['id']);return createTicket(_0x2479f0,_0x4d44e1,_0x5a97ae,_0x2124b5,_0x81a72f,_0x2124b5[_0xe73a('0x53')],_0x3cf49e);})['then'](function(_0x4d15a4){_0x47c8bd=_0x4d15a4;logger[_0xe73a('0x16')]('Ticket\x20created!');logger[_0xe73a('0x16')](_0xe73a('0x54'),_0x47c8bd['id']);var _0x132fe9=util['format'](_0xe73a('0x55'),_0x2479f0['remoteUri'],_[_0xe73a('0x56')](_0x47c8bd['id'],'x')[0x1]);logger[_0xe73a('0x16')](_0xe73a('0x4b'),_0xe73a('0x57'));emit(util[_0xe73a('0x1e')](_0xe73a('0x58'),_0x1afc1f['name']),_0xe73a('0x59'),{'uri':_0x132fe9});})[_0xe73a('0x38')](function(_0x2b46ea){logger[_0xe73a('0x29')]('[QUEUE]',JSON[_0xe73a('0x23')](_0x2b46ea));});};exports[_0xe73a('0x5a')]=function(_0x2e9671,_0x1650a9,_0x9aacae,_0x51c3,_0x22f7ab,_0x157727,_0x265a01){var _0x4ed111,_0x526437,_0x29a8eb,_0x141cd5;_0x157727['remoteUri']=intUtil['stripTrailingSlash'](_0x157727[_0xe73a('0x1f')]);_0x157727['serverUrl']=intUtil[_0xe73a('0x5b')](_0x157727['serverUrl']);if(_0x265a01&&_0x265a01[_0xe73a('0x5c')]&&_0x265a01[_0xe73a('0x5c')]!==_0xe73a('0x5d')){logger[_0xe73a('0x16')]('[OUTBOUND]',_0xe73a('0x4c'));_0x1650a9[_0xe73a('0x4d')]=util[_0xe73a('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x157727[_0xe73a('0x4e')],_0x1650a9[_0xe73a('0x4f')],md5(_0x1650a9['uniqueid']));}return getConnection(_0x157727)['then'](function(_0x56b7ce){_0x141cd5=_0x56b7ce;return getUser(_0x157727,_0x51c3?_0x51c3[_0xe73a('0x50')]:'',_0x141cd5);})['then'](function(_0x427efa){_0x4ed111=_0x427efa;logger[_0xe73a('0x16')]('The\x20User\x20ID\x20is:',_0x4ed111['id']);return getEndUser(_0x157727,_0x1650a9[_0xe73a('0x5e')],_0x1650a9[_0xe73a('0x5f')],_0x141cd5);})[_0xe73a('0x24')](function(_0x260ff4){_0x526437=_0x260ff4;logger[_0xe73a('0x16')](_0xe73a('0x60'),_0x526437['id']);return createTicket(_0x157727,_0x4ed111,_0x526437,_0x9aacae,_0x1650a9,_0x9aacae[_0xe73a('0x53')],_0x141cd5);})['then'](function(_0x38b88d){_0x29a8eb=_0x38b88d;logger[_0xe73a('0x16')](_0xe73a('0x61'));logger[_0xe73a('0x16')](_0xe73a('0x54'),_0x29a8eb['id']);var _0x1b3f90=util['format'](_0xe73a('0x55'),_0x157727['remoteUri'],_[_0xe73a('0x56')](_0x29a8eb['id'],'x')[0x1]);logger['info'](_0xe73a('0x62'),_0xe73a('0x57'));emit(util[_0xe73a('0x1e')](_0xe73a('0x58'),_0x51c3['name']),_0xe73a('0x59'),{'uri':_0x1b3f90});})[_0xe73a('0x38')](function(_0x24851b){logger[_0xe73a('0x29')]('[OUTBOUND]',JSON[_0xe73a('0x23')](_0x24851b));});};exports['abandoned']=function(_0x31a993,_0x1487ce,_0x1d85f8,_0x230dec,_0x571a41,_0x4fa482){var _0x16556c,_0x1451ba,_0x4dc134,_0x205df0;_0x4fa482[_0xe73a('0x1f')]=intUtil[_0xe73a('0x5b')](_0x4fa482[_0xe73a('0x1f')]);_0x4fa482[_0xe73a('0x4e')]=intUtil[_0xe73a('0x5b')](_0x4fa482[_0xe73a('0x4e')]);if(_0x571a41&&_0x571a41[_0xe73a('0x4a')]){logger[_0xe73a('0x16')]('[ABANDONED]',_0xe73a('0x4c'));_0x1487ce[_0xe73a('0x4d')]=util[_0xe73a('0x1e')](_0xe73a('0x63'),_0x4fa482[_0xe73a('0x4e')],_0x1487ce[_0xe73a('0x4f')],md5(_0x1487ce[_0xe73a('0x4f')]));}else{_0x1487ce[_0xe73a('0x4d')]='';}return getConnection(_0x4fa482)[_0xe73a('0x24')](function(_0x3b81e6){_0x205df0=_0x3b81e6;return getUser(_0x4fa482,_0x230dec?_0x230dec['email']:'',_0x205df0);})[_0xe73a('0x24')](function(_0x2d6116){_0x16556c=_0x2d6116;logger[_0xe73a('0x16')](_0xe73a('0x51'),_0x16556c['id']);return getEndUser(_0x4fa482,_0x1487ce['calleridname'],_0x1487ce[_0xe73a('0x52')],_0x205df0);})['then'](function(_0x243c59){_0x1451ba=_0x243c59;logger[_0xe73a('0x16')](_0xe73a('0x60'),_0x1451ba['id']);return createTicket(_0x4fa482,_0x16556c,_0x1451ba,_0x1d85f8,_0x1487ce,_0x1d85f8[_0xe73a('0x53')],_0x205df0);})[_0xe73a('0x24')](function(_0x162025){_0x4dc134=_0x162025;logger[_0xe73a('0x16')](_0xe73a('0x61'));logger[_0xe73a('0x16')]('The\x20Ticket\x20ID\x20is:',_0x4dc134['id']);})['catch'](function(_0x5176f0){logger[_0xe73a('0x29')]('[ABANDONED]',JSON['stringify'](_0x5176f0));});};
\ No newline at end of file
+var _0x13b9=['firstname','lastname','POST','Contacts','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','destcalleridname','[OUTBOUND]','abandoned','monitor_format','[ABANDONED]','bluebird','md5','util','./util','../../../../config/logger','vTiger','socket.io-emitter','emit','forEach','type','string','content','toString','variable','variableName','customVariable','Variable','idField','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Open','getString','Subjects','Descriptions','format','remoteUri','create','admin','sessionName','HelpDesk','stringify','resolve','error','catch','query','test','statusCode','createTicket','Getting\x20agent\x20with\x20email','GET','then','success','result','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','[vTiger],\x20%s,\x20%s,\x20%s','%s/webservice.php','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!'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x13b9,0x152));var _0x913b=function(_0x331fee,_0x230544){_0x331fee=_0x331fee-0x0;var _0x5f1f09=_0x13b9[_0x331fee];return _0x5f1f09;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x913b('0x0'));var md5=require(_0x913b('0x1'));var util=require(_0x913b('0x2'));var intUtil=require(_0x913b('0x3'));var logger=require(_0x913b('0x4'))(_0x913b('0x5'));var io=require(_0x913b('0x6'))({'host':'localhost','port':0x18eb});function emit(_0x13bcc8,_0x4d9b93,_0x5701c4){io['to'](_0x13bcc8)[_0x913b('0x7')](_0x4d9b93,_0x5701c4);}function getCustomFields(_0x19c6ac,_0x3c13a5){var _0xf0c074={};if(_0x19c6ac['length']>0x0){_[_0x913b('0x8')](_0x19c6ac,function(_0x2bc588){if(_0x2bc588[_0x913b('0x9')]===_0x913b('0xa')&&_0x2bc588['idField']){_0xf0c074[_0x2bc588['idField']]=_0x2bc588[_0x913b('0xb')][_0x913b('0xc')]();}else if(_0x2bc588[_0x913b('0x9')]===_0x913b('0xd')&&_0x2bc588[_0x913b('0xe')]&&_0x2bc588['idField']&&_0x3c13a5[_0x2bc588[_0x913b('0xe')]]){_0xf0c074[_0x2bc588['idField']]=_0x3c13a5[_0x2bc588[_0x913b('0xe')]][_0x913b('0xc')]();}else if(_0x2bc588[_0x913b('0x9')]===_0x913b('0xf')&&_0x2bc588['Variable']&&_0x2bc588[_0x913b('0x10')]['name']&&_0x2bc588[_0x913b('0x11')]&&_0x3c13a5[_0x2bc588[_0x913b('0x10')][_0x913b('0x12')][_0x913b('0x13')]()]){_0xf0c074[_0x2bc588[_0x913b('0x11')]]=_0x3c13a5[_0x2bc588[_0x913b('0x10')]['name'][_0x913b('0x13')]()]['toString']();}});}return _0xf0c074;}function createTicket(_0x10f583,_0x1ee610,_0x2971b2,_0xe4970b,_0x53beff,_0x42e6e9,_0x16670d){logger[_0x913b('0x14')](_0x913b('0x15'));var _0x4de87e=_[_0x913b('0x16')]({'parent_id':'','assigned_user_id':_0x1ee610['id'],'ticketpriorities':'Normal','ticketstatus':_0x913b('0x17'),'ticket_title':intUtil[_0x913b('0x18')](_0xe4970b[_0x913b('0x19')],_0x53beff,'\x20'),'description':intUtil['getString'](_0xe4970b[_0x913b('0x1a')],_0x53beff,'\x0a'),'contact_id':_0x2971b2['id']},getCustomFields(_0x42e6e9,_0x53beff));var _0x1b2138={'method':'POST','uri':util[_0x913b('0x1b')]('%s/webservice.php',_0x10f583[_0x913b('0x1c')]),'form':{'operation':_0x913b('0x1d'),'username':_0x913b('0x1e'),'sessionName':_0x16670d[_0x913b('0x1f')],'elementType':_0x913b('0x20'),'element':JSON[_0x913b('0x21')](_0x4de87e)},'json':!![]};return request(_0x1b2138)['then'](function(_0x4ccebc){if(_0x4ccebc['success']){return BPromise[_0x913b('0x22')]({'id':_0x4ccebc['result']['id']});}else{throw new Error(util[_0x913b('0x1b')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x913b('0x21')](_0x4ccebc[_0x913b('0x23')])));}})[_0x913b('0x24')](function(_0x5036a5){var _0x2113f2=req[_0x913b('0x25')][_0x913b('0x26')]?0x1f4:_0x5036a5[_0x913b('0x27')]||0x1f4;logger[_0x913b('0x23')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x913b('0x28'),_0x2113f2,JSON['stringify'](_0x5036a5));});}function getUser(_0x517825,_0x5ccd35,_0x2ffab9){logger['info'](_0x913b('0x29'),_0x5ccd35);return request({'method':_0x913b('0x2a'),'uri':util['format']('%s/webservice.php',_0x517825[_0x913b('0x1c')]),'qs':{'operation':'query','username':_0x913b('0x1e'),'sessionName':_0x2ffab9[_0x913b('0x1f')],'query':util[_0x913b('0x1b')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x5ccd35)},'json':!![]})[_0x913b('0x2b')](function(_0x59d7fc){if(_0x59d7fc[_0x913b('0x2c')]&&_0x59d7fc[_0x913b('0x2d')][_0x913b('0x2e')]){logger['info'](_0x913b('0x2f'));return BPromise[_0x913b('0x22')]({'id':_0x59d7fc['result'][0x0]['id'],'email':_0x59d7fc['result'][0x0][_0x913b('0x30')],'name':_0x59d7fc[_0x913b('0x2d')][0x0][_0x913b('0x31')]+'\x20'+_0x59d7fc['result'][_0x913b('0x32')]});}else{logger['info'](_0x913b('0x33'));return BPromise[_0x913b('0x22')]({'id':_0x2ffab9[_0x913b('0x34')],'email':_0x517825[_0x913b('0x35')],'name':_0x913b('0x1e')});}})['catch'](function(_0x2e52f0){var _0x3aac92=req['query'][_0x913b('0x26')]?0x1f4:_0x2e52f0['statusCode']||0x1f4;logger['error'](_0x913b('0x36'),'getUser',_0x3aac92,JSON[_0x913b('0x21')](_0x2e52f0));});}function getEndUser(_0x59e7af,_0x3427a5,_0x12c838,_0x34b21d){logger[_0x913b('0x14')]('Searching\x20end\x20user\x20with\x20phone',_0x12c838);return request({'method':'GET','uri':util[_0x913b('0x1b')](_0x913b('0x37'),_0x59e7af['remoteUri']),'qs':{'operation':_0x913b('0x25'),'username':_0x913b('0x1e'),'sessionName':_0x34b21d[_0x913b('0x1f')],'query':util[_0x913b('0x1b')](_0x913b('0x38'),_0x12c838,_0x12c838,_0x12c838,_0x12c838,_0x12c838)},'json':!![]})[_0x913b('0x2b')](function(_0x266e87){if(_0x266e87[_0x913b('0x2c')]&&_0x266e87[_0x913b('0x2d')][_0x913b('0x2e')]){logger[_0x913b('0x14')](_0x913b('0x39'));return BPromise[_0x913b('0x22')]({'id':_0x266e87[_0x913b('0x2d')][0x0]['id'],'name':_0x266e87[_0x913b('0x2d')][0x0][_0x913b('0x3a')]+'\x20'+_0x266e87[_0x913b('0x2d')][0x0][_0x913b('0x3b')],'phone':_0x12c838});}else{logger[_0x913b('0x14')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0x913b('0x3c'),'uri':util[_0x913b('0x1b')]('%s/webservice.php',_0x59e7af[_0x913b('0x1c')]),'form':{'operation':_0x913b('0x1d'),'sessionName':_0x34b21d[_0x913b('0x1f')],'elementType':_0x913b('0x3d'),'element':JSON[_0x913b('0x21')]({'lastname':_0x3427a5,'phone':_0x12c838,'assigned_user_id':'\x20'})},'json':!![]})[_0x913b('0x2b')](function(_0x76577c){logger['info']('Enduser\x20created.');return BPromise[_0x913b('0x22')]({'id':_0x76577c[_0x913b('0x2d')]['id'],'name':_0x76577c[_0x913b('0x2d')][_0x913b('0x3b')],'phone':_0x76577c['result'][_0x913b('0x3e')]});})[_0x913b('0x24')](function(_0x349088){var _0x49979d=req[_0x913b('0x25')][_0x913b('0x26')]?0x1f4:_0x349088[_0x913b('0x27')]||0x1f4;logger[_0x913b('0x23')](_0x913b('0x36'),_0x913b('0x3f'),_0x49979d,JSON[_0x913b('0x21')](_0x349088));});}});}function getConnection(_0x186b86){var _0x28a419=_0x186b86[_0x913b('0x35')];var _0x5dbf48=_0x186b86[_0x913b('0x40')];return request({'method':_0x913b('0x2a'),'uri':util[_0x913b('0x1b')](_0x913b('0x37'),_0x186b86['remoteUri']),'qs':{'operation':_0x913b('0x41'),'username':_0x28a419},'json':!![]})[_0x913b('0x2b')](function(_0x1e6c2d){if(_0x1e6c2d[_0x913b('0x2c')]){return request({'method':_0x913b('0x3c'),'uri':util[_0x913b('0x1b')](_0x913b('0x37'),_0x186b86['remoteUri']),'form':{'operation':_0x913b('0x42'),'username':'admin','accessKey':md5(_0x1e6c2d[_0x913b('0x2d')][_0x913b('0x43')]+_0x5dbf48)},'json':!![]});}})[_0x913b('0x2b')](function(_0x96fe51){if(_0x96fe51[_0x913b('0x2c')]){return BPromise['resolve'](_0x96fe51[_0x913b('0x2d')]);}else{throw new Error(util['format'](_0x913b('0x44'),_0x186b86['id']));}})['catch'](function(_0x215bf5){var _0xfe34d0=req[_0x913b('0x25')][_0x913b('0x26')]?0x1f4:_0x215bf5[_0x913b('0x27')]||0x1f4;logger['error'](_0x913b('0x36'),_0x913b('0x45'),_0xfe34d0,JSON[_0x913b('0x21')](_0x215bf5));});}function request(_0x29fcbc){logger[_0x913b('0x14')](_0x913b('0x46'),JSON[_0x913b('0x21')](_0x29fcbc));return rp(_0x29fcbc);}exports[_0x913b('0x47')]=function(_0xa9eefd,_0x1ab6ad,_0x4937be,_0x52499b,_0xd47578,_0x205539){var _0x369d6d,_0xef3200,_0x4a1785,_0x4e5a0b;_0x205539[_0x913b('0x1c')]=intUtil[_0x913b('0x48')](_0x205539[_0x913b('0x1c')]);if(_0xd47578&&_0xd47578['monitor_format']){logger[_0x913b('0x14')](_0x913b('0x49'),_0x913b('0x4a'));_0x1ab6ad['recordingURL']=util[_0x913b('0x1b')](_0x913b('0x4b'),_0x205539[_0x913b('0x4c')],_0x1ab6ad[_0x913b('0x4d')],md5(_0x1ab6ad[_0x913b('0x4d')]));}else{_0x1ab6ad[_0x913b('0x4e')]='';}return getConnection(_0x205539)[_0x913b('0x2b')](function(_0x220cb0){_0x4e5a0b=_0x220cb0;return getUser(_0x205539,_0x52499b?_0x52499b[_0x913b('0x4f')]:'',_0x4e5a0b);})[_0x913b('0x2b')](function(_0x6e359f){_0x369d6d=_0x6e359f;logger['info'](_0x913b('0x50'),_0x369d6d['id']);return getEndUser(_0x205539,_0x1ab6ad[_0x913b('0x51')],_0x1ab6ad[_0x913b('0x52')],_0x4e5a0b);})[_0x913b('0x2b')](function(_0x56fba2){_0xef3200=_0x56fba2;logger[_0x913b('0x14')](_0x913b('0x53'),_0xef3200['id']);return createTicket(_0x205539,_0x369d6d,_0xef3200,_0x4937be,_0x1ab6ad,_0x4937be[_0x913b('0x54')],_0x4e5a0b);})['then'](function(_0x40285b){_0x4a1785=_0x40285b;logger['info'](_0x913b('0x55'));logger[_0x913b('0x14')](_0x913b('0x56'),_0x4a1785['id']);var _0xd10ca6=util['format'](_0x913b('0x57'),_0x205539[_0x913b('0x1c')],_[_0x913b('0x58')](_0x4a1785['id'],'x')[0x1]);logger['info'](_0x913b('0x49'),_0x913b('0x59'));emit(util[_0x913b('0x1b')](_0x913b('0x5a'),_0x52499b[_0x913b('0x12')]),'trigger:browser:url',{'uri':_0xd10ca6});})[_0x913b('0x24')](function(_0x498260){logger['error'](_0x913b('0x49'),JSON[_0x913b('0x21')](_0x498260));});};exports[_0x913b('0x5b')]=function(_0x17220b,_0x10451b,_0x46117d,_0x432e2f,_0x3f590c,_0x3c504a,_0xdd419e){var _0x547cde,_0x3ed041,_0x42bd3b,_0x37d570;_0x3c504a['remoteUri']=intUtil[_0x913b('0x48')](_0x3c504a[_0x913b('0x1c')]);_0x3c504a[_0x913b('0x4c')]=intUtil[_0x913b('0x48')](_0x3c504a[_0x913b('0x4c')]);if(_0xdd419e&&_0xdd419e[_0x913b('0x5c')]&&_0xdd419e['recordingFormat']!==_0x913b('0x5d')){logger['info']('[OUTBOUND]',_0x913b('0x4a'));_0x10451b[_0x913b('0x4e')]=util[_0x913b('0x1b')](_0x913b('0x4b'),_0x3c504a['serverUrl'],_0x10451b[_0x913b('0x4d')],md5(_0x10451b[_0x913b('0x4d')]));}return getConnection(_0x3c504a)[_0x913b('0x2b')](function(_0x15fdf1){_0x37d570=_0x15fdf1;return getUser(_0x3c504a,_0x432e2f?_0x432e2f['email']:'',_0x37d570);})[_0x913b('0x2b')](function(_0x56e99b){_0x547cde=_0x56e99b;logger[_0x913b('0x14')](_0x913b('0x50'),_0x547cde['id']);return getEndUser(_0x3c504a,_0x10451b[_0x913b('0x5e')],_0x10451b['destcalleridnum'],_0x37d570);})[_0x913b('0x2b')](function(_0x498e1d){_0x3ed041=_0x498e1d;logger[_0x913b('0x14')](_0x913b('0x53'),_0x3ed041['id']);return createTicket(_0x3c504a,_0x547cde,_0x3ed041,_0x46117d,_0x10451b,_0x46117d[_0x913b('0x54')],_0x37d570);})[_0x913b('0x2b')](function(_0x3d3f8c){_0x42bd3b=_0x3d3f8c;logger[_0x913b('0x14')](_0x913b('0x55'));logger[_0x913b('0x14')](_0x913b('0x56'),_0x42bd3b['id']);var _0x311b96=util[_0x913b('0x1b')](_0x913b('0x57'),_0x3c504a['remoteUri'],_['split'](_0x42bd3b['id'],'x')[0x1]);logger[_0x913b('0x14')](_0x913b('0x5f'),_0x913b('0x59'));emit(util['format'](_0x913b('0x5a'),_0x432e2f['name']),'trigger:browser:url',{'uri':_0x311b96});})[_0x913b('0x24')](function(_0x267f2f){logger['error'](_0x913b('0x5f'),JSON['stringify'](_0x267f2f));});};exports[_0x913b('0x60')]=function(_0xaf20ba,_0x3b641d,_0x28dc50,_0x1ec8ad,_0x22f6ca,_0x2b95d6){var _0x4e3137,_0x504e89,_0x27e5b2,_0x20d381;_0x2b95d6[_0x913b('0x1c')]=intUtil[_0x913b('0x48')](_0x2b95d6[_0x913b('0x1c')]);_0x2b95d6[_0x913b('0x4c')]=intUtil[_0x913b('0x48')](_0x2b95d6[_0x913b('0x4c')]);if(_0x22f6ca&&_0x22f6ca[_0x913b('0x61')]){logger[_0x913b('0x14')](_0x913b('0x62'),'Recording\x20is\x20enabled!');_0x3b641d[_0x913b('0x4e')]=util[_0x913b('0x1b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2b95d6[_0x913b('0x4c')],_0x3b641d[_0x913b('0x4d')],md5(_0x3b641d[_0x913b('0x4d')]));}else{_0x3b641d['recordingURL']='';}return getConnection(_0x2b95d6)[_0x913b('0x2b')](function(_0x5a1918){_0x20d381=_0x5a1918;return getUser(_0x2b95d6,_0x1ec8ad?_0x1ec8ad[_0x913b('0x4f')]:'',_0x20d381);})[_0x913b('0x2b')](function(_0x575074){_0x4e3137=_0x575074;logger['info']('The\x20User\x20ID\x20is:',_0x4e3137['id']);return getEndUser(_0x2b95d6,_0x3b641d[_0x913b('0x51')],_0x3b641d[_0x913b('0x52')],_0x20d381);})['then'](function(_0x26fa8a){_0x504e89=_0x26fa8a;logger[_0x913b('0x14')](_0x913b('0x53'),_0x504e89['id']);return createTicket(_0x2b95d6,_0x4e3137,_0x504e89,_0x28dc50,_0x3b641d,_0x28dc50[_0x913b('0x54')],_0x20d381);})[_0x913b('0x2b')](function(_0x33c3e3){_0x27e5b2=_0x33c3e3;logger['info']('Ticket\x20created!');logger[_0x913b('0x14')](_0x913b('0x56'),_0x27e5b2['id']);})[_0x913b('0x24')](function(_0xad7467){logger[_0x913b('0x23')](_0x913b('0x62'),JSON[_0x913b('0x21')](_0xad7467));});};
\ No newline at end of file
index c4cc523..655f2e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16d1=['stringify','GET','length','map','forEach','type','nameField','customField','string','idField','custom_fields','content','variable','variableName','customVariable','Variable','toLowerCase','push','queue','serverUrl','stripTrailingSlash','[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','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','abandoned','monitor_format','[ABANDONED]','lodash','request-promise','md5','util','./util','zendesk','localhost','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Fields','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','then','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','count','results','end-user','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','authType','%s:%s','username','%s/token:%s','token','Basic\x20%s','toString','[HTTP]'];(function(_0x394d91,_0x3728d9){var _0x33bc90=function(_0x3e990c){while(--_0x3e990c){_0x394d91['push'](_0x394d91['shift']());}};_0x33bc90(++_0x3728d9);}(_0x16d1,0xf7));var _0x116d=function(_0x5ba4b0,_0x539d6a){_0x5ba4b0=_0x5ba4b0-0x0;var _0x41ab05=_0x16d1[_0x5ba4b0];return _0x41ab05;};'use strict';var _=require(_0x116d('0x0'));var rp=require(_0x116d('0x1'));var md5=require(_0x116d('0x2'));var util=require(_0x116d('0x3'));var intUtil=require(_0x116d('0x4'));var logger=require('../../../../config/logger')(_0x116d('0x5'));var io=require('socket.io-emitter')({'host':_0x116d('0x6'),'port':0x18eb});function emit(_0x2a6178,_0x3faf10,_0x54f70f){io['to'](_0x2a6178)[_0x116d('0x7')](_0x3faf10,_0x54f70f);}var headers={'Content-Type':_0x116d('0x8'),'Accept':_0x116d('0x8')};function getTicket(_0x560653,_0x34c27a,_0x2e3922,_0x1f46ee,_0x2a918b){logger[_0x116d('0x9')](_0x116d('0xa'));return request({'uri':util[_0x116d('0xb')](_0x116d('0xc'),_0x560653[_0x116d('0xd')]),'method':_0x116d('0xe'),'body':{'ticket':_[_0x116d('0xf')]({'requester_id':_0x2e3922['id'],'submitter_id':_0x34c27a?_0x34c27a['id']:undefined,'assignee_id':_0x34c27a?_0x34c27a['id']:undefined,'tags':getTags(_0x1f46ee[_0x116d('0x10')],_0x116d('0x11')),'subject':intUtil[_0x116d('0x12')](_0x1f46ee[_0x116d('0x13')],_0x2a918b,'\x20'),'description':intUtil['getString'](_0x1f46ee['Descriptions'],_0x2a918b,'\x0a'),'comment':{'public':![],'body':intUtil[_0x116d('0x12')](_0x1f46ee['Descriptions'],_0x2a918b,'\x0a')}},getCustomFields(_0x1f46ee[_0x116d('0x14')],_0x2a918b))}})['then'](function(_0x52000f){logger[_0x116d('0x9')](_0x116d('0x15'));return _0x52000f[_0x116d('0x16')];});}function getUser(_0x239502,_0x37fa48){logger[_0x116d('0x9')](_0x116d('0x17'),_0x37fa48);return request({'uri':util['format'](_0x116d('0x18'),_0x239502['remoteUri']),'qs':{'query':util[_0x116d('0xb')](_0x116d('0x19'),_0x37fa48)}})[_0x116d('0x1a')](function(_0x189fd4){if(_0x189fd4['count']){logger[_0x116d('0x9')](_0x116d('0x1b'));return _[_0x116d('0x1c')](_0x189fd4['results'],{'email':_0x37fa48,'role':_0x116d('0x1d')});}else{logger['info'](_0x116d('0x1e'));return request({'uri':util[_0x116d('0xb')]('%s/users/me.json',_0x239502['remoteUri'])})[_0x116d('0x1a')](function(_0x2008cd){logger[_0x116d('0x9')](_0x116d('0x1f'));return _0x2008cd[_0x116d('0x20')];});}});}function getEndUser(_0x5aaf80,_0x229a57,_0x29e57b){logger[_0x116d('0x9')]('Searching\x20enduser\x20with\x20phone',_0x29e57b);return request({'uri':util[_0x116d('0xb')](_0x116d('0x18'),_0x5aaf80[_0x116d('0xd')]),'qs':{'query':util['format'](_0x116d('0x21'),_0x29e57b)}})['then'](function(_0x4b7268){if(_0x4b7268[_0x116d('0x22')]){logger['info']('Enduser\x20found!');return _[_0x116d('0x1c')](_0x4b7268[_0x116d('0x23')],{'phone':_0x29e57b,'role':_0x116d('0x24')});}else{logger['info'](_0x116d('0x25'));return request({'uri':util[_0x116d('0xb')]('%s/users.json',_0x5aaf80[_0x116d('0xd')]),'method':_0x116d('0xe'),'body':{'user':{'role':'end-user','name':util[_0x116d('0xb')](_0x116d('0x26'),_0x229a57||_0x29e57b),'phone':_0x29e57b}}})[_0x116d('0x1a')](function(_0x2024b3){logger[_0x116d('0x9')]('Enduser\x20created.');return _0x2024b3[_0x116d('0x20')];});}});}function getAuth(_0x33bb1d){var _0xab0cac;if(_0x33bb1d[_0x116d('0x27')]==='password'){_0xab0cac=util[_0x116d('0xb')](_0x116d('0x28'),_0x33bb1d[_0x116d('0x29')],_0x33bb1d['password']);}else if(_0x33bb1d[_0x116d('0x27')]==='token'){_0xab0cac=util[_0x116d('0xb')](_0x116d('0x2a'),_0x33bb1d[_0x116d('0x29')],_0x33bb1d[_0x116d('0x2b')]);}return util[_0x116d('0xb')](_0x116d('0x2c'),new Buffer(_0xab0cac)[_0x116d('0x2d')]('base64'));}function request(_0x5d1696){logger['debug'](_0x116d('0x2e'),JSON[_0x116d('0x2f')](_0x5d1696));return rp(_['defaults'](_0x5d1696,{'method':_0x116d('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x76ff7a,_0x12057e){var _0x45d0e2=[];if(_0x76ff7a&&_0x76ff7a[_0x116d('0x31')]>0x0){_0x45d0e2=_[_0x116d('0x32')](_0x76ff7a,_0x12057e);}return _0x45d0e2;}function getCustomFields(_0x30da25,_0x49fd42){var _0x9ecb77=[];var _0x557e88={'custom_fields':[]};if(_0x30da25[_0x116d('0x31')]>0x0){_[_0x116d('0x33')](_0x30da25,function(_0x20739c){if(_0x20739c[_0x116d('0x34')]==='string'&&_0x20739c[_0x116d('0x35')]&&!_0x20739c[_0x116d('0x36')]){_0x557e88[_0x20739c[_0x116d('0x35')]['toLowerCase']()]=_0x20739c['content'][_0x116d('0x2d')]();}else if(_0x20739c[_0x116d('0x34')]===_0x116d('0x37')&&_0x20739c[_0x116d('0x38')]&&_0x20739c[_0x116d('0x36')]){_0x557e88[_0x116d('0x39')]['push']({'id':_0x20739c[_0x116d('0x38')],'value':_0x20739c[_0x116d('0x3a')][_0x116d('0x2d')]()});}else if(_0x20739c[_0x116d('0x34')]===_0x116d('0x3b')&&_0x20739c[_0x116d('0x3c')]&&_0x20739c[_0x116d('0x38')]&&_0x20739c[_0x116d('0x36')]){_0x49fd42[_0x20739c[_0x116d('0x3c')]]&&_0x557e88[_0x116d('0x39')]['push']({'id':_0x20739c[_0x116d('0x38')],'value':_0x49fd42[_0x20739c[_0x116d('0x3c')]][_0x116d('0x2d')]()});}else if(_0x20739c[_0x116d('0x34')]===_0x116d('0x3d')&&_0x20739c[_0x116d('0x3e')]&&_0x20739c[_0x116d('0x3e')]['name']&&_0x20739c[_0x116d('0x38')]&&_0x20739c[_0x116d('0x36')]){_0x49fd42[_0x20739c[_0x116d('0x3e')]['name'][_0x116d('0x3f')]()]&&_0x557e88[_0x116d('0x39')][_0x116d('0x40')]({'id':_0x20739c['idField'],'value':_0x49fd42[_0x20739c[_0x116d('0x3e')][_0x116d('0x11')][_0x116d('0x3f')]()][_0x116d('0x2d')]()});}});}return _0x557e88;}exports[_0x116d('0x41')]=function(_0x3c8179,_0x40ab73,_0x1b59ac,_0x477ce1,_0x188b8d,_0x181936){var _0x4fc6d8,_0x21392a;_0x181936[_0x116d('0xd')]=intUtil['stripTrailingSlash'](_0x181936[_0x116d('0xd')]);_0x181936[_0x116d('0x42')]=intUtil[_0x116d('0x43')](_0x181936['serverUrl']);if(_0x188b8d&&_0x188b8d['monitor_format']){logger[_0x116d('0x9')](_0x116d('0x44'),_0x116d('0x45'));_0x40ab73[_0x116d('0x46')]=util['format'](_0x116d('0x47'),_0x181936[_0x116d('0x42')],_0x40ab73[_0x116d('0x48')],md5(_0x40ab73[_0x116d('0x48')]));}else{_0x40ab73['recordingURL']='';}headers[_0x116d('0x49')]=getAuth(_0x181936);return getUser(_0x181936,_0x477ce1[_0x116d('0x4a')])[_0x116d('0x1a')](function(_0x5d11d0){_0x4fc6d8=_0x5d11d0;logger[_0x116d('0x9')](_0x116d('0x4b'),_0x4fc6d8['id']);return getEndUser(_0x181936,_0x40ab73[_0x116d('0x4c')],_0x40ab73[_0x116d('0x4d')]);})[_0x116d('0x1a')](function(_0x381860){_0x21392a=_0x381860;logger[_0x116d('0x9')](_0x116d('0x4e'),_0x21392a['id']);return getTicket(_0x181936,_0x4fc6d8,_0x21392a,_0x1b59ac,_0x40ab73);})[_0x116d('0x1a')](function(_0x123b6d){if(_0x123b6d){logger['info'](_0x116d('0x4f'),_0x123b6d['id']);switch(_0x181936[_0x116d('0x34')]){case _0x116d('0x50'):logger[_0x116d('0x9')](_0x116d('0x44'),_0x116d('0x51'));return request({'uri':util[_0x116d('0xb')](_0x116d('0x52'),_0x181936[_0x116d('0xd')],_0x4fc6d8['id'],_0x123b6d['id']),'method':_0x116d('0xe')});case _0x116d('0x53'):logger[_0x116d('0x9')](_0x116d('0x44'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x116d('0xb')](_0x116d('0x54'),_0x477ce1[_0x116d('0x11')]),_0x116d('0x55'),{'uri':util['format'](_0x116d('0x56'),_0x181936[_0x116d('0xd')],_0x123b6d['id'])});break;default:logger[_0x116d('0x57')]('[QUEUE]',_0x116d('0x58'));}}})[_0x116d('0x59')](function(_0x6e1cf6){logger[_0x116d('0x57')]('[QUEUE]',JSON['stringify'](_0x6e1cf6));});};exports[_0x116d('0x5a')]=function(_0x20ddf3,_0x89fd78,_0x1b7468,_0x1927ce,_0x597f9c,_0x13e9c1,_0x1116c4){var _0xb78eb,_0x1eba28;_0x13e9c1[_0x116d('0xd')]=intUtil[_0x116d('0x43')](_0x13e9c1['remoteUri']);_0x13e9c1[_0x116d('0x42')]=intUtil[_0x116d('0x43')](_0x13e9c1['serverUrl']);if(_0x1116c4&&_0x1116c4[_0x116d('0x5b')]&&_0x1116c4['recordingFormat']!==_0x116d('0x5c')){logger[_0x116d('0x9')](_0x116d('0x5d'),_0x116d('0x45'));_0x89fd78[_0x116d('0x46')]=util[_0x116d('0xb')](_0x116d('0x47'),_0x13e9c1[_0x116d('0x42')],_0x89fd78[_0x116d('0x48')],md5(_0x89fd78[_0x116d('0x48')]));}headers[_0x116d('0x49')]=getAuth(_0x13e9c1);return getUser(_0x13e9c1,_0x1927ce['email'])[_0x116d('0x1a')](function(_0x4d92f1){_0xb78eb=_0x4d92f1;logger[_0x116d('0x9')](_0x116d('0x4b'),_0xb78eb['id']);return getEndUser(_0x13e9c1,_0x89fd78['destcalleridname'],_0x89fd78['destcalleridnum']);})[_0x116d('0x1a')](function(_0x52e6bd){_0x1eba28=_0x52e6bd;logger['info'](_0x116d('0x4e'),_0x1eba28['id']);return getTicket(_0x13e9c1,_0xb78eb,_0x1eba28,_0x1b7468,_0x89fd78);})[_0x116d('0x1a')](function(_0x1f5c95){if(_0x1f5c95){logger[_0x116d('0x9')](_0x116d('0x4f'),_0x1f5c95['id']);switch(_0x13e9c1[_0x116d('0x34')]){case _0x116d('0x50'):logger['info'](_0x116d('0x5d'),_0x116d('0x51'));return request({'uri':util[_0x116d('0xb')](_0x116d('0x52'),_0x13e9c1['remoteUri'],_0xb78eb['id'],_0x1f5c95['id']),'method':_0x116d('0xe')});case'newTab':logger[_0x116d('0x9')](_0x116d('0x5d'),_0x116d('0x5e'));emit(util[_0x116d('0xb')](_0x116d('0x54'),_0x1927ce['name']),_0x116d('0x55'),{'uri':util[_0x116d('0xb')](_0x116d('0x56'),_0x13e9c1[_0x116d('0xd')],_0x1f5c95['id'])});break;default:logger[_0x116d('0x57')](_0x116d('0x5d'),_0x116d('0x58'));}}})['catch'](function(_0x4fde9d){logger[_0x116d('0x57')](_0x116d('0x5d'),JSON[_0x116d('0x2f')](_0x4fde9d));});};exports[_0x116d('0x5f')]=function(_0x4911d0,_0x45dda5,_0xb4ba54,_0x4f8d9b,_0x5bf417,_0x4b7286){var _0x4b910f,_0x32b710;_0x4b7286[_0x116d('0xd')]=intUtil[_0x116d('0x43')](_0x4b7286['remoteUri']);_0x4b7286[_0x116d('0x42')]=intUtil[_0x116d('0x43')](_0x4b7286['serverUrl']);if(_0x5bf417&&_0x5bf417[_0x116d('0x60')]){logger[_0x116d('0x9')](_0x116d('0x61'),_0x116d('0x45'));_0x45dda5[_0x116d('0x46')]=util[_0x116d('0xb')](_0x116d('0x47'),_0x4b7286[_0x116d('0x42')],_0x45dda5['uniqueid'],md5(_0x45dda5['uniqueid']));}else{_0x45dda5['recordingURL']='';}headers[_0x116d('0x49')]=getAuth(_0x4b7286);return getUser(_0x4b7286)['then'](function(_0x4f28fa){_0x4b910f=_0x4f28fa;logger[_0x116d('0x9')](_0x116d('0x4b'),_0x4b910f['id']);return getEndUser(_0x4b7286,_0x45dda5[_0x116d('0x4c')],_0x45dda5[_0x116d('0x4d')]);})['then'](function(_0x1b0535){_0x32b710=_0x1b0535;logger[_0x116d('0x9')](_0x116d('0x4e'),_0x32b710['id']);return getTicket(_0x4b7286,_0x4b910f,_0x32b710,_0xb4ba54,_0x45dda5);})['then'](function(_0x214543){if(_0x214543){logger[_0x116d('0x9')](_0x116d('0x4f'),_0x214543['id']);}})[_0x116d('0x59')](function(_0x1e2117){logger[_0x116d('0x57')](_0x116d('0x61'),JSON[_0x116d('0x2f')](_0x1e2117));});};
\ No newline at end of file
+var _0x2926=['Tags','name','getString','Subjects','Descriptions','Fields','Ticket\x20created!','ticket','%s/search.json','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','end-user','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','stringify','defaults','length','map','forEach','type','string','nameField','customField','content','custom_fields','push','idField','variable','variableName','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','abandoned','recordingURL','[ABANDONED]','lodash','request-promise','md5','util','./util','../../../../config/logger','zendesk','socket.io-emitter','localhost','emit','application/json','info','format','remoteUri','POST'];(function(_0x1c4951,_0x2038ee){var _0x345e1b=function(_0x69ee47){while(--_0x69ee47){_0x1c4951['push'](_0x1c4951['shift']());}};_0x345e1b(++_0x2038ee);}(_0x2926,0x179));var _0x6292=function(_0x786e9,_0x1a029){_0x786e9=_0x786e9-0x0;var _0x1f891b=_0x2926[_0x786e9];return _0x1f891b;};'use strict';var _=require(_0x6292('0x0'));var rp=require(_0x6292('0x1'));var md5=require(_0x6292('0x2'));var util=require(_0x6292('0x3'));var intUtil=require(_0x6292('0x4'));var logger=require(_0x6292('0x5'))(_0x6292('0x6'));var io=require(_0x6292('0x7'))({'host':_0x6292('0x8'),'port':0x18eb});function emit(_0x501b02,_0x301937,_0x1f302f){io['to'](_0x501b02)[_0x6292('0x9')](_0x301937,_0x1f302f);}var headers={'Content-Type':_0x6292('0xa'),'Accept':'application/json'};function getTicket(_0x2410a3,_0x1d68ac,_0x1bf1dd,_0x210376,_0x256e82){logger[_0x6292('0xb')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x6292('0xc')]('%s/tickets.json',_0x2410a3[_0x6292('0xd')]),'method':_0x6292('0xe'),'body':{'ticket':_['merge']({'requester_id':_0x1bf1dd['id'],'submitter_id':_0x1d68ac?_0x1d68ac['id']:undefined,'assignee_id':_0x1d68ac?_0x1d68ac['id']:undefined,'tags':getTags(_0x210376[_0x6292('0xf')],_0x6292('0x10')),'subject':intUtil[_0x6292('0x11')](_0x210376[_0x6292('0x12')],_0x256e82,'\x20'),'description':intUtil['getString'](_0x210376[_0x6292('0x13')],_0x256e82,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x210376[_0x6292('0x13')],_0x256e82,'\x0a')}},getCustomFields(_0x210376[_0x6292('0x14')],_0x256e82))}})['then'](function(_0x44cd35){logger[_0x6292('0xb')](_0x6292('0x15'));return _0x44cd35[_0x6292('0x16')];});}function getUser(_0x1ec425,_0x5df516){logger[_0x6292('0xb')]('Getting\x20agent\x20with\x20email',_0x5df516);return request({'uri':util['format'](_0x6292('0x17'),_0x1ec425[_0x6292('0xd')]),'qs':{'query':util['format'](_0x6292('0x18'),_0x5df516)}})[_0x6292('0x19')](function(_0x10aa00){if(_0x10aa00[_0x6292('0x1a')]){logger[_0x6292('0xb')](_0x6292('0x1b'));return _['find'](_0x10aa00[_0x6292('0x1c')],{'email':_0x5df516,'role':_0x6292('0x1d')});}else{logger['info'](_0x6292('0x1e'));return request({'uri':util[_0x6292('0xc')]('%s/users/me.json',_0x1ec425[_0x6292('0xd')])})['then'](function(_0x4e1fda){logger['info'](_0x6292('0x1f'));return _0x4e1fda[_0x6292('0x20')];});}});}function getEndUser(_0xe23376,_0x4a1d0a,_0x372aee){logger[_0x6292('0xb')](_0x6292('0x21'),_0x372aee);return request({'uri':util['format'](_0x6292('0x17'),_0xe23376[_0x6292('0xd')]),'qs':{'query':util[_0x6292('0xc')]('type:user\x20role:end-user\x20phone:%s',_0x372aee)}})['then'](function(_0x5d23c7){if(_0x5d23c7['count']){logger[_0x6292('0xb')](_0x6292('0x22'));return _['find'](_0x5d23c7[_0x6292('0x1c')],{'phone':_0x372aee,'role':_0x6292('0x23')});}else{logger[_0x6292('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x6292('0x24'),_0xe23376[_0x6292('0xd')]),'method':_0x6292('0xe'),'body':{'user':{'role':_0x6292('0x23'),'name':util['format'](_0x6292('0x25'),_0x4a1d0a||_0x372aee),'phone':_0x372aee}}})['then'](function(_0x222a44){logger[_0x6292('0xb')](_0x6292('0x26'));return _0x222a44[_0x6292('0x20')];});}});}function getAuth(_0x17573d){var _0x4ff48c;if(_0x17573d[_0x6292('0x27')]===_0x6292('0x28')){_0x4ff48c=util[_0x6292('0xc')](_0x6292('0x29'),_0x17573d[_0x6292('0x2a')],_0x17573d[_0x6292('0x28')]);}else if(_0x17573d[_0x6292('0x27')]===_0x6292('0x2b')){_0x4ff48c=util[_0x6292('0xc')](_0x6292('0x2c'),_0x17573d['username'],_0x17573d['token']);}return util[_0x6292('0xc')](_0x6292('0x2d'),new Buffer(_0x4ff48c)[_0x6292('0x2e')](_0x6292('0x2f')));}function request(_0xe1d8a4){logger[_0x6292('0x30')]('[HTTP]',JSON[_0x6292('0x31')](_0xe1d8a4));return rp(_[_0x6292('0x32')](_0xe1d8a4,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x2ce43a,_0x15f861){var _0x3d2739=[];if(_0x2ce43a&&_0x2ce43a[_0x6292('0x33')]>0x0){_0x3d2739=_[_0x6292('0x34')](_0x2ce43a,_0x15f861);}return _0x3d2739;}function getCustomFields(_0x473cca,_0x60ca19){var _0x11cf83=[];var _0x2b6d2c={'custom_fields':[]};if(_0x473cca[_0x6292('0x33')]>0x0){_[_0x6292('0x35')](_0x473cca,function(_0x2fd74e){if(_0x2fd74e[_0x6292('0x36')]===_0x6292('0x37')&&_0x2fd74e[_0x6292('0x38')]&&!_0x2fd74e[_0x6292('0x39')]){_0x2b6d2c[_0x2fd74e[_0x6292('0x38')]['toLowerCase']()]=_0x2fd74e[_0x6292('0x3a')]['toString']();}else if(_0x2fd74e[_0x6292('0x36')]===_0x6292('0x37')&&_0x2fd74e['idField']&&_0x2fd74e['customField']){_0x2b6d2c[_0x6292('0x3b')][_0x6292('0x3c')]({'id':_0x2fd74e[_0x6292('0x3d')],'value':_0x2fd74e[_0x6292('0x3a')][_0x6292('0x2e')]()});}else if(_0x2fd74e[_0x6292('0x36')]===_0x6292('0x3e')&&_0x2fd74e[_0x6292('0x3f')]&&_0x2fd74e[_0x6292('0x3d')]&&_0x2fd74e[_0x6292('0x39')]){_0x60ca19[_0x2fd74e[_0x6292('0x3f')]]&&_0x2b6d2c[_0x6292('0x3b')][_0x6292('0x3c')]({'id':_0x2fd74e[_0x6292('0x3d')],'value':_0x60ca19[_0x2fd74e[_0x6292('0x3f')]][_0x6292('0x2e')]()});}else if(_0x2fd74e[_0x6292('0x36')]==='customVariable'&&_0x2fd74e[_0x6292('0x40')]&&_0x2fd74e[_0x6292('0x40')][_0x6292('0x10')]&&_0x2fd74e[_0x6292('0x3d')]&&_0x2fd74e[_0x6292('0x39')]){_0x60ca19[_0x2fd74e[_0x6292('0x40')][_0x6292('0x10')][_0x6292('0x41')]()]&&_0x2b6d2c[_0x6292('0x3b')]['push']({'id':_0x2fd74e[_0x6292('0x3d')],'value':_0x60ca19[_0x2fd74e[_0x6292('0x40')][_0x6292('0x10')]['toLowerCase']()][_0x6292('0x2e')]()});}});}return _0x2b6d2c;}exports[_0x6292('0x42')]=function(_0x478a5a,_0x2fbe15,_0x3bdddc,_0x5a7a37,_0x13106d,_0x1d3f37){var _0x14c5cd,_0xe06b7a;_0x1d3f37['remoteUri']=intUtil[_0x6292('0x43')](_0x1d3f37['remoteUri']);_0x1d3f37[_0x6292('0x44')]=intUtil['stripTrailingSlash'](_0x1d3f37[_0x6292('0x44')]);if(_0x13106d&&_0x13106d[_0x6292('0x45')]){logger[_0x6292('0xb')](_0x6292('0x46'),_0x6292('0x47'));_0x2fbe15['recordingURL']=util[_0x6292('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1d3f37[_0x6292('0x44')],_0x2fbe15[_0x6292('0x48')],md5(_0x2fbe15[_0x6292('0x48')]));}else{_0x2fbe15['recordingURL']='';}headers['Authorization']=getAuth(_0x1d3f37);return getUser(_0x1d3f37,_0x5a7a37[_0x6292('0x49')])[_0x6292('0x19')](function(_0xd8665f){_0x14c5cd=_0xd8665f;logger[_0x6292('0xb')](_0x6292('0x4a'),_0x14c5cd['id']);return getEndUser(_0x1d3f37,_0x2fbe15['calleridname'],_0x2fbe15[_0x6292('0x4b')]);})[_0x6292('0x19')](function(_0x2766f5){_0xe06b7a=_0x2766f5;logger[_0x6292('0xb')](_0x6292('0x4c'),_0xe06b7a['id']);return getTicket(_0x1d3f37,_0x14c5cd,_0xe06b7a,_0x3bdddc,_0x2fbe15);})['then'](function(_0x30bdf1){if(_0x30bdf1){logger[_0x6292('0xb')]('The\x20Ticket\x20ID\x20is:',_0x30bdf1['id']);switch(_0x1d3f37[_0x6292('0x36')]){case _0x6292('0x4d'):logger['info'](_0x6292('0x46'),_0x6292('0x4e'));return request({'uri':util[_0x6292('0xc')](_0x6292('0x4f'),_0x1d3f37['remoteUri'],_0x14c5cd['id'],_0x30bdf1['id']),'method':_0x6292('0xe')});case _0x6292('0x50'):logger[_0x6292('0xb')](_0x6292('0x46'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x6292('0xc')]('user:%s',_0x5a7a37[_0x6292('0x10')]),_0x6292('0x51'),{'uri':util[_0x6292('0xc')](_0x6292('0x52'),_0x1d3f37[_0x6292('0xd')],_0x30bdf1['id'])});break;default:logger[_0x6292('0x53')](_0x6292('0x46'),_0x6292('0x54'));}}})[_0x6292('0x55')](function(_0x11c225){logger[_0x6292('0x53')]('[QUEUE]',JSON['stringify'](_0x11c225));});};exports['outbound']=function(_0x41281a,_0x2e6e2f,_0x24794e,_0x33c3ee,_0xdb39f9,_0x15b6e2,_0x5a5ec0){var _0x2feecf,_0x2a523a;_0x15b6e2[_0x6292('0xd')]=intUtil[_0x6292('0x43')](_0x15b6e2[_0x6292('0xd')]);_0x15b6e2['serverUrl']=intUtil[_0x6292('0x43')](_0x15b6e2[_0x6292('0x44')]);if(_0x5a5ec0&&_0x5a5ec0[_0x6292('0x56')]&&_0x5a5ec0[_0x6292('0x56')]!==_0x6292('0x57')){logger[_0x6292('0xb')](_0x6292('0x58'),_0x6292('0x47'));_0x2e6e2f['recordingURL']=util[_0x6292('0xc')](_0x6292('0x59'),_0x15b6e2['serverUrl'],_0x2e6e2f['uniqueid'],md5(_0x2e6e2f[_0x6292('0x48')]));}headers[_0x6292('0x5a')]=getAuth(_0x15b6e2);return getUser(_0x15b6e2,_0x33c3ee[_0x6292('0x49')])[_0x6292('0x19')](function(_0x265566){_0x2feecf=_0x265566;logger[_0x6292('0xb')](_0x6292('0x4a'),_0x2feecf['id']);return getEndUser(_0x15b6e2,_0x2e6e2f['destcalleridname'],_0x2e6e2f[_0x6292('0x5b')]);})[_0x6292('0x19')](function(_0x4f08bd){_0x2a523a=_0x4f08bd;logger[_0x6292('0xb')](_0x6292('0x4c'),_0x2a523a['id']);return getTicket(_0x15b6e2,_0x2feecf,_0x2a523a,_0x24794e,_0x2e6e2f);})['then'](function(_0x222f41){if(_0x222f41){logger['info'](_0x6292('0x5c'),_0x222f41['id']);switch(_0x15b6e2[_0x6292('0x36')]){case _0x6292('0x4d'):logger['info'](_0x6292('0x58'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x6292('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x15b6e2['remoteUri'],_0x2feecf['id'],_0x222f41['id']),'method':_0x6292('0xe')});case _0x6292('0x50'):logger[_0x6292('0xb')](_0x6292('0x58'),_0x6292('0x5d'));emit(util['format'](_0x6292('0x5e'),_0x33c3ee[_0x6292('0x10')]),_0x6292('0x51'),{'uri':util[_0x6292('0xc')](_0x6292('0x52'),_0x15b6e2[_0x6292('0xd')],_0x222f41['id'])});break;default:logger[_0x6292('0x53')](_0x6292('0x58'),_0x6292('0x54'));}}})['catch'](function(_0x57b7cf){logger[_0x6292('0x53')](_0x6292('0x58'),JSON[_0x6292('0x31')](_0x57b7cf));});};exports[_0x6292('0x5f')]=function(_0x4d6df0,_0x435ff3,_0x3acfff,_0x1e8250,_0x388d81,_0x279db7){var _0x3673cb,_0x360517;_0x279db7[_0x6292('0xd')]=intUtil[_0x6292('0x43')](_0x279db7[_0x6292('0xd')]);_0x279db7[_0x6292('0x44')]=intUtil[_0x6292('0x43')](_0x279db7[_0x6292('0x44')]);if(_0x388d81&&_0x388d81['monitor_format']){logger[_0x6292('0xb')]('[ABANDONED]',_0x6292('0x47'));_0x435ff3[_0x6292('0x60')]=util[_0x6292('0xc')](_0x6292('0x59'),_0x279db7[_0x6292('0x44')],_0x435ff3[_0x6292('0x48')],md5(_0x435ff3[_0x6292('0x48')]));}else{_0x435ff3[_0x6292('0x60')]='';}headers[_0x6292('0x5a')]=getAuth(_0x279db7);return getUser(_0x279db7)[_0x6292('0x19')](function(_0x4ca23f){_0x3673cb=_0x4ca23f;logger[_0x6292('0xb')](_0x6292('0x4a'),_0x3673cb['id']);return getEndUser(_0x279db7,_0x435ff3['calleridname'],_0x435ff3[_0x6292('0x4b')]);})[_0x6292('0x19')](function(_0x460d20){_0x360517=_0x460d20;logger[_0x6292('0xb')](_0x6292('0x4c'),_0x360517['id']);return getTicket(_0x279db7,_0x3673cb,_0x360517,_0x3acfff,_0x435ff3);})[_0x6292('0x19')](function(_0x5c9cb7){if(_0x5c9cb7){logger[_0x6292('0xb')](_0x6292('0x5c'),_0x5c9cb7['id']);}})[_0x6292('0x55')](function(_0x26c72e){logger['error'](_0x6292('0x61'),JSON['stringify'](_0x26c72e));});};
\ No newline at end of file
index 3bcf2e5..9a421d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04ac=['abandoned','[ABANDONED]','request-promise','md5','util','./util','xml2json','../../../../config/logger','zoho','socket.io-emitter','localhost','application/json','Creating\x20new\x20call...','merge','inbound','outbound','starttime','agentcalledAt','YYYY-MM-DD\x20HH:mm:ss','getString','Subjects','Descriptions','Fields','lastevent','Call\x20Result','Called','complete','Answered','Rejected','talktime','Call\x20Duration','utc','format','mm:ss','answertime','endtime','diff','CONTACTID','LEADID','SEMODULE','Leads','SEID','<Calls><row\x20no=\x221\x22>','hasOwnProperty','encodeXML','</row></Calls>','POST','https://crm.%s/crm/private/xml/Calls/insertRecords','host','authToken','crmapi','response','result','recorddetail','info','Call\x20created!','Error\x20on\x20call\x20creation:\x20','stringify','GET','https://crm.%s/crm/private/json/Users/getUsers','then','users','user','find','Agent\x20found!','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','https://crm.%s/crm/private/json/Contacts/searchRecords','Enduser\x20found\x20in\x20Contacts!','Contacts','row','length','val','content','((Phone:%s))','Enduser\x20found\x20in\x20Leads!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','https://crm.%s/crm/private/xml/Leads/insertRecords','<Leads><row\x20no=\x221\x22><FL\x20val=\x22First\x20Name\x22>%s</FL><FL\x20val=\x22Last\x20Name\x22>%s</FL><FL\x20val=\x22Phone\x22>%s</FL></row></Leads>','parse','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20creation:\x20','Error\x20on\x20Lead\x20retrieve:\x20','debug','[HTTP]','forEach','type','idField','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','queue','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','catch','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','Outbound','user:%s'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x04ac,0x1ee));var _0xc04a=function(_0x29b2c2,_0x4c8680){_0x29b2c2=_0x29b2c2-0x0;var _0x6bc5f5=_0x04ac[_0x29b2c2];return _0x6bc5f5;};'use strict';var _=require('lodash');var rp=require(_0xc04a('0x0'));var md5=require(_0xc04a('0x1'));var util=require(_0xc04a('0x2'));var intUtil=require(_0xc04a('0x3'));var parser=require(_0xc04a('0x4'));var entities=require('entities');var moment=require('moment');var logger=require(_0xc04a('0x5'))(_0xc04a('0x6'));var io=require(_0xc04a('0x7'))({'host':_0xc04a('0x8'),'port':0x18eb});function emit(_0x376440,_0xd9d8bf,_0x190e52){io['to'](_0x376440)['emit'](_0xd9d8bf,_0x190e52);}var headers={'Content-Type':'application/json','Accept':_0xc04a('0x9')};function getCall(_0x4046f5,_0x1d9089,_0x3504b0,_0x28eb79,_0x29f0fc,_0xfd3a59){logger['info'](_0xc04a('0xa'));var _0x8ec40b=_[_0xc04a('0xb')]({'SMOWNERID':_0x1d9089['id'],'Call Type':_0xfd3a59||_0xc04a('0xc'),'Call Start Time':(_0xfd3a59===_0xc04a('0xd')?_0x29f0fc[_0xc04a('0xe')]:_0x29f0fc[_0xc04a('0xf')])||moment()['format'](_0xc04a('0x10')),'Subject':intUtil[_0xc04a('0x11')](_0x28eb79[_0xc04a('0x12')],_0x29f0fc,'\x20'),'Description':intUtil[_0xc04a('0x11')](_0x28eb79[_0xc04a('0x13')],_0x29f0fc,'\x0a')},getCustomFields(_0x28eb79[_0xc04a('0x14')],_0x29f0fc));switch(_0x29f0fc[_0xc04a('0x15')]){case'called':_0x8ec40b[_0xc04a('0x16')]=_0xc04a('0x17');break;case _0xc04a('0x18'):case'connect':_0x8ec40b[_0xc04a('0x16')]=_0xc04a('0x19');break;case'rejected':_0x8ec40b[_0xc04a('0x16')]=_0xc04a('0x1a');break;case'abandoned':_0x8ec40b[_0xc04a('0x16')]='Abandoned';break;default:}if(_0x29f0fc[_0xc04a('0x1b')]){_0x8ec40b[_0xc04a('0x1c')]=moment[_0xc04a('0x1d')](parseInt(_0x29f0fc[_0xc04a('0x1b')])*0x3e8)[_0xc04a('0x1e')](_0xc04a('0x1f'));}else if(_0x29f0fc[_0xc04a('0x20')]&&_0x29f0fc[_0xc04a('0x21')]){_0x8ec40b[_0xc04a('0x1c')]=moment['utc'](moment(_0x29f0fc['endtime'],_0xc04a('0x10'))[_0xc04a('0x22')](moment(_0x29f0fc[_0xc04a('0xe')],_0xc04a('0x10'))))[_0xc04a('0x1e')](_0xc04a('0x1f'));}if(_0x3504b0[_0xc04a('0x23')]){_0x8ec40b['CONTACTID']=_0x3504b0['CONTACTID'];}else if(_0x3504b0[_0xc04a('0x24')]){_0x8ec40b[_0xc04a('0x25')]=_0xc04a('0x26');_0x8ec40b[_0xc04a('0x27')]=_0x3504b0[_0xc04a('0x24')];}var _0x10763c=_0xc04a('0x28');for(var _0x1bf799 in _0x8ec40b){if(_0x8ec40b[_0xc04a('0x29')](_0x1bf799)){_0x10763c+=util[_0xc04a('0x1e')]('<FL\x20val=\x22%s\x22>%s</FL>',entities[_0xc04a('0x2a')](_0x1bf799),entities[_0xc04a('0x2a')](_0x8ec40b[_0x1bf799]));}}_0x10763c+=_0xc04a('0x2b');return request({'method':_0xc04a('0x2c'),'uri':util[_0xc04a('0x1e')](_0xc04a('0x2d'),_0x4046f5[_0xc04a('0x2e')]),'qs':{'authtoken':_0x4046f5[_0xc04a('0x2f')],'scope':_0xc04a('0x30'),'xmlData':_0x10763c},'json':!![]})['then'](function(_0x3ab0a3){_0x3ab0a3=JSON['parse'](parser['toJson'](_0x3ab0a3));if(_0x3ab0a3['response']){if(_0x3ab0a3[_0xc04a('0x31')][_0xc04a('0x32')]&&_0x3ab0a3[_0xc04a('0x31')]['result'][_0xc04a('0x33')]){logger[_0xc04a('0x34')](_0xc04a('0x35'));return{'id':_0x3ab0a3[_0xc04a('0x31')][_0xc04a('0x32')][_0xc04a('0x33')]['FL'][0x0]['$t']};}}throw new Error(_0xc04a('0x36')+JSON[_0xc04a('0x37')](_0x3ab0a3));});}function getUser(_0x4ae14e,_0x58030f){_0x58030f&&logger[_0xc04a('0x34')]('Getting\x20agent\x20with\x20email',_0x58030f);return request({'method':_0xc04a('0x38'),'uri':util[_0xc04a('0x1e')](_0xc04a('0x39'),_0x4ae14e[_0xc04a('0x2e')]),'qs':{'type':'AllUsers','authtoken':_0x4ae14e[_0xc04a('0x2f')],'scope':_0xc04a('0x30')},'json':!![]})[_0xc04a('0x3a')](function(_0x39372b){if(_0x39372b[_0xc04a('0x3b')]&&_0x39372b['users'][_0xc04a('0x3c')]){var _0x30060b;if(_0x58030f){_0x30060b=_[_0xc04a('0x3d')](_0x39372b[_0xc04a('0x3b')][_0xc04a('0x3c')],{'email':_0x58030f,'profile':'Standard'});}if(_0x30060b){logger[_0xc04a('0x34')](_0xc04a('0x3e'));}else{logger[_0xc04a('0x34')]('Using\x20the\x20admin\x20account!');_0x30060b=_[_0xc04a('0x3d')](_0x39372b[_0xc04a('0x3b')][_0xc04a('0x3c')],{'profile':'Administrator'});}return _0x30060b;}else{logger[_0xc04a('0x3f')](_0xc04a('0x40'),JSON[_0xc04a('0x37')](_0x39372b));throw new Error(_0xc04a('0x41')+JSON[_0xc04a('0x37')](_0x39372b));}});}function getEndUser(_0xdbc7cc,_0x36522d,_0x5be9dd){logger[_0xc04a('0x34')]('Searching\x20enduser\x20with\x20phone',_0x5be9dd);return request({'method':_0xc04a('0x38'),'uri':util[_0xc04a('0x1e')](_0xc04a('0x42'),_0xdbc7cc[_0xc04a('0x2e')]),'qs':{'authtoken':_0xdbc7cc[_0xc04a('0x2f')],'scope':_0xc04a('0x30'),'criteria':util[_0xc04a('0x1e')]('((Phone:%s))',_0x5be9dd)},'json':!![]})['then'](function(_0x232452){if(_0x232452[_0xc04a('0x31')]&&_0x232452[_0xc04a('0x31')][_0xc04a('0x32')]){logger[_0xc04a('0x34')](_0xc04a('0x43'));var _0x98ea54={};var _0x285980=_0x232452[_0xc04a('0x31')][_0xc04a('0x32')][_0xc04a('0x44')]['row']['no']?_0x232452['response']['result'][_0xc04a('0x44')][_0xc04a('0x45')]['FL']:_0x232452['response']['result'][_0xc04a('0x44')][_0xc04a('0x45')][0x0]['FL'];for(var _0x1e725d=0x0,_0x1cd819=_0x285980[_0xc04a('0x46')];_0x1e725d<_0x1cd819;_0x1e725d++){_0x98ea54[_0x285980[_0x1e725d][_0xc04a('0x47')]]=_0x285980[_0x1e725d][_0xc04a('0x48')];}return _0x98ea54;}else{return request({'method':_0xc04a('0x38'),'uri':util[_0xc04a('0x1e')]('https://crm.%s/crm/private/json/Leads/searchRecords',_0xdbc7cc[_0xc04a('0x2e')]),'qs':{'authtoken':_0xdbc7cc['authToken'],'scope':_0xc04a('0x30'),'criteria':util[_0xc04a('0x1e')](_0xc04a('0x49'),_0x5be9dd)},'json':!![]})[_0xc04a('0x3a')](function(_0x415af9){if(_0x415af9['response']&&_0x415af9[_0xc04a('0x31')][_0xc04a('0x32')]){logger[_0xc04a('0x34')](_0xc04a('0x4a'));var _0x3bf6dd={};var _0x1f78cf=_0x415af9['response'][_0xc04a('0x32')][_0xc04a('0x26')]['row']['no']?_0x415af9[_0xc04a('0x31')][_0xc04a('0x32')][_0xc04a('0x26')][_0xc04a('0x45')]['FL']:_0x415af9[_0xc04a('0x31')]['result'][_0xc04a('0x26')][_0xc04a('0x45')][0x0]['FL'];for(var _0x5eeb09=0x0,_0x28642b=_0x1f78cf[_0xc04a('0x46')];_0x5eeb09<_0x28642b;_0x5eeb09++){_0x3bf6dd[_0x1f78cf[_0x5eeb09]['val']]=_0x1f78cf[_0x5eeb09][_0xc04a('0x48')];}return _0x3bf6dd;}else{logger['info'](_0xc04a('0x4b'));_0x36522d=getName(_0x36522d);return request({'method':_0xc04a('0x2c'),'uri':util['format'](_0xc04a('0x4c'),_0xdbc7cc[_0xc04a('0x2e')]),'qs':{'authtoken':_0xdbc7cc[_0xc04a('0x2f')],'scope':_0xc04a('0x30'),'xmlData':util[_0xc04a('0x1e')](_0xc04a('0x4d'),entities[_0xc04a('0x2a')](_0x36522d[0x0]),entities['encodeXML'](_0x36522d[0x1]),_0x5be9dd)},'json':!![]})[_0xc04a('0x3a')](function(_0x191453){_0x191453=JSON[_0xc04a('0x4e')](parser['toJson'](_0x191453));if(_0x191453['response']){if(_0x191453[_0xc04a('0x31')][_0xc04a('0x32')]&&_0x191453['response'][_0xc04a('0x32')][_0xc04a('0x33')]){logger['info'](_0xc04a('0x4f'));return request({'method':'GET','uri':util['format'](_0xc04a('0x50'),_0xdbc7cc[_0xc04a('0x2e')]),'qs':{'authtoken':_0xdbc7cc[_0xc04a('0x2f')],'scope':_0xc04a('0x30'),'id':_0x191453[_0xc04a('0x31')][_0xc04a('0x32')][_0xc04a('0x33')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0xc04a('0x51')+JSON['stringify'](_0x191453));})[_0xc04a('0x3a')](function(_0x4cb34c){if(_0x4cb34c[_0xc04a('0x31')]){if(_0x4cb34c[_0xc04a('0x31')]['result']){var _0x32ba6b={};for(var _0x398c1e=0x0,_0x2cc1d0=_0x4cb34c[_0xc04a('0x31')]['result'][_0xc04a('0x26')]['row']['FL']['length'];_0x398c1e<_0x2cc1d0;_0x398c1e++){_0x32ba6b[_0x4cb34c[_0xc04a('0x31')][_0xc04a('0x32')][_0xc04a('0x26')][_0xc04a('0x45')]['FL'][_0x398c1e][_0xc04a('0x47')]]=_0x4cb34c[_0xc04a('0x31')][_0xc04a('0x32')]['Leads'][_0xc04a('0x45')]['FL'][_0x398c1e][_0xc04a('0x48')];}return _0x32ba6b;}}throw new Error(_0xc04a('0x52')+JSON[_0xc04a('0x37')](_0x4cb34c));});}});}});}function request(_0x1d9ada){logger[_0xc04a('0x53')](_0xc04a('0x54'),JSON[_0xc04a('0x37')](_0x1d9ada));return rp(_0x1d9ada);}function getCustomFields(_0x362c88,_0x483ddf){var _0x4e78bf={};if(_0x362c88[_0xc04a('0x46')]>0x0){_[_0xc04a('0x55')](_0x362c88,function(_0x2e8575){if(_0x2e8575[_0xc04a('0x56')]==='string'&&_0x2e8575[_0xc04a('0x57')]){_0x4e78bf[_0x2e8575[_0xc04a('0x57')]]=_0x2e8575[_0xc04a('0x48')][_0xc04a('0x58')]();}else if(_0x2e8575['type']==='variable'&&_0x2e8575[_0xc04a('0x59')]&&_0x2e8575[_0xc04a('0x57')]&&_0x483ddf[_0x2e8575[_0xc04a('0x59')]]){_0x4e78bf[_0x2e8575[_0xc04a('0x57')]]=_0x483ddf[_0x2e8575[_0xc04a('0x59')]][_0xc04a('0x58')]();}else if(_0x2e8575['type']===_0xc04a('0x5a')&&_0x2e8575[_0xc04a('0x5b')]&&_0x2e8575[_0xc04a('0x5b')][_0xc04a('0x5c')]&&_0x2e8575[_0xc04a('0x57')]&&_0x483ddf[_0x2e8575[_0xc04a('0x5b')][_0xc04a('0x5c')][_0xc04a('0x5d')]()]){_0x4e78bf[_0x2e8575['idField']]=_0x483ddf[_0x2e8575['Variable'][_0xc04a('0x5c')][_0xc04a('0x5d')]()][_0xc04a('0x58')]();}});}return _0x4e78bf;}function getName(_0x48dc30){if(_0x48dc30[_0xc04a('0x5e')]('\x20')>0x0){var _0x575ec0=_0x48dc30[_0xc04a('0x5f')](/ (.+)/);if(_0x575ec0[0x1]){return _0x575ec0;}}return[_0x48dc30,_0x48dc30];}exports[_0xc04a('0x60')]=function(_0x9a328e,_0x3c6f00,_0x3ec5ed,_0x3b8998,_0x3d4821,_0x21ff64){var _0x519b47,_0x485da8;if(_0x3d4821&&_0x3d4821[_0xc04a('0x61')]){logger['info'](_0xc04a('0x62'),'Recording\x20is\x20enabled!');_0x3c6f00[_0xc04a('0x63')]=util['format'](_0xc04a('0x64'),_0x21ff64[_0xc04a('0x65')],_0x3c6f00['uniqueid'],md5(_0x3c6f00[_0xc04a('0x66')]));}else{_0x3c6f00[_0xc04a('0x63')]='';}return getUser(_0x21ff64,_0x3b8998[_0xc04a('0x67')])[_0xc04a('0x3a')](function(_0x154313){_0x519b47=_0x154313;logger[_0xc04a('0x34')]('The\x20User\x20ID\x20is:',_0x519b47['id']);return getEndUser(_0x21ff64,_0x3c6f00[_0xc04a('0x68')],_0x3c6f00[_0xc04a('0x69')]);})['then'](function(_0x18ce3d){_0x485da8=_0x18ce3d;logger[_0xc04a('0x34')](_0xc04a('0x6a'),_0x485da8[_0xc04a('0x23')]||_0x485da8[_0xc04a('0x24')]);return getCall(_0x21ff64,_0x519b47,_0x485da8,_0x3ec5ed,_0x3c6f00,_0xc04a('0x6b'));})[_0xc04a('0x3a')](function(_0x582680){if(_0x582680){logger[_0xc04a('0x34')](_0xc04a('0x6c'),_0x582680['id']);logger['info'](_0xc04a('0x62'),_0xc04a('0x6d'));emit(util[_0xc04a('0x1e')]('user:%s',_0x3b8998[_0xc04a('0x5c')]),_0xc04a('0x6e'),{'uri':util['format'](_0xc04a('0x6f'),_0x21ff64[_0xc04a('0x2e')],_0x582680['id'])});}})[_0xc04a('0x70')](function(_0x391003){logger[_0xc04a('0x3f')](_0xc04a('0x62'),JSON['stringify'](_0x391003));});};exports[_0xc04a('0xd')]=function(_0xc0d8ac,_0x198282,_0x5d0481,_0x16015f,_0x1b89a2,_0x379126,_0x22b203){var _0x50e5ec,_0x6a3472;if(_0x22b203&&_0x22b203[_0xc04a('0x71')]&&_0x22b203[_0xc04a('0x71')]!==_0xc04a('0x72')){logger[_0xc04a('0x34')](_0xc04a('0x73'),_0xc04a('0x74'));_0x198282[_0xc04a('0x63')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x379126[_0xc04a('0x65')],_0x198282[_0xc04a('0x66')],md5(_0x198282[_0xc04a('0x66')]));}return getUser(_0x379126,_0x16015f[_0xc04a('0x67')])[_0xc04a('0x3a')](function(_0x2add83){_0x50e5ec=_0x2add83;logger[_0xc04a('0x34')](_0xc04a('0x75'),_0x50e5ec['id']);return getEndUser(_0x379126,_0x198282[_0xc04a('0x76')],_0x198282['destcalleridnum']);})[_0xc04a('0x3a')](function(_0x307ea7){_0x6a3472=_0x307ea7;logger[_0xc04a('0x34')](_0xc04a('0x6a'),_0x6a3472['CONTACTID']||_0x6a3472['LEADID']);return getCall(_0x379126,_0x50e5ec,_0x6a3472,_0x5d0481,_0x198282,_0xc04a('0x77'));})[_0xc04a('0x3a')](function(_0x1096fc){if(_0x1096fc){logger[_0xc04a('0x34')](_0xc04a('0x6c'),_0x1096fc['id']);logger['info'](_0xc04a('0x73'),_0xc04a('0x6d'));emit(util[_0xc04a('0x1e')](_0xc04a('0x78'),_0x16015f[_0xc04a('0x5c')]),_0xc04a('0x6e'),{'uri':util[_0xc04a('0x1e')](_0xc04a('0x6f'),_0x379126[_0xc04a('0x2e')],_0x1096fc['id'])});}})[_0xc04a('0x70')](function(_0x4f0a17){logger[_0xc04a('0x3f')](_0xc04a('0x73'),JSON[_0xc04a('0x37')](_0x4f0a17));});};exports[_0xc04a('0x79')]=function(_0x2d0253,_0x33912a,_0xa82785,_0x3305d6,_0x27bef3,_0xb4b219){var _0xbb6336,_0x5e9a22;if(_0x27bef3&&_0x27bef3['monitor_format']){logger['info']('[ABANDONED]',_0xc04a('0x74'));_0x33912a[_0xc04a('0x63')]=util[_0xc04a('0x1e')](_0xc04a('0x64'),_0xb4b219[_0xc04a('0x65')],_0x33912a['uniqueid'],md5(_0x33912a[_0xc04a('0x66')]));}else{_0x33912a['recordingURL']='';}return getUser(_0xb4b219)['then'](function(_0x254be5){_0xbb6336=_0x254be5;logger[_0xc04a('0x34')]('The\x20User\x20ID\x20is:',_0xbb6336['id']);return getEndUser(_0xb4b219,_0x33912a[_0xc04a('0x68')],_0x33912a[_0xc04a('0x69')]);})[_0xc04a('0x3a')](function(_0x10c84c){_0x5e9a22=_0x10c84c;logger[_0xc04a('0x34')](_0xc04a('0x6a'),_0x5e9a22[_0xc04a('0x23')]||_0x5e9a22['LEADID']);return getCall(_0xb4b219,_0xbb6336,_0x5e9a22,_0xa82785,_0x33912a,_0xc04a('0x6b'));})[_0xc04a('0x3a')](function(_0x489c13){if(_0x489c13){logger[_0xc04a('0x34')](_0xc04a('0x6c'),_0x489c13['id']);}})[_0xc04a('0x70')](function(_0xf54694){logger[_0xc04a('0x3f')](_0xc04a('0x7a'),JSON[_0xc04a('0x37')](_0xf54694));});};
\ No newline at end of file
+var _0xbc03=['Agent\x20found!','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Searching\x20enduser\x20with\x20phone','https://crm.%s/crm/private/json/Contacts/searchRecords','((Phone:%s))','Enduser\x20found\x20in\x20Contacts!','Contacts','row','length','val','content','https://crm.%s/crm/private/json/Leads/searchRecords','Leads','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','https://crm.%s/crm/private/xml/Leads/insertRecords','<Leads><row\x20no=\x221\x22><FL\x20val=\x22First\x20Name\x22>%s</FL><FL\x20val=\x22Last\x20Name\x22>%s</FL><FL\x20val=\x22Phone\x22>%s</FL></row></Leads>','Enduser\x20created.','Error\x20on\x20Lead\x20creation:\x20','debug','[HTTP]','forEach','type','string','idField','variableName','toString','Variable','toLowerCase','indexOf','split','queue','monitor_format','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Call\x20ID\x20is:','[QUEUE]','user:%s','name','catch','error','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','[ABANDONED]','calleridnum','lodash','md5','./util','xml2json','../../../../config/logger','zoho','socket.io-emitter','localhost','emit','application/json','info','merge','inbound','outbound','starttime','agentcalledAt','getString','Subjects','Fields','lastevent','called','Call\x20Result','Called','complete','connect','Answered','rejected','Abandoned','talktime','Call\x20Duration','utc','format','mm:ss','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','diff','CONTACTID','LEADID','SEMODULE','SEID','<Calls><row\x20no=\x221\x22>','hasOwnProperty','encodeXML','</row></Calls>','POST','https://crm.%s/crm/private/xml/Calls/insertRecords','authToken','crmapi','then','toJson','response','result','Call\x20created!','recorddetail','stringify','Getting\x20agent\x20with\x20email','GET','https://crm.%s/crm/private/json/Users/getUsers','host','AllUsers','user','find','users'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xbc03,0xb4));var _0x3bc0=function(_0x26f499,_0x2359ef){_0x26f499=_0x26f499-0x0;var _0xccb39=_0xbc03[_0x26f499];return _0xccb39;};'use strict';var _=require(_0x3bc0('0x0'));var rp=require('request-promise');var md5=require(_0x3bc0('0x1'));var util=require('util');var intUtil=require(_0x3bc0('0x2'));var parser=require(_0x3bc0('0x3'));var entities=require('entities');var moment=require('moment');var logger=require(_0x3bc0('0x4'))(_0x3bc0('0x5'));var io=require(_0x3bc0('0x6'))({'host':_0x3bc0('0x7'),'port':0x18eb});function emit(_0x3b5d05,_0x51759b,_0x21bc53){io['to'](_0x3b5d05)[_0x3bc0('0x8')](_0x51759b,_0x21bc53);}var headers={'Content-Type':_0x3bc0('0x9'),'Accept':'application/json'};function getCall(_0x39bb62,_0x314ddc,_0x28eb88,_0x29619e,_0x4edc6d,_0x3554b5){logger[_0x3bc0('0xa')]('Creating\x20new\x20call...');var _0x362a04=_[_0x3bc0('0xb')]({'SMOWNERID':_0x314ddc['id'],'Call Type':_0x3554b5||_0x3bc0('0xc'),'Call Start Time':(_0x3554b5===_0x3bc0('0xd')?_0x4edc6d[_0x3bc0('0xe')]:_0x4edc6d[_0x3bc0('0xf')])||moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'Subject':intUtil[_0x3bc0('0x10')](_0x29619e[_0x3bc0('0x11')],_0x4edc6d,'\x20'),'Description':intUtil[_0x3bc0('0x10')](_0x29619e['Descriptions'],_0x4edc6d,'\x0a')},getCustomFields(_0x29619e[_0x3bc0('0x12')],_0x4edc6d));switch(_0x4edc6d[_0x3bc0('0x13')]){case _0x3bc0('0x14'):_0x362a04[_0x3bc0('0x15')]=_0x3bc0('0x16');break;case _0x3bc0('0x17'):case _0x3bc0('0x18'):_0x362a04['Call\x20Result']=_0x3bc0('0x19');break;case _0x3bc0('0x1a'):_0x362a04[_0x3bc0('0x15')]='Rejected';break;case'abandoned':_0x362a04['Call\x20Result']=_0x3bc0('0x1b');break;default:}if(_0x4edc6d[_0x3bc0('0x1c')]){_0x362a04[_0x3bc0('0x1d')]=moment[_0x3bc0('0x1e')](parseInt(_0x4edc6d[_0x3bc0('0x1c')])*0x3e8)[_0x3bc0('0x1f')](_0x3bc0('0x20'));}else if(_0x4edc6d[_0x3bc0('0x21')]&&_0x4edc6d[_0x3bc0('0x22')]){_0x362a04['Call\x20Duration']=moment[_0x3bc0('0x1e')](moment(_0x4edc6d[_0x3bc0('0x22')],_0x3bc0('0x23'))[_0x3bc0('0x24')](moment(_0x4edc6d[_0x3bc0('0xe')],_0x3bc0('0x23'))))[_0x3bc0('0x1f')]('mm:ss');}if(_0x28eb88[_0x3bc0('0x25')]){_0x362a04[_0x3bc0('0x25')]=_0x28eb88['CONTACTID'];}else if(_0x28eb88[_0x3bc0('0x26')]){_0x362a04[_0x3bc0('0x27')]='Leads';_0x362a04[_0x3bc0('0x28')]=_0x28eb88[_0x3bc0('0x26')];}var _0x232a8f=_0x3bc0('0x29');for(var _0x30d528 in _0x362a04){if(_0x362a04[_0x3bc0('0x2a')](_0x30d528)){_0x232a8f+=util[_0x3bc0('0x1f')]('<FL\x20val=\x22%s\x22>%s</FL>',entities['encodeXML'](_0x30d528),entities[_0x3bc0('0x2b')](_0x362a04[_0x30d528]));}}_0x232a8f+=_0x3bc0('0x2c');return request({'method':_0x3bc0('0x2d'),'uri':util[_0x3bc0('0x1f')](_0x3bc0('0x2e'),_0x39bb62['host']),'qs':{'authtoken':_0x39bb62[_0x3bc0('0x2f')],'scope':_0x3bc0('0x30'),'xmlData':_0x232a8f},'json':!![]})[_0x3bc0('0x31')](function(_0x405792){_0x405792=JSON['parse'](parser[_0x3bc0('0x32')](_0x405792));if(_0x405792[_0x3bc0('0x33')]){if(_0x405792[_0x3bc0('0x33')][_0x3bc0('0x34')]&&_0x405792[_0x3bc0('0x33')]['result']['recorddetail']){logger[_0x3bc0('0xa')](_0x3bc0('0x35'));return{'id':_0x405792['response'][_0x3bc0('0x34')][_0x3bc0('0x36')]['FL'][0x0]['$t']};}}throw new Error('Error\x20on\x20call\x20creation:\x20'+JSON[_0x3bc0('0x37')](_0x405792));});}function getUser(_0x204475,_0x48e331){_0x48e331&&logger['info'](_0x3bc0('0x38'),_0x48e331);return request({'method':_0x3bc0('0x39'),'uri':util['format'](_0x3bc0('0x3a'),_0x204475[_0x3bc0('0x3b')]),'qs':{'type':_0x3bc0('0x3c'),'authtoken':_0x204475[_0x3bc0('0x2f')],'scope':'crmapi'},'json':!![]})[_0x3bc0('0x31')](function(_0x492403){if(_0x492403['users']&&_0x492403['users'][_0x3bc0('0x3d')]){var _0x9812fa;if(_0x48e331){_0x9812fa=_[_0x3bc0('0x3e')](_0x492403[_0x3bc0('0x3f')][_0x3bc0('0x3d')],{'email':_0x48e331,'profile':'Standard'});}if(_0x9812fa){logger[_0x3bc0('0xa')](_0x3bc0('0x40'));}else{logger['info'](_0x3bc0('0x41'));_0x9812fa=_[_0x3bc0('0x3e')](_0x492403[_0x3bc0('0x3f')][_0x3bc0('0x3d')],{'profile':'Administrator'});}return _0x9812fa;}else{logger['error'](_0x3bc0('0x42'),JSON[_0x3bc0('0x37')](_0x492403));throw new Error(_0x3bc0('0x43')+JSON[_0x3bc0('0x37')](_0x492403));}});}function getEndUser(_0x2f9202,_0x44d428,_0x371826){logger[_0x3bc0('0xa')](_0x3bc0('0x44'),_0x371826);return request({'method':_0x3bc0('0x39'),'uri':util['format'](_0x3bc0('0x45'),_0x2f9202[_0x3bc0('0x3b')]),'qs':{'authtoken':_0x2f9202[_0x3bc0('0x2f')],'scope':_0x3bc0('0x30'),'criteria':util[_0x3bc0('0x1f')](_0x3bc0('0x46'),_0x371826)},'json':!![]})[_0x3bc0('0x31')](function(_0x230ae4){if(_0x230ae4[_0x3bc0('0x33')]&&_0x230ae4[_0x3bc0('0x33')][_0x3bc0('0x34')]){logger[_0x3bc0('0xa')](_0x3bc0('0x47'));var _0x88f9b8={};var _0x12f4ad=_0x230ae4[_0x3bc0('0x33')][_0x3bc0('0x34')][_0x3bc0('0x48')][_0x3bc0('0x49')]['no']?_0x230ae4[_0x3bc0('0x33')]['result'][_0x3bc0('0x48')][_0x3bc0('0x49')]['FL']:_0x230ae4[_0x3bc0('0x33')][_0x3bc0('0x34')][_0x3bc0('0x48')][_0x3bc0('0x49')][0x0]['FL'];for(var _0x1ec2e9=0x0,_0x18f7f0=_0x12f4ad[_0x3bc0('0x4a')];_0x1ec2e9<_0x18f7f0;_0x1ec2e9++){_0x88f9b8[_0x12f4ad[_0x1ec2e9][_0x3bc0('0x4b')]]=_0x12f4ad[_0x1ec2e9][_0x3bc0('0x4c')];}return _0x88f9b8;}else{return request({'method':_0x3bc0('0x39'),'uri':util[_0x3bc0('0x1f')](_0x3bc0('0x4d'),_0x2f9202[_0x3bc0('0x3b')]),'qs':{'authtoken':_0x2f9202[_0x3bc0('0x2f')],'scope':_0x3bc0('0x30'),'criteria':util['format'](_0x3bc0('0x46'),_0x371826)},'json':!![]})[_0x3bc0('0x31')](function(_0x275033){if(_0x275033[_0x3bc0('0x33')]&&_0x275033['response'][_0x3bc0('0x34')]){logger['info']('Enduser\x20found\x20in\x20Leads!');var _0x13819a={};var _0x2a7dc5=_0x275033[_0x3bc0('0x33')][_0x3bc0('0x34')][_0x3bc0('0x4e')][_0x3bc0('0x49')]['no']?_0x275033[_0x3bc0('0x33')]['result'][_0x3bc0('0x4e')][_0x3bc0('0x49')]['FL']:_0x275033['response']['result']['Leads'][_0x3bc0('0x49')][0x0]['FL'];for(var _0x1a8c25=0x0,_0x1b1d2f=_0x2a7dc5['length'];_0x1a8c25<_0x1b1d2f;_0x1a8c25++){_0x13819a[_0x2a7dc5[_0x1a8c25]['val']]=_0x2a7dc5[_0x1a8c25][_0x3bc0('0x4c')];}return _0x13819a;}else{logger[_0x3bc0('0xa')](_0x3bc0('0x4f'));_0x44d428=getName(_0x44d428);return request({'method':_0x3bc0('0x2d'),'uri':util[_0x3bc0('0x1f')](_0x3bc0('0x50'),_0x2f9202[_0x3bc0('0x3b')]),'qs':{'authtoken':_0x2f9202['authToken'],'scope':'crmapi','xmlData':util[_0x3bc0('0x1f')](_0x3bc0('0x51'),entities[_0x3bc0('0x2b')](_0x44d428[0x0]),entities['encodeXML'](_0x44d428[0x1]),_0x371826)},'json':!![]})[_0x3bc0('0x31')](function(_0x18c5c5){_0x18c5c5=JSON['parse'](parser[_0x3bc0('0x32')](_0x18c5c5));if(_0x18c5c5[_0x3bc0('0x33')]){if(_0x18c5c5[_0x3bc0('0x33')]['result']&&_0x18c5c5[_0x3bc0('0x33')][_0x3bc0('0x34')][_0x3bc0('0x36')]){logger[_0x3bc0('0xa')](_0x3bc0('0x52'));return request({'method':_0x3bc0('0x39'),'uri':util[_0x3bc0('0x1f')]('https://crm.%s/crm/private/json/Leads/getRecordById',_0x2f9202[_0x3bc0('0x3b')]),'qs':{'authtoken':_0x2f9202[_0x3bc0('0x2f')],'scope':'crmapi','id':_0x18c5c5[_0x3bc0('0x33')]['result'][_0x3bc0('0x36')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0x3bc0('0x53')+JSON[_0x3bc0('0x37')](_0x18c5c5));})[_0x3bc0('0x31')](function(_0xc64761){if(_0xc64761[_0x3bc0('0x33')]){if(_0xc64761[_0x3bc0('0x33')][_0x3bc0('0x34')]){var _0x37b994={};for(var _0x3da4d2=0x0,_0x207fd1=_0xc64761[_0x3bc0('0x33')][_0x3bc0('0x34')][_0x3bc0('0x4e')]['row']['FL'][_0x3bc0('0x4a')];_0x3da4d2<_0x207fd1;_0x3da4d2++){_0x37b994[_0xc64761[_0x3bc0('0x33')]['result'][_0x3bc0('0x4e')][_0x3bc0('0x49')]['FL'][_0x3da4d2][_0x3bc0('0x4b')]]=_0xc64761[_0x3bc0('0x33')][_0x3bc0('0x34')][_0x3bc0('0x4e')][_0x3bc0('0x49')]['FL'][_0x3da4d2]['content'];}return _0x37b994;}}throw new Error('Error\x20on\x20Lead\x20retrieve:\x20'+JSON[_0x3bc0('0x37')](_0xc64761));});}});}});}function request(_0x39e81e){logger[_0x3bc0('0x54')](_0x3bc0('0x55'),JSON[_0x3bc0('0x37')](_0x39e81e));return rp(_0x39e81e);}function getCustomFields(_0x4304b0,_0x111304){var _0x3971da={};if(_0x4304b0[_0x3bc0('0x4a')]>0x0){_[_0x3bc0('0x56')](_0x4304b0,function(_0xa0f8a7){if(_0xa0f8a7[_0x3bc0('0x57')]===_0x3bc0('0x58')&&_0xa0f8a7['idField']){_0x3971da[_0xa0f8a7[_0x3bc0('0x59')]]=_0xa0f8a7[_0x3bc0('0x4c')]['toString']();}else if(_0xa0f8a7[_0x3bc0('0x57')]==='variable'&&_0xa0f8a7['variableName']&&_0xa0f8a7['idField']&&_0x111304[_0xa0f8a7['variableName']]){_0x3971da[_0xa0f8a7[_0x3bc0('0x59')]]=_0x111304[_0xa0f8a7[_0x3bc0('0x5a')]][_0x3bc0('0x5b')]();}else if(_0xa0f8a7[_0x3bc0('0x57')]==='customVariable'&&_0xa0f8a7[_0x3bc0('0x5c')]&&_0xa0f8a7[_0x3bc0('0x5c')]['name']&&_0xa0f8a7[_0x3bc0('0x59')]&&_0x111304[_0xa0f8a7[_0x3bc0('0x5c')]['name']['toLowerCase']()]){_0x3971da[_0xa0f8a7[_0x3bc0('0x59')]]=_0x111304[_0xa0f8a7[_0x3bc0('0x5c')]['name'][_0x3bc0('0x5d')]()][_0x3bc0('0x5b')]();}});}return _0x3971da;}function getName(_0x24c2de){if(_0x24c2de[_0x3bc0('0x5e')]('\x20')>0x0){var _0xc9465e=_0x24c2de[_0x3bc0('0x5f')](/ (.+)/);if(_0xc9465e[0x1]){return _0xc9465e;}}return[_0x24c2de,_0x24c2de];}exports[_0x3bc0('0x60')]=function(_0x4e51b5,_0x434b09,_0x13a27d,_0x515088,_0x171549,_0x4b3520){var _0x31322a,_0x2d59db;if(_0x171549&&_0x171549[_0x3bc0('0x61')]){logger[_0x3bc0('0xa')]('[QUEUE]',_0x3bc0('0x62'));_0x434b09[_0x3bc0('0x63')]=util[_0x3bc0('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4b3520[_0x3bc0('0x64')],_0x434b09[_0x3bc0('0x65')],md5(_0x434b09[_0x3bc0('0x65')]));}else{_0x434b09['recordingURL']='';}return getUser(_0x4b3520,_0x515088[_0x3bc0('0x66')])[_0x3bc0('0x31')](function(_0x5860c9){_0x31322a=_0x5860c9;logger[_0x3bc0('0xa')](_0x3bc0('0x67'),_0x31322a['id']);return getEndUser(_0x4b3520,_0x434b09[_0x3bc0('0x68')],_0x434b09['calleridnum']);})[_0x3bc0('0x31')](function(_0x3d145d){_0x2d59db=_0x3d145d;logger[_0x3bc0('0xa')](_0x3bc0('0x69'),_0x2d59db[_0x3bc0('0x25')]||_0x2d59db['LEADID']);return getCall(_0x4b3520,_0x31322a,_0x2d59db,_0x13a27d,_0x434b09,'Inbound');})[_0x3bc0('0x31')](function(_0x556f3c){if(_0x556f3c){logger['info'](_0x3bc0('0x6a'),_0x556f3c['id']);logger[_0x3bc0('0xa')](_0x3bc0('0x6b'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3bc0('0x1f')](_0x3bc0('0x6c'),_0x515088[_0x3bc0('0x6d')]),'trigger:browser:url',{'uri':util[_0x3bc0('0x1f')]('https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s',_0x4b3520[_0x3bc0('0x3b')],_0x556f3c['id'])});}})[_0x3bc0('0x6e')](function(_0x1b0d53){logger[_0x3bc0('0x6f')](_0x3bc0('0x6b'),JSON[_0x3bc0('0x37')](_0x1b0d53));});};exports[_0x3bc0('0xd')]=function(_0xcb048,_0x1b1be1,_0xe13349,_0x3f0c6a,_0x3e8d54,_0x14ba65,_0x2aad4d){var _0x193bf0,_0x3486d6;if(_0x2aad4d&&_0x2aad4d[_0x3bc0('0x70')]&&_0x2aad4d[_0x3bc0('0x70')]!==_0x3bc0('0x71')){logger['info'](_0x3bc0('0x72'),_0x3bc0('0x62'));_0x1b1be1[_0x3bc0('0x63')]=util[_0x3bc0('0x1f')](_0x3bc0('0x73'),_0x14ba65[_0x3bc0('0x64')],_0x1b1be1['uniqueid'],md5(_0x1b1be1[_0x3bc0('0x65')]));}return getUser(_0x14ba65,_0x3f0c6a[_0x3bc0('0x66')])['then'](function(_0x14beb1){_0x193bf0=_0x14beb1;logger['info'](_0x3bc0('0x67'),_0x193bf0['id']);return getEndUser(_0x14ba65,_0x1b1be1[_0x3bc0('0x74')],_0x1b1be1['destcalleridnum']);})[_0x3bc0('0x31')](function(_0xaf720f){_0x3486d6=_0xaf720f;logger['info']('The\x20Enduser\x20ID\x20is:',_0x3486d6[_0x3bc0('0x25')]||_0x3486d6['LEADID']);return getCall(_0x14ba65,_0x193bf0,_0x3486d6,_0xe13349,_0x1b1be1,_0x3bc0('0x75'));})[_0x3bc0('0x31')](function(_0x2615bc){if(_0x2615bc){logger['info'](_0x3bc0('0x6a'),_0x2615bc['id']);logger['info']('[OUTBOUND]',_0x3bc0('0x76'));emit(util[_0x3bc0('0x1f')](_0x3bc0('0x6c'),_0x3f0c6a[_0x3bc0('0x6d')]),'trigger:browser:url',{'uri':util[_0x3bc0('0x1f')](_0x3bc0('0x77'),_0x14ba65['host'],_0x2615bc['id'])});}})['catch'](function(_0x5ce11f){logger[_0x3bc0('0x6f')]('[OUTBOUND]',JSON[_0x3bc0('0x37')](_0x5ce11f));});};exports['abandoned']=function(_0x26f6ee,_0x27951e,_0x45ec6a,_0x54f340,_0xf7886e,_0x4a8720){var _0xca5f69,_0x111c9d;if(_0xf7886e&&_0xf7886e[_0x3bc0('0x61')]){logger[_0x3bc0('0xa')](_0x3bc0('0x78'),_0x3bc0('0x62'));_0x27951e[_0x3bc0('0x63')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a8720[_0x3bc0('0x64')],_0x27951e[_0x3bc0('0x65')],md5(_0x27951e['uniqueid']));}else{_0x27951e[_0x3bc0('0x63')]='';}return getUser(_0x4a8720)[_0x3bc0('0x31')](function(_0x4fe621){_0xca5f69=_0x4fe621;logger[_0x3bc0('0xa')](_0x3bc0('0x67'),_0xca5f69['id']);return getEndUser(_0x4a8720,_0x27951e[_0x3bc0('0x68')],_0x27951e[_0x3bc0('0x79')]);})[_0x3bc0('0x31')](function(_0x451920){_0x111c9d=_0x451920;logger['info'](_0x3bc0('0x69'),_0x111c9d[_0x3bc0('0x25')]||_0x111c9d[_0x3bc0('0x26')]);return getCall(_0x4a8720,_0xca5f69,_0x111c9d,_0x45ec6a,_0x27951e,'Inbound');})[_0x3bc0('0x31')](function(_0xd020ad){if(_0xd020ad){logger[_0x3bc0('0xa')](_0x3bc0('0x6a'),_0xd020ad['id']);}})[_0x3bc0('0x6e')](function(_0x5418c4){logger['error'](_0x3bc0('0x78'),JSON[_0x3bc0('0x37')](_0x5418c4));});};
\ No newline at end of file
index 1b58b94..48827a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c5e=['request-promise','util','../../../../config/logger','exec','data1','toUpperCase','data2','GET','POST','data7','render','then','info','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20body:\x20%s','statusCode','body','catch','%s\x20%s\x20%s\x20[%s]:%s'];(function(_0x4539a0,_0x73d968){var _0x41823a=function(_0x3d6738){while(--_0x3d6738){_0x4539a0['push'](_0x4539a0['shift']());}};_0x41823a(++_0x73d968);}(_0x4c5e,0x169));var _0xe4c5=function(_0x284b0e,_0x593192){_0x284b0e=_0x284b0e-0x0;var _0xec7b80=_0x4c5e[_0x284b0e];return _0xec7b80;};'use strict';var rp=require(_0xe4c5('0x0'));var util=require(_0xe4c5('0x1'));var Mustache=require('mustache');var logger=require(_0xe4c5('0x2'))('trigger');exports[_0xe4c5('0x3')]=function(_0x45753e,_0x5e84b6){var _0x559bd7={'method':_0x45753e[_0xe4c5('0x4')][_0xe4c5('0x5')](),'uri':encodeURI(Mustache['render'](_0x45753e[_0xe4c5('0x6')],_0x5e84b6)),'json':!![],'resolveWithFullResponse':!![]};switch(_0x45753e[_0xe4c5('0x4')][_0xe4c5('0x5')]()){case _0xe4c5('0x7'):_0x559bd7['qs']=_0x5e84b6;break;case _0xe4c5('0x8'):_0x559bd7['body']=_0x45753e[_0xe4c5('0x9')]?Mustache[_0xe4c5('0xa')](_0x45753e[_0xe4c5('0x9')],_0x5e84b6):_0x5e84b6;break;}rp(_0x559bd7)[_0xe4c5('0xb')](function(_0x1c420e){logger[_0xe4c5('0xc')](util[_0xe4c5('0xd')](_0xe4c5('0xe'),_0x45753e['data1'],_0x45753e[_0xe4c5('0x6')],_0x1c420e[_0xe4c5('0xf')],_0x1c420e[_0xe4c5('0x10')]));})[_0xe4c5('0x11')](function(_0x3a17fb){logger['error'](util[_0xe4c5('0xd')](_0xe4c5('0x12'),_0x45753e['data1'],_0x45753e[_0xe4c5('0x6')],_0x3a17fb[_0xe4c5('0xf')],_0x3a17fb['name'],_0x3a17fb['message']));});};
\ No newline at end of file
+var _0xd487=['render','data2','POST','body','data7','info','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20body:\x20%s','%s\x20%s\x20%s\x20[%s]:%s','message','request-promise','util','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase'];(function(_0x4bf2d7,_0x3e2751){var _0x347507=function(_0x4e3bfb){while(--_0x4e3bfb){_0x4bf2d7['push'](_0x4bf2d7['shift']());}};_0x347507(++_0x3e2751);}(_0xd487,0x1cc));var _0x7d48=function(_0x598408,_0x5e6f74){_0x598408=_0x598408-0x0;var _0x560720=_0xd487[_0x598408];return _0x560720;};'use strict';var rp=require(_0x7d48('0x0'));var util=require(_0x7d48('0x1'));var Mustache=require(_0x7d48('0x2'));var logger=require(_0x7d48('0x3'))(_0x7d48('0x4'));exports[_0x7d48('0x5')]=function(_0x3e9c95,_0x2d1c50){var _0x16b114={'method':_0x3e9c95[_0x7d48('0x6')][_0x7d48('0x7')](),'uri':encodeURI(Mustache[_0x7d48('0x8')](_0x3e9c95[_0x7d48('0x9')],_0x2d1c50)),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3e9c95[_0x7d48('0x6')]['toUpperCase']()){case'GET':_0x16b114['qs']=_0x2d1c50;break;case _0x7d48('0xa'):_0x16b114[_0x7d48('0xb')]=_0x3e9c95[_0x7d48('0xc')]?Mustache[_0x7d48('0x8')](_0x3e9c95[_0x7d48('0xc')],_0x2d1c50):_0x2d1c50;break;}rp(_0x16b114)['then'](function(_0x143b49){logger[_0x7d48('0xd')](util[_0x7d48('0xe')](_0x7d48('0xf'),_0x3e9c95[_0x7d48('0x6')],_0x3e9c95[_0x7d48('0x9')],_0x143b49['statusCode'],_0x143b49['body']));})['catch'](function(_0x3a0b7f){logger['error'](util['format'](_0x7d48('0x10'),_0x3e9c95[_0x7d48('0x6')],_0x3e9c95[_0x7d48('0x9')],_0x3a0b7f['statusCode'],_0x3a0b7f['name'],_0x3a0b7f[_0x7d48('0x11')]));});};
\ No newline at end of file
index 419d42e..93a6444 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1280=['error','message','result','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','debug','rpc'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x1280,0xba));var _0x0128=function(_0x26b9cb,_0x12bc4c){_0x26b9cb=_0x26b9cb-0x0;var _0x3f44e6=_0x1280[_0x26b9cb];return _0x3f44e6;};'use strict';var jayson=require(_0x0128('0x0'));var BPromise=require(_0x0128('0x1'));var logger=require(_0x0128('0x2'))(_0x0128('0x3'));var client=jayson[_0x0128('0x4')][_0x0128('0x5')]({'port':0x2329});client[_0x0128('0x6')]=function(_0x3a3112,_0x403dd9){return new BPromise(function(_0x551461,_0x2c8eee){return client[_0x0128('0x7')](_0x3a3112,_0x403dd9)['then'](function(_0x589536){logger[_0x0128('0x8')](_0x0128('0x9'),_0x0128('0x3'),_0x3a3112,_0x403dd9,_0x589536);if(_0x589536[_0x0128('0xa')]){logger['error']('rpc',_0x0128('0x3'),_0x3a3112,_0x589536[_0x0128('0xa')]['message'],_0x403dd9);return _0x2c8eee(_0x589536[_0x0128('0xa')][_0x0128('0xb')]);}else{return _0x551461(_0x589536[_0x0128('0xc')]);}})['catch'](function(_0x1b1234){logger[_0x0128('0xa')](_0x0128('0x9'),_0x0128('0x3'),_0x3a3112,_0x1b1234,_0x403dd9);return _0x2c8eee(_0x1b1234);});});};module[_0x0128('0xd')]=client;
\ No newline at end of file
+var _0x0845=['error','message','result','catch','exports','jayson/promise','routing','client','http','Request','request','then'];(function(_0x3b0c27,_0x47d547){var _0x15baba=function(_0x540c3f){while(--_0x540c3f){_0x3b0c27['push'](_0x3b0c27['shift']());}};_0x15baba(++_0x47d547);}(_0x0845,0x125));var _0x5084=function(_0x1bdf21,_0x10dc9e){_0x1bdf21=_0x1bdf21-0x0;var _0x38255c=_0x0845[_0x1bdf21];return _0x38255c;};'use strict';var jayson=require(_0x5084('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0x5084('0x1'));var client=jayson[_0x5084('0x2')][_0x5084('0x3')]({'port':0x2329});client[_0x5084('0x4')]=function(_0x41255e,_0x26a738){return new BPromise(function(_0x4ec3e3,_0xd1319d){return client[_0x5084('0x5')](_0x41255e,_0x26a738)[_0x5084('0x6')](function(_0x5820a0){logger['debug']('rpc',_0x5084('0x1'),_0x41255e,_0x26a738,_0x5820a0);if(_0x5820a0[_0x5084('0x7')]){logger[_0x5084('0x7')]('rpc','routing',_0x41255e,_0x5820a0[_0x5084('0x7')][_0x5084('0x8')],_0x26a738);return _0xd1319d(_0x5820a0[_0x5084('0x7')]['message']);}else{return _0x4ec3e3(_0x5820a0[_0x5084('0x9')]);}})[_0x5084('0xa')](function(_0x36b4c9){logger['error']('rpc',_0x5084('0x1'),_0x41255e,_0x36b4c9,_0x26a738);return _0xd1319d(_0x36b4c9);});});};module[_0x5084('0xb')]=client;
\ No newline at end of file
index 07db4ff..6f5ee2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89a5=['mailAccounts','listen','catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','resolve','then','getMailAccounts'];(function(_0x3b6efe,_0x30db53){var _0x16789e=function(_0x2dc12a){while(--_0x2dc12a){_0x3b6efe['push'](_0x3b6efe['shift']());}};_0x16789e(++_0x30db53);}(_0x89a5,0x160));var _0x589a=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x89a5[_0x1d24eb];return _0x1dc576;};'use strict';var BPromise=require(_0x589a('0x0'));var server=require(_0x589a('0x1'));var Realtime=require(_0x589a('0x2'));var EmailChannel=require(_0x589a('0x3'));var mailAccount=require(_0x589a('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x589a('0x5')]()[_0x589a('0x6')](mailAccount[_0x589a('0x7')]())[_0x589a('0x6')](realtime['initMailAccounts']())[_0x589a('0x6')](function(){email['refresh'](realtime[_0x589a('0x8')]);return realtime;});}function main(){return server[_0x589a('0x9')](realtime,email)[_0x589a('0x6')](function(_0x269359){return initRealtime();})[_0x589a('0x6')](function(_0x56b36d){return setInterval(initRealtime,0x2710);})[_0x589a('0xa')](function(_0x45e500){console[_0x589a('0xb')](_0x45e500);});}main();
\ No newline at end of file
+var _0x8d53=['listen','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','resolve','then','getMailAccounts'];(function(_0xd04611,_0x6f7365){var _0x72e2db=function(_0x349948){while(--_0x349948){_0xd04611['push'](_0xd04611['shift']());}};_0x72e2db(++_0x6f7365);}(_0x8d53,0x1b1));var _0x38d5=function(_0x32c98a,_0x5e6eb0){_0x32c98a=_0x32c98a-0x0;var _0x1796d3=_0x8d53[_0x32c98a];return _0x1796d3;};'use strict';var BPromise=require(_0x38d5('0x0'));var server=require(_0x38d5('0x1'));var Realtime=require(_0x38d5('0x2'));var EmailChannel=require(_0x38d5('0x3'));var mailAccount=require(_0x38d5('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x38d5('0x5')]()[_0x38d5('0x6')](mailAccount[_0x38d5('0x7')]())[_0x38d5('0x6')](realtime['initMailAccounts']())[_0x38d5('0x6')](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x38d5('0x8')](realtime,email)[_0x38d5('0x6')](function(_0x23f026){return initRealtime();})[_0x38d5('0x6')](function(_0x3c4d84){return setInterval(initRealtime,0x2710);})['catch'](function(_0x2486e0){console['log'](_0x2486e0);});}main();
\ No newline at end of file
index 9c113b6..296e611 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27e0=['verify','then','verified','exports','md5','./imap','./smtp','../../../config/logger','email','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key','active','Imap','status','total','stringify','mailAccount:update','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','isNil','disabled','messageStatus','connected','name','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','catch','lastSync','sendMail','Smtp'];(function(_0x3d756d,_0xa4f656){var _0x313bbf=function(_0x34da53){while(--_0x34da53){_0x3d756d['push'](_0x3d756d['shift']());}};_0x313bbf(++_0xa4f656);}(_0x27e0,0x174));var _0x027e=function(_0x359f71,_0x1a12a2){_0x359f71=_0x359f71-0x0;var _0x4b6ec9=_0x27e0[_0x359f71];return _0x4b6ec9;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x027e('0x0'));var io=require('socket.io-emitter')({'host':'localhost','port':0x18eb});var EmailImap=require(_0x027e('0x1'));var EmailSmtp=require(_0x027e('0x2'));var logger=require(_0x027e('0x3'))(_0x027e('0x4'));var mailAccount=require(_0x027e('0x5'));var md5Accounts={};function EmailChannel(_0x70af2a){logger[_0x027e('0x6')](_0x027e('0x7'));this[_0x027e('0x8')]=_0x70af2a['mailAccounts'];this[_0x027e('0x9')]={};this[_0x027e('0xa')]=new EmailSmtp();}EmailChannel[_0x027e('0xb')][_0x027e('0xc')]=function(_0x3ed17e){var _0x176150=this['mailAccounts'][_0x3ed17e];var _0xf5c759={'id':_0x176150['id'],'name':_0x176150['name'],'key':_0x176150[_0x027e('0xd')],'active':_0x176150[_0x027e('0xe')],'Imap':{'status':_0x176150[_0x027e('0xf')][_0x027e('0x10')],'messageStatus':_0x176150[_0x027e('0xf')]['messageStatus'],'total':_0x176150[_0x027e('0xf')][_0x027e('0x11')]}};if(_['isNil'](md5Accounts[_0x3ed17e])){md5Accounts[_0x3ed17e]={};}var _0x373763=md5(JSON[_0x027e('0x12')](_0xf5c759));if(md5Accounts[_0x3ed17e][_0x027e('0x0')]!==_0x373763){md5Accounts[_0x3ed17e][_0x027e('0x0')]=_0x373763;io['emit'](_0x027e('0x13'),_0xf5c759);}};EmailChannel['prototype']['refresh']=function(_0x53ddae){for(var _0x11b56f in _0x53ddae){if(_0x53ddae[_0x027e('0x14')](_0x11b56f)){if(_0x53ddae[_0x11b56f][_0x027e('0xf')]&&_0x53ddae[_0x11b56f]['active']){var _0x494f20=_0x53ddae[_0x11b56f][_0x027e('0xf')];if(!this['imapAccounts'][_0x027e('0x14')](_0x494f20['id'])){this[_0x027e('0x9')][_0x494f20['id']]=new EmailImap(_0x494f20,_0x53ddae[_0x11b56f][_0x027e('0x4')]);this['imapAccounts'][_0x494f20['id']]['on'](_0x027e('0x15'),this[_0x027e('0x16')][_0x027e('0x17')](this,_0x11b56f));this['imapAccounts'][_0x494f20['id']]['on'](_0x027e('0x4'),this[_0x027e('0x18')][_0x027e('0x17')](this,_0x11b56f));this[_0x027e('0x9')][_0x494f20['id']]['on'](_0x027e('0x19'),this[_0x027e('0x1a')][_0x027e('0x17')](this,_0x11b56f));this[_0x027e('0x9')][_0x494f20['id']]['on'](_0x027e('0x1b'),this[_0x027e('0x1c')]['bind'](this,_0x11b56f));}}else{if(_[_0x027e('0x1d')](this[_0x027e('0x8')][_0x11b56f]['Imap'])){this[_0x027e('0x8')][_0x11b56f][_0x027e('0xf')]={};}this[_0x027e('0x8')][_0x11b56f]['Imap'][_0x027e('0x10')]=_0x027e('0x1e');this['mailAccounts'][_0x11b56f]['Imap'][_0x027e('0x1f')]='';this[_0x027e('0xc')](_0x11b56f);}}}};EmailChannel[_0x027e('0xb')][_0x027e('0x16')]=function(_0x2a4161,_0x1c3a15){if(this[_0x027e('0x8')][_0x2a4161]){this[_0x027e('0x8')][_0x2a4161][_0x027e('0xf')][_0x027e('0x10')]=_0x027e('0x20');this[_0x027e('0x8')][_0x2a4161][_0x027e('0xf')]['messageStatus']=_0x1c3a15[_0x027e('0x21')];if(_0x1c3a15['messages']){this['mailAccounts'][_0x2a4161][_0x027e('0xf')][_0x027e('0x11')]=_0x1c3a15['messages'][_0x027e('0x11')];}return this[_0x027e('0xc')](_0x2a4161);}};EmailChannel['prototype']['handleImapEmail']=function(_0x23611f,_0x4fe118){logger['info'](_0x027e('0x22'),_0x4fe118[_0x027e('0x23')],_0x4fe118[_0x027e('0x24')],_0x4fe118[_0x027e('0x25')],_0x23611f);if(this[_0x027e('0x8')][_0x23611f]){return mailAccount['notify'](_0x23611f,_0x4fe118)['then'](function(_0x235903){if(_0x235903){logger[_0x027e('0x6')]('Mail\x20accepted\x20from\x20routing');}})[_0x027e('0x26')](function(_0x177d50){logger[_0x027e('0x1b')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x027e('0x12')](_0x177d50));});}};EmailChannel[_0x027e('0xb')][_0x027e('0x1a')]=function(_0x4c3e40){if(this[_0x027e('0x8')][_0x4c3e40]&&this[_0x027e('0x8')][_0x4c3e40][_0x027e('0xf')]){if(this[_0x027e('0x9')][this['mailAccounts'][_0x4c3e40][_0x027e('0xf')]['id']]){delete this[_0x027e('0x9')][this[_0x027e('0x8')][_0x4c3e40][_0x027e('0xf')]['id']];}this[_0x027e('0x8')][_0x4c3e40][_0x027e('0xf')][_0x027e('0x27')]=moment();this[_0x027e('0xc')](_0x4c3e40);}};EmailChannel[_0x027e('0xb')][_0x027e('0x1c')]=function(_0x490494,_0x274c61){if(this[_0x027e('0x8')][_0x490494]){this[_0x027e('0x8')][_0x490494][_0x027e('0xf')][_0x027e('0x10')]='error';this[_0x027e('0x8')][_0x490494][_0x027e('0xf')][_0x027e('0x1f')]=_0x274c61;return this[_0x027e('0xc')](_0x490494);}};EmailChannel[_0x027e('0xb')][_0x027e('0x28')]=function(_0x2f0842,_0x19768d){return this[_0x027e('0xa')]['send'](_0x2f0842,_0x19768d);};EmailChannel[_0x027e('0xb')]['verifySmtp']=function(_0x4f50f2){var _0x19fa53=this;if(this[_0x027e('0x8')][_0x4f50f2['id']]){if(_[_0x027e('0x1d')](this[_0x027e('0x8')][_0x4f50f2['id']][_0x027e('0x29')])){this[_0x027e('0x8')][_0x4f50f2['id']][_0x027e('0x29')]={};}this[_0x027e('0x8')][_0x4f50f2['id']][_0x027e('0x29')][_0x027e('0x27')]=moment();return new BPromise(function(_0x16e5b5,_0x485251){return _0x19fa53[_0x027e('0xa')][_0x027e('0x2a')](_0x4f50f2)[_0x027e('0x2b')](function(_0x51cac3){_0x19fa53[_0x027e('0x8')][_0x4f50f2['id']][_0x027e('0x29')][_0x027e('0x10')]=_0x027e('0x2c');_0x19fa53[_0x027e('0x8')][_0x4f50f2['id']][_0x027e('0x29')][_0x027e('0x1f')]='';_0x19fa53[_0x027e('0xc')](_0x4f50f2['id']);_0x16e5b5(_0x51cac3);})[_0x027e('0x26')](function(_0x5d832e){_0x19fa53[_0x027e('0x8')][_0x4f50f2['id']][_0x027e('0x29')][_0x027e('0x10')]='error';_0x19fa53[_0x027e('0x8')][_0x4f50f2['id']][_0x027e('0x29')]['messageStatus']=_0x5d832e;_0x19fa53[_0x027e('0xc')](_0x4f50f2['id']);_0x485251(_0x5d832e);});});}return this[_0x027e('0xa')]['verify'](_0x4f50f2);};module[_0x027e('0x2d')]=EmailChannel;
\ No newline at end of file
+var _0x40ff=['error','handleImapError','isNil','disabled','connected','messages','total','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','verifySmtp','Smtp','verify','verified','lodash','bluebird','md5','socket.io-emitter','./imap','../../../config/logger','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','name','active','Imap','status','messageStatus','mailAccount:update','prototype','refresh','hasOwnProperty','email','handleImapBox','bind','handleImapEmail','end','handleImapEnd'];(function(_0x2ad6ae,_0x1291f8){var _0x53b5ff=function(_0x4344dc){while(--_0x4344dc){_0x2ad6ae['push'](_0x2ad6ae['shift']());}};_0x53b5ff(++_0x1291f8);}(_0x40ff,0x111));var _0xf40f=function(_0x2fb037,_0x7a2561){_0x2fb037=_0x2fb037-0x0;var _0x39b13b=_0x40ff[_0x2fb037];return _0x39b13b;};'use strict';var _=require(_0xf40f('0x0'));var moment=require('moment');var BPromise=require(_0xf40f('0x1'));var md5=require(_0xf40f('0x2'));var io=require(_0xf40f('0x3'))({'host':'localhost','port':0x18eb});var EmailImap=require(_0xf40f('0x4'));var EmailSmtp=require('./smtp');var logger=require(_0xf40f('0x5'))('email');var mailAccount=require(_0xf40f('0x6'));var md5Accounts={};function EmailChannel(_0x536784){logger['info'](_0xf40f('0x7'));this['mailAccounts']=_0x536784[_0xf40f('0x8')];this[_0xf40f('0x9')]={};this[_0xf40f('0xa')]=new EmailSmtp();}EmailChannel['prototype'][_0xf40f('0xb')]=function(_0x43570c){var _0x1dfc53=this[_0xf40f('0x8')][_0x43570c];var _0x2e5d5e={'id':_0x1dfc53['id'],'name':_0x1dfc53[_0xf40f('0xc')],'key':_0x1dfc53['key'],'active':_0x1dfc53[_0xf40f('0xd')],'Imap':{'status':_0x1dfc53[_0xf40f('0xe')][_0xf40f('0xf')],'messageStatus':_0x1dfc53[_0xf40f('0xe')][_0xf40f('0x10')],'total':_0x1dfc53[_0xf40f('0xe')]['total']}};if(_['isNil'](md5Accounts[_0x43570c])){md5Accounts[_0x43570c]={};}var _0x1012b9=md5(JSON['stringify'](_0x2e5d5e));if(md5Accounts[_0x43570c][_0xf40f('0x2')]!==_0x1012b9){md5Accounts[_0x43570c][_0xf40f('0x2')]=_0x1012b9;io[_0xf40f('0xb')](_0xf40f('0x11'),_0x2e5d5e);}};EmailChannel[_0xf40f('0x12')][_0xf40f('0x13')]=function(_0x52f5b6){for(var _0xc3103 in _0x52f5b6){if(_0x52f5b6[_0xf40f('0x14')](_0xc3103)){if(_0x52f5b6[_0xc3103][_0xf40f('0xe')]&&_0x52f5b6[_0xc3103]['active']){var _0x3eec31=_0x52f5b6[_0xc3103]['Imap'];if(!this['imapAccounts'][_0xf40f('0x14')](_0x3eec31['id'])){this['imapAccounts'][_0x3eec31['id']]=new EmailImap(_0x3eec31,_0x52f5b6[_0xc3103][_0xf40f('0x15')]);this['imapAccounts'][_0x3eec31['id']]['on']('box',this[_0xf40f('0x16')][_0xf40f('0x17')](this,_0xc3103));this['imapAccounts'][_0x3eec31['id']]['on'](_0xf40f('0x15'),this[_0xf40f('0x18')][_0xf40f('0x17')](this,_0xc3103));this[_0xf40f('0x9')][_0x3eec31['id']]['on'](_0xf40f('0x19'),this[_0xf40f('0x1a')]['bind'](this,_0xc3103));this[_0xf40f('0x9')][_0x3eec31['id']]['on'](_0xf40f('0x1b'),this[_0xf40f('0x1c')][_0xf40f('0x17')](this,_0xc3103));}}else{if(_[_0xf40f('0x1d')](this['mailAccounts'][_0xc3103][_0xf40f('0xe')])){this['mailAccounts'][_0xc3103][_0xf40f('0xe')]={};}this[_0xf40f('0x8')][_0xc3103][_0xf40f('0xe')][_0xf40f('0xf')]=_0xf40f('0x1e');this['mailAccounts'][_0xc3103][_0xf40f('0xe')][_0xf40f('0x10')]='';this['emit'](_0xc3103);}}}};EmailChannel[_0xf40f('0x12')][_0xf40f('0x16')]=function(_0x2e92d2,_0x1f7fa0){if(this[_0xf40f('0x8')][_0x2e92d2]){this[_0xf40f('0x8')][_0x2e92d2][_0xf40f('0xe')]['status']=_0xf40f('0x1f');this['mailAccounts'][_0x2e92d2][_0xf40f('0xe')][_0xf40f('0x10')]=_0x1f7fa0[_0xf40f('0xc')];if(_0x1f7fa0[_0xf40f('0x20')]){this['mailAccounts'][_0x2e92d2][_0xf40f('0xe')][_0xf40f('0x21')]=_0x1f7fa0[_0xf40f('0x20')][_0xf40f('0x21')];}return this[_0xf40f('0xb')](_0x2e92d2);}};EmailChannel['prototype']['handleImapEmail']=function(_0x573c3f,_0x5d429f){logger[_0xf40f('0x22')](_0xf40f('0x23'),_0x5d429f[_0xf40f('0x24')],_0x5d429f[_0xf40f('0x25')],_0x5d429f[_0xf40f('0x26')],_0x573c3f);if(this[_0xf40f('0x8')][_0x573c3f]){return mailAccount[_0xf40f('0x27')](_0x573c3f,_0x5d429f)[_0xf40f('0x28')](function(_0x5940ce){if(_0x5940ce){logger[_0xf40f('0x22')](_0xf40f('0x29'));}})[_0xf40f('0x2a')](function(_0xa53778){logger[_0xf40f('0x1b')](_0xf40f('0x2b'),JSON['stringify'](_0xa53778));});}};EmailChannel[_0xf40f('0x12')]['handleImapEnd']=function(_0x228dce){if(this['mailAccounts'][_0x228dce]&&this['mailAccounts'][_0x228dce][_0xf40f('0xe')]){if(this['imapAccounts'][this['mailAccounts'][_0x228dce][_0xf40f('0xe')]['id']]){delete this[_0xf40f('0x9')][this['mailAccounts'][_0x228dce][_0xf40f('0xe')]['id']];}this['mailAccounts'][_0x228dce][_0xf40f('0xe')][_0xf40f('0x2c')]=moment();this[_0xf40f('0xb')](_0x228dce);}};EmailChannel[_0xf40f('0x12')][_0xf40f('0x1c')]=function(_0x25560d,_0x14a243){if(this[_0xf40f('0x8')][_0x25560d]){this[_0xf40f('0x8')][_0x25560d][_0xf40f('0xe')]['status']=_0xf40f('0x1b');this[_0xf40f('0x8')][_0x25560d][_0xf40f('0xe')]['messageStatus']=_0x14a243;return this['emit'](_0x25560d);}};EmailChannel['prototype'][_0xf40f('0x2d')]=function(_0x5c2a82,_0x4df6c3){return this[_0xf40f('0xa')]['send'](_0x5c2a82,_0x4df6c3);};EmailChannel[_0xf40f('0x12')][_0xf40f('0x2e')]=function(_0x439296){var _0xe0a93c=this;if(this[_0xf40f('0x8')][_0x439296['id']]){if(_[_0xf40f('0x1d')](this['mailAccounts'][_0x439296['id']][_0xf40f('0x2f')])){this[_0xf40f('0x8')][_0x439296['id']][_0xf40f('0x2f')]={};}this['mailAccounts'][_0x439296['id']][_0xf40f('0x2f')][_0xf40f('0x2c')]=moment();return new BPromise(function(_0x2e46c9,_0x49707e){return _0xe0a93c['smtp'][_0xf40f('0x30')](_0x439296)[_0xf40f('0x28')](function(_0x5cf3ae){_0xe0a93c[_0xf40f('0x8')][_0x439296['id']]['Smtp'][_0xf40f('0xf')]=_0xf40f('0x31');_0xe0a93c[_0xf40f('0x8')][_0x439296['id']][_0xf40f('0x2f')]['messageStatus']='';_0xe0a93c[_0xf40f('0xb')](_0x439296['id']);_0x2e46c9(_0x5cf3ae);})[_0xf40f('0x2a')](function(_0x472a77){_0xe0a93c[_0xf40f('0x8')][_0x439296['id']]['Smtp']['status']=_0xf40f('0x1b');_0xe0a93c[_0xf40f('0x8')][_0x439296['id']][_0xf40f('0x2f')]['messageStatus']=_0x472a77;_0xe0a93c[_0xf40f('0xb')](_0x439296['id']);_0x49707e(_0x472a77);});});}return this['smtp'][_0xf40f('0x30')](_0x439296);};module['exports']=EmailChannel;
\ No newline at end of file
index 7cbb63c..7a447c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb62e=['mailbox','account','getAccount','ready','handleReady','bind','once','end','handleEnd','error','connect','inherits','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','email','anonymous@xcally.com','openBox','handleOpenBox','emit','readUnseen','prototype','handleCloseBox','handleError','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchError','textCode','hasOwnProperty','upperFirst','path','util','imap','lodash','mailparser','simpleParser','events','EventEmitter','./utils','../../../config/logger'];(function(_0x37700f,_0x14317a){var _0x105194=function(_0x2cff1e){while(--_0x2cff1e){_0x37700f['push'](_0x37700f['shift']());}};_0x105194(++_0x14317a);}(_0xb62e,0x1de));var _0xeb62=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xb62e[_0x2d7f0e];return _0x110b07;};'use strict';var fs=require('fs');var path=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var Imap=require(_0xeb62('0x2'));var _=require(_0xeb62('0x3'));var rs=require('randomstring');var simpleParser=require(_0xeb62('0x4'))[_0xeb62('0x5')];var EventEmitter=require(_0xeb62('0x6'))[_0xeb62('0x7')];var utils=require(_0xeb62('0x8'));var logger=require(_0xeb62('0x9'))('email');function EmailImap(_0x3ec879,_0x455e1a){this[_0xeb62('0xa')]='INBOX';this[_0xeb62('0xb')]=this[_0xeb62('0xc')](_0x3ec879,_0x455e1a);this[_0xeb62('0x2')]=new Imap(this[_0xeb62('0xb')]);this['imap']['once'](_0xeb62('0xd'),this[_0xeb62('0xe')][_0xeb62('0xf')](this));this[_0xeb62('0x2')][_0xeb62('0x10')](_0xeb62('0x11'),this[_0xeb62('0x12')][_0xeb62('0xf')](this));this[_0xeb62('0x2')]['on'](_0xeb62('0x13'),this['handleError'][_0xeb62('0xf')](this));this[_0xeb62('0x2')][_0xeb62('0x14')]();}util[_0xeb62('0x15')](EmailImap,EventEmitter);EmailImap['prototype'][_0xeb62('0xc')]=function(_0x2fbad2,_0x23fb15){var _0x4da178={'connTimeout':_0x2fbad2[_0xeb62('0x16')]?_0x2fbad2[_0xeb62('0x16')]*0x3e8:0x2710,'authTimeout':_0x2fbad2[_0xeb62('0x17')]?_0x2fbad2['authTimeout']*0x3e8:0x1388};if(_[_0xeb62('0x18')](_0x2fbad2[_0xeb62('0x19')])){if(_0x2fbad2[_0xeb62('0x1a')]){_0x4da178[_0xeb62('0x1b')]=_0x2fbad2[_0xeb62('0x1b')];_0x4da178[_0xeb62('0x1c')]=_0x2fbad2[_0xeb62('0x1c')];}_0x4da178[_0xeb62('0x1d')]=_0x2fbad2[_0xeb62('0x1d')];_0x4da178[_0xeb62('0x1e')]=_0x2fbad2[_0xeb62('0x1e')]||0x3e1;if(_0x2fbad2[_0xeb62('0x1f')]){_0x4da178[_0xeb62('0x1f')]=!![];}else{_0x4da178['tls']=![];_0x4da178[_0xeb62('0x20')]=_0xeb62('0x21');}}else{_0x4da178[_0xeb62('0x1b')]=_0x2fbad2[_0xeb62('0x1b')];_0x4da178[_0xeb62('0x1c')]=_0x2fbad2[_0xeb62('0x1c')];_0x4da178[_0xeb62('0x1d')]=utils['getHost'](_0x2fbad2['service']);_0x4da178[_0xeb62('0x1e')]=0x3e1;_0x4da178[_0xeb62('0x1f')]=!![];}_0x4da178[_0xeb62('0x22')]=_0x23fb15||_0x2fbad2[_0xeb62('0x1b')]||_0xeb62('0x23');return _0x4da178;};EmailImap['prototype']['handleReady']=function(){this[_0xeb62('0x2')][_0xeb62('0x24')](this[_0xeb62('0xa')],![],this[_0xeb62('0x25')]['bind'](this));};EmailImap['prototype'][_0xeb62('0x25')]=function(_0x4dbc2c,_0x448327){if(_0x4dbc2c){this['handleError'](_0x4dbc2c,!![]);}else{this[_0xeb62('0x26')]('box',_0x448327);this[_0xeb62('0x27')]();}};EmailImap[_0xeb62('0x28')][_0xeb62('0x29')]=function(_0x4e4268){if(_0x4e4268){this[_0xeb62('0x2a')](_0x4e4268,!![]);}else{this[_0xeb62('0x2')][_0xeb62('0x11')]();}};EmailImap[_0xeb62('0x28')][_0xeb62('0x27')]=function(){this[_0xeb62('0x2')]['search']([_0xeb62('0x2b')],this[_0xeb62('0x2c')]['bind'](this));};EmailImap[_0xeb62('0x28')][_0xeb62('0x2c')]=function(_0x2c967c,_0x2c308c){if(_0x2c967c){this[_0xeb62('0x2a')](_0x2c967c,!![]);}else{if(_0x2c308c['length']){try{var _0x4b58af=this[_0xeb62('0x2')][_0xeb62('0x2d')](_0x2c308c,{'bodies':'','markSeen':!![]});_0x4b58af['on'](_0xeb62('0x2e'),this[_0xeb62('0x2f')][_0xeb62('0xf')](this));_0x4b58af[_0xeb62('0x10')](_0xeb62('0x13'),this['handleFetchError'][_0xeb62('0xf')](this));_0x4b58af['once']('end',this[_0xeb62('0x30')][_0xeb62('0xf')](this));}catch(_0x4978e8){logger[_0xeb62('0x13')](_0x4978e8);}}else{this['imap'][_0xeb62('0x31')](!![],this[_0xeb62('0x29')]['bind'](this));}}};EmailImap[_0xeb62('0x28')][_0xeb62('0x2f')]=function(_0x5914c9,_0x1b3a60){_0x5914c9['on'](_0xeb62('0x32'),this[_0xeb62('0x33')][_0xeb62('0xf')](this));_0x5914c9['once'](_0xeb62('0x34'),this[_0xeb62('0x35')]['bind'](this));_0x5914c9['once'](_0xeb62('0x11'),this[_0xeb62('0x36')]['bind'](this));};EmailImap[_0xeb62('0x28')][_0xeb62('0x33')]=function(_0x11eadb,_0x1f839a){simpleParser(_0x11eadb,this[_0xeb62('0x37')][_0xeb62('0xf')](this));};EmailImap[_0xeb62('0x28')]['handleMessageAttributes']=function(_0x54ea4b){};EmailImap[_0xeb62('0x28')][_0xeb62('0x36')]=function(){};EmailImap[_0xeb62('0x28')][_0xeb62('0x37')]=function(_0x4a544a,_0x834232){if(_0x4a544a){logger['error'](_0x4a544a);}else{this[_0xeb62('0x26')](_0xeb62('0x22'),utils[_0xeb62('0x38')](this[_0xeb62('0xb')],_0x834232));}};EmailImap[_0xeb62('0x28')][_0xeb62('0x30')]=function(){this[_0xeb62('0x2')][_0xeb62('0x31')](!![],this['handleCloseBox'][_0xeb62('0xf')](this));};EmailImap[_0xeb62('0x28')][_0xeb62('0x39')]=function(_0x6ffbb){this['handleError'](_0x6ffbb);this['imap'][_0xeb62('0x31')](!![],this[_0xeb62('0x29')]['bind'](this));};EmailImap[_0xeb62('0x28')][_0xeb62('0x12')]=function(){this['emit'](_0xeb62('0x11'));};EmailImap['prototype'][_0xeb62('0x2a')]=function(_0x47b815,_0x114544){logger['error'](_0xeb62('0x2a'),this[_0xeb62('0xb')][_0xeb62('0x22')],JSON['stringify'](_0x47b815));var _0x5464e6='';if(_0x47b815){if(_0x47b815[_0xeb62('0x3a')]){_0x5464e6=_0x47b815[_0xeb62('0x3a')];}else{for(var _0xb1c958 in _0x47b815){if(_0x47b815[_0xeb62('0x3b')](_0xb1c958)){_0x5464e6+=_[_0xeb62('0x3c')](_0xb1c958)+':\x20'+_0x47b815[_0xb1c958]+'\x0a';}}}}if(_0x114544){this['imap'][_0xeb62('0x11')]();}else{this['emit'](_0xeb62('0x13'),_0x5464e6);this['emit'](_0xeb62('0x11'));}};module['exports']=EmailImap;
\ No newline at end of file
+var _0x263f=['handleMessageEnd','handleSimpleParser','handleFetchEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','events','EventEmitter','./utils','email','INBOX','account','getAccount','once','ready','handleReady','bind','handleEnd','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','anonymous@xcally.com','openBox','mailbox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','error','handleFetchError','closeBox','body','handleMessageBody','handleMessageAttributes'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x263f,0x182));var _0xf263=function(_0x3f6e70,_0x27410e){_0x3f6e70=_0x3f6e70-0x0;var _0x4c2c2e=_0x263f[_0x3f6e70];return _0x4c2c2e;};'use strict';var fs=require('fs');var path=require(_0xf263('0x0'));var util=require(_0xf263('0x1'));var Imap=require(_0xf263('0x2'));var _=require(_0xf263('0x3'));var rs=require(_0xf263('0x4'));var simpleParser=require(_0xf263('0x5'))['simpleParser'];var EventEmitter=require(_0xf263('0x6'))[_0xf263('0x7')];var utils=require(_0xf263('0x8'));var logger=require('../../../config/logger')(_0xf263('0x9'));function EmailImap(_0xdb2fc1,_0x4c7ab2){this['mailbox']=_0xf263('0xa');this[_0xf263('0xb')]=this[_0xf263('0xc')](_0xdb2fc1,_0x4c7ab2);this[_0xf263('0x2')]=new Imap(this['account']);this[_0xf263('0x2')][_0xf263('0xd')](_0xf263('0xe'),this[_0xf263('0xf')][_0xf263('0x10')](this));this[_0xf263('0x2')][_0xf263('0xd')]('end',this[_0xf263('0x11')]['bind'](this));this[_0xf263('0x2')]['on']('error',this['handleError'][_0xf263('0x10')](this));this[_0xf263('0x2')][_0xf263('0x12')]();}util[_0xf263('0x13')](EmailImap,EventEmitter);EmailImap[_0xf263('0x14')][_0xf263('0xc')]=function(_0xc75366,_0x559c6c){var _0x2f40d8={'connTimeout':_0xc75366['connTimeout']?_0xc75366[_0xf263('0x15')]*0x3e8:0x2710,'authTimeout':_0xc75366[_0xf263('0x16')]?_0xc75366[_0xf263('0x16')]*0x3e8:0x1388};if(_[_0xf263('0x17')](_0xc75366[_0xf263('0x18')])){if(_0xc75366[_0xf263('0x19')]){_0x2f40d8[_0xf263('0x1a')]=_0xc75366['user'];_0x2f40d8['password']=_0xc75366[_0xf263('0x1b')];}_0x2f40d8[_0xf263('0x1c')]=_0xc75366[_0xf263('0x1c')];_0x2f40d8[_0xf263('0x1d')]=_0xc75366[_0xf263('0x1d')]||0x3e1;if(_0xc75366['tls']){_0x2f40d8[_0xf263('0x1e')]=!![];}else{_0x2f40d8['tls']=![];_0x2f40d8[_0xf263('0x1f')]=_0xf263('0x20');}}else{_0x2f40d8[_0xf263('0x1a')]=_0xc75366['user'];_0x2f40d8[_0xf263('0x1b')]=_0xc75366[_0xf263('0x1b')];_0x2f40d8[_0xf263('0x1c')]=utils['getHost'](_0xc75366[_0xf263('0x18')]);_0x2f40d8[_0xf263('0x1d')]=0x3e1;_0x2f40d8[_0xf263('0x1e')]=!![];}_0x2f40d8[_0xf263('0x9')]=_0x559c6c||_0xc75366[_0xf263('0x1a')]||_0xf263('0x21');return _0x2f40d8;};EmailImap[_0xf263('0x14')][_0xf263('0xf')]=function(){this[_0xf263('0x2')][_0xf263('0x22')](this[_0xf263('0x23')],![],this['handleOpenBox']['bind'](this));};EmailImap['prototype'][_0xf263('0x24')]=function(_0x4175a6,_0x231748){if(_0x4175a6){this[_0xf263('0x25')](_0x4175a6,!![]);}else{this[_0xf263('0x26')](_0xf263('0x27'),_0x231748);this[_0xf263('0x28')]();}};EmailImap[_0xf263('0x14')][_0xf263('0x29')]=function(_0xbeabe5){if(_0xbeabe5){this[_0xf263('0x25')](_0xbeabe5,!![]);}else{this['imap'][_0xf263('0x2a')]();}};EmailImap['prototype'][_0xf263('0x28')]=function(){this['imap'][_0xf263('0x2b')]([_0xf263('0x2c')],this['handleReadUnseen']['bind'](this));};EmailImap[_0xf263('0x14')][_0xf263('0x2d')]=function(_0x2dcebc,_0x327698){if(_0x2dcebc){this[_0xf263('0x25')](_0x2dcebc,!![]);}else{if(_0x327698[_0xf263('0x2e')]){try{var _0x3caa96=this[_0xf263('0x2')]['fetch'](_0x327698,{'bodies':'','markSeen':!![]});_0x3caa96['on'](_0xf263('0x2f'),this[_0xf263('0x30')][_0xf263('0x10')](this));_0x3caa96[_0xf263('0xd')](_0xf263('0x31'),this[_0xf263('0x32')][_0xf263('0x10')](this));_0x3caa96[_0xf263('0xd')](_0xf263('0x2a'),this['handleFetchEnd'][_0xf263('0x10')](this));}catch(_0x5a202e){logger['error'](_0x5a202e);}}else{this[_0xf263('0x2')][_0xf263('0x33')](!![],this['handleCloseBox'][_0xf263('0x10')](this));}}};EmailImap[_0xf263('0x14')]['handleFetchMessage']=function(_0x2f28ac,_0x3e8b4f){_0x2f28ac['on'](_0xf263('0x34'),this[_0xf263('0x35')][_0xf263('0x10')](this));_0x2f28ac[_0xf263('0xd')]('attributes',this[_0xf263('0x36')][_0xf263('0x10')](this));_0x2f28ac['once']('end',this[_0xf263('0x37')][_0xf263('0x10')](this));};EmailImap[_0xf263('0x14')][_0xf263('0x35')]=function(_0x4a3e44,_0x476850){simpleParser(_0x4a3e44,this[_0xf263('0x38')][_0xf263('0x10')](this));};EmailImap[_0xf263('0x14')][_0xf263('0x36')]=function(_0x49c9a1){};EmailImap[_0xf263('0x14')][_0xf263('0x37')]=function(){};EmailImap[_0xf263('0x14')]['handleSimpleParser']=function(_0x1ece85,_0x47837b){if(_0x1ece85){logger[_0xf263('0x31')](_0x1ece85);}else{this[_0xf263('0x26')](_0xf263('0x9'),utils['parser'](this[_0xf263('0xb')],_0x47837b));}};EmailImap[_0xf263('0x14')][_0xf263('0x39')]=function(){this['imap'][_0xf263('0x33')](!![],this[_0xf263('0x29')][_0xf263('0x10')](this));};EmailImap['prototype'][_0xf263('0x32')]=function(_0x5db415){this[_0xf263('0x25')](_0x5db415);this[_0xf263('0x2')][_0xf263('0x33')](!![],this['handleCloseBox']['bind'](this));};EmailImap['prototype'][_0xf263('0x11')]=function(){this[_0xf263('0x26')]('end');};EmailImap['prototype'][_0xf263('0x25')]=function(_0x1e1dbf,_0x476402){logger[_0xf263('0x31')](_0xf263('0x25'),this['account'][_0xf263('0x9')],JSON[_0xf263('0x3a')](_0x1e1dbf));var _0x35c59b='';if(_0x1e1dbf){if(_0x1e1dbf[_0xf263('0x3b')]){_0x35c59b=_0x1e1dbf[_0xf263('0x3b')];}else{for(var _0x4f5e48 in _0x1e1dbf){if(_0x1e1dbf[_0xf263('0x3c')](_0x4f5e48)){_0x35c59b+=_[_0xf263('0x3d')](_0x4f5e48)+':\x20'+_0x1e1dbf[_0x4f5e48]+'\x0a';}}}}if(_0x476402){this[_0xf263('0x2')]['end']();}else{this['emit'](_0xf263('0x31'),_0x35c59b);this['emit']('end');}};module[_0xf263('0x3e')]=EmailImap;
\ No newline at end of file
index a2e4df8..5fa652d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d82=['createTransport','sendMail','toString','verify','Not\x20verifired','exports','nodemailer','bluebird','prototype','send'];(function(_0x3f5182,_0x54d1d9){var _0x7d826e=function(_0x310a46){while(--_0x310a46){_0x3f5182['push'](_0x3f5182['shift']());}};_0x7d826e(++_0x54d1d9);}(_0x0d82,0xd8));var _0x20d8=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0d82[_0x4b369d];return _0x571a98;};'use strict';var nodemailer=require(_0x20d8('0x0'));var BPromise=require(_0x20d8('0x1'));function EmailSmtp(){}EmailSmtp[_0x20d8('0x2')][_0x20d8('0x3')]=function(_0x12d577,_0x2f9d4d){return new BPromise(function(_0x5f2e5c,_0x2ded22){var _0x36f99f=nodemailer[_0x20d8('0x4')](_0x12d577);_0x36f99f[_0x20d8('0x5')](_0x2f9d4d,function(_0x119de0,_0x5441d5){if(_0x119de0){_0x2ded22(_0x119de0[_0x20d8('0x6')]());}else{_0x5f2e5c(_0x5441d5);}});});};EmailSmtp[_0x20d8('0x2')][_0x20d8('0x7')]=function(_0x97d743){return new BPromise(function(_0x3ca4ab,_0x274c9f){var _0x108306=nodemailer[_0x20d8('0x4')](_0x97d743);_0x108306[_0x20d8('0x7')](function(_0x5a6f47,_0x249d90){if(_0x5a6f47){_0x274c9f(_0x5a6f47['toString']());}else{if(_0x249d90){_0x3ca4ab(_0x249d90);}else{_0x274c9f(_0x20d8('0x8'));}}});});};module[_0x20d8('0x9')]=EmailSmtp;
\ No newline at end of file
+var _0x1613=['toString','Not\x20verifired','nodemailer','bluebird','prototype','createTransport','sendMail','verify'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1613,0x102));var _0x3161=function(_0x192635,_0x498b00){_0x192635=_0x192635-0x0;var _0x18da32=_0x1613[_0x192635];return _0x18da32;};'use strict';var nodemailer=require(_0x3161('0x0'));var BPromise=require(_0x3161('0x1'));function EmailSmtp(){}EmailSmtp[_0x3161('0x2')]['send']=function(_0x30f402,_0x4f15e3){return new BPromise(function(_0x2304c8,_0x142840){var _0xabecc6=nodemailer[_0x3161('0x3')](_0x30f402);_0xabecc6[_0x3161('0x4')](_0x4f15e3,function(_0x401b01,_0x51ceda){if(_0x401b01){_0x142840(_0x401b01['toString']());}else{_0x2304c8(_0x51ceda);}});});};EmailSmtp[_0x3161('0x2')][_0x3161('0x5')]=function(_0x5775d1){return new BPromise(function(_0xa6911d,_0x5ac42f){var _0x5a5775=nodemailer['createTransport'](_0x5775d1);_0x5a5775['verify'](function(_0x6f6627,_0x2241d5){if(_0x6f6627){_0x5ac42f(_0x6f6627[_0x3161('0x6')]());}else{if(_0x2241d5){_0xa6911d(_0x2241d5);}else{_0x5ac42f(_0x3161('0x7'));}}});});};module['exports']=EmailSmtp;
\ No newline at end of file
index 551b69d..cc5d3c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36fa=['%s-%s','now','join','root','server/files/attachments/','writeFileSync','content','push','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','127.0.0.1','moment','randomstring','path','util','email','head','value','address','anonymous','generate','@xcally.com','name','split','length','slice','Anonymous','isEmpty','parser','from','subject','messageId','inReplyTo','date','format','YYYY-MM-DD\x20HH:mm:ss','html','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originTo','includes','originCc','attachments','type','attachment','filename','attachment-'];(function(_0x1ee351,_0x54261b){var _0x245aaf=function(_0x3e4b65){while(--_0x3e4b65){_0x1ee351['push'](_0x1ee351['shift']());}};_0x245aaf(++_0x54261b);}(_0x36fa,0x118));var _0xa36f=function(_0x23223d,_0x59bf84){_0x23223d=_0x23223d-0x0;var _0x51dbc5=_0x36fa[_0x23223d];return _0x51dbc5;};'use strict';var _=require('lodash');var moment=require(_0xa36f('0x0'));var random=require(_0xa36f('0x1'));var fs=require('fs');var path=require(_0xa36f('0x2'));var util=require(_0xa36f('0x3'));var logger=require('../../../config/logger')(_0xa36f('0x4'));var config=require('../../../config/environment');function getAddress(_0x15b734){var _0x5dd478=_[_0xa36f('0x5')](_0x15b734[_0xa36f('0x6')]);return _0x5dd478&&_0x5dd478['address']?_0x5dd478[_0xa36f('0x7')]:_0xa36f('0x8')+random[_0xa36f('0x9')](0x6)+_0xa36f('0xa');}function getFirstName(_0x48ec82){var _0xc9ae10=_[_0xa36f('0x5')](_0x48ec82[_0xa36f('0x6')]);if(_0xc9ae10&&_0xc9ae10[_0xa36f('0xb')]){var _0x771afd=_0xc9ae10[_0xa36f('0xb')][_0xa36f('0xc')](/\s+/);return _0x771afd[_0xa36f('0xd')]?_0x771afd[_0xa36f('0xe')](0x0,-0x1)['join']('\x20'):_0xc9ae10[_0xa36f('0xb')];}return _0xa36f('0xf');}function getLastName(_0x202270){var _0xcb5657=_[_0xa36f('0x5')](_0x202270[_0xa36f('0x6')]);if(_0xcb5657&&_0xcb5657['name']){var _0x121c63=_0xcb5657['name'][_0xa36f('0xc')](/\s+/);return _0x121c63['length']>0x1?_0x121c63['pop']():'';}return'';}function getMails(_0x42e8fd,_0x53649a){var _0x38f97e='';for(var _0x17ed50=0x0;_0x17ed50<_0x53649a[_0xa36f('0x6')][_0xa36f('0xd')];_0x17ed50+=0x1){if(_0x53649a[_0xa36f('0x6')][_0x17ed50][_0xa36f('0x7')]!==_0x42e8fd){if(!_[_0xa36f('0x10')](_0x38f97e)){_0x38f97e+=',';}_0x38f97e+=_0x53649a[_0xa36f('0x6')][_0x17ed50][_0xa36f('0xb')]||_0x53649a[_0xa36f('0x6')][_0x17ed50][_0xa36f('0x7')]||'';_0x38f97e+='\x20<';_0x38f97e+=_0x53649a['value'][_0x17ed50][_0xa36f('0x7')]?_0x53649a[_0xa36f('0x6')][_0x17ed50][_0xa36f('0x7')]:'anonymous'+random['generate'](0x6)+'@xcally.com';_0x38f97e+='>';}}return _0x38f97e;}exports[_0xa36f('0x11')]=function(_0x170855,_0x33304b){var _0x52afa8={'from':getAddress(_0x33304b[_0xa36f('0x12')]),'firstName':getFirstName(_0x33304b[_0xa36f('0x12')]),'lastName':getLastName(_0x33304b[_0xa36f('0x12')]),'mapKey':'email','message':{'from':getMails(_0x170855[_0xa36f('0x4')],_0x33304b[_0xa36f('0x12')]),'to':_0x170855[_0xa36f('0x4')],'cc':'','subject':_0x33304b[_0xa36f('0x13')]||'','messageId':_0x33304b[_0xa36f('0x14')],'inReplyTo':_0x33304b[_0xa36f('0x15')],'sentAt':moment(_0x33304b[_0xa36f('0x16')])[_0xa36f('0x17')](_0xa36f('0x18')),'attach':![],'attachments':[]}};if(_0x33304b[_0xa36f('0x19')]){var _0x37c8d9=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x37c8d9['test'](_0x33304b['html'])){_0x33304b[_0xa36f('0x19')]=_0x33304b[_0xa36f('0x19')]['replace'](_0x37c8d9,'');}_0x52afa8[_0xa36f('0x1a')]=_0x33304b[_0xa36f('0x19')];}else{_0x52afa8[_0xa36f('0x1a')]=_0x33304b[_0xa36f('0x1b')];}if(_0x52afa8[_0xa36f('0x1a')]){_0x52afa8['body']=_0x52afa8[_0xa36f('0x1a')]['replace'](/<a\s+/gi,_0xa36f('0x1c'));}if(_0x33304b['to']){_0x52afa8[_0xa36f('0x1d')][_0xa36f('0x1e')]=getMails(null,_0x33304b['to']);var _0x16b534=getMails(_0x170855[_0xa36f('0x4')],_0x33304b['to']);if(!_[_0xa36f('0x10')](_0x16b534)){_0x52afa8[_0xa36f('0x1d')]['cc']+=_0x16b534;}}if(_0x33304b['cc']){_0x52afa8[_0xa36f('0x1d')]['originCc']=getMails(null,_0x33304b['cc']);var _0x1151eb=getMails(_0x170855[_0xa36f('0x4')],_0x33304b['cc']);if(!_['isEmpty'](_0x1151eb)){if(!_[_0xa36f('0x10')](_0x52afa8[_0xa36f('0x1d')]['cc'])){_0x52afa8[_0xa36f('0x1d')]['cc']+=',';}_0x52afa8[_0xa36f('0x1d')]['cc']+=_0x1151eb;}}if(!_[_0xa36f('0x1f')](_0x52afa8[_0xa36f('0x1d')][_0xa36f('0x1e')],_0x170855['email'])&&!_[_0xa36f('0x1f')](_0x52afa8[_0xa36f('0x1d')][_0xa36f('0x20')],_0x170855['email'])){_0x52afa8[_0xa36f('0x1d')]['bcc']=_0x170855[_0xa36f('0x4')];}if(_0x33304b['attachments']&&_0x33304b[_0xa36f('0x21')][_0xa36f('0xd')]){_0x52afa8['message']['attach']=_0x33304b[_0xa36f('0x21')]['length'];for(var _0x13ec7f=0x0,_0xb609d1,_0x485682,_0x6c56bc;_0x13ec7f<_0x33304b[_0xa36f('0x21')][_0xa36f('0xd')];_0x13ec7f+=0x1){if(_0x33304b['attachments'][_0x13ec7f][_0xa36f('0x22')]===_0xa36f('0x23')){_0x6c56bc=_0x33304b['attachments'][_0x13ec7f][_0xa36f('0x24')]||_0xa36f('0x25')+_0x13ec7f;_0xb609d1=util[_0xa36f('0x17')](_0xa36f('0x26'),Date[_0xa36f('0x27')](),_0x6c56bc);_0x485682=path[_0xa36f('0x28')](config[_0xa36f('0x29')],_0xa36f('0x2a'),_0xb609d1);fs[_0xa36f('0x2b')](_0x485682,_0x33304b['attachments'][_0x13ec7f][_0xa36f('0x2c')]);_0x52afa8[_0xa36f('0x1d')]['attachments'][_0xa36f('0x2d')]({'name':_0x6c56bc,'basename':_0xb609d1,'type':_0x33304b[_0xa36f('0x21')][_0x13ec7f]['contentType'],'filepath':_0x485682});}}}return _0x52afa8;};exports['getHost']=function(_0x5bfeb9){switch(_0x5bfeb9){case _0xa36f('0x2e'):return _0xa36f('0x2f');case _0xa36f('0x30'):return _0xa36f('0x31');case _0xa36f('0x32'):return'imap-mail.outlook.com';case _0xa36f('0x33'):return'outlook.office365.com';}return _0xa36f('0x34');};
\ No newline at end of file
+var _0x2171=['originTo','message','originCc','includes','attachments','attach','type','attachment-','format','%s-%s','root','server/files/attachments/','content','contentType','getHost','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','../../../config/logger','email','../../../config/environment','value','address','anonymous','generate','@xcally.com','head','name','split','length','slice','join','Anonymous','pop','isEmpty','from','subject','messageId','inReplyTo','YYYY-MM-DD\x20HH:mm:ss','html','replace','body','textAsHtml','<a\x20target=\x22_blank\x22\x20'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x2171,0x155));var _0x1217=function(_0x1706f5,_0xdcebbd){_0x1706f5=_0x1706f5-0x0;var _0x1b6ce4=_0x2171[_0x1706f5];return _0x1b6ce4;};'use strict';var _=require(_0x1217('0x0'));var moment=require(_0x1217('0x1'));var random=require(_0x1217('0x2'));var fs=require('fs');var path=require('path');var util=require('util');var logger=require(_0x1217('0x3'))(_0x1217('0x4'));var config=require(_0x1217('0x5'));function getAddress(_0x2898a7){var _0x54abcf=_['head'](_0x2898a7[_0x1217('0x6')]);return _0x54abcf&&_0x54abcf[_0x1217('0x7')]?_0x54abcf[_0x1217('0x7')]:_0x1217('0x8')+random[_0x1217('0x9')](0x6)+_0x1217('0xa');}function getFirstName(_0x554337){var _0x403e2f=_[_0x1217('0xb')](_0x554337[_0x1217('0x6')]);if(_0x403e2f&&_0x403e2f[_0x1217('0xc')]){var _0xef5815=_0x403e2f[_0x1217('0xc')][_0x1217('0xd')](/\s+/);return _0xef5815[_0x1217('0xe')]?_0xef5815[_0x1217('0xf')](0x0,-0x1)[_0x1217('0x10')]('\x20'):_0x403e2f[_0x1217('0xc')];}return _0x1217('0x11');}function getLastName(_0x471797){var _0x2b77f2=_[_0x1217('0xb')](_0x471797[_0x1217('0x6')]);if(_0x2b77f2&&_0x2b77f2[_0x1217('0xc')]){var _0x5cd810=_0x2b77f2[_0x1217('0xc')][_0x1217('0xd')](/\s+/);return _0x5cd810[_0x1217('0xe')]>0x1?_0x5cd810[_0x1217('0x12')]():'';}return'';}function getMails(_0x46eaac,_0x4b5a13){var _0x3ccc47='';for(var _0x44b30b=0x0;_0x44b30b<_0x4b5a13['value']['length'];_0x44b30b+=0x1){if(_0x4b5a13[_0x1217('0x6')][_0x44b30b][_0x1217('0x7')]!==_0x46eaac){if(!_[_0x1217('0x13')](_0x3ccc47)){_0x3ccc47+=',';}_0x3ccc47+=_0x4b5a13[_0x1217('0x6')][_0x44b30b][_0x1217('0xc')]||_0x4b5a13[_0x1217('0x6')][_0x44b30b][_0x1217('0x7')]||'';_0x3ccc47+='\x20<';_0x3ccc47+=_0x4b5a13[_0x1217('0x6')][_0x44b30b]['address']?_0x4b5a13[_0x1217('0x6')][_0x44b30b][_0x1217('0x7')]:_0x1217('0x8')+random[_0x1217('0x9')](0x6)+_0x1217('0xa');_0x3ccc47+='>';}}return _0x3ccc47;}exports['parser']=function(_0x5c9348,_0x1a218f){var _0x30c9a8={'from':getAddress(_0x1a218f[_0x1217('0x14')]),'firstName':getFirstName(_0x1a218f[_0x1217('0x14')]),'lastName':getLastName(_0x1a218f[_0x1217('0x14')]),'mapKey':_0x1217('0x4'),'message':{'from':getMails(_0x5c9348['email'],_0x1a218f[_0x1217('0x14')]),'to':_0x5c9348['email'],'cc':'','subject':_0x1a218f[_0x1217('0x15')]||'','messageId':_0x1a218f[_0x1217('0x16')],'inReplyTo':_0x1a218f[_0x1217('0x17')],'sentAt':moment(_0x1a218f['date'])['format'](_0x1217('0x18')),'attach':![],'attachments':[]}};if(_0x1a218f[_0x1217('0x19')]){var _0x5f3c3d=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x5f3c3d['test'](_0x1a218f[_0x1217('0x19')])){_0x1a218f['html']=_0x1a218f[_0x1217('0x19')][_0x1217('0x1a')](_0x5f3c3d,'');}_0x30c9a8[_0x1217('0x1b')]=_0x1a218f[_0x1217('0x19')];}else{_0x30c9a8[_0x1217('0x1b')]=_0x1a218f[_0x1217('0x1c')];}if(_0x30c9a8[_0x1217('0x1b')]){_0x30c9a8[_0x1217('0x1b')]=_0x30c9a8[_0x1217('0x1b')][_0x1217('0x1a')](/<a\s+/gi,_0x1217('0x1d'));}if(_0x1a218f['to']){_0x30c9a8['message'][_0x1217('0x1e')]=getMails(null,_0x1a218f['to']);var _0x478734=getMails(_0x5c9348[_0x1217('0x4')],_0x1a218f['to']);if(!_[_0x1217('0x13')](_0x478734)){_0x30c9a8[_0x1217('0x1f')]['cc']+=_0x478734;}}if(_0x1a218f['cc']){_0x30c9a8[_0x1217('0x1f')][_0x1217('0x20')]=getMails(null,_0x1a218f['cc']);var _0x1faf2c=getMails(_0x5c9348['email'],_0x1a218f['cc']);if(!_[_0x1217('0x13')](_0x1faf2c)){if(!_[_0x1217('0x13')](_0x30c9a8[_0x1217('0x1f')]['cc'])){_0x30c9a8[_0x1217('0x1f')]['cc']+=',';}_0x30c9a8['message']['cc']+=_0x1faf2c;}}if(!_['includes'](_0x30c9a8['message'][_0x1217('0x1e')],_0x5c9348['email'])&&!_[_0x1217('0x21')](_0x30c9a8[_0x1217('0x1f')][_0x1217('0x20')],_0x5c9348[_0x1217('0x4')])){_0x30c9a8[_0x1217('0x1f')]['bcc']=_0x5c9348['email'];}if(_0x1a218f[_0x1217('0x22')]&&_0x1a218f[_0x1217('0x22')][_0x1217('0xe')]){_0x30c9a8[_0x1217('0x1f')][_0x1217('0x23')]=_0x1a218f[_0x1217('0x22')][_0x1217('0xe')];for(var _0x3dde51=0x0,_0x1c6fa7,_0x43082d,_0x21e8d6;_0x3dde51<_0x1a218f[_0x1217('0x22')][_0x1217('0xe')];_0x3dde51+=0x1){if(_0x1a218f[_0x1217('0x22')][_0x3dde51][_0x1217('0x24')]==='attachment'){_0x21e8d6=_0x1a218f['attachments'][_0x3dde51]['filename']||_0x1217('0x25')+_0x3dde51;_0x1c6fa7=util[_0x1217('0x26')](_0x1217('0x27'),Date['now'](),_0x21e8d6);_0x43082d=path['join'](config[_0x1217('0x28')],_0x1217('0x29'),_0x1c6fa7);fs['writeFileSync'](_0x43082d,_0x1a218f[_0x1217('0x22')][_0x3dde51][_0x1217('0x2a')]);_0x30c9a8[_0x1217('0x1f')]['attachments']['push']({'name':_0x21e8d6,'basename':_0x1c6fa7,'type':_0x1a218f[_0x1217('0x22')][_0x3dde51][_0x1217('0x2b')],'filepath':_0x43082d});}}}return _0x30c9a8;};exports[_0x1217('0x2c')]=function(_0x3dd939){switch(_0x3dd939){case _0x1217('0x2d'):return _0x1217('0x2e');case _0x1217('0x2f'):return'imap.mail.yahoo.com';case _0x1217('0x30'):return _0x1217('0x31');case _0x1217('0x32'):return _0x1217('0x33');}return _0x1217('0x34');};
\ No newline at end of file
index a9890eb..01b2fd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc04=['SERV','active','Imap','Smtp','exports','lodash','name','Service','key'];(function(_0x5dea5d,_0x500563){var _0x18f74a=function(_0xdea2eb){while(--_0xdea2eb){_0x5dea5d['push'](_0x5dea5d['shift']());}};_0x18f74a(++_0x500563);}(_0xcc04,0x101));var _0x4cc0=function(_0x3ce449,_0x43090c){_0x3ce449=_0x3ce449-0x0;var _0x4ec22f=_0xcc04[_0x3ce449];return _0x4ec22f;};'use strict';var _=require(_0x4cc0('0x0'));function MailAccount(_0x496f73){this['id']=_0x496f73['id']||0x0;this[_0x4cc0('0x1')]=_0x496f73[_0x4cc0('0x1')]||_0x4cc0('0x2');this[_0x4cc0('0x3')]=_0x496f73[_0x4cc0('0x3')]||_0x4cc0('0x4');this[_0x4cc0('0x5')]=_0x496f73['active']||![];this[_0x4cc0('0x6')]=_0x496f73['Imap']||[];this[_0x4cc0('0x7')]=_0x496f73[_0x4cc0('0x7')]||[];}module[_0x4cc0('0x8')]=MailAccount;
\ No newline at end of file
+var _0x59ab=['key','active','Imap','Smtp','exports','lodash','name','Service'];(function(_0x37abf0,_0xb0cabf){var _0x416d51=function(_0x4311c5){while(--_0x4311c5){_0x37abf0['push'](_0x37abf0['shift']());}};_0x416d51(++_0xb0cabf);}(_0x59ab,0x1e5));var _0xb59a=function(_0x366647,_0xd7065c){_0x366647=_0x366647-0x0;var _0x54aed1=_0x59ab[_0x366647];return _0x54aed1;};'use strict';var _=require(_0xb59a('0x0'));function MailAccount(_0x58cf29){this['id']=_0x58cf29['id']||0x0;this[_0xb59a('0x1')]=_0x58cf29[_0xb59a('0x1')]||_0xb59a('0x2');this[_0xb59a('0x3')]=_0x58cf29['key']||'SERV';this[_0xb59a('0x4')]=_0x58cf29['active']||![];this[_0xb59a('0x5')]=_0x58cf29[_0xb59a('0x5')]||[];this[_0xb59a('0x6')]=_0x58cf29['Smtp']||[];}module[_0xb59a('0x7')]=MailAccount;
\ No newline at end of file
index 552b21b..33340ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1c=['hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','mailAccounts','length','isUndefined','merge','lodash','../model/mailAccount','mapKeys'];(function(_0x301261,_0x1ef00e){var _0x402210=function(_0x5dd08e){while(--_0x5dd08e){_0x301261['push'](_0x301261['shift']());}};_0x402210(++_0x1ef00e);}(_0xed1c,0xe4));var _0xced1=function(_0x1fb23c,_0x1ab111){_0x1fb23c=_0x1fb23c-0x0;var _0x57d511=_0xed1c[_0x1fb23c];return _0x57d511;};'use strict';var _=require(_0xced1('0x0'));var MailAccount=require(_0xced1('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x55da99,_0x5abe0f,_0x4c3102){var _0x424db6=_[_0xced1('0x2')](_0x55da99,function(_0x79202e,_0x47a45c){return _0x79202e[_0x4c3102];});for(var _0x1e23a9 in _0x5abe0f){if(_0x5abe0f[_0xced1('0x3')](_0x1e23a9)){if(!_0x424db6[_0x1e23a9]){delete _0x5abe0f[_0x1e23a9];}}}}Realtime[_0xced1('0x4')][_0xced1('0x5')]=function(_0x59399e,_0x2bcf42){for(var _0x38bca8 in _0x2bcf42){if(_0x59399e[_0xced1('0x3')](_0x38bca8)){_0x59399e[_0x38bca8]=_0x2bcf42[_0x38bca8];}}};Realtime[_0xced1('0x4')][_0xced1('0x6')]=function(){var _0x3221b6=this;return function(_0x325dd2){if(_0x325dd2){freeIsNotKey(_0x325dd2,_0x3221b6[_0xced1('0x7')],'id');for(var _0x5c902f=0x0,_0x82c84e={},_0x59c820={};_0x5c902f<_0x325dd2[_0xced1('0x8')];_0x5c902f+=0x1){_0x82c84e=_0x325dd2[_0x5c902f];if(_[_0xced1('0x9')](_0x3221b6[_0xced1('0x7')][_0x82c84e['id']])){_0x3221b6[_0xced1('0x7')][_0x82c84e['id']]=new MailAccount(_0x82c84e);}else{_[_0xced1('0xa')](_0x3221b6[_0xced1('0x7')][_0x82c84e['id']],_0x82c84e);}}}return _0x3221b6[_0xced1('0x7')];};};module['exports']=Realtime;
\ No newline at end of file
+var _0x8f4c=['prototype','initMailAccounts','length','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x3f7e8b,_0x7291d1){var _0x4eb892=function(_0x4ed54e){while(--_0x4ed54e){_0x3f7e8b['push'](_0x3f7e8b['shift']());}};_0x4eb892(++_0x7291d1);}(_0x8f4c,0x113));var _0xc8f4=function(_0x29b372,_0x14a80c){_0x29b372=_0x29b372-0x0;var _0x36ba6b=_0x8f4c[_0x29b372];return _0x36ba6b;};'use strict';var _=require(_0xc8f4('0x0'));var MailAccount=require(_0xc8f4('0x1'));var Realtime=function(){this[_0xc8f4('0x2')]={};};function freeIsNotKey(_0x43926b,_0x19893b,_0x134d73){var _0x580083=_[_0xc8f4('0x3')](_0x43926b,function(_0x47350d,_0x133764){return _0x47350d[_0x134d73];});for(var _0x56c9b1 in _0x19893b){if(_0x19893b[_0xc8f4('0x4')](_0x56c9b1)){if(!_0x580083[_0x56c9b1]){delete _0x19893b[_0x56c9b1];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x520063,_0x373506){for(var _0x48c39d in _0x373506){if(_0x520063[_0xc8f4('0x4')](_0x48c39d)){_0x520063[_0x48c39d]=_0x373506[_0x48c39d];}}};Realtime[_0xc8f4('0x5')][_0xc8f4('0x6')]=function(){var _0x39ed63=this;return function(_0x34f05f){if(_0x34f05f){freeIsNotKey(_0x34f05f,_0x39ed63['mailAccounts'],'id');for(var _0x38c41b=0x0,_0x191b92={},_0x2fba62={};_0x38c41b<_0x34f05f[_0xc8f4('0x7')];_0x38c41b+=0x1){_0x191b92=_0x34f05f[_0x38c41b];if(_['isUndefined'](_0x39ed63[_0xc8f4('0x2')][_0x191b92['id']])){_0x39ed63['mailAccounts'][_0x191b92['id']]=new MailAccount(_0x191b92);}else{_[_0xc8f4('0x8')](_0x39ed63[_0xc8f4('0x2')][_0x191b92['id']],_0x191b92);}}}return _0x39ed63[_0xc8f4('0x2')];};};module[_0xc8f4('0x9')]=Realtime;
\ No newline at end of file
index d105e1c..e8eac9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x720e=['NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','service','email','active','key','ListId','TemplateId','Smtp','getMailAccount'];(function(_0x13c071,_0x4b70da){var _0x419adb=function(_0x22c496){while(--_0x22c496){_0x13c071['push'](_0x13c071['shift']());}};_0x419adb(++_0x4b70da);}(_0x720e,0x1b3));var _0xe720=function(_0x3e6b2f,_0x1ffa07){_0x3e6b2f=_0x3e6b2f-0x0;var _0x323215=_0x720e[_0x3e6b2f];return _0x323215;};'use strict';var client=require(_0xe720('0x0'));exports[_0xe720('0x1')]=function(){return function(){return client[_0xe720('0x2')](_0xe720('0x3'),{'options':{'attributes':['id',_0xe720('0x4'),_0xe720('0x5'),_0xe720('0x6'),_0xe720('0x7'),_0xe720('0x8'),_0xe720('0x9'),_0xe720('0xa')],'raw':![],'include':[{'model':'MailServerIn','as':'Imap'},{'model':'MailServerOut','as':_0xe720('0xb')}]},'log':_0xe720('0xc')});};};exports['notify']=function(_0x19c0eb,_0x10453d){return client[_0xe720('0x2')](_0xe720('0xd'),{'account':{'id':_0x19c0eb},'body':_0x10453d,'log':_0xe720('0xd')});};
\ No newline at end of file
+var _0x01e8=['getMailAccount','NotifyMailAccount','../client','getMailAccounts','Request','name','email','key','TemplateId','MailServerIn','MailServerOut','Smtp'];(function(_0x5ed608,_0x53d5a7){var _0x2a1fa7=function(_0x5639f5){while(--_0x5639f5){_0x5ed608['push'](_0x5ed608['shift']());}};_0x2a1fa7(++_0x53d5a7);}(_0x01e8,0x6e));var _0x801e=function(_0x20463f,_0x4cc37a){_0x20463f=_0x20463f-0x0;var _0x143ee4=_0x01e8[_0x20463f];return _0x143ee4;};'use strict';var client=require(_0x801e('0x0'));exports[_0x801e('0x1')]=function(){return function(){return client[_0x801e('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0x801e('0x3'),'service',_0x801e('0x4'),'active',_0x801e('0x5'),'ListId',_0x801e('0x6')],'raw':![],'include':[{'model':_0x801e('0x7'),'as':'Imap'},{'model':_0x801e('0x8'),'as':_0x801e('0x9')}]},'log':_0x801e('0xa')});};};exports['notify']=function(_0x5c9ea3,_0x3c74d7){return client[_0x801e('0x2')]('NotifyMailAccount',{'account':{'id':_0x5c9ea3},'body':_0x3c74d7,'log':_0x801e('0xb')});};
\ No newline at end of file
index cecc7ee..c76ca43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa486=['http','stringify','listen','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','lodash','email','sendMail','account','message','then','catch','verifySmtp','Verified','error','values','mailAccounts','length','Imap','password','Smtp','pass','server'];(function(_0x5371e4,_0x212348){var _0x2bbf6d=function(_0x1b3e8d){while(--_0x1b3e8d){_0x5371e4['push'](_0x5371e4['shift']());}};_0x2bbf6d(++_0x212348);}(_0xa486,0x17d));var _0x6a48=function(_0x566f16,_0x46d625){_0x566f16=_0x566f16-0x0;var _0x1eb22a=_0xa486[_0x566f16];return _0x1eb22a;};'use strict';var jayson=require(_0x6a48('0x0'));var BPromise=require('bluebird');var _=require(_0x6a48('0x1'));var logger=require('../../../config/logger')(_0x6a48('0x2'));exports['listen']=function(_0x3ffe67,_0x414c8e){return new BPromise(function(_0x11e1f3,_0x24451d){var _0x452070={'SendMail':function(_0x226d37){var _0x29c0eb=this;return new Promise(function(_0x3d81f7,_0x124af7){_0x414c8e[_0x6a48('0x3')](_0x226d37[_0x6a48('0x4')],_0x226d37[_0x6a48('0x5')])[_0x6a48('0x6')](function(_0x6dbc6){_0x3d81f7({'code':0xc8,'message':_0x6dbc6});})[_0x6a48('0x7')](function(_0xbd313a){_0x124af7(_0x29c0eb['error'](0x1f4,_0xbd313a));});});},'VerifySmtp':function(_0x3960b0){var _0x526836=this;return new Promise(function(_0x17bc14,_0x454dbd){_0x414c8e[_0x6a48('0x8')](_0x3960b0[_0x6a48('0x4')])[_0x6a48('0x6')](function(_0x3aec54){_0x17bc14({'code':0xc8,'message':_0x6a48('0x9')});})[_0x6a48('0x7')](function(_0x3f099a){_0x454dbd(_0x526836[_0x6a48('0xa')](0x1f4,_0x3f099a));});});},'MailAccounts':function(_0x1ef5c7){return new Promise(function(_0x94f1d1,_0x334e78){var _0x2df927=_[_0x6a48('0xb')](_0x3ffe67[_0x6a48('0xc')]);for(var _0xcbcb4b=0x0;_0xcbcb4b<_0x2df927[_0x6a48('0xd')];_0xcbcb4b+=0x1){if(_0x2df927[_0xcbcb4b][_0x6a48('0xe')]&&_0x2df927[_0xcbcb4b][_0x6a48('0xe')][_0x6a48('0xf')]){delete _0x2df927[_0xcbcb4b][_0x6a48('0xe')][_0x6a48('0xf')];}if(_0x2df927[_0xcbcb4b][_0x6a48('0x10')]&&_0x2df927[_0xcbcb4b][_0x6a48('0x10')][_0x6a48('0x11')]){delete _0x2df927[_0xcbcb4b][_0x6a48('0x10')][_0x6a48('0x11')];}}_0x94f1d1({'count':_0x2df927['length'],'rows':_0x2df927});});}};var _0xab0913=jayson[_0x6a48('0x12')](_0x452070)[_0x6a48('0x13')]();_0xab0913['on'](_0x6a48('0xa'),function(_0x51a4ef){logger[_0x6a48('0xa')](JSON[_0x6a48('0x14')](_0x51a4ef));return _0x24451d(_0x51a4ef);});_0xab0913[_0x6a48('0x15')](0x232b,'127.0.0.1',function(){console[_0x6a48('0x16')](_0x6a48('0x17'),0x232b);return _0x11e1f3(_0x6a48('0x18')+0x232b);});});};
\ No newline at end of file
+var _0x55f1=['lodash','../../../config/logger','email','listen','sendMail','account','message','then','catch','error','verifySmtp','Verified','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise'];(function(_0x3acb98,_0x29b96f){var _0x3db46b=function(_0x1cf479){while(--_0x1cf479){_0x3acb98['push'](_0x3acb98['shift']());}};_0x3db46b(++_0x29b96f);}(_0x55f1,0x9b));var _0x155f=function(_0x381c8e,_0xee9936){_0x381c8e=_0x381c8e-0x0;var _0x56504e=_0x55f1[_0x381c8e];return _0x56504e;};'use strict';var jayson=require(_0x155f('0x0'));var BPromise=require('bluebird');var _=require(_0x155f('0x1'));var logger=require(_0x155f('0x2'))(_0x155f('0x3'));exports[_0x155f('0x4')]=function(_0x53478b,_0x13e2af){return new BPromise(function(_0x2089cc,_0x5c3d6c){var _0x5cd807={'SendMail':function(_0xd6ee05){var _0x4bf0f6=this;return new Promise(function(_0x8565ec,_0x22e07f){_0x13e2af[_0x155f('0x5')](_0xd6ee05[_0x155f('0x6')],_0xd6ee05[_0x155f('0x7')])[_0x155f('0x8')](function(_0x1b268d){_0x8565ec({'code':0xc8,'message':_0x1b268d});})[_0x155f('0x9')](function(_0x100e9a){_0x22e07f(_0x4bf0f6[_0x155f('0xa')](0x1f4,_0x100e9a));});});},'VerifySmtp':function(_0x11c946){var _0x39d85a=this;return new Promise(function(_0x5b9e3b,_0x9fb9a){_0x13e2af[_0x155f('0xb')](_0x11c946[_0x155f('0x6')])[_0x155f('0x8')](function(_0x49a4d0){_0x5b9e3b({'code':0xc8,'message':_0x155f('0xc')});})[_0x155f('0x9')](function(_0x18fd42){_0x9fb9a(_0x39d85a['error'](0x1f4,_0x18fd42));});});},'MailAccounts':function(_0x517753){return new Promise(function(_0x2aaa3c,_0x137330){var _0x4b9e0c=_[_0x155f('0xd')](_0x53478b[_0x155f('0xe')]);for(var _0x2fa0d4=0x0;_0x2fa0d4<_0x4b9e0c[_0x155f('0xf')];_0x2fa0d4+=0x1){if(_0x4b9e0c[_0x2fa0d4]['Imap']&&_0x4b9e0c[_0x2fa0d4][_0x155f('0x10')][_0x155f('0x11')]){delete _0x4b9e0c[_0x2fa0d4]['Imap'][_0x155f('0x11')];}if(_0x4b9e0c[_0x2fa0d4][_0x155f('0x12')]&&_0x4b9e0c[_0x2fa0d4][_0x155f('0x12')][_0x155f('0x13')]){delete _0x4b9e0c[_0x2fa0d4][_0x155f('0x12')][_0x155f('0x13')];}}_0x2aaa3c({'count':_0x4b9e0c[_0x155f('0xf')],'rows':_0x4b9e0c});});}};var _0x343a1e=jayson[_0x155f('0x14')](_0x5cd807)[_0x155f('0x15')]();_0x343a1e['on'](_0x155f('0xa'),function(_0x3bdede){logger[_0x155f('0xa')](JSON[_0x155f('0x16')](_0x3bdede));return _0x5c3d6c(_0x3bdede);});_0x343a1e[_0x155f('0x4')](0x232b,_0x155f('0x17'),function(){console['log'](_0x155f('0x18'),0x232b);return _0x2089cc(_0x155f('0x19')+0x232b);});});};
\ No newline at end of file
index a68b810..fd9f060 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3212=['socket.io','adapter','socket.io-redis','localhost','../../config/triggers','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','sticky-session','../../config/environment','createServer','timeout','port'];(function(_0x4a44b3,_0x28ce0e){var _0x58b125=function(_0x2056e4){while(--_0x2056e4){_0x4a44b3['push'](_0x4a44b3['shift']());}};_0x58b125(++_0x28ce0e);}(_0x3212,0xc1));var _0x2321=function(_0x44bdde,_0x502182){_0x44bdde=_0x44bdde-0x0;var _0x157efc=_0x3212[_0x44bdde];return _0x157efc;};'use strict';var http=require(_0x2321('0x0'));var express=require(_0x2321('0x1'));var sticky=require(_0x2321('0x2'));var config=require(_0x2321('0x3'));var app=express();var server=http[_0x2321('0x4')](app);server[_0x2321('0x5')]=0xdbba0;if(sticky['listen'](server,config[_0x2321('0x6')])){var socketio=require(_0x2321('0x7'))(server,{'transports':['websocket','polling']});socketio[_0x2321('0x8')](require(_0x2321('0x9'))({'host':_0x2321('0xa'),'port':0x18eb}));require(_0x2321('0xb'))[_0x2321('0xc')]();require('../../config/socketio')[_0x2321('0xc')](socketio);require(_0x2321('0xd'))[_0x2321('0xc')](app);require(_0x2321('0xe'))[_0x2321('0xc')](app);}else{server[_0x2321('0xf')](_0x2321('0x10'),function(){console[_0x2321('0x11')](_0x2321('0x12'),config[_0x2321('0x6')]);});}exports=module[_0x2321('0x13')]=app;
\ No newline at end of file
+var _0xfa6a=['log','Express\x20server\x20listening\x20on\x20port\x20%d!','http','express','sticky-session','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','socket.io-redis','../../config/triggers','../../config/socketio','default','../../routes','once','listening'];(function(_0x252d7a,_0xcba710){var _0x31ba06=function(_0x4768e5){while(--_0x4768e5){_0x252d7a['push'](_0x252d7a['shift']());}};_0x31ba06(++_0xcba710);}(_0xfa6a,0x145));var _0xafa6=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xfa6a[_0x599f41];return _0x2e4d58;};'use strict';var http=require(_0xafa6('0x0'));var express=require(_0xafa6('0x1'));var sticky=require(_0xafa6('0x2'));var config=require(_0xafa6('0x3'));var app=express();var server=http[_0xafa6('0x4')](app);server[_0xafa6('0x5')]=0xdbba0;if(sticky[_0xafa6('0x6')](server,config[_0xafa6('0x7')])){var socketio=require(_0xafa6('0x8'))(server,{'transports':[_0xafa6('0x9'),'polling']});socketio['adapter'](require(_0xafa6('0xa'))({'host':'localhost','port':0x18eb}));require(_0xafa6('0xb'))['default']();require(_0xafa6('0xc'))[_0xafa6('0xd')](socketio);require('../../config/express')[_0xafa6('0xd')](app);require(_0xafa6('0xe'))[_0xafa6('0xd')](app);}else{server[_0xafa6('0xf')](_0xafa6('0x10'),function(){console[_0xafa6('0x11')](_0xafa6('0x12'),config[_0xafa6('0x7')]);});}exports=module['exports']=app;
\ No newline at end of file
index 3c27341..1a9809d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bd6=['error','rpc','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','Request','debug'];(function(_0x41331e,_0x49a78c){var _0x27141d=function(_0x1e21d4){while(--_0x1e21d4){_0x41331e['push'](_0x41331e['shift']());}};_0x27141d(++_0x49a78c);}(_0x2bd6,0x1f4));var _0x62bd=function(_0x14a0a0,_0x45d0cf){_0x14a0a0=_0x14a0a0-0x0;var _0x56b651=_0x2bd6[_0x14a0a0];return _0x56b651;};'use strict';var jayson=require(_0x62bd('0x0'));var BPromise=require(_0x62bd('0x1'));var logger=require(_0x62bd('0x2'))(_0x62bd('0x3'));var client=jayson[_0x62bd('0x4')]['http']({'port':0x2329});client[_0x62bd('0x5')]=function(_0x1a8ed2,_0x23ba52){return new BPromise(function(_0x4a7608,_0x23c8a0){return client['request'](_0x1a8ed2,_0x23ba52)['then'](function(_0x3c267e){logger[_0x62bd('0x6')]('rpc',_0x62bd('0x3'),_0x1a8ed2,_0x23ba52,_0x3c267e);if(_0x3c267e[_0x62bd('0x7')]){logger['error'](_0x62bd('0x8'),_0x62bd('0x3'),_0x1a8ed2,_0x3c267e[_0x62bd('0x7')][_0x62bd('0x9')],_0x23ba52);return _0x23c8a0(_0x3c267e[_0x62bd('0x7')][_0x62bd('0x9')]);}else{return _0x4a7608(_0x3c267e[_0x62bd('0xa')]);}})[_0x62bd('0xb')](function(_0x3c582f){logger[_0x62bd('0x7')]('rpc','routing',_0x1a8ed2,_0x3c582f,_0x23ba52);return _0x23c8a0(_0x3c582f);});});};module[_0x62bd('0xc')]=client;
\ No newline at end of file
+var _0xdbf7=['rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','then','debug'];(function(_0x4303fb,_0x5ab295){var _0x5f3760=function(_0x90c947){while(--_0x90c947){_0x4303fb['push'](_0x4303fb['shift']());}};_0x5f3760(++_0x5ab295);}(_0xdbf7,0x8d));var _0x7dbf=function(_0x5e4f42,_0x296563){_0x5e4f42=_0x5e4f42-0x0;var _0x24a54e=_0xdbf7[_0x5e4f42];return _0x24a54e;};'use strict';var jayson=require(_0x7dbf('0x0'));var BPromise=require(_0x7dbf('0x1'));var logger=require(_0x7dbf('0x2'))(_0x7dbf('0x3'));var client=jayson[_0x7dbf('0x4')][_0x7dbf('0x5')]({'port':0x2329});client[_0x7dbf('0x6')]=function(_0x7b931c,_0x4e243e){return new BPromise(function(_0x11294f,_0x5cdcfc){return client['request'](_0x7b931c,_0x4e243e)[_0x7dbf('0x7')](function(_0x47730f){logger[_0x7dbf('0x8')](_0x7dbf('0x9'),_0x7dbf('0x3'),_0x7b931c,_0x4e243e,_0x47730f);if(_0x47730f[_0x7dbf('0xa')]){logger[_0x7dbf('0xa')](_0x7dbf('0x9'),_0x7dbf('0x3'),_0x7b931c,_0x47730f[_0x7dbf('0xa')][_0x7dbf('0xb')],_0x4e243e);return _0x5cdcfc(_0x47730f[_0x7dbf('0xa')][_0x7dbf('0xb')]);}else{return _0x11294f(_0x47730f[_0x7dbf('0xc')]);}})[_0x7dbf('0xd')](function(_0x4f1088){logger[_0x7dbf('0xa')](_0x7dbf('0x9'),_0x7dbf('0x3'),_0x7b931c,_0x4f1088,_0x4e243e);return _0x5cdcfc(_0x4f1088);});});};module[_0x7dbf('0xe')]=client;
\ No newline at end of file
index fc661d8..df65602 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87f5=['getAgents','initAgents','then','getIntervals','initIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','initMailQueues','initFaxQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve'];(function(_0x334d53,_0x3c40b2){var _0x4fd923=function(_0x58bc36){while(--_0x58bc36){_0x334d53['push'](_0x334d53['shift']());}};_0x4fd923(++_0x3c40b2);}(_0x87f5,0xc6));var _0x587f=function(_0x3412ab,_0x5a2b22){_0x3412ab=_0x3412ab-0x0;var _0x37ad1d=_0x87f5[_0x3412ab];return _0x37ad1d;};'use strict';var BPromise=require(_0x587f('0x0'));var server=require(_0x587f('0x1'));var Realtime=require(_0x587f('0x2'));var user=require(_0x587f('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x587f('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x587f('0x5'));var mailQueue=require(_0x587f('0x6'));var faxQueue=require(_0x587f('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x587f('0x8')]()['then'](user[_0x587f('0x9')]())['then'](realtime[_0x587f('0xa')]())[_0x587f('0xb')](interval[_0x587f('0xc')]())['then'](realtime[_0x587f('0xd')]())[_0x587f('0xb')](openchannelQueue['getOpenchannelQueues']())[_0x587f('0xb')](realtime[_0x587f('0xe')]())[_0x587f('0xb')](chatQueue[_0x587f('0xf')]())[_0x587f('0xb')](realtime[_0x587f('0x10')]())[_0x587f('0xb')](smsQueue['getSmsQueues']())['then'](realtime[_0x587f('0x11')]())[_0x587f('0xb')](mailQueue['getMailQueues']())[_0x587f('0xb')](realtime[_0x587f('0x12')]())[_0x587f('0xb')](faxQueue['getFaxQueues']())[_0x587f('0xb')](realtime[_0x587f('0x13')]())['then'](function(){return realtime;});}function main(){return server[_0x587f('0x14')](realtime)[_0x587f('0xb')](function(_0x565b4d){return initRealtime();})[_0x587f('0xb')](function(_0x56dc72){return setInterval(initRealtime,0x1388);})[_0x587f('0x15')](function(_0x243167){console[_0x587f('0x16')](_0x243167);});}main();
\ No newline at end of file
+var _0x6d20=['initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','initFaxQueues','listen','catch','bluebird','./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues'];(function(_0x314b56,_0x292792){var _0x34e0d4=function(_0x519f29){while(--_0x519f29){_0x314b56['push'](_0x314b56['shift']());}};_0x34e0d4(++_0x292792);}(_0x6d20,0x119));var _0x06d2=function(_0xcd07c,_0x8f566c){_0xcd07c=_0xcd07c-0x0;var _0xb99e27=_0x6d20[_0xcd07c];return _0xb99e27;};'use strict';var BPromise=require(_0x06d2('0x0'));var server=require(_0x06d2('0x1'));var Realtime=require(_0x06d2('0x2'));var user=require(_0x06d2('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x06d2('0x4'));var chatQueue=require(_0x06d2('0x5'));var smsQueue=require(_0x06d2('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x06d2('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()['then'](user['getAgents']())[_0x06d2('0x8')](realtime[_0x06d2('0x9')]())[_0x06d2('0x8')](interval[_0x06d2('0xa')]())[_0x06d2('0x8')](realtime[_0x06d2('0xb')]())[_0x06d2('0x8')](openchannelQueue[_0x06d2('0xc')]())[_0x06d2('0x8')](realtime[_0x06d2('0xd')]())[_0x06d2('0x8')](chatQueue[_0x06d2('0xe')]())[_0x06d2('0x8')](realtime[_0x06d2('0xf')]())[_0x06d2('0x8')](smsQueue[_0x06d2('0x10')]())[_0x06d2('0x8')](realtime[_0x06d2('0x11')]())[_0x06d2('0x8')](mailQueue['getMailQueues']())[_0x06d2('0x8')](realtime['initMailQueues']())[_0x06d2('0x8')](faxQueue['getFaxQueues']())[_0x06d2('0x8')](realtime[_0x06d2('0x12')]())[_0x06d2('0x8')](function(){return realtime;});}function main(){return server[_0x06d2('0x13')](realtime)[_0x06d2('0x8')](function(_0x14e79e){return initRealtime();})[_0x06d2('0x8')](function(_0x35b419){return setInterval(initRealtime,0x1388);})[_0x06d2('0x14')](function(_0x4f0752){console['log'](_0x4f0752);});}main();
\ No newline at end of file
index e258777..68d997c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16b3=['filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','nextTick','call','isEqual','restart','length','condition','findRules','matches','turn','prioritize','priority','toJSON','map','toString','isString','parse','object','exports','lodash','init','isNil','register','prototype','isArray','rules','isObject','push','sync','activeRules'];(function(_0x21090b,_0x39dd3b){var _0x3c68d7=function(_0x28ecd4){while(--_0x28ecd4){_0x21090b['push'](_0x21090b['shift']());}};_0x3c68d7(++_0x39dd3b);}(_0x16b3,0x8d));var _0x316b=function(_0x275099,_0x364007){_0x275099=_0x275099-0x0;var _0xe8ab0f=_0x16b3[_0x275099];return _0xe8ab0f;};'use strict';var _=require(_0x316b('0x0'));function RuleEngine(_0x344718,_0xa018c0){this[_0x316b('0x1')]();if(!_[_0x316b('0x2')](_0x344718)){this[_0x316b('0x3')](_0x344718);}if(_0xa018c0){this['ignoreFactChanges']=_0xa018c0['ignoreFactChanges'];}return this;}RuleEngine[_0x316b('0x4')][_0x316b('0x1')]=function(_0x4a819b){this['rules']=[];this['activeRules']=[];};RuleEngine[_0x316b('0x4')]['register']=function(_0x3b58a3){if(Array[_0x316b('0x5')](_0x3b58a3)){this[_0x316b('0x6')]=this[_0x316b('0x6')]['concat'](_0x3b58a3);}else if(_0x3b58a3!==null&&_[_0x316b('0x7')](_0x3b58a3)){this[_0x316b('0x6')][_0x316b('0x8')](_0x3b58a3);}this[_0x316b('0x9')]();};RuleEngine[_0x316b('0x4')]['sync']=function(){this[_0x316b('0xa')]=this['rules'][_0x316b('0xb')](function(_0x2ba7fe){if(_['isNil'](_0x2ba7fe['on'])){_0x2ba7fe['on']=!![];}if(_0x2ba7fe['on']===!![]){return _0x2ba7fe;}});this[_0x316b('0xa')]=_[_0x316b('0xc')](this['activeRules'],['p'],[_0x316b('0xd')]);};RuleEngine['prototype'][_0x316b('0xe')]=function(_0x229056,_0x66da59){var _0xbe99ab=![];_0x229056[_0x316b('0xf')]=!![];var _0x37a2ab=_[_0x316b('0x10')](_0x229056);var _0xd3337f=_[_0x316b('0x10')](_0x229056);var _0x3fafbb=this['activeRules'];var _0x305737=[];var _0x14dd29=this['ignoreFactChanges'];(function FnRuleLoop(_0x43883c){var _0x104618={'rules':function(){return _0x3fafbb;},'rule':function(){return _0x3fafbb[_0x43883c];},'when':function(_0x3918ed){if(_0x3918ed){var _0x2557b5=_0x3fafbb[_0x43883c][_0x316b('0x11')];_0x2557b5[_0x316b('0x12')]=_0x3fafbb[_0x43883c]['id']||_0x3fafbb[_0x43883c][_0x316b('0x13')]||'index_'+_0x43883c;process[_0x316b('0x14')](function(){_0x305737[_0x316b('0x8')](_0x2557b5[_0x316b('0x12')]);_0x2557b5[_0x316b('0x15')](_0x37a2ab,_0x104618);});}else{process[_0x316b('0x14')](function(){_0x104618['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0xbe99ab=!![];return FnRuleLoop(0x0);},'next':function(_0x1a5e64){if(!_0x14dd29&&!_[_0x316b('0x16')](_0xd3337f,_0x37a2ab)){_0xd3337f=_[_0x316b('0x10')](_0x37a2ab);process[_0x316b('0x14')](function(){_0x104618[_0x316b('0x17')]();});}else{process[_0x316b('0x14')](function(){if(_[_0x316b('0x2')](_0x1a5e64)){return FnRuleLoop(_0x43883c+0x1);}else{return FnRuleLoop(_0x1a5e64);}});}}};if(_0x43883c<_0x3fafbb[_0x316b('0x18')]&&_0xbe99ab===![]){var _0x23c1e7=_0x3fafbb[_0x43883c][_0x316b('0x19')];_0x23c1e7['call'](_0x37a2ab,_0x104618);}else{process[_0x316b('0x14')](function(){_0x37a2ab['matchPath']=_0x305737;return _0x66da59?_0x66da59(_0x37a2ab):_['noop']();});}}(0x0));};RuleEngine['prototype'][_0x316b('0x1a')]=function(_0x55d4ae){if(_[_0x316b('0x2')](_0x55d4ae)){return this[_0x316b('0x6')];}else{var _0x4e3e05=_[_0x316b('0x1b')](_0x55d4ae);return _['filter'](this[_0x316b('0x6')],_0x4e3e05);}};RuleEngine[_0x316b('0x4')][_0x316b('0x1c')]=function(_0x22d69d,_0x3f8069){var _0x22d69d=_0x22d69d==='on'||_0x22d69d==='ON'?!![]:![];var _0x157fff=this[_0x316b('0x1a')](_0x3f8069);for(var _0x3c007b=0x0,_0x521ef1=_0x157fff[_0x316b('0x18')];_0x3c007b<_0x521ef1;_0x3c007b+=0x1){_0x157fff[_0x3c007b]['on']=_0x22d69d;}this[_0x316b('0x9')]();};RuleEngine[_0x316b('0x4')][_0x316b('0x1d')]=function(_0xf0813,_0x4f017b){_0xf0813=parseInt(_0xf0813,0xa);var _0x2f1d4a=this[_0x316b('0x1a')](_0x4f017b);for(var _0xf50548=0x0,_0xd18410=_0x2f1d4a[_0x316b('0x18')];_0xf50548<_0xd18410;_0xf50548+=0x1){_0x2f1d4a[_0xf50548][_0x316b('0x1e')]=_0xf0813;}this['sync']();};RuleEngine['prototype'][_0x316b('0x1f')]=function(){var _0x3f12bf=this[_0x316b('0x6')];if(_0x3f12bf instanceof Array){_0x3f12bf=_0x3f12bf[_0x316b('0x20')](function(_0x45bab2){_0x45bab2[_0x316b('0x19')]=_0x45bab2[_0x316b('0x19')][_0x316b('0x21')]();_0x45bab2[_0x316b('0x11')]=_0x45bab2['consequence']['toString']();return _0x45bab2;});}else if(!_[_0x316b('0x2')](_0x3f12bf)){_0x3f12bf[_0x316b('0x19')]=_0x3f12bf[_0x316b('0x19')]['toString']();_0x3f12bf[_0x316b('0x11')]=_0x3f12bf[_0x316b('0x11')]['toString']();}return _0x3f12bf;};RuleEngine['prototype']['fromJSON']=function(_0x4a59c4){this[_0x316b('0x1')]();if(_[_0x316b('0x22')](_0x4a59c4)){_0x4a59c4=JSON[_0x316b('0x23')](_0x4a59c4);}if(_0x4a59c4 instanceof Array){_0x4a59c4=_0x4a59c4[_0x316b('0x20')](function(_0xc43709){_0xc43709['condition']=eval('('+_0xc43709[_0x316b('0x19')]+')');_0xc43709[_0x316b('0x11')]=eval('('+_0xc43709[_0x316b('0x11')]+')');return _0xc43709;});}else if(_0x4a59c4!==null&&typeof _0x4a59c4==_0x316b('0x24')){_0x4a59c4['condition']=eval('('+_0x4a59c4[_0x316b('0x19')]+')');_0x4a59c4[_0x316b('0x11')]=eval('('+_0x4a59c4[_0x316b('0x11')]+')');}this[_0x316b('0x3')](_0x4a59c4);};module[_0x316b('0x25')]=RuleEngine;
\ No newline at end of file
+var _0xdb2b=['nextTick','ruleRef','call','next','isEqual','restart','length','matchPath','findRules','matches','filter','prioritize','priority','toJSON','map','condition','toString','fromJSON','isString','parse','object','exports','lodash','init','isNil','register','ignoreFactChanges','prototype','rules','activeRules','isObject','push','sync','asc','execute','result','clone','consequence','name','index_'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb2b,0xb6));var _0xbdb2=function(_0xdee7ec,_0x29d552){_0xdee7ec=_0xdee7ec-0x0;var _0x1879b6=_0xdb2b[_0xdee7ec];return _0x1879b6;};'use strict';var _=require(_0xbdb2('0x0'));function RuleEngine(_0x2dbcc5,_0x46e87e){this[_0xbdb2('0x1')]();if(!_[_0xbdb2('0x2')](_0x2dbcc5)){this[_0xbdb2('0x3')](_0x2dbcc5);}if(_0x46e87e){this[_0xbdb2('0x4')]=_0x46e87e[_0xbdb2('0x4')];}return this;}RuleEngine[_0xbdb2('0x5')][_0xbdb2('0x1')]=function(_0x33e5b5){this[_0xbdb2('0x6')]=[];this[_0xbdb2('0x7')]=[];};RuleEngine[_0xbdb2('0x5')][_0xbdb2('0x3')]=function(_0x1acb68){if(Array['isArray'](_0x1acb68)){this['rules']=this['rules']['concat'](_0x1acb68);}else if(_0x1acb68!==null&&_[_0xbdb2('0x8')](_0x1acb68)){this[_0xbdb2('0x6')][_0xbdb2('0x9')](_0x1acb68);}this[_0xbdb2('0xa')]();};RuleEngine[_0xbdb2('0x5')][_0xbdb2('0xa')]=function(){this['activeRules']=this[_0xbdb2('0x6')]['filter'](function(_0x38baba){if(_[_0xbdb2('0x2')](_0x38baba['on'])){_0x38baba['on']=!![];}if(_0x38baba['on']===!![]){return _0x38baba;}});this['activeRules']=_['orderBy'](this['activeRules'],['p'],[_0xbdb2('0xb')]);};RuleEngine[_0xbdb2('0x5')][_0xbdb2('0xc')]=function(_0x4d7ea1,_0x2bf426){var _0x558864=![];_0x4d7ea1[_0xbdb2('0xd')]=!![];var _0x543e80=_[_0xbdb2('0xe')](_0x4d7ea1);var _0x5d7e59=_[_0xbdb2('0xe')](_0x4d7ea1);var _0x151d5c=this[_0xbdb2('0x7')];var _0x5d99fa=[];var _0xa57bec=this[_0xbdb2('0x4')];(function FnRuleLoop(_0x578fb9){var _0x1be620={'rules':function(){return _0x151d5c;},'rule':function(){return _0x151d5c[_0x578fb9];},'when':function(_0x442b2c){if(_0x442b2c){var _0x3ee247=_0x151d5c[_0x578fb9][_0xbdb2('0xf')];_0x3ee247['ruleRef']=_0x151d5c[_0x578fb9]['id']||_0x151d5c[_0x578fb9][_0xbdb2('0x10')]||_0xbdb2('0x11')+_0x578fb9;process[_0xbdb2('0x12')](function(){_0x5d99fa[_0xbdb2('0x9')](_0x3ee247[_0xbdb2('0x13')]);_0x3ee247[_0xbdb2('0x14')](_0x543e80,_0x1be620);});}else{process[_0xbdb2('0x12')](function(){_0x1be620[_0xbdb2('0x15')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x558864=!![];return FnRuleLoop(0x0);},'next':function(_0x3992b9){if(!_0xa57bec&&!_[_0xbdb2('0x16')](_0x5d7e59,_0x543e80)){_0x5d7e59=_[_0xbdb2('0xe')](_0x543e80);process[_0xbdb2('0x12')](function(){_0x1be620[_0xbdb2('0x17')]();});}else{process['nextTick'](function(){if(_[_0xbdb2('0x2')](_0x3992b9)){return FnRuleLoop(_0x578fb9+0x1);}else{return FnRuleLoop(_0x3992b9);}});}}};if(_0x578fb9<_0x151d5c[_0xbdb2('0x18')]&&_0x558864===![]){var _0x15a7a2=_0x151d5c[_0x578fb9]['condition'];_0x15a7a2[_0xbdb2('0x14')](_0x543e80,_0x1be620);}else{process['nextTick'](function(){_0x543e80[_0xbdb2('0x19')]=_0x5d99fa;return _0x2bf426?_0x2bf426(_0x543e80):_['noop']();});}}(0x0));};RuleEngine[_0xbdb2('0x5')][_0xbdb2('0x1a')]=function(_0x485fa1){if(_[_0xbdb2('0x2')](_0x485fa1)){return this[_0xbdb2('0x6')];}else{var _0xaa2275=_[_0xbdb2('0x1b')](_0x485fa1);return _[_0xbdb2('0x1c')](this[_0xbdb2('0x6')],_0xaa2275);}};RuleEngine[_0xbdb2('0x5')]['turn']=function(_0x174f80,_0x3e085d){var _0x174f80=_0x174f80==='on'||_0x174f80==='ON'?!![]:![];var _0x3a3e80=this['findRules'](_0x3e085d);for(var _0x57680b=0x0,_0x377abe=_0x3a3e80[_0xbdb2('0x18')];_0x57680b<_0x377abe;_0x57680b+=0x1){_0x3a3e80[_0x57680b]['on']=_0x174f80;}this['sync']();};RuleEngine[_0xbdb2('0x5')][_0xbdb2('0x1d')]=function(_0xf9e422,_0x53faef){_0xf9e422=parseInt(_0xf9e422,0xa);var _0x3f83ee=this[_0xbdb2('0x1a')](_0x53faef);for(var _0x2a9de0=0x0,_0xb10f4b=_0x3f83ee[_0xbdb2('0x18')];_0x2a9de0<_0xb10f4b;_0x2a9de0+=0x1){_0x3f83ee[_0x2a9de0][_0xbdb2('0x1e')]=_0xf9e422;}this[_0xbdb2('0xa')]();};RuleEngine[_0xbdb2('0x5')][_0xbdb2('0x1f')]=function(){var _0x263670=this[_0xbdb2('0x6')];if(_0x263670 instanceof Array){_0x263670=_0x263670[_0xbdb2('0x20')](function(_0x349767){_0x349767[_0xbdb2('0x21')]=_0x349767[_0xbdb2('0x21')][_0xbdb2('0x22')]();_0x349767[_0xbdb2('0xf')]=_0x349767[_0xbdb2('0xf')]['toString']();return _0x349767;});}else if(!_[_0xbdb2('0x2')](_0x263670)){_0x263670[_0xbdb2('0x21')]=_0x263670['condition'][_0xbdb2('0x22')]();_0x263670[_0xbdb2('0xf')]=_0x263670[_0xbdb2('0xf')][_0xbdb2('0x22')]();}return _0x263670;};RuleEngine[_0xbdb2('0x5')][_0xbdb2('0x23')]=function(_0x36ad65){this[_0xbdb2('0x1')]();if(_[_0xbdb2('0x24')](_0x36ad65)){_0x36ad65=JSON[_0xbdb2('0x25')](_0x36ad65);}if(_0x36ad65 instanceof Array){_0x36ad65=_0x36ad65[_0xbdb2('0x20')](function(_0x548b03){_0x548b03[_0xbdb2('0x21')]=eval('('+_0x548b03[_0xbdb2('0x21')]+')');_0x548b03[_0xbdb2('0xf')]=eval('('+_0x548b03[_0xbdb2('0xf')]+')');return _0x548b03;});}else if(_0x36ad65!==null&&typeof _0x36ad65==_0xbdb2('0x26')){_0x36ad65[_0xbdb2('0x21')]=eval('('+_0x36ad65[_0xbdb2('0x21')]+')');_0x36ad65['consequence']=eval('('+_0x36ad65[_0xbdb2('0xf')]+')');}this[_0xbdb2('0x3')](_0x36ad65);};module[_0xbdb2('0x27')]=RuleEngine;
\ No newline at end of file
index 6d9467a..b949db0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x1fead2,_0x191a4b){var _0x305eca=function(_0x5178bf){while(--_0x5178bf){_0x1fead2['push'](_0x1fead2['shift']());}};_0x305eca(++_0x191a4b);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});};
\ No newline at end of file
+var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x2d06e6,_0x5bca29){var _0x567935=function(_0x50d0af){while(--_0x50d0af){_0x2d06e6['push'](_0x2d06e6['shift']());}};_0x567935(++_0x5bca29);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});};
\ No newline at end of file
index b6ea5b3..abebb36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedc5=['Capacity','maxcapacity','idle','updateRealtime','mail','chat','fax','sms','length','getChannelStatus','Status','StatusTime','toNumber','emit','user:save','exports','lodash','moment','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','prototype','CurrentCapacity'];(function(_0x50b651,_0x2ce0c5){var _0x1ec2b0=function(_0x468b6d){while(--_0x468b6d){_0x50b651['push'](_0x50b651['shift']());}};_0x1ec2b0(++_0x2ce0c5);}(_0xedc5,0x190));var _0x5edc=function(_0x1a4748,_0x40c46e){_0x1a4748=_0x1a4748-0x0;var _0x28ca99=_0xedc5[_0x1a4748];return _0x28ca99;};'use strict';var _=require(_0x5edc('0x0'));var moment=require(_0x5edc('0x1'));var io=require('socket.io-emitter')({'host':_0x5edc('0x2'),'port':0x18eb});function Agent(_0x206586){this['id']=_0x206586['id']||0x0;this['name']=_0x206586[_0x5edc('0x3')]||'';this[_0x5edc('0x4')]=_0x206586[_0x5edc('0x4')]||!![];this[_0x5edc('0x5')]=_0x206586['voicePause']||![];this[_0x5edc('0x6')]=_0x206586[_0x5edc('0x6')]||![];this[_0x5edc('0x7')]=_0x206586[_0x5edc('0x7')]||![];this['faxPause']=_0x206586[_0x5edc('0x8')]||![];this[_0x5edc('0x9')]=_0x206586[_0x5edc('0x9')]||![];this['openchannelPause']=_0x206586[_0x5edc('0xa')]||![];this[_0x5edc('0xb')]=_0x5edc('0xc');this[_0x5edc('0xd')]=0x0;this[_0x5edc('0xe')]=_0x206586[_0x5edc('0xe')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x5edc('0xf')]=_0x5edc('0xc');this['mailStatusTime']=0x0;this[_0x5edc('0x10')]=_0x206586[_0x5edc('0x10')]||0x0;this[_0x5edc('0x11')]=0x0;this[_0x5edc('0x12')]=_0x5edc('0xc');this[_0x5edc('0x13')]=0x0;this[_0x5edc('0x14')]=_0x206586[_0x5edc('0x14')]||0x0;this[_0x5edc('0x15')]=0x0;this[_0x5edc('0x16')]=_0x5edc('0xc');this['smsStatusTime']=0x0;this[_0x5edc('0x17')]=_0x206586[_0x5edc('0x17')]||0x0;this[_0x5edc('0x18')]=0x0;this[_0x5edc('0x19')]=_0x5edc('0xc');this[_0x5edc('0x1a')]=0x0;this[_0x5edc('0x1b')]=_0x206586['openchannelCapacity']||0x0;this[_0x5edc('0x1c')]=0x0;this['busy']=![];this[_0x5edc('0x1d')]=undefined;this['updateRealtime']();}Agent[_0x5edc('0x1e')]['getChannelStatus']=function(_0x13f203){if(this[_0x13f203+_0x5edc('0x1f')]>0x0){if(this[_0x13f203+_0x5edc('0x20')]>0x0&&this[_0x13f203+_0x5edc('0x1f')]>=this[_0x13f203+'Capacity']){return _0x5edc('0x21');}else{return'working';}}else{return _0x5edc('0x22');}};Agent[_0x5edc('0x1e')][_0x5edc('0x23')]=function(){var _0x477838=[_0x5edc('0x24'),_0x5edc('0x25'),'openchannel',_0x5edc('0x26'),_0x5edc('0x27')];for(var _0x1cf5fe=0x0;_0x1cf5fe<_0x477838[_0x5edc('0x28')];_0x1cf5fe+=0x1){var _0x1df283=this[_0x5edc('0x29')](_0x477838[_0x1cf5fe]);if(this[_0x477838[_0x1cf5fe]+_0x5edc('0x2a')]!==_0x1df283){this[_0x477838[_0x1cf5fe]+_0x5edc('0x2b')]=_[_0x5edc('0x2c')](moment()['format']('x'));}this[_0x477838[_0x1cf5fe]+_0x5edc('0x2a')]=_0x1df283;}io[_0x5edc('0x2d')](_0x5edc('0x2e'),this);};module[_0x5edc('0x2f')]=Agent;
\ No newline at end of file
+var _0x2f3f=['smsPause','openchannelPause','chatStatus','unknown','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','working','mail','chat','openchannel','fax','getChannelStatus','Status','StatusTime','format','emit','exports','lodash','socket.io-emitter','localhost','name','online','voicePause','chatPause','faxPause'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2f3f,0x100));var _0xf2f3=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x2f3f[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xf2f3('0x0'));var moment=require('moment');var io=require(_0xf2f3('0x1'))({'host':_0xf2f3('0x2'),'port':0x18eb});function Agent(_0x2b8c90){this['id']=_0x2b8c90['id']||0x0;this[_0xf2f3('0x3')]=_0x2b8c90['name']||'';this['online']=_0x2b8c90[_0xf2f3('0x4')]||!![];this[_0xf2f3('0x5')]=_0x2b8c90[_0xf2f3('0x5')]||![];this[_0xf2f3('0x6')]=_0x2b8c90[_0xf2f3('0x6')]||![];this['mailPause']=_0x2b8c90['mailPause']||![];this[_0xf2f3('0x7')]=_0x2b8c90[_0xf2f3('0x7')]||![];this[_0xf2f3('0x8')]=_0x2b8c90['smsPause']||![];this[_0xf2f3('0x9')]=_0x2b8c90[_0xf2f3('0x9')]||![];this[_0xf2f3('0xa')]=_0xf2f3('0xb');this['chatStatusTime']=0x0;this[_0xf2f3('0xc')]=_0x2b8c90[_0xf2f3('0xc')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xf2f3('0xd')]='unknown';this[_0xf2f3('0xe')]=0x0;this[_0xf2f3('0xf')]=_0x2b8c90['mailCapacity']||0x0;this[_0xf2f3('0x10')]=0x0;this[_0xf2f3('0x11')]=_0xf2f3('0xb');this[_0xf2f3('0x12')]=0x0;this[_0xf2f3('0x13')]=_0x2b8c90['faxCapacity']||0x0;this[_0xf2f3('0x14')]=0x0;this[_0xf2f3('0x15')]='unknown';this[_0xf2f3('0x16')]=0x0;this['smsCapacity']=_0x2b8c90['smsCapacity']||0x0;this[_0xf2f3('0x17')]=0x0;this[_0xf2f3('0x18')]='unknown';this['openchannelStatusTime']=0x0;this[_0xf2f3('0x19')]=_0x2b8c90[_0xf2f3('0x19')]||0x0;this[_0xf2f3('0x1a')]=0x0;this[_0xf2f3('0x1b')]=![];this['busyQueue']=undefined;this[_0xf2f3('0x1c')]();}Agent[_0xf2f3('0x1d')]['getChannelStatus']=function(_0x418234){if(this[_0x418234+_0xf2f3('0x1e')]>0x0){if(this[_0x418234+_0xf2f3('0x1f')]>0x0&&this[_0x418234+_0xf2f3('0x1e')]>=this[_0x418234+_0xf2f3('0x1f')]){return _0xf2f3('0x20');}else{return _0xf2f3('0x21');}}else{return'idle';}};Agent[_0xf2f3('0x1d')][_0xf2f3('0x1c')]=function(){var _0x3eeb14=[_0xf2f3('0x22'),_0xf2f3('0x23'),_0xf2f3('0x24'),_0xf2f3('0x25'),'sms'];for(var _0x2f3db6=0x0;_0x2f3db6<_0x3eeb14['length'];_0x2f3db6+=0x1){var _0x3ca2c2=this[_0xf2f3('0x26')](_0x3eeb14[_0x2f3db6]);if(this[_0x3eeb14[_0x2f3db6]+_0xf2f3('0x27')]!==_0x3ca2c2){this[_0x3eeb14[_0x2f3db6]+_0xf2f3('0x28')]=_['toNumber'](moment()[_0xf2f3('0x29')]('x'));}this[_0x3eeb14[_0x2f3db6]+'Status']=_0x3ca2c2;}io[_0xf2f3('0x2a')]('user:save',this);};module[_0xf2f3('0x2b')]=Agent;
\ No newline at end of file
index 277d84d..c7ec295 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['prototype','_rr','map','paused','length','online','loggedIn','chatPause','available','stringify','format','emit','chat_queue:save','exports','lodash','md5','util','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0xcb18f6,_0x5da881){var _0x4d0953=function(_0x10dc76){while(--_0x10dc76){_0xcb18f6['push'](_0xcb18f6['shift']());}};_0x4d0953(++_0x5da881);}(_0x34e8,0x12c));var _0x834e=function(_0x2fdb7d,_0xe2974b){_0x2fdb7d=_0x2fdb7d-0x0;var _0x942314=_0x34e8[_0x2fdb7d];return _0x942314;};'use strict';var _=require(_0x834e('0x0'));var md5=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var io=require(_0x834e('0x3'))({'host':'localhost','port':0x18eb});function ChatQueue(_0x832422){this['id']=_0x832422['id']||0x0;this[_0x834e('0x4')]=_0x832422[_0x834e('0x4')]||'';this[_0x834e('0x5')]=_0x832422[_0x834e('0x5')]||0xa;this[_0x834e('0x6')]=_0x832422[_0x834e('0x6')]||'beepall';this[_0x834e('0x7')]=_0x832422['Agents'];this[_0x834e('0x8')]={};this[_0x834e('0x9')]=0x0;this[_0x834e('0x1')]='';this[_0x834e('0xa')]();this[_0x834e('0xb')]();}ChatQueue[_0x834e('0xc')][_0x834e('0xa')]=function(){var _0x1af45a=this[_0x834e('0x8')][_0x834e('0xd')];this[_0x834e('0x8')]=_[_0x834e('0xe')](this[_0x834e('0x7')],'id');this[_0x834e('0x8')][_0x834e('0xd')]=_0x1af45a;};ChatQueue[_0x834e('0xc')][_0x834e('0xb')]=function(){this['loggedIn']=0x0;this[_0x834e('0xf')]=0x0;for(var _0x6cd9b9=0x0;_0x6cd9b9<this['Agents'][_0x834e('0x10')];_0x6cd9b9+=0x1){if(this[_0x834e('0x7')][_0x6cd9b9][_0x834e('0x11')]){this[_0x834e('0x12')]+=0x1;}if(this['Agents'][_0x6cd9b9][_0x834e('0x13')]){this[_0x834e('0xf')]+=0x1;}}this['available']=this[_0x834e('0x12')]-this['paused'];this[_0x834e('0x14')]=this[_0x834e('0x14')]>=0x0?this['available']:0x0;var _0x43ac41={'id':this['id'],'available':this[_0x834e('0x14')],'loggedIn':this[_0x834e('0x12')],'name':this['name'],'paused':this[_0x834e('0xf')],'waiting':this[_0x834e('0x9')]};var _0x34e41a=md5(JSON[_0x834e('0x15')](_0x43ac41));if(this[_0x834e('0x1')]!==_0x34e41a){this[_0x834e('0x1')]=_0x34e41a;io['to'](util[_0x834e('0x16')]('chat:queue:%s',_0x43ac41[_0x834e('0x4')]))[_0x834e('0x17')](_0x834e('0x18'),_0x43ac41);}};module[_0x834e('0x19')]=ChatQueue;
\ No newline at end of file
+var _0xcb91=['waiting','md5','updateRealtime','mapAgentsId','_rr','map','prototype','loggedIn','length','online','chatPause','paused','available','format','chat:queue:%s','emit','chat_queue:save','util','socket.io-emitter','localhost','name','timeout','strategy','Agents'];(function(_0x379868,_0x3dfdc2){var _0x1d82ce=function(_0x3d2822){while(--_0x3d2822){_0x379868['push'](_0x379868['shift']());}};_0x1d82ce(++_0x3dfdc2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5c14f6,_0x2979d8){_0x5c14f6=_0x5c14f6-0x0;var _0x4949b3=_0xcb91[_0x5c14f6];return _0x4949b3;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x1cb9('0x0'));var io=require(_0x1cb9('0x1'))({'host':_0x1cb9('0x2'),'port':0x18eb});function ChatQueue(_0x22c4b8){this['id']=_0x22c4b8['id']||0x0;this['name']=_0x22c4b8[_0x1cb9('0x3')]||'';this[_0x1cb9('0x4')]=_0x22c4b8['timeout']||0xa;this[_0x1cb9('0x5')]=_0x22c4b8[_0x1cb9('0x5')]||'beepall';this[_0x1cb9('0x6')]=_0x22c4b8[_0x1cb9('0x6')];this['mapAgentsId']={};this[_0x1cb9('0x7')]=0x0;this[_0x1cb9('0x8')]='';this['updateRouting']();this[_0x1cb9('0x9')]();}ChatQueue['prototype']['updateRouting']=function(){var _0x45a12f=this[_0x1cb9('0xa')][_0x1cb9('0xb')];this[_0x1cb9('0xa')]=_[_0x1cb9('0xc')](this['Agents'],'id');this[_0x1cb9('0xa')][_0x1cb9('0xb')]=_0x45a12f;};ChatQueue[_0x1cb9('0xd')][_0x1cb9('0x9')]=function(){this[_0x1cb9('0xe')]=0x0;this['paused']=0x0;for(var _0x5e3c19=0x0;_0x5e3c19<this['Agents'][_0x1cb9('0xf')];_0x5e3c19+=0x1){if(this[_0x1cb9('0x6')][_0x5e3c19][_0x1cb9('0x10')]){this[_0x1cb9('0xe')]+=0x1;}if(this['Agents'][_0x5e3c19][_0x1cb9('0x11')]){this[_0x1cb9('0x12')]+=0x1;}}this[_0x1cb9('0x13')]=this[_0x1cb9('0xe')]-this[_0x1cb9('0x12')];this['available']=this['available']>=0x0?this[_0x1cb9('0x13')]:0x0;var _0x3cc765={'id':this['id'],'available':this[_0x1cb9('0x13')],'loggedIn':this[_0x1cb9('0xe')],'name':this[_0x1cb9('0x3')],'paused':this[_0x1cb9('0x12')],'waiting':this[_0x1cb9('0x7')]};var _0x4e1340=md5(JSON['stringify'](_0x3cc765));if(this[_0x1cb9('0x8')]!==_0x4e1340){this[_0x1cb9('0x8')]=_0x4e1340;io['to'](util[_0x1cb9('0x14')](_0x1cb9('0x15'),_0x3cc765[_0x1cb9('0x3')]))[_0x1cb9('0x16')](_0x1cb9('0x17'),_0x3cc765);}};module['exports']=ChatQueue;
\ No newline at end of file
index 6ad8eb9..90604ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb998=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','map','paused','length','available','loggedIn','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','md5','util','socket.io-emitter','localhost'];(function(_0x327e8e,_0x3ebf0f){var _0x648ee8=function(_0x46614c){while(--_0x46614c){_0x327e8e['push'](_0x327e8e['shift']());}};_0x648ee8(++_0x3ebf0f);}(_0xb998,0x1d7));var _0x8b99=function(_0x52b492,_0x138f93){_0x52b492=_0x52b492-0x0;var _0x34eca9=_0xb998[_0x52b492];return _0x34eca9;};'use strict';var _=require('lodash');var md5=require(_0x8b99('0x0'));var util=require(_0x8b99('0x1'));var io=require(_0x8b99('0x2'))({'host':_0x8b99('0x3'),'port':0x18eb});function FaxQueue(_0x501451){this['id']=_0x501451['id']||0x0;this[_0x8b99('0x4')]=_0x501451[_0x8b99('0x4')]||'';this[_0x8b99('0x5')]=_0x501451[_0x8b99('0x5')]||0xa;this[_0x8b99('0x6')]=_0x501451['strategy']||_0x8b99('0x7');this[_0x8b99('0x8')]=_0x501451['Agents'];this[_0x8b99('0x9')]={};this[_0x8b99('0xa')]=0x0;this[_0x8b99('0x0')]='';this['updateRouting']();this[_0x8b99('0xb')]();}FaxQueue[_0x8b99('0xc')]['updateRouting']=function(){var _0x158b33=this[_0x8b99('0x9')][_0x8b99('0xd')];this[_0x8b99('0x9')]=_[_0x8b99('0xe')](this[_0x8b99('0x8')],'id');this[_0x8b99('0x9')]['_rr']=_0x158b33;};FaxQueue[_0x8b99('0xc')][_0x8b99('0xb')]=function(){this['loggedIn']=0x0;this[_0x8b99('0xf')]=0x0;for(var _0x19112f=0x0;_0x19112f<this[_0x8b99('0x8')][_0x8b99('0x10')];_0x19112f+=0x1){if(this[_0x8b99('0x8')][_0x19112f]['online']){this['loggedIn']+=0x1;}if(this[_0x8b99('0x8')][_0x19112f]['faxPause']){this[_0x8b99('0xf')]+=0x1;}}this[_0x8b99('0x11')]=this['loggedIn']-this['paused'];this[_0x8b99('0x11')]=this[_0x8b99('0x11')]>=0x0?this[_0x8b99('0x11')]:0x0;var _0x1bd315={'id':this['id'],'available':this[_0x8b99('0x11')],'loggedIn':this[_0x8b99('0x12')],'name':this[_0x8b99('0x4')],'paused':this[_0x8b99('0xf')],'waiting':this[_0x8b99('0xa')]};var _0x10809b=md5(JSON[_0x8b99('0x13')](_0x1bd315));if(this['md5']!==_0x10809b){this[_0x8b99('0x0')]=_0x10809b;io['to'](util[_0x8b99('0x14')](_0x8b99('0x15'),_0x1bd315['name']))[_0x8b99('0x16')](_0x8b99('0x17'),_0x1bd315);}};module[_0x8b99('0x18')]=FaxQueue;
\ No newline at end of file
+var _0x0d0c=['util','socket.io-emitter','localhost','name','timeout','strategy','beepall','waiting','updateRealtime','updateRouting','_rr','mapAgentsId','map','Agents','prototype','loggedIn','paused','length','faxPause','available','md5','format','fax:queue:%s','emit','fax_queue:save','exports'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x0d0c,0x16c));var _0xc0d0=function(_0x4f55c8,_0x144f10){_0x4f55c8=_0x4f55c8-0x0;var _0x4a0757=_0x0d0c[_0x4f55c8];return _0x4a0757;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xc0d0('0x0'));var io=require(_0xc0d0('0x1'))({'host':_0xc0d0('0x2'),'port':0x18eb});function FaxQueue(_0x43a541){this['id']=_0x43a541['id']||0x0;this[_0xc0d0('0x3')]=_0x43a541[_0xc0d0('0x3')]||'';this[_0xc0d0('0x4')]=_0x43a541[_0xc0d0('0x4')]||0xa;this['strategy']=_0x43a541[_0xc0d0('0x5')]||_0xc0d0('0x6');this['Agents']=_0x43a541['Agents'];this['mapAgentsId']={};this[_0xc0d0('0x7')]=0x0;this['md5']='';this['updateRouting']();this[_0xc0d0('0x8')]();}FaxQueue['prototype'][_0xc0d0('0x9')]=function(){var _0x479429=this['mapAgentsId'][_0xc0d0('0xa')];this[_0xc0d0('0xb')]=_[_0xc0d0('0xc')](this[_0xc0d0('0xd')],'id');this[_0xc0d0('0xb')][_0xc0d0('0xa')]=_0x479429;};FaxQueue[_0xc0d0('0xe')][_0xc0d0('0x8')]=function(){this[_0xc0d0('0xf')]=0x0;this[_0xc0d0('0x10')]=0x0;for(var _0x117bd7=0x0;_0x117bd7<this[_0xc0d0('0xd')][_0xc0d0('0x11')];_0x117bd7+=0x1){if(this[_0xc0d0('0xd')][_0x117bd7]['online']){this[_0xc0d0('0xf')]+=0x1;}if(this[_0xc0d0('0xd')][_0x117bd7][_0xc0d0('0x12')]){this[_0xc0d0('0x10')]+=0x1;}}this[_0xc0d0('0x13')]=this[_0xc0d0('0xf')]-this[_0xc0d0('0x10')];this[_0xc0d0('0x13')]=this[_0xc0d0('0x13')]>=0x0?this['available']:0x0;var _0x5e2202={'id':this['id'],'available':this[_0xc0d0('0x13')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xc0d0('0x10')],'waiting':this[_0xc0d0('0x7')]};var _0x3804a2=md5(JSON['stringify'](_0x5e2202));if(this[_0xc0d0('0x14')]!==_0x3804a2){this['md5']=_0x3804a2;io['to'](util[_0xc0d0('0x15')](_0xc0d0('0x16'),_0x5e2202[_0xc0d0('0x3')]))[_0xc0d0('0x17')](_0xc0d0('0x18'),_0x5e2202);}};module[_0xc0d0('0x19')]=FaxQueue;
\ No newline at end of file
index 26c595f..802eec9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7844=['Intervals','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7844,0x8b));var _0x4784=function(_0x48b99b,_0xfea405){_0x48b99b=_0x48b99b-0x0;var _0x1d5399=_0x7844[_0x48b99b];return _0x1d5399;};'use strict';function Interval(_0x45a006){this['id']=_0x45a006['id']||0x0;this[_0x4784('0x0')]=_0x45a006[_0x4784('0x0')]||'';this[_0x4784('0x1')]=_0x45a006[_0x4784('0x1')]||{};}module['exports']=Interval;
\ No newline at end of file
+var _0xd411=['Intervals'];(function(_0x32b015,_0x15aac6){var _0x122edd=function(_0x3ba676){while(--_0x3ba676){_0x32b015['push'](_0x32b015['shift']());}};_0x122edd(++_0x15aac6);}(_0xd411,0xb1));var _0x1d41=function(_0x3e4df7,_0x46860e){_0x3e4df7=_0x3e4df7-0x0;var _0xb57650=_0xd411[_0x3e4df7];return _0xb57650;};'use strict';function Interval(_0x336990){this['id']=_0x336990['id']||0x0;this['name']=_0x336990['name']||'';this[_0x1d41('0x0')]=_0x336990[_0x1d41('0x0')]||{};}module['exports']=Interval;
\ No newline at end of file
index c34a7c7..1d73878 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x535e=['exports','lodash','util','socket.io-emitter','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x535e,0x15d));var _0xe535=function(_0x1a50ef,_0x458ac5){_0x1a50ef=_0x1a50ef-0x0;var _0x56b77e=_0x535e[_0x1a50ef];return _0x56b77e;};'use strict';var _=require(_0xe535('0x0'));var md5=require('md5');var util=require(_0xe535('0x1'));var io=require(_0xe535('0x2'))({'host':_0xe535('0x3'),'port':0x18eb});function MailQueue(_0x109d79){this['id']=_0x109d79['id']||0x0;this[_0xe535('0x4')]=_0x109d79[_0xe535('0x4')]||'';this['timeout']=_0x109d79[_0xe535('0x5')]||0xa;this[_0xe535('0x6')]=_0x109d79[_0xe535('0x6')]||_0xe535('0x7');this[_0xe535('0x8')]=_0x109d79['Agents'];this[_0xe535('0x9')]={};this[_0xe535('0xa')]=0x0;this[_0xe535('0xb')]='';this[_0xe535('0xc')]();this[_0xe535('0xd')]();}MailQueue[_0xe535('0xe')][_0xe535('0xc')]=function(){var _0x44f05a=this[_0xe535('0x9')][_0xe535('0xf')];this[_0xe535('0x9')]=_[_0xe535('0x10')](this[_0xe535('0x8')],'id');this[_0xe535('0x9')]['_rr']=_0x44f05a;};MailQueue[_0xe535('0xe')][_0xe535('0xd')]=function(){this[_0xe535('0x11')]=0x0;this[_0xe535('0x12')]=0x0;for(var _0x13334e=0x0;_0x13334e<this['Agents'][_0xe535('0x13')];_0x13334e+=0x1){if(this[_0xe535('0x8')][_0x13334e][_0xe535('0x14')]){this['loggedIn']+=0x1;}if(this[_0xe535('0x8')][_0x13334e][_0xe535('0x15')]){this[_0xe535('0x12')]+=0x1;}}this[_0xe535('0x16')]=this[_0xe535('0x11')]-this[_0xe535('0x12')];this[_0xe535('0x16')]=this[_0xe535('0x16')]>=0x0?this[_0xe535('0x16')]:0x0;var _0x436c1e={'id':this['id'],'available':this[_0xe535('0x16')],'loggedIn':this[_0xe535('0x11')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xe535('0xa')]};var _0x3c2000=md5(JSON[_0xe535('0x17')](_0x436c1e));if(this[_0xe535('0xb')]!==_0x3c2000){this[_0xe535('0xb')]=_0x3c2000;io['to'](util[_0xe535('0x18')](_0xe535('0x19'),_0x436c1e['name']))[_0xe535('0x1a')](_0xe535('0x1b'),_0x436c1e);}};module[_0xe535('0x1c')]=MailQueue;
\ No newline at end of file
+var _0x3e96=['prototype','updateRouting','map','_rr','length','online','loggedIn','mailPause','paused','available','stringify','mail:queue:%s','emit','md5','util','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime'];(function(_0x33c0f2,_0x285ffc){var _0x6573b6=function(_0x3b6bab){while(--_0x3b6bab){_0x33c0f2['push'](_0x33c0f2['shift']());}};_0x6573b6(++_0x285ffc);}(_0x3e96,0xe5));var _0x63e9=function(_0x3df871,_0xda2e11){_0x3df871=_0x3df871-0x0;var _0x570f7b=_0x3e96[_0x3df871];return _0x570f7b;};'use strict';var _=require('lodash');var md5=require(_0x63e9('0x0'));var util=require(_0x63e9('0x1'));var io=require(_0x63e9('0x2'))({'host':'localhost','port':0x18eb});function MailQueue(_0x4867f6){this['id']=_0x4867f6['id']||0x0;this[_0x63e9('0x3')]=_0x4867f6[_0x63e9('0x3')]||'';this['timeout']=_0x4867f6[_0x63e9('0x4')]||0xa;this['strategy']=_0x4867f6[_0x63e9('0x5')]||_0x63e9('0x6');this['Agents']=_0x4867f6[_0x63e9('0x7')];this[_0x63e9('0x8')]={};this[_0x63e9('0x9')]=0x0;this[_0x63e9('0x0')]='';this['updateRouting']();this[_0x63e9('0xa')]();}MailQueue[_0x63e9('0xb')][_0x63e9('0xc')]=function(){var _0x292128=this[_0x63e9('0x8')]['_rr'];this[_0x63e9('0x8')]=_[_0x63e9('0xd')](this['Agents'],'id');this[_0x63e9('0x8')][_0x63e9('0xe')]=_0x292128;};MailQueue[_0x63e9('0xb')][_0x63e9('0xa')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x281c02=0x0;_0x281c02<this[_0x63e9('0x7')][_0x63e9('0xf')];_0x281c02+=0x1){if(this[_0x63e9('0x7')][_0x281c02][_0x63e9('0x10')]){this[_0x63e9('0x11')]+=0x1;}if(this[_0x63e9('0x7')][_0x281c02][_0x63e9('0x12')]){this[_0x63e9('0x13')]+=0x1;}}this['available']=this[_0x63e9('0x11')]-this['paused'];this[_0x63e9('0x14')]=this[_0x63e9('0x14')]>=0x0?this['available']:0x0;var _0xffa6f2={'id':this['id'],'available':this['available'],'loggedIn':this[_0x63e9('0x11')],'name':this[_0x63e9('0x3')],'paused':this[_0x63e9('0x13')],'waiting':this[_0x63e9('0x9')]};var _0x670a59=md5(JSON[_0x63e9('0x15')](_0xffa6f2));if(this['md5']!==_0x670a59){this[_0x63e9('0x0')]=_0x670a59;io['to'](util['format'](_0x63e9('0x16'),_0xffa6f2[_0x63e9('0x3')]))[_0x63e9('0x17')]('mail_queue:save',_0xffa6f2);}};module['exports']=MailQueue;
\ No newline at end of file
index e62a503..006c48b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e09=['length','online','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','util','socket.io-emitter','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','loggedIn','paused'];(function(_0x81dcac,_0x8ff7db){var _0xc7803b=function(_0x499b29){while(--_0x499b29){_0x81dcac['push'](_0x81dcac['shift']());}};_0xc7803b(++_0x8ff7db);}(_0x4e09,0x166));var _0x94e0=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x4e09[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var md5=require(_0x94e0('0x0'));var util=require(_0x94e0('0x1'));var io=require(_0x94e0('0x2'))({'host':_0x94e0('0x3'),'port':0x18eb});function OpenchannelQueue(_0x114308){this['id']=_0x114308['id']||0x0;this[_0x94e0('0x4')]=_0x114308['name']||'';this[_0x94e0('0x5')]=_0x114308[_0x94e0('0x5')]||0xa;this[_0x94e0('0x6')]=_0x114308[_0x94e0('0x6')]||_0x94e0('0x7');this[_0x94e0('0x8')]=_0x114308[_0x94e0('0x8')];this[_0x94e0('0x9')]={};this[_0x94e0('0xa')]=0x0;this['md5']='';this[_0x94e0('0xb')]();this['updateRealtime']();}OpenchannelQueue[_0x94e0('0xc')]['updateRouting']=function(){var _0x432e20=this[_0x94e0('0x9')][_0x94e0('0xd')];this[_0x94e0('0x9')]=_[_0x94e0('0xe')](this[_0x94e0('0x8')],'id');this[_0x94e0('0x9')][_0x94e0('0xd')]=_0x432e20;};OpenchannelQueue[_0x94e0('0xc')]['updateRealtime']=function(){this[_0x94e0('0xf')]=0x0;this[_0x94e0('0x10')]=0x0;for(var _0x41b47b=0x0;_0x41b47b<this['Agents'][_0x94e0('0x11')];_0x41b47b+=0x1){if(this[_0x94e0('0x8')][_0x41b47b][_0x94e0('0x12')]){this[_0x94e0('0xf')]+=0x1;}if(this[_0x94e0('0x8')][_0x41b47b][_0x94e0('0x13')]){this[_0x94e0('0x10')]+=0x1;}}this['available']=this[_0x94e0('0xf')]-this[_0x94e0('0x10')];this[_0x94e0('0x14')]=this[_0x94e0('0x14')]>=0x0?this[_0x94e0('0x14')]:0x0;var _0x59257={'id':this['id'],'available':this[_0x94e0('0x14')],'loggedIn':this[_0x94e0('0xf')],'name':this[_0x94e0('0x4')],'paused':this[_0x94e0('0x10')],'waiting':this['waiting']};var _0x5390a7=md5(JSON[_0x94e0('0x15')](_0x59257));if(this['md5']!==_0x5390a7){this['md5']=_0x5390a7;io['to'](util[_0x94e0('0x16')](_0x94e0('0x17'),_0x59257[_0x94e0('0x4')]))[_0x94e0('0x18')]('openchannel_queue:save',_0x59257);}};module['exports']=OpenchannelQueue;
\ No newline at end of file
+var _0xeab3=['exports','lodash','md5','util','socket.io-emitter','localhost','timeout','strategy','mapAgentsId','waiting','updateRouting','prototype','map','Agents','_rr','paused','length','online','loggedIn','available','stringify','format','emit'];(function(_0x3dea7d,_0x2cd4ea){var _0x53919a=function(_0x1554e2){while(--_0x1554e2){_0x3dea7d['push'](_0x3dea7d['shift']());}};_0x53919a(++_0x2cd4ea);}(_0xeab3,0x143));var _0x3eab=function(_0x52ac27,_0x8776c8){_0x52ac27=_0x52ac27-0x0;var _0x40732e=_0xeab3[_0x52ac27];return _0x40732e;};'use strict';var _=require(_0x3eab('0x0'));var md5=require(_0x3eab('0x1'));var util=require(_0x3eab('0x2'));var io=require(_0x3eab('0x3'))({'host':_0x3eab('0x4'),'port':0x18eb});function OpenchannelQueue(_0xfc0237){this['id']=_0xfc0237['id']||0x0;this['name']=_0xfc0237['name']||'';this[_0x3eab('0x5')]=_0xfc0237[_0x3eab('0x5')]||0xa;this[_0x3eab('0x6')]=_0xfc0237['strategy']||'beepall';this['Agents']=_0xfc0237['Agents'];this[_0x3eab('0x7')]={};this[_0x3eab('0x8')]=0x0;this['md5']='';this[_0x3eab('0x9')]();this['updateRealtime']();}OpenchannelQueue[_0x3eab('0xa')][_0x3eab('0x9')]=function(){var _0x468157=this[_0x3eab('0x7')]['_rr'];this['mapAgentsId']=_[_0x3eab('0xb')](this[_0x3eab('0xc')],'id');this[_0x3eab('0x7')][_0x3eab('0xd')]=_0x468157;};OpenchannelQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x3eab('0xe')]=0x0;for(var _0x2a89db=0x0;_0x2a89db<this[_0x3eab('0xc')][_0x3eab('0xf')];_0x2a89db+=0x1){if(this[_0x3eab('0xc')][_0x2a89db][_0x3eab('0x10')]){this[_0x3eab('0x11')]+=0x1;}if(this[_0x3eab('0xc')][_0x2a89db]['openchannelPause']){this['paused']+=0x1;}}this[_0x3eab('0x12')]=this[_0x3eab('0x11')]-this['paused'];this['available']=this['available']>=0x0?this[_0x3eab('0x12')]:0x0;var _0x4819a0={'id':this['id'],'available':this[_0x3eab('0x12')],'loggedIn':this[_0x3eab('0x11')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x3eab('0x8')]};var _0x3dc435=md5(JSON[_0x3eab('0x13')](_0x4819a0));if(this[_0x3eab('0x1')]!==_0x3dc435){this[_0x3eab('0x1')]=_0x3dc435;io['to'](util[_0x3eab('0x14')]('openchannel:queue:%s',_0x4819a0['name']))[_0x3eab('0x15')]('openchannel_queue:save',_0x4819a0);}};module[_0x3eab('0x16')]=OpenchannelQueue;
\ No newline at end of file
index b6daae6..d676e51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x750a=['smsPause','available','sms:queue:%s','emit','exports','md5','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','_rr','prototype','paused','online','loggedIn'];(function(_0x2014d3,_0x88dc82){var _0x41ca0e=function(_0x3dfbf3){while(--_0x3dfbf3){_0x2014d3['push'](_0x2014d3['shift']());}};_0x41ca0e(++_0x88dc82);}(_0x750a,0x140));var _0xa750=function(_0x660c81,_0x50d945){_0x660c81=_0x660c81-0x0;var _0x5d0f6c=_0x750a[_0x660c81];return _0x5d0f6c;};'use strict';var _=require('lodash');var md5=require(_0xa750('0x0'));var util=require('util');var io=require('socket.io-emitter')({'host':_0xa750('0x1'),'port':0x18eb});function SmsQueue(_0xeb020d){this['id']=_0xeb020d['id']||0x0;this[_0xa750('0x2')]=_0xeb020d[_0xa750('0x2')]||'';this[_0xa750('0x3')]=_0xeb020d[_0xa750('0x3')]||0xa;this[_0xa750('0x4')]=_0xeb020d[_0xa750('0x4')]||_0xa750('0x5');this[_0xa750('0x6')]=_0xeb020d[_0xa750('0x6')];this[_0xa750('0x7')]={};this[_0xa750('0x8')]=0x0;this['md5']='';this['updateRouting']();this[_0xa750('0x9')]();}SmsQueue['prototype'][_0xa750('0xa')]=function(){var _0x1760f5=this['mapAgentsId'][_0xa750('0xb')];this[_0xa750('0x7')]=_['map'](this['Agents'],'id');this[_0xa750('0x7')]['_rr']=_0x1760f5;};SmsQueue[_0xa750('0xc')][_0xa750('0x9')]=function(){this['loggedIn']=0x0;this[_0xa750('0xd')]=0x0;for(var _0x1c5657=0x0;_0x1c5657<this[_0xa750('0x6')]['length'];_0x1c5657+=0x1){if(this[_0xa750('0x6')][_0x1c5657][_0xa750('0xe')]){this[_0xa750('0xf')]+=0x1;}if(this[_0xa750('0x6')][_0x1c5657][_0xa750('0x10')]){this[_0xa750('0xd')]+=0x1;}}this['available']=this[_0xa750('0xf')]-this[_0xa750('0xd')];this[_0xa750('0x11')]=this['available']>=0x0?this[_0xa750('0x11')]:0x0;var _0x29480c={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xa750('0x2')],'paused':this['paused'],'waiting':this[_0xa750('0x8')]};var _0x1bde87=md5(JSON['stringify'](_0x29480c));if(this[_0xa750('0x0')]!==_0x1bde87){this['md5']=_0x1bde87;io['to'](util['format'](_0xa750('0x12'),_0x29480c['name']))[_0xa750('0x13')]('sms_queue:save',_0x29480c);}};module[_0xa750('0x14')]=SmsQueue;
\ No newline at end of file
+var _0x0bb5=['smsPause','available','stringify','sms:queue:%s','emit','sms_queue:save','lodash','md5','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','prototype','updateRouting','map','_rr','updateRealtime','paused','length','loggedIn'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0bb5,0x148));var _0x50bb=function(_0x100554,_0x418065){_0x100554=_0x100554-0x0;var _0x30d867=_0x0bb5[_0x100554];return _0x30d867;};'use strict';var _=require(_0x50bb('0x0'));var md5=require(_0x50bb('0x1'));var util=require('util');var io=require('socket.io-emitter')({'host':_0x50bb('0x2'),'port':0x18eb});function SmsQueue(_0x1aaa37){this['id']=_0x1aaa37['id']||0x0;this[_0x50bb('0x3')]=_0x1aaa37[_0x50bb('0x3')]||'';this[_0x50bb('0x4')]=_0x1aaa37[_0x50bb('0x4')]||0xa;this[_0x50bb('0x5')]=_0x1aaa37[_0x50bb('0x5')]||'beepall';this['Agents']=_0x1aaa37[_0x50bb('0x6')];this[_0x50bb('0x7')]={};this[_0x50bb('0x8')]=0x0;this[_0x50bb('0x1')]='';this['updateRouting']();this['updateRealtime']();}SmsQueue[_0x50bb('0x9')][_0x50bb('0xa')]=function(){var _0x3ae598=this[_0x50bb('0x7')]['_rr'];this[_0x50bb('0x7')]=_[_0x50bb('0xb')](this[_0x50bb('0x6')],'id');this[_0x50bb('0x7')][_0x50bb('0xc')]=_0x3ae598;};SmsQueue[_0x50bb('0x9')][_0x50bb('0xd')]=function(){this['loggedIn']=0x0;this[_0x50bb('0xe')]=0x0;for(var _0x58837d=0x0;_0x58837d<this[_0x50bb('0x6')][_0x50bb('0xf')];_0x58837d+=0x1){if(this[_0x50bb('0x6')][_0x58837d]['online']){this[_0x50bb('0x10')]+=0x1;}if(this[_0x50bb('0x6')][_0x58837d][_0x50bb('0x11')]){this['paused']+=0x1;}}this[_0x50bb('0x12')]=this['loggedIn']-this[_0x50bb('0xe')];this[_0x50bb('0x12')]=this[_0x50bb('0x12')]>=0x0?this[_0x50bb('0x12')]:0x0;var _0x908950={'id':this['id'],'available':this['available'],'loggedIn':this[_0x50bb('0x10')],'name':this[_0x50bb('0x3')],'paused':this['paused'],'waiting':this[_0x50bb('0x8')]};var _0x4796ec=md5(JSON[_0x50bb('0x13')](_0x908950));if(this[_0x50bb('0x1')]!==_0x4796ec){this['md5']=_0x4796ec;io['to'](util['format'](_0x50bb('0x14'),_0x908950[_0x50bb('0x3')]))[_0x50bb('0x15')](_0x50bb('0x16'),_0x908950);}};module['exports']=SmsQueue;
\ No newline at end of file
index 0485212..3adca6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd97f=['lodash','moment','../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','intervals','openchannelQueues','chatQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','mergeFromDatabase','initAgents','agents','prototype','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','updateRouting','isUndefined','mailQueues','initFaxQueues','exports','bluebird','util'];(function(_0x52b16d,_0x510ab6){var _0x172f17=function(_0x5c1eb1){while(--_0x5c1eb1){_0x52b16d['push'](_0x52b16d['shift']());}};_0x172f17(++_0x510ab6);}(_0xd97f,0x166));var _0xfd97=function(_0xe36710,_0x176822){_0xe36710=_0xe36710-0x0;var _0x23d9ee=_0xd97f[_0xe36710];return _0x23d9ee;};'use strict';var BPromise=require(_0xfd97('0x0'));var util=require(_0xfd97('0x1'));var _=require(_0xfd97('0x2'));var moment=require(_0xfd97('0x3'));var Agent=require(_0xfd97('0x4'));var Interval=require(_0xfd97('0x5'));var OpenchannelQueue=require(_0xfd97('0x6'));var ChatQueue=require(_0xfd97('0x7'));var SmsQueue=require(_0xfd97('0x8'));var MailQueue=require(_0xfd97('0x9'));var FaxQueue=require(_0xfd97('0xa'));var Realtime=function(){this['agents']={};this[_0xfd97('0xb')]={};this[_0xfd97('0xc')]={};this[_0xfd97('0xd')]={};this[_0xfd97('0xe')]={};this['mailQueues']={};this[_0xfd97('0xf')]={};this[_0xfd97('0x10')]={};this[_0xfd97('0x11')]={};this[_0xfd97('0x12')]={};this[_0xfd97('0x13')]={};this['faxQueuesWaitingInteractions']={};};function freeIsNotKey(_0x3e8d64,_0x776b5c,_0x50e637){var _0xbb469a=_[_0xfd97('0x14')](_0x3e8d64,function(_0x2ef3a6,_0x25309c){return _0x2ef3a6[_0x50e637];});for(var _0x485d55 in _0x776b5c){if(_0x776b5c[_0xfd97('0x15')](_0x485d55)){if(!_0xbb469a[_0x485d55]){delete _0x776b5c[_0x485d55];}}}}Realtime['prototype'][_0xfd97('0x16')]=function(_0x1e67a4,_0x1e6d42){for(var _0x6119ed in _0x1e6d42){if(_0x1e67a4[_0xfd97('0x15')](_0x6119ed)){_0x1e67a4[_0x6119ed]=_0x1e6d42[_0x6119ed];}}};Realtime['prototype'][_0xfd97('0x17')]=function(){var _0xe87c78=this;return function(_0x11cea3){if(_0x11cea3){freeIsNotKey(_0x11cea3,_0xe87c78['agents'],'id');for(var _0x5e3bd9=0x0,_0x465e7d={},_0x5747c6={};_0x5e3bd9<_0x11cea3['length'];_0x5e3bd9+=0x1){_0x465e7d=_0x11cea3[_0x5e3bd9];if(_['isUndefined'](_0xe87c78['agents'][_0x465e7d['id']])){_0xe87c78[_0xfd97('0x18')][_0x465e7d['id']]=new Agent(_0x465e7d);}else{_0xe87c78[_0xfd97('0x16')](_0xe87c78[_0xfd97('0x18')][_0x465e7d['id']],_0x465e7d);}}}return _0xe87c78['agents'];};};Realtime[_0xfd97('0x19')][_0xfd97('0x1a')]=function(){var _0x3edb26=this;return function(_0x214e96){if(_0x214e96){freeIsNotKey(_0x214e96,_0x3edb26[_0xfd97('0xb')],'id');for(var _0x3bdc3e=0x0,_0x1ef5ae={},_0x18b217={};_0x3bdc3e<_0x214e96[_0xfd97('0x1b')];_0x3bdc3e+=0x1){_0x1ef5ae=_0x214e96[_0x3bdc3e];if(_['isUndefined'](_0x3edb26[_0xfd97('0xb')][_0x1ef5ae['id']])){_0x3edb26['intervals'][_0x1ef5ae['id']]=new Interval(_0x1ef5ae);}else{_0x3edb26[_0xfd97('0x16')](_0x3edb26[_0xfd97('0xb')][_0x1ef5ae['id']],_0x1ef5ae);}}}return _0x3edb26[_0xfd97('0xb')];};};Realtime[_0xfd97('0x19')][_0xfd97('0x1c')]=function(){var _0x1e4731=this;return function(_0x589048){if(_0x589048){freeIsNotKey(_0x589048,_0x1e4731[_0xfd97('0xc')],'id');for(var _0x5ae293=0x0,_0x4f09f5={},_0x320f46={};_0x5ae293<_0x589048[_0xfd97('0x1b')];_0x5ae293+=0x1){_0x4f09f5=_0x589048[_0x5ae293];if(_['isUndefined'](_0x1e4731[_0xfd97('0xc')][_0x4f09f5['id']])){_0x1e4731[_0xfd97('0xc')][_0x4f09f5['id']]=new OpenchannelQueue(_0x4f09f5);}else{_0x1e4731[_0xfd97('0x16')](_0x1e4731[_0xfd97('0xc')][_0x4f09f5['id']],_0x4f09f5);}_0x1e4731[_0xfd97('0xc')][_0x4f09f5['id']]['updateRouting']();_0x1e4731[_0xfd97('0xc')][_0x4f09f5['id']][_0xfd97('0x1d')]();}}return _0x1e4731['openchannelQueues'];};};Realtime['prototype'][_0xfd97('0x1e')]=function(){var _0x27a218=this;return function(_0x10e159){if(_0x10e159){freeIsNotKey(_0x10e159,_0x27a218['chatQueues'],'id');for(var _0x3d93f2=0x0,_0x28dc2d={},_0x1edbbe={};_0x3d93f2<_0x10e159[_0xfd97('0x1b')];_0x3d93f2+=0x1){_0x28dc2d=_0x10e159[_0x3d93f2];if(_['isUndefined'](_0x27a218[_0xfd97('0xd')][_0x28dc2d['id']])){_0x27a218[_0xfd97('0xd')][_0x28dc2d['id']]=new ChatQueue(_0x28dc2d);}else{_0x27a218['mergeFromDatabase'](_0x27a218['chatQueues'][_0x28dc2d['id']],_0x28dc2d);}_0x27a218['chatQueues'][_0x28dc2d['id']][_0xfd97('0x1f')]();_0x27a218[_0xfd97('0xd')][_0x28dc2d['id']][_0xfd97('0x1d')]();}}return _0x27a218[_0xfd97('0xd')];};};Realtime[_0xfd97('0x19')]['initSmsQueues']=function(){var _0x29f0bc=this;return function(_0x438a13){if(_0x438a13){freeIsNotKey(_0x438a13,_0x29f0bc[_0xfd97('0xe')],'id');for(var _0x435420=0x0,_0x53d68a={},_0x55d315={};_0x435420<_0x438a13[_0xfd97('0x1b')];_0x435420+=0x1){_0x53d68a=_0x438a13[_0x435420];if(_[_0xfd97('0x20')](_0x29f0bc['smsQueues'][_0x53d68a['id']])){_0x29f0bc[_0xfd97('0xe')][_0x53d68a['id']]=new SmsQueue(_0x53d68a);}else{_0x29f0bc[_0xfd97('0x16')](_0x29f0bc[_0xfd97('0xe')][_0x53d68a['id']],_0x53d68a);}_0x29f0bc[_0xfd97('0xe')][_0x53d68a['id']][_0xfd97('0x1f')]();_0x29f0bc[_0xfd97('0xe')][_0x53d68a['id']]['updateRealtime']();}}return _0x29f0bc[_0xfd97('0xe')];};};Realtime[_0xfd97('0x19')]['initMailQueues']=function(){var _0x2c86a3=this;return function(_0x5447fc){if(_0x5447fc){freeIsNotKey(_0x5447fc,_0x2c86a3['mailQueues'],'id');for(var _0x1601d4=0x0,_0x115c15={},_0x1271d2={};_0x1601d4<_0x5447fc['length'];_0x1601d4+=0x1){_0x115c15=_0x5447fc[_0x1601d4];if(_['isUndefined'](_0x2c86a3[_0xfd97('0x21')][_0x115c15['id']])){_0x2c86a3[_0xfd97('0x21')][_0x115c15['id']]=new MailQueue(_0x115c15);}else{_0x2c86a3[_0xfd97('0x16')](_0x2c86a3['mailQueues'][_0x115c15['id']],_0x115c15);}_0x2c86a3['mailQueues'][_0x115c15['id']][_0xfd97('0x1f')]();_0x2c86a3[_0xfd97('0x21')][_0x115c15['id']][_0xfd97('0x1d')]();}}return _0x2c86a3['mailQueues'];};};Realtime['prototype'][_0xfd97('0x22')]=function(){var _0x45670b=this;return function(_0x3c9a18){if(_0x3c9a18){freeIsNotKey(_0x3c9a18,_0x45670b['faxQueues'],'id');for(var _0x3ccae1=0x0,_0x45b0ba={},_0x3da407={};_0x3ccae1<_0x3c9a18[_0xfd97('0x1b')];_0x3ccae1+=0x1){_0x45b0ba=_0x3c9a18[_0x3ccae1];if(_[_0xfd97('0x20')](_0x45670b[_0xfd97('0xf')][_0x45b0ba['id']])){_0x45670b[_0xfd97('0xf')][_0x45b0ba['id']]=new FaxQueue(_0x45b0ba);}else{_0x45670b['mergeFromDatabase'](_0x45670b['faxQueues'][_0x45b0ba['id']],_0x45b0ba);}_0x45670b[_0xfd97('0xf')][_0x45b0ba['id']]['updateRouting']();_0x45670b[_0xfd97('0xf')][_0x45b0ba['id']]['updateRealtime']();}}return _0x45670b[_0xfd97('0xf')];};};module[_0xfd97('0x23')]=Realtime;
\ No newline at end of file
+var _0xfb0d=['smsQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','prototype','mergeFromDatabase','initAgents','length','isUndefined','agents','initOpenchannelQueues','updateRouting','updateRealtime','initChatQueues','initSmsQueues','initMailQueues','exports','bluebird','lodash','moment','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','intervals','openchannelQueues','chatQueues'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xfb0d,0x12b));var _0xdfb0=function(_0x5e81a4,_0x259b8a){_0x5e81a4=_0x5e81a4-0x0;var _0x491e72=_0xfb0d[_0x5e81a4];return _0x491e72;};'use strict';var BPromise=require(_0xdfb0('0x0'));var util=require('util');var _=require(_0xdfb0('0x1'));var moment=require(_0xdfb0('0x2'));var Agent=require('../model/agent');var Interval=require('../model/interval');var OpenchannelQueue=require(_0xdfb0('0x3'));var ChatQueue=require(_0xdfb0('0x4'));var SmsQueue=require(_0xdfb0('0x5'));var MailQueue=require(_0xdfb0('0x6'));var FaxQueue=require(_0xdfb0('0x7'));var Realtime=function(){this['agents']={};this[_0xdfb0('0x8')]={};this[_0xdfb0('0x9')]={};this[_0xdfb0('0xa')]={};this[_0xdfb0('0xb')]={};this[_0xdfb0('0xc')]={};this[_0xdfb0('0xd')]={};this[_0xdfb0('0xe')]={};this['mailQueuesWaitingInteractions']={};this[_0xdfb0('0xf')]={};this[_0xdfb0('0x10')]={};this['faxQueuesWaitingInteractions']={};};function freeIsNotKey(_0x1f8515,_0x514cae,_0x1b999b){var _0x643a9c=_[_0xdfb0('0x11')](_0x1f8515,function(_0x205d1b,_0x549eb7){return _0x205d1b[_0x1b999b];});for(var _0x3c35bb in _0x514cae){if(_0x514cae['hasOwnProperty'](_0x3c35bb)){if(!_0x643a9c[_0x3c35bb]){delete _0x514cae[_0x3c35bb];}}}}Realtime[_0xdfb0('0x12')][_0xdfb0('0x13')]=function(_0xe6b894,_0xcd506){for(var _0x1701f9 in _0xcd506){if(_0xe6b894['hasOwnProperty'](_0x1701f9)){_0xe6b894[_0x1701f9]=_0xcd506[_0x1701f9];}}};Realtime[_0xdfb0('0x12')][_0xdfb0('0x14')]=function(){var _0x39682f=this;return function(_0x210e93){if(_0x210e93){freeIsNotKey(_0x210e93,_0x39682f['agents'],'id');for(var _0x31e5c0=0x0,_0x53be6c={},_0x29d7de={};_0x31e5c0<_0x210e93[_0xdfb0('0x15')];_0x31e5c0+=0x1){_0x53be6c=_0x210e93[_0x31e5c0];if(_[_0xdfb0('0x16')](_0x39682f[_0xdfb0('0x17')][_0x53be6c['id']])){_0x39682f[_0xdfb0('0x17')][_0x53be6c['id']]=new Agent(_0x53be6c);}else{_0x39682f[_0xdfb0('0x13')](_0x39682f[_0xdfb0('0x17')][_0x53be6c['id']],_0x53be6c);}}}return _0x39682f[_0xdfb0('0x17')];};};Realtime[_0xdfb0('0x12')]['initIntervals']=function(){var _0x41d31c=this;return function(_0x3b6634){if(_0x3b6634){freeIsNotKey(_0x3b6634,_0x41d31c['intervals'],'id');for(var _0x231bb7=0x0,_0x39d544={},_0x5609b8={};_0x231bb7<_0x3b6634[_0xdfb0('0x15')];_0x231bb7+=0x1){_0x39d544=_0x3b6634[_0x231bb7];if(_[_0xdfb0('0x16')](_0x41d31c['intervals'][_0x39d544['id']])){_0x41d31c['intervals'][_0x39d544['id']]=new Interval(_0x39d544);}else{_0x41d31c[_0xdfb0('0x13')](_0x41d31c[_0xdfb0('0x8')][_0x39d544['id']],_0x39d544);}}}return _0x41d31c[_0xdfb0('0x8')];};};Realtime[_0xdfb0('0x12')][_0xdfb0('0x18')]=function(){var _0x43dd96=this;return function(_0x43514b){if(_0x43514b){freeIsNotKey(_0x43514b,_0x43dd96[_0xdfb0('0x9')],'id');for(var _0x32abeb=0x0,_0x1cbd59={},_0x10baa3={};_0x32abeb<_0x43514b['length'];_0x32abeb+=0x1){_0x1cbd59=_0x43514b[_0x32abeb];if(_['isUndefined'](_0x43dd96['openchannelQueues'][_0x1cbd59['id']])){_0x43dd96[_0xdfb0('0x9')][_0x1cbd59['id']]=new OpenchannelQueue(_0x1cbd59);}else{_0x43dd96[_0xdfb0('0x13')](_0x43dd96[_0xdfb0('0x9')][_0x1cbd59['id']],_0x1cbd59);}_0x43dd96[_0xdfb0('0x9')][_0x1cbd59['id']][_0xdfb0('0x19')]();_0x43dd96[_0xdfb0('0x9')][_0x1cbd59['id']][_0xdfb0('0x1a')]();}}return _0x43dd96[_0xdfb0('0x9')];};};Realtime[_0xdfb0('0x12')][_0xdfb0('0x1b')]=function(){var _0x8322bf=this;return function(_0x22b4a2){if(_0x22b4a2){freeIsNotKey(_0x22b4a2,_0x8322bf[_0xdfb0('0xa')],'id');for(var _0x562da1=0x0,_0x4886d1={},_0x1d5c44={};_0x562da1<_0x22b4a2['length'];_0x562da1+=0x1){_0x4886d1=_0x22b4a2[_0x562da1];if(_['isUndefined'](_0x8322bf[_0xdfb0('0xa')][_0x4886d1['id']])){_0x8322bf[_0xdfb0('0xa')][_0x4886d1['id']]=new ChatQueue(_0x4886d1);}else{_0x8322bf[_0xdfb0('0x13')](_0x8322bf[_0xdfb0('0xa')][_0x4886d1['id']],_0x4886d1);}_0x8322bf['chatQueues'][_0x4886d1['id']][_0xdfb0('0x19')]();_0x8322bf['chatQueues'][_0x4886d1['id']]['updateRealtime']();}}return _0x8322bf[_0xdfb0('0xa')];};};Realtime['prototype'][_0xdfb0('0x1c')]=function(){var _0x2c2a13=this;return function(_0x5ea17d){if(_0x5ea17d){freeIsNotKey(_0x5ea17d,_0x2c2a13[_0xdfb0('0xb')],'id');for(var _0x72b6f6=0x0,_0x74cc4a={},_0x45b3fa={};_0x72b6f6<_0x5ea17d[_0xdfb0('0x15')];_0x72b6f6+=0x1){_0x74cc4a=_0x5ea17d[_0x72b6f6];if(_[_0xdfb0('0x16')](_0x2c2a13['smsQueues'][_0x74cc4a['id']])){_0x2c2a13['smsQueues'][_0x74cc4a['id']]=new SmsQueue(_0x74cc4a);}else{_0x2c2a13['mergeFromDatabase'](_0x2c2a13[_0xdfb0('0xb')][_0x74cc4a['id']],_0x74cc4a);}_0x2c2a13[_0xdfb0('0xb')][_0x74cc4a['id']][_0xdfb0('0x19')]();_0x2c2a13[_0xdfb0('0xb')][_0x74cc4a['id']]['updateRealtime']();}}return _0x2c2a13[_0xdfb0('0xb')];};};Realtime[_0xdfb0('0x12')][_0xdfb0('0x1d')]=function(){var _0x164698=this;return function(_0x219995){if(_0x219995){freeIsNotKey(_0x219995,_0x164698[_0xdfb0('0xc')],'id');for(var _0x5bd09b=0x0,_0x5b41b6={},_0x2ef9f1={};_0x5bd09b<_0x219995[_0xdfb0('0x15')];_0x5bd09b+=0x1){_0x5b41b6=_0x219995[_0x5bd09b];if(_[_0xdfb0('0x16')](_0x164698['mailQueues'][_0x5b41b6['id']])){_0x164698['mailQueues'][_0x5b41b6['id']]=new MailQueue(_0x5b41b6);}else{_0x164698[_0xdfb0('0x13')](_0x164698['mailQueues'][_0x5b41b6['id']],_0x5b41b6);}_0x164698['mailQueues'][_0x5b41b6['id']][_0xdfb0('0x19')]();_0x164698['mailQueues'][_0x5b41b6['id']][_0xdfb0('0x1a')]();}}return _0x164698[_0xdfb0('0xc')];};};Realtime['prototype']['initFaxQueues']=function(){var _0x3037b6=this;return function(_0x2eec0d){if(_0x2eec0d){freeIsNotKey(_0x2eec0d,_0x3037b6['faxQueues'],'id');for(var _0x1643d1=0x0,_0x3facdc={},_0xe13a06={};_0x1643d1<_0x2eec0d[_0xdfb0('0x15')];_0x1643d1+=0x1){_0x3facdc=_0x2eec0d[_0x1643d1];if(_['isUndefined'](_0x3037b6[_0xdfb0('0xd')][_0x3facdc['id']])){_0x3037b6['faxQueues'][_0x3facdc['id']]=new FaxQueue(_0x3facdc);}else{_0x3037b6['mergeFromDatabase'](_0x3037b6[_0xdfb0('0xd')][_0x3facdc['id']],_0x3facdc);}_0x3037b6['faxQueues'][_0x3facdc['id']]['updateRouting']();_0x3037b6[_0xdfb0('0xd')][_0x3facdc['id']][_0xdfb0('0x1a')]();}}return _0x3037b6[_0xdfb0('0xd')];};};module[_0xdfb0('0x1e')]=Realtime;
\ No newline at end of file
index 650d007..d2f70ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5979=['update','Request','UpdateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x3050ad,_0x377c3d){var _0x5023ad=function(_0x274025){while(--_0x274025){_0x3050ad['push'](_0x3050ad['shift']());}};_0x5023ad(++_0x377c3d);}(_0x5979,0x167));var _0x9597=function(_0x5d90b8,_0x528b3a){_0x5d90b8=_0x5d90b8-0x0;var _0x5712b3=_0x5979[_0x5d90b8];return _0x5712b3;};'use strict';var client=require(_0x9597('0x0'));exports[_0x9597('0x1')]=function(_0x3c2aee,_0xf47786){return client[_0x9597('0x2')](_0x9597('0x3'),{'body':_0xf47786,'options':{'where':{'id':_0x3c2aee}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x2db380,_0x108016){return client[_0x9597('0x2')](_0x9597('0x4'),{'body':_0x108016,'options':{'where':{'id':_0x2db380}},'log':_0x9597('0x5')});};
\ No newline at end of file
+var _0x6034=['addTags','AddTagsToChatInteraction','addTagsToChatInteraction','update','Request','updateChatInteraction'];(function(_0x1ba1e2,_0xa0bfad){var _0x125b56=function(_0x4c46ae){while(--_0x4c46ae){_0x1ba1e2['push'](_0x1ba1e2['shift']());}};_0x125b56(++_0xa0bfad);}(_0x6034,0x195));var _0x4603=function(_0x5c446c,_0x3aee94){_0x5c446c=_0x5c446c-0x0;var _0xbfb6f5=_0x6034[_0x5c446c];return _0xbfb6f5;};'use strict';var client=require('../client');exports[_0x4603('0x0')]=function(_0x2d6aa6,_0x9b86ac){return client[_0x4603('0x1')]('UpdateChatInteraction',{'body':_0x9b86ac,'options':{'where':{'id':_0x2d6aa6}},'log':_0x4603('0x2')});};exports[_0x4603('0x3')]=function(_0xacd6ef,_0x5f1849){return client['Request'](_0x4603('0x4'),{'body':_0x5f1849,'options':{'where':{'id':_0xacd6ef}},'log':_0x4603('0x5')});};
\ No newline at end of file
index 1168cf7..401e481 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcf4=['CreateChatMessage','createChatMessage','create','Request'];(function(_0x5ca6b7,_0x1a4f32){var _0x2d7743=function(_0x569d42){while(--_0x569d42){_0x5ca6b7['push'](_0x5ca6b7['shift']());}};_0x2d7743(++_0x1a4f32);}(_0xfcf4,0x142));var _0x4fcf=function(_0x3b4c8d,_0x55fa78){_0x3b4c8d=_0x3b4c8d-0x0;var _0x24afef=_0xfcf4[_0x3b4c8d];return _0x24afef;};'use strict';var client=require('../client');exports[_0x4fcf('0x0')]=function(_0x4e3edc){return client[_0x4fcf('0x1')](_0x4fcf('0x2'),{'body':_0x4e3edc,'log':_0x4fcf('0x3')});};
\ No newline at end of file
+var _0xdd1c=['create','CreateChatMessage','createChatMessage','../client'];(function(_0x24201c,_0x39b5ba){var _0x18bf75=function(_0x2e0b60){while(--_0x2e0b60){_0x24201c['push'](_0x24201c['shift']());}};_0x18bf75(++_0x39b5ba);}(_0xdd1c,0x73));var _0xcdd1=function(_0x3ecf65,_0x3bac13){_0x3ecf65=_0x3ecf65-0x0;var _0x1907df=_0xdd1c[_0x3ecf65];return _0x1907df;};'use strict';var client=require(_0xcdd1('0x0'));exports[_0xcdd1('0x1')]=function(_0x5b5d85){return client['Request'](_0xcdd1('0x2'),{'body':_0x5b5d85,'log':_0xcdd1('0x3')});};
\ No newline at end of file
index ed9c9bf..43d7d04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecbd=['../client','name','User','Agents','online','chatPause','getChatQueues'];(function(_0x139c24,_0x562ba1){var _0xed1b28=function(_0x3d0f24){while(--_0x3d0f24){_0x139c24['push'](_0x139c24['shift']());}};_0xed1b28(++_0x562ba1);}(_0xecbd,0x1f1));var _0xdecb=function(_0x140c9a,_0x385656){_0x140c9a=_0x140c9a-0x0;var _0x254ff6=_0xecbd[_0x140c9a];return _0x254ff6;};'use strict';var client=require(_0xdecb('0x0'));exports['getChatQueues']=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xdecb('0x1'),'timeout','strategy'],'include':[{'model':_0xdecb('0x2'),'as':_0xdecb('0x3'),'attributes':['id',_0xdecb('0x1'),_0xdecb('0x4'),_0xdecb('0x5')]}]},'log':_0xdecb('0x6')});};};
\ No newline at end of file
+var _0xac9e=['timeout','User','Agents','online','../client','getChatQueues','name'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xac9e,0x17e));var _0xeac9=function(_0x52695a,_0x510db4){_0x52695a=_0x52695a-0x0;var _0x40e83a=_0xac9e[_0x52695a];return _0x40e83a;};'use strict';var client=require(_0xeac9('0x0'));exports[_0xeac9('0x1')]=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xeac9('0x2'),_0xeac9('0x3'),'strategy'],'include':[{'model':_0xeac9('0x4'),'as':_0xeac9('0x5'),'attributes':['id',_0xeac9('0x2'),_0xeac9('0x6'),'chatPause']}]},'log':_0xeac9('0x1')});};};
\ No newline at end of file
index 9433ceb..81849ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0ba=['DESC','../client','create','Request','CreateChatQueueReport','update'];(function(_0x4abc8f,_0xef597d){var _0x5d7939=function(_0x145f23){while(--_0x145f23){_0x4abc8f['push'](_0x4abc8f['shift']());}};_0x5d7939(++_0xef597d);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xaf0b('0x0'));exports[_0xaf0b('0x1')]=function(_0x1caf8c){return client[_0xaf0b('0x2')](_0xaf0b('0x3'),{'body':_0x1caf8c,'log':'CreateChatQueueReport'});};exports[_0xaf0b('0x4')]=function(_0xce0364,_0x4cffa5){return client[_0xaf0b('0x2')]('UpdateChatQueueReport',{'body':_0x4cffa5,'options':{'where':{'uniqueid':_0xce0364},'order':[['id',_0xaf0b('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});};
\ No newline at end of file
+var _0xb492=['CreateChatQueueReport','UpdateChatQueueReport','create','Request'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb492,0x172));var _0x2b49=function(_0x1a276e,_0x1d75a6){_0x1a276e=_0x1a276e-0x0;var _0x302c25=_0xb492[_0x1a276e];return _0x302c25;};'use strict';var client=require('../client');exports[_0x2b49('0x0')]=function(_0x32fdad){return client[_0x2b49('0x1')](_0x2b49('0x2'),{'body':_0x32fdad,'log':'CreateChatQueueReport'});};exports['update']=function(_0x31a7e5,_0x340296){return client[_0x2b49('0x1')](_0x2b49('0x3'),{'body':_0x340296,'options':{'where':{'uniqueid':_0x31a7e5},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});};
\ No newline at end of file
index c0e5b81..dd9234e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46da=['Request','addTags','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client'];(function(_0x338828,_0x2cb6a4){var _0x58e89b=function(_0x4a4f35){while(--_0x4a4f35){_0x338828['push'](_0x338828['shift']());}};_0x58e89b(++_0x2cb6a4);}(_0x46da,0x135));var _0xa46d=function(_0x40ac74,_0x17852d){_0x40ac74=_0x40ac74-0x0;var _0x40b485=_0x46da[_0x40ac74];return _0x40b485;};'use strict';var client=require(_0xa46d('0x0'));exports['update']=function(_0x3e44a0,_0x570f7c){return client[_0xa46d('0x1')]('UpdateFaxInteraction',{'body':_0x570f7c,'options':{'where':{'id':_0x3e44a0}},'log':'updateFaxInteraction'});};exports[_0xa46d('0x2')]=function(_0x1725e4,_0x190c1c){return client['Request'](_0xa46d('0x3'),{'body':_0x190c1c,'options':{'where':{'id':_0x1725e4}},'log':_0xa46d('0x4')});};
\ No newline at end of file
+var _0x5c43=['../client','update','Request','UpdateFaxInteraction','updateFaxInteraction','addTags','AddTagsToFaxInteraction','addTagsToFaxInteraction'];(function(_0x685201,_0x5312a0){var _0x5daffa=function(_0x1bf910){while(--_0x1bf910){_0x685201['push'](_0x685201['shift']());}};_0x5daffa(++_0x5312a0);}(_0x5c43,0xd8));var _0x35c4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5c43[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x35c4('0x0'));exports[_0x35c4('0x1')]=function(_0x5adfca,_0x4b16cc){return client[_0x35c4('0x2')](_0x35c4('0x3'),{'body':_0x4b16cc,'options':{'where':{'id':_0x5adfca}},'log':_0x35c4('0x4')});};exports[_0x35c4('0x5')]=function(_0x40e9ec,_0x1846d9){return client[_0x35c4('0x2')](_0x35c4('0x6'),{'body':_0x1846d9,'options':{'where':{'id':_0x40e9ec}},'log':_0x35c4('0x7')});};
\ No newline at end of file
index 70d2dd5..53cbed8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebfd=['CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x2bdd9c,_0x31871a){var _0x2ded3b=function(_0x4d30f4){while(--_0x4d30f4){_0x2bdd9c['push'](_0x2bdd9c['shift']());}};_0x2ded3b(++_0x31871a);}(_0xebfd,0x1aa));var _0xdebf=function(_0x5dbb84,_0x1bbce9){_0x5dbb84=_0x5dbb84-0x0;var _0x1d6eae=_0xebfd[_0x5dbb84];return _0x1d6eae;};'use strict';var client=require(_0xdebf('0x0'));exports[_0xdebf('0x1')]=function(_0x533431){return client['Request'](_0xdebf('0x2'),{'body':_0x533431,'log':_0xdebf('0x3')});};
\ No newline at end of file
+var _0x5540=['createFaxMessage','../client','Request','CreateFaxMessage'];(function(_0x250124,_0x2b6a6c){var _0x330afc=function(_0x43ed4b){while(--_0x43ed4b){_0x250124['push'](_0x250124['shift']());}};_0x330afc(++_0x2b6a6c);}(_0x5540,0xb9));var _0x0554=function(_0x53b4e8,_0x3d2a6d){_0x53b4e8=_0x53b4e8-0x0;var _0x1013ad=_0x5540[_0x53b4e8];return _0x1013ad;};'use strict';var client=require(_0x0554('0x0'));exports['create']=function(_0x2d7c13){return client[_0x0554('0x1')](_0x0554('0x2'),{'body':_0x2d7c13,'log':_0x0554('0x3')});};
\ No newline at end of file
index 759753b..aa162d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41c1=['name','online','faxPause','getFaxQueues','../client','Request','timeout','strategy','Agents'];(function(_0xb7b878,_0x5c3b92){var _0x3c84b9=function(_0x21d5a2){while(--_0x21d5a2){_0xb7b878['push'](_0xb7b878['shift']());}};_0x3c84b9(++_0x5c3b92);}(_0x41c1,0x1c6));var _0x141c=function(_0x2b0acc,_0x4ae9d9){_0x2b0acc=_0x2b0acc-0x0;var _0x4d2cfb=_0x41c1[_0x2b0acc];return _0x4d2cfb;};'use strict';var client=require(_0x141c('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x141c('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0x141c('0x2'),_0x141c('0x3')],'include':[{'model':'User','as':_0x141c('0x4'),'attributes':['id',_0x141c('0x5'),_0x141c('0x6'),_0x141c('0x7')]}]},'log':_0x141c('0x8')});};};
\ No newline at end of file
+var _0xa3f1=['online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','strategy','User','Agents'];(function(_0xcb2aae,_0x5485e8){var _0x28a172=function(_0x34fde2){while(--_0x34fde2){_0xcb2aae['push'](_0xcb2aae['shift']());}};_0x28a172(++_0x5485e8);}(_0xa3f1,0x110));var _0x1a3f=function(_0x386c97,_0x2322b1){_0x386c97=_0x386c97-0x0;var _0x44c4ed=_0xa3f1[_0x386c97];return _0x44c4ed;};'use strict';var client=require(_0x1a3f('0x0'));exports[_0x1a3f('0x1')]=function(){return function(){return client[_0x1a3f('0x2')](_0x1a3f('0x3'),{'options':{'raw':![],'attributes':['id',_0x1a3f('0x4'),'timeout',_0x1a3f('0x5')],'include':[{'model':_0x1a3f('0x6'),'as':_0x1a3f('0x7'),'attributes':['id','name',_0x1a3f('0x8'),_0x1a3f('0x9')]}]},'log':'getFaxQueues'});};};
\ No newline at end of file
index 4fa7c69..17d707d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9305=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0x4a5182,_0x135866){var _0x5c1ae5=function(_0x59eb7c){while(--_0x59eb7c){_0x4a5182['push'](_0x4a5182['shift']());}};_0x5c1ae5(++_0x135866);}(_0x9305,0x1e2));var _0x5930=function(_0x43111f,_0x32a1a2){_0x43111f=_0x43111f-0x0;var _0xfd01d9=_0x9305[_0x43111f];return _0xfd01d9;};'use strict';var client=require(_0x5930('0x0'));exports[_0x5930('0x1')]=function(_0x454dee){return client[_0x5930('0x2')]('CreateFaxQueueReport',{'body':_0x454dee,'log':_0x5930('0x3')});};exports[_0x5930('0x4')]=function(_0x124f7c,_0x16c710){return client['Request'](_0x5930('0x5'),{'body':_0x16c710,'options':{'where':{'uniqueid':_0x124f7c},'order':[['id',_0x5930('0x6')]],'limit':0x1},'log':_0x5930('0x5')});};
\ No newline at end of file
+var _0x8d27=['CreateFaxQueueReport','DESC','UpdateFaxQueueReport','create','Request'];(function(_0x13b359,_0x2aa19f){var _0x4c5be7=function(_0x41dffd){while(--_0x41dffd){_0x13b359['push'](_0x13b359['shift']());}};_0x4c5be7(++_0x2aa19f);}(_0x8d27,0x1c5));var _0x78d2=function(_0x10e46b,_0x431d72){_0x10e46b=_0x10e46b-0x0;var _0x462267=_0x8d27[_0x10e46b];return _0x462267;};'use strict';var client=require('../client');exports[_0x78d2('0x0')]=function(_0x43cc53){return client[_0x78d2('0x1')](_0x78d2('0x2'),{'body':_0x43cc53,'log':_0x78d2('0x2')});};exports['update']=function(_0x48f767,_0x39f5ef){return client[_0x78d2('0x1')]('UpdateFaxQueueReport',{'body':_0x39f5ef,'options':{'where':{'uniqueid':_0x48f767},'order':[['id',_0x78d2('0x3')]],'limit':0x1},'log':_0x78d2('0x4')});};
\ No newline at end of file
index d28e011..8b86271 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1eba=['GetInterval','name','interval','../client','getIntervals','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x2ce6d5,_0x333e0c){_0x2ce6d5=_0x2ce6d5-0x0;var _0x32d272=_0x1eba[_0x2ce6d5];return _0x32d272;};'use strict';var client=require(_0xa1eb('0x0'));exports[_0xa1eb('0x1')]=function(){return function(){return client[_0xa1eb('0x2')](_0xa1eb('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xa1eb('0x4')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0xa1eb('0x4'),_0xa1eb('0x5')]}]},'log':_0xa1eb('0x1')});};};
\ No newline at end of file
+var _0xb8a0=['Interval','Request','GetInterval'];(function(_0x54c17a,_0x480446){var _0x5f0254=function(_0x302af8){while(--_0x302af8){_0x54c17a['push'](_0x54c17a['shift']());}};_0x5f0254(++_0x480446);}(_0xb8a0,0x1d5));var _0x0b8a=function(_0x1d8a80,_0x5c3c31){_0x1d8a80=_0x1d8a80-0x0;var _0x1d6177=_0xb8a0[_0x1d8a80];return _0x1d6177;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client[_0x0b8a('0x0')](_0x0b8a('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x0b8a('0x2'),'as':'Intervals','attributes':['id','name','interval']}]},'log':'getIntervals'});};};
\ No newline at end of file
index 04464fc..9d97110 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b2e=['addTagsToChatInteraction','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x1d7791,_0x2a291f){var _0x2293f8=function(_0x464734){while(--_0x464734){_0x1d7791['push'](_0x1d7791['shift']());}};_0x2293f8(++_0x2a291f);}(_0x0b2e,0x1d2));var _0xe0b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b2e[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['update']=function(_0x3bde58,_0x1c479b){return client[_0xe0b2('0x0')](_0xe0b2('0x1'),{'body':_0x1c479b,'options':{'where':{'id':_0x3bde58}},'log':_0xe0b2('0x2')});};exports[_0xe0b2('0x3')]=function(_0x26abb1,_0x13a878){return client['Request']('AddTagsToMailInteraction',{'body':_0x13a878,'options':{'where':{'id':_0x26abb1}},'log':_0xe0b2('0x4')});};
\ No newline at end of file
+var _0x7d9a=['AddTagsToMailInteraction','addTagsToChatInteraction','update','Request','updateMailInteraction','addTags'];(function(_0x48468b,_0x2f7d9d){var _0x536e3e=function(_0x132e2c){while(--_0x132e2c){_0x48468b['push'](_0x48468b['shift']());}};_0x536e3e(++_0x2f7d9d);}(_0x7d9a,0x1b2));var _0xa7d9=function(_0x466607,_0x1516a7){_0x466607=_0x466607-0x0;var _0xcbf523=_0x7d9a[_0x466607];return _0xcbf523;};'use strict';var client=require('../client');exports[_0xa7d9('0x0')]=function(_0x4b3258,_0x37b54f){return client[_0xa7d9('0x1')]('UpdateMailInteraction',{'body':_0x37b54f,'options':{'where':{'id':_0x4b3258}},'log':_0xa7d9('0x2')});};exports[_0xa7d9('0x3')]=function(_0x50238f,_0x2271a3){return client['Request'](_0xa7d9('0x4'),{'body':_0x2271a3,'options':{'where':{'id':_0x50238f}},'log':_0xa7d9('0x5')});};
\ No newline at end of file
index 8e8d105..916746a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d38=['../client','Request'];(function(_0x268097,_0x1cb767){var _0x1b34c9=function(_0x4cac2b){while(--_0x4cac2b){_0x268097['push'](_0x268097['shift']());}};_0x1b34c9(++_0x1cb767);}(_0x0d38,0xfc));var _0x80d3=function(_0x5cca1e,_0x21f6a3){_0x5cca1e=_0x5cca1e-0x0;var _0x205561=_0x0d38[_0x5cca1e];return _0x205561;};'use strict';var client=require(_0x80d3('0x0'));exports['create']=function(_0x1792c9){return client[_0x80d3('0x1')]('CreateMailMessage',{'body':_0x1792c9,'log':'createMailMessage'});};
\ No newline at end of file
+var _0x4710=['../client','createMailMessage'];(function(_0x1f780b,_0x25f912){var _0x11f2f7=function(_0x40d41b){while(--_0x40d41b){_0x1f780b['push'](_0x1f780b['shift']());}};_0x11f2f7(++_0x25f912);}(_0x4710,0x1e8));var _0x0471=function(_0x411b66,_0x2797cb){_0x411b66=_0x411b66-0x0;var _0x37048b=_0x4710[_0x411b66];return _0x37048b;};'use strict';var client=require(_0x0471('0x0'));exports['create']=function(_0x221a79){return client['Request']('CreateMailMessage',{'body':_0x221a79,'log':_0x0471('0x1')});};
\ No newline at end of file
index 403cfa7..cdc699a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0571=['timeout','strategy','User','Agents','mailPause','../client','getMailQueues','GetMailQueue','name'];(function(_0x53c47f,_0x56fc53){var _0x2e51c7=function(_0x3283c3){while(--_0x3283c3){_0x53c47f['push'](_0x53c47f['shift']());}};_0x2e51c7(++_0x56fc53);}(_0x0571,0x10a));var _0x1057=function(_0x336264,_0x32e1d9){_0x336264=_0x336264-0x0;var _0x53cf91=_0x0571[_0x336264];return _0x53cf91;};'use strict';var client=require(_0x1057('0x0'));exports[_0x1057('0x1')]=function(){return function(){return client['Request'](_0x1057('0x2'),{'options':{'raw':![],'attributes':['id',_0x1057('0x3'),_0x1057('0x4'),_0x1057('0x5')],'include':[{'model':_0x1057('0x6'),'as':_0x1057('0x7'),'attributes':['id',_0x1057('0x3'),'online',_0x1057('0x8')]}]},'log':_0x1057('0x1')});};};
\ No newline at end of file
+var _0x7d06=['strategy','User','Agents','name','online','../client','getMailQueues'];(function(_0x353313,_0x5c3686){var _0x4cb750=function(_0x17ac7e){while(--_0x17ac7e){_0x353313['push'](_0x353313['shift']());}};_0x4cb750(++_0x5c3686);}(_0x7d06,0xde));var _0x67d0=function(_0x12c73c,_0x5e12bb){_0x12c73c=_0x12c73c-0x0;var _0x384ab8=_0x7d06[_0x12c73c];return _0x384ab8;};'use strict';var client=require(_0x67d0('0x0'));exports[_0x67d0('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0x67d0('0x2')],'include':[{'model':_0x67d0('0x3'),'as':_0x67d0('0x4'),'attributes':['id',_0x67d0('0x5'),_0x67d0('0x6'),'mailPause']}]},'log':_0x67d0('0x1')});};};
\ No newline at end of file
index 3c83a03..c567017 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2af=['Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create'];(function(_0x45c46e,_0x479fac){var _0x148ecb=function(_0x1be1a7){while(--_0x1be1a7){_0x45c46e['push'](_0x45c46e['shift']());}};_0x148ecb(++_0x479fac);}(_0xf2af,0x108));var _0xff2a=function(_0x1644d4,_0x187792){_0x1644d4=_0x1644d4-0x0;var _0xdc3987=_0xf2af[_0x1644d4];return _0xdc3987;};'use strict';var client=require(_0xff2a('0x0'));exports[_0xff2a('0x1')]=function(_0x5b258){return client[_0xff2a('0x2')](_0xff2a('0x3'),{'body':_0x5b258,'log':_0xff2a('0x3')});};exports[_0xff2a('0x4')]=function(_0x5317e6,_0x581608){return client[_0xff2a('0x2')](_0xff2a('0x5'),{'body':_0x581608,'options':{'where':{'uniqueid':_0x5317e6},'order':[['id',_0xff2a('0x6')]],'limit':0x1},'log':_0xff2a('0x5')});};
\ No newline at end of file
+var _0x403a=['Request','DESC','UpdateMailQueueReport','CreateMailQueueReport'];(function(_0x3b68e8,_0x57f556){var _0x407844=function(_0x1e809d){while(--_0x1e809d){_0x3b68e8['push'](_0x3b68e8['shift']());}};_0x407844(++_0x57f556);}(_0x403a,0x1db));var _0xa403=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x403a[_0x1e7b16];return _0x37fadc;};'use strict';var client=require('../client');exports['create']=function(_0x29e00a){return client['Request'](_0xa403('0x0'),{'body':_0x29e00a,'log':'CreateMailQueueReport'});};exports['update']=function(_0x2b53a4,_0x40c361){return client[_0xa403('0x1')]('UpdateMailQueueReport',{'body':_0x40c361,'options':{'where':{'uniqueid':_0x2b53a4},'order':[['id',_0xa403('0x2')]],'limit':0x1},'log':_0xa403('0x3')});};
\ No newline at end of file
index 534a8d3..f8f6fd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6198=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','../client','update','Request'];(function(_0x1a1566,_0x1802a5){var _0xf1b193=function(_0x16583b){while(--_0x16583b){_0x1a1566['push'](_0x1a1566['shift']());}};_0xf1b193(++_0x1802a5);}(_0x6198,0x1af));var _0x8619=function(_0x55dc3f,_0x216e92){_0x55dc3f=_0x55dc3f-0x0;var _0x4a1fc1=_0x6198[_0x55dc3f];return _0x4a1fc1;};'use strict';var client=require(_0x8619('0x0'));exports[_0x8619('0x1')]=function(_0x4a032a,_0x2a9bb3){return client[_0x8619('0x2')](_0x8619('0x3'),{'body':_0x2a9bb3,'options':{'where':{'id':_0x4a032a}},'log':_0x8619('0x4')});};exports[_0x8619('0x5')]=function(_0x4cc686,_0x4d56ce){return client[_0x8619('0x2')](_0x8619('0x6'),{'body':_0x4d56ce,'options':{'where':{'id':_0x4cc686}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
+var _0xc2a2=['../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0xc2a2,0x8c));var _0x2c2a=function(_0x4d108c,_0x44eb33){_0x4d108c=_0x4d108c-0x0;var _0x18307c=_0xc2a2[_0x4d108c];return _0x18307c;};'use strict';var client=require(_0x2c2a('0x0'));exports[_0x2c2a('0x1')]=function(_0x52803,_0x54d716){return client[_0x2c2a('0x2')](_0x2c2a('0x3'),{'body':_0x54d716,'options':{'where':{'id':_0x52803}},'log':_0x2c2a('0x4')});};exports['addTags']=function(_0x41dfca,_0x5a178d){return client[_0x2c2a('0x2')](_0x2c2a('0x5'),{'body':_0x5a178d,'options':{'where':{'id':_0x41dfca}},'log':_0x2c2a('0x6')});};
\ No newline at end of file
index 2132627..b2cb11e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cd=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x50b97,_0x3585d0){var _0x2e213f=function(_0x11aac5){while(--_0x11aac5){_0x50b97['push'](_0x50b97['shift']());}};_0x2e213f(++_0x3585d0);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2906e6,_0x5ccd59){_0x2906e6=_0x2906e6-0x0;var _0x12517a=_0xf3cd[_0x2906e6];return _0x12517a;};'use strict';var client=require(_0xdf3c('0x0'));exports[_0xdf3c('0x1')]=function(_0x31e5a5){return client[_0xdf3c('0x2')](_0xdf3c('0x3'),{'body':_0x31e5a5,'log':_0xdf3c('0x4')});};
\ No newline at end of file
+var _0xbdb7=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create','Request'];(function(_0x2abf9b,_0x46cdd6){var _0x1788c4=function(_0x8a34b6){while(--_0x8a34b6){_0x2abf9b['push'](_0x2abf9b['shift']());}};_0x1788c4(++_0x46cdd6);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x34d6cb,_0x1ae55c){_0x34d6cb=_0x34d6cb-0x0;var _0x4372cb=_0xbdb7[_0x34d6cb];return _0x4372cb;};'use strict';var client=require(_0x7bdb('0x0'));exports[_0x7bdb('0x1')]=function(_0x44467d){return client[_0x7bdb('0x2')](_0x7bdb('0x3'),{'body':_0x44467d,'log':_0x7bdb('0x4')});};
\ No newline at end of file
index 9a1ff4a..651e985 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d6d=['timeout','strategy','User','Agents','online','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','name'];(function(_0x38e191,_0x8d5355){var _0x4af767=function(_0x29faac){while(--_0x29faac){_0x38e191['push'](_0x38e191['shift']());}};_0x4af767(++_0x8d5355);}(_0x6d6d,0xe2));var _0xd6d6=function(_0x27c3a7,_0x11244d){_0x27c3a7=_0x27c3a7-0x0;var _0x298838=_0x6d6d[_0x27c3a7];return _0x298838;};'use strict';var client=require('../client');exports[_0xd6d6('0x0')]=function(){return function(){return client[_0xd6d6('0x1')](_0xd6d6('0x2'),{'options':{'raw':![],'attributes':['id',_0xd6d6('0x3'),_0xd6d6('0x4'),_0xd6d6('0x5')],'include':[{'model':_0xd6d6('0x6'),'as':_0xd6d6('0x7'),'attributes':['id','name',_0xd6d6('0x8'),_0xd6d6('0x9')]}]},'log':_0xd6d6('0x0')});};};
\ No newline at end of file
+var _0x1c30=['User','Agents','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy'];(function(_0x33ab79,_0x4f7c50){var _0x10ac00=function(_0x1caa4c){while(--_0x1caa4c){_0x33ab79['push'](_0x33ab79['shift']());}};_0x10ac00(++_0x4f7c50);}(_0x1c30,0x17a));var _0x01c3=function(_0x2797c6,_0x37421b){_0x2797c6=_0x2797c6-0x0;var _0x54809f=_0x1c30[_0x2797c6];return _0x54809f;};'use strict';var client=require(_0x01c3('0x0'));exports[_0x01c3('0x1')]=function(){return function(){return client[_0x01c3('0x2')](_0x01c3('0x3'),{'options':{'raw':![],'attributes':['id',_0x01c3('0x4'),_0x01c3('0x5'),_0x01c3('0x6')],'include':[{'model':_0x01c3('0x7'),'as':_0x01c3('0x8'),'attributes':['id',_0x01c3('0x4'),_0x01c3('0x9'),_0x01c3('0xa')]}]},'log':_0x01c3('0x1')});};};
\ No newline at end of file
index 5b8deaf..d7710fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9c1=['DESC','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x4b45b5,_0x40f3a0){var _0x39e256=function(_0x52aef1){while(--_0x52aef1){_0x4b45b5['push'](_0x4b45b5['shift']());}};_0x39e256(++_0x40f3a0);}(_0xb9c1,0x13f));var _0x1b9c=function(_0x279a77,_0x3f6749){_0x279a77=_0x279a77-0x0;var _0x42856c=_0xb9c1[_0x279a77];return _0x42856c;};'use strict';var client=require('../client');exports[_0x1b9c('0x0')]=function(_0x101e73){return client[_0x1b9c('0x1')](_0x1b9c('0x2'),{'body':_0x101e73,'log':_0x1b9c('0x2')});};exports[_0x1b9c('0x3')]=function(_0x5b83fe,_0x25f334){return client[_0x1b9c('0x1')](_0x1b9c('0x4'),{'body':_0x25f334,'options':{'where':{'uniqueid':_0x5b83fe},'order':[['id',_0x1b9c('0x5')]],'limit':0x1},'log':_0x1b9c('0x4')});};
\ No newline at end of file
+var _0x22d2=['update','UpdateOpenchannelQueueReport','DESC','../client','Request','CreateOpenchannelQueueReport'];(function(_0x1a4a06,_0x36a5c2){var _0x49ec08=function(_0x497f24){while(--_0x497f24){_0x1a4a06['push'](_0x1a4a06['shift']());}};_0x49ec08(++_0x36a5c2);}(_0x22d2,0x6f));var _0x222d=function(_0x579fcf,_0x43825f){_0x579fcf=_0x579fcf-0x0;var _0x1a430c=_0x22d2[_0x579fcf];return _0x1a430c;};'use strict';var client=require(_0x222d('0x0'));exports['create']=function(_0x4ef518){return client[_0x222d('0x1')](_0x222d('0x2'),{'body':_0x4ef518,'log':_0x222d('0x2')});};exports[_0x222d('0x3')]=function(_0xd0dcc1,_0x5b661a){return client[_0x222d('0x1')](_0x222d('0x4'),{'body':_0x5b661a,'options':{'where':{'uniqueid':_0xd0dcc1},'order':[['id',_0x222d('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});};
\ No newline at end of file
index d6e3d8e..71c1768 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1f7=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','Request','updateSmsInteraction','addTags'];(function(_0x506857,_0x116f88){var _0x911d6c=function(_0x2bd427){while(--_0x2bd427){_0x506857['push'](_0x506857['shift']());}};_0x911d6c(++_0x116f88);}(_0xa1f7,0xda));var _0x7a1f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa1f7[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x7a1f('0x0'));exports['update']=function(_0x7508e6,_0x3ab9f1){return client[_0x7a1f('0x1')]('UpdateSmsInteraction',{'body':_0x3ab9f1,'options':{'where':{'id':_0x7508e6}},'log':_0x7a1f('0x2')});};exports[_0x7a1f('0x3')]=function(_0x2c994e,_0x13640e){return client[_0x7a1f('0x1')](_0x7a1f('0x4'),{'body':_0x13640e,'options':{'where':{'id':_0x2c994e}},'log':_0x7a1f('0x5')});};
\ No newline at end of file
+var _0x2b01=['addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x417777,_0x32b39a){var _0x2a2297=function(_0x27b2af){while(--_0x27b2af){_0x417777['push'](_0x417777['shift']());}};_0x2a2297(++_0x32b39a);}(_0x2b01,0x18b));var _0x12b0=function(_0x1e3ae5,_0x3ed3ee){_0x1e3ae5=_0x1e3ae5-0x0;var _0x4e6c14=_0x2b01[_0x1e3ae5];return _0x4e6c14;};'use strict';var client=require(_0x12b0('0x0'));exports[_0x12b0('0x1')]=function(_0x5397da,_0x3e2eed){return client[_0x12b0('0x2')](_0x12b0('0x3'),{'body':_0x3e2eed,'options':{'where':{'id':_0x5397da}},'log':_0x12b0('0x4')});};exports[_0x12b0('0x5')]=function(_0x55a45c,_0x2441f6){return client['Request'](_0x12b0('0x6'),{'body':_0x2441f6,'options':{'where':{'id':_0x55a45c}},'log':_0x12b0('0x7')});};
\ No newline at end of file
index acc57a5..ccc34bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd56=['CreateSmsMessage','../client','create','Request'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0xcd56,0xb1));var _0x6cd5=function(_0x2f23b4,_0x52ef04){_0x2f23b4=_0x2f23b4-0x0;var _0x34831a=_0xcd56[_0x2f23b4];return _0x34831a;};'use strict';var client=require(_0x6cd5('0x0'));exports[_0x6cd5('0x1')]=function(_0x4ff35e){return client[_0x6cd5('0x2')](_0x6cd5('0x3'),{'body':_0x4ff35e,'log':'createSmsMessage'});};
\ No newline at end of file
+var _0xe2c8=['../client','Request','CreateSmsMessage'];(function(_0xa3fadc,_0xd1e16){var _0x23ecb8=function(_0x2c71f7){while(--_0x2c71f7){_0xa3fadc['push'](_0xa3fadc['shift']());}};_0x23ecb8(++_0xd1e16);}(_0xe2c8,0x17d));var _0x8e2c=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xe2c8[_0x5f1391];return _0x50ebe3;};'use strict';var client=require(_0x8e2c('0x0'));exports['create']=function(_0x5e57b2){return client[_0x8e2c('0x1')](_0x8e2c('0x2'),{'body':_0x5e57b2,'log':'createSmsMessage'});};
\ No newline at end of file
index e108118..2640103 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x241e=['User','Agents','name','online','smsPause','getSmsQueues','Request','GetSmsQueue','timeout','strategy'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x241e,0x1b4));var _0xe241=function(_0x29fcd0,_0x1f5618){_0x29fcd0=_0x29fcd0-0x0;var _0xcb78b0=_0x241e[_0x29fcd0];return _0xcb78b0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0xe241('0x0')](_0xe241('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xe241('0x2'),_0xe241('0x3')],'include':[{'model':_0xe241('0x4'),'as':_0xe241('0x5'),'attributes':['id',_0xe241('0x6'),_0xe241('0x7'),_0xe241('0x8')]}]},'log':_0xe241('0x9')});};};
\ No newline at end of file
+var _0x9f02=['../client','name','timeout','strategy','User','Agents','online','getSmsQueues'];(function(_0x56fbaa,_0x3bc5a6){var _0x49fbc1=function(_0x19b08b){while(--_0x19b08b){_0x56fbaa['push'](_0x56fbaa['shift']());}};_0x49fbc1(++_0x3bc5a6);}(_0x9f02,0x68));var _0x29f0=function(_0x227fde,_0x40179f){_0x227fde=_0x227fde-0x0;var _0x5796c5=_0x9f02[_0x227fde];return _0x5796c5;};'use strict';var client=require(_0x29f0('0x0'));exports['getSmsQueues']=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x29f0('0x1'),_0x29f0('0x2'),_0x29f0('0x3')],'include':[{'model':_0x29f0('0x4'),'as':_0x29f0('0x5'),'attributes':['id','name',_0x29f0('0x6'),'smsPause']}]},'log':_0x29f0('0x7')});};};
\ No newline at end of file
index 4dfe9d7..dbe0da2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f7c=['UpdateSmsQueueReport','DESC','../client','create','Request','CreateSmsQueueReport','update'];(function(_0x48ce1e,_0x2d9737){var _0x358aef=function(_0xb014de){while(--_0xb014de){_0x48ce1e['push'](_0x48ce1e['shift']());}};_0x358aef(++_0x2d9737);}(_0x3f7c,0xaa));var _0xc3f7=function(_0x312d48,_0x537d55){_0x312d48=_0x312d48-0x0;var _0x216276=_0x3f7c[_0x312d48];return _0x216276;};'use strict';var client=require(_0xc3f7('0x0'));exports[_0xc3f7('0x1')]=function(_0xc92a5f){return client[_0xc3f7('0x2')](_0xc3f7('0x3'),{'body':_0xc92a5f,'log':'CreateSmsQueueReport'});};exports[_0xc3f7('0x4')]=function(_0x5532d3,_0xfae744){return client[_0xc3f7('0x2')](_0xc3f7('0x5'),{'body':_0xfae744,'options':{'where':{'uniqueid':_0x5532d3},'order':[['id',_0xc3f7('0x6')]],'limit':0x1},'log':_0xc3f7('0x5')});};
\ No newline at end of file
+var _0x676c=['DESC','UpdateSmsQueueReport','../client','create','CreateSmsQueueReport','update','Request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x676c,0x198));var _0xc676=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x676c[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xc676('0x0'));exports[_0xc676('0x1')]=function(_0xf31d2c){return client['Request'](_0xc676('0x2'),{'body':_0xf31d2c,'log':_0xc676('0x2')});};exports[_0xc676('0x3')]=function(_0xc56885,_0x22b173){return client[_0xc676('0x4')]('UpdateSmsQueueReport',{'body':_0x22b173,'options':{'where':{'uniqueid':_0xc56885},'order':[['id',_0xc676('0x5')]],'limit':0x1},'log':_0xc676('0x6')});};
\ No newline at end of file
index 14dc974..0e337b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21e6=['getAgents','Request','agent','name','online','pauseType','lastPauseAt','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','../client'];(function(_0x2c9ee9,_0x1f0c49){var _0x1689df=function(_0x46b318){while(--_0x46b318){_0x2c9ee9['push'](_0x2c9ee9['shift']());}};_0x1689df(++_0x1f0c49);}(_0x21e6,0x109));var _0x621e=function(_0x51a182,_0x5639a7){_0x51a182=_0x51a182-0x0;var _0x46aa3e=_0x21e6[_0x51a182];return _0x46aa3e;};'use strict';var client=require(_0x621e('0x0'));exports[_0x621e('0x1')]=function(){return function(){return client[_0x621e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':_0x621e('0x3')},'attributes':['id',_0x621e('0x4'),_0x621e('0x5'),_0x621e('0x6'),_0x621e('0x7'),_0x621e('0x8'),_0x621e('0x9'),_0x621e('0xa'),_0x621e('0xb'),_0x621e('0xc'),_0x621e('0xd'),_0x621e('0xe'),_0x621e('0xf'),_0x621e('0x10'),_0x621e('0x11'),_0x621e('0x12')]},'log':_0x621e('0x1')});};};
\ No newline at end of file
+var _0x783c=['mailCapacity','faxCapacity','smsCapacity','getAgents','Request','GetUser','agent','name','online','pauseType','lastPauseAt','voicePause','chatPause','faxPause','smsPause','openchannelPause','chatCapacity'];(function(_0x585035,_0x5244a8){var _0x2d36ce=function(_0x31c860){while(--_0x31c860){_0x585035['push'](_0x585035['shift']());}};_0x2d36ce(++_0x5244a8);}(_0x783c,0x179));var _0xc783=function(_0x3c6eea,_0x38462e){_0x3c6eea=_0x3c6eea-0x0;var _0x20ff79=_0x783c[_0x3c6eea];return _0x20ff79;};'use strict';var client=require('../client');exports[_0xc783('0x0')]=function(){return function(){return client[_0xc783('0x1')](_0xc783('0x2'),{'options':{'raw':!![],'where':{'role':_0xc783('0x3')},'attributes':['id',_0xc783('0x4'),_0xc783('0x5'),_0xc783('0x6'),_0xc783('0x7'),_0xc783('0x8'),_0xc783('0x9'),'mailPause',_0xc783('0xa'),_0xc783('0xb'),_0xc783('0xc'),_0xc783('0xd'),_0xc783('0xe'),_0xc783('0xf'),_0xc783('0x10'),'openchannelCapacity']},'log':'getAgents'});};};
\ No newline at end of file
index 9c66664..5e6a7c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['[%s][QUEUE]\x20%s','stringify','validate','util','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','find','agents','timeout','createQueue','channel','format','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0xb10b,0x12a));var _0xbb10=function(_0x2b29ab,_0x201845){_0x2b29ab=_0x2b29ab-0x0;var _0x16e64b=_0xb10b[_0x2b29ab];return _0x16e64b;};'use strict';var schema=require(_0xbb10('0x0'));var _=require('lodash');var util=require(_0xbb10('0x1'));var seqqueue=require(_0xbb10('0x2'));var logger=require(_0xbb10('0x3'))('routing');var strategy=require(_0xbb10('0x4'));var queue=schema({'name':{'type':_0xbb10('0x5'),'required':!![],'message':_0xbb10('0x6')},'timeout':{'type':_0xbb10('0x7'),'message':_0xbb10('0x8')}});function writeLog(_0x312b72,_0x481979,_0x328583){return logger[_0xbb10('0x9')](util['format'](_0xbb10('0xa'),_0x312b72,_0x481979[_0xbb10('0xb')],_0x328583));}function handleFindAgent(_0x21370f){return function(_0x1c3ee5){return _0x1c3ee5[_0xbb10('0xb')][_0xbb10('0xc')]()===_0x21370f[_0xbb10('0xc')]();};}exports[_0xbb10('0xd')]=function(_0x5ab04a,_0x4e47f8,_0x20bd61,_0x118a74){return function(_0xce64f3){try{var _0x5e136d={'name':_0x4e47f8[0x0],'timeout':_0x4e47f8[0x1]};var _0x408248=queue['validate'](_0x5e136d,{'typecast':!![]});if(_0x408248[_0xbb10('0xe')]){logger[_0xbb10('0xf')](_0xbb10('0x10'),_0x5ab04a,_[_0xbb10('0x11')](_0x408248,_0xbb10('0x12'))[_0xbb10('0x13')](',\x20'));_0xce64f3['stop']();}else{var _0x26e021=_[_0xbb10('0x14')](_0x20bd61[_0xbb10('0x15')],handleFindAgent(_0x5e136d[_0xbb10('0xb')]));if(_0x26e021){var _0x3df17b=(_0x5e136d[_0xbb10('0x16')]||0xa)*0x3e8;var _0x24a57b,_0x36b5e8;var _0x3e26f4=seqqueue[_0xbb10('0x17')](_0x3df17b);_0x3e26f4['id']=_0x5ab04a;_0x3e26f4['atimeout']=_0x3df17b;_0x3e26f4[_0xbb10('0x18')]=_0x118a74[_0xbb10('0x18')];writeLog(_0x5ab04a,_0x26e021,util[_0xbb10('0x19')](_0xbb10('0x1a'),_0x3df17b));_0x24a57b=setInterval(function(){if(_0x20bd61[_0xbb10('0x1b')]&&!_0x20bd61[_0xbb10('0x1b')][_0x5ab04a]){logger[_0xbb10('0x9')](_0xbb10('0x1c'),_0x5ab04a);clearInterval(_0x24a57b);clearTimeout(_0x36b5e8);_0x36b5e8=undefined;_0x3e26f4[_0xbb10('0x1d')](!![]);_0xce64f3[_0xbb10('0x1e')]();}},0x3e8);_0x36b5e8=setTimeout(function(){logger['info'](_0xbb10('0x1f'),_0x5ab04a);clearInterval(_0x24a57b);_0x24a57b=undefined;_0x3e26f4[_0xbb10('0x1d')](!![]);_0xce64f3[_0xbb10('0x20')]();},_0x3df17b);strategy[_0xbb10('0x21')](_0x3e26f4,_0x26e021,_0x20bd61,_0x118a74);}else{logger[_0xbb10('0xf')](_0xbb10('0x22'),_0x5ab04a,_0x5e136d['name']);_0xce64f3[_0xbb10('0x1e')]();}}}catch(_0x12ef77){console['log'](_0x12ef77);logger['error'](_0xbb10('0x23'),_0x5ab04a,JSON[_0xbb10('0x24')](_0x12ef77));_0xce64f3[_0xbb10('0x1e')]();}};};
\ No newline at end of file
+var _0xa9e0=['agents','name','atimeout','channel','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','stringify','validate','lodash','util','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','stop','find'];(function(_0x9795bb,_0x52b115){var _0x9ae7e6=function(_0x4263f){while(--_0x4263f){_0x9795bb['push'](_0x9795bb['shift']());}};_0x9ae7e6(++_0x52b115);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var schema=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var seqqueue=require('seq-queue');var logger=require('../../../../config/logger')(_0x0a9e('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x0a9e('0x4'),'required':!![],'message':_0x0a9e('0x5')},'timeout':{'type':_0x0a9e('0x6'),'message':_0x0a9e('0x7')}});function writeLog(_0x981158,_0x57b080,_0x219af0){return logger[_0x0a9e('0x8')](util[_0x0a9e('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x981158,_0x57b080['name'],_0x219af0));}function handleFindAgent(_0xe42b77){return function(_0x56465b){return _0x56465b['name'][_0x0a9e('0xa')]()===_0xe42b77[_0x0a9e('0xa')]();};}exports[_0x0a9e('0xb')]=function(_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56){return function(_0x50dfb2){try{var _0x527cdd={'name':_0xfeb75b[0x0],'timeout':_0xfeb75b[0x1]};var _0x4cfe67=queue[_0x0a9e('0x0')](_0x527cdd,{'typecast':!![]});if(_0x4cfe67[_0x0a9e('0xc')]){logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x3ab53f,_[_0x0a9e('0xf')](_0x4cfe67,_0x0a9e('0x10'))['join'](',\x20'));_0x50dfb2[_0x0a9e('0x11')]();}else{var _0x239b12=_[_0x0a9e('0x12')](_0xbd1168[_0x0a9e('0x13')],handleFindAgent(_0x527cdd[_0x0a9e('0x14')]));if(_0x239b12){var _0x4d5611=(_0x527cdd['timeout']||0xa)*0x3e8;var _0x22dccb,_0x5d0880;var _0x1985b6=seqqueue['createQueue'](_0x4d5611);_0x1985b6['id']=_0x3ab53f;_0x1985b6[_0x0a9e('0x15')]=_0x4d5611;_0x1985b6[_0x0a9e('0x16')]=_0x4a4c56['channel'];writeLog(_0x3ab53f,_0x239b12,util[_0x0a9e('0x9')]('START:%s',_0x4d5611));_0x22dccb=setInterval(function(){if(_0xbd1168[_0x0a9e('0x17')]&&!_0xbd1168[_0x0a9e('0x17')][_0x3ab53f]){logger[_0x0a9e('0x8')](_0x0a9e('0x18'),_0x3ab53f);clearInterval(_0x22dccb);clearTimeout(_0x5d0880);_0x5d0880=undefined;_0x1985b6[_0x0a9e('0x19')](!![]);_0x50dfb2[_0x0a9e('0x11')]();}},0x3e8);_0x5d0880=setTimeout(function(){logger[_0x0a9e('0x8')](_0x0a9e('0x1a'),_0x3ab53f);clearInterval(_0x22dccb);_0x22dccb=undefined;_0x1985b6[_0x0a9e('0x19')](!![]);_0x50dfb2[_0x0a9e('0x1b')]();},_0x4d5611);strategy[_0x0a9e('0x1c')](_0x1985b6,_0x239b12,_0xbd1168,_0x4a4c56);}else{logger[_0x0a9e('0xd')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x3ab53f,_0x527cdd[_0x0a9e('0x14')]);_0x50dfb2[_0x0a9e('0x11')]();}}}catch(_0x53682f){console[_0x0a9e('0x1d')](_0x53682f);logger['error']('[%s][QUEUE]\x20%s',_0x3ab53f,JSON[_0x0a9e('0x1e')](_0x53682f));_0x50dfb2[_0x0a9e('0x11')]();}};};
\ No newline at end of file
index c32763c..c04832c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','next','create','[%s][AUTOREPLY]\x20%s','stop','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../mailRpc','consequence','isNil','created','interaction','info','Autoreply\x20already\x20sent','channel','getMustacheRender','contact','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','startsWith','Re:','Re:\x20','ChatWebsiteId','upperFirst','InteractionId','Message','account','Smtp','service','host','port','secure','authentication','user','pass','inReplyTo','messageId','<div\x20id=\x22xm-mail-content\x22>','replace','body','<div\x20id=\x22xm-mail-content\x22','<div','</div>','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify'];(function(_0x8bbed1,_0x8626d8){var _0x20e5ad=function(_0x366a97){while(--_0x366a97){_0x8bbed1['push'](_0x8bbed1['shift']());}};_0x20e5ad(++_0x8626d8);}(_0xedd9,0xfc));var _0x9edd=function(_0x2323a6,_0x368710){_0x2323a6=_0x2323a6-0x0;var _0x31ebf0=_0xedd9[_0x2323a6];return _0x31ebf0;};'use strict';var _=require('lodash');var moment=require(_0x9edd('0x0'));var utils=require(_0x9edd('0x1'));var logger=require(_0x9edd('0x2'))(_0x9edd('0x3'));var rpc={'chatMessage':require(_0x9edd('0x4')),'openchannelMessage':require(_0x9edd('0x5')),'mailMessage':require(_0x9edd('0x6')),'smsMessage':require(_0x9edd('0x7')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x9edd('0x8'));exports[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return function(_0x5319f7){try{if(_0x34c1a7[0x0]==='1'&&(_[_0x9edd('0xa')](this['interaction'][_0x9edd('0xb')])||!this[_0x9edd('0xc')][_0x9edd('0xb')])){logger[_0x9edd('0xd')]('[%s][AUTOREPLY]\x20%s',_0x268f9e,_0x9edd('0xe'));return _0x5319f7['next']();}var _0x2076fc=this[_0x9edd('0xf')];var _0x523026={'body':utils[_0x9edd('0x10')](_0x34c1a7[0x1],this),'ContactId':this[_0x9edd('0x11')]['id'],'sentAt':moment()['format'](_0x9edd('0x12')),'direction':_0x9edd('0x13')};if(this[_0x9edd('0x14')]){_0x523026['to']=this[_0x9edd('0x14')][_0x9edd('0x15')]||'';_0x523026['cc']=this[_0x9edd('0x14')]['cc']||'';_0x523026[_0x9edd('0x15')]=this[_0x9edd('0x14')]['to']||'';_0x523026['phone']=this[_0x9edd('0x14')][_0x9edd('0x16')]||'';_0x523026[_0x9edd('0x17')]=!![];if(this[_0x9edd('0x14')][_0x9edd('0x18')]){_0x523026[_0x9edd('0x18')]='';_0x523026[_0x9edd('0x18')]+=_[_0x9edd('0x19')](this['message'][_0x9edd('0x18')],_0x9edd('0x1a'))?'':_0x9edd('0x1b');_0x523026['subject']+=this[_0x9edd('0x14')][_0x9edd('0x18')];}}if(this[_0x9edd('0xf')]==='chat'){_0x523026[_0x9edd('0x1c')]=this['account']['id'];}else{_0x523026[_[_0x9edd('0x1d')](this[_0x9edd('0xf')])+'AccountId']=this['account']['id'];}_0x523026[_[_0x9edd('0x1d')](this['channel'])+_0x9edd('0x1e')]=this['interaction']['id'];if(rpc[this['channel']+_0x9edd('0x1f')]){if(this[_0x9edd('0xf')]==='mail'){var _0x5823bc={'tls':{'rejectUnauthorized':![]}};if(this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x22')]){_0x5823bc['service']=this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x22')];}else{_0x5823bc[_0x9edd('0x23')]=this[_0x9edd('0x20')]['Smtp'][_0x9edd('0x23')];_0x5823bc[_0x9edd('0x24')]=this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x24')];_0x5823bc['secure']=this['account'][_0x9edd('0x21')][_0x9edd('0x25')];}if(this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x26')]){_0x5823bc['auth']={'user':this['account'][_0x9edd('0x21')][_0x9edd('0x27')],'pass':this[_0x9edd('0x20')]['Smtp'][_0x9edd('0x28')]};}_0x523026[_0x9edd('0x29')]=this[_0x9edd('0x14')][_0x9edd('0x2a')];_0x523026['html']=_0x9edd('0x2b')+_[_0x9edd('0x2c')](_0x523026[_0x9edd('0x2d')],_0x9edd('0x2e'),_0x9edd('0x2f'))+_0x9edd('0x30');return mailRpc[_0x9edd('0x31')](_0x5823bc,_0x523026)[_0x9edd('0x32')](function(_0x19b6c1){logger[_0x9edd('0xd')](_0x9edd('0x33'),_0x268f9e);_0x523026[_0x9edd('0x2a')]=_0x19b6c1[_0x9edd('0x14')][_0x9edd('0x2a')];return rpc[_0x2076fc+_0x9edd('0x1f')]['create'](_0x523026);})[_0x9edd('0x32')](function(_0x259259){logger[_0x9edd('0xd')]('[%s][AUTOREPLY]\x20%s',_0x268f9e,JSON[_0x9edd('0x34')](_0x259259));})[_0x9edd('0x35')](function(_0xde9b13){logger[_0x9edd('0x36')](_0x9edd('0x37'),_0x268f9e,JSON[_0x9edd('0x34')](_0xde9b13));})[_0x9edd('0x38')](function(){_0x5319f7[_0x9edd('0x39')]();});}else{return rpc[this[_0x9edd('0xf')]+_0x9edd('0x1f')][_0x9edd('0x3a')](_0x523026)[_0x9edd('0x32')](function(_0x27eb7e){logger[_0x9edd('0xd')]('[%s][AUTOREPLY]\x20%s',_0x268f9e,_0x523026[_0x9edd('0x2d')]);})['catch'](function(_0x968303){logger[_0x9edd('0x36')](_0x9edd('0x3b'),_0x268f9e,JSON[_0x9edd('0x34')](_0x968303));})[_0x9edd('0x38')](function(){_0x5319f7['next']();});}}}catch(_0x6de835){logger[_0x9edd('0x36')](_0x9edd('0x3b'),_0x268f9e,JSON[_0x9edd('0x34')](_0x6de835));_0x5319f7[_0x9edd('0x3c')]();}};};
\ No newline at end of file
+var _0xcb91=['consequence','interaction','created','Autoreply\x20already\x20sent','next','channel','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','Re:','Re:\x20','account','upperFirst','AccountId','mail','Smtp','service','port','secure','authentication','auth','user','pass','inReplyTo','messageId','<div\x20id=\x22xm-mail-content\x22>','body','<div\x20id=\x22xm-mail-content\x22','<div','</div>','then','info','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','[%s][AUTOREPLY]\x20%s','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','Message','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../mailRpc'];(function(_0x529abc,_0x17b97e){var _0x453afa=function(_0x536263){while(--_0x536263){_0x529abc['push'](_0x529abc['shift']());}};_0x453afa(++_0x17b97e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x272638,_0x42b993){_0x272638=_0x272638-0x0;var _0x19d027=_0xcb91[_0x272638];return _0x19d027;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0x1cb9('0x0'));var logger=require(_0x1cb9('0x1'))(_0x1cb9('0x2'));var rpc={'chatMessage':require(_0x1cb9('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1cb9('0x4')),'smsMessage':require(_0x1cb9('0x5')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x1cb9('0x6'));exports[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return function(_0x3f7deb){try{if(_0x226b69[0x0]==='1'&&(_['isNil'](this[_0x1cb9('0x8')][_0x1cb9('0x9')])||!this['interaction'][_0x1cb9('0x9')])){logger['info']('[%s][AUTOREPLY]\x20%s',_0x53ffbd,_0x1cb9('0xa'));return _0x3f7deb[_0x1cb9('0xb')]();}var _0x74ce19=this[_0x1cb9('0xc')];var _0x2fc627={'body':utils['getMustacheRender'](_0x226b69[0x1],this),'ContactId':this[_0x1cb9('0xd')]['id'],'sentAt':moment()[_0x1cb9('0xe')](_0x1cb9('0xf')),'direction':_0x1cb9('0x10')};if(this[_0x1cb9('0x11')]){_0x2fc627['to']=this['message']['from']||'';_0x2fc627['cc']=this['message']['cc']||'';_0x2fc627[_0x1cb9('0x12')]=this[_0x1cb9('0x11')]['to']||'';_0x2fc627[_0x1cb9('0x13')]=this[_0x1cb9('0x11')]['phone']||'';_0x2fc627[_0x1cb9('0x14')]=!![];if(this[_0x1cb9('0x11')][_0x1cb9('0x15')]){_0x2fc627[_0x1cb9('0x15')]='';_0x2fc627[_0x1cb9('0x15')]+=_['startsWith'](this['message'][_0x1cb9('0x15')],_0x1cb9('0x16'))?'':_0x1cb9('0x17');_0x2fc627[_0x1cb9('0x15')]+=this[_0x1cb9('0x11')][_0x1cb9('0x15')];}}if(this[_0x1cb9('0xc')]==='chat'){_0x2fc627['ChatWebsiteId']=this[_0x1cb9('0x18')]['id'];}else{_0x2fc627[_[_0x1cb9('0x19')](this[_0x1cb9('0xc')])+_0x1cb9('0x1a')]=this[_0x1cb9('0x18')]['id'];}_0x2fc627[_[_0x1cb9('0x19')](this[_0x1cb9('0xc')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x1cb9('0xc')]+'Message']){if(this[_0x1cb9('0xc')]===_0x1cb9('0x1b')){var _0x523b26={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x1cb9('0x1c')][_0x1cb9('0x1d')]){_0x523b26[_0x1cb9('0x1d')]=this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x1d')];}else{_0x523b26['host']=this['account'][_0x1cb9('0x1c')]['host'];_0x523b26[_0x1cb9('0x1e')]=this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x1e')];_0x523b26[_0x1cb9('0x1f')]=this['account'][_0x1cb9('0x1c')][_0x1cb9('0x1f')];}if(this['account'][_0x1cb9('0x1c')][_0x1cb9('0x20')]){_0x523b26[_0x1cb9('0x21')]={'user':this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x22')],'pass':this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x23')]};}_0x2fc627[_0x1cb9('0x24')]=this['message'][_0x1cb9('0x25')];_0x2fc627['html']=_0x1cb9('0x26')+_['replace'](_0x2fc627[_0x1cb9('0x27')],_0x1cb9('0x28'),_0x1cb9('0x29'))+_0x1cb9('0x2a');return mailRpc['sendMailMessage'](_0x523b26,_0x2fc627)[_0x1cb9('0x2b')](function(_0x4eba82){logger[_0x1cb9('0x2c')](_0x1cb9('0x2d'),_0x53ffbd);_0x2fc627[_0x1cb9('0x25')]=_0x4eba82['message'][_0x1cb9('0x25')];return rpc[_0x74ce19+'Message'][_0x1cb9('0x2e')](_0x2fc627);})['then'](function(_0x2164e3){logger[_0x1cb9('0x2c')](_0x1cb9('0x2f'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x2164e3));})['catch'](function(_0x2114a4){logger[_0x1cb9('0x31')](_0x1cb9('0x32'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x2114a4));})[_0x1cb9('0x33')](function(){_0x3f7deb[_0x1cb9('0xb')]();});}else{return rpc[this[_0x1cb9('0xc')]+_0x1cb9('0x34')][_0x1cb9('0x2e')](_0x2fc627)[_0x1cb9('0x2b')](function(_0x294eec){logger[_0x1cb9('0x2c')](_0x1cb9('0x2f'),_0x53ffbd,_0x2fc627['body']);})['catch'](function(_0x299ff8){logger[_0x1cb9('0x31')](_0x1cb9('0x2f'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x299ff8));})[_0x1cb9('0x33')](function(){_0x3f7deb[_0x1cb9('0xb')]();});}}}catch(_0x35f5e8){logger[_0x1cb9('0x31')]('[%s][AUTOREPLY]\x20%s',_0x53ffbd,JSON[_0x1cb9('0x30')](_0x35f5e8));_0x3f7deb[_0x1cb9('0x35')]();}};};
\ No newline at end of file
index 0fd4710..82cbe9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9458=['stringify','finally','stop','routing','../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s'];(function(_0x33337f,_0x5d7319){var _0x3d9d50=function(_0x660d6a){while(--_0x660d6a){_0x33337f['push'](_0x33337f['shift']());}};_0x3d9d50(++_0x5d7319);}(_0x9458,0x1b8));var _0x8945=function(_0x22cb9c,_0x39e4de){_0x22cb9c=_0x22cb9c-0x0;var _0x562740=_0x9458[_0x22cb9c];return _0x562740;};'use strict';var moment=require('moment');var logger=require('../../../../config/logger')(_0x8945('0x0'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x8945('0x1')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x8945('0x2'))};exports[_0x8945('0x3')]=function(_0x10311b,_0x31347e,_0x82cd35,_0x2cfb88){return function(_0x69dab5){try{logger[_0x8945('0x4')](_0x8945('0x5'),_0x10311b,_0x31347e[0x0]);var _0x1a2b8f={'closed':0x1,'closedAt':moment()['format'](_0x8945('0x6')),'closeReason':_0x8945('0x7'),'disposition':_0x31347e[0x0]};if(rpc[_0x2cfb88[_0x8945('0x8')]+_0x8945('0x9')]){rpc[_0x2cfb88[_0x8945('0x8')]+_0x8945('0x9')]['update'](_0x2cfb88[_0x8945('0xa')]['id'],_0x1a2b8f)[_0x8945('0xb')](function(_0x4a0578){logger['info'](_0x8945('0xc'),_0x10311b,_0x2cfb88['interaction']['id']);})[_0x8945('0xd')](function(_0x76c5c7){logger[_0x8945('0xe')](_0x8945('0xf'),_0x10311b,JSON[_0x8945('0x10')](_0x76c5c7));})[_0x8945('0x11')](function(){_0x69dab5['stop']();});}}catch(_0x1582cb){logger[_0x8945('0xe')]('[%s][CLOSE]\x20%s',_0x10311b,JSON[_0x8945('0x10')](_0x1582cb));_0x69dab5[_0x8945('0x12')]();}};};
\ No newline at end of file
+var _0x236c=['routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','channel','Interaction','update','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','stop','error','moment'];(function(_0x59f079,_0x204570){var _0x22c0b0=function(_0x4acaaf){while(--_0x4acaaf){_0x59f079['push'](_0x59f079['shift']());}};_0x22c0b0(++_0x204570);}(_0x236c,0x155));var _0xc236=function(_0x409f98,_0x3c25da){_0x409f98=_0x409f98-0x0;var _0x505a95=_0x236c[_0x409f98];return _0x505a95;};'use strict';var moment=require(_0xc236('0x0'));var logger=require('../../../../config/logger')(_0xc236('0x1'));var rpc={'chatInteraction':require(_0xc236('0x2')),'openchannelInteraction':require(_0xc236('0x3')),'smsInteraction':require(_0xc236('0x4')),'mailInteraction':require(_0xc236('0x5')),'faxInteraction':require('../../rpc/faxInteraction')};exports[_0xc236('0x6')]=function(_0x36e87d,_0x33bc57,_0xd582f6,_0x23d3cc){return function(_0x461c3a){try{logger['info'](_0xc236('0x7'),_0x36e87d,_0x33bc57[0x0]);var _0x4d349b={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0x33bc57[0x0]};if(rpc[_0x23d3cc[_0xc236('0x8')]+'Interaction']){rpc[_0x23d3cc[_0xc236('0x8')]+_0xc236('0x9')][_0xc236('0xa')](_0x23d3cc[_0xc236('0xb')]['id'],_0x4d349b)[_0xc236('0xc')](function(_0x5bc8d8){logger[_0xc236('0xd')](_0xc236('0xe'),_0x36e87d,_0x23d3cc['interaction']['id']);})[_0xc236('0xf')](function(_0x1bc39f){logger['error'](_0xc236('0x10'),_0x36e87d,JSON['stringify'](_0x1bc39f));})['finally'](function(){_0x461c3a[_0xc236('0x11')]();});}}catch(_0x442095){logger[_0xc236('0x12')](_0xc236('0x10'),_0x36e87d,JSON['stringify'](_0x442095));_0x461c3a[_0xc236('0x11')]();}};};
\ No newline at end of file
index 444b6d2..9b3e48e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x126e=['stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','speech','metadata','endConversation','next','error','moment','apiai-promise','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','isEmpty','getMustacheRender','Message','create','then','body'];(function(_0x29a753,_0x5ce67d){var _0x5d78c7=function(_0x2659dd){while(--_0x2659dd){_0x29a753['push'](_0x29a753['shift']());}};_0x5d78c7(++_0x5ce67d);}(_0x126e,0x108));var _0xe126=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x126e[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var moment=require(_0xe126('0x0'));var apiai=require(_0xe126('0x1'));var utils=require(_0xe126('0x2'));var logger=require(_0xe126('0x3'))(_0xe126('0x4'));var rpc={'chatMessage':require(_0xe126('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xe126('0x6')),'smsMessage':require(_0xe126('0x7')),'faxMessage':require(_0xe126('0x8'))};exports[_0xe126('0x9')]=function(_0x2f75a4,_0x2162bd){return function(_0x10210f){try{if(!_['isNil'](this[_0xe126('0xa')][_0xe126('0xb')])){logger[_0xe126('0xc')](_0xe126('0xd'),_0x2f75a4,_0xe126('0xe'));return _0x10210f['next']();}var _0x1bc461={'ContactId':this[_0xe126('0xf')]['id'],'sentAt':moment()['format'](_0xe126('0x10')),'direction':_0xe126('0x11')};var _0x4854e9=this[_0xe126('0x12')];if(_0x4854e9==='chat'){_0x1bc461[_0xe126('0x13')]=this['account']['id'];}else{_0x1bc461[_[_0xe126('0x14')](_0x4854e9)+_0xe126('0x15')]=this[_0xe126('0x16')]['id'];}_0x1bc461[_[_0xe126('0x14')](_0x4854e9)+_0xe126('0x17')]=this[_0xe126('0xa')]['id'];if(this[_0xe126('0xa')]['created']){var _0xd55baf=_0x2162bd[0x2];if(!_[_0xe126('0x18')](_0xd55baf)){_0x1bc461['body']=utils[_0xe126('0x19')](_0xd55baf,this);return rpc[_0x4854e9+_0xe126('0x1a')][_0xe126('0x1b')](_0x1bc461)[_0xe126('0x1c')](function(_0x5e52d1){logger[_0xe126('0xc')](_0xe126('0xd'),_0x2f75a4,_0x1bc461[_0xe126('0x1d')]);})['catch'](function(_0x2b0baa){logger['error'](_0xe126('0xd'),_0x2f75a4,JSON[_0xe126('0x1e')](_0x2b0baa));})[_0xe126('0x1f')](function(){logger[_0xe126('0xc')](_0xe126('0x20'),_0x2f75a4);_0x10210f[_0xe126('0x21')]();});}else{logger[_0xe126('0xc')](_0xe126('0x22'),_0x2f75a4);_0x10210f['stop']();}}else{var _0x3e0a77=apiai(_0x2162bd[0x0],{'language':_0x2162bd[0x1]||'en'});return _0x3e0a77[_0xe126('0x23')](this[_0xe126('0x24')][_0xe126('0x1d')],{'sessionId':this[_0xe126('0xa')]['id']})[_0xe126('0x1c')](function(_0x3be1c3){_0x1bc461[_0xe126('0x1d')]=_0x3be1c3['result']['fulfillment'][_0xe126('0x25')];return rpc[_0x4854e9+_0xe126('0x1a')][_0xe126('0x1b')](_0x1bc461)['then'](function(_0x5381e1){logger['info'](_0xe126('0xd'),_0x2f75a4,_0x1bc461[_0xe126('0x1d')]);if(_0x3be1c3['result'][_0xe126('0x26')][_0xe126('0x27')]){_0x10210f[_0xe126('0x28')]();}else{_0x10210f[_0xe126('0x21')]();}})['catch'](function(_0x49d70d){logger[_0xe126('0x29')]('[%s][DIALOGFLOW]\x20%s',_0x2f75a4,JSON[_0xe126('0x1e')](_0x49d70d));_0x10210f[_0xe126('0x28')]();});});}}catch(_0x630bcc){logger['error'](_0xe126('0xd'),_0x2f75a4,JSON[_0xe126('0x1e')](_0x630bcc));_0x10210f['stop']();}};};
\ No newline at end of file
+var _0x0af5=['moment','apiai-promise','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','channel','chat','account','upperFirst','AccountId','InteractionId','body','getMustacheRender','then','catch','error','stringify','finally','info','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','result','fulfillment','speech','Message','create','metadata','next'];(function(_0x332a20,_0x13bde6){var _0x1b71c1=function(_0x4334b0){while(--_0x4334b0){_0x332a20['push'](_0x332a20['shift']());}};_0x1b71c1(++_0x13bde6);}(_0x0af5,0x158));var _0x50af=function(_0x26c82f,_0x153ce0){_0x26c82f=_0x26c82f-0x0;var _0x5b4f7f=_0x0af5[_0x26c82f];return _0x5b4f7f;};'use strict';var _=require('lodash');var moment=require(_0x50af('0x0'));var apiai=require(_0x50af('0x1'));var utils=require(_0x50af('0x2'));var logger=require(_0x50af('0x3'))(_0x50af('0x4'));var rpc={'chatMessage':require(_0x50af('0x5')),'openchannelMessage':require(_0x50af('0x6')),'mailMessage':require(_0x50af('0x7')),'smsMessage':require(_0x50af('0x8')),'faxMessage':require(_0x50af('0x9'))};exports[_0x50af('0xa')]=function(_0xe37b1,_0x5e94f8){return function(_0x5a5c0a){try{if(!_[_0x50af('0xb')](this[_0x50af('0xc')]['UserId'])){logger['info'](_0x50af('0xd'),_0xe37b1,_0x50af('0xe'));return _0x5a5c0a['next']();}var _0x4bef88={'ContactId':this[_0x50af('0xf')]['id'],'sentAt':moment()[_0x50af('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x50af('0x11')};var _0x28a92c=this[_0x50af('0x12')];if(_0x28a92c===_0x50af('0x13')){_0x4bef88['ChatWebsiteId']=this[_0x50af('0x14')]['id'];}else{_0x4bef88[_[_0x50af('0x15')](_0x28a92c)+_0x50af('0x16')]=this[_0x50af('0x14')]['id'];}_0x4bef88[_[_0x50af('0x15')](_0x28a92c)+_0x50af('0x17')]=this['interaction']['id'];if(this['interaction']['created']){var _0x620389=_0x5e94f8[0x2];if(!_['isEmpty'](_0x620389)){_0x4bef88[_0x50af('0x18')]=utils[_0x50af('0x19')](_0x620389,this);return rpc[_0x28a92c+'Message']['create'](_0x4bef88)[_0x50af('0x1a')](function(_0x13cbf4){logger['info']('[%s][DIALOGFLOW]\x20%s',_0xe37b1,_0x4bef88[_0x50af('0x18')]);})[_0x50af('0x1b')](function(_0x33869f){logger[_0x50af('0x1c')](_0x50af('0xd'),_0xe37b1,JSON[_0x50af('0x1d')](_0x33869f));})[_0x50af('0x1e')](function(){logger[_0x50af('0x1f')](_0x50af('0x20'),_0xe37b1);_0x5a5c0a[_0x50af('0x21')]();});}else{logger['info'](_0x50af('0x22'),_0xe37b1);_0x5a5c0a[_0x50af('0x21')]();}}else{var _0x3ee220=apiai(_0x5e94f8[0x0],{'language':_0x5e94f8[0x1]||'en'});return _0x3ee220[_0x50af('0x23')](this['message'][_0x50af('0x18')],{'sessionId':this[_0x50af('0xc')]['id']})[_0x50af('0x1a')](function(_0x147da3){_0x4bef88[_0x50af('0x18')]=_0x147da3[_0x50af('0x24')][_0x50af('0x25')][_0x50af('0x26')];return rpc[_0x28a92c+_0x50af('0x27')][_0x50af('0x28')](_0x4bef88)['then'](function(_0x76a6b3){logger[_0x50af('0x1f')](_0x50af('0xd'),_0xe37b1,_0x4bef88[_0x50af('0x18')]);if(_0x147da3[_0x50af('0x24')][_0x50af('0x29')]['endConversation']){_0x5a5c0a[_0x50af('0x2a')]();}else{_0x5a5c0a[_0x50af('0x21')]();}})['catch'](function(_0xd085ec){logger[_0x50af('0x1c')](_0x50af('0xd'),_0xe37b1,JSON['stringify'](_0xd085ec));_0x5a5c0a['next']();});});}}catch(_0x26dbae){logger[_0x50af('0x1c')](_0x50af('0xd'),_0xe37b1,JSON[_0x50af('0x1d')](_0x26dbae));_0x5a5c0a[_0x50af('0x21')]();}};};
\ No newline at end of file
index 4871bdd..54085bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x381a=['string','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','validate','length','error','map','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','lodash','html-to-text','./utils','../../../../config/logger','routing'];(function(_0x9b2bb0,_0x3965b1){var _0x2cdb3b=function(_0x177d75){while(--_0x177d75){_0x9b2bb0['push'](_0x9b2bb0['shift']());}};_0x2cdb3b(++_0x3965b1);}(_0x381a,0x91));var _0xa381=function(_0x4429db,_0x222bf3){_0x4429db=_0x4429db-0x0;var _0x168bdd=_0x381a[_0x4429db];return _0x168bdd;};'use strict';var schema=require('validate');var _=require(_0xa381('0x0'));var htmlToText=require(_0xa381('0x1'));var utils=require(_0xa381('0x2'));var logger=require(_0xa381('0x3'))(_0xa381('0x4'));var gotoif=schema({'condition':{'type':_0xa381('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':_0xa381('0x6')},'priorityFalse':{'type':_0xa381('0x7'),'message':_0xa381('0x8')}});exports['consequence']=function(_0x5ed925,_0x59f784){return function(_0x4ce937){try{var _0x21b309={'condition':htmlToText[_0xa381('0x9')](utils[_0xa381('0xa')](_0x59f784[0x0],this),{'wordwrap':![]})[_0xa381('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x59f784[0x1],'priorityFalse':_0x59f784[0x2]};var _0x4a871b=gotoif[_0xa381('0xc')](_0x21b309,{'typecast':!![]});if(_0x4a871b[_0xa381('0xd')]){logger[_0xa381('0xe')]('[%s][GOTOIF]\x20%s',_0x5ed925,_[_0xa381('0xf')](_0x4a871b,'message')[_0xa381('0x10')](',\x20'));_0x4ce937[_0xa381('0x11')]();}else{try{var _0x670937=eval('('+_0x21b309[_0xa381('0x12')]+')');var _0x54b3d1=_0x670937?_0x21b309[_0xa381('0x13')]:_0x21b309[_0xa381('0x14')];logger[_0xa381('0x15')](_0xa381('0x16'),_0x5ed925,_0x21b309['condition'],_0x670937,_0x54b3d1||_0xa381('0x17'));if(_0x54b3d1){var _0x5b4e46=_[_0xa381('0x18')](_0x4ce937[_0xa381('0x19')](),{'p':_0x54b3d1});if(_0x5b4e46>=0x0){logger[_0xa381('0x15')](_0xa381('0x1a'),_0x5ed925,_0x54b3d1||_0xa381('0x17'),_0x5b4e46);_0x4ce937[_0xa381('0x17')](_0x5b4e46);}else{logger[_0xa381('0x15')](_0xa381('0x1b'),_0x5ed925,_0x54b3d1||_0xa381('0x17'));_0x4ce937['stop']();}}else{_0x4ce937['next']();}}catch(_0x47e13e){logger[_0xa381('0xe')](_0xa381('0x1c'),_0x5ed925,_0x47e13e['message']);_0x4ce937['stop']();}}}catch(_0x466f10){logger[_0xa381('0xe')](_0xa381('0x1d'),_0x5ed925,JSON['stringify'](_0x466f10));_0x4ce937[_0xa381('0x11')]();}};};
\ No newline at end of file
+var _0x06d5=['priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','map','message','stop','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','rules','next','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','validate','lodash','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x24cf7f,_0xcda231){var _0x4c6742=function(_0x2469db){while(--_0x2469db){_0x24cf7f['push'](_0x24cf7f['shift']());}};_0x4c6742(++_0xcda231);}(_0x06d5,0x66));var _0x506d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x06d5[_0x17d9e3];return _0x14192d;};'use strict';var schema=require(_0x506d('0x0'));var _=require(_0x506d('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x506d('0x2'));var logger=require(_0x506d('0x3'))('routing');var gotoif=schema({'condition':{'type':_0x506d('0x4'),'required':!![],'message':_0x506d('0x5')},'priorityTrue':{'type':'number','message':_0x506d('0x6')},'priorityFalse':{'type':_0x506d('0x7'),'message':_0x506d('0x8')}});exports[_0x506d('0x9')]=function(_0x2139d0,_0x577092){return function(_0x212f18){try{var _0x1b04c4={'condition':htmlToText[_0x506d('0xa')](utils[_0x506d('0xb')](_0x577092[0x0],this),{'wordwrap':![]})[_0x506d('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x577092[0x1],'priorityFalse':_0x577092[0x2]};var _0x17a487=gotoif[_0x506d('0x0')](_0x1b04c4,{'typecast':!![]});if(_0x17a487[_0x506d('0xd')]){logger[_0x506d('0xe')]('[%s][GOTOIF]\x20%s',_0x2139d0,_[_0x506d('0xf')](_0x17a487,_0x506d('0x10'))['join'](',\x20'));_0x212f18[_0x506d('0x11')]();}else{try{var _0xf8c765=eval('('+_0x1b04c4[_0x506d('0x12')]+')');var _0xbbbf2d=_0xf8c765?_0x1b04c4['priorityTrue']:_0x1b04c4[_0x506d('0x13')];logger[_0x506d('0x14')](_0x506d('0x15'),_0x2139d0,_0x1b04c4['condition'],_0xf8c765,_0xbbbf2d||'next');if(_0xbbbf2d){var _0x3c6e49=_['findIndex'](_0x212f18[_0x506d('0x16')](),{'p':_0xbbbf2d});if(_0x3c6e49>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2139d0,_0xbbbf2d||_0x506d('0x17'),_0x3c6e49);_0x212f18[_0x506d('0x17')](_0x3c6e49);}else{logger[_0x506d('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x2139d0,_0xbbbf2d||_0x506d('0x17'));_0x212f18[_0x506d('0x11')]();}}else{_0x212f18[_0x506d('0x17')]();}}catch(_0x8ba608){logger['error'](_0x506d('0x18'),_0x2139d0,_0x8ba608[_0x506d('0x10')]);_0x212f18[_0x506d('0x11')]();}}}catch(_0x5e50e9){logger['error'](_0x506d('0x19'),_0x2139d0,JSON[_0x506d('0x1a')](_0x5e50e9));_0x212f18[_0x506d('0x11')]();}};};
\ No newline at end of file
index 6d4fba6..377a10c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8236=['[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','stringify','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','validate','length','[%s][GOTOP]\x20%s','map','message','stop','info'];(function(_0xa921a1,_0x390347){var _0xc26d61=function(_0x1742cb){while(--_0x1742cb){_0xa921a1['push'](_0xa921a1['shift']());}};_0xc26d61(++_0x390347);}(_0x8236,0x184));var _0x6823=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x8236[_0x82129b];return _0x2ae5dc;};'use strict';var schema=require('validate');var _=require(_0x6823('0x0'));var logger=require(_0x6823('0x1'))('routing');var gotop=schema({'priority':{'type':_0x6823('0x2'),'required':!![],'message':_0x6823('0x3')}});exports['consequence']=function(_0x3a2f42,_0x2d27b9){return function(_0x278dd9){try{var _0x694f52={'priority':_0x2d27b9[0x0]};var _0x353dfb=gotop[_0x6823('0x4')](_0x694f52,{'typecast':!![]});if(_0x353dfb[_0x6823('0x5')]){logger['error'](_0x6823('0x6'),_0x3a2f42,_[_0x6823('0x7')](_0x353dfb,_0x6823('0x8'))['join'](',\x20'));_0x278dd9[_0x6823('0x9')]();}else{logger[_0x6823('0xa')](_0x6823('0xb'),_0x3a2f42,_0x694f52[_0x6823('0xc')]);if(_0x694f52[_0x6823('0xc')]){var _0x18715d=_[_0x6823('0xd')](_0x278dd9[_0x6823('0xe')](),{'p':_0x694f52[_0x6823('0xc')]});if(_0x18715d>=0x0){logger[_0x6823('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3a2f42,_0x694f52['priority']||'next',_0x18715d);_0x278dd9[_0x6823('0xf')](_0x18715d);}else{logger[_0x6823('0xa')](_0x6823('0x10'),_0x3a2f42,_0x694f52[_0x6823('0xc')]||_0x6823('0xf'));_0x278dd9['stop']();}}else{_0x278dd9[_0x6823('0xf')]();}}}catch(_0x9870bf){logger[_0x6823('0x11')]('[%s][GOTOP]\x20%s',_0x3a2f42,JSON[_0x6823('0x12')](_0x9870bf));_0x278dd9[_0x6823('0x9')]();}};};
\ No newline at end of file
+var _0xbe9d=['priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s'];(function(_0xd637a3,_0x19b904){var _0x180a84=function(_0x2fc05a){while(--_0x2fc05a){_0xd637a3['push'](_0xd637a3['shift']());}};_0x180a84(++_0x19b904);}(_0xbe9d,0xfd));var _0xdbe9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbe9d[_0xa464c9];return _0x3d73c4;};'use strict';var schema=require(_0xdbe9('0x0'));var _=require(_0xdbe9('0x1'));var logger=require(_0xdbe9('0x2'))('routing');var gotop=schema({'priority':{'type':_0xdbe9('0x3'),'required':!![],'message':_0xdbe9('0x4')}});exports[_0xdbe9('0x5')]=function(_0x1c3e79,_0xb4f527){return function(_0x1ea578){try{var _0x4a59a6={'priority':_0xb4f527[0x0]};var _0x3c9ef4=gotop[_0xdbe9('0x0')](_0x4a59a6,{'typecast':!![]});if(_0x3c9ef4['length']){logger[_0xdbe9('0x6')](_0xdbe9('0x7'),_0x1c3e79,_[_0xdbe9('0x8')](_0x3c9ef4,'message')[_0xdbe9('0x9')](',\x20'));_0x1ea578[_0xdbe9('0xa')]();}else{logger[_0xdbe9('0xb')](_0xdbe9('0xc'),_0x1c3e79,_0x4a59a6[_0xdbe9('0xd')]);if(_0x4a59a6[_0xdbe9('0xd')]){var _0x37310c=_[_0xdbe9('0xe')](_0x1ea578[_0xdbe9('0xf')](),{'p':_0x4a59a6[_0xdbe9('0xd')]});if(_0x37310c>=0x0){logger[_0xdbe9('0xb')](_0xdbe9('0x10'),_0x1c3e79,_0x4a59a6['priority']||_0xdbe9('0x11'),_0x37310c);_0x1ea578[_0xdbe9('0x11')](_0x37310c);}else{logger[_0xdbe9('0xb')](_0xdbe9('0x12'),_0x1c3e79,_0x4a59a6[_0xdbe9('0xd')]||'next');_0x1ea578[_0xdbe9('0xa')]();}}else{_0x1ea578[_0xdbe9('0x11')]();}}}catch(_0x2c30f8){logger[_0xdbe9('0x6')](_0xdbe9('0x7'),_0x1c3e79,JSON['stringify'](_0x2c30f8));_0x1ea578[_0xdbe9('0xa')]();}};};
\ No newline at end of file
index 69f6861..18556bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x509f=['contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','stringify','error','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender'];(function(_0x45f176,_0x56d1f5){var _0x1985fe=function(_0x463c4a){while(--_0x463c4a){_0x45f176['push'](_0x45f176['shift']());}};_0x1985fe(++_0x56d1f5);}(_0x509f,0x1c2));var _0xf509=function(_0x34ab34,_0x13b573){_0x34ab34=_0x34ab34-0x0;var _0x256d37=_0x509f[_0x34ab34];return _0x256d37;};'use strict';var _=require(_0xf509('0x0'));var utils=require(_0xf509('0x1'));var logger=require(_0xf509('0x2'))('routing');var rpc={'chatMessage':require(_0xf509('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xf509('0x4')),'smsMessage':require(_0xf509('0x5')),'faxMessage':require(_0xf509('0x6'))};exports[_0xf509('0x7')]=function(_0x20bbbf,_0x38f4ff){return function(_0x33dc4a){try{var _0x428edc={'body':utils[_0xf509('0x8')](_0x38f4ff[0x0],this),'ContactId':this[_0xf509('0x9')]['id']};if(this[_0xf509('0xa')]===_0xf509('0xb')){_0x428edc[_0xf509('0xc')]=this[_0xf509('0xd')]['id'];}else{_0x428edc[_[_0xf509('0xe')](this[_0xf509('0xa')])+_0xf509('0xf')]=this[_0xf509('0xd')]['id'];}_0x428edc[_['upperFirst'](this[_0xf509('0xa')])+'InteractionId']=this[_0xf509('0x10')]['id'];if(rpc[this[_0xf509('0xa')]+_0xf509('0x11')]){return rpc[this[_0xf509('0xa')]+_0xf509('0x11')][_0xf509('0x12')](_0x428edc)[_0xf509('0x13')](function(_0x487be7){logger[_0xf509('0x14')](_0xf509('0x15'),_0x20bbbf,_0x428edc[_0xf509('0x16')]);_0x33dc4a[_0xf509('0x17')]();})[_0xf509('0x18')](function(_0x39ba15){logger['error'](_0xf509('0x15'),_0x20bbbf,JSON[_0xf509('0x19')](_0x39ba15));_0x33dc4a['stop']();});}}catch(_0x6af01){logger[_0xf509('0x1a')](_0xf509('0x15'),_0x20bbbf,JSON[_0xf509('0x19')](_0x6af01));_0x33dc4a['stop']();}};};
\ No newline at end of file
+var _0xa76a=['getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence'];(function(_0x121e9f,_0x130ec8){var _0x8ff963=function(_0x352370){while(--_0x352370){_0x121e9f['push'](_0x121e9f['shift']());}};_0x8ff963(++_0x130ec8);}(_0xa76a,0x11a));var _0xaa76=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xa76a[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0xaa76('0x0'));var utils=require(_0xaa76('0x1'));var logger=require(_0xaa76('0x2'))('routing');var rpc={'chatMessage':require(_0xaa76('0x3')),'openchannelMessage':require(_0xaa76('0x4')),'mailMessage':require(_0xaa76('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xaa76('0x6'))};exports[_0xaa76('0x7')]=function(_0x32d66b,_0x1d34e1){return function(_0x4dc3a7){try{var _0x45f4f8={'body':utils[_0xaa76('0x8')](_0x1d34e1[0x0],this),'ContactId':this[_0xaa76('0x9')]['id']};if(this[_0xaa76('0xa')]===_0xaa76('0xb')){_0x45f4f8[_0xaa76('0xc')]=this[_0xaa76('0xd')]['id'];}else{_0x45f4f8[_[_0xaa76('0xe')](this[_0xaa76('0xa')])+_0xaa76('0xf')]=this[_0xaa76('0xd')]['id'];}_0x45f4f8[_[_0xaa76('0xe')](this[_0xaa76('0xa')])+_0xaa76('0x10')]=this[_0xaa76('0x11')]['id'];if(rpc[this[_0xaa76('0xa')]+_0xaa76('0x12')]){return rpc[this[_0xaa76('0xa')]+_0xaa76('0x12')][_0xaa76('0x13')](_0x45f4f8)[_0xaa76('0x14')](function(_0x199519){logger[_0xaa76('0x15')](_0xaa76('0x16'),_0x32d66b,_0x45f4f8[_0xaa76('0x17')]);_0x4dc3a7[_0xaa76('0x18')]();})[_0xaa76('0x19')](function(_0x28b096){logger[_0xaa76('0x1a')]('[%s][MESSAGE]\x20%s',_0x32d66b,JSON[_0xaa76('0x1b')](_0x28b096));_0x4dc3a7[_0xaa76('0x1c')]();});}}catch(_0x5e4325){logger[_0xaa76('0x1a')](_0xaa76('0x16'),_0x32d66b,JSON[_0xaa76('0x1b')](_0x5e4325));_0x4dc3a7['stop']();}};};
\ No newline at end of file
index a4c7bf8..363f0d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf65=['getMustacheRender','next','[%s][NOOP]\x20%s','stop','../../../../config/logger','routing','consequence','info'];(function(_0x5adef0,_0x3e3da8){var _0x360f6b=function(_0x4f54ba){while(--_0x4f54ba){_0x5adef0['push'](_0x5adef0['shift']());}};_0x360f6b(++_0x3e3da8);}(_0xaf65,0x15c));var _0x5af6=function(_0x3a87b6,_0xfb0b8d){_0x3a87b6=_0x3a87b6-0x0;var _0x2aeb35=_0xaf65[_0x3a87b6];return _0x2aeb35;};'use strict';var utils=require('./utils');var logger=require(_0x5af6('0x0'))(_0x5af6('0x1'));exports[_0x5af6('0x2')]=function(_0x3a50cc,_0xd1a02){return function(_0x47bc74){try{logger[_0x5af6('0x3')]('[%s][NOOP]\x20%s',_0x3a50cc,utils[_0x5af6('0x4')](_0xd1a02[0x0],this));_0x47bc74[_0x5af6('0x5')]();}catch(_0x5e2083){logger['error'](_0x5af6('0x6'),_0x3a50cc,JSON['stringify'](_0x5e2083));_0x47bc74[_0x5af6('0x7')]();}};};
\ No newline at end of file
+var _0xf1f2=['info','[%s][NOOP]\x20%s','getMustacheRender','stringify','stop','../../../../config/logger','routing','consequence'];(function(_0x1789bc,_0x1acf84){var _0x35efd1=function(_0x2329b2){while(--_0x2329b2){_0x1789bc['push'](_0x1789bc['shift']());}};_0x35efd1(++_0x1acf84);}(_0xf1f2,0x145));var _0x2f1f=function(_0x5dc03e,_0x54e60c){_0x5dc03e=_0x5dc03e-0x0;var _0x466a07=_0xf1f2[_0x5dc03e];return _0x466a07;};'use strict';var utils=require('./utils');var logger=require(_0x2f1f('0x0'))(_0x2f1f('0x1'));exports[_0x2f1f('0x2')]=function(_0x4f16c6,_0x95043e){return function(_0x5b967a){try{logger[_0x2f1f('0x3')](_0x2f1f('0x4'),_0x4f16c6,utils[_0x2f1f('0x5')](_0x95043e[0x0],this));_0x5b967a['next']();}catch(_0x158d28){logger['error']('[%s][NOOP]\x20%s',_0x4f16c6,JSON[_0x2f1f('0x6')](_0x158d28));_0x5b967a[_0x2f1f('0x7')]();}};};
\ No newline at end of file
index d398384..08fd46c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89af=['[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','waiting','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','stop','find','Queues','timeout','createQueue','atimeout','qtimeout','rules','close','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stringify','lodash','util','seq-queue','moment','routing','./strategy','socket.io-emitter','localhost','queue_id','queue','joinAt','emit','account','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','from','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1bf2a4,_0x38a110){var _0x3486ca=function(_0x1f966b){while(--_0x1f966b){_0x1bf2a4['push'](_0x1bf2a4['shift']());}};_0x3486ca(++_0x38a110);}(_0x89af,0xf9));var _0xf89a=function(_0x4e79bf,_0x444586){_0x4e79bf=_0x4e79bf-0x0;var _0x200084=_0x89af[_0x4e79bf];return _0x200084;};'use strict';var schema=require('validate');var _=require(_0xf89a('0x0'));var util=require(_0xf89a('0x1'));var seqqueue=require(_0xf89a('0x2'));var moment=require(_0xf89a('0x3'));var logger=require('../../../../config/logger')(_0xf89a('0x4'));var strategy=require(_0xf89a('0x5'));var io=require(_0xf89a('0x6'))({'host':_0xf89a('0x7'),'port':0x18eb});var attributes=['id',_0xf89a('0x8'),'account',_0xf89a('0x9'),'from',_0xf89a('0xa')];function emit(_0x460eb5,_0x3640d8,_0x23b84e){io['to'](_0x460eb5)[_0xf89a('0xb')](_0x3640d8,_0x23b84e);}function emitChannelQueueInteraction(_0x9b23e7,_0x2da85e,_0x2a8e11,_0x47202a,_0x253a37,_0x8cc10,_0x2e284e,_0x22fc69){_0x2a8e11[_0xf89a('0x8')]=_0x22fc69;_0x2a8e11[_0xf89a('0x9')]=_0x2da85e;_0x2a8e11[_0xf89a('0xc')]=_0x47202a;_0x2a8e11['id']=_0x253a37;if(_0x8cc10){_0x2e284e[util[_0xf89a('0xd')](_0xf89a('0xe'),_0x9b23e7)][_0x253a37]=_[_0xf89a('0xf')](_0x2a8e11,attributes);}else{delete _0x2e284e[util[_0xf89a('0xd')]('%sQueuesWaitingInteractions',_0x9b23e7)][_0x253a37];}emit(util['format'](_0xf89a('0x10'),_0x9b23e7,_0x2da85e),util[_0xf89a('0xd')]('%s_queue_waiting_interaction:%s',_0x9b23e7,_0x8cc10?_0xf89a('0x11'):'remove'),_['pick'](_0x2a8e11,attributes));}var rpc={'openchannelQueueReport':require(_0xf89a('0x12')),'mailQueueReport':require(_0xf89a('0x13')),'chatQueueReport':require(_0xf89a('0x14')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xf89a('0x15'))};var queue=schema({'name':{'type':_0xf89a('0x16'),'required':!![],'message':_0xf89a('0x17')},'timeout':{'type':_0xf89a('0x18'),'message':_0xf89a('0x19')}});function startRouting(_0x450341,_0x4b0f7c,_0x4066f6,_0x5b97b4){if(_0x450341&&_0x4b0f7c&&_0x4066f6){_0x4b0f7c['waiting']+=0x1;var _0x14c422={'uniqueid':_0x450341,'from':_0x4066f6['body']?_0x4066f6[_0xf89a('0x1a')][_0xf89a('0x1b')]:'','joinAt':moment()[_0xf89a('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4066f6[_0xf89a('0x1c')]?_0x4066f6[_0xf89a('0x1c')]['id']:null,'ListId':_0x4066f6[_0xf89a('0x1d')]?_0x4066f6['list']['id']:null};_0x14c422[_['upperFirst'](_0x4066f6[_0xf89a('0x1e')])+_0xf89a('0x1f')]=_0x4b0f7c['id']||null;_0x14c422[_[_0xf89a('0x20')](_0x4066f6[_0xf89a('0x1e')])+_0xf89a('0x21')]=_0x4066f6[_0xf89a('0x22')]?_0x4066f6[_0xf89a('0x22')]['id']:null;_0x14c422[_[_0xf89a('0x20')](_0x4066f6[_0xf89a('0x1e')])+_0xf89a('0x23')]=_0x4066f6['message']?_0x4066f6[_0xf89a('0x24')]['id']:null;_0x14c422[_[_0xf89a('0x20')](_0x4066f6[_0xf89a('0x1e')])+(_0x4066f6['channel']!==_0xf89a('0x25')?_0xf89a('0x26'):'WebsiteId')]=_0x4066f6['account']?_0x4066f6[_0xf89a('0xc')]['id']:null;logger[_0xf89a('0x27')](util[_0xf89a('0xd')](_0xf89a('0x28'),_0x450341,_0x4b0f7c[_0xf89a('0x29')]));emitChannelQueueInteraction(_0x4066f6[_0xf89a('0x1e')],_0x4b0f7c[_0xf89a('0x29')],_0x14c422,_0x4066f6['account'][_0xf89a('0x29')],_0x4066f6['message']['id'],!![],_0x5b97b4,_0x4b0f7c['id']);if(rpc[_0x4066f6[_0xf89a('0x1e')]+'QueueReport']){return rpc[_0x4066f6[_0xf89a('0x1e')]+_0xf89a('0x2a')][_0xf89a('0x2b')](_0x14c422)[_0xf89a('0x2c')](function(_0x538c3a){logger[_0xf89a('0x2d')]('create\x20queue\x20report');});}}}function stopRouting(_0x286d63,_0x21d6fc,_0x7bab62,_0x5e49b6){if(_0x286d63&&_0x21d6fc){_0x21d6fc['waiting']-=0x1;var _0x48cb8b={'leaveAt':moment()[_0xf89a('0xd')](_0xf89a('0x2e')),'acceptAt':moment()[_0xf89a('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0xf89a('0x27')](util['format'](_0xf89a('0x2f'),_0x286d63,_0x21d6fc[_0xf89a('0x29')]));emitChannelQueueInteraction(_0x7bab62[_0xf89a('0x1e')],_0x21d6fc[_0xf89a('0x29')],_0x7bab62[_0xf89a('0x1a')],_0x7bab62['account'][_0xf89a('0x29')],_0x7bab62[_0xf89a('0x24')]['id'],![],_0x5e49b6,_0x21d6fc['id']);if(rpc[_0x7bab62['channel']+_0xf89a('0x2a')]){return rpc[_0x7bab62['channel']+'QueueReport']['update'](_0x286d63,_0x48cb8b)[_0xf89a('0x2c')](function(_0x41985e){logger[_0xf89a('0x2d')](_0xf89a('0x30'));});}}}function endRouting(_0x13145c,_0x1a676e,_0xfd2c5c,_0x595fa6){if(_0x13145c&&_0x1a676e){_0x1a676e[_0xf89a('0x31')]-=0x1;var _0x47cd46={'leaveAt':moment()['format'](_0xf89a('0x2e')),'exitAt':moment()[_0xf89a('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger[_0xf89a('0x27')](util[_0xf89a('0xd')](_0xf89a('0x32'),_0x13145c,_0x1a676e['name']));emitChannelQueueInteraction(_0xfd2c5c[_0xf89a('0x1e')],_0x1a676e[_0xf89a('0x29')],_0xfd2c5c[_0xf89a('0x1a')],_0xfd2c5c[_0xf89a('0xc')][_0xf89a('0x29')],_0xfd2c5c[_0xf89a('0x24')]['id'],![],_0x595fa6);if(rpc[_0xfd2c5c[_0xf89a('0x1e')]+_0xf89a('0x2a')]){return rpc[_0xfd2c5c['channel']+'QueueReport'][_0xf89a('0x33')](_0x13145c,_0x47cd46)[_0xf89a('0x2c')](function(_0x4b0be6){logger[_0xf89a('0x2d')](_0xf89a('0x30'));});}}}function handleFindQueue(_0x4be3ab){return function(_0xe7fd1){return _0xe7fd1[_0xf89a('0x29')]['toLowerCase']()===_0x4be3ab[_0xf89a('0x34')]();};}exports[_0xf89a('0x35')]=function(_0x4e3b0b,_0x5859d5,_0x36e3ce,_0x788396){return function(_0x413cc7){try{var _0x5ad506={'name':_0x5859d5[0x0],'timeout':_0x5859d5[0x1]};var _0x5e9914=queue[_0xf89a('0x36')](_0x5ad506,{'typecast':!![]});if(_0x5e9914[_0xf89a('0x37')]){logger[_0xf89a('0x2d')](_0xf89a('0x38'),_0x4e3b0b,_[_0xf89a('0x39')](_0x5e9914,_0xf89a('0x24'))['join'](',\x20'));_0x413cc7[_0xf89a('0x3a')]();}else{var _0x4bfcb8=_[_0xf89a('0x3b')](_0x36e3ce[_0x788396[_0xf89a('0x1e')]+_0xf89a('0x3c')],handleFindQueue(_0x5ad506[_0xf89a('0x29')]));if(_0x4bfcb8){startRouting(_0x4e3b0b,_0x4bfcb8,_0x788396,_0x36e3ce);var _0x11ee36=(_0x4bfcb8[_0xf89a('0x3d')]||0xa)*0x3e8;var _0x27ebe2=(_0x5ad506[_0xf89a('0x3d')]||0x14)*0x3e8;var _0x4e3ea9,_0x4ce21b;if(_0x11ee36>_0x27ebe2){_0x27ebe2=_0x11ee36;}var _0x5ed127=seqqueue[_0xf89a('0x3e')](_0x11ee36);_0x5ed127['id']=_0x4e3b0b;_0x5ed127[_0xf89a('0x3f')]=_0x11ee36;_0x5ed127[_0xf89a('0x40')]=_0x27ebe2;_0x5ed127[_0xf89a('0x1e')]=_0x788396[_0xf89a('0x1e')];_0x4ce21b=setInterval(function(){if(_0x36e3ce[_0xf89a('0x41')]&&!_0x36e3ce[_0xf89a('0x41')][_0x4e3b0b]){stopRouting(_0x4e3b0b,_0x4bfcb8,_0x788396,_0x36e3ce);clearTimeout(_0x4e3ea9);clearInterval(_0x4ce21b);_0x4e3ea9=undefined;_0x5ed127[_0xf89a('0x42')](!![]);_0x413cc7['stop']();}},0x3e8);_0x4e3ea9=setTimeout(function(){endRouting(_0x4e3b0b,_0x4bfcb8,_0x788396,_0x36e3ce);clearInterval(_0x4ce21b);_0x4ce21b=undefined;_0x5ed127[_0xf89a('0x42')](!![]);_0x413cc7[_0xf89a('0x43')]();},_0x27ebe2);switch(_0x4bfcb8[_0xf89a('0x44')]){case'rrmemory':strategy[_0xf89a('0x45')](_0x5ed127,_0x4bfcb8,_0x36e3ce,_0x788396);break;default:strategy[_0xf89a('0x46')](_0x5ed127,_0x4bfcb8,_0x36e3ce,_0x788396);}}else{logger['error'](_0xf89a('0x47'),_0x4e3b0b,_0x5ad506[_0xf89a('0x29')]);_0x413cc7[_0xf89a('0x3a')]();}}}catch(_0x25a9e2){console[_0xf89a('0x48')](_0x25a9e2);logger[_0xf89a('0x2d')](_0xf89a('0x38'),_0x4e3b0b,JSON[_0xf89a('0x49')](_0x25a9e2));_0x413cc7[_0xf89a('0x3a')]();}};};
\ No newline at end of file
+var _0x354a=['localhost','queue_id','account','queue','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','string','number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','InteractionId','interaction','upperFirst','MessageId','message','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','catch','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','length','[%s][QUEUE]\x20%s','map','join','stop','Queues','atimeout','qtimeout','rules','close','strategy','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stringify','validate','lodash','util','moment','../../../../config/logger','./strategy','socket.io-emitter'];(function(_0x1334d0,_0x258fd4){var _0x12706a=function(_0x2f91f4){while(--_0x2f91f4){_0x1334d0['push'](_0x1334d0['shift']());}};_0x12706a(++_0x258fd4);}(_0x354a,0xbf));var _0xa354=function(_0x153f7b,_0x3d2df4){_0x153f7b=_0x153f7b-0x0;var _0x212994=_0x354a[_0x153f7b];return _0x212994;};'use strict';var schema=require(_0xa354('0x0'));var _=require(_0xa354('0x1'));var util=require(_0xa354('0x2'));var seqqueue=require('seq-queue');var moment=require(_0xa354('0x3'));var logger=require(_0xa354('0x4'))('routing');var strategy=require(_0xa354('0x5'));var io=require(_0xa354('0x6'))({'host':_0xa354('0x7'),'port':0x18eb});var attributes=['id',_0xa354('0x8'),_0xa354('0x9'),_0xa354('0xa'),'from','joinAt'];function emit(_0x2444e3,_0x4c6f00,_0x4220d6){io['to'](_0x2444e3)['emit'](_0x4c6f00,_0x4220d6);}function emitChannelQueueInteraction(_0x10ac41,_0x2c169d,_0x106bff,_0x301e3d,_0xfe86a3,_0x455347,_0x5c281e,_0xd1e023){_0x106bff[_0xa354('0x8')]=_0xd1e023;_0x106bff[_0xa354('0xa')]=_0x2c169d;_0x106bff[_0xa354('0x9')]=_0x301e3d;_0x106bff['id']=_0xfe86a3;if(_0x455347){_0x5c281e[util[_0xa354('0xb')]('%sQueuesWaitingInteractions',_0x10ac41)][_0xfe86a3]=_[_0xa354('0xc')](_0x106bff,attributes);}else{delete _0x5c281e[util['format'](_0xa354('0xd'),_0x10ac41)][_0xfe86a3];}emit(util['format'](_0xa354('0xe'),_0x10ac41,_0x2c169d),util[_0xa354('0xb')](_0xa354('0xf'),_0x10ac41,_0x455347?_0xa354('0x10'):'remove'),_['pick'](_0x106bff,attributes));}var rpc={'openchannelQueueReport':require(_0xa354('0x11')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xa354('0x12')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xa354('0x13'))};var queue=schema({'name':{'type':_0xa354('0x14'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xa354('0x15'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x3917b6,_0x157717,_0x2c6988,_0x59c210){if(_0x3917b6&&_0x157717&&_0x2c6988){_0x157717[_0xa354('0x16')]+=0x1;var _0x1ceea8={'uniqueid':_0x3917b6,'from':_0x2c6988['body']?_0x2c6988[_0xa354('0x17')][_0xa354('0x18')]:'','joinAt':moment()[_0xa354('0xb')](_0xa354('0x19')),'ContactId':_0x2c6988[_0xa354('0x1a')]?_0x2c6988[_0xa354('0x1a')]['id']:null,'ListId':_0x2c6988['list']?_0x2c6988[_0xa354('0x1b')]['id']:null};_0x1ceea8[_['upperFirst'](_0x2c6988[_0xa354('0x1c')])+'QueueId']=_0x157717['id']||null;_0x1ceea8[_['upperFirst'](_0x2c6988[_0xa354('0x1c')])+_0xa354('0x1d')]=_0x2c6988[_0xa354('0x1e')]?_0x2c6988[_0xa354('0x1e')]['id']:null;_0x1ceea8[_[_0xa354('0x1f')](_0x2c6988[_0xa354('0x1c')])+_0xa354('0x20')]=_0x2c6988[_0xa354('0x21')]?_0x2c6988[_0xa354('0x21')]['id']:null;_0x1ceea8[_[_0xa354('0x1f')](_0x2c6988[_0xa354('0x1c')])+(_0x2c6988[_0xa354('0x1c')]!==_0xa354('0x22')?'AccountId':_0xa354('0x23'))]=_0x2c6988[_0xa354('0x9')]?_0x2c6988[_0xa354('0x9')]['id']:null;logger[_0xa354('0x24')](util[_0xa354('0xb')](_0xa354('0x25'),_0x3917b6,_0x157717[_0xa354('0x26')]));emitChannelQueueInteraction(_0x2c6988[_0xa354('0x1c')],_0x157717[_0xa354('0x26')],_0x1ceea8,_0x2c6988[_0xa354('0x9')][_0xa354('0x26')],_0x2c6988[_0xa354('0x21')]['id'],!![],_0x59c210,_0x157717['id']);if(rpc[_0x2c6988[_0xa354('0x1c')]+_0xa354('0x27')]){return rpc[_0x2c6988[_0xa354('0x1c')]+_0xa354('0x27')][_0xa354('0x28')](_0x1ceea8)['catch'](function(_0x1d611f){logger[_0xa354('0x29')](_0xa354('0x2a'));});}}}function stopRouting(_0x54aa30,_0x1e300e,_0x264474,_0x308026){if(_0x54aa30&&_0x1e300e){_0x1e300e['waiting']-=0x1;var _0x4e9eda={'leaveAt':moment()[_0xa354('0xb')](_0xa354('0x19')),'acceptAt':moment()[_0xa354('0xb')](_0xa354('0x19')),'reason':_0xa354('0x2b')};logger[_0xa354('0x24')](util['format'](_0xa354('0x2c'),_0x54aa30,_0x1e300e[_0xa354('0x26')]));emitChannelQueueInteraction(_0x264474[_0xa354('0x1c')],_0x1e300e['name'],_0x264474[_0xa354('0x17')],_0x264474[_0xa354('0x9')][_0xa354('0x26')],_0x264474[_0xa354('0x21')]['id'],![],_0x308026,_0x1e300e['id']);if(rpc[_0x264474[_0xa354('0x1c')]+_0xa354('0x27')]){return rpc[_0x264474[_0xa354('0x1c')]+_0xa354('0x27')][_0xa354('0x2d')](_0x54aa30,_0x4e9eda)[_0xa354('0x2e')](function(_0x553995){logger[_0xa354('0x29')]('update\x20queue\x20report');});}}}function endRouting(_0x360f40,_0x4e98d8,_0x3cd601,_0x19949e){if(_0x360f40&&_0x4e98d8){_0x4e98d8[_0xa354('0x16')]-=0x1;var _0x16af9e={'leaveAt':moment()[_0xa354('0xb')](_0xa354('0x19')),'exitAt':moment()[_0xa354('0xb')](_0xa354('0x19')),'reason':_0xa354('0x2f')};logger[_0xa354('0x24')](util['format'](_0xa354('0x30'),_0x360f40,_0x4e98d8[_0xa354('0x26')]));emitChannelQueueInteraction(_0x3cd601[_0xa354('0x1c')],_0x4e98d8[_0xa354('0x26')],_0x3cd601[_0xa354('0x17')],_0x3cd601[_0xa354('0x9')]['name'],_0x3cd601[_0xa354('0x21')]['id'],![],_0x19949e);if(rpc[_0x3cd601[_0xa354('0x1c')]+_0xa354('0x27')]){return rpc[_0x3cd601[_0xa354('0x1c')]+_0xa354('0x27')][_0xa354('0x2d')](_0x360f40,_0x16af9e)[_0xa354('0x2e')](function(_0x169a53){logger['error'](_0xa354('0x31'));});}}}function handleFindQueue(_0x229775){return function(_0x4e690f){return _0x4e690f['name'][_0xa354('0x32')]()===_0x229775[_0xa354('0x32')]();};}exports['consequence']=function(_0x53eec5,_0x5ab6ef,_0x54a5ba,_0x58c579){return function(_0x593560){try{var _0x219eab={'name':_0x5ab6ef[0x0],'timeout':_0x5ab6ef[0x1]};var _0x33dbeb=queue['validate'](_0x219eab,{'typecast':!![]});if(_0x33dbeb[_0xa354('0x33')]){logger['error'](_0xa354('0x34'),_0x53eec5,_[_0xa354('0x35')](_0x33dbeb,_0xa354('0x21'))[_0xa354('0x36')](',\x20'));_0x593560[_0xa354('0x37')]();}else{var _0x1c4b16=_['find'](_0x54a5ba[_0x58c579[_0xa354('0x1c')]+_0xa354('0x38')],handleFindQueue(_0x219eab[_0xa354('0x26')]));if(_0x1c4b16){startRouting(_0x53eec5,_0x1c4b16,_0x58c579,_0x54a5ba);var _0x39893c=(_0x1c4b16[_0xa354('0x2f')]||0xa)*0x3e8;var _0xc42e03=(_0x219eab[_0xa354('0x2f')]||0x14)*0x3e8;var _0x31cda2,_0x23cfcd;if(_0x39893c>_0xc42e03){_0xc42e03=_0x39893c;}var _0x5ea6cd=seqqueue['createQueue'](_0x39893c);_0x5ea6cd['id']=_0x53eec5;_0x5ea6cd[_0xa354('0x39')]=_0x39893c;_0x5ea6cd[_0xa354('0x3a')]=_0xc42e03;_0x5ea6cd['channel']=_0x58c579[_0xa354('0x1c')];_0x23cfcd=setInterval(function(){if(_0x54a5ba[_0xa354('0x3b')]&&!_0x54a5ba[_0xa354('0x3b')][_0x53eec5]){stopRouting(_0x53eec5,_0x1c4b16,_0x58c579,_0x54a5ba);clearTimeout(_0x31cda2);clearInterval(_0x23cfcd);_0x31cda2=undefined;_0x5ea6cd[_0xa354('0x3c')](!![]);_0x593560[_0xa354('0x37')]();}},0x3e8);_0x31cda2=setTimeout(function(){endRouting(_0x53eec5,_0x1c4b16,_0x58c579,_0x54a5ba);clearInterval(_0x23cfcd);_0x23cfcd=undefined;_0x5ea6cd['close'](!![]);_0x593560['next']();},_0xc42e03);switch(_0x1c4b16[_0xa354('0x3d')]){case'rrmemory':strategy['rrmemory'](_0x5ea6cd,_0x1c4b16,_0x54a5ba,_0x58c579);break;default:strategy[_0xa354('0x3e')](_0x5ea6cd,_0x1c4b16,_0x54a5ba,_0x58c579);}}else{logger[_0xa354('0x29')](_0xa354('0x3f'),_0x53eec5,_0x219eab['name']);_0x593560['stop']();}}}catch(_0x162c19){console[_0xa354('0x40')](_0x162c19);logger[_0xa354('0x29')](_0xa354('0x34'),_0x53eec5,JSON[_0xa354('0x41')](_0x162c19));_0x593560[_0xa354('0x37')]();}};};
\ No newline at end of file
index c792295..dbac107 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdaf7=['isNil','TIMEOUT','hideNotification','lodash','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','bind','handleTimeout','prototype','done','handleRun','info','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','forcedOwnership',':FORCED','busyQueue','showNotification'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0xdaf7,0x67));var _0x7daf=function(_0x5f4368,_0x4ff466){_0x5f4368=_0x5f4368-0x0;var _0x326200=_0xdaf7[_0x5f4368];return _0x326200;};'use strict';var _=require(_0x7daf('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0x7daf('0x1'))(_0x7daf('0x2'));var Agent=function(_0x24261f,_0x3ad832,_0x1679a2,_0x202a2a){this[_0x7daf('0x3')]=uuid['v4']();this[_0x7daf('0x4')]=_0x24261f;this[_0x7daf('0x5')]=_0x3ad832;this[_0x7daf('0x6')]=_0x1679a2;this[_0x7daf('0x2')]=_0x202a2a;this[_0x7daf('0x4')]['push'](this['handleRun'][_0x7daf('0x7')](this),this[_0x7daf('0x8')][_0x7daf('0x7')](this));this[_0x7daf('0x4')]['on']('drained',this['handleTimeout'][_0x7daf('0x7')](this));};Agent[_0x7daf('0x9')]['push']=function(){this[_0x7daf('0x4')]['push'](this['handleRun']['bind'](this),this['handleTimeout']['bind'](this));};Agent[_0x7daf('0x9')][_0x7daf('0xa')]=function(_0x1ff160){if(_0x1ff160){setTimeout(this['push'][_0x7daf('0x7')](this),0x3e8);_0x1ff160[_0x7daf('0xa')]();}};Agent[_0x7daf('0x9')][_0x7daf('0xb')]=function(_0x2e0c2e){logger[_0x7daf('0xc')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x7daf('0x4')]['id'],this['agent']['id']);if(_['isNil'](this['realtime'][_0x7daf('0xd')][this[_0x7daf('0x5')]['id']])){logger['info'](_0x7daf('0xe'),this[_0x7daf('0x4')]['id'],this[_0x7daf('0x5')]['id']);this['done'](_0x2e0c2e);}else{if(this[_0x7daf('0x2')]['forcedOwnership']||util[_0x7daf('0xf')](this[_0x7daf('0x4')]['id'],this[_0x7daf('0x6')][_0x7daf('0xd')][this[_0x7daf('0x5')]['id']],this[_0x7daf('0x4')][_0x7daf('0x10')],![])){util[_0x7daf('0x11')](this['squeue']['id'],this[_0x7daf('0x6')][_0x7daf('0xd')][this[_0x7daf('0x5')]['id']],'RINGING'+(this[_0x7daf('0x2')][_0x7daf('0x12')]?_0x7daf('0x13'):''));this[_0x7daf('0x6')]['agents'][this[_0x7daf('0x5')]['id']]['busy']=!![];this['realtime'][_0x7daf('0xd')][this[_0x7daf('0x5')]['id']][_0x7daf('0x14')]=undefined;util[_0x7daf('0x15')](this[_0x7daf('0x3')],this[_0x7daf('0x4')]['id'],this[_0x7daf('0x6')][_0x7daf('0xd')][this[_0x7daf('0x5')]['id']],null,this[_0x7daf('0x2')]);}else{this[_0x7daf('0xa')](_0x2e0c2e);}}};Agent[_0x7daf('0x9')][_0x7daf('0x8')]=function(){logger[_0x7daf('0xc')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x7daf('0x4')]['id'],this['agent']['id']);if(_[_0x7daf('0x16')](this[_0x7daf('0x6')][_0x7daf('0xd')][this[_0x7daf('0x5')]['id']])){return logger[_0x7daf('0xc')](_0x7daf('0xe'),this[_0x7daf('0x4')]['id'],this[_0x7daf('0x5')]['id']);}else{util[_0x7daf('0x11')](this[_0x7daf('0x4')]['id'],this[_0x7daf('0x6')][_0x7daf('0xd')][this[_0x7daf('0x5')]['id']],_0x7daf('0x17'));this['realtime'][_0x7daf('0xd')][this[_0x7daf('0x5')]['id']]['busy']=![];this[_0x7daf('0x6')]['agents'][this[_0x7daf('0x5')]['id']][_0x7daf('0x14')]=undefined;util[_0x7daf('0x18')](this[_0x7daf('0x3')],this[_0x7daf('0x4')]['id'],this[_0x7daf('0x6')][_0x7daf('0xd')][this[_0x7daf('0x5')]['id']],null,this['routing']);}};function agent(_0x1cb6a1,_0x83b683,_0x565454,_0x1c034a){return new Agent(_0x1cb6a1,_0x83b683,_0x565454,_0x1c034a);}module['exports']=agent;
\ No newline at end of file
+var _0x55ed=['exports','lodash','uuid','../../../../../config/logger','routing','squeue','push','bind','drained','handleTimeout','handleRun','done','prototype','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','realtime','info','forcedOwnership','isAgentAvailable','agents','channel','writeLog','RINGING',':FORCED','busy','busyQueue','showNotification','[%s][AGENT]\x20timeout\x20with\x20%s','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','TIMEOUT','hideNotification','notificationId'];(function(_0x32451d,_0x1bbba8){var _0x2ae346=function(_0x2de025){while(--_0x2de025){_0x32451d['push'](_0x32451d['shift']());}};_0x2ae346(++_0x1bbba8);}(_0x55ed,0x18d));var _0xd55e=function(_0xf7f907,_0x4e8b37){_0xf7f907=_0xf7f907-0x0;var _0x4f293d=_0x55ed[_0xf7f907];return _0x4f293d;};'use strict';var _=require(_0xd55e('0x0'));var uuid=require(_0xd55e('0x1'));var util=require('./util');var logger=require(_0xd55e('0x2'))(_0xd55e('0x3'));var Agent=function(_0x54c5e2,_0x8cc202,_0x192770,_0x31297d){this['notificationId']=uuid['v4']();this[_0xd55e('0x4')]=_0x54c5e2;this['agent']=_0x8cc202;this['realtime']=_0x192770;this['routing']=_0x31297d;this[_0xd55e('0x4')][_0xd55e('0x5')](this['handleRun']['bind'](this),this['handleTimeout'][_0xd55e('0x6')](this));this['squeue']['on'](_0xd55e('0x7'),this[_0xd55e('0x8')][_0xd55e('0x6')](this));};Agent['prototype'][_0xd55e('0x5')]=function(){this[_0xd55e('0x4')][_0xd55e('0x5')](this[_0xd55e('0x9')][_0xd55e('0x6')](this),this['handleTimeout']['bind'](this));};Agent['prototype'][_0xd55e('0xa')]=function(_0x367b25){if(_0x367b25){setTimeout(this[_0xd55e('0x5')][_0xd55e('0x6')](this),0x3e8);_0x367b25['done']();}};Agent[_0xd55e('0xb')]['handleRun']=function(_0x240c74){logger['info'](_0xd55e('0xc'),this['squeue']['id'],this[_0xd55e('0xd')]['id']);if(_[_0xd55e('0xe')](this[_0xd55e('0xf')]['agents'][this[_0xd55e('0xd')]['id']])){logger[_0xd55e('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xd55e('0x4')]['id'],this[_0xd55e('0xd')]['id']);this[_0xd55e('0xa')](_0x240c74);}else{if(this[_0xd55e('0x3')][_0xd55e('0x11')]||util[_0xd55e('0x12')](this[_0xd55e('0x4')]['id'],this[_0xd55e('0xf')][_0xd55e('0x13')][this[_0xd55e('0xd')]['id']],this[_0xd55e('0x4')][_0xd55e('0x14')],![])){util[_0xd55e('0x15')](this[_0xd55e('0x4')]['id'],this[_0xd55e('0xf')][_0xd55e('0x13')][this['agent']['id']],_0xd55e('0x16')+(this[_0xd55e('0x3')][_0xd55e('0x11')]?_0xd55e('0x17'):''));this[_0xd55e('0xf')][_0xd55e('0x13')][this[_0xd55e('0xd')]['id']][_0xd55e('0x18')]=!![];this['realtime'][_0xd55e('0x13')][this[_0xd55e('0xd')]['id']][_0xd55e('0x19')]=undefined;util[_0xd55e('0x1a')](this['notificationId'],this[_0xd55e('0x4')]['id'],this[_0xd55e('0xf')][_0xd55e('0x13')][this['agent']['id']],null,this[_0xd55e('0x3')]);}else{this[_0xd55e('0xa')](_0x240c74);}}};Agent['prototype'][_0xd55e('0x8')]=function(){logger[_0xd55e('0x10')](_0xd55e('0x1b'),this[_0xd55e('0x4')]['id'],this[_0xd55e('0xd')]['id']);if(_['isNil'](this[_0xd55e('0xf')][_0xd55e('0x13')][this[_0xd55e('0xd')]['id']])){return logger[_0xd55e('0x10')](_0xd55e('0x1c'),this[_0xd55e('0x4')]['id'],this[_0xd55e('0xd')]['id']);}else{util['writeLog'](this[_0xd55e('0x4')]['id'],this[_0xd55e('0xf')][_0xd55e('0x13')][this[_0xd55e('0xd')]['id']],_0xd55e('0x1d'));this[_0xd55e('0xf')][_0xd55e('0x13')][this[_0xd55e('0xd')]['id']]['busy']=![];this[_0xd55e('0xf')][_0xd55e('0x13')][this[_0xd55e('0xd')]['id']][_0xd55e('0x19')]=undefined;util[_0xd55e('0x1e')](this[_0xd55e('0x1f')],this['squeue']['id'],this[_0xd55e('0xf')][_0xd55e('0x13')][this['agent']['id']],null,this['routing']);}};function agent(_0x4bead9,_0x1fdd60,_0x16da2b,_0xea9b1d){return new Agent(_0x4bead9,_0x1fdd60,_0x16da2b,_0xea9b1d);}module[_0xd55e('0x20')]=agent;
\ No newline at end of file
index ebe2427..e56d089 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb84e=['realtime','floor','qtimeout','atimeout','module','length','push','handleRun','bind','handleTimeout','drained','prototype','done','isNil','Agents','agents','info','isAgentAvailable','channel','RINGING','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20EMPTY','writeLog','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue'];(function(_0x4421d3,_0x415b69){var _0x7e6c6d=function(_0x25854e){while(--_0x25854e){_0x4421d3['push'](_0x4421d3['shift']());}};_0x7e6c6d(++_0x415b69);}(_0xb84e,0xbf));var _0xeb84=function(_0x199c03,_0x3254aa){_0x199c03=_0x199c03-0x0;var _0x11a7d4=_0xb84e[_0x199c03];return _0x11a7d4;};'use strict';var _=require('lodash');var uuid=require(_0xeb84('0x0'));var util=require(_0xeb84('0x1'));var logger=require(_0xeb84('0x2'))(_0xeb84('0x3'));var Beepall=function(_0x49570e,_0x512746,_0xade213,_0x35f52d){this[_0xeb84('0x4')]=uuid['v4']();this[_0xeb84('0x5')]=_0x49570e;this[_0xeb84('0x6')]=_0x512746;this[_0xeb84('0x7')]=_0xade213;this['routing']=_0x35f52d;this['length']=Math[_0xeb84('0x8')](this['squeue'][_0xeb84('0x9')]/this[_0xeb84('0x5')][_0xeb84('0xa')]);this[_0xeb84('0xb')]=this['squeue'][_0xeb84('0x9')]%this[_0xeb84('0x5')][_0xeb84('0xa')];for(var _0x2d81e5=0x0;_0x2d81e5<this[_0xeb84('0xc')];_0x2d81e5+=0x1){this[_0xeb84('0x5')][_0xeb84('0xd')](this[_0xeb84('0xe')][_0xeb84('0xf')](this),this[_0xeb84('0x10')][_0xeb84('0xf')](this));}this[_0xeb84('0x5')][_0xeb84('0xd')](this['handleRun']['bind'](this),this[_0xeb84('0x10')][_0xeb84('0xf')](this),this[_0xeb84('0xb')]);this[_0xeb84('0x5')]['on'](_0xeb84('0x11'),this[_0xeb84('0x10')]['bind'](this));};Beepall[_0xeb84('0x12')][_0xeb84('0xd')]=function(){this[_0xeb84('0x5')][_0xeb84('0xd')](this['handleRun'][_0xeb84('0xf')](this),this[_0xeb84('0x10')][_0xeb84('0xf')](this));};Beepall[_0xeb84('0x12')][_0xeb84('0x13')]=function(_0x502e75){if(_0x502e75){setTimeout(this[_0xeb84('0xd')]['bind'](this),0x3e8);_0x502e75[_0xeb84('0x13')]();}};Beepall[_0xeb84('0x12')][_0xeb84('0xe')]=function(_0x4bb89d){var _0x568a75=!![];if(!_[_0xeb84('0x14')](this[_0xeb84('0x6')])&&!_[_0xeb84('0x14')](this[_0xeb84('0x6')][_0xeb84('0x15')])&&this[_0xeb84('0x6')][_0xeb84('0x15')][_0xeb84('0xc')]>0x0){for(var _0x109fb0=0x0,_0xee87d7;_0x109fb0<this[_0xeb84('0x6')][_0xeb84('0x15')][_0xeb84('0xc')];_0x109fb0+=0x1){_0xee87d7=this[_0xeb84('0x6')][_0xeb84('0x15')][_0x109fb0]['id'];if(_[_0xeb84('0x14')](this['realtime'][_0xeb84('0x16')][_0xee87d7])){logger[_0xeb84('0x17')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xeb84('0x5')]['id'],_0xee87d7);}else{if(util[_0xeb84('0x18')](this[_0xeb84('0x5')]['id'],this[_0xeb84('0x7')][_0xeb84('0x16')][_0xee87d7],this[_0xeb84('0x5')][_0xeb84('0x19')],!![])){_0x568a75=![];util['writeLog'](this['squeue']['id'],this[_0xeb84('0x7')][_0xeb84('0x16')][_0xee87d7],_0xeb84('0x1a'));this[_0xeb84('0x7')][_0xeb84('0x16')][_0xee87d7][_0xeb84('0x1b')]=!![];this[_0xeb84('0x7')][_0xeb84('0x16')][_0xee87d7][_0xeb84('0x1c')]=this[_0xeb84('0x6')][_0xeb84('0x1d')];util[_0xeb84('0x1e')](this[_0xeb84('0x4')],this[_0xeb84('0x5')]['id'],this['realtime'][_0xeb84('0x16')][_0xee87d7],this[_0xeb84('0x6')],this[_0xeb84('0x3')]);}}}if(_0x568a75){this[_0xeb84('0x13')](_0x4bb89d);}}else{logger[_0xeb84('0x17')](_0xeb84('0x1f'),this[_0xeb84('0x5')]['id']);this[_0xeb84('0x13')](_0x4bb89d);}};Beepall[_0xeb84('0x12')][_0xeb84('0x10')]=function(){if(!_[_0xeb84('0x14')](this['queue'])&&!_['isNil'](this[_0xeb84('0x6')]['Agents'])){for(var _0x1e241e=0x0,_0x29b32d;_0x1e241e<this[_0xeb84('0x6')][_0xeb84('0x15')]['length'];_0x1e241e+=0x1){_0x29b32d=this['queue'][_0xeb84('0x15')][_0x1e241e]['id'];if(_[_0xeb84('0x14')](this['realtime'][_0xeb84('0x16')][_0x29b32d])){logger[_0xeb84('0x17')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xeb84('0x5')]['id'],_0x29b32d);}else{util[_0xeb84('0x20')](this['squeue']['id'],this[_0xeb84('0x7')]['agents'][_0x29b32d],'TIMEOUT');this[_0xeb84('0x7')]['agents'][_0x29b32d][_0xeb84('0x1b')]=![];this[_0xeb84('0x7')][_0xeb84('0x16')][_0x29b32d][_0xeb84('0x1c')]=undefined;util['hideNotification'](this[_0xeb84('0x4')],this['squeue']['id'],this[_0xeb84('0x7')][_0xeb84('0x16')][_0x29b32d],this[_0xeb84('0x6')],this[_0xeb84('0x3')]);}}}};function beepall(_0x3171fc,_0x29ec00,_0x3ee579,_0x6d0df7){return new Beepall(_0x3171fc,_0x29ec00,_0x3ee579,_0x6d0df7);}module['exports']=beepall;
\ No newline at end of file
+var _0x8164=['name','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','realtime','floor','squeue','qtimeout','atimeout','module','push','bind','drained','handleTimeout','prototype','handleRun','done','isNil','queue','Agents','length','agents','info','isAgentAvailable','channel','writeLog','busy'];(function(_0xd1229b,_0x40a504){var _0x542cd8=function(_0x39ef3c){while(--_0x39ef3c){_0xd1229b['push'](_0xd1229b['shift']());}};_0x542cd8(++_0x40a504);}(_0x8164,0x170));var _0x4816=function(_0x4ad553,_0x586c5a){_0x4ad553=_0x4ad553-0x0;var _0x136750=_0x8164[_0x4ad553];return _0x136750;};'use strict';var _=require(_0x4816('0x0'));var uuid=require(_0x4816('0x1'));var util=require(_0x4816('0x2'));var logger=require('../../../../../config/logger')(_0x4816('0x3'));var Beepall=function(_0x1e9b3f,_0x568058,_0x109370,_0x4a6265){this[_0x4816('0x4')]=uuid['v4']();this['squeue']=_0x1e9b3f;this['queue']=_0x568058;this[_0x4816('0x5')]=_0x109370;this['routing']=_0x4a6265;this['length']=Math[_0x4816('0x6')](this[_0x4816('0x7')][_0x4816('0x8')]/this[_0x4816('0x7')][_0x4816('0x9')]);this[_0x4816('0xa')]=this[_0x4816('0x7')][_0x4816('0x8')]%this[_0x4816('0x7')]['atimeout'];for(var _0x3ea583=0x0;_0x3ea583<this['length'];_0x3ea583+=0x1){this[_0x4816('0x7')][_0x4816('0xb')](this['handleRun'][_0x4816('0xc')](this),this['handleTimeout']['bind'](this));}this[_0x4816('0x7')]['push'](this['handleRun'][_0x4816('0xc')](this),this['handleTimeout'][_0x4816('0xc')](this),this[_0x4816('0xa')]);this[_0x4816('0x7')]['on'](_0x4816('0xd'),this[_0x4816('0xe')][_0x4816('0xc')](this));};Beepall[_0x4816('0xf')][_0x4816('0xb')]=function(){this[_0x4816('0x7')][_0x4816('0xb')](this[_0x4816('0x10')][_0x4816('0xc')](this),this[_0x4816('0xe')][_0x4816('0xc')](this));};Beepall[_0x4816('0xf')][_0x4816('0x11')]=function(_0x4803d0){if(_0x4803d0){setTimeout(this['push'][_0x4816('0xc')](this),0x3e8);_0x4803d0[_0x4816('0x11')]();}};Beepall[_0x4816('0xf')][_0x4816('0x10')]=function(_0xc8ffd5){var _0x37effd=!![];if(!_[_0x4816('0x12')](this[_0x4816('0x13')])&&!_[_0x4816('0x12')](this['queue'][_0x4816('0x14')])&&this['queue']['Agents'][_0x4816('0x15')]>0x0){for(var _0x11aeab=0x0,_0x5de184;_0x11aeab<this[_0x4816('0x13')]['Agents'][_0x4816('0x15')];_0x11aeab+=0x1){_0x5de184=this[_0x4816('0x13')]['Agents'][_0x11aeab]['id'];if(_['isNil'](this[_0x4816('0x5')][_0x4816('0x16')][_0x5de184])){logger[_0x4816('0x17')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x4816('0x7')]['id'],_0x5de184);}else{if(util[_0x4816('0x18')](this[_0x4816('0x7')]['id'],this[_0x4816('0x5')]['agents'][_0x5de184],this['squeue'][_0x4816('0x19')],!![])){_0x37effd=![];util[_0x4816('0x1a')](this['squeue']['id'],this[_0x4816('0x5')]['agents'][_0x5de184],'RINGING');this[_0x4816('0x5')][_0x4816('0x16')][_0x5de184][_0x4816('0x1b')]=!![];this['realtime'][_0x4816('0x16')][_0x5de184]['busyQueue']=this[_0x4816('0x13')][_0x4816('0x1c')];util['showNotification'](this[_0x4816('0x4')],this[_0x4816('0x7')]['id'],this[_0x4816('0x5')][_0x4816('0x16')][_0x5de184],this[_0x4816('0x13')],this[_0x4816('0x3')]);}}}if(_0x37effd){this[_0x4816('0x11')](_0xc8ffd5);}}else{logger[_0x4816('0x17')](_0x4816('0x1d'),this['squeue']['id']);this[_0x4816('0x11')](_0xc8ffd5);}};Beepall[_0x4816('0xf')]['handleTimeout']=function(){if(!_['isNil'](this[_0x4816('0x13')])&&!_[_0x4816('0x12')](this[_0x4816('0x13')][_0x4816('0x14')])){for(var _0x15ba67=0x0,_0x4bc551;_0x15ba67<this['queue']['Agents'][_0x4816('0x15')];_0x15ba67+=0x1){_0x4bc551=this[_0x4816('0x13')][_0x4816('0x14')][_0x15ba67]['id'];if(_[_0x4816('0x12')](this[_0x4816('0x5')][_0x4816('0x16')][_0x4bc551])){logger['info'](_0x4816('0x1e'),this['squeue']['id'],_0x4bc551);}else{util[_0x4816('0x1a')](this[_0x4816('0x7')]['id'],this[_0x4816('0x5')][_0x4816('0x16')][_0x4bc551],_0x4816('0x1f'));this['realtime'][_0x4816('0x16')][_0x4bc551]['busy']=![];this['realtime'][_0x4816('0x16')][_0x4bc551]['busyQueue']=undefined;util['hideNotification'](this['notificationId'],this['squeue']['id'],this[_0x4816('0x5')][_0x4816('0x16')][_0x4bc551],this['queue'],this[_0x4816('0x3')]);}}}};function beepall(_0x235d82,_0x4c990c,_0x227652,_0x34e0f4){return new Beepall(_0x235d82,_0x4c990c,_0x227652,_0x34e0f4);}module[_0x4816('0x20')]=beepall;
\ No newline at end of file
index 5d6342f..6694595 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27a0=['./beepall','./agent','./rrmemory'];(function(_0x3f2915,_0x15767c){var _0x1305d7=function(_0x2715f4){while(--_0x2715f4){_0x3f2915['push'](_0x3f2915['shift']());}};_0x1305d7(++_0x15767c);}(_0x27a0,0xbf));var _0x027a=function(_0x1ac1ae,_0x1aff1e){_0x1ac1ae=_0x1ac1ae-0x0;var _0x42ce70=_0x27a0[_0x1ac1ae];return _0x42ce70;};'use strict';module['exports']={'rrmemory':require(_0x027a('0x0')),'beepall':require(_0x027a('0x1')),'agent':require(_0x027a('0x2'))};
\ No newline at end of file
+var _0xa7e6=['exports','./rrmemory','./beepall','./agent'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xa7e6,0x74));var _0x6a7e=function(_0x4a464e,_0x250abf){_0x4a464e=_0x4a464e-0x0;var _0x54d070=_0xa7e6[_0x4a464e];return _0x54d070;};'use strict';module[_0x6a7e('0x0')]={'rrmemory':require(_0x6a7e('0x1')),'beepall':require(_0x6a7e('0x2')),'agent':require(_0x6a7e('0x3'))};
\ No newline at end of file
index ae2d045..4917f8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cbf=['agentId','mapAgentsId','info','realtime','agents','channel','writeLog','RINGING','busy','name','showNotification','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busyQueue','hideNotification','lodash','uuid','./util','routing','notificationId','squeue','queue','length','floor','qtimeout','atimeout','module','handleRun','handleTimeout','bind','drained','push','done','prototype'];(function(_0x15f607,_0x230ef5){var _0x11205d=function(_0x1f8a20){while(--_0x1f8a20){_0x15f607['push'](_0x15f607['shift']());}};_0x11205d(++_0x230ef5);}(_0x4cbf,0xfd));var _0xf4cb=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x4cbf[_0x3ea913];return _0x2b4f28;};'use strict';var rr=require('rr');var _=require(_0xf4cb('0x0'));var uuid=require(_0xf4cb('0x1'));var util=require(_0xf4cb('0x2'));var logger=require('../../../../../config/logger')(_0xf4cb('0x3'));var RRMemory=function(_0x223d6d,_0x20c4ce,_0xb2197,_0x44f635){this[_0xf4cb('0x4')]=uuid['v4']();this[_0xf4cb('0x5')]=_0x223d6d;this[_0xf4cb('0x6')]=_0x20c4ce;this['realtime']=_0xb2197;this[_0xf4cb('0x3')]=_0x44f635;this[_0xf4cb('0x7')]=Math[_0xf4cb('0x8')](this[_0xf4cb('0x5')][_0xf4cb('0x9')]/this['squeue'][_0xf4cb('0xa')]);this[_0xf4cb('0xb')]=this['squeue'][_0xf4cb('0x9')]%this[_0xf4cb('0x5')][_0xf4cb('0xa')];for(var _0x46eba8=0x0;_0x46eba8<this[_0xf4cb('0x7')];_0x46eba8+=0x1){this['squeue']['push'](this[_0xf4cb('0xc')]['bind'](this),this[_0xf4cb('0xd')][_0xf4cb('0xe')](this));}this[_0xf4cb('0x5')]['push'](this[_0xf4cb('0xc')][_0xf4cb('0xe')](this),this['handleTimeout']['bind'](this),this[_0xf4cb('0xb')]);this['squeue']['on'](_0xf4cb('0xf'),this['handleTimeout'][_0xf4cb('0xe')](this));};RRMemory['prototype'][_0xf4cb('0x10')]=function(){this['squeue']['push'](this['handleRun']['bind'](this),this['handleTimeout'][_0xf4cb('0xe')](this));};RRMemory['prototype'][_0xf4cb('0x11')]=function(_0xc7723){if(_0xc7723){setTimeout(this[_0xf4cb('0x10')]['bind'](this),0xc8);_0xc7723[_0xf4cb('0x11')]();}};RRMemory[_0xf4cb('0x12')][_0xf4cb('0xc')]=function(_0x46f778){this[_0xf4cb('0x13')]=rr(this[_0xf4cb('0x6')][_0xf4cb('0x14')]);logger[_0xf4cb('0x15')]('[%s][QUEUE]\x20try\x20with\x20%s',this[_0xf4cb('0x5')]['id'],this[_0xf4cb('0x13')]);if(_['isNil'](this[_0xf4cb('0x16')]['agents'][this['agentId']])){logger[_0xf4cb('0x15')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xf4cb('0x5')]['id'],this['agentId']);this[_0xf4cb('0x11')](_0x46f778);}else{if(util['isAgentAvailable'](this[_0xf4cb('0x5')]['id'],this['realtime'][_0xf4cb('0x17')][this[_0xf4cb('0x13')]],this[_0xf4cb('0x5')][_0xf4cb('0x18')],!![])){util[_0xf4cb('0x19')](this['squeue']['id'],this[_0xf4cb('0x16')][_0xf4cb('0x17')][this[_0xf4cb('0x13')]],_0xf4cb('0x1a'));this[_0xf4cb('0x16')][_0xf4cb('0x17')][this[_0xf4cb('0x13')]][_0xf4cb('0x1b')]=!![];this[_0xf4cb('0x16')][_0xf4cb('0x17')][this[_0xf4cb('0x13')]]['busyQueue']=this[_0xf4cb('0x6')][_0xf4cb('0x1c')];util[_0xf4cb('0x1d')](this[_0xf4cb('0x4')],this[_0xf4cb('0x5')]['id'],this[_0xf4cb('0x16')]['agents'][this[_0xf4cb('0x13')]],this[_0xf4cb('0x6')],this['routing']);}else{this['done'](_0x46f778);}}};RRMemory['prototype']['handleTimeout']=function(){logger[_0xf4cb('0x15')]('[%s][QUEUE]\x20timeout\x20with\x20%s',this[_0xf4cb('0x5')]['id'],this[_0xf4cb('0x13')]);if(_[_0xf4cb('0x1e')](this[_0xf4cb('0x16')]['agents'][this[_0xf4cb('0x13')]])){logger[_0xf4cb('0x15')](_0xf4cb('0x1f'),this['squeue']['id'],this[_0xf4cb('0x13')]);}else{util['writeLog'](this[_0xf4cb('0x5')]['id'],this[_0xf4cb('0x16')][_0xf4cb('0x17')][this[_0xf4cb('0x13')]],'TIMEOUT');this[_0xf4cb('0x16')]['agents'][this[_0xf4cb('0x13')]]['busy']=![];this[_0xf4cb('0x16')][_0xf4cb('0x17')][this['agentId']][_0xf4cb('0x20')]=undefined;util[_0xf4cb('0x21')](this[_0xf4cb('0x4')],this[_0xf4cb('0x5')]['id'],this[_0xf4cb('0x16')]['agents'][this['agentId']],this['queue'],this['routing']);}};function rrmemory(_0x3a0d51,_0x259169,_0x3d85c0,_0x4d8b21){return new RRMemory(_0x3a0d51,_0x259169,_0x3d85c0,_0x4d8b21);}module['exports']=rrmemory;
\ No newline at end of file
+var _0x6a78=['module','push','handleRun','handleTimeout','bind','drained','prototype','done','agentId','info','isNil','agents','channel','writeLog','RINGING','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20timeout\x20with\x20%s','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','TIMEOUT','hideNotification','exports','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','length','floor','qtimeout','atimeout'];(function(_0x5bd730,_0x1b6e90){var _0x178d57=function(_0x19de05){while(--_0x19de05){_0x5bd730['push'](_0x5bd730['shift']());}};_0x178d57(++_0x1b6e90);}(_0x6a78,0xea));var _0x86a7=function(_0x426a8d,_0x1ce178){_0x426a8d=_0x426a8d-0x0;var _0x549515=_0x6a78[_0x426a8d];return _0x549515;};'use strict';var rr=require('rr');var _=require('lodash');var uuid=require('uuid');var util=require(_0x86a7('0x0'));var logger=require(_0x86a7('0x1'))(_0x86a7('0x2'));var RRMemory=function(_0x271890,_0xe1e1c7,_0x4649b4,_0x305023){this[_0x86a7('0x3')]=uuid['v4']();this[_0x86a7('0x4')]=_0x271890;this[_0x86a7('0x5')]=_0xe1e1c7;this[_0x86a7('0x6')]=_0x4649b4;this[_0x86a7('0x2')]=_0x305023;this[_0x86a7('0x7')]=Math[_0x86a7('0x8')](this[_0x86a7('0x4')][_0x86a7('0x9')]/this[_0x86a7('0x4')][_0x86a7('0xa')]);this[_0x86a7('0xb')]=this[_0x86a7('0x4')][_0x86a7('0x9')]%this[_0x86a7('0x4')][_0x86a7('0xa')];for(var _0x5d98b6=0x0;_0x5d98b6<this[_0x86a7('0x7')];_0x5d98b6+=0x1){this[_0x86a7('0x4')][_0x86a7('0xc')](this[_0x86a7('0xd')]['bind'](this),this[_0x86a7('0xe')][_0x86a7('0xf')](this));}this[_0x86a7('0x4')][_0x86a7('0xc')](this[_0x86a7('0xd')][_0x86a7('0xf')](this),this[_0x86a7('0xe')][_0x86a7('0xf')](this),this[_0x86a7('0xb')]);this[_0x86a7('0x4')]['on'](_0x86a7('0x10'),this[_0x86a7('0xe')][_0x86a7('0xf')](this));};RRMemory[_0x86a7('0x11')]['push']=function(){this['squeue'][_0x86a7('0xc')](this[_0x86a7('0xd')]['bind'](this),this['handleTimeout'][_0x86a7('0xf')](this));};RRMemory[_0x86a7('0x11')]['done']=function(_0x511aa6){if(_0x511aa6){setTimeout(this[_0x86a7('0xc')][_0x86a7('0xf')](this),0xc8);_0x511aa6[_0x86a7('0x12')]();}};RRMemory['prototype']['handleRun']=function(_0x2e8f4c){this[_0x86a7('0x13')]=rr(this[_0x86a7('0x5')]['mapAgentsId']);logger[_0x86a7('0x14')]('[%s][QUEUE]\x20try\x20with\x20%s',this['squeue']['id'],this[_0x86a7('0x13')]);if(_[_0x86a7('0x15')](this[_0x86a7('0x6')][_0x86a7('0x16')][this[_0x86a7('0x13')]])){logger[_0x86a7('0x14')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x86a7('0x4')]['id'],this[_0x86a7('0x13')]);this[_0x86a7('0x12')](_0x2e8f4c);}else{if(util['isAgentAvailable'](this['squeue']['id'],this[_0x86a7('0x6')][_0x86a7('0x16')][this[_0x86a7('0x13')]],this[_0x86a7('0x4')][_0x86a7('0x17')],!![])){util[_0x86a7('0x18')](this['squeue']['id'],this[_0x86a7('0x6')]['agents'][this['agentId']],_0x86a7('0x19'));this[_0x86a7('0x6')][_0x86a7('0x16')][this[_0x86a7('0x13')]][_0x86a7('0x1a')]=!![];this[_0x86a7('0x6')][_0x86a7('0x16')][this[_0x86a7('0x13')]][_0x86a7('0x1b')]=this[_0x86a7('0x5')][_0x86a7('0x1c')];util[_0x86a7('0x1d')](this[_0x86a7('0x3')],this[_0x86a7('0x4')]['id'],this[_0x86a7('0x6')][_0x86a7('0x16')][this[_0x86a7('0x13')]],this['queue'],this[_0x86a7('0x2')]);}else{this[_0x86a7('0x12')](_0x2e8f4c);}}};RRMemory['prototype'][_0x86a7('0xe')]=function(){logger[_0x86a7('0x14')](_0x86a7('0x1e'),this[_0x86a7('0x4')]['id'],this['agentId']);if(_[_0x86a7('0x15')](this['realtime']['agents'][this[_0x86a7('0x13')]])){logger['info'](_0x86a7('0x1f'),this[_0x86a7('0x4')]['id'],this[_0x86a7('0x13')]);}else{util[_0x86a7('0x18')](this[_0x86a7('0x4')]['id'],this[_0x86a7('0x6')][_0x86a7('0x16')][this[_0x86a7('0x13')]],_0x86a7('0x20'));this['realtime']['agents'][this['agentId']][_0x86a7('0x1a')]=![];this[_0x86a7('0x6')][_0x86a7('0x16')][this['agentId']]['busyQueue']=undefined;util[_0x86a7('0x21')](this['notificationId'],this[_0x86a7('0x4')]['id'],this[_0x86a7('0x6')][_0x86a7('0x16')][this['agentId']],this[_0x86a7('0x5')],this[_0x86a7('0x2')]);}};function rrmemory(_0x543e46,_0x2b0fc0,_0x435b26,_0x478262){return new RRMemory(_0x543e46,_0x2b0fc0,_0x435b26,_0x478262);}module[_0x86a7('0x22')]=rrmemory;
\ No newline at end of file
index 84641a7..0847031 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c56=['getMustacheRender','notificationTemplate','error','[%s][QUEUE]\x20%s','message','save','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','online','OFFLINE','Pause','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','util','../utils','mustache','../../../../../config/logger','routing','socket.io-emitter','localhost','emit','format','user:%s','name','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue'];(function(_0x4bd521,_0x4a0f6a){var _0x2a38b9=function(_0x33b21b){while(--_0x33b21b){_0x4bd521['push'](_0x4bd521['shift']());}};_0x2a38b9(++_0x4a0f6a);}(_0x2c56,0xd7));var _0x62c5=function(_0x1c5f81,_0xeaa6f3){_0x1c5f81=_0x1c5f81-0x0;var _0x92f750=_0x2c56[_0x1c5f81];return _0x92f750;};'use strict';var util=require(_0x62c5('0x0'));var utils=require(_0x62c5('0x1'));var Mustache=require(_0x62c5('0x2'));var logger=require(_0x62c5('0x3'))(_0x62c5('0x4'));var io=require(_0x62c5('0x5'))({'host':_0x62c5('0x6'),'port':0x18eb});function emit(_0x483c59,_0x4ffbff,_0x5aa306){io['to'](_0x483c59)[_0x62c5('0x7')](_0x4ffbff,_0x5aa306);}function sendNotification(_0x36379b,_0x2e33cb,_0x4bf0e6,_0x1c5e5a,_0x5e653e,_0x15ac99){io['to'](util[_0x62c5('0x8')](_0x62c5('0x9'),_0x1c5e5a[_0x62c5('0xa')]))[_0x62c5('0x7')](_0x62c5('0xb'),_0x1c5e5a);var _0x18835e=_0x15ac99||{};var _0xa3716e=_0x4bf0e6[_0x62c5('0xc')]('.');var _0x4dc9b3={'uniqueid':_0x2e33cb,'channel':_0xa3716e[0x0],'id':_0xa3716e[0x1],'title':_0xa3716e[0x0]+_0x62c5('0xd'),'interactionId':_0xa3716e[0x2],'queue':_0x5e653e?_0x5e653e[_0x62c5('0xa')]:null,'sound':_0x18835e[_0x62c5('0xe')][_0x62c5('0xf')],'shake':_0x18835e[_0x62c5('0xe')][_0x62c5('0x10')]};try{if(!_0x18835e[_0x62c5('0x11')]){_0x18835e['body']={};}if(_0x5e653e){_0x18835e[_0x62c5('0x11')][_0x62c5('0x12')]=_0x5e653e;}else if(_0x18835e['body'][_0x62c5('0x12')]){delete _0x18835e[_0x62c5('0x11')][_0x62c5('0x12')];}_0x4dc9b3['msg']=utils[_0x62c5('0x13')](_0x18835e[_0x62c5('0xe')][_0x62c5('0x14')],_0x18835e);}catch(_0x27e9f8){_0x4dc9b3['msg']='I\x20can\x27t\x20render\x20your\x20template';logger[_0x62c5('0x15')](util[_0x62c5('0x8')](_0x62c5('0x16'),_0x2e33cb,_0x27e9f8[_0x62c5('0x17')]));}io['to'](util[_0x62c5('0x8')](_0x62c5('0x9'),_0x1c5e5a[_0x62c5('0xa')]))[_0x62c5('0x7')](util[_0x62c5('0x8')]('notification:%s',_0x36379b?_0x62c5('0x18'):'remove'),_0x4dc9b3);}function writeLog(_0x5f4e55,_0x43a411,_0x11dd69){return logger[_0x62c5('0x19')](util[_0x62c5('0x8')](_0x62c5('0x1a'),_0x5f4e55,_0x43a411[_0x62c5('0xa')],_0x11dd69));}exports[_0x62c5('0x1b')]=function(_0x29286f,_0x1ddb6c,_0x24b1c3,_0x482d4){if(_0x1ddb6c[_0x62c5('0x1c')]){writeLog(_0x29286f,_0x1ddb6c,'BUSY');return![];}if(!_0x1ddb6c[_0x62c5('0x1d')]){writeLog(_0x29286f,_0x1ddb6c,_0x62c5('0x1e'));return![];}if(_0x1ddb6c[_0x24b1c3+_0x62c5('0x1f')]){writeLog(_0x29286f,_0x1ddb6c,'PAUSE');return![];}if(_0x482d4&&_0x1ddb6c[_0x62c5('0x20')](_0x24b1c3+_0x62c5('0x21'))&&_0x1ddb6c['hasOwnProperty'](_0x24b1c3+'CurrentCapacity')){if(_0x1ddb6c[_0x24b1c3+_0x62c5('0x21')]>0x0&&_0x1ddb6c[_0x24b1c3+_0x62c5('0x22')]>=_0x1ddb6c[_0x24b1c3+_0x62c5('0x21')]){writeLog(_0x29286f,_0x1ddb6c,_0x24b1c3[_0x62c5('0x23')]()+_0x62c5('0x24'));return![];}}return!![];};exports[_0x62c5('0x25')]=function(_0x3bc3f7,_0x3daf5b,_0x242eb4,_0x422336,_0x44026d){return sendNotification(!![],_0x3bc3f7,_0x3daf5b,_0x242eb4,_0x422336,_0x44026d);};exports[_0x62c5('0x26')]=function(_0x3b5de2,_0x254c44,_0x4c58f7,_0x388778,_0xcd81c1){return sendNotification(![],_0x3b5de2,_0x254c44,_0x4c58f7,_0x388778,_0xcd81c1);};exports['writeLog']=writeLog;
\ No newline at end of file
+var _0x5919=['hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','util','../utils','mustache','../../../../../config/logger','routing','socket.io-emitter','localhost','emit','format','user:save','split','\x20interaction','name','notificationSound','account','notificationShake','body','queue','getMustacheRender','notificationTemplate','error','[%s][QUEUE]\x20%s','message','user:%s','save','info','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause'];(function(_0x53a4de,_0xff041d){var _0x304c3c=function(_0x4d2f9a){while(--_0x4d2f9a){_0x53a4de['push'](_0x53a4de['shift']());}};_0x304c3c(++_0xff041d);}(_0x5919,0x18d));var _0x9591=function(_0x48cc96,_0x242d75){_0x48cc96=_0x48cc96-0x0;var _0x5cd2d0=_0x5919[_0x48cc96];return _0x5cd2d0;};'use strict';var util=require(_0x9591('0x0'));var utils=require(_0x9591('0x1'));var Mustache=require(_0x9591('0x2'));var logger=require(_0x9591('0x3'))(_0x9591('0x4'));var io=require(_0x9591('0x5'))({'host':_0x9591('0x6'),'port':0x18eb});function emit(_0x5ae1b9,_0x58160d,_0x1910e6){io['to'](_0x5ae1b9)[_0x9591('0x7')](_0x58160d,_0x1910e6);}function sendNotification(_0xa56b83,_0xddd89b,_0x38d6bb,_0x455e16,_0x55b201,_0x585b6b){io['to'](util[_0x9591('0x8')]('user:%s',_0x455e16['name']))[_0x9591('0x7')](_0x9591('0x9'),_0x455e16);var _0x356bde=_0x585b6b||{};var _0x58e36f=_0x38d6bb[_0x9591('0xa')]('.');var _0x23deff={'uniqueid':_0xddd89b,'channel':_0x58e36f[0x0],'id':_0x58e36f[0x1],'title':_0x58e36f[0x0]+_0x9591('0xb'),'interactionId':_0x58e36f[0x2],'queue':_0x55b201?_0x55b201[_0x9591('0xc')]:null,'sound':_0x356bde['account'][_0x9591('0xd')],'shake':_0x356bde[_0x9591('0xe')][_0x9591('0xf')]};try{if(!_0x356bde[_0x9591('0x10')]){_0x356bde['body']={};}if(_0x55b201){_0x356bde['body']['queue']=_0x55b201;}else if(_0x356bde[_0x9591('0x10')]['queue']){delete _0x356bde['body'][_0x9591('0x11')];}_0x23deff['msg']=utils[_0x9591('0x12')](_0x356bde[_0x9591('0xe')][_0x9591('0x13')],_0x356bde);}catch(_0x2dbffe){_0x23deff['msg']='I\x20can\x27t\x20render\x20your\x20template';logger[_0x9591('0x14')](util['format'](_0x9591('0x15'),_0xddd89b,_0x2dbffe[_0x9591('0x16')]));}io['to'](util['format'](_0x9591('0x17'),_0x455e16[_0x9591('0xc')]))[_0x9591('0x7')](util['format']('notification:%s',_0xa56b83?_0x9591('0x18'):'remove'),_0x23deff);}function writeLog(_0x1f093b,_0x25782b,_0x4c0a9d){return logger[_0x9591('0x19')](util[_0x9591('0x8')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x1f093b,_0x25782b[_0x9591('0xc')],_0x4c0a9d));}exports[_0x9591('0x1a')]=function(_0x5c0177,_0xb41964,_0xe8c16e,_0x2b03c8){if(_0xb41964[_0x9591('0x1b')]){writeLog(_0x5c0177,_0xb41964,_0x9591('0x1c'));return![];}if(!_0xb41964[_0x9591('0x1d')]){writeLog(_0x5c0177,_0xb41964,_0x9591('0x1e'));return![];}if(_0xb41964[_0xe8c16e+_0x9591('0x1f')]){writeLog(_0x5c0177,_0xb41964,'PAUSE');return![];}if(_0x2b03c8&&_0xb41964[_0x9591('0x20')](_0xe8c16e+_0x9591('0x21'))&&_0xb41964[_0x9591('0x20')](_0xe8c16e+_0x9591('0x22'))){if(_0xb41964[_0xe8c16e+_0x9591('0x21')]>0x0&&_0xb41964[_0xe8c16e+_0x9591('0x22')]>=_0xb41964[_0xe8c16e+_0x9591('0x21')]){writeLog(_0x5c0177,_0xb41964,_0xe8c16e[_0x9591('0x23')]()+_0x9591('0x24'));return![];}}return!![];};exports[_0x9591('0x25')]=function(_0x41167f,_0x5d5276,_0x55e52c,_0x17b10b,_0x2d88c7){return sendNotification(!![],_0x41167f,_0x5d5276,_0x55e52c,_0x17b10b,_0x2d88c7);};exports[_0x9591('0x26')]=function(_0x156b34,_0x4d0191,_0x207651,_0x53f4f8,_0x1ed477){return sendNotification(![],_0x156b34,_0x4d0191,_0x207651,_0x53f4f8,_0x1ed477);};exports['writeLog']=writeLog;
\ No newline at end of file
index 7392883..a147582 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f4b=['replace','isEmpty','body','isObject','stringify','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s'];(function(_0x34c221,_0x3493d1){var _0x56ec8f=function(_0x2f1adc){while(--_0x2f1adc){_0x34c221['push'](_0x34c221['shift']());}};_0x56ec8f(++_0x3493d1);}(_0x1f4b,0xa6));var _0xb1f4=function(_0x575228,_0x3f9bc1){_0x575228=_0x575228-0x0;var _0x4cb11e=_0x1f4b[_0x575228];return _0x4cb11e;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require('lodash');var utils=require('./utils');var logger=require(_0xb1f4('0x0'))(_0xb1f4('0x1'));var system=schema({'command':{'type':'string','required':!![],'message':_0xb1f4('0x2')}});exports[_0xb1f4('0x3')]=function(_0x413221,_0x534e0a){return function(_0x3b1e98){try{var _0x31c39f={'command':_0x534e0a[0x0]};var _0x4c481e=system[_0xb1f4('0x4')](_0x31c39f,{'typecast':!![]});if(_0x4c481e['length']){logger[_0xb1f4('0x5')](_0xb1f4('0x6'),_0x413221,_[_0xb1f4('0x7')](_0x4c481e,_0xb1f4('0x8'))[_0xb1f4('0x9')](',\x20'));logger[_0xb1f4('0xa')](_0xb1f4('0xb'),_0x413221);_0x3b1e98[_0xb1f4('0xc')]();}else{var _0x47cdbd=this;var _0x4000af=utils[_0xb1f4('0xd')](_0x534e0a[0x0],this);logger[_0xb1f4('0xa')](_0xb1f4('0xe'),_0x413221,_0x4000af);sh[_0xb1f4('0xf')](_[_0xb1f4('0x10')](_0x4000af),function(_0xf0ab15,_0x139e47){logger[_0xb1f4('0xa')](_0xb1f4('0x11'),_0x413221,_0xf0ab15);if(_0xf0ab15==0x0){var _0x409a4f=_0x139e47[_0xb1f4('0x12')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x534e0a[0x1])||_[_0xb1f4('0x13')](_0x534e0a[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x413221);_0x47cdbd[_0xb1f4('0x14')][_0x534e0a[0x1]]=_0x409a4f;}else{logger[_0xb1f4('0xa')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x413221,_0x534e0a[0x1],_0x409a4f);_0x47cdbd[_0xb1f4('0x14')][_0x534e0a[0x1]]=_0x409a4f;}}_0x3b1e98[_0xb1f4('0xc')]();});}}catch(_0x5bd0b3){logger[_0xb1f4('0x5')](_0xb1f4('0x6'),_0x413221,_[_0xb1f4('0x15')](_0x5bd0b3)?JSON[_0xb1f4('0x16')](_0x5bd0b3):_0x5bd0b3);logger[_0xb1f4('0xa')](_0xb1f4('0xb'),_0x413221);_0x3b1e98[_0xb1f4('0xc')]();}};};
\ No newline at end of file
+var _0x7dad=['[%s][SYSTEM]\x20%s','isObject','stringify','validate','lodash','./utils','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','map','message','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','info','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','next'];(function(_0x436251,_0x44ebf9){var _0x5ca831=function(_0xbddf8e){while(--_0xbddf8e){_0x436251['push'](_0x436251['shift']());}};_0x5ca831(++_0x44ebf9);}(_0x7dad,0x12e));var _0xd7da=function(_0x1ffa93,_0x29a3b5){_0x1ffa93=_0x1ffa93-0x0;var _0x213789=_0x7dad[_0x1ffa93];return _0x213789;};'use strict';var schema=require(_0xd7da('0x0'));var sh=require('shelljs');var _=require(_0xd7da('0x1'));var utils=require(_0xd7da('0x2'));var logger=require('../../../../config/logger')(_0xd7da('0x3'));var system=schema({'command':{'type':_0xd7da('0x4'),'required':!![],'message':_0xd7da('0x5')}});exports['consequence']=function(_0x6d2945,_0x16fb12){return function(_0x1652c2){try{var _0x314413={'command':_0x16fb12[0x0]};var _0x3c545d=system[_0xd7da('0x0')](_0x314413,{'typecast':!![]});if(_0x3c545d['length']){logger[_0xd7da('0x6')]('[%s][SYSTEM]\x20%s',_0x6d2945,_[_0xd7da('0x7')](_0x3c545d,_0xd7da('0x8'))['join'](',\x20'));logger['info'](_0xd7da('0x9'),_0x6d2945);_0x1652c2['next']();}else{var _0x47f5cb=this;var _0xae5ada=utils['getMustacheRender'](_0x16fb12[0x0],this);logger[_0xd7da('0xa')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x6d2945,_0xae5ada);sh[_0xd7da('0xb')](_[_0xd7da('0xc')](_0xae5ada),function(_0x2cc5a0,_0x5daa3e){logger[_0xd7da('0xa')](_0xd7da('0xd'),_0x6d2945,_0x2cc5a0);if(_0x2cc5a0==0x0){var _0x482efe=_0x5daa3e[_0xd7da('0xe')](/(\r\n|\n|\r)/gm,'');if(_[_0xd7da('0xf')](_0x16fb12[0x1])||_[_0xd7da('0x10')](_0x16fb12[0x1])){logger[_0xd7da('0xa')](_0xd7da('0x11'),_0x6d2945);_0x47f5cb[_0xd7da('0x12')][_0x16fb12[0x1]]=_0x482efe;}else{logger[_0xd7da('0xa')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x6d2945,_0x16fb12[0x1],_0x482efe);_0x47f5cb[_0xd7da('0x12')][_0x16fb12[0x1]]=_0x482efe;}}_0x1652c2[_0xd7da('0x13')]();});}}catch(_0x2b3d30){logger[_0xd7da('0x6')](_0xd7da('0x14'),_0x6d2945,_[_0xd7da('0x15')](_0x2b3d30)?JSON[_0xd7da('0x16')](_0x2b3d30):_0x2b3d30);logger[_0xd7da('0xa')](_0xd7da('0x9'),_0x6d2945);_0x1652c2[_0xd7da('0x13')]();}};};
\ No newline at end of file
index b947be1..3c8dfe1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x382fb0,_0xb69b82){var _0x1f8418=function(_0x41c065){while(--_0x41c065){_0x382fb0['push'](_0x382fb0['shift']());}};_0x1f8418(++_0xb69b82);}(_0x7a54,0x106));var _0x47a5=function(_0x239eb7,_0x246049){_0x239eb7=_0x239eb7-0x0;var _0x10985d=_0x7a54[_0x239eb7];return _0x10985d;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};};
\ No newline at end of file
+var _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x553a37,_0x137a47){var _0x328ab7=function(_0xc15892){while(--_0xc15892){_0x553a37['push'](_0x553a37['shift']());}};_0x328ab7(++_0x137a47);}(_0x7a54,0x106));var _0x47a5=function(_0x2d6779,_0x369f01){_0x2d6779=_0x2d6779-0x0;var _0x875196=_0x7a54[_0x2d6779];return _0x875196;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};};
\ No newline at end of file
index 738d3dc..9f70c88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f38=['lodash','exports','render','body','contact','message','account','interaction','mustache'];(function(_0x4b146a,_0x584daf){var _0x1244bc=function(_0x15e940){while(--_0x15e940){_0x4b146a['push'](_0x4b146a['shift']());}};_0x1244bc(++_0x584daf);}(_0x1f38,0xd7));var _0x81f3=function(_0x47c958,_0x3cfe09){_0x47c958=_0x47c958-0x0;var _0x573eab=_0x1f38[_0x47c958];return _0x573eab;};'use strict';var Mustache=require(_0x81f3('0x0'));var _=require(_0x81f3('0x1'));module[_0x81f3('0x2')]={'getMustacheRender':function(_0x3f167c,_0x261dcf){return Mustache[_0x81f3('0x3')](_0x3f167c,_['merge'](_0x261dcf[_0x81f3('0x4')],{'contact':_0x261dcf[_0x81f3('0x5')],'message':_0x261dcf[_0x81f3('0x6')],'account':_0x261dcf[_0x81f3('0x7')],'interaction':_0x261dcf[_0x81f3('0x8')],'list':_0x261dcf['list']}))||'';}};
\ No newline at end of file
+var _0xb2ff=['message','account','interaction','list','mustache','lodash','body'];(function(_0x2b6c93,_0x163a8b){var _0x5cfd8e=function(_0xe1548a){while(--_0xe1548a){_0x2b6c93['push'](_0x2b6c93['shift']());}};_0x5cfd8e(++_0x163a8b);}(_0xb2ff,0x123));var _0xfb2f=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb2ff[_0x167cc1];return _0x10bc4b;};'use strict';var Mustache=require(_0xfb2f('0x0'));var _=require(_0xfb2f('0x1'));module['exports']={'getMustacheRender':function(_0x3e4c2f,_0x54e80d){return Mustache['render'](_0x3e4c2f,_['merge'](_0x54e80d[_0xfb2f('0x2')],{'contact':_0x54e80d['contact'],'message':_0x54e80d[_0xfb2f('0x3')],'account':_0x54e80d[_0xfb2f('0x4')],'interaction':_0x54e80d[_0xfb2f('0x5')],'list':_0x54e80d[_0xfb2f('0x6')]}))||'';}};
\ No newline at end of file
index 166c2c6..fc28903 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe409=['waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','values','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','path','jayson/promise','bluebird','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','interval','listen','rules','channel','message','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','push','dialogflow','slice','tag','TagId','%s:%s:%s','condition','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','No\x20applications\x20to\x20execute','interaction','QueueReport','update','catch','message\x20is\x20empty','agents','agent','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','loggedIn','name','paused'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xe409,0xbb));var _0x9e40=function(_0x496935,_0x3906e6){_0x496935=_0x496935-0x0;var _0x453c9d=_0xe409[_0x496935];return _0x453c9d;};'use strict';var _=require('lodash');var util=require(_0x9e40('0x0'));var path=require(_0x9e40('0x1'));var fs=require('fs');var jayson=require(_0x9e40('0x2'));var BPromise=require(_0x9e40('0x3'));var uuid=require('uuid');var config=require(_0x9e40('0x4'));var logger=require(_0x9e40('0x5'))(_0x9e40('0x6'));var rpc={'openchannelQueueReport':require(_0x9e40('0x7'))};var rpc={'openchannelQueueReport':require(_0x9e40('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x9e40('0x8')),'smsQueueReport':require(_0x9e40('0x9')),'faxQueueReport':require(_0x9e40('0xa'))};var RuleEngine=require(_0x9e40('0xb'));function getId(_0x385a5b,_0x25c05a,_0x52e2b6){return util[_0x9e40('0xc')](_0x9e40('0xd'),_0x385a5b,_0x25c05a||0x0,_0x52e2b6||0x0);}function getIntervals(_0x4bc69d,_0x5eb1ea){var _0x4d957a=[];if(!_[_0x9e40('0xe')](_0x5eb1ea[_0x9e40('0xf')])&&!_[_0x9e40('0xe')](_0x4bc69d[_0x5eb1ea['IntervalId']])&&!_[_0x9e40('0xe')](_0x4bc69d[_0x5eb1ea['IntervalId']]['Intervals'])){_0x4d957a=_[_0x9e40('0x10')](_0x4bc69d[_0x5eb1ea[_0x9e40('0xf')]]['Intervals'],_0x9e40('0x11'));}else if(!_['isNil'](_0x5eb1ea[_0x9e40('0x11')])){_0x4d957a=[_0x5eb1ea['interval']];}return _0x4d957a;}exports[_0x9e40('0x12')]=function(_0x478629){_0x478629[_0x9e40('0x13')]={};return new BPromise(function(_0x4c5e4a,_0x17c689){var _0x20da68={'Start':function(_0x5beae2){var _0x393276=this;return new Promise(function(_0x382997,_0x3cec42){if(_0x5beae2){try{var _0x4a4035=[];var _0x4500e7=getId(_0x5beae2[_0x9e40('0x14')],_0x5beae2[_0x9e40('0x15')]?_0x5beae2[_0x9e40('0x15')]['id']:0x0,_0x5beae2['interaction']?_0x5beae2['interaction']['id']:0x0);if(_0x5beae2[_0x9e40('0x16')]&&_['isArray'](_0x5beae2[_0x9e40('0x16')])&&_0x5beae2[_0x9e40('0x16')]['length']){for(var _0x3205c6=0x0;_0x3205c6<_0x5beae2[_0x9e40('0x16')][_0x9e40('0x17')];_0x3205c6+=0x1){var _0x11622d=_0x5beae2[_0x9e40('0x16')][_0x3205c6];if(fs[_0x9e40('0x18')](path[_0x9e40('0x19')](__dirname,_0x9e40('0x16'),_0x11622d[_0x9e40('0x1a')]+_0x9e40('0x1b')))){var _0x22acf6=[];switch(_0x11622d[_0x9e40('0x1a')][_0x9e40('0x1c')]()){case _0x9e40('0x1d'):var _0x3f5654=_0x11622d[_0x9e40('0x1e')][_0x9e40('0x1f')](',');_0x22acf6[_0x9e40('0x20')](_0x3f5654[0x0]);_0x22acf6[_0x9e40('0x20')](_0x3f5654['slice'](0x1,_0x3f5654['length'])[_0x9e40('0x19')](','));break;case _0x9e40('0x21'):var _0x3f5654=_0x11622d[_0x9e40('0x1e')]['split'](',');_0x22acf6[_0x9e40('0x20')](_0x3f5654[0x0]);_0x22acf6[_0x9e40('0x20')](_0x3f5654[0x1]);_0x22acf6['push'](_0x3f5654[_0x9e40('0x22')](0x2,_0x3f5654['length'])[_0x9e40('0x19')](','));break;case _0x9e40('0x15'):_0x22acf6['push'](_0x11622d[_0x9e40('0x1e')]);break;case _0x9e40('0x23'):_0x22acf6[_0x9e40('0x20')](_0x11622d[_0x9e40('0x24')]);_0x22acf6[_0x9e40('0x20')](_0x11622d['appdata']);break;default:_0x22acf6=_['isNil'](_0x11622d[_0x9e40('0x1e')])?[]:_0x11622d[_0x9e40('0x1e')][_0x9e40('0x1f')](',');}var _0xddd9ca={'id':util[_0x9e40('0xc')](_0x9e40('0x25'),_0x4500e7,_0x11622d['id'],_0x11622d['app']),'condition':require('./interval')[_0x9e40('0x26')](_0x4500e7,getIntervals(_0x478629[_0x9e40('0x27')],_0x11622d),_0x478629),'consequence':require(_0x9e40('0x28')+_0x11622d[_0x9e40('0x1a')])[_0x9e40('0x29')](_0x4500e7,_0x22acf6,_0x478629,_0x5beae2),'p':_0x11622d['priority']||0x0};logger[_0x9e40('0x2a')](_0x9e40('0x2b'),_0xddd9ca['id'],_0x9e40('0x2c'),getIntervals(_0x478629[_0x9e40('0x27')],_0x11622d)[_0x9e40('0x19')](_0x9e40('0x2d')));_0x4a4035[_0x9e40('0x20')](_0xddd9ca);}else{logger[_0x9e40('0x2e')](_0x9e40('0x2f'),path[_0x9e40('0x19')](__dirname,'applications',_0x11622d[_0x9e40('0x1a')]+_0x9e40('0x1b')));}}_0x478629['rules'][_0x4500e7]=new RuleEngine(_0x4a4035);_0x478629[_0x9e40('0x13')][_0x4500e7][_0x9e40('0x30')](_0x5beae2,function(_0x347ed4){logger['info'](_0x9e40('0x31'),JSON[_0x9e40('0x32')](_0x347ed4[_0x9e40('0x33')]));if(_0x478629[_0x9e40('0x13')][_0x4500e7]){delete _0x478629[_0x9e40('0x13')][_0x4500e7];}});return _0x382997({'code':0xc8,'message':_0x5beae2});}else{logger[_0x9e40('0x2a')](_0x9e40('0x34'));return _0x382997({'code':0xc8,'message':_0x5beae2});}}catch(_0x1b6752){logger['error'](JSON[_0x9e40('0x32')](_0x1b6752));return _0x3cec42(_0x393276[_0x9e40('0x2e')](0x1f4,_0x1b6752));}}return _0x3cec42('routing\x20is\x20empty');});},'AcceptMessage':function(_0x5a9452){var _0x3d129c=this;return new Promise(function(_0x1d1512,_0x4c204c){if(_0x5a9452[_0x9e40('0x15')]&&_0x5a9452[_0x9e40('0x15')]['id']){try{var _0x509c8c=getId(_0x5a9452[_0x9e40('0x14')],_0x5a9452[_0x9e40('0x15')]?_0x5a9452[_0x9e40('0x15')]['id']:0x0,_0x5a9452['interaction']?_0x5a9452[_0x9e40('0x35')]['id']:0x0);if(_0x478629[_0x9e40('0x13')][_0x509c8c]){delete _0x478629[_0x9e40('0x13')][_0x509c8c];if(rpc[_0x5a9452[_0x9e40('0x14')]+_0x9e40('0x36')]){rpc[_0x5a9452[_0x9e40('0x14')]+_0x9e40('0x36')][_0x9e40('0x37')](_0x509c8c,{'UserId':_0x5a9452[_0x9e40('0x15')]['UserId']})[_0x9e40('0x38')](function(_0x26675f){logger['error']('error\x20update\x20queue\x20report');});}}return _0x1d1512({'code':0xc8,'message':_0x5a9452});}catch(_0x49d738){logger['error'](JSON[_0x9e40('0x32')](_0x49d738));return _0x4c204c(_0x3d129c['error'](0x1f4,_0x49d738));}}logger[_0x9e40('0x2e')]('message\x20is\x20empty');return _0x4c204c(_0x3d129c[_0x9e40('0x2e')](0x1f4,_0x9e40('0x39')));});},'RejectMessage':function(_0x2849c5){var _0x4d98ed=this;return new Promise(function(_0x5065eb,_0x34c9eb){if(_0x2849c5['agent']&&_0x2849c5['agent']['id']){try{if(_0x478629[_0x9e40('0x3a')][_0x2849c5[_0x9e40('0x3b')]['id']]){_0x478629[_0x9e40('0x3a')][_0x2849c5[_0x9e40('0x3b')]['id']][_0x9e40('0x3c')]=![];_0x478629[_0x9e40('0x3a')][_0x2849c5[_0x9e40('0x3b')]['id']][_0x9e40('0x3d')]=undefined;}return _0x5065eb({'code':0xc8,'message':_0x2849c5});}catch(_0x5bdecb){logger['error'](JSON[_0x9e40('0x32')](_0x5bdecb));return _0x34c9eb(_0x4d98ed[_0x9e40('0x2e')](0x1f4,_0x5bdecb));}}logger[_0x9e40('0x2e')](_0x9e40('0x39'));return _0x34c9eb(_0x4d98ed['error'](0x1f4,_0x9e40('0x39')));});},'AbandonInteraction':function(_0x556eab){var _0x4193a7=this;return new Promise(function(_0x3e82e8,_0x6dd8c0){if(_0x556eab[_0x9e40('0x14')]&&_0x556eab[_0x9e40('0x35')]&&_0x556eab['interaction']['id']){try{var _0x4cddb6=getId(_0x556eab[_0x9e40('0x14')],_0x556eab['message']?_0x556eab[_0x9e40('0x15')]['id']:0x0,_0x556eab['interaction']?_0x556eab[_0x9e40('0x35')]['id']:0x0);if(_0x478629[_0x9e40('0x13')][_0x4cddb6]){delete _0x478629['rules'][_0x4cddb6];}return _0x3e82e8({'code':0xc8,'message':_0x556eab});}catch(_0x15512f){logger[_0x9e40('0x2e')](JSON[_0x9e40('0x32')](_0x15512f));return _0x6dd8c0(_0x4193a7[_0x9e40('0x2e')](0x1f4,_0x15512f));}}logger[_0x9e40('0x2e')](_0x9e40('0x39'));return _0x6dd8c0(_0x4193a7[_0x9e40('0x2e')](0x1f4,_0x9e40('0x39')));});},'AgentCapacity':function(_0x5b52bd){var _0x1a7377=this;return new Promise(function(_0x1c9f0d,_0x22471b){if(_0x478629[_0x9e40('0x3a')][_0x9e40('0x3e')](_0x5b52bd['id'])){for(var _0x5b0f85 in _0x5b52bd[_0x9e40('0x3f')]){if(_0x5b52bd[_0x9e40('0x3f')][_0x9e40('0x3e')](_0x5b0f85)){if(_0x478629[_0x9e40('0x3a')][_0x5b52bd['id']]['hasOwnProperty'](_0x5b0f85+'CurrentCapacity')){_0x478629[_0x9e40('0x3a')][_0x5b52bd['id']][_0x5b0f85+_0x9e40('0x40')]=parseInt(_0x5b52bd[_0x9e40('0x3f')][_0x5b0f85],0xa);_0x478629[_0x9e40('0x3a')][_0x5b52bd['id']][_0x9e40('0x41')]();}}}return _0x1c9f0d({'code':0xc8,'message':_0x478629['agents'][_0x5b52bd['id']]});}else{return _0x22471b(_0x1a7377[_0x9e40('0x2e')](0x1f4,_0x9e40('0x42')));}});},'Agents':function(_0x12edd4){return new Promise(function(_0x161529,_0x2d3270){var _0x5b7619=_['values'](_0x478629[_0x9e40('0x3a')]);_0x161529({'count':_0x5b7619['length'],'rows':_0x5b7619});});},'ChatQueues':function(_0x4b47d2){return new Promise(function(_0x1a689d,_0x24e66e){var _0x6bd0ca=[];for(var _0x5196d8 in _0x478629[_0x9e40('0x43')]){if(_0x478629[_0x9e40('0x43')]['hasOwnProperty'](_0x5196d8)){var _0x3610d2=_0x478629['chatQueues'][_0x5196d8];var _0x4d9797={'id':_0x3610d2['id'],'available':_0x3610d2['available'],'loggedIn':_0x3610d2[_0x9e40('0x44')],'name':_0x3610d2[_0x9e40('0x45')],'paused':_0x3610d2[_0x9e40('0x46')],'waiting':_0x3610d2[_0x9e40('0x47')]};_0x6bd0ca['push'](_0x4d9797);}}_0x1a689d({'count':_0x6bd0ca[_0x9e40('0x17')],'rows':_0x6bd0ca});});},'MailQueues':function(_0x9fd120){return new Promise(function(_0x4252f4,_0x4ae955){var _0x475df6=[];for(var _0x5039e9 in _0x478629[_0x9e40('0x48')]){if(_0x478629[_0x9e40('0x48')][_0x9e40('0x3e')](_0x5039e9)){var _0x26dca1=_0x478629['mailQueues'][_0x5039e9];var _0x5c7851={'id':_0x26dca1['id'],'available':_0x26dca1[_0x9e40('0x49')],'loggedIn':_0x26dca1[_0x9e40('0x44')],'name':_0x26dca1[_0x9e40('0x45')],'paused':_0x26dca1['paused'],'waiting':_0x26dca1[_0x9e40('0x47')]};_0x475df6['push'](_0x5c7851);}}_0x4252f4({'count':_0x475df6[_0x9e40('0x17')],'rows':_0x475df6});});},'OpenchannelQueues':function(_0x4ac494){return new Promise(function(_0x3df799,_0x56946d){var _0x5a6e60=[];for(var _0xec09b in _0x478629['openchannelQueues']){if(_0x478629[_0x9e40('0x4a')][_0x9e40('0x3e')](_0xec09b)){var _0x546e2f=_0x478629['openchannelQueues'][_0xec09b];var _0x35873a={'id':_0x546e2f['id'],'available':_0x546e2f['available'],'loggedIn':_0x546e2f['loggedIn'],'name':_0x546e2f[_0x9e40('0x45')],'paused':_0x546e2f[_0x9e40('0x46')],'waiting':_0x546e2f[_0x9e40('0x47')]};_0x5a6e60[_0x9e40('0x20')](_0x35873a);}}_0x3df799({'count':_0x5a6e60[_0x9e40('0x17')],'rows':_0x5a6e60});});},'SmsQueues':function(_0x176635){return new Promise(function(_0x2485c5,_0x4ddc97){var _0x4cad6f=[];for(var _0x2fb842 in _0x478629['smsQueues']){if(_0x478629[_0x9e40('0x4b')]['hasOwnProperty'](_0x2fb842)){var _0x2a7263=_0x478629[_0x9e40('0x4b')][_0x2fb842];var _0x4605ce={'id':_0x2a7263['id'],'available':_0x2a7263[_0x9e40('0x49')],'loggedIn':_0x2a7263[_0x9e40('0x44')],'name':_0x2a7263['name'],'paused':_0x2a7263['paused'],'waiting':_0x2a7263[_0x9e40('0x47')]};_0x4cad6f[_0x9e40('0x20')](_0x4605ce);}}_0x2485c5({'count':_0x4cad6f[_0x9e40('0x17')],'rows':_0x4cad6f});});},'FaxQueues':function(_0x5c113d){return new Promise(function(_0x12aced,_0x253bed){var _0x4497ff=[];for(var _0x193610 in _0x478629[_0x9e40('0x4c')]){if(_0x478629['faxQueues'][_0x9e40('0x3e')](_0x193610)){var _0xc63c10=_0x478629[_0x9e40('0x4c')][_0x193610];var _0x21a20e={'id':_0xc63c10['id'],'available':_0xc63c10[_0x9e40('0x49')],'loggedIn':_0xc63c10[_0x9e40('0x44')],'name':_0xc63c10[_0x9e40('0x45')],'paused':_0xc63c10[_0x9e40('0x46')],'waiting':_0xc63c10[_0x9e40('0x47')]};_0x4497ff[_0x9e40('0x20')](_0x21a20e);}}_0x12aced({'count':_0x4497ff[_0x9e40('0x17')],'rows':_0x4497ff});});},'ChatQueuesWaitingInteractions':function(_0x58dc23){return new Promise(function(_0x141319,_0xcb47cc){var _0x382c94=_['values'](_0x478629[_0x9e40('0x4d')]);_0x141319({'count':_0x382c94[_0x9e40('0x17')],'rows':_0x382c94});});},'MailQueuesWaitingInteractions':function(_0x160966){return new Promise(function(_0x3b7714,_0x64d8a9){var _0x22d91c=_[_0x9e40('0x4e')](_0x478629['mailQueuesWaitingInteractions']);_0x3b7714({'count':_0x22d91c[_0x9e40('0x17')],'rows':_0x22d91c});});},'OpenchannelQueuesWaitingInteractions':function(_0xdf1c14){return new Promise(function(_0x4dd997,_0x3e51c5){var _0x3ff8aa=_['values'](_0x478629[_0x9e40('0x4f')]);_0x4dd997({'count':_0x3ff8aa[_0x9e40('0x17')],'rows':_0x3ff8aa});});},'SmsQueuesWaitingInteractions':function(_0x167b15){return new Promise(function(_0x3b5007,_0x39f920){var _0xe54d5b=_[_0x9e40('0x4e')](_0x478629[_0x9e40('0x50')]);_0x3b5007({'count':_0xe54d5b['length'],'rows':_0xe54d5b});});},'FaxQueuesWaitingInteractions':function(_0x317406){return new Promise(function(_0x383ad1,_0x4d5e56){var _0x4a3df2=_[_0x9e40('0x4e')](_0x478629[_0x9e40('0x51')]);_0x383ad1({'count':_0x4a3df2[_0x9e40('0x17')],'rows':_0x4a3df2});});}};var _0xa42349=jayson[_0x9e40('0x52')](_0x20da68)[_0x9e40('0x53')]();_0xa42349['on'](_0x9e40('0x2e'),function(_0x13adc4){logger['error'](JSON[_0x9e40('0x32')](_0x13adc4));return _0x17c689(_0x13adc4);});_0xa42349[_0x9e40('0x12')](0x232c,'127.0.0.1',function(){console[_0x9e40('0x54')](_0x9e40('0x55'),0x232c);return _0x4c5e4a('RPC\x20listening\x20on\x20port:'+0x232c);});});};
\ No newline at end of file
+var _0xd0ed=['app','.js','toLowerCase','appdata','split','push','slice','join','tag','TagId','format','%s:%s:%s','condition','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','No\x20applications\x20to\x20execute','routing\x20is\x20empty','QueueReport','update','UserId','message\x20is\x20empty','agent','agents','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','http','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/faxQueueReport','%s.%s.%s','IntervalId','isNil','map','interval','rules','channel','message','interaction','applications','length'];(function(_0x2036c4,_0x4b19d5){var _0x4ca2df=function(_0x389ff4){while(--_0x389ff4){_0x2036c4['push'](_0x2036c4['shift']());}};_0x4ca2df(++_0x4b19d5);}(_0xd0ed,0xdd));var _0xdd0e=function(_0x4bfb94,_0x57e844){_0x4bfb94=_0x4bfb94-0x0;var _0x55bde6=_0xd0ed[_0x4bfb94];return _0x55bde6;};'use strict';var _=require(_0xdd0e('0x0'));var util=require(_0xdd0e('0x1'));var path=require(_0xdd0e('0x2'));var fs=require('fs');var jayson=require(_0xdd0e('0x3'));var BPromise=require(_0xdd0e('0x4'));var uuid=require(_0xdd0e('0x5'));var config=require('../../../config/environment');var logger=require(_0xdd0e('0x6'))(_0xdd0e('0x7'));var rpc={'openchannelQueueReport':require(_0xdd0e('0x8'))};var rpc={'openchannelQueueReport':require(_0xdd0e('0x8')),'mailQueueReport':require(_0xdd0e('0x9')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xdd0e('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x12ecf9,_0x4f81d0,_0x1adcad){return util['format'](_0xdd0e('0xb'),_0x12ecf9,_0x4f81d0||0x0,_0x1adcad||0x0);}function getIntervals(_0x74cbf3,_0x20da85){var _0x5c73c2=[];if(!_['isNil'](_0x20da85[_0xdd0e('0xc')])&&!_[_0xdd0e('0xd')](_0x74cbf3[_0x20da85[_0xdd0e('0xc')]])&&!_[_0xdd0e('0xd')](_0x74cbf3[_0x20da85[_0xdd0e('0xc')]]['Intervals'])){_0x5c73c2=_[_0xdd0e('0xe')](_0x74cbf3[_0x20da85['IntervalId']]['Intervals'],_0xdd0e('0xf'));}else if(!_[_0xdd0e('0xd')](_0x20da85[_0xdd0e('0xf')])){_0x5c73c2=[_0x20da85[_0xdd0e('0xf')]];}return _0x5c73c2;}exports['listen']=function(_0x32cf8e){_0x32cf8e[_0xdd0e('0x10')]={};return new BPromise(function(_0x3aecfc,_0x46f8b8){var _0x29f58f={'Start':function(_0x2bce7c){var _0x2013ed=this;return new Promise(function(_0x120723,_0xdfc3c5){if(_0x2bce7c){try{var _0x35194d=[];var _0x28e281=getId(_0x2bce7c[_0xdd0e('0x11')],_0x2bce7c[_0xdd0e('0x12')]?_0x2bce7c[_0xdd0e('0x12')]['id']:0x0,_0x2bce7c[_0xdd0e('0x13')]?_0x2bce7c[_0xdd0e('0x13')]['id']:0x0);if(_0x2bce7c[_0xdd0e('0x14')]&&_['isArray'](_0x2bce7c[_0xdd0e('0x14')])&&_0x2bce7c[_0xdd0e('0x14')][_0xdd0e('0x15')]){for(var _0x479939=0x0;_0x479939<_0x2bce7c[_0xdd0e('0x14')]['length'];_0x479939+=0x1){var _0x16d02c=_0x2bce7c[_0xdd0e('0x14')][_0x479939];if(fs['existsSync'](path['join'](__dirname,_0xdd0e('0x14'),_0x16d02c[_0xdd0e('0x16')]+_0xdd0e('0x17')))){var _0x367f21=[];switch(_0x16d02c[_0xdd0e('0x16')][_0xdd0e('0x18')]()){case'autoreply':var _0x5b28ac=_0x16d02c[_0xdd0e('0x19')][_0xdd0e('0x1a')](',');_0x367f21[_0xdd0e('0x1b')](_0x5b28ac[0x0]);_0x367f21[_0xdd0e('0x1b')](_0x5b28ac[_0xdd0e('0x1c')](0x1,_0x5b28ac['length'])[_0xdd0e('0x1d')](','));break;case'dialogflow':var _0x5b28ac=_0x16d02c[_0xdd0e('0x19')][_0xdd0e('0x1a')](',');_0x367f21[_0xdd0e('0x1b')](_0x5b28ac[0x0]);_0x367f21['push'](_0x5b28ac[0x1]);_0x367f21[_0xdd0e('0x1b')](_0x5b28ac[_0xdd0e('0x1c')](0x2,_0x5b28ac['length'])[_0xdd0e('0x1d')](','));break;case _0xdd0e('0x12'):_0x367f21[_0xdd0e('0x1b')](_0x16d02c['appdata']);break;case _0xdd0e('0x1e'):_0x367f21[_0xdd0e('0x1b')](_0x16d02c[_0xdd0e('0x1f')]);_0x367f21['push'](_0x16d02c[_0xdd0e('0x19')]);break;default:_0x367f21=_[_0xdd0e('0xd')](_0x16d02c[_0xdd0e('0x19')])?[]:_0x16d02c[_0xdd0e('0x19')][_0xdd0e('0x1a')](',');}var _0x56a39e={'id':util[_0xdd0e('0x20')](_0xdd0e('0x21'),_0x28e281,_0x16d02c['id'],_0x16d02c['app']),'condition':require('./interval')[_0xdd0e('0x22')](_0x28e281,getIntervals(_0x32cf8e['intervals'],_0x16d02c),_0x32cf8e),'consequence':require(_0xdd0e('0x23')+_0x16d02c[_0xdd0e('0x16')])['consequence'](_0x28e281,_0x367f21,_0x32cf8e,_0x2bce7c),'p':_0x16d02c[_0xdd0e('0x24')]||0x0};logger[_0xdd0e('0x25')](_0xdd0e('0x26'),_0x56a39e['id'],_0xdd0e('0x27'),getIntervals(_0x32cf8e['intervals'],_0x16d02c)[_0xdd0e('0x1d')](_0xdd0e('0x28')));_0x35194d[_0xdd0e('0x1b')](_0x56a39e);}else{logger[_0xdd0e('0x29')](_0xdd0e('0x2a'),path[_0xdd0e('0x1d')](__dirname,_0xdd0e('0x14'),_0x16d02c[_0xdd0e('0x16')]+_0xdd0e('0x17')));}}_0x32cf8e['rules'][_0x28e281]=new RuleEngine(_0x35194d);_0x32cf8e[_0xdd0e('0x10')][_0x28e281][_0xdd0e('0x2b')](_0x2bce7c,function(_0x52359f){logger[_0xdd0e('0x25')](_0xdd0e('0x2c'),JSON[_0xdd0e('0x2d')](_0x52359f[_0xdd0e('0x2e')]));if(_0x32cf8e[_0xdd0e('0x10')][_0x28e281]){delete _0x32cf8e['rules'][_0x28e281];}});return _0x120723({'code':0xc8,'message':_0x2bce7c});}else{logger['info'](_0xdd0e('0x2f'));return _0x120723({'code':0xc8,'message':_0x2bce7c});}}catch(_0x3c7ea8){logger[_0xdd0e('0x29')](JSON[_0xdd0e('0x2d')](_0x3c7ea8));return _0xdfc3c5(_0x2013ed['error'](0x1f4,_0x3c7ea8));}}return _0xdfc3c5(_0xdd0e('0x30'));});},'AcceptMessage':function(_0x2ebfa2){var _0x418bab=this;return new Promise(function(_0x14578d,_0x3f6f10){if(_0x2ebfa2[_0xdd0e('0x12')]&&_0x2ebfa2[_0xdd0e('0x12')]['id']){try{var _0x1d3889=getId(_0x2ebfa2[_0xdd0e('0x11')],_0x2ebfa2['message']?_0x2ebfa2[_0xdd0e('0x12')]['id']:0x0,_0x2ebfa2['interaction']?_0x2ebfa2[_0xdd0e('0x13')]['id']:0x0);if(_0x32cf8e[_0xdd0e('0x10')][_0x1d3889]){delete _0x32cf8e[_0xdd0e('0x10')][_0x1d3889];if(rpc[_0x2ebfa2[_0xdd0e('0x11')]+_0xdd0e('0x31')]){rpc[_0x2ebfa2['channel']+'QueueReport'][_0xdd0e('0x32')](_0x1d3889,{'UserId':_0x2ebfa2['message'][_0xdd0e('0x33')]})['catch'](function(_0x1bce20){logger[_0xdd0e('0x29')]('error\x20update\x20queue\x20report');});}}return _0x14578d({'code':0xc8,'message':_0x2ebfa2});}catch(_0x20d419){logger['error'](JSON[_0xdd0e('0x2d')](_0x20d419));return _0x3f6f10(_0x418bab[_0xdd0e('0x29')](0x1f4,_0x20d419));}}logger[_0xdd0e('0x29')]('message\x20is\x20empty');return _0x3f6f10(_0x418bab[_0xdd0e('0x29')](0x1f4,_0xdd0e('0x34')));});},'RejectMessage':function(_0x559c1e){var _0x2a0e8f=this;return new Promise(function(_0x42eb33,_0x5969af){if(_0x559c1e[_0xdd0e('0x35')]&&_0x559c1e[_0xdd0e('0x35')]['id']){try{if(_0x32cf8e[_0xdd0e('0x36')][_0x559c1e[_0xdd0e('0x35')]['id']]){_0x32cf8e[_0xdd0e('0x36')][_0x559c1e[_0xdd0e('0x35')]['id']]['busy']=![];_0x32cf8e[_0xdd0e('0x36')][_0x559c1e['agent']['id']][_0xdd0e('0x37')]=undefined;}return _0x42eb33({'code':0xc8,'message':_0x559c1e});}catch(_0x3b66c9){logger[_0xdd0e('0x29')](JSON[_0xdd0e('0x2d')](_0x3b66c9));return _0x5969af(_0x2a0e8f[_0xdd0e('0x29')](0x1f4,_0x3b66c9));}}logger[_0xdd0e('0x29')](_0xdd0e('0x34'));return _0x5969af(_0x2a0e8f[_0xdd0e('0x29')](0x1f4,_0xdd0e('0x34')));});},'AbandonInteraction':function(_0x2977e6){var _0x30584a=this;return new Promise(function(_0x1cdb75,_0x627092){if(_0x2977e6[_0xdd0e('0x11')]&&_0x2977e6['interaction']&&_0x2977e6['interaction']['id']){try{var _0x302f67=getId(_0x2977e6['channel'],_0x2977e6['message']?_0x2977e6[_0xdd0e('0x12')]['id']:0x0,_0x2977e6[_0xdd0e('0x13')]?_0x2977e6['interaction']['id']:0x0);if(_0x32cf8e['rules'][_0x302f67]){delete _0x32cf8e[_0xdd0e('0x10')][_0x302f67];}return _0x1cdb75({'code':0xc8,'message':_0x2977e6});}catch(_0x4d6f11){logger['error'](JSON[_0xdd0e('0x2d')](_0x4d6f11));return _0x627092(_0x30584a[_0xdd0e('0x29')](0x1f4,_0x4d6f11));}}logger[_0xdd0e('0x29')]('message\x20is\x20empty');return _0x627092(_0x30584a['error'](0x1f4,_0xdd0e('0x34')));});},'AgentCapacity':function(_0xaf6bf2){var _0x2fcc48=this;return new Promise(function(_0x4bcaa4,_0x3a6fb3){if(_0x32cf8e[_0xdd0e('0x36')][_0xdd0e('0x38')](_0xaf6bf2['id'])){for(var _0x1312fd in _0xaf6bf2[_0xdd0e('0x39')]){if(_0xaf6bf2[_0xdd0e('0x39')]['hasOwnProperty'](_0x1312fd)){if(_0x32cf8e['agents'][_0xaf6bf2['id']][_0xdd0e('0x38')](_0x1312fd+_0xdd0e('0x3a'))){_0x32cf8e[_0xdd0e('0x36')][_0xaf6bf2['id']][_0x1312fd+'CurrentCapacity']=parseInt(_0xaf6bf2['capacity'][_0x1312fd],0xa);_0x32cf8e[_0xdd0e('0x36')][_0xaf6bf2['id']][_0xdd0e('0x3b')]();}}}return _0x4bcaa4({'code':0xc8,'message':_0x32cf8e[_0xdd0e('0x36')][_0xaf6bf2['id']]});}else{return _0x3a6fb3(_0x2fcc48[_0xdd0e('0x29')](0x1f4,_0xdd0e('0x3c')));}});},'Agents':function(_0x1baab1){return new Promise(function(_0xe33f3f,_0xabdb2a){var _0x606f2f=_[_0xdd0e('0x3d')](_0x32cf8e[_0xdd0e('0x36')]);_0xe33f3f({'count':_0x606f2f[_0xdd0e('0x15')],'rows':_0x606f2f});});},'ChatQueues':function(_0x4451c7){return new Promise(function(_0x3e8799,_0x169fd1){var _0x4b6f78=[];for(var _0x10fd71 in _0x32cf8e['chatQueues']){if(_0x32cf8e[_0xdd0e('0x3e')][_0xdd0e('0x38')](_0x10fd71)){var _0x447dc2=_0x32cf8e[_0xdd0e('0x3e')][_0x10fd71];var _0x13c205={'id':_0x447dc2['id'],'available':_0x447dc2[_0xdd0e('0x3f')],'loggedIn':_0x447dc2[_0xdd0e('0x40')],'name':_0x447dc2[_0xdd0e('0x41')],'paused':_0x447dc2[_0xdd0e('0x42')],'waiting':_0x447dc2[_0xdd0e('0x43')]};_0x4b6f78[_0xdd0e('0x1b')](_0x13c205);}}_0x3e8799({'count':_0x4b6f78['length'],'rows':_0x4b6f78});});},'MailQueues':function(_0x48a132){return new Promise(function(_0x21d103,_0x5bef57){var _0x1eed71=[];for(var _0x450b04 in _0x32cf8e[_0xdd0e('0x44')]){if(_0x32cf8e[_0xdd0e('0x44')][_0xdd0e('0x38')](_0x450b04)){var _0x1663c4=_0x32cf8e['mailQueues'][_0x450b04];var _0x4bfe06={'id':_0x1663c4['id'],'available':_0x1663c4['available'],'loggedIn':_0x1663c4[_0xdd0e('0x40')],'name':_0x1663c4[_0xdd0e('0x41')],'paused':_0x1663c4['paused'],'waiting':_0x1663c4[_0xdd0e('0x43')]};_0x1eed71['push'](_0x4bfe06);}}_0x21d103({'count':_0x1eed71[_0xdd0e('0x15')],'rows':_0x1eed71});});},'OpenchannelQueues':function(_0x5505c4){return new Promise(function(_0x18d0a4,_0x28b032){var _0x46e6b2=[];for(var _0x3ff58d in _0x32cf8e[_0xdd0e('0x45')]){if(_0x32cf8e[_0xdd0e('0x45')][_0xdd0e('0x38')](_0x3ff58d)){var _0x23980e=_0x32cf8e[_0xdd0e('0x45')][_0x3ff58d];var _0x15b5e9={'id':_0x23980e['id'],'available':_0x23980e['available'],'loggedIn':_0x23980e[_0xdd0e('0x40')],'name':_0x23980e[_0xdd0e('0x41')],'paused':_0x23980e[_0xdd0e('0x42')],'waiting':_0x23980e[_0xdd0e('0x43')]};_0x46e6b2[_0xdd0e('0x1b')](_0x15b5e9);}}_0x18d0a4({'count':_0x46e6b2[_0xdd0e('0x15')],'rows':_0x46e6b2});});},'SmsQueues':function(_0x2aa946){return new Promise(function(_0x5bf4a3,_0x570ec0){var _0x2b57eb=[];for(var _0x3dbd72 in _0x32cf8e[_0xdd0e('0x46')]){if(_0x32cf8e[_0xdd0e('0x46')][_0xdd0e('0x38')](_0x3dbd72)){var _0x39fba7=_0x32cf8e['smsQueues'][_0x3dbd72];var _0x7c19b0={'id':_0x39fba7['id'],'available':_0x39fba7['available'],'loggedIn':_0x39fba7[_0xdd0e('0x40')],'name':_0x39fba7[_0xdd0e('0x41')],'paused':_0x39fba7[_0xdd0e('0x42')],'waiting':_0x39fba7[_0xdd0e('0x43')]};_0x2b57eb[_0xdd0e('0x1b')](_0x7c19b0);}}_0x5bf4a3({'count':_0x2b57eb['length'],'rows':_0x2b57eb});});},'FaxQueues':function(_0x4ab17a){return new Promise(function(_0xa5258b,_0x37ea57){var _0x3d3b74=[];for(var _0x5b248 in _0x32cf8e[_0xdd0e('0x47')]){if(_0x32cf8e[_0xdd0e('0x47')]['hasOwnProperty'](_0x5b248)){var _0x1f38f4=_0x32cf8e['faxQueues'][_0x5b248];var _0x12311a={'id':_0x1f38f4['id'],'available':_0x1f38f4[_0xdd0e('0x3f')],'loggedIn':_0x1f38f4[_0xdd0e('0x40')],'name':_0x1f38f4[_0xdd0e('0x41')],'paused':_0x1f38f4['paused'],'waiting':_0x1f38f4[_0xdd0e('0x43')]};_0x3d3b74['push'](_0x12311a);}}_0xa5258b({'count':_0x3d3b74['length'],'rows':_0x3d3b74});});},'ChatQueuesWaitingInteractions':function(_0x33a81b){return new Promise(function(_0x2e8210,_0x35c961){var _0x523a0a=_[_0xdd0e('0x3d')](_0x32cf8e[_0xdd0e('0x48')]);_0x2e8210({'count':_0x523a0a[_0xdd0e('0x15')],'rows':_0x523a0a});});},'MailQueuesWaitingInteractions':function(_0x333db5){return new Promise(function(_0x5c2a9b,_0x422742){var _0x315ba9=_[_0xdd0e('0x3d')](_0x32cf8e[_0xdd0e('0x49')]);_0x5c2a9b({'count':_0x315ba9['length'],'rows':_0x315ba9});});},'OpenchannelQueuesWaitingInteractions':function(_0x5e569b){return new Promise(function(_0x25524a,_0x29f689){var _0x3118e1=_[_0xdd0e('0x3d')](_0x32cf8e[_0xdd0e('0x4a')]);_0x25524a({'count':_0x3118e1['length'],'rows':_0x3118e1});});},'SmsQueuesWaitingInteractions':function(_0x25be33){return new Promise(function(_0x431334,_0x3003c8){var _0x11440b=_[_0xdd0e('0x3d')](_0x32cf8e['smsQueuesWaitingInteractions']);_0x431334({'count':_0x11440b[_0xdd0e('0x15')],'rows':_0x11440b});});},'FaxQueuesWaitingInteractions':function(_0x1603a4){return new Promise(function(_0x341c00,_0x335fe6){var _0x6c477f=_['values'](_0x32cf8e['faxQueuesWaitingInteractions']);_0x341c00({'count':_0x6c477f[_0xdd0e('0x15')],'rows':_0x6c477f});});}};var _0x7b3bb2=jayson['server'](_0x29f58f)[_0xdd0e('0x4b')]();_0x7b3bb2['on'](_0xdd0e('0x29'),function(_0x15a6e9){logger[_0xdd0e('0x29')](JSON['stringify'](_0x15a6e9));return _0x46f8b8(_0x15a6e9);});_0x7b3bb2[_0xdd0e('0x4c')](0x232c,_0xdd0e('0x4d'),function(){console[_0xdd0e('0x4e')](_0xdd0e('0x4f'),0x232c);return _0x3aecfc(_0xdd0e('0x50')+0x232c);});});};
\ No newline at end of file
index c4ddfdf..b316b1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb907=['some','info','\x20|\x20','when','log','[%s][INTERVAL]\x20%s\x20%s','join','util','bluebird','lodash','../../../config/logger','routing','client','http','request','then','error','result','catch','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','iftime\x20%s','message','indexOf','true','[%s][INTERVAL]\x20%s'];(function(_0x10e09a,_0xc2cd22){var _0x235b16=function(_0x596c17){while(--_0x596c17){_0x10e09a['push'](_0x10e09a['shift']());}};_0x235b16(++_0xc2cd22);}(_0xb907,0x1d7));var _0x7b90=function(_0x1d9c4e,_0x78df8c){_0x1d9c4e=_0x1d9c4e-0x0;var _0x489a19=_0xb907[_0x1d9c4e];return _0x489a19;};'use strict';var util=require(_0x7b90('0x0'));var BPromise=require(_0x7b90('0x1'));var jayson=require('jayson/promise');var _=require(_0x7b90('0x2'));var logger=require(_0x7b90('0x3'))(_0x7b90('0x4'));var client=jayson[_0x7b90('0x5')][_0x7b90('0x6')]({'port':0x232a});function request(_0x45b80e,_0x2f1c08){return new BPromise(function(_0x401f3f,_0x5fa857){return client[_0x7b90('0x7')](_0x45b80e,_0x2f1c08)[_0x7b90('0x8')](function(_0x4d87e9){if(_0x4d87e9[_0x7b90('0x9')]){return _0x5fa857(_0x4d87e9[_0x7b90('0x9')]['message']);}else{return _0x401f3f(_0x4d87e9[_0x7b90('0xa')]);}})[_0x7b90('0xb')](function(_0x299cc5){return _0x5fa857(_0x299cc5);});});}exports['condition']=function(_0x1e5ba7,_0x3ca817,_0x2228c8){return function(_0xc1308a){if(_0x2228c8['rules']&&!_0x2228c8[_0x7b90('0xc')][_0x1e5ba7]){logger['info'](_0x7b90('0xd'),_0x1e5ba7);return _0xc1308a[_0x7b90('0xe')]();}var _0x154712=[];for(var _0x279a63=0x0;_0x279a63<_0x3ca817[_0x7b90('0xf')];_0x279a63+=0x1){_0x154712['push'](request(_0x7b90('0x10'),{'command':util['format'](_0x7b90('0x11'),_0x3ca817[_0x279a63])})[_0x7b90('0x8')](function(_0x293d4b){return _0x293d4b&&_0x293d4b[_0x7b90('0x12')]&&_0x293d4b[_0x7b90('0x12')][_0x7b90('0x13')](_0x7b90('0x14'))>=0x0?!![]:![];})['catch'](function(_0x466d8a){logger['error'](_0x7b90('0x15'),_0x1e5ba7,_0x3ca817[_0x279a63]);}));}BPromise['all'](_0x154712)[_0x7b90('0x8')](function(_0x13b229){var _0x4af217=_[_0x7b90('0x16')](_0x13b229);logger[_0x7b90('0x17')]('[%s][INTERVAL]\x20%s\x20%s',_0x1e5ba7,_0x3ca817['join'](_0x7b90('0x18')),_0x4af217);_0xc1308a[_0x7b90('0x19')](_0x4af217);})[_0x7b90('0xb')](function(_0x4b97c3){console[_0x7b90('0x1a')](_0x4b97c3);logger[_0x7b90('0x9')](_0x7b90('0x1b'),_0x1e5ba7,_0x3ca817[_0x7b90('0x1c')]('\x20|\x20'),JSON['stringify'](_0x4b97c3));_0xc1308a[_0x7b90('0xe')]();});};};
\ No newline at end of file
+var _0xf2f0=['jayson/promise','lodash','routing','http','then','error','message','result','catch','condition','rules','push','iftime\x20%s','indexOf','true','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','when','log','\x20|\x20','stringify','stop','util','bluebird'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf2f0,0x1ae));var _0x0f2f=function(_0x8343ba,_0x217a01){_0x8343ba=_0x8343ba-0x0;var _0x3b10ff=_0xf2f0[_0x8343ba];return _0x3b10ff;};'use strict';var util=require(_0x0f2f('0x0'));var BPromise=require(_0x0f2f('0x1'));var jayson=require(_0x0f2f('0x2'));var _=require(_0x0f2f('0x3'));var logger=require('../../../config/logger')(_0x0f2f('0x4'));var client=jayson['client'][_0x0f2f('0x5')]({'port':0x232a});function request(_0x3b8eba,_0x2bda4e){return new BPromise(function(_0x5043f0,_0x2a89d8){return client['request'](_0x3b8eba,_0x2bda4e)[_0x0f2f('0x6')](function(_0x3cee43){if(_0x3cee43[_0x0f2f('0x7')]){return _0x2a89d8(_0x3cee43[_0x0f2f('0x7')][_0x0f2f('0x8')]);}else{return _0x5043f0(_0x3cee43[_0x0f2f('0x9')]);}})[_0x0f2f('0xa')](function(_0xe3d092){return _0x2a89d8(_0xe3d092);});});}exports[_0x0f2f('0xb')]=function(_0x120e07,_0x32fec7,_0xc27266){return function(_0x30ea45){if(_0xc27266[_0x0f2f('0xc')]&&!_0xc27266['rules'][_0x120e07]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x120e07);return _0x30ea45['stop']();}var _0x329af8=[];for(var _0x5328bd=0x0;_0x5328bd<_0x32fec7['length'];_0x5328bd+=0x1){_0x329af8[_0x0f2f('0xd')](request('Command',{'command':util['format'](_0x0f2f('0xe'),_0x32fec7[_0x5328bd])})[_0x0f2f('0x6')](function(_0x185c14){return _0x185c14&&_0x185c14[_0x0f2f('0x8')]&&_0x185c14[_0x0f2f('0x8')][_0x0f2f('0xf')](_0x0f2f('0x10'))>=0x0?!![]:![];})[_0x0f2f('0xa')](function(_0xafcba1){logger[_0x0f2f('0x7')]('[%s][INTERVAL]\x20%s',_0x120e07,_0x32fec7[_0x5328bd]);}));}BPromise[_0x0f2f('0x11')](_0x329af8)[_0x0f2f('0x6')](function(_0x57072b){var _0x4d579f=_[_0x0f2f('0x12')](_0x57072b);logger[_0x0f2f('0x13')](_0x0f2f('0x14'),_0x120e07,_0x32fec7[_0x0f2f('0x15')]('\x20|\x20'),_0x4d579f);_0x30ea45[_0x0f2f('0x16')](_0x4d579f);})[_0x0f2f('0xa')](function(_0x535301){console[_0x0f2f('0x17')](_0x535301);logger[_0x0f2f('0x7')]('[%s][INTERVAL]\x20%s\x20%s',_0x120e07,_0x32fec7[_0x0f2f('0x15')](_0x0f2f('0x18')),JSON[_0x0f2f('0x19')](_0x535301));_0x30ea45[_0x0f2f('0x1a')]();});};};
\ No newline at end of file